From ba724c8b71ff31f2b0a2fda2b4f97ccb2b0849ff Mon Sep 17 00:00:00 2001 From: David Blass Date: Thu, 20 Nov 2025 15:09:12 -0500 Subject: [PATCH] standardize name to gh_pullfrog --- mcp-server | 2331 +++++++++++++++++++++++++------------------------ mcp/README.md | 8 +- play.ts | 2 +- 3 files changed, 1178 insertions(+), 1163 deletions(-) diff --git a/mcp-server b/mcp-server index 2b29625..3e584e1 100755 --- a/mcp-server +++ b/mcp-server @@ -33382,7 +33382,7 @@ __export(util_exports, { assertNever: () => assertNever, assertNotEqual: () => assertNotEqual, assignProp: () => assignProp, - cached: () => cached, + cached: () => cached2, captureStackTrace: () => captureStackTrace, cleanEnum: () => cleanEnum, cleanRegex: () => cleanRegex, @@ -33408,7 +33408,7 @@ __export(util_exports, { normalizeParams: () => normalizeParams, nullish: () => nullish, numKeys: () => numKeys, - omit: () => omit, + omit: () => omit2, optionalKeys: () => optionalKeys, partial: () => partial, pick: () => pick, @@ -33447,7 +33447,7 @@ function jsonStringifyReplacer(_, value2) { return value2.toString(); return value2; } -function cached(getter) { +function cached2(getter) { const set = false; return { get value() { @@ -33644,7 +33644,7 @@ function pick(schema2, mask) { checks: [] }); } -function omit(schema2, mask) { +function omit2(schema2, mask) { const newShape = { ...schema2._zod.def.shape }; const currDef = schema2._zod.def; for (const key in mask) { @@ -33818,7 +33818,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 = cached(() => { + allowsEval = cached2(() => { if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { return false; } @@ -35643,7 +35643,7 @@ var init_schemas = __esm({ }); $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => { $ZodType.init(inst, def); - const _normalized = cached(() => { + const _normalized = cached2(() => { const keys = Object.keys(def.shape); for (const k of keys) { if (!(def.shape[k] instanceof $ZodType)) { @@ -35863,7 +35863,7 @@ var init_schemas = __esm({ } return propValues; }); - const disc = cached(() => { + const disc = cached2(() => { const opts = def.options; const map = /* @__PURE__ */ new Map(); for (const o of opts) { @@ -41508,7 +41508,7 @@ var init_locales = __esm({ }); // node_modules/.pnpm/zod@3.25.76/node_modules/zod/v4/core/registries.js -function registry() { +function registry2() { return new $ZodRegistry(); } var $output, $input, $ZodRegistry, globalRegistry; @@ -41558,7 +41558,7 @@ var init_registries = __esm({ return this._map.has(schema2); } }; - globalRegistry = /* @__PURE__ */ registry(); + globalRegistry = /* @__PURE__ */ registry2(); } }); @@ -43522,7 +43522,7 @@ __export(core_exports2, { parseAsync: () => parseAsync, prettifyError: () => prettifyError, regexes: () => regexes_exports, - registry: () => registry, + registry: () => registry2, safeParse: () => safeParse, safeParseAsync: () => safeParseAsync, toDotPath: () => toDotPath, @@ -70785,6 +70785,1135 @@ var require_src = __commonJS({ } }); +// 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]; + } + 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] = 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", + undefined: "undefined", + bigint: "a bigint", + number: "a number", + object: "an object", + string: "a string", + symbol: "a symbol" +}; +var jsTypeOfDescriptions = { + ...domainDescriptions, + function: "a function" +}; + +// 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"; + +// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/flatMorph.js +var flatMorph = (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] = append(result[k.group], v); + else + result[k] = v; + } + } + return outputShouldBeArray ? Object.values(result) : result; +}; + +// 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 = { + Array, + Boolean, + Date, + Error, + Function, + Map, + Number, + Promise, + RegExp, + Set, + String, + WeakMap, + WeakSet +}; +var FileConstructor = globalThis.File ?? Blob; +var platformConstructors = { + ArrayBuffer, + Blob, + File: FileConstructor, + FormData, + Headers, + Request, + Response, + URL +}; +var typedArrayConstructors = { + Int8Array, + Uint8Array, + Uint8ClampedArray, + Int16Array, + Uint16Array, + Int32Array, + Uint32Array, + Float32Array, + Float64Array, + BigInt64Array, + BigUint64Array +}; +var builtinConstructors = { + ...ecmascriptConstructors, + ...platformConstructors, + ...typedArrayConstructors, + String, + 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", + 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 platformDescriptions = { + 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 typedArrayDescriptions = { + 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 objectKindDescriptions = { + ...ecmascriptDescriptions, + ...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")(); + } catch { + return true; + } +}); + +// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/generics.js +var brand = noSuggest("brand"); +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 = () => { + 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 env = globalThis.process?.env ?? {}; +var isomorphic = { + fileName, + env +}; + +// 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; + return `^(?:${source})$`; +}; +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; +var positiveIntegerPattern = /[1-9]\d*/.source; +var looseDecimalPattern = /\.\d+/.source; +var strictDecimalPattern = /\.\d*[1-9]/.source; +var createNumberMatcher = (opts) => anchoredRegex(RegexPatterns.negativeLookahead(anchoredNegativeZeroPattern) + RegexPatterns.nonCapturingGroup("-?" + RegexPatterns.nonCapturingGroup(RegexPatterns.nonCapturingGroup("0|" + positiveIntegerPattern) + RegexPatterns.nonCapturingGroup(opts.decimalPattern) + "?") + (opts.allowDecimalOnly ? "|" + opts.decimalPattern : "") + "?")); +var wellFormedNumberMatcher = createNumberMatcher({ + decimalPattern: strictDecimalPattern, + allowDecimalOnly: false +}); +var isWellFormedNumber = wellFormedNumberMatcher.test.bind(wellFormedNumberMatcher); +var numericStringMatcher = createNumberMatcher({ + decimalPattern: looseDecimalPattern, + 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"; +var initialRegistryContents = { + version: arkUtilVersion, + 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 = (path, prop, ...[opts]) => { + const stringifySymbol = opts?.stringifySymbol ?? printable; + let propAccessChain = path; + switch (typeof prop) { + case "string": + propAccessChain = isDotAccessible(prop) ? path === "" ? prop : `${path}.${prop}` : `${path}[${JSON.stringify(prop)}]`; + break; + case "number": + propAccessChain = `${path}[${prop}]`; + break; + case "symbol": + propAccessChain = `${path}[${stringifySymbol(prop)}]`; + break; + default: + if (opts?.stringifyNonKey) + propAccessChain = `${path}[${opts.stringifyNonKey(prop)}]`; + else { + throwParseError(`${printable(prop)} must be a PropertyKey or stringifyNonKey must be passed to options`); + } + } + return propAccessChain; +}; +var stringifyPath = (path, ...opts) => path.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 path of this) { + propString = appendStringifiedKey(propString, path); + 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"); + +// 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) + _registryName = `$ark${suffix++}`; +var registryName = _registryName; +globalThis[registryName] = registry; +var $ark = registry; +var reference = (name) => `${registryName}.${name}`; +var registeredReference = (value2) => reference(register(value2)); + +// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/compile.js +var CompiledFunction = class extends CastableBase { + argNames; + body = ""; + constructor(...args2) { + super(); + 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`); + } + ; + this[arg] = arg; + } + } + indentation = 0; + indent() { + this.indentation += 4; + return this; + } + dedent() { + this.indentation -= 4; + return this; + } + prop(key, optional = false) { + return compileLiteralPropAccess(key, optional); + } + index(key, optional = false) { + return indexPropAccess(`${key}`, optional); + } + line(statement) { + ; + this.body += `${" ".repeat(this.indentation)}${statement} +`; + return this; + } + const(identifier, expression) { + this.line(`const ${identifier} = ${expression}`); + return this; + } + let(identifier, expression) { + return this.line(`let ${identifier} = ${expression}`); + } + set(identifier, expression) { + return this.line(`${identifier} = ${expression}`); + } + if(condition, then) { + return this.block(`if (${condition})`, then); + } + elseIf(condition, then) { + return this.block(`else if (${condition})`, then); + } + else(then) { + return this.block("else", then); + } + /** Current index is "i" */ + for(until, body, initialValue = 0) { + return this.block(`for (let i = ${initialValue}; ${until}; i++)`, body); + } + /** Current key is "k" */ + forIn(object2, body) { + return this.block(`for (const k in ${object2})`, body); + } + block(prefix, contents, suffix2 = "") { + this.line(`${prefix} {`); + this.indent(); + contents(this); + this.dedent(); + return this.line(`}${suffix2}`); + } + return(expression = "") { + return this.line(`return ${expression}`); + } + write(name = "anonymous", indent2 = 0) { + return `${name}(${this.argNames.join(", ")}) { ${indent2 ? this.body.split("\n").map((l) => " ".repeat(indent2) + `${l}`).join("\n") : this.body} }`; + } + compile() { + return new DynamicFunction(...this.argNames, this.body); + } +}; +var compileSerializedValue = (value2) => hasDomain(value2, "object") || typeof value2 === "symbol" ? registeredReference(value2) : serializePrimitive(value2); +var compileLiteralPropAccess = (key, optional = false) => { + if (typeof key === "string" && isDotAccessible(key)) + return `${optional ? "?" : ""}.${key}`; + return indexPropAccess(serializeLiteralKey(key), optional); +}; +var serializeLiteralKey = (key) => typeof key === "symbol" ? registeredReference(key) : JSON.stringify(key); +var indexPropAccess = (key, optional = false) => `${optional ? "?." : ""}[${key}]`; +var NodeCompiler = class extends CompiledFunction { + traversalKind; + optimistic; + constructor(ctx) { + super("data", "ctx"); + this.traversalKind = ctx.kind; + this.optimistic = ctx.optimistic === true; + } + invoke(node2, opts) { + const arg = opts?.arg ?? this.data; + const requiresContext = typeof node2 === "string" ? true : this.requiresContextFor(node2); + const id = typeof node2 === "string" ? node2 : node2.id; + if (requiresContext) + return `${this.referenceToId(id, opts)}(${arg}, ${this.ctx})`; + return `${this.referenceToId(id, opts)}(${arg})`; + } + referenceToId(id, opts) { + const invokedKind = opts?.kind ?? this.traversalKind; + const base = `this.${id}${invokedKind}`; + return opts?.bind ? `${base}.bind(${opts?.bind})` : base; + } + requiresContextFor(node2) { + return this.traversalKind === "Apply" || node2.allowsRequiresContext; + } + initializeErrorCount() { + return this.const("errorCount", "ctx.currentErrorCount"); + } + returnIfFail() { + return this.if("ctx.currentErrorCount > errorCount", () => this.return()); + } + returnIfFailFast() { + return this.if("ctx.failFast && ctx.currentErrorCount > errorCount", () => this.return()); + } + traverseKey(keyExpression, accessExpression, node2) { + const requiresContext = this.requiresContextFor(node2); + if (requiresContext) + this.line(`${this.ctx}.path.push(${keyExpression})`); + this.check(node2, { + arg: accessExpression + }); + if (requiresContext) + this.line(`${this.ctx}.path.pop()`); + return this; + } + check(node2, opts) { + return this.traversalKind === "Allows" ? this.if(`!${this.invoke(node2, opts)}`, () => this.return(false)) : this.line(this.invoke(node2, opts)); + } +}; + +// 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? + flatMorph(o, (k, v) => [k, isArray(v) ? [...v] : v]) +); +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.53.0/node_modules/@ark/schema/out/shared/implement.js +var basisKinds = ["unit", "proto", "domain"]; +var structuralKinds = [ + "required", + "optional", + "index", + "sequence" +]; +var prestructuralKinds = [ + "pattern", + "divisor", + "exactLength", + "max", + "min", + "maxLength", + "minLength", + "before", + "after" +]; +var refinementKinds = [ + ...prestructuralKinds, + "structure", + "predicate" +]; +var constraintKinds = [...refinementKinds, ...structuralKinds]; +var rootKinds = [ + "alias", + "union", + "morph", + "unit", + "intersection", + "proto", + "domain" +]; +var nodeKinds = [...rootKinds, ...constraintKinds]; +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); +var unionChildKinds = [ + ...schemaKindsRightOf("union"), + "alias" +]; +var morphChildKinds = [ + ...schemaKindsRightOf("morph"), + "alias" +]; +var defaultValueSerializer = (v) => { + if (typeof v === "string" || typeof v === "boolean" || v === null) + return v; + if (typeof v === "number") { + if (Number.isNaN(v)) + return "NaN"; + if (v === Number.POSITIVE_INFINITY) + return "Infinity"; + if (v === Number.NEGATIVE_INFINITY) + return "-Infinity"; + return v; + } + return compileSerializedValue(v); +}; +var compileObjectLiteral = (ctx) => { + let result = "{ "; + for (const [k, v] of Object.entries(ctx)) + result += `${k}: ${compileSerializedValue(v)}, `; + return result + " }"; +}; +var implementNode = (_) => { + const implementation23 = _; + if (implementation23.hasAssociatedError) { + implementation23.defaults.expected ??= (ctx) => "description" in ctx ? ctx.description : implementation23.defaults.description(ctx); + 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) + return ctx.problem; + const problemWithLocation = `${ctx.propString} ${ctx.problem}`; + if (problemWithLocation[0] === "[") { + return `value at ${problemWithLocation}`; + } + return problemWithLocation; + }; + } + return implementation23; +}; + +// 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(printable(context, { quoteKeys: false, indent: 4 })); + this.code = code; + this.context = context; + } + hasCode(code) { + return this.code === code; + } +}; +var defaultConfig = { + dialect: "https://json-schema.org/draft/2020-12/schema", + useRefs: false, + fallback: { + arrayObject: (ctx) => ToJsonSchema.throw("arrayObject", ctx), + arrayPostfix: (ctx) => ToJsonSchema.throw("arrayPostfix", ctx), + defaultValue: (ctx) => ToJsonSchema.throw("defaultValue", ctx), + domain: (ctx) => ToJsonSchema.throw("domain", ctx), + morph: (ctx) => ToJsonSchema.throw("morph", ctx), + patternIntersection: (ctx) => ToJsonSchema.throw("patternIntersection", ctx), + predicate: (ctx) => ToJsonSchema.throw("predicate", ctx), + proto: (ctx) => ToJsonSchema.throw("proto", ctx), + symbolKey: (ctx) => ToJsonSchema.throw("symbolKey", ctx), + unit: (ctx) => ToJsonSchema.throw("unit", ctx), + date: (ctx) => ToJsonSchema.throw("date", ctx) + } +}; +var ToJsonSchema = { + Error: ToJsonSchemaError, + throw: (...args2) => { + throw new ToJsonSchema.Error(...args2); + }, + throwInternalOperandError: (kind, schema2) => throwInternalError(`Unexpected JSON Schema input for ${kind}: ${printable(schema2)}`), + defaultConfig +}; + +// 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)); + if ($ark.resolvedConfig) + $ark.resolvedConfig = mergeConfigs($ark.resolvedConfig, result); + return result; +}; +var mergeConfigs = (base, merged) => { + if (!merged) + return base; + const result = { ...base }; + let k; + for (k in merged) { + const keywords2 = { ...base.keywords }; + if (k === "keywords") { + for (const flatAlias in merged[k]) { + const v = merged.keywords[flatAlias]; + if (v === void 0) + continue; + keywords2[flatAlias] = typeof v === "string" ? { description: v } : v; + } + result.keywords = keywords2; + } else if (k === "toJsonSchema") { + result[k] = mergeToJsonSchemaConfigs(base.toJsonSchema, merged.toJsonSchema); + } else if (isNodeKind(k)) { + result[k] = // not casting this makes TS compute a very inefficient + // type that is not needed + { + ...base[k], + ...merged[k] + }; + } else + result[k] = merged[k]; + } + return result; +}; +var mergeToJsonSchemaConfigs = ((baseConfig, mergedConfig) => { + if (!baseConfig) + return mergedConfig ?? {}; + if (!mergedConfig) + return baseConfig; + const result = { ...baseConfig }; + let k; + for (k in mergedConfig) { + if (k === "fallback") { + result.fallback = mergeFallbacks(baseConfig.fallback, mergedConfig.fallback); + } else + result[k] = mergedConfig[k]; + } + return result; +}); +var mergeFallbacks = (base, merged) => { + base = normalizeFallback(base); + merged = normalizeFallback(merged); + const result = {}; + let code; + for (code in ToJsonSchema.defaultConfig.fallback) { + result[code] = merged[code] ?? merged.default ?? base[code] ?? base.default ?? ToJsonSchema.defaultConfig.fallback[code]; + } + return result; +}; +var normalizeFallback = (fallback) => typeof fallback === "function" ? { default: fallback } : fallback ?? {}; + +// node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/config.js +var configure = configureSchema; + +// mcp/arkConfig.ts +configure({ + toJsonSchema: { + dialect: null + } +}); + // node_modules/.pnpm/@modelcontextprotocol+sdk@1.20.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js init_zod(); var LATEST_PROTOCOL_VERSION = "2025-06-18"; @@ -72435,7 +73564,7 @@ var StdioServerTransport = class { import { EventEmitter } from "events"; // node_modules/.pnpm/fuse.js@7.1.0/node_modules/fuse.js/dist/fuse.mjs -function isArray(value2) { +function isArray2(value2) { return !Array.isArray ? getTag(value2) === "[object Array]" : Array.isArray(value2); } var INFINITY = 1 / 0; @@ -72510,7 +73639,7 @@ function createKey(key) { let src = null; let weight = 1; let getFn = null; - if (isString(key) || isArray(key)) { + if (isString(key) || isArray2(key)) { src = key; path = createKeyPath(key); id = createKeyId(key); @@ -72533,10 +73662,10 @@ function createKey(key) { return { path, id, weight, src, getFn }; } function createKeyPath(key) { - return isArray(key) ? key : key.split("."); + return isArray2(key) ? key : key.split("."); } function createKeyId(key) { - return isArray(key) ? key.join(".") : key; + return isArray2(key) ? key.join(".") : key; } function get(obj, path) { let list = []; @@ -72555,7 +73684,7 @@ function get(obj, path) { } if (index === path2.length - 1 && (isString(value2) || isNumber(value2) || isBoolean(value2))) { list.push(toString(value2)); - } else if (isArray(value2)) { + } else if (isArray2(value2)) { arr = true; for (let i = 0, len = value2.length; i < len; i += 1) { deepGet(value2[i], path2, index + 1); @@ -72729,7 +73858,7 @@ var FuseIndex = class { if (!isDefined(value2)) { return; } - if (isArray(value2)) { + if (isArray2(value2)) { let subRecords = []; const stack = [{ nestedArrIndex: -1, value: value2 }]; while (stack.length) { @@ -72744,7 +73873,7 @@ var FuseIndex = class { n: this.norm.get(value3) }; subRecords.push(subRecord); - } else if (isArray(value3)) { + } else if (isArray2(value3)) { value3.forEach((item, k) => { stack.push({ nestedArrIndex: k, @@ -73414,7 +74543,7 @@ var ExtendedSearch = class { } }; var registeredSearchers = []; -function register(...args2) { +function register2(...args2) { registeredSearchers.push(...args2); } function createSearcher(pattern, options) { @@ -73436,7 +74565,7 @@ var KeyType = { }; var isExpression = (query) => !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]); var isPath = (query) => !!query[KeyType.PATH]; -var isLeaf = (query) => !isArray(query) && isObject(query) && !isExpression(query); +var isLeaf = (query) => !isArray2(query) && isObject(query) && !isExpression(query); var convertToExplicit = (query) => ({ [LogicalOperator.AND]: Object.keys(query).map((key) => ({ [key]: query[key] @@ -73470,7 +74599,7 @@ function parse(query, options, { auto = true } = {}) { }; keys.forEach((key) => { const value2 = query2[key]; - if (isArray(value2)) { + if (isArray2(value2)) { value2.forEach((item) => { node2.children.push(next2(item)); }); @@ -73715,7 +74844,7 @@ var Fuse = class { return []; } let matches = []; - if (isArray(value2)) { + if (isArray2(value2)) { value2.forEach(({ v: text, i: idx, n: norm2 }) => { if (!isDefined(text)) { return; @@ -73750,7 +74879,7 @@ Fuse.config = Config; Fuse.parseQuery = parse; } { - register(ExtendedSearch); + register2(ExtendedSearch); } // node_modules/.pnpm/mcp-proxy@5.9.0/node_modules/mcp-proxy/dist/stdio-CsjPjeWC.js @@ -93189,7 +94318,7 @@ var import_ajv$1 = /* @__PURE__ */ __toESM2(require_ajv2(), 1); var import_ajv2 = /* @__PURE__ */ __toESM2(require_ajv2(), 1); // node_modules/.pnpm/mcp-proxy@5.9.0/node_modules/mcp-proxy/dist/index.js -var ParseError = class extends Error { +var ParseError2 = class extends Error { constructor(message, options) { super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line; } @@ -93235,14 +94364,14 @@ function createParser(callbacks) { id = value2.includes("\0") ? void 0 : value2; break; case "retry": - /^\d+$/.test(value2) ? onRetry(parseInt(value2, 10)) : onError(new ParseError(`Invalid \`retry\` value: "${value2}"`, { + /^\d+$/.test(value2) ? onRetry(parseInt(value2, 10)) : onError(new ParseError2(`Invalid \`retry\` value: "${value2}"`, { type: "invalid-retry", value: value2, line })); break; default: - onError(new ParseError(`Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`, { + onError(new ParseError2(`Unknown field "${field.length > 20 ? `${field.slice(0, 20)}\u2026` : field}"`, { type: "unknown-field", field, value: value2, @@ -95052,1119 +96181,6 @@ var FastMCP = class extends FastMCPEventEmitter { // external.ts var ghPullfrogMcpName = "gh_pullfrog"; -// 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]; - } - 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] = 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", - undefined: "undefined", - bigint: "a bigint", - number: "a number", - object: "an object", - string: "a string", - symbol: "a symbol" -}; -var jsTypeOfDescriptions = { - ...domainDescriptions, - function: "a function" -}; - -// 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 ParseError2 = class extends Error { - name = "ParseError"; -}; -var throwParseError = (message) => throwError(message, ParseError2); -var noSuggest = (s) => ` ${s}`; -var ZeroWidthSpace = "\u200B"; - -// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/flatMorph.js -var flatMorph = (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] = append(result[k.group], v); - else - result[k] = v; - } - } - return outputShouldBeArray ? Object.values(result) : result; -}; - -// 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 omit2 = (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 = { - Array, - Boolean, - Date, - Error, - Function, - Map, - Number, - Promise, - RegExp, - Set, - String, - WeakMap, - WeakSet -}; -var FileConstructor = globalThis.File ?? Blob; -var platformConstructors = { - ArrayBuffer, - Blob, - File: FileConstructor, - FormData, - Headers, - Request, - Response, - URL -}; -var typedArrayConstructors = { - Int8Array, - Uint8Array, - Uint8ClampedArray, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array, - BigInt64Array, - BigUint64Array -}; -var builtinConstructors = { - ...ecmascriptConstructors, - ...platformConstructors, - ...typedArrayConstructors, - String, - 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 isArray2 = Array.isArray; -var ecmascriptDescriptions = { - 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 platformDescriptions = { - 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 typedArrayDescriptions = { - 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 objectKindDescriptions = { - ...ecmascriptDescriptions, - ...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 cached2 = (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 = cached2(() => { - try { - return new Function("return false")(); - } catch { - return true; - } -}); - -// node_modules/.pnpm/@ark+util@0.53.0/node_modules/@ark/util/out/generics.js -var brand = noSuggest("brand"); -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 = () => { - 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 env = globalThis.process?.env ?? {}; -var isomorphic = { - fileName, - env -}; - -// 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; - return `^(?:${source})$`; -}; -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; -var positiveIntegerPattern = /[1-9]\d*/.source; -var looseDecimalPattern = /\.\d+/.source; -var strictDecimalPattern = /\.\d*[1-9]/.source; -var createNumberMatcher = (opts) => anchoredRegex(RegexPatterns.negativeLookahead(anchoredNegativeZeroPattern) + RegexPatterns.nonCapturingGroup("-?" + RegexPatterns.nonCapturingGroup(RegexPatterns.nonCapturingGroup("0|" + positiveIntegerPattern) + RegexPatterns.nonCapturingGroup(opts.decimalPattern) + "?") + (opts.allowDecimalOnly ? "|" + opts.decimalPattern : "") + "?")); -var wellFormedNumberMatcher = createNumberMatcher({ - decimalPattern: strictDecimalPattern, - allowDecimalOnly: false -}); -var isWellFormedNumber = wellFormedNumberMatcher.test.bind(wellFormedNumberMatcher); -var numericStringMatcher = createNumberMatcher({ - decimalPattern: looseDecimalPattern, - 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"; -var initialRegistryContents = { - version: arkUtilVersion, - filename: isomorphic.fileName(), - FileConstructor -}; -var registry2 = initialRegistryContents; -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; - registry2[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(${register2(v)})`, - onFunction: (v) => `Function(${register2(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 = (path, prop, ...[opts]) => { - const stringifySymbol = opts?.stringifySymbol ?? printable; - let propAccessChain = path; - switch (typeof prop) { - case "string": - propAccessChain = isDotAccessible(prop) ? path === "" ? prop : `${path}.${prop}` : `${path}[${JSON.stringify(prop)}]`; - break; - case "number": - propAccessChain = `${path}[${prop}]`; - break; - case "symbol": - propAccessChain = `${path}[${stringifySymbol(prop)}]`; - break; - default: - if (opts?.stringifyNonKey) - propAccessChain = `${path}[${opts.stringifyNonKey(prop)}]`; - else { - throwParseError(`${printable(prop)} must be a PropertyKey or stringifyNonKey must be passed to options`); - } - } - return propAccessChain; -}; -var stringifyPath = (path, ...opts) => path.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 path of this) { - propString = appendStringifiedKey(propString, path); - 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"); - -// 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) - _registryName = `$ark${suffix++}`; -var registryName = _registryName; -globalThis[registryName] = registry2; -var $ark = registry2; -var reference = (name) => `${registryName}.${name}`; -var registeredReference = (value2) => reference(register2(value2)); - -// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/compile.js -var CompiledFunction = class extends CastableBase { - argNames; - body = ""; - constructor(...args2) { - super(); - 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`); - } - ; - this[arg] = arg; - } - } - indentation = 0; - indent() { - this.indentation += 4; - return this; - } - dedent() { - this.indentation -= 4; - return this; - } - prop(key, optional = false) { - return compileLiteralPropAccess(key, optional); - } - index(key, optional = false) { - return indexPropAccess(`${key}`, optional); - } - line(statement) { - ; - this.body += `${" ".repeat(this.indentation)}${statement} -`; - return this; - } - const(identifier, expression) { - this.line(`const ${identifier} = ${expression}`); - return this; - } - let(identifier, expression) { - return this.line(`let ${identifier} = ${expression}`); - } - set(identifier, expression) { - return this.line(`${identifier} = ${expression}`); - } - if(condition, then) { - return this.block(`if (${condition})`, then); - } - elseIf(condition, then) { - return this.block(`else if (${condition})`, then); - } - else(then) { - return this.block("else", then); - } - /** Current index is "i" */ - for(until, body, initialValue = 0) { - return this.block(`for (let i = ${initialValue}; ${until}; i++)`, body); - } - /** Current key is "k" */ - forIn(object2, body) { - return this.block(`for (const k in ${object2})`, body); - } - block(prefix, contents, suffix2 = "") { - this.line(`${prefix} {`); - this.indent(); - contents(this); - this.dedent(); - return this.line(`}${suffix2}`); - } - return(expression = "") { - return this.line(`return ${expression}`); - } - write(name = "anonymous", indent2 = 0) { - return `${name}(${this.argNames.join(", ")}) { ${indent2 ? this.body.split("\n").map((l) => " ".repeat(indent2) + `${l}`).join("\n") : this.body} }`; - } - compile() { - return new DynamicFunction(...this.argNames, this.body); - } -}; -var compileSerializedValue = (value2) => hasDomain(value2, "object") || typeof value2 === "symbol" ? registeredReference(value2) : serializePrimitive(value2); -var compileLiteralPropAccess = (key, optional = false) => { - if (typeof key === "string" && isDotAccessible(key)) - return `${optional ? "?" : ""}.${key}`; - return indexPropAccess(serializeLiteralKey(key), optional); -}; -var serializeLiteralKey = (key) => typeof key === "symbol" ? registeredReference(key) : JSON.stringify(key); -var indexPropAccess = (key, optional = false) => `${optional ? "?." : ""}[${key}]`; -var NodeCompiler = class extends CompiledFunction { - traversalKind; - optimistic; - constructor(ctx) { - super("data", "ctx"); - this.traversalKind = ctx.kind; - this.optimistic = ctx.optimistic === true; - } - invoke(node2, opts) { - const arg = opts?.arg ?? this.data; - const requiresContext = typeof node2 === "string" ? true : this.requiresContextFor(node2); - const id = typeof node2 === "string" ? node2 : node2.id; - if (requiresContext) - return `${this.referenceToId(id, opts)}(${arg}, ${this.ctx})`; - return `${this.referenceToId(id, opts)}(${arg})`; - } - referenceToId(id, opts) { - const invokedKind = opts?.kind ?? this.traversalKind; - const base = `this.${id}${invokedKind}`; - return opts?.bind ? `${base}.bind(${opts?.bind})` : base; - } - requiresContextFor(node2) { - return this.traversalKind === "Apply" || node2.allowsRequiresContext; - } - initializeErrorCount() { - return this.const("errorCount", "ctx.currentErrorCount"); - } - returnIfFail() { - return this.if("ctx.currentErrorCount > errorCount", () => this.return()); - } - returnIfFailFast() { - return this.if("ctx.failFast && ctx.currentErrorCount > errorCount", () => this.return()); - } - traverseKey(keyExpression, accessExpression, node2) { - const requiresContext = this.requiresContextFor(node2); - if (requiresContext) - this.line(`${this.ctx}.path.push(${keyExpression})`); - this.check(node2, { - arg: accessExpression - }); - if (requiresContext) - this.line(`${this.ctx}.path.pop()`); - return this; - } - check(node2, opts) { - return this.traversalKind === "Allows" ? this.if(`!${this.invoke(node2, opts)}`, () => this.return(false)) : this.line(this.invoke(node2, opts)); - } -}; - -// 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? - flatMorph(o, (k, v) => [k, isArray2(v) ? [...v] : v]) -); -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.53.0/node_modules/@ark/schema/out/shared/implement.js -var basisKinds = ["unit", "proto", "domain"]; -var structuralKinds = [ - "required", - "optional", - "index", - "sequence" -]; -var prestructuralKinds = [ - "pattern", - "divisor", - "exactLength", - "max", - "min", - "maxLength", - "minLength", - "before", - "after" -]; -var refinementKinds = [ - ...prestructuralKinds, - "structure", - "predicate" -]; -var constraintKinds = [...refinementKinds, ...structuralKinds]; -var rootKinds = [ - "alias", - "union", - "morph", - "unit", - "intersection", - "proto", - "domain" -]; -var nodeKinds = [...rootKinds, ...constraintKinds]; -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); -var unionChildKinds = [ - ...schemaKindsRightOf("union"), - "alias" -]; -var morphChildKinds = [ - ...schemaKindsRightOf("morph"), - "alias" -]; -var defaultValueSerializer = (v) => { - if (typeof v === "string" || typeof v === "boolean" || v === null) - return v; - if (typeof v === "number") { - if (Number.isNaN(v)) - return "NaN"; - if (v === Number.POSITIVE_INFINITY) - return "Infinity"; - if (v === Number.NEGATIVE_INFINITY) - return "-Infinity"; - return v; - } - return compileSerializedValue(v); -}; -var compileObjectLiteral = (ctx) => { - let result = "{ "; - for (const [k, v] of Object.entries(ctx)) - result += `${k}: ${compileSerializedValue(v)}, `; - return result + " }"; -}; -var implementNode = (_) => { - const implementation23 = _; - if (implementation23.hasAssociatedError) { - implementation23.defaults.expected ??= (ctx) => "description" in ctx ? ctx.description : implementation23.defaults.description(ctx); - 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) - return ctx.problem; - const problemWithLocation = `${ctx.propString} ${ctx.problem}`; - if (problemWithLocation[0] === "[") { - return `value at ${problemWithLocation}`; - } - return problemWithLocation; - }; - } - return implementation23; -}; - -// 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(printable(context, { quoteKeys: false, indent: 4 })); - this.code = code; - this.context = context; - } - hasCode(code) { - return this.code === code; - } -}; -var defaultConfig = { - dialect: "https://json-schema.org/draft/2020-12/schema", - useRefs: false, - fallback: { - arrayObject: (ctx) => ToJsonSchema.throw("arrayObject", ctx), - arrayPostfix: (ctx) => ToJsonSchema.throw("arrayPostfix", ctx), - defaultValue: (ctx) => ToJsonSchema.throw("defaultValue", ctx), - domain: (ctx) => ToJsonSchema.throw("domain", ctx), - morph: (ctx) => ToJsonSchema.throw("morph", ctx), - patternIntersection: (ctx) => ToJsonSchema.throw("patternIntersection", ctx), - predicate: (ctx) => ToJsonSchema.throw("predicate", ctx), - proto: (ctx) => ToJsonSchema.throw("proto", ctx), - symbolKey: (ctx) => ToJsonSchema.throw("symbolKey", ctx), - unit: (ctx) => ToJsonSchema.throw("unit", ctx), - date: (ctx) => ToJsonSchema.throw("date", ctx) - } -}; -var ToJsonSchema = { - Error: ToJsonSchemaError, - throw: (...args2) => { - throw new ToJsonSchema.Error(...args2); - }, - throwInternalOperandError: (kind, schema2) => throwInternalError(`Unexpected JSON Schema input for ${kind}: ${printable(schema2)}`), - defaultConfig -}; - -// node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/config.js -$ark.config ??= {}; -var mergeConfigs = (base, merged) => { - if (!merged) - return base; - const result = { ...base }; - let k; - for (k in merged) { - const keywords2 = { ...base.keywords }; - if (k === "keywords") { - for (const flatAlias in merged[k]) { - const v = merged.keywords[flatAlias]; - if (v === void 0) - continue; - keywords2[flatAlias] = typeof v === "string" ? { description: v } : v; - } - result.keywords = keywords2; - } else if (k === "toJsonSchema") { - result[k] = mergeToJsonSchemaConfigs(base.toJsonSchema, merged.toJsonSchema); - } else if (isNodeKind(k)) { - result[k] = // not casting this makes TS compute a very inefficient - // type that is not needed - { - ...base[k], - ...merged[k] - }; - } else - result[k] = merged[k]; - } - return result; -}; -var mergeToJsonSchemaConfigs = ((baseConfig, mergedConfig) => { - if (!baseConfig) - return mergedConfig ?? {}; - if (!mergedConfig) - return baseConfig; - const result = { ...baseConfig }; - let k; - for (k in mergedConfig) { - if (k === "fallback") { - result.fallback = mergeFallbacks(baseConfig.fallback, mergedConfig.fallback); - } else - result[k] = mergedConfig[k]; - } - return result; -}); -var mergeFallbacks = (base, merged) => { - base = normalizeFallback(base); - merged = normalizeFallback(merged); - const result = {}; - let code; - for (code in ToJsonSchema.defaultConfig.fallback) { - result[code] = merged[code] ?? merged.default ?? base[code] ?? base.default ?? ToJsonSchema.defaultConfig.fallback[code]; - } - return result; -}; -var normalizeFallback = (fallback) => typeof fallback === "function" ? { default: fallback } : fallback ?? {}; - // node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/shared/errors.js var ArkError = class _ArkError extends CastableBase { [arkKind] = "error"; @@ -96742,7 +96758,7 @@ var BaseNode = class extends Callable { keySchemaImplementation.reduceIo(ioKind, ioInner, v); else if (keySchemaImplementation.child) { const childValue = v; - ioInner[k] = isArray2(childValue) ? childValue.map((child) => ioKind === "in" ? child.rawIn : child.rawOut) : ioKind === "in" ? childValue.rawIn : childValue.rawOut; + ioInner[k] = isArray(childValue) ? childValue.map((child) => ioKind === "in" ? child.rawIn : child.rawOut) : ioKind === "in" ? childValue.rawIn : childValue.rawOut; } else ioInner[k] = v; } @@ -96853,7 +96869,7 @@ var BaseNode = class extends Callable { if (!this.impl.keys[k].child) return [k, v]; const children = v; - if (!isArray2(children)) { + if (!isArray(children)) { const transformed2 = children._transform(mapper, ctx); return transformed2 ? [k, transformed2] : []; } @@ -97009,7 +97025,7 @@ var Disjoint = class _Disjoint extends Array { } }; var describeReasons = (l, r) => `${describeReason(l)} and ${describeReason(r)}`; -var describeReason = (value2) => isNode(value2) ? value2.expression : isArray2(value2) ? value2.map(describeReason).join(" | ") || "never" : String(value2); +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.53.0/node_modules/@ark/schema/out/shared/intersections.js @@ -97162,7 +97178,7 @@ var InternalPrimitiveConstraint = class extends BaseConstraint { } }; var constraintKeyParser = (kind) => (schema2, ctx) => { - if (isArray2(schema2)) { + if (isArray(schema2)) { if (schema2.length === 0) { return; } @@ -97863,7 +97879,7 @@ var discriminateRootKind = (schema2) => { return throwParseError(writeInvalidSchemaMessage(schema2)); if ("morphs" in schema2) return "morph"; - if ("branches" in schema2 || isArray2(schema2)) + if ("branches" in schema2 || isArray(schema2)) return "union"; if ("unit" in schema2) return "unit"; @@ -97880,7 +97896,7 @@ var discriminateRootKind = (schema2) => { }; var writeInvalidSchemaMessage = (schema2) => `${printable(schema2)} is not a valid type schema`; var nodeCountsByPrefix = {}; -var serializeListableChild = (listableNode) => isArray2(listableNode) ? listableNode.map((node2) => node2.collapsibleJson) : listableNode.collapsibleJson; +var serializeListableChild = (listableNode) => isArray(listableNode) ? listableNode.map((node2) => node2.collapsibleJson) : listableNode.collapsibleJson; var nodesByRegisteredId = {}; $ark.nodesByRegisteredId = nodesByRegisteredId; var registerNodeId = (prefix) => { @@ -97938,7 +97954,7 @@ var createNode = ({ id, kind, inner, meta, $, ignoreCache }) => { innerJson[k] = serialize(v); if (keyImpl.child === true) { const listableNode = v; - if (isArray2(listableNode)) + if (isArray(listableNode)) children.push(...listableNode); else children.push(listableNode); @@ -98135,7 +98151,7 @@ var OptionalNode = class extends BaseProp { const baseIn = super.rawIn; if (!this.hasDefault()) return baseIn; - return this.$.node("optional", omit2(baseIn.inner, { default: true }), { + return this.$.node("optional", omit(baseIn.inner, { default: true }), { prereduced: true }); } @@ -98498,7 +98514,7 @@ var BaseRoot = class extends BaseNode { onUndeclaredKey(cfg) { const rule = typeof cfg === "string" ? cfg : cfg.rule; const deep = typeof cfg === "string" ? false : cfg.deep; - return this.$.finalize(this.transform((kind, inner) => kind === "structure" ? rule === "ignore" ? omit2(inner, { undeclared: 1 }) : { ...inner, undeclared: rule } : inner, deep ? void 0 : { shouldTransform: (node2) => !includes(structuralKinds, node2.kind) })); + return this.$.finalize(this.transform((kind, inner) => kind === "structure" ? rule === "ignore" ? omit(inner, { undeclared: 1 }) : { ...inner, undeclared: rule } : inner, deep ? void 0 : { shouldTransform: (node2) => !includes(structuralKinds, node2.kind) })); } hasEqualMorphs(r) { if (!this.includesTransform && !r.includesTransform) @@ -99284,7 +99300,7 @@ var implementation17 = implementNode({ } } }, - normalize: (schema2) => isArray2(schema2) ? { branches: schema2 } : schema2, + normalize: (schema2) => isArray(schema2) ? { branches: schema2 } : schema2, reduce: (inner, $) => { const reducedBranches = reduceBranches(inner); if (reducedBranches.length === 1) @@ -101169,7 +101185,7 @@ var bindModule = (module, $) => new RootModule(flatMorph(module, (alias, value2) ])); // node_modules/.pnpm/@ark+schema@0.53.0/node_modules/@ark/schema/out/scope.js -var schemaBranchesOf = (schema2) => isArray2(schema2) ? schema2 : "branches" in schema2 && isArray2(schema2.branches) ? schema2.branches : void 0; +var schemaBranchesOf = (schema2) => isArray(schema2) ? schema2 : "branches" in schema2 && isArray(schema2.branches) ? schema2.branches : void 0; 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 = {}; @@ -102293,7 +102309,7 @@ var doubleAtMessage = `At most one key matcher may be specified per expression`; // node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/parser/property.js var parseProperty = (def, ctx) => { - if (isArray2(def)) { + if (isArray(def)) { if (def[1] === "=") return [ctx.$.parseOwnDefinitionFormat(def[0], ctx), "=", def[2]]; if (def[1] === "?") @@ -102333,7 +102349,7 @@ var parseObjectLiteral = (def, ctx) => { const parsedValue = parseProperty(v, ctx); const parsedEntryKey = parsedKey; if (parsedKey.kind === "required") { - if (!isArray2(parsedValue)) { + if (!isArray(parsedValue)) { appendNamedProp(structure, "required", { key: parsedKey.normalized, value: parsedValue @@ -102350,7 +102366,7 @@ var parseObjectLiteral = (def, ctx) => { } continue; } - if (isArray2(parsedValue)) { + if (isArray(parsedValue)) { if (parsedValue[1] === "?") throwParseError(invalidOptionalKeyKindMessage); if (parsedValue[1] === "=") @@ -102468,7 +102484,7 @@ var parseTupleLiteral = (def, ctx) => { i++; } const parsedProperty = parseProperty(def[i], ctx); - const [valueNode, operator, possibleDefaultValue] = !isArray2(parsedProperty) ? [parsedProperty] : parsedProperty; + const [valueNode, operator, possibleDefaultValue] = !isArray(parsedProperty) ? [parsedProperty] : parsedProperty; i++; if (spread) { if (!valueNode.extends($ark.intrinsic.Array)) @@ -102707,7 +102723,7 @@ var InternalScope = class _InternalScope extends BaseScope { if (!isScopeAlias && !ctx.args) ctx.args = { this: ctx.id }; const result = parseInnerDefinition(def, ctx); - if (isArray2(result)) { + if (isArray(result)) { if (result[1] === "=") return throwParseError(shallowDefaultableMessage); if (result[1] === "?") @@ -102768,7 +102784,7 @@ var arkArray = Scope.module({ }); // node_modules/.pnpm/arktype@2.1.25/node_modules/arktype/out/keywords/FormData.js -var value = rootSchema(["string", registry2.FileConstructor]); +var value = rootSchema(["string", registry.FileConstructor]); var parsedFormDataValue = value.rawOr(value.array()); var parsed = rootSchema({ meta: "an object representing parsed form data", @@ -102789,7 +102805,7 @@ var arkFormData = Scope.module({ for (const [k, v] of data) { if (k in result) { const existing = result[k]; - if (typeof existing === "string" || existing instanceof registry2.FileConstructor) + if (typeof existing === "string" || existing instanceof registry.FileConstructor) result[k] = [existing, v]; else existing.push(v); @@ -107160,7 +107176,7 @@ function parseRepoContext() { } // mcp/shared.ts -var getMcpContext = cached2(() => { +var getMcpContext = cached(() => { const githubInstallationToken = process.env.GITHUB_INSTALLATION_TOKEN; if (!githubInstallationToken) { throw new Error("GITHUB_INSTALLATION_TOKEN environment variable is required"); @@ -107720,7 +107736,6 @@ addTools(server, [ CreateWorkingCommentTool, UpdateWorkingCommentTool, IssueTool, - // ListFilesTool, PullRequestTool, ReviewTool, PullRequestInfoTool, diff --git a/mcp/README.md b/mcp/README.md index bc18b96..0d9eefd 100644 --- a/mcp/README.md +++ b/mcp/README.md @@ -1,4 +1,4 @@ -# gh-pullfrog MCP Tools +# gh_pullfrog MCP Tools this directory contains the mcp (model context protocol) server tools for interacting with github. @@ -22,7 +22,7 @@ all logs from all failed workflow runs in the check suite, including: **example:** ```typescript // when handling a check_suite_completed webhook -await mcp.call("gh-pullfrog/get_check_suite_logs", { +await mcp.call("gh_pullfrog/get_check_suite_logs", { check_suite_id: check_suite.id }); ``` @@ -48,7 +48,7 @@ array of review comments including: **example:** ```typescript // when handling a pull_request_review_submitted webhook -await mcp.call("gh-pullfrog/get_review_comments", { +await mcp.call("gh_pullfrog/get_review_comments", { pull_number: 47, review_id: review.id }); @@ -69,7 +69,7 @@ array of reviews with: **example:** ```typescript -await mcp.call("gh-pullfrog/list_pull_request_reviews", { +await mcp.call("gh_pullfrog/list_pull_request_reviews", { pull_number: 47 }); ``` diff --git a/play.ts b/play.ts index 912acf7..c7b7a26 100644 --- a/play.ts +++ b/play.ts @@ -24,7 +24,7 @@ export async function run( const inputs: Required = { prompt, - agent: "claude", + agent: "codex", ...flatMorph(agents, (_, agent) => agent.apiKeyNames.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]]) ),