rterm-backend 2.8.2 → 2.8.4

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;
@@ -11727,9 +11727,20 @@ function loadBetterSqlite3() {
11727
11727
  if (cachedConstructor && cachedPackageName === packageName2) {
11728
11728
  return cachedConstructor;
11729
11729
  }
11730
- cachedConstructor = require2(packageName2);
11731
- cachedPackageName = packageName2;
11732
- return cachedConstructor;
11730
+ try {
11731
+ cachedConstructor = require2(packageName2);
11732
+ cachedPackageName = packageName2;
11733
+ return cachedConstructor;
11734
+ } catch (e) {
11735
+ try {
11736
+ const binaryName = packageName2 === ELECTRON_RUNTIME_PACKAGE_NAME ? "better_sqlite3.node" : "better_sqlite3.node";
11737
+ cachedConstructor = require2(binaryName);
11738
+ cachedPackageName = packageName2;
11739
+ return cachedConstructor;
11740
+ } catch (e2) {
11741
+ throw new Error(`better-sqlite3 is not available (tried npm package '${packageName2}' and embedded binary): ${e instanceof Error ? e.message : String(e)} / ${e2 instanceof Error ? e2.message : String(e2)}`);
11742
+ }
11743
+ }
11733
11744
  }
11734
11745
  function normalizePotentialAsarPath(filePath) {
11735
11746
  return filePath.replace(`${import_node_path3.default.sep}app.asar${import_node_path3.default.sep}`, `${import_node_path3.default.sep}app.asar.unpacked${import_node_path3.default.sep}`).replace(
@@ -11810,7 +11821,9 @@ var init_betterSqlite3Runtime = __esm({
11810
11821
  import_node_path3 = __toESM(require("node:path"), 1);
11811
11822
  import_node_module = require("node:module");
11812
11823
  import_meta3 = {};
11813
- require2 = (0, import_node_module.createRequire)(import_meta3.url);
11824
+ require2 = (0, import_node_module.createRequire)(
11825
+ typeof __filename !== "undefined" ? __filename : import_meta3.url
11826
+ );
11814
11827
  NODE_RUNTIME_PACKAGE_NAME = "better-sqlite3";
11815
11828
  ELECTRON_RUNTIME_PACKAGE_NAME = "better-sqlite3-electron";
11816
11829
  cachedConstructor = null;
@@ -28426,8 +28439,8 @@ var require_pdf_worker = __commonJS({
28426
28439
  if (font.data && (isAddToPathSet || this.options.disableFontFace)) {
28427
28440
  var buildPath = function buildPath2(fontChar) {
28428
28441
  if (!font.renderer.hasBuiltPath(fontChar)) {
28429
- var path31 = font.renderer.getPathJs(fontChar);
28430
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
28442
+ var path32 = font.renderer.getPathJs(fontChar);
28443
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
28431
28444
  }
28432
28445
  };
28433
28446
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -71115,10 +71128,10 @@ var require_pdf = __commonJS({
71115
71128
  ctx.save();
71116
71129
  ctx.beginPath();
71117
71130
  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);
71131
+ var path32 = paths[i];
71132
+ ctx.setTransform.apply(ctx, path32.transform);
71133
+ ctx.translate(path32.x, path32.y);
71134
+ path32.addToPath(ctx, path32.fontSize);
71122
71135
  }
71123
71136
  ctx.restore();
71124
71137
  ctx.clip();
@@ -73311,8 +73324,8 @@ var require_pdf = __commonJS({
73311
73324
  function PDFNodeStreamFsFullReader2(stream) {
73312
73325
  _classCallCheck(this, PDFNodeStreamFsFullReader2);
73313
73326
  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) {
73327
+ var path32 = decodeURI(_this7._url.path);
73328
+ fs22.lstat(path32, function(error40, stat) {
73316
73329
  if (error40) {
73317
73330
  _this7._errored = true;
73318
73331
  _this7._reason = error40;
@@ -73320,7 +73333,7 @@ var require_pdf = __commonJS({
73320
73333
  return;
73321
73334
  }
73322
73335
  _this7._contentLength = stat.size;
73323
- _this7._setReadableStream(fs22.createReadStream(path31));
73336
+ _this7._setReadableStream(fs22.createReadStream(path32));
73324
73337
  _this7._headersCapability.resolve();
73325
73338
  });
73326
73339
  return _this7;
@@ -90630,8 +90643,8 @@ var require_pdf_worker2 = __commonJS({
90630
90643
  if (font.data && (isAddToPathSet || this.options.disableFontFace)) {
90631
90644
  var buildPath = function buildPath2(fontChar) {
90632
90645
  if (!font.renderer.hasBuiltPath(fontChar)) {
90633
- var path31 = font.renderer.getPathJs(fontChar);
90634
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
90646
+ var path32 = font.renderer.getPathJs(fontChar);
90647
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
90635
90648
  }
90636
90649
  };
90637
90650
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -133427,10 +133440,10 @@ var require_pdf2 = __commonJS({
133427
133440
  ctx.save();
133428
133441
  ctx.beginPath();
133429
133442
  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);
133443
+ var path32 = paths[i];
133444
+ ctx.setTransform.apply(ctx, path32.transform);
133445
+ ctx.translate(path32.x, path32.y);
133446
+ path32.addToPath(ctx, path32.fontSize);
133434
133447
  }
133435
133448
  ctx.restore();
133436
133449
  ctx.clip();
@@ -135147,8 +135160,8 @@ var require_pdf2 = __commonJS({
135147
135160
  function PDFNodeStreamFsFullReader2(stream) {
135148
135161
  _classCallCheck(this, PDFNodeStreamFsFullReader2);
135149
135162
  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) {
135163
+ var path32 = decodeURI(_this7._url.path);
135164
+ fs22.lstat(path32, function(error40, stat) {
135152
135165
  if (error40) {
135153
135166
  _this7._errored = true;
135154
135167
  _this7._reason = error40;
@@ -135156,7 +135169,7 @@ var require_pdf2 = __commonJS({
135156
135169
  return;
135157
135170
  }
135158
135171
  _this7._contentLength = stat.size;
135159
- _this7._setReadableStream(fs22.createReadStream(path31));
135172
+ _this7._setReadableStream(fs22.createReadStream(path32));
135160
135173
  _this7._headersCapability.resolve();
135161
135174
  });
135162
135175
  return _this7;
@@ -152733,8 +152746,8 @@ var require_pdf_worker3 = __commonJS({
152733
152746
  if (font.data && (isAddToPathSet || this.options.disableFontFace)) {
152734
152747
  var buildPath = function buildPath2(fontChar) {
152735
152748
  if (!font.renderer.hasBuiltPath(fontChar)) {
152736
- var path31 = font.renderer.getPathJs(fontChar);
152737
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
152749
+ var path32 = font.renderer.getPathJs(fontChar);
152750
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
152738
152751
  }
152739
152752
  };
152740
152753
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -187189,10 +187202,10 @@ var require_pdf3 = __commonJS({
187189
187202
  ctx.save();
187190
187203
  ctx.beginPath();
187191
187204
  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);
187205
+ var path32 = paths[i];
187206
+ ctx.setTransform.apply(ctx, path32.transform);
187207
+ ctx.translate(path32.x, path32.y);
187208
+ path32.addToPath(ctx, path32.fontSize);
187196
187209
  }
187197
187210
  ctx.restore();
187198
187211
  ctx.clip();
@@ -212587,8 +212600,8 @@ var require_pdf_worker4 = __commonJS({
212587
212600
  if (font.data && (isAddToPathSet || this.options.disableFontFace || state.fillColorSpace.name === "Pattern")) {
212588
212601
  var buildPath = function buildPath2(fontChar) {
212589
212602
  if (!font.renderer.hasBuiltPath(fontChar)) {
212590
- var path31 = font.renderer.getPathJs(fontChar);
212591
- _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path31]);
212603
+ var path32 = font.renderer.getPathJs(fontChar);
212604
+ _this5.handler.send("commonobj", [font.loadedName + "_path_" + fontChar, "FontPath", path32]);
212592
212605
  }
212593
212606
  };
212594
212607
  for (var i = 0, ii = glyphs.length; i < ii; i++) {
@@ -244552,10 +244565,10 @@ var require_pdf4 = __commonJS({
244552
244565
  ctx.save();
244553
244566
  ctx.beginPath();
244554
244567
  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);
244568
+ var path32 = paths[i];
244569
+ ctx.setTransform.apply(ctx, path32.transform);
244570
+ ctx.translate(path32.x, path32.y);
244571
+ path32.addToPath(ctx, path32.fontSize);
244559
244572
  }
244560
244573
  ctx.restore();
244561
244574
  ctx.clip();
@@ -250178,11 +250191,11 @@ var require_pdf4 = __commonJS({
250178
250191
  function PDFNodeStreamFsFullReader2(stream) {
250179
250192
  _classCallCheck(this, PDFNodeStreamFsFullReader2);
250180
250193
  var _this7 = _possibleConstructorReturn(this, (PDFNodeStreamFsFullReader2.__proto__ || Object.getPrototypeOf(PDFNodeStreamFsFullReader2)).call(this, stream));
250181
- var path31 = decodeURIComponent(_this7._url.path);
250194
+ var path32 = decodeURIComponent(_this7._url.path);
250182
250195
  if (fileUriRegex.test(_this7._url.href)) {
250183
- path31 = path31.replace(/^\//, "");
250196
+ path32 = path32.replace(/^\//, "");
250184
250197
  }
250185
- fs22.lstat(path31, function(error40, stat) {
250198
+ fs22.lstat(path32, function(error40, stat) {
250186
250199
  if (error40) {
250187
250200
  _this7._errored = true;
250188
250201
  _this7._reason = error40;
@@ -250190,7 +250203,7 @@ var require_pdf4 = __commonJS({
250190
250203
  return;
250191
250204
  }
250192
250205
  _this7._contentLength = stat.size;
250193
- _this7._setReadableStream(fs22.createReadStream(path31));
250206
+ _this7._setReadableStream(fs22.createReadStream(path32));
250194
250207
  _this7._headersCapability.resolve();
250195
250208
  });
250196
250209
  return _this7;
@@ -250202,11 +250215,11 @@ var require_pdf4 = __commonJS({
250202
250215
  function PDFNodeStreamFsRangeReader2(stream, start, end) {
250203
250216
  _classCallCheck(this, PDFNodeStreamFsRangeReader2);
250204
250217
  var _this8 = _possibleConstructorReturn(this, (PDFNodeStreamFsRangeReader2.__proto__ || Object.getPrototypeOf(PDFNodeStreamFsRangeReader2)).call(this, stream));
250205
- var path31 = decodeURIComponent(_this8._url.path);
250218
+ var path32 = decodeURIComponent(_this8._url.path);
250206
250219
  if (fileUriRegex.test(_this8._url.href)) {
250207
- path31 = path31.replace(/^\//, "");
250220
+ path32 = path32.replace(/^\//, "");
250208
250221
  }
250209
- _this8._setReadableStream(fs22.createReadStream(path31, {
250222
+ _this8._setReadableStream(fs22.createReadStream(path32, {
250210
250223
  start,
250211
250224
  end: end - 1
250212
250225
  }));
@@ -259326,8 +259339,8 @@ var require_utils2 = __commonJS({
259326
259339
  }
259327
259340
  return ind;
259328
259341
  }
259329
- function removeDotSegments(path31) {
259330
- let input = path31;
259342
+ function removeDotSegments(path32) {
259343
+ let input = path32;
259331
259344
  const output = [];
259332
259345
  let nextSlash = -1;
259333
259346
  let len = 0;
@@ -259526,8 +259539,8 @@ var require_schemes = __commonJS({
259526
259539
  wsComponent.secure = void 0;
259527
259540
  }
259528
259541
  if (wsComponent.resourceName) {
259529
- const [path31, query] = wsComponent.resourceName.split("?");
259530
- wsComponent.path = path31 && path31 !== "/" ? path31 : void 0;
259542
+ const [path32, query] = wsComponent.resourceName.split("?");
259543
+ wsComponent.path = path32 && path32 !== "/" ? path32 : void 0;
259531
259544
  wsComponent.query = query;
259532
259545
  wsComponent.resourceName = void 0;
259533
259546
  }
@@ -268585,7 +268598,7 @@ var require_windows = __commonJS({
268585
268598
  module2.exports = isexe;
268586
268599
  isexe.sync = sync;
268587
268600
  var fs22 = require("fs");
268588
- function checkPathExt(path31, options) {
268601
+ function checkPathExt(path32, options) {
268589
268602
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
268590
268603
  if (!pathext) {
268591
268604
  return true;
@@ -268596,25 +268609,25 @@ var require_windows = __commonJS({
268596
268609
  }
268597
268610
  for (var i = 0; i < pathext.length; i++) {
268598
268611
  var p = pathext[i].toLowerCase();
268599
- if (p && path31.substr(-p.length).toLowerCase() === p) {
268612
+ if (p && path32.substr(-p.length).toLowerCase() === p) {
268600
268613
  return true;
268601
268614
  }
268602
268615
  }
268603
268616
  return false;
268604
268617
  }
268605
- function checkStat(stat, path31, options) {
268618
+ function checkStat(stat, path32, options) {
268606
268619
  if (!stat.isSymbolicLink() && !stat.isFile()) {
268607
268620
  return false;
268608
268621
  }
268609
- return checkPathExt(path31, options);
268622
+ return checkPathExt(path32, options);
268610
268623
  }
268611
- function isexe(path31, options, cb) {
268612
- fs22.stat(path31, function(er, stat) {
268613
- cb(er, er ? false : checkStat(stat, path31, options));
268624
+ function isexe(path32, options, cb) {
268625
+ fs22.stat(path32, function(er, stat) {
268626
+ cb(er, er ? false : checkStat(stat, path32, options));
268614
268627
  });
268615
268628
  }
268616
- function sync(path31, options) {
268617
- return checkStat(fs22.statSync(path31), path31, options);
268629
+ function sync(path32, options) {
268630
+ return checkStat(fs22.statSync(path32), path32, options);
268618
268631
  }
268619
268632
  }
268620
268633
  });
@@ -268625,13 +268638,13 @@ var require_mode = __commonJS({
268625
268638
  module2.exports = isexe;
268626
268639
  isexe.sync = sync;
268627
268640
  var fs22 = require("fs");
268628
- function isexe(path31, options, cb) {
268629
- fs22.stat(path31, function(er, stat) {
268641
+ function isexe(path32, options, cb) {
268642
+ fs22.stat(path32, function(er, stat) {
268630
268643
  cb(er, er ? false : checkStat(stat, options));
268631
268644
  });
268632
268645
  }
268633
- function sync(path31, options) {
268634
- return checkStat(fs22.statSync(path31), options);
268646
+ function sync(path32, options) {
268647
+ return checkStat(fs22.statSync(path32), options);
268635
268648
  }
268636
268649
  function checkStat(stat, options) {
268637
268650
  return stat.isFile() && checkMode(stat, options);
@@ -268664,7 +268677,7 @@ var require_isexe = __commonJS({
268664
268677
  }
268665
268678
  module2.exports = isexe;
268666
268679
  isexe.sync = sync;
268667
- function isexe(path31, options, cb) {
268680
+ function isexe(path32, options, cb) {
268668
268681
  if (typeof options === "function") {
268669
268682
  cb = options;
268670
268683
  options = {};
@@ -268674,7 +268687,7 @@ var require_isexe = __commonJS({
268674
268687
  throw new TypeError("callback not provided");
268675
268688
  }
268676
268689
  return new Promise(function(resolve2, reject) {
268677
- isexe(path31, options || {}, function(er, is) {
268690
+ isexe(path32, options || {}, function(er, is) {
268678
268691
  if (er) {
268679
268692
  reject(er);
268680
268693
  } else {
@@ -268683,7 +268696,7 @@ var require_isexe = __commonJS({
268683
268696
  });
268684
268697
  });
268685
268698
  }
268686
- core2(path31, options || {}, function(er, is) {
268699
+ core2(path32, options || {}, function(er, is) {
268687
268700
  if (er) {
268688
268701
  if (er.code === "EACCES" || options && options.ignoreErrors) {
268689
268702
  er = null;
@@ -268693,9 +268706,9 @@ var require_isexe = __commonJS({
268693
268706
  cb(er, is);
268694
268707
  });
268695
268708
  }
268696
- function sync(path31, options) {
268709
+ function sync(path32, options) {
268697
268710
  try {
268698
- return core2.sync(path31, options || {});
268711
+ return core2.sync(path32, options || {});
268699
268712
  } catch (er) {
268700
268713
  if (options && options.ignoreErrors || er.code === "EACCES") {
268701
268714
  return false;
@@ -268711,7 +268724,7 @@ var require_isexe = __commonJS({
268711
268724
  var require_which = __commonJS({
268712
268725
  "../../node_modules/which/which.js"(exports2, module2) {
268713
268726
  var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
268714
- var path31 = require("path");
268727
+ var path32 = require("path");
268715
268728
  var COLON = isWindows ? ";" : ":";
268716
268729
  var isexe = require_isexe();
268717
268730
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -268749,7 +268762,7 @@ var require_which = __commonJS({
268749
268762
  return opt.all && found.length ? resolve2(found) : reject(getNotFoundError(cmd));
268750
268763
  const ppRaw = pathEnv[i];
268751
268764
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
268752
- const pCmd = path31.join(pathPart, cmd);
268765
+ const pCmd = path32.join(pathPart, cmd);
268753
268766
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
268754
268767
  resolve2(subStep(p, i, 0));
268755
268768
  });
@@ -268776,7 +268789,7 @@ var require_which = __commonJS({
268776
268789
  for (let i = 0; i < pathEnv.length; i++) {
268777
268790
  const ppRaw = pathEnv[i];
268778
268791
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
268779
- const pCmd = path31.join(pathPart, cmd);
268792
+ const pCmd = path32.join(pathPart, cmd);
268780
268793
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
268781
268794
  for (let j = 0; j < pathExt.length; j++) {
268782
268795
  const cur = p + pathExt[j];
@@ -268824,7 +268837,7 @@ var require_path_key = __commonJS({
268824
268837
  var require_resolveCommand = __commonJS({
268825
268838
  "../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
268826
268839
  "use strict";
268827
- var path31 = require("path");
268840
+ var path32 = require("path");
268828
268841
  var which = require_which();
268829
268842
  var getPathKey = require_path_key();
268830
268843
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -268842,7 +268855,7 @@ var require_resolveCommand = __commonJS({
268842
268855
  try {
268843
268856
  resolved = which.sync(parsed.command, {
268844
268857
  path: env[getPathKey({ env })],
268845
- pathExt: withoutPathExt ? path31.delimiter : void 0
268858
+ pathExt: withoutPathExt ? path32.delimiter : void 0
268846
268859
  });
268847
268860
  } catch (e) {
268848
268861
  } finally {
@@ -268851,7 +268864,7 @@ var require_resolveCommand = __commonJS({
268851
268864
  }
268852
268865
  }
268853
268866
  if (resolved) {
268854
- resolved = path31.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
268867
+ resolved = path32.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
268855
268868
  }
268856
268869
  return resolved;
268857
268870
  }
@@ -268905,8 +268918,8 @@ var require_shebang_command = __commonJS({
268905
268918
  if (!match) {
268906
268919
  return null;
268907
268920
  }
268908
- const [path31, argument] = match[0].replace(/#! ?/, "").split(" ");
268909
- const binary2 = path31.split("/").pop();
268921
+ const [path32, argument] = match[0].replace(/#! ?/, "").split(" ");
268922
+ const binary2 = path32.split("/").pop();
268910
268923
  if (binary2 === "env") {
268911
268924
  return argument;
268912
268925
  }
@@ -268941,7 +268954,7 @@ var require_readShebang = __commonJS({
268941
268954
  var require_parse2 = __commonJS({
268942
268955
  "../../node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
268943
268956
  "use strict";
268944
- var path31 = require("path");
268957
+ var path32 = require("path");
268945
268958
  var resolveCommand = require_resolveCommand();
268946
268959
  var escape2 = require_escape();
268947
268960
  var readShebang = require_readShebang();
@@ -268966,7 +268979,7 @@ var require_parse2 = __commonJS({
268966
268979
  const needsShell = !isExecutableRegExp.test(commandFile);
268967
268980
  if (parsed.options.forceShell || needsShell) {
268968
268981
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
268969
- parsed.command = path31.normalize(parsed.command);
268982
+ parsed.command = path32.normalize(parsed.command);
268970
268983
  parsed.command = escape2.command(parsed.command);
268971
268984
  parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
268972
268985
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -278590,7 +278603,7 @@ var require_ws_transport = __commonJS({
278590
278603
  let protocol;
278591
278604
  let port;
278592
278605
  const host = url2.hostname;
278593
- const path31 = url2.pathname;
278606
+ const path32 = url2.pathname;
278594
278607
  const search = url2.search || "";
278595
278608
  switch (srcProto) {
278596
278609
  case "http:":
@@ -278610,7 +278623,7 @@ var require_ws_transport = __commonJS({
278610
278623
  protocol = encrypted === true ? "wss:" : "ws:";
278611
278624
  break;
278612
278625
  }
278613
- return `${protocol}//${host}:${port}${path31}${search}`;
278626
+ return `${protocol}//${host}:${port}${path32}${search}`;
278614
278627
  }
278615
278628
  function wsconnect(opts = {}) {
278616
278629
  (0, transport_1.setTransportFactory)({
@@ -279613,7 +279626,7 @@ var init_natsEventBus = __esm({
279613
279626
  });
279614
279627
 
279615
279628
  // ../../packages/backend/src/runtimes/gybackend/startGyBackend.ts
279616
- var import_node_path27 = __toESM(require("node:path"), 1);
279629
+ var import_node_path28 = __toESM(require("node:path"), 1);
279617
279630
  var import_node_process2 = __toESM(require("node:process"), 1);
279618
279631
 
279619
279632
  // ../../packages/backend/src/services/TerminalService.ts
@@ -280587,7 +280600,6 @@ add-zsh-hook precmd gyshell_precmd
280587
280600
  };
280588
280601
 
280589
280602
  // ../../packages/backend/src/services/SSHBackend.ts
280590
- var ssh2 = __toESM(require("ssh2"), 1);
280591
280603
  var fs2 = __toESM(require("fs"), 1);
280592
280604
  var net = __toESM(require("net"), 1);
280593
280605
  var import_node_path = require("node:path");
@@ -280724,6 +280736,16 @@ var DEFAULT_SFTP_TRANSFER_PROFILES = [
280724
280736
  ];
280725
280737
 
280726
280738
  // ../../packages/backend/src/services/SSHBackend.ts
280739
+ var ssh2 = null;
280740
+ function loadSsh2() {
280741
+ if (ssh2) return ssh2;
280742
+ try {
280743
+ ssh2 = require("ssh2");
280744
+ return ssh2;
280745
+ } catch (e) {
280746
+ 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)}`);
280747
+ }
280748
+ }
280727
280749
  var GYSHELL_READY_MARKER2 = "__GYSHELL_READY__";
280728
280750
  var SSH_CONNECT_READY_TIMEOUT_MS = 2e4;
280729
280751
  var SSH_KEEPALIVE_INTERVAL_MS = 3e4;
@@ -281538,7 +281560,7 @@ var SSHBackend = class _SSHBackend {
281538
281560
  `\x1B[36m\u25B9 ${jumpId} Establishing tunnel via jump host ${sshConfig.jumpHost.host}...\x1B[0m\r
281539
281561
  `
281540
281562
  );
281541
- const jumpClient = new ssh2.Client();
281563
+ const jumpClient = new (loadSsh2()).Client();
281542
281564
  const jumpSock = await this.buildConnectSocketIfNeeded(
281543
281565
  sshConfig.jumpHost,
281544
281566
  emit9
@@ -281882,7 +281904,7 @@ var SSHBackend = class _SSHBackend {
281882
281904
  throw new Error("SSHBackend only supports ssh connections");
281883
281905
  }
281884
281906
  const sshConfig = config2;
281885
- const client2 = new ssh2.Client();
281907
+ const client2 = new (loadSsh2()).Client();
281886
281908
  const instance = {
281887
281909
  client: client2,
281888
281910
  sshConfig,
@@ -292294,8 +292316,8 @@ function shallowCopy(obj) {
292294
292316
  }
292295
292317
  function replaceSecrets(root, secretsMap) {
292296
292318
  const result = shallowCopy(root);
292297
- for (const [path31, secretId] of Object.entries(secretsMap)) {
292298
- const [last, ...partsReverse] = path31.split(".").reverse();
292319
+ for (const [path32, secretId] of Object.entries(secretsMap)) {
292320
+ const [last, ...partsReverse] = path32.split(".").reverse();
292299
292321
  let current = result;
292300
292322
  for (const part of partsReverse.reverse()) {
292301
292323
  if (current[part] === void 0) break;
@@ -297050,7 +297072,7 @@ var AutoBatchQueue = class {
297050
297072
  ];
297051
297073
  }
297052
297074
  };
297053
- var Client2 = class _Client {
297075
+ var Client = class _Client {
297054
297076
  get _fetch() {
297055
297077
  return this.fetchImplementation || _getFetchImplementation(this.debug);
297056
297078
  }
@@ -297359,9 +297381,9 @@ var Client2 = class _Client {
297359
297381
  }
297360
297382
  return headers;
297361
297383
  }
297362
- _getPlatformEndpointPath(path31) {
297384
+ _getPlatformEndpointPath(path32) {
297363
297385
  const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
297364
- return needsV1Prefix ? `/v1/platform/${path31}` : `/platform/${path31}`;
297386
+ return needsV1Prefix ? `/v1/platform/${path32}` : `/platform/${path32}`;
297365
297387
  }
297366
297388
  async processInputs(inputs) {
297367
297389
  if (this.hideInputs === false) {
@@ -297397,9 +297419,9 @@ var Client2 = class _Client {
297397
297419
  }
297398
297420
  return runParams;
297399
297421
  }
297400
- async _getResponse(path31, queryParams) {
297422
+ async _getResponse(path32, queryParams) {
297401
297423
  const paramsString = queryParams?.toString() ?? "";
297402
- const url2 = `${this.apiUrl}${path31}?${paramsString}`;
297424
+ const url2 = `${this.apiUrl}${path32}?${paramsString}`;
297403
297425
  const response = await this.caller.call(async () => {
297404
297426
  const res = await this._fetch(url2, {
297405
297427
  method: "GET",
@@ -297407,22 +297429,22 @@ var Client2 = class _Client {
297407
297429
  signal: AbortSignal.timeout(this.timeout_ms),
297408
297430
  ...this.fetchOptions
297409
297431
  });
297410
- await raiseForStatus(res, `fetch ${path31}`);
297432
+ await raiseForStatus(res, `fetch ${path32}`);
297411
297433
  return res;
297412
297434
  });
297413
297435
  return response;
297414
297436
  }
297415
- async _get(path31, queryParams) {
297416
- const response = await this._getResponse(path31, queryParams);
297437
+ async _get(path32, queryParams) {
297438
+ const response = await this._getResponse(path32, queryParams);
297417
297439
  return response.json();
297418
297440
  }
297419
- async *_getPaginated(path31, queryParams = new URLSearchParams(), transform2) {
297441
+ async *_getPaginated(path32, queryParams = new URLSearchParams(), transform2) {
297420
297442
  let offset = Number(queryParams.get("offset")) || 0;
297421
297443
  const limit2 = Number(queryParams.get("limit")) || 100;
297422
297444
  while (true) {
297423
297445
  queryParams.set("offset", String(offset));
297424
297446
  queryParams.set("limit", String(limit2));
297425
- const url2 = `${this.apiUrl}${path31}?${queryParams}`;
297447
+ const url2 = `${this.apiUrl}${path32}?${queryParams}`;
297426
297448
  const response = await this.caller.call(async () => {
297427
297449
  const res = await this._fetch(url2, {
297428
297450
  method: "GET",
@@ -297430,7 +297452,7 @@ var Client2 = class _Client {
297430
297452
  signal: AbortSignal.timeout(this.timeout_ms),
297431
297453
  ...this.fetchOptions
297432
297454
  });
297433
- await raiseForStatus(res, `fetch ${path31}`);
297455
+ await raiseForStatus(res, `fetch ${path32}`);
297434
297456
  return res;
297435
297457
  });
297436
297458
  const items = transform2 ? transform2(await response.json()) : await response.json();
@@ -297444,19 +297466,19 @@ var Client2 = class _Client {
297444
297466
  offset += items.length;
297445
297467
  }
297446
297468
  }
297447
- async *_getCursorPaginatedList(path31, body = null, requestMethod = "POST", dataKey = "runs") {
297469
+ async *_getCursorPaginatedList(path32, body = null, requestMethod = "POST", dataKey = "runs") {
297448
297470
  const bodyParams = body ? { ...body } : {};
297449
297471
  while (true) {
297450
297472
  const body2 = JSON.stringify(bodyParams);
297451
297473
  const response = await this.caller.call(async () => {
297452
- const res = await this._fetch(`${this.apiUrl}${path31}`, {
297474
+ const res = await this._fetch(`${this.apiUrl}${path32}`, {
297453
297475
  method: requestMethod,
297454
297476
  headers: { ...this.headers, "Content-Type": "application/json" },
297455
297477
  signal: AbortSignal.timeout(this.timeout_ms),
297456
297478
  ...this.fetchOptions,
297457
297479
  body: body2
297458
297480
  });
297459
- await raiseForStatus(res, `fetch ${path31}`);
297481
+ await raiseForStatus(res, `fetch ${path32}`);
297460
297482
  return res;
297461
297483
  });
297462
297484
  const responseBody = await response.json();
@@ -298385,8 +298407,8 @@ Context: ${context2}`);
298385
298407
  limit: Number(limit2) || 100
298386
298408
  };
298387
298409
  let currentOffset = Number(offset) || 0;
298388
- const path31 = "/runs/group";
298389
- const url2 = `${this.apiUrl}${path31}`;
298410
+ const path32 = "/runs/group";
298411
+ const url2 = `${this.apiUrl}${path32}`;
298390
298412
  while (true) {
298391
298413
  const currentBody = {
298392
298414
  ...baseBody,
@@ -298402,7 +298424,7 @@ Context: ${context2}`);
298402
298424
  ...this.fetchOptions,
298403
298425
  body
298404
298426
  });
298405
- await raiseForStatus(res, `Failed to fetch ${path31}`);
298427
+ await raiseForStatus(res, `Failed to fetch ${path32}`);
298406
298428
  return res;
298407
298429
  });
298408
298430
  const items = await response.json();
@@ -298719,20 +298741,20 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298719
298741
  return result;
298720
298742
  }
298721
298743
  async hasProject({ projectId, projectName }) {
298722
- let path31 = "/sessions";
298744
+ let path32 = "/sessions";
298723
298745
  const params = new URLSearchParams();
298724
298746
  if (projectId !== void 0 && projectName !== void 0) {
298725
298747
  throw new Error("Must provide either projectName or projectId, not both");
298726
298748
  } else if (projectId !== void 0) {
298727
298749
  assertUuid(projectId);
298728
- path31 += `/${projectId}`;
298750
+ path32 += `/${projectId}`;
298729
298751
  } else if (projectName !== void 0) {
298730
298752
  params.append("name", projectName);
298731
298753
  } else {
298732
298754
  throw new Error("Must provide projectName or projectId");
298733
298755
  }
298734
298756
  const response = await this.caller.call(async () => {
298735
- const res = await this._fetch(`${this.apiUrl}${path31}?${params}`, {
298757
+ const res = await this._fetch(`${this.apiUrl}${path32}?${params}`, {
298736
298758
  method: "GET",
298737
298759
  headers: this.headers,
298738
298760
  signal: AbortSignal.timeout(this.timeout_ms),
@@ -298755,13 +298777,13 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298755
298777
  }
298756
298778
  }
298757
298779
  async readProject({ projectId, projectName, includeStats }) {
298758
- let path31 = "/sessions";
298780
+ let path32 = "/sessions";
298759
298781
  const params = new URLSearchParams();
298760
298782
  if (projectId !== void 0 && projectName !== void 0) {
298761
298783
  throw new Error("Must provide either projectName or projectId, not both");
298762
298784
  } else if (projectId !== void 0) {
298763
298785
  assertUuid(projectId);
298764
- path31 += `/${projectId}`;
298786
+ path32 += `/${projectId}`;
298765
298787
  } else if (projectName !== void 0) {
298766
298788
  params.append("name", projectName);
298767
298789
  } else {
@@ -298770,7 +298792,7 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298770
298792
  if (includeStats !== void 0) {
298771
298793
  params.append("include_stats", includeStats.toString());
298772
298794
  }
298773
- const response = await this._get(path31, params);
298795
+ const response = await this._get(path32, params);
298774
298796
  let result;
298775
298797
  if (Array.isArray(response)) {
298776
298798
  if (response.length === 0) {
@@ -298933,19 +298955,19 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298933
298955
  return result;
298934
298956
  }
298935
298957
  async readDataset({ datasetId, datasetName }) {
298936
- let path31 = "/datasets";
298958
+ let path32 = "/datasets";
298937
298959
  const params = new URLSearchParams({ limit: "1" });
298938
298960
  if (datasetId && datasetName) {
298939
298961
  throw new Error("Must provide either datasetName or datasetId, not both");
298940
298962
  } else if (datasetId) {
298941
298963
  assertUuid(datasetId);
298942
- path31 += `/${datasetId}`;
298964
+ path32 += `/${datasetId}`;
298943
298965
  } else if (datasetName) {
298944
298966
  params.append("name", datasetName);
298945
298967
  } else {
298946
298968
  throw new Error("Must provide datasetName or datasetId");
298947
298969
  }
298948
- const response = await this._get(path31, params);
298970
+ const response = await this._get(path32, params);
298949
298971
  let result;
298950
298972
  if (Array.isArray(response)) {
298951
298973
  if (response.length === 0) {
@@ -298989,20 +299011,20 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
298989
299011
  return response;
298990
299012
  }
298991
299013
  async readDatasetOpenaiFinetuning({ datasetId, datasetName }) {
298992
- const path31 = "/datasets";
299014
+ const path32 = "/datasets";
298993
299015
  if (datasetId !== void 0) {
298994
299016
  } else if (datasetName !== void 0) {
298995
299017
  datasetId = (await this.readDataset({ datasetName })).id;
298996
299018
  } else {
298997
299019
  throw new Error("Must provide either datasetName or datasetId");
298998
299020
  }
298999
- const response = await this._getResponse(`${path31}/${datasetId}/openai_ft`);
299021
+ const response = await this._getResponse(`${path32}/${datasetId}/openai_ft`);
299000
299022
  const datasetText = await response.text();
299001
299023
  const dataset = datasetText.trim().split("\n").map((line) => JSON.parse(line));
299002
299024
  return dataset;
299003
299025
  }
299004
299026
  async *listDatasets({ limit: limit2 = 100, offset = 0, datasetIds, datasetName, datasetNameContains, metadata } = {}) {
299005
- const path31 = "/datasets";
299027
+ const path32 = "/datasets";
299006
299028
  const params = new URLSearchParams({
299007
299029
  limit: limit2.toString(),
299008
299030
  offset: offset.toString()
@@ -299021,7 +299043,7 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299021
299043
  if (metadata !== void 0) {
299022
299044
  params.append("metadata", JSON.stringify(metadata));
299023
299045
  }
299024
- for await (const datasets of this._getPaginated(path31, params)) {
299046
+ for await (const datasets of this._getPaginated(path32, params)) {
299025
299047
  yield* datasets;
299026
299048
  }
299027
299049
  }
@@ -299090,7 +299112,7 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299090
299112
  });
299091
299113
  }
299092
299114
  async deleteDataset({ datasetId, datasetName }) {
299093
- let path31 = "/datasets";
299115
+ let path32 = "/datasets";
299094
299116
  let datasetId_ = datasetId;
299095
299117
  if (datasetId !== void 0 && datasetName !== void 0) {
299096
299118
  throw new Error("Must provide either datasetName or datasetId, not both");
@@ -299100,18 +299122,18 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299100
299122
  }
299101
299123
  if (datasetId_ !== void 0) {
299102
299124
  assertUuid(datasetId_);
299103
- path31 += `/${datasetId_}`;
299125
+ path32 += `/${datasetId_}`;
299104
299126
  } else {
299105
299127
  throw new Error("Must provide datasetName or datasetId");
299106
299128
  }
299107
299129
  await this.caller.call(async () => {
299108
- const res = await this._fetch(this.apiUrl + path31, {
299130
+ const res = await this._fetch(this.apiUrl + path32, {
299109
299131
  method: "DELETE",
299110
299132
  headers: this.headers,
299111
299133
  signal: AbortSignal.timeout(this.timeout_ms),
299112
299134
  ...this.fetchOptions
299113
299135
  });
299114
- await raiseForStatus(res, `delete ${path31}`, true);
299136
+ await raiseForStatus(res, `delete ${path32}`, true);
299115
299137
  return res;
299116
299138
  });
299117
299139
  }
@@ -299302,8 +299324,8 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299302
299324
  }
299303
299325
  async readExample(exampleId) {
299304
299326
  assertUuid(exampleId);
299305
- const path31 = `/examples/${exampleId}`;
299306
- const rawExample = await this._get(path31);
299327
+ const path32 = `/examples/${exampleId}`;
299328
+ const rawExample = await this._get(path32);
299307
299329
  const { attachment_urls, ...rest } = rawExample;
299308
299330
  const example = rest;
299309
299331
  if (attachment_urls) {
@@ -299386,15 +299408,15 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299386
299408
  }
299387
299409
  async deleteExample(exampleId) {
299388
299410
  assertUuid(exampleId);
299389
- const path31 = `/examples/${exampleId}`;
299411
+ const path32 = `/examples/${exampleId}`;
299390
299412
  await this.caller.call(async () => {
299391
- const res = await this._fetch(this.apiUrl + path31, {
299413
+ const res = await this._fetch(this.apiUrl + path32, {
299392
299414
  method: "DELETE",
299393
299415
  headers: this.headers,
299394
299416
  signal: AbortSignal.timeout(this.timeout_ms),
299395
299417
  ...this.fetchOptions
299396
299418
  });
299397
- await raiseForStatus(res, `delete ${path31}`, true);
299419
+ await raiseForStatus(res, `delete ${path32}`, true);
299398
299420
  return res;
299399
299421
  });
299400
299422
  }
@@ -299407,9 +299429,9 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299407
299429
  async deleteExamples(exampleIds, options) {
299408
299430
  exampleIds.forEach((id) => assertUuid(id));
299409
299431
  if (options?.hardDelete) {
299410
- const path31 = this._getPlatformEndpointPath("datasets/examples/delete");
299432
+ const path32 = this._getPlatformEndpointPath("datasets/examples/delete");
299411
299433
  await this.caller.call(async () => {
299412
- const res = await this._fetch(`${this.apiUrl}${path31}`, {
299434
+ const res = await this._fetch(`${this.apiUrl}${path32}`, {
299413
299435
  method: "POST",
299414
299436
  headers: { ...this.headers, "Content-Type": "application/json" },
299415
299437
  body: JSON.stringify({
@@ -299643,21 +299665,21 @@ Message: ${Array.isArray(result.detail) ? result.detail.join("\n") : "Unspecifie
299643
299665
  }
299644
299666
  async readFeedback(feedbackId) {
299645
299667
  assertUuid(feedbackId);
299646
- const path31 = `/feedback/${feedbackId}`;
299647
- const response = await this._get(path31);
299668
+ const path32 = `/feedback/${feedbackId}`;
299669
+ const response = await this._get(path32);
299648
299670
  return response;
299649
299671
  }
299650
299672
  async deleteFeedback(feedbackId) {
299651
299673
  assertUuid(feedbackId);
299652
- const path31 = `/feedback/${feedbackId}`;
299674
+ const path32 = `/feedback/${feedbackId}`;
299653
299675
  await this.caller.call(async () => {
299654
- const res = await this._fetch(this.apiUrl + path31, {
299676
+ const res = await this._fetch(this.apiUrl + path32, {
299655
299677
  method: "DELETE",
299656
299678
  headers: this.headers,
299657
299679
  signal: AbortSignal.timeout(this.timeout_ms),
299658
299680
  ...this.fetchOptions
299659
299681
  });
299660
- await raiseForStatus(res, `delete ${path31}`, true);
299682
+ await raiseForStatus(res, `delete ${path32}`, true);
299661
299683
  return res;
299662
299684
  });
299663
299685
  }
@@ -300971,7 +300993,7 @@ var RunTree = class _RunTree {
300971
300993
  }
300972
300994
  static getSharedClient() {
300973
300995
  if (!_RunTree.sharedClient) {
300974
- _RunTree.sharedClient = new Client2();
300996
+ _RunTree.sharedClient = new Client();
300975
300997
  }
300976
300998
  return _RunTree.sharedClient;
300977
300999
  }
@@ -302151,7 +302173,7 @@ var client;
302151
302173
  var getDefaultLangChainClientSingleton = () => {
302152
302174
  if (client === void 0) {
302153
302175
  const clientParams = getEnvironmentVariable("LANGCHAIN_CALLBACKS_BACKGROUND") === "false" ? { blockOnRootRunFinalization: true } : {};
302154
- client = new Client2(clientParams);
302176
+ client = new Client(clientParams);
302155
302177
  }
302156
302178
  return client;
302157
302179
  };
@@ -303253,12 +303275,12 @@ function isInteger(str3) {
303253
303275
  }
303254
303276
  return true;
303255
303277
  }
303256
- function escapePathComponent(path31) {
303257
- if (path31.indexOf("/") === -1 && path31.indexOf("~") === -1) return path31;
303258
- return path31.replace(/~/g, "~0").replace(/\//g, "~1");
303278
+ function escapePathComponent(path32) {
303279
+ if (path32.indexOf("/") === -1 && path32.indexOf("~") === -1) return path32;
303280
+ return path32.replace(/~/g, "~0").replace(/\//g, "~1");
303259
303281
  }
303260
- function unescapePathComponent(path31) {
303261
- return path31.replace(/~1/g, "/").replace(/~0/g, "~");
303282
+ function unescapePathComponent(path32) {
303283
+ return path32.replace(/~1/g, "/").replace(/~0/g, "~");
303262
303284
  }
303263
303285
  function hasUndefined(obj) {
303264
303286
  if (obj === void 0) return true;
@@ -303452,8 +303474,8 @@ function applyOperation(document2, operation, validateOperation = false, mutateD
303452
303474
  else return returnValue;
303453
303475
  } else {
303454
303476
  if (!mutateDocument) document2 = _deepClone(document2);
303455
- const path31 = operation.path || "";
303456
- const keys = path31.split("/");
303477
+ const path32 = operation.path || "";
303478
+ const keys = path32.split("/");
303457
303479
  let obj = document2;
303458
303480
  let t = 1;
303459
303481
  let len = keys.length;
@@ -303576,7 +303598,7 @@ function _areEquals(a, b) {
303576
303598
  }
303577
303599
 
303578
303600
  // ../../node_modules/@langchain/core/dist/utils/fast-json-patch/src/duplex.js
303579
- function _generate(mirror, obj, patches, path31, invertible) {
303601
+ function _generate(mirror, obj, patches, path32, invertible) {
303580
303602
  if (obj === mirror) return;
303581
303603
  if (typeof obj.toJSON === "function") obj = obj.toJSON();
303582
303604
  var newKeys = _objectKeys(obj);
@@ -303588,40 +303610,40 @@ function _generate(mirror, obj, patches, path31, invertible) {
303588
303610
  var oldVal = mirror[key];
303589
303611
  if (hasOwnProperty(obj, key) && !(obj[key] === void 0 && oldVal !== void 0 && Array.isArray(obj) === false)) {
303590
303612
  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);
303613
+ 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
303614
  else if (oldVal !== newVal) {
303593
303615
  changed = true;
303594
303616
  if (invertible) patches.push({
303595
303617
  op: "test",
303596
- path: path31 + "/" + escapePathComponent(key),
303618
+ path: path32 + "/" + escapePathComponent(key),
303597
303619
  value: _deepClone(oldVal)
303598
303620
  });
303599
303621
  patches.push({
303600
303622
  op: "replace",
303601
- path: path31 + "/" + escapePathComponent(key),
303623
+ path: path32 + "/" + escapePathComponent(key),
303602
303624
  value: _deepClone(newVal)
303603
303625
  });
303604
303626
  }
303605
303627
  } else if (Array.isArray(mirror) === Array.isArray(obj)) {
303606
303628
  if (invertible) patches.push({
303607
303629
  op: "test",
303608
- path: path31 + "/" + escapePathComponent(key),
303630
+ path: path32 + "/" + escapePathComponent(key),
303609
303631
  value: _deepClone(oldVal)
303610
303632
  });
303611
303633
  patches.push({
303612
303634
  op: "remove",
303613
- path: path31 + "/" + escapePathComponent(key)
303635
+ path: path32 + "/" + escapePathComponent(key)
303614
303636
  });
303615
303637
  deleted = true;
303616
303638
  } else {
303617
303639
  if (invertible) patches.push({
303618
303640
  op: "test",
303619
- path: path31,
303641
+ path: path32,
303620
303642
  value: mirror
303621
303643
  });
303622
303644
  patches.push({
303623
303645
  op: "replace",
303624
- path: path31,
303646
+ path: path32,
303625
303647
  value: obj
303626
303648
  });
303627
303649
  changed = true;
@@ -303632,7 +303654,7 @@ function _generate(mirror, obj, patches, path31, invertible) {
303632
303654
  var key = newKeys[t];
303633
303655
  if (!hasOwnProperty(mirror, key) && obj[key] !== void 0) patches.push({
303634
303656
  op: "add",
303635
- path: path31 + "/" + escapePathComponent(key),
303657
+ path: path32 + "/" + escapePathComponent(key),
303636
303658
  value: _deepClone(obj[key])
303637
303659
  });
303638
303660
  }
@@ -305018,10 +305040,10 @@ function assignProp(target, prop, value) {
305018
305040
  configurable: true
305019
305041
  });
305020
305042
  }
305021
- function getElementAtPath(obj, path31) {
305022
- if (!path31)
305043
+ function getElementAtPath(obj, path32) {
305044
+ if (!path32)
305023
305045
  return obj;
305024
- return path31.reduce((acc, key) => acc?.[key], obj);
305046
+ return path32.reduce((acc, key) => acc?.[key], obj);
305025
305047
  }
305026
305048
  function promiseAllObject(promisesObj) {
305027
305049
  const keys = Object.keys(promisesObj);
@@ -305341,11 +305363,11 @@ function aborted(x, startIndex = 0) {
305341
305363
  }
305342
305364
  return false;
305343
305365
  }
305344
- function prefixIssues(path31, issues) {
305366
+ function prefixIssues(path32, issues) {
305345
305367
  return issues.map((iss) => {
305346
305368
  var _a3;
305347
305369
  (_a3 = iss).path ?? (_a3.path = []);
305348
- iss.path.unshift(path31);
305370
+ iss.path.unshift(path32);
305349
305371
  return iss;
305350
305372
  });
305351
305373
  }
@@ -305482,7 +305504,7 @@ function treeifyError(error40, _mapper) {
305482
305504
  return issue2.message;
305483
305505
  };
305484
305506
  const result = { errors: [] };
305485
- const processError = (error41, path31 = []) => {
305507
+ const processError = (error41, path32 = []) => {
305486
305508
  var _a3, _b;
305487
305509
  for (const issue2 of error41.issues) {
305488
305510
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -305492,7 +305514,7 @@ function treeifyError(error40, _mapper) {
305492
305514
  } else if (issue2.code === "invalid_element") {
305493
305515
  processError({ issues: issue2.issues }, issue2.path);
305494
305516
  } else {
305495
- const fullpath = [...path31, ...issue2.path];
305517
+ const fullpath = [...path32, ...issue2.path];
305496
305518
  if (fullpath.length === 0) {
305497
305519
  result.errors.push(mapper(issue2));
305498
305520
  continue;
@@ -305522,9 +305544,9 @@ function treeifyError(error40, _mapper) {
305522
305544
  processError(error40);
305523
305545
  return result;
305524
305546
  }
305525
- function toDotPath(path31) {
305547
+ function toDotPath(path32) {
305526
305548
  const segs = [];
305527
- for (const seg of path31) {
305549
+ for (const seg of path32) {
305528
305550
  if (typeof seg === "number")
305529
305551
  segs.push(`[${seg}]`);
305530
305552
  else if (typeof seg === "symbol")
@@ -315427,8 +315449,8 @@ function getErrorMap() {
315427
315449
 
315428
315450
  // ../../node_modules/zod/v3/helpers/parseUtil.js
315429
315451
  var makeIssue = (params) => {
315430
- const { data, path: path31, errorMaps, issueData } = params;
315431
- const fullPath = [...path31, ...issueData.path || []];
315452
+ const { data, path: path32, errorMaps, issueData } = params;
315453
+ const fullPath = [...path32, ...issueData.path || []];
315432
315454
  const fullIssue = {
315433
315455
  ...issueData,
315434
315456
  path: fullPath
@@ -315544,11 +315566,11 @@ var errorUtil;
315544
315566
 
315545
315567
  // ../../node_modules/zod/v3/types.js
315546
315568
  var ParseInputLazyPath = class {
315547
- constructor(parent, value, path31, key) {
315569
+ constructor(parent, value, path32, key) {
315548
315570
  this._cachedPath = [];
315549
315571
  this.parent = parent;
315550
315572
  this.data = value;
315551
- this._path = path31;
315573
+ this._path = path32;
315552
315574
  this._key = key;
315553
315575
  }
315554
315576
  get path() {
@@ -321809,10 +321831,10 @@ var Runnable = class extends Serializable {
321809
321831
  }
321810
321832
  const paths = log.ops.filter((op) => op.path.startsWith("/logs/")).map((op) => op.path.split("/")[2]);
321811
321833
  const dedupedPaths = [...new Set(paths)];
321812
- for (const path31 of dedupedPaths) {
321834
+ for (const path32 of dedupedPaths) {
321813
321835
  let eventType;
321814
321836
  let data = {};
321815
- const logEntry = runLog.state.logs[path31];
321837
+ const logEntry = runLog.state.logs[path32];
321816
321838
  if (logEntry.end_time === void 0) if (logEntry.streamed_output.length > 0) eventType = "stream";
321817
321839
  else eventType = "start";
321818
321840
  else eventType = "end";
@@ -324808,7 +324830,7 @@ var LangSmithLoader = class extends BaseDocumentLoader {
324808
324830
  constructor(fields) {
324809
324831
  super();
324810
324832
  if (fields.client && fields.clientConfig) throw new Error("client and clientConfig cannot both be provided.");
324811
- this.client = fields.client ?? new Client2(fields?.clientConfig);
324833
+ this.client = fields.client ?? new Client(fields?.clientConfig);
324812
324834
  this.contentKey = fields.contentKey ? fields.contentKey.split(".") : [];
324813
324835
  this.formatContent = fields.formatContent ?? _stringify;
324814
324836
  this.datasetId = fields.datasetId;
@@ -333877,13 +333899,13 @@ function combineAliasesAndInvert(constructor) {
333877
333899
  }, {});
333878
333900
  }
333879
333901
  async function reviver(value) {
333880
- const { optionalImportsMap, optionalImportEntrypoints: optionalImportEntrypoints$1, importMap, secretsMap, secretsFromEnv, path: path31, depth, maxDepth } = this;
333881
- const pathStr = path31.join(".");
333902
+ const { optionalImportsMap, optionalImportEntrypoints: optionalImportEntrypoints$1, importMap, secretsMap, secretsFromEnv, path: path32, depth, maxDepth } = this;
333903
+ const pathStr = path32.join(".");
333882
333904
  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
333905
  if (typeof value !== "object" || value == null) return value;
333884
333906
  if (Array.isArray(value)) return Promise.all(value.map((v, i) => reviver.call({
333885
333907
  ...this,
333886
- path: [...path31, `${i}`],
333908
+ path: [...path32, `${i}`],
333887
333909
  depth: depth + 1
333888
333910
  }, v)));
333889
333911
  const record2 = value;
@@ -333938,7 +333960,7 @@ async function reviver(value) {
333938
333960
  if (typeof builder !== "function") throw new Error(`Invalid identifer: ${pathStr} -> ${str3}`);
333939
333961
  const kwargs = await reviver.call({
333940
333962
  ...this,
333941
- path: [...path31, "kwargs"],
333963
+ path: [...path32, "kwargs"],
333942
333964
  depth: depth + 1
333943
333965
  }, serialized.kwargs);
333944
333966
  const instance = new builder(mapKeys(kwargs, keyFromJson, combineAliasesAndInvert(builder)));
@@ -333948,7 +333970,7 @@ async function reviver(value) {
333948
333970
  const result = {};
333949
333971
  for (const [key, val] of Object.entries(record2)) result[key] = await reviver.call({
333950
333972
  ...this,
333951
- path: [...path31, key],
333973
+ path: [...path32, key],
333952
333974
  depth: depth + 1
333953
333975
  }, val);
333954
333976
  return result;
@@ -339076,10 +339098,10 @@ var Graph$1 = class {
339076
339098
  this.edges.add([startKey, endKey]);
339077
339099
  return this;
339078
339100
  }
339079
- addConditionalEdges(source, path31, pathMap) {
339101
+ addConditionalEdges(source, path32, pathMap) {
339080
339102
  const options = typeof source === "object" ? source : {
339081
339103
  source,
339082
- path: path31,
339104
+ path: path32,
339083
339105
  pathMap
339084
339106
  };
339085
339107
  this.warnIfCompiled("Adding an edge to a graph that has already been compiled. This will not be reflected in the compiled graph.");
@@ -340478,16 +340500,16 @@ var Diff = class {
340478
340500
  }
340479
340501
  }
340480
340502
  }
340481
- addToPath(path31, added, removed, oldPosInc, options) {
340482
- const last = path31.lastComponent;
340503
+ addToPath(path32, added, removed, oldPosInc, options) {
340504
+ const last = path32.lastComponent;
340483
340505
  if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
340484
340506
  return {
340485
- oldPos: path31.oldPos + oldPosInc,
340507
+ oldPos: path32.oldPos + oldPosInc,
340486
340508
  lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
340487
340509
  };
340488
340510
  } else {
340489
340511
  return {
340490
- oldPos: path31.oldPos + oldPosInc,
340512
+ oldPos: path32.oldPos + oldPosInc,
340491
340513
  lastComponent: { count: 1, added, removed, previousComponent: last }
340492
340514
  };
340493
340515
  }
@@ -348350,12 +348372,12 @@ function encodeURIPath(str3) {
348350
348372
  return str3.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
348351
348373
  }
348352
348374
  var EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
348353
- var createPathTagFunction = (pathEncoder = encodeURIPath) => function path31(statics, ...params) {
348375
+ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path32(statics, ...params) {
348354
348376
  if (statics.length === 1)
348355
348377
  return statics[0];
348356
348378
  let postPath = false;
348357
348379
  const invalidSegments = [];
348358
- const path32 = statics.reduce((previousValue, currentValue, index2) => {
348380
+ const path33 = statics.reduce((previousValue, currentValue, index2) => {
348359
348381
  if (/[?#]/.test(currentValue)) {
348360
348382
  postPath = true;
348361
348383
  }
@@ -348372,7 +348394,7 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path31(sta
348372
348394
  }
348373
348395
  return previousValue + currentValue + (index2 === params.length ? "" : encoded);
348374
348396
  }, "");
348375
- const pathOnly = path32.split(/[?#]/, 1)[0];
348397
+ const pathOnly = path33.split(/[?#]/, 1)[0];
348376
348398
  const invalidSegmentPattern = /(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;
348377
348399
  let match;
348378
348400
  while ((match = invalidSegmentPattern.exec(pathOnly)) !== null) {
@@ -348393,10 +348415,10 @@ var createPathTagFunction = (pathEncoder = encodeURIPath) => function path31(sta
348393
348415
  }, "");
348394
348416
  throw new OpenAIError(`Path parameters result in path with invalid segments:
348395
348417
  ${invalidSegments.map((e) => e.error).join("\n")}
348396
- ${path32}
348418
+ ${path33}
348397
348419
  ${underline}`);
348398
348420
  }
348399
- return path32;
348421
+ return path33;
348400
348422
  };
348401
348423
  var path8 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
348402
348424
 
@@ -353213,9 +353235,9 @@ var OpenAI = class {
353213
353235
  this.apiKey = token;
353214
353236
  return true;
353215
353237
  }
353216
- buildURL(path31, query, defaultBaseURL) {
353238
+ buildURL(path32, query, defaultBaseURL) {
353217
353239
  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));
353240
+ const url2 = isAbsoluteURL(path32) ? new URL(path32) : new URL(baseURL + (baseURL.endsWith("/") && path32.startsWith("/") ? path32.slice(1) : path32));
353219
353241
  const defaultQuery = this.defaultQuery();
353220
353242
  if (!isEmptyObj(defaultQuery)) {
353221
353243
  query = { ...defaultQuery, ...query };
@@ -353239,24 +353261,24 @@ var OpenAI = class {
353239
353261
  */
353240
353262
  async prepareRequest(request, { url: url2, options }) {
353241
353263
  }
353242
- get(path31, opts) {
353243
- return this.methodRequest("get", path31, opts);
353264
+ get(path32, opts) {
353265
+ return this.methodRequest("get", path32, opts);
353244
353266
  }
353245
- post(path31, opts) {
353246
- return this.methodRequest("post", path31, opts);
353267
+ post(path32, opts) {
353268
+ return this.methodRequest("post", path32, opts);
353247
353269
  }
353248
- patch(path31, opts) {
353249
- return this.methodRequest("patch", path31, opts);
353270
+ patch(path32, opts) {
353271
+ return this.methodRequest("patch", path32, opts);
353250
353272
  }
353251
- put(path31, opts) {
353252
- return this.methodRequest("put", path31, opts);
353273
+ put(path32, opts) {
353274
+ return this.methodRequest("put", path32, opts);
353253
353275
  }
353254
- delete(path31, opts) {
353255
- return this.methodRequest("delete", path31, opts);
353276
+ delete(path32, opts) {
353277
+ return this.methodRequest("delete", path32, opts);
353256
353278
  }
353257
- methodRequest(method, path31, opts) {
353279
+ methodRequest(method, path32, opts) {
353258
353280
  return this.request(Promise.resolve(opts).then((opts2) => {
353259
- return { method, path: path31, ...opts2 };
353281
+ return { method, path: path32, ...opts2 };
353260
353282
  }));
353261
353283
  }
353262
353284
  request(options, remainingRetries = null) {
@@ -353360,8 +353382,8 @@ var OpenAI = class {
353360
353382
  }));
353361
353383
  return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
353362
353384
  }
353363
- getAPIList(path31, Page2, opts) {
353364
- return this.requestAPIList(Page2, { method: "get", path: path31, ...opts });
353385
+ getAPIList(path32, Page2, opts) {
353386
+ return this.requestAPIList(Page2, { method: "get", path: path32, ...opts });
353365
353387
  }
353366
353388
  requestAPIList(Page2, options) {
353367
353389
  const request = this.makeRequest(options, null, void 0);
@@ -353439,8 +353461,8 @@ var OpenAI = class {
353439
353461
  }
353440
353462
  async buildRequest(inputOptions, { retryCount = 0 } = {}) {
353441
353463
  const options = { ...inputOptions };
353442
- const { method, path: path31, query, defaultBaseURL } = options;
353443
- const url2 = this.buildURL(path31, query, defaultBaseURL);
353464
+ const { method, path: path32, query, defaultBaseURL } = options;
353465
+ const url2 = this.buildURL(path32, query, defaultBaseURL);
353444
353466
  if ("timeout" in options)
353445
353467
  validatePositiveInteger("timeout", options.timeout);
353446
353468
  options.timeout = options.timeout ?? this.timeout;
@@ -355056,23 +355078,23 @@ function isNullable(schema2) {
355056
355078
  }
355057
355079
  return false;
355058
355080
  }
355059
- function ensureStrictJsonSchema(jsonSchema, path31, root) {
355081
+ function ensureStrictJsonSchema(jsonSchema, path32, root) {
355060
355082
  if (typeof jsonSchema === "boolean") {
355061
- throw new TypeError(`Expected object schema but got boolean; path=${path31.join("/")}`);
355083
+ throw new TypeError(`Expected object schema but got boolean; path=${path32.join("/")}`);
355062
355084
  }
355063
355085
  if (!isObject4(jsonSchema)) {
355064
- throw new TypeError(`Expected ${JSON.stringify(jsonSchema)} to be an object; path=${path31.join("/")}`);
355086
+ throw new TypeError(`Expected ${JSON.stringify(jsonSchema)} to be an object; path=${path32.join("/")}`);
355065
355087
  }
355066
355088
  const defs = jsonSchema.$defs;
355067
355089
  if (isObject4(defs)) {
355068
355090
  for (const [defName, defSchema] of Object.entries(defs)) {
355069
- ensureStrictJsonSchema(defSchema, [...path31, "$defs", defName], root);
355091
+ ensureStrictJsonSchema(defSchema, [...path32, "$defs", defName], root);
355070
355092
  }
355071
355093
  }
355072
355094
  const definitions = jsonSchema.definitions;
355073
355095
  if (isObject4(definitions)) {
355074
355096
  for (const [definitionName, definitionSchema] of Object.entries(definitions)) {
355075
- ensureStrictJsonSchema(definitionSchema, [...path31, "definitions", definitionName], root);
355097
+ ensureStrictJsonSchema(definitionSchema, [...path32, "definitions", definitionName], root);
355076
355098
  }
355077
355099
  }
355078
355100
  const typ = jsonSchema.type;
@@ -355084,31 +355106,31 @@ function ensureStrictJsonSchema(jsonSchema, path31, root) {
355084
355106
  if (isObject4(properties)) {
355085
355107
  for (const [key, value] of Object.entries(properties)) {
355086
355108
  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`);
355109
+ 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
355110
  }
355089
355111
  }
355090
355112
  jsonSchema.required = Object.keys(properties);
355091
355113
  jsonSchema.properties = Object.fromEntries(Object.entries(properties).map(([key, propSchema]) => [
355092
355114
  key,
355093
- ensureStrictJsonSchema(propSchema, [...path31, "properties", key], root)
355115
+ ensureStrictJsonSchema(propSchema, [...path32, "properties", key], root)
355094
355116
  ]));
355095
355117
  }
355096
355118
  const items = jsonSchema.items;
355097
355119
  if (isObject4(items)) {
355098
- jsonSchema.items = ensureStrictJsonSchema(items, [...path31, "items"], root);
355120
+ jsonSchema.items = ensureStrictJsonSchema(items, [...path32, "items"], root);
355099
355121
  }
355100
355122
  const anyOf = jsonSchema.anyOf;
355101
355123
  if (Array.isArray(anyOf)) {
355102
- jsonSchema.anyOf = anyOf.map((variant, i) => ensureStrictJsonSchema(variant, [...path31, "anyOf", String(i)], root));
355124
+ jsonSchema.anyOf = anyOf.map((variant, i) => ensureStrictJsonSchema(variant, [...path32, "anyOf", String(i)], root));
355103
355125
  }
355104
355126
  const allOf = jsonSchema.allOf;
355105
355127
  if (Array.isArray(allOf)) {
355106
355128
  if (allOf.length === 1) {
355107
- const resolved = ensureStrictJsonSchema(allOf[0], [...path31, "allOf", "0"], root);
355129
+ const resolved = ensureStrictJsonSchema(allOf[0], [...path32, "allOf", "0"], root);
355108
355130
  Object.assign(jsonSchema, resolved);
355109
355131
  delete jsonSchema.allOf;
355110
355132
  } else {
355111
- jsonSchema.allOf = allOf.map((entry, i) => ensureStrictJsonSchema(entry, [...path31, "allOf", String(i)], root));
355133
+ jsonSchema.allOf = allOf.map((entry, i) => ensureStrictJsonSchema(entry, [...path32, "allOf", String(i)], root));
355112
355134
  }
355113
355135
  }
355114
355136
  if (jsonSchema.default === null) {
@@ -355117,7 +355139,7 @@ function ensureStrictJsonSchema(jsonSchema, path31, root) {
355117
355139
  const ref = jsonSchema.$ref;
355118
355140
  if (ref && hasMoreThanNKeys(jsonSchema, 1)) {
355119
355141
  if (typeof ref !== "string") {
355120
- throw new TypeError(`Received non-string $ref - ${ref}; path=${path31.join("/")}`);
355142
+ throw new TypeError(`Received non-string $ref - ${ref}; path=${path32.join("/")}`);
355121
355143
  }
355122
355144
  const resolved = resolveRef(root, ref);
355123
355145
  if (typeof resolved === "boolean") {
@@ -355128,7 +355150,7 @@ function ensureStrictJsonSchema(jsonSchema, path31, root) {
355128
355150
  }
355129
355151
  Object.assign(jsonSchema, { ...resolved, ...jsonSchema });
355130
355152
  delete jsonSchema.$ref;
355131
- return ensureStrictJsonSchema(jsonSchema, path31, root);
355153
+ return ensureStrictJsonSchema(jsonSchema, path32, root);
355132
355154
  }
355133
355155
  return jsonSchema;
355134
355156
  }
@@ -370339,7 +370361,7 @@ function getSupportedElicitationModes(capabilities) {
370339
370361
  const supportsUrlMode = hasUrlCapability;
370340
370362
  return { supportsFormMode, supportsUrlMode };
370341
370363
  }
370342
- var Client3 = class extends Protocol {
370364
+ var Client2 = class extends Protocol {
370343
370365
  /**
370344
370366
  * Initializes this client with the given name and version information.
370345
370367
  */
@@ -373544,7 +373566,7 @@ var McpRuntimeCore = class extends import_node_events.EventEmitter {
373544
373566
  }
373545
373567
  return stdioTransport;
373546
373568
  })();
373547
- const client2 = new Client3(
373569
+ const client2 = new Client2(
373548
373570
  { name: `gyshell-mcp-${name}`, version: "1.0.0" },
373549
373571
  { capabilities: {} }
373550
373572
  );
@@ -377299,6 +377321,7 @@ function createTriggerRuntime(deps) {
377299
377321
 
377300
377322
  // ../../packages/backend/src/services/observability.ts
377301
377323
  var import_node_module2 = require("node:module");
377324
+ var import_node_path27 = __toESM(require("node:path"), 1);
377302
377325
 
377303
377326
  // ../../packages/backend/src/services/sre/metricsLedger.ts
377304
377327
  var DEFAULT_LIMIT = 1e4;
@@ -382552,10 +382575,10 @@ function createObservability(deps) {
382552
382575
  const monitorStatus = new MonitorStatusService(deps.resourceMonitorService, deps.terminalService);
382553
382576
  const policyEngine = new AgtPolicyEngine({
382554
382577
  loadPolicy: async () => {
382555
- const req = (0, import_node_module2.createRequire)(import_meta4.url);
382578
+ const req = (0, import_node_module2.createRequire)(typeof __filename !== "undefined" ? __filename : import_meta4.url);
382556
382579
  const fs22 = req("node:fs");
382557
- const path31 = req("node:path");
382558
- const policyPath = path31.join(".", "policy.yaml");
382580
+ const path32 = req("node:path");
382581
+ const policyPath = path32.join(".", "policy.yaml");
382559
382582
  if (fs22.existsSync(policyPath)) {
382560
382583
  return parsePolicyYaml(fs22.readFileSync(policyPath, "utf8"));
382561
382584
  }
@@ -382595,21 +382618,21 @@ function createObservability(deps) {
382595
382618
  reviewMode: deps.reviewMode ?? "strict"
382596
382619
  });
382597
382620
  const pluginScanRoot = (process.env.GYBACKEND_DATA_DIR ?? "./.gybackend-data") + "/plugins";
382598
- const bundlePluginRoot = new URL("../../plugins/", import_meta4.url).pathname;
382621
+ 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
382622
  const scanRoots = [pluginScanRoot, "./plugins"];
382600
382623
  try {
382601
- const req = (0, import_node_module2.createRequire)(import_meta4.url);
382624
+ const req = (0, import_node_module2.createRequire)(typeof __filename !== "undefined" ? __filename : import_meta4.url);
382602
382625
  const fs22 = req("node:fs");
382603
382626
  if (fs22.existsSync(bundlePluginRoot)) scanRoots.push(bundlePluginRoot);
382604
382627
  } catch {
382605
382628
  }
382606
382629
  try {
382607
- const req = (0, import_node_module2.createRequire)(import_meta4.url);
382630
+ const req = (0, import_node_module2.createRequire)(typeof __filename !== "undefined" ? __filename : import_meta4.url);
382608
382631
  const fs22 = req("node:fs");
382609
- const path31 = req("node:path");
382632
+ const path32 = req("node:path");
382610
382633
  const resourcesPath = process.resourcesPath;
382611
382634
  if (resourcesPath) {
382612
- const resourcesPlugins = path31.join(resourcesPath, "plugins");
382635
+ const resourcesPlugins = path32.join(resourcesPath, "plugins");
382613
382636
  if (fs22.existsSync(resourcesPlugins)) scanRoots.push(resourcesPlugins);
382614
382637
  }
382615
382638
  } catch {
@@ -384497,9 +384520,9 @@ function numberFromEnv(name, fallback) {
384497
384520
  function resolveDataDir() {
384498
384521
  const custom3 = (import_node_process2.default.env.GYBACKEND_DATA_DIR || "").trim();
384499
384522
  if (custom3) {
384500
- return import_node_path27.default.resolve(custom3);
384523
+ return import_node_path28.default.resolve(custom3);
384501
384524
  }
384502
- return import_node_path27.default.join(import_node_process2.default.cwd(), ".gybackend-data");
384525
+ return import_node_path28.default.join(import_node_process2.default.cwd(), ".gybackend-data");
384503
384526
  }
384504
384527
  async function startGyBackend() {
384505
384528
  const dataDir = resolveDataDir();
@@ -384532,7 +384555,7 @@ async function startGyBackend() {
384532
384555
  const modelCapabilityService = new ModelCapabilityService();
384533
384556
  const imageAttachmentService = new ImageAttachmentService(dataDir);
384534
384557
  const terminalStateStore = new TerminalStateStore(
384535
- import_node_path27.default.join(dataDir, "terminal-tabs-state.json")
384558
+ import_node_path28.default.join(dataDir, "terminal-tabs-state.json")
384536
384559
  );
384537
384560
  const terminalService = new TerminalService({
384538
384561
  terminalStateStore
@@ -384683,7 +384706,7 @@ async function startGyBackend() {
384683
384706
  });
384684
384707
  console.log(`[gybackend] Observability wired: dashboard state available (hosts=${observability.metricsLedger.hosts().length})`);
384685
384708
  if (settingsService.getSettings().sessionLogging?.enabled) {
384686
- const logDir = import_node_path27.default.join(
384709
+ const logDir = import_node_path28.default.join(
384687
384710
  import_node_process2.default.env.GYSHELL_STORE_DIR || "",
384688
384711
  "session-logs"
384689
384712
  );