diff --git a/entry b/entry index 2da4f9e..91aa901 100755 --- a/entry +++ b/entry @@ -517,13 +517,13 @@ var require_tunnel = __commonJS({ var debug2; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug2 = function() { - var args3 = Array.prototype.slice.call(arguments); - if (typeof args3[0] === "string") { - args3[0] = "TUNNEL: " + args3[0]; + var args2 = Array.prototype.slice.call(arguments); + if (typeof args2[0] === "string") { + args2[0] = "TUNNEL: " + args2[0]; } else { - args3.unshift("TUNNEL:"); + args2.unshift("TUNNEL:"); } - console.error.apply(console, args3); + console.error.apply(console, args2); }; } else { debug2 = function() { @@ -2666,7 +2666,7 @@ var require_multipart = __commonJS({ const self2 = this; let boundary; const limits = cfg.limits; - const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName3) => contentType === "application/octet-stream" || fileName3 !== void 0); + const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName2) => contentType === "application/octet-stream" || fileName2 !== void 0); const parsedConType = cfg.parsedConType || []; const defCharset = cfg.defCharset || "utf8"; const preservePath = cfg.preservePath; @@ -4928,12 +4928,12 @@ var require_file = __commonJS({ var { kEnumerableProperty } = require_util(); var encoder = new TextEncoder(); var File2 = class _File extends Blob2 { - constructor(fileBits, fileName3, options = {}) { + constructor(fileBits, fileName2, options = {}) { webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" }); fileBits = webidl.converters["sequence"](fileBits); - fileName3 = webidl.converters.USVString(fileName3); + fileName2 = webidl.converters.USVString(fileName2); options = webidl.converters.FilePropertyBag(options); - const n = fileName3; + const n = fileName2; let t = options.type; let d; substep: { @@ -4968,8 +4968,8 @@ var require_file = __commonJS({ } }; var FileLike = class _FileLike { - constructor(blobLike, fileName3, options = {}) { - const n = fileName3; + constructor(blobLike, fileName2, options = {}) { + const n = fileName2; const t = options.type; const d = options.lastModified ?? Date.now(); this[kState] = { @@ -4979,21 +4979,21 @@ var require_file = __commonJS({ lastModified: d }; } - stream(...args3) { + stream(...args2) { webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.stream(...args3); + return this[kState].blobLike.stream(...args2); } - arrayBuffer(...args3) { + arrayBuffer(...args2) { webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.arrayBuffer(...args3); + return this[kState].blobLike.arrayBuffer(...args2); } - slice(...args3) { + slice(...args2) { webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.slice(...args3); + return this[kState].blobLike.slice(...args2); } - text(...args3) { + text(...args2) { webidl.brandCheck(this, _FileLike); - return this[kState].blobLike.text(...args3); + return this[kState].blobLike.text(...args2); } get size() { webidl.brandCheck(this, _FileLike); @@ -8981,8 +8981,8 @@ var require_balanced_pool = __commonJS({ pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); }); - pool.on("disconnect", (...args3) => { - const err = args3[2]; + pool.on("disconnect", (...args2) => { + const err = args2[2]; if (err && err.code === "UND_ERR_SOCKET") { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); @@ -9256,32 +9256,32 @@ var require_readable = __commonJS({ } return super.destroy(err); } - emit(ev, ...args3) { + emit(ev, ...args2) { if (ev === "data") { this._readableState.dataEmitted = true; } else if (ev === "error") { this._readableState.errorEmitted = true; } - return super.emit(ev, ...args3); + return super.emit(ev, ...args2); } - on(ev, ...args3) { + on(ev, ...args2) { if (ev === "data" || ev === "readable") { this[kReading] = true; } - return super.on(ev, ...args3); + return super.on(ev, ...args2); } - addListener(ev, ...args3) { - return this.on(ev, ...args3); + addListener(ev, ...args2) { + return this.on(ev, ...args2); } - off(ev, ...args3) { - const ret = super.off(ev, ...args3); + off(ev, ...args2) { + const ret = super.off(ev, ...args2); if (ev === "data" || ev === "readable") { this[kReading] = this.listenerCount("data") > 0 || this.listenerCount("readable") > 0; } return ret; } - removeListener(ev, ...args3) { - return this.off(ev, ...args3); + removeListener(ev, ...args2) { + return this.off(ev, ...args2); } push(chunk) { if (this[kConsume] && chunk !== null && this.readableLength === 0) { @@ -11528,26 +11528,26 @@ var require_DecoratorHandler = __commonJS({ constructor(handler2) { this.handler = handler2; } - onConnect(...args3) { - return this.handler.onConnect(...args3); + onConnect(...args2) { + return this.handler.onConnect(...args2); } - onError(...args3) { - return this.handler.onError(...args3); + onError(...args2) { + return this.handler.onError(...args2); } - onUpgrade(...args3) { - return this.handler.onUpgrade(...args3); + onUpgrade(...args2) { + return this.handler.onUpgrade(...args2); } - onHeaders(...args3) { - return this.handler.onHeaders(...args3); + onHeaders(...args2) { + return this.handler.onHeaders(...args2); } - onData(...args3) { - return this.handler.onData(...args3); + onData(...args2) { + return this.handler.onData(...args2); } - onComplete(...args3) { - return this.handler.onComplete(...args3); + onComplete(...args2) { + return this.handler.onComplete(...args2); } - onBodySent(...args3) { - return this.handler.onBodySent(...args3); + onBodySent(...args2) { + return this.handler.onBodySent(...args2); } }; } @@ -18847,9 +18847,9 @@ var require_io = __commonJS({ currentDepth++; yield mkdirP(destDir); const files = yield ioUtil.readdir(sourceDir); - for (const fileName3 of files) { - const srcFile = `${sourceDir}/${fileName3}`; - const destFile = `${destDir}/${fileName3}`; + for (const fileName2 of files) { + const srcFile = `${sourceDir}/${fileName2}`; + const destFile = `${destDir}/${fileName2}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { yield cpDirRecursive(srcFile, destFile, currentDepth, force); @@ -18947,13 +18947,13 @@ var require_toolrunner = __commonJS({ var timers_1 = __require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner = class extends events.EventEmitter { - constructor(toolPath, args3, options) { + constructor(toolPath, args2, options) { super(); if (!toolPath) { throw new Error("Parameter 'toolPath' cannot be null or empty."); } this.toolPath = toolPath; - this.args = args3 || []; + this.args = args2 || []; this.options = options || {}; } _debug(message) { @@ -18963,28 +18963,28 @@ var require_toolrunner = __commonJS({ } _getCommandString(options, noPrefix) { const toolPath = this._getSpawnFileName(); - const args3 = this._getSpawnArgs(options); + const args2 = this._getSpawnArgs(options); let cmd = noPrefix ? "" : "[command]"; if (IS_WINDOWS) { if (this._isCmdFile()) { cmd += toolPath; - for (const a of args3) { + for (const a of args2) { cmd += ` ${a}`; } } else if (options.windowsVerbatimArguments) { cmd += `"${toolPath}"`; - for (const a of args3) { + for (const a of args2) { cmd += ` ${a}`; } } else { cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args3) { + for (const a of args2) { cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } } else { cmd += toolPath; - for (const a of args3) { + for (const a of args2) { cmd += ` ${a}`; } } @@ -19176,8 +19176,8 @@ var require_toolrunner = __commonJS({ if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); } - const fileName3 = this._getSpawnFileName(); - const cp = child.spawn(fileName3, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName3)); + const fileName2 = this._getSpawnFileName(); + const cp = child.spawn(fileName2, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName2)); let stdbuffer = ""; if (cp.stdout) { cp.stdout.on("data", (data) => { @@ -19257,11 +19257,11 @@ var require_toolrunner = __commonJS({ }; exports.ToolRunner = ToolRunner; function argStringToArray(argString) { - const args3 = []; + const args2 = []; let inQuotes = false; let escaped = false; let arg = ""; - function append3(c) { + function append2(c) { if (escaped && c !== '"') { arg += "\\"; } @@ -19274,12 +19274,12 @@ var require_toolrunner = __commonJS({ if (!escaped) { inQuotes = !inQuotes; } else { - append3(c); + append2(c); } continue; } if (c === "\\" && escaped) { - append3(c); + append2(c); continue; } if (c === "\\" && inQuotes) { @@ -19288,17 +19288,17 @@ var require_toolrunner = __commonJS({ } if (c === " " && !inQuotes) { if (arg.length > 0) { - args3.push(arg); + args2.push(arg); arg = ""; } continue; } - append3(c); + append2(c); } if (arg.length > 0) { - args3.push(arg.trim()); + args2.push(arg.trim()); } - return args3; + return args2; } exports.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { @@ -19424,20 +19424,20 @@ var require_exec = __commonJS({ exports.getExecOutput = exports.exec = void 0; var string_decoder_1 = __require("string_decoder"); var tr = __importStar(require_toolrunner()); - function exec(commandLine, args3, options) { + function exec(commandLine, args2, options) { return __awaiter(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } const toolPath = commandArgs[0]; - args3 = commandArgs.slice(1).concat(args3 || []); - const runner = new tr.ToolRunner(toolPath, args3, options); + args2 = commandArgs.slice(1).concat(args2 || []); + const runner = new tr.ToolRunner(toolPath, args2, options); return runner.exec(); }); } exports.exec = exec; - function getExecOutput(commandLine, args3, options) { + function getExecOutput(commandLine, args2, options) { var _a, _b; return __awaiter(this, void 0, void 0, function* () { let stdout = ""; @@ -19459,7 +19459,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec(commandLine, args3, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args2, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -20510,9 +20510,9 @@ var require_conversions = __commonJS({ const b = c * Math.sin(hr); return [l, a, b]; }; - convert.rgb.ansi16 = function(args3, saturation = null) { - const [r, g, b] = args3; - let value2 = saturation === null ? convert.rgb.hsv(args3)[2] : saturation; + convert.rgb.ansi16 = function(args2, saturation = null) { + const [r, g, b] = args2; + let value2 = saturation === null ? convert.rgb.hsv(args2)[2] : saturation; value2 = Math.round(value2 / 50); if (value2 === 0) { return 30; @@ -20523,13 +20523,13 @@ var require_conversions = __commonJS({ } return ansi; }; - convert.hsv.ansi16 = function(args3) { - return convert.rgb.ansi16(convert.hsv.rgb(args3), args3[2]); + convert.hsv.ansi16 = function(args2) { + return convert.rgb.ansi16(convert.hsv.rgb(args2), args2[2]); }; - convert.rgb.ansi256 = function(args3) { - const r = args3[0]; - const g = args3[1]; - const b = args3[2]; + convert.rgb.ansi256 = function(args2) { + const r = args2[0]; + const g = args2[1]; + const b = args2[2]; if (r === g && g === b) { if (r < 8) { return 16; @@ -20542,40 +20542,40 @@ var require_conversions = __commonJS({ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); return ansi; }; - convert.ansi16.rgb = function(args3) { - let color = args3 % 10; + convert.ansi16.rgb = function(args2) { + let color = args2 % 10; if (color === 0 || color === 7) { - if (args3 > 50) { + if (args2 > 50) { color += 3.5; } color = color / 10.5 * 255; return [color, color, color]; } - const mult = (~~(args3 > 50) + 1) * 0.5; + const mult = (~~(args2 > 50) + 1) * 0.5; const r = (color & 1) * mult * 255; const g = (color >> 1 & 1) * mult * 255; const b = (color >> 2 & 1) * mult * 255; return [r, g, b]; }; - convert.ansi256.rgb = function(args3) { - if (args3 >= 232) { - const c = (args3 - 232) * 10 + 8; + convert.ansi256.rgb = function(args2) { + if (args2 >= 232) { + const c = (args2 - 232) * 10 + 8; return [c, c, c]; } - args3 -= 16; + args2 -= 16; let rem; - const r = Math.floor(args3 / 36) / 5 * 255; - const g = Math.floor((rem = args3 % 36) / 6) / 5 * 255; + const r = Math.floor(args2 / 36) / 5 * 255; + const g = Math.floor((rem = args2 % 36) / 6) / 5 * 255; const b = rem % 6 / 5 * 255; return [r, g, b]; }; - convert.rgb.hex = function(args3) { - const integer3 = ((Math.round(args3[0]) & 255) << 16) + ((Math.round(args3[1]) & 255) << 8) + (Math.round(args3[2]) & 255); + convert.rgb.hex = function(args2) { + const integer3 = ((Math.round(args2[0]) & 255) << 16) + ((Math.round(args2[1]) & 255) << 8) + (Math.round(args2[2]) & 255); const string3 = integer3.toString(16).toUpperCase(); return "000000".substring(string3.length) + string3; }; - convert.hex.rgb = function(args3) { - const match2 = args3.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + convert.hex.rgb = function(args2) { + const match2 = args2.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); if (!match2) { return [0, 0, 0]; } @@ -20733,11 +20733,11 @@ var require_conversions = __commonJS({ convert.rgb.apple = function(rgb) { return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; }; - convert.gray.rgb = function(args3) { - return [args3[0] / 100 * 255, args3[0] / 100 * 255, args3[0] / 100 * 255]; + convert.gray.rgb = function(args2) { + return [args2[0] / 100 * 255, args2[0] / 100 * 255, args2[0] / 100 * 255]; }; - convert.gray.hsl = function(args3) { - return [0, 0, args3[0]]; + convert.gray.hsl = function(args2) { + return [0, 0, args2[0]]; }; convert.gray.hsv = convert.gray.hsl; convert.gray.hwb = function(gray) { @@ -20799,8 +20799,8 @@ var require_route = __commonJS({ return graph; } function link(from, to) { - return function(args3) { - return to(from(args3)); + return function(args2) { + return to(from(args2)); }; } function wrapConversion(toModel, graph) { @@ -20840,15 +20840,15 @@ var require_color_convert = __commonJS({ var convert = {}; var models = Object.keys(conversions); function wrapRaw(fn2) { - const wrappedFn = function(...args3) { - const arg0 = args3[0]; + const wrappedFn = function(...args2) { + const arg0 = args2[0]; if (arg0 === void 0 || arg0 === null) { return arg0; } if (arg0.length > 1) { - args3 = arg0; + args2 = arg0; } - return fn2(args3); + return fn2(args2); }; if ("conversion" in fn2) { wrappedFn.conversion = fn2.conversion; @@ -20856,15 +20856,15 @@ var require_color_convert = __commonJS({ return wrappedFn; } function wrapRounded(fn2) { - const wrappedFn = function(...args3) { - const arg0 = args3[0]; + const wrappedFn = function(...args2) { + const arg0 = args2[0]; if (arg0 === void 0 || arg0 === null) { return arg0; } if (arg0.length > 1) { - args3 = arg0; + args2 = arg0; } - const result = fn2(args3); + const result = fn2(args2); if (typeof result === "object") { for (let len = result.length, i = 0; i < len; i++) { result[i] = Math.round(result[i]); @@ -20897,16 +20897,16 @@ var require_color_convert = __commonJS({ var require_ansi_styles = __commonJS({ "node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module) { "use strict"; - var wrapAnsi16 = (fn2, offset) => (...args3) => { - const code = fn2(...args3); + var wrapAnsi16 = (fn2, offset) => (...args2) => { + const code = fn2(...args2); return `\x1B[${code + offset}m`; }; - var wrapAnsi256 = (fn2, offset) => (...args3) => { - const code = fn2(...args3); + var wrapAnsi256 = (fn2, offset) => (...args2) => { + const code = fn2(...args2); return `\x1B[${38 + offset};5;${code}m`; }; - var wrapAnsi16m = (fn2, offset) => (...args3) => { - const rgb = fn2(...args3); + var wrapAnsi16m = (fn2, offset) => (...args2) => { + const rgb = fn2(...args2); return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; }; var ansi2ansi = (n) => n; @@ -24900,7 +24900,7 @@ var require_createStream = __commonJS({ output = output.trimEnd(); process.stdout.write(output); }; - var append3 = (row, columnWidths, config2) => { + var append2 = (row, columnWidths, config2) => { const rows = prepareData([row], config2); const body = rows.map((literalRow) => { return (0, drawRow_1.drawRow)(literalRow, config2); @@ -24931,7 +24931,7 @@ var require_createStream = __commonJS({ empty = false; create(row, columnWidths, config2); } else { - append3(row, columnWidths, config2); + append2(row, columnWidths, config2); } } }; @@ -26145,24 +26145,24 @@ function processCreateParams3(params) { }; return { errorMap: customMap, description }; } -function timeRegexSource2(args3) { +function timeRegexSource2(args2) { let secondsRegexSource = `[0-5]\\d`; - if (args3.precision) { - secondsRegexSource = `${secondsRegexSource}\\.\\d{${args3.precision}}`; - } else if (args3.precision == null) { + if (args2.precision) { + secondsRegexSource = `${secondsRegexSource}\\.\\d{${args2.precision}}`; + } else if (args2.precision == null) { secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; } - const secondsQuantifier = args3.precision ? "+" : "?"; + const secondsQuantifier = args2.precision ? "+" : "?"; return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; } -function timeRegex2(args3) { - return new RegExp(`^${timeRegexSource2(args3)}$`); +function timeRegex2(args2) { + return new RegExp(`^${timeRegexSource2(args2)}$`); } -function datetimeRegex2(args3) { - let regex3 = `${dateRegexSource2}T${timeRegexSource2(args3)}`; +function datetimeRegex2(args2) { + let regex3 = `${dateRegexSource2}T${timeRegexSource2(args2)}`; const opts = []; - opts.push(args3.local ? `Z?` : `Z`); - if (args3.offset) + opts.push(args2.local ? `Z?` : `Z`); + if (args2.offset) opts.push(`([+-]\\d{2}:?\\d{2})`); regex3 = `${regex3}(${opts.join("|")})`; return new RegExp(`^${regex3}$`); @@ -28850,9 +28850,9 @@ var init_types = __esm({ }); return INVALID2; } - function makeArgsIssue(args3, error41) { + function makeArgsIssue(args2, error41) { return makeIssue2({ - data: args3, + data: args2, path: ctx.path, errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default2].filter((x) => !!x), issueData: { @@ -28876,10 +28876,10 @@ var init_types = __esm({ const fn2 = ctx.data; if (this._def.returns instanceof ZodPromise2) { const me = this; - return OK2(async function(...args3) { + return OK2(async function(...args2) { const error41 = new ZodError2([]); - const parsedArgs = await me._def.args.parseAsync(args3, params).catch((e) => { - error41.addIssue(makeArgsIssue(args3, e)); + const parsedArgs = await me._def.args.parseAsync(args2, params).catch((e) => { + error41.addIssue(makeArgsIssue(args2, e)); throw error41; }); const result = await Reflect.apply(fn2, this, parsedArgs); @@ -28891,10 +28891,10 @@ var init_types = __esm({ }); } else { const me = this; - return OK2(function(...args3) { - const parsedArgs = me._def.args.safeParse(args3, params); + return OK2(function(...args2) { + const parsedArgs = me._def.args.safeParse(args2, params); if (!parsedArgs.success) { - throw new ZodError2([makeArgsIssue(args3, parsedArgs.error)]); + throw new ZodError2([makeArgsIssue(args2, parsedArgs.error)]); } const result = Reflect.apply(fn2, this, parsedArgs.data); const parsedReturns = me._def.returns.safeParse(result, params); @@ -28931,9 +28931,9 @@ var init_types = __esm({ const validatedFunc = this.parse(func); return validatedFunc; } - static create(args3, returns, params) { + static create(args2, returns, params) { return new _ZodFunction({ - args: args3 ? args3 : ZodTuple2.create([]).rest(ZodUnknown2.create()), + args: args2 ? args2 : ZodTuple2.create([]).rest(ZodUnknown2.create()), returns: returns || ZodUnknown2.create(), typeName: ZodFirstPartyTypeKind2.ZodFunction, ...processCreateParams3(params) @@ -35731,8 +35731,8 @@ var require_ajv2 = __commonJS({ throw new Error("schema should be object or boolean"); var serialize = this._opts.serialize; var cacheKey = serialize ? serialize(schema2) : schema2; - var cached4 = this._cache.get(cacheKey); - if (cached4) return cached4; + var cached3 = this._cache.get(cacheKey); + if (cached3) return cached3; shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false; var id = resolve.normalizeId(this._getId(schema2)); if (id && shouldAddSchema) checkUnique(this, id); @@ -38077,8 +38077,8 @@ var require_dispatcher2 = __commonJS({ destroy() { throw new Error("not implemented"); } - compose(...args3) { - const interceptors = Array.isArray(args3[0]) ? args3[0] : args3; + compose(...args2) { + const interceptors = Array.isArray(args2[0]) ? args2[0] : args2; let dispatch = this.dispatch.bind(this); for (const interceptor of interceptors) { if (interceptor == null) { @@ -44483,8 +44483,8 @@ var require_balanced_pool2 = __commonJS({ pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); }); - pool.on("disconnect", (...args3) => { - const err = args3[2]; + pool.on("disconnect", (...args2) => { + const err = args2[2]; if (err && err.code === "UND_ERR_SOCKET") { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]); this._updateBalancedPoolStats(); @@ -48588,35 +48588,35 @@ var require_decorator_handler = __commonJS({ } this.#handler = WrapHandler.wrap(handler2); } - onRequestStart(...args3) { - this.#handler.onRequestStart?.(...args3); + onRequestStart(...args2) { + this.#handler.onRequestStart?.(...args2); } - onRequestUpgrade(...args3) { + onRequestUpgrade(...args2) { assert2(!this.#onCompleteCalled); assert2(!this.#onErrorCalled); - return this.#handler.onRequestUpgrade?.(...args3); + return this.#handler.onRequestUpgrade?.(...args2); } - onResponseStart(...args3) { + onResponseStart(...args2) { assert2(!this.#onCompleteCalled); assert2(!this.#onErrorCalled); assert2(!this.#onResponseStartCalled); this.#onResponseStartCalled = true; - return this.#handler.onResponseStart?.(...args3); + return this.#handler.onResponseStart?.(...args2); } - onResponseData(...args3) { + onResponseData(...args2) { assert2(!this.#onCompleteCalled); assert2(!this.#onErrorCalled); - return this.#handler.onResponseData?.(...args3); + return this.#handler.onResponseData?.(...args2); } - onResponseEnd(...args3) { + onResponseEnd(...args2) { assert2(!this.#onCompleteCalled); assert2(!this.#onErrorCalled); this.#onCompleteCalled = true; - return this.#handler.onResponseEnd?.(...args3); + return this.#handler.onResponseEnd?.(...args2); } - onResponseError(...args3) { + onResponseError(...args2) { this.#onErrorCalled = true; - return this.#handler.onResponseError?.(...args3); + return this.#handler.onResponseError?.(...args2); } /** * @deprecated @@ -57210,8 +57210,8 @@ var require_websocketerror = __commonJS({ return DOMException; } return new Proxy(DOMException, { - construct(target, args3, newTarget) { - const instance = Reflect.construct(target, args3, target); + construct(target, args2, newTarget) { + const instance = Reflect.construct(target, args2, target); Object.setPrototypeOf(instance, newTarget.prototype); return instance; } @@ -58771,26 +58771,26 @@ var require_uri_templates = __commonJS({ } }); -// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js +// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js var arktype_C_GObzDh_exports = {}; __export(arktype_C_GObzDh_exports, { getToJsonSchemaFn: () => getToJsonSchemaFn }); var getToJsonSchemaFn; var init_arktype_C_GObzDh = __esm({ - "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js"() { + "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/arktype-C-GObzDh.js"() { getToJsonSchemaFn = async () => (schema2) => schema2.toJsonSchema(); } }); -// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect--zg3C1LQ.js +// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect--zg3C1LQ.js var effect_zg3C1LQ_exports = {}; __export(effect_zg3C1LQ_exports, { getToJsonSchemaFn: () => getToJsonSchemaFn2 }); var getToJsonSchemaFn2; var init_effect_zg3C1LQ = __esm({ - "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect--zg3C1LQ.js"() { + "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/effect--zg3C1LQ.js"() { init_index_CAcLDIRJ(); getToJsonSchemaFn2 = async () => { const { JSONSchema } = await tryImport(import("effect"), "effect"); @@ -58799,14 +58799,14 @@ var init_effect_zg3C1LQ = __esm({ } }); -// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-s6Akl-oc.js +// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-s6Akl-oc.js var sury_s6Akl_oc_exports = {}; __export(sury_s6Akl_oc_exports, { getToJsonSchemaFn: () => getToJsonSchemaFn3 }); var getToJsonSchemaFn3; var init_sury_s6Akl_oc = __esm({ - "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-s6Akl-oc.js"() { + "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/sury-s6Akl-oc.js"() { init_index_CAcLDIRJ(); getToJsonSchemaFn3 = async () => { const { toJSONSchema: toJSONSchema2 } = await tryImport(import("sury"), "sury"); @@ -58815,14 +58815,14 @@ var init_sury_s6Akl_oc = __esm({ } }); -// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-DBCeetIe.js +// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-DBCeetIe.js var valibot_DBCeetIe_exports = {}; __export(valibot_DBCeetIe_exports, { getToJsonSchemaFn: () => getToJsonSchemaFn4 }); var getToJsonSchemaFn4; var init_valibot_DBCeetIe = __esm({ - "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-DBCeetIe.js"() { + "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/valibot-DBCeetIe.js"() { init_index_CAcLDIRJ(); getToJsonSchemaFn4 = async () => { const { toJsonSchema: toJsonSchema2 } = await tryImport(import("@valibot/to-json-schema"), "@valibot/to-json-schema"); @@ -58910,7 +58910,7 @@ __export(util_exports, { assertNever: () => assertNever, assertNotEqual: () => assertNotEqual, assignProp: () => assignProp, - cached: () => cached3, + cached: () => cached2, captureStackTrace: () => captureStackTrace, cleanEnum: () => cleanEnum, cleanRegex: () => cleanRegex, @@ -58975,7 +58975,7 @@ function jsonStringifyReplacer(_, value2) { return value2.toString(); return value2; } -function cached3(getter) { +function cached2(getter) { const set = false; return { get value() { @@ -59324,8 +59324,8 @@ function getLengthableOrigin(input) { return "string"; return "unknown"; } -function issue(...args3) { - const [iss, input, inst] = args3; +function issue(...args2) { + const [iss, input, inst] = args2; if (typeof iss === "string") { return { message: iss, @@ -59346,7 +59346,7 @@ var init_util2 = __esm({ "node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/util.js"() { captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => { }; - allowsEval = cached3(() => { + allowsEval = cached2(() => { if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { return false; } @@ -59684,20 +59684,20 @@ __export(regexes_exports, { function emoji() { return new RegExp(_emoji, "u"); } -function timeSource(args3) { +function timeSource(args2) { const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; - const regex3 = typeof args3.precision === "number" ? args3.precision === -1 ? `${hhmm}` : args3.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args3.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; + const regex3 = typeof args2.precision === "number" ? args2.precision === -1 ? `${hhmm}` : args2.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args2.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; return regex3; } -function time(args3) { - return new RegExp(`^${timeSource(args3)}$`); +function time(args2) { + return new RegExp(`^${timeSource(args2)}$`); } -function datetime(args3) { - const time2 = timeSource({ precision: args3.precision }); +function datetime(args2) { + const time2 = timeSource({ precision: args2.precision }); const opts = ["Z"]; - if (args3.local) + if (args2.local) opts.push(""); - if (args3.offset) + if (args2.offset) opts.push(`([+-]\\d{2}:\\d{2})`); const timeRegex4 = `${time2}(?:${opts.join("|")})`; return new RegExp(`^${dateSource}T(?:${timeRegex4})$`); @@ -60305,11 +60305,11 @@ var Doc; var init_doc = __esm({ "node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/doc.js"() { Doc = class { - constructor(args3 = []) { + constructor(args2 = []) { this.content = []; this.indent = 0; if (this) - this.args = args3; + this.args = args2; } indented(fn2) { this.indent += 1; @@ -60332,10 +60332,10 @@ var init_doc = __esm({ } compile() { const F = Function; - const args3 = this?.args; + const args2 = this?.args; const content = this?.content ?? [``]; const lines = [...content.map((x) => ` ${x}`)]; - return new F(...args3, lines.join("\n")); + return new F(...args2, lines.join("\n")); } }; } @@ -61171,7 +61171,7 @@ var init_schemas = __esm({ }); $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { $ZodType.init(inst, def); - const _normalized = cached3(() => { + const _normalized = cached2(() => { const keys = Object.keys(def.shape); for (const k of keys) { if (!(def.shape[k] instanceof $ZodType)) { @@ -61391,7 +61391,7 @@ var init_schemas = __esm({ } return propValues; }); - const disc = cached3(() => { + const disc = cached2(() => { const opts = def.options; const map = /* @__PURE__ */ new Map(); for (const o of opts) { @@ -67980,8 +67980,8 @@ var init_function = __esm({ if (typeof func !== "function") { throw new Error("implement() must be called with a function"); } - const impl = ((...args3) => { - const parsedArgs = this._def.input ? parse3(this._def.input, args3, void 0, { callee: impl }) : args3; + const impl = ((...args2) => { + const parsedArgs = this._def.input ? parse3(this._def.input, args2, void 0, { callee: impl }) : args2; if (!Array.isArray(parsedArgs)) { throw new Error("Invalid arguments schema: not an array or tuple schema."); } @@ -67994,8 +67994,8 @@ var init_function = __esm({ if (typeof func !== "function") { throw new Error("implement() must be called with a function"); } - const impl = (async (...args3) => { - const parsedArgs = this._def.input ? await parseAsync(this._def.input, args3, void 0, { callee: impl }) : args3; + const impl = (async (...args2) => { + const parsedArgs = this._def.input ? await parseAsync(this._def.input, args2, void 0, { callee: impl }) : args2; if (!Array.isArray(parsedArgs)) { throw new Error("Invalid arguments schema: not an array or tuple schema."); } @@ -68004,22 +68004,22 @@ var init_function = __esm({ }); return impl; } - input(...args3) { + input(...args2) { const F = this.constructor; - if (Array.isArray(args3[0])) { + if (Array.isArray(args2[0])) { return new F({ type: "function", input: new $ZodTuple({ type: "tuple", - items: args3[0], - rest: args3[1] + items: args2[0], + rest: args2[1] }), output: this._def.output }); } return new F({ type: "function", - input: args3[0], + input: args2[0], output: this._def.output }); } @@ -70713,14 +70713,14 @@ var init_esm = __esm({ } }); -// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-Bw_60DVU.js +// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-Bw_60DVU.js var zod_Bw_60DVU_exports = {}; __export(zod_Bw_60DVU_exports, { getToJsonSchemaFn: () => getToJsonSchemaFn5 }); var getToJsonSchemaFn5; var init_zod_Bw_60DVU = __esm({ - "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-Bw_60DVU.js"() { + "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/zod-Bw_60DVU.js"() { init_index_CAcLDIRJ(); getToJsonSchemaFn5 = async () => { let zodV4toJSONSchema = (_schema) => { @@ -70753,10 +70753,10 @@ var init_zod_Bw_60DVU = __esm({ } }); -// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CAcLDIRJ.js +// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CAcLDIRJ.js var missingDependenciesUrl, tryImport, getToJsonSchemaFn6, toJsonSchema; var init_index_CAcLDIRJ = __esm({ - "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CAcLDIRJ.js"() { + "node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index-CAcLDIRJ.js"() { missingDependenciesUrl = "https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies"; tryImport = async (result, name) => { try { @@ -70789,6 +70789,20 @@ var init_index_CAcLDIRJ = __esm({ var core3 = __toESM(require_core(), 1); // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/arrays.js +var liftArray = (data) => Array.isArray(data) ? data : [data]; +var spliterate = (arr, predicate) => { + const result = [[], []]; + for (const item of arr) { + if (predicate(item)) + result[0].push(item); + else + result[1].push(item); + } + return result; +}; +var ReadonlyArray = Array; +var includes = (array, element) => array.includes(element); +var range = (length, offset = 0) => [...new Array(length)].map((_, i) => i + offset); var append = (to, value2, opts) => { if (to === void 0) { return value2 === void 0 ? [] : Array.isArray(value2) ? value2 : [value2]; @@ -70806,8 +70820,36 @@ var append = (to, value2, opts) => { } return to; }; +var conflatenate = (to, elementOrList) => { + if (elementOrList === void 0 || elementOrList === null) + return to ?? []; + if (to === void 0 || to === null) + return liftArray(elementOrList); + return to.concat(elementOrList); +}; +var conflatenateAll = (...elementsOrLists) => elementsOrLists.reduce(conflatenate, []); +var appendUnique = (to, value2, opts) => { + if (to === void 0) + return Array.isArray(value2) ? value2 : [value2]; + const isEqual = opts?.isEqual ?? ((l, r) => l === r); + for (const v of liftArray(value2)) + if (!to.some((existing) => isEqual(existing, v))) + to.push(v); + return to; +}; +var groupBy = (array, discriminant) => array.reduce((result, item) => { + const key = item[discriminant]; + result[key] = append(result[key], item); + return result; +}, {}); +var arrayEquals = (l, r, opts) => l.length === r.length && l.every(opts?.isEqual ? (lItem, i) => opts.isEqual(lItem, r[i]) : (lItem, i) => lItem === r[i]); // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/domain.js +var hasDomain = (data, kind) => domainOf(data) === kind; +var domainOf = (data) => { + const builtinType = typeof data; + return builtinType === "object" ? data === null ? "null" : "object" : builtinType === "function" ? "object" : builtinType; +}; var domainDescriptions = { boolean: "boolean", null: "null", @@ -70824,6 +70866,16 @@ var jsTypeOfDescriptions = { }; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/errors.js +var InternalArktypeError = class extends Error { +}; +var throwInternalError = (message) => throwError(message, InternalArktypeError); +var throwError = (message, ctor = Error) => { + throw new ctor(message); +}; +var ParseError = class extends Error { + name = "ParseError"; +}; +var throwParseError = (message) => throwError(message, ParseError); var noSuggest = (s) => ` ${s}`; var ZeroWidthSpace = "\u200B"; @@ -70851,7 +70903,53 @@ var flatMorph = (o, flatMapEntry) => { }; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/records.js +var entriesOf = Object.entries; +var isKeyOf = (k, o) => k in o; +var hasKey = (o, k) => k in o; +var DynamicBase = class { + constructor(properties) { + Object.assign(this, properties); + } +}; +var NoopBase = class { +}; +var CastableBase = class extends NoopBase { +}; +var splitByKeys = (o, leftKeys) => { + const l = {}; + const r = {}; + let k; + for (k in o) { + if (k in leftKeys) + l[k] = o[k]; + else + r[k] = o[k]; + } + return [l, r]; +}; +var omit = (o, keys) => splitByKeys(o, keys)[1]; +var isEmptyObject = (o) => Object.keys(o).length === 0; +var stringAndSymbolicEntriesOf = (o) => [ + ...Object.entries(o), + ...Object.getOwnPropertySymbols(o).map((k) => [k, o[k]]) +]; +var defineProperties = (base, merged) => ( + // declared like this to avoid https://github.com/microsoft/TypeScript/issues/55049 + Object.defineProperties(base, Object.getOwnPropertyDescriptors(merged)) +); +var withAlphabetizedKeys = (o) => { + const keys = Object.keys(o).sort(); + const result = {}; + for (let i = 0; i < keys.length; i++) + result[keys[i]] = o[keys[i]]; + return result; +}; var unset = noSuggest(`unset${ZeroWidthSpace}`); +var enumValues = (tsEnum) => Object.values(tsEnum).filter((v) => { + if (typeof v === "number") + return true; + return typeof tsEnum[v] !== "number"; +}); // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/objectKinds.js var ecmascriptConstructors = { @@ -70901,6 +70999,17 @@ var builtinConstructors = { Number, Boolean }; +var objectKindOf = (data) => { + let prototype = Object.getPrototypeOf(data); + while (prototype?.constructor && (!isKeyOf(prototype.constructor.name, builtinConstructors) || !(data instanceof builtinConstructors[prototype.constructor.name]))) + prototype = Object.getPrototypeOf(prototype); + const name = prototype?.constructor?.name; + if (name === void 0 || name === "Object") + return void 0; + return name; +}; +var objectKindOrDomainOf = (data) => typeof data === "object" && data !== null ? objectKindOf(data) ?? "object" : domainOf(data); +var isArray = Array.isArray; var ecmascriptDescriptions = { Array: "an array", Function: "a function", @@ -70944,12 +71053,73 @@ var objectKindDescriptions = { ...platformDescriptions, ...typedArrayDescriptions }; +var getBuiltinNameOfConstructor = (ctor) => { + const constructorName = Object(ctor).name ?? null; + return constructorName && isKeyOf(constructorName, builtinConstructors) && builtinConstructors[constructorName] === ctor ? constructorName : null; +}; +var constructorExtends = (ctor, base) => { + let current = ctor.prototype; + while (current !== null) { + if (current === base.prototype) + return true; + current = Object.getPrototypeOf(current); + } + return false; +}; + +// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/clone.js +var deepClone = (input) => _clone(input, /* @__PURE__ */ new Map()); +var _clone = (input, seen) => { + if (typeof input !== "object" || input === null) + return input; + if (seen?.has(input)) + return seen.get(input); + const builtinConstructorName = getBuiltinNameOfConstructor(input.constructor); + if (builtinConstructorName === "Date") + return new Date(input.getTime()); + if (builtinConstructorName && builtinConstructorName !== "Array") + return input; + const cloned = Array.isArray(input) ? input.slice() : Object.create(Object.getPrototypeOf(input)); + const propertyDescriptors = Object.getOwnPropertyDescriptors(input); + if (seen) { + seen.set(input, cloned); + for (const k in propertyDescriptors) { + const desc = propertyDescriptors[k]; + if ("get" in desc || "set" in desc) + continue; + desc.value = _clone(desc.value, seen); + } + } + Object.defineProperties(cloned, propertyDescriptors); + return cloned; +}; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/functions.js var cached = (thunk) => { let result = unset; return () => result === unset ? result = thunk() : result; }; +var isThunk = (value2) => typeof value2 === "function" && value2.length === 0; +var DynamicFunction = class extends Function { + constructor(...args2) { + const params = args2.slice(0, -1); + const body = args2.at(-1); + try { + super(...params, body); + } catch (e) { + return throwInternalError(`Encountered an unexpected error while compiling your definition: + Message: ${e} + Source: (${args2.slice(0, -1)}) => { + ${args2.at(-1)} + }`); + } + } +}; +var Callable = class { + constructor(fn2, ...[opts]) { + return Object.assign(Object.setPrototypeOf(fn2.bind(opts?.bind ?? this), this.constructor.prototype), opts?.attach); + } +}; var envHasCsp = cached(() => { try { return new Function("return false")(); @@ -70964,6 +71134,10 @@ var inferred = noSuggest("arkInferred"); // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/hkt.js var args = noSuggest("args"); +var Hkt = class { + constructor() { + } +}; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/isomorphic.js var fileName = () => { @@ -70983,6 +71157,7 @@ var isomorphic = { }; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/strings.js +var capitalize = (s) => s[0].toUpperCase() + s.slice(1); var anchoredRegex = (regex3) => new RegExp(anchoredSource(regex3), typeof regex3 === "string" ? "" : regex3.flags); var anchoredSource = (regex3) => { const source = typeof regex3 === "string" ? regex3 : regex3.source; @@ -70992,6 +71167,12 @@ var RegexPatterns = { negativeLookahead: (pattern) => `(?!${pattern})`, nonCapturingGroup: (pattern) => `(?:${pattern})` }; +var Backslash = "\\"; +var whitespaceChars = { + " ": 1, + "\n": 1, + " ": 1 +}; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/numbers.js var anchoredNegativeZeroPattern = /^-0\.?0*$/.source; @@ -71009,10 +71190,52 @@ var numericStringMatcher = createNumberMatcher({ allowDecimalOnly: true }); var isNumericString = numericStringMatcher.test.bind(numericStringMatcher); +var numberLikeMatcher = /^-?\d*\.?\d*$/; +var isNumberLike = (s) => s.length !== 0 && numberLikeMatcher.test(s); var wellFormedIntegerMatcher = anchoredRegex(RegexPatterns.negativeLookahead("^-0$") + "-?" + RegexPatterns.nonCapturingGroup(RegexPatterns.nonCapturingGroup("0|" + positiveIntegerPattern))); var isWellFormedInteger = wellFormedIntegerMatcher.test.bind(wellFormedIntegerMatcher); var integerLikeMatcher = /^-?\d+$/; var isIntegerLike = integerLikeMatcher.test.bind(integerLikeMatcher); +var numericLiteralDescriptions = { + number: "a number", + bigint: "a bigint", + integer: "an integer" +}; +var writeMalformedNumericLiteralMessage = (def, kind) => `'${def}' was parsed as ${numericLiteralDescriptions[kind]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`; +var isWellFormed = (def, kind) => kind === "number" ? isWellFormedNumber(def) : isWellFormedInteger(def); +var parseKind = (def, kind) => kind === "number" ? Number(def) : Number.parseInt(def); +var isKindLike = (def, kind) => kind === "number" ? isNumberLike(def) : isIntegerLike(def); +var tryParseNumber = (token, options) => parseNumeric(token, "number", options); +var tryParseWellFormedNumber = (token, options) => parseNumeric(token, "number", { ...options, strict: true }); +var tryParseInteger = (token, options) => parseNumeric(token, "integer", options); +var parseNumeric = (token, kind, options) => { + const value2 = parseKind(token, kind); + if (!Number.isNaN(value2)) { + if (isKindLike(token, kind)) { + if (options?.strict) { + return isWellFormed(token, kind) ? value2 : throwParseError(writeMalformedNumericLiteralMessage(token, kind)); + } + return value2; + } + } + return options?.errorOnFail ? throwParseError(options?.errorOnFail === true ? `Failed to parse ${numericLiteralDescriptions[kind]} from '${token}'` : options?.errorOnFail) : void 0; +}; +var tryParseWellFormedBigint = (def) => { + if (def[def.length - 1] !== "n") + return; + const maybeIntegerLiteral = def.slice(0, -1); + let value2; + try { + value2 = BigInt(maybeIntegerLiteral); + } catch { + return; + } + if (wellFormedIntegerMatcher.test(maybeIntegerLiteral)) + return value2; + if (integerLikeMatcher.test(maybeIntegerLiteral)) { + return throwParseError(writeMalformedNumericLiteralMessage(def, "bigint")); + } +}; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/registry.js var arkUtilVersion = "0.53.0"; @@ -71021,6 +71244,315 @@ var initialRegistryContents = { filename: isomorphic.fileName(), FileConstructor }; +var registry = initialRegistryContents; +var namesByResolution = /* @__PURE__ */ new Map(); +var nameCounts = /* @__PURE__ */ Object.create(null); +var register = (value2) => { + const existingName = namesByResolution.get(value2); + if (existingName) + return existingName; + let name = baseNameFor(value2); + if (nameCounts[name]) + name = `${name}${nameCounts[name]++}`; + else + nameCounts[name] = 1; + registry[name] = value2; + namesByResolution.set(value2, name); + return name; +}; +var isDotAccessible = (keyName) => /^[$A-Z_a-z][\w$]*$/.test(keyName); +var baseNameFor = (value2) => { + switch (typeof value2) { + case "object": { + if (value2 === null) + break; + const prefix = objectKindOf(value2) ?? "object"; + return prefix[0].toLowerCase() + prefix.slice(1); + } + case "function": + return isDotAccessible(value2.name) ? value2.name : "fn"; + case "symbol": + return value2.description && isDotAccessible(value2.description) ? value2.description : "symbol"; + } + return throwInternalError(`Unexpected attempt to register serializable value of type ${domainOf(value2)}`); +}; + +// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/primitive.js +var serializePrimitive = (value2) => typeof value2 === "string" ? JSON.stringify(value2) : typeof value2 === "bigint" ? `${value2}n` : `${value2}`; + +// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/serialize.js +var snapshot = (data, opts = {}) => _serialize(data, { + onUndefined: `$ark.undefined`, + onBigInt: (n) => `$ark.bigint-${n}`, + ...opts +}, []); +var printable = (data, opts) => { + switch (domainOf(data)) { + case "object": + const o = data; + const ctorName = o.constructor.name; + return ctorName === "Object" || ctorName === "Array" ? opts?.quoteKeys === false ? stringifyUnquoted(o, opts?.indent ?? 0, "") : JSON.stringify(_serialize(o, printableOpts, []), null, opts?.indent) : stringifyUnquoted(o, opts?.indent ?? 0, ""); + case "symbol": + return printableOpts.onSymbol(data); + default: + return serializePrimitive(data); + } +}; +var stringifyUnquoted = (value2, indent2, currentIndent) => { + if (typeof value2 === "function") + return printableOpts.onFunction(value2); + if (typeof value2 !== "object" || value2 === null) + return serializePrimitive(value2); + const nextIndent = currentIndent + " ".repeat(indent2); + if (Array.isArray(value2)) { + if (value2.length === 0) + return "[]"; + const items = value2.map((item) => stringifyUnquoted(item, indent2, nextIndent)).join(",\n" + nextIndent); + return indent2 ? `[ +${nextIndent}${items} +${currentIndent}]` : `[${items}]`; + } + const ctorName = value2.constructor.name; + if (ctorName === "Object") { + const keyValues = stringAndSymbolicEntriesOf(value2).map(([key, val]) => { + const stringifiedKey = typeof key === "symbol" ? printableOpts.onSymbol(key) : isDotAccessible(key) ? key : JSON.stringify(key); + const stringifiedValue = stringifyUnquoted(val, indent2, nextIndent); + return `${nextIndent}${stringifiedKey}: ${stringifiedValue}`; + }); + if (keyValues.length === 0) + return "{}"; + return indent2 ? `{ +${keyValues.join(",\n")} +${currentIndent}}` : `{${keyValues.join(", ")}}`; + } + if (value2 instanceof Date) + return describeCollapsibleDate(value2); + if ("expression" in value2 && typeof value2.expression === "string") + return value2.expression; + return ctorName; +}; +var printableOpts = { + onCycle: () => "(cycle)", + onSymbol: (v) => `Symbol(${register(v)})`, + onFunction: (v) => `Function(${register(v)})` +}; +var _serialize = (data, opts, seen) => { + switch (domainOf(data)) { + case "object": { + const o = data; + if ("toJSON" in o && typeof o.toJSON === "function") + return o.toJSON(); + if (typeof o === "function") + return printableOpts.onFunction(o); + if (seen.includes(o)) + return "(cycle)"; + const nextSeen = [...seen, o]; + if (Array.isArray(o)) + return o.map((item) => _serialize(item, opts, nextSeen)); + if (o instanceof Date) + return o.toDateString(); + const result = {}; + for (const k in o) + result[k] = _serialize(o[k], opts, nextSeen); + for (const s of Object.getOwnPropertySymbols(o)) { + result[opts.onSymbol?.(s) ?? s.toString()] = _serialize(o[s], opts, nextSeen); + } + return result; + } + case "symbol": + return printableOpts.onSymbol(data); + case "bigint": + return opts.onBigInt?.(data) ?? `${data}n`; + case "undefined": + return opts.onUndefined ?? "undefined"; + case "string": + return data.replaceAll("\\", "\\\\"); + default: + return data; + } +}; +var describeCollapsibleDate = (date2) => { + const year = date2.getFullYear(); + const month = date2.getMonth(); + const dayOfMonth = date2.getDate(); + const hours = date2.getHours(); + const minutes = date2.getMinutes(); + const seconds = date2.getSeconds(); + const milliseconds = date2.getMilliseconds(); + if (month === 0 && dayOfMonth === 1 && hours === 0 && minutes === 0 && seconds === 0 && milliseconds === 0) + return `${year}`; + const datePortion = `${months[month]} ${dayOfMonth}, ${year}`; + if (hours === 0 && minutes === 0 && seconds === 0 && milliseconds === 0) + return datePortion; + let timePortion = date2.toLocaleTimeString(); + const suffix2 = timePortion.endsWith(" AM") || timePortion.endsWith(" PM") ? timePortion.slice(-3) : ""; + if (suffix2) + timePortion = timePortion.slice(0, -suffix2.length); + if (milliseconds) + timePortion += `.${pad(milliseconds, 3)}`; + else if (timeWithUnnecessarySeconds.test(timePortion)) + timePortion = timePortion.slice(0, -3); + return `${timePortion + suffix2}, ${datePortion}`; +}; +var months = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" +]; +var timeWithUnnecessarySeconds = /:\d\d:00$/; +var pad = (value2, length) => String(value2).padStart(length, "0"); + +// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/path.js +var appendStringifiedKey = (path3, prop, ...[opts]) => { + const stringifySymbol = opts?.stringifySymbol ?? printable; + let propAccessChain = path3; + switch (typeof prop) { + case "string": + propAccessChain = isDotAccessible(prop) ? path3 === "" ? prop : `${path3}.${prop}` : `${path3}[${JSON.stringify(prop)}]`; + break; + case "number": + propAccessChain = `${path3}[${prop}]`; + break; + case "symbol": + propAccessChain = `${path3}[${stringifySymbol(prop)}]`; + break; + default: + if (opts?.stringifyNonKey) + propAccessChain = `${path3}[${opts.stringifyNonKey(prop)}]`; + else { + throwParseError(`${printable(prop)} must be a PropertyKey or stringifyNonKey must be passed to options`); + } + } + return propAccessChain; +}; +var stringifyPath = (path3, ...opts) => path3.reduce((s, k) => appendStringifiedKey(s, k, ...opts), ""); +var ReadonlyPath = class extends ReadonlyArray { + // alternate strategy for caching since the base object is frozen + cache = {}; + constructor(...items) { + super(); + this.push(...items); + } + toJSON() { + if (this.cache.json) + return this.cache.json; + this.cache.json = []; + for (let i = 0; i < this.length; i++) { + this.cache.json.push(typeof this[i] === "symbol" ? printable(this[i]) : this[i]); + } + return this.cache.json; + } + stringify() { + if (this.cache.stringify) + return this.cache.stringify; + return this.cache.stringify = stringifyPath(this); + } + stringifyAncestors() { + if (this.cache.stringifyAncestors) + return this.cache.stringifyAncestors; + let propString = ""; + const result = [propString]; + for (const path3 of this) { + propString = appendStringifiedKey(propString, path3); + result.push(propString); + } + return this.cache.stringifyAncestors = result; + } +}; + +// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/scanner.js +var Scanner = class { + chars; + i; + def; + constructor(def) { + this.def = def; + this.chars = [...def]; + this.i = 0; + } + /** Get lookahead and advance scanner by one */ + shift() { + return this.chars[this.i++] ?? ""; + } + get lookahead() { + return this.chars[this.i] ?? ""; + } + get nextLookahead() { + return this.chars[this.i + 1] ?? ""; + } + get length() { + return this.chars.length; + } + shiftUntil(condition) { + let shifted = ""; + while (this.lookahead) { + if (condition(this, shifted)) + break; + else + shifted += this.shift(); + } + return shifted; + } + shiftUntilEscapable(condition) { + let shifted = ""; + while (this.lookahead) { + if (this.lookahead === Backslash) { + this.shift(); + if (condition(this, shifted)) + shifted += this.shift(); + else if (this.lookahead === Backslash) + shifted += this.shift(); + else + shifted += `${Backslash}${this.shift()}`; + } else if (condition(this, shifted)) + break; + else + shifted += this.shift(); + } + return shifted; + } + shiftUntilLookahead(charOrSet) { + return typeof charOrSet === "string" ? this.shiftUntil((s) => s.lookahead === charOrSet) : this.shiftUntil((s) => s.lookahead in charOrSet); + } + shiftUntilNonWhitespace() { + return this.shiftUntil(() => !(this.lookahead in whitespaceChars)); + } + jumpToIndex(i) { + this.i = i < 0 ? this.length + i : i; + } + jumpForward(count) { + this.i += count; + } + get location() { + return this.i; + } + get unscanned() { + return this.chars.slice(this.i, this.length).join(""); + } + get scanned() { + return this.chars.slice(0, this.i).join(""); + } + sliceChars(start, end) { + return this.chars.slice(start, end).join(""); + } + lookaheadIs(char) { + return this.lookahead === char; + } + lookaheadIsIn(tokens) { + return this.lookahead in tokens; + } +}; +var writeUnmatchedGroupCloseMessage = (char, unscanned) => `Unmatched ${char}${unscanned === "" ? "" : ` before ${unscanned}`}`; +var writeUnclosedGroupMessage = (missingChar) => `Missing ${missingChar}`; // node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/traits.js var implementedTraits = noSuggest("implementedTraits"); @@ -76972,9 +77504,9 @@ var require_ajv = __commonJS2((exports, module) => { throw new Error("schema should be object or boolean"); var serialize = this._opts.serialize; var cacheKey = serialize ? serialize(schema2) : schema2; - var cached4 = this._cache.get(cacheKey); - if (cached4) - return cached4; + var cached3 = this._cache.get(cacheKey); + if (cached3) + return cached3; shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false; var id = resolve.normalizeId(this._getId(schema2)); if (id && shouldAddSchema) @@ -77288,7 +77820,7 @@ var ProcessTransport = class { executableArgs = [], extraArgs = {}, pathToClaudeCodeExecutable, - env: env3 = { ...process.env }, + env: env2 = { ...process.env }, stderr, customSystemPrompt, appendSystemPrompt, @@ -77311,7 +77843,7 @@ var ProcessTransport = class { includePartialMessages, plugins } = this.options; - const args3 = [ + const args2 = [ "--output-format", "stream-json", "--verbose", @@ -77319,93 +77851,93 @@ var ProcessTransport = class { "stream-json" ]; if (typeof customSystemPrompt === "string") - args3.push("--system-prompt", customSystemPrompt); + args2.push("--system-prompt", customSystemPrompt); if (appendSystemPrompt) - args3.push("--append-system-prompt", appendSystemPrompt); + args2.push("--append-system-prompt", appendSystemPrompt); if (maxThinkingTokens !== void 0) { - args3.push("--max-thinking-tokens", maxThinkingTokens.toString()); + args2.push("--max-thinking-tokens", maxThinkingTokens.toString()); } if (maxTurns) - args3.push("--max-turns", maxTurns.toString()); + args2.push("--max-turns", maxTurns.toString()); if (maxBudgetUsd !== void 0) { - args3.push("--max-budget-usd", maxBudgetUsd.toString()); + args2.push("--max-budget-usd", maxBudgetUsd.toString()); } if (model) - args3.push("--model", model); - if (env3.DEBUG) - args3.push("--debug-to-stderr"); + args2.push("--model", model); + if (env2.DEBUG) + args2.push("--debug-to-stderr"); if (canUseTool) { if (permissionPromptToolName) { throw new Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other."); } - args3.push("--permission-prompt-tool", "stdio"); + args2.push("--permission-prompt-tool", "stdio"); } else if (permissionPromptToolName) { - args3.push("--permission-prompt-tool", permissionPromptToolName); + args2.push("--permission-prompt-tool", permissionPromptToolName); } if (continueConversation) - args3.push("--continue"); + args2.push("--continue"); if (resume) - args3.push("--resume", resume); + args2.push("--resume", resume); if (allowedTools.length > 0) { - args3.push("--allowedTools", allowedTools.join(",")); + args2.push("--allowedTools", allowedTools.join(",")); } if (disallowedTools.length > 0) { - args3.push("--disallowedTools", disallowedTools.join(",")); + args2.push("--disallowedTools", disallowedTools.join(",")); } if (mcpServers && Object.keys(mcpServers).length > 0) { - args3.push("--mcp-config", JSON.stringify({ mcpServers })); + args2.push("--mcp-config", JSON.stringify({ mcpServers })); } if (agents2 && Object.keys(agents2).length > 0) { - args3.push("--agents", JSON.stringify(agents2)); + args2.push("--agents", JSON.stringify(agents2)); } if (settingSources) { - args3.push("--setting-sources", settingSources.join(",")); + args2.push("--setting-sources", settingSources.join(",")); } if (strictMcpConfig) { - args3.push("--strict-mcp-config"); + args2.push("--strict-mcp-config"); } if (permissionMode) { - args3.push("--permission-mode", permissionMode); + args2.push("--permission-mode", permissionMode); } if (allowDangerouslySkipPermissions) { - args3.push("--allow-dangerously-skip-permissions"); + args2.push("--allow-dangerously-skip-permissions"); } if (fallbackModel) { if (model && fallbackModel === model) { throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option."); } - args3.push("--fallback-model", fallbackModel); + args2.push("--fallback-model", fallbackModel); } if (includePartialMessages) { - args3.push("--include-partial-messages"); + args2.push("--include-partial-messages"); } for (const dir of additionalDirectories) { - args3.push("--add-dir", dir); + args2.push("--add-dir", dir); } if (plugins && plugins.length > 0) { for (const plugin of plugins) { if (plugin.type === "local") { - args3.push("--plugin-dir", plugin.path); + args2.push("--plugin-dir", plugin.path); } else { throw new Error(`Unsupported plugin type: ${plugin.type}`); } } } if (this.options.forkSession) { - args3.push("--fork-session"); + args2.push("--fork-session"); } if (this.options.resumeSessionAt) { - args3.push("--resume-session-at", this.options.resumeSessionAt); + args2.push("--resume-session-at", this.options.resumeSessionAt); } for (const [flag, value2] of Object.entries(extraArgs)) { if (value2 === null) { - args3.push(`--${flag}`); + args2.push(`--${flag}`); } else { - args3.push(`--${flag}`, value2); + args2.push(`--${flag}`, value2); } } - if (!env3.CLAUDE_CODE_ENTRYPOINT) { - env3.CLAUDE_CODE_ENTRYPOINT = "sdk-ts"; + if (!env2.CLAUDE_CODE_ENTRYPOINT) { + env2.CLAUDE_CODE_ENTRYPOINT = "sdk-ts"; } const fs22 = getFsImplementation(); if (!fs22.existsSync(pathToClaudeCodeExecutable)) { @@ -77414,18 +77946,18 @@ var ProcessTransport = class { } const isNative = isNativeBinary(pathToClaudeCodeExecutable); const spawnCommand = isNative ? pathToClaudeCodeExecutable : executable; - const spawnArgs = isNative ? [...executableArgs, ...args3] : [...executableArgs, pathToClaudeCodeExecutable, ...args3]; + const spawnArgs = isNative ? [...executableArgs, ...args2] : [...executableArgs, pathToClaudeCodeExecutable, ...args2]; this.logForDebugging(isNative ? `Spawning Claude Code native binary: ${spawnCommand} ${spawnArgs.join(" ")}` : `Spawning Claude Code process: ${spawnCommand} ${spawnArgs.join(" ")}`); - const stderrMode = env3.DEBUG || stderr ? "pipe" : "ignore"; + const stderrMode = env2.DEBUG || stderr ? "pipe" : "ignore"; this.child = spawn(spawnCommand, spawnArgs, { cwd: cwd2, stdio: ["pipe", "pipe", stderrMode], signal: this.abortController.signal, - env: env3 + env: env2 }); this.childStdin = this.child.stdin; this.childStdout = this.child.stdout; - if (env3.DEBUG || stderr) { + if (env2.DEBUG || stderr) { this.child.stderr.on("data", (data) => { this.logForDebugging(data.toString()); }); @@ -78024,11 +78556,11 @@ function memoize(func, resolver) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { - var args3 = arguments, key = resolver ? resolver.apply(this, args3) : args3[0], cache = memoized.cache; + var args2 = arguments, key = resolver ? resolver.apply(this, args2) : args2[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } - var result = func.apply(this, args3); + var result = func.apply(this, args2); memoized.cache = cache.set(key, result) || cache; return result; }; @@ -79623,24 +80155,24 @@ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=) var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; var dateRegexSource = `((\\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])))`; var dateRegex = new RegExp(`^${dateRegexSource}$`); -function timeRegexSource(args3) { +function timeRegexSource(args2) { let secondsRegexSource = `[0-5]\\d`; - if (args3.precision) { - secondsRegexSource = `${secondsRegexSource}\\.\\d{${args3.precision}}`; - } else if (args3.precision == null) { + if (args2.precision) { + secondsRegexSource = `${secondsRegexSource}\\.\\d{${args2.precision}}`; + } else if (args2.precision == null) { secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; } - const secondsQuantifier = args3.precision ? "+" : "?"; + const secondsQuantifier = args2.precision ? "+" : "?"; return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; } -function timeRegex(args3) { - return new RegExp(`^${timeRegexSource(args3)}$`); +function timeRegex(args2) { + return new RegExp(`^${timeRegexSource(args2)}$`); } -function datetimeRegex(args3) { - let regex3 = `${dateRegexSource}T${timeRegexSource(args3)}`; +function datetimeRegex(args2) { + let regex3 = `${dateRegexSource}T${timeRegexSource(args2)}`; const opts = []; - opts.push(args3.local ? `Z?` : `Z`); - if (args3.offset) + opts.push(args2.local ? `Z?` : `Z`); + if (args2.offset) opts.push(`([+-]\\d{2}:?\\d{2})`); regex3 = `${regex3}(${opts.join("|")})`; return new RegExp(`^${regex3}$`); @@ -81853,9 +82385,9 @@ var ZodFunction = class _ZodFunction extends ZodType { }); return INVALID; } - function makeArgsIssue(args3, error41) { + function makeArgsIssue(args2, error41) { return makeIssue({ - data: args3, + data: args2, path: ctx.path, errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x), issueData: { @@ -81879,10 +82411,10 @@ var ZodFunction = class _ZodFunction extends ZodType { const fn2 = ctx.data; if (this._def.returns instanceof ZodPromise) { const me = this; - return OK(async function(...args3) { + return OK(async function(...args2) { const error41 = new ZodError([]); - const parsedArgs = await me._def.args.parseAsync(args3, params).catch((e) => { - error41.addIssue(makeArgsIssue(args3, e)); + const parsedArgs = await me._def.args.parseAsync(args2, params).catch((e) => { + error41.addIssue(makeArgsIssue(args2, e)); throw error41; }); const result = await Reflect.apply(fn2, this, parsedArgs); @@ -81894,10 +82426,10 @@ var ZodFunction = class _ZodFunction extends ZodType { }); } else { const me = this; - return OK(function(...args3) { - const parsedArgs = me._def.args.safeParse(args3, params); + return OK(function(...args2) { + const parsedArgs = me._def.args.safeParse(args2, params); if (!parsedArgs.success) { - throw new ZodError([makeArgsIssue(args3, parsedArgs.error)]); + throw new ZodError([makeArgsIssue(args2, parsedArgs.error)]); } const result = Reflect.apply(fn2, this, parsedArgs.data); const parsedReturns = me._def.returns.safeParse(result, params); @@ -81934,9 +82466,9 @@ var ZodFunction = class _ZodFunction extends ZodType { const validatedFunc = this.parse(func); return validatedFunc; } - static create(args3, returns, params) { + static create(args2, returns, params) { return new _ZodFunction({ - args: args3 ? args3 : ZodTuple.create([]).rest(ZodUnknown.create()), + args: args2 ? args2 : ZodTuple.create([]).rest(ZodUnknown.create()), returns: returns || ZodUnknown.create(), typeName: ZodFirstPartyTypeKind.ZodFunction, ...processCreateParams(params) @@ -83223,7 +83755,7 @@ function query({ continue: continueConversation, cwd: cwd2, disallowedTools = [], - env: env3, + env: env2, executable = isRunningWithBun() ? "bun" : "node", executableArgs = [], extraArgs = {}, @@ -83245,7 +83777,7 @@ function query({ stderr, strictMcpConfig } = rest; - let processEnv = env3; + let processEnv = env2; if (!processEnv) { processEnv = { ...process.env }; } @@ -83327,7 +83859,7 @@ function query({ // package.json var package_default = { name: "@pullfrog/action", - version: "0.0.127", + version: "0.0.128", type: "module", files: [ "index.js", @@ -83404,6 +83936,21 @@ var core = __toESM(require_core(), 1); var import_table = __toESM(require_src(), 1); var isGitHubActions = !!process.env.GITHUB_ACTIONS; var isDebugEnabled = () => process.env.LOG_LEVEL === "debug"; +function getTerminalWidth() { + if (process.stdout.columns && process.stdout.columns > 0) { + return process.stdout.columns; + } + return 120; +} +function truncateLine(line, maxLength) { + if (line.length <= maxLength) { + return line; + } + if (maxLength <= 3) { + return "...".slice(0, maxLength); + } + return line.slice(0, maxLength - 3) + "..."; +} function startGroup2(name) { if (isGitHubActions) { core.startGroup(name); @@ -83419,35 +83966,12 @@ function endGroup2() { } } function boxString(text, options) { - const { title, maxWidth = 80, indent: indent2 = "", padding = 1 } = options || {}; + const terminalWidth = getTerminalWidth(); + const { title, maxWidth = terminalWidth, indent: indent2 = "", padding = 1 } = options || {}; + const maxContentWidth = maxWidth - 2 - padding * 2; const lines = text.trim().split("\n"); - const wrappedLines = []; - for (const line of lines) { - if (line.length <= maxWidth - padding * 2) { - wrappedLines.push(line); - } else { - const words = line.split(" "); - let currentLine = ""; - for (const word of words) { - const testLine = currentLine ? `${currentLine} ${word}` : word; - if (testLine.length <= maxWidth - padding * 2) { - currentLine = testLine; - } else { - if (currentLine) { - wrappedLines.push(currentLine); - currentLine = word; - } else { - wrappedLines.push(word.substring(0, maxWidth - padding * 2)); - currentLine = word.substring(maxWidth - padding * 2); - } - } - } - if (currentLine) { - wrappedLines.push(currentLine); - } - } - } - const maxLineLength = Math.max(...wrappedLines.map((line) => line.length)); + const truncatedLines = lines.map((line) => truncateLine(line, maxContentWidth)); + const maxLineLength = Math.max(...truncatedLines.map((line) => line.length)); const contentBoxWidth = maxLineLength + padding * 2; const titleLineLength = title ? ` ${title} `.length : 0; const boxWidth = Math.max(contentBoxWidth, titleLineLength); @@ -83462,7 +83986,7 @@ function boxString(text, options) { result += `${indent2}\u250C${"\u2500".repeat(boxWidth)}\u2510 `; } - for (const line of wrappedLines) { + for (const line of truncatedLines) { const paddedLine = line.padEnd(maxLineLength); result += `${indent2}\u2502${" ".repeat(padding)}${paddedLine}${" ".repeat(padding)}\u2502 `; @@ -83719,7 +84243,7 @@ function isJsonArray(value2) { function isJsonObject(value2) { return value2 !== null && typeof value2 === "object" && !Array.isArray(value2); } -function isEmptyObject(value2) { +function isEmptyObject2(value2) { return Object.keys(value2).length === 0; } function isPlainObject(value2) { @@ -83790,7 +84314,7 @@ function collectSingleKeyChain(startKey, startValue, maxDepth) { segments.push(nextKey); currentValue = nextValue; } - if (!isJsonObject(currentValue) || isEmptyObject(currentValue)) return { + if (!isJsonObject(currentValue) || isEmptyObject2(currentValue)) return { segments, tail: void 0, leafValue: currentValue @@ -83880,7 +84404,7 @@ function encodeKeyValuePair(key, value2, writer, depth, options, siblings, rootL } else if (isJsonArray(leafValue)) { encodeArray(foldedKey, leafValue, writer, depth, options); return; - } else if (isJsonObject(leafValue) && isEmptyObject(leafValue)) { + } else if (isJsonObject(leafValue) && isEmptyObject2(leafValue)) { writer.push(depth, `${encodedFoldedKey}:`); return; } @@ -83899,7 +84423,7 @@ function encodeKeyValuePair(key, value2, writer, depth, options, siblings, rootL else if (isJsonArray(value2)) encodeArray(key, value2, writer, depth, options); else if (isJsonObject(value2)) { writer.push(depth, `${encodedKey}:`); - if (!isEmptyObject(value2)) encodeObject(value2, writer, depth + 1, options, rootLiteralKeys, currentPath, effectiveFlattenDepth); + if (!isEmptyObject2(value2)) encodeObject(value2, writer, depth + 1, options, rootLiteralKeys, currentPath, effectiveFlattenDepth); } } function encodeArray(key, value2, writer, depth, options) { @@ -83991,7 +84515,7 @@ function encodeMixedArrayAsListItems(prefix, items, writer, depth, options) { for (const item of items) encodeListItemValue(item, writer, depth + 1, options); } function encodeObjectAsListItem(obj, writer, depth, options) { - if (isEmptyObject(obj)) { + if (isEmptyObject2(obj)) { writer.push(depth, LIST_ITEM_MARKER); return; } @@ -84022,7 +84546,7 @@ function encodeObjectAsListItem(obj, writer, depth, options) { } else if (isJsonObject(firstValue)) { writer.pushListItem(depth, `${encodedKey}:`); - if (!isEmptyObject(firstValue)) encodeObject(firstValue, writer, depth + 2, options); + if (!isEmptyObject2(firstValue)) encodeObject(firstValue, writer, depth + 2, options); } for (let i = 1; i < entries.length; i++) { const [key, value2] = entries[i]; @@ -84048,777 +84572,7 @@ function resolveOptions(options) { }; } -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/arrays.js -var liftArray = (data) => Array.isArray(data) ? data : [data]; -var spliterate = (arr, predicate) => { - const result = [[], []]; - for (const item of arr) { - if (predicate(item)) - result[0].push(item); - else - result[1].push(item); - } - return result; -}; -var ReadonlyArray2 = Array; -var includes = (array, element) => array.includes(element); -var range = (length, offset = 0) => [...new Array(length)].map((_, i) => i + offset); -var append2 = (to, value2, opts) => { - if (to === void 0) { - return value2 === void 0 ? [] : Array.isArray(value2) ? value2 : [value2]; - } - if (opts?.prepend) { - if (Array.isArray(value2)) - to.unshift(...value2); - else - to.unshift(value2); - } else { - if (Array.isArray(value2)) - to.push(...value2); - else - to.push(value2); - } - return to; -}; -var conflatenate = (to, elementOrList) => { - if (elementOrList === void 0 || elementOrList === null) - return to ?? []; - if (to === void 0 || to === null) - return liftArray(elementOrList); - return to.concat(elementOrList); -}; -var conflatenateAll = (...elementsOrLists) => elementsOrLists.reduce(conflatenate, []); -var appendUnique = (to, value2, opts) => { - if (to === void 0) - return Array.isArray(value2) ? value2 : [value2]; - const isEqual = opts?.isEqual ?? ((l, r) => l === r); - for (const v of liftArray(value2)) - if (!to.some((existing) => isEqual(existing, v))) - to.push(v); - return to; -}; -var groupBy = (array, discriminant) => array.reduce((result, item) => { - const key = item[discriminant]; - result[key] = append2(result[key], item); - return result; -}, {}); -var arrayEquals = (l, r, opts) => l.length === r.length && l.every(opts?.isEqual ? (lItem, i) => opts.isEqual(lItem, r[i]) : (lItem, i) => lItem === r[i]); - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/domain.js -var hasDomain2 = (data, kind) => domainOf2(data) === kind; -var domainOf2 = (data) => { - const builtinType = typeof data; - return builtinType === "object" ? data === null ? "null" : "object" : builtinType === "function" ? "object" : builtinType; -}; -var domainDescriptions2 = { - boolean: "boolean", - null: "null", - undefined: "undefined", - bigint: "a bigint", - number: "a number", - object: "an object", - string: "a string", - symbol: "a symbol" -}; -var jsTypeOfDescriptions2 = { - ...domainDescriptions2, - function: "a function" -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/errors.js -var InternalArktypeError = class extends Error { -}; -var throwInternalError2 = (message) => throwError(message, InternalArktypeError); -var throwError = (message, ctor = Error) => { - throw new ctor(message); -}; -var ParseError = class extends Error { - name = "ParseError"; -}; -var throwParseError2 = (message) => throwError(message, ParseError); -var noSuggest2 = (s) => ` ${s}`; -var ZeroWidthSpace2 = "\u200B"; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/flatMorph.js -var flatMorph2 = (o, flatMapEntry) => { - const result = {}; - const inputIsArray = Array.isArray(o); - let outputShouldBeArray = false; - for (const [i, entry] of Object.entries(o).entries()) { - const mapped = inputIsArray ? flatMapEntry(i, entry[1]) : flatMapEntry(...entry, i); - outputShouldBeArray ||= typeof mapped[0] === "number"; - const flattenedEntries = Array.isArray(mapped[0]) || mapped.length === 0 ? ( - // if we have an empty array (for filtering) or an array with - // another array as its first element, treat it as a list - mapped - ) : [mapped]; - for (const [k, v] of flattenedEntries) { - if (typeof k === "object") - result[k.group] = append2(result[k.group], v); - else - result[k] = v; - } - } - return outputShouldBeArray ? Object.values(result) : result; -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/records.js -var entriesOf = Object.entries; -var isKeyOf2 = (k, o) => k in o; -var hasKey = (o, k) => k in o; -var DynamicBase = class { - constructor(properties) { - Object.assign(this, properties); - } -}; -var NoopBase2 = class { -}; -var CastableBase = class extends NoopBase2 { -}; -var splitByKeys = (o, leftKeys) => { - const l = {}; - const r = {}; - let k; - for (k in o) { - if (k in leftKeys) - l[k] = o[k]; - else - r[k] = o[k]; - } - return [l, r]; -}; -var omit = (o, keys) => splitByKeys(o, keys)[1]; -var isEmptyObject2 = (o) => Object.keys(o).length === 0; -var stringAndSymbolicEntriesOf2 = (o) => [ - ...Object.entries(o), - ...Object.getOwnPropertySymbols(o).map((k) => [k, o[k]]) -]; -var defineProperties = (base, merged) => ( - // declared like this to avoid https://github.com/microsoft/TypeScript/issues/55049 - Object.defineProperties(base, Object.getOwnPropertyDescriptors(merged)) -); -var withAlphabetizedKeys = (o) => { - const keys = Object.keys(o).sort(); - const result = {}; - for (let i = 0; i < keys.length; i++) - result[keys[i]] = o[keys[i]]; - return result; -}; -var unset2 = noSuggest2(`unset${ZeroWidthSpace2}`); -var enumValues = (tsEnum) => Object.values(tsEnum).filter((v) => { - if (typeof v === "number") - return true; - return typeof tsEnum[v] !== "number"; -}); - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/objectKinds.js -var ecmascriptConstructors2 = { - Array, - Boolean, - Date, - Error, - Function, - Map, - Number, - Promise, - RegExp, - Set, - String, - WeakMap, - WeakSet -}; -var FileConstructor2 = globalThis.File ?? Blob; -var platformConstructors2 = { - ArrayBuffer, - Blob, - File: FileConstructor2, - FormData, - Headers, - Request, - Response, - URL -}; -var typedArrayConstructors2 = { - Int8Array, - Uint8Array, - Uint8ClampedArray, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array, - BigInt64Array, - BigUint64Array -}; -var builtinConstructors2 = { - ...ecmascriptConstructors2, - ...platformConstructors2, - ...typedArrayConstructors2, - String, - Number, - Boolean -}; -var objectKindOf2 = (data) => { - let prototype = Object.getPrototypeOf(data); - while (prototype?.constructor && (!isKeyOf2(prototype.constructor.name, builtinConstructors2) || !(data instanceof builtinConstructors2[prototype.constructor.name]))) - prototype = Object.getPrototypeOf(prototype); - const name = prototype?.constructor?.name; - if (name === void 0 || name === "Object") - return void 0; - return name; -}; -var objectKindOrDomainOf = (data) => typeof data === "object" && data !== null ? objectKindOf2(data) ?? "object" : domainOf2(data); -var isArray = Array.isArray; -var ecmascriptDescriptions2 = { - Array: "an array", - Function: "a function", - Date: "a Date", - RegExp: "a RegExp", - Error: "an Error", - Map: "a Map", - Set: "a Set", - String: "a String object", - Number: "a Number object", - Boolean: "a Boolean object", - Promise: "a Promise", - WeakMap: "a WeakMap", - WeakSet: "a WeakSet" -}; -var platformDescriptions2 = { - ArrayBuffer: "an ArrayBuffer instance", - Blob: "a Blob instance", - File: "a File instance", - FormData: "a FormData instance", - Headers: "a Headers instance", - Request: "a Request instance", - Response: "a Response instance", - URL: "a URL instance" -}; -var typedArrayDescriptions2 = { - Int8Array: "an Int8Array", - Uint8Array: "a Uint8Array", - Uint8ClampedArray: "a Uint8ClampedArray", - Int16Array: "an Int16Array", - Uint16Array: "a Uint16Array", - Int32Array: "an Int32Array", - Uint32Array: "a Uint32Array", - Float32Array: "a Float32Array", - Float64Array: "a Float64Array", - BigInt64Array: "a BigInt64Array", - BigUint64Array: "a BigUint64Array" -}; -var objectKindDescriptions2 = { - ...ecmascriptDescriptions2, - ...platformDescriptions2, - ...typedArrayDescriptions2 -}; -var getBuiltinNameOfConstructor2 = (ctor) => { - const constructorName = Object(ctor).name ?? null; - return constructorName && isKeyOf2(constructorName, builtinConstructors2) && builtinConstructors2[constructorName] === ctor ? constructorName : null; -}; -var constructorExtends = (ctor, base) => { - let current = ctor.prototype; - while (current !== null) { - if (current === base.prototype) - return true; - current = Object.getPrototypeOf(current); - } - return false; -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/clone.js -var deepClone = (input) => _clone(input, /* @__PURE__ */ new Map()); -var _clone = (input, seen) => { - if (typeof input !== "object" || input === null) - return input; - if (seen?.has(input)) - return seen.get(input); - const builtinConstructorName = getBuiltinNameOfConstructor2(input.constructor); - if (builtinConstructorName === "Date") - return new Date(input.getTime()); - if (builtinConstructorName && builtinConstructorName !== "Array") - return input; - const cloned = Array.isArray(input) ? input.slice() : Object.create(Object.getPrototypeOf(input)); - const propertyDescriptors = Object.getOwnPropertyDescriptors(input); - if (seen) { - seen.set(input, cloned); - for (const k in propertyDescriptors) { - const desc = propertyDescriptors[k]; - if ("get" in desc || "set" in desc) - continue; - desc.value = _clone(desc.value, seen); - } - } - Object.defineProperties(cloned, propertyDescriptors); - return cloned; -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/functions.js -var cached2 = (thunk) => { - let result = unset2; - return () => result === unset2 ? result = thunk() : result; -}; -var isThunk = (value2) => typeof value2 === "function" && value2.length === 0; -var DynamicFunction = class extends Function { - constructor(...args3) { - const params = args3.slice(0, -1); - const body = args3[args3.length - 1]; - try { - super(...params, body); - } catch (e) { - return throwInternalError2(`Encountered an unexpected error while compiling your definition: - Message: ${e} - Source: (${args3.slice(0, -1)}) => { - ${args3[args3.length - 1]} - }`); - } - } -}; -var Callable = class { - constructor(fn2, ...[opts]) { - return Object.assign(Object.setPrototypeOf(fn2.bind(opts?.bind ?? this), this.constructor.prototype), opts?.attach); - } -}; -var envHasCsp2 = cached2(() => { - try { - return new Function("return false")(); - } catch { - return true; - } -}); - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/generics.js -var brand2 = noSuggest2("brand"); -var inferred2 = noSuggest2("arkInferred"); - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/hkt.js -var args2 = noSuggest2("args"); -var Hkt = class { - constructor() { - } -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/isomorphic.js -var fileName2 = () => { - try { - const error41 = new Error(); - const stackLine = error41.stack?.split("\n")[2]?.trim() || ""; - const filePath = stackLine.match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1] || "unknown"; - return filePath.replace(/^file:\/\//, ""); - } catch { - return "unknown"; - } -}; -var env2 = globalThis.process?.env ?? {}; -var isomorphic2 = { - fileName: fileName2, - env: env2 -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/strings.js -var capitalize = (s) => s[0].toUpperCase() + s.slice(1); -var uncapitalize = (s) => s[0].toLowerCase() + s.slice(1); -var anchoredRegex2 = (regex3) => new RegExp(anchoredSource2(regex3), typeof regex3 === "string" ? "" : regex3.flags); -var anchoredSource2 = (regex3) => { - const source = typeof regex3 === "string" ? regex3 : regex3.source; - return `^(?:${source})$`; -}; -var RegexPatterns2 = { - negativeLookahead: (pattern) => `(?!${pattern})`, - nonCapturingGroup: (pattern) => `(?:${pattern})` -}; -var Backslash2 = "\\"; -var whitespaceChars2 = { - " ": 1, - "\n": 1, - " ": 1 -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/numbers.js -var anchoredNegativeZeroPattern2 = /^-0\.?0*$/.source; -var positiveIntegerPattern2 = /[1-9]\d*/.source; -var looseDecimalPattern2 = /\.\d+/.source; -var strictDecimalPattern2 = /\.\d*[1-9]/.source; -var createNumberMatcher2 = (opts) => anchoredRegex2(RegexPatterns2.negativeLookahead(anchoredNegativeZeroPattern2) + RegexPatterns2.nonCapturingGroup("-?" + RegexPatterns2.nonCapturingGroup(RegexPatterns2.nonCapturingGroup("0|" + positiveIntegerPattern2) + RegexPatterns2.nonCapturingGroup(opts.decimalPattern) + "?") + (opts.allowDecimalOnly ? "|" + opts.decimalPattern : "") + "?")); -var wellFormedNumberMatcher2 = createNumberMatcher2({ - decimalPattern: strictDecimalPattern2, - allowDecimalOnly: false -}); -var isWellFormedNumber2 = wellFormedNumberMatcher2.test.bind(wellFormedNumberMatcher2); -var numericStringMatcher2 = createNumberMatcher2({ - decimalPattern: looseDecimalPattern2, - allowDecimalOnly: true -}); -var isNumericString2 = numericStringMatcher2.test.bind(numericStringMatcher2); -var numberLikeMatcher = /^-?\d*\.?\d*$/; -var isNumberLike = (s) => s.length !== 0 && numberLikeMatcher.test(s); -var wellFormedIntegerMatcher2 = anchoredRegex2(RegexPatterns2.negativeLookahead("^-0$") + "-?" + RegexPatterns2.nonCapturingGroup(RegexPatterns2.nonCapturingGroup("0|" + positiveIntegerPattern2))); -var isWellFormedInteger2 = wellFormedIntegerMatcher2.test.bind(wellFormedIntegerMatcher2); -var integerLikeMatcher2 = /^-?\d+$/; -var isIntegerLike2 = integerLikeMatcher2.test.bind(integerLikeMatcher2); -var numericLiteralDescriptions = { - number: "a number", - bigint: "a bigint", - integer: "an integer" -}; -var writeMalformedNumericLiteralMessage = (def, kind) => `'${def}' was parsed as ${numericLiteralDescriptions[kind]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`; -var isWellFormed = (def, kind) => kind === "number" ? isWellFormedNumber2(def) : isWellFormedInteger2(def); -var parseKind = (def, kind) => kind === "number" ? Number(def) : Number.parseInt(def); -var isKindLike = (def, kind) => kind === "number" ? isNumberLike(def) : isIntegerLike2(def); -var tryParseNumber = (token, options) => parseNumeric(token, "number", options); -var tryParseWellFormedNumber = (token, options) => parseNumeric(token, "number", { ...options, strict: true }); -var tryParseInteger = (token, options) => parseNumeric(token, "integer", options); -var parseNumeric = (token, kind, options) => { - const value2 = parseKind(token, kind); - if (!Number.isNaN(value2)) { - if (isKindLike(token, kind)) { - if (options?.strict) { - return isWellFormed(token, kind) ? value2 : throwParseError2(writeMalformedNumericLiteralMessage(token, kind)); - } - return value2; - } - } - return options?.errorOnFail ? throwParseError2(options?.errorOnFail === true ? `Failed to parse ${numericLiteralDescriptions[kind]} from '${token}'` : options?.errorOnFail) : void 0; -}; -var tryParseWellFormedBigint = (def) => { - if (def[def.length - 1] !== "n") - return; - const maybeIntegerLiteral = def.slice(0, -1); - let value2; - try { - value2 = BigInt(maybeIntegerLiteral); - } catch { - return; - } - if (wellFormedIntegerMatcher2.test(maybeIntegerLiteral)) - return value2; - if (integerLikeMatcher2.test(maybeIntegerLiteral)) { - return throwParseError2(writeMalformedNumericLiteralMessage(def, "bigint")); - } -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/registry.js -var arkUtilVersion2 = "0.56.0"; -var initialRegistryContents2 = { - version: arkUtilVersion2, - filename: isomorphic2.fileName(), - FileConstructor: FileConstructor2 -}; -var registry = initialRegistryContents2; -var namesByResolution = /* @__PURE__ */ new Map(); -var nameCounts = /* @__PURE__ */ Object.create(null); -var register2 = (value2) => { - const existingName = namesByResolution.get(value2); - if (existingName) - return existingName; - let name = baseNameFor(value2); - if (nameCounts[name]) - name = `${name}${nameCounts[name]++}`; - else - nameCounts[name] = 1; - registry[name] = value2; - namesByResolution.set(value2, name); - return name; -}; -var isDotAccessible2 = (keyName) => /^[$A-Z_a-z][\w$]*$/.test(keyName); -var baseNameFor = (value2) => { - switch (typeof value2) { - case "object": { - if (value2 === null) - break; - const prefix = objectKindOf2(value2) ?? "object"; - return prefix[0].toLowerCase() + prefix.slice(1); - } - case "function": - return isDotAccessible2(value2.name) ? value2.name : "fn"; - case "symbol": - return value2.description && isDotAccessible2(value2.description) ? value2.description : "symbol"; - } - return throwInternalError2(`Unexpected attempt to register serializable value of type ${domainOf2(value2)}`); -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/primitive.js -var serializePrimitive2 = (value2) => typeof value2 === "string" ? JSON.stringify(value2) : typeof value2 === "bigint" ? `${value2}n` : `${value2}`; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/serialize.js -var snapshot = (data, opts = {}) => _serialize(data, { - onUndefined: `$ark.undefined`, - onBigInt: (n) => `$ark.bigint-${n}`, - ...opts -}, []); -var printable2 = (data, opts) => { - switch (domainOf2(data)) { - case "object": - const o = data; - const ctorName = o.constructor?.name ?? "Object"; - return ctorName === "Object" || ctorName === "Array" ? opts?.quoteKeys === false ? stringifyUnquoted(o, opts?.indent ?? 0, "") : JSON.stringify(_serialize(o, printableOpts, []), null, opts?.indent) : stringifyUnquoted(o, opts?.indent ?? 0, ""); - case "symbol": - return printableOpts.onSymbol(data); - default: - return serializePrimitive2(data); - } -}; -var stringifyUnquoted = (value2, indent2, currentIndent) => { - if (typeof value2 === "function") - return printableOpts.onFunction(value2); - if (typeof value2 !== "object" || value2 === null) - return serializePrimitive2(value2); - const nextIndent = currentIndent + " ".repeat(indent2); - if (Array.isArray(value2)) { - if (value2.length === 0) - return "[]"; - const items = value2.map((item) => stringifyUnquoted(item, indent2, nextIndent)).join(",\n" + nextIndent); - return indent2 ? `[ -${nextIndent}${items} -${currentIndent}]` : `[${items}]`; - } - const ctorName = value2.constructor?.name ?? "Object"; - if (ctorName === "Object") { - const keyValues = stringAndSymbolicEntriesOf2(value2).map(([key, val]) => { - const stringifiedKey = typeof key === "symbol" ? printableOpts.onSymbol(key) : isDotAccessible2(key) ? key : JSON.stringify(key); - const stringifiedValue = stringifyUnquoted(val, indent2, nextIndent); - return `${nextIndent}${stringifiedKey}: ${stringifiedValue}`; - }); - if (keyValues.length === 0) - return "{}"; - return indent2 ? `{ -${keyValues.join(",\n")} -${currentIndent}}` : `{${keyValues.join(", ")}}`; - } - if (value2 instanceof Date) - return describeCollapsibleDate(value2); - if ("expression" in value2 && typeof value2.expression === "string") - return value2.expression; - return ctorName; -}; -var printableOpts = { - onCycle: () => "(cycle)", - onSymbol: (v) => `Symbol(${register2(v)})`, - onFunction: (v) => `Function(${register2(v)})` -}; -var _serialize = (data, opts, seen) => { - switch (domainOf2(data)) { - case "object": { - const o = data; - if ("toJSON" in o && typeof o.toJSON === "function") - return o.toJSON(); - if (typeof o === "function") - return printableOpts.onFunction(o); - if (seen.includes(o)) - return "(cycle)"; - const nextSeen = [...seen, o]; - if (Array.isArray(o)) - return o.map((item) => _serialize(item, opts, nextSeen)); - if (o instanceof Date) - return o.toDateString(); - const result = {}; - for (const k in o) - result[k] = _serialize(o[k], opts, nextSeen); - for (const s of Object.getOwnPropertySymbols(o)) { - result[opts.onSymbol?.(s) ?? s.toString()] = _serialize(o[s], opts, nextSeen); - } - return result; - } - case "symbol": - return printableOpts.onSymbol(data); - case "bigint": - return opts.onBigInt?.(data) ?? `${data}n`; - case "undefined": - return opts.onUndefined ?? "undefined"; - case "string": - return data.replace(/\\/g, "\\\\"); - default: - return data; - } -}; -var describeCollapsibleDate = (date2) => { - const year = date2.getFullYear(); - const month = date2.getMonth(); - const dayOfMonth = date2.getDate(); - const hours = date2.getHours(); - const minutes = date2.getMinutes(); - const seconds = date2.getSeconds(); - const milliseconds = date2.getMilliseconds(); - if (month === 0 && dayOfMonth === 1 && hours === 0 && minutes === 0 && seconds === 0 && milliseconds === 0) - return `${year}`; - const datePortion = `${months[month]} ${dayOfMonth}, ${year}`; - if (hours === 0 && minutes === 0 && seconds === 0 && milliseconds === 0) - return datePortion; - let timePortion = date2.toLocaleTimeString(); - const suffix2 = timePortion.endsWith(" AM") || timePortion.endsWith(" PM") ? timePortion.slice(-3) : ""; - if (suffix2) - timePortion = timePortion.slice(0, -suffix2.length); - if (milliseconds) - timePortion += `.${pad(milliseconds, 3)}`; - else if (timeWithUnnecessarySeconds.test(timePortion)) - timePortion = timePortion.slice(0, -3); - return `${timePortion + suffix2}, ${datePortion}`; -}; -var months = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December" -]; -var timeWithUnnecessarySeconds = /:\d\d:00$/; -var pad = (value2, length) => String(value2).padStart(length, "0"); - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/path.js -var appendStringifiedKey = (path3, prop, ...[opts]) => { - const stringifySymbol = opts?.stringifySymbol ?? printable2; - let propAccessChain = path3; - switch (typeof prop) { - case "string": - propAccessChain = isDotAccessible2(prop) ? path3 === "" ? prop : `${path3}.${prop}` : `${path3}[${JSON.stringify(prop)}]`; - break; - case "number": - propAccessChain = `${path3}[${prop}]`; - break; - case "symbol": - propAccessChain = `${path3}[${stringifySymbol(prop)}]`; - break; - default: - if (opts?.stringifyNonKey) - propAccessChain = `${path3}[${opts.stringifyNonKey(prop)}]`; - else { - throwParseError2(`${printable2(prop)} must be a PropertyKey or stringifyNonKey must be passed to options`); - } - } - return propAccessChain; -}; -var stringifyPath = (path3, ...opts) => path3.reduce((s, k) => appendStringifiedKey(s, k, ...opts), ""); -var ReadonlyPath = class extends ReadonlyArray2 { - // alternate strategy for caching since the base object is frozen - cache = {}; - constructor(...items) { - super(); - this.push(...items); - } - toJSON() { - if (this.cache.json) - return this.cache.json; - this.cache.json = []; - for (let i = 0; i < this.length; i++) { - this.cache.json.push(typeof this[i] === "symbol" ? printable2(this[i]) : this[i]); - } - return this.cache.json; - } - stringify() { - if (this.cache.stringify) - return this.cache.stringify; - return this.cache.stringify = stringifyPath(this); - } - stringifyAncestors() { - if (this.cache.stringifyAncestors) - return this.cache.stringifyAncestors; - let propString = ""; - const result = [propString]; - for (const path3 of this) { - propString = appendStringifiedKey(propString, path3); - result.push(propString); - } - return this.cache.stringifyAncestors = result; - } -}; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/scanner.js -var Scanner = class { - chars; - i; - def; - constructor(def) { - this.def = def; - this.chars = [...def]; - this.i = 0; - } - /** Get lookahead and advance scanner by one */ - shift() { - return this.chars[this.i++] ?? ""; - } - get lookahead() { - return this.chars[this.i] ?? ""; - } - get nextLookahead() { - return this.chars[this.i + 1] ?? ""; - } - get length() { - return this.chars.length; - } - shiftUntil(condition) { - let shifted = ""; - while (this.lookahead) { - if (condition(this, shifted)) - break; - else - shifted += this.shift(); - } - return shifted; - } - shiftUntilEscapable(condition) { - let shifted = ""; - while (this.lookahead) { - if (this.lookahead === Backslash2) { - this.shift(); - if (condition(this, shifted)) - shifted += this.shift(); - else if (this.lookahead === Backslash2) - shifted += this.shift(); - else - shifted += `${Backslash2}${this.shift()}`; - } else if (condition(this, shifted)) - break; - else - shifted += this.shift(); - } - return shifted; - } - shiftUntilLookahead(charOrSet) { - return typeof charOrSet === "string" ? this.shiftUntil((s) => s.lookahead === charOrSet) : this.shiftUntil((s) => s.lookahead in charOrSet); - } - shiftUntilNonWhitespace() { - return this.shiftUntil(() => !(this.lookahead in whitespaceChars2)); - } - jumpToIndex(i) { - this.i = i < 0 ? this.length + i : i; - } - jumpForward(count) { - this.i += count; - } - get location() { - return this.i; - } - get unscanned() { - return this.chars.slice(this.i, this.length).join(""); - } - get scanned() { - return this.chars.slice(0, this.i).join(""); - } - sliceChars(start, end) { - return this.chars.slice(start, end).join(""); - } - lookaheadIs(char) { - return this.lookahead === char; - } - lookaheadIsIn(tokens) { - return this.lookahead in tokens; - } -}; -var writeUnmatchedGroupCloseMessage = (char, unscanned) => `Unmatched ${char}${unscanned === "" ? "" : ` before ${unscanned}`}`; -var writeUnclosedGroupMessage = (missingChar) => `Missing ${missingChar}`; - -// node_modules/.pnpm/@ark+util@0.56.0/node_modules/@ark/util/out/traits.js -var implementedTraits2 = noSuggest2("implementedTraits"); - -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/registry.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/registry.js var _registryName = "$ark"; var suffix = 2; while (_registryName in globalThis) @@ -84827,16 +84581,16 @@ var registryName = _registryName; globalThis[registryName] = registry; var $ark = registry; var reference = (name) => `${registryName}.${name}`; -var registeredReference = (value2) => reference(register2(value2)); +var registeredReference = (value2) => reference(register(value2)); -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/compile.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/compile.js var CompiledFunction = class extends CastableBase { argNames; body = ""; - constructor(...args3) { + constructor(...args2) { super(); - this.argNames = args3; - for (const arg of args3) { + this.argNames = args2; + for (const arg of args2) { if (arg in this) { throw new Error(`Arg name '${arg}' would overwrite an existing property on FunctionBody`); } @@ -84909,9 +84663,9 @@ var CompiledFunction = class extends CastableBase { return new DynamicFunction(...this.argNames, this.body); } }; -var compileSerializedValue = (value2) => hasDomain2(value2, "object") || typeof value2 === "symbol" ? registeredReference(value2) : serializePrimitive2(value2); +var compileSerializedValue = (value2) => hasDomain(value2, "object") || typeof value2 === "symbol" ? registeredReference(value2) : serializePrimitive(value2); var compileLiteralPropAccess = (key, optional = false) => { - if (typeof key === "string" && isDotAccessible2(key)) + if (typeof key === "string" && isDotAccessible(key)) return `${optional ? "?" : ""}.${key}`; return indexPropAccess(serializeLiteralKey(key), optional); }; @@ -84966,17 +84720,17 @@ var NodeCompiler = class extends CompiledFunction { } }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/utils.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/utils.js var makeRootAndArrayPropertiesMutable = (o) => ( // this cast should not be required, but it seems TS is referencing // the wrong parameters here? - flatMorph2(o, (k, v) => [k, isArray(v) ? [...v] : v]) + flatMorph(o, (k, v) => [k, isArray(v) ? [...v] : v]) ); -var arkKind = noSuggest2("arkKind"); +var arkKind = noSuggest("arkKind"); var hasArkKind = (value2, kind) => value2?.[arkKind] === kind; var isNode = (value2) => hasArkKind(value2, "root") || hasArkKind(value2, "constraint"); -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/implement.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/implement.js var basisKinds = ["unit", "proto", "domain"]; var structuralKinds = [ "required", @@ -85011,9 +84765,9 @@ var rootKinds = [ "domain" ]; var nodeKinds = [...rootKinds, ...constraintKinds]; -var constraintKeys = flatMorph2(constraintKinds, (i, kind) => [kind, 1]); -var structureKeys = flatMorph2([...structuralKinds, "undeclared"], (i, k) => [k, 1]); -var precedenceByKind = flatMorph2(nodeKinds, (i, kind) => [kind, i]); +var constraintKeys = flatMorph(constraintKinds, (i, kind) => [kind, 1]); +var structureKeys = flatMorph([...structuralKinds, "undeclared"], (i, k) => [k, 1]); +var precedenceByKind = flatMorph(nodeKinds, (i, kind) => [kind, i]); var isNodeKind = (value2) => typeof value2 === "string" && value2 in precedenceByKind; var precedenceOfKind = (kind) => precedenceByKind[kind]; var schemaKindsRightOf = (kind) => rootKinds.slice(precedenceOfKind(kind) + 1); @@ -85049,7 +84803,7 @@ var implementNode = (_) => { const implementation23 = _; if (implementation23.hasAssociatedError) { implementation23.defaults.expected ??= (ctx) => "description" in ctx ? ctx.description : implementation23.defaults.description(ctx); - implementation23.defaults.actual ??= (data) => printable2(data); + implementation23.defaults.actual ??= (data) => printable(data); implementation23.defaults.problem ??= (ctx) => `must be ${ctx.expected}${ctx.actual ? ` (was ${ctx.actual})` : ""}`; implementation23.defaults.message ??= (ctx) => { if (ctx.path.length === 0) @@ -85064,13 +84818,13 @@ var implementNode = (_) => { return implementation23; }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/toJsonSchema.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/toJsonSchema.js var ToJsonSchemaError = class extends Error { name = "ToJsonSchemaError"; code; context; constructor(code, context) { - super(printable2(context, { quoteKeys: false, indent: 4 })); + super(printable(context, { quoteKeys: false, indent: 4 })); this.code = code; this.context = context; } @@ -85079,7 +84833,6 @@ var ToJsonSchemaError = class extends Error { } }; var defaultConfig = { - target: "draft-2020-12", dialect: "https://json-schema.org/draft/2020-12/schema", useRefs: false, fallback: { @@ -85098,14 +84851,14 @@ var defaultConfig = { }; var ToJsonSchema = { Error: ToJsonSchemaError, - throw: (...args3) => { - throw new ToJsonSchema.Error(...args3); + throw: (...args2) => { + throw new ToJsonSchema.Error(...args2); }, - throwInternalOperandError: (kind, schema2) => throwInternalError2(`Unexpected JSON Schema input for ${kind}: ${printable2(schema2)}`), + throwInternalOperandError: (kind, schema2) => throwInternalError(`Unexpected JSON Schema input for ${kind}: ${printable(schema2)}`), defaultConfig }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/config.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/config.js $ark.config ??= {}; var configureSchema = (config2) => { const result = Object.assign($ark.config, mergeConfigs($ark.config, config2)); @@ -85142,13 +84895,9 @@ var mergeConfigs = (base, merged) => { } return result; }; -var jsonSchemaTargetToDialect = { - "draft-2020-12": "https://json-schema.org/draft/2020-12/schema", - "draft-07": "http://json-schema.org/draft-07/schema#" -}; var mergeToJsonSchemaConfigs = ((baseConfig, mergedConfig) => { if (!baseConfig) - return resolveTargetToDialect(mergedConfig ?? {}, void 0); + return mergedConfig ?? {}; if (!mergedConfig) return baseConfig; const result = { ...baseConfig }; @@ -85159,19 +84908,8 @@ var mergeToJsonSchemaConfigs = ((baseConfig, mergedConfig) => { } else result[k] = mergedConfig[k]; } - return resolveTargetToDialect(result, mergedConfig); + return result; }); -var resolveTargetToDialect = (opts, userOpts) => { - if (userOpts?.dialect !== void 0) - return opts; - if (userOpts?.target !== void 0) { - return { - ...opts, - dialect: jsonSchemaTargetToDialect[userOpts.target] - }; - } - return opts; -}; var mergeFallbacks = (base, merged) => { base = normalizeFallback(base); merged = normalizeFallback(merged); @@ -85184,7 +84922,7 @@ var mergeFallbacks = (base, merged) => { }; var normalizeFallback = (fallback) => typeof fallback === "function" ? { default: fallback } : fallback ?? {}; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/errors.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/errors.js var ArkError = class _ArkError extends CastableBase { [arkKind] = "error"; path; @@ -85277,7 +85015,7 @@ var ArkError = class _ArkError extends CastableBase { throw this; } }; -var ArkErrors = class _ArkErrors extends ReadonlyArray2 { +var ArkErrors = class _ArkErrors extends ReadonlyArray { [arkKind] = "errors"; ctx; constructor(ctx) { @@ -85295,13 +85033,13 @@ var ArkErrors = class _ArkErrors extends ReadonlyArray2 { * they will never be directly present in this representation. */ get flatByPath() { - return flatMorph2(this.byPath, (k, v) => [k, v.flat]); + return flatMorph(this.byPath, (k, v) => [k, v.flat]); } /** * {@link byPath} flattened so that each value is an array of problem strings at that path. */ get flatProblemsByPath() { - return flatMorph2(this.byPath, (k, v) => [k, v.flat.map((e) => e.problem)]); + return flatMorph(this.byPath, (k, v) => [k, v.flat.map((e) => e.problem)]); } /** * All pathStrings at which errors are present mapped to the errors occuring @@ -85397,7 +85135,7 @@ var ArkErrors = class _ArkErrors extends ReadonlyArray2 { } addAncestorPaths(error41) { for (const propString of error41.path.stringifyAncestors()) { - this.byAncestorPath[propString] = append2(this.byAncestorPath[propString], error41); + this.byAncestorPath[propString] = append(this.byAncestorPath[propString], error41); } } }; @@ -85416,7 +85154,7 @@ var TraversalError = class extends Error { }; var indent = (error41) => error41.toString().split("\n").join("\n "); -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/traversal.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/traversal.js var Traversal = class { /** * #### the path being validated or morphed @@ -85500,7 +85238,7 @@ var Traversal = class { return this.currentErrorCount !== 0; } get currentBranch() { - return this.branches[this.branches.length - 1]; + return this.branches.at(-1); } queueMorphs(morphs) { const input = { @@ -85569,7 +85307,7 @@ var Traversal = class { } } applyMorphsAtPath(path3, morphs) { - const key = path3[path3.length - 1]; + const key = path3.at(-1); let parent; if (key !== void 0) { parent = this.root; @@ -85581,8 +85319,7 @@ var Traversal = class { const morphIsNode = isNode(morph); const result = morph(parent === void 0 ? this.root : parent[key], this); if (result instanceof ArkError) { - if (!this.errors.includes(result)) - this.errors.add(result); + this.errors.add(result); break; } if (result instanceof ArkErrors) { @@ -85609,7 +85346,7 @@ var traverseKey = (key, fn2, ctx) => { return result; }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/node.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/node.js var BaseNode = class extends Callable { attachments; $; @@ -85712,7 +85449,7 @@ var BaseNode = class extends Callable { return this.createBranchedOptimisticRootApply(); default: this.rootApplyStrategy; - return throwInternalError2(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`); + return throwInternalError(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`); } } compiledMeta = compileMeta(this.metaJson); @@ -85869,7 +85606,7 @@ var BaseNode = class extends Callable { undeclaredKeyHandling: this.undeclared }; } - const innerWithTransformedChildren = flatMorph2(this.inner, (k, v) => { + const innerWithTransformedChildren = flatMorph(this.inner, (k, v) => { if (!this.impl.keys[k].child) return [k, v]; const children = v; @@ -85897,7 +85634,7 @@ var BaseNode = class extends Callable { const transformedKeys = Object.keys(transformedInner); const hasNoTypedKeys = transformedKeys.length === 0 || transformedKeys.length === 1 && transformedKeys[0] === "meta"; if (hasNoTypedKeys && // if inner was previously an empty object (e.g. unknown) ensure it is not pruned - !isEmptyObject2(this.inner)) + !isEmptyObject(this.inner)) return null; if ((this.kind === "required" || this.kind === "optional" || this.kind === "index") && !("value" in transformedInner)) { return ctx.undeclaredKeyHandling ? { ...transformedInner, value: $ark.intrinsic.unknown } : null; @@ -85950,14 +85687,14 @@ var NodeSelector = { return nodes[0]; } }, - normalize: (selector) => typeof selector === "function" ? { boundary: "references", method: "filter", where: selector } : typeof selector === "string" ? isKeyOf2(selector, NodeSelector.applyBoundary) ? { method: "filter", boundary: selector } : { boundary: "references", method: "filter", kind: selector } : { boundary: "references", method: "filter", ...selector } + normalize: (selector) => typeof selector === "function" ? { boundary: "references", method: "filter", where: selector } : typeof selector === "string" ? isKeyOf(selector, NodeSelector.applyBoundary) ? { method: "filter", boundary: selector } : { boundary: "references", method: "filter", kind: selector } : { boundary: "references", method: "filter", ...selector } }; -var writeSelectAssertionMessage = (from, selector) => `${from} had no references matching ${printable2(selector)}.`; +var writeSelectAssertionMessage = (from, selector) => `${from} had no references matching ${printable(selector)}.`; var typePathToPropString = (path3) => stringifyPath(path3, { stringifyNonKey: (node2) => node2.expression }); var referenceMatcher = /"(\$ark\.[^"]+)"/g; -var compileMeta = (metaJson) => JSON.stringify(metaJson).replace(referenceMatcher, "$1"); +var compileMeta = (metaJson) => JSON.stringify(metaJson).replaceAll(referenceMatcher, "$1"); var flatRef = (path3, node2) => ({ path: path3, node: node2, @@ -85971,7 +85708,7 @@ var appendUniqueNodes = (existing, refs) => appendUnique(existing, refs, { isEqual: (l, r) => l.equals(r) }); -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/disjoint.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/disjoint.js var Disjoint = class _Disjoint extends Array { static init(kind, l, r, ctx) { return new _Disjoint({ @@ -86005,7 +85742,7 @@ var Disjoint = class _Disjoint extends Array { \u2022 ${this.map(({ path: path3, l, r }) => `${path3}: ${describeReasons(l, r)}`).join("\n\u2022 ")}`; } throw() { - return throwParseError2(this.describeReasons()); + return throwParseError(this.describeReasons()); } invert() { const result = this.map((entry) => ({ @@ -86032,7 +85769,7 @@ var describeReasons = (l, r) => `${describeReason(l)} and ${describeReason(r)}`; var describeReason = (value2) => isNode(value2) ? value2.expression : isArray(value2) ? value2.map(describeReason).join(" | ") || "never" : String(value2); var writeUnsatisfiableExpressionError = (expression) => `${expression} results in an unsatisfiable type`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/shared/intersections.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/intersections.js var intersectionCache = {}; var intersectNodesRoot = (l, r, $2) => intersectOrPipeNodes(l, r, { $: $2, @@ -86143,7 +85880,7 @@ var _pipeMorphed = (from, to, ctx) => { }); }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/constraint.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/constraint.js var BaseConstraint = class extends BaseNode { constructor(attachments, $2) { super(attachments, $2); @@ -86221,7 +85958,7 @@ var intersectConstraints = (s) => { s.l[i] = result; matched = true; } else if (!s.l.includes(result)) { - return throwInternalError2(`Unexpectedly encountered multiple distinct intersection results for refinement ${head}`); + return throwInternalError(`Unexpectedly encountered multiple distinct intersection results for refinement ${head}`); } } if (!matched) @@ -86241,23 +85978,23 @@ var unflattenConstraints = (constraints) => { const inner = {}; for (const constraint of constraints) { if (constraint.hasOpenIntersection()) { - inner[constraint.kind] = append2(inner[constraint.kind], constraint); + inner[constraint.kind] = append(inner[constraint.kind], constraint); } else { if (inner[constraint.kind]) { - return throwInternalError2(`Unexpected intersection of closed refinements of kind ${constraint.kind}`); + return throwInternalError(`Unexpected intersection of closed refinements of kind ${constraint.kind}`); } inner[constraint.kind] = constraint; } } return inner; }; -var throwInvalidOperandError = (...args3) => throwParseError2(writeInvalidOperandMessage(...args3)); +var throwInvalidOperandError = (...args2) => throwParseError(writeInvalidOperandMessage(...args2)); var writeInvalidOperandMessage = (kind, expected, actual) => { const actualDescription = actual.hasKind("morph") ? "a morph" : actual.isUnknown() ? "unknown" : actual.exclude(expected).defaultShortDescription; return `${capitalize(kind)} operand must be ${expected.description} (was ${actualDescription})`; }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/generic.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/generic.js var parseGeneric = (paramDefs, bodyDef, $2) => new GenericRoot(paramDefs, bodyDef, $2, $2, null); var LazyGenericBody = class extends Callable { }; @@ -86271,11 +86008,11 @@ var GenericRoot = class extends Callable { hkt; description; constructor(paramDefs, bodyDef, $2, arg$, hkt) { - super((...args3) => { - const argNodes = flatMorph2(this.names, (i, name) => { - const arg = this.arg$.parse(args3[i]); + super((...args2) => { + const argNodes = flatMorph(this.names, (i, name) => { + const arg = this.arg$.parse(args2[i]); if (!arg.extends(this.constraints[i])) { - throwParseError2(writeUnsatisfiedParameterConstraintMessage(name, this.constraints[i].expression, arg.expression)); + throwParseError(writeUnsatisfiedParameterConstraintMessage(name, this.constraints[i].expression, arg.expression)); } return [name, arg]; }); @@ -86327,7 +86064,7 @@ var GenericRoot = class extends Callable { }; var writeUnsatisfiedParameterConstraintMessage = (name, constraint, arg) => `${name} must be assignable to ${constraint} (was ${arg})`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/predicate.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/predicate.js var implementation = implementNode({ kind: "predicate", hasAssociatedError: true, @@ -86361,8 +86098,7 @@ var PredicateNode = class extends BaseConstraint { }; compiledErrorContext = compileObjectLiteral(this.errorContext); traverseApply = (data, ctx) => { - const errorCount = ctx.currentErrorCount; - if (!this.predicate(data, ctx.external) && ctx.currentErrorCount === errorCount) + if (!this.predicate(data, ctx.external) && !ctx.hasError()) ctx.errorFromNodeContext(this.errorContext); }; compile(js) { @@ -86370,12 +86106,7 @@ var PredicateNode = class extends BaseConstraint { js.return(this.compiledCondition); return; } - js.initializeErrorCount(); - js.if( - // only add the default error if the predicate didn't add one itself - `${this.compiledNegation} && ctx.currentErrorCount === errorCount`, - () => js.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`) - ); + js.if(`${this.compiledNegation} && !ctx.hasError()`, () => js.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`)); } reduceJsonSchema(base, ctx) { return ctx.fallback.predicate({ @@ -86390,13 +86121,13 @@ var Predicate = { Node: PredicateNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/divisor.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/divisor.js var implementation2 = implementNode({ kind: "divisor", collapsibleKey: "rule", keys: { rule: { - parse: (divisor) => Number.isInteger(divisor) ? divisor : throwParseError2(writeNonIntegerDivisorMessage(divisor)) + parse: (divisor) => Number.isInteger(divisor) ? divisor : throwParseError(writeNonIntegerDivisorMessage(divisor)) } }, normalize: (schema2) => typeof schema2 === "number" ? { rule: schema2 } : schema2, @@ -86442,7 +86173,7 @@ var greatestCommonDivisor = (l, r) => { return greatestCommonDivisor2; }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/range.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/range.js var BaseRange = class extends InternalPrimitiveConstraint { boundOperandKind = operandKindsByBoundKind[this.kind]; compiledActual = this.boundOperandKind === "value" ? `data` : this.boundOperandKind === "length" ? `data.length` : `data.valueOf()`; @@ -86510,7 +86241,7 @@ var parseDateLimit = (limit) => typeof limit === "string" || typeof limit === "n var writeInvalidLengthBoundMessage = (kind, limit) => `${kind} bound must be a positive integer (was ${limit})`; var createLengthRuleParser = (kind) => (limit) => { if (!Number.isInteger(limit) || limit < 0) - throwParseError2(writeInvalidLengthBoundMessage(kind, limit)); + throwParseError(writeInvalidLengthBoundMessage(kind, limit)); return limit; }; var operandKindsByBoundKind = { @@ -86521,11 +86252,11 @@ var operandKindsByBoundKind = { after: "date", before: "date" }; -var compileComparator = (kind, exclusive) => `${isKeyOf2(kind, boundKindPairsByLower) ? ">" : "<"}${exclusive ? "" : "="}`; +var compileComparator = (kind, exclusive) => `${isKeyOf(kind, boundKindPairsByLower) ? ">" : "<"}${exclusive ? "" : "="}`; var dateLimitToString = (limit) => typeof limit === "string" ? limit : new Date(limit).toLocaleString(); var writeUnboundableMessage = (root2) => `Bounded expression ${root2} must be exactly one of number, string, Array, or Date`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/after.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/after.js var implementation3 = implementNode({ kind: "after", collapsibleKey: "rule", @@ -86558,7 +86289,7 @@ var After = { Node: AfterNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/before.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/before.js var implementation4 = implementNode({ kind: "before", collapsibleKey: "rule", @@ -86592,7 +86323,7 @@ var Before = { Node: BeforeNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/exactLength.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/exactLength.js var implementation5 = implementNode({ kind: "exactLength", collapsibleKey: "rule", @@ -86639,7 +86370,7 @@ var ExactLength = { Node: ExactLengthNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/max.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/max.js var implementation6 = implementNode({ kind: "max", collapsibleKey: "rule", @@ -86678,7 +86409,7 @@ var Max = { Node: MaxNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/maxLength.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/maxLength.js var implementation7 = implementNode({ kind: "maxLength", collapsibleKey: "rule", @@ -86720,7 +86451,7 @@ var MaxLength = { Node: MaxLengthNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/min.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/min.js var implementation8 = implementNode({ kind: "min", collapsibleKey: "rule", @@ -86758,7 +86489,7 @@ var Min = { Node: MinNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/minLength.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/minLength.js var implementation9 = implementNode({ kind: "minLength", collapsibleKey: "rule", @@ -86803,7 +86534,7 @@ var MinLength = { Node: MinLengthNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/kinds.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/kinds.js var boundImplementationsByKind = { min: Min.implementation, max: Max.implementation, @@ -86823,7 +86554,7 @@ var boundClassesByKind = { before: Before.Node }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/refinements/pattern.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/refinements/pattern.js var implementation10 = implementNode({ kind: "pattern", collapsibleKey: "rule", @@ -86869,11 +86600,11 @@ var Pattern = { Node: PatternNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/parse.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/parse.js var schemaKindOf = (schema2, allowedKinds) => { const kind = discriminateRootKind(schema2); if (allowedKinds && !allowedKinds.includes(kind)) { - return throwParseError2(`Root of kind ${kind} should be one of ${allowedKinds}`); + return throwParseError(`Root of kind ${kind} should be one of ${allowedKinds}`); } return kind; }; @@ -86881,12 +86612,12 @@ var discriminateRootKind = (schema2) => { if (hasArkKind(schema2, "root")) return schema2.kind; if (typeof schema2 === "string") { - return schema2[0] === "$" ? "alias" : schema2 in domainDescriptions2 ? "domain" : "proto"; + return schema2[0] === "$" ? "alias" : schema2 in domainDescriptions ? "domain" : "proto"; } if (typeof schema2 === "function") return "proto"; if (typeof schema2 !== "object" || schema2 === null) - return throwParseError2(writeInvalidSchemaMessage(schema2)); + return throwParseError(writeInvalidSchemaMessage(schema2)); if ("morphs" in schema2) return "morph"; if ("branches" in schema2 || isArray(schema2)) @@ -86902,9 +86633,9 @@ var discriminateRootKind = (schema2) => { return "proto"; if ("domain" in schema2) return "domain"; - return throwParseError2(writeInvalidSchemaMessage(schema2)); + return throwParseError(writeInvalidSchemaMessage(schema2)); }; -var writeInvalidSchemaMessage = (schema2) => `${printable2(schema2)} is not a valid type schema`; +var writeInvalidSchemaMessage = (schema2) => `${printable(schema2)} is not a valid type schema`; var nodeCountsByPrefix = {}; var serializeListableChild = (listableNode) => isArray(listableNode) ? listableNode.map((node2) => node2.collapsibleJson) : listableNode.collapsibleJson; var nodesByRegisteredId = {}; @@ -86931,9 +86662,9 @@ var parseNode = (ctx) => { const k = entry[0]; const keyImpl = impl.keys[k]; if (!keyImpl) - return throwParseError2(`Key ${k} is not valid on ${ctx.kind} schema`); + return throwParseError(`Key ${k} is not valid on ${ctx.kind} schema`); const v = keyImpl.parse ? keyImpl.parse(entry[1], ctx) : entry[1]; - if (v !== unset2 && (v !== void 0 || keyImpl.preserveUndefined)) + if (v !== unset && (v !== void 0 || keyImpl.preserveUndefined)) inner[k] = v; } if (impl.reduce && !ctx.prereduced) { @@ -86975,8 +86706,8 @@ var createNode = ({ id, kind, inner, meta, $: $2, ignoreCache }) => { innerJson = impl.finalizeInnerJson(innerJson); let json3 = { ...innerJson }; let metaJson = {}; - if (!isEmptyObject2(meta)) { - metaJson = flatMorph2(meta, (k, v) => [ + if (!isEmptyObject(meta)) { + metaJson = flatMorph(meta, (k, v) => [ k, k === "examples" ? v : defaultValueSerializer(v) ]); @@ -87016,7 +86747,7 @@ var withId = (node2, id) => { if (node2.id === id) return node2; if (isNode(nodesByRegisteredId[id])) - throwInternalError2(`Unexpected attempt to overwrite node id ${id}`); + throwInternalError(`Unexpected attempt to overwrite node id ${id}`); return createNode({ id, kind: node2.kind, @@ -87028,7 +86759,7 @@ var withId = (node2, id) => { }; var withMeta = (node2, meta, id) => { if (id && isNode(nodesByRegisteredId[id])) - throwInternalError2(`Unexpected attempt to overwrite node id ${id}`); + throwInternalError(`Unexpected attempt to overwrite node id ${id}`); return createNode({ id: id ?? registerNodeId(meta.alias ?? node2.kind), kind: node2.kind, @@ -87045,7 +86776,7 @@ var possiblyCollapse = (json3, toKey, allowPrimitive) => { return collapsed; if ( // if the collapsed value is still an object - hasDomain2(collapsed, "object") && // and the JSON did not include any implied keys + hasDomain(collapsed, "object") && // and the JSON did not include any implied keys (Object.keys(collapsed).length === 1 || Array.isArray(collapsed)) ) { return collapsed; @@ -87054,7 +86785,7 @@ var possiblyCollapse = (json3, toKey, allowPrimitive) => { return json3; }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/structure/prop.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/structure/prop.js var intersectProps = (l, r, ctx) => { if (l.key !== r.key) return null; @@ -87074,7 +86805,7 @@ var intersectProps = (l, r, ctx) => { value: value2 }); } - const defaultIntersection = l.hasDefault() ? r.hasDefault() ? l.default === r.default ? l.default : throwParseError2(writeDefaultIntersectionMessage(l.default, r.default)) : l.default : r.hasDefault() ? r.default : unset2; + const defaultIntersection = l.hasDefault() ? r.hasDefault() ? l.default === r.default ? l.default : throwParseError(writeDefaultIntersectionMessage(l.default, r.default)) : l.default : r.hasDefault() ? r.default : unset; return ctx.$.node("optional", { key, value: value2, @@ -87088,7 +86819,7 @@ var BaseProp = class extends BaseConstraint { impliedBasis = $ark.intrinsic.object.internal; serializedKey = compileSerializedValue(this.key); compiledKey = typeof this.key === "string" ? this.key : this.serializedKey; - flatRefs = append2(this.value.flatRefs.map((ref) => flatRef([this.key, ...ref.path], ref.node)), flatRef([this.key], this.value)); + flatRefs = append(this.value.flatRefs.map((ref) => flatRef([this.key, ...ref.path], ref.node)), flatRef([this.key], this.value)); _transform(mapper, ctx) { ctx.path.push(this.key); const result = super._transform(mapper, ctx); @@ -87119,9 +86850,9 @@ var BaseProp = class extends BaseConstraint { js.return(true); } }; -var writeDefaultIntersectionMessage = (lValue, rValue) => `Invalid intersection of default values ${printable2(lValue)} & ${printable2(rValue)}`; +var writeDefaultIntersectionMessage = (lValue, rValue) => `Invalid intersection of default values ${printable(lValue)} & ${printable(rValue)}`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/structure/optional.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/structure/optional.js var implementation11 = implementNode({ kind: "optional", hasAssociatedError: false, @@ -87152,8 +86883,8 @@ var implementation11 = implementNode({ } }); var OptionalNode = class extends BaseProp { - constructor(...args3) { - super(...args3); + constructor(...args2) { + super(...args2); if ("default" in this.inner) assertDefaultValueAssignability(this.value, this.inner.default, this.key); } @@ -87171,7 +86902,7 @@ var OptionalNode = class extends BaseProp { const { default: defaultValue, ...requiredInner } = this.inner; return this.cacheGetter("outProp", this.$.node("required", requiredInner, { prereduced: true })); } - expression = this.hasDefault() ? `${this.compiledKey}: ${this.value.expression} = ${printable2(this.inner.default)}` : `${this.compiledKey}?: ${this.value.expression}`; + expression = this.hasDefault() ? `${this.compiledKey}: ${this.value.expression} = ${printable(this.inner.default)}` : `${this.compiledKey}?: ${this.value.expression}`; defaultValueMorph = getDefaultableMorph(this); defaultValueMorphRef = this.defaultValueMorph && registeredReference(this.defaultValueMorph); }; @@ -87197,7 +86928,7 @@ var computeDefaultValueMorph = (key, value2, defaultInput) => { }; } const precomputedMorphedDefault = value2.includesTransform ? value2.assert(defaultInput) : defaultInput; - return hasDomain2(precomputedMorphedDefault, "object") ? ( + return hasDomain(precomputedMorphedDefault, "object") ? ( // the type signature only allows this if the value was morphed (data, ctx) => { traverseKey(key, () => value2(data[key] = defaultInput, ctx), ctx); @@ -87210,15 +86941,15 @@ var computeDefaultValueMorph = (key, value2, defaultInput) => { }; var assertDefaultValueAssignability = (node2, value2, key) => { const wrapped = isThunk(value2); - if (hasDomain2(value2, "object") && !wrapped) - throwParseError2(writeNonPrimitiveNonFunctionDefaultValueMessage(key)); + if (hasDomain(value2, "object") && !wrapped) + throwParseError(writeNonPrimitiveNonFunctionDefaultValueMessage(key)); const out = node2.in(wrapped ? value2() : value2); if (out instanceof ArkErrors) { if (key === null) { - throwParseError2(`Default ${out.summary}`); + throwParseError(`Default ${out.summary}`); } const atPath = out.transform((e) => e.transform((input) => ({ ...input, prefixPath: [key] }))); - throwParseError2(`Default for ${atPath.summary}`); + throwParseError(`Default for ${atPath.summary}`); } return value2; }; @@ -87227,7 +86958,7 @@ var writeNonPrimitiveNonFunctionDefaultValueMessage = (key) => { return `Non-primitive default ${keyDescription}must be specified as a function like () => ({my: 'object'})`; }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/root.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/root.js var BaseRoot = class extends BaseNode { constructor(attachments, $2) { super(attachments, $2); @@ -87254,15 +86985,13 @@ var BaseRoot = class extends BaseNode { return out; return { value: out }; }, - jsonSchema: { - input: (opts) => this.rawIn.toJsonSchema({ - target: validateStandardJsonSchemaTarget(opts.target), - ...opts.libraryOptions - }), - output: (opts) => this.rawOut.toJsonSchema({ - target: validateStandardJsonSchemaTarget(opts.target), - ...opts.libraryOptions - }) + toJSONSchema: (opts) => { + if (opts.target && opts.target !== "draft-2020-12") { + return throwParseError(`JSONSchema target '${opts.target}' is not supported (must be "draft-2020-12")`); + } + if (opts.io === "input") + return this.rawIn.toJsonSchema(); + return this.rawOut.toJsonSchema(); } }; } @@ -87271,7 +87000,7 @@ var BaseRoot = class extends BaseNode { } brand(name) { if (name === "") - return throwParseError2(emptyBrandNameMessage); + return throwParseError(emptyBrandNameMessage); return this; } readonly() { @@ -87291,19 +87020,13 @@ var BaseRoot = class extends BaseNode { const schema2 = typeof ctx.dialect === "string" ? { $schema: ctx.dialect } : {}; Object.assign(schema2, this.toJsonSchemaRecurse(ctx)); if (ctx.useRefs) { - const defs = flatMorph2(this.references, (i, ref) => ref.isRoot() && !ref.alwaysExpandJsonSchema ? [ref.id, ref.toResolvedJsonSchema(ctx)] : []); - if (ctx.target === "draft-07") - Object.assign(schema2, { definitions: defs }); - else - schema2.$defs = defs; + schema2.$defs = flatMorph(this.references, (i, ref) => ref.isRoot() && !ref.alwaysExpandJsonSchema ? [ref.id, ref.toResolvedJsonSchema(ctx)] : []); } return schema2; } toJsonSchemaRecurse(ctx) { - if (ctx.useRefs && !this.alwaysExpandJsonSchema) { - const defsKey = ctx.target === "draft-07" ? "definitions" : "$defs"; - return { $ref: `#/${defsKey}/${this.id}` }; - } + if (ctx.useRefs && !this.alwaysExpandJsonSchema) + return { $ref: `#/$defs/${this.id}` }; return this.toResolvedJsonSchema(ctx); } get alwaysExpandJsonSchema() { @@ -87363,39 +87086,39 @@ var BaseRoot = class extends BaseNode { return this._keyof; const result = this.applyStructuralOperation("keyof", []).reduce((result2, branch) => result2.intersect(branch).toNeverIfDisjoint(), $ark.intrinsic.unknown.internal); if (result.branches.length === 0) { - throwParseError2(writeUnsatisfiableExpressionError(`keyof ${this.expression}`)); + throwParseError(writeUnsatisfiableExpressionError(`keyof ${this.expression}`)); } return this._keyof = this.$.finalize(result); } get props() { if (this.branches.length !== 1) - return throwParseError2(writeLiteralUnionEntriesMessage(this.expression)); + return throwParseError(writeLiteralUnionEntriesMessage(this.expression)); return [...this.applyStructuralOperation("props", [])[0]]; } merge(r) { const rNode = this.$.parseDefinition(r); return this.$.schema(rNode.distribute((branch) => this.applyStructuralOperation("merge", [ - structureOf(branch) ?? throwParseError2(writeNonStructuralOperandMessage("merge", branch.expression)) + structureOf(branch) ?? throwParseError(writeNonStructuralOperandMessage("merge", branch.expression)) ]))); } - applyStructuralOperation(operation, args3) { + applyStructuralOperation(operation, args2) { return this.distribute((branch) => { if (branch.equals($ark.intrinsic.object) && operation !== "merge") return branch; const structure = structureOf(branch); if (!structure) { - throwParseError2(writeNonStructuralOperandMessage(operation, branch.expression)); + throwParseError(writeNonStructuralOperandMessage(operation, branch.expression)); } if (operation === "keyof") return structure.keyof(); if (operation === "get") - return structure.get(...args3); + return structure.get(...args2); if (operation === "props") return structure.props; const structuralMethodName = operation === "required" ? "require" : operation === "partial" ? "optionalize" : operation; return this.$.node("intersection", { domain: "object", - structure: structure[structuralMethodName](...args3) + structure: structure[structuralMethodName](...args2) }); }); } @@ -87513,7 +87236,7 @@ var BaseRoot = class extends BaseNode { _constrain(io, kind, schema2) { const constraint = this.$.node(kind, schema2); if (constraint.isRoot()) { - return constraint.isUnknown() ? this : throwInternalError2(`Unexpected constraint node ${constraint}`); + return constraint.isUnknown() ? this : throwInternalError(`Unexpected constraint node ${constraint}`); } const operand = io === "root" ? this : io === "in" ? this.rawIn : this.rawOut; if (operand.hasKind("morph") || constraint.impliedBasis && !operand.extends(constraint.impliedBasis)) { @@ -87598,16 +87321,6 @@ var BaseRoot = class extends BaseNode { } }; var emptyBrandNameMessage = `Expected a non-empty brand name after #`; -var supportedJsonSchemaTargets = [ - "draft-2020-12", - "draft-07" -]; -var writeInvalidJsonSchemaTargetMessage = (target) => `JSONSchema target '${target}' is not supported (must be ${supportedJsonSchemaTargets.map((t) => `"${t}"`).join(" or ")})`; -var validateStandardJsonSchemaTarget = (target) => { - if (!includes(supportedJsonSchemaTargets, target)) - throwParseError2(writeInvalidJsonSchemaTargetMessage(target)); - return target; -}; var exclusivizeRangeSchema = (schema2) => typeof schema2 === "object" && !(schema2 instanceof Date) ? { ...schema2, exclusive: true } : { rule: schema2, exclusive: true @@ -87627,13 +87340,13 @@ var writeLiteralUnionEntriesMessage = (expression) => `Props cannot be extracted ${expression}`; var writeNonStructuralOperandMessage = (operation, operand) => `${operation} operand must be an object (was ${operand})`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/utils.js -var defineRightwardIntersections = (kind, implementation23) => flatMorph2(schemaKindsRightOf(kind), (i, kind2) => [ +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/utils.js +var defineRightwardIntersections = (kind, implementation23) => flatMorph(schemaKindsRightOf(kind), (i, kind2) => [ kind2, implementation23 ]); -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/alias.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/alias.js var normalizeAliasSchema = (schema2) => typeof schema2 === "string" ? { reference: schema2 } : schema2; var neverIfDisjoint = (result) => result instanceof Disjoint ? $ark.intrinsic.never.internal : result; var implementation12 = implementNode({ @@ -87681,15 +87394,15 @@ var AliasNode = class extends BaseRoot { const seen = []; while (hasArkKind(resolution, "context")) { if (seen.includes(resolution.id)) { - return throwParseError2(writeShallowCycleErrorMessage(resolution.id, seen)); + return throwParseError(writeShallowCycleErrorMessage(resolution.id, seen)); } seen.push(resolution.id); resolution = nodesByRegisteredId[resolution.id]; } if (!hasArkKind(resolution, "root")) { - return throwInternalError2(`Unexpected resolution for reference ${this.reference} + return throwInternalError(`Unexpected resolution for reference ${this.reference} Seen: [${seen.join("->")}] -Resolution: ${printable2(resolution)}`); +Resolution: ${printable(resolution)}`); } return resolution; } @@ -87704,10 +87417,10 @@ Resolution: ${printable2(resolution)}`); return resolution; if (hasArkKind(resolution, "root")) return resolution.id; - return throwInternalError2(`Unexpected resolution for reference ${this.reference}: ${printable2(resolution)}`); + return throwInternalError(`Unexpected resolution for reference ${this.reference}: ${printable(resolution)}`); } get defaultShortDescription() { - return domainDescriptions2.object; + return domainDescriptions.object; } innerToJsonSchema(ctx) { return this.resolution.toJsonSchemaRecurse(ctx); @@ -87716,14 +87429,14 @@ Resolution: ${printable2(resolution)}`); const seen = ctx.seen[this.reference]; if (seen?.includes(data)) return true; - ctx.seen[this.reference] = append2(seen, data); + ctx.seen[this.reference] = append(seen, data); return this.resolution.traverseAllows(data, ctx); }; traverseApply = (data, ctx) => { const seen = ctx.seen[this.reference]; if (seen?.includes(data)) return; - ctx.seen[this.reference] = append2(seen, data); + ctx.seen[this.reference] = append(seen, data); this.resolution.traverseApply(data, ctx); }; compile(js) { @@ -87740,7 +87453,7 @@ var Alias = { Node: AliasNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/basis.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/basis.js var InternalBasis = class extends BaseRoot { traverseApply = (data, ctx) => { if (!this.traverseAllows(data, ctx)) @@ -87766,7 +87479,7 @@ var InternalBasis = class extends BaseRoot { } }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/domain.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/domain.js var implementation13 = implementNode({ kind: "domain", hasAssociatedError: true, @@ -87775,11 +87488,11 @@ var implementation13 = implementNode({ domain: {}, numberAllowsNaN: {} }, - normalize: (schema2) => typeof schema2 === "string" ? { domain: schema2 } : hasKey(schema2, "numberAllowsNaN") && schema2.domain !== "number" ? throwParseError2(Domain.writeBadAllowNanMessage(schema2.domain)) : schema2, + normalize: (schema2) => typeof schema2 === "string" ? { domain: schema2 } : hasKey(schema2, "numberAllowsNaN") && schema2.domain !== "number" ? throwParseError(Domain.writeBadAllowNanMessage(schema2.domain)) : schema2, applyConfig: (schema2, config2) => schema2.numberAllowsNaN === void 0 && schema2.domain === "number" && config2.numberAllowsNaN ? { ...schema2, numberAllowsNaN: true } : schema2, defaults: { - description: (node2) => domainDescriptions2[node2.domain], - actual: (data) => Number.isNaN(data) ? "NaN" : domainDescriptions2[domainOf2(data)] + description: (node2) => domainDescriptions[node2.domain], + actual: (data) => Number.isNaN(data) ? "NaN" : domainDescriptions[domainOf(data)] }, intersections: { domain: (l, r) => ( @@ -87791,7 +87504,7 @@ var implementation13 = implementNode({ }); var DomainNode = class extends InternalBasis { requiresNaNCheck = this.domain === "number" && !this.numberAllowsNaN; - traverseAllows = this.requiresNaNCheck ? (data) => typeof data === "number" && !Number.isNaN(data) : (data) => domainOf2(data) === this.domain; + traverseAllows = this.requiresNaNCheck ? (data) => typeof data === "number" && !Number.isNaN(data) : (data) => domainOf(data) === this.domain; compiledCondition = this.domain === "object" ? `((typeof data === "object" && data !== null) || typeof data === "function")` : `typeof data === "${this.domain}"${this.requiresNaNCheck ? " && !Number.isNaN(data)" : ""}`; compiledNegation = this.domain === "object" ? `((typeof data !== "object" || data === null) && typeof data !== "function")` : `typeof data !== "${this.domain}"${this.requiresNaNCheck ? " || Number.isNaN(data)" : ""}`; expression = this.numberAllowsNaN ? "number | NaN" : this.domain; @@ -87799,7 +87512,7 @@ var DomainNode = class extends InternalBasis { return this.numberAllowsNaN ? `(${this.expression})` : this.expression; } get defaultShortDescription() { - return domainDescriptions2[this.domain]; + return domainDescriptions[this.domain]; } innerToJsonSchema(ctx) { if (this.domain === "bigint" || this.domain === "symbol") { @@ -87820,7 +87533,7 @@ var Domain = { writeBadAllowNanMessage: (actual) => `numberAllowsNaN may only be specified with domain "number" (was ${actual})` }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/intersection.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/intersection.js var implementation14 = implementNode({ kind: "intersection", hasAssociatedError: true, @@ -87830,21 +87543,21 @@ var implementation14 = implementNode({ const { structure, ...schema2 } = rawSchema; const hasRootStructureKey = !!structure; const normalizedStructure = structure ?? {}; - const normalized = flatMorph2(schema2, (k, v) => { - if (isKeyOf2(k, structureKeys)) { + const normalized = flatMorph(schema2, (k, v) => { + if (isKeyOf(k, structureKeys)) { if (hasRootStructureKey) { - throwParseError2(`Flattened structure key ${k} cannot be specified alongside a root 'structure' key.`); + throwParseError(`Flattened structure key ${k} cannot be specified alongside a root 'structure' key.`); } normalizedStructure[k] = v; return []; } return [k, v]; }); - if (hasArkKind(normalizedStructure, "constraint") || !isEmptyObject2(normalizedStructure)) + if (hasArkKind(normalizedStructure, "constraint") || !isEmptyObject(normalizedStructure)) normalized.structure = normalizedStructure; return normalized; }, - finalizeInnerJson: ({ structure, ...rest }) => hasDomain2(structure, "object") ? { ...structure, ...rest } : rest, + finalizeInnerJson: ({ structure, ...rest }) => hasDomain(structure, "object") ? { ...structure, ...rest } : rest, keys: { domain: { child: true, @@ -87928,7 +87641,7 @@ var implementation14 = implementNode({ if (node2.basis && !node2.prestructurals.some((r) => r.impl.obviatesBasisDescription)) childDescriptions.push(node2.basis.description); if (node2.prestructurals.length) { - const sortedRefinementDescriptions = node2.prestructurals.slice().sort((l, r) => l.kind === "min" && r.kind === "max" ? -1 : 0).map((r) => r.description); + const sortedRefinementDescriptions = node2.prestructurals.toSorted((l, r) => l.kind === "min" && r.kind === "max" ? -1 : 0).map((r) => r.description); childDescriptions.push(...sortedRefinementDescriptions); } if (node2.inner.predicate) { @@ -87994,7 +87707,7 @@ var IntersectionNode = class extends BaseRoot { if (ctx.failFast && ctx.currentErrorCount > errorCount) return; } - this.prestructurals[this.prestructurals.length - 1].traverseApply(data, ctx); + this.prestructurals.at(-1).traverseApply(data, ctx); if (ctx.currentErrorCount > errorCount) return; } @@ -88009,7 +87722,7 @@ var IntersectionNode = class extends BaseRoot { if (ctx.failFast && ctx.currentErrorCount > errorCount) return; } - this.inner.predicate[this.inner.predicate.length - 1].traverseApply(data, ctx); + this.inner.predicate.at(-1).traverseApply(data, ctx); } }; compile(js) { @@ -88030,7 +87743,7 @@ var IntersectionNode = class extends BaseRoot { js.check(this.prestructurals[i]); js.returnIfFailFast(); } - js.check(this.prestructurals[this.prestructurals.length - 1]); + js.check(this.prestructurals.at(-1)); if (this.structure || this.inner.predicate) js.returnIfFail(); } @@ -88044,7 +87757,7 @@ var IntersectionNode = class extends BaseRoot { js.check(this.inner.predicate[i]); js.returnIfFail(); } - js.check(this.inner.predicate[this.inner.predicate.length - 1]); + js.check(this.inner.predicate.at(-1)); } } }; @@ -88081,7 +87794,7 @@ var intersectIntersections = (l, r, ctx) => { }); }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/morph.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/morph.js var implementation15 = implementNode({ kind: "morph", hasAssociatedError: false, @@ -88110,7 +87823,7 @@ var implementation15 = implementNode({ intersections: { morph: (l, r, ctx) => { if (!l.hasEqualMorphs(r)) { - return throwParseError2(writeMorphIntersectionMessage(l.expression, r.expression)); + return throwParseError(writeMorphIntersectionMessage(l.expression, r.expression)); } const inTersection = intersectOrPipeNodes(l.rawIn, r.rawIn, ctx); if (inTersection instanceof Disjoint) @@ -88149,7 +87862,7 @@ var implementation15 = implementNode({ var MorphNode = class extends BaseRoot { serializedMorphs = this.morphs.map(registeredReference); compiledMorphs = `[${this.serializedMorphs}]`; - lastMorph = this.inner.morphs[this.inner.morphs.length - 1]; + lastMorph = this.inner.morphs.at(-1); lastMorphIfNode = hasArkKind(this.lastMorph, "root") ? this.lastMorph : void 0; introspectableIn = this.inner.in; introspectableOut = this.lastMorphIfNode ? Object.assign(this.referencesById, this.lastMorphIfNode.referencesById) && this.lastMorphIfNode.rawOut : void 0; @@ -88217,23 +87930,23 @@ var writeMorphIntersectionMessage = (lDescription, rDescription) => `The interse Left: ${lDescription} Right: ${rDescription}`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/proto.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/proto.js var implementation16 = implementNode({ kind: "proto", hasAssociatedError: true, collapsibleKey: "proto", keys: { proto: { - serialize: (ctor) => getBuiltinNameOfConstructor2(ctor) ?? defaultValueSerializer(ctor) + serialize: (ctor) => getBuiltinNameOfConstructor(ctor) ?? defaultValueSerializer(ctor) }, dateAllowsInvalid: {} }, normalize: (schema2) => { - const normalized = typeof schema2 === "string" ? { proto: builtinConstructors2[schema2] } : typeof schema2 === "function" ? isNode(schema2) ? schema2 : { proto: schema2 } : typeof schema2.proto === "string" ? { ...schema2, proto: builtinConstructors2[schema2.proto] } : schema2; + const normalized = typeof schema2 === "string" ? { proto: builtinConstructors[schema2] } : typeof schema2 === "function" ? isNode(schema2) ? schema2 : { proto: schema2 } : typeof schema2.proto === "string" ? { ...schema2, proto: builtinConstructors[schema2.proto] } : schema2; if (typeof normalized.proto !== "function") - throwParseError2(Proto.writeInvalidSchemaMessage(normalized.proto)); + throwParseError(Proto.writeInvalidSchemaMessage(normalized.proto)); if (hasKey(normalized, "dateAllowsInvalid") && normalized.proto !== Date) - throwParseError2(Proto.writeBadInvalidDateMessage(normalized.proto)); + throwParseError(Proto.writeBadInvalidDateMessage(normalized.proto)); return normalized; }, applyConfig: (schema2, config2) => { @@ -88242,7 +87955,7 @@ var implementation16 = implementNode({ return schema2; }, defaults: { - description: (node2) => node2.builtinName ? objectKindDescriptions2[node2.builtinName] : `an instance of ${node2.proto.name}`, + description: (node2) => node2.builtinName ? objectKindDescriptions[node2.builtinName] : `an instance of ${node2.proto.name}`, actual: (data) => data instanceof Date && data.toString() === "Invalid Date" ? "an invalid Date" : objectKindOrDomainOf(data) }, intersections: { @@ -88255,7 +87968,7 @@ var implementation16 = implementNode({ } }); var ProtoNode = class extends InternalBasis { - builtinName = getBuiltinNameOfConstructor2(this.proto); + builtinName = getBuiltinNameOfConstructor(this.proto); serializedConstructor = this.json.proto; requiresInvalidDateCheck = this.proto === Date && !this.dateAllowsInvalid; traverseAllows = this.requiresInvalidDateCheck ? (data) => data instanceof Date && data.toString() !== "Invalid Date" : (data) => data instanceof this.proto; @@ -88290,10 +88003,10 @@ var Proto = { implementation: implementation16, Node: ProtoNode, writeBadInvalidDateMessage: (actual) => `dateAllowsInvalid may only be specified with constructor Date (was ${actual.name})`, - writeInvalidSchemaMessage: (actual) => `instanceOf operand must be a function (was ${domainOf2(actual)})` + writeInvalidSchemaMessage: (actual) => `instanceOf operand must be a function (was ${domainOf(actual)})` }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/union.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/union.js var implementation17 = implementNode({ kind: "union", hasAssociatedError: true, @@ -88349,7 +88062,7 @@ var implementation17 = implementNode({ for (const errorAtPath of errors) appendUnique(branchesAtPath, errorAtPath.expected); const expected = describeBranches(branchesAtPath); - const actual = errors.every((e) => e.actual === errors[0].actual) ? errors[0].actual : printable2(errors[0].data); + const actual = errors.every((e) => e.actual === errors[0].actual) ? errors[0].actual : printable(errors[0].data); return `${path3 && `${path3} `}must be ${expected}${actual && ` (was ${actual})`}`; }); return describeBranches(pathDescriptions); @@ -88370,7 +88083,7 @@ var implementation17 = implementNode({ let resultBranches; if (l.ordered) { if (r.ordered) { - throwParseError2(writeOrderedIntersectionMessage(l.expression, r.expression)); + throwParseError(writeOrderedIntersectionMessage(l.expression, r.expression)); } resultBranches = intersectBranches(r.branches, l.branches, ctx); if (resultBranches instanceof Disjoint) @@ -88419,7 +88132,7 @@ var UnionNode = class extends BaseRoot { createBranchedOptimisticRootApply() { return (data, onFail) => { const optimisticResult = this.traverseOptimistic(data); - if (optimisticResult !== unset2) + if (optimisticResult !== unset) return optimisticResult; const ctx = new Traversal(data, this.$.resolvedConfig); this.traverseApply(data, ctx); @@ -88473,7 +88186,7 @@ var UnionNode = class extends BaseRoot { return data; } } - return unset2; + return unset; }; compile(js) { if (!this.discriminant || // if we have a union of two units like `boolean`, the @@ -88498,9 +88211,9 @@ var UnionNode = class extends BaseRoot { if (v.rootApplyStrategy === "branchedOptimistic") caseResult = js.invoke(v, { kind: "Optimistic" }); else if (v.contextFreeMorph) - caseResult = `${js.invoke(v)} ? ${registeredReference(v.contextFreeMorph)}(data) : "${unset2}"`; + caseResult = `${js.invoke(v)} ? ${registeredReference(v.contextFreeMorph)}(data) : "${unset}"`; else - caseResult = `${js.invoke(v)} ? data : "${unset2}"`; + caseResult = `${js.invoke(v)} ? data : "${unset}"`; } else caseResult = js.invoke(v); js.line(`${caseCondition}: return ${caseResult}`); @@ -88508,12 +88221,12 @@ var UnionNode = class extends BaseRoot { return js; }); if (js.traversalKind === "Allows") { - js.return(optimistic ? `"${unset2}"` : false); + js.return(optimistic ? `"${unset}"` : false); return; } const expected = describeBranches(this.discriminant.kind === "domain" ? caseKeys.map((k) => { const jsTypeOf = k.slice(1, -1); - return jsTypeOf === "function" ? domainDescriptions2.object : domainDescriptions2[jsTypeOf]; + return jsTypeOf === "function" ? domainDescriptions.object : domainDescriptions[jsTypeOf]; }) : caseKeys); const serializedPathSegments = this.discriminant.path.map((k) => typeof k === "symbol" ? registeredReference(k) : JSON.stringify(k)); const serializedExpected = JSON.stringify(expected); @@ -88539,7 +88252,7 @@ var UnionNode = class extends BaseRoot { for (const branch of this.branches) { js.if(`${js.invoke(branch)}`, () => js.return(optimistic ? branch.contextFreeMorph ? `${registeredReference(branch.contextFreeMorph)}(data)` : "data" : true)); } - js.return(optimistic ? `"${unset2}"` : false); + js.return(optimistic ? `"${unset}"` : false); } } get nestableExpression() { @@ -88549,7 +88262,7 @@ var UnionNode = class extends BaseRoot { if (this.branches.length < 2 || this.isCyclic) return null; if (this.unitBranches.length === this.branches.length) { - const cases2 = flatMorph2(this.unitBranches, (i, n) => [ + const cases2 = flatMorph(this.unitBranches, (i, n) => [ `${n.rawIn.serializedValue}`, n.hasKind("morph") ? n : true ]); @@ -88748,8 +88461,8 @@ var discriminantCaseToNode = (caseDiscriminant, path3, $2) => { return node2; }; var optionallyChainPropString = (path3) => path3.reduce((acc, k) => acc + compileLiteralPropAccess(k, true), "data"); -var serializedTypeOfDescriptions = registeredReference(jsTypeOfDescriptions2); -var serializedPrintable = registeredReference(printable2); +var serializedTypeOfDescriptions = registeredReference(jsTypeOfDescriptions); +var serializedPrintable = registeredReference(printable); var Union = { implementation: implementation17, Node: UnionNode @@ -88757,7 +88470,7 @@ var Union = { var discriminantToJson = (discriminant) => ({ kind: discriminant.kind, path: discriminant.path.map((k) => typeof k === "string" ? k : compileSerializedValue(k)), - cases: flatMorph2(discriminant.cases, (k, node2) => [ + cases: flatMorph(discriminant.cases, (k, node2) => [ k, node2 === true ? node2 : node2.hasKind("union") && node2.discriminantJson ? node2.discriminantJson : node2.json ]) @@ -88846,12 +88559,12 @@ var assertDeterminateOverlap = (l, r) => { if (!l.includesTransform && !r.includesTransform) return; if (!arrayEquals(l.shallowMorphs, r.shallowMorphs)) { - throwParseError2(writeIndiscriminableMorphMessage(l.expression, r.expression)); + throwParseError(writeIndiscriminableMorphMessage(l.expression, r.expression)); } if (!arrayEquals(l.flatMorphs, r.flatMorphs, { isEqual: (l2, r2) => l2.propString === r2.propString && (l2.node.hasKind("morph") && r2.node.hasKind("morph") ? l2.node.hasEqualMorphs(r2.node) : l2.node.hasKind("intersection") && r2.node.hasKind("intersection") ? l2.node.structure?.structuralMorphRef === r2.node.structure?.structuralMorphRef : false) })) { - throwParseError2(writeIndiscriminableMorphMessage(l.expression, r.expression)); + throwParseError(writeIndiscriminableMorphMessage(l.expression, r.expression)); } }; var pruneDiscriminant = (discriminantBranch, discriminantCtx) => discriminantBranch.transform((nodeKind, inner) => { @@ -88877,7 +88590,7 @@ var writeOrderedIntersectionMessage = (lDescription, rDescription) => `The inter Left: ${lDescription} Right: ${rDescription}`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/roots/unit.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/roots/unit.js var implementation18 = implementNode({ kind: "unit", hasAssociatedError: true, @@ -88889,7 +88602,7 @@ var implementation18 = implementNode({ }, normalize: (schema2) => schema2, defaults: { - description: (node2) => printable2(node2.unit), + description: (node2) => printable(node2.unit), problem: ({ expected, actual }) => `${expected === actual ? `must be reference equal to ${expected} (serialized to the same value)` : `must be ${expected} (was ${actual})`}` }, intersections: { @@ -88914,10 +88627,10 @@ var UnitNode = class extends InternalBasis { serializedValue = typeof this.unit === "string" || this.unit instanceof Date ? JSON.stringify(this.compiledValue) : `${this.compiledValue}`; compiledCondition = compileEqualityCheck(this.unit, this.serializedValue); compiledNegation = compileEqualityCheck(this.unit, this.serializedValue, "negated"); - expression = printable2(this.unit); - domain = domainOf2(this.unit); + expression = printable(this.unit); + domain = domainOf(this.unit); get defaultShortDescription() { - return this.domain === "object" ? domainDescriptions2.object : this.description; + return this.domain === "object" ? domainDescriptions.object : this.description; } innerToJsonSchema(ctx) { return ( @@ -88941,7 +88654,7 @@ var compileEqualityCheck = (unit, serializedValue, negated) => { return `data ${negated ? "!" : "="}== ${serializedValue}`; }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/structure/index.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/structure/index.js var implementation19 = implementNode({ kind: "index", hasAssociatedError: false, @@ -88952,11 +88665,11 @@ var implementation19 = implementNode({ parse: (schema2, ctx) => { const key = ctx.$.parseSchema(schema2); if (!key.extends($ark.intrinsic.key)) { - return throwParseError2(writeInvalidPropertyKeyMessage(key.expression)); + return throwParseError(writeInvalidPropertyKeyMessage(key.expression)); } const enumerableBranches = key.branches.filter((b) => b.hasKind("unit")); if (enumerableBranches.length) { - return throwParseError2(writeEnumerableIndexBranches(enumerableBranches.map((b) => printable2(b.unit)))); + return throwParseError(writeEnumerableIndexBranches(enumerableBranches.map((b) => printable(b.unit)))); } return key; } @@ -88988,15 +88701,15 @@ var implementation19 = implementNode({ var IndexNode = class extends BaseConstraint { impliedBasis = $ark.intrinsic.object.internal; expression = `[${this.signature.expression}]: ${this.value.expression}`; - flatRefs = append2(this.value.flatRefs.map((ref) => flatRef([this.signature, ...ref.path], ref.node)), flatRef([this.signature], this.value)); - traverseAllows = (data, ctx) => stringAndSymbolicEntriesOf2(data).every((entry) => { + flatRefs = append(this.value.flatRefs.map((ref) => flatRef([this.signature, ...ref.path], ref.node)), flatRef([this.signature], this.value)); + traverseAllows = (data, ctx) => stringAndSymbolicEntriesOf(data).every((entry) => { if (this.signature.traverseAllows(entry[0], ctx)) { return traverseKey(entry[0], () => this.value.traverseAllows(entry[1], ctx), ctx); } return true; }); traverseApply = (data, ctx) => { - for (const entry of stringAndSymbolicEntriesOf2(data)) { + for (const entry of stringAndSymbolicEntriesOf(data)) { if (this.signature.traverseAllows(entry[0], ctx)) { traverseKey(entry[0], () => this.value.traverseApply(entry[1], ctx), ctx); } @@ -89018,7 +88731,7 @@ var Index = { var writeEnumerableIndexBranches = (keys) => `Index keys ${keys.join(", ")} should be specified as named props.`; var writeInvalidPropertyKeyMessage = (indexSchema) => `Indexed key definition '${indexSchema}' must be a string or symbol`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/structure/required.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/structure/required.js var implementation20 = implementNode({ kind: "required", hasAssociatedError: true, @@ -89056,7 +88769,7 @@ var Required = { Node: RequiredNode }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/structure/sequence.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/structure/sequence.js var implementation21 = implementNode({ kind: "sequence", hasAssociatedError: false, @@ -89127,12 +88840,12 @@ var implementation21 = implementNode({ if ("variadic" in schema2 || "prefix" in schema2 || "defaultables" in schema2 || "optionals" in schema2 || "postfix" in schema2 || "minVariadicLength" in schema2) { if (schema2.postfix?.length) { if (!schema2.variadic) - return throwParseError2(postfixWithoutVariadicMessage); + return throwParseError(postfixWithoutVariadicMessage); if (schema2.optionals?.length || schema2.defaultables?.length) - return throwParseError2(postfixAfterOptionalOrDefaultableMessage); + return throwParseError(postfixAfterOptionalOrDefaultableMessage); } if (schema2.minVariadicLength && !schema2.variadic) { - return throwParseError2("minVariadicLength may not be specified without a variadic element"); + return throwParseError("minVariadicLength may not be specified without a variadic element"); } return schema2; } @@ -89145,10 +88858,10 @@ var implementation21 = implementNode({ const optionals = raw.optionals?.slice() ?? []; const postfix = raw.postfix?.slice() ?? []; if (raw.variadic) { - while (optionals[optionals.length - 1]?.equals(raw.variadic)) + while (optionals.at(-1)?.equals(raw.variadic)) optionals.pop(); if (optionals.length === 0 && defaultables.length === 0) { - while (prefix[prefix.length - 1]?.equals(raw.variadic)) { + while (prefix.at(-1)?.equals(raw.variadic)) { prefix.pop(); minVariadicLength++; } @@ -89180,7 +88893,7 @@ var implementation21 = implementNode({ description: (node2) => { if (node2.isVariadicOnly) return `${node2.variadic.nestableExpression}[]`; - const innerDescription = node2.tuple.map((element) => element.kind === "defaultables" ? `${element.node.nestableExpression} = ${printable2(element.default)}` : element.kind === "optionals" ? `${element.node.nestableExpression}?` : element.kind === "variadic" ? `...${element.node.nestableExpression}[]` : element.node.expression).join(", "); + const innerDescription = node2.tuple.map((element) => element.kind === "defaultables" ? `${element.node.nestableExpression} = ${printable(element.default)}` : element.kind === "optionals" ? `${element.node.nestableExpression}?` : element.kind === "variadic" ? `...${element.node.nestableExpression}[]` : element.node.expression).join(", "); return `[${innerDescription}]`; } }, @@ -89225,11 +88938,11 @@ var SequenceNode = class extends BaseConstraint { // have to wait until prevariadic and variadicOrPostfix are set to calculate flatRefs = this.addFlatRefs(); addFlatRefs() { - appendUniqueFlatRefs(this.flatRefs, this.prevariadic.flatMap((element, i) => append2(element.node.flatRefs.map((ref) => flatRef([`${i}`, ...ref.path], ref.node)), flatRef([`${i}`], element.node)))); + appendUniqueFlatRefs(this.flatRefs, this.prevariadic.flatMap((element, i) => append(element.node.flatRefs.map((ref) => flatRef([`${i}`, ...ref.path], ref.node)), flatRef([`${i}`], element.node)))); appendUniqueFlatRefs(this.flatRefs, this.variadicOrPostfix.flatMap((element) => ( // a postfix index can't be directly represented as a type // key, so we just use the same matcher for variadic - append2(element.flatRefs.map((ref) => flatRef([$ark.intrinsic.nonNegativeIntegerString.internal, ...ref.path], ref.node)), flatRef([$ark.intrinsic.nonNegativeIntegerString.internal], element)) + append(element.flatRefs.map((ref) => flatRef([$ark.intrinsic.nonNegativeIntegerString.internal, ...ref.path], ref.node)), flatRef([$ark.intrinsic.nonNegativeIntegerString.internal], element)) ))); return this.flatRefs; } @@ -89250,7 +88963,7 @@ var SequenceNode = class extends BaseConstraint { return { kind: "postfix", node: this.postfix[index - firstPostfixIndex] }; return { kind: "variadic", - node: this.variadic ?? throwInternalError2(`Unexpected attempt to access index ${index} on ${this}`) + node: this.variadic ?? throwInternalError(`Unexpected attempt to access index ${index} on ${this}`) }; } // minLength/maxLength should be checked by Intersection before either traversal @@ -89305,9 +89018,8 @@ var SequenceNode = class extends BaseConstraint { // this depends on tuple so needs to come after it expression = this.description; reduceJsonSchema(schema2, ctx) { - const isDraft07 = ctx.target === "draft-07"; if (this.prevariadic.length) { - const prefixSchemas = this.prevariadic.map((el) => { + schema2.prefixItems = this.prevariadic.map((el) => { const valueSchema = el.node.toJsonSchemaRecurse(ctx); if (el.kind === "defaultables") { const value2 = typeof el.default === "function" ? el.default() : el.default; @@ -89319,34 +89031,25 @@ var SequenceNode = class extends BaseConstraint { } return valueSchema; }); - if (isDraft07) - schema2.items = prefixSchemas; - else - schema2.prefixItems = prefixSchemas; } if (this.minLength) schema2.minItems = this.minLength; if (this.variadic) { - const variadicItemSchema = this.variadic.toJsonSchemaRecurse(ctx); - if (isDraft07 && this.prevariadic.length) - schema2.additionalItems = variadicItemSchema; - else - schema2.items = variadicItemSchema; + const variadicSchema = Object.assign(schema2, { + items: this.variadic.toJsonSchemaRecurse(ctx) + }); if (this.maxLength) - schema2.maxItems = this.maxLength; + variadicSchema.maxItems = this.maxLength; if (this.postfix) { const elements = this.postfix.map((el) => el.toJsonSchemaRecurse(ctx)); schema2 = ctx.fallback.arrayPostfix({ code: "arrayPostfix", - base: schema2, + base: variadicSchema, elements }); } } else { - if (isDraft07) - schema2.additionalItems = false; - else - schema2.items = false; + schema2.items = false; delete schema2.maxItems; } return schema2; @@ -89394,11 +89097,11 @@ var sequenceTupleToInner = (tuple) => tuple.reduce((result, element) => { if (element.kind === "variadic") result.variadic = element.node; else if (element.kind === "defaultables") { - result.defaultables = append2(result.defaultables, [ + result.defaultables = append(result.defaultables, [ [element.node, element.default] ]); } else - result[element.kind] = append2(result[element.kind], element.node); + result[element.kind] = append(result[element.kind], element.node); return result; }, {}); var postfixAfterOptionalOrDefaultableMessage = "A postfix required element cannot follow an optional or defaultable element"; @@ -89408,8 +89111,8 @@ var _intersectSequences = (s) => { const [rHead, ...rTail] = s.r; if (!lHead || !rHead) return s; - const lHasPostfix = lTail[lTail.length - 1]?.kind === "postfix"; - const rHasPostfix = rTail[rTail.length - 1]?.kind === "postfix"; + const lHasPostfix = lTail.at(-1)?.kind === "postfix"; + const rHasPostfix = rTail.at(-1)?.kind === "postfix"; const kind = lHead.kind === "prefix" || rHead.kind === "prefix" ? "prefix" : lHead.kind === "postfix" || rHead.kind === "postfix" ? "postfix" : lHead.kind === "variadic" && rHead.kind === "variadic" ? "variadic" : lHasPostfix || rHasPostfix ? "prefix" : lHead.kind === "defaultables" || rHead.kind === "defaultables" ? "defaultables" : "optionals"; if (lHead.kind === "prefix" && rHead.kind === "variadic" && rHasPostfix) { const postfixBranchResult = _intersectSequences({ @@ -89453,14 +89156,14 @@ var _intersectSequences = (s) => { } } else if (kind === "defaultables") { if (lHead.kind === "defaultables" && rHead.kind === "defaultables" && lHead.default !== rHead.default) { - throwParseError2(writeDefaultIntersectionMessage(lHead.default, rHead.default)); + throwParseError(writeDefaultIntersectionMessage(lHead.default, rHead.default)); } s.result = [ ...s.result, { kind, node: result, - default: lHead.kind === "defaultables" ? lHead.default : rHead.kind === "defaultables" ? rHead.default : throwInternalError2(`Unexpected defaultable intersection from ${lHead.kind} and ${rHead.kind} elements.`) + default: lHead.kind === "defaultables" ? lHead.default : rHead.kind === "defaultables" ? rHead.default : throwInternalError(`Unexpected defaultable intersection from ${lHead.kind} and ${rHead.kind} elements.`) } ]; } else @@ -89475,7 +89178,7 @@ var _intersectSequences = (s) => { }; var elementIsRequired = (el) => el.kind === "prefix" || el.kind === "postfix"; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/structure/structure.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/structure/structure.js var createStructuralWriter = (childStringProp) => (node2) => { if (node2.props.length || node2.index) { const parts = node2.index?.map((index) => index[childStringProp]) ?? []; @@ -89521,7 +89224,7 @@ var implementation22 = implementNode({ child: true, parse: constraintKeyParser("required"), reduceIo: (ioKind, inner, nodes) => { - inner.required = append2(inner.required, nodes.map((node2) => ioKind === "in" ? node2.rawIn : node2.rawOut)); + inner.required = append(inner.required, nodes.map((node2) => ioKind === "in" ? node2.rawIn : node2.rawOut)); return; } }, @@ -89534,7 +89237,7 @@ var implementation22 = implementNode({ return; } for (const node2 of nodes) { - inner[node2.outProp.kind] = append2(inner[node2.outProp.kind], node2.outProp.rawOut); + inner[node2.outProp.kind] = append(inner[node2.outProp.kind], node2.outProp.rawOut); } } }, @@ -89655,7 +89358,7 @@ var implementation22 = implementNode({ for (let i = 0; i < inner.required.length; i++) { const requiredProp = inner.required[i]; if (requiredProp.key in seen) - throwParseError2(writeDuplicateKeyMessage(requiredProp.key)); + throwParseError(writeDuplicateKeyMessage(requiredProp.key)); seen[requiredProp.key] = true; if (inner.index) { for (const index of inner.index) { @@ -89670,7 +89373,7 @@ var implementation22 = implementNode({ for (let i = 0; i < inner.optional.length; i++) { const optionalProp = inner.optional[i]; if (optionalProp.key in seen) - throwParseError2(writeDuplicateKeyMessage(optionalProp.key)); + throwParseError(writeDuplicateKeyMessage(optionalProp.key)); seen[optionalProp.key] = true; if (inner.index) { for (const index of inner.index) { @@ -89694,7 +89397,7 @@ var StructureNode = class extends BaseConstraint { impliedBasis = $ark.intrinsic.object.internal; impliedSiblings = this.children.flatMap((n) => n.impliedSiblings ?? []); props = conflatenate(this.required, this.optional); - propsByKey = flatMorph2(this.props, (i, node2) => [node2.key, node2]); + propsByKey = flatMorph(this.props, (i, node2) => [node2.key, node2]); propsByKeyReference = registeredReference(this.propsByKey); expression = structuralExpression(this); requiredKeys = this.required?.map((node2) => node2.key) ?? []; @@ -89716,21 +89419,21 @@ var StructureNode = class extends BaseConstraint { const originalProp = this.propsByKey[mapped.key]; if (isNode(mapped)) { if (mapped.kind !== "required" && mapped.kind !== "optional") { - return throwParseError2(`Map result must have kind "required" or "optional" (was ${mapped.kind})`); + return throwParseError(`Map result must have kind "required" or "optional" (was ${mapped.kind})`); } - structureInner[mapped.kind] = append2(structureInner[mapped.kind], mapped); + structureInner[mapped.kind] = append(structureInner[mapped.kind], mapped); return structureInner; } const mappedKind = mapped.kind ?? originalProp?.kind ?? "required"; - const mappedPropInner = flatMorph2(mapped, (k, v) => k in Optional.implementation.keys ? [k, v] : []); - structureInner[mappedKind] = append2(structureInner[mappedKind], this.$.node(mappedKind, mappedPropInner)); + const mappedPropInner = flatMorph(mapped, (k, v) => k in Optional.implementation.keys ? [k, v] : []); + structureInner[mappedKind] = append(structureInner[mappedKind], this.$.node(mappedKind, mappedPropInner)); return structureInner; }, {})); } assertHasKeys(keys) { const invalidKeys = keys.filter((k) => !typeOrTermExtends(k, this.keyof())); if (invalidKeys.length) { - return throwParseError2(writeInvalidKeysMessage(this.expression, invalidKeys)); + return throwParseError(writeInvalidKeysMessage(this.expression, invalidKeys)); } } get(indexer, ...path3) { @@ -89765,9 +89468,9 @@ var StructureNode = class extends BaseConstraint { } if (!value2) { if (this.sequence?.variadic && hasArkKind(key, "root") && key.extends($ark.intrinsic.number)) { - return throwParseError2(writeNumberIndexMessage(key.expression, this.sequence.expression)); + return throwParseError(writeNumberIndexMessage(key.expression, this.sequence.expression)); } - return throwParseError2(writeInvalidKeysMessage(this.expression, [key])); + return throwParseError(writeInvalidKeysMessage(this.expression, [key])); } const result = value2.get(...path3); return required2 ? result : result.or($ark.intrinsic.undefined); @@ -89800,11 +89503,11 @@ var StructureNode = class extends BaseConstraint { merge(r) { const inner = this.filterKeys("omit", [r.keyof()]); if (r.required) - inner.required = append2(inner.required, r.required); + inner.required = append(inner.required, r.required); if (r.optional) - inner.optional = append2(inner.optional, r.optional); + inner.optional = append(inner.optional, r.optional); if (r.index) - inner.index = append2(inner.index, r.index); + inner.index = append(inner.index, r.index); if (r.sequence) inner.sequence = r.sequence; if (r.undeclared) @@ -90028,7 +89731,7 @@ var StructureNode = class extends BaseConstraint { }); } if (!keyBranch.hasKind("intersection")) { - return throwInternalError2(`Unexpected index branch kind ${keyBranch.kind}.`); + return throwInternalError(`Unexpected index branch kind ${keyBranch.kind}.`); } const { pattern } = keyBranch.inner; if (pattern) { @@ -90109,11 +89812,11 @@ var getPossibleMorph = (node2) => { }; var precompileMorphs = (js, node2) => { const requiresContext = node2.defaultable.some((node3) => node3.defaultValueMorph.length === 2) || node2.sequence?.defaultValueMorphs.some((morph) => morph.length === 2); - const args3 = `(data${requiresContext ? ", ctx" : ""})`; - return js.block(`${args3} => `, (js2) => { + const args2 = `(data${requiresContext ? ", ctx" : ""})`; + return js.block(`${args2} => `, (js2) => { for (let i = 0; i < node2.defaultable.length; i++) { const { serializedKey, defaultValueMorphRef } = node2.defaultable[i]; - js2.if(`!(${serializedKey} in data)`, (js3) => js3.line(`${defaultValueMorphRef}${args3}`)); + js2.if(`!(${serializedKey} in data)`, (js3) => js3.line(`${defaultValueMorphRef}${args2}`)); } if (node2.sequence?.defaultables) { js2.for(`i < ${node2.sequence.defaultables.length}`, (js3) => js3.set(`data[i]`, 5), `data.length - ${node2.sequence.prefixLength}`); @@ -90143,7 +89846,7 @@ var normalizeIndex = (signature, value2, $2) => { const normalized = {}; for (const n of enumerableBranches) { const prop = $2.node("required", { key: n.unit, value: value2 }); - normalized[prop.kind] = append2(normalized[prop.kind], prop); + normalized[prop.kind] = append(normalized[prop.kind], prop); } if (nonEnumerableBranches.length) { normalized.index = $2.node("index", { @@ -90153,11 +89856,11 @@ var normalizeIndex = (signature, value2, $2) => { } return normalized; }; -var typeKeyToString = (k) => hasArkKind(k, "root") ? k.expression : printable2(k); +var typeKeyToString = (k) => hasArkKind(k, "root") ? k.expression : printable(k); var writeInvalidKeysMessage = (o, keys) => `Key${keys.length === 1 ? "" : "s"} ${keys.map(typeKeyToString).join(", ")} ${keys.length === 1 ? "does" : "do"} not exist on ${o}`; var writeDuplicateKeyMessage = (key) => `Duplicate key ${compileSerializedValue(key)}`; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/kinds.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/kinds.js var nodeImplementationsByKind = { ...boundImplementationsByKind, alias: Alias.implementation, @@ -90176,11 +89879,11 @@ var nodeImplementationsByKind = { sequence: Sequence.implementation, structure: Structure.implementation }; -$ark.defaultConfig = withAlphabetizedKeys(Object.assign(flatMorph2(nodeImplementationsByKind, (kind, implementation23) => [ +$ark.defaultConfig = withAlphabetizedKeys(Object.assign(flatMorph(nodeImplementationsByKind, (kind, implementation23) => [ kind, implementation23.defaults ]), { - jitless: envHasCsp2(), + jitless: envHasCsp(), clone: deepClone, onUndeclaredKey: "ignore", exactOptionalPropertyTypes: true, @@ -90210,21 +89913,21 @@ var nodeClassesByKind = { structure: Structure.Node }; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/module.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/module.js var RootModule = class extends DynamicBase { // ensure `[arkKind]` is non-enumerable so it doesn't get spread on import/export get [arkKind]() { return "module"; } }; -var bindModule = (module, $2) => new RootModule(flatMorph2(module, (alias, value2) => [ +var bindModule = (module, $2) => new RootModule(flatMorph(module, (alias, value2) => [ alias, hasArkKind(value2, "module") ? bindModule(value2, $2) : $2.bindReference(value2) ])); -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/scope.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/scope.js var schemaBranchesOf = (schema2) => isArray(schema2) ? schema2 : "branches" in schema2 && isArray(schema2.branches) ? schema2.branches : void 0; -var throwMismatchedNodeRootError = (expected, actual) => throwParseError2(`Node of kind ${actual} is not valid as a ${expected} definition`); +var throwMismatchedNodeRootError = (expected, actual) => throwParseError(`Node of kind ${actual} is not valid as a ${expected} definition`); var writeDuplicateAliasError = (alias) => `#${alias} duplicates public alias ${alias}`; var scopesByName = {}; $ark.ambient ??= {}; @@ -90291,7 +89994,7 @@ var BaseScope = class { this.resolvedConfig = mergeConfigs($ark.resolvedConfig, config2); this.name = this.resolvedConfig.name ?? `anonymousScope${Object.keys(scopesByName).length}`; if (this.name in scopesByName) - throwParseError2(`A Scope already named ${this.name} already exists`); + throwParseError(`A Scope already named ${this.name} already exists`); scopesByName[this.name] = this; const aliasEntries = Object.entries(def).map((entry) => this.preparseOwnAliasEntry(...entry)); for (const [k, v] of aliasEntries) { @@ -90299,11 +90002,11 @@ var BaseScope = class { if (k[0] === "#") { name = k.slice(1); if (name in this.aliases) - throwParseError2(writeDuplicateAliasError(name)); + throwParseError(writeDuplicateAliasError(name)); this.aliases[name] = v; } else { if (name in this.aliases) - throwParseError2(writeDuplicateAliasError(k)); + throwParseError(writeDuplicateAliasError(k)); this.aliases[name] = v; this.exportedNames.push(name); } @@ -90326,7 +90029,7 @@ var BaseScope = class { ] }, { prereduced: true }); this.nodesByHash[rawUnknownUnion.hash] = this.node("intersection", {}, { prereduced: true }); - this.intrinsic = $ark.intrinsic ? flatMorph2($ark.intrinsic, (k, v) => ( + this.intrinsic = $ark.intrinsic ? flatMorph($ark.intrinsic, (k, v) => ( // don't include cyclic aliases from JSON scope k.startsWith("json") ? [] : [k, this.bindReference(v)] )) : {}; @@ -90387,7 +90090,7 @@ var BaseScope = class { schema2 = resolution; kind = resolution.kind; } - } else if (kind === "union" && hasDomain2(schema2, "object")) { + } else if (kind === "union" && hasDomain(schema2, "object")) { const branches = schemaBranchesOf(schema2); if (branches?.length === 1) { schema2 = branches[0]; @@ -90422,7 +90125,7 @@ var BaseScope = class { return bound; } resolveRoot(name) { - return this.maybeResolveRoot(name) ?? throwParseError2(writeUnresolvableMessage(name)); + return this.maybeResolveRoot(name) ?? throwParseError(writeUnresolvableMessage(name)); } maybeResolveRoot(name) { const result = this.maybeResolve(name); @@ -90438,11 +90141,11 @@ var BaseScope = class { return $ark.ambient; } maybeResolve(name) { - const cached4 = this.resolutions[name]; - if (cached4) { - if (typeof cached4 !== "string") - return this.bindReference(cached4); - const v = nodesByRegisteredId[cached4]; + const cached3 = this.resolutions[name]; + if (cached3) { + if (typeof cached3 !== "string") + return this.bindReference(cached3); + const v = nodesByRegisteredId[cached3]; if (hasArkKind(v, "root")) return this.resolutions[name] = v; if (hasArkKind(v, "context")) { @@ -90450,7 +90153,7 @@ var BaseScope = class { return this.node("alias", { reference: `$${name}` }, { prereduced: true }); } if (v.phase === "resolved") { - return throwInternalError2(`Unexpected resolved context for was uncached by its scope: ${printable2(v)}`); + return throwInternalError(`Unexpected resolved context for was uncached by its scope: ${printable(v)}`); } v.phase = "resolving"; const node2 = this.bindReference(this.parseOwnDefinitionFormat(v.def, v)); @@ -90459,7 +90162,7 @@ var BaseScope = class { nodesByRegisteredId[v.id] = node2; return this.resolutions[name] = node2; } - return throwInternalError2(`Unexpected nodesById entry for ${cached4}: ${printable2(v)}`); + return throwInternalError(`Unexpected nodesById entry for ${cached3}: ${printable(v)}`); } let def = this.aliases[name] ?? this.ambient?.[name]; if (!def) @@ -90469,7 +90172,7 @@ var BaseScope = class { return this.resolutions[name] = this.bindReference(def); if (hasArkKind(def, "module")) { if (!def.root) - throwParseError2(writeMissingSubmoduleAccessMessage(name)); + throwParseError(writeMissingSubmoduleAccessMessage(name)); return this.resolutions[name] = this.bindReference(def.root); } return this.resolutions[name] = this.parse(def, { @@ -90489,7 +90192,7 @@ var BaseScope = class { return new Traversal(root2, this.resolvedConfig); } import(...names) { - return new RootModule(flatMorph2(this.export(...names), (alias, value2) => [ + return new RootModule(flatMorph(this.export(...names), (alias, value2) => [ `#${alias}`, value2 ])); @@ -90518,7 +90221,7 @@ var BaseScope = class { this.resolved = true; } const namesToExport = names.length ? names : this.exportedNames; - return new RootModule(flatMorph2(namesToExport, (_, name) => [ + return new RootModule(flatMorph(namesToExport, (_, name) => [ name, this._exports[name] ])); @@ -90582,9 +90285,9 @@ var bootstrapAliasReferences = (resolution) => { } return resolution; }; -var resolutionsToJson = (resolutions) => flatMorph2(resolutions, (k, v) => [ +var resolutionsToJson = (resolutions) => flatMorph(resolutions, (k, v) => [ k, - hasArkKind(v, "root") || hasArkKind(v, "generic") ? v.json : hasArkKind(v, "module") ? resolutionsToJson(v) : throwInternalError2(`Unexpected resolution ${printable2(v)}`) + hasArkKind(v, "root") || hasArkKind(v, "generic") ? v.json : hasArkKind(v, "module") ? resolutionsToJson(v) : throwInternalError(`Unexpected resolution ${printable(v)}`) ]); var maybeResolveSubalias = (base, name) => { const dotIndex = name.indexOf("."); @@ -90595,7 +90298,7 @@ var maybeResolveSubalias = (base, name) => { if (prefixSchema === void 0) return; if (!hasArkKind(prefixSchema, "module")) - return throwParseError2(writeNonSubmoduleDotMessage(dotPrefix)); + return throwParseError(writeNonSubmoduleDotMessage(dotPrefix)); const subalias = name.slice(dotIndex + 1); const resolution = prefixSchema[subalias]; if (resolution === void 0) @@ -90603,9 +90306,9 @@ var maybeResolveSubalias = (base, name) => { if (hasArkKind(resolution, "root") || hasArkKind(resolution, "generic")) return resolution; if (hasArkKind(resolution, "module")) { - return resolution.root ?? throwParseError2(writeMissingSubmoduleAccessMessage(name)); + return resolution.root ?? throwParseError(writeMissingSubmoduleAccessMessage(name)); } - throwInternalError2(`Unexpected resolution for alias '${name}': ${printable2(resolution)}`); + throwInternalError(`Unexpected resolution for alias '${name}': ${printable(resolution)}`); }; var schemaScope = (aliases, config2) => new SchemaScope(aliases, config2); var rootSchemaScope = new SchemaScope({}); @@ -90615,12 +90318,12 @@ var resolutionsOfModule = ($2, typeSet) => { const v = typeSet[k]; if (hasArkKind(v, "module")) { const innerResolutions = resolutionsOfModule($2, v); - const prefixedResolutions = flatMorph2(innerResolutions, (innerK, innerV) => [`${k}.${innerK}`, innerV]); + const prefixedResolutions = flatMorph(innerResolutions, (innerK, innerV) => [`${k}.${innerK}`, innerV]); Object.assign(result, prefixedResolutions); } else if (hasArkKind(v, "root") || hasArkKind(v, "generic")) result[k] = v; else - throwInternalError2(`Unexpected scope resolution ${printable2(v)}`); + throwInternalError(`Unexpected scope resolution ${printable(v)}`); } return result; }; @@ -90633,12 +90336,12 @@ var node = rootSchemaScope.node; var defineSchema = rootSchemaScope.defineSchema; var genericNode = rootSchemaScope.generic; -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/structure/shared.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/structure/shared.js var arrayIndexSource = `^(?:0|[1-9]\\d*)$`; var arrayIndexMatcher = new RegExp(arrayIndexSource); var arrayIndexMatcherReference = registeredReference(arrayIndexMatcher); -// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/intrinsic.js +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/intrinsic.js var intrinsicBases = schemaScope({ bigint: "bigint", // since we know this won't be reduced, it can be safely cast to a union @@ -90692,15 +90395,15 @@ var intrinsic = { }; $ark.intrinsic = { ...intrinsic }; -// node_modules/.pnpm/arkregex@0.0.4/node_modules/arkregex/out/regex.js +// node_modules/.pnpm/arkregex@0.0.2/node_modules/arkregex/out/regex.js var regex = ((src, flags) => new RegExp(src, flags)); Object.assign(regex, { as: regex }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/config.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/config.js var configure = configureSchema; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operand/date.js -var isDateLiteral = (value2) => typeof value2 === "string" && value2[0] === "d" && (value2[1] === "'" || value2[1] === '"') && value2[value2.length - 1] === value2[1]; +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operand/date.js +var isDateLiteral = (value2) => typeof value2 === "string" && value2[0] === "d" && (value2[1] === "'" || value2[1] === '"') && value2.at(-1) === value2[1]; var isValidDate = (d) => d.toString() !== "Invalid Date"; var extractDateLiteralSource = (literal) => literal.slice(2, -1); var writeInvalidDateMessage = (source) => `'${source}' could not be parsed by the Date constructor`; @@ -90715,42 +90418,26 @@ var maybeParseDate = (source, errorOnFail) => { if (isValidDate(numberParsedDate)) return numberParsedDate; } - return errorOnFail ? throwParseError2(errorOnFail === true ? writeInvalidDateMessage(source) : errorOnFail) : void 0; + return errorOnFail ? throwParseError(errorOnFail === true ? writeInvalidDateMessage(source) : errorOnFail) : void 0; }; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operand/enclosed.js -var regexExecArray = rootSchema({ - proto: "Array", - sequence: "string", - required: { - key: "groups", - value: ["object", { unit: void 0 }] - } -}); +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operand/enclosed.js var parseEnclosed = (s, enclosing) => { const enclosed = s.scanner.shiftUntilEscapable(untilLookaheadIsClosing[enclosingTokens[enclosing]]); if (s.scanner.lookahead === "") return s.error(writeUnterminatedEnclosedMessage(enclosed, enclosing)); s.scanner.shift(); - if (enclosing in enclosingRegexTokens) { - let regex3; + if (enclosing === "/") { try { - regex3 = new RegExp(enclosed); + new RegExp(enclosed); } catch (e) { - throwParseError2(String(e)); + throwParseError(String(e)); } s.root = s.ctx.$.node("intersection", { domain: "string", pattern: enclosed }, { prereduced: true }); - if (enclosing === "x/") { - s.root = s.ctx.$.node("morph", { - in: s.root, - morphs: (s2) => regex3.exec(s2), - declaredOut: regexExecArray - }); - } - } else if (isKeyOf2(enclosing, enclosingQuote)) + } else if (isKeyOf(enclosing, enclosingQuote)) s.root = s.ctx.$.node("unit", { unit: enclosed }); else { const date2 = tryParseDate(enclosed, writeInvalidDateMessage(enclosed)); @@ -90772,13 +90459,9 @@ var enclosingLiteralTokens = { "'": "'", '"': '"' }; -var enclosingRegexTokens = { - "/": "/", - "x/": "/" -}; var enclosingTokens = { ...enclosingLiteralTokens, - ...enclosingRegexTokens + "/": "/" }; var untilLookaheadIsClosing = { "'": (scanner) => scanner.lookahead === `'`, @@ -90792,12 +90475,12 @@ var enclosingCharDescriptions = { }; var writeUnterminatedEnclosedMessage = (fragment, enclosingStart) => `${enclosingStart}${fragment} requires a closing ${enclosingCharDescriptions[enclosingTokens[enclosingStart]]}`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/ast/validate.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/ast/validate.js var writePrefixedPrivateReferenceMessage = (name) => `Private type references should not include '#'. Use '${name}' instead.`; var shallowOptionalMessage = "Optional definitions like 'string?' are only valid as properties in an object or tuple"; var shallowDefaultableMessage = "Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple"; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/tokens.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/tokens.js var terminatingChars = { "<": 1, ">": 1, @@ -90811,15 +90494,15 @@ var terminatingChars = { ":": 1, "?": 1, "#": 1, - ...whitespaceChars2 + ...whitespaceChars }; var lookaheadIsFinalizing = (lookahead, unscanned) => lookahead === ">" ? unscanned[0] === "=" ? ( // >== would only occur in an expression like Array==5 // otherwise, >= would only occur as part of a bound like number>=5 unscanned[1] === "=" -) : unscanned.trimStart() === "" || isKeyOf2(unscanned.trimStart()[0], terminatingChars) : lookahead === "=" ? unscanned[0] !== "=" : lookahead === "," || lookahead === "?"; +) : unscanned.trimStart() === "" || isKeyOf(unscanned.trimStart()[0], terminatingChars) : lookahead === "=" ? unscanned[0] !== "=" : lookahead === "," || lookahead === "?"; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operand/genericArgs.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operand/genericArgs.js var parseGenericArgs = (name, g, s) => _parseGenericArgs(name, g, s, []); var _parseGenericArgs = (name, g, s, argNodes) => { const argState = s.parseUntilFinalizer(); @@ -90836,7 +90519,7 @@ var _parseGenericArgs = (name, g, s, argNodes) => { }; var writeInvalidGenericArgCountMessage = (name, params, argDefs) => `${name}<${params.join(", ")}> requires exactly ${params.length} args (got ${argDefs.length}${argDefs.length === 0 ? "" : `: ${argDefs.join(", ")}`})`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operand/unenclosed.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operand/unenclosed.js var parseUnenclosed = (s) => { const token = s.scanner.shiftUntilLookahead(terminatingChars); if (token === "keyof") @@ -90852,7 +90535,7 @@ var parseGenericInstantiation = (name, g, s) => { const parsedArgs = parseGenericArgs(name, g, s); return g(...parsedArgs); }; -var unenclosedToNode = (s, token) => maybeParseReference(s, token) ?? maybeParseUnenclosedLiteral(s, token) ?? s.error(token === "" ? s.scanner.lookahead === "#" ? writePrefixedPrivateReferenceMessage(s.shiftedBy(1).scanner.shiftUntilLookahead(terminatingChars)) : writeMissingOperandMessage(s) : writeUnresolvableMessage(token)); +var unenclosedToNode = (s, token) => maybeParseReference(s, token) ?? maybeParseUnenclosedLiteral(s, token) ?? s.error(token === "" ? s.scanner.lookahead === "#" ? writePrefixedPrivateReferenceMessage(s.shiftedByOne().scanner.shiftUntilLookahead(terminatingChars)) : writeMissingOperandMessage(s) : writeUnresolvableMessage(token)); var maybeParseReference = (s, token) => { if (s.ctx.args?.[token]) { const arg = s.ctx.args[token]; @@ -90867,7 +90550,7 @@ var maybeParseReference = (s, token) => { return; if (hasArkKind(resolution, "generic")) return parseGenericInstantiation(token, resolution, s); - return throwParseError2(`Unexpected resolution ${printable2(resolution)}`); + return throwParseError(`Unexpected resolution ${printable(resolution)}`); }; var maybeParseUnenclosedLiteral = (s, token) => { const maybeNumber = tryParseWellFormedNumber(token); @@ -90884,10 +90567,10 @@ var writeMissingOperandMessage = (s) => { var writeMissingRightOperandMessage = (token, unscanned = "") => `Token '${token}' requires a right operand${unscanned ? ` before '${unscanned}'` : ""}`; var writeExpressionExpectedMessage = (unscanned) => `Expected an expression${unscanned ? ` before '${unscanned}'` : ""}`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operand/operand.js -var parseOperand = (s) => s.scanner.lookahead === "" ? s.error(writeMissingOperandMessage(s)) : s.scanner.lookahead === "(" ? s.shiftedBy(1).reduceGroupOpen() : s.scanner.lookaheadIsIn(enclosingChar) ? parseEnclosed(s, s.scanner.shift()) : s.scanner.lookaheadIsIn(whitespaceChars2) ? parseOperand(s.shiftedBy(1)) : s.scanner.lookahead === "d" ? s.scanner.nextLookahead in enclosingQuote ? parseEnclosed(s, `${s.scanner.shift()}${s.scanner.shift()}`) : parseUnenclosed(s) : s.scanner.lookahead === "x" ? s.scanner.nextLookahead === "/" ? s.shiftedBy(2) && parseEnclosed(s, "x/") : parseUnenclosed(s) : parseUnenclosed(s); +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operand/operand.js +var parseOperand = (s) => s.scanner.lookahead === "" ? s.error(writeMissingOperandMessage(s)) : s.scanner.lookahead === "(" ? s.shiftedByOne().reduceGroupOpen() : s.scanner.lookaheadIsIn(enclosingChar) ? parseEnclosed(s, s.scanner.shift()) : s.scanner.lookaheadIsIn(whitespaceChars) ? parseOperand(s.shiftedByOne()) : s.scanner.lookahead === "d" ? s.scanner.nextLookahead in enclosingQuote ? parseEnclosed(s, `${s.scanner.shift()}${s.scanner.shift()}`) : parseUnenclosed(s) : parseUnenclosed(s); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/reduce/shared.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/reduce/shared.js var minComparators = { ">": true, ">=": true @@ -90907,7 +90590,7 @@ var writeOpenRangeMessage = (min, comparator) => `Left bounds are only valid whe var writeUnpairableComparatorMessage = (comparator) => `Left-bounded expressions must specify their limits using < or <= (was ${comparator})`; var writeMultipleLeftBoundsMessage = (openLimit, openComparator, limit, comparator) => `An expression may have at most one left bound (parsed ${openLimit}${invertedComparators[openComparator]}, ${limit}${invertedComparators[comparator]})`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operator/bounds.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operator/bounds.js var parseBound = (s, start) => { const comparator = shiftComparator(s, start); if (s.root.hasKind("unit")) { @@ -90934,20 +90617,20 @@ var shiftComparator = (s, start) => s.scanner.lookaheadIs("=") ? `${start}${s.sc var getBoundKinds = (comparator, limit, root2, boundKind) => { if (root2.extends($ark.intrinsic.number)) { if (typeof limit !== "number") { - return throwParseError2(writeInvalidLimitMessage(comparator, limit, boundKind)); + return throwParseError(writeInvalidLimitMessage(comparator, limit, boundKind)); } return comparator === "==" ? ["min", "max"] : comparator[0] === ">" ? ["min"] : ["max"]; } if (root2.extends($ark.intrinsic.lengthBoundable)) { if (typeof limit !== "number") { - return throwParseError2(writeInvalidLimitMessage(comparator, limit, boundKind)); + return throwParseError(writeInvalidLimitMessage(comparator, limit, boundKind)); } return comparator === "==" ? ["exactLength"] : comparator[0] === ">" ? ["minLength"] : ["maxLength"]; } if (root2.extends($ark.intrinsic.Date)) { return comparator === "==" ? ["after", "before"] : comparator[0] === ">" ? ["after"] : ["before"]; } - return throwParseError2(writeUnboundableMessage(root2.expression)); + return throwParseError(writeUnboundableMessage(root2.expression)); }; var openLeftBoundToRoot = (leftBound) => ({ rule: isDateLiteral(leftBound.limit) ? extractDateLiteralSource(leftBound.limit) : leftBound.limit, @@ -90970,7 +90653,7 @@ var parseRightBound = (s, comparator) => { } if (!s.branches.leftBound) return; - if (!isKeyOf2(comparator, maxComparators)) + if (!isKeyOf(comparator, maxComparators)) return s.error(writeUnpairableComparatorMessage(comparator)); const lowerBoundKind = getBoundKinds(s.branches.leftBound.comparator, s.branches.leftBound.limit, previousRoot, "left"); s.constrainRoot(lowerBoundKind[0], openLeftBoundToRoot(s.branches.leftBound)); @@ -90978,14 +90661,14 @@ var parseRightBound = (s, comparator) => { }; var writeInvalidLimitMessage = (comparator, limit, boundKind) => `Comparator ${boundKind === "left" ? invertedComparators[comparator] : comparator} must be ${boundKind === "left" ? "preceded" : "followed"} by a corresponding literal (was ${limit})`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operator/brand.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operator/brand.js var parseBrand = (s) => { s.scanner.shiftUntilNonWhitespace(); const brandName = s.scanner.shiftUntilLookahead(terminatingChars); s.root = s.root.brand(brandName); }; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operator/divisor.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operator/divisor.js var parseDivisor = (s) => { s.scanner.shiftUntilNonWhitespace(); const divisorToken = s.scanner.shiftUntilLookahead(terminatingChars); @@ -90998,15 +90681,15 @@ var parseDivisor = (s) => { }; var writeInvalidDivisorMessage = (divisor) => `% operator must be followed by a non-zero integer literal (was ${divisor})`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operator/operator.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operator/operator.js var parseOperator = (s) => { const lookahead = s.scanner.shift(); - return lookahead === "" ? s.finalize("") : lookahead === "[" ? s.scanner.shift() === "]" ? s.setRoot(s.root.array()) : s.error(incompleteArrayTokenMessage) : lookahead === "|" ? s.scanner.lookahead === ">" ? s.shiftedBy(1).pushRootToBranch("|>") : s.pushRootToBranch(lookahead) : lookahead === "&" ? s.pushRootToBranch(lookahead) : lookahead === ")" ? s.finalizeGroup() : lookaheadIsFinalizing(lookahead, s.scanner.unscanned) ? s.finalize(lookahead) : isKeyOf2(lookahead, comparatorStartChars) ? parseBound(s, lookahead) : lookahead === "%" ? parseDivisor(s) : lookahead === "#" ? parseBrand(s) : lookahead in whitespaceChars2 ? parseOperator(s) : s.error(writeUnexpectedCharacterMessage(lookahead)); + return lookahead === "" ? s.finalize("") : lookahead === "[" ? s.scanner.shift() === "]" ? s.setRoot(s.root.array()) : s.error(incompleteArrayTokenMessage) : lookahead === "|" ? s.scanner.lookahead === ">" ? s.shiftedByOne().pushRootToBranch("|>") : s.pushRootToBranch(lookahead) : lookahead === "&" ? s.pushRootToBranch(lookahead) : lookahead === ")" ? s.finalizeGroup() : lookaheadIsFinalizing(lookahead, s.scanner.unscanned) ? s.finalize(lookahead) : isKeyOf(lookahead, comparatorStartChars) ? parseBound(s, lookahead) : lookahead === "%" ? parseDivisor(s) : lookahead === "#" ? parseBrand(s) : lookahead in whitespaceChars ? parseOperator(s) : s.error(writeUnexpectedCharacterMessage(lookahead)); }; var writeUnexpectedCharacterMessage = (char, shouldBe = "") => `'${char}' is not allowed here${shouldBe && ` (should be ${shouldBe})`}`; var incompleteArrayTokenMessage = `Missing expected ']'`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/shift/operator/default.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/shift/operator/default.js var parseDefault = (s) => { const baseNode = s.unsetRoot(); s.parseOperand(); @@ -91018,7 +90701,7 @@ var parseDefault = (s) => { }; var writeNonLiteralDefaultMessage = (defaultDef) => `Default value '${defaultDef}' must be a literal value`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/string.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/string.js var parseString = (def, ctx) => { const aliasResolution = ctx.$.maybeResolveRoot(def); if (aliasResolution) @@ -91031,14 +90714,14 @@ var parseString = (def, ctx) => { const s = new RuntimeState(new Scanner(def), ctx); const node2 = fullStringParse(s); if (s.finalizer === ">") - throwParseError2(writeUnexpectedCharacterMessage(">")); + throwParseError(writeUnexpectedCharacterMessage(">")); return node2; }; var fullStringParse = (s) => { s.parseOperand(); let result = parseUntilFinalizer(s).root; if (!result) { - return throwInternalError2(`Root was unexpectedly unset after parsing string '${s.scanner.scanned}'`); + return throwInternalError(`Root was unexpectedly unset after parsing string '${s.scanner.scanned}'`); } if (s.finalizer === "=") result = parseDefault(s); @@ -91046,7 +90729,7 @@ var fullStringParse = (s) => { result = [result, "?"]; s.scanner.shiftUntilNonWhitespace(); if (s.scanner.lookahead) { - throwParseError2(writeUnexpectedCharacterMessage(s.scanner.lookahead)); + throwParseError(writeUnexpectedCharacterMessage(s.scanner.lookahead)); } return result; }; @@ -91057,7 +90740,7 @@ var parseUntilFinalizer = (s) => { }; var next = (s) => s.hasRoot() ? s.parseOperator() : s.parseOperand(); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/reduce/dynamic.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/reduce/dynamic.js var RuntimeState = class _RuntimeState { root; branches = { @@ -91076,7 +90759,7 @@ var RuntimeState = class _RuntimeState { this.ctx = ctx; } error(message) { - return throwParseError2(message); + return throwParseError(message); } hasRoot() { return this.root !== void 0; @@ -91089,8 +90772,8 @@ var RuntimeState = class _RuntimeState { this.root = void 0; return value2; } - constrainRoot(...args3) { - this.root = this.root.constrain(args3[0], args3[1]); + constrainRoot(...args2) { + this.root = this.root.constrain(args2[0], args2[1]); } finalize(finalizer) { if (this.groups.length) @@ -91100,7 +90783,7 @@ var RuntimeState = class _RuntimeState { } reduceLeftBound(limit, comparator) { const invertedComparator = invertedComparators[comparator]; - if (!isKeyOf2(invertedComparator, minComparators)) + if (!isKeyOf(invertedComparator, minComparators)) return this.error(writeUnpairableComparatorMessage(comparator)); if (this.branches.leftBound) { return this.error(writeMultipleLeftBoundsMessage(this.branches.leftBound.limit, this.branches.leftBound.comparator, limit, invertedComparator)); @@ -91143,7 +90826,7 @@ var RuntimeState = class _RuntimeState { applyPrefixes() { while (this.branches.prefixes.length) { const lastPrefix = this.branches.prefixes.pop(); - this.root = lastPrefix === "keyof" ? this.root.keyof() : throwInternalError2(`Unexpected prefix '${lastPrefix}'`); + this.root = lastPrefix === "keyof" ? this.root.keyof() : throwInternalError(`Unexpected prefix '${lastPrefix}'`); } } pushRootToBranch(token) { @@ -91186,15 +90869,15 @@ var RuntimeState = class _RuntimeState { }; } previousOperator() { - return this.branches.leftBound?.comparator ?? this.branches.prefixes[this.branches.prefixes.length - 1] ?? (this.branches.intersection ? "&" : this.branches.union ? "|" : this.branches.pipe ? "|>" : void 0); + return this.branches.leftBound?.comparator ?? this.branches.prefixes.at(-1) ?? (this.branches.intersection ? "&" : this.branches.union ? "|" : this.branches.pipe ? "|>" : void 0); } - shiftedBy(count) { - this.scanner.jumpForward(count); + shiftedByOne() { + this.scanner.shift(); return this; } }; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/generic.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/generic.js var emptyGenericParameterMessage = "An empty string is not a valid generic parameter name"; var parseGenericParamName = (scanner, result, ctx) => { scanner.shiftUntilNonWhitespace(); @@ -91202,7 +90885,7 @@ var parseGenericParamName = (scanner, result, ctx) => { if (name === "") { if (scanner.lookahead === "" && result.length) return result; - return throwParseError2(emptyGenericParameterMessage); + return throwParseError(emptyGenericParameterMessage); } scanner.shiftUntilNonWhitespace(); return _parseOptionalConstraint(scanner, name, result, ctx); @@ -91223,7 +90906,7 @@ var _parseOptionalConstraint = (scanner, name, result, ctx) => { return parseGenericParamName(scanner, result, ctx); }; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/fn.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/fn.js var InternalFnParser = class extends Callable { constructor($2) { const attach = { @@ -91238,7 +90921,7 @@ var InternalFnParser = class extends Callable { let returnType = $2.intrinsic.unknown; if (returnOperatorIndex !== -1) { if (returnOperatorIndex !== signature.length - 2) - return throwParseError2(badFnReturnTypeMessage); + return throwParseError(badFnReturnTypeMessage); returnType = $2.parse(signature[returnOperatorIndex + 1]); } return (impl) => new InternalTypedFn(impl, paramTuple, returnType); @@ -91254,8 +90937,8 @@ var InternalTypedFn = class extends Callable { const typedName = `typed ${raw.name}`; const typed = { // assign to a key with the expected name to force it to be created that way - [typedName]: (...args3) => { - const validatedArgs = params.assert(args3); + [typedName]: (...args2) => { + const validatedArgs = params.assert(args2); const returned = raw(...validatedArgs); return returns.assert(returned); } @@ -91265,7 +90948,7 @@ var InternalTypedFn = class extends Callable { this.params = params; this.returns = returns; let argsExpression = params.expression; - if (argsExpression[0] === "[" && argsExpression[argsExpression.length - 1] === "]") + if (argsExpression[0] === "[" && argsExpression.at(-1) === "]") argsExpression = argsExpression.slice(1, -1); else if (argsExpression.endsWith("[]")) argsExpression = `...${argsExpression}`; @@ -91275,11 +90958,11 @@ var InternalTypedFn = class extends Callable { var badFnReturnTypeMessage = `":" must be followed by exactly one return type e.g: fn("string", ":", "number")(s => s.length)`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/match.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/match.js var InternalMatchParser = class extends Callable { $; constructor($2) { - super((...args3) => new InternalChainedMatchParser($2)(...args3), { + super((...args2) => new InternalChainedMatchParser($2)(...args2), { bind: $2 }); this.$ = $2; @@ -91306,9 +90989,9 @@ var InternalChainedMatchParser = class extends Callable { } at(key, cases) { if (this.key) - throwParseError2(doubleAtMessage); + throwParseError(doubleAtMessage); if (this.branches.length) - throwParseError2(chainedAtMessage); + throwParseError(chainedAtMessage); this.key = key; return cases ? this.match(cases) : this; } @@ -91332,12 +91015,12 @@ var InternalChainedMatchParser = class extends Callable { const [k, v] = entries[i]; if (k === "default") { if (i !== entries.length - 1) { - throwParseError2(`default may only be specified as the last key of a switch definition`); + throwParseError(`default may only be specified as the last key of a switch definition`); } return this.default(v); } if (typeof v !== "function") { - return throwParseError2(`Value for case "${k}" must be a function (was ${domainOf2(v)})`); + return throwParseError(`Value for case "${k}" must be a function (was ${domainOf(v)})`); } this.caseEntry(k, v); } @@ -91368,7 +91051,7 @@ var throwOnDefault = (errors) => errors.throw(); var chainedAtMessage = `A key matcher must be specified before the first case i.e. match.at('foo') or match.in().at('bar')`; var doubleAtMessage = `At most one key matcher may be specified per expression`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/property.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/property.js var parseProperty = (def, ctx) => { if (isArray(def)) { if (def[1] === "=") @@ -91381,29 +91064,29 @@ var parseProperty = (def, ctx) => { var invalidOptionalKeyKindMessage = `Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }`; var invalidDefaultableKeyKindMessage = `Only required keys may specify default values, e.g. { value: 'number = 0' }`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/objectLiteral.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/objectLiteral.js var parseObjectLiteral = (def, ctx) => { let spread; const structure = {}; - const defEntries = stringAndSymbolicEntriesOf2(def); + const defEntries = stringAndSymbolicEntriesOf(def); for (const [k, v] of defEntries) { const parsedKey = preparseKey(k); if (parsedKey.kind === "spread") { - if (!isEmptyObject2(structure)) - return throwParseError2(nonLeadingSpreadError); + if (!isEmptyObject(structure)) + return throwParseError(nonLeadingSpreadError); const operand = ctx.$.parseOwnDefinitionFormat(v, ctx); if (operand.equals(intrinsic.object)) continue; if (!operand.hasKind("intersection") || // still error on attempts to spread proto nodes like ...Date !operand.basis?.equals(intrinsic.object)) { - return throwParseError2(writeInvalidSpreadTypeMessage(operand.expression)); + return throwParseError(writeInvalidSpreadTypeMessage(operand.expression)); } spread = operand.structure; continue; } if (parsedKey.kind === "undeclared") { if (v !== "reject" && v !== "delete" && v !== "ignore") - throwParseError2(writeInvalidUndeclaredBehaviorMessage(v)); + throwParseError(writeInvalidUndeclaredBehaviorMessage(v)); structure.undeclared = v; continue; } @@ -91429,9 +91112,9 @@ var parseObjectLiteral = (def, ctx) => { } if (isArray(parsedValue)) { if (parsedValue[1] === "?") - throwParseError2(invalidOptionalKeyKindMessage); + throwParseError(invalidOptionalKeyKindMessage); if (parsedValue[1] === "=") - throwParseError2(invalidDefaultableKeyKindMessage); + throwParseError(invalidDefaultableKeyKindMessage); } if (parsedKey.kind === "optional") { appendNamedProp(structure, "optional", { @@ -91443,9 +91126,9 @@ var parseObjectLiteral = (def, ctx) => { const signature = ctx.$.parseOwnDefinitionFormat(parsedEntryKey.normalized, ctx); const normalized = normalizeIndex(signature, parsedValue, ctx.$); if (normalized.index) - structure.index = append2(structure.index, normalized.index); + structure.index = append(structure.index, normalized.index); if (normalized.required) - structure.required = append2(structure.required, normalized.required); + structure.required = append(structure.required, normalized.required); } const structureNode = ctx.$.node("structure", structure); return ctx.$.parseSchema({ @@ -91454,29 +91137,29 @@ var parseObjectLiteral = (def, ctx) => { }); }; var appendNamedProp = (structure, kind, inner, ctx) => { - structure[kind] = append2( + structure[kind] = append( // doesn't seem like this cast should be necessary structure[kind], ctx.$.node(kind, inner) ); }; -var writeInvalidUndeclaredBehaviorMessage = (actual) => `Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${printable2(actual)})`; +var writeInvalidUndeclaredBehaviorMessage = (actual) => `Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${printable(actual)})`; var nonLeadingSpreadError = "Spread operator may only be used as the first key in an object"; -var preparseKey = (key) => typeof key === "symbol" ? { kind: "required", normalized: key } : key[key.length - 1] === "?" ? key[key.length - 2] === Backslash2 ? { kind: "required", normalized: `${key.slice(0, -2)}?` } : { +var preparseKey = (key) => typeof key === "symbol" ? { kind: "required", normalized: key } : key.at(-1) === "?" ? key.at(-2) === Backslash ? { kind: "required", normalized: `${key.slice(0, -2)}?` } : { kind: "optional", normalized: key.slice(0, -1) -} : key[0] === "[" && key[key.length - 1] === "]" ? { kind: "index", normalized: key.slice(1, -1) } : key[0] === Backslash2 && key[1] === "[" && key[key.length - 1] === "]" ? { kind: "required", normalized: key.slice(1) } : key === "..." ? { kind: "spread" } : key === "+" ? { kind: "undeclared" } : { +} : key[0] === "[" && key.at(-1) === "]" ? { kind: "index", normalized: key.slice(1, -1) } : key[0] === Backslash && key[1] === "[" && key.at(-1) === "]" ? { kind: "required", normalized: key.slice(1) } : key === "..." ? { kind: "spread" } : key === "+" ? { kind: "undeclared" } : { kind: "required", normalized: key === "\\..." ? "..." : key === "\\+" ? "+" : key }; var writeInvalidSpreadTypeMessage = (def) => `Spread operand must resolve to an object literal type (was ${def})`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/tupleExpressions.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/tupleExpressions.js var maybeParseTupleExpression = (def, ctx) => isIndexZeroExpression(def) ? indexZeroParsers[def[0]](def, ctx) : isIndexOneExpression(def) ? indexOneParsers[def[1]](def, ctx) : null; var parseKeyOfTuple = (def, ctx) => ctx.$.parseOwnDefinitionFormat(def[1], ctx).keyof(); var parseBranchTuple = (def, ctx) => { if (def[2] === void 0) - return throwParseError2(writeMissingRightOperandMessage(def[1], "")); + return throwParseError(writeMissingRightOperandMessage(def[1], "")); const l = ctx.$.parseOwnDefinitionFormat(def[0], ctx); const r = ctx.$.parseOwnDefinitionFormat(def[2], ctx); if (def[1] === "|") @@ -91489,14 +91172,14 @@ var parseBranchTuple = (def, ctx) => { var parseArrayTuple = (def, ctx) => ctx.$.parseOwnDefinitionFormat(def[0], ctx).array(); var parseMorphTuple = (def, ctx) => { if (typeof def[2] !== "function") { - return throwParseError2(writeMalformedFunctionalExpressionMessage("=>", def[2])); + return throwParseError(writeMalformedFunctionalExpressionMessage("=>", def[2])); } return ctx.$.parseOwnDefinitionFormat(def[0], ctx).pipe(def[2]); }; var writeMalformedFunctionalExpressionMessage = (operator, value2) => `${operator === ":" ? "Narrow" : "Morph"} expression requires a function following '${operator}' (was ${typeof value2})`; var parseNarrowTuple = (def, ctx) => { if (typeof def[2] !== "function") { - return throwParseError2(writeMalformedFunctionalExpressionMessage(":", def[2])); + return throwParseError(writeMalformedFunctionalExpressionMessage(":", def[2])); } return ctx.$.parseOwnDefinitionFormat(def[0], ctx).constrain("predicate", def[2]); }; @@ -91504,7 +91187,7 @@ var parseMetaTuple = (def, ctx) => ctx.$.parseOwnDefinitionFormat(def[0], ctx).c var defineIndexOneParsers = (parsers) => parsers; var postfixParsers = defineIndexOneParsers({ "[]": parseArrayTuple, - "?": () => throwParseError2(shallowOptionalMessage) + "?": () => throwParseError(shallowOptionalMessage) }); var infixParsers = defineIndexOneParsers({ "|": parseBranchTuple, @@ -91515,7 +91198,7 @@ var infixParsers = defineIndexOneParsers({ "@": parseMetaTuple, // since object and tuple literals parse there via `parseProperty`, // they must be shallow if parsed directly as a tuple expression - "=": () => throwParseError2(shallowDefaultableMessage) + "=": () => throwParseError(shallowDefaultableMessage) }); var indexOneParsers = { ...postfixParsers, ...infixParsers }; var isIndexOneExpression = (def) => indexOneParsers[def[1]] !== void 0; @@ -91524,9 +91207,9 @@ var indexZeroParsers = defineIndexZeroParsers({ keyof: parseKeyOfTuple, instanceof: (def, ctx) => { if (typeof def[1] !== "function") { - return throwParseError2(writeInvalidConstructorMessage(objectKindOrDomainOf(def[1]))); + return throwParseError(writeInvalidConstructorMessage(objectKindOrDomainOf(def[1]))); } - const branches = def.slice(1).map((ctor) => typeof ctor === "function" ? ctx.$.node("proto", { proto: ctor }) : throwParseError2(writeInvalidConstructorMessage(objectKindOrDomainOf(ctor)))); + const branches = def.slice(1).map((ctor) => typeof ctor === "function" ? ctx.$.node("proto", { proto: ctor }) : throwParseError(writeInvalidConstructorMessage(objectKindOrDomainOf(ctor)))); return branches.length === 1 ? branches[0] : ctx.$.node("union", { branches }); }, "===": (def, ctx) => ctx.$.units(def.slice(1)) @@ -91534,7 +91217,7 @@ var indexZeroParsers = defineIndexZeroParsers({ var isIndexZeroExpression = (def) => indexZeroParsers[def[0]] !== void 0; var writeInvalidConstructorMessage = (actual) => `Expected a constructor following 'instanceof' operator (was ${actual})`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/tupleLiteral.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/tupleLiteral.js var parseTupleLiteral = (def, ctx) => { let sequences = [{}]; let i = 0; @@ -91549,7 +91232,7 @@ var parseTupleLiteral = (def, ctx) => { i++; if (spread) { if (!valueNode.extends($ark.intrinsic.Array)) - return throwParseError2(writeNonArraySpreadMessage(valueNode.expression)); + return throwParseError(writeNonArraySpreadMessage(valueNode.expression)); sequences = sequences.flatMap((base) => ( // since appendElement mutates base, we have to shallow-ish clone it for each branch valueNode.distribute((branch) => appendSpreadBranch(makeRootAndArrayPropertiesMutable(base), branch)) @@ -91564,7 +91247,7 @@ var parseTupleLiteral = (def, ctx) => { }); } } - return ctx.$.parseSchema(sequences.map((sequence) => isEmptyObject2(sequence) ? { + return ctx.$.parseSchema(sequences.map((sequence) => isEmptyObject(sequence) ? { proto: Array, exactLength: 0 } : { @@ -91574,38 +91257,38 @@ var parseTupleLiteral = (def, ctx) => { }; var appendRequiredElement = (base, element) => { if (base.defaultables || base.optionals) { - return throwParseError2(base.variadic ? ( + return throwParseError(base.variadic ? ( // e.g. [boolean = true, ...string[], number] postfixAfterOptionalOrDefaultableMessage ) : requiredPostOptionalMessage); } if (base.variadic) { - base.postfix = append2(base.postfix, element); + base.postfix = append(base.postfix, element); } else { - base.prefix = append2(base.prefix, element); + base.prefix = append(base.prefix, element); } return base; }; var appendOptionalElement = (base, element) => { if (base.variadic) - return throwParseError2(optionalOrDefaultableAfterVariadicMessage); - base.optionals = append2(base.optionals, element); + return throwParseError(optionalOrDefaultableAfterVariadicMessage); + base.optionals = append(base.optionals, element); return base; }; var appendDefaultableElement = (base, element, value2) => { if (base.variadic) - return throwParseError2(optionalOrDefaultableAfterVariadicMessage); + return throwParseError(optionalOrDefaultableAfterVariadicMessage); if (base.optionals) - return throwParseError2(defaultablePostOptionalMessage); - base.defaultables = append2(base.defaultables, [[element, value2]]); + return throwParseError(defaultablePostOptionalMessage); + base.defaultables = append(base.defaultables, [[element, value2]]); return base; }; var appendVariadicElement = (base, element) => { if (base.postfix) - throwParseError2(multipleVariadicMesage); + throwParseError(multipleVariadicMesage); if (base.variadic) { if (!base.variadic.equals(element)) { - throwParseError2(multipleVariadicMesage); + throwParseError(multipleVariadicMesage); } } else { base.variadic = element.internal; @@ -91636,7 +91319,7 @@ var requiredPostOptionalMessage = "A required element may not follow an optional var optionalOrDefaultableAfterVariadicMessage = "An optional element may not follow a variadic element"; var defaultablePostOptionalMessage = "A defaultable element may not follow an optional element without a default"; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/parser/definition.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/definition.js var parseCache = {}; var parseInnerDefinition = (def, ctx) => { if (typeof def === "string") { @@ -91646,16 +91329,14 @@ var parseInnerDefinition = (def, ctx) => { const scopeCache = parseCache[ctx.$.name] ??= {}; return scopeCache[def] ??= parseString(def, ctx); } - return hasDomain2(def, "object") ? parseObject(def, ctx) : throwParseError2(writeBadDefinitionTypeMessage(domainOf2(def))); + return hasDomain(def, "object") ? parseObject(def, ctx) : throwParseError(writeBadDefinitionTypeMessage(domainOf(def))); }; var parseObject = (def, ctx) => { - const objectKind = objectKindOf2(def); + const objectKind = objectKindOf(def); switch (objectKind) { case void 0: if (hasArkKind(def, "root")) return def; - if ("~standard" in def) - return parseStandardSchema(def, ctx); return parseObjectLiteral(def, ctx); case "Array": return parseTuple(def, ctx); @@ -91668,39 +91349,16 @@ var parseObject = (def, ctx) => { const resolvedDef = isThunk(def) ? def() : def; if (hasArkKind(resolvedDef, "root")) return resolvedDef; - return throwParseError2(writeBadDefinitionTypeMessage("Function")); + return throwParseError(writeBadDefinitionTypeMessage("Function")); } default: - return throwParseError2(writeBadDefinitionTypeMessage(objectKind ?? printable2(def))); + return throwParseError(writeBadDefinitionTypeMessage(objectKind ?? printable(def))); } }; -var parseStandardSchema = (def, ctx) => ctx.$.intrinsic.unknown.pipe((v, ctx2) => { - const result = def["~standard"].validate(v); - if (!result.issues) - return result.value; - for (const { message, path: path3 } of result.issues) { - if (path3) { - if (path3.length) { - ctx2.error({ - problem: uncapitalize(message), - relativePath: path3.map((k) => typeof k === "object" ? k.key : k) - }); - } else { - ctx2.error({ - message - }); - } - } else { - ctx2.error({ - message - }); - } - } -}); var parseTuple = (def, ctx) => maybeParseTupleExpression(def, ctx) ?? parseTupleLiteral(def, ctx); var writeBadDefinitionTypeMessage = (actual) => `Type definitions must be strings or objects (was ${actual})`; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/type.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/type.js var InternalTypeParser = class extends Callable { constructor($2) { const attach = Object.assign( @@ -91731,29 +91389,29 @@ var InternalTypeParser = class extends Callable { // also won't be defined during bootstrapping $2.ambientAttachments ); - super((...args3) => { - if (args3.length === 1) { - return $2.parse(args3[0]); + super((...args2) => { + if (args2.length === 1) { + return $2.parse(args2[0]); } - if (args3.length === 2 && typeof args3[0] === "string" && args3[0][0] === "<" && args3[0][args3[0].length - 1] === ">") { - const paramString = args3[0].slice(1, -1); + if (args2.length === 2 && typeof args2[0] === "string" && args2[0][0] === "<" && args2[0].at(-1) === ">") { + const paramString = args2[0].slice(1, -1); const params = $2.parseGenericParams(paramString, {}); - return new GenericRoot(params, args3[1], $2, $2, null); + return new GenericRoot(params, args2[1], $2, $2, null); } - return $2.parse(args3); + return $2.parse(args2); }, { attach }); } }; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/scope.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/scope.js var $arkTypeRegistry = $ark; var InternalScope = class _InternalScope extends BaseScope { get ambientAttachments() { if (!$arkTypeRegistry.typeAttachments) return; - return this.cacheGetter("ambientAttachments", flatMorph2($arkTypeRegistry.typeAttachments, (k, v) => [ + return this.cacheGetter("ambientAttachments", flatMorph($arkTypeRegistry.typeAttachments, (k, v) => [ k, this.bindReference(v) ])); @@ -91769,8 +91427,8 @@ var InternalScope = class _InternalScope extends BaseScope { def = [def, "@", config2]; return [alias, def]; } - if (alias[alias.length - 1] !== ">") { - throwParseError2(`'>' must be the last character of a generic declaration in a scope`); + if (alias.at(-1) !== ">") { + throwParseError(`'>' must be the last character of a generic declaration in a scope`); } const name = alias.slice(0, firstParamIndex); const paramString = alias.slice(firstParamIndex + 1, -1); @@ -91811,9 +91469,9 @@ var InternalScope = class _InternalScope extends BaseScope { const result = parseInnerDefinition(def, ctx); if (isArray(result)) { if (result[1] === "=") - return throwParseError2(shallowDefaultableMessage); + return throwParseError(shallowDefaultableMessage); if (result[1] === "?") - return throwParseError2(shallowOptionalMessage); + return throwParseError(shallowOptionalMessage); } return result; } @@ -91842,21 +91500,21 @@ var scope = Object.assign(InternalScope.scope, { }); var Scope = InternalScope; -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/builtins.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/builtins.js var MergeHkt = class extends Hkt { description = 'merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'; }; -var Merge = genericNode(["base", intrinsic.object], ["props", intrinsic.object])((args3) => args3.base.merge(args3.props), MergeHkt); +var Merge = genericNode(["base", intrinsic.object], ["props", intrinsic.object])((args2) => args2.base.merge(args2.props), MergeHkt); var arkBuiltins = Scope.module({ Key: intrinsic.key, Merge }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/Array.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/Array.js var liftFromHkt = class extends Hkt { }; -var liftFrom = genericNode("element")((args3) => { - const nonArrayElement = args3.element.exclude(intrinsic.Array); +var liftFrom = genericNode("element")((args2) => { + const nonArrayElement = args2.element.exclude(intrinsic.Array); const lifted = nonArrayElement.array(); return nonArrayElement.rawOr(lifted).pipe(liftArray).distribute((branch) => branch.assertHasKind("morph").declareOut(lifted), rootSchema); }, liftFromHkt); @@ -91869,7 +91527,7 @@ var arkArray = Scope.module({ name: "Array" }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/FormData.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/FormData.js var value = rootSchema(["string", registry.FileConstructor]); var parsedFormDataValue = value.rawOr(value.array()); var parsed = rootSchema({ @@ -91906,7 +91564,7 @@ var arkFormData = Scope.module({ name: "FormData" }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/TypedArray.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/TypedArray.js var TypedArray = Scope.module({ Int8: ["instanceof", Int8Array], Uint8: ["instanceof", Uint8Array], @@ -91923,20 +91581,20 @@ var TypedArray = Scope.module({ name: "TypedArray" }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/constructors.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/constructors.js var omittedPrototypes = { Boolean: 1, Number: 1, String: 1 }; var arkPrototypes = Scope.module({ - ...flatMorph2({ ...ecmascriptConstructors2, ...platformConstructors2 }, (k, v) => k in omittedPrototypes ? [] : [k, ["instanceof", v]]), + ...flatMorph({ ...ecmascriptConstructors, ...platformConstructors }, (k, v) => k in omittedPrototypes ? [] : [k, ["instanceof", v]]), Array: arkArray, TypedArray, FormData: arkFormData }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/number.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/number.js var epoch = rootSchema({ domain: { domain: "number", @@ -91979,7 +91637,7 @@ var number = Scope.module({ name: "number" }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/string.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/string.js var regexStringNode = (regex3, description, jsonSchemaFormat) => { const schema2 = { domain: "string", @@ -91993,7 +91651,7 @@ var regexStringNode = (regex3, description, jsonSchemaFormat) => { schema2.meta = { format: jsonSchemaFormat }; return node("intersection", schema2); }; -var stringIntegerRoot = regexStringNode(wellFormedIntegerMatcher2, "a well-formed integer string"); +var stringIntegerRoot = regexStringNode(wellFormedIntegerMatcher, "a well-formed integer string"); var stringInteger = Scope.module({ root: stringIntegerRoot, parse: rootSchema({ @@ -92026,7 +91684,7 @@ var capitalize2 = Scope.module({ name: "string.capitalize" }); var isLuhnValid = (creditCardInput) => { - const sanitized = creditCardInput.replace(/[ -]+/g, ""); + const sanitized = creditCardInput.replaceAll(/[ -]+/g, ""); let sum = 0; let digit; let tmpNum; @@ -92201,7 +91859,7 @@ var lower = Scope.module({ name: "string.lower" }); var normalizedForms = ["NFC", "NFD", "NFKC", "NFKD"]; -var preformattedNodes = flatMorph2(normalizedForms, (i, form) => [ +var preformattedNodes = flatMorph(normalizedForms, (i, form) => [ form, rootSchema({ domain: "string", @@ -92209,7 +91867,7 @@ var preformattedNodes = flatMorph2(normalizedForms, (i, form) => [ meta: `${form}-normalized unicode` }) ]); -var normalizeNodes = flatMorph2(normalizedForms, (i, form) => [ +var normalizeNodes = flatMorph(normalizedForms, (i, form) => [ form, rootSchema({ in: "string", @@ -92250,7 +91908,7 @@ var normalize = Scope.module({ }, { name: "string.normalize" }); -var numericRoot = regexStringNode(numericStringMatcher2, "a well-formed numeric string"); +var numericRoot = regexStringNode(numericStringMatcher, "a well-formed numeric string"); var stringNumeric = Scope.module({ root: numericRoot, parse: rootSchema({ @@ -92386,7 +92044,7 @@ var string = Scope.module({ name: "string" }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/ts.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/ts.js var arkTsKeywords = Scope.module({ bigint: intrinsic.bigint, boolean: intrinsic.boolean, @@ -92426,37 +92084,37 @@ var object = Scope.module({ var RecordHkt = class extends Hkt { description = 'instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'; }; -var Record = genericNode(["K", intrinsic.key], "V")((args3) => ({ +var Record = genericNode(["K", intrinsic.key], "V")((args2) => ({ domain: "object", index: { - signature: args3.K, - value: args3.V + signature: args2.K, + value: args2.V } }), RecordHkt); var PickHkt = class extends Hkt { description = 'pick a set of properties from an object like `Pick(User, "name | age")`'; }; -var Pick = genericNode(["T", intrinsic.object], ["K", intrinsic.key])((args3) => args3.T.pick(args3.K), PickHkt); +var Pick = genericNode(["T", intrinsic.object], ["K", intrinsic.key])((args2) => args2.T.pick(args2.K), PickHkt); var OmitHkt = class extends Hkt { description = 'omit a set of properties from an object like `Omit(User, "age")`'; }; -var Omit = genericNode(["T", intrinsic.object], ["K", intrinsic.key])((args3) => args3.T.omit(args3.K), OmitHkt); +var Omit = genericNode(["T", intrinsic.object], ["K", intrinsic.key])((args2) => args2.T.omit(args2.K), OmitHkt); var PartialHkt = class extends Hkt { description = "make all named properties of an object optional like `Partial(User)`"; }; -var Partial = genericNode(["T", intrinsic.object])((args3) => args3.T.partial(), PartialHkt); +var Partial = genericNode(["T", intrinsic.object])((args2) => args2.T.partial(), PartialHkt); var RequiredHkt = class extends Hkt { description = "make all named properties of an object required like `Required(User)`"; }; -var Required2 = genericNode(["T", intrinsic.object])((args3) => args3.T.required(), RequiredHkt); +var Required2 = genericNode(["T", intrinsic.object])((args2) => args2.T.required(), RequiredHkt); var ExcludeHkt = class extends Hkt { description = 'exclude branches of a union like `Exclude("boolean", "true")`'; }; -var Exclude = genericNode("T", "U")((args3) => args3.T.exclude(args3.U), ExcludeHkt); +var Exclude = genericNode("T", "U")((args2) => args2.T.exclude(args2.U), ExcludeHkt); var ExtractHkt = class extends Hkt { description = 'extract branches of a union like `Extract("0 | false | 1", "number")`'; }; -var Extract = genericNode("T", "U")((args3) => args3.T.extract(args3.U), ExtractHkt); +var Extract = genericNode("T", "U")((args2) => args2.T.extract(args2.U), ExtractHkt); var arkTsGenerics = Scope.module({ Exclude, Extract, @@ -92467,7 +92125,7 @@ var arkTsGenerics = Scope.module({ Required: Required2 }); -// node_modules/.pnpm/arktype@2.1.28/node_modules/arktype/out/keywords/keywords.js +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/keywords.js var ark = scope({ ...arkTsKeywords, ...arkTsGenerics, @@ -93102,8 +92760,8 @@ async function installFromGithub({ const tempDirPrefix = `${owner}-${repo}-github-`; const tempDir = await mkdtemp(join4(tmpdir(), tempDirPrefix)); const urlPath = new URL(assetUrl).pathname; - const fileName3 = urlPath.split("/").pop() || "asset"; - const downloadPath = join4(tempDir, fileName3); + const fileName2 = urlPath.split("/").pop() || "asset"; + const downloadPath = join4(tempDir, fileName2); const assetResponse = await fetchWithRetry(assetUrl, headers, "Failed to download asset"); if (!assetResponse.body) throw new Error("Response body is null"); const fileStream = createWriteStream2(downloadPath); @@ -93446,57 +93104,57 @@ var CodexExec = class { constructor(executablePath = null) { this.executablePath = executablePath || findCodexPath(); } - async *run(args3) { + async *run(args2) { const commandArgs = ["exec", "--experimental-json"]; - if (args3.model) { - commandArgs.push("--model", args3.model); + if (args2.model) { + commandArgs.push("--model", args2.model); } - if (args3.sandboxMode) { - commandArgs.push("--sandbox", args3.sandboxMode); + if (args2.sandboxMode) { + commandArgs.push("--sandbox", args2.sandboxMode); } - if (args3.workingDirectory) { - commandArgs.push("--cd", args3.workingDirectory); + if (args2.workingDirectory) { + commandArgs.push("--cd", args2.workingDirectory); } - if (args3.skipGitRepoCheck) { + if (args2.skipGitRepoCheck) { commandArgs.push("--skip-git-repo-check"); } - if (args3.outputSchemaFile) { - commandArgs.push("--output-schema", args3.outputSchemaFile); + if (args2.outputSchemaFile) { + commandArgs.push("--output-schema", args2.outputSchemaFile); } - if (args3.modelReasoningEffort) { - commandArgs.push("--config", `model_reasoning_effort="${args3.modelReasoningEffort}"`); + if (args2.modelReasoningEffort) { + commandArgs.push("--config", `model_reasoning_effort="${args2.modelReasoningEffort}"`); } - if (args3.networkAccessEnabled !== void 0) { - commandArgs.push("--config", `sandbox_workspace_write.network_access=${args3.networkAccessEnabled}`); + if (args2.networkAccessEnabled !== void 0) { + commandArgs.push("--config", `sandbox_workspace_write.network_access=${args2.networkAccessEnabled}`); } - if (args3.webSearchEnabled !== void 0) { - commandArgs.push("--config", `features.web_search_request=${args3.webSearchEnabled}`); + if (args2.webSearchEnabled !== void 0) { + commandArgs.push("--config", `features.web_search_request=${args2.webSearchEnabled}`); } - if (args3.approvalPolicy) { - commandArgs.push("--config", `approval_policy="${args3.approvalPolicy}"`); + if (args2.approvalPolicy) { + commandArgs.push("--config", `approval_policy="${args2.approvalPolicy}"`); } - if (args3.images?.length) { - for (const image of args3.images) { + if (args2.images?.length) { + for (const image of args2.images) { commandArgs.push("--image", image); } } - if (args3.threadId) { - commandArgs.push("resume", args3.threadId); + if (args2.threadId) { + commandArgs.push("resume", args2.threadId); } - const env3 = { + const env2 = { ...process.env }; - if (!env3[INTERNAL_ORIGINATOR_ENV]) { - env3[INTERNAL_ORIGINATOR_ENV] = TYPESCRIPT_SDK_ORIGINATOR; + if (!env2[INTERNAL_ORIGINATOR_ENV]) { + env2[INTERNAL_ORIGINATOR_ENV] = TYPESCRIPT_SDK_ORIGINATOR; } - if (args3.baseUrl) { - env3.OPENAI_BASE_URL = args3.baseUrl; + if (args2.baseUrl) { + env2.OPENAI_BASE_URL = args2.baseUrl; } - if (args3.apiKey) { - env3.CODEX_API_KEY = args3.apiKey; + if (args2.apiKey) { + env2.CODEX_API_KEY = args2.apiKey; } const child = spawn2(this.executablePath, commandArgs, { - env: env3 + env: env2 }); let spawnError = null; child.once("error", (err) => spawnError = err); @@ -93504,7 +93162,7 @@ var CodexExec = class { child.kill(); throw new Error("Child process has no stdin"); } - child.stdin.write(args3.input); + child.stdin.write(args2.input); child.stdin.end(); if (!child.stdout) { child.kill(); @@ -94012,13 +93670,13 @@ import { spawnSync as spawnSync3 } from "node:child_process"; // utils/subprocess.ts import { spawn as nodeSpawn } from "node:child_process"; async function spawn4(options) { - const { cmd, args: args3, env: env3, input, timeout, cwd: cwd2, onStdout, onStderr } = options; + const { cmd, args: args2, env: env2, input, timeout, cwd: cwd2, onStdout, onStderr } = options; const startTime = Date.now(); let stdoutBuffer = ""; let stderrBuffer = ""; return new Promise((resolve, reject) => { - const child = nodeSpawn(cmd, args3, { - env: env3 || { + const child = nodeSpawn(cmd, args2, { + env: env2 || { PATH: process.env.PATH || "", HOME: process.env.HOME || "" }, @@ -94174,7 +93832,7 @@ var gemini = agent({ } const sessionPrompt = addInstructions(payload); log.info(`Starting Gemini CLI with prompt: ${payload.prompt.substring(0, 100)}...`); - const args3 = payload.sandbox ? [ + const args2 = payload.sandbox ? [ "--allowed-tools", "read_file,list_directory,search_file_content,glob,save_memory,write_todos", "--allowed-mcp-server-names", @@ -94190,7 +93848,7 @@ var gemini = agent({ try { const result = await spawn4({ cmd: "node", - args: [cliPath, ...args3], + args: [cliPath, ...args2], env: createAgentEnv({ GEMINI_API_KEY: apiKey }), @@ -94299,7 +93957,7 @@ function getUserAgent() { } // node_modules/.pnpm/before-after-hook@4.0.0/node_modules/before-after-hook/lib/register.js -function register3(state, name, method, options) { +function register2(state, name, method, options) { if (typeof method !== "function") { throw new Error("method for before hook must be a function"); } @@ -94308,7 +93966,7 @@ function register3(state, name, method, options) { } if (Array.isArray(name)) { return name.reverse().reduce((callback, name2) => { - return register3.bind(null, state, name2, callback, options); + return register2.bind(null, state, name2, callback, options); }, method)(); } return Promise.resolve().then(() => { @@ -94381,8 +94039,8 @@ function bindApi(hook2, state, name) { hook2.api = { remove: removeHookRef }; hook2.remove = removeHookRef; ["before", "error", "after", "wrap"].forEach((kind) => { - const args3 = name ? [state, kind, name] : [state, kind]; - hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args3); + const args2 = name ? [state, kind, name] : [state, kind]; + hook2[kind] = hook2.api[kind] = bindable(addHook, null).apply(null, args2); }); } function Singular() { @@ -94390,7 +94048,7 @@ function Singular() { const singularHookState = { registry: {} }; - const singularHook = register3.bind(null, singularHookState, singularHookName); + const singularHook = register2.bind(null, singularHookState, singularHookName); bindApi(singularHook, singularHookState, singularHookName); return singularHook; } @@ -94398,7 +94056,7 @@ function Collection() { const state = { registry: {} }; - const hook2 = register3.bind(null, state); + const hook2 = register2.bind(null, state); bindApi(hook2, state); return hook2; } @@ -95113,8 +94771,8 @@ var Octokit = class { static VERSION = VERSION4; static defaults(defaults) { const OctokitWithDefaults = class extends this { - constructor(...args3) { - const options = args3[0] || {}; + constructor(...args2) { + const options = args2[0] || {}; if (typeof defaults === "function") { super(defaults(options)); return; @@ -97643,8 +97301,8 @@ function endpointsToMethods(octokit) { } function decorate(octokit, scope2, methodName, defaults, decorations) { const requestWithDefaults = octokit.request.defaults(defaults); - function withDecorations(...args3) { - let options = requestWithDefaults.endpoint.merge(...args3); + function withDecorations(...args2) { + let options = requestWithDefaults.endpoint.merge(...args2); if (decorations.mapToData) { options = Object.assign({}, options, { data: options[decorations.mapToData], @@ -97662,7 +97320,7 @@ function decorate(octokit, scope2, methodName, defaults, decorations) { octokit.log.warn(decorations.deprecated); } if (decorations.renamedParameters) { - const options2 = requestWithDefaults.endpoint.merge(...args3); + const options2 = requestWithDefaults.endpoint.merge(...args2); for (const [name, alias] of Object.entries( decorations.renamedParameters )) { @@ -97678,7 +97336,7 @@ function decorate(octokit, scope2, methodName, defaults, decorations) { } return requestWithDefaults(options2); } - return requestWithDefaults(...args3); + return requestWithDefaults(...args2); } return Object.assign(withDecorations, requestWithDefaults); } @@ -99692,7 +99350,7 @@ var StdioServerTransport = class { } }; -// node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.28/node_modules/fastmcp/dist/FastMCP.js +// node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.25/node_modules/fastmcp/dist/FastMCP.js import { EventEmitter } from "events"; // node_modules/.pnpm/fuse.js@7.1.0/node_modules/fuse.js/dist/fuse.mjs @@ -100675,8 +100333,8 @@ var ExtendedSearch = class { } }; var registeredSearchers = []; -function register4(...args3) { - registeredSearchers.push(...args3); +function register3(...args2) { + registeredSearchers.push(...args2); } function createSearcher(pattern, options) { for (let i = 0, len = registeredSearchers.length; i < len; i += 1) { @@ -101011,7 +100669,7 @@ Fuse.config = Config; Fuse.parseQuery = parse2; } { - register4(ExtendedSearch); + register3(ExtendedSearch); } // node_modules/.pnpm/mcp-proxy@5.9.0/node_modules/mcp-proxy/dist/stdio-CsjPjeWC.js @@ -101851,21 +101509,21 @@ var base64Regex$1 = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3} var base64urlRegex3 = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; var dateRegexSource3 = `((\\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])))`; var dateRegex3 = /* @__PURE__ */ new RegExp(`^${dateRegexSource3}$`); -function timeRegexSource3(args3) { +function timeRegexSource3(args2) { let secondsRegexSource = `[0-5]\\d`; - if (args3.precision) secondsRegexSource = `${secondsRegexSource}\\.\\d{${args3.precision}}`; - else if (args3.precision == null) secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; - const secondsQuantifier = args3.precision ? "+" : "?"; + if (args2.precision) secondsRegexSource = `${secondsRegexSource}\\.\\d{${args2.precision}}`; + else if (args2.precision == null) secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; + const secondsQuantifier = args2.precision ? "+" : "?"; return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; } -function timeRegex3(args3) { - return /* @__PURE__ */ new RegExp(`^${timeRegexSource3(args3)}$`); +function timeRegex3(args2) { + return /* @__PURE__ */ new RegExp(`^${timeRegexSource3(args2)}$`); } -function datetimeRegex3(args3) { - let regex$1 = `${dateRegexSource3}T${timeRegexSource3(args3)}`; +function datetimeRegex3(args2) { + let regex$1 = `${dateRegexSource3}T${timeRegexSource3(args2)}`; const opts = []; - opts.push(args3.local ? `Z?` : `Z`); - if (args3.offset) opts.push(`([+-]\\d{2}:?\\d{2})`); + opts.push(args2.local ? `Z?` : `Z`); + if (args2.offset) opts.push(`([+-]\\d{2}:?\\d{2})`); regex$1 = `${regex$1}(${opts.join("|")})`; return /* @__PURE__ */ new RegExp(`^${regex$1}$`); } @@ -103971,9 +103629,9 @@ var ZodFunction3 = class ZodFunction4 extends ZodType3 { }); return INVALID3; } - function makeArgsIssue(args3, error41) { + function makeArgsIssue(args2, error41) { return makeIssue3({ - data: args3, + data: args2, path: ctx.path, errorMaps: [ ctx.common.contextualErrorMap, @@ -104007,10 +103665,10 @@ var ZodFunction3 = class ZodFunction4 extends ZodType3 { const fn2 = ctx.data; if (this._def.returns instanceof ZodPromise3) { const me = this; - return OK3(async function(...args3) { + return OK3(async function(...args2) { const error41 = new ZodError3([]); - const parsedArgs = await me._def.args.parseAsync(args3, params).catch((e) => { - error41.addIssue(makeArgsIssue(args3, e)); + const parsedArgs = await me._def.args.parseAsync(args2, params).catch((e) => { + error41.addIssue(makeArgsIssue(args2, e)); throw error41; }); const result = await Reflect.apply(fn2, this, parsedArgs); @@ -104021,9 +103679,9 @@ var ZodFunction3 = class ZodFunction4 extends ZodType3 { }); } else { const me = this; - return OK3(function(...args3) { - const parsedArgs = me._def.args.safeParse(args3, params); - if (!parsedArgs.success) throw new ZodError3([makeArgsIssue(args3, parsedArgs.error)]); + return OK3(function(...args2) { + const parsedArgs = me._def.args.safeParse(args2, params); + if (!parsedArgs.success) throw new ZodError3([makeArgsIssue(args2, parsedArgs.error)]); const result = Reflect.apply(fn2, this, parsedArgs.data); const parsedReturns = me._def.returns.safeParse(result, params); if (!parsedReturns.success) throw new ZodError3([makeReturnsIssue(result, parsedReturns.error)]); @@ -104055,9 +103713,9 @@ var ZodFunction3 = class ZodFunction4 extends ZodType3 { strictImplement(func) { return this.parse(func); } - static create(args3, returns, params) { + static create(args2, returns, params) { return new ZodFunction4({ - args: args3 ? args3 : ZodTuple3.create([]).rest(ZodUnknown3.create()), + args: args2 ? args2 : ZodTuple3.create([]).rest(ZodUnknown3.create()), returns: returns || ZodUnknown3.create(), typeName: ZodFirstPartyTypeKind3.ZodFunction, ...processCreateParams4(params) @@ -105372,11 +105030,11 @@ var require_depd = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/depd@2.0.0/ } function wrapfunction(fn2, message) { if (typeof fn2 !== "function") throw new TypeError("argument fn must be a function"); - var args3 = createArgumentsString(fn2.length); + var args2 = createArgumentsString(fn2.length); var stack = getStack(); var site = callSiteLocation(stack[1]); site.name = fn2.name; - return new Function("fn", "log", "deprecate", "message", "site", '"use strict"\nreturn function (' + args3 + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn2, log2, this, message, site); + return new Function("fn", "log", "deprecate", "message", "site", '"use strict"\nreturn function (' + args2 + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn2, log2, this, message, site); } function wrapproperty(obj, prop, message) { if (!obj || typeof obj !== "object" && typeof obj !== "function") throw new TypeError("argument obj must be object"); @@ -114522,15 +114180,15 @@ var require_raw_body = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/raw-bod stream.on("error", onEnd); sync = false; function done() { - var args3 = new Array(arguments.length); - for (var i$3 = 0; i$3 < args3.length; i$3++) args3[i$3] = arguments[i$3]; + var args2 = new Array(arguments.length); + for (var i$3 = 0; i$3 < args2.length; i$3++) args2[i$3] = arguments[i$3]; complete = true; if (sync) process.nextTick(invokeCallback); else invokeCallback(); function invokeCallback() { cleanup(); - if (args3[0]) halt(stream); - callback.apply(null, args3); + if (args2[0]) halt(stream); + callback.apply(null, args2); } } function onAborted() { @@ -120294,8 +119952,8 @@ var require_ajv3 = /* @__PURE__ */ __commonJS3({ "node_modules/.pnpm/ajv@6.12.6/ if (typeof schema2 != "object" && typeof schema2 != "boolean") throw new Error("schema should be object or boolean"); var serialize = this._opts.serialize; var cacheKey = serialize ? serialize(schema2) : schema2; - var cached4 = this._cache.get(cacheKey); - if (cached4) return cached4; + var cached3 = this._cache.get(cacheKey); + if (cached3) return cached3; shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false; var id = resolve.normalizeId(this._getId(schema2)); if (id && shouldAddSchema) checkUnique(this, id); @@ -121048,15 +120706,15 @@ var EventSourceParserStream = class extends TransformStream { } }; -// node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.28/node_modules/fastmcp/dist/FastMCP.js +// node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.25/node_modules/fastmcp/dist/FastMCP.js var import_undici = __toESM(require_undici2(), 1); var import_uri_templates = __toESM(require_uri_templates(), 1); import { setTimeout as delay } from "timers/promises"; -// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.28_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index.js +// node_modules/.pnpm/xsschema@0.3.5_arktype@2.1.25_zod-to-json-schema@3.24.6_zod@3.25.76__zod@3.25.76/node_modules/xsschema/dist/index.js init_index_CAcLDIRJ(); -// node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.28/node_modules/fastmcp/dist/FastMCP.js +// node_modules/.pnpm/fastmcp@3.20.0_arktype@2.1.25/node_modules/fastmcp/dist/FastMCP.js init_zod(); var FastMCPError = class extends Error { constructor(message) { @@ -121547,9 +121205,9 @@ ${e instanceof Error ? e.stack : JSON.stringify(e)}` `Unknown prompt: ${request2.params.name}` ); } - const args3 = request2.params.arguments; + const args2 = request2.params.arguments; for (const arg of prompt.arguments ?? []) { - if (arg.required && !(args3 && arg.name in args3)) { + if (arg.required && !(args2 && arg.name in args2)) { throw new McpError( ErrorCode2.InvalidRequest, `Prompt '${request2.params.name}' requires argument '${arg.name}': ${arg.description || "No description provided"}` @@ -121559,7 +121217,7 @@ ${e instanceof Error ? e.stack : JSON.stringify(e)}` let result; try { result = await prompt.load( - args3, + args2, this.#auth ); } catch (error41) { @@ -121744,7 +121402,7 @@ ${error41 instanceof Error ? error41.stack : JSON.stringify(error41)}` `Unknown tool: ${request2.params.name}` ); } - let args3 = void 0; + let args2 = void 0; if (tool2.parameters) { const parsed2 = await tool2.parameters["~standard"].validate( request2.params.arguments @@ -121759,7 +121417,7 @@ ${error41 instanceof Error ? error41.stack : JSON.stringify(error41)}` `Tool '${request2.params.name}' parameter validation failed: ${friendlyErrors}. Please check the parameter types and values according to the tool's schema.` ); } - args3 = parsed2.value; + args2 = parsed2.value; } const progressToken = request2.params?._meta?.progressToken; let result; @@ -121841,7 +121499,7 @@ ${error41 instanceof Error ? error41.stack : JSON.stringify(error41)}` ); } }; - const executeToolPromise = tool2.execute(args3, { + const executeToolPromise = tool2.execute(args2, { client: { version: this.#server.getClientVersion() }, @@ -122262,10 +121920,10 @@ var FastMCP = class extends FastMCPEventEmitter { res.writeHead(404).end(); }; #parseRuntimeConfig(overrides) { - const args3 = process.argv.slice(2); + const args2 = process.argv.slice(2); const getArg = (name) => { - const index = args3.findIndex((arg) => arg === `--${name}`); - return index !== -1 && index + 1 < args3.length ? args3[index + 1] : void 0; + const index = args2.findIndex((arg) => arg === `--${name}`); + return index !== -1 && index + 1 < args2.length ? args2[index + 1] : void 0; }; const transportArg = getArg("transport"); const portArg = getArg("port"); @@ -122393,9 +122051,9 @@ var GetCheckSuiteLogsTool = tool({ // utils/shell.ts import { spawnSync as spawnSync4 } from "node:child_process"; -function $(cmd, args3, options) { +function $(cmd, args2, options) { const encoding = options?.encoding ?? "utf-8"; - const result = spawnSync4(cmd, args3, { + const result = spawnSync4(cmd, args2, { stdio: ["ignore", "pipe", "pipe"], encoding, cwd: options?.cwd diff --git a/external.ts b/external.ts index 7994e58..29d3455 100644 --- a/external.ts +++ b/external.ts @@ -57,6 +57,14 @@ export type PayloadEvent = branch: string; [key: string]: any; } + | { + trigger: "pull_request_ready_for_review"; + issue_number: number; + pr_title: string; + pr_body: string | null; + branch: string; + [key: string]: any; + } | { trigger: "pull_request_review_requested"; issue_number: number; diff --git a/package.json b/package.json index f9f176a..9cfa47f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pullfrog/action", - "version": "0.0.127", + "version": "0.0.128", "type": "module", "files": [ "index.js", diff --git a/utils/cli.ts b/utils/cli.ts index 13febec..5e54875 100644 --- a/utils/cli.ts +++ b/utils/cli.ts @@ -10,6 +10,30 @@ import { table } from "table"; const isGitHubActions = !!process.env.GITHUB_ACTIONS; const isDebugEnabled = () => process.env.LOG_LEVEL === "debug"; +/** + * Get the terminal width, or a reasonable default if not available + */ +function getTerminalWidth(): number { + if (process.stdout.columns && process.stdout.columns > 0) { + return process.stdout.columns; + } + // reasonable default for most terminals + return 120; +} + +/** + * Truncate a line to fit within maxLength, adding ellipsis if needed + */ +function truncateLine(line: string, maxLength: number): string { + if (line.length <= maxLength) { + return line; + } + if (maxLength <= 3) { + return "...".slice(0, maxLength); + } + return line.slice(0, maxLength - 3) + "..."; +} + /** * Start a collapsed group (GitHub Actions) or regular group (local) */ @@ -44,40 +68,16 @@ function boxString( padding?: number; } ): string { - const { title, maxWidth = 80, indent = "", padding = 1 } = options || {}; + const terminalWidth = getTerminalWidth(); + const { title, maxWidth = terminalWidth, indent = "", padding = 1 } = options || {}; + + // account for box borders (2 chars: │ on each side) and padding + const maxContentWidth = maxWidth - 2 - padding * 2; const lines = text.trim().split("\n"); - const wrappedLines: string[] = []; + const truncatedLines = lines.map((line) => truncateLine(line, maxContentWidth)); - for (const line of lines) { - if (line.length <= maxWidth - padding * 2) { - wrappedLines.push(line); - } else { - const words = line.split(" "); - let currentLine = ""; - - for (const word of words) { - const testLine = currentLine ? `${currentLine} ${word}` : word; - if (testLine.length <= maxWidth - padding * 2) { - currentLine = testLine; - } else { - if (currentLine) { - wrappedLines.push(currentLine); - currentLine = word; - } else { - wrappedLines.push(word.substring(0, maxWidth - padding * 2)); - currentLine = word.substring(maxWidth - padding * 2); - } - } - } - - if (currentLine) { - wrappedLines.push(currentLine); - } - } - } - - const maxLineLength = Math.max(...wrappedLines.map((line) => line.length)); + const maxLineLength = Math.max(...truncatedLines.map((line) => line.length)); const contentBoxWidth = maxLineLength + padding * 2; // ensure box width is at least as wide as the title line when title exists @@ -96,7 +96,7 @@ function boxString( result += `${indent}┌${"─".repeat(boxWidth)}┐\n`; } - for (const line of wrappedLines) { + for (const line of truncatedLines) { const paddedLine = line.padEnd(maxLineLength); result += `${indent}│${" ".repeat(padding)}${paddedLine}${" ".repeat(padding)}│\n`; }