@typecaast/schema 0.1.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,832 @@
1
+ import { z } from 'zod';
2
+
3
+ /** A pixel dimension pair (authoring reference; the exact frame for video). */
4
+ declare const sizeSchema: z.ZodObject<{
5
+ width: z.ZodNumber;
6
+ height: z.ZodNumber;
7
+ }, z.core.$strip>;
8
+ type Size = z.infer<typeof sizeSchema>;
9
+ /**
10
+ * How the rendered conversation fills its container.
11
+ * - `reflow`: container queries + ResizeObserver; bubbles re-wrap on small screens.
12
+ * - `scale`: CSS transform scale-to-fit, preserves exact layout.
13
+ * - `fixed`: clip to canvas.
14
+ */
15
+ declare const fitModeSchema: z.ZodEnum<{
16
+ reflow: "reflow";
17
+ scale: "scale";
18
+ fixed: "fixed";
19
+ }>;
20
+ type FitMode = z.infer<typeof fitModeSchema>;
21
+ /**
22
+ * Color theme. `auto` inherits the host page's `prefers-color-scheme` (live
23
+ * preview) and falls back to `light`; video export resolves `auto` to a
24
+ * concrete mode and defaults to `light` when unspecified.
25
+ */
26
+ declare const themeModeSchema: z.ZodEnum<{
27
+ light: "light";
28
+ dark: "dark";
29
+ auto: "auto";
30
+ }>;
31
+ type ThemeMode = z.infer<typeof themeModeSchema>;
32
+ /**
33
+ * Asset resolution strategy.
34
+ * - `inline`: embed images as data URLs (self-contained config; default).
35
+ * - `url`: reference hosted images (smaller config; user hosts their own).
36
+ */
37
+ declare const assetModeSchema: z.ZodEnum<{
38
+ inline: "inline";
39
+ url: "url";
40
+ }>;
41
+ type AssetMode = z.infer<typeof assetModeSchema>;
42
+ /** Reference to a skin plus its skin-specific options (validated by the skin). */
43
+ declare const skinRefSchema: z.ZodObject<{
44
+ id: z.ZodString;
45
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
46
+ }, z.core.$strip>;
47
+ type SkinRef = z.infer<typeof skinRefSchema>;
48
+ /** Top-level rendering/authoring metadata. */
49
+ declare const metaSchema: z.ZodObject<{
50
+ canvas: z.ZodObject<{
51
+ width: z.ZodNumber;
52
+ height: z.ZodNumber;
53
+ }, z.core.$strip>;
54
+ fps: z.ZodDefault<z.ZodNumber>;
55
+ fit: z.ZodDefault<z.ZodEnum<{
56
+ reflow: "reflow";
57
+ scale: "scale";
58
+ fixed: "fixed";
59
+ }>>;
60
+ theme: z.ZodDefault<z.ZodEnum<{
61
+ light: "light";
62
+ dark: "dark";
63
+ auto: "auto";
64
+ }>>;
65
+ skin: z.ZodObject<{
66
+ id: z.ZodString;
67
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
68
+ }, z.core.$strip>;
69
+ seed: z.ZodDefault<z.ZodNumber>;
70
+ background: z.ZodDefault<z.ZodString>;
71
+ assets: z.ZodDefault<z.ZodEnum<{
72
+ inline: "inline";
73
+ url: "url";
74
+ }>>;
75
+ }, z.core.$strip>;
76
+ /** `meta` as it appears after parsing (defaults applied). */
77
+ type Meta = z.infer<typeof metaSchema>;
78
+ /** `meta` as authored (fields with defaults are optional). */
79
+ type MetaInput = z.input<typeof metaSchema>;
80
+
81
+ /** Whether a participant is a human or an app/bot (changes how skins render it). */
82
+ declare const participantKindSchema: z.ZodEnum<{
83
+ person: "person";
84
+ app: "app";
85
+ }>;
86
+ type ParticipantKind = z.infer<typeof participantKindSchema>;
87
+ /** A speaker in the conversation. */
88
+ declare const participantSchema: z.ZodObject<{
89
+ id: z.ZodString;
90
+ name: z.ZodString;
91
+ avatar: z.ZodOptional<z.ZodString>;
92
+ color: z.ZodOptional<z.ZodString>;
93
+ isSelf: z.ZodOptional<z.ZodBoolean>;
94
+ kind: z.ZodDefault<z.ZodEnum<{
95
+ person: "person";
96
+ app: "app";
97
+ }>>;
98
+ }, z.core.$strip>;
99
+ type Participant = z.infer<typeof participantSchema>;
100
+ type ParticipantInput = z.input<typeof participantSchema>;
101
+ declare const participantsSchema: z.ZodArray<z.ZodObject<{
102
+ id: z.ZodString;
103
+ name: z.ZodString;
104
+ avatar: z.ZodOptional<z.ZodString>;
105
+ color: z.ZodOptional<z.ZodString>;
106
+ isSelf: z.ZodOptional<z.ZodBoolean>;
107
+ kind: z.ZodDefault<z.ZodEnum<{
108
+ person: "person";
109
+ app: "app";
110
+ }>>;
111
+ }, z.core.$strip>>;
112
+
113
+ /**
114
+ * Global auto-pacing defaults. Every value is overridable per step in the
115
+ * timeline; the engine computes delays/durations from these and bakes in
116
+ * seeded, deterministic jitter (`humanize`).
117
+ */
118
+ declare const pacingSchema: z.ZodObject<{
119
+ readingWpm: z.ZodDefault<z.ZodNumber>;
120
+ typingCps: z.ZodDefault<z.ZodNumber>;
121
+ reactionDelayMs: z.ZodDefault<z.ZodNumber>;
122
+ interMessageGapMs: z.ZodDefault<z.ZodNumber>;
123
+ humanize: z.ZodDefault<z.ZodNumber>;
124
+ startDelayMs: z.ZodDefault<z.ZodNumber>;
125
+ }, z.core.$strip>;
126
+ type Pacing = z.infer<typeof pacingSchema>;
127
+ type PacingInput = z.input<typeof pacingSchema>;
128
+
129
+ /**
130
+ * Inline marks inside a text node. `text` runs carry plain content; the others
131
+ * are the recognized marks (`code`, `link`, `mention`, `emoji`). The set is
132
+ * intentionally small in v1 — new marks can be added without a schema-version
133
+ * bump (unknown content node types are handled leniently; see the registry).
134
+ */
135
+ declare const inlineTextSchema: z.ZodObject<{
136
+ type: z.ZodLiteral<"text">;
137
+ value: z.ZodString;
138
+ }, z.core.$strip>;
139
+ declare const inlineCodeSchema: z.ZodObject<{
140
+ type: z.ZodLiteral<"code">;
141
+ value: z.ZodString;
142
+ }, z.core.$strip>;
143
+ declare const inlineLinkSchema: z.ZodObject<{
144
+ type: z.ZodLiteral<"link">;
145
+ href: z.ZodString;
146
+ label: z.ZodOptional<z.ZodString>;
147
+ }, z.core.$strip>;
148
+ declare const inlineMentionSchema: z.ZodObject<{
149
+ type: z.ZodLiteral<"mention">;
150
+ label: z.ZodString;
151
+ id: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>;
153
+ declare const inlineEmojiSchema: z.ZodObject<{
154
+ type: z.ZodLiteral<"emoji">;
155
+ value: z.ZodString;
156
+ shortcode: z.ZodOptional<z.ZodString>;
157
+ }, z.core.$strip>;
158
+ declare const inlineNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
159
+ type: z.ZodLiteral<"text">;
160
+ value: z.ZodString;
161
+ }, z.core.$strip>, z.ZodObject<{
162
+ type: z.ZodLiteral<"code">;
163
+ value: z.ZodString;
164
+ }, z.core.$strip>, z.ZodObject<{
165
+ type: z.ZodLiteral<"link">;
166
+ href: z.ZodString;
167
+ label: z.ZodOptional<z.ZodString>;
168
+ }, z.core.$strip>, z.ZodObject<{
169
+ type: z.ZodLiteral<"mention">;
170
+ label: z.ZodString;
171
+ id: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ type: z.ZodLiteral<"emoji">;
174
+ value: z.ZodString;
175
+ shortcode: z.ZodOptional<z.ZodString>;
176
+ }, z.core.$strip>], "type">;
177
+ type InlineNode = z.infer<typeof inlineNodeSchema>;
178
+ /** A block of inline content. */
179
+ declare const textNodeSchema: z.ZodObject<{
180
+ type: z.ZodLiteral<"text">;
181
+ spans: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
182
+ type: z.ZodLiteral<"text">;
183
+ value: z.ZodString;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ type: z.ZodLiteral<"code">;
186
+ value: z.ZodString;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ type: z.ZodLiteral<"link">;
189
+ href: z.ZodString;
190
+ label: z.ZodOptional<z.ZodString>;
191
+ }, z.core.$strip>, z.ZodObject<{
192
+ type: z.ZodLiteral<"mention">;
193
+ label: z.ZodString;
194
+ id: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strip>, z.ZodObject<{
196
+ type: z.ZodLiteral<"emoji">;
197
+ value: z.ZodString;
198
+ shortcode: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strip>], "type">>;
200
+ }, z.core.$strip>;
201
+ type TextNode = z.infer<typeof textNodeSchema>;
202
+ /** An in-message image (same hosting model as avatars, per `meta.assets`). */
203
+ declare const imageNodeSchema: z.ZodObject<{
204
+ type: z.ZodLiteral<"image">;
205
+ src: z.ZodString;
206
+ alt: z.ZodOptional<z.ZodString>;
207
+ width: z.ZodOptional<z.ZodNumber>;
208
+ height: z.ZodOptional<z.ZodNumber>;
209
+ }, z.core.$strip>;
210
+ type ImageNode = z.infer<typeof imageNodeSchema>;
211
+ /**
212
+ * A content node whose `type` the runtime doesn't recognize. It validates
213
+ * leniently (only `type` is required) and is skipped by skins that don't handle
214
+ * it — so future node types (`attachment`, `linkPreview`, …) slot in without
215
+ * breaking older runtimes or bumping the schema version.
216
+ */
217
+ interface UnknownContentNode {
218
+ type: string;
219
+ [key: string]: unknown;
220
+ }
221
+ /** The body of a message: an ordered list of content nodes. */
222
+ type ContentNode = TextNode | ImageNode | UnknownContentNode;
223
+
224
+ /** Register (or override) the strict schema for a content node type. */
225
+ declare function registerContentNodeType(type: string, schema: z.ZodTypeAny): void;
226
+ /** The content node types the runtime validates strictly. */
227
+ declare function knownContentNodeTypes(): string[];
228
+ declare function isKnownContentNodeType(type: string): boolean;
229
+ /**
230
+ * Build a content-node schema from the current registry state. Call this after
231
+ * registering a new type to pick it up; `contentNodeSchema` below is the
232
+ * default built from the v1 registry (`text` + `image`).
233
+ */
234
+ declare function buildContentNodeSchema(): z.ZodType<ContentNode>;
235
+ /** Default content-node schema (text + image + lenient unknown). */
236
+ declare const contentNodeSchema: z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>;
237
+ /** A message body: an ordered array of content nodes. */
238
+ declare const contentSchema: z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>;
239
+
240
+ /**
241
+ * Parse a plain authoring string into inline nodes, extracting inline `code`,
242
+ * links, and `@mentions`. Emoji are left inside text runs in v1 (they render
243
+ * fine and a dedicated emoji mark can be authored explicitly).
244
+ */
245
+ declare function parseInline(text: string): InlineNode[];
246
+ /** Convenience shape for authoring an in-message image. */
247
+ interface ImageSugar {
248
+ src: string;
249
+ alt?: string;
250
+ width?: number;
251
+ height?: number;
252
+ }
253
+ /** `text` string → a single text content node. */
254
+ declare function textToContentNode(text: string): TextNode;
255
+ /** `image` sugar → an image content node (drops undefined optionals). */
256
+ declare function imageToContentNode(image: ImageSugar): ImageNode;
257
+ /** The sugar fields a message may carry instead of explicit `content`. */
258
+ interface MessageBodySugar {
259
+ /** Authored text (parsed into inline marks). */
260
+ text?: string;
261
+ /** In-message images, rendered after the text. */
262
+ images?: ImageSugar[];
263
+ /** Explicit content nodes; when present, wins over `text`/`images`. */
264
+ content?: ContentNode[];
265
+ }
266
+ /**
267
+ * Resolve a message's body sugar to content nodes. Explicit `content` is
268
+ * authoritative; otherwise the text node (if any) comes first, then images —
269
+ * matching the "here's the toast: [image]" ordering in the spec example.
270
+ */
271
+ declare function toContentNodes(body: MessageBodySugar): ContentNode[];
272
+
273
+ /** Authoring sugar for an in-message image (compiled to an image node). */
274
+ declare const imageSugarSchema: z.ZodObject<{
275
+ src: z.ZodString;
276
+ alt: z.ZodOptional<z.ZodString>;
277
+ width: z.ZodOptional<z.ZodNumber>;
278
+ height: z.ZodOptional<z.ZodNumber>;
279
+ }, z.core.$strip>;
280
+ /** An incoming message, optionally preceded by a typing indicator. */
281
+ declare const messageStepSchema: z.ZodObject<{
282
+ id: z.ZodOptional<z.ZodString>;
283
+ delay: z.ZodOptional<z.ZodNumber>;
284
+ instant: z.ZodOptional<z.ZodBoolean>;
285
+ holdAfter: z.ZodOptional<z.ZodNumber>;
286
+ text: z.ZodOptional<z.ZodString>;
287
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
288
+ src: z.ZodString;
289
+ alt: z.ZodOptional<z.ZodString>;
290
+ width: z.ZodOptional<z.ZodNumber>;
291
+ height: z.ZodOptional<z.ZodNumber>;
292
+ }, z.core.$strip>>>;
293
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
294
+ type: z.ZodLiteral<"message">;
295
+ from: z.ZodString;
296
+ typing: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
297
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
298
+ }, z.core.$strip>]>>;
299
+ }, z.core.$strip>;
300
+ /** A reaction landing on a target message (`$prev` or a message id). */
301
+ declare const reactionStepSchema: z.ZodObject<{
302
+ id: z.ZodOptional<z.ZodString>;
303
+ delay: z.ZodOptional<z.ZodNumber>;
304
+ instant: z.ZodOptional<z.ZodBoolean>;
305
+ holdAfter: z.ZodOptional<z.ZodNumber>;
306
+ type: z.ZodLiteral<"reaction">;
307
+ target: z.ZodString;
308
+ emoji: z.ZodString;
309
+ from: z.ZodOptional<z.ZodString>;
310
+ }, z.core.$strip>;
311
+ /** A standalone typing indicator (no message necessarily follows). */
312
+ declare const typingStepSchema: z.ZodObject<{
313
+ id: z.ZodOptional<z.ZodString>;
314
+ delay: z.ZodOptional<z.ZodNumber>;
315
+ instant: z.ZodOptional<z.ZodBoolean>;
316
+ holdAfter: z.ZodOptional<z.ZodNumber>;
317
+ type: z.ZodLiteral<"typing">;
318
+ from: z.ZodString;
319
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
320
+ }, z.core.$strip>;
321
+ /** The self participant typing into the composer, char by char. */
322
+ declare const composerTypeStepSchema: z.ZodObject<{
323
+ id: z.ZodOptional<z.ZodString>;
324
+ delay: z.ZodOptional<z.ZodNumber>;
325
+ instant: z.ZodOptional<z.ZodBoolean>;
326
+ holdAfter: z.ZodOptional<z.ZodNumber>;
327
+ type: z.ZodLiteral<"composerType">;
328
+ from: z.ZodString;
329
+ text: z.ZodString;
330
+ typingDuration: z.ZodOptional<z.ZodNumber>;
331
+ }, z.core.$strip>;
332
+ /** Commit the composer's current text to the thread. */
333
+ declare const sendStepSchema: z.ZodObject<{
334
+ id: z.ZodOptional<z.ZodString>;
335
+ delay: z.ZodOptional<z.ZodNumber>;
336
+ instant: z.ZodOptional<z.ZodBoolean>;
337
+ holdAfter: z.ZodOptional<z.ZodNumber>;
338
+ type: z.ZodLiteral<"send">;
339
+ from: z.ZodOptional<z.ZodString>;
340
+ }, z.core.$strip>;
341
+ /** Edit a previously sent message's body. */
342
+ declare const editStepSchema: z.ZodObject<{
343
+ id: z.ZodOptional<z.ZodString>;
344
+ delay: z.ZodOptional<z.ZodNumber>;
345
+ instant: z.ZodOptional<z.ZodBoolean>;
346
+ holdAfter: z.ZodOptional<z.ZodNumber>;
347
+ text: z.ZodOptional<z.ZodString>;
348
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
349
+ src: z.ZodString;
350
+ alt: z.ZodOptional<z.ZodString>;
351
+ width: z.ZodOptional<z.ZodNumber>;
352
+ height: z.ZodOptional<z.ZodNumber>;
353
+ }, z.core.$strip>>>;
354
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
355
+ type: z.ZodLiteral<"edit">;
356
+ target: z.ZodString;
357
+ }, z.core.$strip>;
358
+ /** Delete a previously sent message. */
359
+ declare const deleteStepSchema: z.ZodObject<{
360
+ id: z.ZodOptional<z.ZodString>;
361
+ delay: z.ZodOptional<z.ZodNumber>;
362
+ instant: z.ZodOptional<z.ZodBoolean>;
363
+ holdAfter: z.ZodOptional<z.ZodNumber>;
364
+ type: z.ZodLiteral<"delete">;
365
+ target: z.ZodString;
366
+ }, z.core.$strip>;
367
+ /** A read receipt (optionally by a participant, optionally up to a message). */
368
+ declare const readReceiptStepSchema: z.ZodObject<{
369
+ id: z.ZodOptional<z.ZodString>;
370
+ delay: z.ZodOptional<z.ZodNumber>;
371
+ instant: z.ZodOptional<z.ZodBoolean>;
372
+ holdAfter: z.ZodOptional<z.ZodNumber>;
373
+ type: z.ZodLiteral<"readReceipt">;
374
+ by: z.ZodOptional<z.ZodString>;
375
+ target: z.ZodOptional<z.ZodString>;
376
+ }, z.core.$strip>;
377
+ /** An app/system card (e.g. "Pull request opened" with action buttons). */
378
+ declare const systemStepSchema: z.ZodObject<{
379
+ id: z.ZodOptional<z.ZodString>;
380
+ delay: z.ZodOptional<z.ZodNumber>;
381
+ instant: z.ZodOptional<z.ZodBoolean>;
382
+ holdAfter: z.ZodOptional<z.ZodNumber>;
383
+ text: z.ZodOptional<z.ZodString>;
384
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
385
+ src: z.ZodString;
386
+ alt: z.ZodOptional<z.ZodString>;
387
+ width: z.ZodOptional<z.ZodNumber>;
388
+ height: z.ZodOptional<z.ZodNumber>;
389
+ }, z.core.$strip>>>;
390
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
391
+ type: z.ZodLiteral<"system">;
392
+ from: z.ZodOptional<z.ZodString>;
393
+ card: z.ZodOptional<z.ZodString>;
394
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
395
+ label: z.ZodString;
396
+ href: z.ZodOptional<z.ZodString>;
397
+ }, z.core.$strip>>>;
398
+ }, z.core.$strip>;
399
+ /** An explicit pause in the timeline. */
400
+ declare const beatStepSchema: z.ZodObject<{
401
+ id: z.ZodOptional<z.ZodString>;
402
+ delay: z.ZodOptional<z.ZodNumber>;
403
+ instant: z.ZodOptional<z.ZodBoolean>;
404
+ holdAfter: z.ZodOptional<z.ZodNumber>;
405
+ type: z.ZodLiteral<"beat">;
406
+ duration: z.ZodNumber;
407
+ }, z.core.$strip>;
408
+ declare const timelineStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
409
+ id: z.ZodOptional<z.ZodString>;
410
+ delay: z.ZodOptional<z.ZodNumber>;
411
+ instant: z.ZodOptional<z.ZodBoolean>;
412
+ holdAfter: z.ZodOptional<z.ZodNumber>;
413
+ text: z.ZodOptional<z.ZodString>;
414
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
415
+ src: z.ZodString;
416
+ alt: z.ZodOptional<z.ZodString>;
417
+ width: z.ZodOptional<z.ZodNumber>;
418
+ height: z.ZodOptional<z.ZodNumber>;
419
+ }, z.core.$strip>>>;
420
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
421
+ type: z.ZodLiteral<"message">;
422
+ from: z.ZodString;
423
+ typing: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
424
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
425
+ }, z.core.$strip>]>>;
426
+ }, z.core.$strip>, z.ZodObject<{
427
+ id: z.ZodOptional<z.ZodString>;
428
+ delay: z.ZodOptional<z.ZodNumber>;
429
+ instant: z.ZodOptional<z.ZodBoolean>;
430
+ holdAfter: z.ZodOptional<z.ZodNumber>;
431
+ type: z.ZodLiteral<"reaction">;
432
+ target: z.ZodString;
433
+ emoji: z.ZodString;
434
+ from: z.ZodOptional<z.ZodString>;
435
+ }, z.core.$strip>, z.ZodObject<{
436
+ id: z.ZodOptional<z.ZodString>;
437
+ delay: z.ZodOptional<z.ZodNumber>;
438
+ instant: z.ZodOptional<z.ZodBoolean>;
439
+ holdAfter: z.ZodOptional<z.ZodNumber>;
440
+ type: z.ZodLiteral<"typing">;
441
+ from: z.ZodString;
442
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
443
+ }, z.core.$strip>, z.ZodObject<{
444
+ id: z.ZodOptional<z.ZodString>;
445
+ delay: z.ZodOptional<z.ZodNumber>;
446
+ instant: z.ZodOptional<z.ZodBoolean>;
447
+ holdAfter: z.ZodOptional<z.ZodNumber>;
448
+ type: z.ZodLiteral<"composerType">;
449
+ from: z.ZodString;
450
+ text: z.ZodString;
451
+ typingDuration: z.ZodOptional<z.ZodNumber>;
452
+ }, z.core.$strip>, z.ZodObject<{
453
+ id: z.ZodOptional<z.ZodString>;
454
+ delay: z.ZodOptional<z.ZodNumber>;
455
+ instant: z.ZodOptional<z.ZodBoolean>;
456
+ holdAfter: z.ZodOptional<z.ZodNumber>;
457
+ type: z.ZodLiteral<"send">;
458
+ from: z.ZodOptional<z.ZodString>;
459
+ }, z.core.$strip>, z.ZodObject<{
460
+ id: z.ZodOptional<z.ZodString>;
461
+ delay: z.ZodOptional<z.ZodNumber>;
462
+ instant: z.ZodOptional<z.ZodBoolean>;
463
+ holdAfter: z.ZodOptional<z.ZodNumber>;
464
+ text: z.ZodOptional<z.ZodString>;
465
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
466
+ src: z.ZodString;
467
+ alt: z.ZodOptional<z.ZodString>;
468
+ width: z.ZodOptional<z.ZodNumber>;
469
+ height: z.ZodOptional<z.ZodNumber>;
470
+ }, z.core.$strip>>>;
471
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
472
+ type: z.ZodLiteral<"edit">;
473
+ target: z.ZodString;
474
+ }, z.core.$strip>, z.ZodObject<{
475
+ id: z.ZodOptional<z.ZodString>;
476
+ delay: z.ZodOptional<z.ZodNumber>;
477
+ instant: z.ZodOptional<z.ZodBoolean>;
478
+ holdAfter: z.ZodOptional<z.ZodNumber>;
479
+ type: z.ZodLiteral<"delete">;
480
+ target: z.ZodString;
481
+ }, z.core.$strip>, z.ZodObject<{
482
+ id: z.ZodOptional<z.ZodString>;
483
+ delay: z.ZodOptional<z.ZodNumber>;
484
+ instant: z.ZodOptional<z.ZodBoolean>;
485
+ holdAfter: z.ZodOptional<z.ZodNumber>;
486
+ type: z.ZodLiteral<"readReceipt">;
487
+ by: z.ZodOptional<z.ZodString>;
488
+ target: z.ZodOptional<z.ZodString>;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ id: z.ZodOptional<z.ZodString>;
491
+ delay: z.ZodOptional<z.ZodNumber>;
492
+ instant: z.ZodOptional<z.ZodBoolean>;
493
+ holdAfter: z.ZodOptional<z.ZodNumber>;
494
+ text: z.ZodOptional<z.ZodString>;
495
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
496
+ src: z.ZodString;
497
+ alt: z.ZodOptional<z.ZodString>;
498
+ width: z.ZodOptional<z.ZodNumber>;
499
+ height: z.ZodOptional<z.ZodNumber>;
500
+ }, z.core.$strip>>>;
501
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
502
+ type: z.ZodLiteral<"system">;
503
+ from: z.ZodOptional<z.ZodString>;
504
+ card: z.ZodOptional<z.ZodString>;
505
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
506
+ label: z.ZodString;
507
+ href: z.ZodOptional<z.ZodString>;
508
+ }, z.core.$strip>>>;
509
+ }, z.core.$strip>, z.ZodObject<{
510
+ id: z.ZodOptional<z.ZodString>;
511
+ delay: z.ZodOptional<z.ZodNumber>;
512
+ instant: z.ZodOptional<z.ZodBoolean>;
513
+ holdAfter: z.ZodOptional<z.ZodNumber>;
514
+ type: z.ZodLiteral<"beat">;
515
+ duration: z.ZodNumber;
516
+ }, z.core.$strip>], "type">;
517
+ type TimelineStep = z.infer<typeof timelineStepSchema>;
518
+ type TimelineStepInput = z.input<typeof timelineStepSchema>;
519
+ declare const timelineSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
520
+ id: z.ZodOptional<z.ZodString>;
521
+ delay: z.ZodOptional<z.ZodNumber>;
522
+ instant: z.ZodOptional<z.ZodBoolean>;
523
+ holdAfter: z.ZodOptional<z.ZodNumber>;
524
+ text: z.ZodOptional<z.ZodString>;
525
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
526
+ src: z.ZodString;
527
+ alt: z.ZodOptional<z.ZodString>;
528
+ width: z.ZodOptional<z.ZodNumber>;
529
+ height: z.ZodOptional<z.ZodNumber>;
530
+ }, z.core.$strip>>>;
531
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
532
+ type: z.ZodLiteral<"message">;
533
+ from: z.ZodString;
534
+ typing: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
535
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
536
+ }, z.core.$strip>]>>;
537
+ }, z.core.$strip>, z.ZodObject<{
538
+ id: z.ZodOptional<z.ZodString>;
539
+ delay: z.ZodOptional<z.ZodNumber>;
540
+ instant: z.ZodOptional<z.ZodBoolean>;
541
+ holdAfter: z.ZodOptional<z.ZodNumber>;
542
+ type: z.ZodLiteral<"reaction">;
543
+ target: z.ZodString;
544
+ emoji: z.ZodString;
545
+ from: z.ZodOptional<z.ZodString>;
546
+ }, z.core.$strip>, z.ZodObject<{
547
+ id: z.ZodOptional<z.ZodString>;
548
+ delay: z.ZodOptional<z.ZodNumber>;
549
+ instant: z.ZodOptional<z.ZodBoolean>;
550
+ holdAfter: z.ZodOptional<z.ZodNumber>;
551
+ type: z.ZodLiteral<"typing">;
552
+ from: z.ZodString;
553
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
554
+ }, z.core.$strip>, z.ZodObject<{
555
+ id: z.ZodOptional<z.ZodString>;
556
+ delay: z.ZodOptional<z.ZodNumber>;
557
+ instant: z.ZodOptional<z.ZodBoolean>;
558
+ holdAfter: z.ZodOptional<z.ZodNumber>;
559
+ type: z.ZodLiteral<"composerType">;
560
+ from: z.ZodString;
561
+ text: z.ZodString;
562
+ typingDuration: z.ZodOptional<z.ZodNumber>;
563
+ }, z.core.$strip>, z.ZodObject<{
564
+ id: z.ZodOptional<z.ZodString>;
565
+ delay: z.ZodOptional<z.ZodNumber>;
566
+ instant: z.ZodOptional<z.ZodBoolean>;
567
+ holdAfter: z.ZodOptional<z.ZodNumber>;
568
+ type: z.ZodLiteral<"send">;
569
+ from: z.ZodOptional<z.ZodString>;
570
+ }, z.core.$strip>, z.ZodObject<{
571
+ id: z.ZodOptional<z.ZodString>;
572
+ delay: z.ZodOptional<z.ZodNumber>;
573
+ instant: z.ZodOptional<z.ZodBoolean>;
574
+ holdAfter: z.ZodOptional<z.ZodNumber>;
575
+ text: z.ZodOptional<z.ZodString>;
576
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
577
+ src: z.ZodString;
578
+ alt: z.ZodOptional<z.ZodString>;
579
+ width: z.ZodOptional<z.ZodNumber>;
580
+ height: z.ZodOptional<z.ZodNumber>;
581
+ }, z.core.$strip>>>;
582
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
583
+ type: z.ZodLiteral<"edit">;
584
+ target: z.ZodString;
585
+ }, z.core.$strip>, z.ZodObject<{
586
+ id: z.ZodOptional<z.ZodString>;
587
+ delay: z.ZodOptional<z.ZodNumber>;
588
+ instant: z.ZodOptional<z.ZodBoolean>;
589
+ holdAfter: z.ZodOptional<z.ZodNumber>;
590
+ type: z.ZodLiteral<"delete">;
591
+ target: z.ZodString;
592
+ }, z.core.$strip>, z.ZodObject<{
593
+ id: z.ZodOptional<z.ZodString>;
594
+ delay: z.ZodOptional<z.ZodNumber>;
595
+ instant: z.ZodOptional<z.ZodBoolean>;
596
+ holdAfter: z.ZodOptional<z.ZodNumber>;
597
+ type: z.ZodLiteral<"readReceipt">;
598
+ by: z.ZodOptional<z.ZodString>;
599
+ target: z.ZodOptional<z.ZodString>;
600
+ }, z.core.$strip>, z.ZodObject<{
601
+ id: z.ZodOptional<z.ZodString>;
602
+ delay: z.ZodOptional<z.ZodNumber>;
603
+ instant: z.ZodOptional<z.ZodBoolean>;
604
+ holdAfter: z.ZodOptional<z.ZodNumber>;
605
+ text: z.ZodOptional<z.ZodString>;
606
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
607
+ src: z.ZodString;
608
+ alt: z.ZodOptional<z.ZodString>;
609
+ width: z.ZodOptional<z.ZodNumber>;
610
+ height: z.ZodOptional<z.ZodNumber>;
611
+ }, z.core.$strip>>>;
612
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
613
+ type: z.ZodLiteral<"system">;
614
+ from: z.ZodOptional<z.ZodString>;
615
+ card: z.ZodOptional<z.ZodString>;
616
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
617
+ label: z.ZodString;
618
+ href: z.ZodOptional<z.ZodString>;
619
+ }, z.core.$strip>>>;
620
+ }, z.core.$strip>, z.ZodObject<{
621
+ id: z.ZodOptional<z.ZodString>;
622
+ delay: z.ZodOptional<z.ZodNumber>;
623
+ instant: z.ZodOptional<z.ZodBoolean>;
624
+ holdAfter: z.ZodOptional<z.ZodNumber>;
625
+ type: z.ZodLiteral<"beat">;
626
+ duration: z.ZodNumber;
627
+ }, z.core.$strip>], "type">>;
628
+ /** The discriminant values of every timeline step. */
629
+ declare const STEP_TYPES: readonly ["message", "reaction", "typing", "composerType", "send", "edit", "delete", "readReceipt", "system", "beat"];
630
+ type StepType = (typeof STEP_TYPES)[number];
631
+
632
+ /**
633
+ * The config schema version. Distinct from the `@typecaast/schema` package
634
+ * version (related but versioned independently — see PLAN §22). A config newer
635
+ * than the installed runtime fails parsing with a clear error.
636
+ */
637
+ declare const CONFIG_VERSION = 1;
638
+ /** The complete Typecaast config: the single source of truth for a simulation. */
639
+ declare const configSchema: z.ZodObject<{
640
+ version: z.ZodLiteral<1>;
641
+ meta: z.ZodObject<{
642
+ canvas: z.ZodObject<{
643
+ width: z.ZodNumber;
644
+ height: z.ZodNumber;
645
+ }, z.core.$strip>;
646
+ fps: z.ZodDefault<z.ZodNumber>;
647
+ fit: z.ZodDefault<z.ZodEnum<{
648
+ reflow: "reflow";
649
+ scale: "scale";
650
+ fixed: "fixed";
651
+ }>>;
652
+ theme: z.ZodDefault<z.ZodEnum<{
653
+ light: "light";
654
+ dark: "dark";
655
+ auto: "auto";
656
+ }>>;
657
+ skin: z.ZodObject<{
658
+ id: z.ZodString;
659
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
660
+ }, z.core.$strip>;
661
+ seed: z.ZodDefault<z.ZodNumber>;
662
+ background: z.ZodDefault<z.ZodString>;
663
+ assets: z.ZodDefault<z.ZodEnum<{
664
+ inline: "inline";
665
+ url: "url";
666
+ }>>;
667
+ }, z.core.$strip>;
668
+ participants: z.ZodArray<z.ZodObject<{
669
+ id: z.ZodString;
670
+ name: z.ZodString;
671
+ avatar: z.ZodOptional<z.ZodString>;
672
+ color: z.ZodOptional<z.ZodString>;
673
+ isSelf: z.ZodOptional<z.ZodBoolean>;
674
+ kind: z.ZodDefault<z.ZodEnum<{
675
+ person: "person";
676
+ app: "app";
677
+ }>>;
678
+ }, z.core.$strip>>;
679
+ pacing: z.ZodDefault<z.ZodObject<{
680
+ readingWpm: z.ZodDefault<z.ZodNumber>;
681
+ typingCps: z.ZodDefault<z.ZodNumber>;
682
+ reactionDelayMs: z.ZodDefault<z.ZodNumber>;
683
+ interMessageGapMs: z.ZodDefault<z.ZodNumber>;
684
+ humanize: z.ZodDefault<z.ZodNumber>;
685
+ startDelayMs: z.ZodDefault<z.ZodNumber>;
686
+ }, z.core.$strip>>;
687
+ timeline: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
688
+ id: z.ZodOptional<z.ZodString>;
689
+ delay: z.ZodOptional<z.ZodNumber>;
690
+ instant: z.ZodOptional<z.ZodBoolean>;
691
+ holdAfter: z.ZodOptional<z.ZodNumber>;
692
+ text: z.ZodOptional<z.ZodString>;
693
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
694
+ src: z.ZodString;
695
+ alt: z.ZodOptional<z.ZodString>;
696
+ width: z.ZodOptional<z.ZodNumber>;
697
+ height: z.ZodOptional<z.ZodNumber>;
698
+ }, z.core.$strip>>>;
699
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
700
+ type: z.ZodLiteral<"message">;
701
+ from: z.ZodString;
702
+ typing: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
703
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
704
+ }, z.core.$strip>]>>;
705
+ }, z.core.$strip>, z.ZodObject<{
706
+ id: z.ZodOptional<z.ZodString>;
707
+ delay: z.ZodOptional<z.ZodNumber>;
708
+ instant: z.ZodOptional<z.ZodBoolean>;
709
+ holdAfter: z.ZodOptional<z.ZodNumber>;
710
+ type: z.ZodLiteral<"reaction">;
711
+ target: z.ZodString;
712
+ emoji: z.ZodString;
713
+ from: z.ZodOptional<z.ZodString>;
714
+ }, z.core.$strip>, z.ZodObject<{
715
+ id: z.ZodOptional<z.ZodString>;
716
+ delay: z.ZodOptional<z.ZodNumber>;
717
+ instant: z.ZodOptional<z.ZodBoolean>;
718
+ holdAfter: z.ZodOptional<z.ZodNumber>;
719
+ type: z.ZodLiteral<"typing">;
720
+ from: z.ZodString;
721
+ showTypingFor: z.ZodOptional<z.ZodNumber>;
722
+ }, z.core.$strip>, z.ZodObject<{
723
+ id: z.ZodOptional<z.ZodString>;
724
+ delay: z.ZodOptional<z.ZodNumber>;
725
+ instant: z.ZodOptional<z.ZodBoolean>;
726
+ holdAfter: z.ZodOptional<z.ZodNumber>;
727
+ type: z.ZodLiteral<"composerType">;
728
+ from: z.ZodString;
729
+ text: z.ZodString;
730
+ typingDuration: z.ZodOptional<z.ZodNumber>;
731
+ }, z.core.$strip>, z.ZodObject<{
732
+ id: z.ZodOptional<z.ZodString>;
733
+ delay: z.ZodOptional<z.ZodNumber>;
734
+ instant: z.ZodOptional<z.ZodBoolean>;
735
+ holdAfter: z.ZodOptional<z.ZodNumber>;
736
+ type: z.ZodLiteral<"send">;
737
+ from: z.ZodOptional<z.ZodString>;
738
+ }, z.core.$strip>, z.ZodObject<{
739
+ id: z.ZodOptional<z.ZodString>;
740
+ delay: z.ZodOptional<z.ZodNumber>;
741
+ instant: z.ZodOptional<z.ZodBoolean>;
742
+ holdAfter: z.ZodOptional<z.ZodNumber>;
743
+ text: z.ZodOptional<z.ZodString>;
744
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
745
+ src: z.ZodString;
746
+ alt: z.ZodOptional<z.ZodString>;
747
+ width: z.ZodOptional<z.ZodNumber>;
748
+ height: z.ZodOptional<z.ZodNumber>;
749
+ }, z.core.$strip>>>;
750
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
751
+ type: z.ZodLiteral<"edit">;
752
+ target: z.ZodString;
753
+ }, z.core.$strip>, z.ZodObject<{
754
+ id: z.ZodOptional<z.ZodString>;
755
+ delay: z.ZodOptional<z.ZodNumber>;
756
+ instant: z.ZodOptional<z.ZodBoolean>;
757
+ holdAfter: z.ZodOptional<z.ZodNumber>;
758
+ type: z.ZodLiteral<"delete">;
759
+ target: z.ZodString;
760
+ }, z.core.$strip>, z.ZodObject<{
761
+ id: z.ZodOptional<z.ZodString>;
762
+ delay: z.ZodOptional<z.ZodNumber>;
763
+ instant: z.ZodOptional<z.ZodBoolean>;
764
+ holdAfter: z.ZodOptional<z.ZodNumber>;
765
+ type: z.ZodLiteral<"readReceipt">;
766
+ by: z.ZodOptional<z.ZodString>;
767
+ target: z.ZodOptional<z.ZodString>;
768
+ }, z.core.$strip>, z.ZodObject<{
769
+ id: z.ZodOptional<z.ZodString>;
770
+ delay: z.ZodOptional<z.ZodNumber>;
771
+ instant: z.ZodOptional<z.ZodBoolean>;
772
+ holdAfter: z.ZodOptional<z.ZodNumber>;
773
+ text: z.ZodOptional<z.ZodString>;
774
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
775
+ src: z.ZodString;
776
+ alt: z.ZodOptional<z.ZodString>;
777
+ width: z.ZodOptional<z.ZodNumber>;
778
+ height: z.ZodOptional<z.ZodNumber>;
779
+ }, z.core.$strip>>>;
780
+ content: z.ZodOptional<z.ZodArray<z.ZodType<ContentNode, unknown, z.core.$ZodTypeInternals<ContentNode, unknown>>>>;
781
+ type: z.ZodLiteral<"system">;
782
+ from: z.ZodOptional<z.ZodString>;
783
+ card: z.ZodOptional<z.ZodString>;
784
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
785
+ label: z.ZodString;
786
+ href: z.ZodOptional<z.ZodString>;
787
+ }, z.core.$strip>>>;
788
+ }, z.core.$strip>, z.ZodObject<{
789
+ id: z.ZodOptional<z.ZodString>;
790
+ delay: z.ZodOptional<z.ZodNumber>;
791
+ instant: z.ZodOptional<z.ZodBoolean>;
792
+ holdAfter: z.ZodOptional<z.ZodNumber>;
793
+ type: z.ZodLiteral<"beat">;
794
+ duration: z.ZodNumber;
795
+ }, z.core.$strip>], "type">>;
796
+ }, z.core.$strip>;
797
+ /** A parsed config (defaults applied). */
798
+ type Config = z.infer<typeof configSchema>;
799
+ /** A config as authored (fields with defaults are optional). */
800
+ type ConfigInput = z.input<typeof configSchema>;
801
+ /**
802
+ * Generate the JSON Schema for a Typecaast config (for editor autocomplete and
803
+ * `$schema` references). Lazy so importing the package never eagerly runs the
804
+ * conversion. Refinements (e.g. the lenient content-node guard) are not
805
+ * representable in JSON Schema and are dropped.
806
+ */
807
+ declare function configJsonSchema(): Record<string, unknown>;
808
+
809
+ /** Diagnostic severity tiers (PLAN §23). */
810
+ type Severity = "error" | "warning" | "info";
811
+ /**
812
+ * A single validation finding. Every diagnostic carries a stable `code`, the
813
+ * offending `location` (step/message/path), and a `hint` for remediation.
814
+ */
815
+ interface Diagnostic {
816
+ code: string;
817
+ severity: Severity;
818
+ message: string;
819
+ /** Dotted/indexed path, e.g. `timeline[3].from` or `meta.canvas.width`. */
820
+ location?: string;
821
+ hint?: string;
822
+ }
823
+ /**
824
+ * Validate a parsed config value (already JSON-decoded). Returns all
825
+ * diagnostics — schema errors, then semantic checks (reference integrity,
826
+ * target resolution). Reusable by the CLI and the builder's lint panel.
827
+ *
828
+ * A version newer than the runtime short-circuits with a single hard error.
829
+ */
830
+ declare function validateConfig(raw: unknown): Diagnostic[];
831
+
832
+ export { type AssetMode, CONFIG_VERSION, type Config, type ConfigInput, type ContentNode, type Diagnostic, type FitMode, type ImageNode, type ImageSugar, type InlineNode, type MessageBodySugar, type Meta, type MetaInput, type Pacing, type PacingInput, type Participant, type ParticipantInput, type ParticipantKind, STEP_TYPES, type Severity, type Size, type SkinRef, type StepType, type TextNode, type ThemeMode, type TimelineStep, type TimelineStepInput, type UnknownContentNode, assetModeSchema, beatStepSchema, buildContentNodeSchema, composerTypeStepSchema, configJsonSchema, configSchema, contentNodeSchema, contentSchema, deleteStepSchema, editStepSchema, fitModeSchema, imageNodeSchema, imageSugarSchema, imageToContentNode, inlineCodeSchema, inlineEmojiSchema, inlineLinkSchema, inlineMentionSchema, inlineNodeSchema, inlineTextSchema, isKnownContentNodeType, knownContentNodeTypes, messageStepSchema, metaSchema, pacingSchema, parseInline, participantKindSchema, participantSchema, participantsSchema, reactionStepSchema, readReceiptStepSchema, registerContentNodeType, sendStepSchema, sizeSchema, skinRefSchema, systemStepSchema, textNodeSchema, textToContentNode, themeModeSchema, timelineSchema, timelineStepSchema, toContentNodes, typingStepSchema, validateConfig };