@mengine/medeo-client 1.3.1-alpha.4 → 1.3.1-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { A as MoveVideoClipsInput, J as ChangeSpeechScriptInput, K as DeleteBgmInput, N as MoveVideoClipsByAnchorInput, O as ReplaceVideoClipContentInput, Q as AdjustVideoClipVolumeInput, R as MoveSpeechesInput, S as SetBgmInput, T as ReplaceVideoClipSequenceInput, V as DeleteVideoClipsInput, W as DeleteSpeechesInput, Y as ChangeSpeechVoiceInput, b as SetCaptionStyleInput, ct as AddSpeechesInput, et as AdjustVideoClipDurationInput, g as SetVideoClipSpeedShiftInput, it as AdjustBgmVolumeInput, nt as AdjustSpeechVolumeInput, ot as AddVideoClipsInput, v as SetCaptionVisibilityInput } from "./index-CMa6ZCtX.js";
1
2
  import { InferInputType } from "loro-mirror";
2
3
  import { z } from "zod";
3
4
  import { LoroDoc, PeerID } from "loro-crdt";
@@ -29,10 +30,10 @@ import { LoroDoc, PeerID } from "loro-crdt";
29
30
  * @enum
30
31
  */
31
32
  declare const PartKind$1: {
32
- readonly BGM: 'bgm';
33
- readonly CAPTION: 'caption';
34
- readonly SPEECH: 'speech';
35
- readonly VIDEO_CLIP: 'video_clip';
33
+ readonly BGM: "bgm";
34
+ readonly CAPTION: "caption";
35
+ readonly SPEECH: "speech";
36
+ readonly VIDEO_CLIP: "video_clip";
36
37
  };
37
38
  /**
38
39
  * @public
@@ -144,8 +145,8 @@ interface CaptionPart$1 {
144
145
  * @enum
145
146
  */
146
147
  declare const AspectRatio: {
147
- readonly RATIO_16_9: '16:9';
148
- readonly RATIO_9_16: '9:16';
148
+ readonly RATIO_16_9: "16:9";
149
+ readonly RATIO_9_16: "9:16";
149
150
  };
150
151
  /**
151
152
  * @public
@@ -156,10 +157,10 @@ type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
156
157
  * @enum
157
158
  */
158
159
  declare const AssetSource: {
159
- readonly AI_IMAGES: 'ai_images';
160
- readonly AI_VIDEOS: 'ai_videos';
161
- readonly MY_UPLOADED_ASSETS: 'my_uploaded_assets';
162
- readonly STOCK_VIDEOS: 'stock_videos';
160
+ readonly AI_IMAGES: "ai_images";
161
+ readonly AI_VIDEOS: "ai_videos";
162
+ readonly MY_UPLOADED_ASSETS: "my_uploaded_assets";
163
+ readonly STOCK_VIDEOS: "stock_videos";
163
164
  };
164
165
  /**
165
166
  * @public
@@ -253,11 +254,11 @@ declare const SpeedShiftCategory: {
253
254
  /**
254
255
  * Variable speed controlled by Bezier keyframes
255
256
  */
256
- readonly CURVE: 'curve';
257
+ readonly CURVE: "curve";
257
258
  /**
258
259
  * Constant speed multiplier across the entire clip
259
260
  */
260
- readonly LINEAR: 'linear';
261
+ readonly LINEAR: "linear";
261
262
  };
262
263
  /**
263
264
  * @public
@@ -441,6 +442,10 @@ interface VideoDraft$1 {
441
442
  }
442
443
  //#endregion
443
444
  //#region src/document/types.d.ts
445
+ declare const VIDEO_DOCUMENT_SCHEMA_VERSION: "video-document/v0";
446
+ /** A server-derived compatibility view, never an editor write authority. */
447
+ declare const ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION: "video-document/entity-projection-v1";
448
+ type VideoDocumentSchemaVersion = typeof VIDEO_DOCUMENT_SCHEMA_VERSION | typeof ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION;
444
449
  type PartKind = 'video_clip' | 'speech' | 'caption' | 'bgm';
445
450
  /**
446
451
  * Project-level creation settings. Mirrors the IDL, but keeps the two fields the
@@ -482,7 +487,11 @@ type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
482
487
  *
483
488
  * `speech_part_id` / `start_ms` are kept as resource-intrinsic facts (which
484
489
  * speech it was split from, and its offset in that source) — reference/17
485
- * principle 4.
490
+ * principle 4. An independently placed Caption (its own Clip and Sequence
491
+ * Marker, no Voice take) has no owning speech: both fields stay unset and its
492
+ * position is expressed entirely by the Clip's placement. Generation source
493
+ * (AudioScript provenance) and Voice alignment are entity Relations, decoupled
494
+ * from this display-side legacy view.
486
495
  */
487
496
  type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
488
497
  initial_duration_ms?: number | undefined;
@@ -550,6 +559,19 @@ interface Track {
550
559
  is_hidden: boolean | undefined;
551
560
  items: TrackItem[] | undefined;
552
561
  }
562
+ /** The linear speed multiplier of a `speed_shift`, defaulting to 1 (original). */
563
+ declare function speedOf(speedShift: SpeedShift | undefined): number;
564
+ /**
565
+ * A video clip's effective timeline duration, derived from authoritative facts
566
+ * (RFC 02, `reference/16` §4, reference/17 §5): the trim window
567
+ * `play_out - play_in` divided by the speed multiplier, rounded to integer ms.
568
+ * `play_in` / `play_out` are optional in the IDL but every write path sets them
569
+ * (defaulting to the whole media), and the legacy-ingest projection backfills the
570
+ * window from a legacy `duration_ms` — so an authoritative clip always carries a
571
+ * trim window and there is no stored `duration_ms` to fall back to. A clip with
572
+ * neither bound yields 0. Speeds the clip up (>1× → shorter) or down (<1×).
573
+ */
574
+ declare function effectiveVideoClipDurationMs(clip: VideoClipPart): number;
553
575
  /**
554
576
  * Authoritative part union: a flat discriminated union over the four part kinds.
555
577
  * Deliberately *not* the IDL's namespace union (no `$unknown` / `visit`): engine
@@ -615,52 +637,17 @@ type VideoDraftPartUnion = {
615
637
  };
616
638
  };
617
639
  /**
618
- * Legacy Draft import shape. It allows omitted durations and engine extensions
619
- * so existing fixtures and migrations can state only the facts they have.
620
- * Projection returns the narrower `VideoDraftContent` contract instead.
640
+ * Derived `VideoDraft` read-view. The shape follows the IDL verbatim except for
641
+ * `part_library`: the IDL types its parts with the generated namespace
642
+ * `PartUnion`, but the engine's projection emits `VideoDraftPartUnion` — the
643
+ * authoritative parts with the derived `duration_ms` re-injected (reference/17 §7)
644
+ * plus the engine extensions (`media_duration_ms`, the looser `SpeedShift`). This
645
+ * is the intentional superset over the IDL `VideoDraft` (see the extensions note).
621
646
  */
622
647
  type VideoDraft = Omit<VideoDraft$1, 'part_library' | 'video_creation_settings'> & {
623
648
  part_library: Record<string, VideoDraftPartUnion> | undefined;
624
649
  video_creation_settings?: VideoCreationSettings | undefined;
625
650
  };
626
- /**
627
- * The complete content read model produced by the shared projection. Business
628
- * identity, settings, thumbnail and revision counters are assembled by Director;
629
- * keeping an explicit field list prevents new business DTO fields entering here.
630
- */
631
- type VideoDraftContent = Pick<VideoDraft, 'timeline' | 'main_track' | 'above_main_tracks' | 'below_main_tracks' | 'part_aggregations'> & {
632
- part_library: Record<string, VideoDraftContentPartUnion> | undefined;
633
- };
634
- /** Projection always states the duration field; legacy imports may omit it. */
635
- type VideoDraftContentPartUnion = {
636
- video_clip: VideoClipPart & {
637
- duration_ms: number | undefined;
638
- };
639
- speech?: never;
640
- caption?: never;
641
- bgm?: never;
642
- } | {
643
- video_clip?: never;
644
- speech: SpeechPart & {
645
- duration_ms: number | undefined;
646
- };
647
- caption?: never;
648
- bgm?: never;
649
- } | {
650
- video_clip?: never;
651
- speech?: never;
652
- caption: CaptionPart & {
653
- duration_ms: number | undefined;
654
- };
655
- bgm?: never;
656
- } | {
657
- video_clip?: never;
658
- speech?: never;
659
- caption?: never;
660
- bgm: BgmPart & {
661
- duration_ms: number | undefined;
662
- };
663
- };
664
651
  /** Authoritative timeline: `duration_ms` is derived (= longest track), not stored. */
665
652
  interface Timeline {
666
653
  unit_time_ms: number | undefined;
@@ -675,19 +662,39 @@ interface Timeline {
675
662
  * is not, and passes any `>= 0` guard on its way to an editor that cannot use it.
676
663
  */
677
664
  declare const DEFAULT_UNIT_TIME_MS = 33.333;
665
+ /**
666
+ * Project-level scalars that do not participate in track ordering. Grouped under
667
+ * `meta` because the loro-mirror `schema()` root only accepts container schemas,
668
+ * not bare scalars — so these must live inside a map container in storage. The
669
+ * domain type mirrors that storage shape 1:1 (RFC 03 §4) rather than flattening,
670
+ * keeping `VideoDocument` and the loro draft isomorphic and the mapping layer a
671
+ * near-identity. `schema_version` lives here too (it is a scalar fact).
672
+ */
673
+ interface VideoDocumentMeta {
674
+ schema_version: VideoDocumentSchemaVersion;
675
+ draft_id?: string | undefined;
676
+ project_id: VideoDraft['project_id'];
677
+ owner_id: VideoDraft['owner_id'];
678
+ thumbnail_storage_key: VideoDraft['thumbnail_storage_key'];
679
+ chat_session_id: VideoDraft['chat_session_id'];
680
+ video_creation_settings: VideoDraft['video_creation_settings'];
681
+ /** Legacy imported version for v0; committed Entity revision for entity-projection-v1. */
682
+ version: VideoDraft['version'];
683
+ }
678
684
  /**
679
685
  * Authoritative collaborative document: only facts. Positioning lives on each
680
686
  * `TrackItem.time_position`; absolute time, `part_aggregations`, and total
681
687
  * duration are derived in the `VideoDraft` projection, not stored here (RFC 02 §6).
682
688
  *
683
- * The content mirrors Loro storage: timeline, part library, and a single
684
- * ordered `tracks` list (reference/17 §4). Business metadata stays in Director. A
689
+ * The shape mirrors the loro storage structure 1:1 (RFC 03 §4): a `meta` map of
690
+ * project scalars, plus a single ordered `tracks` list (reference/17 §4). A
685
691
  * track's lane is expressed by its `parts_kind`, not by which container it lives
686
692
  * in — the `main` / `above` / `below` three-pane view is reconstructed at
687
693
  * projection time. Order is the list order itself, so there is no `lane` /
688
694
  * `lane_order` field to diverge under concurrent edits.
689
695
  */
690
696
  interface VideoDocument {
697
+ meta: VideoDocumentMeta;
691
698
  timeline: Timeline | undefined;
692
699
  tracks: Track[] | undefined;
693
700
  part_library: Record<string, PartUnion> | undefined;
@@ -711,13 +718,13 @@ interface VideoDocumentValidationIssue {
711
718
  //#endregion
712
719
  //#region src/document/projection.d.ts
713
720
  /**
714
- * Projection between authoritative `VideoDocument` and compatible content
715
- * layouts (RFC 02 §5/§7). Both directions live here:
721
+ * Projection between the authoritative `VideoDocument` and the legacy
722
+ * `VideoDraft` read-view (RFC 02 §5/§7). Both directions live here:
716
723
  *
717
724
  * - `toVideoDocument` ingests a `VideoDraft`, deriving each item's `position`
718
725
  * from the legacy absolute layout + aggregations; derived values (abs time,
719
726
  * `part_aggregations`, total duration) are dropped.
720
- * - `fromVideoDocument` solves a `VideoDocument` into `VideoDraftContent` via the
727
+ * - `fromVideoDocument` solves a `VideoDocument` back into a `VideoDraft` via the
721
728
  * timeline-core cascade, re-deriving exactly those values.
722
729
  *
723
730
  * Business validation lives in `validation.ts`; `fromVideoDocument` asserts a
@@ -729,7 +736,7 @@ interface VideoDocumentValidationIssue {
729
736
  * aggregations (RFC 02 §4/§5). Absolute time, `part_aggregations`, and total
730
737
  * duration are dropped — they are re-derived by the projection.
731
738
  */
732
- declare function toVideoDocument(draft: Pick<VideoDraft, keyof VideoDraftContent>): VideoDocument;
739
+ declare function toVideoDocument(draft: VideoDraft): VideoDocument;
733
740
  /** speech/attachment part_id → its host video part_id + relative offset. */
734
741
  type SpeechHostMap = Map<string, {
735
742
  hostPartId: string;
@@ -769,8 +776,8 @@ interface DerivedItemPosition {
769
776
  */
770
777
  declare function derivePositionFromAbs(partId: string, abs: number, isMain: boolean, speechHost: SpeechHostMap, partLibrary: Record<string, PartUnion | string | undefined>): DerivedItemPosition;
771
778
  /**
772
- * Project `VideoDocument` into `VideoDraftContent`, solving each item's
773
- * absolute position, the `part_aggregations`, and
779
+ * Project the authoritative `VideoDocument` back into the legacy `VideoDraft`
780
+ * read-view, solving each item's absolute position, the `part_aggregations`, and
774
781
  * the total duration via the timeline-core cascade.
775
782
  *
776
783
  * The read-view is a compatibility contract, and the IDL declares
@@ -784,15 +791,32 @@ declare function derivePositionFromAbs(partId: string, abs: number, isMain: bool
784
791
  * These two are defaultable because the projection knows their values on its own:
785
792
  * absent `unit_time_ms` means "no display granularity was ever stated" and absent
786
793
  * `is_hidden` means "this track was never hidden". `version` is NOT defaultable
787
- * here — it belongs to Director assembly using the server envelope update_seq.
788
- * Neither business metadata nor a revision counter belongs in content projection.
794
+ * here — its only honest value is server state (`update_seq`) that a
795
+ * `VideoDocument` cannot see, so it stays absent and the HTTP layer fills it.
789
796
  */
790
- declare function fromVideoDocument(document: VideoDocument): VideoDraftContent;
797
+ declare function fromVideoDocument(document: VideoDocument): VideoDraft;
791
798
  //#endregion
792
799
  //#region src/document/initial-document.d.ts
800
+ /**
801
+ * The project facts a freshly created document is built from — exactly the five
802
+ * fields Director sets when it creates a draft row, and nothing else.
803
+ *
804
+ * Deliberately not a whole `VideoDraft`: tracks and the part library of a new
805
+ * document are empty by definition, so accepting them would mean accepting
806
+ * values that must always be empty, and every such field is a place for a future
807
+ * caller to send something that is silently dropped. The narrow shape makes the
808
+ * "a new document has no content" rule structural instead of a convention.
809
+ */
810
+ interface InitialDocumentFacts {
811
+ draftId: string;
812
+ projectId: string | undefined;
813
+ ownerId: string | undefined;
814
+ chatSessionId: string | undefined;
815
+ videoCreationSettings: VideoCreationSettings | undefined;
816
+ }
793
817
  /**
794
818
  * Build the `VideoDocument` a newly created project starts from: the caller's
795
- * no parts and one empty track per lane. Business facts remain in Director.
819
+ * project facts, no parts, and one empty track per lane.
796
820
  *
797
821
  * The empty lane tracks are the reason this function exists rather than callers
798
822
  * assembling a document inline. Lane tracks are otherwise minted lazily by the
@@ -813,7 +837,171 @@ declare function fromVideoDocument(document: VideoDocument): VideoDraftContent;
813
837
  * supplies, and total duration is derived on read (RFC 02 §6), so a new document
814
838
  * has no timeline fact to state.
815
839
  */
816
- declare function buildInitialVideoDocument(): VideoDocument;
840
+ declare function buildInitialVideoDocument(facts: InitialDocumentFacts): VideoDocument;
841
+ //#endregion
842
+ //#region ../medeo-dsl/src/ids.d.ts
843
+ declare const entityIdBrand: unique symbol;
844
+ declare const relationIdBrand: unique symbol;
845
+ type EntityId = string & {
846
+ readonly [entityIdBrand]: 'EntityId';
847
+ };
848
+ type RelationId = string & {
849
+ readonly [relationIdBrand]: 'RelationId';
850
+ };
851
+ //#endregion
852
+ //#region ../medeo-dsl/src/json-values.d.ts
853
+ type JsonPrimitive = string | number | boolean | null;
854
+ type JsonValue = JsonPrimitive | JsonObject | readonly JsonValue[];
855
+ type JsonObject = {
856
+ readonly [key: string]: JsonValue;
857
+ };
858
+ //#endregion
859
+ //#region ../medeo-dsl/src/entities.d.ts
860
+ type KnownEntityKind = 'axvideo' | 'timeline' | 'track' | 'clip' | 'asset' | 'video' | 'audio' | 'voice' | 'image' | 'sequence-marker' | 'viewport' | 'audio-script' | 'phonetic-script' | 'caption';
861
+ declare const extensionEntityKindBrand: unique symbol;
862
+ type ExtensionEntityKind = string & {
863
+ readonly [extensionEntityKindBrand]: 'ExtensionEntityKind';
864
+ };
865
+ /** Extensions require explicit branding so removed or reserved domain kinds cannot reappear accidentally. */
866
+ type EntityKind = KnownEntityKind | ExtensionEntityKind;
867
+ interface SequenceRange<Point = unknown> {
868
+ readonly start: Point;
869
+ readonly end: Point;
870
+ }
871
+ type SequenceDuration<Span = unknown> = {
872
+ readonly mode: 'from-source';
873
+ } | {
874
+ readonly mode: 'fixed';
875
+ readonly value: Span;
876
+ };
877
+ interface ScriptTextSegment {
878
+ readonly segmentId: string;
879
+ readonly text: string;
880
+ readonly language?: string;
881
+ }
882
+ interface VoiceDescriptor {
883
+ readonly system: 'voice-library';
884
+ readonly key: string;
885
+ readonly name?: string;
886
+ }
887
+ interface CaptionFontDescriptor {
888
+ readonly system: 'font-library';
889
+ readonly key: string;
890
+ }
891
+ interface CaptionStyleFields {
892
+ readonly font?: CaptionFontDescriptor;
893
+ readonly fontSize?: number;
894
+ readonly fontColor?: string;
895
+ readonly fontWeight?: number;
896
+ readonly entranceAnimation?: string;
897
+ readonly entranceAnimationDurationMs?: number;
898
+ readonly strokeColor?: string;
899
+ readonly strokeWidth?: number;
900
+ readonly positionX?: number;
901
+ readonly positionY?: number;
902
+ }
903
+ /**
904
+ * Half-open `[start, end)` position window inside one Segment's text, counted
905
+ * in Unicode code points (not UTF-16 code units), so a boundary never splits a
906
+ * surrogate pair. Positions are non-negative safe integers with `start < end`;
907
+ * `end` must not exceed the Segment's code-point length.
908
+ */
909
+ interface CaptionTextRange extends JsonObject {
910
+ readonly start: number;
911
+ readonly end: number;
912
+ }
913
+ /**
914
+ * One ordered entry of the Caption's segment selection. `segmentId` quotes the
915
+ * composed AudioScript's own stable segment identity — a local id quoted by the
916
+ * variant, never a peer Entity reference. Text itself is never copied here;
917
+ * complete Caption content is assembled through its direct baseEntityIds.
918
+ * The optional `textRange` narrows one Segment to an intra-Segment sub-span
919
+ * (intra-segment re-segmentation); without it the whole Segment text is selected.
920
+ */
921
+ type CaptionSegmentSelection = JsonObject & {
922
+ readonly segmentId: string;
923
+ readonly textRange?: CaptionTextRange;
924
+ };
925
+ //#endregion
926
+ //#region ../medeo-dsl/src/relations.d.ts
927
+ type KnownRelationKind = 'timeline-track' | 'track-clip' | 'clip-marker' | 'marker-content' | 'axvideo-marker' | 'marker-timeline' | 'physical-asset' | 'generated' | 'caption-alignment' | 'clip-anchor' | 'phonetic-script-render' | 'audio-script-source' | 'audio-script-marker';
928
+ type RelationKind = KnownRelationKind | (string & {});
929
+ type RelationTrace = JsonObject;
930
+ /**
931
+ * Authoritative persisted relation value.
932
+ *
933
+ * A kind may assign semantic roles to endpoint 0 and endpoint 1. Callers and
934
+ * storage adapters must preserve the submitted positions; kinds whose
935
+ * semantics are unordered simply do not interpret those positions.
936
+ */
937
+ interface RelationRow<K extends RelationKind = RelationKind, Metadata extends JsonObject = JsonObject> {
938
+ readonly relationId: RelationId;
939
+ readonly endpoint0EntityId: EntityId;
940
+ readonly endpoint1EntityId: EntityId;
941
+ readonly relationKind: K;
942
+ readonly metadata: Metadata;
943
+ readonly trace: RelationTrace;
944
+ }
945
+ //#endregion
946
+ //#region ../medeo-dsl/src/rows.d.ts
947
+ /** One persisted first-class entity. Its owned fields live directly in payload. */
948
+ interface EntityRow<K extends EntityKind = EntityKind> {
949
+ readonly entityId: EntityId;
950
+ readonly entityKind: K;
951
+ readonly payload: JsonObject;
952
+ }
953
+ /** Complete persistence value for an entity set and its authoritative relations. */
954
+ interface EntityRelationRows {
955
+ readonly entities: readonly EntityRow[];
956
+ readonly relations: readonly RelationRow[];
957
+ }
958
+ //#endregion
959
+ //#region src/document/entity-projection-values.d.ts
960
+ /** A graph cannot be represented faithfully by the compatibility reader. */
961
+ declare class EntityTimelineProjectionError extends Error {
962
+ constructor(message: string);
963
+ }
964
+ //#endregion
965
+ //#region src/document/entity-projection.d.ts
966
+ /**
967
+ * One-way compatibility view over the Entity graph. A legacy part is never
968
+ * consulted as an editing fact. Peer IDs appear only in this derived read
969
+ * contract, reconstructed from relations; they are not stored in payloads.
970
+ */
971
+ declare function projectEntityTimeline(rows: EntityRelationRows, meta: VideoDocumentMeta): VideoDocument;
972
+ //#endregion
973
+ //#region src/document/entity-timeline-layout.d.ts
974
+ type EntityTimelineTrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
975
+ interface ResolvedEntityClipPlacement {
976
+ readonly clipEntityId: string;
977
+ readonly markerEntityId: string;
978
+ readonly contentEntityId: string;
979
+ readonly trackEntityId: string;
980
+ readonly start: number;
981
+ readonly duration: number;
982
+ readonly mode: 'sequential' | 'absolute' | 'anchored';
983
+ readonly anchorClipEntityId?: string;
984
+ readonly anchorOffset?: number;
985
+ }
986
+ interface ResolvedEntityTrack {
987
+ readonly entityId: string;
988
+ readonly role: EntityTimelineTrackRole;
989
+ readonly order: number;
990
+ readonly hidden: boolean;
991
+ readonly clips: readonly ResolvedEntityClipPlacement[];
992
+ }
993
+ interface ResolvedEntityTimelineLayout {
994
+ readonly tracks: readonly ResolvedEntityTrack[];
995
+ readonly clips: ReadonlyMap<string, ResolvedEntityClipPlacement>;
996
+ /** Background music fills this duration; it never extends the timeline. */
997
+ readonly durationMs: number;
998
+ }
999
+ /**
1000
+ * Resolve only entity-owned placement facts. This does not choose new anchors,
1001
+ * manufacture clips, or mutate a graph while reading. Write-side operations
1002
+ * must express any detach/reparent/overlap decision in their entity plan.
1003
+ */
1004
+ declare function resolveEntityTimelineLayout(rows: EntityRelationRows): ResolvedEntityTimelineLayout;
817
1005
  //#endregion
818
1006
  //#region src/document/validation.d.ts
819
1007
  /**
@@ -845,6 +1033,29 @@ declare function validateVideoDocument(document: unknown): VideoDocumentValidati
845
1033
  //#endregion
846
1034
  //#region src/document/mirror-schema.d.ts
847
1035
  declare const videoDocumentMirrorSchema: import("loro-mirror").RootSchemaType<{
1036
+ meta: import("loro-mirror").LoroMapSchema<{
1037
+ schema_version: /*elided*/any;
1038
+ draft_id: /*elided*/any;
1039
+ project_id: /*elided*/any;
1040
+ owner_id: /*elided*/any;
1041
+ thumbnail_storage_key: /*elided*/any;
1042
+ chat_session_id: /*elided*/any;
1043
+ video_creation_settings: /*elided*/any;
1044
+ version: /*elided*/any;
1045
+ }> & {
1046
+ options: {};
1047
+ } & {
1048
+ catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
1049
+ schema_version: /*elided*/any;
1050
+ draft_id: /*elided*/any;
1051
+ project_id: /*elided*/any;
1052
+ owner_id: /*elided*/any;
1053
+ thumbnail_storage_key: /*elided*/any;
1054
+ chat_session_id: /*elided*/any;
1055
+ video_creation_settings: /*elided*/any;
1056
+ version: /*elided*/any;
1057
+ }, C>;
1058
+ };
848
1059
  timeline: import("loro-mirror").LoroMapSchema<{
849
1060
  unit_time_ms: /*elided*/any;
850
1061
  }> & {
@@ -909,611 +1120,35 @@ type TrackDraft = NonNullable<NonNullable<VideoDocumentDraft['tracks']>[number]>
909
1120
  /** A single track item in a draft. */
910
1121
  type TrackItemDraft = NonNullable<NonNullable<TrackDraft['items']>[number]>;
911
1122
  //#endregion
912
- //#region src/editor/schemas/add-speeches.d.ts
913
- /**
914
- * Add speeches (and their captions). TTS runs upstream; the stable speech /
915
- * caption parts arrive materialized (see `speech-assets.ts`). The op writes the
916
- * parts and each speech's `{ mode:'anchored', anchorPartId, offsetMs }` fact
917
- * verbatim — no write-time host-picking, no cascade (RFC 02 §4). The projection
918
- * derives absolute positions on read.
919
- */
920
- declare const addSpeechesInputSchema: z.ZodObject<{
921
- speeches: z.ZodArray<z.ZodObject<{
922
- speech_id: z.ZodString;
923
- anchor_part_id: z.ZodString;
924
- offset_ms: z.ZodNumber;
925
- audio_storage_key: z.ZodString;
926
- duration_ms: z.ZodNumber;
927
- audio_script: z.ZodString;
928
- volume: z.ZodNumber;
929
- voice: z.ZodObject<{
930
- id: z.ZodString;
931
- name: z.ZodString;
932
- }, z.core.$strip>;
933
- origin_speech_id: z.ZodString;
934
- caption_ids: z.ZodArray<z.ZodString>;
935
- }, z.core.$strip>>;
936
- captions: z.ZodArray<z.ZodObject<{
937
- caption_id: z.ZodString;
938
- speech_part_id: z.ZodString;
939
- text: z.ZodString;
940
- start_ms: z.ZodNumber;
941
- duration_ms: z.ZodNumber;
942
- }, z.core.$strip>>;
943
- }, z.core.$strip>;
944
- type AddSpeechesInput = z.infer<typeof addSpeechesInputSchema>;
945
- //#endregion
946
- //#region src/editor/schemas/add-video-clips.d.ts
1123
+ //#region src/editor/id-gen.d.ts
947
1124
  /**
948
- * Add video clips to a track. Each clip's duration facts are separated so a
949
- * single number is never overloaded (RFC 02 / `reference/16` §0b):
1125
+ * Part-id generation, aligned with the online ecosystem.
950
1126
  *
951
- * - `media_duration_ms` is the source media's intrinsic full length (a resource
952
- * fact, written to the part);
953
- * - `play_in` / `play_out` are the optional trim window into that media; when
954
- * omitted the whole media is used (`play_in=0`, `play_out=media_duration_ms`).
1127
+ * The authoritative online producers — agent-harness (`@harness/shared`
1128
+ * `genObjId`) and director.v2 (`common/obj_id.py` `gen_obj_id`) — both mint part
1129
+ * ids as `` `${prefix}_${ulid()}` ``, and real captured drafts use exactly that
1130
+ * shape (`clip_…` / `spe_…` / `cap_…` / `bgm_…`, each a 26-char ULID). The engine
1131
+ * previously emitted `vc_<base36 timestamp><6 random>`, a different prefix AND a
1132
+ * different encoding — the sole cross-repo id divergence. This module removes it
1133
+ * by emitting the same `<prefix>_<ULID>` bytes.
955
1134
  *
956
- * The clip's effective timeline duration is derived by the projection from the
957
- * trim window and `speed_shift` — it is never an input here.
958
- */
959
- declare const addVideoClipsInputSchema: z.ZodObject<{
960
- clips: z.ZodArray<z.ZodObject<{
961
- media_id: z.ZodString;
962
- start_ms: z.ZodOptional<z.ZodNumber>;
963
- media_duration_ms: z.ZodNumber;
964
- play_in: z.ZodOptional<z.ZodNumber>;
965
- play_out: z.ZodOptional<z.ZodNumber>;
966
- track_id: z.ZodOptional<z.ZodString>;
967
- }, z.core.$strip>>;
968
- before_clip_id: z.ZodOptional<z.ZodString>;
969
- after_clip_id: z.ZodOptional<z.ZodString>;
970
- }, z.core.$strip>;
971
- type AddVideoClipsInput = z.infer<typeof addVideoClipsInputSchema>;
972
- //#endregion
973
- //#region src/editor/schemas/adjust-bgm-volume.d.ts
974
- declare const adjustBgmVolumeInputSchema: z.ZodObject<{
975
- bgm: z.ZodArray<z.ZodObject<{
976
- bgm_id: z.ZodString;
977
- volume: z.ZodNumber;
978
- }, z.core.$strip>>;
979
- }, z.core.$strip>;
980
- type AdjustBgmVolumeInput = z.infer<typeof adjustBgmVolumeInputSchema>;
981
- //#endregion
982
- //#region src/editor/schemas/adjust-speech-volume.d.ts
983
- declare const adjustSpeechVolumeInputSchema: z.ZodObject<{
984
- speeches: z.ZodArray<z.ZodObject<{
985
- speech_id: z.ZodString;
986
- volume: z.ZodNumber;
987
- }, z.core.$strip>>;
988
- }, z.core.$strip>;
989
- type AdjustSpeechVolumeInput = z.infer<typeof adjustSpeechVolumeInputSchema>;
990
- //#endregion
991
- //#region src/editor/schemas/adjust-video-clip-duration.d.ts
992
- /**
993
- * Re-trim existing video clips (the user-facing "adjust duration" gesture is a
994
- * trim of the source window). The new `play_in` / `play_out` are the facts; the
995
- * effective timeline duration is derived from them and the clip's `speed_shift`,
996
- * and the change reflows downstream clips, speeches, and the timeline inside the
997
- * op's transaction (no caller-materialized cascade).
998
- */
999
- declare const adjustVideoClipDurationInputSchema: z.ZodObject<{
1000
- clips: z.ZodArray<z.ZodObject<{
1001
- clip_id: z.ZodString;
1002
- play_in: z.ZodNumber;
1003
- play_out: z.ZodNumber;
1004
- }, z.core.$strip>>;
1005
- }, z.core.$strip>;
1006
- type AdjustVideoClipDurationInput = z.infer<typeof adjustVideoClipDurationInputSchema>;
1007
- //#endregion
1008
- //#region src/editor/schemas/adjust-video-clip-volume.d.ts
1009
- declare const adjustVideoClipVolumeInputSchema: z.ZodObject<{
1010
- clips: z.ZodArray<z.ZodObject<{
1011
- clip_id: z.ZodString;
1012
- volume: z.ZodNumber;
1013
- }, z.core.$strip>>;
1014
- }, z.core.$strip>;
1015
- type AdjustVideoClipVolumeInput = z.infer<typeof adjustVideoClipVolumeInputSchema>;
1016
- //#endregion
1017
- //#region src/editor/schemas/change-speech.d.ts
1018
- /**
1019
- * Change a speech's script or voice. Both re-run TTS upstream and return the
1020
- * regenerated speech / caption parts in the same materialized shape as
1021
- * `AddSpeeches` (`speech-assets.ts`); the op upserts them by id (the speech part
1022
- * id is preserved across a re-TTS), re-seats at `start_ms`, and reflows. Old
1023
- * caption parts no longer owned by the speech are removed via `caption_ids`.
1024
- */
1025
- declare const changeSpeechScriptInputSchema: z.ZodObject<{
1026
- speeches: z.ZodArray<z.ZodObject<{
1027
- speech_id: z.ZodString;
1028
- anchor_part_id: z.ZodString;
1029
- offset_ms: z.ZodNumber;
1030
- audio_storage_key: z.ZodString;
1031
- duration_ms: z.ZodNumber;
1032
- audio_script: z.ZodString;
1033
- volume: z.ZodNumber;
1034
- voice: z.ZodObject<{
1035
- id: z.ZodString;
1036
- name: z.ZodString;
1037
- }, z.core.$strip>;
1038
- origin_speech_id: z.ZodString;
1039
- caption_ids: z.ZodArray<z.ZodString>;
1040
- }, z.core.$strip>>;
1041
- captions: z.ZodArray<z.ZodObject<{
1042
- caption_id: z.ZodString;
1043
- speech_part_id: z.ZodString;
1044
- text: z.ZodString;
1045
- start_ms: z.ZodNumber;
1046
- duration_ms: z.ZodNumber;
1047
- }, z.core.$strip>>;
1048
- }, z.core.$strip>;
1049
- declare const changeSpeechVoiceInputSchema: z.ZodObject<{
1050
- speeches: z.ZodArray<z.ZodObject<{
1051
- speech_id: z.ZodString;
1052
- anchor_part_id: z.ZodString;
1053
- offset_ms: z.ZodNumber;
1054
- audio_storage_key: z.ZodString;
1055
- duration_ms: z.ZodNumber;
1056
- audio_script: z.ZodString;
1057
- volume: z.ZodNumber;
1058
- voice: z.ZodObject<{
1059
- id: z.ZodString;
1060
- name: z.ZodString;
1061
- }, z.core.$strip>;
1062
- origin_speech_id: z.ZodString;
1063
- caption_ids: z.ZodArray<z.ZodString>;
1064
- }, z.core.$strip>>;
1065
- captions: z.ZodArray<z.ZodObject<{
1066
- caption_id: z.ZodString;
1067
- speech_part_id: z.ZodString;
1068
- text: z.ZodString;
1069
- start_ms: z.ZodNumber;
1070
- duration_ms: z.ZodNumber;
1071
- }, z.core.$strip>>;
1072
- }, z.core.$strip>;
1073
- type ChangeSpeechScriptInput = z.infer<typeof changeSpeechScriptInputSchema>;
1074
- type ChangeSpeechVoiceInput = z.infer<typeof changeSpeechVoiceInputSchema>;
1075
- //#endregion
1076
- //#region src/editor/schemas/delete-bgm.d.ts
1077
- /**
1078
- * Remove the document BGM. Pure document edit: clears the bgm lane and removes
1079
- * the bgm part. Takes no input (a document holds at most one bgm); an empty
1080
- * object keeps the op signature uniform with the rest.
1081
- */
1082
- declare const deleteBgmInputSchema: z.ZodObject<{}, z.core.$strip>;
1083
- type DeleteBgmInput = z.infer<typeof deleteBgmInputSchema>;
1084
- //#endregion
1085
- //#region src/editor/schemas/delete-speeches.d.ts
1086
- /**
1087
- * Delete speeches with their captions. Pure document edit (no side effect): the
1088
- * op removes each speech part, cascade-deletes the captions it owns (via
1089
- * `caption_ids` / `speech_part_id`), drops their track items, and reflows.
1090
- */
1091
- declare const deleteSpeechesInputSchema: z.ZodObject<{
1092
- speech_ids: z.ZodArray<z.ZodString>;
1093
- }, z.core.$strip>;
1094
- type DeleteSpeechesInput = z.infer<typeof deleteSpeechesInputSchema>;
1095
- //#endregion
1096
- //#region src/editor/schemas/delete-video-clips.d.ts
1097
- /**
1098
- * How a delete handles the anchored subtree (speeches anchored to a deleted clip,
1099
- * and their captions) — a delete-op policy, not a data-model field (reference/17
1100
- * §6). `cascade` (default) removes the subtree; `detach` keeps the direct
1101
- * anchored children, re-pinning them to `absolute` so they stay on the timeline.
1102
- */
1103
- declare const anchoredDeletePolicySchema: z.ZodEnum<{
1104
- cascade: "cascade";
1105
- detach: "detach";
1106
- }>;
1107
- type AnchoredDeletePolicy = z.infer<typeof anchoredDeletePolicySchema>;
1108
- declare const deleteVideoClipsInputSchema: z.ZodObject<{
1109
- clip_ids: z.ZodArray<z.ZodString>;
1110
- on_anchored: z.ZodOptional<z.ZodEnum<{
1111
- cascade: "cascade";
1112
- detach: "detach";
1113
- }>>;
1114
- }, z.core.$strip>;
1115
- type DeleteVideoClipsInput = z.infer<typeof deleteVideoClipsInputSchema>;
1116
- //#endregion
1117
- //#region src/editor/schemas/move-speeches.d.ts
1118
- /**
1119
- * Move speeches in time. Pure document edit: the op re-seats each speech at its
1120
- * new absolute `start_ms`; the cascade reassigns it to the host video clip,
1121
- * resolves overlaps, and reflows. Captions follow their speech.
1122
- */
1123
- declare const moveSpeechesInputSchema: z.ZodObject<{
1124
- speeches: z.ZodArray<z.ZodObject<{
1125
- speech_id: z.ZodString;
1126
- new_start_ms: z.ZodNumber;
1127
- }, z.core.$strip>>;
1128
- }, z.core.$strip>;
1129
- type MoveSpeechesInput = z.infer<typeof moveSpeechesInputSchema>;
1130
- //#endregion
1131
- //#region src/editor/schemas/move-video-clips-by-anchor.d.ts
1132
- /**
1133
- * Where the moved block lands on the main track.
1134
- *
1135
- * A discriminated union rather than two optional `before_clip_id` /
1136
- * `after_clip_id` fields (the shape `addVideoClips` had to use, because there the
1137
- * two modes share a whole clip description): here the alternatives carry nothing
1138
- * in common, so making them mutually exclusive *by type* removes three runtime
1139
- * `superRefine` checks that would otherwise have to be written and tested.
1140
- *
1141
- * `track_start` is an explicit member, not the absence of an anchor. The
1142
- * agent-harness mutation this maps from treats "neither anchor given" as
1143
- * "move to the front" (`applyBatchMoveVideoClips` falls back to `insertIndex = 0`),
1144
- * which is a default buried in a tool description. Requiring the caller to name
1145
- * that intent keeps a forgotten field from silently reordering the timeline.
1146
- */
1147
- declare const moveAnchorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1148
- position: z.ZodLiteral<"before">;
1149
- clip_id: z.ZodString;
1150
- }, z.core.$strip>, z.ZodObject<{
1151
- position: z.ZodLiteral<"after">;
1152
- clip_id: z.ZodString;
1153
- }, z.core.$strip>, z.ZodObject<{
1154
- position: z.ZodLiteral<"track_start">;
1155
- }, z.core.$strip>], "position">;
1156
- /**
1157
- * What happens to the speeches anchored to the clips being moved.
1158
- *
1159
- * - `follow` keeps each speech anchored where it is, so it travels with its clip
1160
- * to the new position. In the anchored model this is the *no-op* branch: a
1161
- * speech's authoritative fact is `{ anchorPartId, offsetMs }` and its absolute
1162
- * time is derived on read from the host's position, so moving the host moves
1163
- * the speech with no write to the speech at all.
1164
- * - `keep_absolute` preserves each speech's current absolute landing instead, then
1165
- * re-anchors it to whichever clip now covers that time (RFC 02 §9.1/§11.1). This
1166
- * is the branch that costs an extra pass, and the one the FE timeline uses.
1167
- *
1168
- * **Required, with no default**, matching `deleteVideoClips` and
1169
- * `replaceVideoClipSequence`. The two branches decide which picture the user's
1170
- * narration ends up over, which is too consequential to infer from a missing
1171
- * field — and neither branch is "safe enough" to be the implicit one.
1172
- */
1173
- declare const movedClipAnchoredPolicySchema: z.ZodEnum<{
1174
- follow: "follow";
1175
- keep_absolute: "keep_absolute";
1176
- }>;
1177
- /**
1178
- * Reorder a set of main-track clips relative to a reference clip.
1179
- *
1180
- * Distinct from `moveVideoClips`, which positions clips by absolute time
1181
- * (`new_start_ms`) and is what the FE timeline dispatches after a drag. Main-track
1182
- * clips are `sequential`-positioned, so absolute time is not authoritative state
1183
- * there (RFC 02 §4/§7): `moveVideoClips` has to *guess* an index back out of the
1184
- * time it was handed, whereas an anchor already is the ordinal fact being changed.
1185
- * Keeping them separate also isolates blast radius — this method can diverge on
1186
- * speech policy without touching the FE path.
1187
- *
1188
- * `clip_ids` need not be contiguous. They move as one block, keeping their
1189
- * relative order, which is the agent-harness `batch_move_video_clips` contract.
1190
- */
1191
- declare const moveVideoClipsByAnchorInputSchema: z.ZodObject<{
1192
- clip_ids: z.ZodArray<z.ZodString>;
1193
- anchor: z.ZodDiscriminatedUnion<[z.ZodObject<{
1194
- position: z.ZodLiteral<"before">;
1195
- clip_id: z.ZodString;
1196
- }, z.core.$strip>, z.ZodObject<{
1197
- position: z.ZodLiteral<"after">;
1198
- clip_id: z.ZodString;
1199
- }, z.core.$strip>, z.ZodObject<{
1200
- position: z.ZodLiteral<"track_start">;
1201
- }, z.core.$strip>], "position">;
1202
- on_anchored: z.ZodEnum<{
1203
- follow: "follow";
1204
- keep_absolute: "keep_absolute";
1205
- }>;
1206
- }, z.core.$strip>;
1207
- type MoveAnchor = z.infer<typeof moveAnchorSchema>;
1208
- type MovedClipAnchoredPolicy = z.infer<typeof movedClipAnchoredPolicySchema>;
1209
- type MoveVideoClipsByAnchorInput = z.infer<typeof moveVideoClipsByAnchorInputSchema>;
1210
- //#endregion
1211
- //#region src/editor/schemas/move-video-clips.d.ts
1212
- declare const moveVideoClipsInputSchema: z.ZodObject<{
1213
- clips: z.ZodArray<z.ZodObject<{
1214
- clip_id: z.ZodString;
1215
- new_start_ms: z.ZodNumber;
1216
- new_track_id: z.ZodOptional<z.ZodString>;
1217
- }, z.core.$strip>>;
1218
- }, z.core.$strip>;
1219
- type MoveVideoClipsInput = z.infer<typeof moveVideoClipsInputSchema>;
1220
- //#endregion
1221
- //#region src/editor/schemas/replace-video-clip-content.d.ts
1222
- /**
1223
- * Replace the media backing existing video clips. The media import runs upstream
1224
- * (Director); its stable result — the new media id, intrinsic length, and the
1225
- * reset trim window — arrives materialized (see
1226
- * `results/phase-4-side-effect-payload-contract.md` §4). Director resets
1227
- * `play_in=0` / `play_out=media_duration_ms` and clears `speed_shift` on
1228
- * replacement. The clip `part_id`s (hence their track items) are unchanged; the
1229
- * editor reflows the main track from the new effective durations.
1230
- */
1231
- declare const replaceVideoClipContentInputSchema: z.ZodObject<{
1232
- clips: z.ZodArray<z.ZodObject<{
1233
- clip_id: z.ZodString;
1234
- origin_media_id: z.ZodString;
1235
- media_duration_ms: z.ZodNumber;
1236
- play_in: z.ZodNumber;
1237
- play_out: z.ZodNumber;
1238
- volume: z.ZodNumber;
1239
- }, z.core.$strip>>;
1240
- }, z.core.$strip>;
1241
- type ReplaceVideoClipContentInput = z.infer<typeof replaceVideoClipContentInputSchema>;
1242
- //#endregion
1243
- //#region src/editor/schemas/replace-video-clip-sequence.d.ts
1244
- /**
1245
- * What happens to the speeches anchored to the clips being replaced.
1246
- *
1247
- * - `remap` re-anchors each surviving speech to the new clip in the SAME POSITION
1248
- * of the sequence, keeping its offset — old[i]'s children become new[i]'s
1249
- * children. An old clip with no counterpart (fewer new clips than old) has its
1250
- * subtree deleted, because there is nothing left to anchor to.
1251
- * - `cascade` deletes every anchored speech (and its captions) outright, like
1252
- * `deleteVideoClips`.
1253
- *
1254
- * **Required, with no default.** The two branches differ in whether the user's
1255
- * narration survives, and the agent tool that drives this op makes its
1256
- * `preserve_speeches` flag required for that reason. A default here would let a
1257
- * caller that forgot the field silently delete speech.
1258
- */
1259
- declare const anchoredReplacePolicySchema: z.ZodEnum<{
1260
- cascade: "cascade";
1261
- remap: "remap";
1262
- }>;
1263
- type AnchoredReplacePolicy = z.infer<typeof anchoredReplacePolicySchema>;
1264
- /**
1265
- * Replace a contiguous run of main-track clips with a new run.
1266
- *
1267
- * A composite of delete + insert that cannot be expressed as the two ops in
1268
- * sequence, because the anchored speeches have to survive *across* the swap: with
1269
- * `remap` they are re-anchored positionally, which needs both the old and the new
1270
- * ids in the same transaction (ADR 0009 — the cascade stays in the editor, callers
1271
- * never re-wire anchors themselves).
1272
- *
1273
- * Duration facts follow `addVideoClips`: `media_duration_ms` is the source's
1274
- * intrinsic length and the trim window defaults to the whole media. The effective
1275
- * timeline duration is derived by the projection, never an input.
1276
- *
1277
- * `media_id` is optional: omitting it creates a **deliberate empty placeholder
1278
- * clip** (`origin_media_id: ''`) — structure with no picture. This is the only op
1279
- * that can produce one, and it is authoritative state, unlike the gap fillers the
1280
- * read-side solve mints (which never enter the document).
1281
- */
1282
- declare const replaceVideoClipSequenceInputSchema: z.ZodObject<{
1283
- old_clip_ids: z.ZodArray<z.ZodString>;
1284
- new_clips: z.ZodArray<z.ZodObject<{
1285
- media_id: z.ZodOptional<z.ZodString>;
1286
- media_duration_ms: z.ZodNumber;
1287
- play_in: z.ZodOptional<z.ZodNumber>;
1288
- play_out: z.ZodOptional<z.ZodNumber>;
1289
- }, z.core.$strip>>;
1290
- on_anchored: z.ZodEnum<{
1291
- cascade: "cascade";
1292
- remap: "remap";
1293
- }>;
1294
- }, z.core.$strip>;
1295
- type ReplaceVideoClipSequenceInput = z.infer<typeof replaceVideoClipSequenceInputSchema>;
1296
- //#endregion
1297
- //#region src/editor/schemas/set-bgm.d.ts
1298
- /**
1299
- * Set the document BGM. The media's stable result (storage key) arrives
1300
- * materialized from upstream (see
1301
- * `results/phase-4-side-effect-payload-contract.md` §3). The op upserts the bgm
1302
- * part and seats it on the bgm lane; its effective length is always the whole
1303
- * timeline, derived by the projection on read — so there is no `duration_ms`
1304
- * input or fact (RFC 02 / `reference/16` §0b). A `bgm_id` lets the op replace an
1305
- * existing bgm part by id.
1306
- */
1307
- declare const setBgmInputSchema: z.ZodObject<{
1308
- bgm_id: z.ZodString;
1309
- audio_storage_key: z.ZodString;
1310
- origin_media_id: z.ZodString;
1311
- volume: z.ZodNumber;
1312
- }, z.core.$strip>;
1313
- type SetBgmInput = z.infer<typeof setBgmInputSchema>;
1314
- //#endregion
1315
- //#region src/editor/schemas/set-caption-style.d.ts
1316
- /**
1317
- * Set the caption visual style. GLOBAL by design: the style applies to every
1318
- * caption part in the document — it carries NO `caption_id`. This mirrors the FE,
1319
- * whose caption-style store (`caption-style.ts:persistCaptionStylePatch`) iterates
1320
- * ALL captions and writes the same normalized style to each; the product has a
1321
- * single document-wide caption style, not per-caption styling.
1322
- *
1323
- * Every field is optional and maps to a `CaptionStyle` attribute (snake_case
1324
- * IDL). A field present in the input is written to every caption; a field ABSENT
1325
- * from the input is left untouched on each caption (the editor merges the patch
1326
- * onto each caption's existing style — this is a value edit, not a full-style
1327
- * replace, so a partial patch such as "recolor only" does not wipe font size).
1328
- *
1329
- * Pure document edit, no cascade — captions keep their positions; only the style
1330
- * sub-map of each caption part changes.
1331
- */
1332
- declare const setCaptionStyleInputSchema: z.ZodObject<{
1333
- font_id: z.ZodOptional<z.ZodString>;
1334
- font_size: z.ZodOptional<z.ZodNumber>;
1335
- font_color: z.ZodOptional<z.ZodString>;
1336
- font_weight: z.ZodOptional<z.ZodNumber>;
1337
- entrance_animation: z.ZodOptional<z.ZodString>;
1338
- entrance_animation_duration_ms: z.ZodOptional<z.ZodNumber>;
1339
- stroke_color: z.ZodOptional<z.ZodString>;
1340
- stroke_width: z.ZodOptional<z.ZodNumber>;
1341
- position_x: z.ZodOptional<z.ZodNumber>;
1342
- position_y: z.ZodOptional<z.ZodNumber>;
1343
- }, z.core.$strip>;
1344
- type SetCaptionStyleInput = z.infer<typeof setCaptionStyleInputSchema>;
1345
- //#endregion
1346
- //#region src/editor/schemas/set-caption-visibility.d.ts
1347
- /**
1348
- * Toggle caption visibility (the caption track's `is_hidden` flag). Pure
1349
- * document edit, no cascade — captions keep their positions; only the lane's
1350
- * hidden flag changes.
1351
- */
1352
- declare const setCaptionVisibilityInputSchema: z.ZodObject<{
1353
- is_hidden: z.ZodBoolean;
1354
- }, z.core.$strip>;
1355
- type SetCaptionVisibilityInput = z.infer<typeof setCaptionVisibilityInputSchema>;
1356
- //#endregion
1357
- //#region src/editor/schemas/set-video-clip-speed-shift.d.ts
1358
- /**
1359
- * Set the playback speed of existing video clips. Per the speed-shift decision
1360
- * (`reference/16` §0): the op writes only the `speed_shift` fact — it does NOT
1361
- * store an effective `duration_ms` (projection derives it from the trim window /
1362
- * speed) and does NOT scale anchored speeches' relative offsets (offsets stay
1363
- * put; the cascade reflows absolute positions). A `null` speed_shift clears the
1364
- * speed back to original (1×).
1365
- */
1366
- declare const setVideoClipSpeedShiftInputSchema: z.ZodObject<{
1367
- clips: z.ZodArray<z.ZodObject<{
1368
- clip_id: z.ZodString;
1369
- speed_shift: z.ZodNullable<z.ZodObject<{
1370
- category: z.ZodEnum<{
1371
- curve: "curve";
1372
- linear: "linear";
1373
- }>;
1374
- mode: z.ZodString;
1375
- config: z.ZodUnion<readonly [z.ZodObject<{
1376
- linear: z.ZodObject<{
1377
- speed: z.ZodNumber;
1378
- }, z.core.$strip>;
1379
- }, z.core.$strip>, z.ZodObject<{
1380
- curve: z.ZodObject<{
1381
- keyframes: z.ZodArray<z.ZodObject<{
1382
- position: z.ZodNumber;
1383
- rate: z.ZodNumber;
1384
- in_tangent: z.ZodOptional<z.ZodObject<{
1385
- x: z.ZodNumber;
1386
- y: z.ZodNumber;
1387
- }, z.core.$strip>>;
1388
- out_tangent: z.ZodOptional<z.ZodObject<{
1389
- x: z.ZodNumber;
1390
- y: z.ZodNumber;
1391
- }, z.core.$strip>>;
1392
- }, z.core.$strip>>;
1393
- }, z.core.$strip>;
1394
- }, z.core.$strip>]>;
1395
- }, z.core.$strip>>;
1396
- }, z.core.$strip>>;
1397
- }, z.core.$strip>;
1398
- type SetVideoClipSpeedShiftInput = z.infer<typeof setVideoClipSpeedShiftInputSchema>;
1399
- //#endregion
1400
- //#region src/editor/schemas/shared.d.ts
1401
- declare const clipIdSchema: z.ZodString;
1402
- declare const clipIdsSchema: z.ZodArray<z.ZodString>;
1403
- declare const mediaIdSchema: z.ZodString;
1404
- declare const speechIdSchema: z.ZodString;
1405
- declare const timelineMsSchema: z.ZodNumber;
1406
- declare const positiveMsSchema: z.ZodNumber;
1407
- declare const volumeSchema: z.ZodNumber;
1408
- declare const speechIdsSchema: z.ZodArray<z.ZodString>;
1409
- /**
1410
- * A clip's playback-speed fact, the only thing `SetVideoClipSpeedShift` writes.
1411
- * Mirrors the IDL `SpeedShift`: `category` is `linear` | `curve`, and `config`
1412
- * is a discriminated union — `{ linear: { speed } }` for a constant multiplier
1413
- * (the multiplier projection reads at `config.linear.speed`) or `{ curve: {
1414
- * keyframes } }` for a Bezier-controlled variable speed (RFC 02 / `reference/16`
1415
- * §0). Exactly one of `linear` / `curve` is present.
1416
- */
1417
- declare const speedShiftSchema: z.ZodObject<{
1418
- category: z.ZodEnum<{
1419
- curve: "curve";
1420
- linear: "linear";
1421
- }>;
1422
- mode: z.ZodString;
1423
- config: z.ZodUnion<readonly [z.ZodObject<{
1424
- linear: z.ZodObject<{
1425
- speed: z.ZodNumber;
1426
- }, z.core.$strip>;
1427
- }, z.core.$strip>, z.ZodObject<{
1428
- curve: z.ZodObject<{
1429
- keyframes: z.ZodArray<z.ZodObject<{
1430
- position: z.ZodNumber;
1431
- rate: z.ZodNumber;
1432
- in_tangent: z.ZodOptional<z.ZodObject<{
1433
- x: z.ZodNumber;
1434
- y: z.ZodNumber;
1435
- }, z.core.$strip>>;
1436
- out_tangent: z.ZodOptional<z.ZodObject<{
1437
- x: z.ZodNumber;
1438
- y: z.ZodNumber;
1439
- }, z.core.$strip>>;
1440
- }, z.core.$strip>>;
1441
- }, z.core.$strip>;
1442
- }, z.core.$strip>]>;
1443
- }, z.core.$strip>;
1444
- declare const voiceSchema: z.ZodObject<{
1445
- id: z.ZodString;
1446
- name: z.ZodString;
1447
- }, z.core.$strip>;
1448
- //#endregion
1449
- //#region src/editor/schemas/speech-assets.d.ts
1450
- /**
1451
- * The materialized TTS result shared by `AddSpeeches` / `ChangeSpeechScript` /
1452
- * `ChangeSpeechVoice` (see `results/phase-4-side-effect-payload-contract.md`
1453
- * §1/§2). The side effect (TTS/ASR + billing) runs upstream; the op receives the
1454
- * stable speech + caption parts and writes them as authoritative facts. No
1455
- * cascade runs on write — the projection derives absolute positions on read.
1456
- *
1457
- * Each speech carries the anchoring fact directly (RFC 02 §4): the host video
1458
- * clip `anchor_part_id` and the `offset_ms` within it. The upstream caller
1459
- * already knows which clip a speech attaches to, so the op writes
1460
- * `{ mode:'anchored', anchorPartId, offsetMs }` verbatim — no write-time
1461
- * host-picking. Captions anchor to their speech via the caption part's
1462
- * `start_ms` (offset within the speech).
1463
- */
1464
- declare const speechAssetSchema: z.ZodObject<{
1465
- speech_id: z.ZodString;
1466
- anchor_part_id: z.ZodString;
1467
- offset_ms: z.ZodNumber;
1468
- audio_storage_key: z.ZodString;
1469
- duration_ms: z.ZodNumber;
1470
- audio_script: z.ZodString;
1471
- volume: z.ZodNumber;
1472
- voice: z.ZodObject<{
1473
- id: z.ZodString;
1474
- name: z.ZodString;
1475
- }, z.core.$strip>;
1476
- origin_speech_id: z.ZodString;
1477
- caption_ids: z.ZodArray<z.ZodString>;
1478
- }, z.core.$strip>;
1479
- declare const captionAssetSchema: z.ZodObject<{
1480
- caption_id: z.ZodString;
1481
- speech_part_id: z.ZodString;
1482
- text: z.ZodString;
1483
- start_ms: z.ZodNumber;
1484
- duration_ms: z.ZodNumber;
1485
- }, z.core.$strip>;
1486
- /** A materialized speech-subtree write (speeches + their captions). */
1487
- declare const speechAssetsSchema: z.ZodObject<{
1488
- speeches: z.ZodArray<z.ZodObject<{
1489
- speech_id: z.ZodString;
1490
- anchor_part_id: z.ZodString;
1491
- offset_ms: z.ZodNumber;
1492
- audio_storage_key: z.ZodString;
1493
- duration_ms: z.ZodNumber;
1494
- audio_script: z.ZodString;
1495
- volume: z.ZodNumber;
1496
- voice: z.ZodObject<{
1497
- id: z.ZodString;
1498
- name: z.ZodString;
1499
- }, z.core.$strip>;
1500
- origin_speech_id: z.ZodString;
1501
- caption_ids: z.ZodArray<z.ZodString>;
1502
- }, z.core.$strip>>;
1503
- captions: z.ZodArray<z.ZodObject<{
1504
- caption_id: z.ZodString;
1505
- speech_part_id: z.ZodString;
1506
- text: z.ZodString;
1507
- start_ms: z.ZodNumber;
1508
- duration_ms: z.ZodNumber;
1509
- }, z.core.$strip>>;
1510
- }, z.core.$strip>;
1511
- type SpeechAsset = z.infer<typeof speechAssetSchema>;
1512
- type CaptionAsset = z.infer<typeof captionAssetSchema>;
1513
- type SpeechAssets = z.infer<typeof speechAssetsSchema>;
1514
- declare namespace index_d_exports {
1515
- export { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, AnchoredDeletePolicy, AnchoredReplacePolicy, CaptionAsset, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, MoveAnchor, MoveSpeechesInput, MoveVideoClipsByAnchorInput, MoveVideoClipsInput, MovedClipAnchoredPolicy, ReplaceVideoClipContentInput, ReplaceVideoClipSequenceInput, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput, SpeechAsset, SpeechAssets, addSpeechesInputSchema, addVideoClipsInputSchema, adjustBgmVolumeInputSchema, adjustSpeechVolumeInputSchema, adjustVideoClipDurationInputSchema, adjustVideoClipVolumeInputSchema, anchoredDeletePolicySchema, anchoredReplacePolicySchema, changeSpeechScriptInputSchema, changeSpeechVoiceInputSchema, clipIdSchema, clipIdsSchema, deleteBgmInputSchema, deleteSpeechesInputSchema, deleteVideoClipsInputSchema, mediaIdSchema, moveAnchorSchema, moveSpeechesInputSchema, moveVideoClipsByAnchorInputSchema, moveVideoClipsInputSchema, movedClipAnchoredPolicySchema, positiveMsSchema, replaceVideoClipContentInputSchema, replaceVideoClipSequenceInputSchema, setBgmInputSchema, setCaptionStyleInputSchema, setCaptionVisibilityInputSchema, setVideoClipSpeedShiftInputSchema, speechAssetsSchema, speechIdSchema, speechIdsSchema, speedShiftSchema, timelineMsSchema, voiceSchema, volumeSchema };
1516
- }
1135
+ * The ULID is generated inline (Crockford Base32, 48-bit time + 80-bit random)
1136
+ * rather than pulling the `ulid` npm package: the randomness class matches the
1137
+ * old generator (both `Math.random`-based) and it keeps `@mengine/medeo-client`
1138
+ * dependency-free for a purely mechanical id string. Part ids only need to be
1139
+ * unique and lexicographically time-sortable, which this satisfies.
1140
+ */
1141
+ /**
1142
+ * Online part-id semantic prefixes. `clip` (video clip) is the only value the
1143
+ * engine currently mints (see `addVideoClips`); the rest are declared so the
1144
+ * type documents the shared vocabulary and guards against reintroducing the old
1145
+ * `vc`/`sp`/`cp`/`bg` names. Speech/caption/bgm ids arrive pre-minted in op
1146
+ * payloads, so the engine never generates them itself.
1147
+ */
1148
+ type PartIdPrefix = 'clip' | 'spe' | 'cap' | 'bgm' | 'ti';
1149
+ declare function generatePartId(prefix: PartIdPrefix): string;
1150
+ /** Injectable part-id mint; defaults to `generatePartId` on `SemanticEditor`. */
1151
+ type PartIdFactory = (prefix: PartIdPrefix) => string;
1517
1152
  //#endregion
1518
1153
  //#region src/editor/schema-validator.d.ts
1519
1154
  interface SnapshotReadable {
@@ -1667,10 +1302,15 @@ interface OpActor {
1667
1302
  role: 'user' | 'agent';
1668
1303
  }
1669
1304
  interface CommitOptions {
1670
- intent?: {
1671
- kind: string;
1672
- payload: unknown;
1673
- };
1305
+ /**
1306
+ * Caller-supplied intent attached to the op's audit message.
1307
+ *
1308
+ * Typed as `unknown` to match `TransactAudit.intent`. The wire (real
1309
+ * mengine-server and the in-memory test double) only surfaces **string**
1310
+ * intents onto the audit log — non-string values stay in the Loro commit
1311
+ * message but parse to `null`. Agent callers should pass a string.
1312
+ */
1313
+ intent?: unknown;
1674
1314
  /** Author of this op; omitted for writes with no acting user (bootstrap, repair). */
1675
1315
  actor?: OpActor;
1676
1316
  }
@@ -1702,6 +1342,8 @@ interface TransactAudit {
1702
1342
  * position. The caller never materializes a layout (ADR 0009).
1703
1343
  */
1704
1344
  interface SemanticDocumentAdapter extends SnapshotReadable {
1345
+ /** True once the document holds real content (a bootstrapped/synced snapshot). */
1346
+ hasContent(): boolean;
1705
1347
  /**
1706
1348
  * Apply one op's whole mutation in a single transaction. `edit` mutates the
1707
1349
  * document draft; the adapter diffs the result and commits once with `audit`.
@@ -1713,7 +1355,8 @@ interface SemanticDocumentAdapter extends SnapshotReadable {
1713
1355
  declare class SemanticEditor {
1714
1356
  private readonly doc;
1715
1357
  private readonly validator;
1716
- constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator);
1358
+ private readonly idFactory;
1359
+ constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator, idFactory?: PartIdFactory);
1717
1360
  moveVideoClips(input: MoveVideoClipsInput, options?: CommitOptions): Promise<void>;
1718
1361
  /**
1719
1362
  * Reorder main-track clips relative to an anchor clip, moving them as one block.
@@ -1867,10 +1510,11 @@ declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
1867
1510
  constructor(doc: LoroDoc);
1868
1511
  snapshot(): VideoDocument;
1869
1512
  /**
1870
- * Release mirror subscriptions; do not reuse this adapter afterwards.
1871
- * The caller still owns the borrowed LoroDoc.
1513
+ * True once the doc holds real document content. A fresh mirror over an empty
1514
+ * doc still reports defaulted root maps, so probe the stored `schema_version`
1515
+ * (empty until a snapshot is bootstrapped or synced in).
1872
1516
  */
1873
- dispose(): void;
1517
+ hasContent(): boolean;
1874
1518
  /**
1875
1519
  * Apply one op as a single transaction. `edit` mutates the immer draft; mirror
1876
1520
  * diffs the result and commits once with the audit `message`. A throw in `edit`
@@ -1883,14 +1527,67 @@ declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
1883
1527
  declare function createMirrorVideoDocument(document: VideoDocument, options?: MirrorVideoDocumentOptions): LoroDoc;
1884
1528
  /** Build a `MirrorVideoDocumentAdapter` over a fresh doc seeded with `document`. */
1885
1529
  declare function createMirrorVideoDocumentAdapter(document: VideoDocument, options?: MirrorVideoDocumentOptions): MirrorVideoDocumentAdapter;
1530
+ /** Host-only replacement of a derived view, retaining the existing Loro history. */
1531
+ declare function applyEntityTimelineProjection(doc: LoroDoc, projection: VideoDocument, entityRevision: number): Uint8Array;
1532
+ /** Write a whole `VideoDocument` into a draft (seed a fresh doc / plain-memory state). */
1533
+ declare function writeVideoDocumentToDraft(draft: VideoDocumentDraft, document: VideoDocument): void;
1534
+ //#endregion
1535
+ //#region src/document/plain-memory-adapter.d.ts
1536
+ /**
1537
+ * A `TransactAudit` widened with the ordered ids minted during that transact.
1538
+ * `generated_ids` is empty when the op never called the id factory.
1539
+ */
1540
+ interface JournalEntry extends TransactAudit {
1541
+ /** Ids produced by the adapter's id factory during this transact, in mint order. */
1542
+ generated_ids: string[];
1543
+ }
1544
+ interface PlainMemoryAdapterOptions {
1545
+ /** Underlying id mint; wrapped so each call inside a transact is journaled. */
1546
+ idFactory?: PartIdFactory;
1547
+ }
1548
+ /**
1549
+ * Pure in-memory `SemanticDocumentAdapter` — no Loro/WASM. Holds a
1550
+ * `VideoDocumentDraft` object and applies each `transact` via immer `produce`,
1551
+ * journaling every audit that actually mutated state (plus any ids minted
1552
+ * during that transact).
1553
+ *
1554
+ * Known benign difference vs `MirrorVideoDocumentAdapter`: the editor's
1555
+ * `setPart` assigns a fresh part object on every call, so a same-value rewrite
1556
+ * produces a new immer state and IS journaled here, while the mirror's deep
1557
+ * diff emits no commit. Terminal `snapshot()` stays equal; replay is idempotent.
1558
+ */
1559
+ declare class PlainMemoryAdapter implements SemanticDocumentAdapter {
1560
+ private state;
1561
+ private readonly _journal;
1562
+ private readonly baseIdFactory;
1563
+ /** Non-null only while a `transact` edit callback is running. */
1564
+ private pendingIds;
1565
+ /**
1566
+ * Recording wrapper around the underlying factory. Callers (sandbox editor)
1567
+ * use this so every minted id is appended to the current transact's list.
1568
+ */
1569
+ readonly idFactory: PartIdFactory;
1570
+ constructor(document: VideoDocument, options?: PlainMemoryAdapterOptions);
1571
+ get journal(): readonly JournalEntry[];
1572
+ hasContent(): boolean;
1573
+ snapshot(): VideoDocument;
1574
+ /**
1575
+ * Apply one op via immer. A throw in `edit` discards the draft (state and
1576
+ * journal unchanged). When `produce` returns the same reference, there was
1577
+ * no structural change — skip journal, matching mirror "no change, no commit".
1578
+ */
1579
+ transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
1580
+ }
1581
+ /** Build a `PlainMemoryAdapter` seeded with `document`. */
1582
+ declare function createPlainMemoryAdapter(document: VideoDocument, options?: PlainMemoryAdapterOptions): PlainMemoryAdapter;
1886
1583
  //#endregion
1887
1584
  //#region src/document/mirror-read.d.ts
1888
1585
  /**
1889
1586
  * Project the mirror state (`VideoDocumentDraft`) into the authoritative
1890
1587
  * `VideoDocument`. The storage shape is isomorphic to the domain shape (RFC 03
1891
- * §4, reference/17 §4: timeline + a single `tracks` list + part_library), so this
1588
+ * §4, reference/17 §4: meta map + a single `tracks` list + part_library), so this
1892
1589
  * is a near-identity — it reads `time_position` / `fallback_abs_ms` JSON blobs
1893
- * back into structured values and selects content fields. Legacy meta is ignored.
1590
+ * back into structured values and trims empty strings, nothing more.
1894
1591
  *
1895
1592
  * It maps only authoritative facts (RFC 02 §6): `part_id` + `time_position`. The
1896
1593
  * projection-derived `VideoDraft` read-view (absolute time, `part_aggregations`,
@@ -1940,7 +1637,7 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
1940
1637
  id: z.ZodOptional<z.ZodString>;
1941
1638
  kind: z.ZodLiteral<"caption">;
1942
1639
  initial_duration_ms: z.ZodNumber;
1943
- speech_part_id: z.ZodString;
1640
+ speech_part_id: z.ZodOptional<z.ZodString>;
1944
1641
  text: z.ZodString;
1945
1642
  start_ms: z.ZodNumber;
1946
1643
  style: z.ZodOptional<z.ZodObject<{
@@ -1966,15 +1663,28 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
1966
1663
  }, z.core.$loose>;
1967
1664
  }, z.core.$loose>]>;
1968
1665
  declare const videoDocumentSchema: z.ZodObject<{
1666
+ meta: z.ZodObject<{
1667
+ schema_version: z.ZodEnum<{
1668
+ "video-document/v0": "video-document/v0";
1669
+ "video-document/entity-projection-v1": "video-document/entity-projection-v1";
1670
+ }>;
1671
+ draft_id: z.ZodOptional<z.ZodString>;
1672
+ project_id: z.ZodOptional<z.ZodString>;
1673
+ owner_id: z.ZodOptional<z.ZodString>;
1674
+ thumbnail_storage_key: z.ZodOptional<z.ZodString>;
1675
+ chat_session_id: z.ZodOptional<z.ZodString>;
1676
+ video_creation_settings: z.ZodOptional<z.ZodUnknown>;
1677
+ version: z.ZodOptional<z.ZodNumber>;
1678
+ }, z.core.$loose>;
1969
1679
  timeline: z.ZodOptional<z.ZodObject<{
1970
1680
  unit_time_ms: z.ZodOptional<z.ZodNumber>;
1971
1681
  }, z.core.$loose>>;
1972
1682
  tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1973
1683
  id: z.ZodOptional<z.ZodString>;
1974
1684
  parts_kind: z.ZodOptional<z.ZodEnum<{
1975
- bgm: "bgm";
1976
- caption: "caption";
1977
1685
  speech: "speech";
1686
+ caption: "caption";
1687
+ bgm: "bgm";
1978
1688
  video_clip: "video_clip";
1979
1689
  }>>;
1980
1690
  is_hidden: z.ZodOptional<z.ZodBoolean>;
@@ -2030,7 +1740,7 @@ declare const videoDocumentSchema: z.ZodObject<{
2030
1740
  id: z.ZodOptional<z.ZodString>;
2031
1741
  kind: z.ZodLiteral<"caption">;
2032
1742
  initial_duration_ms: z.ZodNumber;
2033
- speech_part_id: z.ZodString;
1743
+ speech_part_id: z.ZodOptional<z.ZodString>;
2034
1744
  text: z.ZodString;
2035
1745
  start_ms: z.ZodNumber;
2036
1746
  style: z.ZodOptional<z.ZodObject<{
@@ -2057,4 +1767,4 @@ declare const videoDocumentSchema: z.ZodObject<{
2057
1767
  }, z.core.$loose>]>>>;
2058
1768
  }, z.core.$loose>;
2059
1769
  //#endregion
2060
- export { VideoDraft as $, assertValidVideoDocument as A, CaptionPart as B, index_d_exports as C, VideoDocumentMirrorSchema as D, VideoDocumentDraft as E, buildSpeechHostMap as F, Timeline as G, PartKind as H, derivePositionFromAbs as I, TrackItemTimePosition as J, Track as K, fromVideoDocument as L, buildInitialVideoDocument as M, DerivedItemPosition as N, videoDocumentMirrorSchema as O, SpeechHostMap as P, VideoDocumentValidationIssueCode as Q, toVideoDocument as R, ValidationError as S, TrackItemDraft as T, PartUnion as U, DEFAULT_UNIT_TIME_MS as V, SpeechPart as W, VideoDocument as X, VideoClipPart as Y, VideoDocumentValidationIssue as Z, PlannedSemanticOpKind as _, MirrorVideoDocumentOptions as a, PartAggregation as at, SchemaValidator as b, CommitOptions as c, Track$1 as ct, SemanticEditor as d, VideoDraftContent as et, SemanticOpInput as f, ImplementedSemanticOpKind as g, IMPLEMENTED_SEMANTIC_OP_KINDS as h, MirrorVideoDocumentAdapter as i, CaptionStyle as it, validateVideoDocument as j, VideoDocumentValidationError as k, OpActor as l, TrackItem$1 as lt, TransactAudit as m, videoDocumentSchema as n, Attachment as nt, createMirrorVideoDocument as o, SpeedShift as ot, SemanticOpName as p, TrackItem as q, readVideoDocumentFromDraft as r, CaptionPart$1 as rt, createMirrorVideoDocumentAdapter as s, Timeline$1 as st, partUnionSchema as t, VideoDraftPartUnion as tt, SemanticDocumentAdapter as u, SemanticOpKind as v, TrackDraft as w, SnapshotReadable as x, isImplementedSemanticOpKind as y, BgmPart as z };
1770
+ export { VoiceDescriptor as $, generatePartId as A, effectiveVideoClipDurationMs as At, ResolvedEntityClipPlacement as B, PlannedSemanticOpKind as C, VideoClipPart as Ct, SnapshotReadable as D, VideoDocumentValidationIssueCode as Dt, SchemaValidator as E, VideoDocumentValidationIssue as Et, videoDocumentMirrorSchema as F, PartAggregation as Ft, EntityTimelineProjectionError as G, ResolvedEntityTrack as H, VideoDocumentValidationError as I, SpeedShift as It, CaptionSegmentSelection as J, EntityRelationRows as K, assertValidVideoDocument as L, Timeline$1 as Lt, TrackItemDraft as M, Attachment as Mt, VideoDocumentDraft as N, CaptionPart$1 as Nt, ValidationError as O, VideoDraft as Ot, VideoDocumentMirrorSchema as P, CaptionStyle as Pt, SequenceRange as Q, validateVideoDocument as R, Track$1 as Rt, ImplementedSemanticOpKind as S, VIDEO_DOCUMENT_SCHEMA_VERSION as St, isImplementedSemanticOpKind as T, VideoDocumentSchemaVersion as Tt, resolveEntityTimelineLayout as U, ResolvedEntityTimelineLayout as V, projectEntityTimeline as W, ScriptTextSegment as X, CaptionStyleFields as Y, SequenceDuration as Z, SemanticEditor as _, SpeechPart as _t, PlainMemoryAdapter as a, DerivedItemPosition as at, TransactAudit as b, TrackItem as bt, MirrorVideoDocumentAdapter as c, derivePositionFromAbs as ct, createMirrorVideoDocument as d, BgmPart as dt, JsonObject as et, createMirrorVideoDocumentAdapter as f, CaptionPart as ft, SemanticDocumentAdapter as g, PartUnion as gt, OpActor as h, PartKind as ht, JournalEntry as i, buildInitialVideoDocument as it, TrackDraft as j, speedOf as jt, PartIdFactory as k, VideoDraftPartUnion as kt, MirrorVideoDocumentOptions as l, fromVideoDocument as lt, CommitOptions as m, ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION as mt, videoDocumentSchema as n, EntityId as nt, PlainMemoryAdapterOptions as o, SpeechHostMap as ot, writeVideoDocumentToDraft as p, DEFAULT_UNIT_TIME_MS as pt, EntityRow as q, readVideoDocumentFromDraft as r, InitialDocumentFacts as rt, createPlainMemoryAdapter as s, buildSpeechHostMap as st, partUnionSchema as t, JsonValue as tt, applyEntityTimelineProjection as u, toVideoDocument as ut, SemanticOpInput as v, Timeline as vt, SemanticOpKind as w, VideoDocument as wt, IMPLEMENTED_SEMANTIC_OP_KINDS as x, TrackItemTimePosition as xt, SemanticOpName as y, Track as yt, EntityTimelineTrackRole as z, TrackItem$1 as zt };