@shopify/create-app 4.8.5 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/analytics-D5P7IMRA.js +48 -0
  2. package/dist/analytics-TXXYVQN7.js +40 -0
  3. package/dist/{chunk-ODCXYGJ2.js → chunk-23UTCSPZ.js} +14 -4
  4. package/dist/{chunk-5JYB62AT.js → chunk-2UPX6QLJ.js} +7 -7
  5. package/dist/{chunk-YGBCHL4K.js → chunk-3IJICKWH.js} +2 -2
  6. package/dist/chunk-5OAATCQX.js +218 -0
  7. package/dist/{chunk-BEUNBVME.js → chunk-A33KVF5C.js} +1 -1
  8. package/dist/{chunk-ZTNEDTAC.js → chunk-AJLJXEKT.js} +3093 -23
  9. package/dist/chunk-BBGOL4JF.js +86 -0
  10. package/dist/chunk-CK3T27VW.js +119 -0
  11. package/dist/{chunk-E43EDJOG.js → chunk-EJEHENXO.js} +3 -2
  12. package/dist/chunk-FKZ3NFHZ.js +7 -0
  13. package/dist/{chunk-TS6YLIAL.js → chunk-KZZE6H5Q.js} +51 -26
  14. package/dist/chunk-MHLFPQ3W.js +50 -0
  15. package/dist/{chunk-JEMOMVLA.js → chunk-MOB6XVGL.js} +2 -2
  16. package/dist/{chunk-GU2TODXD.js → chunk-NB6X7ZFE.js} +3 -3
  17. package/dist/{chunk-SGIGETET.js → chunk-NHN6SUTT.js} +202 -55
  18. package/dist/chunk-NLC4T4YS.js +1092 -0
  19. package/dist/{chunk-PERCCMZB.js → chunk-NW3CCDI2.js} +320 -3213
  20. package/dist/{chunk-4SGOGIHQ.js → chunk-OG3KDO3M.js} +16 -16
  21. package/dist/{chunk-ZKLW7LMH.js → chunk-PSP4NDSB.js} +16 -14
  22. package/dist/{chunk-67ZHQJFJ.js → chunk-QNTXEHZO.js} +5 -5
  23. package/dist/{chunk-B4MEUQZW.js → chunk-RYTPHY47.js} +10 -10
  24. package/dist/{chunk-CPI6XVRV.js → chunk-SFVOZJMO.js} +32 -10
  25. package/dist/chunk-SHCNJ47P.js +89 -0
  26. package/dist/{chunk-F2LFNR26.js → chunk-SYVHC634.js} +2 -2
  27. package/dist/{chunk-C3J4HVUN.js → chunk-VDUAROBQ.js} +3 -2
  28. package/dist/command-json-schema-S3W3UW3A.js +65 -0
  29. package/dist/{conf-store-I2EVFNHO.js → conf-store-GW5MF5EC.js} +11 -11
  30. package/dist/custom-oclif-loader-MYKFWED2.js +85 -0
  31. package/dist/{deprecations-ASHE6RU7.js → deprecations-TJKLSMEC.js} +18 -15
  32. package/dist/environment-OJNKZ7ML.js +25 -0
  33. package/dist/environments-FLXCXEQY.js +32 -0
  34. package/dist/error-handler-KSSGLWAL.js +44 -0
  35. package/dist/{fs-AOTVAHUT.js → fs-54TFRUFV.js} +10 -5
  36. package/dist/hooks/postrun.js +11 -6
  37. package/dist/hooks/prerun.js +6 -6
  38. package/dist/{http-proxy-node16-5LMQ6YXS.js → http-proxy-node16-FD2WN6JB.js} +2 -3
  39. package/dist/index.js +6688 -3623
  40. package/dist/{is-global-2XE72BX5.js → is-global-ABT2AQMZ.js} +10 -5
  41. package/dist/json-error-N7MI3KIX.js +104 -0
  42. package/dist/{lib-XCYUJYSO.js → lib-NYDMHWZM.js} +3 -4
  43. package/dist/{local-VTOHZRT2.js → local-BAVJFTPY.js} +11 -3
  44. package/dist/{metadata-PNCC4F25.js → metadata-JDWMZLO3.js} +10 -4
  45. package/dist/{node-package-manager-WUKOPNFK.js → node-package-manager-LZQDH5RV.js} +20 -17
  46. package/dist/notifications-system-C4VANR5T.js +47 -0
  47. package/dist/os-UYRG46VD.js +24 -0
  48. package/dist/{output-Y2INREX2.js → output-WTBNQLZY.js} +12 -5
  49. package/dist/{path-2WA5R6GG.js → path-2KZ7FSGN.js} +2 -2
  50. package/dist/{prettier-SS3RRDXK.js → prettier-BNZDRHR4.js} +2 -2
  51. package/dist/{system-KPC4GYYQ.js → system-VYWFQ656.js} +18 -15
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/dist/{ui-WQOJ2UKT.js → ui-EW2MACA7.js} +18 -15
  54. package/dist/{upgrade-KCKPO4QT.js → upgrade-TCM7RY33.js} +47 -29
  55. package/dist/{version-ODXTDVIB.js → version-6BXGHP54.js} +2 -2
  56. package/dist/version-ANERG2ID.js +36 -0
  57. package/oclif.manifest.json +15 -1
  58. package/package.json +3 -3
  59. package/dist/analytics-I6PGSH5K.js +0 -44
  60. package/dist/analytics-QHQHZXCP.js +0 -36
  61. package/dist/chunk-2Z5L5TZI.js +0 -301
  62. package/dist/chunk-7OHJH7BF.js +0 -21
  63. package/dist/custom-oclif-loader-HTLL62HO.js +0 -54
  64. package/dist/environments-JM7VKVKQ.js +0 -29
  65. package/dist/error-handler-TUY64CIU.js +0 -40
  66. package/dist/notifications-system-GBBRT4B6.js +0 -43
  67. package/dist/os-J6JGAAOY.js +0 -19
  68. package/dist/version-5242JBZK.js +0 -33
@@ -0,0 +1,1092 @@
1
+ import {
2
+ ZodFirstPartyTypeKind
3
+ } from "./chunk-AJLJXEKT.js";
4
+ import {
5
+ init_cjs_shims
6
+ } from "./chunk-3XNI6LP4.js";
7
+
8
+ // ../cli-kit/dist/public/node/json-output-schema.js
9
+ init_cjs_shims();
10
+
11
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/index.js
12
+ init_cjs_shims();
13
+
14
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
15
+ init_cjs_shims();
16
+ var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
17
+ var defaultOptions = {
18
+ name: void 0,
19
+ $refStrategy: "root",
20
+ basePath: ["#"],
21
+ effectStrategy: "input",
22
+ pipeStrategy: "all",
23
+ dateStrategy: "format:date-time",
24
+ mapStrategy: "entries",
25
+ removeAdditionalStrategy: "passthrough",
26
+ allowedAdditionalProperties: !0,
27
+ rejectedAdditionalProperties: !1,
28
+ definitionPath: "definitions",
29
+ target: "jsonSchema7",
30
+ strictUnions: !1,
31
+ definitions: {},
32
+ errorMessages: !1,
33
+ markdownDescription: !1,
34
+ patternStrategy: "escape",
35
+ applyRegexFlags: !1,
36
+ emailStrategy: "format:email",
37
+ base64Strategy: "contentEncoding:base64",
38
+ nameStrategy: "ref",
39
+ openAiAnyTypeName: "OpenAiAnyType"
40
+ }, getDefaultOptions = (options) => typeof options == "string" ? {
41
+ ...defaultOptions,
42
+ name: options
43
+ } : {
44
+ ...defaultOptions,
45
+ ...options
46
+ };
47
+
48
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js
49
+ init_cjs_shims();
50
+ var getRefs = (options) => {
51
+ let _options = getDefaultOptions(options), currentPath = _options.name !== void 0 ? [..._options.basePath, _options.definitionPath, _options.name] : _options.basePath;
52
+ return {
53
+ ..._options,
54
+ flags: { hasReferencedOpenAiAnyType: !1 },
55
+ currentPath,
56
+ propertyPath: void 0,
57
+ seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
58
+ def._def,
59
+ {
60
+ def: def._def,
61
+ path: [..._options.basePath, _options.definitionPath, name],
62
+ // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
63
+ jsonSchema: void 0
64
+ }
65
+ ]))
66
+ };
67
+ };
68
+
69
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
70
+ init_cjs_shims();
71
+ function addErrorMessage(res, key, errorMessage, refs) {
72
+ refs?.errorMessages && errorMessage && (res.errorMessage = {
73
+ ...res.errorMessage,
74
+ [key]: errorMessage
75
+ });
76
+ }
77
+ function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
78
+ res[key] = value, addErrorMessage(res, key, errorMessage, refs);
79
+ }
80
+
81
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
82
+ init_cjs_shims();
83
+ var getRelativePath = (pathA, pathB) => {
84
+ let i = 0;
85
+ for (; i < pathA.length && i < pathB.length && pathA[i] === pathB[i]; i++)
86
+ ;
87
+ return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
88
+ };
89
+
90
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js
91
+ init_cjs_shims();
92
+
93
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
94
+ init_cjs_shims();
95
+
96
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js
97
+ init_cjs_shims();
98
+ function parseAnyDef(refs) {
99
+ if (refs.target !== "openAi")
100
+ return {};
101
+ let anyDefinitionPath = [
102
+ ...refs.basePath,
103
+ refs.definitionPath,
104
+ refs.openAiAnyTypeName
105
+ ];
106
+ return refs.flags.hasReferencedOpenAiAnyType = !0, {
107
+ $ref: refs.$refStrategy === "relative" ? getRelativePath(anyDefinitionPath, refs.currentPath) : anyDefinitionPath.join("/")
108
+ };
109
+ }
110
+
111
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
112
+ init_cjs_shims();
113
+ function parseArrayDef(def, refs) {
114
+ let res = {
115
+ type: "array"
116
+ };
117
+ return def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny && (res.items = parseDef(def.type._def, {
118
+ ...refs,
119
+ currentPath: [...refs.currentPath, "items"]
120
+ })), def.minLength && setResponseValueAndErrors(res, "minItems", def.minLength.value, def.minLength.message, refs), def.maxLength && setResponseValueAndErrors(res, "maxItems", def.maxLength.value, def.maxLength.message, refs), def.exactLength && (setResponseValueAndErrors(res, "minItems", def.exactLength.value, def.exactLength.message, refs), setResponseValueAndErrors(res, "maxItems", def.exactLength.value, def.exactLength.message, refs)), res;
121
+ }
122
+
123
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js
124
+ init_cjs_shims();
125
+ function parseBigintDef(def, refs) {
126
+ let res = {
127
+ type: "integer",
128
+ format: "int64"
129
+ };
130
+ if (!def.checks)
131
+ return res;
132
+ for (let check of def.checks)
133
+ switch (check.kind) {
134
+ case "min":
135
+ refs.target === "jsonSchema7" ? check.inclusive ? setResponseValueAndErrors(res, "minimum", check.value, check.message, refs) : setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs) : (check.inclusive || (res.exclusiveMinimum = !0), setResponseValueAndErrors(res, "minimum", check.value, check.message, refs));
136
+ break;
137
+ case "max":
138
+ refs.target === "jsonSchema7" ? check.inclusive ? setResponseValueAndErrors(res, "maximum", check.value, check.message, refs) : setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs) : (check.inclusive || (res.exclusiveMaximum = !0), setResponseValueAndErrors(res, "maximum", check.value, check.message, refs));
139
+ break;
140
+ case "multipleOf":
141
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
142
+ break;
143
+ }
144
+ return res;
145
+ }
146
+
147
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js
148
+ init_cjs_shims();
149
+ function parseBooleanDef() {
150
+ return {
151
+ type: "boolean"
152
+ };
153
+ }
154
+
155
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js
156
+ init_cjs_shims();
157
+ function parseBrandedDef(_def, refs) {
158
+ return parseDef(_def.type._def, refs);
159
+ }
160
+
161
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js
162
+ init_cjs_shims();
163
+ var parseCatchDef = (def, refs) => parseDef(def.innerType._def, refs);
164
+
165
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js
166
+ init_cjs_shims();
167
+ function parseDateDef(def, refs, overrideDateStrategy) {
168
+ let strategy = overrideDateStrategy ?? refs.dateStrategy;
169
+ if (Array.isArray(strategy))
170
+ return {
171
+ anyOf: strategy.map((item, i) => parseDateDef(def, refs, item))
172
+ };
173
+ switch (strategy) {
174
+ case "string":
175
+ case "format:date-time":
176
+ return {
177
+ type: "string",
178
+ format: "date-time"
179
+ };
180
+ case "format:date":
181
+ return {
182
+ type: "string",
183
+ format: "date"
184
+ };
185
+ case "integer":
186
+ return integerDateParser(def, refs);
187
+ }
188
+ }
189
+ var integerDateParser = (def, refs) => {
190
+ let res = {
191
+ type: "integer",
192
+ format: "unix-time"
193
+ };
194
+ if (refs.target === "openApi3")
195
+ return res;
196
+ for (let check of def.checks)
197
+ switch (check.kind) {
198
+ case "min":
199
+ setResponseValueAndErrors(
200
+ res,
201
+ "minimum",
202
+ check.value,
203
+ // This is in milliseconds
204
+ check.message,
205
+ refs
206
+ );
207
+ break;
208
+ case "max":
209
+ setResponseValueAndErrors(
210
+ res,
211
+ "maximum",
212
+ check.value,
213
+ // This is in milliseconds
214
+ check.message,
215
+ refs
216
+ );
217
+ break;
218
+ }
219
+ return res;
220
+ };
221
+
222
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js
223
+ init_cjs_shims();
224
+ function parseDefaultDef(_def, refs) {
225
+ return {
226
+ ...parseDef(_def.innerType._def, refs),
227
+ default: _def.defaultValue()
228
+ };
229
+ }
230
+
231
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js
232
+ init_cjs_shims();
233
+ function parseEffectsDef(_def, refs) {
234
+ return refs.effectStrategy === "input" ? parseDef(_def.schema._def, refs) : parseAnyDef(refs);
235
+ }
236
+
237
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js
238
+ init_cjs_shims();
239
+ function parseEnumDef(def) {
240
+ return {
241
+ type: "string",
242
+ enum: Array.from(def.values)
243
+ };
244
+ }
245
+
246
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js
247
+ init_cjs_shims();
248
+ var isJsonSchema7AllOfType = (type) => "type" in type && type.type === "string" ? !1 : "allOf" in type;
249
+ function parseIntersectionDef(def, refs) {
250
+ let allOf = [
251
+ parseDef(def.left._def, {
252
+ ...refs,
253
+ currentPath: [...refs.currentPath, "allOf", "0"]
254
+ }),
255
+ parseDef(def.right._def, {
256
+ ...refs,
257
+ currentPath: [...refs.currentPath, "allOf", "1"]
258
+ })
259
+ ].filter((x) => !!x), unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: !1 } : void 0, mergedAllOf = [];
260
+ return allOf.forEach((schema) => {
261
+ if (isJsonSchema7AllOfType(schema))
262
+ mergedAllOf.push(...schema.allOf), schema.unevaluatedProperties === void 0 && (unevaluatedProperties = void 0);
263
+ else {
264
+ let nestedSchema = schema;
265
+ if ("additionalProperties" in schema && schema.additionalProperties === !1) {
266
+ let { additionalProperties, ...rest } = schema;
267
+ nestedSchema = rest;
268
+ } else
269
+ unevaluatedProperties = void 0;
270
+ mergedAllOf.push(nestedSchema);
271
+ }
272
+ }), mergedAllOf.length ? {
273
+ allOf: mergedAllOf,
274
+ ...unevaluatedProperties
275
+ } : void 0;
276
+ }
277
+
278
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js
279
+ init_cjs_shims();
280
+ function parseLiteralDef(def, refs) {
281
+ let parsedType = typeof def.value;
282
+ return parsedType !== "bigint" && parsedType !== "number" && parsedType !== "boolean" && parsedType !== "string" ? {
283
+ type: Array.isArray(def.value) ? "array" : "object"
284
+ } : refs.target === "openApi3" ? {
285
+ type: parsedType === "bigint" ? "integer" : parsedType,
286
+ enum: [def.value]
287
+ } : {
288
+ type: parsedType === "bigint" ? "integer" : parsedType,
289
+ const: def.value
290
+ };
291
+ }
292
+
293
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
294
+ init_cjs_shims();
295
+
296
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
297
+ init_cjs_shims();
298
+
299
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
300
+ init_cjs_shims();
301
+ var emojiRegex, zodPatterns = {
302
+ /**
303
+ * `c` was changed to `[cC]` to replicate /i flag
304
+ */
305
+ cuid: /^[cC][^\s-]{8,}$/,
306
+ cuid2: /^[0-9a-z]+$/,
307
+ ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
308
+ /**
309
+ * `a-z` was added to replicate /i flag
310
+ */
311
+ email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
312
+ /**
313
+ * Constructed a valid Unicode RegExp
314
+ *
315
+ * Lazily instantiate since this type of regex isn't supported
316
+ * in all envs (e.g. React Native).
317
+ *
318
+ * See:
319
+ * https://github.com/colinhacks/zod/issues/2433
320
+ * Fix in Zod:
321
+ * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
322
+ */
323
+ emoji: () => (emojiRegex === void 0 && (emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), emojiRegex),
324
+ /**
325
+ * Unused
326
+ */
327
+ uuid: /^[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}$/,
328
+ /**
329
+ * Unused
330
+ */
331
+ ipv4: /^(?:(?: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])$/,
332
+ ipv4Cidr: /^(?:(?: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])$/,
333
+ /**
334
+ * Unused
335
+ */
336
+ 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})))$/,
337
+ ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[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])$/,
338
+ base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
339
+ base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
340
+ nanoid: /^[a-zA-Z0-9_-]{21}$/,
341
+ jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
342
+ };
343
+ function parseStringDef(def, refs) {
344
+ let res = {
345
+ type: "string"
346
+ };
347
+ if (def.checks)
348
+ for (let check of def.checks)
349
+ switch (check.kind) {
350
+ case "min":
351
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength == "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs);
352
+ break;
353
+ case "max":
354
+ setResponseValueAndErrors(res, "maxLength", typeof res.maxLength == "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
355
+ break;
356
+ case "email":
357
+ switch (refs.emailStrategy) {
358
+ case "format:email":
359
+ addFormat(res, "email", check.message, refs);
360
+ break;
361
+ case "format:idn-email":
362
+ addFormat(res, "idn-email", check.message, refs);
363
+ break;
364
+ case "pattern:zod":
365
+ addPattern(res, zodPatterns.email, check.message, refs);
366
+ break;
367
+ }
368
+ break;
369
+ case "url":
370
+ addFormat(res, "uri", check.message, refs);
371
+ break;
372
+ case "uuid":
373
+ addFormat(res, "uuid", check.message, refs);
374
+ break;
375
+ case "regex":
376
+ addPattern(res, check.regex, check.message, refs);
377
+ break;
378
+ case "cuid":
379
+ addPattern(res, zodPatterns.cuid, check.message, refs);
380
+ break;
381
+ case "cuid2":
382
+ addPattern(res, zodPatterns.cuid2, check.message, refs);
383
+ break;
384
+ case "startsWith":
385
+ addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
386
+ break;
387
+ case "endsWith":
388
+ addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
389
+ break;
390
+ case "datetime":
391
+ addFormat(res, "date-time", check.message, refs);
392
+ break;
393
+ case "date":
394
+ addFormat(res, "date", check.message, refs);
395
+ break;
396
+ case "time":
397
+ addFormat(res, "time", check.message, refs);
398
+ break;
399
+ case "duration":
400
+ addFormat(res, "duration", check.message, refs);
401
+ break;
402
+ case "length":
403
+ setResponseValueAndErrors(res, "minLength", typeof res.minLength == "number" ? Math.max(res.minLength, check.value) : check.value, check.message, refs), setResponseValueAndErrors(res, "maxLength", typeof res.maxLength == "number" ? Math.min(res.maxLength, check.value) : check.value, check.message, refs);
404
+ break;
405
+ case "includes": {
406
+ addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
407
+ break;
408
+ }
409
+ case "ip": {
410
+ check.version !== "v6" && addFormat(res, "ipv4", check.message, refs), check.version !== "v4" && addFormat(res, "ipv6", check.message, refs);
411
+ break;
412
+ }
413
+ case "base64url":
414
+ addPattern(res, zodPatterns.base64url, check.message, refs);
415
+ break;
416
+ case "jwt":
417
+ addPattern(res, zodPatterns.jwt, check.message, refs);
418
+ break;
419
+ case "cidr": {
420
+ check.version !== "v6" && addPattern(res, zodPatterns.ipv4Cidr, check.message, refs), check.version !== "v4" && addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
421
+ break;
422
+ }
423
+ case "emoji":
424
+ addPattern(res, zodPatterns.emoji(), check.message, refs);
425
+ break;
426
+ case "ulid": {
427
+ addPattern(res, zodPatterns.ulid, check.message, refs);
428
+ break;
429
+ }
430
+ case "base64": {
431
+ switch (refs.base64Strategy) {
432
+ case "format:binary": {
433
+ addFormat(res, "binary", check.message, refs);
434
+ break;
435
+ }
436
+ case "contentEncoding:base64": {
437
+ setResponseValueAndErrors(res, "contentEncoding", "base64", check.message, refs);
438
+ break;
439
+ }
440
+ case "pattern:zod": {
441
+ addPattern(res, zodPatterns.base64, check.message, refs);
442
+ break;
443
+ }
444
+ }
445
+ break;
446
+ }
447
+ case "nanoid":
448
+ addPattern(res, zodPatterns.nanoid, check.message, refs);
449
+ case "toLowerCase":
450
+ case "toUpperCase":
451
+ case "trim":
452
+ break;
453
+ default:
454
+ }
455
+ return res;
456
+ }
457
+ function escapeLiteralCheckValue(literal, refs) {
458
+ return refs.patternStrategy === "escape" ? escapeNonAlphaNumeric(literal) : literal;
459
+ }
460
+ var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
461
+ function escapeNonAlphaNumeric(source) {
462
+ let result = "";
463
+ for (let i = 0; i < source.length; i++)
464
+ ALPHA_NUMERIC.has(source[i]) || (result += "\\"), result += source[i];
465
+ return result;
466
+ }
467
+ function addFormat(schema, value, message, refs) {
468
+ schema.format || schema.anyOf?.some((x) => x.format) ? (schema.anyOf || (schema.anyOf = []), schema.format && (schema.anyOf.push({
469
+ format: schema.format,
470
+ ...schema.errorMessage && refs.errorMessages && {
471
+ errorMessage: { format: schema.errorMessage.format }
472
+ }
473
+ }), delete schema.format, schema.errorMessage && (delete schema.errorMessage.format, Object.keys(schema.errorMessage).length === 0 && delete schema.errorMessage)), schema.anyOf.push({
474
+ format: value,
475
+ ...message && refs.errorMessages && { errorMessage: { format: message } }
476
+ })) : setResponseValueAndErrors(schema, "format", value, message, refs);
477
+ }
478
+ function addPattern(schema, regex, message, refs) {
479
+ schema.pattern || schema.allOf?.some((x) => x.pattern) ? (schema.allOf || (schema.allOf = []), schema.pattern && (schema.allOf.push({
480
+ pattern: schema.pattern,
481
+ ...schema.errorMessage && refs.errorMessages && {
482
+ errorMessage: { pattern: schema.errorMessage.pattern }
483
+ }
484
+ }), delete schema.pattern, schema.errorMessage && (delete schema.errorMessage.pattern, Object.keys(schema.errorMessage).length === 0 && delete schema.errorMessage)), schema.allOf.push({
485
+ pattern: stringifyRegExpWithFlags(regex, refs),
486
+ ...message && refs.errorMessages && { errorMessage: { pattern: message } }
487
+ })) : setResponseValueAndErrors(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
488
+ }
489
+ function stringifyRegExpWithFlags(regex, refs) {
490
+ if (!refs.applyRegexFlags || !regex.flags)
491
+ return regex.source;
492
+ let flags = {
493
+ i: regex.flags.includes("i"),
494
+ m: regex.flags.includes("m"),
495
+ s: regex.flags.includes("s")
496
+ // `.` matches newlines
497
+ }, source = flags.i ? regex.source.toLowerCase() : regex.source, pattern = "", isEscaped = !1, inCharGroup = !1, inCharRange = !1;
498
+ for (let i = 0; i < source.length; i++) {
499
+ if (isEscaped) {
500
+ pattern += source[i], isEscaped = !1;
501
+ continue;
502
+ }
503
+ if (flags.i) {
504
+ if (inCharGroup) {
505
+ if (source[i].match(/[a-z]/)) {
506
+ inCharRange ? (pattern += source[i], pattern += `${source[i - 2]}-${source[i]}`.toUpperCase(), inCharRange = !1) : source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/) ? (pattern += source[i], inCharRange = !0) : pattern += `${source[i]}${source[i].toUpperCase()}`;
507
+ continue;
508
+ }
509
+ } else if (source[i].match(/[a-z]/)) {
510
+ pattern += `[${source[i]}${source[i].toUpperCase()}]`;
511
+ continue;
512
+ }
513
+ }
514
+ if (flags.m) {
515
+ if (source[i] === "^") {
516
+ pattern += `(^|(?<=[\r
517
+ ]))`;
518
+ continue;
519
+ } else if (source[i] === "$") {
520
+ pattern += `($|(?=[\r
521
+ ]))`;
522
+ continue;
523
+ }
524
+ }
525
+ if (flags.s && source[i] === ".") {
526
+ pattern += inCharGroup ? `${source[i]}\r
527
+ ` : `[${source[i]}\r
528
+ ]`;
529
+ continue;
530
+ }
531
+ pattern += source[i], source[i] === "\\" ? isEscaped = !0 : inCharGroup && source[i] === "]" ? inCharGroup = !1 : !inCharGroup && source[i] === "[" && (inCharGroup = !0);
532
+ }
533
+ try {
534
+ new RegExp(pattern);
535
+ } catch {
536
+ return console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`), regex.source;
537
+ }
538
+ return pattern;
539
+ }
540
+
541
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
542
+ function parseRecordDef(def, refs) {
543
+ if (refs.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum)
544
+ return {
545
+ type: "object",
546
+ required: def.keyType._def.values,
547
+ properties: def.keyType._def.values.reduce((acc, key) => ({
548
+ ...acc,
549
+ [key]: parseDef(def.valueType._def, {
550
+ ...refs,
551
+ currentPath: [...refs.currentPath, "properties", key]
552
+ }) ?? parseAnyDef(refs)
553
+ }), {}),
554
+ additionalProperties: refs.rejectedAdditionalProperties
555
+ };
556
+ let schema = {
557
+ type: "object",
558
+ additionalProperties: parseDef(def.valueType._def, {
559
+ ...refs,
560
+ currentPath: [...refs.currentPath, "additionalProperties"]
561
+ }) ?? refs.allowedAdditionalProperties
562
+ };
563
+ if (refs.target === "openApi3")
564
+ return schema;
565
+ if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
566
+ let { type, ...keyType } = parseStringDef(def.keyType._def, refs);
567
+ return {
568
+ ...schema,
569
+ propertyNames: keyType
570
+ };
571
+ } else {
572
+ if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum)
573
+ return {
574
+ ...schema,
575
+ propertyNames: {
576
+ enum: def.keyType._def.values
577
+ }
578
+ };
579
+ if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
580
+ let { type, ...keyType } = parseBrandedDef(def.keyType._def, refs);
581
+ return {
582
+ ...schema,
583
+ propertyNames: keyType
584
+ };
585
+ }
586
+ }
587
+ return schema;
588
+ }
589
+
590
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js
591
+ function parseMapDef(def, refs) {
592
+ if (refs.mapStrategy === "record")
593
+ return parseRecordDef(def, refs);
594
+ let keys = parseDef(def.keyType._def, {
595
+ ...refs,
596
+ currentPath: [...refs.currentPath, "items", "items", "0"]
597
+ }) || parseAnyDef(refs), values = parseDef(def.valueType._def, {
598
+ ...refs,
599
+ currentPath: [...refs.currentPath, "items", "items", "1"]
600
+ }) || parseAnyDef(refs);
601
+ return {
602
+ type: "array",
603
+ maxItems: 125,
604
+ items: {
605
+ type: "array",
606
+ items: [keys, values],
607
+ minItems: 2,
608
+ maxItems: 2
609
+ }
610
+ };
611
+ }
612
+
613
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
614
+ init_cjs_shims();
615
+ function parseNativeEnumDef(def) {
616
+ let object = def.values, actualValues = Object.keys(def.values).filter((key) => typeof object[object[key]] != "number").map((key) => object[key]), parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
617
+ return {
618
+ type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
619
+ enum: actualValues
620
+ };
621
+ }
622
+
623
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js
624
+ init_cjs_shims();
625
+ function parseNeverDef(refs) {
626
+ return refs.target === "openAi" ? void 0 : {
627
+ not: parseAnyDef({
628
+ ...refs,
629
+ currentPath: [...refs.currentPath, "not"]
630
+ })
631
+ };
632
+ }
633
+
634
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js
635
+ init_cjs_shims();
636
+ function parseNullDef(refs) {
637
+ return refs.target === "openApi3" ? {
638
+ enum: ["null"],
639
+ nullable: !0
640
+ } : {
641
+ type: "null"
642
+ };
643
+ }
644
+
645
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
646
+ init_cjs_shims();
647
+
648
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js
649
+ init_cjs_shims();
650
+ var primitiveMappings = {
651
+ ZodString: "string",
652
+ ZodNumber: "number",
653
+ ZodBigInt: "integer",
654
+ ZodBoolean: "boolean",
655
+ ZodNull: "null"
656
+ };
657
+ function parseUnionDef(def, refs) {
658
+ if (refs.target === "openApi3")
659
+ return asAnyOf(def, refs);
660
+ let options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
661
+ if (options.every((x) => x._def.typeName in primitiveMappings && (!x._def.checks || !x._def.checks.length))) {
662
+ let types = options.reduce((types2, x) => {
663
+ let type = primitiveMappings[x._def.typeName];
664
+ return type && !types2.includes(type) ? [...types2, type] : types2;
665
+ }, []);
666
+ return {
667
+ type: types.length > 1 ? types : types[0]
668
+ };
669
+ } else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
670
+ let types = options.reduce((acc, x) => {
671
+ let type = typeof x._def.value;
672
+ switch (type) {
673
+ case "string":
674
+ case "number":
675
+ case "boolean":
676
+ return [...acc, type];
677
+ case "bigint":
678
+ return [...acc, "integer"];
679
+ case "object":
680
+ if (x._def.value === null)
681
+ return [...acc, "null"];
682
+ default:
683
+ return acc;
684
+ }
685
+ }, []);
686
+ if (types.length === options.length) {
687
+ let uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
688
+ return {
689
+ type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
690
+ enum: options.reduce((acc, x) => acc.includes(x._def.value) ? acc : [...acc, x._def.value], [])
691
+ };
692
+ }
693
+ } else if (options.every((x) => x._def.typeName === "ZodEnum"))
694
+ return {
695
+ type: "string",
696
+ enum: options.reduce((acc, x) => [
697
+ ...acc,
698
+ ...x._def.values.filter((x2) => !acc.includes(x2))
699
+ ], [])
700
+ };
701
+ return asAnyOf(def, refs);
702
+ }
703
+ var asAnyOf = (def, refs) => {
704
+ let anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x, i) => parseDef(x._def, {
705
+ ...refs,
706
+ currentPath: [...refs.currentPath, "anyOf", `${i}`]
707
+ })).filter((x) => !!x && (!refs.strictUnions || typeof x == "object" && Object.keys(x).length > 0));
708
+ return anyOf.length ? { anyOf } : void 0;
709
+ };
710
+
711
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js
712
+ function parseNullableDef(def, refs) {
713
+ if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) && (!def.innerType._def.checks || !def.innerType._def.checks.length))
714
+ return refs.target === "openApi3" ? {
715
+ type: primitiveMappings[def.innerType._def.typeName],
716
+ nullable: !0
717
+ } : {
718
+ type: [
719
+ primitiveMappings[def.innerType._def.typeName],
720
+ "null"
721
+ ]
722
+ };
723
+ if (refs.target === "openApi3") {
724
+ let base2 = parseDef(def.innerType._def, {
725
+ ...refs,
726
+ currentPath: [...refs.currentPath]
727
+ });
728
+ return base2 && "$ref" in base2 ? { allOf: [base2], nullable: !0 } : base2 && { ...base2, nullable: !0 };
729
+ }
730
+ let base = parseDef(def.innerType._def, {
731
+ ...refs,
732
+ currentPath: [...refs.currentPath, "anyOf", "0"]
733
+ });
734
+ return base && { anyOf: [base, { type: "null" }] };
735
+ }
736
+
737
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js
738
+ init_cjs_shims();
739
+ function parseNumberDef(def, refs) {
740
+ let res = {
741
+ type: "number"
742
+ };
743
+ if (!def.checks)
744
+ return res;
745
+ for (let check of def.checks)
746
+ switch (check.kind) {
747
+ case "int":
748
+ res.type = "integer", addErrorMessage(res, "type", check.message, refs);
749
+ break;
750
+ case "min":
751
+ refs.target === "jsonSchema7" ? check.inclusive ? setResponseValueAndErrors(res, "minimum", check.value, check.message, refs) : setResponseValueAndErrors(res, "exclusiveMinimum", check.value, check.message, refs) : (check.inclusive || (res.exclusiveMinimum = !0), setResponseValueAndErrors(res, "minimum", check.value, check.message, refs));
752
+ break;
753
+ case "max":
754
+ refs.target === "jsonSchema7" ? check.inclusive ? setResponseValueAndErrors(res, "maximum", check.value, check.message, refs) : setResponseValueAndErrors(res, "exclusiveMaximum", check.value, check.message, refs) : (check.inclusive || (res.exclusiveMaximum = !0), setResponseValueAndErrors(res, "maximum", check.value, check.message, refs));
755
+ break;
756
+ case "multipleOf":
757
+ setResponseValueAndErrors(res, "multipleOf", check.value, check.message, refs);
758
+ break;
759
+ }
760
+ return res;
761
+ }
762
+
763
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
764
+ init_cjs_shims();
765
+ function parseObjectDef(def, refs) {
766
+ let forceOptionalIntoNullable = refs.target === "openAi", result = {
767
+ type: "object",
768
+ properties: {}
769
+ }, required = [], shape = def.shape();
770
+ for (let propName in shape) {
771
+ let propDef = shape[propName];
772
+ if (propDef === void 0 || propDef._def === void 0)
773
+ continue;
774
+ let propOptional = safeIsOptional(propDef);
775
+ propOptional && forceOptionalIntoNullable && (propDef._def.typeName === "ZodOptional" && (propDef = propDef._def.innerType), propDef.isNullable() || (propDef = propDef.nullable()), propOptional = !1);
776
+ let parsedDef = parseDef(propDef._def, {
777
+ ...refs,
778
+ currentPath: [...refs.currentPath, "properties", propName],
779
+ propertyPath: [...refs.currentPath, "properties", propName]
780
+ });
781
+ parsedDef !== void 0 && (result.properties[propName] = parsedDef, propOptional || required.push(propName));
782
+ }
783
+ required.length && (result.required = required);
784
+ let additionalProperties = decideAdditionalProperties(def, refs);
785
+ return additionalProperties !== void 0 && (result.additionalProperties = additionalProperties), result;
786
+ }
787
+ function decideAdditionalProperties(def, refs) {
788
+ if (def.catchall._def.typeName !== "ZodNever")
789
+ return parseDef(def.catchall._def, {
790
+ ...refs,
791
+ currentPath: [...refs.currentPath, "additionalProperties"]
792
+ });
793
+ switch (def.unknownKeys) {
794
+ case "passthrough":
795
+ return refs.allowedAdditionalProperties;
796
+ case "strict":
797
+ return refs.rejectedAdditionalProperties;
798
+ case "strip":
799
+ return refs.removeAdditionalStrategy === "strict" ? refs.allowedAdditionalProperties : refs.rejectedAdditionalProperties;
800
+ }
801
+ }
802
+ function safeIsOptional(schema) {
803
+ try {
804
+ return schema.isOptional();
805
+ } catch {
806
+ return !0;
807
+ }
808
+ }
809
+
810
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js
811
+ init_cjs_shims();
812
+ var parseOptionalDef = (def, refs) => {
813
+ if (refs.currentPath.toString() === refs.propertyPath?.toString())
814
+ return parseDef(def.innerType._def, refs);
815
+ let innerSchema = parseDef(def.innerType._def, {
816
+ ...refs,
817
+ currentPath: [...refs.currentPath, "anyOf", "1"]
818
+ });
819
+ return innerSchema ? {
820
+ anyOf: [
821
+ {
822
+ not: parseAnyDef(refs)
823
+ },
824
+ innerSchema
825
+ ]
826
+ } : parseAnyDef(refs);
827
+ };
828
+
829
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js
830
+ init_cjs_shims();
831
+ var parsePipelineDef = (def, refs) => {
832
+ if (refs.pipeStrategy === "input")
833
+ return parseDef(def.in._def, refs);
834
+ if (refs.pipeStrategy === "output")
835
+ return parseDef(def.out._def, refs);
836
+ let a = parseDef(def.in._def, {
837
+ ...refs,
838
+ currentPath: [...refs.currentPath, "allOf", "0"]
839
+ }), b = parseDef(def.out._def, {
840
+ ...refs,
841
+ currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
842
+ });
843
+ return {
844
+ allOf: [a, b].filter((x) => x !== void 0)
845
+ };
846
+ };
847
+
848
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js
849
+ init_cjs_shims();
850
+ function parsePromiseDef(def, refs) {
851
+ return parseDef(def.type._def, refs);
852
+ }
853
+
854
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js
855
+ init_cjs_shims();
856
+ function parseSetDef(def, refs) {
857
+ let schema = {
858
+ type: "array",
859
+ uniqueItems: !0,
860
+ items: parseDef(def.valueType._def, {
861
+ ...refs,
862
+ currentPath: [...refs.currentPath, "items"]
863
+ })
864
+ };
865
+ return def.minSize && setResponseValueAndErrors(schema, "minItems", def.minSize.value, def.minSize.message, refs), def.maxSize && setResponseValueAndErrors(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs), schema;
866
+ }
867
+
868
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js
869
+ init_cjs_shims();
870
+ function parseTupleDef(def, refs) {
871
+ return def.rest ? {
872
+ type: "array",
873
+ minItems: def.items.length,
874
+ items: def.items.map((x, i) => parseDef(x._def, {
875
+ ...refs,
876
+ currentPath: [...refs.currentPath, "items", `${i}`]
877
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], []),
878
+ additionalItems: parseDef(def.rest._def, {
879
+ ...refs,
880
+ currentPath: [...refs.currentPath, "additionalItems"]
881
+ })
882
+ } : {
883
+ type: "array",
884
+ minItems: def.items.length,
885
+ maxItems: def.items.length,
886
+ items: def.items.map((x, i) => parseDef(x._def, {
887
+ ...refs,
888
+ currentPath: [...refs.currentPath, "items", `${i}`]
889
+ })).reduce((acc, x) => x === void 0 ? acc : [...acc, x], [])
890
+ };
891
+ }
892
+
893
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js
894
+ init_cjs_shims();
895
+ function parseUndefinedDef(refs) {
896
+ return {
897
+ not: parseAnyDef(refs)
898
+ };
899
+ }
900
+
901
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js
902
+ init_cjs_shims();
903
+ function parseUnknownDef(refs) {
904
+ return parseAnyDef(refs);
905
+ }
906
+
907
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js
908
+ init_cjs_shims();
909
+ var parseReadonlyDef = (def, refs) => parseDef(def.innerType._def, refs);
910
+
911
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
912
+ var selectParser = (def, typeName, refs) => {
913
+ switch (typeName) {
914
+ case ZodFirstPartyTypeKind.ZodString:
915
+ return parseStringDef(def, refs);
916
+ case ZodFirstPartyTypeKind.ZodNumber:
917
+ return parseNumberDef(def, refs);
918
+ case ZodFirstPartyTypeKind.ZodObject:
919
+ return parseObjectDef(def, refs);
920
+ case ZodFirstPartyTypeKind.ZodBigInt:
921
+ return parseBigintDef(def, refs);
922
+ case ZodFirstPartyTypeKind.ZodBoolean:
923
+ return parseBooleanDef();
924
+ case ZodFirstPartyTypeKind.ZodDate:
925
+ return parseDateDef(def, refs);
926
+ case ZodFirstPartyTypeKind.ZodUndefined:
927
+ return parseUndefinedDef(refs);
928
+ case ZodFirstPartyTypeKind.ZodNull:
929
+ return parseNullDef(refs);
930
+ case ZodFirstPartyTypeKind.ZodArray:
931
+ return parseArrayDef(def, refs);
932
+ case ZodFirstPartyTypeKind.ZodUnion:
933
+ case ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
934
+ return parseUnionDef(def, refs);
935
+ case ZodFirstPartyTypeKind.ZodIntersection:
936
+ return parseIntersectionDef(def, refs);
937
+ case ZodFirstPartyTypeKind.ZodTuple:
938
+ return parseTupleDef(def, refs);
939
+ case ZodFirstPartyTypeKind.ZodRecord:
940
+ return parseRecordDef(def, refs);
941
+ case ZodFirstPartyTypeKind.ZodLiteral:
942
+ return parseLiteralDef(def, refs);
943
+ case ZodFirstPartyTypeKind.ZodEnum:
944
+ return parseEnumDef(def);
945
+ case ZodFirstPartyTypeKind.ZodNativeEnum:
946
+ return parseNativeEnumDef(def);
947
+ case ZodFirstPartyTypeKind.ZodNullable:
948
+ return parseNullableDef(def, refs);
949
+ case ZodFirstPartyTypeKind.ZodOptional:
950
+ return parseOptionalDef(def, refs);
951
+ case ZodFirstPartyTypeKind.ZodMap:
952
+ return parseMapDef(def, refs);
953
+ case ZodFirstPartyTypeKind.ZodSet:
954
+ return parseSetDef(def, refs);
955
+ case ZodFirstPartyTypeKind.ZodLazy:
956
+ return () => def.getter()._def;
957
+ case ZodFirstPartyTypeKind.ZodPromise:
958
+ return parsePromiseDef(def, refs);
959
+ case ZodFirstPartyTypeKind.ZodNaN:
960
+ case ZodFirstPartyTypeKind.ZodNever:
961
+ return parseNeverDef(refs);
962
+ case ZodFirstPartyTypeKind.ZodEffects:
963
+ return parseEffectsDef(def, refs);
964
+ case ZodFirstPartyTypeKind.ZodAny:
965
+ return parseAnyDef(refs);
966
+ case ZodFirstPartyTypeKind.ZodUnknown:
967
+ return parseUnknownDef(refs);
968
+ case ZodFirstPartyTypeKind.ZodDefault:
969
+ return parseDefaultDef(def, refs);
970
+ case ZodFirstPartyTypeKind.ZodBranded:
971
+ return parseBrandedDef(def, refs);
972
+ case ZodFirstPartyTypeKind.ZodReadonly:
973
+ return parseReadonlyDef(def, refs);
974
+ case ZodFirstPartyTypeKind.ZodCatch:
975
+ return parseCatchDef(def, refs);
976
+ case ZodFirstPartyTypeKind.ZodPipeline:
977
+ return parsePipelineDef(def, refs);
978
+ case ZodFirstPartyTypeKind.ZodFunction:
979
+ case ZodFirstPartyTypeKind.ZodVoid:
980
+ case ZodFirstPartyTypeKind.ZodSymbol:
981
+ return;
982
+ default:
983
+ return /* @__PURE__ */ ((_) => {
984
+ })(typeName);
985
+ }
986
+ };
987
+
988
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js
989
+ function parseDef(def, refs, forceResolution = !1) {
990
+ let seenItem = refs.seen.get(def);
991
+ if (refs.override) {
992
+ let overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
993
+ if (overrideResult !== ignoreOverride)
994
+ return overrideResult;
995
+ }
996
+ if (seenItem && !forceResolution) {
997
+ let seenSchema = get$ref(seenItem, refs);
998
+ if (seenSchema !== void 0)
999
+ return seenSchema;
1000
+ }
1001
+ let newItem = { def, path: refs.currentPath, jsonSchema: void 0 };
1002
+ refs.seen.set(def, newItem);
1003
+ let jsonSchemaOrGetter = selectParser(def, def.typeName, refs), jsonSchema = typeof jsonSchemaOrGetter == "function" ? parseDef(jsonSchemaOrGetter(), refs) : jsonSchemaOrGetter;
1004
+ if (jsonSchema && addMeta(def, refs, jsonSchema), refs.postProcess) {
1005
+ let postProcessResult = refs.postProcess(jsonSchema, def, refs);
1006
+ return newItem.jsonSchema = jsonSchema, postProcessResult;
1007
+ }
1008
+ return newItem.jsonSchema = jsonSchema, jsonSchema;
1009
+ }
1010
+ var get$ref = (item, refs) => {
1011
+ switch (refs.$refStrategy) {
1012
+ case "root":
1013
+ return { $ref: item.path.join("/") };
1014
+ case "relative":
1015
+ return { $ref: getRelativePath(refs.currentPath, item.path) };
1016
+ case "none":
1017
+ case "seen":
1018
+ return item.path.length < refs.currentPath.length && item.path.every((value, index) => refs.currentPath[index] === value) ? (console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`), parseAnyDef(refs)) : refs.$refStrategy === "seen" ? parseAnyDef(refs) : void 0;
1019
+ }
1020
+ }, addMeta = (def, refs, jsonSchema) => (def.description && (jsonSchema.description = def.description, refs.markdownDescription && (jsonSchema.markdownDescription = def.description)), jsonSchema);
1021
+
1022
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseTypes.js
1023
+ init_cjs_shims();
1024
+
1025
+ // ../../node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js
1026
+ init_cjs_shims();
1027
+ var zodToJsonSchema = (schema, options) => {
1028
+ let refs = getRefs(options), definitions = typeof options == "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name2, schema2]) => ({
1029
+ ...acc,
1030
+ [name2]: parseDef(schema2._def, {
1031
+ ...refs,
1032
+ currentPath: [...refs.basePath, refs.definitionPath, name2]
1033
+ }, !0) ?? parseAnyDef(refs)
1034
+ }), {}) : void 0, name = typeof options == "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name, main = parseDef(schema._def, name === void 0 ? refs : {
1035
+ ...refs,
1036
+ currentPath: [...refs.basePath, refs.definitionPath, name]
1037
+ }, !1) ?? parseAnyDef(refs), title = typeof options == "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
1038
+ title !== void 0 && (main.title = title), refs.flags.hasReferencedOpenAiAnyType && (definitions || (definitions = {}), definitions[refs.openAiAnyTypeName] || (definitions[refs.openAiAnyTypeName] = {
1039
+ // Skipping "object" as no properties can be defined and additionalProperties must be "false"
1040
+ type: ["string", "number", "integer", "boolean", "array", "null"],
1041
+ items: {
1042
+ $ref: refs.$refStrategy === "relative" ? "1" : [
1043
+ ...refs.basePath,
1044
+ refs.definitionPath,
1045
+ refs.openAiAnyTypeName
1046
+ ].join("/")
1047
+ }
1048
+ }));
1049
+ let combined = name === void 0 ? definitions ? {
1050
+ ...main,
1051
+ [refs.definitionPath]: definitions
1052
+ } : main : {
1053
+ $ref: [
1054
+ ...refs.$refStrategy === "relative" ? [] : refs.basePath,
1055
+ refs.definitionPath,
1056
+ name
1057
+ ].join("/"),
1058
+ [refs.definitionPath]: {
1059
+ ...definitions,
1060
+ [name]: main
1061
+ }
1062
+ };
1063
+ return refs.target === "jsonSchema7" ? combined.$schema = "http://json-schema.org/draft-07/schema#" : (refs.target === "jsonSchema2019-09" || refs.target === "openAi") && (combined.$schema = "https://json-schema.org/draft/2019-09/schema#"), refs.target === "openAi" && ("anyOf" in combined || "oneOf" in combined || "allOf" in combined || "type" in combined && Array.isArray(combined.type)) && console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."), combined;
1064
+ };
1065
+
1066
+ // ../cli-kit/dist/public/node/json-output-schema.js
1067
+ function defineJsonOutputSchema(options) {
1068
+ return {
1069
+ name: options.name,
1070
+ schema: options.schema,
1071
+ definitions: options.definitions ?? {},
1072
+ jsonSchema: zodToJsonSchema(options.schema, {
1073
+ name: options.name,
1074
+ nameStrategy: "title",
1075
+ ...options.definitions ? { definitions: options.definitions } : {},
1076
+ target: "jsonSchema7"
1077
+ }),
1078
+ validate: (value) => options.schema.parse(value),
1079
+ encode: (value) => encodeJsonOutput(options.schema.parse(value))
1080
+ };
1081
+ }
1082
+ function encodeJsonOutput(value) {
1083
+ let encoded = JSON.stringify(value, null, 2);
1084
+ if (encoded === void 0)
1085
+ throw new TypeError("JSON output must be serializable.");
1086
+ return encoded;
1087
+ }
1088
+
1089
+ export {
1090
+ defineJsonOutputSchema
1091
+ };
1092
+ //# sourceMappingURL=chunk-NLC4T4YS.js.map