@mastra/slack 1.6.0-alpha.0 → 1.6.1-alpha.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,212 +1,2237 @@
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>;
2029
+ declare const SlashCommandSchema: ZodObject<{
2030
+ command: ZodString;
2031
+ description: ZodOptional<ZodString>;
2032
+ usageHint: ZodOptional<ZodString>;
2033
+ prompt: ZodOptional<ZodString>;
2034
+ }, $strip>;
19
2035
  /** Who owns an installation: a registered Agent (default) or an AgentController. */
20
- declare const OwnerTypeSchema: z.ZodEnum<{
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<{
21
2043
  agent: "agent";
22
2044
  agentController: "agentController";
23
- }>;
24
- type SlackOwnerType = z.infer<typeof OwnerTypeSchema>;
25
- declare const SlackInstallationDataSchema: z.ZodObject<{
26
- ownerType: z.ZodOptional<z.ZodEnum<{
27
- agent: "agent";
28
- agentController: "agentController";
29
- }>>;
30
- appId: z.ZodString;
31
- clientId: z.ZodString;
32
- clientSecret: z.ZodString;
33
- signingSecret: z.ZodString;
34
- teamId: z.ZodString;
35
- teamName: z.ZodOptional<z.ZodString>;
36
- botToken: z.ZodString;
37
- botUserId: z.ZodString;
38
- name: z.ZodOptional<z.ZodString>;
39
- description: z.ZodOptional<z.ZodString>;
40
- slashCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
- command: z.ZodString;
42
- description: z.ZodOptional<z.ZodString>;
43
- usageHint: z.ZodOptional<z.ZodString>;
44
- prompt: z.ZodOptional<z.ZodString>;
45
- }, z.core.$strip>>>;
46
- }, z.core.$strip>;
47
- type SlackInstallationData = z.infer<typeof SlackInstallationDataSchema>;
48
- declare const SlackPendingDataSchema: z.ZodObject<{
49
- ownerType: z.ZodOptional<z.ZodEnum<{
50
- agent: "agent";
51
- agentController: "agentController";
52
- }>>;
53
- appId: z.ZodString;
54
- clientId: z.ZodString;
55
- clientSecret: z.ZodString;
56
- signingSecret: z.ZodString;
57
- authorizationUrl: z.ZodString;
58
- name: z.ZodOptional<z.ZodString>;
59
- description: z.ZodOptional<z.ZodString>;
60
- slashCommands: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
- command: z.ZodString;
62
- description: z.ZodOptional<z.ZodString>;
63
- usageHint: z.ZodOptional<z.ZodString>;
64
- prompt: z.ZodOptional<z.ZodString>;
65
- }, z.core.$strip>>>;
66
- redirectUrl: z.ZodOptional<z.ZodString>;
67
- }, z.core.$strip>;
68
- type SlackPendingData = z.infer<typeof SlackPendingDataSchema>;
69
- declare const SlackConfigDataSchema: z.ZodObject<{
70
- token: z.ZodOptional<z.ZodString>;
71
- refreshToken: z.ZodString;
72
- }, z.core.$strip>;
73
- type SlackConfigData = z.infer<typeof SlackConfigDataSchema>;
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>;
74
2090
  /** Normalized slash command config as stored in installation data. */
75
- type StoredSlashCommand = z.infer<typeof SlashCommandSchema>;
2091
+ type StoredSlashCommand = output<typeof SlashCommandSchema>;
76
2092
  interface SlackInstallation {
77
- id: string;
78
- /** Owner key: an agent id when ownerType is 'agent' (default), or an AgentController id. */
79
- agentId: string;
80
- /** Defaults to 'agent' when absent (pre-existing installations). */
81
- ownerType?: SlackOwnerType;
82
- webhookId: string;
83
- configHash: string;
84
- installedAt: Date;
85
- appId: string;
86
- clientId: string;
87
- clientSecret: string;
88
- signingSecret: string;
89
- teamId: string;
90
- teamName?: string;
91
- botToken: string;
92
- botUserId: 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[];
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[];
98
2114
  }
99
2115
  interface SlackPendingInstallation {
100
- id: string;
101
- /** Owner key: an agent id when ownerType is 'agent' (default), or an AgentController id. */
102
- agentId: string;
103
- /** Defaults to 'agent' when absent (pre-existing installations). */
104
- ownerType?: SlackOwnerType;
105
- webhookId: string;
106
- configHash: string;
107
- createdAt: Date;
108
- appId: string;
109
- clientId: string;
110
- clientSecret: string;
111
- signingSecret: string;
112
- authorizationUrl: string;
113
- /** Explicit name passed to connect(), takes priority over agent.name */
114
- name?: string;
115
- /** Explicit description passed to connect(), takes priority over agent.getDescription() */
116
- description?: string;
117
- slashCommands?: StoredSlashCommand[];
118
- 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;
119
2135
  }
120
2136
  interface SlackConfigTokens {
121
- token?: string;
122
- refreshToken: string;
123
- updatedAt: Date;
2137
+ token?: string;
2138
+ refreshToken: string;
2139
+ updatedAt: Date;
124
2140
  }
125
-
2141
+ //#endregion
2142
+ //#region src/types.d.ts
126
2143
  /**
127
2144
  * Per-adapter overrides shared across both streaming and static branches
128
2145
  * of {@link SlackAdapterChannelConfig}.
129
2146
  */
130
2147
  interface SlackAdapterChannelConfigBase {
131
- /** CORS configuration for the Slack webhook route. */
132
- cors?: ChannelAdapterConfig['cors'];
133
- /** Slack gateway listener toggle. Currently a no-op for Slack (HTTP-only). */
134
- gateway?: ChannelAdapterConfig['gateway'];
135
- /** Override how errors are rendered in Slack messages. */
136
- formatError?: ChannelAdapterConfig['formatError'];
137
- /**
138
- * Control Slack typing indicators and Assistant-mode status text.
139
- *
140
- * - `true` — use built-in defaults: `"is typing…"` while generating text,
141
- * `"is calling {toolName}…"` while a tool runs, `"is waiting for
142
- * approval…"` while a tool is suspended. Slack auto-prepends the app
143
- * name so the user sees `"<App Name> is typing…"`.
144
- * - `false` — never call `startTyping`. Useful when a live streaming
145
- * widget (e.g. `toolDisplay: 'grouped'`) already conveys progress.
146
- * - `(chunk, ctx) => string | false | null | undefined | void` — set
147
- * custom copy per chunk. Return a string to override the status,
148
- * or `false`/`null`/`undefined` to leave it unchanged. Compose with
149
- * `defaultTypingStatus` (exported from `@mastra/core/channels`) to
150
- * fall back to defaults for chunks you don't handle.
151
- *
152
- * @default true
153
- */
154
- 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
+ * Dialect for the agent's final reply text. See `ChannelAdapterConfig['textFormat']`.
2156
+ * `'markdown'` (default) posts replies as markdown for native Slack rendering;
2157
+ * `'plain'` posts literal plain text (escape hatch for agents prompted to emit
2158
+ * Slack mrkdwn). Applies to the static driver and the streaming fallback;
2159
+ * native streaming is always markdown.
2160
+ */
2161
+ textFormat?: ChannelAdapterConfig['textFormat'];
2162
+ /**
2163
+ * Control Slack typing indicators and Assistant-mode status text.
2164
+ *
2165
+ * - `true` — use built-in defaults: `"is typing…"` while generating text,
2166
+ * `"is calling {toolName}…"` while a tool runs, `"is waiting for
2167
+ * approval…"` while a tool is suspended. Slack auto-prepends the app
2168
+ * name so the user sees `"<App Name> is typing…"`.
2169
+ * - `false` — never call `startTyping`. Useful when a live streaming
2170
+ * widget (e.g. `toolDisplay: 'grouped'`) already conveys progress.
2171
+ * - `(chunk, ctx) => string | false | null | undefined | void` — set
2172
+ * custom copy per chunk. Return a string to override the status,
2173
+ * or `false`/`null`/`undefined` to leave it unchanged. Compose with
2174
+ * `defaultTypingStatus` (exported from `@mastra/core/channels`) to
2175
+ * fall back to defaults for chunks you don't handle.
2176
+ *
2177
+ * @default true
2178
+ */
2179
+ typingStatus?: ChannelAdapterConfig['typingStatus'];
155
2180
  }
156
2181
  /**
157
2182
  * Slack adapter overrides with `streaming` enabled (the default). Allows any
158
2183
  * `toolDisplay` mode, including the streaming-only `'timeline'` / `'grouped'`.
159
2184
  */
160
2185
  interface SlackAdapterStreamingConfig extends SlackAdapterChannelConfigBase {
161
- /**
162
- * Stream agent text deltas to Slack as the agent generates them.
163
- *
164
- * - `true` (default) — stream with default options.
165
- * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
166
- *
167
- * @default true
168
- */
169
- streaming?: Exclude<StreamingConfig, false>;
170
- /**
171
- * How tool calls are rendered in Slack.
172
- *
173
- * - `'cards'` — per-tool "Running…" → "Result" Block Kit cards (the streaming
174
- * session is closed/posted/reopened around each card).
175
- * - `'text'` — per-tool plain-text messages (no Block Kit).
176
- * - `'timeline'` — render tools as inline task entries beside the streaming text.
177
- * - `'grouped'` (default in Slack) — collapse all tools into a single
178
- * "Thinking Steps" plan widget. Renders well in Slack's AI Assistant UI.
179
- * - `'hidden'` — execute tools silently; only the typing status indicates work.
180
- * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
181
- *
182
- * Approve/deny prompts (`requireApproval`) always render as a separate card.
183
- *
184
- * @default 'grouped'
185
- */
186
- toolDisplay?: ToolDisplay;
2186
+ /**
2187
+ * Stream agent text deltas to Slack as the agent generates them.
2188
+ *
2189
+ * - `true` (default) — stream with default options.
2190
+ * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
2191
+ *
2192
+ * @default true
2193
+ */
2194
+ streaming?: Exclude<StreamingConfig, false>;
2195
+ /**
2196
+ * How tool calls are rendered in Slack.
2197
+ *
2198
+ * - `'cards'` — per-tool "Running…" → "Result" Block Kit cards (the streaming
2199
+ * session is closed/posted/reopened around each card).
2200
+ * - `'text'` — per-tool plain-text messages (no Block Kit).
2201
+ * - `'timeline'` — render tools as inline task entries beside the streaming text.
2202
+ * - `'grouped'` (default in Slack) — collapse all tools into a single
2203
+ * "Thinking Steps" plan widget. Renders well in Slack's AI Assistant UI.
2204
+ * - `'hidden'` — execute tools silently; only the typing status indicates work.
2205
+ * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
2206
+ *
2207
+ * Approve/deny prompts (`requireApproval`) always render as a separate card.
2208
+ *
2209
+ * @default 'grouped'
2210
+ */
2211
+ toolDisplay?: ToolDisplay;
187
2212
  }
188
2213
  /**
189
2214
  * Slack adapter overrides with `streaming: false`. Restricts `toolDisplay`
190
2215
  * to modes that post discrete messages (no `StreamingPlan` available).
191
2216
  */
192
2217
  interface SlackAdapterStaticConfig extends SlackAdapterChannelConfigBase {
193
- /**
194
- * Disable Slack's native message streaming and buffer text until `step-finish`.
195
- * `'timeline'` and `'grouped'` modes require streaming, so they're not
196
- * available on this branch.
197
- */
198
- streaming: false;
199
- /**
200
- * How tool calls are rendered in Slack (static modes only).
201
- *
202
- * - `'cards'` (default) — per-tool "Running…" → "Result" Block Kit cards.
203
- * - `'text'` — per-tool plain-text messages (no Block Kit).
204
- * - `'hidden'` — execute tools silently; only the typing status indicates work.
205
- * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
206
- *
207
- * @default 'cards'
208
- */
209
- toolDisplay?: StaticToolDisplay;
2218
+ /**
2219
+ * Disable Slack's native message streaming and buffer text until `step-finish`.
2220
+ * `'timeline'` and `'grouped'` modes require streaming, so they're not
2221
+ * available on this branch.
2222
+ */
2223
+ streaming: false;
2224
+ /**
2225
+ * How tool calls are rendered in Slack (static modes only).
2226
+ *
2227
+ * - `'cards'` (default) — per-tool "Running…" → "Result" Block Kit cards.
2228
+ * - `'text'` — per-tool plain-text messages (no Block Kit).
2229
+ * - `'hidden'` — execute tools silently; only the typing status indicates work.
2230
+ * - Function form ({@link ToolDisplay}): a `ToolDisplayFn` for full control.
2231
+ *
2232
+ * @default 'cards'
2233
+ */
2234
+ toolDisplay?: StaticToolDisplay;
210
2235
  }
211
2236
  /**
212
2237
  * Per-adapter overrides applied to the Slack entry inside
@@ -220,170 +2245,170 @@ type SlackAdapterChannelConfig = SlackAdapterStreamingConfig | SlackAdapterStati
220
2245
  * {@link SlackProviderConfig}.
221
2246
  */
222
2247
  interface SlackProviderConfigBase extends SlackAdapterChannelConfigBase {
223
- /**
224
- * Override built-in event handlers (e.g. `onDirectMessage`, `onMention`).
225
- * Forwarded to `AgentChannels` for every agent connected via this provider.
226
- *
227
- * @example
228
- * ```ts
229
- * handlers: {
230
- * onDirectMessage: async (thread, message, defaultHandler) => {
231
- * console.log('DM:', message.text);
232
- * await defaultHandler(thread, message);
233
- * },
234
- * }
235
- * ```
236
- */
237
- handlers?: ChannelHandlers;
238
- /** Which media types to send inline to the model. See `ChannelConfig.inlineMedia`. */
239
- inlineMedia?: ChannelConfig['inlineMedia'];
240
- /** Promote URLs in message text to file parts. See `ChannelConfig.inlineLinks`. */
241
- inlineLinks?: ChannelConfig['inlineLinks'];
242
- /** State adapter for deduplication, locking, and subscriptions. */
243
- state?: ChannelConfig['state'];
244
- /** Fetch recent thread messages from Slack when the agent joins mid-conversation. */
245
- threadContext?: ChannelConfig['threadContext'];
246
- /** Whether to include channel tools (add_reaction, remove_reaction). */
247
- tools?: ChannelConfig['tools'];
248
- /** Additional options passed directly to the Chat SDK. */
249
- chatOptions?: ChannelConfig['chatOptions'];
250
- /**
251
- * Logger forwarded to the underlying `SlackAdapter` for internal error
252
- * reporting. Defaults to the adapter's `ConsoleLogger`.
253
- */
254
- logger?: SlackAdapterConfig['logger'];
255
- /**
256
- * Slack App Configuration access token for programmatic app creation.
257
- * Generate at: https://api.slack.com/apps > "Your App Configuration Tokens"
258
- *
259
- * Optional — will rotate to get a fresh token on startup using `refreshToken`.
260
- */
261
- token?: string;
262
- /**
263
- * Slack App Configuration refresh token.
264
- * Used for automatic token rotation. Single-use; each rotation returns a new pair.
265
- *
266
- * Can be provided here or later via `configure({ refreshToken })`.
267
- * If omitted, the provider starts unconfigured and cannot create apps until
268
- * `configure()` is called or tokens are loaded from storage.
269
- */
270
- refreshToken?: string;
271
- /**
272
- * Base URL for webhook callbacks.
273
- * Required when calling connect() to create apps.
274
- * Can also be set later via setBaseUrl() or auto-detected from server config.
275
- *
276
- * For local development, use a tunnel like cloudflared:
277
- * ```
278
- * baseUrl: 'https://abc123.trycloudflare.com'
279
- * ```
280
- */
281
- baseUrl?: string;
282
- /**
283
- * Custom storage for installations.
284
- * Defaults to using Mastra's ChannelsStorage from the global storage.
285
- * Throws if no persistent storage is available.
286
- */
287
- storage?: ChannelsStorage;
288
- /**
289
- * Path to redirect to after OAuth completion.
290
- * Defaults to "/" (homepage)
291
- */
292
- redirectPath?: string;
293
- /**
294
- * Called when a workspace successfully installs the app.
295
- */
296
- onInstall?: (installation: SlackInstallation) => Promise<void>;
297
- /**
298
- * Encryption key for sensitive data (clientSecret, signingSecret, botToken).
299
- * If not provided, secrets are stored in plaintext (not recommended for production).
300
- *
301
- * Use a 32+ character random string. Can be set via MASTRA_ENCRYPTION_KEY env var.
302
- */
303
- encryptionKey?: string;
304
- /**
305
- * Resolver that returns a `waitUntil` for the current Slack webhook request.
306
- *
307
- * Required on serverless runtimes where Hono can't bridge the platform's
308
- * `ExecutionContext` automatically (Vercel, AWS Lambda). Without `waitUntil`, the
309
- * runtime freezes the invocation as soon as the 200 ack returns, killing the
310
- * agent run mid-flight and leaving the user with no Slack reply.
311
- *
312
- * Pass the bare `waitUntil(promise)` function from your platform's SDK. If your
313
- * runtime requires the Hono `Context` to derive `waitUntil`, use
314
- * {@link resolveWaitUntil} instead.
315
- *
316
- * Cloudflare Workers and Netlify users typically don't need this — Mastra's
317
- * default helper already reads `c.executionCtx.waitUntil` and
318
- * `c.env.context.waitUntil`.
319
- *
320
- * @example
321
- * ```ts
322
- * import { waitUntil } from '@vercel/functions';
323
- * new SlackProvider({ waitUntil });
324
- * ```
325
- */
326
- waitUntil?: WaitUntilFn;
327
- /**
328
- * Resolve `waitUntil` from the request's Hono `Context`. Use this when the runtime
329
- * exposes `waitUntil` through the request and core's default doesn't cover it.
330
- *
331
- * For platforms whose `waitUntil` is a bare import (e.g. `@vercel/functions`),
332
- * pass it via {@link waitUntil} instead.
333
- *
334
- * Resolution order: {@link waitUntil} → {@link resolveWaitUntil} → core default.
335
- */
336
- resolveWaitUntil?: WaitUntilResolver;
337
- /**
338
- * Per-adapter overrides applied to the Slack adapter entry inside
339
- * `AgentChannels.adapters` — for example `toolDisplay`, `streaming`,
340
- * `formatError`.
341
- *
342
- * @deprecated Pass these fields at the top level of `SlackProviderConfig`
343
- * instead. Top-level fields win; values from `adapterConfig` are merged in
344
- * as a fallback for backwards compatibility.
345
- */
346
- adapterConfig?: SlackAdapterChannelConfig;
2248
+ /**
2249
+ * Override built-in event handlers (e.g. `onDirectMessage`, `onMention`).
2250
+ * Forwarded to `AgentChannels` for every agent connected via this provider.
2251
+ *
2252
+ * @example
2253
+ * ```ts
2254
+ * handlers: {
2255
+ * onDirectMessage: async (thread, message, defaultHandler) => {
2256
+ * console.log('DM:', message.text);
2257
+ * await defaultHandler(thread, message);
2258
+ * },
2259
+ * }
2260
+ * ```
2261
+ */
2262
+ handlers?: ChannelHandlers;
2263
+ /** Which media types to send inline to the model. See `ChannelConfig.inlineMedia`. */
2264
+ inlineMedia?: ChannelConfig['inlineMedia'];
2265
+ /** Promote URLs in message text to file parts. See `ChannelConfig.inlineLinks`. */
2266
+ inlineLinks?: ChannelConfig['inlineLinks'];
2267
+ /** State adapter for deduplication, locking, and subscriptions. */
2268
+ state?: ChannelConfig['state'];
2269
+ /** Fetch recent thread messages from Slack when the agent joins mid-conversation. */
2270
+ threadContext?: ChannelConfig['threadContext'];
2271
+ /** Whether to include channel tools (add_reaction, remove_reaction). */
2272
+ tools?: ChannelConfig['tools'];
2273
+ /** Additional options passed directly to the Chat SDK. */
2274
+ chatOptions?: ChannelConfig['chatOptions'];
2275
+ /**
2276
+ * Logger forwarded to the underlying `SlackAdapter` for internal error
2277
+ * reporting. Defaults to the adapter's `ConsoleLogger`.
2278
+ */
2279
+ logger?: SlackAdapterConfig['logger'];
2280
+ /**
2281
+ * Slack App Configuration access token for programmatic app creation.
2282
+ * Generate at: https://api.slack.com/apps > "Your App Configuration Tokens"
2283
+ *
2284
+ * Optional — will rotate to get a fresh token on startup using `refreshToken`.
2285
+ */
2286
+ token?: string;
2287
+ /**
2288
+ * Slack App Configuration refresh token.
2289
+ * Used for automatic token rotation. Single-use; each rotation returns a new pair.
2290
+ *
2291
+ * Can be provided here or later via `configure({ refreshToken })`.
2292
+ * If omitted, the provider starts unconfigured and cannot create apps until
2293
+ * `configure()` is called or tokens are loaded from storage.
2294
+ */
2295
+ refreshToken?: string;
2296
+ /**
2297
+ * Base URL for webhook callbacks.
2298
+ * Required when calling connect() to create apps.
2299
+ * Can also be set later via setBaseUrl() or auto-detected from server config.
2300
+ *
2301
+ * For local development, use a tunnel like cloudflared:
2302
+ * ```
2303
+ * baseUrl: 'https://abc123.trycloudflare.com'
2304
+ * ```
2305
+ */
2306
+ baseUrl?: string;
2307
+ /**
2308
+ * Custom storage for installations.
2309
+ * Defaults to using Mastra's ChannelsStorage from the global storage.
2310
+ * Throws if no persistent storage is available.
2311
+ */
2312
+ storage?: ChannelsStorage;
2313
+ /**
2314
+ * Path to redirect to after OAuth completion.
2315
+ * Defaults to "/" (homepage)
2316
+ */
2317
+ redirectPath?: string;
2318
+ /**
2319
+ * Called when a workspace successfully installs the app.
2320
+ */
2321
+ onInstall?: (installation: SlackInstallation) => Promise<void>;
2322
+ /**
2323
+ * Encryption key for sensitive data (clientSecret, signingSecret, botToken).
2324
+ * If not provided, secrets are stored in plaintext (not recommended for production).
2325
+ *
2326
+ * Use a 32+ character random string. Can be set via MASTRA_ENCRYPTION_KEY env var.
2327
+ */
2328
+ encryptionKey?: string;
2329
+ /**
2330
+ * Resolver that returns a `waitUntil` for the current Slack webhook request.
2331
+ *
2332
+ * Required on serverless runtimes where Hono can't bridge the platform's
2333
+ * `ExecutionContext` automatically (Vercel, AWS Lambda). Without `waitUntil`, the
2334
+ * runtime freezes the invocation as soon as the 200 ack returns, killing the
2335
+ * agent run mid-flight and leaving the user with no Slack reply.
2336
+ *
2337
+ * Pass the bare `waitUntil(promise)` function from your platform's SDK. If your
2338
+ * runtime requires the Hono `Context` to derive `waitUntil`, use
2339
+ * {@link resolveWaitUntil} instead.
2340
+ *
2341
+ * Cloudflare Workers and Netlify users typically don't need this — Mastra's
2342
+ * default helper already reads `c.executionCtx.waitUntil` and
2343
+ * `c.env.context.waitUntil`.
2344
+ *
2345
+ * @example
2346
+ * ```ts
2347
+ * import { waitUntil } from '@vercel/functions';
2348
+ * new SlackProvider({ waitUntil });
2349
+ * ```
2350
+ */
2351
+ waitUntil?: WaitUntilFn;
2352
+ /**
2353
+ * Resolve `waitUntil` from the request's Hono `Context`. Use this when the runtime
2354
+ * exposes `waitUntil` through the request and core's default doesn't cover it.
2355
+ *
2356
+ * For platforms whose `waitUntil` is a bare import (e.g. `@vercel/functions`),
2357
+ * pass it via {@link waitUntil} instead.
2358
+ *
2359
+ * Resolution order: {@link waitUntil} → {@link resolveWaitUntil} → core default.
2360
+ */
2361
+ resolveWaitUntil?: WaitUntilResolver;
2362
+ /**
2363
+ * Per-adapter overrides applied to the Slack adapter entry inside
2364
+ * `AgentChannels.adapters` — for example `toolDisplay`, `streaming`,
2365
+ * `formatError`.
2366
+ *
2367
+ * @deprecated Pass these fields at the top level of `SlackProviderConfig`
2368
+ * instead. Top-level fields win; values from `adapterConfig` are merged in
2369
+ * as a fallback for backwards compatibility.
2370
+ */
2371
+ adapterConfig?: SlackAdapterChannelConfig;
347
2372
  }
348
2373
  /**
349
2374
  * Slack provider configuration with `streaming` enabled (the default).
350
2375
  * Allows any `toolDisplay` mode.
351
2376
  */
352
2377
  interface SlackProviderStreamingConfig extends SlackProviderConfigBase {
353
- /**
354
- * Stream agent text deltas to Slack as the agent generates them.
355
- *
356
- * - `true` (default) — stream with default options.
357
- * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
358
- *
359
- * @default true
360
- */
361
- streaming?: Exclude<StreamingConfig, false>;
362
- /**
363
- * How tool calls are rendered in Slack. See {@link SlackAdapterStreamingConfig#toolDisplay}.
364
- *
365
- * @default 'grouped'
366
- */
367
- toolDisplay?: ToolDisplay;
2378
+ /**
2379
+ * Stream agent text deltas to Slack as the agent generates them.
2380
+ *
2381
+ * - `true` (default) — stream with default options.
2382
+ * - `{ updateIntervalMs }` — stream with a custom post-and-edit interval.
2383
+ *
2384
+ * @default true
2385
+ */
2386
+ streaming?: Exclude<StreamingConfig, false>;
2387
+ /**
2388
+ * How tool calls are rendered in Slack. See {@link SlackAdapterStreamingConfig#toolDisplay}.
2389
+ *
2390
+ * @default 'grouped'
2391
+ */
2392
+ toolDisplay?: ToolDisplay;
368
2393
  }
369
2394
  /**
370
2395
  * Slack provider configuration with `streaming: false`. Restricts
371
2396
  * `toolDisplay` to modes that post discrete messages.
372
2397
  */
373
2398
  interface SlackProviderStaticConfig extends SlackProviderConfigBase {
374
- /**
375
- * Disable Slack's native message streaming and buffer text until `step-finish`.
376
- * `'timeline'` and `'grouped'` modes require streaming, so they're not
377
- * available on this branch.
378
- */
379
- streaming: false;
380
- /**
381
- * How tool calls are rendered in Slack (static modes only). See
382
- * {@link SlackAdapterStaticConfig#toolDisplay}.
383
- *
384
- * @default 'cards'
385
- */
386
- toolDisplay?: StaticToolDisplay;
2399
+ /**
2400
+ * Disable Slack's native message streaming and buffer text until `step-finish`.
2401
+ * `'timeline'` and `'grouped'` modes require streaming, so they're not
2402
+ * available on this branch.
2403
+ */
2404
+ streaming: false;
2405
+ /**
2406
+ * How tool calls are rendered in Slack (static modes only). See
2407
+ * {@link SlackAdapterStaticConfig#toolDisplay}.
2408
+ *
2409
+ * @default 'cards'
2410
+ */
2411
+ toolDisplay?: StaticToolDisplay;
387
2412
  }
388
2413
  /**
389
2414
  * Configuration for SlackProvider at the Mastra level.
@@ -402,86 +2427,86 @@ type SlackProviderConfig = SlackProviderStreamingConfig | SlackProviderStaticCon
402
2427
  * This is serializable and can be stored in the database for stored agents.
403
2428
  */
404
2429
  interface SlackConnectOptions {
405
- /**
406
- * Display name for the Slack bot.
407
- * Defaults to agent name, then agent ID.
408
- */
409
- name?: string;
410
- /**
411
- * Bot description shown in Slack.
412
- * Defaults to "{name} - Powered by Mastra".
413
- */
414
- description?: string;
415
- /**
416
- * URL to an image for the app icon.
417
- * Should be a square PNG/JPG, minimum 512x512px.
418
- * The image will be automatically downloaded and uploaded to Slack.
419
- *
420
- * @example
421
- * iconUrl: 'https://example.com/my-bot-avatar.png'
422
- */
423
- iconUrl?: string;
424
- /**
425
- * Slash commands this agent supports.
426
- *
427
- * Simple form - command triggers agent.generate() with the input text:
428
- * ```ts
429
- * slashCommands: ['/ask']
430
- * ```
431
- *
432
- * With custom prompt template:
433
- * ```ts
434
- * slashCommands: [
435
- * {
436
- * command: '/summarize',
437
- * description: 'Summarize a URL',
438
- * prompt: 'Fetch and summarize: {{text}}'
439
- * }
440
- * ]
441
- * ```
442
- *
443
- * Use {{text}} as placeholder for user input.
444
- */
445
- slashCommands?: (string | SlashCommandConfig)[];
446
- /**
447
- * Customize the Slack app manifest before it's sent to the Manifest API.
448
- *
449
- * Receives the default manifest (built from name, description, slashCommands,
450
- * and internal URLs) and returns the final manifest to use.
451
- *
452
- * Use this for any advanced Slack configuration: custom scopes, events,
453
- * interactivity settings, etc.
454
- *
455
- * @example
456
- * // Add extra scopes
457
- * manifest: (m) => ({
458
- * ...m,
459
- * oauth_config: {
460
- * ...m.oauth_config,
461
- * scopes: { bot: [...(m.oauth_config?.scopes?.bot ?? []), 'files:write'] }
462
- * }
463
- * })
464
- *
465
- * @example
466
- * // Subscribe to additional events
467
- * manifest: (m) => ({
468
- * ...m,
469
- * settings: {
470
- * ...m.settings,
471
- * event_subscriptions: {
472
- * ...m.settings?.event_subscriptions,
473
- * bot_events: [...(m.settings?.event_subscriptions?.bot_events ?? []), 'reaction_added']
474
- * }
475
- * }
476
- * })
477
- */
478
- manifest?: (defaults: SlackAppManifest) => SlackAppManifest;
479
- /**
480
- * URL to redirect to after successful OAuth completion.
481
- * Typically set by the Studio UI to return to the agent page.
482
- * Defaults to `SlackProviderConfig.redirectPath` or `/`.
483
- */
484
- redirectUrl?: string;
2430
+ /**
2431
+ * Display name for the Slack bot.
2432
+ * Defaults to agent name, then agent ID.
2433
+ */
2434
+ name?: string;
2435
+ /**
2436
+ * Bot description shown in Slack.
2437
+ * Defaults to "{name} - Powered by Mastra".
2438
+ */
2439
+ description?: string;
2440
+ /**
2441
+ * URL to an image for the app icon.
2442
+ * Should be a square PNG/JPG, minimum 512x512px.
2443
+ * The image will be automatically downloaded and uploaded to Slack.
2444
+ *
2445
+ * @example
2446
+ * iconUrl: 'https://example.com/my-bot-avatar.png'
2447
+ */
2448
+ iconUrl?: string;
2449
+ /**
2450
+ * Slash commands this agent supports.
2451
+ *
2452
+ * Simple form - command triggers agent.generate() with the input text:
2453
+ * ```ts
2454
+ * slashCommands: ['/ask']
2455
+ * ```
2456
+ *
2457
+ * With custom prompt template:
2458
+ * ```ts
2459
+ * slashCommands: [
2460
+ * {
2461
+ * command: '/summarize',
2462
+ * description: 'Summarize a URL',
2463
+ * prompt: 'Fetch and summarize: {{text}}'
2464
+ * }
2465
+ * ]
2466
+ * ```
2467
+ *
2468
+ * Use {{text}} as placeholder for user input.
2469
+ */
2470
+ slashCommands?: (string | SlashCommandConfig)[];
2471
+ /**
2472
+ * Customize the Slack app manifest before it's sent to the Manifest API.
2473
+ *
2474
+ * Receives the default manifest (built from name, description, slashCommands,
2475
+ * and internal URLs) and returns the final manifest to use.
2476
+ *
2477
+ * Use this for any advanced Slack configuration: custom scopes, events,
2478
+ * interactivity settings, etc.
2479
+ *
2480
+ * @example
2481
+ * // Add extra scopes
2482
+ * manifest: (m) => ({
2483
+ * ...m,
2484
+ * oauth_config: {
2485
+ * ...m.oauth_config,
2486
+ * scopes: { bot: [...(m.oauth_config?.scopes?.bot ?? []), 'files:write'] }
2487
+ * }
2488
+ * })
2489
+ *
2490
+ * @example
2491
+ * // Subscribe to additional events
2492
+ * manifest: (m) => ({
2493
+ * ...m,
2494
+ * settings: {
2495
+ * ...m.settings,
2496
+ * event_subscriptions: {
2497
+ * ...m.settings?.event_subscriptions,
2498
+ * bot_events: [...(m.settings?.event_subscriptions?.bot_events ?? []), 'reaction_added']
2499
+ * }
2500
+ * }
2501
+ * })
2502
+ */
2503
+ manifest?: (defaults: SlackAppManifest) => SlackAppManifest;
2504
+ /**
2505
+ * URL to redirect to after successful OAuth completion.
2506
+ * Typically set by the Studio UI to return to the agent page.
2507
+ * Defaults to `SlackProviderConfig.redirectPath` or `/`.
2508
+ */
2509
+ redirectUrl?: string;
485
2510
  }
486
2511
  /**
487
2512
  * Slash command configuration (fully serializable).
@@ -490,104 +2515,105 @@ interface SlackConnectOptions {
490
2515
  * and sent to the agent. Like Claude Code's slash commands.
491
2516
  */
492
2517
  interface SlashCommandConfig {
493
- /** Command name including slash (e.g., "/ask") */
494
- command: string;
495
- /** Short description shown in Slack's command picker */
496
- description?: string;
497
- /** Usage hint shown in Slack (e.g., "[question]") */
498
- usageHint?: string;
499
- /**
500
- * Prompt template sent to the agent.
501
- * Use {{text}} as placeholder for user input.
502
- *
503
- * Defaults to "{{text}}" (just passes input directly).
504
- *
505
- * @example
506
- * prompt: 'Summarize the following URL: {{text}}'
507
- * prompt: 'Write {{text}} in TypeScript'
508
- */
509
- prompt?: string;
2518
+ /** Command name including slash (e.g., "/ask") */
2519
+ command: string;
2520
+ /** Short description shown in Slack's command picker */
2521
+ description?: string;
2522
+ /** Usage hint shown in Slack (e.g., "[question]") */
2523
+ usageHint?: string;
2524
+ /**
2525
+ * Prompt template sent to the agent.
2526
+ * Use {{text}} as placeholder for user input.
2527
+ *
2528
+ * Defaults to "{{text}}" (just passes input directly).
2529
+ *
2530
+ * @example
2531
+ * prompt: 'Summarize the following URL: {{text}}'
2532
+ * prompt: 'Write {{text}} in TypeScript'
2533
+ */
2534
+ prompt?: string;
510
2535
  }
511
2536
  interface SlackMessage {
512
- text?: string;
513
- blocks?: SlackBlock[];
514
- response_type?: 'in_channel' | 'ephemeral';
515
- replace_original?: boolean;
516
- delete_original?: boolean;
2537
+ text?: string;
2538
+ blocks?: SlackBlock[];
2539
+ response_type?: 'in_channel' | 'ephemeral';
2540
+ replace_original?: boolean;
2541
+ delete_original?: boolean;
517
2542
  }
518
2543
  interface SlackBlock {
519
- type: string;
520
- [key: string]: unknown;
2544
+ type: string;
2545
+ [key: string]: unknown;
521
2546
  }
522
2547
  /**
523
2548
  * Slack App Manifest for programmatic app creation.
524
2549
  * @see https://api.slack.com/reference/manifests
525
2550
  */
526
2551
  interface SlackAppManifest {
527
- display_information: {
528
- name: string;
529
- description?: string;
530
- background_color?: string;
531
- long_description?: string;
2552
+ display_information: {
2553
+ name: string;
2554
+ description?: string;
2555
+ background_color?: string;
2556
+ long_description?: string;
2557
+ };
2558
+ features?: {
2559
+ app_home?: {
2560
+ home_tab_enabled?: boolean;
2561
+ messages_tab_enabled?: boolean;
2562
+ messages_tab_read_only_enabled?: boolean;
2563
+ };
2564
+ bot_user?: {
2565
+ display_name: string;
2566
+ always_online?: boolean;
532
2567
  };
533
- features?: {
534
- app_home?: {
535
- home_tab_enabled?: boolean;
536
- messages_tab_enabled?: boolean;
537
- messages_tab_read_only_enabled?: boolean;
538
- };
539
- bot_user?: {
540
- display_name: string;
541
- always_online?: boolean;
542
- };
543
- slash_commands?: Array<{
544
- command: string;
545
- description: string;
546
- url: string;
547
- usage_hint?: string;
548
- }>;
549
- assistant_view?: {
550
- assistant_description: string;
551
- suggested_prompts?: Array<{
552
- title: string;
553
- message: string;
554
- }>;
555
- };
2568
+ slash_commands?: Array<{
2569
+ command: string;
2570
+ description: string;
2571
+ url: string;
2572
+ usage_hint?: string;
2573
+ }>;
2574
+ assistant_view?: {
2575
+ assistant_description: string;
2576
+ suggested_prompts?: Array<{
2577
+ title: string;
2578
+ message: string;
2579
+ }>;
556
2580
  };
557
- oauth_config?: {
558
- redirect_urls?: string[];
559
- scopes?: {
560
- bot?: string[];
561
- user?: string[];
562
- };
2581
+ };
2582
+ oauth_config?: {
2583
+ redirect_urls?: string[];
2584
+ scopes?: {
2585
+ bot?: string[];
2586
+ user?: string[];
563
2587
  };
564
- settings?: {
565
- event_subscriptions?: {
566
- request_url?: string;
567
- bot_events?: string[];
568
- user_events?: string[];
569
- };
570
- interactivity?: {
571
- is_enabled?: boolean;
572
- request_url?: string;
573
- message_menu_options_url?: string;
574
- };
575
- org_deploy_enabled?: boolean;
576
- socket_mode_enabled?: boolean;
577
- token_rotation_enabled?: boolean;
2588
+ };
2589
+ settings?: {
2590
+ event_subscriptions?: {
2591
+ request_url?: string;
2592
+ bot_events?: string[];
2593
+ user_events?: string[];
578
2594
  };
2595
+ interactivity?: {
2596
+ is_enabled?: boolean;
2597
+ request_url?: string;
2598
+ message_menu_options_url?: string;
2599
+ };
2600
+ org_deploy_enabled?: boolean;
2601
+ socket_mode_enabled?: boolean;
2602
+ token_rotation_enabled?: boolean;
2603
+ };
579
2604
  }
580
2605
  /**
581
2606
  * Credentials returned when creating a Slack app via manifest API.
582
2607
  */
583
2608
  interface SlackAppCredentials {
584
- appId: string;
585
- clientId: string;
586
- clientSecret: string;
587
- signingSecret: string;
588
- oauthAuthorizeUrl?: string;
2609
+ appId: string;
2610
+ clientId: string;
2611
+ clientSecret: string;
2612
+ signingSecret: string;
2613
+ oauthAuthorizeUrl?: string;
589
2614
  }
590
-
2615
+ //#endregion
2616
+ //#region src/provider.d.ts
591
2617
  /**
592
2618
  * Slack channel integration for Mastra.
593
2619
  *
@@ -626,195 +2652,198 @@ interface SlackAppCredentials {
626
2652
  * ```
627
2653
  */
628
2654
  declare class SlackProvider implements ChannelProvider {
629
- #private;
630
- readonly id = "slack";
631
- constructor(config?: SlackProviderConfig);
632
- /**
633
- * Provide or clear Slack App Configuration credentials at runtime.
634
- *
635
- * Use this when credentials aren't available at construction time — for example,
636
- * when they're entered through the Editor UI or loaded from a vault.
637
- *
638
- * Pass `null` to clear credentials and delete stored tokens.
639
- *
640
- * @example
641
- * ```ts
642
- * const slack = new SlackProvider();
643
- * // Provide credentials (persists to storage immediately):
644
- * await slack.configure({ refreshToken: 'xoxe-1-...' });
645
- * // Clear credentials and stored tokens:
646
- * await slack.configure(null);
647
- * ```
648
- */
649
- configure(credentials: {
650
- refreshToken: string;
651
- token?: string;
652
- } | null): Promise<void>;
653
- /**
654
- * Called by Mastra when this channel is registered.
655
- * @internal
656
- */
657
- __attach(mastra: Mastra): void;
658
- /**
659
- * Set the base URL for webhook callbacks.
660
- * Only needed if not using Mastra server config.
661
- */
662
- setBaseUrl(baseUrl: string): void;
663
- /**
664
- * Restore active Slack installations from storage.
665
- *
666
- * For each active installation in the database, this creates a SlackAdapter
667
- * and injects AgentChannels into the corresponding Agent so it can receive
668
- * Slack events immediately on startup.
669
- *
670
- * Does NOT auto-provision new apps. Use `connect(agentId, options)` to
671
- * create a new Slack app for an agent.
672
- */
673
- initialize(): Promise<void>;
674
- /**
675
- * Get API routes for the Mastra server.
676
- * Add these to your Mastra config via `server.apiRoutes`.
677
- *
678
- * The mastra instance is automatically injected via createHandler.
679
- * On first request, auto-initializes any agents with slack configs.
680
- */
681
- getRoutes(): ApiRoute[];
682
- /**
683
- * Connect an agent to Slack by creating a new Slack app.
684
- *
685
- * @returns OAuth connect result with authorization URL for user redirect
686
- */
687
- connect(agentId: string, options?: SlackConnectOptions): Promise<ChannelConnectResult>;
688
- /**
689
- * Connect to Slack by creating a new Slack app for an arbitrary connection id
690
- * (no registered agent required — e.g. an AgentController or custom owner).
691
- * Since there is no agent to derive a display name from, `name` is required.
692
- *
693
- * @returns OAuth connect result with authorization URL for user redirect
694
- */
695
- connect(options: SlackConnectOptions & {
696
- id: string;
697
- name: string;
698
- }): Promise<ChannelConnectResult>;
699
- /**
700
- * Disconnect an agent from Slack by deleting its app.
701
- */
702
- disconnect(agentId: string): Promise<void>;
703
- /**
704
- * Get the Slack installation for an agent.
705
- */
706
- getInstallation(agentId: string): Promise<SlackInstallation | null>;
707
- /**
708
- * List all Slack installations (public info only).
709
- * Includes both active and pending installations.
710
- */
711
- listInstallations(): Promise<ChannelInstallationInfo[]>;
712
- /**
713
- * Discovery metadata for the editor UI.
714
- */
715
- getInfo(): ChannelPlatformInfo;
716
- /**
717
- * Check if the provider has credentials and can create/manage Slack apps.
718
- * Returns false if no refresh token has been provided via constructor, `configure()`, or storage.
719
- */
720
- isConfigured(): boolean;
721
- /**
722
- * Get the SlackAdapter for an installation.
723
- * Used internally for message formatting and posting.
724
- */
725
- getAdapter(installationId: string): SlackAdapter | undefined;
726
- }
727
-
2655
+ #private;
2656
+ readonly id = "slack";
2657
+ constructor(config?: SlackProviderConfig);
2658
+ /**
2659
+ * Provide or clear Slack App Configuration credentials at runtime.
2660
+ *
2661
+ * Use this when credentials aren't available at construction time — for example,
2662
+ * when they're entered through the Editor UI or loaded from a vault.
2663
+ *
2664
+ * Pass `null` to clear credentials and delete stored tokens.
2665
+ *
2666
+ * @example
2667
+ * ```ts
2668
+ * const slack = new SlackProvider();
2669
+ * // Provide credentials (persists to storage immediately):
2670
+ * await slack.configure({ refreshToken: 'xoxe-1-...' });
2671
+ * // Clear credentials and stored tokens:
2672
+ * await slack.configure(null);
2673
+ * ```
2674
+ */
2675
+ configure(credentials: {
2676
+ refreshToken: string;
2677
+ token?: string;
2678
+ } | null): Promise<void>;
2679
+ /**
2680
+ * Called by Mastra when this channel is registered.
2681
+ * @internal
2682
+ */
2683
+ __attach(mastra: Mastra): void;
2684
+ /**
2685
+ * Set the base URL for webhook callbacks.
2686
+ * Only needed if not using Mastra server config.
2687
+ */
2688
+ setBaseUrl(baseUrl: string): void;
2689
+ /**
2690
+ * Restore active Slack installations from storage.
2691
+ *
2692
+ * For each active installation in the database, this creates a SlackAdapter
2693
+ * and injects AgentChannels into the corresponding Agent so it can receive
2694
+ * Slack events immediately on startup.
2695
+ *
2696
+ * Does NOT auto-provision new apps. Use `connect(agentId, options)` to
2697
+ * create a new Slack app for an agent.
2698
+ */
2699
+ initialize(): Promise<void>;
2700
+ /**
2701
+ * Get API routes for the Mastra server.
2702
+ * Add these to your Mastra config via `server.apiRoutes`.
2703
+ *
2704
+ * The mastra instance is automatically injected via createHandler.
2705
+ * On first request, auto-initializes any agents with slack configs.
2706
+ */
2707
+ getRoutes(): ApiRoute[];
2708
+ /**
2709
+ * Connect an agent to Slack by creating a new Slack app.
2710
+ *
2711
+ * @returns OAuth connect result with authorization URL for user redirect
2712
+ */
2713
+ connect(agentId: string, options?: SlackConnectOptions): Promise<ChannelConnectResult>;
2714
+ /**
2715
+ * Connect to Slack by creating a new Slack app for an arbitrary connection id
2716
+ * (no registered agent required — e.g. an AgentController or custom owner).
2717
+ * Since there is no agent to derive a display name from, `name` is required.
2718
+ *
2719
+ * @returns OAuth connect result with authorization URL for user redirect
2720
+ */
2721
+ connect(options: SlackConnectOptions & {
2722
+ id: string;
2723
+ name: string;
2724
+ }): Promise<ChannelConnectResult>;
2725
+ /**
2726
+ * Disconnect an agent from Slack by deleting its app.
2727
+ */
2728
+ disconnect(agentId: string): Promise<void>;
2729
+ /**
2730
+ * Get the Slack installation for an agent.
2731
+ */
2732
+ getInstallation(agentId: string): Promise<SlackInstallation | null>;
2733
+ /**
2734
+ * List all Slack installations (public info only).
2735
+ * Includes both active and pending installations.
2736
+ */
2737
+ listInstallations(): Promise<ChannelInstallationInfo[]>;
2738
+ /**
2739
+ * Discovery metadata for the editor UI.
2740
+ */
2741
+ getInfo(): ChannelPlatformInfo;
2742
+ /**
2743
+ * Check if the provider has credentials and can create/manage Slack apps.
2744
+ * Returns false if no refresh token has been provided via constructor, `configure()`, or storage.
2745
+ */
2746
+ isConfigured(): boolean;
2747
+ /**
2748
+ * Get the SlackAdapter for an installation.
2749
+ * Used internally for message formatting and posting.
2750
+ */
2751
+ getAdapter(installationId: string): SlackAdapter$1 | undefined;
2752
+ }
2753
+ //#endregion
2754
+ //#region src/client.d.ts
728
2755
  interface SlackManifestClientConfig {
2756
+ token: string;
2757
+ refreshToken: string;
2758
+ onTokenRotation?: (tokens: {
729
2759
  token: string;
730
2760
  refreshToken: string;
731
- onTokenRotation?: (tokens: {
732
- token: string;
733
- refreshToken: string;
734
- }) => Promise<void>;
2761
+ }) => Promise<void>;
735
2762
  }
736
2763
  /**
737
2764
  * Client for Slack's App Manifest API.
738
2765
  * Handles programmatic app creation, deletion, and token rotation.
739
2766
  */
740
2767
  declare class SlackManifestClient {
741
- #private;
742
- constructor(config: SlackManifestClientConfig);
743
- /**
744
- * Get current tokens (after potential rotation).
745
- */
746
- getTokens(): {
747
- token: string;
748
- refreshToken: string;
749
- };
750
- /**
751
- * Update tokens (e.g., from storage on startup).
752
- */
753
- setTokens(tokens: {
754
- token: string;
755
- refreshToken: string;
756
- }): void;
757
- /**
758
- * Rotate the configuration tokens.
759
- * Slack config access tokens expire after 12 hours; the refresh token is single-use
760
- * and each rotation returns a new access token + refresh token pair.
761
- *
762
- * Concurrent callers share the same in-flight rotation to avoid burning
763
- * single-use refresh tokens.
764
- */
765
- rotateToken(): Promise<void>;
766
- /**
767
- * Create a new Slack app from a manifest.
768
- */
769
- createApp(manifest: SlackAppManifest): Promise<SlackAppCredentials>;
770
- /**
771
- * Delete a Slack app.
772
- */
773
- deleteApp(appId: string): Promise<void>;
774
- /**
775
- * Check whether a Slack app still exists.
776
- *
777
- * Uses the read-only `apps.manifest.export` endpoint as an existence probe.
778
- * Returns `false` when Slack reports the app is missing/inaccessible
779
- * (e.g. it was deleted from the Slack admin UI), `true` when it exports
780
- * successfully. Network/transport errors are re-thrown so callers can
781
- * distinguish "app is gone" from "couldn't reach Slack".
782
- */
783
- appExists(appId: string): Promise<boolean>;
784
- /**
785
- * Update an existing Slack app's manifest.
786
- */
787
- updateApp(appId: string, manifest: SlackAppManifest): Promise<void>;
788
- /**
789
- * Set the app icon via undocumented apps.icon.set API.
790
- */
791
- setAppIcon(appId: string, imageData: ArrayBuffer): Promise<void>;
792
- }
793
-
2768
+ #private;
2769
+ constructor(config: SlackManifestClientConfig);
2770
+ /**
2771
+ * Get current tokens (after potential rotation).
2772
+ */
2773
+ getTokens(): {
2774
+ token: string;
2775
+ refreshToken: string;
2776
+ };
2777
+ /**
2778
+ * Update tokens (e.g., from storage on startup).
2779
+ */
2780
+ setTokens(tokens: {
2781
+ token: string;
2782
+ refreshToken: string;
2783
+ }): void;
2784
+ /**
2785
+ * Rotate the configuration tokens.
2786
+ * Slack config access tokens expire after 12 hours; the refresh token is single-use
2787
+ * and each rotation returns a new access token + refresh token pair.
2788
+ *
2789
+ * Concurrent callers share the same in-flight rotation to avoid burning
2790
+ * single-use refresh tokens.
2791
+ */
2792
+ rotateToken(): Promise<void>;
2793
+ /**
2794
+ * Create a new Slack app from a manifest.
2795
+ */
2796
+ createApp(manifest: SlackAppManifest): Promise<SlackAppCredentials>;
2797
+ /**
2798
+ * Delete a Slack app.
2799
+ */
2800
+ deleteApp(appId: string): Promise<void>;
2801
+ /**
2802
+ * Check whether a Slack app still exists.
2803
+ *
2804
+ * Uses the read-only `apps.manifest.export` endpoint as an existence probe.
2805
+ * Returns `false` when Slack reports the app is missing/inaccessible
2806
+ * (e.g. it was deleted from the Slack admin UI), `true` when it exports
2807
+ * successfully. Network/transport errors are re-thrown so callers can
2808
+ * distinguish "app is gone" from "couldn't reach Slack".
2809
+ */
2810
+ appExists(appId: string): Promise<boolean>;
2811
+ /**
2812
+ * Update an existing Slack app's manifest.
2813
+ */
2814
+ updateApp(appId: string, manifest: SlackAppManifest): Promise<void>;
2815
+ /**
2816
+ * Set the app icon via undocumented apps.icon.set API.
2817
+ */
2818
+ setAppIcon(appId: string, imageData: ArrayBuffer): Promise<void>;
2819
+ }
2820
+ //#endregion
2821
+ //#region src/crypto.d.ts
794
2822
  /**
795
2823
  * Verify a Slack request signature.
796
2824
  * @see https://api.slack.com/authentication/verifying-requests-from-slack
797
2825
  */
798
2826
  declare function verifySlackRequest(params: {
799
- signingSecret: string;
800
- timestamp: string;
801
- body: string;
802
- signature: string;
2827
+ signingSecret: string;
2828
+ timestamp: string;
2829
+ body: string;
2830
+ signature: string;
803
2831
  }): boolean;
804
2832
  /**
805
2833
  * Parse URL-encoded form body from Slack slash commands.
806
2834
  * Uses URLSearchParams which correctly handles `+` as space.
807
2835
  */
808
2836
  declare function parseSlackFormBody(body: string): Record<string, string>;
809
-
2837
+ //#endregion
2838
+ //#region src/manifest.d.ts
810
2839
  /**
811
2840
  * Slash command for manifest building.
812
2841
  * Simplified version of SlashCommandConfig for manifest generation.
813
2842
  */
814
2843
  interface SlashCommand {
815
- command: string;
816
- description?: string;
817
- usageHint?: string;
2844
+ command: string;
2845
+ description?: string;
2846
+ usageHint?: string;
818
2847
  }
819
2848
  /**
820
2849
  * Default bot scopes required for agent functionality.
@@ -825,22 +2854,23 @@ declare const DEFAULT_BOT_SCOPES: readonly ["chat:write", "chat:write.public", "
825
2854
  */
826
2855
  declare const DEFAULT_BOT_EVENTS: readonly ["app_mention", "message.channels", "message.groups", "message.im", "message.mpim"];
827
2856
  interface BuildManifestOptions {
828
- /** Display name for the Slack app */
829
- name: string;
830
- /** Description shown in Slack */
831
- description?: string;
832
- /** URL for event webhooks */
833
- webhookUrl: string;
834
- /** URL for OAuth redirect */
835
- oauthRedirectUrl: string;
836
- /** URL for slash command webhooks (defaults to webhookUrl) */
837
- commandsUrl?: string;
838
- /** Slash commands to register */
839
- slashCommands?: SlashCommand[];
2857
+ /** Display name for the Slack app */
2858
+ name: string;
2859
+ /** Description shown in Slack */
2860
+ description?: string;
2861
+ /** URL for event webhooks */
2862
+ webhookUrl: string;
2863
+ /** URL for OAuth redirect */
2864
+ oauthRedirectUrl: string;
2865
+ /** URL for slash command webhooks (defaults to webhookUrl) */
2866
+ commandsUrl?: string;
2867
+ /** Slash commands to register */
2868
+ slashCommands?: SlashCommand[];
840
2869
  }
841
2870
  /**
842
2871
  * Build a Slack app manifest for an agent.
843
2872
  */
844
2873
  declare function buildManifest(options: BuildManifestOptions): SlackAppManifest;
845
-
846
- 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 };
2874
+ //#endregion
2875
+ 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 };
2876
+ //# sourceMappingURL=index.d.cts.map