@mastra/slack 1.5.1 → 1.6.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.
package/dist/index.d.cts CHANGED
@@ -1,192 +1,2229 @@
1
- import { Mastra } from '@mastra/core/mastra';
2
- import { ChannelAdapterConfig, StreamingConfig, ToolDisplay, StaticToolDisplay, ChannelHandlers, ChannelConfig, WaitUntilFn, WaitUntilResolver, ChannelProvider, ChannelConnectResult, ChannelInstallationInfo, ChannelPlatformInfo } from '@mastra/core/channels';
3
- import { ApiRoute } from '@mastra/core/server';
4
- import { SlackAdapterConfig, SlackAdapter } from '@chat-adapter/slack';
5
- export { SlackAdapter, createSlackAdapter } from '@chat-adapter/slack';
6
- import { z } from 'zod';
7
- import { ChannelsStorage } from '@mastra/core/storage';
8
-
1
+ import { Mastra } from "@mastra/core/mastra";
2
+ import { ChannelAdapterConfig, ChannelConfig, ChannelConnectResult, ChannelHandlers, ChannelInstallationInfo, ChannelPlatformInfo, ChannelProvider, StaticToolDisplay, StreamingConfig, ToolDisplay, WaitUntilFn, WaitUntilResolver } from "@mastra/core/channels";
3
+ import { ApiRoute } from "@mastra/core/server";
4
+ import { SlackAdapter, SlackAdapter as SlackAdapter$1, SlackAdapterConfig, createSlackAdapter } from "@chat-adapter/slack";
5
+ import { ChannelsStorage } from "@mastra/core/storage";
6
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/json-schema.d.cts
7
+ type _JSONSchema = boolean | JSONSchema;
8
+ type JSONSchema = {
9
+ [k: string]: unknown;
10
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
11
+ $id?: string;
12
+ $anchor?: string;
13
+ $ref?: string;
14
+ $dynamicRef?: string;
15
+ $dynamicAnchor?: string;
16
+ $vocabulary?: Record<string, boolean>;
17
+ $comment?: string;
18
+ $defs?: Record<string, JSONSchema>;
19
+ type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
20
+ additionalItems?: _JSONSchema;
21
+ unevaluatedItems?: _JSONSchema;
22
+ prefixItems?: _JSONSchema[];
23
+ items?: _JSONSchema | _JSONSchema[];
24
+ contains?: _JSONSchema;
25
+ additionalProperties?: _JSONSchema;
26
+ unevaluatedProperties?: _JSONSchema;
27
+ properties?: Record<string, _JSONSchema>;
28
+ patternProperties?: Record<string, _JSONSchema>;
29
+ dependentSchemas?: Record<string, _JSONSchema>;
30
+ propertyNames?: _JSONSchema;
31
+ if?: _JSONSchema;
32
+ then?: _JSONSchema;
33
+ else?: _JSONSchema;
34
+ allOf?: JSONSchema[];
35
+ anyOf?: JSONSchema[];
36
+ oneOf?: JSONSchema[];
37
+ not?: _JSONSchema;
38
+ multipleOf?: number;
39
+ maximum?: number;
40
+ exclusiveMaximum?: number | boolean;
41
+ minimum?: number;
42
+ exclusiveMinimum?: number | boolean;
43
+ maxLength?: number;
44
+ minLength?: number;
45
+ pattern?: string;
46
+ maxItems?: number;
47
+ minItems?: number;
48
+ uniqueItems?: boolean;
49
+ maxContains?: number;
50
+ minContains?: number;
51
+ maxProperties?: number;
52
+ minProperties?: number;
53
+ required?: string[];
54
+ dependentRequired?: Record<string, string[]>;
55
+ enum?: Array<string | number | boolean | null>;
56
+ const?: string | number | boolean | null;
57
+ id?: string;
58
+ title?: string;
59
+ description?: string;
60
+ default?: unknown;
61
+ deprecated?: boolean;
62
+ readOnly?: boolean;
63
+ writeOnly?: boolean;
64
+ nullable?: boolean;
65
+ examples?: unknown[];
66
+ format?: string;
67
+ contentMediaType?: string;
68
+ contentEncoding?: string;
69
+ contentSchema?: JSONSchema;
70
+ _prefault?: unknown;
71
+ };
72
+ type BaseSchema = JSONSchema;
73
+ //#endregion
74
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/standard-schema.d.cts
75
+ /** The Standard interface. */
76
+ interface StandardTypedV1<Input = unknown, Output = Input> {
77
+ /** The Standard properties. */
78
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
79
+ }
80
+ declare namespace StandardTypedV1 {
81
+ /** The Standard properties interface. */
82
+ interface Props<Input = unknown, Output = Input> {
83
+ /** The version number of the standard. */
84
+ readonly version: 1;
85
+ /** The vendor name of the schema library. */
86
+ readonly vendor: string;
87
+ /** Inferred types associated with the schema. */
88
+ readonly types?: Types<Input, Output> | undefined;
89
+ }
90
+ /** The Standard types interface. */
91
+ interface Types<Input = unknown, Output = Input> {
92
+ /** The input type of the schema. */
93
+ readonly input: Input;
94
+ /** The output type of the schema. */
95
+ readonly output: Output;
96
+ }
97
+ /** Infers the input type of a Standard. */
98
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
99
+ /** Infers the output type of a Standard. */
100
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
101
+ }
102
+ /** The Standard Schema interface. */
103
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
104
+ /** The Standard Schema properties. */
105
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
106
+ }
107
+ declare namespace StandardSchemaV1 {
108
+ /** The Standard Schema properties interface. */
109
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
110
+ /** Validates unknown input values. */
111
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
112
+ }
113
+ /** The result interface of the validate function. */
114
+ type Result<Output> = SuccessResult<Output> | FailureResult;
115
+ /** The result interface if validation succeeds. */
116
+ interface SuccessResult<Output> {
117
+ /** The typed output value. */
118
+ readonly value: Output;
119
+ /** The absence of issues indicates success. */
120
+ readonly issues?: undefined;
121
+ }
122
+ interface Options {
123
+ /** Implicit support for additional vendor-specific parameters, if needed. */
124
+ readonly libraryOptions?: Record<string, unknown> | undefined;
125
+ }
126
+ /** The result interface if validation fails. */
127
+ interface FailureResult {
128
+ /** The issues of failed validation. */
129
+ readonly issues: ReadonlyArray<Issue>;
130
+ }
131
+ /** The issue interface of the failure output. */
132
+ interface Issue {
133
+ /** The error message of the issue. */
134
+ readonly message: string;
135
+ /** The path of the issue, if any. */
136
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
137
+ }
138
+ /** The path segment interface of the issue. */
139
+ interface PathSegment {
140
+ /** The key representing a path segment. */
141
+ readonly key: PropertyKey;
142
+ }
143
+ /** The Standard types interface. */
144
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
145
+ /** Infers the input type of a Standard. */
146
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
147
+ /** Infers the output type of a Standard. */
148
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
149
+ }
150
+ /** The Standard JSON Schema interface. */
151
+ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
152
+ /** The Standard JSON Schema properties. */
153
+ readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
154
+ }
155
+ declare namespace StandardJSONSchemaV1 {
156
+ /** The Standard JSON Schema properties interface. */
157
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
158
+ /** Methods for generating the input/output JSON Schema. */
159
+ readonly jsonSchema: Converter;
160
+ }
161
+ /** The Standard JSON Schema converter interface. */
162
+ interface Converter {
163
+ /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
164
+ readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
165
+ /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
166
+ readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
167
+ }
168
+ /** The target version of the generated JSON Schema.
169
+ *
170
+ * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
171
+ *
172
+ * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
173
+ *
174
+ * All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
175
+ */
176
+ type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
177
+ /** The options for the input/output methods. */
178
+ interface Options {
179
+ /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
180
+ readonly target: Target;
181
+ /** Implicit support for additional vendor-specific parameters, if needed. */
182
+ readonly libraryOptions?: Record<string, unknown> | undefined;
183
+ }
184
+ /** The Standard types interface. */
185
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
186
+ /** Infers the input type of a Standard. */
187
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
188
+ /** Infers the output type of a Standard. */
189
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
190
+ }
191
+ interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
192
+ //#endregion
193
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/registries.d.cts
194
+ declare const $output: unique symbol;
195
+ type $output = typeof $output;
196
+ declare const $input: unique symbol;
197
+ type $input = typeof $input;
198
+ type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S>; }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S>; } : Meta;
199
+ type MetadataType = object | undefined;
200
+ declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
201
+ _meta: Meta;
202
+ _schema: Schema;
203
+ _map: WeakMap<Schema, $replace<Meta, Schema>>;
204
+ _idmap: Map<string, Schema>;
205
+ add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
206
+ clear(): this;
207
+ remove(schema: Schema): this;
208
+ get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
209
+ has(schema: Schema): boolean;
210
+ }
211
+ interface JSONSchemaMeta {
212
+ id?: string | undefined;
213
+ title?: string | undefined;
214
+ description?: string | undefined;
215
+ deprecated?: boolean | undefined;
216
+ [k: string]: unknown;
217
+ }
218
+ interface GlobalMeta extends JSONSchemaMeta {}
219
+ //#endregion
220
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/to-json-schema.d.cts
221
+ type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
222
+ interface JSONSchemaGeneratorParams {
223
+ processors: Record<string, Processor>;
224
+ /** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
225
+ * @default globalRegistry */
226
+ metadata?: $ZodRegistry<Record<string, any>>;
227
+ /** The JSON Schema version to target.
228
+ * - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
229
+ * - `"draft-07"` — JSON Schema Draft 7
230
+ * - `"draft-04"` — JSON Schema Draft 4
231
+ * - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
232
+ target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
233
+ /** How to handle unrepresentable types.
234
+ * - `"throw"` — Default. Unrepresentable types throw an error
235
+ * - `"any"` — Unrepresentable types become `{}` */
236
+ unrepresentable?: "throw" | "any";
237
+ /** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
238
+ override?: (ctx: {
239
+ zodSchema: $ZodTypes;
240
+ jsonSchema: BaseSchema;
241
+ path: (string | number)[];
242
+ }) => void;
243
+ /** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
244
+ * - `"output"` — Default. Convert the output schema.
245
+ * - `"input"` — Convert the input schema. */
246
+ io?: "input" | "output";
247
+ cycles?: "ref" | "throw";
248
+ reused?: "ref" | "inline";
249
+ external?: {
250
+ registry: $ZodRegistry<{
251
+ id?: string | undefined;
252
+ }>;
253
+ uri?: ((id: string) => string) | undefined;
254
+ defs: Record<string, BaseSchema>;
255
+ } | undefined;
256
+ }
257
+ /**
258
+ * Parameters for the toJSONSchema function.
259
+ */
260
+ type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
261
+ interface ProcessParams {
262
+ schemaPath: $ZodType[];
263
+ path: (string | number)[];
264
+ }
265
+ interface Seen {
266
+ /** JSON Schema result for this Zod schema */
267
+ schema: BaseSchema;
268
+ /** A cached version of the schema that doesn't get overwritten during ref resolution */
269
+ def?: BaseSchema;
270
+ defId?: string | undefined;
271
+ /** Number of times this schema was encountered during traversal */
272
+ count: number;
273
+ /** Cycle path */
274
+ cycle?: (string | number)[] | undefined;
275
+ isParent?: boolean | undefined;
276
+ /** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
277
+ ref?: $ZodType | null;
278
+ /** JSON Schema property path for this schema */
279
+ path?: (string | number)[] | undefined;
280
+ }
281
+ interface ToJSONSchemaContext {
282
+ processors: Record<string, Processor>;
283
+ metadataRegistry: $ZodRegistry<Record<string, any>>;
284
+ target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
285
+ unrepresentable: "throw" | "any";
286
+ override: (ctx: {
287
+ zodSchema: $ZodType;
288
+ jsonSchema: BaseSchema;
289
+ path: (string | number)[];
290
+ }) => void;
291
+ io: "input" | "output";
292
+ counter: number;
293
+ seen: Map<$ZodType, Seen>;
294
+ cycles: "ref" | "throw";
295
+ reused: "ref" | "inline";
296
+ external?: {
297
+ registry: $ZodRegistry<{
298
+ id?: string | undefined;
299
+ }>;
300
+ uri?: ((id: string) => string) | undefined;
301
+ defs: Record<string, BaseSchema>;
302
+ } | undefined;
303
+ }
304
+ type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
305
+ interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
306
+ "~standard": ZodStandardSchemaWithJSON$1<T>;
307
+ }
308
+ //#endregion
309
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/util.d.cts
310
+ type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
311
+ type MimeTypes = "application/json" | "application/xml" | "application/x-www-form-urlencoded" | "application/javascript" | "application/pdf" | "application/zip" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-powerpoint" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/octet-stream" | "application/graphql" | "text/html" | "text/plain" | "text/css" | "text/javascript" | "text/csv" | "image/png" | "image/jpeg" | "image/gif" | "image/svg+xml" | "image/webp" | "audio/mpeg" | "audio/ogg" | "audio/wav" | "audio/webm" | "video/mp4" | "video/webm" | "video/ogg" | "font/woff" | "font/woff2" | "font/ttf" | "font/otf" | "multipart/form-data" | (string & {});
312
+ type IsAny<T> = 0 extends 1 & T ? true : false;
313
+ type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
314
+ type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
315
+ type NoUndefined<T> = T extends undefined ? never : T;
316
+ type LoosePartial<T extends object> = InexactPartial<T> & {
317
+ [k: string]: unknown;
318
+ };
319
+ type Mask<Keys extends PropertyKey> = { [K in Keys]?: true; };
320
+ type Writeable<T> = { -readonly [P in keyof T]: T[P]; } & {};
321
+ type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined; };
322
+ type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
323
+ readonly [Symbol.toStringTag]: string;
324
+ } | Date | Error | Generator | Promise<unknown> | RegExp;
325
+ type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
326
+ type SomeObject = Record<PropertyKey, any>;
327
+ type Identity<T> = T;
328
+ type Flatten<T> = Identity<{ [k in keyof T]: T[k]; }>;
329
+ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
330
+ type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K]; } & { [K in keyof B]: B[K]; }>;
331
+ type TupleItems = ReadonlyArray<SomeType>;
332
+ type AnyFunc = (...args: any[]) => any;
333
+ type MaybeAsync<T> = T | Promise<T>;
334
+ type EnumValue = string | number;
335
+ type EnumLike = Readonly<Record<string, EnumValue>>;
336
+ type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k; }>;
337
+ type Literal = string | number | bigint | boolean | null | undefined;
338
+ type Primitive = string | number | symbol | bigint | boolean | null | undefined;
339
+ type HasLength = {
340
+ length: number;
341
+ };
342
+ type PropValues = Record<string, Set<Primitive>>;
343
+ type PrimitiveSet = Set<Primitive>;
344
+ type EmptyToNever<T> = keyof T extends never ? never : T;
345
+ declare abstract class Class {
346
+ constructor(..._args: any[]);
347
+ }
348
+ //#endregion
349
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/versions.d.cts
350
+ declare const version: {
351
+ readonly major: 4;
352
+ readonly minor: 4;
353
+ readonly patch: number;
354
+ };
355
+ //#endregion
356
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/schemas.d.cts
357
+ interface ParseContext<T extends $ZodIssueBase = never> {
358
+ /** Customize error messages. */
359
+ readonly error?: $ZodErrorMap<T>;
360
+ /** Include the `input` field in issue objects. Default `false`. */
361
+ readonly reportInput?: boolean;
362
+ /** Skip eval-based fast path. Default `false`. */
363
+ readonly jitless?: boolean;
364
+ }
365
+ /** @internal */
366
+ interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
367
+ readonly async?: boolean | undefined;
368
+ readonly direction?: "forward" | "backward";
369
+ readonly skipChecks?: boolean;
370
+ }
371
+ interface ParsePayload<T = unknown> {
372
+ value: T;
373
+ issues: $ZodRawIssue[];
374
+ /** A way to mark a whole payload as aborted. Used in codecs/pipes. */
375
+ aborted?: boolean;
376
+ /** @internal Marks a value as a fallback that an outer wrapper (e.g.
377
+ * $ZodOptional) may override with its own interpretation when input was
378
+ * undefined. Set by $ZodCatch when catchValue substitutes and by every
379
+ * $ZodTransform invocation. */
380
+ fallback?: boolean | undefined;
381
+ }
382
+ type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
383
+ interface $ZodTypeDef {
384
+ type: "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "null" | "undefined" | "void" | "never" | "any" | "unknown" | "date" | "object" | "record" | "file" | "array" | "tuple" | "union" | "intersection" | "map" | "set" | "enum" | "literal" | "nullable" | "optional" | "nonoptional" | "success" | "transform" | "default" | "prefault" | "catch" | "nan" | "pipe" | "readonly" | "template_literal" | "promise" | "lazy" | "function" | "custom";
385
+ error?: $ZodErrorMap<never> | undefined;
386
+ checks?: $ZodCheck<never>[];
387
+ }
388
+ interface _$ZodTypeInternals {
389
+ /** The `@zod/core` version of this schema */
390
+ version: typeof version;
391
+ /** Schema definition. */
392
+ def: $ZodTypeDef;
393
+ /** @internal Randomly generated ID for this schema. */
394
+ /** @internal List of deferred initializers. */
395
+ deferred: AnyFunc[] | undefined;
396
+ /** @internal Parses input and runs all checks (refinements). */
397
+ run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
398
+ /** @internal Parses input, doesn't run checks. */
399
+ parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
400
+ /** @internal Stores identifiers for the set of traits implemented by this schema. */
401
+ traits: Set<string>;
402
+ /** @internal Indicates that a schema output type should be considered optional inside objects.
403
+ * @default Required
404
+ */
405
+ /** @internal */
406
+ optin?: "optional" | undefined;
407
+ /** @internal */
408
+ optout?: "optional" | undefined;
409
+ /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
410
+ *
411
+ * Defined on: enum, const, literal, null, undefined
412
+ * Passthrough: optional, nullable, branded, default, catch, pipe
413
+ * Todo: unions?
414
+ */
415
+ values?: PrimitiveSet | undefined;
416
+ /** Default value bubbled up from */
417
+ /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
418
+ propValues?: PropValues | undefined;
419
+ /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
420
+ pattern: RegExp | undefined;
421
+ /** @internal The constructor function of this schema. */
422
+ constr: new (def: any) => $ZodType;
423
+ /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
424
+ bag: Record<string, unknown>;
425
+ /** @internal The set of issues this schema might throw during type checking. */
426
+ isst: $ZodIssueBase;
427
+ /** @internal Subject to change, not a public API. */
428
+ processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
429
+ /** An optional method used to override `toJSONSchema` logic. */
430
+ toJSONSchema?: () => unknown;
431
+ /** @internal The parent of this schema. Only set during certain clone operations. */
432
+ parent?: $ZodType | undefined;
433
+ }
434
+ /** @internal */
435
+ interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
436
+ /** @internal The inferred output type */
437
+ output: O;
438
+ /** @internal The inferred input type */
439
+ input: I;
440
+ }
441
+ type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
442
+ type SomeType = {
443
+ _zod: _$ZodTypeInternals;
444
+ };
445
+ interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
446
+ _zod: Internals;
447
+ "~standard": $ZodStandardSchema<this>;
448
+ }
449
+ interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
450
+ declare const $ZodType: $constructor<$ZodType>;
451
+ interface $ZodStringDef extends $ZodTypeDef {
452
+ type: "string";
453
+ coerce?: boolean;
454
+ checks?: $ZodCheck<string>[];
455
+ }
456
+ interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
457
+ def: $ZodStringDef;
458
+ /** @deprecated Internal API, use with caution (not deprecated) */
459
+ pattern: RegExp;
460
+ /** @deprecated Internal API, use with caution (not deprecated) */
461
+ isst: $ZodIssueInvalidType;
462
+ bag: LoosePartial<{
463
+ minimum: number;
464
+ maximum: number;
465
+ patterns: Set<RegExp>;
466
+ format: string;
467
+ contentEncoding: string;
468
+ }>;
469
+ }
470
+ interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
471
+ declare const $ZodString: $constructor<$ZodString>;
472
+ interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {}
473
+ interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
474
+ def: $ZodStringFormatDef<Format>;
475
+ }
476
+ interface $ZodStringFormat<Format extends string = string> extends $ZodType {
477
+ _zod: $ZodStringFormatInternals<Format>;
478
+ }
479
+ declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
480
+ interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {}
481
+ interface $ZodGUID extends $ZodType {
482
+ _zod: $ZodGUIDInternals;
483
+ }
484
+ declare const $ZodGUID: $constructor<$ZodGUID>;
485
+ interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
486
+ version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
487
+ }
488
+ interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
489
+ def: $ZodUUIDDef;
490
+ }
491
+ interface $ZodUUID extends $ZodType {
492
+ _zod: $ZodUUIDInternals;
493
+ }
494
+ declare const $ZodUUID: $constructor<$ZodUUID>;
495
+ interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {}
496
+ interface $ZodEmail extends $ZodType {
497
+ _zod: $ZodEmailInternals;
498
+ }
499
+ declare const $ZodEmail: $constructor<$ZodEmail>;
500
+ interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
501
+ hostname?: RegExp | undefined;
502
+ protocol?: RegExp | undefined;
503
+ normalize?: boolean | undefined;
504
+ }
505
+ interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
506
+ def: $ZodURLDef;
507
+ }
508
+ interface $ZodURL extends $ZodType {
509
+ _zod: $ZodURLInternals;
510
+ }
511
+ declare const $ZodURL: $constructor<$ZodURL>;
512
+ interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {}
513
+ interface $ZodEmoji extends $ZodType {
514
+ _zod: $ZodEmojiInternals;
515
+ }
516
+ declare const $ZodEmoji: $constructor<$ZodEmoji>;
517
+ interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {}
518
+ interface $ZodNanoID extends $ZodType {
519
+ _zod: $ZodNanoIDInternals;
520
+ }
521
+ declare const $ZodNanoID: $constructor<$ZodNanoID>;
522
+ /**
523
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
524
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
525
+ * See https://github.com/paralleldrive/cuid.
526
+ */
527
+ interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {}
528
+ /**
529
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
530
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
531
+ * See https://github.com/paralleldrive/cuid.
532
+ */
533
+ interface $ZodCUID extends $ZodType {
534
+ _zod: $ZodCUIDInternals;
535
+ }
536
+ /**
537
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
538
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
539
+ * See https://github.com/paralleldrive/cuid.
540
+ */
541
+ declare const $ZodCUID: $constructor<$ZodCUID>;
542
+ interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {}
543
+ interface $ZodCUID2 extends $ZodType {
544
+ _zod: $ZodCUID2Internals;
545
+ }
546
+ declare const $ZodCUID2: $constructor<$ZodCUID2>;
547
+ interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {}
548
+ interface $ZodULID extends $ZodType {
549
+ _zod: $ZodULIDInternals;
550
+ }
551
+ declare const $ZodULID: $constructor<$ZodULID>;
552
+ interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {}
553
+ interface $ZodXID extends $ZodType {
554
+ _zod: $ZodXIDInternals;
555
+ }
556
+ declare const $ZodXID: $constructor<$ZodXID>;
557
+ interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {}
558
+ interface $ZodKSUID extends $ZodType {
559
+ _zod: $ZodKSUIDInternals;
560
+ }
561
+ declare const $ZodKSUID: $constructor<$ZodKSUID>;
562
+ interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
563
+ precision: number | null;
564
+ offset: boolean;
565
+ local: boolean;
566
+ }
567
+ interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
568
+ def: $ZodISODateTimeDef;
569
+ }
570
+ interface $ZodISODateTime extends $ZodType {
571
+ _zod: $ZodISODateTimeInternals;
572
+ }
573
+ declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
574
+ interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {}
575
+ interface $ZodISODate extends $ZodType {
576
+ _zod: $ZodISODateInternals;
577
+ }
578
+ declare const $ZodISODate: $constructor<$ZodISODate>;
579
+ interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
580
+ precision?: number | null;
581
+ }
582
+ interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
583
+ def: $ZodISOTimeDef;
584
+ }
585
+ interface $ZodISOTime extends $ZodType {
586
+ _zod: $ZodISOTimeInternals;
587
+ }
588
+ declare const $ZodISOTime: $constructor<$ZodISOTime>;
589
+ interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {}
590
+ interface $ZodISODuration extends $ZodType {
591
+ _zod: $ZodISODurationInternals;
592
+ }
593
+ declare const $ZodISODuration: $constructor<$ZodISODuration>;
594
+ interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
595
+ version?: "v4";
596
+ }
597
+ interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
598
+ def: $ZodIPv4Def;
599
+ }
600
+ interface $ZodIPv4 extends $ZodType {
601
+ _zod: $ZodIPv4Internals;
602
+ }
603
+ declare const $ZodIPv4: $constructor<$ZodIPv4>;
604
+ interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
605
+ version?: "v6";
606
+ }
607
+ interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
608
+ def: $ZodIPv6Def;
609
+ }
610
+ interface $ZodIPv6 extends $ZodType {
611
+ _zod: $ZodIPv6Internals;
612
+ }
613
+ declare const $ZodIPv6: $constructor<$ZodIPv6>;
614
+ interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
615
+ version?: "v4";
616
+ }
617
+ interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
618
+ def: $ZodCIDRv4Def;
619
+ }
620
+ interface $ZodCIDRv4 extends $ZodType {
621
+ _zod: $ZodCIDRv4Internals;
622
+ }
623
+ declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
624
+ interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
625
+ version?: "v6";
626
+ }
627
+ interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
628
+ def: $ZodCIDRv6Def;
629
+ }
630
+ interface $ZodCIDRv6 extends $ZodType {
631
+ _zod: $ZodCIDRv6Internals;
632
+ }
633
+ declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
634
+ interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {}
635
+ interface $ZodBase64 extends $ZodType {
636
+ _zod: $ZodBase64Internals;
637
+ }
638
+ declare const $ZodBase64: $constructor<$ZodBase64>;
639
+ interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}
640
+ interface $ZodBase64URL extends $ZodType {
641
+ _zod: $ZodBase64URLInternals;
642
+ }
643
+ declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
644
+ interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {}
645
+ interface $ZodE164 extends $ZodType {
646
+ _zod: $ZodE164Internals;
647
+ }
648
+ declare const $ZodE164: $constructor<$ZodE164>;
649
+ interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
650
+ alg?: JWTAlgorithm | undefined;
651
+ }
652
+ interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
653
+ def: $ZodJWTDef;
654
+ }
655
+ interface $ZodJWT extends $ZodType {
656
+ _zod: $ZodJWTInternals;
657
+ }
658
+ declare const $ZodJWT: $constructor<$ZodJWT>;
659
+ interface $ZodNumberDef extends $ZodTypeDef {
660
+ type: "number";
661
+ coerce?: boolean;
662
+ }
663
+ interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
664
+ def: $ZodNumberDef;
665
+ /** @deprecated Internal API, use with caution (not deprecated) */
666
+ pattern: RegExp;
667
+ /** @deprecated Internal API, use with caution (not deprecated) */
668
+ isst: $ZodIssueInvalidType;
669
+ bag: LoosePartial<{
670
+ minimum: number;
671
+ maximum: number;
672
+ exclusiveMinimum: number;
673
+ exclusiveMaximum: number;
674
+ format: string;
675
+ pattern: RegExp;
676
+ }>;
677
+ }
678
+ interface $ZodNumber<Input = unknown> extends $ZodType {
679
+ _zod: $ZodNumberInternals<Input>;
680
+ }
681
+ declare const $ZodNumber: $constructor<$ZodNumber>;
682
+ interface $ZodBooleanDef extends $ZodTypeDef {
683
+ type: "boolean";
684
+ coerce?: boolean;
685
+ checks?: $ZodCheck<boolean>[];
686
+ }
687
+ interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
688
+ pattern: RegExp;
689
+ def: $ZodBooleanDef;
690
+ isst: $ZodIssueInvalidType;
691
+ }
692
+ interface $ZodBoolean<T = unknown> extends $ZodType {
693
+ _zod: $ZodBooleanInternals<T>;
694
+ }
695
+ declare const $ZodBoolean: $constructor<$ZodBoolean>;
696
+ interface $ZodBigIntDef extends $ZodTypeDef {
697
+ type: "bigint";
698
+ coerce?: boolean;
699
+ }
700
+ interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
701
+ pattern: RegExp;
702
+ /** @internal Internal API, use with caution */
703
+ def: $ZodBigIntDef;
704
+ isst: $ZodIssueInvalidType;
705
+ bag: LoosePartial<{
706
+ minimum: bigint;
707
+ maximum: bigint;
708
+ format: string;
709
+ }>;
710
+ }
711
+ interface $ZodBigInt<T = unknown> extends $ZodType {
712
+ _zod: $ZodBigIntInternals<T>;
713
+ }
714
+ declare const $ZodBigInt: $constructor<$ZodBigInt>;
715
+ interface $ZodSymbolDef extends $ZodTypeDef {
716
+ type: "symbol";
717
+ }
718
+ interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
719
+ def: $ZodSymbolDef;
720
+ isst: $ZodIssueInvalidType;
721
+ }
722
+ interface $ZodSymbol extends $ZodType {
723
+ _zod: $ZodSymbolInternals;
724
+ }
725
+ declare const $ZodSymbol: $constructor<$ZodSymbol>;
726
+ interface $ZodUndefinedDef extends $ZodTypeDef {
727
+ type: "undefined";
728
+ }
729
+ interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
730
+ pattern: RegExp;
731
+ def: $ZodUndefinedDef;
732
+ values: PrimitiveSet;
733
+ isst: $ZodIssueInvalidType;
734
+ }
735
+ interface $ZodUndefined extends $ZodType {
736
+ _zod: $ZodUndefinedInternals;
737
+ }
738
+ declare const $ZodUndefined: $constructor<$ZodUndefined>;
739
+ interface $ZodNullDef extends $ZodTypeDef {
740
+ type: "null";
741
+ }
742
+ interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
743
+ pattern: RegExp;
744
+ def: $ZodNullDef;
745
+ values: PrimitiveSet;
746
+ isst: $ZodIssueInvalidType;
747
+ }
748
+ interface $ZodNull extends $ZodType {
749
+ _zod: $ZodNullInternals;
750
+ }
751
+ declare const $ZodNull: $constructor<$ZodNull>;
752
+ interface $ZodAnyDef extends $ZodTypeDef {
753
+ type: "any";
754
+ }
755
+ interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
756
+ def: $ZodAnyDef;
757
+ isst: never;
758
+ }
759
+ interface $ZodAny extends $ZodType {
760
+ _zod: $ZodAnyInternals;
761
+ }
762
+ declare const $ZodAny: $constructor<$ZodAny>;
763
+ interface $ZodUnknownDef extends $ZodTypeDef {
764
+ type: "unknown";
765
+ }
766
+ interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
767
+ def: $ZodUnknownDef;
768
+ isst: never;
769
+ }
770
+ interface $ZodUnknown extends $ZodType {
771
+ _zod: $ZodUnknownInternals;
772
+ }
773
+ declare const $ZodUnknown: $constructor<$ZodUnknown>;
774
+ interface $ZodNeverDef extends $ZodTypeDef {
775
+ type: "never";
776
+ }
777
+ interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
778
+ def: $ZodNeverDef;
779
+ isst: $ZodIssueInvalidType;
780
+ }
781
+ interface $ZodNever extends $ZodType {
782
+ _zod: $ZodNeverInternals;
783
+ }
784
+ declare const $ZodNever: $constructor<$ZodNever>;
785
+ interface $ZodVoidDef extends $ZodTypeDef {
786
+ type: "void";
787
+ }
788
+ interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
789
+ def: $ZodVoidDef;
790
+ isst: $ZodIssueInvalidType;
791
+ }
792
+ interface $ZodVoid extends $ZodType {
793
+ _zod: $ZodVoidInternals;
794
+ }
795
+ declare const $ZodVoid: $constructor<$ZodVoid>;
796
+ interface $ZodDateDef extends $ZodTypeDef {
797
+ type: "date";
798
+ coerce?: boolean;
799
+ }
800
+ interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
801
+ def: $ZodDateDef;
802
+ isst: $ZodIssueInvalidType;
803
+ bag: LoosePartial<{
804
+ minimum: Date;
805
+ maximum: Date;
806
+ format: string;
807
+ }>;
808
+ }
809
+ interface $ZodDate<T = unknown> extends $ZodType {
810
+ _zod: $ZodDateInternals<T>;
811
+ }
812
+ declare const $ZodDate: $constructor<$ZodDate>;
813
+ interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
814
+ type: "array";
815
+ element: T;
816
+ }
817
+ interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
818
+ def: $ZodArrayDef<T>;
819
+ isst: $ZodIssueInvalidType;
820
+ output: output<T>[];
821
+ input: input<T>[];
822
+ }
823
+ interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
824
+ declare const $ZodArray: $constructor<$ZodArray>;
825
+ type OptionalOutSchema = {
826
+ _zod: {
827
+ optout: "optional";
828
+ };
829
+ };
830
+ type OptionalInSchema = {
831
+ _zod: {
832
+ optin: "optional";
833
+ };
834
+ };
835
+ type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"]; } & { -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"]; } & Extra>;
836
+ type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"]; } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"]; } & Extra>;
837
+ type $ZodObjectConfig = {
838
+ out: Record<string, unknown>;
839
+ in: Record<string, unknown>;
840
+ };
841
+ type $loose = {
842
+ out: Record<string, unknown>;
843
+ in: Record<string, unknown>;
844
+ };
845
+ type $strict = {
846
+ out: {};
847
+ in: {};
848
+ };
849
+ type $strip = {
850
+ out: {};
851
+ in: {};
852
+ };
853
+ type $catchall<T extends SomeType> = {
854
+ out: {
855
+ [k: string]: output<T>;
856
+ };
857
+ in: {
858
+ [k: string]: input<T>;
859
+ };
860
+ };
861
+ type $ZodShape = Readonly<{
862
+ [k: string]: $ZodType;
863
+ }>;
864
+ interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
865
+ type: "object";
866
+ shape: Shape;
867
+ catchall?: $ZodType | undefined;
868
+ }
869
+ interface $ZodObjectInternals<
870
+ /** @ts-ignore Cast variance */
871
+ out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
872
+ def: $ZodObjectDef<Shape>;
873
+ config: Config;
874
+ isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
875
+ propValues: PropValues;
876
+ output: $InferObjectOutput<Shape, Config["out"]>;
877
+ input: $InferObjectInput<Shape, Config["in"]>;
878
+ optin?: "optional" | undefined;
879
+ optout?: "optional" | undefined;
880
+ }
881
+ type $ZodLooseShape = Record<string, any>;
882
+ interface $ZodObject<
883
+ /** @ts-ignore Cast variance */
884
+ out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
885
+ declare const $ZodObject: $constructor<$ZodObject>;
886
+ type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
887
+ type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
888
+ interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
889
+ type: "union";
890
+ options: Options;
891
+ inclusive?: boolean;
892
+ }
893
+ type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
894
+ type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
895
+ interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
896
+ def: $ZodUnionDef<T>;
897
+ isst: $ZodIssueInvalidUnion;
898
+ pattern: T[number]["_zod"]["pattern"];
899
+ values: T[number]["_zod"]["values"];
900
+ output: $InferUnionOutput<T[number]>;
901
+ input: $InferUnionInput<T[number]>;
902
+ optin: IsOptionalIn<T[number]> extends false ? "optional" | undefined : "optional";
903
+ optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
904
+ }
905
+ interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
906
+ _zod: $ZodUnionInternals<T>;
907
+ }
908
+ declare const $ZodUnion: $constructor<$ZodUnion>;
909
+ interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
910
+ type: "intersection";
911
+ left: Left;
912
+ right: Right;
913
+ }
914
+ interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
915
+ def: $ZodIntersectionDef<A, B>;
916
+ isst: never;
917
+ optin: A["_zod"]["optin"] | B["_zod"]["optin"];
918
+ optout: A["_zod"]["optout"] | B["_zod"]["optout"];
919
+ output: output<A> & output<B>;
920
+ input: input<A> & input<B>;
921
+ }
922
+ interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
923
+ _zod: $ZodIntersectionInternals<A, B>;
924
+ }
925
+ declare const $ZodIntersection: $constructor<$ZodIntersection>;
926
+ interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
927
+ type: "tuple";
928
+ items: T;
929
+ rest: Rest;
930
+ }
931
+ type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input<Rest>[] : [])];
932
+ type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input<T[k]>; };
933
+ type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" ? [...TupleInputTypeWithOptionals<Prefix>, input<Tail>?] : TupleInputTypeNoOptionals<T> : [];
934
+ type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output<Rest>[] : [])];
935
+ type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output<T[k]>; };
936
+ type TupleOutputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optout"] extends "optional" ? [...TupleOutputTypeWithOptionals<Prefix>, output<Tail>?] : TupleOutputTypeNoOptionals<T> : [];
937
+ interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
938
+ def: $ZodTupleDef<T, Rest>;
939
+ isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
940
+ output: $InferTupleOutputType<T, Rest>;
941
+ input: $InferTupleInputType<T, Rest>;
942
+ }
943
+ interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
944
+ _zod: $ZodTupleInternals<T, Rest>;
945
+ }
946
+ declare const $ZodTuple: $constructor<$ZodTuple>;
947
+ type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
948
+ interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
949
+ type: "record";
950
+ keyType: Key;
951
+ valueType: Value;
952
+ /** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
953
+ mode?: "strict" | "loose";
954
+ }
955
+ type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
956
+ type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : Record<input<Key> & PropertyKey, input<Value>>;
957
+ interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
958
+ def: $ZodRecordDef<Key, Value>;
959
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
960
+ optin?: "optional" | undefined;
961
+ optout?: "optional" | undefined;
962
+ }
963
+ type $partial = {
964
+ "~~partial": true;
965
+ };
966
+ interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
967
+ _zod: $ZodRecordInternals<Key, Value>;
968
+ }
969
+ declare const $ZodRecord: $constructor<$ZodRecord>;
970
+ interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
971
+ type: "map";
972
+ keyType: Key;
973
+ valueType: Value;
974
+ }
975
+ interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
976
+ def: $ZodMapDef<Key, Value>;
977
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
978
+ optin?: "optional" | undefined;
979
+ optout?: "optional" | undefined;
980
+ }
981
+ interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
982
+ _zod: $ZodMapInternals<Key, Value>;
983
+ }
984
+ declare const $ZodMap: $constructor<$ZodMap>;
985
+ interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
986
+ type: "set";
987
+ valueType: T;
988
+ }
989
+ interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input<T>>> {
990
+ def: $ZodSetDef<T>;
991
+ isst: $ZodIssueInvalidType;
992
+ optin?: "optional" | undefined;
993
+ optout?: "optional" | undefined;
994
+ }
995
+ interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
996
+ _zod: $ZodSetInternals<T>;
997
+ }
998
+ declare const $ZodSet: $constructor<$ZodSet>;
999
+ type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
1000
+ type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
1001
+ interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
1002
+ type: "enum";
1003
+ entries: T;
1004
+ }
1005
+ interface $ZodEnumInternals<
1006
+ /** @ts-ignore Cast variance */
1007
+ out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
1008
+ def: $ZodEnumDef<T>;
1009
+ /** @deprecated Internal API, use with caution (not deprecated) */
1010
+ values: PrimitiveSet;
1011
+ /** @deprecated Internal API, use with caution (not deprecated) */
1012
+ pattern: RegExp;
1013
+ isst: $ZodIssueInvalidValue;
1014
+ }
1015
+ interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
1016
+ _zod: $ZodEnumInternals<T>;
1017
+ }
1018
+ declare const $ZodEnum: $constructor<$ZodEnum>;
1019
+ interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
1020
+ type: "literal";
1021
+ values: T[];
1022
+ }
1023
+ interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
1024
+ def: $ZodLiteralDef<T>;
1025
+ values: Set<T>;
1026
+ pattern: RegExp;
1027
+ isst: $ZodIssueInvalidValue;
1028
+ }
1029
+ interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
1030
+ _zod: $ZodLiteralInternals<T>;
1031
+ }
1032
+ declare const $ZodLiteral: $constructor<$ZodLiteral>;
1033
+ /** Do not reference this directly. */
1034
+ interface File extends _File {
1035
+ readonly type: string;
1036
+ readonly size: number;
1037
+ }
1038
+ interface $ZodFileDef extends $ZodTypeDef {
1039
+ type: "file";
1040
+ }
1041
+ interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
1042
+ def: $ZodFileDef;
1043
+ isst: $ZodIssueInvalidType;
1044
+ bag: LoosePartial<{
1045
+ minimum: number;
1046
+ maximum: number;
1047
+ mime: MimeTypes[];
1048
+ }>;
1049
+ }
1050
+ interface $ZodFile extends $ZodType {
1051
+ _zod: $ZodFileInternals;
1052
+ }
1053
+ declare const $ZodFile: $constructor<$ZodFile>;
1054
+ interface $ZodTransformDef extends $ZodTypeDef {
1055
+ type: "transform";
1056
+ transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
1057
+ }
1058
+ interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
1059
+ def: $ZodTransformDef;
1060
+ isst: never;
1061
+ }
1062
+ interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
1063
+ _zod: $ZodTransformInternals<O, I>;
1064
+ }
1065
+ declare const $ZodTransform: $constructor<$ZodTransform>;
1066
+ interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1067
+ type: "optional";
1068
+ innerType: T;
1069
+ }
1070
+ interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
1071
+ def: $ZodOptionalDef<T>;
1072
+ optin: "optional";
1073
+ optout: "optional";
1074
+ isst: never;
1075
+ values: T["_zod"]["values"];
1076
+ pattern: T["_zod"]["pattern"];
1077
+ }
1078
+ interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
1079
+ _zod: $ZodOptionalInternals<T>;
1080
+ }
1081
+ declare const $ZodOptional: $constructor<$ZodOptional>;
1082
+ interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
1083
+ interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
1084
+ def: $ZodExactOptionalDef<T>;
1085
+ output: output<T>;
1086
+ input: input<T>;
1087
+ }
1088
+ interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
1089
+ _zod: $ZodExactOptionalInternals<T>;
1090
+ }
1091
+ declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
1092
+ interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1093
+ type: "nullable";
1094
+ innerType: T;
1095
+ }
1096
+ interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
1097
+ def: $ZodNullableDef<T>;
1098
+ optin: T["_zod"]["optin"];
1099
+ optout: T["_zod"]["optout"];
1100
+ isst: never;
1101
+ values: T["_zod"]["values"];
1102
+ pattern: T["_zod"]["pattern"];
1103
+ }
1104
+ interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
1105
+ _zod: $ZodNullableInternals<T>;
1106
+ }
1107
+ declare const $ZodNullable: $constructor<$ZodNullable>;
1108
+ interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1109
+ type: "default";
1110
+ innerType: T;
1111
+ /** The default value. May be a getter. */
1112
+ defaultValue: NoUndefined<output<T>>;
1113
+ }
1114
+ interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1115
+ def: $ZodDefaultDef<T>;
1116
+ optin: "optional";
1117
+ optout?: "optional" | undefined;
1118
+ isst: never;
1119
+ values: T["_zod"]["values"];
1120
+ }
1121
+ interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
1122
+ _zod: $ZodDefaultInternals<T>;
1123
+ }
1124
+ declare const $ZodDefault: $constructor<$ZodDefault>;
1125
+ interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1126
+ type: "prefault";
1127
+ innerType: T;
1128
+ /** The default value. May be a getter. */
1129
+ defaultValue: input<T>;
1130
+ }
1131
+ interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1132
+ def: $ZodPrefaultDef<T>;
1133
+ optin: "optional";
1134
+ optout?: "optional" | undefined;
1135
+ isst: never;
1136
+ values: T["_zod"]["values"];
1137
+ }
1138
+ interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
1139
+ _zod: $ZodPrefaultInternals<T>;
1140
+ }
1141
+ declare const $ZodPrefault: $constructor<$ZodPrefault>;
1142
+ interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1143
+ type: "nonoptional";
1144
+ innerType: T;
1145
+ }
1146
+ interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
1147
+ def: $ZodNonOptionalDef<T>;
1148
+ isst: $ZodIssueInvalidType;
1149
+ values: T["_zod"]["values"];
1150
+ optin: "optional" | undefined;
1151
+ optout: "optional" | undefined;
1152
+ }
1153
+ interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
1154
+ _zod: $ZodNonOptionalInternals<T>;
1155
+ }
1156
+ declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
1157
+ interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1158
+ type: "success";
1159
+ innerType: T;
1160
+ }
1161
+ interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input<T>> {
1162
+ def: $ZodSuccessDef<T>;
1163
+ isst: never;
1164
+ optin: T["_zod"]["optin"];
1165
+ optout: "optional" | undefined;
1166
+ }
1167
+ interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
1168
+ _zod: $ZodSuccessInternals<T>;
1169
+ }
1170
+ declare const $ZodSuccess: $constructor<$ZodSuccess>;
1171
+ interface $ZodCatchCtx extends ParsePayload {
1172
+ /** @deprecated Use `ctx.issues` */
1173
+ error: {
1174
+ issues: $ZodIssue[];
1175
+ };
1176
+ /** @deprecated Use `ctx.value` */
1177
+ input: unknown;
1178
+ }
1179
+ interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1180
+ type: "catch";
1181
+ innerType: T;
1182
+ catchValue: (ctx: $ZodCatchCtx) => unknown;
1183
+ }
1184
+ interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1185
+ def: $ZodCatchDef<T>;
1186
+ optin: T["_zod"]["optin"];
1187
+ optout: T["_zod"]["optout"];
1188
+ isst: never;
1189
+ values: T["_zod"]["values"];
1190
+ }
1191
+ interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
1192
+ _zod: $ZodCatchInternals<T>;
1193
+ }
1194
+ declare const $ZodCatch: $constructor<$ZodCatch>;
1195
+ interface $ZodNaNDef extends $ZodTypeDef {
1196
+ type: "nan";
1197
+ }
1198
+ interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
1199
+ def: $ZodNaNDef;
1200
+ isst: $ZodIssueInvalidType;
1201
+ }
1202
+ interface $ZodNaN extends $ZodType {
1203
+ _zod: $ZodNaNInternals;
1204
+ }
1205
+ declare const $ZodNaN: $constructor<$ZodNaN>;
1206
+ interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
1207
+ type: "pipe";
1208
+ in: A;
1209
+ out: B;
1210
+ /** Only defined inside $ZodCodec instances. */
1211
+ transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input<B>>;
1212
+ /** Only defined inside $ZodCodec instances. */
1213
+ reverseTransform?: (value: input<B>, payload: ParsePayload<input<B>>) => MaybeAsync<output<A>>;
1214
+ }
1215
+ interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
1216
+ def: $ZodPipeDef<A, B>;
1217
+ isst: never;
1218
+ values: A["_zod"]["values"];
1219
+ optin: A["_zod"]["optin"];
1220
+ optout: B["_zod"]["optout"];
1221
+ propValues: A["_zod"]["propValues"];
1222
+ }
1223
+ interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
1224
+ _zod: $ZodPipeInternals<A, B>;
1225
+ }
1226
+ declare const $ZodPipe: $constructor<$ZodPipe>;
1227
+ interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1228
+ type: "readonly";
1229
+ innerType: T;
1230
+ }
1231
+ interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
1232
+ def: $ZodReadonlyDef<T>;
1233
+ optin: T["_zod"]["optin"];
1234
+ optout: T["_zod"]["optout"];
1235
+ isst: never;
1236
+ propValues: T["_zod"]["propValues"];
1237
+ values: T["_zod"]["values"];
1238
+ }
1239
+ interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
1240
+ _zod: $ZodReadonlyInternals<T>;
1241
+ }
1242
+ declare const $ZodReadonly: $constructor<$ZodReadonly>;
1243
+ interface $ZodTemplateLiteralDef extends $ZodTypeDef {
1244
+ type: "template_literal";
1245
+ parts: $ZodTemplateLiteralPart[];
1246
+ format?: string | undefined;
1247
+ }
1248
+ interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
1249
+ pattern: RegExp;
1250
+ def: $ZodTemplateLiteralDef;
1251
+ isst: $ZodIssueInvalidType;
1252
+ }
1253
+ interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
1254
+ _zod: $ZodTemplateLiteralInternals<Template>;
1255
+ }
1256
+ type LiteralPart = Exclude<Literal, symbol>;
1257
+ interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
1258
+ pattern: RegExp;
1259
+ }
1260
+ interface SchemaPart extends $ZodType {
1261
+ _zod: SchemaPartInternals;
1262
+ }
1263
+ type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
1264
+ declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
1265
+ type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
1266
+ type $ZodFunctionIn = $ZodFunctionArgs;
1267
+ type $ZodFunctionOut = $ZodType;
1268
+ type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input<Returns>;
1269
+ type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input<Returns>>;
1270
+ type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => output<Returns>;
1271
+ type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => Promise<output<Returns>>;
1272
+ interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
1273
+ type: "function";
1274
+ input: In;
1275
+ output: Out;
1276
+ }
1277
+ interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
1278
+ def: $ZodFunctionDef<Args, Returns>;
1279
+ isst: $ZodIssueInvalidType;
1280
+ }
1281
+ interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
1282
+ /** @deprecated */
1283
+ _def: $ZodFunctionDef<Args, Returns>;
1284
+ _input: $InferInnerFunctionType<Args, Returns>;
1285
+ _output: $InferOuterFunctionType<Args, Returns>;
1286
+ implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
1287
+ implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
1288
+ input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
1289
+ input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
1290
+ input(...args: any[]): $ZodFunction<any, Returns>;
1291
+ output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
1292
+ }
1293
+ declare const $ZodFunction: $constructor<$ZodFunction>;
1294
+ interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1295
+ type: "promise";
1296
+ innerType: T;
1297
+ }
1298
+ interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input<T>>> {
1299
+ def: $ZodPromiseDef<T>;
1300
+ isst: never;
1301
+ }
1302
+ interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
1303
+ _zod: $ZodPromiseInternals<T>;
1304
+ }
1305
+ declare const $ZodPromise: $constructor<$ZodPromise>;
1306
+ interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1307
+ type: "lazy";
1308
+ getter: () => T;
1309
+ }
1310
+ interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1311
+ def: $ZodLazyDef<T>;
1312
+ isst: never;
1313
+ /** Auto-cached way to retrieve the inner schema */
1314
+ innerType: T;
1315
+ pattern: T["_zod"]["pattern"];
1316
+ propValues: T["_zod"]["propValues"];
1317
+ optin: T["_zod"]["optin"];
1318
+ optout: T["_zod"]["optout"];
1319
+ }
1320
+ interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
1321
+ _zod: $ZodLazyInternals<T>;
1322
+ }
1323
+ declare const $ZodLazy: $constructor<$ZodLazy>;
1324
+ interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
1325
+ type: "custom";
1326
+ check: "custom";
1327
+ path?: PropertyKey[] | undefined;
1328
+ error?: $ZodErrorMap | undefined;
1329
+ params?: Record<string, any> | undefined;
1330
+ fn: (arg: O) => unknown;
1331
+ }
1332
+ interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
1333
+ def: $ZodCustomDef;
1334
+ issc: $ZodIssue;
1335
+ isst: never;
1336
+ bag: LoosePartial<{
1337
+ Class: typeof Class;
1338
+ }>;
1339
+ }
1340
+ interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
1341
+ _zod: $ZodCustomInternals<O, I>;
1342
+ }
1343
+ declare const $ZodCustom: $constructor<$ZodCustom>;
1344
+ type $ZodTypes = $ZodString | $ZodNumber | $ZodBigInt | $ZodBoolean | $ZodDate | $ZodSymbol | $ZodUndefined | $ZodNullable | $ZodNull | $ZodAny | $ZodUnknown | $ZodNever | $ZodVoid | $ZodArray | $ZodObject | $ZodUnion | $ZodIntersection | $ZodTuple | $ZodRecord | $ZodMap | $ZodSet | $ZodLiteral | $ZodEnum | $ZodFunction | $ZodPromise | $ZodLazy | $ZodOptional | $ZodDefault | $ZodPrefault | $ZodTemplateLiteral | $ZodCustom | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1345
+ //#endregion
1346
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/checks.d.cts
1347
+ interface $ZodCheckDef {
1348
+ check: string;
1349
+ error?: $ZodErrorMap<never> | undefined;
1350
+ /** If true, no later checks will be executed if this check fails. Default `false`. */
1351
+ abort?: boolean | undefined;
1352
+ /** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
1353
+ when?: ((payload: ParsePayload) => boolean) | undefined;
1354
+ }
1355
+ interface $ZodCheckInternals<T> {
1356
+ def: $ZodCheckDef;
1357
+ /** The set of issues this check might throw. */
1358
+ issc?: $ZodIssueBase;
1359
+ check(payload: ParsePayload<T>): MaybeAsync<void>;
1360
+ onattach: ((schema: $ZodType) => void)[];
1361
+ }
1362
+ interface $ZodCheck<in T = never> {
1363
+ _zod: $ZodCheckInternals<T>;
1364
+ }
1365
+ declare const $ZodCheck: $constructor<$ZodCheck<any>>;
1366
+ interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
1367
+ check: "max_length";
1368
+ maximum: number;
1369
+ }
1370
+ interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1371
+ def: $ZodCheckMaxLengthDef;
1372
+ issc: $ZodIssueTooBig<T>;
1373
+ }
1374
+ interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1375
+ _zod: $ZodCheckMaxLengthInternals<T>;
1376
+ }
1377
+ declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
1378
+ interface $ZodCheckMinLengthDef extends $ZodCheckDef {
1379
+ check: "min_length";
1380
+ minimum: number;
1381
+ }
1382
+ interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1383
+ def: $ZodCheckMinLengthDef;
1384
+ issc: $ZodIssueTooSmall<T>;
1385
+ }
1386
+ interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1387
+ _zod: $ZodCheckMinLengthInternals<T>;
1388
+ }
1389
+ declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
1390
+ interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
1391
+ check: "length_equals";
1392
+ length: number;
1393
+ }
1394
+ interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1395
+ def: $ZodCheckLengthEqualsDef;
1396
+ issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
1397
+ }
1398
+ interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
1399
+ _zod: $ZodCheckLengthEqualsInternals<T>;
1400
+ }
1401
+ declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
1402
+ type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
1403
+ interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
1404
+ check: "string_format";
1405
+ format: Format;
1406
+ pattern?: RegExp | undefined;
1407
+ }
1408
+ interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
1409
+ def: $ZodCheckStringFormatDef;
1410
+ issc: $ZodIssueInvalidStringFormat;
1411
+ }
1412
+ interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
1413
+ format: "regex";
1414
+ pattern: RegExp;
1415
+ }
1416
+ interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
1417
+ def: $ZodCheckRegexDef;
1418
+ issc: $ZodIssueInvalidStringFormat;
1419
+ }
1420
+ interface $ZodCheckRegex extends $ZodCheck<string> {
1421
+ _zod: $ZodCheckRegexInternals;
1422
+ }
1423
+ declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
1424
+ interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {}
1425
+ interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
1426
+ def: $ZodCheckLowerCaseDef;
1427
+ issc: $ZodIssueInvalidStringFormat;
1428
+ }
1429
+ interface $ZodCheckLowerCase extends $ZodCheck<string> {
1430
+ _zod: $ZodCheckLowerCaseInternals;
1431
+ }
1432
+ declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
1433
+ interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {}
1434
+ interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
1435
+ def: $ZodCheckUpperCaseDef;
1436
+ issc: $ZodIssueInvalidStringFormat;
1437
+ }
1438
+ interface $ZodCheckUpperCase extends $ZodCheck<string> {
1439
+ _zod: $ZodCheckUpperCaseInternals;
1440
+ }
1441
+ declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
1442
+ interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
1443
+ includes: string;
1444
+ position?: number | undefined;
1445
+ }
1446
+ interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
1447
+ def: $ZodCheckIncludesDef;
1448
+ issc: $ZodIssueInvalidStringFormat;
1449
+ }
1450
+ interface $ZodCheckIncludes extends $ZodCheck<string> {
1451
+ _zod: $ZodCheckIncludesInternals;
1452
+ }
1453
+ declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
1454
+ interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
1455
+ prefix: string;
1456
+ }
1457
+ interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
1458
+ def: $ZodCheckStartsWithDef;
1459
+ issc: $ZodIssueInvalidStringFormat;
1460
+ }
1461
+ interface $ZodCheckStartsWith extends $ZodCheck<string> {
1462
+ _zod: $ZodCheckStartsWithInternals;
1463
+ }
1464
+ declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
1465
+ interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
1466
+ suffix: string;
1467
+ }
1468
+ interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
1469
+ def: $ZodCheckEndsWithDef;
1470
+ issc: $ZodIssueInvalidStringFormat;
1471
+ }
1472
+ interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
1473
+ _zod: $ZodCheckEndsWithInternals;
1474
+ }
1475
+ declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
1476
+ //#endregion
1477
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/errors.d.cts
1478
+ interface $ZodIssueBase {
1479
+ readonly code?: string;
1480
+ readonly input?: unknown;
1481
+ readonly path: PropertyKey[];
1482
+ readonly message: string;
1483
+ }
1484
+ type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
1485
+ interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
1486
+ readonly code: "invalid_type";
1487
+ readonly expected: $ZodInvalidTypeExpected;
1488
+ readonly input?: Input;
1489
+ }
1490
+ interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
1491
+ readonly code: "too_big";
1492
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1493
+ readonly maximum: number | bigint;
1494
+ readonly inclusive?: boolean;
1495
+ readonly exact?: boolean;
1496
+ readonly input?: Input;
1497
+ }
1498
+ interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
1499
+ readonly code: "too_small";
1500
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1501
+ readonly minimum: number | bigint;
1502
+ /** True if the allowable range includes the minimum */
1503
+ readonly inclusive?: boolean;
1504
+ /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
1505
+ readonly exact?: boolean;
1506
+ readonly input?: Input;
1507
+ }
1508
+ interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
1509
+ readonly code: "invalid_format";
1510
+ readonly format: $ZodStringFormats | (string & {});
1511
+ readonly pattern?: string;
1512
+ readonly input?: string;
1513
+ }
1514
+ interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
1515
+ readonly code: "not_multiple_of";
1516
+ readonly divisor: number;
1517
+ readonly input?: Input;
1518
+ }
1519
+ interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
1520
+ readonly code: "unrecognized_keys";
1521
+ readonly keys: string[];
1522
+ readonly input?: Record<string, unknown>;
1523
+ }
1524
+ interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
1525
+ readonly code: "invalid_union";
1526
+ readonly errors: $ZodIssue[][];
1527
+ readonly input?: unknown;
1528
+ readonly discriminator?: string | undefined;
1529
+ readonly options?: Primitive[];
1530
+ readonly inclusive?: true;
1531
+ }
1532
+ interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
1533
+ readonly code: "invalid_union";
1534
+ readonly errors: [];
1535
+ readonly input?: unknown;
1536
+ readonly discriminator?: string | undefined;
1537
+ readonly inclusive: false;
1538
+ }
1539
+ type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
1540
+ interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
1541
+ readonly code: "invalid_key";
1542
+ readonly origin: "map" | "record";
1543
+ readonly issues: $ZodIssue[];
1544
+ readonly input?: Input;
1545
+ }
1546
+ interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
1547
+ readonly code: "invalid_element";
1548
+ readonly origin: "map" | "set";
1549
+ readonly key: unknown;
1550
+ readonly issues: $ZodIssue[];
1551
+ readonly input?: Input;
1552
+ }
1553
+ interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
1554
+ readonly code: "invalid_value";
1555
+ readonly values: Primitive[];
1556
+ readonly input?: Input;
1557
+ }
1558
+ interface $ZodIssueCustom extends $ZodIssueBase {
1559
+ readonly code: "custom";
1560
+ readonly params?: Record<string, any> | undefined;
1561
+ readonly input?: unknown;
1562
+ }
1563
+ type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
1564
+ type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
1565
+ type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
1566
+ /** The input data */
1567
+ readonly input: unknown;
1568
+ /** The schema or check that originated this issue. */
1569
+ readonly inst?: $ZodType | $ZodCheck;
1570
+ /** If `true`, Zod will continue executing checks/refinements after this issue. */
1571
+ readonly continue?: boolean | undefined;
1572
+ } & Record<string, unknown>> : never;
1573
+ type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
1574
+ interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
1575
+ (issue: $ZodRawIssue<T>): {
1576
+ message: string;
1577
+ } | string | undefined | null;
1578
+ }
1579
+ interface $ZodError<T = unknown> extends Error {
1580
+ type: T;
1581
+ issues: $ZodIssue[];
1582
+ _zod: {
1583
+ output: T;
1584
+ def: $ZodIssue[];
1585
+ };
1586
+ stack?: string;
1587
+ name: string;
1588
+ }
1589
+ declare const $ZodError: $constructor<$ZodError>;
1590
+ type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
1591
+ type _FlattenedError<T, U = string> = {
1592
+ formErrors: U[];
1593
+ fieldErrors: { [P in keyof T]?: U[]; };
1594
+ };
1595
+ type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U>; } : T extends any[] ? {
1596
+ [k: number]: $ZodFormattedError<T[number], U>;
1597
+ } : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U>; }> : any;
1598
+ type $ZodFormattedError<T, U = string> = {
1599
+ _errors: U[];
1600
+ } & Flatten<_ZodFormattedError<T, U>>;
1601
+ //#endregion
1602
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/core.d.cts
1603
+ type ZodTrait = {
1604
+ _zod: {
1605
+ def: any;
1606
+ [k: string]: any;
1607
+ };
1608
+ };
1609
+ interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
1610
+ new (def: D): T;
1611
+ init(inst: T, def: D): asserts inst is T;
1612
+ }
1613
+ declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void, params?: {
1614
+ Parent?: typeof Class;
1615
+ }): $constructor<T, D>;
1616
+ declare const $brand: unique symbol;
1617
+ type $brand<T extends string | number | symbol = string | number | symbol> = {
1618
+ [$brand]: { [k in T]: true; };
1619
+ };
1620
+ type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
1621
+ _zod: {
1622
+ input: input<T> & $brand<Brand>;
1623
+ output: output<T> & $brand<Brand>;
1624
+ };
1625
+ } : Dir extends "in" ? {
1626
+ _zod: {
1627
+ input: input<T> & $brand<Brand>;
1628
+ };
1629
+ } : {
1630
+ _zod: {
1631
+ output: output<T> & $brand<Brand>;
1632
+ };
1633
+ });
1634
+ type input<T> = T extends {
1635
+ _zod: {
1636
+ input: any;
1637
+ };
1638
+ } ? T["_zod"]["input"] : unknown;
1639
+ type output<T> = T extends {
1640
+ _zod: {
1641
+ output: any;
1642
+ };
1643
+ } ? T["_zod"]["output"] : unknown;
1644
+ //#endregion
1645
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/core/api.d.cts
1646
+ type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
1647
+ error?: string | $ZodErrorMap<IssueTypes> | undefined;
1648
+ /** @deprecated This parameter is deprecated. Use `error` instead. */
1649
+ message?: string | undefined;
1650
+ })>>>;
1651
+ type TypeParams<T extends $ZodType = $ZodType & {
1652
+ _isst: never;
1653
+ }, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
1654
+ type CheckParams<T extends $ZodCheck = $ZodCheck // & { _issc: never },
1655
+ , AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
1656
+ type CheckStringFormatParams<T extends $ZodStringFormat = $ZodStringFormat, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "coerce" | "checks" | "error" | "check" | "format"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "type" | "coerce" | "checks" | "error" | "check" | "format" | AlsoOmit>;
1657
+ type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
1658
+ type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
1659
+ type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
1660
+ type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
1661
+ type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
1662
+ type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
1663
+ type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when">;
1664
+ /**
1665
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1666
+ * (timestamps embedded in the id). Use {@link _cuid2} instead.
1667
+ * See https://github.com/paralleldrive/cuid.
1668
+ */
1669
+ type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
1670
+ type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
1671
+ type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
1672
+ type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
1673
+ type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
1674
+ type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
1675
+ type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
1676
+ type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
1677
+ type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
1678
+ type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
1679
+ type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
1680
+ type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
1681
+ type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
1682
+ type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
1683
+ type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
1684
+ type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
1685
+ type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
1686
+ type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
1687
+ type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
1688
+ type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
1689
+ type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
1690
+ type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
1691
+ type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
1692
+ type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
1693
+ type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
1694
+ type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
1695
+ type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
1696
+ type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
1697
+ type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
1698
+ type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
1699
+ type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
1700
+ /** The schema or check that originated this issue. */
1701
+ readonly inst?: $ZodType | $ZodCheck;
1702
+ /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
1703
+ readonly continue?: boolean | undefined;
1704
+ } & Record<string, unknown>> : never;
1705
+ interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
1706
+ addIssue(arg: string | $ZodSuperRefineIssue): void;
1707
+ }
1708
+ interface $ZodSuperRefineParams {
1709
+ /** If provided, the refinement runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
1710
+ when?: ((payload: ParsePayload) => boolean) | undefined;
1711
+ }
1712
+ //#endregion
1713
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/classic/errors.d.cts
1714
+ /** An Error-like class used to store Zod validation issues. */
1715
+ interface ZodError<T = unknown> extends $ZodError<T> {
1716
+ /** @deprecated Use the `z.treeifyError(err)` function instead. */
1717
+ format(): $ZodFormattedError<T>;
1718
+ format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
1719
+ /** @deprecated Use the `z.treeifyError(err)` function instead. */
1720
+ flatten(): $ZodFlattenedError<T>;
1721
+ flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
1722
+ /** @deprecated Push directly to `.issues` instead. */
1723
+ addIssue(issue: $ZodIssue): void;
1724
+ /** @deprecated Push directly to `.issues` instead. */
1725
+ addIssues(issues: $ZodIssue[]): void;
1726
+ /** @deprecated Check `err.issues.length === 0` instead. */
1727
+ isEmpty: boolean;
1728
+ }
1729
+ declare const ZodError: $constructor<ZodError>;
1730
+ //#endregion
1731
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/classic/parse.d.cts
1732
+ type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
1733
+ type ZodSafeParseSuccess<T> = {
1734
+ success: true;
1735
+ data: T;
1736
+ error?: never;
1737
+ };
1738
+ type ZodSafeParseError<T> = {
1739
+ success: false;
1740
+ data?: never;
1741
+ error: ZodError<T>;
1742
+ };
1743
+ //#endregion
1744
+ //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.4.3/09b4e1f4024540142723f154808f0d43eb14b44b685c1085d435a20f90e89165/node_modules/zod/v4/classic/schemas.d.cts
1745
+ type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
1746
+ interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
1747
+ def: Internals["def"];
1748
+ type: Internals["def"]["type"];
1749
+ /** @deprecated Use `.def` instead. */
1750
+ _def: Internals["def"];
1751
+ /** @deprecated Use `z.output<typeof schema>` instead. */
1752
+ _output: Internals["output"];
1753
+ /** @deprecated Use `z.input<typeof schema>` instead. */
1754
+ _input: Internals["input"];
1755
+ "~standard": ZodStandardSchemaWithJSON<this>;
1756
+ /** Converts this schema to a JSON Schema representation. */
1757
+ toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
1758
+ check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
1759
+ with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
1760
+ clone(def?: Internals["def"], params?: {
1761
+ parent: boolean;
1762
+ }): this;
1763
+ register<R extends $ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [$replace<R["_meta"], this>?] : [$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
1764
+ brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
1765
+ parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
1766
+ safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
1767
+ parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
1768
+ safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
1769
+ spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
1770
+ encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
1771
+ decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
1772
+ encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
1773
+ decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
1774
+ safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
1775
+ safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
1776
+ safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
1777
+ safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
1778
+ refine<Ch extends (arg: output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input<this>> : this;
1779
+ superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>, params?: $ZodSuperRefineParams): this;
1780
+ overwrite(fn: (x: output<this>) => output<this>): this;
1781
+ optional(): ZodOptional<this>;
1782
+ exactOptional(): ZodExactOptional<this>;
1783
+ nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
1784
+ nullable(): ZodNullable<this>;
1785
+ nullish(): ZodOptional<ZodNullable<this>>;
1786
+ default(def: NoUndefined<output<this>>): ZodDefault<this>;
1787
+ default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
1788
+ prefault(def: () => input<this>): ZodPrefault<this>;
1789
+ prefault(def: input<this>): ZodPrefault<this>;
1790
+ array(): ZodArray<this>;
1791
+ or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
1792
+ and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
1793
+ transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
1794
+ catch(def: output<this>): ZodCatch<this>;
1795
+ catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
1796
+ pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
1797
+ readonly(): ZodReadonly<this>;
1798
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
1799
+ describe(description: string): this;
1800
+ description?: string;
1801
+ /** Returns the metadata associated with this instance in `z.globalRegistry` */
1802
+ meta(): $replace<GlobalMeta, this> | undefined;
1803
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
1804
+ meta(data: $replace<GlobalMeta, this>): this;
1805
+ /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
1806
+ *
1807
+ * ```ts
1808
+ * const schema = z.string().optional();
1809
+ * const isOptional = schema.safeParse(undefined).success; // true
1810
+ * ```
1811
+ */
1812
+ isOptional(): boolean;
1813
+ /**
1814
+ * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
1815
+ *
1816
+ * ```ts
1817
+ * const schema = z.string().nullable();
1818
+ * const isNullable = schema.safeParse(null).success; // true
1819
+ * ```
1820
+ */
1821
+ isNullable(): boolean;
1822
+ apply<T>(fn: (schema: this) => T): T;
1823
+ }
1824
+ interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
1825
+ declare const ZodType: $constructor<ZodType>;
1826
+ interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
1827
+ format: string | null;
1828
+ minLength: number | null;
1829
+ maxLength: number | null;
1830
+ regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
1831
+ includes(value: string, params?: string | $ZodCheckIncludesParams): this;
1832
+ startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
1833
+ endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
1834
+ min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
1835
+ max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
1836
+ length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
1837
+ nonempty(params?: string | $ZodCheckMinLengthParams): this;
1838
+ lowercase(params?: string | $ZodCheckLowerCaseParams): this;
1839
+ uppercase(params?: string | $ZodCheckUpperCaseParams): this;
1840
+ trim(): this;
1841
+ normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
1842
+ toLowerCase(): this;
1843
+ toUpperCase(): this;
1844
+ slugify(): this;
1845
+ }
1846
+ /** @internal */
1847
+ declare const _ZodString: $constructor<_ZodString>;
1848
+ interface ZodString extends _ZodString<$ZodStringInternals<string>> {
1849
+ /** @deprecated Use `z.email()` instead. */
1850
+ email(params?: string | $ZodCheckEmailParams): this;
1851
+ /** @deprecated Use `z.url()` instead. */
1852
+ url(params?: string | $ZodCheckURLParams): this;
1853
+ /** @deprecated Use `z.jwt()` instead. */
1854
+ jwt(params?: string | $ZodCheckJWTParams): this;
1855
+ /** @deprecated Use `z.emoji()` instead. */
1856
+ emoji(params?: string | $ZodCheckEmojiParams): this;
1857
+ /** @deprecated Use `z.guid()` instead. */
1858
+ guid(params?: string | $ZodCheckGUIDParams): this;
1859
+ /** @deprecated Use `z.uuid()` instead. */
1860
+ uuid(params?: string | $ZodCheckUUIDParams): this;
1861
+ /** @deprecated Use `z.uuid()` instead. */
1862
+ uuidv4(params?: string | $ZodCheckUUIDParams): this;
1863
+ /** @deprecated Use `z.uuid()` instead. */
1864
+ uuidv6(params?: string | $ZodCheckUUIDParams): this;
1865
+ /** @deprecated Use `z.uuid()` instead. */
1866
+ uuidv7(params?: string | $ZodCheckUUIDParams): this;
1867
+ /** @deprecated Use `z.nanoid()` instead. */
1868
+ nanoid(params?: string | $ZodCheckNanoIDParams): this;
1869
+ /** @deprecated Use `z.guid()` instead. */
1870
+ guid(params?: string | $ZodCheckGUIDParams): this;
1871
+ /**
1872
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1873
+ * (timestamps embedded in the id). Use `z.cuid2()` instead.
1874
+ * See https://github.com/paralleldrive/cuid.
1875
+ */
1876
+ cuid(params?: string | $ZodCheckCUIDParams): this;
1877
+ /** @deprecated Use `z.cuid2()` instead. */
1878
+ cuid2(params?: string | $ZodCheckCUID2Params): this;
1879
+ /** @deprecated Use `z.ulid()` instead. */
1880
+ ulid(params?: string | $ZodCheckULIDParams): this;
1881
+ /** @deprecated Use `z.base64()` instead. */
1882
+ base64(params?: string | $ZodCheckBase64Params): this;
1883
+ /** @deprecated Use `z.base64url()` instead. */
1884
+ base64url(params?: string | $ZodCheckBase64URLParams): this;
1885
+ /** @deprecated Use `z.xid()` instead. */
1886
+ xid(params?: string | $ZodCheckXIDParams): this;
1887
+ /** @deprecated Use `z.ksuid()` instead. */
1888
+ ksuid(params?: string | $ZodCheckKSUIDParams): this;
1889
+ /** @deprecated Use `z.ipv4()` instead. */
1890
+ ipv4(params?: string | $ZodCheckIPv4Params): this;
1891
+ /** @deprecated Use `z.ipv6()` instead. */
1892
+ ipv6(params?: string | $ZodCheckIPv6Params): this;
1893
+ /** @deprecated Use `z.cidrv4()` instead. */
1894
+ cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
1895
+ /** @deprecated Use `z.cidrv6()` instead. */
1896
+ cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
1897
+ /** @deprecated Use `z.e164()` instead. */
1898
+ e164(params?: string | $ZodCheckE164Params): this;
1899
+ /** @deprecated Use `z.iso.datetime()` instead. */
1900
+ datetime(params?: string | $ZodCheckISODateTimeParams): this;
1901
+ /** @deprecated Use `z.iso.date()` instead. */
1902
+ date(params?: string | $ZodCheckISODateParams): this;
1903
+ /** @deprecated Use `z.iso.time()` instead. */
1904
+ time(params?: string | $ZodCheckISOTimeParams): this;
1905
+ /** @deprecated Use `z.iso.duration()` instead. */
1906
+ duration(params?: string | $ZodCheckISODurationParams): this;
1907
+ }
1908
+ declare const ZodString: $constructor<ZodString>;
1909
+ interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
1910
+ element: T;
1911
+ min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
1912
+ nonempty(params?: string | $ZodCheckMinLengthParams): this;
1913
+ max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
1914
+ length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
1915
+ unwrap(): T;
1916
+ "~standard": ZodStandardSchemaWithJSON<this>;
1917
+ }
1918
+ declare const ZodArray: $constructor<ZodArray>;
1919
+ type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output<Ext[K]> extends output<Base[K]> ? input<Ext[K]> extends input<Base[K]> ? Ext[K] : never : never : Ext[K]; };
1920
+ interface ZodObject<
1921
+ /** @ts-ignore Cast variance */
1922
+ out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
1923
+ "~standard": ZodStandardSchemaWithJSON<this>;
1924
+ shape: Shape;
1925
+ keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
1926
+ /** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
1927
+ catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
1928
+ /** @deprecated Use `z.looseObject()` or `.loose()` instead. */
1929
+ passthrough(): ZodObject<Shape, $loose>;
1930
+ /** Consider `z.looseObject(A.shape)` instead */
1931
+ loose(): ZodObject<Shape, $loose>;
1932
+ /** Consider `z.strictObject(A.shape)` instead */
1933
+ strict(): ZodObject<Shape, $strict>;
1934
+ /** This is the default behavior. This method call is likely unnecessary. */
1935
+ strip(): ZodObject<Shape, $strip>;
1936
+ extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, Writeable<U>>, Config>;
1937
+ safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, Writeable<U>>, Config>;
1938
+ /**
1939
+ * @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
1940
+ */
1941
+ merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
1942
+ pick<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1943
+ omit<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
1944
+ partial(): ZodObject<{ -readonly [k in keyof Shape]: ZodOptional<Shape[k]>; }, Config>;
1945
+ partial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k]; }, Config>;
1946
+ required(): ZodObject<{ -readonly [k in keyof Shape]: ZodNonOptional<Shape[k]>; }, Config>;
1947
+ required<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k]; }, Config>;
1948
+ }
1949
+ declare const ZodObject: $constructor<ZodObject>;
1950
+ interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
1951
+ "~standard": ZodStandardSchemaWithJSON<this>;
1952
+ options: T;
1953
+ }
1954
+ declare const ZodUnion: $constructor<ZodUnion>;
1955
+ interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
1956
+ "~standard": ZodStandardSchemaWithJSON<this>;
1957
+ }
1958
+ declare const ZodIntersection: $constructor<ZodIntersection>;
1959
+ interface ZodEnum<
1960
+ /** @ts-ignore Cast variance */
1961
+ out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
1962
+ "~standard": ZodStandardSchemaWithJSON<this>;
1963
+ enum: T;
1964
+ options: Array<T[keyof T]>;
1965
+ extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
1966
+ exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
1967
+ }
1968
+ declare const ZodEnum: $constructor<ZodEnum>;
1969
+ interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
1970
+ "~standard": ZodStandardSchemaWithJSON<this>;
1971
+ }
1972
+ declare const ZodTransform: $constructor<ZodTransform>;
1973
+ interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
1974
+ "~standard": ZodStandardSchemaWithJSON<this>;
1975
+ unwrap(): T;
1976
+ }
1977
+ declare const ZodOptional: $constructor<ZodOptional>;
1978
+ interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
1979
+ "~standard": ZodStandardSchemaWithJSON<this>;
1980
+ unwrap(): T;
1981
+ }
1982
+ declare const ZodExactOptional: $constructor<ZodExactOptional>;
1983
+ interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
1984
+ "~standard": ZodStandardSchemaWithJSON<this>;
1985
+ unwrap(): T;
1986
+ }
1987
+ declare const ZodNullable: $constructor<ZodNullable>;
1988
+ interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
1989
+ "~standard": ZodStandardSchemaWithJSON<this>;
1990
+ unwrap(): T;
1991
+ /** @deprecated Use `.unwrap()` instead. */
1992
+ removeDefault(): T;
1993
+ }
1994
+ declare const ZodDefault: $constructor<ZodDefault>;
1995
+ interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
1996
+ "~standard": ZodStandardSchemaWithJSON<this>;
1997
+ unwrap(): T;
1998
+ }
1999
+ declare const ZodPrefault: $constructor<ZodPrefault>;
2000
+ interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
2001
+ "~standard": ZodStandardSchemaWithJSON<this>;
2002
+ unwrap(): T;
2003
+ }
2004
+ declare const ZodNonOptional: $constructor<ZodNonOptional>;
2005
+ interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
2006
+ "~standard": ZodStandardSchemaWithJSON<this>;
2007
+ unwrap(): T;
2008
+ /** @deprecated Use `.unwrap()` instead. */
2009
+ removeCatch(): T;
2010
+ }
2011
+ declare const ZodCatch: $constructor<ZodCatch>;
2012
+ interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
2013
+ "~standard": ZodStandardSchemaWithJSON<this>;
2014
+ in: A;
2015
+ out: B;
2016
+ }
2017
+ declare const ZodPipe: $constructor<ZodPipe>;
2018
+ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
2019
+ "~standard": ZodStandardSchemaWithJSON<this>;
2020
+ unwrap(): T;
2021
+ }
2022
+ declare const ZodReadonly: $constructor<ZodReadonly>;
2023
+ //#endregion
2024
+ //#region src/schemas.d.ts
9
2025
  /**
10
2026
  * Zod schemas for Slack channel data stored in ChannelsStorage.
11
2027
  * These define the shape of the `data` JSON blob in ChannelInstallation records.
12
2028
  */
13
- declare const SlashCommandSchema: z.ZodObject<{
14
- command: z.ZodString;
15
- description: z.ZodOptional<z.ZodString>;
16
- usageHint: z.ZodOptional<z.ZodString>;
17
- prompt: z.ZodOptional<z.ZodString>;
18
- }, z.core.$strip>;
19
- declare const SlackInstallationDataSchema: z.ZodObject<{
20
- appId: z.ZodString;
21
- clientId: z.ZodString;
22
- clientSecret: z.ZodString;
23
- signingSecret: z.ZodString;
24
- teamId: z.ZodString;
25
- teamName: z.ZodOptional<z.ZodString>;
26
- botToken: z.ZodString;
27
- botUserId: z.ZodString;
28
- name: z.ZodOptional<z.ZodString>;
29
- description: z.ZodOptional<z.ZodString>;
30
- slashCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
31
- command: z.ZodString;
32
- description: z.ZodOptional<z.ZodString>;
33
- usageHint: z.ZodOptional<z.ZodString>;
34
- prompt: z.ZodOptional<z.ZodString>;
35
- }, z.core.$strip>>>;
36
- }, z.core.$strip>;
37
- type SlackInstallationData = z.infer<typeof SlackInstallationDataSchema>;
38
- declare const SlackPendingDataSchema: z.ZodObject<{
39
- appId: z.ZodString;
40
- clientId: z.ZodString;
41
- clientSecret: z.ZodString;
42
- signingSecret: z.ZodString;
43
- authorizationUrl: z.ZodString;
44
- name: z.ZodOptional<z.ZodString>;
45
- description: z.ZodOptional<z.ZodString>;
46
- slashCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
- command: z.ZodString;
48
- description: z.ZodOptional<z.ZodString>;
49
- usageHint: z.ZodOptional<z.ZodString>;
50
- prompt: z.ZodOptional<z.ZodString>;
51
- }, z.core.$strip>>>;
52
- redirectUrl: z.ZodOptional<z.ZodString>;
53
- }, z.core.$strip>;
54
- type SlackPendingData = z.infer<typeof SlackPendingDataSchema>;
55
- declare const SlackConfigDataSchema: z.ZodObject<{
56
- token: z.ZodOptional<z.ZodString>;
57
- refreshToken: z.ZodString;
58
- }, z.core.$strip>;
59
- type SlackConfigData = z.infer<typeof SlackConfigDataSchema>;
2029
+ declare const SlashCommandSchema: ZodObject<{
2030
+ command: ZodString;
2031
+ description: ZodOptional<ZodString>;
2032
+ usageHint: ZodOptional<ZodString>;
2033
+ prompt: ZodOptional<ZodString>;
2034
+ }, $strip>;
2035
+ /** Who owns an installation: a registered Agent (default) or an AgentController. */
2036
+ declare const OwnerTypeSchema: ZodEnum<{
2037
+ agent: "agent";
2038
+ agentController: "agentController";
2039
+ }>;
2040
+ type SlackOwnerType = output<typeof OwnerTypeSchema>;
2041
+ declare const SlackInstallationDataSchema: ZodObject<{
2042
+ ownerType: ZodOptional<ZodEnum<{
2043
+ agent: "agent";
2044
+ agentController: "agentController";
2045
+ }>>;
2046
+ appId: ZodString;
2047
+ clientId: ZodString;
2048
+ clientSecret: ZodString;
2049
+ signingSecret: ZodString;
2050
+ teamId: ZodString;
2051
+ teamName: ZodOptional<ZodString>;
2052
+ botToken: ZodString;
2053
+ botUserId: ZodString;
2054
+ name: ZodOptional<ZodString>;
2055
+ description: ZodOptional<ZodString>;
2056
+ slashCommands: ZodOptional<ZodArray<ZodObject<{
2057
+ command: ZodString;
2058
+ description: ZodOptional<ZodString>;
2059
+ usageHint: ZodOptional<ZodString>;
2060
+ prompt: ZodOptional<ZodString>;
2061
+ }, $strip>>>;
2062
+ }, $strip>;
2063
+ type SlackInstallationData = output<typeof SlackInstallationDataSchema>;
2064
+ declare const SlackPendingDataSchema: ZodObject<{
2065
+ ownerType: ZodOptional<ZodEnum<{
2066
+ agent: "agent";
2067
+ agentController: "agentController";
2068
+ }>>;
2069
+ appId: ZodString;
2070
+ clientId: ZodString;
2071
+ clientSecret: ZodString;
2072
+ signingSecret: ZodString;
2073
+ authorizationUrl: ZodString;
2074
+ name: ZodOptional<ZodString>;
2075
+ description: ZodOptional<ZodString>;
2076
+ slashCommands: ZodOptional<ZodArray<ZodObject<{
2077
+ command: ZodString;
2078
+ description: ZodOptional<ZodString>;
2079
+ usageHint: ZodOptional<ZodString>;
2080
+ prompt: ZodOptional<ZodString>;
2081
+ }, $strip>>>;
2082
+ redirectUrl: ZodOptional<ZodString>;
2083
+ }, $strip>;
2084
+ type SlackPendingData = output<typeof SlackPendingDataSchema>;
2085
+ declare const SlackConfigDataSchema: ZodObject<{
2086
+ token: ZodOptional<ZodString>;
2087
+ refreshToken: ZodString;
2088
+ }, $strip>;
2089
+ type SlackConfigData = output<typeof SlackConfigDataSchema>;
60
2090
  /** Normalized slash command config as stored in installation data. */
61
- type StoredSlashCommand = z.infer<typeof SlashCommandSchema>;
2091
+ type StoredSlashCommand = output<typeof SlashCommandSchema>;
62
2092
  interface SlackInstallation {
63
- id: string;
64
- agentId: string;
65
- webhookId: string;
66
- configHash: string;
67
- installedAt: Date;
68
- appId: string;
69
- clientId: string;
70
- clientSecret: string;
71
- signingSecret: string;
72
- teamId: string;
73
- teamName?: string;
74
- botToken: string;
75
- botUserId: string;
76
- /** Explicit name passed to connect(), takes priority over agent.name */
77
- name?: string;
78
- /** Explicit description passed to connect(), takes priority over agent.getDescription() */
79
- description?: string;
80
- slashCommands?: StoredSlashCommand[];
2093
+ id: string;
2094
+ /** Owner key: an agent id when ownerType is 'agent' (default), or an AgentController id. */
2095
+ agentId: string;
2096
+ /** Defaults to 'agent' when absent (pre-existing installations). */
2097
+ ownerType?: SlackOwnerType;
2098
+ webhookId: string;
2099
+ configHash: string;
2100
+ installedAt: Date;
2101
+ appId: string;
2102
+ clientId: string;
2103
+ clientSecret: string;
2104
+ signingSecret: string;
2105
+ teamId: string;
2106
+ teamName?: string;
2107
+ botToken: string;
2108
+ botUserId: string;
2109
+ /** Explicit name passed to connect(), takes priority over agent.name */
2110
+ name?: string;
2111
+ /** Explicit description passed to connect(), takes priority over agent.getDescription() */
2112
+ description?: string;
2113
+ slashCommands?: StoredSlashCommand[];
81
2114
  }
82
2115
  interface SlackPendingInstallation {
83
- id: string;
84
- agentId: string;
85
- webhookId: string;
86
- configHash: string;
87
- createdAt: Date;
88
- appId: string;
89
- clientId: string;
90
- clientSecret: string;
91
- signingSecret: string;
92
- authorizationUrl: string;
93
- /** Explicit name passed to connect(), takes priority over agent.name */
94
- name?: string;
95
- /** Explicit description passed to connect(), takes priority over agent.getDescription() */
96
- description?: string;
97
- slashCommands?: StoredSlashCommand[];
98
- redirectUrl?: string;
2116
+ id: string;
2117
+ /** Owner key: an agent id when ownerType is 'agent' (default), or an AgentController id. */
2118
+ agentId: string;
2119
+ /** Defaults to 'agent' when absent (pre-existing installations). */
2120
+ ownerType?: SlackOwnerType;
2121
+ webhookId: string;
2122
+ configHash: string;
2123
+ createdAt: Date;
2124
+ appId: string;
2125
+ clientId: string;
2126
+ clientSecret: string;
2127
+ signingSecret: string;
2128
+ authorizationUrl: string;
2129
+ /** Explicit name passed to connect(), takes priority over agent.name */
2130
+ name?: string;
2131
+ /** Explicit description passed to connect(), takes priority over agent.getDescription() */
2132
+ description?: string;
2133
+ slashCommands?: StoredSlashCommand[];
2134
+ redirectUrl?: string;
99
2135
  }
100
2136
  interface SlackConfigTokens {
101
- token?: string;
102
- refreshToken: string;
103
- updatedAt: Date;
2137
+ token?: string;
2138
+ refreshToken: string;
2139
+ updatedAt: Date;
104
2140
  }
105
-
2141
+ //#endregion
2142
+ //#region src/types.d.ts
106
2143
  /**
107
2144
  * Per-adapter overrides shared across both streaming and static branches
108
2145
  * of {@link SlackAdapterChannelConfig}.
109
2146
  */
110
2147
  interface SlackAdapterChannelConfigBase {
111
- /** CORS configuration for the Slack webhook route. */
112
- cors?: ChannelAdapterConfig['cors'];
113
- /** Slack gateway listener toggle. Currently a no-op for Slack (HTTP-only). */
114
- gateway?: ChannelAdapterConfig['gateway'];
115
- /** Override how errors are rendered in Slack messages. */
116
- formatError?: ChannelAdapterConfig['formatError'];
117
- /**
118
- * Control Slack typing indicators and Assistant-mode status text.
119
- *
120
- * - `true` — use built-in defaults: `"is typing…"` while generating text,
121
- * `"is calling {toolName}…"` while a tool runs, `"is waiting for
122
- * approval…"` while a tool is suspended. Slack auto-prepends the app
123
- * name so the user sees `"<App Name> is typing…"`.
124
- * - `false` — never call `startTyping`. Useful when a live streaming
125
- * widget (e.g. `toolDisplay: 'grouped'`) already conveys progress.
126
- * - `(chunk, ctx) => string | false | null | undefined | void` — set
127
- * custom copy per chunk. Return a string to override the status,
128
- * or `false`/`null`/`undefined` to leave it unchanged. Compose with
129
- * `defaultTypingStatus` (exported from `@mastra/core/channels`) to
130
- * fall back to defaults for chunks you don't handle.
131
- *
132
- * @default true
133
- */
134
- typingStatus?: ChannelAdapterConfig['typingStatus'];
2148
+ /** CORS configuration for the Slack webhook route. */
2149
+ cors?: ChannelAdapterConfig['cors'];
2150
+ /** Slack gateway listener toggle. Currently a no-op for Slack (HTTP-only). */
2151
+ gateway?: ChannelAdapterConfig['gateway'];
2152
+ /** Override how errors are rendered in Slack messages. */
2153
+ formatError?: ChannelAdapterConfig['formatError'];
2154
+ /**
2155
+ * Control Slack typing indicators and Assistant-mode status text.
2156
+ *
2157
+ * - `true` — use built-in defaults: `"is typing…"` while generating text,
2158
+ * `"is calling {toolName}…"` while a tool runs, `"is waiting for
2159
+ * approval…"` while a tool is suspended. Slack auto-prepends the app
2160
+ * name so the user sees `"<App Name> is typing…"`.
2161
+ * - `false` — never call `startTyping`. Useful when a live streaming
2162
+ * widget (e.g. `toolDisplay: 'grouped'`) already conveys progress.
2163
+ * - `(chunk, ctx) => string | false | null | undefined | void` — set
2164
+ * custom copy per chunk. Return a string to override the status,
2165
+ * or `false`/`null`/`undefined` to leave it unchanged. Compose with
2166
+ * `defaultTypingStatus` (exported from `@mastra/core/channels`) to
2167
+ * fall back to defaults for chunks you don't handle.
2168
+ *
2169
+ * @default true
2170
+ */
2171
+ typingStatus?: ChannelAdapterConfig['typingStatus'];
135
2172
  }
136
2173
  /**
137
2174
  * Slack adapter overrides with `streaming` enabled (the default). Allows any
138
2175
  * `toolDisplay` mode, including the streaming-only `'timeline'` / `'grouped'`.
139
2176
  */
140
2177
  interface SlackAdapterStreamingConfig extends SlackAdapterChannelConfigBase {
141
- /**
142
- * Stream agent text deltas to Slack as the agent generates them.
143
- *
144
- * - `true` (default) — stream with default options.
145
- * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
146
- *
147
- * @default true
148
- */
149
- streaming?: Exclude<StreamingConfig, false>;
150
- /**
151
- * How tool calls are rendered in Slack.
152
- *
153
- * - `'cards'` — per-tool "Running…" → "Result" Block Kit cards (the streaming
154
- * session is closed/posted/reopened around each card).
155
- * - `'text'` — per-tool plain-text messages (no Block Kit).
156
- * - `'timeline'` — render tools as inline task entries beside the streaming text.
157
- * - `'grouped'` (default in Slack) — collapse all tools into a single
158
- * "Thinking Steps" plan widget. Renders well in Slack's AI Assistant UI.
159
- * - `'hidden'` — execute tools silently; only the typing status indicates work.
160
- * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
161
- *
162
- * Approve/deny prompts (`requireApproval`) always render as a separate card.
163
- *
164
- * @default 'grouped'
165
- */
166
- toolDisplay?: ToolDisplay;
2178
+ /**
2179
+ * Stream agent text deltas to Slack as the agent generates them.
2180
+ *
2181
+ * - `true` (default) — stream with default options.
2182
+ * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
2183
+ *
2184
+ * @default true
2185
+ */
2186
+ streaming?: Exclude<StreamingConfig, false>;
2187
+ /**
2188
+ * How tool calls are rendered in Slack.
2189
+ *
2190
+ * - `'cards'` — per-tool "Running…" → "Result" Block Kit cards (the streaming
2191
+ * session is closed/posted/reopened around each card).
2192
+ * - `'text'` — per-tool plain-text messages (no Block Kit).
2193
+ * - `'timeline'` — render tools as inline task entries beside the streaming text.
2194
+ * - `'grouped'` (default in Slack) — collapse all tools into a single
2195
+ * "Thinking Steps" plan widget. Renders well in Slack's AI Assistant UI.
2196
+ * - `'hidden'` — execute tools silently; only the typing status indicates work.
2197
+ * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
2198
+ *
2199
+ * Approve/deny prompts (`requireApproval`) always render as a separate card.
2200
+ *
2201
+ * @default 'grouped'
2202
+ */
2203
+ toolDisplay?: ToolDisplay;
167
2204
  }
168
2205
  /**
169
2206
  * Slack adapter overrides with `streaming: false`. Restricts `toolDisplay`
170
2207
  * to modes that post discrete messages (no `StreamingPlan` available).
171
2208
  */
172
2209
  interface SlackAdapterStaticConfig extends SlackAdapterChannelConfigBase {
173
- /**
174
- * Disable Slack's native message streaming and buffer text until `step-finish`.
175
- * `'timeline'` and `'grouped'` modes require streaming, so they're not
176
- * available on this branch.
177
- */
178
- streaming: false;
179
- /**
180
- * How tool calls are rendered in Slack (static modes only).
181
- *
182
- * - `'cards'` (default) — per-tool "Running…" → "Result" Block Kit cards.
183
- * - `'text'` — per-tool plain-text messages (no Block Kit).
184
- * - `'hidden'` — execute tools silently; only the typing status indicates work.
185
- * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
186
- *
187
- * @default 'cards'
188
- */
189
- toolDisplay?: StaticToolDisplay;
2210
+ /**
2211
+ * Disable Slack's native message streaming and buffer text until `step-finish`.
2212
+ * `'timeline'` and `'grouped'` modes require streaming, so they're not
2213
+ * available on this branch.
2214
+ */
2215
+ streaming: false;
2216
+ /**
2217
+ * How tool calls are rendered in Slack (static modes only).
2218
+ *
2219
+ * - `'cards'` (default) — per-tool "Running…" → "Result" Block Kit cards.
2220
+ * - `'text'` — per-tool plain-text messages (no Block Kit).
2221
+ * - `'hidden'` — execute tools silently; only the typing status indicates work.
2222
+ * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
2223
+ *
2224
+ * @default 'cards'
2225
+ */
2226
+ toolDisplay?: StaticToolDisplay;
190
2227
  }
191
2228
  /**
192
2229
  * Per-adapter overrides applied to the Slack entry inside
@@ -200,170 +2237,170 @@ type SlackAdapterChannelConfig = SlackAdapterStreamingConfig | SlackAdapterStati
200
2237
  * {@link SlackProviderConfig}.
201
2238
  */
202
2239
  interface SlackProviderConfigBase extends SlackAdapterChannelConfigBase {
203
- /**
204
- * Override built-in event handlers (e.g. `onDirectMessage`, `onMention`).
205
- * Forwarded to `AgentChannels` for every agent connected via this provider.
206
- *
207
- * @example
208
- * ```ts
209
- * handlers: {
210
- * onDirectMessage: async (thread, message, defaultHandler) => {
211
- * console.log('DM:', message.text);
212
- * await defaultHandler(thread, message);
213
- * },
214
- * }
215
- * ```
216
- */
217
- handlers?: ChannelHandlers;
218
- /** Which media types to send inline to the model. See `ChannelConfig.inlineMedia`. */
219
- inlineMedia?: ChannelConfig['inlineMedia'];
220
- /** Promote URLs in message text to file parts. See `ChannelConfig.inlineLinks`. */
221
- inlineLinks?: ChannelConfig['inlineLinks'];
222
- /** State adapter for deduplication, locking, and subscriptions. */
223
- state?: ChannelConfig['state'];
224
- /** Fetch recent thread messages from Slack when the agent joins mid-conversation. */
225
- threadContext?: ChannelConfig['threadContext'];
226
- /** Whether to include channel tools (add_reaction, remove_reaction). */
227
- tools?: ChannelConfig['tools'];
228
- /** Additional options passed directly to the Chat SDK. */
229
- chatOptions?: ChannelConfig['chatOptions'];
230
- /**
231
- * Logger forwarded to the underlying `SlackAdapter` for internal error
232
- * reporting. Defaults to the adapter's `ConsoleLogger`.
233
- */
234
- logger?: SlackAdapterConfig['logger'];
235
- /**
236
- * Slack App Configuration access token for programmatic app creation.
237
- * Generate at: https://api.slack.com/apps > "Your App Configuration Tokens"
238
- *
239
- * Optional — will rotate to get a fresh token on startup using `refreshToken`.
240
- */
241
- token?: string;
242
- /**
243
- * Slack App Configuration refresh token.
244
- * Used for automatic token rotation. Single-use; each rotation returns a new pair.
245
- *
246
- * Can be provided here or later via `configure({ refreshToken })`.
247
- * If omitted, the provider starts unconfigured and cannot create apps until
248
- * `configure()` is called or tokens are loaded from storage.
249
- */
250
- refreshToken?: string;
251
- /**
252
- * Base URL for webhook callbacks.
253
- * Required when calling connect() to create apps.
254
- * Can also be set later via setBaseUrl() or auto-detected from server config.
255
- *
256
- * For local development, use a tunnel like cloudflared:
257
- * ```
258
- * baseUrl: 'https://abc123.trycloudflare.com'
259
- * ```
260
- */
261
- baseUrl?: string;
262
- /**
263
- * Custom storage for installations.
264
- * Defaults to using Mastra's ChannelsStorage from the global storage.
265
- * Throws if no persistent storage is available.
266
- */
267
- storage?: ChannelsStorage;
268
- /**
269
- * Path to redirect to after OAuth completion.
270
- * Defaults to "/" (homepage)
271
- */
272
- redirectPath?: string;
273
- /**
274
- * Called when a workspace successfully installs the app.
275
- */
276
- onInstall?: (installation: SlackInstallation) => Promise<void>;
277
- /**
278
- * Encryption key for sensitive data (clientSecret, signingSecret, botToken).
279
- * If not provided, secrets are stored in plaintext (not recommended for production).
280
- *
281
- * Use a 32+ character random string. Can be set via MASTRA_ENCRYPTION_KEY env var.
282
- */
283
- encryptionKey?: string;
284
- /**
285
- * Resolver that returns a `waitUntil` for the current Slack webhook request.
286
- *
287
- * Required on serverless runtimes where Hono can't bridge the platform's
288
- * `ExecutionContext` automatically (Vercel, AWS Lambda). Without `waitUntil`, the
289
- * runtime freezes the invocation as soon as the 200 ack returns, killing the
290
- * agent run mid-flight and leaving the user with no Slack reply.
291
- *
292
- * Pass the bare `waitUntil(promise)` function from your platform's SDK. If your
293
- * runtime requires the Hono `Context` to derive `waitUntil`, use
294
- * {@link resolveWaitUntil} instead.
295
- *
296
- * Cloudflare Workers and Netlify users typically don't need this — Mastra's
297
- * default helper already reads `c.executionCtx.waitUntil` and
298
- * `c.env.context.waitUntil`.
299
- *
300
- * @example
301
- * ```ts
302
- * import { waitUntil } from '@vercel/functions';
303
- * new SlackProvider({ waitUntil });
304
- * ```
305
- */
306
- waitUntil?: WaitUntilFn;
307
- /**
308
- * Resolve `waitUntil` from the request's Hono `Context`. Use this when the runtime
309
- * exposes `waitUntil` through the request and core's default doesn't cover it.
310
- *
311
- * For platforms whose `waitUntil` is a bare import (e.g. `@vercel/functions`),
312
- * pass it via {@link waitUntil} instead.
313
- *
314
- * Resolution order: {@link waitUntil} → {@link resolveWaitUntil} → core default.
315
- */
316
- resolveWaitUntil?: WaitUntilResolver;
317
- /**
318
- * Per-adapter overrides applied to the Slack adapter entry inside
319
- * `AgentChannels.adapters` — for example `toolDisplay`, `streaming`,
320
- * `formatError`.
321
- *
322
- * @deprecated Pass these fields at the top level of `SlackProviderConfig`
323
- * instead. Top-level fields win; values from `adapterConfig` are merged in
324
- * as a fallback for backwards compatibility.
325
- */
326
- adapterConfig?: SlackAdapterChannelConfig;
2240
+ /**
2241
+ * Override built-in event handlers (e.g. `onDirectMessage`, `onMention`).
2242
+ * Forwarded to `AgentChannels` for every agent connected via this provider.
2243
+ *
2244
+ * @example
2245
+ * ```ts
2246
+ * handlers: {
2247
+ * onDirectMessage: async (thread, message, defaultHandler) => {
2248
+ * console.log('DM:', message.text);
2249
+ * await defaultHandler(thread, message);
2250
+ * },
2251
+ * }
2252
+ * ```
2253
+ */
2254
+ handlers?: ChannelHandlers;
2255
+ /** Which media types to send inline to the model. See `ChannelConfig.inlineMedia`. */
2256
+ inlineMedia?: ChannelConfig['inlineMedia'];
2257
+ /** Promote URLs in message text to file parts. See `ChannelConfig.inlineLinks`. */
2258
+ inlineLinks?: ChannelConfig['inlineLinks'];
2259
+ /** State adapter for deduplication, locking, and subscriptions. */
2260
+ state?: ChannelConfig['state'];
2261
+ /** Fetch recent thread messages from Slack when the agent joins mid-conversation. */
2262
+ threadContext?: ChannelConfig['threadContext'];
2263
+ /** Whether to include channel tools (add_reaction, remove_reaction). */
2264
+ tools?: ChannelConfig['tools'];
2265
+ /** Additional options passed directly to the Chat SDK. */
2266
+ chatOptions?: ChannelConfig['chatOptions'];
2267
+ /**
2268
+ * Logger forwarded to the underlying `SlackAdapter` for internal error
2269
+ * reporting. Defaults to the adapter's `ConsoleLogger`.
2270
+ */
2271
+ logger?: SlackAdapterConfig['logger'];
2272
+ /**
2273
+ * Slack App Configuration access token for programmatic app creation.
2274
+ * Generate at: https://api.slack.com/apps > "Your App Configuration Tokens"
2275
+ *
2276
+ * Optional — will rotate to get a fresh token on startup using `refreshToken`.
2277
+ */
2278
+ token?: string;
2279
+ /**
2280
+ * Slack App Configuration refresh token.
2281
+ * Used for automatic token rotation. Single-use; each rotation returns a new pair.
2282
+ *
2283
+ * Can be provided here or later via `configure({ refreshToken })`.
2284
+ * If omitted, the provider starts unconfigured and cannot create apps until
2285
+ * `configure()` is called or tokens are loaded from storage.
2286
+ */
2287
+ refreshToken?: string;
2288
+ /**
2289
+ * Base URL for webhook callbacks.
2290
+ * Required when calling connect() to create apps.
2291
+ * Can also be set later via setBaseUrl() or auto-detected from server config.
2292
+ *
2293
+ * For local development, use a tunnel like cloudflared:
2294
+ * ```
2295
+ * baseUrl: 'https://abc123.trycloudflare.com'
2296
+ * ```
2297
+ */
2298
+ baseUrl?: string;
2299
+ /**
2300
+ * Custom storage for installations.
2301
+ * Defaults to using Mastra's ChannelsStorage from the global storage.
2302
+ * Throws if no persistent storage is available.
2303
+ */
2304
+ storage?: ChannelsStorage;
2305
+ /**
2306
+ * Path to redirect to after OAuth completion.
2307
+ * Defaults to "/" (homepage)
2308
+ */
2309
+ redirectPath?: string;
2310
+ /**
2311
+ * Called when a workspace successfully installs the app.
2312
+ */
2313
+ onInstall?: (installation: SlackInstallation) => Promise<void>;
2314
+ /**
2315
+ * Encryption key for sensitive data (clientSecret, signingSecret, botToken).
2316
+ * If not provided, secrets are stored in plaintext (not recommended for production).
2317
+ *
2318
+ * Use a 32+ character random string. Can be set via MASTRA_ENCRYPTION_KEY env var.
2319
+ */
2320
+ encryptionKey?: string;
2321
+ /**
2322
+ * Resolver that returns a `waitUntil` for the current Slack webhook request.
2323
+ *
2324
+ * Required on serverless runtimes where Hono can't bridge the platform's
2325
+ * `ExecutionContext` automatically (Vercel, AWS Lambda). Without `waitUntil`, the
2326
+ * runtime freezes the invocation as soon as the 200 ack returns, killing the
2327
+ * agent run mid-flight and leaving the user with no Slack reply.
2328
+ *
2329
+ * Pass the bare `waitUntil(promise)` function from your platform's SDK. If your
2330
+ * runtime requires the Hono `Context` to derive `waitUntil`, use
2331
+ * {@link resolveWaitUntil} instead.
2332
+ *
2333
+ * Cloudflare Workers and Netlify users typically don't need this — Mastra's
2334
+ * default helper already reads `c.executionCtx.waitUntil` and
2335
+ * `c.env.context.waitUntil`.
2336
+ *
2337
+ * @example
2338
+ * ```ts
2339
+ * import { waitUntil } from '@vercel/functions';
2340
+ * new SlackProvider({ waitUntil });
2341
+ * ```
2342
+ */
2343
+ waitUntil?: WaitUntilFn;
2344
+ /**
2345
+ * Resolve `waitUntil` from the request's Hono `Context`. Use this when the runtime
2346
+ * exposes `waitUntil` through the request and core's default doesn't cover it.
2347
+ *
2348
+ * For platforms whose `waitUntil` is a bare import (e.g. `@vercel/functions`),
2349
+ * pass it via {@link waitUntil} instead.
2350
+ *
2351
+ * Resolution order: {@link waitUntil} → {@link resolveWaitUntil} → core default.
2352
+ */
2353
+ resolveWaitUntil?: WaitUntilResolver;
2354
+ /**
2355
+ * Per-adapter overrides applied to the Slack adapter entry inside
2356
+ * `AgentChannels.adapters` — for example `toolDisplay`, `streaming`,
2357
+ * `formatError`.
2358
+ *
2359
+ * @deprecated Pass these fields at the top level of `SlackProviderConfig`
2360
+ * instead. Top-level fields win; values from `adapterConfig` are merged in
2361
+ * as a fallback for backwards compatibility.
2362
+ */
2363
+ adapterConfig?: SlackAdapterChannelConfig;
327
2364
  }
328
2365
  /**
329
2366
  * Slack provider configuration with `streaming` enabled (the default).
330
2367
  * Allows any `toolDisplay` mode.
331
2368
  */
332
2369
  interface SlackProviderStreamingConfig extends SlackProviderConfigBase {
333
- /**
334
- * Stream agent text deltas to Slack as the agent generates them.
335
- *
336
- * - `true` (default) — stream with default options.
337
- * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
338
- *
339
- * @default true
340
- */
341
- streaming?: Exclude<StreamingConfig, false>;
342
- /**
343
- * How tool calls are rendered in Slack. See {@link SlackAdapterStreamingConfig#toolDisplay}.
344
- *
345
- * @default 'grouped'
346
- */
347
- toolDisplay?: ToolDisplay;
2370
+ /**
2371
+ * Stream agent text deltas to Slack as the agent generates them.
2372
+ *
2373
+ * - `true` (default) — stream with default options.
2374
+ * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
2375
+ *
2376
+ * @default true
2377
+ */
2378
+ streaming?: Exclude<StreamingConfig, false>;
2379
+ /**
2380
+ * How tool calls are rendered in Slack. See {@link SlackAdapterStreamingConfig#toolDisplay}.
2381
+ *
2382
+ * @default 'grouped'
2383
+ */
2384
+ toolDisplay?: ToolDisplay;
348
2385
  }
349
2386
  /**
350
2387
  * Slack provider configuration with `streaming: false`. Restricts
351
2388
  * `toolDisplay` to modes that post discrete messages.
352
2389
  */
353
2390
  interface SlackProviderStaticConfig extends SlackProviderConfigBase {
354
- /**
355
- * Disable Slack's native message streaming and buffer text until `step-finish`.
356
- * `'timeline'` and `'grouped'` modes require streaming, so they're not
357
- * available on this branch.
358
- */
359
- streaming: false;
360
- /**
361
- * How tool calls are rendered in Slack (static modes only). See
362
- * {@link SlackAdapterStaticConfig#toolDisplay}.
363
- *
364
- * @default 'cards'
365
- */
366
- toolDisplay?: StaticToolDisplay;
2391
+ /**
2392
+ * Disable Slack's native message streaming and buffer text until `step-finish`.
2393
+ * `'timeline'` and `'grouped'` modes require streaming, so they're not
2394
+ * available on this branch.
2395
+ */
2396
+ streaming: false;
2397
+ /**
2398
+ * How tool calls are rendered in Slack (static modes only). See
2399
+ * {@link SlackAdapterStaticConfig#toolDisplay}.
2400
+ *
2401
+ * @default 'cards'
2402
+ */
2403
+ toolDisplay?: StaticToolDisplay;
367
2404
  }
368
2405
  /**
369
2406
  * Configuration for SlackProvider at the Mastra level.
@@ -382,86 +2419,86 @@ type SlackProviderConfig = SlackProviderStreamingConfig | SlackProviderStaticCon
382
2419
  * This is serializable and can be stored in the database for stored agents.
383
2420
  */
384
2421
  interface SlackConnectOptions {
385
- /**
386
- * Display name for the Slack bot.
387
- * Defaults to agent name, then agent ID.
388
- */
389
- name?: string;
390
- /**
391
- * Bot description shown in Slack.
392
- * Defaults to "{name} - Powered by Mastra".
393
- */
394
- description?: string;
395
- /**
396
- * URL to an image for the app icon.
397
- * Should be a square PNG/JPG, minimum 512x512px.
398
- * The image will be automatically downloaded and uploaded to Slack.
399
- *
400
- * @example
401
- * iconUrl: 'https://example.com/my-bot-avatar.png'
402
- */
403
- iconUrl?: string;
404
- /**
405
- * Slash commands this agent supports.
406
- *
407
- * Simple form - command triggers agent.generate() with the input text:
408
- * ```ts
409
- * slashCommands: ['/ask']
410
- * ```
411
- *
412
- * With custom prompt template:
413
- * ```ts
414
- * slashCommands: [
415
- * {
416
- * command: '/summarize',
417
- * description: 'Summarize a URL',
418
- * prompt: 'Fetch and summarize: {{text}}'
419
- * }
420
- * ]
421
- * ```
422
- *
423
- * Use {{text}} as placeholder for user input.
424
- */
425
- slashCommands?: (string | SlashCommandConfig)[];
426
- /**
427
- * Customize the Slack app manifest before it's sent to the Manifest API.
428
- *
429
- * Receives the default manifest (built from name, description, slashCommands,
430
- * and internal URLs) and returns the final manifest to use.
431
- *
432
- * Use this for any advanced Slack configuration: custom scopes, events,
433
- * interactivity settings, etc.
434
- *
435
- * @example
436
- * // Add extra scopes
437
- * manifest: (m) => ({
438
- * ...m,
439
- * oauth_config: {
440
- * ...m.oauth_config,
441
- * scopes: { bot: [...(m.oauth_config?.scopes?.bot ?? []), 'files:write'] }
442
- * }
443
- * })
444
- *
445
- * @example
446
- * // Subscribe to additional events
447
- * manifest: (m) => ({
448
- * ...m,
449
- * settings: {
450
- * ...m.settings,
451
- * event_subscriptions: {
452
- * ...m.settings?.event_subscriptions,
453
- * bot_events: [...(m.settings?.event_subscriptions?.bot_events ?? []), 'reaction_added']
454
- * }
455
- * }
456
- * })
457
- */
458
- manifest?: (defaults: SlackAppManifest) => SlackAppManifest;
459
- /**
460
- * URL to redirect to after successful OAuth completion.
461
- * Typically set by the Studio UI to return to the agent page.
462
- * Defaults to `SlackProviderConfig.redirectPath` or `/`.
463
- */
464
- redirectUrl?: string;
2422
+ /**
2423
+ * Display name for the Slack bot.
2424
+ * Defaults to agent name, then agent ID.
2425
+ */
2426
+ name?: string;
2427
+ /**
2428
+ * Bot description shown in Slack.
2429
+ * Defaults to "{name} - Powered by Mastra".
2430
+ */
2431
+ description?: string;
2432
+ /**
2433
+ * URL to an image for the app icon.
2434
+ * Should be a square PNG/JPG, minimum 512x512px.
2435
+ * The image will be automatically downloaded and uploaded to Slack.
2436
+ *
2437
+ * @example
2438
+ * iconUrl: 'https://example.com/my-bot-avatar.png'
2439
+ */
2440
+ iconUrl?: string;
2441
+ /**
2442
+ * Slash commands this agent supports.
2443
+ *
2444
+ * Simple form - command triggers agent.generate() with the input text:
2445
+ * ```ts
2446
+ * slashCommands: ['/ask']
2447
+ * ```
2448
+ *
2449
+ * With custom prompt template:
2450
+ * ```ts
2451
+ * slashCommands: [
2452
+ * {
2453
+ * command: '/summarize',
2454
+ * description: 'Summarize a URL',
2455
+ * prompt: 'Fetch and summarize: {{text}}'
2456
+ * }
2457
+ * ]
2458
+ * ```
2459
+ *
2460
+ * Use {{text}} as placeholder for user input.
2461
+ */
2462
+ slashCommands?: (string | SlashCommandConfig)[];
2463
+ /**
2464
+ * Customize the Slack app manifest before it's sent to the Manifest API.
2465
+ *
2466
+ * Receives the default manifest (built from name, description, slashCommands,
2467
+ * and internal URLs) and returns the final manifest to use.
2468
+ *
2469
+ * Use this for any advanced Slack configuration: custom scopes, events,
2470
+ * interactivity settings, etc.
2471
+ *
2472
+ * @example
2473
+ * // Add extra scopes
2474
+ * manifest: (m) => ({
2475
+ * ...m,
2476
+ * oauth_config: {
2477
+ * ...m.oauth_config,
2478
+ * scopes: { bot: [...(m.oauth_config?.scopes?.bot ?? []), 'files:write'] }
2479
+ * }
2480
+ * })
2481
+ *
2482
+ * @example
2483
+ * // Subscribe to additional events
2484
+ * manifest: (m) => ({
2485
+ * ...m,
2486
+ * settings: {
2487
+ * ...m.settings,
2488
+ * event_subscriptions: {
2489
+ * ...m.settings?.event_subscriptions,
2490
+ * bot_events: [...(m.settings?.event_subscriptions?.bot_events ?? []), 'reaction_added']
2491
+ * }
2492
+ * }
2493
+ * })
2494
+ */
2495
+ manifest?: (defaults: SlackAppManifest) => SlackAppManifest;
2496
+ /**
2497
+ * URL to redirect to after successful OAuth completion.
2498
+ * Typically set by the Studio UI to return to the agent page.
2499
+ * Defaults to `SlackProviderConfig.redirectPath` or `/`.
2500
+ */
2501
+ redirectUrl?: string;
465
2502
  }
466
2503
  /**
467
2504
  * Slash command configuration (fully serializable).
@@ -470,104 +2507,105 @@ interface SlackConnectOptions {
470
2507
  * and sent to the agent. Like Claude Code's slash commands.
471
2508
  */
472
2509
  interface SlashCommandConfig {
473
- /** Command name including slash (e.g., "/ask") */
474
- command: string;
475
- /** Short description shown in Slack's command picker */
476
- description?: string;
477
- /** Usage hint shown in Slack (e.g., "[question]") */
478
- usageHint?: string;
479
- /**
480
- * Prompt template sent to the agent.
481
- * Use {{text}} as placeholder for user input.
482
- *
483
- * Defaults to "{{text}}" (just passes input directly).
484
- *
485
- * @example
486
- * prompt: 'Summarize the following URL: {{text}}'
487
- * prompt: 'Write {{text}} in TypeScript'
488
- */
489
- prompt?: string;
2510
+ /** Command name including slash (e.g., "/ask") */
2511
+ command: string;
2512
+ /** Short description shown in Slack's command picker */
2513
+ description?: string;
2514
+ /** Usage hint shown in Slack (e.g., "[question]") */
2515
+ usageHint?: string;
2516
+ /**
2517
+ * Prompt template sent to the agent.
2518
+ * Use {{text}} as placeholder for user input.
2519
+ *
2520
+ * Defaults to "{{text}}" (just passes input directly).
2521
+ *
2522
+ * @example
2523
+ * prompt: 'Summarize the following URL: {{text}}'
2524
+ * prompt: 'Write {{text}} in TypeScript'
2525
+ */
2526
+ prompt?: string;
490
2527
  }
491
2528
  interface SlackMessage {
492
- text?: string;
493
- blocks?: SlackBlock[];
494
- response_type?: 'in_channel' | 'ephemeral';
495
- replace_original?: boolean;
496
- delete_original?: boolean;
2529
+ text?: string;
2530
+ blocks?: SlackBlock[];
2531
+ response_type?: 'in_channel' | 'ephemeral';
2532
+ replace_original?: boolean;
2533
+ delete_original?: boolean;
497
2534
  }
498
2535
  interface SlackBlock {
499
- type: string;
500
- [key: string]: unknown;
2536
+ type: string;
2537
+ [key: string]: unknown;
501
2538
  }
502
2539
  /**
503
2540
  * Slack App Manifest for programmatic app creation.
504
2541
  * @see https://api.slack.com/reference/manifests
505
2542
  */
506
2543
  interface SlackAppManifest {
507
- display_information: {
508
- name: string;
509
- description?: string;
510
- background_color?: string;
511
- long_description?: string;
2544
+ display_information: {
2545
+ name: string;
2546
+ description?: string;
2547
+ background_color?: string;
2548
+ long_description?: string;
2549
+ };
2550
+ features?: {
2551
+ app_home?: {
2552
+ home_tab_enabled?: boolean;
2553
+ messages_tab_enabled?: boolean;
2554
+ messages_tab_read_only_enabled?: boolean;
2555
+ };
2556
+ bot_user?: {
2557
+ display_name: string;
2558
+ always_online?: boolean;
512
2559
  };
513
- features?: {
514
- app_home?: {
515
- home_tab_enabled?: boolean;
516
- messages_tab_enabled?: boolean;
517
- messages_tab_read_only_enabled?: boolean;
518
- };
519
- bot_user?: {
520
- display_name: string;
521
- always_online?: boolean;
522
- };
523
- slash_commands?: Array<{
524
- command: string;
525
- description: string;
526
- url: string;
527
- usage_hint?: string;
528
- }>;
529
- assistant_view?: {
530
- assistant_description: string;
531
- suggested_prompts?: Array<{
532
- title: string;
533
- message: string;
534
- }>;
535
- };
2560
+ slash_commands?: Array<{
2561
+ command: string;
2562
+ description: string;
2563
+ url: string;
2564
+ usage_hint?: string;
2565
+ }>;
2566
+ assistant_view?: {
2567
+ assistant_description: string;
2568
+ suggested_prompts?: Array<{
2569
+ title: string;
2570
+ message: string;
2571
+ }>;
536
2572
  };
537
- oauth_config?: {
538
- redirect_urls?: string[];
539
- scopes?: {
540
- bot?: string[];
541
- user?: string[];
542
- };
2573
+ };
2574
+ oauth_config?: {
2575
+ redirect_urls?: string[];
2576
+ scopes?: {
2577
+ bot?: string[];
2578
+ user?: string[];
543
2579
  };
544
- settings?: {
545
- event_subscriptions?: {
546
- request_url?: string;
547
- bot_events?: string[];
548
- user_events?: string[];
549
- };
550
- interactivity?: {
551
- is_enabled?: boolean;
552
- request_url?: string;
553
- message_menu_options_url?: string;
554
- };
555
- org_deploy_enabled?: boolean;
556
- socket_mode_enabled?: boolean;
557
- token_rotation_enabled?: boolean;
2580
+ };
2581
+ settings?: {
2582
+ event_subscriptions?: {
2583
+ request_url?: string;
2584
+ bot_events?: string[];
2585
+ user_events?: string[];
558
2586
  };
2587
+ interactivity?: {
2588
+ is_enabled?: boolean;
2589
+ request_url?: string;
2590
+ message_menu_options_url?: string;
2591
+ };
2592
+ org_deploy_enabled?: boolean;
2593
+ socket_mode_enabled?: boolean;
2594
+ token_rotation_enabled?: boolean;
2595
+ };
559
2596
  }
560
2597
  /**
561
2598
  * Credentials returned when creating a Slack app via manifest API.
562
2599
  */
563
2600
  interface SlackAppCredentials {
564
- appId: string;
565
- clientId: string;
566
- clientSecret: string;
567
- signingSecret: string;
568
- oauthAuthorizeUrl?: string;
2601
+ appId: string;
2602
+ clientId: string;
2603
+ clientSecret: string;
2604
+ signingSecret: string;
2605
+ oauthAuthorizeUrl?: string;
569
2606
  }
570
-
2607
+ //#endregion
2608
+ //#region src/provider.d.ts
571
2609
  /**
572
2610
  * Slack channel integration for Mastra.
573
2611
  *
@@ -606,174 +2644,198 @@ interface SlackAppCredentials {
606
2644
  * ```
607
2645
  */
608
2646
  declare class SlackProvider implements ChannelProvider {
609
- #private;
610
- readonly id = "slack";
611
- constructor(config?: SlackProviderConfig);
612
- /**
613
- * Provide or clear Slack App Configuration credentials at runtime.
614
- *
615
- * Use this when credentials aren't available at construction time — for example,
616
- * when they're entered through the Editor UI or loaded from a vault.
617
- *
618
- * Pass `null` to clear credentials and delete stored tokens.
619
- *
620
- * @example
621
- * ```ts
622
- * const slack = new SlackProvider();
623
- * // Provide credentials (persists to storage immediately):
624
- * await slack.configure({ refreshToken: 'xoxe-1-...' });
625
- * // Clear credentials and stored tokens:
626
- * await slack.configure(null);
627
- * ```
628
- */
629
- configure(credentials: {
630
- refreshToken: string;
631
- token?: string;
632
- } | null): Promise<void>;
633
- /**
634
- * Called by Mastra when this channel is registered.
635
- * @internal
636
- */
637
- __attach(mastra: Mastra): void;
638
- /**
639
- * Set the base URL for webhook callbacks.
640
- * Only needed if not using Mastra server config.
641
- */
642
- setBaseUrl(baseUrl: string): void;
643
- /**
644
- * Restore active Slack installations from storage.
645
- *
646
- * For each active installation in the database, this creates a SlackAdapter
647
- * and injects AgentChannels into the corresponding Agent so it can receive
648
- * Slack events immediately on startup.
649
- *
650
- * Does NOT auto-provision new apps. Use `connect(agentId, options)` to
651
- * create a new Slack app for an agent.
652
- */
653
- initialize(): Promise<void>;
654
- /**
655
- * Get API routes for the Mastra server.
656
- * Add these to your Mastra config via `server.apiRoutes`.
657
- *
658
- * The mastra instance is automatically injected via createHandler.
659
- * On first request, auto-initializes any agents with slack configs.
660
- */
661
- getRoutes(): ApiRoute[];
662
- /**
663
- * Connect an agent to Slack by creating a new Slack app.
664
- *
665
- * @returns OAuth connect result with authorization URL for user redirect
666
- */
667
- connect(agentId: string, options?: SlackConnectOptions): Promise<ChannelConnectResult>;
668
- /**
669
- * Disconnect an agent from Slack by deleting its app.
670
- */
671
- disconnect(agentId: string): Promise<void>;
672
- /**
673
- * Get the Slack installation for an agent.
674
- */
675
- getInstallation(agentId: string): Promise<SlackInstallation | null>;
676
- /**
677
- * List all Slack installations (public info only).
678
- * Includes both active and pending installations.
679
- */
680
- listInstallations(): Promise<ChannelInstallationInfo[]>;
681
- /**
682
- * Discovery metadata for the editor UI.
683
- */
684
- getInfo(): ChannelPlatformInfo;
685
- /**
686
- * Check if the provider has credentials and can create/manage Slack apps.
687
- * Returns false if no refresh token has been provided via constructor, `configure()`, or storage.
688
- */
689
- isConfigured(): boolean;
690
- /**
691
- * Get the SlackAdapter for an installation.
692
- * Used internally for message formatting and posting.
693
- */
694
- getAdapter(installationId: string): SlackAdapter | undefined;
695
- }
696
-
2647
+ #private;
2648
+ readonly id = "slack";
2649
+ constructor(config?: SlackProviderConfig);
2650
+ /**
2651
+ * Provide or clear Slack App Configuration credentials at runtime.
2652
+ *
2653
+ * Use this when credentials aren't available at construction time — for example,
2654
+ * when they're entered through the Editor UI or loaded from a vault.
2655
+ *
2656
+ * Pass `null` to clear credentials and delete stored tokens.
2657
+ *
2658
+ * @example
2659
+ * ```ts
2660
+ * const slack = new SlackProvider();
2661
+ * // Provide credentials (persists to storage immediately):
2662
+ * await slack.configure({ refreshToken: 'xoxe-1-...' });
2663
+ * // Clear credentials and stored tokens:
2664
+ * await slack.configure(null);
2665
+ * ```
2666
+ */
2667
+ configure(credentials: {
2668
+ refreshToken: string;
2669
+ token?: string;
2670
+ } | null): Promise<void>;
2671
+ /**
2672
+ * Called by Mastra when this channel is registered.
2673
+ * @internal
2674
+ */
2675
+ __attach(mastra: Mastra): void;
2676
+ /**
2677
+ * Set the base URL for webhook callbacks.
2678
+ * Only needed if not using Mastra server config.
2679
+ */
2680
+ setBaseUrl(baseUrl: string): void;
2681
+ /**
2682
+ * Restore active Slack installations from storage.
2683
+ *
2684
+ * For each active installation in the database, this creates a SlackAdapter
2685
+ * and injects AgentChannels into the corresponding Agent so it can receive
2686
+ * Slack events immediately on startup.
2687
+ *
2688
+ * Does NOT auto-provision new apps. Use `connect(agentId, options)` to
2689
+ * create a new Slack app for an agent.
2690
+ */
2691
+ initialize(): Promise<void>;
2692
+ /**
2693
+ * Get API routes for the Mastra server.
2694
+ * Add these to your Mastra config via `server.apiRoutes`.
2695
+ *
2696
+ * The mastra instance is automatically injected via createHandler.
2697
+ * On first request, auto-initializes any agents with slack configs.
2698
+ */
2699
+ getRoutes(): ApiRoute[];
2700
+ /**
2701
+ * Connect an agent to Slack by creating a new Slack app.
2702
+ *
2703
+ * @returns OAuth connect result with authorization URL for user redirect
2704
+ */
2705
+ connect(agentId: string, options?: SlackConnectOptions): Promise<ChannelConnectResult>;
2706
+ /**
2707
+ * Connect to Slack by creating a new Slack app for an arbitrary connection id
2708
+ * (no registered agent required — e.g. an AgentController or custom owner).
2709
+ * Since there is no agent to derive a display name from, `name` is required.
2710
+ *
2711
+ * @returns OAuth connect result with authorization URL for user redirect
2712
+ */
2713
+ connect(options: SlackConnectOptions & {
2714
+ id: string;
2715
+ name: string;
2716
+ }): Promise<ChannelConnectResult>;
2717
+ /**
2718
+ * Disconnect an agent from Slack by deleting its app.
2719
+ */
2720
+ disconnect(agentId: string): Promise<void>;
2721
+ /**
2722
+ * Get the Slack installation for an agent.
2723
+ */
2724
+ getInstallation(agentId: string): Promise<SlackInstallation | null>;
2725
+ /**
2726
+ * List all Slack installations (public info only).
2727
+ * Includes both active and pending installations.
2728
+ */
2729
+ listInstallations(): Promise<ChannelInstallationInfo[]>;
2730
+ /**
2731
+ * Discovery metadata for the editor UI.
2732
+ */
2733
+ getInfo(): ChannelPlatformInfo;
2734
+ /**
2735
+ * Check if the provider has credentials and can create/manage Slack apps.
2736
+ * Returns false if no refresh token has been provided via constructor, `configure()`, or storage.
2737
+ */
2738
+ isConfigured(): boolean;
2739
+ /**
2740
+ * Get the SlackAdapter for an installation.
2741
+ * Used internally for message formatting and posting.
2742
+ */
2743
+ getAdapter(installationId: string): SlackAdapter$1 | undefined;
2744
+ }
2745
+ //#endregion
2746
+ //#region src/client.d.ts
697
2747
  interface SlackManifestClientConfig {
2748
+ token: string;
2749
+ refreshToken: string;
2750
+ onTokenRotation?: (tokens: {
698
2751
  token: string;
699
2752
  refreshToken: string;
700
- onTokenRotation?: (tokens: {
701
- token: string;
702
- refreshToken: string;
703
- }) => Promise<void>;
2753
+ }) => Promise<void>;
704
2754
  }
705
2755
  /**
706
2756
  * Client for Slack's App Manifest API.
707
2757
  * Handles programmatic app creation, deletion, and token rotation.
708
2758
  */
709
2759
  declare class SlackManifestClient {
710
- #private;
711
- constructor(config: SlackManifestClientConfig);
712
- /**
713
- * Get current tokens (after potential rotation).
714
- */
715
- getTokens(): {
716
- token: string;
717
- refreshToken: string;
718
- };
719
- /**
720
- * Update tokens (e.g., from storage on startup).
721
- */
722
- setTokens(tokens: {
723
- token: string;
724
- refreshToken: string;
725
- }): void;
726
- /**
727
- * Rotate the configuration tokens.
728
- * Slack config access tokens expire after 12 hours; the refresh token is single-use
729
- * and each rotation returns a new access token + refresh token pair.
730
- *
731
- * Concurrent callers share the same in-flight rotation to avoid burning
732
- * single-use refresh tokens.
733
- */
734
- rotateToken(): Promise<void>;
735
- /**
736
- * Create a new Slack app from a manifest.
737
- */
738
- createApp(manifest: SlackAppManifest): Promise<SlackAppCredentials>;
739
- /**
740
- * Delete a Slack app.
741
- */
742
- deleteApp(appId: string): Promise<void>;
743
- /**
744
- * Update an existing Slack app's manifest.
745
- */
746
- updateApp(appId: string, manifest: SlackAppManifest): Promise<void>;
747
- /**
748
- * Set the app icon via undocumented apps.icon.set API.
749
- */
750
- setAppIcon(appId: string, imageData: ArrayBuffer): Promise<void>;
751
- }
752
-
2760
+ #private;
2761
+ constructor(config: SlackManifestClientConfig);
2762
+ /**
2763
+ * Get current tokens (after potential rotation).
2764
+ */
2765
+ getTokens(): {
2766
+ token: string;
2767
+ refreshToken: string;
2768
+ };
2769
+ /**
2770
+ * Update tokens (e.g., from storage on startup).
2771
+ */
2772
+ setTokens(tokens: {
2773
+ token: string;
2774
+ refreshToken: string;
2775
+ }): void;
2776
+ /**
2777
+ * Rotate the configuration tokens.
2778
+ * Slack config access tokens expire after 12 hours; the refresh token is single-use
2779
+ * and each rotation returns a new access token + refresh token pair.
2780
+ *
2781
+ * Concurrent callers share the same in-flight rotation to avoid burning
2782
+ * single-use refresh tokens.
2783
+ */
2784
+ rotateToken(): Promise<void>;
2785
+ /**
2786
+ * Create a new Slack app from a manifest.
2787
+ */
2788
+ createApp(manifest: SlackAppManifest): Promise<SlackAppCredentials>;
2789
+ /**
2790
+ * Delete a Slack app.
2791
+ */
2792
+ deleteApp(appId: string): Promise<void>;
2793
+ /**
2794
+ * Check whether a Slack app still exists.
2795
+ *
2796
+ * Uses the read-only `apps.manifest.export` endpoint as an existence probe.
2797
+ * Returns `false` when Slack reports the app is missing/inaccessible
2798
+ * (e.g. it was deleted from the Slack admin UI), `true` when it exports
2799
+ * successfully. Network/transport errors are re-thrown so callers can
2800
+ * distinguish "app is gone" from "couldn't reach Slack".
2801
+ */
2802
+ appExists(appId: string): Promise<boolean>;
2803
+ /**
2804
+ * Update an existing Slack app's manifest.
2805
+ */
2806
+ updateApp(appId: string, manifest: SlackAppManifest): Promise<void>;
2807
+ /**
2808
+ * Set the app icon via undocumented apps.icon.set API.
2809
+ */
2810
+ setAppIcon(appId: string, imageData: ArrayBuffer): Promise<void>;
2811
+ }
2812
+ //#endregion
2813
+ //#region src/crypto.d.ts
753
2814
  /**
754
2815
  * Verify a Slack request signature.
755
2816
  * @see https://api.slack.com/authentication/verifying-requests-from-slack
756
2817
  */
757
2818
  declare function verifySlackRequest(params: {
758
- signingSecret: string;
759
- timestamp: string;
760
- body: string;
761
- signature: string;
2819
+ signingSecret: string;
2820
+ timestamp: string;
2821
+ body: string;
2822
+ signature: string;
762
2823
  }): boolean;
763
2824
  /**
764
2825
  * Parse URL-encoded form body from Slack slash commands.
765
2826
  * Uses URLSearchParams which correctly handles `+` as space.
766
2827
  */
767
2828
  declare function parseSlackFormBody(body: string): Record<string, string>;
768
-
2829
+ //#endregion
2830
+ //#region src/manifest.d.ts
769
2831
  /**
770
2832
  * Slash command for manifest building.
771
2833
  * Simplified version of SlashCommandConfig for manifest generation.
772
2834
  */
773
2835
  interface SlashCommand {
774
- command: string;
775
- description?: string;
776
- usageHint?: string;
2836
+ command: string;
2837
+ description?: string;
2838
+ usageHint?: string;
777
2839
  }
778
2840
  /**
779
2841
  * Default bot scopes required for agent functionality.
@@ -784,22 +2846,23 @@ declare const DEFAULT_BOT_SCOPES: readonly ["chat:write", "chat:write.public", "
784
2846
  */
785
2847
  declare const DEFAULT_BOT_EVENTS: readonly ["app_mention", "message.channels", "message.groups", "message.im", "message.mpim"];
786
2848
  interface BuildManifestOptions {
787
- /** Display name for the Slack app */
788
- name: string;
789
- /** Description shown in Slack */
790
- description?: string;
791
- /** URL for event webhooks */
792
- webhookUrl: string;
793
- /** URL for OAuth redirect */
794
- oauthRedirectUrl: string;
795
- /** URL for slash command webhooks (defaults to webhookUrl) */
796
- commandsUrl?: string;
797
- /** Slash commands to register */
798
- slashCommands?: SlashCommand[];
2849
+ /** Display name for the Slack app */
2850
+ name: string;
2851
+ /** Description shown in Slack */
2852
+ description?: string;
2853
+ /** URL for event webhooks */
2854
+ webhookUrl: string;
2855
+ /** URL for OAuth redirect */
2856
+ oauthRedirectUrl: string;
2857
+ /** URL for slash command webhooks (defaults to webhookUrl) */
2858
+ commandsUrl?: string;
2859
+ /** Slash commands to register */
2860
+ slashCommands?: SlashCommand[];
799
2861
  }
800
2862
  /**
801
2863
  * Build a Slack app manifest for an agent.
802
2864
  */
803
2865
  declare function buildManifest(options: BuildManifestOptions): SlackAppManifest;
804
-
805
- export { DEFAULT_BOT_EVENTS, DEFAULT_BOT_SCOPES, type SlackAdapterChannelConfig, type SlackAppManifest, type SlackBlock, type SlackConfigData, SlackConfigDataSchema, type SlackConfigTokens, type SlackConnectOptions, type SlackInstallation, type SlackInstallationData, SlackInstallationDataSchema, SlackManifestClient, type SlackMessage, type SlackPendingData, SlackPendingDataSchema, type SlackPendingInstallation, SlackProvider, type SlackProviderConfig, type SlashCommandConfig, buildManifest, parseSlackFormBody, verifySlackRequest };
2866
+ //#endregion
2867
+ export { DEFAULT_BOT_EVENTS, DEFAULT_BOT_SCOPES, type SlackAdapter, type SlackAdapterChannelConfig, type SlackAppManifest, type SlackBlock, type SlackConfigData, SlackConfigDataSchema, type SlackConfigTokens, type SlackConnectOptions, type SlackInstallation, type SlackInstallationData, SlackInstallationDataSchema, SlackManifestClient, type SlackMessage, type SlackPendingData, SlackPendingDataSchema, type SlackPendingInstallation, SlackProvider, type SlackProviderConfig, type SlashCommandConfig, buildManifest, createSlackAdapter, parseSlackFormBody, verifySlackRequest };
2868
+ //# sourceMappingURL=index.d.cts.map