@mengine/medeo-client 1.3.1-alpha.5 → 1.3.1-alpha.7

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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { $ as VideoDraft, A as assertValidVideoDocument, B as CaptionPart, C as index_d_exports, D as VideoDocumentMirrorSchema, E as VideoDocumentDraft, F as buildSpeechHostMap, G as Timeline, H as PartKind, I as derivePositionFromAbs, J as TrackItemTimePosition, K as Track, L as fromVideoDocument, M as buildInitialVideoDocument, N as DerivedItemPosition, O as videoDocumentMirrorSchema, P as SpeechHostMap, Q as VideoDocumentValidationIssueCode, R as toVideoDocument, S as ValidationError, T as TrackItemDraft, U as PartUnion, V as DEFAULT_UNIT_TIME_MS, W as SpeechPart, X as VideoDocument, Y as VideoClipPart, Z as VideoDocumentValidationIssue, _ as PlannedSemanticOpKind, a as MirrorVideoDocumentOptions, at as PartAggregation, b as SchemaValidator, c as CommitOptions, ct as Track$1, d as SemanticEditor, et as VideoDraftContent, f as SemanticOpInput, g as ImplementedSemanticOpKind, h as IMPLEMENTED_SEMANTIC_OP_KINDS, i as MirrorVideoDocumentAdapter, it as CaptionStyle, j as validateVideoDocument, k as VideoDocumentValidationError, l as OpActor, lt as TrackItem$1, m as TransactAudit, n as videoDocumentSchema, nt as Attachment, o as createMirrorVideoDocument, ot as SpeedShift, p as SemanticOpName, q as TrackItem, r as readVideoDocumentFromDraft, rt as CaptionPart$1, s as createMirrorVideoDocumentAdapter, st as Timeline$1, t as partUnionSchema, tt as VideoDraftPartUnion, u as SemanticDocumentAdapter, v as SemanticOpKind, w as TrackDraft, x as SnapshotReadable, y as isImplementedSemanticOpKind, z as BgmPart } from "./index-DdnuQf17.js";
1
+ import { t as index_d_exports } from "./index-CMa6ZCtX.js";
2
+ import { $ as VoiceDescriptor, A as generatePartId, At as effectiveVideoClipDurationMs, B as ResolvedEntityClipPlacement, C as PlannedSemanticOpKind, Ct as VideoClipPart, D as SnapshotReadable, Dt as VideoDocumentValidationIssueCode, E as SchemaValidator, Et as VideoDocumentValidationIssue, F as videoDocumentMirrorSchema, Ft as PartAggregation, G as EntityTimelineProjectionError, H as ResolvedEntityTrack, I as VideoDocumentValidationError, It as SpeedShift, J as CaptionSegmentSelection, K as EntityRelationRows, L as assertValidVideoDocument, Lt as Timeline$1, M as TrackItemDraft, Mt as Attachment, N as VideoDocumentDraft, Nt as CaptionPart$1, O as ValidationError, Ot as VideoDraft, P as VideoDocumentMirrorSchema, Pt as CaptionStyle, Q as SequenceRange, R as validateVideoDocument, Rt as Track$1, S as ImplementedSemanticOpKind, St as VIDEO_DOCUMENT_SCHEMA_VERSION, T as isImplementedSemanticOpKind, Tt as VideoDocumentSchemaVersion, U as resolveEntityTimelineLayout, V as ResolvedEntityTimelineLayout, W as projectEntityTimeline, X as ScriptTextSegment, Y as CaptionStyleFields, Z as SequenceDuration, _ as SemanticEditor, _t as SpeechPart, a as PlainMemoryAdapter, at as DerivedItemPosition, b as TransactAudit, bt as TrackItem, c as MirrorVideoDocumentAdapter, ct as derivePositionFromAbs, d as createMirrorVideoDocument, dt as BgmPart, et as JsonObject, f as createMirrorVideoDocumentAdapter, ft as CaptionPart, g as SemanticDocumentAdapter, gt as PartUnion, h as OpActor, ht as PartKind, i as JournalEntry, it as buildInitialVideoDocument, j as TrackDraft, jt as speedOf, k as PartIdFactory, kt as VideoDraftPartUnion, l as MirrorVideoDocumentOptions, lt as fromVideoDocument, m as CommitOptions, mt as ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION, n as videoDocumentSchema, nt as EntityId, o as PlainMemoryAdapterOptions, ot as SpeechHostMap, p as writeVideoDocumentToDraft, pt as DEFAULT_UNIT_TIME_MS, q as EntityRow, r as readVideoDocumentFromDraft, rt as InitialDocumentFacts, s as createPlainMemoryAdapter, st as buildSpeechHostMap, t as partUnionSchema, tt as JsonValue, u as applyEntityTimelineProjection, ut as toVideoDocument, v as SemanticOpInput, vt as Timeline, w as SemanticOpKind, wt as VideoDocument, x as IMPLEMENTED_SEMANTIC_OP_KINDS, xt as TrackItemTimePosition, y as SemanticOpName, yt as Track, z as EntityTimelineTrackRole, zt as TrackItem$1 } from "./index-Dxxu0Mi1.js";
2
3
  import { PeerID } from "loro-crdt";
3
4
  import { DocState } from "@mengine/sync";
4
5
  import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
@@ -177,33 +178,509 @@ interface MengineEventStreamOptions {
177
178
  }
178
179
  declare function readMengineEventStream(options: MengineEventStreamOptions): Promise<void>;
179
180
  //#endregion
180
- //#region src/editor/id-gen.d.ts
181
+ //#region ../medeo-dsl/src/composition.d.ts
182
+ type ScriptCompositionIssueCode = 'field_conflict' | 'composition_cycle' | 'invalid_bases' | 'composition_missing' | 'composition_ambiguous' | 'composition_dangling' | 'unknown_segment' | 'empty_selection' | 'invalid_script' | 'invalid_selection';
183
+ /** Assembly fails explicitly when declared bases cannot provide valid, unambiguous content. */
184
+ declare class ScriptCompositionError extends Error {
185
+ readonly code: ScriptCompositionIssueCode;
186
+ readonly entityId: EntityId;
187
+ constructor(code: ScriptCompositionIssueCode, entityId: EntityId, message: string);
188
+ }
189
+ interface AssembledCaptionContent {
190
+ readonly caption: EntityRow<'caption'>;
191
+ readonly audioScript: EntityRow<'audio-script'>;
192
+ /** Selected AudioScript segments in Caption selection order. */
193
+ readonly segments: readonly ScriptTextSegment[];
194
+ /** Complete display text: the selected segments' text joined in order. */
195
+ readonly text: string;
196
+ }
197
+ interface AssembledPhoneticScriptContent {
198
+ readonly phoneticScript: EntityRow<'phonetic-script'>;
199
+ readonly audioScript: EntityRow<'audio-script'>;
200
+ /** All AudioScript segments in script order; the pronunciation variant never reorders text. */
201
+ readonly segments: readonly ScriptTextSegment[];
202
+ /** Complete base text owned by the AudioScript. */
203
+ readonly text: string;
204
+ }
205
+ /** Validate all base providers before applying explicit own fields; ordering cannot resolve ambiguity. */
206
+ declare function assembleEntityContent(rows: EntityRelationRows, entityId: EntityId): EntityRow;
207
+ /** Find the actual AudioScript text owner through direct variant bases. */
208
+ declare function findComposedAudioScript(rows: EntityRelationRows, variantEntityId: EntityId, variantKind: 'caption' | 'phonetic-script'): EntityRow<'audio-script'>;
209
+ /** Join the whole AudioScript text in segment order. */
210
+ declare function assembleScriptText(script: EntityRow<'audio-script'>): string;
211
+ /** Assemble selected text after base-field validation and explicit variant overrides. */
212
+ declare function assembleCaptionContent(rows: EntityRelationRows, captionEntityId: EntityId): AssembledCaptionContent;
181
213
  /**
182
- * Part-id generation, aligned with the online ecosystem.
214
+ * Assemble the complete Phonetic Script content for TTS: the composed
215
+ * AudioScript's base text plus the variant's own phoneme and prosody fields.
216
+ */
217
+ declare function assemblePhoneticScriptContent(rows: EntityRelationRows, phoneticScriptEntityId: EntityId): AssembledPhoneticScriptContent;
218
+ /** Select source text without creating another authoritative text field. */
219
+ declare function selectAudioScriptSegments(script: EntityRow<'audio-script'>, selections: readonly CaptionSegmentSelection[]): readonly ScriptTextSegment[];
220
+ //#endregion
221
+ //#region src/entity-editor/entity-graph-http-client.d.ts
222
+ /** One authenticated revision of the authoritative Medeo Entity graph. */
223
+ interface EntityGraphState {
224
+ readonly audioScriptEntityId: string | null;
225
+ readonly revision: number;
226
+ readonly rows: EntityRelationRows;
227
+ }
228
+ interface EntityGraphCommitOptions {
229
+ /** Omitted preserves the baseline association; null explicitly clears it. */
230
+ readonly audioScriptEntityId?: string | null;
231
+ /** Server version vector proving the explicit legacy-to-Entity migration baseline. */
232
+ readonly migrationBaseVv?: string;
233
+ }
234
+ /** Browser-safe authenticated CAS client for a document's Entity graph. */
235
+ declare class EntityGraphHttpClient {
236
+ private readonly options;
237
+ private readonly transport;
238
+ private readonly endpoint;
239
+ constructor(options: MengineHttpClientOptions);
240
+ fetchState(): Promise<EntityGraphState>;
241
+ /**
242
+ * Replace the complete Entity graph under the baseline revision.
243
+ *
244
+ * Deletion intent is derived from baseline IDs omitted from `nextRows`, so a
245
+ * transient create-then-remove never becomes a request to delete unknown
246
+ * persisted data.
247
+ */
248
+ commit(baseState: EntityGraphState, nextRows: EntityRelationRows, options?: EntityGraphCommitOptions): Promise<EntityGraphState>;
249
+ private request;
250
+ }
251
+ //#endregion
252
+ //#region src/entity-editor/types.d.ts
253
+ /** Injectable domain-id mint shared by Entity and Relation authoring surfaces. */
254
+ type EntityTimelineIdFactory = (prefix: 'entity' | 'relation') => string;
255
+ interface ImageMediaAssetFact {
256
+ readonly assetId: string;
257
+ readonly kind: 'image';
258
+ readonly storageKey?: string;
259
+ }
260
+ interface VideoMediaAssetFact {
261
+ readonly assetId: string;
262
+ readonly kind: 'video';
263
+ readonly durationMs: number;
264
+ readonly storageKey?: string;
265
+ }
266
+ interface AudioMediaAssetFact {
267
+ readonly assetId: string;
268
+ readonly kind: 'audio';
269
+ readonly durationMs: number;
270
+ readonly storageKey: string;
271
+ }
272
+ interface VoiceMediaAssetFact {
273
+ /** Stable external speech result id, independent of the placed Clip id. */
274
+ readonly assetId: string;
275
+ readonly kind: 'voice';
276
+ readonly durationMs: number;
277
+ readonly storageKey: string;
278
+ /** Present for synthesized voice, absent for original recorded audio. */
279
+ readonly voice?: VoiceDescriptor;
280
+ }
281
+ /** Facts resolved from media storage. A trim window never substitutes for intrinsic duration. */
282
+ type MediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact | AudioMediaAssetFact | VoiceMediaAssetFact;
283
+ type ClipPlacement = {
284
+ readonly kind: 'sequential';
285
+ readonly order: number;
286
+ } | {
287
+ readonly kind: 'absolute';
288
+ readonly targetRange: SequenceRange<number>;
289
+ } | {
290
+ readonly kind: 'anchored';
291
+ readonly hostClipEntityId: string;
292
+ readonly anchorOffset: number;
293
+ };
294
+ interface InsertPlacedClipInput {
295
+ readonly trackEntityId: string;
296
+ readonly contentEntityId: string;
297
+ readonly sourceRange: SequenceRange<number>;
298
+ readonly duration: SequenceDuration<number>;
299
+ readonly placement: ClipPlacement;
300
+ readonly clipPayload?: JsonObject;
301
+ /** Stable caller-owned placement identity, when one already exists outside the graph. */
302
+ readonly clipEntityId?: string;
303
+ }
304
+ interface SetClipPlacementInput {
305
+ readonly clipEntityId: string;
306
+ readonly placement: ClipPlacement;
307
+ }
308
+ type SequentialClipAnchor = {
309
+ readonly position: 'before' | 'after';
310
+ readonly clipEntityId: string;
311
+ } | {
312
+ readonly position: 'trackStart';
313
+ };
314
+ interface MoveSequentialClipsInput {
315
+ readonly clipEntityIds: readonly string[];
316
+ readonly anchor: SequentialClipAnchor;
317
+ readonly onAnchored: 'follow' | 'keepAbsolute';
318
+ }
319
+ interface MoveClipsToStartsInput {
320
+ readonly moves: readonly {
321
+ readonly clipEntityId: string;
322
+ readonly newStartMs: number;
323
+ }[];
324
+ /** Absolute-time drags preserve every voiceover's current visible landing. */
325
+ readonly onAnchored: 'keepAbsolute';
326
+ }
327
+ interface DeleteClipTreeInput {
328
+ readonly clipEntityIds: readonly string[];
329
+ readonly onAnchored: 'cascade' | 'detach';
330
+ }
331
+ interface VoiceoverCaptionFact {
332
+ /** Stable placed caption identity supplied by the materialized side effect. */
333
+ readonly captionClipEntityId: string;
334
+ /** Directly held bases; includes the AudioScript used by the Voice. */
335
+ readonly baseEntityIds: readonly string[];
336
+ /** Ordered selection of AudioScript segments; caption text is never passed inline. */
337
+ readonly selections: readonly CaptionSegmentSelection[];
338
+ readonly startMs: number;
339
+ readonly durationMs: number;
340
+ readonly style?: CaptionStyleFields;
341
+ }
342
+ type VoiceoverTakeInput = {
343
+ readonly timelineEntityId: string; /** Stable placed speech identity, distinct from media.assetId. */
344
+ readonly voiceoverClipEntityId: string;
345
+ readonly media: VoiceMediaAssetFact; /** Existing pronunciation variant; its composed AudioScript stays the text owner. */
346
+ readonly phoneticScriptEntityId: string;
347
+ readonly volume: number;
348
+ readonly captions: readonly VoiceoverCaptionFact[];
349
+ } & ({
350
+ readonly placement: ClipPlacement;
351
+ readonly hostClipEntityId?: never;
352
+ readonly anchorOffset?: never;
353
+ } | {
354
+ readonly placement?: never;
355
+ readonly hostClipEntityId: string;
356
+ readonly anchorOffset: number;
357
+ });
358
+ type VisualMediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact;
359
+ interface InsertMediaClipInput {
360
+ readonly timelineEntityId: string;
361
+ readonly clipEntityId?: string;
362
+ readonly media: VisualMediaAssetFact;
363
+ /** Source/display window in whole milliseconds. Images use this as their finite display span. */
364
+ readonly sourceRange: SequenceRange<number>;
365
+ readonly placement: ClipPlacement;
366
+ readonly volume?: number;
367
+ }
368
+ interface ReplaceMediaClipInput {
369
+ readonly clipEntityId: string;
370
+ readonly media: VisualMediaAssetFact;
371
+ readonly sourceRange: SequenceRange<number>;
372
+ }
373
+ interface ReplacementMediaClipInput {
374
+ readonly clipEntityId?: string;
375
+ readonly media: VisualMediaAssetFact;
376
+ readonly sourceRange: SequenceRange<number>;
377
+ readonly volume?: number;
378
+ }
379
+ type MediaClipInsertion = {
380
+ readonly kind: 'before';
381
+ readonly clipEntityId: string;
382
+ } | {
383
+ readonly kind: 'after';
384
+ readonly clipEntityId: string;
385
+ } | {
386
+ readonly kind: 'firstStart';
387
+ readonly startMs: number;
388
+ };
389
+ interface InsertMediaClipsInput {
390
+ readonly timelineEntityId: string;
391
+ readonly clips: readonly ReplacementMediaClipInput[];
392
+ /** One placement decision for the whole input-ordered block. */
393
+ readonly insertion: MediaClipInsertion;
394
+ }
395
+ interface ReplaceSequentialClipsInput {
396
+ readonly timelineEntityId: string;
397
+ readonly oldClipEntityIds: readonly string[];
398
+ readonly newClips: readonly ReplacementMediaClipInput[];
399
+ readonly onAnchored: 'remap' | 'cascade';
400
+ }
401
+ interface SetClipVolumeInput {
402
+ readonly clipEntityId: string;
403
+ /** Playback gain in decibels. */
404
+ readonly volume: number;
405
+ }
406
+ interface LinearClipSpeed {
407
+ readonly kind: 'linear';
408
+ readonly rate: number;
409
+ readonly mode?: string;
410
+ }
411
+ interface SetClipSpeedInput {
412
+ readonly clipEntityId: string;
413
+ readonly timeRemapping: LinearClipSpeed | null;
414
+ }
415
+ interface TrimClipInput {
416
+ readonly clipEntityId: string;
417
+ readonly sourceRange: SequenceRange<number>;
418
+ }
419
+ interface VoiceoverTakeResult {
420
+ readonly voiceoverClipEntityId: string;
421
+ readonly voiceEntityId: string;
422
+ /** The pronunciation variant the Voice was rendered from. */
423
+ readonly phoneticScriptEntityId: string;
424
+ /** The base-text owner resolved from the PhoneticScript baseEntityIds. */
425
+ readonly audioScriptEntityId: string;
426
+ readonly captionClipEntityIds: readonly string[];
427
+ }
428
+ interface MoveVoiceoverInput {
429
+ readonly voiceoverClipEntityId: string;
430
+ /** Absolute requested timeline start; MEngine resolves and persists the host relation. */
431
+ readonly newStartMs: number;
432
+ }
433
+ interface DeleteVoiceoverInput {
434
+ readonly voiceoverClipEntityIds: readonly string[];
435
+ }
436
+ interface SetBgmInput {
437
+ readonly timelineEntityId: string;
438
+ readonly bgmClipEntityId: string;
439
+ readonly media: AudioMediaAssetFact;
440
+ readonly volume: number;
441
+ }
442
+ interface DeleteBgmInput {
443
+ readonly timelineEntityId: string;
444
+ }
445
+ interface SetCaptionVisibilityInput {
446
+ readonly timelineEntityId: string;
447
+ readonly hidden: boolean;
448
+ }
449
+ interface PatchCaptionStyleInput {
450
+ readonly timelineEntityId: string;
451
+ readonly style: CaptionStyleFields;
452
+ }
453
+ interface InsertCaptionClipInput {
454
+ readonly timelineEntityId: string;
455
+ /** Stable placed caption identity, distinct from the Caption content identity. */
456
+ readonly captionClipEntityId?: string;
457
+ /** Existing bases composed by this variant; includes an AudioScript text owner. */
458
+ readonly baseEntityIds: readonly string[];
459
+ /** Ordered selection of the AudioScript segments this Caption displays. */
460
+ readonly selections: readonly CaptionSegmentSelection[];
461
+ /** Intrinsic cue length of the Caption entity itself; display comes from the placement. */
462
+ readonly durationMs: number;
463
+ readonly style?: CaptionStyleFields;
464
+ readonly placement: ClipPlacement;
465
+ }
466
+ interface InsertClipInput {
467
+ readonly trackEntityId: string;
468
+ /** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
469
+ readonly contentEntityId: string;
470
+ readonly sourceRange: SequenceRange<number>;
471
+ readonly duration: SequenceDuration<number>;
472
+ readonly targetRange?: SequenceRange<number>;
473
+ readonly clipPayload?: JsonObject;
474
+ }
475
+ interface UpdateClipMarkerInput {
476
+ readonly clipEntityId: string;
477
+ readonly sourceRange?: SequenceRange<number>;
478
+ /** Passing `undefined` explicitly removes the optional target range. */
479
+ readonly targetRange?: SequenceRange<number> | undefined;
480
+ readonly duration?: SequenceDuration<number>;
481
+ /** Passing `undefined` explicitly removes the optional remapping value. */
482
+ readonly timeRemapping?: JsonValue | undefined;
483
+ }
484
+ interface MoveClipInput {
485
+ readonly clipEntityId: string;
486
+ readonly trackEntityId: string;
487
+ }
488
+ interface ReplaceClipContentInput {
489
+ readonly clipEntityId: string;
490
+ /** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
491
+ readonly contentEntityId: string;
492
+ readonly sourceRange: SequenceRange<number>;
493
+ readonly duration: SequenceDuration<number>;
494
+ readonly targetRange?: SequenceRange<number>;
495
+ readonly timeRemapping?: JsonValue;
496
+ }
497
+ interface DeleteClipInput {
498
+ readonly clipEntityId: string;
499
+ }
500
+ interface UpdateClipInput {
501
+ readonly clipEntityId: string;
502
+ /** Complete replacement for the Clip-owned payload. */
503
+ readonly payload: JsonObject;
504
+ }
505
+ type ClipEntityId = EntityId;
506
+ //#endregion
507
+ //#region src/entity-editor/entity-timeline-editor.d.ts
508
+ /**
509
+ * Graph-native timeline authoring over authoritative Medeo Entity and Relation rows.
183
510
  *
184
- * The authoritative online producers — agent-harness (`@harness/shared`
185
- * `genObjId`) and director.v2 (`common/obj_id.py` `gen_obj_id`) — both mint part
186
- * ids as `` `${prefix}_${ulid()}` ``, and real captured drafts use exactly that
187
- * shape (`clip_…` / `spe_…` / `cap_…` / `bgm_…`, each a 26-char ULID). The engine
188
- * previously emitted `vc_<base36 timestamp><6 random>`, a different prefix AND a
189
- * different encoding — the sole cross-repo id divergence. This module removes it
190
- * by emitting the same `<prefix>_<ULID>` bytes.
511
+ * Each mutation is applied to a detached graph, validated as a complete DSL set,
512
+ * and committed only after validation succeeds.
513
+ */
514
+ declare class EntityTimelineEditor {
515
+ private readonly idFactory;
516
+ private state;
517
+ constructor(initialRows: EntityRelationRows, idFactory?: EntityTimelineIdFactory);
518
+ rows(): EntityRelationRows;
519
+ insertClip(input: InsertClipInput): ClipEntityId;
520
+ insertPlacedClip(input: InsertPlacedClipInput): ClipEntityId;
521
+ updateClipMarker(input: UpdateClipMarkerInput): void;
522
+ setClipPlacement(input: SetClipPlacementInput): void;
523
+ moveSequentialClips(input: MoveSequentialClipsInput): void;
524
+ moveClipsToStarts(input: MoveClipsToStartsInput): void;
525
+ moveClip(input: MoveClipInput): void;
526
+ replaceClipContent(input: ReplaceClipContentInput): void;
527
+ insertMediaClip(input: InsertMediaClipInput): ClipEntityId;
528
+ insertMediaClips(input: InsertMediaClipsInput): readonly ClipEntityId[];
529
+ replaceMediaClip(input: ReplaceMediaClipInput): void;
530
+ setClipVolume(input: SetClipVolumeInput): void;
531
+ setClipSpeed(input: SetClipSpeedInput): void;
532
+ trimClip(input: TrimClipInput): void;
533
+ replaceSequentialClips(input: ReplaceSequentialClipsInput): readonly ClipEntityId[];
534
+ deleteClip(input: DeleteClipInput): void;
535
+ deleteClipTree(input: DeleteClipTreeInput): void;
536
+ updateClip(input: UpdateClipInput): void;
537
+ upsertVoiceoverTake(input: VoiceoverTakeInput): VoiceoverTakeResult;
538
+ moveVoiceover(input: MoveVoiceoverInput): void;
539
+ deleteVoiceover(input: DeleteVoiceoverInput): void;
540
+ setBgm(input: SetBgmInput): ClipEntityId;
541
+ deleteBgm(input: DeleteBgmInput): void;
542
+ setCaptionVisibility(input: SetCaptionVisibilityInput): void;
543
+ patchCaptionStyle(input: PatchCaptionStyleInput): void;
544
+ /**
545
+ * Place a Caption as a composed variant of an existing AudioScript: the
546
+ * entity stores baseEntityIds, selection, optional style, and inherent cue-bounded
547
+ * Sequence. This helper does not copy base text. The Clip and its display Marker describe this use;
548
+ * moving or stretching the returned Clip later changes the Clip/Marker,
549
+ * never the Caption entity or the AudioScript.
550
+ */
551
+ insertCaptionClip(input: InsertCaptionClipInput): ClipEntityId;
552
+ private insertPlacedClipIntoDraft;
553
+ private ensureRoleTrack;
554
+ /** The existing pronunciation variant a Voice consumes; composition is required. */
555
+ private requireComposedPhoneticScript;
556
+ /** Preserve the factual synthesis input, regardless of persisted endpoint positions. */
557
+ private ensurePhoneticRender;
558
+ private reconcileVoiceoverCaptions;
559
+ private ensureRoleTrackForClip;
560
+ private replaceCaptionAlignment;
561
+ /**
562
+ * Remove one placed Caption use. The composed AudioScript outlives the
563
+ * caption: it may anchor further captions and remains the text owner.
564
+ */
565
+ private removeCaptionClipGraph;
566
+ private replaceAnchorHost;
567
+ /** Rebuild the legacy edit baseline from current visual order before a high-level cascade. */
568
+ private normalizeMainSequential;
569
+ private resolveOneVoiceoverOverlap;
570
+ private applyClipPlacement;
571
+ private reanchorAtAbsolute;
572
+ private removeAnchoredDescendants;
573
+ private removeClipGraph;
574
+ private transact;
575
+ private mintEntityId;
576
+ private createRelation;
577
+ private relinkRelation;
578
+ private mintRelationId;
579
+ }
580
+ //#endregion
581
+ //#region src/entity-editor/editor-resources.d.ts
582
+ declare const roleOrder: {
583
+ readonly caption: 0;
584
+ readonly video_clip: 1;
585
+ readonly speech: 2;
586
+ readonly bgm: 3;
587
+ };
588
+ type EditorTrackRole = keyof typeof roleOrder;
589
+ interface EditorFoundation {
590
+ readonly rows: EntityRelationRows;
591
+ readonly timelineEntityId: string;
592
+ readonly trackEntityIds: Readonly<Record<EditorTrackRole, string>>;
593
+ }
594
+ /**
595
+ * MEngine editor policy, not a cardinality restriction on the general-purpose DSL.
596
+ *
597
+ * Media variants share one entity identity with their Asset: every
598
+ * Image/Video/Audio/Voice Entity must carry its own external locator, every
599
+ * external asset id has exactly one claimant, and no media variant may be
600
+ * bound through a legacy `physical-asset` Relation. Dual-entity media graphs
601
+ * are rejected, not migrated. Caption composes AudioScript text and has no physical text Asset.
602
+ */
603
+ declare function assertCanonicalEditorResources(rows: EntityRelationRows): void;
604
+ /**
605
+ * Commit-transition policy shared by the editor, the HTTP commit boundary, the
606
+ * host tool, and the entity stores. It compares the authoritative before and
607
+ * after rows of one CAS commit and enforces the single-identity write rules
608
+ * on the complete after state, with no exemption for historical graphs:
609
+ *
610
+ * 1. every Image/Video/Audio/Voice Entity carries its own Asset `external`
611
+ * identity;
612
+ * 2. no `physical-asset` Relation may bind a media variant or Caption;
613
+ * 3. a self-carried media identity is immutable — it cannot be rewritten to
614
+ * another asset id.
615
+ *
616
+ * Dual-entity media graphs are rejected instead of being migrated or merged
617
+ * implicitly. Deleting media is explicit and allowed.
618
+ */
619
+ declare function assertMediaAssetWritePolicy(before: EntityRelationRows, after: EntityRelationRows): void;
620
+ /** Add only missing editor structure; existing identities and owned settings are never replaced. */
621
+ declare function ensureEditorFoundation(initial: EntityRelationRows, idFactory?: EntityTimelineIdFactory, timelinePayload?: EntityRow['payload']): EditorFoundation;
622
+ //#endregion
623
+ //#region src/entity-editor/media-asset-import.d.ts
624
+ interface ImportedMediaAsset {
625
+ readonly rows: EntityRelationRows;
626
+ /** The single media variant identity for this asset id; it is its own Asset. */
627
+ readonly contentEntityId: string;
628
+ }
629
+ /**
630
+ * Import at the editor boundary, not at asset generation time. Existing
631
+ * provenance is retained.
191
632
  *
192
- * The ULID is generated inline (Crockford Base32, 48-bit time + 80-bit random)
193
- * rather than pulling the `ulid` npm package: the randomness class matches the
194
- * old generator (both `Math.random`-based) and it keeps `@mengine/medeo-client`
195
- * dependency-free for a purely mechanical id string. Part ids only need to be
196
- * unique and lexicographically time-sortable, which this satisfies.
633
+ * A media variant is a logical facet of its Asset and shares one entity
634
+ * identity: the import mints exactly one entity of the media kind that carries
635
+ * the external locator itself, and deduplicates only against existing variants
636
+ * that already carry the same `(system, key)`. Legacy dual-entity graphs
637
+ * (`asset` row plus a `physical-asset` binding) are not reused and are
638
+ * rejected by the canonical resource policy instead of being migrated.
197
639
  */
640
+ declare function importMediaAsset(initial: EntityRelationRows, fact: MediaAssetFact, idFactory?: EntityTimelineIdFactory): ImportedMediaAsset;
641
+ //#endregion
642
+ //#region src/entity-editor/legacy-entity-migration.d.ts
643
+ /** One-time import only. Ordinary editor operations must never reverse-diff a legacy document. */
644
+ declare function migrateLegacyTimelineToEntities(legacy: VideoDocument, assetFacts: readonly MediaAssetFact[], initial?: EntityRelationRows, idFactory?: EntityTimelineIdFactory): EntityRelationRows;
645
+ /** Server gate: a cutover may change representation, never the existing render facts. */
646
+ declare function assertEntityProjectionPreservesLegacy(legacy: VideoDocument, projection: VideoDocument, rows: EntityRelationRows): void;
647
+ //#endregion
648
+ //#region src/entity-editor/caption-content.d.ts
649
+ interface CaptionContentInput {
650
+ readonly contentEntityId: string;
651
+ readonly audioScriptEntityId: string;
652
+ readonly text: string;
653
+ readonly selections?: readonly CaptionSegmentSelection[];
654
+ readonly durationMs: number;
655
+ }
656
+ /** Author Caption content from semantic intent; callers never reconcile variant bases or assembled fields. */
657
+ declare function prepareCaptionContent(rows: EntityRelationRows, input: CaptionContentInput): EntityRow<'caption'>;
658
+ //#endregion
659
+ //#region src/entity-editor/document-audio-script.d.ts
660
+ interface DocumentAudioScript {
661
+ readonly entityId: string;
662
+ readonly segments: readonly (ScriptTextSegment & Readonly<Record<string, unknown>>)[];
663
+ }
664
+ /** Resolve only the document association; other AudioScripts remain independent resources. */
665
+ declare function readDocumentAudioScript(state: Pick<EntityGraphState, 'rows' | 'audioScriptEntityId'>): DocumentAudioScript | null;
666
+ //#endregion
667
+ //#region src/editor/journal.d.ts
198
668
  /**
199
- * Online part-id semantic prefixes. `clip` (video clip) is the only value the
200
- * engine currently mints (see `addVideoClips`); the rest are declared so the
201
- * type documents the shared vocabulary and guards against reintroducing the old
202
- * `vc`/`sp`/`cp`/`bg` names. Speech/caption/bgm ids arrive pre-minted in op
203
- * payloads, so the engine never generates them itself.
669
+ * Wire a plain-memory adapter + editor that share a recording id factory, so
670
+ * every mutating transact lands in `journal` with ordered `generated_ids`.
204
671
  */
205
- type PartIdPrefix = 'clip' | 'spe' | 'cap' | 'bgm' | 'ti';
206
- declare function generatePartId(prefix: PartIdPrefix): string;
672
+ declare function createEditSandbox(document: VideoDocument, options?: PlainMemoryAdapterOptions): {
673
+ adapter: PlainMemoryAdapter;
674
+ editor: SemanticEditor;
675
+ journal: readonly JournalEntry[];
676
+ };
677
+ /**
678
+ * Re-drive `doc` from a recorded journal, forcing each entry's `generated_ids`
679
+ * through a queue-backed id factory. Never mints fresh ids: an empty queue on
680
+ * demand throws `unrecorded id`; leftover ids after an entry throws
681
+ * `unconsumed ids`. Legacy entries without `generated_ids` are treated as `[]`.
682
+ */
683
+ declare function replayJournal(doc: SemanticDocumentAdapter, journal: readonly JournalEntry[]): Promise<void>;
207
684
  //#endregion
208
685
  //#region src/editor/snapshot-utils.d.ts
209
686
  /** Main-track item identity read from a raw snapshot (only `part_id` is needed). */
@@ -296,9 +773,7 @@ type PushResultKind = 'ack' | 'duplicate' | 'rejected' | 'failed' | 'nothing_to_
296
773
  */
297
774
  interface PushResult {
298
775
  kind: PushResultKind;
299
- /** Server document sequence observed after a successful `ack` or `duplicate`. */
300
- mengineUpdateSeq?: number | undefined;
301
- /** @deprecated Ack-only sequence retained until consumers adopt `mengineUpdateSeq`. */
776
+ /** Server-allocated sequence number; only present for `ack`. */
302
777
  updateSeq?: number | undefined;
303
778
  /** Whether the server held ops the local document lacked. See above. */
304
779
  collaborated: boolean;
@@ -405,7 +880,8 @@ declare class ManualSyncDoc {
405
880
  * Fetches the snapshot up front rather than starting empty and converging: the
406
881
  * agent's first act is to read the document, so there is no useful state before
407
882
  * the snapshot lands. This also fails fast and loudly on a document that does
408
- * not exist or whose first snapshot is incomplete or invalid.
883
+ * not exist, instead of `MengineDocSession.waitForContent()`'s behavior of
884
+ * waiting forever for content that will never arrive.
409
885
  */
410
886
  static open(options: ManualSyncDocOptions): Promise<ManualSyncDoc>;
411
887
  /** Current document read model (authoritative shape). */
@@ -421,16 +897,27 @@ declare class ManualSyncDoc {
421
897
  * was passed to the constructor.
422
898
  */
423
899
  editorPeerId(): PeerID;
424
- /** Current content projected into the compatible track and part read shape. */
425
- content(): VideoDraftContent;
900
+ /** Current document projected to the legacy `VideoDraft` read shape. */
901
+ draft(): VideoDraft;
902
+ /**
903
+ * Replay a deterministic sandbox journal into this document.
904
+ *
905
+ * The adapter stays private so callers cannot bypass the manual-sync
906
+ * lifecycle; journal replay is the one host-side operation that needs the
907
+ * adapter's transaction boundary and recorded id queue. Durability is still
908
+ * explicit: call {@link push} after replay and report success only from its
909
+ * verdict.
910
+ */
911
+ replayJournal(journal: readonly JournalEntry[]): Promise<void>;
426
912
  /**
427
913
  * Mark the document state the caller has just observed, for a later
428
914
  * {@link hasChangedSince}.
429
915
  *
430
916
  * This pair replaces the legacy integer-version comparison that
431
917
  * `DraftVersionDetector` used to tell the LLM "the draft was modified
432
- * externally, reload before editing". Comparing Loro version vectors covers
433
- * all collaborative edits without a business revision field in the document.
918
+ * externally, reload before editing". Under mengine `meta.version` never
919
+ * changes, so that detector would go permanently silent; comparing version
920
+ * vectors restores the same capability.
434
921
  *
435
922
  * Same capability, not a stronger one: like the legacy detector, this only
436
923
  * reports what changed between two moments the caller chose to sample.
@@ -575,9 +1062,6 @@ declare class MedeoHttpDocStorage implements DocStorage {
575
1062
  * tool-level ack wait) subscribe here.
576
1063
  */
577
1064
  subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
578
- /** Authoritative HTTP reads and accepted pushes, never inferred from SSE bytes. */
579
- subscribeServerVersion(callback: (version: Uint8Array) => void): () => void;
580
- private reportServerVersion;
581
1065
  deleteDoc(_docId: string): Promise<void>;
582
1066
  subscribeDocUpdate(callback: (update: DocUpdate, origin: unknown) => void): () => void;
583
1067
  private assertDocId;
@@ -626,14 +1110,6 @@ interface WaitForServerAckOptions {
626
1110
  /** Deadline in ms. Rejects with reason `timeout` when it elapses. */
627
1111
  timeoutMs?: number;
628
1112
  }
629
- /** Document-level confirmation is independent of local operation completion. */
630
- interface MengineDocSyncState {
631
- /** Remote-only imports do not create a new local confirmation obligation. */
632
- readonly confirmation: 'unknown' | 'pending' | 'confirmed';
633
- /** Transport/activity phase. Idle does not imply confirmation; failure details
634
- * remain available through push outcomes and confirmation wait errors. */
635
- readonly phase: 'connecting' | 'idle' | 'syncing' | 'offline' | 'failed';
636
- }
637
1113
  interface MengineDocSessionOptions {
638
1114
  docId: string;
639
1115
  client: MengineHttpClient;
@@ -644,6 +1120,11 @@ interface MengineDocSessionOptions {
644
1120
  */
645
1121
  localStorage?: DocStorageLike;
646
1122
  sseReconnectDelayMs?: number;
1123
+ /**
1124
+ * Keep remote synchronization read-only: pull snapshot/diffs and subscribe to
1125
+ * SSE updates, but never POST local Loro updates to the server.
1126
+ */
1127
+ readonlyMode?: boolean;
647
1128
  }
648
1129
  /**
649
1130
  * A live editing session for one Medeo document — the single entry point clients
@@ -679,15 +1160,8 @@ declare class MengineDocSession {
679
1160
  private adapterValue;
680
1161
  private editorValue;
681
1162
  private started;
682
- private startTask;
683
- private destroyed;
684
- private lifetime;
685
- private hasConnected;
686
- private initialVersionValue;
687
- private localVersionValue;
688
- private pushErrorValue;
689
1163
  /**
690
- * Latest server oplog version seen on an authoritative HTTP response. Lets `waitForServerAck`
1164
+ * Latest server oplog version seen on a push outcome. Lets `waitForServerAck`
691
1165
  * return without waiting when the server is already known to cover the local
692
1166
  * doc (e.g. nothing was edited since the last confirmed push).
693
1167
  */
@@ -702,14 +1176,14 @@ declare class MengineDocSession {
702
1176
  */
703
1177
  subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
704
1178
  /**
705
- * Resolve once the server has durably accepted the local commits as of
1179
+ * Resolve once the server has durably accepted the local document state as of
706
1180
  * *now* — the capability an Agent tool needs to answer "did my edit land?"
707
1181
  * before reporting success.
708
1182
  *
709
1183
  * Call it right after the editor ops whose durability matters. It snapshots the
710
- * latest local commit's version (or the loaded baseline before any edit) and
711
- * resolves when an authoritative server version covers it. Remote-only
712
- * imports do not extend this target, matching the displayed confirmation state.
1184
+ * local doc's current version and resolves on the first push outcome whose
1185
+ * `serverVV` covers that version, i.e. the server log is at least as advanced as
1186
+ * the local doc was when this was called.
713
1187
  *
714
1188
  * Version coverage, not byte identity, is the acceptance test — for two reasons:
715
1189
  * the ops may reach the server inside a merged blob rather than as the exact
@@ -731,6 +1205,18 @@ declare class MengineDocSession {
731
1205
  * step. The committed change drives DocManager's local-update push.
732
1206
  */
733
1207
  get editor(): SemanticEditor;
1208
+ /**
1209
+ * Opaque version token of the local oplog (base64 `VersionVector.encode`).
1210
+ * Equality-comparable only: equal means no observed change (local or
1211
+ * remote-arrived) since the token was taken. Throws when not started.
1212
+ */
1213
+ version(): string;
1214
+ /**
1215
+ * The live document adapter, exposed for journal replay (commit channel).
1216
+ * Replaying through it still goes SemanticEditor → Loro → mengine-server —
1217
+ * no write bypass. Typed by the narrow interface on purpose.
1218
+ */
1219
+ get documentAdapter(): SemanticDocumentAdapter;
734
1220
  /** Current document snapshot (read model). */
735
1221
  snapshot(): VideoDocument;
736
1222
  /**
@@ -741,18 +1227,21 @@ declare class MengineDocSession {
741
1227
  * surfaces through `subscribe`.
742
1228
  */
743
1229
  start(): Promise<VideoDocument>;
744
- private open;
745
- getSyncState(): MengineDocSyncState;
746
- private confirmationTarget;
747
- /** Immediately supplies current state; unsubscribe when the host changes docs. */
748
- subscribeSyncState(cb: (state: MengineDocSyncState) => void): () => void;
749
- private emitSyncState;
750
1230
  subscribe(cb: (event: MengineDocSessionUpdateEvent) => void): () => void;
751
1231
  onStateChange(cb: (state: DocState) => void): () => void;
752
1232
  getState(): DocState;
753
1233
  destroy(): void;
754
- /** Merge persisted local edits before exposing the initial content. */
755
- private waitForLocalLoad;
1234
+ /**
1235
+ * Resolve once the Loro doc holds the document root.
1236
+ *
1237
+ * `DocManager` loads from local storage, which starts empty for a fresh
1238
+ * client; the server snapshot arrives asynchronously via the first sync job.
1239
+ * `loaded` only means the local load ran, so we wait for actual content
1240
+ * (populated schema roots) instead, surfaced by the doc subscription set up
1241
+ * in `start()`.
1242
+ */
1243
+ private waitForContent;
1244
+ private hasContent;
756
1245
  }
757
1246
  //#endregion
758
1247
  //#region src/storage/memory-doc-storage.d.ts
@@ -1079,4 +1568,4 @@ declare function hostForAbsMs(ranges: MainClipRange[], absMs: number): MainClipR
1079
1568
  */
1080
1569
  declare function relativePositionForAbs(ranges: MainClipRange[], absMs: number): TrackItemTimePosition;
1081
1570
  //#endregion
1082
- export { type Aggregation, type Attachment, type BgmPart, type CaptionPart, type CaptionStyle, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, IMPLEMENTED_SEMANTIC_OP_KINDS, type ImplementedSemanticOpKind, LANE_KINDS_IN_STACK_ORDER, type LaneKind, type MainClipRange, type MakeEmptyPart, ManualSyncDoc, type ManualSyncDocOptions, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUpdateMeta, MirrorVideoDocumentAdapter, type MirrorVideoDocumentOptions, type OpActor, type PartAggregation, type PartKind, type PartUnion, type PlannedSemanticOpKind, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, SchemaValidator, type SemanticDocumentAdapter, SemanticEditor, type SemanticOpInput, type SemanticOpKind, type SemanticOpName, type SnapshotReadable, type SolvedVideoDocument, type SpeechHostMap, type SpeechPart, type SpeedShift, TIMELINE_SKELETON_DURATION_MS, type Timeline, type TimelineDoc, type TimelineItem, type Track, type TrackDraft, type TrackItem, type TrackItemDraft, type TrackItemTimePosition, type TransactAudit, ValidationError, type VideoClipPart, type VideoDocument, type VideoDocumentDraft, type VideoDocumentMirrorSchema, VideoDocumentValidationError, type VideoDocumentValidationIssue, type VideoDocumentValidationIssueCode, type VideoDraft, type CaptionPart$1 as VideoDraftCaptionPart, type VideoDraftContent, type VideoDraftPartUnion, type Timeline$1 as VideoDraftTimeline, type Track$1 as VideoDraftTrack, type TrackItem$1 as VideoDraftTrackItem, type WaitForServerAckOptions, arrangeMainTrackSeamlessly, assertValidVideoDocument, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, decodeDocVersionMark, derivePositionFromAbs, encodeDocVersionMark, ensureLaneTrack, fillMainTrackTimeGaps, findLaneTrack, fromVideoDocument, generatePartId, getAt, hostForAbsMs, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, laneTrackId, mainTrackRanges, partDurationMs, partUnionSchema, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, resolveAllSpeechOverlaps, resolveSpeechOverlapByShiftingVideos, safeDurationMs, index_d_exports as schemas, snapshotToPlain, solveVideoDocument, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
1571
+ export { type Aggregation, type AssembledCaptionContent, type AssembledPhoneticScriptContent, type Attachment, type AudioMediaAssetFact, type BgmPart, type CaptionContentInput, type CaptionPart, type CaptionSegmentSelection, type CaptionStyle, type ClipEntityId, type ClipPlacement, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DeleteBgmInput, type DeleteClipInput, type DeleteClipTreeInput, type DeleteVoiceoverInput, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, type DocumentAudioScript, ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION, type EditorFoundation, type EntityGraphCommitOptions, EntityGraphHttpClient, type EntityGraphState, EntityTimelineEditor, type EntityTimelineIdFactory, EntityTimelineProjectionError, type EntityTimelineTrackRole, IMPLEMENTED_SEMANTIC_OP_KINDS, type ImageMediaAssetFact, type ImplementedSemanticOpKind, type ImportedMediaAsset, type InitialDocumentFacts, type InsertCaptionClipInput, type InsertClipInput, type InsertMediaClipInput, type InsertMediaClipsInput, type InsertPlacedClipInput, type JournalEntry, LANE_KINDS_IN_STACK_ORDER, type LaneKind, type LinearClipSpeed, type MainClipRange, type MakeEmptyPart, ManualSyncDoc, type ManualSyncDocOptions, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type MediaAssetFact, type MediaClipInsertion, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocumentVersion, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUpdateMeta, MirrorVideoDocumentAdapter, type MirrorVideoDocumentOptions, type MoveClipInput, type MoveClipsToStartsInput, type MoveSequentialClipsInput, type MoveVoiceoverInput, type OpActor, type PartAggregation, type PartIdFactory, type PartKind, type PartUnion, type PatchCaptionStyleInput, PlainMemoryAdapter, type PlainMemoryAdapterOptions, type PlannedSemanticOpKind, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type ReplaceClipContentInput, type ReplaceMediaClipInput, type ReplaceSequentialClipsInput, type ReplacementMediaClipInput, type ResolvedEntityClipPlacement, type ResolvedEntityTimelineLayout, type ResolvedEntityTrack, SchemaValidator, ScriptCompositionError, type SemanticDocumentAdapter, SemanticEditor, type SemanticOpInput, type SemanticOpKind, type SemanticOpName, type SequentialClipAnchor, type SetBgmInput, type SetCaptionVisibilityInput, type SetClipPlacementInput, type SetClipSpeedInput, type SetClipVolumeInput, type SnapshotReadable, type SolvedVideoDocument, type SpeechHostMap, type SpeechPart, type SpeedShift, TIMELINE_SKELETON_DURATION_MS, type Timeline, type TimelineDoc, type TimelineItem, type Track, type TrackDraft, type TrackItem, type TrackItemDraft, type TrackItemTimePosition, type TransactAudit, type TrimClipInput, type UpdateClipInput, type UpdateClipMarkerInput, VIDEO_DOCUMENT_SCHEMA_VERSION, ValidationError, type VideoClipPart, type VideoDocument, type VideoDocumentDraft, type VideoDocumentMirrorSchema, type VideoDocumentSchemaVersion, VideoDocumentValidationError, type VideoDocumentValidationIssue, type VideoDocumentValidationIssueCode, type VideoDraft, type CaptionPart$1 as VideoDraftCaptionPart, type VideoDraftPartUnion, type Timeline$1 as VideoDraftTimeline, type Track$1 as VideoDraftTrack, type TrackItem$1 as VideoDraftTrackItem, type VideoMediaAssetFact, type VisualMediaAssetFact, type VoiceMediaAssetFact, type VoiceoverCaptionFact, type VoiceoverTakeInput, type VoiceoverTakeResult, type WaitForServerAckOptions, applyEntityTimelineProjection, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertMediaAssetWritePolicy, assertValidVideoDocument, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, createEditSandbox, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, createPlainMemoryAdapter, decodeDocVersionMark, derivePositionFromAbs, effectiveVideoClipDurationMs, encodeDocVersionMark, ensureEditorFoundation, ensureLaneTrack, fillMainTrackTimeGaps, findComposedAudioScript, findLaneTrack, fromVideoDocument, generatePartId, getAt, hostForAbsMs, importMediaAsset, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, laneTrackId, mainTrackRanges, migrateLegacyTimelineToEntities, partDurationMs, partUnionSchema, prepareCaptionContent, projectEntityTimeline, readDocumentAudioScript, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, replayJournal, resolveAllSpeechOverlaps, resolveEntityTimelineLayout, resolveSpeechOverlapByShiftingVideos, safeDurationMs, index_d_exports as schemas, selectAudioScriptSegments, snapshotToPlain, solveVideoDocument, speedOf, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema, writeVideoDocumentToDraft };