@mengine/medeo-client 1.4.0 → 1.4.1-alpha.1

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 VideoDocumentSchemaVersion, A as assertValidVideoDocument, B as BgmPart, C as index_d_exports, D as VideoDocumentMirrorSchema, E as VideoDocumentDraft, F as SpeechHostMap, G as SpeechPart, H as DEFAULT_UNIT_TIME_MS, I as buildSpeechHostMap, J as TrackItem, K as Timeline, L as derivePositionFromAbs, M as InitialDocumentFacts, N as buildInitialVideoDocument, O as videoDocumentMirrorSchema, P as DerivedItemPosition, Q as VideoDocument, R as fromVideoDocument, S as ValidationError, T as TrackItemDraft, U as PartKind, V as CaptionPart, W as PartUnion, X as VIDEO_DOCUMENT_SCHEMA_VERSION, Y as TrackItemTimePosition, Z as VideoClipPart, _ as PlannedSemanticOpKind, a as MirrorVideoDocumentOptions, at as CaptionPart$1, b as SchemaValidator, c as CommitOptions, ct as SpeedShift, d as SemanticEditor, dt as TrackItem$1, et as VideoDocumentValidationIssue, f as SemanticOpInput, g as ImplementedSemanticOpKind, h as IMPLEMENTED_SEMANTIC_OP_KINDS, i as MirrorVideoDocumentAdapter, it as Attachment, j as validateVideoDocument, k as VideoDocumentValidationError, l as OpActor, lt as Timeline$1, m as TransactAudit, n as videoDocumentSchema, nt as VideoDraft, o as createMirrorVideoDocument, ot as CaptionStyle, p as SemanticOpName, q as Track, r as readVideoDocumentFromDraft, rt as VideoDraftPartUnion, s as createMirrorVideoDocumentAdapter, st as PartAggregation, t as partUnionSchema, tt as VideoDocumentValidationIssueCode, u as SemanticDocumentAdapter, ut as Track$1, v as SemanticOpKind, w as TrackDraft, x as SnapshotReadable, y as isImplementedSemanticOpKind, z as toVideoDocument } from "./index-CX7IXsnp.js";
1
+ import { t as index_d_exports } from "./index-CMa6ZCtX.js";
2
+ import { $ as SequenceRange, A as generatePartId, At as VideoDraftPartUnion, B as ResolvedEntityClipPlacement, Bt as TrackItem$1, C as PlannedSemanticOpKind, Ct as VIDEO_DOCUMENT_SCHEMA_VERSION, D as SnapshotReadable, Dt as VideoDocumentValidationIssue, E as SchemaValidator, Et as VideoDocumentSchemaVersion, F as videoDocumentMirrorSchema, Ft as CaptionStyle, G as EntityTimelineProjectionError, H as ResolvedEntityTrack, I as VideoDocumentValidationError, It as PartAggregation, J as RelationRow, K as EntityRelationRows, L as assertValidVideoDocument, Lt as SpeedShift, M as TrackItemDraft, Mt as speedOf, N as VideoDocumentDraft, Nt as Attachment, O as ValidationError, Ot as VideoDocumentValidationIssueCode, P as VideoDocumentMirrorSchema, Pt as CaptionPart$1, Q as SequenceDuration, R as validateVideoDocument, Rt as Timeline$1, S as ImplementedSemanticOpKind, St as TrackItemTimePosition, T as isImplementedSemanticOpKind, Tt as VideoDocument, U as resolveEntityTimelineLayout, V as ResolvedEntityTimelineLayout, W as projectEntityTimeline, X as CaptionStyleFields, Y as CaptionSegmentSelection, Z as ScriptTextSegment, _ as SemanticEditor, _t as PartUnion, a as PlainMemoryAdapter, at as buildInitialVideoDocument, b as TransactAudit, bt as Track, c as MirrorVideoDocumentAdapter, ct as buildSpeechHostMap, d as createMirrorVideoDocument, dt as toVideoDocument, et as VoiceDescriptor, f as createMirrorVideoDocumentAdapter, ft as BgmPart, g as SemanticDocumentAdapter, gt as PartKind, h as OpActor, ht as ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION, i as JournalEntry, it as InitialDocumentFacts, j as TrackDraft, jt as effectiveVideoClipDurationMs, k as PartIdFactory, kt as VideoDraft, l as MirrorVideoDocumentOptions, lt as derivePositionFromAbs, m as CommitOptions, mt as DEFAULT_UNIT_TIME_MS, n as videoDocumentSchema, nt as JsonValue, o as PlainMemoryAdapterOptions, ot as DerivedItemPosition, p as writeVideoDocumentToDraft, pt as CaptionPart, q as EntityRow, r as readVideoDocumentFromDraft, rt as EntityId, s as createPlainMemoryAdapter, st as SpeechHostMap, t as partUnionSchema, tt as JsonObject, u as applyEntityTimelineProjection, ut as fromVideoDocument, v as SemanticOpInput, vt as SpeechPart, w as SemanticOpKind, wt as VideoClipPart, x as IMPLEMENTED_SEMANTIC_OP_KINDS, xt as TrackItem, y as SemanticOpName, yt as Timeline, z as EntityTimelineTrackRole, zt as Track$1 } from "./index-Bs60N9Hl.js";
2
3
  import { LoroDoc, 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,629 @@ 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;
213
+ /**
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
+ /** Current AudioScript content version attached to the project. */
225
+ readonly audioScriptEntityId: string;
226
+ readonly revision: number;
227
+ readonly loroSnapshot: string;
228
+ readonly rows: EntityRelationRows;
229
+ }
230
+ interface EntityGraphCommitOptions {
231
+ /** Server version vector proving the explicit legacy-to-Entity migration baseline. */
232
+ readonly migrationBaseVv?: string;
233
+ }
234
+ /** Browser-safe authenticated Loro 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
+ * Compile edits against the original causal snapshot and publish native Loro operations.
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: Pick<EntityGraphState, 'revision' | 'rows' | 'loroSnapshot'>, nextRows: EntityRelationRows, options?: EntityGraphCommitOptions): Promise<EntityGraphState>;
249
+ /** Send the same prepared bytes on retry; never recompile an unconfirmed edit. */
250
+ commitUpdate(update: string): Promise<EntityGraphState>;
251
+ private request;
252
+ }
253
+ //#endregion
254
+ //#region src/entity-editor/types.d.ts
255
+ /** Injectable domain-id mint shared by Entity and Relation authoring surfaces. */
256
+ type EntityTimelineIdFactory = (prefix: 'entity' | 'relation') => string;
257
+ interface ImageMediaAssetFact {
258
+ readonly assetId: string;
259
+ readonly kind: 'image';
260
+ readonly storageKey?: string;
261
+ }
262
+ interface VideoMediaAssetFact {
263
+ readonly assetId: string;
264
+ readonly kind: 'video';
265
+ readonly durationMs: number;
266
+ readonly storageKey?: string;
267
+ }
268
+ interface AudioMediaAssetFact {
269
+ readonly assetId: string;
270
+ readonly kind: 'audio';
271
+ readonly durationMs: number;
272
+ readonly storageKey: string;
273
+ }
274
+ interface VoiceMediaAssetFact {
275
+ /** Stable external speech result id, independent of the placed Clip id. */
276
+ readonly assetId: string;
277
+ readonly kind: 'voice';
278
+ readonly durationMs: number;
279
+ readonly storageKey: string;
280
+ /** Present for synthesized voice, absent for original recorded audio. */
281
+ readonly voice?: VoiceDescriptor;
282
+ }
283
+ /** Facts resolved from media storage. A trim window never substitutes for intrinsic duration. */
284
+ type MediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact | AudioMediaAssetFact | VoiceMediaAssetFact;
285
+ type ClipPlacement = {
286
+ readonly kind: 'sequential';
287
+ readonly order: number;
288
+ } | {
289
+ readonly kind: 'absolute';
290
+ readonly targetRange: SequenceRange<number>;
291
+ } | {
292
+ readonly kind: 'anchored';
293
+ readonly hostClipEntityId: string;
294
+ readonly anchorOffset: number;
295
+ };
296
+ interface InsertPlacedClipInput {
297
+ readonly trackEntityId: string;
298
+ readonly contentEntityId: string;
299
+ readonly sourceRange: SequenceRange<number>;
300
+ readonly duration: SequenceDuration<number>;
301
+ readonly placement: ClipPlacement;
302
+ readonly clipPayload?: JsonObject;
303
+ /** Stable caller-owned placement identity, when one already exists outside the graph. */
304
+ readonly clipEntityId?: string;
305
+ }
306
+ interface SetClipPlacementInput {
307
+ readonly clipEntityId: string;
308
+ readonly placement: ClipPlacement;
309
+ }
310
+ type SequentialClipAnchor = {
311
+ readonly position: 'before' | 'after';
312
+ readonly clipEntityId: string;
313
+ } | {
314
+ readonly position: 'trackStart';
315
+ };
316
+ interface MoveSequentialClipsInput {
317
+ readonly clipEntityIds: readonly string[];
318
+ readonly anchor: SequentialClipAnchor;
319
+ readonly onAnchored: 'follow' | 'keepAbsolute';
320
+ }
321
+ interface MoveClipsToStartsInput {
322
+ readonly moves: readonly {
323
+ readonly clipEntityId: string;
324
+ readonly newStartMs: number;
325
+ }[];
326
+ /** Absolute-time drags preserve every voiceover's current visible landing. */
327
+ readonly onAnchored: 'keepAbsolute';
328
+ }
329
+ interface DeleteClipTreeInput {
330
+ readonly clipEntityIds: readonly string[];
331
+ readonly onAnchored: 'cascade' | 'detach';
332
+ }
333
+ interface VoiceoverCaptionFact {
334
+ /** Stable placed caption identity supplied by the materialized side effect. */
335
+ readonly captionClipEntityId: string;
336
+ /** Directly held bases; includes the AudioScript used by the Voice. */
337
+ readonly baseEntityIds: readonly string[];
338
+ /** Ordered selection of AudioScript segments; caption text is never passed inline. */
339
+ readonly selections: readonly CaptionSegmentSelection[];
340
+ readonly startMs: number;
341
+ readonly durationMs: number;
342
+ readonly style?: CaptionStyleFields;
343
+ }
344
+ type VoiceoverTakeInput = {
345
+ readonly timelineEntityId: string; /** Stable placed speech identity, distinct from media.assetId. */
346
+ readonly voiceoverClipEntityId: string;
347
+ readonly media: VoiceMediaAssetFact; /** Existing pronunciation variant; its composed AudioScript stays the text owner. */
348
+ readonly phoneticScriptEntityId: string;
349
+ readonly volume: number;
350
+ readonly captions: readonly VoiceoverCaptionFact[];
351
+ } & ({
352
+ readonly placement: ClipPlacement;
353
+ readonly hostClipEntityId?: never;
354
+ readonly anchorOffset?: never;
355
+ } | {
356
+ readonly placement?: never;
357
+ readonly hostClipEntityId: string;
358
+ readonly anchorOffset: number;
359
+ });
360
+ type VisualMediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact;
361
+ interface InsertMediaClipInput {
362
+ readonly timelineEntityId: string;
363
+ readonly clipEntityId?: string;
364
+ readonly media: VisualMediaAssetFact;
365
+ /** Source/display window in whole milliseconds. Images use this as their finite display span. */
366
+ readonly sourceRange: SequenceRange<number>;
367
+ readonly placement: ClipPlacement;
368
+ readonly volume?: number;
369
+ }
370
+ interface ReplaceMediaClipInput {
371
+ readonly clipEntityId: string;
372
+ readonly media: VisualMediaAssetFact;
373
+ readonly sourceRange: SequenceRange<number>;
374
+ }
375
+ interface ReplacementMediaClipInput {
376
+ readonly clipEntityId?: string;
377
+ readonly media: VisualMediaAssetFact;
378
+ readonly sourceRange: SequenceRange<number>;
379
+ readonly volume?: number;
380
+ }
381
+ type MediaClipInsertion = {
382
+ readonly kind: 'before';
383
+ readonly clipEntityId: string;
384
+ } | {
385
+ readonly kind: 'after';
386
+ readonly clipEntityId: string;
387
+ } | {
388
+ readonly kind: 'firstStart';
389
+ readonly startMs: number;
390
+ };
391
+ interface InsertMediaClipsInput {
392
+ readonly timelineEntityId: string;
393
+ readonly clips: readonly ReplacementMediaClipInput[];
394
+ /** One placement decision for the whole input-ordered block. */
395
+ readonly insertion: MediaClipInsertion;
396
+ }
397
+ interface ReplaceSequentialClipsInput {
398
+ readonly timelineEntityId: string;
399
+ readonly oldClipEntityIds: readonly string[];
400
+ readonly newClips: readonly ReplacementMediaClipInput[];
401
+ readonly onAnchored: 'remap' | 'cascade';
402
+ }
403
+ interface SetClipVolumeInput {
404
+ readonly clipEntityId: string;
405
+ /** Playback gain in decibels. */
406
+ readonly volume: number;
407
+ }
408
+ interface LinearClipSpeed {
409
+ readonly kind: 'linear';
410
+ readonly rate: number;
411
+ readonly mode?: string;
412
+ }
413
+ interface SetClipSpeedInput {
414
+ readonly clipEntityId: string;
415
+ readonly timeRemapping: LinearClipSpeed | null;
416
+ }
417
+ interface TrimClipInput {
418
+ readonly clipEntityId: string;
419
+ readonly sourceRange: SequenceRange<number>;
420
+ }
421
+ interface VoiceoverTakeResult {
422
+ readonly voiceoverClipEntityId: string;
423
+ readonly voiceEntityId: string;
424
+ /** The pronunciation variant the Voice was rendered from. */
425
+ readonly phoneticScriptEntityId: string;
426
+ /** The base-text owner resolved from the PhoneticScript baseEntityIds. */
427
+ readonly audioScriptEntityId: string;
428
+ readonly captionClipEntityIds: readonly string[];
429
+ }
430
+ interface MoveVoiceoverInput {
431
+ readonly voiceoverClipEntityId: string;
432
+ /** Absolute requested timeline start; MEngine resolves and persists the host relation. */
433
+ readonly newStartMs: number;
434
+ }
435
+ interface DeleteVoiceoverInput {
436
+ readonly voiceoverClipEntityIds: readonly string[];
437
+ }
438
+ interface SetBgmInput {
439
+ readonly timelineEntityId: string;
440
+ readonly bgmClipEntityId: string;
441
+ readonly media: AudioMediaAssetFact;
442
+ readonly volume: number;
443
+ }
444
+ interface DeleteBgmInput {
445
+ readonly timelineEntityId: string;
446
+ }
447
+ interface SetCaptionVisibilityInput {
448
+ readonly timelineEntityId: string;
449
+ readonly hidden: boolean;
450
+ }
451
+ interface PatchCaptionStyleInput {
452
+ readonly timelineEntityId: string;
453
+ readonly style: CaptionStyleFields;
454
+ }
455
+ interface InsertCaptionClipInput {
456
+ readonly timelineEntityId: string;
457
+ /** Existing generation identity for newly materialized Caption content, distinct from its Clip. */
458
+ readonly captionEntityId?: string;
459
+ /** Stable placed caption identity, distinct from the Caption content identity. */
460
+ readonly captionClipEntityId?: string;
461
+ /** Existing bases composed by this variant; includes an AudioScript text owner. */
462
+ readonly baseEntityIds: readonly string[];
463
+ /** Ordered selection of the AudioScript segments this Caption displays. */
464
+ readonly selections: readonly CaptionSegmentSelection[];
465
+ /** Intrinsic cue length of the Caption entity itself; display comes from the placement. */
466
+ readonly durationMs: number;
467
+ readonly style?: CaptionStyleFields;
468
+ readonly placement: ClipPlacement;
469
+ }
470
+ interface InsertClipInput {
471
+ readonly trackEntityId: string;
472
+ /** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
473
+ readonly contentEntityId: string;
474
+ readonly sourceRange: SequenceRange<number>;
475
+ readonly duration: SequenceDuration<number>;
476
+ readonly targetRange?: SequenceRange<number>;
477
+ readonly clipPayload?: JsonObject;
478
+ }
479
+ interface UpdateClipMarkerInput {
480
+ readonly clipEntityId: string;
481
+ readonly sourceRange?: SequenceRange<number>;
482
+ /** Passing `undefined` explicitly removes the optional target range. */
483
+ readonly targetRange?: SequenceRange<number> | undefined;
484
+ readonly duration?: SequenceDuration<number>;
485
+ /** Passing `undefined` explicitly removes the optional remapping value. */
486
+ readonly timeRemapping?: JsonValue | undefined;
487
+ }
488
+ interface MoveClipInput {
489
+ readonly clipEntityId: string;
490
+ readonly trackEntityId: string;
491
+ }
492
+ interface ReplaceClipContentInput {
493
+ readonly clipEntityId: string;
494
+ /** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
495
+ readonly contentEntityId: string;
496
+ readonly sourceRange: SequenceRange<number>;
497
+ readonly duration: SequenceDuration<number>;
498
+ readonly targetRange?: SequenceRange<number>;
499
+ readonly timeRemapping?: JsonValue;
500
+ }
501
+ interface DeleteClipInput {
502
+ readonly clipEntityId: string;
503
+ }
504
+ interface UpdateClipInput {
505
+ readonly clipEntityId: string;
506
+ /** Complete replacement for the Clip-owned payload. */
507
+ readonly payload: JsonObject;
508
+ }
509
+ type ClipEntityId = EntityId;
510
+ //#endregion
511
+ //#region src/entity-editor/entity-timeline-editor.d.ts
512
+ /**
513
+ * Graph-native timeline authoring over authoritative Medeo Entity and Relation rows.
514
+ *
515
+ * Each mutation is applied to a detached graph, validated as a complete DSL set,
516
+ * and committed only after validation succeeds.
517
+ */
518
+ declare class EntityTimelineEditor {
519
+ private readonly idFactory;
520
+ private state;
521
+ constructor(initialRows: EntityRelationRows, idFactory?: EntityTimelineIdFactory);
522
+ rows(): EntityRelationRows;
523
+ insertClip(input: InsertClipInput): ClipEntityId;
524
+ insertPlacedClip(input: InsertPlacedClipInput): ClipEntityId;
525
+ updateClipMarker(input: UpdateClipMarkerInput): void;
526
+ setClipPlacement(input: SetClipPlacementInput): void;
527
+ moveSequentialClips(input: MoveSequentialClipsInput): void;
528
+ moveClipsToStarts(input: MoveClipsToStartsInput): void;
529
+ moveClip(input: MoveClipInput): void;
530
+ replaceClipContent(input: ReplaceClipContentInput): void;
531
+ insertMediaClip(input: InsertMediaClipInput): ClipEntityId;
532
+ insertMediaClips(input: InsertMediaClipsInput): readonly ClipEntityId[];
533
+ replaceMediaClip(input: ReplaceMediaClipInput): void;
534
+ setClipVolume(input: SetClipVolumeInput): void;
535
+ setClipSpeed(input: SetClipSpeedInput): void;
536
+ trimClip(input: TrimClipInput): void;
537
+ replaceSequentialClips(input: ReplaceSequentialClipsInput): readonly ClipEntityId[];
538
+ deleteClip(input: DeleteClipInput): void;
539
+ deleteClipTree(input: DeleteClipTreeInput): void;
540
+ updateClip(input: UpdateClipInput): void;
541
+ upsertVoiceoverTake(input: VoiceoverTakeInput): VoiceoverTakeResult;
542
+ moveVoiceover(input: MoveVoiceoverInput): void;
543
+ deleteVoiceover(input: DeleteVoiceoverInput): void;
544
+ setBgm(input: SetBgmInput): ClipEntityId;
545
+ deleteBgm(input: DeleteBgmInput): void;
546
+ setCaptionVisibility(input: SetCaptionVisibilityInput): void;
547
+ patchCaptionStyle(input: PatchCaptionStyleInput): void;
548
+ /**
549
+ * Place a Caption as a composed variant of an existing AudioScript: the
550
+ * entity stores baseEntityIds, selection, optional style, and inherent cue-bounded
551
+ * Sequence. This helper does not copy base text. The Clip and its display Marker describe this use;
552
+ * moving or stretching the returned Clip later changes the Clip/Marker,
553
+ * never the Caption entity or the AudioScript.
554
+ */
555
+ insertCaptionClip(input: InsertCaptionClipInput): ClipEntityId;
556
+ private insertPlacedClipIntoDraft;
557
+ private ensureRoleTrack;
558
+ /** The existing pronunciation variant a Voice consumes; composition is required. */
559
+ private requireComposedPhoneticScript;
560
+ /** Preserve the factual synthesis input, regardless of persisted endpoint positions. */
561
+ private ensurePhoneticRender;
562
+ private reconcileVoiceoverCaptions;
563
+ private ensureRoleTrackForClip;
564
+ private replaceCaptionAlignment;
565
+ /**
566
+ * Remove one placed Caption use. The composed AudioScript outlives the
567
+ * caption: it may anchor further captions and remains the text owner.
568
+ */
569
+ private removeCaptionClipGraph;
570
+ private replaceAnchorHost;
571
+ /** Rebuild the legacy edit baseline from current visual order before a high-level cascade. */
572
+ private normalizeMainSequential;
573
+ private resolveOneVoiceoverOverlap;
574
+ private applyClipPlacement;
575
+ private reanchorAtAbsolute;
576
+ private removeAnchoredDescendants;
577
+ private removeClipGraph;
578
+ private transact;
579
+ private mintEntityId;
580
+ private createRelation;
581
+ private relinkRelation;
582
+ private mintRelationId;
583
+ }
584
+ //#endregion
585
+ //#region src/entity-editor/editor-resources.d.ts
586
+ declare const roleOrder: {
587
+ readonly caption: 0;
588
+ readonly video_clip: 1;
589
+ readonly speech: 2;
590
+ readonly bgm: 3;
591
+ };
592
+ type EditorTrackRole = keyof typeof roleOrder;
593
+ interface EditorFoundation {
594
+ readonly rows: EntityRelationRows;
595
+ readonly timelineEntityId: string;
596
+ readonly trackEntityIds: Readonly<Record<EditorTrackRole, string>>;
597
+ /** Initial or current AudioScript content ID selected by the foundation. */
598
+ readonly audioScriptEntityId: string;
599
+ }
600
+ /**
601
+ * MEngine editor policy, not a cardinality restriction on the general-purpose DSL.
602
+ *
603
+ * Media variants share one entity identity with their Asset: every
604
+ * Image/Video/Audio/Voice Entity must carry its own external locator, every
605
+ * external asset id has exactly one claimant, and no media variant may be
606
+ * bound through a legacy `physical-asset` Relation. Dual-entity media graphs
607
+ * are rejected, not migrated. Caption composes AudioScript text and may associate with a physical text Asset.
608
+ */
609
+ declare function assertCanonicalEditorResources(rows: EntityRelationRows): void;
181
610
  /**
182
- * Part-id generation, aligned with the online ecosystem.
611
+ * Commit-transition policy shared by the editor, the HTTP commit boundary, the
612
+ * host tool, and the entity stores. It compares the authoritative before and
613
+ * after rows of one CAS commit and enforces the single-identity write rules
614
+ * on the complete after state, with no exemption for historical graphs:
183
615
  *
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.
616
+ * 1. every Image/Video/Audio/Voice Entity carries its own Asset `external`
617
+ * identity;
618
+ * 2. no `physical-asset` Relation may bind a media variant;
619
+ * 3. a self-carried media identity is immutable — it cannot be rewritten to
620
+ * another asset id.
621
+ *
622
+ * Dual-entity media graphs are rejected instead of being migrated or merged
623
+ * implicitly. Deleting media is explicit and allowed.
624
+ */
625
+ declare function assertMediaAssetWritePolicy(before: EntityRelationRows, after: EntityRelationRows): void;
626
+ /** Add only missing editor structure; existing identities and owned settings are never replaced. */
627
+ declare function ensureEditorFoundation(initial: EntityRelationRows, idFactory?: EntityTimelineIdFactory, timelinePayload?: EntityRow['payload']): EditorFoundation;
628
+ //#endregion
629
+ //#region src/entity-editor/media-asset-import.d.ts
630
+ interface ImportedMediaAsset {
631
+ readonly rows: EntityRelationRows;
632
+ /** The single media variant identity for this asset id; it is its own Asset. */
633
+ readonly contentEntityId: string;
634
+ }
635
+ /**
636
+ * Import at the editor boundary, not at asset generation time. Existing
637
+ * provenance is retained.
191
638
  *
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.
639
+ * A media variant is a logical facet of its Asset and shares one entity
640
+ * identity: the import mints exactly one entity of the media kind that carries
641
+ * the external locator itself, and deduplicates only against existing variants
642
+ * that already carry the same `(system, key)`. Legacy dual-entity graphs
643
+ * (`asset` row plus a `physical-asset` binding) are not reused and are
644
+ * rejected by the canonical resource policy instead of being migrated.
645
+ */
646
+ declare function importMediaAsset(initial: EntityRelationRows, fact: MediaAssetFact, idFactory?: EntityTimelineIdFactory): ImportedMediaAsset;
647
+ //#endregion
648
+ //#region src/entity-editor/legacy-entity-migration.d.ts
649
+ /** One-time import only. Ordinary editor operations must never reverse-diff a legacy document. */
650
+ declare function migrateLegacyTimelineToEntities(legacy: VideoDocument, assetFacts: readonly MediaAssetFact[], initial?: EntityRelationRows, idFactory?: EntityTimelineIdFactory): EntityRelationRows;
651
+ /** Server gate: a cutover may change representation, never the existing render facts. */
652
+ declare function assertEntityProjectionPreservesLegacy(legacy: VideoDocument, projection: VideoDocument, rows: EntityRelationRows): void;
653
+ //#endregion
654
+ //#region src/entity-editor/caption-content.d.ts
655
+ interface CaptionContentInput {
656
+ readonly contentEntityId: string;
657
+ readonly audioScriptEntityId: string;
658
+ readonly text: string;
659
+ readonly selections?: readonly CaptionSegmentSelection[];
660
+ readonly durationMs: number;
661
+ }
662
+ /** Author Caption content from semantic intent; callers never reconcile variant bases or assembled fields. */
663
+ declare function prepareCaptionContent(rows: EntityRelationRows, input: CaptionContentInput): EntityRow<'caption'>;
664
+ //#endregion
665
+ //#region src/entity-editor/document-audio-script.d.ts
666
+ interface DocumentAudioScript {
667
+ readonly entityId: string;
668
+ readonly segments: readonly (ScriptTextSegment & Readonly<Record<string, unknown>>)[];
669
+ }
670
+ /** State exposing the current AudioScript content version attached to the project. */
671
+ interface DocumentAudioScriptState {
672
+ readonly rows: EntityRelationRows;
673
+ /** Current attachment; initialized projects point to a real script, including an empty one. */
674
+ readonly audioScriptEntityId: string | null;
675
+ }
676
+ /** Read only the attached version and preserve every segment; never aggregate other scripts. */
677
+ declare function readDocumentAudioScript(state: DocumentAudioScriptState): DocumentAudioScript;
678
+ //#endregion
679
+ //#region src/entity-crdt/entity-document.d.ts
680
+ declare const LORO_ENTITY_SCHEMA = "medeo.entities.loro.v1";
681
+ interface EntityDocumentState {
682
+ readonly rows: EntityRelationRows;
683
+ readonly project: Readonly<Record<string, string>>;
684
+ }
685
+ type Command = {
686
+ type: 'create';
687
+ row: EntityRow;
688
+ } | {
689
+ type: 'selection-baseline';
690
+ root: string;
691
+ fingerprint: string;
692
+ } | {
693
+ type: 'order';
694
+ group: string;
695
+ roots: string[];
696
+ token: string;
697
+ } | {
698
+ type: 'write';
699
+ root: string;
700
+ payload: JsonObject;
701
+ token: string;
702
+ } | {
703
+ type: 'text';
704
+ root: string;
705
+ path: readonly (string | number)[];
706
+ start: number;
707
+ deleteCount: number;
708
+ text: string;
709
+ token: string;
710
+ } | {
711
+ type: 'delete';
712
+ root: string;
713
+ } | {
714
+ type: 'relation';
715
+ row: RelationRow;
716
+ } | {
717
+ type: 'relation-fields';
718
+ root: string;
719
+ metadata: JsonObject;
720
+ trace: JsonObject;
721
+ } | {
722
+ type: 'unlink';
723
+ root: string;
724
+ } | {
725
+ type: 'attach';
726
+ slot: string;
727
+ entityId: string;
728
+ };
729
+ /** Plain domain objects assembled from native Loro state, never a second writable authority. */
730
+ declare function readEntityDocument(doc: LoroDoc, allowSelectionConflicts?: boolean): EntityDocumentState;
731
+ /** Native editing containers survive domain version changes and merge independently. */
732
+ declare class LoroEntityDocument {
733
+ readonly doc: LoroDoc;
734
+ private readonly validate?;
735
+ private readonly undoManager;
736
+ constructor(doc: LoroDoc, validate?: ((state: EntityDocumentState) => void) | undefined);
737
+ /** Open a causal snapshot using the same Loro runtime as the compiler. */
738
+ static fromSnapshot(snapshot: Uint8Array, validate?: (state: EntityDocumentState) => void): LoroEntityDocument;
739
+ static create(rows: EntityRelationRows, project?: Readonly<Record<string, string>>, peerId?: PeerID): LoroEntityDocument;
740
+ snapshot(): EntityDocumentState;
741
+ relationsOf(entityId: string): readonly RelationRow[];
742
+ getVersion(id: string): EntityRow | undefined;
743
+ /** The callback and every domain validation execute on a causally complete fork first. */
744
+ transact(edit: (draft: LoroEntityDraft) => void): Uint8Array;
745
+ /** Import preserves native operation identities; projection errors never discard remote operations. */
746
+ import(update: Uint8Array): void;
747
+ canUndo(): boolean;
748
+ canRedo(): boolean;
749
+ undo(): boolean;
750
+ redo(): boolean;
751
+ private historyEdit;
752
+ }
753
+ declare class LoroEntityDraft {
754
+ private readonly doc;
755
+ readonly commands: Command[];
756
+ private readonly selectedRoots;
757
+ constructor(doc: LoroDoc);
758
+ snapshot(): EntityDocumentState;
759
+ order(groupId: string, entityIds: readonly string[]): void;
760
+ create(row: EntityRow): void;
761
+ delete(entityId: string): void;
762
+ attach(slot: string, entityId: string): void;
763
+ link(row: RelationRow): void;
764
+ patchRelation(relationId: string, metadata: JsonObject, trace: JsonObject): void;
765
+ unlink(relationId: string): void;
766
+ private relationRoot;
767
+ update(entityId: string, fields: JsonObject): void;
768
+ declare(entityId: string, fields: JsonObject): void;
769
+ replaceOwned(entityId: string, payload: JsonObject): void;
770
+ editText(entityId: string, path: readonly (string | number)[], start: number, deleteCount: number, text: string): void;
771
+ captureSelectionBaselines(): void;
772
+ private record;
773
+ }
774
+ //#endregion
775
+ //#region src/entity-crdt/compile-rows.d.ts
776
+ /** Lower a detached ordinary-object edit against its actual causal Loro baseline. */
777
+ declare function compileEntityRows(snapshot: Uint8Array, rows: EntityRelationRows, validate?: (state: EntityDocumentState) => void): {
778
+ update: Uint8Array;
779
+ state: EntityDocumentState;
780
+ };
781
+ /** Compile an edit on an existing peer, retaining its native local undo history. */
782
+ declare function applyEntityRows(editor: LoroEntityDocument, rows: EntityRelationRows): {
783
+ update: Uint8Array;
784
+ state: EntityDocumentState;
785
+ };
786
+ //#endregion
787
+ //#region src/editor/journal.d.ts
788
+ /**
789
+ * Wire a plain-memory adapter + editor that share a recording id factory, so
790
+ * every mutating transact lands in `journal` with ordered `generated_ids`.
197
791
  */
792
+ declare function createEditSandbox(document: VideoDocument, options?: PlainMemoryAdapterOptions): {
793
+ adapter: PlainMemoryAdapter;
794
+ editor: SemanticEditor;
795
+ journal: readonly JournalEntry[];
796
+ };
198
797
  /**
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.
798
+ * Re-drive `doc` from a recorded journal, forcing each entry's `generated_ids`
799
+ * through a queue-backed id factory. Never mints fresh ids: an empty queue on
800
+ * demand throws `unrecorded id`; leftover ids after an entry throws
801
+ * `unconsumed ids`. Legacy entries without `generated_ids` are treated as `[]`.
204
802
  */
205
- type PartIdPrefix = 'clip' | 'spe' | 'cap' | 'bgm' | 'ti';
206
- declare function generatePartId(prefix: PartIdPrefix): string;
803
+ declare function replayJournal(doc: SemanticDocumentAdapter, journal: readonly JournalEntry[]): Promise<void>;
207
804
  //#endregion
208
805
  //#region src/editor/snapshot-utils.d.ts
209
806
  /** Main-track item identity read from a raw snapshot (only `part_id` is needed). */
@@ -296,9 +893,7 @@ type PushResultKind = 'ack' | 'duplicate' | 'rejected' | 'failed' | 'nothing_to_
296
893
  */
297
894
  interface PushResult {
298
895
  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`. */
896
+ /** Server-allocated sequence number; only present for `ack`. */
302
897
  updateSeq?: number | undefined;
303
898
  /** Whether the server held ops the local document lacked. See above. */
304
899
  collaborated: boolean;
@@ -424,6 +1019,16 @@ declare class ManualSyncDoc {
424
1019
  editorPeerId(): PeerID;
425
1020
  /** Current document projected to the legacy `VideoDraft` read shape. */
426
1021
  draft(): VideoDraft;
1022
+ /**
1023
+ * Replay a deterministic sandbox journal into this document.
1024
+ *
1025
+ * The adapter stays private so callers cannot bypass the manual-sync
1026
+ * lifecycle; journal replay is the one host-side operation that needs the
1027
+ * adapter's transaction boundary and recorded id queue. Durability is still
1028
+ * explicit: call {@link push} after replay and report success only from its
1029
+ * verdict.
1030
+ */
1031
+ replayJournal(journal: readonly JournalEntry[]): Promise<void>;
427
1032
  /**
428
1033
  * Mark the document state the caller has just observed, for a later
429
1034
  * {@link hasChangedSince}.
@@ -577,22 +1182,12 @@ declare class MedeoHttpDocStorage implements DocStorage {
577
1182
  * tool-level ack wait) subscribe here.
578
1183
  */
579
1184
  subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
580
- /** Authoritative HTTP reads and accepted pushes, never inferred from SSE bytes. */
581
- subscribeServerVersion(callback: (version: Uint8Array) => void): () => void;
582
- private reportServerVersion;
583
1185
  deleteDoc(_docId: string): Promise<void>;
584
1186
  subscribeDocUpdate(callback: (update: DocUpdate, origin: unknown) => void): () => void;
585
1187
  private assertDocId;
586
1188
  private emitUpdate;
587
1189
  }
588
1190
  //#endregion
589
- //#region src/session/document-undo-manager.d.ts
590
- /** Availability for this document's current editing session, not server revisions. */
591
- interface MengineUndoState {
592
- readonly canUndo: boolean;
593
- readonly canRedo: boolean;
594
- }
595
- //#endregion
596
1191
  //#region src/session/types.d.ts
597
1192
  /**
598
1193
  * Local storage contract the runtime depends on. Aliased to the engine
@@ -635,14 +1230,6 @@ interface WaitForServerAckOptions {
635
1230
  /** Deadline in ms. Rejects with reason `timeout` when it elapses. */
636
1231
  timeoutMs?: number;
637
1232
  }
638
- /** Document-level confirmation is independent of local operation completion. */
639
- interface MengineDocSyncState {
640
- /** Remote-only imports do not create a new local confirmation obligation. */
641
- readonly confirmation: 'unknown' | 'pending' | 'confirmed';
642
- /** Transport/activity phase. Idle does not imply confirmation; failure details
643
- * remain available through push outcomes and confirmation wait errors. */
644
- readonly phase: 'connecting' | 'idle' | 'syncing' | 'offline' | 'failed';
645
- }
646
1233
  interface MengineDocSessionOptions {
647
1234
  docId: string;
648
1235
  client: MengineHttpClient;
@@ -653,14 +1240,23 @@ interface MengineDocSessionOptions {
653
1240
  */
654
1241
  localStorage?: DocStorageLike;
655
1242
  sseReconnectDelayMs?: number;
1243
+ /**
1244
+ * Keep remote synchronization read-only: pull snapshot/diffs and subscribe to
1245
+ * SSE updates, but never POST local Loro updates to the server.
1246
+ */
1247
+ readonlyMode?: boolean;
656
1248
  }
657
1249
  /**
658
1250
  * A live editing session for one Medeo document — the single entry point clients
659
1251
  * (FE draft driver, Agent, embeds) use to open, edit, and observe a document.
660
1252
  *
661
- * SemanticEditor writes through MirrorVideoDocumentAdapter directly, while
662
- * DocumentUndoManager observes the same LoroDoc independently. Both mutation
663
- * paths use the session's DocumentMutationGuard, closed before teardown.
1253
+ * It assembles the engine sync stack around one Medeo document:
1254
+ *
1255
+ * local DocStorage ─┐
1256
+ * ├─ ClientServerSynchronizer ── DocManager ── LoroDoc
1257
+ * MedeoHttpDocStorage┘ │
1258
+ * (remote = Rust mengine-server) ▼
1259
+ * MirrorVideoDocumentAdapter + SemanticEditor
664
1260
  *
665
1261
  * `DocManager` owns the `LoroDoc`: local edits committed on the adapter are
666
1262
  * picked up via `subscribeLocalUpdates`, saved to local storage, then pushed to
@@ -681,19 +1277,11 @@ declare class MengineDocSession {
681
1277
  private readonly manager;
682
1278
  private readonly events;
683
1279
  private readonly disposables;
684
- private readonly mutationGuard;
685
1280
  private adapterValue;
686
1281
  private editorValue;
687
- private undoManagerValue;
688
1282
  private started;
689
- private destroyed;
690
- private lifetime;
691
- private hasConnected;
692
- private initialVersionValue;
693
- private localVersionValue;
694
- private pushErrorValue;
695
1283
  /**
696
- * Latest server oplog version seen on an authoritative HTTP response. Lets `waitForServerAck`
1284
+ * Latest server oplog version seen on a push outcome. Lets `waitForServerAck`
697
1285
  * return without waiting when the server is already known to cover the local
698
1286
  * doc (e.g. nothing was edited since the last confirmed push).
699
1287
  */
@@ -708,14 +1296,14 @@ declare class MengineDocSession {
708
1296
  */
709
1297
  subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
710
1298
  /**
711
- * Resolve once the server has durably accepted the local commits as of
1299
+ * Resolve once the server has durably accepted the local document state as of
712
1300
  * *now* — the capability an Agent tool needs to answer "did my edit land?"
713
1301
  * before reporting success.
714
1302
  *
715
1303
  * Call it right after the editor ops whose durability matters. It snapshots the
716
- * latest local commit's version (or the loaded baseline before any edit) and
717
- * resolves when an authoritative server version covers it. Remote-only
718
- * imports do not extend this target, matching the displayed confirmation state.
1304
+ * local doc's current version and resolves on the first push outcome whose
1305
+ * `serverVV` covers that version, i.e. the server log is at least as advanced as
1306
+ * the local doc was when this was called.
719
1307
  *
720
1308
  * Version coverage, not byte identity, is the acceptance test — for two reasons:
721
1309
  * the ops may reach the server inside a merged blob rather than as the exact
@@ -737,39 +1325,20 @@ declare class MengineDocSession {
737
1325
  * step. The committed change drives DocManager's local-update push.
738
1326
  */
739
1327
  get editor(): SemanticEditor;
740
- /** Current document snapshot (read model). */
741
- snapshot(): VideoDocument;
742
- /** Current-session undo/redo availability. Loading and closed sessions report false. */
743
- getUndoState(): MengineUndoState;
744
- /**
745
- * Supplies current availability immediately, then coalesces stack changes in a
746
- * microtask. Session teardown publishes empty availability synchronously.
747
- */
748
- subscribeUndoState(cb: (state: MengineUndoState) => void): () => void;
749
1328
  /**
750
- * Undo a local edit immediately; server confirmation remains asynchronous.
751
- * On a shared LWW field this writes its prior value, potentially overwriting a
752
- * later remote edit to that same field. Returns false if no update is produced.
1329
+ * Opaque version token of the local oplog (base64 `VersionVector.encode`).
1330
+ * Equality-comparable only: equal means no observed change (local or
1331
+ * remote-arrived) since the token was taken. Throws when not started.
753
1332
  */
754
- undo(options?: CommitOptions): boolean;
1333
+ version(): string;
755
1334
  /**
756
- * Restore the state visible before undo without rerunning external side effects.
757
- * Returns false if no update is produced; durable confirmation is separate.
1335
+ * The live document adapter, exposed for journal replay (commit channel).
1336
+ * Replaying through it still goes SemanticEditor → Loro → mengine-server —
1337
+ * no write bypass. Typed by the narrow interface on purpose.
758
1338
  */
759
- redo(options?: CommitOptions): boolean;
760
- /**
761
- * Combine existing semantic operations (e.g. trim a clip and adjust its volume)
762
- * or repeated commits during one drag gesture into a single undo step. A gesture
763
- * that only previews locally and commits once on release needs no group.
764
- * Each commit is immediately visible locally and enters sync independently;
765
- * a later failure does not roll it back.
766
- * Always pair with endUndoGroup in a finally block. Conflicting remote imports
767
- * can end/split the group early, and unrelated local edits would join it.
768
- * Complete asynchronous asset preparation before opening the group.
769
- */
770
- beginUndoGroup(): void;
771
- /** End a gesture, including one already split by a conflicting remote import. */
772
- endUndoGroup(): void;
1339
+ get documentAdapter(): SemanticDocumentAdapter;
1340
+ /** Current document snapshot (read model). */
1341
+ snapshot(): VideoDocument;
773
1342
  /**
774
1343
  * Start the sync stack and connect the document.
775
1344
  *
@@ -778,11 +1347,6 @@ declare class MengineDocSession {
778
1347
  * surfaces through `subscribe`.
779
1348
  */
780
1349
  start(): Promise<VideoDocument>;
781
- getSyncState(): MengineDocSyncState;
782
- private confirmationTarget;
783
- /** Immediately supplies current state; unsubscribe when the host changes docs. */
784
- subscribeSyncState(cb: (state: MengineDocSyncState) => void): () => void;
785
- private emitSyncState;
786
1350
  subscribe(cb: (event: MengineDocSessionUpdateEvent) => void): () => void;
787
1351
  onStateChange(cb: (state: DocState) => void): () => void;
788
1352
  getState(): DocState;
@@ -1124,4 +1688,4 @@ declare function hostForAbsMs(ranges: MainClipRange[], absMs: number): MainClipR
1124
1688
  */
1125
1689
  declare function relativePositionForAbs(ranges: MainClipRange[], absMs: number): TrackItemTimePosition;
1126
1690
  //#endregion
1127
- 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, type InitialDocumentFacts, 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 MengineUndoState, 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, 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 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 };
1691
+ 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, type DocumentAudioScriptState, ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION, type EditorFoundation, EntityDocumentState, 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, LORO_ENTITY_SCHEMA, type LaneKind, type LinearClipSpeed, LoroEntityDocument, LoroEntityDraft, 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, applyEntityRows, applyEntityTimelineProjection, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertMediaAssetWritePolicy, assertValidVideoDocument, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, compileEntityRows, 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, readEntityDocument, 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 };