@usecontextlayer/ctxe 0.5.13 → 0.5.15
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/cli.mjs +1266 -1175
- package/dist/cli.mjs.map +1 -1
- package/package.json +6 -6
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e6a211a4-7df5-5298-b682-3f726da56b53")}catch(e){}}();
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as Sentry from "@sentry/node";
|
|
6
6
|
import { mkdir, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
@@ -60,284 +60,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
60
60
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
|
-
//#region
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
//#region sentry.ts
|
|
68
|
-
Sentry.init({
|
|
69
|
-
dsn: "https://40681e101c0fe69980030b91041a4811@o4510556311519232.ingest.us.sentry.io/4511512992022528",
|
|
70
|
-
environment: "production",
|
|
71
|
-
release: version$2,
|
|
72
|
-
sendDefaultPii: false,
|
|
73
|
-
tracesSampleRate: 0
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region ../sandbox/dist/index.mjs
|
|
78
|
-
function isNodeError$1(error) {
|
|
79
|
-
return error instanceof Error && "code" in error;
|
|
80
|
-
}
|
|
81
|
-
async function ensureHostFilesystemReady(bindMounts) {
|
|
82
|
-
for (const mount of bindMounts) {
|
|
83
|
-
if (mount.hostPathBehavior === "createDir") {
|
|
84
|
-
await mkdir(mount.hostPath, {
|
|
85
|
-
mode: 448,
|
|
86
|
-
recursive: true
|
|
87
|
-
});
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
let stats;
|
|
91
|
-
try {
|
|
92
|
-
stats = await stat(mount.hostPath);
|
|
93
|
-
} catch (error) {
|
|
94
|
-
if (isNodeError$1(error) && error.code === "ENOENT") throw new Error(`Required sandbox host path does not exist: ${mount.hostPath}`);
|
|
95
|
-
throw error;
|
|
96
|
-
}
|
|
97
|
-
if (!stats.isDirectory()) throw new Error(`Required sandbox host path is not a directory: ${mount.hostPath}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
const SANDBOX_STOP_TIMEOUT_MS = 1e4;
|
|
101
|
-
async function bootSandbox(microsandboxLib, config) {
|
|
102
|
-
let builder = microsandboxLib.Sandbox.builder(config.name).image(config.image);
|
|
103
|
-
if (config.memory !== void 0) builder = builder.memory(config.memory);
|
|
104
|
-
builder = builder.pullPolicy("if-missing").registry((r) => r.auth({ kind: "anonymous" })).replace().ephemeral(true).workdir(config.workdir).envs(config.env);
|
|
105
|
-
for (const mount of config.bindMounts) builder = builder.volume(mount.guestPath, (mountBuilder) => {
|
|
106
|
-
const bind = mountBuilder.bind(mount.hostPath);
|
|
107
|
-
return mount.mode === "ro" ? bind.readonly() : bind;
|
|
108
|
-
});
|
|
109
|
-
builder = builder.patch((patchBuilder) => {
|
|
110
|
-
let patch = patchBuilder;
|
|
111
|
-
for (const dirPatch of config.dirPatches) patch = patch.copyDir(dirPatch.hostPath, dirPatch.guestPath, { replace: true });
|
|
112
|
-
for (const textPatch of config.textPatches) patch = patch.text(textPatch.guestPath, textPatch.content, {
|
|
113
|
-
mode: textPatch.fileMode,
|
|
114
|
-
replace: true
|
|
115
|
-
});
|
|
116
|
-
return patch;
|
|
117
|
-
});
|
|
118
|
-
builder = builder.network((nb) => nb.policy(microsandboxLib.NetworkPolicy.allowAll()));
|
|
119
|
-
return await builder.create();
|
|
120
|
-
}
|
|
121
|
-
const CLAUDE_GUEST_HOME = "/root";
|
|
122
|
-
const CLAUDE_CONFIG_GUEST_PATH = `${CLAUDE_GUEST_HOME}/.claude`;
|
|
123
|
-
const CLAUDE_PROJECTS_GUEST_PATH = `${CLAUDE_CONFIG_GUEST_PATH}/projects`;
|
|
124
|
-
const CLAUDE_CREDENTIALS_GUEST_PATH = `${CLAUDE_CONFIG_GUEST_PATH}/.credentials.json`;
|
|
125
|
-
const CLAUDE_JSON_GUEST_PATH = `${CLAUDE_GUEST_HOME}/.claude.json`;
|
|
126
|
-
const CLAUDE_REQUIRED_ENV = {
|
|
127
|
-
HOME: CLAUDE_GUEST_HOME,
|
|
128
|
-
IS_SANDBOX: "1"
|
|
129
|
-
};
|
|
130
|
-
const MICROSANDBOX_HOST_ALIAS = "host.microsandbox.internal";
|
|
131
|
-
const HOST_LOOPBACK_HOSTNAMES = new Set([
|
|
132
|
-
"localhost",
|
|
133
|
-
"127.0.0.1",
|
|
134
|
-
"0.0.0.0"
|
|
135
|
-
]);
|
|
136
|
-
const IPV6_LOOPBACK_HOSTNAMES = new Set(["[::1]", "[::]"]);
|
|
137
|
-
function rewriteHostUrlForGuest(url) {
|
|
138
|
-
const parsed = new URL(url);
|
|
139
|
-
const hostname = parsed.hostname.toLowerCase();
|
|
140
|
-
if (HOST_LOOPBACK_HOSTNAMES.has(hostname) || IPV6_LOOPBACK_HOSTNAMES.has(hostname)) {
|
|
141
|
-
parsed.hostname = MICROSANDBOX_HOST_ALIAS;
|
|
142
|
-
return parsed.toString();
|
|
143
|
-
}
|
|
144
|
-
return url;
|
|
145
|
-
}
|
|
146
|
-
function withConfigEntries(base, entries) {
|
|
147
|
-
const env = {
|
|
148
|
-
...base,
|
|
149
|
-
GIT_CONFIG_COUNT: String(entries.length)
|
|
150
|
-
};
|
|
151
|
-
entries.forEach(([key, value], i) => {
|
|
152
|
-
env[`GIT_CONFIG_KEY_${i}`] = key;
|
|
153
|
-
env[`GIT_CONFIG_VALUE_${i}`] = value;
|
|
154
|
-
});
|
|
155
|
-
return env;
|
|
156
|
-
}
|
|
157
|
-
function identityEnv(identity) {
|
|
158
|
-
return {
|
|
159
|
-
GIT_AUTHOR_EMAIL: identity.email,
|
|
160
|
-
GIT_AUTHOR_NAME: identity.name,
|
|
161
|
-
GIT_COMMITTER_EMAIL: identity.email,
|
|
162
|
-
GIT_COMMITTER_NAME: identity.name
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* The env for every HOST-side machine git spawn. Isolation is the point: the
|
|
167
|
-
* operator's global/system config must never reach machine git — on a dev box a
|
|
168
|
-
* global `commit.gpgsign` routed through 1Password's `op-ssh-sign` fails or
|
|
169
|
-
* serializes every machine commit while the vault is locked, and a global
|
|
170
|
-
* `core.excludesFile` silently changes what `add -A` snapshots. Prod containers
|
|
171
|
-
* carry no gitconfig, so isolation also makes dev match prod. The signing pin is
|
|
172
|
-
* belt-and-suspenders on top of the isolation (and the layer the guest shares).
|
|
173
|
-
* Auth never blocks on a prompt; the token rides http.extraHeader instead.
|
|
174
|
-
*/
|
|
175
|
-
function hostGitEnv(input = {}) {
|
|
176
|
-
const entries = [["commit.gpgsign", "false"]];
|
|
177
|
-
if (input.auth !== void 0) entries.push(["http.extraHeader", `Authorization: Bearer ${input.auth}`]);
|
|
178
|
-
return withConfigEntries({
|
|
179
|
-
GIT_CONFIG_GLOBAL: "/dev/null",
|
|
180
|
-
GIT_CONFIG_SYSTEM: "/dev/null",
|
|
181
|
-
GIT_TERMINAL_PROMPT: "0",
|
|
182
|
-
...input.identity ? identityEnv(input.identity) : {}
|
|
183
|
-
}, entries);
|
|
184
|
-
}
|
|
185
|
-
const execFileAsync = promisify(execFile);
|
|
186
|
-
const KEYCHAIN_SERVICE = "Claude Code-credentials";
|
|
187
|
-
function buildLinuxClaudeConfig(input) {
|
|
188
|
-
const parsed = input.rawClaudeJson ? JSON.parse(input.rawClaudeJson) : {};
|
|
189
|
-
const config = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? { ...parsed } : {};
|
|
190
|
-
delete config.installMethod;
|
|
191
|
-
const projects = config.projects && typeof config.projects === "object" && !Array.isArray(config.projects) ? { ...config.projects } : {};
|
|
192
|
-
const existingProject = projects[input.projectGuestPath] && typeof projects[input.projectGuestPath] === "object" && !Array.isArray(projects[input.projectGuestPath]) ? { ...projects[input.projectGuestPath] } : {};
|
|
193
|
-
projects[input.projectGuestPath] = {
|
|
194
|
-
...existingProject,
|
|
195
|
-
hasTrustDialogAccepted: true
|
|
196
|
-
};
|
|
197
|
-
config.projects = projects;
|
|
198
|
-
return `${JSON.stringify(config, null, " ")}\n`;
|
|
199
|
-
}
|
|
200
|
-
async function materializeClaudeHostConfig(input) {
|
|
201
|
-
let rawClaudeJson;
|
|
202
|
-
try {
|
|
203
|
-
rawClaudeJson = await readFile(input.hostClaudeJsonPath, "utf8");
|
|
204
|
-
} catch (error) {
|
|
205
|
-
if (!isNodeError$1(error) || error.code !== "ENOENT") throw error;
|
|
206
|
-
rawClaudeJson = null;
|
|
207
|
-
}
|
|
208
|
-
const credentials = await (input.readClaudeCredentials ?? readClaudeCodeCredentialsFromKeychain)({ platform: input.platform ?? process.platform });
|
|
209
|
-
return {
|
|
210
|
-
claudeJson: buildLinuxClaudeConfig({
|
|
211
|
-
projectGuestPath: input.projectGuestPath,
|
|
212
|
-
rawClaudeJson
|
|
213
|
-
}),
|
|
214
|
-
credentials
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
async function readClaudeCodeCredentialsFromKeychain(input) {
|
|
218
|
-
if (input.platform !== "darwin") return null;
|
|
219
|
-
return await new Promise((resolve) => {
|
|
220
|
-
execFile("security", [
|
|
221
|
-
"find-generic-password",
|
|
222
|
-
"-s",
|
|
223
|
-
KEYCHAIN_SERVICE,
|
|
224
|
-
"-w"
|
|
225
|
-
], { encoding: "utf8" }, (error, stdout) => {
|
|
226
|
-
if (error) {
|
|
227
|
-
resolve(null);
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
const trimmed = stdout.trim();
|
|
231
|
-
resolve(trimmed.length > 0 ? trimmed : null);
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
function claudeMaterialTextPatches(material) {
|
|
236
|
-
const patches = [{
|
|
237
|
-
content: material.claudeJson,
|
|
238
|
-
fileMode: 384,
|
|
239
|
-
guestPath: CLAUDE_JSON_GUEST_PATH
|
|
240
|
-
}];
|
|
241
|
-
if (material.credentials !== null) patches.push({
|
|
242
|
-
content: material.credentials,
|
|
243
|
-
fileMode: 384,
|
|
244
|
-
guestPath: CLAUDE_CREDENTIALS_GUEST_PATH
|
|
245
|
-
});
|
|
246
|
-
return patches;
|
|
247
|
-
}
|
|
248
|
-
function buildClaudeBootConfig(input) {
|
|
249
|
-
return {
|
|
250
|
-
bindMounts: input.bindMounts,
|
|
251
|
-
dirPatches: [],
|
|
252
|
-
env: input.guestEnv,
|
|
253
|
-
image: input.image,
|
|
254
|
-
memory: input.memory,
|
|
255
|
-
name: input.name,
|
|
256
|
-
textPatches: [...claudeMaterialTextPatches(input.claudeMaterial), ...input.textPatches ?? []],
|
|
257
|
-
workdir: input.workdir
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
const DRAIN_TIMED_OUT = Symbol("drain-timed-out");
|
|
261
|
-
const DRAIN_ABORTED = Symbol("drain-aborted");
|
|
262
|
-
async function drainExecStream(handle, options) {
|
|
263
|
-
const { onEvent, signal } = options;
|
|
264
|
-
if (signal?.aborted) return { kind: "aborted" };
|
|
265
|
-
const startedAt = Date.now();
|
|
266
|
-
let lastEventAt = startedAt;
|
|
267
|
-
let tightenedDeadline = Number.POSITIVE_INFINITY;
|
|
268
|
-
const ctrl = { tighten: (deadlineMs) => {
|
|
269
|
-
tightenedDeadline = Math.min(tightenedDeadline, deadlineMs);
|
|
270
|
-
} };
|
|
271
|
-
let resolveAborted;
|
|
272
|
-
const aborted = new Promise((resolve) => {
|
|
273
|
-
resolveAborted = resolve;
|
|
274
|
-
});
|
|
275
|
-
const onAbort = () => resolveAborted?.(DRAIN_ABORTED);
|
|
276
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
277
|
-
try {
|
|
278
|
-
for (;;) {
|
|
279
|
-
const ceilingDeadline = startedAt + options.maxDurationMs;
|
|
280
|
-
const inactivityDeadline = lastEventAt + options.inactivityMs;
|
|
281
|
-
const deadline = Math.min(ceilingDeadline, inactivityDeadline, tightenedDeadline);
|
|
282
|
-
let timer;
|
|
283
|
-
const timedOut = new Promise((resolve) => {
|
|
284
|
-
timer = setTimeout(() => resolve(DRAIN_TIMED_OUT), Math.max(0, deadline - Date.now()));
|
|
285
|
-
});
|
|
286
|
-
const pending = handle.recv();
|
|
287
|
-
let settled;
|
|
288
|
-
try {
|
|
289
|
-
settled = await Promise.race([
|
|
290
|
-
pending,
|
|
291
|
-
timedOut,
|
|
292
|
-
aborted
|
|
293
|
-
]);
|
|
294
|
-
} finally {
|
|
295
|
-
clearTimeout(timer);
|
|
296
|
-
}
|
|
297
|
-
if (settled === DRAIN_ABORTED) {
|
|
298
|
-
pending.catch(() => {});
|
|
299
|
-
return { kind: "aborted" };
|
|
300
|
-
}
|
|
301
|
-
if (settled === DRAIN_TIMED_OUT) {
|
|
302
|
-
pending.catch(() => {});
|
|
303
|
-
return {
|
|
304
|
-
kind: "timed_out",
|
|
305
|
-
reason: ceilingDeadline <= inactivityDeadline ? "max_duration" : "inactivity"
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
if (settled === null) return { kind: "ended" };
|
|
309
|
-
lastEventAt = Date.now();
|
|
310
|
-
if (settled === void 0) continue;
|
|
311
|
-
if (settled.kind === "exited") return {
|
|
312
|
-
exitCode: settled.code,
|
|
313
|
-
kind: "exited"
|
|
314
|
-
};
|
|
315
|
-
onEvent(settled, ctrl);
|
|
316
|
-
}
|
|
317
|
-
} finally {
|
|
318
|
-
signal?.removeEventListener("abort", onAbort);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
const DEBUG_SANDBOX_NAME = "ctx-sandbox-debug";
|
|
322
|
-
const DEFAULT_BOOT_COMMAND = ["uname", "-a"];
|
|
323
|
-
async function runSandbox(input) {
|
|
324
|
-
const microsandbox = await import("microsandbox");
|
|
325
|
-
const requested = input.command.length > 0 ? [...input.command] : DEFAULT_BOOT_COMMAND;
|
|
326
|
-
const cmd = requested[0];
|
|
327
|
-
if (cmd === void 0) throw new Error("sandbox command resolved empty");
|
|
328
|
-
const args = requested.slice(1);
|
|
329
|
-
console.error(`[sandbox] booting ${input.image} …`);
|
|
330
|
-
const sandbox = await microsandbox.Sandbox.builder(DEBUG_SANDBOX_NAME).image(input.image).replace().ephemeral(true).create();
|
|
331
|
-
try {
|
|
332
|
-
const output = await sandbox.exec(cmd, args);
|
|
333
|
-
process.stdout.write(output.stdout());
|
|
334
|
-
process.stderr.write(output.stderr());
|
|
335
|
-
return output.code;
|
|
336
|
-
} finally {
|
|
337
|
-
await sandbox.stopWithTimeout(SANDBOX_STOP_TIMEOUT_MS);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
var _a$1$1;
|
|
63
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
64
|
+
var _a$3;
|
|
65
|
+
/** A special constant with type `never` */
|
|
66
|
+
const NEVER = /*@__PURE__*/ Object.freeze({ status: "aborted" });
|
|
341
67
|
function $constructor$1(name, initializer, params) {
|
|
342
68
|
function init(inst, def) {
|
|
343
69
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
@@ -388,12 +114,15 @@ var $ZodEncodeError$1 = class extends Error {
|
|
|
388
114
|
this.name = "ZodEncodeError";
|
|
389
115
|
}
|
|
390
116
|
};
|
|
391
|
-
(_a$
|
|
117
|
+
(_a$3 = globalThis).__zod_globalConfig ?? (_a$3.__zod_globalConfig = {});
|
|
392
118
|
const globalConfig$1 = globalThis.__zod_globalConfig;
|
|
393
119
|
function config$1(newConfig) {
|
|
394
120
|
if (newConfig) Object.assign(globalConfig$1, newConfig);
|
|
395
121
|
return globalConfig$1;
|
|
396
122
|
}
|
|
123
|
+
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
397
126
|
function getEnumValues$1(entries) {
|
|
398
127
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
399
128
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -420,6 +149,13 @@ function cleanRegex$1(source) {
|
|
|
420
149
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
421
150
|
return source.slice(start, end);
|
|
422
151
|
}
|
|
152
|
+
function floatSafeRemainder(val, step) {
|
|
153
|
+
const ratio = val / step;
|
|
154
|
+
const roundedRatio = Math.round(ratio);
|
|
155
|
+
const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
156
|
+
if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
|
|
157
|
+
return ratio - roundedRatio;
|
|
158
|
+
}
|
|
423
159
|
const EVALUATING$1 = /* @__PURE__*/ Symbol("evaluating");
|
|
424
160
|
function defineLazy$1(object, key, getter) {
|
|
425
161
|
let value = void 0;
|
|
@@ -458,7 +194,7 @@ function slugify$1(input) {
|
|
|
458
194
|
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
459
195
|
}
|
|
460
196
|
const captureStackTrace$1 = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
461
|
-
function isObject$
|
|
197
|
+
function isObject$2(data) {
|
|
462
198
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
463
199
|
}
|
|
464
200
|
const allowsEval$1 = /* @__PURE__*/ cached$1(() => {
|
|
@@ -472,12 +208,12 @@ const allowsEval$1 = /* @__PURE__*/ cached$1(() => {
|
|
|
472
208
|
}
|
|
473
209
|
});
|
|
474
210
|
function isPlainObject$5(o) {
|
|
475
|
-
if (isObject$
|
|
211
|
+
if (isObject$2(o) === false) return false;
|
|
476
212
|
const ctor = o.constructor;
|
|
477
213
|
if (ctor === void 0) return true;
|
|
478
214
|
if (typeof ctor !== "function") return true;
|
|
479
215
|
const prot = ctor.prototype;
|
|
480
|
-
if (isObject$
|
|
216
|
+
if (isObject$2(prot) === false) return false;
|
|
481
217
|
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
|
|
482
218
|
return true;
|
|
483
219
|
}
|
|
@@ -521,7 +257,13 @@ function optionalKeys$1(shape) {
|
|
|
521
257
|
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
522
258
|
});
|
|
523
259
|
}
|
|
524
|
-
|
|
260
|
+
const NUMBER_FORMAT_RANGES = {
|
|
261
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
262
|
+
int32: [-2147483648, 2147483647],
|
|
263
|
+
uint32: [0, 4294967295],
|
|
264
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
265
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
266
|
+
};
|
|
525
267
|
function pick$1(schema, mask) {
|
|
526
268
|
const currDef = schema._zod.def;
|
|
527
269
|
const checks = currDef.checks;
|
|
@@ -681,7 +423,7 @@ function getLengthableOrigin$1(input) {
|
|
|
681
423
|
if (typeof input === "string") return "string";
|
|
682
424
|
return "unknown";
|
|
683
425
|
}
|
|
684
|
-
function issue$
|
|
426
|
+
function issue$1(...args) {
|
|
685
427
|
const [iss, input, inst] = args;
|
|
686
428
|
if (typeof iss === "string") return {
|
|
687
429
|
message: iss,
|
|
@@ -691,7 +433,10 @@ function issue$3(...args) {
|
|
|
691
433
|
};
|
|
692
434
|
return { ...iss };
|
|
693
435
|
}
|
|
694
|
-
|
|
436
|
+
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
439
|
+
const initializer$3 = (inst, def) => {
|
|
695
440
|
inst.name = "$ZodError";
|
|
696
441
|
Object.defineProperty(inst, "_zod", {
|
|
697
442
|
value: inst._zod,
|
|
@@ -707,8 +452,8 @@ const initializer$1$1 = (inst, def) => {
|
|
|
707
452
|
enumerable: false
|
|
708
453
|
});
|
|
709
454
|
};
|
|
710
|
-
const $ZodError$1 = $constructor$1("$ZodError", initializer$
|
|
711
|
-
const $ZodRealError$1 = $constructor$1("$ZodError", initializer$
|
|
455
|
+
const $ZodError$1 = $constructor$1("$ZodError", initializer$3);
|
|
456
|
+
const $ZodRealError$1 = $constructor$1("$ZodError", initializer$3, { Parent: Error });
|
|
712
457
|
function flattenError$1(error, mapper = (issue) => issue.message) {
|
|
713
458
|
const fieldErrors = {};
|
|
714
459
|
const formErrors = [];
|
|
@@ -749,6 +494,9 @@ function formatError$2(error, mapper = (issue) => issue.message) {
|
|
|
749
494
|
processError(error);
|
|
750
495
|
return fieldErrors;
|
|
751
496
|
}
|
|
497
|
+
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
752
500
|
const _parse$1 = (_Err) => (schema, value, _ctx, _params) => {
|
|
753
501
|
const ctx = _ctx ? {
|
|
754
502
|
..._ctx,
|
|
@@ -801,7 +549,7 @@ const _safeParse$1 = (_Err) => (schema, value, _ctx) => {
|
|
|
801
549
|
data: result.value
|
|
802
550
|
};
|
|
803
551
|
};
|
|
804
|
-
const safeParse$
|
|
552
|
+
const safeParse$3 = /* @__PURE__*/ _safeParse$1($ZodRealError$1);
|
|
805
553
|
const _safeParseAsync$1 = (_Err) => async (schema, value, _ctx) => {
|
|
806
554
|
const ctx = _ctx ? {
|
|
807
555
|
..._ctx,
|
|
@@ -820,7 +568,7 @@ const _safeParseAsync$1 = (_Err) => async (schema, value, _ctx) => {
|
|
|
820
568
|
data: result.value
|
|
821
569
|
};
|
|
822
570
|
};
|
|
823
|
-
const safeParseAsync$
|
|
571
|
+
const safeParseAsync$3 = /* @__PURE__*/ _safeParseAsync$1($ZodRealError$1);
|
|
824
572
|
const _encode$1 = (_Err) => (schema, value, _ctx) => {
|
|
825
573
|
const ctx = _ctx ? {
|
|
826
574
|
..._ctx,
|
|
@@ -861,6 +609,9 @@ const _safeEncodeAsync$1 = (_Err) => async (schema, value, _ctx) => {
|
|
|
861
609
|
const _safeDecodeAsync$1 = (_Err) => async (schema, value, _ctx) => {
|
|
862
610
|
return _safeParseAsync$1(_Err)(schema, value, _ctx);
|
|
863
611
|
};
|
|
612
|
+
|
|
613
|
+
//#endregion
|
|
614
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
|
|
864
615
|
/**
|
|
865
616
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
866
617
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -873,7 +624,7 @@ const xid$1 = /^[0-9a-vA-V]{20}$/;
|
|
|
873
624
|
const ksuid$1 = /^[A-Za-z0-9]{27}$/;
|
|
874
625
|
const nanoid$1 = /^[a-zA-Z0-9_-]{21}$/;
|
|
875
626
|
/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
|
|
876
|
-
const duration$
|
|
627
|
+
const duration$3 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
877
628
|
/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
|
|
878
629
|
const guid$1 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
879
630
|
/** Returns a regex for validating an RFC 9562/4122 UUID.
|
|
@@ -885,9 +636,9 @@ const uuid$1 = (version) => {
|
|
|
885
636
|
};
|
|
886
637
|
/** Practical email validation */
|
|
887
638
|
const email$1 = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
888
|
-
const _emoji$
|
|
639
|
+
const _emoji$3 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
889
640
|
function emoji$1() {
|
|
890
|
-
return new RegExp(_emoji$
|
|
641
|
+
return new RegExp(_emoji$3, "u");
|
|
891
642
|
}
|
|
892
643
|
const ipv4$1 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
893
644
|
const ipv6$1 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
|
|
@@ -898,15 +649,15 @@ const base64url$1 = /^[A-Za-z0-9_-]*$/;
|
|
|
898
649
|
const httpProtocol$1 = /^https?$/;
|
|
899
650
|
const e164$1 = /^\+[1-9]\d{6,14}$/;
|
|
900
651
|
const dateSource$1 = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
901
|
-
const date$
|
|
652
|
+
const date$4 = /*@__PURE__*/ new RegExp(`^${dateSource$1}$`);
|
|
902
653
|
function timeSource$1(args) {
|
|
903
654
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
904
655
|
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
905
656
|
}
|
|
906
|
-
function time$
|
|
657
|
+
function time$3(args) {
|
|
907
658
|
return new RegExp(`^${timeSource$1(args)}$`);
|
|
908
659
|
}
|
|
909
|
-
function datetime$
|
|
660
|
+
function datetime$3(args) {
|
|
910
661
|
const time = timeSource$1({ precision: args.precision });
|
|
911
662
|
const opts = ["Z"];
|
|
912
663
|
if (args.local) opts.push("");
|
|
@@ -914,19 +665,163 @@ function datetime$1$1(args) {
|
|
|
914
665
|
const timeRegex = `${time}(?:${opts.join("|")})`;
|
|
915
666
|
return new RegExp(`^${dateSource$1}T(?:${timeRegex})$`);
|
|
916
667
|
}
|
|
917
|
-
const string$
|
|
668
|
+
const string$4 = (params) => {
|
|
918
669
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
919
670
|
return new RegExp(`^${regex}$`);
|
|
920
671
|
};
|
|
672
|
+
const integer = /^-?\d+$/;
|
|
921
673
|
const number$4 = /^-?\d+(?:\.\d+)?$/;
|
|
674
|
+
const boolean$2 = /^(?:true|false)$/i;
|
|
922
675
|
const lowercase$1 = /^[^A-Z]*$/;
|
|
923
676
|
const uppercase$1 = /^[^a-z]*$/;
|
|
677
|
+
|
|
678
|
+
//#endregion
|
|
679
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
|
|
924
680
|
const $ZodCheck$1 = /*@__PURE__*/ $constructor$1("$ZodCheck", (inst, def) => {
|
|
925
681
|
var _a;
|
|
926
682
|
inst._zod ?? (inst._zod = {});
|
|
927
683
|
inst._zod.def = def;
|
|
928
684
|
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
929
685
|
});
|
|
686
|
+
const numericOriginMap = {
|
|
687
|
+
number: "number",
|
|
688
|
+
bigint: "bigint",
|
|
689
|
+
object: "date"
|
|
690
|
+
};
|
|
691
|
+
const $ZodCheckLessThan = /*@__PURE__*/ $constructor$1("$ZodCheckLessThan", (inst, def) => {
|
|
692
|
+
$ZodCheck$1.init(inst, def);
|
|
693
|
+
const origin = numericOriginMap[typeof def.value];
|
|
694
|
+
inst._zod.onattach.push((inst) => {
|
|
695
|
+
const bag = inst._zod.bag;
|
|
696
|
+
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
697
|
+
if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
|
|
698
|
+
else bag.exclusiveMaximum = def.value;
|
|
699
|
+
});
|
|
700
|
+
inst._zod.check = (payload) => {
|
|
701
|
+
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
702
|
+
payload.issues.push({
|
|
703
|
+
origin,
|
|
704
|
+
code: "too_big",
|
|
705
|
+
maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
706
|
+
input: payload.value,
|
|
707
|
+
inclusive: def.inclusive,
|
|
708
|
+
inst,
|
|
709
|
+
continue: !def.abort
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
});
|
|
713
|
+
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor$1("$ZodCheckGreaterThan", (inst, def) => {
|
|
714
|
+
$ZodCheck$1.init(inst, def);
|
|
715
|
+
const origin = numericOriginMap[typeof def.value];
|
|
716
|
+
inst._zod.onattach.push((inst) => {
|
|
717
|
+
const bag = inst._zod.bag;
|
|
718
|
+
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
719
|
+
if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
|
|
720
|
+
else bag.exclusiveMinimum = def.value;
|
|
721
|
+
});
|
|
722
|
+
inst._zod.check = (payload) => {
|
|
723
|
+
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
724
|
+
payload.issues.push({
|
|
725
|
+
origin,
|
|
726
|
+
code: "too_small",
|
|
727
|
+
minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
728
|
+
input: payload.value,
|
|
729
|
+
inclusive: def.inclusive,
|
|
730
|
+
inst,
|
|
731
|
+
continue: !def.abort
|
|
732
|
+
});
|
|
733
|
+
};
|
|
734
|
+
});
|
|
735
|
+
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor$1("$ZodCheckMultipleOf", (inst, def) => {
|
|
736
|
+
$ZodCheck$1.init(inst, def);
|
|
737
|
+
inst._zod.onattach.push((inst) => {
|
|
738
|
+
var _a;
|
|
739
|
+
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
740
|
+
});
|
|
741
|
+
inst._zod.check = (payload) => {
|
|
742
|
+
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
743
|
+
if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
744
|
+
payload.issues.push({
|
|
745
|
+
origin: typeof payload.value,
|
|
746
|
+
code: "not_multiple_of",
|
|
747
|
+
divisor: def.value,
|
|
748
|
+
input: payload.value,
|
|
749
|
+
inst,
|
|
750
|
+
continue: !def.abort
|
|
751
|
+
});
|
|
752
|
+
};
|
|
753
|
+
});
|
|
754
|
+
const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor$1("$ZodCheckNumberFormat", (inst, def) => {
|
|
755
|
+
$ZodCheck$1.init(inst, def);
|
|
756
|
+
def.format = def.format || "float64";
|
|
757
|
+
const isInt = def.format?.includes("int");
|
|
758
|
+
const origin = isInt ? "int" : "number";
|
|
759
|
+
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
760
|
+
inst._zod.onattach.push((inst) => {
|
|
761
|
+
const bag = inst._zod.bag;
|
|
762
|
+
bag.format = def.format;
|
|
763
|
+
bag.minimum = minimum;
|
|
764
|
+
bag.maximum = maximum;
|
|
765
|
+
if (isInt) bag.pattern = integer;
|
|
766
|
+
});
|
|
767
|
+
inst._zod.check = (payload) => {
|
|
768
|
+
const input = payload.value;
|
|
769
|
+
if (isInt) {
|
|
770
|
+
if (!Number.isInteger(input)) {
|
|
771
|
+
payload.issues.push({
|
|
772
|
+
expected: origin,
|
|
773
|
+
format: def.format,
|
|
774
|
+
code: "invalid_type",
|
|
775
|
+
continue: false,
|
|
776
|
+
input,
|
|
777
|
+
inst
|
|
778
|
+
});
|
|
779
|
+
return;
|
|
780
|
+
}
|
|
781
|
+
if (!Number.isSafeInteger(input)) {
|
|
782
|
+
if (input > 0) payload.issues.push({
|
|
783
|
+
input,
|
|
784
|
+
code: "too_big",
|
|
785
|
+
maximum: Number.MAX_SAFE_INTEGER,
|
|
786
|
+
note: "Integers must be within the safe integer range.",
|
|
787
|
+
inst,
|
|
788
|
+
origin,
|
|
789
|
+
inclusive: true,
|
|
790
|
+
continue: !def.abort
|
|
791
|
+
});
|
|
792
|
+
else payload.issues.push({
|
|
793
|
+
input,
|
|
794
|
+
code: "too_small",
|
|
795
|
+
minimum: Number.MIN_SAFE_INTEGER,
|
|
796
|
+
note: "Integers must be within the safe integer range.",
|
|
797
|
+
inst,
|
|
798
|
+
origin,
|
|
799
|
+
inclusive: true,
|
|
800
|
+
continue: !def.abort
|
|
801
|
+
});
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
if (input < minimum) payload.issues.push({
|
|
806
|
+
origin: "number",
|
|
807
|
+
input,
|
|
808
|
+
code: "too_small",
|
|
809
|
+
minimum,
|
|
810
|
+
inclusive: true,
|
|
811
|
+
inst,
|
|
812
|
+
continue: !def.abort
|
|
813
|
+
});
|
|
814
|
+
if (input > maximum) payload.issues.push({
|
|
815
|
+
origin: "number",
|
|
816
|
+
input,
|
|
817
|
+
code: "too_big",
|
|
818
|
+
maximum,
|
|
819
|
+
inclusive: true,
|
|
820
|
+
inst,
|
|
821
|
+
continue: !def.abort
|
|
822
|
+
});
|
|
823
|
+
};
|
|
824
|
+
});
|
|
930
825
|
const $ZodCheckMaxLength$1 = /*@__PURE__*/ $constructor$1("$ZodCheckMaxLength", (inst, def) => {
|
|
931
826
|
var _a;
|
|
932
827
|
$ZodCheck$1.init(inst, def);
|
|
@@ -1138,6 +1033,9 @@ const $ZodCheckOverwrite$1 = /*@__PURE__*/ $constructor$1("$ZodCheckOverwrite",
|
|
|
1138
1033
|
payload.value = def.tx(payload.value);
|
|
1139
1034
|
};
|
|
1140
1035
|
});
|
|
1036
|
+
|
|
1037
|
+
//#endregion
|
|
1038
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
|
|
1141
1039
|
var Doc$1 = class {
|
|
1142
1040
|
constructor(args = []) {
|
|
1143
1041
|
this.content = [];
|
|
@@ -1167,17 +1065,23 @@ var Doc$1 = class {
|
|
|
1167
1065
|
return new F(...args, lines.join("\n"));
|
|
1168
1066
|
}
|
|
1169
1067
|
};
|
|
1170
|
-
|
|
1068
|
+
|
|
1069
|
+
//#endregion
|
|
1070
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
|
|
1071
|
+
const version$2 = {
|
|
1171
1072
|
major: 4,
|
|
1172
1073
|
minor: 4,
|
|
1173
1074
|
patch: 3
|
|
1174
1075
|
};
|
|
1076
|
+
|
|
1077
|
+
//#endregion
|
|
1078
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
|
|
1175
1079
|
const $ZodType$1 = /*@__PURE__*/ $constructor$1("$ZodType", (inst, def) => {
|
|
1176
1080
|
var _a;
|
|
1177
1081
|
inst ?? (inst = {});
|
|
1178
1082
|
inst._zod.def = def;
|
|
1179
1083
|
inst._zod.bag = inst._zod.bag || {};
|
|
1180
|
-
inst._zod.version = version$
|
|
1084
|
+
inst._zod.version = version$2;
|
|
1181
1085
|
const checks = [...inst._zod.def.checks ?? []];
|
|
1182
1086
|
if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
|
|
1183
1087
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
@@ -1251,10 +1155,10 @@ const $ZodType$1 = /*@__PURE__*/ $constructor$1("$ZodType", (inst, def) => {
|
|
|
1251
1155
|
defineLazy$1(inst, "~standard", () => ({
|
|
1252
1156
|
validate: (value) => {
|
|
1253
1157
|
try {
|
|
1254
|
-
const r = safeParse$
|
|
1158
|
+
const r = safeParse$3(inst, value);
|
|
1255
1159
|
return r.success ? { value: r.data } : { issues: r.error?.issues };
|
|
1256
1160
|
} catch (_) {
|
|
1257
|
-
return safeParseAsync$
|
|
1161
|
+
return safeParseAsync$3(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
|
|
1258
1162
|
}
|
|
1259
1163
|
},
|
|
1260
1164
|
vendor: "zod",
|
|
@@ -1263,7 +1167,7 @@ const $ZodType$1 = /*@__PURE__*/ $constructor$1("$ZodType", (inst, def) => {
|
|
|
1263
1167
|
});
|
|
1264
1168
|
const $ZodString$1 = /*@__PURE__*/ $constructor$1("$ZodString", (inst, def) => {
|
|
1265
1169
|
$ZodType$1.init(inst, def);
|
|
1266
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$
|
|
1170
|
+
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$4(inst._zod.bag);
|
|
1267
1171
|
inst._zod.parse = (payload, _) => {
|
|
1268
1172
|
if (def.coerce) try {
|
|
1269
1173
|
payload.value = String(payload.value);
|
|
@@ -1398,19 +1302,19 @@ const $ZodKSUID$1 = /*@__PURE__*/ $constructor$1("$ZodKSUID", (inst, def) => {
|
|
|
1398
1302
|
$ZodStringFormat$1.init(inst, def);
|
|
1399
1303
|
});
|
|
1400
1304
|
const $ZodISODateTime$1 = /*@__PURE__*/ $constructor$1("$ZodISODateTime", (inst, def) => {
|
|
1401
|
-
def.pattern ?? (def.pattern = datetime$
|
|
1305
|
+
def.pattern ?? (def.pattern = datetime$3(def));
|
|
1402
1306
|
$ZodStringFormat$1.init(inst, def);
|
|
1403
1307
|
});
|
|
1404
1308
|
const $ZodISODate$1 = /*@__PURE__*/ $constructor$1("$ZodISODate", (inst, def) => {
|
|
1405
|
-
def.pattern ?? (def.pattern = date$
|
|
1309
|
+
def.pattern ?? (def.pattern = date$4);
|
|
1406
1310
|
$ZodStringFormat$1.init(inst, def);
|
|
1407
1311
|
});
|
|
1408
1312
|
const $ZodISOTime$1 = /*@__PURE__*/ $constructor$1("$ZodISOTime", (inst, def) => {
|
|
1409
|
-
def.pattern ?? (def.pattern = time$
|
|
1313
|
+
def.pattern ?? (def.pattern = time$3(def));
|
|
1410
1314
|
$ZodStringFormat$1.init(inst, def);
|
|
1411
1315
|
});
|
|
1412
1316
|
const $ZodISODuration$1 = /*@__PURE__*/ $constructor$1("$ZodISODuration", (inst, def) => {
|
|
1413
|
-
def.pattern ?? (def.pattern = duration$
|
|
1317
|
+
def.pattern ?? (def.pattern = duration$3);
|
|
1414
1318
|
$ZodStringFormat$1.init(inst, def);
|
|
1415
1319
|
});
|
|
1416
1320
|
const $ZodIPv4$1 = /*@__PURE__*/ $constructor$1("$ZodIPv4", (inst, def) => {
|
|
@@ -1542,6 +1446,48 @@ const $ZodJWT$1 = /*@__PURE__*/ $constructor$1("$ZodJWT", (inst, def) => {
|
|
|
1542
1446
|
});
|
|
1543
1447
|
};
|
|
1544
1448
|
});
|
|
1449
|
+
const $ZodNumber = /*@__PURE__*/ $constructor$1("$ZodNumber", (inst, def) => {
|
|
1450
|
+
$ZodType$1.init(inst, def);
|
|
1451
|
+
inst._zod.pattern = inst._zod.bag.pattern ?? number$4;
|
|
1452
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1453
|
+
if (def.coerce) try {
|
|
1454
|
+
payload.value = Number(payload.value);
|
|
1455
|
+
} catch (_) {}
|
|
1456
|
+
const input = payload.value;
|
|
1457
|
+
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
1458
|
+
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
1459
|
+
payload.issues.push({
|
|
1460
|
+
expected: "number",
|
|
1461
|
+
code: "invalid_type",
|
|
1462
|
+
input,
|
|
1463
|
+
inst,
|
|
1464
|
+
...received ? { received } : {}
|
|
1465
|
+
});
|
|
1466
|
+
return payload;
|
|
1467
|
+
};
|
|
1468
|
+
});
|
|
1469
|
+
const $ZodNumberFormat = /*@__PURE__*/ $constructor$1("$ZodNumberFormat", (inst, def) => {
|
|
1470
|
+
$ZodCheckNumberFormat.init(inst, def);
|
|
1471
|
+
$ZodNumber.init(inst, def);
|
|
1472
|
+
});
|
|
1473
|
+
const $ZodBoolean = /*@__PURE__*/ $constructor$1("$ZodBoolean", (inst, def) => {
|
|
1474
|
+
$ZodType$1.init(inst, def);
|
|
1475
|
+
inst._zod.pattern = boolean$2;
|
|
1476
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
1477
|
+
if (def.coerce) try {
|
|
1478
|
+
payload.value = Boolean(payload.value);
|
|
1479
|
+
} catch (_) {}
|
|
1480
|
+
const input = payload.value;
|
|
1481
|
+
if (typeof input === "boolean") return payload;
|
|
1482
|
+
payload.issues.push({
|
|
1483
|
+
expected: "boolean",
|
|
1484
|
+
code: "invalid_type",
|
|
1485
|
+
input,
|
|
1486
|
+
inst
|
|
1487
|
+
});
|
|
1488
|
+
return payload;
|
|
1489
|
+
};
|
|
1490
|
+
});
|
|
1545
1491
|
const $ZodUnknown$1 = /*@__PURE__*/ $constructor$1("$ZodUnknown", (inst, def) => {
|
|
1546
1492
|
$ZodType$1.init(inst, def);
|
|
1547
1493
|
inst._zod.parse = (payload) => payload;
|
|
@@ -1676,13 +1622,13 @@ const $ZodObject$1 = /*@__PURE__*/ $constructor$1("$ZodObject", (inst, def) => {
|
|
|
1676
1622
|
}
|
|
1677
1623
|
return propValues;
|
|
1678
1624
|
});
|
|
1679
|
-
const isObject
|
|
1625
|
+
const isObject = isObject$2;
|
|
1680
1626
|
const catchall = def.catchall;
|
|
1681
1627
|
let value;
|
|
1682
1628
|
inst._zod.parse = (payload, ctx) => {
|
|
1683
1629
|
value ?? (value = _normalized.value);
|
|
1684
1630
|
const input = payload.value;
|
|
1685
|
-
if (!isObject
|
|
1631
|
+
if (!isObject(input)) {
|
|
1686
1632
|
payload.issues.push({
|
|
1687
1633
|
expected: "object",
|
|
1688
1634
|
code: "invalid_type",
|
|
@@ -1805,15 +1751,16 @@ const $ZodObjectJIT$1 = /*@__PURE__*/ $constructor$1("$ZodObjectJIT", (inst, def
|
|
|
1805
1751
|
return (payload, ctx) => fn(shape, payload, ctx);
|
|
1806
1752
|
};
|
|
1807
1753
|
let fastpass;
|
|
1808
|
-
const isObject
|
|
1754
|
+
const isObject = isObject$2;
|
|
1809
1755
|
const jit = !globalConfig$1.jitless;
|
|
1810
|
-
const
|
|
1756
|
+
const allowsEval = allowsEval$1;
|
|
1757
|
+
const fastEnabled = jit && allowsEval.value;
|
|
1811
1758
|
const catchall = def.catchall;
|
|
1812
1759
|
let value;
|
|
1813
1760
|
inst._zod.parse = (payload, ctx) => {
|
|
1814
1761
|
value ?? (value = _normalized.value);
|
|
1815
1762
|
const input = payload.value;
|
|
1816
|
-
if (!isObject
|
|
1763
|
+
if (!isObject(input)) {
|
|
1817
1764
|
payload.issues.push({
|
|
1818
1765
|
expected: "object",
|
|
1819
1766
|
code: "invalid_type",
|
|
@@ -2112,6 +2059,24 @@ const $ZodEnum$1 = /*@__PURE__*/ $constructor$1("$ZodEnum", (inst, def) => {
|
|
|
2112
2059
|
return payload;
|
|
2113
2060
|
};
|
|
2114
2061
|
});
|
|
2062
|
+
const $ZodLiteral = /*@__PURE__*/ $constructor$1("$ZodLiteral", (inst, def) => {
|
|
2063
|
+
$ZodType$1.init(inst, def);
|
|
2064
|
+
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
2065
|
+
const values = new Set(def.values);
|
|
2066
|
+
inst._zod.values = values;
|
|
2067
|
+
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex$1(o) : o ? escapeRegex$1(o.toString()) : String(o)).join("|")})$`);
|
|
2068
|
+
inst._zod.parse = (payload, _ctx) => {
|
|
2069
|
+
const input = payload.value;
|
|
2070
|
+
if (values.has(input)) return payload;
|
|
2071
|
+
payload.issues.push({
|
|
2072
|
+
code: "invalid_value",
|
|
2073
|
+
values: def.values,
|
|
2074
|
+
input,
|
|
2075
|
+
inst
|
|
2076
|
+
});
|
|
2077
|
+
return payload;
|
|
2078
|
+
};
|
|
2079
|
+
});
|
|
2115
2080
|
const $ZodTransform$1 = /*@__PURE__*/ $constructor$1("$ZodTransform", (inst, def) => {
|
|
2116
2081
|
$ZodType$1.init(inst, def);
|
|
2117
2082
|
inst._zod.optin = "optional";
|
|
@@ -2337,9 +2302,12 @@ function handleRefineResult$1(result, payload, input, inst) {
|
|
|
2337
2302
|
continue: !inst._zod.def.abort
|
|
2338
2303
|
};
|
|
2339
2304
|
if (inst._zod.def.params) _iss.params = inst._zod.def.params;
|
|
2340
|
-
payload.issues.push(issue$
|
|
2305
|
+
payload.issues.push(issue$1(_iss));
|
|
2341
2306
|
}
|
|
2342
2307
|
}
|
|
2308
|
+
|
|
2309
|
+
//#endregion
|
|
2310
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
2343
2311
|
var _a$2;
|
|
2344
2312
|
var $ZodRegistry$1 = class {
|
|
2345
2313
|
constructor() {
|
|
@@ -2385,6 +2353,9 @@ function registry$1() {
|
|
|
2385
2353
|
}
|
|
2386
2354
|
(_a$2 = globalThis).__zod_globalRegistry ?? (_a$2.__zod_globalRegistry = registry$1());
|
|
2387
2355
|
const globalRegistry$1 = globalThis.__zod_globalRegistry;
|
|
2356
|
+
|
|
2357
|
+
//#endregion
|
|
2358
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
|
|
2388
2359
|
// @__NO_SIDE_EFFECTS__
|
|
2389
2360
|
function _string$1(Class, params) {
|
|
2390
2361
|
return new Class({
|
|
@@ -2661,6 +2632,31 @@ function _isoDuration$1(Class, params) {
|
|
|
2661
2632
|
});
|
|
2662
2633
|
}
|
|
2663
2634
|
// @__NO_SIDE_EFFECTS__
|
|
2635
|
+
function _number(Class, params) {
|
|
2636
|
+
return new Class({
|
|
2637
|
+
type: "number",
|
|
2638
|
+
checks: [],
|
|
2639
|
+
...normalizeParams$1(params)
|
|
2640
|
+
});
|
|
2641
|
+
}
|
|
2642
|
+
// @__NO_SIDE_EFFECTS__
|
|
2643
|
+
function _int(Class, params) {
|
|
2644
|
+
return new Class({
|
|
2645
|
+
type: "number",
|
|
2646
|
+
check: "number_format",
|
|
2647
|
+
abort: false,
|
|
2648
|
+
format: "safeint",
|
|
2649
|
+
...normalizeParams$1(params)
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2652
|
+
// @__NO_SIDE_EFFECTS__
|
|
2653
|
+
function _boolean(Class, params) {
|
|
2654
|
+
return new Class({
|
|
2655
|
+
type: "boolean",
|
|
2656
|
+
...normalizeParams$1(params)
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
// @__NO_SIDE_EFFECTS__
|
|
2664
2660
|
function _unknown$1(Class) {
|
|
2665
2661
|
return new Class({ type: "unknown" });
|
|
2666
2662
|
}
|
|
@@ -2672,6 +2668,50 @@ function _never$1(Class, params) {
|
|
|
2672
2668
|
});
|
|
2673
2669
|
}
|
|
2674
2670
|
// @__NO_SIDE_EFFECTS__
|
|
2671
|
+
function _lt(value, params) {
|
|
2672
|
+
return new $ZodCheckLessThan({
|
|
2673
|
+
check: "less_than",
|
|
2674
|
+
...normalizeParams$1(params),
|
|
2675
|
+
value,
|
|
2676
|
+
inclusive: false
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
// @__NO_SIDE_EFFECTS__
|
|
2680
|
+
function _lte(value, params) {
|
|
2681
|
+
return new $ZodCheckLessThan({
|
|
2682
|
+
check: "less_than",
|
|
2683
|
+
...normalizeParams$1(params),
|
|
2684
|
+
value,
|
|
2685
|
+
inclusive: true
|
|
2686
|
+
});
|
|
2687
|
+
}
|
|
2688
|
+
// @__NO_SIDE_EFFECTS__
|
|
2689
|
+
function _gt(value, params) {
|
|
2690
|
+
return new $ZodCheckGreaterThan({
|
|
2691
|
+
check: "greater_than",
|
|
2692
|
+
...normalizeParams$1(params),
|
|
2693
|
+
value,
|
|
2694
|
+
inclusive: false
|
|
2695
|
+
});
|
|
2696
|
+
}
|
|
2697
|
+
// @__NO_SIDE_EFFECTS__
|
|
2698
|
+
function _gte(value, params) {
|
|
2699
|
+
return new $ZodCheckGreaterThan({
|
|
2700
|
+
check: "greater_than",
|
|
2701
|
+
...normalizeParams$1(params),
|
|
2702
|
+
value,
|
|
2703
|
+
inclusive: true
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
// @__NO_SIDE_EFFECTS__
|
|
2707
|
+
function _multipleOf(value, params) {
|
|
2708
|
+
return new $ZodCheckMultipleOf({
|
|
2709
|
+
check: "multiple_of",
|
|
2710
|
+
...normalizeParams$1(params),
|
|
2711
|
+
value
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
// @__NO_SIDE_EFFECTS__
|
|
2675
2715
|
function _maxLength$1(maximum, params) {
|
|
2676
2716
|
return new $ZodCheckMaxLength$1({
|
|
2677
2717
|
check: "max_length",
|
|
@@ -2794,16 +2834,16 @@ function _refine$1(Class, fn, _params) {
|
|
|
2794
2834
|
// @__NO_SIDE_EFFECTS__
|
|
2795
2835
|
function _superRefine$1(fn, params) {
|
|
2796
2836
|
const ch = /* @__PURE__ */ _check$1((payload) => {
|
|
2797
|
-
payload.addIssue = (issue
|
|
2798
|
-
if (typeof issue
|
|
2837
|
+
payload.addIssue = (issue) => {
|
|
2838
|
+
if (typeof issue === "string") payload.issues.push(issue$1(issue, payload.value, ch._zod.def));
|
|
2799
2839
|
else {
|
|
2800
|
-
const _issue = issue
|
|
2840
|
+
const _issue = issue;
|
|
2801
2841
|
if (_issue.fatal) _issue.continue = false;
|
|
2802
2842
|
_issue.code ?? (_issue.code = "custom");
|
|
2803
2843
|
_issue.input ?? (_issue.input = payload.value);
|
|
2804
2844
|
_issue.inst ?? (_issue.inst = ch);
|
|
2805
2845
|
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
2806
|
-
payload.issues.push(issue$
|
|
2846
|
+
payload.issues.push(issue$1(_issue));
|
|
2807
2847
|
}
|
|
2808
2848
|
};
|
|
2809
2849
|
return fn(payload.value, payload);
|
|
@@ -2819,6 +2859,9 @@ function _check$1(fn, params) {
|
|
|
2819
2859
|
ch._zod.check = fn;
|
|
2820
2860
|
return ch;
|
|
2821
2861
|
}
|
|
2862
|
+
|
|
2863
|
+
//#endregion
|
|
2864
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
|
|
2822
2865
|
function initializeContext$1(params) {
|
|
2823
2866
|
let target = params?.target ?? "draft-2020-12";
|
|
2824
2867
|
if (target === "draft-4") target = "draft-04";
|
|
@@ -2837,7 +2880,7 @@ function initializeContext$1(params) {
|
|
|
2837
2880
|
external: params?.external ?? void 0
|
|
2838
2881
|
};
|
|
2839
2882
|
}
|
|
2840
|
-
function process$
|
|
2883
|
+
function process$2(schema, ctx, _params = {
|
|
2841
2884
|
path: [],
|
|
2842
2885
|
schemaPath: []
|
|
2843
2886
|
}) {
|
|
@@ -2874,7 +2917,7 @@ function process$1$1(schema, ctx, _params = {
|
|
|
2874
2917
|
const parent = schema._zod.parent;
|
|
2875
2918
|
if (parent) {
|
|
2876
2919
|
if (!result.ref) result.ref = parent;
|
|
2877
|
-
process$
|
|
2920
|
+
process$2(parent, ctx, params);
|
|
2878
2921
|
ctx.seen.get(parent).isParent = true;
|
|
2879
2922
|
}
|
|
2880
2923
|
}
|
|
@@ -3094,7 +3137,7 @@ const createToJSONSchemaMethod$1 = (schema, processors = {}) => (params) => {
|
|
|
3094
3137
|
...params,
|
|
3095
3138
|
processors
|
|
3096
3139
|
});
|
|
3097
|
-
process$
|
|
3140
|
+
process$2(schema, ctx);
|
|
3098
3141
|
extractDefs$1(ctx, schema);
|
|
3099
3142
|
return finalize$1(ctx, schema);
|
|
3100
3143
|
};
|
|
@@ -3106,10 +3149,13 @@ const createStandardJSONSchemaMethod$1 = (schema, io, processors = {}) => (param
|
|
|
3106
3149
|
io,
|
|
3107
3150
|
processors
|
|
3108
3151
|
});
|
|
3109
|
-
process$
|
|
3152
|
+
process$2(schema, ctx);
|
|
3110
3153
|
extractDefs$1(ctx, schema);
|
|
3111
3154
|
return finalize$1(ctx, schema);
|
|
3112
3155
|
};
|
|
3156
|
+
|
|
3157
|
+
//#endregion
|
|
3158
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
|
|
3113
3159
|
const formatMap$1 = {
|
|
3114
3160
|
guid: "uuid",
|
|
3115
3161
|
url: "uri",
|
|
@@ -3138,9 +3184,33 @@ const stringProcessor$1 = (schema, ctx, _json, _params) => {
|
|
|
3138
3184
|
}))];
|
|
3139
3185
|
}
|
|
3140
3186
|
};
|
|
3187
|
+
const numberProcessor = (schema, ctx, _json, _params) => {
|
|
3188
|
+
const json = _json;
|
|
3189
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
3190
|
+
if (typeof format === "string" && format.includes("int")) json.type = "integer";
|
|
3191
|
+
else json.type = "number";
|
|
3192
|
+
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
3193
|
+
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
3194
|
+
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
3195
|
+
if (exMin) if (legacy) {
|
|
3196
|
+
json.minimum = exclusiveMinimum;
|
|
3197
|
+
json.exclusiveMinimum = true;
|
|
3198
|
+
} else json.exclusiveMinimum = exclusiveMinimum;
|
|
3199
|
+
else if (typeof minimum === "number") json.minimum = minimum;
|
|
3200
|
+
if (exMax) if (legacy) {
|
|
3201
|
+
json.maximum = exclusiveMaximum;
|
|
3202
|
+
json.exclusiveMaximum = true;
|
|
3203
|
+
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
3204
|
+
else if (typeof maximum === "number") json.maximum = maximum;
|
|
3205
|
+
if (typeof multipleOf === "number") json.multipleOf = multipleOf;
|
|
3206
|
+
};
|
|
3207
|
+
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
3208
|
+
json.type = "boolean";
|
|
3209
|
+
};
|
|
3141
3210
|
const neverProcessor$1 = (_schema, _ctx, json, _params) => {
|
|
3142
3211
|
json.not = {};
|
|
3143
3212
|
};
|
|
3213
|
+
const unknownProcessor = (_schema, _ctx, _json, _params) => {};
|
|
3144
3214
|
const enumProcessor$1 = (schema, _ctx, json, _params) => {
|
|
3145
3215
|
const def = schema._zod.def;
|
|
3146
3216
|
const values = getEnumValues$1(def.entries);
|
|
@@ -3148,6 +3218,27 @@ const enumProcessor$1 = (schema, _ctx, json, _params) => {
|
|
|
3148
3218
|
if (values.every((v) => typeof v === "string")) json.type = "string";
|
|
3149
3219
|
json.enum = values;
|
|
3150
3220
|
};
|
|
3221
|
+
const literalProcessor = (schema, ctx, json, _params) => {
|
|
3222
|
+
const def = schema._zod.def;
|
|
3223
|
+
const vals = [];
|
|
3224
|
+
for (const val of def.values) if (val === void 0) {
|
|
3225
|
+
if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
3226
|
+
} else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
3227
|
+
else vals.push(Number(val));
|
|
3228
|
+
else vals.push(val);
|
|
3229
|
+
if (vals.length === 0) {} else if (vals.length === 1) {
|
|
3230
|
+
const val = vals[0];
|
|
3231
|
+
json.type = val === null ? "null" : typeof val;
|
|
3232
|
+
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
|
|
3233
|
+
else json.const = val;
|
|
3234
|
+
} else {
|
|
3235
|
+
if (vals.every((v) => typeof v === "number")) json.type = "number";
|
|
3236
|
+
if (vals.every((v) => typeof v === "string")) json.type = "string";
|
|
3237
|
+
if (vals.every((v) => typeof v === "boolean")) json.type = "boolean";
|
|
3238
|
+
if (vals.every((v) => v === null)) json.type = "null";
|
|
3239
|
+
json.enum = vals;
|
|
3240
|
+
}
|
|
3241
|
+
};
|
|
3151
3242
|
const customProcessor$1 = (_schema, ctx, _json, _params) => {
|
|
3152
3243
|
if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
|
|
3153
3244
|
};
|
|
@@ -3161,7 +3252,7 @@ const arrayProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3161
3252
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
3162
3253
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
3163
3254
|
json.type = "array";
|
|
3164
|
-
json.items = process$
|
|
3255
|
+
json.items = process$2(def.element, ctx, {
|
|
3165
3256
|
...params,
|
|
3166
3257
|
path: [...params.path, "items"]
|
|
3167
3258
|
});
|
|
@@ -3172,7 +3263,7 @@ const objectProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3172
3263
|
json.type = "object";
|
|
3173
3264
|
json.properties = {};
|
|
3174
3265
|
const shape = def.shape;
|
|
3175
|
-
for (const key in shape) json.properties[key] = process$
|
|
3266
|
+
for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
|
|
3176
3267
|
...params,
|
|
3177
3268
|
path: [
|
|
3178
3269
|
...params.path,
|
|
@@ -3190,7 +3281,7 @@ const objectProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3190
3281
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
3191
3282
|
else if (!def.catchall) {
|
|
3192
3283
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
3193
|
-
} else if (def.catchall) json.additionalProperties = process$
|
|
3284
|
+
} else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
|
|
3194
3285
|
...params,
|
|
3195
3286
|
path: [...params.path, "additionalProperties"]
|
|
3196
3287
|
});
|
|
@@ -3198,7 +3289,7 @@ const objectProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3198
3289
|
const unionProcessor$1 = (schema, ctx, json, params) => {
|
|
3199
3290
|
const def = schema._zod.def;
|
|
3200
3291
|
const isExclusive = def.inclusive === false;
|
|
3201
|
-
const options = def.options.map((x, i) => process$
|
|
3292
|
+
const options = def.options.map((x, i) => process$2(x, ctx, {
|
|
3202
3293
|
...params,
|
|
3203
3294
|
path: [
|
|
3204
3295
|
...params.path,
|
|
@@ -3211,7 +3302,7 @@ const unionProcessor$1 = (schema, ctx, json, params) => {
|
|
|
3211
3302
|
};
|
|
3212
3303
|
const intersectionProcessor$1 = (schema, ctx, json, params) => {
|
|
3213
3304
|
const def = schema._zod.def;
|
|
3214
|
-
const a = process$
|
|
3305
|
+
const a = process$2(def.left, ctx, {
|
|
3215
3306
|
...params,
|
|
3216
3307
|
path: [
|
|
3217
3308
|
...params.path,
|
|
@@ -3219,7 +3310,7 @@ const intersectionProcessor$1 = (schema, ctx, json, params) => {
|
|
|
3219
3310
|
0
|
|
3220
3311
|
]
|
|
3221
3312
|
});
|
|
3222
|
-
const b = process$
|
|
3313
|
+
const b = process$2(def.right, ctx, {
|
|
3223
3314
|
...params,
|
|
3224
3315
|
path: [
|
|
3225
3316
|
...params.path,
|
|
@@ -3237,7 +3328,7 @@ const recordProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3237
3328
|
const keyType = def.keyType;
|
|
3238
3329
|
const patterns = keyType._zod.bag?.patterns;
|
|
3239
3330
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
3240
|
-
const valueSchema = process$
|
|
3331
|
+
const valueSchema = process$2(def.valueType, ctx, {
|
|
3241
3332
|
...params,
|
|
3242
3333
|
path: [
|
|
3243
3334
|
...params.path,
|
|
@@ -3248,11 +3339,11 @@ const recordProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3248
3339
|
json.patternProperties = {};
|
|
3249
3340
|
for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
|
|
3250
3341
|
} else {
|
|
3251
|
-
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$
|
|
3342
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$2(def.keyType, ctx, {
|
|
3252
3343
|
...params,
|
|
3253
3344
|
path: [...params.path, "propertyNames"]
|
|
3254
3345
|
});
|
|
3255
|
-
json.additionalProperties = process$
|
|
3346
|
+
json.additionalProperties = process$2(def.valueType, ctx, {
|
|
3256
3347
|
...params,
|
|
3257
3348
|
path: [...params.path, "additionalProperties"]
|
|
3258
3349
|
});
|
|
@@ -3265,7 +3356,7 @@ const recordProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3265
3356
|
};
|
|
3266
3357
|
const nullableProcessor$1 = (schema, ctx, json, params) => {
|
|
3267
3358
|
const def = schema._zod.def;
|
|
3268
|
-
const inner = process$
|
|
3359
|
+
const inner = process$2(def.innerType, ctx, params);
|
|
3269
3360
|
const seen = ctx.seen.get(schema);
|
|
3270
3361
|
if (ctx.target === "openapi-3.0") {
|
|
3271
3362
|
seen.ref = def.innerType;
|
|
@@ -3274,27 +3365,27 @@ const nullableProcessor$1 = (schema, ctx, json, params) => {
|
|
|
3274
3365
|
};
|
|
3275
3366
|
const nonoptionalProcessor$1 = (schema, ctx, _json, params) => {
|
|
3276
3367
|
const def = schema._zod.def;
|
|
3277
|
-
process$
|
|
3368
|
+
process$2(def.innerType, ctx, params);
|
|
3278
3369
|
const seen = ctx.seen.get(schema);
|
|
3279
3370
|
seen.ref = def.innerType;
|
|
3280
3371
|
};
|
|
3281
3372
|
const defaultProcessor$1 = (schema, ctx, json, params) => {
|
|
3282
3373
|
const def = schema._zod.def;
|
|
3283
|
-
process$
|
|
3374
|
+
process$2(def.innerType, ctx, params);
|
|
3284
3375
|
const seen = ctx.seen.get(schema);
|
|
3285
3376
|
seen.ref = def.innerType;
|
|
3286
3377
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
3287
3378
|
};
|
|
3288
3379
|
const prefaultProcessor$1 = (schema, ctx, json, params) => {
|
|
3289
3380
|
const def = schema._zod.def;
|
|
3290
|
-
process$
|
|
3381
|
+
process$2(def.innerType, ctx, params);
|
|
3291
3382
|
const seen = ctx.seen.get(schema);
|
|
3292
3383
|
seen.ref = def.innerType;
|
|
3293
3384
|
if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
3294
3385
|
};
|
|
3295
3386
|
const catchProcessor$1 = (schema, ctx, json, params) => {
|
|
3296
3387
|
const def = schema._zod.def;
|
|
3297
|
-
process$
|
|
3388
|
+
process$2(def.innerType, ctx, params);
|
|
3298
3389
|
const seen = ctx.seen.get(schema);
|
|
3299
3390
|
seen.ref = def.innerType;
|
|
3300
3391
|
let catchValue;
|
|
@@ -3309,51 +3400,57 @@ const pipeProcessor$1 = (schema, ctx, _json, params) => {
|
|
|
3309
3400
|
const def = schema._zod.def;
|
|
3310
3401
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
3311
3402
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
3312
|
-
process$
|
|
3403
|
+
process$2(innerType, ctx, params);
|
|
3313
3404
|
const seen = ctx.seen.get(schema);
|
|
3314
3405
|
seen.ref = innerType;
|
|
3315
3406
|
};
|
|
3316
3407
|
const readonlyProcessor$1 = (schema, ctx, json, params) => {
|
|
3317
3408
|
const def = schema._zod.def;
|
|
3318
|
-
process$
|
|
3409
|
+
process$2(def.innerType, ctx, params);
|
|
3319
3410
|
const seen = ctx.seen.get(schema);
|
|
3320
3411
|
seen.ref = def.innerType;
|
|
3321
3412
|
json.readOnly = true;
|
|
3322
3413
|
};
|
|
3323
3414
|
const optionalProcessor$1 = (schema, ctx, _json, params) => {
|
|
3324
3415
|
const def = schema._zod.def;
|
|
3325
|
-
process$
|
|
3416
|
+
process$2(def.innerType, ctx, params);
|
|
3326
3417
|
const seen = ctx.seen.get(schema);
|
|
3327
3418
|
seen.ref = def.innerType;
|
|
3328
3419
|
};
|
|
3420
|
+
|
|
3421
|
+
//#endregion
|
|
3422
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
|
|
3329
3423
|
const ZodISODateTime$1 = /*@__PURE__*/ $constructor$1("ZodISODateTime", (inst, def) => {
|
|
3330
3424
|
$ZodISODateTime$1.init(inst, def);
|
|
3331
3425
|
ZodStringFormat$1.init(inst, def);
|
|
3332
3426
|
});
|
|
3333
3427
|
function datetime$2(params) {
|
|
3334
|
-
return
|
|
3428
|
+
return _isoDateTime$1(ZodISODateTime$1, params);
|
|
3335
3429
|
}
|
|
3336
3430
|
const ZodISODate$1 = /*@__PURE__*/ $constructor$1("ZodISODate", (inst, def) => {
|
|
3337
3431
|
$ZodISODate$1.init(inst, def);
|
|
3338
3432
|
ZodStringFormat$1.init(inst, def);
|
|
3339
3433
|
});
|
|
3340
|
-
function date$
|
|
3341
|
-
return
|
|
3434
|
+
function date$3(params) {
|
|
3435
|
+
return _isoDate$1(ZodISODate$1, params);
|
|
3342
3436
|
}
|
|
3343
3437
|
const ZodISOTime$1 = /*@__PURE__*/ $constructor$1("ZodISOTime", (inst, def) => {
|
|
3344
3438
|
$ZodISOTime$1.init(inst, def);
|
|
3345
3439
|
ZodStringFormat$1.init(inst, def);
|
|
3346
3440
|
});
|
|
3347
3441
|
function time$2(params) {
|
|
3348
|
-
return
|
|
3442
|
+
return _isoTime$1(ZodISOTime$1, params);
|
|
3349
3443
|
}
|
|
3350
3444
|
const ZodISODuration$1 = /*@__PURE__*/ $constructor$1("ZodISODuration", (inst, def) => {
|
|
3351
3445
|
$ZodISODuration$1.init(inst, def);
|
|
3352
3446
|
ZodStringFormat$1.init(inst, def);
|
|
3353
3447
|
});
|
|
3354
3448
|
function duration$2(params) {
|
|
3355
|
-
return
|
|
3449
|
+
return _isoDuration$1(ZodISODuration$1, params);
|
|
3356
3450
|
}
|
|
3451
|
+
|
|
3452
|
+
//#endregion
|
|
3453
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
|
|
3357
3454
|
const initializer$2 = (inst, issues) => {
|
|
3358
3455
|
$ZodError$1.init(inst, issues);
|
|
3359
3456
|
inst.name = "ZodError";
|
|
@@ -3374,6 +3471,9 @@ const initializer$2 = (inst, issues) => {
|
|
|
3374
3471
|
});
|
|
3375
3472
|
};
|
|
3376
3473
|
const ZodRealError$1 = /*@__PURE__*/ $constructor$1("ZodError", initializer$2, { Parent: Error });
|
|
3474
|
+
|
|
3475
|
+
//#endregion
|
|
3476
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
|
|
3377
3477
|
const parse$2 = /* @__PURE__ */ _parse$1(ZodRealError$1);
|
|
3378
3478
|
const parseAsync$1 = /* @__PURE__ */ _parseAsync$1(ZodRealError$1);
|
|
3379
3479
|
const safeParse$2 = /* @__PURE__ */ _safeParse$1(ZodRealError$1);
|
|
@@ -3386,6 +3486,9 @@ const safeEncode$1 = /* @__PURE__ */ _safeEncode$1(ZodRealError$1);
|
|
|
3386
3486
|
const safeDecode$1 = /* @__PURE__ */ _safeDecode$1(ZodRealError$1);
|
|
3387
3487
|
const safeEncodeAsync$1 = /* @__PURE__ */ _safeEncodeAsync$1(ZodRealError$1);
|
|
3388
3488
|
const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync$1(ZodRealError$1);
|
|
3489
|
+
|
|
3490
|
+
//#endregion
|
|
3491
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
|
|
3389
3492
|
const _installedGroups$1 = /* @__PURE__ */ new WeakMap();
|
|
3390
3493
|
function _installLazyMethods$1(inst, group, methods) {
|
|
3391
3494
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -3474,7 +3577,7 @@ const ZodType$1 = /*@__PURE__*/ $constructor$1("ZodType", (inst, def) => {
|
|
|
3474
3577
|
return this.check(superRefine$1(refinement, params));
|
|
3475
3578
|
},
|
|
3476
3579
|
overwrite(fn) {
|
|
3477
|
-
return this.check(
|
|
3580
|
+
return this.check(_overwrite$1(fn));
|
|
3478
3581
|
},
|
|
3479
3582
|
optional() {
|
|
3480
3583
|
return optional$3(this);
|
|
@@ -3558,85 +3661,85 @@ const _ZodString$1 = /*@__PURE__*/ $constructor$1("_ZodString", (inst, def) => {
|
|
|
3558
3661
|
inst.maxLength = bag.maximum ?? null;
|
|
3559
3662
|
_installLazyMethods$1(inst, "_ZodString", {
|
|
3560
3663
|
regex(...args) {
|
|
3561
|
-
return this.check(
|
|
3664
|
+
return this.check(_regex$1(...args));
|
|
3562
3665
|
},
|
|
3563
3666
|
includes(...args) {
|
|
3564
|
-
return this.check(
|
|
3667
|
+
return this.check(_includes$1(...args));
|
|
3565
3668
|
},
|
|
3566
3669
|
startsWith(...args) {
|
|
3567
|
-
return this.check(
|
|
3670
|
+
return this.check(_startsWith$1(...args));
|
|
3568
3671
|
},
|
|
3569
3672
|
endsWith(...args) {
|
|
3570
|
-
return this.check(
|
|
3673
|
+
return this.check(_endsWith$1(...args));
|
|
3571
3674
|
},
|
|
3572
3675
|
min(...args) {
|
|
3573
|
-
return this.check(
|
|
3676
|
+
return this.check(_minLength$1(...args));
|
|
3574
3677
|
},
|
|
3575
3678
|
max(...args) {
|
|
3576
|
-
return this.check(
|
|
3679
|
+
return this.check(_maxLength$1(...args));
|
|
3577
3680
|
},
|
|
3578
3681
|
length(...args) {
|
|
3579
|
-
return this.check(
|
|
3682
|
+
return this.check(_length$1(...args));
|
|
3580
3683
|
},
|
|
3581
3684
|
nonempty(...args) {
|
|
3582
|
-
return this.check(
|
|
3685
|
+
return this.check(_minLength$1(1, ...args));
|
|
3583
3686
|
},
|
|
3584
3687
|
lowercase(params) {
|
|
3585
|
-
return this.check(
|
|
3688
|
+
return this.check(_lowercase$1(params));
|
|
3586
3689
|
},
|
|
3587
3690
|
uppercase(params) {
|
|
3588
|
-
return this.check(
|
|
3691
|
+
return this.check(_uppercase$1(params));
|
|
3589
3692
|
},
|
|
3590
3693
|
trim() {
|
|
3591
|
-
return this.check(
|
|
3694
|
+
return this.check(_trim$1());
|
|
3592
3695
|
},
|
|
3593
3696
|
normalize(...args) {
|
|
3594
|
-
return this.check(
|
|
3697
|
+
return this.check(_normalize$1(...args));
|
|
3595
3698
|
},
|
|
3596
3699
|
toLowerCase() {
|
|
3597
|
-
return this.check(
|
|
3700
|
+
return this.check(_toLowerCase$1());
|
|
3598
3701
|
},
|
|
3599
3702
|
toUpperCase() {
|
|
3600
|
-
return this.check(
|
|
3703
|
+
return this.check(_toUpperCase$1());
|
|
3601
3704
|
},
|
|
3602
3705
|
slugify() {
|
|
3603
|
-
return this.check(
|
|
3706
|
+
return this.check(_slugify$1());
|
|
3604
3707
|
}
|
|
3605
3708
|
});
|
|
3606
3709
|
});
|
|
3607
3710
|
const ZodString$1 = /*@__PURE__*/ $constructor$1("ZodString", (inst, def) => {
|
|
3608
3711
|
$ZodString$1.init(inst, def);
|
|
3609
3712
|
_ZodString$1.init(inst, def);
|
|
3610
|
-
inst.email = (params) => inst.check(
|
|
3611
|
-
inst.url = (params) => inst.check(
|
|
3612
|
-
inst.jwt = (params) => inst.check(
|
|
3613
|
-
inst.emoji = (params) => inst.check(
|
|
3614
|
-
inst.guid = (params) => inst.check(
|
|
3615
|
-
inst.uuid = (params) => inst.check(
|
|
3616
|
-
inst.uuidv4 = (params) => inst.check(
|
|
3617
|
-
inst.uuidv6 = (params) => inst.check(
|
|
3618
|
-
inst.uuidv7 = (params) => inst.check(
|
|
3619
|
-
inst.nanoid = (params) => inst.check(
|
|
3620
|
-
inst.guid = (params) => inst.check(
|
|
3621
|
-
inst.cuid = (params) => inst.check(
|
|
3622
|
-
inst.cuid2 = (params) => inst.check(
|
|
3623
|
-
inst.ulid = (params) => inst.check(
|
|
3624
|
-
inst.base64 = (params) => inst.check(
|
|
3625
|
-
inst.base64url = (params) => inst.check(
|
|
3626
|
-
inst.xid = (params) => inst.check(
|
|
3627
|
-
inst.ksuid = (params) => inst.check(
|
|
3628
|
-
inst.ipv4 = (params) => inst.check(
|
|
3629
|
-
inst.ipv6 = (params) => inst.check(
|
|
3630
|
-
inst.cidrv4 = (params) => inst.check(
|
|
3631
|
-
inst.cidrv6 = (params) => inst.check(
|
|
3632
|
-
inst.e164 = (params) => inst.check(
|
|
3713
|
+
inst.email = (params) => inst.check(_email$1(ZodEmail$1, params));
|
|
3714
|
+
inst.url = (params) => inst.check(_url$1(ZodURL$1, params));
|
|
3715
|
+
inst.jwt = (params) => inst.check(_jwt$1(ZodJWT$1, params));
|
|
3716
|
+
inst.emoji = (params) => inst.check(_emoji$2(ZodEmoji$1, params));
|
|
3717
|
+
inst.guid = (params) => inst.check(_guid$1(ZodGUID$1, params));
|
|
3718
|
+
inst.uuid = (params) => inst.check(_uuid$1(ZodUUID$1, params));
|
|
3719
|
+
inst.uuidv4 = (params) => inst.check(_uuidv4$1(ZodUUID$1, params));
|
|
3720
|
+
inst.uuidv6 = (params) => inst.check(_uuidv6$1(ZodUUID$1, params));
|
|
3721
|
+
inst.uuidv7 = (params) => inst.check(_uuidv7$1(ZodUUID$1, params));
|
|
3722
|
+
inst.nanoid = (params) => inst.check(_nanoid$1(ZodNanoID$1, params));
|
|
3723
|
+
inst.guid = (params) => inst.check(_guid$1(ZodGUID$1, params));
|
|
3724
|
+
inst.cuid = (params) => inst.check(_cuid$1(ZodCUID$1, params));
|
|
3725
|
+
inst.cuid2 = (params) => inst.check(_cuid2$1(ZodCUID2$1, params));
|
|
3726
|
+
inst.ulid = (params) => inst.check(_ulid$1(ZodULID$1, params));
|
|
3727
|
+
inst.base64 = (params) => inst.check(_base64$1(ZodBase64$1, params));
|
|
3728
|
+
inst.base64url = (params) => inst.check(_base64url$1(ZodBase64URL$1, params));
|
|
3729
|
+
inst.xid = (params) => inst.check(_xid$1(ZodXID$1, params));
|
|
3730
|
+
inst.ksuid = (params) => inst.check(_ksuid$1(ZodKSUID$1, params));
|
|
3731
|
+
inst.ipv4 = (params) => inst.check(_ipv4$1(ZodIPv4$1, params));
|
|
3732
|
+
inst.ipv6 = (params) => inst.check(_ipv6$1(ZodIPv6$1, params));
|
|
3733
|
+
inst.cidrv4 = (params) => inst.check(_cidrv4$1(ZodCIDRv4$1, params));
|
|
3734
|
+
inst.cidrv6 = (params) => inst.check(_cidrv6$1(ZodCIDRv6$1, params));
|
|
3735
|
+
inst.e164 = (params) => inst.check(_e164$1(ZodE164$1, params));
|
|
3633
3736
|
inst.datetime = (params) => inst.check(datetime$2(params));
|
|
3634
|
-
inst.date = (params) => inst.check(date$
|
|
3737
|
+
inst.date = (params) => inst.check(date$3(params));
|
|
3635
3738
|
inst.time = (params) => inst.check(time$2(params));
|
|
3636
3739
|
inst.duration = (params) => inst.check(duration$2(params));
|
|
3637
3740
|
});
|
|
3638
|
-
function string$
|
|
3639
|
-
return
|
|
3741
|
+
function string$3(params) {
|
|
3742
|
+
return _string$1(ZodString$1, params);
|
|
3640
3743
|
}
|
|
3641
3744
|
const ZodStringFormat$1 = /*@__PURE__*/ $constructor$1("ZodStringFormat", (inst, def) => {
|
|
3642
3745
|
$ZodStringFormat$1.init(inst, def);
|
|
@@ -3658,6 +3761,9 @@ const ZodURL$1 = /*@__PURE__*/ $constructor$1("ZodURL", (inst, def) => {
|
|
|
3658
3761
|
$ZodURL$1.init(inst, def);
|
|
3659
3762
|
ZodStringFormat$1.init(inst, def);
|
|
3660
3763
|
});
|
|
3764
|
+
function url(params) {
|
|
3765
|
+
return _url$1(ZodURL$1, params);
|
|
3766
|
+
}
|
|
3661
3767
|
const ZodEmoji$1 = /*@__PURE__*/ $constructor$1("ZodEmoji", (inst, def) => {
|
|
3662
3768
|
$ZodEmoji$1.init(inst, def);
|
|
3663
3769
|
ZodStringFormat$1.init(inst, def);
|
|
@@ -3723,13 +3829,89 @@ const ZodJWT$1 = /*@__PURE__*/ $constructor$1("ZodJWT", (inst, def) => {
|
|
|
3723
3829
|
$ZodJWT$1.init(inst, def);
|
|
3724
3830
|
ZodStringFormat$1.init(inst, def);
|
|
3725
3831
|
});
|
|
3832
|
+
const ZodNumber = /*@__PURE__*/ $constructor$1("ZodNumber", (inst, def) => {
|
|
3833
|
+
$ZodNumber.init(inst, def);
|
|
3834
|
+
ZodType$1.init(inst, def);
|
|
3835
|
+
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
3836
|
+
_installLazyMethods$1(inst, "ZodNumber", {
|
|
3837
|
+
gt(value, params) {
|
|
3838
|
+
return this.check(_gt(value, params));
|
|
3839
|
+
},
|
|
3840
|
+
gte(value, params) {
|
|
3841
|
+
return this.check(_gte(value, params));
|
|
3842
|
+
},
|
|
3843
|
+
min(value, params) {
|
|
3844
|
+
return this.check(_gte(value, params));
|
|
3845
|
+
},
|
|
3846
|
+
lt(value, params) {
|
|
3847
|
+
return this.check(_lt(value, params));
|
|
3848
|
+
},
|
|
3849
|
+
lte(value, params) {
|
|
3850
|
+
return this.check(_lte(value, params));
|
|
3851
|
+
},
|
|
3852
|
+
max(value, params) {
|
|
3853
|
+
return this.check(_lte(value, params));
|
|
3854
|
+
},
|
|
3855
|
+
int(params) {
|
|
3856
|
+
return this.check(int(params));
|
|
3857
|
+
},
|
|
3858
|
+
safe(params) {
|
|
3859
|
+
return this.check(int(params));
|
|
3860
|
+
},
|
|
3861
|
+
positive(params) {
|
|
3862
|
+
return this.check(_gt(0, params));
|
|
3863
|
+
},
|
|
3864
|
+
nonnegative(params) {
|
|
3865
|
+
return this.check(_gte(0, params));
|
|
3866
|
+
},
|
|
3867
|
+
negative(params) {
|
|
3868
|
+
return this.check(_lt(0, params));
|
|
3869
|
+
},
|
|
3870
|
+
nonpositive(params) {
|
|
3871
|
+
return this.check(_lte(0, params));
|
|
3872
|
+
},
|
|
3873
|
+
multipleOf(value, params) {
|
|
3874
|
+
return this.check(_multipleOf(value, params));
|
|
3875
|
+
},
|
|
3876
|
+
step(value, params) {
|
|
3877
|
+
return this.check(_multipleOf(value, params));
|
|
3878
|
+
},
|
|
3879
|
+
finite() {
|
|
3880
|
+
return this;
|
|
3881
|
+
}
|
|
3882
|
+
});
|
|
3883
|
+
const bag = inst._zod.bag;
|
|
3884
|
+
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
3885
|
+
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
3886
|
+
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
3887
|
+
inst.isFinite = true;
|
|
3888
|
+
inst.format = bag.format ?? null;
|
|
3889
|
+
});
|
|
3890
|
+
function number$3(params) {
|
|
3891
|
+
return _number(ZodNumber, params);
|
|
3892
|
+
}
|
|
3893
|
+
const ZodNumberFormat = /*@__PURE__*/ $constructor$1("ZodNumberFormat", (inst, def) => {
|
|
3894
|
+
$ZodNumberFormat.init(inst, def);
|
|
3895
|
+
ZodNumber.init(inst, def);
|
|
3896
|
+
});
|
|
3897
|
+
function int(params) {
|
|
3898
|
+
return _int(ZodNumberFormat, params);
|
|
3899
|
+
}
|
|
3900
|
+
const ZodBoolean = /*@__PURE__*/ $constructor$1("ZodBoolean", (inst, def) => {
|
|
3901
|
+
$ZodBoolean.init(inst, def);
|
|
3902
|
+
ZodType$1.init(inst, def);
|
|
3903
|
+
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
3904
|
+
});
|
|
3905
|
+
function boolean$1(params) {
|
|
3906
|
+
return _boolean(ZodBoolean, params);
|
|
3907
|
+
}
|
|
3726
3908
|
const ZodUnknown$1 = /*@__PURE__*/ $constructor$1("ZodUnknown", (inst, def) => {
|
|
3727
3909
|
$ZodUnknown$1.init(inst, def);
|
|
3728
3910
|
ZodType$1.init(inst, def);
|
|
3729
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
3911
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
|
|
3730
3912
|
});
|
|
3731
3913
|
function unknown$3() {
|
|
3732
|
-
return
|
|
3914
|
+
return _unknown$1(ZodUnknown$1);
|
|
3733
3915
|
}
|
|
3734
3916
|
const ZodNever$1 = /*@__PURE__*/ $constructor$1("ZodNever", (inst, def) => {
|
|
3735
3917
|
$ZodNever$1.init(inst, def);
|
|
@@ -3737,7 +3919,7 @@ const ZodNever$1 = /*@__PURE__*/ $constructor$1("ZodNever", (inst, def) => {
|
|
|
3737
3919
|
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor$1(inst, ctx, json, params);
|
|
3738
3920
|
});
|
|
3739
3921
|
function never$1(params) {
|
|
3740
|
-
return
|
|
3922
|
+
return _never$1(ZodNever$1, params);
|
|
3741
3923
|
}
|
|
3742
3924
|
const ZodArray$1 = /*@__PURE__*/ $constructor$1("ZodArray", (inst, def) => {
|
|
3743
3925
|
$ZodArray$1.init(inst, def);
|
|
@@ -3746,16 +3928,16 @@ const ZodArray$1 = /*@__PURE__*/ $constructor$1("ZodArray", (inst, def) => {
|
|
|
3746
3928
|
inst.element = def.element;
|
|
3747
3929
|
_installLazyMethods$1(inst, "ZodArray", {
|
|
3748
3930
|
min(n, params) {
|
|
3749
|
-
return this.check(
|
|
3931
|
+
return this.check(_minLength$1(n, params));
|
|
3750
3932
|
},
|
|
3751
3933
|
nonempty(params) {
|
|
3752
|
-
return this.check(
|
|
3934
|
+
return this.check(_minLength$1(1, params));
|
|
3753
3935
|
},
|
|
3754
3936
|
max(n, params) {
|
|
3755
|
-
return this.check(
|
|
3937
|
+
return this.check(_maxLength$1(n, params));
|
|
3756
3938
|
},
|
|
3757
3939
|
length(n, params) {
|
|
3758
|
-
return this.check(
|
|
3940
|
+
return this.check(_length$1(n, params));
|
|
3759
3941
|
},
|
|
3760
3942
|
unwrap() {
|
|
3761
3943
|
return this.element;
|
|
@@ -3763,7 +3945,7 @@ const ZodArray$1 = /*@__PURE__*/ $constructor$1("ZodArray", (inst, def) => {
|
|
|
3763
3945
|
});
|
|
3764
3946
|
});
|
|
3765
3947
|
function array$1(element, params) {
|
|
3766
|
-
return
|
|
3948
|
+
return _array$1(ZodArray$1, element, params);
|
|
3767
3949
|
}
|
|
3768
3950
|
const ZodObject$1 = /*@__PURE__*/ $constructor$1("ZodObject", (inst, def) => {
|
|
3769
3951
|
$ZodObjectJIT$1.init(inst, def);
|
|
@@ -3836,6 +4018,14 @@ function object$3(shape, params) {
|
|
|
3836
4018
|
...normalizeParams$1(params)
|
|
3837
4019
|
});
|
|
3838
4020
|
}
|
|
4021
|
+
function strictObject(shape, params) {
|
|
4022
|
+
return new ZodObject$1({
|
|
4023
|
+
type: "object",
|
|
4024
|
+
shape,
|
|
4025
|
+
catchall: never$1(),
|
|
4026
|
+
...normalizeParams$1(params)
|
|
4027
|
+
});
|
|
4028
|
+
}
|
|
3839
4029
|
const ZodUnion$1 = /*@__PURE__*/ $constructor$1("ZodUnion", (inst, def) => {
|
|
3840
4030
|
$ZodUnion$1.init(inst, def);
|
|
3841
4031
|
ZodType$1.init(inst, def);
|
|
@@ -3871,7 +4061,7 @@ const ZodRecord$1 = /*@__PURE__*/ $constructor$1("ZodRecord", (inst, def) => {
|
|
|
3871
4061
|
function record$2(keyType, valueType, params) {
|
|
3872
4062
|
if (!valueType || !valueType._zod) return new ZodRecord$1({
|
|
3873
4063
|
type: "record",
|
|
3874
|
-
keyType: string$
|
|
4064
|
+
keyType: string$3(),
|
|
3875
4065
|
valueType: keyType,
|
|
3876
4066
|
...normalizeParams$1(valueType)
|
|
3877
4067
|
});
|
|
@@ -3919,21 +4109,38 @@ function _enum$1(values, params) {
|
|
|
3919
4109
|
...normalizeParams$1(params)
|
|
3920
4110
|
});
|
|
3921
4111
|
}
|
|
4112
|
+
const ZodLiteral = /*@__PURE__*/ $constructor$1("ZodLiteral", (inst, def) => {
|
|
4113
|
+
$ZodLiteral.init(inst, def);
|
|
4114
|
+
ZodType$1.init(inst, def);
|
|
4115
|
+
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
4116
|
+
inst.values = new Set(def.values);
|
|
4117
|
+
Object.defineProperty(inst, "value", { get() {
|
|
4118
|
+
if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
4119
|
+
return def.values[0];
|
|
4120
|
+
} });
|
|
4121
|
+
});
|
|
4122
|
+
function literal(value, params) {
|
|
4123
|
+
return new ZodLiteral({
|
|
4124
|
+
type: "literal",
|
|
4125
|
+
values: Array.isArray(value) ? value : [value],
|
|
4126
|
+
...normalizeParams$1(params)
|
|
4127
|
+
});
|
|
4128
|
+
}
|
|
3922
4129
|
const ZodTransform$1 = /*@__PURE__*/ $constructor$1("ZodTransform", (inst, def) => {
|
|
3923
4130
|
$ZodTransform$1.init(inst, def);
|
|
3924
4131
|
ZodType$1.init(inst, def);
|
|
3925
4132
|
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor$1(inst, ctx, json, params);
|
|
3926
4133
|
inst._zod.parse = (payload, _ctx) => {
|
|
3927
4134
|
if (_ctx.direction === "backward") throw new $ZodEncodeError$1(inst.constructor.name);
|
|
3928
|
-
payload.addIssue = (issue
|
|
3929
|
-
if (typeof issue
|
|
4135
|
+
payload.addIssue = (issue) => {
|
|
4136
|
+
if (typeof issue === "string") payload.issues.push(issue$1(issue, payload.value, def));
|
|
3930
4137
|
else {
|
|
3931
|
-
const _issue = issue
|
|
4138
|
+
const _issue = issue;
|
|
3932
4139
|
if (_issue.fatal) _issue.continue = false;
|
|
3933
4140
|
_issue.code ?? (_issue.code = "custom");
|
|
3934
4141
|
_issue.input ?? (_issue.input = payload.value);
|
|
3935
4142
|
_issue.inst ?? (_issue.inst = inst);
|
|
3936
|
-
payload.issues.push(issue$
|
|
4143
|
+
payload.issues.push(issue$1(_issue));
|
|
3937
4144
|
}
|
|
3938
4145
|
};
|
|
3939
4146
|
const output = def.transform(payload.value, payload);
|
|
@@ -4079,184 +4286,373 @@ const ZodCustom$1 = /*@__PURE__*/ $constructor$1("ZodCustom", (inst, def) => {
|
|
|
4079
4286
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor$1(inst, ctx, json, params);
|
|
4080
4287
|
});
|
|
4081
4288
|
function refine$1(fn, _params = {}) {
|
|
4082
|
-
return
|
|
4289
|
+
return _refine$1(ZodCustom$1, fn, _params);
|
|
4083
4290
|
}
|
|
4084
4291
|
function superRefine$1(fn, params) {
|
|
4085
|
-
return
|
|
4292
|
+
return _superRefine$1(fn, params);
|
|
4086
4293
|
}
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
visible: { $item: "lane" }
|
|
4144
|
-
},
|
|
4145
|
-
meta: {
|
|
4146
|
-
children: ["kind", "day"],
|
|
4147
|
-
props: {
|
|
4148
|
-
align: "center",
|
|
4149
|
-
direction: "horizontal",
|
|
4150
|
-
gap: "sm"
|
|
4151
|
-
},
|
|
4152
|
-
type: "Stack"
|
|
4153
|
-
},
|
|
4154
|
-
needsline: {
|
|
4155
|
-
props: {
|
|
4156
|
-
text: "Needs a lane",
|
|
4157
|
-
variant: "warning"
|
|
4158
|
-
},
|
|
4159
|
-
type: "Badge",
|
|
4160
|
-
visible: { $item: "needs_lane" }
|
|
4161
|
-
}
|
|
4162
|
-
},
|
|
4163
|
-
root: "detail"
|
|
4164
|
-
} }, null, " ")}`, `${JSON.stringify({ render: {
|
|
4165
|
-
elements: {
|
|
4166
|
-
freshness: {
|
|
4167
|
-
props: {
|
|
4168
|
-
text: { $concat: ["Updated ", { $relativeDate: {
|
|
4169
|
-
now: { $state: "/now" },
|
|
4170
|
-
value: { $maxBy: {
|
|
4171
|
-
field: "last_updated",
|
|
4172
|
-
items: { $state: "/items" }
|
|
4173
|
-
} }
|
|
4174
|
-
} }] },
|
|
4175
|
-
variant: "muted"
|
|
4176
|
-
},
|
|
4177
|
-
type: "Text",
|
|
4178
|
-
visible: { $state: "/items/0" }
|
|
4179
|
-
},
|
|
4180
|
-
page: {
|
|
4181
|
-
children: ["freshness", "table"],
|
|
4182
|
-
props: {
|
|
4183
|
-
align: "stretch",
|
|
4184
|
-
className: "p-8",
|
|
4185
|
-
direction: "vertical",
|
|
4186
|
-
gap: "md"
|
|
4187
|
-
},
|
|
4188
|
-
type: "Stack"
|
|
4189
|
-
},
|
|
4190
|
-
table: {
|
|
4191
|
-
props: {
|
|
4192
|
-
columns: [
|
|
4193
|
-
{
|
|
4194
|
-
key: "client",
|
|
4195
|
-
label: "Client",
|
|
4196
|
-
variant: "strong"
|
|
4197
|
-
},
|
|
4198
|
-
{
|
|
4199
|
-
key: "title",
|
|
4200
|
-
label: "Update",
|
|
4201
|
-
width: "wide"
|
|
4202
|
-
},
|
|
4203
|
-
{
|
|
4204
|
-
component: "badge",
|
|
4205
|
-
key: "kind",
|
|
4206
|
-
label: "Kind",
|
|
4207
|
-
variantOverride: {
|
|
4208
|
-
call: "outline",
|
|
4209
|
-
followup: "warning",
|
|
4210
|
-
release: "success"
|
|
4211
|
-
}
|
|
4212
|
-
},
|
|
4213
|
-
{
|
|
4214
|
-
component: "badge",
|
|
4215
|
-
key: "lane",
|
|
4216
|
-
label: "Lane",
|
|
4217
|
-
variantOverride: { "Needs a lane": "warning" }
|
|
4218
|
-
},
|
|
4219
|
-
{
|
|
4220
|
-
key: "occurred_on",
|
|
4221
|
-
label: "Activity",
|
|
4222
|
-
type: "date",
|
|
4223
|
-
variant: "muted",
|
|
4224
|
-
width: "narrow"
|
|
4225
|
-
}
|
|
4226
|
-
],
|
|
4227
|
-
emptyText: "No updates match",
|
|
4228
|
-
filterable: ["kind", "client"],
|
|
4229
|
-
groupable: [
|
|
4230
|
-
"lane",
|
|
4231
|
-
"client",
|
|
4232
|
-
"kind"
|
|
4233
|
-
],
|
|
4234
|
-
initialSort: {
|
|
4235
|
-
desc: true,
|
|
4236
|
-
key: "occurred_on"
|
|
4237
|
-
},
|
|
4238
|
-
rowLink: "path",
|
|
4239
|
-
rows: { $state: "/items" }
|
|
4240
|
-
},
|
|
4241
|
-
type: "Table"
|
|
4242
|
-
}
|
|
4243
|
-
},
|
|
4244
|
-
root: "page"
|
|
4245
|
-
} }, null, " ")}`;
|
|
4246
|
-
const segmentSchema = string$4().min(1, "a repoId segment must be non-empty").refine((s) => s !== "." && s !== ".." && !s.includes("/"), { message: "a repoId segment must not be '.'/'..' or contain '/'" });
|
|
4247
|
-
const sessionMetaSchema = object$3({
|
|
4248
|
-
created: string$4().nullable(),
|
|
4249
|
-
firstPrompt: string$4().nullable(),
|
|
4250
|
-
modified: string$4().nullable(),
|
|
4251
|
-
sessionId: string$4()
|
|
4294
|
+
|
|
4295
|
+
//#endregion
|
|
4296
|
+
//#region ../shared/dist/sentry-event-cap.mjs
|
|
4297
|
+
const UUID_PATTERN = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;
|
|
4298
|
+
const LONG_DIGIT_RUN_PATTERN = /\d{6,}/g;
|
|
4299
|
+
const capSchema = string$3().trim().regex(/^[+-]?\d+$/).transform(Number).pipe(number$3().int().positive());
|
|
4300
|
+
/**
|
|
4301
|
+
* Reads the `SENTRY_CAP_EVENTS` contract: a positive integer enables capping and
|
|
4302
|
+
* IS the cap. Absent, blank, or unparseable yields `undefined` — capping off.
|
|
4303
|
+
*/
|
|
4304
|
+
function parseSentryEventCap(raw) {
|
|
4305
|
+
const result = capSchema.safeParse(raw);
|
|
4306
|
+
return result.success ? result.data : void 0;
|
|
4307
|
+
}
|
|
4308
|
+
/**
|
|
4309
|
+
* The composed form every init site uses: parse the raw env value and build the
|
|
4310
|
+
* hook in one call — `undefined` (capping off) when the value doesn't parse.
|
|
4311
|
+
*/
|
|
4312
|
+
function sentryEventCapBeforeSend(raw) {
|
|
4313
|
+
const cap = parseSentryEventCap(raw);
|
|
4314
|
+
return cap === void 0 ? void 0 : createCappedBeforeSend(cap);
|
|
4315
|
+
}
|
|
4316
|
+
/**
|
|
4317
|
+
* Groups events by a normalized message and admits at most `cap` of each. Keys
|
|
4318
|
+
* a UUID- and digit-collapsed message so one defect reported across many runs
|
|
4319
|
+
* (`… <uuid> … <n> … STEP_FAILURE`) counts as one key, while genuinely distinct
|
|
4320
|
+
* defects that merely share a stack (54 different missing Dataverse columns
|
|
4321
|
+
* under one `ErrorResponse` frame) each keep their own budget.
|
|
4322
|
+
*/
|
|
4323
|
+
function createCappedBeforeSend(cap) {
|
|
4324
|
+
const sentPerKey = /* @__PURE__ */ new Map();
|
|
4325
|
+
return (event) => {
|
|
4326
|
+
const key = normalizedKey(event);
|
|
4327
|
+
const sent = sentPerKey.get(key) ?? 0;
|
|
4328
|
+
if (sent >= cap) return null;
|
|
4329
|
+
sentPerKey.set(key, sent + 1);
|
|
4330
|
+
return event;
|
|
4331
|
+
};
|
|
4332
|
+
}
|
|
4333
|
+
function normalizedKey(event) {
|
|
4334
|
+
return (event.message ?? event.exception?.values?.at(-1)?.value ?? "").replace(UUID_PATTERN, "<uuid>").replace(LONG_DIGIT_RUN_PATTERN, "<n>");
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
//#endregion
|
|
4338
|
+
//#region package.json
|
|
4339
|
+
var version$1 = "0.5.15";
|
|
4340
|
+
|
|
4341
|
+
//#endregion
|
|
4342
|
+
//#region sentry.ts
|
|
4343
|
+
Sentry.init({
|
|
4344
|
+
beforeSend: sentryEventCapBeforeSend(process.env.SENTRY_CAP_EVENTS),
|
|
4345
|
+
dsn: "https://40681e101c0fe69980030b91041a4811@o4510556311519232.ingest.us.sentry.io/4511512992022528",
|
|
4346
|
+
environment: "production",
|
|
4347
|
+
release: version$1,
|
|
4348
|
+
sendDefaultPii: false,
|
|
4349
|
+
tracesSampleRate: 0
|
|
4252
4350
|
});
|
|
4253
|
-
record$2(string$4(), sessionMetaSchema);
|
|
4254
4351
|
|
|
4255
4352
|
//#endregion
|
|
4256
|
-
//#region
|
|
4353
|
+
//#region ../sandbox/dist/index.mjs
|
|
4354
|
+
const GUEST_MEMORY_SAMPLE_INTERVAL_MS = 1e3;
|
|
4355
|
+
function createGuestMemoryProbe(readMetrics) {
|
|
4356
|
+
let reading = null;
|
|
4357
|
+
let lastFailure = null;
|
|
4358
|
+
let sampling = false;
|
|
4359
|
+
const timer = setInterval(() => {
|
|
4360
|
+
if (sampling) return;
|
|
4361
|
+
sampling = true;
|
|
4362
|
+
readMetrics().then((metrics) => {
|
|
4363
|
+
const previous = reading;
|
|
4364
|
+
reading = {
|
|
4365
|
+
latestBytes: metrics.memoryBytes,
|
|
4366
|
+
limitBytes: metrics.memoryLimitBytes,
|
|
4367
|
+
peakBytes: Math.max(previous?.peakBytes ?? 0, metrics.memoryBytes),
|
|
4368
|
+
samples: (previous?.samples ?? 0) + 1
|
|
4369
|
+
};
|
|
4370
|
+
}, (error) => {
|
|
4371
|
+
lastFailure = {
|
|
4372
|
+
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4373
|
+
message: error instanceof Error ? error.message : String(error)
|
|
4374
|
+
};
|
|
4375
|
+
}).finally(() => {
|
|
4376
|
+
sampling = false;
|
|
4377
|
+
});
|
|
4378
|
+
}, GUEST_MEMORY_SAMPLE_INTERVAL_MS);
|
|
4379
|
+
timer.unref();
|
|
4380
|
+
return {
|
|
4381
|
+
read: () => ({
|
|
4382
|
+
lastFailure,
|
|
4383
|
+
reading
|
|
4384
|
+
}),
|
|
4385
|
+
stop: () => clearInterval(timer)
|
|
4386
|
+
};
|
|
4387
|
+
}
|
|
4388
|
+
function isNodeError$1(error) {
|
|
4389
|
+
return error instanceof Error && "code" in error;
|
|
4390
|
+
}
|
|
4391
|
+
async function ensureHostFilesystemReady(bindMounts) {
|
|
4392
|
+
for (const mount of bindMounts) {
|
|
4393
|
+
if (mount.hostPathBehavior === "createDir") {
|
|
4394
|
+
await mkdir(mount.hostPath, {
|
|
4395
|
+
mode: 448,
|
|
4396
|
+
recursive: true
|
|
4397
|
+
});
|
|
4398
|
+
continue;
|
|
4399
|
+
}
|
|
4400
|
+
let stats;
|
|
4401
|
+
try {
|
|
4402
|
+
stats = await stat(mount.hostPath);
|
|
4403
|
+
} catch (error) {
|
|
4404
|
+
if (isNodeError$1(error) && error.code === "ENOENT") throw new Error(`Required sandbox host path does not exist: ${mount.hostPath}`);
|
|
4405
|
+
throw error;
|
|
4406
|
+
}
|
|
4407
|
+
if (!stats.isDirectory()) throw new Error(`Required sandbox host path is not a directory: ${mount.hostPath}`);
|
|
4408
|
+
}
|
|
4409
|
+
}
|
|
4410
|
+
const SANDBOX_STOP_TIMEOUT_MS = 1e4;
|
|
4411
|
+
async function bootSandbox(microsandboxLib, config) {
|
|
4412
|
+
let builder = microsandboxLib.Sandbox.builder(config.name).image(config.image);
|
|
4413
|
+
if (config.memory !== void 0) builder = builder.memory(config.memory);
|
|
4414
|
+
builder = builder.pullPolicy("if-missing").registry((r) => r.auth({ kind: "anonymous" })).replace().ephemeral(true).workdir(config.workdir).envs(config.env);
|
|
4415
|
+
for (const mount of config.bindMounts) builder = builder.volume(mount.guestPath, (mountBuilder) => {
|
|
4416
|
+
const bind = mountBuilder.bind(mount.hostPath);
|
|
4417
|
+
return mount.mode === "ro" ? bind.readonly() : bind;
|
|
4418
|
+
});
|
|
4419
|
+
builder = builder.patch((patchBuilder) => {
|
|
4420
|
+
let patch = patchBuilder;
|
|
4421
|
+
for (const dirPatch of config.dirPatches) patch = patch.copyDir(dirPatch.hostPath, dirPatch.guestPath, { replace: true });
|
|
4422
|
+
for (const textPatch of config.textPatches) patch = patch.text(textPatch.guestPath, textPatch.content, {
|
|
4423
|
+
mode: textPatch.fileMode,
|
|
4424
|
+
replace: true
|
|
4425
|
+
});
|
|
4426
|
+
return patch;
|
|
4427
|
+
});
|
|
4428
|
+
builder = builder.network((nb) => nb.policy(microsandboxLib.NetworkPolicy.allowAll()));
|
|
4429
|
+
const sandbox = await builder.create();
|
|
4430
|
+
return {
|
|
4431
|
+
guestMemory: createGuestMemoryProbe(() => sandbox.metrics()),
|
|
4432
|
+
sandbox
|
|
4433
|
+
};
|
|
4434
|
+
}
|
|
4435
|
+
const CLAUDE_GUEST_HOME = "/root";
|
|
4436
|
+
const CLAUDE_CONFIG_GUEST_PATH = `${CLAUDE_GUEST_HOME}/.claude`;
|
|
4437
|
+
const CLAUDE_PROJECTS_GUEST_PATH = `${CLAUDE_CONFIG_GUEST_PATH}/projects`;
|
|
4438
|
+
const CLAUDE_CREDENTIALS_GUEST_PATH = `${CLAUDE_CONFIG_GUEST_PATH}/.credentials.json`;
|
|
4439
|
+
const CLAUDE_JSON_GUEST_PATH = `${CLAUDE_GUEST_HOME}/.claude.json`;
|
|
4440
|
+
const CLAUDE_REQUIRED_ENV = {
|
|
4441
|
+
HOME: CLAUDE_GUEST_HOME,
|
|
4442
|
+
IS_SANDBOX: "1"
|
|
4443
|
+
};
|
|
4444
|
+
const MICROSANDBOX_HOST_ALIAS = "host.microsandbox.internal";
|
|
4445
|
+
const HOST_LOOPBACK_HOSTNAMES = new Set([
|
|
4446
|
+
"localhost",
|
|
4447
|
+
"127.0.0.1",
|
|
4448
|
+
"0.0.0.0"
|
|
4449
|
+
]);
|
|
4450
|
+
const IPV6_LOOPBACK_HOSTNAMES = new Set(["[::1]", "[::]"]);
|
|
4451
|
+
function rewriteHostUrlForGuest(url) {
|
|
4452
|
+
const parsed = new URL(url);
|
|
4453
|
+
const hostname = parsed.hostname.toLowerCase();
|
|
4454
|
+
if (HOST_LOOPBACK_HOSTNAMES.has(hostname) || IPV6_LOOPBACK_HOSTNAMES.has(hostname)) {
|
|
4455
|
+
parsed.hostname = MICROSANDBOX_HOST_ALIAS;
|
|
4456
|
+
return parsed.toString();
|
|
4457
|
+
}
|
|
4458
|
+
return url;
|
|
4459
|
+
}
|
|
4460
|
+
function withConfigEntries(base, entries) {
|
|
4461
|
+
const env = {
|
|
4462
|
+
...base,
|
|
4463
|
+
GIT_CONFIG_COUNT: String(entries.length)
|
|
4464
|
+
};
|
|
4465
|
+
entries.forEach(([key, value], i) => {
|
|
4466
|
+
env[`GIT_CONFIG_KEY_${i}`] = key;
|
|
4467
|
+
env[`GIT_CONFIG_VALUE_${i}`] = value;
|
|
4468
|
+
});
|
|
4469
|
+
return env;
|
|
4470
|
+
}
|
|
4471
|
+
function identityEnv(identity) {
|
|
4472
|
+
return {
|
|
4473
|
+
GIT_AUTHOR_EMAIL: identity.email,
|
|
4474
|
+
GIT_AUTHOR_NAME: identity.name,
|
|
4475
|
+
GIT_COMMITTER_EMAIL: identity.email,
|
|
4476
|
+
GIT_COMMITTER_NAME: identity.name
|
|
4477
|
+
};
|
|
4478
|
+
}
|
|
4479
|
+
/**
|
|
4480
|
+
* The env for every HOST-side machine git spawn. Isolation is the point: the
|
|
4481
|
+
* operator's global/system config must never reach machine git — on a dev box a
|
|
4482
|
+
* global `commit.gpgsign` routed through 1Password's `op-ssh-sign` fails or
|
|
4483
|
+
* serializes every machine commit while the vault is locked, and a global
|
|
4484
|
+
* `core.excludesFile` silently changes what `add -A` snapshots. Prod containers
|
|
4485
|
+
* carry no gitconfig, so isolation also makes dev match prod. The signing pin is
|
|
4486
|
+
* belt-and-suspenders on top of the isolation (and the layer the guest shares).
|
|
4487
|
+
* Auth never blocks on a prompt; the token rides http.extraHeader instead.
|
|
4488
|
+
*/
|
|
4489
|
+
function hostGitEnv(input = {}) {
|
|
4490
|
+
const entries = [["commit.gpgsign", "false"]];
|
|
4491
|
+
if (input.auth !== void 0) entries.push(["http.extraHeader", `Authorization: Bearer ${input.auth}`]);
|
|
4492
|
+
return withConfigEntries({
|
|
4493
|
+
GIT_CONFIG_GLOBAL: "/dev/null",
|
|
4494
|
+
GIT_CONFIG_SYSTEM: "/dev/null",
|
|
4495
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
4496
|
+
...input.identity ? identityEnv(input.identity) : {}
|
|
4497
|
+
}, entries);
|
|
4498
|
+
}
|
|
4499
|
+
const execFileAsync = promisify(execFile);
|
|
4500
|
+
const KEYCHAIN_SERVICE = "Claude Code-credentials";
|
|
4501
|
+
function buildLinuxClaudeConfig(input) {
|
|
4502
|
+
const parsed = input.rawClaudeJson ? JSON.parse(input.rawClaudeJson) : {};
|
|
4503
|
+
const config = parsed && typeof parsed === "object" && !Array.isArray(parsed) ? { ...parsed } : {};
|
|
4504
|
+
delete config.installMethod;
|
|
4505
|
+
const projects = config.projects && typeof config.projects === "object" && !Array.isArray(config.projects) ? { ...config.projects } : {};
|
|
4506
|
+
const existingProject = projects[input.projectGuestPath] && typeof projects[input.projectGuestPath] === "object" && !Array.isArray(projects[input.projectGuestPath]) ? { ...projects[input.projectGuestPath] } : {};
|
|
4507
|
+
projects[input.projectGuestPath] = {
|
|
4508
|
+
...existingProject,
|
|
4509
|
+
hasTrustDialogAccepted: true
|
|
4510
|
+
};
|
|
4511
|
+
config.projects = projects;
|
|
4512
|
+
return `${JSON.stringify(config, null, " ")}\n`;
|
|
4513
|
+
}
|
|
4514
|
+
async function materializeClaudeHostConfig(input) {
|
|
4515
|
+
let rawClaudeJson;
|
|
4516
|
+
try {
|
|
4517
|
+
rawClaudeJson = await readFile(input.hostClaudeJsonPath, "utf8");
|
|
4518
|
+
} catch (error) {
|
|
4519
|
+
if (!isNodeError$1(error) || error.code !== "ENOENT") throw error;
|
|
4520
|
+
rawClaudeJson = null;
|
|
4521
|
+
}
|
|
4522
|
+
const credentials = await (input.readClaudeCredentials ?? readClaudeCodeCredentialsFromKeychain)({ platform: input.platform ?? process.platform });
|
|
4523
|
+
return {
|
|
4524
|
+
claudeJson: buildLinuxClaudeConfig({
|
|
4525
|
+
projectGuestPath: input.projectGuestPath,
|
|
4526
|
+
rawClaudeJson
|
|
4527
|
+
}),
|
|
4528
|
+
credentials
|
|
4529
|
+
};
|
|
4530
|
+
}
|
|
4531
|
+
async function readClaudeCodeCredentialsFromKeychain(input) {
|
|
4532
|
+
if (input.platform !== "darwin") return null;
|
|
4533
|
+
return await new Promise((resolve) => {
|
|
4534
|
+
execFile("security", [
|
|
4535
|
+
"find-generic-password",
|
|
4536
|
+
"-s",
|
|
4537
|
+
KEYCHAIN_SERVICE,
|
|
4538
|
+
"-w"
|
|
4539
|
+
], { encoding: "utf8" }, (error, stdout) => {
|
|
4540
|
+
if (error) {
|
|
4541
|
+
resolve(null);
|
|
4542
|
+
return;
|
|
4543
|
+
}
|
|
4544
|
+
const trimmed = stdout.trim();
|
|
4545
|
+
resolve(trimmed.length > 0 ? trimmed : null);
|
|
4546
|
+
});
|
|
4547
|
+
});
|
|
4548
|
+
}
|
|
4549
|
+
function claudeMaterialTextPatches(material) {
|
|
4550
|
+
const patches = [{
|
|
4551
|
+
content: material.claudeJson,
|
|
4552
|
+
fileMode: 384,
|
|
4553
|
+
guestPath: CLAUDE_JSON_GUEST_PATH
|
|
4554
|
+
}];
|
|
4555
|
+
if (material.credentials !== null) patches.push({
|
|
4556
|
+
content: material.credentials,
|
|
4557
|
+
fileMode: 384,
|
|
4558
|
+
guestPath: CLAUDE_CREDENTIALS_GUEST_PATH
|
|
4559
|
+
});
|
|
4560
|
+
return patches;
|
|
4561
|
+
}
|
|
4562
|
+
const CLAUDE_GUEST_MEMORY_MIB = 2048;
|
|
4563
|
+
function buildClaudeBootConfig(input) {
|
|
4564
|
+
return {
|
|
4565
|
+
bindMounts: input.bindMounts,
|
|
4566
|
+
dirPatches: [],
|
|
4567
|
+
env: input.guestEnv,
|
|
4568
|
+
image: input.image,
|
|
4569
|
+
memory: input.memory ?? CLAUDE_GUEST_MEMORY_MIB,
|
|
4570
|
+
name: input.name,
|
|
4571
|
+
textPatches: [...claudeMaterialTextPatches(input.claudeMaterial), ...input.textPatches ?? []],
|
|
4572
|
+
workdir: input.workdir
|
|
4573
|
+
};
|
|
4574
|
+
}
|
|
4575
|
+
const DRAIN_TIMED_OUT = Symbol("drain-timed-out");
|
|
4576
|
+
const DRAIN_ABORTED = Symbol("drain-aborted");
|
|
4577
|
+
async function drainExecStream(handle, options) {
|
|
4578
|
+
const { onEvent, signal } = options;
|
|
4579
|
+
if (signal?.aborted) return { kind: "aborted" };
|
|
4580
|
+
const startedAt = Date.now();
|
|
4581
|
+
let lastEventAt = startedAt;
|
|
4582
|
+
let tightenedDeadline = Number.POSITIVE_INFINITY;
|
|
4583
|
+
const ctrl = { tighten: (deadlineMs) => {
|
|
4584
|
+
tightenedDeadline = Math.min(tightenedDeadline, deadlineMs);
|
|
4585
|
+
} };
|
|
4586
|
+
let resolveAborted;
|
|
4587
|
+
const aborted = new Promise((resolve) => {
|
|
4588
|
+
resolveAborted = resolve;
|
|
4589
|
+
});
|
|
4590
|
+
const onAbort = () => resolveAborted?.(DRAIN_ABORTED);
|
|
4591
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
4592
|
+
try {
|
|
4593
|
+
for (;;) {
|
|
4594
|
+
const ceilingDeadline = startedAt + options.maxDurationMs;
|
|
4595
|
+
const inactivityDeadline = lastEventAt + options.inactivityMs;
|
|
4596
|
+
const deadline = Math.min(ceilingDeadline, inactivityDeadline, tightenedDeadline);
|
|
4597
|
+
let timer;
|
|
4598
|
+
const timedOut = new Promise((resolve) => {
|
|
4599
|
+
timer = setTimeout(() => resolve(DRAIN_TIMED_OUT), Math.max(0, deadline - Date.now()));
|
|
4600
|
+
});
|
|
4601
|
+
const pending = handle.recv();
|
|
4602
|
+
let settled;
|
|
4603
|
+
try {
|
|
4604
|
+
settled = await Promise.race([
|
|
4605
|
+
pending,
|
|
4606
|
+
timedOut,
|
|
4607
|
+
aborted
|
|
4608
|
+
]);
|
|
4609
|
+
} finally {
|
|
4610
|
+
clearTimeout(timer);
|
|
4611
|
+
}
|
|
4612
|
+
if (settled === DRAIN_ABORTED) {
|
|
4613
|
+
pending.catch(() => {});
|
|
4614
|
+
return { kind: "aborted" };
|
|
4615
|
+
}
|
|
4616
|
+
if (settled === DRAIN_TIMED_OUT) {
|
|
4617
|
+
pending.catch(() => {});
|
|
4618
|
+
return {
|
|
4619
|
+
kind: "timed_out",
|
|
4620
|
+
reason: ceilingDeadline <= inactivityDeadline ? "max_duration" : "inactivity"
|
|
4621
|
+
};
|
|
4622
|
+
}
|
|
4623
|
+
if (settled === null) return { kind: "ended" };
|
|
4624
|
+
lastEventAt = Date.now();
|
|
4625
|
+
if (settled === void 0) continue;
|
|
4626
|
+
if (settled.kind === "exited") return {
|
|
4627
|
+
exitCode: settled.code,
|
|
4628
|
+
kind: "exited"
|
|
4629
|
+
};
|
|
4630
|
+
onEvent(settled, ctrl);
|
|
4631
|
+
}
|
|
4632
|
+
} finally {
|
|
4633
|
+
signal?.removeEventListener("abort", onAbort);
|
|
4634
|
+
}
|
|
4635
|
+
}
|
|
4636
|
+
const DEBUG_SANDBOX_NAME = "ctx-sandbox-debug";
|
|
4637
|
+
const DEFAULT_BOOT_COMMAND = ["uname", "-a"];
|
|
4638
|
+
async function runSandbox(input) {
|
|
4639
|
+
const microsandbox = await import("microsandbox");
|
|
4640
|
+
const requested = input.command.length > 0 ? [...input.command] : DEFAULT_BOOT_COMMAND;
|
|
4641
|
+
const cmd = requested[0];
|
|
4642
|
+
if (cmd === void 0) throw new Error("sandbox command resolved empty");
|
|
4643
|
+
const args = requested.slice(1);
|
|
4644
|
+
console.error(`[sandbox] booting ${input.image} …`);
|
|
4645
|
+
const sandbox = await microsandbox.Sandbox.builder(DEBUG_SANDBOX_NAME).image(input.image).replace().ephemeral(true).create();
|
|
4646
|
+
try {
|
|
4647
|
+
const output = await sandbox.exec(cmd, args);
|
|
4648
|
+
process.stdout.write(output.stdout());
|
|
4649
|
+
process.stderr.write(output.stderr());
|
|
4650
|
+
return output.code;
|
|
4651
|
+
} finally {
|
|
4652
|
+
await sandbox.stopWithTimeout(SANDBOX_STOP_TIMEOUT_MS);
|
|
4653
|
+
}
|
|
4654
|
+
}
|
|
4257
4655
|
var _a$1;
|
|
4258
|
-
/** A special constant with type `never` */
|
|
4259
|
-
const NEVER = /*@__PURE__*/ Object.freeze({ status: "aborted" });
|
|
4260
4656
|
function $constructor(name, initializer, params) {
|
|
4261
4657
|
function init(inst, def) {
|
|
4262
4658
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
@@ -4313,9 +4709,6 @@ function config(newConfig) {
|
|
|
4313
4709
|
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
4314
4710
|
return globalConfig;
|
|
4315
4711
|
}
|
|
4316
|
-
|
|
4317
|
-
//#endregion
|
|
4318
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
|
|
4319
4712
|
function getEnumValues(entries) {
|
|
4320
4713
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
4321
4714
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -4342,13 +4735,6 @@ function cleanRegex(source) {
|
|
|
4342
4735
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
4343
4736
|
return source.slice(start, end);
|
|
4344
4737
|
}
|
|
4345
|
-
function floatSafeRemainder(val, step) {
|
|
4346
|
-
const ratio = val / step;
|
|
4347
|
-
const roundedRatio = Math.round(ratio);
|
|
4348
|
-
const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
4349
|
-
if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
|
|
4350
|
-
return ratio - roundedRatio;
|
|
4351
|
-
}
|
|
4352
4738
|
const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
|
|
4353
4739
|
function defineLazy(object, key, getter) {
|
|
4354
4740
|
let value = void 0;
|
|
@@ -4387,7 +4773,7 @@ function slugify(input) {
|
|
|
4387
4773
|
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
4388
4774
|
}
|
|
4389
4775
|
const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
|
|
4390
|
-
function isObject$
|
|
4776
|
+
function isObject$3(data) {
|
|
4391
4777
|
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
4392
4778
|
}
|
|
4393
4779
|
const allowsEval = /* @__PURE__*/ cached(() => {
|
|
@@ -4401,12 +4787,12 @@ const allowsEval = /* @__PURE__*/ cached(() => {
|
|
|
4401
4787
|
}
|
|
4402
4788
|
});
|
|
4403
4789
|
function isPlainObject$4(o) {
|
|
4404
|
-
if (isObject$
|
|
4790
|
+
if (isObject$3(o) === false) return false;
|
|
4405
4791
|
const ctor = o.constructor;
|
|
4406
4792
|
if (ctor === void 0) return true;
|
|
4407
4793
|
if (typeof ctor !== "function") return true;
|
|
4408
4794
|
const prot = ctor.prototype;
|
|
4409
|
-
if (isObject$
|
|
4795
|
+
if (isObject$3(prot) === false) return false;
|
|
4410
4796
|
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
|
|
4411
4797
|
return true;
|
|
4412
4798
|
}
|
|
@@ -4450,13 +4836,7 @@ function optionalKeys(shape) {
|
|
|
4450
4836
|
return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
|
|
4451
4837
|
});
|
|
4452
4838
|
}
|
|
4453
|
-
|
|
4454
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
4455
|
-
int32: [-2147483648, 2147483647],
|
|
4456
|
-
uint32: [0, 4294967295],
|
|
4457
|
-
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
4458
|
-
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
4459
|
-
};
|
|
4839
|
+
Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, -Number.MAX_VALUE, Number.MAX_VALUE;
|
|
4460
4840
|
function pick(schema, mask) {
|
|
4461
4841
|
const currDef = schema._zod.def;
|
|
4462
4842
|
const checks = currDef.checks;
|
|
@@ -4626,9 +5006,6 @@ function issue(...args) {
|
|
|
4626
5006
|
};
|
|
4627
5007
|
return { ...iss };
|
|
4628
5008
|
}
|
|
4629
|
-
|
|
4630
|
-
//#endregion
|
|
4631
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
|
|
4632
5009
|
const initializer$1 = (inst, def) => {
|
|
4633
5010
|
inst.name = "$ZodError";
|
|
4634
5011
|
Object.defineProperty(inst, "_zod", {
|
|
@@ -4687,9 +5064,6 @@ function formatError$1(error, mapper = (issue) => issue.message) {
|
|
|
4687
5064
|
processError(error);
|
|
4688
5065
|
return fieldErrors;
|
|
4689
5066
|
}
|
|
4690
|
-
|
|
4691
|
-
//#endregion
|
|
4692
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
4693
5067
|
const _parse = (_Err) => (schema, value, _ctx, _params) => {
|
|
4694
5068
|
const ctx = _ctx ? {
|
|
4695
5069
|
..._ctx,
|
|
@@ -4802,9 +5176,6 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
4802
5176
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
4803
5177
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
4804
5178
|
};
|
|
4805
|
-
|
|
4806
|
-
//#endregion
|
|
4807
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
|
|
4808
5179
|
/**
|
|
4809
5180
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
4810
5181
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -4842,7 +5213,7 @@ const base64url = /^[A-Za-z0-9_-]*$/;
|
|
|
4842
5213
|
const httpProtocol = /^https?$/;
|
|
4843
5214
|
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
4844
5215
|
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
4845
|
-
const date$
|
|
5216
|
+
const date$1$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
|
|
4846
5217
|
function timeSource(args) {
|
|
4847
5218
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
4848
5219
|
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -4858,163 +5229,19 @@ function datetime$1(args) {
|
|
|
4858
5229
|
const timeRegex = `${time}(?:${opts.join("|")})`;
|
|
4859
5230
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
4860
5231
|
}
|
|
4861
|
-
const string$
|
|
5232
|
+
const string$1$1 = (params) => {
|
|
4862
5233
|
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
4863
5234
|
return new RegExp(`^${regex}$`);
|
|
4864
5235
|
};
|
|
4865
|
-
const
|
|
4866
|
-
const number$3 = /^-?\d+(?:\.\d+)?$/;
|
|
4867
|
-
const boolean$2 = /^(?:true|false)$/i;
|
|
5236
|
+
const number$2 = /^-?\d+(?:\.\d+)?$/;
|
|
4868
5237
|
const lowercase = /^[^A-Z]*$/;
|
|
4869
5238
|
const uppercase = /^[^a-z]*$/;
|
|
4870
|
-
|
|
4871
|
-
//#endregion
|
|
4872
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
|
|
4873
5239
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
4874
5240
|
var _a;
|
|
4875
5241
|
inst._zod ?? (inst._zod = {});
|
|
4876
5242
|
inst._zod.def = def;
|
|
4877
5243
|
(_a = inst._zod).onattach ?? (_a.onattach = []);
|
|
4878
5244
|
});
|
|
4879
|
-
const numericOriginMap = {
|
|
4880
|
-
number: "number",
|
|
4881
|
-
bigint: "bigint",
|
|
4882
|
-
object: "date"
|
|
4883
|
-
};
|
|
4884
|
-
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
4885
|
-
$ZodCheck.init(inst, def);
|
|
4886
|
-
const origin = numericOriginMap[typeof def.value];
|
|
4887
|
-
inst._zod.onattach.push((inst) => {
|
|
4888
|
-
const bag = inst._zod.bag;
|
|
4889
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
4890
|
-
if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
|
|
4891
|
-
else bag.exclusiveMaximum = def.value;
|
|
4892
|
-
});
|
|
4893
|
-
inst._zod.check = (payload) => {
|
|
4894
|
-
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
4895
|
-
payload.issues.push({
|
|
4896
|
-
origin,
|
|
4897
|
-
code: "too_big",
|
|
4898
|
-
maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
4899
|
-
input: payload.value,
|
|
4900
|
-
inclusive: def.inclusive,
|
|
4901
|
-
inst,
|
|
4902
|
-
continue: !def.abort
|
|
4903
|
-
});
|
|
4904
|
-
};
|
|
4905
|
-
});
|
|
4906
|
-
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
4907
|
-
$ZodCheck.init(inst, def);
|
|
4908
|
-
const origin = numericOriginMap[typeof def.value];
|
|
4909
|
-
inst._zod.onattach.push((inst) => {
|
|
4910
|
-
const bag = inst._zod.bag;
|
|
4911
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
4912
|
-
if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
|
|
4913
|
-
else bag.exclusiveMinimum = def.value;
|
|
4914
|
-
});
|
|
4915
|
-
inst._zod.check = (payload) => {
|
|
4916
|
-
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
4917
|
-
payload.issues.push({
|
|
4918
|
-
origin,
|
|
4919
|
-
code: "too_small",
|
|
4920
|
-
minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
|
|
4921
|
-
input: payload.value,
|
|
4922
|
-
inclusive: def.inclusive,
|
|
4923
|
-
inst,
|
|
4924
|
-
continue: !def.abort
|
|
4925
|
-
});
|
|
4926
|
-
};
|
|
4927
|
-
});
|
|
4928
|
-
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
4929
|
-
$ZodCheck.init(inst, def);
|
|
4930
|
-
inst._zod.onattach.push((inst) => {
|
|
4931
|
-
var _a;
|
|
4932
|
-
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
4933
|
-
});
|
|
4934
|
-
inst._zod.check = (payload) => {
|
|
4935
|
-
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
4936
|
-
if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
4937
|
-
payload.issues.push({
|
|
4938
|
-
origin: typeof payload.value,
|
|
4939
|
-
code: "not_multiple_of",
|
|
4940
|
-
divisor: def.value,
|
|
4941
|
-
input: payload.value,
|
|
4942
|
-
inst,
|
|
4943
|
-
continue: !def.abort
|
|
4944
|
-
});
|
|
4945
|
-
};
|
|
4946
|
-
});
|
|
4947
|
-
const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
|
|
4948
|
-
$ZodCheck.init(inst, def);
|
|
4949
|
-
def.format = def.format || "float64";
|
|
4950
|
-
const isInt = def.format?.includes("int");
|
|
4951
|
-
const origin = isInt ? "int" : "number";
|
|
4952
|
-
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
4953
|
-
inst._zod.onattach.push((inst) => {
|
|
4954
|
-
const bag = inst._zod.bag;
|
|
4955
|
-
bag.format = def.format;
|
|
4956
|
-
bag.minimum = minimum;
|
|
4957
|
-
bag.maximum = maximum;
|
|
4958
|
-
if (isInt) bag.pattern = integer;
|
|
4959
|
-
});
|
|
4960
|
-
inst._zod.check = (payload) => {
|
|
4961
|
-
const input = payload.value;
|
|
4962
|
-
if (isInt) {
|
|
4963
|
-
if (!Number.isInteger(input)) {
|
|
4964
|
-
payload.issues.push({
|
|
4965
|
-
expected: origin,
|
|
4966
|
-
format: def.format,
|
|
4967
|
-
code: "invalid_type",
|
|
4968
|
-
continue: false,
|
|
4969
|
-
input,
|
|
4970
|
-
inst
|
|
4971
|
-
});
|
|
4972
|
-
return;
|
|
4973
|
-
}
|
|
4974
|
-
if (!Number.isSafeInteger(input)) {
|
|
4975
|
-
if (input > 0) payload.issues.push({
|
|
4976
|
-
input,
|
|
4977
|
-
code: "too_big",
|
|
4978
|
-
maximum: Number.MAX_SAFE_INTEGER,
|
|
4979
|
-
note: "Integers must be within the safe integer range.",
|
|
4980
|
-
inst,
|
|
4981
|
-
origin,
|
|
4982
|
-
inclusive: true,
|
|
4983
|
-
continue: !def.abort
|
|
4984
|
-
});
|
|
4985
|
-
else payload.issues.push({
|
|
4986
|
-
input,
|
|
4987
|
-
code: "too_small",
|
|
4988
|
-
minimum: Number.MIN_SAFE_INTEGER,
|
|
4989
|
-
note: "Integers must be within the safe integer range.",
|
|
4990
|
-
inst,
|
|
4991
|
-
origin,
|
|
4992
|
-
inclusive: true,
|
|
4993
|
-
continue: !def.abort
|
|
4994
|
-
});
|
|
4995
|
-
return;
|
|
4996
|
-
}
|
|
4997
|
-
}
|
|
4998
|
-
if (input < minimum) payload.issues.push({
|
|
4999
|
-
origin: "number",
|
|
5000
|
-
input,
|
|
5001
|
-
code: "too_small",
|
|
5002
|
-
minimum,
|
|
5003
|
-
inclusive: true,
|
|
5004
|
-
inst,
|
|
5005
|
-
continue: !def.abort
|
|
5006
|
-
});
|
|
5007
|
-
if (input > maximum) payload.issues.push({
|
|
5008
|
-
origin: "number",
|
|
5009
|
-
input,
|
|
5010
|
-
code: "too_big",
|
|
5011
|
-
maximum,
|
|
5012
|
-
inclusive: true,
|
|
5013
|
-
inst,
|
|
5014
|
-
continue: !def.abort
|
|
5015
|
-
});
|
|
5016
|
-
};
|
|
5017
|
-
});
|
|
5018
5245
|
const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
|
|
5019
5246
|
var _a;
|
|
5020
5247
|
$ZodCheck.init(inst, def);
|
|
@@ -5226,9 +5453,6 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
|
|
|
5226
5453
|
payload.value = def.tx(payload.value);
|
|
5227
5454
|
};
|
|
5228
5455
|
});
|
|
5229
|
-
|
|
5230
|
-
//#endregion
|
|
5231
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
|
|
5232
5456
|
var Doc = class {
|
|
5233
5457
|
constructor(args = []) {
|
|
5234
5458
|
this.content = [];
|
|
@@ -5258,17 +5482,11 @@ var Doc = class {
|
|
|
5258
5482
|
return new F(...args, lines.join("\n"));
|
|
5259
5483
|
}
|
|
5260
5484
|
};
|
|
5261
|
-
|
|
5262
|
-
//#endregion
|
|
5263
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
|
|
5264
5485
|
const version = {
|
|
5265
5486
|
major: 4,
|
|
5266
5487
|
minor: 4,
|
|
5267
5488
|
patch: 3
|
|
5268
5489
|
};
|
|
5269
|
-
|
|
5270
|
-
//#endregion
|
|
5271
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
|
|
5272
5490
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
5273
5491
|
var _a;
|
|
5274
5492
|
inst ?? (inst = {});
|
|
@@ -5360,7 +5578,7 @@ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
|
5360
5578
|
});
|
|
5361
5579
|
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
5362
5580
|
$ZodType.init(inst, def);
|
|
5363
|
-
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$
|
|
5581
|
+
inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1$1(inst._zod.bag);
|
|
5364
5582
|
inst._zod.parse = (payload, _) => {
|
|
5365
5583
|
if (def.coerce) try {
|
|
5366
5584
|
payload.value = String(payload.value);
|
|
@@ -5499,7 +5717,7 @@ const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def
|
|
|
5499
5717
|
$ZodStringFormat.init(inst, def);
|
|
5500
5718
|
});
|
|
5501
5719
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
5502
|
-
def.pattern ?? (def.pattern = date$
|
|
5720
|
+
def.pattern ?? (def.pattern = date$1$1);
|
|
5503
5721
|
$ZodStringFormat.init(inst, def);
|
|
5504
5722
|
});
|
|
5505
5723
|
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
@@ -5639,48 +5857,6 @@ const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
|
|
|
5639
5857
|
});
|
|
5640
5858
|
};
|
|
5641
5859
|
});
|
|
5642
|
-
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
5643
|
-
$ZodType.init(inst, def);
|
|
5644
|
-
inst._zod.pattern = inst._zod.bag.pattern ?? number$3;
|
|
5645
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
5646
|
-
if (def.coerce) try {
|
|
5647
|
-
payload.value = Number(payload.value);
|
|
5648
|
-
} catch (_) {}
|
|
5649
|
-
const input = payload.value;
|
|
5650
|
-
if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
|
|
5651
|
-
const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
|
|
5652
|
-
payload.issues.push({
|
|
5653
|
-
expected: "number",
|
|
5654
|
-
code: "invalid_type",
|
|
5655
|
-
input,
|
|
5656
|
-
inst,
|
|
5657
|
-
...received ? { received } : {}
|
|
5658
|
-
});
|
|
5659
|
-
return payload;
|
|
5660
|
-
};
|
|
5661
|
-
});
|
|
5662
|
-
const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
|
|
5663
|
-
$ZodCheckNumberFormat.init(inst, def);
|
|
5664
|
-
$ZodNumber.init(inst, def);
|
|
5665
|
-
});
|
|
5666
|
-
const $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
|
|
5667
|
-
$ZodType.init(inst, def);
|
|
5668
|
-
inst._zod.pattern = boolean$2;
|
|
5669
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
5670
|
-
if (def.coerce) try {
|
|
5671
|
-
payload.value = Boolean(payload.value);
|
|
5672
|
-
} catch (_) {}
|
|
5673
|
-
const input = payload.value;
|
|
5674
|
-
if (typeof input === "boolean") return payload;
|
|
5675
|
-
payload.issues.push({
|
|
5676
|
-
expected: "boolean",
|
|
5677
|
-
code: "invalid_type",
|
|
5678
|
-
input,
|
|
5679
|
-
inst
|
|
5680
|
-
});
|
|
5681
|
-
return payload;
|
|
5682
|
-
};
|
|
5683
|
-
});
|
|
5684
5860
|
const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
|
|
5685
5861
|
$ZodType.init(inst, def);
|
|
5686
5862
|
inst._zod.parse = (payload) => payload;
|
|
@@ -5815,13 +5991,13 @@ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
|
5815
5991
|
}
|
|
5816
5992
|
return propValues;
|
|
5817
5993
|
});
|
|
5818
|
-
const isObject = isObject$
|
|
5994
|
+
const isObject$1 = isObject$3;
|
|
5819
5995
|
const catchall = def.catchall;
|
|
5820
5996
|
let value;
|
|
5821
5997
|
inst._zod.parse = (payload, ctx) => {
|
|
5822
5998
|
value ?? (value = _normalized.value);
|
|
5823
5999
|
const input = payload.value;
|
|
5824
|
-
if (!isObject(input)) {
|
|
6000
|
+
if (!isObject$1(input)) {
|
|
5825
6001
|
payload.issues.push({
|
|
5826
6002
|
expected: "object",
|
|
5827
6003
|
code: "invalid_type",
|
|
@@ -5944,16 +6120,15 @@ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
5944
6120
|
return (payload, ctx) => fn(shape, payload, ctx);
|
|
5945
6121
|
};
|
|
5946
6122
|
let fastpass;
|
|
5947
|
-
const isObject = isObject$
|
|
6123
|
+
const isObject$2 = isObject$3;
|
|
5948
6124
|
const jit = !globalConfig.jitless;
|
|
5949
|
-
const
|
|
5950
|
-
const fastEnabled = jit && allowsEval$2.value;
|
|
6125
|
+
const fastEnabled = jit && allowsEval.value;
|
|
5951
6126
|
const catchall = def.catchall;
|
|
5952
6127
|
let value;
|
|
5953
6128
|
inst._zod.parse = (payload, ctx) => {
|
|
5954
6129
|
value ?? (value = _normalized.value);
|
|
5955
6130
|
const input = payload.value;
|
|
5956
|
-
if (!isObject(input)) {
|
|
6131
|
+
if (!isObject$2(input)) {
|
|
5957
6132
|
payload.issues.push({
|
|
5958
6133
|
expected: "object",
|
|
5959
6134
|
code: "invalid_type",
|
|
@@ -6196,7 +6371,7 @@ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
|
6196
6371
|
issues: []
|
|
6197
6372
|
}, ctx);
|
|
6198
6373
|
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
6199
|
-
if (typeof key === "string" && number$
|
|
6374
|
+
if (typeof key === "string" && number$2.test(key) && keyResult.issues.length) {
|
|
6200
6375
|
const retryResult = def.keyType._zod.run({
|
|
6201
6376
|
value: Number(key),
|
|
6202
6377
|
issues: []
|
|
@@ -6252,24 +6427,6 @@ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
|
6252
6427
|
return payload;
|
|
6253
6428
|
};
|
|
6254
6429
|
});
|
|
6255
|
-
const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
|
|
6256
|
-
$ZodType.init(inst, def);
|
|
6257
|
-
if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
|
|
6258
|
-
const values = new Set(def.values);
|
|
6259
|
-
inst._zod.values = values;
|
|
6260
|
-
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
6261
|
-
inst._zod.parse = (payload, _ctx) => {
|
|
6262
|
-
const input = payload.value;
|
|
6263
|
-
if (values.has(input)) return payload;
|
|
6264
|
-
payload.issues.push({
|
|
6265
|
-
code: "invalid_value",
|
|
6266
|
-
values: def.values,
|
|
6267
|
-
input,
|
|
6268
|
-
inst
|
|
6269
|
-
});
|
|
6270
|
-
return payload;
|
|
6271
|
-
};
|
|
6272
|
-
});
|
|
6273
6430
|
const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
|
|
6274
6431
|
$ZodType.init(inst, def);
|
|
6275
6432
|
inst._zod.optin = "optional";
|
|
@@ -6498,9 +6655,6 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
6498
6655
|
payload.issues.push(issue(_iss));
|
|
6499
6656
|
}
|
|
6500
6657
|
}
|
|
6501
|
-
|
|
6502
|
-
//#endregion
|
|
6503
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
|
|
6504
6658
|
var _a;
|
|
6505
6659
|
var $ZodRegistry = class {
|
|
6506
6660
|
constructor() {
|
|
@@ -6546,9 +6700,6 @@ function registry() {
|
|
|
6546
6700
|
}
|
|
6547
6701
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
6548
6702
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
6549
|
-
|
|
6550
|
-
//#endregion
|
|
6551
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
|
|
6552
6703
|
// @__NO_SIDE_EFFECTS__
|
|
6553
6704
|
function _string(Class, params) {
|
|
6554
6705
|
return new Class({
|
|
@@ -6825,31 +6976,6 @@ function _isoDuration(Class, params) {
|
|
|
6825
6976
|
});
|
|
6826
6977
|
}
|
|
6827
6978
|
// @__NO_SIDE_EFFECTS__
|
|
6828
|
-
function _number(Class, params) {
|
|
6829
|
-
return new Class({
|
|
6830
|
-
type: "number",
|
|
6831
|
-
checks: [],
|
|
6832
|
-
...normalizeParams(params)
|
|
6833
|
-
});
|
|
6834
|
-
}
|
|
6835
|
-
// @__NO_SIDE_EFFECTS__
|
|
6836
|
-
function _int(Class, params) {
|
|
6837
|
-
return new Class({
|
|
6838
|
-
type: "number",
|
|
6839
|
-
check: "number_format",
|
|
6840
|
-
abort: false,
|
|
6841
|
-
format: "safeint",
|
|
6842
|
-
...normalizeParams(params)
|
|
6843
|
-
});
|
|
6844
|
-
}
|
|
6845
|
-
// @__NO_SIDE_EFFECTS__
|
|
6846
|
-
function _boolean(Class, params) {
|
|
6847
|
-
return new Class({
|
|
6848
|
-
type: "boolean",
|
|
6849
|
-
...normalizeParams(params)
|
|
6850
|
-
});
|
|
6851
|
-
}
|
|
6852
|
-
// @__NO_SIDE_EFFECTS__
|
|
6853
6979
|
function _unknown(Class) {
|
|
6854
6980
|
return new Class({ type: "unknown" });
|
|
6855
6981
|
}
|
|
@@ -6861,50 +6987,6 @@ function _never(Class, params) {
|
|
|
6861
6987
|
});
|
|
6862
6988
|
}
|
|
6863
6989
|
// @__NO_SIDE_EFFECTS__
|
|
6864
|
-
function _lt(value, params) {
|
|
6865
|
-
return new $ZodCheckLessThan({
|
|
6866
|
-
check: "less_than",
|
|
6867
|
-
...normalizeParams(params),
|
|
6868
|
-
value,
|
|
6869
|
-
inclusive: false
|
|
6870
|
-
});
|
|
6871
|
-
}
|
|
6872
|
-
// @__NO_SIDE_EFFECTS__
|
|
6873
|
-
function _lte(value, params) {
|
|
6874
|
-
return new $ZodCheckLessThan({
|
|
6875
|
-
check: "less_than",
|
|
6876
|
-
...normalizeParams(params),
|
|
6877
|
-
value,
|
|
6878
|
-
inclusive: true
|
|
6879
|
-
});
|
|
6880
|
-
}
|
|
6881
|
-
// @__NO_SIDE_EFFECTS__
|
|
6882
|
-
function _gt(value, params) {
|
|
6883
|
-
return new $ZodCheckGreaterThan({
|
|
6884
|
-
check: "greater_than",
|
|
6885
|
-
...normalizeParams(params),
|
|
6886
|
-
value,
|
|
6887
|
-
inclusive: false
|
|
6888
|
-
});
|
|
6889
|
-
}
|
|
6890
|
-
// @__NO_SIDE_EFFECTS__
|
|
6891
|
-
function _gte(value, params) {
|
|
6892
|
-
return new $ZodCheckGreaterThan({
|
|
6893
|
-
check: "greater_than",
|
|
6894
|
-
...normalizeParams(params),
|
|
6895
|
-
value,
|
|
6896
|
-
inclusive: true
|
|
6897
|
-
});
|
|
6898
|
-
}
|
|
6899
|
-
// @__NO_SIDE_EFFECTS__
|
|
6900
|
-
function _multipleOf(value, params) {
|
|
6901
|
-
return new $ZodCheckMultipleOf({
|
|
6902
|
-
check: "multiple_of",
|
|
6903
|
-
...normalizeParams(params),
|
|
6904
|
-
value
|
|
6905
|
-
});
|
|
6906
|
-
}
|
|
6907
|
-
// @__NO_SIDE_EFFECTS__
|
|
6908
6990
|
function _maxLength(maximum, params) {
|
|
6909
6991
|
return new $ZodCheckMaxLength({
|
|
6910
6992
|
check: "max_length",
|
|
@@ -7052,9 +7134,6 @@ function _check(fn, params) {
|
|
|
7052
7134
|
ch._zod.check = fn;
|
|
7053
7135
|
return ch;
|
|
7054
7136
|
}
|
|
7055
|
-
|
|
7056
|
-
//#endregion
|
|
7057
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
|
|
7058
7137
|
function initializeContext(params) {
|
|
7059
7138
|
let target = params?.target ?? "draft-2020-12";
|
|
7060
7139
|
if (target === "draft-4") target = "draft-04";
|
|
@@ -7073,7 +7152,7 @@ function initializeContext(params) {
|
|
|
7073
7152
|
external: params?.external ?? void 0
|
|
7074
7153
|
};
|
|
7075
7154
|
}
|
|
7076
|
-
function process$
|
|
7155
|
+
function process$1$1(schema, ctx, _params = {
|
|
7077
7156
|
path: [],
|
|
7078
7157
|
schemaPath: []
|
|
7079
7158
|
}) {
|
|
@@ -7110,7 +7189,7 @@ function process$2(schema, ctx, _params = {
|
|
|
7110
7189
|
const parent = schema._zod.parent;
|
|
7111
7190
|
if (parent) {
|
|
7112
7191
|
if (!result.ref) result.ref = parent;
|
|
7113
|
-
process$
|
|
7192
|
+
process$1$1(parent, ctx, params);
|
|
7114
7193
|
ctx.seen.get(parent).isParent = true;
|
|
7115
7194
|
}
|
|
7116
7195
|
}
|
|
@@ -7330,7 +7409,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
7330
7409
|
...params,
|
|
7331
7410
|
processors
|
|
7332
7411
|
});
|
|
7333
|
-
process$
|
|
7412
|
+
process$1$1(schema, ctx);
|
|
7334
7413
|
extractDefs(ctx, schema);
|
|
7335
7414
|
return finalize(ctx, schema);
|
|
7336
7415
|
};
|
|
@@ -7342,13 +7421,10 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
7342
7421
|
io,
|
|
7343
7422
|
processors
|
|
7344
7423
|
});
|
|
7345
|
-
process$
|
|
7424
|
+
process$1$1(schema, ctx);
|
|
7346
7425
|
extractDefs(ctx, schema);
|
|
7347
7426
|
return finalize(ctx, schema);
|
|
7348
7427
|
};
|
|
7349
|
-
|
|
7350
|
-
//#endregion
|
|
7351
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
|
|
7352
7428
|
const formatMap = {
|
|
7353
7429
|
guid: "uuid",
|
|
7354
7430
|
url: "uri",
|
|
@@ -7377,33 +7453,9 @@ const stringProcessor = (schema, ctx, _json, _params) => {
|
|
|
7377
7453
|
}))];
|
|
7378
7454
|
}
|
|
7379
7455
|
};
|
|
7380
|
-
const numberProcessor = (schema, ctx, _json, _params) => {
|
|
7381
|
-
const json = _json;
|
|
7382
|
-
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
|
|
7383
|
-
if (typeof format === "string" && format.includes("int")) json.type = "integer";
|
|
7384
|
-
else json.type = "number";
|
|
7385
|
-
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
7386
|
-
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
7387
|
-
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
7388
|
-
if (exMin) if (legacy) {
|
|
7389
|
-
json.minimum = exclusiveMinimum;
|
|
7390
|
-
json.exclusiveMinimum = true;
|
|
7391
|
-
} else json.exclusiveMinimum = exclusiveMinimum;
|
|
7392
|
-
else if (typeof minimum === "number") json.minimum = minimum;
|
|
7393
|
-
if (exMax) if (legacy) {
|
|
7394
|
-
json.maximum = exclusiveMaximum;
|
|
7395
|
-
json.exclusiveMaximum = true;
|
|
7396
|
-
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
7397
|
-
else if (typeof maximum === "number") json.maximum = maximum;
|
|
7398
|
-
if (typeof multipleOf === "number") json.multipleOf = multipleOf;
|
|
7399
|
-
};
|
|
7400
|
-
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
7401
|
-
json.type = "boolean";
|
|
7402
|
-
};
|
|
7403
7456
|
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
7404
7457
|
json.not = {};
|
|
7405
7458
|
};
|
|
7406
|
-
const unknownProcessor = (_schema, _ctx, _json, _params) => {};
|
|
7407
7459
|
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
7408
7460
|
const def = schema._zod.def;
|
|
7409
7461
|
const values = getEnumValues(def.entries);
|
|
@@ -7411,27 +7463,6 @@ const enumProcessor = (schema, _ctx, json, _params) => {
|
|
|
7411
7463
|
if (values.every((v) => typeof v === "string")) json.type = "string";
|
|
7412
7464
|
json.enum = values;
|
|
7413
7465
|
};
|
|
7414
|
-
const literalProcessor = (schema, ctx, json, _params) => {
|
|
7415
|
-
const def = schema._zod.def;
|
|
7416
|
-
const vals = [];
|
|
7417
|
-
for (const val of def.values) if (val === void 0) {
|
|
7418
|
-
if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
|
|
7419
|
-
} else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
|
|
7420
|
-
else vals.push(Number(val));
|
|
7421
|
-
else vals.push(val);
|
|
7422
|
-
if (vals.length === 0) {} else if (vals.length === 1) {
|
|
7423
|
-
const val = vals[0];
|
|
7424
|
-
json.type = val === null ? "null" : typeof val;
|
|
7425
|
-
if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
|
|
7426
|
-
else json.const = val;
|
|
7427
|
-
} else {
|
|
7428
|
-
if (vals.every((v) => typeof v === "number")) json.type = "number";
|
|
7429
|
-
if (vals.every((v) => typeof v === "string")) json.type = "string";
|
|
7430
|
-
if (vals.every((v) => typeof v === "boolean")) json.type = "boolean";
|
|
7431
|
-
if (vals.every((v) => v === null)) json.type = "null";
|
|
7432
|
-
json.enum = vals;
|
|
7433
|
-
}
|
|
7434
|
-
};
|
|
7435
7466
|
const customProcessor = (_schema, ctx, _json, _params) => {
|
|
7436
7467
|
if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
|
|
7437
7468
|
};
|
|
@@ -7445,7 +7476,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
7445
7476
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
7446
7477
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
7447
7478
|
json.type = "array";
|
|
7448
|
-
json.items = process$
|
|
7479
|
+
json.items = process$1$1(def.element, ctx, {
|
|
7449
7480
|
...params,
|
|
7450
7481
|
path: [...params.path, "items"]
|
|
7451
7482
|
});
|
|
@@ -7456,7 +7487,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7456
7487
|
json.type = "object";
|
|
7457
7488
|
json.properties = {};
|
|
7458
7489
|
const shape = def.shape;
|
|
7459
|
-
for (const key in shape) json.properties[key] = process$
|
|
7490
|
+
for (const key in shape) json.properties[key] = process$1$1(shape[key], ctx, {
|
|
7460
7491
|
...params,
|
|
7461
7492
|
path: [
|
|
7462
7493
|
...params.path,
|
|
@@ -7474,7 +7505,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7474
7505
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
7475
7506
|
else if (!def.catchall) {
|
|
7476
7507
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
7477
|
-
} else if (def.catchall) json.additionalProperties = process$
|
|
7508
|
+
} else if (def.catchall) json.additionalProperties = process$1$1(def.catchall, ctx, {
|
|
7478
7509
|
...params,
|
|
7479
7510
|
path: [...params.path, "additionalProperties"]
|
|
7480
7511
|
});
|
|
@@ -7482,7 +7513,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7482
7513
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
7483
7514
|
const def = schema._zod.def;
|
|
7484
7515
|
const isExclusive = def.inclusive === false;
|
|
7485
|
-
const options = def.options.map((x, i) => process$
|
|
7516
|
+
const options = def.options.map((x, i) => process$1$1(x, ctx, {
|
|
7486
7517
|
...params,
|
|
7487
7518
|
path: [
|
|
7488
7519
|
...params.path,
|
|
@@ -7495,7 +7526,7 @@ const unionProcessor = (schema, ctx, json, params) => {
|
|
|
7495
7526
|
};
|
|
7496
7527
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
7497
7528
|
const def = schema._zod.def;
|
|
7498
|
-
const a = process$
|
|
7529
|
+
const a = process$1$1(def.left, ctx, {
|
|
7499
7530
|
...params,
|
|
7500
7531
|
path: [
|
|
7501
7532
|
...params.path,
|
|
@@ -7503,7 +7534,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
7503
7534
|
0
|
|
7504
7535
|
]
|
|
7505
7536
|
});
|
|
7506
|
-
const b = process$
|
|
7537
|
+
const b = process$1$1(def.right, ctx, {
|
|
7507
7538
|
...params,
|
|
7508
7539
|
path: [
|
|
7509
7540
|
...params.path,
|
|
@@ -7521,7 +7552,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
7521
7552
|
const keyType = def.keyType;
|
|
7522
7553
|
const patterns = keyType._zod.bag?.patterns;
|
|
7523
7554
|
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
7524
|
-
const valueSchema = process$
|
|
7555
|
+
const valueSchema = process$1$1(def.valueType, ctx, {
|
|
7525
7556
|
...params,
|
|
7526
7557
|
path: [
|
|
7527
7558
|
...params.path,
|
|
@@ -7532,11 +7563,11 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
7532
7563
|
json.patternProperties = {};
|
|
7533
7564
|
for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
|
|
7534
7565
|
} else {
|
|
7535
|
-
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$
|
|
7566
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$1$1(def.keyType, ctx, {
|
|
7536
7567
|
...params,
|
|
7537
7568
|
path: [...params.path, "propertyNames"]
|
|
7538
7569
|
});
|
|
7539
|
-
json.additionalProperties = process$
|
|
7570
|
+
json.additionalProperties = process$1$1(def.valueType, ctx, {
|
|
7540
7571
|
...params,
|
|
7541
7572
|
path: [...params.path, "additionalProperties"]
|
|
7542
7573
|
});
|
|
@@ -7549,7 +7580,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
|
|
|
7549
7580
|
};
|
|
7550
7581
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
7551
7582
|
const def = schema._zod.def;
|
|
7552
|
-
const inner = process$
|
|
7583
|
+
const inner = process$1$1(def.innerType, ctx, params);
|
|
7553
7584
|
const seen = ctx.seen.get(schema);
|
|
7554
7585
|
if (ctx.target === "openapi-3.0") {
|
|
7555
7586
|
seen.ref = def.innerType;
|
|
@@ -7558,27 +7589,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
|
|
|
7558
7589
|
};
|
|
7559
7590
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
7560
7591
|
const def = schema._zod.def;
|
|
7561
|
-
process$
|
|
7592
|
+
process$1$1(def.innerType, ctx, params);
|
|
7562
7593
|
const seen = ctx.seen.get(schema);
|
|
7563
7594
|
seen.ref = def.innerType;
|
|
7564
7595
|
};
|
|
7565
7596
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
7566
7597
|
const def = schema._zod.def;
|
|
7567
|
-
process$
|
|
7598
|
+
process$1$1(def.innerType, ctx, params);
|
|
7568
7599
|
const seen = ctx.seen.get(schema);
|
|
7569
7600
|
seen.ref = def.innerType;
|
|
7570
7601
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7571
7602
|
};
|
|
7572
7603
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
7573
7604
|
const def = schema._zod.def;
|
|
7574
|
-
process$
|
|
7605
|
+
process$1$1(def.innerType, ctx, params);
|
|
7575
7606
|
const seen = ctx.seen.get(schema);
|
|
7576
7607
|
seen.ref = def.innerType;
|
|
7577
7608
|
if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7578
7609
|
};
|
|
7579
7610
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
7580
7611
|
const def = schema._zod.def;
|
|
7581
|
-
process$
|
|
7612
|
+
process$1$1(def.innerType, ctx, params);
|
|
7582
7613
|
const seen = ctx.seen.get(schema);
|
|
7583
7614
|
seen.ref = def.innerType;
|
|
7584
7615
|
let catchValue;
|
|
@@ -7593,57 +7624,51 @@ const pipeProcessor = (schema, ctx, _json, params) => {
|
|
|
7593
7624
|
const def = schema._zod.def;
|
|
7594
7625
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
7595
7626
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
7596
|
-
process$
|
|
7627
|
+
process$1$1(innerType, ctx, params);
|
|
7597
7628
|
const seen = ctx.seen.get(schema);
|
|
7598
7629
|
seen.ref = innerType;
|
|
7599
7630
|
};
|
|
7600
7631
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
7601
7632
|
const def = schema._zod.def;
|
|
7602
|
-
process$
|
|
7633
|
+
process$1$1(def.innerType, ctx, params);
|
|
7603
7634
|
const seen = ctx.seen.get(schema);
|
|
7604
7635
|
seen.ref = def.innerType;
|
|
7605
7636
|
json.readOnly = true;
|
|
7606
7637
|
};
|
|
7607
7638
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
7608
7639
|
const def = schema._zod.def;
|
|
7609
|
-
process$
|
|
7640
|
+
process$1$1(def.innerType, ctx, params);
|
|
7610
7641
|
const seen = ctx.seen.get(schema);
|
|
7611
7642
|
seen.ref = def.innerType;
|
|
7612
7643
|
};
|
|
7613
|
-
|
|
7614
|
-
//#endregion
|
|
7615
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
|
|
7616
7644
|
const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
|
|
7617
7645
|
$ZodISODateTime.init(inst, def);
|
|
7618
7646
|
ZodStringFormat.init(inst, def);
|
|
7619
7647
|
});
|
|
7620
7648
|
function datetime(params) {
|
|
7621
|
-
return _isoDateTime(ZodISODateTime, params);
|
|
7649
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
7622
7650
|
}
|
|
7623
7651
|
const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
|
|
7624
7652
|
$ZodISODate.init(inst, def);
|
|
7625
7653
|
ZodStringFormat.init(inst, def);
|
|
7626
7654
|
});
|
|
7627
7655
|
function date$2(params) {
|
|
7628
|
-
return _isoDate(ZodISODate, params);
|
|
7656
|
+
return /* @__PURE__ */ _isoDate(ZodISODate, params);
|
|
7629
7657
|
}
|
|
7630
7658
|
const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
|
|
7631
7659
|
$ZodISOTime.init(inst, def);
|
|
7632
7660
|
ZodStringFormat.init(inst, def);
|
|
7633
7661
|
});
|
|
7634
7662
|
function time(params) {
|
|
7635
|
-
return _isoTime(ZodISOTime, params);
|
|
7663
|
+
return /* @__PURE__ */ _isoTime(ZodISOTime, params);
|
|
7636
7664
|
}
|
|
7637
7665
|
const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
|
|
7638
7666
|
$ZodISODuration.init(inst, def);
|
|
7639
7667
|
ZodStringFormat.init(inst, def);
|
|
7640
7668
|
});
|
|
7641
7669
|
function duration(params) {
|
|
7642
|
-
return _isoDuration(ZodISODuration, params);
|
|
7670
|
+
return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
|
|
7643
7671
|
}
|
|
7644
|
-
|
|
7645
|
-
//#endregion
|
|
7646
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
|
|
7647
7672
|
const initializer = (inst, issues) => {
|
|
7648
7673
|
$ZodError.init(inst, issues);
|
|
7649
7674
|
inst.name = "ZodError";
|
|
@@ -7664,9 +7689,6 @@ const initializer = (inst, issues) => {
|
|
|
7664
7689
|
});
|
|
7665
7690
|
};
|
|
7666
7691
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
|
|
7667
|
-
|
|
7668
|
-
//#endregion
|
|
7669
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
|
|
7670
7692
|
const parse$1 = /* @__PURE__ */ _parse(ZodRealError);
|
|
7671
7693
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
7672
7694
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -7679,9 +7701,6 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
|
7679
7701
|
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
7680
7702
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
7681
7703
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
7682
|
-
|
|
7683
|
-
//#endregion
|
|
7684
|
-
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
|
|
7685
7704
|
const _installedGroups = /* @__PURE__ */ new WeakMap();
|
|
7686
7705
|
function _installLazyMethods(inst, group, methods) {
|
|
7687
7706
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -7770,7 +7789,7 @@ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
|
|
|
7770
7789
|
return this.check(superRefine(refinement, params));
|
|
7771
7790
|
},
|
|
7772
7791
|
overwrite(fn) {
|
|
7773
|
-
return this.check(_overwrite(fn));
|
|
7792
|
+
return this.check(/* @__PURE__ */ _overwrite(fn));
|
|
7774
7793
|
},
|
|
7775
7794
|
optional() {
|
|
7776
7795
|
return optional$2(this);
|
|
@@ -7854,85 +7873,85 @@ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
|
|
|
7854
7873
|
inst.maxLength = bag.maximum ?? null;
|
|
7855
7874
|
_installLazyMethods(inst, "_ZodString", {
|
|
7856
7875
|
regex(...args) {
|
|
7857
|
-
return this.check(_regex(...args));
|
|
7876
|
+
return this.check(/* @__PURE__ */ _regex(...args));
|
|
7858
7877
|
},
|
|
7859
7878
|
includes(...args) {
|
|
7860
|
-
return this.check(_includes(...args));
|
|
7879
|
+
return this.check(/* @__PURE__ */ _includes(...args));
|
|
7861
7880
|
},
|
|
7862
7881
|
startsWith(...args) {
|
|
7863
|
-
return this.check(_startsWith(...args));
|
|
7882
|
+
return this.check(/* @__PURE__ */ _startsWith(...args));
|
|
7864
7883
|
},
|
|
7865
7884
|
endsWith(...args) {
|
|
7866
|
-
return this.check(_endsWith(...args));
|
|
7885
|
+
return this.check(/* @__PURE__ */ _endsWith(...args));
|
|
7867
7886
|
},
|
|
7868
7887
|
min(...args) {
|
|
7869
|
-
return this.check(_minLength(...args));
|
|
7888
|
+
return this.check(/* @__PURE__ */ _minLength(...args));
|
|
7870
7889
|
},
|
|
7871
7890
|
max(...args) {
|
|
7872
|
-
return this.check(_maxLength(...args));
|
|
7891
|
+
return this.check(/* @__PURE__ */ _maxLength(...args));
|
|
7873
7892
|
},
|
|
7874
7893
|
length(...args) {
|
|
7875
|
-
return this.check(_length(...args));
|
|
7894
|
+
return this.check(/* @__PURE__ */ _length(...args));
|
|
7876
7895
|
},
|
|
7877
7896
|
nonempty(...args) {
|
|
7878
|
-
return this.check(_minLength(1, ...args));
|
|
7897
|
+
return this.check(/* @__PURE__ */ _minLength(1, ...args));
|
|
7879
7898
|
},
|
|
7880
7899
|
lowercase(params) {
|
|
7881
|
-
return this.check(_lowercase(params));
|
|
7900
|
+
return this.check(/* @__PURE__ */ _lowercase(params));
|
|
7882
7901
|
},
|
|
7883
7902
|
uppercase(params) {
|
|
7884
|
-
return this.check(_uppercase(params));
|
|
7903
|
+
return this.check(/* @__PURE__ */ _uppercase(params));
|
|
7885
7904
|
},
|
|
7886
7905
|
trim() {
|
|
7887
|
-
return this.check(_trim());
|
|
7906
|
+
return this.check(/* @__PURE__ */ _trim());
|
|
7888
7907
|
},
|
|
7889
7908
|
normalize(...args) {
|
|
7890
|
-
return this.check(_normalize(...args));
|
|
7909
|
+
return this.check(/* @__PURE__ */ _normalize(...args));
|
|
7891
7910
|
},
|
|
7892
7911
|
toLowerCase() {
|
|
7893
|
-
return this.check(_toLowerCase());
|
|
7912
|
+
return this.check(/* @__PURE__ */ _toLowerCase());
|
|
7894
7913
|
},
|
|
7895
7914
|
toUpperCase() {
|
|
7896
|
-
return this.check(_toUpperCase());
|
|
7915
|
+
return this.check(/* @__PURE__ */ _toUpperCase());
|
|
7897
7916
|
},
|
|
7898
7917
|
slugify() {
|
|
7899
|
-
return this.check(_slugify());
|
|
7918
|
+
return this.check(/* @__PURE__ */ _slugify());
|
|
7900
7919
|
}
|
|
7901
7920
|
});
|
|
7902
7921
|
});
|
|
7903
7922
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
7904
7923
|
$ZodString.init(inst, def);
|
|
7905
7924
|
_ZodString.init(inst, def);
|
|
7906
|
-
inst.email = (params) => inst.check(_email(ZodEmail, params));
|
|
7907
|
-
inst.url = (params) => inst.check(_url(ZodURL, params));
|
|
7908
|
-
inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
|
|
7909
|
-
inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
|
|
7910
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
7911
|
-
inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
|
|
7912
|
-
inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
|
|
7913
|
-
inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
|
|
7914
|
-
inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
|
|
7915
|
-
inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
|
|
7916
|
-
inst.guid = (params) => inst.check(_guid(ZodGUID, params));
|
|
7917
|
-
inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
|
|
7918
|
-
inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
|
|
7919
|
-
inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
|
|
7920
|
-
inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
|
|
7921
|
-
inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
|
|
7922
|
-
inst.xid = (params) => inst.check(_xid(ZodXID, params));
|
|
7923
|
-
inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
|
|
7924
|
-
inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
|
|
7925
|
-
inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
|
|
7926
|
-
inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
|
|
7927
|
-
inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
|
|
7928
|
-
inst.e164 = (params) => inst.check(_e164(ZodE164, params));
|
|
7925
|
+
inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
|
|
7926
|
+
inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
|
|
7927
|
+
inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
|
|
7928
|
+
inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
|
|
7929
|
+
inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
|
|
7930
|
+
inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
|
|
7931
|
+
inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
|
|
7932
|
+
inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
|
|
7933
|
+
inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
|
|
7934
|
+
inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
|
|
7935
|
+
inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
|
|
7936
|
+
inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
|
|
7937
|
+
inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
|
|
7938
|
+
inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
|
|
7939
|
+
inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
|
|
7940
|
+
inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
|
|
7941
|
+
inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
|
|
7942
|
+
inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
|
|
7943
|
+
inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
|
|
7944
|
+
inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
|
|
7945
|
+
inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
|
|
7946
|
+
inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
|
|
7947
|
+
inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
|
|
7929
7948
|
inst.datetime = (params) => inst.check(datetime(params));
|
|
7930
7949
|
inst.date = (params) => inst.check(date$2(params));
|
|
7931
7950
|
inst.time = (params) => inst.check(time(params));
|
|
7932
7951
|
inst.duration = (params) => inst.check(duration(params));
|
|
7933
7952
|
});
|
|
7934
7953
|
function string$2(params) {
|
|
7935
|
-
return _string(ZodString, params);
|
|
7954
|
+
return /* @__PURE__ */ _string(ZodString, params);
|
|
7936
7955
|
}
|
|
7937
7956
|
const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
|
|
7938
7957
|
$ZodStringFormat.init(inst, def);
|
|
@@ -7954,9 +7973,6 @@ const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
|
|
|
7954
7973
|
$ZodURL.init(inst, def);
|
|
7955
7974
|
ZodStringFormat.init(inst, def);
|
|
7956
7975
|
});
|
|
7957
|
-
function url(params) {
|
|
7958
|
-
return _url(ZodURL, params);
|
|
7959
|
-
}
|
|
7960
7976
|
const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
|
|
7961
7977
|
$ZodEmoji.init(inst, def);
|
|
7962
7978
|
ZodStringFormat.init(inst, def);
|
|
@@ -8022,89 +8038,13 @@ const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
|
|
|
8022
8038
|
$ZodJWT.init(inst, def);
|
|
8023
8039
|
ZodStringFormat.init(inst, def);
|
|
8024
8040
|
});
|
|
8025
|
-
const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
|
|
8026
|
-
$ZodNumber.init(inst, def);
|
|
8027
|
-
ZodType.init(inst, def);
|
|
8028
|
-
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
8029
|
-
_installLazyMethods(inst, "ZodNumber", {
|
|
8030
|
-
gt(value, params) {
|
|
8031
|
-
return this.check(_gt(value, params));
|
|
8032
|
-
},
|
|
8033
|
-
gte(value, params) {
|
|
8034
|
-
return this.check(_gte(value, params));
|
|
8035
|
-
},
|
|
8036
|
-
min(value, params) {
|
|
8037
|
-
return this.check(_gte(value, params));
|
|
8038
|
-
},
|
|
8039
|
-
lt(value, params) {
|
|
8040
|
-
return this.check(_lt(value, params));
|
|
8041
|
-
},
|
|
8042
|
-
lte(value, params) {
|
|
8043
|
-
return this.check(_lte(value, params));
|
|
8044
|
-
},
|
|
8045
|
-
max(value, params) {
|
|
8046
|
-
return this.check(_lte(value, params));
|
|
8047
|
-
},
|
|
8048
|
-
int(params) {
|
|
8049
|
-
return this.check(int(params));
|
|
8050
|
-
},
|
|
8051
|
-
safe(params) {
|
|
8052
|
-
return this.check(int(params));
|
|
8053
|
-
},
|
|
8054
|
-
positive(params) {
|
|
8055
|
-
return this.check(_gt(0, params));
|
|
8056
|
-
},
|
|
8057
|
-
nonnegative(params) {
|
|
8058
|
-
return this.check(_gte(0, params));
|
|
8059
|
-
},
|
|
8060
|
-
negative(params) {
|
|
8061
|
-
return this.check(_lt(0, params));
|
|
8062
|
-
},
|
|
8063
|
-
nonpositive(params) {
|
|
8064
|
-
return this.check(_lte(0, params));
|
|
8065
|
-
},
|
|
8066
|
-
multipleOf(value, params) {
|
|
8067
|
-
return this.check(_multipleOf(value, params));
|
|
8068
|
-
},
|
|
8069
|
-
step(value, params) {
|
|
8070
|
-
return this.check(_multipleOf(value, params));
|
|
8071
|
-
},
|
|
8072
|
-
finite() {
|
|
8073
|
-
return this;
|
|
8074
|
-
}
|
|
8075
|
-
});
|
|
8076
|
-
const bag = inst._zod.bag;
|
|
8077
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
8078
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
8079
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
8080
|
-
inst.isFinite = true;
|
|
8081
|
-
inst.format = bag.format ?? null;
|
|
8082
|
-
});
|
|
8083
|
-
function number$2(params) {
|
|
8084
|
-
return _number(ZodNumber, params);
|
|
8085
|
-
}
|
|
8086
|
-
const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
|
|
8087
|
-
$ZodNumberFormat.init(inst, def);
|
|
8088
|
-
ZodNumber.init(inst, def);
|
|
8089
|
-
});
|
|
8090
|
-
function int(params) {
|
|
8091
|
-
return _int(ZodNumberFormat, params);
|
|
8092
|
-
}
|
|
8093
|
-
const ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
|
|
8094
|
-
$ZodBoolean.init(inst, def);
|
|
8095
|
-
ZodType.init(inst, def);
|
|
8096
|
-
inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
|
|
8097
|
-
});
|
|
8098
|
-
function boolean$1(params) {
|
|
8099
|
-
return _boolean(ZodBoolean, params);
|
|
8100
|
-
}
|
|
8101
8041
|
const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
|
|
8102
8042
|
$ZodUnknown.init(inst, def);
|
|
8103
8043
|
ZodType.init(inst, def);
|
|
8104
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
8044
|
+
inst._zod.processJSONSchema = (ctx, json, params) => void 0;
|
|
8105
8045
|
});
|
|
8106
8046
|
function unknown$2() {
|
|
8107
|
-
return _unknown(ZodUnknown);
|
|
8047
|
+
return /* @__PURE__ */ _unknown(ZodUnknown);
|
|
8108
8048
|
}
|
|
8109
8049
|
const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
|
|
8110
8050
|
$ZodNever.init(inst, def);
|
|
@@ -8112,7 +8052,7 @@ const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
|
|
|
8112
8052
|
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
|
|
8113
8053
|
});
|
|
8114
8054
|
function never(params) {
|
|
8115
|
-
return _never(ZodNever, params);
|
|
8055
|
+
return /* @__PURE__ */ _never(ZodNever, params);
|
|
8116
8056
|
}
|
|
8117
8057
|
const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
8118
8058
|
$ZodArray.init(inst, def);
|
|
@@ -8121,16 +8061,16 @@ const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
|
8121
8061
|
inst.element = def.element;
|
|
8122
8062
|
_installLazyMethods(inst, "ZodArray", {
|
|
8123
8063
|
min(n, params) {
|
|
8124
|
-
return this.check(_minLength(n, params));
|
|
8064
|
+
return this.check(/* @__PURE__ */ _minLength(n, params));
|
|
8125
8065
|
},
|
|
8126
8066
|
nonempty(params) {
|
|
8127
|
-
return this.check(_minLength(1, params));
|
|
8067
|
+
return this.check(/* @__PURE__ */ _minLength(1, params));
|
|
8128
8068
|
},
|
|
8129
8069
|
max(n, params) {
|
|
8130
|
-
return this.check(_maxLength(n, params));
|
|
8070
|
+
return this.check(/* @__PURE__ */ _maxLength(n, params));
|
|
8131
8071
|
},
|
|
8132
8072
|
length(n, params) {
|
|
8133
|
-
return this.check(_length(n, params));
|
|
8073
|
+
return this.check(/* @__PURE__ */ _length(n, params));
|
|
8134
8074
|
},
|
|
8135
8075
|
unwrap() {
|
|
8136
8076
|
return this.element;
|
|
@@ -8138,7 +8078,7 @@ const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
|
|
|
8138
8078
|
});
|
|
8139
8079
|
});
|
|
8140
8080
|
function array(element, params) {
|
|
8141
|
-
return _array(ZodArray, element, params);
|
|
8081
|
+
return /* @__PURE__ */ _array(ZodArray, element, params);
|
|
8142
8082
|
}
|
|
8143
8083
|
const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
|
|
8144
8084
|
$ZodObjectJIT.init(inst, def);
|
|
@@ -8211,14 +8151,6 @@ function object$2(shape, params) {
|
|
|
8211
8151
|
...normalizeParams(params)
|
|
8212
8152
|
});
|
|
8213
8153
|
}
|
|
8214
|
-
function strictObject(shape, params) {
|
|
8215
|
-
return new ZodObject({
|
|
8216
|
-
type: "object",
|
|
8217
|
-
shape,
|
|
8218
|
-
catchall: never(),
|
|
8219
|
-
...normalizeParams(params)
|
|
8220
|
-
});
|
|
8221
|
-
}
|
|
8222
8154
|
const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
|
|
8223
8155
|
$ZodUnion.init(inst, def);
|
|
8224
8156
|
ZodType.init(inst, def);
|
|
@@ -8302,23 +8234,6 @@ function _enum(values, params) {
|
|
|
8302
8234
|
...normalizeParams(params)
|
|
8303
8235
|
});
|
|
8304
8236
|
}
|
|
8305
|
-
const ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
|
|
8306
|
-
$ZodLiteral.init(inst, def);
|
|
8307
|
-
ZodType.init(inst, def);
|
|
8308
|
-
inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
|
|
8309
|
-
inst.values = new Set(def.values);
|
|
8310
|
-
Object.defineProperty(inst, "value", { get() {
|
|
8311
|
-
if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
|
|
8312
|
-
return def.values[0];
|
|
8313
|
-
} });
|
|
8314
|
-
});
|
|
8315
|
-
function literal(value, params) {
|
|
8316
|
-
return new ZodLiteral({
|
|
8317
|
-
type: "literal",
|
|
8318
|
-
values: Array.isArray(value) ? value : [value],
|
|
8319
|
-
...normalizeParams(params)
|
|
8320
|
-
});
|
|
8321
|
-
}
|
|
8322
8237
|
const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
|
|
8323
8238
|
$ZodTransform.init(inst, def);
|
|
8324
8239
|
ZodType.init(inst, def);
|
|
@@ -8479,18 +8394,185 @@ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
|
8479
8394
|
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
|
|
8480
8395
|
});
|
|
8481
8396
|
function refine(fn, _params = {}) {
|
|
8482
|
-
return _refine(ZodCustom, fn, _params);
|
|
8397
|
+
return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
|
|
8483
8398
|
}
|
|
8484
8399
|
function superRefine(fn, params) {
|
|
8485
|
-
return _superRefine(fn, params);
|
|
8400
|
+
return /* @__PURE__ */ _superRefine(fn, params);
|
|
8486
8401
|
}
|
|
8402
|
+
`${JSON.stringify({ render: {
|
|
8403
|
+
elements: {
|
|
8404
|
+
body: {
|
|
8405
|
+
props: { text: { $item: "body" } },
|
|
8406
|
+
type: "Markdown",
|
|
8407
|
+
visible: { $item: "body" }
|
|
8408
|
+
},
|
|
8409
|
+
card: {
|
|
8410
|
+
children: [
|
|
8411
|
+
"meta",
|
|
8412
|
+
"laneline",
|
|
8413
|
+
"needsline",
|
|
8414
|
+
"body"
|
|
8415
|
+
],
|
|
8416
|
+
props: { title: { $item: "proposed_title" } },
|
|
8417
|
+
type: "Card"
|
|
8418
|
+
},
|
|
8419
|
+
day: {
|
|
8420
|
+
props: {
|
|
8421
|
+
text: { $concat: ["Activity ", {
|
|
8422
|
+
$format: "date",
|
|
8423
|
+
locale: "en-US",
|
|
8424
|
+
options: { timeZone: "UTC" },
|
|
8425
|
+
value: { $item: "occurred_on" }
|
|
8426
|
+
}] },
|
|
8427
|
+
variant: "outline"
|
|
8428
|
+
},
|
|
8429
|
+
type: "Badge",
|
|
8430
|
+
visible: { $item: "occurred_on" }
|
|
8431
|
+
},
|
|
8432
|
+
detail: {
|
|
8433
|
+
children: ["card"],
|
|
8434
|
+
props: {
|
|
8435
|
+
className: "mx-auto max-w-2xl p-8",
|
|
8436
|
+
direction: "vertical",
|
|
8437
|
+
gap: "md"
|
|
8438
|
+
},
|
|
8439
|
+
repeat: {
|
|
8440
|
+
key: "path",
|
|
8441
|
+
statePath: "/items"
|
|
8442
|
+
},
|
|
8443
|
+
type: "Stack"
|
|
8444
|
+
},
|
|
8445
|
+
kind: {
|
|
8446
|
+
props: {
|
|
8447
|
+
text: { $item: "kind" },
|
|
8448
|
+
variant: "secondary"
|
|
8449
|
+
},
|
|
8450
|
+
type: "Badge"
|
|
8451
|
+
},
|
|
8452
|
+
laneline: {
|
|
8453
|
+
props: {
|
|
8454
|
+
text: { $concat: ["Lane · ", { $item: "lane" }] },
|
|
8455
|
+
variant: "muted"
|
|
8456
|
+
},
|
|
8457
|
+
type: "Text",
|
|
8458
|
+
visible: { $item: "lane" }
|
|
8459
|
+
},
|
|
8460
|
+
meta: {
|
|
8461
|
+
children: ["kind", "day"],
|
|
8462
|
+
props: {
|
|
8463
|
+
align: "center",
|
|
8464
|
+
direction: "horizontal",
|
|
8465
|
+
gap: "sm"
|
|
8466
|
+
},
|
|
8467
|
+
type: "Stack"
|
|
8468
|
+
},
|
|
8469
|
+
needsline: {
|
|
8470
|
+
props: {
|
|
8471
|
+
text: "Needs a lane",
|
|
8472
|
+
variant: "warning"
|
|
8473
|
+
},
|
|
8474
|
+
type: "Badge",
|
|
8475
|
+
visible: { $item: "needs_lane" }
|
|
8476
|
+
}
|
|
8477
|
+
},
|
|
8478
|
+
root: "detail"
|
|
8479
|
+
} }, null, " ")}`, `${JSON.stringify({ render: {
|
|
8480
|
+
elements: {
|
|
8481
|
+
freshness: {
|
|
8482
|
+
props: {
|
|
8483
|
+
text: { $concat: ["Updated ", { $relativeDate: {
|
|
8484
|
+
now: { $state: "/now" },
|
|
8485
|
+
value: { $maxBy: {
|
|
8486
|
+
field: "last_updated",
|
|
8487
|
+
items: { $state: "/items" }
|
|
8488
|
+
} }
|
|
8489
|
+
} }] },
|
|
8490
|
+
variant: "muted"
|
|
8491
|
+
},
|
|
8492
|
+
type: "Text",
|
|
8493
|
+
visible: { $state: "/items/0" }
|
|
8494
|
+
},
|
|
8495
|
+
page: {
|
|
8496
|
+
children: ["freshness", "table"],
|
|
8497
|
+
props: {
|
|
8498
|
+
align: "stretch",
|
|
8499
|
+
className: "p-8",
|
|
8500
|
+
direction: "vertical",
|
|
8501
|
+
gap: "md"
|
|
8502
|
+
},
|
|
8503
|
+
type: "Stack"
|
|
8504
|
+
},
|
|
8505
|
+
table: {
|
|
8506
|
+
props: {
|
|
8507
|
+
columns: [
|
|
8508
|
+
{
|
|
8509
|
+
key: "client",
|
|
8510
|
+
label: "Client",
|
|
8511
|
+
variant: "strong"
|
|
8512
|
+
},
|
|
8513
|
+
{
|
|
8514
|
+
key: "title",
|
|
8515
|
+
label: "Update",
|
|
8516
|
+
width: "wide"
|
|
8517
|
+
},
|
|
8518
|
+
{
|
|
8519
|
+
component: "badge",
|
|
8520
|
+
key: "kind",
|
|
8521
|
+
label: "Kind",
|
|
8522
|
+
variantOverride: {
|
|
8523
|
+
call: "outline",
|
|
8524
|
+
followup: "warning",
|
|
8525
|
+
release: "success"
|
|
8526
|
+
}
|
|
8527
|
+
},
|
|
8528
|
+
{
|
|
8529
|
+
component: "badge",
|
|
8530
|
+
key: "lane",
|
|
8531
|
+
label: "Lane",
|
|
8532
|
+
variantOverride: { "Needs a lane": "warning" }
|
|
8533
|
+
},
|
|
8534
|
+
{
|
|
8535
|
+
key: "occurred_on",
|
|
8536
|
+
label: "Activity",
|
|
8537
|
+
type: "date",
|
|
8538
|
+
variant: "muted",
|
|
8539
|
+
width: "narrow"
|
|
8540
|
+
}
|
|
8541
|
+
],
|
|
8542
|
+
emptyText: "No updates match",
|
|
8543
|
+
filterable: ["kind", "client"],
|
|
8544
|
+
groupable: [
|
|
8545
|
+
"lane",
|
|
8546
|
+
"client",
|
|
8547
|
+
"kind"
|
|
8548
|
+
],
|
|
8549
|
+
initialSort: {
|
|
8550
|
+
desc: true,
|
|
8551
|
+
key: "occurred_on"
|
|
8552
|
+
},
|
|
8553
|
+
rowLink: "path",
|
|
8554
|
+
rows: { $state: "/items" }
|
|
8555
|
+
},
|
|
8556
|
+
type: "Table"
|
|
8557
|
+
}
|
|
8558
|
+
},
|
|
8559
|
+
root: "page"
|
|
8560
|
+
} }, null, " ")}`;
|
|
8561
|
+
const segmentSchema = string$2().min(1, "a repoId segment must be non-empty").refine((s) => s !== "." && s !== ".." && !s.includes("/"), { message: "a repoId segment must not be '.'/'..' or contain '/'" });
|
|
8562
|
+
const sessionMetaSchema = object$2({
|
|
8563
|
+
created: string$2().nullable(),
|
|
8564
|
+
firstPrompt: string$2().nullable(),
|
|
8565
|
+
modified: string$2().nullable(),
|
|
8566
|
+
sessionId: string$2()
|
|
8567
|
+
});
|
|
8568
|
+
record$1(string$2(), sessionMetaSchema);
|
|
8487
8569
|
|
|
8488
8570
|
//#endregion
|
|
8489
8571
|
//#region ../shared/dist/ctx-machine-token.mjs
|
|
8490
8572
|
const EXPIRY_SKEW_MS = 6e4;
|
|
8491
|
-
const tokenResponseSchema = object$
|
|
8492
|
-
access_token: string$
|
|
8493
|
-
expires_in: number$
|
|
8573
|
+
const tokenResponseSchema = object$3({
|
|
8574
|
+
access_token: string$3().trim().min(1),
|
|
8575
|
+
expires_in: number$3().positive()
|
|
8494
8576
|
});
|
|
8495
8577
|
function createMachineTokenProvider(config) {
|
|
8496
8578
|
const fetchImpl = config.fetchImpl ?? fetch;
|
|
@@ -30441,7 +30523,7 @@ function osUsername() {
|
|
|
30441
30523
|
function msToIso(ms) {
|
|
30442
30524
|
return new Date(ms).toISOString();
|
|
30443
30525
|
}
|
|
30444
|
-
const isoMsSchema = string$
|
|
30526
|
+
const isoMsSchema = string$3().transform((value, ctx) => {
|
|
30445
30527
|
const ms = Date.parse(value);
|
|
30446
30528
|
if (Number.isNaN(ms)) {
|
|
30447
30529
|
ctx.addIssue({
|
|
@@ -30516,7 +30598,7 @@ function formatError(error) {
|
|
|
30516
30598
|
return String(error);
|
|
30517
30599
|
}
|
|
30518
30600
|
const cursorFileSchema = strictObject({
|
|
30519
|
-
floors: record$
|
|
30601
|
+
floors: record$2(string$3(), isoMsSchema),
|
|
30520
30602
|
frontier: isoMsSchema
|
|
30521
30603
|
});
|
|
30522
30604
|
async function readCursor(rootDir, synthesizerName) {
|
|
@@ -30987,19 +31069,19 @@ function dirtyWorkingTreeIssue(paths) {
|
|
|
30987
31069
|
message: `Working tree is dirty:\n${formatWorkingTreePaths(paths)}\nRun 'ctxe repair' to roll back to HEAD (preserves .engine/runs/**).`
|
|
30988
31070
|
};
|
|
30989
31071
|
}
|
|
30990
|
-
const runTriggerSchema = _enum([
|
|
31072
|
+
const runTriggerSchema = _enum$1([
|
|
30991
31073
|
"adhoc",
|
|
30992
31074
|
"backfill",
|
|
30993
31075
|
"daemon"
|
|
30994
31076
|
]);
|
|
30995
|
-
_enum([
|
|
31077
|
+
_enum$1([
|
|
30996
31078
|
"success",
|
|
30997
31079
|
"failed",
|
|
30998
31080
|
"timed_out",
|
|
30999
31081
|
"rate_limited",
|
|
31000
31082
|
"stale"
|
|
31001
31083
|
]);
|
|
31002
|
-
const runStatusSchema = _enum([
|
|
31084
|
+
const runStatusSchema = _enum$1([
|
|
31003
31085
|
"starting",
|
|
31004
31086
|
"running",
|
|
31005
31087
|
"success",
|
|
@@ -31010,23 +31092,23 @@ const runStatusSchema = _enum([
|
|
|
31010
31092
|
"interrupted"
|
|
31011
31093
|
]);
|
|
31012
31094
|
const claudeResultSchema = strictObject({
|
|
31013
|
-
api_error_status: number$
|
|
31095
|
+
api_error_status: number$3().int().optional(),
|
|
31014
31096
|
is_error: boolean$1(),
|
|
31015
|
-
num_turns: number$
|
|
31016
|
-
subtype: string$
|
|
31017
|
-
terminal_reason: string$
|
|
31018
|
-
total_cost_usd: number$
|
|
31097
|
+
num_turns: number$3().int(),
|
|
31098
|
+
subtype: string$3().min(1),
|
|
31099
|
+
terminal_reason: string$3().min(1).optional(),
|
|
31100
|
+
total_cost_usd: number$3()
|
|
31019
31101
|
});
|
|
31020
31102
|
const runRecordSchema = strictObject({
|
|
31021
31103
|
claude_result: claudeResultSchema.optional(),
|
|
31022
|
-
completed_at: string$
|
|
31023
|
-
duration_ms: number$
|
|
31024
|
-
exit_code: number$
|
|
31025
|
-
rate_limit_resets_at: string$
|
|
31026
|
-
run_id: string$
|
|
31027
|
-
started_at: string$
|
|
31104
|
+
completed_at: string$3().min(1).optional(),
|
|
31105
|
+
duration_ms: number$3().int().nonnegative().optional(),
|
|
31106
|
+
exit_code: number$3().int().optional(),
|
|
31107
|
+
rate_limit_resets_at: string$3().min(1).optional(),
|
|
31108
|
+
run_id: string$3().min(1),
|
|
31109
|
+
started_at: string$3().min(1),
|
|
31028
31110
|
status: runStatusSchema,
|
|
31029
|
-
synthesizer: string$
|
|
31111
|
+
synthesizer: string$3().min(1),
|
|
31030
31112
|
triggered_by: runTriggerSchema
|
|
31031
31113
|
});
|
|
31032
31114
|
const RECORD_FILE_NAME = "record.json";
|
|
@@ -31249,8 +31331,8 @@ function renderSliceJson(slice) {
|
|
|
31249
31331
|
return `${JSON.stringify(windows, null, " ")}\n`;
|
|
31250
31332
|
}
|
|
31251
31333
|
const synthesizerSpecFrontmatterSchema = strictObject({
|
|
31252
|
-
description: string$
|
|
31253
|
-
name: string$
|
|
31334
|
+
description: string$3().optional(),
|
|
31335
|
+
name: string$3().trim().min(1)
|
|
31254
31336
|
});
|
|
31255
31337
|
function parseSynthesizerSpecMarkdown(content, sourcePath) {
|
|
31256
31338
|
if (!hasYamlFrontmatter(content)) return {
|
|
@@ -32053,14 +32135,14 @@ const hostProcessEnv = process.env;
|
|
|
32053
32135
|
function hostHomeDir() {
|
|
32054
32136
|
return hostProcessEnv.HOME ?? "";
|
|
32055
32137
|
}
|
|
32056
|
-
const rateLimitEventSchema = object$
|
|
32057
|
-
rate_limit_info: object$
|
|
32058
|
-
resetsAt: number$
|
|
32059
|
-
status: string$
|
|
32138
|
+
const rateLimitEventSchema = object$3({
|
|
32139
|
+
rate_limit_info: object$3({
|
|
32140
|
+
resetsAt: number$3().optional(),
|
|
32141
|
+
status: string$3().min(1)
|
|
32060
32142
|
}),
|
|
32061
32143
|
type: literal("rate_limit_event")
|
|
32062
32144
|
});
|
|
32063
|
-
const resultEventSchema = object$
|
|
32145
|
+
const resultEventSchema = object$3({
|
|
32064
32146
|
...claudeResultSchema.shape,
|
|
32065
32147
|
type: literal("result")
|
|
32066
32148
|
});
|
|
@@ -32194,7 +32276,6 @@ function synthesizerCommand(sessionId, rootDir, options = {}) {
|
|
|
32194
32276
|
command.push("Begin the run.");
|
|
32195
32277
|
return command;
|
|
32196
32278
|
}
|
|
32197
|
-
const GUEST_MEMORY_MIB = 2048;
|
|
32198
32279
|
const EXEC_INACTIVITY_TIMEOUT_MS = 600 * 1e3;
|
|
32199
32280
|
const EXEC_MAX_DURATION_MS = 7200 * 1e3;
|
|
32200
32281
|
const EXEC_RESULT_GRACE_MS = 60 * 1e3;
|
|
@@ -32249,6 +32330,7 @@ var MicrosandboxClaudeExecutor = class {
|
|
|
32249
32330
|
let exitCode = 1;
|
|
32250
32331
|
let observation = {};
|
|
32251
32332
|
let sandbox = null;
|
|
32333
|
+
let guestMemory = null;
|
|
32252
32334
|
try {
|
|
32253
32335
|
const claudeMaterial = await materializeClaudeHostConfig({
|
|
32254
32336
|
hostClaudeJsonPath: path.join(hostHomeDir(), ".claude.json"),
|
|
@@ -32266,13 +32348,14 @@ var MicrosandboxClaudeExecutor = class {
|
|
|
32266
32348
|
claudeMaterial,
|
|
32267
32349
|
guestEnv: runPlan.guestEnv,
|
|
32268
32350
|
image: runPlan.image,
|
|
32269
|
-
memory: GUEST_MEMORY_MIB,
|
|
32270
32351
|
name: runPlan.sandboxName,
|
|
32271
32352
|
textPatches: layout.textPatches,
|
|
32272
32353
|
workdir: layout.workdir
|
|
32273
32354
|
});
|
|
32274
32355
|
await ensureHostFilesystemReady(bootConfig.bindMounts);
|
|
32275
|
-
|
|
32356
|
+
const booted = await bootSandbox(microsandbox, bootConfig);
|
|
32357
|
+
sandbox = booted.sandbox;
|
|
32358
|
+
guestMemory = booted.guestMemory;
|
|
32276
32359
|
const [cmd, ...args] = runPlan.command;
|
|
32277
32360
|
const stderrDecoder = new TextDecoder("utf-8", { fatal: false });
|
|
32278
32361
|
const stdoutDecoder = new TextDecoder("utf-8", { fatal: false });
|
|
@@ -32309,12 +32392,14 @@ var MicrosandboxClaudeExecutor = class {
|
|
|
32309
32392
|
exitCode = 1;
|
|
32310
32393
|
stderrParts.push(`synthesizer sandbox boot failed: ${formatError(error)}`);
|
|
32311
32394
|
} finally {
|
|
32395
|
+
guestMemory?.stop();
|
|
32312
32396
|
if (sandbox) try {
|
|
32313
32397
|
await sandbox.stopWithTimeout(SANDBOX_STOP_TIMEOUT_MS);
|
|
32314
32398
|
} catch (error) {
|
|
32315
32399
|
stderrParts.push(`sandbox stop failed: ${formatError(error)}`);
|
|
32316
32400
|
}
|
|
32317
32401
|
}
|
|
32402
|
+
if (exitCode !== 0 && guestMemory) stderrParts.push(`guest memory watermark: ${formatGuestMemory(guestMemory.read())}\n`);
|
|
32318
32403
|
return {
|
|
32319
32404
|
exitCode,
|
|
32320
32405
|
observation,
|
|
@@ -32322,6 +32407,12 @@ var MicrosandboxClaudeExecutor = class {
|
|
|
32322
32407
|
};
|
|
32323
32408
|
}
|
|
32324
32409
|
};
|
|
32410
|
+
function formatGuestMemory(reading) {
|
|
32411
|
+
const mib = (bytes) => `${Math.round(bytes / 1048576)}MiB`;
|
|
32412
|
+
const r = reading.reading;
|
|
32413
|
+
const base = r ? `peak ${mib(r.peakBytes)} of ${mib(r.limitBytes)} (latest ${mib(r.latestBytes)}, ${r.samples} samples)` : "no samples";
|
|
32414
|
+
return reading.lastFailure ? `${base}; last sampling failure at ${reading.lastFailure.at}: ${reading.lastFailure.message}` : base;
|
|
32415
|
+
}
|
|
32325
32416
|
function buildMicrosandboxClaudeRunPlan(input) {
|
|
32326
32417
|
return {
|
|
32327
32418
|
command: synthesizerCommand(input.runId, input.rootDir, {
|
|
@@ -37936,9 +38027,9 @@ async function fetchWorkspacePlan(input) {
|
|
|
37936
38027
|
|
|
37937
38028
|
//#endregion
|
|
37938
38029
|
//#region env.ts
|
|
37939
|
-
const nonEmptyStringSchema = string$
|
|
38030
|
+
const nonEmptyStringSchema = string$3().trim().min(1);
|
|
37940
38031
|
const authUrlSchema = url().refine((value) => value.startsWith("http://") || value.startsWith("https://"), { message: "Expected an http:// or https:// URL." }).transform((value) => value.replace(/\/+$/, ""));
|
|
37941
|
-
const envSchema = object$
|
|
38032
|
+
const envSchema = object$3({
|
|
37942
38033
|
CTX_MACHINE_CLIENT_ID: nonEmptyStringSchema.optional(),
|
|
37943
38034
|
CTX_MACHINE_CLIENT_SECRET: nonEmptyStringSchema.optional(),
|
|
37944
38035
|
CTX_PLATFORM_URL: nonEmptyStringSchema.default("http://127.0.0.1:3010"),
|
|
@@ -38065,7 +38156,7 @@ const DURATION_UNIT_MS = {
|
|
|
38065
38156
|
m: 6e4,
|
|
38066
38157
|
s: 1e3
|
|
38067
38158
|
};
|
|
38068
|
-
const durationMsSchema = string$
|
|
38159
|
+
const durationMsSchema = string$3().transform((value, ctx) => {
|
|
38069
38160
|
const match = /^(\d+)(d|h|m|s)$/.exec(value);
|
|
38070
38161
|
if (match === null) {
|
|
38071
38162
|
ctx.addIssue({
|
|
@@ -38077,7 +38168,7 @@ const durationMsSchema = string$2().transform((value, ctx) => {
|
|
|
38077
38168
|
const [, amount, unit] = match;
|
|
38078
38169
|
return Number(amount) * DURATION_UNIT_MS[unit];
|
|
38079
38170
|
});
|
|
38080
|
-
const adHocWindowSchema = object$
|
|
38171
|
+
const adHocWindowSchema = object$3({
|
|
38081
38172
|
from: isoMsSchema.optional(),
|
|
38082
38173
|
last: durationMsSchema.optional(),
|
|
38083
38174
|
to: isoMsSchema.optional()
|
|
@@ -38960,7 +39051,7 @@ function resolveRepoContext(command) {
|
|
|
38960
39051
|
}
|
|
38961
39052
|
function createProgram() {
|
|
38962
39053
|
const program = new Command();
|
|
38963
|
-
program.name("ctxe").description("ContextEngine CLI").version(version$
|
|
39054
|
+
program.name("ctxe").description("ContextEngine CLI").version(version$1).option("--root-dir <path>", "Workspace checkout ctxe operates on (precedence: --root-dir > CTXE_ROOT_DIR > cwd).").showHelpAfterError(true).showSuggestionAfterError(true);
|
|
38964
39055
|
program.command("new <name>").description("Create a workspace on slate-platform (CTX_PLATFORM_URL; the server assigns the workspace_id and makes you its owner). Prompts on stdin for the Claude OAuth token (a secret, blank for none); base ids + synthesizer config are flags.").option("--base-id <id...>", "Base id(s) this workspace synthesizes from (repeatable)").option("--model <model>", "Claude model for synthesis — stored in the workspace plan and passed through to `claude --model`; any value the claude CLI accepts").option("--effort-level <level>", "Reasoning effort level — stored in the workspace plan and passed through to `claude --effort`; any value the claude CLI accepts").option("--tick <duration>", "Daemon tick as an ISO-8601 duration (e.g. PT20M)").option("--max-slice-size <duration>", "Max slice size as an ISO-8601 duration (e.g. PT24H)").option("--synthesizer-image <ref>", "Synthesizer sandbox image ref").option("--oldest-considered-point <iso>", "Oldest source instant to synthesize from (ISO-8601; absent → now − 30d, resolved at each run boundary)").action(async (name, options) => {
|
|
38965
39056
|
await runWorkspaceNew(name, options, env);
|
|
38966
39057
|
});
|
|
@@ -39037,4 +39128,4 @@ runCli().catch((error) => {
|
|
|
39037
39128
|
//#endregion
|
|
39038
39129
|
export { createProgram, resolveRepoContext, resolveRuntimePaths, runCli };
|
|
39039
39130
|
//# sourceMappingURL=cli.mjs.map
|
|
39040
|
-
//# debugId=
|
|
39131
|
+
//# debugId=e6a211a4-7df5-5298-b682-3f726da56b53
|