better-dsh 0.2.5-a → 0.2.5-c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/THIRD_PARTY_NOTICES.md +49 -0
  2. package/docs/50_test-reports/2026-10-02-better-dsh-schemastery/344/276/235/350/265/226/345/243/260/346/230/216/344/277/256/345/244/215/345/256/236/346/265/213/346/212/245/345/221/212.md +62 -0
  3. package/docs/50_test-reports/2026-10-03-better-dsh-tool-surface-repl-dvc-browser-ast-lsp-4999/345/256/236/346/265/213/346/212/245/345/221/212.md +185 -0
  4. package/docs/50_test-reports/2026-10-03-physical-import/344/270/216llm-completion-ast/347/233/270/345/257/271/350/267/257/345/276/204/344/277/256/345/244/215/345/256/236/346/265/213/346/212/245/345/221/212.md +101 -0
  5. package/docs/50_test-reports/2026-10-03-pnpm11/345/271/264/351/276/204/351/227/250/351/224/201/346/226/207/344/273/266/347/233/270/344/275/215/345/256/236/350/257/201.md +54 -0
  6. package/docs/50_test-reports/2026-10-03-remote-BYO-PTY-label/351/207/215/346/236/204/347/254/254/344/270/200/344/272/272/347/247/260/345/256/236/346/265/213/346/212/245/345/221/212.md +447 -0
  7. package/docs/50_test-reports/2026-10-03-schemastery-cosmokit/346/272/220/347/240/201/345/206/205/350/201/224/345/256/236/346/265/213/346/212/245/345/221/212.md +63 -0
  8. package/docs/50_test-reports/2026-10-03-zero-npm-runtime-deps/345/256/236/346/265/213/346/212/245/345/221/212.md +82 -0
  9. package/docs/specs/remote-pty-label/spec.md +126 -0
  10. package/docs/specs/zero-npm-runtime-deps/spec.md +85 -0
  11. package/lib/BrowserWebSocketTransport-FbPg_VFT.js +39 -0
  12. package/lib/BrowserWebSocketTransport-Q5SUMk7_.js +4 -0
  13. package/lib/LaunchOptions-DlBKKKLC.js +4 -0
  14. package/lib/LaunchOptions-RNO1YIoJ.js +17 -0
  15. package/lib/NodeWebSocketTransport-BdrEPUFe.js +3629 -0
  16. package/lib/NodeWebSocketTransport-DyU2tm5L.js +4 -0
  17. package/lib/bidi-D0POLRy7.js +16106 -0
  18. package/lib/chunk-DQxbwPpZ.js +30 -0
  19. package/lib/compaction/index.d.ts +3 -3
  20. package/lib/compaction/index.js +4 -4
  21. package/lib/failover/index.d.ts +3 -3
  22. package/lib/failover/index.js +4 -4
  23. package/lib/fs-aware/sandbox-plugin.js +20 -20
  24. package/lib/index-DZQNwO7f.d.ts +208 -0
  25. package/lib/index-browser-rqlXyoed.js +21061 -0
  26. package/lib/index.d.ts +4 -4
  27. package/lib/index.js +397 -149
  28. package/lib/kernel-bridge.py +172 -0
  29. package/lib/kernel-env.js +1 -1
  30. package/lib/lib-C8_jXvwA.js +894 -0
  31. package/lib/{lsp-server-registry-946ysdqg.js → lsp-server-registry-C05QLdw0.js} +13 -13
  32. package/lib/{lsp-server-registry-XU6aHSqZ.js → lsp-server-registry-LUjrrLxk.js} +1 -1
  33. package/lib/main-7c69ae95.js +1432 -0
  34. package/lib/main-Dlv0Jm8U.js +3 -0
  35. package/lib/mobile/plugin.d.ts +4 -4
  36. package/lib/mobile/plugin.js +10 -10
  37. package/lib/puppeteer-core-BIIJGWPE.js +1136 -0
  38. package/lib/py-sdk.js +1 -1
  39. package/lib/remote/plugin.d.ts +3 -3
  40. package/lib/remote/plugin.js +148 -53
  41. package/lib/url-schemes/index.d.ts +11 -11
  42. package/lib/url-schemes/index.js +4274 -308
  43. package/lib/util-DgR7HQUl.js +2953 -0
  44. package/lib/web-password.d.ts +7 -7
  45. package/lib/web-password.js +2 -2
  46. package/lib/{web-trust-BO66y72w.js → web-trust-B27wcZEw.js} +2 -2
  47. package/lib/{web-trust-BihHCelF.d.ts → web-trust-CL9P6jVe.d.ts} +7 -7
  48. package/lib/web-trust.d.ts +1 -1
  49. package/lib/web-trust.js +2 -1
  50. package/lib/{wrap-Bzdimp4p.js → wrap-0VA0uFx8.js} +54 -51
  51. package/package.json +9 -21
  52. /package/lib/{kernel-env-hxaihi9C.js → kernel-env-BLPZE-I3.js} +0 -0
  53. /package/lib/{native-capture-x_Hos2e8.js → native-capture-BEByDXYM.js} +0 -0
  54. /package/lib/{py-sdk-Chvy92MB.js → py-sdk-D7klhpWb.js} +0 -0
@@ -0,0 +1,30 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region rolldown:runtime
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __commonJS = (cb, mod) => function() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
28
+
29
+ //#endregion
30
+ export { __require as n, __toESM as r, __commonJS as t };
@@ -1,5 +1,5 @@
1
+ import { t as Schema } from "../index-DZQNwO7f.js";
1
2
  import { Context, Volatile } from "@deepseek-ai/cordis";
2
- import z from "@deepseek-ai/schemastery";
3
3
 
4
4
  //#region src/compaction/config.d.ts
5
5
 
@@ -30,7 +30,7 @@ declare const inject: string[];
30
30
  * `retainTokens` is composition-only (see {@link DEFAULT_RETAIN_TOKENS}) and
31
31
  * stays non-volatile — form writes never touch it, a patch file still can.
32
32
  */
33
- declare const Config: z<CompactionTuningConfig>;
33
+ declare const Config: Schema<CompactionTuningConfig>;
34
34
  /**
35
35
  * The row config as cordis hands it over post-resolution: the volatile
36
36
  * threshold arrives as a live reference, not a plain number.
@@ -50,7 +50,7 @@ declare function apply(ctx: Context, config: ResolvedCompactionTuningConfig | un
50
50
  declare const _default: {
51
51
  name: string;
52
52
  inject: string[];
53
- Config: z<CompactionTuningConfig>;
53
+ Config: Schema<CompactionTuningConfig>;
54
54
  apply: typeof apply;
55
55
  };
56
56
  //#endregion
@@ -1,5 +1,5 @@
1
+ import { t as Schema } from "../lib-C8_jXvwA.js";
1
2
  import { Context } from "@deepseek-ai/cordis";
2
- import z from "@deepseek-ai/schemastery";
3
3
 
4
4
  //#region src/compaction/config.ts
5
5
  /** Upstream `compaction-basic`'s own default: condense at 80% of the window. */
@@ -42,9 +42,9 @@ const inject = [];
42
42
  * `retainTokens` is composition-only (see {@link DEFAULT_RETAIN_TOKENS}) and
43
43
  * stays non-volatile — form writes never touch it, a patch file still can.
44
44
  */
45
- const Config = z.object({
46
- thresholdRatio: z.number().step(.01).min(THRESHOLD_MIN_RATIO).max(THRESHOLD_MAX_RATIO).default(DEFAULT_THRESHOLD_RATIO).volatile(),
47
- retainTokens: z.number().step(1).min(0).default(DEFAULT_RETAIN_TOKENS)
45
+ const Config = Schema.object({
46
+ thresholdRatio: Schema.number().step(.01).min(THRESHOLD_MIN_RATIO).max(THRESHOLD_MAX_RATIO).default(DEFAULT_THRESHOLD_RATIO).volatile(),
47
+ retainTokens: Schema.number().step(1).min(0).default(DEFAULT_RETAIN_TOKENS)
48
48
  });
49
49
  /**
50
50
  * Keep the live compaction engine on the user's threshold preference.
@@ -1,5 +1,5 @@
1
+ import { t as Schema } from "../index-DZQNwO7f.js";
1
2
  import { Context, Volatile } from "@deepseek-ai/cordis";
2
- import z from "@deepseek-ai/schemastery";
3
3
 
4
4
  //#region src/failover/config.d.ts
5
5
 
@@ -27,7 +27,7 @@ declare const inject: string[];
27
27
  * profile-layer patch override on THIS row's entry, the runtime rewrites the
28
28
  * resolved refs in place, and every request re-reads them without a reload.
29
29
  */
30
- declare const Config: z<FailoverConfig>;
30
+ declare const Config: Schema<FailoverConfig>;
31
31
  /**
32
32
  * The row config as cordis hands it over post-resolution: volatile fields are
33
33
  * live references, not plain strings.
@@ -52,7 +52,7 @@ declare function apply(ctx: Context, config: ResolvedFailoverConfig | undefined)
52
52
  declare const _default: {
53
53
  name: string;
54
54
  inject: string[];
55
- Config: z<FailoverConfig>;
55
+ Config: Schema<FailoverConfig>;
56
56
  apply: typeof apply;
57
57
  };
58
58
  //#endregion
@@ -1,6 +1,6 @@
1
+ import { t as Schema } from "../lib-C8_jXvwA.js";
1
2
  import { Context } from "@deepseek-ai/cordis";
2
3
  import { randomUUID } from "node:crypto";
3
- import z from "@deepseek-ai/schemastery";
4
4
  import { RetryId } from "@deepseek-ai/dsh-llm-retry";
5
5
 
6
6
  //#region src/failover/config.ts
@@ -48,9 +48,9 @@ const inject = [];
48
48
  * profile-layer patch override on THIS row's entry, the runtime rewrites the
49
49
  * resolved refs in place, and every request re-reads them without a reload.
50
50
  */
51
- const Config = z.object({
52
- fallback1: z.string().default("").volatile(),
53
- fallback2: z.string().default("").volatile()
51
+ const Config = Schema.object({
52
+ fallback1: Schema.string().default("").volatile(),
53
+ fallback2: Schema.string().default("").volatile()
54
54
  });
55
55
  /** Read one field that may be a plain value (tests, defaults) or a live ref (composed row). */
56
56
  function readSlot(slot) {
@@ -1,4 +1,4 @@
1
- import { f as UrlSchemesError, t as buildFsLayerResolver } from "../wrap-Bzdimp4p.js";
1
+ import { f as UrlSchemesError, t as buildFsLayerResolver } from "../wrap-0VA0uFx8.js";
2
2
  import { Context } from "@deepseek-ai/cordis";
3
3
  import { dirname, sep } from "node:path";
4
4
  import { stat } from "node:fs/promises";
@@ -18,19 +18,19 @@ function isMissing(error) {
18
18
  const code = error.code;
19
19
  return MISSING_CODES.has(code);
20
20
  }
21
- function comparablePath(path, caseSensitive) {
22
- return caseSensitive ? path : path.toLowerCase();
21
+ function comparablePath(path$1, caseSensitive) {
22
+ return caseSensitive ? path$1 : path$1.toLowerCase();
23
23
  }
24
- function isLexicallyUnder(path, root, caseSensitive) {
25
- const comparableTarget = comparablePath(path, caseSensitive);
24
+ function isLexicallyUnder(path$1, root, caseSensitive) {
25
+ const comparableTarget = comparablePath(path$1, caseSensitive);
26
26
  const comparableRoot = comparablePath(root, caseSensitive);
27
27
  if (comparableTarget === comparableRoot) return true;
28
28
  const prefix = comparableRoot.endsWith(sep) ? comparableRoot : comparableRoot + sep;
29
29
  return comparableTarget.startsWith(prefix);
30
30
  }
31
- async function statIfPresent(path) {
31
+ async function statIfPresent(path$1) {
32
32
  try {
33
- return await stat(path, { bigint: true });
33
+ return await stat(path$1, { bigint: true });
34
34
  } catch (error) {
35
35
  /* v8 ignore else -- a non-missing stat failure requires a host permission or I/O fault after resolve reached this ancestor. */
36
36
  if (isMissing(error)) return void 0;
@@ -53,11 +53,11 @@ function sameIdentity(left, right) {
53
53
  * to the host filesystem convention used by supported platforms.
54
54
  * @returns whether the target is the root or a descendant of it.
55
55
  */
56
- async function isPathUnder(path, root, caseSensitive = process.platform !== "win32") {
57
- if (isLexicallyUnder(path, root, caseSensitive)) return true;
56
+ async function isPathUnder(path$1, root, caseSensitive = process.platform !== "win32") {
57
+ if (isLexicallyUnder(path$1, root, caseSensitive)) return true;
58
58
  const rootInfo = await statIfPresent(root);
59
59
  if (!rootInfo) return false;
60
- let ancestor = path;
60
+ let ancestor = path$1;
61
61
  while (true) {
62
62
  const ancestorInfo = await statIfPresent(ancestor);
63
63
  if (ancestorInfo && sameIdentity(ancestorInfo, rootInfo)) return true;
@@ -170,12 +170,12 @@ var SandboxedFileSystem = class extends LocalFileSystem {
170
170
  //#endregion
171
171
  //#region src/fs-aware/sandbox-plugin.ts
172
172
  /** Scheme prefix test — mirrors the resolver's own grammar. */
173
- function isSchemePath(path) {
174
- return /^[a-z][a-z0-9]*:\/\//.test(path);
173
+ function isSchemePath(path$1) {
174
+ return /^[a-z][a-z0-9]*:\/\//.test(path$1);
175
175
  }
176
176
  /** Session-layer schemes are excluded from FS-layer resolution (design D2). */
177
- function isSessionLayerScheme(path) {
178
- return path.startsWith("ctx://") || path.startsWith("agent://") || path.startsWith("skill://");
177
+ function isSessionLayerScheme(path$1) {
178
+ return path$1.startsWith("ctx://") || path$1.startsWith("agent://") || path$1.startsWith("skill://");
179
179
  }
180
180
  function sessionLayerError(url) {
181
181
  if (url.startsWith("skill://")) return new UrlSchemesError("CTX_SESSION_LAYER", `${url}: session-layer scheme — skill discovery (which roots load, scan depth, layered scope merge) is the host skill provider's business logic and resolves only against a calling agent, which the filesystem layer does not have. Load skills with the native \`skill\` tool; grep/glob with path=skill://… keep working through the tool layer`);
@@ -213,13 +213,13 @@ var FsAwareSandboxFileSystem = class extends Base {
213
213
  rawUrl: url
214
214
  };
215
215
  }
216
- async resolve(path, opts) {
217
- if (!this.schemeResolution || !isSchemePath(path)) return super.resolve(path, opts);
218
- if (isSessionLayerScheme(path)) throw sessionLayerError(path);
219
- await this.resolver.resolve(this.envFor(path), path);
216
+ async resolve(path$1, opts) {
217
+ if (!this.schemeResolution || !isSchemePath(path$1)) return super.resolve(path$1, opts);
218
+ if (isSessionLayerScheme(path$1)) throw sessionLayerError(path$1);
219
+ await this.resolver.resolve(this.envFor(path$1), path$1);
220
220
  return {
221
- targetKey: path,
222
- displayPath: path
221
+ targetKey: path$1,
222
+ displayPath: path$1
223
223
  };
224
224
  }
225
225
  async stat(target, signal) {
@@ -0,0 +1,208 @@
1
+ import { Binary, Dict, Volatile } from "@deepseek-ai/cosmokit";
2
+ import { StandardSchemaV1 } from "@standard-schema/spec";
3
+
4
+ //#region third_party/schemastery/lib/types/index.d.ts
5
+ declare const kSchema: unique symbol;
6
+ declare global {
7
+ namespace Schemastery {
8
+ /** Convert primitive constructors, constants, and existing schemas into a schema type. */
9
+ type From<X> = X extends string | number | boolean ? Schema<X> : X extends Schema<any, any, SchemaMode> ? X : X extends typeof String ? Schema<string> : X extends typeof Number ? Schema<number> : X extends typeof Boolean ? Schema<boolean> : X extends typeof Function ? Schema<Function, (...args: any[]) => any> : X extends Constructor<infer S> ? Schema<S> : never;
10
+ type TypeS1<X> = X extends Schema<infer S, infer _T, infer _M> ? S : never;
11
+ type Inverse<X> = X extends Schema<infer _S, infer T, infer M> ? (arg: SchemaOutput<T, M>) => void : never;
12
+ /** Input type accepted by a schema-like value. */
13
+ type TypeS<X> = TypeS1<From<X>>;
14
+ /** Output type returned by a schema-like value after validation. */
15
+ type TypeT<X> = ReturnType<From<X>>;
16
+ /** Resolver callback used by custom schema types registered with `Schema.extend()`. */
17
+ type Resolve = (data: any, schema: Schema, options: Options, strict?: boolean) => [any, any?];
18
+ /** Input type accepted by one schema in an intersection. */
19
+ type IntersectS<X> = From<X> extends Schema<infer S, infer _T, infer _M> ? S : never;
20
+ /** Output type returned by one schema in an intersection. */
21
+ type IntersectT<X> = Inverse<From<X>> extends ((arg: infer T) => void) ? T : never;
22
+ type TupleS<X extends readonly any[]> = X extends readonly [infer L, ...infer R] ? [TypeS<L>?, ...TupleS<R>] : any[];
23
+ type TupleT<X extends readonly any[]> = X extends readonly [infer L, ...infer R] ? [TypeT<L>?, ...TupleT<R>] : any[];
24
+ type ObjectS<X extends Dict> = { [K in keyof X]?: TypeS<X[K]> | null } & Dict;
25
+ type ObjectT<X extends Dict> = { [K in keyof X]: TypeT<X[K]> } & Dict;
26
+ type Constructor<T = any> = new (...args: any[]) => T;
27
+ /** Static constructor and factory methods exposed by the default `Schema` export. */
28
+ interface Static {
29
+ <T = any>(options: Partial<Schema<T>>): Schema<T>;
30
+ new <T = any>(options: Partial<Schema<T>>): Schema<T>;
31
+ prototype: Schema;
32
+ /** Validate a value against a schema node and return `[output, adaptedInput?]`. */
33
+ resolve: Resolve;
34
+ /** Infer a schema from a primitive value, constructor, or existing schema. */
35
+ from<X = any>(source?: X): From<X>;
36
+ /** Register a resolver for a custom schema `type`. */
37
+ extend(type: string, resolve: Resolve): void;
38
+ /** Accept any value without validation. */
39
+ any<T = any>(): Schema<T>;
40
+ /** Accept only nullable input. */
41
+ never(): Schema<never>;
42
+ /** Accept exactly one constant value. */
43
+ const<const T>(value: T): Schema<T>;
44
+ /** Accept strings, with optional metadata constraints added by instance methods. */
45
+ string(): Schema<string>;
46
+ /** Accept numbers, with optional range and step constraints. */
47
+ number(): Schema<number>;
48
+ /** Accept non-negative integer numbers. */
49
+ natural(): Schema<number>;
50
+ /** Accept a number between 0 and 1 and mark it as a slider. */
51
+ percent(): Schema<number>;
52
+ /** Accept booleans. */
53
+ boolean(): Schema<boolean>;
54
+ /** Accept `Date` instances or parse datetime strings into `Date` objects. */
55
+ date(): Schema<string | Date, Date>;
56
+ /** Accept `RegExp` instances or parse strings into regular expressions. */
57
+ regExp(flag?: string): Schema<string | RegExp, RegExp>;
58
+ /** Accept binary sources and normalize them to `ArrayBufferLike`. */
59
+ arrayBuffer(): Schema<Binary.Source, ArrayBufferLike>;
60
+ arrayBuffer(encoding: 'hex' | 'base64'): Schema<Binary.Source | string, ArrayBufferLike>;
61
+ /** Accept a numeric bitset or string keys and normalize to a number. */
62
+ bitset<K extends string>(bits: Partial<Record<K, number>>): Schema<number | readonly K[], number>;
63
+ /** Accept functions. */
64
+ function(): Schema<Function, (...args: any[]) => any>;
65
+ /** Accept instances of a constructor or objects whose constructor name matches. */
66
+ is(constructor: string): Schema;
67
+ is<T>(constructor: Constructor<T>): Schema<T>;
68
+ /** Accept arrays whose elements match `inner`. */
69
+ array<X>(inner: X): Schema<TypeS<X>[], TypeT<X>[]>;
70
+ /** Accept plain objects with values matching `inner` and optional key schema. */
71
+ dict<X, Y extends Schema<any, string> = Schema<string>>(inner: X, sKey?: Y): Schema<Dict<TypeS<X>, TypeS<Y>>, Dict<TypeT<X>, TypeT<Y>>>;
72
+ /** Accept tuple arrays where each index matches the corresponding schema. */
73
+ tuple<const X extends readonly any[]>(list: X): Schema<TupleS<X>, TupleT<X>>;
74
+ /** Accept plain objects; infer fields from the dictionary, not the enclosing schema's output type. */
75
+ object<X extends Dict>(dict: X): Schema<ObjectS<NoInfer<X>>, ObjectT<NoInfer<X>>>;
76
+ /** Accept values matching at least one schema in `list`. */
77
+ union<const X>(list: readonly X[]): Schema<TypeS<X>, TypeT<X>>;
78
+ /** Accept values matching every schema in `list`, merging object outputs. */
79
+ intersect<const X>(list: readonly X[]): Schema<IntersectS<X>, IntersectT<X>>;
80
+ /** Validate with `inner`, then convert the result with `callback`. */
81
+ transform<X, T>(inner: X, callback: (value: TypeS<X>, options: Schemastery.Options) => T, preserve?: boolean): Schema<TypeS<X>, T>;
82
+ /** Defer construction of a recursive schema until validation or serialization. */
83
+ lazy<X extends Schema<any, any, SchemaMode>>(callback: () => X): X;
84
+ ValidationError: typeof ValidationError;
85
+ }
86
+ /** Runtime validation options shared by all schema calls. */
87
+ interface Options {
88
+ /** Remove invalid object properties instead of throwing when possible. */
89
+ autofix?: boolean;
90
+ /** Skip validation for selected values and schema nodes. */
91
+ ignore?(data: any, schema: Schema): boolean;
92
+ /** Path used to format nested validation errors. */
93
+ path?: (keyof any)[];
94
+ }
95
+ /** UI and validation metadata attached by schema builder methods. */
96
+ interface Meta<T = any> {
97
+ default?: T extends {} ? Partial<T> : T;
98
+ required?: boolean;
99
+ /** Parse this node as a stable config reference; its type and UI metadata remain unchanged. */
100
+ volatile?: boolean;
101
+ disabled?: boolean;
102
+ collapse?: boolean;
103
+ badges?: {
104
+ text: string;
105
+ type: string;
106
+ }[];
107
+ hidden?: boolean;
108
+ loose?: boolean;
109
+ role?: string;
110
+ extra?: any;
111
+ link?: string;
112
+ description?: string | Dict<string>;
113
+ comment?: string;
114
+ pattern?: {
115
+ source: string;
116
+ flags?: string;
117
+ };
118
+ max?: number;
119
+ min?: number;
120
+ step?: number;
121
+ }
122
+ }
123
+ /** Callable schema instance that validates input and returns normalized output. */
124
+ interface Schemastery<S = any, T = S, Mode extends SchemaMode = 'plain'> {
125
+ (data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>;
126
+ new (data?: S | null, options?: Schemastery.Options): SchemaOutput<T, Mode>;
127
+ [kSchema]: true;
128
+ uid: number;
129
+ meta: Schemastery.Meta<T>;
130
+ type: string;
131
+ sKey?: Schema;
132
+ inner?: Schema;
133
+ list?: Schema[];
134
+ dict?: Dict<Schema>;
135
+ bits?: Dict<number>;
136
+ callback?: Function;
137
+ constructor?: string | Function;
138
+ builder?: Function;
139
+ value?: T;
140
+ refs?: Dict<Schema>;
141
+ preserve?: boolean;
142
+ '~standard': StandardSchemaV1.Props;
143
+ /** Format this schema as a compact TypeScript-like type string. */
144
+ toString(inline?: boolean): string;
145
+ /** Serialize this schema, preserving shared and recursive references. */
146
+ toJSON(): Schema<S, T, Mode>;
147
+ /** Mark nullable input as invalid unless a default supplies a fallback. */
148
+ required<R extends boolean = true>(value?: R): Schema<S, T, SetRequired<Mode, R>>;
149
+ /**
150
+ * Parse this config field as a stable reference containing immutable data.
151
+ * @returns a schema whose output supports get(), including when the field is absent.
152
+ */
153
+ volatile(): Schema<NoInfer<S>, NoInfer<T>, Mode extends 'defined' | 'volatile-defined' ? 'volatile-defined' : 'volatile'>;
154
+ /** Hide this schema node from UI renderers. */
155
+ hidden(value?: boolean): Schema<S, T, Mode>;
156
+ /** Return the default value instead of throwing when validation fails. */
157
+ loose(value?: boolean): Schema<S, T, Mode>;
158
+ /** Attach a renderer role and optional role-specific metadata. */
159
+ role(text: string, extra?: any): Schema<S, T, Mode>;
160
+ /** Attach an external documentation link. */
161
+ link(link: string): Schema<S, T, Mode>;
162
+ /** Set the fallback value used for nullable input. */
163
+ default(value: T | NoInfer<Partial<S>>): Schema<S, T, SetRequired<Mode, true>>;
164
+ /** Attach an auxiliary comment for documentation or form UIs. */
165
+ comment(text: string): Schema<S, T, Mode>;
166
+ /** Attach a localized or plain description for documentation or form UIs. */
167
+ description(text: string): Schema<S, T, Mode>;
168
+ /** Mark this schema node as disabled for form UIs. */
169
+ disabled(value?: boolean): Schema<S, T, Mode>;
170
+ /** Request collapsed rendering for nested form UIs. */
171
+ collapse(value?: boolean): Schema<S, T, Mode>;
172
+ /** Add a deprecated badge to this schema node. */
173
+ deprecated(): Schema<S, T, Mode>;
174
+ /** Add an experimental badge to this schema node. */
175
+ experimental(): Schema<S, T, Mode>;
176
+ /** Require strings to match a regular expression. */
177
+ pattern(regexp: RegExp): Schema<S, T, Mode>;
178
+ /** Set an inclusive maximum for numbers or collection lengths. */
179
+ max(value: number): Schema<S, T, Mode>;
180
+ /** Set an inclusive minimum for numbers or collection lengths. */
181
+ min(value: number): Schema<S, T, Mode>;
182
+ /** Set the numeric increment constraint. */
183
+ step(value: number): Schema<S, T, Mode>;
184
+ /** Add or replace an object property schema. */
185
+ set(key: string, value: Schema): Schema<S, T, Mode>;
186
+ /** Append a tuple, union, or intersection member schema. */
187
+ push(value: Schema): Schema<S, T, Mode>;
188
+ /** Remove values equal to schema defaults from normalized output. */
189
+ simplify(value?: any): any;
190
+ /** Return a schema clone with descriptions merged from locale messages. */
191
+ i18n(messages: Dict): Schema<S, T, Mode>;
192
+ /** Attach arbitrary metadata consumed by form renderers and downstream tools. */
193
+ extra<K extends keyof Schemastery.Meta>(key: K, value: Schemastery.Meta[K]): Schema<S, T, Mode>;
194
+ }
195
+ }
196
+ declare class ValidationError extends TypeError {
197
+ options: Schemastery.Options;
198
+ name: string;
199
+ constructor(message: string, options: Schemastery.Options);
200
+ static is(error: any): error is ValidationError;
201
+ }
202
+ type SchemaMode = 'plain' | 'defined' | 'volatile' | 'volatile-defined';
203
+ type SchemaOutput<T, M$1 extends SchemaMode> = M$1 extends 'volatile' ? Volatile<T | undefined> : M$1 extends 'volatile-defined' ? Volatile<T> : T;
204
+ type SetRequired<M$1 extends SchemaMode, R extends boolean> = M$1 extends 'volatile' | 'volatile-defined' ? R extends true ? 'volatile-defined' : 'volatile' : R extends true ? 'defined' : 'plain';
205
+ type Schema<S = any, T = S, Mode extends SchemaMode = 'plain'> = Schemastery<S, T, Mode>;
206
+ declare const Schema: Schemastery.Static;
207
+ //#endregion
208
+ export { Schema as t };