@lobehub/cli 0.0.175 → 0.0.176

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/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import { Buffer as Buffer$1 } from "node:buffer";
15
15
  import * as net$1 from "node:net";
16
16
  import net, { BlockList, connect, createServer, isIP } from "node:net";
17
17
  import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
18
- import process$1, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
18
+ import _w, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
19
19
  import { URL as URL$1, fileURLToPath, pathToFileURL } from "node:url";
20
20
  import { finished, pipeline } from "node:stream/promises";
21
21
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark, pipeline as pipeline$1 } from "node:stream";
@@ -110,7 +110,7 @@ var init_escapeRegExp = __esmMin((() => {}));
110
110
 
111
111
  //#endregion
112
112
  //#region ../../packages/utils/src/object.ts
113
- var isObjectLike$1, isRecord$8, isPlainRecord, toRecord, pickString$1;
113
+ var isObjectLike$1, isRecord$8, isPlainRecord, toRecord$1, pickString$1;
114
114
  var init_object$1 = __esmMin((() => {
115
115
  isObjectLike$1 = (value) => typeof value === "object" && value !== null;
116
116
  isRecord$8 = (value) => isObjectLike$1(value) && !Array.isArray(value);
@@ -119,7 +119,7 @@ var init_object$1 = __esmMin((() => {
119
119
  const prototype = Object.getPrototypeOf(value);
120
120
  return prototype === Object.prototype || prototype === null;
121
121
  };
122
- toRecord = (value) => isRecord$8(value) ? value : void 0;
122
+ toRecord$1 = (value) => isRecord$8(value) ? value : void 0;
123
123
  pickString$1 = (value) => typeof value === "string" ? value : void 0;
124
124
  }));
125
125
 
@@ -460,7 +460,7 @@ function defineLazy(object, key, getter) {
460
460
  configurable: true
461
461
  });
462
462
  }
463
- function assignProp$1(target, prop, value) {
463
+ function assignProp(target, prop, value) {
464
464
  Object.defineProperty(target, prop, {
465
465
  value,
466
466
  writable: true,
@@ -484,7 +484,7 @@ function deferProp(target, key, getter) {
484
484
  Object.defineProperty(target, key, {
485
485
  get() {
486
486
  const value = getter();
487
- assignProp$1(this, key, value);
487
+ assignProp(this, key, value);
488
488
  return value;
489
489
  },
490
490
  enumerable: true,
@@ -492,7 +492,7 @@ function deferProp(target, key, getter) {
492
492
  });
493
493
  }
494
494
  function putProp(target, key, value) {
495
- if (key in target) assignProp$1(target, key, value);
495
+ if (key in target) assignProp(target, key, value);
496
496
  else target[key] = value;
497
497
  }
498
498
  /**
@@ -534,7 +534,7 @@ function slugify$1(input) {
534
534
  function isObject$4(data) {
535
535
  return typeof data === "object" && data !== null && !Array.isArray(data);
536
536
  }
537
- function isPlainObject$12(o) {
537
+ function isPlainObject$11(o) {
538
538
  if (isObject$4(o) === false) return false;
539
539
  const ctor = o.constructor;
540
540
  if (ctor === void 0) return true;
@@ -545,7 +545,7 @@ function isPlainObject$12(o) {
545
545
  return true;
546
546
  }
547
547
  function shallowClone(o) {
548
- if (isPlainObject$12(o)) return { ...o };
548
+ if (isPlainObject$11(o)) return { ...o };
549
549
  if (Array.isArray(o)) return [...o];
550
550
  if (o instanceof Map) return new Map(o);
551
551
  if (o instanceof Set) return new Set(o);
@@ -617,7 +617,7 @@ function omit(schema, mask) {
617
617
  }));
618
618
  }
619
619
  function extend(schema, shape) {
620
- if (!isPlainObject$12(shape)) throw new Error("Invalid input to extend: expected a plain object");
620
+ if (!isPlainObject$11(shape)) throw new Error("Invalid input to extend: expected a plain object");
621
621
  const checks = schema._zod.def.checks;
622
622
  if (checks && checks.length > 0) {
623
623
  const existingShape = sourceShape(schema);
@@ -632,7 +632,7 @@ function extended(schema, shape) {
632
632
  return newShape;
633
633
  }
634
634
  function safeExtend(schema, shape) {
635
- if (!isPlainObject$12(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
635
+ if (!isPlainObject$11(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
636
636
  return clone$1(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
637
637
  }
638
638
  function merge$1(a, b) {
@@ -2039,7 +2039,7 @@ function mergeValues$1(a, b) {
2039
2039
  valid: true,
2040
2040
  data: a
2041
2041
  };
2042
- if (isPlainObject$12(a) && isPlainObject$12(b)) {
2042
+ if (isPlainObject$11(a) && isPlainObject$11(b)) {
2043
2043
  const bKeys = Object.keys(b);
2044
2044
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
2045
2045
  const newObj = {
@@ -2687,7 +2687,7 @@ var init_schemas$1 = __esmMin((() => {
2687
2687
  for (const key in shape) {
2688
2688
  const field = shape[key]._zod;
2689
2689
  if (field.values) {
2690
- if (!Object.prototype.hasOwnProperty.call(propValues, key)) assignProp$1(propValues, key, /* @__PURE__ */ new Set());
2690
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) assignProp(propValues, key, /* @__PURE__ */ new Set());
2691
2691
  for (const v of field.values) propValues[key].add(v);
2692
2692
  if (field.optin !== void 0) propValues[key].add(void 0);
2693
2693
  }
@@ -2908,7 +2908,7 @@ var init_schemas$1 = __esmMin((() => {
2908
2908
  if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
2909
2909
  if (pv[zod.def.discriminator]?.has(void 0)) undefinedCount++;
2910
2910
  for (const [k, v] of Object.entries(pv)) {
2911
- if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp$1(propValues, k, /* @__PURE__ */ new Set());
2911
+ if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp(propValues, k, /* @__PURE__ */ new Set());
2912
2912
  for (const val of v) propValues[k].add(val);
2913
2913
  }
2914
2914
  }
@@ -2972,7 +2972,7 @@ var init_schemas$1 = __esmMin((() => {
2972
2972
  memo?.attach(inst);
2973
2973
  inst._zod.parse = (payload, ctx) => {
2974
2974
  const input = payload.value;
2975
- if (!isPlainObject$12(input)) {
2975
+ if (!isPlainObject$11(input)) {
2976
2976
  payload.issues.push({
2977
2977
  expected: "record",
2978
2978
  code: "invalid_type",
@@ -4307,7 +4307,7 @@ var init_api = __esmMin((() => {
4307
4307
  //#endregion
4308
4308
  //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
4309
4309
  function assignProps(target, ...sources) {
4310
- for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp$1(target, key, source[key]);
4310
+ for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
4311
4311
  return target;
4312
4312
  }
4313
4313
  function initializeContext(params) {
@@ -4526,7 +4526,7 @@ function foldObjects(members) {
4526
4526
  if (part === null || part === void 0) continue;
4527
4527
  if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part))) parts.push(part);
4528
4528
  }
4529
- assignProp$1(properties, key, parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts });
4529
+ assignProp(properties, key, parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts });
4530
4530
  }
4531
4531
  for (const key of object.required ?? []) required.add(key);
4532
4532
  }
@@ -4656,7 +4656,7 @@ function finalize(ctx, schema) {
4656
4656
  const seen = entry[1];
4657
4657
  if (seen.def && seen.defId) {
4658
4658
  if (seen.def.id === seen.defId) delete seen.def.id;
4659
- assignProp$1(defs, seen.defId, seen.def);
4659
+ assignProp(defs, seen.defId, seen.def);
4660
4660
  }
4661
4661
  }
4662
4662
  if (ctx.external) ctx.sharedEmitDoneFor = ctx.external;
@@ -4860,7 +4860,7 @@ function toJSONSchema(input, params) {
4860
4860
  for (const entry of registry._idmap.entries()) {
4861
4861
  const [key, schema] = entry;
4862
4862
  extractDefs(ctx, schema);
4863
- assignProp$1(schemas, key, finalize(ctx, schema));
4863
+ assignProp(schemas, key, finalize(ctx, schema));
4864
4864
  }
4865
4865
  if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
4866
4866
  return { schemas };
@@ -5115,7 +5115,7 @@ var init_json_schema_processors = __esmMin((() => {
5115
5115
  if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
5116
5116
  json.type = "object";
5117
5117
  json.properties = {};
5118
- for (const key in shape) assignProp$1(json.properties, key, processSchema(shape[key], ctx, {
5118
+ for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
5119
5119
  ...params,
5120
5120
  path: [
5121
5121
  ...params.path,
@@ -5243,7 +5243,7 @@ var init_json_schema_processors = __esmMin((() => {
5243
5243
  ]
5244
5244
  });
5245
5245
  json.patternProperties = {};
5246
- for (const pattern of patterns) assignProp$1(json.patternProperties, exactPattern(pattern).source, valueSchema);
5246
+ for (const pattern of patterns) assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
5247
5247
  } else {
5248
5248
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
5249
5249
  json.propertyNames = processSchema(def.keyType, ctx, {
@@ -19264,7 +19264,7 @@ const PLUGIN_SCHEMA_SEPARATOR = "____";
19264
19264
  * console.log(isPlainObject(Object.create(null))); // true
19265
19265
  * console.log(isPlainObject(new Map())); // false
19266
19266
  */
19267
- function isPlainObject$11(object) {
19267
+ function isPlainObject$10(object) {
19268
19268
  if (typeof object !== "object") return false;
19269
19269
  if (object == null) return false;
19270
19270
  if (Object.getPrototypeOf(object) === null) return true;
@@ -19957,8 +19957,8 @@ function mergeWithDeep(target, source, merge, stack) {
19957
19957
  const merged = merge(targetValue, sourceValue, key, target, source, stack);
19958
19958
  if (merged !== void 0) target[key] = merged;
19959
19959
  else if (Array.isArray(sourceValue)) target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
19960
- else if (isObjectLike(targetValue) && isObjectLike(sourceValue) && (isPlainObject$11(targetValue) || isPlainObject$11(sourceValue) || isTypedArray$2(targetValue) || isTypedArray$2(sourceValue))) target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
19961
- else if (targetValue == null && isPlainObject$11(sourceValue)) target[key] = mergeWithDeep({}, sourceValue, merge, stack);
19960
+ else if (isObjectLike(targetValue) && isObjectLike(sourceValue) && (isPlainObject$10(targetValue) || isPlainObject$10(sourceValue) || isTypedArray$2(targetValue) || isTypedArray$2(sourceValue))) target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
19961
+ else if (targetValue == null && isPlainObject$10(sourceValue)) target[key] = mergeWithDeep({}, sourceValue, merge, stack);
19962
19962
  else if (targetValue == null && isTypedArray$2(sourceValue)) target[key] = cloneDeep(sourceValue);
19963
19963
  else if (targetValue === void 0 || sourceValue !== void 0) target[key] = sourceValue;
19964
19964
  }
@@ -20438,7 +20438,7 @@ function resolveWorkspaceScope(explicit) {
20438
20438
  * their personal space.
20439
20439
  */
20440
20440
  function describeScopedNotFound(error) {
20441
- if (toRecord(toRecord(error)?.data)?.code !== "NOT_FOUND") return;
20441
+ if (toRecord$1(toRecord$1(error)?.data)?.code !== "NOT_FOUND") return;
20442
20442
  const { workspaceId } = resolveWorkspaceScope();
20443
20443
  if (!workspaceId) return;
20444
20444
  return `Looked in workspace ${workspaceId}. If it is in your personal space, rerun with LOBEHUB_WORKSPACE_ID=${PERSONAL_SCOPE_ENV_VALUE}; for another workspace, set LOBEHUB_WORKSPACE_ID=<id>.`;
@@ -22196,7 +22196,7 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
22196
22196
  const childProcess$2 = __require("node:child_process");
22197
22197
  const path$16 = __require("node:path");
22198
22198
  const fs$17 = __require("node:fs");
22199
- const process$3 = __require("node:process");
22199
+ const process$2 = __require("node:process");
22200
22200
  const { Argument, humanReadableArgName } = require_argument();
22201
22201
  const { CommanderError } = require_error$1();
22202
22202
  const { Help, stripColor } = require_help();
@@ -22248,13 +22248,13 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
22248
22248
  this._showSuggestionAfterError = true;
22249
22249
  this._savedState = null;
22250
22250
  this._outputConfiguration = {
22251
- writeOut: (str) => process$3.stdout.write(str),
22252
- writeErr: (str) => process$3.stderr.write(str),
22251
+ writeOut: (str) => process$2.stdout.write(str),
22252
+ writeErr: (str) => process$2.stderr.write(str),
22253
22253
  outputError: (str, write) => write(str),
22254
- getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
22255
- getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
22256
- getOutHasColors: () => useColor() ?? (process$3.stdout.isTTY && process$3.stdout.hasColors?.()),
22257
- getErrHasColors: () => useColor() ?? (process$3.stderr.isTTY && process$3.stderr.hasColors?.()),
22254
+ getOutHelpWidth: () => process$2.stdout.isTTY ? process$2.stdout.columns : void 0,
22255
+ getErrHelpWidth: () => process$2.stderr.isTTY ? process$2.stderr.columns : void 0,
22256
+ getOutHasColors: () => useColor() ?? (process$2.stdout.isTTY && process$2.stdout.hasColors?.()),
22257
+ getErrHasColors: () => useColor() ?? (process$2.stderr.isTTY && process$2.stderr.hasColors?.()),
22258
22258
  stripColor: (str) => stripColor(str)
22259
22259
  };
22260
22260
  this._hidden = false;
@@ -22612,7 +22612,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22612
22612
  */
22613
22613
  _exit(exitCode, code, message) {
22614
22614
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code, message));
22615
- process$3.exit(exitCode);
22615
+ process$2.exit(exitCode);
22616
22616
  }
22617
22617
  /**
22618
22618
  * Register callback `fn` for the command.
@@ -22951,11 +22951,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
22951
22951
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
22952
22952
  parseOptions = parseOptions || {};
22953
22953
  if (argv === void 0 && parseOptions.from === void 0) {
22954
- if (process$3.versions?.electron) parseOptions.from = "electron";
22955
- const execArgv = process$3.execArgv ?? [];
22954
+ if (process$2.versions?.electron) parseOptions.from = "electron";
22955
+ const execArgv = process$2.execArgv ?? [];
22956
22956
  if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) parseOptions.from = "eval";
22957
22957
  }
22958
- if (argv === void 0) argv = process$3.argv;
22958
+ if (argv === void 0) argv = process$2.argv;
22959
22959
  this.rawArgs = argv.slice();
22960
22960
  let userArgs;
22961
22961
  switch (parseOptions.from) {
@@ -22965,7 +22965,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22965
22965
  userArgs = argv.slice(2);
22966
22966
  break;
22967
22967
  case "electron":
22968
- if (process$3.defaultApp) {
22968
+ if (process$2.defaultApp) {
22969
22969
  this._scriptPath = argv[1];
22970
22970
  userArgs = argv.slice(2);
22971
22971
  } else userArgs = argv.slice(1);
@@ -23130,16 +23130,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
23130
23130
  }
23131
23131
  launchWithNode = sourceExt.includes(path$16.extname(executableFile));
23132
23132
  let proc;
23133
- if (process$3.platform !== "win32") if (launchWithNode) {
23133
+ if (process$2.platform !== "win32") if (launchWithNode) {
23134
23134
  args.unshift(executableFile);
23135
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
23136
- proc = childProcess$2.spawn(process$3.argv[0], args, { stdio: "inherit" });
23135
+ args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
23136
+ proc = childProcess$2.spawn(process$2.argv[0], args, { stdio: "inherit" });
23137
23137
  } else proc = childProcess$2.spawn(executableFile, args, { stdio: "inherit" });
23138
23138
  else {
23139
23139
  this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
23140
23140
  args.unshift(executableFile);
23141
- args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
23142
- proc = childProcess$2.spawn(process$3.execPath, args, { stdio: "inherit" });
23141
+ args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
23142
+ proc = childProcess$2.spawn(process$2.execPath, args, { stdio: "inherit" });
23143
23143
  }
23144
23144
  if (!proc.killed) [
23145
23145
  "SIGUSR1",
@@ -23148,20 +23148,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
23148
23148
  "SIGINT",
23149
23149
  "SIGHUP"
23150
23150
  ].forEach((signal) => {
23151
- process$3.on(signal, () => {
23151
+ process$2.on(signal, () => {
23152
23152
  if (proc.killed === false && proc.exitCode === null) proc.kill(signal);
23153
23153
  });
23154
23154
  });
23155
23155
  const exitCallback = this._exitCallback;
23156
23156
  proc.on("close", (code) => {
23157
23157
  code = code ?? 1;
23158
- if (!exitCallback) process$3.exit(code);
23158
+ if (!exitCallback) process$2.exit(code);
23159
23159
  else exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
23160
23160
  });
23161
23161
  proc.on("error", (err) => {
23162
23162
  if (err.code === "ENOENT") this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
23163
23163
  else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
23164
- if (!exitCallback) process$3.exit(1);
23164
+ if (!exitCallback) process$2.exit(1);
23165
23165
  else {
23166
23166
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
23167
23167
  wrappedError.nestedError = err;
@@ -23570,13 +23570,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
23570
23570
  */
23571
23571
  _parseOptionsEnv() {
23572
23572
  this.options.forEach((option) => {
23573
- if (option.envVar && option.envVar in process$3.env) {
23573
+ if (option.envVar && option.envVar in process$2.env) {
23574
23574
  const optionKey = option.attributeName();
23575
23575
  if (this.getOptionValue(optionKey) === void 0 || [
23576
23576
  "default",
23577
23577
  "config",
23578
23578
  "env"
23579
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
23579
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$2.env[option.envVar]);
23580
23580
  else this.emit(`optionEnv:${option.name()}`);
23581
23581
  }
23582
23582
  });
@@ -23993,7 +23993,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
23993
23993
  */
23994
23994
  help(contextOptions) {
23995
23995
  this.outputHelp(contextOptions);
23996
- let exitCode = Number(process$3.exitCode ?? 0);
23996
+ let exitCode = Number(process$2.exitCode ?? 0);
23997
23997
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
23998
23998
  this._exit(exitCode, "commander.help", "(outputHelp)");
23999
23999
  }
@@ -24083,8 +24083,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
24083
24083
  * @package
24084
24084
  */
24085
24085
  function useColor() {
24086
- if (process$3.env.NO_COLOR || process$3.env.FORCE_COLOR === "0" || process$3.env.FORCE_COLOR === "false") return false;
24087
- if (process$3.env.FORCE_COLOR || process$3.env.CLICOLOR_FORCE !== void 0) return true;
24086
+ if (process$2.env.NO_COLOR || process$2.env.FORCE_COLOR === "0" || process$2.env.FORCE_COLOR === "false") return false;
24087
+ if (process$2.env.FORCE_COLOR || process$2.env.CLICOLOR_FORCE !== void 0) return true;
24088
24088
  }
24089
24089
  exports.Command = Command;
24090
24090
  exports.useColor = useColor;
@@ -25837,7 +25837,7 @@ AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator ||
25837
25837
  };
25838
25838
 
25839
25839
  //#endregion
25840
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/double-indexed-kv.js
25840
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/double-indexed-kv.js
25841
25841
  var DoubleIndexedKV = class {
25842
25842
  constructor() {
25843
25843
  this.keyToValue = /* @__PURE__ */ new Map();
@@ -25860,7 +25860,7 @@ var DoubleIndexedKV = class {
25860
25860
  };
25861
25861
 
25862
25862
  //#endregion
25863
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/registry.js
25863
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/registry.js
25864
25864
  var Registry = class {
25865
25865
  constructor(generateIdentifier) {
25866
25866
  this.generateIdentifier = generateIdentifier;
@@ -25874,6 +25874,9 @@ var Registry = class {
25874
25874
  clear() {
25875
25875
  this.kv.clear();
25876
25876
  }
25877
+ get size() {
25878
+ return this.kv.valueToKey.size;
25879
+ }
25877
25880
  getIdentifier(value) {
25878
25881
  return this.kv.getByValue(value);
25879
25882
  }
@@ -25883,7 +25886,7 @@ var Registry = class {
25883
25886
  };
25884
25887
 
25885
25888
  //#endregion
25886
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/class-registry.js
25889
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/class-registry.js
25887
25890
  var ClassRegistry = class extends Registry {
25888
25891
  constructor() {
25889
25892
  super((c) => c.name);
@@ -25901,46 +25904,22 @@ var ClassRegistry = class extends Registry {
25901
25904
  };
25902
25905
 
25903
25906
  //#endregion
25904
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/util.js
25905
- function valuesOfObj(record) {
25906
- if ("values" in Object) return Object.values(record);
25907
- const values = [];
25908
- for (const key in record) if (record.hasOwnProperty(key)) values.push(record[key]);
25909
- return values;
25910
- }
25911
- function find$2(record, predicate) {
25912
- const values = valuesOfObj(record);
25913
- if ("find" in values) return values.find(predicate);
25914
- const valuesNotNever = values;
25915
- for (let i = 0; i < valuesNotNever.length; i++) {
25916
- const value = valuesNotNever[i];
25917
- if (predicate(value)) return value;
25918
- }
25919
- }
25920
- function forEach(record, run) {
25921
- Object.entries(record).forEach(([key, value]) => run(value, key));
25922
- }
25923
- function includes(arr, value) {
25924
- return arr.indexOf(value) !== -1;
25925
- }
25926
- function findArr(record, predicate) {
25927
- for (let i = 0; i < record.length; i++) {
25928
- const value = record[i];
25929
- if (predicate(value)) return value;
25930
- }
25931
- }
25932
-
25933
- //#endregion
25934
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/custom-transformer-registry.js
25907
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/custom-transformer-registry.js
25935
25908
  var CustomTransformerRegistry = class {
25936
25909
  constructor() {
25937
25910
  this.transfomers = {};
25911
+ this.ordered = [];
25938
25912
  }
25939
25913
  register(transformer) {
25940
25914
  this.transfomers[transformer.name] = transformer;
25915
+ this.ordered = Object.values(this.transfomers);
25916
+ }
25917
+ get size() {
25918
+ return this.ordered.length;
25941
25919
  }
25942
25920
  findApplicable(v) {
25943
- return find$2(this.transfomers, (transformer) => transformer.isApplicable(v));
25921
+ const transformers = this.ordered;
25922
+ for (let i = 0; i < transformers.length; i++) if (transformers[i].isApplicable(v)) return transformers[i];
25944
25923
  }
25945
25924
  findByName(name) {
25946
25925
  return this.transfomers[name];
@@ -25948,39 +25927,60 @@ var CustomTransformerRegistry = class {
25948
25927
  };
25949
25928
 
25950
25929
  //#endregion
25951
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/is.js
25952
- const getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
25930
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/is.js
25953
25931
  const isUndefined$1 = (payload) => typeof payload === "undefined";
25954
- const isNull$1 = (payload) => payload === null;
25955
- const isPlainObject$10 = (payload) => {
25932
+ const isPlainObject$9 = (payload) => {
25956
25933
  if (typeof payload !== "object" || payload === null) return false;
25957
25934
  if (payload === Object.prototype) return false;
25958
- if (Object.getPrototypeOf(payload) === null) return true;
25959
- return Object.getPrototypeOf(payload) === Object.prototype;
25935
+ const prototype = Object.getPrototypeOf(payload);
25936
+ return prototype === null || prototype === Object.prototype;
25960
25937
  };
25961
- const isEmptyObject = (payload) => isPlainObject$10(payload) && Object.keys(payload).length === 0;
25938
+ const isEmptyObject = (payload) => isPlainObject$9(payload) && Object.keys(payload).length === 0;
25962
25939
  const isArray = (payload) => Array.isArray(payload);
25963
- const isString = (payload) => typeof payload === "string";
25964
- const isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
25965
- const isBoolean$1 = (payload) => typeof payload === "boolean";
25966
25940
  const isRegExp = (payload) => payload instanceof RegExp;
25967
25941
  const isMap = (payload) => payload instanceof Map;
25968
25942
  const isSet = (payload) => payload instanceof Set;
25969
- const isSymbol = (payload) => getType(payload) === "Symbol";
25943
+ const hasSymbolTag = (payload) => (typeof payload === "object" && payload !== null || typeof payload === "function") && payload[Symbol.toStringTag] === "Symbol";
25944
+ const isSymbol = (payload) => typeof payload === "symbol" || hasSymbolTag(payload);
25970
25945
  const isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
25971
25946
  const isError$1 = (payload) => payload instanceof Error;
25972
25947
  const isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
25973
- const isPrimitive = (payload) => isBoolean$1(payload) || isNull$1(payload) || isUndefined$1(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
25948
+ const isPrimitive = (payload) => {
25949
+ switch (typeof payload) {
25950
+ case "boolean":
25951
+ case "string":
25952
+ case "undefined":
25953
+ case "symbol": return true;
25954
+ case "number": return !isNaN(payload);
25955
+ case "object": return payload === null || hasSymbolTag(payload);
25956
+ case "function": return hasSymbolTag(payload);
25957
+ default: return false;
25958
+ }
25959
+ };
25974
25960
  const isBigint = (payload) => typeof payload === "bigint";
25975
25961
  const isInfinite = (payload) => payload === Infinity || payload === -Infinity;
25976
25962
  const isTypedArray$1 = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
25977
- const isURL = (payload) => payload instanceof URL;
25963
+ const isURL = (payload) => typeof URL !== "undefined" && payload instanceof URL;
25978
25964
 
25979
25965
  //#endregion
25980
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/pathstringifier.js
25981
- const escapeKey = (key) => key.replace(/\\/g, "\\\\").replace(/\./g, "\\.");
25966
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/pathstringifier.js
25967
+ const escapeKey = (key) => key.indexOf("\\") === -1 && key.indexOf(".") === -1 ? key : key.replace(/\\/g, "\\\\").replace(/\./g, "\\.");
25982
25968
  const stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
25969
+ const splitOnDots = (string) => {
25970
+ const result = [];
25971
+ let start = 0;
25972
+ for (;;) {
25973
+ const dot = string.indexOf(".", start);
25974
+ if (dot === -1) {
25975
+ result.push(start === 0 ? string : string.slice(start));
25976
+ return result;
25977
+ }
25978
+ result.push(string.slice(start, dot));
25979
+ start = dot + 1;
25980
+ }
25981
+ };
25983
25982
  const parsePath = (string, legacyPaths) => {
25983
+ if (typeof string === "string" && string.indexOf("\\") === -1) return splitOnDots(string);
25984
25984
  const result = [];
25985
25985
  let segment = "";
25986
25986
  for (let i = 0; i < string.length; i++) {
@@ -26011,7 +26011,42 @@ const parsePath = (string, legacyPaths) => {
26011
26011
  };
26012
26012
 
26013
26013
  //#endregion
26014
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/transformer.js
26014
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/date.js
26015
+ const pad2 = (n) => n < 10 ? "0" + n : "" + n;
26016
+ const pad3 = (n) => n < 10 ? "00" + n : n < 100 ? "0" + n : "" + n;
26017
+ function toISOString(date) {
26018
+ const year = date.getUTCFullYear();
26019
+ if (year < 1e3 || year > 9999) return date.toISOString();
26020
+ return year + "-" + pad2(date.getUTCMonth() + 1) + "-" + pad2(date.getUTCDate()) + "T" + pad2(date.getUTCHours()) + ":" + pad2(date.getUTCMinutes()) + ":" + pad2(date.getUTCSeconds()) + "." + pad3(date.getUTCMilliseconds()) + "Z";
26021
+ }
26022
+ const digits = (s, from, count) => {
26023
+ let n = 0;
26024
+ for (let i = from; i < from + count; i++) {
26025
+ const d = s.charCodeAt(i) - 48;
26026
+ if (d < 0 || d > 9) return -1;
26027
+ n = n * 10 + d;
26028
+ }
26029
+ return n;
26030
+ };
26031
+ function parseISOString(value) {
26032
+ if (typeof value === "string" && value.length === 24 && value.charCodeAt(4) === 45 && value.charCodeAt(7) === 45 && value.charCodeAt(10) === 84 && value.charCodeAt(13) === 58 && value.charCodeAt(16) === 58 && value.charCodeAt(19) === 46 && value.charCodeAt(23) === 90) {
26033
+ const year = digits(value, 0, 4);
26034
+ const month = digits(value, 5, 2);
26035
+ const day = digits(value, 8, 2);
26036
+ const hours = digits(value, 11, 2);
26037
+ const minutes = digits(value, 14, 2);
26038
+ const seconds = digits(value, 17, 2);
26039
+ const ms = digits(value, 20, 3);
26040
+ if (year >= 1e3 && month >= 1 && month <= 12 && day >= 1 && hours >= 0 && hours <= 23 && minutes >= 0 && minutes <= 59 && seconds >= 0 && seconds <= 59 && ms >= 0) {
26041
+ const date = new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds, ms));
26042
+ if (date.getUTCDate() === day) return date;
26043
+ }
26044
+ }
26045
+ return new Date(value);
26046
+ }
26047
+
26048
+ //#endregion
26049
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/transformer.js
26015
26050
  function simpleTransformation(isApplicable, annotation, transform, untransform) {
26016
26051
  return {
26017
26052
  isApplicable,
@@ -26027,7 +26062,7 @@ const simpleRules = [
26027
26062
  console.error("Please add a BigInt polyfill.");
26028
26063
  return v;
26029
26064
  }),
26030
- simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
26065
+ simpleTransformation(isDate, "Date", toISOString, parseISOString),
26031
26066
  simpleTransformation(isError$1, "Error", (v, superJson) => {
26032
26067
  const baseError = {
26033
26068
  name: v.name,
@@ -26039,7 +26074,7 @@ const simpleRules = [
26039
26074
  });
26040
26075
  return baseError;
26041
26076
  }, (v, superJson) => {
26042
- const e = new Error(v.message, { cause: v.cause });
26077
+ const e = "cause" in v ? new Error(v.message, { cause: v.cause }) : new Error(v.message);
26043
26078
  e.name = v.name;
26044
26079
  e.stack = v.stack;
26045
26080
  superJson.allowedErrorProps.forEach((prop) => {
@@ -26073,7 +26108,7 @@ function compositeTransformation(isApplicable, annotation, transform, untransfor
26073
26108
  };
26074
26109
  }
26075
26110
  const symbolRule = compositeTransformation((s, superJson) => {
26076
- if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
26111
+ if (superJson.symbolRegistry.size > 0 && isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
26077
26112
  return false;
26078
26113
  }, (s, superJson) => {
26079
26114
  return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
@@ -26096,13 +26131,33 @@ const constructorToName = [
26096
26131
  obj[ctor.name] = ctor;
26097
26132
  return obj;
26098
26133
  }, {});
26099
- const typedArrayRule = compositeTransformation(isTypedArray$1, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
26134
+ const bigIntConstructorToName = {};
26135
+ if (typeof BigInt64Array !== "undefined") bigIntConstructorToName[BigInt64Array.name] = BigInt64Array;
26136
+ if (typeof BigUint64Array !== "undefined") bigIntConstructorToName[BigUint64Array.name] = BigUint64Array;
26137
+ const typedArrayRule = compositeTransformation(isTypedArray$1, (v) => ["typed-array", v.constructor.name], (v) => [...v].map((n) => {
26138
+ if (typeof n === "bigint") return n.toString();
26139
+ if (typeof n === "number") {
26140
+ if (Number.isNaN(n)) return "NaN";
26141
+ if (n === Infinity) return "Infinity";
26142
+ if (n === -Infinity) return "-Infinity";
26143
+ if (n === 0 && 1 / n === -Infinity) return "-0";
26144
+ }
26145
+ return n;
26146
+ }), (v, a) => {
26147
+ const bigIntCtor = bigIntConstructorToName[a[1]];
26148
+ if (bigIntCtor) return new bigIntCtor(v.map((n) => BigInt(n)));
26100
26149
  const ctor = constructorToName[a[1]];
26101
26150
  if (!ctor) throw new Error("Trying to deserialize unknown typed array");
26102
- return new ctor(v);
26151
+ return new ctor(v.map((n) => {
26152
+ if (n === "NaN") return NaN;
26153
+ if (n === "Infinity") return Infinity;
26154
+ if (n === "-Infinity") return -Infinity;
26155
+ if (n === "-0") return -0;
26156
+ return n;
26157
+ }));
26103
26158
  });
26104
26159
  function isInstanceOfRegisteredClass(potentialClass, superJson) {
26105
- if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
26160
+ if (superJson.classRegistry.size > 0 && potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
26106
26161
  return false;
26107
26162
  }
26108
26163
  const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
@@ -26131,23 +26186,58 @@ const customRule = compositeTransformation((value, superJson) => {
26131
26186
  if (!transformer) throw new Error("Trying to deserialize unknown custom value");
26132
26187
  return transformer.deserialize(v);
26133
26188
  });
26134
- const compositeRules = [
26135
- classRule,
26136
- symbolRule,
26137
- customRule,
26138
- typedArrayRule
26189
+ const [undefinedRule, bigintRule, dateRule, errorRule, regexpRule, setRule, mapRule, nonFiniteRule, negativeZeroRule, urlRule] = simpleRules;
26190
+ const objectRules = [
26191
+ dateRule,
26192
+ errorRule,
26193
+ regexpRule,
26194
+ setRule,
26195
+ mapRule,
26196
+ urlRule
26139
26197
  ];
26140
- const transformValue = (value, superJson) => {
26141
- const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
26142
- if (applicableCompositeRule) return {
26143
- value: applicableCompositeRule.transform(value, superJson),
26144
- type: applicableCompositeRule.annotation(value, superJson)
26198
+ const applySimple = (rule, value, superJson) => ({
26199
+ value: rule.transform(value, superJson),
26200
+ type: rule.annotation
26201
+ });
26202
+ /** Class, symbol and custom rules only. */
26203
+ const transformRegisteredValue = (value, superJson) => {
26204
+ if (classRule.isApplicable(value, superJson)) return {
26205
+ value: classRule.transform(value, superJson),
26206
+ type: classRule.annotation(value, superJson)
26145
26207
  };
26146
- const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
26147
- if (applicableSimpleRule) return {
26148
- value: applicableSimpleRule.transform(value, superJson),
26149
- type: applicableSimpleRule.annotation
26208
+ if (symbolRule.isApplicable(value, superJson)) return {
26209
+ value: symbolRule.transform(value, superJson),
26210
+ type: symbolRule.annotation(value, superJson)
26150
26211
  };
26212
+ if (superJson.customTransformerRegistry.size > 0) {
26213
+ const transformer = superJson.customTransformerRegistry.findApplicable(value);
26214
+ if (transformer) return {
26215
+ value: transformer.serialize(value),
26216
+ type: ["custom", transformer.name]
26217
+ };
26218
+ }
26219
+ };
26220
+ const transformValue = (value, superJson) => {
26221
+ const registered = transformRegisteredValue(value, superJson);
26222
+ if (registered) return registered;
26223
+ switch (typeof value) {
26224
+ case "undefined": return applySimple(undefinedRule, value, superJson);
26225
+ case "bigint": return applySimple(bigintRule, value, superJson);
26226
+ case "number":
26227
+ if (nonFiniteRule.isApplicable(value, superJson)) return applySimple(nonFiniteRule, value, superJson);
26228
+ if (negativeZeroRule.isApplicable(value, superJson)) return applySimple(negativeZeroRule, value, superJson);
26229
+ return;
26230
+ case "object":
26231
+ case "function":
26232
+ if (value === null) return;
26233
+ if (typedArrayRule.isApplicable(value, superJson)) return {
26234
+ value: typedArrayRule.transform(value, superJson),
26235
+ type: typedArrayRule.annotation(value, superJson)
26236
+ };
26237
+ for (let i = 0; i < objectRules.length; i++) if (objectRules[i].isApplicable(value, superJson)) return applySimple(objectRules[i], value, superJson);
26238
+ return;
26239
+ default: return;
26240
+ }
26151
26241
  };
26152
26242
  const simpleRulesByAnnotation = {};
26153
26243
  simpleRules.forEach((rule) => {
@@ -26169,7 +26259,41 @@ const untransformValue = (json, type, superJson) => {
26169
26259
  };
26170
26260
 
26171
26261
  //#endregion
26172
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/accessDeep.js
26262
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/util.js
26263
+ function forEach(record, run) {
26264
+ const keys = Object.keys(record);
26265
+ for (let i = 0; i < keys.length; i++) run(record[keys[i]], keys[i]);
26266
+ }
26267
+ function includes(arr, value) {
26268
+ return arr.indexOf(value) !== -1;
26269
+ }
26270
+ const getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
26271
+ function copy(target) {
26272
+ if (typeof target !== "object" || target === null) return target;
26273
+ if (Symbol.toStringTag in target) {
26274
+ const type = getType(target);
26275
+ if (type === "Array") return target.map(copy);
26276
+ return type === "Object" ? copyObject(target) : target;
26277
+ }
26278
+ if (isArray(target)) return target.map(copy);
26279
+ return copyObject(target);
26280
+ }
26281
+ function copyObject(target) {
26282
+ const prototype = Object.getPrototypeOf(target);
26283
+ if (prototype !== Object.prototype || prototype.constructor !== Object) return target;
26284
+ const result = {};
26285
+ const keys = Object.keys(target);
26286
+ for (let i = 0; i < keys.length; i++) {
26287
+ const key = keys[i];
26288
+ if (key !== "__proto__") result[key] = copy(target[key]);
26289
+ }
26290
+ const symbols = Object.getOwnPropertySymbols(target);
26291
+ for (let i = 0; i < symbols.length; i++) if (Object.prototype.propertyIsEnumerable.call(target, symbols[i])) result[symbols[i]] = copy(target[symbols[i]]);
26292
+ return result;
26293
+ }
26294
+
26295
+ //#endregion
26296
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/accessDeep.js
26173
26297
  const getNthKey = (value, n) => {
26174
26298
  if (n > value.size) throw new Error("index out of bounds");
26175
26299
  const keys = value.keys();
@@ -26180,6 +26304,15 @@ const getNthKey = (value, n) => {
26180
26304
  return keys.next().value;
26181
26305
  };
26182
26306
  function validatePath(path) {
26307
+ let suspicious = false;
26308
+ for (let i = 0; i < path.length; i++) {
26309
+ const key = path[i];
26310
+ if (key === "__proto__" || key === "prototype" || key === "constructor") {
26311
+ suspicious = true;
26312
+ break;
26313
+ }
26314
+ }
26315
+ if (!suspicious) return;
26183
26316
  if (includes(path, "__proto__")) throw new Error("__proto__ is not allowed as a property");
26184
26317
  if (includes(path, "prototype")) throw new Error("prototype is not allowed as a property");
26185
26318
  if (includes(path, "constructor")) throw new Error("constructor is not allowed as a property");
@@ -26205,16 +26338,14 @@ const getDeep = (object, path) => {
26205
26338
  }
26206
26339
  return object;
26207
26340
  };
26208
- const setDeep = (object, path, mapper) => {
26209
- validatePath(path);
26210
- if (path.length === 0) return mapper(object);
26211
- let parent = object;
26212
- for (let i = 0; i < path.length - 1; i++) {
26341
+ const walk$1 = (parent, path) => {
26342
+ let i = 0;
26343
+ for (; i < path.length - 1; i++) {
26213
26344
  const key = path[i];
26214
26345
  if (isArray(parent)) {
26215
26346
  const index = +key;
26216
26347
  parent = parent[index];
26217
- } else if (isPlainObject$10(parent)) parent = parent[key];
26348
+ } else if (isPlainObject$9(parent)) parent = parent[key];
26218
26349
  else if (isSet(parent)) {
26219
26350
  const row = +key;
26220
26351
  parent = getNthKey(parent, row);
@@ -26233,25 +26364,41 @@ const setDeep = (object, path, mapper) => {
26233
26364
  }
26234
26365
  }
26235
26366
  }
26367
+ return [parent, i];
26368
+ };
26369
+ const walkDeep = (object, path) => {
26370
+ validatePath(path);
26371
+ const [parent, rest] = walk$1(object, path);
26372
+ return [parent, path.slice(rest)];
26373
+ };
26374
+ const setDeep = (object, path, mapper) => {
26375
+ validatePath(path);
26376
+ if (path.length === 0) return mapper(object);
26377
+ const [parent] = walk$1(object, path);
26236
26378
  const lastKey = path[path.length - 1];
26237
26379
  if (isArray(parent)) parent[+lastKey] = mapper(parent[+lastKey]);
26238
- else if (isPlainObject$10(parent)) parent[lastKey] = mapper(parent[lastKey]);
26380
+ else if (isPlainObject$9(parent)) parent[lastKey] = mapper(parent[lastKey]);
26239
26381
  if (isSet(parent)) {
26240
- const oldValue = getNthKey(parent, +lastKey);
26382
+ const index = +lastKey;
26383
+ const oldValue = getNthKey(parent, index);
26241
26384
  const newValue = mapper(oldValue);
26242
26385
  if (oldValue !== newValue) {
26243
- parent.delete(oldValue);
26244
- parent.add(newValue);
26386
+ const values = [...parent];
26387
+ values[index] = newValue;
26388
+ parent.clear();
26389
+ values.forEach((value) => parent.add(value));
26245
26390
  }
26246
26391
  }
26247
26392
  if (isMap(parent)) {
26248
- const row = +path[path.length - 2];
26249
- const keyToRow = getNthKey(parent, row);
26393
+ const keyToRow = getNthKey(parent, +path[path.length - 2]);
26250
26394
  switch (+lastKey === 0 ? "key" : "value") {
26251
26395
  case "key": {
26252
26396
  const newKey = mapper(keyToRow);
26253
- parent.set(newKey, parent.get(keyToRow));
26254
- if (newKey !== keyToRow) parent.delete(keyToRow);
26397
+ if (newKey !== keyToRow) {
26398
+ const entries = [...parent];
26399
+ parent.clear();
26400
+ entries.forEach(([k, v]) => parent.set(k === keyToRow ? newKey : k, v));
26401
+ }
26255
26402
  break;
26256
26403
  }
26257
26404
  case "value":
@@ -26263,26 +26410,28 @@ const setDeep = (object, path, mapper) => {
26263
26410
  };
26264
26411
 
26265
26412
  //#endregion
26266
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/plainer.js
26413
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/plainer.js
26267
26414
  const enableLegacyPaths = (version) => version < 1;
26268
- function traverse(tree, walker, version, origin = []) {
26269
- if (!tree) return;
26270
- const legacyPaths = enableLegacyPaths(version);
26271
- if (!isArray(tree)) {
26272
- forEach(tree, (subtree, key) => traverse(subtree, walker, version, [...origin, ...parsePath(key, legacyPaths)]));
26273
- return;
26274
- }
26275
- const [nodeValue, children] = tree;
26276
- if (children) forEach(children, (child, key) => {
26277
- traverse(child, walker, version, [...origin, ...parsePath(key, legacyPaths)]);
26278
- });
26279
- walker(nodeValue, origin);
26280
- }
26281
26415
  function applyValueAnnotations(plain, annotations, version, superJson) {
26282
- traverse(annotations, (type, path) => {
26283
- plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
26284
- }, version);
26285
- return plain;
26416
+ const legacyPaths = enableLegacyPaths(version);
26417
+ const apply = (node, path, tree, error) => {
26418
+ if (!tree) return node;
26419
+ const children = isArray(tree) ? tree[1] : tree;
26420
+ if (children) {
26421
+ let parent;
26422
+ let rest = [];
26423
+ if (!error) try {
26424
+ [parent, rest] = walkDeep(node, path);
26425
+ } catch (e) {
26426
+ error = e;
26427
+ }
26428
+ for (const key of Object.keys(children)) apply(parent, [...rest, ...parsePath(key, legacyPaths)], children[key], error);
26429
+ }
26430
+ if (!isArray(tree)) return node;
26431
+ if (error) throw error;
26432
+ return setDeep(node, path, (v) => untransformValue(v, tree[0], superJson));
26433
+ };
26434
+ return apply(plain, [], annotations);
26286
26435
  }
26287
26436
  function applyReferentialEqualityAnnotations(plain, annotations, version) {
26288
26437
  const legacyPaths = enableLegacyPaths(version);
@@ -26301,12 +26450,7 @@ function applyReferentialEqualityAnnotations(plain, annotations, version) {
26301
26450
  } else forEach(annotations, apply);
26302
26451
  return plain;
26303
26452
  }
26304
- const isDeep = (object, superJson) => isPlainObject$10(object) || isArray(object) || isMap(object) || isSet(object) || isError$1(object) || isInstanceOfRegisteredClass(object, superJson);
26305
- function addIdentity(object, path, identities) {
26306
- const existingSet = identities.get(object);
26307
- if (existingSet) existingSet.push(path);
26308
- else identities.set(object, [path]);
26309
- }
26453
+ const isDeep = (object, superJson) => isPlainObject$9(object) || isArray(object) || isMap(object) || isSet(object) || isError$1(object) || isInstanceOfRegisteredClass(object, superJson);
26310
26454
  function generateReferentialEqualityAnnotations(identitites, dedupe) {
26311
26455
  const result = {};
26312
26456
  let rootEqualityPaths = void 0;
@@ -26321,151 +26465,147 @@ function generateReferentialEqualityAnnotations(identitites, dedupe) {
26321
26465
  else return [rootEqualityPaths, result];
26322
26466
  else return isEmptyObject(result) ? void 0 : result;
26323
26467
  }
26324
- const walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
26468
+ var PathNode = class {
26469
+ /** `key` is null only for the root. */
26470
+ constructor(parent, key) {
26471
+ this.parent = parent;
26472
+ this.key = key;
26473
+ }
26474
+ };
26475
+ /** The first visit of a non-primitive, which is also the path node of its children. */
26476
+ var Seen = class extends PathNode {
26477
+ constructor() {
26478
+ super(...arguments);
26479
+ this.more = void 0;
26480
+ this.done = false;
26481
+ this.value = void 0;
26482
+ this.annotations = void 0;
26483
+ }
26484
+ };
26485
+ const toPath$3 = (node) => {
26486
+ const path = [];
26487
+ for (; node; node = node.parent) if (node.key !== null) path.push(node.key);
26488
+ return path.reverse();
26489
+ };
26490
+ const pathsOf = (seen) => {
26491
+ const paths = [toPath$3(seen)];
26492
+ seen.more?.forEach((node) => paths.push(toPath$3(node)));
26493
+ return paths;
26494
+ };
26495
+ /**
26496
+ * The annotation record of a plain container, built lazily so each flattened key is joined once.
26497
+ * Keys are kept as an object would order them: array indices ascending, then insertion order.
26498
+ */
26499
+ var PendingAnnotations = class {
26500
+ constructor() {
26501
+ /** Pairs: escaped array-index key, tree. */
26502
+ this.indices = [];
26503
+ /** Pairs: escaped key and tree, or `key.` prefix and a nested PendingAnnotations. */
26504
+ this.rest = [];
26505
+ }
26506
+ };
26507
+ const isArrayIndex = (key) => {
26508
+ const length = key.length;
26509
+ if (length === 0 || length > 10) return false;
26510
+ for (let i = 0; i < length; i++) {
26511
+ const code = key.charCodeAt(i);
26512
+ if (code < 48 || code > 57) return false;
26513
+ }
26514
+ if (key.charCodeAt(0) === 48) return length === 1;
26515
+ return length < 10 || +key < 4294967295;
26516
+ };
26517
+ function materialize(pending, prefix, out) {
26518
+ const { indices, rest } = pending;
26519
+ for (let i = 0; i < indices.length; i += 2) out[prefix + indices[i]] = indices[i + 1];
26520
+ for (let i = 0; i < rest.length; i += 2) {
26521
+ const value = rest[i + 1];
26522
+ if (value instanceof PendingAnnotations) materialize(value, prefix + rest[i], out);
26523
+ else out[prefix + rest[i]] = value;
26524
+ }
26525
+ return out;
26526
+ }
26527
+ const toRecord = (annotations) => annotations instanceof PendingAnnotations ? materialize(annotations, "", {}) : annotations;
26528
+ const isPlainContainer = (object) => isPlainObject$9(object) || isArray(object) && Object.getPrototypeOf(object) === Array.prototype;
26529
+ function walk(object, ctx, parent, key) {
26325
26530
  const primitive = isPrimitive(object);
26531
+ let seen;
26326
26532
  if (!primitive) {
26327
- addIdentity(object, path, identities);
26328
- const seen = seenObjects.get(object);
26329
- if (seen) return dedupe ? { transformedValue: null } : seen;
26330
- }
26331
- if (!isDeep(object, superJson)) {
26332
- const transformed = transformValue(object, superJson);
26333
- const result = transformed ? {
26334
- transformedValue: transformed.value,
26335
- annotations: [transformed.type]
26336
- } : { transformedValue: object };
26337
- if (!primitive) seenObjects.set(object, result);
26338
- return result;
26533
+ seen = ctx.seen.get(object);
26534
+ if (seen) {
26535
+ (seen.more ?? (seen.more = [])).push(new PathNode(parent, key));
26536
+ if (seen.done) {
26537
+ if (ctx.dedupe) {
26538
+ ctx.annotations = void 0;
26539
+ return null;
26540
+ }
26541
+ ctx.annotations = seen.annotations;
26542
+ return seen.value;
26543
+ }
26544
+ ctx.annotations = void 0;
26545
+ return isDeep(object, ctx.superJson) ? null : leaf(object, ctx, seen);
26546
+ }
26547
+ seen = new Seen(parent, key);
26548
+ ctx.seen.set(object, seen);
26549
+ parent = seen;
26339
26550
  }
26340
- if (includes(objectsInThisPath, object)) return { transformedValue: null };
26341
- const transformationResult = transformValue(object, superJson);
26551
+ const plainContainer = !primitive && isPlainContainer(object);
26552
+ if (!plainContainer && !isDeep(object, ctx.superJson)) return leaf(object, ctx, seen);
26553
+ if (primitive && key !== null) parent = new PathNode(parent, key);
26554
+ const transformationResult = plainContainer ? transformRegisteredValue(object, ctx.superJson) : transformValue(object, ctx.superJson);
26342
26555
  const transformed = transformationResult?.value ?? object;
26343
26556
  const transformedValue = isArray(transformed) ? [] : {};
26344
- const innerAnnotations = {};
26345
- forEach(transformed, (value, index) => {
26557
+ let inner;
26558
+ const keys = Object.keys(transformed);
26559
+ for (let i = 0; i < keys.length; i++) {
26560
+ const index = keys[i];
26346
26561
  if (index === "__proto__" || index === "constructor" || index === "prototype") throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
26347
- const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
26348
- transformedValue[index] = recursiveResult.transformedValue;
26349
- if (isArray(recursiveResult.annotations)) innerAnnotations[escapeKey(index)] = recursiveResult.annotations;
26350
- else if (isPlainObject$10(recursiveResult.annotations)) forEach(recursiveResult.annotations, (tree, key) => {
26351
- innerAnnotations[escapeKey(index) + "." + key] = tree;
26352
- });
26353
- });
26354
- const result = isEmptyObject(innerAnnotations) ? {
26355
- transformedValue,
26356
- annotations: !!transformationResult ? [transformationResult.type] : void 0
26357
- } : {
26358
- transformedValue,
26359
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
26360
- };
26361
- if (!primitive) seenObjects.set(object, result);
26362
- return result;
26363
- };
26364
-
26365
- //#endregion
26366
- //#region node_modules/.pnpm/copy-anything@4.1.5/node_modules/copy-anything/dist/index.js
26367
- /**
26368
- * Assigns a prop the copy is keeping, preserving whether it was enumerable. Callers decide
26369
- * _whether_ to keep a non-enumerable prop before getting here, so by this point the answer is
26370
- * always yes.
26371
- */
26372
- function assignProp(carry, key, newVal, originalObject) {
26373
- if (Object.prototype.propertyIsEnumerable.call(originalObject, key)) {
26374
- carry[key] = newVal;
26375
- return;
26562
+ transformedValue[index] = walk(transformed[index], ctx, parent, index);
26563
+ const childAnnotations = ctx.annotations;
26564
+ if (childAnnotations !== void 0) {
26565
+ inner ?? (inner = new PendingAnnotations());
26566
+ const escaped = escapeKey(index);
26567
+ if (childAnnotations instanceof PendingAnnotations) inner.rest.push(escaped + ".", childAnnotations);
26568
+ else if (isArrayIndex(escaped)) inner.indices.push(escaped, childAnnotations);
26569
+ else inner.rest.push(escaped, childAnnotations);
26570
+ }
26376
26571
  }
26377
- Object.defineProperty(carry, key, {
26378
- value: newVal,
26379
- enumerable: false,
26380
- writable: true,
26381
- configurable: true
26382
- });
26572
+ const annotations = inner ? transformationResult ? [transformationResult.type, materialize(inner, "", {})] : inner : transformationResult ? [transformationResult.type] : void 0;
26573
+ return finish(ctx, seen, transformedValue, annotations);
26383
26574
  }
26384
- /**
26385
- * Whether `value` is an object literal, as opposed to a class instance, a built-in like `Date`, an
26386
- * `arguments` object, or an object with a null prototype.
26387
- *
26388
- * The prototype check comes first because it is cheap and rejects almost everything; the tag check
26389
- * is only reached by values that are about to be cloned anyway.
26390
- */
26391
- function isPlainObject$9(value) {
26392
- return Object.getPrototypeOf(value) === Object.prototype && Object.prototype.toString.call(value) === "[object Object]";
26575
+ function leaf(object, ctx, seen) {
26576
+ const transformed = transformValue(object, ctx.superJson);
26577
+ return transformed ? finish(ctx, seen, transformed.value, [transformed.type]) : finish(ctx, seen, object, void 0);
26393
26578
  }
26394
- /**
26395
- * Returns the clone that `value` should be replaced with, and queues it to be filled in later.
26396
- * Anything that isn't an array or a plain object is returned untouched.
26397
- *
26398
- * Reusing the clone already registered in `clones` is what makes circular and shared references
26399
- * work: the placeholder is registered before its contents exist, so a reference back to an ancestor
26400
- * resolves to it rather than walking forever.
26401
- */
26402
- function cloneRef(value, clones, sources, dests) {
26403
- if (typeof value !== "object" || value === null) return value;
26404
- const array = Array.isArray(value);
26405
- if (!array && !isPlainObject$9(value)) return value;
26406
- const existing = clones.get(value);
26407
- if (existing !== void 0) return existing;
26408
- const clone = array ? new Array(value.length) : {};
26409
- clones.set(value, clone);
26410
- sources.push(value);
26411
- dests.push(clone);
26412
- return clone;
26413
- }
26414
- /**
26415
- * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the
26416
- * original object. Arrays and the objects inside them are cloned as well.
26417
- *
26418
- * Nesting depth is limited only by available memory, and circular references are reproduced in the
26419
- * copy rather than followed forever. Two props pointing at the same object still point at one
26420
- * shared copy afterwards.
26421
- *
26422
- * @param target Target can be anything
26423
- * @param [options={}] See type {@link Options} for more details.
26424
- *
26425
- * - `{ props: ['key1'] }` will only copy the `key1` property. When using this you will need to cast
26426
- * the return type manually (in order to keep the TS implementation in here simple I didn't
26427
- * built a complex auto resolved type for those few cases people want to use this option)
26428
- * - `{ nonenumerable: true }` will copy all non-enumerable properties. Default is `{}`
26429
- *
26430
- * @returns The target with replaced values
26431
- */
26432
- function copy(target, options = {}) {
26433
- if (typeof target !== "object" || target === null) return target;
26434
- const clones = /* @__PURE__ */ new Map();
26435
- const sources = [];
26436
- const dests = [];
26437
- const result = cloneRef(target, clones, sources, dests);
26438
- const onlyProps = Array.isArray(options.props) ? options.props : void 0;
26439
- const nonenumerable = options.nonenumerable === true;
26440
- while (sources.length) {
26441
- const source = sources.pop();
26442
- const dest = dests.pop();
26443
- if (Array.isArray(source)) {
26444
- for (let i = 0; i < source.length; i++) if (i in source) dest[i] = cloneRef(source[i], clones, sources, dests);
26445
- continue;
26446
- }
26447
- if (nonenumerable) for (const key of Object.getOwnPropertyNames(source)) {
26448
- if (key === "__proto__") continue;
26449
- if (onlyProps && !onlyProps.includes(key)) continue;
26450
- assignProp(dest, key, cloneRef(source[key], clones, sources, dests), source);
26451
- }
26452
- else for (const key in source) {
26453
- if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
26454
- if (key === "__proto__") continue;
26455
- if (onlyProps && !onlyProps.includes(key)) continue;
26456
- dest[key] = cloneRef(source[key], clones, sources, dests);
26457
- }
26458
- for (const key of Object.getOwnPropertySymbols(source)) {
26459
- if (onlyProps && !onlyProps.includes(key)) continue;
26460
- if (!nonenumerable && !Object.prototype.propertyIsEnumerable.call(source, key)) continue;
26461
- assignProp(dest, key, cloneRef(source[key], clones, sources, dests), source);
26462
- }
26579
+ function finish(ctx, seen, value, annotations) {
26580
+ if (seen) {
26581
+ seen.done = true;
26582
+ seen.value = value;
26583
+ seen.annotations = annotations;
26463
26584
  }
26464
- return result;
26585
+ ctx.annotations = annotations;
26586
+ return value;
26587
+ }
26588
+ function walkRoot(object, superJson, dedupe) {
26589
+ const ctx = {
26590
+ superJson,
26591
+ dedupe,
26592
+ seen: /* @__PURE__ */ new Map(),
26593
+ annotations: void 0
26594
+ };
26595
+ const transformedValue = walk(object, ctx, null, null);
26596
+ const identities = /* @__PURE__ */ new Map();
26597
+ ctx.seen.forEach((seen, value) => {
26598
+ if (seen.more) identities.set(value, pathsOf(seen));
26599
+ });
26600
+ return {
26601
+ transformedValue,
26602
+ annotations: toRecord(ctx.annotations),
26603
+ identities
26604
+ };
26465
26605
  }
26466
26606
 
26467
26607
  //#endregion
26468
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/index.js
26608
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/index.js
26469
26609
  var SuperJSON = class {
26470
26610
  /**
26471
26611
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
@@ -26478,14 +26618,13 @@ var SuperJSON = class {
26478
26618
  this.dedupe = dedupe;
26479
26619
  }
26480
26620
  serialize(object) {
26481
- const identities = /* @__PURE__ */ new Map();
26482
- const output = walker(object, identities, this, this.dedupe);
26621
+ const output = walkRoot(object, this, this.dedupe);
26483
26622
  const res = { json: output.transformedValue };
26484
26623
  if (output.annotations) res.meta = {
26485
26624
  ...res.meta,
26486
26625
  values: output.annotations
26487
26626
  };
26488
- const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
26627
+ const equalityAnnotations = generateReferentialEqualityAnnotations(output.identities, this.dedupe);
26489
26628
  if (equalityAnnotations) res.meta = {
26490
26629
  ...res.meta,
26491
26630
  referentialEqualities: equalityAnnotations
@@ -49303,14 +49442,14 @@ const TRANSIENT_NETWORK_ERROR_CODES = new Set([
49303
49442
  "UND_ERR_SOCKET"
49304
49443
  ]);
49305
49444
  function getErrorCause(error) {
49306
- return errorCauseFrom(error) ?? toRecord(error)?.cause;
49445
+ return errorCauseFrom(error) ?? toRecord$1(error)?.cause;
49307
49446
  }
49308
49447
  function getErrorCode(error) {
49309
- const code = toRecord(error)?.code;
49448
+ const code = toRecord$1(error)?.code;
49310
49449
  return typeof code === "string" ? code : void 0;
49311
49450
  }
49312
49451
  function getErrorMessage(error) {
49313
- const message = errorMessageFrom(error) ?? toRecord(error)?.message;
49452
+ const message = errorMessageFrom(error) ?? toRecord$1(error)?.message;
49314
49453
  return typeof message === "string" ? message : void 0;
49315
49454
  }
49316
49455
  function getErrorChain(error) {
@@ -49349,7 +49488,7 @@ function isTransientNetworkError(error) {
49349
49488
  * NOT_FOUND; callers use this to fall back to an older endpoint.
49350
49489
  */
49351
49490
  function isMissingProcedure$2(error) {
49352
- return toRecord(toRecord(error)?.data)?.code === "NOT_FOUND" && /procedure/i.test(getErrorMessage(error) ?? "");
49491
+ return toRecord$1(toRecord$1(error)?.data)?.code === "NOT_FOUND" && /procedure/i.test(getErrorMessage(error) ?? "");
49353
49492
  }
49354
49493
 
49355
49494
  //#endregion
@@ -57894,7 +58033,7 @@ const publishCanvasArtifact = async (client, params) => {
57894
58033
  title
57895
58034
  });
57896
58035
  } catch (error) {
57897
- const code = toRecord(toRecord(error)?.data)?.code;
58036
+ const code = toRecord$1(toRecord$1(error)?.data)?.code;
57898
58037
  if (code === "BAD_REQUEST" || code === "CONFLICT" || code === "FORBIDDEN" || code === "NOT_FOUND") {
57899
58038
  const previous = pending.previous;
57900
58039
  writeBinding(manifest, previous.canvasId || previous.deploymentId ? previous : {
@@ -57917,7 +58056,7 @@ const publishCanvasArtifact = async (client, params) => {
57917
58056
  requestedSlug: params.slug,
57918
58057
  version: saved.version
57919
58058
  }).catch((error) => {
57920
- if (toRecord(toRecord(error)?.data)?.code === "BAD_REQUEST") writeBinding(manifest, {
58059
+ if (toRecord$1(toRecord$1(error)?.data)?.code === "BAD_REQUEST") writeBinding(manifest, {
57921
58060
  ...activeBinding,
57922
58061
  pendingCanvas: {
57923
58062
  ...pending,
@@ -58014,7 +58153,7 @@ const fingerprintCreate = (entries, requestedSlug, title) => {
58014
58153
  * Rejections such as quota, size or an expired upload carry other codes.
58015
58154
  */
58016
58155
  const isUnknownCommitOutcome = (error) => {
58017
- const code = toRecord(toRecord(error)?.data)?.code;
58156
+ const code = toRecord$1(toRecord$1(error)?.data)?.code;
58018
58157
  return code === void 0 || code === "INTERNAL_SERVER_ERROR";
58019
58158
  };
58020
58159
  /** Market's answer when a reused key carries a different request. */
@@ -66011,7 +66150,7 @@ var AntigravityAdapter = class {
66011
66150
  if (raw.event === "init") {
66012
66151
  this.latestTurnCompleted = false;
66013
66152
  this.sessionId = pickString$1(raw.conversation_id);
66014
- this.model = pickString$1(toRecord(raw.init)?.model);
66153
+ this.model = pickString$1(toRecord$1(raw.init)?.model);
66015
66154
  return this.openStream();
66016
66155
  }
66017
66156
  if (raw.event === "result" && isRecord$8(raw.result)) return this.handleResult(raw.result);
@@ -66116,8 +66255,8 @@ var AntigravityAdapter = class {
66116
66255
  return events;
66117
66256
  }
66118
66257
  handleTool(index, step) {
66119
- const info = toRecord(step.tool_info);
66120
- const subagents = toRecord(step.subagent_info);
66258
+ const info = toRecord$1(step.tool_info);
66259
+ const subagents = toRecord$1(step.subagent_info);
66121
66260
  const name = pickString$1(info?.name) ?? pickString$1(step.tool_name);
66122
66261
  if (!name && !subagents) return [];
66123
66262
  const events = this.openStream();
@@ -66139,7 +66278,7 @@ var AntigravityAdapter = class {
66139
66278
  } else if (info?.parameters !== void 0) pending.payload.arguments = args;
66140
66279
  if (info?.parameters !== void 0 || step.state === "DONE") events.push(...this.startTool(pending));
66141
66280
  if (step.state === "DONE") {
66142
- const error = toRecord(info?.error);
66281
+ const error = toRecord$1(info?.error);
66143
66282
  const content = [stringifyOutput(info?.output ?? subagents), pickString$1(error?.message) ?? stringifyOutput(info?.error)].filter(Boolean).join("\n");
66144
66283
  events.push(...this.toolResult(pending, content, info?.error != null));
66145
66284
  this.pendingTools.delete(index);
@@ -68822,13 +68961,13 @@ const acpContentBlockText = (value) => {
68822
68961
  * notification `params` or the nested `update`.
68823
68962
  */
68824
68963
  const isAcpReplayMessage = (raw) => {
68825
- const params = toRecord(toRecord(raw)?.params);
68826
- const update = toRecord(params?.update);
68827
- return toRecord(params?._meta)?.isReplay === true || toRecord(update?._meta)?.isReplay === true;
68964
+ const params = toRecord$1(toRecord$1(raw)?.params);
68965
+ const update = toRecord$1(params?.update);
68966
+ return toRecord$1(params?._meta)?.isReplay === true || toRecord$1(update?._meta)?.isReplay === true;
68828
68967
  };
68829
68968
  /** ACP extension dedup marker: `_meta.eventId` on the notification `params`. */
68830
68969
  const acpEventIdOf = (raw) => {
68831
- const meta = toRecord(toRecord(toRecord(raw)?.params)?._meta);
68970
+ const meta = toRecord$1(toRecord$1(toRecord$1(raw)?.params)?._meta);
68832
68971
  return typeof meta?.eventId === "string" ? meta.eventId : void 0;
68833
68972
  };
68834
68973
 
@@ -334441,7 +334580,7 @@ var stdio_exports = /* @__PURE__ */ __exportAll$2({
334441
334580
  function getDefaultEnvironment() {
334442
334581
  const env = {};
334443
334582
  for (const key of DEFAULT_INHERITED_ENV_VARS) {
334444
- const value = process$1.env[key];
334583
+ const value = _w.env[key];
334445
334584
  if (value === void 0) continue;
334446
334585
  if (value.startsWith("()")) continue;
334447
334586
  env[key] = value;
@@ -334452,7 +334591,7 @@ var import_cross_spawn$1, DEFAULT_INHERITED_ENV_VARS, StdioClientTransport;
334452
334591
  var init_stdio = __esmMin((() => {
334453
334592
  init_src_CeKsbNLO();
334454
334593
  import_cross_spawn$1 = /* @__PURE__ */ __toESM$2(require_cross_spawn(), 1);
334455
- DEFAULT_INHERITED_ENV_VARS = process$1.platform === "win32" ? [
334594
+ DEFAULT_INHERITED_ENV_VARS = _w.platform === "win32" ? [
334456
334595
  "APPDATA",
334457
334596
  "COMSPEC",
334458
334597
  "HOMEDRIVE",
@@ -334509,7 +334648,7 @@ var init_stdio = __esmMin((() => {
334509
334648
  this._serverParams.stderr ?? "inherit"
334510
334649
  ],
334511
334650
  shell: false,
334512
- windowsHide: process$1.platform === "win32",
334651
+ windowsHide: _w.platform === "win32",
334513
334652
  cwd: this._serverParams.cwd
334514
334653
  });
334515
334654
  this._process.on("error", (error) => {
@@ -335365,7 +335504,7 @@ var init_client = __esmMin((() => {
335365
335504
  name: toolName
335366
335505
  }, timeout === void 0 ? void 0 : { timeout });
335367
335506
  } catch (error) {
335368
- if (SdkError$1.isInstance(error) && error.code === SdkErrorCode$2.UnsupportedResultType && toRecord(error.data)?.resultType === "input_required") return {
335507
+ if (SdkError$1.isInstance(error) && error.code === SdkErrorCode$2.UnsupportedResultType && toRecord$1(error.data)?.resultType === "input_required") return {
335369
335508
  content: [{
335370
335509
  type: "text",
335371
335510
  text: "This MCP tool requires user input that LobeHub does not support yet. Use a tool that does not require additional input."
@@ -337543,9 +337682,9 @@ const getSubprocessResult = ({ stdout }) => {
337543
337682
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/utils/standard-stream.js
337544
337683
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
337545
337684
  const STANDARD_STREAMS = [
337546
- process$1.stdin,
337547
- process$1.stdout,
337548
- process$1.stderr
337685
+ _w.stdin,
337686
+ _w.stdout,
337687
+ _w.stderr
337549
337688
  ];
337550
337689
  const STANDARD_STREAMS_ALIASES = [
337551
337690
  "stdin",
@@ -337670,9 +337809,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
337670
337809
  //#endregion
337671
337810
  //#region node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
337672
337811
  function isUnicodeSupported() {
337673
- const { env } = process$1;
337812
+ const { env } = _w;
337674
337813
  const { TERM, TERM_PROGRAM } = env;
337675
- if (process$1.platform !== "win32") return TERM !== "linux";
337814
+ if (_w.platform !== "win32") return TERM !== "linux";
337676
337815
  return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
337677
337816
  }
337678
337817
 
@@ -338207,7 +338346,7 @@ function traversePathUp(startPath) {
338207
338346
 
338208
338347
  //#endregion
338209
338348
  //#region node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
338210
- const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath = process$1.execPath, addExecPath = true } = {}) => {
338349
+ const npmRunPath = ({ cwd = _w.cwd(), path: pathOption = _w.env[pathKey()], preferLocal = true, execPath = _w.execPath, addExecPath = true } = {}) => {
338211
338350
  const cwdPath = path.resolve(toPath(cwd));
338212
338351
  const result = [];
338213
338352
  const pathParts = pathOption.split(path.delimiter);
@@ -338225,7 +338364,7 @@ const applyExecPath = (result, pathParts, execPath, cwdPath) => {
338225
338364
  const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
338226
338365
  if (!pathParts.includes(pathPart)) result.push(pathPart);
338227
338366
  };
338228
- const npmRunPathEnv = ({ env = process$1.env, ...options } = {}) => {
338367
+ const npmRunPathEnv = ({ env = _w.env, ...options } = {}) => {
338229
338368
  env = { ...env };
338230
338369
  const pathName = pathKey({ env });
338231
338370
  options.path = env[pathName];
@@ -339360,7 +339499,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
339360
339499
  };
339361
339500
  const getDefaultCwd = () => {
339362
339501
  try {
339363
- return process$1.cwd();
339502
+ return _w.cwd();
339364
339503
  } catch (error) {
339365
339504
  error.message = `The current directory does not exist.\n${error.message}`;
339366
339505
  throw error;
@@ -339396,7 +339535,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
339396
339535
  options.killSignal = normalizeKillSignal(options.killSignal);
339397
339536
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
339398
339537
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
339399
- if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
339538
+ if (_w.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
339400
339539
  return {
339401
339540
  file,
339402
339541
  commandArguments,
@@ -339423,7 +339562,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
339423
339562
  });
339424
339563
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
339425
339564
  const env = extendEnv ? {
339426
- ...process$1.env,
339565
+ ..._w.env,
339427
339566
  ...envOption
339428
339567
  } : envOption;
339429
339568
  if (preferLocal || node) return npmRunPathEnv({
@@ -340425,12 +340564,12 @@ const guessStreamDirection = {
340425
340564
  }
340426
340565
  };
340427
340566
  const getStandardStreamDirection = (value) => {
340428
- if ([0, process$1.stdin].includes(value)) return "input";
340567
+ if ([0, _w.stdin].includes(value)) return "input";
340429
340568
  if ([
340430
340569
  1,
340431
340570
  2,
340432
- process$1.stdout,
340433
- process$1.stderr
340571
+ _w.stdout,
340572
+ _w.stderr
340434
340573
  ].includes(value)) return "output";
340435
340574
  };
340436
340575
  const DEFAULT_DIRECTION = "output";
@@ -341494,9 +341633,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
341494
341633
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
341495
341634
  };
341496
341635
  const getIpcExport = () => {
341497
- const anyProcess = process$1;
341636
+ const anyProcess = _w;
341498
341637
  const isSubprocess = true;
341499
- const ipc = process$1.channel !== void 0;
341638
+ const ipc = _w.channel !== void 0;
341500
341639
  return {
341501
341640
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
341502
341641
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -341973,7 +342112,7 @@ var SignalExitFallback = class extends SignalExitBase {
341973
342112
  };
341974
342113
  var SignalExit = class extends SignalExitBase {
341975
342114
  /* c8 ignore start */
341976
- #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
342115
+ #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
341977
342116
  /* c8 ignore stop */
341978
342117
  #emitter = new Emitter();
341979
342118
  #process;
@@ -342068,8 +342207,8 @@ var SignalExit = class extends SignalExitBase {
342068
342207
  } else return og.call(this.#process, ev, ...args);
342069
342208
  }
342070
342209
  };
342071
- const process$2 = globalThis.process;
342072
- const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
342210
+ const process$1 = globalThis.process;
342211
+ const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
342073
342212
 
342074
342213
  //#endregion
342075
342214
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/terminate/cleanup.js