@statelyai/sdk 0.39.1 → 0.41.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 (35) hide show
  1. package/README.md +10 -0
  2. package/dist/assetStorage.d.mts +1 -1
  3. package/dist/chunk-D1OLi6Wq.mjs +46 -0
  4. package/dist/editorHostProtocol.d.mts +3 -3
  5. package/dist/embed.d.mts +4 -3
  6. package/dist/embed.mjs +10 -3
  7. package/dist/{graph-CfWCJS4m.d.mts → graph-DbZdSisK.d.mts} +1 -1
  8. package/dist/graph.d.mts +1 -1
  9. package/dist/{index-DfMkVP94.d.mts → index-DqF1xP8P.d.mts} +50 -406
  10. package/dist/index.d.mts +5 -5
  11. package/dist/index.mjs +3 -3
  12. package/dist/{inspect-DXtP_tPO.mjs → inspect-CDjr4saL.mjs} +1 -1
  13. package/dist/{inspect-JNvMtuzC.d.mts → inspect-ruD95iBM.d.mts} +1 -1
  14. package/dist/inspect.d.mts +2 -2
  15. package/dist/inspect.mjs +2 -2
  16. package/dist/machineGraph-DYtFKHlq-BpWpGU22.mjs +3 -0
  17. package/dist/machineGraph-DYtFKHlq-ChbeTHlv.mjs +1023 -0
  18. package/dist/patchTypes.d.mts +1 -1
  19. package/dist/{protocol-D3XQmmmv.d.mts → protocol-BvElOcXs.d.mts} +17 -5
  20. package/dist/protocol.d.mts +1 -1
  21. package/dist/relay.d.mts +1 -1
  22. package/dist/rolldown-runtime-95iHPtFO-Bo6l7CbO.mjs +114 -0
  23. package/dist/{studio-DL0yj2Pi.mjs → schemas-DsQ8UYlM.mjs} +36 -1642
  24. package/dist/sourceCoverage.d.mts +101 -0
  25. package/dist/sourceCoverage.mjs +3572 -0
  26. package/dist/studio-DH7OeLao.mjs +1604 -0
  27. package/dist/{studio-ClBs4caM.d.mts → studio-DRw9sxCm.d.mts} +20 -2
  28. package/dist/studio.d.mts +1 -1
  29. package/dist/studio.mjs +1 -1
  30. package/dist/{version-gEUUpYtd.mjs → version-eag6cuvm.mjs} +1 -1
  31. package/dist/xstateSource-BUCx2xA4-CWteIFJn.d.mts +451 -0
  32. package/dist/xstateSource-JvwXWv6G-KnMMoZlG.mjs +151753 -0
  33. package/package.json +9 -5
  34. /package/dist/{editor-sync-types-Ch5P5XRj.d.mts → editor-sync-types-BjgSBGxf.d.mts} +0 -0
  35. /package/dist/{patchTypes-BZ7gzwAP.d.mts → patchTypes-BFlvJTDJ.d.mts} +0 -0
@@ -1,340 +1,5 @@
1
- import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
1
+ import { r as __exportAll } from "./chunk-D1OLi6Wq.mjs";
2
2
 
3
- //#region \0rolldown/runtime.js
4
- var __defProp = Object.defineProperty;
5
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
6
- var __exportAll = (all, no_symbols) => {
7
- let target = {};
8
- for (var name in all) {
9
- __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true
12
- });
13
- }
14
- if (!no_symbols) {
15
- __defProp(target, Symbol.toStringTag, { value: "Module" });
16
- }
17
- return target;
18
- };
19
-
20
- //#endregion
21
- //#region ../../node_modules/.pnpm/@asteasolutions+zod-to-openapi@8.5.0_zod@4.4.3/node_modules/@asteasolutions/zod-to-openapi/dist/index.cjs
22
- var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
23
- /******************************************************************************
24
- Copyright (c) Microsoft Corporation.
25
-
26
- Permission to use, copy, modify, and/or distribute this software for any
27
- purpose with or without fee is hereby granted.
28
-
29
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
30
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
31
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
32
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
33
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
34
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
35
- PERFORMANCE OF THIS SOFTWARE.
36
- ***************************************************************************** */
37
- function __rest(s, e) {
38
- var t = {};
39
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
40
- if (s != null && typeof Object.getOwnPropertySymbols === "function") {
41
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
42
- }
43
- return t;
44
- }
45
- const ZodTypeKeys = {
46
- ZodAny: "any",
47
- ZodArray: "array",
48
- ZodBigInt: "bigint",
49
- ZodBoolean: "boolean",
50
- ZodDefault: "default",
51
- ZodPrefault: "prefault",
52
- ZodTransform: "transform",
53
- ZodEnum: "enum",
54
- ZodIntersection: "intersection",
55
- ZodLazy: "lazy",
56
- ZodLiteral: "literal",
57
- ZodNever: "never",
58
- ZodNull: "null",
59
- ZodNullable: "nullable",
60
- ZodNumber: "number",
61
- ZodNonOptional: "nonoptional",
62
- ZodObject: "object",
63
- ZodOptional: "optional",
64
- ZodPipe: "pipe",
65
- ZodReadonly: "readonly",
66
- ZodRecord: "record",
67
- ZodString: "string",
68
- ZodTuple: "tuple",
69
- ZodType: "type",
70
- ZodUnion: "union",
71
- ZodDiscriminatedUnion: "union",
72
- ZodUnknown: "unknown",
73
- ZodVoid: "void",
74
- ZodDate: "date",
75
- ZodTemplateLiteral: "template_literal"
76
- };
77
- function isZodType(schema, typeNames) {
78
- return (Array.isArray(typeNames) ? typeNames : [typeNames]).some((typeName) => {
79
- var _a;
80
- const typeNameMatch = ((_a = schema === null || schema === void 0 ? void 0 : schema.def) === null || _a === void 0 ? void 0 : _a.type) === ZodTypeKeys[typeName];
81
- if (typeName === "ZodDiscriminatedUnion") return typeNameMatch && "discriminator" in schema.def;
82
- return typeNameMatch;
83
- });
84
- }
85
- function isAnyZodType(schema) {
86
- return schema && "def" in schema;
87
- }
88
- var $ZodRegistry = class {
89
- constructor() {
90
- this._map = /* @__PURE__ */ new Map();
91
- this._idmap = /* @__PURE__ */ new Map();
92
- }
93
- add(schema, ..._meta) {
94
- const meta = _meta[0];
95
- this._map.set(schema, meta);
96
- if (meta && typeof meta === "object" && "id" in meta) {
97
- if (this._idmap.has(meta.id)) throw new Error(`ID ${meta.id} already exists in the registry`);
98
- this._idmap.set(meta.id, schema);
99
- }
100
- return this;
101
- }
102
- clear() {
103
- this._map = /* @__PURE__ */ new Map();
104
- this._idmap = /* @__PURE__ */ new Map();
105
- return this;
106
- }
107
- remove(schema) {
108
- const meta = this._map.get(schema);
109
- if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
110
- this._map.delete(schema);
111
- return this;
112
- }
113
- get(schema) {
114
- const p = schema._zod.parent;
115
- if (p) {
116
- const pm = { ...this.get(p) ?? {} };
117
- delete pm.id;
118
- return {
119
- ...pm,
120
- ...this._map.get(schema)
121
- };
122
- }
123
- return this._map.get(schema);
124
- }
125
- has(schema) {
126
- return this._map.has(schema);
127
- }
128
- };
129
- function registry() {
130
- return new $ZodRegistry();
131
- }
132
- function isUndefined(value) {
133
- return value === void 0;
134
- }
135
- function omit(object, keys) {
136
- const result = {};
137
- Object.entries(object).forEach(([key, value]) => {
138
- if (!keys.some((keyToOmit) => keyToOmit === key)) result[key] = value;
139
- });
140
- return result;
141
- }
142
- function omitBy(object, predicate) {
143
- const result = {};
144
- Object.entries(object).forEach(([key, value]) => {
145
- if (!predicate(value, key)) result[key] = value;
146
- });
147
- return result;
148
- }
149
- /**
150
- * @deprecated This is not really deprecated but this should always be used with
151
- * caution. Using it may alter the behavior of the library and the generated schemas.
152
- */
153
- const zodToOpenAPIRegistry = registry();
154
- var Metadata = class {
155
- static collectMetadata(schema, metadata) {
156
- const currentMetadata = this.getMetadataFromRegistry(schema);
157
- const _internal = Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata._internal), metadata === null || metadata === void 0 ? void 0 : metadata._internal);
158
- const param = Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param), metadata === null || metadata === void 0 ? void 0 : metadata.param);
159
- const totalMetadata = Object.assign(Object.assign(Object.assign(Object.assign({}, Object.keys(_internal).length > 0 ? { _internal } : {}), currentMetadata), metadata), Object.keys(param).length > 0 ? { param } : {});
160
- if (isZodType(schema, [
161
- "ZodOptional",
162
- "ZodNullable",
163
- "ZodDefault",
164
- "ZodPrefault",
165
- "ZodReadonly",
166
- "ZodNonOptional"
167
- ]) && isAnyZodType(schema._zod.def.innerType)) return this.collectMetadata(schema._zod.def.innerType, totalMetadata);
168
- if (isZodType(schema, "ZodPipe")) {
169
- const inSchema = schema._zod.def.in;
170
- const outSchema = schema._zod.def.out;
171
- if (isZodType(inSchema, "ZodTransform") && isAnyZodType(outSchema)) return this.collectMetadata(outSchema, totalMetadata);
172
- if (isAnyZodType(inSchema)) return this.collectMetadata(inSchema, totalMetadata);
173
- }
174
- return totalMetadata;
175
- }
176
- /**
177
- * @deprecated Use one of `getOpenApiMetadata` or `getInternalMetadata` instead
178
- */
179
- static getMetadata(zodSchema) {
180
- return this.collectMetadata(zodSchema);
181
- }
182
- static getOpenApiMetadata(zodSchema) {
183
- const metadata = this.collectMetadata(zodSchema);
184
- const _a = metadata !== null && metadata !== void 0 ? metadata : {}, { _internal } = _a;
185
- return __rest(_a, ["_internal"]);
186
- }
187
- static getInternalMetadata(zodSchema) {
188
- var _a;
189
- return (_a = this.collectMetadata(zodSchema)) === null || _a === void 0 ? void 0 : _a._internal;
190
- }
191
- static getParamMetadata(zodSchema) {
192
- const metadata = this.collectMetadata(zodSchema);
193
- return Object.assign(Object.assign({}, metadata), { param: Object.assign(Object.assign({}, (metadata === null || metadata === void 0 ? void 0 : metadata.description) ? { description: metadata.description } : {}), metadata === null || metadata === void 0 ? void 0 : metadata.param) });
194
- }
195
- /**
196
- * A method that omits all custom keys added to the regular OpenAPI
197
- * metadata properties
198
- */
199
- static buildSchemaMetadata(metadata) {
200
- return omitBy(omit(metadata, ["param", "_internal"]), isUndefined);
201
- }
202
- static buildParameterMetadata(metadata) {
203
- return omitBy(metadata, isUndefined);
204
- }
205
- static applySchemaMetadata(initialData, metadata) {
206
- return omitBy(Object.assign(Object.assign({}, initialData), this.buildSchemaMetadata(metadata)), isUndefined);
207
- }
208
- static getRefId(zodSchema) {
209
- var _a;
210
- return (_a = this.getInternalMetadata(zodSchema)) === null || _a === void 0 ? void 0 : _a.refId;
211
- }
212
- static unwrapChained(schema) {
213
- return this.unwrapUntil(schema);
214
- }
215
- static getDefaultValue(zodSchema) {
216
- var _a;
217
- const unwrapped = (_a = this.unwrapUntil(zodSchema, "ZodDefault")) !== null && _a !== void 0 ? _a : this.unwrapUntil(zodSchema, "ZodPrefault");
218
- return unwrapped === null || unwrapped === void 0 ? void 0 : unwrapped._zod.def.defaultValue;
219
- }
220
- static unwrapUntil(schema, typeName) {
221
- if (typeName && isZodType(schema, typeName)) return schema;
222
- if (isZodType(schema, [
223
- "ZodOptional",
224
- "ZodNullable",
225
- "ZodDefault",
226
- "ZodPrefault",
227
- "ZodReadonly",
228
- "ZodNonOptional"
229
- ]) && isAnyZodType(schema._zod.def.innerType)) return this.unwrapUntil(schema._zod.def.innerType, typeName);
230
- if (isZodType(schema, "ZodPipe")) {
231
- const inSchema = schema._zod.def.in;
232
- const outSchema = schema._zod.def.out;
233
- if (isZodType(inSchema, "ZodTransform") && isAnyZodType(outSchema)) return this.unwrapUntil(outSchema, typeName);
234
- if (isAnyZodType(inSchema)) return this.unwrapUntil(inSchema, typeName);
235
- }
236
- return typeName ? void 0 : schema;
237
- }
238
- static getMetadataFromInternalRegistry(zodSchema) {
239
- return zodToOpenAPIRegistry.get(zodSchema);
240
- }
241
- static getMetadataFromRegistry(zodSchema) {
242
- const internal = this.getMetadataFromInternalRegistry(zodSchema);
243
- const general = zodSchema.meta();
244
- if (!internal) return general;
245
- const { _internal } = internal, rest = __rest(internal, ["_internal"]);
246
- const _a = general !== null && general !== void 0 ? general : {}, { id, title } = _a, restGeneral = __rest(_a, ["id", "title"]);
247
- return Object.assign(Object.assign(Object.assign({ _internal: Object.assign(Object.assign({}, id ? { refId: id } : {}), _internal) }, rest), title ? { description: title } : {}), restGeneral);
248
- }
249
- static setMetadataInRegistry(zodSchema, metadata) {
250
- zodToOpenAPIRegistry.add(zodSchema, metadata);
251
- }
252
- };
253
- function preserveMetadataFromModifier(zodSchema, modifier) {
254
- const zodModifier = zodSchema[modifier];
255
- if (typeof zodModifier !== "function") return;
256
- zodSchema[modifier] = function(...args) {
257
- const result = zodModifier.apply(this, args);
258
- const meta = Metadata.getMetadataFromRegistry(this);
259
- if (meta) Metadata.setMetadataInRegistry(result, meta);
260
- return result;
261
- };
262
- }
263
- function extendZodWithOpenApi(zod) {
264
- if (typeof zod.ZodType.prototype.openapi !== "undefined") return;
265
- zod.ZodType.prototype.openapi = function(...args) {
266
- const { refId, metadata, options } = getOpenApiConfiguration(...args);
267
- const _a = metadata !== null && metadata !== void 0 ? metadata : {}, { param } = _a, restOfOpenApi = __rest(_a, ["param"]);
268
- const allMetadata = Metadata.getMetadataFromRegistry(this);
269
- const _b = allMetadata !== null && allMetadata !== void 0 ? allMetadata : {}, { _internal: internalMetadata } = _b, currentMetadata = __rest(_b, ["_internal"]);
270
- const _internal = Object.assign(Object.assign(Object.assign({}, internalMetadata), options), refId ? { refId } : void 0);
271
- const resultMetadata = Object.assign(Object.assign(Object.assign({}, currentMetadata), restOfOpenApi), (currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param) || param ? { param: Object.assign(Object.assign({}, currentMetadata === null || currentMetadata === void 0 ? void 0 : currentMetadata.param), param) } : void 0);
272
- const result = new this.constructor(this._def);
273
- function setMetadata(schema) {
274
- Metadata.setMetadataInRegistry(schema, Object.assign(Object.assign({}, Object.keys(_internal).length > 0 ? { _internal } : void 0), resultMetadata));
275
- }
276
- setMetadata(result);
277
- /**
278
- * In order to handle z.json() which is implemented as:
279
- *
280
- * const jsonSchema = lazy(() => { return union([ ... ]) });
281
- * return jsonSchema;
282
- *
283
- * We need to not only set the metadata to the resulting schema (which would be different
284
- * from `jsonSchema`), but also to the original lazy schema so that the _internal metadata (refId)
285
- * is also present in the internally used `jsonSchema`.
286
- */
287
- if (isZodType(result, "ZodLazy")) setMetadata(this);
288
- if (isZodType(result, "ZodObject")) {
289
- const currentMetadata = Metadata.getMetadataFromRegistry(result);
290
- const originalExtend = result.extend;
291
- result.extend = function(...args) {
292
- const extendedResult = originalExtend.apply(result, args);
293
- const _a = currentMetadata !== null && currentMetadata !== void 0 ? currentMetadata : {}, { _internal } = _a, rest = __rest(_a, ["_internal"]);
294
- Metadata.setMetadataInRegistry(extendedResult, { _internal: { extendedFrom: (_internal === null || _internal === void 0 ? void 0 : _internal.refId) ? {
295
- refId: _internal.refId,
296
- schema: result
297
- } : _internal === null || _internal === void 0 ? void 0 : _internal.extendedFrom } });
298
- return extendedResult.openapi(rest);
299
- };
300
- preserveMetadataFromModifier(result, "catchall");
301
- }
302
- preserveMetadataFromModifier(result, "optional");
303
- preserveMetadataFromModifier(result, "nullable");
304
- preserveMetadataFromModifier(result, "default");
305
- preserveMetadataFromModifier(result, "transform");
306
- preserveMetadataFromModifier(result, "refine");
307
- preserveMetadataFromModifier(result, "length");
308
- preserveMetadataFromModifier(result, "min");
309
- preserveMetadataFromModifier(result, "max");
310
- const originalMeta = result.meta;
311
- result.meta = function(...args) {
312
- const result = originalMeta.apply(this, args);
313
- if (args[0]) {
314
- const meta = Metadata.getMetadataFromInternalRegistry(this);
315
- if (meta) Metadata.setMetadataInRegistry(result, Object.assign(Object.assign({}, meta), args[0]));
316
- }
317
- return result;
318
- };
319
- return result;
320
- };
321
- }
322
- function getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {
323
- if (typeof refOrOpenapi === "string") return {
324
- refId: refOrOpenapi,
325
- metadata: metadataOrOptions,
326
- options
327
- };
328
- return {
329
- refId: void 0,
330
- metadata: refOrOpenapi,
331
- options: metadataOrOptions
332
- };
333
- }
334
- exports.extendZodWithOpenApi = extendZodWithOpenApi;
335
- }));
336
-
337
- //#endregion
338
3
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
339
4
  var _a$1;
340
5
  /** A special constant with type `never` */
@@ -1228,14 +893,14 @@ const safeDecodeAsync$1 = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
1228
893
  var regexes_exports = /* @__PURE__ */ __exportAll({
1229
894
  base64: () => base64$1,
1230
895
  base64url: () => base64url$1,
1231
- bigint: () => bigint$2,
1232
- boolean: () => boolean$2,
896
+ bigint: () => bigint$1,
897
+ boolean: () => boolean$1,
1233
898
  browserEmail: () => browserEmail,
1234
899
  cidrv4: () => cidrv4$1,
1235
900
  cidrv6: () => cidrv6$1,
1236
901
  cuid: () => cuid$1,
1237
902
  cuid2: () => cuid2$1,
1238
- date: () => date$3,
903
+ date: () => date$2,
1239
904
  datetime: () => datetime$1,
1240
905
  domain: () => domain,
1241
906
  duration: () => duration$1,
@@ -1260,7 +925,7 @@ var regexes_exports = /* @__PURE__ */ __exportAll({
1260
925
  md5_hex: () => md5_hex,
1261
926
  nanoid: () => nanoid$1,
1262
927
  null: () => _null$2,
1263
- number: () => number$2,
928
+ number: () => number$1,
1264
929
  rfc5322Email: () => rfc5322Email,
1265
930
  sha1_base64: () => sha1_base64,
1266
931
  sha1_base64url: () => sha1_base64url,
@@ -1274,7 +939,7 @@ var regexes_exports = /* @__PURE__ */ __exportAll({
1274
939
  sha512_base64: () => sha512_base64,
1275
940
  sha512_base64url: () => sha512_base64url,
1276
941
  sha512_hex: () => sha512_hex,
1277
- string: () => string$2,
942
+ string: () => string$1,
1278
943
  time: () => time$1,
1279
944
  ulid: () => ulid$1,
1280
945
  undefined: () => _undefined$2,
@@ -1342,7 +1007,7 @@ const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$
1342
1007
  const httpProtocol = /^https?$/;
1343
1008
  const e164$1 = /^\+[1-9]\d{6,14}$/;
1344
1009
  const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
1345
- const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
1010
+ const date$2 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
1346
1011
  function timeSource(args) {
1347
1012
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
1348
1013
  return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -1358,14 +1023,14 @@ function datetime$1(args) {
1358
1023
  const timeRegex = `${time}(?:${opts.join("|")})`;
1359
1024
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
1360
1025
  }
1361
- const string$2 = (params) => {
1026
+ const string$1 = (params) => {
1362
1027
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
1363
1028
  return new RegExp(`^${regex}$`);
1364
1029
  };
1365
- const bigint$2 = /^-?\d+n?$/;
1030
+ const bigint$1 = /^-?\d+n?$/;
1366
1031
  const integer = /^-?\d+$/;
1367
- const number$2 = /^-?\d+(?:\.\d+)?$/;
1368
- const boolean$2 = /^(?:true|false)$/i;
1032
+ const number$1 = /^-?\d+(?:\.\d+)?$/;
1033
+ const boolean$1 = /^(?:true|false)$/i;
1369
1034
  const _null$2 = /^null$/i;
1370
1035
  const _undefined$2 = /^undefined$/i;
1371
1036
  const lowercase = /^[^A-Z]*$/;
@@ -2032,7 +1697,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2032
1697
  });
2033
1698
  const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
2034
1699
  $ZodType.init(inst, def);
2035
- inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$2(inst._zod.bag);
1700
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
2036
1701
  inst._zod.parse = (payload, _) => {
2037
1702
  if (def.coerce) try {
2038
1703
  payload.value = String(payload.value);
@@ -2171,7 +1836,7 @@ const $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, d
2171
1836
  $ZodStringFormat.init(inst, def);
2172
1837
  });
2173
1838
  const $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
2174
- def.pattern ?? (def.pattern = date$3);
1839
+ def.pattern ?? (def.pattern = date$2);
2175
1840
  $ZodStringFormat.init(inst, def);
2176
1841
  });
2177
1842
  const $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
@@ -2331,7 +1996,7 @@ const $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFor
2331
1996
  });
2332
1997
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
2333
1998
  $ZodType.init(inst, def);
2334
- inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
1999
+ inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
2335
2000
  inst._zod.parse = (payload, _ctx) => {
2336
2001
  if (def.coerce) try {
2337
2002
  payload.value = Number(payload.value);
@@ -2355,7 +2020,7 @@ const $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst,
2355
2020
  });
2356
2021
  const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
2357
2022
  $ZodType.init(inst, def);
2358
- inst._zod.pattern = boolean$2;
2023
+ inst._zod.pattern = boolean$1;
2359
2024
  inst._zod.parse = (payload, _ctx) => {
2360
2025
  if (def.coerce) try {
2361
2026
  payload.value = Boolean(payload.value);
@@ -2373,7 +2038,7 @@ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
2373
2038
  });
2374
2039
  const $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
2375
2040
  $ZodType.init(inst, def);
2376
- inst._zod.pattern = bigint$2;
2041
+ inst._zod.pattern = bigint$1;
2377
2042
  inst._zod.parse = (payload, _ctx) => {
2378
2043
  if (def.coerce) try {
2379
2044
  payload.value = BigInt(payload.value);
@@ -3183,7 +2848,7 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
3183
2848
  issues: []
3184
2849
  }, ctx);
3185
2850
  if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
3186
- if (typeof key === "string" && number$2.test(key) && keyResult.issues.length) {
2851
+ if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
3187
2852
  const retryResult = def.keyType._zod.run({
3188
2853
  value: Number(key),
3189
2854
  issues: []
@@ -11773,7 +11438,7 @@ var iso_exports = /* @__PURE__ */ __exportAll({
11773
11438
  ZodISODateTime: () => ZodISODateTime,
11774
11439
  ZodISODuration: () => ZodISODuration,
11775
11440
  ZodISOTime: () => ZodISOTime,
11776
- date: () => date$2,
11441
+ date: () => date$1,
11777
11442
  datetime: () => datetime,
11778
11443
  duration: () => duration,
11779
11444
  time: () => time
@@ -11789,7 +11454,7 @@ const ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
11789
11454
  $ZodISODate.init(inst, def);
11790
11455
  ZodStringFormat.init(inst, def);
11791
11456
  });
11792
- function date$2(params) {
11457
+ function date$1(params) {
11793
11458
  return _isoDate(ZodISODate, params);
11794
11459
  }
11795
11460
  const ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
@@ -11925,8 +11590,8 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
11925
11590
  array: () => array,
11926
11591
  base64: () => base64,
11927
11592
  base64url: () => base64url,
11928
- bigint: () => bigint$1,
11929
- boolean: () => boolean$1,
11593
+ bigint: () => bigint,
11594
+ boolean: () => boolean,
11930
11595
  catch: () => _catch,
11931
11596
  check: () => check,
11932
11597
  cidrv4: () => cidrv4,
@@ -11935,7 +11600,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
11935
11600
  cuid: () => cuid,
11936
11601
  cuid2: () => cuid2,
11937
11602
  custom: () => custom,
11938
- date: () => date$1,
11603
+ date: () => date,
11939
11604
  describe: () => describe,
11940
11605
  discriminatedUnion: () => discriminatedUnion,
11941
11606
  e164: () => e164,
@@ -11979,7 +11644,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
11979
11644
  null: () => _null,
11980
11645
  nullable: () => nullable,
11981
11646
  nullish: () => nullish,
11982
- number: () => number$1,
11647
+ number: () => number,
11983
11648
  object: () => object,
11984
11649
  optional: () => optional,
11985
11650
  partialRecord: () => partialRecord,
@@ -11992,7 +11657,7 @@ var schemas_exports = /* @__PURE__ */ __exportAll({
11992
11657
  refine: () => refine,
11993
11658
  set: () => set,
11994
11659
  strictObject: () => strictObject,
11995
- string: () => string$1,
11660
+ string: () => string,
11996
11661
  stringFormat: () => stringFormat,
11997
11662
  stringbool: () => stringbool,
11998
11663
  success: () => success,
@@ -12261,11 +11926,11 @@ const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
12261
11926
  inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
12262
11927
  inst.e164 = (params) => inst.check(_e164(ZodE164, params));
12263
11928
  inst.datetime = (params) => inst.check(datetime(params));
12264
- inst.date = (params) => inst.check(date$2(params));
11929
+ inst.date = (params) => inst.check(date$1(params));
12265
11930
  inst.time = (params) => inst.check(time(params));
12266
11931
  inst.duration = (params) => inst.check(duration(params));
12267
11932
  });
12268
- function string$1(params) {
11933
+ function string(params) {
12269
11934
  return _string(ZodString, params);
12270
11935
  }
12271
11936
  const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
@@ -12517,7 +12182,7 @@ const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
12517
12182
  inst.isFinite = true;
12518
12183
  inst.format = bag.format ?? null;
12519
12184
  });
12520
- function number$1(params) {
12185
+ function number(params) {
12521
12186
  return _number(ZodNumber, params);
12522
12187
  }
12523
12188
  const ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
@@ -12544,7 +12209,7 @@ const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
12544
12209
  ZodType.init(inst, def);
12545
12210
  inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
12546
12211
  });
12547
- function boolean$1(params) {
12212
+ function boolean(params) {
12548
12213
  return _boolean(ZodBoolean, params);
12549
12214
  }
12550
12215
  const ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
@@ -12569,7 +12234,7 @@ const ZodBigInt = /* @__PURE__ */ $constructor("ZodBigInt", (inst, def) => {
12569
12234
  inst.maxValue = bag.maximum ?? null;
12570
12235
  inst.format = bag.format ?? null;
12571
12236
  });
12572
- function bigint$1(params) {
12237
+ function bigint(params) {
12573
12238
  return _bigint(ZodBigInt, params);
12574
12239
  }
12575
12240
  const ZodBigIntFormat = /* @__PURE__ */ $constructor("ZodBigIntFormat", (inst, def) => {
@@ -12648,7 +12313,7 @@ const ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
12648
12313
  inst.minDate = c.minimum ? new Date(c.minimum) : null;
12649
12314
  inst.maxDate = c.maximum ? new Date(c.maximum) : null;
12650
12315
  });
12651
- function date$1(params) {
12316
+ function date(params) {
12652
12317
  return _date(ZodDate, params);
12653
12318
  }
12654
12319
  const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
@@ -12851,7 +12516,7 @@ const ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
12851
12516
  function record(keyType, valueType, params) {
12852
12517
  if (!valueType || !valueType._zod) return new ZodRecord({
12853
12518
  type: "record",
12854
- keyType: string$1(),
12519
+ keyType: string(),
12855
12520
  valueType: keyType,
12856
12521
  ...normalizeParams(valueType)
12857
12522
  });
@@ -13296,12 +12961,12 @@ const stringbool = (...args) => _stringbool({
13296
12961
  function json(params) {
13297
12962
  const jsonSchema = lazy(() => {
13298
12963
  return union([
13299
- string$1(params),
13300
- number$1(),
13301
- boolean$1(),
12964
+ string(params),
12965
+ number(),
12966
+ boolean(),
13302
12967
  _null(),
13303
12968
  array(jsonSchema),
13304
- record(string$1(), jsonSchema)
12969
+ record(string(), jsonSchema)
13305
12970
  ]);
13306
12971
  });
13307
12972
  return jsonSchema;
@@ -13315,1275 +12980,4 @@ function preprocess(fn, schema) {
13315
12980
  }
13316
12981
 
13317
12982
  //#endregion
13318
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/compat.js
13319
- /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
13320
- const ZodIssueCode = {
13321
- invalid_type: "invalid_type",
13322
- too_big: "too_big",
13323
- too_small: "too_small",
13324
- invalid_format: "invalid_format",
13325
- not_multiple_of: "not_multiple_of",
13326
- unrecognized_keys: "unrecognized_keys",
13327
- invalid_union: "invalid_union",
13328
- invalid_key: "invalid_key",
13329
- invalid_element: "invalid_element",
13330
- invalid_value: "invalid_value",
13331
- custom: "custom"
13332
- };
13333
- /** @deprecated Use `z.config(params)` instead. */
13334
- function setErrorMap(map) {
13335
- config({ customError: map });
13336
- }
13337
- /** @deprecated Use `z.config()` instead. */
13338
- function getErrorMap() {
13339
- return config().customError;
13340
- }
13341
- /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
13342
- var ZodFirstPartyTypeKind;
13343
- (function(ZodFirstPartyTypeKind) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
13344
-
13345
- //#endregion
13346
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/from-json-schema.js
13347
- const z = {
13348
- ...schemas_exports,
13349
- ...checks_exports,
13350
- iso: iso_exports
13351
- };
13352
- const RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
13353
- "$schema",
13354
- "$ref",
13355
- "$defs",
13356
- "definitions",
13357
- "$id",
13358
- "id",
13359
- "$comment",
13360
- "$anchor",
13361
- "$vocabulary",
13362
- "$dynamicRef",
13363
- "$dynamicAnchor",
13364
- "type",
13365
- "enum",
13366
- "const",
13367
- "anyOf",
13368
- "oneOf",
13369
- "allOf",
13370
- "not",
13371
- "properties",
13372
- "required",
13373
- "additionalProperties",
13374
- "patternProperties",
13375
- "propertyNames",
13376
- "minProperties",
13377
- "maxProperties",
13378
- "items",
13379
- "prefixItems",
13380
- "additionalItems",
13381
- "minItems",
13382
- "maxItems",
13383
- "uniqueItems",
13384
- "contains",
13385
- "minContains",
13386
- "maxContains",
13387
- "minLength",
13388
- "maxLength",
13389
- "pattern",
13390
- "format",
13391
- "minimum",
13392
- "maximum",
13393
- "exclusiveMinimum",
13394
- "exclusiveMaximum",
13395
- "multipleOf",
13396
- "description",
13397
- "default",
13398
- "contentEncoding",
13399
- "contentMediaType",
13400
- "contentSchema",
13401
- "unevaluatedItems",
13402
- "unevaluatedProperties",
13403
- "if",
13404
- "then",
13405
- "else",
13406
- "dependentSchemas",
13407
- "dependentRequired",
13408
- "nullable",
13409
- "readOnly"
13410
- ]);
13411
- function detectVersion(schema, defaultTarget) {
13412
- const $schema = schema.$schema;
13413
- if ($schema === "https://json-schema.org/draft/2020-12/schema") return "draft-2020-12";
13414
- if ($schema === "http://json-schema.org/draft-07/schema#") return "draft-7";
13415
- if ($schema === "http://json-schema.org/draft-04/schema#") return "draft-4";
13416
- return defaultTarget ?? "draft-2020-12";
13417
- }
13418
- function resolveRef(ref, ctx) {
13419
- if (!ref.startsWith("#")) throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
13420
- const path = ref.slice(1).split("/").filter(Boolean);
13421
- if (path.length === 0) return ctx.rootSchema;
13422
- const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
13423
- if (path[0] === defsKey) {
13424
- const key = path[1];
13425
- if (!key || !ctx.defs[key]) throw new Error(`Reference not found: ${ref}`);
13426
- return ctx.defs[key];
13427
- }
13428
- throw new Error(`Reference not found: ${ref}`);
13429
- }
13430
- function convertBaseSchema(schema, ctx) {
13431
- if (schema.not !== void 0) {
13432
- if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) return z.never();
13433
- throw new Error("not is not supported in Zod (except { not: {} } for never)");
13434
- }
13435
- if (schema.unevaluatedItems !== void 0) throw new Error("unevaluatedItems is not supported");
13436
- if (schema.unevaluatedProperties !== void 0) throw new Error("unevaluatedProperties is not supported");
13437
- if (schema.if !== void 0 || schema.then !== void 0 || schema.else !== void 0) throw new Error("Conditional schemas (if/then/else) are not supported");
13438
- if (schema.dependentSchemas !== void 0 || schema.dependentRequired !== void 0) throw new Error("dependentSchemas and dependentRequired are not supported");
13439
- if (schema.$ref) {
13440
- const refPath = schema.$ref;
13441
- if (ctx.refs.has(refPath)) return ctx.refs.get(refPath);
13442
- if (ctx.processing.has(refPath)) return z.lazy(() => {
13443
- if (!ctx.refs.has(refPath)) throw new Error(`Circular reference not resolved: ${refPath}`);
13444
- return ctx.refs.get(refPath);
13445
- });
13446
- ctx.processing.add(refPath);
13447
- const zodSchema = convertSchema(resolveRef(refPath, ctx), ctx);
13448
- ctx.refs.set(refPath, zodSchema);
13449
- ctx.processing.delete(refPath);
13450
- return zodSchema;
13451
- }
13452
- if (schema.enum !== void 0) {
13453
- const enumValues = schema.enum;
13454
- if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) return z.null();
13455
- if (enumValues.length === 0) return z.never();
13456
- if (enumValues.length === 1) return z.literal(enumValues[0]);
13457
- if (enumValues.every((v) => typeof v === "string")) return z.enum(enumValues);
13458
- const literalSchemas = enumValues.map((v) => z.literal(v));
13459
- if (literalSchemas.length < 2) return literalSchemas[0];
13460
- return z.union([
13461
- literalSchemas[0],
13462
- literalSchemas[1],
13463
- ...literalSchemas.slice(2)
13464
- ]);
13465
- }
13466
- if (schema.const !== void 0) return z.literal(schema.const);
13467
- const type = schema.type;
13468
- if (Array.isArray(type)) {
13469
- const typeSchemas = type.map((t) => {
13470
- return convertBaseSchema({
13471
- ...schema,
13472
- type: t
13473
- }, ctx);
13474
- });
13475
- if (typeSchemas.length === 0) return z.never();
13476
- if (typeSchemas.length === 1) return typeSchemas[0];
13477
- return z.union(typeSchemas);
13478
- }
13479
- if (!type) return z.any();
13480
- let zodSchema;
13481
- switch (type) {
13482
- case "string": {
13483
- let stringSchema = z.string();
13484
- if (schema.format) {
13485
- const format = schema.format;
13486
- if (format === "email") stringSchema = stringSchema.check(z.email());
13487
- else if (format === "uri" || format === "uri-reference") stringSchema = stringSchema.check(z.url());
13488
- else if (format === "uuid" || format === "guid") stringSchema = stringSchema.check(z.uuid());
13489
- else if (format === "date-time") stringSchema = stringSchema.check(z.iso.datetime());
13490
- else if (format === "date") stringSchema = stringSchema.check(z.iso.date());
13491
- else if (format === "time") stringSchema = stringSchema.check(z.iso.time());
13492
- else if (format === "duration") stringSchema = stringSchema.check(z.iso.duration());
13493
- else if (format === "ipv4") stringSchema = stringSchema.check(z.ipv4());
13494
- else if (format === "ipv6") stringSchema = stringSchema.check(z.ipv6());
13495
- else if (format === "mac") stringSchema = stringSchema.check(z.mac());
13496
- else if (format === "cidr") stringSchema = stringSchema.check(z.cidrv4());
13497
- else if (format === "cidr-v6") stringSchema = stringSchema.check(z.cidrv6());
13498
- else if (format === "base64") stringSchema = stringSchema.check(z.base64());
13499
- else if (format === "base64url") stringSchema = stringSchema.check(z.base64url());
13500
- else if (format === "e164") stringSchema = stringSchema.check(z.e164());
13501
- else if (format === "jwt") stringSchema = stringSchema.check(z.jwt());
13502
- else if (format === "emoji") stringSchema = stringSchema.check(z.emoji());
13503
- else if (format === "nanoid") stringSchema = stringSchema.check(z.nanoid());
13504
- else if (format === "cuid") stringSchema = stringSchema.check(z.cuid());
13505
- else if (format === "cuid2") stringSchema = stringSchema.check(z.cuid2());
13506
- else if (format === "ulid") stringSchema = stringSchema.check(z.ulid());
13507
- else if (format === "xid") stringSchema = stringSchema.check(z.xid());
13508
- else if (format === "ksuid") stringSchema = stringSchema.check(z.ksuid());
13509
- }
13510
- if (typeof schema.minLength === "number") stringSchema = stringSchema.min(schema.minLength);
13511
- if (typeof schema.maxLength === "number") stringSchema = stringSchema.max(schema.maxLength);
13512
- if (schema.pattern) stringSchema = stringSchema.regex(new RegExp(schema.pattern));
13513
- zodSchema = stringSchema;
13514
- break;
13515
- }
13516
- case "number":
13517
- case "integer": {
13518
- let numberSchema = type === "integer" ? z.number().int() : z.number();
13519
- if (typeof schema.minimum === "number") numberSchema = numberSchema.min(schema.minimum);
13520
- if (typeof schema.maximum === "number") numberSchema = numberSchema.max(schema.maximum);
13521
- if (typeof schema.exclusiveMinimum === "number") numberSchema = numberSchema.gt(schema.exclusiveMinimum);
13522
- else if (schema.exclusiveMinimum === true && typeof schema.minimum === "number") numberSchema = numberSchema.gt(schema.minimum);
13523
- if (typeof schema.exclusiveMaximum === "number") numberSchema = numberSchema.lt(schema.exclusiveMaximum);
13524
- else if (schema.exclusiveMaximum === true && typeof schema.maximum === "number") numberSchema = numberSchema.lt(schema.maximum);
13525
- if (typeof schema.multipleOf === "number") numberSchema = numberSchema.multipleOf(schema.multipleOf);
13526
- zodSchema = numberSchema;
13527
- break;
13528
- }
13529
- case "boolean":
13530
- zodSchema = z.boolean();
13531
- break;
13532
- case "null":
13533
- zodSchema = z.null();
13534
- break;
13535
- case "object": {
13536
- const shape = {};
13537
- const properties = schema.properties || {};
13538
- const requiredSet = new Set(schema.required || []);
13539
- for (const [key, propSchema] of Object.entries(properties)) {
13540
- const propZodSchema = convertSchema(propSchema, ctx);
13541
- shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();
13542
- }
13543
- if (schema.propertyNames) {
13544
- const keySchema = convertSchema(schema.propertyNames, ctx);
13545
- const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z.any();
13546
- if (Object.keys(shape).length === 0) {
13547
- zodSchema = z.record(keySchema, valueSchema);
13548
- break;
13549
- }
13550
- const objectSchema = z.object(shape).passthrough();
13551
- const recordSchema = z.looseRecord(keySchema, valueSchema);
13552
- zodSchema = z.intersection(objectSchema, recordSchema);
13553
- break;
13554
- }
13555
- if (schema.patternProperties) {
13556
- const patternProps = schema.patternProperties;
13557
- const patternKeys = Object.keys(patternProps);
13558
- const looseRecords = [];
13559
- for (const pattern of patternKeys) {
13560
- const patternValue = convertSchema(patternProps[pattern], ctx);
13561
- const keySchema = z.string().regex(new RegExp(pattern));
13562
- looseRecords.push(z.looseRecord(keySchema, patternValue));
13563
- }
13564
- const schemasToIntersect = [];
13565
- if (Object.keys(shape).length > 0) schemasToIntersect.push(z.object(shape).passthrough());
13566
- schemasToIntersect.push(...looseRecords);
13567
- if (schemasToIntersect.length === 0) zodSchema = z.object({}).passthrough();
13568
- else if (schemasToIntersect.length === 1) zodSchema = schemasToIntersect[0];
13569
- else {
13570
- let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);
13571
- for (let i = 2; i < schemasToIntersect.length; i++) result = z.intersection(result, schemasToIntersect[i]);
13572
- zodSchema = result;
13573
- }
13574
- break;
13575
- }
13576
- const objectSchema = z.object(shape);
13577
- if (schema.additionalProperties === false) zodSchema = objectSchema.strict();
13578
- else if (typeof schema.additionalProperties === "object") zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));
13579
- else zodSchema = objectSchema.passthrough();
13580
- break;
13581
- }
13582
- case "array": {
13583
- const prefixItems = schema.prefixItems;
13584
- const items = schema.items;
13585
- if (prefixItems && Array.isArray(prefixItems)) {
13586
- const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
13587
- const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
13588
- if (rest) zodSchema = z.tuple(tupleItems).rest(rest);
13589
- else zodSchema = z.tuple(tupleItems);
13590
- if (typeof schema.minItems === "number") zodSchema = zodSchema.check(z.minLength(schema.minItems));
13591
- if (typeof schema.maxItems === "number") zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
13592
- } else if (Array.isArray(items)) {
13593
- const tupleItems = items.map((item) => convertSchema(item, ctx));
13594
- const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
13595
- if (rest) zodSchema = z.tuple(tupleItems).rest(rest);
13596
- else zodSchema = z.tuple(tupleItems);
13597
- if (typeof schema.minItems === "number") zodSchema = zodSchema.check(z.minLength(schema.minItems));
13598
- if (typeof schema.maxItems === "number") zodSchema = zodSchema.check(z.maxLength(schema.maxItems));
13599
- } else if (items !== void 0) {
13600
- const element = convertSchema(items, ctx);
13601
- let arraySchema = z.array(element);
13602
- if (typeof schema.minItems === "number") arraySchema = arraySchema.min(schema.minItems);
13603
- if (typeof schema.maxItems === "number") arraySchema = arraySchema.max(schema.maxItems);
13604
- zodSchema = arraySchema;
13605
- } else zodSchema = z.array(z.any());
13606
- break;
13607
- }
13608
- default: throw new Error(`Unsupported type: ${type}`);
13609
- }
13610
- return zodSchema;
13611
- }
13612
- function convertSchema(schema, ctx) {
13613
- if (typeof schema === "boolean") return schema ? z.any() : z.never();
13614
- let baseSchema = convertBaseSchema(schema, ctx);
13615
- const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
13616
- if (schema.anyOf && Array.isArray(schema.anyOf)) {
13617
- const options = schema.anyOf.map((s) => convertSchema(s, ctx));
13618
- const anyOfUnion = z.union(options);
13619
- baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
13620
- }
13621
- if (schema.oneOf && Array.isArray(schema.oneOf)) {
13622
- const options = schema.oneOf.map((s) => convertSchema(s, ctx));
13623
- const oneOfUnion = z.xor(options);
13624
- baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
13625
- }
13626
- if (schema.allOf && Array.isArray(schema.allOf)) if (schema.allOf.length === 0) baseSchema = hasExplicitType ? baseSchema : z.any();
13627
- else {
13628
- let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
13629
- const startIdx = hasExplicitType ? 0 : 1;
13630
- for (let i = startIdx; i < schema.allOf.length; i++) result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
13631
- baseSchema = result;
13632
- }
13633
- if (schema.nullable === true && ctx.version === "openapi-3.0") baseSchema = z.nullable(baseSchema);
13634
- if (schema.readOnly === true) baseSchema = z.readonly(baseSchema);
13635
- if (schema.default !== void 0) baseSchema = baseSchema.default(schema.default);
13636
- const extraMeta = {};
13637
- for (const key of [
13638
- "$id",
13639
- "id",
13640
- "$comment",
13641
- "$anchor",
13642
- "$vocabulary",
13643
- "$dynamicRef",
13644
- "$dynamicAnchor"
13645
- ]) if (key in schema) extraMeta[key] = schema[key];
13646
- for (const key of [
13647
- "contentEncoding",
13648
- "contentMediaType",
13649
- "contentSchema"
13650
- ]) if (key in schema) extraMeta[key] = schema[key];
13651
- for (const key of Object.keys(schema)) if (!RECOGNIZED_KEYS.has(key)) extraMeta[key] = schema[key];
13652
- if (Object.keys(extraMeta).length > 0) ctx.registry.add(baseSchema, extraMeta);
13653
- if (schema.description) baseSchema = baseSchema.describe(schema.description);
13654
- return baseSchema;
13655
- }
13656
- /**
13657
- * Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */
13658
- function fromJSONSchema(schema, params) {
13659
- if (typeof schema === "boolean") return schema ? z.any() : z.never();
13660
- let normalized;
13661
- try {
13662
- normalized = JSON.parse(JSON.stringify(schema));
13663
- } catch {
13664
- throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
13665
- }
13666
- const ctx = {
13667
- version: detectVersion(normalized, params?.defaultTarget),
13668
- defs: normalized.$defs || normalized.definitions || {},
13669
- refs: /* @__PURE__ */ new Map(),
13670
- processing: /* @__PURE__ */ new Set(),
13671
- rootSchema: normalized,
13672
- registry: params?.registry ?? globalRegistry
13673
- };
13674
- return convertSchema(normalized, ctx);
13675
- }
13676
-
13677
- //#endregion
13678
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/coerce.js
13679
- var coerce_exports = /* @__PURE__ */ __exportAll({
13680
- bigint: () => bigint,
13681
- boolean: () => boolean,
13682
- date: () => date,
13683
- number: () => number,
13684
- string: () => string
13685
- });
13686
- function string(params) {
13687
- return _coercedString(ZodString, params);
13688
- }
13689
- function number(params) {
13690
- return _coercedNumber(ZodNumber, params);
13691
- }
13692
- function boolean(params) {
13693
- return _coercedBoolean(ZodBoolean, params);
13694
- }
13695
- function bigint(params) {
13696
- return _coercedBigint(ZodBigInt, params);
13697
- }
13698
- function date(params) {
13699
- return _coercedDate(ZodDate, params);
13700
- }
13701
-
13702
- //#endregion
13703
- //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
13704
- var external_exports = /* @__PURE__ */ __exportAll({
13705
- $brand: () => $brand,
13706
- $input: () => $input,
13707
- $output: () => $output,
13708
- NEVER: () => NEVER,
13709
- TimePrecision: () => TimePrecision,
13710
- ZodAny: () => ZodAny,
13711
- ZodArray: () => ZodArray,
13712
- ZodBase64: () => ZodBase64,
13713
- ZodBase64URL: () => ZodBase64URL,
13714
- ZodBigInt: () => ZodBigInt,
13715
- ZodBigIntFormat: () => ZodBigIntFormat,
13716
- ZodBoolean: () => ZodBoolean,
13717
- ZodCIDRv4: () => ZodCIDRv4,
13718
- ZodCIDRv6: () => ZodCIDRv6,
13719
- ZodCUID: () => ZodCUID,
13720
- ZodCUID2: () => ZodCUID2,
13721
- ZodCatch: () => ZodCatch,
13722
- ZodCodec: () => ZodCodec,
13723
- ZodCustom: () => ZodCustom,
13724
- ZodCustomStringFormat: () => ZodCustomStringFormat,
13725
- ZodDate: () => ZodDate,
13726
- ZodDefault: () => ZodDefault,
13727
- ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
13728
- ZodE164: () => ZodE164,
13729
- ZodEmail: () => ZodEmail,
13730
- ZodEmoji: () => ZodEmoji,
13731
- ZodEnum: () => ZodEnum,
13732
- ZodError: () => ZodError,
13733
- ZodExactOptional: () => ZodExactOptional,
13734
- ZodFile: () => ZodFile,
13735
- ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
13736
- ZodFunction: () => ZodFunction,
13737
- ZodGUID: () => ZodGUID,
13738
- ZodIPv4: () => ZodIPv4,
13739
- ZodIPv6: () => ZodIPv6,
13740
- ZodISODate: () => ZodISODate,
13741
- ZodISODateTime: () => ZodISODateTime,
13742
- ZodISODuration: () => ZodISODuration,
13743
- ZodISOTime: () => ZodISOTime,
13744
- ZodIntersection: () => ZodIntersection,
13745
- ZodIssueCode: () => ZodIssueCode,
13746
- ZodJWT: () => ZodJWT,
13747
- ZodKSUID: () => ZodKSUID,
13748
- ZodLazy: () => ZodLazy,
13749
- ZodLiteral: () => ZodLiteral,
13750
- ZodMAC: () => ZodMAC,
13751
- ZodMap: () => ZodMap,
13752
- ZodNaN: () => ZodNaN,
13753
- ZodNanoID: () => ZodNanoID,
13754
- ZodNever: () => ZodNever,
13755
- ZodNonOptional: () => ZodNonOptional,
13756
- ZodNull: () => ZodNull,
13757
- ZodNullable: () => ZodNullable,
13758
- ZodNumber: () => ZodNumber,
13759
- ZodNumberFormat: () => ZodNumberFormat,
13760
- ZodObject: () => ZodObject,
13761
- ZodOptional: () => ZodOptional,
13762
- ZodPipe: () => ZodPipe,
13763
- ZodPrefault: () => ZodPrefault,
13764
- ZodPreprocess: () => ZodPreprocess,
13765
- ZodPromise: () => ZodPromise,
13766
- ZodReadonly: () => ZodReadonly,
13767
- ZodRealError: () => ZodRealError,
13768
- ZodRecord: () => ZodRecord,
13769
- ZodSet: () => ZodSet,
13770
- ZodString: () => ZodString,
13771
- ZodStringFormat: () => ZodStringFormat,
13772
- ZodSuccess: () => ZodSuccess,
13773
- ZodSymbol: () => ZodSymbol,
13774
- ZodTemplateLiteral: () => ZodTemplateLiteral,
13775
- ZodTransform: () => ZodTransform,
13776
- ZodTuple: () => ZodTuple,
13777
- ZodType: () => ZodType,
13778
- ZodULID: () => ZodULID,
13779
- ZodURL: () => ZodURL,
13780
- ZodUUID: () => ZodUUID,
13781
- ZodUndefined: () => ZodUndefined,
13782
- ZodUnion: () => ZodUnion,
13783
- ZodUnknown: () => ZodUnknown,
13784
- ZodVoid: () => ZodVoid,
13785
- ZodXID: () => ZodXID,
13786
- ZodXor: () => ZodXor,
13787
- _ZodString: () => _ZodString,
13788
- _default: () => _default,
13789
- _function: () => _function,
13790
- any: () => any,
13791
- array: () => array,
13792
- base64: () => base64,
13793
- base64url: () => base64url,
13794
- bigint: () => bigint$1,
13795
- boolean: () => boolean$1,
13796
- catch: () => _catch,
13797
- check: () => check,
13798
- cidrv4: () => cidrv4,
13799
- cidrv6: () => cidrv6,
13800
- clone: () => clone,
13801
- codec: () => codec,
13802
- coerce: () => coerce_exports,
13803
- config: () => config,
13804
- core: () => core_exports,
13805
- cuid: () => cuid,
13806
- cuid2: () => cuid2,
13807
- custom: () => custom,
13808
- date: () => date$1,
13809
- decode: () => decode,
13810
- decodeAsync: () => decodeAsync,
13811
- describe: () => describe,
13812
- discriminatedUnion: () => discriminatedUnion,
13813
- e164: () => e164,
13814
- email: () => email,
13815
- emoji: () => emoji,
13816
- encode: () => encode,
13817
- encodeAsync: () => encodeAsync,
13818
- endsWith: () => _endsWith,
13819
- enum: () => _enum,
13820
- exactOptional: () => exactOptional,
13821
- file: () => file,
13822
- flattenError: () => flattenError,
13823
- float32: () => float32,
13824
- float64: () => float64,
13825
- formatError: () => formatError,
13826
- fromJSONSchema: () => fromJSONSchema,
13827
- function: () => _function,
13828
- getErrorMap: () => getErrorMap,
13829
- globalRegistry: () => globalRegistry,
13830
- gt: () => _gt,
13831
- gte: () => _gte,
13832
- guid: () => guid,
13833
- hash: () => hash,
13834
- hex: () => hex,
13835
- hostname: () => hostname,
13836
- httpUrl: () => httpUrl,
13837
- includes: () => _includes,
13838
- instanceof: () => _instanceof,
13839
- int: () => int,
13840
- int32: () => int32,
13841
- int64: () => int64,
13842
- intersection: () => intersection,
13843
- invertCodec: () => invertCodec,
13844
- ipv4: () => ipv4,
13845
- ipv6: () => ipv6,
13846
- iso: () => iso_exports,
13847
- json: () => json,
13848
- jwt: () => jwt,
13849
- keyof: () => keyof,
13850
- ksuid: () => ksuid,
13851
- lazy: () => lazy,
13852
- length: () => _length,
13853
- literal: () => literal,
13854
- locales: () => locales_exports,
13855
- looseObject: () => looseObject,
13856
- looseRecord: () => looseRecord,
13857
- lowercase: () => _lowercase,
13858
- lt: () => _lt,
13859
- lte: () => _lte,
13860
- mac: () => mac,
13861
- map: () => map,
13862
- maxLength: () => _maxLength,
13863
- maxSize: () => _maxSize,
13864
- meta: () => meta,
13865
- mime: () => _mime,
13866
- minLength: () => _minLength,
13867
- minSize: () => _minSize,
13868
- multipleOf: () => _multipleOf,
13869
- nan: () => nan,
13870
- nanoid: () => nanoid,
13871
- nativeEnum: () => nativeEnum,
13872
- negative: () => _negative,
13873
- never: () => never,
13874
- nonnegative: () => _nonnegative,
13875
- nonoptional: () => nonoptional,
13876
- nonpositive: () => _nonpositive,
13877
- normalize: () => _normalize,
13878
- null: () => _null,
13879
- nullable: () => nullable,
13880
- nullish: () => nullish,
13881
- number: () => number$1,
13882
- object: () => object,
13883
- optional: () => optional,
13884
- overwrite: () => _overwrite,
13885
- parse: () => parse,
13886
- parseAsync: () => parseAsync,
13887
- partialRecord: () => partialRecord,
13888
- pipe: () => pipe,
13889
- positive: () => _positive,
13890
- prefault: () => prefault,
13891
- preprocess: () => preprocess,
13892
- prettifyError: () => prettifyError,
13893
- promise: () => promise,
13894
- property: () => _property,
13895
- readonly: () => readonly,
13896
- record: () => record,
13897
- refine: () => refine,
13898
- regex: () => _regex,
13899
- regexes: () => regexes_exports,
13900
- registry: () => registry,
13901
- safeDecode: () => safeDecode,
13902
- safeDecodeAsync: () => safeDecodeAsync,
13903
- safeEncode: () => safeEncode,
13904
- safeEncodeAsync: () => safeEncodeAsync,
13905
- safeParse: () => safeParse,
13906
- safeParseAsync: () => safeParseAsync,
13907
- set: () => set,
13908
- setErrorMap: () => setErrorMap,
13909
- size: () => _size,
13910
- slugify: () => _slugify,
13911
- startsWith: () => _startsWith,
13912
- strictObject: () => strictObject,
13913
- string: () => string$1,
13914
- stringFormat: () => stringFormat,
13915
- stringbool: () => stringbool,
13916
- success: () => success,
13917
- superRefine: () => superRefine,
13918
- symbol: () => symbol,
13919
- templateLiteral: () => templateLiteral,
13920
- toJSONSchema: () => toJSONSchema,
13921
- toLowerCase: () => _toLowerCase,
13922
- toUpperCase: () => _toUpperCase,
13923
- transform: () => transform,
13924
- treeifyError: () => treeifyError,
13925
- trim: () => _trim,
13926
- tuple: () => tuple,
13927
- uint32: () => uint32,
13928
- uint64: () => uint64,
13929
- ulid: () => ulid,
13930
- undefined: () => _undefined,
13931
- union: () => union,
13932
- unknown: () => unknown,
13933
- uppercase: () => _uppercase,
13934
- url: () => url,
13935
- util: () => util_exports,
13936
- uuid: () => uuid,
13937
- uuidv4: () => uuidv4,
13938
- uuidv6: () => uuidv6,
13939
- uuidv7: () => uuidv7,
13940
- void: () => _void,
13941
- xid: () => xid,
13942
- xor: () => xor
13943
- });
13944
- config(en_default());
13945
-
13946
- //#endregion
13947
- //#region ../api-contract/dist/openapi.mjs
13948
- var import_dist = require_dist();
13949
- (0, import_dist.extendZodWithOpenApi)(external_exports);
13950
-
13951
- //#endregion
13952
- //#region ../api-contract/dist/errors.mjs
13953
- /**
13954
- * Error shape returned by every `/api/v1` machine operation (and by the shared
13955
- * auth guard). Each operation registers its own error schema component in the
13956
- * OpenAPI document, so this is a factory rather than a single shared instance.
13957
- */
13958
- function createApiErrorResponseSchema() {
13959
- return object({
13960
- error: string$1(),
13961
- issues: array(unknown()).optional()
13962
- });
13963
- }
13964
- const apiErrorResponseSchema = createApiErrorResponseSchema();
13965
- /**
13966
- * Canonical error codes for the `/api/v1` resource operations. Machine
13967
- * operations keep the flat `{ error: string }` shape above unchanged; the
13968
- * nested envelope below applies to resource operations only.
13969
- */
13970
- const resourceErrorCodeSchema = _enum([
13971
- "bad_request",
13972
- "unauthenticated",
13973
- "forbidden",
13974
- "not_found",
13975
- "conflict",
13976
- "payload_too_large",
13977
- "rate_limited",
13978
- "capability_disabled",
13979
- "upstream_error",
13980
- "internal_error"
13981
- ]);
13982
- /** Factory, matching `createApiErrorResponseSchema`, for per-route OpenAPI components. */
13983
- function createResourceApiErrorResponseSchema() {
13984
- return object({ error: object({
13985
- code: resourceErrorCodeSchema,
13986
- message: string$1(),
13987
- issues: array(unknown()).optional(),
13988
- retryable: boolean$1().optional()
13989
- }) });
13990
- }
13991
- const resourceApiErrorResponseSchema = createResourceApiErrorResponseSchema();
13992
-
13993
- //#endregion
13994
- //#region ../api-contract/dist/xgraph.mjs
13995
- const looseRecordSchema = record(string$1(), unknown());
13996
- const pointSchema = object({
13997
- x: number$1(),
13998
- y: number$1()
13999
- });
14000
- const nodeDataSchema = looseRecordSchema.refine((data) => !("parentId" in data), "XGraph node data must not contain parentId; use node.parentId.");
14001
- const xgraphNodeSchema = object({
14002
- id: string$1(),
14003
- type: string$1().optional(),
14004
- parentId: string$1().nullable().optional(),
14005
- sourceId: string$1().optional(),
14006
- targetId: string$1().optional(),
14007
- label: string$1().nullable().optional(),
14008
- data: nodeDataSchema.optional(),
14009
- x: number$1().optional(),
14010
- y: number$1().optional(),
14011
- width: number$1().optional(),
14012
- height: number$1().optional(),
14013
- position: pointSchema.optional(),
14014
- dx: number$1().optional(),
14015
- dy: number$1().optional()
14016
- }).passthrough();
14017
- const xgraphEdgeSchema = object({
14018
- id: string$1(),
14019
- type: string$1().optional(),
14020
- sourceId: string$1(),
14021
- targetId: string$1(),
14022
- label: string$1().nullable().optional(),
14023
- data: unknown().optional(),
14024
- x: number$1().optional(),
14025
- y: number$1().optional(),
14026
- width: number$1().optional(),
14027
- height: number$1().optional(),
14028
- position: pointSchema.optional(),
14029
- dx: number$1().optional(),
14030
- dy: number$1().optional()
14031
- }).passthrough();
14032
- /** XGraph wire shape accepted and emitted at API boundaries. */
14033
- const xgraphSchema = object({
14034
- xgraphSchemaVersion: literal("1.0.0").optional(),
14035
- id: string$1().optional(),
14036
- type: string$1().optional(),
14037
- parentId: string$1().nullable().optional(),
14038
- initialNodeId: string$1().nullable().optional(),
14039
- nodes: array(xgraphNodeSchema),
14040
- edges: array(xgraphEdgeSchema),
14041
- data: unknown().optional(),
14042
- layout: unknown().nullable().optional(),
14043
- annotations: array(unknown()).optional(),
14044
- direction: _enum([
14045
- "up",
14046
- "down",
14047
- "left",
14048
- "right"
14049
- ]).optional(),
14050
- style: looseRecordSchema.optional()
14051
- }).passthrough();
14052
-
14053
- //#endregion
14054
- //#region ../api-contract/dist/resources.mjs
14055
- /**
14056
- * Canonical schemas for persistent `/api/v1` resources plus the owned,
14057
- * deterministic code-extraction operation.
14058
- *
14059
- * These models are canonical, not upstream-shaped: providers (e.g. the Stately
14060
- * Registry adapter) are responsible for translating upstream envelopes,
14061
- * identifier quirks and casing into these shapes. No `{ data }` envelope
14062
- * appears anywhere; all timestamps are ISO strings.
14063
- */
14064
- /**
14065
- * XState major versions the editor targets (see
14066
- * `packages/editor/src/formats/xstate.ts`).
14067
- */
14068
- const xstateVersionSchema = union([literal(5), literal(6)]);
14069
- const projectVisibilitySchema = _enum([
14070
- "public",
14071
- "unlisted",
14072
- "private"
14073
- ]);
14074
- const verifyResultSchema = object({
14075
- valid: literal(true),
14076
- tokenScope: _enum(["user", "project"])
14077
- });
14078
- /**
14079
- * Entitlements for the authenticated caller.
14080
- *
14081
- * Internal contract: this is not published as an `/api/v1` operation. Editor
14082
- * feature gating resolves it server-side through the resource provider and
14083
- * hands the mapped result to the client (see
14084
- * `packages/editor/src/entitlements`).
14085
- *
14086
- * `entitlements` is an open set of provider-defined strings; unknown values are
14087
- * ignored rather than rejected.
14088
- */
14089
- const entitlementsResultSchema = object({
14090
- subscription: object({
14091
- tier: string$1(),
14092
- status: string$1()
14093
- }).nullable(),
14094
- entitlements: array(string$1())
14095
- });
14096
- /**
14097
- * Which editor format a machine's stored definition is in: `digraph` is the
14098
- * original (legacy) editor's format, `xgraph` the current one.
14099
- */
14100
- const machineDefinitionFormatSchema = _enum(["digraph", "xgraph"]);
14101
- /**
14102
- * `name` and `updatedAt` are optional: some upstream project envelopes only
14103
- * return machine ids. Providers that can supply them cheaply should.
14104
- */
14105
- const projectMachineSummarySchema = object({
14106
- machineId: string$1(),
14107
- name: string$1().optional(),
14108
- updatedAt: string$1().optional(),
14109
- format: machineDefinitionFormatSchema.optional()
14110
- });
14111
- /**
14112
- * A project list row. It carries the project's machine roster, not just its
14113
- * metadata, so a client can mount a whole workspace from one `projects.list`
14114
- * response and fetch definitions lazily.
14115
- */
14116
- const projectSummarySchema = object({
14117
- projectId: string$1(),
14118
- projectVersionId: string$1(),
14119
- name: string$1(),
14120
- ownership: _enum(["personal", "team"]).optional(),
14121
- description: string$1().nullable(),
14122
- visibility: projectVisibilitySchema,
14123
- createdAt: string$1(),
14124
- updatedAt: string$1(),
14125
- rootMachineId: string$1().nullable().optional(),
14126
- machines: array(projectMachineSummarySchema).optional(),
14127
- permissions: object({ canEdit: boolean$1() }).optional(),
14128
- allowedVisibility: array(projectVisibilitySchema).optional()
14129
- });
14130
- const projectSchema = projectSummarySchema.extend({
14131
- rootMachineId: string$1().nullable(),
14132
- machines: array(projectMachineSummarySchema),
14133
- permissions: object({ canEdit: boolean$1() })
14134
- });
14135
- const machineSchema = object({
14136
- machineId: string$1(),
14137
- name: string$1(),
14138
- projectId: string$1().optional(),
14139
- projectVersionId: string$1(),
14140
- definition: unknown(),
14141
- graph: xgraphSchema.optional(),
14142
- createdAt: string$1().optional(),
14143
- updatedAt: string$1().optional(),
14144
- format: machineDefinitionFormatSchema.optional()
14145
- });
14146
- const machineVersionSchema = object({
14147
- machineVersionId: string$1(),
14148
- machineId: string$1(),
14149
- versionNumber: number$1(),
14150
- name: string$1(),
14151
- definition: unknown(),
14152
- createdAt: string$1(),
14153
- updatedAt: string$1(),
14154
- format: machineDefinitionFormatSchema.optional()
14155
- });
14156
- /** Version-history row without the definition payload. */
14157
- const machineVersionSummarySchema = object({
14158
- machineVersionId: string$1(),
14159
- machineId: string$1(),
14160
- versionNumber: number$1(),
14161
- name: string$1().nullable(),
14162
- status: string$1(),
14163
- parentVersionId: string$1().nullable(),
14164
- createdAt: string$1(),
14165
- updatedAt: string$1(),
14166
- format: machineDefinitionFormatSchema.optional()
14167
- });
14168
- /** Result of converting a machine's stored definition to XGraph in place. */
14169
- const machinesConvertResultSchema = object({
14170
- machine: machineSchema,
14171
- created: boolean$1(),
14172
- version: object({
14173
- machineVersionId: string$1(),
14174
- versionNumber: number$1(),
14175
- name: string$1().nullable()
14176
- })
14177
- });
14178
- /**
14179
- * A project the caller may fork a machine into, with the version ids a fork
14180
- * can target. `projectVersionIds` is ordered as the provider reports it.
14181
- */
14182
- const projectDestinationProjectSchema = object({
14183
- projectId: string$1(),
14184
- name: string$1(),
14185
- visibility: projectVisibilitySchema,
14186
- projectVersionIds: array(string$1())
14187
- });
14188
- /**
14189
- * Fork destinations grouped by owner. The caller's personal projects are one
14190
- * owner alongside each team; `ownerId` is opaque and provider-defined.
14191
- */
14192
- const projectDestinationSchema = object({
14193
- ownerId: string$1(),
14194
- name: string$1(),
14195
- projects: array(projectDestinationProjectSchema)
14196
- });
14197
- /** Result of forking a machine into a new or existing project version. */
14198
- const machinesForkResultSchema = object({
14199
- machine: machineSchema,
14200
- projectVersionId: string$1(),
14201
- projectId: string$1()
14202
- });
14203
- /**
14204
- * The version holding a machine's pre-conversion (legacy editor) definition.
14205
- * `versionId` is `null` when the machine has no such version, which is the
14206
- * signal that the legacy editor cannot be re-entered for it.
14207
- */
14208
- const machineLegacyVersionSchema = object({ versionId: string$1().nullable() });
14209
- /** Result of restoring a machine's legacy-editor definition. */
14210
- const machinesRestoreLegacyResultSchema = object({
14211
- machine: machineSchema,
14212
- version: object({
14213
- machineVersionId: string$1(),
14214
- versionNumber: number$1(),
14215
- name: string$1().nullable()
14216
- })
14217
- });
14218
- /**
14219
- * Result of restoring a machine to one of its own versions.
14220
- *
14221
- * `capturedVersion` is the new version holding the machine's *pre-restore*
14222
- * definition, so the restore itself is undoable. It is `null` when the restore
14223
- * was a no-op (the machine already held that version's definition), which is
14224
- * the signal that no history row was added.
14225
- */
14226
- const machinesRestoreVersionResultSchema = object({
14227
- machine: machineSchema,
14228
- capturedVersion: machineVersionSummarySchema.nullable()
14229
- });
14230
- const extractedMachinesSchema = object({ machines: array(object({
14231
- config: record(string$1(), unknown()),
14232
- machineIndex: number$1().int().nonnegative().optional()
14233
- })) });
14234
- const projectsCreateRequestSchema = object({
14235
- name: string$1().min(1),
14236
- visibility: projectVisibilitySchema
14237
- });
14238
- const projectsUpdateRequestSchema = object({
14239
- name: string$1().min(1).optional(),
14240
- description: string$1().nullable().optional(),
14241
- visibility: projectVisibilitySchema.optional()
14242
- }).refine((value) => value.name !== void 0 || value.description !== void 0 || value.visibility !== void 0, { message: "At least one of `name`, `description` or `visibility` is required." });
14243
- const machinesCreateRequestSchema = object({
14244
- projectVersionId: string$1().min(1),
14245
- xstateVersion: xstateVersionSchema,
14246
- name: string$1().min(1).optional(),
14247
- definition: unknown().optional()
14248
- });
14249
- const machinesUpdateRequestSchema = object({
14250
- name: string$1().min(1).optional(),
14251
- definition: unknown().optional(),
14252
- expectedUpdatedAt: string$1().min(1).optional()
14253
- }).refine((value) => value.name !== void 0 || value.definition !== void 0, { message: "At least one of `name` or `definition` is required." });
14254
- /**
14255
- * `status` is canonical lowercase; providers map it to their own casing.
14256
- * Omitting `definition` snapshots the machine's current definition.
14257
- */
14258
- const machineVersionsCreateRequestSchema = object({
14259
- name: string$1().min(1).optional(),
14260
- definition: unknown().optional(),
14261
- status: _enum(["committed", "auto"]).optional(),
14262
- parentVersionId: string$1().min(1).optional()
14263
- });
14264
- const machinesConvertRequestSchema = object({
14265
- definition: xgraphSchema,
14266
- expectedUpdatedAt: string$1().min(1),
14267
- keepOriginalVersion: boolean$1().optional()
14268
- });
14269
- /**
14270
- * Fork a machine into exactly one target: an existing project version, or a
14271
- * new project to create for it. Both, or neither, is a client bug.
14272
- */
14273
- const machinesForkRequestSchema = object({
14274
- targetProjectVersionId: string$1().min(1).optional(),
14275
- targetProject: object({
14276
- name: string$1().min(1),
14277
- visibility: projectVisibilitySchema,
14278
- teamId: string$1().min(1).optional()
14279
- }).optional(),
14280
- machineName: string$1().min(1).optional(),
14281
- xstateVersion: xstateVersionSchema.optional()
14282
- }).refine((value) => value.targetProjectVersionId === void 0 !== (value.targetProject === void 0), { message: "Exactly one of `targetProjectVersionId` or `targetProject` is required." });
14283
- const machinesRestoreLegacyRequestSchema = object({
14284
- versionId: string$1().min(1).optional(),
14285
- expectedUpdatedAt: string$1().min(1),
14286
- reason: string$1().optional()
14287
- });
14288
- const machinesRestoreVersionRequestSchema = object({ expectedUpdatedAt: string$1().min(1).optional() });
14289
- const codeExtractMachinesRequestSchema = object({
14290
- code: string$1().min(1),
14291
- xstateVersion: xstateVersionSchema.optional()
14292
- });
14293
- const authVerifyResponseSchema = verifyResultSchema;
14294
- const projectsListResponseSchema = array(projectSummarySchema);
14295
- const projectsGetResponseSchema = projectSchema;
14296
- const projectsCreateResponseSchema = projectSchema;
14297
- const projectsUpdateResponseSchema = projectSchema;
14298
- const projectsDeleteResponseSchema = object({ projectId: string$1() });
14299
- const projectsListMachinesResponseSchema = array(projectMachineSummarySchema);
14300
- const projectsDestinationsResponseSchema = array(projectDestinationSchema);
14301
- const machinesCreateResponseSchema = machineSchema;
14302
- const machinesGetResponseSchema = machineSchema;
14303
- const machinesUpdateResponseSchema = machineSchema;
14304
- const machinesGetVersionResponseSchema = machineVersionSchema;
14305
- const machineVersionsListResponseSchema = array(machineVersionSummarySchema);
14306
- const machineVersionsCreateResponseSchema = machineVersionSchema;
14307
- const machinesConvertDefinitionResponseSchema = machinesConvertResultSchema;
14308
- const machinesForkResponseSchema = machinesForkResultSchema;
14309
- const machinesGetLegacyVersionResponseSchema = machineLegacyVersionSchema;
14310
- const machinesRestoreLegacyResponseSchema = machinesRestoreLegacyResultSchema;
14311
- const machinesRestoreVersionResponseSchema = machinesRestoreVersionResultSchema;
14312
- const codeExtractMachinesResponseSchema = extractedMachinesSchema;
14313
- /**
14314
- * Request/response schema pairs keyed by resource capability name. Kept here
14315
- * rather than on the `Capability` metadata entries so that the capability
14316
- * registry stays plain, serialisable data.
14317
- */
14318
- const resourceOperationSchemas = {
14319
- "auth.verify": { response: authVerifyResponseSchema },
14320
- "projects.list": { response: projectsListResponseSchema },
14321
- "projects.create": {
14322
- request: projectsCreateRequestSchema,
14323
- response: projectsCreateResponseSchema
14324
- },
14325
- "projects.get": { response: projectsGetResponseSchema },
14326
- "projects.update": {
14327
- request: projectsUpdateRequestSchema,
14328
- response: projectsUpdateResponseSchema
14329
- },
14330
- "projects.delete": { response: projectsDeleteResponseSchema },
14331
- "projects.listMachines": { response: projectsListMachinesResponseSchema },
14332
- "projects.destinations": { response: projectsDestinationsResponseSchema },
14333
- "machines.create": {
14334
- request: machinesCreateRequestSchema,
14335
- response: machinesCreateResponseSchema
14336
- },
14337
- "machines.get": { response: machinesGetResponseSchema },
14338
- "machines.getVersion": { response: machinesGetVersionResponseSchema },
14339
- "machines.update": {
14340
- request: machinesUpdateRequestSchema,
14341
- response: machinesUpdateResponseSchema
14342
- },
14343
- "machines.versions.list": { response: machineVersionsListResponseSchema },
14344
- "machines.versions.create": {
14345
- request: machineVersionsCreateRequestSchema,
14346
- response: machineVersionsCreateResponseSchema
14347
- },
14348
- "machines.convertDefinition": {
14349
- request: machinesConvertRequestSchema,
14350
- response: machinesConvertDefinitionResponseSchema
14351
- },
14352
- "machines.fork": {
14353
- request: machinesForkRequestSchema,
14354
- response: machinesForkResponseSchema
14355
- },
14356
- "machines.getLegacyVersion": { response: machinesGetLegacyVersionResponseSchema },
14357
- "machines.restoreLegacy": {
14358
- request: machinesRestoreLegacyRequestSchema,
14359
- response: machinesRestoreLegacyResponseSchema
14360
- },
14361
- "machines.restoreVersion": {
14362
- request: machinesRestoreVersionRequestSchema,
14363
- response: machinesRestoreVersionResponseSchema
14364
- }
14365
- };
14366
- /** Provider-independent operations implemented by this repository. */
14367
- const codeOperationSchemas = { "code.extractMachines": {
14368
- request: codeExtractMachinesRequestSchema,
14369
- response: codeExtractMachinesResponseSchema
14370
- } };
14371
- /** Every owned API operation with a canonical request/response contract. */
14372
- const operationSchemas = {
14373
- ...resourceOperationSchemas,
14374
- ...codeOperationSchemas
14375
- };
14376
-
14377
- //#endregion
14378
- //#region src/studio.ts
14379
- /**
14380
- * Remote client for the owned Stately resource contract (`/api/v1/*`).
14381
- *
14382
- * Every method targets our own routes (never the legacy Registry API), sends
14383
- * JSON bodies with a bearer credential, and validates responses against the
14384
- * canonical Zod schemas from `@statelyai/api-contract`. Responses are canonical
14385
- * values directly: there is no `{ data }` envelope. Errors use the nested
14386
- * envelope `{ error: { code, message, issues?, retryable? } }`.
14387
- */
14388
- /** Default base URL of the editor/API deployment hosting `/api/v1`. */
14389
- const DEFAULT_STATELY_BASE_URL = "https://editor.stately.ai";
14390
- var StudioApiError = class extends Error {
14391
- status;
14392
- /** Canonical resource error code, when the server sent one. */
14393
- code;
14394
- issues;
14395
- retryable;
14396
- constructor(message, status, options = {}) {
14397
- super(message);
14398
- this.name = "StudioApiError";
14399
- this.status = status;
14400
- this.code = options.code;
14401
- this.issues = options.issues;
14402
- this.retryable = options.retryable;
14403
- }
14404
- };
14405
- function getFetch(fetchImpl) {
14406
- const resolvedFetch = fetchImpl ?? globalThis.fetch;
14407
- if (!resolvedFetch) throw new Error("No fetch implementation available. Pass one via createStatelyClient({ fetch }).");
14408
- return resolvedFetch;
14409
- }
14410
- function joinApiUrl(baseUrl, path) {
14411
- return `${baseUrl.replace(/\/+$/, "")}/api/v1${path}`;
14412
- }
14413
- async function parseJson(response) {
14414
- if (!response.headers.get("content-type")?.includes("application/json")) return null;
14415
- return response.json().catch(() => null);
14416
- }
14417
- function toApiError(data, status) {
14418
- const parsed = resourceApiErrorResponseSchema.safeParse(data);
14419
- if (parsed.success) {
14420
- const { code, message, issues, retryable } = parsed.data.error;
14421
- return new StudioApiError(message, status, {
14422
- code,
14423
- issues,
14424
- retryable
14425
- });
14426
- }
14427
- if (typeof data === "object" && data !== null && "error" in data && typeof data.error === "string") return new StudioApiError(data.error, status);
14428
- return new StudioApiError(`HTTP ${status}`, status);
14429
- }
14430
- function normalizeVisibility(visibility) {
14431
- return visibility.toLowerCase();
14432
- }
14433
- function normalizeXStateVersion(xstateVersion) {
14434
- return xstateVersion === void 0 || xstateVersion === 4 ? 5 : xstateVersion;
14435
- }
14436
- function normalizeExtractXStateVersion(xstateVersion) {
14437
- return xstateVersion === 4 ? 5 : xstateVersion;
14438
- }
14439
- function withMachineAlias(machine) {
14440
- return {
14441
- ...machine,
14442
- definition: machine.definition,
14443
- id: machine.machineId
14444
- };
14445
- }
14446
- function withProjectAlias(project) {
14447
- return {
14448
- ...project,
14449
- id: project.projectVersionId
14450
- };
14451
- }
14452
- function isCredentialLike(value) {
14453
- if (typeof value === "string") return true;
14454
- return typeof value === "object" && value !== null && "type" in value && (value.type === "api_key" || value.type === "oauth");
14455
- }
14456
- function createStatelyClient(options = {}) {
14457
- const baseUrl = options.baseUrl ?? DEFAULT_STATELY_BASE_URL;
14458
- const fetchImpl = getFetch(options.fetch);
14459
- const defaultCredential = options.credential ?? (options.apiKey ? {
14460
- type: "api_key",
14461
- token: options.apiKey
14462
- } : void 0);
14463
- const defaultAuthMode = options.authMode ?? "auto";
14464
- async function request(path, init, schema, requestOptions = {}) {
14465
- const headers = new Headers(init.headers);
14466
- const authMode = requestOptions.authMode ?? defaultAuthMode;
14467
- const credential = requestOptions.credential ?? defaultCredential;
14468
- if (authMode !== "none") {
14469
- const token = getCredentialToken(credential);
14470
- if (authMode === "bearer" && (!token || !credential)) throw new StudioApiError("No Stately credential configured. Pass createStatelyClient({ credential }) or use authMode: \"auto\" to let the server decide whether authentication is required.", 401, { code: "unauthenticated" });
14471
- if (token && credential) headers.set("Authorization", createAuthorizationHeader(credential));
14472
- }
14473
- const response = await fetchImpl(joinApiUrl(baseUrl, path), {
14474
- ...init,
14475
- headers,
14476
- ...requestOptions.signal ? { signal: requestOptions.signal } : {}
14477
- });
14478
- const data = await parseJson(response);
14479
- if (!response.ok) throw toApiError(data, response.status);
14480
- const parsed = schema.safeParse(data);
14481
- if (!parsed.success) throw new StudioApiError(`Unexpected response for ${path}: ${parsed.error.message}`, response.status, {
14482
- code: "internal_error",
14483
- issues: [...parsed.error.issues]
14484
- });
14485
- return parsed.data;
14486
- }
14487
- function jsonInit(method, body) {
14488
- return {
14489
- method,
14490
- headers: { "Content-Type": "application/json" },
14491
- body: JSON.stringify(body)
14492
- };
14493
- }
14494
- const projects = {
14495
- list(requestOptions) {
14496
- return request("/projects", { method: "GET" }, projectsListResponseSchema, requestOptions);
14497
- },
14498
- create(input, requestOptions) {
14499
- return request("/projects", jsonInit("POST", {
14500
- name: input.name,
14501
- visibility: normalizeVisibility(input.visibility)
14502
- }), projectSchema, requestOptions).then(withProjectAlias);
14503
- },
14504
- get(projectId, requestOptions) {
14505
- return request(`/projects/${encodeURIComponent(projectId)}`, { method: "GET" }, projectSchema, requestOptions).then(withProjectAlias);
14506
- },
14507
- update(projectId, input, requestOptions) {
14508
- return request(`/projects/${encodeURIComponent(projectId)}`, jsonInit("PATCH", {
14509
- ...input.name !== void 0 ? { name: input.name } : {},
14510
- ...input.description !== void 0 ? { description: input.description } : {},
14511
- ...input.visibility !== void 0 ? { visibility: normalizeVisibility(input.visibility) } : {}
14512
- }), projectSchema, requestOptions).then(withProjectAlias);
14513
- },
14514
- delete(projectId, requestOptions) {
14515
- return request(`/projects/${encodeURIComponent(projectId)}`, { method: "DELETE" }, projectsDeleteResponseSchema, requestOptions);
14516
- },
14517
- listMachines(projectId, requestOptions) {
14518
- return request(`/projects/${encodeURIComponent(projectId)}/machines`, { method: "GET" }, projectsListMachinesResponseSchema, requestOptions);
14519
- },
14520
- async ensure(input, requestOptions) {
14521
- if (input.matchConnectedRepo !== false) {
14522
- const match = (await projects.list(requestOptions)).find((candidate) => candidate.name === input.name);
14523
- if (match) return projects.get(match.projectId, requestOptions);
14524
- }
14525
- return projects.create(input, requestOptions);
14526
- }
14527
- };
14528
- const machines = {
14529
- create(input, requestOptions) {
14530
- return request("/machines", jsonInit("POST", {
14531
- projectVersionId: input.projectVersionId,
14532
- xstateVersion: normalizeXStateVersion(input.xstateVersion),
14533
- ...input.name !== void 0 ? { name: input.name } : {},
14534
- ...input.definition !== void 0 ? { definition: input.definition } : {}
14535
- }), machineSchema, requestOptions).then((machine) => withMachineAlias(machine));
14536
- },
14537
- async createMany(input, requestOptions) {
14538
- return [await machines.create(input, requestOptions)];
14539
- },
14540
- get(machineId, getOptions = {}) {
14541
- return request(`/machines/${encodeURIComponent(machineId)}`, { method: "GET" }, machineSchema, getOptions).then((machine) => withMachineAlias(machine));
14542
- },
14543
- getVersion(machineId, versionId, requestOptions) {
14544
- return request(`/machines/${encodeURIComponent(machineId)}/versions/${encodeURIComponent(versionId)}`, { method: "GET" }, machineVersionSchema, requestOptions);
14545
- },
14546
- update(machineIdOrInput, inputOrOptions, maybeOptions) {
14547
- const machineId = typeof machineIdOrInput === "string" ? machineIdOrInput : machineIdOrInput.machineId ?? machineIdOrInput.id;
14548
- if (!machineId) throw new StudioApiError("machines.update requires a machine id.", 400, { code: "bad_request" });
14549
- const input = (typeof machineIdOrInput === "string" ? inputOrOptions : machineIdOrInput) ?? {};
14550
- const requestOptions = typeof machineIdOrInput === "string" ? maybeOptions : inputOrOptions;
14551
- return request(`/machines/${encodeURIComponent(machineId)}`, jsonInit("PATCH", {
14552
- ...input.name !== void 0 ? { name: input.name } : {},
14553
- ...input.definition !== void 0 ? { definition: input.definition } : {},
14554
- ...input.expectedUpdatedAt !== void 0 ? { expectedUpdatedAt: input.expectedUpdatedAt } : {}
14555
- }), machineSchema, requestOptions).then((machine) => withMachineAlias(machine));
14556
- }
14557
- };
14558
- return {
14559
- auth: { verify(credentialOrOptions, verifyOptions) {
14560
- return request("/auth/verify", { method: "GET" }, verifyResultSchema, isCredentialLike(credentialOrOptions) ? {
14561
- ...verifyOptions,
14562
- credential: credentialOrOptions
14563
- } : credentialOrOptions ?? verifyOptions ?? {});
14564
- } },
14565
- projects,
14566
- machines,
14567
- code: { extractMachines(codeOrInput, extractOptions = {}) {
14568
- const input = typeof codeOrInput === "string" ? {
14569
- code: codeOrInput,
14570
- xstateVersion: extractOptions.xstateVersion
14571
- } : codeOrInput;
14572
- const legacyOptions = extractOptions;
14573
- const credential = legacyOptions.credential ?? (legacyOptions.apiKey ? {
14574
- type: "api_key",
14575
- token: legacyOptions.apiKey
14576
- } : void 0);
14577
- return request("/code/extract-machines", jsonInit("POST", {
14578
- code: input.code,
14579
- xstateVersion: normalizeExtractXStateVersion(input.xstateVersion)
14580
- }), extractedMachinesSchema, {
14581
- ...extractOptions,
14582
- credential
14583
- });
14584
- } }
14585
- };
14586
- }
14587
-
14588
- //#endregion
14589
- export { StudioApiError as n, createStatelyClient as r, DEFAULT_STATELY_BASE_URL as t };
12983
+ export { ZodString as $, uuid as $n, _property as $r, int as $t, ZodJWT as A, preprocess as An, _coercedDate as Ar, boolean as At, ZodNull as B, stringbool as Bn, _lte as Br, discriminatedUnion as Bt, ZodExactOptional as C, config as Ci, nullish as Cn, iso_exports as Cr, _undefined as Ct, ZodIPv4 as D, partialRecord as Dn, TimePrecision as Dr, base64 as Dt, ZodGUID as E, optional as En, toJSONSchema as Er, array as Et, ZodMap as F, schemas_exports as Fn, _gte as Fr, cuid as Ft, ZodOptional as G, transform as Gn, _minSize as Gr, file as Gt, ZodNumber as H, superRefine as Hn, _maxSize as Hr, email as Ht, ZodNaN as I, set as In, _includes as Ir, cuid2 as It, ZodPreprocess as J, uint64 as Jn, _nonnegative as Jr, guid as Jt, ZodPipe as K, tuple as Kn, _multipleOf as Kr, float32 as Kt, ZodNanoID as L, strictObject as Ln, _length as Lr, custom as Lt, ZodLazy as M, readonly as Mn, _coercedString as Mr, cidrv4 as Mt, ZodLiteral as N, record as Nn, _endsWith as Nr, cidrv6 as Nt, ZodIPv6 as O, pipe as On, _coercedBigint as Or, base64url as Ot, ZodMAC as P, refine as Pn, _gt as Pr, codec as Pt, ZodSet as Q, url as Qn, _positive as Qr, httpUrl as Qt, ZodNever as R, string as Rn, _lowercase as Rr, date as Rt, ZodEnum as S, NEVER as Si, nullable as Sn, ZodISOTime as Sr, _null as St, ZodFunction as T, object as Tn, core_exports as Tr, any as Tt, ZodNumberFormat as U, symbol as Un, _mime as Ur, emoji as Ut, ZodNullable as V, success as Vn, _maxLength as Vr, e164 as Vt, ZodObject as W, templateLiteral as Wn, _minLength as Wr, exactOptional as Wt, ZodReadonly as X, union as Xn, _normalize as Xr, hex as Xt, ZodPromise as Y, ulid as Yn, _nonpositive as Yr, hash as Yt, ZodRecord as Z, unknown as Zn, _overwrite as Zr, hostname as Zt, ZodDefault as _, prettifyError as _i, nan as _n, ZodError as _r, _catch as _t, ZodBigInt as a, _toUpperCase as ai, ipv6 as an, decode as ar, ZodTuple as at, ZodEmail as b, util_exports as bi, never as bn, ZodISODateTime as br, _function as bt, ZodCIDRv4 as c, $input as ci, keyof as cn, encodeAsync as cr, ZodURL as ct, ZodCUID2 as d, registry as di, literal as dn, safeDecode as dr, ZodUnion as dt, _regex as ei, int32 as en, uuidv4 as er, ZodStringFormat as et, ZodCatch as f, locales_exports as fi, looseObject as fn, safeDecodeAsync as fr, ZodUnknown as ft, ZodDate as g, formatError as gi, meta as gn, safeParseAsync as gr, _ZodString as gt, ZodCustomStringFormat as h, flattenError as hi, map as hn, safeParse as hr, ZodXor as ht, ZodBase64URL as i, _toLowerCase as ii, ipv4 as in, xor as ir, ZodTransform as it, ZodKSUID as j, promise as jn, _coercedNumber as jr, check as jt, ZodIntersection as k, prefault as kn, _coercedBoolean as kr, bigint as kt, ZodCIDRv6 as l, $output as li, ksuid as ln, parse as lr, ZodUUID as lt, ZodCustom as m, regexes_exports as mi, mac as mn, safeEncodeAsync as mr, ZodXID as mt, ZodArray as n, _slugify as ni, intersection as nn, uuidv7 as nr, ZodSymbol as nt, ZodBigIntFormat as o, _trim as oi, json as on, decodeAsync as or, ZodType as ot, ZodCodec as p, en_default as pi, looseRecord as pn, safeEncode as pr, ZodVoid as pt, ZodPrefault as q, uint32 as qn, _negative as qr, float64 as qt, ZodBase64 as r, _startsWith as ri, invertCodec as rn, xid as rr, ZodTemplateLiteral as rt, ZodBoolean as s, _uppercase as si, jwt as sn, encode as sr, ZodULID as st, ZodAny as t, _size as ti, int64 as tn, uuidv6 as tr, ZodSuccess as tt, ZodCUID as u, globalRegistry as ui, lazy as un, parseAsync as ur, ZodUndefined as ut, ZodDiscriminatedUnion as v, treeifyError as vi, nanoid as vn, ZodRealError as vr, _default as vt, ZodFile as w, number as wn, checks_exports as wr, _void as wt, ZodEmoji as x, $brand as xi, nonoptional as xn, ZodISODuration as xr, _instanceof as xt, ZodE164 as y, clone as yi, nativeEnum as yn, ZodISODate as yr, _enum as yt, ZodNonOptional as z, stringFormat as zn, _lt as zr, describe as zt };