@lichao0223/lobehub-cli 0.0.101 → 0.0.103

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 _w, { cwd, execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
18
+ import process$1, { 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
 
@@ -413,7 +413,7 @@ var init_heteroCliArgs = __esmMin((() => {
413
413
  }));
414
414
 
415
415
  //#endregion
416
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/util.js
416
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
417
417
  function getEnumValues(entries) {
418
418
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
419
419
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -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) {
@@ -693,17 +693,6 @@ function prefixIssues(path, issues) {
693
693
  function unwrapMessage(message) {
694
694
  return typeof message === "string" ? message : message?.message;
695
695
  }
696
- /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
697
- function sizeCaps(defChecks) {
698
- const caps = [];
699
- for (const ch of defChecks ?? []) {
700
- const d = ch._zod.def;
701
- if (!/_(length|size)$|_equals$/.test(d.check)) break;
702
- const max = d.maximum ?? d.length ?? d.size;
703
- if (max >= 0) caps.push([max, ch]);
704
- }
705
- return caps;
706
- }
707
696
  function attachSchema(issues, start, inst) {
708
697
  var _a;
709
698
  for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
@@ -964,7 +953,7 @@ var init_util$3 = __esmMin((() => {
964
953
  }));
965
954
 
966
955
  //#endregion
967
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/core.js
956
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
968
957
  function newError(Definition) {
969
958
  const E = _E;
970
959
  if (E) {
@@ -1076,7 +1065,7 @@ var init_core$3 = __esmMin((() => {
1076
1065
  }));
1077
1066
 
1078
1067
  //#endregion
1079
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/errors.js
1068
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
1080
1069
  function _getMessage() {
1081
1070
  const internals = this._zod;
1082
1071
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -1196,7 +1185,7 @@ var init_errors$3 = __esmMin((() => {
1196
1185
  }));
1197
1186
 
1198
1187
  //#endregion
1199
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/parse.js
1188
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
1200
1189
  function finalizeParams(callee, params) {
1201
1190
  return {
1202
1191
  callee: params?.callee ?? callee,
@@ -1403,7 +1392,7 @@ var init_parse$1 = __esmMin((() => {
1403
1392
  }));
1404
1393
 
1405
1394
  //#endregion
1406
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/regexes.js
1395
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
1407
1396
  function nanoidOfLength(length) {
1408
1397
  return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);
1409
1398
  }
@@ -1470,7 +1459,7 @@ var init_regexes = __esmMin((() => {
1470
1459
  }));
1471
1460
 
1472
1461
  //#endregion
1473
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/checks.js
1462
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
1474
1463
  var $ZodCheck, _whenHasLength, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckOverwrite;
1475
1464
  var init_checks$1 = __esmMin((() => {
1476
1465
  init_core$3();
@@ -1772,7 +1761,7 @@ var init_checks$1 = __esmMin((() => {
1772
1761
  }));
1773
1762
 
1774
1763
  //#endregion
1775
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/doc.js
1764
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
1776
1765
  var Doc;
1777
1766
  var init_doc$1 = __esmMin((() => {
1778
1767
  Doc = class {
@@ -1810,18 +1799,18 @@ var init_doc$1 = __esmMin((() => {
1810
1799
  }));
1811
1800
 
1812
1801
  //#endregion
1813
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/versions.js
1802
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
1814
1803
  var version$3;
1815
1804
  var init_versions = __esmMin((() => {
1816
1805
  version$3 = {
1817
1806
  major: 4,
1818
1807
  minor: 6,
1819
- patch: 7
1808
+ patch: 5
1820
1809
  };
1821
1810
  }));
1822
1811
 
1823
1812
  //#endregion
1824
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/schemas.js
1813
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
1825
1814
  async function validateAsync(inst, value) {
1826
1815
  const ctx = { async: true };
1827
1816
  return toStandardResult(await inst._zod.run({
@@ -1929,25 +1918,6 @@ function isValidJWT$1(token, algorithm = null) {
1929
1918
  return false;
1930
1919
  }
1931
1920
  }
1932
- function capSize(inst, size) {
1933
- const caps = sizeCaps(inst._zod.def.checks);
1934
- if (!caps.length) return;
1935
- const cap = Math.min(...caps.map((c) => c[0]));
1936
- const parse = inst._zod.parse;
1937
- inst._zod.parse = (payload, ctx) => {
1938
- const n = size(payload.value);
1939
- if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
1940
- for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
1941
- const start = payload.issues.length;
1942
- ch._zod.check(payload);
1943
- payload.issues[start].continue = false;
1944
- attachSchema(payload.issues, start, inst);
1945
- return payload;
1946
- }
1947
- }
1948
- return parse(payload, ctx);
1949
- };
1950
- }
1951
1921
  function handleArrayResult(result, final, index) {
1952
1922
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1953
1923
  final.value[index] = result.value;
@@ -2069,7 +2039,7 @@ function mergeValues$1(a, b) {
2069
2039
  valid: true,
2070
2040
  data: a
2071
2041
  };
2072
- if (isPlainObject$12(a) && isPlainObject$12(b)) {
2042
+ if (isPlainObject$11(a) && isPlainObject$11(b)) {
2073
2043
  const bKeys = Object.keys(b);
2074
2044
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
2075
2045
  const newObj = {
@@ -2214,7 +2184,7 @@ function handleRefineResult(result, payload, input, inst) {
2214
2184
  payload.issues.push(issue(_iss));
2215
2185
  }
2216
2186
  }
2217
- var $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodDate, arraySize, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodLazy, $ZodCustom;
2187
+ var $ZodType, toStandardResult, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, URL_BAD_FORMAT, URL_UNPARSEABLE, asciiTabOrNewline, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, ipv6Alphabet, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, base64Charset, $ZodBase64, base64urlCharset, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodUndefined, $ZodNull, $ZodAny, $ZodUnknown, $ZodNever, $ZodDate, $ZodArray, NO_SYMBOL_KEYS, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodPreprocess, $ZodReadonly, $ZodLazy, $ZodCustom;
2218
2188
  var init_schemas$1 = __esmMin((() => {
2219
2189
  init_checks$1();
2220
2190
  init_core$3();
@@ -2661,7 +2631,6 @@ var init_schemas$1 = __esmMin((() => {
2661
2631
  return payload;
2662
2632
  };
2663
2633
  });
2664
- arraySize = (input) => Array.isArray(input) ? input.length : -1;
2665
2634
  $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
2666
2635
  $ZodType.init(inst, def);
2667
2636
  const memo = globalConfig.memoizer;
@@ -2695,7 +2664,6 @@ var init_schemas$1 = __esmMin((() => {
2695
2664
  if (proms.length) return Promise.all(proms).then(() => payload);
2696
2665
  return payload;
2697
2666
  };
2698
- capSize(inst, arraySize);
2699
2667
  });
2700
2668
  NO_SYMBOL_KEYS = [];
2701
2669
  $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
@@ -2719,7 +2687,7 @@ var init_schemas$1 = __esmMin((() => {
2719
2687
  for (const key in shape) {
2720
2688
  const field = shape[key]._zod;
2721
2689
  if (field.values) {
2722
- 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());
2723
2691
  for (const v of field.values) propValues[key].add(v);
2724
2692
  if (field.optin !== void 0) propValues[key].add(void 0);
2725
2693
  }
@@ -2940,7 +2908,7 @@ var init_schemas$1 = __esmMin((() => {
2940
2908
  if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
2941
2909
  if (pv[zod.def.discriminator]?.has(void 0)) undefinedCount++;
2942
2910
  for (const [k, v] of Object.entries(pv)) {
2943
- 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());
2944
2912
  for (const val of v) propValues[k].add(val);
2945
2913
  }
2946
2914
  }
@@ -3004,7 +2972,7 @@ var init_schemas$1 = __esmMin((() => {
3004
2972
  memo?.attach(inst);
3005
2973
  inst._zod.parse = (payload, ctx) => {
3006
2974
  const input = payload.value;
3007
- if (!isPlainObject$12(input)) {
2975
+ if (!isPlainObject$11(input)) {
3008
2976
  payload.issues.push({
3009
2977
  expected: "record",
3010
2978
  code: "invalid_type",
@@ -3353,7 +3321,7 @@ var init_schemas$1 = __esmMin((() => {
3353
3321
  }));
3354
3322
 
3355
3323
  //#endregion
3356
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
3324
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
3357
3325
  function isRef$1(value) {
3358
3326
  return value !== null && typeof value === "object";
3359
3327
  }
@@ -3609,7 +3577,7 @@ var init_memoizer = __esmMin((() => {
3609
3577
  }));
3610
3578
 
3611
3579
  //#endregion
3612
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/en.js
3580
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
3613
3581
  function en_default() {
3614
3582
  return { localeError: error() };
3615
3583
  }
@@ -3722,7 +3690,7 @@ var init_en$1 = __esmMin((() => {
3722
3690
  }));
3723
3691
 
3724
3692
  //#endregion
3725
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/registries.js
3693
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
3726
3694
  function registry$1() {
3727
3695
  return new $ZodRegistry();
3728
3696
  }
@@ -3773,11 +3741,11 @@ var init_registries = __esmMin((() => {
3773
3741
  }));
3774
3742
 
3775
3743
  //#endregion
3776
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/compile.js
3744
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/compile.js
3777
3745
  var init_compile = __esmMin((() => {}));
3778
3746
 
3779
3747
  //#endregion
3780
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/api.js
3748
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
3781
3749
  function snapshotChecks(def) {
3782
3750
  if (def.checks) def.checks = [...def.checks];
3783
3751
  return def;
@@ -4337,9 +4305,9 @@ var init_api = __esmMin((() => {
4337
4305
  }));
4338
4306
 
4339
4307
  //#endregion
4340
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
4308
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
4341
4309
  function assignProps(target, ...sources) {
4342
- 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]);
4343
4311
  return target;
4344
4312
  }
4345
4313
  function initializeContext(params) {
@@ -4558,7 +4526,7 @@ function foldObjects(members) {
4558
4526
  if (part === null || part === void 0) continue;
4559
4527
  if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part))) parts.push(part);
4560
4528
  }
4561
- 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 });
4562
4530
  }
4563
4531
  for (const key of object.required ?? []) required.add(key);
4564
4532
  }
@@ -4688,7 +4656,7 @@ function finalize(ctx, schema) {
4688
4656
  const seen = entry[1];
4689
4657
  if (seen.def && seen.defId) {
4690
4658
  if (seen.def.id === seen.defId) delete seen.def.id;
4691
- assignProp$1(defs, seen.defId, seen.def);
4659
+ assignProp(defs, seen.defId, seen.def);
4692
4660
  }
4693
4661
  }
4694
4662
  if (ctx.external) ctx.sharedEmitDoneFor = ctx.external;
@@ -4778,7 +4746,7 @@ var init_to_json_schema = __esmMin((() => {
4778
4746
  }));
4779
4747
 
4780
4748
  //#endregion
4781
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
4749
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
4782
4750
  function aggregateChecks(schema) {
4783
4751
  const agg = {};
4784
4752
  const def = schema._zod.def;
@@ -4892,7 +4860,7 @@ function toJSONSchema(input, params) {
4892
4860
  for (const entry of registry._idmap.entries()) {
4893
4861
  const [key, schema] = entry;
4894
4862
  extractDefs(ctx, schema);
4895
- assignProp$1(schemas, key, finalize(ctx, schema));
4863
+ assignProp(schemas, key, finalize(ctx, schema));
4896
4864
  }
4897
4865
  if (Object.keys(defs).length > 0) schemas.__shared = { [ctx.target === "draft-2020-12" ? "$defs" : "definitions"]: defs };
4898
4866
  return { schemas };
@@ -5147,7 +5115,7 @@ var init_json_schema_processors = __esmMin((() => {
5147
5115
  if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
5148
5116
  json.type = "object";
5149
5117
  json.properties = {};
5150
- 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, {
5151
5119
  ...params,
5152
5120
  path: [
5153
5121
  ...params.path,
@@ -5275,7 +5243,7 @@ var init_json_schema_processors = __esmMin((() => {
5275
5243
  ]
5276
5244
  });
5277
5245
  json.patternProperties = {};
5278
- 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);
5279
5247
  } else {
5280
5248
  if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
5281
5249
  json.propertyNames = processSchema(def.keyType, ctx, {
@@ -5426,7 +5394,7 @@ var init_json_schema_processors = __esmMin((() => {
5426
5394
  }));
5427
5395
 
5428
5396
  //#endregion
5429
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/core/index.js
5397
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/index.js
5430
5398
  var init_core$2 = __esmMin((() => {
5431
5399
  init_core$3();
5432
5400
  init_parse$1();
@@ -5448,13 +5416,13 @@ var init_core$2 = __esmMin((() => {
5448
5416
  }));
5449
5417
 
5450
5418
  //#endregion
5451
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/checks.js
5419
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/checks.js
5452
5420
  var init_checks = __esmMin((() => {
5453
5421
  init_core$2();
5454
5422
  }));
5455
5423
 
5456
5424
  //#endregion
5457
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/errors.js
5425
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
5458
5426
  function _lazyMethod(proto, key, make) {
5459
5427
  Object.defineProperty(proto, key, {
5460
5428
  configurable: true,
@@ -5510,7 +5478,7 @@ var init_errors$2 = __esmMin((() => {
5510
5478
  }));
5511
5479
 
5512
5480
  //#endregion
5513
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/parse.js
5481
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
5514
5482
  var parse$3, parseAsync, safeParse, safeParseAsync, encode$3, decode$2, encodeAsync, decodeAsync, safeEncode, safeDecode, safeEncodeAsync, safeDecodeAsync;
5515
5483
  var init_parse = __esmMin((() => {
5516
5484
  init_core$2();
@@ -5530,7 +5498,7 @@ var init_parse = __esmMin((() => {
5530
5498
  }));
5531
5499
 
5532
5500
  //#endregion
5533
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
5501
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
5534
5502
  function _ensureDefaultLocale() {
5535
5503
  if (!globalConfig.localeError) config$1(en_default());
5536
5504
  }
@@ -6519,7 +6487,7 @@ var init_schemas = __esmMin((() => {
6519
6487
  }));
6520
6488
 
6521
6489
  //#endregion
6522
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/compat.js
6490
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/compat.js
6523
6491
  var ZodIssueCode$1, ZodFirstPartyTypeKind$1;
6524
6492
  var init_compat = __esmMin((() => {
6525
6493
  init_core$2();
@@ -6541,7 +6509,7 @@ var init_compat = __esmMin((() => {
6541
6509
  }));
6542
6510
 
6543
6511
  //#endregion
6544
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/iso.js
6512
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.js
6545
6513
  function datetime(params) {
6546
6514
  return _isoDateTime(ZodISODateTime, params);
6547
6515
  }
@@ -6554,7 +6522,7 @@ var init_iso = __esmMin((() => {
6554
6522
  }));
6555
6523
 
6556
6524
  //#endregion
6557
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/coerce.js
6525
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/coerce.js
6558
6526
  function number(params) {
6559
6527
  return _coercedNumber(ZodNumber$1, params);
6560
6528
  }
@@ -6567,7 +6535,7 @@ var init_coerce = __esmMin((() => {
6567
6535
  }));
6568
6536
 
6569
6537
  //#endregion
6570
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/external.js
6538
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.js
6571
6539
  var init_external$1 = __esmMin((() => {
6572
6540
  init_core$2();
6573
6541
  init_schemas();
@@ -6587,7 +6555,7 @@ var init_external$1 = __esmMin((() => {
6587
6555
  }));
6588
6556
 
6589
6557
  //#endregion
6590
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/index.js
6558
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/index.js
6591
6559
  var init_zod$1 = __esmMin((() => {
6592
6560
  init_external$1();
6593
6561
  init_external$1();
@@ -7018,7 +6986,7 @@ var init_heterogeneousAgent = __esmMin((() => {
7018
6986
 
7019
6987
  //#endregion
7020
6988
  //#region ../../packages/types/src/agent/heteroSelectorCapabilities.ts
7021
- var HETEROGENEOUS_AGENT_DEFAULT_SELECTION, AMP_AGENT_MODES, CLAUDE_CODE_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_FLAGS, CODEX_COMMON_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_CONFIG_KEY$1, CODEX_DEEPSEEK_V4_REASONING_EFFORT_LEVELS, CODEX_GLM_5_2_REASONING_EFFORT_LEVELS, CODEX_MAX_REASONING_EFFORT_LEVELS, CODEX_ULTRA_REASONING_MODELS, CODEX_MAX_REASONING_MODELS, QODER_REASONING_EFFORT_LEVELS, QODER_REASONING_EFFORT_FLAG, COPILOT_REASONING_EFFORT_LEVELS, COPILOT_REASONING_EFFORT_FLAG, CODEX_SERVICE_TIER_CONFIG_KEY$1, toCodexServiceTier, CODEX_FAST_SERVICE_TIER_VALUES, isAmpAgentMode, isClaudeCodeReasoningEffort, isCodexReasoningEffort, isGrokBuildReasoningEffort, isQoderReasoningEffort, isCopilotReasoningEffort, isCodexFastServiceTier, getCodexReasoningEffortLevels, resolveAmpAgentMode, CODEX_MODEL_FLAGS$2, resolveClaudeCodeModel, resolveClaudeCodeReasoningEffort, resolveCodexModel, resolveCodexReasoningEffort, resolveCodexSpeedMode, resolveGrokBuildReasoningEffort, resolveQoderReasoningEffort, resolveCopilotReasoningEffort, resolvePersistedModel, parseModelTuple, MODEL_FLAGS_ENCODING, HETERO_SELECTOR_CAPABILITIES, modelFlagsOf, COPILOT_MODEL_FLAGS, GROK_BUILD_MODEL_FLAGS, KIMI_CODE_MODEL_FLAGS, OPENCODE_MODEL_FLAGS, PI_MODEL_FLAGS, QODER_MODEL_FLAGS;
6989
+ var HETEROGENEOUS_AGENT_DEFAULT_SELECTION, AMP_AGENT_MODES, CLAUDE_CODE_REASONING_EFFORT_LEVELS, ANTIGRAVITY_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_LEVELS, GROK_BUILD_REASONING_EFFORT_FLAGS, CODEX_COMMON_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_LEVELS, CODEX_REASONING_EFFORT_CONFIG_KEY$1, CODEX_DEEPSEEK_V4_REASONING_EFFORT_LEVELS, CODEX_GLM_5_2_REASONING_EFFORT_LEVELS, CODEX_MAX_REASONING_EFFORT_LEVELS, CODEX_ULTRA_REASONING_MODELS, CODEX_MAX_REASONING_MODELS, QODER_REASONING_EFFORT_LEVELS, QODER_REASONING_EFFORT_FLAG, COPILOT_REASONING_EFFORT_LEVELS, COPILOT_REASONING_EFFORT_FLAG, CODEX_SERVICE_TIER_CONFIG_KEY$1, toCodexServiceTier, CODEX_FAST_SERVICE_TIER_VALUES, isAmpAgentMode, isClaudeCodeReasoningEffort, isCodexReasoningEffort, isGrokBuildReasoningEffort, isQoderReasoningEffort, isCopilotReasoningEffort, isCodexFastServiceTier, getCodexReasoningEffortLevels, resolveAmpAgentMode, CODEX_MODEL_FLAGS$2, resolveClaudeCodeModel, resolveClaudeCodeReasoningEffort, resolveCodexModel, resolveCodexReasoningEffort, resolveCodexSpeedMode, resolveGrokBuildReasoningEffort, resolveQoderReasoningEffort, resolveCopilotReasoningEffort, resolvePersistedModel, parseModelTuple, MODEL_FLAGS_ENCODING, HETERO_SELECTOR_CAPABILITIES, modelFlagsOf, COPILOT_MODEL_FLAGS, GROK_BUILD_MODEL_FLAGS, KIMI_CODE_MODEL_FLAGS, OPENCODE_MODEL_FLAGS, PI_MODEL_FLAGS, QODER_MODEL_FLAGS;
7022
6990
  var init_heteroSelectorCapabilities = __esmMin((() => {
7023
6991
  init_heteroCliArgs();
7024
6992
  HETEROGENEOUS_AGENT_DEFAULT_SELECTION = "default";
@@ -7035,6 +7003,13 @@ var init_heteroSelectorCapabilities = __esmMin((() => {
7035
7003
  "xhigh",
7036
7004
  "max"
7037
7005
  ];
7006
+ ANTIGRAVITY_REASONING_EFFORT_LEVELS = [
7007
+ "low",
7008
+ "medium",
7009
+ "high",
7010
+ "xhigh",
7011
+ "max"
7012
+ ];
7038
7013
  GROK_BUILD_REASONING_EFFORT_LEVELS = [
7039
7014
  "low",
7040
7015
  "medium",
@@ -7158,14 +7133,24 @@ var init_heteroSelectorCapabilities = __esmMin((() => {
7158
7133
  kind: "flag"
7159
7134
  };
7160
7135
  HETERO_SELECTOR_CAPABILITIES = {
7161
- "antigravity": { model: {
7162
- encodings: [{
7163
- flags: ["--model"],
7164
- kind: "flag"
7165
- }],
7166
- resolve: resolvePersistedModel,
7167
- source: "catalog"
7168
- } },
7136
+ "antigravity": {
7137
+ effort: {
7138
+ encodings: [{
7139
+ flags: ["--effort"],
7140
+ kind: "flag"
7141
+ }],
7142
+ levels: (model, models) => models ? models.find((entry) => entry.id === model)?.effortLevels ?? [] : ANTIGRAVITY_REASONING_EFFORT_LEVELS,
7143
+ resolve: resolveClaudeCodeReasoningEffort
7144
+ },
7145
+ model: {
7146
+ encodings: [{
7147
+ flags: ["--model"],
7148
+ kind: "flag"
7149
+ }],
7150
+ resolve: resolveClaudeCodeModel,
7151
+ source: "catalog"
7152
+ }
7153
+ },
7169
7154
  "amp": { mode: {
7170
7155
  encodings: [{
7171
7156
  flags: ["--mode"],
@@ -18423,6 +18408,8 @@ const API_KEY_FULL_ACCESS_SCOPE = "*";
18423
18408
  /**
18424
18409
  * The selectable scope catalog. `model:invoke` is its own tier because it is
18425
18410
  * the one that burns money (chat/completions, image, video, music, asr).
18411
+ * On the public REST API, text / JSON / image / video generation, speech and
18412
+ * transcription spend credits under `generation:write` instead.
18426
18413
  *
18427
18414
  * Deliberately absent (a restricted key can never obtain them):
18428
18415
  * - `api_key:*` — keys must not mint keys (self-provisioning)
@@ -18445,6 +18432,8 @@ const API_KEY_SCOPES = [
18445
18432
  "file:write",
18446
18433
  "knowledge:read",
18447
18434
  "knowledge:write",
18435
+ "generation:read",
18436
+ "generation:write",
18448
18437
  "mcp:read",
18449
18438
  "mcp:write",
18450
18439
  "usage:read",
@@ -19284,7 +19273,7 @@ const PLUGIN_SCHEMA_SEPARATOR = "____";
19284
19273
  * console.log(isPlainObject(Object.create(null))); // true
19285
19274
  * console.log(isPlainObject(new Map())); // false
19286
19275
  */
19287
- function isPlainObject$11(object) {
19276
+ function isPlainObject$10(object) {
19288
19277
  if (typeof object !== "object") return false;
19289
19278
  if (object == null) return false;
19290
19279
  if (Object.getPrototypeOf(object) === null) return true;
@@ -19977,8 +19966,8 @@ function mergeWithDeep(target, source, merge, stack) {
19977
19966
  const merged = merge(targetValue, sourceValue, key, target, source, stack);
19978
19967
  if (merged !== void 0) target[key] = merged;
19979
19968
  else if (Array.isArray(sourceValue)) target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);
19980
- 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);
19981
- else if (targetValue == null && isPlainObject$11(sourceValue)) target[key] = mergeWithDeep({}, sourceValue, merge, stack);
19969
+ 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);
19970
+ else if (targetValue == null && isPlainObject$10(sourceValue)) target[key] = mergeWithDeep({}, sourceValue, merge, stack);
19982
19971
  else if (targetValue == null && isTypedArray$2(sourceValue)) target[key] = cloneDeep(sourceValue);
19983
19972
  else if (targetValue === void 0 || sourceValue !== void 0) target[key] = sourceValue;
19984
19973
  }
@@ -20458,7 +20447,7 @@ function resolveWorkspaceScope(explicit) {
20458
20447
  * their personal space.
20459
20448
  */
20460
20449
  function describeScopedNotFound(error) {
20461
- if (toRecord(toRecord(error)?.data)?.code !== "NOT_FOUND") return;
20450
+ if (toRecord$1(toRecord$1(error)?.data)?.code !== "NOT_FOUND") return;
20462
20451
  const { workspaceId } = resolveWorkspaceScope();
20463
20452
  if (!workspaceId) return;
20464
20453
  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>.`;
@@ -22216,7 +22205,7 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
22216
22205
  const childProcess$2 = __require("node:child_process");
22217
22206
  const path$16 = __require("node:path");
22218
22207
  const fs$17 = __require("node:fs");
22219
- const process$2 = __require("node:process");
22208
+ const process$3 = __require("node:process");
22220
22209
  const { Argument, humanReadableArgName } = require_argument();
22221
22210
  const { CommanderError } = require_error$1();
22222
22211
  const { Help, stripColor } = require_help();
@@ -22268,13 +22257,13 @@ var require_command = /* @__PURE__ */ __commonJSMin$2(((exports) => {
22268
22257
  this._showSuggestionAfterError = true;
22269
22258
  this._savedState = null;
22270
22259
  this._outputConfiguration = {
22271
- writeOut: (str) => process$2.stdout.write(str),
22272
- writeErr: (str) => process$2.stderr.write(str),
22260
+ writeOut: (str) => process$3.stdout.write(str),
22261
+ writeErr: (str) => process$3.stderr.write(str),
22273
22262
  outputError: (str, write) => write(str),
22274
- getOutHelpWidth: () => process$2.stdout.isTTY ? process$2.stdout.columns : void 0,
22275
- getErrHelpWidth: () => process$2.stderr.isTTY ? process$2.stderr.columns : void 0,
22276
- getOutHasColors: () => useColor() ?? (process$2.stdout.isTTY && process$2.stdout.hasColors?.()),
22277
- getErrHasColors: () => useColor() ?? (process$2.stderr.isTTY && process$2.stderr.hasColors?.()),
22263
+ getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
22264
+ getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
22265
+ getOutHasColors: () => useColor() ?? (process$3.stdout.isTTY && process$3.stdout.hasColors?.()),
22266
+ getErrHasColors: () => useColor() ?? (process$3.stderr.isTTY && process$3.stderr.hasColors?.()),
22278
22267
  stripColor: (str) => stripColor(str)
22279
22268
  };
22280
22269
  this._hidden = false;
@@ -22632,7 +22621,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22632
22621
  */
22633
22622
  _exit(exitCode, code, message) {
22634
22623
  if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code, message));
22635
- process$2.exit(exitCode);
22624
+ process$3.exit(exitCode);
22636
22625
  }
22637
22626
  /**
22638
22627
  * Register callback `fn` for the command.
@@ -22971,11 +22960,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
22971
22960
  if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
22972
22961
  parseOptions = parseOptions || {};
22973
22962
  if (argv === void 0 && parseOptions.from === void 0) {
22974
- if (process$2.versions?.electron) parseOptions.from = "electron";
22975
- const execArgv = process$2.execArgv ?? [];
22963
+ if (process$3.versions?.electron) parseOptions.from = "electron";
22964
+ const execArgv = process$3.execArgv ?? [];
22976
22965
  if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) parseOptions.from = "eval";
22977
22966
  }
22978
- if (argv === void 0) argv = process$2.argv;
22967
+ if (argv === void 0) argv = process$3.argv;
22979
22968
  this.rawArgs = argv.slice();
22980
22969
  let userArgs;
22981
22970
  switch (parseOptions.from) {
@@ -22985,7 +22974,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
22985
22974
  userArgs = argv.slice(2);
22986
22975
  break;
22987
22976
  case "electron":
22988
- if (process$2.defaultApp) {
22977
+ if (process$3.defaultApp) {
22989
22978
  this._scriptPath = argv[1];
22990
22979
  userArgs = argv.slice(2);
22991
22980
  } else userArgs = argv.slice(1);
@@ -23150,16 +23139,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
23150
23139
  }
23151
23140
  launchWithNode = sourceExt.includes(path$16.extname(executableFile));
23152
23141
  let proc;
23153
- if (process$2.platform !== "win32") if (launchWithNode) {
23142
+ if (process$3.platform !== "win32") if (launchWithNode) {
23154
23143
  args.unshift(executableFile);
23155
- args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
23156
- proc = childProcess$2.spawn(process$2.argv[0], args, { stdio: "inherit" });
23144
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
23145
+ proc = childProcess$2.spawn(process$3.argv[0], args, { stdio: "inherit" });
23157
23146
  } else proc = childProcess$2.spawn(executableFile, args, { stdio: "inherit" });
23158
23147
  else {
23159
23148
  this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
23160
23149
  args.unshift(executableFile);
23161
- args = incrementNodeInspectorPort(process$2.execArgv).concat(args);
23162
- proc = childProcess$2.spawn(process$2.execPath, args, { stdio: "inherit" });
23150
+ args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
23151
+ proc = childProcess$2.spawn(process$3.execPath, args, { stdio: "inherit" });
23163
23152
  }
23164
23153
  if (!proc.killed) [
23165
23154
  "SIGUSR1",
@@ -23168,20 +23157,20 @@ Expecting one of '${allowedValues.join("', '")}'`);
23168
23157
  "SIGINT",
23169
23158
  "SIGHUP"
23170
23159
  ].forEach((signal) => {
23171
- process$2.on(signal, () => {
23160
+ process$3.on(signal, () => {
23172
23161
  if (proc.killed === false && proc.exitCode === null) proc.kill(signal);
23173
23162
  });
23174
23163
  });
23175
23164
  const exitCallback = this._exitCallback;
23176
23165
  proc.on("close", (code) => {
23177
23166
  code = code ?? 1;
23178
- if (!exitCallback) process$2.exit(code);
23167
+ if (!exitCallback) process$3.exit(code);
23179
23168
  else exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
23180
23169
  });
23181
23170
  proc.on("error", (err) => {
23182
23171
  if (err.code === "ENOENT") this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
23183
23172
  else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
23184
- if (!exitCallback) process$2.exit(1);
23173
+ if (!exitCallback) process$3.exit(1);
23185
23174
  else {
23186
23175
  const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
23187
23176
  wrappedError.nestedError = err;
@@ -23590,13 +23579,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
23590
23579
  */
23591
23580
  _parseOptionsEnv() {
23592
23581
  this.options.forEach((option) => {
23593
- if (option.envVar && option.envVar in process$2.env) {
23582
+ if (option.envVar && option.envVar in process$3.env) {
23594
23583
  const optionKey = option.attributeName();
23595
23584
  if (this.getOptionValue(optionKey) === void 0 || [
23596
23585
  "default",
23597
23586
  "config",
23598
23587
  "env"
23599
- ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$2.env[option.envVar]);
23588
+ ].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
23600
23589
  else this.emit(`optionEnv:${option.name()}`);
23601
23590
  }
23602
23591
  });
@@ -24013,7 +24002,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
24013
24002
  */
24014
24003
  help(contextOptions) {
24015
24004
  this.outputHelp(contextOptions);
24016
- let exitCode = Number(process$2.exitCode ?? 0);
24005
+ let exitCode = Number(process$3.exitCode ?? 0);
24017
24006
  if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
24018
24007
  this._exit(exitCode, "commander.help", "(outputHelp)");
24019
24008
  }
@@ -24103,8 +24092,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
24103
24092
  * @package
24104
24093
  */
24105
24094
  function useColor() {
24106
- if (process$2.env.NO_COLOR || process$2.env.FORCE_COLOR === "0" || process$2.env.FORCE_COLOR === "false") return false;
24107
- if (process$2.env.FORCE_COLOR || process$2.env.CLICOLOR_FORCE !== void 0) return true;
24095
+ if (process$3.env.NO_COLOR || process$3.env.FORCE_COLOR === "0" || process$3.env.FORCE_COLOR === "false") return false;
24096
+ if (process$3.env.FORCE_COLOR || process$3.env.CLICOLOR_FORCE !== void 0) return true;
24108
24097
  }
24109
24098
  exports.Command = Command;
24110
24099
  exports.useColor = useColor;
@@ -24443,7 +24432,7 @@ const GOMS_KLM_TIMING_SECONDS = {
24443
24432
  };
24444
24433
 
24445
24434
  //#endregion
24446
- //#region node_modules/.pnpm/@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
24435
+ //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
24447
24436
  /**
24448
24437
  * Creates an observable. `subscribe` runs for each subscriber, and can
24449
24438
  * return a function that cleans up when it unsubscribes.
@@ -24669,7 +24658,7 @@ function observableToAsyncIterable(observable, signal) {
24669
24658
  }
24670
24659
 
24671
24660
  //#endregion
24672
- //#region node_modules/.pnpm/@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
24661
+ //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/observable-BjUZYMQq.mjs
24673
24662
  /**
24674
24663
  * Shares one subscription to the source between all subscribers. It
24675
24664
  * starts with the first subscriber and ends when the last unsubscribes.
@@ -24795,7 +24784,7 @@ function behaviorSubject(initialValue) {
24795
24784
  }
24796
24785
 
24797
24786
  //#endregion
24798
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
24787
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/splitLink-PFsRy7Mf.mjs
24799
24788
  /** @internal */
24800
24789
  function createChain(opts) {
24801
24790
  return observable$1((observer) => {
@@ -24814,7 +24803,7 @@ function createChain(opts) {
24814
24803
  }
24815
24804
 
24816
24805
  //#endregion
24817
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
24806
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/objectSpread2-pyA4QVO4.mjs
24818
24807
  function _typeof$1(o) {
24819
24808
  "@babel/helpers - typeof";
24820
24809
  return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -24868,7 +24857,7 @@ function _objectSpread2$1(e) {
24868
24857
  }
24869
24858
 
24870
24859
  //#endregion
24871
- //#region node_modules/.pnpm/@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
24860
+ //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/codes-BCsCCyMj.mjs
24872
24861
  /**
24873
24862
  * Check that value is object
24874
24863
  * @internal
@@ -24931,7 +24920,7 @@ const retryableRpcCodes = [
24931
24920
  ];
24932
24921
 
24933
24922
  //#endregion
24934
- //#region node_modules/.pnpm/@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
24923
+ //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/getErrorShape-CVrl8_-w.mjs
24935
24924
  const noop$4 = () => {};
24936
24925
  const freezeIfAvailable = (obj) => {
24937
24926
  if (Object.freeze) Object.freeze(obj);
@@ -25036,7 +25025,7 @@ function _objectSpread2(e) {
25036
25025
  }
25037
25026
 
25038
25027
  //#endregion
25039
- //#region node_modules/.pnpm/@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/asyncGeneratorDelegate-Bmz6asKS.mjs
25028
+ //#region node_modules/.pnpm/@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3/node_modules/@trpc/server/dist/asyncGeneratorDelegate-Bmz6asKS.mjs
25040
25029
  /** @internal */
25041
25030
  function transformResultInner(response, transformer) {
25042
25031
  if ("error" in response) {
@@ -25142,7 +25131,7 @@ AsyncGenerator$1.prototype["function" == typeof Symbol && Symbol.asyncIterator |
25142
25131
  };
25143
25132
 
25144
25133
  //#endregion
25145
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
25134
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/TRPCClientError-DE6-fd1n.mjs
25146
25135
  /**
25147
25136
  * Whether a value is a `TRPCClientError`, typed for a router or procedure.
25148
25137
  * @see https://trpc.io/docs/client/vanilla/error-handling#catching-a-thrown-error
@@ -25198,7 +25187,7 @@ var TRPCClientError = class TRPCClientError extends Error {
25198
25187
  };
25199
25188
 
25200
25189
  //#endregion
25201
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/unstable-internals.mjs
25190
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/unstable-internals.mjs
25202
25191
  /**
25203
25192
  * @internal
25204
25193
  */
@@ -25225,7 +25214,7 @@ function getTransformer(transformer) {
25225
25214
  }
25226
25215
 
25227
25216
  //#endregion
25228
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
25217
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpUtils-CtMuyl9j.mjs
25229
25218
  const isFunction$1 = (fn) => typeof fn === "function";
25230
25219
  /**
25231
25220
  * The `fetch` to use: `customFetchImpl` if given, or else the global one.
@@ -25361,7 +25350,7 @@ async function httpRequest(opts) {
25361
25350
  }
25362
25351
 
25363
25352
  //#endregion
25364
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpLink-B4UwXApa.mjs
25353
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/httpLink-B4UwXApa.mjs
25365
25354
  /** Whether an input is binary: a `Uint8Array`, `Blob` or `File`. */
25366
25355
  function isOctetType(input) {
25367
25356
  return input instanceof Uint8Array || input instanceof Blob;
@@ -25454,7 +25443,7 @@ function httpLink(opts) {
25454
25443
  }
25455
25444
 
25456
25445
  //#endregion
25457
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/wsLink-DYx-NUSN.mjs
25446
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/wsLink-DYx-NUSN.mjs
25458
25447
  /**
25459
25448
  * Get the result of a value or function that returns a value
25460
25449
  * It also optionally accepts typesafe arguments for the function
@@ -25644,7 +25633,7 @@ var WsConnection = class WsConnection {
25644
25633
  _defineProperty$1(WsConnection, "connectCount", 0);
25645
25634
 
25646
25635
  //#endregion
25647
- //#region node_modules/.pnpm/@trpc+client@11.29.5_@trpc+server@11.29.5_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/index.mjs
25636
+ //#region node_modules/.pnpm/@trpc+client@11.29.7_@trpc+server@11.29.7_@types+ws@8.18.2_typescript@6.0.3__typescript@6.0.3/node_modules/@trpc/client/dist/index.mjs
25648
25637
  const observerKeys = [
25649
25638
  "onStarted",
25650
25639
  "onData",
@@ -25857,7 +25846,7 @@ AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator ||
25857
25846
  };
25858
25847
 
25859
25848
  //#endregion
25860
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/double-indexed-kv.js
25849
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/double-indexed-kv.js
25861
25850
  var DoubleIndexedKV = class {
25862
25851
  constructor() {
25863
25852
  this.keyToValue = /* @__PURE__ */ new Map();
@@ -25880,7 +25869,7 @@ var DoubleIndexedKV = class {
25880
25869
  };
25881
25870
 
25882
25871
  //#endregion
25883
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/registry.js
25872
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/registry.js
25884
25873
  var Registry = class {
25885
25874
  constructor(generateIdentifier) {
25886
25875
  this.generateIdentifier = generateIdentifier;
@@ -25894,6 +25883,9 @@ var Registry = class {
25894
25883
  clear() {
25895
25884
  this.kv.clear();
25896
25885
  }
25886
+ get size() {
25887
+ return this.kv.valueToKey.size;
25888
+ }
25897
25889
  getIdentifier(value) {
25898
25890
  return this.kv.getByValue(value);
25899
25891
  }
@@ -25903,7 +25895,7 @@ var Registry = class {
25903
25895
  };
25904
25896
 
25905
25897
  //#endregion
25906
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/class-registry.js
25898
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/class-registry.js
25907
25899
  var ClassRegistry = class extends Registry {
25908
25900
  constructor() {
25909
25901
  super((c) => c.name);
@@ -25921,46 +25913,22 @@ var ClassRegistry = class extends Registry {
25921
25913
  };
25922
25914
 
25923
25915
  //#endregion
25924
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/util.js
25925
- function valuesOfObj(record) {
25926
- if ("values" in Object) return Object.values(record);
25927
- const values = [];
25928
- for (const key in record) if (record.hasOwnProperty(key)) values.push(record[key]);
25929
- return values;
25930
- }
25931
- function find$2(record, predicate) {
25932
- const values = valuesOfObj(record);
25933
- if ("find" in values) return values.find(predicate);
25934
- const valuesNotNever = values;
25935
- for (let i = 0; i < valuesNotNever.length; i++) {
25936
- const value = valuesNotNever[i];
25937
- if (predicate(value)) return value;
25938
- }
25939
- }
25940
- function forEach(record, run) {
25941
- Object.entries(record).forEach(([key, value]) => run(value, key));
25942
- }
25943
- function includes(arr, value) {
25944
- return arr.indexOf(value) !== -1;
25945
- }
25946
- function findArr(record, predicate) {
25947
- for (let i = 0; i < record.length; i++) {
25948
- const value = record[i];
25949
- if (predicate(value)) return value;
25950
- }
25951
- }
25952
-
25953
- //#endregion
25954
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/custom-transformer-registry.js
25916
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/custom-transformer-registry.js
25955
25917
  var CustomTransformerRegistry = class {
25956
25918
  constructor() {
25957
25919
  this.transfomers = {};
25920
+ this.ordered = [];
25958
25921
  }
25959
25922
  register(transformer) {
25960
25923
  this.transfomers[transformer.name] = transformer;
25924
+ this.ordered = Object.values(this.transfomers);
25925
+ }
25926
+ get size() {
25927
+ return this.ordered.length;
25961
25928
  }
25962
25929
  findApplicable(v) {
25963
- return find$2(this.transfomers, (transformer) => transformer.isApplicable(v));
25930
+ const transformers = this.ordered;
25931
+ for (let i = 0; i < transformers.length; i++) if (transformers[i].isApplicable(v)) return transformers[i];
25964
25932
  }
25965
25933
  findByName(name) {
25966
25934
  return this.transfomers[name];
@@ -25968,39 +25936,60 @@ var CustomTransformerRegistry = class {
25968
25936
  };
25969
25937
 
25970
25938
  //#endregion
25971
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/is.js
25972
- const getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
25939
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/is.js
25973
25940
  const isUndefined$1 = (payload) => typeof payload === "undefined";
25974
- const isNull$1 = (payload) => payload === null;
25975
- const isPlainObject$10 = (payload) => {
25941
+ const isPlainObject$9 = (payload) => {
25976
25942
  if (typeof payload !== "object" || payload === null) return false;
25977
25943
  if (payload === Object.prototype) return false;
25978
- if (Object.getPrototypeOf(payload) === null) return true;
25979
- return Object.getPrototypeOf(payload) === Object.prototype;
25944
+ const prototype = Object.getPrototypeOf(payload);
25945
+ return prototype === null || prototype === Object.prototype;
25980
25946
  };
25981
- const isEmptyObject = (payload) => isPlainObject$10(payload) && Object.keys(payload).length === 0;
25947
+ const isEmptyObject = (payload) => isPlainObject$9(payload) && Object.keys(payload).length === 0;
25982
25948
  const isArray = (payload) => Array.isArray(payload);
25983
- const isString = (payload) => typeof payload === "string";
25984
- const isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
25985
- const isBoolean$1 = (payload) => typeof payload === "boolean";
25986
25949
  const isRegExp = (payload) => payload instanceof RegExp;
25987
25950
  const isMap = (payload) => payload instanceof Map;
25988
25951
  const isSet = (payload) => payload instanceof Set;
25989
- const isSymbol = (payload) => getType(payload) === "Symbol";
25952
+ const hasSymbolTag = (payload) => (typeof payload === "object" && payload !== null || typeof payload === "function") && payload[Symbol.toStringTag] === "Symbol";
25953
+ const isSymbol = (payload) => typeof payload === "symbol" || hasSymbolTag(payload);
25990
25954
  const isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
25991
25955
  const isError$1 = (payload) => payload instanceof Error;
25992
25956
  const isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
25993
- const isPrimitive = (payload) => isBoolean$1(payload) || isNull$1(payload) || isUndefined$1(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
25957
+ const isPrimitive = (payload) => {
25958
+ switch (typeof payload) {
25959
+ case "boolean":
25960
+ case "string":
25961
+ case "undefined":
25962
+ case "symbol": return true;
25963
+ case "number": return !isNaN(payload);
25964
+ case "object": return payload === null || hasSymbolTag(payload);
25965
+ case "function": return hasSymbolTag(payload);
25966
+ default: return false;
25967
+ }
25968
+ };
25994
25969
  const isBigint = (payload) => typeof payload === "bigint";
25995
25970
  const isInfinite = (payload) => payload === Infinity || payload === -Infinity;
25996
25971
  const isTypedArray$1 = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
25997
- const isURL = (payload) => payload instanceof URL;
25972
+ const isURL = (payload) => typeof URL !== "undefined" && payload instanceof URL;
25998
25973
 
25999
25974
  //#endregion
26000
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/pathstringifier.js
26001
- const escapeKey = (key) => key.replace(/\\/g, "\\\\").replace(/\./g, "\\.");
25975
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/pathstringifier.js
25976
+ const escapeKey = (key) => key.indexOf("\\") === -1 && key.indexOf(".") === -1 ? key : key.replace(/\\/g, "\\\\").replace(/\./g, "\\.");
26002
25977
  const stringifyPath = (path) => path.map(String).map(escapeKey).join(".");
25978
+ const splitOnDots = (string) => {
25979
+ const result = [];
25980
+ let start = 0;
25981
+ for (;;) {
25982
+ const dot = string.indexOf(".", start);
25983
+ if (dot === -1) {
25984
+ result.push(start === 0 ? string : string.slice(start));
25985
+ return result;
25986
+ }
25987
+ result.push(string.slice(start, dot));
25988
+ start = dot + 1;
25989
+ }
25990
+ };
26003
25991
  const parsePath = (string, legacyPaths) => {
25992
+ if (typeof string === "string" && string.indexOf("\\") === -1) return splitOnDots(string);
26004
25993
  const result = [];
26005
25994
  let segment = "";
26006
25995
  for (let i = 0; i < string.length; i++) {
@@ -26031,7 +26020,42 @@ const parsePath = (string, legacyPaths) => {
26031
26020
  };
26032
26021
 
26033
26022
  //#endregion
26034
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/transformer.js
26023
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/date.js
26024
+ const pad2 = (n) => n < 10 ? "0" + n : "" + n;
26025
+ const pad3 = (n) => n < 10 ? "00" + n : n < 100 ? "0" + n : "" + n;
26026
+ function toISOString(date) {
26027
+ const year = date.getUTCFullYear();
26028
+ if (year < 1e3 || year > 9999) return date.toISOString();
26029
+ return year + "-" + pad2(date.getUTCMonth() + 1) + "-" + pad2(date.getUTCDate()) + "T" + pad2(date.getUTCHours()) + ":" + pad2(date.getUTCMinutes()) + ":" + pad2(date.getUTCSeconds()) + "." + pad3(date.getUTCMilliseconds()) + "Z";
26030
+ }
26031
+ const digits = (s, from, count) => {
26032
+ let n = 0;
26033
+ for (let i = from; i < from + count; i++) {
26034
+ const d = s.charCodeAt(i) - 48;
26035
+ if (d < 0 || d > 9) return -1;
26036
+ n = n * 10 + d;
26037
+ }
26038
+ return n;
26039
+ };
26040
+ function parseISOString(value) {
26041
+ 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) {
26042
+ const year = digits(value, 0, 4);
26043
+ const month = digits(value, 5, 2);
26044
+ const day = digits(value, 8, 2);
26045
+ const hours = digits(value, 11, 2);
26046
+ const minutes = digits(value, 14, 2);
26047
+ const seconds = digits(value, 17, 2);
26048
+ const ms = digits(value, 20, 3);
26049
+ if (year >= 1e3 && month >= 1 && month <= 12 && day >= 1 && hours >= 0 && hours <= 23 && minutes >= 0 && minutes <= 59 && seconds >= 0 && seconds <= 59 && ms >= 0) {
26050
+ const date = new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds, ms));
26051
+ if (date.getUTCDate() === day) return date;
26052
+ }
26053
+ }
26054
+ return new Date(value);
26055
+ }
26056
+
26057
+ //#endregion
26058
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/transformer.js
26035
26059
  function simpleTransformation(isApplicable, annotation, transform, untransform) {
26036
26060
  return {
26037
26061
  isApplicable,
@@ -26047,7 +26071,7 @@ const simpleRules = [
26047
26071
  console.error("Please add a BigInt polyfill.");
26048
26072
  return v;
26049
26073
  }),
26050
- simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
26074
+ simpleTransformation(isDate, "Date", toISOString, parseISOString),
26051
26075
  simpleTransformation(isError$1, "Error", (v, superJson) => {
26052
26076
  const baseError = {
26053
26077
  name: v.name,
@@ -26059,7 +26083,7 @@ const simpleRules = [
26059
26083
  });
26060
26084
  return baseError;
26061
26085
  }, (v, superJson) => {
26062
- const e = new Error(v.message, { cause: v.cause });
26086
+ const e = "cause" in v ? new Error(v.message, { cause: v.cause }) : new Error(v.message);
26063
26087
  e.name = v.name;
26064
26088
  e.stack = v.stack;
26065
26089
  superJson.allowedErrorProps.forEach((prop) => {
@@ -26093,7 +26117,7 @@ function compositeTransformation(isApplicable, annotation, transform, untransfor
26093
26117
  };
26094
26118
  }
26095
26119
  const symbolRule = compositeTransformation((s, superJson) => {
26096
- if (isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
26120
+ if (superJson.symbolRegistry.size > 0 && isSymbol(s)) return !!superJson.symbolRegistry.getIdentifier(s);
26097
26121
  return false;
26098
26122
  }, (s, superJson) => {
26099
26123
  return ["symbol", superJson.symbolRegistry.getIdentifier(s)];
@@ -26116,13 +26140,33 @@ const constructorToName = [
26116
26140
  obj[ctor.name] = ctor;
26117
26141
  return obj;
26118
26142
  }, {});
26119
- const typedArrayRule = compositeTransformation(isTypedArray$1, (v) => ["typed-array", v.constructor.name], (v) => [...v], (v, a) => {
26143
+ const bigIntConstructorToName = {};
26144
+ if (typeof BigInt64Array !== "undefined") bigIntConstructorToName[BigInt64Array.name] = BigInt64Array;
26145
+ if (typeof BigUint64Array !== "undefined") bigIntConstructorToName[BigUint64Array.name] = BigUint64Array;
26146
+ const typedArrayRule = compositeTransformation(isTypedArray$1, (v) => ["typed-array", v.constructor.name], (v) => [...v].map((n) => {
26147
+ if (typeof n === "bigint") return n.toString();
26148
+ if (typeof n === "number") {
26149
+ if (Number.isNaN(n)) return "NaN";
26150
+ if (n === Infinity) return "Infinity";
26151
+ if (n === -Infinity) return "-Infinity";
26152
+ if (n === 0 && 1 / n === -Infinity) return "-0";
26153
+ }
26154
+ return n;
26155
+ }), (v, a) => {
26156
+ const bigIntCtor = bigIntConstructorToName[a[1]];
26157
+ if (bigIntCtor) return new bigIntCtor(v.map((n) => BigInt(n)));
26120
26158
  const ctor = constructorToName[a[1]];
26121
26159
  if (!ctor) throw new Error("Trying to deserialize unknown typed array");
26122
- return new ctor(v);
26160
+ return new ctor(v.map((n) => {
26161
+ if (n === "NaN") return NaN;
26162
+ if (n === "Infinity") return Infinity;
26163
+ if (n === "-Infinity") return -Infinity;
26164
+ if (n === "-0") return -0;
26165
+ return n;
26166
+ }));
26123
26167
  });
26124
26168
  function isInstanceOfRegisteredClass(potentialClass, superJson) {
26125
- if (potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
26169
+ if (superJson.classRegistry.size > 0 && potentialClass?.constructor) return !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
26126
26170
  return false;
26127
26171
  }
26128
26172
  const classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
@@ -26151,23 +26195,58 @@ const customRule = compositeTransformation((value, superJson) => {
26151
26195
  if (!transformer) throw new Error("Trying to deserialize unknown custom value");
26152
26196
  return transformer.deserialize(v);
26153
26197
  });
26154
- const compositeRules = [
26155
- classRule,
26156
- symbolRule,
26157
- customRule,
26158
- typedArrayRule
26198
+ const [undefinedRule, bigintRule, dateRule, errorRule, regexpRule, setRule, mapRule, nonFiniteRule, negativeZeroRule, urlRule] = simpleRules;
26199
+ const objectRules = [
26200
+ dateRule,
26201
+ errorRule,
26202
+ regexpRule,
26203
+ setRule,
26204
+ mapRule,
26205
+ urlRule
26159
26206
  ];
26160
- const transformValue = (value, superJson) => {
26161
- const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
26162
- if (applicableCompositeRule) return {
26163
- value: applicableCompositeRule.transform(value, superJson),
26164
- type: applicableCompositeRule.annotation(value, superJson)
26207
+ const applySimple = (rule, value, superJson) => ({
26208
+ value: rule.transform(value, superJson),
26209
+ type: rule.annotation
26210
+ });
26211
+ /** Class, symbol and custom rules only. */
26212
+ const transformRegisteredValue = (value, superJson) => {
26213
+ if (classRule.isApplicable(value, superJson)) return {
26214
+ value: classRule.transform(value, superJson),
26215
+ type: classRule.annotation(value, superJson)
26165
26216
  };
26166
- const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
26167
- if (applicableSimpleRule) return {
26168
- value: applicableSimpleRule.transform(value, superJson),
26169
- type: applicableSimpleRule.annotation
26217
+ if (symbolRule.isApplicable(value, superJson)) return {
26218
+ value: symbolRule.transform(value, superJson),
26219
+ type: symbolRule.annotation(value, superJson)
26170
26220
  };
26221
+ if (superJson.customTransformerRegistry.size > 0) {
26222
+ const transformer = superJson.customTransformerRegistry.findApplicable(value);
26223
+ if (transformer) return {
26224
+ value: transformer.serialize(value),
26225
+ type: ["custom", transformer.name]
26226
+ };
26227
+ }
26228
+ };
26229
+ const transformValue = (value, superJson) => {
26230
+ const registered = transformRegisteredValue(value, superJson);
26231
+ if (registered) return registered;
26232
+ switch (typeof value) {
26233
+ case "undefined": return applySimple(undefinedRule, value, superJson);
26234
+ case "bigint": return applySimple(bigintRule, value, superJson);
26235
+ case "number":
26236
+ if (nonFiniteRule.isApplicable(value, superJson)) return applySimple(nonFiniteRule, value, superJson);
26237
+ if (negativeZeroRule.isApplicable(value, superJson)) return applySimple(negativeZeroRule, value, superJson);
26238
+ return;
26239
+ case "object":
26240
+ case "function":
26241
+ if (value === null) return;
26242
+ if (typedArrayRule.isApplicable(value, superJson)) return {
26243
+ value: typedArrayRule.transform(value, superJson),
26244
+ type: typedArrayRule.annotation(value, superJson)
26245
+ };
26246
+ for (let i = 0; i < objectRules.length; i++) if (objectRules[i].isApplicable(value, superJson)) return applySimple(objectRules[i], value, superJson);
26247
+ return;
26248
+ default: return;
26249
+ }
26171
26250
  };
26172
26251
  const simpleRulesByAnnotation = {};
26173
26252
  simpleRules.forEach((rule) => {
@@ -26189,7 +26268,41 @@ const untransformValue = (json, type, superJson) => {
26189
26268
  };
26190
26269
 
26191
26270
  //#endregion
26192
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/accessDeep.js
26271
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/util.js
26272
+ function forEach(record, run) {
26273
+ const keys = Object.keys(record);
26274
+ for (let i = 0; i < keys.length; i++) run(record[keys[i]], keys[i]);
26275
+ }
26276
+ function includes(arr, value) {
26277
+ return arr.indexOf(value) !== -1;
26278
+ }
26279
+ const getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
26280
+ function copy(target) {
26281
+ if (typeof target !== "object" || target === null) return target;
26282
+ if (Symbol.toStringTag in target) {
26283
+ const type = getType(target);
26284
+ if (type === "Array") return target.map(copy);
26285
+ return type === "Object" ? copyObject(target) : target;
26286
+ }
26287
+ if (isArray(target)) return target.map(copy);
26288
+ return copyObject(target);
26289
+ }
26290
+ function copyObject(target) {
26291
+ const prototype = Object.getPrototypeOf(target);
26292
+ if (prototype !== Object.prototype || prototype.constructor !== Object) return target;
26293
+ const result = {};
26294
+ const keys = Object.keys(target);
26295
+ for (let i = 0; i < keys.length; i++) {
26296
+ const key = keys[i];
26297
+ if (key !== "__proto__") result[key] = copy(target[key]);
26298
+ }
26299
+ const symbols = Object.getOwnPropertySymbols(target);
26300
+ for (let i = 0; i < symbols.length; i++) if (Object.prototype.propertyIsEnumerable.call(target, symbols[i])) result[symbols[i]] = copy(target[symbols[i]]);
26301
+ return result;
26302
+ }
26303
+
26304
+ //#endregion
26305
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/accessDeep.js
26193
26306
  const getNthKey = (value, n) => {
26194
26307
  if (n > value.size) throw new Error("index out of bounds");
26195
26308
  const keys = value.keys();
@@ -26200,6 +26313,15 @@ const getNthKey = (value, n) => {
26200
26313
  return keys.next().value;
26201
26314
  };
26202
26315
  function validatePath(path) {
26316
+ let suspicious = false;
26317
+ for (let i = 0; i < path.length; i++) {
26318
+ const key = path[i];
26319
+ if (key === "__proto__" || key === "prototype" || key === "constructor") {
26320
+ suspicious = true;
26321
+ break;
26322
+ }
26323
+ }
26324
+ if (!suspicious) return;
26203
26325
  if (includes(path, "__proto__")) throw new Error("__proto__ is not allowed as a property");
26204
26326
  if (includes(path, "prototype")) throw new Error("prototype is not allowed as a property");
26205
26327
  if (includes(path, "constructor")) throw new Error("constructor is not allowed as a property");
@@ -26225,16 +26347,14 @@ const getDeep = (object, path) => {
26225
26347
  }
26226
26348
  return object;
26227
26349
  };
26228
- const setDeep = (object, path, mapper) => {
26229
- validatePath(path);
26230
- if (path.length === 0) return mapper(object);
26231
- let parent = object;
26232
- for (let i = 0; i < path.length - 1; i++) {
26350
+ const walk$1 = (parent, path) => {
26351
+ let i = 0;
26352
+ for (; i < path.length - 1; i++) {
26233
26353
  const key = path[i];
26234
26354
  if (isArray(parent)) {
26235
26355
  const index = +key;
26236
26356
  parent = parent[index];
26237
- } else if (isPlainObject$10(parent)) parent = parent[key];
26357
+ } else if (isPlainObject$9(parent)) parent = parent[key];
26238
26358
  else if (isSet(parent)) {
26239
26359
  const row = +key;
26240
26360
  parent = getNthKey(parent, row);
@@ -26253,25 +26373,41 @@ const setDeep = (object, path, mapper) => {
26253
26373
  }
26254
26374
  }
26255
26375
  }
26376
+ return [parent, i];
26377
+ };
26378
+ const walkDeep = (object, path) => {
26379
+ validatePath(path);
26380
+ const [parent, rest] = walk$1(object, path);
26381
+ return [parent, path.slice(rest)];
26382
+ };
26383
+ const setDeep = (object, path, mapper) => {
26384
+ validatePath(path);
26385
+ if (path.length === 0) return mapper(object);
26386
+ const [parent] = walk$1(object, path);
26256
26387
  const lastKey = path[path.length - 1];
26257
26388
  if (isArray(parent)) parent[+lastKey] = mapper(parent[+lastKey]);
26258
- else if (isPlainObject$10(parent)) parent[lastKey] = mapper(parent[lastKey]);
26389
+ else if (isPlainObject$9(parent)) parent[lastKey] = mapper(parent[lastKey]);
26259
26390
  if (isSet(parent)) {
26260
- const oldValue = getNthKey(parent, +lastKey);
26391
+ const index = +lastKey;
26392
+ const oldValue = getNthKey(parent, index);
26261
26393
  const newValue = mapper(oldValue);
26262
26394
  if (oldValue !== newValue) {
26263
- parent.delete(oldValue);
26264
- parent.add(newValue);
26395
+ const values = [...parent];
26396
+ values[index] = newValue;
26397
+ parent.clear();
26398
+ values.forEach((value) => parent.add(value));
26265
26399
  }
26266
26400
  }
26267
26401
  if (isMap(parent)) {
26268
- const row = +path[path.length - 2];
26269
- const keyToRow = getNthKey(parent, row);
26402
+ const keyToRow = getNthKey(parent, +path[path.length - 2]);
26270
26403
  switch (+lastKey === 0 ? "key" : "value") {
26271
26404
  case "key": {
26272
26405
  const newKey = mapper(keyToRow);
26273
- parent.set(newKey, parent.get(keyToRow));
26274
- if (newKey !== keyToRow) parent.delete(keyToRow);
26406
+ if (newKey !== keyToRow) {
26407
+ const entries = [...parent];
26408
+ parent.clear();
26409
+ entries.forEach(([k, v]) => parent.set(k === keyToRow ? newKey : k, v));
26410
+ }
26275
26411
  break;
26276
26412
  }
26277
26413
  case "value":
@@ -26283,26 +26419,28 @@ const setDeep = (object, path, mapper) => {
26283
26419
  };
26284
26420
 
26285
26421
  //#endregion
26286
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/plainer.js
26422
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/plainer.js
26287
26423
  const enableLegacyPaths = (version) => version < 1;
26288
- function traverse(tree, walker, version, origin = []) {
26289
- if (!tree) return;
26290
- const legacyPaths = enableLegacyPaths(version);
26291
- if (!isArray(tree)) {
26292
- forEach(tree, (subtree, key) => traverse(subtree, walker, version, [...origin, ...parsePath(key, legacyPaths)]));
26293
- return;
26294
- }
26295
- const [nodeValue, children] = tree;
26296
- if (children) forEach(children, (child, key) => {
26297
- traverse(child, walker, version, [...origin, ...parsePath(key, legacyPaths)]);
26298
- });
26299
- walker(nodeValue, origin);
26300
- }
26301
26424
  function applyValueAnnotations(plain, annotations, version, superJson) {
26302
- traverse(annotations, (type, path) => {
26303
- plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
26304
- }, version);
26305
- return plain;
26425
+ const legacyPaths = enableLegacyPaths(version);
26426
+ const apply = (node, path, tree, error) => {
26427
+ if (!tree) return node;
26428
+ const children = isArray(tree) ? tree[1] : tree;
26429
+ if (children) {
26430
+ let parent;
26431
+ let rest = [];
26432
+ if (!error) try {
26433
+ [parent, rest] = walkDeep(node, path);
26434
+ } catch (e) {
26435
+ error = e;
26436
+ }
26437
+ for (const key of Object.keys(children)) apply(parent, [...rest, ...parsePath(key, legacyPaths)], children[key], error);
26438
+ }
26439
+ if (!isArray(tree)) return node;
26440
+ if (error) throw error;
26441
+ return setDeep(node, path, (v) => untransformValue(v, tree[0], superJson));
26442
+ };
26443
+ return apply(plain, [], annotations);
26306
26444
  }
26307
26445
  function applyReferentialEqualityAnnotations(plain, annotations, version) {
26308
26446
  const legacyPaths = enableLegacyPaths(version);
@@ -26321,12 +26459,7 @@ function applyReferentialEqualityAnnotations(plain, annotations, version) {
26321
26459
  } else forEach(annotations, apply);
26322
26460
  return plain;
26323
26461
  }
26324
- const isDeep = (object, superJson) => isPlainObject$10(object) || isArray(object) || isMap(object) || isSet(object) || isError$1(object) || isInstanceOfRegisteredClass(object, superJson);
26325
- function addIdentity(object, path, identities) {
26326
- const existingSet = identities.get(object);
26327
- if (existingSet) existingSet.push(path);
26328
- else identities.set(object, [path]);
26329
- }
26462
+ const isDeep = (object, superJson) => isPlainObject$9(object) || isArray(object) || isMap(object) || isSet(object) || isError$1(object) || isInstanceOfRegisteredClass(object, superJson);
26330
26463
  function generateReferentialEqualityAnnotations(identitites, dedupe) {
26331
26464
  const result = {};
26332
26465
  let rootEqualityPaths = void 0;
@@ -26341,151 +26474,147 @@ function generateReferentialEqualityAnnotations(identitites, dedupe) {
26341
26474
  else return [rootEqualityPaths, result];
26342
26475
  else return isEmptyObject(result) ? void 0 : result;
26343
26476
  }
26344
- const walker = (object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
26477
+ var PathNode = class {
26478
+ /** `key` is null only for the root. */
26479
+ constructor(parent, key) {
26480
+ this.parent = parent;
26481
+ this.key = key;
26482
+ }
26483
+ };
26484
+ /** The first visit of a non-primitive, which is also the path node of its children. */
26485
+ var Seen = class extends PathNode {
26486
+ constructor() {
26487
+ super(...arguments);
26488
+ this.more = void 0;
26489
+ this.done = false;
26490
+ this.value = void 0;
26491
+ this.annotations = void 0;
26492
+ }
26493
+ };
26494
+ const toPath$3 = (node) => {
26495
+ const path = [];
26496
+ for (; node; node = node.parent) if (node.key !== null) path.push(node.key);
26497
+ return path.reverse();
26498
+ };
26499
+ const pathsOf = (seen) => {
26500
+ const paths = [toPath$3(seen)];
26501
+ seen.more?.forEach((node) => paths.push(toPath$3(node)));
26502
+ return paths;
26503
+ };
26504
+ /**
26505
+ * The annotation record of a plain container, built lazily so each flattened key is joined once.
26506
+ * Keys are kept as an object would order them: array indices ascending, then insertion order.
26507
+ */
26508
+ var PendingAnnotations = class {
26509
+ constructor() {
26510
+ /** Pairs: escaped array-index key, tree. */
26511
+ this.indices = [];
26512
+ /** Pairs: escaped key and tree, or `key.` prefix and a nested PendingAnnotations. */
26513
+ this.rest = [];
26514
+ }
26515
+ };
26516
+ const isArrayIndex = (key) => {
26517
+ const length = key.length;
26518
+ if (length === 0 || length > 10) return false;
26519
+ for (let i = 0; i < length; i++) {
26520
+ const code = key.charCodeAt(i);
26521
+ if (code < 48 || code > 57) return false;
26522
+ }
26523
+ if (key.charCodeAt(0) === 48) return length === 1;
26524
+ return length < 10 || +key < 4294967295;
26525
+ };
26526
+ function materialize(pending, prefix, out) {
26527
+ const { indices, rest } = pending;
26528
+ for (let i = 0; i < indices.length; i += 2) out[prefix + indices[i]] = indices[i + 1];
26529
+ for (let i = 0; i < rest.length; i += 2) {
26530
+ const value = rest[i + 1];
26531
+ if (value instanceof PendingAnnotations) materialize(value, prefix + rest[i], out);
26532
+ else out[prefix + rest[i]] = value;
26533
+ }
26534
+ return out;
26535
+ }
26536
+ const toRecord = (annotations) => annotations instanceof PendingAnnotations ? materialize(annotations, "", {}) : annotations;
26537
+ const isPlainContainer = (object) => isPlainObject$9(object) || isArray(object) && Object.getPrototypeOf(object) === Array.prototype;
26538
+ function walk(object, ctx, parent, key) {
26345
26539
  const primitive = isPrimitive(object);
26540
+ let seen;
26346
26541
  if (!primitive) {
26347
- addIdentity(object, path, identities);
26348
- const seen = seenObjects.get(object);
26349
- if (seen) return dedupe ? { transformedValue: null } : seen;
26350
- }
26351
- if (!isDeep(object, superJson)) {
26352
- const transformed = transformValue(object, superJson);
26353
- const result = transformed ? {
26354
- transformedValue: transformed.value,
26355
- annotations: [transformed.type]
26356
- } : { transformedValue: object };
26357
- if (!primitive) seenObjects.set(object, result);
26358
- return result;
26542
+ seen = ctx.seen.get(object);
26543
+ if (seen) {
26544
+ (seen.more ?? (seen.more = [])).push(new PathNode(parent, key));
26545
+ if (seen.done) {
26546
+ if (ctx.dedupe) {
26547
+ ctx.annotations = void 0;
26548
+ return null;
26549
+ }
26550
+ ctx.annotations = seen.annotations;
26551
+ return seen.value;
26552
+ }
26553
+ ctx.annotations = void 0;
26554
+ return isDeep(object, ctx.superJson) ? null : leaf(object, ctx, seen);
26555
+ }
26556
+ seen = new Seen(parent, key);
26557
+ ctx.seen.set(object, seen);
26558
+ parent = seen;
26359
26559
  }
26360
- if (includes(objectsInThisPath, object)) return { transformedValue: null };
26361
- const transformationResult = transformValue(object, superJson);
26560
+ const plainContainer = !primitive && isPlainContainer(object);
26561
+ if (!plainContainer && !isDeep(object, ctx.superJson)) return leaf(object, ctx, seen);
26562
+ if (primitive && key !== null) parent = new PathNode(parent, key);
26563
+ const transformationResult = plainContainer ? transformRegisteredValue(object, ctx.superJson) : transformValue(object, ctx.superJson);
26362
26564
  const transformed = transformationResult?.value ?? object;
26363
26565
  const transformedValue = isArray(transformed) ? [] : {};
26364
- const innerAnnotations = {};
26365
- forEach(transformed, (value, index) => {
26566
+ let inner;
26567
+ const keys = Object.keys(transformed);
26568
+ for (let i = 0; i < keys.length; i++) {
26569
+ const index = keys[i];
26366
26570
  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.`);
26367
- const recursiveResult = walker(value, identities, superJson, dedupe, [...path, index], [...objectsInThisPath, object], seenObjects);
26368
- transformedValue[index] = recursiveResult.transformedValue;
26369
- if (isArray(recursiveResult.annotations)) innerAnnotations[escapeKey(index)] = recursiveResult.annotations;
26370
- else if (isPlainObject$10(recursiveResult.annotations)) forEach(recursiveResult.annotations, (tree, key) => {
26371
- innerAnnotations[escapeKey(index) + "." + key] = tree;
26372
- });
26373
- });
26374
- const result = isEmptyObject(innerAnnotations) ? {
26375
- transformedValue,
26376
- annotations: !!transformationResult ? [transformationResult.type] : void 0
26377
- } : {
26378
- transformedValue,
26379
- annotations: !!transformationResult ? [transformationResult.type, innerAnnotations] : innerAnnotations
26380
- };
26381
- if (!primitive) seenObjects.set(object, result);
26382
- return result;
26383
- };
26384
-
26385
- //#endregion
26386
- //#region node_modules/.pnpm/copy-anything@4.1.5/node_modules/copy-anything/dist/index.js
26387
- /**
26388
- * Assigns a prop the copy is keeping, preserving whether it was enumerable. Callers decide
26389
- * _whether_ to keep a non-enumerable prop before getting here, so by this point the answer is
26390
- * always yes.
26391
- */
26392
- function assignProp(carry, key, newVal, originalObject) {
26393
- if (Object.prototype.propertyIsEnumerable.call(originalObject, key)) {
26394
- carry[key] = newVal;
26395
- return;
26571
+ transformedValue[index] = walk(transformed[index], ctx, parent, index);
26572
+ const childAnnotations = ctx.annotations;
26573
+ if (childAnnotations !== void 0) {
26574
+ inner ?? (inner = new PendingAnnotations());
26575
+ const escaped = escapeKey(index);
26576
+ if (childAnnotations instanceof PendingAnnotations) inner.rest.push(escaped + ".", childAnnotations);
26577
+ else if (isArrayIndex(escaped)) inner.indices.push(escaped, childAnnotations);
26578
+ else inner.rest.push(escaped, childAnnotations);
26579
+ }
26396
26580
  }
26397
- Object.defineProperty(carry, key, {
26398
- value: newVal,
26399
- enumerable: false,
26400
- writable: true,
26401
- configurable: true
26402
- });
26581
+ const annotations = inner ? transformationResult ? [transformationResult.type, materialize(inner, "", {})] : inner : transformationResult ? [transformationResult.type] : void 0;
26582
+ return finish(ctx, seen, transformedValue, annotations);
26403
26583
  }
26404
- /**
26405
- * Whether `value` is an object literal, as opposed to a class instance, a built-in like `Date`, an
26406
- * `arguments` object, or an object with a null prototype.
26407
- *
26408
- * The prototype check comes first because it is cheap and rejects almost everything; the tag check
26409
- * is only reached by values that are about to be cloned anyway.
26410
- */
26411
- function isPlainObject$9(value) {
26412
- return Object.getPrototypeOf(value) === Object.prototype && Object.prototype.toString.call(value) === "[object Object]";
26584
+ function leaf(object, ctx, seen) {
26585
+ const transformed = transformValue(object, ctx.superJson);
26586
+ return transformed ? finish(ctx, seen, transformed.value, [transformed.type]) : finish(ctx, seen, object, void 0);
26413
26587
  }
26414
- /**
26415
- * Returns the clone that `value` should be replaced with, and queues it to be filled in later.
26416
- * Anything that isn't an array or a plain object is returned untouched.
26417
- *
26418
- * Reusing the clone already registered in `clones` is what makes circular and shared references
26419
- * work: the placeholder is registered before its contents exist, so a reference back to an ancestor
26420
- * resolves to it rather than walking forever.
26421
- */
26422
- function cloneRef(value, clones, sources, dests) {
26423
- if (typeof value !== "object" || value === null) return value;
26424
- const array = Array.isArray(value);
26425
- if (!array && !isPlainObject$9(value)) return value;
26426
- const existing = clones.get(value);
26427
- if (existing !== void 0) return existing;
26428
- const clone = array ? new Array(value.length) : {};
26429
- clones.set(value, clone);
26430
- sources.push(value);
26431
- dests.push(clone);
26432
- return clone;
26433
- }
26434
- /**
26435
- * Copy (clone) an object and all its props recursively to get rid of any prop referenced of the
26436
- * original object. Arrays and the objects inside them are cloned as well.
26437
- *
26438
- * Nesting depth is limited only by available memory, and circular references are reproduced in the
26439
- * copy rather than followed forever. Two props pointing at the same object still point at one
26440
- * shared copy afterwards.
26441
- *
26442
- * @param target Target can be anything
26443
- * @param [options={}] See type {@link Options} for more details.
26444
- *
26445
- * - `{ props: ['key1'] }` will only copy the `key1` property. When using this you will need to cast
26446
- * the return type manually (in order to keep the TS implementation in here simple I didn't
26447
- * built a complex auto resolved type for those few cases people want to use this option)
26448
- * - `{ nonenumerable: true }` will copy all non-enumerable properties. Default is `{}`
26449
- *
26450
- * @returns The target with replaced values
26451
- */
26452
- function copy(target, options = {}) {
26453
- if (typeof target !== "object" || target === null) return target;
26454
- const clones = /* @__PURE__ */ new Map();
26455
- const sources = [];
26456
- const dests = [];
26457
- const result = cloneRef(target, clones, sources, dests);
26458
- const onlyProps = Array.isArray(options.props) ? options.props : void 0;
26459
- const nonenumerable = options.nonenumerable === true;
26460
- while (sources.length) {
26461
- const source = sources.pop();
26462
- const dest = dests.pop();
26463
- if (Array.isArray(source)) {
26464
- for (let i = 0; i < source.length; i++) if (i in source) dest[i] = cloneRef(source[i], clones, sources, dests);
26465
- continue;
26466
- }
26467
- if (nonenumerable) for (const key of Object.getOwnPropertyNames(source)) {
26468
- if (key === "__proto__") continue;
26469
- if (onlyProps && !onlyProps.includes(key)) continue;
26470
- assignProp(dest, key, cloneRef(source[key], clones, sources, dests), source);
26471
- }
26472
- else for (const key in source) {
26473
- if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
26474
- if (key === "__proto__") continue;
26475
- if (onlyProps && !onlyProps.includes(key)) continue;
26476
- dest[key] = cloneRef(source[key], clones, sources, dests);
26477
- }
26478
- for (const key of Object.getOwnPropertySymbols(source)) {
26479
- if (onlyProps && !onlyProps.includes(key)) continue;
26480
- if (!nonenumerable && !Object.prototype.propertyIsEnumerable.call(source, key)) continue;
26481
- assignProp(dest, key, cloneRef(source[key], clones, sources, dests), source);
26482
- }
26588
+ function finish(ctx, seen, value, annotations) {
26589
+ if (seen) {
26590
+ seen.done = true;
26591
+ seen.value = value;
26592
+ seen.annotations = annotations;
26483
26593
  }
26484
- return result;
26594
+ ctx.annotations = annotations;
26595
+ return value;
26596
+ }
26597
+ function walkRoot(object, superJson, dedupe) {
26598
+ const ctx = {
26599
+ superJson,
26600
+ dedupe,
26601
+ seen: /* @__PURE__ */ new Map(),
26602
+ annotations: void 0
26603
+ };
26604
+ const transformedValue = walk(object, ctx, null, null);
26605
+ const identities = /* @__PURE__ */ new Map();
26606
+ ctx.seen.forEach((seen, value) => {
26607
+ if (seen.more) identities.set(value, pathsOf(seen));
26608
+ });
26609
+ return {
26610
+ transformedValue,
26611
+ annotations: toRecord(ctx.annotations),
26612
+ identities
26613
+ };
26485
26614
  }
26486
26615
 
26487
26616
  //#endregion
26488
- //#region node_modules/.pnpm/superjson@2.2.6/node_modules/superjson/dist/index.js
26617
+ //#region node_modules/.pnpm/superjson@2.2.7/node_modules/superjson/dist/index.js
26489
26618
  var SuperJSON = class {
26490
26619
  /**
26491
26620
  * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
@@ -26498,14 +26627,13 @@ var SuperJSON = class {
26498
26627
  this.dedupe = dedupe;
26499
26628
  }
26500
26629
  serialize(object) {
26501
- const identities = /* @__PURE__ */ new Map();
26502
- const output = walker(object, identities, this, this.dedupe);
26630
+ const output = walkRoot(object, this, this.dedupe);
26503
26631
  const res = { json: output.transformedValue };
26504
26632
  if (output.annotations) res.meta = {
26505
26633
  ...res.meta,
26506
26634
  values: output.annotations
26507
26635
  };
26508
- const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
26636
+ const equalityAnnotations = generateReferentialEqualityAnnotations(output.identities, this.dedupe);
26509
26637
  if (equalityAnnotations) res.meta = {
26510
26638
  ...res.meta,
26511
26639
  referentialEqualities: equalityAnnotations
@@ -26789,7 +26917,7 @@ const cliVersion = pkg.version;
26789
26917
  const cliNodeEngine = pkg.engines?.node;
26790
26918
 
26791
26919
  //#endregion
26792
- //#region ../../node_modules/.pnpm/@trpc+server@11.29.5_@types+aws-lambda@8.10.164_@types+express@5.0.6_@types+ws@8.18.2_n_d0ee0c058429d0f6dbf2db4bfd1f1e09/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
26920
+ //#region ../../node_modules/.pnpm/@trpc+server@11.29.7_@types+aws-lambda@8.10.164_@types+express@5.0.6_@types+ws@8.18.2_n_4a5bbc7e05a0f03e83d6e27192082686/node_modules/@trpc/server/dist/observable-CodTG6Sf.mjs
26793
26921
  /**
26794
26922
  * Creates an observable. `subscribe` runs for each subscriber, and can
26795
26923
  * return a function that cleans up when it unsubscribes.
@@ -49323,14 +49451,14 @@ const TRANSIENT_NETWORK_ERROR_CODES = new Set([
49323
49451
  "UND_ERR_SOCKET"
49324
49452
  ]);
49325
49453
  function getErrorCause(error) {
49326
- return errorCauseFrom(error) ?? toRecord(error)?.cause;
49454
+ return errorCauseFrom(error) ?? toRecord$1(error)?.cause;
49327
49455
  }
49328
49456
  function getErrorCode(error) {
49329
- const code = toRecord(error)?.code;
49457
+ const code = toRecord$1(error)?.code;
49330
49458
  return typeof code === "string" ? code : void 0;
49331
49459
  }
49332
49460
  function getErrorMessage(error) {
49333
- const message = errorMessageFrom(error) ?? toRecord(error)?.message;
49461
+ const message = errorMessageFrom(error) ?? toRecord$1(error)?.message;
49334
49462
  return typeof message === "string" ? message : void 0;
49335
49463
  }
49336
49464
  function getErrorChain(error) {
@@ -49369,7 +49497,7 @@ function isTransientNetworkError(error) {
49369
49497
  * NOT_FOUND; callers use this to fall back to an older endpoint.
49370
49498
  */
49371
49499
  function isMissingProcedure$2(error) {
49372
- return toRecord(toRecord(error)?.data)?.code === "NOT_FOUND" && /procedure/i.test(getErrorMessage(error) ?? "");
49500
+ return toRecord$1(toRecord$1(error)?.data)?.code === "NOT_FOUND" && /procedure/i.test(getErrorMessage(error) ?? "");
49373
49501
  }
49374
49502
 
49375
49503
  //#endregion
@@ -57914,7 +58042,7 @@ const publishCanvasArtifact = async (client, params) => {
57914
58042
  title
57915
58043
  });
57916
58044
  } catch (error) {
57917
- const code = toRecord(toRecord(error)?.data)?.code;
58045
+ const code = toRecord$1(toRecord$1(error)?.data)?.code;
57918
58046
  if (code === "BAD_REQUEST" || code === "CONFLICT" || code === "FORBIDDEN" || code === "NOT_FOUND") {
57919
58047
  const previous = pending.previous;
57920
58048
  writeBinding(manifest, previous.canvasId || previous.deploymentId ? previous : {
@@ -57937,7 +58065,7 @@ const publishCanvasArtifact = async (client, params) => {
57937
58065
  requestedSlug: params.slug,
57938
58066
  version: saved.version
57939
58067
  }).catch((error) => {
57940
- if (toRecord(toRecord(error)?.data)?.code === "BAD_REQUEST") writeBinding(manifest, {
58068
+ if (toRecord$1(toRecord$1(error)?.data)?.code === "BAD_REQUEST") writeBinding(manifest, {
57941
58069
  ...activeBinding,
57942
58070
  pendingCanvas: {
57943
58071
  ...pending,
@@ -58034,7 +58162,7 @@ const fingerprintCreate = (entries, requestedSlug, title) => {
58034
58162
  * Rejections such as quota, size or an expired upload carry other codes.
58035
58163
  */
58036
58164
  const isUnknownCommitOutcome = (error) => {
58037
- const code = toRecord(toRecord(error)?.data)?.code;
58165
+ const code = toRecord$1(toRecord$1(error)?.data)?.code;
58038
58166
  return code === void 0 || code === "INTERNAL_SERVER_ERROR";
58039
58167
  };
58040
58168
  /** Market's answer when a reused key carries a different request. */
@@ -58973,7 +59101,7 @@ function registerBotMessengersCommands(bot) {
58973
59101
  }
58974
59102
  if (installations.length === 0) {
58975
59103
  console.log("No System Bot installations connected.");
58976
- console.log(`\nRun ${import_picocolors.default.dim("lh bot messengers platforms")} to see what's available, then install via ${import_picocolors.default.dim("Settings → Messenger")} (OAuth requires a browser).`);
59104
+ console.log(`\nRun ${import_picocolors.default.dim("lh bot messengers platforms")} to see what's available, then install via ${import_picocolors.default.dim("Marketplace → Apps")} (OAuth requires a browser).`);
58977
59105
  return;
58978
59106
  }
58979
59107
  printTable(installations.map((i) => [
@@ -59047,7 +59175,7 @@ function registerBotMessengersCommands(bot) {
59047
59175
  "APP ID",
59048
59176
  "BOT USERNAME"
59049
59177
  ]);
59050
- console.log(`\nInstalls are initiated via ${import_picocolors.default.dim("Settings → Messenger")} in the web UI (OAuth needs a browser).`);
59178
+ console.log(`\nInstalls are initiated via ${import_picocolors.default.dim("Marketplace → Apps")} in the web UI (OAuth needs a browser).`);
59051
59179
  });
59052
59180
  const links = messengers.command("links").description("Manage per-user account links — routing of inbound IM to your agents");
59053
59181
  links.command("list").description("List all your account links across platforms and tenants.").option("--json", "Output JSON").action(async (options) => {
@@ -60193,10 +60321,288 @@ var init_config = __esmMin((() => {
60193
60321
  QODER_CLI_INSTALL_DOCS_URL = qoderDescriptor.install.docsUrl;
60194
60322
  }));
60195
60323
 
60324
+ //#endregion
60325
+ //#region ../../packages/heterogeneous-agents/src/spawn/antigravity.ts
60326
+ /** agy reads a single JSONL user message, then finishes the turn when stdin closes. */
60327
+ const ANTIGRAVITY_BASE_ARGS = [
60328
+ "--input-format",
60329
+ "stream-json",
60330
+ "--output-format",
60331
+ "stream-json",
60332
+ "--dangerously-skip-permissions"
60333
+ ];
60334
+ /** A Connect service can inherit an old SSH session that makes agy skip the desktop keyring. */
60335
+ const getAntigravitySpawnEnv = (env) => {
60336
+ if (env.LOBEHUB_CONNECT_SERVICE !== "1") return env;
60337
+ const childEnv = { ...env };
60338
+ delete childEnv.SSH_CLIENT;
60339
+ delete childEnv.SSH_CONNECTION;
60340
+ delete childEnv.SSH_TTY;
60341
+ return childEnv;
60342
+ };
60343
+ const FULL_ACCESS_SETTINGS = JSON.stringify({
60344
+ agentMode: "",
60345
+ allowNonWorkspaceAccess: true,
60346
+ enableTerminalSandbox: false
60347
+ });
60348
+ const MANAGED_FLAGS = new Set([
60349
+ "--",
60350
+ "--input-format",
60351
+ "--output-format",
60352
+ "--print",
60353
+ "--prompt",
60354
+ "--prompt-interactive",
60355
+ "--remote-control",
60356
+ "-i",
60357
+ "-p",
60358
+ "--continue",
60359
+ "-c",
60360
+ "--conversation"
60361
+ ]);
60362
+ const buildAntigravityArgs = ({ extraArgs = [], resumeSessionId }) => {
60363
+ const conflicting = extraArgs.find((arg) => MANAGED_FLAGS.has(arg.split("=")[0]));
60364
+ if (conflicting) throw new Error(`LobeHub manages Antigravity's prompt, output and session flags: ${conflicting}`);
60365
+ const hasCustomPermissionSettings = extraArgs.some((arg) => [
60366
+ "--mode",
60367
+ "--sandbox",
60368
+ "--settings"
60369
+ ].includes(arg.split("=")[0]));
60370
+ return [
60371
+ ...ANTIGRAVITY_BASE_ARGS,
60372
+ ...hasCustomPermissionSettings ? [] : ["--settings", FULL_ACCESS_SETTINGS],
60373
+ ...resumeSessionId ? ["--conversation", resumeSessionId] : [],
60374
+ ...extraArgs
60375
+ ];
60376
+ };
60377
+
60378
+ //#endregion
60379
+ //#region ../../packages/heterogeneous-agents/src/spawn/wsl.ts
60380
+ var WSL_COMMAND_PREFIX, isWslCommand, parseWslCommand, formatWslCommand, getWslExecutable, toWslPath, toWslArg, NEVER_FORWARDED, FORWARDED_PREFIXES, FORWARDED_PROXY, ENV_NAME, collectForwardedEnvNames, mergeWslEnv, buildWslSpawnPlan, WSL_PROBE_TIMEOUT_MS, WSL_LIST_TIMEOUT_MS, PATH_MARKER, COMMAND_MARKER, WSL_PROBED_COMMANDS, PROBE_SCRIPT, runWsl, decodeWslOutput, parseWslDistroList, parseWslProbeOutput, distrosPromise, distroProbes, settledPathEnv, listWslDistros, probeWslDistro, invalidateWslCache, findWslCommandCandidates, getWslPathEnv;
60381
+ var init_wsl = __esmMin((() => {
60382
+ init_config();
60383
+ WSL_COMMAND_PREFIX = "wsl://";
60384
+ isWslCommand = (command) => command.trim().toLowerCase().startsWith(WSL_COMMAND_PREFIX);
60385
+ parseWslCommand = (command) => {
60386
+ const trimmed = command.trim();
60387
+ if (!isWslCommand(trimmed)) return;
60388
+ const rest = trimmed.slice(6);
60389
+ const slash = rest.indexOf("/");
60390
+ if (slash <= 0) return;
60391
+ const linuxPath = rest.slice(slash);
60392
+ if (linuxPath.length < 2) return;
60393
+ return {
60394
+ distro: rest.slice(0, slash),
60395
+ linuxPath
60396
+ };
60397
+ };
60398
+ formatWslCommand = ({ distro, linuxPath }) => `${WSL_COMMAND_PREFIX}${distro}${linuxPath}`;
60399
+ getWslExecutable = (env = process.env) => `${(env.SystemRoot || env.SYSTEMROOT || "C:\\Windows").replace(/[\\/]+$/, "")}\\System32\\wsl.exe`;
60400
+ toWslPath = (value) => {
60401
+ const drive = value.match(/^([A-Za-z]):[\\/](.*)$/s);
60402
+ if (drive) {
60403
+ const rest = drive[2].replaceAll("\\", "/");
60404
+ return `/mnt/${drive[1].toLowerCase()}${rest ? `/${rest}` : ""}`;
60405
+ }
60406
+ const unc = value.match(/^\\\\wsl(?:\$|\.localhost)\\[^\\]+(\\.*)?$/i);
60407
+ if (unc) return (unc[1] ?? "\\").replaceAll("\\", "/");
60408
+ return value;
60409
+ };
60410
+ toWslArg = (arg) => {
60411
+ const translated = toWslPath(arg);
60412
+ if (translated !== arg) return translated;
60413
+ const flag = arg.match(/^(--?[\w-]+=)(.+)$/s);
60414
+ if (!flag) return arg;
60415
+ const value = toWslPath(flag[2]);
60416
+ return value === flag[2] ? arg : `${flag[1]}${value}`;
60417
+ };
60418
+ NEVER_FORWARDED = new Set([
60419
+ "appdata",
60420
+ "comspec",
60421
+ "home",
60422
+ "homedrive",
60423
+ "homepath",
60424
+ "localappdata",
60425
+ "path",
60426
+ "pathext",
60427
+ "programdata",
60428
+ "programfiles",
60429
+ "programfiles(x86)",
60430
+ "pwd",
60431
+ "shell",
60432
+ "systemroot",
60433
+ "temp",
60434
+ "tmp",
60435
+ "userprofile",
60436
+ "windir",
60437
+ "wslenv"
60438
+ ]);
60439
+ FORWARDED_PREFIXES = [
60440
+ "ANTHROPIC_",
60441
+ "CLAUDE_",
60442
+ "CODEX_",
60443
+ "CURSOR_",
60444
+ "DEEPSEEK_",
60445
+ "DSH_",
60446
+ "LOBEHUB_",
60447
+ "OPENAI_"
60448
+ ];
60449
+ FORWARDED_PROXY = /^(?:all|http|https|no)_proxy$/i;
60450
+ ENV_NAME = /^[A-Za-z_]\w*$/;
60451
+ collectForwardedEnvNames = (env) => Object.keys(env).filter((name) => {
60452
+ if (!ENV_NAME.test(name) || NEVER_FORWARDED.has(name.toLowerCase())) return false;
60453
+ if (env[name] === void 0) return false;
60454
+ return env[name] !== process.env[name] || FORWARDED_PREFIXES.some((prefix) => name.toUpperCase().startsWith(prefix)) || FORWARDED_PROXY.test(name);
60455
+ });
60456
+ mergeWslEnv = (current, names) => {
60457
+ const entries = (current ?? "").split(":").filter(Boolean);
60458
+ const present = new Set(entries.map((entry) => entry.split("/")[0].toLowerCase()));
60459
+ for (const name of names) if (!present.has(name.toLowerCase())) entries.push(`${name}/u`);
60460
+ return entries.join(":");
60461
+ };
60462
+ buildWslSpawnPlan = ({ distro, linuxPath }, args, env, pathEnv) => {
60463
+ const forwarded = env ? collectForwardedEnvNames(env) : [];
60464
+ return {
60465
+ args: [
60466
+ "--distribution",
60467
+ distro,
60468
+ "--exec",
60469
+ ...pathEnv ? ["env", `PATH=${pathEnv}`] : [],
60470
+ linuxPath,
60471
+ ...args.map(toWslArg)
60472
+ ],
60473
+ command: getWslExecutable(env),
60474
+ env: env && forwarded.length > 0 ? {
60475
+ ...env,
60476
+ WSLENV: mergeWslEnv(env.WSLENV, forwarded)
60477
+ } : env
60478
+ };
60479
+ };
60480
+ WSL_PROBE_TIMEOUT_MS = 2e4;
60481
+ WSL_LIST_TIMEOUT_MS = 5e3;
60482
+ PATH_MARKER = "__LOBEHUB_WSL_PATH__=";
60483
+ COMMAND_MARKER = "__LOBEHUB_WSL_CMD__=";
60484
+ WSL_PROBED_COMMANDS = [...new Set([
60485
+ ...HETEROGENEOUS_AGENT_CONFIGS.map((config) => config.defaultCommand),
60486
+ "cursor-agent",
60487
+ "dsh"
60488
+ ])].filter((name) => /^[\w.-]+$/.test(name));
60489
+ PROBE_SCRIPT = `lobehub_shell="\${SHELL:-/bin/sh}"
60490
+ case "\${lobehub_shell##*/}" in bash|zsh|ksh|sh|dash) ;; *) lobehub_shell=/bin/sh ;; esac
60491
+ "$lobehub_shell" -ilc 'printf "\\n${PATH_MARKER}%s\\n" "$PATH"; for c in "$@"; do p=$(command -v "$c" 2>/dev/null) || continue; case "$p" in /*) printf "${COMMAND_MARKER}%s=%s\\n" "$c" "$p" ;; esac; done' lobehub "$@" </dev/null
60492
+ `;
60493
+ runWsl = (args, { env, input, timeout }) => new Promise((resolve, reject) => {
60494
+ let settled = false;
60495
+ const finish = (error, output) => {
60496
+ if (settled) return;
60497
+ settled = true;
60498
+ clearTimeout(timer);
60499
+ if (error) reject(error);
60500
+ else resolve(output);
60501
+ };
60502
+ const child = spawn(getWslExecutable(env), args, {
60503
+ env: {
60504
+ ...env ?? process.env,
60505
+ WSL_UTF8: "1"
60506
+ },
60507
+ stdio: [
60508
+ "pipe",
60509
+ "pipe",
60510
+ "ignore"
60511
+ ],
60512
+ windowsHide: true
60513
+ });
60514
+ const chunks = [];
60515
+ const timer = setTimeout(() => {
60516
+ child.kill();
60517
+ finish(/* @__PURE__ */ new Error("Timed out waiting for WSL"));
60518
+ }, timeout);
60519
+ child.stdout?.on("data", (chunk) => chunks.push(chunk));
60520
+ child.on("error", (error) => finish(error));
60521
+ child.on("close", (code) => {
60522
+ if (code === 0) finish(void 0, Buffer.concat(chunks));
60523
+ else finish(/* @__PURE__ */ new Error(`wsl.exe exited with code ${code}`));
60524
+ });
60525
+ child.stdin?.on("error", () => {});
60526
+ child.stdin?.end(input ?? "");
60527
+ });
60528
+ decodeWslOutput = (output) => (output.includes(0) ? output.toString("utf16le") : output.toString("utf8")).replace(/^\uFEFF/, "");
60529
+ parseWslDistroList = (output) => output.split(/\r?\n/).map((line) => line.replaceAll("\0", "").trim()).filter((name) => name && !/^docker-desktop/i.test(name));
60530
+ parseWslProbeOutput = (output) => {
60531
+ const commands = /* @__PURE__ */ new Map();
60532
+ let pathEnv;
60533
+ for (const rawLine of output.split(/\r?\n/)) {
60534
+ const line = rawLine.trim();
60535
+ if (line.startsWith(PATH_MARKER)) pathEnv = line.slice(21) || void 0;
60536
+ else if (line.startsWith(COMMAND_MARKER)) {
60537
+ const entry = line.slice(20);
60538
+ const separator = entry.indexOf("=");
60539
+ const name = entry.slice(0, separator);
60540
+ const linuxPath = entry.slice(separator + 1);
60541
+ if (separator > 0 && linuxPath.startsWith("/")) commands.set(name, linuxPath);
60542
+ }
60543
+ }
60544
+ return {
60545
+ commands,
60546
+ pathEnv
60547
+ };
60548
+ };
60549
+ ;
60550
+ distroProbes = /* @__PURE__ */ new Map();
60551
+ settledPathEnv = /* @__PURE__ */ new Map();
60552
+ listWslDistros = () => {
60553
+ distrosPromise ??= runWsl(["--list", "--quiet"], { timeout: WSL_LIST_TIMEOUT_MS }).then((output) => parseWslDistroList(decodeWslOutput(output))).catch(() => []);
60554
+ return distrosPromise;
60555
+ };
60556
+ probeWslDistro = (distro) => {
60557
+ let probe = distroProbes.get(distro);
60558
+ if (!probe) {
60559
+ probe = runWsl([
60560
+ "--distribution",
60561
+ distro,
60562
+ "--exec",
60563
+ "sh",
60564
+ "-s",
60565
+ "--",
60566
+ ...WSL_PROBED_COMMANDS
60567
+ ], {
60568
+ input: PROBE_SCRIPT,
60569
+ timeout: WSL_PROBE_TIMEOUT_MS
60570
+ }).then((output) => {
60571
+ const result = parseWslProbeOutput(decodeWslOutput(output));
60572
+ settledPathEnv.set(distro, result.pathEnv);
60573
+ return result;
60574
+ }).catch(() => {
60575
+ distroProbes.delete(distro);
60576
+ });
60577
+ distroProbes.set(distro, probe);
60578
+ }
60579
+ return probe;
60580
+ };
60581
+ invalidateWslCache = () => {
60582
+ distrosPromise = void 0;
60583
+ distroProbes.clear();
60584
+ settledPathEnv.clear();
60585
+ };
60586
+ findWslCommandCandidates = async (command) => {
60587
+ if (platform() !== "win32") return [];
60588
+ const distros = await listWslDistros();
60589
+ const probes = await Promise.all(distros.map((distro) => probeWslDistro(distro)));
60590
+ return distros.flatMap((distro, index) => {
60591
+ const linuxPath = probes[index]?.commands.get(command);
60592
+ return linuxPath ? [formatWslCommand({
60593
+ distro,
60594
+ linuxPath
60595
+ })] : [];
60596
+ });
60597
+ };
60598
+ getWslPathEnv = async (distro) => (await probeWslDistro(distro))?.pathEnv;
60599
+ }));
60600
+
60196
60601
  //#endregion
60197
60602
  //#region ../../packages/heterogeneous-agents/src/spawn/cliSpawn.ts
60198
- var WINDOWS_EXE_EXT_PATTERN, WINDOWS_MAX_COMMAND_LINE_LENGTH, WINDOWS_NODE_EXE_PATTERN, isWindows$1, quoteWindowsCommandLineArgument, assertWindowsCommandLineFits, isPathLikeCommand$1, fileExists$1, execFileString, pickWindowsNodeExecutable, joinShimRelativePath, resolveShimPathToken, getExistingShimPathToken, resolveWindowsNodeCommand, getNodeCommand, getNodeScriptTarget, inferWindowsNodeScriptFromShim, inferWindowsExecutableFromShim, inferWindowsNpmShimTarget, resolveWindowsBareCommand, resolveCliSpawnPlan;
60603
+ var WINDOWS_EXE_EXT_PATTERN, WINDOWS_MAX_COMMAND_LINE_LENGTH, WINDOWS_NODE_EXE_PATTERN, isWindows$1, quoteWindowsCommandLineArgument, assertWindowsCommandLineFits, isPathLikeCommand$1, fileExists$1, execFileString, pickWindowsNodeExecutable, joinShimRelativePath, resolveShimPathToken, getExistingShimPathToken, resolveWindowsNodeCommand, getNodeCommand, getNodeScriptTarget, inferWindowsNodeScriptFromShim, inferWindowsExecutableFromShim, inferWindowsPowerShellShimTarget, inferWindowsNpmShimTarget, resolveWindowsBareCommand, resolveCliSpawnPlan;
60199
60604
  var init_cliSpawn = __esmMin((() => {
60605
+ init_wsl();
60200
60606
  WINDOWS_EXE_EXT_PATTERN = /\.exe$/i;
60201
60607
  WINDOWS_MAX_COMMAND_LINE_LENGTH = 32767;
60202
60608
  WINDOWS_NODE_EXE_PATTERN = /(?:^|[\\/])node(?:\.exe)?$/i;
@@ -60312,12 +60718,33 @@ var init_cliSpawn = __esmMin((() => {
60312
60718
  if (await fileExists$1(command)) return { command };
60313
60719
  }
60314
60720
  };
60721
+ inferWindowsPowerShellShimTarget = async (shimPath, source, env) => {
60722
+ const match = source.match(/\b(powershell|pwsh)(?:\.exe)?\b[^\r\n]*?-File\s+"?(%(?:~dp0|dp0%))?\\?([^"\r\n]+?\.ps1)"?/i);
60723
+ if (!match) return;
60724
+ const [, host, relativeToShim, scriptToken] = match;
60725
+ const script = relativeToShim ? joinShimRelativePath(shimPath, scriptToken) : scriptToken.replaceAll("/", "\\");
60726
+ if (!path.win32.isAbsolute(script) || !await fileExists$1(script)) return;
60727
+ const systemRoot = env?.SystemRoot || process.env.SystemRoot || "C:\\Windows";
60728
+ const command = host.toLowerCase() === "pwsh" ? "pwsh.exe" : path.win32.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
60729
+ return {
60730
+ argsPrefix: [
60731
+ "-NoLogo",
60732
+ "-NoProfile",
60733
+ "-NonInteractive",
60734
+ "-ExecutionPolicy",
60735
+ "Bypass",
60736
+ "-File",
60737
+ script
60738
+ ],
60739
+ command
60740
+ };
60741
+ };
60315
60742
  inferWindowsNpmShimTarget = async (shimPath, env) => {
60316
60743
  if (WINDOWS_EXE_EXT_PATTERN.test(shimPath)) return { command: shimPath };
60317
60744
  if (!await fileExists$1(shimPath)) return;
60318
60745
  try {
60319
60746
  const source = await readFile(shimPath, "utf8");
60320
- return await inferWindowsNodeScriptFromShim(shimPath, source, env) ?? await inferWindowsExecutableFromShim(shimPath, source);
60747
+ return await inferWindowsNodeScriptFromShim(shimPath, source, env) ?? await inferWindowsExecutableFromShim(shimPath, source) ?? await inferWindowsPowerShellShimTarget(shimPath, source, env);
60321
60748
  } catch {
60322
60749
  return;
60323
60750
  }
@@ -60336,6 +60763,13 @@ var init_cliSpawn = __esmMin((() => {
60336
60763
  };
60337
60764
  resolveCliSpawnPlan = async (command, args, env) => {
60338
60765
  const trimmedCommand = command.trim();
60766
+ const wslCommand = parseWslCommand(trimmedCommand);
60767
+ if (wslCommand) {
60768
+ if (!isWindows$1()) throw new Error(`A WSL command only runs on Windows: ${trimmedCommand}`);
60769
+ const wslPlan = buildWslSpawnPlan(wslCommand, args, env, await getWslPathEnv(wslCommand.distro));
60770
+ assertWindowsCommandLineFits(wslPlan);
60771
+ return wslPlan;
60772
+ }
60339
60773
  if (!isWindows$1() || !trimmedCommand) return {
60340
60774
  args,
60341
60775
  command
@@ -60360,6 +60794,7 @@ var resolveCliCommand_exports = /* @__PURE__ */ __exportAll$2({
60360
60794
  LOGIN_SHELL_TIMEOUT_STATUS_ERROR: () => LOGIN_SHELL_TIMEOUT_STATUS_ERROR,
60361
60795
  LoginShellPathTimeoutError: () => LoginShellPathTimeoutError,
60362
60796
  detectHeterogeneousCliCommand: () => detectHeterogeneousCliCommand,
60797
+ detectInWslWhenMissing: () => detectInWslWhenMissing,
60363
60798
  detectValidatedCommand: () => detectValidatedCommand,
60364
60799
  detectValidatedCommandCandidates: () => detectValidatedCommandCandidates,
60365
60800
  invalidateLoginShellPathCache: () => invalidateLoginShellPathCache,
@@ -60367,10 +60802,11 @@ var resolveCliCommand_exports = /* @__PURE__ */ __exportAll$2({
60367
60802
  resolveHeteroSpawnCommand: () => resolveHeteroSpawnCommand,
60368
60803
  resolveUserSpawnPath: () => resolveUserSpawnPath
60369
60804
  });
60370
- var execFilePromise$2, VERSION_PATTERN, extractVersion, isWindows, shellPathPromise, registryPathPromise, WINDOWS_SHELL_METAS, WINDOWS_RUNNABLE_EXTS, WINDOWS_SHIM_EXTS, WINDOWS_SHELL_MAX_COMMAND_LINE_LENGTH, isWindowsRunnablePath, isWindowsShimPath, pickWindowsRunnables, isPathLikeCommand, LOGIN_SHELL_PATH_TIMEOUT_MS, LOGIN_SHELL_TIMEOUT_STATUS_ERROR, isLoginShellTimeoutStatus, LoginShellPathTimeoutError, getLoginShellPath, cachedShellPath, shellPathGeneration, getCurrentLoginShellPath, invalidateLoginShellPathCache, WINDOWS_REGISTRY_PATH_KEYS, WINDOWS_REGISTRY_PATH_VALUE, expandWindowsEnvRefs$1, readWindowsRegistryPathValue, readMergedWindowsRegistryPath, getWindowsRegistryPath, mergePathValues, resolveUserSpawnPath, recoverProbeEnvironment, getCommandPathLines, resolveCommandCandidates, quoteWindowsShellToken, buildWindowsShellProbe, UNRESOLVED_SHIM, execProbe, detectValidatedCommandInEnvironment, isProbeableCommand, detectValidatedCommandCandidates, detectValidatedCommand, HETEROGENEOUS_CLI_AGENT_OPTIONS, DEFAULT_HETERO_COMMAND, getWellKnownCommandPaths, detectHeterogeneousCliCommand, resolveHeteroSpawnCommand;
60805
+ var execFilePromise$2, VERSION_PATTERN, extractVersion, isWindows, shellPathPromise, registryPathPromise, WINDOWS_SHELL_METAS, WINDOWS_RUNNABLE_EXTS, WINDOWS_SHIM_EXTS, WINDOWS_SHELL_MAX_COMMAND_LINE_LENGTH, isWindowsRunnablePath, isWindowsShimPath, pickWindowsRunnables, isPathLikeCommand, LOGIN_SHELL_PATH_TIMEOUT_MS, LOGIN_SHELL_TIMEOUT_STATUS_ERROR, isLoginShellTimeoutStatus, LoginShellPathTimeoutError, getLoginShellPath, cachedShellPath, shellPathGeneration, getCurrentLoginShellPath, invalidateLoginShellPathCache, WINDOWS_REGISTRY_PATH_KEYS, WINDOWS_REGISTRY_PATH_VALUE, expandWindowsEnvRefs$1, readWindowsRegistryPathValue, readMergedWindowsRegistryPath, getWindowsRegistryPath, mergePathValues, resolveUserSpawnPath, recoverProbeEnvironment, getCommandPathLines, resolveCommandCandidates, quoteWindowsShellToken, buildWindowsShellProbe, UNRESOLVED_SHIM, execProbe, detectValidatedCommandInEnvironment, isProbeableCommand, detectValidatedCommandCandidates, detectValidatedCommand, HETEROGENEOUS_CLI_AGENT_OPTIONS, DEFAULT_HETERO_COMMAND, getWellKnownCommandPaths, detectHeterogeneousCliCommand, WSL_COMMAND_NAMES, detectInWslWhenMissing, resolveHeteroSpawnCommand;
60371
60806
  var init_resolveCliCommand = __esmMin((() => {
60372
60807
  init_config();
60373
60808
  init_cliSpawn();
60809
+ init_wsl();
60374
60810
  execFilePromise$2 = promisify(execFile);
60375
60811
  VERSION_PATTERN = /v?(\d+\.\d+\.\d+(?:-[\dA-Za-z.-]+)?(?:\+[\dA-Za-z.-]+)?)/;
60376
60812
  extractVersion = (versionBanner) => versionBanner.match(VERSION_PATTERN)?.[1];
@@ -60435,6 +60871,7 @@ var init_resolveCliCommand = __esmMin((() => {
60435
60871
  return shellPathPromise;
60436
60872
  };
60437
60873
  invalidateLoginShellPathCache = () => {
60874
+ invalidateWslCache();
60438
60875
  cachedShellPath = void 0;
60439
60876
  shellPathGeneration += 1;
60440
60877
  shellPathPromise = void 0;
@@ -60566,7 +61003,7 @@ var init_resolveCliCommand = __esmMin((() => {
60566
61003
  const spawnPlan = await resolveCliSpawnPlan(command, args, env);
60567
61004
  if (isWindows() && spawnPlan.command === command && isWindowsShimPath(command)) return UNRESOLVED_SHIM;
60568
61005
  return execFilePromise$2(spawnPlan.command, spawnPlan.args, {
60569
- env,
61006
+ env: spawnPlan.env ?? env,
60570
61007
  timeout: 5e3,
60571
61008
  windowsHide: true
60572
61009
  });
@@ -60651,7 +61088,7 @@ var init_resolveCliCommand = __esmMin((() => {
60651
61088
  const inheritedStatus = await detectValidatedCommandInEnvironment(command, options, probeEnv);
60652
61089
  if (inheritedStatus.available) return inheritedStatus;
60653
61090
  lastStatus = inheritedStatus;
60654
- if (!isProbeableCommand(command)) continue;
61091
+ if (!isProbeableCommand(command) || isWslCommand(command)) continue;
60655
61092
  if (!recoveryAttempted) {
60656
61093
  recoveryAttempted = true;
60657
61094
  try {
@@ -60788,6 +61225,11 @@ var init_resolveCliCommand = __esmMin((() => {
60788
61225
  path.join(homedir(), "Library", "pnpm", "copilot")
60789
61226
  ];
60790
61227
  case "cursor":
61228
+ if (platform() === "win32") {
61229
+ const localAppData = process.env.LOCALAPPDATA;
61230
+ if (!localAppData) return [];
61231
+ return [path.win32.join(localAppData, "cursor-agent", "agent.cmd")];
61232
+ }
60791
61233
  if (platform() !== "darwin" && platform() !== "linux") return [];
60792
61234
  return [path.join(homedir(), ".local", "bin", "agent"), path.join(homedir(), ".local", "bin", "cursor-agent")];
60793
61235
  case "droid":
@@ -60859,7 +61301,19 @@ var init_resolveCliCommand = __esmMin((() => {
60859
61301
  detectHeterogeneousCliCommand = async (agentType, command, probeEnv) => {
60860
61302
  const validator = HETEROGENEOUS_CLI_AGENT_OPTIONS[agentType];
60861
61303
  if (!validator) return { available: false };
60862
- return detectValidatedCommandCandidates(command.trim() === DEFAULT_HETERO_COMMAND[agentType] ? [command, ...getWellKnownCommandPaths(agentType)] : [command], validator, probeEnv);
61304
+ const isDefaultCommand = command.trim() === DEFAULT_HETERO_COMMAND[agentType];
61305
+ const status = await detectValidatedCommandCandidates(isDefaultCommand ? [command, ...getWellKnownCommandPaths(agentType)] : [command], validator, probeEnv);
61306
+ if (!isDefaultCommand) return status;
61307
+ return detectInWslWhenMissing(status, WSL_COMMAND_NAMES[agentType] ?? [command], validator);
61308
+ };
61309
+ WSL_COMMAND_NAMES = { cursor: ["agent", "cursor-agent"] };
61310
+ detectInWslWhenMissing = async (status, commandNames, options) => {
61311
+ if (status.available || !isWindows()) return status;
61312
+ const candidates = [];
61313
+ for (const name of commandNames) candidates.push(...await findWslCommandCandidates(name));
61314
+ if (candidates.length === 0) return status;
61315
+ const wslStatus = await detectValidatedCommandCandidates(candidates, options);
61316
+ return wslStatus.available ? wslStatus : status;
60863
61317
  };
60864
61318
  resolveHeteroSpawnCommand = async (agentType, command) => {
60865
61319
  const requested = command?.trim();
@@ -60926,11 +61380,11 @@ const fetchAntigravityQuota = async (params = {}) => {
60926
61380
  });
60927
61381
  try {
60928
61382
  const resolved = await resolveHeteroSpawnCommand("antigravity", params.command);
60929
- const env = {
61383
+ const env = getAntigravitySpawnEnv({
60930
61384
  ...process.env,
60931
61385
  ...resolved.pathEnv ? { PATH: resolved.pathEnv } : {},
60932
61386
  ...params.env
60933
- };
61387
+ });
60934
61388
  const plan = await resolveCliSpawnPlan(resolved.command, [
60935
61389
  "-p",
60936
61390
  "/usage",
@@ -60939,15 +61393,19 @@ const fetchAntigravityQuota = async (params = {}) => {
60939
61393
  "--print-timeout",
60940
61394
  "15s"
60941
61395
  ], env);
60942
- const { stdout } = await execFilePromise$1(plan.command, plan.args, {
61396
+ const query = execFilePromise$1(plan.command, plan.args, {
60943
61397
  cwd: tmpdir(),
60944
61398
  encoding: "utf8",
60945
- env,
61399
+ env: plan.env ?? env,
60946
61400
  killSignal: "SIGKILL",
60947
61401
  maxBuffer: 1024 * 1024,
60948
61402
  timeout: 2e4,
60949
61403
  windowsHide: true
60950
61404
  });
61405
+ query.child?.stderr?.on("data", (chunk) => {
61406
+ if (String(chunk).includes("Authentication required. Please visit the URL to log in:")) query.child.kill("SIGKILL");
61407
+ });
61408
+ const { stdout } = await query;
60951
61409
  let payload;
60952
61410
  try {
60953
61411
  payload = JSON.parse(stdout);
@@ -60969,7 +61427,7 @@ const fetchAntigravityQuota = async (params = {}) => {
60969
61427
  } catch (error) {
60970
61428
  const record = isRecord$8(error) ? error : {};
60971
61429
  const detail = `${record.stderr ?? ""} ${record.message ?? ""}`;
60972
- return failure(record.code === "ENOENT" ? "cli_not_found" : record.killed || record.code === "ETIMEDOUT" ? "timeout" : isHeterogeneousAgentAuthRequired("antigravity", detail) ? "auth_required" : "command_failed");
61430
+ return failure(record.code === "ENOENT" ? "cli_not_found" : isHeterogeneousAgentAuthRequired("antigravity", detail) ? "auth_required" : record.killed || record.code === "ETIMEDOUT" ? "timeout" : "command_failed");
60973
61431
  }
60974
61432
  };
60975
61433
 
@@ -62263,7 +62721,7 @@ const materializeImageToPath = async (image, cacheDir) => {
62263
62721
  if (image.path) return image.path;
62264
62722
  const ext = EXT_BY_MEDIA_TYPE[normalizeMediaType(image.mediaType)] || EXT_BY_MEDIA_TYPE[guessMediaTypeFromBuffer(image.buffer) ?? ""];
62265
62723
  if (!ext) throw new Error(`Unsupported image media type for path materialization: ${image.mediaType}`);
62266
- const key = sha256Hex(`${image.mediaType}:${image.buffer.length}:${image.buffer.subarray(0, 64).toString("hex")}`);
62724
+ const key = sha256Hex(image.buffer);
62267
62725
  const filePath = path.join(cacheDir, `${key}${ext}`);
62268
62726
  try {
62269
62727
  await access(filePath);
@@ -62376,6 +62834,7 @@ const buildQoderInput = async (blocks, options) => {
62376
62834
  * extra CLI args required to attach images. The single source of truth for
62377
62835
  * how each external agent CLI receives multimodal input.
62378
62836
  *
62837
+ * - `antigravity`: stream-json text on stdin with local paths for the built-in image reader
62379
62838
  * - `amp` / `claude-code` / `codebuddy`: stream-json on stdin with text + base64 image content blocks
62380
62839
  * - `codex`: raw text on stdin + repeatable `--image <path>` flags
62381
62840
  * - `kimi-code`: `--prompt <text>` with materialized image paths referenced in the text
@@ -62389,15 +62848,18 @@ const buildQoderInput = async (blocks, options) => {
62389
62848
  const buildAgentInput = async (agentType, prompt, options = {}) => {
62390
62849
  const blocks = toBlocks$1(prompt);
62391
62850
  switch (agentType) {
62392
- case "antigravity":
62393
- if (blocks.some(isImageBlock)) throw new Error("Antigravity CLI stream input does not support image attachments.");
62851
+ case "antigravity": {
62852
+ const imagePaths = await resolvePathInputImagePaths(blocks, options);
62853
+ const attachments = imagePaths.length ? ["Use your built-in image-reading tool to inspect the attached images before answering:", ...imagePaths.map((imagePath) => `- ${JSON.stringify(path.resolve(imagePath))}`)].join("\n") : "";
62854
+ const content = [collectText(blocks), attachments].filter(Boolean).join("\n\n");
62394
62855
  return {
62395
62856
  args: [],
62396
62857
  stdin: `${JSON.stringify({
62397
62858
  event: "user",
62398
- message: { content: collectText(blocks) }
62859
+ message: { content }
62399
62860
  })}\n`
62400
62861
  };
62862
+ }
62401
62863
  case "amp":
62402
62864
  case "claude-code":
62403
62865
  case "codebuddy": return buildClaudeCompatibleStdin(blocks, options);
@@ -62745,7 +63207,7 @@ var CodexAppServerClient = class {
62745
63207
  const child = spawnManaged(spawnPlan.command, spawnPlan.args, {
62746
63208
  cwd: this.options.cwd,
62747
63209
  detached: process.platform !== "win32",
62748
- env: this.options.env,
63210
+ env: spawnPlan.env ?? this.options.env,
62749
63211
  stdio: [
62750
63212
  "pipe",
62751
63213
  "pipe",
@@ -65152,13 +65614,13 @@ var AcpStdioClient = class {
65152
65614
  async start() {
65153
65615
  if (this.child) return;
65154
65616
  if (this.closed) throw new Error("ACP stdio client is closed");
65155
- const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args);
65617
+ const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args, this.options.env);
65156
65618
  if (this.closed) throw new Error("ACP stdio client is closed");
65157
65619
  const detached = process.platform !== "win32" && (this.options.detached ?? true);
65158
65620
  const child = spawnManaged(spawnPlan.command, spawnPlan.args, {
65159
65621
  cwd: this.options.cwd,
65160
65622
  detached,
65161
- env: this.options.env,
65623
+ env: spawnPlan.env ?? this.options.env,
65162
65624
  stdio: [
65163
65625
  "pipe",
65164
65626
  "pipe",
@@ -65942,29 +66404,38 @@ const stringifyOutput = (value) => typeof value === "string" ? value : value ===
65942
66404
  /**
65943
66405
  * Native agy NDJSON protocol, not the Gemini/Claude stream-json protocol.
65944
66406
  * https://antigravity.google/docs/cli/headless/
65945
- * LobeHub uses one process per turn and --conversation to resume. The native
65946
- * protocol also supports multiple turns while stdin remains open.
66407
+ * Supports both one-shot turns and multi-turn liveInput steering while stdin remains open.
65947
66408
  */
65948
66409
  var AntigravityAdapter = class {
65949
66410
  sessionId;
65950
66411
  completedSteps = /* @__PURE__ */ new Set();
65951
66412
  flushed = false;
65952
66413
  hasResponseText = false;
66414
+ latestTurnCompleted = false;
65953
66415
  model;
65954
66416
  pendingTools = /* @__PURE__ */ new Map();
65955
66417
  resultReceived = false;
65956
66418
  completionValidated = false;
65957
66419
  responseStep;
66420
+ runtimeEndStrategy;
66421
+ seenInitialUserInput = false;
66422
+ seenUserInputSteps = /* @__PURE__ */ new Set();
65958
66423
  stepIndex = 0;
65959
66424
  stepTools = [];
65960
66425
  streamOpen = false;
66426
+ takeNextSteerUuid;
65961
66427
  toolSinceResponse = false;
65962
66428
  usageByStep = /* @__PURE__ */ new Map();
66429
+ constructor(options = {}) {
66430
+ this.runtimeEndStrategy = options.runtimeEndStrategy ?? "on-result";
66431
+ this.takeNextSteerUuid = options.takeNextSteerUuid;
66432
+ }
65963
66433
  adapt(raw) {
65964
66434
  if (this.flushed || this.resultReceived || !isRecord$8(raw)) return [];
65965
66435
  if (raw.event === "init") {
66436
+ this.latestTurnCompleted = false;
65966
66437
  this.sessionId = pickString$1(raw.conversation_id);
65967
- this.model = pickString$1(toRecord(raw.init)?.model);
66438
+ this.model = pickString$1(toRecord$1(raw.init)?.model);
65968
66439
  return this.openStream();
65969
66440
  }
65970
66441
  if (raw.event === "result" && isRecord$8(raw.result)) return this.handleResult(raw.result);
@@ -65976,8 +66447,24 @@ var AntigravityAdapter = class {
65976
66447
  if (this.sessionId && conversationId && conversationId !== this.sessionId) return [];
65977
66448
  this.sessionId ??= conversationId;
65978
66449
  if (this.completedSteps.has(index)) return [];
66450
+ this.latestTurnCompleted = false;
65979
66451
  const events = [];
65980
- if (step.step_type === "agent_response") {
66452
+ if (step.step_type === "user_input") {
66453
+ if (!this.seenUserInputSteps.has(index)) {
66454
+ this.seenUserInputSteps.add(index);
66455
+ if (!this.seenInitialUserInput) this.seenInitialUserInput = true;
66456
+ else {
66457
+ const uuid = this.takeNextSteerUuid?.();
66458
+ if (uuid) {
66459
+ events.push(...this.closeStream());
66460
+ events.push(this.event("step_complete", {
66461
+ phase: "user_message",
66462
+ uuid
66463
+ }));
66464
+ }
66465
+ }
66466
+ }
66467
+ } else if (step.step_type === "agent_response") {
65981
66468
  if (this.toolSinceResponse || this.responseStep !== void 0 && this.responseStep !== index) {
65982
66469
  events.push(...this.closeStream());
65983
66470
  this.stepIndex += 1;
@@ -66008,7 +66495,7 @@ var AntigravityAdapter = class {
66008
66495
  return [...this.settlePendingTools("Antigravity ended before this tool returned a result."), ...this.closeStream()];
66009
66496
  }
66010
66497
  validateCompletion() {
66011
- if (this.resultReceived || this.completionValidated) return [];
66498
+ if (this.resultReceived || this.latestTurnCompleted || this.completionValidated) return [];
66012
66499
  this.completionValidated = true;
66013
66500
  return [this.event("error", {
66014
66501
  agentType: IDENTIFIER,
@@ -66053,8 +66540,8 @@ var AntigravityAdapter = class {
66053
66540
  return events;
66054
66541
  }
66055
66542
  handleTool(index, step) {
66056
- const info = toRecord(step.tool_info);
66057
- const subagents = toRecord(step.subagent_info);
66543
+ const info = toRecord$1(step.tool_info);
66544
+ const subagents = toRecord$1(step.subagent_info);
66058
66545
  const name = pickString$1(info?.name) ?? pickString$1(step.tool_name);
66059
66546
  if (!name && !subagents) return [];
66060
66547
  const events = this.openStream();
@@ -66076,7 +66563,7 @@ var AntigravityAdapter = class {
66076
66563
  } else if (info?.parameters !== void 0) pending.payload.arguments = args;
66077
66564
  if (info?.parameters !== void 0 || step.state === "DONE") events.push(...this.startTool(pending));
66078
66565
  if (step.state === "DONE") {
66079
- const error = toRecord(info?.error);
66566
+ const error = toRecord$1(info?.error);
66080
66567
  const content = [stringifyOutput(info?.output ?? subagents), pickString$1(error?.message) ?? stringifyOutput(info?.error)].filter(Boolean).join("\n");
66081
66568
  events.push(...this.toolResult(pending, content, info?.error != null));
66082
66569
  this.pendingTools.delete(index);
@@ -66120,7 +66607,9 @@ var AntigravityAdapter = class {
66120
66607
  return events;
66121
66608
  }
66122
66609
  handleResult(result) {
66123
- this.resultReceived = true;
66610
+ const keepOpenForMoreTurns = this.runtimeEndStrategy === "on-transport-close" && result.status === "SUCCESS";
66611
+ if (!keepOpenForMoreTurns) this.resultReceived = true;
66612
+ this.latestTurnCompleted = true;
66124
66613
  this.sessionId ??= pickString$1(result.conversation_id);
66125
66614
  const hasPendingTools = this.pendingTools.size > 0;
66126
66615
  const events = this.settlePendingTools("Antigravity ended before this tool returned a result.");
@@ -66152,6 +66641,13 @@ var AntigravityAdapter = class {
66152
66641
  }));
66153
66642
  }
66154
66643
  events.push(...this.closeStream());
66644
+ if (keepOpenForMoreTurns) {
66645
+ this.hasResponseText = false;
66646
+ this.responseStep = void 0;
66647
+ this.toolSinceResponse = false;
66648
+ this.stepTools = [];
66649
+ this.stepIndex += 1;
66650
+ }
66155
66651
  return events;
66156
66652
  }
66157
66653
  event(type, data, stepIndex = this.stepIndex) {
@@ -68750,13 +69246,13 @@ const acpContentBlockText = (value) => {
68750
69246
  * notification `params` or the nested `update`.
68751
69247
  */
68752
69248
  const isAcpReplayMessage = (raw) => {
68753
- const params = toRecord(toRecord(raw)?.params);
68754
- const update = toRecord(params?.update);
68755
- return toRecord(params?._meta)?.isReplay === true || toRecord(update?._meta)?.isReplay === true;
69249
+ const params = toRecord$1(toRecord$1(raw)?.params);
69250
+ const update = toRecord$1(params?.update);
69251
+ return toRecord$1(params?._meta)?.isReplay === true || toRecord$1(update?._meta)?.isReplay === true;
68756
69252
  };
68757
69253
  /** ACP extension dedup marker: `_meta.eventId` on the notification `params`. */
68758
69254
  const acpEventIdOf = (raw) => {
68759
- const meta = toRecord(toRecord(toRecord(raw)?.params)?._meta);
69255
+ const meta = toRecord$1(toRecord$1(toRecord$1(raw)?.params)?._meta);
68760
69256
  return typeof meta?.eventId === "string" ? meta.eventId : void 0;
68761
69257
  };
68762
69258
 
@@ -71637,37 +72133,159 @@ var AcpAgentSession = class {
71637
72133
  };
71638
72134
 
71639
72135
  //#endregion
71640
- //#region ../../packages/heterogeneous-agents/src/spawn/antigravity.ts
71641
- /** agy reads a single JSONL user message, then finishes the turn when stdin closes. */
71642
- const ANTIGRAVITY_BASE_ARGS = [
71643
- "--input-format",
71644
- "stream-json",
71645
- "--output-format",
71646
- "stream-json",
71647
- "--dangerously-skip-permissions"
71648
- ];
71649
- const MANAGED_FLAGS = new Set([
71650
- "--",
71651
- "--input-format",
71652
- "--output-format",
71653
- "--print",
71654
- "--prompt",
71655
- "--prompt-interactive",
71656
- "--remote-control",
71657
- "-i",
71658
- "-p",
71659
- "--continue",
71660
- "-c",
71661
- "--conversation"
71662
- ]);
71663
- const buildAntigravityArgs = ({ extraArgs = [], resumeSessionId }) => {
71664
- const conflicting = extraArgs.find((arg) => MANAGED_FLAGS.has(arg.split("=")[0]));
71665
- if (conflicting) throw new Error(`LobeHub manages Antigravity's prompt, output and session flags: ${conflicting}`);
71666
- return [
71667
- ...ANTIGRAVITY_BASE_ARGS,
71668
- ...resumeSessionId ? ["--conversation", resumeSessionId] : [],
71669
- ...extraArgs
71670
- ];
72136
+ //#region ../../packages/heterogeneous-agents/src/spawn/antigravityLiveInput.ts
72137
+ /**
72138
+ * How long a live Antigravity session may sit between turns with no stdout
72139
+ * before stdin is closed anyway.
72140
+ */
72141
+ const DEFAULT_IDLE_CLOSE_MS$1 = 1800 * 1e3;
72142
+ const readIdleCloseMs$1 = () => {
72143
+ const value = Number(process.env.LOBE_ANTIGRAVITY_LIVE_INPUT_IDLE_MS);
72144
+ return Number.isFinite(value) && value > 0 ? value : DEFAULT_IDLE_CLOSE_MS$1;
72145
+ };
72146
+ /**
72147
+ * The runtime end a live Antigravity session (stdin kept open, see
72148
+ * `AntigravityLiveInput`) reports once, at process exit.
72149
+ */
72150
+ const resolveAntigravityLiveRuntimeEnd = (lastTurn, exit) => {
72151
+ if (!lastTurn?.ok || exit.killedByHost || exit.sawError) return;
72152
+ if (exit.code !== 0) return;
72153
+ return {
72154
+ reason: "complete",
72155
+ transport: "cli-live"
72156
+ };
72157
+ };
72158
+ /**
72159
+ * Keeps an Antigravity (`--input-format stream-json --output-format stream-json`)
72160
+ * stdin open while a turn is active or steered follow-ups remain unconsumed,
72161
+ * then closes stdin as soon as the session becomes idle so the process exits cleanly.
72162
+ */
72163
+ var AntigravityLiveInput = class {
72164
+ closed = false;
72165
+ idleCloseMs;
72166
+ idleTimer;
72167
+ initialUserInputSeen = false;
72168
+ lastOutcome;
72169
+ lineBuffer = "";
72170
+ pendingAdapterUuids = [];
72171
+ seenUserInputSteps = /* @__PURE__ */ new Set();
72172
+ sessionId;
72173
+ turnOpen = false;
72174
+ unconsumed = [];
72175
+ constructor(stdin, options = {}) {
72176
+ this.stdin = stdin;
72177
+ this.idleCloseMs = options.idleCloseMs ?? readIdleCloseMs$1();
72178
+ stdin.on?.("close", () => this.markClosed());
72179
+ stdin.on?.("error", () => this.markClosed());
72180
+ }
72181
+ get isOpen() {
72182
+ return !this.closed && !this.stdin.destroyed && !this.stdin.writableEnded;
72183
+ }
72184
+ get lastTurn() {
72185
+ return this.lastOutcome;
72186
+ }
72187
+ /**
72188
+ * Write one stream-json `user` line into the session. When `uuid` is given
72189
+ * (a steered follow-up), stdin stays open across turn boundaries until `agy`
72190
+ * picks up that message and finishes its turn.
72191
+ */
72192
+ send(stdinLine, uuid) {
72193
+ if (!this.isOpen) return false;
72194
+ if (uuid) {
72195
+ this.unconsumed.push(uuid);
72196
+ this.pendingAdapterUuids.push(uuid);
72197
+ }
72198
+ this.stdin.write(stdinLine);
72199
+ this.clearIdleTimer();
72200
+ return true;
72201
+ }
72202
+ /** Pop the next steered message UUID for `AntigravityAdapter` to confirm. */
72203
+ takeSteerUuid() {
72204
+ return this.pendingAdapterUuids.shift();
72205
+ }
72206
+ /** Feed raw stdout bytes from the child process. */
72207
+ observe(chunk) {
72208
+ this.lineBuffer += typeof chunk === "string" ? chunk : chunk.toString("utf8");
72209
+ for (;;) {
72210
+ const newline = this.lineBuffer.indexOf("\n");
72211
+ if (newline === -1) break;
72212
+ const line = this.lineBuffer.slice(0, newline).trim();
72213
+ this.lineBuffer = this.lineBuffer.slice(newline + 1);
72214
+ if (!line) continue;
72215
+ try {
72216
+ this.observeMessage(JSON.parse(line));
72217
+ } catch {}
72218
+ }
72219
+ if (this.closed) return;
72220
+ if (this.turnOpen) this.clearIdleTimer();
72221
+ else this.armIdleTimer();
72222
+ }
72223
+ /** stdout ended: flush any trailing partial line and close stdin. */
72224
+ finish() {
72225
+ if (this.lineBuffer.trim()) this.observe("\n");
72226
+ this.close();
72227
+ }
72228
+ close() {
72229
+ if (this.closed) return;
72230
+ this.markClosed();
72231
+ this.stdin.end();
72232
+ }
72233
+ observeMessage(message) {
72234
+ if (!message || typeof message !== "object") return;
72235
+ if (message.event === "init") {
72236
+ if (typeof message.conversation_id === "string" && message.conversation_id) this.sessionId = message.conversation_id;
72237
+ this.openTurn();
72238
+ return;
72239
+ }
72240
+ if (message.event === "step_update" && message.step_update && typeof message.step_update === "object") {
72241
+ const step = message.step_update;
72242
+ const conversationId = typeof step.conversation_id === "string" && step.conversation_id ? step.conversation_id : void 0;
72243
+ if (this.sessionId && conversationId && conversationId !== this.sessionId) return;
72244
+ this.sessionId ??= conversationId;
72245
+ if (step.step_type === "user_input") {
72246
+ const index = typeof step.step_index === "number" ? step.step_index : void 0;
72247
+ if (index === void 0 || !this.seenUserInputSteps.has(index)) {
72248
+ if (index !== void 0) this.seenUserInputSteps.add(index);
72249
+ if (this.initialUserInputSeen) this.unconsumed.shift();
72250
+ else this.initialUserInputSeen = true;
72251
+ }
72252
+ }
72253
+ this.openTurn();
72254
+ return;
72255
+ }
72256
+ if (message.event === "result" && message.result && typeof message.result === "object") {
72257
+ this.turnOpen = false;
72258
+ const status = typeof message.result.status === "string" ? message.result.status : void 0;
72259
+ this.lastOutcome = {
72260
+ ok: status === "SUCCESS",
72261
+ status
72262
+ };
72263
+ if (status !== "SUCCESS") this.close();
72264
+ else this.closeIfIdle();
72265
+ }
72266
+ }
72267
+ openTurn() {
72268
+ this.turnOpen = true;
72269
+ this.lastOutcome = void 0;
72270
+ }
72271
+ closeIfIdle() {
72272
+ if (this.turnOpen || this.unconsumed.length > 0) return;
72273
+ this.close();
72274
+ }
72275
+ armIdleTimer() {
72276
+ this.clearIdleTimer();
72277
+ this.idleTimer = setTimeout(() => this.close(), this.idleCloseMs);
72278
+ this.idleTimer.unref?.();
72279
+ }
72280
+ clearIdleTimer() {
72281
+ if (!this.idleTimer) return;
72282
+ clearTimeout(this.idleTimer);
72283
+ this.idleTimer = void 0;
72284
+ }
72285
+ markClosed() {
72286
+ this.closed = true;
72287
+ this.clearIdleTimer();
72288
+ }
71671
72289
  };
71672
72290
 
71673
72291
  //#endregion
@@ -74536,8 +75154,17 @@ const isSupportedDshVersion = (version) => {
74536
75154
  * `--version` but has no `acp` profile, so it is reported unavailable here
74537
75155
  * rather than failing every turn after the agent was created.
74538
75156
  */
75157
+ /**
75158
+ * `dsh` is installed with `npm i -g`. On Windows that drops `dsh.cmd` in npm's
75159
+ * global prefix (`%APPDATA%\npm`), a directory npm's installer only adds to the
75160
+ * registry User PATH, so an app started before it never sees it.
75161
+ */
75162
+ const getDshWellKnownPaths = () => platform() === "win32" ? [path.win32.join(process.env.APPDATA || path.win32.join(homedir(), "AppData", "Roaming"), "npm", "dsh.cmd")] : [];
74539
75163
  const detectDshCommand = async (command = "dsh", env) => {
74540
- const status = await detectValidatedCommand(command, { validatePattern: DSH_VERSION_PATTERN }, env);
75164
+ const isDefaultCommand = command.trim() === "dsh";
75165
+ const validation = { validatePattern: DSH_VERSION_PATTERN };
75166
+ const nativeStatus = await detectValidatedCommandCandidates(isDefaultCommand ? [command, ...getDshWellKnownPaths()] : [command], validation, env);
75167
+ const status = isDefaultCommand ? await detectInWslWhenMissing(nativeStatus, ["dsh"], validation) : nativeStatus;
74541
75168
  if (!status.available || isSupportedDshVersion(status.version)) return status;
74542
75169
  return {
74543
75170
  ...status,
@@ -74545,6 +75172,22 @@ const detectDshCommand = async (command = "dsh", env) => {
74545
75172
  error: `DeepSeek Harness CLI ${status.version} is too old; LobeHub needs ${DSH_MIN_VERSION} or newer. Update it with: npm i -g @deepseek-ai/dsh`
74546
75173
  };
74547
75174
  };
75175
+ /**
75176
+ * The `dsh` binary a session should spawn, with the PATH that validated it.
75177
+ * A custom command is used verbatim; the default one is re-detected so a CLI
75178
+ * installed after the host started (a fresh registry PATH on Windows, a new
75179
+ * login-shell PATH elsewhere) still launches instead of failing with ENOENT.
75180
+ */
75181
+ const resolveDshSpawnCommand = async (command, env) => {
75182
+ const requested = command?.trim();
75183
+ if (requested && requested !== "dsh") return { command: requested };
75184
+ const detected = await detectDshCommand("dsh", env).catch(() => void 0);
75185
+ return detected?.available && detected.path ? {
75186
+ command: detected.path,
75187
+ pathEnv: detected.resolvedPathEnv,
75188
+ version: detected.version
75189
+ } : { command: "dsh" };
75190
+ };
74548
75191
  /** Select the CLI's shipped ACP profile, served on stdio until disconnect. */
74549
75192
  const DSH_ACP_PROFILE_ARGS = ["--profile", "acp"];
74550
75193
  /** The profile boots its plugin tree before answering `initialize`. */
@@ -75297,11 +75940,14 @@ const getHeterogeneousAgentPresetEnv = (agentType, agentEnv) => {
75297
75940
  * presets, then the agent's own `env` on top. An entrypoint the agent cleared
75298
75941
  * is removed from the result, so an inherited one does not stand in for it.
75299
75942
  */
75300
- const getHeterogeneousAgentSpawnEnv = (agentType, agentEnv, inheritedEnv) => dropClearedClaudeCodeEntrypoint({
75301
- ...inheritedEnv,
75302
- ...getHeterogeneousAgentPresetEnv(agentType, agentEnv),
75303
- ...agentEnv
75304
- });
75943
+ const getHeterogeneousAgentSpawnEnv = (agentType, agentEnv, inheritedEnv) => {
75944
+ const env = dropClearedClaudeCodeEntrypoint({
75945
+ ...inheritedEnv,
75946
+ ...getHeterogeneousAgentPresetEnv(agentType, agentEnv),
75947
+ ...agentEnv
75948
+ });
75949
+ return agentType === "antigravity" ? getAntigravitySpawnEnv(env) : env;
75950
+ };
75305
75951
 
75306
75952
  //#endregion
75307
75953
  //#region ../../packages/heterogeneous-agents/src/spawn/workingDirectory.ts
@@ -75912,16 +76558,17 @@ const spawnAgent = async (options) => {
75912
76558
  };
75913
76559
  /** One-shot JSONL CLI spawn; `spawnAgent` owns the Codex JWT file around it. */
75914
76560
  const spawnCliAgent = async (options, command, cwd, inputPlan, childEnv, codexJwtFile) => {
75915
- const liveInput = options.agentType === "claude-code" && options.liveInput === true;
76561
+ const claudeLiveInput = options.agentType === "claude-code" && options.liveInput === true;
76562
+ const antigravityLiveInput = options.agentType === "antigravity" && options.liveInput === true;
75916
76563
  const permissionMode = options.agentType === "claude-code" ? options.permissionMode : void 0;
75917
- const permissionPrompts = liveInput && !!options.askUserBridge;
76564
+ const permissionPrompts = claudeLiveInput && !!options.askUserBridge;
75918
76565
  const args = buildSpawnArgs({
75919
76566
  agentType: options.agentType,
75920
76567
  configArgs: options.agentType === "codex" ? [...buildCodexLobeHubContextArgs(childEnv), ...codexJwtFile?.args ?? []] : void 0,
75921
76568
  extraArgs: options.extraArgs ?? [],
75922
76569
  includePartialMessages: options.includePartialMessages ?? false,
75923
76570
  inputArgs: inputPlan.args,
75924
- liveInput,
76571
+ liveInput: claudeLiveInput,
75925
76572
  permissionMode,
75926
76573
  permissionPrompts,
75927
76574
  resumeSessionId: options.resumeSessionId
@@ -75937,23 +76584,29 @@ const spawnCliAgent = async (options, command, cwd, inputPlan, childEnv, codexJw
75937
76584
  home: childEnv.HOME,
75938
76585
  sessionId: options.resumeSessionId
75939
76586
  }) : void 0;
75940
- const cliSpawnPlan = await resolveCliSpawnPlan(command, args);
76587
+ const cliSpawnPlan = await resolveCliSpawnPlan(command, args, childEnv);
75941
76588
  const detached = platform() !== "win32" && (options.detached ?? true);
75942
76589
  const startedAt = Date.now();
75943
76590
  const proc = spawnManaged(cliSpawnPlan.command, cliSpawnPlan.args, {
75944
76591
  cwd,
75945
76592
  detached,
75946
- env: childEnv,
76593
+ env: cliSpawnPlan.env ?? childEnv,
75947
76594
  stdio: [
75948
76595
  "pipe",
75949
76596
  "pipe",
75950
76597
  "pipe"
75951
76598
  ]
75952
76599
  });
76600
+ const claudeLive = claudeLiveInput && proc.stdin ? new ClaudeCodeLiveInput(proc.stdin) : void 0;
76601
+ const antigravityLive = antigravityLiveInput && proc.stdin ? new AntigravityLiveInput(proc.stdin) : void 0;
76602
+ const live = claudeLive ?? antigravityLive;
75953
76603
  const pipeline = new AgentStreamPipeline({
75954
- adapter: liveInput ? new ClaudeCodeAdapter({
76604
+ adapter: claudeLive ? new ClaudeCodeAdapter({
75955
76605
  runtimeEndStrategy: "on-transport-close",
75956
76606
  signalBackgroundTaskCompletion: true
76607
+ }) : antigravityLive ? new AntigravityAdapter({
76608
+ runtimeEndStrategy: "on-transport-close",
76609
+ takeNextSteerUuid: () => antigravityLive.takeSteerUuid()
75957
76610
  }) : void 0,
75958
76611
  agentType: options.agentType,
75959
76612
  cwd,
@@ -75999,21 +76652,20 @@ const spawnCliAgent = async (options, command, cwd, inputPlan, childEnv, codexJw
75999
76652
  const removeJwtFile = () => codexJwtFile.cleanup();
76000
76653
  exit.then(removeJwtFile, removeJwtFile);
76001
76654
  }
76002
- const live = liveInput && proc.stdin ? new ClaudeCodeLiveInput(proc.stdin) : void 0;
76003
- if (live && permissionMode && permissionPrompts && options.askUserBridge) {
76655
+ if (claudeLive && permissionMode && permissionPrompts && options.askUserBridge) {
76004
76656
  const bridge = options.askUserBridge;
76005
76657
  const isRoot = isRunningAsRoot();
76006
- attachClaudeCodePermissionResponder(live, {
76658
+ attachClaudeCodePermissionResponder(claudeLive, {
76007
76659
  ask: askThroughBridge(bridge),
76008
76660
  cancel: (toolCallId) => bridge.cancel(toolCallId, "session_ended"),
76009
76661
  isRoot
76010
76662
  });
76011
76663
  const reporter = new PermissionModeReporter(options.operationId, resolveClaudeCodePermissionMode(permissionMode, isRoot).fallback);
76012
- live.onControlRequestSent((request, meta) => {
76664
+ claudeLive.onControlRequestSent((request, meta) => {
76013
76665
  const requestedMode = meta?.requestedMode;
76014
76666
  if (request.subtype === "set_permission_mode" && isHeteroPermissionMode(requestedMode)) reporter.requested(requestedMode, isRoot);
76015
76667
  });
76016
- live.subscribe((message) => {
76668
+ claudeLive.subscribe((message) => {
76017
76669
  const event = reporter.observe(message);
76018
76670
  if (!event) return;
76019
76671
  queue.push(event);
@@ -76048,12 +76700,17 @@ const spawnCliAgent = async (options, command, cwd, inputPlan, childEnv, codexJw
76048
76700
  if (code === 0 && !killedByUs) events.push(...pipeline.validateCompletion());
76049
76701
  sawErrorEvent ||= events.some((event) => event.type === "error");
76050
76702
  for (const event of events) queue.push(event);
76051
- const liveEnd = resolveClaudeCodeLiveRuntimeEnd(live?.lastTurn, {
76703
+ const liveEnd = claudeLive ? resolveClaudeCodeLiveRuntimeEnd(claudeLive.lastTurn, {
76052
76704
  code,
76053
76705
  killedByHost: killedByUs,
76054
76706
  sawError: sawErrorEvent,
76055
76707
  signal
76056
- });
76708
+ }) : antigravityLive ? resolveAntigravityLiveRuntimeEnd(antigravityLive.lastTurn, {
76709
+ code,
76710
+ killedByHost: killedByUs,
76711
+ sawError: sawErrorEvent,
76712
+ signal
76713
+ }) : void 0;
76057
76714
  if (liveEnd) for (const event of pipeline.completeRuntime(liveEnd)) queue.push(event);
76058
76715
  for (const event of await pipeline.collectPostRunUsage({ env: childEnv })) queue.push(event);
76059
76716
  } catch (err) {
@@ -76099,16 +76756,21 @@ const spawnCliAgent = async (options, command, cwd, inputPlan, childEnv, codexJw
76099
76756
  } };
76100
76757
  } },
76101
76758
  exit,
76102
- ...live && {
76103
- interruptTurn: () => live.interrupt(),
76104
- sendControlRequest: (request) => live.sendControlRequest(request),
76759
+ ...claudeLive && {
76760
+ interruptTurn: () => claudeLive.interrupt(),
76761
+ sendControlRequest: (request) => claudeLive.sendControlRequest(request),
76105
76762
  sendUserMessage: async (prompt, sendOptions) => {
76106
- if (!live.isOpen) return false;
76763
+ if (!claudeLive.isOpen) return false;
76107
76764
  const plan = await buildAgentInput("claude-code", prompt, options.inputOptions);
76108
- return live.send(plan.stdin, sendOptions?.uuid);
76765
+ return claudeLive.send(plan.stdin, sendOptions?.uuid);
76109
76766
  },
76110
76767
  supportsSteerImageAttachments: true
76111
76768
  },
76769
+ ...antigravityLive && { sendUserMessage: async (prompt, sendOptions) => {
76770
+ if (!antigravityLive.isOpen) return false;
76771
+ const plan = await buildAgentInput("antigravity", prompt, options.inputOptions);
76772
+ return antigravityLive.send(plan.stdin, sendOptions?.uuid);
76773
+ } },
76112
76774
  kill: (signal = "SIGINT") => {
76113
76775
  killedByUs = true;
76114
76776
  live?.close();
@@ -76369,14 +77031,15 @@ const requestViaRpc = async (options, { failureMessage, method, params, timeoutM
76369
77031
  timeout = setTimeout(() => {
76370
77032
  settleError(/* @__PURE__ */ new Error(`${failureMessage}: RPC timed out`), true);
76371
77033
  }, timeoutMs);
76372
- resolveCliSpawnPlan(options.command ?? "codex", rpcArgs).then((spawnPlan) => {
77034
+ const childEnv = {
77035
+ ...process.env,
77036
+ ...options.env,
77037
+ ...options.codexHomePath ? { CODEX_HOME: options.codexHomePath } : {}
77038
+ };
77039
+ resolveCliSpawnPlan(options.command ?? "codex", rpcArgs, childEnv).then((spawnPlan) => {
76373
77040
  if (finished) return;
76374
77041
  child = spawn(spawnPlan.command, spawnPlan.args, {
76375
- env: {
76376
- ...process.env,
76377
- ...options.env,
76378
- ...options.codexHomePath ? { CODEX_HOME: options.codexHomePath } : {}
76379
- },
77042
+ env: spawnPlan.env ?? childEnv,
76380
77043
  stdio: [
76381
77044
  "pipe",
76382
77045
  "pipe",
@@ -305735,6 +306398,7 @@ const listCodexModels = async ({ args = [], commandPath, cwd, env, timeoutMs })
305735
306398
  //#endregion
305736
306399
  //#region ../../packages/heterogeneous-agents/src/models/listHeterogeneousAgentModels.ts
305737
306400
  init_object$1();
306401
+ init_config();
305738
306402
  init_cliSpawn();
305739
306403
  init_resolveCliCommand();
305740
306404
  const execFilePromise = promisify(execFile);
@@ -305956,6 +306620,7 @@ const classifyCatalogError = (error) => {
305956
306620
  };
305957
306621
  const getCatalogErrorMessage = (code, type) => {
305958
306622
  const name = getHeterogeneousTypeLabel(type) ?? type;
306623
+ if (code === "auth_required") return `Sign in to the ${name} CLI on the execution device`;
305959
306624
  if (code === "cli_not_found") return `${name} CLI was not found`;
305960
306625
  if (code === "timeout") return `${name} model discovery timed out`;
305961
306626
  return `${name} model discovery failed`;
@@ -305989,10 +306654,11 @@ const listHeterogeneousAgentModels = async (params) => {
305989
306654
  const callerEnv = params.env ?? process.env;
305990
306655
  const resolved = await resolveCatalogCommand(params, callerEnv);
305991
306656
  const mergedPath = [...new Set([callerEnv.PATH, resolved.pathEnv].filter(Boolean).join(path.delimiter).split(path.delimiter))].filter(Boolean).join(path.delimiter);
305992
- const env = {
306657
+ const mergedEnv = {
305993
306658
  ...callerEnv,
305994
306659
  ...mergedPath ? { PATH: mergedPath } : {}
305995
306660
  };
306661
+ const env = params.type === "antigravity" ? getAntigravitySpawnEnv(mergedEnv) : mergedEnv;
305996
306662
  try {
305997
306663
  if (params.type === "codex") return {
305998
306664
  models: await listCodexModels({
@@ -306060,11 +306726,11 @@ const listHeterogeneousAgentModels = async (params) => {
306060
306726
  "list",
306061
306727
  "--json"
306062
306728
  ] : params.type === "pi" ? buildPiCatalogArgs(params.args) : ["--list-models"];
306063
- const spawnPlan = await resolveCliSpawnPlan(resolved.command, args);
306729
+ const spawnPlan = await resolveCliSpawnPlan(resolved.command, args, env);
306064
306730
  const { stderr, stdout } = await execFilePromise(spawnPlan.command, spawnPlan.args, {
306065
306731
  cwd,
306066
306732
  encoding: "utf8",
306067
- env,
306733
+ env: spawnPlan.env ?? env,
306068
306734
  maxBuffer: MODEL_CATALOG_MAX_BUFFER,
306069
306735
  timeout: MODEL_CATALOG_TIMEOUT_MS,
306070
306736
  windowsHide: true
@@ -306091,7 +306757,8 @@ const listHeterogeneousAgentModels = async (params) => {
306091
306757
  updatedAt
306092
306758
  };
306093
306759
  } catch (error) {
306094
- const code = classifyCatalogError(error);
306760
+ const { stderr } = getErrorRecord(error);
306761
+ const code = params.type === "antigravity" && isHeterogeneousAgentAuthRequired(params.type, String(stderr ?? "")) ? "auth_required" : classifyCatalogError(error);
306095
306762
  return {
306096
306763
  error: {
306097
306764
  code,
@@ -309859,13 +310526,13 @@ var init_dialects_BAIiebX0 = __esmMin((() => {
309859
310526
  }));
309860
310527
 
309861
310528
  //#endregion
309862
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/classic/index.js
310529
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/index.js
309863
310530
  var init_classic = __esmMin((() => {
309864
310531
  init_external$1();
309865
310532
  }));
309866
310533
 
309867
310534
  //#endregion
309868
- //#region node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/index.js
310535
+ //#region node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/index.js
309869
310536
  var init_v4 = __esmMin((() => {
309870
310537
  init_classic();
309871
310538
  }));
@@ -324951,7 +325618,7 @@ var init_shimsNode = __esmMin((() => {
324951
325618
  }));
324952
325619
 
324953
325620
  //#endregion
324954
- //#region node_modules/.pnpm/pkce-challenge@5.0.1/node_modules/pkce-challenge/dist/index.node.js
325621
+ //#region node_modules/.pnpm/pkce-challenge@5.0.2/node_modules/pkce-challenge/dist/index.node.js
324955
325622
  /**
324956
325623
  * Creates an array of length `size` of random bytes
324957
325624
  * @param size
@@ -334205,7 +334872,7 @@ var stdio_exports = /* @__PURE__ */ __exportAll$2({
334205
334872
  function getDefaultEnvironment() {
334206
334873
  const env = {};
334207
334874
  for (const key of DEFAULT_INHERITED_ENV_VARS) {
334208
- const value = _w.env[key];
334875
+ const value = process$1.env[key];
334209
334876
  if (value === void 0) continue;
334210
334877
  if (value.startsWith("()")) continue;
334211
334878
  env[key] = value;
@@ -334216,7 +334883,7 @@ var import_cross_spawn$1, DEFAULT_INHERITED_ENV_VARS, StdioClientTransport;
334216
334883
  var init_stdio = __esmMin((() => {
334217
334884
  init_src_CeKsbNLO();
334218
334885
  import_cross_spawn$1 = /* @__PURE__ */ __toESM$2(require_cross_spawn(), 1);
334219
- DEFAULT_INHERITED_ENV_VARS = _w.platform === "win32" ? [
334886
+ DEFAULT_INHERITED_ENV_VARS = process$1.platform === "win32" ? [
334220
334887
  "APPDATA",
334221
334888
  "COMSPEC",
334222
334889
  "HOMEDRIVE",
@@ -334273,7 +334940,7 @@ var init_stdio = __esmMin((() => {
334273
334940
  this._serverParams.stderr ?? "inherit"
334274
334941
  ],
334275
334942
  shell: false,
334276
- windowsHide: _w.platform === "win32",
334943
+ windowsHide: process$1.platform === "win32",
334277
334944
  cwd: this._serverParams.cwd
334278
334945
  });
334279
334946
  this._process.on("error", (error) => {
@@ -335129,7 +335796,7 @@ var init_client = __esmMin((() => {
335129
335796
  name: toolName
335130
335797
  }, timeout === void 0 ? void 0 : { timeout });
335131
335798
  } catch (error) {
335132
- if (SdkError$1.isInstance(error) && error.code === SdkErrorCode$2.UnsupportedResultType && toRecord(error.data)?.resultType === "input_required") return {
335799
+ if (SdkError$1.isInstance(error) && error.code === SdkErrorCode$2.UnsupportedResultType && toRecord$1(error.data)?.resultType === "input_required") return {
335133
335800
  content: [{
335134
335801
  type: "text",
335135
335802
  text: "This MCP tool requires user input that LobeHub does not support yet. Use a tool that does not require additional input."
@@ -337307,9 +337974,9 @@ const getSubprocessResult = ({ stdout }) => {
337307
337974
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/utils/standard-stream.js
337308
337975
  const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
337309
337976
  const STANDARD_STREAMS = [
337310
- _w.stdin,
337311
- _w.stdout,
337312
- _w.stderr
337977
+ process$1.stdin,
337978
+ process$1.stdout,
337979
+ process$1.stderr
337313
337980
  ];
337314
337981
  const STANDARD_STREAMS_ALIASES = [
337315
337982
  "stdin",
@@ -337434,9 +338101,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
337434
338101
  //#endregion
337435
338102
  //#region node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.js
337436
338103
  function isUnicodeSupported() {
337437
- const { env } = _w;
338104
+ const { env } = process$1;
337438
338105
  const { TERM, TERM_PROGRAM } = env;
337439
- if (_w.platform !== "win32") return TERM !== "linux";
338106
+ if (process$1.platform !== "win32") return TERM !== "linux";
337440
338107
  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";
337441
338108
  }
337442
338109
 
@@ -337971,7 +338638,7 @@ function traversePathUp(startPath) {
337971
338638
 
337972
338639
  //#endregion
337973
338640
  //#region node_modules/.pnpm/npm-run-path@6.0.0/node_modules/npm-run-path/index.js
337974
- const npmRunPath = ({ cwd = _w.cwd(), path: pathOption = _w.env[pathKey()], preferLocal = true, execPath = _w.execPath, addExecPath = true } = {}) => {
338641
+ const npmRunPath = ({ cwd = process$1.cwd(), path: pathOption = process$1.env[pathKey()], preferLocal = true, execPath = process$1.execPath, addExecPath = true } = {}) => {
337975
338642
  const cwdPath = path.resolve(toPath(cwd));
337976
338643
  const result = [];
337977
338644
  const pathParts = pathOption.split(path.delimiter);
@@ -337989,7 +338656,7 @@ const applyExecPath = (result, pathParts, execPath, cwdPath) => {
337989
338656
  const pathPart = path.resolve(cwdPath, toPath(execPath), "..");
337990
338657
  if (!pathParts.includes(pathPart)) result.push(pathPart);
337991
338658
  };
337992
- const npmRunPathEnv = ({ env = _w.env, ...options } = {}) => {
338659
+ const npmRunPathEnv = ({ env = process$1.env, ...options } = {}) => {
337993
338660
  env = { ...env };
337994
338661
  const pathName = pathKey({ env });
337995
338662
  options.path = env[pathName];
@@ -339124,7 +339791,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
339124
339791
  };
339125
339792
  const getDefaultCwd = () => {
339126
339793
  try {
339127
- return _w.cwd();
339794
+ return process$1.cwd();
339128
339795
  } catch (error) {
339129
339796
  error.message = `The current directory does not exist.\n${error.message}`;
339130
339797
  throw error;
@@ -339160,7 +339827,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
339160
339827
  options.killSignal = normalizeKillSignal(options.killSignal);
339161
339828
  options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
339162
339829
  options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
339163
- if (_w.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
339830
+ if (process$1.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
339164
339831
  return {
339165
339832
  file,
339166
339833
  commandArguments,
@@ -339187,7 +339854,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
339187
339854
  });
339188
339855
  const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
339189
339856
  const env = extendEnv ? {
339190
- ..._w.env,
339857
+ ...process$1.env,
339191
339858
  ...envOption
339192
339859
  } : envOption;
339193
339860
  if (preferLocal || node) return npmRunPathEnv({
@@ -340189,12 +340856,12 @@ const guessStreamDirection = {
340189
340856
  }
340190
340857
  };
340191
340858
  const getStandardStreamDirection = (value) => {
340192
- if ([0, _w.stdin].includes(value)) return "input";
340859
+ if ([0, process$1.stdin].includes(value)) return "input";
340193
340860
  if ([
340194
340861
  1,
340195
340862
  2,
340196
- _w.stdout,
340197
- _w.stderr
340863
+ process$1.stdout,
340864
+ process$1.stderr
340198
340865
  ].includes(value)) return "output";
340199
340866
  };
340200
340867
  const DEFAULT_DIRECTION = "output";
@@ -341258,9 +341925,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
341258
341925
  Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
341259
341926
  };
341260
341927
  const getIpcExport = () => {
341261
- const anyProcess = _w;
341928
+ const anyProcess = process$1;
341262
341929
  const isSubprocess = true;
341263
- const ipc = _w.channel !== void 0;
341930
+ const ipc = process$1.channel !== void 0;
341264
341931
  return {
341265
341932
  ...getIpcMethods(anyProcess, isSubprocess, ipc),
341266
341933
  getCancelSignal: getCancelSignal$1.bind(void 0, {
@@ -341737,7 +342404,7 @@ var SignalExitFallback = class extends SignalExitBase {
341737
342404
  };
341738
342405
  var SignalExit = class extends SignalExitBase {
341739
342406
  /* c8 ignore start */
341740
- #hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
342407
+ #hupSig = process$2.platform === "win32" ? "SIGINT" : "SIGHUP";
341741
342408
  /* c8 ignore stop */
341742
342409
  #emitter = new Emitter();
341743
342410
  #process;
@@ -341832,8 +342499,8 @@ var SignalExit = class extends SignalExitBase {
341832
342499
  } else return og.call(this.#process, ev, ...args);
341833
342500
  }
341834
342501
  };
341835
- const process$1 = globalThis.process;
341836
- const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
342502
+ const process$2 = globalThis.process;
342503
+ const { onExit, load: load$1, unload } = signalExitWrap(processOk(process$2) ? new SignalExit(process$2) : new SignalExitFallback());
341837
342504
 
341838
342505
  //#endregion
341839
342506
  //#region node_modules/.pnpm/execa@9.6.1/node_modules/execa/lib/terminate/cleanup.js
@@ -555320,10 +555987,13 @@ const resolveRemotePlatformRuntime = async (type, baseEnv = process.env) => {
555320
555987
  };
555321
555988
  const validatedPath = status.path;
555322
555989
  const env = buildRemotePlatformEnvironment(status, baseEnv);
555323
- const prepareSpawn = async (args) => ({
555324
- ...await resolveCliSpawnPlan(validatedPath, args, env),
555325
- env
555326
- });
555990
+ const prepareSpawn = async (args) => {
555991
+ const plan = await resolveCliSpawnPlan(validatedPath, args, env);
555992
+ return {
555993
+ ...plan,
555994
+ env: plan.env ?? env
555995
+ };
555996
+ };
555327
555997
  return {
555328
555998
  available: true,
555329
555999
  execute: async (args, options) => executeSpawnPlan(await prepareSpawn(args), options?.timeout),
@@ -557645,6 +558315,7 @@ function registerConnectCommand(program) {
557645
558315
  }
557646
558316
  if (options.daemon) return handleDaemonStart(options);
557647
558317
  const isServiceChild = options.serviceChild || process.env.LOBEHUB_CONNECT_SERVICE === "1";
558318
+ if (isServiceChild) process.env.LOBEHUB_CONNECT_SERVICE = "1";
557648
558319
  await runConnect(options, options.daemonChild || isServiceChild || process.env.LOBEHUB_DAEMON === "1");
557649
558320
  });
557650
558321
  connectCmd.command("capabilities").description("Report native agent runtimes supported by this CLI and installed binaries").action(async () => {
@@ -581152,7 +581823,7 @@ var WebStandardStreamableHTTPServerTransport = class {
581152
581823
  };
581153
581824
 
581154
581825
  //#endregion
581155
- //#region node_modules/.pnpm/@hono+node-server@2.1.9_hono@4.13.19/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
581826
+ //#region node_modules/.pnpm/@hono+node-server@2.1.11_hono@4.13.19/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs
581156
581827
  const X_ALREADY_SENT = "x-hono-already-sent";
581157
581828
 
581158
581829
  //#endregion
@@ -581181,7 +581852,7 @@ const defineWebSocketHelper = (handler) => {
581181
581852
  };
581182
581853
 
581183
581854
  //#endregion
581184
- //#region node_modules/.pnpm/@hono+node-server@2.1.9_hono@4.13.19/node_modules/@hono/node-server/dist/index.mjs
581855
+ //#region node_modules/.pnpm/@hono+node-server@2.1.11_hono@4.13.19/node_modules/@hono/node-server/dist/index.mjs
581185
581856
  var RequestError = class extends Error {
581186
581857
  constructor(message, options) {
581187
581858
  super(message, options);
@@ -583047,12 +583718,12 @@ var RpcStdioClient = class {
583047
583718
  */
583048
583719
  async start() {
583049
583720
  if (this.child || this.closed) return;
583050
- const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args);
583721
+ const spawnPlan = await resolveCliSpawnPlan(this.options.commandPath, this.options.args, this.options.env);
583051
583722
  if (this.closed) return;
583052
583723
  const child = spawnManaged(spawnPlan.command, spawnPlan.args, {
583053
583724
  cwd: this.options.cwd,
583054
583725
  detached: process.platform !== "win32" && (this.options.detached ?? true),
583055
- env: this.options.env,
583726
+ env: spawnPlan.env ?? this.options.env,
583056
583727
  stdio: [
583057
583728
  "pipe",
583058
583729
  "pipe",
@@ -583447,7 +584118,7 @@ var PiRpcClient = class {
583447
584118
  version = await new Promise((resolve, reject) => {
583448
584119
  const probe = execFile(plan.command, plan.args, {
583449
584120
  cwd: this.options.cwd,
583450
- env: this.options.env,
584121
+ env: plan.env ?? this.options.env,
583451
584122
  killSignal: "SIGKILL",
583452
584123
  signal: this.probeAbort.signal,
583453
584124
  timeout: 5e3,
@@ -584466,7 +585137,7 @@ async function* withHeteroSteer(handle, context) {
584466
585137
  const res = await client.aiAgent.waitHeteroSteer.mutate({
584467
585138
  ...acceptsControl && { acceptsControl: true },
584468
585139
  ...handle.supportsSteerImageAttachments && { acceptsImageAttachments: true },
584469
- acceptsImages: true,
585140
+ ...handle.supportsSteerImages !== false && { acceptsImages: true },
584470
585141
  ...!answered && { blockMs: 1 },
584471
585142
  ...waitingForUser() && { holdSteer: true },
584472
585143
  operationId
@@ -585115,13 +585786,15 @@ const exec = async (options) => {
585115
585786
  session?.dispose().catch(() => {});
585116
585787
  };
585117
585788
  try {
585789
+ const dshCommand = await resolveDshSpawnCommand(options.command);
585118
585790
  session = spawnDshAcpSession({
585119
585791
  args: options.agentArg,
585120
585792
  clientVersion: "lobehub-cli",
585121
- command: options.command,
585793
+ command: dshCommand.command,
585122
585794
  cwd: options.cwd || process.cwd(),
585123
585795
  env: buildAgentProcessEnv({
585124
585796
  operationId: serverIngest ? operationId : void 0,
585797
+ pathEnv: dshCommand.pathEnv,
585125
585798
  topicId: options.topic
585126
585799
  }),
585127
585800
  model: options.model,
@@ -585514,7 +586187,7 @@ const exec = async (options) => {
585514
586187
  extraArgs,
585515
586188
  includePartialMessages: options.type === "claude-code",
585516
586189
  initialModel: usesHeterogeneousSessionInitialModel(options.type) ? options.model : void 0,
585517
- liveInput: options.type === "claude-code",
586190
+ liveInput: options.type === "claude-code" || options.type === "antigravity",
585518
586191
  operationId,
585519
586192
  ...options.type === "claude-code" && resolved.permissionMode && { permissionMode: resolved.permissionMode },
585520
586193
  uploadImage
@@ -591043,6 +591716,38 @@ function registerTopicCommands(task) {
591043
591716
  });
591044
591717
  }
591045
591718
 
591719
+ //#endregion
591720
+ //#region src/commands/task/visibility.ts
591721
+ const TASK_VISIBILITIES = ["private", "public"];
591722
+ const VISIBILITY_OPTION_DESCRIPTION = "Task visibility: private (only you) or public (the whole workspace)";
591723
+ /** Validate `--visibility`; throws a message listing the accepted values. */
591724
+ const parseVisibility = (value) => {
591725
+ if (value === void 0) return void 0;
591726
+ const normalized = value.trim().toLowerCase();
591727
+ if (TASK_VISIBILITIES.includes(normalized)) return normalized;
591728
+ throw new Error(`Invalid visibility "${value}". Must be one of: ${TASK_VISIBILITIES.join(", ")}`);
591729
+ };
591730
+ const PRIVATE_AGENT_ON_PUBLIC_TASK = /public task cannot be assigned to a private agent/i;
591731
+ /**
591732
+ * Append how to fix a failed create / edit when the server's message has a
591733
+ * CLI-side remedy. The server message itself is kept verbatim; other errors
591734
+ * pass through unchanged so the global handler still recognizes them.
591735
+ */
591736
+ const withVisibilityHint = (error, context) => {
591737
+ const message = formatError(error);
591738
+ if (!PRIVATE_AGENT_ON_PUBLIC_TASK.test(message)) return error;
591739
+ const hint = context.command === "create" ? "Create it with `--visibility private` instead." : `Add \`--visibility private\` to this command, or run \`lh task edit ${context.id} --visibility private\` first (only the task creator can make it private).`;
591740
+ return /* @__PURE__ */ new Error(`${message}\nHint: ${hint}`);
591741
+ };
591742
+ /**
591743
+ * Prefix a failed `updateVisibility` call with what was being attempted; the
591744
+ * server's reason (e.g. only the creator can make a task private) stays
591745
+ * verbatim. `appliedOtherEdits` notes that the rest of the edit already landed.
591746
+ */
591747
+ const describeVisibilityError = (error, id, visibility, appliedOtherEdits = false) => {
591748
+ return /* @__PURE__ */ new Error(`Could not make ${id} ${visibility}${appliedOtherEdits ? " (the other changes in this command were applied)" : ""}: ${formatError(error)}`);
591749
+ };
591750
+
591046
591751
  //#endregion
591047
591752
  //#region src/commands/task/index.ts
591048
591753
  init_src$2();
@@ -591370,10 +592075,12 @@ function registerTaskCommand(program) {
591370
592075
  }
591371
592076
  console.log();
591372
592077
  });
591373
- task.command("create").description("Create a new task").requiredOption("-i, --instruction <text>", "Task instruction").option("-n, --name <name>", "Task name").option("--agent <id>", "Assign to agent").option("--user <idOrEmail>", "Assign to a workspace member (user id, email or username)").option("--parent <id>", "Parent task ID").option("--priority <n>", "Priority (0=none, 1=urgent, 2=high, 3=normal, 4=low)", "0").option("--label <name>", "Attach an existing label (repeatable or comma-separated; \"Group/Label\" also works)", collectLabels).option("--model <model>", "Model to run with (default: the assignee agent's model)").option("--provider <provider>", "Provider for --model (default: resolved from the agent)").option("--origin-agent <id>", "Agent to notify when the task finishes (requires --origin-topic)").option("--origin-topic <id>", "Your conversation (topic) that receives the result card (requires --origin-agent)").option("--origin-message <id>", "Message in the origin topic the task was created from").option("--origin-operation <id>", "Operation that created the task").option("--origin-tool-call <id>", "Tool call that created the task").option("--json [fields]", "Output JSON").action(async (options) => {
592078
+ task.command("create").description("Create a new task").requiredOption("-i, --instruction <text>", "Task instruction").option("-n, --name <name>", "Task name").option("--agent <id>", "Assign to agent").option("--user <idOrEmail>", "Assign to a workspace member (user id, email or username)").option("--parent <id>", "Parent task ID").option("--priority <n>", "Priority (0=none, 1=urgent, 2=high, 3=normal, 4=low)", "0").option("--visibility <visibility>", `${VISIBILITY_OPTION_DESCRIPTION}. Default: inherited from --parent, private for a private --agent, otherwise public`).option("--label <name>", "Attach an existing label (repeatable or comma-separated; \"Group/Label\" also works)", collectLabels).option("--model <model>", "Model to run with (default: the assignee agent's model)").option("--provider <provider>", "Provider for --model (default: resolved from the agent)").option("--origin-agent <id>", "Agent to notify when the task finishes (requires --origin-topic)").option("--origin-topic <id>", "Your conversation (topic) that receives the result card (requires --origin-agent)").option("--origin-message <id>", "Message in the origin topic the task was created from").option("--origin-operation <id>", "Operation that created the task").option("--origin-tool-call <id>", "Tool call that created the task").option("--json [fields]", "Output JSON").action(async (options) => {
591374
592079
  let origin;
592080
+ let visibility;
591375
592081
  try {
591376
592082
  origin = toCreateOrigin(options);
592083
+ visibility = parseVisibility(options.visibility);
591377
592084
  } catch (error) {
591378
592085
  log$15.error(error.message);
591379
592086
  process.exitCode = 1;
@@ -591395,7 +592102,10 @@ function registerTaskCommand(program) {
591395
592102
  const modelConfig = toCreateModelConfig(options);
591396
592103
  if (modelConfig) input.config = modelConfig;
591397
592104
  if (origin) input.context = { origin };
591398
- const result = await client.task.create.mutate(input);
592105
+ if (visibility) input.visibility = visibility;
592106
+ const result = await client.task.create.mutate(input).catch((error) => {
592107
+ throw withVisibilityHint(error, { command: "create" });
592108
+ });
591399
592109
  const url = buildUrl(taskPath(result.data.identifier, result.data.name));
591400
592110
  if (options.json !== void 0) {
591401
592111
  outputJson({
@@ -591408,7 +592118,15 @@ function registerTaskCommand(program) {
591408
592118
  console.log(`ID: ${result.data.id}`);
591409
592119
  console.log(`${import_picocolors.default.bold("task")}: ${url}`);
591410
592120
  });
591411
- task.command("edit <id>").description("Update a task").option("-n, --name <name>", "Task name").option("-i, --instruction <text>", "Task instruction").option("--agent <id>", "Assign to agent").option("--user <idOrEmail>", "Assign to a workspace member (user id, email or username)").option("--priority <n>", "Priority (0-4)").option("--project <id>", "Move to a project (\"null\" to remove it from its project)").option("--label <name>", "Add a label (repeatable or comma-separated; replaces the task's other label of the same group)", collectLabels).option("--remove-label <name>", "Remove a label (repeatable or comma-separated)", collectLabels).option("--heartbeat-interval <n>", "Heartbeat interval in seconds").option("--heartbeat-timeout <n>", "Heartbeat timeout in seconds (0 to disable)").option("--description <text>", "Task description").option("--model <model>", "Model to run with (\"null\" to follow the assignee agent again)").option("--provider <provider>", "Provider for the model (default: resolved from the agent)").option("--status <status>", "Set status (backlog, running, paused, completed, failed, canceled)").option("--json [fields]", "Output JSON").action(async (id, options) => {
592121
+ task.command("edit <id>").description("Update a task").option("-n, --name <name>", "Task name").option("-i, --instruction <text>", "Task instruction").option("--agent <id>", "Assign to agent").option("--user <idOrEmail>", "Assign to a workspace member (user id, email or username)").option("--priority <n>", "Priority (0-4)").option("--visibility <visibility>", `${VISIBILITY_OPTION_DESCRIPTION}. Only the task creator can make a task private`).option("--project <id>", "Move to a project (\"null\" to remove it from its project)").option("--label <name>", "Add a label (repeatable or comma-separated; replaces the task's other label of the same group)", collectLabels).option("--remove-label <name>", "Remove a label (repeatable or comma-separated)", collectLabels).option("--heartbeat-interval <n>", "Heartbeat interval in seconds").option("--heartbeat-timeout <n>", "Heartbeat timeout in seconds (0 to disable)").option("--description <text>", "Task description").option("--model <model>", "Model to run with (\"null\" to follow the assignee agent again)").option("--provider <provider>", "Provider for the model (default: resolved from the agent)").option("--status <status>", "Set status (backlog, running, paused, completed, failed, canceled)").option("--json [fields]", "Output JSON").action(async (id, options) => {
592122
+ let visibility;
592123
+ try {
592124
+ visibility = parseVisibility(options.visibility);
592125
+ } catch (error) {
592126
+ log$15.error(error.message);
592127
+ process.exitCode = 1;
592128
+ return;
592129
+ }
591412
592130
  const client = await getTrpcClient();
591413
592131
  const assigneeUserId = await resolveUserOption(client, options.user);
591414
592132
  if (assigneeUserId === false) return;
@@ -591446,6 +592164,27 @@ function registerTaskCommand(program) {
591446
592164
  process.exitCode = 1;
591447
592165
  return;
591448
592166
  }
592167
+ const changeVisibility = (target, appliedOtherEdits) => client.task.updateVisibility.mutate({
592168
+ id,
592169
+ visibility: target
592170
+ }).catch((error) => {
592171
+ throw describeVisibilityError(error, id, target, appliedOtherEdits);
592172
+ });
592173
+ const applyPublic = async () => visibility === "public" ? (await changeVisibility("public", true)).data : {};
592174
+ const afterPrivate = (error) => {
592175
+ if (visibility !== "private") throw error;
592176
+ throw new Error(`${formatError(error)} (${id} was already made private)`);
592177
+ };
592178
+ if (visibility && !(hasLabelEdits || hasFieldEdits || options.status)) {
592179
+ const result = await changeVisibility(visibility, false);
592180
+ if (options.json !== void 0) outputJson(withUrl(result.data, await resolveUrlBuilder(client), resourcePath.task(result.data)), typeof options.json === "string" ? options.json : void 0);
592181
+ else {
592182
+ log$15.info(`${import_picocolors.default.bold(result.data.identifier)} is now ${visibility}`);
592183
+ console.log(`ID: ${result.data.id}`);
592184
+ }
592185
+ return;
592186
+ }
592187
+ if (visibility === "private") await changeVisibility("private", false);
591449
592188
  const hasOtherEdits = hasFieldEdits || !!options.status;
591450
592189
  const readLabels = async () => (await client.task.detail.query({ id })).data?.labels ?? [];
591451
592190
  const previousLabels = hasLabelEdits && hasOtherEdits ? await readLabels() : void 0;
@@ -591469,8 +592208,9 @@ function registerTaskCommand(program) {
591469
592208
  add: addLabelIds,
591470
592209
  remove: removeLabelIds,
591471
592210
  taskId: id
591472
- });
592211
+ }).catch(afterPrivate);
591473
592212
  if (hasLabelEdits && !hasOtherEdits) {
592213
+ await applyPublic();
591474
592214
  if (options.json !== void 0) {
591475
592215
  const { data } = await client.task.find.query({ id });
591476
592216
  outputJson(withUrl({
@@ -591485,8 +592225,12 @@ function registerTaskCommand(program) {
591485
592225
  const result = await client.task.updateStatus.mutate({
591486
592226
  id,
591487
592227
  status: options.status
591488
- }).catch(restoreLabelsOnFailure);
591489
- if (options.json !== void 0) outputJson(withUrl(result.data, await resolveUrlBuilder(client), resourcePath.task(result.data)), typeof options.json === "string" ? options.json : void 0);
592228
+ }).catch(restoreLabelsOnFailure).catch(afterPrivate);
592229
+ const promoted = await applyPublic();
592230
+ if (options.json !== void 0) outputJson(withUrl({
592231
+ ...result.data,
592232
+ ...promoted
592233
+ }, await resolveUrlBuilder(client), resourcePath.task(result.data)), typeof options.json === "string" ? options.json : void 0);
591490
592234
  else {
591491
592235
  log$15.info(`${import_picocolors.default.bold(result.data.identifier)} → ${options.status}`);
591492
592236
  console.log(`ID: ${result.data.id}`);
@@ -591495,12 +592239,19 @@ function registerTaskCommand(program) {
591495
592239
  }
591496
592240
  input.status = options.status;
591497
592241
  }
591498
- const result = await client.task.update.mutate(input).catch(restoreLabelsOnFailure);
592242
+ const result = await client.task.update.mutate(input).catch(restoreLabelsOnFailure).catch((error) => {
592243
+ throw withVisibilityHint(error, {
592244
+ command: "edit",
592245
+ id
592246
+ });
592247
+ }).catch(afterPrivate);
592248
+ const promoted = await applyPublic();
591499
592249
  if (options.json !== void 0) {
591500
- outputJson(withUrl(labels ? {
592250
+ outputJson(withUrl({
591501
592251
  ...result.data,
591502
- labels
591503
- } : result.data, await resolveUrlBuilder(client), resourcePath.task(result.data)), typeof options.json === "string" ? options.json : void 0);
592252
+ ...promoted,
592253
+ ...labels ? { labels } : {}
592254
+ }, await resolveUrlBuilder(client), resourcePath.task(result.data)), typeof options.json === "string" ? options.json : void 0);
591504
592255
  return;
591505
592256
  }
591506
592257
  const statusSuffix = options.status ? ` → ${options.status}` : "";