auto-mode 2.0.1 → 3.0.0

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.
@@ -1,4 +1,4 @@
1
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/util.js
1
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/util.js
2
2
  function getEnumValues(entries) {
3
3
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
4
4
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -305,6 +305,17 @@ function prefixIssues(path, issues) {
305
305
  function unwrapMessage(message) {
306
306
  return typeof message === "string" ? message : message?.message;
307
307
  }
308
+ /** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
309
+ function sizeCaps(defChecks) {
310
+ const caps = [];
311
+ for (const ch of defChecks ?? []) {
312
+ const d = ch._zod.def;
313
+ if (!/_(length|size)$|_equals$/.test(d.check)) break;
314
+ const max = d.maximum ?? d.length ?? d.size;
315
+ if (max >= 0) caps.push([max, ch]);
316
+ }
317
+ return caps;
318
+ }
308
319
  function attachSchema(issues, start, inst) {
309
320
  var _a;
310
321
  for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
@@ -381,7 +392,6 @@ function members(proto, table) {
381
392
  });
382
393
  else defineBound(proto, key, desc.value);
383
394
  }
384
- for (const sym of Object.getOwnPropertySymbols(table)) defineBound(proto, sym, table[sym]);
385
395
  }
386
396
  /** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
387
397
  function own(inst, key, value, enumerable = true) {
@@ -522,7 +532,7 @@ function constantCatch(value) {
522
532
  return fn;
523
533
  }
524
534
  //#endregion
525
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/core.js
535
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/core.js
526
536
  var _a$1;
527
537
  const _zodDesc = {
528
538
  value: void 0,
@@ -567,8 +577,7 @@ function $constructor(name, initializer, proto, params) {
567
577
  } finally {
568
578
  _zodDesc.value = void 0;
569
579
  }
570
- }
571
- if (inst._zod.traits.has(name)) return;
580
+ } else if (inst._zod.traits.has(name)) return;
572
581
  inst._zod.traits.add(name);
573
582
  initializer(inst, def);
574
583
  if (initialized) {
@@ -629,7 +638,7 @@ function config(newConfig) {
629
638
  return globalConfig;
630
639
  }
631
640
  //#endregion
632
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/errors.js
641
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/errors.js
633
642
  function _getMessage() {
634
643
  const internals = this._zod;
635
644
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -798,7 +807,7 @@ function prettifyError(error) {
798
807
  return lines.join("\n");
799
808
  }
800
809
  //#endregion
801
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/parse.js
810
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/parse.js
802
811
  function finalizeParams(callee, params) {
803
812
  return {
804
813
  callee: params?.callee ?? callee,
@@ -1001,7 +1010,7 @@ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
1001
1010
  return _safeParseAsync(_Err)(schema, value, _ctx);
1002
1011
  };
1003
1012
  //#endregion
1004
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/regexes.js
1013
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/regexes.js
1005
1014
  /**
1006
1015
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
1007
1016
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -1073,7 +1082,7 @@ const boolean$1 = /^(?:true|false)$/i;
1073
1082
  const lowercase = /^[^A-Z]*$/;
1074
1083
  const uppercase = /^[^a-z]*$/;
1075
1084
  //#endregion
1076
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/checks.js
1085
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/checks.js
1077
1086
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
1078
1087
  var _a;
1079
1088
  inst._zod ?? (inst._zod = {});
@@ -1369,7 +1378,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
1369
1378
  };
1370
1379
  });
1371
1380
  //#endregion
1372
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/doc.js
1381
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/doc.js
1373
1382
  var Doc = class {
1374
1383
  constructor(args = [], closed = {}) {
1375
1384
  this.content = [];
@@ -1403,14 +1412,14 @@ var Doc = class {
1403
1412
  }
1404
1413
  };
1405
1414
  //#endregion
1406
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/versions.js
1415
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/versions.js
1407
1416
  const version = {
1408
1417
  major: 4,
1409
1418
  minor: 6,
1410
- patch: 2
1419
+ patch: 6
1411
1420
  };
1412
1421
  //#endregion
1413
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/schemas.js
1422
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/schemas.js
1414
1423
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1415
1424
  var _a;
1416
1425
  inst ?? (inst = {});
@@ -1570,10 +1579,27 @@ const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
1570
1579
  def.pattern ?? (def.pattern = email);
1571
1580
  $ZodStringFormat.init(inst, def);
1572
1581
  });
1573
- /** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
1582
+ function canParseURL(input) {
1583
+ try {
1584
+ if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
1585
+ new URL(input);
1586
+ return true;
1587
+ } catch {
1588
+ return false;
1589
+ }
1590
+ }
1591
+ function validateURL(trimmed, def) {
1592
+ if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
1593
+ return parseURLObject(trimmed, def);
1594
+ }
1595
+ /** Parses a URL while preserving the non-normalizing HTTP guard. */
1574
1596
  function parseURLObject(trimmed, def) {
1575
1597
  if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
1576
1598
  try {
1599
+ if (typeof URL !== "undefined") {
1600
+ const URLStatic = URL;
1601
+ if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
1602
+ }
1577
1603
  return new URL(trimmed);
1578
1604
  } catch {
1579
1605
  return 2;
@@ -1597,7 +1623,7 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1597
1623
  inst._zod.check = (payload) => {
1598
1624
  try {
1599
1625
  const trimmed = payload.value.trim();
1600
- const url = parseURLObject(trimmed, def);
1626
+ const url = validateURL(trimmed, def);
1601
1627
  if (url === 1) {
1602
1628
  payload.issues.push({
1603
1629
  code: "invalid_format",
@@ -1619,6 +1645,10 @@ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1619
1645
  });
1620
1646
  return;
1621
1647
  }
1648
+ if (url === true) {
1649
+ payload.value = stripTabAndNewline(trimmed);
1650
+ return;
1651
+ }
1622
1652
  if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
1623
1653
  code: "invalid_format",
1624
1654
  format: "url",
@@ -1708,12 +1738,7 @@ const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
1708
1738
  const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
1709
1739
  function isValidIPv6(value) {
1710
1740
  if (!ipv6Alphabet.test(value)) return false;
1711
- try {
1712
- new URL(`http://[${value}]`);
1713
- return true;
1714
- } catch {
1715
- return false;
1716
- }
1741
+ return canParseURL(`http://[${value}]`);
1717
1742
  }
1718
1743
  const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
1719
1744
  def.pattern ?? (def.pattern = ipv6);
@@ -1891,6 +1916,26 @@ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
1891
1916
  return payload;
1892
1917
  };
1893
1918
  });
1919
+ function capSize(inst, size) {
1920
+ const caps = sizeCaps(inst._zod.def.checks);
1921
+ if (!caps.length) return;
1922
+ const cap = Math.min(...caps.map((c) => c[0]));
1923
+ const parse = inst._zod.parse;
1924
+ inst._zod.parse = (payload, ctx) => {
1925
+ const n = size(payload.value);
1926
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
1927
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) if (n > max && ch._zod.def.when(payload)) {
1928
+ const start = payload.issues.length;
1929
+ ch._zod.check(payload);
1930
+ payload.issues[start].continue = false;
1931
+ attachSchema(payload.issues, start, inst);
1932
+ return payload;
1933
+ }
1934
+ }
1935
+ return parse(payload, ctx);
1936
+ };
1937
+ }
1938
+ const arraySize = (input) => Array.isArray(input) ? input.length : -1;
1894
1939
  function handleArrayResult(result, final, index) {
1895
1940
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1896
1941
  final.value[index] = result.value;
@@ -1928,6 +1973,7 @@ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1928
1973
  if (proms.length) return Promise.all(proms).then(() => payload);
1929
1974
  return payload;
1930
1975
  };
1976
+ capSize(inst, arraySize);
1931
1977
  });
1932
1978
  function handlePropertyResult(result, final, key, input, optin, optout) {
1933
1979
  const isPresent = key in input;
@@ -2036,7 +2082,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2036
2082
  }
2037
2083
  return propValues;
2038
2084
  });
2039
- const isObject$2 = isObject;
2085
+ const isObject$1 = isObject;
2040
2086
  const catchall = def.catchall;
2041
2087
  let value;
2042
2088
  const memo = globalConfig.memoizer;
@@ -2044,7 +2090,7 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
2044
2090
  inst._zod.parse = (payload, ctx) => {
2045
2091
  value ?? (value = _normalized.value);
2046
2092
  const input = payload.value;
2047
- if (!isObject$2(input)) {
2093
+ if (!isObject$1(input)) {
2048
2094
  payload.issues.push({
2049
2095
  expected: "object",
2050
2096
  code: "invalid_type",
@@ -2174,7 +2220,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
2174
2220
  return doc.compile();
2175
2221
  };
2176
2222
  let fastpass;
2177
- const isObject$1 = isObject;
2223
+ const isObject$2 = isObject;
2178
2224
  const jit = !globalConfig.jitless;
2179
2225
  const fastEnabled = jit && allowsEval.value;
2180
2226
  const catchall = def.catchall;
@@ -2182,7 +2228,7 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
2182
2228
  inst._zod.parse = (payload, ctx) => {
2183
2229
  value ?? (value = _normalized.value);
2184
2230
  const input = payload.value;
2185
- if (!isObject$1(input)) {
2231
+ if (!isObject$2(input)) {
2186
2232
  payload.issues.push({
2187
2233
  expected: "object",
2188
2234
  code: "invalid_type",
@@ -2828,7 +2874,7 @@ function handleRefineResult(result, payload, input, inst) {
2828
2874
  }
2829
2875
  }
2830
2876
  //#endregion
2831
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/memoizer.js
2877
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/memoizer.js
2832
2878
  var $ZodCyclicError = class extends Error {
2833
2879
  constructor() {
2834
2880
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -2839,7 +2885,7 @@ var $ZodCyclicError = class extends Error {
2839
2885
  const STATE = "~memo";
2840
2886
  const NO_ISSUES = [];
2841
2887
  function isRef(value) {
2842
- return value !== null && (typeof value === "object" || typeof value === "function");
2888
+ return value !== null && typeof value === "object";
2843
2889
  }
2844
2890
  function cloneIssues(issues) {
2845
2891
  return issues.map((iss) => iss.path ? {
@@ -2886,9 +2932,6 @@ function isRecursive(inst, stack, resolve) {
2886
2932
  check(def.catchall);
2887
2933
  break;
2888
2934
  }
2889
- case "properties":
2890
- merge(shape(def.shape, false));
2891
- break;
2892
2935
  case "array":
2893
2936
  check(def.element);
2894
2937
  break;
@@ -3084,7 +3127,7 @@ function isBackEdge(ctx, value) {
3084
3127
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
3085
3128
  }
3086
3129
  //#endregion
3087
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/locales/en.js
3130
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/locales/en.js
3088
3131
  const error = () => {
3089
3132
  const Sizable = {
3090
3133
  string: {
@@ -3139,6 +3182,7 @@ const error = () => {
3139
3182
  base64url: "base64url-encoded string",
3140
3183
  json_string: "JSON string",
3141
3184
  e164: "E.164 number",
3185
+ currency_code: "currency code",
3142
3186
  credit_card: "credit card number",
3143
3187
  iban: "IBAN",
3144
3188
  jwt: "JWT",
@@ -3191,7 +3235,7 @@ function en_default() {
3191
3235
  return { localeError: error() };
3192
3236
  }
3193
3237
  //#endregion
3194
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/registries.js
3238
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/registries.js
3195
3239
  var _a;
3196
3240
  var $ZodRegistry = class {
3197
3241
  constructor() {
@@ -3238,13 +3282,17 @@ function registry() {
3238
3282
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
3239
3283
  const globalRegistry = globalThis.__zod_globalRegistry;
3240
3284
  //#endregion
3241
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/api.js
3285
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/api.js
3286
+ function snapshotChecks(def) {
3287
+ if (def.checks) def.checks = [...def.checks];
3288
+ return def;
3289
+ }
3242
3290
  // @__NO_SIDE_EFFECTS__
3243
3291
  function _string(Class, params) {
3244
- return new Class({
3292
+ return new Class(snapshotChecks({
3245
3293
  type: "string",
3246
3294
  ...normalizeParams(params)
3247
- });
3295
+ }));
3248
3296
  }
3249
3297
  // @__NO_SIDE_EFFECTS__
3250
3298
  function _email(Class, params) {
@@ -3516,11 +3564,11 @@ function _isoDuration(Class, params) {
3516
3564
  }
3517
3565
  // @__NO_SIDE_EFFECTS__
3518
3566
  function _number(Class, params) {
3519
- return new Class({
3567
+ return new Class(snapshotChecks({
3520
3568
  type: "number",
3521
3569
  checks: [],
3522
3570
  ...normalizeParams(params)
3523
- });
3571
+ }));
3524
3572
  }
3525
3573
  // @__NO_SIDE_EFFECTS__
3526
3574
  function _int(Class, params) {
@@ -3743,7 +3791,7 @@ function _check(fn, params) {
3743
3791
  return ch;
3744
3792
  }
3745
3793
  //#endregion
3746
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/to-json-schema.js
3794
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/to-json-schema.js
3747
3795
  function assignProps(target, ...sources) {
3748
3796
  for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
3749
3797
  return target;
@@ -4187,7 +4235,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
4187
4235
  return finalize(ctx, schema);
4188
4236
  };
4189
4237
  //#endregion
4190
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/core/json-schema-processors.js
4238
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/core/json-schema-processors.js
4191
4239
  const narrowMin = (agg, key, value) => {
4192
4240
  if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
4193
4241
  };
@@ -4400,13 +4448,12 @@ const objectProcessor = (schema, ctx, _json, params) => {
4400
4448
  key
4401
4449
  ]
4402
4450
  }));
4403
- const allKeys = new Set(Object.keys(shape));
4404
- const requiredKeys = new Set([...allKeys].filter((key) => {
4451
+ const requiredKeys = [];
4452
+ for (const key of Object.keys(shape)) {
4405
4453
  const field = def.shape[key];
4406
- if (ctx.io === "input") return inputOptin(field) === void 0;
4407
- else return field._zod.optout === void 0;
4408
- }));
4409
- if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
4454
+ if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) requiredKeys.push(key);
4455
+ }
4456
+ if (requiredKeys.length > 0) json.required = requiredKeys;
4410
4457
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
4411
4458
  else if (!def.catchall) {
4412
4459
  if (ctx.io === "output") json.additionalProperties = false;
@@ -4636,7 +4683,7 @@ const optionalProcessor = (schema, ctx, _json, params) => {
4636
4683
  seen.ref = def.innerType;
4637
4684
  };
4638
4685
  //#endregion
4639
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/classic/errors.js
4686
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/classic/errors.js
4640
4687
  const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4641
4688
  function _lazyMethod(proto, key, make) {
4642
4689
  Object.defineProperty(proto, key, {
@@ -4686,7 +4733,7 @@ const initializer = (inst, issues) => {
4686
4733
  };
4687
4734
  const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
4688
4735
  //#endregion
4689
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/classic/parse.js
4736
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/classic/parse.js
4690
4737
  const parse = /* @__PURE__ */ _parse(ZodRealError);
4691
4738
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
4692
4739
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -4700,7 +4747,7 @@ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
4700
4747
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
4701
4748
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
4702
4749
  //#endregion
4703
- //#region node_modules/.bun/zod@4.6.2/node_modules/zod/v4/classic/schemas.js
4750
+ //#region node_modules/.bun/zod@4.6.6/node_modules/zod/v4/classic/schemas.js
4704
4751
  function _ensureDefaultLocale() {
4705
4752
  if (!globalConfig.localeError) config(en_default());
4706
4753
  }
@@ -1,5 +1,5 @@
1
- import { d as string, s as number, u as strictObject } from "./schemas-Dc2424NY.js";
2
- import { t as startJudgeSession } from "./start-judge-session-DjPX0007.js";
1
+ import { d as string, s as number, u as strictObject } from "./schemas-B_w83Dze.js";
2
+ import { t as startJudgeSession } from "./start-judge-session-vxiG-kDp.js";
3
3
  import { randomBytes } from "node:crypto";
4
4
  import { chmod, mkdir, rename, rm, stat } from "node:fs/promises";
5
5
  import { dirname, join } from "node:path";
@@ -68,20 +68,6 @@ async function startJudgeServer(options) {
68
68
  stop
69
69
  };
70
70
  }
71
- async function removeOwnSocket(socketPath, ino, onRemoved) {
72
- const current = await stat(socketPath).catch(() => null);
73
- if (ino !== null && current?.ino === ino) await rm(socketPath, { force: true });
74
- onRemoved();
75
- }
76
- function startListening(server, socketPath) {
77
- return new Promise((resolve, reject) => {
78
- server.once("error", reject);
79
- server.listen(socketPath, () => {
80
- server.off("error", reject);
81
- resolve();
82
- });
83
- });
84
- }
85
71
  function isAnswering(socketPath) {
86
72
  return new Promise((resolve) => {
87
73
  const probe = connect(socketPath);
@@ -94,6 +80,11 @@ function isAnswering(socketPath) {
94
80
  });
95
81
  });
96
82
  }
83
+ async function removeOwnSocket(socketPath, ino, onRemoved) {
84
+ const current = await stat(socketPath).catch(() => null);
85
+ if (ino !== null && current?.ino === ino) await rm(socketPath, { force: true });
86
+ onRemoved();
87
+ }
97
88
  const MAX_REQUEST_BYTES = 4194304;
98
89
  async function runReview(socket, session) {
99
90
  const controller = new AbortController();
@@ -155,9 +146,6 @@ function readLine(socket, maxBytes) {
155
146
  socket.once("close", stopReading);
156
147
  });
157
148
  }
158
- function writeResponse(socket, response) {
159
- if (!socket.destroyed) socket.end(`${JSON.stringify(response)}\n`);
160
- }
161
149
  function parseJSON(text) {
162
150
  try {
163
151
  return JSON.parse(text);
@@ -165,5 +153,17 @@ function parseJSON(text) {
165
153
  return null;
166
154
  }
167
155
  }
156
+ function writeResponse(socket, response) {
157
+ if (!socket.destroyed) socket.end(`${JSON.stringify(response)}\n`);
158
+ }
159
+ function startListening(server, socketPath) {
160
+ return new Promise((resolve, reject) => {
161
+ server.once("error", reject);
162
+ server.listen(socketPath, () => {
163
+ server.off("error", reject);
164
+ resolve();
165
+ });
166
+ });
167
+ }
168
168
  //#endregion
169
169
  export { startJudgeServer };
@@ -0,0 +1 @@
1
+ export { t as startJudgeSession } from "./start-judge-session-vxiG-kDp.js";