dorkos 0.34.1 → 0.35.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.
package/dist/bin/cli.js CHANGED
@@ -290,10 +290,10 @@ function mergeDefs(...defs) {
290
290
  function cloneDef(schema) {
291
291
  return mergeDefs(schema._zod.def);
292
292
  }
293
- function getElementAtPath(obj, path14) {
294
- if (!path14)
293
+ function getElementAtPath(obj, path15) {
294
+ if (!path15)
295
295
  return obj;
296
- return path14.reduce((acc, key) => acc?.[key], obj);
296
+ return path15.reduce((acc, key) => acc?.[key], obj);
297
297
  }
298
298
  function promiseAllObject(promisesObj) {
299
299
  const keys = Object.keys(promisesObj);
@@ -605,11 +605,11 @@ function aborted(x2, startIndex = 0) {
605
605
  }
606
606
  return false;
607
607
  }
608
- function prefixIssues(path14, issues) {
608
+ function prefixIssues(path15, issues) {
609
609
  return issues.map((iss) => {
610
610
  var _a2;
611
611
  (_a2 = iss).path ?? (_a2.path = []);
612
- iss.path.unshift(path14);
612
+ iss.path.unshift(path15);
613
613
  return iss;
614
614
  });
615
615
  }
@@ -850,8 +850,8 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
850
850
  return fieldErrors;
851
851
  }
852
852
  function treeifyError(error48, mapper = (issue2) => issue2.message) {
853
- const result = { errors: [] };
854
- const processError = (error49, path14 = []) => {
853
+ const result2 = { errors: [] };
854
+ const processError = (error49, path15 = []) => {
855
855
  var _a2, _b;
856
856
  for (const issue2 of error49.issues) {
857
857
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -861,12 +861,12 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
861
861
  } else if (issue2.code === "invalid_element") {
862
862
  processError({ issues: issue2.issues }, issue2.path);
863
863
  } else {
864
- const fullpath = [...path14, ...issue2.path];
864
+ const fullpath = [...path15, ...issue2.path];
865
865
  if (fullpath.length === 0) {
866
- result.errors.push(mapper(issue2));
866
+ result2.errors.push(mapper(issue2));
867
867
  continue;
868
868
  }
869
- let curr = result;
869
+ let curr = result2;
870
870
  let i2 = 0;
871
871
  while (i2 < fullpath.length) {
872
872
  const el = fullpath[i2];
@@ -889,12 +889,12 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
889
889
  }
890
890
  };
891
891
  processError(error48);
892
- return result;
892
+ return result2;
893
893
  }
894
894
  function toDotPath(_path) {
895
895
  const segs = [];
896
- const path14 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
897
- for (const seg of path14) {
896
+ const path15 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
897
+ for (const seg of path15) {
898
898
  if (typeof seg === "number")
899
899
  segs.push(`[${seg}]`);
900
900
  else if (typeof seg === "symbol")
@@ -954,52 +954,52 @@ var init_parse = __esm({
954
954
  init_util();
955
955
  _parse = (_Err) => (schema, value, _ctx, _params) => {
956
956
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
957
- const result = schema._zod.run({ value, issues: [] }, ctx);
958
- if (result instanceof Promise) {
957
+ const result2 = schema._zod.run({ value, issues: [] }, ctx);
958
+ if (result2 instanceof Promise) {
959
959
  throw new $ZodAsyncError();
960
960
  }
961
- if (result.issues.length) {
962
- const e2 = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
961
+ if (result2.issues.length) {
962
+ const e2 = new (_params?.Err ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
963
963
  captureStackTrace(e2, _params?.callee);
964
964
  throw e2;
965
965
  }
966
- return result.value;
966
+ return result2.value;
967
967
  };
968
968
  parse = /* @__PURE__ */ _parse($ZodRealError);
969
969
  _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
970
970
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
971
- let result = schema._zod.run({ value, issues: [] }, ctx);
972
- if (result instanceof Promise)
973
- result = await result;
974
- if (result.issues.length) {
975
- const e2 = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
971
+ let result2 = schema._zod.run({ value, issues: [] }, ctx);
972
+ if (result2 instanceof Promise)
973
+ result2 = await result2;
974
+ if (result2.issues.length) {
975
+ const e2 = new (params?.Err ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
976
976
  captureStackTrace(e2, params?.callee);
977
977
  throw e2;
978
978
  }
979
- return result.value;
979
+ return result2.value;
980
980
  };
981
981
  parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
982
982
  _safeParse = (_Err) => (schema, value, _ctx) => {
983
983
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
984
- const result = schema._zod.run({ value, issues: [] }, ctx);
985
- if (result instanceof Promise) {
984
+ const result2 = schema._zod.run({ value, issues: [] }, ctx);
985
+ if (result2 instanceof Promise) {
986
986
  throw new $ZodAsyncError();
987
987
  }
988
- return result.issues.length ? {
988
+ return result2.issues.length ? {
989
989
  success: false,
990
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
991
- } : { success: true, data: result.value };
990
+ error: new (_Err ?? $ZodError)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
991
+ } : { success: true, data: result2.value };
992
992
  };
993
993
  safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
994
994
  _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
995
995
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
996
- let result = schema._zod.run({ value, issues: [] }, ctx);
997
- if (result instanceof Promise)
998
- result = await result;
999
- return result.issues.length ? {
996
+ let result2 = schema._zod.run({ value, issues: [] }, ctx);
997
+ if (result2 instanceof Promise)
998
+ result2 = await result2;
999
+ return result2.issues.length ? {
1000
1000
  success: false,
1001
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1002
- } : { success: true, data: result.value };
1001
+ error: new _Err(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1002
+ } : { success: true, data: result2.value };
1003
1003
  };
1004
1004
  safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
1005
1005
  _encode = (_Err) => (schema, value, _ctx) => {
@@ -1205,9 +1205,9 @@ var init_regexes = __esm({
1205
1205
  });
1206
1206
 
1207
1207
  // ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
1208
- function handleCheckPropertyResult(result, payload, property) {
1209
- if (result.issues.length) {
1210
- payload.issues.push(...prefixIssues(property, result.issues));
1208
+ function handleCheckPropertyResult(result2, payload, property) {
1209
+ if (result2.issues.length) {
1210
+ payload.issues.push(...prefixIssues(property, result2.issues));
1211
1211
  }
1212
1212
  }
1213
1213
  var $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCheckMultipleOf, $ZodCheckNumberFormat, $ZodCheckBigIntFormat, $ZodCheckMaxSize, $ZodCheckMinSize, $ZodCheckSizeEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckLengthEquals, $ZodCheckStringFormat, $ZodCheckRegex, $ZodCheckLowerCase, $ZodCheckUpperCase, $ZodCheckIncludes, $ZodCheckStartsWith, $ZodCheckEndsWith, $ZodCheckProperty, $ZodCheckMimeType, $ZodCheckOverwrite;
@@ -1722,14 +1722,14 @@ var init_checks = __esm({
1722
1722
  $ZodCheckProperty = /* @__PURE__ */ $constructor("$ZodCheckProperty", (inst, def) => {
1723
1723
  $ZodCheck.init(inst, def);
1724
1724
  inst._zod.check = (payload) => {
1725
- const result = def.schema._zod.run({
1725
+ const result2 = def.schema._zod.run({
1726
1726
  value: payload.value[def.property],
1727
1727
  issues: []
1728
1728
  }, {});
1729
- if (result instanceof Promise) {
1730
- return result.then((result2) => handleCheckPropertyResult(result2, payload, def.property));
1729
+ if (result2 instanceof Promise) {
1730
+ return result2.then((result3) => handleCheckPropertyResult(result3, payload, def.property));
1731
1731
  }
1732
- handleCheckPropertyResult(result, payload, def.property);
1732
+ handleCheckPropertyResult(result2, payload, def.property);
1733
1733
  return;
1734
1734
  };
1735
1735
  });
@@ -1853,25 +1853,25 @@ function isValidJWT(token, algorithm = null) {
1853
1853
  return false;
1854
1854
  }
1855
1855
  }
1856
- function handleArrayResult(result, final, index) {
1857
- if (result.issues.length) {
1858
- final.issues.push(...prefixIssues(index, result.issues));
1856
+ function handleArrayResult(result2, final, index) {
1857
+ if (result2.issues.length) {
1858
+ final.issues.push(...prefixIssues(index, result2.issues));
1859
1859
  }
1860
- final.value[index] = result.value;
1860
+ final.value[index] = result2.value;
1861
1861
  }
1862
- function handlePropertyResult(result, final, key, input2, isOptionalOut) {
1863
- if (result.issues.length) {
1862
+ function handlePropertyResult(result2, final, key, input2, isOptionalOut) {
1863
+ if (result2.issues.length) {
1864
1864
  if (isOptionalOut && !(key in input2)) {
1865
1865
  return;
1866
1866
  }
1867
- final.issues.push(...prefixIssues(key, result.issues));
1867
+ final.issues.push(...prefixIssues(key, result2.issues));
1868
1868
  }
1869
- if (result.value === void 0) {
1869
+ if (result2.value === void 0) {
1870
1870
  if (key in input2) {
1871
1871
  final.value[key] = void 0;
1872
1872
  }
1873
1873
  } else {
1874
- final.value[key] = result.value;
1874
+ final.value[key] = result2.value;
1875
1875
  }
1876
1876
  }
1877
1877
  function normalizeDef(def) {
@@ -1925,9 +1925,9 @@ function handleCatchall(proms, input2, payload, ctx, def, inst) {
1925
1925
  });
1926
1926
  }
1927
1927
  function handleUnionResults(results, final, inst, ctx) {
1928
- for (const result of results) {
1929
- if (result.issues.length === 0) {
1930
- final.value = result.value;
1928
+ for (const result2 of results) {
1929
+ if (result2.issues.length === 0) {
1930
+ final.value = result2.value;
1931
1931
  return final;
1932
1932
  }
1933
1933
  }
@@ -1940,7 +1940,7 @@ function handleUnionResults(results, final, inst, ctx) {
1940
1940
  code: "invalid_union",
1941
1941
  input: final.value,
1942
1942
  inst,
1943
- errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1943
+ errors: results.map((result2) => result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1944
1944
  });
1945
1945
  return final;
1946
1946
  }
@@ -1955,7 +1955,7 @@ function handleExclusiveUnionResults(results, final, inst, ctx) {
1955
1955
  code: "invalid_union",
1956
1956
  input: final.value,
1957
1957
  inst,
1958
- errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1958
+ errors: results.map((result2) => result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1959
1959
  });
1960
1960
  } else {
1961
1961
  final.issues.push({
@@ -2012,7 +2012,7 @@ function mergeValues(a2, b2) {
2012
2012
  }
2013
2013
  return { valid: false, mergeErrorPath: [] };
2014
2014
  }
2015
- function handleIntersectionResults(result, left, right) {
2015
+ function handleIntersectionResults(result2, left, right) {
2016
2016
  const unrecKeys = /* @__PURE__ */ new Map();
2017
2017
  let unrecIssue;
2018
2018
  for (const iss of left.issues) {
@@ -2024,7 +2024,7 @@ function handleIntersectionResults(result, left, right) {
2024
2024
  unrecKeys.get(k2).l = true;
2025
2025
  }
2026
2026
  } else {
2027
- result.issues.push(iss);
2027
+ result2.issues.push(iss);
2028
2028
  }
2029
2029
  }
2030
2030
  for (const iss of right.issues) {
@@ -2035,27 +2035,27 @@ function handleIntersectionResults(result, left, right) {
2035
2035
  unrecKeys.get(k2).r = true;
2036
2036
  }
2037
2037
  } else {
2038
- result.issues.push(iss);
2038
+ result2.issues.push(iss);
2039
2039
  }
2040
2040
  }
2041
2041
  const bothKeys = [...unrecKeys].filter(([, f3]) => f3.l && f3.r).map(([k2]) => k2);
2042
2042
  if (bothKeys.length && unrecIssue) {
2043
- result.issues.push({ ...unrecIssue, keys: bothKeys });
2043
+ result2.issues.push({ ...unrecIssue, keys: bothKeys });
2044
2044
  }
2045
- if (aborted(result))
2046
- return result;
2045
+ if (aborted(result2))
2046
+ return result2;
2047
2047
  const merged = mergeValues(left.value, right.value);
2048
2048
  if (!merged.valid) {
2049
2049
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
2050
2050
  }
2051
- result.value = merged.data;
2052
- return result;
2051
+ result2.value = merged.data;
2052
+ return result2;
2053
2053
  }
2054
- function handleTupleResult(result, final, index) {
2055
- if (result.issues.length) {
2056
- final.issues.push(...prefixIssues(index, result.issues));
2054
+ function handleTupleResult(result2, final, index) {
2055
+ if (result2.issues.length) {
2056
+ final.issues.push(...prefixIssues(index, result2.issues));
2057
2057
  }
2058
- final.value[index] = result.value;
2058
+ final.value[index] = result2.value;
2059
2059
  }
2060
2060
  function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
2061
2061
  if (keyResult.issues.length) {
@@ -2087,17 +2087,17 @@ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx)
2087
2087
  }
2088
2088
  final.value.set(keyResult.value, valueResult.value);
2089
2089
  }
2090
- function handleSetResult(result, final) {
2091
- if (result.issues.length) {
2092
- final.issues.push(...result.issues);
2090
+ function handleSetResult(result2, final) {
2091
+ if (result2.issues.length) {
2092
+ final.issues.push(...result2.issues);
2093
2093
  }
2094
- final.value.add(result.value);
2094
+ final.value.add(result2.value);
2095
2095
  }
2096
- function handleOptionalResult(result, input2) {
2097
- if (result.issues.length && input2 === void 0) {
2096
+ function handleOptionalResult(result2, input2) {
2097
+ if (result2.issues.length && input2 === void 0) {
2098
2098
  return { issues: [], value: void 0 };
2099
2099
  }
2100
- return result;
2100
+ return result2;
2101
2101
  }
2102
2102
  function handleDefaultResult(payload, def) {
2103
2103
  if (payload.value === void 0) {
@@ -2123,24 +2123,24 @@ function handlePipeResult(left, next, ctx) {
2123
2123
  }
2124
2124
  return next._zod.run({ value: left.value, issues: left.issues }, ctx);
2125
2125
  }
2126
- function handleCodecAResult(result, def, ctx) {
2127
- if (result.issues.length) {
2128
- result.aborted = true;
2129
- return result;
2126
+ function handleCodecAResult(result2, def, ctx) {
2127
+ if (result2.issues.length) {
2128
+ result2.aborted = true;
2129
+ return result2;
2130
2130
  }
2131
2131
  const direction = ctx.direction || "forward";
2132
2132
  if (direction === "forward") {
2133
- const transformed = def.transform(result.value, result);
2133
+ const transformed = def.transform(result2.value, result2);
2134
2134
  if (transformed instanceof Promise) {
2135
- return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
2135
+ return transformed.then((value) => handleCodecTxResult(result2, value, def.out, ctx));
2136
2136
  }
2137
- return handleCodecTxResult(result, transformed, def.out, ctx);
2137
+ return handleCodecTxResult(result2, transformed, def.out, ctx);
2138
2138
  } else {
2139
- const transformed = def.reverseTransform(result.value, result);
2139
+ const transformed = def.reverseTransform(result2.value, result2);
2140
2140
  if (transformed instanceof Promise) {
2141
- return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
2141
+ return transformed.then((value) => handleCodecTxResult(result2, value, def.in, ctx));
2142
2142
  }
2143
- return handleCodecTxResult(result, transformed, def.in, ctx);
2143
+ return handleCodecTxResult(result2, transformed, def.in, ctx);
2144
2144
  }
2145
2145
  }
2146
2146
  function handleCodecTxResult(left, value, nextSchema, ctx) {
@@ -2154,8 +2154,8 @@ function handleReadonlyResult(payload) {
2154
2154
  payload.value = Object.freeze(payload.value);
2155
2155
  return payload;
2156
2156
  }
2157
- function handleRefineResult(result, payload, input2, inst) {
2158
- if (!result) {
2157
+ function handleRefineResult(result2, payload, input2, inst) {
2158
+ if (!result2) {
2159
2159
  const _iss = {
2160
2160
  code: "custom",
2161
2161
  input: input2,
@@ -2269,13 +2269,13 @@ var init_schemas = __esm({
2269
2269
  }
2270
2270
  return handleCanaryResult(canary, payload, ctx);
2271
2271
  }
2272
- const result = inst._zod.parse(payload, ctx);
2273
- if (result instanceof Promise) {
2272
+ const result2 = inst._zod.parse(payload, ctx);
2273
+ if (result2 instanceof Promise) {
2274
2274
  if (ctx.async === false)
2275
2275
  throw new $ZodAsyncError();
2276
- return result.then((result2) => runChecks(result2, checks, ctx));
2276
+ return result2.then((result3) => runChecks(result3, checks, ctx));
2277
2277
  }
2278
- return runChecks(result, checks, ctx);
2278
+ return runChecks(result2, checks, ctx);
2279
2279
  };
2280
2280
  }
2281
2281
  defineLazy(inst, "~standard", () => ({
@@ -2762,14 +2762,14 @@ var init_schemas = __esm({
2762
2762
  const proms = [];
2763
2763
  for (let i2 = 0; i2 < input2.length; i2++) {
2764
2764
  const item = input2[i2];
2765
- const result = def.element._zod.run({
2765
+ const result2 = def.element._zod.run({
2766
2766
  value: item,
2767
2767
  issues: []
2768
2768
  }, ctx);
2769
- if (result instanceof Promise) {
2770
- proms.push(result.then((result2) => handleArrayResult(result2, payload, i2)));
2769
+ if (result2 instanceof Promise) {
2770
+ proms.push(result2.then((result3) => handleArrayResult(result3, payload, i2)));
2771
2771
  } else {
2772
- handleArrayResult(result, payload, i2);
2772
+ handleArrayResult(result2, payload, i2);
2773
2773
  }
2774
2774
  }
2775
2775
  if (proms.length) {
@@ -2966,17 +2966,17 @@ var init_schemas = __esm({
2966
2966
  let async = false;
2967
2967
  const results = [];
2968
2968
  for (const option of def.options) {
2969
- const result = option._zod.run({
2969
+ const result2 = option._zod.run({
2970
2970
  value: payload.value,
2971
2971
  issues: []
2972
2972
  }, ctx);
2973
- if (result instanceof Promise) {
2974
- results.push(result);
2973
+ if (result2 instanceof Promise) {
2974
+ results.push(result2);
2975
2975
  async = true;
2976
2976
  } else {
2977
- if (result.issues.length === 0)
2978
- return result;
2979
- results.push(result);
2977
+ if (result2.issues.length === 0)
2978
+ return result2;
2979
+ results.push(result2);
2980
2980
  }
2981
2981
  }
2982
2982
  if (!async)
@@ -2998,15 +2998,15 @@ var init_schemas = __esm({
2998
2998
  let async = false;
2999
2999
  const results = [];
3000
3000
  for (const option of def.options) {
3001
- const result = option._zod.run({
3001
+ const result2 = option._zod.run({
3002
3002
  value: payload.value,
3003
3003
  issues: []
3004
3004
  }, ctx);
3005
- if (result instanceof Promise) {
3006
- results.push(result);
3005
+ if (result2 instanceof Promise) {
3006
+ results.push(result2);
3007
3007
  async = true;
3008
3008
  } else {
3009
- results.push(result);
3009
+ results.push(result2);
3010
3010
  }
3011
3011
  }
3012
3012
  if (!async)
@@ -3135,28 +3135,28 @@ var init_schemas = __esm({
3135
3135
  if (i2 >= optStart)
3136
3136
  continue;
3137
3137
  }
3138
- const result = item._zod.run({
3138
+ const result2 = item._zod.run({
3139
3139
  value: input2[i2],
3140
3140
  issues: []
3141
3141
  }, ctx);
3142
- if (result instanceof Promise) {
3143
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i2)));
3142
+ if (result2 instanceof Promise) {
3143
+ proms.push(result2.then((result3) => handleTupleResult(result3, payload, i2)));
3144
3144
  } else {
3145
- handleTupleResult(result, payload, i2);
3145
+ handleTupleResult(result2, payload, i2);
3146
3146
  }
3147
3147
  }
3148
3148
  if (def.rest) {
3149
3149
  const rest = input2.slice(items.length);
3150
3150
  for (const el of rest) {
3151
3151
  i2++;
3152
- const result = def.rest._zod.run({
3152
+ const result2 = def.rest._zod.run({
3153
3153
  value: el,
3154
3154
  issues: []
3155
3155
  }, ctx);
3156
- if (result instanceof Promise) {
3157
- proms.push(result.then((result2) => handleTupleResult(result2, payload, i2)));
3156
+ if (result2 instanceof Promise) {
3157
+ proms.push(result2.then((result3) => handleTupleResult(result3, payload, i2)));
3158
3158
  } else {
3159
- handleTupleResult(result, payload, i2);
3159
+ handleTupleResult(result2, payload, i2);
3160
3160
  }
3161
3161
  }
3162
3162
  }
@@ -3186,19 +3186,19 @@ var init_schemas = __esm({
3186
3186
  for (const key of values2) {
3187
3187
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
3188
3188
  recordKeys.add(typeof key === "number" ? key.toString() : key);
3189
- const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
3190
- if (result instanceof Promise) {
3191
- proms.push(result.then((result2) => {
3192
- if (result2.issues.length) {
3193
- payload.issues.push(...prefixIssues(key, result2.issues));
3189
+ const result2 = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
3190
+ if (result2 instanceof Promise) {
3191
+ proms.push(result2.then((result3) => {
3192
+ if (result3.issues.length) {
3193
+ payload.issues.push(...prefixIssues(key, result3.issues));
3194
3194
  }
3195
- payload.value[key] = result2.value;
3195
+ payload.value[key] = result3.value;
3196
3196
  }));
3197
3197
  } else {
3198
- if (result.issues.length) {
3199
- payload.issues.push(...prefixIssues(key, result.issues));
3198
+ if (result2.issues.length) {
3199
+ payload.issues.push(...prefixIssues(key, result2.issues));
3200
3200
  }
3201
- payload.value[key] = result.value;
3201
+ payload.value[key] = result2.value;
3202
3202
  }
3203
3203
  }
3204
3204
  }
@@ -3251,19 +3251,19 @@ var init_schemas = __esm({
3251
3251
  }
3252
3252
  continue;
3253
3253
  }
3254
- const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
3255
- if (result instanceof Promise) {
3256
- proms.push(result.then((result2) => {
3257
- if (result2.issues.length) {
3258
- payload.issues.push(...prefixIssues(key, result2.issues));
3254
+ const result2 = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
3255
+ if (result2 instanceof Promise) {
3256
+ proms.push(result2.then((result3) => {
3257
+ if (result3.issues.length) {
3258
+ payload.issues.push(...prefixIssues(key, result3.issues));
3259
3259
  }
3260
- payload.value[keyResult.value] = result2.value;
3260
+ payload.value[keyResult.value] = result3.value;
3261
3261
  }));
3262
3262
  } else {
3263
- if (result.issues.length) {
3264
- payload.issues.push(...prefixIssues(key, result.issues));
3263
+ if (result2.issues.length) {
3264
+ payload.issues.push(...prefixIssues(key, result2.issues));
3265
3265
  }
3266
- payload.value[keyResult.value] = result.value;
3266
+ payload.value[keyResult.value] = result2.value;
3267
3267
  }
3268
3268
  }
3269
3269
  }
@@ -3320,11 +3320,11 @@ var init_schemas = __esm({
3320
3320
  const proms = [];
3321
3321
  payload.value = /* @__PURE__ */ new Set();
3322
3322
  for (const item of input2) {
3323
- const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
3324
- if (result instanceof Promise) {
3325
- proms.push(result.then((result2) => handleSetResult(result2, payload)));
3323
+ const result2 = def.valueType._zod.run({ value: item, issues: [] }, ctx);
3324
+ if (result2 instanceof Promise) {
3325
+ proms.push(result2.then((result3) => handleSetResult(result3, payload)));
3326
3326
  } else
3327
- handleSetResult(result, payload);
3327
+ handleSetResult(result2, payload);
3328
3328
  }
3329
3329
  if (proms.length)
3330
3330
  return Promise.all(proms).then(() => payload);
@@ -3422,10 +3422,10 @@ var init_schemas = __esm({
3422
3422
  });
3423
3423
  inst._zod.parse = (payload, ctx) => {
3424
3424
  if (def.innerType._zod.optin === "optional") {
3425
- const result = def.innerType._zod.run(payload, ctx);
3426
- if (result instanceof Promise)
3427
- return result.then((r3) => handleOptionalResult(r3, payload.value));
3428
- return handleOptionalResult(result, payload.value);
3425
+ const result2 = def.innerType._zod.run(payload, ctx);
3426
+ if (result2 instanceof Promise)
3427
+ return result2.then((r3) => handleOptionalResult(r3, payload.value));
3428
+ return handleOptionalResult(result2, payload.value);
3429
3429
  }
3430
3430
  if (payload.value === void 0) {
3431
3431
  return payload;
@@ -3470,11 +3470,11 @@ var init_schemas = __esm({
3470
3470
  payload.value = def.defaultValue;
3471
3471
  return payload;
3472
3472
  }
3473
- const result = def.innerType._zod.run(payload, ctx);
3474
- if (result instanceof Promise) {
3475
- return result.then((result2) => handleDefaultResult(result2, def));
3473
+ const result2 = def.innerType._zod.run(payload, ctx);
3474
+ if (result2 instanceof Promise) {
3475
+ return result2.then((result3) => handleDefaultResult(result3, def));
3476
3476
  }
3477
- return handleDefaultResult(result, def);
3477
+ return handleDefaultResult(result2, def);
3478
3478
  };
3479
3479
  });
3480
3480
  $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
@@ -3498,11 +3498,11 @@ var init_schemas = __esm({
3498
3498
  return v2 ? new Set([...v2].filter((x2) => x2 !== void 0)) : void 0;
3499
3499
  });
3500
3500
  inst._zod.parse = (payload, ctx) => {
3501
- const result = def.innerType._zod.run(payload, ctx);
3502
- if (result instanceof Promise) {
3503
- return result.then((result2) => handleNonOptionalResult(result2, inst));
3501
+ const result2 = def.innerType._zod.run(payload, ctx);
3502
+ if (result2 instanceof Promise) {
3503
+ return result2.then((result3) => handleNonOptionalResult(result3, inst));
3504
3504
  }
3505
- return handleNonOptionalResult(result, inst);
3505
+ return handleNonOptionalResult(result2, inst);
3506
3506
  };
3507
3507
  });
3508
3508
  $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
@@ -3511,14 +3511,14 @@ var init_schemas = __esm({
3511
3511
  if (ctx.direction === "backward") {
3512
3512
  throw new $ZodEncodeError("ZodSuccess");
3513
3513
  }
3514
- const result = def.innerType._zod.run(payload, ctx);
3515
- if (result instanceof Promise) {
3516
- return result.then((result2) => {
3517
- payload.value = result2.issues.length === 0;
3514
+ const result2 = def.innerType._zod.run(payload, ctx);
3515
+ if (result2 instanceof Promise) {
3516
+ return result2.then((result3) => {
3517
+ payload.value = result3.issues.length === 0;
3518
3518
  return payload;
3519
3519
  });
3520
3520
  }
3521
- payload.value = result.issues.length === 0;
3521
+ payload.value = result2.issues.length === 0;
3522
3522
  return payload;
3523
3523
  };
3524
3524
  });
@@ -3531,15 +3531,15 @@ var init_schemas = __esm({
3531
3531
  if (ctx.direction === "backward") {
3532
3532
  return def.innerType._zod.run(payload, ctx);
3533
3533
  }
3534
- const result = def.innerType._zod.run(payload, ctx);
3535
- if (result instanceof Promise) {
3536
- return result.then((result2) => {
3537
- payload.value = result2.value;
3538
- if (result2.issues.length) {
3534
+ const result2 = def.innerType._zod.run(payload, ctx);
3535
+ if (result2 instanceof Promise) {
3536
+ return result2.then((result3) => {
3537
+ payload.value = result3.value;
3538
+ if (result3.issues.length) {
3539
3539
  payload.value = def.catchValue({
3540
3540
  ...payload,
3541
3541
  error: {
3542
- issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
3542
+ issues: result3.issues.map((iss) => finalizeIssue(iss, ctx, config()))
3543
3543
  },
3544
3544
  input: payload.value
3545
3545
  });
@@ -3548,12 +3548,12 @@ var init_schemas = __esm({
3548
3548
  return payload;
3549
3549
  });
3550
3550
  }
3551
- payload.value = result.value;
3552
- if (result.issues.length) {
3551
+ payload.value = result2.value;
3552
+ if (result2.issues.length) {
3553
3553
  payload.value = def.catchValue({
3554
3554
  ...payload,
3555
3555
  error: {
3556
- issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
3556
+ issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
3557
3557
  },
3558
3558
  input: payload.value
3559
3559
  });
@@ -3631,11 +3631,11 @@ var init_schemas = __esm({
3631
3631
  if (ctx.direction === "backward") {
3632
3632
  return def.innerType._zod.run(payload, ctx);
3633
3633
  }
3634
- const result = def.innerType._zod.run(payload, ctx);
3635
- if (result instanceof Promise) {
3636
- return result.then(handleReadonlyResult);
3634
+ const result2 = def.innerType._zod.run(payload, ctx);
3635
+ if (result2 instanceof Promise) {
3636
+ return result2.then(handleReadonlyResult);
3637
3637
  }
3638
- return handleReadonlyResult(result);
3638
+ return handleReadonlyResult(result2);
3639
3639
  };
3640
3640
  });
3641
3641
  $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral", (inst, def) => {
@@ -3693,11 +3693,11 @@ var init_schemas = __esm({
3693
3693
  }
3694
3694
  return function(...args) {
3695
3695
  const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;
3696
- const result = Reflect.apply(func, this, parsedArgs);
3696
+ const result2 = Reflect.apply(func, this, parsedArgs);
3697
3697
  if (inst._def.output) {
3698
- return parse(inst._def.output, result);
3698
+ return parse(inst._def.output, result2);
3699
3699
  }
3700
- return result;
3700
+ return result2;
3701
3701
  };
3702
3702
  };
3703
3703
  inst.implementAsync = (func) => {
@@ -3706,11 +3706,11 @@ var init_schemas = __esm({
3706
3706
  }
3707
3707
  return async function(...args) {
3708
3708
  const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;
3709
- const result = await Reflect.apply(func, this, parsedArgs);
3709
+ const result2 = await Reflect.apply(func, this, parsedArgs);
3710
3710
  if (inst._def.output) {
3711
- return await parseAsync(inst._def.output, result);
3711
+ return await parseAsync(inst._def.output, result2);
3712
3712
  }
3713
- return result;
3713
+ return result2;
3714
3714
  };
3715
3715
  };
3716
3716
  inst._zod.parse = (payload, _ctx) => {
@@ -7008,12 +7008,12 @@ var init_lt = __esm({
7008
7008
  }
7009
7009
  };
7010
7010
  function getSizing(origin, unitType, inclusive, targetShouldBe) {
7011
- const result = Sizable[origin] ?? null;
7012
- if (result === null)
7013
- return result;
7011
+ const result2 = Sizable[origin] ?? null;
7012
+ if (result2 === null)
7013
+ return result2;
7014
7014
  return {
7015
- unit: result.unit[unitType],
7016
- verb: result.verb[targetShouldBe][inclusive ? "inclusive" : "notInclusive"]
7015
+ unit: result2.unit[unitType],
7016
+ verb: result2.verb[targetShouldBe][inclusive ? "inclusive" : "notInclusive"]
7017
7017
  };
7018
7018
  }
7019
7019
  const FormatDictionary = {
@@ -10855,11 +10855,11 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
10855
10855
  }
10856
10856
  return seen.schema;
10857
10857
  }
10858
- const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
10859
- ctx.seen.set(schema, result);
10858
+ const result2 = { schema: {}, count: 1, cycle: void 0, path: _params.path };
10859
+ ctx.seen.set(schema, result2);
10860
10860
  const overrideSchema = schema._zod.toJSONSchema?.();
10861
10861
  if (overrideSchema) {
10862
- result.schema = overrideSchema;
10862
+ result2.schema = overrideSchema;
10863
10863
  } else {
10864
10864
  const params = {
10865
10865
  ..._params,
@@ -10867,9 +10867,9 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
10867
10867
  path: _params.path
10868
10868
  };
10869
10869
  if (schema._zod.processJSONSchema) {
10870
- schema._zod.processJSONSchema(ctx, result.schema, params);
10870
+ schema._zod.processJSONSchema(ctx, result2.schema, params);
10871
10871
  } else {
10872
- const _json = result.schema;
10872
+ const _json = result2.schema;
10873
10873
  const processor = ctx.processors[def.type];
10874
10874
  if (!processor) {
10875
10875
  throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
@@ -10878,22 +10878,22 @@ function process2(schema, ctx, _params = { path: [], schemaPath: [] }) {
10878
10878
  }
10879
10879
  const parent = schema._zod.parent;
10880
10880
  if (parent) {
10881
- if (!result.ref)
10882
- result.ref = parent;
10881
+ if (!result2.ref)
10882
+ result2.ref = parent;
10883
10883
  process2(parent, ctx, params);
10884
10884
  ctx.seen.get(parent).isParent = true;
10885
10885
  }
10886
10886
  }
10887
10887
  const meta3 = ctx.metadataRegistry.get(schema);
10888
10888
  if (meta3)
10889
- Object.assign(result.schema, meta3);
10889
+ Object.assign(result2.schema, meta3);
10890
10890
  if (ctx.io === "input" && isTransforming(schema)) {
10891
- delete result.schema.examples;
10892
- delete result.schema.default;
10891
+ delete result2.schema.examples;
10892
+ delete result2.schema.default;
10893
10893
  }
10894
- if (ctx.io === "input" && result.schema._prefault)
10895
- (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
10896
- delete result.schema._prefault;
10894
+ if (ctx.io === "input" && result2.schema._prefault)
10895
+ (_a2 = result2.schema).default ?? (_a2.default = result2.schema._prefault);
10896
+ delete result2.schema._prefault;
10897
10897
  const _result = ctx.seen.get(schema);
10898
10898
  return _result.schema;
10899
10899
  }
@@ -11056,13 +11056,13 @@ function finalize(ctx, schema) {
11056
11056
  for (const entry of [...ctx.seen.entries()].reverse()) {
11057
11057
  flattenRef(entry[0]);
11058
11058
  }
11059
- const result = {};
11059
+ const result2 = {};
11060
11060
  if (ctx.target === "draft-2020-12") {
11061
- result.$schema = "https://json-schema.org/draft/2020-12/schema";
11061
+ result2.$schema = "https://json-schema.org/draft/2020-12/schema";
11062
11062
  } else if (ctx.target === "draft-07") {
11063
- result.$schema = "http://json-schema.org/draft-07/schema#";
11063
+ result2.$schema = "http://json-schema.org/draft-07/schema#";
11064
11064
  } else if (ctx.target === "draft-04") {
11065
- result.$schema = "http://json-schema.org/draft-04/schema#";
11065
+ result2.$schema = "http://json-schema.org/draft-04/schema#";
11066
11066
  } else if (ctx.target === "openapi-3.0") {
11067
11067
  } else {
11068
11068
  }
@@ -11070,9 +11070,9 @@ function finalize(ctx, schema) {
11070
11070
  const id = ctx.external.registry.get(schema)?.id;
11071
11071
  if (!id)
11072
11072
  throw new Error("Schema is missing an `id` property");
11073
- result.$id = ctx.external.uri(id);
11073
+ result2.$id = ctx.external.uri(id);
11074
11074
  }
11075
- Object.assign(result, root.def ?? root.schema);
11075
+ Object.assign(result2, root.def ?? root.schema);
11076
11076
  const defs = ctx.external?.defs ?? {};
11077
11077
  for (const entry of ctx.seen.entries()) {
11078
11078
  const seen = entry[1];
@@ -11084,14 +11084,14 @@ function finalize(ctx, schema) {
11084
11084
  } else {
11085
11085
  if (Object.keys(defs).length > 0) {
11086
11086
  if (ctx.target === "draft-2020-12") {
11087
- result.$defs = defs;
11087
+ result2.$defs = defs;
11088
11088
  } else {
11089
- result.definitions = defs;
11089
+ result2.definitions = defs;
11090
11090
  }
11091
11091
  }
11092
11092
  }
11093
11093
  try {
11094
- const finalized = JSON.parse(JSON.stringify(result));
11094
+ const finalized = JSON.parse(JSON.stringify(result2));
11095
11095
  Object.defineProperty(finalized, "~standard", {
11096
11096
  value: {
11097
11097
  ...schema["~standard"],
@@ -11811,8 +11811,8 @@ var init_json_schema_generator = __esm({
11811
11811
  this.ctx.external = _params.external;
11812
11812
  }
11813
11813
  extractDefs(this.ctx, schema);
11814
- const result = finalize(this.ctx, schema);
11815
- const { "~standard": _3, ...plainResult } = result;
11814
+ const result2 = finalize(this.ctx, schema);
11815
+ const { "~standard": _3, ...plainResult } = result2;
11816
11816
  return plainResult;
11817
11817
  }
11818
11818
  };
@@ -13588,13 +13588,13 @@ function resolveRef(ref, ctx) {
13588
13588
  if (!ref.startsWith("#")) {
13589
13589
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
13590
13590
  }
13591
- const path14 = ref.slice(1).split("/").filter(Boolean);
13592
- if (path14.length === 0) {
13591
+ const path15 = ref.slice(1).split("/").filter(Boolean);
13592
+ if (path15.length === 0) {
13593
13593
  return ctx.rootSchema;
13594
13594
  }
13595
13595
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
13596
- if (path14[0] === defsKey) {
13597
- const key = path14[1];
13596
+ if (path15[0] === defsKey) {
13597
+ const key = path15[1];
13598
13598
  if (!key || !ctx.defs[key]) {
13599
13599
  throw new Error(`Reference not found: ${ref}`);
13600
13600
  }
@@ -13819,11 +13819,11 @@ function convertBaseSchema(schema, ctx) {
13819
13819
  } else if (schemasToIntersect.length === 1) {
13820
13820
  zodSchema = schemasToIntersect[0];
13821
13821
  } else {
13822
- let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
13822
+ let result2 = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
13823
13823
  for (let i2 = 2; i2 < schemasToIntersect.length; i2++) {
13824
- result = z.intersection(result, schemasToIntersect[i2]);
13824
+ result2 = z.intersection(result2, schemasToIntersect[i2]);
13825
13825
  }
13826
- zodSchema = result;
13826
+ zodSchema = result2;
13827
13827
  }
13828
13828
  break;
13829
13829
  }
@@ -13914,12 +13914,12 @@ function convertSchema(schema, ctx) {
13914
13914
  if (schema.allOf.length === 0) {
13915
13915
  baseSchema = hasExplicitType ? baseSchema : z.any();
13916
13916
  } else {
13917
- let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
13917
+ let result2 = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
13918
13918
  const startIdx = hasExplicitType ? 0 : 1;
13919
13919
  for (let i2 = startIdx; i2 < schema.allOf.length; i2++) {
13920
- result = z.intersection(result, convertSchema(schema.allOf[i2], ctx));
13920
+ result2 = z.intersection(result2, convertSchema(schema.allOf[i2], ctx));
13921
13921
  }
13922
- baseSchema = result;
13922
+ baseSchema = result2;
13923
13923
  }
13924
13924
  }
13925
13925
  if (schema.nullable === true && ctx.version === "openapi-3.0") {
@@ -14926,8 +14926,8 @@ var init_parseUtil = __esm({
14926
14926
  init_errors3();
14927
14927
  init_en2();
14928
14928
  makeIssue = (params) => {
14929
- const { data, path: path14, errorMaps, issueData } = params;
14930
- const fullPath = [...path14, ...issueData.path || []];
14929
+ const { data, path: path15, errorMaps, issueData } = params;
14930
+ const fullPath = [...path15, ...issueData.path || []];
14931
14931
  const fullIssue = {
14932
14932
  ...issueData,
14933
14933
  path: fullPath
@@ -15235,11 +15235,11 @@ var init_types = __esm({
15235
15235
  init_parseUtil();
15236
15236
  init_util2();
15237
15237
  ParseInputLazyPath = class {
15238
- constructor(parent, value, path14, key) {
15238
+ constructor(parent, value, path15, key) {
15239
15239
  this._cachedPath = [];
15240
15240
  this.parent = parent;
15241
15241
  this.data = value;
15242
- this._path = path14;
15242
+ this._path = path15;
15243
15243
  this._key = key;
15244
15244
  }
15245
15245
  get path() {
@@ -15253,9 +15253,9 @@ var init_types = __esm({
15253
15253
  return this._cachedPath;
15254
15254
  }
15255
15255
  };
15256
- handleResult = (ctx, result) => {
15257
- if (isValid(result)) {
15258
- return { success: true, data: result.value };
15256
+ handleResult = (ctx, result2) => {
15257
+ if (isValid(result2)) {
15258
+ return { success: true, data: result2.value };
15259
15259
  } else {
15260
15260
  if (!ctx.common.issues.length) {
15261
15261
  throw new Error("Validation failed but no issues detected.");
@@ -15303,21 +15303,21 @@ var init_types = __esm({
15303
15303
  };
15304
15304
  }
15305
15305
  _parseSync(input2) {
15306
- const result = this._parse(input2);
15307
- if (isAsync(result)) {
15306
+ const result2 = this._parse(input2);
15307
+ if (isAsync(result2)) {
15308
15308
  throw new Error("Synchronous parse encountered promise.");
15309
15309
  }
15310
- return result;
15310
+ return result2;
15311
15311
  }
15312
15312
  _parseAsync(input2) {
15313
- const result = this._parse(input2);
15314
- return Promise.resolve(result);
15313
+ const result2 = this._parse(input2);
15314
+ return Promise.resolve(result2);
15315
15315
  }
15316
15316
  parse(data, params) {
15317
- const result = this.safeParse(data, params);
15318
- if (result.success)
15319
- return result.data;
15320
- throw result.error;
15317
+ const result2 = this.safeParse(data, params);
15318
+ if (result2.success)
15319
+ return result2.data;
15320
+ throw result2.error;
15321
15321
  }
15322
15322
  safeParse(data, params) {
15323
15323
  const ctx = {
@@ -15332,8 +15332,8 @@ var init_types = __esm({
15332
15332
  data,
15333
15333
  parsedType: getParsedType2(data)
15334
15334
  };
15335
- const result = this._parseSync({ data, path: ctx.path, parent: ctx });
15336
- return handleResult(ctx, result);
15335
+ const result2 = this._parseSync({ data, path: ctx.path, parent: ctx });
15336
+ return handleResult(ctx, result2);
15337
15337
  }
15338
15338
  "~validate"(data) {
15339
15339
  const ctx = {
@@ -15349,9 +15349,9 @@ var init_types = __esm({
15349
15349
  };
15350
15350
  if (!this["~standard"].async) {
15351
15351
  try {
15352
- const result = this._parseSync({ data, path: [], parent: ctx });
15353
- return isValid(result) ? {
15354
- value: result.value
15352
+ const result2 = this._parseSync({ data, path: [], parent: ctx });
15353
+ return isValid(result2) ? {
15354
+ value: result2.value
15355
15355
  } : {
15356
15356
  issues: ctx.common.issues
15357
15357
  };
@@ -15365,17 +15365,17 @@ var init_types = __esm({
15365
15365
  };
15366
15366
  }
15367
15367
  }
15368
- return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
15369
- value: result.value
15368
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result2) => isValid(result2) ? {
15369
+ value: result2.value
15370
15370
  } : {
15371
15371
  issues: ctx.common.issues
15372
15372
  });
15373
15373
  }
15374
15374
  async parseAsync(data, params) {
15375
- const result = await this.safeParseAsync(data, params);
15376
- if (result.success)
15377
- return result.data;
15378
- throw result.error;
15375
+ const result2 = await this.safeParseAsync(data, params);
15376
+ if (result2.success)
15377
+ return result2.data;
15378
+ throw result2.error;
15379
15379
  }
15380
15380
  async safeParseAsync(data, params) {
15381
15381
  const ctx = {
@@ -15391,8 +15391,8 @@ var init_types = __esm({
15391
15391
  parsedType: getParsedType2(data)
15392
15392
  };
15393
15393
  const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
15394
- const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
15395
- return handleResult(ctx, result);
15394
+ const result2 = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
15395
+ return handleResult(ctx, result2);
15396
15396
  }
15397
15397
  refine(check2, message) {
15398
15398
  const getIssueProperties = (val) => {
@@ -15405,13 +15405,13 @@ var init_types = __esm({
15405
15405
  }
15406
15406
  };
15407
15407
  return this._refinement((val, ctx) => {
15408
- const result = check2(val);
15408
+ const result2 = check2(val);
15409
15409
  const setError = () => ctx.addIssue({
15410
15410
  code: ZodIssueCode2.custom,
15411
15411
  ...getIssueProperties(val)
15412
15412
  });
15413
- if (typeof Promise !== "undefined" && result instanceof Promise) {
15414
- return result.then((data) => {
15413
+ if (typeof Promise !== "undefined" && result2 instanceof Promise) {
15414
+ return result2.then((data) => {
15415
15415
  if (!data) {
15416
15416
  setError();
15417
15417
  return false;
@@ -15420,7 +15420,7 @@ var init_types = __esm({
15420
15420
  }
15421
15421
  });
15422
15422
  }
15423
- if (!result) {
15423
+ if (!result2) {
15424
15424
  setError();
15425
15425
  return false;
15426
15426
  } else {
@@ -16844,14 +16844,14 @@ var init_types = __esm({
16844
16844
  if (ctx.common.async) {
16845
16845
  return Promise.all([...ctx.data].map((item, i2) => {
16846
16846
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
16847
- })).then((result2) => {
16848
- return ParseStatus.mergeArray(status, result2);
16847
+ })).then((result3) => {
16848
+ return ParseStatus.mergeArray(status, result3);
16849
16849
  });
16850
16850
  }
16851
- const result = [...ctx.data].map((item, i2) => {
16851
+ const result2 = [...ctx.data].map((item, i2) => {
16852
16852
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
16853
16853
  });
16854
- return ParseStatus.mergeArray(status, result);
16854
+ return ParseStatus.mergeArray(status, result2);
16855
16855
  }
16856
16856
  get element() {
16857
16857
  return this._def.type;
@@ -17231,18 +17231,18 @@ var init_types = __esm({
17231
17231
  const { ctx } = this._processInputParams(input2);
17232
17232
  const options = this._def.options;
17233
17233
  function handleResults(results) {
17234
- for (const result of results) {
17235
- if (result.result.status === "valid") {
17236
- return result.result;
17234
+ for (const result2 of results) {
17235
+ if (result2.result.status === "valid") {
17236
+ return result2.result;
17237
17237
  }
17238
17238
  }
17239
- for (const result of results) {
17240
- if (result.result.status === "dirty") {
17241
- ctx.common.issues.push(...result.ctx.common.issues);
17242
- return result.result;
17239
+ for (const result2 of results) {
17240
+ if (result2.result.status === "dirty") {
17241
+ ctx.common.issues.push(...result2.ctx.common.issues);
17242
+ return result2.result;
17243
17243
  }
17244
17244
  }
17245
- const unionErrors = results.map((result) => new ZodError2(result.ctx.common.issues));
17245
+ const unionErrors = results.map((result2) => new ZodError2(result2.ctx.common.issues));
17246
17246
  addIssueToContext(ctx, {
17247
17247
  code: ZodIssueCode2.invalid_union,
17248
17248
  unionErrors
@@ -17280,15 +17280,15 @@ var init_types = __esm({
17280
17280
  },
17281
17281
  parent: null
17282
17282
  };
17283
- const result = option._parseSync({
17283
+ const result2 = option._parseSync({
17284
17284
  data: ctx.data,
17285
17285
  path: ctx.path,
17286
17286
  parent: childCtx
17287
17287
  });
17288
- if (result.status === "valid") {
17289
- return result;
17290
- } else if (result.status === "dirty" && !dirty) {
17291
- dirty = { result, ctx: childCtx };
17288
+ if (result2.status === "valid") {
17289
+ return result2;
17290
+ } else if (result2.status === "dirty" && !dirty) {
17291
+ dirty = { result: result2, ctx: childCtx };
17292
17292
  }
17293
17293
  if (childCtx.common.issues.length) {
17294
17294
  issues.push(childCtx.common.issues);
@@ -17795,9 +17795,9 @@ var init_types = __esm({
17795
17795
  error48.addIssue(makeArgsIssue(args, e2));
17796
17796
  throw error48;
17797
17797
  });
17798
- const result = await Reflect.apply(fn, this, parsedArgs);
17799
- const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e2) => {
17800
- error48.addIssue(makeReturnsIssue(result, e2));
17798
+ const result2 = await Reflect.apply(fn, this, parsedArgs);
17799
+ const parsedReturns = await me._def.returns._def.type.parseAsync(result2, params).catch((e2) => {
17800
+ error48.addIssue(makeReturnsIssue(result2, e2));
17801
17801
  throw error48;
17802
17802
  });
17803
17803
  return parsedReturns;
@@ -17809,10 +17809,10 @@ var init_types = __esm({
17809
17809
  if (!parsedArgs.success) {
17810
17810
  throw new ZodError2([makeArgsIssue(args, parsedArgs.error)]);
17811
17811
  }
17812
- const result = Reflect.apply(fn, this, parsedArgs.data);
17813
- const parsedReturns = me._def.returns.safeParse(result, params);
17812
+ const result2 = Reflect.apply(fn, this, parsedArgs.data);
17813
+ const parsedReturns = me._def.returns.safeParse(result2, params);
17814
17814
  if (!parsedReturns.success) {
17815
- throw new ZodError2([makeReturnsIssue(result, parsedReturns.error)]);
17815
+ throw new ZodError2([makeReturnsIssue(result2, parsedReturns.error)]);
17816
17816
  }
17817
17817
  return parsedReturns.data;
17818
17818
  });
@@ -18057,43 +18057,43 @@ var init_types = __esm({
18057
18057
  return Promise.resolve(processed).then(async (processed2) => {
18058
18058
  if (status.value === "aborted")
18059
18059
  return INVALID;
18060
- const result = await this._def.schema._parseAsync({
18060
+ const result2 = await this._def.schema._parseAsync({
18061
18061
  data: processed2,
18062
18062
  path: ctx.path,
18063
18063
  parent: ctx
18064
18064
  });
18065
- if (result.status === "aborted")
18065
+ if (result2.status === "aborted")
18066
18066
  return INVALID;
18067
- if (result.status === "dirty")
18068
- return DIRTY(result.value);
18067
+ if (result2.status === "dirty")
18068
+ return DIRTY(result2.value);
18069
18069
  if (status.value === "dirty")
18070
- return DIRTY(result.value);
18071
- return result;
18070
+ return DIRTY(result2.value);
18071
+ return result2;
18072
18072
  });
18073
18073
  } else {
18074
18074
  if (status.value === "aborted")
18075
18075
  return INVALID;
18076
- const result = this._def.schema._parseSync({
18076
+ const result2 = this._def.schema._parseSync({
18077
18077
  data: processed,
18078
18078
  path: ctx.path,
18079
18079
  parent: ctx
18080
18080
  });
18081
- if (result.status === "aborted")
18081
+ if (result2.status === "aborted")
18082
18082
  return INVALID;
18083
- if (result.status === "dirty")
18084
- return DIRTY(result.value);
18083
+ if (result2.status === "dirty")
18084
+ return DIRTY(result2.value);
18085
18085
  if (status.value === "dirty")
18086
- return DIRTY(result.value);
18087
- return result;
18086
+ return DIRTY(result2.value);
18087
+ return result2;
18088
18088
  }
18089
18089
  }
18090
18090
  if (effect.type === "refinement") {
18091
18091
  const executeRefinement = (acc) => {
18092
- const result = effect.refinement(acc, checkCtx);
18092
+ const result2 = effect.refinement(acc, checkCtx);
18093
18093
  if (ctx.common.async) {
18094
- return Promise.resolve(result);
18094
+ return Promise.resolve(result2);
18095
18095
  }
18096
- if (result instanceof Promise) {
18096
+ if (result2 instanceof Promise) {
18097
18097
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
18098
18098
  }
18099
18099
  return acc;
@@ -18131,18 +18131,18 @@ var init_types = __esm({
18131
18131
  });
18132
18132
  if (!isValid(base))
18133
18133
  return INVALID;
18134
- const result = effect.transform(base.value, checkCtx);
18135
- if (result instanceof Promise) {
18134
+ const result2 = effect.transform(base.value, checkCtx);
18135
+ if (result2 instanceof Promise) {
18136
18136
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
18137
18137
  }
18138
- return { status: status.value, value: result };
18138
+ return { status: status.value, value: result2 };
18139
18139
  } else {
18140
18140
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
18141
18141
  if (!isValid(base))
18142
18142
  return INVALID;
18143
- return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
18143
+ return Promise.resolve(effect.transform(base.value, checkCtx)).then((result2) => ({
18144
18144
  status: status.value,
18145
- value: result
18145
+ value: result2
18146
18146
  }));
18147
18147
  });
18148
18148
  }
@@ -18239,18 +18239,18 @@ var init_types = __esm({
18239
18239
  issues: []
18240
18240
  }
18241
18241
  };
18242
- const result = this._def.innerType._parse({
18242
+ const result2 = this._def.innerType._parse({
18243
18243
  data: newCtx.data,
18244
18244
  path: newCtx.path,
18245
18245
  parent: {
18246
18246
  ...newCtx
18247
18247
  }
18248
18248
  });
18249
- if (isAsync(result)) {
18250
- return result.then((result2) => {
18249
+ if (isAsync(result2)) {
18250
+ return result2.then((result3) => {
18251
18251
  return {
18252
18252
  status: "valid",
18253
- value: result2.status === "valid" ? result2.value : this._def.catchValue({
18253
+ value: result3.status === "valid" ? result3.value : this._def.catchValue({
18254
18254
  get error() {
18255
18255
  return new ZodError2(newCtx.common.issues);
18256
18256
  },
@@ -18261,7 +18261,7 @@ var init_types = __esm({
18261
18261
  } else {
18262
18262
  return {
18263
18263
  status: "valid",
18264
- value: result.status === "valid" ? result.value : this._def.catchValue({
18264
+ value: result2.status === "valid" ? result2.value : this._def.catchValue({
18265
18265
  get error() {
18266
18266
  return new ZodError2(newCtx.common.issues);
18267
18267
  },
@@ -18375,14 +18375,14 @@ var init_types = __esm({
18375
18375
  };
18376
18376
  ZodReadonly2 = class extends ZodType2 {
18377
18377
  _parse(input2) {
18378
- const result = this._def.innerType._parse(input2);
18378
+ const result2 = this._def.innerType._parse(input2);
18379
18379
  const freeze = (data) => {
18380
18380
  if (isValid(data)) {
18381
18381
  data.value = Object.freeze(data.value);
18382
18382
  }
18383
18383
  return data;
18384
18384
  };
18385
- return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
18385
+ return isAsync(result2) ? result2.then((data) => freeze(data)) : freeze(result2);
18386
18386
  }
18387
18387
  unwrap() {
18388
18388
  return this._def.innerType;
@@ -18765,13 +18765,13 @@ ${USAGE_LINE}`);
18765
18765
  let type;
18766
18766
  const rawType = values2.type;
18767
18767
  if (typeof rawType === "string" && rawType.length > 0) {
18768
- const result = PackageTypeSchema.safeParse(rawType);
18769
- if (!result.success) {
18768
+ const result2 = PackageTypeSchema.safeParse(rawType);
18769
+ if (!result2.success) {
18770
18770
  throw new Error(
18771
18771
  `Invalid --type value: '${rawType}'. Allowed: ${ALLOWED_PACKAGE_TYPES.join(", ")}`
18772
18772
  );
18773
18773
  }
18774
- type = result.data;
18774
+ type = result2.data;
18775
18775
  }
18776
18776
  return {
18777
18777
  name,
@@ -18783,7 +18783,7 @@ ${USAGE_LINE}`);
18783
18783
  };
18784
18784
  }
18785
18785
  async function runPackageInit(args) {
18786
- const result = await createPackage({
18786
+ const result2 = await createPackage({
18787
18787
  parentDir: args.parentDir ?? process.cwd(),
18788
18788
  name: args.name,
18789
18789
  type: args.type ?? "plugin",
@@ -18791,9 +18791,9 @@ async function runPackageInit(args) {
18791
18791
  author: args.author,
18792
18792
  adapterType: args.adapterType
18793
18793
  });
18794
- console.log(`Created package at: ${result.packagePath}`);
18794
+ console.log(`Created package at: ${result2.packagePath}`);
18795
18795
  console.log("Files written:");
18796
- for (const file2 of result.filesWritten) {
18796
+ for (const file2 of result2.filesWritten) {
18797
18797
  console.log(` - ${file2}`);
18798
18798
  }
18799
18799
  }
@@ -18842,17 +18842,17 @@ function parseSkillFile(filePath, content, schema) {
18842
18842
  filePath
18843
18843
  };
18844
18844
  }
18845
- const result = schema.safeParse(data);
18846
- if (!result.success) {
18845
+ const result2 = schema.safeParse(data);
18846
+ if (!result2.success) {
18847
18847
  return {
18848
18848
  ok: false,
18849
- error: `Invalid frontmatter: ${result.error.message}`,
18849
+ error: `Invalid frontmatter: ${result2.error.message}`,
18850
18850
  filePath
18851
18851
  };
18852
18852
  }
18853
18853
  const dirPath = path2.dirname(filePath);
18854
18854
  const dirName = path2.basename(dirPath);
18855
- const meta3 = result.data;
18855
+ const meta3 = result2.data;
18856
18856
  if (typeof meta3.name === "string" && meta3.name !== dirName) {
18857
18857
  return {
18858
18858
  ok: false,
@@ -18864,7 +18864,7 @@ function parseSkillFile(filePath, content, schema) {
18864
18864
  ok: true,
18865
18865
  definition: {
18866
18866
  name: dirName,
18867
- meta: result.data,
18867
+ meta: result2.data,
18868
18868
  body,
18869
18869
  filePath,
18870
18870
  dirPath
@@ -19246,14 +19246,14 @@ function parseMarketplaceJson(content) {
19246
19246
  error: `Invalid JSON: ${err instanceof Error ? err.message : String(err)}`
19247
19247
  };
19248
19248
  }
19249
- const result = MarketplaceJsonSchema.safeParse(parsed);
19250
- if (!result.success) {
19249
+ const result2 = MarketplaceJsonSchema.safeParse(parsed);
19250
+ if (!result2.success) {
19251
19251
  return {
19252
19252
  ok: false,
19253
- error: `marketplace.json validation failed: ${formatZodIssues(result.error.issues)}`
19253
+ error: `marketplace.json validation failed: ${formatZodIssues(result2.error.issues)}`
19254
19254
  };
19255
19255
  }
19256
- return { ok: true, marketplace: result.data };
19256
+ return { ok: true, marketplace: result2.data };
19257
19257
  }
19258
19258
  function parseDorkosSidecar(content) {
19259
19259
  let parsed;
@@ -19265,34 +19265,45 @@ function parseDorkosSidecar(content) {
19265
19265
  error: `Invalid JSON: ${err instanceof Error ? err.message : String(err)}`
19266
19266
  };
19267
19267
  }
19268
- const result = DorkosSidecarSchema.safeParse(parsed);
19269
- if (!result.success) {
19268
+ const result2 = DorkosSidecarSchema.safeParse(parsed);
19269
+ if (!result2.success) {
19270
19270
  return {
19271
19271
  ok: false,
19272
- error: `dorkos.json validation failed: ${formatZodIssues(result.error.issues)}`
19272
+ error: `dorkos.json validation failed: ${formatZodIssues(result2.error.issues)}`
19273
19273
  };
19274
19274
  }
19275
- return { ok: true, sidecar: result.data };
19275
+ return { ok: true, sidecar: result2.data };
19276
19276
  }
19277
19277
  function formatZodIssues(issues) {
19278
19278
  return issues.map((i2) => `${i2.path.join(".") || "<root>"}: ${i2.message}`).join("; ");
19279
19279
  }
19280
+ var LenientMarketplaceEnvelopeSchema, LenientPluginEntrySchema;
19280
19281
  var init_marketplace_json_parser = __esm({
19281
19282
  "../marketplace/dist/marketplace-json-parser.js"() {
19282
19283
  "use strict";
19284
+ init_zod2();
19283
19285
  init_marketplace_json_schema();
19284
19286
  init_dorkos_sidecar_schema();
19285
19287
  init_merge_marketplace();
19288
+ LenientMarketplaceEnvelopeSchema = external_exports2.object({
19289
+ name: external_exports2.string().min(1).regex(/^[a-z0-9][a-z0-9.-]*$/, "Must be kebab-case (letters, digits, dots, hyphens)"),
19290
+ owner: OwnerSchema,
19291
+ metadata: MetadataSchema.optional(),
19292
+ plugins: external_exports2.array(external_exports2.unknown())
19293
+ }).passthrough();
19294
+ LenientPluginEntrySchema = MarketplaceJsonEntrySchema.extend({
19295
+ name: external_exports2.string().min(1).regex(/^[a-z0-9][a-z0-9.-]*$/, "Must be kebab-case (letters, digits, dots, hyphens)")
19296
+ });
19286
19297
  }
19287
19298
  });
19288
19299
 
19289
19300
  // ../marketplace/dist/cc-validator.js
19290
19301
  function validateAgainstCcSchema(raw) {
19291
- const result = CcMarketplaceJsonSchema.safeParse(raw);
19292
- if (result.success) {
19302
+ const result2 = CcMarketplaceJsonSchema.safeParse(raw);
19303
+ if (result2.success) {
19293
19304
  return { ok: true };
19294
19305
  }
19295
- return { ok: false, errors: result.error.issues };
19306
+ return { ok: false, errors: result2.error.issues };
19296
19307
  }
19297
19308
  var CcSourceSchema, CcAuthorSchema, CcOwnerSchema, CcMetadataSchema, CcMarketplaceJsonEntrySchema, CcMarketplaceJsonSchema;
19298
19309
  var init_cc_validator = __esm({
@@ -19422,17 +19433,17 @@ async function validateSkillsInDirectory(fullDir, packagePath, issues) {
19422
19433
  const scanResults = await scanSkillDirectory(fullDir, PermissiveSkillFrontmatterSchema, {
19423
19434
  includeMissing: false
19424
19435
  });
19425
- for (const result of scanResults) {
19426
- if (!result.ok) {
19436
+ for (const result2 of scanResults) {
19437
+ if (!result2.ok) {
19427
19438
  issues.push({
19428
19439
  level: "error",
19429
19440
  code: "SKILL_INVALID",
19430
- message: result.error,
19431
- path: path5.relative(packagePath, result.filePath)
19441
+ message: result2.error,
19442
+ path: path5.relative(packagePath, result2.filePath)
19432
19443
  });
19433
19444
  continue;
19434
19445
  }
19435
- const { dirPath, filePath } = result.definition;
19446
+ const { dirPath, filePath } = result2.definition;
19436
19447
  const structureResult = await validateSkillStructure(dirPath);
19437
19448
  if (!structureResult.valid) {
19438
19449
  for (const err of structureResult.errors) {
@@ -19478,22 +19489,22 @@ __export(package_validate_command_exports, {
19478
19489
  import path6 from "node:path";
19479
19490
  async function runPackageValidate(args) {
19480
19491
  const packagePath = path6.resolve(args.packagePath ?? process.cwd());
19481
- const result = await validatePackage(packagePath);
19482
- if (result.manifest) {
19492
+ const result2 = await validatePackage(packagePath);
19493
+ if (result2.manifest) {
19483
19494
  console.log(
19484
- `Package: ${result.manifest.name}@${result.manifest.version} (${result.manifest.type})`
19495
+ `Package: ${result2.manifest.name}@${result2.manifest.version} (${result2.manifest.type})`
19485
19496
  );
19486
19497
  }
19487
- if (result.issues.length === 0) {
19498
+ if (result2.issues.length === 0) {
19488
19499
  console.log("\u2713 Package is valid");
19489
19500
  return 0;
19490
19501
  }
19491
- for (const issue2 of result.issues) {
19502
+ for (const issue2 of result2.issues) {
19492
19503
  const prefix = issue2.level === "error" ? "\u2717" : "\u26A0";
19493
19504
  const location = issue2.path ? ` (${issue2.path})` : "";
19494
19505
  console.log(`${prefix} [${issue2.code}] ${issue2.message}${location}`);
19495
19506
  }
19496
- if (result.ok) {
19507
+ if (result2.ok) {
19497
19508
  console.log("\u2713 Package is valid (with warnings)");
19498
19509
  return 0;
19499
19510
  }
@@ -19553,16 +19564,16 @@ function resolveRelativePath(source, context) {
19553
19564
  throw new ResolvePluginSourceError('Relative paths must not contain ".."');
19554
19565
  }
19555
19566
  const startsWithDotSlash = source.startsWith("./");
19556
- let path14;
19567
+ let path15;
19557
19568
  if (startsWithDotSlash) {
19558
- path14 = stripLeadingDotSlash(source);
19569
+ path15 = stripLeadingDotSlash(source);
19559
19570
  } else {
19560
19571
  const pluginRoot = normalizePluginRoot(context.pluginRoot);
19561
- path14 = pluginRoot ? `${pluginRoot}/${source}` : source;
19572
+ path15 = pluginRoot ? `${pluginRoot}/${source}` : source;
19562
19573
  }
19563
19574
  return {
19564
19575
  type: "relative-path",
19565
- path: path14,
19576
+ path: path15,
19566
19577
  marketplaceRoot: context.marketplaceRoot
19567
19578
  };
19568
19579
  }
@@ -20181,14 +20192,14 @@ async function runCacheList() {
20181
20192
  async function runCachePrune(args) {
20182
20193
  try {
20183
20194
  const body = args.keepLastN !== void 0 ? { keepLastN: args.keepLastN } : {};
20184
- const result = await apiCall("POST", "/api/marketplace/cache/prune", body);
20185
- const count = result.removed.length;
20195
+ const result2 = await apiCall("POST", "/api/marketplace/cache/prune", body);
20196
+ const count = result2.removed.length;
20186
20197
  if (count === 0) {
20187
20198
  console.log("Nothing to prune \u2014 cache is already minimal.");
20188
20199
  return 0;
20189
20200
  }
20190
20201
  const noun = count === 1 ? "package" : "packages";
20191
- console.log(`Pruned ${count} cached ${noun}, freed ${formatBytes(result.freedBytes)}.`);
20202
+ console.log(`Pruned ${count} cached ${noun}, freed ${formatBytes(result2.freedBytes)}.`);
20192
20203
  return 0;
20193
20204
  } catch (err) {
20194
20205
  if (err instanceof ApiError) {
@@ -20453,14 +20464,14 @@ async function runInstall(args) {
20453
20464
  return 0;
20454
20465
  }
20455
20466
  }
20456
- const result = await apiCall(
20467
+ const result2 = await apiCall(
20457
20468
  "POST",
20458
20469
  `/api/marketplace/packages/${encodeURIComponent(args.name)}/install`,
20459
20470
  buildRequestBody(args)
20460
20471
  );
20461
- console.log(`Installed ${result.packageName}@${result.version} to ${result.installPath}`);
20462
- if (result.warnings && result.warnings.length > 0) {
20463
- for (const warning of result.warnings) {
20472
+ console.log(`Installed ${result2.packageName}@${result2.version} to ${result2.installPath}`);
20473
+ if (result2.warnings && result2.warnings.length > 0) {
20474
+ for (const warning of result2.warnings) {
20464
20475
  console.log(` warning: ${warning}`);
20465
20476
  }
20466
20477
  }
@@ -20551,16 +20562,16 @@ async function runUninstall(args) {
20551
20562
  const body = {};
20552
20563
  if (args.purge) body.purge = true;
20553
20564
  if (args.projectPath) body.projectPath = args.projectPath;
20554
- const result = await apiCall(
20565
+ const result2 = await apiCall(
20555
20566
  "POST",
20556
20567
  `/api/marketplace/packages/${encodeURIComponent(args.name)}/uninstall`,
20557
20568
  body
20558
20569
  );
20559
- console.log(`Uninstalled ${result.packageName} (${result.removedFiles} entries removed)`);
20560
- if (!args.purge && result.preservedData.length > 0) {
20570
+ console.log(`Uninstalled ${result2.packageName} (${result2.removedFiles} entries removed)`);
20571
+ if (!args.purge && result2.preservedData.length > 0) {
20561
20572
  console.log("Preserved:");
20562
- for (const path14 of result.preservedData) {
20563
- console.log(` ${path14}`);
20573
+ for (const path15 of result2.preservedData) {
20574
+ console.log(` ${path15}`);
20564
20575
  }
20565
20576
  }
20566
20577
  return 0;
@@ -20629,13 +20640,13 @@ async function runUpdate(args) {
20629
20640
  for (const name of targets) {
20630
20641
  const body = { apply: Boolean(args.apply) };
20631
20642
  if (args.projectPath) body.projectPath = args.projectPath;
20632
- const result = await apiCall(
20643
+ const result2 = await apiCall(
20633
20644
  "POST",
20634
20645
  `/api/marketplace/packages/${encodeURIComponent(name)}/update`,
20635
20646
  body
20636
20647
  );
20637
- allChecks.push(...result.checks);
20638
- allApplied.push(...result.applied);
20648
+ allChecks.push(...result2.checks);
20649
+ allApplied.push(...result2.applied);
20639
20650
  }
20640
20651
  renderUpdateChecks(allChecks, Boolean(args.apply));
20641
20652
  if (args.apply && allApplied.length > 0) {
@@ -20945,11 +20956,11 @@ function countPackages(marketplace) {
20945
20956
  return 0;
20946
20957
  }
20947
20958
  async function refreshOne(name) {
20948
- const result = await apiCall(
20959
+ const result2 = await apiCall(
20949
20960
  "POST",
20950
20961
  `/api/marketplace/sources/${encodeURIComponent(name)}/refresh`
20951
20962
  );
20952
- return countPackages(result.marketplace);
20963
+ return countPackages(result2.marketplace);
20953
20964
  }
20954
20965
  function formatSuccess(name, count) {
20955
20966
  return `Refreshed ${name}: ${count} ${count === 1 ? "package" : "packages"}.`;
@@ -21174,20 +21185,20 @@ var require_file_uri_to_path = __commonJS({
21174
21185
  var rest = decodeURI(uri.substring(7));
21175
21186
  var firstSlash = rest.indexOf("/");
21176
21187
  var host = rest.substring(0, firstSlash);
21177
- var path14 = rest.substring(firstSlash + 1);
21188
+ var path15 = rest.substring(firstSlash + 1);
21178
21189
  if ("localhost" == host) host = "";
21179
21190
  if (host) {
21180
21191
  host = sep2 + sep2 + host;
21181
21192
  }
21182
- path14 = path14.replace(/^(.+)\|/, "$1:");
21193
+ path15 = path15.replace(/^(.+)\|/, "$1:");
21183
21194
  if (sep2 == "\\") {
21184
- path14 = path14.replace(/\//g, "\\");
21195
+ path15 = path15.replace(/\//g, "\\");
21185
21196
  }
21186
- if (/^.+\:/.test(path14)) {
21197
+ if (/^.+\:/.test(path15)) {
21187
21198
  } else {
21188
- path14 = sep2 + path14;
21199
+ path15 = sep2 + path15;
21189
21200
  }
21190
- return host + path14;
21201
+ return host + path15;
21191
21202
  }
21192
21203
  }
21193
21204
  });
@@ -21196,18 +21207,18 @@ var require_file_uri_to_path = __commonJS({
21196
21207
  var require_bindings = __commonJS({
21197
21208
  "../../node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js"(exports, module) {
21198
21209
  var fs10 = __require("fs");
21199
- var path14 = __require("path");
21200
- var fileURLToPath2 = require_file_uri_to_path();
21201
- var join2 = path14.join;
21202
- var dirname2 = path14.dirname;
21203
- var exists = fs10.accessSync && function(path15) {
21210
+ var path15 = __require("path");
21211
+ var fileURLToPath3 = require_file_uri_to_path();
21212
+ var join2 = path15.join;
21213
+ var dirname2 = path15.dirname;
21214
+ var exists = fs10.accessSync && function(path16) {
21204
21215
  try {
21205
- fs10.accessSync(path15);
21216
+ fs10.accessSync(path16);
21206
21217
  } catch (e2) {
21207
21218
  return false;
21208
21219
  }
21209
21220
  return true;
21210
- } || fs10.existsSync || path14.existsSync;
21221
+ } || fs10.existsSync || path15.existsSync;
21211
21222
  var defaults = {
21212
21223
  arrow: process.env.NODE_BINDINGS_ARROW || " \u2192 ",
21213
21224
  compiled: process.env.NODE_BINDINGS_COMPILED_DIR || "compiled",
@@ -21252,7 +21263,7 @@ var require_bindings = __commonJS({
21252
21263
  if (!opts.module_root) {
21253
21264
  opts.module_root = exports.getRoot(exports.getFileName());
21254
21265
  }
21255
- if (path14.extname(opts.bindings) != ".node") {
21266
+ if (path15.extname(opts.bindings) != ".node") {
21256
21267
  opts.bindings += ".node";
21257
21268
  }
21258
21269
  var requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
@@ -21309,7 +21320,7 @@ var require_bindings = __commonJS({
21309
21320
  Error.stackTraceLimit = origSTL;
21310
21321
  var fileSchema = "file://";
21311
21322
  if (fileName.indexOf(fileSchema) === 0) {
21312
- fileName = fileURLToPath2(fileName);
21323
+ fileName = fileURLToPath3(fileName);
21313
21324
  }
21314
21325
  return fileName;
21315
21326
  };
@@ -21453,12 +21464,12 @@ var require_transaction = __commonJS({
21453
21464
  }
21454
21465
  before.run();
21455
21466
  try {
21456
- const result = apply.call(fn, this, arguments);
21457
- if (result && typeof result.then === "function") {
21467
+ const result2 = apply.call(fn, this, arguments);
21468
+ if (result2 && typeof result2.then === "function") {
21458
21469
  throw new TypeError("Transaction function cannot return a promise");
21459
21470
  }
21460
21471
  after.run();
21461
- return result;
21472
+ return result2;
21462
21473
  } catch (ex) {
21463
21474
  if (db.inTransaction) {
21464
21475
  undo.run();
@@ -21491,7 +21502,7 @@ var require_backup = __commonJS({
21491
21502
  "../../node_modules/.pnpm/better-sqlite3@12.8.0/node_modules/better-sqlite3/lib/methods/backup.js"(exports, module) {
21492
21503
  "use strict";
21493
21504
  var fs10 = __require("fs");
21494
- var path14 = __require("path");
21505
+ var path15 = __require("path");
21495
21506
  var { promisify } = __require("util");
21496
21507
  var { cppdb } = require_util();
21497
21508
  var fsAccess = promisify(fs10.access);
@@ -21507,7 +21518,7 @@ var require_backup = __commonJS({
21507
21518
  if (typeof attachedName !== "string") throw new TypeError('Expected the "attached" option to be a string');
21508
21519
  if (!attachedName) throw new TypeError('The "attached" option cannot be an empty string');
21509
21520
  if (handler != null && typeof handler !== "function") throw new TypeError('Expected the "progress" option to be a function');
21510
- await fsAccess(path14.dirname(filename)).catch(() => {
21521
+ await fsAccess(path15.dirname(filename)).catch(() => {
21511
21522
  throw new TypeError("Cannot save backup because the directory does not exist");
21512
21523
  });
21513
21524
  const isNewFile = await fsAccess(filename).then(() => false, () => true);
@@ -21606,7 +21617,7 @@ var require_aggregate = __commonJS({
21606
21617
  const start = "start" in options ? options.start : null;
21607
21618
  const step = getFunctionOption(options, "step", true);
21608
21619
  const inverse = getFunctionOption(options, "inverse", false);
21609
- const result = getFunctionOption(options, "result", false);
21620
+ const result2 = getFunctionOption(options, "result", false);
21610
21621
  const safeIntegers = "safeIntegers" in options ? +getBooleanOption(options, "safeIntegers") : 2;
21611
21622
  const deterministic = getBooleanOption(options, "deterministic");
21612
21623
  const directOnly = getBooleanOption(options, "directOnly");
@@ -21617,7 +21628,7 @@ var require_aggregate = __commonJS({
21617
21628
  if (argCount > 0) argCount -= 1;
21618
21629
  if (argCount > 100) throw new RangeError("User-defined functions cannot have more than 100 arguments");
21619
21630
  }
21620
- this[cppdb].aggregate(start, step, inverse, result, name, argCount, safeIntegers, deterministic, directOnly);
21631
+ this[cppdb].aggregate(start, step, inverse, result2, name, argCount, safeIntegers, deterministic, directOnly);
21621
21632
  return this;
21622
21633
  };
21623
21634
  var getFunctionOption = (options, key, required2) => {
@@ -21813,7 +21824,7 @@ var require_database = __commonJS({
21813
21824
  "../../node_modules/.pnpm/better-sqlite3@12.8.0/node_modules/better-sqlite3/lib/database.js"(exports, module) {
21814
21825
  "use strict";
21815
21826
  var fs10 = __require("fs");
21816
- var path14 = __require("path");
21827
+ var path15 = __require("path");
21817
21828
  var util2 = require_util();
21818
21829
  var SqliteError = require_sqlite_error();
21819
21830
  var DEFAULT_ADDON;
@@ -21849,7 +21860,7 @@ var require_database = __commonJS({
21849
21860
  addon = DEFAULT_ADDON || (DEFAULT_ADDON = require_bindings()("better_sqlite3.node"));
21850
21861
  } else if (typeof nativeBinding === "string") {
21851
21862
  const requireFunc = typeof __non_webpack_require__ === "function" ? __non_webpack_require__ : __require;
21852
- addon = requireFunc(path14.resolve(nativeBinding).replace(/(\.node)?$/, ".node"));
21863
+ addon = requireFunc(path15.resolve(nativeBinding).replace(/(\.node)?$/, ".node"));
21853
21864
  } else {
21854
21865
  addon = nativeBinding;
21855
21866
  }
@@ -21857,7 +21868,7 @@ var require_database = __commonJS({
21857
21868
  addon.setErrorConstructor(SqliteError);
21858
21869
  addon.isInitialized = true;
21859
21870
  }
21860
- if (!anonymous && !filename.startsWith("file:") && !fs10.existsSync(path14.dirname(filename))) {
21871
+ if (!anonymous && !filename.startsWith("file:") && !fs10.existsSync(path15.dirname(filename))) {
21861
21872
  throw new TypeError("Cannot open database because the directory does not exist");
21862
21873
  }
21863
21874
  Object.defineProperties(this, {
@@ -22917,20 +22928,20 @@ function requireSrc() {
22917
22928
  function requirePicocolors() {
22918
22929
  if (hasRequiredPicocolors) return picocolors.exports;
22919
22930
  hasRequiredPicocolors = 1;
22920
- let p = process || {}, argv2 = p.argv || [], env3 = p.env || {};
22921
- let isColorSupported2 = !(!!env3.NO_COLOR || argv2.includes("--no-color")) && (!!env3.FORCE_COLOR || argv2.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env3.TERM !== "dumb" || !!env3.CI);
22931
+ let p = process || {}, argv2 = p.argv || [], env4 = p.env || {};
22932
+ let isColorSupported2 = !(!!env4.NO_COLOR || argv2.includes("--no-color")) && (!!env4.FORCE_COLOR || argv2.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env4.TERM !== "dumb" || !!env4.CI);
22922
22933
  let formatter = (open, close, replace = open) => (input2) => {
22923
22934
  let string4 = "" + input2, index = string4.indexOf(close, open.length);
22924
22935
  return ~index ? open + replaceClose2(string4, close, replace, index) + close : open + string4 + close;
22925
22936
  };
22926
22937
  let replaceClose2 = (string4, close, replace, index) => {
22927
- let result = "", cursor = 0;
22938
+ let result2 = "", cursor = 0;
22928
22939
  do {
22929
- result += string4.substring(cursor, index) + replace;
22940
+ result2 += string4.substring(cursor, index) + replace;
22930
22941
  cursor = index + close.length;
22931
22942
  index = string4.indexOf(close, cursor);
22932
22943
  } while (~index);
22933
- return result + string4.substring(cursor);
22944
+ return result2 + string4.substring(cursor);
22934
22945
  };
22935
22946
  let createColors2 = (enabled = isColorSupported2) => {
22936
22947
  let f3 = enabled ? formatter : () => String;
@@ -23699,12 +23710,12 @@ function stringWidth$1(string4, options = {}) {
23699
23710
  return width;
23700
23711
  }
23701
23712
  function isUnicodeSupported() {
23702
- const { env: env3 } = g$1;
23703
- const { TERM, TERM_PROGRAM } = env3;
23713
+ const { env: env4 } = g$1;
23714
+ const { TERM, TERM_PROGRAM } = env4;
23704
23715
  if (g$1.platform !== "win32") {
23705
23716
  return TERM !== "linux";
23706
23717
  }
23707
- return Boolean(env3.WT_SESSION) || Boolean(env3.TERMINUS_SUBLIME) || env3.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env3.TERMINAL_EMULATOR === "JetBrains-JediTerm";
23718
+ return Boolean(env4.WT_SESSION) || Boolean(env4.TERMINUS_SUBLIME) || env4.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env4.TERMINAL_EMULATOR === "JetBrains-JediTerm";
23708
23719
  }
23709
23720
  function stringWidth(str) {
23710
23721
  const hasICU = typeof Intl === "object";
@@ -23909,6 +23920,84 @@ var init_logger = __esm({
23909
23920
  }
23910
23921
  });
23911
23922
 
23923
+ // ../../apps/server/src/env.ts
23924
+ var boolFlag, serverEnvSchema, result, env3;
23925
+ var init_env = __esm({
23926
+ "../../apps/server/src/env.ts"() {
23927
+ "use strict";
23928
+ init_zod();
23929
+ boolFlag = external_exports.enum(["true", "false"]).default("false").transform((v2) => v2 === "true");
23930
+ serverEnvSchema = external_exports.object({
23931
+ // System
23932
+ HOME: external_exports.string().optional(),
23933
+ GITHUB_TOKEN: external_exports.string().optional(),
23934
+ // Runtime
23935
+ NODE_ENV: external_exports.enum(["development", "production", "test"]).default("development"),
23936
+ DORKOS_PORT: external_exports.coerce.number().int().min(1).max(65535).default(4242),
23937
+ DORKOS_HOST: external_exports.string().default("localhost"),
23938
+ DORKOS_DEFAULT_CWD: external_exports.string().optional(),
23939
+ DORKOS_BOUNDARY: external_exports.string().optional(),
23940
+ DORKOS_LOG_LEVEL: external_exports.coerce.number().int().min(0).max(5).optional(),
23941
+ DORK_HOME: external_exports.string().optional(),
23942
+ DORKOS_VERSION_OVERRIDE: external_exports.string().optional(),
23943
+ CLIENT_DIST_PATH: external_exports.string().optional(),
23944
+ // MCP external server — optional API key for authenticated access
23945
+ MCP_API_KEY: external_exports.string().optional(),
23946
+ // Marketplace MCP — when '1', auto-approves every install/uninstall/create
23947
+ // confirmation request without prompting the user. Used by CI and tests.
23948
+ MARKETPLACE_AUTO_APPROVE: external_exports.string().optional(),
23949
+ // Feature flags (boolean after transform)
23950
+ DORKOS_A2A_ENABLED: boolFlag,
23951
+ DORKOS_TASKS_ENABLED: boolFlag,
23952
+ DORKOS_RELAY_ENABLED: boolFlag,
23953
+ // Activity feed — retention period for pruning (defaults to 30 days in service)
23954
+ DORKOS_ACTIVITY_RETENTION_DAYS: external_exports.coerce.number().int().min(1).optional(),
23955
+ // Test mode — TestModeRuntime is registered instead of ClaudeCodeRuntime
23956
+ DORKOS_TEST_RUNTIME: external_exports.string().optional().transform((v2) => v2 === "true"),
23957
+ // Tunnel (ngrok integration — all optional)
23958
+ TUNNEL_ENABLED: boolFlag,
23959
+ TUNNEL_PORT: external_exports.coerce.number().int().min(1).max(65535).optional(),
23960
+ TUNNEL_AUTH: external_exports.string().optional(),
23961
+ TUNNEL_DOMAIN: external_exports.string().optional(),
23962
+ NGROK_AUTHTOKEN: external_exports.string().optional()
23963
+ });
23964
+ result = serverEnvSchema.safeParse(process.env);
23965
+ if (!result.success) {
23966
+ console.error("\n Missing or invalid environment variables:\n");
23967
+ result.error.issues.forEach((i2) => console.error(` - ${i2.path.join(".")}: ${i2.message}`));
23968
+ console.error("\n Copy .env.example to .env\n");
23969
+ process.exit(1);
23970
+ }
23971
+ env3 = result.data;
23972
+ }
23973
+ });
23974
+
23975
+ // ../../apps/server/src/lib/version.ts
23976
+ import { readFileSync } from "fs";
23977
+ import path11 from "path";
23978
+ import { fileURLToPath } from "url";
23979
+ function resolveVersion() {
23980
+ if (env3.DORKOS_VERSION_OVERRIDE) return env3.DORKOS_VERSION_OVERRIDE;
23981
+ if (true) return "0.35.0";
23982
+ const pkgPath = path11.join(path11.dirname(fileURLToPath(import.meta.url)), "../../package.json");
23983
+ return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
23984
+ }
23985
+ function checkDevBuild(version2) {
23986
+ if (env3.DORKOS_VERSION_OVERRIDE) return false;
23987
+ if (true) return false;
23988
+ return DEV_VERSION_PATTERN.test(version2);
23989
+ }
23990
+ var DEV_VERSION_PATTERN, SERVER_VERSION, IS_DEV_BUILD;
23991
+ var init_version = __esm({
23992
+ "../../apps/server/src/lib/version.ts"() {
23993
+ "use strict";
23994
+ init_env();
23995
+ DEV_VERSION_PATTERN = /^0\.0\.0/;
23996
+ SERVER_VERSION = resolveVersion();
23997
+ IS_DEV_BUILD = checkDevBuild(SERVER_VERSION);
23998
+ }
23999
+ });
24000
+
23912
24001
  // ../../apps/server/src/services/core/config-manager.ts
23913
24002
  var config_manager_exports = {};
23914
24003
  __export(config_manager_exports, {
@@ -23917,17 +24006,25 @@ __export(config_manager_exports, {
23917
24006
  });
23918
24007
  import Conf from "conf";
23919
24008
  import fs7 from "fs";
23920
- import path11 from "path";
24009
+ import path12 from "path";
23921
24010
  function initConfigManager(dorkHome) {
23922
24011
  configManager = new ConfigManager(dorkHome);
23923
24012
  return configManager;
23924
24013
  }
23925
- var jsonSchemaFull, jsonSchemaProperties, confSchema, ConfigManager, configManager;
24014
+ var CONFIG_MIGRATIONS, jsonSchemaFull, jsonSchemaProperties, confSchema, ConfigManager, configManager;
23926
24015
  var init_config_manager = __esm({
23927
24016
  "../../apps/server/src/services/core/config-manager.ts"() {
23928
24017
  init_zod();
23929
24018
  init_config_schema();
23930
24019
  init_logger();
24020
+ init_version();
24021
+ CONFIG_MIGRATIONS = {
24022
+ "1.0.0": (store) => {
24023
+ if (!store.has("version")) {
24024
+ store.set("version", 1);
24025
+ }
24026
+ }
24027
+ };
23931
24028
  jsonSchemaFull = external_exports.toJSONSchema(UserConfigSchema, {
23932
24029
  target: "jsonSchema2019-09"
23933
24030
  });
@@ -23938,24 +24035,24 @@ var init_config_manager = __esm({
23938
24035
  _isFirstRun = false;
23939
24036
  constructor(dorkHome) {
23940
24037
  const configDir = dorkHome;
23941
- const configPath = path11.join(configDir, "config.json");
24038
+ const configPath = path12.join(configDir, "config.json");
23942
24039
  this._isFirstRun = !fs7.existsSync(configPath);
24040
+ const confOptions = {
24041
+ configName: "config",
24042
+ cwd: configDir,
24043
+ schema: confSchema,
24044
+ defaults: USER_CONFIG_DEFAULTS,
24045
+ clearInvalidConfig: false,
24046
+ // `projectVersion` is the app version — sourced from the canonical
24047
+ // version resolver (`lib/version.ts`) which honors
24048
+ // `DORKOS_VERSION_OVERRIDE`, the esbuild-injected CLI version, and the
24049
+ // package.json dev fallback in that order. Migration keys in
24050
+ // CONFIG_MIGRATIONS must be semver strings matching real releases.
24051
+ projectVersion: SERVER_VERSION,
24052
+ migrations: CONFIG_MIGRATIONS
24053
+ };
23943
24054
  try {
23944
- this.store = new Conf({
23945
- configName: "config",
23946
- cwd: configDir,
23947
- schema: confSchema,
23948
- defaults: USER_CONFIG_DEFAULTS,
23949
- clearInvalidConfig: false,
23950
- projectVersion: "1.0.0",
23951
- migrations: {
23952
- "1.0.0": (store) => {
23953
- if (!store.has("version")) {
23954
- store.set("version", 1);
23955
- }
23956
- }
23957
- }
23958
- });
24055
+ this.store = new Conf(confOptions);
23959
24056
  logger.info(`[Config] Loaded from ${configPath} (first run: ${this._isFirstRun})`);
23960
24057
  } catch (_error) {
23961
24058
  if (fs7.existsSync(configPath)) {
@@ -23965,13 +24062,7 @@ var init_config_manager = __esm({
23965
24062
  logger.warn(`Corrupt config backed up to ${backupPath}`);
23966
24063
  logger.warn("Creating fresh config with defaults.");
23967
24064
  }
23968
- this.store = new Conf({
23969
- configName: "config",
23970
- cwd: configDir,
23971
- schema: confSchema,
23972
- defaults: USER_CONFIG_DEFAULTS,
23973
- clearInvalidConfig: false
23974
- });
24065
+ this.store = new Conf(confOptions);
23975
24066
  }
23976
24067
  }
23977
24068
  /** Whether this is the first time the config file has been created */
@@ -23992,12 +24083,12 @@ var init_config_manager = __esm({
23992
24083
  }
23993
24084
  /** Set a nested value via dot-path. Returns warning if key is sensitive. */
23994
24085
  setDot(key, value) {
23995
- const result = {};
24086
+ const result2 = {};
23996
24087
  if (SENSITIVE_CONFIG_KEYS.includes(key)) {
23997
- result.warning = `'${key}' contains sensitive data. Consider using environment variables instead.`;
24088
+ result2.warning = `'${key}' contains sensitive data. Consider using environment variables instead.`;
23998
24089
  }
23999
24090
  this.store.set(key, value);
24000
- return result;
24091
+ return result2;
24001
24092
  }
24002
24093
  /** Get the full config object */
24003
24094
  getAll() {
@@ -24104,9 +24195,9 @@ function handleConfigGet(store, key) {
24104
24195
  }
24105
24196
  function handleConfigSet(store, key, rawValue) {
24106
24197
  const value = parseConfigValue(rawValue);
24107
- const result = store.setDot(key, value);
24108
- if (result.warning) {
24109
- console.warn(`\u26A0 ${result.warning}`);
24198
+ const result2 = store.setDot(key, value);
24199
+ if (result2.warning) {
24200
+ console.warn(`\u26A0 ${result2.warning}`);
24110
24201
  }
24111
24202
  console.log(`Set ${key} = ${value === null ? "null" : String(value)}`);
24112
24203
  }
@@ -24137,13 +24228,13 @@ function handleConfigPath(store) {
24137
24228
  console.log(store.path);
24138
24229
  }
24139
24230
  function handleConfigValidate(store) {
24140
- const result = store.validate();
24141
- if (result.valid) {
24231
+ const result2 = store.validate();
24232
+ if (result2.valid) {
24142
24233
  console.log("Config is valid");
24143
24234
  process.exit(0);
24144
24235
  } else {
24145
24236
  console.error("Config validation failed:");
24146
- for (const err of result.errors ?? []) {
24237
+ for (const err of result2.errors ?? []) {
24147
24238
  console.error(` - ${err}`);
24148
24239
  }
24149
24240
  process.exit(1);
@@ -24204,10 +24295,10 @@ __export(init_wizard_exports, {
24204
24295
  });
24205
24296
  import { input, select, confirm as confirm3 } from "@inquirer/prompts";
24206
24297
  import fs8 from "fs";
24207
- import path12 from "path";
24298
+ import path13 from "path";
24208
24299
  async function runInitWizard(options) {
24209
24300
  const { yes, dorkHome, store } = options;
24210
- const configPath = path12.join(dorkHome, "config.json");
24301
+ const configPath = path13.join(dorkHome, "config.json");
24211
24302
  if (yes) {
24212
24303
  store.reset();
24213
24304
  console.log(`Config initialized with defaults at ${configPath}`);
@@ -24257,7 +24348,7 @@ async function runInitWizard(options) {
24257
24348
  store.setDot("ui.theme", theme);
24258
24349
  store.setDot("tunnel.enabled", tunnelEnabled);
24259
24350
  if (cwd && cwd.trim() !== "") {
24260
- store.setDot("server.cwd", path12.resolve(cwd));
24351
+ store.setDot("server.cwd", path13.resolve(cwd));
24261
24352
  }
24262
24353
  console.log(`
24263
24354
  Config saved to ${configPath}`);
@@ -25428,8 +25519,8 @@ var require_main = __commonJS({
25428
25519
  // src/cli.ts
25429
25520
  import { parseArgs as parseArgs10 } from "node:util";
25430
25521
  import os3, { networkInterfaces } from "os";
25431
- import path13 from "path";
25432
- import { fileURLToPath } from "url";
25522
+ import path14 from "path";
25523
+ import { fileURLToPath as fileURLToPath2 } from "url";
25433
25524
  import fs9 from "fs";
25434
25525
 
25435
25526
  // src/check-claude.ts
@@ -25686,7 +25777,7 @@ if (nodeVersionIssue) {
25686
25777
  console.error(formatDiagnostic(nodeVersionIssue));
25687
25778
  process.exit(1);
25688
25779
  }
25689
- var __dirname = path13.dirname(fileURLToPath(import.meta.url));
25780
+ var __dirname = path14.dirname(fileURLToPath2(import.meta.url));
25690
25781
  if (process.argv[2] === "package") {
25691
25782
  const packageSubcommand = process.argv[3];
25692
25783
  const subArgs = process.argv.slice(4);
@@ -25930,12 +26021,12 @@ Examples:
25930
26021
  process.exit(0);
25931
26022
  }
25932
26023
  if (values.version) {
25933
- console.log("0.34.1");
26024
+ console.log("0.35.0");
25934
26025
  process.exit(0);
25935
26026
  }
25936
26027
  if (values["post-install-check"]) {
25937
26028
  const claudeFound = checkClaude();
25938
- console.log(`dorkos ${"0.34.1"}`);
26029
+ console.log(`dorkos ${"0.35.0"}`);
25939
26030
  if (claudeFound) {
25940
26031
  console.log("Installation verified.");
25941
26032
  } else {
@@ -25944,7 +26035,7 @@ if (values["post-install-check"]) {
25944
26035
  }
25945
26036
  process.exit(0);
25946
26037
  }
25947
- var DORK_HOME = env.DORK_HOME || path13.join(os3.homedir(), ".dork");
26038
+ var DORK_HOME = env.DORK_HOME || path14.join(os3.homedir(), ".dork");
25948
26039
  var subcommand = positionals[0];
25949
26040
  if (subcommand === "cleanup") {
25950
26041
  const { runCleanup: runCleanup2 } = await Promise.resolve().then(() => (init_cleanup_command(), cleanup_command_exports));
@@ -25952,7 +26043,7 @@ if (subcommand === "cleanup") {
25952
26043
  process.exit(process.exitCode ?? 0);
25953
26044
  }
25954
26045
  fs9.mkdirSync(DORK_HOME, { recursive: true });
25955
- fs9.mkdirSync(path13.join(DORK_HOME, "logs"), { recursive: true });
26046
+ fs9.mkdirSync(path14.join(DORK_HOME, "logs"), { recursive: true });
25956
26047
  process.env.DORK_HOME = DORK_HOME;
25957
26048
  if (subcommand === "config") {
25958
26049
  const { initConfigManager: initConfigManager3 } = await Promise.resolve().then(() => (init_config_manager(), config_manager_exports));
@@ -25982,7 +26073,7 @@ if (cliPort) {
25982
26073
  process.env.DORKOS_PORT = configPort ? String(configPort) : String(DEFAULT_PORT);
25983
26074
  }
25984
26075
  process.env.NODE_ENV = "production";
25985
- process.env.CLIENT_DIST_PATH = path13.join(__dirname, "../client");
26076
+ process.env.CLIENT_DIST_PATH = path14.join(__dirname, "../client");
25986
26077
  if (values.tunnel) {
25987
26078
  process.env.TUNNEL_ENABLED = "true";
25988
26079
  } else if (!process.env.TUNNEL_ENABLED && cfgMgr.getDot("tunnel.enabled")) {
@@ -26021,30 +26112,30 @@ if (!process.env.DORKOS_RELAY_ENABLED && cfgMgr.getDot("relay.enabled")) {
26021
26112
  }
26022
26113
  var cliDir = values.dir;
26023
26114
  if (cliDir) {
26024
- process.env.DORKOS_DEFAULT_CWD = path13.resolve(cliDir);
26115
+ process.env.DORKOS_DEFAULT_CWD = path14.resolve(cliDir);
26025
26116
  } else if (!process.env.DORKOS_DEFAULT_CWD) {
26026
26117
  const configCwd = cfgMgr.getDot("server.cwd");
26027
- process.env.DORKOS_DEFAULT_CWD = configCwd ? path13.resolve(configCwd) : process.cwd();
26118
+ process.env.DORKOS_DEFAULT_CWD = configCwd ? path14.resolve(configCwd) : process.cwd();
26028
26119
  }
26029
26120
  var cliBoundary = values.boundary;
26030
26121
  if (cliBoundary) {
26031
- process.env.DORKOS_BOUNDARY = path13.resolve(cliBoundary);
26122
+ process.env.DORKOS_BOUNDARY = path14.resolve(cliBoundary);
26032
26123
  } else if (!process.env.DORKOS_BOUNDARY) {
26033
26124
  const configBoundary = cfgMgr.getDot("server.boundary");
26034
26125
  if (configBoundary) {
26035
- process.env.DORKOS_BOUNDARY = path13.resolve(configBoundary);
26126
+ process.env.DORKOS_BOUNDARY = path14.resolve(configBoundary);
26036
26127
  }
26037
26128
  }
26038
26129
  var boundaryVal = process.env.DORKOS_BOUNDARY;
26039
26130
  var home = os3.homedir();
26040
- if (boundaryVal && !boundaryVal.startsWith(home + path13.sep) && boundaryVal !== home) {
26131
+ if (boundaryVal && !boundaryVal.startsWith(home + path14.sep) && boundaryVal !== home) {
26041
26132
  console.warn(
26042
26133
  `[Warning] Directory boundary "${boundaryVal}" is above home directory "${home}". This grants access to system directories.`
26043
26134
  );
26044
26135
  }
26045
26136
  var effectiveBoundary = process.env.DORKOS_BOUNDARY || home;
26046
26137
  var resolvedDir = process.env.DORKOS_DEFAULT_CWD;
26047
- if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBoundary + path13.sep)) {
26138
+ if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBoundary + path14.sep)) {
26048
26139
  console.warn(
26049
26140
  `[Warning] Default CWD "${resolvedDir}" is outside boundary "${effectiveBoundary}". Falling back to boundary root.`
26050
26141
  );
@@ -26052,7 +26143,7 @@ if (resolvedDir !== effectiveBoundary && !resolvedDir.startsWith(effectiveBounda
26052
26143
  }
26053
26144
  var logLevelName = values["log-level"] || env.LOG_LEVEL || cfgMgr.getDot("logging.level") || (env.NODE_ENV === "production" ? "info" : "debug");
26054
26145
  process.env.DORKOS_LOG_LEVEL = String(LOG_LEVEL_MAP[logLevelName] ?? 3);
26055
- var envPath = path13.join(process.env.DORKOS_DEFAULT_CWD, ".env");
26146
+ var envPath = path14.join(process.env.DORKOS_DEFAULT_CWD, ".env");
26056
26147
  if (fs9.existsSync(envPath)) {
26057
26148
  const dotenv = await import("dotenv");
26058
26149
  dotenv.config({ path: envPath, override: false });
@@ -26079,7 +26170,7 @@ var ansiReset = "\x1B[0m";
26079
26170
  console.log("");
26080
26171
  console.log(`${purple}${logo}${ansiReset}`);
26081
26172
  console.log("");
26082
- console.log(` DorkOS v${"0.34.1"}`);
26173
+ console.log(` DorkOS v${"0.35.0"}`);
26083
26174
  console.log(` Local: ${link(localUrl, localUrl)}`);
26084
26175
  var nets = networkInterfaces();
26085
26176
  var networkUrl = null;
@@ -26140,9 +26231,9 @@ if (shouldOpenBrowser && process.stdin.isTTY) {
26140
26231
  }
26141
26232
  });
26142
26233
  }
26143
- checkForUpdate("0.34.1").then((latestVersion) => {
26234
+ checkForUpdate("0.35.0").then((latestVersion) => {
26144
26235
  if (latestVersion) {
26145
- const msg = `Update available: ${"0.34.1"} \u2192 ${latestVersion}`;
26236
+ const msg = `Update available: ${"0.35.0"} \u2192 ${latestVersion}`;
26146
26237
  const cmd = "Run npm install -g dorkos@latest to update";
26147
26238
  const width = Math.max(msg.length, cmd.length) + 6;
26148
26239
  const pad = (s2) => `\u2502 ${s2}${" ".repeat(width - s2.length - 6)} \u2502`;