@morlay/ui-conversation-message-actions 0.0.14 → 0.0.16

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.
@@ -1,9 +1,11 @@
1
1
  import { SessionEditor } from "./index.mjs";
2
2
  import { Context, Service } from "@deepseek-ai/cordis";
3
- import { Session, Session as Session$1, SessionEvent, SessionEvent as SessionEvent$1, SessionHeader, SessionHeader as SessionHeader$1, SessionId, SessionId as SessionIdBrand, SessionLogOffset, SessionSeq, SessionStore } from "@deepseek-ai/dsh-session";
3
+ import { Session, Session as Session$1, SessionEvent, SessionEvent as SessionEvent$1, SessionHeader, SessionHeader as SessionHeader$1, SessionId, SessionId as SessionIdBrand, SessionLogOffset, SessionSeq, SessionSeq as SessionSeq$1, SessionStore } from "@deepseek-ai/dsh-session";
4
4
  import { BranchBoundary, BranchTimeline, SessionBranch } from "@morlay/session-branch";
5
5
  import { TokenMeter } from "@deepseek-ai/dsh-token-meter";
6
+ import { ProjectionSnapshot, SessionProjectionMap } from "@deepseek-ai/dsh-session-projection";
6
7
  import { SessionPersistence, SessionPersistenceRevision, SessionStorageMetadata } from "@deepseek-ai/dsh-session-persistence";
8
+ import { SessionId as SessionId$1 } from "@deepseek-ai/dsh-session/types";
7
9
  //#region ../../vendor/deepseek-harness/vendor/cosmokit/lib/types/types.d.ts
8
10
  declare function isArrayBufferLike(value: any): value is ArrayBufferLike;
9
11
  declare function isArrayBufferSource(value: any): value is Binary.Source;
@@ -25,11 +27,11 @@ type Dict<T = any, K extends string | symbol = string> = { [key in K]: T; };
25
27
  //#endregion
26
28
  //#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
27
29
  /** The Standard Typed interface. This is a base type extended by other specs. */
28
- interface StandardTypedV1<Input = unknown, Output = Input> {
30
+ interface StandardTypedV1$1<Input = unknown, Output = Input> {
29
31
  /** The Standard properties. */
30
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
32
+ readonly "~standard": StandardTypedV1$1.Props<Input, Output>;
31
33
  }
32
- declare namespace StandardTypedV1 {
34
+ declare namespace StandardTypedV1$1 {
33
35
  /** The Standard Typed properties interface. */
34
36
  interface Props<Input = unknown, Output = Input> {
35
37
  /** The version number of the standard. */
@@ -47,20 +49,20 @@ declare namespace StandardTypedV1 {
47
49
  readonly output: Output;
48
50
  }
49
51
  /** Infers the input type of a Standard Typed. */
50
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
52
+ type InferInput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["input"];
51
53
  /** Infers the output type of a Standard Typed. */
52
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
54
+ type InferOutput<Schema extends StandardTypedV1$1> = NonNullable<Schema["~standard"]["types"]>["output"];
53
55
  }
54
56
  /** The Standard Schema interface. */
55
- interface StandardSchemaV1<Input = unknown, Output = Input> {
57
+ interface StandardSchemaV1$1<Input = unknown, Output = Input> {
56
58
  /** The Standard Schema properties. */
57
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
59
+ readonly "~standard": StandardSchemaV1$1.Props<Input, Output>;
58
60
  }
59
- declare namespace StandardSchemaV1 {
61
+ declare namespace StandardSchemaV1$1 {
60
62
  /** The Standard Schema properties interface. */
61
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
63
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1$1.Props<Input, Output> {
62
64
  /** Validates unknown input values. */
63
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
65
+ readonly validate: (value: unknown, options?: StandardSchemaV1$1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
64
66
  }
65
67
  /** The result interface of the validate function. */
66
68
  type Result<Output> = SuccessResult<Output> | FailureResult;
@@ -93,11 +95,11 @@ declare namespace StandardSchemaV1 {
93
95
  readonly key: PropertyKey;
94
96
  }
95
97
  /** The Standard types interface. */
96
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
98
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1$1.Types<Input, Output> {}
97
99
  /** Infers the input type of a Standard. */
98
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
100
+ type InferInput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferInput<Schema>;
99
101
  /** Infers the output type of a Standard. */
100
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
102
+ type InferOutput<Schema extends StandardTypedV1$1> = StandardTypedV1$1.InferOutput<Schema>;
101
103
  }
102
104
  //#endregion
103
105
  //#region ../../vendor/deepseek-harness/vendor/schemastery/lib/types/index.d.ts
@@ -236,7 +238,7 @@ declare global {
236
238
  value?: T;
237
239
  refs?: Dict<Schema>;
238
240
  preserve?: boolean;
239
- '~standard': StandardSchemaV1.Props;
241
+ '~standard': StandardSchemaV1$1.Props;
240
242
  /** Format this schema as a compact TypeScript-like type string. */
241
243
  toString(inline?: boolean): string;
242
244
  /** Serialize this schema, preserving shared and recursive references. */
@@ -294,39 +296,2577 @@ declare class ValidationError extends TypeError {
294
296
  type Schema<S = any, T = S> = Schemastery<S, T>;
295
297
  declare const Schema: Schemastery.Static;
296
298
  //#endregion
297
- //#region ../session-rdb/src/import.d.ts
298
- declare function parseJsonlArtifact(content: string): SessionStorageMetadata & {
299
- events: SessionEvent$1[];
299
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/json-schema.d.cts
300
+ type _JSONSchema = boolean | JSONSchema;
301
+ type SchemaType = "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
302
+ type JSONSchema = {
303
+ [k: string]: unknown;
304
+ $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
305
+ $id?: string;
306
+ $anchor?: string;
307
+ $ref?: string;
308
+ $dynamicRef?: string;
309
+ $dynamicAnchor?: string;
310
+ $vocabulary?: Record<string, boolean>;
311
+ $comment?: string;
312
+ $defs?: Record<string, JSONSchema>;
313
+ type?: SchemaType | SchemaType[];
314
+ additionalItems?: _JSONSchema;
315
+ unevaluatedItems?: _JSONSchema;
316
+ prefixItems?: _JSONSchema[];
317
+ items?: _JSONSchema | _JSONSchema[];
318
+ contains?: _JSONSchema;
319
+ additionalProperties?: _JSONSchema;
320
+ unevaluatedProperties?: _JSONSchema;
321
+ properties?: Record<string, _JSONSchema>;
322
+ patternProperties?: Record<string, _JSONSchema>;
323
+ dependentSchemas?: Record<string, _JSONSchema>;
324
+ propertyNames?: _JSONSchema;
325
+ if?: _JSONSchema;
326
+ then?: _JSONSchema;
327
+ else?: _JSONSchema;
328
+ allOf?: JSONSchema[];
329
+ anyOf?: JSONSchema[];
330
+ oneOf?: JSONSchema[];
331
+ not?: _JSONSchema;
332
+ multipleOf?: number;
333
+ maximum?: number;
334
+ exclusiveMaximum?: number | boolean;
335
+ minimum?: number;
336
+ exclusiveMinimum?: number | boolean;
337
+ maxLength?: number;
338
+ minLength?: number;
339
+ pattern?: string;
340
+ maxItems?: number;
341
+ minItems?: number;
342
+ uniqueItems?: boolean;
343
+ maxContains?: number;
344
+ minContains?: number;
345
+ maxProperties?: number;
346
+ minProperties?: number;
347
+ required?: string[];
348
+ dependentRequired?: Record<string, string[]>;
349
+ enum?: Array<string | number | boolean | null>;
350
+ const?: string | number | boolean | null;
351
+ id?: string;
352
+ title?: string;
353
+ description?: string;
354
+ default?: unknown;
355
+ deprecated?: boolean;
356
+ readOnly?: boolean;
357
+ writeOnly?: boolean;
358
+ nullable?: boolean;
359
+ examples?: unknown[];
360
+ format?: string;
361
+ contentMediaType?: string;
362
+ contentEncoding?: string;
363
+ contentSchema?: JSONSchema;
364
+ _prefault?: unknown;
300
365
  };
366
+ type BaseSchema = JSONSchema;
301
367
  //#endregion
302
- //#region ../../vendor/deepseek-harness/packages/settings/settings/lib/types/redact.d.ts
303
- /** One schema-declared secret position inside a redacted value. */
304
- interface RedactedSecret {
305
- /** Path from the section root to the removed field (concrete dict keys and array indexes included). */
306
- path: string[];
307
- /** Whether the field held a value before redaction. */
308
- set: boolean;
368
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/standard-schema.d.cts
369
+ /** The Standard interface. */
370
+ interface StandardTypedV1<Input = unknown, Output = Input> {
371
+ /** The Standard properties. */
372
+ readonly "~standard": StandardTypedV1.Props<Input, Output>;
373
+ }
374
+ declare namespace StandardTypedV1 {
375
+ /** The Standard properties interface. */
376
+ interface Props<Input = unknown, Output = Input> {
377
+ /** The version number of the standard. */
378
+ readonly version: 1;
379
+ /** The vendor name of the schema library. */
380
+ readonly vendor: string;
381
+ /** Inferred types associated with the schema. */
382
+ readonly types?: Types<Input, Output> | undefined;
383
+ }
384
+ /** The Standard types interface. */
385
+ interface Types<Input = unknown, Output = Input> {
386
+ /** The input type of the schema. */
387
+ readonly input: Input;
388
+ /** The output type of the schema. */
389
+ readonly output: Output;
390
+ }
391
+ /** Infers the input type of a Standard. */
392
+ type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
393
+ /** Infers the output type of a Standard. */
394
+ type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
395
+ }
396
+ /** The Standard Schema interface. */
397
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
398
+ /** The Standard Schema properties. */
399
+ readonly "~standard": StandardSchemaV1.Props<Input, Output>;
400
+ }
401
+ declare namespace StandardSchemaV1 {
402
+ /** The Standard Schema properties interface. */
403
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
404
+ /** Validates unknown input values. */
405
+ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
406
+ }
407
+ /** The result interface of the validate function. */
408
+ type Result<Output> = SuccessResult<Output> | FailureResult;
409
+ /** The result interface if validation succeeds. */
410
+ interface SuccessResult<Output> {
411
+ /** The typed output value. */
412
+ readonly value: Output;
413
+ /** The absence of issues indicates success. */
414
+ readonly issues?: undefined;
415
+ }
416
+ interface Options {
417
+ /** Implicit support for additional vendor-specific parameters, if needed. */
418
+ readonly libraryOptions?: Record<string, unknown> | undefined;
419
+ }
420
+ /** The result interface if validation fails. */
421
+ interface FailureResult {
422
+ /** The issues of failed validation. */
423
+ readonly issues: ReadonlyArray<Issue>;
424
+ }
425
+ /** The issue interface of the failure output. */
426
+ interface Issue {
427
+ /** The error message of the issue. */
428
+ readonly message: string;
429
+ /** The path of the issue, if any. */
430
+ readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
431
+ }
432
+ /** The path segment interface of the issue. */
433
+ interface PathSegment {
434
+ /** The key representing a path segment. */
435
+ readonly key: PropertyKey;
436
+ }
437
+ /** The Standard types interface. */
438
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
439
+ /** Infers the input type of a Standard. */
440
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
441
+ /** Infers the output type of a Standard. */
442
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
443
+ }
444
+ /** The Standard JSON Schema interface. */
445
+ interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
446
+ /** The Standard JSON Schema properties. */
447
+ readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
448
+ }
449
+ declare namespace StandardJSONSchemaV1 {
450
+ /** The Standard JSON Schema properties interface. */
451
+ interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
452
+ /** Methods for generating the input/output JSON Schema. */
453
+ readonly jsonSchema: Converter;
454
+ }
455
+ /** The Standard JSON Schema converter interface. */
456
+ interface Converter {
457
+ /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
458
+ readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
459
+ /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
460
+ readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
461
+ }
462
+ /** The target version of the generated JSON Schema.
463
+ *
464
+ * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use.
465
+ *
466
+ * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
467
+ *
468
+ * All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
469
+ */
470
+ type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
471
+ /** The options for the input/output methods. */
472
+ interface Options {
473
+ /** 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. */
474
+ readonly target: Target;
475
+ /** Implicit support for additional vendor-specific parameters, if needed. */
476
+ readonly libraryOptions?: Record<string, unknown> | undefined;
477
+ }
478
+ /** The Standard types interface. */
479
+ interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {}
480
+ /** Infers the input type of a Standard. */
481
+ type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
482
+ /** Infers the output type of a Standard. */
483
+ type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
309
484
  }
485
+ interface StandardSchemaWithJSONProps<Input = unknown, Output = Input> extends StandardSchemaV1.Props<Input, Output>, StandardJSONSchemaV1.Props<Input, Output> {}
310
486
  //#endregion
311
- //#region ../../vendor/deepseek-harness/packages/util/brand/lib/types/index.d.ts
487
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/registries.d.cts
488
+ declare const $output: unique symbol;
489
+ type $output = typeof $output;
490
+ declare const $input: unique symbol;
491
+ type $input = typeof $input;
492
+ 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;
493
+ type MetadataType = object | undefined;
494
+ declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
495
+ _meta: Meta;
496
+ _schema: Schema;
497
+ _map: WeakMap<Schema, $replace<Meta, Schema>>;
498
+ _idmap: Map<string, Schema>;
499
+ add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;
500
+ clear(): this;
501
+ remove(schema: Schema): this;
502
+ get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;
503
+ has(schema: Schema): boolean;
504
+ }
505
+ interface JSONSchemaMeta {
506
+ id?: string | undefined;
507
+ title?: string | undefined;
508
+ description?: string | undefined;
509
+ deprecated?: boolean | undefined;
510
+ [k: string]: unknown;
511
+ }
512
+ interface GlobalMeta extends JSONSchemaMeta {}
513
+ //#endregion
514
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/to-json-schema.d.cts
515
+ type Processor<T extends $ZodType = $ZodType> = (schema: T, ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void;
312
516
  /**
313
- * Duplicate-install-safe nominal primitive helpers.
314
- *
315
- * A brand makes structurally identical strings or numbers non-interchangeable
316
- * at the type level: a `SessionId` cannot be passed where a `ToolCallId` is
317
- * expected, and an event sequence cannot be passed as a log offset. Comparison,
318
- * logging, and serialization retain the underlying primitive behavior.
319
- *
320
- * This package owns no concrete domain value and keeps no runtime identity or mutable
321
- * state, so independently installed copies produce interchangeable values.
322
- *
323
- * @module @deepseek-ai/dsh-brand
517
+ * Called for each schema that has no JSON Schema equivalent. Return a JSON Schema to use in its
518
+ * place, `"any"` to fall back to the `unrepresentable: "any"` behavior, or `"throw"`/`undefined` to
519
+ * throw the default error. Throwing from the handler propagates, so custom errors work too.
324
520
  */
325
- declare const BRAND: unique symbol;
326
- /** A string carrying a compile-time-only brand `B`. */
327
- type Branded<B extends string> = string & {
328
- readonly [BRAND]: B;
521
+ type UnrepresentableHandler<T extends $ZodType = $ZodType> = (ctx: {
522
+ zodSchema: T;
523
+ path: (string | number)[];
524
+ /** The error Zod would throw. Distinguishes sites that share a `zodSchema`, e.g. an `undefined`
525
+ * vs a `bigint` member of the same literal. */
526
+ message: string;
527
+ }) => BaseSchema | "throw" | "any" | undefined;
528
+ interface JSONSchemaGeneratorParams {
529
+ processors: Record<string, Processor>;
530
+ /** A registry used to look up metadata for each schema. Any schema with an `id` property will be extracted as a $def.
531
+ * @default globalRegistry */
532
+ metadata?: $ZodRegistry<Record<string, any>>;
533
+ /** The JSON Schema version to target.
534
+ * - `"draft-2020-12"` — Default. JSON Schema Draft 2020-12
535
+ * - `"draft-07"` — JSON Schema Draft 7
536
+ * - `"draft-04"` — JSON Schema Draft 4
537
+ * - `"openapi-3.0"` — OpenAPI 3.0 Schema Object */
538
+ target?: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string) | undefined;
539
+ /** How to handle unrepresentable types.
540
+ * - `"throw"` — Default. Unrepresentable types throw an error
541
+ * - `"any"` — Unrepresentable types become `{}`
542
+ * - A function — called once per unrepresentable schema; see {@link UnrepresentableHandler}. */
543
+ unrepresentable?: "throw" | "any" | UnrepresentableHandler<$ZodTypes>;
544
+ /** Arbitrary custom logic that can be used to modify the generated JSON Schema. */
545
+ override?: (ctx: {
546
+ zodSchema: $ZodTypes;
547
+ jsonSchema: BaseSchema;
548
+ path: (string | number)[];
549
+ }) => void;
550
+ /** Whether to extract the `"input"` or `"output"` type. Relevant to transforms, defaults, coerced primitives, etc.
551
+ * - `"output"` — Default. Convert the output schema.
552
+ * - `"input"` — Convert the input schema. */
553
+ io?: "input" | "output";
554
+ cycles?: "ref" | "throw";
555
+ reused?: "ref" | "inline";
556
+ external?: {
557
+ registry: $ZodRegistry<{
558
+ id?: string | undefined;
559
+ }>;
560
+ uri?: ((id: string) => string) | undefined;
561
+ defs: Record<string, BaseSchema>;
562
+ } | undefined;
563
+ }
564
+ /**
565
+ * Parameters for the toJSONSchema function.
566
+ */
567
+ type ToJSONSchemaParams = Omit<JSONSchemaGeneratorParams, "processors" | "external">;
568
+ interface ProcessParams {
569
+ schemaPath: $ZodType[];
570
+ path: (string | number)[];
571
+ }
572
+ interface Seen {
573
+ /** JSON Schema result for this Zod schema */
574
+ schema: BaseSchema;
575
+ /** A cached version of the schema that doesn't get overwritten during ref resolution */
576
+ def?: BaseSchema;
577
+ defId?: string | undefined;
578
+ /** Number of times this schema was encountered during traversal */
579
+ count: number;
580
+ /** Cycle path */
581
+ cycle?: (string | number)[] | undefined;
582
+ isParent?: boolean | undefined;
583
+ /** Schema to inherit JSON Schema properties from (set by processor for wrappers) */
584
+ ref?: $ZodType | null;
585
+ /** JSON Schema property path for this schema */
586
+ path?: (string | number)[] | undefined;
587
+ }
588
+ interface ToJSONSchemaContext {
589
+ processors: Record<string, Processor>;
590
+ metadataRegistry: $ZodRegistry<Record<string, any>>;
591
+ target: "draft-04" | "draft-07" | "draft-2020-12" | "openapi-3.0" | ({} & string);
592
+ unrepresentable: "throw" | "any" | UnrepresentableHandler;
593
+ override: (ctx: {
594
+ zodSchema: $ZodType;
595
+ jsonSchema: BaseSchema;
596
+ path: (string | number)[];
597
+ }) => void;
598
+ io: "input" | "output";
599
+ counter: number;
600
+ seen: Map<$ZodType, Seen>;
601
+ /** Registry conversions share one `seen` map across every emitted schema. These hold the
602
+ * `external` the whole-map passes below last ran for, so the passes are not repeated once per
603
+ * schema — and still re-run if the map grows or `external` is swapped. `sharedEmitDoneFor`
604
+ * covers both passes in `finalize`: the ref flattening and the `$defs` build.
605
+ *
606
+ * The passes are valid only while nothing they read has changed, so both are cleared in
607
+ * `processSchema()` when the map grows, and in `JSONSchemaGenerator.emit()`, which can also change
608
+ * the `cycles` and `reused` they branch on.
609
+ *
610
+ * One case is deliberately not covered: an `override` callback that writes to
611
+ * `metadataRegistry` mid-conversion. It runs inside `finalize`, so a registry conversion has
612
+ * nowhere left to clear the guards, and later schemas keep the ids the first pass saw. That
613
+ * output was never coherent — before this, whether a shared subschema was inlined or extracted
614
+ * depended on which registry entry happened to be emitted when the callback fired. */
615
+ sharedDefsExtractedFor?: ToJSONSchemaContext["external"];
616
+ sharedEmitDoneFor?: ToJSONSchemaContext["external"];
617
+ cycles: "ref" | "throw";
618
+ reused: "ref" | "inline";
619
+ /** The `allOf` array of each intersection encountered during traversal, innermost first. `finalize` folds every emitted object holding one; see `foldIntersection`. */
620
+ intersections: BaseSchema[][];
621
+ /** Rewrites a processor deferred to `finalize`, where the flatten has resolved every ref and the union branches are in place. */
622
+ deferred: (() => void)[];
623
+ external?: {
624
+ registry: $ZodRegistry<{
625
+ id?: string | undefined;
626
+ }>;
627
+ uri?: ((id: string) => string) | undefined;
628
+ defs: Record<string, BaseSchema>;
629
+ } | undefined;
630
+ }
631
+ type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
632
+ interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
633
+ "~standard": ZodStandardSchemaWithJSON$1<T>;
634
+ }
635
+ //#endregion
636
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/util.d.cts
637
+ 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 & {});
638
+ type IsAny<T> = 0 extends 1 & T ? true : false;
639
+ type Omit$1<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
640
+ type MakePartial<T, K extends keyof T> = Omit$1<T, K> & InexactPartial<Pick<T, K>>;
641
+ type NoUndefined<T> = T extends undefined ? never : T;
642
+ type Widen<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends bigint ? bigint : T;
643
+ type LoosePartial<T extends object> = InexactPartial<T> & {
644
+ [k: string]: unknown;
645
+ };
646
+ type InexactPartial<T> = { [P in keyof T]?: T[P] | undefined; };
647
+ type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
648
+ readonly [Symbol.toStringTag]: string;
649
+ } | Date | Error | Generator | Promise<unknown> | RegExp;
650
+ 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>;
651
+ type Identity<T> = T;
652
+ type Flatten<T> = Identity<{ [k in keyof T]: T[k]; }>;
653
+ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
654
+ type TupleItems = ReadonlyArray<SomeType>;
655
+ type AnyFunc = (...args: any[]) => any;
656
+ type MaybeAsync<T> = T | Promise<T>;
657
+ type EnumValue = string | number;
658
+ type EnumLike = Readonly<Record<string, EnumValue>>;
659
+ type Literal = string | number | bigint | boolean | null | undefined;
660
+ type Primitive = string | number | symbol | bigint | boolean | null | undefined;
661
+ type HasLength = {
662
+ length: number;
663
+ };
664
+ type PropValues = Record<string, Set<Primitive>>;
665
+ type PrimitiveSet = Set<Primitive>;
666
+ type EmptyToNever<T> = keyof T extends never ? never : T;
667
+ declare abstract class Class {
668
+ constructor(..._args: any[]);
669
+ }
670
+ /** A trait's prototype members: a partial view of its own interface, with `this` typed as the instance. */
671
+ type ProtoOf<T> = { [K in keyof T]?: (T[K] extends ((...args: infer A) => infer R) ? (...args: A) => R : T[K]) | undefined; } & ThisType<T>;
672
+ //#endregion
673
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/versions.d.cts
674
+ declare const version: {
675
+ readonly major: 4;
676
+ readonly minor: 6;
677
+ readonly patch: number;
678
+ };
679
+ //#endregion
680
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/schemas.d.cts
681
+ interface ParseContext<T extends $ZodIssueBase = never> {
682
+ /** Customize error messages. */
683
+ readonly error?: $ZodErrorMap<T>;
684
+ /** Include the `input` field in issue objects. Default `false`. */
685
+ readonly reportInput?: boolean;
686
+ /** Skip eval-based fast path. Default `false`. */
687
+ readonly jitless?: boolean;
688
+ }
689
+ /** @internal */
690
+ interface ParseContextInternal<T extends $ZodIssueBase = never> extends ParseContext<T> {
691
+ readonly async?: boolean | undefined;
692
+ readonly direction?: "forward" | "backward";
693
+ readonly skipChecks?: boolean;
694
+ /** Set only by `validate`/`validateAsync`. A container may stop before its next child, never inside one, so a map entry and a tuple's fixed items parse whole. */
695
+ readonly abortEarly?: boolean;
696
+ }
697
+ interface ParsePayload<T = unknown> {
698
+ value: T;
699
+ issues: $ZodRawIssue[];
700
+ /** A way to mark a whole payload as aborted. Used in codecs/pipes. */
701
+ aborted?: boolean;
702
+ /** @internal Set when the value came from a repeat visit to a node still being
703
+ * parsed. Its checks run on the node itself, against the finished value. */
704
+ memo?: boolean | undefined;
705
+ }
706
+ type CheckFn<T> = (input: ParsePayload<T>) => MaybeAsync<void>;
707
+ interface $ZodTypeDef {
708
+ 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" | "properties";
709
+ error?: $ZodErrorMap<never> | undefined;
710
+ checks?: $ZodCheck<never>[];
711
+ }
712
+ interface _$ZodTypeInternals {
713
+ /** The `@zod/core` version of this schema */
714
+ version: typeof version;
715
+ /** Schema definition. */
716
+ def: $ZodTypeDef;
717
+ /** @internal Randomly generated ID for this schema. */
718
+ /** @internal List of deferred initializers. */
719
+ deferred: AnyFunc[] | undefined;
720
+ /** @internal Parses input and runs all checks (refinements). */
721
+ run(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
722
+ /** @internal Parses input, doesn't run checks. */
723
+ parse(payload: ParsePayload<any>, ctx: ParseContextInternal): MaybeAsync<ParsePayload>;
724
+ /** @internal Stores identifiers for the set of traits implemented by this schema. */
725
+ traits: Set<string>;
726
+ /** @internal Indicates that a schema output type should be considered optional inside objects.
727
+ * @default Required
728
+ */
729
+ /** @internal Three rungs, each strictly stronger than the last:
730
+ * undefined — required; the container may not omit this slot
731
+ * "optional" — the container may omit it; nothing is supplied in its place
732
+ * "defaulted" — the container may omit it AND this schema substitutes a value
733
+ * Consumers asking "may the slot be absent?" test `!== undefined`.
734
+ * $ZodOptional asks the stronger question and tests `=== "defaulted"`. */
735
+ optin?: "optional" | "defaulted" | undefined;
736
+ /** @internal */
737
+ optout?: "optional" | undefined;
738
+ /** @internal The set of literal values that will pass validation. Must be an exhaustive set. Used to determine optionality in z.record().
739
+ *
740
+ * Defined on: enum, const, literal, null, undefined
741
+ * Passthrough: optional, nullable, branded, default, catch, pipe
742
+ * Todo: unions?
743
+ */
744
+ values?: PrimitiveSet | undefined;
745
+ /** Default value bubbled up from */
746
+ /** @internal A set of literal discriminators used for the fast path in discriminated unions. */
747
+ propValues?: PropValues | undefined;
748
+ /** @internal This flag indicates that a schema validation can be represented with a regular expression. Used to determine allowable schemas in z.templateLiteral(). */
749
+ pattern: RegExp | undefined;
750
+ /** @internal The constructor function of this schema. */
751
+ constr: new (def: any) => $ZodType;
752
+ /** @internal A catchall object for bag metadata related to this schema. Commonly modified by checks using `onattach`. */
753
+ bag: Record<string, unknown>;
754
+ /** @internal The set of issues this schema might throw during type checking. */
755
+ isst: $ZodIssueBase;
756
+ /** @internal Subject to change, not a public API. */
757
+ processJSONSchema?: ((ctx: ToJSONSchemaContext, json: BaseSchema, params: ProcessParams) => void) | undefined;
758
+ /** An optional method used to override `toJSONSchema` logic. */
759
+ toJSONSchema?: () => unknown;
760
+ /** @internal The parent of this schema. Only set during certain clone operations. */
761
+ parent?: $ZodType | undefined;
762
+ }
763
+ /** @internal */
764
+ interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeInternals {
765
+ /** @internal The inferred output type */
766
+ output: O;
767
+ /** @internal The inferred input type */
768
+ input: I;
769
+ }
770
+ type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
771
+ type SomeType = {
772
+ _zod: _$ZodTypeInternals;
773
+ };
774
+ interface $ZodType<O = unknown, I = unknown, Internals extends $ZodTypeInternals<O, I> = $ZodTypeInternals<O, I>> {
775
+ _zod: Internals;
776
+ "~standard": $ZodStandardSchema<this>;
777
+ }
778
+ interface _$ZodType<T extends $ZodTypeInternals = $ZodTypeInternals> extends $ZodType<T["output"], T["input"], T> {}
779
+ declare const $ZodType: $constructor<$ZodType>;
780
+ interface $ZodStringDef extends $ZodTypeDef {
781
+ type: "string";
782
+ coerce?: boolean;
783
+ checks?: $ZodCheck<string>[];
784
+ }
785
+ interface $ZodStringInternals<Input> extends $ZodTypeInternals<string, Input> {
786
+ def: $ZodStringDef;
787
+ /** @deprecated Internal API, use with caution (not deprecated) */
788
+ pattern: RegExp;
789
+ /** @deprecated Internal API, use with caution (not deprecated) */
790
+ isst: $ZodIssueInvalidType;
791
+ bag: LoosePartial<{
792
+ minimum: number;
793
+ maximum: number;
794
+ patterns: Set<RegExp>;
795
+ format: string;
796
+ contentEncoding: string;
797
+ /** the pattern admits strings its `format` keyword forbids, so `toJSONSchema` must not emit it */
798
+ laxFormat: boolean;
799
+ }>;
800
+ }
801
+ interface $ZodString<Input = unknown> extends _$ZodType<$ZodStringInternals<Input>> {}
802
+ declare const $ZodString: $constructor<$ZodString>;
803
+ interface $ZodNumberDef extends $ZodTypeDef {
804
+ type: "number";
805
+ coerce?: boolean;
806
+ }
807
+ interface $ZodNumberInternals<Input = unknown> extends $ZodTypeInternals<number, Input> {
808
+ def: $ZodNumberDef;
809
+ /** @deprecated Internal API, use with caution (not deprecated) */
810
+ pattern: RegExp;
811
+ /** @deprecated Internal API, use with caution (not deprecated) */
812
+ isst: $ZodIssueInvalidType;
813
+ bag: LoosePartial<{
814
+ minimum: number;
815
+ maximum: number;
816
+ exclusiveMinimum: number;
817
+ exclusiveMaximum: number;
818
+ format: string;
819
+ pattern: RegExp;
820
+ }>;
821
+ }
822
+ interface $ZodNumber<Input = unknown> extends $ZodType {
823
+ _zod: $ZodNumberInternals<Input>;
824
+ }
825
+ declare const $ZodNumber: $constructor<$ZodNumber>;
826
+ interface $ZodBooleanDef extends $ZodTypeDef {
827
+ type: "boolean";
828
+ coerce?: boolean;
829
+ checks?: $ZodCheck<boolean>[];
830
+ }
831
+ interface $ZodBooleanInternals<T = unknown> extends $ZodTypeInternals<boolean, T> {
832
+ pattern: RegExp;
833
+ def: $ZodBooleanDef;
834
+ isst: $ZodIssueInvalidType;
835
+ }
836
+ interface $ZodBoolean<T = unknown> extends $ZodType {
837
+ _zod: $ZodBooleanInternals<T>;
838
+ }
839
+ declare const $ZodBoolean: $constructor<$ZodBoolean>;
840
+ interface $ZodBigIntDef extends $ZodTypeDef {
841
+ type: "bigint";
842
+ coerce?: boolean;
843
+ }
844
+ interface $ZodBigIntInternals<T = unknown> extends $ZodTypeInternals<bigint, T> {
845
+ pattern: RegExp;
846
+ /** @internal Internal API, use with caution */
847
+ def: $ZodBigIntDef;
848
+ isst: $ZodIssueInvalidType;
849
+ bag: LoosePartial<{
850
+ minimum: bigint;
851
+ maximum: bigint;
852
+ format: string;
853
+ }>;
854
+ }
855
+ interface $ZodBigInt<T = unknown> extends $ZodType {
856
+ _zod: $ZodBigIntInternals<T>;
857
+ }
858
+ declare const $ZodBigInt: $constructor<$ZodBigInt>;
859
+ interface $ZodSymbolDef extends $ZodTypeDef {
860
+ type: "symbol";
861
+ }
862
+ interface $ZodSymbolInternals extends $ZodTypeInternals<symbol, symbol> {
863
+ def: $ZodSymbolDef;
864
+ isst: $ZodIssueInvalidType;
865
+ }
866
+ interface $ZodSymbol extends $ZodType {
867
+ _zod: $ZodSymbolInternals;
868
+ }
869
+ declare const $ZodSymbol: $constructor<$ZodSymbol>;
870
+ interface $ZodUndefinedDef extends $ZodTypeDef {
871
+ type: "undefined";
872
+ }
873
+ interface $ZodUndefinedInternals extends $ZodTypeInternals<undefined, undefined> {
874
+ pattern: RegExp;
875
+ def: $ZodUndefinedDef;
876
+ values: PrimitiveSet;
877
+ isst: $ZodIssueInvalidType;
878
+ }
879
+ interface $ZodUndefined extends $ZodType {
880
+ _zod: $ZodUndefinedInternals;
881
+ }
882
+ declare const $ZodUndefined: $constructor<$ZodUndefined>;
883
+ interface $ZodNullDef extends $ZodTypeDef {
884
+ type: "null";
885
+ }
886
+ interface $ZodNullInternals extends $ZodTypeInternals<null, null> {
887
+ pattern: RegExp;
888
+ def: $ZodNullDef;
889
+ values: PrimitiveSet;
890
+ isst: $ZodIssueInvalidType;
891
+ }
892
+ interface $ZodNull extends $ZodType {
893
+ _zod: $ZodNullInternals;
894
+ }
895
+ declare const $ZodNull: $constructor<$ZodNull>;
896
+ interface $ZodAnyDef extends $ZodTypeDef {
897
+ type: "any";
898
+ }
899
+ interface $ZodAnyInternals extends $ZodTypeInternals<any, any> {
900
+ def: $ZodAnyDef;
901
+ isst: never;
902
+ }
903
+ interface $ZodAny extends $ZodType {
904
+ _zod: $ZodAnyInternals;
905
+ }
906
+ declare const $ZodAny: $constructor<$ZodAny>;
907
+ interface $ZodUnknownDef extends $ZodTypeDef {
908
+ type: "unknown";
909
+ }
910
+ interface $ZodUnknownInternals extends $ZodTypeInternals<unknown, unknown> {
911
+ def: $ZodUnknownDef;
912
+ isst: never;
913
+ }
914
+ interface $ZodUnknown extends $ZodType {
915
+ _zod: $ZodUnknownInternals;
916
+ }
917
+ declare const $ZodUnknown: $constructor<$ZodUnknown>;
918
+ interface $ZodNeverDef extends $ZodTypeDef {
919
+ type: "never";
920
+ }
921
+ interface $ZodNeverInternals extends $ZodTypeInternals<never, never> {
922
+ def: $ZodNeverDef;
923
+ isst: $ZodIssueInvalidType;
924
+ }
925
+ interface $ZodNever extends $ZodType {
926
+ _zod: $ZodNeverInternals;
927
+ }
928
+ declare const $ZodNever: $constructor<$ZodNever>;
929
+ interface $ZodVoidDef extends $ZodTypeDef {
930
+ type: "void";
931
+ }
932
+ interface $ZodVoidInternals extends $ZodTypeInternals<void, void> {
933
+ def: $ZodVoidDef;
934
+ isst: $ZodIssueInvalidType;
935
+ }
936
+ interface $ZodVoid extends $ZodType {
937
+ _zod: $ZodVoidInternals;
938
+ }
939
+ declare const $ZodVoid: $constructor<$ZodVoid>;
940
+ interface $ZodDateDef extends $ZodTypeDef {
941
+ type: "date";
942
+ coerce?: boolean;
943
+ }
944
+ interface $ZodDateInternals<T = unknown> extends $ZodTypeInternals<Date, T> {
945
+ def: $ZodDateDef;
946
+ isst: $ZodIssueInvalidType;
947
+ bag: LoosePartial<{
948
+ minimum: Date;
949
+ maximum: Date;
950
+ format: string;
951
+ }>;
952
+ }
953
+ interface $ZodDate<T = unknown> extends $ZodType {
954
+ _zod: $ZodDateInternals<T>;
955
+ }
956
+ declare const $ZodDate: $constructor<$ZodDate>;
957
+ interface $ZodArrayDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
958
+ type: "array";
959
+ element: T;
960
+ }
961
+ interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInternals {
962
+ def: $ZodArrayDef<T>;
963
+ isst: $ZodIssueInvalidType;
964
+ output: output<T>[];
965
+ input: input<T>[];
966
+ }
967
+ interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
968
+ declare const $ZodArray: $constructor<$ZodArray>;
969
+ type OptionalOutSchema = {
970
+ _zod: {
971
+ optout: "optional";
972
+ };
973
+ };
974
+ type OptionalInSchema = {
975
+ _zod: {
976
+ optin: "optional" | "defaulted";
977
+ };
978
+ };
979
+ type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : { [k in 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>;
980
+ type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : { [k in 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>;
981
+ type $ZodObjectConfig = {
982
+ out: Record<string, unknown>;
983
+ in: Record<string, unknown>;
984
+ };
985
+ type $ZodShape = Readonly<{
986
+ [k: string]: $ZodType;
987
+ }>;
988
+ interface $ZodObjectDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef {
989
+ type: "object";
990
+ shape: Shape;
991
+ catchall?: $ZodType | undefined;
992
+ }
993
+ interface $ZodObjectInternals<
994
+ /** @ts-ignore Cast variance */
995
+ out Shape extends $ZodShape = $ZodShape, out Config extends $ZodObjectConfig = $ZodObjectConfig> extends _$ZodTypeInternals {
996
+ def: $ZodObjectDef<Shape>;
997
+ config: Config;
998
+ isst: $ZodIssueInvalidType | $ZodIssueUnrecognizedKeys;
999
+ propValues: PropValues;
1000
+ output: $InferObjectOutput<Shape, Config["out"]>;
1001
+ input: $InferObjectInput<Shape, Config["in"]>;
1002
+ optin?: "optional" | undefined;
1003
+ optout?: "optional" | undefined;
1004
+ }
1005
+ type $ZodLooseShape = Record<string, any>;
1006
+ interface $ZodObject<
1007
+ /** @ts-ignore Cast variance */
1008
+ out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
1009
+ declare const $ZodObject: $constructor<$ZodObject>;
1010
+ type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
1011
+ type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
1012
+ interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
1013
+ type: "union";
1014
+ options: Options;
1015
+ inclusive?: boolean;
1016
+ }
1017
+ type IsOptionalIn<T extends SomeType> = T extends OptionalInSchema ? true : false;
1018
+ type IsOptionalOut<T extends SomeType> = T extends OptionalOutSchema ? true : false;
1019
+ interface $ZodUnionInternals<T extends readonly SomeType[] = readonly $ZodType[]> extends _$ZodTypeInternals {
1020
+ def: $ZodUnionDef<T>;
1021
+ isst: $ZodIssueInvalidUnion;
1022
+ pattern: T[number]["_zod"]["pattern"];
1023
+ values: T[number]["_zod"]["values"];
1024
+ output: $InferUnionOutput<T[number]>;
1025
+ input: $InferUnionInput<T[number]>;
1026
+ optin: IsOptionalIn<T[number]> extends false ? "optional" | "defaulted" | undefined : "optional" | "defaulted";
1027
+ optout: IsOptionalOut<T[number]> extends false ? "optional" | undefined : "optional";
1028
+ }
1029
+ interface $ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends $ZodType<any, any, $ZodUnionInternals<T>> {
1030
+ _zod: $ZodUnionInternals<T>;
1031
+ }
1032
+ declare const $ZodUnion: $constructor<$ZodUnion>;
1033
+ interface $ZodIntersectionDef<Left extends SomeType = $ZodType, Right extends SomeType = $ZodType> extends $ZodTypeDef {
1034
+ type: "intersection";
1035
+ left: Left;
1036
+ right: Right;
1037
+ }
1038
+ interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _$ZodTypeInternals {
1039
+ def: $ZodIntersectionDef<A, B>;
1040
+ isst: never;
1041
+ optin: A["_zod"]["optin"] | B["_zod"]["optin"];
1042
+ optout: A["_zod"]["optout"] | B["_zod"]["optout"];
1043
+ output: output<A> & output<B>;
1044
+ input: input<A> & input<B>;
1045
+ }
1046
+ interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
1047
+ _zod: $ZodIntersectionInternals<A, B>;
1048
+ }
1049
+ declare const $ZodIntersection: $constructor<$ZodIntersection>;
1050
+ interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodTypeDef {
1051
+ type: "tuple";
1052
+ items: T;
1053
+ rest: Rest;
1054
+ }
1055
+ type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input<Rest>[] : [])];
1056
+ type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input<T[k]>; };
1057
+ 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> : [];
1058
+ type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output<Rest>[] : [])];
1059
+ type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output<T[k]>; };
1060
+ 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> : [];
1061
+ interface $ZodTupleInternals<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends _$ZodTypeInternals {
1062
+ def: $ZodTupleDef<T, Rest>;
1063
+ isst: $ZodIssueInvalidType | $ZodIssueTooBig<unknown[]> | $ZodIssueTooSmall<unknown[]>;
1064
+ output: $InferTupleOutputType<T, Rest>;
1065
+ input: $InferTupleInputType<T, Rest>;
1066
+ }
1067
+ interface $ZodTuple<T extends TupleItems = readonly $ZodType[], Rest extends SomeType | null = $ZodType | null> extends $ZodType {
1068
+ _zod: $ZodTupleInternals<T, Rest>;
1069
+ }
1070
+ declare const $ZodTuple: $constructor<$ZodTuple>;
1071
+ type $ZodRecordKey = $ZodType<string | number | symbol, unknown>;
1072
+ interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeDef {
1073
+ type: "record";
1074
+ keyType: Key;
1075
+ valueType: Value;
1076
+ /** @default "strict" - errors on keys not matching keyType. "loose" passes through non-matching keys unchanged. */
1077
+ mode?: "strict" | "loose";
1078
+ partial?: boolean;
1079
+ }
1080
+ type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
1081
+ 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>>;
1082
+ interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
1083
+ def: $ZodRecordDef<Key, Value>;
1084
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
1085
+ optin?: "optional" | undefined;
1086
+ optout?: "optional" | undefined;
1087
+ }
1088
+ type $partial = {
1089
+ "~~partial": true;
329
1090
  };
1091
+ interface $ZodRecord<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodType {
1092
+ _zod: $ZodRecordInternals<Key, Value>;
1093
+ }
1094
+ declare const $ZodRecord: $constructor<$ZodRecord>;
1095
+ interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeDef {
1096
+ type: "map";
1097
+ keyType: Key;
1098
+ valueType: Value;
1099
+ }
1100
+ interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
1101
+ def: $ZodMapDef<Key, Value>;
1102
+ isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
1103
+ optin?: "optional" | undefined;
1104
+ optout?: "optional" | undefined;
1105
+ }
1106
+ interface $ZodMap<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodType {
1107
+ _zod: $ZodMapInternals<Key, Value>;
1108
+ }
1109
+ declare const $ZodMap: $constructor<$ZodMap>;
1110
+ interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1111
+ type: "set";
1112
+ valueType: T;
1113
+ }
1114
+ interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input<T>>> {
1115
+ def: $ZodSetDef<T>;
1116
+ isst: $ZodIssueInvalidType;
1117
+ optin?: "optional" | undefined;
1118
+ optout?: "optional" | undefined;
1119
+ }
1120
+ interface $ZodSet<T extends SomeType = $ZodType> extends $ZodType {
1121
+ _zod: $ZodSetInternals<T>;
1122
+ }
1123
+ declare const $ZodSet: $constructor<$ZodSet>;
1124
+ type $InferEnumOutput<T extends EnumLike> = T[keyof T] & {};
1125
+ type $InferEnumInput<T extends EnumLike> = T[keyof T] & {};
1126
+ interface $ZodEnumDef<T extends EnumLike = EnumLike> extends $ZodTypeDef {
1127
+ type: "enum";
1128
+ entries: T;
1129
+ }
1130
+ interface $ZodEnumInternals<
1131
+ /** @ts-ignore Cast variance */
1132
+ out T extends EnumLike = EnumLike> extends $ZodTypeInternals<$InferEnumOutput<T>, $InferEnumInput<T>> {
1133
+ def: $ZodEnumDef<T>;
1134
+ /** @deprecated Internal API, use with caution (not deprecated) */
1135
+ values: PrimitiveSet;
1136
+ /** @deprecated Internal API, use with caution (not deprecated) */
1137
+ pattern: RegExp;
1138
+ isst: $ZodIssueInvalidValue;
1139
+ }
1140
+ interface $ZodEnum<T extends EnumLike = EnumLike> extends $ZodType {
1141
+ _zod: $ZodEnumInternals<T>;
1142
+ }
1143
+ declare const $ZodEnum: $constructor<$ZodEnum>;
1144
+ interface $ZodLiteralDef<T extends Literal> extends $ZodTypeDef {
1145
+ type: "literal";
1146
+ values: T[];
1147
+ }
1148
+ interface $ZodLiteralInternals<T extends Literal = Literal> extends $ZodTypeInternals<T, T> {
1149
+ def: $ZodLiteralDef<T>;
1150
+ values: Set<T>;
1151
+ pattern: RegExp;
1152
+ isst: $ZodIssueInvalidValue;
1153
+ }
1154
+ interface $ZodLiteral<T extends Literal = Literal> extends $ZodType {
1155
+ _zod: $ZodLiteralInternals<T>;
1156
+ }
1157
+ declare const $ZodLiteral: $constructor<$ZodLiteral>;
1158
+ type _File = typeof globalThis extends {
1159
+ File: infer F extends new (...args: any[]) => any;
1160
+ } ? InstanceType<F> : {};
1161
+ /** Do not reference this directly. */
1162
+ interface File extends _File {
1163
+ readonly type: string;
1164
+ readonly size: number;
1165
+ }
1166
+ interface $ZodFileDef extends $ZodTypeDef {
1167
+ type: "file";
1168
+ }
1169
+ interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
1170
+ def: $ZodFileDef;
1171
+ isst: $ZodIssueInvalidType;
1172
+ bag: LoosePartial<{
1173
+ minimum: number;
1174
+ maximum: number;
1175
+ mime: MimeTypes[];
1176
+ }>;
1177
+ }
1178
+ interface $ZodFile extends $ZodType {
1179
+ _zod: $ZodFileInternals;
1180
+ }
1181
+ declare const $ZodFile: $constructor<$ZodFile>;
1182
+ interface $ZodTransformDef extends $ZodTypeDef {
1183
+ type: "transform";
1184
+ transform: (input: unknown, payload: ParsePayload<unknown>) => MaybeAsync<unknown>;
1185
+ }
1186
+ interface $ZodTransformInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I> {
1187
+ def: $ZodTransformDef;
1188
+ isst: never;
1189
+ }
1190
+ interface $ZodTransform<O = unknown, I = unknown> extends $ZodType {
1191
+ _zod: $ZodTransformInternals<O, I>;
1192
+ }
1193
+ declare const $ZodTransform: $constructor<$ZodTransform>;
1194
+ interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1195
+ type: "optional";
1196
+ innerType: T;
1197
+ }
1198
+ interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
1199
+ def: $ZodOptionalDef<T>;
1200
+ optin: "optional" | "defaulted";
1201
+ optout: "optional";
1202
+ isst: never;
1203
+ values: T["_zod"]["values"];
1204
+ pattern: T["_zod"]["pattern"];
1205
+ }
1206
+ interface $ZodOptional<T extends SomeType = $ZodType> extends $ZodType {
1207
+ _zod: $ZodOptionalInternals<T>;
1208
+ }
1209
+ declare const $ZodOptional: $constructor<$ZodOptional>;
1210
+ interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOptionalDef<T> {}
1211
+ interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
1212
+ def: $ZodExactOptionalDef<T>;
1213
+ output: output<T>;
1214
+ input: input<T>;
1215
+ }
1216
+ interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
1217
+ _zod: $ZodExactOptionalInternals<T>;
1218
+ }
1219
+ declare const $ZodExactOptional: $constructor<$ZodExactOptional>;
1220
+ interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1221
+ type: "nullable";
1222
+ innerType: T;
1223
+ }
1224
+ interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
1225
+ def: $ZodNullableDef<T>;
1226
+ optin: T["_zod"]["optin"];
1227
+ optout: T["_zod"]["optout"];
1228
+ isst: never;
1229
+ values: T["_zod"]["values"];
1230
+ pattern: T["_zod"]["pattern"];
1231
+ }
1232
+ interface $ZodNullable<T extends SomeType = $ZodType> extends $ZodType {
1233
+ _zod: $ZodNullableInternals<T>;
1234
+ }
1235
+ declare const $ZodNullable: $constructor<$ZodNullable>;
1236
+ interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1237
+ type: "default";
1238
+ innerType: T;
1239
+ /** The default value. May be a getter. */
1240
+ defaultValue: NoUndefined<output<T>>;
1241
+ }
1242
+ interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1243
+ def: $ZodDefaultDef<T>;
1244
+ optin: "defaulted";
1245
+ optout?: "optional" | undefined;
1246
+ isst: never;
1247
+ values: T["_zod"]["values"];
1248
+ }
1249
+ interface $ZodDefault<T extends SomeType = $ZodType> extends $ZodType {
1250
+ _zod: $ZodDefaultInternals<T>;
1251
+ }
1252
+ declare const $ZodDefault: $constructor<$ZodDefault>;
1253
+ interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1254
+ type: "prefault";
1255
+ innerType: T;
1256
+ /** The default value. May be a getter. */
1257
+ defaultValue: input<T>;
1258
+ }
1259
+ interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1260
+ def: $ZodPrefaultDef<T>;
1261
+ optin: "defaulted";
1262
+ optout?: "optional" | undefined;
1263
+ isst: never;
1264
+ values: T["_zod"]["values"];
1265
+ }
1266
+ interface $ZodPrefault<T extends SomeType = $ZodType> extends $ZodType {
1267
+ _zod: $ZodPrefaultInternals<T>;
1268
+ }
1269
+ declare const $ZodPrefault: $constructor<$ZodPrefault>;
1270
+ interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1271
+ type: "nonoptional";
1272
+ innerType: T;
1273
+ }
1274
+ interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
1275
+ def: $ZodNonOptionalDef<T>;
1276
+ isst: $ZodIssueInvalidType;
1277
+ values: T["_zod"]["values"];
1278
+ optin: "optional" | undefined;
1279
+ optout: "optional" | undefined;
1280
+ }
1281
+ interface $ZodNonOptional<T extends SomeType = $ZodType> extends $ZodType {
1282
+ _zod: $ZodNonOptionalInternals<T>;
1283
+ }
1284
+ declare const $ZodNonOptional: $constructor<$ZodNonOptional>;
1285
+ interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1286
+ type: "success";
1287
+ innerType: T;
1288
+ }
1289
+ interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input<T>> {
1290
+ def: $ZodSuccessDef<T>;
1291
+ isst: never;
1292
+ optin: T["_zod"]["optin"];
1293
+ optout: "optional" | undefined;
1294
+ }
1295
+ interface $ZodSuccess<T extends SomeType = $ZodType> extends $ZodType {
1296
+ _zod: $ZodSuccessInternals<T>;
1297
+ }
1298
+ declare const $ZodSuccess: $constructor<$ZodSuccess>;
1299
+ interface $ZodCatchCtx extends ParsePayload {
1300
+ /** @deprecated Use `ctx.issues` */
1301
+ error: {
1302
+ issues: $ZodIssue[];
1303
+ };
1304
+ /** @deprecated Use `ctx.value` */
1305
+ input: unknown;
1306
+ }
1307
+ interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1308
+ type: "catch";
1309
+ innerType: T;
1310
+ catchValue: (ctx: $ZodCatchCtx) => unknown;
1311
+ }
1312
+ interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1313
+ def: $ZodCatchDef<T>;
1314
+ optin: T["_zod"]["optin"];
1315
+ optout: T["_zod"]["optout"];
1316
+ isst: never;
1317
+ values: T["_zod"]["values"];
1318
+ }
1319
+ interface $ZodCatch<T extends SomeType = $ZodType> extends $ZodType {
1320
+ _zod: $ZodCatchInternals<T>;
1321
+ }
1322
+ declare const $ZodCatch: $constructor<$ZodCatch>;
1323
+ interface $ZodNaNDef extends $ZodTypeDef {
1324
+ type: "nan";
1325
+ }
1326
+ interface $ZodNaNInternals extends $ZodTypeInternals<number, number> {
1327
+ def: $ZodNaNDef;
1328
+ isst: $ZodIssueInvalidType;
1329
+ }
1330
+ interface $ZodNaN extends $ZodType {
1331
+ _zod: $ZodNaNInternals;
1332
+ }
1333
+ declare const $ZodNaN: $constructor<$ZodNaN>;
1334
+ interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeDef {
1335
+ type: "pipe";
1336
+ in: A;
1337
+ out: B;
1338
+ /** Only defined inside $ZodCodec instances. */
1339
+ transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input<B>>;
1340
+ /** Only defined inside $ZodCodec instances. */
1341
+ reverseTransform?: (value: input<B>, payload: ParsePayload<input<B>>) => MaybeAsync<output<A>>;
1342
+ }
1343
+ interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
1344
+ def: $ZodPipeDef<A, B>;
1345
+ isst: never;
1346
+ values: A["_zod"]["values"];
1347
+ optin: A["_zod"]["optin"];
1348
+ optout: B["_zod"]["optout"];
1349
+ propValues: A["_zod"]["propValues"];
1350
+ }
1351
+ interface $ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
1352
+ _zod: $ZodPipeInternals<A, B>;
1353
+ }
1354
+ declare const $ZodPipe: $constructor<$ZodPipe>;
1355
+ interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1356
+ type: "readonly";
1357
+ innerType: T;
1358
+ }
1359
+ interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
1360
+ def: $ZodReadonlyDef<T>;
1361
+ optin: T["_zod"]["optin"];
1362
+ optout: T["_zod"]["optout"];
1363
+ isst: never;
1364
+ propValues: T["_zod"]["propValues"];
1365
+ values: T["_zod"]["values"];
1366
+ }
1367
+ interface $ZodReadonly<T extends SomeType = $ZodType> extends $ZodType {
1368
+ _zod: $ZodReadonlyInternals<T>;
1369
+ }
1370
+ declare const $ZodReadonly: $constructor<$ZodReadonly>;
1371
+ interface $ZodTemplateLiteralDef extends $ZodTypeDef {
1372
+ type: "template_literal";
1373
+ parts: $ZodTemplateLiteralPart[];
1374
+ format?: string | undefined;
1375
+ }
1376
+ interface $ZodTemplateLiteralInternals<Template extends string = string> extends $ZodTypeInternals<Template, Template> {
1377
+ pattern: RegExp;
1378
+ def: $ZodTemplateLiteralDef;
1379
+ isst: $ZodIssueInvalidType;
1380
+ }
1381
+ interface $ZodTemplateLiteral<Template extends string = string> extends $ZodType {
1382
+ _zod: $ZodTemplateLiteralInternals<Template>;
1383
+ }
1384
+ type LiteralPart = Exclude<Literal, symbol>;
1385
+ interface SchemaPartInternals extends $ZodTypeInternals<LiteralPart, LiteralPart> {
1386
+ pattern: RegExp;
1387
+ }
1388
+ interface SchemaPart extends $ZodType {
1389
+ _zod: SchemaPartInternals;
1390
+ }
1391
+ type $ZodTemplateLiteralPart = LiteralPart | SchemaPart;
1392
+ declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
1393
+ type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
1394
+ type $ZodFunctionIn = $ZodFunctionArgs;
1395
+ type $ZodFunctionOut = $ZodType;
1396
+ type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input<Returns>;
1397
+ type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input<Returns>>;
1398
+ type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => output<Returns>;
1399
+ type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => Promise<output<Returns>>;
1400
+ interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
1401
+ type: "function";
1402
+ input: In;
1403
+ output: Out;
1404
+ }
1405
+ interface $ZodFunctionInternals<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> extends $ZodTypeInternals<$InferOuterFunctionType<Args, Returns>, $InferInnerFunctionType<Args, Returns>> {
1406
+ def: $ZodFunctionDef<Args, Returns>;
1407
+ isst: $ZodIssueInvalidType;
1408
+ }
1409
+ interface $ZodFunction<Args extends $ZodFunctionIn = $ZodFunctionIn, Returns extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodType<any, any, $ZodFunctionInternals<Args, Returns>> {
1410
+ /** @deprecated */
1411
+ _def: $ZodFunctionDef<Args, Returns>;
1412
+ _input: $InferInnerFunctionType<Args, Returns>;
1413
+ _output: $InferOuterFunctionType<Args, Returns>;
1414
+ implement<F extends $InferInnerFunctionType<Args, Returns>>(func: F): (...args: Parameters<this["_output"]>) => ReturnType<F> extends ReturnType<this["_output"]> ? ReturnType<F> : ReturnType<this["_output"]>;
1415
+ implementAsync<F extends $InferInnerFunctionTypeAsync<Args, Returns>>(func: F): F extends $InferOuterFunctionTypeAsync<Args, Returns> ? F : $InferOuterFunctionTypeAsync<Args, Returns>;
1416
+ input<const Items extends TupleItems, const Rest extends $ZodFunctionOut = $ZodFunctionOut>(args: Items, rest?: Rest): $ZodFunction<$ZodTuple<Items, Rest>, Returns>;
1417
+ input<NewArgs extends $ZodFunctionIn>(args: NewArgs): $ZodFunction<NewArgs, Returns>;
1418
+ input(...args: any[]): $ZodFunction<any, Returns>;
1419
+ output<NewReturns extends $ZodType>(output: NewReturns): $ZodFunction<Args, NewReturns>;
1420
+ }
1421
+ declare const $ZodFunction: $constructor<$ZodFunction>;
1422
+ interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1423
+ type: "promise";
1424
+ innerType: T;
1425
+ }
1426
+ interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input<T>>> {
1427
+ def: $ZodPromiseDef<T>;
1428
+ isst: never;
1429
+ }
1430
+ interface $ZodPromise<T extends SomeType = $ZodType> extends $ZodType {
1431
+ _zod: $ZodPromiseInternals<T>;
1432
+ }
1433
+ declare const $ZodPromise: $constructor<$ZodPromise>;
1434
+ interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1435
+ type: "lazy";
1436
+ getter: () => T;
1437
+ }
1438
+ interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1439
+ def: $ZodLazyDef<T>;
1440
+ isst: never;
1441
+ /** Auto-cached way to retrieve the inner schema */
1442
+ innerType: T;
1443
+ pattern: T["_zod"]["pattern"];
1444
+ propValues: T["_zod"]["propValues"];
1445
+ optin: T["_zod"]["optin"];
1446
+ optout: T["_zod"]["optout"];
1447
+ }
1448
+ interface $ZodLazy<T extends SomeType = $ZodType> extends $ZodType {
1449
+ _zod: $ZodLazyInternals<T>;
1450
+ }
1451
+ declare const $ZodLazy: $constructor<$ZodLazy>;
1452
+ interface $ZodCustomDef<O = unknown> extends $ZodTypeDef, $ZodCheckDef {
1453
+ type: "custom";
1454
+ check: "custom";
1455
+ path?: PropertyKey[] | undefined;
1456
+ error?: $ZodErrorMap | undefined;
1457
+ params?: Record<string, any> | undefined;
1458
+ fn: (arg: O) => unknown;
1459
+ }
1460
+ interface $ZodCustomInternals<O = unknown, I = unknown> extends $ZodTypeInternals<O, I>, $ZodCheckInternals<O> {
1461
+ def: $ZodCustomDef;
1462
+ issc: $ZodIssue;
1463
+ isst: never;
1464
+ bag: LoosePartial<{
1465
+ Class: typeof Class;
1466
+ }>;
1467
+ }
1468
+ interface $ZodCustom<O = unknown, I = unknown> extends $ZodType {
1469
+ _zod: $ZodCustomInternals<O, I>;
1470
+ }
1471
+ declare const $ZodCustom: $constructor<$ZodCustom>;
1472
+ interface $ZodPropertiesDef<Shape extends $ZodShape = $ZodShape> extends $ZodTypeDef, $ZodCheckDef {
1473
+ type: "properties";
1474
+ check: "properties";
1475
+ shape: Shape;
1476
+ }
1477
+ interface $ZodPropertiesInternals<Shape extends $ZodShape = $ZodShape> extends $ZodTypeInternals<$InferObjectInput<Shape, {}>, $InferObjectInput<Shape, {}>>, $ZodCheckInternals<{ -readonly [k in keyof Shape]: Widen<input<Shape[k]>>; }> {
1478
+ def: $ZodPropertiesDef<Shape>;
1479
+ isst: $ZodIssueInvalidType;
1480
+ issc: $ZodIssue;
1481
+ }
1482
+ interface $ZodProperties<Shape extends $ZodShape = $ZodShape> extends $ZodType {
1483
+ _zod: $ZodPropertiesInternals<Shape>;
1484
+ [Symbol.iterator](): Iterator<this>;
1485
+ }
1486
+ declare const $ZodProperties: $constructor<$ZodProperties>;
1487
+ 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 | $ZodProperties | $ZodTransform | $ZodNonOptional | $ZodReadonly | $ZodNaN | $ZodPipe | $ZodSuccess | $ZodCatch | $ZodFile;
1488
+ //#endregion
1489
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/checks.d.cts
1490
+ interface $ZodCheckDef {
1491
+ check: string;
1492
+ error?: $ZodErrorMap<never> | undefined;
1493
+ /** If true, no later checks will be executed if this check fails. Default `false`. */
1494
+ abort?: boolean | undefined;
1495
+ /** If provided, the check runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
1496
+ when?: ((payload: ParsePayload) => boolean) | undefined;
1497
+ }
1498
+ interface $ZodCheckInternals<T> {
1499
+ def: $ZodCheckDef;
1500
+ /** The set of issues this check might throw. */
1501
+ issc?: $ZodIssueBase;
1502
+ check(payload: ParsePayload<T>): MaybeAsync<void>;
1503
+ onattach: ((schema: $ZodType) => void)[];
1504
+ }
1505
+ interface $ZodCheck<in T = never> {
1506
+ _zod: $ZodCheckInternals<T>;
1507
+ }
1508
+ declare const $ZodCheck: $constructor<$ZodCheck<any>>;
1509
+ interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
1510
+ check: "max_length";
1511
+ maximum: number;
1512
+ }
1513
+ interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1514
+ def: $ZodCheckMaxLengthDef;
1515
+ issc: $ZodIssueTooBig<T>;
1516
+ }
1517
+ interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1518
+ _zod: $ZodCheckMaxLengthInternals<T>;
1519
+ }
1520
+ declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
1521
+ interface $ZodCheckMinLengthDef extends $ZodCheckDef {
1522
+ check: "min_length";
1523
+ minimum: number;
1524
+ }
1525
+ interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1526
+ def: $ZodCheckMinLengthDef;
1527
+ issc: $ZodIssueTooSmall<T>;
1528
+ }
1529
+ interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
1530
+ _zod: $ZodCheckMinLengthInternals<T>;
1531
+ }
1532
+ declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
1533
+ interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
1534
+ check: "length_equals";
1535
+ length: number;
1536
+ }
1537
+ interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
1538
+ def: $ZodCheckLengthEqualsDef;
1539
+ issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
1540
+ }
1541
+ interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
1542
+ _zod: $ZodCheckLengthEqualsInternals<T>;
1543
+ }
1544
+ declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
1545
+ 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" | "iban" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
1546
+ //#endregion
1547
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/errors.d.cts
1548
+ interface $ZodIssueBase {
1549
+ readonly code?: string;
1550
+ readonly input?: unknown;
1551
+ readonly path: PropertyKey[];
1552
+ readonly message: string;
1553
+ }
1554
+ type $ZodInvalidTypeExpected = "string" | "number" | "int" | "boolean" | "bigint" | "symbol" | "undefined" | "null" | "never" | "void" | "date" | "array" | "object" | "tuple" | "record" | "map" | "set" | "file" | "nonoptional" | "nan" | "function" | (string & {});
1555
+ interface $ZodIssueInvalidType<Input = unknown> extends $ZodIssueBase {
1556
+ readonly code: "invalid_type";
1557
+ readonly expected: $ZodInvalidTypeExpected;
1558
+ readonly input?: Input;
1559
+ }
1560
+ interface $ZodIssueTooBig<Input = unknown> extends $ZodIssueBase {
1561
+ readonly code: "too_big";
1562
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1563
+ readonly maximum: number | bigint;
1564
+ readonly inclusive?: boolean;
1565
+ readonly exact?: boolean;
1566
+ readonly input?: Input;
1567
+ }
1568
+ interface $ZodIssueTooSmall<Input = unknown> extends $ZodIssueBase {
1569
+ readonly code: "too_small";
1570
+ readonly origin: "number" | "int" | "bigint" | "date" | "string" | "array" | "set" | "file" | (string & {});
1571
+ readonly minimum: number | bigint;
1572
+ /** True if the allowable range includes the minimum */
1573
+ readonly inclusive?: boolean;
1574
+ /** True if the allowed value is fixed (e.g.` z.length(5)`), not a range (`z.minLength(5)`) */
1575
+ readonly exact?: boolean;
1576
+ readonly input?: Input;
1577
+ }
1578
+ interface $ZodIssueInvalidStringFormat extends $ZodIssueBase {
1579
+ readonly code: "invalid_format";
1580
+ readonly format: $ZodStringFormats | (string & {});
1581
+ readonly pattern?: string;
1582
+ readonly input?: string;
1583
+ }
1584
+ interface $ZodIssueNotMultipleOf<Input extends number | bigint = number | bigint> extends $ZodIssueBase {
1585
+ readonly code: "not_multiple_of";
1586
+ readonly divisor: number;
1587
+ readonly input?: Input;
1588
+ }
1589
+ interface $ZodIssueUnrecognizedKeys extends $ZodIssueBase {
1590
+ readonly code: "unrecognized_keys";
1591
+ readonly keys: string[];
1592
+ readonly input?: Record<string, unknown>;
1593
+ }
1594
+ interface $ZodIssueInvalidUnionNoMatch extends $ZodIssueBase {
1595
+ readonly code: "invalid_union";
1596
+ readonly errors: $ZodIssue[][];
1597
+ readonly input?: unknown;
1598
+ readonly discriminator?: string | undefined;
1599
+ readonly options?: Primitive[];
1600
+ readonly inclusive?: true;
1601
+ }
1602
+ interface $ZodIssueInvalidUnionMultipleMatch extends $ZodIssueBase {
1603
+ readonly code: "invalid_union";
1604
+ readonly errors: [];
1605
+ readonly input?: unknown;
1606
+ readonly discriminator?: string | undefined;
1607
+ readonly inclusive: false;
1608
+ /** Indices of the options that matched */
1609
+ readonly matches: number[];
1610
+ }
1611
+ type $ZodIssueInvalidUnion = $ZodIssueInvalidUnionNoMatch | $ZodIssueInvalidUnionMultipleMatch;
1612
+ interface $ZodIssueInvalidKey<Input = unknown> extends $ZodIssueBase {
1613
+ readonly code: "invalid_key";
1614
+ readonly origin: "map" | "record";
1615
+ readonly issues: $ZodIssue[];
1616
+ readonly input?: Input;
1617
+ }
1618
+ interface $ZodIssueInvalidElement<Input = unknown> extends $ZodIssueBase {
1619
+ readonly code: "invalid_element";
1620
+ readonly origin: "map" | "set";
1621
+ readonly key: unknown;
1622
+ readonly issues: $ZodIssue[];
1623
+ readonly input?: Input;
1624
+ }
1625
+ interface $ZodIssueInvalidValue<Input = unknown> extends $ZodIssueBase {
1626
+ readonly code: "invalid_value";
1627
+ readonly values: Primitive[];
1628
+ readonly input?: Input;
1629
+ }
1630
+ interface $ZodIssueCustom extends $ZodIssueBase {
1631
+ readonly code: "custom";
1632
+ readonly params?: Record<string, any> | undefined;
1633
+ readonly input?: unknown;
1634
+ }
1635
+ type $ZodIssue = $ZodIssueInvalidType | $ZodIssueTooBig | $ZodIssueTooSmall | $ZodIssueInvalidStringFormat | $ZodIssueNotMultipleOf | $ZodIssueUnrecognizedKeys | $ZodIssueInvalidUnion | $ZodIssueInvalidKey | $ZodIssueInvalidElement | $ZodIssueInvalidValue | $ZodIssueCustom;
1636
+ type $ZodInternalIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue$1<T> : never;
1637
+ type RawIssue$1<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
1638
+ /** The input data */
1639
+ readonly input: unknown;
1640
+ /** The schema or check that originated this issue. */
1641
+ readonly inst?: $ZodType | $ZodCheck;
1642
+ /** 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. */
1643
+ readonly schema?: $ZodType | undefined;
1644
+ /** If `true`, Zod will continue executing checks/refinements after this issue. */
1645
+ readonly continue?: boolean | undefined;
1646
+ } & Record<string, unknown>> : never;
1647
+ type $ZodRawIssue<T extends $ZodIssueBase = $ZodIssue> = $ZodInternalIssue<T>;
1648
+ interface $ZodErrorMap<T extends $ZodIssueBase = $ZodIssue> {
1649
+ (issue: $ZodRawIssue<T>): {
1650
+ message: string;
1651
+ } | string | undefined | null;
1652
+ }
1653
+ interface $ZodError<T = unknown> extends Error {
1654
+ type: T;
1655
+ issues: $ZodIssue[];
1656
+ _zod: {
1657
+ output: T;
1658
+ def: $ZodIssue[];
1659
+ };
1660
+ stack?: string;
1661
+ name: string;
1662
+ }
1663
+ declare const $ZodError: $constructor<$ZodError>;
1664
+ type $ZodFlattenedError<T, U = string> = _FlattenedError<T, U>;
1665
+ type _FlattenedError<T, U = string> = {
1666
+ formErrors: U[];
1667
+ fieldErrors: { [P in keyof T]?: U[]; };
1668
+ };
1669
+ type _ZodFormattedError<T, U = string> = T extends [any, ...any[]] ? { [K in keyof T]?: $ZodFormattedError<T[K], U>; } : T extends any[] ? {
1670
+ [k: number]: $ZodFormattedError<T[number], U>;
1671
+ } : T extends object ? Flatten<{ [K in keyof T]?: $ZodFormattedError<T[K], U>; }> : any;
1672
+ type $ZodFormattedError<T, U = string> = {
1673
+ _errors: U[];
1674
+ } & Flatten<_ZodFormattedError<T, U>>;
1675
+ //#endregion
1676
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/core.d.cts
1677
+ type ZodTrait = {
1678
+ _zod: {
1679
+ def: any;
1680
+ [k: string]: any;
1681
+ };
1682
+ };
1683
+ interface $constructor<T extends ZodTrait, D = T["_zod"]["def"]> {
1684
+ new (def: D): T;
1685
+ init(inst: T, def: D): asserts inst is T;
1686
+ }
1687
+ interface $constructorParams {
1688
+ Parent?: typeof Class;
1689
+ }
1690
+ declare function $constructor<T extends ZodTrait, D = T["_zod"]["def"]>(name: string, initializer: (inst: T, def: D) => void,
1691
+ /** 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. */
1692
+ proto?: ProtoOf<T>, params?: $constructorParams): $constructor<T, D>;
1693
+ declare const $brand: unique symbol;
1694
+ type $brand<T extends string | number | symbol = string | number | symbol> = {
1695
+ [$brand]: { [k in T]: true; };
1696
+ };
1697
+ type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
1698
+ _zod: {
1699
+ input: input<T> & $brand<Brand>;
1700
+ output: output<T> & $brand<Brand>;
1701
+ };
1702
+ } : Dir extends "in" ? {
1703
+ _zod: {
1704
+ input: input<T> & $brand<Brand>;
1705
+ };
1706
+ } : {
1707
+ _zod: {
1708
+ output: output<T> & $brand<Brand>;
1709
+ };
1710
+ });
1711
+ type input<T> = T extends {
1712
+ _zod: {
1713
+ input: any;
1714
+ };
1715
+ } ? T["_zod"]["input"] : unknown;
1716
+ type output<T> = T extends {
1717
+ _zod: {
1718
+ output: any;
1719
+ };
1720
+ } ? T["_zod"]["output"] : unknown;
1721
+ //#endregion
1722
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/core/api.d.cts
1723
+ 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] ? {} : {
1724
+ error?: string | $ZodErrorMap<IssueTypes> | undefined;
1725
+ /** @deprecated This parameter is deprecated. Use `error` instead. */
1726
+ message?: string | undefined;
1727
+ })>>>;
1728
+ type TypeParams<T extends $ZodType = $ZodType & {
1729
+ _isst: never;
1730
+ }, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
1731
+ type CheckParams<T extends $ZodCheck = $ZodCheck // & { _issc: never },
1732
+ , AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
1733
+ 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>;
1734
+ type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
1735
+ type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
1736
+ type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
1737
+ type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
1738
+ type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
1739
+ type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
1740
+ type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
1741
+ /** The schema or check that originated this issue. */
1742
+ readonly inst?: $ZodType | $ZodCheck;
1743
+ /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
1744
+ readonly continue?: boolean | undefined;
1745
+ } & Record<string, unknown>> : never;
1746
+ interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
1747
+ addIssue(arg: string | $ZodSuperRefineIssue): void;
1748
+ }
1749
+ interface $ZodSuperRefineParams {
1750
+ /** If provided, the refinement runs only when this returns `true`. By default, it is skipped if prior parsing produced aborting issues. */
1751
+ when?: ((payload: ParsePayload) => boolean) | undefined;
1752
+ }
1753
+ //#endregion
1754
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/errors.d.cts
1755
+ /** An Error-like class used to store Zod validation issues. */
1756
+ interface ZodError<T = unknown> extends $ZodError<T> {
1757
+ /** @deprecated Use the `z.treeifyError(err)` function instead. */
1758
+ format(): $ZodFormattedError<T>;
1759
+ format<U>(mapper: (issue: $ZodIssue) => U): $ZodFormattedError<T, U>;
1760
+ /** @deprecated Use the `z.treeifyError(err)` function instead. */
1761
+ flatten(): $ZodFlattenedError<T>;
1762
+ flatten<U>(mapper: (issue: $ZodIssue) => U): $ZodFlattenedError<T, U>;
1763
+ /** @deprecated Push directly to `.issues` instead. */
1764
+ addIssue(issue: $ZodIssue): void;
1765
+ /** @deprecated Push directly to `.issues` instead. */
1766
+ addIssues(issues: $ZodIssue[]): void;
1767
+ /** @deprecated Check `err.issues.length === 0` instead. */
1768
+ isEmpty: boolean;
1769
+ }
1770
+ declare const ZodError: $constructor<ZodError>;
1771
+ //#endregion
1772
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/parse.d.cts
1773
+ type ZodSafeParseResult<T> = ZodSafeParseSuccess<T> | ZodSafeParseError<T>;
1774
+ type ZodSafeParseSuccess<T> = {
1775
+ success: true;
1776
+ data: T;
1777
+ error?: never;
1778
+ };
1779
+ type ZodSafeParseError<T> = {
1780
+ success: false;
1781
+ data?: never;
1782
+ error: ZodError<T>;
1783
+ };
1784
+ //#endregion
1785
+ //#region ../../node_modules/.pnpm/zod@4.6.1/node_modules/zod/v4/classic/schemas.d.cts
1786
+ type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
1787
+ interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
1788
+ def: Internals["def"];
1789
+ type: Internals["def"]["type"];
1790
+ /** @deprecated Use `.def` instead. */
1791
+ _def: Internals["def"];
1792
+ /** @deprecated Use `z.output<typeof schema>` instead. */
1793
+ _output: Internals["output"];
1794
+ /** @deprecated Use `z.input<typeof schema>` instead. */
1795
+ _input: Internals["input"];
1796
+ "~standard": ZodStandardSchemaWithJSON<this>;
1797
+ /** Converts this schema to a JSON Schema representation. */
1798
+ toJSONSchema(params?: ToJSONSchemaParams): ZodStandardJSONSchemaPayload<this>;
1799
+ check(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
1800
+ with(...checks: (CheckFn<output<this>> | $ZodCheck<output<this>>)[]): this;
1801
+ clone(def?: Internals["def"], params?: {
1802
+ parent: boolean;
1803
+ }): this;
1804
+ 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;
1805
+ brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : $ZodBranded<this, T, Dir>;
1806
+ parse(data: unknown, params?: ParseContext<$ZodIssue>): output<this>;
1807
+ safeParse(data: unknown, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
1808
+ parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
1809
+ safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
1810
+ spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
1811
+ validate(data: unknown, params?: ParseContext<$ZodIssue>): data is input<this>;
1812
+ validateAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<boolean>;
1813
+ encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
1814
+ decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
1815
+ encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
1816
+ decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
1817
+ safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
1818
+ safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
1819
+ safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
1820
+ safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
1821
+ 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;
1822
+ superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>, params?: $ZodSuperRefineParams): this;
1823
+ overwrite(fn: (x: output<this>) => output<this>): this;
1824
+ optional(): ZodOptional<this>;
1825
+ exactOptional(): ZodExactOptional<this>;
1826
+ nonoptional(params?: string | $ZodNonOptionalParams): ZodNonOptional<this>;
1827
+ nullable(): ZodNullable<this>;
1828
+ nullish(): ZodOptional<ZodNullable<this>>;
1829
+ default(def: NoUndefined<output<this>>): ZodDefault<this>;
1830
+ default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
1831
+ prefault(def: () => input<this>): ZodPrefault<this>;
1832
+ prefault(def: input<this>): ZodPrefault<this>;
1833
+ array(): ZodArray<this>;
1834
+ or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
1835
+ and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
1836
+ transform<NewOut>(transform: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, output<this>>>;
1837
+ catch(def: output<this>): ZodCatch<this>;
1838
+ catch(def: (ctx: $ZodCatchCtx) => output<this>): ZodCatch<this>;
1839
+ pipe<T extends $ZodType<any, output<this>>>(target: T | $ZodType<any, output<this>>): ZodPipe<this, T>;
1840
+ readonly(): ZodReadonly<this>;
1841
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
1842
+ describe(description: string): this;
1843
+ description?: string;
1844
+ /** Returns the metadata associated with this instance in `z.globalRegistry` */
1845
+ meta(): $replace<GlobalMeta, this> | undefined;
1846
+ /** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
1847
+ meta(data: $replace<GlobalMeta, this>): this;
1848
+ /** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
1849
+ *
1850
+ * ```ts
1851
+ * const schema = z.string().optional();
1852
+ * const isOptional = schema.safeParse(undefined).success; // true
1853
+ * ```
1854
+ */
1855
+ isOptional(): boolean;
1856
+ /**
1857
+ * @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
1858
+ *
1859
+ * ```ts
1860
+ * const schema = z.string().nullable();
1861
+ * const isNullable = schema.safeParse(null).success; // true
1862
+ * ```
1863
+ */
1864
+ isNullable(): boolean;
1865
+ apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
1866
+ }
1867
+ interface _ZodType<out Internals extends $ZodTypeInternals = $ZodTypeInternals> extends ZodType<any, any, Internals> {}
1868
+ declare const ZodType: $constructor<ZodType>;
1869
+ interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
1870
+ element: T;
1871
+ min(minLength: number, params?: string | $ZodCheckMinLengthParams): this;
1872
+ nonempty(params?: string | $ZodCheckMinLengthParams): this;
1873
+ max(maxLength: number, params?: string | $ZodCheckMaxLengthParams): this;
1874
+ length(len: number, params?: string | $ZodCheckLengthEqualsParams): this;
1875
+ unwrap(): T;
1876
+ "~standard": ZodStandardSchemaWithJSON<this>;
1877
+ }
1878
+ declare const ZodArray: $constructor<ZodArray>;
1879
+ interface ZodUnion<T extends readonly SomeType[] = readonly $ZodType[]> extends _ZodType<$ZodUnionInternals<T>>, $ZodUnion<T> {
1880
+ "~standard": ZodStandardSchemaWithJSON<this>;
1881
+ options: T;
1882
+ }
1883
+ declare const ZodUnion: $constructor<ZodUnion>;
1884
+ interface ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodIntersectionInternals<A, B>>, $ZodIntersection<A, B> {
1885
+ "~standard": ZodStandardSchemaWithJSON<this>;
1886
+ }
1887
+ declare const ZodIntersection: $constructor<ZodIntersection>;
1888
+ interface ZodTransform<O = unknown, I = unknown> extends _ZodType<$ZodTransformInternals<O, I>>, $ZodTransform<O, I> {
1889
+ "~standard": ZodStandardSchemaWithJSON<this>;
1890
+ }
1891
+ declare const ZodTransform: $constructor<ZodTransform>;
1892
+ interface ZodOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodOptionalInternals<T>>, $ZodOptional<T> {
1893
+ "~standard": ZodStandardSchemaWithJSON<this>;
1894
+ unwrap(): T;
1895
+ }
1896
+ declare const ZodOptional: $constructor<ZodOptional>;
1897
+ interface ZodExactOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodExactOptionalInternals<T>>, $ZodExactOptional<T> {
1898
+ "~standard": ZodStandardSchemaWithJSON<this>;
1899
+ unwrap(): T;
1900
+ }
1901
+ declare const ZodExactOptional: $constructor<ZodExactOptional>;
1902
+ interface ZodNullable<T extends SomeType = $ZodType> extends _ZodType<$ZodNullableInternals<T>>, $ZodNullable<T> {
1903
+ "~standard": ZodStandardSchemaWithJSON<this>;
1904
+ unwrap(): T;
1905
+ }
1906
+ declare const ZodNullable: $constructor<ZodNullable>;
1907
+ interface ZodDefault<T extends SomeType = $ZodType> extends _ZodType<$ZodDefaultInternals<T>>, $ZodDefault<T> {
1908
+ "~standard": ZodStandardSchemaWithJSON<this>;
1909
+ unwrap(): T;
1910
+ /** @deprecated Use `.unwrap()` instead. */
1911
+ removeDefault(): T;
1912
+ }
1913
+ declare const ZodDefault: $constructor<ZodDefault>;
1914
+ interface ZodPrefault<T extends SomeType = $ZodType> extends _ZodType<$ZodPrefaultInternals<T>>, $ZodPrefault<T> {
1915
+ "~standard": ZodStandardSchemaWithJSON<this>;
1916
+ unwrap(): T;
1917
+ }
1918
+ declare const ZodPrefault: $constructor<ZodPrefault>;
1919
+ interface ZodNonOptional<T extends SomeType = $ZodType> extends _ZodType<$ZodNonOptionalInternals<T>>, $ZodNonOptional<T> {
1920
+ "~standard": ZodStandardSchemaWithJSON<this>;
1921
+ unwrap(): T;
1922
+ }
1923
+ declare const ZodNonOptional: $constructor<ZodNonOptional>;
1924
+ interface ZodCatch<T extends SomeType = $ZodType> extends _ZodType<$ZodCatchInternals<T>>, $ZodCatch<T> {
1925
+ "~standard": ZodStandardSchemaWithJSON<this>;
1926
+ unwrap(): T;
1927
+ /** @deprecated Use `.unwrap()` instead. */
1928
+ removeCatch(): T;
1929
+ }
1930
+ declare const ZodCatch: $constructor<ZodCatch>;
1931
+ interface ZodPipe<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends _ZodType<$ZodPipeInternals<A, B>>, $ZodPipe<A, B> {
1932
+ "~standard": ZodStandardSchemaWithJSON<this>;
1933
+ in: A;
1934
+ out: B;
1935
+ }
1936
+ declare const ZodPipe: $constructor<ZodPipe>;
1937
+ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadonlyInternals<T>>, $ZodReadonly<T> {
1938
+ "~standard": ZodStandardSchemaWithJSON<this>;
1939
+ unwrap(): T;
1940
+ }
1941
+ declare const ZodReadonly: $constructor<ZodReadonly>;
1942
+ //#endregion
1943
+ //#region ../../vendor/deepseek-harness/packages/storage/storage/lib/types/backend.d.ts
1944
+ /**
1945
+ * One registered backend. A backend owns exactly one medium and shares its
1946
+ * lifecycle across all facets; facets are optional members — a backend that
1947
+ * cannot serve a data kind simply omits it, and resolution fails loud instead.
1948
+ */
1949
+ interface StorageBackend {
1950
+ /** Key-value operations; absent when this backend cannot serve them. */
1951
+ readonly kv?: KvFacet;
1952
+ /**
1953
+ * Drain in-flight writes across all open units and release the medium.
1954
+ * Idempotent; concurrent and repeated calls resolve once teardown finishes.
1955
+ * @returns resolution after the medium is released.
1956
+ */
1957
+ close(): Promise<void>;
1958
+ }
1959
+ /** The key-value data shape: whole-unit snapshots plus per-record durable writes. */
1960
+ interface KvFacet {
1961
+ /**
1962
+ * Open one unit, creating it when the medium holds no trace of it yet
1963
+ * (materialization may defer to the first write, but {@link KvUnit.loadAll}
1964
+ * must immediately serve the empty shape). A version already stamped on the
1965
+ * medium that differs from `descriptor.version` rejects with
1966
+ * `version-mismatch`; a medium that cannot be parsed as this unit rejects
1967
+ * with `malformed-medium`. Opening the same unit name twice without closing
1968
+ * is a caller bug and rejects.
1969
+ * @param descriptor - Static identity and shape of the unit to open.
1970
+ * @returns the opened unit.
1971
+ */
1972
+ open(descriptor: KvUnitDescriptor): Promise<KvUnit>;
1973
+ }
1974
+ /** Static identity and shape of one KV unit, projected from its owner's spec. */
1975
+ interface KvUnitDescriptor {
1976
+ /** Unit name; must match {@link UNIT_NAME_RE}. Also the file-name / SQL-identifier segment. */
1977
+ readonly name: string;
1978
+ /** Unit format version; a non-negative integer stamped on the medium at first materialization. */
1979
+ readonly version: number;
1980
+ /** Table names; each must match {@link UNIT_NAME_RE}. */
1981
+ readonly tables: readonly string[];
1982
+ /** Whether this unit carries the global singleton slot. */
1983
+ readonly hasGlobal: boolean;
1984
+ /**
1985
+ * Medium layout. `single` (the default) keeps the whole unit in one
1986
+ * document; `per-record` keeps each record in its own document, so a unit
1987
+ * whose records are large or sparse never rewrites the rest on one write,
1988
+ * and an unaccepted version stamp discards only that record instead of
1989
+ * rejecting the whole unit. Backends that only serve one layout accept the
1990
+ * other's units as foreign documents.
1991
+ */
1992
+ readonly layout?: 'single' | 'per-record';
1993
+ /**
1994
+ * Older unit versions whose stored records are also readable under the
1995
+ * declaring owner's current record schemas (the owner vouches for that —
1996
+ * typically by declaring the fields old records lack as optional). Reads of
1997
+ * a `per-record` unit accept documents stamped with any listed version, and
1998
+ * the legacy whole-unit bootstrap accepts a legacy file stamped with one;
1999
+ * writes always stamp {@link version}. `single`-layout reads stay
2000
+ * exact-version.
2001
+ */
2002
+ readonly compatibleVersions?: readonly number[];
2003
+ }
2004
+ /**
2005
+ * One opened unit. Values are opaque JSON to this layer: no schema, no
2006
+ * events, no domain meaning. The unit does NOT serialize concurrent writes —
2007
+ * write ordering is the caller's responsibility (the domain layer runs one
2008
+ * write chain per unit); the unit only guarantees that each single call is
2009
+ * atomic on the medium and durable once resolved (a crash after resolution
2010
+ * followed by a re-open observes the write). Any call after {@link close}
2011
+ * rejects with `closed`.
2012
+ */
2013
+ interface KvUnit {
2014
+ /**
2015
+ * Read the full current snapshot.
2016
+ * @returns every table's records keyed by table name, plus the global
2017
+ * singleton (`null` when never written or not declared).
2018
+ */
2019
+ loadAll(): Promise<{
2020
+ tables: Record<string, Record<string, unknown>>;
2021
+ global: unknown;
2022
+ }>;
2023
+ /**
2024
+ * Upsert one record durably. Overwrite semantics: an existing key is replaced.
2025
+ * @param table - Declared table name.
2026
+ * @param key - Record key. In the `per-record` layout a key becomes a path
2027
+ * segment and must match `[a-zA-Z0-9_-]+` (an unsafe key rejects); in the
2028
+ * `single` layout keys stay opaque.
2029
+ * @param value - Opaque JSON-serializable record.
2030
+ * @returns resolution after durability.
2031
+ */
2032
+ putRecord(table: string, key: string, value: unknown): Promise<void>;
2033
+ /**
2034
+ * Delete one record durably. Idempotent: a missing key is a no-op.
2035
+ * @param table - Declared table name.
2036
+ * @param key - Record key.
2037
+ * @returns resolution after durability.
2038
+ */
2039
+ deleteRecord(table: string, key: string): Promise<void>;
2040
+ /**
2041
+ * Move one record's stored document out of the unit's readable set,
2042
+ * preserving its bytes for inspection instead of deleting them. Backends
2043
+ * whose medium has no per-record document to move (the `single` layout, a
2044
+ * row store) omit this member, and the caller falls back to its
2045
+ * reject-loud path. Absent after the move: a later {@link loadAll} reads
2046
+ * the key as missing and a later {@link putRecord} recreates it fresh.
2047
+ * @param table - Declared table name.
2048
+ * @param key - Record key.
2049
+ * @returns the medium location the document was moved to (diagnostics).
2050
+ */
2051
+ backupRecord?(table: string, key: string): Promise<string>;
2052
+ /**
2053
+ * Write the global singleton durably. Only valid when the descriptor
2054
+ * declared `hasGlobal`.
2055
+ * @param value - Opaque JSON-serializable value.
2056
+ * @returns resolution after durability.
2057
+ */
2058
+ setGlobal(value: unknown): Promise<void>;
2059
+ /**
2060
+ * Drain this unit's in-flight writes and release it. Idempotent.
2061
+ * @returns resolution after the unit is released.
2062
+ */
2063
+ close(): Promise<void>;
2064
+ }
2065
+ //#endregion
2066
+ //#region ../../vendor/deepseek-harness/packages/storage/storage/lib/types/registry.d.ts
2067
+ /**
2068
+ * Mutable name → backend table. Multiple backends stay mounted side by side;
2069
+ * which backend serves which consumer is the consumer's configuration
2070
+ * (e.g. the domain layer's route table), never a hub-global choice.
2071
+ */
2072
+ declare class BackendRegistry {
2073
+ private readonly backends;
2074
+ /**
2075
+ * Register a named backend. Registration is an effect: the returned
2076
+ * disposer removes the name. Disposal does NOT close the backend — the
2077
+ * owning plugin closes it after unregistering.
2078
+ * @param name - Backend name, e.g. `json` or `sqlite`.
2079
+ * @param backend - The backend instance.
2080
+ * @returns the disposer that unregisters the name.
2081
+ */
2082
+ register(name: string, backend: StorageBackend): () => void;
2083
+ /**
2084
+ * Resolve a backend by name.
2085
+ * @param name - Registered backend name.
2086
+ * @returns the backend.
2087
+ */
2088
+ get(name: string): StorageBackend;
2089
+ /**
2090
+ * Registered backend names, for diagnostics.
2091
+ * @returns a snapshot array of names.
2092
+ */
2093
+ names(): string[];
2094
+ }
2095
+ //#endregion
2096
+ //#region ../../vendor/deepseek-harness/packages/storage/storage/lib/types/index.d.ts
2097
+ declare module '@deepseek-ai/cordis' {
2098
+ interface Context {
2099
+ storage: Storage;
2100
+ }
2101
+ }
2102
+ /**
2103
+ * Data forms mountable on the hub, keyed by form name. Form owners extend
2104
+ * this map via declaration merging (the domain layer merges
2105
+ * `domain: DomainFacility`) and mount the facility in their `apply`.
2106
+ */
2107
+ interface StorageForms {}
2108
+ /**
2109
+ * The storage hub service. Backends register under `backend`; data forms
2110
+ * mount under their `StorageForms` key and are reached as `ctx.storage.<form>`.
2111
+ */
2112
+ declare class Storage extends Service {
2113
+ /** Named backend table; multiple backends stay mounted side by side. */
2114
+ readonly backend: BackendRegistry;
2115
+ private readonly forms;
2116
+ constructor(ctx: Context);
2117
+ /**
2118
+ * Mount a data-form facility on the hub. Mounting is an effect: the
2119
+ * returned disposer unmounts the form.
2120
+ * @param form - Form key declared in {@link StorageForms}.
2121
+ * @param facility - The facility instance to expose.
2122
+ * @returns the disposer that unmounts the form.
2123
+ */
2124
+ mount<K extends keyof StorageForms>(form: K, facility: StorageForms[K]): () => void;
2125
+ /**
2126
+ * Resolve a mounted data form.
2127
+ * @param form - Form key declared in {@link StorageForms}.
2128
+ * @returns the mounted facility.
2129
+ */
2130
+ form<K extends keyof StorageForms>(form: K): StorageForms[K];
2131
+ /** Domain data form; present once the domain layer plugin is loaded. */
2132
+ get domain(): StorageForms extends {
2133
+ domain: infer D;
2134
+ } ? D : never;
2135
+ }
2136
+ //#endregion
2137
+ //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/spec.d.ts
2138
+ /** Global singleton declaration: schema plus the value used before the first write. */
2139
+ interface DomainGlobalSpec<G> {
2140
+ /** Validates the stored global at the durable boundary. */
2141
+ readonly schema: ZodType<G>;
2142
+ /** Value served when the medium holds no global yet; not written until the first `set`. */
2143
+ readonly initial: G;
2144
+ }
2145
+ /**
2146
+ * One table declaration. `K` is a phantom key type (typically a branded
2147
+ * string) carried for compile-time projection only; keys are plain strings on
2148
+ * the medium.
2149
+ */
2150
+ interface DomainTableSpec<K extends string = string, V = unknown> {
2151
+ /** Validates every stored record at the durable boundary. */
2152
+ readonly valueSchema: ZodType<V>;
2153
+ /** Phantom carrier for the key type; never present at runtime. */
2154
+ readonly __key?: K;
2155
+ }
2156
+ /** Static declaration of one domain: identity, version, and record layout. */
2157
+ interface DomainSpec {
2158
+ /** Domain name; must match `UNIT_NAME_RE` (doubles as the backend unit name). */
2159
+ readonly name: string;
2160
+ /** Current domain format version; reads enforce it according to the selected layout. */
2161
+ readonly version: number;
2162
+ /**
2163
+ * Medium layout for the backend unit: `single` (the default) stores the
2164
+ * whole unit as one document; `per-record` stores each record as its own
2165
+ * document, for units whose records are large, sparse, or individually
2166
+ * disposable — the projection cache — and scopes version checks per record
2167
+ * (an unaccepted record document is discarded, never migrated).
2168
+ */
2169
+ readonly layout?: 'single' | 'per-record';
2170
+ /**
2171
+ * Older domain versions whose stored records the current record schemas
2172
+ * also accept (the declaring owner vouches for that, typically by
2173
+ * declaring the fields older records lack as optional). `per-record` backends
2174
+ * read documents stamped with a listed version instead of discarding them,
2175
+ * and accept a legacy whole-unit file so stamped for the one-time
2176
+ * bootstrap; writes always stamp {@link version}.
2177
+ */
2178
+ readonly compatibleVersions?: readonly number[];
2179
+ /**
2180
+ * What `open` does with a stored table record that fails its zod schema.
2181
+ * Absent (the default), the whole open rejects with `invalid-record` —
2182
+ * right for authoritative data. `'backup-and-skip'` is for domains whose
2183
+ * records are disposable derived data: the backend moves the record's
2184
+ * document aside (`KvUnit.backupRecord`), the failure is logged with
2185
+ * its cause, and the open continues with the record absent. A backend
2186
+ * without `backupRecord` (no per-record document to move) falls back
2187
+ * to the rejecting default. The global slot always rejects.
2188
+ */
2189
+ readonly invalidRecords?: 'backup-and-skip';
2190
+ /** Optional global singleton slot. */
2191
+ readonly global?: DomainGlobalSpec<unknown>;
2192
+ /** Table declarations keyed by table name; each name must match `UNIT_NAME_RE`. */
2193
+ readonly tables: Record<string, DomainTableSpec>;
2194
+ }
2195
+ /** Key type of one declared table, recovered from its phantom carrier. */
2196
+ type TableKeyOf<S extends DomainSpec, N extends keyof S['tables']> = S['tables'][N] extends DomainTableSpec<infer K> ? K : never;
2197
+ /** Value type of one declared table. */
2198
+ type TableValueOf<S extends DomainSpec, N extends keyof S['tables']> = S['tables'][N] extends DomainTableSpec<string, infer V> ? V : never;
2199
+ //#endregion
2200
+ //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/domain.d.ts
2201
+ /** Handle on a domain's global singleton. */
2202
+ interface DomainGlobal<G> {
2203
+ /**
2204
+ * Current value, synchronously from the authoritative in-memory state.
2205
+ * Before the first `set` this is the spec's `initial`.
2206
+ * @returns the current global value.
2207
+ */
2208
+ get(): G;
2209
+ /**
2210
+ * Replace the value durably. Queued on the domain's write chain; the first
2211
+ * `set` is what materializes the global on the medium.
2212
+ * @param value - New value; must satisfy the spec's schema (not re-checked
2213
+ * here — validation happens at the durable read boundary).
2214
+ * @returns resolution after durability and event emission.
2215
+ */
2216
+ set(value: G): Promise<void>;
2217
+ }
2218
+ /**
2219
+ * Handle on one declared table. Records are plain immutable data: returned
2220
+ * values are the stored objects themselves (no defensive copies) and must not
2221
+ * be mutated in place — replace via `put`/`update`.
2222
+ */
2223
+ interface KvTable<K extends string, V> {
2224
+ /**
2225
+ * Read one record, synchronously from memory.
2226
+ * @param key - Record key.
2227
+ * @returns the record, or `undefined` when absent.
2228
+ */
2229
+ get(key: K): V | undefined;
2230
+ /**
2231
+ * Snapshot iterator over `[key, record]` pairs. A snapshot, not a live
2232
+ * view: iteration stays stable while queued writes land.
2233
+ * @returns the pair iterator.
2234
+ */
2235
+ entries(): IterableIterator<[K, V]>;
2236
+ /**
2237
+ * Snapshot iterator over keys.
2238
+ * @returns the key iterator.
2239
+ */
2240
+ keys(): IterableIterator<K>;
2241
+ /** Current record count. */
2242
+ readonly size: number;
2243
+ /**
2244
+ * Insert or overwrite one record durably.
2245
+ * @param key - Record key.
2246
+ * @param value - The full new record (no partial merge).
2247
+ * @returns resolution after durability and event emission.
2248
+ */
2249
+ put(key: K, value: V): Promise<void>;
2250
+ /**
2251
+ * Delete one record durably.
2252
+ * @param key - Record key.
2253
+ * @returns `true` when the record existed, `false` when it was already
2254
+ * absent (no write and no event in that case).
2255
+ */
2256
+ delete(key: K): Promise<boolean>;
2257
+ /**
2258
+ * Atomic read-modify-write on the domain's write chain: `fn` sees the
2259
+ * value current at its queue slot, so concurrent updates never interleave.
2260
+ * @param key - Record key; a missing key rejects with `missing-key`.
2261
+ * @param fn - Synchronous pure transform from current to next record.
2262
+ * @returns the stored next record.
2263
+ */
2264
+ update(key: K, fn: (current: V) => V): Promise<V>;
2265
+ }
2266
+ /** Global handle of a spec: typed when declared, `never` (inaccessible) when not. */
2267
+ type DomainGlobalHandleOf<S extends DomainSpec> = S extends {
2268
+ readonly global: DomainGlobalSpec<infer G>;
2269
+ } ? DomainGlobal<G> : never;
2270
+ /** One open domain, typed by its spec. */
2271
+ interface Domain<S extends DomainSpec> {
2272
+ /** Domain name from the spec. */
2273
+ readonly name: string;
2274
+ /** Global singleton handle; a spec without `global` has no usable handle (`never`). */
2275
+ readonly global: DomainGlobalHandleOf<S>;
2276
+ /**
2277
+ * Resolve one declared table handle. Handles are stable — repeated calls
2278
+ * return the same instance.
2279
+ * @param name - Declared table name.
2280
+ * @returns the typed table handle.
2281
+ */
2282
+ table<N extends keyof S['tables'] & string>(name: N): KvTable<TableKeyOf<S, N>, TableValueOf<S, N>>;
2283
+ /**
2284
+ * Close this domain: reject new writes immediately, drain already-queued
2285
+ * writes (their events still emit), release the backend unit, then free
2286
+ * the domain name for a later open. Idempotent — repeated calls share one
2287
+ * teardown. The consumer owns this call (typically as its own `ctx.effect`
2288
+ * disposer); the facility closes any domain left open when it unmounts.
2289
+ * @returns resolution after the unit is released.
2290
+ */
2291
+ close(): Promise<void>;
2292
+ }
2293
+ /**
2294
+ * The single domain implementation behind the {@link Domain} interface. The
2295
+ * facility constructs it from a validated `loadAll` snapshot and erases it to
2296
+ * `Domain<S>`; nothing outside this package constructs one.
2297
+ */
2298
+ declare class DomainImpl {
2299
+ private readonly ctx;
2300
+ private readonly unit;
2301
+ private readonly onClosed;
2302
+ /** Domain name from the spec. */
2303
+ readonly name: string;
2304
+ private readonly tables;
2305
+ private globalValue;
2306
+ private readonly globalHandle?;
2307
+ /** Tail of the write chain; every link settles (rejections are observed by the caller's slice). */
2308
+ private chain;
2309
+ /** Set when close begins: new writes reject while already-queued writes drain. */
2310
+ private disposing;
2311
+ /** Set when close finishes (chain drained, unit closed): reads reject from here on. */
2312
+ private closed;
2313
+ private disposal?;
2314
+ /**
2315
+ * @param ctx - Context that carries `domain/changed` emissions.
2316
+ * @param spec - The domain declaration.
2317
+ * @param unit - The opened backend unit; this instance owns its lifecycle.
2318
+ * @param records - Validated records from the unit's `loadAll`, one entry
2319
+ * per declared table (empty maps included) — the facility builds it from
2320
+ * the spec, so the entry set IS the table set.
2321
+ * @param globalValue - Validated stored global, or the spec's `initial`
2322
+ * when the medium held none; `undefined` when the spec declares no global.
2323
+ * @param onClosed - Facility hook run once after teardown completes; frees
2324
+ * the domain name for a later open.
2325
+ */
2326
+ constructor(ctx: Context, spec: DomainSpec, unit: KvUnit, records: Map<string, Map<string, unknown>>, globalValue: unknown, onClosed: () => void);
2327
+ /** Global singleton handle; accessing it on a spec that declares no global is a caller bug and throws. */
2328
+ get global(): DomainGlobal<unknown>;
2329
+ /**
2330
+ * Resolve one declared table handle; an undeclared name is a caller bug
2331
+ * and throws.
2332
+ * @param name - Declared table name.
2333
+ * @returns the stable table handle.
2334
+ */
2335
+ table(name: string): KvTable<string, unknown>;
2336
+ /**
2337
+ * Close this domain: reject new writes immediately, drain already-queued
2338
+ * writes (their events still emit), close the unit, then free the name via
2339
+ * the facility hook. Idempotent — repeated calls share one teardown.
2340
+ * @returns resolution after the unit is released.
2341
+ */
2342
+ close(): Promise<void>;
2343
+ private runClose;
2344
+ /**
2345
+ * Dispatch one post-durability change notification, containing observer
2346
+ * failures: the write is already committed (medium and memory both hold
2347
+ * the new state), so a throwing listener must not retroactively reject it.
2348
+ */
2349
+ private emitChanged;
2350
+ private enqueue;
2351
+ private assertReadable;
2352
+ }
2353
+ //#endregion
2354
+ //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/events.d.ts
2355
+ /**
2356
+ * Change-event vocabulary of the domain data form. Every durable write emits
2357
+ * one event after the backend resolves durability, carrying the new snapshot
2358
+ * and an operation discriminant — never the old value (a diffing consumer
2359
+ * keeps its own previous snapshot). This is the event source for cross-process
2360
+ * change push (RPC frames) in a later phase.
2361
+ * @module @deepseek-ai/dsh-storage-domain/src/events
2362
+ */
2363
+ /** Shared location fields of one durable domain change. */
2364
+ interface DomainChangedBase {
2365
+ /** Owning domain name. */
2366
+ readonly domain: string;
2367
+ /** Table name; `''` for a global-singleton write. */
2368
+ readonly table: string;
2369
+ /** Record key; `''` for a global-singleton write. */
2370
+ readonly key: string;
2371
+ }
2372
+ /** A record (or the global singleton) was inserted or overwritten. */
2373
+ interface DomainChangedPut extends DomainChangedBase {
2374
+ readonly operation: 'put';
2375
+ /** The new snapshot. */
2376
+ readonly value: unknown;
2377
+ }
2378
+ /** A record was deleted; tombstones carry no value. */
2379
+ interface DomainChangedDeleted extends DomainChangedBase {
2380
+ readonly operation: 'deleted';
2381
+ readonly value?: never;
2382
+ }
2383
+ /** One durable domain change; a closed union — switch on `operation`. */
2384
+ type DomainChanged = DomainChangedPut | DomainChangedDeleted;
2385
+ declare module '@deepseek-ai/cordis' {
2386
+ interface Events {
2387
+ /**
2388
+ * A domain record or the global singleton changed, emitted once per write
2389
+ * strictly after the backend acknowledged durability. Events of one
2390
+ * domain arrive in its write-chain order.
2391
+ * @param change - domain, table (`''` for global), key (`''` for global),
2392
+ * operation discriminant, and on `put` the new snapshot.
2393
+ * @mode emit
2394
+ */
2395
+ 'domain/changed'(change: DomainChanged): void;
2396
+ }
2397
+ }
2398
+ //#endregion
2399
+ //#region ../../vendor/deepseek-harness/packages/storage/storage-domain/lib/types/index.d.ts
2400
+ declare module '@deepseek-ai/dsh-storage' {
2401
+ interface StorageForms {
2402
+ domain: DomainFacility;
2403
+ }
2404
+ }
2405
+ declare module '@deepseek-ai/cordis' {
2406
+ interface Context {
2407
+ storageDomain: DomainFacility;
2408
+ }
2409
+ }
2410
+ /**
2411
+ * Plugin config. Which backend serves which domain is decided here, not
2412
+ * globally on the hub: `backend` is the default route and `routes` overrides
2413
+ * it per domain name. A route naming an unregistered backend fails loud at
2414
+ * `open` with `backend-not-found`.
2415
+ */
2416
+ interface Config$2 {
2417
+ /** Default backend name for every domain without an explicit route. Required: there is no universally correct medium. */
2418
+ backend: string;
2419
+ /** Per-domain overrides: domain name → backend name. */
2420
+ routes?: Record<string, string>;
2421
+ }
2422
+ declare const Config$2: Schema<Config$2>;
2423
+ /**
2424
+ * The mounted domain facility. Opens declared domains over routed backends;
2425
+ * one facility instance owns the open-domain table and enforces single-open
2426
+ * per domain name.
2427
+ */
2428
+ declare class DomainFacility {
2429
+ private readonly ctx;
2430
+ private readonly config;
2431
+ private readonly domains;
2432
+ /** Names reserved by an in-flight or completed open, so concurrent opens of one name fail loud. */
2433
+ private readonly reserved;
2434
+ /**
2435
+ * @param ctx - Context of the domain plugin; open-domain effects and change
2436
+ * events attach here.
2437
+ * @param config - Validated plugin config.
2438
+ */
2439
+ constructor(ctx: Context, config: Config$2);
2440
+ /**
2441
+ * Open one declared domain. Steps, each failing the whole call: reject a
2442
+ * name that is already open (`already-open`); resolve the backend route
2443
+ * (`backend-not-found` passes through from the hub); require its `kv` facet
2444
+ * (`facet-unsupported`); open the unit projected from the spec (backend
2445
+ * `version-mismatch`/`malformed-medium` pass through); load and validate
2446
+ * every stored record against the spec's zod schemas (`invalid-record`
2447
+ * with the offending table and key — unless the spec declares
2448
+ * `invalidRecords: 'backup-and-skip'` and the unit can move documents aside, in
2449
+ * which case the failing record is backed up, logged, and skipped);
2450
+ * construct the domain.
2451
+ *
2452
+ * Lifecycle: the CALLER owns the returned handle and closes it via
2453
+ * `Domain.close()` (typically as its own `ctx.effect` disposer) — the
2454
+ * facility does not tie the domain to any consumer fiber. Domains still
2455
+ * open when the facility unmounts are closed by the plugin disposer.
2456
+ * @param spec - The domain declaration, typically from `defineDomain`.
2457
+ * @returns the opened domain handle, typed by the spec.
2458
+ */
2459
+ open<S extends DomainSpec>(spec: S): Promise<Domain<S>>;
2460
+ /**
2461
+ * Look up an open domain by name, untyped. Diagnostic surface (the package
2462
+ * invariant cross-checks change events against live domain state); typed
2463
+ * consumers hold the handle returned by {@link open}.
2464
+ * @param name - Domain name.
2465
+ * @returns the open domain runtime, or `undefined` when not open.
2466
+ */
2467
+ get(name: string): DomainImpl | undefined;
2468
+ /**
2469
+ * Close every domain still open on this facility. The unmount path for
2470
+ * consumers that never called `Domain.close()` themselves; closing is
2471
+ * idempotent, so double-closing an already-closed domain is harmless.
2472
+ * @returns resolution after every unit is released.
2473
+ */
2474
+ closeAll(): Promise<void>;
2475
+ }
2476
+ //#endregion
2477
+ //#region ../../vendor/deepseek-harness/packages/session/session-projection-cache/lib/types/index.d.ts
2478
+ declare module '@deepseek-ai/cordis' {
2479
+ interface Context {
2480
+ sessionProjectionCache: SessionProjectionCache;
2481
+ }
2482
+ }
2483
+ /**
2484
+ * Plugin config. Both throttle triggers are deployment choices with no
2485
+ * universally correct value, so the composition states them explicitly
2486
+ * (cordis.yml); the three mandatory write points (session creation,
2487
+ * `turn/end`, and session disposal) are policy, not tunables, and always
2488
+ * fire.
2489
+ */
2490
+ interface Config$1 {
2491
+ /** Committed events per session that force a durable checkpoint write between mandatory points. */
2492
+ writeEveryEvents: number;
2493
+ /** Longest time (milliseconds) a dirty checkpoint may stay unwritten between mandatory points. */
2494
+ writeIntervalMs: number;
2495
+ }
2496
+ declare const Config$1: Schema<Config$1>;
2497
+ /**
2498
+ * The persisted projection cache service. Opens the `session_projcache`
2499
+ * domain at init, checkpoints live sessions on a throttled write-behind
2500
+ * (count/interval triggers from {@link Config}) plus three mandatory points —
2501
+ * session creation, `turn/end`, and session disposal (the live-to-cold
2502
+ * moment) — and serves the
2503
+ * cached rows for a session header. Every durable write is fail-soft:
2504
+ * failures log a warning and the cache self-heals on the next write.
2505
+ */
2506
+ declare class SessionProjectionCache extends Service {
2507
+ config: Config$1;
2508
+ static inject: string[];
2509
+ static Config: Schema<Config$1>;
2510
+ private table?;
2511
+ private readonly dirty;
2512
+ constructor(ctx: Context, config: Config$1);
2513
+ /** Open the domain and install the write-behind listeners. */
2514
+ protected [Service.init](): Promise<void>;
2515
+ /**
2516
+ * The stored record for one session, accepted only when its bound log
2517
+ * identity matches `expected`. A session id names a slot, not a lifecycle:
2518
+ * a recreated id or a persistence store swapped under a surviving cache
2519
+ * must not let an old record seed state folded from an unrelated log.
2520
+ * Synchronous from the domain's in-memory state — the same state every
2521
+ * write mutated, so a read can never go around the write chain to the
2522
+ * medium.
2523
+ * @param id - the session whose record is read.
2524
+ * @param expected - the log identity the caller holds (live or stored header).
2525
+ * @returns the identity-matching record, or `undefined` (absent or unrelated).
2526
+ */
2527
+ private recordFor;
2528
+ /**
2529
+ * The zero-I/O listing read: whole values viewed straight from the stored
2530
+ * rows (version-matching keys only), each cut carried with its watermark so
2531
+ * a client value store can seed under its higher-seq-wins rule — as stale
2532
+ * as the last durable checkpoint but never wrong, and never from an
2533
+ * unrelated log (the caller's header is the identity witness). Fresher
2534
+ * paths (the history tail baseline) supersede these values whenever a
2535
+ * session is actually opened.
2536
+ * @param meta - the listed session's header (identity witness; no log read).
2537
+ * @param inheritedEventCount - exact inherited prefix length that completes
2538
+ * the checkpoint identity.
2539
+ * @param keys - optional projection keys required by the caller's audience.
2540
+ * @returns the cut (`asOfSeq` = lowest served-row watermark), or
2541
+ * `undefined` when no usable row exists for this lifecycle.
2542
+ */
2543
+ cachedSnapshot(meta: SessionHeader$1, inheritedEventCount: SessionLogOffset, keys?: readonly Extract<keyof SessionProjectionMap, string>[]): ProjectionSnapshot | undefined;
2544
+ /**
2545
+ * Read only a predecessor checkpoint's title as a zero-I/O listing hint.
2546
+ *
2547
+ * The authoritative Session header supplies the lifecycle identity. A cache
2548
+ * checkpoint can lag that log but cannot lead it because writes flush the
2549
+ * log first, so a matching predecessor title is a genuine (possibly stale)
2550
+ * fact from this Session. The registry still requires the current title
2551
+ * projection's row version and schema. No other predecessor projection is
2552
+ * exposed: format normalization can change their current meaning, and the
2553
+ * strict {@link cachedSnapshot} / hydration paths continue to reject them.
2554
+ * @param meta - authoritative listed Session header.
2555
+ * @param inheritedEventCount - exact inherited cut completing the lifecycle identity.
2556
+ * @returns a title-only checkpoint view with `asOfSeq: -1`, or `undefined`
2557
+ * when the record is current, newer, unrelated, missing, or incompatible
2558
+ * with the title unit. The sentinel avoids reusing a sequence that a
2559
+ * cardinality-changing Session migration may have remapped.
2560
+ */
2561
+ cachedPredecessorTitle(meta: SessionHeader$1, inheritedEventCount: SessionLogOffset): ProjectionSnapshot | undefined;
2562
+ /** View selected wire rows and bind them to their lowest served watermark. */
2563
+ private viewRecord;
2564
+ /**
2565
+ * Hydrate projection cells for an already-prepared Session without another
2566
+ * persistence read. The cache seeds matching rows; the supplied exact log
2567
+ * advances every unit to the observation cut. No checkpoint is written
2568
+ * because the logical observation may contain recovery events not yet durable.
2569
+ * @param session - exact unpublished Session retained by persistence.
2570
+ * @param events - exact logical event prefix represented by the observation.
2571
+ * @returns all projection values at the event cut.
2572
+ */
2573
+ hydratePrepared(session: Session$1, events: readonly SessionEvent$1[]): ProjectionSnapshot;
2574
+ /**
2575
+ * Durably checkpoint one live session NOW (all mandatory points call
2576
+ * this; tests and carriers may too). The registry cut is snapshotted at
2577
+ * this boundary (states are live references), then the session's record is
2578
+ * replaced on the domain's write chain. NOT fail-soft — callers on the
2579
+ * fail-soft paths contain it.
2580
+ * @param session - the live session to checkpoint.
2581
+ * @returns resolution after durability and event emission.
2582
+ */
2583
+ write(session: Session$1): Promise<void>;
2584
+ /**
2585
+ * Cold-read one session's projections from its complete log. Each unit is
2586
+ * seeded from the identity-checked cached rows — the registry skips `apply`
2587
+ * for the already-folded prefix (events at or below the row's `seq`) — and
2588
+ * the refreshed checkpoint is written back (fail-soft, fire-and-forget), so
2589
+ * the first cold read creates the cache row and later ones seed from it.
2590
+ * The caller supplies the complete log in seq order: this service never
2591
+ * consults the persistence layer.
2592
+ * @param meta - the stored session header (identity witness).
2593
+ * @param inheritedEventCount - exact inherited prefix length for projection initialization and identity.
2594
+ * @param events - the session's complete log, in seq order.
2595
+ * @returns the projection cut at the log end.
2596
+ */
2597
+ coldSnapshot(meta: SessionHeader$1, inheritedEventCount: SessionLogOffset, events: readonly SessionEvent$1[]): ProjectionSnapshot;
2598
+ private installWritePath;
2599
+ /**
2600
+ * One fail-soft durable checkpoint. Every caller has work by construction:
2601
+ * the throttle triggers only fire dirty (markClean clears the timer with
2602
+ * the counter) and the mandatory points write unconditionally.
2603
+ */
2604
+ private flushSoft;
2605
+ /** Reset one session's dirty bookkeeping (its checkpoint is being written). */
2606
+ private markClean;
2607
+ /** Replace one session's stored record with its log identity and a detached snapshot of `rows`. */
2608
+ private put;
2609
+ private requireTable;
2610
+ }
2611
+ //#endregion
2612
+ //#region ../../vendor/deepseek-harness/packages/util/brand/lib/types/index.d.ts
2613
+ /**
2614
+ * Duplicate-install-safe nominal primitive helpers.
2615
+ *
2616
+ * A brand makes structurally identical strings or numbers non-interchangeable
2617
+ * at the type level: a `SessionId` cannot be passed where a `ToolCallId` is
2618
+ * expected, and an event sequence cannot be passed as a log offset. Comparison,
2619
+ * logging, and serialization retain the underlying primitive behavior.
2620
+ *
2621
+ * This package owns no concrete domain value and keeps no runtime identity or mutable
2622
+ * state, so independently installed copies produce interchangeable values.
2623
+ *
2624
+ * @module @deepseek-ai/dsh-brand
2625
+ */
2626
+ declare const BRAND: unique symbol;
2627
+ /** A string carrying a compile-time-only brand `B`. */
2628
+ type Branded<B extends string> = string & {
2629
+ readonly [BRAND]: B;
2630
+ };
2631
+ //#endregion
2632
+ //#region ../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/types.d.ts
2633
+ /**
2634
+ * Identifies one workspace record. A generated uuid, never the path: path
2635
+ * normalization rewrites paths, and a reference anchor must stay stable.
2636
+ */
2637
+ type WorkspaceId$1 = Branded<'WorkspaceId'>;
2638
+ declare module '@deepseek-ai/dsh-typert-protocol' {
2639
+ interface RemoteErrorDetailsMap {
2640
+ /** No registration carries that Workspace identity. */
2641
+ 'workspace/not-found': {
2642
+ readonly workspaceId: WorkspaceId$1;
2643
+ };
2644
+ }
2645
+ }
2646
+ /**
2647
+ * One workspace: a stable id over an existing directory, a display title, and
2648
+ * an ordered candidate account of sessions. Membership requires both an id in
2649
+ * that account and a session header whose canonical cwd equals the workspace
2650
+ * path. Consumers only see this interface; the implementation stays private.
2651
+ */
2652
+ interface Workspace {
2653
+ /** Stable record id (generated uuid). */
2654
+ readonly id: WorkspaceId$1;
2655
+ /**
2656
+ * Canonical directory path: the `fs.realpath` of the path given at create
2657
+ * time (trailing slashes, `..`, and symlinks all resolved). Never rewritten
2658
+ * afterwards, even when the directory disappears (see {@link status}).
2659
+ */
2660
+ readonly path: string;
2661
+ /** Display title. Defaults to the final path segment, or a filesystem root's own spelling; duplicates are allowed. */
2662
+ readonly title: string;
2663
+ /** ISO-8601 creation instant, stamped at create and never rewritten. */
2664
+ readonly createdAt: string;
2665
+ /** ISO-8601 instant of the last durable mutation (create counts as one). */
2666
+ readonly updatedAt: string;
2667
+ /**
2668
+ * Header-validated sessions in manually owned order: a new session is
2669
+ * prepended at attach, explicit reordering goes through
2670
+ * `insertSessionBefore`, and activity never reorders. The durable candidate
2671
+ * account is filtered synchronously: missing headers, invalid cwd values,
2672
+ * and canonical cwd mismatches are never returned. A subsequent workspace
2673
+ * mutation prunes those filtered candidates durably.
2674
+ */
2675
+ readonly sessionIds: readonly SessionId$1[];
2676
+ /**
2677
+ * Replace the display title durably.
2678
+ * @param title - New title; any string, duplicates across workspaces allowed.
2679
+ * @returns resolution after durability.
2680
+ */
2681
+ setTitle(title: string): Promise<void>;
2682
+ /**
2683
+ * Prepend a session to this workspace's candidate account. An already
2684
+ * accounted id resolves without writing, aside from the durable
2685
+ * filtered-candidate prune every accepted mutation performs. A new id's
2686
+ * live or persisted
2687
+ * header cwd must resolve to an existing directory equal to {@link path};
2688
+ * unknown ids, missing or invalid cwd values, and mismatches reject without
2689
+ * writing.
2690
+ * @param sessionId - The session to record.
2691
+ * @returns resolution after durability.
2692
+ */
2693
+ attachSession(sessionId: SessionId$1): Promise<void>;
2694
+ /**
2695
+ * Move an accounted session within the manual order, DOM-insertBefore-like:
2696
+ * with an anchor the session lands before it, without one it appends to the
2697
+ * end. Only the moved id changes position. A session or anchor absent from
2698
+ * the account rejects without writing; a move to the current position
2699
+ * resolves without writing, aside from the durable filtered-candidate
2700
+ * prune every accepted mutation performs; decided on the domain write
2701
+ * chain.
2702
+ * @param sessionId - The accounted session to move.
2703
+ * @param beforeSessionId - Accounted anchor to insert before; omitted appends.
2704
+ * @returns resolution after durability.
2705
+ */
2706
+ insertSessionBefore(sessionId: SessionId$1, beforeSessionId?: SessionId$1): Promise<void>;
2707
+ /**
2708
+ * Remove a session from this workspace's account. Idempotent: an id not on
2709
+ * the account resolves without writing, aside from the durable
2710
+ * filtered-candidate prune every accepted mutation performs; decided on
2711
+ * the domain write chain like attach. Never touches the session's own stored log.
2712
+ * @param sessionId - The session to remove.
2713
+ * @returns resolution after durability.
2714
+ */
2715
+ detachSession(sessionId: SessionId$1): Promise<void>;
2716
+ /**
2717
+ * Live directory check, uncached: whether {@link path} currently exists and
2718
+ * is a directory. A missing directory never mutates the record — the
2719
+ * directory may only be temporarily moved.
2720
+ * @returns `'ok'` when the directory exists, `'missing-dir'` otherwise.
2721
+ */
2722
+ status(): Promise<'ok' | 'missing-dir'>;
2723
+ }
2724
+ //#endregion
2725
+ //#region ../../vendor/deepseek-harness/packages/workspace/workspace/lib/types/index.d.ts
2726
+ /** Identifies one workspace record (see `src/types.ts` for the brand rationale). */
2727
+ type WorkspaceId = WorkspaceId$1;
2728
+ /**
2729
+ * Brand a string as a {@link WorkspaceId}.
2730
+ * @param id - Raw workspace id string.
2731
+ * @returns the same string, branded at compile time.
2732
+ */
2733
+ declare function WorkspaceId(id: string): WorkspaceId;
2734
+ declare module '@deepseek-ai/cordis' {
2735
+ interface Context {
2736
+ workspaceRegistry: WorkspaceRegistry;
2737
+ }
2738
+ }
2739
+ /**
2740
+ * Durable workspace registry. Startup waits for `sessionPersistence`, builds
2741
+ * one canonical-cwd header index, and completes the one-time history
2742
+ * bootstrap before the service becomes active. The persistence dependency is
2743
+ * mandatory so an unavailable peer can never be mistaken for an empty
2744
+ * history and commit the initialized marker.
2745
+ */
2746
+ declare class WorkspaceRegistry extends Service {
2747
+ static inject: string[];
2748
+ private table?;
2749
+ private global?;
2750
+ private state?;
2751
+ private readonly entities;
2752
+ private readonly headers;
2753
+ private readonly sessionPaths;
2754
+ private readonly invalidSessionPaths;
2755
+ private operationTail;
2756
+ private readonly host;
2757
+ constructor(ctx: Context);
2758
+ /** Open the domain, finish bootstrap when required, and rebuild the ordered cache. */
2759
+ protected [Service.init](): Promise<void>;
2760
+ /**
2761
+ * Create or reuse a workspace for an existing directory. The fully qualified
2762
+ * path is canonicalized through `fs.realpath`; a relative, nonexistent, or
2763
+ * non-directory path rejects. Repeated calls for the same canonical path
2764
+ * return the existing entity without changing its title.
2765
+ * A newly created workspace is prepended to the durable registry order.
2766
+ * Different canonical paths may share a display title.
2767
+ * @param path - Existing directory to own, in a fully qualified path spelling.
2768
+ * @param title - Display title used only when a new record is created.
2769
+ * @returns the existing or newly durable workspace.
2770
+ */
2771
+ create(path: string, title?: string): Promise<Workspace>;
2772
+ /**
2773
+ * Look up a workspace by id.
2774
+ * @param id - Workspace id.
2775
+ * @returns the workspace, or `undefined` when unknown.
2776
+ */
2777
+ get(id: WorkspaceId): Workspace | undefined;
2778
+ /**
2779
+ * Synchronous workspace projection in durable registry order. Every
2780
+ * entity's `sessionIds` getter is already filtered by the startup/live
2781
+ * canonical-cwd header index; this method performs no persistence reads.
2782
+ * @returns a fresh ordered array of workspace entities.
2783
+ */
2784
+ list(): Workspace[];
2785
+ /**
2786
+ * Delete one workspace registration while retaining its directory and every
2787
+ * session log. The durable order is updated before the table deletion; a
2788
+ * failed table write restores the prior order and keeps the entity
2789
+ * published. Unknown ids are an idempotent no-op for domain callers.
2790
+ * @param id - Workspace registration to remove.
2791
+ * @returns `true` when a record was deleted, `false` when it was unknown.
2792
+ */
2793
+ delete(id: WorkspaceId): Promise<boolean>;
2794
+ /**
2795
+ * Move one workspace within the durable display order, DOM-insertBefore-like.
2796
+ * With an anchor it lands before that workspace; without one it appends.
2797
+ * @param id - Workspace to move.
2798
+ * @param beforeId - Workspace anchor; omitted appends.
2799
+ * @returns the complete committed workspace order.
2800
+ */
2801
+ insertBefore(id: WorkspaceId, beforeId?: WorkspaceId): Promise<readonly WorkspaceId[]>;
2802
+ /**
2803
+ * The registry-global archive set: sessions hidden from every grouping
2804
+ * surface. Archiving never touches workspace accounting — an archived
2805
+ * session keeps its `sessionIds` slot so unarchiving restores its position.
2806
+ * @returns the archived session ids in archive order.
2807
+ */
2808
+ get archivedSessionIds(): readonly SessionId[];
2809
+ /**
2810
+ * Archive one session durably. The session must exist (live or in session
2811
+ * persistence); its workspace accounting — or lack of one — is irrelevant.
2812
+ * An already archived id resolves without writing.
2813
+ * @param sessionId - The session to archive.
2814
+ * @returns resolution after durability.
2815
+ */
2816
+ archiveSession(sessionId: SessionId): Promise<void>;
2817
+ /**
2818
+ * Whether a session is live, header-indexed, or present in a fresh
2819
+ * persistence listing. Only a definite miss returns false — a failing
2820
+ * `sessionPersistence.list()` propagates so storage faults never
2821
+ * masquerade as an unknown session.
2822
+ */
2823
+ private sessionKnown;
2824
+ /**
2825
+ * Resolve by canonical directory path without creating or mutating a
2826
+ * workspace. A missing path rejects during `realpath`; an existing unowned
2827
+ * directory returns `undefined`.
2828
+ * @param path - Existing directory path in a fully qualified spelling.
2829
+ * @returns the workspace owning the canonical path, when one exists.
2830
+ */
2831
+ resolveByPath(path: string): Promise<Workspace | undefined>;
2832
+ private createCanonical;
2833
+ private deleteKnown;
2834
+ /**
2835
+ * Complete the one mutation explicitly named by durable state. Unexplained
2836
+ * order/table divergence still reaches {@link validateStoredState} and
2837
+ * fails loud; this path never guesses which operation created a row from its shape alone.
2838
+ */
2839
+ private recoverPendingMutation;
2840
+ private bootstrap;
2841
+ private validateStoredState;
2842
+ private rebuildEntities;
2843
+ private replaceHeaderIndex;
2844
+ private indexHeaders;
2845
+ private indexHeader;
2846
+ /** Every stored session's header, projected from the persistence snapshot listing. */
2847
+ private listStoredHeaders;
2848
+ private indexLiveSessions;
2849
+ private reportFilteredCandidates;
2850
+ private readSessionHeader;
2851
+ private requireTable;
2852
+ private requireState;
2853
+ private setState;
2854
+ private enqueueOperation;
2855
+ }
2856
+ //#endregion
2857
+ //#region ../session-rdb/src/import.d.ts
2858
+ declare function parseJsonlArtifact(content: string): SessionStorageMetadata & {
2859
+ events: SessionEvent$1[];
2860
+ };
2861
+ //#endregion
2862
+ //#region ../../vendor/deepseek-harness/packages/settings/settings/lib/types/redact.d.ts
2863
+ /** One schema-declared secret position inside a redacted value. */
2864
+ interface RedactedSecret {
2865
+ /** Path from the section root to the removed field (concrete dict keys and array indexes included). */
2866
+ path: string[];
2867
+ /** Whether the field held a value before redaction. */
2868
+ set: boolean;
2869
+ }
330
2870
  //#endregion
331
2871
  //#region ../../vendor/deepseek-harness/packages/settings/settings/lib/types/types.d.ts
332
2872
  /** Nominal id of one registered settings namespace. */