@presidio-dev/specifai-mcp-server 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -17
- package/dist/index.js +21 -12
- package/dist/index.js.map +5 -4
- package/package.json +4 -1
package/dist/index.js.map
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"sources": ["../node_modules/zod/lib/index.mjs", "../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js", "../src/services/server.service.ts", "../src/services/document.service.ts", "../src/services/file.service.ts", "../src/utils/logger.ts", "../index.ts"],
|
3
|
+
"sources": ["../node_modules/zod/lib/index.mjs", "../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js", "../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js", "../src/services/server.service.ts", "../src/services/document.service.ts", "../src/services/file.service.ts", "../src/utils/logger.ts", "../node_modules/minisearch/dist/es/index.js", "../index.ts"],
|
4
4
|
"sourcesContent": [
|
5
5
|
"var util;\n(function (util) {\n util.assertEqual = (val) => val;\n function assertIs(_arg) { }\n util.assertIs = assertIs;\n function assertNever(_x) {\n throw new Error();\n }\n util.assertNever = assertNever;\n util.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util.getValidEnumValues = (obj) => {\n const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util.objectValues(filtered);\n };\n util.objectValues = (obj) => {\n return util.objectKeys(obj).map(function (e) {\n return obj[e];\n });\n };\n util.objectKeys = typeof Object.keys === \"function\" // eslint-disable-line ban/ban\n ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban\n : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return undefined;\n };\n util.isInteger = typeof Number.isInteger === \"function\"\n ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban\n : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array\n .map((val) => (typeof val === \"string\" ? `'${val}'` : val))\n .join(separator);\n }\n util.joinValues = joinValues;\n util.jsonStringifyReplacer = (_, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nvar objectUtil;\n(function (objectUtil) {\n objectUtil.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second, // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nconst ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\",\n]);\nconst getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then &&\n typeof data.then === \"function\" &&\n data.catch &&\n typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n};\n\nconst ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\",\n]);\nconst quotelessJson = (obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n};\nclass ZodError extends Error {\n get errors() {\n return this.issues;\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n // eslint-disable-next-line ban/ban\n Object.setPrototypeOf(this, actualProto);\n }\n else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n format(_mapper) {\n const mapper = _mapper ||\n function (issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n }\n else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n }\n else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n // if (typeof el === \"string\") {\n // curr[el] = curr[el] || { _errors: [] };\n // } else if (typeof el === \"number\") {\n // const errorArray: any = [];\n // errorArray._errors = [];\n // curr[el] = curr[el] || errorArray;\n // }\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(this);\n return fieldErrors;\n }\n static assert(value) {\n if (!(value instanceof ZodError)) {\n throw new Error(`Not a ZodError: ${value}`);\n }\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n}\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\n\nconst errorMap = (issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n }\n else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n }\n else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n }\n else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n }\n else {\n util.assertNever(issue.validation);\n }\n }\n else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n }\n else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly equal to `\n : issue.inclusive\n ? `greater than or equal to `\n : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `less than or equal to`\n : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact\n ? `exactly`\n : issue.inclusive\n ? `smaller than or equal to`\n : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n};\n\nlet overrideErrorMap = errorMap;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n\nconst makeIssue = (params) => {\n const { data, path, errorMaps, issueData } = params;\n const fullPath = [...path, ...(issueData.path || [])];\n const fullIssue = {\n ...issueData,\n path: fullPath,\n };\n if (issueData.message !== undefined) {\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message,\n };\n }\n let errorMessage = \"\";\n const maps = errorMaps\n .filter((m) => !!m)\n .slice()\n .reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: errorMessage,\n };\n};\nconst EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const overrideMap = getErrorMap();\n const issue = makeIssue({\n issueData: issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap, // contextual error map is first priority\n ctx.schemaErrorMap, // then schema-bound map if available\n overrideMap, // then global override map\n overrideMap === errorMap ? undefined : errorMap, // then global default map\n ].filter((x) => !!x),\n });\n ctx.common.issues.push(issue);\n}\nclass ParseStatus {\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n });\n }\n return ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" &&\n (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n}\nconst INVALID = Object.freeze({\n status: \"aborted\",\n});\nconst DIRTY = (value) => ({ status: \"dirty\", value });\nconst OK = (value) => ({ status: \"valid\", value });\nconst isAborted = (x) => x.status === \"aborted\";\nconst isDirty = (x) => x.status === \"dirty\";\nconst isValid = (x) => x.status === \"valid\";\nconst isAsync = (x) => typeof Promise !== \"undefined\" && x instanceof Promise;\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\nvar errorUtil;\n(function (errorUtil) {\n errorUtil.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (errorUtil = {}));\n\nvar _ZodEnum_cache, _ZodNativeEnum_cache;\nclass ParseInputLazyPath {\n constructor(parent, value, path, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n }\n else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n}\nconst handleResult = (ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n }\n else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n },\n };\n }\n};\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap, invalid_type_error, required_error, description } = params;\n if (errorMap && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap)\n return { errorMap: errorMap, description };\n const customMap = (iss, ctx) => {\n var _a, _b;\n const { message } = params;\n if (iss.code === \"invalid_enum_value\") {\n return { message: message !== null && message !== void 0 ? message : ctx.defaultError };\n }\n if (typeof ctx.data === \"undefined\") {\n return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };\n }\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };\n };\n return { errorMap: customMap, description };\n}\nclass ZodType {\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return (ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n });\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent,\n },\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n \"~validate\"(data) {\n var _a, _b;\n const ctx = {\n common: {\n issues: [],\n async: !!this[\"~standard\"].async,\n },\n path: [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n if (!this[\"~standard\"].async) {\n try {\n const result = this._parseSync({ data, path: [], parent: ctx });\n return isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n };\n }\n catch (err) {\n if ((_b = (_a = err === null || err === void 0 ? void 0 : err.message) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(\"encountered\")) {\n this[\"~standard\"].async = true;\n }\n ctx.common = {\n issues: [],\n async: true,\n };\n }\n }\n return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result)\n ? {\n value: result.value,\n }\n : {\n issues: ctx.common.issues,\n });\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true,\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data),\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult)\n ? maybeAsyncResult\n : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = (val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n }\n else if (typeof message === \"function\") {\n return message(val);\n }\n else {\n return message;\n }\n };\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = () => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val),\n });\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n }\n else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\"\n ? refinementData(val, ctx)\n : refinementData);\n return false;\n }\n else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement },\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n constructor(def) {\n /** Alias of safeParseAsync */\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n this[\"~standard\"] = {\n version: 1,\n vendor: \"zod\",\n validate: (data) => this[\"~validate\"](data),\n };\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform },\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def),\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description,\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(undefined).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n}\nconst cuidRegex = /^c[^\\s-]{8,}$/i;\nconst cuid2Regex = /^[0-9a-z]+$/;\nconst ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;\n// const uuidRegex =\n// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;\nconst uuidRegex = /^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$/i;\nconst nanoidRegex = /^[a-z0-9_-]{21}$/i;\nconst jwtRegex = /^[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]+\\.[A-Za-z0-9-_]*$/;\nconst durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n// from https://stackoverflow.com/a/46181/1550155\n// old version: too slow, didn't support unicode\n// const emailRegex = /^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))$/i;\n//old email regex\n// const emailRegex = /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@((?!-)([^<>()[\\].,;:\\s@\"]+\\.)+[^<>()[\\].,;:\\s@\"]{1,})[^-<>()[\\].,;:\\s@\"]$/i;\n// eslint-disable-next-line\n// const emailRegex =\n// /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\])|(\\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\\.[A-Za-z]{2,})+))$/;\n// const emailRegex =\n// /^[a-zA-Z0-9\\.\\!\\#\\$\\%\\&\\'\\*\\+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// const emailRegex =\n// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i;\nconst emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_'+\\-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\n// const emailRegex =\n// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\\.[a-z0-9\\-]+)*$/i;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emojiRegex = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nlet emojiRegex;\n// faster, simpler, safer\nconst ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nconst ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/(3[0-2]|[12]?[0-9])$/;\n// const ipv6Regex =\n// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\nconst ipv6Regex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0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nconst base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;\n// https://base64.guru/standards/base64url\nconst base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;\n// simple\n// const dateRegexSource = `\\\\d{4}-\\\\d{2}-\\\\d{2}`;\n// no leap year validation\n// const dateRegexSource = `\\\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\\\d|2\\\\d))`;\n// with leap year validation\nconst 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])))`;\nconst dateRegex = new RegExp(`^${dateRegexSource}$`);\nfunction timeRegexSource(args) {\n // let regex = `\\\\d{2}:\\\\d{2}:\\\\d{2}`;\n let regex = `([01]\\\\d|2[0-3]):[0-5]\\\\d:[0-5]\\\\d`;\n if (args.precision) {\n regex = `${regex}\\\\.\\\\d{${args.precision}}`;\n }\n else if (args.precision == null) {\n regex = `${regex}(\\\\.\\\\d+)?`;\n }\n return regex;\n}\nfunction timeRegex(args) {\n return new RegExp(`^${timeRegexSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nfunction datetimeRegex(args) {\n let regex = `${dateRegexSource}T${timeRegexSource(args)}`;\n const opts = [];\n opts.push(args.local ? `Z?` : `Z`);\n if (args.offset)\n opts.push(`([+-]\\\\d{2}:?\\\\d{2})`);\n regex = `${regex}(${opts.join(\"|\")})`;\n return new RegExp(`^${regex}$`);\n}\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\nfunction isValidJWT(jwt, alg) {\n if (!jwtRegex.test(jwt))\n return false;\n try {\n const [header] = jwt.split(\".\");\n // Convert base64url to base64\n const base64 = header\n .replace(/-/g, \"+\")\n .replace(/_/g, \"/\")\n .padEnd(header.length + ((4 - (header.length % 4)) % 4), \"=\");\n const decoded = JSON.parse(atob(base64));\n if (typeof decoded !== \"object\" || decoded === null)\n return false;\n if (!decoded.typ || !decoded.alg)\n return false;\n if (alg && decoded.alg !== alg)\n return false;\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nfunction isValidCidr(ip, version) {\n if ((version === \"v4\" || !version) && ipv4CidrRegex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6CidrRegex.test(ip)) {\n return true;\n }\n return false;\n}\nclass ZodString extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message,\n });\n }\n status.dirty();\n }\n }\n else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"emoji\") {\n if (!emojiRegex) {\n emojiRegex = new RegExp(_emojiRegex, \"u\");\n }\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"nanoid\") {\n if (!nanoidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"nanoid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n }\n catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n }\n else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n }\n else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n }\n else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"date\") {\n const regex = dateRegex;\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"date\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"time\") {\n const regex = timeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"time\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"duration\") {\n if (!durationRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"duration\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"jwt\") {\n if (!isValidJWT(input.data, check.alg)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"jwt\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"cidr\") {\n if (!isValidCidr(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cidr\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64\") {\n if (!base64Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"base64url\") {\n if (!base64urlRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"base64url\",\n code: ZodIssueCode.invalid_string,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _regex(regex, validation, message) {\n return this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message),\n });\n }\n _addCheck(check) {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n nanoid(message) {\n return this._addCheck({ kind: \"nanoid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n base64(message) {\n return this._addCheck({ kind: \"base64\", ...errorUtil.errToObj(message) });\n }\n base64url(message) {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return this._addCheck({\n kind: \"base64url\",\n ...errorUtil.errToObj(message),\n });\n }\n jwt(options) {\n return this._addCheck({ kind: \"jwt\", ...errorUtil.errToObj(options) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n cidr(options) {\n return this._addCheck({ kind: \"cidr\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a, _b;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n local: false,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n date(message) {\n return this._addCheck({ kind: \"date\", message });\n }\n time(options) {\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"time\",\n precision: null,\n message: options,\n });\n }\n return this._addCheck({\n kind: \"time\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n duration(message) {\n return this._addCheck({ kind: \"duration\", ...errorUtil.errToObj(message) });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex: regex,\n ...errorUtil.errToObj(message),\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value: value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message),\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value: value,\n ...errorUtil.errToObj(message),\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message),\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message),\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message),\n });\n }\n /**\n * Equivalent to `.min(1)`\n */\n nonempty(message) {\n return this.min(1, errorUtil.errToObj(message));\n }\n trim() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }],\n });\n }\n toLowerCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }],\n });\n }\n toUpperCase() {\n return new ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }],\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isDate() {\n return !!this._def.checks.find((ch) => ch.kind === \"date\");\n }\n get isTime() {\n return !!this._def.checks.find((ch) => ch.kind === \"time\");\n }\n get isDuration() {\n return !!this._def.checks.find((ch) => ch.kind === \"duration\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isNANOID() {\n return !!this._def.checks.find((ch) => ch.kind === \"nanoid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get isCIDR() {\n return !!this._def.checks.find((ch) => ch.kind === \"cidr\");\n }\n get isBase64() {\n return !!this._def.checks.find((ch) => ch.kind === \"base64\");\n }\n get isBase64url() {\n // base64url encoding is a modification of base64 that can safely be used in URLs and filenames\n return !!this._def.checks.find((ch) => ch.kind === \"base64url\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\n// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / Math.pow(10, decCount);\n}\nclass ZodNumber extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message),\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value: value,\n message: errorUtil.toString(message),\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message),\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message),\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" ||\n (ch.kind === \"multipleOf\" && util.isInteger(ch.value)));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" ||\n ch.kind === \"int\" ||\n ch.kind === \"multipleOf\") {\n return true;\n }\n else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n}\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodBigInt extends ZodType {\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n try {\n input.data = BigInt(input.data);\n }\n catch (_a) {\n return this._getInvalidInput(input);\n }\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n return this._getInvalidInput(input);\n }\n let ctx = undefined;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive\n ? input.data < check.value\n : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n const tooBig = check.inclusive\n ? input.data > check.value\n : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message,\n });\n status.dirty();\n }\n }\n else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message,\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _getInvalidInput(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message),\n },\n ],\n });\n }\n _addCheck(check) {\n return new ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message),\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message),\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message),\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n}\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params),\n });\n};\nclass ZodBoolean extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params),\n });\n};\nclass ZodDate extends ZodType {\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_date,\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = undefined;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\",\n });\n status.dirty();\n }\n }\n else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime()),\n };\n }\n _addCheck(check) {\n return new ZodDate({\n ...this._def,\n checks: [...this._def.checks, check],\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message),\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n}\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params),\n });\n};\nclass ZodSymbol extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params),\n });\n};\nclass ZodUndefined extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params),\n });\n};\nclass ZodNull extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params),\n });\n};\nclass ZodAny extends ZodType {\n constructor() {\n super(...arguments);\n // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params),\n });\n};\nclass ZodUnknown extends ZodType {\n constructor() {\n super(...arguments);\n // required\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n}\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params),\n });\n};\nclass ZodNever extends ZodType {\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n}\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params),\n });\n};\nclass ZodVoid extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n}\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params),\n });\n};\nclass ZodArray extends ZodType {\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: (tooSmall ? def.exactLength.value : undefined),\n maximum: (tooBig ? def.exactLength.value : undefined),\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message,\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message,\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message,\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result) => {\n return ParseStatus.mergeArray(status, result);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) },\n });\n }\n max(maxLength, message) {\n return new ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) },\n });\n }\n length(len, message) {\n return new ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) },\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params),\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: () => newShape,\n });\n }\n else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element),\n });\n }\n else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n }\n else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n }\n else {\n return schema;\n }\n}\nclass ZodObject extends ZodType {\n constructor() {\n super(...arguments);\n this._cached = null;\n /**\n * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.\n * If you want to pass through unknown properties, use `.passthrough()` instead.\n */\n this.nonstrict = this.passthrough;\n // extend<\n // Augmentation extends ZodRawShape,\n // NewOutput extends util.flatten<{\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // }>,\n // NewInput extends util.flatten<{\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }>\n // >(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<T, Augmentation>,\n // UnknownKeys,\n // Catchall,\n // NewOutput,\n // NewInput\n // > {\n // return new ZodObject({\n // ...this._def,\n // shape: () => ({\n // ...this._def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // }\n /**\n * @deprecated Use `.extend` instead\n * */\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n return (this._cached = { shape, keys });\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever &&\n this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] },\n });\n }\n }\n else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys,\n });\n status.dirty();\n }\n }\n else if (unknownKeys === \"strip\") ;\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n }\n else {\n // run catchall validation\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data,\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve()\n .then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n syncPairs.push({\n key,\n value,\n alwaysSet: pair.alwaysSet,\n });\n }\n return syncPairs;\n })\n .then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...(message !== undefined\n ? {\n errorMap: (issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError,\n };\n return {\n message: defaultError,\n };\n },\n }\n : {}),\n });\n }\n strip() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"strip\",\n });\n }\n passthrough() {\n return new ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\",\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new ZodObject({\n ...this._def,\n shape: () => ({\n ...this._def.shape(),\n ...augmentation,\n }),\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: () => ({\n ...this._def.shape(),\n ...merging._def.shape(),\n }),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new ZodObject({\n ...this._def,\n catchall: index,\n });\n }\n pick(mask) {\n const shape = {};\n util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n omit(mask) {\n const shape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => shape,\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n }\n else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n required(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n }\n else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new ZodObject({\n ...this._def,\n shape: () => newShape,\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n}\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: () => shape,\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params),\n });\n};\nclass ZodUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n // return first issue-free validation if it exists\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n // add issues from dirty option\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n // return invalid\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n }),\n ctx: childCtx,\n };\n })).then(handleResults);\n }\n else {\n let dirty = undefined;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n parent: null,\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx,\n });\n if (result.status === \"valid\") {\n return result;\n }\n else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues) => new ZodError(issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors,\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n}\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params),\n });\n};\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\n////////// //////////\n////////// ZodDiscriminatedUnion //////////\n////////// //////////\n/////////////////////////////////////////////////////\n/////////////////////////////////////////////////////\nconst getDiscriminator = (type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n }\n else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n }\n else if (type instanceof ZodLiteral) {\n return [type.value];\n }\n else if (type instanceof ZodEnum) {\n return type.options;\n }\n else if (type instanceof ZodNativeEnum) {\n // eslint-disable-next-line ban/ban\n return util.objectValues(type.enum);\n }\n else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n }\n else if (type instanceof ZodUndefined) {\n return [undefined];\n }\n else if (type instanceof ZodNull) {\n return [null];\n }\n else if (type instanceof ZodOptional) {\n return [undefined, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodNullable) {\n return [null, ...getDiscriminator(type.unwrap())];\n }\n else if (type instanceof ZodBranded) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodReadonly) {\n return getDiscriminator(type.unwrap());\n }\n else if (type instanceof ZodCatch) {\n return getDiscriminator(type._def.innerType);\n }\n else {\n return [];\n }\n};\nclass ZodDiscriminatedUnion extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator],\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n // Get all the valid discriminator values\n const optionsMap = new Map();\n // try {\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues.length) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params),\n });\n }\n}\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util\n .objectKeys(a)\n .filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n else if (aType === ZodParsedType.date &&\n bType === ZodParsedType.date &&\n +a === +b) {\n return { valid: true, data: a };\n }\n else {\n return { valid: false };\n }\n}\nclass ZodIntersection extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = (parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types,\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n };\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }),\n ]).then(([left, right]) => handleParsed(left, right));\n }\n else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n }));\n }\n }\n}\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left: left,\n right: right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params),\n });\n};\nclass ZodTuple extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\",\n });\n status.dirty();\n }\n const items = [...ctx.data]\n .map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n })\n .filter((x) => !!x); // filter nulls\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n }\n else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new ZodTuple({\n ...this._def,\n rest,\n });\n }\n}\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params),\n });\n};\nclass ZodRecord extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),\n alwaysSet: key in ctx.data,\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n }\n else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third),\n });\n }\n return new ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second),\n });\n }\n}\nclass ZodMap extends ZodType {\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"])),\n };\n });\n if (ctx.common.async) {\n const finalMap = new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n }\n else {\n const finalMap = new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n}\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params),\n });\n};\nclass ZodSet extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message,\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message,\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements) {\n const parsedSet = new Set();\n for (const element of elements) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements) => finalizeSet(elements));\n }\n else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) },\n });\n }\n max(maxSize, message) {\n return new ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) },\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n}\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params),\n });\n};\nclass ZodFunction extends ZodType {\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error,\n },\n });\n }\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap,\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error,\n },\n });\n }\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(async function (...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args\n .parseAsync(args, params)\n .catch((e) => {\n error.addIssue(makeArgsIssue(args, e));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type\n .parseAsync(result, params)\n .catch((e) => {\n error.addIssue(makeReturnsIssue(result, e));\n throw error;\n });\n return parsedReturns;\n });\n }\n else {\n // Would love a way to avoid disabling this rule, but we need\n // an alias (using an arrow function was what caused 2651).\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const me = this;\n return OK(function (...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create()),\n });\n }\n returns(returnType) {\n return new ZodFunction({\n ...this._def,\n returns: returnType,\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new ZodFunction({\n args: (args\n ? args\n : ZodTuple.create([]).rest(ZodUnknown.create())),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params),\n });\n }\n}\nclass ZodLazy extends ZodType {\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n}\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter: getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params),\n });\n};\nclass ZodLiteral extends ZodType {\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n}\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value: value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params),\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params),\n });\n}\nclass ZodEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodEnum_cache.set(this, void 0);\n }\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodEnum_cache, \"f\").has(input.data)) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values, newDef = this._def) {\n return ZodEnum.create(values, {\n ...this._def,\n ...newDef,\n });\n }\n exclude(values, newDef = this._def) {\n return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {\n ...this._def,\n ...newDef,\n });\n }\n}\n_ZodEnum_cache = new WeakMap();\nZodEnum.create = createZodEnum;\nclass ZodNativeEnum extends ZodType {\n constructor() {\n super(...arguments);\n _ZodNativeEnum_cache.set(this, void 0);\n }\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string &&\n ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type,\n });\n return INVALID;\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\")) {\n __classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), \"f\");\n }\n if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, \"f\").has(input.data)) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues,\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n}\n_ZodNativeEnum_cache = new WeakMap();\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values: values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params),\n });\n};\nclass ZodPromise extends ZodType {\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise &&\n ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise\n ? ctx.data\n : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap,\n });\n }));\n }\n}\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params),\n });\n};\nclass ZodEffects extends ZodType {\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects\n ? this._def.schema.sourceType()\n : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: (arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n }\n else {\n status.dirty();\n }\n },\n get path() {\n return ctx.path;\n },\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(processed).then(async (processed) => {\n if (status.value === \"aborted\")\n return INVALID;\n const result = await this._def.schema._parseAsync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n });\n }\n else {\n if (status.value === \"aborted\")\n return INVALID;\n const result = this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx,\n });\n if (result.status === \"aborted\")\n return INVALID;\n if (result.status === \"dirty\")\n return DIRTY(result.value);\n if (status.value === \"dirty\")\n return DIRTY(result.value);\n return result;\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = (acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n };\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n // return value is ignored\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n }\n else {\n return this._def.schema\n ._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx })\n .then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util.assertNever(effect);\n }\n}\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params),\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params),\n });\n};\nclass ZodOptional extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(undefined);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params),\n });\n};\nclass ZodNullable extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params),\n });\n};\nclass ZodDefault extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n}\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\"\n ? params.default\n : () => params.default,\n ...processCreateParams(params),\n });\n};\nclass ZodCatch extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n // newCtx is used to not collect issues from inner types in ctx\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: [],\n },\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx,\n },\n });\n if (isAsync(result)) {\n return result.then((result) => {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n });\n }\n else {\n return {\n status: \"valid\",\n value: result.status === \"valid\"\n ? result.value\n : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data,\n }),\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n}\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params),\n });\n};\nclass ZodNaN extends ZodType {\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType,\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n}\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params),\n });\n};\nconst BRAND = Symbol(\"zod_brand\");\nclass ZodBranded extends ZodType {\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx,\n });\n }\n unwrap() {\n return this._def.type;\n }\n}\nclass ZodPipeline extends ZodType {\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n }\n else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n };\n return handleAsync();\n }\n else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx,\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value,\n };\n }\n else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx,\n });\n }\n }\n }\n static create(a, b) {\n return new ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline,\n });\n }\n}\nclass ZodReadonly extends ZodType {\n _parse(input) {\n const result = this._def.innerType._parse(input);\n const freeze = (data) => {\n if (isValid(data)) {\n data.value = Object.freeze(data.value);\n }\n return data;\n };\n return isAsync(result)\n ? result.then((data) => freeze(data))\n : freeze(result);\n }\n unwrap() {\n return this._def.innerType;\n }\n}\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params),\n });\n};\n////////////////////////////////////////\n////////////////////////////////////////\n////////// //////////\n////////// z.custom //////////\n////////// //////////\n////////////////////////////////////////\n////////////////////////////////////////\nfunction cleanParams(params, data) {\n const p = typeof params === \"function\"\n ? params(data)\n : typeof params === \"string\"\n ? { message: params }\n : params;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n return p2;\n}\nfunction custom(check, _params = {}, \n/**\n * @deprecated\n *\n * Pass `fatal` into the params object instead:\n *\n * ```ts\n * z.string().custom((val) => val.length > 5, { fatal: false })\n * ```\n *\n */\nfatal) {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n const r = check(data);\n if (r instanceof Promise) {\n return r.then((r) => {\n var _a, _b;\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n });\n }\n if (!r) {\n const params = cleanParams(_params, data);\n const _fatal = (_b = (_a = params.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n ctx.addIssue({ code: \"custom\", ...params, fatal: _fatal });\n }\n return;\n });\n return ZodAny.create();\n}\nconst late = {\n object: ZodObject.lazycreate,\n};\nvar ZodFirstPartyTypeKind;\n(function (ZodFirstPartyTypeKind) {\n ZodFirstPartyTypeKind[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\nconst instanceOfType = (\n// const instanceOfType = <T extends new (...args: any[]) => any>(\ncls, params = {\n message: `Input not instance of ${cls.name}`,\n}) => custom((data) => data instanceof cls, params);\nconst stringType = ZodString.create;\nconst numberType = ZodNumber.create;\nconst nanType = ZodNaN.create;\nconst bigIntType = ZodBigInt.create;\nconst booleanType = ZodBoolean.create;\nconst dateType = ZodDate.create;\nconst symbolType = ZodSymbol.create;\nconst undefinedType = ZodUndefined.create;\nconst nullType = ZodNull.create;\nconst anyType = ZodAny.create;\nconst unknownType = ZodUnknown.create;\nconst neverType = ZodNever.create;\nconst voidType = ZodVoid.create;\nconst arrayType = ZodArray.create;\nconst objectType = ZodObject.create;\nconst strictObjectType = ZodObject.strictCreate;\nconst unionType = ZodUnion.create;\nconst discriminatedUnionType = ZodDiscriminatedUnion.create;\nconst intersectionType = ZodIntersection.create;\nconst tupleType = ZodTuple.create;\nconst recordType = ZodRecord.create;\nconst mapType = ZodMap.create;\nconst setType = ZodSet.create;\nconst functionType = ZodFunction.create;\nconst lazyType = ZodLazy.create;\nconst literalType = ZodLiteral.create;\nconst enumType = ZodEnum.create;\nconst nativeEnumType = ZodNativeEnum.create;\nconst promiseType = ZodPromise.create;\nconst effectsType = ZodEffects.create;\nconst optionalType = ZodOptional.create;\nconst nullableType = ZodNullable.create;\nconst preprocessType = ZodEffects.createWithPreprocess;\nconst pipelineType = ZodPipeline.create;\nconst ostring = () => stringType().optional();\nconst onumber = () => numberType().optional();\nconst oboolean = () => booleanType().optional();\nconst coerce = {\n string: ((arg) => ZodString.create({ ...arg, coerce: true })),\n number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),\n boolean: ((arg) => ZodBoolean.create({\n ...arg,\n coerce: true,\n })),\n bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),\n date: ((arg) => ZodDate.create({ ...arg, coerce: true })),\n};\nconst NEVER = INVALID;\n\nvar z = /*#__PURE__*/Object.freeze({\n __proto__: null,\n defaultErrorMap: errorMap,\n setErrorMap: setErrorMap,\n getErrorMap: getErrorMap,\n makeIssue: makeIssue,\n EMPTY_PATH: EMPTY_PATH,\n addIssueToContext: addIssueToContext,\n ParseStatus: ParseStatus,\n INVALID: INVALID,\n DIRTY: DIRTY,\n OK: OK,\n isAborted: isAborted,\n isDirty: isDirty,\n isValid: isValid,\n isAsync: isAsync,\n get util () { return util; },\n get objectUtil () { return objectUtil; },\n ZodParsedType: ZodParsedType,\n getParsedType: getParsedType,\n ZodType: ZodType,\n datetimeRegex: datetimeRegex,\n ZodString: ZodString,\n ZodNumber: ZodNumber,\n ZodBigInt: ZodBigInt,\n ZodBoolean: ZodBoolean,\n ZodDate: ZodDate,\n ZodSymbol: ZodSymbol,\n ZodUndefined: ZodUndefined,\n ZodNull: ZodNull,\n ZodAny: ZodAny,\n ZodUnknown: ZodUnknown,\n ZodNever: ZodNever,\n ZodVoid: ZodVoid,\n ZodArray: ZodArray,\n ZodObject: ZodObject,\n ZodUnion: ZodUnion,\n ZodDiscriminatedUnion: ZodDiscriminatedUnion,\n ZodIntersection: ZodIntersection,\n ZodTuple: ZodTuple,\n ZodRecord: ZodRecord,\n ZodMap: ZodMap,\n ZodSet: ZodSet,\n ZodFunction: ZodFunction,\n ZodLazy: ZodLazy,\n ZodLiteral: ZodLiteral,\n ZodEnum: ZodEnum,\n ZodNativeEnum: ZodNativeEnum,\n ZodPromise: ZodPromise,\n ZodEffects: ZodEffects,\n ZodTransformer: ZodEffects,\n ZodOptional: ZodOptional,\n ZodNullable: ZodNullable,\n ZodDefault: ZodDefault,\n ZodCatch: ZodCatch,\n ZodNaN: ZodNaN,\n BRAND: BRAND,\n ZodBranded: ZodBranded,\n ZodPipeline: ZodPipeline,\n ZodReadonly: ZodReadonly,\n custom: custom,\n Schema: ZodType,\n ZodSchema: ZodType,\n late: late,\n get ZodFirstPartyTypeKind () { return ZodFirstPartyTypeKind; },\n coerce: coerce,\n any: anyType,\n array: arrayType,\n bigint: bigIntType,\n boolean: booleanType,\n date: dateType,\n discriminatedUnion: discriminatedUnionType,\n effect: effectsType,\n 'enum': enumType,\n 'function': functionType,\n 'instanceof': instanceOfType,\n intersection: intersectionType,\n lazy: lazyType,\n literal: literalType,\n map: mapType,\n nan: nanType,\n nativeEnum: nativeEnumType,\n never: neverType,\n 'null': nullType,\n nullable: nullableType,\n number: numberType,\n object: objectType,\n oboolean: oboolean,\n onumber: onumber,\n optional: optionalType,\n ostring: ostring,\n pipeline: pipelineType,\n preprocess: preprocessType,\n promise: promiseType,\n record: recordType,\n set: setType,\n strictObject: strictObjectType,\n string: stringType,\n symbol: symbolType,\n transformer: effectsType,\n tuple: tupleType,\n 'undefined': undefinedType,\n union: unionType,\n unknown: unknownType,\n 'void': voidType,\n NEVER: NEVER,\n ZodIssueCode: ZodIssueCode,\n quotelessJson: quotelessJson,\n ZodError: ZodError\n});\n\nexport { BRAND, DIRTY, EMPTY_PATH, INVALID, NEVER, OK, ParseStatus, ZodType as Schema, ZodAny, ZodArray, ZodBigInt, ZodBoolean, ZodBranded, ZodCatch, ZodDate, ZodDefault, ZodDiscriminatedUnion, ZodEffects, ZodEnum, ZodError, ZodFirstPartyTypeKind, ZodFunction, ZodIntersection, ZodIssueCode, ZodLazy, ZodLiteral, ZodMap, ZodNaN, ZodNativeEnum, ZodNever, ZodNull, ZodNullable, ZodNumber, ZodObject, ZodOptional, ZodParsedType, ZodPipeline, ZodPromise, ZodReadonly, ZodRecord, ZodType as ZodSchema, ZodSet, ZodString, ZodSymbol, ZodEffects as ZodTransformer, ZodTuple, ZodType, ZodUndefined, ZodUnion, ZodUnknown, ZodVoid, addIssueToContext, anyType as any, arrayType as array, bigIntType as bigint, booleanType as boolean, coerce, custom, dateType as date, datetimeRegex, z as default, errorMap as defaultErrorMap, discriminatedUnionType as discriminatedUnion, effectsType as effect, enumType as enum, functionType as function, getErrorMap, getParsedType, instanceOfType as instanceof, intersectionType as intersection, isAborted, isAsync, isDirty, isValid, late, lazyType as lazy, literalType as literal, makeIssue, mapType as map, nanType as nan, nativeEnumType as nativeEnum, neverType as never, nullType as null, nullableType as nullable, numberType as number, objectType as object, objectUtil, oboolean, onumber, optionalType as optional, ostring, pipelineType as pipeline, preprocessType as preprocess, promiseType as promise, quotelessJson, recordType as record, setType as set, setErrorMap, strictObjectType as strictObject, stringType as string, symbolType as symbol, effectsType as transformer, tupleType as tuple, undefinedType as undefined, unionType as union, unknownType as unknown, util, voidType as void, z };\n",
|
6
6
|
"import { z } from \"zod\";\nexport const LATEST_PROTOCOL_VERSION = \"2024-11-05\";\nexport const SUPPORTED_PROTOCOL_VERSIONS = [\n LATEST_PROTOCOL_VERSION,\n \"2024-10-07\",\n];\n/* JSON-RPC types */\nexport const JSONRPC_VERSION = \"2.0\";\n/**\n * A progress token, used to associate progress notifications with the original request.\n */\nexport const ProgressTokenSchema = z.union([z.string(), z.number().int()]);\n/**\n * An opaque token used to represent a cursor for pagination.\n */\nexport const CursorSchema = z.string();\nconst BaseRequestParamsSchema = z\n .object({\n _meta: z.optional(z\n .object({\n /**\n * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.\n */\n progressToken: z.optional(ProgressTokenSchema),\n })\n .passthrough()),\n})\n .passthrough();\nexport const RequestSchema = z.object({\n method: z.string(),\n params: z.optional(BaseRequestParamsSchema),\n});\nconst BaseNotificationParamsSchema = z\n .object({\n /**\n * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications.\n */\n _meta: z.optional(z.object({}).passthrough()),\n})\n .passthrough();\nexport const NotificationSchema = z.object({\n method: z.string(),\n params: z.optional(BaseNotificationParamsSchema),\n});\nexport const ResultSchema = z\n .object({\n /**\n * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses.\n */\n _meta: z.optional(z.object({}).passthrough()),\n})\n .passthrough();\n/**\n * A uniquely identifying ID for a request in JSON-RPC.\n */\nexport const RequestIdSchema = z.union([z.string(), z.number().int()]);\n/**\n * A request that expects a response.\n */\nexport const JSONRPCRequestSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n id: RequestIdSchema,\n})\n .merge(RequestSchema)\n .strict();\n/**\n * A notification which does not expect a response.\n */\nexport const JSONRPCNotificationSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n})\n .merge(NotificationSchema)\n .strict();\n/**\n * A successful (non-error) response to a request.\n */\nexport const JSONRPCResponseSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n id: RequestIdSchema,\n result: ResultSchema,\n})\n .strict();\n/**\n * Error codes defined by the JSON-RPC specification.\n */\nexport var ErrorCode;\n(function (ErrorCode) {\n // SDK error codes\n ErrorCode[ErrorCode[\"ConnectionClosed\"] = -32000] = \"ConnectionClosed\";\n ErrorCode[ErrorCode[\"RequestTimeout\"] = -32001] = \"RequestTimeout\";\n // Standard JSON-RPC error codes\n ErrorCode[ErrorCode[\"ParseError\"] = -32700] = \"ParseError\";\n ErrorCode[ErrorCode[\"InvalidRequest\"] = -32600] = \"InvalidRequest\";\n ErrorCode[ErrorCode[\"MethodNotFound\"] = -32601] = \"MethodNotFound\";\n ErrorCode[ErrorCode[\"InvalidParams\"] = -32602] = \"InvalidParams\";\n ErrorCode[ErrorCode[\"InternalError\"] = -32603] = \"InternalError\";\n})(ErrorCode || (ErrorCode = {}));\n/**\n * A response to a request that indicates an error occurred.\n */\nexport const JSONRPCErrorSchema = z\n .object({\n jsonrpc: z.literal(JSONRPC_VERSION),\n id: RequestIdSchema,\n error: z.object({\n /**\n * The error type that occurred.\n */\n code: z.number().int(),\n /**\n * A short description of the error. The message SHOULD be limited to a concise single sentence.\n */\n message: z.string(),\n /**\n * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).\n */\n data: z.optional(z.unknown()),\n }),\n})\n .strict();\nexport const JSONRPCMessageSchema = z.union([\n JSONRPCRequestSchema,\n JSONRPCNotificationSchema,\n JSONRPCResponseSchema,\n JSONRPCErrorSchema,\n]);\n/* Empty result */\n/**\n * A response that indicates success but carries no data.\n */\nexport const EmptyResultSchema = ResultSchema.strict();\n/* Cancellation */\n/**\n * This notification can be sent by either side to indicate that it is cancelling a previously-issued request.\n *\n * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.\n *\n * This notification indicates that the result will be unused, so any associated processing SHOULD cease.\n *\n * A client MUST NOT attempt to cancel its `initialize` request.\n */\nexport const CancelledNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/cancelled\"),\n params: BaseNotificationParamsSchema.extend({\n /**\n * The ID of the request to cancel.\n *\n * This MUST correspond to the ID of a request previously issued in the same direction.\n */\n requestId: RequestIdSchema,\n /**\n * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.\n */\n reason: z.string().optional(),\n }),\n});\n/* Initialization */\n/**\n * Describes the name and version of an MCP implementation.\n */\nexport const ImplementationSchema = z\n .object({\n name: z.string(),\n version: z.string(),\n})\n .passthrough();\n/**\n * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.\n */\nexport const ClientCapabilitiesSchema = z\n .object({\n /**\n * Experimental, non-standard capabilities that the client supports.\n */\n experimental: z.optional(z.object({}).passthrough()),\n /**\n * Present if the client supports sampling from an LLM.\n */\n sampling: z.optional(z.object({}).passthrough()),\n /**\n * Present if the client supports listing roots.\n */\n roots: z.optional(z\n .object({\n /**\n * Whether the client supports issuing notifications for changes to the roots list.\n */\n listChanged: z.optional(z.boolean()),\n })\n .passthrough()),\n})\n .passthrough();\n/**\n * This request is sent from the client to the server when it first connects, asking it to begin initialization.\n */\nexport const InitializeRequestSchema = RequestSchema.extend({\n method: z.literal(\"initialize\"),\n params: BaseRequestParamsSchema.extend({\n /**\n * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.\n */\n protocolVersion: z.string(),\n capabilities: ClientCapabilitiesSchema,\n clientInfo: ImplementationSchema,\n }),\n});\n/**\n * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.\n */\nexport const ServerCapabilitiesSchema = z\n .object({\n /**\n * Experimental, non-standard capabilities that the server supports.\n */\n experimental: z.optional(z.object({}).passthrough()),\n /**\n * Present if the server supports sending log messages to the client.\n */\n logging: z.optional(z.object({}).passthrough()),\n /**\n * Present if the server offers any prompt templates.\n */\n prompts: z.optional(z\n .object({\n /**\n * Whether this server supports issuing notifications for changes to the prompt list.\n */\n listChanged: z.optional(z.boolean()),\n })\n .passthrough()),\n /**\n * Present if the server offers any resources to read.\n */\n resources: z.optional(z\n .object({\n /**\n * Whether this server supports clients subscribing to resource updates.\n */\n subscribe: z.optional(z.boolean()),\n /**\n * Whether this server supports issuing notifications for changes to the resource list.\n */\n listChanged: z.optional(z.boolean()),\n })\n .passthrough()),\n /**\n * Present if the server offers any tools to call.\n */\n tools: z.optional(z\n .object({\n /**\n * Whether this server supports issuing notifications for changes to the tool list.\n */\n listChanged: z.optional(z.boolean()),\n })\n .passthrough()),\n})\n .passthrough();\n/**\n * After receiving an initialize request from the client, the server sends this response.\n */\nexport const InitializeResultSchema = ResultSchema.extend({\n /**\n * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.\n */\n protocolVersion: z.string(),\n capabilities: ServerCapabilitiesSchema,\n serverInfo: ImplementationSchema,\n /**\n * Instructions describing how to use the server and its features.\n *\n * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a \"hint\" to the model. For example, this information MAY be added to the system prompt.\n */\n instructions: z.optional(z.string()),\n});\n/**\n * This notification is sent from the client to the server after initialization has finished.\n */\nexport const InitializedNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/initialized\"),\n});\n/* Ping */\n/**\n * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.\n */\nexport const PingRequestSchema = RequestSchema.extend({\n method: z.literal(\"ping\"),\n});\n/* Progress notifications */\nexport const ProgressSchema = z\n .object({\n /**\n * The progress thus far. This should increase every time progress is made, even if the total is unknown.\n */\n progress: z.number(),\n /**\n * Total number of items to process (or total progress required), if known.\n */\n total: z.optional(z.number()),\n})\n .passthrough();\n/**\n * An out-of-band notification used to inform the receiver of a progress update for a long-running request.\n */\nexport const ProgressNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/progress\"),\n params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({\n /**\n * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.\n */\n progressToken: ProgressTokenSchema,\n }),\n});\n/* Pagination */\nexport const PaginatedRequestSchema = RequestSchema.extend({\n params: BaseRequestParamsSchema.extend({\n /**\n * An opaque token representing the current pagination position.\n * If provided, the server should return results starting after this cursor.\n */\n cursor: z.optional(CursorSchema),\n }).optional(),\n});\nexport const PaginatedResultSchema = ResultSchema.extend({\n /**\n * An opaque token representing the pagination position after the last returned result.\n * If present, there may be more results available.\n */\n nextCursor: z.optional(CursorSchema),\n});\n/* Resources */\n/**\n * The contents of a specific resource or sub-resource.\n */\nexport const ResourceContentsSchema = z\n .object({\n /**\n * The URI of this resource.\n */\n uri: z.string(),\n /**\n * The MIME type of this resource, if known.\n */\n mimeType: z.optional(z.string()),\n})\n .passthrough();\nexport const TextResourceContentsSchema = ResourceContentsSchema.extend({\n /**\n * The text of the item. This must only be set if the item can actually be represented as text (not binary data).\n */\n text: z.string(),\n});\nexport const BlobResourceContentsSchema = ResourceContentsSchema.extend({\n /**\n * A base64-encoded string representing the binary data of the item.\n */\n blob: z.string().base64(),\n});\n/**\n * A known resource that the server is capable of reading.\n */\nexport const ResourceSchema = z\n .object({\n /**\n * The URI of this resource.\n */\n uri: z.string(),\n /**\n * A human-readable name for this resource.\n *\n * This can be used by clients to populate UI elements.\n */\n name: z.string(),\n /**\n * A description of what this resource represents.\n *\n * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.\n */\n description: z.optional(z.string()),\n /**\n * The MIME type of this resource, if known.\n */\n mimeType: z.optional(z.string()),\n})\n .passthrough();\n/**\n * A template description for resources available on the server.\n */\nexport const ResourceTemplateSchema = z\n .object({\n /**\n * A URI template (according to RFC 6570) that can be used to construct resource URIs.\n */\n uriTemplate: z.string(),\n /**\n * A human-readable name for the type of resource this template refers to.\n *\n * This can be used by clients to populate UI elements.\n */\n name: z.string(),\n /**\n * A description of what this template is for.\n *\n * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.\n */\n description: z.optional(z.string()),\n /**\n * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.\n */\n mimeType: z.optional(z.string()),\n})\n .passthrough();\n/**\n * Sent from the client to request a list of resources the server has.\n */\nexport const ListResourcesRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal(\"resources/list\"),\n});\n/**\n * The server's response to a resources/list request from the client.\n */\nexport const ListResourcesResultSchema = PaginatedResultSchema.extend({\n resources: z.array(ResourceSchema),\n});\n/**\n * Sent from the client to request a list of resource templates the server has.\n */\nexport const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal(\"resources/templates/list\"),\n});\n/**\n * The server's response to a resources/templates/list request from the client.\n */\nexport const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({\n resourceTemplates: z.array(ResourceTemplateSchema),\n});\n/**\n * Sent from the client to the server, to read a specific resource URI.\n */\nexport const ReadResourceRequestSchema = RequestSchema.extend({\n method: z.literal(\"resources/read\"),\n params: BaseRequestParamsSchema.extend({\n /**\n * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.\n */\n uri: z.string(),\n }),\n});\n/**\n * The server's response to a resources/read request from the client.\n */\nexport const ReadResourceResultSchema = ResultSchema.extend({\n contents: z.array(z.union([TextResourceContentsSchema, BlobResourceContentsSchema])),\n});\n/**\n * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.\n */\nexport const ResourceListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/resources/list_changed\"),\n});\n/**\n * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.\n */\nexport const SubscribeRequestSchema = RequestSchema.extend({\n method: z.literal(\"resources/subscribe\"),\n params: BaseRequestParamsSchema.extend({\n /**\n * The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.\n */\n uri: z.string(),\n }),\n});\n/**\n * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.\n */\nexport const UnsubscribeRequestSchema = RequestSchema.extend({\n method: z.literal(\"resources/unsubscribe\"),\n params: BaseRequestParamsSchema.extend({\n /**\n * The URI of the resource to unsubscribe from.\n */\n uri: z.string(),\n }),\n});\n/**\n * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.\n */\nexport const ResourceUpdatedNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/resources/updated\"),\n params: BaseNotificationParamsSchema.extend({\n /**\n * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.\n */\n uri: z.string(),\n }),\n});\n/* Prompts */\n/**\n * Describes an argument that a prompt can accept.\n */\nexport const PromptArgumentSchema = z\n .object({\n /**\n * The name of the argument.\n */\n name: z.string(),\n /**\n * A human-readable description of the argument.\n */\n description: z.optional(z.string()),\n /**\n * Whether this argument must be provided.\n */\n required: z.optional(z.boolean()),\n})\n .passthrough();\n/**\n * A prompt or prompt template that the server offers.\n */\nexport const PromptSchema = z\n .object({\n /**\n * The name of the prompt or prompt template.\n */\n name: z.string(),\n /**\n * An optional description of what this prompt provides\n */\n description: z.optional(z.string()),\n /**\n * A list of arguments to use for templating the prompt.\n */\n arguments: z.optional(z.array(PromptArgumentSchema)),\n})\n .passthrough();\n/**\n * Sent from the client to request a list of prompts and prompt templates the server has.\n */\nexport const ListPromptsRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal(\"prompts/list\"),\n});\n/**\n * The server's response to a prompts/list request from the client.\n */\nexport const ListPromptsResultSchema = PaginatedResultSchema.extend({\n prompts: z.array(PromptSchema),\n});\n/**\n * Used by the client to get a prompt provided by the server.\n */\nexport const GetPromptRequestSchema = RequestSchema.extend({\n method: z.literal(\"prompts/get\"),\n params: BaseRequestParamsSchema.extend({\n /**\n * The name of the prompt or prompt template.\n */\n name: z.string(),\n /**\n * Arguments to use for templating the prompt.\n */\n arguments: z.optional(z.record(z.string())),\n }),\n});\n/**\n * Text provided to or from an LLM.\n */\nexport const TextContentSchema = z\n .object({\n type: z.literal(\"text\"),\n /**\n * The text content of the message.\n */\n text: z.string(),\n})\n .passthrough();\n/**\n * An image provided to or from an LLM.\n */\nexport const ImageContentSchema = z\n .object({\n type: z.literal(\"image\"),\n /**\n * The base64-encoded image data.\n */\n data: z.string().base64(),\n /**\n * The MIME type of the image. Different providers may support different image types.\n */\n mimeType: z.string(),\n})\n .passthrough();\n/**\n * The contents of a resource, embedded into a prompt or tool call result.\n */\nexport const EmbeddedResourceSchema = z\n .object({\n type: z.literal(\"resource\"),\n resource: z.union([TextResourceContentsSchema, BlobResourceContentsSchema]),\n})\n .passthrough();\n/**\n * Describes a message returned as part of a prompt.\n */\nexport const PromptMessageSchema = z\n .object({\n role: z.enum([\"user\", \"assistant\"]),\n content: z.union([\n TextContentSchema,\n ImageContentSchema,\n EmbeddedResourceSchema,\n ]),\n})\n .passthrough();\n/**\n * The server's response to a prompts/get request from the client.\n */\nexport const GetPromptResultSchema = ResultSchema.extend({\n /**\n * An optional description for the prompt.\n */\n description: z.optional(z.string()),\n messages: z.array(PromptMessageSchema),\n});\n/**\n * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.\n */\nexport const PromptListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/prompts/list_changed\"),\n});\n/* Tools */\n/**\n * Definition for a tool the client can call.\n */\nexport const ToolSchema = z\n .object({\n /**\n * The name of the tool.\n */\n name: z.string(),\n /**\n * A human-readable description of the tool.\n */\n description: z.optional(z.string()),\n /**\n * A JSON Schema object defining the expected parameters for the tool.\n */\n inputSchema: z\n .object({\n type: z.literal(\"object\"),\n properties: z.optional(z.object({}).passthrough()),\n })\n .passthrough(),\n})\n .passthrough();\n/**\n * Sent from the client to request a list of tools the server has.\n */\nexport const ListToolsRequestSchema = PaginatedRequestSchema.extend({\n method: z.literal(\"tools/list\"),\n});\n/**\n * The server's response to a tools/list request from the client.\n */\nexport const ListToolsResultSchema = PaginatedResultSchema.extend({\n tools: z.array(ToolSchema),\n});\n/**\n * The server's response to a tool call.\n */\nexport const CallToolResultSchema = ResultSchema.extend({\n content: z.array(z.union([TextContentSchema, ImageContentSchema, EmbeddedResourceSchema])),\n isError: z.boolean().default(false).optional(),\n});\n/**\n * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.\n */\nexport const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({\n toolResult: z.unknown(),\n}));\n/**\n * Used by the client to invoke a tool provided by the server.\n */\nexport const CallToolRequestSchema = RequestSchema.extend({\n method: z.literal(\"tools/call\"),\n params: BaseRequestParamsSchema.extend({\n name: z.string(),\n arguments: z.optional(z.record(z.unknown())),\n }),\n});\n/**\n * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.\n */\nexport const ToolListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/tools/list_changed\"),\n});\n/* Logging */\n/**\n * The severity of a log message.\n */\nexport const LoggingLevelSchema = z.enum([\n \"debug\",\n \"info\",\n \"notice\",\n \"warning\",\n \"error\",\n \"critical\",\n \"alert\",\n \"emergency\",\n]);\n/**\n * A request from the client to the server, to enable or adjust logging.\n */\nexport const SetLevelRequestSchema = RequestSchema.extend({\n method: z.literal(\"logging/setLevel\"),\n params: BaseRequestParamsSchema.extend({\n /**\n * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.\n */\n level: LoggingLevelSchema,\n }),\n});\n/**\n * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.\n */\nexport const LoggingMessageNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/message\"),\n params: BaseNotificationParamsSchema.extend({\n /**\n * The severity of this log message.\n */\n level: LoggingLevelSchema,\n /**\n * An optional name of the logger issuing this message.\n */\n logger: z.optional(z.string()),\n /**\n * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.\n */\n data: z.unknown(),\n }),\n});\n/* Sampling */\n/**\n * Hints to use for model selection.\n */\nexport const ModelHintSchema = z\n .object({\n /**\n * A hint for a model name.\n */\n name: z.string().optional(),\n})\n .passthrough();\n/**\n * The server's preferences for model selection, requested of the client during sampling.\n */\nexport const ModelPreferencesSchema = z\n .object({\n /**\n * Optional hints to use for model selection.\n */\n hints: z.optional(z.array(ModelHintSchema)),\n /**\n * How much to prioritize cost when selecting a model.\n */\n costPriority: z.optional(z.number().min(0).max(1)),\n /**\n * How much to prioritize sampling speed (latency) when selecting a model.\n */\n speedPriority: z.optional(z.number().min(0).max(1)),\n /**\n * How much to prioritize intelligence and capabilities when selecting a model.\n */\n intelligencePriority: z.optional(z.number().min(0).max(1)),\n})\n .passthrough();\n/**\n * Describes a message issued to or received from an LLM API.\n */\nexport const SamplingMessageSchema = z\n .object({\n role: z.enum([\"user\", \"assistant\"]),\n content: z.union([TextContentSchema, ImageContentSchema]),\n})\n .passthrough();\n/**\n * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.\n */\nexport const CreateMessageRequestSchema = RequestSchema.extend({\n method: z.literal(\"sampling/createMessage\"),\n params: BaseRequestParamsSchema.extend({\n messages: z.array(SamplingMessageSchema),\n /**\n * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.\n */\n systemPrompt: z.optional(z.string()),\n /**\n * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.\n */\n includeContext: z.optional(z.enum([\"none\", \"thisServer\", \"allServers\"])),\n temperature: z.optional(z.number()),\n /**\n * The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.\n */\n maxTokens: z.number().int(),\n stopSequences: z.optional(z.array(z.string())),\n /**\n * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.\n */\n metadata: z.optional(z.object({}).passthrough()),\n /**\n * The server's preferences for which model to select.\n */\n modelPreferences: z.optional(ModelPreferencesSchema),\n }),\n});\n/**\n * The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.\n */\nexport const CreateMessageResultSchema = ResultSchema.extend({\n /**\n * The name of the model that generated the message.\n */\n model: z.string(),\n /**\n * The reason why sampling stopped.\n */\n stopReason: z.optional(z.enum([\"endTurn\", \"stopSequence\", \"maxTokens\"]).or(z.string())),\n role: z.enum([\"user\", \"assistant\"]),\n content: z.discriminatedUnion(\"type\", [\n TextContentSchema,\n ImageContentSchema,\n ]),\n});\n/* Autocomplete */\n/**\n * A reference to a resource or resource template definition.\n */\nexport const ResourceReferenceSchema = z\n .object({\n type: z.literal(\"ref/resource\"),\n /**\n * The URI or URI template of the resource.\n */\n uri: z.string(),\n})\n .passthrough();\n/**\n * Identifies a prompt.\n */\nexport const PromptReferenceSchema = z\n .object({\n type: z.literal(\"ref/prompt\"),\n /**\n * The name of the prompt or prompt template\n */\n name: z.string(),\n})\n .passthrough();\n/**\n * A request from the client to the server, to ask for completion options.\n */\nexport const CompleteRequestSchema = RequestSchema.extend({\n method: z.literal(\"completion/complete\"),\n params: BaseRequestParamsSchema.extend({\n ref: z.union([PromptReferenceSchema, ResourceReferenceSchema]),\n /**\n * The argument's information\n */\n argument: z\n .object({\n /**\n * The name of the argument\n */\n name: z.string(),\n /**\n * The value of the argument to use for completion matching.\n */\n value: z.string(),\n })\n .passthrough(),\n }),\n});\n/**\n * The server's response to a completion/complete request\n */\nexport const CompleteResultSchema = ResultSchema.extend({\n completion: z\n .object({\n /**\n * An array of completion values. Must not exceed 100 items.\n */\n values: z.array(z.string()).max(100),\n /**\n * The total number of completion options available. This can exceed the number of values actually sent in the response.\n */\n total: z.optional(z.number().int()),\n /**\n * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.\n */\n hasMore: z.optional(z.boolean()),\n })\n .passthrough(),\n});\n/* Roots */\n/**\n * Represents a root directory or file that the server can operate on.\n */\nexport const RootSchema = z\n .object({\n /**\n * The URI identifying the root. This *must* start with file:// for now.\n */\n uri: z.string().startsWith(\"file://\"),\n /**\n * An optional name for the root.\n */\n name: z.optional(z.string()),\n})\n .passthrough();\n/**\n * Sent from the server to request a list of root URIs from the client.\n */\nexport const ListRootsRequestSchema = RequestSchema.extend({\n method: z.literal(\"roots/list\"),\n});\n/**\n * The client's response to a roots/list request from the server.\n */\nexport const ListRootsResultSchema = ResultSchema.extend({\n roots: z.array(RootSchema),\n});\n/**\n * A notification from the client to the server, informing it that the list of roots has changed.\n */\nexport const RootsListChangedNotificationSchema = NotificationSchema.extend({\n method: z.literal(\"notifications/roots/list_changed\"),\n});\n/* Client messages */\nexport const ClientRequestSchema = z.union([\n PingRequestSchema,\n InitializeRequestSchema,\n CompleteRequestSchema,\n SetLevelRequestSchema,\n GetPromptRequestSchema,\n ListPromptsRequestSchema,\n ListResourcesRequestSchema,\n ListResourceTemplatesRequestSchema,\n ReadResourceRequestSchema,\n SubscribeRequestSchema,\n UnsubscribeRequestSchema,\n CallToolRequestSchema,\n ListToolsRequestSchema,\n]);\nexport const ClientNotificationSchema = z.union([\n CancelledNotificationSchema,\n ProgressNotificationSchema,\n InitializedNotificationSchema,\n RootsListChangedNotificationSchema,\n]);\nexport const ClientResultSchema = z.union([\n EmptyResultSchema,\n CreateMessageResultSchema,\n ListRootsResultSchema,\n]);\n/* Server messages */\nexport const ServerRequestSchema = z.union([\n PingRequestSchema,\n CreateMessageRequestSchema,\n ListRootsRequestSchema,\n]);\nexport const ServerNotificationSchema = z.union([\n CancelledNotificationSchema,\n ProgressNotificationSchema,\n LoggingMessageNotificationSchema,\n ResourceUpdatedNotificationSchema,\n ResourceListChangedNotificationSchema,\n ToolListChangedNotificationSchema,\n PromptListChangedNotificationSchema,\n]);\nexport const ServerResultSchema = z.union([\n EmptyResultSchema,\n InitializeResultSchema,\n CompleteResultSchema,\n GetPromptResultSchema,\n ListPromptsResultSchema,\n ListResourcesResultSchema,\n ListResourceTemplatesResultSchema,\n ReadResourceResultSchema,\n CallToolResultSchema,\n ListToolsResultSchema,\n]);\nexport class McpError extends Error {\n constructor(code, message, data) {\n super(`MCP error ${code}: ${message}`);\n this.code = code;\n this.data = data;\n }\n}\n//# sourceMappingURL=types.js.map",
|
@@ -8,13 +8,14 @@
|
|
8
8
|
"import { mergeCapabilities, Protocol, } from \"../shared/protocol.js\";\nimport { CreateMessageResultSchema, EmptyResultSchema, InitializedNotificationSchema, InitializeRequestSchema, LATEST_PROTOCOL_VERSION, ListRootsResultSchema, SUPPORTED_PROTOCOL_VERSIONS, } from \"../types.js\";\n/**\n * An MCP server on top of a pluggable transport.\n *\n * This server will automatically respond to the initialization flow as initiated from the client.\n *\n * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:\n *\n * ```typescript\n * // Custom schemas\n * const CustomRequestSchema = RequestSchema.extend({...})\n * const CustomNotificationSchema = NotificationSchema.extend({...})\n * const CustomResultSchema = ResultSchema.extend({...})\n *\n * // Type aliases\n * type CustomRequest = z.infer<typeof CustomRequestSchema>\n * type CustomNotification = z.infer<typeof CustomNotificationSchema>\n * type CustomResult = z.infer<typeof CustomResultSchema>\n *\n * // Create typed server\n * const server = new Server<CustomRequest, CustomNotification, CustomResult>({\n * name: \"CustomServer\",\n * version: \"1.0.0\"\n * })\n * ```\n */\nexport class Server extends Protocol {\n /**\n * Initializes this server with the given name and version information.\n */\n constructor(_serverInfo, options) {\n var _a;\n super(options);\n this._serverInfo = _serverInfo;\n this._capabilities = (_a = options === null || options === void 0 ? void 0 : options.capabilities) !== null && _a !== void 0 ? _a : {};\n this._instructions = options === null || options === void 0 ? void 0 : options.instructions;\n this.setRequestHandler(InitializeRequestSchema, (request) => this._oninitialize(request));\n this.setNotificationHandler(InitializedNotificationSchema, () => { var _a; return (_a = this.oninitialized) === null || _a === void 0 ? void 0 : _a.call(this); });\n }\n /**\n * Registers new capabilities. This can only be called before connecting to a transport.\n *\n * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).\n */\n registerCapabilities(capabilities) {\n if (this.transport) {\n throw new Error(\"Cannot register capabilities after connecting to transport\");\n }\n this._capabilities = mergeCapabilities(this._capabilities, capabilities);\n }\n assertCapabilityForMethod(method) {\n var _a, _b;\n switch (method) {\n case \"sampling/createMessage\":\n if (!((_a = this._clientCapabilities) === null || _a === void 0 ? void 0 : _a.sampling)) {\n throw new Error(`Client does not support sampling (required for ${method})`);\n }\n break;\n case \"roots/list\":\n if (!((_b = this._clientCapabilities) === null || _b === void 0 ? void 0 : _b.roots)) {\n throw new Error(`Client does not support listing roots (required for ${method})`);\n }\n break;\n case \"ping\":\n // No specific capability required for ping\n break;\n }\n }\n assertNotificationCapability(method) {\n switch (method) {\n case \"notifications/message\":\n if (!this._capabilities.logging) {\n throw new Error(`Server does not support logging (required for ${method})`);\n }\n break;\n case \"notifications/resources/updated\":\n case \"notifications/resources/list_changed\":\n if (!this._capabilities.resources) {\n throw new Error(`Server does not support notifying about resources (required for ${method})`);\n }\n break;\n case \"notifications/tools/list_changed\":\n if (!this._capabilities.tools) {\n throw new Error(`Server does not support notifying of tool list changes (required for ${method})`);\n }\n break;\n case \"notifications/prompts/list_changed\":\n if (!this._capabilities.prompts) {\n throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`);\n }\n break;\n case \"notifications/cancelled\":\n // Cancellation notifications are always allowed\n break;\n case \"notifications/progress\":\n // Progress notifications are always allowed\n break;\n }\n }\n assertRequestHandlerCapability(method) {\n switch (method) {\n case \"sampling/createMessage\":\n if (!this._capabilities.sampling) {\n throw new Error(`Server does not support sampling (required for ${method})`);\n }\n break;\n case \"logging/setLevel\":\n if (!this._capabilities.logging) {\n throw new Error(`Server does not support logging (required for ${method})`);\n }\n break;\n case \"prompts/get\":\n case \"prompts/list\":\n if (!this._capabilities.prompts) {\n throw new Error(`Server does not support prompts (required for ${method})`);\n }\n break;\n case \"resources/list\":\n case \"resources/templates/list\":\n case \"resources/read\":\n if (!this._capabilities.resources) {\n throw new Error(`Server does not support resources (required for ${method})`);\n }\n break;\n case \"tools/call\":\n case \"tools/list\":\n if (!this._capabilities.tools) {\n throw new Error(`Server does not support tools (required for ${method})`);\n }\n break;\n case \"ping\":\n case \"initialize\":\n // No specific capability required for these methods\n break;\n }\n }\n async _oninitialize(request) {\n const requestedVersion = request.params.protocolVersion;\n this._clientCapabilities = request.params.capabilities;\n this._clientVersion = request.params.clientInfo;\n return {\n protocolVersion: SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion)\n ? requestedVersion\n : LATEST_PROTOCOL_VERSION,\n capabilities: this.getCapabilities(),\n serverInfo: this._serverInfo,\n ...(this._instructions && { instructions: this._instructions }),\n };\n }\n /**\n * After initialization has completed, this will be populated with the client's reported capabilities.\n */\n getClientCapabilities() {\n return this._clientCapabilities;\n }\n /**\n * After initialization has completed, this will be populated with information about the client's name and version.\n */\n getClientVersion() {\n return this._clientVersion;\n }\n getCapabilities() {\n return this._capabilities;\n }\n async ping() {\n return this.request({ method: \"ping\" }, EmptyResultSchema);\n }\n async createMessage(params, options) {\n return this.request({ method: \"sampling/createMessage\", params }, CreateMessageResultSchema, options);\n }\n async listRoots(params, options) {\n return this.request({ method: \"roots/list\", params }, ListRootsResultSchema, options);\n }\n async sendLoggingMessage(params) {\n return this.notification({ method: \"notifications/message\", params });\n }\n async sendResourceUpdated(params) {\n return this.notification({\n method: \"notifications/resources/updated\",\n params,\n });\n }\n async sendResourceListChanged() {\n return this.notification({\n method: \"notifications/resources/list_changed\",\n });\n }\n async sendToolListChanged() {\n return this.notification({ method: \"notifications/tools/list_changed\" });\n }\n async sendPromptListChanged() {\n return this.notification({ method: \"notifications/prompts/list_changed\" });\n }\n}\n//# sourceMappingURL=index.js.map",
|
9
9
|
"import process from \"node:process\";\nimport { ReadBuffer, serializeMessage } from \"../shared/stdio.js\";\n/**\n * Server transport for stdio: this communicates with a MCP client by reading from the current process' stdin and writing to stdout.\n *\n * This transport is only available in Node.js environments.\n */\nexport class StdioServerTransport {\n constructor(_stdin = process.stdin, _stdout = process.stdout) {\n this._stdin = _stdin;\n this._stdout = _stdout;\n this._readBuffer = new ReadBuffer();\n this._started = false;\n // Arrow functions to bind `this` properly, while maintaining function identity.\n this._ondata = (chunk) => {\n this._readBuffer.append(chunk);\n this.processReadBuffer();\n };\n this._onerror = (error) => {\n var _a;\n (_a = this.onerror) === null || _a === void 0 ? void 0 : _a.call(this, error);\n };\n }\n /**\n * Starts listening for messages on stdin.\n */\n async start() {\n if (this._started) {\n throw new Error(\"StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.\");\n }\n this._started = true;\n this._stdin.on(\"data\", this._ondata);\n this._stdin.on(\"error\", this._onerror);\n }\n processReadBuffer() {\n var _a, _b;\n while (true) {\n try {\n const message = this._readBuffer.readMessage();\n if (message === null) {\n break;\n }\n (_a = this.onmessage) === null || _a === void 0 ? void 0 : _a.call(this, message);\n }\n catch (error) {\n (_b = this.onerror) === null || _b === void 0 ? void 0 : _b.call(this, error);\n }\n }\n }\n async close() {\n var _a;\n // Remove our event listeners first\n this._stdin.off(\"data\", this._ondata);\n this._stdin.off(\"error\", this._onerror);\n // Check if we were the only data listener\n const remainingDataListeners = this._stdin.listenerCount('data');\n if (remainingDataListeners === 0) {\n // Only pause stdin if we were the only listener\n // This prevents interfering with other parts of the application that might be using stdin\n this._stdin.pause();\n }\n // Clear the buffer and notify closure\n this._readBuffer.clear();\n (_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);\n }\n send(message) {\n return new Promise((resolve) => {\n const json = serializeMessage(message);\n if (this._stdout.write(json)) {\n resolve();\n }\n else {\n this._stdout.once(\"drain\", resolve);\n }\n });\n }\n}\n//# sourceMappingURL=stdio.js.map",
|
10
10
|
"import { JSONRPCMessageSchema } from \"../types.js\";\n/**\n * Buffers a continuous stdio stream into discrete JSON-RPC messages.\n */\nexport class ReadBuffer {\n append(chunk) {\n this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;\n }\n readMessage() {\n if (!this._buffer) {\n return null;\n }\n const index = this._buffer.indexOf(\"\\n\");\n if (index === -1) {\n return null;\n }\n const line = this._buffer.toString(\"utf8\", 0, index);\n this._buffer = this._buffer.subarray(index + 1);\n return deserializeMessage(line);\n }\n clear() {\n this._buffer = undefined;\n }\n}\nexport function deserializeMessage(line) {\n return JSONRPCMessageSchema.parse(JSON.parse(line));\n}\nexport function serializeMessage(message) {\n return JSON.stringify(message) + \"\\n\";\n}\n//# sourceMappingURL=stdio.js.map",
|
11
|
-
"import { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js'\nimport { object, z } from 'zod'\nimport { join } from 'path'\nimport { readFile, access, constants } from 'fs/promises'\nimport type { Solution } from '../types'\nimport { DocumentService } from './document.service'\nimport { FileService } from './file.service'\nimport { logger } from '../utils/logger'\n\n/**\n * Schema for get-user-stories request\n */\nconst GetUserStoriesRequestSchema = object({\n prdId: z.string(),\n cwd: z.string(),\n})\n\n/**\n * Schema for get-tasks request\n */\nconst GetTasksRequestSchema = object({\n prdId: z.string(),\n userStoryId: z.string(),\n cwd: z.string(),\n})\n\n/**\n * Schema for get-task request\n */\nconst GetTaskRequestSchema = object({\n prdId: z.string(),\n userStoryId: z.string(),\n taskId: z.string(),\n cwd: z.string(),\n})\n\n/**\n * Schema for tools that only need an optional project path\n */\nconst OptionalProjectPathSchema = object({\n cwd: z.string(),\n})\n\n/**\n * Service for handling MCP server operations\n */\nexport class ServerService {\n private server: Server\n private documentService: DocumentService\n private fileService: FileService\n private solution: Solution | null\n private projectPath: string | null\n\n constructor(projectPath?: string) {\n this.solution = null\n this.projectPath = projectPath || null\n this.documentService = new DocumentService()\n this.fileService = new FileService()\n this.server = new Server(\n {\n name: 'specifai',\n version: `${process.env.SP_VERSION || '0.0.0'}`,\n },\n {\n capabilities: {\n tools: {},\n },\n }\n )\n\n logger.info('Initializing MCP server...')\n this.setupRequestHandlers()\n logger.info('MCP server initialized')\n }\n\n /**\n * Format document array into text output\n */\n private formatDocuments(docs: Array<{ id: string; title: string; description: string }>): string {\n return docs\n .map((doc) =>\n [\n `ID: ${doc.id}`,\n `Title: ${doc.title}`,\n `Description: ${doc.description}`,\n '--------------',\n ].join('\\n')\n )\n .join('\\n')\n }\n\n /**\n * Auto-infer project path and load solution\n * @param projectPath - The project path to load the solution from\n * */\n private async loadSolutionByAutoInference(projectPath: string): Promise<void> {\n const inferredPath = await this.inferProjectPath(projectPath)\n if (inferredPath) {\n this.projectPath = inferredPath\n this.solution = await this.documentService.loadSolution(inferredPath)\n logger.info({ inferredPath }, 'Project path auto-inferred')\n }\n }\n\n /**\n * Infer project path from a given directory path\n * @param directoryPath - The directory path to check for .specifai-path file\n * @returns The inferred project path or null if not found\n */\n private async inferProjectPath(directoryPath: string): Promise<string | null> {\n if (!directoryPath) {\n logger.debug('No directory path provided for inference')\n return null\n }\n\n try {\n // Check if the directory exists\n if (!(await this.fileService.isDirectory(directoryPath))) {\n logger.debug({ directoryPath }, 'Directory does not exist')\n return null\n }\n\n // Check if .specifai-path file exists\n const specFilePath = join(directoryPath, '.specifai-path')\n try {\n await access(specFilePath, constants.R_OK)\n } catch {\n logger.debug({ specFilePath }, '.specifai-path file not found')\n return null\n }\n\n // Read the file content\n const content = await readFile(specFilePath, 'utf-8')\n const projectPath = content.trim()\n\n // Validate the project path\n if (!(await this.fileService.isDirectory(projectPath))) {\n logger.warn({ projectPath }, 'Project path from .specifai-path is not a valid directory')\n return null\n }\n\n logger.info({ directoryPath, projectPath }, 'Successfully inferred project path')\n return projectPath\n } catch (error) {\n logger.error({ error, directoryPath }, 'Error inferring project path')\n return null\n }\n }\n\n /**\n * Setup all request handlers for the server\n */\n private setupRequestHandlers(): void {\n this.setupListToolsHandler()\n this.setupCallToolHandler()\n }\n\n /**\n * Setup handler for listing available tools\n */\n private setupListToolsHandler(): void {\n this.server.setRequestHandler(ListToolsRequestSchema, async () => {\n logger.info('Handling list tools request')\n return {\n tools: [\n {\n name: 'get-brds',\n description: 'Get Business Requirement Documents for this project',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-prds',\n description: 'Get Product Requirement Documents for this project',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-nfrs',\n description: 'Get Non-Functional Requirement Documents for this project',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-uirs',\n description: 'Get User Interface Requirement Documents for this project',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-bpds',\n description: 'Get Business Process Documents for this project',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-user-stories',\n description: 'Get User Stories for a particular PRD',\n inputSchema: {\n type: 'object',\n required: ['prdId', 'cwd'],\n properties: {\n prdId: {\n type: 'string',\n description: 'The ID of the PRD to get user stories for',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n {\n name: 'get-tasks',\n description: 'Get Tasks for a particular User Story',\n inputSchema: {\n type: 'object',\n required: ['prdId', 'userStoryId', 'cwd'],\n properties: {\n prdId: {\n type: 'string',\n description: 'The ID of the PRD to get user stories for',\n },\n userStoryId: {\n type: 'string',\n description: 'The ID of the User Story to get tasks for',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n {\n name: 'get-task',\n description: 'Get a Task for a particular User Story in a particular PRD',\n inputSchema: {\n type: 'object',\n required: ['prdId', 'userStoryId', 'taskId', 'cwd'],\n properties: {\n prdId: {\n type: 'string',\n description: 'The ID of the PRD to get user stories for',\n },\n userStoryId: {\n type: 'string',\n description: 'The ID of the User Story to get tasks for',\n },\n taskId: {\n type: 'string',\n description: 'The ID of the Task to get',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n {\n name: 'set-project-path',\n description:\n 'Update the project path and reload the solution. use this tool only when we not automatically able to infer the project path or asked by the user or us., we will try to auto infer it from the environment first.',\n inputSchema: {\n type: 'object',\n required: ['path'],\n properties: {\n path: {\n type: 'string',\n description:\n 'The absolute path to a directory containing specifai specification files.',\n },\n },\n },\n },\n ],\n }\n })\n }\n\n /**\n * Setup handler for tool calls\n */\n private setupCallToolHandler(): void {\n if (this.projectPath) {\n logger.info({ projectPath: this.projectPath }, 'Project path is found from process.env.PWD')\n this.inferProjectPath(this.projectPath).then((inferredPath) => {\n if (inferredPath) {\n logger.info({ inferredPath }, 'Project path auto-inferred')\n this.projectPath = inferredPath\n this.documentService.loadSolution(inferredPath).then((solution) => {\n this.solution = solution\n logger.info('Solution loaded from auto-inferred project path')\n })\n }\n })\n }\n this.server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params\n logger.info({ tool: name, args }, 'Handling tool call')\n\n try {\n switch (name) {\n case 'set-project-path': {\n const { path } = object({ path: z.string() }).parse(args)\n this.projectPath = path\n this.solution = await this.documentService.loadSolution(path)\n return this.createTextResponse(`Project path set to: ${path}`)\n }\n\n case 'get-brds': {\n const { cwd } = OptionalProjectPathSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n return this.createTextResponse(this.formatDocuments(this.solution.BRD))\n }\n\n case 'get-prds': {\n const { cwd } = OptionalProjectPathSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n return this.createTextResponse(this.formatDocuments(this.solution.PRD))\n }\n\n case 'get-nfrs': {\n const { cwd } = OptionalProjectPathSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n return this.createTextResponse(this.formatDocuments(this.solution.NFR))\n }\n\n case 'get-uirs': {\n const { cwd } = OptionalProjectPathSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n return this.createTextResponse(this.formatDocuments(this.solution.UIR))\n }\n\n case 'get-bpds': {\n const { cwd } = OptionalProjectPathSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n return this.createTextResponse(this.formatDocuments(this.solution.BP))\n }\n\n case 'get-user-stories': {\n const { prdId, cwd } = GetUserStoriesRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const prd = this.documentService.findPRD(this.solution, prdId)\n if (!prd) {\n logger.warn({ prdId }, 'PRD not found')\n return this.createTextResponse(`No PRD found with ID ${prdId}`)\n }\n return this.createTextResponse(this.formatDocuments(prd.userStories))\n }\n\n case 'get-tasks': {\n const { prdId, userStoryId, cwd } = GetTasksRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const prd = this.documentService.findPRD(this.solution, prdId)\n if (!prd) {\n logger.warn({ prdId }, 'PRD not found')\n return this.createTextResponse(`No PRD found with ID ${prdId}`)\n }\n const userStory = this.documentService.findUserStory(prd, userStoryId)\n if (!userStory) {\n logger.warn({ prdId, userStoryId }, 'User Story not found')\n return this.createTextResponse(`No User Story found with ID ${userStoryId}`)\n }\n return this.createTextResponse(this.formatDocuments(userStory.tasks))\n }\n\n case 'get-task': {\n const { prdId, userStoryId, taskId, cwd } = GetTaskRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const prd = this.documentService.findPRD(this.solution, prdId)\n if (!prd) {\n logger.warn({ prdId }, 'PRD not found')\n return this.createTextResponse(`No PRD found with ID ${prdId}`)\n }\n const userStory = this.documentService.findUserStory(prd, userStoryId)\n if (!userStory) {\n logger.warn({ prdId, userStoryId }, 'User Story not found')\n return this.createTextResponse(`No User Story found with ID ${userStoryId}`)\n }\n const task = this.documentService.findTask(userStory, taskId)\n if (!task) {\n logger.warn({ prdId, userStoryId, taskId }, 'Task not found')\n return this.createTextResponse(`No Task found with ID ${taskId}`)\n }\n return this.createTextResponse(\n [`ID: ${task.id}`, `Title: ${task.title}`, `Description: ${task.description}`].join(\n '\\n'\n )\n )\n }\n\n default:\n logger.warn({ tool: name }, 'Unknown tool called')\n throw new Error(`Unknown tool: ${name}`)\n }\n } catch (error) {\n if (error instanceof z.ZodError) {\n const message = `Invalid arguments: ${error.errors\n .map((e) => `${e.path.join('.')}: ${e.message}`)\n .join(', ')}`\n logger.error({ error: error.errors, tool: name }, message)\n throw new Error(message)\n }\n logger.error({ error, tool: name }, 'Error handling tool call')\n throw error\n }\n })\n }\n\n /**\n * Create a text response object\n */\n private createTextResponse(text: string) {\n return {\n content: [\n {\n type: 'text',\n text,\n },\n ],\n }\n }\n\n /**\n * Start the server\n */\n async start(): Promise<void> {\n logger.info('Starting MCP server...')\n const transport = new StdioServerTransport()\n await this.server.connect(transport)\n logger.info('MCP server started successfully')\n }\n}\n",
|
11
|
+
"import { Server } from '@modelcontextprotocol/sdk/server/index.js'\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'\nimport { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js'\nimport { object, z } from 'zod'\nimport { join } from 'path'\nimport { readFile, access, constants } from 'fs/promises'\nimport type { Solution } from '../types'\nimport { DocumentService } from './document.service'\nimport { FileService } from './file.service'\nimport { logger } from '../utils/logger'\nimport MiniSearch from 'minisearch'\n\n/**\n * Schema for get-user-stories request\n */\nconst GetUserStoriesRequestSchema = object({\n prdId: z.string(),\n cwd: z.string(),\n})\n\n/**\n * Schema for get-tasks request\n */\nconst GetTasksRequestSchema = object({\n prdId: z.string(),\n userStoryId: z.string(),\n cwd: z.string(),\n})\n\n/**\n * Schema for get-task request\n */\nconst GetTaskRequestSchema = object({\n prdId: z.string(),\n userStoryId: z.string(),\n taskId: z.string(),\n cwd: z.string(),\n})\n\n/**\n * Schema for tools that only need an optional project path\n */\nconst OptionalProjectPathSchema = object({\n cwd: z.string(),\n})\n\nconst GetTaskByIdRequestSchema = object({\n taskId: z.string(),\n cwd: z.string(),\n})\n\nconst SearchRequestSchema = object({\n searchTerm: z.string(),\n cwd: z.string(),\n type: z.enum(['PRD', 'BRD', 'NFR', 'UIR', 'BP', 'US', 'TASK']).optional(),\n})\n\nconst GetBRsRequestSchema = object({\n cwd: z.string(),\n includeDescription: z.boolean().optional().default(false),\n limit: z.number().optional().default(10),\n offset: z.number().optional().default(0),\n})\n\nconst GetPRDsRequestSchema = object({\n cwd: z.string(),\n includeDescription: z.boolean().optional().default(false),\n limit: z.number().optional().default(10),\n offset: z.number().optional().default(0),\n includeUserStories: z.boolean().optional().default(false),\n includeTasks: z.boolean().optional().default(false),\n})\n\nconst GetNFRsRequestSchema = object({\n cwd: z.string(),\n includeDescription: z.boolean().optional().default(false),\n limit: z.number().optional().default(10),\n offset: z.number().optional().default(0),\n})\n\nconst GetUIRsRequestSchema = object({\n cwd: z.string(),\n includeDescription: z.boolean().optional().default(false),\n limit: z.number().optional().default(10),\n offset: z.number().optional().default(0),\n})\n\nconst GetBPsRequestSchema = object({\n cwd: z.string(),\n includeDescription: z.boolean().optional().default(false),\n limit: z.number().optional().default(10),\n offset: z.number().optional().default(0),\n})\n\nconst GetListAllTasksRequestSchema = object({\n cwd: z.string(),\n limit: z.number().optional().default(10),\n offset: z.number().optional().default(0),\n})\n\n/**\n * Service for handling MCP server operations\n */\nexport class ServerService {\n private server: Server\n private documentService: DocumentService\n private fileService: FileService\n private solution: Solution | null\n private projectPath: string | null\n private miniSearch: MiniSearch\n\n constructor(projectPath?: string) {\n this.solution = null\n this.projectPath = projectPath || null\n this.documentService = new DocumentService()\n this.fileService = new FileService()\n this.miniSearch = new MiniSearch({\n fields: ['id', 'title', 'description', 'type'],\n storeFields: ['id', 'title', 'description', 'type'],\n searchOptions: {\n fuzzy: true,\n },\n })\n this.server = new Server(\n {\n name: 'specifai',\n version: `${process.env.SP_VERSION || '0.0.0'}`,\n },\n {\n capabilities: {\n tools: {},\n },\n }\n )\n\n logger.info('Initializing MCP server...')\n this.setupRequestHandlers()\n logger.info('MCP server initialized')\n }\n\n /**\n * Format document array into text output\n */\n private formatDocuments(docs: Array<{ id: string; title: string; description: string }>): string {\n return docs\n .map((doc) =>\n [\n `ID: ${doc.id}`,\n `Title: ${doc.title}`,\n `Description: ${doc.description}`,\n '--------------',\n ].join('\\n')\n )\n .join('\\n')\n }\n\n /**\n * Format document array into text output\n */\n private formatDocumentsV2(\n docs: Array<{\n [key: string]: any\n }>\n ): string {\n return docs\n .map((doc) =>\n [\n Object.keys(doc)\n .map((key) => `${key}: ${doc[key]}`)\n .join('\\n'),\n '--------------',\n ].join('\\n')\n )\n .join('\\n')\n }\n\n /**\n * Auto-infer project path and load solution\n * @param projectPath - The project path to load the solution from\n * */\n private async loadSolutionByAutoInference(projectPath: string): Promise<void> {\n const inferredPath = await this.inferProjectPath(projectPath)\n if (inferredPath) {\n this.projectPath = inferredPath\n this.solution = await this.documentService.loadSolution(inferredPath)\n this.updateMiniSearchIndex()\n logger.info({ inferredPath }, 'Project path auto-inferred')\n }\n }\n\n /**\n * Infer project path from a given directory path\n * @param directoryPath - The directory path to check for .specifai-path file\n * @returns The inferred project path or null if not found\n */\n private async inferProjectPath(directoryPath: string): Promise<string | null> {\n if (!directoryPath) {\n logger.debug('No directory path provided for inference')\n return null\n }\n\n try {\n // Check if the directory exists\n if (!(await this.fileService.isDirectory(directoryPath))) {\n logger.debug({ directoryPath }, 'Directory does not exist')\n return null\n }\n\n // Check if .specifai-path file exists\n const specFilePath = join(directoryPath, '.specifai-path')\n try {\n await access(specFilePath, constants.R_OK)\n } catch {\n logger.debug({ specFilePath }, '.specifai-path file not found')\n return null\n }\n\n // Read the file content\n const content = await readFile(specFilePath, 'utf-8')\n const projectPath = content.trim()\n\n // Validate the project path\n if (!(await this.fileService.isDirectory(projectPath))) {\n logger.warn({ projectPath }, 'Project path from .specifai-path is not a valid directory')\n return null\n }\n\n logger.info({ directoryPath, projectPath }, 'Successfully inferred project path')\n return projectPath\n } catch (error) {\n logger.error({ error, directoryPath }, 'Error inferring project path')\n return null\n }\n }\n\n /**\n * Setup all request handlers for the server\n */\n private setupRequestHandlers(): void {\n this.setupListToolsHandler()\n this.setupCallToolHandler()\n }\n\n /**\n * Setup handler for listing available tools\n */\n private setupListToolsHandler(): void {\n this.server.setRequestHandler(ListToolsRequestSchema, async () => {\n const cwdMessage =\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.'\n logger.info('Handling list tools request')\n return {\n tools: [\n {\n name: 'get-brds',\n description:\n 'Get Business Requirement Documents for this project, returns ID, Title, Description(not included by default)',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description: cwdMessage,\n },\n includeDescription: {\n type: 'boolean',\n description: 'Include description in the output, default is false',\n },\n limit: {\n type: 'number',\n description: 'Limit the number of documents to return, default is 10',\n },\n offset: {\n type: 'number',\n description: 'Offset the number of documents to return, default is 0',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-prds',\n description:\n 'Get Product Requirement Documents for this project, returns ID, Title, Description(not included by default)',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description: cwdMessage,\n },\n includeDescription: {\n type: 'boolean',\n description: 'Include description in the output, default is false',\n },\n limit: {\n type: 'number',\n description: 'Limit the number of documents to return, default is 10',\n },\n offset: {\n type: 'number',\n description: 'Offset the number of documents to return, default is 0',\n },\n includeUserStories: {\n type: 'boolean',\n description:\n 'Include user stories in the output each user stories will include ID and Title, Description will not be included, default is false',\n },\n includeTasks: {\n type: 'boolean',\n description:\n 'Include tasks in the output each task will include ID and Title, Description will not be included, default is false',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-nfrs',\n description:\n 'Get Non-Functional Requirement Documents for this project, returns ID, Title, Description(not included by default)',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description: cwdMessage,\n },\n includeDescription: {\n type: 'boolean',\n description: 'Include description in the output, default is false',\n },\n limit: {\n type: 'number',\n description: 'Limit the number of documents to return, default is 10',\n },\n offset: {\n type: 'number',\n description: 'Offset the number of documents to return, default is 0',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-uirs',\n description: 'Get User Interface Requirement Documents for this project',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n includeDescription: {\n type: 'boolean',\n description: 'Include description in the output, default is false',\n },\n limit: {\n type: 'number',\n description: 'Limit the number of documents to return, default is 10',\n },\n offset: {\n type: 'number',\n description: 'Offset the number of documents to return, default is 0',\n },\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-bpds',\n description: 'Get Business Process Documents for this project',\n inputSchema: {\n type: 'object',\n properties: {\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n includeDescription: {\n type: 'boolean',\n description: 'Include description in the output, default is false',\n },\n limit: {\n type: 'number',\n description: 'Limit the number of documents to return, default 10',\n },\n offset: {\n type: 'number',\n description: 'Offset the number of documents to return, default is 0',\n },\n required: ['cwd'],\n },\n },\n {\n name: 'get-user-stories',\n description: 'Get User Stories for a particular PRD',\n inputSchema: {\n type: 'object',\n required: ['prdId', 'cwd'],\n properties: {\n prdId: {\n type: 'string',\n description:\n 'The ID of the PRD to get user stories for, PRD ID convention is PRD<PRD Number>, PRD number is zero padded with minimum 2 digits, e.g. PRD01, PRD12, PRD103, etc.',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n {\n name: 'get-tasks',\n description: 'Get Tasks for a particular User Story',\n inputSchema: {\n type: 'object',\n required: ['prdId', 'userStoryId', 'cwd'],\n properties: {\n prdId: {\n type: 'string',\n description:\n 'The ID of the PRD to get user stories for, PRD ID convention is PRD<PRD Number>, PRD number is zero padded with minimum 2 digits, e.g. PRD01, PRD12, PRD103, etc.',\n },\n userStoryId: {\n type: 'string',\n description:\n 'The ID of the User Story to get tasks for, US ID convention is US<US Number>, US number is non zero padded, e.g. US1, US12, US103, etc.',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n {\n name: 'get-task',\n description: 'Get list of Tasks for a particular User Story in a particular PRD',\n inputSchema: {\n type: 'object',\n required: ['prdId', 'userStoryId', 'taskId', 'cwd'],\n properties: {\n prdId: {\n type: 'string',\n description:\n 'The ID of the PRD to get user stories for, PRD ID convention is PRD<PRD Number>, PRD number is zero padded with minimum 2 digits, e.g. PRD01, PRD12, PRD103, etc.',\n },\n userStoryId: {\n type: 'string',\n description:\n 'The ID of the User Story to get tasks for, US ID convention is US<US Number>, US number is non zero padded, e.g. US1, US12, US103, etc.',\n },\n taskId: {\n type: 'string',\n description:\n 'The ID of the Task to get, TASK ID convention is TASK<TASK Number>, TASK number is non zero padded, e.g. TASK1, TASK12, TASK103, etc.',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n {\n name: 'set-project-path',\n description:\n 'Update the project path and reload the solution. use this tool only when we not automatically able to infer the project path or asked by the user or us., we will try to auto infer it from the environment first.',\n inputSchema: {\n type: 'object',\n required: ['path'],\n properties: {\n path: {\n type: 'string',\n description:\n 'The absolute path to a directory containing specifai specification files.',\n },\n },\n },\n },\n {\n name: 'get-task-by-id',\n description:\n \"Retrieves complete information about a specific task when you know its exact ID. This tool provides direct access to a single task's details without having to retrieve and filter through all tasks., returns full task object, ID, Title, Description\",\n inputSchema: {\n type: 'object',\n required: ['taskId', 'cwd'],\n properties: {\n taskId: {\n type: 'string',\n description:\n 'The unique identifier for the task you want to retrieve Must follow the format: TASK followed by a number without leading zeros Examples: TASK1 TASK12, TASK103 Note: The number portion is NOT zero-padded (use TASK1, not TASK01), Convert the Task ID to mentioned format to use this tool.',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n {\n name: 'list-all-tasks',\n description:\n 'List all the tasks available across all PRDs and User Stories, without task description, only return ID and Title',\n inputSchema: {\n type: 'object',\n required: ['cwd'],\n properties: {\n cwd: {\n type: 'string',\n description: cwdMessage,\n },\n limit: {\n type: 'number',\n description: 'Limit the number of documents to return, default is 10',\n },\n offset: {\n type: 'number',\n description: 'Offset the number of documents to return, default is 0',\n },\n },\n },\n },\n {\n name: 'search',\n description:\n 'Full text search across all documents, returns an array of document ID, Title, Description',\n inputSchema: {\n type: 'object',\n required: ['searchTerm', 'cwd'],\n properties: {\n searchTerm: {\n type: 'string',\n description: 'The search term to search for',\n },\n type: {\n type: 'string',\n description:\n 'Optional type of document to search in, valid values are: PRD, BRD, NFR, UIR, BP, US, TASK',\n },\n cwd: {\n type: 'string',\n description:\n 'Absolute path where the tool is called from and containing the `.specifai-path` file to auto-infer the specifai project path. This path will be current working directory (cwd) from where the tool is called.',\n },\n },\n },\n },\n ],\n }\n })\n }\n\n private updateMiniSearchIndex(): void {\n if (!this.solution) return\n this.miniSearch.removeAll()\n const docs = [\n ...this.solution.PRD.map((prd) => ({ ...prd, type: 'PRD' })),\n ...this.solution.BRD.map((brd) => ({ ...brd, type: 'BRD' })),\n ...this.solution.NFR.map((nfr) => ({ ...nfr, type: 'NFR' })),\n ...this.solution.UIR.map((uir) => ({ ...uir, type: 'UIR' })),\n ...this.solution.BP.map((bp) => ({ ...bp, type: 'BP' })),\n ...this.solution.PRD.flatMap((prd) => prd.userStories).map((userStory) => ({\n ...userStory,\n type: 'US',\n })),\n ...this.solution.PRD.flatMap((prd) =>\n prd.userStories.flatMap((userStory) => userStory.tasks)\n ).map((task) => ({ ...task, type: 'TASK' })),\n ]\n this.miniSearch.addAll(docs)\n }\n\n private paginate<T>(array: T[], limit = 0, offset = 0) {\n if (limit === 0) return array.slice(offset)\n return array.slice(offset, offset + limit)\n }\n\n /**\n * Setup handler for tool calls\n */\n private setupCallToolHandler(): void {\n if (this.projectPath) {\n logger.info({ projectPath: this.projectPath }, 'Project path is found from process.env.PWD')\n this.inferProjectPath(this.projectPath).then((inferredPath) => {\n if (inferredPath) {\n logger.info({ inferredPath }, 'Project path auto-inferred')\n this.projectPath = inferredPath\n this.documentService.loadSolution(inferredPath).then((solution) => {\n this.solution = solution\n this.updateMiniSearchIndex()\n logger.info('Solution loaded from auto-inferred project path')\n })\n }\n })\n }\n this.server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params\n logger.info({ tool: name, args }, 'Handling tool call')\n\n try {\n switch (name) {\n case 'set-project-path': {\n const { path } = object({ path: z.string() }).parse(args)\n this.projectPath = path\n this.solution = await this.documentService.loadSolution(path)\n this.updateMiniSearchIndex()\n return this.createTextResponse(`Project path set to: ${path}`)\n }\n\n case 'get-brds': {\n const { cwd, includeDescription, limit, offset } = GetBRsRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n\n const docs = this.paginate(\n this.solution.BRD.map((brd) => ({\n ID: brd.id,\n Title: brd.title,\n ...(includeDescription ? { Description: brd.description } : {}),\n })),\n limit,\n offset\n )\n\n if (docs.length === 0) {\n return this.createTextResponse('No BRDs found')\n }\n\n return this.createTextResponse(this.formatDocumentsV2(docs))\n }\n\n case 'get-prds': {\n const { cwd, includeDescription, includeTasks, includeUserStories, limit, offset } =\n GetPRDsRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n\n const docs = this.paginate(this.solution.PRD, limit, offset)\n\n if (docs.length === 0) {\n return this.createTextResponse('No PRDs found')\n }\n\n return this.createTextResponse(\n docs.reduce((acc, prd) => {\n const lines = [\n `ID: ${prd.id}`,\n `Title: ${prd.title}`,\n ...(includeDescription ? [`Description: ${prd.description}`] : []),\n ]\n\n if (includeUserStories) {\n if (prd.userStories.length === 0) {\n lines.push(`User Stories: ${prd.id} has no user stories`)\n } else {\n lines.push(`User Stories:`)\n prd.userStories.forEach((userStory) => {\n lines.push(` US ID: ${userStory.id}`)\n lines.push(` US Title: ${userStory.title}`)\n\n if (includeTasks) {\n if (userStory.tasks.length === 0) {\n lines.push(` Tasks: ${userStory.id} has no tasks`)\n } else {\n lines.push(` Tasks:`)\n userStory.tasks.forEach((task) => {\n lines.push(` TASK ID: ${task.id}`)\n lines.push(` TASK Title: ${task.title}`)\n })\n }\n }\n })\n }\n }\n\n lines.push('--------------\\n')\n return acc + lines.join('\\n') + '\\n'\n }, '')\n )\n }\n\n case 'get-nfrs': {\n const { cwd, includeDescription, limit, offset } = GetNFRsRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n\n const docs = this.paginate(\n this.solution.NFR.map((brd) => ({\n ID: brd.id,\n Title: brd.title,\n ...(includeDescription ? { Description: brd.description } : {}),\n })),\n limit,\n offset\n )\n\n if (docs.length === 0) {\n return this.createTextResponse('No NFRs found')\n }\n\n return this.createTextResponse(this.formatDocumentsV2(docs))\n }\n\n case 'get-uirs': {\n const { cwd, includeDescription, limit, offset } = GetUIRsRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n\n const docs = this.paginate(\n this.solution.UIR.map((brd) => ({\n ID: brd.id,\n Title: brd.title,\n ...(includeDescription ? { Description: brd.description } : {}),\n })),\n limit,\n offset\n )\n\n if (docs.length === 0) {\n return this.createTextResponse('No UIRs found')\n }\n\n return this.createTextResponse(this.formatDocumentsV2(docs))\n }\n\n case 'get-bpds': {\n const { cwd, includeDescription, limit, offset } = GetBPsRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n\n const docs = this.paginate(\n this.solution.BP.map((brd) => ({\n ID: brd.id,\n Title: brd.title,\n ...(includeDescription ? { Description: brd.description } : {}),\n })),\n limit,\n offset\n )\n\n if (docs.length === 0) {\n return this.createTextResponse('No BPs found')\n }\n\n return this.createTextResponse(this.formatDocumentsV2(docs))\n }\n\n case 'get-user-stories': {\n const { prdId, cwd } = GetUserStoriesRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const prd = this.documentService.findPRD(this.solution, prdId)\n if (!prd) {\n logger.warn({ prdId }, 'PRD not found')\n return this.createTextResponse(`No PRD found with ID ${prdId}`)\n }\n return this.createTextResponse(this.formatDocuments(prd.userStories))\n }\n\n case 'get-tasks': {\n const { prdId, userStoryId, cwd } = GetTasksRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const prd = this.documentService.findPRD(this.solution, prdId)\n if (!prd) {\n logger.warn({ prdId }, 'PRD not found')\n return this.createTextResponse(`No PRD found with ID ${prdId}`)\n }\n const userStory = this.documentService.findUserStory(prd, userStoryId)\n if (!userStory) {\n logger.warn({ prdId, userStoryId }, 'User Story not found')\n return this.createTextResponse(`No User Story found with ID ${userStoryId}`)\n }\n return this.createTextResponse(this.formatDocuments(userStory.tasks))\n }\n\n case 'get-task': {\n const { prdId, userStoryId, taskId, cwd } = GetTaskRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const prd = this.documentService.findPRD(this.solution, prdId)\n if (!prd) {\n logger.warn({ prdId }, 'PRD not found')\n return this.createTextResponse(`No PRD found with ID ${prdId}`)\n }\n const userStory = this.documentService.findUserStory(prd, userStoryId)\n if (!userStory) {\n logger.warn({ prdId, userStoryId }, 'User Story not found')\n return this.createTextResponse(`No User Story found with ID ${userStoryId}`)\n }\n const task = this.documentService.findTask(userStory, taskId)\n if (!task) {\n logger.warn({ prdId, userStoryId, taskId }, 'Task not found')\n return this.createTextResponse(`No Task found with ID ${taskId}`)\n }\n return this.createTextResponse(\n [`ID: ${task.id}`, `Title: ${task.title}`, `Description: ${task.description}`].join(\n '\\n'\n )\n )\n }\n\n case 'list-all-tasks': {\n const { cwd, limit, offset } = GetListAllTasksRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const tasks = this.paginate(\n this.solution.PRD.map((prd) =>\n prd.userStories.map((userStory) => userStory.tasks)\n ).flat(2),\n limit,\n offset\n )\n\n if (!tasks || tasks.length === 0) {\n return this.createTextResponse('No tasks found')\n }\n\n return this.createTextResponse(\n this.formatDocumentsV2(\n tasks.map((task) => ({\n ID: task.id,\n Title: task.title,\n }))\n )\n )\n }\n\n case 'get-task-by-id': {\n const { taskId, cwd } = GetTaskByIdRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n const task = this.solution.PRD.flatMap((prd) =>\n prd.userStories.flatMap((userStory) => userStory.tasks)\n ).find((task) => task.id === taskId)\n if (!task) {\n logger.warn({ taskId }, 'Task not found')\n return this.createTextResponse(`No Task found with ID ${taskId}`)\n }\n return this.createTextResponse(\n [`ID: ${task.id}`, `Title: ${task.title}`, `Description: ${task.description}`].join(\n '\\n'\n )\n )\n }\n\n case 'search': {\n const { searchTerm, cwd, type } = SearchRequestSchema.parse(args)\n\n // Try to infer project path if provided\n if (cwd) {\n await this.loadSolutionByAutoInference(cwd)\n }\n\n if (!this.solution || !cwd) {\n throw new Error(\n 'No project path set. Use set-project-path first or provide a valid cwd to auto-infer.'\n )\n }\n\n let searchResult = this.miniSearch.search(searchTerm)\n\n if (type) {\n searchResult = searchResult.filter((doc) => doc.type === type)\n }\n\n if (searchResult.length === 0) {\n return this.createTextResponse('No results found')\n }\n\n const allSearchResultString = searchResult\n .map((doc) =>\n [\n `ID: ${doc.id}`,\n `Title: ${doc.title}`,\n `Description: ${doc.description}`,\n `Type: ${doc.type}`,\n '--------------',\n ].join('\\n')\n )\n .join('\\n')\n\n return this.createTextResponse(allSearchResultString)\n }\n\n default:\n logger.warn({ tool: name }, 'Unknown tool called')\n throw new Error(`Unknown tool: ${name}`)\n }\n } catch (error) {\n if (error instanceof z.ZodError) {\n const message = `Invalid arguments: ${error.errors\n .map((e) => `${e.path.join('.')}: ${e.message}`)\n .join(', ')}`\n logger.error({ error: error.errors, tool: name }, message)\n throw new Error(message)\n }\n logger.error({ error, tool: name }, 'Error handling tool call')\n throw error\n }\n })\n }\n\n /**\n * Create a text response object\n */\n private createTextResponse(text: string) {\n return {\n content: [\n {\n type: 'text',\n text,\n },\n ],\n }\n }\n\n /**\n * Start the server\n */\n async start(): Promise<void> {\n logger.info('Starting MCP server...')\n const transport = new StdioServerTransport()\n await this.server.connect(transport)\n logger.info('MCP server started successfully')\n }\n}\n",
|
12
12
|
"import { join } from 'path'\nimport type {\n Solution,\n JsonFileContent,\n BaseDocument,\n PRD,\n BRD,\n NFR,\n UIR,\n BP,\n UserStory,\n Task,\n} from '../types'\nimport { FileService } from './file.service'\nimport { logger } from '../utils/logger'\n\n/**\n * Service for handling document operations\n */\nexport class DocumentService {\n private fileService: FileService\n\n constructor() {\n this.fileService = new FileService()\n }\n\n /**\n * Normalize JSON file content into BaseDocument format\n * @param objects - Array of JSON file contents\n * @returns Array of normalized documents\n */\n private normalize(objects: JsonFileContent[]): BaseDocument[] {\n logger.debug({ count: objects.length }, 'Normalizing documents')\n return objects.map((obj) => ({\n id: obj.name.replace('.json', '').replace('-base', ''),\n title: obj.content.title,\n description: obj.content.requirement,\n }))\n }\n\n /**\n * Process PRD files to include user stories and tasks\n * @param prds - Array of PRD file contents\n * @returns Array of processed PRDs\n */\n private processPRDs(prds: JsonFileContent[]): PRD[] {\n logger.debug({ count: prds.length }, 'Processing PRD files')\n return prds\n .map((obj) => {\n if (!obj.name.includes('feature')) {\n const prd = prds.find((prd) => prd.name === obj.name.replace('base', 'feature'))\n if (!prd) {\n logger.warn({ basePrd: obj.name }, 'No matching feature PRD found')\n return null\n }\n\n const userStories: UserStory[] = prd.content.features.map((feature: any) => ({\n id: feature.id,\n title: feature.name,\n description: feature.description,\n tasks: feature.tasks.map(\n (task: any): Task => ({\n id: task.id,\n title: task.list,\n description: task.acceptance,\n })\n ),\n }))\n\n logger.debug(\n { prdId: obj.name, userStoriesCount: userStories.length },\n 'Processed PRD with user stories'\n )\n\n return {\n id: obj.name.replace('.json', '').replace('-base', ''),\n title: obj.content.title,\n description: obj.content.requirement,\n userStories,\n }\n }\n return null\n })\n .filter((obj): obj is PRD => obj !== null)\n }\n\n /**\n * Load all documents from a project directory\n * @param projectPath - Path to the project directory\n * @returns Solution containing all document types\n */\n async loadSolution(projectPath: string): Promise<Solution> {\n logger.info({ projectPath }, 'Loading solution')\n\n if (!(await this.fileService.isDirectory(projectPath))) {\n logger.error({ projectPath }, 'Invalid project path')\n throw new Error(`Invalid project path: ${projectPath}`)\n }\n\n try {\n const [bps, brds, prds, nfrs, uirs] = await Promise.all([\n this.fileService.readAllJsonFiles(join(projectPath, 'BP')),\n this.fileService.readAllJsonFiles(join(projectPath, 'BRD')),\n this.fileService.readAllJsonFiles(join(projectPath, 'PRD')),\n this.fileService.readAllJsonFiles(join(projectPath, 'NFR')),\n this.fileService.readAllJsonFiles(join(projectPath, 'UIR')),\n ])\n\n const solution = {\n BP: this.normalize(bps) as BP[],\n BRD: this.normalize(brds) as BRD[],\n PRD: this.processPRDs(prds),\n NFR: this.normalize(nfrs) as NFR[],\n UIR: this.normalize(uirs) as UIR[],\n }\n\n logger.info(\n {\n bpsCount: solution.BP.length,\n brdsCount: solution.BRD.length,\n prdsCount: solution.PRD.length,\n nfrsCount: solution.NFR.length,\n uirsCount: solution.UIR.length,\n },\n 'Solution loaded successfully'\n )\n\n return solution\n } catch (error) {\n logger.warn({ error, projectPath }, 'Some directories not found while loading solution')\n return {\n BP: [],\n BRD: [],\n PRD: [],\n NFR: [],\n UIR: [],\n }\n }\n }\n\n /**\n * Find a PRD by ID\n * @param solution - Solution containing all documents\n * @param prdId - ID of the PRD to find\n * @returns PRD if found, null otherwise\n */\n findPRD(solution: Solution, prdId: string): PRD | null {\n const prd = solution.PRD.find((prd) => prd.id === prdId) || null\n if (!prd) {\n logger.debug({ prdId }, 'PRD not found')\n }\n return prd\n }\n\n /**\n * Find a user story in a PRD\n * @param prd - PRD to search in\n * @param userStoryId - ID of the user story to find\n * @returns User story if found, null otherwise\n */\n findUserStory(prd: PRD, userStoryId: string): UserStory | null {\n const userStory = prd.userStories.find((story) => story.id === userStoryId) || null\n if (!userStory) {\n logger.debug({ prdId: prd.id, userStoryId }, 'User Story not found')\n }\n return userStory\n }\n\n /**\n * Find a task in a user story\n * @param userStory - User story to search in\n * @param taskId - ID of the task to find\n * @returns Task if found, null otherwise\n */\n findTask(userStory: UserStory, taskId: string): Task | null {\n const task = userStory.tasks?.find((task) => task.id === taskId) || null\n if (!task) {\n logger.debug({ userStoryId: userStory.id, taskId }, 'Task not found')\n }\n return task\n }\n}\n",
|
13
13
|
"import { join } from 'path'\nimport { readdir, readFile } from 'fs/promises'\nimport type { JsonFileContent } from '../types'\nimport { logger } from '../utils/logger'\n\n/**\n * Service for handling file system operations\n */\nexport class FileService {\n /**\n * Read all JSON files from a directory\n * @param directory - Directory path to read from\n * @returns Array of file contents with metadata\n */\n async readAllJsonFiles(directory: string): Promise<JsonFileContent[]> {\n try {\n const files = await readdir(directory)\n const jsonFiles = files.filter((file) => file.endsWith('.json'))\n\n const fileContents = await Promise.all(\n jsonFiles.map(async (file) => {\n const filePath = join(directory, file)\n const content = await readFile(filePath, 'utf-8')\n try {\n return {\n name: file,\n content: JSON.parse(content),\n }\n } catch (error) {\n logger.error({ error, file }, `Error parsing JSON file ${file}`)\n return {\n name: file,\n content: null,\n error: 'Invalid JSON',\n }\n }\n })\n )\n\n return fileContents\n } catch (error) {\n logger.warn({ error }, 'Directory not found, returning empty array')\n return []\n }\n }\n\n /**\n * Validate if a path is a directory\n * @param path - Path to validate\n * @returns True if path is a directory\n */\n async isDirectory(path: string): Promise<boolean> {\n try {\n const stats = await readdir(path)\n return true\n } catch {\n return false\n }\n }\n}\n",
|
14
14
|
"import pino from 'pino'\nimport type { LoggerOptions, TransportTargetOptions } from 'pino'\nimport os from 'os'\n\n/**\n * Default log file path: $HOME/.specifai/mcp-log.log\n * Can be overridden with LOG_FILE_PATH environment variable\n */\nconst LOG_FILE_PATH =\n process.env.LOG_FILE_PATH ||\n (process.env.HOME ? `${process.env.HOME}/.specifai/mcp-log.log` : undefined)\n\n/**\n * Logger configuration options\n */\nconst loggerOptions: LoggerOptions = {\n level: process.env.LOG_LEVEL || 'info',\n base: {\n version: process.env.SP_VERSION || '0.0.0',\n pid: process.pid,\n hostname: os.hostname(),\n },\n}\n\n/**\n * Extended transport options type that includes worker configuration\n */\ntype ExtendedTransportOptions = TransportTargetOptions & {\n worker?: {\n autoEnd: boolean\n }\n}\n\n/**\n * Create a logger instance based on environment conditions\n */\nlet logger: pino.Logger\n\n// Only attempt file logging if we have a valid path\nif (LOG_FILE_PATH) {\n try {\n /**\n * Transport configuration for file writing\n */\n const transportOptions: ExtendedTransportOptions = {\n target: 'pino/file',\n options: {\n destination: LOG_FILE_PATH,\n append: true,\n sync: false,\n mkdir: true,\n silent: true,\n },\n worker: {\n autoEnd: false,\n },\n }\n\n // Wrap in try-catch to handle any transport initialization errors\n logger = pino(loggerOptions, pino.transport(transportOptions))\n } catch (err) {\n // Silently fall back to no-op logger if transport fails\n logger = pino({ ...loggerOptions, enabled: false })\n }\n} else {\n // If no valid log path, use a no-op logger\n logger = pino({ ...loggerOptions, enabled: false })\n}\n\n// Note: We can't directly add error handlers to pino logger instances\n// The errors are handled by the transport configuration with silent: true\n\nexport { logger }\n",
|
15
|
+
"/** @ignore */\nconst ENTRIES = 'ENTRIES';\n/** @ignore */\nconst KEYS = 'KEYS';\n/** @ignore */\nconst VALUES = 'VALUES';\n/** @ignore */\nconst LEAF = '';\n/**\n * @private\n */\nclass TreeIterator {\n constructor(set, type) {\n const node = set._tree;\n const keys = Array.from(node.keys());\n this.set = set;\n this._type = type;\n this._path = keys.length > 0 ? [{ node, keys }] : [];\n }\n next() {\n const value = this.dive();\n this.backtrack();\n return value;\n }\n dive() {\n if (this._path.length === 0) {\n return { done: true, value: undefined };\n }\n const { node, keys } = last$1(this._path);\n if (last$1(keys) === LEAF) {\n return { done: false, value: this.result() };\n }\n const child = node.get(last$1(keys));\n this._path.push({ node: child, keys: Array.from(child.keys()) });\n return this.dive();\n }\n backtrack() {\n if (this._path.length === 0) {\n return;\n }\n const keys = last$1(this._path).keys;\n keys.pop();\n if (keys.length > 0) {\n return;\n }\n this._path.pop();\n this.backtrack();\n }\n key() {\n return this.set._prefix + this._path\n .map(({ keys }) => last$1(keys))\n .filter(key => key !== LEAF)\n .join('');\n }\n value() {\n return last$1(this._path).node.get(LEAF);\n }\n result() {\n switch (this._type) {\n case VALUES: return this.value();\n case KEYS: return this.key();\n default: return [this.key(), this.value()];\n }\n }\n [Symbol.iterator]() {\n return this;\n }\n}\nconst last$1 = (array) => {\n return array[array.length - 1];\n};\n\n/* eslint-disable no-labels */\n/**\n * @ignore\n */\nconst fuzzySearch = (node, query, maxDistance) => {\n const results = new Map();\n if (query === undefined)\n return results;\n // Number of columns in the Levenshtein matrix.\n const n = query.length + 1;\n // Matching terms can never be longer than N + maxDistance.\n const m = n + maxDistance;\n // Fill first matrix row and column with numbers: 0 1 2 3 ...\n const matrix = new Uint8Array(m * n).fill(maxDistance + 1);\n for (let j = 0; j < n; ++j)\n matrix[j] = j;\n for (let i = 1; i < m; ++i)\n matrix[i * n] = i;\n recurse(node, query, maxDistance, results, matrix, 1, n, '');\n return results;\n};\n// Modified version of http://stevehanov.ca/blog/?id=114\n// This builds a Levenshtein matrix for a given query and continuously updates\n// it for nodes in the radix tree that fall within the given maximum edit\n// distance. Keeping the same matrix around is beneficial especially for larger\n// edit distances.\n//\n// k a t e <-- query\n// 0 1 2 3 4\n// c 1 1 2 3 4\n// a 2 2 1 2 3\n// t 3 3 2 1 [2] <-- edit distance\n// ^\n// ^ term in radix tree, rows are added and removed as needed\nconst recurse = (node, query, maxDistance, results, matrix, m, n, prefix) => {\n const offset = m * n;\n key: for (const key of node.keys()) {\n if (key === LEAF) {\n // We've reached a leaf node. Check if the edit distance acceptable and\n // store the result if it is.\n const distance = matrix[offset - 1];\n if (distance <= maxDistance) {\n results.set(prefix, [node.get(key), distance]);\n }\n }\n else {\n // Iterate over all characters in the key. Update the Levenshtein matrix\n // and check if the minimum distance in the last row is still within the\n // maximum edit distance. If it is, we can recurse over all child nodes.\n let i = m;\n for (let pos = 0; pos < key.length; ++pos, ++i) {\n const char = key[pos];\n const thisRowOffset = n * i;\n const prevRowOffset = thisRowOffset - n;\n // Set the first column based on the previous row, and initialize the\n // minimum distance in the current row.\n let minDistance = matrix[thisRowOffset];\n const jmin = Math.max(0, i - maxDistance - 1);\n const jmax = Math.min(n - 1, i + maxDistance);\n // Iterate over remaining columns (characters in the query).\n for (let j = jmin; j < jmax; ++j) {\n const different = char !== query[j];\n // It might make sense to only read the matrix positions used for\n // deletion/insertion if the characters are different. But we want to\n // avoid conditional reads for performance reasons.\n const rpl = matrix[prevRowOffset + j] + +different;\n const del = matrix[prevRowOffset + j + 1] + 1;\n const ins = matrix[thisRowOffset + j] + 1;\n const dist = matrix[thisRowOffset + j + 1] = Math.min(rpl, del, ins);\n if (dist < minDistance)\n minDistance = dist;\n }\n // Because distance will never decrease, we can stop. There will be no\n // matching child nodes.\n if (minDistance > maxDistance) {\n continue key;\n }\n }\n recurse(node.get(key), query, maxDistance, results, matrix, i, n, prefix + key);\n }\n }\n};\n\n/* eslint-disable no-labels */\n/**\n * A class implementing the same interface as a standard JavaScript\n * [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)\n * with string keys, but adding support for efficiently searching entries with\n * prefix or fuzzy search. This class is used internally by {@link MiniSearch}\n * as the inverted index data structure. The implementation is a radix tree\n * (compressed prefix tree).\n *\n * Since this class can be of general utility beyond _MiniSearch_, it is\n * exported by the `minisearch` package and can be imported (or required) as\n * `minisearch/SearchableMap`.\n *\n * @typeParam T The type of the values stored in the map.\n */\nclass SearchableMap {\n /**\n * The constructor is normally called without arguments, creating an empty\n * map. In order to create a {@link SearchableMap} from an iterable or from an\n * object, check {@link SearchableMap.from} and {@link\n * SearchableMap.fromObject}.\n *\n * The constructor arguments are for internal use, when creating derived\n * mutable views of a map at a prefix.\n */\n constructor(tree = new Map(), prefix = '') {\n this._size = undefined;\n this._tree = tree;\n this._prefix = prefix;\n }\n /**\n * Creates and returns a mutable view of this {@link SearchableMap},\n * containing only entries that share the given prefix.\n *\n * ### Usage:\n *\n * ```javascript\n * let map = new SearchableMap()\n * map.set(\"unicorn\", 1)\n * map.set(\"universe\", 2)\n * map.set(\"university\", 3)\n * map.set(\"unique\", 4)\n * map.set(\"hello\", 5)\n *\n * let uni = map.atPrefix(\"uni\")\n * uni.get(\"unique\") // => 4\n * uni.get(\"unicorn\") // => 1\n * uni.get(\"hello\") // => undefined\n *\n * let univer = map.atPrefix(\"univer\")\n * univer.get(\"unique\") // => undefined\n * univer.get(\"universe\") // => 2\n * univer.get(\"university\") // => 3\n * ```\n *\n * @param prefix The prefix\n * @return A {@link SearchableMap} representing a mutable view of the original\n * Map at the given prefix\n */\n atPrefix(prefix) {\n if (!prefix.startsWith(this._prefix)) {\n throw new Error('Mismatched prefix');\n }\n const [node, path] = trackDown(this._tree, prefix.slice(this._prefix.length));\n if (node === undefined) {\n const [parentNode, key] = last(path);\n for (const k of parentNode.keys()) {\n if (k !== LEAF && k.startsWith(key)) {\n const node = new Map();\n node.set(k.slice(key.length), parentNode.get(k));\n return new SearchableMap(node, prefix);\n }\n }\n }\n return new SearchableMap(node, prefix);\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/clear\n */\n clear() {\n this._size = undefined;\n this._tree.clear();\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/delete\n * @param key Key to delete\n */\n delete(key) {\n this._size = undefined;\n return remove(this._tree, key);\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries\n * @return An iterator iterating through `[key, value]` entries.\n */\n entries() {\n return new TreeIterator(this, ENTRIES);\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/forEach\n * @param fn Iteration function\n */\n forEach(fn) {\n for (const [key, value] of this) {\n fn(key, value, this);\n }\n }\n /**\n * Returns a Map of all the entries that have a key within the given edit\n * distance from the search key. The keys of the returned Map are the matching\n * keys, while the values are two-element arrays where the first element is\n * the value associated to the key, and the second is the edit distance of the\n * key to the search key.\n *\n * ### Usage:\n *\n * ```javascript\n * let map = new SearchableMap()\n * map.set('hello', 'world')\n * map.set('hell', 'yeah')\n * map.set('ciao', 'mondo')\n *\n * // Get all entries that match the key 'hallo' with a maximum edit distance of 2\n * map.fuzzyGet('hallo', 2)\n * // => Map(2) { 'hello' => ['world', 1], 'hell' => ['yeah', 2] }\n *\n * // In the example, the \"hello\" key has value \"world\" and edit distance of 1\n * // (change \"e\" to \"a\"), the key \"hell\" has value \"yeah\" and edit distance of 2\n * // (change \"e\" to \"a\", delete \"o\")\n * ```\n *\n * @param key The search key\n * @param maxEditDistance The maximum edit distance (Levenshtein)\n * @return A Map of the matching keys to their value and edit distance\n */\n fuzzyGet(key, maxEditDistance) {\n return fuzzySearch(this._tree, key, maxEditDistance);\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get\n * @param key Key to get\n * @return Value associated to the key, or `undefined` if the key is not\n * found.\n */\n get(key) {\n const node = lookup(this._tree, key);\n return node !== undefined ? node.get(LEAF) : undefined;\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/has\n * @param key Key\n * @return True if the key is in the map, false otherwise\n */\n has(key) {\n const node = lookup(this._tree, key);\n return node !== undefined && node.has(LEAF);\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/keys\n * @return An `Iterable` iterating through keys\n */\n keys() {\n return new TreeIterator(this, KEYS);\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/set\n * @param key Key to set\n * @param value Value to associate to the key\n * @return The {@link SearchableMap} itself, to allow chaining\n */\n set(key, value) {\n if (typeof key !== 'string') {\n throw new Error('key must be a string');\n }\n this._size = undefined;\n const node = createPath(this._tree, key);\n node.set(LEAF, value);\n return this;\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/size\n */\n get size() {\n if (this._size) {\n return this._size;\n }\n /** @ignore */\n this._size = 0;\n const iter = this.entries();\n while (!iter.next().done)\n this._size += 1;\n return this._size;\n }\n /**\n * Updates the value at the given key using the provided function. The function\n * is called with the current value at the key, and its return value is used as\n * the new value to be set.\n *\n * ### Example:\n *\n * ```javascript\n * // Increment the current value by one\n * searchableMap.update('somekey', (currentValue) => currentValue == null ? 0 : currentValue + 1)\n * ```\n *\n * If the value at the given key is or will be an object, it might not require\n * re-assignment. In that case it is better to use `fetch()`, because it is\n * faster.\n *\n * @param key The key to update\n * @param fn The function used to compute the new value from the current one\n * @return The {@link SearchableMap} itself, to allow chaining\n */\n update(key, fn) {\n if (typeof key !== 'string') {\n throw new Error('key must be a string');\n }\n this._size = undefined;\n const node = createPath(this._tree, key);\n node.set(LEAF, fn(node.get(LEAF)));\n return this;\n }\n /**\n * Fetches the value of the given key. If the value does not exist, calls the\n * given function to create a new value, which is inserted at the given key\n * and subsequently returned.\n *\n * ### Example:\n *\n * ```javascript\n * const map = searchableMap.fetch('somekey', () => new Map())\n * map.set('foo', 'bar')\n * ```\n *\n * @param key The key to update\n * @param initial A function that creates a new value if the key does not exist\n * @return The existing or new value at the given key\n */\n fetch(key, initial) {\n if (typeof key !== 'string') {\n throw new Error('key must be a string');\n }\n this._size = undefined;\n const node = createPath(this._tree, key);\n let value = node.get(LEAF);\n if (value === undefined) {\n node.set(LEAF, value = initial());\n }\n return value;\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values\n * @return An `Iterable` iterating through values.\n */\n values() {\n return new TreeIterator(this, VALUES);\n }\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/@@iterator\n */\n [Symbol.iterator]() {\n return this.entries();\n }\n /**\n * Creates a {@link SearchableMap} from an `Iterable` of entries\n *\n * @param entries Entries to be inserted in the {@link SearchableMap}\n * @return A new {@link SearchableMap} with the given entries\n */\n static from(entries) {\n const tree = new SearchableMap();\n for (const [key, value] of entries) {\n tree.set(key, value);\n }\n return tree;\n }\n /**\n * Creates a {@link SearchableMap} from the iterable properties of a JavaScript object\n *\n * @param object Object of entries for the {@link SearchableMap}\n * @return A new {@link SearchableMap} with the given entries\n */\n static fromObject(object) {\n return SearchableMap.from(Object.entries(object));\n }\n}\nconst trackDown = (tree, key, path = []) => {\n if (key.length === 0 || tree == null) {\n return [tree, path];\n }\n for (const k of tree.keys()) {\n if (k !== LEAF && key.startsWith(k)) {\n path.push([tree, k]); // performance: update in place\n return trackDown(tree.get(k), key.slice(k.length), path);\n }\n }\n path.push([tree, key]); // performance: update in place\n return trackDown(undefined, '', path);\n};\nconst lookup = (tree, key) => {\n if (key.length === 0 || tree == null) {\n return tree;\n }\n for (const k of tree.keys()) {\n if (k !== LEAF && key.startsWith(k)) {\n return lookup(tree.get(k), key.slice(k.length));\n }\n }\n};\n// Create a path in the radix tree for the given key, and returns the deepest\n// node. This function is in the hot path for indexing. It avoids unnecessary\n// string operations and recursion for performance.\nconst createPath = (node, key) => {\n const keyLength = key.length;\n outer: for (let pos = 0; node && pos < keyLength;) {\n for (const k of node.keys()) {\n // Check whether this key is a candidate: the first characters must match.\n if (k !== LEAF && key[pos] === k[0]) {\n const len = Math.min(keyLength - pos, k.length);\n // Advance offset to the point where key and k no longer match.\n let offset = 1;\n while (offset < len && key[pos + offset] === k[offset])\n ++offset;\n const child = node.get(k);\n if (offset === k.length) {\n // The existing key is shorter than the key we need to create.\n node = child;\n }\n else {\n // Partial match: we need to insert an intermediate node to contain\n // both the existing subtree and the new node.\n const intermediate = new Map();\n intermediate.set(k.slice(offset), child);\n node.set(key.slice(pos, pos + offset), intermediate);\n node.delete(k);\n node = intermediate;\n }\n pos += offset;\n continue outer;\n }\n }\n // Create a final child node to contain the final suffix of the key.\n const child = new Map();\n node.set(key.slice(pos), child);\n return child;\n }\n return node;\n};\nconst remove = (tree, key) => {\n const [node, path] = trackDown(tree, key);\n if (node === undefined) {\n return;\n }\n node.delete(LEAF);\n if (node.size === 0) {\n cleanup(path);\n }\n else if (node.size === 1) {\n const [key, value] = node.entries().next().value;\n merge(path, key, value);\n }\n};\nconst cleanup = (path) => {\n if (path.length === 0) {\n return;\n }\n const [node, key] = last(path);\n node.delete(key);\n if (node.size === 0) {\n cleanup(path.slice(0, -1));\n }\n else if (node.size === 1) {\n const [key, value] = node.entries().next().value;\n if (key !== LEAF) {\n merge(path.slice(0, -1), key, value);\n }\n }\n};\nconst merge = (path, key, value) => {\n if (path.length === 0) {\n return;\n }\n const [node, nodeKey] = last(path);\n node.set(nodeKey + key, value);\n node.delete(nodeKey);\n};\nconst last = (array) => {\n return array[array.length - 1];\n};\n\nconst OR = 'or';\nconst AND = 'and';\nconst AND_NOT = 'and_not';\n/**\n * {@link MiniSearch} is the main entrypoint class, implementing a full-text\n * search engine in memory.\n *\n * @typeParam T The type of the documents being indexed.\n *\n * ### Basic example:\n *\n * ```javascript\n * const documents = [\n * {\n * id: 1,\n * title: 'Moby Dick',\n * text: 'Call me Ishmael. Some years ago...',\n * category: 'fiction'\n * },\n * {\n * id: 2,\n * title: 'Zen and the Art of Motorcycle Maintenance',\n * text: 'I can see by my watch...',\n * category: 'fiction'\n * },\n * {\n * id: 3,\n * title: 'Neuromancer',\n * text: 'The sky above the port was...',\n * category: 'fiction'\n * },\n * {\n * id: 4,\n * title: 'Zen and the Art of Archery',\n * text: 'At first sight it must seem...',\n * category: 'non-fiction'\n * },\n * // ...and more\n * ]\n *\n * // Create a search engine that indexes the 'title' and 'text' fields for\n * // full-text search. Search results will include 'title' and 'category' (plus the\n * // id field, that is always stored and returned)\n * const miniSearch = new MiniSearch({\n * fields: ['title', 'text'],\n * storeFields: ['title', 'category']\n * })\n *\n * // Add documents to the index\n * miniSearch.addAll(documents)\n *\n * // Search for documents:\n * let results = miniSearch.search('zen art motorcycle')\n * // => [\n * // { id: 2, title: 'Zen and the Art of Motorcycle Maintenance', category: 'fiction', score: 2.77258 },\n * // { id: 4, title: 'Zen and the Art of Archery', category: 'non-fiction', score: 1.38629 }\n * // ]\n * ```\n */\nclass MiniSearch {\n /**\n * @param options Configuration options\n *\n * ### Examples:\n *\n * ```javascript\n * // Create a search engine that indexes the 'title' and 'text' fields of your\n * // documents:\n * const miniSearch = new MiniSearch({ fields: ['title', 'text'] })\n * ```\n *\n * ### ID Field:\n *\n * ```javascript\n * // Your documents are assumed to include a unique 'id' field, but if you want\n * // to use a different field for document identification, you can set the\n * // 'idField' option:\n * const miniSearch = new MiniSearch({ idField: 'key', fields: ['title', 'text'] })\n * ```\n *\n * ### Options and defaults:\n *\n * ```javascript\n * // The full set of options (here with their default value) is:\n * const miniSearch = new MiniSearch({\n * // idField: field that uniquely identifies a document\n * idField: 'id',\n *\n * // extractField: function used to get the value of a field in a document.\n * // By default, it assumes the document is a flat object with field names as\n * // property keys and field values as string property values, but custom logic\n * // can be implemented by setting this option to a custom extractor function.\n * extractField: (document, fieldName) => document[fieldName],\n *\n * // tokenize: function used to split fields into individual terms. By\n * // default, it is also used to tokenize search queries, unless a specific\n * // `tokenize` search option is supplied. When tokenizing an indexed field,\n * // the field name is passed as the second argument.\n * tokenize: (string, _fieldName) => string.split(SPACE_OR_PUNCTUATION),\n *\n * // processTerm: function used to process each tokenized term before\n * // indexing. It can be used for stemming and normalization. Return a falsy\n * // value in order to discard a term. By default, it is also used to process\n * // search queries, unless a specific `processTerm` option is supplied as a\n * // search option. When processing a term from a indexed field, the field\n * // name is passed as the second argument.\n * processTerm: (term, _fieldName) => term.toLowerCase(),\n *\n * // searchOptions: default search options, see the `search` method for\n * // details\n * searchOptions: undefined,\n *\n * // fields: document fields to be indexed. Mandatory, but not set by default\n * fields: undefined\n *\n * // storeFields: document fields to be stored and returned as part of the\n * // search results.\n * storeFields: []\n * })\n * ```\n */\n constructor(options) {\n if ((options === null || options === void 0 ? void 0 : options.fields) == null) {\n throw new Error('MiniSearch: option \"fields\" must be provided');\n }\n const autoVacuum = (options.autoVacuum == null || options.autoVacuum === true) ? defaultAutoVacuumOptions : options.autoVacuum;\n this._options = {\n ...defaultOptions,\n ...options,\n autoVacuum,\n searchOptions: { ...defaultSearchOptions, ...(options.searchOptions || {}) },\n autoSuggestOptions: { ...defaultAutoSuggestOptions, ...(options.autoSuggestOptions || {}) }\n };\n this._index = new SearchableMap();\n this._documentCount = 0;\n this._documentIds = new Map();\n this._idToShortId = new Map();\n // Fields are defined during initialization, don't change, are few in\n // number, rarely need iterating over, and have string keys. Therefore in\n // this case an object is a better candidate than a Map to store the mapping\n // from field key to ID.\n this._fieldIds = {};\n this._fieldLength = new Map();\n this._avgFieldLength = [];\n this._nextId = 0;\n this._storedFields = new Map();\n this._dirtCount = 0;\n this._currentVacuum = null;\n this._enqueuedVacuum = null;\n this._enqueuedVacuumConditions = defaultVacuumConditions;\n this.addFields(this._options.fields);\n }\n /**\n * Adds a document to the index\n *\n * @param document The document to be indexed\n */\n add(document) {\n const { extractField, tokenize, processTerm, fields, idField } = this._options;\n const id = extractField(document, idField);\n if (id == null) {\n throw new Error(`MiniSearch: document does not have ID field \"${idField}\"`);\n }\n if (this._idToShortId.has(id)) {\n throw new Error(`MiniSearch: duplicate ID ${id}`);\n }\n const shortDocumentId = this.addDocumentId(id);\n this.saveStoredFields(shortDocumentId, document);\n for (const field of fields) {\n const fieldValue = extractField(document, field);\n if (fieldValue == null)\n continue;\n const tokens = tokenize(fieldValue.toString(), field);\n const fieldId = this._fieldIds[field];\n const uniqueTerms = new Set(tokens).size;\n this.addFieldLength(shortDocumentId, fieldId, this._documentCount - 1, uniqueTerms);\n for (const term of tokens) {\n const processedTerm = processTerm(term, field);\n if (Array.isArray(processedTerm)) {\n for (const t of processedTerm) {\n this.addTerm(fieldId, shortDocumentId, t);\n }\n }\n else if (processedTerm) {\n this.addTerm(fieldId, shortDocumentId, processedTerm);\n }\n }\n }\n }\n /**\n * Adds all the given documents to the index\n *\n * @param documents An array of documents to be indexed\n */\n addAll(documents) {\n for (const document of documents)\n this.add(document);\n }\n /**\n * Adds all the given documents to the index asynchronously.\n *\n * Returns a promise that resolves (to `undefined`) when the indexing is done.\n * This method is useful when index many documents, to avoid blocking the main\n * thread. The indexing is performed asynchronously and in chunks.\n *\n * @param documents An array of documents to be indexed\n * @param options Configuration options\n * @return A promise resolving to `undefined` when the indexing is done\n */\n addAllAsync(documents, options = {}) {\n const { chunkSize = 10 } = options;\n const acc = { chunk: [], promise: Promise.resolve() };\n const { chunk, promise } = documents.reduce(({ chunk, promise }, document, i) => {\n chunk.push(document);\n if ((i + 1) % chunkSize === 0) {\n return {\n chunk: [],\n promise: promise\n .then(() => new Promise(resolve => setTimeout(resolve, 0)))\n .then(() => this.addAll(chunk))\n };\n }\n else {\n return { chunk, promise };\n }\n }, acc);\n return promise.then(() => this.addAll(chunk));\n }\n /**\n * Removes the given document from the index.\n *\n * The document to remove must NOT have changed between indexing and removal,\n * otherwise the index will be corrupted.\n *\n * This method requires passing the full document to be removed (not just the\n * ID), and immediately removes the document from the inverted index, allowing\n * memory to be released. A convenient alternative is {@link\n * MiniSearch#discard}, which needs only the document ID, and has the same\n * visible effect, but delays cleaning up the index until the next vacuuming.\n *\n * @param document The document to be removed\n */\n remove(document) {\n const { tokenize, processTerm, extractField, fields, idField } = this._options;\n const id = extractField(document, idField);\n if (id == null) {\n throw new Error(`MiniSearch: document does not have ID field \"${idField}\"`);\n }\n const shortId = this._idToShortId.get(id);\n if (shortId == null) {\n throw new Error(`MiniSearch: cannot remove document with ID ${id}: it is not in the index`);\n }\n for (const field of fields) {\n const fieldValue = extractField(document, field);\n if (fieldValue == null)\n continue;\n const tokens = tokenize(fieldValue.toString(), field);\n const fieldId = this._fieldIds[field];\n const uniqueTerms = new Set(tokens).size;\n this.removeFieldLength(shortId, fieldId, this._documentCount, uniqueTerms);\n for (const term of tokens) {\n const processedTerm = processTerm(term, field);\n if (Array.isArray(processedTerm)) {\n for (const t of processedTerm) {\n this.removeTerm(fieldId, shortId, t);\n }\n }\n else if (processedTerm) {\n this.removeTerm(fieldId, shortId, processedTerm);\n }\n }\n }\n this._storedFields.delete(shortId);\n this._documentIds.delete(shortId);\n this._idToShortId.delete(id);\n this._fieldLength.delete(shortId);\n this._documentCount -= 1;\n }\n /**\n * Removes all the given documents from the index. If called with no arguments,\n * it removes _all_ documents from the index.\n *\n * @param documents The documents to be removed. If this argument is omitted,\n * all documents are removed. Note that, for removing all documents, it is\n * more efficient to call this method with no arguments than to pass all\n * documents.\n */\n removeAll(documents) {\n if (documents) {\n for (const document of documents)\n this.remove(document);\n }\n else if (arguments.length > 0) {\n throw new Error('Expected documents to be present. Omit the argument to remove all documents.');\n }\n else {\n this._index = new SearchableMap();\n this._documentCount = 0;\n this._documentIds = new Map();\n this._idToShortId = new Map();\n this._fieldLength = new Map();\n this._avgFieldLength = [];\n this._storedFields = new Map();\n this._nextId = 0;\n }\n }\n /**\n * Discards the document with the given ID, so it won't appear in search results\n *\n * It has the same visible effect of {@link MiniSearch.remove} (both cause the\n * document to stop appearing in searches), but a different effect on the\n * internal data structures:\n *\n * - {@link MiniSearch#remove} requires passing the full document to be\n * removed as argument, and removes it from the inverted index immediately.\n *\n * - {@link MiniSearch#discard} instead only needs the document ID, and\n * works by marking the current version of the document as discarded, so it\n * is immediately ignored by searches. This is faster and more convenient\n * than {@link MiniSearch#remove}, but the index is not immediately\n * modified. To take care of that, vacuuming is performed after a certain\n * number of documents are discarded, cleaning up the index and allowing\n * memory to be released.\n *\n * After discarding a document, it is possible to re-add a new version, and\n * only the new version will appear in searches. In other words, discarding\n * and re-adding a document works exactly like removing and re-adding it. The\n * {@link MiniSearch.replace} method can also be used to replace a document\n * with a new version.\n *\n * #### Details about vacuuming\n *\n * Repetite calls to this method would leave obsolete document references in\n * the index, invisible to searches. Two mechanisms take care of cleaning up:\n * clean up during search, and vacuuming.\n *\n * - Upon search, whenever a discarded ID is found (and ignored for the\n * results), references to the discarded document are removed from the\n * inverted index entries for the search terms. This ensures that subsequent\n * searches for the same terms do not need to skip these obsolete references\n * again.\n *\n * - In addition, vacuuming is performed automatically by default (see the\n * `autoVacuum` field in {@link Options}) after a certain number of\n * documents are discarded. Vacuuming traverses all terms in the index,\n * cleaning up all references to discarded documents. Vacuuming can also be\n * triggered manually by calling {@link MiniSearch#vacuum}.\n *\n * @param id The ID of the document to be discarded\n */\n discard(id) {\n const shortId = this._idToShortId.get(id);\n if (shortId == null) {\n throw new Error(`MiniSearch: cannot discard document with ID ${id}: it is not in the index`);\n }\n this._idToShortId.delete(id);\n this._documentIds.delete(shortId);\n this._storedFields.delete(shortId);\n (this._fieldLength.get(shortId) || []).forEach((fieldLength, fieldId) => {\n this.removeFieldLength(shortId, fieldId, this._documentCount, fieldLength);\n });\n this._fieldLength.delete(shortId);\n this._documentCount -= 1;\n this._dirtCount += 1;\n this.maybeAutoVacuum();\n }\n maybeAutoVacuum() {\n if (this._options.autoVacuum === false) {\n return;\n }\n const { minDirtFactor, minDirtCount, batchSize, batchWait } = this._options.autoVacuum;\n this.conditionalVacuum({ batchSize, batchWait }, { minDirtCount, minDirtFactor });\n }\n /**\n * Discards the documents with the given IDs, so they won't appear in search\n * results\n *\n * It is equivalent to calling {@link MiniSearch#discard} for all the given\n * IDs, but with the optimization of triggering at most one automatic\n * vacuuming at the end.\n *\n * Note: to remove all documents from the index, it is faster and more\n * convenient to call {@link MiniSearch.removeAll} with no argument, instead\n * of passing all IDs to this method.\n */\n discardAll(ids) {\n const autoVacuum = this._options.autoVacuum;\n try {\n this._options.autoVacuum = false;\n for (const id of ids) {\n this.discard(id);\n }\n }\n finally {\n this._options.autoVacuum = autoVacuum;\n }\n this.maybeAutoVacuum();\n }\n /**\n * It replaces an existing document with the given updated version\n *\n * It works by discarding the current version and adding the updated one, so\n * it is functionally equivalent to calling {@link MiniSearch#discard}\n * followed by {@link MiniSearch#add}. The ID of the updated document should\n * be the same as the original one.\n *\n * Since it uses {@link MiniSearch#discard} internally, this method relies on\n * vacuuming to clean up obsolete document references from the index, allowing\n * memory to be released (see {@link MiniSearch#discard}).\n *\n * @param updatedDocument The updated document to replace the old version\n * with\n */\n replace(updatedDocument) {\n const { idField, extractField } = this._options;\n const id = extractField(updatedDocument, idField);\n this.discard(id);\n this.add(updatedDocument);\n }\n /**\n * Triggers a manual vacuuming, cleaning up references to discarded documents\n * from the inverted index\n *\n * Vacuuming is only useful for applications that use the {@link\n * MiniSearch#discard} or {@link MiniSearch#replace} methods.\n *\n * By default, vacuuming is performed automatically when needed (controlled by\n * the `autoVacuum` field in {@link Options}), so there is usually no need to\n * call this method, unless one wants to make sure to perform vacuuming at a\n * specific moment.\n *\n * Vacuuming traverses all terms in the inverted index in batches, and cleans\n * up references to discarded documents from the posting list, allowing memory\n * to be released.\n *\n * The method takes an optional object as argument with the following keys:\n *\n * - `batchSize`: the size of each batch (1000 by default)\n *\n * - `batchWait`: the number of milliseconds to wait between batches (10 by\n * default)\n *\n * On large indexes, vacuuming could have a non-negligible cost: batching\n * avoids blocking the thread for long, diluting this cost so that it is not\n * negatively affecting the application. Nonetheless, this method should only\n * be called when necessary, and relying on automatic vacuuming is usually\n * better.\n *\n * It returns a promise that resolves (to undefined) when the clean up is\n * completed. If vacuuming is already ongoing at the time this method is\n * called, a new one is enqueued immediately after the ongoing one, and a\n * corresponding promise is returned. However, no more than one vacuuming is\n * enqueued on top of the ongoing one, even if this method is called more\n * times (enqueuing multiple ones would be useless).\n *\n * @param options Configuration options for the batch size and delay. See\n * {@link VacuumOptions}.\n */\n vacuum(options = {}) {\n return this.conditionalVacuum(options);\n }\n conditionalVacuum(options, conditions) {\n // If a vacuum is already ongoing, schedule another as soon as it finishes,\n // unless there's already one enqueued. If one was already enqueued, do not\n // enqueue another on top, but make sure that the conditions are the\n // broadest.\n if (this._currentVacuum) {\n this._enqueuedVacuumConditions = this._enqueuedVacuumConditions && conditions;\n if (this._enqueuedVacuum != null) {\n return this._enqueuedVacuum;\n }\n this._enqueuedVacuum = this._currentVacuum.then(() => {\n const conditions = this._enqueuedVacuumConditions;\n this._enqueuedVacuumConditions = defaultVacuumConditions;\n return this.performVacuuming(options, conditions);\n });\n return this._enqueuedVacuum;\n }\n if (this.vacuumConditionsMet(conditions) === false) {\n return Promise.resolve();\n }\n this._currentVacuum = this.performVacuuming(options);\n return this._currentVacuum;\n }\n async performVacuuming(options, conditions) {\n const initialDirtCount = this._dirtCount;\n if (this.vacuumConditionsMet(conditions)) {\n const batchSize = options.batchSize || defaultVacuumOptions.batchSize;\n const batchWait = options.batchWait || defaultVacuumOptions.batchWait;\n let i = 1;\n for (const [term, fieldsData] of this._index) {\n for (const [fieldId, fieldIndex] of fieldsData) {\n for (const [shortId] of fieldIndex) {\n if (this._documentIds.has(shortId)) {\n continue;\n }\n if (fieldIndex.size <= 1) {\n fieldsData.delete(fieldId);\n }\n else {\n fieldIndex.delete(shortId);\n }\n }\n }\n if (this._index.get(term).size === 0) {\n this._index.delete(term);\n }\n if (i % batchSize === 0) {\n await new Promise((resolve) => setTimeout(resolve, batchWait));\n }\n i += 1;\n }\n this._dirtCount -= initialDirtCount;\n }\n // Make the next lines always async, so they execute after this function returns\n await null;\n this._currentVacuum = this._enqueuedVacuum;\n this._enqueuedVacuum = null;\n }\n vacuumConditionsMet(conditions) {\n if (conditions == null) {\n return true;\n }\n let { minDirtCount, minDirtFactor } = conditions;\n minDirtCount = minDirtCount || defaultAutoVacuumOptions.minDirtCount;\n minDirtFactor = minDirtFactor || defaultAutoVacuumOptions.minDirtFactor;\n return this.dirtCount >= minDirtCount && this.dirtFactor >= minDirtFactor;\n }\n /**\n * Is `true` if a vacuuming operation is ongoing, `false` otherwise\n */\n get isVacuuming() {\n return this._currentVacuum != null;\n }\n /**\n * The number of documents discarded since the most recent vacuuming\n */\n get dirtCount() {\n return this._dirtCount;\n }\n /**\n * A number between 0 and 1 giving an indication about the proportion of\n * documents that are discarded, and can therefore be cleaned up by vacuuming.\n * A value close to 0 means that the index is relatively clean, while a higher\n * value means that the index is relatively dirty, and vacuuming could release\n * memory.\n */\n get dirtFactor() {\n return this._dirtCount / (1 + this._documentCount + this._dirtCount);\n }\n /**\n * Returns `true` if a document with the given ID is present in the index and\n * available for search, `false` otherwise\n *\n * @param id The document ID\n */\n has(id) {\n return this._idToShortId.has(id);\n }\n /**\n * Returns the stored fields (as configured in the `storeFields` constructor\n * option) for the given document ID. Returns `undefined` if the document is\n * not present in the index.\n *\n * @param id The document ID\n */\n getStoredFields(id) {\n const shortId = this._idToShortId.get(id);\n if (shortId == null) {\n return undefined;\n }\n return this._storedFields.get(shortId);\n }\n /**\n * Search for documents matching the given search query.\n *\n * The result is a list of scored document IDs matching the query, sorted by\n * descending score, and each including data about which terms were matched and\n * in which fields.\n *\n * ### Basic usage:\n *\n * ```javascript\n * // Search for \"zen art motorcycle\" with default options: terms have to match\n * // exactly, and individual terms are joined with OR\n * miniSearch.search('zen art motorcycle')\n * // => [ { id: 2, score: 2.77258, match: { ... } }, { id: 4, score: 1.38629, match: { ... } } ]\n * ```\n *\n * ### Restrict search to specific fields:\n *\n * ```javascript\n * // Search only in the 'title' field\n * miniSearch.search('zen', { fields: ['title'] })\n * ```\n *\n * ### Field boosting:\n *\n * ```javascript\n * // Boost a field\n * miniSearch.search('zen', { boost: { title: 2 } })\n * ```\n *\n * ### Prefix search:\n *\n * ```javascript\n * // Search for \"moto\" with prefix search (it will match documents\n * // containing terms that start with \"moto\" or \"neuro\")\n * miniSearch.search('moto neuro', { prefix: true })\n * ```\n *\n * ### Fuzzy search:\n *\n * ```javascript\n * // Search for \"ismael\" with fuzzy search (it will match documents containing\n * // terms similar to \"ismael\", with a maximum edit distance of 0.2 term.length\n * // (rounded to nearest integer)\n * miniSearch.search('ismael', { fuzzy: 0.2 })\n * ```\n *\n * ### Combining strategies:\n *\n * ```javascript\n * // Mix of exact match, prefix search, and fuzzy search\n * miniSearch.search('ismael mob', {\n * prefix: true,\n * fuzzy: 0.2\n * })\n * ```\n *\n * ### Advanced prefix and fuzzy search:\n *\n * ```javascript\n * // Perform fuzzy and prefix search depending on the search term. Here\n * // performing prefix and fuzzy search only on terms longer than 3 characters\n * miniSearch.search('ismael mob', {\n * prefix: term => term.length > 3\n * fuzzy: term => term.length > 3 ? 0.2 : null\n * })\n * ```\n *\n * ### Combine with AND:\n *\n * ```javascript\n * // Combine search terms with AND (to match only documents that contain both\n * // \"motorcycle\" and \"art\")\n * miniSearch.search('motorcycle art', { combineWith: 'AND' })\n * ```\n *\n * ### Combine with AND_NOT:\n *\n * There is also an AND_NOT combinator, that finds documents that match the\n * first term, but do not match any of the other terms. This combinator is\n * rarely useful with simple queries, and is meant to be used with advanced\n * query combinations (see later for more details).\n *\n * ### Filtering results:\n *\n * ```javascript\n * // Filter only results in the 'fiction' category (assuming that 'category'\n * // is a stored field)\n * miniSearch.search('motorcycle art', {\n * filter: (result) => result.category === 'fiction'\n * })\n * ```\n *\n * ### Wildcard query\n *\n * Searching for an empty string (assuming the default tokenizer) returns no\n * results. Sometimes though, one needs to match all documents, like in a\n * \"wildcard\" search. This is possible by passing the special value\n * {@link MiniSearch.wildcard} as the query:\n *\n * ```javascript\n * // Return search results for all documents\n * miniSearch.search(MiniSearch.wildcard)\n * ```\n *\n * Note that search options such as `filter` and `boostDocument` are still\n * applied, influencing which results are returned, and their order:\n *\n * ```javascript\n * // Return search results for all documents in the 'fiction' category\n * miniSearch.search(MiniSearch.wildcard, {\n * filter: (result) => result.category === 'fiction'\n * })\n * ```\n *\n * ### Advanced combination of queries:\n *\n * It is possible to combine different subqueries with OR, AND, and AND_NOT,\n * and even with different search options, by passing a query expression\n * tree object as the first argument, instead of a string.\n *\n * ```javascript\n * // Search for documents that contain \"zen\" and (\"motorcycle\" or \"archery\")\n * miniSearch.search({\n * combineWith: 'AND',\n * queries: [\n * 'zen',\n * {\n * combineWith: 'OR',\n * queries: ['motorcycle', 'archery']\n * }\n * ]\n * })\n *\n * // Search for documents that contain (\"apple\" or \"pear\") but not \"juice\" and\n * // not \"tree\"\n * miniSearch.search({\n * combineWith: 'AND_NOT',\n * queries: [\n * {\n * combineWith: 'OR',\n * queries: ['apple', 'pear']\n * },\n * 'juice',\n * 'tree'\n * ]\n * })\n * ```\n *\n * Each node in the expression tree can be either a string, or an object that\n * supports all {@link SearchOptions} fields, plus a `queries` array field for\n * subqueries.\n *\n * Note that, while this can become complicated to do by hand for complex or\n * deeply nested queries, it provides a formalized expression tree API for\n * external libraries that implement a parser for custom query languages.\n *\n * @param query Search query\n * @param searchOptions Search options. Each option, if not given, defaults to the corresponding value of `searchOptions` given to the constructor, or to the library default.\n */\n search(query, searchOptions = {}) {\n const { searchOptions: globalSearchOptions } = this._options;\n const searchOptionsWithDefaults = { ...globalSearchOptions, ...searchOptions };\n const rawResults = this.executeQuery(query, searchOptions);\n const results = [];\n for (const [docId, { score, terms, match }] of rawResults) {\n // terms are the matched query terms, which will be returned to the user\n // as queryTerms. The quality is calculated based on them, as opposed to\n // the matched terms in the document (which can be different due to\n // prefix and fuzzy match)\n const quality = terms.length || 1;\n const result = {\n id: this._documentIds.get(docId),\n score: score * quality,\n terms: Object.keys(match),\n queryTerms: terms,\n match\n };\n Object.assign(result, this._storedFields.get(docId));\n if (searchOptionsWithDefaults.filter == null || searchOptionsWithDefaults.filter(result)) {\n results.push(result);\n }\n }\n // If it's a wildcard query, and no document boost is applied, skip sorting\n // the results, as all results have the same score of 1\n if (query === MiniSearch.wildcard && searchOptionsWithDefaults.boostDocument == null) {\n return results;\n }\n results.sort(byScore);\n return results;\n }\n /**\n * Provide suggestions for the given search query\n *\n * The result is a list of suggested modified search queries, derived from the\n * given search query, each with a relevance score, sorted by descending score.\n *\n * By default, it uses the same options used for search, except that by\n * default it performs prefix search on the last term of the query, and\n * combine terms with `'AND'` (requiring all query terms to match). Custom\n * options can be passed as a second argument. Defaults can be changed upon\n * calling the {@link MiniSearch} constructor, by passing a\n * `autoSuggestOptions` option.\n *\n * ### Basic usage:\n *\n * ```javascript\n * // Get suggestions for 'neuro':\n * miniSearch.autoSuggest('neuro')\n * // => [ { suggestion: 'neuromancer', terms: [ 'neuromancer' ], score: 0.46240 } ]\n * ```\n *\n * ### Multiple words:\n *\n * ```javascript\n * // Get suggestions for 'zen ar':\n * miniSearch.autoSuggest('zen ar')\n * // => [\n * // { suggestion: 'zen archery art', terms: [ 'zen', 'archery', 'art' ], score: 1.73332 },\n * // { suggestion: 'zen art', terms: [ 'zen', 'art' ], score: 1.21313 }\n * // ]\n * ```\n *\n * ### Fuzzy suggestions:\n *\n * ```javascript\n * // Correct spelling mistakes using fuzzy search:\n * miniSearch.autoSuggest('neromancer', { fuzzy: 0.2 })\n * // => [ { suggestion: 'neuromancer', terms: [ 'neuromancer' ], score: 1.03998 } ]\n * ```\n *\n * ### Filtering:\n *\n * ```javascript\n * // Get suggestions for 'zen ar', but only within the 'fiction' category\n * // (assuming that 'category' is a stored field):\n * miniSearch.autoSuggest('zen ar', {\n * filter: (result) => result.category === 'fiction'\n * })\n * // => [\n * // { suggestion: 'zen archery art', terms: [ 'zen', 'archery', 'art' ], score: 1.73332 },\n * // { suggestion: 'zen art', terms: [ 'zen', 'art' ], score: 1.21313 }\n * // ]\n * ```\n *\n * @param queryString Query string to be expanded into suggestions\n * @param options Search options. The supported options and default values\n * are the same as for the {@link MiniSearch#search} method, except that by\n * default prefix search is performed on the last term in the query, and terms\n * are combined with `'AND'`.\n * @return A sorted array of suggestions sorted by relevance score.\n */\n autoSuggest(queryString, options = {}) {\n options = { ...this._options.autoSuggestOptions, ...options };\n const suggestions = new Map();\n for (const { score, terms } of this.search(queryString, options)) {\n const phrase = terms.join(' ');\n const suggestion = suggestions.get(phrase);\n if (suggestion != null) {\n suggestion.score += score;\n suggestion.count += 1;\n }\n else {\n suggestions.set(phrase, { score, terms, count: 1 });\n }\n }\n const results = [];\n for (const [suggestion, { score, terms, count }] of suggestions) {\n results.push({ suggestion, terms, score: score / count });\n }\n results.sort(byScore);\n return results;\n }\n /**\n * Total number of documents available to search\n */\n get documentCount() {\n return this._documentCount;\n }\n /**\n * Number of terms in the index\n */\n get termCount() {\n return this._index.size;\n }\n /**\n * Deserializes a JSON index (serialized with `JSON.stringify(miniSearch)`)\n * and instantiates a MiniSearch instance. It should be given the same options\n * originally used when serializing the index.\n *\n * ### Usage:\n *\n * ```javascript\n * // If the index was serialized with:\n * let miniSearch = new MiniSearch({ fields: ['title', 'text'] })\n * miniSearch.addAll(documents)\n *\n * const json = JSON.stringify(miniSearch)\n * // It can later be deserialized like this:\n * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })\n * ```\n *\n * @param json JSON-serialized index\n * @param options configuration options, same as the constructor\n * @return An instance of MiniSearch deserialized from the given JSON.\n */\n static loadJSON(json, options) {\n if (options == null) {\n throw new Error('MiniSearch: loadJSON should be given the same options used when serializing the index');\n }\n return this.loadJS(JSON.parse(json), options);\n }\n /**\n * Async equivalent of {@link MiniSearch.loadJSON}\n *\n * This function is an alternative to {@link MiniSearch.loadJSON} that returns\n * a promise, and loads the index in batches, leaving pauses between them to avoid\n * blocking the main thread. It tends to be slower than the synchronous\n * version, but does not block the main thread, so it can be a better choice\n * when deserializing very large indexes.\n *\n * @param json JSON-serialized index\n * @param options configuration options, same as the constructor\n * @return A Promise that will resolve to an instance of MiniSearch deserialized from the given JSON.\n */\n static async loadJSONAsync(json, options) {\n if (options == null) {\n throw new Error('MiniSearch: loadJSON should be given the same options used when serializing the index');\n }\n return this.loadJSAsync(JSON.parse(json), options);\n }\n /**\n * Returns the default value of an option. It will throw an error if no option\n * with the given name exists.\n *\n * @param optionName Name of the option\n * @return The default value of the given option\n *\n * ### Usage:\n *\n * ```javascript\n * // Get default tokenizer\n * MiniSearch.getDefault('tokenize')\n *\n * // Get default term processor\n * MiniSearch.getDefault('processTerm')\n *\n * // Unknown options will throw an error\n * MiniSearch.getDefault('notExisting')\n * // => throws 'MiniSearch: unknown option \"notExisting\"'\n * ```\n */\n static getDefault(optionName) {\n if (defaultOptions.hasOwnProperty(optionName)) {\n return getOwnProperty(defaultOptions, optionName);\n }\n else {\n throw new Error(`MiniSearch: unknown option \"${optionName}\"`);\n }\n }\n /**\n * @ignore\n */\n static loadJS(js, options) {\n const { index, documentIds, fieldLength, storedFields, serializationVersion } = js;\n const miniSearch = this.instantiateMiniSearch(js, options);\n miniSearch._documentIds = objectToNumericMap(documentIds);\n miniSearch._fieldLength = objectToNumericMap(fieldLength);\n miniSearch._storedFields = objectToNumericMap(storedFields);\n for (const [shortId, id] of miniSearch._documentIds) {\n miniSearch._idToShortId.set(id, shortId);\n }\n for (const [term, data] of index) {\n const dataMap = new Map();\n for (const fieldId of Object.keys(data)) {\n let indexEntry = data[fieldId];\n // Version 1 used to nest the index entry inside a field called ds\n if (serializationVersion === 1) {\n indexEntry = indexEntry.ds;\n }\n dataMap.set(parseInt(fieldId, 10), objectToNumericMap(indexEntry));\n }\n miniSearch._index.set(term, dataMap);\n }\n return miniSearch;\n }\n /**\n * @ignore\n */\n static async loadJSAsync(js, options) {\n const { index, documentIds, fieldLength, storedFields, serializationVersion } = js;\n const miniSearch = this.instantiateMiniSearch(js, options);\n miniSearch._documentIds = await objectToNumericMapAsync(documentIds);\n miniSearch._fieldLength = await objectToNumericMapAsync(fieldLength);\n miniSearch._storedFields = await objectToNumericMapAsync(storedFields);\n for (const [shortId, id] of miniSearch._documentIds) {\n miniSearch._idToShortId.set(id, shortId);\n }\n let count = 0;\n for (const [term, data] of index) {\n const dataMap = new Map();\n for (const fieldId of Object.keys(data)) {\n let indexEntry = data[fieldId];\n // Version 1 used to nest the index entry inside a field called ds\n if (serializationVersion === 1) {\n indexEntry = indexEntry.ds;\n }\n dataMap.set(parseInt(fieldId, 10), await objectToNumericMapAsync(indexEntry));\n }\n if (++count % 1000 === 0)\n await wait(0);\n miniSearch._index.set(term, dataMap);\n }\n return miniSearch;\n }\n /**\n * @ignore\n */\n static instantiateMiniSearch(js, options) {\n const { documentCount, nextId, fieldIds, averageFieldLength, dirtCount, serializationVersion } = js;\n if (serializationVersion !== 1 && serializationVersion !== 2) {\n throw new Error('MiniSearch: cannot deserialize an index created with an incompatible version');\n }\n const miniSearch = new MiniSearch(options);\n miniSearch._documentCount = documentCount;\n miniSearch._nextId = nextId;\n miniSearch._idToShortId = new Map();\n miniSearch._fieldIds = fieldIds;\n miniSearch._avgFieldLength = averageFieldLength;\n miniSearch._dirtCount = dirtCount || 0;\n miniSearch._index = new SearchableMap();\n return miniSearch;\n }\n /**\n * @ignore\n */\n executeQuery(query, searchOptions = {}) {\n if (query === MiniSearch.wildcard) {\n return this.executeWildcardQuery(searchOptions);\n }\n if (typeof query !== 'string') {\n const options = { ...searchOptions, ...query, queries: undefined };\n const results = query.queries.map((subquery) => this.executeQuery(subquery, options));\n return this.combineResults(results, options.combineWith);\n }\n const { tokenize, processTerm, searchOptions: globalSearchOptions } = this._options;\n const options = { tokenize, processTerm, ...globalSearchOptions, ...searchOptions };\n const { tokenize: searchTokenize, processTerm: searchProcessTerm } = options;\n const terms = searchTokenize(query)\n .flatMap((term) => searchProcessTerm(term))\n .filter((term) => !!term);\n const queries = terms.map(termToQuerySpec(options));\n const results = queries.map(query => this.executeQuerySpec(query, options));\n return this.combineResults(results, options.combineWith);\n }\n /**\n * @ignore\n */\n executeQuerySpec(query, searchOptions) {\n const options = { ...this._options.searchOptions, ...searchOptions };\n const boosts = (options.fields || this._options.fields).reduce((boosts, field) => ({ ...boosts, [field]: getOwnProperty(options.boost, field) || 1 }), {});\n const { boostDocument, weights, maxFuzzy, bm25: bm25params } = options;\n const { fuzzy: fuzzyWeight, prefix: prefixWeight } = { ...defaultSearchOptions.weights, ...weights };\n const data = this._index.get(query.term);\n const results = this.termResults(query.term, query.term, 1, query.termBoost, data, boosts, boostDocument, bm25params);\n let prefixMatches;\n let fuzzyMatches;\n if (query.prefix) {\n prefixMatches = this._index.atPrefix(query.term);\n }\n if (query.fuzzy) {\n const fuzzy = (query.fuzzy === true) ? 0.2 : query.fuzzy;\n const maxDistance = fuzzy < 1 ? Math.min(maxFuzzy, Math.round(query.term.length * fuzzy)) : fuzzy;\n if (maxDistance)\n fuzzyMatches = this._index.fuzzyGet(query.term, maxDistance);\n }\n if (prefixMatches) {\n for (const [term, data] of prefixMatches) {\n const distance = term.length - query.term.length;\n if (!distance) {\n continue;\n } // Skip exact match.\n // Delete the term from fuzzy results (if present) if it is also a\n // prefix result. This entry will always be scored as a prefix result.\n fuzzyMatches === null || fuzzyMatches === void 0 ? void 0 : fuzzyMatches.delete(term);\n // Weight gradually approaches 0 as distance goes to infinity, with the\n // weight for the hypothetical distance 0 being equal to prefixWeight.\n // The rate of change is much lower than that of fuzzy matches to\n // account for the fact that prefix matches stay more relevant than\n // fuzzy matches for longer distances.\n const weight = prefixWeight * term.length / (term.length + 0.3 * distance);\n this.termResults(query.term, term, weight, query.termBoost, data, boosts, boostDocument, bm25params, results);\n }\n }\n if (fuzzyMatches) {\n for (const term of fuzzyMatches.keys()) {\n const [data, distance] = fuzzyMatches.get(term);\n if (!distance) {\n continue;\n } // Skip exact match.\n // Weight gradually approaches 0 as distance goes to infinity, with the\n // weight for the hypothetical distance 0 being equal to fuzzyWeight.\n const weight = fuzzyWeight * term.length / (term.length + distance);\n this.termResults(query.term, term, weight, query.termBoost, data, boosts, boostDocument, bm25params, results);\n }\n }\n return results;\n }\n /**\n * @ignore\n */\n executeWildcardQuery(searchOptions) {\n const results = new Map();\n const options = { ...this._options.searchOptions, ...searchOptions };\n for (const [shortId, id] of this._documentIds) {\n const score = options.boostDocument ? options.boostDocument(id, '', this._storedFields.get(shortId)) : 1;\n results.set(shortId, {\n score,\n terms: [],\n match: {}\n });\n }\n return results;\n }\n /**\n * @ignore\n */\n combineResults(results, combineWith = OR) {\n if (results.length === 0) {\n return new Map();\n }\n const operator = combineWith.toLowerCase();\n const combinator = combinators[operator];\n if (!combinator) {\n throw new Error(`Invalid combination operator: ${combineWith}`);\n }\n return results.reduce(combinator) || new Map();\n }\n /**\n * Allows serialization of the index to JSON, to possibly store it and later\n * deserialize it with {@link MiniSearch.loadJSON}.\n *\n * Normally one does not directly call this method, but rather call the\n * standard JavaScript `JSON.stringify()` passing the {@link MiniSearch}\n * instance, and JavaScript will internally call this method. Upon\n * deserialization, one must pass to {@link MiniSearch.loadJSON} the same\n * options used to create the original instance that was serialized.\n *\n * ### Usage:\n *\n * ```javascript\n * // Serialize the index:\n * let miniSearch = new MiniSearch({ fields: ['title', 'text'] })\n * miniSearch.addAll(documents)\n * const json = JSON.stringify(miniSearch)\n *\n * // Later, to deserialize it:\n * miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })\n * ```\n *\n * @return A plain-object serializable representation of the search index.\n */\n toJSON() {\n const index = [];\n for (const [term, fieldIndex] of this._index) {\n const data = {};\n for (const [fieldId, freqs] of fieldIndex) {\n data[fieldId] = Object.fromEntries(freqs);\n }\n index.push([term, data]);\n }\n return {\n documentCount: this._documentCount,\n nextId: this._nextId,\n documentIds: Object.fromEntries(this._documentIds),\n fieldIds: this._fieldIds,\n fieldLength: Object.fromEntries(this._fieldLength),\n averageFieldLength: this._avgFieldLength,\n storedFields: Object.fromEntries(this._storedFields),\n dirtCount: this._dirtCount,\n index,\n serializationVersion: 2\n };\n }\n /**\n * @ignore\n */\n termResults(sourceTerm, derivedTerm, termWeight, termBoost, fieldTermData, fieldBoosts, boostDocumentFn, bm25params, results = new Map()) {\n if (fieldTermData == null)\n return results;\n for (const field of Object.keys(fieldBoosts)) {\n const fieldBoost = fieldBoosts[field];\n const fieldId = this._fieldIds[field];\n const fieldTermFreqs = fieldTermData.get(fieldId);\n if (fieldTermFreqs == null)\n continue;\n let matchingFields = fieldTermFreqs.size;\n const avgFieldLength = this._avgFieldLength[fieldId];\n for (const docId of fieldTermFreqs.keys()) {\n if (!this._documentIds.has(docId)) {\n this.removeTerm(fieldId, docId, derivedTerm);\n matchingFields -= 1;\n continue;\n }\n const docBoost = boostDocumentFn ? boostDocumentFn(this._documentIds.get(docId), derivedTerm, this._storedFields.get(docId)) : 1;\n if (!docBoost)\n continue;\n const termFreq = fieldTermFreqs.get(docId);\n const fieldLength = this._fieldLength.get(docId)[fieldId];\n // NOTE: The total number of fields is set to the number of documents\n // `this._documentCount`. It could also make sense to use the number of\n // documents where the current field is non-blank as a normalization\n // factor. This will make a difference in scoring if the field is rarely\n // present. This is currently not supported, and may require further\n // analysis to see if it is a valid use case.\n const rawScore = calcBM25Score(termFreq, matchingFields, this._documentCount, fieldLength, avgFieldLength, bm25params);\n const weightedScore = termWeight * termBoost * fieldBoost * docBoost * rawScore;\n const result = results.get(docId);\n if (result) {\n result.score += weightedScore;\n assignUniqueTerm(result.terms, sourceTerm);\n const match = getOwnProperty(result.match, derivedTerm);\n if (match) {\n match.push(field);\n }\n else {\n result.match[derivedTerm] = [field];\n }\n }\n else {\n results.set(docId, {\n score: weightedScore,\n terms: [sourceTerm],\n match: { [derivedTerm]: [field] }\n });\n }\n }\n }\n return results;\n }\n /**\n * @ignore\n */\n addTerm(fieldId, documentId, term) {\n const indexData = this._index.fetch(term, createMap);\n let fieldIndex = indexData.get(fieldId);\n if (fieldIndex == null) {\n fieldIndex = new Map();\n fieldIndex.set(documentId, 1);\n indexData.set(fieldId, fieldIndex);\n }\n else {\n const docs = fieldIndex.get(documentId);\n fieldIndex.set(documentId, (docs || 0) + 1);\n }\n }\n /**\n * @ignore\n */\n removeTerm(fieldId, documentId, term) {\n if (!this._index.has(term)) {\n this.warnDocumentChanged(documentId, fieldId, term);\n return;\n }\n const indexData = this._index.fetch(term, createMap);\n const fieldIndex = indexData.get(fieldId);\n if (fieldIndex == null || fieldIndex.get(documentId) == null) {\n this.warnDocumentChanged(documentId, fieldId, term);\n }\n else if (fieldIndex.get(documentId) <= 1) {\n if (fieldIndex.size <= 1) {\n indexData.delete(fieldId);\n }\n else {\n fieldIndex.delete(documentId);\n }\n }\n else {\n fieldIndex.set(documentId, fieldIndex.get(documentId) - 1);\n }\n if (this._index.get(term).size === 0) {\n this._index.delete(term);\n }\n }\n /**\n * @ignore\n */\n warnDocumentChanged(shortDocumentId, fieldId, term) {\n for (const fieldName of Object.keys(this._fieldIds)) {\n if (this._fieldIds[fieldName] === fieldId) {\n this._options.logger('warn', `MiniSearch: document with ID ${this._documentIds.get(shortDocumentId)} has changed before removal: term \"${term}\" was not present in field \"${fieldName}\". Removing a document after it has changed can corrupt the index!`, 'version_conflict');\n return;\n }\n }\n }\n /**\n * @ignore\n */\n addDocumentId(documentId) {\n const shortDocumentId = this._nextId;\n this._idToShortId.set(documentId, shortDocumentId);\n this._documentIds.set(shortDocumentId, documentId);\n this._documentCount += 1;\n this._nextId += 1;\n return shortDocumentId;\n }\n /**\n * @ignore\n */\n addFields(fields) {\n for (let i = 0; i < fields.length; i++) {\n this._fieldIds[fields[i]] = i;\n }\n }\n /**\n * @ignore\n */\n addFieldLength(documentId, fieldId, count, length) {\n let fieldLengths = this._fieldLength.get(documentId);\n if (fieldLengths == null)\n this._fieldLength.set(documentId, fieldLengths = []);\n fieldLengths[fieldId] = length;\n const averageFieldLength = this._avgFieldLength[fieldId] || 0;\n const totalFieldLength = (averageFieldLength * count) + length;\n this._avgFieldLength[fieldId] = totalFieldLength / (count + 1);\n }\n /**\n * @ignore\n */\n removeFieldLength(documentId, fieldId, count, length) {\n if (count === 1) {\n this._avgFieldLength[fieldId] = 0;\n return;\n }\n const totalFieldLength = (this._avgFieldLength[fieldId] * count) - length;\n this._avgFieldLength[fieldId] = totalFieldLength / (count - 1);\n }\n /**\n * @ignore\n */\n saveStoredFields(documentId, doc) {\n const { storeFields, extractField } = this._options;\n if (storeFields == null || storeFields.length === 0) {\n return;\n }\n let documentFields = this._storedFields.get(documentId);\n if (documentFields == null)\n this._storedFields.set(documentId, documentFields = {});\n for (const fieldName of storeFields) {\n const fieldValue = extractField(doc, fieldName);\n if (fieldValue !== undefined)\n documentFields[fieldName] = fieldValue;\n }\n }\n}\n/**\n * The special wildcard symbol that can be passed to {@link MiniSearch#search}\n * to match all documents\n */\nMiniSearch.wildcard = Symbol('*');\nconst getOwnProperty = (object, property) => Object.prototype.hasOwnProperty.call(object, property) ? object[property] : undefined;\nconst combinators = {\n [OR]: (a, b) => {\n for (const docId of b.keys()) {\n const existing = a.get(docId);\n if (existing == null) {\n a.set(docId, b.get(docId));\n }\n else {\n const { score, terms, match } = b.get(docId);\n existing.score = existing.score + score;\n existing.match = Object.assign(existing.match, match);\n assignUniqueTerms(existing.terms, terms);\n }\n }\n return a;\n },\n [AND]: (a, b) => {\n const combined = new Map();\n for (const docId of b.keys()) {\n const existing = a.get(docId);\n if (existing == null)\n continue;\n const { score, terms, match } = b.get(docId);\n assignUniqueTerms(existing.terms, terms);\n combined.set(docId, {\n score: existing.score + score,\n terms: existing.terms,\n match: Object.assign(existing.match, match)\n });\n }\n return combined;\n },\n [AND_NOT]: (a, b) => {\n for (const docId of b.keys())\n a.delete(docId);\n return a;\n }\n};\nconst defaultBM25params = { k: 1.2, b: 0.7, d: 0.5 };\nconst calcBM25Score = (termFreq, matchingCount, totalCount, fieldLength, avgFieldLength, bm25params) => {\n const { k, b, d } = bm25params;\n const invDocFreq = Math.log(1 + (totalCount - matchingCount + 0.5) / (matchingCount + 0.5));\n return invDocFreq * (d + termFreq * (k + 1) / (termFreq + k * (1 - b + b * fieldLength / avgFieldLength)));\n};\nconst termToQuerySpec = (options) => (term, i, terms) => {\n const fuzzy = (typeof options.fuzzy === 'function')\n ? options.fuzzy(term, i, terms)\n : (options.fuzzy || false);\n const prefix = (typeof options.prefix === 'function')\n ? options.prefix(term, i, terms)\n : (options.prefix === true);\n const termBoost = (typeof options.boostTerm === 'function')\n ? options.boostTerm(term, i, terms)\n : 1;\n return { term, fuzzy, prefix, termBoost };\n};\nconst defaultOptions = {\n idField: 'id',\n extractField: (document, fieldName) => document[fieldName],\n tokenize: (text) => text.split(SPACE_OR_PUNCTUATION),\n processTerm: (term) => term.toLowerCase(),\n fields: undefined,\n searchOptions: undefined,\n storeFields: [],\n logger: (level, message) => {\n if (typeof (console === null || console === void 0 ? void 0 : console[level]) === 'function')\n console[level](message);\n },\n autoVacuum: true\n};\nconst defaultSearchOptions = {\n combineWith: OR,\n prefix: false,\n fuzzy: false,\n maxFuzzy: 6,\n boost: {},\n weights: { fuzzy: 0.45, prefix: 0.375 },\n bm25: defaultBM25params\n};\nconst defaultAutoSuggestOptions = {\n combineWith: AND,\n prefix: (term, i, terms) => i === terms.length - 1\n};\nconst defaultVacuumOptions = { batchSize: 1000, batchWait: 10 };\nconst defaultVacuumConditions = { minDirtFactor: 0.1, minDirtCount: 20 };\nconst defaultAutoVacuumOptions = { ...defaultVacuumOptions, ...defaultVacuumConditions };\nconst assignUniqueTerm = (target, term) => {\n // Avoid adding duplicate terms.\n if (!target.includes(term))\n target.push(term);\n};\nconst assignUniqueTerms = (target, source) => {\n for (const term of source) {\n // Avoid adding duplicate terms.\n if (!target.includes(term))\n target.push(term);\n }\n};\nconst byScore = ({ score: a }, { score: b }) => b - a;\nconst createMap = () => new Map();\nconst objectToNumericMap = (object) => {\n const map = new Map();\n for (const key of Object.keys(object)) {\n map.set(parseInt(key, 10), object[key]);\n }\n return map;\n};\nconst objectToNumericMapAsync = async (object) => {\n const map = new Map();\n let count = 0;\n for (const key of Object.keys(object)) {\n map.set(parseInt(key, 10), object[key]);\n if (++count % 1000 === 0) {\n await wait(0);\n }\n }\n return map;\n};\nconst wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n// This regular expression matches any Unicode space, newline, or punctuation\n// character\nconst SPACE_OR_PUNCTUATION = /[\\n\\r\\p{Z}\\p{P}]+/u;\n\nexport { MiniSearch as default };\n//# sourceMappingURL=index.js.map\n",
|
15
16
|
"#!/usr/bin/env node\nimport { ServerService } from './src/services/server.service'\nimport { logger } from './src/utils/logger'\nimport pkg from './package.json'\n\n// Version is injected during build\ndeclare global {\n namespace NodeJS {\n interface ProcessEnv {\n SP_VERSION: string\n PWD?: string\n }\n }\n}\n\n/**\n * Print version information\n */\nfunction printVersion() {\n console.log(process.env.SP_VERSION || '0.0.0')\n}\n\n/**\n * Print usage instructions\n */\nfunction printHelp() {\n // Keep console.error for help output since it's CLI usage information\n console.error(`\n${pkg.name} - v${process.env.SP_VERSION}\n\nUsage: ${pkg.bin ? Object.keys(pkg.bin)[0] : pkg.name}\n\nOptions:\n -h, --help Display this help message\n -v, --version Display version information\n\nExample:\n ${pkg.bin ? Object.keys(pkg.bin)[0] : pkg.name}\n\n npx --yes ${pkg.name}\n\n bunx ${pkg.name}\n`)\n}\n\n/**\n * Main entry point for the Specifai MCP Server\n */\nasync function main() {\n try {\n logger.info(\n { version: process.env.SP_VERSION, pwd: process.env.PWD, ...process.env },\n 'Starting Specifai MCP Server'\n )\n\n const args = process.argv.slice(2)\n\n if (args[0] === '--help' || args[0] === '-h') {\n printHelp()\n process.exit(args.length === 0 ? 1 : 0)\n }\n\n if (args[0] === '--version' || args[0] === '-v') {\n printVersion()\n process.exit(0)\n }\n\n // Initialize and start server\n const serverService = new ServerService(process.env.PWD)\n await serverService.start()\n\n logger.info('Specifai MCP Server running on stdio')\n } catch (error) {\n logger.error({ error: error instanceof Error ? error.message : String(error) }, 'Fatal error')\n process.exit(1)\n }\n}\n\n// Handle process signals\nprocess.on('SIGINT', () => {\n logger.info('Received SIGINT. Shutting down...')\n process.exit(0)\n})\n\nprocess.on('SIGTERM', () => {\n logger.info('Received SIGTER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F,EACA,CACE,KAAM,WACN,YACE,8GACF,YAAa,CACX,KAAM,SACN,WAAY,CACV,IAAK,CACH,KAAM,SACN,YAxCV,gNAyCQ,EACA,mBAAoB,CAClB,KAAM,UACN,YAAa,qDACf,EACA,MAAO,CACL,KAAM,SACN,YAAa,wDACf,EACA,OAAQ,CACN,KAAM,SACN,YAAa,wDACf,EACA,mBAAoB,CAClB,KAAM,UACN,YACE,oIACJ,EACA,aAAc,CACZ,KAAM,UACN,YACE,qHACJ,CACF,EACA,SAAU,CAAC,KAAK,CAClB,CACF,EACA,CACE,KAAM,WACN,YACE,qHACF,YAAa,CACX,KAAM,SACN,WAAY,CACV,IAAK,CACH,KAAM,SACN,YA7EV,gNA8EQ,EACA,mBAAoB,CAClB,KAAM,UACN,YAAa,qDACf,EACA,MAAO,CACL,KAAM,SACN,YAAa,wDACf,EACA,OAAQ,CACN,KAAM,SACN,YAAa,wDACf,CACF,EACA,SAAU,CAAC,KAAK,CAClB,CACF,EACA,CACE,KAAM,WACN,YAAa,4DACb,YAAa,CACX,KAAM,SACN,WAAY,CACV,IAAK,CACH,KAAM,SACN,YACE,gNACJ,EACA,mBAAoB,CAClB,KAAM,UACN,YAAa,qDACf,EACA,MAAO,CACL,KAAM,SACN,YAAa,wDACf,EACA,OAAQ,CACN,KAAM,SACN,YAAa,wDACf,CACF,EACA,SAAU,CAAC,KAAK,CAClB,CACF,EACA,CACE,KAAM,WACN,YAAa,kDACb,YAAa,CACX,KAAM,SACN,WAAY,CACV,IAAK,CACH,KAAM,SACN,YACE,gNACJ,CACF,EACA,mBAAoB,CAClB,KAAM,UACN,YAAa,qDACf,EACA,MAAO,CACL,KAAM,SACN,YAAa,qDACf,EACA,OAAQ,CACN,KAAM,SACN,YAAa,wDACf,EACA,SAAU,CAAC,KAAK,CAClB,CACF,EACA,CACE,KAAM,mBACN,YAAa,wCACb,YAAa,CACX,KAAM,SACN,SAAU,CAAC,QAAS,KAAK,EACzB,WAAY,CACV,MAAO,CACL,KAAM,SACN,YACE,mKACJ,EACA,IAAK,CACH,KAAM,SACN,YACE,gNACJ,CACF,CACF,CACF,EACA,CACE,KAAM,YACN,YAAa,wCACb,YAAa,CACX,KAAM,SACN,SAAU,CAAC,QAAS,cAAe,KAAK,EACxC,WAAY,CACV,MAAO,CACL,KAAM,SACN,YACE,mKACJ,EACA,YAAa,CACX,KAAM,SACN,YACE,yIACJ,EACA,IAAK,CACH,KAAM,SACN,YACE,gNACJ,CACF,CACF,CACF,EACA,CACE,KAAM,WACN,YAAa,oEACb,YAAa,CACX,KAAM,SACN,SAAU,CAAC,QAAS,cAAe,SAAU,KAAK,EAClD,WAAY,CACV,MAAO,CACL,KAAM,SACN,YACE,mKACJ,EACA,YAAa,CACX,KAAM,SACN,YACE,yIACJ,EACA,OAAQ,CACN,KAAM,SACN,YACE,uIACJ,EACA,IAAK,CACH,KAAM,SACN,YACE,gNACJ,CACF,CACF,CACF,EACA,CACE,KAAM,mBACN,YACE,qNACF,YAAa,CACX,KAAM,SACN,SAAU,CAAC,MAAM,EACjB,WAAY,CACV,KAAM,CACJ,KAAM,SACN,YACE,2EACJ,CACF,CACF,CACF,EACA,CACE,KAAM,iBACN,YACE,0PACF,YAAa,CACX,KAAM,SACN,SAAU,CAAC,SAAU,KAAK,EAC1B,WAAY,CACV,OAAQ,CACN,KAAM,SACN,YACE,gSACJ,EACA,IAAK,CACH,KAAM,SACN,YACE,gNACJ,CACF,CACF,CACF,EACA,CACE,KAAM,iBACN,YACE,oHACF,YAAa,CACX,KAAM,SACN,SAAU,CAAC,KAAK,EAChB,WAAY,CACV,IAAK,CACH,KAAM,SACN,YA/QV,gNAgRQ,EACA,MAAO,CACL,KAAM,SACN,YAAa,wDACf,EACA,OAAQ,CACN,KAAM,SACN,YAAa,wDACf,CACF,CACF,CACF,EACA,CACE,KAAM,SACN,YACE,6FACF,YAAa,CACX,KAAM,SACN,SAAU,CAAC,aAAc,KAAK,EAC9B,WAAY,CACV,WAAY,CACV,KAAM,SACN,YA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