@valbuild/shared 0.121.0 → 0.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,62 @@
1
+ import type { Json, SerializedSchema } from "@valbuild/core";
2
+ /**
3
+ * Can this value, taken from one schema, be written into another?
4
+ *
5
+ * The question restore asks, and it is NOT the question validation asks.
6
+ * Validation checks a value against the schema it belongs to. This compares two
7
+ * schemas — the one a value was stored under and the one it is being written
8
+ * into — because a restore moves a value across a schema change, and possibly
9
+ * across paths.
10
+ *
11
+ * Three answers, not two. `unknown` is where the comparison genuinely cannot
12
+ * decide, and it exists so that an editor is told "we are not sure" rather than
13
+ * being given a confident answer we made up. Treating unknown as compatible
14
+ * writes values that break; treating it as incompatible blocks restores that
15
+ * would have been fine.
16
+ */
17
+ export type Compatibility = {
18
+ status: "compatible";
19
+ } | {
20
+ status: "incompatible";
21
+ reason: IncompatibleReason;
22
+ } | {
23
+ status: "unknown";
24
+ message: string;
25
+ };
26
+ export type IncompatibleReason = {
27
+ kind: "type-changed";
28
+ from: string;
29
+ to: string;
30
+ } | {
31
+ kind: "no-matching-variant";
32
+ variants: string[];
33
+ } | {
34
+ kind: "unknown-field";
35
+ keys: string[];
36
+ } | {
37
+ kind: "missing-required";
38
+ keys: string[];
39
+ } | {
40
+ kind: "not-optional";
41
+ } | {
42
+ kind: "literal-changed";
43
+ from: string;
44
+ to: string;
45
+ } | {
46
+ kind: "different-module";
47
+ from: string;
48
+ to: string;
49
+ };
50
+ /**
51
+ * A sentence an editor can act on, for the popup that explains a refusal.
52
+ *
53
+ * Kept beside the reasons rather than in the UI so that adding a reason without
54
+ * wording for it is a type error rather than a blank dialog.
55
+ */
56
+ export declare function explainIncompatible(reason: IncompatibleReason): string;
57
+ export declare function checkCompatibility(from: {
58
+ schema: SerializedSchema;
59
+ value: Json;
60
+ }, to: {
61
+ schema: SerializedSchema;
62
+ }): Compatibility;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Extract a human-readable filename from a file ref (local path or remote URL).
3
+ * Handles both remote refs (via splitRemoteRef) and plain `/public/...` paths.
4
+ */
5
+ export declare function getFilenameFromRef(ref: string): string;
6
+ /**
7
+ * Parse a file ref into its constituent parts: a clean path, filename, and
8
+ * folder (the path relative to `/public`).
9
+ *
10
+ * The `folder` strips the standard `/public` prefix so it shows a
11
+ * concise location like `/images` instead of `/public/images`.
12
+ */
13
+ export declare function getRefParts(ref: string): {
14
+ cleanPath: string;
15
+ filename: string;
16
+ folder: string;
17
+ };
@@ -0,0 +1,76 @@
1
+ import { Json, ModuleFilePath, SerializedSchema, SourcePath } from "@valbuild/core";
2
+ import { Index } from "flexsearch";
3
+ /**
4
+ * The search index and the labels to render for its hits.
5
+ *
6
+ * Kept as a plain module rather than living inside a worker so it can be tested:
7
+ * a worker entry runs `self.onmessage` on import, which no test environment here
8
+ * provides.
9
+ *
10
+ * In `@valbuild/shared` rather than the Studio because there are now two
11
+ * realms searching the same content: the Studio's `SearchStore`, which keeps an
12
+ * index alive in a worker and re-indexes a module at a time, and the MCP
13
+ * `search_content` tool, which builds one per call and throws it away. What
14
+ * counts as a document, and what a hit is labelled, must not differ between
15
+ * them — an agent and an editor searching the same project should find the same
16
+ * things.
17
+ */
18
+ export type SearchIndex = {
19
+ index: Index;
20
+ pathToLabel: Map<string, string>;
21
+ /**
22
+ * Which document ids belong to which module, so one module can be re-indexed
23
+ * without touching the others.
24
+ *
25
+ * The ids are the `SourcePath`s themselves — `index.add(path, …)` below — so
26
+ * this could be recovered by scanning `pathToLabel` for a module-file-path
27
+ * prefix. It is kept explicitly anyway: the scan would be O(every document in
28
+ * the project) per module re-indexed, which is the whole-project cost that
29
+ * re-indexing one module exists to avoid.
30
+ */
31
+ docsByModule: Map<ModuleFilePath, Set<string>>;
32
+ };
33
+ /** An index with nothing in it. Fill it with {@link indexModule}. */
34
+ export declare function createSearchIndex(): SearchIndex;
35
+ /**
36
+ * Index one module, replacing whatever was previously indexed for it.
37
+ *
38
+ * Remove-then-add rather than `update`, because the set of paths in a module is
39
+ * not stable: deleting an array item or a record entry means documents that must
40
+ * disappear, and `update` only revises ids it is given.
41
+ *
42
+ * `.jsonValues()` entries are indexed only once their content is loaded — an
43
+ * un-loaded entry is an opaque marker that {@link traverseSchemaSource} skips, so
44
+ * the index is naturally PARTIAL and grows as batches land. That is why the search
45
+ * UI loads the entries on the first query and re-indexes (debounced) as they
46
+ * arrive, rather than pretending an empty result set is an answer.
47
+ */
48
+ export declare function indexModule(searchIndex: SearchIndex, moduleFilePath: ModuleFilePath, source: Json, schema: SerializedSchema): void;
49
+ /**
50
+ * Drop everything indexed for one module.
51
+ *
52
+ * Also used for a module that has gone away entirely — otherwise its documents
53
+ * stay searchable and a hit navigates to a path that no longer exists.
54
+ */
55
+ export declare function removeModule(searchIndex: SearchIndex, moduleFilePath: ModuleFilePath): void;
56
+ /**
57
+ * Index every module, from scratch.
58
+ *
59
+ * Now a loop over {@link indexModule} rather than its own walk, so the full
60
+ * build and the incremental one cannot drift in what they consider a document.
61
+ */
62
+ export declare function buildSearchIndex(modules: Record<ModuleFilePath, {
63
+ source: Json;
64
+ schema: SerializedSchema;
65
+ }>): SearchIndex;
66
+ export type SearchResults = {
67
+ results: Array<{
68
+ path: SourcePath;
69
+ label: string;
70
+ }>;
71
+ /** Matches for the query, not just on this page. */
72
+ total: number;
73
+ /** `total` hit {@link MAX_COUNTED_RESULTS}, so it means "at least this many". */
74
+ totalIsLowerBound: boolean;
75
+ };
76
+ export declare function performSearch(searchIndex: SearchIndex | null, query: string, limit?: number, offset?: number): SearchResults;
@@ -0,0 +1,30 @@
1
+ import { ModuleFilePath, ModulePath, SourcePath } from "@valbuild/core";
2
+ /**
3
+ * The one way to build a child's source path.
4
+ *
5
+ * There were five hand-rolled versions of this, three of them subtly different
6
+ * and two of them wrong, and the wrong ones were wrong in a way that hid: a
7
+ * module path segment has to be JSON-quoted if it is a string and bare if it is
8
+ * an array index, and both broken copies appended the raw key at the module
9
+ * root. An unquoted key parses fine as long as it contains no `.` — so every
10
+ * object field and every ordinary record key still resolved, and only a key with
11
+ * a dot in it broke. That is exactly what a media gallery is keyed by, so
12
+ * clicking a file in the Media panel navigated to
13
+ * `?p=/public/val/red-8x8_bfbd0.png`, which `splitModulePath` reads as the two
14
+ * segments `/public/val/red-8x8_bfbd0` and `png`, and the studio said the module
15
+ * was not found.
16
+ *
17
+ * So: one function, and never a template string. `Internal.createValPathOfItem`
18
+ * is the rule itself — `JSON.stringify` quotes a string and leaves a number
19
+ * bare, which is precisely the module-path grammar — and everything here defers
20
+ * to it rather than restating it.
21
+ */
22
+ export declare function sourcePathOfChild(parent: SourcePath | ModuleFilePath, key: string | number): SourcePath;
23
+ /**
24
+ * The same thing, for callers holding the module file path and module path apart.
25
+ *
26
+ * `ModulePath` is empty at the module root, which is the case both broken copies
27
+ * got wrong: there is no separator in the path yet, so the key is the first
28
+ * segment and still has to be quoted.
29
+ */
30
+ export declare function concatModulePath(moduleFilePath: ModuleFilePath, modulePath: ModulePath, key: string | number): SourcePath;
@@ -0,0 +1,20 @@
1
+ import { Source, SerializedSchema, SourcePath } from "@valbuild/core";
2
+ /**
3
+ * Traverses a schema and source pair, calling a callback for each leaf node.
4
+ * Handles all schema types including primitives, objects, arrays, records, unions, richtext, files, images, etc.
5
+ *
6
+ * @param source - The JSON source data
7
+ * @param schema - The serialized schema
8
+ * @param path - The current source path
9
+ * @param callback - Function called for each traversable node with { source, schema, path }
10
+ */
11
+ export declare function traverseSchemaSource(source: Source, schema: SerializedSchema, path: SourcePath, callback: (opts: {
12
+ source: Source;
13
+ schema: SerializedSchema;
14
+ path: SourcePath;
15
+ }) => void): void;
16
+ /**
17
+ * Flattens richtext source to a plain string, extracting only text content.
18
+ * Used for indexing richtext content in search.
19
+ */
20
+ export declare function flattenRichText(source: Source): string;
@@ -0,0 +1,257 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The wire shapes for reading history.
4
+ *
5
+ * Here rather than in `@valbuild/server` because both sides of `/api/val` need
6
+ * them: the server builds these and the Studio parses them, and a second
7
+ * hand-written copy in the client is how the two drift.
8
+ *
9
+ * `HistoryError` is a closed union of everything that can go wrong
10
+ * reconstructing a commit - see `packages/server/src/history/HistoryError.ts`
11
+ * for what each one means. It travels as data rather than as a message because
12
+ * the Studio decides what to OFFER from it: a schema mismatch means "cannot
13
+ * restore this field", a missing source means "cannot restore this module at
14
+ * all", and a rendered string cannot be told apart.
15
+ */
16
+ export declare const HistoryError: z.ZodDiscriminatedUnion<[z.ZodObject<{
17
+ kind: z.ZodLiteral<"commit-not-found">;
18
+ commitSha: z.ZodString;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ kind: z.ZodLiteral<"archive-unreadable">;
21
+ commitSha: z.ZodString;
22
+ message: z.ZodString;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ kind: z.ZodLiteral<"source-unavailable">;
25
+ moduleFilePath: z.ZodString;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ kind: z.ZodLiteral<"schema-unreadable">;
28
+ moduleFilePath: z.ZodString;
29
+ message: z.ZodString;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"file-unavailable">;
32
+ gitPath: z.ZodString;
33
+ message: z.ZodString;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ kind: z.ZodLiteral<"not-supported-in-fs-mode">;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ kind: z.ZodLiteral<"transport">;
38
+ message: z.ZodString;
39
+ }, z.core.$strip>], "kind">;
40
+ export type HistoryError = z.infer<typeof HistoryError>;
41
+ export declare const HistoricalCommit: z.ZodObject<{
42
+ commitSha: z.ZodString;
43
+ parentCommitSha: z.ZodString;
44
+ clientCommitSha: z.ZodString;
45
+ branch: z.ZodString;
46
+ createdBranch: z.ZodNullable<z.ZodString>;
47
+ creator: z.ZodNullable<z.ZodString>;
48
+ message: z.ZodNullable<z.ZodString>;
49
+ createdAt: z.ZodString;
50
+ seqNum: z.ZodString;
51
+ patchCount: z.ZodNumber;
52
+ hasArchive: z.ZodBoolean;
53
+ }, z.core.$strip>;
54
+ export type HistoricalCommit = z.infer<typeof HistoricalCommit>;
55
+ /**
56
+ * A binary file the commit touched - named, with a URL, and nothing fetched.
57
+ * Only an `<img src>` that mounts pays for the bytes.
58
+ */
59
+ export declare const BinaryFileRef: z.ZodObject<{
60
+ gitPath: z.ZodString;
61
+ change: z.ZodUnion<readonly [z.ZodLiteral<"added">, z.ZodLiteral<"modified">, z.ZodLiteral<"deleted">]>;
62
+ remote: z.ZodBoolean;
63
+ url: z.ZodString;
64
+ }, z.core.$strip>;
65
+ export type BinaryFileRef = z.infer<typeof BinaryFileRef>;
66
+ export declare const HistoricalModule: z.ZodObject<{
67
+ source: z.ZodNullable<z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>>;
68
+ schema: z.ZodNullable<z.ZodType<import("@valbuild/core").SerializedSchema, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").SerializedSchema, unknown>>>;
69
+ patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
70
+ changedPaths: z.ZodArray<z.ZodString>;
71
+ failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
72
+ kind: z.ZodLiteral<"commit-not-found">;
73
+ commitSha: z.ZodString;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ kind: z.ZodLiteral<"archive-unreadable">;
76
+ commitSha: z.ZodString;
77
+ message: z.ZodString;
78
+ }, z.core.$strip>, z.ZodObject<{
79
+ kind: z.ZodLiteral<"source-unavailable">;
80
+ moduleFilePath: z.ZodString;
81
+ }, z.core.$strip>, z.ZodObject<{
82
+ kind: z.ZodLiteral<"schema-unreadable">;
83
+ moduleFilePath: z.ZodString;
84
+ message: z.ZodString;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"file-unavailable">;
87
+ gitPath: z.ZodString;
88
+ message: z.ZodString;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ kind: z.ZodLiteral<"not-supported-in-fs-mode">;
91
+ }, z.core.$strip>, z.ZodObject<{
92
+ kind: z.ZodLiteral<"transport">;
93
+ message: z.ZodString;
94
+ }, z.core.$strip>], "kind">>;
95
+ }, z.core.$strip>;
96
+ export type HistoricalModule = z.infer<typeof HistoricalModule>;
97
+ export declare const HistoricalPatchSet: z.ZodObject<{
98
+ commit: z.ZodObject<{
99
+ commitSha: z.ZodString;
100
+ parentCommitSha: z.ZodString;
101
+ clientCommitSha: z.ZodString;
102
+ branch: z.ZodString;
103
+ createdBranch: z.ZodNullable<z.ZodString>;
104
+ creator: z.ZodNullable<z.ZodString>;
105
+ message: z.ZodNullable<z.ZodString>;
106
+ createdAt: z.ZodString;
107
+ seqNum: z.ZodString;
108
+ patchCount: z.ZodNumber;
109
+ hasArchive: z.ZodBoolean;
110
+ }, z.core.$strip>;
111
+ modules: z.ZodRecord<z.ZodString, z.ZodObject<{
112
+ source: z.ZodNullable<z.ZodType<import("@valbuild/core/patch").JSONValue, unknown, z.core.$ZodTypeInternals<import("@valbuild/core/patch").JSONValue, unknown>>>;
113
+ schema: z.ZodNullable<z.ZodType<import("@valbuild/core").SerializedSchema, unknown, z.core.$ZodTypeInternals<import("@valbuild/core").SerializedSchema, unknown>>>;
114
+ patchIds: z.ZodArray<z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>>;
115
+ changedPaths: z.ZodArray<z.ZodString>;
116
+ failures: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
117
+ kind: z.ZodLiteral<"commit-not-found">;
118
+ commitSha: z.ZodString;
119
+ }, z.core.$strip>, z.ZodObject<{
120
+ kind: z.ZodLiteral<"archive-unreadable">;
121
+ commitSha: z.ZodString;
122
+ message: z.ZodString;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ kind: z.ZodLiteral<"source-unavailable">;
125
+ moduleFilePath: z.ZodString;
126
+ }, z.core.$strip>, z.ZodObject<{
127
+ kind: z.ZodLiteral<"schema-unreadable">;
128
+ moduleFilePath: z.ZodString;
129
+ message: z.ZodString;
130
+ }, z.core.$strip>, z.ZodObject<{
131
+ kind: z.ZodLiteral<"file-unavailable">;
132
+ gitPath: z.ZodString;
133
+ message: z.ZodString;
134
+ }, z.core.$strip>, z.ZodObject<{
135
+ kind: z.ZodLiteral<"not-supported-in-fs-mode">;
136
+ }, z.core.$strip>, z.ZodObject<{
137
+ kind: z.ZodLiteral<"transport">;
138
+ message: z.ZodString;
139
+ }, z.core.$strip>], "kind">>;
140
+ }, z.core.$strip>>;
141
+ patches: z.ZodArray<z.ZodObject<{
142
+ patchId: z.ZodString & z.ZodType<import("@valbuild/core").PatchId, string, z.core.$ZodTypeInternals<import("@valbuild/core").PatchId, string>>;
143
+ moduleFilePath: z.ZodString;
144
+ patch: z.ZodUnknown;
145
+ authorId: z.ZodNullable<z.ZodString>;
146
+ createdAt: z.ZodString;
147
+ baseSha: z.ZodString;
148
+ coreVersion: z.ZodString;
149
+ }, z.core.$strip>>;
150
+ jsonEntries: z.ZodRecord<z.ZodString, z.ZodUnknown>;
151
+ binaryFiles: z.ZodArray<z.ZodObject<{
152
+ gitPath: z.ZodString;
153
+ change: z.ZodUnion<readonly [z.ZodLiteral<"added">, z.ZodLiteral<"modified">, z.ZodLiteral<"deleted">]>;
154
+ remote: z.ZodBoolean;
155
+ url: z.ZodString;
156
+ }, z.core.$strip>>;
157
+ warnings: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
158
+ kind: z.ZodLiteral<"commit-not-found">;
159
+ commitSha: z.ZodString;
160
+ }, z.core.$strip>, z.ZodObject<{
161
+ kind: z.ZodLiteral<"archive-unreadable">;
162
+ commitSha: z.ZodString;
163
+ message: z.ZodString;
164
+ }, z.core.$strip>, z.ZodObject<{
165
+ kind: z.ZodLiteral<"source-unavailable">;
166
+ moduleFilePath: z.ZodString;
167
+ }, z.core.$strip>, z.ZodObject<{
168
+ kind: z.ZodLiteral<"schema-unreadable">;
169
+ moduleFilePath: z.ZodString;
170
+ message: z.ZodString;
171
+ }, z.core.$strip>, z.ZodObject<{
172
+ kind: z.ZodLiteral<"file-unavailable">;
173
+ gitPath: z.ZodString;
174
+ message: z.ZodString;
175
+ }, z.core.$strip>, z.ZodObject<{
176
+ kind: z.ZodLiteral<"not-supported-in-fs-mode">;
177
+ }, z.core.$strip>, z.ZodObject<{
178
+ kind: z.ZodLiteral<"transport">;
179
+ message: z.ZodString;
180
+ }, z.core.$strip>], "kind">>;
181
+ }, z.core.$strip>;
182
+ export type HistoricalPatchSet = z.infer<typeof HistoricalPatchSet>;
183
+ /**
184
+ * Whether the historical value can be written back as the project stands.
185
+ *
186
+ * Computed in the Studio, not on the server: the verdict depends on the current
187
+ * source and the current schema, both of which the client already holds, and it
188
+ * runs against the same worker-thread validator that validates ordinary edits.
189
+ * The types stay here because they are what a restore preview hands to the UI.
190
+ *
191
+ * `blocked` carries its reasons so a refusal can name the field and say why,
192
+ * rather than being an unexplained disabled button.
193
+ */
194
+ export declare const RestoreVerdict: z.ZodUnion<readonly [z.ZodObject<{
195
+ status: z.ZodLiteral<"restorable">;
196
+ }, z.core.$strip>, z.ZodObject<{
197
+ status: z.ZodLiteral<"blocked">;
198
+ reasons: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
199
+ kind: z.ZodLiteral<"commit-not-found">;
200
+ commitSha: z.ZodString;
201
+ }, z.core.$strip>, z.ZodObject<{
202
+ kind: z.ZodLiteral<"archive-unreadable">;
203
+ commitSha: z.ZodString;
204
+ message: z.ZodString;
205
+ }, z.core.$strip>, z.ZodObject<{
206
+ kind: z.ZodLiteral<"source-unavailable">;
207
+ moduleFilePath: z.ZodString;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ kind: z.ZodLiteral<"schema-unreadable">;
210
+ moduleFilePath: z.ZodString;
211
+ message: z.ZodString;
212
+ }, z.core.$strip>, z.ZodObject<{
213
+ kind: z.ZodLiteral<"file-unavailable">;
214
+ gitPath: z.ZodString;
215
+ message: z.ZodString;
216
+ }, z.core.$strip>, z.ZodObject<{
217
+ kind: z.ZodLiteral<"not-supported-in-fs-mode">;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ kind: z.ZodLiteral<"transport">;
220
+ message: z.ZodString;
221
+ }, z.core.$strip>], "kind">>;
222
+ }, z.core.$strip>]>;
223
+ export type RestoreVerdict = z.infer<typeof RestoreVerdict>;
224
+ export declare const ModuleComparison: z.ZodObject<{
225
+ current: z.ZodNullable<z.ZodUnknown>;
226
+ changedVsCurrent: z.ZodArray<z.ZodString>;
227
+ verdict: z.ZodUnion<readonly [z.ZodObject<{
228
+ status: z.ZodLiteral<"restorable">;
229
+ }, z.core.$strip>, z.ZodObject<{
230
+ status: z.ZodLiteral<"blocked">;
231
+ reasons: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
232
+ kind: z.ZodLiteral<"commit-not-found">;
233
+ commitSha: z.ZodString;
234
+ }, z.core.$strip>, z.ZodObject<{
235
+ kind: z.ZodLiteral<"archive-unreadable">;
236
+ commitSha: z.ZodString;
237
+ message: z.ZodString;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ kind: z.ZodLiteral<"source-unavailable">;
240
+ moduleFilePath: z.ZodString;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ kind: z.ZodLiteral<"schema-unreadable">;
243
+ moduleFilePath: z.ZodString;
244
+ message: z.ZodString;
245
+ }, z.core.$strip>, z.ZodObject<{
246
+ kind: z.ZodLiteral<"file-unavailable">;
247
+ gitPath: z.ZodString;
248
+ message: z.ZodString;
249
+ }, z.core.$strip>, z.ZodObject<{
250
+ kind: z.ZodLiteral<"not-supported-in-fs-mode">;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ kind: z.ZodLiteral<"transport">;
253
+ message: z.ZodString;
254
+ }, z.core.$strip>], "kind">>;
255
+ }, z.core.$strip>]>;
256
+ }, z.core.$strip>;
257
+ export type ModuleComparison = z.infer<typeof ModuleComparison>;
@@ -1,6 +1,13 @@
1
1
  import type { JSONValue as JSONValueT, PatchJSON as PatchJSONT, PatchBlock as PatchBlockT, ParentRef as ParentRefT } from "@valbuild/core/patch";
2
2
  import type { PatchId as PatchIdT } from "@valbuild/core";
3
3
  import { z } from "zod";
4
+ /**
5
+ * JSON, recursively — the shape of a Source over the wire.
6
+ *
7
+ * Exported because history reads stored Sources back and needs the same
8
+ * definition; a second copy is a second thing to keep in step.
9
+ */
10
+ export declare const JSONValue: z.ZodType<JSONValueT>;
4
11
  export declare const PatchJSON: z.ZodType<PatchJSONT>;
5
12
  export type PatchJSON = PatchJSONT;
6
13
  export declare const Patch: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { type SerializedSchema as SerializedSchemaT, type SerializedStringSchema as SerializedStringSchemaT, type SerializedLiteralSchema as SerializedLiteralSchemaT, type SerializedBooleanSchema as SerializedBooleanSchemaT, type SerializedNumberSchema as SerializedNumberSchemaT, type SerializedObjectSchema as SerializedObjectSchemaT, type SerializedArraySchema as SerializedArraySchemaT, type SerializedUnionSchema as SerializedUnionSchemaT, type SerializedRichTextSchema as SerializedRichTextSchemaT, type SerializedRichTextOptions as SerializedRichTextOptionsT, type SerializedRecordSchema as SerializedRecordSchemaT, type SerializedKeyOfSchema as SerializedKeyOfSchemaT, type SerializedRouteSchema as SerializedRouteSchemaT, type SerializedFileSchema as SerializedFileSchemaT, type SerializedDateSchema as SerializedDateSchemaT, type SerializedDateTimeSchema as SerializedDateTimeSchemaT, type SerializedColorSchema as SerializedColorSchemaT, type SerializedCodeSchema as SerializedCodeSchemaT, type SerializedImageSchema as SerializedImageSchemaT } from "@valbuild/core";
2
+ import { type SerializedSchema as SerializedSchemaT, type SerializedStringSchema as SerializedStringSchemaT, type SerializedLiteralSchema as SerializedLiteralSchemaT, type SerializedBooleanSchema as SerializedBooleanSchemaT, type SerializedNumberSchema as SerializedNumberSchemaT, type SerializedObjectSchema as SerializedObjectSchemaT, type SerializedArraySchema as SerializedArraySchemaT, type SerializedUnionSchema as SerializedUnionSchemaT, type SerializedRichTextSchema as SerializedRichTextSchemaT, type SerializedRichTextOptions as SerializedRichTextOptionsT, type SerializedRecordSchema as SerializedRecordSchemaT, type SerializedKeyOfSchema as SerializedKeyOfSchemaT, type SerializedRouteSchema as SerializedRouteSchemaT, type SerializedFileSchema as SerializedFileSchemaT, type SerializedDateSchema as SerializedDateSchemaT, type SerializedDateTimeSchema as SerializedDateTimeSchemaT, type SerializedColorSchema as SerializedColorSchemaT, type SerializedCodeSchema as SerializedCodeSchemaT, type SerializedImageSchema as SerializedImageSchemaT, type SerializedSettingsSchema as SerializedSettingsSchemaT } from "@valbuild/core";
3
3
  export declare const SerializedStringSchema: z.ZodType<SerializedStringSchemaT>;
4
4
  export declare const SerializedLiteralSchema: z.ZodType<SerializedLiteralSchemaT>;
5
5
  export declare const SerializedBooleanSchema: z.ZodType<SerializedBooleanSchemaT>;
@@ -73,4 +73,5 @@ export declare const CodeOptions: z.ZodObject<{
73
73
  }, z.core.$strip>;
74
74
  export declare const SerializedCodeSchema: z.ZodType<SerializedCodeSchemaT>;
75
75
  export declare const SerializedRouteSchema: z.ZodType<SerializedRouteSchemaT>;
76
+ export declare const SerializedSettingsSchema: z.ZodType<SerializedSettingsSchemaT>;
76
77
  export declare const SerializedSchema: z.ZodType<SerializedSchemaT>;