@mengine/medeo-client 2.0.1-alpha.3 → 2.0.1-alpha.31

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,3 +1,4 @@
1
+ import { A as MoveVideoClipsInput, J as ChangeSpeechScriptInput, K as DeleteBgmInput, N as MoveVideoClipsByAnchorInput, O as ReplaceVideoClipContentInput, Q as AdjustVideoClipVolumeInput, R as MoveSpeechesInput, S as SetBgmInput, T as ReplaceVideoClipSequenceInput, V as DeleteVideoClipsInput, W as DeleteSpeechesInput, Y as ChangeSpeechVoiceInput, b as SetCaptionStyleInput, ct as AddSpeechesInput, et as AdjustVideoClipDurationInput, g as SetVideoClipSpeedShiftInput, it as AdjustBgmVolumeInput, nt as AdjustSpeechVolumeInput, ot as AddVideoClipsInput, v as SetCaptionVisibilityInput } from "./index-CMa6ZCtX.js";
1
2
  import { InferInputType } from "loro-mirror";
2
3
  import { z } from "zod";
3
4
  import { LoroDoc, PeerID } from "loro-crdt";
@@ -8,7 +9,7 @@ import { LoroDoc, PeerID } from "loro-crdt";
8
9
  *
9
10
  * VideoDraft read-view types extracted from the Smithy IDL
10
11
  * (medeo-v2-design-materials). Re-run `vp run @mengine/idl-codegen#sync`.
11
- * Source IDL commit: 902e82e3fec1e94b36e14ef671de91abd210dc86
12
+ * Source IDL commit: e855b3035fe5d932d051b9c5043be9c25b9dec03
12
13
  *
13
14
  * WHY EVERY FIELD IS `T | undefined`:
14
15
  * AWS `smithy-typescript-codegen` widens every structure member to
@@ -29,10 +30,10 @@ import { LoroDoc, PeerID } from "loro-crdt";
29
30
  * @enum
30
31
  */
31
32
  declare const PartKind$1: {
32
- readonly BGM: 'bgm';
33
- readonly CAPTION: 'caption';
34
- readonly SPEECH: 'speech';
35
- readonly VIDEO_CLIP: 'video_clip';
33
+ readonly BGM: "bgm";
34
+ readonly CAPTION: "caption";
35
+ readonly SPEECH: "speech";
36
+ readonly VIDEO_CLIP: "video_clip";
36
37
  };
37
38
  /**
38
39
  * @public
@@ -40,15 +41,160 @@ declare const PartKind$1: {
40
41
  type PartKind$1 = (typeof PartKind$1)[keyof typeof PartKind$1];
41
42
  /**
42
43
  * @public
44
+ * @enum
43
45
  */
44
- interface VoiceSummary {
45
- name: string | undefined;
46
+ declare const AspectRatio: {
47
+ readonly RATIO_16_9: "16:9";
48
+ readonly RATIO_9_16: "9:16";
49
+ };
50
+ /**
51
+ * @public
52
+ */
53
+ type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
54
+ /**
55
+ * @public
56
+ * @enum
57
+ */
58
+ declare const AssetSource: {
59
+ readonly AI_IMAGES: "ai_images";
60
+ readonly AI_VIDEOS: "ai_videos";
61
+ readonly MY_UPLOADED_ASSETS: "my_uploaded_assets";
62
+ readonly STOCK_VIDEOS: "stock_videos";
63
+ };
64
+ /**
65
+ * @public
66
+ */
67
+ type AssetSource = (typeof AssetSource)[keyof typeof AssetSource];
68
+ /**
69
+ * An extra aspect ratio variant with independent storage keys for thumbnail,
70
+ * preview video, and highlight video. Stored inside video_settings JSONB.
71
+ * @public
72
+ */
73
+ interface RatioVariant {
74
+ aspect_ratio: string | undefined;
75
+ thumb_storage_key: string | undefined;
76
+ video_storage_key: string | undefined;
77
+ highlight_video_storage_key?: string | undefined;
78
+ }
79
+ /**
80
+ * @public
81
+ * @enum
82
+ */
83
+ declare const CreationRenderPolicy: {
84
+ readonly AUTO_AFTER_GENERATION: "auto_after_generation";
85
+ readonly MANUAL: "manual";
86
+ };
87
+ /**
88
+ * @public
89
+ */
90
+ type CreationRenderPolicy = (typeof CreationRenderPolicy)[keyof typeof CreationRenderPolicy];
91
+ /**
92
+ * @public
93
+ */
94
+ interface VideoCreationSettings$1 {
95
+ voice_id?: string | undefined;
96
+ duration_ms?: number | undefined;
97
+ aspect_ratio?: AspectRatio | undefined;
98
+ video_style_id?: string | undefined;
99
+ asset_sources?: AssetSource[] | undefined;
100
+ recipe_id?: string | undefined;
101
+ enable_high_cost_confirm?: boolean | undefined;
102
+ user_confirm_cost_threshold?: number | undefined;
103
+ /**
104
+ * Extra aspect ratio variants with independent storage keys.
105
+ * Each variant carries its own thumbnail, preview video, and optional highlight video.
106
+ * Used when a recipe supports multiple aspect ratios (e.g. both 16:9 and 9:16).
107
+ * @public
108
+ */
109
+ extra_ratios?: RatioVariant[] | undefined;
110
+ /**
111
+ * Render (export) trigger policy for the finished video.
112
+ * manual: the user triggers export explicitly.
113
+ * auto_after_generation: a render job is created automatically once generation succeeds.
114
+ * When omitted, falls back to the platform default derived from the client
115
+ * platform header: mobile = auto_after_generation, web = manual.
116
+ * @public
117
+ */
118
+ render_policy?: CreationRenderPolicy | undefined;
119
+ /**
120
+ * Createflow workflow identifier. When set, harness uses this for exact workflow matching.
121
+ * @public
122
+ */
123
+ workflow_id?: string | undefined;
124
+ /**
125
+ * Media id of the narration source the user provided via the
126
+ * audio-script input slot (a narration-text document, or an audio file
127
+ * to transcribe). Distinguishes the narration source from other
128
+ * reference media in media_ids. Only meaningful for the
129
+ * audio_script_to_video workflow.
130
+ * @public
131
+ */
132
+ audio_script_media_id?: string | undefined;
133
+ }
134
+ /**
135
+ * @public
136
+ */
137
+ interface TrackItem$1 {
138
+ abs_time_position: number | undefined;
139
+ part_id: string | undefined;
140
+ }
141
+ /**
142
+ * @public
143
+ */
144
+ interface Track$1 {
46
145
  id: string | undefined;
146
+ /**
147
+ * Types of parts that can be contained in tracks
148
+ * @public
149
+ */
150
+ parts_kind: PartKind$1 | undefined;
151
+ is_hidden: boolean | undefined;
152
+ items: TrackItem$1[] | undefined;
47
153
  }
48
154
  /**
49
155
  * @public
50
156
  */
51
- interface SpeechPart$1 {
157
+ interface Attachment {
158
+ part_id: string | undefined;
159
+ relative_time_position: number | undefined;
160
+ }
161
+ /**
162
+ * @public
163
+ */
164
+ interface PartAggregation {
165
+ body_part_id: string | undefined;
166
+ attachments: Attachment[] | undefined;
167
+ }
168
+ /**
169
+ * @public
170
+ * @enum
171
+ */
172
+ declare const AudioFadeCurve: {
173
+ readonly COSINE: "cosine";
174
+ readonly EXPONENTIAL: "exponential";
175
+ readonly LINEAR: "linear";
176
+ readonly LOGARITHMIC: "logarithmic";
177
+ };
178
+ /**
179
+ * @public
180
+ */
181
+ type AudioFadeCurve = (typeof AudioFadeCurve)[keyof typeof AudioFadeCurve];
182
+ /**
183
+ * Audio fade configuration shared by video, BGM, and speech timeline parts.
184
+ * @public
185
+ */
186
+ interface AudioFade {
187
+ duration_ms: number | undefined;
188
+ /**
189
+ * Defaults to LINEAR when omitted.
190
+ * @public
191
+ */
192
+ curve?: AudioFadeCurve | undefined;
193
+ }
194
+ /**
195
+ * @public
196
+ */
197
+ interface BgmPart$1 {
52
198
  id: string | undefined;
53
199
  duration_ms: number | undefined;
54
200
  /**
@@ -56,12 +202,68 @@ interface SpeechPart$1 {
56
202
  * @public
57
203
  */
58
204
  kind: PartKind$1 | undefined;
59
- audio_script: string | undefined;
60
- volume: number | undefined;
61
205
  audio_storage_key: string | undefined;
62
- origin_speech_id: string | undefined;
63
- voice: VoiceSummary | undefined;
64
- caption_ids: string[] | undefined;
206
+ volume: number | undefined;
207
+ origin_media_id: string | undefined;
208
+ /**
209
+ * Audio fade configuration shared by video, BGM, and speech timeline parts.
210
+ * @public
211
+ */
212
+ audio_fade_in?: AudioFade | undefined;
213
+ /**
214
+ * Audio fade configuration shared by video, BGM, and speech timeline parts.
215
+ * @public
216
+ */
217
+ audio_fade_out?: AudioFade | undefined;
218
+ }
219
+ /**
220
+ * @public
221
+ * @enum
222
+ */
223
+ declare const CaptionCreatedFrom: {
224
+ readonly ASR: "asr";
225
+ readonly IMPORT: "import";
226
+ readonly TTS: "tts";
227
+ readonly USER: "user";
228
+ readonly VIDEO_AUDIO: "video_audio";
229
+ };
230
+ /**
231
+ * @public
232
+ */
233
+ type CaptionCreatedFrom = (typeof CaptionCreatedFrom)[keyof typeof CaptionCreatedFrom];
234
+ /**
235
+ * @public
236
+ * @enum
237
+ */
238
+ declare const CaptionSourceKind: {
239
+ /**
240
+ * Legacy caption transport value. It is not v29 relation authority.
241
+ */
242
+ readonly AUDIO_SCRIPT: "audio_script";
243
+ readonly IMPORT: "import";
244
+ readonly SPEECH_AUDIO: "speech_audio";
245
+ readonly TIMELINE: "timeline";
246
+ readonly USER: "user";
247
+ readonly VIDEO_AUDIO: "video_audio";
248
+ };
249
+ /**
250
+ * @public
251
+ */
252
+ type CaptionSourceKind = (typeof CaptionSourceKind)[keyof typeof CaptionSourceKind];
253
+ /**
254
+ * Legacy source metadata kept only to read and round-trip historical draft
255
+ * payloads. It is not v29 relation authority and must not be used to infer
256
+ * relation direction.
257
+ * @public
258
+ */
259
+ interface DslSourceRef {
260
+ source_kind?: CaptionSourceKind | undefined;
261
+ source_media_id?: string | undefined;
262
+ source_script_revision_id?: string | undefined;
263
+ source_part_id?: string | undefined;
264
+ source_clip_part_id?: string | undefined;
265
+ start_timestamp_ms?: number | undefined;
266
+ end_timestamp_ms?: number | undefined;
65
267
  }
66
268
  /**
67
269
  * Caption visual style configuration
@@ -138,102 +340,100 @@ interface CaptionPart$1 {
138
340
  * @public
139
341
  */
140
342
  style?: CaptionStyle | undefined;
343
+ /**
344
+ * Legacy source classification retained for historical draft transport.
345
+ * It is not v29 relation authority.
346
+ * @public
347
+ */
348
+ source_kind?: CaptionSourceKind | undefined;
349
+ /**
350
+ * Legacy source part identifier retained for historical draft transport.
351
+ * It is not v29 relation authority.
352
+ * @public
353
+ */
354
+ source_part_id?: string | undefined;
355
+ /**
356
+ * Legacy creation provenance retained for historical draft transport.
357
+ * @public
358
+ */
359
+ created_from?: CaptionCreatedFrom | undefined;
360
+ /**
361
+ * Legacy read-only source metadata retained for round-tripping historical
362
+ * drafts. It is not v29 relation authority.
363
+ * @public
364
+ */
365
+ source_ref?: DslSourceRef | undefined;
141
366
  }
142
367
  /**
143
- * @public
144
- * @enum
145
- */
146
- declare const AspectRatio: {
147
- readonly RATIO_16_9: '16:9';
148
- readonly RATIO_9_16: '9:16';
149
- };
150
- /**
368
+ * Typed phoneme payload consumed by FE and MEngine compatibility projections.
151
369
  * @public
152
370
  */
153
- type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
371
+ interface PhonemeControlContent {
372
+ ssml: string | undefined;
373
+ }
154
374
  /**
155
375
  * @public
156
376
  * @enum
157
377
  */
158
- declare const AssetSource: {
159
- readonly AI_IMAGES: 'ai_images';
160
- readonly AI_VIDEOS: 'ai_videos';
161
- readonly MY_UPLOADED_ASSETS: 'my_uploaded_assets';
162
- readonly STOCK_VIDEOS: 'stock_videos';
378
+ declare const PhonemeControlStatus: {
379
+ readonly APPLIED: "applied";
380
+ readonly DRAFT: "draft";
381
+ readonly OBSOLETE: "obsolete";
163
382
  };
164
383
  /**
165
384
  * @public
166
385
  */
167
- type AssetSource = (typeof AssetSource)[keyof typeof AssetSource];
168
- /**
169
- * An extra aspect ratio variant with independent storage keys for thumbnail,
170
- * preview video, and highlight video. Stored inside video_settings JSONB.
171
- * @public
172
- */
173
- interface RatioVariant {
174
- aspect_ratio: string | undefined;
175
- thumb_storage_key: string | undefined;
176
- video_storage_key: string | undefined;
177
- highlight_video_storage_key?: string | undefined;
178
- }
386
+ type PhonemeControlStatus = (typeof PhonemeControlStatus)[keyof typeof PhonemeControlStatus];
179
387
  /**
388
+ * Resolved phoneme revision attached eagerly to SpeechPart.
180
389
  * @public
181
390
  */
182
- interface VideoCreationSettings$1 {
183
- voice_id?: string | undefined;
184
- duration_ms?: number | undefined;
185
- aspect_ratio?: AspectRatio | undefined;
186
- video_style_id?: string | undefined;
187
- asset_sources?: AssetSource[] | undefined;
188
- recipe_id?: string | undefined;
189
- enable_high_cost_confirm?: boolean | undefined;
190
- user_confirm_cost_threshold?: number | undefined;
391
+ interface PhonemeControlRevisionResolved {
392
+ id: string | undefined;
393
+ speech_part_id: string | undefined;
394
+ revision_no: number | undefined;
395
+ source_script_revision_id: string | undefined;
191
396
  /**
192
- * Extra aspect ratio variants with independent storage keys.
193
- * Each variant carries its own thumbnail, preview video, and optional highlight video.
194
- * Used when a recipe supports multiple aspect ratios (e.g. both 16:9 and 9:16).
397
+ * Typed phoneme payload consumed by FE and MEngine compatibility projections.
195
398
  * @public
196
399
  */
197
- extra_ratios?: RatioVariant[] | undefined;
198
- }
199
- /**
200
- * @public
201
- */
202
- interface TrackItem$1 {
203
- abs_time_position: number | undefined;
204
- part_id: string | undefined;
400
+ content: PhonemeControlContent | undefined;
401
+ status: PhonemeControlStatus | undefined;
402
+ applied_voice_generation_id?: string | undefined;
403
+ created_by?: string | undefined;
404
+ created_at?: Date | undefined;
405
+ /**
406
+ * Legacy read-only projection for round-tripping historical drafts. This
407
+ * is not v29 relation authority.
408
+ * @public
409
+ */
410
+ source_ref?: DslSourceRef | undefined;
205
411
  }
206
412
  /**
207
413
  * @public
208
414
  */
209
- interface Track$1 {
415
+ interface VoiceSummary {
416
+ name: string | undefined;
210
417
  id: string | undefined;
211
- /**
212
- * Types of parts that can be contained in tracks
213
- * @public
214
- */
215
- parts_kind: PartKind$1 | undefined;
216
- is_hidden: boolean | undefined;
217
- items: TrackItem$1[] | undefined;
218
418
  }
219
419
  /**
220
420
  * @public
421
+ * @enum
221
422
  */
222
- interface Attachment {
223
- part_id: string | undefined;
224
- relative_time_position: number | undefined;
225
- }
423
+ declare const SpeechVoiceSyncStatus: {
424
+ readonly PHONEME_CHANGED: "phoneme_changed";
425
+ readonly SCRIPT_CHANGED: "script_changed";
426
+ readonly STALE_PHONEME_CONTROL: "stale_phoneme_control";
427
+ readonly SYNCED: "synced";
428
+ };
226
429
  /**
227
430
  * @public
228
431
  */
229
- interface PartAggregation {
230
- body_part_id: string | undefined;
231
- attachments: Attachment[] | undefined;
232
- }
432
+ type SpeechVoiceSyncStatus = (typeof SpeechVoiceSyncStatus)[keyof typeof SpeechVoiceSyncStatus];
233
433
  /**
234
434
  * @public
235
435
  */
236
- interface BgmPart$1 {
436
+ interface SpeechPart$1 {
237
437
  id: string | undefined;
238
438
  duration_ms: number | undefined;
239
439
  /**
@@ -241,9 +441,65 @@ interface BgmPart$1 {
241
441
  * @public
242
442
  */
243
443
  kind: PartKind$1 | undefined;
244
- audio_storage_key: string | undefined;
444
+ audio_script: string | undefined;
245
445
  volume: number | undefined;
246
- origin_media_id: string | undefined;
446
+ audio_storage_key: string | undefined;
447
+ origin_speech_id: string | undefined;
448
+ /**
449
+ * Voice metadata is absent only when this part projects a recorded raw-audio
450
+ * speech asset. Generated/TTS speech and normal speech assets must still
451
+ * provide a voice; services enforce that distinction before projection.
452
+ * @public
453
+ */
454
+ voice?: VoiceSummary | undefined;
455
+ caption_ids: string[] | undefined;
456
+ /**
457
+ * Optional pronunciation guide for TTS (SSML / Pinyin / etc.).
458
+ * @public
459
+ */
460
+ phoneme_script?: string | undefined;
461
+ /**
462
+ * Current immutable script revision projected into this speech part.
463
+ * @public
464
+ */
465
+ current_script_revision_id?: string | undefined;
466
+ /**
467
+ * Current voice generation projected into this speech part.
468
+ * @public
469
+ */
470
+ current_voice_generation_id?: string | undefined;
471
+ /**
472
+ * Latest phoneme-control revision selected for this speech, if any.
473
+ * @public
474
+ */
475
+ current_phoneme_revision_id?: string | undefined;
476
+ /**
477
+ * Eagerly resolved phoneme-control content. Absent for legacy drafts or
478
+ * when phoneme control has not been generated.
479
+ * @public
480
+ */
481
+ current_phoneme?: PhonemeControlRevisionResolved | undefined;
482
+ /**
483
+ * Derived state of the current script relative to the generated voice.
484
+ * @public
485
+ */
486
+ voice_sync_status?: SpeechVoiceSyncStatus | undefined;
487
+ /**
488
+ * Legacy read-only projection for round-tripping historical drafts. This
489
+ * is not v29 relation authority.
490
+ * @public
491
+ */
492
+ source_ref?: DslSourceRef | undefined;
493
+ /**
494
+ * Audio fade configuration shared by video, BGM, and speech timeline parts.
495
+ * @public
496
+ */
497
+ audio_fade_in?: AudioFade | undefined;
498
+ /**
499
+ * Audio fade configuration shared by video, BGM, and speech timeline parts.
500
+ * @public
501
+ */
502
+ audio_fade_out?: AudioFade | undefined;
247
503
  }
248
504
  /**
249
505
  * @public
@@ -253,11 +509,11 @@ declare const SpeedShiftCategory: {
253
509
  /**
254
510
  * Variable speed controlled by Bezier keyframes
255
511
  */
256
- readonly CURVE: 'curve';
512
+ readonly CURVE: "curve";
257
513
  /**
258
514
  * Constant speed multiplier across the entire clip
259
515
  */
260
- readonly LINEAR: 'linear';
516
+ readonly LINEAR: "linear";
261
517
  };
262
518
  /**
263
519
  * @public
@@ -348,6 +604,16 @@ interface VideoClipPart$1 {
348
604
  volume: number | undefined;
349
605
  origin_media_id: string | undefined;
350
606
  speed_shift?: SpeedShift | undefined;
607
+ /**
608
+ * Optional audio fade-in transport field retained for editor compatibility.
609
+ * @public
610
+ */
611
+ audio_fade_in?: AudioFade | undefined;
612
+ /**
613
+ * Optional audio fade-out transport field retained for editor compatibility.
614
+ * @public
615
+ */
616
+ audio_fade_out?: AudioFade | undefined;
351
617
  }
352
618
  /**
353
619
  * @public
@@ -470,7 +736,8 @@ type VideoClipPart = Omit<VideoClipPart$1, 'duration_ms'>;
470
736
  * from it by the projection.
471
737
  */
472
738
  type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
473
- media_duration_ms?: number | undefined;
739
+ media_duration_ms?: number | undefined; /** Compatibility discriminator for already-recorded Audio projected as speech. */
740
+ origin_asset_system?: 'memota' | undefined;
474
741
  };
475
742
  /**
476
743
  * Authoritative caption part. The IDL `CaptionPart` carries `duration_ms` (the
@@ -482,9 +749,21 @@ type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
482
749
  *
483
750
  * `speech_part_id` / `start_ms` are kept as resource-intrinsic facts (which
484
751
  * speech it was split from, and its offset in that source) — reference/17
485
- * principle 4.
486
- */
752
+ * principle 4. An independently placed Caption (its own Clip and Sequence
753
+ * Marker, no Voice take) has no owning speech: both fields stay unset and its
754
+ * position is expressed entirely by the Clip's placement. Generation source
755
+ * (AudioScript provenance) and Voice alignment are entity Relations, decoupled
756
+ * from this display-side legacy view.
757
+ */
758
+ /** Derived render interval, relative to the placed Caption Clip; never an Entity. */
759
+ interface CaptionDisplayCue {
760
+ segmentId: string;
761
+ text: string;
762
+ startMs: number;
763
+ durationMs: number;
764
+ }
487
765
  type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
766
+ display_cues?: CaptionDisplayCue[];
488
767
  initial_duration_ms?: number | undefined;
489
768
  };
490
769
  /**
@@ -550,6 +829,19 @@ interface Track {
550
829
  is_hidden: boolean | undefined;
551
830
  items: TrackItem[] | undefined;
552
831
  }
832
+ /** The linear speed multiplier of a `speed_shift`, defaulting to 1 (original). */
833
+ declare function speedOf(speedShift: SpeedShift | undefined): number;
834
+ /**
835
+ * A video clip's effective timeline duration, derived from authoritative facts
836
+ * (RFC 02, `reference/16` §4, reference/17 §5): the trim window
837
+ * `play_out - play_in` divided by the speed multiplier, rounded to integer ms.
838
+ * `play_in` / `play_out` are optional in the IDL but every write path sets them
839
+ * (defaulting to the whole media), and the legacy-ingest projection backfills the
840
+ * window from a legacy `duration_ms` — so an authoritative clip always carries a
841
+ * trim window and there is no stored `duration_ms` to fall back to. A clip with
842
+ * neither bound yields 0. Speeds the clip up (>1× → shorter) or down (<1×).
843
+ */
844
+ declare function effectiveVideoClipDurationMs(clip: VideoClipPart): number;
553
845
  /**
554
846
  * Authoritative part union: a flat discriminated union over the four part kinds.
555
847
  * Deliberately *not* the IDL's namespace union (no `$unknown` / `visit`): engine
@@ -676,38 +968,216 @@ interface Timeline {
676
968
  */
677
969
  declare const DEFAULT_UNIT_TIME_MS = 33.333;
678
970
  /**
679
- * Authoritative collaborative document: only facts. Positioning lives on each
680
- * `TrackItem.time_position`; absolute time, `part_aggregations`, and total
681
- * duration are derived in the `VideoDraft` projection, not stored here (RFC 02 §6).
971
+ * Authoritative collaborative document: only facts. Positioning lives on each
972
+ * `TrackItem.time_position`; absolute time, `part_aggregations`, and total
973
+ * duration are derived in the `VideoDraft` projection, not stored here (RFC 02 §6).
974
+ *
975
+ * The content mirrors Loro storage: timeline, part library, and a single
976
+ * ordered `tracks` list (reference/17 §4). Business metadata stays in Director. A
977
+ * track's lane is expressed by its `parts_kind`, not by which container it lives
978
+ * in — the `main` / `above` / `below` three-pane view is reconstructed at
979
+ * projection time. Order is the list order itself, so there is no `lane` /
980
+ * `lane_order` field to diverge under concurrent edits.
981
+ */
982
+ interface VideoDocument {
983
+ timeline: Timeline | undefined;
984
+ tracks: Track[] | undefined;
985
+ part_library: Record<string, PartUnion> | undefined;
986
+ }
987
+ type VideoDocumentValidationIssueCode = 'invalid_schema' | 'duplicate_track_item_identity' | 'duplicate_lane_track' | 'unknown_part_kind' | 'part_kind_mismatch' | 'missing_part_reference' | 'track_kind_mismatch' | 'main_track_non_video_clip' | 'invalid_part_value' | 'invalid_speech_caption_reference' | 'invalid_position_anchor';
988
+ /**
989
+ * Issue severity (RFC 02 §11.1). `error` is a hard reject — the document is not
990
+ * a legal `VideoDocument` and must not be projected. `recoverable` marks a
991
+ * business inconsistency the projection is designed to heal on read (currently
992
+ * only a dangling `anchorPartId`: the orphan condition, recovered via the item's
993
+ * `fallback_abs_ms` snapshot + cascade reassign), so it is surfaced for
994
+ * observability but does NOT block projection. Absent `severity` means `error`.
995
+ */
996
+ type VideoDocumentValidationIssueSeverity = 'error' | 'recoverable';
997
+ interface VideoDocumentValidationIssue {
998
+ code: VideoDocumentValidationIssueCode;
999
+ path: string;
1000
+ message: string;
1001
+ severity?: VideoDocumentValidationIssueSeverity;
1002
+ }
1003
+ //#endregion
1004
+ //#region src/document/mirror-schema.d.ts
1005
+ declare const videoDocumentMirrorSchema: import("loro-mirror").RootSchemaType<{
1006
+ timeline: import("loro-mirror").LoroMapSchema<{
1007
+ unit_time_ms: /*elided*/any;
1008
+ }> & {
1009
+ options: {};
1010
+ } & {
1011
+ catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
1012
+ unit_time_ms: /*elided*/any;
1013
+ }, C>;
1014
+ };
1015
+ tracks: import("loro-mirror").LoroMovableListSchema<import("loro-mirror").LoroMapSchema<{
1016
+ id: /*elided*/any;
1017
+ parts_kind: /*elided*/any;
1018
+ is_hidden: /*elided*/any;
1019
+ items: /*elided*/any;
1020
+ }> & {
1021
+ options: {};
1022
+ } & {
1023
+ catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
1024
+ id: /*elided*/any;
1025
+ parts_kind: /*elided*/any;
1026
+ is_hidden: /*elided*/any;
1027
+ items: /*elided*/any;
1028
+ }, C>;
1029
+ }> & {
1030
+ options: {};
1031
+ };
1032
+ part_library: import("loro-mirror").LoroMapSchemaWithCatchall<{}, import("loro-mirror").LoroMapSchema<{
1033
+ video_clip: /*elided*/any;
1034
+ speech: /*elided*/any;
1035
+ caption: /*elided*/any;
1036
+ bgm: /*elided*/any;
1037
+ }> & {
1038
+ options: {};
1039
+ } & {
1040
+ catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
1041
+ video_clip: /*elided*/any;
1042
+ speech: /*elided*/any;
1043
+ caption: /*elided*/any;
1044
+ bgm: /*elided*/any;
1045
+ }, C>;
1046
+ }> & {
1047
+ options: {};
1048
+ };
1049
+ }> & {
1050
+ options: {};
1051
+ };
1052
+ type VideoDocumentMirrorSchema = typeof videoDocumentMirrorSchema;
1053
+ /**
1054
+ * The mutable draft an op's `transact` callback edits, inferred from the schema.
1055
+ *
1056
+ * `InferInputType` is the schema's *input* shape: the declared business fields
1057
+ * with the `$cid` container ids (which mirror injects into its output
1058
+ * `InferType`) made optional, so ops assign plain objects without supplying
1059
+ * `$cid`. Deriving it from the schema keeps draft and storage in lockstep — a
1060
+ * schema change is a compile error at every edit site, not a silent drift.
1061
+ * Reorders within `items` still diff to real Loro `move` ops because the schema
1062
+ * keys items by `part_id`.
1063
+ */
1064
+ type VideoDocumentDraft = InferInputType<VideoDocumentMirrorSchema>;
1065
+ /** Track value as it appears in a draft. Derived from the single `tracks` movable list. */
1066
+ type TrackDraft = NonNullable<NonNullable<VideoDocumentDraft['tracks']>[number]>;
1067
+ /** A single track item in a draft. */
1068
+ type TrackItemDraft = NonNullable<NonNullable<TrackDraft['items']>[number]>;
1069
+ //#endregion
1070
+ //#region src/timeline-core/bridge.d.ts
1071
+ /**
1072
+ * Bridge between the authoritative `VideoDocument` (position-only facts) and the
1073
+ * flat `TimelineDoc` the cascade primitives solve over.
1074
+ *
1075
+ * The data flow is single-directional (RFC 02 §7/§10): ops write only facts
1076
+ * (`time_position`, parts) to `VideoDocument`; absolute time, `part_aggregations`,
1077
+ * total duration, and gap fillers are NOT stored — the projection derives them
1078
+ * on read by running the cascade. There is no write-back of solved positions.
1079
+ *
1080
+ * - `solveVideoDocument` seeds a `TimelineDoc` from each item's `time_position`,
1081
+ * runs the full cascade, and returns the derived read-view (abs / aggregations
1082
+ * / duration). It is the single solve shared by the legacy `VideoDraft`
1083
+ * projection.
1084
+ * - `ensureLaneTrack` / `findLaneTrack` locate (or mint) a secondary lane's
1085
+ * track row in the draft, so ops can write authoritative facts onto the right
1086
+ * named container (lane = container).
1087
+ */
1088
+ /** The projection-derived read-view of a `VideoDocument` (RFC 02 §7). */
1089
+ interface SolvedVideoDocument {
1090
+ absByPartId: Map<string, number>;
1091
+ aggregations: PartAggregation[];
1092
+ durationMs: number;
1093
+ partLibrary: Record<string, PartUnion>;
1094
+ /**
1095
+ * Part ids of the gap fillers this solve minted.
1096
+ *
1097
+ * They exist only inside the solve: gap filling needs them so the clips after a
1098
+ * gap land at the right absolute time, but they are not authoritative state and
1099
+ * the read view does not carry them (see `fromVideoDocument`).
1100
+ *
1101
+ * Reported as ids rather than left for the caller to detect, because the caller
1102
+ * *cannot* detect them. The obvious predicate — `origin_media_id === ''` — also
1103
+ * matches an empty clip a writer placed on purpose (`batch_replace_video_clip_sequence`
1104
+ * documents "Omit to create an empty clip placeholder"), and those are
1105
+ * authoritative parts that must survive the projection. The mint callback is the
1106
+ * only place that knows the difference.
1107
+ *
1108
+ * Note this deliberately excludes the fillers that gap filling *extended* rather
1109
+ * than minted (`fillMainTrackTimeGaps` cases 1 and 2): those are authoritative
1110
+ * empty clips already in `part_library`, and only their length is derived.
1111
+ */
1112
+ derivedFillerPartIds: Set<string>;
1113
+ }
1114
+ /** How the caller obtained the document it is asking to be solved. */
1115
+ interface SolveVideoDocumentOptions {
1116
+ /**
1117
+ * The producer already resolved every placement, so the legacy cascade must
1118
+ * not run. Only an Entity projection can state this: its placement comes from
1119
+ * Clip order / clip-anchor offsets / Marker targetRange, and re-solving would
1120
+ * overwrite those and synthesize gap fillers the Entity graph never had.
1121
+ *
1122
+ * The document itself no longer carries its provenance (P7M14 moved business
1123
+ * metadata out of the CRDT), so the caller states it. `hasResolvedPlacement`
1124
+ * only verifies the claim — it is never the branch condition, because a
1125
+ * legacy draft can satisfy it by accident and a broken projection can fail it.
1126
+ */
1127
+ readonly placementResolved?: boolean;
1128
+ }
1129
+ /**
1130
+ * Solve a `VideoDocument` (authoritative, position-only) into its derived
1131
+ * read-view: absolute time per item, `part_aggregations`, and total duration.
1132
+ * This is the read side of the single-directional flow — never written back.
1133
+ */
1134
+ declare function solveVideoDocument(document: VideoDocument, options?: SolveVideoDocumentOptions): SolvedVideoDocument;
1135
+ /** The named container a secondary lane lives in. */
1136
+ type SecondaryLane = 'speech' | 'caption' | 'bgm';
1137
+ /** A lane's track kind: the `video_clip` main lane plus the three secondary lanes. */
1138
+ type LaneKind = SecondaryLane | 'video_clip';
1139
+ /**
1140
+ * The four lanes in top-to-bottom stack order — the order a `tracks` list holds
1141
+ * them in (see {@link laneRank}).
1142
+ *
1143
+ * Exported so a document can be seeded with all four lanes up front. That seed is
1144
+ * not cosmetic: {@link ensureLaneTrack} is find-then-mint over a `LoroMovableList`,
1145
+ * so two concurrent writers that each mint the same absent lane both keep their
1146
+ * row, and the merged document holds two tracks for one lane. For the main lane
1147
+ * that is fatal — `videoDocumentSchema` allows at most one `video_clip` track, so
1148
+ * the merged document stops being projectable at all, symmetrically on both
1149
+ * replicas. Pre-seeding every lane makes `ensureLaneTrack` always take its find
1150
+ * branch, which removes the race by construction rather than by detection.
1151
+ *
1152
+ * What closes the race is that a track with the lane's `parts_kind` EXISTS — the
1153
+ * lookup is by kind, not by id. So a seed is only safe if it covers every lane:
1154
+ * a partial seed leaves the uncovered lanes exactly as exposed as before.
1155
+ */
1156
+ declare const LANE_KINDS_IN_STACK_ORDER: readonly LaneKind[];
1157
+ /**
1158
+ * The conventional track id for a lane (`main_track`, `<kind>_track`). Shared by
1159
+ * the up-front seed and {@link ensureLaneTrack}'s lazy mint so a document's lane
1160
+ * ids do not depend on which of the two created the track.
682
1161
  *
683
- * The content mirrors Loro storage: timeline, part library, and a single
684
- * ordered `tracks` list (reference/17 §4). Business metadata stays in Director. A
685
- * track's lane is expressed by its `parts_kind`, not by which container it lives
686
- * in — the `main` / `above` / `below` three-pane view is reconstructed at
687
- * projection time. Order is the list order itself, so there is no `lane` /
688
- * `lane_order` field to diverge under concurrent edits.
1162
+ * Ids are cosmetic to the merge itself — lane lookup goes by `parts_kind`, so
1163
+ * drifting them apart would not reopen the concurrent-mint race. They matter to
1164
+ * readers that address a lane by id (the FE editor's panes, fixtures), which is
1165
+ * why there is one convention rather than two.
689
1166
  */
690
- interface VideoDocument {
691
- timeline: Timeline | undefined;
692
- tracks: Track[] | undefined;
693
- part_library: Record<string, PartUnion> | undefined;
694
- }
695
- type VideoDocumentValidationIssueCode = 'invalid_schema' | 'duplicate_track_item_identity' | 'duplicate_lane_track' | 'unknown_part_kind' | 'part_kind_mismatch' | 'missing_part_reference' | 'track_kind_mismatch' | 'main_track_non_video_clip' | 'invalid_part_value' | 'invalid_speech_caption_reference' | 'invalid_position_anchor';
1167
+ declare function laneTrackId(kind: LaneKind): string;
696
1168
  /**
697
- * Issue severity (RFC 02 §11.1). `error` is a hard reject — the document is not
698
- * a legal `VideoDocument` and must not be projected. `recoverable` marks a
699
- * business inconsistency the projection is designed to heal on read (currently
700
- * only a dangling `anchorPartId`: the orphan condition, recovered via the item's
701
- * `fallback_abs_ms` snapshot + cascade reassign), so it is surfaced for
702
- * observability but does NOT block projection. Absent `severity` means `error`.
1169
+ * Locate a lane's track row in the single `tracks` list by kind, minting an empty
1170
+ * row in lane-stacking order if absent (reference/17 §4: lane = `parts_kind`).
1171
+ * Ops use this to write authoritative items onto the right lane. The track id
1172
+ * comes from {@link laneTrackId}, shared with the up-front seed.
1173
+ *
1174
+ * The mint branch is a concurrency hazard, not a convenience: see
1175
+ * {@link LANE_KINDS_IN_STACK_ORDER}. A document seeded with all four lanes never
1176
+ * reaches it.
703
1177
  */
704
- type VideoDocumentValidationIssueSeverity = 'error' | 'recoverable';
705
- interface VideoDocumentValidationIssue {
706
- code: VideoDocumentValidationIssueCode;
707
- path: string;
708
- message: string;
709
- severity?: VideoDocumentValidationIssueSeverity;
710
- }
1178
+ declare function ensureLaneTrack(draft: VideoDocumentDraft, kind: LaneKind): TrackDraft;
1179
+ /** Find a secondary lane's track row without minting it. */
1180
+ declare function findLaneTrack(draft: VideoDocumentDraft, kind: SecondaryLane): TrackDraft | undefined;
711
1181
  //#endregion
712
1182
  //#region src/document/projection.d.ts
713
1183
  /**
@@ -787,7 +1257,7 @@ declare function derivePositionFromAbs(partId: string, abs: number, isMain: bool
787
1257
  * here — it belongs to Director assembly using the server envelope update_seq.
788
1258
  * Neither business metadata nor a revision counter belongs in content projection.
789
1259
  */
790
- declare function fromVideoDocument(document: VideoDocument): VideoDraftContent;
1260
+ declare function fromVideoDocument(document: VideoDocument, options?: SolveVideoDocumentOptions): VideoDraftContent;
791
1261
  //#endregion
792
1262
  //#region src/document/initial-document.d.ts
793
1263
  /**
@@ -815,6 +1285,165 @@ declare function fromVideoDocument(document: VideoDocument): VideoDraftContent;
815
1285
  */
816
1286
  declare function buildInitialVideoDocument(): VideoDocument;
817
1287
  //#endregion
1288
+ //#region ../medeo-dsl/src/sandbox.d.ts
1289
+ /** Kinds a script can author. */
1290
+ type EntityKind = 'timeline' | 'track' | 'clip' | 'sequence-marker' | 'video' | 'audio' | 'voiceover-recording' | 'image' | 'voice' | 'script' | 'audio-script' | 'phonetic-script' | 'caption';
1291
+ type RelationKind = 'contain' | 'marker' | 'clip-anchor' | 'voice-timbre' | 'caption-alignment' | 'derived-from';
1292
+ //#endregion
1293
+ //#region ../medeo-dsl/src/ids.d.ts
1294
+ declare const entityIdBrand: unique symbol;
1295
+ declare const relationIdBrand: unique symbol;
1296
+ type EntityId = string & {
1297
+ readonly [entityIdBrand]: 'EntityId';
1298
+ };
1299
+ type RelationId = string & {
1300
+ readonly [relationIdBrand]: 'RelationId';
1301
+ };
1302
+ //#endregion
1303
+ //#region ../medeo-dsl/src/json-values.d.ts
1304
+ type JsonPrimitive = string | number | boolean | null;
1305
+ type JsonValue = JsonPrimitive | JsonObject | readonly JsonValue[];
1306
+ type JsonObject = {
1307
+ readonly [key: string]: JsonValue;
1308
+ };
1309
+ //#endregion
1310
+ //#region ../medeo-dsl/src/entities.d.ts
1311
+ type StoredEntityKind = EntityKind | 'asset';
1312
+ declare const extensionEntityKindBrand: unique symbol;
1313
+ type ExtensionEntityKind = string & {
1314
+ readonly [extensionEntityKindBrand]: 'ExtensionEntityKind';
1315
+ };
1316
+ /** Extensions require explicit branding so removed or reserved domain kinds cannot reappear accidentally. */
1317
+ type AnyEntityKind = StoredEntityKind | ExtensionEntityKind;
1318
+ interface ScriptTextSegment {
1319
+ readonly segmentId: string;
1320
+ readonly text: string;
1321
+ readonly language?: string;
1322
+ }
1323
+ interface VoiceDescriptor {
1324
+ readonly system: 'voice-library';
1325
+ readonly key: string;
1326
+ readonly name?: string;
1327
+ }
1328
+ interface CaptionFontDescriptor {
1329
+ readonly system: 'font-library';
1330
+ readonly key: string;
1331
+ }
1332
+ interface CaptionStyleFields {
1333
+ readonly font?: CaptionFontDescriptor;
1334
+ readonly fontSize?: number;
1335
+ readonly fontColor?: string;
1336
+ readonly fontWeight?: number;
1337
+ readonly entranceAnimation?: string;
1338
+ readonly entranceAnimationDurationMs?: number;
1339
+ readonly strokeColor?: string;
1340
+ readonly strokeWidth?: number;
1341
+ readonly positionX?: number;
1342
+ readonly positionY?: number;
1343
+ }
1344
+ /**
1345
+ * Half-open `[start, end)` position window inside one Segment's text, counted
1346
+ * in Unicode code points (not UTF-16 code units), so a boundary never splits a
1347
+ * surrogate pair. Positions are non-negative safe integers with `start < end`;
1348
+ * `end` must not exceed the Segment's code-point length.
1349
+ */
1350
+ interface CaptionTextRange extends JsonObject {
1351
+ readonly start: number;
1352
+ readonly end: number;
1353
+ }
1354
+ /**
1355
+ * The Caption's single text selection. `segmentId` quotes the
1356
+ * composed AudioScript's own stable segment identity — a local id quoted by the
1357
+ * variant, never a peer Entity reference. Text itself is never copied here;
1358
+ * complete Caption content is assembled through its direct baseEntityIds.
1359
+ * The optional `textRange` narrows one Segment to an intra-Segment sub-span
1360
+ * (intra-segment re-segmentation); without it the whole Segment text is selected.
1361
+ */
1362
+ type CaptionSegmentSelection = JsonObject & {
1363
+ readonly segmentId: string;
1364
+ readonly textRange?: CaptionTextRange;
1365
+ };
1366
+ //#endregion
1367
+ //#region ../medeo-dsl/src/relations.d.ts
1368
+ type StoredRelationKind = RelationKind | 'from-asset' | 'to-asset';
1369
+ type AnyRelationKind = StoredRelationKind | (string & {});
1370
+ type RelationTrace = JsonObject;
1371
+ /**
1372
+ * Authoritative persisted relation value.
1373
+ *
1374
+ * A kind may assign semantic roles to endpoint 0 and endpoint 1. Callers and
1375
+ * storage adapters must preserve the submitted positions; kinds whose
1376
+ * semantics are unordered simply do not interpret those positions.
1377
+ */
1378
+ interface RelationRow<K extends AnyRelationKind = AnyRelationKind, Metadata extends JsonObject = JsonObject> {
1379
+ readonly relationId: RelationId;
1380
+ readonly endpoint0EntityId: EntityId;
1381
+ readonly endpoint1EntityId: EntityId;
1382
+ readonly relationKind: K;
1383
+ readonly metadata: Metadata;
1384
+ readonly trace: RelationTrace;
1385
+ }
1386
+ //#endregion
1387
+ //#region ../medeo-dsl/src/rows.d.ts
1388
+ /** One persisted first-class entity. Its owned fields live directly in payload. */
1389
+ interface EntityRow<K extends AnyEntityKind = AnyEntityKind> {
1390
+ readonly entityId: EntityId;
1391
+ readonly entityKind: K;
1392
+ readonly payload: JsonObject;
1393
+ }
1394
+ /** Complete persistence value for an entity set and its authoritative relations. */
1395
+ interface EntityRelationRows {
1396
+ readonly entities: readonly EntityRow[];
1397
+ readonly relations: readonly RelationRow[];
1398
+ }
1399
+ //#endregion
1400
+ //#region src/document/entity-projection-values.d.ts
1401
+ /** A graph cannot be represented faithfully by the compatibility reader. */
1402
+ declare class EntityTimelineProjectionError extends Error {
1403
+ constructor(message: string);
1404
+ }
1405
+ //#endregion
1406
+ //#region src/document/entity-projection.d.ts
1407
+ /**
1408
+ * One-way compatibility view over the Entity graph. A legacy part is never
1409
+ * consulted as an editing fact. Peer IDs appear only in this derived read
1410
+ * contract, reconstructed from relations; they are not stored in payloads.
1411
+ */
1412
+ declare function projectEntityTimeline(rows: EntityRelationRows): VideoDocument;
1413
+ //#endregion
1414
+ //#region src/document/entity-timeline-layout.d.ts
1415
+ type EntityTimelineTrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
1416
+ interface ResolvedEntityClipPlacement {
1417
+ readonly clipEntityId: string;
1418
+ readonly markerEntityId: string;
1419
+ readonly contentEntityId: string;
1420
+ readonly trackEntityId: string;
1421
+ readonly start: number;
1422
+ readonly duration: number;
1423
+ readonly mode: 'sequential' | 'absolute' | 'anchored';
1424
+ readonly anchorClipEntityId?: string;
1425
+ readonly anchorOffset?: number;
1426
+ }
1427
+ interface ResolvedEntityTrack {
1428
+ readonly entityId: string;
1429
+ readonly role: EntityTimelineTrackRole;
1430
+ readonly order: number;
1431
+ readonly hidden: boolean;
1432
+ readonly clips: readonly ResolvedEntityClipPlacement[];
1433
+ }
1434
+ interface ResolvedEntityTimelineLayout {
1435
+ readonly tracks: readonly ResolvedEntityTrack[];
1436
+ readonly clips: ReadonlyMap<string, ResolvedEntityClipPlacement>;
1437
+ /** Background music fills this duration; it never extends the timeline. */
1438
+ readonly durationMs: number;
1439
+ }
1440
+ /**
1441
+ * Resolve only entity-owned placement facts. This does not choose new anchors,
1442
+ * manufacture clips, or mutate a graph while reading. Write-side operations
1443
+ * must express any detach/reparent/overlap decision in their entity plan.
1444
+ */
1445
+ declare function resolveEntityTimelineLayout(rows: EntityRelationRows): ResolvedEntityTimelineLayout;
1446
+ //#endregion
818
1447
  //#region src/document/validation.d.ts
819
1448
  /**
820
1449
  * Business-level schema guard for `VideoDocument` (RFC 03 §9). It is the gate
@@ -843,677 +1472,35 @@ declare class VideoDocumentValidationError extends Error {
843
1472
  declare function assertValidVideoDocument(document: unknown): asserts document is VideoDocument;
844
1473
  declare function validateVideoDocument(document: unknown): VideoDocumentValidationIssue[];
845
1474
  //#endregion
846
- //#region src/document/mirror-schema.d.ts
847
- declare const videoDocumentMirrorSchema: import("loro-mirror").RootSchemaType<{
848
- timeline: import("loro-mirror").LoroMapSchema<{
849
- unit_time_ms: /*elided*/any;
850
- }> & {
851
- options: {};
852
- } & {
853
- catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
854
- unit_time_ms: /*elided*/any;
855
- }, C>;
856
- };
857
- tracks: import("loro-mirror").LoroMovableListSchema<import("loro-mirror").LoroMapSchema<{
858
- id: /*elided*/any;
859
- parts_kind: /*elided*/any;
860
- is_hidden: /*elided*/any;
861
- items: /*elided*/any;
862
- }> & {
863
- options: {};
864
- } & {
865
- catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
866
- id: /*elided*/any;
867
- parts_kind: /*elided*/any;
868
- is_hidden: /*elided*/any;
869
- items: /*elided*/any;
870
- }, C>;
871
- }> & {
872
- options: {};
873
- };
874
- part_library: import("loro-mirror").LoroMapSchemaWithCatchall<{}, import("loro-mirror").LoroMapSchema<{
875
- video_clip: /*elided*/any;
876
- speech: /*elided*/any;
877
- caption: /*elided*/any;
878
- bgm: /*elided*/any;
879
- }> & {
880
- options: {};
881
- } & {
882
- catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
883
- video_clip: /*elided*/any;
884
- speech: /*elided*/any;
885
- caption: /*elided*/any;
886
- bgm: /*elided*/any;
887
- }, C>;
888
- }> & {
889
- options: {};
890
- };
891
- }> & {
892
- options: {};
893
- };
894
- type VideoDocumentMirrorSchema = typeof videoDocumentMirrorSchema;
895
- /**
896
- * The mutable draft an op's `transact` callback edits, inferred from the schema.
897
- *
898
- * `InferInputType` is the schema's *input* shape: the declared business fields
899
- * with the `$cid` container ids (which mirror injects into its output
900
- * `InferType`) made optional, so ops assign plain objects without supplying
901
- * `$cid`. Deriving it from the schema keeps draft and storage in lockstep — a
902
- * schema change is a compile error at every edit site, not a silent drift.
903
- * Reorders within `items` still diff to real Loro `move` ops because the schema
904
- * keys items by `part_id`.
905
- */
906
- type VideoDocumentDraft = InferInputType<VideoDocumentMirrorSchema>;
907
- /** Track value as it appears in a draft. Derived from the single `tracks` movable list. */
908
- type TrackDraft = NonNullable<NonNullable<VideoDocumentDraft['tracks']>[number]>;
909
- /** A single track item in a draft. */
910
- type TrackItemDraft = NonNullable<NonNullable<TrackDraft['items']>[number]>;
911
- //#endregion
912
- //#region src/editor/schemas/add-speeches.d.ts
913
- /**
914
- * Add speeches (and their captions). TTS runs upstream; the stable speech /
915
- * caption parts arrive materialized (see `speech-assets.ts`). The op writes the
916
- * parts and each speech's `{ mode:'anchored', anchorPartId, offsetMs }` fact
917
- * verbatim — no write-time host-picking, no cascade (RFC 02 §4). The projection
918
- * derives absolute positions on read.
919
- */
920
- declare const addSpeechesInputSchema: z.ZodObject<{
921
- speeches: z.ZodArray<z.ZodObject<{
922
- speech_id: z.ZodString;
923
- anchor_part_id: z.ZodString;
924
- offset_ms: z.ZodNumber;
925
- audio_storage_key: z.ZodString;
926
- duration_ms: z.ZodNumber;
927
- audio_script: z.ZodString;
928
- volume: z.ZodNumber;
929
- voice: z.ZodObject<{
930
- id: z.ZodString;
931
- name: z.ZodString;
932
- }, z.core.$strip>;
933
- origin_speech_id: z.ZodString;
934
- caption_ids: z.ZodArray<z.ZodString>;
935
- }, z.core.$strip>>;
936
- captions: z.ZodArray<z.ZodObject<{
937
- caption_id: z.ZodString;
938
- speech_part_id: z.ZodString;
939
- text: z.ZodString;
940
- start_ms: z.ZodNumber;
941
- duration_ms: z.ZodNumber;
942
- }, z.core.$strip>>;
943
- }, z.core.$strip>;
944
- type AddSpeechesInput = z.infer<typeof addSpeechesInputSchema>;
945
- //#endregion
946
- //#region src/editor/schemas/add-video-clips.d.ts
947
- /**
948
- * Add video clips to a track. Each clip's duration facts are separated so a
949
- * single number is never overloaded (RFC 02 / `reference/16` §0b):
950
- *
951
- * - `media_duration_ms` is the source media's intrinsic full length (a resource
952
- * fact, written to the part);
953
- * - `play_in` / `play_out` are the optional trim window into that media; when
954
- * omitted the whole media is used (`play_in=0`, `play_out=media_duration_ms`).
955
- *
956
- * The clip's effective timeline duration is derived by the projection from the
957
- * trim window and `speed_shift` — it is never an input here.
958
- */
959
- declare const addVideoClipsInputSchema: z.ZodObject<{
960
- clips: z.ZodArray<z.ZodObject<{
961
- media_id: z.ZodString;
962
- start_ms: z.ZodOptional<z.ZodNumber>;
963
- media_duration_ms: z.ZodNumber;
964
- play_in: z.ZodOptional<z.ZodNumber>;
965
- play_out: z.ZodOptional<z.ZodNumber>;
966
- track_id: z.ZodOptional<z.ZodString>;
967
- }, z.core.$strip>>;
968
- before_clip_id: z.ZodOptional<z.ZodString>;
969
- after_clip_id: z.ZodOptional<z.ZodString>;
970
- }, z.core.$strip>;
971
- type AddVideoClipsInput = z.infer<typeof addVideoClipsInputSchema>;
972
- //#endregion
973
- //#region src/editor/schemas/adjust-bgm-volume.d.ts
974
- declare const adjustBgmVolumeInputSchema: z.ZodObject<{
975
- bgm: z.ZodArray<z.ZodObject<{
976
- bgm_id: z.ZodString;
977
- volume: z.ZodNumber;
978
- }, z.core.$strip>>;
979
- }, z.core.$strip>;
980
- type AdjustBgmVolumeInput = z.infer<typeof adjustBgmVolumeInputSchema>;
981
- //#endregion
982
- //#region src/editor/schemas/adjust-speech-volume.d.ts
983
- declare const adjustSpeechVolumeInputSchema: z.ZodObject<{
984
- speeches: z.ZodArray<z.ZodObject<{
985
- speech_id: z.ZodString;
986
- volume: z.ZodNumber;
987
- }, z.core.$strip>>;
988
- }, z.core.$strip>;
989
- type AdjustSpeechVolumeInput = z.infer<typeof adjustSpeechVolumeInputSchema>;
990
- //#endregion
991
- //#region src/editor/schemas/adjust-video-clip-duration.d.ts
992
- /**
993
- * Re-trim existing video clips (the user-facing "adjust duration" gesture is a
994
- * trim of the source window). The new `play_in` / `play_out` are the facts; the
995
- * effective timeline duration is derived from them and the clip's `speed_shift`,
996
- * and the change reflows downstream clips, speeches, and the timeline inside the
997
- * op's transaction (no caller-materialized cascade).
998
- */
999
- declare const adjustVideoClipDurationInputSchema: z.ZodObject<{
1000
- clips: z.ZodArray<z.ZodObject<{
1001
- clip_id: z.ZodString;
1002
- play_in: z.ZodNumber;
1003
- play_out: z.ZodNumber;
1004
- }, z.core.$strip>>;
1005
- }, z.core.$strip>;
1006
- type AdjustVideoClipDurationInput = z.infer<typeof adjustVideoClipDurationInputSchema>;
1007
- //#endregion
1008
- //#region src/editor/schemas/adjust-video-clip-volume.d.ts
1009
- declare const adjustVideoClipVolumeInputSchema: z.ZodObject<{
1010
- clips: z.ZodArray<z.ZodObject<{
1011
- clip_id: z.ZodString;
1012
- volume: z.ZodNumber;
1013
- }, z.core.$strip>>;
1014
- }, z.core.$strip>;
1015
- type AdjustVideoClipVolumeInput = z.infer<typeof adjustVideoClipVolumeInputSchema>;
1016
- //#endregion
1017
- //#region src/editor/schemas/change-speech.d.ts
1018
- /**
1019
- * Change a speech's script or voice. Both re-run TTS upstream and return the
1020
- * regenerated speech / caption parts in the same materialized shape as
1021
- * `AddSpeeches` (`speech-assets.ts`); the op upserts them by id (the speech part
1022
- * id is preserved across a re-TTS), re-seats at `start_ms`, and reflows. Old
1023
- * caption parts no longer owned by the speech are removed via `caption_ids`.
1024
- */
1025
- declare const changeSpeechScriptInputSchema: z.ZodObject<{
1026
- speeches: z.ZodArray<z.ZodObject<{
1027
- speech_id: z.ZodString;
1028
- anchor_part_id: z.ZodString;
1029
- offset_ms: z.ZodNumber;
1030
- audio_storage_key: z.ZodString;
1031
- duration_ms: z.ZodNumber;
1032
- audio_script: z.ZodString;
1033
- volume: z.ZodNumber;
1034
- voice: z.ZodObject<{
1035
- id: z.ZodString;
1036
- name: z.ZodString;
1037
- }, z.core.$strip>;
1038
- origin_speech_id: z.ZodString;
1039
- caption_ids: z.ZodArray<z.ZodString>;
1040
- }, z.core.$strip>>;
1041
- captions: z.ZodArray<z.ZodObject<{
1042
- caption_id: z.ZodString;
1043
- speech_part_id: z.ZodString;
1044
- text: z.ZodString;
1045
- start_ms: z.ZodNumber;
1046
- duration_ms: z.ZodNumber;
1047
- }, z.core.$strip>>;
1048
- }, z.core.$strip>;
1049
- declare const changeSpeechVoiceInputSchema: z.ZodObject<{
1050
- speeches: z.ZodArray<z.ZodObject<{
1051
- speech_id: z.ZodString;
1052
- anchor_part_id: z.ZodString;
1053
- offset_ms: z.ZodNumber;
1054
- audio_storage_key: z.ZodString;
1055
- duration_ms: z.ZodNumber;
1056
- audio_script: z.ZodString;
1057
- volume: z.ZodNumber;
1058
- voice: z.ZodObject<{
1059
- id: z.ZodString;
1060
- name: z.ZodString;
1061
- }, z.core.$strip>;
1062
- origin_speech_id: z.ZodString;
1063
- caption_ids: z.ZodArray<z.ZodString>;
1064
- }, z.core.$strip>>;
1065
- captions: z.ZodArray<z.ZodObject<{
1066
- caption_id: z.ZodString;
1067
- speech_part_id: z.ZodString;
1068
- text: z.ZodString;
1069
- start_ms: z.ZodNumber;
1070
- duration_ms: z.ZodNumber;
1071
- }, z.core.$strip>>;
1072
- }, z.core.$strip>;
1073
- type ChangeSpeechScriptInput = z.infer<typeof changeSpeechScriptInputSchema>;
1074
- type ChangeSpeechVoiceInput = z.infer<typeof changeSpeechVoiceInputSchema>;
1075
- //#endregion
1076
- //#region src/editor/schemas/delete-bgm.d.ts
1077
- /**
1078
- * Remove the document BGM. Pure document edit: clears the bgm lane and removes
1079
- * the bgm part. Takes no input (a document holds at most one bgm); an empty
1080
- * object keeps the op signature uniform with the rest.
1081
- */
1082
- declare const deleteBgmInputSchema: z.ZodObject<{}, z.core.$strip>;
1083
- type DeleteBgmInput = z.infer<typeof deleteBgmInputSchema>;
1084
- //#endregion
1085
- //#region src/editor/schemas/delete-speeches.d.ts
1086
- /**
1087
- * Delete speeches with their captions. Pure document edit (no side effect): the
1088
- * op removes each speech part, cascade-deletes the captions it owns (via
1089
- * `caption_ids` / `speech_part_id`), drops their track items, and reflows.
1090
- */
1091
- declare const deleteSpeechesInputSchema: z.ZodObject<{
1092
- speech_ids: z.ZodArray<z.ZodString>;
1093
- }, z.core.$strip>;
1094
- type DeleteSpeechesInput = z.infer<typeof deleteSpeechesInputSchema>;
1095
- //#endregion
1096
- //#region src/editor/schemas/delete-video-clips.d.ts
1097
- /**
1098
- * How a delete handles the anchored subtree (speeches anchored to a deleted clip,
1099
- * and their captions) — a delete-op policy, not a data-model field (reference/17
1100
- * §6). `cascade` (default) removes the subtree; `detach` keeps the direct
1101
- * anchored children, re-pinning them to `absolute` so they stay on the timeline.
1102
- */
1103
- declare const anchoredDeletePolicySchema: z.ZodEnum<{
1104
- cascade: "cascade";
1105
- detach: "detach";
1106
- }>;
1107
- type AnchoredDeletePolicy = z.infer<typeof anchoredDeletePolicySchema>;
1108
- declare const deleteVideoClipsInputSchema: z.ZodObject<{
1109
- clip_ids: z.ZodArray<z.ZodString>;
1110
- on_anchored: z.ZodOptional<z.ZodEnum<{
1111
- cascade: "cascade";
1112
- detach: "detach";
1113
- }>>;
1114
- }, z.core.$strip>;
1115
- type DeleteVideoClipsInput = z.infer<typeof deleteVideoClipsInputSchema>;
1116
- //#endregion
1117
- //#region src/editor/schemas/move-speeches.d.ts
1118
- /**
1119
- * Move speeches in time. Pure document edit: the op re-seats each speech at its
1120
- * new absolute `start_ms`; the cascade reassigns it to the host video clip,
1121
- * resolves overlaps, and reflows. Captions follow their speech.
1122
- */
1123
- declare const moveSpeechesInputSchema: z.ZodObject<{
1124
- speeches: z.ZodArray<z.ZodObject<{
1125
- speech_id: z.ZodString;
1126
- new_start_ms: z.ZodNumber;
1127
- }, z.core.$strip>>;
1128
- }, z.core.$strip>;
1129
- type MoveSpeechesInput = z.infer<typeof moveSpeechesInputSchema>;
1130
- //#endregion
1131
- //#region src/editor/schemas/move-video-clips-by-anchor.d.ts
1132
- /**
1133
- * Where the moved block lands on the main track.
1134
- *
1135
- * A discriminated union rather than two optional `before_clip_id` /
1136
- * `after_clip_id` fields (the shape `addVideoClips` had to use, because there the
1137
- * two modes share a whole clip description): here the alternatives carry nothing
1138
- * in common, so making them mutually exclusive *by type* removes three runtime
1139
- * `superRefine` checks that would otherwise have to be written and tested.
1140
- *
1141
- * `track_start` is an explicit member, not the absence of an anchor. The
1142
- * agent-harness mutation this maps from treats "neither anchor given" as
1143
- * "move to the front" (`applyBatchMoveVideoClips` falls back to `insertIndex = 0`),
1144
- * which is a default buried in a tool description. Requiring the caller to name
1145
- * that intent keeps a forgotten field from silently reordering the timeline.
1146
- */
1147
- declare const moveAnchorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1148
- position: z.ZodLiteral<"before">;
1149
- clip_id: z.ZodString;
1150
- }, z.core.$strip>, z.ZodObject<{
1151
- position: z.ZodLiteral<"after">;
1152
- clip_id: z.ZodString;
1153
- }, z.core.$strip>, z.ZodObject<{
1154
- position: z.ZodLiteral<"track_start">;
1155
- }, z.core.$strip>], "position">;
1156
- /**
1157
- * What happens to the speeches anchored to the clips being moved.
1158
- *
1159
- * - `follow` keeps each speech anchored where it is, so it travels with its clip
1160
- * to the new position. In the anchored model this is the *no-op* branch: a
1161
- * speech's authoritative fact is `{ anchorPartId, offsetMs }` and its absolute
1162
- * time is derived on read from the host's position, so moving the host moves
1163
- * the speech with no write to the speech at all.
1164
- * - `keep_absolute` preserves each speech's current absolute landing instead, then
1165
- * re-anchors it to whichever clip now covers that time (RFC 02 §9.1/§11.1). This
1166
- * is the branch that costs an extra pass, and the one the FE timeline uses.
1167
- *
1168
- * **Required, with no default**, matching `deleteVideoClips` and
1169
- * `replaceVideoClipSequence`. The two branches decide which picture the user's
1170
- * narration ends up over, which is too consequential to infer from a missing
1171
- * field — and neither branch is "safe enough" to be the implicit one.
1172
- */
1173
- declare const movedClipAnchoredPolicySchema: z.ZodEnum<{
1174
- follow: "follow";
1175
- keep_absolute: "keep_absolute";
1176
- }>;
1177
- /**
1178
- * Reorder a set of main-track clips relative to a reference clip.
1179
- *
1180
- * Distinct from `moveVideoClips`, which positions clips by absolute time
1181
- * (`new_start_ms`) and is what the FE timeline dispatches after a drag. Main-track
1182
- * clips are `sequential`-positioned, so absolute time is not authoritative state
1183
- * there (RFC 02 §4/§7): `moveVideoClips` has to *guess* an index back out of the
1184
- * time it was handed, whereas an anchor already is the ordinal fact being changed.
1185
- * Keeping them separate also isolates blast radius — this method can diverge on
1186
- * speech policy without touching the FE path.
1187
- *
1188
- * `clip_ids` need not be contiguous. They move as one block, keeping their
1189
- * relative order, which is the agent-harness `batch_move_video_clips` contract.
1190
- */
1191
- declare const moveVideoClipsByAnchorInputSchema: z.ZodObject<{
1192
- clip_ids: z.ZodArray<z.ZodString>;
1193
- anchor: z.ZodDiscriminatedUnion<[z.ZodObject<{
1194
- position: z.ZodLiteral<"before">;
1195
- clip_id: z.ZodString;
1196
- }, z.core.$strip>, z.ZodObject<{
1197
- position: z.ZodLiteral<"after">;
1198
- clip_id: z.ZodString;
1199
- }, z.core.$strip>, z.ZodObject<{
1200
- position: z.ZodLiteral<"track_start">;
1201
- }, z.core.$strip>], "position">;
1202
- on_anchored: z.ZodEnum<{
1203
- follow: "follow";
1204
- keep_absolute: "keep_absolute";
1205
- }>;
1206
- }, z.core.$strip>;
1207
- type MoveAnchor = z.infer<typeof moveAnchorSchema>;
1208
- type MovedClipAnchoredPolicy = z.infer<typeof movedClipAnchoredPolicySchema>;
1209
- type MoveVideoClipsByAnchorInput = z.infer<typeof moveVideoClipsByAnchorInputSchema>;
1210
- //#endregion
1211
- //#region src/editor/schemas/move-video-clips.d.ts
1212
- declare const moveVideoClipsInputSchema: z.ZodObject<{
1213
- clips: z.ZodArray<z.ZodObject<{
1214
- clip_id: z.ZodString;
1215
- new_start_ms: z.ZodNumber;
1216
- new_track_id: z.ZodOptional<z.ZodString>;
1217
- }, z.core.$strip>>;
1218
- }, z.core.$strip>;
1219
- type MoveVideoClipsInput = z.infer<typeof moveVideoClipsInputSchema>;
1220
- //#endregion
1221
- //#region src/editor/schemas/replace-video-clip-content.d.ts
1222
- /**
1223
- * Replace the media backing existing video clips. The media import runs upstream
1224
- * (Director); its stable result — the new media id, intrinsic length, and the
1225
- * reset trim window — arrives materialized (see
1226
- * `results/phase-4-side-effect-payload-contract.md` §4). Director resets
1227
- * `play_in=0` / `play_out=media_duration_ms` and clears `speed_shift` on
1228
- * replacement. The clip `part_id`s (hence their track items) are unchanged; the
1229
- * editor reflows the main track from the new effective durations.
1230
- */
1231
- declare const replaceVideoClipContentInputSchema: z.ZodObject<{
1232
- clips: z.ZodArray<z.ZodObject<{
1233
- clip_id: z.ZodString;
1234
- origin_media_id: z.ZodString;
1235
- media_duration_ms: z.ZodNumber;
1236
- play_in: z.ZodNumber;
1237
- play_out: z.ZodNumber;
1238
- volume: z.ZodNumber;
1239
- }, z.core.$strip>>;
1240
- }, z.core.$strip>;
1241
- type ReplaceVideoClipContentInput = z.infer<typeof replaceVideoClipContentInputSchema>;
1242
- //#endregion
1243
- //#region src/editor/schemas/replace-video-clip-sequence.d.ts
1244
- /**
1245
- * What happens to the speeches anchored to the clips being replaced.
1246
- *
1247
- * - `remap` re-anchors each surviving speech to the new clip in the SAME POSITION
1248
- * of the sequence, keeping its offset — old[i]'s children become new[i]'s
1249
- * children. An old clip with no counterpart (fewer new clips than old) has its
1250
- * subtree deleted, because there is nothing left to anchor to.
1251
- * - `cascade` deletes every anchored speech (and its captions) outright, like
1252
- * `deleteVideoClips`.
1253
- *
1254
- * **Required, with no default.** The two branches differ in whether the user's
1255
- * narration survives, and the agent tool that drives this op makes its
1256
- * `preserve_speeches` flag required for that reason. A default here would let a
1257
- * caller that forgot the field silently delete speech.
1258
- */
1259
- declare const anchoredReplacePolicySchema: z.ZodEnum<{
1260
- cascade: "cascade";
1261
- remap: "remap";
1262
- }>;
1263
- type AnchoredReplacePolicy = z.infer<typeof anchoredReplacePolicySchema>;
1264
- /**
1265
- * Replace a contiguous run of main-track clips with a new run.
1266
- *
1267
- * A composite of delete + insert that cannot be expressed as the two ops in
1268
- * sequence, because the anchored speeches have to survive *across* the swap: with
1269
- * `remap` they are re-anchored positionally, which needs both the old and the new
1270
- * ids in the same transaction (ADR 0009 — the cascade stays in the editor, callers
1271
- * never re-wire anchors themselves).
1272
- *
1273
- * Duration facts follow `addVideoClips`: `media_duration_ms` is the source's
1274
- * intrinsic length and the trim window defaults to the whole media. The effective
1275
- * timeline duration is derived by the projection, never an input.
1276
- *
1277
- * `media_id` is optional: omitting it creates a **deliberate empty placeholder
1278
- * clip** (`origin_media_id: ''`) — structure with no picture. This is the only op
1279
- * that can produce one, and it is authoritative state, unlike the gap fillers the
1280
- * read-side solve mints (which never enter the document).
1281
- */
1282
- declare const replaceVideoClipSequenceInputSchema: z.ZodObject<{
1283
- old_clip_ids: z.ZodArray<z.ZodString>;
1284
- new_clips: z.ZodArray<z.ZodObject<{
1285
- media_id: z.ZodOptional<z.ZodString>;
1286
- media_duration_ms: z.ZodNumber;
1287
- play_in: z.ZodOptional<z.ZodNumber>;
1288
- play_out: z.ZodOptional<z.ZodNumber>;
1289
- }, z.core.$strip>>;
1290
- on_anchored: z.ZodEnum<{
1291
- cascade: "cascade";
1292
- remap: "remap";
1293
- }>;
1294
- }, z.core.$strip>;
1295
- type ReplaceVideoClipSequenceInput = z.infer<typeof replaceVideoClipSequenceInputSchema>;
1296
- //#endregion
1297
- //#region src/editor/schemas/set-bgm.d.ts
1298
- /**
1299
- * Set the document BGM. The media's stable result (storage key) arrives
1300
- * materialized from upstream (see
1301
- * `results/phase-4-side-effect-payload-contract.md` §3). The op upserts the bgm
1302
- * part and seats it on the bgm lane; its effective length is always the whole
1303
- * timeline, derived by the projection on read — so there is no `duration_ms`
1304
- * input or fact (RFC 02 / `reference/16` §0b). A `bgm_id` lets the op replace an
1305
- * existing bgm part by id.
1306
- */
1307
- declare const setBgmInputSchema: z.ZodObject<{
1308
- bgm_id: z.ZodString;
1309
- audio_storage_key: z.ZodString;
1310
- origin_media_id: z.ZodString;
1311
- volume: z.ZodNumber;
1312
- }, z.core.$strip>;
1313
- type SetBgmInput = z.infer<typeof setBgmInputSchema>;
1314
- //#endregion
1315
- //#region src/editor/schemas/set-caption-style.d.ts
1475
+ //#region src/editor/id-gen.d.ts
1316
1476
  /**
1317
- * Set the caption visual style. GLOBAL by design: the style applies to every
1318
- * caption part in the document — it carries NO `caption_id`. This mirrors the FE,
1319
- * whose caption-style store (`caption-style.ts:persistCaptionStylePatch`) iterates
1320
- * ALL captions and writes the same normalized style to each; the product has a
1321
- * single document-wide caption style, not per-caption styling.
1477
+ * Part-id generation, aligned with the online ecosystem.
1322
1478
  *
1323
- * Every field is optional and maps to a `CaptionStyle` attribute (snake_case
1324
- * IDL). A field present in the input is written to every caption; a field ABSENT
1325
- * from the input is left untouched on each caption (the editor merges the patch
1326
- * onto each caption's existing style — this is a value edit, not a full-style
1327
- * replace, so a partial patch such as "recolor only" does not wipe font size).
1328
- *
1329
- * Pure document edit, no cascade — captions keep their positions; only the style
1330
- * sub-map of each caption part changes.
1331
- */
1332
- declare const setCaptionStyleInputSchema: z.ZodObject<{
1333
- font_id: z.ZodOptional<z.ZodString>;
1334
- font_size: z.ZodOptional<z.ZodNumber>;
1335
- font_color: z.ZodOptional<z.ZodString>;
1336
- font_weight: z.ZodOptional<z.ZodNumber>;
1337
- entrance_animation: z.ZodOptional<z.ZodString>;
1338
- entrance_animation_duration_ms: z.ZodOptional<z.ZodNumber>;
1339
- stroke_color: z.ZodOptional<z.ZodString>;
1340
- stroke_width: z.ZodOptional<z.ZodNumber>;
1341
- position_x: z.ZodOptional<z.ZodNumber>;
1342
- position_y: z.ZodOptional<z.ZodNumber>;
1343
- }, z.core.$strip>;
1344
- type SetCaptionStyleInput = z.infer<typeof setCaptionStyleInputSchema>;
1345
- //#endregion
1346
- //#region src/editor/schemas/set-caption-visibility.d.ts
1347
- /**
1348
- * Toggle caption visibility (the caption track's `is_hidden` flag). Pure
1349
- * document edit, no cascade — captions keep their positions; only the lane's
1350
- * hidden flag changes.
1351
- */
1352
- declare const setCaptionVisibilityInputSchema: z.ZodObject<{
1353
- is_hidden: z.ZodBoolean;
1354
- }, z.core.$strip>;
1355
- type SetCaptionVisibilityInput = z.infer<typeof setCaptionVisibilityInputSchema>;
1356
- //#endregion
1357
- //#region src/editor/schemas/set-video-clip-speed-shift.d.ts
1358
- /**
1359
- * Set the playback speed of existing video clips. Per the speed-shift decision
1360
- * (`reference/16` §0): the op writes only the `speed_shift` fact — it does NOT
1361
- * store an effective `duration_ms` (projection derives it from the trim window /
1362
- * speed) and does NOT scale anchored speeches' relative offsets (offsets stay
1363
- * put; the cascade reflows absolute positions). A `null` speed_shift clears the
1364
- * speed back to original (1×).
1365
- */
1366
- declare const setVideoClipSpeedShiftInputSchema: z.ZodObject<{
1367
- clips: z.ZodArray<z.ZodObject<{
1368
- clip_id: z.ZodString;
1369
- speed_shift: z.ZodNullable<z.ZodObject<{
1370
- category: z.ZodEnum<{
1371
- curve: "curve";
1372
- linear: "linear";
1373
- }>;
1374
- mode: z.ZodString;
1375
- config: z.ZodUnion<readonly [z.ZodObject<{
1376
- linear: z.ZodObject<{
1377
- speed: z.ZodNumber;
1378
- }, z.core.$strip>;
1379
- }, z.core.$strip>, z.ZodObject<{
1380
- curve: z.ZodObject<{
1381
- keyframes: z.ZodArray<z.ZodObject<{
1382
- position: z.ZodNumber;
1383
- rate: z.ZodNumber;
1384
- in_tangent: z.ZodOptional<z.ZodObject<{
1385
- x: z.ZodNumber;
1386
- y: z.ZodNumber;
1387
- }, z.core.$strip>>;
1388
- out_tangent: z.ZodOptional<z.ZodObject<{
1389
- x: z.ZodNumber;
1390
- y: z.ZodNumber;
1391
- }, z.core.$strip>>;
1392
- }, z.core.$strip>>;
1393
- }, z.core.$strip>;
1394
- }, z.core.$strip>]>;
1395
- }, z.core.$strip>>;
1396
- }, z.core.$strip>>;
1397
- }, z.core.$strip>;
1398
- type SetVideoClipSpeedShiftInput = z.infer<typeof setVideoClipSpeedShiftInputSchema>;
1399
- //#endregion
1400
- //#region src/editor/schemas/shared.d.ts
1401
- declare const clipIdSchema: z.ZodString;
1402
- declare const clipIdsSchema: z.ZodArray<z.ZodString>;
1403
- declare const mediaIdSchema: z.ZodString;
1404
- declare const speechIdSchema: z.ZodString;
1405
- declare const timelineMsSchema: z.ZodNumber;
1406
- declare const positiveMsSchema: z.ZodNumber;
1407
- declare const volumeSchema: z.ZodNumber;
1408
- declare const speechIdsSchema: z.ZodArray<z.ZodString>;
1409
- /**
1410
- * A clip's playback-speed fact, the only thing `SetVideoClipSpeedShift` writes.
1411
- * Mirrors the IDL `SpeedShift`: `category` is `linear` | `curve`, and `config`
1412
- * is a discriminated union — `{ linear: { speed } }` for a constant multiplier
1413
- * (the multiplier projection reads at `config.linear.speed`) or `{ curve: {
1414
- * keyframes } }` for a Bezier-controlled variable speed (RFC 02 / `reference/16`
1415
- * §0). Exactly one of `linear` / `curve` is present.
1416
- */
1417
- declare const speedShiftSchema: z.ZodObject<{
1418
- category: z.ZodEnum<{
1419
- curve: "curve";
1420
- linear: "linear";
1421
- }>;
1422
- mode: z.ZodString;
1423
- config: z.ZodUnion<readonly [z.ZodObject<{
1424
- linear: z.ZodObject<{
1425
- speed: z.ZodNumber;
1426
- }, z.core.$strip>;
1427
- }, z.core.$strip>, z.ZodObject<{
1428
- curve: z.ZodObject<{
1429
- keyframes: z.ZodArray<z.ZodObject<{
1430
- position: z.ZodNumber;
1431
- rate: z.ZodNumber;
1432
- in_tangent: z.ZodOptional<z.ZodObject<{
1433
- x: z.ZodNumber;
1434
- y: z.ZodNumber;
1435
- }, z.core.$strip>>;
1436
- out_tangent: z.ZodOptional<z.ZodObject<{
1437
- x: z.ZodNumber;
1438
- y: z.ZodNumber;
1439
- }, z.core.$strip>>;
1440
- }, z.core.$strip>>;
1441
- }, z.core.$strip>;
1442
- }, z.core.$strip>]>;
1443
- }, z.core.$strip>;
1444
- declare const voiceSchema: z.ZodObject<{
1445
- id: z.ZodString;
1446
- name: z.ZodString;
1447
- }, z.core.$strip>;
1448
- //#endregion
1449
- //#region src/editor/schemas/speech-assets.d.ts
1450
- /**
1451
- * The materialized TTS result shared by `AddSpeeches` / `ChangeSpeechScript` /
1452
- * `ChangeSpeechVoice` (see `results/phase-4-side-effect-payload-contract.md`
1453
- * §1/§2). The side effect (TTS/ASR + billing) runs upstream; the op receives the
1454
- * stable speech + caption parts and writes them as authoritative facts. No
1455
- * cascade runs on write — the projection derives absolute positions on read.
1479
+ * The authoritative online producers — agent-harness (`@harness/shared`
1480
+ * `genObjId`) and director.v2 (`common/obj_id.py` `gen_obj_id`) — both mint part
1481
+ * ids as `` `${prefix}_${ulid()}` ``, and real captured drafts use exactly that
1482
+ * shape (`clip_…` / `spe_…` / `cap_…` / `bgm_…`, each a 26-char ULID). The engine
1483
+ * previously emitted `vc_<base36 timestamp><6 random>`, a different prefix AND a
1484
+ * different encoding — the sole cross-repo id divergence. This module removes it
1485
+ * by emitting the same `<prefix>_<ULID>` bytes.
1456
1486
  *
1457
- * Each speech carries the anchoring fact directly (RFC 02 §4): the host video
1458
- * clip `anchor_part_id` and the `offset_ms` within it. The upstream caller
1459
- * already knows which clip a speech attaches to, so the op writes
1460
- * `{ mode:'anchored', anchorPartId, offsetMs }` verbatim — no write-time
1461
- * host-picking. Captions anchor to their speech via the caption part's
1462
- * `start_ms` (offset within the speech).
1463
- */
1464
- declare const speechAssetSchema: z.ZodObject<{
1465
- speech_id: z.ZodString;
1466
- anchor_part_id: z.ZodString;
1467
- offset_ms: z.ZodNumber;
1468
- audio_storage_key: z.ZodString;
1469
- duration_ms: z.ZodNumber;
1470
- audio_script: z.ZodString;
1471
- volume: z.ZodNumber;
1472
- voice: z.ZodObject<{
1473
- id: z.ZodString;
1474
- name: z.ZodString;
1475
- }, z.core.$strip>;
1476
- origin_speech_id: z.ZodString;
1477
- caption_ids: z.ZodArray<z.ZodString>;
1478
- }, z.core.$strip>;
1479
- declare const captionAssetSchema: z.ZodObject<{
1480
- caption_id: z.ZodString;
1481
- speech_part_id: z.ZodString;
1482
- text: z.ZodString;
1483
- start_ms: z.ZodNumber;
1484
- duration_ms: z.ZodNumber;
1485
- }, z.core.$strip>;
1486
- /** A materialized speech-subtree write (speeches + their captions). */
1487
- declare const speechAssetsSchema: z.ZodObject<{
1488
- speeches: z.ZodArray<z.ZodObject<{
1489
- speech_id: z.ZodString;
1490
- anchor_part_id: z.ZodString;
1491
- offset_ms: z.ZodNumber;
1492
- audio_storage_key: z.ZodString;
1493
- duration_ms: z.ZodNumber;
1494
- audio_script: z.ZodString;
1495
- volume: z.ZodNumber;
1496
- voice: z.ZodObject<{
1497
- id: z.ZodString;
1498
- name: z.ZodString;
1499
- }, z.core.$strip>;
1500
- origin_speech_id: z.ZodString;
1501
- caption_ids: z.ZodArray<z.ZodString>;
1502
- }, z.core.$strip>>;
1503
- captions: z.ZodArray<z.ZodObject<{
1504
- caption_id: z.ZodString;
1505
- speech_part_id: z.ZodString;
1506
- text: z.ZodString;
1507
- start_ms: z.ZodNumber;
1508
- duration_ms: z.ZodNumber;
1509
- }, z.core.$strip>>;
1510
- }, z.core.$strip>;
1511
- type SpeechAsset = z.infer<typeof speechAssetSchema>;
1512
- type CaptionAsset = z.infer<typeof captionAssetSchema>;
1513
- type SpeechAssets = z.infer<typeof speechAssetsSchema>;
1514
- declare namespace index_d_exports {
1515
- export { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, AnchoredDeletePolicy, AnchoredReplacePolicy, CaptionAsset, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, MoveAnchor, MoveSpeechesInput, MoveVideoClipsByAnchorInput, MoveVideoClipsInput, MovedClipAnchoredPolicy, ReplaceVideoClipContentInput, ReplaceVideoClipSequenceInput, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput, SpeechAsset, SpeechAssets, addSpeechesInputSchema, addVideoClipsInputSchema, adjustBgmVolumeInputSchema, adjustSpeechVolumeInputSchema, adjustVideoClipDurationInputSchema, adjustVideoClipVolumeInputSchema, anchoredDeletePolicySchema, anchoredReplacePolicySchema, changeSpeechScriptInputSchema, changeSpeechVoiceInputSchema, clipIdSchema, clipIdsSchema, deleteBgmInputSchema, deleteSpeechesInputSchema, deleteVideoClipsInputSchema, mediaIdSchema, moveAnchorSchema, moveSpeechesInputSchema, moveVideoClipsByAnchorInputSchema, moveVideoClipsInputSchema, movedClipAnchoredPolicySchema, positiveMsSchema, replaceVideoClipContentInputSchema, replaceVideoClipSequenceInputSchema, setBgmInputSchema, setCaptionStyleInputSchema, setCaptionVisibilityInputSchema, setVideoClipSpeedShiftInputSchema, speechAssetsSchema, speechIdSchema, speechIdsSchema, speedShiftSchema, timelineMsSchema, voiceSchema, volumeSchema };
1516
- }
1487
+ * The ULID is generated inline (Crockford Base32, 48-bit time + 80-bit random)
1488
+ * rather than pulling the `ulid` npm package: the randomness class matches the
1489
+ * old generator (both `Math.random`-based) and it keeps `@mengine/medeo-client`
1490
+ * dependency-free for a purely mechanical id string. Part ids only need to be
1491
+ * unique and lexicographically time-sortable, which this satisfies.
1492
+ */
1493
+ /**
1494
+ * Online part-id semantic prefixes. `clip` (video clip) is the only value the
1495
+ * engine currently mints (see `addVideoClips`); the rest are declared so the
1496
+ * type documents the shared vocabulary and guards against reintroducing the old
1497
+ * `vc`/`sp`/`cp`/`bg` names. Speech/caption/bgm ids arrive pre-minted in op
1498
+ * payloads, so the engine never generates them itself.
1499
+ */
1500
+ type PartIdPrefix = 'clip' | 'spe' | 'cap' | 'bgm' | 'ti';
1501
+ declare function generatePartId(prefix: PartIdPrefix): string;
1502
+ /** Injectable part-id mint; defaults to `generatePartId` on `SemanticEditor`. */
1503
+ type PartIdFactory = (prefix: PartIdPrefix) => string;
1517
1504
  //#endregion
1518
1505
  //#region src/editor/schema-validator.d.ts
1519
1506
  interface SnapshotReadable {
@@ -1667,10 +1654,15 @@ interface OpActor {
1667
1654
  role: 'user' | 'agent';
1668
1655
  }
1669
1656
  interface CommitOptions {
1670
- intent?: {
1671
- kind: string;
1672
- payload: unknown;
1673
- };
1657
+ /**
1658
+ * Caller-supplied intent attached to the op's audit message.
1659
+ *
1660
+ * Typed as `unknown` to match `TransactAudit.intent`. The wire (real
1661
+ * mengine-server and the in-memory test double) only surfaces **string**
1662
+ * intents onto the audit log — non-string values stay in the Loro commit
1663
+ * message but parse to `null`. Agent callers should pass a string.
1664
+ */
1665
+ intent?: unknown;
1674
1666
  /** Author of this op; omitted for writes with no acting user (bootstrap, repair). */
1675
1667
  actor?: OpActor;
1676
1668
  }
@@ -1714,7 +1706,8 @@ interface SemanticDocumentAdapter extends SnapshotReadable {
1714
1706
  declare class SemanticEditor {
1715
1707
  private readonly doc;
1716
1708
  private readonly validator;
1717
- constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator);
1709
+ private readonly idFactory;
1710
+ constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator, idFactory?: PartIdFactory);
1718
1711
  moveVideoClips(input: MoveVideoClipsInput, options?: CommitOptions): Promise<void>;
1719
1712
  /**
1720
1713
  * Reorder main-track clips relative to an anchor clip, moving them as one block.
@@ -1882,6 +1875,14 @@ declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
1882
1875
  private disposed;
1883
1876
  constructor(doc: LoroDoc, mutationGuard?: DocumentMutationGuard);
1884
1877
  snapshot(): VideoDocument;
1878
+ /**
1879
+ * Native Entity authority: placement is already solved by the Entity graph.
1880
+ *
1881
+ * The root check goes through `getShallowValue` first because `getMap` creates
1882
+ * the container on access — probing a legacy document for `medeo` would
1883
+ * otherwise mutate it, which a read must never do.
1884
+ */
1885
+ isEntityDocument(): boolean;
1885
1886
  /**
1886
1887
  * Release mirror subscriptions; do not reuse this adapter afterwards.
1887
1888
  * The caller still owns the borrowed LoroDoc.
@@ -1901,6 +1902,62 @@ declare function createMirrorVideoDocument(document: VideoDocument, options?: Mi
1901
1902
  /** Build a `MirrorVideoDocumentAdapter` over a fresh doc seeded with `document`. */
1902
1903
  declare function createMirrorVideoDocumentAdapter(document: VideoDocument, options?: MirrorVideoDocumentOptions): MirrorVideoDocumentAdapter;
1903
1904
  //#endregion
1905
+ //#region src/document/plain-memory-adapter.d.ts
1906
+ /**
1907
+ * A `TransactAudit` widened with the ordered ids minted during that transact.
1908
+ * `generated_ids` is empty when the op never called the id factory.
1909
+ */
1910
+ interface JournalEntry extends TransactAudit {
1911
+ /** Ids produced by the adapter's id factory during this transact, in mint order. */
1912
+ generated_ids: string[];
1913
+ }
1914
+ interface PlainMemoryAdapterOptions {
1915
+ /** Underlying id mint; wrapped so each call inside a transact is journaled. */
1916
+ idFactory?: PartIdFactory;
1917
+ /**
1918
+ * Refuse every `transact`. Set when the seed document is an Entity projection:
1919
+ * its timeline is owned by the Entity graph, and the document itself no longer
1920
+ * states its provenance (business metadata left the CRDT), so the caller does.
1921
+ */
1922
+ readOnly?: boolean;
1923
+ }
1924
+ /**
1925
+ * Pure in-memory `SemanticDocumentAdapter` — no Loro/WASM. Holds a
1926
+ * `VideoDocumentDraft` object and applies each `transact` via immer `produce`,
1927
+ * journaling every audit that actually mutated state (plus any ids minted
1928
+ * during that transact).
1929
+ *
1930
+ * Known benign difference vs `MirrorVideoDocumentAdapter`: the editor's
1931
+ * `setPart` assigns a fresh part object on every call, so a same-value rewrite
1932
+ * produces a new immer state and IS journaled here, while the mirror's deep
1933
+ * diff emits no commit. Terminal `snapshot()` stays equal; replay is idempotent.
1934
+ */
1935
+ declare class PlainMemoryAdapter implements SemanticDocumentAdapter {
1936
+ private state;
1937
+ private readonly _journal;
1938
+ private readonly baseIdFactory;
1939
+ /** Non-null only while a `transact` edit callback is running. */
1940
+ private pendingIds;
1941
+ /**
1942
+ * Recording wrapper around the underlying factory. Callers (sandbox editor)
1943
+ * use this so every minted id is appended to the current transact's list.
1944
+ */
1945
+ readonly idFactory: PartIdFactory;
1946
+ private readonly readOnly;
1947
+ constructor(document: VideoDocument, options?: PlainMemoryAdapterOptions);
1948
+ get journal(): readonly JournalEntry[];
1949
+ hasContent(): boolean;
1950
+ snapshot(): VideoDocument;
1951
+ /**
1952
+ * Apply one op via immer. A throw in `edit` discards the draft (state and
1953
+ * journal unchanged). When `produce` returns the same reference, there was
1954
+ * no structural change — skip journal, matching mirror "no change, no commit".
1955
+ */
1956
+ transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
1957
+ }
1958
+ /** Build a `PlainMemoryAdapter` seeded with `document`. */
1959
+ declare function createPlainMemoryAdapter(document: VideoDocument, options?: PlainMemoryAdapterOptions): PlainMemoryAdapter;
1960
+ //#endregion
1904
1961
  //#region src/document/mirror-read.d.ts
1905
1962
  /**
1906
1963
  * Project the mirror state (`VideoDocumentDraft`) into the authoritative
@@ -1957,7 +2014,7 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
1957
2014
  id: z.ZodOptional<z.ZodString>;
1958
2015
  kind: z.ZodLiteral<"caption">;
1959
2016
  initial_duration_ms: z.ZodNumber;
1960
- speech_part_id: z.ZodString;
2017
+ speech_part_id: z.ZodOptional<z.ZodString>;
1961
2018
  text: z.ZodString;
1962
2019
  start_ms: z.ZodNumber;
1963
2020
  style: z.ZodOptional<z.ZodObject<{
@@ -1989,10 +2046,10 @@ declare const videoDocumentSchema: z.ZodObject<{
1989
2046
  tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1990
2047
  id: z.ZodOptional<z.ZodString>;
1991
2048
  parts_kind: z.ZodOptional<z.ZodEnum<{
1992
- bgm: "bgm";
1993
- caption: "caption";
1994
- speech: "speech";
1995
2049
  video_clip: "video_clip";
2050
+ speech: "speech";
2051
+ caption: "caption";
2052
+ bgm: "bgm";
1996
2053
  }>>;
1997
2054
  is_hidden: z.ZodOptional<z.ZodBoolean>;
1998
2055
  items: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2047,7 +2104,7 @@ declare const videoDocumentSchema: z.ZodObject<{
2047
2104
  id: z.ZodOptional<z.ZodString>;
2048
2105
  kind: z.ZodLiteral<"caption">;
2049
2106
  initial_duration_ms: z.ZodNumber;
2050
- speech_part_id: z.ZodString;
2107
+ speech_part_id: z.ZodOptional<z.ZodString>;
2051
2108
  text: z.ZodString;
2052
2109
  start_ms: z.ZodNumber;
2053
2110
  style: z.ZodOptional<z.ZodObject<{
@@ -2074,4 +2131,4 @@ declare const videoDocumentSchema: z.ZodObject<{
2074
2131
  }, z.core.$loose>]>>>;
2075
2132
  }, z.core.$loose>;
2076
2133
  //#endregion
2077
- export { VideoDraft as $, assertValidVideoDocument as A, CaptionPart as B, index_d_exports as C, VideoDocumentMirrorSchema as D, VideoDocumentDraft as E, buildSpeechHostMap as F, Timeline as G, PartKind as H, derivePositionFromAbs as I, TrackItemTimePosition as J, Track as K, fromVideoDocument as L, buildInitialVideoDocument as M, DerivedItemPosition as N, videoDocumentMirrorSchema as O, SpeechHostMap as P, VideoDocumentValidationIssueCode as Q, toVideoDocument as R, ValidationError as S, TrackItemDraft as T, PartUnion as U, DEFAULT_UNIT_TIME_MS as V, SpeechPart as W, VideoDocument as X, VideoClipPart as Y, VideoDocumentValidationIssue as Z, PlannedSemanticOpKind as _, MirrorVideoDocumentOptions as a, PartAggregation as at, SchemaValidator as b, CommitOptions as c, Track$1 as ct, SemanticEditor as d, VideoDraftContent as et, SemanticOpInput as f, ImplementedSemanticOpKind as g, IMPLEMENTED_SEMANTIC_OP_KINDS as h, MirrorVideoDocumentAdapter as i, CaptionStyle as it, validateVideoDocument as j, VideoDocumentValidationError as k, OpActor as l, TrackItem$1 as lt, TransactAudit as m, videoDocumentSchema as n, Attachment as nt, createMirrorVideoDocument as o, SpeedShift as ot, SemanticOpName as p, TrackItem as q, readVideoDocumentFromDraft as r, CaptionPart$1 as rt, createMirrorVideoDocumentAdapter as s, Timeline$1 as st, partUnionSchema as t, VideoDraftPartUnion as tt, SemanticDocumentAdapter as u, SemanticOpKind as v, TrackDraft as w, SnapshotReadable as x, isImplementedSemanticOpKind as y, BgmPart as z };
2134
+ export { derivePositionFromAbs as $, assertValidVideoDocument as A, VideoDraftContent as At, EntityRow as B, Track$1 as Bt, isImplementedSemanticOpKind as C, TrackItem as Ct, PartIdFactory as D, VideoDocumentValidationIssue as Dt, ValidationError as E, VideoDocument as Et, ResolvedEntityTrack as F, CaptionPart$1 as Ft, VoiceDescriptor as G, CaptionSegmentSelection as H, resolveEntityTimelineLayout as I, CaptionStyle as It, EntityId as J, JsonObject as K, projectEntityTimeline as L, PartAggregation as Lt, EntityTimelineTrackRole as M, effectiveVideoClipDurationMs as Mt, ResolvedEntityClipPlacement as N, speedOf as Nt, generatePartId as O, VideoDocumentValidationIssueCode as Ot, ResolvedEntityTimelineLayout as P, Attachment as Pt, buildSpeechHostMap as Q, EntityTimelineProjectionError as R, SpeedShift as Rt, SemanticOpKind as S, Track as St, SnapshotReadable as T, VideoClipPart as Tt, CaptionStyleFields as U, RelationRow as V, TrackItem$1 as Vt, ScriptTextSegment as W, DerivedItemPosition as X, buildInitialVideoDocument as Y, SpeechHostMap as Z, SemanticOpName as _, DEFAULT_UNIT_TIME_MS as _t, PlainMemoryAdapter as a, ensureLaneTrack as at, ImplementedSemanticOpKind as b, SpeechPart as bt, MirrorVideoDocumentAdapter as c, solveVideoDocument as ct, createMirrorVideoDocumentAdapter as d, VideoDocumentDraft as dt, fromVideoDocument as et, CommitOptions as f, VideoDocumentMirrorSchema as ft, SemanticOpInput as g, CaptionPart as gt, SemanticEditor as h, CaptionDisplayCue as ht, JournalEntry as i, SolvedVideoDocument as it, validateVideoDocument as j, VideoDraftPartUnion as jt, VideoDocumentValidationError as k, VideoDraft as kt, MirrorVideoDocumentOptions as l, TrackDraft as lt, SemanticDocumentAdapter as m, BgmPart as mt, videoDocumentSchema as n, LANE_KINDS_IN_STACK_ORDER as nt, PlainMemoryAdapterOptions as o, findLaneTrack as ot, OpActor as p, videoDocumentMirrorSchema as pt, JsonValue as q, readVideoDocumentFromDraft as r, LaneKind as rt, createPlainMemoryAdapter as s, laneTrackId as st, partUnionSchema as t, toVideoDocument as tt, createMirrorVideoDocument as u, TrackItemDraft as ut, TransactAudit as v, PartKind as vt, SchemaValidator as w, TrackItemTimePosition as wt, PlannedSemanticOpKind as x, Timeline as xt, IMPLEMENTED_SEMANTIC_OP_KINDS as y, PartUnion as yt, EntityRelationRows as z, Timeline$1 as zt };