open-tag 0.0.1 → 0.0.2
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/LICENSE +201 -0
- package/README.md +78 -0
- package/THIRD_PARTY_NOTICES +358 -0
- package/dist/cli/index.d.mts +1 -0
- package/dist/cli/index.mjs +39 -0
- package/dist/cli/index.mjs.map +1 -0
- package/dist/index.d.mts +4661 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -0
- package/dist/program-enU8tS6o.mjs +44170 -0
- package/dist/program-enU8tS6o.mjs.map +1 -0
- package/package.json +55 -8
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,4661 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema.d.cts
|
|
2
|
+
type _JSONSchema = boolean | JSONSchema;
|
|
3
|
+
type SchemaType = "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
|
|
4
|
+
type JSONSchema = {
|
|
5
|
+
[k: string]: unknown;
|
|
6
|
+
$schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
|
|
7
|
+
$id?: string;
|
|
8
|
+
$anchor?: string;
|
|
9
|
+
$ref?: string;
|
|
10
|
+
$dynamicRef?: string;
|
|
11
|
+
$dynamicAnchor?: string;
|
|
12
|
+
$vocabulary?: Record<string, boolean>;
|
|
13
|
+
$comment?: string;
|
|
14
|
+
$defs?: Record<string, JSONSchema>;
|
|
15
|
+
type?: SchemaType | SchemaType[];
|
|
16
|
+
additionalItems?: _JSONSchema;
|
|
17
|
+
unevaluatedItems?: _JSONSchema;
|
|
18
|
+
prefixItems?: _JSONSchema[];
|
|
19
|
+
items?: _JSONSchema | _JSONSchema[];
|
|
20
|
+
contains?: _JSONSchema;
|
|
21
|
+
additionalProperties?: _JSONSchema;
|
|
22
|
+
unevaluatedProperties?: _JSONSchema;
|
|
23
|
+
properties?: Record<string, _JSONSchema>;
|
|
24
|
+
patternProperties?: Record<string, _JSONSchema>;
|
|
25
|
+
dependentSchemas?: Record<string, _JSONSchema>;
|
|
26
|
+
propertyNames?: _JSONSchema;
|
|
27
|
+
if?: _JSONSchema;
|
|
28
|
+
then?: _JSONSchema;
|
|
29
|
+
else?: _JSONSchema;
|
|
30
|
+
allOf?: JSONSchema[];
|
|
31
|
+
anyOf?: JSONSchema[];
|
|
32
|
+
oneOf?: JSONSchema[];
|
|
33
|
+
not?: _JSONSchema;
|
|
34
|
+
multipleOf?: number;
|
|
35
|
+
maximum?: number;
|
|
36
|
+
exclusiveMaximum?: number | boolean;
|
|
37
|
+
minimum?: number;
|
|
38
|
+
exclusiveMinimum?: number | boolean;
|
|
39
|
+
maxLength?: number;
|
|
40
|
+
minLength?: number;
|
|
41
|
+
pattern?: string;
|
|
42
|
+
maxItems?: number;
|
|
43
|
+
minItems?: number;
|
|
44
|
+
uniqueItems?: boolean;
|
|
45
|
+
maxContains?: number;
|
|
46
|
+
minContains?: number;
|
|
47
|
+
maxProperties?: number;
|
|
48
|
+
minProperties?: number;
|
|
49
|
+
required?: string[];
|
|
50
|
+
dependentRequired?: Record<string, string[]>;
|
|
51
|
+
enum?: Array<string | number | boolean | null>;
|
|
52
|
+
const?: string | number | boolean | null;
|
|
53
|
+
id?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
default?: unknown;
|
|
57
|
+
deprecated?: boolean;
|
|
58
|
+
readOnly?: boolean;
|
|
59
|
+
writeOnly?: boolean;
|
|
60
|
+
nullable?: boolean;
|
|
61
|
+
examples?: unknown[];
|
|
62
|
+
format?: string;
|
|
63
|
+
contentMediaType?: string;
|
|
64
|
+
contentEncoding?: string;
|
|
65
|
+
contentSchema?: JSONSchema;
|
|
66
|
+
_prefault?: unknown;
|
|
67
|
+
};
|
|
68
|
+
type BaseSchema = JSONSchema;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/standard-schema.d.cts
|
|
71
|
+
/** The Standard interface. */
|
|
72
|
+
interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
73
|
+
/** The Standard properties. */
|
|
74
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
75
|
+
}
|
|
76
|
+
declare namespace StandardTypedV1 {
|
|
77
|
+
/** The Standard properties interface. */
|
|
78
|
+
interface Props<Input = unknown, Output = Input> {
|
|
79
|
+
/** The version number of the standard. */
|
|
80
|
+
readonly version: 1;
|
|
81
|
+
/** The vendor name of the schema library. */
|
|
82
|
+
readonly vendor: string;
|
|
83
|
+
/** Inferred types associated with the schema. */
|
|
84
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
85
|
+
}
|
|
86
|
+
/** The Standard types interface. */
|
|
87
|
+
interface Types<Input = unknown, Output = Input> {
|
|
88
|
+
/** The input type of the schema. */
|
|
89
|
+
readonly input: Input;
|
|
90
|
+
/** The output type of the schema. */
|
|
91
|
+
readonly output: Output;
|
|
92
|
+
}
|
|
93
|
+
/** Infers the input type of a Standard. */
|
|
94
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
95
|
+
/** Infers the output type of a Standard. */
|
|
96
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
97
|
+
}
|
|
98
|
+
/** The Standard Schema interface. */
|
|
99
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
100
|
+
/** The Standard Schema properties. */
|
|
101
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
102
|
+
}
|
|
103
|
+
declare namespace StandardSchemaV1 {
|
|
104
|
+
/** The Standard Schema properties interface. */
|
|
105
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
106
|
+
/** Validates unknown input values. */
|
|
107
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
108
|
+
}
|
|
109
|
+
/** The result interface of the validate function. */
|
|
110
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
111
|
+
/** The result interface if validation succeeds. */
|
|
112
|
+
interface SuccessResult<Output> {
|
|
113
|
+
/** The typed output value. */
|
|
114
|
+
readonly value: Output;
|
|
115
|
+
/** The absence of issues indicates success. */
|
|
116
|
+
readonly issues?: undefined;
|
|
117
|
+
}
|
|
118
|
+
interface Options {
|
|
119
|
+
/** Implicit support for additional vendor-specific parameters, if needed. */
|
|
120
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
121
|
+
}
|
|
122
|
+
/** The result interface if validation fails. */
|
|
123
|
+
interface FailureResult {
|
|
124
|
+
/** The issues of failed validation. */
|
|
125
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
126
|
+
}
|
|
127
|
+
/** The issue interface of the failure output. */
|
|
128
|
+
interface Issue {
|
|
129
|
+
/** The error message of the issue. */
|
|
130
|
+
readonly message: string;
|
|
131
|
+
/** The path of the issue, if any. */
|
|
132
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
133
|
+
}
|
|
134
|
+
/** The path segment interface of the issue. */
|
|
135
|
+
interface PathSegment {
|
|
136
|
+
/** The key representing a path segment. */
|
|
137
|
+
readonly key: PropertyKey;
|
|
138
|
+
}
|
|
139
|
+
/** The Standard types interface. */
|
|
140
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
141
|
+
/** Infers the input type of a Standard. */
|
|
142
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
143
|
+
/** Infers the output type of a Standard. */
|
|
144
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
145
|
+
}
|
|
146
|
+
/** The Standard JSON Schema interface. */
|
|
147
|
+
interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
148
|
+
/** The Standard JSON Schema properties. */
|
|
149
|
+
readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
|
|
150
|
+
}
|
|
151
|
+
declare namespace StandardJSONSchemaV1 {
|
|
152
|
+
/** The Standard JSON Schema properties interface. */
|
|
153
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
154
|
+
/** Methods for generating the input/output JSON Schema. */
|
|
155
|
+
readonly jsonSchema: Converter;
|
|
156
|
+
}
|
|
157
|
+
/** The Standard JSON Schema converter interface. */
|
|
158
|
+
interface Converter {
|
|
159
|
+
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
|
|
160
|
+
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
161
|
+
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
|
|
162
|
+
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
163
|
+
}
|
|
164
|
+
/** The target version of the generated JSON Schema.
|
|
165
|
+
*
|
|
166
|
+
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
|
|
167
|
+
*
|
|
168
|
+
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
|
|
169
|
+
*
|
|
170
|
+
* All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
|
|
171
|
+
*/
|
|
172
|
+
type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
|
|
173
|
+
/** The options for the input/output methods. */
|
|
174
|
+
interface Options {
|
|
175
|
+
/** 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. */
|
|
176
|
+
readonly target: Target;
|
|
177
|
+
/** Implicit support for additional vendor-specific parameters, if needed. */
|
|
178
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
179
|
+
}
|
|
180
|
+
/** The Standard types interface. */
|
|
181
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
|
|
182
|
+
/** Infers the input type of a Standard. */
|
|
183
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
184
|
+
/** Infers the output type of a Standard. */
|
|
185
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
186
|
+
}
|
|
187
|
+
interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/registries.d.cts
|
|
190
|
+
declare const $output: unique symbol;
|
|
191
|
+
type $output = typeof $output;
|
|
192
|
+
declare const $input: unique symbol;
|
|
193
|
+
type $input = typeof $input;
|
|
194
|
+
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;
|
|
195
|
+
type MetadataType = object | undefined;
|
|
196
|
+
declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
|
|
197
|
+
_meta: Meta;
|
|
198
|
+
_schema: Schema;
|
|
199
|
+
_map: WeakMap<Schema, $replace<Meta, Schema>>;
|
|
200
|
+
_idmap: Map<string, Schema>;
|
|
201
|
+
add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
|
|
202
|
+
clear(): this;
|
|
203
|
+
remove(schema: Schema): this;
|
|
204
|
+
get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
|
|
205
|
+
has(schema: Schema): boolean;
|
|
206
|
+
}
|
|
207
|
+
interface JSONSchemaMeta {
|
|
208
|
+
id?: string | undefined;
|
|
209
|
+
title?: string | undefined;
|
|
210
|
+
description?: string | undefined;
|
|
211
|
+
deprecated?: boolean | undefined;
|
|
212
|
+
[k: string]: unknown;
|
|
213
|
+
}
|
|
214
|
+
interface GlobalMeta extends JSONSchemaMeta {}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.d.cts
|
|
217
|
+
type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
|
|
218
|
+
/**
|
|
219
|
+
* Called for each schema that has no JSON Schema equivalent. Return a JSON Schema to use in its
|
|
220
|
+
* place, `"any"` to fall back to the `unrepresentable: "any"` behavior, or `"throw"`/`undefined` to
|
|
221
|
+
* throw the default error. Throwing from the handler propagates, so custom errors work too.
|
|
222
|
+
*/
|
|
223
|
+
type UnrepresentableHandler<T extends $ZodType = $ZodType> = (ctx: {
|
|
224
|
+
zodSchema: T;
|
|
225
|
+
path: (string | number)[];
|
|
226
|
+
/** The error Zod would throw. Distinguishes sites that share a `zodSchema`, e.g. an `undefined`
|
|
227
|
+
* vs a `bigint` member of the same literal. */
|
|
228
|
+
message: string;
|
|
229
|
+
}) => BaseSchema | "throw" | "any" | undefined;
|
|
230
|
+
interface JSONSchemaGeneratorParams {
|
|
231
|
+
processors: Record<string, Processor>;
|
|
232
|
+
/** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
|
|
233
|
+
* @default globalRegistry */
|
|
234
|
+
metadata?: $ZodRegistry<Record<string, any>>;
|
|
235
|
+
/** The JSON Schema version to target.
|
|
236
|
+
* - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
|
|
237
|
+
* - `"draft-07"` — JSON Schema Draft 7
|
|
238
|
+
* - `"draft-04"` — JSON Schema Draft 4
|
|
239
|
+
* - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
|
|
240
|
+
target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
|
|
241
|
+
/** How to handle unrepresentable types.
|
|
242
|
+
* - `"throw"` — Default. Unrepresentable types throw an error
|
|
243
|
+
* - `"any"` — Unrepresentable types become `{}`
|
|
244
|
+
* - A function — called once per unrepresentable schema; see {@link UnrepresentableHandler}. */
|
|
245
|
+
unrepresentable?: "throw" | "any" | UnrepresentableHandler<$ZodTypes>;
|
|
246
|
+
/** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
|
|
247
|
+
override?: (ctx: {
|
|
248
|
+
zodSchema: $ZodTypes;
|
|
249
|
+
jsonSchema: BaseSchema;
|
|
250
|
+
path: (string | number)[];
|
|
251
|
+
}) => void;
|
|
252
|
+
/** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
|
|
253
|
+
* - `"output"` — Default. Convert the output schema.
|
|
254
|
+
* - `"input"` — Convert the input schema. */
|
|
255
|
+
io?: "input" | "output";
|
|
256
|
+
cycles?: "ref" | "throw";
|
|
257
|
+
reused?: "ref" | "inline";
|
|
258
|
+
external?: {
|
|
259
|
+
registry: $ZodRegistry<{
|
|
260
|
+
id?: string | undefined;
|
|
261
|
+
}>;
|
|
262
|
+
uri?: ((id: string) => string) | undefined;
|
|
263
|
+
defs: Record<string, BaseSchema>;
|
|
264
|
+
} | undefined;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Parameters for the toJSONSchema function.
|
|
268
|
+
*/
|
|
269
|
+
type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
|
|
270
|
+
interface ProcessParams {
|
|
271
|
+
schemaPath: $ZodType[];
|
|
272
|
+
path: (string | number)[];
|
|
273
|
+
}
|
|
274
|
+
interface Seen {
|
|
275
|
+
/** JSON Schema result for this Zod schema */
|
|
276
|
+
schema: BaseSchema;
|
|
277
|
+
/** A cached version of the schema that doesn't get overwritten during ref resolution */
|
|
278
|
+
def?: BaseSchema;
|
|
279
|
+
defId?: string | undefined;
|
|
280
|
+
/** Number of times this schema was encountered during traversal */
|
|
281
|
+
count: number;
|
|
282
|
+
/** Cycle path */
|
|
283
|
+
cycle?: (string | number)[] | undefined;
|
|
284
|
+
isParent?: boolean | undefined;
|
|
285
|
+
/** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
|
|
286
|
+
ref?: $ZodType | null;
|
|
287
|
+
/** JSON Schema property path for this schema */
|
|
288
|
+
path?: (string | number)[] | undefined;
|
|
289
|
+
}
|
|
290
|
+
interface ToJSONSchemaContext {
|
|
291
|
+
processors: Record<string, Processor>;
|
|
292
|
+
metadataRegistry: $ZodRegistry<Record<string, any>>;
|
|
293
|
+
target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
|
|
294
|
+
unrepresentable: "throw" | "any" | UnrepresentableHandler;
|
|
295
|
+
override: (ctx: {
|
|
296
|
+
zodSchema: $ZodType;
|
|
297
|
+
jsonSchema: BaseSchema;
|
|
298
|
+
path: (string | number)[];
|
|
299
|
+
}) => void;
|
|
300
|
+
io: "input" | "output";
|
|
301
|
+
counter: number;
|
|
302
|
+
seen: Map<$ZodType, Seen>;
|
|
303
|
+
/** Registry conversions share one `seen` map across every emitted schema. These hold the
|
|
304
|
+
* `external` the whole-map passes below last ran for, so the passes are not repeated once per
|
|
305
|
+
* schema — and still re-run if the map grows or `external` is swapped. `sharedEmitDoneFor`
|
|
306
|
+
* covers both passes in `finalize`: the ref flattening and the `$defs` build.
|
|
307
|
+
*
|
|
308
|
+
* The passes are valid only while nothing they read has changed, so both are cleared in
|
|
309
|
+
* `process()` when the map grows, and in `JSONSchemaGenerator.emit()`, which can also change
|
|
310
|
+
* the `cycles` and `reused` they branch on.
|
|
311
|
+
*
|
|
312
|
+
* One case is deliberately not covered: an `override` callback that writes to
|
|
313
|
+
* `metadataRegistry` mid-conversion. It runs inside `finalize`, so a registry conversion has
|
|
314
|
+
* nowhere left to clear the guards, and later schemas keep the ids the first pass saw. That
|
|
315
|
+
* output was never coherent — before this, whether a shared subschema was inlined or extracted
|
|
316
|
+
* depended on which registry entry happened to be emitted when the callback fired. */
|
|
317
|
+
sharedDefsExtractedFor?: ToJSONSchemaContext["external"];
|
|
318
|
+
sharedEmitDoneFor?: ToJSONSchemaContext["external"];
|
|
319
|
+
cycles: "ref" | "throw";
|
|
320
|
+
reused: "ref" | "inline";
|
|
321
|
+
/** The `allOf` array of each intersection encountered during traversal, innermost first. `finalize` folds every emitted object holding one; see `foldIntersection`. */
|
|
322
|
+
intersections: BaseSchema[][];
|
|
323
|
+
/** Rewrites a processor deferred to `finalize`, where the flatten has resolved every ref and the union branches are in place. */
|
|
324
|
+
deferred: (() => void)[];
|
|
325
|
+
external?: {
|
|
326
|
+
registry: $ZodRegistry<{
|
|
327
|
+
id?: string | undefined;
|
|
328
|
+
}>;
|
|
329
|
+
uri?: ((id: string) => string) | undefined;
|
|
330
|
+
defs: Record<string, BaseSchema>;
|
|
331
|
+
} | undefined;
|
|
332
|
+
}
|
|
333
|
+
type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
|
|
334
|
+
interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
|
|
335
|
+
"~standard": ZodStandardSchemaWithJSON$1<T>;
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/util.d.cts
|
|
339
|
+
type JWTAlgorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "EdDSA" | (string & {});
|
|
340
|
+
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 & {});
|
|
341
|
+
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
342
|
+
type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
343
|
+
type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
|
|
344
|
+
type NoUndefined<T> = T extends undefined ? never : T;
|
|
345
|
+
type LoosePartial<T extends object> = InexactPartial<T> & {
|
|
346
|
+
[k: string]: unknown;
|
|
347
|
+
};
|
|
348
|
+
type Mask<Keys extends PropertyKey> = { [K in Keys]?: true; };
|
|
349
|
+
type Writeable<T> = { -readonly [P in keyof T]: T[P]; } & {};
|
|
350
|
+
type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined; };
|
|
351
|
+
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
352
|
+
readonly [Symbol.toStringTag]: string;
|
|
353
|
+
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
354
|
+
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>;
|
|
355
|
+
type SomeObject = Record<PropertyKey, any>;
|
|
356
|
+
type Identity<T> = T;
|
|
357
|
+
type Flatten<T> = Identity<{ [k in keyof T]: T[k]; }>;
|
|
358
|
+
type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
359
|
+
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]; }>;
|
|
360
|
+
type TupleItems = ReadonlyArray<SomeType>;
|
|
361
|
+
type AnyFunc = (...args: any[]) => any;
|
|
362
|
+
type MaybeAsync<T> = T | Promise<T>;
|
|
363
|
+
type EnumValue = string | number;
|
|
364
|
+
type EnumLike = Readonly<Record<string, EnumValue>>;
|
|
365
|
+
type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k; }>;
|
|
366
|
+
type Literal = string | number | bigint | boolean | null | undefined;
|
|
367
|
+
type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
368
|
+
type HasLength = {
|
|
369
|
+
length: number;
|
|
370
|
+
};
|
|
371
|
+
type Numeric = number | bigint | Date;
|
|
372
|
+
type PropValues = Record<string, Set<Primitive>>;
|
|
373
|
+
type PrimitiveSet = Set<Primitive>;
|
|
374
|
+
type EmptyToNever<T> = keyof T extends never ? never : T;
|
|
375
|
+
declare abstract class Class {
|
|
376
|
+
constructor(..._args: any[]);
|
|
377
|
+
}
|
|
378
|
+
/** A trait's prototype members: a partial view of its own interface, with `this` typed as the instance. */
|
|
379
|
+
type ProtoOf<T> = { [K in keyof T]?: (T[K] extends ((...args: infer A) => infer R) ? (...args: A) => R : T[K]) | undefined; } & ThisType<T>;
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/versions.d.cts
|
|
382
|
+
declare const version: {
|
|
383
|
+
readonly major: 4;
|
|
384
|
+
readonly minor: 5;
|
|
385
|
+
readonly patch: number;
|
|
386
|
+
};
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/schemas.d.cts
|
|
389
|
+
interface ParseContext<T extends $ZodIssueBase = never> {
|
|
390
|
+
/** Customize error messages. */
|
|
391
|
+
readonly error?: $ZodErrorMap<T>;
|
|
392
|
+
/** Include the `input` field in issue objects. Default `false`. */
|
|
393
|
+
readonly reportInput?: boolean;
|
|
394
|
+
/** Skip eval-based fast path. Default `false`. */
|
|
395
|
+
readonly jitless?: boolean;
|
|
396
|
+
}
|
|
397
|
+
/** @internal */
|
|
398
|
+
interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
|
|
399
|
+
readonly async?: boolean | undefined;
|
|
400
|
+
readonly direction?: "forward" | "backward";
|
|
401
|
+
readonly skipChecks?: boolean;
|
|
402
|
+
}
|
|
403
|
+
interface ParsePayload<T = unknown> {
|
|
404
|
+
value: T;
|
|
405
|
+
issues: $ZodRawIssue[];
|
|
406
|
+
/** A way to mark a whole payload as aborted. Used in codecs/pipes. */
|
|
407
|
+
aborted?: boolean;
|
|
408
|
+
/** @internal Set when the value came from a repeat visit to a node still being
|
|
409
|
+
* parsed. Its checks run on the node itself, against the finished value. */
|
|
410
|
+
memo?: boolean | undefined;
|
|
411
|
+
}
|
|
412
|
+
type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
|
|
413
|
+
interface $ZodTypeDef {
|
|
414
|
+
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";
|
|
415
|
+
error?: $ZodErrorMap<never> | undefined;
|
|
416
|
+
checks?: $ZodCheck<never>[];
|
|
417
|
+
}
|
|
418
|
+
interface _$ZodTypeInternals {
|
|
419
|
+
/** The `@zod/core` version of this schema */
|
|
420
|
+
version: typeof version;
|
|
421
|
+
/** Schema definition. */
|
|
422
|
+
def: $ZodTypeDef;
|
|
423
|
+
/** @internal Randomly generated ID for this schema. */
|
|
424
|
+
/** @internal List of deferred initializers. */
|
|
425
|
+
deferred: AnyFunc[] | undefined;
|
|
426
|
+
/** @internal Parses input and runs all checks (refinements). */
|
|
427
|
+
run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
428
|
+
/** @internal Parses input, doesn't run checks. */
|
|
429
|
+
parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
|
|
430
|
+
/** @internal Stores identifiers for the set of traits implemented by this schema. */
|
|
431
|
+
traits: Set<string>;
|
|
432
|
+
/** @internal Indicates that a schema output type should be considered optional inside objects.
|
|
433
|
+
* @default Required
|
|
434
|
+
*/
|
|
435
|
+
/** @internal Three rungs, each strictly stronger than the last:
|
|
436
|
+
* undefined — required; the container may not omit this slot
|
|
437
|
+
* "optional" — the container may omit it; nothing is supplied in its place
|
|
438
|
+
* "defaulted" — the container may omit it AND this schema substitutes a value
|
|
439
|
+
* Consumers asking "may the slot be absent?" test `!== undefined`.
|
|
440
|
+
* $ZodOptional asks the stronger question and tests `=== "defaulted"`. */
|
|
441
|
+
optin?: "optional" | "defaulted" | undefined;
|
|
442
|
+
/** @internal */
|
|
443
|
+
optout?: "optional" | undefined;
|
|
444
|
+
/** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
|
|
445
|
+
*
|
|
446
|
+
* Defined on: enum, const, literal, null, undefined
|
|
447
|
+
* Passthrough: optional, nullable, branded, default, catch, pipe
|
|
448
|
+
* Todo: unions?
|
|
449
|
+
*/
|
|
450
|
+
values?: PrimitiveSet | undefined;
|
|
451
|
+
/** Default value bubbled up from */
|
|
452
|
+
/** @internal A set of literal discriminators used for the fast path in discriminated unions. */
|
|
453
|
+
propValues?: PropValues | undefined;
|
|
454
|
+
/** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
|
|
455
|
+
pattern: RegExp | undefined;
|
|
456
|
+
/** @internal The constructor function of this schema. */
|
|
457
|
+
constr: new (def: any) => $ZodType;
|
|
458
|
+
/** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
|
|
459
|
+
bag: Record<string, unknown>;
|
|
460
|
+
/** @internal The set of issues this schema might throw during type checking. */
|
|
461
|
+
isst: $ZodIssueBase;
|
|
462
|
+
/** @internal Subject to change, not a public API. */
|
|
463
|
+
processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
|
|
464
|
+
/** An optional method used to override `toJSONSchema` logic. */
|
|
465
|
+
toJSONSchema?: () => unknown;
|
|
466
|
+
/** @internal The parent of this schema. Only set during certain clone operations. */
|
|
467
|
+
parent?: $ZodType | undefined;
|
|
468
|
+
}
|
|
469
|
+
/** @internal */
|
|
470
|
+
interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
|
|
471
|
+
/** @internal The inferred output type */
|
|
472
|
+
output: O;
|
|
473
|
+
/** @internal The inferred input type */
|
|
474
|
+
input: I;
|
|
475
|
+
}
|
|
476
|
+
type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
|
|
477
|
+
type SomeType = {
|
|
478
|
+
_zod: _$ZodTypeInternals;
|
|
479
|
+
};
|
|
480
|
+
interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
|
|
481
|
+
_zod: Internals;
|
|
482
|
+
"~standard": $ZodStandardSchema<this>;
|
|
483
|
+
}
|
|
484
|
+
interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
|
|
485
|
+
declare const $ZodType: $constructor<$ZodType>;
|
|
486
|
+
interface $ZodStringDef extends $ZodTypeDef {
|
|
487
|
+
type: "string";
|
|
488
|
+
coerce?: boolean;
|
|
489
|
+
checks?: $ZodCheck<string>[];
|
|
490
|
+
}
|
|
491
|
+
interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
|
|
492
|
+
def: $ZodStringDef;
|
|
493
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
494
|
+
pattern: RegExp;
|
|
495
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
496
|
+
isst: $ZodIssueInvalidType;
|
|
497
|
+
bag: LoosePartial<{
|
|
498
|
+
minimum: number;
|
|
499
|
+
maximum: number;
|
|
500
|
+
patterns: Set<RegExp>;
|
|
501
|
+
format: string;
|
|
502
|
+
contentEncoding: string;
|
|
503
|
+
/** the pattern admits strings its `format` keyword forbids, so `toJSONSchema` must not emit it */
|
|
504
|
+
laxFormat: boolean;
|
|
505
|
+
}>;
|
|
506
|
+
}
|
|
507
|
+
interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
|
|
508
|
+
declare const $ZodString: $constructor<$ZodString>;
|
|
509
|
+
interface $ZodStringFormatDef<Format extends string = string> extends $ZodStringDef, $ZodCheckStringFormatDef<Format> {}
|
|
510
|
+
interface $ZodStringFormatInternals<Format extends string = string> extends $ZodStringInternals<string>, $ZodCheckStringFormatInternals {
|
|
511
|
+
def: $ZodStringFormatDef<Format>;
|
|
512
|
+
}
|
|
513
|
+
interface $ZodStringFormat<Format extends string = string> extends $ZodType {
|
|
514
|
+
_zod: $ZodStringFormatInternals<Format>;
|
|
515
|
+
}
|
|
516
|
+
declare const $ZodStringFormat: $constructor<$ZodStringFormat>;
|
|
517
|
+
interface $ZodGUIDInternals extends $ZodStringFormatInternals<"guid"> {}
|
|
518
|
+
interface $ZodGUID extends $ZodType {
|
|
519
|
+
_zod: $ZodGUIDInternals;
|
|
520
|
+
}
|
|
521
|
+
declare const $ZodGUID: $constructor<$ZodGUID>;
|
|
522
|
+
interface $ZodUUIDDef extends $ZodStringFormatDef<"uuid"> {
|
|
523
|
+
version?: "v1" | "v2" | "v3" | "v4" | "v5" | "v6" | "v7" | "v8";
|
|
524
|
+
}
|
|
525
|
+
interface $ZodUUIDInternals extends $ZodStringFormatInternals<"uuid"> {
|
|
526
|
+
def: $ZodUUIDDef;
|
|
527
|
+
}
|
|
528
|
+
interface $ZodUUID extends $ZodType {
|
|
529
|
+
_zod: $ZodUUIDInternals;
|
|
530
|
+
}
|
|
531
|
+
declare const $ZodUUID: $constructor<$ZodUUID>;
|
|
532
|
+
interface $ZodEmailInternals extends $ZodStringFormatInternals<"email"> {}
|
|
533
|
+
interface $ZodEmail extends $ZodType {
|
|
534
|
+
_zod: $ZodEmailInternals;
|
|
535
|
+
}
|
|
536
|
+
declare const $ZodEmail: $constructor<$ZodEmail>;
|
|
537
|
+
interface $ZodURLDef extends $ZodStringFormatDef<"url"> {
|
|
538
|
+
hostname?: RegExp | undefined;
|
|
539
|
+
protocol?: RegExp | undefined;
|
|
540
|
+
normalize?: boolean | undefined;
|
|
541
|
+
}
|
|
542
|
+
interface $ZodURLInternals extends $ZodStringFormatInternals<"url"> {
|
|
543
|
+
def: $ZodURLDef;
|
|
544
|
+
}
|
|
545
|
+
interface $ZodURL extends $ZodType {
|
|
546
|
+
_zod: $ZodURLInternals;
|
|
547
|
+
}
|
|
548
|
+
declare const $ZodURL: $constructor<$ZodURL>;
|
|
549
|
+
interface $ZodEmojiInternals extends $ZodStringFormatInternals<"emoji"> {}
|
|
550
|
+
interface $ZodEmoji extends $ZodType {
|
|
551
|
+
_zod: $ZodEmojiInternals;
|
|
552
|
+
}
|
|
553
|
+
declare const $ZodEmoji: $constructor<$ZodEmoji>;
|
|
554
|
+
interface $ZodNanoIDDef extends $ZodStringFormatDef<"nanoid"> {
|
|
555
|
+
length?: number | undefined;
|
|
556
|
+
}
|
|
557
|
+
interface $ZodNanoIDInternals extends $ZodStringFormatInternals<"nanoid"> {
|
|
558
|
+
def: $ZodNanoIDDef;
|
|
559
|
+
}
|
|
560
|
+
interface $ZodNanoID extends $ZodType {
|
|
561
|
+
_zod: $ZodNanoIDInternals;
|
|
562
|
+
}
|
|
563
|
+
declare const $ZodNanoID: $constructor<$ZodNanoID>;
|
|
564
|
+
/**
|
|
565
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
566
|
+
* (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
|
|
567
|
+
* See https://github.com/paralleldrive/cuid.
|
|
568
|
+
*/
|
|
569
|
+
interface $ZodCUIDInternals extends $ZodStringFormatInternals<"cuid"> {}
|
|
570
|
+
/**
|
|
571
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
572
|
+
* (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
|
|
573
|
+
* See https://github.com/paralleldrive/cuid.
|
|
574
|
+
*/
|
|
575
|
+
interface $ZodCUID extends $ZodType {
|
|
576
|
+
_zod: $ZodCUIDInternals;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
580
|
+
* (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
|
|
581
|
+
* See https://github.com/paralleldrive/cuid.
|
|
582
|
+
*/
|
|
583
|
+
declare const $ZodCUID: $constructor<$ZodCUID>;
|
|
584
|
+
interface $ZodCUID2Internals extends $ZodStringFormatInternals<"cuid2"> {}
|
|
585
|
+
interface $ZodCUID2 extends $ZodType {
|
|
586
|
+
_zod: $ZodCUID2Internals;
|
|
587
|
+
}
|
|
588
|
+
declare const $ZodCUID2: $constructor<$ZodCUID2>;
|
|
589
|
+
interface $ZodULIDInternals extends $ZodStringFormatInternals<"ulid"> {}
|
|
590
|
+
interface $ZodULID extends $ZodType {
|
|
591
|
+
_zod: $ZodULIDInternals;
|
|
592
|
+
}
|
|
593
|
+
declare const $ZodULID: $constructor<$ZodULID>;
|
|
594
|
+
interface $ZodXIDInternals extends $ZodStringFormatInternals<"xid"> {}
|
|
595
|
+
interface $ZodXID extends $ZodType {
|
|
596
|
+
_zod: $ZodXIDInternals;
|
|
597
|
+
}
|
|
598
|
+
declare const $ZodXID: $constructor<$ZodXID>;
|
|
599
|
+
interface $ZodKSUIDInternals extends $ZodStringFormatInternals<"ksuid"> {}
|
|
600
|
+
interface $ZodKSUID extends $ZodType {
|
|
601
|
+
_zod: $ZodKSUIDInternals;
|
|
602
|
+
}
|
|
603
|
+
declare const $ZodKSUID: $constructor<$ZodKSUID>;
|
|
604
|
+
interface $ZodISODateTimeDef extends $ZodStringFormatDef<"datetime"> {
|
|
605
|
+
precision: number | null;
|
|
606
|
+
offset: boolean;
|
|
607
|
+
local: boolean;
|
|
608
|
+
}
|
|
609
|
+
interface $ZodISODateTimeInternals extends $ZodStringFormatInternals {
|
|
610
|
+
def: $ZodISODateTimeDef;
|
|
611
|
+
}
|
|
612
|
+
interface $ZodISODateTime extends $ZodType {
|
|
613
|
+
_zod: $ZodISODateTimeInternals;
|
|
614
|
+
}
|
|
615
|
+
declare const $ZodISODateTime: $constructor<$ZodISODateTime>;
|
|
616
|
+
interface $ZodISODateInternals extends $ZodStringFormatInternals<"date"> {}
|
|
617
|
+
interface $ZodISODate extends $ZodType {
|
|
618
|
+
_zod: $ZodISODateInternals;
|
|
619
|
+
}
|
|
620
|
+
declare const $ZodISODate: $constructor<$ZodISODate>;
|
|
621
|
+
interface $ZodISOTimeDef extends $ZodStringFormatDef<"time"> {
|
|
622
|
+
precision?: number | null;
|
|
623
|
+
}
|
|
624
|
+
interface $ZodISOTimeInternals extends $ZodStringFormatInternals<"time"> {
|
|
625
|
+
def: $ZodISOTimeDef;
|
|
626
|
+
}
|
|
627
|
+
interface $ZodISOTime extends $ZodType {
|
|
628
|
+
_zod: $ZodISOTimeInternals;
|
|
629
|
+
}
|
|
630
|
+
declare const $ZodISOTime: $constructor<$ZodISOTime>;
|
|
631
|
+
interface $ZodISODurationInternals extends $ZodStringFormatInternals<"duration"> {}
|
|
632
|
+
interface $ZodISODuration extends $ZodType {
|
|
633
|
+
_zod: $ZodISODurationInternals;
|
|
634
|
+
}
|
|
635
|
+
declare const $ZodISODuration: $constructor<$ZodISODuration>;
|
|
636
|
+
interface $ZodIPv4Def extends $ZodStringFormatDef<"ipv4"> {
|
|
637
|
+
version?: "v4";
|
|
638
|
+
}
|
|
639
|
+
interface $ZodIPv4Internals extends $ZodStringFormatInternals<"ipv4"> {
|
|
640
|
+
def: $ZodIPv4Def;
|
|
641
|
+
}
|
|
642
|
+
interface $ZodIPv4 extends $ZodType {
|
|
643
|
+
_zod: $ZodIPv4Internals;
|
|
644
|
+
}
|
|
645
|
+
declare const $ZodIPv4: $constructor<$ZodIPv4>;
|
|
646
|
+
interface $ZodIPv6Def extends $ZodStringFormatDef<"ipv6"> {
|
|
647
|
+
version?: "v6";
|
|
648
|
+
}
|
|
649
|
+
interface $ZodIPv6Internals extends $ZodStringFormatInternals<"ipv6"> {
|
|
650
|
+
def: $ZodIPv6Def;
|
|
651
|
+
}
|
|
652
|
+
interface $ZodIPv6 extends $ZodType {
|
|
653
|
+
_zod: $ZodIPv6Internals;
|
|
654
|
+
}
|
|
655
|
+
declare const $ZodIPv6: $constructor<$ZodIPv6>;
|
|
656
|
+
interface $ZodCIDRv4Def extends $ZodStringFormatDef<"cidrv4"> {
|
|
657
|
+
version?: "v4";
|
|
658
|
+
}
|
|
659
|
+
interface $ZodCIDRv4Internals extends $ZodStringFormatInternals<"cidrv4"> {
|
|
660
|
+
def: $ZodCIDRv4Def;
|
|
661
|
+
}
|
|
662
|
+
interface $ZodCIDRv4 extends $ZodType {
|
|
663
|
+
_zod: $ZodCIDRv4Internals;
|
|
664
|
+
}
|
|
665
|
+
declare const $ZodCIDRv4: $constructor<$ZodCIDRv4>;
|
|
666
|
+
interface $ZodCIDRv6Def extends $ZodStringFormatDef<"cidrv6"> {
|
|
667
|
+
version?: "v6";
|
|
668
|
+
}
|
|
669
|
+
interface $ZodCIDRv6Internals extends $ZodStringFormatInternals<"cidrv6"> {
|
|
670
|
+
def: $ZodCIDRv6Def;
|
|
671
|
+
}
|
|
672
|
+
interface $ZodCIDRv6 extends $ZodType {
|
|
673
|
+
_zod: $ZodCIDRv6Internals;
|
|
674
|
+
}
|
|
675
|
+
declare const $ZodCIDRv6: $constructor<$ZodCIDRv6>;
|
|
676
|
+
interface $ZodBase64Internals extends $ZodStringFormatInternals<"base64"> {}
|
|
677
|
+
interface $ZodBase64 extends $ZodType {
|
|
678
|
+
_zod: $ZodBase64Internals;
|
|
679
|
+
}
|
|
680
|
+
declare const $ZodBase64: $constructor<$ZodBase64>;
|
|
681
|
+
interface $ZodBase64URLInternals extends $ZodStringFormatInternals<"base64url"> {}
|
|
682
|
+
interface $ZodBase64URL extends $ZodType {
|
|
683
|
+
_zod: $ZodBase64URLInternals;
|
|
684
|
+
}
|
|
685
|
+
declare const $ZodBase64URL: $constructor<$ZodBase64URL>;
|
|
686
|
+
interface $ZodE164Internals extends $ZodStringFormatInternals<"e164"> {}
|
|
687
|
+
interface $ZodE164 extends $ZodType {
|
|
688
|
+
_zod: $ZodE164Internals;
|
|
689
|
+
}
|
|
690
|
+
declare const $ZodE164: $constructor<$ZodE164>;
|
|
691
|
+
interface $ZodJWTDef extends $ZodStringFormatDef<"jwt"> {
|
|
692
|
+
alg?: JWTAlgorithm | undefined;
|
|
693
|
+
}
|
|
694
|
+
interface $ZodJWTInternals extends $ZodStringFormatInternals<"jwt"> {
|
|
695
|
+
def: $ZodJWTDef;
|
|
696
|
+
}
|
|
697
|
+
interface $ZodJWT extends $ZodType {
|
|
698
|
+
_zod: $ZodJWTInternals;
|
|
699
|
+
}
|
|
700
|
+
declare const $ZodJWT: $constructor<$ZodJWT>;
|
|
701
|
+
interface $ZodNumberDef extends $ZodTypeDef {
|
|
702
|
+
type: "number";
|
|
703
|
+
coerce?: boolean;
|
|
704
|
+
}
|
|
705
|
+
interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
|
|
706
|
+
def: $ZodNumberDef;
|
|
707
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
708
|
+
pattern: RegExp;
|
|
709
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
710
|
+
isst: $ZodIssueInvalidType;
|
|
711
|
+
bag: LoosePartial<{
|
|
712
|
+
minimum: number;
|
|
713
|
+
maximum: number;
|
|
714
|
+
exclusiveMinimum: number;
|
|
715
|
+
exclusiveMaximum: number;
|
|
716
|
+
format: string;
|
|
717
|
+
pattern: RegExp;
|
|
718
|
+
}>;
|
|
719
|
+
}
|
|
720
|
+
interface $ZodNumber<Input = unknown> extends $ZodType {
|
|
721
|
+
_zod: $ZodNumberInternals<Input>;
|
|
722
|
+
}
|
|
723
|
+
declare const $ZodNumber: $constructor<$ZodNumber>;
|
|
724
|
+
interface $ZodBooleanDef extends $ZodTypeDef {
|
|
725
|
+
type: "boolean";
|
|
726
|
+
coerce?: boolean;
|
|
727
|
+
checks?: $ZodCheck<boolean>[];
|
|
728
|
+
}
|
|
729
|
+
interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
|
|
730
|
+
pattern: RegExp;
|
|
731
|
+
def: $ZodBooleanDef;
|
|
732
|
+
isst: $ZodIssueInvalidType;
|
|
733
|
+
}
|
|
734
|
+
interface $ZodBoolean<T = unknown> extends $ZodType {
|
|
735
|
+
_zod: $ZodBooleanInternals<T>;
|
|
736
|
+
}
|
|
737
|
+
declare const $ZodBoolean: $constructor<$ZodBoolean>;
|
|
738
|
+
interface $ZodBigIntDef extends $ZodTypeDef {
|
|
739
|
+
type: "bigint";
|
|
740
|
+
coerce?: boolean;
|
|
741
|
+
}
|
|
742
|
+
interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
|
|
743
|
+
pattern: RegExp;
|
|
744
|
+
/** @internal Internal API, use with caution */
|
|
745
|
+
def: $ZodBigIntDef;
|
|
746
|
+
isst: $ZodIssueInvalidType;
|
|
747
|
+
bag: LoosePartial<{
|
|
748
|
+
minimum: bigint;
|
|
749
|
+
maximum: bigint;
|
|
750
|
+
format: string;
|
|
751
|
+
}>;
|
|
752
|
+
}
|
|
753
|
+
interface $ZodBigInt<T = unknown> extends $ZodType {
|
|
754
|
+
_zod: $ZodBigIntInternals<T>;
|
|
755
|
+
}
|
|
756
|
+
declare const $ZodBigInt: $constructor<$ZodBigInt>;
|
|
757
|
+
interface $ZodSymbolDef extends $ZodTypeDef {
|
|
758
|
+
type: "symbol";
|
|
759
|
+
}
|
|
760
|
+
interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
|
|
761
|
+
def: $ZodSymbolDef;
|
|
762
|
+
isst: $ZodIssueInvalidType;
|
|
763
|
+
}
|
|
764
|
+
interface $ZodSymbol extends $ZodType {
|
|
765
|
+
_zod: $ZodSymbolInternals;
|
|
766
|
+
}
|
|
767
|
+
declare const $ZodSymbol: $constructor<$ZodSymbol>;
|
|
768
|
+
interface $ZodUndefinedDef extends $ZodTypeDef {
|
|
769
|
+
type: "undefined";
|
|
770
|
+
}
|
|
771
|
+
interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
|
|
772
|
+
pattern: RegExp;
|
|
773
|
+
def: $ZodUndefinedDef;
|
|
774
|
+
values: PrimitiveSet;
|
|
775
|
+
isst: $ZodIssueInvalidType;
|
|
776
|
+
}
|
|
777
|
+
interface $ZodUndefined extends $ZodType {
|
|
778
|
+
_zod: $ZodUndefinedInternals;
|
|
779
|
+
}
|
|
780
|
+
declare const $ZodUndefined: $constructor<$ZodUndefined>;
|
|
781
|
+
interface $ZodNullDef extends $ZodTypeDef {
|
|
782
|
+
type: "null";
|
|
783
|
+
}
|
|
784
|
+
interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
|
|
785
|
+
pattern: RegExp;
|
|
786
|
+
def: $ZodNullDef;
|
|
787
|
+
values: PrimitiveSet;
|
|
788
|
+
isst: $ZodIssueInvalidType;
|
|
789
|
+
}
|
|
790
|
+
interface $ZodNull extends $ZodType {
|
|
791
|
+
_zod: $ZodNullInternals;
|
|
792
|
+
}
|
|
793
|
+
declare const $ZodNull: $constructor<$ZodNull>;
|
|
794
|
+
interface $ZodAnyDef extends $ZodTypeDef {
|
|
795
|
+
type: "any";
|
|
796
|
+
}
|
|
797
|
+
interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
|
|
798
|
+
def: $ZodAnyDef;
|
|
799
|
+
isst: never;
|
|
800
|
+
}
|
|
801
|
+
interface $ZodAny extends $ZodType {
|
|
802
|
+
_zod: $ZodAnyInternals;
|
|
803
|
+
}
|
|
804
|
+
declare const $ZodAny: $constructor<$ZodAny>;
|
|
805
|
+
interface $ZodUnknownDef extends $ZodTypeDef {
|
|
806
|
+
type: "unknown";
|
|
807
|
+
}
|
|
808
|
+
interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
|
|
809
|
+
def: $ZodUnknownDef;
|
|
810
|
+
isst: never;
|
|
811
|
+
}
|
|
812
|
+
interface $ZodUnknown extends $ZodType {
|
|
813
|
+
_zod: $ZodUnknownInternals;
|
|
814
|
+
}
|
|
815
|
+
declare const $ZodUnknown: $constructor<$ZodUnknown>;
|
|
816
|
+
interface $ZodNeverDef extends $ZodTypeDef {
|
|
817
|
+
type: "never";
|
|
818
|
+
}
|
|
819
|
+
interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
|
|
820
|
+
def: $ZodNeverDef;
|
|
821
|
+
isst: $ZodIssueInvalidType;
|
|
822
|
+
}
|
|
823
|
+
interface $ZodNever extends $ZodType {
|
|
824
|
+
_zod: $ZodNeverInternals;
|
|
825
|
+
}
|
|
826
|
+
declare const $ZodNever: $constructor<$ZodNever>;
|
|
827
|
+
interface $ZodVoidDef extends $ZodTypeDef {
|
|
828
|
+
type: "void";
|
|
829
|
+
}
|
|
830
|
+
interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
|
|
831
|
+
def: $ZodVoidDef;
|
|
832
|
+
isst: $ZodIssueInvalidType;
|
|
833
|
+
}
|
|
834
|
+
interface $ZodVoid extends $ZodType {
|
|
835
|
+
_zod: $ZodVoidInternals;
|
|
836
|
+
}
|
|
837
|
+
declare const $ZodVoid: $constructor<$ZodVoid>;
|
|
838
|
+
interface $ZodDateDef extends $ZodTypeDef {
|
|
839
|
+
type: "date";
|
|
840
|
+
coerce?: boolean;
|
|
841
|
+
}
|
|
842
|
+
interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
|
|
843
|
+
def: $ZodDateDef;
|
|
844
|
+
isst: $ZodIssueInvalidType;
|
|
845
|
+
bag: LoosePartial<{
|
|
846
|
+
minimum: Date;
|
|
847
|
+
maximum: Date;
|
|
848
|
+
format: string;
|
|
849
|
+
}>;
|
|
850
|
+
}
|
|
851
|
+
interface $ZodDate<T = unknown> extends $ZodType {
|
|
852
|
+
_zod: $ZodDateInternals<T>;
|
|
853
|
+
}
|
|
854
|
+
declare const $ZodDate: $constructor<$ZodDate>;
|
|
855
|
+
interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
856
|
+
type: "array";
|
|
857
|
+
element: T;
|
|
858
|
+
}
|
|
859
|
+
interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
860
|
+
def: $ZodArrayDef<T>;
|
|
861
|
+
isst: $ZodIssueInvalidType;
|
|
862
|
+
output: output<T>[];
|
|
863
|
+
input: input<T>[];
|
|
864
|
+
}
|
|
865
|
+
interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
|
|
866
|
+
declare const $ZodArray: $constructor<$ZodArray>;
|
|
867
|
+
type OptionalOutSchema = {
|
|
868
|
+
_zod: {
|
|
869
|
+
optout: "optional";
|
|
870
|
+
};
|
|
871
|
+
};
|
|
872
|
+
type OptionalInSchema = {
|
|
873
|
+
_zod: {
|
|
874
|
+
optin: "optional" | "defaulted";
|
|
875
|
+
};
|
|
876
|
+
};
|
|
877
|
+
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>;
|
|
878
|
+
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>;
|
|
879
|
+
type $ZodObjectConfig = {
|
|
880
|
+
out: Record<string, unknown>;
|
|
881
|
+
in: Record<string, unknown>;
|
|
882
|
+
};
|
|
883
|
+
type $loose = {
|
|
884
|
+
out: Record<string, unknown>;
|
|
885
|
+
in: Record<string, unknown>;
|
|
886
|
+
};
|
|
887
|
+
type $strict = {
|
|
888
|
+
out: {};
|
|
889
|
+
in: {};
|
|
890
|
+
};
|
|
891
|
+
type $strip = {
|
|
892
|
+
out: {};
|
|
893
|
+
in: {};
|
|
894
|
+
};
|
|
895
|
+
type $catchall<T extends SomeType> = {
|
|
896
|
+
out: {
|
|
897
|
+
[k: string]: output<T>;
|
|
898
|
+
};
|
|
899
|
+
in: {
|
|
900
|
+
[k: string]: input<T>;
|
|
901
|
+
};
|
|
902
|
+
};
|
|
903
|
+
type $ZodShape = Readonly<{
|
|
904
|
+
[k: string]: $ZodType;
|
|
905
|
+
}>;
|
|
906
|
+
interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
|
|
907
|
+
type: "object";
|
|
908
|
+
shape: Shape;
|
|
909
|
+
catchall?: $ZodType | undefined;
|
|
910
|
+
}
|
|
911
|
+
interface $ZodObjectInternals<
|
|
912
|
+
/** @ts-ignore Cast variance */
|
|
913
|
+
out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
|
|
914
|
+
def: $ZodObjectDef<Shape>;
|
|
915
|
+
config: Config;
|
|
916
|
+
isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
|
|
917
|
+
propValues: PropValues;
|
|
918
|
+
output: $InferObjectOutput<Shape, Config["out"]>;
|
|
919
|
+
input: $InferObjectInput<Shape, Config["in"]>;
|
|
920
|
+
optin?: "optional" | undefined;
|
|
921
|
+
optout?: "optional" | undefined;
|
|
922
|
+
}
|
|
923
|
+
type $ZodLooseShape = Record<string, any>;
|
|
924
|
+
interface $ZodObject<
|
|
925
|
+
/** @ts-ignore Cast variance */
|
|
926
|
+
out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
|
|
927
|
+
declare const $ZodObject: $constructor<$ZodObject>;
|
|
928
|
+
type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
|
|
929
|
+
type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
|
|
930
|
+
interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
|
|
931
|
+
type: "union";
|
|
932
|
+
options: Options;
|
|
933
|
+
inclusive?: boolean;
|
|
934
|
+
}
|
|
935
|
+
type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
|
|
936
|
+
type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
|
|
937
|
+
interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
|
|
938
|
+
def: $ZodUnionDef<T>;
|
|
939
|
+
isst: $ZodIssueInvalidUnion;
|
|
940
|
+
pattern: T[number]["_zod"]["pattern"];
|
|
941
|
+
values: T[number]["_zod"]["values"];
|
|
942
|
+
output: $InferUnionOutput<T[number]>;
|
|
943
|
+
input: $InferUnionInput<T[number]>;
|
|
944
|
+
optin: IsOptionalIn<T[number]> extends false ? "optional" | "defaulted" | undefined : "optional" | "defaulted";
|
|
945
|
+
optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
|
|
946
|
+
}
|
|
947
|
+
interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
|
|
948
|
+
_zod: $ZodUnionInternals<T>;
|
|
949
|
+
}
|
|
950
|
+
declare const $ZodUnion: $constructor<$ZodUnion>;
|
|
951
|
+
interface $ZodDiscriminatedUnionDef<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodUnionDef<Options> {
|
|
952
|
+
discriminator: Disc;
|
|
953
|
+
unionFallback?: boolean;
|
|
954
|
+
}
|
|
955
|
+
interface $ZodDiscriminatedUnionInternals<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodUnionInternals<Options> {
|
|
956
|
+
def: $ZodDiscriminatedUnionDef<Options, Disc>;
|
|
957
|
+
propValues: PropValues;
|
|
958
|
+
bag: LoosePartial<{
|
|
959
|
+
optionsMap: Map<Primitive, $ZodType>;
|
|
960
|
+
}>;
|
|
961
|
+
}
|
|
962
|
+
interface $ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends $ZodType {
|
|
963
|
+
_zod: $ZodDiscriminatedUnionInternals<Options, Disc>;
|
|
964
|
+
}
|
|
965
|
+
declare const $ZodDiscriminatedUnion: $constructor<$ZodDiscriminatedUnion>;
|
|
966
|
+
interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
967
|
+
type: "intersection";
|
|
968
|
+
left: Left;
|
|
969
|
+
right: Right;
|
|
970
|
+
}
|
|
971
|
+
interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
|
|
972
|
+
def: $ZodIntersectionDef<A, B>;
|
|
973
|
+
isst: never;
|
|
974
|
+
optin: A["_zod"]["optin"] | B["_zod"]["optin"];
|
|
975
|
+
optout: A["_zod"]["optout"] | B["_zod"]["optout"];
|
|
976
|
+
output: output<A> & output<B>;
|
|
977
|
+
input: input<A> & input<B>;
|
|
978
|
+
}
|
|
979
|
+
interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
980
|
+
_zod: $ZodIntersectionInternals<A, B>;
|
|
981
|
+
}
|
|
982
|
+
declare const $ZodIntersection: $constructor<$ZodIntersection>;
|
|
983
|
+
interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
|
|
984
|
+
type: "tuple";
|
|
985
|
+
items: T;
|
|
986
|
+
rest: Rest;
|
|
987
|
+
}
|
|
988
|
+
type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input<Rest>[] : [])];
|
|
989
|
+
type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input<T[k]>; };
|
|
990
|
+
type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" | "defaulted" ? [...TupleInputTypeWithOptionals<Prefix>, input<Tail>?] : TupleInputTypeNoOptionals<T> : [];
|
|
991
|
+
type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output<Rest>[] : [])];
|
|
992
|
+
type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output<T[k]>; };
|
|
993
|
+
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> : [];
|
|
994
|
+
interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
|
|
995
|
+
def: $ZodTupleDef<T, Rest>;
|
|
996
|
+
isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
|
|
997
|
+
output: $InferTupleOutputType<T, Rest>;
|
|
998
|
+
input: $InferTupleInputType<T, Rest>;
|
|
999
|
+
}
|
|
1000
|
+
interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
|
|
1001
|
+
_zod: $ZodTupleInternals<T, Rest>;
|
|
1002
|
+
}
|
|
1003
|
+
declare const $ZodTuple: $constructor<$ZodTuple>;
|
|
1004
|
+
type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
|
|
1005
|
+
interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1006
|
+
type: "record";
|
|
1007
|
+
keyType: Key;
|
|
1008
|
+
valueType: Value;
|
|
1009
|
+
/** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
|
|
1010
|
+
mode?: "strict" | "loose";
|
|
1011
|
+
partial?: boolean;
|
|
1012
|
+
}
|
|
1013
|
+
type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
|
|
1014
|
+
type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : [Value] extends [OptionalInSchema] ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : Record<input<Key> & PropertyKey, input<Value>>;
|
|
1015
|
+
interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
|
|
1016
|
+
def: $ZodRecordDef<Key, Value>;
|
|
1017
|
+
isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
|
|
1018
|
+
optin?: "optional" | undefined;
|
|
1019
|
+
optout?: "optional" | undefined;
|
|
1020
|
+
}
|
|
1021
|
+
type $partial = {
|
|
1022
|
+
"~~partial": true;
|
|
1023
|
+
};
|
|
1024
|
+
interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
|
|
1025
|
+
_zod: $ZodRecordInternals<Key, Value>;
|
|
1026
|
+
}
|
|
1027
|
+
declare const $ZodRecord: $constructor<$ZodRecord>;
|
|
1028
|
+
interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1029
|
+
type: "map";
|
|
1030
|
+
keyType: Key;
|
|
1031
|
+
valueType: Value;
|
|
1032
|
+
}
|
|
1033
|
+
interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
|
|
1034
|
+
def: $ZodMapDef<Key, Value>;
|
|
1035
|
+
isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
|
|
1036
|
+
optin?: "optional" | undefined;
|
|
1037
|
+
optout?: "optional" | undefined;
|
|
1038
|
+
}
|
|
1039
|
+
interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
|
|
1040
|
+
_zod: $ZodMapInternals<Key, Value>;
|
|
1041
|
+
}
|
|
1042
|
+
declare const $ZodMap: $constructor<$ZodMap>;
|
|
1043
|
+
interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1044
|
+
type: "set";
|
|
1045
|
+
valueType: T;
|
|
1046
|
+
}
|
|
1047
|
+
interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input<T>>> {
|
|
1048
|
+
def: $ZodSetDef<T>;
|
|
1049
|
+
isst: $ZodIssueInvalidType;
|
|
1050
|
+
optin?: "optional" | undefined;
|
|
1051
|
+
optout?: "optional" | undefined;
|
|
1052
|
+
}
|
|
1053
|
+
interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
|
|
1054
|
+
_zod: $ZodSetInternals<T>;
|
|
1055
|
+
}
|
|
1056
|
+
declare const $ZodSet: $constructor<$ZodSet>;
|
|
1057
|
+
type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
|
|
1058
|
+
type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
|
|
1059
|
+
interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
|
|
1060
|
+
type: "enum";
|
|
1061
|
+
entries: T;
|
|
1062
|
+
}
|
|
1063
|
+
interface $ZodEnumInternals<
|
|
1064
|
+
/** @ts-ignore Cast variance */
|
|
1065
|
+
out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
|
|
1066
|
+
def: $ZodEnumDef<T>;
|
|
1067
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1068
|
+
values: PrimitiveSet;
|
|
1069
|
+
/** @deprecated Internal API, use with caution (not deprecated) */
|
|
1070
|
+
pattern: RegExp;
|
|
1071
|
+
isst: $ZodIssueInvalidValue;
|
|
1072
|
+
}
|
|
1073
|
+
interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
|
|
1074
|
+
_zod: $ZodEnumInternals<T>;
|
|
1075
|
+
}
|
|
1076
|
+
declare const $ZodEnum: $constructor<$ZodEnum>;
|
|
1077
|
+
interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
|
|
1078
|
+
type: "literal";
|
|
1079
|
+
values: T[];
|
|
1080
|
+
}
|
|
1081
|
+
interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
|
|
1082
|
+
def: $ZodLiteralDef<T>;
|
|
1083
|
+
values: Set<T>;
|
|
1084
|
+
pattern: RegExp;
|
|
1085
|
+
isst: $ZodIssueInvalidValue;
|
|
1086
|
+
}
|
|
1087
|
+
interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
|
|
1088
|
+
_zod: $ZodLiteralInternals<T>;
|
|
1089
|
+
}
|
|
1090
|
+
declare const $ZodLiteral: $constructor<$ZodLiteral>;
|
|
1091
|
+
type _File = typeof globalThis extends {
|
|
1092
|
+
File: infer F extends new (...args: any[]) => any;
|
|
1093
|
+
} ? InstanceType<F> : {};
|
|
1094
|
+
/** Do not reference this directly. */
|
|
1095
|
+
interface File extends _File {
|
|
1096
|
+
readonly type: string;
|
|
1097
|
+
readonly size: number;
|
|
1098
|
+
}
|
|
1099
|
+
interface $ZodFileDef extends $ZodTypeDef {
|
|
1100
|
+
type: "file";
|
|
1101
|
+
}
|
|
1102
|
+
interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
|
|
1103
|
+
def: $ZodFileDef;
|
|
1104
|
+
isst: $ZodIssueInvalidType;
|
|
1105
|
+
bag: LoosePartial<{
|
|
1106
|
+
minimum: number;
|
|
1107
|
+
maximum: number;
|
|
1108
|
+
mime: MimeTypes[];
|
|
1109
|
+
}>;
|
|
1110
|
+
}
|
|
1111
|
+
interface $ZodFile extends $ZodType {
|
|
1112
|
+
_zod: $ZodFileInternals;
|
|
1113
|
+
}
|
|
1114
|
+
declare const $ZodFile: $constructor<$ZodFile>;
|
|
1115
|
+
interface $ZodTransformDef extends $ZodTypeDef {
|
|
1116
|
+
type: "transform";
|
|
1117
|
+
transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
|
|
1118
|
+
}
|
|
1119
|
+
interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
|
|
1120
|
+
def: $ZodTransformDef;
|
|
1121
|
+
isst: never;
|
|
1122
|
+
}
|
|
1123
|
+
interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
|
|
1124
|
+
_zod: $ZodTransformInternals<O, I>;
|
|
1125
|
+
}
|
|
1126
|
+
declare const $ZodTransform: $constructor<$ZodTransform>;
|
|
1127
|
+
interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1128
|
+
type: "optional";
|
|
1129
|
+
innerType: T;
|
|
1130
|
+
}
|
|
1131
|
+
interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
|
|
1132
|
+
def: $ZodOptionalDef<T>;
|
|
1133
|
+
optin: "optional" | "defaulted";
|
|
1134
|
+
optout: "optional";
|
|
1135
|
+
isst: never;
|
|
1136
|
+
values: T["_zod"]["values"];
|
|
1137
|
+
pattern: T["_zod"]["pattern"];
|
|
1138
|
+
}
|
|
1139
|
+
interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1140
|
+
_zod: $ZodOptionalInternals<T>;
|
|
1141
|
+
}
|
|
1142
|
+
declare const $ZodOptional: $constructor<$ZodOptional>;
|
|
1143
|
+
interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
|
|
1144
|
+
interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
|
|
1145
|
+
def: $ZodExactOptionalDef<T>;
|
|
1146
|
+
output: output<T>;
|
|
1147
|
+
input: input<T>;
|
|
1148
|
+
}
|
|
1149
|
+
interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1150
|
+
_zod: $ZodExactOptionalInternals<T>;
|
|
1151
|
+
}
|
|
1152
|
+
declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
|
|
1153
|
+
interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1154
|
+
type: "nullable";
|
|
1155
|
+
innerType: T;
|
|
1156
|
+
}
|
|
1157
|
+
interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
|
|
1158
|
+
def: $ZodNullableDef<T>;
|
|
1159
|
+
optin: T["_zod"]["optin"];
|
|
1160
|
+
optout: T["_zod"]["optout"];
|
|
1161
|
+
isst: never;
|
|
1162
|
+
values: T["_zod"]["values"];
|
|
1163
|
+
pattern: T["_zod"]["pattern"];
|
|
1164
|
+
}
|
|
1165
|
+
interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
|
|
1166
|
+
_zod: $ZodNullableInternals<T>;
|
|
1167
|
+
}
|
|
1168
|
+
declare const $ZodNullable: $constructor<$ZodNullable>;
|
|
1169
|
+
interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1170
|
+
type: "default";
|
|
1171
|
+
innerType: T;
|
|
1172
|
+
/** The default value. May be a getter. */
|
|
1173
|
+
defaultValue: NoUndefined<output<T>>;
|
|
1174
|
+
}
|
|
1175
|
+
interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
1176
|
+
def: $ZodDefaultDef<T>;
|
|
1177
|
+
optin: "defaulted";
|
|
1178
|
+
optout?: "optional" | undefined;
|
|
1179
|
+
isst: never;
|
|
1180
|
+
values: T["_zod"]["values"];
|
|
1181
|
+
}
|
|
1182
|
+
interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
1183
|
+
_zod: $ZodDefaultInternals<T>;
|
|
1184
|
+
}
|
|
1185
|
+
declare const $ZodDefault: $constructor<$ZodDefault>;
|
|
1186
|
+
interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1187
|
+
type: "prefault";
|
|
1188
|
+
innerType: T;
|
|
1189
|
+
/** The default value. May be a getter. */
|
|
1190
|
+
defaultValue: input<T>;
|
|
1191
|
+
}
|
|
1192
|
+
interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
|
|
1193
|
+
def: $ZodPrefaultDef<T>;
|
|
1194
|
+
optin: "defaulted";
|
|
1195
|
+
optout?: "optional" | undefined;
|
|
1196
|
+
isst: never;
|
|
1197
|
+
values: T["_zod"]["values"];
|
|
1198
|
+
}
|
|
1199
|
+
interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
|
|
1200
|
+
_zod: $ZodPrefaultInternals<T>;
|
|
1201
|
+
}
|
|
1202
|
+
declare const $ZodPrefault: $constructor<$ZodPrefault>;
|
|
1203
|
+
interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1204
|
+
type: "nonoptional";
|
|
1205
|
+
innerType: T;
|
|
1206
|
+
}
|
|
1207
|
+
interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
|
|
1208
|
+
def: $ZodNonOptionalDef<T>;
|
|
1209
|
+
isst: $ZodIssueInvalidType;
|
|
1210
|
+
values: T["_zod"]["values"];
|
|
1211
|
+
optin: "optional" | undefined;
|
|
1212
|
+
optout: "optional" | undefined;
|
|
1213
|
+
}
|
|
1214
|
+
interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
|
|
1215
|
+
_zod: $ZodNonOptionalInternals<T>;
|
|
1216
|
+
}
|
|
1217
|
+
declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
|
|
1218
|
+
interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1219
|
+
type: "success";
|
|
1220
|
+
innerType: T;
|
|
1221
|
+
}
|
|
1222
|
+
interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input<T>> {
|
|
1223
|
+
def: $ZodSuccessDef<T>;
|
|
1224
|
+
isst: never;
|
|
1225
|
+
optin: T["_zod"]["optin"];
|
|
1226
|
+
optout: "optional" | undefined;
|
|
1227
|
+
}
|
|
1228
|
+
interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
|
|
1229
|
+
_zod: $ZodSuccessInternals<T>;
|
|
1230
|
+
}
|
|
1231
|
+
declare const $ZodSuccess: $constructor<$ZodSuccess>;
|
|
1232
|
+
interface $ZodCatchCtx extends ParsePayload {
|
|
1233
|
+
/** @deprecated Use `ctx.issues` */
|
|
1234
|
+
error: {
|
|
1235
|
+
issues: $ZodIssue[];
|
|
1236
|
+
};
|
|
1237
|
+
/** @deprecated Use `ctx.value` */
|
|
1238
|
+
input: unknown;
|
|
1239
|
+
}
|
|
1240
|
+
interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1241
|
+
type: "catch";
|
|
1242
|
+
innerType: T;
|
|
1243
|
+
catchValue: (ctx: $ZodCatchCtx) => unknown;
|
|
1244
|
+
}
|
|
1245
|
+
interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
|
|
1246
|
+
def: $ZodCatchDef<T>;
|
|
1247
|
+
optin: T["_zod"]["optin"];
|
|
1248
|
+
optout: T["_zod"]["optout"];
|
|
1249
|
+
isst: never;
|
|
1250
|
+
values: T["_zod"]["values"];
|
|
1251
|
+
}
|
|
1252
|
+
interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
|
|
1253
|
+
_zod: $ZodCatchInternals<T>;
|
|
1254
|
+
}
|
|
1255
|
+
declare const $ZodCatch: $constructor<$ZodCatch>;
|
|
1256
|
+
interface $ZodNaNDef extends $ZodTypeDef {
|
|
1257
|
+
type: "nan";
|
|
1258
|
+
}
|
|
1259
|
+
interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
|
|
1260
|
+
def: $ZodNaNDef;
|
|
1261
|
+
isst: $ZodIssueInvalidType;
|
|
1262
|
+
}
|
|
1263
|
+
interface $ZodNaN extends $ZodType {
|
|
1264
|
+
_zod: $ZodNaNInternals;
|
|
1265
|
+
}
|
|
1266
|
+
declare const $ZodNaN: $constructor<$ZodNaN>;
|
|
1267
|
+
interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1268
|
+
type: "pipe";
|
|
1269
|
+
in: A;
|
|
1270
|
+
out: B;
|
|
1271
|
+
/** Only defined inside $ZodCodec instances. */
|
|
1272
|
+
transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input<B>>;
|
|
1273
|
+
/** Only defined inside $ZodCodec instances. */
|
|
1274
|
+
reverseTransform?: (value: input<B>, payload: ParsePayload<input<B>>) => MaybeAsync<output<A>>;
|
|
1275
|
+
}
|
|
1276
|
+
interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
|
|
1277
|
+
def: $ZodPipeDef<A, B>;
|
|
1278
|
+
isst: never;
|
|
1279
|
+
values: A["_zod"]["values"];
|
|
1280
|
+
optin: A["_zod"]["optin"];
|
|
1281
|
+
optout: B["_zod"]["optout"];
|
|
1282
|
+
propValues: A["_zod"]["propValues"];
|
|
1283
|
+
}
|
|
1284
|
+
interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
|
|
1285
|
+
_zod: $ZodPipeInternals<A, B>;
|
|
1286
|
+
}
|
|
1287
|
+
declare const $ZodPipe: $constructor<$ZodPipe>;
|
|
1288
|
+
interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1289
|
+
type: "readonly";
|
|
1290
|
+
innerType: T;
|
|
1291
|
+
}
|
|
1292
|
+
interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
|
|
1293
|
+
def: $ZodReadonlyDef<T>;
|
|
1294
|
+
optin: T["_zod"]["optin"];
|
|
1295
|
+
optout: T["_zod"]["optout"];
|
|
1296
|
+
isst: never;
|
|
1297
|
+
propValues: T["_zod"]["propValues"];
|
|
1298
|
+
values: T["_zod"]["values"];
|
|
1299
|
+
}
|
|
1300
|
+
interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
|
|
1301
|
+
_zod: $ZodReadonlyInternals<T>;
|
|
1302
|
+
}
|
|
1303
|
+
declare const $ZodReadonly: $constructor<$ZodReadonly>;
|
|
1304
|
+
interface $ZodTemplateLiteralDef extends $ZodTypeDef {
|
|
1305
|
+
type: "template_literal";
|
|
1306
|
+
parts: $ZodTemplateLiteralPart[];
|
|
1307
|
+
format?: string | undefined;
|
|
1308
|
+
}
|
|
1309
|
+
interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
|
|
1310
|
+
pattern: RegExp;
|
|
1311
|
+
def: $ZodTemplateLiteralDef;
|
|
1312
|
+
isst: $ZodIssueInvalidType;
|
|
1313
|
+
}
|
|
1314
|
+
interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
|
|
1315
|
+
_zod: $ZodTemplateLiteralInternals<Template>;
|
|
1316
|
+
}
|
|
1317
|
+
type LiteralPart = Exclude<Literal, symbol>;
|
|
1318
|
+
interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
|
|
1319
|
+
pattern: RegExp;
|
|
1320
|
+
}
|
|
1321
|
+
interface SchemaPart extends $ZodType {
|
|
1322
|
+
_zod: SchemaPartInternals;
|
|
1323
|
+
}
|
|
1324
|
+
type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
|
|
1325
|
+
declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
|
|
1326
|
+
type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
|
|
1327
|
+
type $ZodFunctionIn = $ZodFunctionArgs;
|
|
1328
|
+
type $ZodFunctionOut = $ZodType;
|
|
1329
|
+
type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input<Returns>;
|
|
1330
|
+
type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input<Returns>>;
|
|
1331
|
+
type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => output<Returns>;
|
|
1332
|
+
type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => Promise<output<Returns>>;
|
|
1333
|
+
interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
|
|
1334
|
+
type: "function";
|
|
1335
|
+
input: In;
|
|
1336
|
+
output: Out;
|
|
1337
|
+
}
|
|
1338
|
+
interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
|
|
1339
|
+
def: $ZodFunctionDef<Args, Returns>;
|
|
1340
|
+
isst: $ZodIssueInvalidType;
|
|
1341
|
+
}
|
|
1342
|
+
interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
|
|
1343
|
+
/** @deprecated */
|
|
1344
|
+
_def: $ZodFunctionDef<Args, Returns>;
|
|
1345
|
+
_input: $InferInnerFunctionType<Args, Returns>;
|
|
1346
|
+
_output: $InferOuterFunctionType<Args, Returns>;
|
|
1347
|
+
implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
|
|
1348
|
+
implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
|
|
1349
|
+
input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
|
|
1350
|
+
input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
|
|
1351
|
+
input(...args: any[]): $ZodFunction<any, Returns>;
|
|
1352
|
+
output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
|
|
1353
|
+
}
|
|
1354
|
+
declare const $ZodFunction: $constructor<$ZodFunction>;
|
|
1355
|
+
interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1356
|
+
type: "promise";
|
|
1357
|
+
innerType: T;
|
|
1358
|
+
}
|
|
1359
|
+
interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input<T>>> {
|
|
1360
|
+
def: $ZodPromiseDef<T>;
|
|
1361
|
+
isst: never;
|
|
1362
|
+
}
|
|
1363
|
+
interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
|
|
1364
|
+
_zod: $ZodPromiseInternals<T>;
|
|
1365
|
+
}
|
|
1366
|
+
declare const $ZodPromise: $constructor<$ZodPromise>;
|
|
1367
|
+
interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
|
|
1368
|
+
type: "lazy";
|
|
1369
|
+
getter: () => T;
|
|
1370
|
+
}
|
|
1371
|
+
interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
|
|
1372
|
+
def: $ZodLazyDef<T>;
|
|
1373
|
+
isst: never;
|
|
1374
|
+
/** Auto-cached way to retrieve the inner schema */
|
|
1375
|
+
innerType: T;
|
|
1376
|
+
pattern: T["_zod"]["pattern"];
|
|
1377
|
+
propValues: T["_zod"]["propValues"];
|
|
1378
|
+
optin: T["_zod"]["optin"];
|
|
1379
|
+
optout: T["_zod"]["optout"];
|
|
1380
|
+
}
|
|
1381
|
+
interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
|
|
1382
|
+
_zod: $ZodLazyInternals<T>;
|
|
1383
|
+
}
|
|
1384
|
+
declare const $ZodLazy: $constructor<$ZodLazy>;
|
|
1385
|
+
interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
|
|
1386
|
+
type: "custom";
|
|
1387
|
+
check: "custom";
|
|
1388
|
+
path?: PropertyKey[] | undefined;
|
|
1389
|
+
error?: $ZodErrorMap | undefined;
|
|
1390
|
+
params?: Record<string, any> | undefined;
|
|
1391
|
+
fn: (arg: O) => unknown;
|
|
1392
|
+
}
|
|
1393
|
+
interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
|
|
1394
|
+
def: $ZodCustomDef;
|
|
1395
|
+
issc: $ZodIssue;
|
|
1396
|
+
isst: never;
|
|
1397
|
+
bag: LoosePartial<{
|
|
1398
|
+
Class: typeof Class;
|
|
1399
|
+
}>;
|
|
1400
|
+
}
|
|
1401
|
+
interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
|
|
1402
|
+
_zod: $ZodCustomInternals<O, I>;
|
|
1403
|
+
}
|
|
1404
|
+
declare const $ZodCustom: $constructor<$ZodCustom>;
|
|
1405
|
+
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;
|
|
1406
|
+
//#endregion
|
|
1407
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/checks.d.cts
|
|
1408
|
+
interface $ZodCheckDef {
|
|
1409
|
+
check: string;
|
|
1410
|
+
error?: $ZodErrorMap<never> | undefined;
|
|
1411
|
+
/** If true, no later checks will be executed if this check fails. Default `false`. */
|
|
1412
|
+
abort?: boolean | undefined;
|
|
1413
|
+
/** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
|
|
1414
|
+
when?: ((payload: ParsePayload) => boolean) | undefined;
|
|
1415
|
+
}
|
|
1416
|
+
interface $ZodCheckInternals<T> {
|
|
1417
|
+
def: $ZodCheckDef;
|
|
1418
|
+
/** The set of issues this check might throw. */
|
|
1419
|
+
issc?: $ZodIssueBase;
|
|
1420
|
+
check(payload: ParsePayload<T>): MaybeAsync<void>;
|
|
1421
|
+
onattach: ((schema: $ZodType) => void)[];
|
|
1422
|
+
}
|
|
1423
|
+
interface $ZodCheck<in T = never> {
|
|
1424
|
+
_zod: $ZodCheckInternals<T>;
|
|
1425
|
+
}
|
|
1426
|
+
declare const $ZodCheck: $constructor<$ZodCheck<any>>;
|
|
1427
|
+
interface $ZodCheckLessThanDef extends $ZodCheckDef {
|
|
1428
|
+
check: "less_than";
|
|
1429
|
+
value: Numeric;
|
|
1430
|
+
inclusive: boolean;
|
|
1431
|
+
}
|
|
1432
|
+
interface $ZodCheckLessThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
|
|
1433
|
+
def: $ZodCheckLessThanDef;
|
|
1434
|
+
issc: $ZodIssueTooBig<T>;
|
|
1435
|
+
}
|
|
1436
|
+
interface $ZodCheckLessThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
|
|
1437
|
+
_zod: $ZodCheckLessThanInternals<T>;
|
|
1438
|
+
}
|
|
1439
|
+
declare const $ZodCheckLessThan: $constructor<$ZodCheckLessThan>;
|
|
1440
|
+
interface $ZodCheckGreaterThanDef extends $ZodCheckDef {
|
|
1441
|
+
check: "greater_than";
|
|
1442
|
+
value: Numeric;
|
|
1443
|
+
inclusive: boolean;
|
|
1444
|
+
}
|
|
1445
|
+
interface $ZodCheckGreaterThanInternals<T extends Numeric = Numeric> extends $ZodCheckInternals<T> {
|
|
1446
|
+
def: $ZodCheckGreaterThanDef;
|
|
1447
|
+
issc: $ZodIssueTooSmall<T>;
|
|
1448
|
+
}
|
|
1449
|
+
interface $ZodCheckGreaterThan<T extends Numeric = Numeric> extends $ZodCheck<T> {
|
|
1450
|
+
_zod: $ZodCheckGreaterThanInternals<T>;
|
|
1451
|
+
}
|
|
1452
|
+
declare const $ZodCheckGreaterThan: $constructor<$ZodCheckGreaterThan>;
|
|
1453
|
+
interface $ZodCheckMultipleOfDef<T extends number | bigint = number | bigint> extends $ZodCheckDef {
|
|
1454
|
+
check: "multiple_of";
|
|
1455
|
+
value: T;
|
|
1456
|
+
}
|
|
1457
|
+
interface $ZodCheckMultipleOfInternals<T extends number | bigint = number | bigint> extends $ZodCheckInternals<T> {
|
|
1458
|
+
def: $ZodCheckMultipleOfDef<T>;
|
|
1459
|
+
issc: $ZodIssueNotMultipleOf;
|
|
1460
|
+
}
|
|
1461
|
+
interface $ZodCheckMultipleOf<T extends number | bigint = number | bigint> extends $ZodCheck<T> {
|
|
1462
|
+
_zod: $ZodCheckMultipleOfInternals<T>;
|
|
1463
|
+
}
|
|
1464
|
+
declare const $ZodCheckMultipleOf: $constructor<$ZodCheckMultipleOf<number | bigint>>;
|
|
1465
|
+
type $ZodNumberFormats = "int32" | "uint32" | "float32" | "float64" | "safeint";
|
|
1466
|
+
interface $ZodCheckNumberFormatDef<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckDef {
|
|
1467
|
+
check: "number_format";
|
|
1468
|
+
format: Format;
|
|
1469
|
+
}
|
|
1470
|
+
interface $ZodCheckNumberFormatInternals<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheckInternals<number> {
|
|
1471
|
+
def: $ZodCheckNumberFormatDef<Format>;
|
|
1472
|
+
issc: $ZodIssueInvalidType | $ZodIssueTooBig<"number"> | $ZodIssueTooSmall<"number">;
|
|
1473
|
+
}
|
|
1474
|
+
interface $ZodCheckNumberFormat<Format extends $ZodNumberFormats = $ZodNumberFormats> extends $ZodCheck<number> {
|
|
1475
|
+
_zod: $ZodCheckNumberFormatInternals<Format>;
|
|
1476
|
+
}
|
|
1477
|
+
declare const $ZodCheckNumberFormat: $constructor<$ZodCheckNumberFormat>;
|
|
1478
|
+
interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
|
|
1479
|
+
check: "max_length";
|
|
1480
|
+
maximum: number;
|
|
1481
|
+
}
|
|
1482
|
+
interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
1483
|
+
def: $ZodCheckMaxLengthDef;
|
|
1484
|
+
issc: $ZodIssueTooBig<T>;
|
|
1485
|
+
}
|
|
1486
|
+
interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
1487
|
+
_zod: $ZodCheckMaxLengthInternals<T>;
|
|
1488
|
+
}
|
|
1489
|
+
declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
|
|
1490
|
+
interface $ZodCheckMinLengthDef extends $ZodCheckDef {
|
|
1491
|
+
check: "min_length";
|
|
1492
|
+
minimum: number;
|
|
1493
|
+
}
|
|
1494
|
+
interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
1495
|
+
def: $ZodCheckMinLengthDef;
|
|
1496
|
+
issc: $ZodIssueTooSmall<T>;
|
|
1497
|
+
}
|
|
1498
|
+
interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
1499
|
+
_zod: $ZodCheckMinLengthInternals<T>;
|
|
1500
|
+
}
|
|
1501
|
+
declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
|
|
1502
|
+
interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
|
|
1503
|
+
check: "length_equals";
|
|
1504
|
+
length: number;
|
|
1505
|
+
}
|
|
1506
|
+
interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
1507
|
+
def: $ZodCheckLengthEqualsDef;
|
|
1508
|
+
issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
|
|
1509
|
+
}
|
|
1510
|
+
interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
1511
|
+
_zod: $ZodCheckLengthEqualsInternals<T>;
|
|
1512
|
+
}
|
|
1513
|
+
declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
|
|
1514
|
+
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" | "credit_card" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
|
|
1515
|
+
interface $ZodCheckStringFormatDef<Format extends string = string> extends $ZodCheckDef {
|
|
1516
|
+
check: "string_format";
|
|
1517
|
+
format: Format;
|
|
1518
|
+
pattern?: RegExp | undefined;
|
|
1519
|
+
}
|
|
1520
|
+
interface $ZodCheckStringFormatInternals extends $ZodCheckInternals<string> {
|
|
1521
|
+
def: $ZodCheckStringFormatDef;
|
|
1522
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1523
|
+
}
|
|
1524
|
+
interface $ZodCheckRegexDef extends $ZodCheckStringFormatDef {
|
|
1525
|
+
format: "regex";
|
|
1526
|
+
pattern: RegExp;
|
|
1527
|
+
}
|
|
1528
|
+
interface $ZodCheckRegexInternals extends $ZodCheckInternals<string> {
|
|
1529
|
+
def: $ZodCheckRegexDef;
|
|
1530
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1531
|
+
}
|
|
1532
|
+
interface $ZodCheckRegex extends $ZodCheck<string> {
|
|
1533
|
+
_zod: $ZodCheckRegexInternals;
|
|
1534
|
+
}
|
|
1535
|
+
declare const $ZodCheckRegex: $constructor<$ZodCheckRegex>;
|
|
1536
|
+
interface $ZodCheckLowerCaseDef extends $ZodCheckStringFormatDef<"lowercase"> {}
|
|
1537
|
+
interface $ZodCheckLowerCaseInternals extends $ZodCheckInternals<string> {
|
|
1538
|
+
def: $ZodCheckLowerCaseDef;
|
|
1539
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1540
|
+
}
|
|
1541
|
+
interface $ZodCheckLowerCase extends $ZodCheck<string> {
|
|
1542
|
+
_zod: $ZodCheckLowerCaseInternals;
|
|
1543
|
+
}
|
|
1544
|
+
declare const $ZodCheckLowerCase: $constructor<$ZodCheckLowerCase>;
|
|
1545
|
+
interface $ZodCheckUpperCaseDef extends $ZodCheckStringFormatDef<"uppercase"> {}
|
|
1546
|
+
interface $ZodCheckUpperCaseInternals extends $ZodCheckInternals<string> {
|
|
1547
|
+
def: $ZodCheckUpperCaseDef;
|
|
1548
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1549
|
+
}
|
|
1550
|
+
interface $ZodCheckUpperCase extends $ZodCheck<string> {
|
|
1551
|
+
_zod: $ZodCheckUpperCaseInternals;
|
|
1552
|
+
}
|
|
1553
|
+
declare const $ZodCheckUpperCase: $constructor<$ZodCheckUpperCase>;
|
|
1554
|
+
interface $ZodCheckIncludesDef extends $ZodCheckStringFormatDef<"includes"> {
|
|
1555
|
+
includes: string;
|
|
1556
|
+
position?: number | undefined;
|
|
1557
|
+
}
|
|
1558
|
+
interface $ZodCheckIncludesInternals extends $ZodCheckInternals<string> {
|
|
1559
|
+
def: $ZodCheckIncludesDef;
|
|
1560
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1561
|
+
}
|
|
1562
|
+
interface $ZodCheckIncludes extends $ZodCheck<string> {
|
|
1563
|
+
_zod: $ZodCheckIncludesInternals;
|
|
1564
|
+
}
|
|
1565
|
+
declare const $ZodCheckIncludes: $constructor<$ZodCheckIncludes>;
|
|
1566
|
+
interface $ZodCheckStartsWithDef extends $ZodCheckStringFormatDef<"starts_with"> {
|
|
1567
|
+
prefix: string;
|
|
1568
|
+
}
|
|
1569
|
+
interface $ZodCheckStartsWithInternals extends $ZodCheckInternals<string> {
|
|
1570
|
+
def: $ZodCheckStartsWithDef;
|
|
1571
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1572
|
+
}
|
|
1573
|
+
interface $ZodCheckStartsWith extends $ZodCheck<string> {
|
|
1574
|
+
_zod: $ZodCheckStartsWithInternals;
|
|
1575
|
+
}
|
|
1576
|
+
declare const $ZodCheckStartsWith: $constructor<$ZodCheckStartsWith>;
|
|
1577
|
+
interface $ZodCheckEndsWithDef extends $ZodCheckStringFormatDef<"ends_with"> {
|
|
1578
|
+
suffix: string;
|
|
1579
|
+
}
|
|
1580
|
+
interface $ZodCheckEndsWithInternals extends $ZodCheckInternals<string> {
|
|
1581
|
+
def: $ZodCheckEndsWithDef;
|
|
1582
|
+
issc: $ZodIssueInvalidStringFormat;
|
|
1583
|
+
}
|
|
1584
|
+
interface $ZodCheckEndsWith extends $ZodCheckInternals<string> {
|
|
1585
|
+
_zod: $ZodCheckEndsWithInternals;
|
|
1586
|
+
}
|
|
1587
|
+
declare const $ZodCheckEndsWith: $constructor<$ZodCheckEndsWith>;
|
|
1588
|
+
//#endregion
|
|
1589
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/errors.d.cts
|
|
1590
|
+
interface $ZodIssueBase {
|
|
1591
|
+
readonly code?: string;
|
|
1592
|
+
readonly input?: unknown;
|
|
1593
|
+
readonly path: PropertyKey[];
|
|
1594
|
+
readonly message: string;
|
|
1595
|
+
}
|
|
1596
|
+
type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
|
|
1597
|
+
interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
|
|
1598
|
+
readonly code: "invalid_type";
|
|
1599
|
+
readonly expected: $ZodInvalidTypeExpected;
|
|
1600
|
+
readonly input?: Input;
|
|
1601
|
+
}
|
|
1602
|
+
interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
|
|
1603
|
+
readonly code: "too_big";
|
|
1604
|
+
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
1605
|
+
readonly maximum: number | bigint;
|
|
1606
|
+
readonly inclusive?: boolean;
|
|
1607
|
+
readonly exact?: boolean;
|
|
1608
|
+
readonly input?: Input;
|
|
1609
|
+
}
|
|
1610
|
+
interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
|
|
1611
|
+
readonly code: "too_small";
|
|
1612
|
+
readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
|
|
1613
|
+
readonly minimum: number | bigint;
|
|
1614
|
+
/** True if the allowable range includes the minimum */
|
|
1615
|
+
readonly inclusive?: boolean;
|
|
1616
|
+
/** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
|
|
1617
|
+
readonly exact?: boolean;
|
|
1618
|
+
readonly input?: Input;
|
|
1619
|
+
}
|
|
1620
|
+
interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
|
|
1621
|
+
readonly code: "invalid_format";
|
|
1622
|
+
readonly format: $ZodStringFormats | (string & {});
|
|
1623
|
+
readonly pattern?: string;
|
|
1624
|
+
readonly input?: string;
|
|
1625
|
+
}
|
|
1626
|
+
interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
|
|
1627
|
+
readonly code: "not_multiple_of";
|
|
1628
|
+
readonly divisor: number;
|
|
1629
|
+
readonly input?: Input;
|
|
1630
|
+
}
|
|
1631
|
+
interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
|
|
1632
|
+
readonly code: "unrecognized_keys";
|
|
1633
|
+
readonly keys: string[];
|
|
1634
|
+
readonly input?: Record<string, unknown>;
|
|
1635
|
+
}
|
|
1636
|
+
interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
|
|
1637
|
+
readonly code: "invalid_union";
|
|
1638
|
+
readonly errors: $ZodIssue[][];
|
|
1639
|
+
readonly input?: unknown;
|
|
1640
|
+
readonly discriminator?: string | undefined;
|
|
1641
|
+
readonly options?: Primitive[];
|
|
1642
|
+
readonly inclusive?: true;
|
|
1643
|
+
}
|
|
1644
|
+
interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
|
|
1645
|
+
readonly code: "invalid_union";
|
|
1646
|
+
readonly errors: [];
|
|
1647
|
+
readonly input?: unknown;
|
|
1648
|
+
readonly discriminator?: string | undefined;
|
|
1649
|
+
readonly inclusive: false;
|
|
1650
|
+
/** Indices of the options that matched */
|
|
1651
|
+
readonly matches: number[];
|
|
1652
|
+
}
|
|
1653
|
+
type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
|
|
1654
|
+
interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
|
|
1655
|
+
readonly code: "invalid_key";
|
|
1656
|
+
readonly origin: "map" | "record";
|
|
1657
|
+
readonly issues: $ZodIssue[];
|
|
1658
|
+
readonly input?: Input;
|
|
1659
|
+
}
|
|
1660
|
+
interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
|
|
1661
|
+
readonly code: "invalid_element";
|
|
1662
|
+
readonly origin: "map" | "set";
|
|
1663
|
+
readonly key: unknown;
|
|
1664
|
+
readonly issues: $ZodIssue[];
|
|
1665
|
+
readonly input?: Input;
|
|
1666
|
+
}
|
|
1667
|
+
interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
|
|
1668
|
+
readonly code: "invalid_value";
|
|
1669
|
+
readonly values: Primitive[];
|
|
1670
|
+
readonly input?: Input;
|
|
1671
|
+
}
|
|
1672
|
+
interface $ZodIssueCustom extends $ZodIssueBase {
|
|
1673
|
+
readonly code: "custom";
|
|
1674
|
+
readonly params?: Record<string, any> | undefined;
|
|
1675
|
+
readonly input?: unknown;
|
|
1676
|
+
}
|
|
1677
|
+
type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
|
|
1678
|
+
type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
|
|
1679
|
+
type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
1680
|
+
/** The input data */
|
|
1681
|
+
readonly input: unknown;
|
|
1682
|
+
/** The schema or check that originated this issue. */
|
|
1683
|
+
readonly inst?: $ZodType | $ZodCheck;
|
|
1684
|
+
/** The schema that owns the issue. Equal to `inst` when a schema originated the issue, and the schema the check was attached to when a check did. */
|
|
1685
|
+
readonly schema?: $ZodType | undefined;
|
|
1686
|
+
/** If `true`, Zod will continue executing checks/refinements after this issue. */
|
|
1687
|
+
readonly continue?: boolean | undefined;
|
|
1688
|
+
} & Record<string, unknown>> : never;
|
|
1689
|
+
type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
|
|
1690
|
+
interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
|
|
1691
|
+
(issue: $ZodRawIssue<T>): {
|
|
1692
|
+
message: string;
|
|
1693
|
+
} | string | undefined | null;
|
|
1694
|
+
}
|
|
1695
|
+
interface $ZodError<T = unknown> extends Error {
|
|
1696
|
+
type: T;
|
|
1697
|
+
issues: $ZodIssue[];
|
|
1698
|
+
_zod: {
|
|
1699
|
+
output: T;
|
|
1700
|
+
def: $ZodIssue[];
|
|
1701
|
+
};
|
|
1702
|
+
stack?: string;
|
|
1703
|
+
name: string;
|
|
1704
|
+
}
|
|
1705
|
+
declare const $ZodError: $constructor<$ZodError>;
|
|
1706
|
+
type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
|
|
1707
|
+
type _FlattenedError<T, U = string> = {
|
|
1708
|
+
formErrors: U[];
|
|
1709
|
+
fieldErrors: { [P in keyof T]?: U[]; };
|
|
1710
|
+
};
|
|
1711
|
+
type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U>; } : T extends any[] ? {
|
|
1712
|
+
[k: number]: $ZodFormattedError<T[number], U>;
|
|
1713
|
+
} : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U>; }> : any;
|
|
1714
|
+
type $ZodFormattedError<T, U = string> = {
|
|
1715
|
+
_errors: U[];
|
|
1716
|
+
} & Flatten<_ZodFormattedError<T, U>>;
|
|
1717
|
+
//#endregion
|
|
1718
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/core.d.cts
|
|
1719
|
+
type ZodTrait = {
|
|
1720
|
+
_zod: {
|
|
1721
|
+
def: any;
|
|
1722
|
+
[k: string]: any;
|
|
1723
|
+
};
|
|
1724
|
+
};
|
|
1725
|
+
interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
|
|
1726
|
+
new (def: D): T;
|
|
1727
|
+
init(inst: T, def: D): asserts inst is T;
|
|
1728
|
+
}
|
|
1729
|
+
interface $constructorParams {
|
|
1730
|
+
Parent?: typeof Class;
|
|
1731
|
+
}
|
|
1732
|
+
declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void,
|
|
1733
|
+
/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */
|
|
1734
|
+
proto?: ProtoOf<T>, params?: $constructorParams): $constructor<T, D>;
|
|
1735
|
+
declare const $brand: unique symbol;
|
|
1736
|
+
type $brand<T extends string | number | symbol = string | number | symbol> = {
|
|
1737
|
+
[$brand]: { [k in T]: true; };
|
|
1738
|
+
};
|
|
1739
|
+
type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
|
|
1740
|
+
_zod: {
|
|
1741
|
+
input: input<T> & $brand<Brand>;
|
|
1742
|
+
output: output<T> & $brand<Brand>;
|
|
1743
|
+
};
|
|
1744
|
+
} : Dir extends "in" ? {
|
|
1745
|
+
_zod: {
|
|
1746
|
+
input: input<T> & $brand<Brand>;
|
|
1747
|
+
};
|
|
1748
|
+
} : {
|
|
1749
|
+
_zod: {
|
|
1750
|
+
output: output<T> & $brand<Brand>;
|
|
1751
|
+
};
|
|
1752
|
+
});
|
|
1753
|
+
type input<T> = T extends {
|
|
1754
|
+
_zod: {
|
|
1755
|
+
input: any;
|
|
1756
|
+
};
|
|
1757
|
+
} ? T["_zod"]["input"] : unknown;
|
|
1758
|
+
type output<T> = T extends {
|
|
1759
|
+
_zod: {
|
|
1760
|
+
output: any;
|
|
1761
|
+
};
|
|
1762
|
+
} ? T["_zod"]["output"] : unknown;
|
|
1763
|
+
//#endregion
|
|
1764
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/api.d.cts
|
|
1765
|
+
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] ? {} : {
|
|
1766
|
+
error?: string | $ZodErrorMap<IssueTypes> | undefined;
|
|
1767
|
+
/** @deprecated This parameter is deprecated. Use `error` instead. */
|
|
1768
|
+
message?: string | undefined;
|
|
1769
|
+
})>>>;
|
|
1770
|
+
type TypeParams<T extends $ZodType = $ZodType & {
|
|
1771
|
+
_isst: never;
|
|
1772
|
+
}, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
|
|
1773
|
+
type CheckParams<T extends $ZodCheck = $ZodCheck // & { _issc: never },
|
|
1774
|
+
, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
|
|
1775
|
+
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>;
|
|
1776
|
+
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>;
|
|
1777
|
+
type $ZodCheckEmailParams = CheckStringFormatParams<$ZodEmail, "when">;
|
|
1778
|
+
type $ZodCheckGUIDParams = CheckStringFormatParams<$ZodGUID, "pattern" | "when">;
|
|
1779
|
+
type $ZodCheckUUIDParams = CheckStringFormatParams<$ZodUUID, "pattern" | "when">;
|
|
1780
|
+
type $ZodCheckURLParams = CheckStringFormatParams<$ZodURL, "when">;
|
|
1781
|
+
type $ZodCheckEmojiParams = CheckStringFormatParams<$ZodEmoji, "when">;
|
|
1782
|
+
type $ZodCheckNanoIDParams = CheckStringFormatParams<$ZodNanoID, "when" | "pattern">;
|
|
1783
|
+
/**
|
|
1784
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
1785
|
+
* (timestamps embedded in the id). Use {@link _cuid2} instead.
|
|
1786
|
+
* See https://github.com/paralleldrive/cuid.
|
|
1787
|
+
*/
|
|
1788
|
+
type $ZodCheckCUIDParams = CheckStringFormatParams<$ZodCUID, "when">;
|
|
1789
|
+
type $ZodCheckCUID2Params = CheckStringFormatParams<$ZodCUID2, "when">;
|
|
1790
|
+
type $ZodCheckULIDParams = CheckStringFormatParams<$ZodULID, "when">;
|
|
1791
|
+
type $ZodCheckXIDParams = CheckStringFormatParams<$ZodXID, "when">;
|
|
1792
|
+
type $ZodCheckKSUIDParams = CheckStringFormatParams<$ZodKSUID, "when">;
|
|
1793
|
+
type $ZodCheckIPv4Params = CheckStringFormatParams<$ZodIPv4, "pattern" | "when" | "version">;
|
|
1794
|
+
type $ZodCheckIPv6Params = CheckStringFormatParams<$ZodIPv6, "pattern" | "when" | "version">;
|
|
1795
|
+
type $ZodCheckCIDRv4Params = CheckStringFormatParams<$ZodCIDRv4, "pattern" | "when">;
|
|
1796
|
+
type $ZodCheckCIDRv6Params = CheckStringFormatParams<$ZodCIDRv6, "pattern" | "when">;
|
|
1797
|
+
type $ZodCheckBase64Params = CheckStringFormatParams<$ZodBase64, "pattern" | "when">;
|
|
1798
|
+
type $ZodCheckBase64URLParams = CheckStringFormatParams<$ZodBase64URL, "pattern" | "when">;
|
|
1799
|
+
type $ZodCheckE164Params = CheckStringFormatParams<$ZodE164, "when">;
|
|
1800
|
+
type $ZodCheckJWTParams = CheckStringFormatParams<$ZodJWT, "pattern" | "when">;
|
|
1801
|
+
type $ZodCheckISODateTimeParams = CheckStringFormatParams<$ZodISODateTime, "pattern" | "when">;
|
|
1802
|
+
type $ZodCheckISODateParams = CheckStringFormatParams<$ZodISODate, "pattern" | "when">;
|
|
1803
|
+
type $ZodCheckISOTimeParams = CheckStringFormatParams<$ZodISOTime, "pattern" | "when">;
|
|
1804
|
+
type $ZodCheckISODurationParams = CheckStringFormatParams<$ZodISODuration, "when">;
|
|
1805
|
+
type $ZodCheckNumberFormatParams = CheckParams<$ZodCheckNumberFormat, "format" | "when">;
|
|
1806
|
+
type $ZodCheckLessThanParams = CheckParams<$ZodCheckLessThan, "inclusive" | "value" | "when">;
|
|
1807
|
+
type $ZodCheckGreaterThanParams = CheckParams<$ZodCheckGreaterThan, "inclusive" | "value" | "when">;
|
|
1808
|
+
type $ZodCheckMultipleOfParams = CheckParams<$ZodCheckMultipleOf, "value" | "when">;
|
|
1809
|
+
type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
|
|
1810
|
+
type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
|
|
1811
|
+
type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
|
|
1812
|
+
type $ZodCheckRegexParams = CheckParams<$ZodCheckRegex, "format" | "pattern" | "when">;
|
|
1813
|
+
type $ZodCheckLowerCaseParams = CheckParams<$ZodCheckLowerCase, "format" | "when">;
|
|
1814
|
+
type $ZodCheckUpperCaseParams = CheckParams<$ZodCheckUpperCase, "format" | "when">;
|
|
1815
|
+
type $ZodCheckIncludesParams = CheckParams<$ZodCheckIncludes, "includes" | "format" | "when" | "pattern">;
|
|
1816
|
+
type $ZodCheckStartsWithParams = CheckParams<$ZodCheckStartsWith, "prefix" | "format" | "when" | "pattern">;
|
|
1817
|
+
type $ZodCheckEndsWithParams = CheckParams<$ZodCheckEndsWith, "suffix" | "format" | "pattern" | "when">;
|
|
1818
|
+
type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
|
|
1819
|
+
type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
|
|
1820
|
+
type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
|
|
1821
|
+
type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
|
|
1822
|
+
type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
|
|
1823
|
+
/** The schema or check that originated this issue. */
|
|
1824
|
+
readonly inst?: $ZodType | $ZodCheck;
|
|
1825
|
+
/** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
|
|
1826
|
+
readonly continue?: boolean | undefined;
|
|
1827
|
+
} & Record<string, unknown>> : never;
|
|
1828
|
+
interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
|
|
1829
|
+
addIssue(arg: string | $ZodSuperRefineIssue): void;
|
|
1830
|
+
}
|
|
1831
|
+
interface $ZodSuperRefineParams {
|
|
1832
|
+
/** If provided, the refinement runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
|
|
1833
|
+
when?: ((payload: ParsePayload) => boolean) | undefined;
|
|
1834
|
+
}
|
|
1835
|
+
//#endregion
|
|
1836
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/errors.d.cts
|
|
1837
|
+
/** An Error-like class used to store Zod validation issues. */
|
|
1838
|
+
interface ZodError<T = unknown> extends $ZodError<T> {
|
|
1839
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
1840
|
+
format(): $ZodFormattedError<T>;
|
|
1841
|
+
format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
|
|
1842
|
+
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
|
1843
|
+
flatten(): $ZodFlattenedError<T>;
|
|
1844
|
+
flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
|
|
1845
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
1846
|
+
addIssue(issue: $ZodIssue): void;
|
|
1847
|
+
/** @deprecated Push directly to `.issues` instead. */
|
|
1848
|
+
addIssues(issues: $ZodIssue[]): void;
|
|
1849
|
+
/** @deprecated Check `err.issues.length === 0` instead. */
|
|
1850
|
+
isEmpty: boolean;
|
|
1851
|
+
}
|
|
1852
|
+
declare const ZodError: $constructor<ZodError>;
|
|
1853
|
+
//#endregion
|
|
1854
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/parse.d.cts
|
|
1855
|
+
type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
|
|
1856
|
+
type ZodSafeParseSuccess<T> = {
|
|
1857
|
+
success: true;
|
|
1858
|
+
data: T;
|
|
1859
|
+
error?: never;
|
|
1860
|
+
};
|
|
1861
|
+
type ZodSafeParseError<T> = {
|
|
1862
|
+
success: false;
|
|
1863
|
+
data?: never;
|
|
1864
|
+
error: ZodError<T>;
|
|
1865
|
+
};
|
|
1866
|
+
//#endregion
|
|
1867
|
+
//#region ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/schemas.d.cts
|
|
1868
|
+
type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
|
|
1869
|
+
interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
|
|
1870
|
+
def: Internals["def"];
|
|
1871
|
+
type: Internals["def"]["type"];
|
|
1872
|
+
/** @deprecated Use `.def` instead. */
|
|
1873
|
+
_def: Internals["def"];
|
|
1874
|
+
/** @deprecated Use `z.output<typeof schema>` instead. */
|
|
1875
|
+
_output: Internals["output"];
|
|
1876
|
+
/** @deprecated Use `z.input<typeof schema>` instead. */
|
|
1877
|
+
_input: Internals["input"];
|
|
1878
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
1879
|
+
/** Converts this schema to a JSON Schema representation. */
|
|
1880
|
+
toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
|
|
1881
|
+
check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
1882
|
+
with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
|
|
1883
|
+
clone(def?: Internals["def"], params?: {
|
|
1884
|
+
parent: boolean;
|
|
1885
|
+
}): this;
|
|
1886
|
+
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;
|
|
1887
|
+
brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
|
|
1888
|
+
parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
|
|
1889
|
+
safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
1890
|
+
parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
1891
|
+
safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
1892
|
+
spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
|
|
1893
|
+
encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
|
|
1894
|
+
decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
|
|
1895
|
+
encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
|
|
1896
|
+
decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
|
|
1897
|
+
safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
|
|
1898
|
+
safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
|
|
1899
|
+
safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
|
|
1900
|
+
safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
|
|
1901
|
+
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;
|
|
1902
|
+
superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>, params?: $ZodSuperRefineParams): this;
|
|
1903
|
+
overwrite(fn: (x: output<this>) => output<this>): this;
|
|
1904
|
+
optional(): ZodOptional<this>;
|
|
1905
|
+
exactOptional(): ZodExactOptional<this>;
|
|
1906
|
+
nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
|
|
1907
|
+
nullable(): ZodNullable<this>;
|
|
1908
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
1909
|
+
default(def: NoUndefined<output<this>>): ZodDefault<this>;
|
|
1910
|
+
default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
|
|
1911
|
+
prefault(def: () => input<this>): ZodPrefault<this>;
|
|
1912
|
+
prefault(def: input<this>): ZodPrefault<this>;
|
|
1913
|
+
array(): ZodArray<this>;
|
|
1914
|
+
or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
|
|
1915
|
+
and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
|
|
1916
|
+
transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
|
|
1917
|
+
catch(def: output<this>): ZodCatch<this>;
|
|
1918
|
+
catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
|
|
1919
|
+
pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
|
|
1920
|
+
readonly(): ZodReadonly<this>;
|
|
1921
|
+
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
|
|
1922
|
+
describe(description: string): this;
|
|
1923
|
+
description?: string;
|
|
1924
|
+
/** Returns the metadata associated with this instance in `z.globalRegistry` */
|
|
1925
|
+
meta(): $replace<GlobalMeta, this> | undefined;
|
|
1926
|
+
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
|
|
1927
|
+
meta(data: $replace<GlobalMeta, this>): this;
|
|
1928
|
+
/** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
|
|
1929
|
+
*
|
|
1930
|
+
* ```ts
|
|
1931
|
+
* const schema = z.string().optional();
|
|
1932
|
+
* const isOptional = schema.safeParse(undefined).success; // true
|
|
1933
|
+
* ```
|
|
1934
|
+
*/
|
|
1935
|
+
isOptional(): boolean;
|
|
1936
|
+
/**
|
|
1937
|
+
* @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
|
|
1938
|
+
*
|
|
1939
|
+
* ```ts
|
|
1940
|
+
* const schema = z.string().nullable();
|
|
1941
|
+
* const isNullable = schema.safeParse(null).success; // true
|
|
1942
|
+
* ```
|
|
1943
|
+
*/
|
|
1944
|
+
isNullable(): boolean;
|
|
1945
|
+
apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
|
|
1946
|
+
}
|
|
1947
|
+
interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
|
|
1948
|
+
declare const ZodType: $constructor<ZodType>;
|
|
1949
|
+
interface _ZodString<T extends $ZodStringInternals<unknown> = $ZodStringInternals<unknown>> extends _ZodType<T> {
|
|
1950
|
+
format: string | null;
|
|
1951
|
+
minLength: number | null;
|
|
1952
|
+
maxLength: number | null;
|
|
1953
|
+
regex(regex: RegExp, params?: string | $ZodCheckRegexParams): this;
|
|
1954
|
+
includes(value: string, params?: string | $ZodCheckIncludesParams): this;
|
|
1955
|
+
startsWith(value: string, params?: string | $ZodCheckStartsWithParams): this;
|
|
1956
|
+
endsWith(value: string, params?: string | $ZodCheckEndsWithParams): this;
|
|
1957
|
+
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
1958
|
+
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
1959
|
+
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
1960
|
+
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
1961
|
+
lowercase(params?: string | $ZodCheckLowerCaseParams): this;
|
|
1962
|
+
uppercase(params?: string | $ZodCheckUpperCaseParams): this;
|
|
1963
|
+
trim(): this;
|
|
1964
|
+
normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
|
|
1965
|
+
toLowerCase(): this;
|
|
1966
|
+
toUpperCase(): this;
|
|
1967
|
+
slugify(): this;
|
|
1968
|
+
}
|
|
1969
|
+
/** @internal */
|
|
1970
|
+
declare const _ZodString: $constructor<_ZodString>;
|
|
1971
|
+
interface ZodString extends _ZodString<$ZodStringInternals<string>> {
|
|
1972
|
+
/** @deprecated Use `z.email()` instead. */
|
|
1973
|
+
email(params?: string | $ZodCheckEmailParams): this;
|
|
1974
|
+
/** @deprecated Use `z.url()` instead. */
|
|
1975
|
+
url(params?: string | $ZodCheckURLParams): this;
|
|
1976
|
+
/** @deprecated Use `z.jwt()` instead. */
|
|
1977
|
+
jwt(params?: string | $ZodCheckJWTParams): this;
|
|
1978
|
+
/** @deprecated Use `z.emoji()` instead. */
|
|
1979
|
+
emoji(params?: string | $ZodCheckEmojiParams): this;
|
|
1980
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
1981
|
+
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
1982
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
1983
|
+
uuid(params?: string | $ZodCheckUUIDParams): this;
|
|
1984
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
1985
|
+
uuidv4(params?: string | $ZodCheckUUIDParams): this;
|
|
1986
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
1987
|
+
uuidv6(params?: string | $ZodCheckUUIDParams): this;
|
|
1988
|
+
/** @deprecated Use `z.uuid()` instead. */
|
|
1989
|
+
uuidv7(params?: string | $ZodCheckUUIDParams): this;
|
|
1990
|
+
/** @deprecated Use `z.nanoid()` instead. */
|
|
1991
|
+
nanoid(params?: string | $ZodCheckNanoIDParams): this;
|
|
1992
|
+
/** @deprecated Use `z.guid()` instead. */
|
|
1993
|
+
guid(params?: string | $ZodCheckGUIDParams): this;
|
|
1994
|
+
/**
|
|
1995
|
+
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
1996
|
+
* (timestamps embedded in the id). Use `z.cuid2()` instead.
|
|
1997
|
+
* See https://github.com/paralleldrive/cuid.
|
|
1998
|
+
*/
|
|
1999
|
+
cuid(params?: string | $ZodCheckCUIDParams): this;
|
|
2000
|
+
/** @deprecated Use `z.cuid2()` instead. */
|
|
2001
|
+
cuid2(params?: string | $ZodCheckCUID2Params): this;
|
|
2002
|
+
/** @deprecated Use `z.ulid()` instead. */
|
|
2003
|
+
ulid(params?: string | $ZodCheckULIDParams): this;
|
|
2004
|
+
/** @deprecated Use `z.base64()` instead. */
|
|
2005
|
+
base64(params?: string | $ZodCheckBase64Params): this;
|
|
2006
|
+
/** @deprecated Use `z.base64url()` instead. */
|
|
2007
|
+
base64url(params?: string | $ZodCheckBase64URLParams): this;
|
|
2008
|
+
/** @deprecated Use `z.xid()` instead. */
|
|
2009
|
+
xid(params?: string | $ZodCheckXIDParams): this;
|
|
2010
|
+
/** @deprecated Use `z.ksuid()` instead. */
|
|
2011
|
+
ksuid(params?: string | $ZodCheckKSUIDParams): this;
|
|
2012
|
+
/** @deprecated Use `z.ipv4()` instead. */
|
|
2013
|
+
ipv4(params?: string | $ZodCheckIPv4Params): this;
|
|
2014
|
+
/** @deprecated Use `z.ipv6()` instead. */
|
|
2015
|
+
ipv6(params?: string | $ZodCheckIPv6Params): this;
|
|
2016
|
+
/** @deprecated Use `z.cidrv4()` instead. */
|
|
2017
|
+
cidrv4(params?: string | $ZodCheckCIDRv4Params): this;
|
|
2018
|
+
/** @deprecated Use `z.cidrv6()` instead. */
|
|
2019
|
+
cidrv6(params?: string | $ZodCheckCIDRv6Params): this;
|
|
2020
|
+
/** @deprecated Use `z.e164()` instead. */
|
|
2021
|
+
e164(params?: string | $ZodCheckE164Params): this;
|
|
2022
|
+
/** @deprecated Use `z.iso.datetime()` instead. */
|
|
2023
|
+
datetime(params?: string | $ZodCheckISODateTimeParams): this;
|
|
2024
|
+
/** @deprecated Use `z.iso.date()` instead. */
|
|
2025
|
+
date(params?: string | $ZodCheckISODateParams): this;
|
|
2026
|
+
/** @deprecated Use `z.iso.time()` instead. */
|
|
2027
|
+
time(params?: string | $ZodCheckISOTimeParams): this;
|
|
2028
|
+
/** @deprecated Use `z.iso.duration()` instead. */
|
|
2029
|
+
duration(params?: string | $ZodCheckISODurationParams): this;
|
|
2030
|
+
}
|
|
2031
|
+
declare const ZodString: $constructor<ZodString>;
|
|
2032
|
+
interface _ZodNumber<Internals extends $ZodNumberInternals = $ZodNumberInternals> extends _ZodType<Internals> {
|
|
2033
|
+
gt(value: number, params?: string | $ZodCheckGreaterThanParams): this;
|
|
2034
|
+
/** Identical to .min() */
|
|
2035
|
+
gte(value: number, params?: string | $ZodCheckGreaterThanParams): this;
|
|
2036
|
+
min(value: number, params?: string | $ZodCheckGreaterThanParams): this;
|
|
2037
|
+
lt(value: number, params?: string | $ZodCheckLessThanParams): this;
|
|
2038
|
+
/** Identical to .max() */
|
|
2039
|
+
lte(value: number, params?: string | $ZodCheckLessThanParams): this;
|
|
2040
|
+
max(value: number, params?: string | $ZodCheckLessThanParams): this;
|
|
2041
|
+
/** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
|
|
2042
|
+
int(params?: string | $ZodCheckNumberFormatParams): this;
|
|
2043
|
+
/** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
|
|
2044
|
+
safe(params?: string | $ZodCheckNumberFormatParams): this;
|
|
2045
|
+
positive(params?: string | $ZodCheckGreaterThanParams): this;
|
|
2046
|
+
nonnegative(params?: string | $ZodCheckGreaterThanParams): this;
|
|
2047
|
+
negative(params?: string | $ZodCheckLessThanParams): this;
|
|
2048
|
+
nonpositive(params?: string | $ZodCheckLessThanParams): this;
|
|
2049
|
+
multipleOf(value: number, params?: string | $ZodCheckMultipleOfParams): this;
|
|
2050
|
+
/** @deprecated Use `.multipleOf()` instead. */
|
|
2051
|
+
step(value: number, params?: string | $ZodCheckMultipleOfParams): this;
|
|
2052
|
+
/** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
|
|
2053
|
+
finite(params?: unknown): this;
|
|
2054
|
+
minValue: number | null;
|
|
2055
|
+
maxValue: number | null;
|
|
2056
|
+
/** @deprecated Check the `format` property instead. */
|
|
2057
|
+
isInt: boolean;
|
|
2058
|
+
/** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
|
|
2059
|
+
isFinite: boolean;
|
|
2060
|
+
format: string | null;
|
|
2061
|
+
}
|
|
2062
|
+
interface ZodNumber extends _ZodNumber<$ZodNumberInternals<number>> {}
|
|
2063
|
+
declare const ZodNumber: $constructor<ZodNumber>;
|
|
2064
|
+
interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
|
|
2065
|
+
interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
|
|
2066
|
+
declare const ZodBoolean: $constructor<ZodBoolean>;
|
|
2067
|
+
interface ZodNull extends _ZodType<$ZodNullInternals> {}
|
|
2068
|
+
declare const ZodNull: $constructor<ZodNull>;
|
|
2069
|
+
interface ZodUnknown extends _ZodType<$ZodUnknownInternals> {}
|
|
2070
|
+
declare const ZodUnknown: $constructor<ZodUnknown>;
|
|
2071
|
+
interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
|
|
2072
|
+
element: T;
|
|
2073
|
+
min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
|
|
2074
|
+
nonempty(params?: string | $ZodCheckMinLengthParams): this;
|
|
2075
|
+
max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
|
|
2076
|
+
length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
|
|
2077
|
+
unwrap(): T;
|
|
2078
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2079
|
+
}
|
|
2080
|
+
declare const ZodArray: $constructor<ZodArray>;
|
|
2081
|
+
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]; };
|
|
2082
|
+
interface ZodObject<
|
|
2083
|
+
/** @ts-ignore Cast variance */
|
|
2084
|
+
out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
|
|
2085
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2086
|
+
shape: Shape;
|
|
2087
|
+
keyof(): ZodEnum<ToEnum<keyof Shape & string>>;
|
|
2088
|
+
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
|
|
2089
|
+
catchall<T extends SomeType>(schema: T): ZodObject<Shape, $catchall<T>>;
|
|
2090
|
+
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
|
|
2091
|
+
passthrough(): ZodObject<Shape, $loose>;
|
|
2092
|
+
/** Consider `z.looseObject(A.shape)` instead */
|
|
2093
|
+
loose(): ZodObject<Shape, $loose>;
|
|
2094
|
+
/** Consider `z.strictObject(A.shape)` instead */
|
|
2095
|
+
strict(): ZodObject<Shape, $strict>;
|
|
2096
|
+
/** This is the default behavior. This method call is likely unnecessary. */
|
|
2097
|
+
strip(): ZodObject<Shape, $strip>;
|
|
2098
|
+
extend<U extends $ZodLooseShape>(shape: U): ZodObject<Extend<Shape, Writeable<U>>, Config>;
|
|
2099
|
+
safeExtend<U extends $ZodLooseShape>(shape: SafeExtendShape<Shape, U> & Partial<Record<keyof Shape, SomeType>>): ZodObject<Extend<Shape, Writeable<U>>, Config>;
|
|
2100
|
+
/**
|
|
2101
|
+
* @deprecated Use [`A.extend(B.shape)`](https://zod.dev/api?id=extend) instead.
|
|
2102
|
+
*/
|
|
2103
|
+
merge<U extends ZodObject>(other: U): ZodObject<Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
|
|
2104
|
+
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>;
|
|
2105
|
+
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>;
|
|
2106
|
+
partial(): ZodObject<{ -readonly [k in keyof Shape]: ZodOptional<Shape[k]>; }, Config>;
|
|
2107
|
+
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>;
|
|
2108
|
+
exactPartial(): ZodObject<{ -readonly [k in keyof Shape]: ZodExactOptional<Shape[k]>; }, Config>;
|
|
2109
|
+
exactPartial<M extends Mask<keyof Shape>>(mask: M & Record<Exclude<keyof M, keyof Shape>, never>): ZodObject<{ -readonly [k in keyof Shape]: k extends keyof M ? ZodExactOptional<Shape[k]> : Shape[k]; }, Config>;
|
|
2110
|
+
required(): ZodObject<{ -readonly [k in keyof Shape]: ZodNonOptional<Shape[k]>; }, Config>;
|
|
2111
|
+
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>;
|
|
2112
|
+
}
|
|
2113
|
+
declare const ZodObject: $constructor<ZodObject>;
|
|
2114
|
+
interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
|
|
2115
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2116
|
+
options: T;
|
|
2117
|
+
}
|
|
2118
|
+
declare const ZodUnion: $constructor<ZodUnion>;
|
|
2119
|
+
interface ZodDiscriminatedUnion<Options extends readonly SomeType[] = readonly $ZodType[], Disc extends string = string> extends ZodUnion<Options>, $ZodDiscriminatedUnion<Options, Disc> {
|
|
2120
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2121
|
+
_zod: $ZodDiscriminatedUnionInternals<Options, Disc>;
|
|
2122
|
+
def: $ZodDiscriminatedUnionDef<Options, Disc>;
|
|
2123
|
+
}
|
|
2124
|
+
declare const ZodDiscriminatedUnion: $constructor<ZodDiscriminatedUnion>;
|
|
2125
|
+
interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
|
|
2126
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2127
|
+
}
|
|
2128
|
+
declare const ZodIntersection: $constructor<ZodIntersection>;
|
|
2129
|
+
interface ZodEnum<
|
|
2130
|
+
/** @ts-ignore Cast variance */
|
|
2131
|
+
out T extends EnumLike = EnumLike> extends _ZodType<$ZodEnumInternals<T>>, $ZodEnum<T> {
|
|
2132
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2133
|
+
enum: T;
|
|
2134
|
+
options: Array<T[keyof T]>;
|
|
2135
|
+
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Pick<T, U[number]>>>;
|
|
2136
|
+
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | $ZodEnumParams): ZodEnum<Flatten<Omit<T, U[number]>>>;
|
|
2137
|
+
}
|
|
2138
|
+
declare const ZodEnum: $constructor<ZodEnum>;
|
|
2139
|
+
interface ZodLiteral<T extends Literal = Literal> extends _ZodType<$ZodLiteralInternals<T>>, $ZodLiteral<T> {
|
|
2140
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2141
|
+
values: Set<T>;
|
|
2142
|
+
/** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
|
|
2143
|
+
value: T;
|
|
2144
|
+
}
|
|
2145
|
+
declare const ZodLiteral: $constructor<ZodLiteral>;
|
|
2146
|
+
interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
|
|
2147
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2148
|
+
}
|
|
2149
|
+
declare const ZodTransform: $constructor<ZodTransform>;
|
|
2150
|
+
interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
|
|
2151
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2152
|
+
unwrap(): T;
|
|
2153
|
+
}
|
|
2154
|
+
declare const ZodOptional: $constructor<ZodOptional>;
|
|
2155
|
+
interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
|
|
2156
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2157
|
+
unwrap(): T;
|
|
2158
|
+
}
|
|
2159
|
+
declare const ZodExactOptional: $constructor<ZodExactOptional>;
|
|
2160
|
+
interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
|
|
2161
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2162
|
+
unwrap(): T;
|
|
2163
|
+
}
|
|
2164
|
+
declare const ZodNullable: $constructor<ZodNullable>;
|
|
2165
|
+
interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
|
|
2166
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2167
|
+
unwrap(): T;
|
|
2168
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
2169
|
+
removeDefault(): T;
|
|
2170
|
+
}
|
|
2171
|
+
declare const ZodDefault: $constructor<ZodDefault>;
|
|
2172
|
+
interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
|
|
2173
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2174
|
+
unwrap(): T;
|
|
2175
|
+
}
|
|
2176
|
+
declare const ZodPrefault: $constructor<ZodPrefault>;
|
|
2177
|
+
interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
|
|
2178
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2179
|
+
unwrap(): T;
|
|
2180
|
+
}
|
|
2181
|
+
declare const ZodNonOptional: $constructor<ZodNonOptional>;
|
|
2182
|
+
interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
|
|
2183
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2184
|
+
unwrap(): T;
|
|
2185
|
+
/** @deprecated Use `.unwrap()` instead. */
|
|
2186
|
+
removeCatch(): T;
|
|
2187
|
+
}
|
|
2188
|
+
declare const ZodCatch: $constructor<ZodCatch>;
|
|
2189
|
+
interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
|
|
2190
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2191
|
+
in: A;
|
|
2192
|
+
out: B;
|
|
2193
|
+
}
|
|
2194
|
+
declare const ZodPipe: $constructor<ZodPipe>;
|
|
2195
|
+
interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
|
|
2196
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2197
|
+
unwrap(): T;
|
|
2198
|
+
}
|
|
2199
|
+
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
2200
|
+
//#endregion
|
|
2201
|
+
//#region ../../packages/shared/dist/task-Dg5NQU3r.d.mts
|
|
2202
|
+
declare const AccountComputerSummarySchema: ZodObject<{
|
|
2203
|
+
computerId: ZodString;
|
|
2204
|
+
displayName: ZodString;
|
|
2205
|
+
platform: ZodEnum<{
|
|
2206
|
+
darwin: "darwin";
|
|
2207
|
+
linux: "linux";
|
|
2208
|
+
win32: "win32";
|
|
2209
|
+
}>;
|
|
2210
|
+
connectionStatus: ZodEnum<{
|
|
2211
|
+
offline: "offline";
|
|
2212
|
+
online: "online";
|
|
2213
|
+
}>;
|
|
2214
|
+
providerReadiness: ZodOptional<ZodArray<ZodObject<{
|
|
2215
|
+
provider: ZodEnum<{
|
|
2216
|
+
"claude-code": "claude-code";
|
|
2217
|
+
codex: "codex";
|
|
2218
|
+
}>;
|
|
2219
|
+
status: ZodEnum<{
|
|
2220
|
+
checking: "checking";
|
|
2221
|
+
install: "install";
|
|
2222
|
+
ready: "ready";
|
|
2223
|
+
"sign-in": "sign-in";
|
|
2224
|
+
unavailable: "unavailable";
|
|
2225
|
+
}>;
|
|
2226
|
+
observedAt: ZodNullable<ZodString>;
|
|
2227
|
+
}, $strict>>>;
|
|
2228
|
+
imCliReadiness: ZodOptional<ZodArray<ZodObject<{
|
|
2229
|
+
provider: ZodEnum<{
|
|
2230
|
+
feishu: "feishu";
|
|
2231
|
+
slack: "slack";
|
|
2232
|
+
}>;
|
|
2233
|
+
status: ZodEnum<{
|
|
2234
|
+
checking: "checking";
|
|
2235
|
+
install: "install";
|
|
2236
|
+
ready: "ready";
|
|
2237
|
+
unavailable: "unavailable";
|
|
2238
|
+
}>;
|
|
2239
|
+
observedAt: ZodNullable<ZodString>;
|
|
2240
|
+
}, $strict>>>;
|
|
2241
|
+
connectedAt: ZodNullable<ZodString>;
|
|
2242
|
+
lastSeenAt: ZodNullable<ZodString>;
|
|
2243
|
+
observedAt: ZodString;
|
|
2244
|
+
createdAt: ZodString;
|
|
2245
|
+
agentIds: ZodArray<ZodString>;
|
|
2246
|
+
}, $strict>;
|
|
2247
|
+
declare const ListAccountComputersResponseSchema: ZodObject<{
|
|
2248
|
+
computers: ZodArray<ZodObject<{
|
|
2249
|
+
computerId: ZodString;
|
|
2250
|
+
displayName: ZodString;
|
|
2251
|
+
platform: ZodEnum<{
|
|
2252
|
+
darwin: "darwin";
|
|
2253
|
+
linux: "linux";
|
|
2254
|
+
win32: "win32";
|
|
2255
|
+
}>;
|
|
2256
|
+
connectionStatus: ZodEnum<{
|
|
2257
|
+
offline: "offline";
|
|
2258
|
+
online: "online";
|
|
2259
|
+
}>;
|
|
2260
|
+
providerReadiness: ZodOptional<ZodArray<ZodObject<{
|
|
2261
|
+
provider: ZodEnum<{
|
|
2262
|
+
"claude-code": "claude-code";
|
|
2263
|
+
codex: "codex";
|
|
2264
|
+
}>;
|
|
2265
|
+
status: ZodEnum<{
|
|
2266
|
+
checking: "checking";
|
|
2267
|
+
install: "install";
|
|
2268
|
+
ready: "ready";
|
|
2269
|
+
"sign-in": "sign-in";
|
|
2270
|
+
unavailable: "unavailable";
|
|
2271
|
+
}>;
|
|
2272
|
+
observedAt: ZodNullable<ZodString>;
|
|
2273
|
+
}, $strict>>>;
|
|
2274
|
+
imCliReadiness: ZodOptional<ZodArray<ZodObject<{
|
|
2275
|
+
provider: ZodEnum<{
|
|
2276
|
+
feishu: "feishu";
|
|
2277
|
+
slack: "slack";
|
|
2278
|
+
}>;
|
|
2279
|
+
status: ZodEnum<{
|
|
2280
|
+
checking: "checking";
|
|
2281
|
+
install: "install";
|
|
2282
|
+
ready: "ready";
|
|
2283
|
+
unavailable: "unavailable";
|
|
2284
|
+
}>;
|
|
2285
|
+
observedAt: ZodNullable<ZodString>;
|
|
2286
|
+
}, $strict>>>;
|
|
2287
|
+
connectedAt: ZodNullable<ZodString>;
|
|
2288
|
+
lastSeenAt: ZodNullable<ZodString>;
|
|
2289
|
+
observedAt: ZodString;
|
|
2290
|
+
createdAt: ZodString;
|
|
2291
|
+
agentIds: ZodArray<ZodString>;
|
|
2292
|
+
}, $strict>>;
|
|
2293
|
+
}, $strict>;
|
|
2294
|
+
type AccountComputerSummary = output<typeof AccountComputerSummarySchema>;
|
|
2295
|
+
type ListAccountComputersResponse = output<typeof ListAccountComputersResponseSchema>;
|
|
2296
|
+
declare const AgentUsageWindowDaysSchema: ZodUnion<readonly [ZodLiteral<1>, ZodLiteral<7>, ZodLiteral<30>, ZodLiteral<90>]>;
|
|
2297
|
+
declare const AgentDetailSchema: ZodObject<{
|
|
2298
|
+
id: ZodString;
|
|
2299
|
+
name: ZodString;
|
|
2300
|
+
displayName: ZodString;
|
|
2301
|
+
runtimeProvider: ZodEnum<{
|
|
2302
|
+
"claude-code": "claude-code";
|
|
2303
|
+
codex: "codex";
|
|
2304
|
+
}>;
|
|
2305
|
+
receiveMode: ZodEnum<{
|
|
2306
|
+
all_message: "all_message";
|
|
2307
|
+
mention_only: "mention_only";
|
|
2308
|
+
}>;
|
|
2309
|
+
status: ZodEnum<{
|
|
2310
|
+
active: "active";
|
|
2311
|
+
suspended: "suspended";
|
|
2312
|
+
}>;
|
|
2313
|
+
createdAt: ZodString;
|
|
2314
|
+
updatedAt: ZodString;
|
|
2315
|
+
createdBy: ZodObject<{
|
|
2316
|
+
userId: ZodString;
|
|
2317
|
+
displayName: ZodString;
|
|
2318
|
+
}, $strict>;
|
|
2319
|
+
computer: ZodNullable<ZodObject<{
|
|
2320
|
+
computerId: ZodString;
|
|
2321
|
+
displayName: ZodString;
|
|
2322
|
+
platform: ZodEnum<{
|
|
2323
|
+
darwin: "darwin";
|
|
2324
|
+
linux: "linux";
|
|
2325
|
+
win32: "win32";
|
|
2326
|
+
}>;
|
|
2327
|
+
}, $strict>>;
|
|
2328
|
+
requiresComputerRebind: ZodOptional<ZodBoolean>;
|
|
2329
|
+
activity: ZodDiscriminatedUnion<[ZodObject<{
|
|
2330
|
+
state: ZodLiteral<"idle">;
|
|
2331
|
+
}, $strict>, ZodObject<{
|
|
2332
|
+
state: ZodLiteral<"unknown">;
|
|
2333
|
+
}, $strict>, ZodObject<{
|
|
2334
|
+
state: ZodLiteral<"working">;
|
|
2335
|
+
startedAt: ZodString;
|
|
2336
|
+
}, $strict>], "state">;
|
|
2337
|
+
}, $strict>;
|
|
2338
|
+
declare const AgentUsageDetailSchema: ZodObject<{
|
|
2339
|
+
inputTokens: ZodNumber;
|
|
2340
|
+
cachedInputTokens: ZodNumber;
|
|
2341
|
+
outputTokens: ZodNumber;
|
|
2342
|
+
tokens: ZodNumber;
|
|
2343
|
+
windowDays: ZodUnion<readonly [ZodLiteral<1>, ZodLiteral<7>, ZodLiteral<30>, ZodLiteral<90>]>;
|
|
2344
|
+
startedAt: ZodString;
|
|
2345
|
+
endedAt: ZodString;
|
|
2346
|
+
tasks: ZodNumber;
|
|
2347
|
+
measuredTasks: ZodNumber;
|
|
2348
|
+
failed: ZodNumber;
|
|
2349
|
+
daily: ZodArray<ZodObject<{
|
|
2350
|
+
inputTokens: ZodNumber;
|
|
2351
|
+
cachedInputTokens: ZodNumber;
|
|
2352
|
+
outputTokens: ZodNumber;
|
|
2353
|
+
tokens: ZodNumber;
|
|
2354
|
+
date: ZodString;
|
|
2355
|
+
tasks: ZodNumber;
|
|
2356
|
+
measuredTasks: ZodNumber;
|
|
2357
|
+
}, $strict>>;
|
|
2358
|
+
}, $strict>;
|
|
2359
|
+
declare const AgentAdminConfigSchema: ZodObject<{
|
|
2360
|
+
id: ZodString;
|
|
2361
|
+
name: ZodString;
|
|
2362
|
+
displayName: ZodString;
|
|
2363
|
+
runtimeProvider: ZodEnum<{
|
|
2364
|
+
"claude-code": "claude-code";
|
|
2365
|
+
codex: "codex";
|
|
2366
|
+
}>;
|
|
2367
|
+
receiveMode: ZodEnum<{
|
|
2368
|
+
all_message: "all_message";
|
|
2369
|
+
mention_only: "mention_only";
|
|
2370
|
+
}>;
|
|
2371
|
+
status: ZodEnum<{
|
|
2372
|
+
active: "active";
|
|
2373
|
+
suspended: "suspended";
|
|
2374
|
+
}>;
|
|
2375
|
+
createdAt: ZodString;
|
|
2376
|
+
updatedAt: ZodString;
|
|
2377
|
+
createdByUserId: ZodString;
|
|
2378
|
+
computerId: ZodNullable<ZodString>;
|
|
2379
|
+
revision: ZodNumber;
|
|
2380
|
+
runtimeConfig: ZodObject<{
|
|
2381
|
+
revision: ZodNumber;
|
|
2382
|
+
model: ZodNullable<ZodString>;
|
|
2383
|
+
reasoningEffort: ZodNullable<ZodString>;
|
|
2384
|
+
instructions: ZodString;
|
|
2385
|
+
maxDurationMs: ZodNullable<ZodNumber>;
|
|
2386
|
+
}, $strict>;
|
|
2387
|
+
}, $strict>;
|
|
2388
|
+
declare const CreateAgentRequestSchema: ZodObject<{
|
|
2389
|
+
creationIntentId: ZodOptional<ZodString>;
|
|
2390
|
+
name: ZodString;
|
|
2391
|
+
displayName: ZodString;
|
|
2392
|
+
runtimeProvider: ZodEnum<{
|
|
2393
|
+
"claude-code": "claude-code";
|
|
2394
|
+
codex: "codex";
|
|
2395
|
+
}>;
|
|
2396
|
+
computerId: ZodOptional<ZodString>;
|
|
2397
|
+
runtimeConfig: ZodOptional<ZodObject<{
|
|
2398
|
+
model: ZodOptional<ZodNullable<ZodString>>;
|
|
2399
|
+
reasoningEffort: ZodOptional<ZodNullable<ZodString>>;
|
|
2400
|
+
instructions: ZodOptional<ZodString>;
|
|
2401
|
+
maxDurationMs: ZodOptional<ZodNullable<ZodNumber>>;
|
|
2402
|
+
}, $strict>>;
|
|
2403
|
+
}, $strict>;
|
|
2404
|
+
declare const UpdateAgentRequestSchema: ZodObject<{
|
|
2405
|
+
expectedRevision: ZodNumber;
|
|
2406
|
+
displayName: ZodOptional<ZodString>;
|
|
2407
|
+
receiveMode: ZodOptional<ZodEnum<{
|
|
2408
|
+
all_message: "all_message";
|
|
2409
|
+
mention_only: "mention_only";
|
|
2410
|
+
}>>;
|
|
2411
|
+
runtimeConfig: ZodOptional<ZodObject<{
|
|
2412
|
+
model: ZodOptional<ZodNullable<ZodString>>;
|
|
2413
|
+
reasoningEffort: ZodOptional<ZodNullable<ZodString>>;
|
|
2414
|
+
instructions: ZodOptional<ZodString>;
|
|
2415
|
+
maxDurationMs: ZodOptional<ZodNullable<ZodNumber>>;
|
|
2416
|
+
}, $strict>>;
|
|
2417
|
+
}, $strict>;
|
|
2418
|
+
declare const ListAgentsResponseSchema: ZodObject<{
|
|
2419
|
+
agents: ZodArray<ZodObject<{
|
|
2420
|
+
id: ZodString;
|
|
2421
|
+
name: ZodString;
|
|
2422
|
+
displayName: ZodString;
|
|
2423
|
+
runtimeProvider: ZodEnum<{
|
|
2424
|
+
"claude-code": "claude-code";
|
|
2425
|
+
codex: "codex";
|
|
2426
|
+
}>;
|
|
2427
|
+
receiveMode: ZodEnum<{
|
|
2428
|
+
all_message: "all_message";
|
|
2429
|
+
mention_only: "mention_only";
|
|
2430
|
+
}>;
|
|
2431
|
+
status: ZodEnum<{
|
|
2432
|
+
active: "active";
|
|
2433
|
+
suspended: "suspended";
|
|
2434
|
+
}>;
|
|
2435
|
+
createdAt: ZodString;
|
|
2436
|
+
updatedAt: ZodString;
|
|
2437
|
+
createdBy: ZodObject<{
|
|
2438
|
+
userId: ZodString;
|
|
2439
|
+
displayName: ZodString;
|
|
2440
|
+
}, $strict>;
|
|
2441
|
+
computer: ZodNullable<ZodObject<{
|
|
2442
|
+
computerId: ZodString;
|
|
2443
|
+
displayName: ZodString;
|
|
2444
|
+
platform: ZodEnum<{
|
|
2445
|
+
darwin: "darwin";
|
|
2446
|
+
linux: "linux";
|
|
2447
|
+
win32: "win32";
|
|
2448
|
+
}>;
|
|
2449
|
+
}, $strict>>;
|
|
2450
|
+
requiresComputerRebind: ZodOptional<ZodBoolean>;
|
|
2451
|
+
activity: ZodDiscriminatedUnion<[ZodObject<{
|
|
2452
|
+
state: ZodLiteral<"idle">;
|
|
2453
|
+
}, $strict>, ZodObject<{
|
|
2454
|
+
state: ZodLiteral<"unknown">;
|
|
2455
|
+
}, $strict>, ZodObject<{
|
|
2456
|
+
state: ZodLiteral<"working">;
|
|
2457
|
+
startedAt: ZodString;
|
|
2458
|
+
}, $strict>], "state">;
|
|
2459
|
+
usage: ZodObject<{
|
|
2460
|
+
windowDays: ZodLiteral<30>;
|
|
2461
|
+
tasks: ZodNumber;
|
|
2462
|
+
failed: ZodNumber;
|
|
2463
|
+
tokens: ZodNumber;
|
|
2464
|
+
}, $strict>;
|
|
2465
|
+
}, $strict>>;
|
|
2466
|
+
}, $strict>;
|
|
2467
|
+
declare const AgentRuntimeTestRequestSchema: ZodObject<{
|
|
2468
|
+
expectedRevision: ZodNumber;
|
|
2469
|
+
expectedRuntimeConfigRevision: ZodNumber;
|
|
2470
|
+
}, $strict>;
|
|
2471
|
+
declare const AgentRuntimeTestResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
2472
|
+
status: ZodLiteral<"passed">;
|
|
2473
|
+
}, $strict>, ZodObject<{
|
|
2474
|
+
status: ZodLiteral<"failed">;
|
|
2475
|
+
code: ZodEnum<{
|
|
2476
|
+
busy: "busy";
|
|
2477
|
+
cancelled: "cancelled";
|
|
2478
|
+
capability_missing: "capability_missing";
|
|
2479
|
+
computer_unavailable: "computer_unavailable";
|
|
2480
|
+
interaction_or_tool: "interaction_or_tool";
|
|
2481
|
+
provider_failed: "provider_failed";
|
|
2482
|
+
provider_start_failed: "provider_start_failed";
|
|
2483
|
+
stale_configuration: "stale_configuration";
|
|
2484
|
+
timeout: "timeout";
|
|
2485
|
+
}>;
|
|
2486
|
+
}, $strict>], "status">;
|
|
2487
|
+
type AgentDetail = output<typeof AgentDetailSchema>;
|
|
2488
|
+
type AgentUsageWindowDays = output<typeof AgentUsageWindowDaysSchema>;
|
|
2489
|
+
type AgentUsageDetail = output<typeof AgentUsageDetailSchema>;
|
|
2490
|
+
type AgentAdminConfig = output<typeof AgentAdminConfigSchema>;
|
|
2491
|
+
type CreateAgentRequest = output<typeof CreateAgentRequestSchema>;
|
|
2492
|
+
type UpdateAgentRequest = output<typeof UpdateAgentRequestSchema>;
|
|
2493
|
+
type ListAgentsResponse = output<typeof ListAgentsResponseSchema>;
|
|
2494
|
+
type AgentRuntimeTestRequest = output<typeof AgentRuntimeTestRequestSchema>;
|
|
2495
|
+
type AgentRuntimeTestResponse = output<typeof AgentRuntimeTestResponseSchema>;
|
|
2496
|
+
declare const ImCliProviderSchema: ZodEnum<{
|
|
2497
|
+
feishu: "feishu";
|
|
2498
|
+
slack: "slack";
|
|
2499
|
+
}>;
|
|
2500
|
+
/**
|
|
2501
|
+
* Exchange identifies the local installation, not an existing Computer. The Server decides create vs
|
|
2502
|
+
* repair only from the one-time code: create always allocates a new Computer, and repair names its
|
|
2503
|
+
* target Computer when the code is issued.
|
|
2504
|
+
*/
|
|
2505
|
+
declare const ComputerConnectCodeExchangeRequestSchema: ZodObject<{
|
|
2506
|
+
code: ZodString;
|
|
2507
|
+
installationId: ZodString;
|
|
2508
|
+
displayName: ZodString;
|
|
2509
|
+
platform: ZodEnum<{
|
|
2510
|
+
darwin: "darwin";
|
|
2511
|
+
linux: "linux";
|
|
2512
|
+
win32: "win32";
|
|
2513
|
+
}>;
|
|
2514
|
+
arch: ZodString;
|
|
2515
|
+
clientVersion: ZodString;
|
|
2516
|
+
}, $strict>;
|
|
2517
|
+
declare const ComputerConnectCodeExchangeResponseSchema: ZodObject<{
|
|
2518
|
+
agentId: ZodOptional<ZodString>;
|
|
2519
|
+
runtimeProvider: ZodOptional<ZodEnum<{
|
|
2520
|
+
"claude-code": "claude-code";
|
|
2521
|
+
codex: "codex";
|
|
2522
|
+
}>>;
|
|
2523
|
+
computerId: ZodString;
|
|
2524
|
+
installationId: ZodString;
|
|
2525
|
+
machineToken: ZodString;
|
|
2526
|
+
}, $strict>;
|
|
2527
|
+
declare const ComputerConnectCodeIssueResponseSchema: ZodObject<{
|
|
2528
|
+
connectCodeId: ZodString;
|
|
2529
|
+
bootstrapCommand: ZodString;
|
|
2530
|
+
expiresIn: ZodNumber;
|
|
2531
|
+
issuedAt: ZodString;
|
|
2532
|
+
mode: ZodOptional<ZodEnum<{
|
|
2533
|
+
create: "create";
|
|
2534
|
+
repair: "repair";
|
|
2535
|
+
}>>;
|
|
2536
|
+
}, $strict>;
|
|
2537
|
+
declare const ComputerConnectCodeStatusSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
2538
|
+
connectCodeId: ZodString;
|
|
2539
|
+
computerId: ZodNull;
|
|
2540
|
+
redeemedAt: ZodNull;
|
|
2541
|
+
state: ZodLiteral<"pending">;
|
|
2542
|
+
}, $strict>, ZodObject<{
|
|
2543
|
+
connectCodeId: ZodString;
|
|
2544
|
+
computerId: ZodNull;
|
|
2545
|
+
redeemedAt: ZodNull;
|
|
2546
|
+
state: ZodLiteral<"expired">;
|
|
2547
|
+
}, $strict>, ZodObject<{
|
|
2548
|
+
connectCodeId: ZodString;
|
|
2549
|
+
computerId: ZodNull;
|
|
2550
|
+
redeemedAt: ZodNull;
|
|
2551
|
+
state: ZodLiteral<"revoked">;
|
|
2552
|
+
}, $strict>, ZodObject<{
|
|
2553
|
+
connectCodeId: ZodString;
|
|
2554
|
+
state: ZodLiteral<"redeemed">;
|
|
2555
|
+
computerId: ZodString;
|
|
2556
|
+
redeemedAt: ZodString;
|
|
2557
|
+
}, $strict>], "state">;
|
|
2558
|
+
type ComputerConnectCodeExchangeRequest = output<typeof ComputerConnectCodeExchangeRequestSchema>;
|
|
2559
|
+
type ComputerConnectCodeExchangeResponse = output<typeof ComputerConnectCodeExchangeResponseSchema>;
|
|
2560
|
+
type ComputerConnectCodeIssueResponse = output<typeof ComputerConnectCodeIssueResponseSchema>;
|
|
2561
|
+
type ComputerConnectCodeStatus = output<typeof ComputerConnectCodeStatusSchema>;
|
|
2562
|
+
type ImCliProvider = output<typeof ImCliProviderSchema>;
|
|
2563
|
+
declare const ConnectCodeExchangeResponseSchema: ZodObject<{
|
|
2564
|
+
accessToken: ZodString;
|
|
2565
|
+
refreshToken: ZodString;
|
|
2566
|
+
tokenType: ZodLiteral<"Bearer">;
|
|
2567
|
+
expiresIn: ZodNumber;
|
|
2568
|
+
}, $strict>;
|
|
2569
|
+
declare const RefreshTokenResponseSchema: ZodObject<{
|
|
2570
|
+
accessToken: ZodString;
|
|
2571
|
+
refreshToken: ZodString;
|
|
2572
|
+
tokenType: ZodLiteral<"Bearer">;
|
|
2573
|
+
expiresIn: ZodNumber;
|
|
2574
|
+
}, $strict>;
|
|
2575
|
+
/**
|
|
2576
|
+
* Authentication proves Account identity only. `setupCompletedAt` is durable Account state from
|
|
2577
|
+
* `users.setup_completed_at`; it is never derived from Agents, Workspaces, or grants.
|
|
2578
|
+
*/
|
|
2579
|
+
declare const MeResponseSchema: ZodObject<{
|
|
2580
|
+
user: ZodObject<{
|
|
2581
|
+
id: ZodString;
|
|
2582
|
+
email: ZodString;
|
|
2583
|
+
displayName: ZodString;
|
|
2584
|
+
}, $strict>;
|
|
2585
|
+
setupCompletedAt: ZodNullable<ZodString>;
|
|
2586
|
+
}, $strict>;
|
|
2587
|
+
type ConnectCodeExchangeResponse = output<typeof ConnectCodeExchangeResponseSchema>;
|
|
2588
|
+
type RefreshTokenResponse = output<typeof RefreshTokenResponseSchema>;
|
|
2589
|
+
type MeResponse = output<typeof MeResponseSchema>;
|
|
2590
|
+
//#endregion
|
|
2591
|
+
//#region src/health.d.ts
|
|
2592
|
+
declare const ServerHealthSchema: ZodObject<{
|
|
2593
|
+
status: ZodLiteral<"ok">;
|
|
2594
|
+
service: ZodLiteral<"opentag-server">;
|
|
2595
|
+
}, $strict>;
|
|
2596
|
+
type ServerHealth = output<typeof ServerHealthSchema>;
|
|
2597
|
+
declare const ImBindingSummarySchema: ZodObject<{
|
|
2598
|
+
id: ZodString;
|
|
2599
|
+
agentId: ZodString;
|
|
2600
|
+
provider: ZodEnum<{
|
|
2601
|
+
feishu: "feishu";
|
|
2602
|
+
slack: "slack";
|
|
2603
|
+
}>;
|
|
2604
|
+
bindingState: ZodEnum<{
|
|
2605
|
+
active: "active";
|
|
2606
|
+
disabled: "disabled";
|
|
2607
|
+
error: "error";
|
|
2608
|
+
provisioning: "provisioning";
|
|
2609
|
+
reauthorization_required: "reauthorization_required";
|
|
2610
|
+
}>;
|
|
2611
|
+
bot: ZodObject<{
|
|
2612
|
+
displayName: ZodNullable<ZodString>;
|
|
2613
|
+
avatarUrl: ZodNullable<ZodString>;
|
|
2614
|
+
}, $strict>;
|
|
2615
|
+
receiveMode: ZodEnum<{
|
|
2616
|
+
all_message: "all_message";
|
|
2617
|
+
mention_only: "mention_only";
|
|
2618
|
+
}>;
|
|
2619
|
+
lastInboundAt: ZodNullable<ZodString>;
|
|
2620
|
+
lastValidatedAt: ZodNullable<ZodString>;
|
|
2621
|
+
lastRuntimeObservationAt: ZodNullable<ZodString>;
|
|
2622
|
+
}, $strict>;
|
|
2623
|
+
declare const ImBindingAdminDetailSchema: ZodObject<{
|
|
2624
|
+
id: ZodString;
|
|
2625
|
+
agentId: ZodString;
|
|
2626
|
+
provider: ZodEnum<{
|
|
2627
|
+
feishu: "feishu";
|
|
2628
|
+
slack: "slack";
|
|
2629
|
+
}>;
|
|
2630
|
+
bindingState: ZodEnum<{
|
|
2631
|
+
active: "active";
|
|
2632
|
+
disabled: "disabled";
|
|
2633
|
+
error: "error";
|
|
2634
|
+
provisioning: "provisioning";
|
|
2635
|
+
reauthorization_required: "reauthorization_required";
|
|
2636
|
+
}>;
|
|
2637
|
+
bot: ZodObject<{
|
|
2638
|
+
displayName: ZodNullable<ZodString>;
|
|
2639
|
+
avatarUrl: ZodNullable<ZodString>;
|
|
2640
|
+
}, $strict>;
|
|
2641
|
+
receiveMode: ZodEnum<{
|
|
2642
|
+
all_message: "all_message";
|
|
2643
|
+
mention_only: "mention_only";
|
|
2644
|
+
}>;
|
|
2645
|
+
lastInboundAt: ZodNullable<ZodString>;
|
|
2646
|
+
lastValidatedAt: ZodNullable<ZodString>;
|
|
2647
|
+
lastRuntimeObservationAt: ZodNullable<ZodString>;
|
|
2648
|
+
identity: ZodDiscriminatedUnion<[ZodObject<{
|
|
2649
|
+
provider: ZodLiteral<"feishu">;
|
|
2650
|
+
appId: ZodString;
|
|
2651
|
+
teamId: ZodNullable<ZodString>;
|
|
2652
|
+
botOpenId: ZodString;
|
|
2653
|
+
teamBrand: ZodNullable<ZodString>;
|
|
2654
|
+
}, $strict>, ZodObject<{
|
|
2655
|
+
provider: ZodLiteral<"slack">;
|
|
2656
|
+
appId: ZodString;
|
|
2657
|
+
teamId: ZodString;
|
|
2658
|
+
enterpriseId: ZodNullable<ZodString>;
|
|
2659
|
+
botUserId: ZodString;
|
|
2660
|
+
appIdEvidence: ZodLiteral<"configured">;
|
|
2661
|
+
}, $strict>], "provider">;
|
|
2662
|
+
credentialGeneration: ZodNumber;
|
|
2663
|
+
grantedCapabilities: ZodArray<ZodString>;
|
|
2664
|
+
reauthorizationRequired: ZodBoolean;
|
|
2665
|
+
lastErrorCode: ZodNullable<ZodString>;
|
|
2666
|
+
}, $strict>;
|
|
2667
|
+
declare const FeishuSetupAttemptSchema: ZodObject<{
|
|
2668
|
+
id: ZodString;
|
|
2669
|
+
agentId: ZodString;
|
|
2670
|
+
intent: ZodEnum<{
|
|
2671
|
+
create: "create";
|
|
2672
|
+
reauthorize: "reauthorize";
|
|
2673
|
+
replace: "replace";
|
|
2674
|
+
}>;
|
|
2675
|
+
state: ZodEnum<{
|
|
2676
|
+
awaiting_user: "awaiting_user";
|
|
2677
|
+
canceled: "canceled";
|
|
2678
|
+
expired: "expired";
|
|
2679
|
+
failed: "failed";
|
|
2680
|
+
succeeded: "succeeded";
|
|
2681
|
+
validating: "validating";
|
|
2682
|
+
}>;
|
|
2683
|
+
qrUrl: ZodNullable<ZodString>;
|
|
2684
|
+
expiresAt: ZodString;
|
|
2685
|
+
errorCode: ZodNullable<ZodString>;
|
|
2686
|
+
completedAt: ZodNullable<ZodString>;
|
|
2687
|
+
createdAt: ZodString;
|
|
2688
|
+
}, $strict>;
|
|
2689
|
+
declare const StartSlackOAuthRequestSchema: ZodObject<{
|
|
2690
|
+
intent: ZodEnum<{
|
|
2691
|
+
create: "create";
|
|
2692
|
+
reauthorize: "reauthorize";
|
|
2693
|
+
}>;
|
|
2694
|
+
returnSurface: ZodOptional<ZodEnum<{
|
|
2695
|
+
"agent-messaging-settings": "agent-messaging-settings";
|
|
2696
|
+
"agent-setup": "agent-setup";
|
|
2697
|
+
}>>;
|
|
2698
|
+
expectedMessaging: ZodOptional<ZodDiscriminatedUnion<[ZodObject<{
|
|
2699
|
+
kind: ZodLiteral<"unbound">;
|
|
2700
|
+
}, $strict>, ZodObject<{
|
|
2701
|
+
kind: ZodLiteral<"bound">;
|
|
2702
|
+
provider: ZodEnum<{
|
|
2703
|
+
feishu: "feishu";
|
|
2704
|
+
slack: "slack";
|
|
2705
|
+
}>;
|
|
2706
|
+
bindingId: ZodString;
|
|
2707
|
+
credentialGeneration: ZodNumber;
|
|
2708
|
+
}, $strict>], "kind">>;
|
|
2709
|
+
}, $strict>;
|
|
2710
|
+
declare const StartSlackOAuthResponseSchema: ZodObject<{
|
|
2711
|
+
authorizationUrl: ZodString;
|
|
2712
|
+
expiresAt: ZodString;
|
|
2713
|
+
}, $strict>;
|
|
2714
|
+
declare const ImBindingDiagnosticsSchema: ZodObject<{
|
|
2715
|
+
imBindingId: ZodString;
|
|
2716
|
+
provider: ZodEnum<{
|
|
2717
|
+
feishu: "feishu";
|
|
2718
|
+
slack: "slack";
|
|
2719
|
+
}>;
|
|
2720
|
+
ready: ZodBoolean;
|
|
2721
|
+
agentRuntimeReadiness: ZodEnum<{
|
|
2722
|
+
checking: "checking";
|
|
2723
|
+
install: "install";
|
|
2724
|
+
ready: "ready";
|
|
2725
|
+
"sign-in": "sign-in";
|
|
2726
|
+
unavailable: "unavailable";
|
|
2727
|
+
}>;
|
|
2728
|
+
providerCliReadiness: ZodEnum<{
|
|
2729
|
+
checking: "checking";
|
|
2730
|
+
install: "install";
|
|
2731
|
+
ready: "ready";
|
|
2732
|
+
unavailable: "unavailable";
|
|
2733
|
+
}>;
|
|
2734
|
+
credentialExecutionReadiness: ZodEnum<{
|
|
2735
|
+
checking: "checking";
|
|
2736
|
+
needs_attention: "needs_attention";
|
|
2737
|
+
ready: "ready";
|
|
2738
|
+
retrying: "retrying";
|
|
2739
|
+
unconfirmed: "unconfirmed";
|
|
2740
|
+
}>;
|
|
2741
|
+
credentialExecutionReason: ZodOptional<ZodEnum<{
|
|
2742
|
+
credential_rejected: "credential_rejected";
|
|
2743
|
+
identity_mismatch: "identity_mismatch";
|
|
2744
|
+
provider_unreachable: "provider_unreachable";
|
|
2745
|
+
rate_limited: "rate_limited";
|
|
2746
|
+
scope_missing: "scope_missing";
|
|
2747
|
+
upgrade_required: "upgrade_required";
|
|
2748
|
+
}>>;
|
|
2749
|
+
credentialGeneration: ZodNumber;
|
|
2750
|
+
credentialStatus: ZodEnum<{
|
|
2751
|
+
invalid: "invalid";
|
|
2752
|
+
valid: "valid";
|
|
2753
|
+
}>;
|
|
2754
|
+
requiredCapabilities: ZodArray<ZodString>;
|
|
2755
|
+
grantedCapabilities: ZodArray<ZodString>;
|
|
2756
|
+
missingCapabilities: ZodArray<ZodString>;
|
|
2757
|
+
reauthorizationRequired: ZodBoolean;
|
|
2758
|
+
slackAppId: ZodNullable<ZodObject<{
|
|
2759
|
+
value: ZodString;
|
|
2760
|
+
evidence: ZodLiteral<"configured">;
|
|
2761
|
+
ingressMatchRequired: ZodLiteral<true>;
|
|
2762
|
+
}, $strict>>;
|
|
2763
|
+
slackIdentityClosure: ZodNullable<ZodObject<{
|
|
2764
|
+
status: ZodEnum<{
|
|
2765
|
+
pending: "pending";
|
|
2766
|
+
verified: "verified";
|
|
2767
|
+
}>;
|
|
2768
|
+
verifiedAt: ZodNullable<ZodString>;
|
|
2769
|
+
}, $strict>>;
|
|
2770
|
+
connection: ZodNullable<ZodObject<{
|
|
2771
|
+
state: ZodEnum<{
|
|
2772
|
+
connected: "connected";
|
|
2773
|
+
disconnected: "disconnected";
|
|
2774
|
+
}>;
|
|
2775
|
+
observedAt: ZodString;
|
|
2776
|
+
}, $strip>>;
|
|
2777
|
+
lastInboundAt: ZodNullable<ZodString>;
|
|
2778
|
+
lastValidatedAt: ZodNullable<ZodString>;
|
|
2779
|
+
lastRuntimeObservationAt: ZodNullable<ZodString>;
|
|
2780
|
+
lastErrorCode: ZodNullable<ZodString>;
|
|
2781
|
+
}, $strict>;
|
|
2782
|
+
type ImBindingSummary = output<typeof ImBindingSummarySchema>;
|
|
2783
|
+
type ImBindingAdminDetail = output<typeof ImBindingAdminDetailSchema>;
|
|
2784
|
+
type FeishuSetupAttempt = output<typeof FeishuSetupAttemptSchema>;
|
|
2785
|
+
type StartSlackOAuthRequest = output<typeof StartSlackOAuthRequestSchema>;
|
|
2786
|
+
type StartSlackOAuthResponse = output<typeof StartSlackOAuthResponseSchema>;
|
|
2787
|
+
type ImBindingDiagnostics = output<typeof ImBindingDiagnosticsSchema>;
|
|
2788
|
+
declare const RuntimeDurableWorkKindSchema: ZodEnum<{
|
|
2789
|
+
"session-message": "session-message";
|
|
2790
|
+
"turn-report": "turn-report";
|
|
2791
|
+
}>;
|
|
2792
|
+
declare const RuntimeDurableWorkRecordSchema: ZodObject<{
|
|
2793
|
+
attempts: ZodNumber;
|
|
2794
|
+
acceptedAt: ZodNumber;
|
|
2795
|
+
key: ZodString;
|
|
2796
|
+
kind: ZodEnum<{
|
|
2797
|
+
"session-message": "session-message";
|
|
2798
|
+
"turn-report": "turn-report";
|
|
2799
|
+
}>;
|
|
2800
|
+
lastError: ZodOptional<ZodObject<{
|
|
2801
|
+
category: ZodString;
|
|
2802
|
+
code: ZodString;
|
|
2803
|
+
message: ZodString;
|
|
2804
|
+
phase: ZodString;
|
|
2805
|
+
requestId: ZodString;
|
|
2806
|
+
retryability: ZodEnum<{
|
|
2807
|
+
retryable: "retryable";
|
|
2808
|
+
terminal: "terminal";
|
|
2809
|
+
}>;
|
|
2810
|
+
}, $strict>>;
|
|
2811
|
+
nextAttemptAt: ZodOptional<ZodNumber>;
|
|
2812
|
+
payload: ZodUnknown;
|
|
2813
|
+
status: ZodEnum<{
|
|
2814
|
+
accepted: "accepted";
|
|
2815
|
+
"dead-letter": "dead-letter";
|
|
2816
|
+
failed: "failed";
|
|
2817
|
+
retryable: "retryable";
|
|
2818
|
+
running: "running";
|
|
2819
|
+
succeeded: "succeeded";
|
|
2820
|
+
}>;
|
|
2821
|
+
updatedAt: ZodNumber;
|
|
2822
|
+
}, $strict>;
|
|
2823
|
+
type RuntimeDurableWorkKind = output<typeof RuntimeDurableWorkKindSchema>;
|
|
2824
|
+
type RuntimeDurableWorkRecord = output<typeof RuntimeDurableWorkRecordSchema>;
|
|
2825
|
+
/** The stable high-level class used for operational routing and dashboards. */
|
|
2826
|
+
declare const StructuredErrorCategorySchema: ZodEnum<{
|
|
2827
|
+
auth: "auth";
|
|
2828
|
+
authorization: "authorization";
|
|
2829
|
+
cancelled: "cancelled";
|
|
2830
|
+
configuration: "configuration";
|
|
2831
|
+
conflict: "conflict";
|
|
2832
|
+
dependency: "dependency";
|
|
2833
|
+
internal: "internal";
|
|
2834
|
+
not_found: "not_found";
|
|
2835
|
+
protocol: "protocol";
|
|
2836
|
+
rate_limit: "rate_limit";
|
|
2837
|
+
timeout: "timeout";
|
|
2838
|
+
unavailable: "unavailable";
|
|
2839
|
+
validation: "validation";
|
|
2840
|
+
}>;
|
|
2841
|
+
/** The safe retry policy for a failure. Retries must still respect operation idempotency. */
|
|
2842
|
+
declare const ErrorRetryabilitySchema: ZodEnum<{
|
|
2843
|
+
after_auth: "after_auth";
|
|
2844
|
+
backoff: "backoff";
|
|
2845
|
+
immediate: "immediate";
|
|
2846
|
+
never: "never";
|
|
2847
|
+
}>;
|
|
2848
|
+
/** The lifecycle boundary at which an error was observed. */
|
|
2849
|
+
declare const StructuredErrorPhaseSchema: ZodEnum<{
|
|
2850
|
+
authentication: "authentication";
|
|
2851
|
+
authorization: "authorization";
|
|
2852
|
+
configuration: "configuration";
|
|
2853
|
+
dispatch: "dispatch";
|
|
2854
|
+
persistence: "persistence";
|
|
2855
|
+
provider: "provider";
|
|
2856
|
+
request: "request";
|
|
2857
|
+
scheduler: "scheduler";
|
|
2858
|
+
serialization: "serialization";
|
|
2859
|
+
shutdown: "shutdown";
|
|
2860
|
+
socket: "socket";
|
|
2861
|
+
startup: "startup";
|
|
2862
|
+
transport: "transport";
|
|
2863
|
+
unknown: "unknown";
|
|
2864
|
+
validation: "validation";
|
|
2865
|
+
worker: "worker";
|
|
2866
|
+
}>;
|
|
2867
|
+
type StructuredErrorCauseInput = {
|
|
2868
|
+
code?: string;
|
|
2869
|
+
category?: StructuredErrorCategory;
|
|
2870
|
+
retryability?: ErrorRetryability;
|
|
2871
|
+
phase?: StructuredErrorPhase;
|
|
2872
|
+
message: string;
|
|
2873
|
+
cause?: StructuredErrorCauseInput;
|
|
2874
|
+
};
|
|
2875
|
+
declare const StructuredErrorSchema: ZodObject<{
|
|
2876
|
+
code: ZodString;
|
|
2877
|
+
category: ZodEnum<{
|
|
2878
|
+
auth: "auth";
|
|
2879
|
+
authorization: "authorization";
|
|
2880
|
+
cancelled: "cancelled";
|
|
2881
|
+
configuration: "configuration";
|
|
2882
|
+
conflict: "conflict";
|
|
2883
|
+
dependency: "dependency";
|
|
2884
|
+
internal: "internal";
|
|
2885
|
+
not_found: "not_found";
|
|
2886
|
+
protocol: "protocol";
|
|
2887
|
+
rate_limit: "rate_limit";
|
|
2888
|
+
timeout: "timeout";
|
|
2889
|
+
unavailable: "unavailable";
|
|
2890
|
+
validation: "validation";
|
|
2891
|
+
}>;
|
|
2892
|
+
retryability: ZodEnum<{
|
|
2893
|
+
after_auth: "after_auth";
|
|
2894
|
+
backoff: "backoff";
|
|
2895
|
+
immediate: "immediate";
|
|
2896
|
+
never: "never";
|
|
2897
|
+
}>;
|
|
2898
|
+
phase: ZodEnum<{
|
|
2899
|
+
authentication: "authentication";
|
|
2900
|
+
authorization: "authorization";
|
|
2901
|
+
configuration: "configuration";
|
|
2902
|
+
dispatch: "dispatch";
|
|
2903
|
+
persistence: "persistence";
|
|
2904
|
+
provider: "provider";
|
|
2905
|
+
request: "request";
|
|
2906
|
+
scheduler: "scheduler";
|
|
2907
|
+
serialization: "serialization";
|
|
2908
|
+
shutdown: "shutdown";
|
|
2909
|
+
socket: "socket";
|
|
2910
|
+
startup: "startup";
|
|
2911
|
+
transport: "transport";
|
|
2912
|
+
unknown: "unknown";
|
|
2913
|
+
validation: "validation";
|
|
2914
|
+
worker: "worker";
|
|
2915
|
+
}>;
|
|
2916
|
+
requestId: ZodOptional<ZodString>;
|
|
2917
|
+
message: ZodString;
|
|
2918
|
+
cause: ZodOptional<ZodType<StructuredErrorCauseInput, unknown, $ZodTypeInternals<StructuredErrorCauseInput, unknown>>>;
|
|
2919
|
+
}, $strict>;
|
|
2920
|
+
type StructuredErrorCategory = output<typeof StructuredErrorCategorySchema>;
|
|
2921
|
+
type ErrorRetryability = output<typeof ErrorRetryabilitySchema>;
|
|
2922
|
+
type StructuredErrorPhase = output<typeof StructuredErrorPhaseSchema>;
|
|
2923
|
+
type StructuredError = output<typeof StructuredErrorSchema>;
|
|
2924
|
+
//#endregion
|
|
2925
|
+
//#region ../../packages/shared/dist/index.d.mts
|
|
2926
|
+
//#region src/channel-name.d.ts
|
|
2927
|
+
/**
|
|
2928
|
+
* Release channel names. Kept free of Node.js imports so browser bundles and protocol schemas can
|
|
2929
|
+
* reference channels without pulling in `node:os`/`node:path`.
|
|
2930
|
+
*/
|
|
2931
|
+
declare const ChannelNameSchema: ZodEnum<{
|
|
2932
|
+
dev: "dev";
|
|
2933
|
+
prod: "prod";
|
|
2934
|
+
staging: "staging";
|
|
2935
|
+
}>;
|
|
2936
|
+
type ChannelName = output<typeof ChannelNameSchema>;
|
|
2937
|
+
//#endregion
|
|
2938
|
+
//#region src/channel.d.ts
|
|
2939
|
+
declare const ServiceIdSchema: ZodString;
|
|
2940
|
+
type ServiceId = output<typeof ServiceIdSchema>;
|
|
2941
|
+
interface ChannelConfig {
|
|
2942
|
+
binName: string;
|
|
2943
|
+
channel: ChannelName;
|
|
2944
|
+
defaultHome: string;
|
|
2945
|
+
defaultServerUrl?: string;
|
|
2946
|
+
displayName: string;
|
|
2947
|
+
packageName: string;
|
|
2948
|
+
serviceId: ServiceId;
|
|
2949
|
+
}
|
|
2950
|
+
declare const SessionCliCreateRequestSchema: ZodObject<{
|
|
2951
|
+
messageId: ZodString;
|
|
2952
|
+
message: ZodString;
|
|
2953
|
+
model: ZodOptional<ZodString>;
|
|
2954
|
+
reasoningEffort: ZodOptional<ZodString>;
|
|
2955
|
+
maxDurationMs: ZodOptional<ZodNumber>;
|
|
2956
|
+
}, $strict>;
|
|
2957
|
+
declare const SessionCliSendRequestSchema: ZodObject<{
|
|
2958
|
+
messageId: ZodString;
|
|
2959
|
+
targetSessionId: ZodString;
|
|
2960
|
+
message: ZodString;
|
|
2961
|
+
}, $strict>;
|
|
2962
|
+
declare const SessionCliCommandResponseSchema: ZodObject<{
|
|
2963
|
+
messageId: ZodString;
|
|
2964
|
+
status: ZodEnum<{
|
|
2965
|
+
accepted: "accepted";
|
|
2966
|
+
rejected: "rejected";
|
|
2967
|
+
unknown: "unknown";
|
|
2968
|
+
unreachable: "unreachable";
|
|
2969
|
+
}>;
|
|
2970
|
+
sessionId: ZodOptional<ZodString>;
|
|
2971
|
+
code: ZodOptional<ZodString>;
|
|
2972
|
+
}, $strict>;
|
|
2973
|
+
declare const SessionCliListQuerySchema: ZodObject<{
|
|
2974
|
+
recursive: ZodDefault<ZodBoolean>;
|
|
2975
|
+
limit: ZodDefault<ZodNumber>;
|
|
2976
|
+
cursor: ZodOptional<ZodString>;
|
|
2977
|
+
since: ZodOptional<ZodString>;
|
|
2978
|
+
}, $strict>;
|
|
2979
|
+
declare const SessionCliListResponseSchema: ZodObject<{
|
|
2980
|
+
items: ZodArray<ZodObject<{
|
|
2981
|
+
sessionId: ZodString;
|
|
2982
|
+
parentSessionId: ZodString;
|
|
2983
|
+
createdAt: ZodString;
|
|
2984
|
+
lastMessageAt: ZodString;
|
|
2985
|
+
lastDeliveryOutcome: ZodEnum<{
|
|
2986
|
+
accepted: "accepted";
|
|
2987
|
+
rejected: "rejected";
|
|
2988
|
+
unknown: "unknown";
|
|
2989
|
+
unreachable: "unreachable";
|
|
2990
|
+
}>;
|
|
2991
|
+
taskPreview: ZodString;
|
|
2992
|
+
}, $strict>>;
|
|
2993
|
+
nextCursor: ZodOptional<ZodString>;
|
|
2994
|
+
}, $strict>;
|
|
2995
|
+
type SessionCliCreateRequest = output<typeof SessionCliCreateRequestSchema>;
|
|
2996
|
+
type SessionCliSendRequest = output<typeof SessionCliSendRequestSchema>;
|
|
2997
|
+
type SessionCliCommandResponse = output<typeof SessionCliCommandResponseSchema>;
|
|
2998
|
+
type SessionCliListQuery = output<typeof SessionCliListQuerySchema>;
|
|
2999
|
+
type SessionCliListResponse = output<typeof SessionCliListResponseSchema>;
|
|
3000
|
+
//#endregion
|
|
3001
|
+
//#region ../../packages/client/dist/index.d.mts
|
|
3002
|
+
interface RequestOptions {
|
|
3003
|
+
signal?: AbortSignal;
|
|
3004
|
+
timeoutMs?: number;
|
|
3005
|
+
requestId?: string;
|
|
3006
|
+
}
|
|
3007
|
+
interface OpenTagApiConstructorOptions {
|
|
3008
|
+
fetchImpl?: typeof fetch;
|
|
3009
|
+
timeoutMs?: number;
|
|
3010
|
+
}
|
|
3011
|
+
declare class OpenTagApi {
|
|
3012
|
+
#private;
|
|
3013
|
+
constructor(serverUrl: string, fetchOrOptions?: typeof fetch | OpenTagApiConstructorOptions, options?: OpenTagApiConstructorOptions);
|
|
3014
|
+
exchangeConnectCode(code: string, expectedUserId?: string, options?: RequestOptions): Promise<ConnectCodeExchangeResponse>;
|
|
3015
|
+
exchangeComputerConnectCode(input: ComputerConnectCodeExchangeRequest, options?: RequestOptions): Promise<ComputerConnectCodeExchangeResponse>;
|
|
3016
|
+
refresh(refreshToken: string, options?: RequestOptions): Promise<RefreshTokenResponse>;
|
|
3017
|
+
me(accessToken: string, options?: RequestOptions): Promise<MeResponse>;
|
|
3018
|
+
issueComputerConnectCode(accessToken: string, options?: RequestOptions): Promise<ComputerConnectCodeIssueResponse>;
|
|
3019
|
+
getComputerConnectCodeStatus(accessToken: string, connectCodeId: string, options?: RequestOptions): Promise<ComputerConnectCodeStatus>;
|
|
3020
|
+
listAccountComputers(accessToken: string, options?: RequestOptions): Promise<ListAccountComputersResponse>;
|
|
3021
|
+
createAgent(accessToken: string, input: CreateAgentRequest, options?: RequestOptions): Promise<AgentAdminConfig>;
|
|
3022
|
+
listAgents(accessToken: string, options?: RequestOptions): Promise<ListAgentsResponse>;
|
|
3023
|
+
getAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentDetail>;
|
|
3024
|
+
getAgentUsage(accessToken: string, agentId: string, windowDays: AgentUsageWindowDays, options?: RequestOptions): Promise<AgentUsageDetail>;
|
|
3025
|
+
getAgentConfig(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentAdminConfig>;
|
|
3026
|
+
testAgentRuntime(accessToken: string, agentId: string, input: AgentRuntimeTestRequest, options?: RequestOptions): Promise<AgentRuntimeTestResponse>;
|
|
3027
|
+
rebindAgentComputer(accessToken: string, agentId: string, computerId: string): Promise<AgentAdminConfig>;
|
|
3028
|
+
updateAgent(accessToken: string, agentId: string, input: UpdateAgentRequest, options?: RequestOptions): Promise<AgentAdminConfig>;
|
|
3029
|
+
suspendAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentAdminConfig>;
|
|
3030
|
+
reactivateAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<AgentAdminConfig>;
|
|
3031
|
+
deleteAgent(accessToken: string, agentId: string, options?: RequestOptions): Promise<void>;
|
|
3032
|
+
getAgentImBinding(accessToken: string, agentId: string, options?: RequestOptions): Promise<ImBindingSummary | undefined>;
|
|
3033
|
+
getAgentImBindingConfig(accessToken: string, agentId: string, options?: RequestOptions): Promise<ImBindingAdminDetail | undefined>;
|
|
3034
|
+
createFeishuSetupAttempt(accessToken: string, agentId: string, intent?: "create" | "reauthorize" | "replace", options?: RequestOptions): Promise<FeishuSetupAttempt>;
|
|
3035
|
+
getFeishuSetupAttempt(accessToken: string, attemptId: string, options?: RequestOptions): Promise<FeishuSetupAttempt>;
|
|
3036
|
+
cancelFeishuSetupAttempt(accessToken: string, attemptId: string, options?: RequestOptions): Promise<FeishuSetupAttempt>;
|
|
3037
|
+
startSlackOAuth(accessToken: string, agentId: string, input: StartSlackOAuthRequest, options?: RequestOptions): Promise<StartSlackOAuthResponse>;
|
|
3038
|
+
getImBindingDiagnostics(accessToken: string, imBindingId: string, options?: RequestOptions): Promise<ImBindingDiagnostics>;
|
|
3039
|
+
disableImBinding(accessToken: string, imBindingId: string, options?: RequestOptions): Promise<void>;
|
|
3040
|
+
openImResource(machineToken: string, imMessageId: string, ordinal: number, scope: {
|
|
3041
|
+
sessionId: string;
|
|
3042
|
+
instanceId: string;
|
|
3043
|
+
placementGeneration: number;
|
|
3044
|
+
}, options?: RequestOptions): Promise<Response>;
|
|
3045
|
+
listRuntimeDurableWork(machineToken: string, kind: RuntimeDurableWorkKind, options?: RequestOptions): Promise<RuntimeDurableWorkRecord[]>;
|
|
3046
|
+
writeRuntimeDurableWork(machineToken: string, record: RuntimeDurableWorkRecord, options?: RequestOptions): Promise<void>;
|
|
3047
|
+
createInternalSession(proof: string, input: SessionCliCreateRequest, options?: RequestOptions): Promise<SessionCliCommandResponse>;
|
|
3048
|
+
sendSessionMessage(proof: string, input: SessionCliSendRequest, options?: RequestOptions): Promise<SessionCliCommandResponse>;
|
|
3049
|
+
listInternalSessions(proof: string, input: SessionCliListQuery, options?: RequestOptions): Promise<SessionCliListResponse>;
|
|
3050
|
+
}
|
|
3051
|
+
//#endregion
|
|
3052
|
+
//#region src/auth/credentials.d.ts
|
|
3053
|
+
interface StoredCredentials {
|
|
3054
|
+
accessToken: string;
|
|
3055
|
+
accessTokenExpiresAt: string;
|
|
3056
|
+
refreshToken: string;
|
|
3057
|
+
serverUrl: string;
|
|
3058
|
+
}
|
|
3059
|
+
//#endregion
|
|
3060
|
+
//#region src/auth/machine-credentials.d.ts
|
|
3061
|
+
interface MachineComputerCredential {
|
|
3062
|
+
computerId: string;
|
|
3063
|
+
installationId: string;
|
|
3064
|
+
machineToken: string;
|
|
3065
|
+
serverUrl: string;
|
|
3066
|
+
}
|
|
3067
|
+
interface StoredMachineCredentials {
|
|
3068
|
+
version: 3;
|
|
3069
|
+
computer: MachineComputerCredential;
|
|
3070
|
+
}
|
|
3071
|
+
//#endregion
|
|
3072
|
+
//#region src/observability/logger.d.ts
|
|
3073
|
+
type ClientLogBindings = Readonly<Record<string, unknown>>;
|
|
3074
|
+
interface ClientLogger {
|
|
3075
|
+
child(bindings: ClientLogBindings): ClientLogger;
|
|
3076
|
+
debug(fields: ClientLogBindings, message: string): void;
|
|
3077
|
+
error(fields: ClientLogBindings, message: string): void;
|
|
3078
|
+
info(fields: ClientLogBindings, message: string): void;
|
|
3079
|
+
warn(fields: ClientLogBindings, message: string): void;
|
|
3080
|
+
}
|
|
3081
|
+
//#endregion
|
|
3082
|
+
//#region src/runtime/agent-runtime-installation.d.ts
|
|
3083
|
+
type AgentRuntimeExecutableSource = "explicit" | "caller-path" | "well-known" | "login-shell" | "version-manager" | "desktop-app";
|
|
3084
|
+
type AgentRuntimeCliInstallation = {
|
|
3085
|
+
provider: "codex" | "claude-code";
|
|
3086
|
+
displayName: string;
|
|
3087
|
+
status: "installed";
|
|
3088
|
+
path: string;
|
|
3089
|
+
source: AgentRuntimeExecutableSource;
|
|
3090
|
+
} | {
|
|
3091
|
+
provider: "codex" | "claude-code";
|
|
3092
|
+
displayName: string;
|
|
3093
|
+
status: "not-installed";
|
|
3094
|
+
} | {
|
|
3095
|
+
provider: "codex" | "claude-code";
|
|
3096
|
+
displayName: string;
|
|
3097
|
+
status: "unknown";
|
|
3098
|
+
detail: string;
|
|
3099
|
+
};
|
|
3100
|
+
//#endregion
|
|
3101
|
+
//#region src/runtime/computer-identity.d.ts
|
|
3102
|
+
interface ComputerIdentity {
|
|
3103
|
+
version: 2;
|
|
3104
|
+
computerId: string;
|
|
3105
|
+
serverUrl: string;
|
|
3106
|
+
}
|
|
3107
|
+
//#endregion
|
|
3108
|
+
//#region src/runtime/provider-cli/types.d.ts
|
|
3109
|
+
/**
|
|
3110
|
+
* A managed Provider CLI is either Feishu/Lark (`lark-cli`) or Slack (`slack`).
|
|
3111
|
+
* The provider identifier reuses the canonical IM provider vocabulary.
|
|
3112
|
+
*/
|
|
3113
|
+
type ProviderCliProvider = ImCliProvider;
|
|
3114
|
+
type ProviderCliTrust = "catalog-verified" | "compatible-unverified";
|
|
3115
|
+
/** Local Provider CLI state machine from the management design; `checking` is an in-flight observation. */
|
|
3116
|
+
type ProviderCliLocalState = "checking" | "absent" | "ready" | "unavailable";
|
|
3117
|
+
/**
|
|
3118
|
+
* Stable local diagnostic codes. These stay local to the machine; only the coarse
|
|
3119
|
+
* readiness mapping may ever leave the device.
|
|
3120
|
+
*/
|
|
3121
|
+
type ProviderCliDiagnosticCode = "not_installed" | "global_bin_unavailable" | "launcher_invalid" | "global_command_shadowed" | "external_path_invalid" | "external_not_detected" | "external_candidate_changed" | "external_candidate_unverified" | "artifact_drifted" | "integrity_failed" | "version_incompatible" | "probe_failed" | "install_incomplete" | "credential_unavailable" | "unsupported_platform" | "operation_in_progress" | "selection_invalid";
|
|
3122
|
+
/** Warning codes that never downgrade readiness on their own. */
|
|
3123
|
+
type ProviderCliWarningCode = "global_command_shadowed" | "global_path_not_configured" | "external_candidate_unverified";
|
|
3124
|
+
interface ProviderCliDiagnostic {
|
|
3125
|
+
readonly code: ProviderCliDiagnosticCode;
|
|
3126
|
+
readonly remediation?: string;
|
|
3127
|
+
}
|
|
3128
|
+
interface ProviderCliWarning {
|
|
3129
|
+
readonly code: ProviderCliWarningCode;
|
|
3130
|
+
readonly remediation?: string;
|
|
3131
|
+
}
|
|
3132
|
+
interface ProviderCliSelectionSummary {
|
|
3133
|
+
readonly kind: "managed" | "external";
|
|
3134
|
+
readonly path: string;
|
|
3135
|
+
readonly version: string;
|
|
3136
|
+
readonly trust: ProviderCliTrust;
|
|
3137
|
+
readonly generation: number;
|
|
3138
|
+
}
|
|
3139
|
+
/** Read-only inspection result for one provider. */
|
|
3140
|
+
interface ProviderCliInspection {
|
|
3141
|
+
readonly provider: ProviderCliProvider;
|
|
3142
|
+
readonly state: Exclude<ProviderCliLocalState, "checking">;
|
|
3143
|
+
readonly readiness: "ready" | "install" | "unavailable";
|
|
3144
|
+
readonly selection?: ProviderCliSelectionSummary;
|
|
3145
|
+
readonly fingerprint?: string;
|
|
3146
|
+
readonly launcher: {
|
|
3147
|
+
readonly path: string;
|
|
3148
|
+
readonly status: "valid" | "missing" | "invalid" | "mismatch";
|
|
3149
|
+
};
|
|
3150
|
+
readonly globalCommand: {
|
|
3151
|
+
readonly active: boolean;
|
|
3152
|
+
readonly path?: string;
|
|
3153
|
+
readonly resolvedPath?: string;
|
|
3154
|
+
};
|
|
3155
|
+
readonly warnings: readonly ProviderCliWarning[];
|
|
3156
|
+
readonly diagnostic?: ProviderCliDiagnostic;
|
|
3157
|
+
}
|
|
3158
|
+
type ProviderCliEnsureAction = "noop" | "selected-existing" | "installed-managed" | "failed";
|
|
3159
|
+
type ProviderCliPhase = "detect" | "select" | "managed-install" | "verify";
|
|
3160
|
+
interface ProviderCliPhaseRecord {
|
|
3161
|
+
readonly phase: ProviderCliPhase;
|
|
3162
|
+
readonly status: "started" | "completed" | "failed";
|
|
3163
|
+
/** Bounded single-line human detail; never carries credentials or raw child-process output. */
|
|
3164
|
+
readonly detail?: string;
|
|
3165
|
+
}
|
|
3166
|
+
interface ProviderCliCandidateReport {
|
|
3167
|
+
readonly path: string;
|
|
3168
|
+
readonly version?: string;
|
|
3169
|
+
readonly trust?: ProviderCliTrust;
|
|
3170
|
+
readonly disposition: "selected" | "ignored";
|
|
3171
|
+
readonly reason: string;
|
|
3172
|
+
}
|
|
3173
|
+
/** Stable ensure result shape; the `--json` document serializes this verbatim per provider. */
|
|
3174
|
+
interface ProviderCliEnsureResult {
|
|
3175
|
+
readonly ok: boolean;
|
|
3176
|
+
readonly provider: ProviderCliProvider;
|
|
3177
|
+
readonly action: ProviderCliEnsureAction;
|
|
3178
|
+
readonly phases: readonly ProviderCliPhaseRecord[];
|
|
3179
|
+
readonly selected?: {
|
|
3180
|
+
readonly path: string;
|
|
3181
|
+
readonly version: string;
|
|
3182
|
+
readonly source: string;
|
|
3183
|
+
readonly trust: ProviderCliTrust;
|
|
3184
|
+
};
|
|
3185
|
+
readonly candidates: readonly ProviderCliCandidateReport[];
|
|
3186
|
+
readonly readiness: "ready" | "unavailable";
|
|
3187
|
+
readonly globalCommand: {
|
|
3188
|
+
readonly active: boolean;
|
|
3189
|
+
readonly path?: string;
|
|
3190
|
+
readonly resolvedPath?: string;
|
|
3191
|
+
};
|
|
3192
|
+
readonly warnings: readonly ProviderCliWarning[];
|
|
3193
|
+
readonly diagnostic?: ProviderCliDiagnostic;
|
|
3194
|
+
readonly dryRun?: boolean;
|
|
3195
|
+
}
|
|
3196
|
+
//#endregion
|
|
3197
|
+
//#region src/runtime/provider-cli/catalog.d.ts
|
|
3198
|
+
/**
|
|
3199
|
+
* Reviewed Provider CLI catalog.
|
|
3200
|
+
*
|
|
3201
|
+
* The catalog is the only source of managed-install truth: version, platform asset,
|
|
3202
|
+
* digests, size bounds, probe contract, and license are reviewed static data that ship
|
|
3203
|
+
* in an OpenTag release. Nothing here is fetched from a mutable remote `latest`
|
|
3204
|
+
* manifest. Probe contracts run without credentials and never call a provider API.
|
|
3205
|
+
*
|
|
3206
|
+
* Current entries were reviewed on 2026-08-30:
|
|
3207
|
+
* - lark-cli v1.0.92 archive digests match the upstream-published `checksums.txt` from
|
|
3208
|
+
* https://github.com/larksuite/cli/releases/tag/v1.0.92; executable digests were
|
|
3209
|
+
* computed from those verified archives.
|
|
3210
|
+
* - Slack CLI v4.7.0 archives were downloaded from the official
|
|
3211
|
+
* https://downloads.slack-edge.com/slack-cli/ prefix (Slack publishes no checksum
|
|
3212
|
+
* file); digests were computed from those archives.
|
|
3213
|
+
*/
|
|
3214
|
+
interface ProviderCliProbeContract {
|
|
3215
|
+
/** Arguments that print the version, e.g. `["--version"]` or `["version"]`. */
|
|
3216
|
+
readonly versionArgs: readonly string[];
|
|
3217
|
+
/** Arguments proving the required command surface, e.g. `["im", "--help"]`. */
|
|
3218
|
+
readonly surfaceArgs: readonly string[];
|
|
3219
|
+
/** RegExp source whose first capture group is the semantic version. */
|
|
3220
|
+
readonly versionPattern: string;
|
|
3221
|
+
readonly timeoutMs: number;
|
|
3222
|
+
readonly maxOutputBytes: number;
|
|
3223
|
+
}
|
|
3224
|
+
interface ProviderCliCatalogArtifact {
|
|
3225
|
+
readonly platform: "darwin" | "linux";
|
|
3226
|
+
readonly arch: "arm64" | "x64";
|
|
3227
|
+
readonly archiveType: "tar.gz";
|
|
3228
|
+
/** Official artifact URL; the reviewed catalog is the trust root for this location. */
|
|
3229
|
+
readonly url: string;
|
|
3230
|
+
/** SHA-256 of the archive. */
|
|
3231
|
+
readonly sha256: string;
|
|
3232
|
+
/** Exact archive size; doubles as the bounded download limit. */
|
|
3233
|
+
readonly archiveBytes: number;
|
|
3234
|
+
/** Hard cap on the decompressed archive stream (decompression-bomb guard). */
|
|
3235
|
+
readonly maxExtractedBytes: number;
|
|
3236
|
+
/** Expected executable member path inside the archive (and below the version dir). */
|
|
3237
|
+
readonly executablePath: string;
|
|
3238
|
+
/** SHA-256 of the extracted executable; also the external `catalog-verified` trust digest. */
|
|
3239
|
+
readonly executableSha256: string;
|
|
3240
|
+
readonly executableBytes: number;
|
|
3241
|
+
}
|
|
3242
|
+
interface ProviderCliCatalogEntry {
|
|
3243
|
+
readonly provider: ProviderCliProvider;
|
|
3244
|
+
/** Native command name visible to users and Agents. */
|
|
3245
|
+
readonly command: "lark-cli" | "slack";
|
|
3246
|
+
readonly displayName: string;
|
|
3247
|
+
/** Exact version a managed install publishes. */
|
|
3248
|
+
readonly version: string;
|
|
3249
|
+
/** Semver range an external candidate must satisfy to be compatible. */
|
|
3250
|
+
readonly compatibility: string;
|
|
3251
|
+
readonly probes: ProviderCliProbeContract;
|
|
3252
|
+
/** Update-check suppression applied by the launcher for managed targets only. */
|
|
3253
|
+
readonly managedEnvironment: Readonly<Record<string, string>>;
|
|
3254
|
+
/** Global flags the launcher prepends for managed targets only. */
|
|
3255
|
+
readonly managedArguments: readonly string[];
|
|
3256
|
+
readonly license: {
|
|
3257
|
+
readonly name: string;
|
|
3258
|
+
readonly copyright: string;
|
|
3259
|
+
readonly notices: string;
|
|
3260
|
+
};
|
|
3261
|
+
readonly artifacts: readonly ProviderCliCatalogArtifact[];
|
|
3262
|
+
}
|
|
3263
|
+
//#endregion
|
|
3264
|
+
//#region src/runtime/integration-cli-installation.d.ts
|
|
3265
|
+
type IntegrationCliId = "feishu" | "slack";
|
|
3266
|
+
type IntegrationCliInstallation = {
|
|
3267
|
+
cli: IntegrationCliId;
|
|
3268
|
+
displayName: string;
|
|
3269
|
+
status: "installed";
|
|
3270
|
+
path: string;
|
|
3271
|
+
source: AgentRuntimeExecutableSource;
|
|
3272
|
+
} | {
|
|
3273
|
+
cli: IntegrationCliId;
|
|
3274
|
+
displayName: string;
|
|
3275
|
+
status: "not-installed";
|
|
3276
|
+
} | {
|
|
3277
|
+
cli: IntegrationCliId;
|
|
3278
|
+
displayName: string;
|
|
3279
|
+
status: "unknown";
|
|
3280
|
+
detail: string;
|
|
3281
|
+
};
|
|
3282
|
+
//#endregion
|
|
3283
|
+
//#region src/runtime/local-computer-configuration.d.ts
|
|
3284
|
+
type LocalConfigurationStatus = "valid" | "missing" | "invalid";
|
|
3285
|
+
interface LocalComputerConfigurationInspection {
|
|
3286
|
+
identity: {
|
|
3287
|
+
status: LocalConfigurationStatus;
|
|
3288
|
+
value?: ComputerIdentity;
|
|
3289
|
+
detail?: string;
|
|
3290
|
+
};
|
|
3291
|
+
credentials: {
|
|
3292
|
+
status: LocalConfigurationStatus;
|
|
3293
|
+
value?: StoredMachineCredentials;
|
|
3294
|
+
detail?: string;
|
|
3295
|
+
};
|
|
3296
|
+
binding: {
|
|
3297
|
+
status: LocalConfigurationStatus;
|
|
3298
|
+
credentialCount: number;
|
|
3299
|
+
serverUrl?: string;
|
|
3300
|
+
detail?: string;
|
|
3301
|
+
};
|
|
3302
|
+
}
|
|
3303
|
+
//#endregion
|
|
3304
|
+
//#region src/runtime/provider-cli/probe.d.ts
|
|
3305
|
+
/** Injectable bounded child-process runner; the default never uses a shell. */
|
|
3306
|
+
type ProviderCliExecFile = (file: string, args: readonly string[], options: {
|
|
3307
|
+
env: NodeJS.ProcessEnv;
|
|
3308
|
+
timeout: number;
|
|
3309
|
+
maxBuffer: number;
|
|
3310
|
+
windowsHide: boolean;
|
|
3311
|
+
}) => Promise<{
|
|
3312
|
+
stdout: string;
|
|
3313
|
+
stderr: string;
|
|
3314
|
+
}>;
|
|
3315
|
+
//#endregion
|
|
3316
|
+
//#region src/runtime/provider-cli/detector.d.ts
|
|
3317
|
+
/**
|
|
3318
|
+
* User-facing external detection: one bounded, read-only scan of exact provider command
|
|
3319
|
+
* names in the invoking CLI process's PATH. It never scans version managers or home
|
|
3320
|
+
* trees, never starts a login shell, and never touches credentials or provider APIs.
|
|
3321
|
+
*/
|
|
3322
|
+
interface ProviderCliCandidate {
|
|
3323
|
+
/** Ephemeral identity valid only for this detection pass. */
|
|
3324
|
+
readonly id: string;
|
|
3325
|
+
readonly provider: ProviderCliProvider;
|
|
3326
|
+
readonly kind: "external" | "managed";
|
|
3327
|
+
/** Canonical realpath of the exact executable this candidate would run. */
|
|
3328
|
+
readonly path: string;
|
|
3329
|
+
/** PATH directory that contributed the candidate, or `selection`. */
|
|
3330
|
+
readonly sourceDir: string;
|
|
3331
|
+
readonly version: string;
|
|
3332
|
+
readonly trust: ProviderCliTrust;
|
|
3333
|
+
readonly fingerprint: string;
|
|
3334
|
+
/** Managed archive digest when the candidate is a managed artifact. */
|
|
3335
|
+
readonly managedDigest?: string;
|
|
3336
|
+
/** Effective PATH order index; candidates not on PATH sort last. */
|
|
3337
|
+
readonly pathRank: number;
|
|
3338
|
+
/** True when the candidate is the current persisted selection. */
|
|
3339
|
+
readonly incumbent: boolean;
|
|
3340
|
+
}
|
|
3341
|
+
/** Bounded artifact download; the default implementation follows redirects off the reviewed URL. */
|
|
3342
|
+
type ProviderCliFetcher = (options: {
|
|
3343
|
+
url: string;
|
|
3344
|
+
maxBytes: number;
|
|
3345
|
+
timeoutMs: number;
|
|
3346
|
+
}) => Promise<Uint8Array>;
|
|
3347
|
+
type ProviderCliPhaseEvent = ProviderCliPhaseRecord & {
|
|
3348
|
+
readonly provider: ProviderCliProvider;
|
|
3349
|
+
};
|
|
3350
|
+
//#endregion
|
|
3351
|
+
//#region src/core/command/policy.d.ts
|
|
3352
|
+
/** Process exit values shared by every user-facing CLI command. */
|
|
3353
|
+
declare const EXIT_CODES$1: {
|
|
3354
|
+
readonly success: 0;
|
|
3355
|
+
readonly failure: 1;
|
|
3356
|
+
readonly usage: 2;
|
|
3357
|
+
readonly serviceUnavailable: 3;
|
|
3358
|
+
readonly interrupted: 130;
|
|
3359
|
+
};
|
|
3360
|
+
type CommandExitCode = (typeof EXIT_CODES$1)[keyof typeof EXIT_CODES$1];
|
|
3361
|
+
type CommandErrorCategory = StructuredError["category"];
|
|
3362
|
+
type CommandRetryability = ErrorRetryability;
|
|
3363
|
+
type CommandPhase = StructuredError["phase"];
|
|
3364
|
+
type CommandErrorCodeFields = {
|
|
3365
|
+
code: string;
|
|
3366
|
+
category: CommandErrorCategory;
|
|
3367
|
+
};
|
|
3368
|
+
type CommandErrorRetryFields = {
|
|
3369
|
+
retryability: CommandRetryability;
|
|
3370
|
+
phase: CommandPhase;
|
|
3371
|
+
};
|
|
3372
|
+
type CommandErrorRequiredFields = CommandErrorCodeFields & CommandErrorRetryFields;
|
|
3373
|
+
type CommandErrorFields = CommandErrorRequiredFields & {
|
|
3374
|
+
requestId?: string;
|
|
3375
|
+
};
|
|
3376
|
+
/** Structured, transport-neutral CLI failure metadata. The Error message is the human detail. */
|
|
3377
|
+
declare class CommandError$1 extends Error {
|
|
3378
|
+
readonly code: string;
|
|
3379
|
+
readonly category: CommandErrorCategory;
|
|
3380
|
+
readonly retryability: CommandRetryability;
|
|
3381
|
+
readonly phase: CommandPhase;
|
|
3382
|
+
readonly requestId?: string;
|
|
3383
|
+
readonly structuredError: StructuredError;
|
|
3384
|
+
constructor(fields: CommandErrorFields, message: string, options?: ErrorOptions);
|
|
3385
|
+
toStructuredError(): StructuredError;
|
|
3386
|
+
}
|
|
3387
|
+
type SuccessCommandResult<T> = {
|
|
3388
|
+
ok: true;
|
|
3389
|
+
value: T;
|
|
3390
|
+
exitCode: typeof EXIT_CODES$1.success;
|
|
3391
|
+
};
|
|
3392
|
+
type FailureCommandResultBase<T> = {
|
|
3393
|
+
ok: false;
|
|
3394
|
+
error: CommandError$1;
|
|
3395
|
+
value?: T;
|
|
3396
|
+
};
|
|
3397
|
+
type FailureCommandResult<T> = FailureCommandResultBase<T> & {
|
|
3398
|
+
exitCode: Exclude<CommandExitCode, 0>;
|
|
3399
|
+
};
|
|
3400
|
+
type CommandResult<T> = SuccessCommandResult<T> | FailureCommandResult<T>;
|
|
3401
|
+
type CommandFormatValueOptions<T> = {
|
|
3402
|
+
formatValue?: (value: T) => string;
|
|
3403
|
+
};
|
|
3404
|
+
type CommandFormatWriterOptions = {
|
|
3405
|
+
stdout?: (chunk: string) => void;
|
|
3406
|
+
stderr?: (chunk: string) => void;
|
|
3407
|
+
};
|
|
3408
|
+
type CommandFormatOptions<T> = CommandFormatValueOptions<T> & CommandFormatWriterOptions;
|
|
3409
|
+
type CommandPresentationOptions<T> = {
|
|
3410
|
+
json?: boolean;
|
|
3411
|
+
} & CommandFormatOptions<T>;
|
|
3412
|
+
type CommandExecutionOptions<T> = CommandPresentationOptions<T> & {
|
|
3413
|
+
logger?: ClientLogger;
|
|
3414
|
+
phase?: CommandPhase;
|
|
3415
|
+
};
|
|
3416
|
+
/** Convert errors from Commander, Zod, the API, and Node into one local contract. */
|
|
3417
|
+
declare function toCommandError$1(error: unknown, phase?: CommandPhase): CommandError$1;
|
|
3418
|
+
/** Present a result once. Human successes use stdout; all failures use redacted stderr. */
|
|
3419
|
+
declare function presentCommand$1<T>(result: CommandResult<T>, options?: CommandPresentationOptions<T>): CommandExitCode;
|
|
3420
|
+
/** Run an operation through the shared result and presentation path. */
|
|
3421
|
+
declare function executeCommand$1<T>(operation: () => Promise<T>, options?: CommandExecutionOptions<T>): Promise<CommandExitCode>;
|
|
3422
|
+
declare function commandExitCode$1(error: CommandError$1): Exclude<CommandExitCode, typeof EXIT_CODES$1.success>;
|
|
3423
|
+
//#endregion
|
|
3424
|
+
//#region src/build-info.d.ts
|
|
3425
|
+
declare const CHANNEL: ChannelName;
|
|
3426
|
+
declare const CLI_PACKAGE_NAME: string;
|
|
3427
|
+
declare const CLI_VERSION: string;
|
|
3428
|
+
//#endregion
|
|
3429
|
+
//#region ../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/typings/index.d.ts
|
|
3430
|
+
// Type definitions for commander
|
|
3431
|
+
// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
|
|
3432
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3433
|
+
// This is a trick to encourage editor to suggest the known literals while still
|
|
3434
|
+
// allowing any BaseType value.
|
|
3435
|
+
// References:
|
|
3436
|
+
// - https://github.com/microsoft/TypeScript/issues/29729
|
|
3437
|
+
// - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
|
|
3438
|
+
// - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
|
|
3439
|
+
type LiteralUnion<LiteralType, BaseType extends string | number> = LiteralType | (BaseType & Record<never, never>);
|
|
3440
|
+
declare class CommanderError extends Error {
|
|
3441
|
+
code: string;
|
|
3442
|
+
exitCode: number;
|
|
3443
|
+
message: string;
|
|
3444
|
+
nestedError?: string;
|
|
3445
|
+
/**
|
|
3446
|
+
* Constructs the CommanderError class
|
|
3447
|
+
* @param exitCode - suggested exit code which could be used with process.exit
|
|
3448
|
+
* @param code - an id string representing the error
|
|
3449
|
+
* @param message - human-readable description of the error
|
|
3450
|
+
*/
|
|
3451
|
+
constructor(exitCode: number, code: string, message: string);
|
|
3452
|
+
}
|
|
3453
|
+
interface ErrorOptions$1 {
|
|
3454
|
+
// optional parameter for error()
|
|
3455
|
+
/** an id string representing the error */
|
|
3456
|
+
code?: string;
|
|
3457
|
+
/** suggested exit code which could be used with process.exit */
|
|
3458
|
+
exitCode?: number;
|
|
3459
|
+
}
|
|
3460
|
+
declare class Argument {
|
|
3461
|
+
description: string;
|
|
3462
|
+
required: boolean;
|
|
3463
|
+
variadic: boolean;
|
|
3464
|
+
defaultValue?: any;
|
|
3465
|
+
defaultValueDescription?: string;
|
|
3466
|
+
parseArg?: <T>(value: string, previous: T) => T;
|
|
3467
|
+
argChoices?: string[];
|
|
3468
|
+
/**
|
|
3469
|
+
* Initialize a new command argument with the given name and description.
|
|
3470
|
+
* The default is that the argument is required, and you can explicitly
|
|
3471
|
+
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
|
3472
|
+
*/
|
|
3473
|
+
constructor(arg: string, description?: string);
|
|
3474
|
+
/**
|
|
3475
|
+
* Return argument name.
|
|
3476
|
+
*/
|
|
3477
|
+
name(): string;
|
|
3478
|
+
/**
|
|
3479
|
+
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
3480
|
+
*/
|
|
3481
|
+
default(value: unknown, description?: string): this;
|
|
3482
|
+
/**
|
|
3483
|
+
* Set the custom handler for processing CLI command arguments into argument values.
|
|
3484
|
+
*/
|
|
3485
|
+
argParser<T>(fn: (value: string, previous: T) => T): this;
|
|
3486
|
+
/**
|
|
3487
|
+
* Only allow argument value to be one of choices.
|
|
3488
|
+
*/
|
|
3489
|
+
choices(values: readonly string[]): this;
|
|
3490
|
+
/**
|
|
3491
|
+
* Make argument required.
|
|
3492
|
+
*/
|
|
3493
|
+
argRequired(): this;
|
|
3494
|
+
/**
|
|
3495
|
+
* Make argument optional.
|
|
3496
|
+
*/
|
|
3497
|
+
argOptional(): this;
|
|
3498
|
+
}
|
|
3499
|
+
declare class Option {
|
|
3500
|
+
flags: string;
|
|
3501
|
+
description: string;
|
|
3502
|
+
required: boolean; // A value must be supplied when the option is specified.
|
|
3503
|
+
optional: boolean; // A value is optional when the option is specified.
|
|
3504
|
+
variadic: boolean;
|
|
3505
|
+
mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
|
|
3506
|
+
short?: string;
|
|
3507
|
+
long?: string;
|
|
3508
|
+
negate: boolean;
|
|
3509
|
+
defaultValue?: any;
|
|
3510
|
+
defaultValueDescription?: string;
|
|
3511
|
+
presetArg?: unknown;
|
|
3512
|
+
envVar?: string;
|
|
3513
|
+
parseArg?: <T>(value: string, previous: T) => T;
|
|
3514
|
+
hidden: boolean;
|
|
3515
|
+
argChoices?: string[];
|
|
3516
|
+
helpGroupHeading?: string;
|
|
3517
|
+
constructor(flags: string, description?: string);
|
|
3518
|
+
/**
|
|
3519
|
+
* Set the default value, and optionally supply the description to be displayed in the help.
|
|
3520
|
+
*/
|
|
3521
|
+
default(value: unknown, description?: string): this;
|
|
3522
|
+
/**
|
|
3523
|
+
* Preset to use when option used without option-argument, especially optional but also boolean and negated.
|
|
3524
|
+
* The custom processing (parseArg) is called.
|
|
3525
|
+
*
|
|
3526
|
+
* @example
|
|
3527
|
+
* ```ts
|
|
3528
|
+
* new Option('--color').default('GREYSCALE').preset('RGB');
|
|
3529
|
+
* new Option('--donate [amount]').preset('20').argParser(parseFloat);
|
|
3530
|
+
* ```
|
|
3531
|
+
*/
|
|
3532
|
+
preset(arg: unknown): this;
|
|
3533
|
+
/**
|
|
3534
|
+
* Add option name(s) that conflict with this option.
|
|
3535
|
+
* An error will be displayed if conflicting options are found during parsing.
|
|
3536
|
+
*
|
|
3537
|
+
* @example
|
|
3538
|
+
* ```ts
|
|
3539
|
+
* new Option('--rgb').conflicts('cmyk');
|
|
3540
|
+
* new Option('--js').conflicts(['ts', 'jsx']);
|
|
3541
|
+
* ```
|
|
3542
|
+
*/
|
|
3543
|
+
conflicts(names: string | string[]): this;
|
|
3544
|
+
/**
|
|
3545
|
+
* Specify implied option values for when this option is set and the implied options are not.
|
|
3546
|
+
*
|
|
3547
|
+
* The custom processing (parseArg) is not called on the implied values.
|
|
3548
|
+
*
|
|
3549
|
+
* @example
|
|
3550
|
+
* program
|
|
3551
|
+
* .addOption(new Option('--log', 'write logging information to file'))
|
|
3552
|
+
* .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
|
|
3553
|
+
*/
|
|
3554
|
+
implies(optionValues: OptionValues): this;
|
|
3555
|
+
/**
|
|
3556
|
+
* Set environment variable to check for option value.
|
|
3557
|
+
*
|
|
3558
|
+
* An environment variables is only used if when processed the current option value is
|
|
3559
|
+
* undefined, or the source of the current value is 'default' or 'config' or 'env'.
|
|
3560
|
+
*/
|
|
3561
|
+
env(name: string): this;
|
|
3562
|
+
/**
|
|
3563
|
+
* Set the custom handler for processing CLI option arguments into option values.
|
|
3564
|
+
*/
|
|
3565
|
+
argParser<T>(fn: (value: string, previous: T) => T): this;
|
|
3566
|
+
/**
|
|
3567
|
+
* Whether the option is mandatory and must have a value after parsing.
|
|
3568
|
+
*/
|
|
3569
|
+
makeOptionMandatory(mandatory?: boolean): this;
|
|
3570
|
+
/**
|
|
3571
|
+
* Hide option in help.
|
|
3572
|
+
*/
|
|
3573
|
+
hideHelp(hide?: boolean): this;
|
|
3574
|
+
/**
|
|
3575
|
+
* Only allow option value to be one of choices.
|
|
3576
|
+
*/
|
|
3577
|
+
choices(values: readonly string[]): this;
|
|
3578
|
+
/**
|
|
3579
|
+
* Return option name.
|
|
3580
|
+
*/
|
|
3581
|
+
name(): string;
|
|
3582
|
+
/**
|
|
3583
|
+
* Return option name, in a camelcase format that can be used
|
|
3584
|
+
* as an object attribute key.
|
|
3585
|
+
*/
|
|
3586
|
+
attributeName(): string;
|
|
3587
|
+
/**
|
|
3588
|
+
* Set the help group heading.
|
|
3589
|
+
*/
|
|
3590
|
+
helpGroup(heading: string): this;
|
|
3591
|
+
/**
|
|
3592
|
+
* Return whether a boolean option.
|
|
3593
|
+
*
|
|
3594
|
+
* Options are one of boolean, negated, required argument, or optional argument.
|
|
3595
|
+
*/
|
|
3596
|
+
isBoolean(): boolean;
|
|
3597
|
+
}
|
|
3598
|
+
declare class Help {
|
|
3599
|
+
/** output helpWidth, long lines are wrapped to fit */
|
|
3600
|
+
helpWidth?: number;
|
|
3601
|
+
minWidthToWrap: number;
|
|
3602
|
+
sortSubcommands: boolean;
|
|
3603
|
+
sortOptions: boolean;
|
|
3604
|
+
showGlobalOptions: boolean;
|
|
3605
|
+
constructor();
|
|
3606
|
+
/*
|
|
3607
|
+
* prepareContext is called by Commander after applying overrides from `Command.configureHelp()`
|
|
3608
|
+
* and just before calling `formatHelp()`.
|
|
3609
|
+
*
|
|
3610
|
+
* Commander just uses the helpWidth and the others are provided for subclasses.
|
|
3611
|
+
*/
|
|
3612
|
+
prepareContext(contextOptions: {
|
|
3613
|
+
error?: boolean;
|
|
3614
|
+
helpWidth?: number;
|
|
3615
|
+
outputHasColors?: boolean;
|
|
3616
|
+
}): void;
|
|
3617
|
+
/** Get the command term to show in the list of subcommands. */
|
|
3618
|
+
subcommandTerm(cmd: Command): string;
|
|
3619
|
+
/** Get the command summary to show in the list of subcommands. */
|
|
3620
|
+
subcommandDescription(cmd: Command): string;
|
|
3621
|
+
/** Get the option term to show in the list of options. */
|
|
3622
|
+
optionTerm(option: Option): string;
|
|
3623
|
+
/** Get the option description to show in the list of options. */
|
|
3624
|
+
optionDescription(option: Option): string;
|
|
3625
|
+
/** Get the argument term to show in the list of arguments. */
|
|
3626
|
+
argumentTerm(argument: Argument): string;
|
|
3627
|
+
/** Get the argument description to show in the list of arguments. */
|
|
3628
|
+
argumentDescription(argument: Argument): string;
|
|
3629
|
+
/** Get the command usage to be displayed at the top of the built-in help. */
|
|
3630
|
+
commandUsage(cmd: Command): string;
|
|
3631
|
+
/** Get the description for the command. */
|
|
3632
|
+
commandDescription(cmd: Command): string;
|
|
3633
|
+
/** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */
|
|
3634
|
+
visibleCommands(cmd: Command): Command[];
|
|
3635
|
+
/** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */
|
|
3636
|
+
visibleOptions(cmd: Command): Option[];
|
|
3637
|
+
/** Get an array of the visible global options. (Not including help.) */
|
|
3638
|
+
visibleGlobalOptions(cmd: Command): Option[];
|
|
3639
|
+
/** Get an array of the arguments which have descriptions. */
|
|
3640
|
+
visibleArguments(cmd: Command): Argument[];
|
|
3641
|
+
/** Get the longest command term length. */
|
|
3642
|
+
longestSubcommandTermLength(cmd: Command, helper: Help): number;
|
|
3643
|
+
/** Get the longest option term length. */
|
|
3644
|
+
longestOptionTermLength(cmd: Command, helper: Help): number;
|
|
3645
|
+
/** Get the longest global option term length. */
|
|
3646
|
+
longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
|
|
3647
|
+
/** Get the longest argument term length. */
|
|
3648
|
+
longestArgumentTermLength(cmd: Command, helper: Help): number;
|
|
3649
|
+
/** Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations. */
|
|
3650
|
+
displayWidth(str: string): number;
|
|
3651
|
+
/** Style the titles. Called with 'Usage:', 'Options:', etc. */
|
|
3652
|
+
styleTitle(title: string): string;
|
|
3653
|
+
/** Usage: <str> */
|
|
3654
|
+
styleUsage(str: string): string;
|
|
3655
|
+
/** Style for command name in usage string. */
|
|
3656
|
+
styleCommandText(str: string): string;
|
|
3657
|
+
styleCommandDescription(str: string): string;
|
|
3658
|
+
styleOptionDescription(str: string): string;
|
|
3659
|
+
styleSubcommandDescription(str: string): string;
|
|
3660
|
+
styleArgumentDescription(str: string): string;
|
|
3661
|
+
/** Base style used by descriptions. */
|
|
3662
|
+
styleDescriptionText(str: string): string;
|
|
3663
|
+
styleOptionTerm(str: string): string;
|
|
3664
|
+
styleSubcommandTerm(str: string): string;
|
|
3665
|
+
styleArgumentTerm(str: string): string;
|
|
3666
|
+
/** Base style used in terms and usage for options. */
|
|
3667
|
+
styleOptionText(str: string): string;
|
|
3668
|
+
/** Base style used in terms and usage for subcommands. */
|
|
3669
|
+
styleSubcommandText(str: string): string;
|
|
3670
|
+
/** Base style used in terms and usage for arguments. */
|
|
3671
|
+
styleArgumentText(str: string): string;
|
|
3672
|
+
/** Calculate the pad width from the maximum term length. */
|
|
3673
|
+
padWidth(cmd: Command, helper: Help): number;
|
|
3674
|
+
/**
|
|
3675
|
+
* Wrap a string at whitespace, preserving existing line breaks.
|
|
3676
|
+
* Wrapping is skipped if the width is less than `minWidthToWrap`.
|
|
3677
|
+
*/
|
|
3678
|
+
boxWrap(str: string, width: number): string;
|
|
3679
|
+
/** Detect manually wrapped and indented strings by checking for line break followed by whitespace. */
|
|
3680
|
+
preformatted(str: string): boolean;
|
|
3681
|
+
/**
|
|
3682
|
+
* Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
|
|
3683
|
+
*
|
|
3684
|
+
* So "TTT", 5, "DDD DDDD DD DDD" might be formatted for this.helpWidth=17 like so:
|
|
3685
|
+
* TTT DDD DDDD
|
|
3686
|
+
* DD DDD
|
|
3687
|
+
*/
|
|
3688
|
+
formatItem(term: string, termWidth: number, description: string, helper: Help): string;
|
|
3689
|
+
/**
|
|
3690
|
+
* Format a list of items, given a heading and an array of formatted items.
|
|
3691
|
+
*/
|
|
3692
|
+
formatItemList(heading: string, items: string[], helper: Help): string[];
|
|
3693
|
+
/**
|
|
3694
|
+
* Group items by their help group heading.
|
|
3695
|
+
*/
|
|
3696
|
+
groupItems<T extends Command | Option>(unsortedItems: T[], visibleItems: T[], getGroup: (item: T) => string): Map<string, T[]>;
|
|
3697
|
+
/** Generate the built-in help text. */
|
|
3698
|
+
formatHelp(cmd: Command, helper: Help): string;
|
|
3699
|
+
}
|
|
3700
|
+
type HelpConfiguration = Partial<Help>;
|
|
3701
|
+
interface ParseOptions {
|
|
3702
|
+
from: 'node' | 'electron' | 'user';
|
|
3703
|
+
}
|
|
3704
|
+
interface HelpContext {
|
|
3705
|
+
// optional parameter for .help() and .outputHelp()
|
|
3706
|
+
error: boolean;
|
|
3707
|
+
}
|
|
3708
|
+
interface AddHelpTextContext {
|
|
3709
|
+
// passed to text function used with .addHelpText()
|
|
3710
|
+
error: boolean;
|
|
3711
|
+
command: Command;
|
|
3712
|
+
}
|
|
3713
|
+
interface OutputConfiguration {
|
|
3714
|
+
writeOut?(str: string): void;
|
|
3715
|
+
writeErr?(str: string): void;
|
|
3716
|
+
outputError?(str: string, write: (str: string) => void): void;
|
|
3717
|
+
getOutHelpWidth?(): number;
|
|
3718
|
+
getErrHelpWidth?(): number;
|
|
3719
|
+
getOutHasColors?(): boolean;
|
|
3720
|
+
getErrHasColors?(): boolean;
|
|
3721
|
+
stripColor?(str: string): string;
|
|
3722
|
+
}
|
|
3723
|
+
type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
|
|
3724
|
+
type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
|
|
3725
|
+
// The source is a string so author can define their own too.
|
|
3726
|
+
type OptionValueSource = LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string> | undefined;
|
|
3727
|
+
type OptionValues = Record<string, any>;
|
|
3728
|
+
declare class Command {
|
|
3729
|
+
args: string[];
|
|
3730
|
+
processedArgs: any[];
|
|
3731
|
+
readonly commands: readonly Command[];
|
|
3732
|
+
readonly options: readonly Option[];
|
|
3733
|
+
readonly registeredArguments: readonly Argument[];
|
|
3734
|
+
parent: Command | null;
|
|
3735
|
+
constructor(name?: string);
|
|
3736
|
+
/**
|
|
3737
|
+
* Set the program version to `str`.
|
|
3738
|
+
*
|
|
3739
|
+
* This method auto-registers the "-V, --version" flag
|
|
3740
|
+
* which will print the version number when passed.
|
|
3741
|
+
*
|
|
3742
|
+
* You can optionally supply the flags and description to override the defaults.
|
|
3743
|
+
*/
|
|
3744
|
+
version(str: string, flags?: string, description?: string): this;
|
|
3745
|
+
/**
|
|
3746
|
+
* Get the program version.
|
|
3747
|
+
*/
|
|
3748
|
+
version(): string | undefined;
|
|
3749
|
+
/**
|
|
3750
|
+
* Define a command, implemented using an action handler.
|
|
3751
|
+
*
|
|
3752
|
+
* @remarks
|
|
3753
|
+
* The command description is supplied using `.description`, not as a parameter to `.command`.
|
|
3754
|
+
*
|
|
3755
|
+
* @example
|
|
3756
|
+
* ```ts
|
|
3757
|
+
* program
|
|
3758
|
+
* .command('clone <source> [destination]')
|
|
3759
|
+
* .description('clone a repository into a newly created directory')
|
|
3760
|
+
* .action((source, destination) => {
|
|
3761
|
+
* console.log('clone command called');
|
|
3762
|
+
* });
|
|
3763
|
+
* ```
|
|
3764
|
+
*
|
|
3765
|
+
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
3766
|
+
* @param opts - configuration options
|
|
3767
|
+
* @returns new command
|
|
3768
|
+
*/
|
|
3769
|
+
command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
|
|
3770
|
+
/**
|
|
3771
|
+
* Define a command, implemented in a separate executable file.
|
|
3772
|
+
*
|
|
3773
|
+
* @remarks
|
|
3774
|
+
* The command description is supplied as the second parameter to `.command`.
|
|
3775
|
+
*
|
|
3776
|
+
* @example
|
|
3777
|
+
* ```ts
|
|
3778
|
+
* program
|
|
3779
|
+
* .command('start <service>', 'start named service')
|
|
3780
|
+
* .command('stop [service]', 'stop named service, or all if no name supplied');
|
|
3781
|
+
* ```
|
|
3782
|
+
*
|
|
3783
|
+
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
|
3784
|
+
* @param description - description of executable command
|
|
3785
|
+
* @param opts - configuration options
|
|
3786
|
+
* @returns `this` command for chaining
|
|
3787
|
+
*/
|
|
3788
|
+
command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
|
|
3789
|
+
/**
|
|
3790
|
+
* Factory routine to create a new unattached command.
|
|
3791
|
+
*
|
|
3792
|
+
* See .command() for creating an attached subcommand, which uses this routine to
|
|
3793
|
+
* create the command. You can override createCommand to customise subcommands.
|
|
3794
|
+
*/
|
|
3795
|
+
createCommand(name?: string): Command;
|
|
3796
|
+
/**
|
|
3797
|
+
* Add a prepared subcommand.
|
|
3798
|
+
*
|
|
3799
|
+
* See .command() for creating an attached subcommand which inherits settings from its parent.
|
|
3800
|
+
*
|
|
3801
|
+
* @returns `this` command for chaining
|
|
3802
|
+
*/
|
|
3803
|
+
addCommand(cmd: Command, opts?: CommandOptions): this;
|
|
3804
|
+
/**
|
|
3805
|
+
* Factory routine to create a new unattached argument.
|
|
3806
|
+
*
|
|
3807
|
+
* See .argument() for creating an attached argument, which uses this routine to
|
|
3808
|
+
* create the argument. You can override createArgument to return a custom argument.
|
|
3809
|
+
*/
|
|
3810
|
+
createArgument(name: string, description?: string): Argument;
|
|
3811
|
+
/**
|
|
3812
|
+
* Define argument syntax for command.
|
|
3813
|
+
*
|
|
3814
|
+
* The default is that the argument is required, and you can explicitly
|
|
3815
|
+
* indicate this with <> around the name. Put [] around the name for an optional argument.
|
|
3816
|
+
*
|
|
3817
|
+
* @example
|
|
3818
|
+
* ```
|
|
3819
|
+
* program.argument('<input-file>');
|
|
3820
|
+
* program.argument('[output-file]');
|
|
3821
|
+
* ```
|
|
3822
|
+
*
|
|
3823
|
+
* @returns `this` command for chaining
|
|
3824
|
+
*/
|
|
3825
|
+
argument<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
3826
|
+
argument(name: string, description?: string, defaultValue?: unknown): this;
|
|
3827
|
+
/**
|
|
3828
|
+
* Define argument syntax for command, adding a prepared argument.
|
|
3829
|
+
*
|
|
3830
|
+
* @returns `this` command for chaining
|
|
3831
|
+
*/
|
|
3832
|
+
addArgument(arg: Argument): this;
|
|
3833
|
+
/**
|
|
3834
|
+
* Define argument syntax for command, adding multiple at once (without descriptions).
|
|
3835
|
+
*
|
|
3836
|
+
* See also .argument().
|
|
3837
|
+
*
|
|
3838
|
+
* @example
|
|
3839
|
+
* ```
|
|
3840
|
+
* program.arguments('<cmd> [env]');
|
|
3841
|
+
* ```
|
|
3842
|
+
*
|
|
3843
|
+
* @returns `this` command for chaining
|
|
3844
|
+
*/
|
|
3845
|
+
arguments(names: string): this;
|
|
3846
|
+
/**
|
|
3847
|
+
* Customise or override default help command. By default a help command is automatically added if your command has subcommands.
|
|
3848
|
+
*
|
|
3849
|
+
* @example
|
|
3850
|
+
* ```ts
|
|
3851
|
+
* program.helpCommand('help [cmd]');
|
|
3852
|
+
* program.helpCommand('help [cmd]', 'show help');
|
|
3853
|
+
* program.helpCommand(false); // suppress default help command
|
|
3854
|
+
* program.helpCommand(true); // add help command even if no subcommands
|
|
3855
|
+
* ```
|
|
3856
|
+
*/
|
|
3857
|
+
helpCommand(nameAndArgs: string, description?: string): this;
|
|
3858
|
+
helpCommand(enable: boolean): this;
|
|
3859
|
+
/**
|
|
3860
|
+
* Add prepared custom help command.
|
|
3861
|
+
*/
|
|
3862
|
+
addHelpCommand(cmd: Command): this;
|
|
3863
|
+
/** @deprecated since v12, instead use helpCommand */
|
|
3864
|
+
addHelpCommand(nameAndArgs: string, description?: string): this;
|
|
3865
|
+
/** @deprecated since v12, instead use helpCommand */
|
|
3866
|
+
addHelpCommand(enable?: boolean): this;
|
|
3867
|
+
/**
|
|
3868
|
+
* Add hook for life cycle event.
|
|
3869
|
+
*/
|
|
3870
|
+
hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;
|
|
3871
|
+
/**
|
|
3872
|
+
* Register callback to use as replacement for calling process.exit.
|
|
3873
|
+
*/
|
|
3874
|
+
exitOverride(callback?: (err: CommanderError) => never | void): this;
|
|
3875
|
+
/**
|
|
3876
|
+
* Display error message and exit (or call exitOverride).
|
|
3877
|
+
*/
|
|
3878
|
+
error(message: string, errorOptions?: ErrorOptions$1): never;
|
|
3879
|
+
/**
|
|
3880
|
+
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
3881
|
+
* or by overriding Help properties using configureHelp().
|
|
3882
|
+
*/
|
|
3883
|
+
createHelp(): Help;
|
|
3884
|
+
/**
|
|
3885
|
+
* You can customise the help by overriding Help properties using configureHelp(),
|
|
3886
|
+
* or with a subclass of Help by overriding createHelp().
|
|
3887
|
+
*/
|
|
3888
|
+
configureHelp(configuration: HelpConfiguration): this;
|
|
3889
|
+
/** Get configuration */
|
|
3890
|
+
configureHelp(): HelpConfiguration;
|
|
3891
|
+
/**
|
|
3892
|
+
* The default output goes to stdout and stderr. You can customise this for special
|
|
3893
|
+
* applications. You can also customise the display of errors by overriding outputError.
|
|
3894
|
+
*
|
|
3895
|
+
* The configuration properties are all functions:
|
|
3896
|
+
* ```
|
|
3897
|
+
* // functions to change where being written, stdout and stderr
|
|
3898
|
+
* writeOut(str)
|
|
3899
|
+
* writeErr(str)
|
|
3900
|
+
* // matching functions to specify width for wrapping help
|
|
3901
|
+
* getOutHelpWidth()
|
|
3902
|
+
* getErrHelpWidth()
|
|
3903
|
+
* // functions based on what is being written out
|
|
3904
|
+
* outputError(str, write) // used for displaying errors, and not used for displaying help
|
|
3905
|
+
* ```
|
|
3906
|
+
*/
|
|
3907
|
+
configureOutput(configuration: OutputConfiguration): this;
|
|
3908
|
+
/** Get configuration */
|
|
3909
|
+
configureOutput(): OutputConfiguration;
|
|
3910
|
+
/**
|
|
3911
|
+
* Copy settings that are useful to have in common across root command and subcommands.
|
|
3912
|
+
*
|
|
3913
|
+
* (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
|
|
3914
|
+
*/
|
|
3915
|
+
copyInheritedSettings(sourceCommand: Command): this;
|
|
3916
|
+
/**
|
|
3917
|
+
* Display the help or a custom message after an error occurs.
|
|
3918
|
+
*/
|
|
3919
|
+
showHelpAfterError(displayHelp?: boolean | string): this;
|
|
3920
|
+
/**
|
|
3921
|
+
* Display suggestion of similar commands for unknown commands, or options for unknown options.
|
|
3922
|
+
*/
|
|
3923
|
+
showSuggestionAfterError(displaySuggestion?: boolean): this;
|
|
3924
|
+
/**
|
|
3925
|
+
* Register callback `fn` for the command.
|
|
3926
|
+
*
|
|
3927
|
+
* @example
|
|
3928
|
+
* ```
|
|
3929
|
+
* program
|
|
3930
|
+
* .command('serve')
|
|
3931
|
+
* .description('start service')
|
|
3932
|
+
* .action(function() {
|
|
3933
|
+
* // do work here
|
|
3934
|
+
* });
|
|
3935
|
+
* ```
|
|
3936
|
+
*
|
|
3937
|
+
* @returns `this` command for chaining
|
|
3938
|
+
*/
|
|
3939
|
+
action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;
|
|
3940
|
+
/**
|
|
3941
|
+
* Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
|
|
3942
|
+
*
|
|
3943
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
|
|
3944
|
+
* option-argument is indicated by `<>` and an optional option-argument by `[]`.
|
|
3945
|
+
*
|
|
3946
|
+
* See the README for more details, and see also addOption() and requiredOption().
|
|
3947
|
+
*
|
|
3948
|
+
* @example
|
|
3949
|
+
*
|
|
3950
|
+
* ```js
|
|
3951
|
+
* program
|
|
3952
|
+
* .option('-p, --pepper', 'add pepper')
|
|
3953
|
+
* .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
|
|
3954
|
+
* .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
|
|
3955
|
+
* .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
|
|
3956
|
+
* ```
|
|
3957
|
+
*
|
|
3958
|
+
* @returns `this` command for chaining
|
|
3959
|
+
*/
|
|
3960
|
+
option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
|
3961
|
+
option<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
3962
|
+
/** @deprecated since v7, instead use choices or a custom function */
|
|
3963
|
+
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
|
3964
|
+
/**
|
|
3965
|
+
* Define a required option, which must have a value after parsing. This usually means
|
|
3966
|
+
* the option must be specified on the command line. (Otherwise the same as .option().)
|
|
3967
|
+
*
|
|
3968
|
+
* The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
|
|
3969
|
+
*/
|
|
3970
|
+
requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
|
|
3971
|
+
requiredOption<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
|
|
3972
|
+
/** @deprecated since v7, instead use choices or a custom function */
|
|
3973
|
+
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
|
|
3974
|
+
/**
|
|
3975
|
+
* Factory routine to create a new unattached option.
|
|
3976
|
+
*
|
|
3977
|
+
* See .option() for creating an attached option, which uses this routine to
|
|
3978
|
+
* create the option. You can override createOption to return a custom option.
|
|
3979
|
+
*/
|
|
3980
|
+
createOption(flags: string, description?: string): Option;
|
|
3981
|
+
/**
|
|
3982
|
+
* Add a prepared Option.
|
|
3983
|
+
*
|
|
3984
|
+
* See .option() and .requiredOption() for creating and attaching an option in a single call.
|
|
3985
|
+
*/
|
|
3986
|
+
addOption(option: Option): this;
|
|
3987
|
+
/**
|
|
3988
|
+
* Whether to store option values as properties on command object,
|
|
3989
|
+
* or store separately (specify false). In both cases the option values can be accessed using .opts().
|
|
3990
|
+
*
|
|
3991
|
+
* @returns `this` command for chaining
|
|
3992
|
+
*/
|
|
3993
|
+
storeOptionsAsProperties<T extends OptionValues>(): this & T;
|
|
3994
|
+
storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
|
|
3995
|
+
storeOptionsAsProperties(storeAsProperties?: boolean): this;
|
|
3996
|
+
/**
|
|
3997
|
+
* Retrieve option value.
|
|
3998
|
+
*/
|
|
3999
|
+
getOptionValue(key: string): any;
|
|
4000
|
+
/**
|
|
4001
|
+
* Store option value.
|
|
4002
|
+
*/
|
|
4003
|
+
setOptionValue(key: string, value: unknown): this;
|
|
4004
|
+
/**
|
|
4005
|
+
* Store option value and where the value came from.
|
|
4006
|
+
*/
|
|
4007
|
+
setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;
|
|
4008
|
+
/**
|
|
4009
|
+
* Get source of option value.
|
|
4010
|
+
*/
|
|
4011
|
+
getOptionValueSource(key: string): OptionValueSource | undefined;
|
|
4012
|
+
/**
|
|
4013
|
+
* Get source of option value. See also .optsWithGlobals().
|
|
4014
|
+
*/
|
|
4015
|
+
getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
|
|
4016
|
+
/**
|
|
4017
|
+
* Alter parsing of short flags with optional values.
|
|
4018
|
+
*
|
|
4019
|
+
* @example
|
|
4020
|
+
* ```
|
|
4021
|
+
* // for `.option('-f,--flag [value]'):
|
|
4022
|
+
* .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour
|
|
4023
|
+
* .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
|
|
4024
|
+
* ```
|
|
4025
|
+
*
|
|
4026
|
+
* @returns `this` command for chaining
|
|
4027
|
+
*/
|
|
4028
|
+
combineFlagAndOptionalValue(combine?: boolean): this;
|
|
4029
|
+
/**
|
|
4030
|
+
* Allow unknown options on the command line.
|
|
4031
|
+
*
|
|
4032
|
+
* @returns `this` command for chaining
|
|
4033
|
+
*/
|
|
4034
|
+
allowUnknownOption(allowUnknown?: boolean): this;
|
|
4035
|
+
/**
|
|
4036
|
+
* Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
|
|
4037
|
+
*
|
|
4038
|
+
* @returns `this` command for chaining
|
|
4039
|
+
*/
|
|
4040
|
+
allowExcessArguments(allowExcess?: boolean): this;
|
|
4041
|
+
/**
|
|
4042
|
+
* Enable positional options. Positional means global options are specified before subcommands which lets
|
|
4043
|
+
* subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
|
|
4044
|
+
*
|
|
4045
|
+
* The default behaviour is non-positional and global options may appear anywhere on the command line.
|
|
4046
|
+
*
|
|
4047
|
+
* @returns `this` command for chaining
|
|
4048
|
+
*/
|
|
4049
|
+
enablePositionalOptions(positional?: boolean): this;
|
|
4050
|
+
/**
|
|
4051
|
+
* Pass through options that come after command-arguments rather than treat them as command-options,
|
|
4052
|
+
* so actual command-options come before command-arguments. Turning this on for a subcommand requires
|
|
4053
|
+
* positional options to have been enabled on the program (parent commands).
|
|
4054
|
+
*
|
|
4055
|
+
* The default behaviour is non-positional and options may appear before or after command-arguments.
|
|
4056
|
+
*
|
|
4057
|
+
* @returns `this` command for chaining
|
|
4058
|
+
*/
|
|
4059
|
+
passThroughOptions(passThrough?: boolean): this;
|
|
4060
|
+
/**
|
|
4061
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
4062
|
+
*
|
|
4063
|
+
* Use parseAsync instead of parse if any of your action handlers are async.
|
|
4064
|
+
*
|
|
4065
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
4066
|
+
*
|
|
4067
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
4068
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
4069
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
4070
|
+
* - `'user'`: just user arguments
|
|
4071
|
+
*
|
|
4072
|
+
* @example
|
|
4073
|
+
* ```
|
|
4074
|
+
* program.parse(); // parse process.argv and auto-detect electron and special node flags
|
|
4075
|
+
* program.parse(process.argv); // assume argv[0] is app and argv[1] is script
|
|
4076
|
+
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
4077
|
+
* ```
|
|
4078
|
+
*
|
|
4079
|
+
* @returns `this` command for chaining
|
|
4080
|
+
*/
|
|
4081
|
+
parse(argv?: readonly string[], parseOptions?: ParseOptions): this;
|
|
4082
|
+
/**
|
|
4083
|
+
* Parse `argv`, setting options and invoking commands when defined.
|
|
4084
|
+
*
|
|
4085
|
+
* Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
|
|
4086
|
+
*
|
|
4087
|
+
* Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
|
|
4088
|
+
* - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
|
|
4089
|
+
* - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
|
|
4090
|
+
* - `'user'`: just user arguments
|
|
4091
|
+
*
|
|
4092
|
+
* @example
|
|
4093
|
+
* ```
|
|
4094
|
+
* await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
|
|
4095
|
+
* await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
|
|
4096
|
+
* await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
|
4097
|
+
* ```
|
|
4098
|
+
*
|
|
4099
|
+
* @returns Promise
|
|
4100
|
+
*/
|
|
4101
|
+
parseAsync(argv?: readonly string[], parseOptions?: ParseOptions): Promise<this>;
|
|
4102
|
+
/**
|
|
4103
|
+
* Called the first time parse is called to save state and allow a restore before subsequent calls to parse.
|
|
4104
|
+
* Not usually called directly, but available for subclasses to save their custom state.
|
|
4105
|
+
*
|
|
4106
|
+
* This is called in a lazy way. Only commands used in parsing chain will have state saved.
|
|
4107
|
+
*/
|
|
4108
|
+
saveStateBeforeParse(): void;
|
|
4109
|
+
/**
|
|
4110
|
+
* Restore state before parse for calls after the first.
|
|
4111
|
+
* Not usually called directly, but available for subclasses to save their custom state.
|
|
4112
|
+
*
|
|
4113
|
+
* This is called in a lazy way. Only commands used in parsing chain will have state restored.
|
|
4114
|
+
*/
|
|
4115
|
+
restoreStateBeforeParse(): void;
|
|
4116
|
+
/**
|
|
4117
|
+
* Parse options from `argv` removing known options,
|
|
4118
|
+
* and return argv split into operands and unknown arguments.
|
|
4119
|
+
*
|
|
4120
|
+
* Side effects: modifies command by storing options. Does not reset state if called again.
|
|
4121
|
+
*
|
|
4122
|
+
* argv => operands, unknown
|
|
4123
|
+
* --known kkk op => [op], []
|
|
4124
|
+
* op --known kkk => [op], []
|
|
4125
|
+
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
|
4126
|
+
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
|
4127
|
+
*/
|
|
4128
|
+
parseOptions(argv: string[]): ParseOptionsResult;
|
|
4129
|
+
/**
|
|
4130
|
+
* Return an object containing local option values as key-value pairs
|
|
4131
|
+
*/
|
|
4132
|
+
opts<T extends OptionValues>(): T;
|
|
4133
|
+
/**
|
|
4134
|
+
* Return an object containing merged local and global option values as key-value pairs.
|
|
4135
|
+
*/
|
|
4136
|
+
optsWithGlobals<T extends OptionValues>(): T;
|
|
4137
|
+
/**
|
|
4138
|
+
* Set the description.
|
|
4139
|
+
*
|
|
4140
|
+
* @returns `this` command for chaining
|
|
4141
|
+
*/
|
|
4142
|
+
description(str: string): this;
|
|
4143
|
+
/** @deprecated since v8, instead use .argument to add command argument with description */
|
|
4144
|
+
description(str: string, argsDescription: Record<string, string>): this;
|
|
4145
|
+
/**
|
|
4146
|
+
* Get the description.
|
|
4147
|
+
*/
|
|
4148
|
+
description(): string;
|
|
4149
|
+
/**
|
|
4150
|
+
* Set the summary. Used when listed as subcommand of parent.
|
|
4151
|
+
*
|
|
4152
|
+
* @returns `this` command for chaining
|
|
4153
|
+
*/
|
|
4154
|
+
summary(str: string): this;
|
|
4155
|
+
/**
|
|
4156
|
+
* Get the summary.
|
|
4157
|
+
*/
|
|
4158
|
+
summary(): string;
|
|
4159
|
+
/**
|
|
4160
|
+
* Set an alias for the command.
|
|
4161
|
+
*
|
|
4162
|
+
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
|
|
4163
|
+
*
|
|
4164
|
+
* @returns `this` command for chaining
|
|
4165
|
+
*/
|
|
4166
|
+
alias(alias: string): this;
|
|
4167
|
+
/**
|
|
4168
|
+
* Get alias for the command.
|
|
4169
|
+
*/
|
|
4170
|
+
alias(): string;
|
|
4171
|
+
/**
|
|
4172
|
+
* Set aliases for the command.
|
|
4173
|
+
*
|
|
4174
|
+
* Only the first alias is shown in the auto-generated help.
|
|
4175
|
+
*
|
|
4176
|
+
* @returns `this` command for chaining
|
|
4177
|
+
*/
|
|
4178
|
+
aliases(aliases: readonly string[]): this;
|
|
4179
|
+
/**
|
|
4180
|
+
* Get aliases for the command.
|
|
4181
|
+
*/
|
|
4182
|
+
aliases(): string[];
|
|
4183
|
+
/**
|
|
4184
|
+
* Set the command usage.
|
|
4185
|
+
*
|
|
4186
|
+
* @returns `this` command for chaining
|
|
4187
|
+
*/
|
|
4188
|
+
usage(str: string): this;
|
|
4189
|
+
/**
|
|
4190
|
+
* Get the command usage.
|
|
4191
|
+
*/
|
|
4192
|
+
usage(): string;
|
|
4193
|
+
/**
|
|
4194
|
+
* Set the name of the command.
|
|
4195
|
+
*
|
|
4196
|
+
* @returns `this` command for chaining
|
|
4197
|
+
*/
|
|
4198
|
+
name(str: string): this;
|
|
4199
|
+
/**
|
|
4200
|
+
* Get the name of the command.
|
|
4201
|
+
*/
|
|
4202
|
+
name(): string;
|
|
4203
|
+
/**
|
|
4204
|
+
* Set the name of the command from script filename, such as process.argv[1],
|
|
4205
|
+
* or import.meta.filename.
|
|
4206
|
+
*
|
|
4207
|
+
* (Used internally and public although not documented in README.)
|
|
4208
|
+
*
|
|
4209
|
+
* @example
|
|
4210
|
+
* ```ts
|
|
4211
|
+
* program.nameFromFilename(import.meta.filename);
|
|
4212
|
+
* ```
|
|
4213
|
+
*
|
|
4214
|
+
* @returns `this` command for chaining
|
|
4215
|
+
*/
|
|
4216
|
+
nameFromFilename(filename: string): this;
|
|
4217
|
+
/**
|
|
4218
|
+
* Set the directory for searching for executable subcommands of this command.
|
|
4219
|
+
*
|
|
4220
|
+
* @example
|
|
4221
|
+
* ```ts
|
|
4222
|
+
* program.executableDir(import.meta.dirname);
|
|
4223
|
+
* // or
|
|
4224
|
+
* program.executableDir('subcommands');
|
|
4225
|
+
* ```
|
|
4226
|
+
*
|
|
4227
|
+
* @returns `this` command for chaining
|
|
4228
|
+
*/
|
|
4229
|
+
executableDir(path: string): this;
|
|
4230
|
+
/**
|
|
4231
|
+
* Get the executable search directory.
|
|
4232
|
+
*/
|
|
4233
|
+
executableDir(): string | null;
|
|
4234
|
+
/**
|
|
4235
|
+
* Set the help group heading for this subcommand in parent command's help.
|
|
4236
|
+
*
|
|
4237
|
+
* @returns `this` command for chaining
|
|
4238
|
+
*/
|
|
4239
|
+
helpGroup(heading: string): this;
|
|
4240
|
+
/**
|
|
4241
|
+
* Get the help group heading for this subcommand in parent command's help.
|
|
4242
|
+
*/
|
|
4243
|
+
helpGroup(): string;
|
|
4244
|
+
/**
|
|
4245
|
+
* Set the default help group heading for subcommands added to this command.
|
|
4246
|
+
* (This does not override a group set directly on the subcommand using .helpGroup().)
|
|
4247
|
+
*
|
|
4248
|
+
* @example
|
|
4249
|
+
* program.commandsGroup('Development Commands:);
|
|
4250
|
+
* program.command('watch')...
|
|
4251
|
+
* program.command('lint')...
|
|
4252
|
+
* ...
|
|
4253
|
+
*
|
|
4254
|
+
* @returns `this` command for chaining
|
|
4255
|
+
*/
|
|
4256
|
+
commandsGroup(heading: string): this;
|
|
4257
|
+
/**
|
|
4258
|
+
* Get the default help group heading for subcommands added to this command.
|
|
4259
|
+
*/
|
|
4260
|
+
commandsGroup(): string;
|
|
4261
|
+
/**
|
|
4262
|
+
* Set the default help group heading for options added to this command.
|
|
4263
|
+
* (This does not override a group set directly on the option using .helpGroup().)
|
|
4264
|
+
*
|
|
4265
|
+
* @example
|
|
4266
|
+
* program
|
|
4267
|
+
* .optionsGroup('Development Options:')
|
|
4268
|
+
* .option('-d, --debug', 'output extra debugging')
|
|
4269
|
+
* .option('-p, --profile', 'output profiling information')
|
|
4270
|
+
*
|
|
4271
|
+
* @returns `this` command for chaining
|
|
4272
|
+
*/
|
|
4273
|
+
optionsGroup(heading: string): this;
|
|
4274
|
+
/**
|
|
4275
|
+
* Get the default help group heading for options added to this command.
|
|
4276
|
+
*/
|
|
4277
|
+
optionsGroup(): string;
|
|
4278
|
+
/**
|
|
4279
|
+
* Output help information for this command.
|
|
4280
|
+
*
|
|
4281
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
4282
|
+
*
|
|
4283
|
+
*/
|
|
4284
|
+
outputHelp(context?: HelpContext): void;
|
|
4285
|
+
/** @deprecated since v7 */
|
|
4286
|
+
outputHelp(cb: (str: string) => string): void;
|
|
4287
|
+
/**
|
|
4288
|
+
* Return command help documentation.
|
|
4289
|
+
*/
|
|
4290
|
+
helpInformation(context?: HelpContext): string;
|
|
4291
|
+
/**
|
|
4292
|
+
* You can pass in flags and a description to override the help
|
|
4293
|
+
* flags and help description for your command. Pass in false
|
|
4294
|
+
* to disable the built-in help option.
|
|
4295
|
+
*/
|
|
4296
|
+
helpOption(flags?: string | boolean, description?: string): this;
|
|
4297
|
+
/**
|
|
4298
|
+
* Supply your own option to use for the built-in help option.
|
|
4299
|
+
* This is an alternative to using helpOption() to customise the flags and description etc.
|
|
4300
|
+
*/
|
|
4301
|
+
addHelpOption(option: Option): this;
|
|
4302
|
+
/**
|
|
4303
|
+
* Output help information and exit.
|
|
4304
|
+
*
|
|
4305
|
+
* Outputs built-in help, and custom text added using `.addHelpText()`.
|
|
4306
|
+
*/
|
|
4307
|
+
help(context?: HelpContext): never;
|
|
4308
|
+
/** @deprecated since v7 */
|
|
4309
|
+
help(cb: (str: string) => string): never;
|
|
4310
|
+
/**
|
|
4311
|
+
* Add additional text to be displayed with the built-in help.
|
|
4312
|
+
*
|
|
4313
|
+
* Position is 'before' or 'after' to affect just this command,
|
|
4314
|
+
* and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
|
|
4315
|
+
*/
|
|
4316
|
+
addHelpText(position: AddHelpTextPosition, text: string): this;
|
|
4317
|
+
addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;
|
|
4318
|
+
/**
|
|
4319
|
+
* Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
|
|
4320
|
+
*/
|
|
4321
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
4322
|
+
}
|
|
4323
|
+
interface CommandOptions {
|
|
4324
|
+
hidden?: boolean;
|
|
4325
|
+
isDefault?: boolean;
|
|
4326
|
+
/** @deprecated since v7, replaced by hidden */
|
|
4327
|
+
noHelp?: boolean;
|
|
4328
|
+
}
|
|
4329
|
+
interface ExecutableCommandOptions extends CommandOptions {
|
|
4330
|
+
executableFile?: string;
|
|
4331
|
+
}
|
|
4332
|
+
interface ParseOptionsResult {
|
|
4333
|
+
operands: string[];
|
|
4334
|
+
unknown: string[];
|
|
4335
|
+
}
|
|
4336
|
+
//#endregion
|
|
4337
|
+
//#region src/cli/program.d.ts
|
|
4338
|
+
declare function createProgram(options?: {
|
|
4339
|
+
json?: boolean;
|
|
4340
|
+
}): Command;
|
|
4341
|
+
//#endregion
|
|
4342
|
+
//#region src/core/agent/context.d.ts
|
|
4343
|
+
interface AgentApiClient extends Pick<OpenTagApi, "createAgent" | "listAgents" | "getAgent" | "getAgentConfig" | "updateAgent" | "suspendAgent" | "reactivateAgent" | "rebindAgentComputer" | "deleteAgent" | "listAccountComputers" | "me" | "getAgentImBinding" | "getAgentImBindingConfig" | "createFeishuSetupAttempt" | "getFeishuSetupAttempt" | "cancelFeishuSetupAttempt" | "getImBindingDiagnostics" | "disableImBinding"> {}
|
|
4344
|
+
interface AgentCommandDependencies {
|
|
4345
|
+
accessToken?: string;
|
|
4346
|
+
api?: AgentApiClient;
|
|
4347
|
+
home?: string;
|
|
4348
|
+
}
|
|
4349
|
+
//#endregion
|
|
4350
|
+
//#region src/core/agent/mutations.d.ts
|
|
4351
|
+
interface AgentCreateOptions extends AgentCommandDependencies {
|
|
4352
|
+
computerId?: string;
|
|
4353
|
+
displayName: string;
|
|
4354
|
+
instructions?: string;
|
|
4355
|
+
instructionsFile?: string;
|
|
4356
|
+
maxDurationMs?: number | string;
|
|
4357
|
+
model?: string;
|
|
4358
|
+
name: string;
|
|
4359
|
+
reasoningEffort?: string;
|
|
4360
|
+
runtimeProvider: string;
|
|
4361
|
+
}
|
|
4362
|
+
interface AgentCreateResult {
|
|
4363
|
+
agent: AgentAdminConfig;
|
|
4364
|
+
warning?: string;
|
|
4365
|
+
}
|
|
4366
|
+
interface AgentBindOptions extends AgentCommandDependencies {
|
|
4367
|
+
computerId?: string;
|
|
4368
|
+
}
|
|
4369
|
+
interface AgentBindResult {
|
|
4370
|
+
agent: AgentAdminConfig;
|
|
4371
|
+
warning?: string;
|
|
4372
|
+
}
|
|
4373
|
+
interface AgentUpdateOptions extends AgentCommandDependencies {
|
|
4374
|
+
clearMaxDuration?: boolean;
|
|
4375
|
+
clearModel?: boolean;
|
|
4376
|
+
clearReasoningEffort?: boolean;
|
|
4377
|
+
displayName?: string;
|
|
4378
|
+
instructions?: string;
|
|
4379
|
+
instructionsFile?: string;
|
|
4380
|
+
maxDurationMs?: number | string;
|
|
4381
|
+
model?: string;
|
|
4382
|
+
reasoningEffort?: string;
|
|
4383
|
+
}
|
|
4384
|
+
/**
|
|
4385
|
+
* Resolves the Computer an Agent runs on. Having none to select is no longer a failure: an Agent can
|
|
4386
|
+
* exist before a Computer does and be bound afterwards. An ambiguous choice still is, because
|
|
4387
|
+
* guessing which machine the Account meant would silently place the Agent on the wrong one.
|
|
4388
|
+
*/
|
|
4389
|
+
declare function selectComputer(response: ListAccountComputersResponse, requestedComputerId?: string): AccountComputerSummary | undefined;
|
|
4390
|
+
declare function runAgentCreate(options: AgentCreateOptions): Promise<AgentCreateResult>;
|
|
4391
|
+
declare function runAgentBind(agentId: string, options: AgentBindOptions): Promise<AgentBindResult>;
|
|
4392
|
+
declare function runAgentUpdate(agentId: string, options: AgentUpdateOptions): Promise<AgentAdminConfig>;
|
|
4393
|
+
declare function runAgentDelete(agentId: string, options?: AgentCommandDependencies): Promise<string>;
|
|
4394
|
+
//#endregion
|
|
4395
|
+
//#region src/core/agent/formatting.d.ts
|
|
4396
|
+
declare function formatAgentCreated(result: AgentCreateResult): string;
|
|
4397
|
+
declare function formatAgentBound(result: AgentBindResult): string;
|
|
4398
|
+
declare function formatAgentList(response: ListAgentsResponse): string;
|
|
4399
|
+
declare function formatAgent(agent: AgentAdminConfig): string;
|
|
4400
|
+
//#endregion
|
|
4401
|
+
//#region src/core/agent/queries.d.ts
|
|
4402
|
+
type AgentListOptions = AgentCommandDependencies;
|
|
4403
|
+
declare function runAgentList(options?: AgentListOptions): Promise<ListAgentsResponse>;
|
|
4404
|
+
declare function runAgentShow(agentId: string, options?: AgentCommandDependencies): Promise<AgentAdminConfig>;
|
|
4405
|
+
//#endregion
|
|
4406
|
+
//#region src/core/auth/login.d.ts
|
|
4407
|
+
interface LoginOptions {
|
|
4408
|
+
api?: Pick<OpenTagApi, "exchangeConnectCode">;
|
|
4409
|
+
code: string;
|
|
4410
|
+
home?: string;
|
|
4411
|
+
now?: () => Date;
|
|
4412
|
+
serverUrl: string;
|
|
4413
|
+
}
|
|
4414
|
+
interface LoginResult {
|
|
4415
|
+
credentialsPath: string;
|
|
4416
|
+
message: string;
|
|
4417
|
+
}
|
|
4418
|
+
declare function runLogin(options: LoginOptions): Promise<LoginResult>;
|
|
4419
|
+
//#endregion
|
|
4420
|
+
//#region src/core/channel/config.d.ts
|
|
4421
|
+
declare const channelConfig: ChannelConfig;
|
|
4422
|
+
//#endregion
|
|
4423
|
+
//#region src/core/command/context.d.ts
|
|
4424
|
+
type CommandContextAuthOptions = {
|
|
4425
|
+
accessToken?: string;
|
|
4426
|
+
api?: OpenTagApi;
|
|
4427
|
+
requireAuth?: boolean;
|
|
4428
|
+
};
|
|
4429
|
+
type CommandContextLocationOptions = {
|
|
4430
|
+
environment?: NodeJS.ProcessEnv;
|
|
4431
|
+
home?: string;
|
|
4432
|
+
serverUrl?: string;
|
|
4433
|
+
};
|
|
4434
|
+
type CommandContextOptions = CommandContextAuthOptions & CommandContextLocationOptions;
|
|
4435
|
+
type CommandContextIdentityAccess = {
|
|
4436
|
+
readonly accessToken?: string;
|
|
4437
|
+
readonly api?: OpenTagApi;
|
|
4438
|
+
};
|
|
4439
|
+
type CommandContextIdentity = CommandContextIdentityAccess & {
|
|
4440
|
+
readonly credentials?: StoredCredentials;
|
|
4441
|
+
};
|
|
4442
|
+
type CommandContextLocation = {
|
|
4443
|
+
readonly environment: NodeJS.ProcessEnv;
|
|
4444
|
+
readonly home: string;
|
|
4445
|
+
};
|
|
4446
|
+
type CommandContext = CommandContextIdentity & CommandContextLocation;
|
|
4447
|
+
/** Resolve home, credentials, token, and API from one detached command context. */
|
|
4448
|
+
declare function resolveCommandContext(options?: CommandContextOptions): Promise<CommandContext>;
|
|
4449
|
+
//#endregion
|
|
4450
|
+
//#region src/core/command/environment.d.ts
|
|
4451
|
+
/** Build a detached child-process environment without changing the parent process. */
|
|
4452
|
+
declare function buildChildEnvironment(baseEnvironment: NodeJS.ProcessEnv, options?: {
|
|
4453
|
+
keys?: readonly string[];
|
|
4454
|
+
overrides?: NodeJS.ProcessEnv;
|
|
4455
|
+
}): NodeJS.ProcessEnv;
|
|
4456
|
+
//#endregion
|
|
4457
|
+
//#region src/core/computer/formatting.d.ts
|
|
4458
|
+
declare function formatComputerList(response: ListAccountComputersResponse): string;
|
|
4459
|
+
//#endregion
|
|
4460
|
+
//#region src/core/computer/queries.d.ts
|
|
4461
|
+
declare function listComputers(home?: string): Promise<ListAccountComputersResponse>;
|
|
4462
|
+
//#endregion
|
|
4463
|
+
//#region src/core/context-tree/state.d.ts
|
|
4464
|
+
interface ContextTreeState {
|
|
4465
|
+
configPath: string;
|
|
4466
|
+
target?: string;
|
|
4467
|
+
/** `not-cloned` is a GitHub target the first Agent Session has yet to clone. */
|
|
4468
|
+
tree: "unknown" | "valid" | "invalid" | "not-cloned";
|
|
4469
|
+
detail?: string;
|
|
4470
|
+
}
|
|
4471
|
+
//#endregion
|
|
4472
|
+
//#region src/core/daemon/service/types.d.ts
|
|
4473
|
+
type DaemonServiceState = "active" | "inactive" | "not-installed" | "unknown";
|
|
4474
|
+
type DaemonServicePlatform = "launchd" | "systemd" | "unsupported";
|
|
4475
|
+
interface RuntimeOwnerInfo {
|
|
4476
|
+
consistency: "consistent" | "malformed" | "missing" | "stale" | "unmanaged" | "unverified";
|
|
4477
|
+
pid?: number;
|
|
4478
|
+
}
|
|
4479
|
+
interface DaemonServiceInfo {
|
|
4480
|
+
configuredHome?: string;
|
|
4481
|
+
currentHome: string;
|
|
4482
|
+
definitionPath: string;
|
|
4483
|
+
detail?: string;
|
|
4484
|
+
drifted?: boolean;
|
|
4485
|
+
logHint: string;
|
|
4486
|
+
pid?: number;
|
|
4487
|
+
platform: DaemonServicePlatform;
|
|
4488
|
+
runtimeOwner?: RuntimeOwnerInfo;
|
|
4489
|
+
serviceId: string;
|
|
4490
|
+
state: DaemonServiceState;
|
|
4491
|
+
}
|
|
4492
|
+
//#endregion
|
|
4493
|
+
//#region src/core/diagnostics/doctor.d.ts
|
|
4494
|
+
type DoctorCheckStatus = "pass" | "fail" | "unknown" | "info" | "skipped";
|
|
4495
|
+
type DoctorCheckScope = "target" | "local-configuration" | "daemon-service" | "server" | "agent-runtime" | "provider-cli" | "context-tree";
|
|
4496
|
+
interface DoctorCheck {
|
|
4497
|
+
code: string;
|
|
4498
|
+
scope: DoctorCheckScope;
|
|
4499
|
+
status: DoctorCheckStatus;
|
|
4500
|
+
blocking: boolean;
|
|
4501
|
+
label: string;
|
|
4502
|
+
detail: string;
|
|
4503
|
+
observedFrom?: string;
|
|
4504
|
+
path?: string;
|
|
4505
|
+
remediation?: string;
|
|
4506
|
+
command?: string;
|
|
4507
|
+
}
|
|
4508
|
+
interface DoctorNextAction {
|
|
4509
|
+
checkCode: string;
|
|
4510
|
+
command: string;
|
|
4511
|
+
reason: string;
|
|
4512
|
+
}
|
|
4513
|
+
interface DoctorTarget {
|
|
4514
|
+
home: string;
|
|
4515
|
+
homeSource: "environment" | "channel-default";
|
|
4516
|
+
cliVersion: string;
|
|
4517
|
+
channel: string;
|
|
4518
|
+
platform: NodeJS.Platform;
|
|
4519
|
+
arch: string;
|
|
4520
|
+
nodeVersion: string;
|
|
4521
|
+
}
|
|
4522
|
+
interface DoctorReport {
|
|
4523
|
+
target: DoctorTarget;
|
|
4524
|
+
checks: DoctorCheck[];
|
|
4525
|
+
nextActions: DoctorNextAction[];
|
|
4526
|
+
providerCliSetup: "ready" | "needs_attention" | "unknown";
|
|
4527
|
+
notEvaluated: readonly string[];
|
|
4528
|
+
exitCode: 0 | 1;
|
|
4529
|
+
}
|
|
4530
|
+
interface DoctorResult extends DoctorReport {
|
|
4531
|
+
message: string;
|
|
4532
|
+
}
|
|
4533
|
+
type HealthChecker = (serverUrl: string) => Promise<ServerHealth>;
|
|
4534
|
+
type LocalConfigurationInspector = (home: string) => Promise<LocalComputerConfigurationInspection>;
|
|
4535
|
+
type DaemonServiceInspector = (home: string) => Promise<DaemonServiceInfo>;
|
|
4536
|
+
type RuntimeDetector = (options: {
|
|
4537
|
+
environment: NodeJS.ProcessEnv;
|
|
4538
|
+
platform: NodeJS.Platform;
|
|
4539
|
+
}) => Promise<AgentRuntimeCliInstallation[]>;
|
|
4540
|
+
type IntegrationCliDetector = (options: {
|
|
4541
|
+
environment: NodeJS.ProcessEnv;
|
|
4542
|
+
platform: NodeJS.Platform;
|
|
4543
|
+
}) => Promise<IntegrationCliInstallation[]>;
|
|
4544
|
+
type ContextTreeInspector = (home: string) => Promise<ContextTreeState>;
|
|
4545
|
+
interface DoctorOptions {
|
|
4546
|
+
env?: NodeJS.ProcessEnv;
|
|
4547
|
+
platform?: NodeJS.Platform;
|
|
4548
|
+
arch?: string;
|
|
4549
|
+
nodeVersion?: string;
|
|
4550
|
+
cliVersion?: string;
|
|
4551
|
+
channel?: string;
|
|
4552
|
+
healthChecker?: HealthChecker;
|
|
4553
|
+
inspectLocalConfiguration?: LocalConfigurationInspector;
|
|
4554
|
+
inspectDaemonService?: DaemonServiceInspector;
|
|
4555
|
+
runtimeDetector?: RuntimeDetector;
|
|
4556
|
+
integrationCliDetector?: IntegrationCliDetector;
|
|
4557
|
+
inspectContextTreeState?: ContextTreeInspector;
|
|
4558
|
+
}
|
|
4559
|
+
declare function runDoctor(options?: DoctorOptions): Promise<DoctorResult>;
|
|
4560
|
+
//#endregion
|
|
4561
|
+
//#region src/core/provider-cli/shared.d.ts
|
|
4562
|
+
interface ProviderCliNextAction {
|
|
4563
|
+
readonly provider: ProviderCliProvider | "all";
|
|
4564
|
+
readonly command: string;
|
|
4565
|
+
readonly reason: string;
|
|
4566
|
+
}
|
|
4567
|
+
interface ProviderCliCommandDeps {
|
|
4568
|
+
/** OS account home override; tests inject an isolated account root. */
|
|
4569
|
+
readonly accountHome?: string;
|
|
4570
|
+
/** Invoking-process environment override (PATH authority for detection). */
|
|
4571
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
4572
|
+
readonly platform?: NodeJS.Platform;
|
|
4573
|
+
readonly arch?: string;
|
|
4574
|
+
readonly catalog?: readonly ProviderCliCatalogEntry[];
|
|
4575
|
+
readonly fetcher?: ProviderCliFetcher;
|
|
4576
|
+
readonly execFile?: ProviderCliExecFile;
|
|
4577
|
+
/** Test-only hook: runs inside the provider lock before the winner is persisted. */
|
|
4578
|
+
readonly beforeWinnerReverify?: (winner: ProviderCliCandidate) => Promise<void>;
|
|
4579
|
+
/** Test-only hook: replaces the cross-process lock retry wait. */
|
|
4580
|
+
readonly sleep?: (ms: number) => Promise<void>;
|
|
4581
|
+
readonly stdout?: (chunk: string) => void;
|
|
4582
|
+
readonly stderr?: (chunk: string) => void;
|
|
4583
|
+
}
|
|
4584
|
+
//#endregion
|
|
4585
|
+
//#region src/core/provider-cli/ensure.d.ts
|
|
4586
|
+
/**
|
|
4587
|
+
* Reusable orchestration for `opentag provider-cli ensure`.
|
|
4588
|
+
*
|
|
4589
|
+
* Human mode prints bounded single-line phase updates and never prompts, with or
|
|
4590
|
+
* without a TTY. `--json` mode writes one common command envelope and suppresses phase lines.
|
|
4591
|
+
*/
|
|
4592
|
+
interface ProviderCliEnsureCommandOptions extends ProviderCliCommandDeps {
|
|
4593
|
+
readonly provider: string;
|
|
4594
|
+
/** Observe real foreground phases when a parent command owns final presentation. */
|
|
4595
|
+
readonly onPhase?: (event: ProviderCliPhaseEvent) => void;
|
|
4596
|
+
readonly managedOnly?: boolean;
|
|
4597
|
+
/** `--no-path-update` passes false. */
|
|
4598
|
+
readonly pathUpdate?: boolean;
|
|
4599
|
+
readonly dryRun?: boolean;
|
|
4600
|
+
readonly json?: boolean;
|
|
4601
|
+
}
|
|
4602
|
+
interface ProviderCliEnsureCommandResult {
|
|
4603
|
+
readonly exitCode: CommandExitCode;
|
|
4604
|
+
readonly results: readonly ProviderCliEnsureResult[];
|
|
4605
|
+
readonly nextActions: readonly ProviderCliNextAction[];
|
|
4606
|
+
}
|
|
4607
|
+
declare function runProviderCliEnsure(options: ProviderCliEnsureCommandOptions): Promise<ProviderCliEnsureCommandResult>;
|
|
4608
|
+
//#endregion
|
|
4609
|
+
//#region src/core/provider-cli/inspect.d.ts
|
|
4610
|
+
/**
|
|
4611
|
+
* Reusable orchestration for `opentag provider-cli inspect`: read-only diagnostics for
|
|
4612
|
+
* the selected Provider CLI. `--json` emits one common command envelope.
|
|
4613
|
+
*/
|
|
4614
|
+
interface ProviderCliInspectCommandOptions extends ProviderCliCommandDeps {
|
|
4615
|
+
readonly provider: string;
|
|
4616
|
+
readonly json?: boolean;
|
|
4617
|
+
}
|
|
4618
|
+
interface ProviderCliInspectCommandResult {
|
|
4619
|
+
readonly exitCode: CommandExitCode;
|
|
4620
|
+
readonly results: readonly ProviderCliInspection[];
|
|
4621
|
+
readonly nextActions: readonly ProviderCliNextAction[];
|
|
4622
|
+
}
|
|
4623
|
+
declare function runProviderCliInspect(options: ProviderCliInspectCommandOptions): Promise<ProviderCliInspectCommandResult>;
|
|
4624
|
+
//#endregion
|
|
4625
|
+
//#region src/core/session/index.d.ts
|
|
4626
|
+
interface SessionMessageOptions {
|
|
4627
|
+
message?: string;
|
|
4628
|
+
messageFile?: string;
|
|
4629
|
+
messageId?: string;
|
|
4630
|
+
}
|
|
4631
|
+
declare function runSessionCreate(options: SessionMessageOptions & {
|
|
4632
|
+
model?: string;
|
|
4633
|
+
reasoningEffort?: string;
|
|
4634
|
+
maxDurationMs?: number;
|
|
4635
|
+
}): Promise<SessionCliCommandResponse>;
|
|
4636
|
+
declare function runSessionSend(targetSessionId: string, options: SessionMessageOptions): Promise<SessionCliCommandResponse>;
|
|
4637
|
+
declare function runSessionList(options: {
|
|
4638
|
+
recursive?: boolean;
|
|
4639
|
+
limit?: number;
|
|
4640
|
+
cursor?: string;
|
|
4641
|
+
since?: string;
|
|
4642
|
+
}): Promise<SessionCliListResponse>;
|
|
4643
|
+
declare function formatSessionCommandResult(result: SessionCliCommandResponse): string;
|
|
4644
|
+
declare function formatSessionList(result: SessionCliListResponse): string;
|
|
4645
|
+
//#endregion
|
|
4646
|
+
//#region src/index.d.ts
|
|
4647
|
+
declare const CommandError: typeof CommandError$1;
|
|
4648
|
+
declare const commandExitCode: typeof commandExitCode$1;
|
|
4649
|
+
declare const EXIT_CODES: {
|
|
4650
|
+
readonly success: 0;
|
|
4651
|
+
readonly failure: 1;
|
|
4652
|
+
readonly usage: 2;
|
|
4653
|
+
readonly serviceUnavailable: 3;
|
|
4654
|
+
readonly interrupted: 130;
|
|
4655
|
+
};
|
|
4656
|
+
declare const executeCommand: typeof executeCommand$1;
|
|
4657
|
+
declare const presentCommand: typeof presentCommand$1;
|
|
4658
|
+
declare const toCommandError: typeof toCommandError$1;
|
|
4659
|
+
//#endregion
|
|
4660
|
+
export { CHANNEL, CLI_PACKAGE_NAME, CLI_VERSION, CommandError, type CommandResult, type DoctorNextAction, type DoctorOptions, type DoctorResult, EXIT_CODES, type LoginOptions, type LoginResult, type ProviderCliEnsureCommandOptions, type ProviderCliEnsureCommandResult, type ProviderCliInspectCommandOptions, type ProviderCliInspectCommandResult, type ProviderCliNextAction, buildChildEnvironment, channelConfig, commandExitCode, createProgram, executeCommand, formatAgent, formatAgentBound, formatAgentCreated, formatAgentList, formatComputerList, formatSessionCommandResult, formatSessionList, listComputers, presentCommand, resolveCommandContext, runAgentBind, runAgentCreate, runAgentDelete, runAgentList, runAgentShow, runAgentUpdate, runDoctor, runLogin, runProviderCliEnsure, runProviderCliInspect, runSessionCreate, runSessionList, runSessionSend, selectComputer, toCommandError };
|
|
4661
|
+
//# sourceMappingURL=index.d.mts.map
|