@mengine/medeo-client 2.0.1-alpha.2 → 2.0.1-alpha.4

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,4 +1,3 @@
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";
2
1
  import { InferInputType } from "loro-mirror";
3
2
  import { z } from "zod";
4
3
  import { LoroDoc, PeerID } from "loro-crdt";
@@ -30,10 +29,10 @@ import { LoroDoc, PeerID } from "loro-crdt";
30
29
  * @enum
31
30
  */
32
31
  declare const PartKind$1: {
33
- readonly BGM: "bgm";
34
- readonly CAPTION: "caption";
35
- readonly SPEECH: "speech";
36
- readonly VIDEO_CLIP: "video_clip";
32
+ readonly BGM: 'bgm';
33
+ readonly CAPTION: 'caption';
34
+ readonly SPEECH: 'speech';
35
+ readonly VIDEO_CLIP: 'video_clip';
37
36
  };
38
37
  /**
39
38
  * @public
@@ -145,8 +144,8 @@ interface CaptionPart$1 {
145
144
  * @enum
146
145
  */
147
146
  declare const AspectRatio: {
148
- readonly RATIO_16_9: "16:9";
149
- readonly RATIO_9_16: "9:16";
147
+ readonly RATIO_16_9: '16:9';
148
+ readonly RATIO_9_16: '9:16';
150
149
  };
151
150
  /**
152
151
  * @public
@@ -157,10 +156,10 @@ type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
157
156
  * @enum
158
157
  */
159
158
  declare const AssetSource: {
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";
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';
164
163
  };
165
164
  /**
166
165
  * @public
@@ -254,11 +253,11 @@ declare const SpeedShiftCategory: {
254
253
  /**
255
254
  * Variable speed controlled by Bezier keyframes
256
255
  */
257
- readonly CURVE: "curve";
256
+ readonly CURVE: 'curve';
258
257
  /**
259
258
  * Constant speed multiplier across the entire clip
260
259
  */
261
- readonly LINEAR: "linear";
260
+ readonly LINEAR: 'linear';
262
261
  };
263
262
  /**
264
263
  * @public
@@ -442,10 +441,6 @@ interface VideoDraft$1 {
442
441
  }
443
442
  //#endregion
444
443
  //#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;
449
444
  type PartKind = 'video_clip' | 'speech' | 'caption' | 'bgm';
450
445
  /**
451
446
  * Project-level creation settings. Mirrors the IDL, but keeps the two fields the
@@ -487,21 +482,9 @@ type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
487
482
  *
488
483
  * `speech_part_id` / `start_ms` are kept as resource-intrinsic facts (which
489
484
  * speech it was split from, and its offset in that source) — reference/17
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.
495
- */
496
- /** Derived render interval, relative to the placed Caption Clip; never an Entity. */
497
- interface CaptionDisplayCue {
498
- segmentId: string;
499
- text: string;
500
- startMs: number;
501
- durationMs: number;
502
- }
485
+ * principle 4.
486
+ */
503
487
  type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
504
- display_cues?: CaptionDisplayCue[];
505
488
  initial_duration_ms?: number | undefined;
506
489
  };
507
490
  /**
@@ -567,19 +550,6 @@ interface Track {
567
550
  is_hidden: boolean | undefined;
568
551
  items: TrackItem[] | undefined;
569
552
  }
570
- /** The linear speed multiplier of a `speed_shift`, defaulting to 1 (original). */
571
- declare function speedOf(speedShift: SpeedShift | undefined): number;
572
- /**
573
- * A video clip's effective timeline duration, derived from authoritative facts
574
- * (RFC 02, `reference/16` §4, reference/17 §5): the trim window
575
- * `play_out - play_in` divided by the speed multiplier, rounded to integer ms.
576
- * `play_in` / `play_out` are optional in the IDL but every write path sets them
577
- * (defaulting to the whole media), and the legacy-ingest projection backfills the
578
- * window from a legacy `duration_ms` — so an authoritative clip always carries a
579
- * trim window and there is no stored `duration_ms` to fall back to. A clip with
580
- * neither bound yields 0. Speeds the clip up (>1× → shorter) or down (<1×).
581
- */
582
- declare function effectiveVideoClipDurationMs(clip: VideoClipPart): number;
583
553
  /**
584
554
  * Authoritative part union: a flat discriminated union over the four part kinds.
585
555
  * Deliberately *not* the IDL's namespace union (no `$unknown` / `visit`): engine
@@ -645,17 +615,52 @@ type VideoDraftPartUnion = {
645
615
  };
646
616
  };
647
617
  /**
648
- * Derived `VideoDraft` read-view. The shape follows the IDL verbatim except for
649
- * `part_library`: the IDL types its parts with the generated namespace
650
- * `PartUnion`, but the engine's projection emits `VideoDraftPartUnion` — the
651
- * authoritative parts with the derived `duration_ms` re-injected (reference/17 §7)
652
- * plus the engine extensions (`media_duration_ms`, the looser `SpeedShift`). This
653
- * is the intentional superset over the IDL `VideoDraft` (see the extensions note).
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.
654
621
  */
655
622
  type VideoDraft = Omit<VideoDraft$1, 'part_library' | 'video_creation_settings'> & {
656
623
  part_library: Record<string, VideoDraftPartUnion> | undefined;
657
624
  video_creation_settings?: VideoCreationSettings | undefined;
658
625
  };
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
+ };
659
664
  /** Authoritative timeline: `duration_ms` is derived (= longest track), not stored. */
660
665
  interface Timeline {
661
666
  unit_time_ms: number | undefined;
@@ -670,39 +675,19 @@ interface Timeline {
670
675
  * is not, and passes any `>= 0` guard on its way to an editor that cannot use it.
671
676
  */
672
677
  declare const DEFAULT_UNIT_TIME_MS = 33.333;
673
- /**
674
- * Project-level scalars that do not participate in track ordering. Grouped under
675
- * `meta` because the loro-mirror `schema()` root only accepts container schemas,
676
- * not bare scalars — so these must live inside a map container in storage. The
677
- * domain type mirrors that storage shape 1:1 (RFC 03 §4) rather than flattening,
678
- * keeping `VideoDocument` and the loro draft isomorphic and the mapping layer a
679
- * near-identity. `schema_version` lives here too (it is a scalar fact).
680
- */
681
- interface VideoDocumentMeta {
682
- schema_version: VideoDocumentSchemaVersion;
683
- draft_id?: string | undefined;
684
- project_id: VideoDraft['project_id'];
685
- owner_id: VideoDraft['owner_id'];
686
- thumbnail_storage_key: VideoDraft['thumbnail_storage_key'];
687
- chat_session_id: VideoDraft['chat_session_id'];
688
- video_creation_settings: VideoDraft['video_creation_settings'];
689
- /** Legacy imported version for v0; committed Entity revision for entity-projection-v1. */
690
- version: VideoDraft['version'];
691
- }
692
678
  /**
693
679
  * Authoritative collaborative document: only facts. Positioning lives on each
694
680
  * `TrackItem.time_position`; absolute time, `part_aggregations`, and total
695
681
  * duration are derived in the `VideoDraft` projection, not stored here (RFC 02 §6).
696
682
  *
697
- * The shape mirrors the loro storage structure 1:1 (RFC 03 §4): a `meta` map of
698
- * project scalars, plus a single ordered `tracks` list (reference/17 §4). A
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
699
685
  * track's lane is expressed by its `parts_kind`, not by which container it lives
700
686
  * in — the `main` / `above` / `below` three-pane view is reconstructed at
701
687
  * projection time. Order is the list order itself, so there is no `lane` /
702
688
  * `lane_order` field to diverge under concurrent edits.
703
689
  */
704
690
  interface VideoDocument {
705
- meta: VideoDocumentMeta;
706
691
  timeline: Timeline | undefined;
707
692
  tracks: Track[] | undefined;
708
693
  part_library: Record<string, PartUnion> | undefined;
@@ -726,13 +711,13 @@ interface VideoDocumentValidationIssue {
726
711
  //#endregion
727
712
  //#region src/document/projection.d.ts
728
713
  /**
729
- * Projection between the authoritative `VideoDocument` and the legacy
730
- * `VideoDraft` read-view (RFC 02 §5/§7). Both directions live here:
714
+ * Projection between authoritative `VideoDocument` and compatible content
715
+ * layouts (RFC 02 §5/§7). Both directions live here:
731
716
  *
732
717
  * - `toVideoDocument` ingests a `VideoDraft`, deriving each item's `position`
733
718
  * from the legacy absolute layout + aggregations; derived values (abs time,
734
719
  * `part_aggregations`, total duration) are dropped.
735
- * - `fromVideoDocument` solves a `VideoDocument` back into a `VideoDraft` via the
720
+ * - `fromVideoDocument` solves a `VideoDocument` into `VideoDraftContent` via the
736
721
  * timeline-core cascade, re-deriving exactly those values.
737
722
  *
738
723
  * Business validation lives in `validation.ts`; `fromVideoDocument` asserts a
@@ -744,7 +729,7 @@ interface VideoDocumentValidationIssue {
744
729
  * aggregations (RFC 02 §4/§5). Absolute time, `part_aggregations`, and total
745
730
  * duration are dropped — they are re-derived by the projection.
746
731
  */
747
- declare function toVideoDocument(draft: VideoDraft): VideoDocument;
732
+ declare function toVideoDocument(draft: Pick<VideoDraft, keyof VideoDraftContent>): VideoDocument;
748
733
  /** speech/attachment part_id → its host video part_id + relative offset. */
749
734
  type SpeechHostMap = Map<string, {
750
735
  hostPartId: string;
@@ -784,8 +769,8 @@ interface DerivedItemPosition {
784
769
  */
785
770
  declare function derivePositionFromAbs(partId: string, abs: number, isMain: boolean, speechHost: SpeechHostMap, partLibrary: Record<string, PartUnion | string | undefined>): DerivedItemPosition;
786
771
  /**
787
- * Project the authoritative `VideoDocument` back into the legacy `VideoDraft`
788
- * read-view, solving each item's absolute position, the `part_aggregations`, and
772
+ * Project `VideoDocument` into `VideoDraftContent`, solving each item's
773
+ * absolute position, the `part_aggregations`, and
789
774
  * the total duration via the timeline-core cascade.
790
775
  *
791
776
  * The read-view is a compatibility contract, and the IDL declares
@@ -799,32 +784,15 @@ declare function derivePositionFromAbs(partId: string, abs: number, isMain: bool
799
784
  * These two are defaultable because the projection knows their values on its own:
800
785
  * absent `unit_time_ms` means "no display granularity was ever stated" and absent
801
786
  * `is_hidden` means "this track was never hidden". `version` is NOT defaultable
802
- * here — its only honest value is server state (`update_seq`) that a
803
- * `VideoDocument` cannot see, so it stays absent and the HTTP layer fills it.
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.
804
789
  */
805
- declare function fromVideoDocument(document: VideoDocument): VideoDraft;
790
+ declare function fromVideoDocument(document: VideoDocument): VideoDraftContent;
806
791
  //#endregion
807
792
  //#region src/document/initial-document.d.ts
808
- /**
809
- * The project facts a freshly created document is built from — exactly the five
810
- * fields Director sets when it creates a draft row, and nothing else.
811
- *
812
- * Deliberately not a whole `VideoDraft`: tracks and the part library of a new
813
- * document are empty by definition, so accepting them would mean accepting
814
- * values that must always be empty, and every such field is a place for a future
815
- * caller to send something that is silently dropped. The narrow shape makes the
816
- * "a new document has no content" rule structural instead of a convention.
817
- */
818
- interface InitialDocumentFacts {
819
- draftId: string;
820
- projectId: string | undefined;
821
- ownerId: string | undefined;
822
- chatSessionId: string | undefined;
823
- videoCreationSettings: VideoCreationSettings | undefined;
824
- }
825
793
  /**
826
794
  * Build the `VideoDocument` a newly created project starts from: the caller's
827
- * project facts, no parts, and one empty track per lane.
795
+ * no parts and one empty track per lane. Business facts remain in Director.
828
796
  *
829
797
  * The empty lane tracks are the reason this function exists rather than callers
830
798
  * assembling a document inline. Lane tracks are otherwise minted lazily by the
@@ -845,171 +813,7 @@ interface InitialDocumentFacts {
845
813
  * supplies, and total duration is derived on read (RFC 02 §6), so a new document
846
814
  * has no timeline fact to state.
847
815
  */
848
- declare function buildInitialVideoDocument(facts: InitialDocumentFacts): VideoDocument;
849
- //#endregion
850
- //#region ../medeo-dsl/src/ids.d.ts
851
- declare const entityIdBrand: unique symbol;
852
- declare const relationIdBrand: unique symbol;
853
- type EntityId = string & {
854
- readonly [entityIdBrand]: 'EntityId';
855
- };
856
- type RelationId = string & {
857
- readonly [relationIdBrand]: 'RelationId';
858
- };
859
- //#endregion
860
- //#region ../medeo-dsl/src/json-values.d.ts
861
- type JsonPrimitive = string | number | boolean | null;
862
- type JsonValue = JsonPrimitive | JsonObject | readonly JsonValue[];
863
- type JsonObject = {
864
- readonly [key: string]: JsonValue;
865
- };
866
- //#endregion
867
- //#region ../medeo-dsl/src/entities.d.ts
868
- type KnownEntityKind = 'axvideo' | 'timeline' | 'track' | 'clip' | 'asset' | 'video' | 'audio' | 'voice' | 'image' | 'sequence-marker' | 'viewport' | 'audio-script' | 'phonetic-script' | 'caption';
869
- declare const extensionEntityKindBrand: unique symbol;
870
- type ExtensionEntityKind = string & {
871
- readonly [extensionEntityKindBrand]: 'ExtensionEntityKind';
872
- };
873
- /** Extensions require explicit branding so removed or reserved domain kinds cannot reappear accidentally. */
874
- type EntityKind = KnownEntityKind | ExtensionEntityKind;
875
- interface SequenceRange<Point = unknown> {
876
- readonly start: Point;
877
- readonly end: Point;
878
- }
879
- type SequenceDuration<Span = unknown> = {
880
- readonly mode: 'from-source';
881
- } | {
882
- readonly mode: 'fixed';
883
- readonly value: Span;
884
- };
885
- interface ScriptTextSegment {
886
- readonly segmentId: string;
887
- readonly text: string;
888
- readonly language?: string;
889
- }
890
- interface VoiceDescriptor {
891
- readonly system: 'voice-library';
892
- readonly key: string;
893
- readonly name?: string;
894
- }
895
- interface CaptionFontDescriptor {
896
- readonly system: 'font-library';
897
- readonly key: string;
898
- }
899
- interface CaptionStyleFields {
900
- readonly font?: CaptionFontDescriptor;
901
- readonly fontSize?: number;
902
- readonly fontColor?: string;
903
- readonly fontWeight?: number;
904
- readonly entranceAnimation?: string;
905
- readonly entranceAnimationDurationMs?: number;
906
- readonly strokeColor?: string;
907
- readonly strokeWidth?: number;
908
- readonly positionX?: number;
909
- readonly positionY?: number;
910
- }
911
- /**
912
- * Half-open `[start, end)` position window inside one Segment's text, counted
913
- * in Unicode code points (not UTF-16 code units), so a boundary never splits a
914
- * surrogate pair. Positions are non-negative safe integers with `start < end`;
915
- * `end` must not exceed the Segment's code-point length.
916
- */
917
- interface CaptionTextRange extends JsonObject {
918
- readonly start: number;
919
- readonly end: number;
920
- }
921
- /**
922
- * The Caption's single text selection. `segmentId` quotes the
923
- * composed AudioScript's own stable segment identity — a local id quoted by the
924
- * variant, never a peer Entity reference. Text itself is never copied here;
925
- * complete Caption content is assembled through its direct baseEntityIds.
926
- * The optional `textRange` narrows one Segment to an intra-Segment sub-span
927
- * (intra-segment re-segmentation); without it the whole Segment text is selected.
928
- */
929
- type CaptionSegmentSelection = JsonObject & {
930
- readonly segmentId: string;
931
- readonly textRange?: CaptionTextRange;
932
- };
933
- //#endregion
934
- //#region ../medeo-dsl/src/relations.d.ts
935
- 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';
936
- type RelationKind = KnownRelationKind | (string & {});
937
- type RelationTrace = JsonObject;
938
- /**
939
- * Authoritative persisted relation value.
940
- *
941
- * A kind may assign semantic roles to endpoint 0 and endpoint 1. Callers and
942
- * storage adapters must preserve the submitted positions; kinds whose
943
- * semantics are unordered simply do not interpret those positions.
944
- */
945
- interface RelationRow<K extends RelationKind = RelationKind, Metadata extends JsonObject = JsonObject> {
946
- readonly relationId: RelationId;
947
- readonly endpoint0EntityId: EntityId;
948
- readonly endpoint1EntityId: EntityId;
949
- readonly relationKind: K;
950
- readonly metadata: Metadata;
951
- readonly trace: RelationTrace;
952
- }
953
- //#endregion
954
- //#region ../medeo-dsl/src/rows.d.ts
955
- /** One persisted first-class entity. Its owned fields live directly in payload. */
956
- interface EntityRow<K extends EntityKind = EntityKind> {
957
- readonly entityId: EntityId;
958
- readonly entityKind: K;
959
- readonly payload: JsonObject;
960
- }
961
- /** Complete persistence value for an entity set and its authoritative relations. */
962
- interface EntityRelationRows {
963
- readonly entities: readonly EntityRow[];
964
- readonly relations: readonly RelationRow[];
965
- }
966
- //#endregion
967
- //#region src/document/entity-projection-values.d.ts
968
- /** A graph cannot be represented faithfully by the compatibility reader. */
969
- declare class EntityTimelineProjectionError extends Error {
970
- constructor(message: string);
971
- }
972
- //#endregion
973
- //#region src/document/entity-projection.d.ts
974
- /**
975
- * One-way compatibility view over the Entity graph. A legacy part is never
976
- * consulted as an editing fact. Peer IDs appear only in this derived read
977
- * contract, reconstructed from relations; they are not stored in payloads.
978
- */
979
- declare function projectEntityTimeline(rows: EntityRelationRows, meta: VideoDocumentMeta): VideoDocument;
980
- //#endregion
981
- //#region src/document/entity-timeline-layout.d.ts
982
- type EntityTimelineTrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
983
- interface ResolvedEntityClipPlacement {
984
- readonly clipEntityId: string;
985
- readonly markerEntityId: string;
986
- readonly contentEntityId: string;
987
- readonly trackEntityId: string;
988
- readonly start: number;
989
- readonly duration: number;
990
- readonly mode: 'sequential' | 'absolute' | 'anchored';
991
- readonly anchorClipEntityId?: string;
992
- readonly anchorOffset?: number;
993
- }
994
- interface ResolvedEntityTrack {
995
- readonly entityId: string;
996
- readonly role: EntityTimelineTrackRole;
997
- readonly order: number;
998
- readonly hidden: boolean;
999
- readonly clips: readonly ResolvedEntityClipPlacement[];
1000
- }
1001
- interface ResolvedEntityTimelineLayout {
1002
- readonly tracks: readonly ResolvedEntityTrack[];
1003
- readonly clips: ReadonlyMap<string, ResolvedEntityClipPlacement>;
1004
- /** Background music fills this duration; it never extends the timeline. */
1005
- readonly durationMs: number;
1006
- }
1007
- /**
1008
- * Resolve only entity-owned placement facts. This does not choose new anchors,
1009
- * manufacture clips, or mutate a graph while reading. Write-side operations
1010
- * must express any detach/reparent/overlap decision in their entity plan.
1011
- */
1012
- declare function resolveEntityTimelineLayout(rows: EntityRelationRows): ResolvedEntityTimelineLayout;
816
+ declare function buildInitialVideoDocument(): VideoDocument;
1013
817
  //#endregion
1014
818
  //#region src/document/validation.d.ts
1015
819
  /**
@@ -1041,29 +845,6 @@ declare function validateVideoDocument(document: unknown): VideoDocumentValidati
1041
845
  //#endregion
1042
846
  //#region src/document/mirror-schema.d.ts
1043
847
  declare const videoDocumentMirrorSchema: import("loro-mirror").RootSchemaType<{
1044
- meta: import("loro-mirror").LoroMapSchema<{
1045
- schema_version: /*elided*/any;
1046
- draft_id: /*elided*/any;
1047
- project_id: /*elided*/any;
1048
- owner_id: /*elided*/any;
1049
- thumbnail_storage_key: /*elided*/any;
1050
- chat_session_id: /*elided*/any;
1051
- video_creation_settings: /*elided*/any;
1052
- version: /*elided*/any;
1053
- }> & {
1054
- options: {};
1055
- } & {
1056
- catchall: <C extends import("loro-mirror").SchemaType>(catchallSchema: C) => import("loro-mirror").LoroMapSchemaWithCatchall<{
1057
- schema_version: /*elided*/any;
1058
- draft_id: /*elided*/any;
1059
- project_id: /*elided*/any;
1060
- owner_id: /*elided*/any;
1061
- thumbnail_storage_key: /*elided*/any;
1062
- chat_session_id: /*elided*/any;
1063
- video_creation_settings: /*elided*/any;
1064
- version: /*elided*/any;
1065
- }, C>;
1066
- };
1067
848
  timeline: import("loro-mirror").LoroMapSchema<{
1068
849
  unit_time_ms: /*elided*/any;
1069
850
  }> & {
@@ -1128,35 +909,611 @@ type TrackDraft = NonNullable<NonNullable<VideoDocumentDraft['tracks']>[number]>
1128
909
  /** A single track item in a draft. */
1129
910
  type TrackItemDraft = NonNullable<NonNullable<TrackDraft['items']>[number]>;
1130
911
  //#endregion
1131
- //#region src/editor/id-gen.d.ts
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
1132
947
  /**
1133
- * Part-id generation, aligned with the online ecosystem.
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):
1134
950
  *
1135
- * The authoritative online producers — agent-harness (`@harness/shared`
1136
- * `genObjId`) and director.v2 (`common/obj_id.py` `gen_obj_id`) — both mint part
1137
- * ids as `` `${prefix}_${ulid()}` ``, and real captured drafts use exactly that
1138
- * shape (`clip_…` / `spe_…` / `cap_…` / `bgm_…`, each a 26-char ULID). The engine
1139
- * previously emitted `vc_<base36 timestamp><6 random>`, a different prefix AND a
1140
- * different encoding — the sole cross-repo id divergence. This module removes it
1141
- * by emitting the same `<prefix>_<ULID>` bytes.
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`).
1142
955
  *
1143
- * The ULID is generated inline (Crockford Base32, 48-bit time + 80-bit random)
1144
- * rather than pulling the `ulid` npm package: the randomness class matches the
1145
- * old generator (both `Math.random`-based) and it keeps `@mengine/medeo-client`
1146
- * dependency-free for a purely mechanical id string. Part ids only need to be
1147
- * unique and lexicographically time-sortable, which this satisfies.
1148
- */
1149
- /**
1150
- * Online part-id semantic prefixes. `clip` (video clip) is the only value the
1151
- * engine currently mints (see `addVideoClips`); the rest are declared so the
1152
- * type documents the shared vocabulary and guards against reintroducing the old
1153
- * `vc`/`sp`/`cp`/`bg` names. Speech/caption/bgm ids arrive pre-minted in op
1154
- * payloads, so the engine never generates them itself.
1155
- */
1156
- type PartIdPrefix = 'clip' | 'spe' | 'cap' | 'bgm' | 'ti';
1157
- declare function generatePartId(prefix: PartIdPrefix): string;
1158
- /** Injectable part-id mint; defaults to `generatePartId` on `SemanticEditor`. */
1159
- type PartIdFactory = (prefix: PartIdPrefix) => string;
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
+ }
1160
1517
  //#endregion
1161
1518
  //#region src/editor/schema-validator.d.ts
1162
1519
  interface SnapshotReadable {
@@ -1310,15 +1667,10 @@ interface OpActor {
1310
1667
  role: 'user' | 'agent';
1311
1668
  }
1312
1669
  interface CommitOptions {
1313
- /**
1314
- * Caller-supplied intent attached to the op's audit message.
1315
- *
1316
- * Typed as `unknown` to match `TransactAudit.intent`. The wire (real
1317
- * mengine-server and the in-memory test double) only surfaces **string**
1318
- * intents onto the audit log — non-string values stay in the Loro commit
1319
- * message but parse to `null`. Agent callers should pass a string.
1320
- */
1321
- intent?: unknown;
1670
+ intent?: {
1671
+ kind: string;
1672
+ payload: unknown;
1673
+ };
1322
1674
  /** Author of this op; omitted for writes with no acting user (bootstrap, repair). */
1323
1675
  actor?: OpActor;
1324
1676
  }
@@ -1350,21 +1702,19 @@ interface TransactAudit {
1350
1702
  * position. The caller never materializes a layout (ADR 0009).
1351
1703
  */
1352
1704
  interface SemanticDocumentAdapter extends SnapshotReadable {
1353
- /** True once the document holds real content (a bootstrapped/synced snapshot). */
1354
- hasContent(): boolean;
1355
1705
  /**
1356
- * Apply one op's whole mutation in a single transaction. `edit` mutates the
1357
- * document draft; the adapter diffs the result and commits once with `audit`.
1706
+ * Apply one op's domain mutation in a single synchronous transaction. `edit`
1707
+ * must finish before returning; async callbacks/await are unsupported. The
1708
+ * adapter diffs the resulting draft and commits once with `audit`.
1358
1709
  * A throw in `edit` rolls back (the draft is discarded, Loro untouched). An
1359
- * edit that changes nothing produces no commit (no phantom audit entry).
1710
+ * edit that changes nothing produces no domain commit (no phantom undo step).
1360
1711
  */
1361
1712
  transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
1362
1713
  }
1363
1714
  declare class SemanticEditor {
1364
1715
  private readonly doc;
1365
1716
  private readonly validator;
1366
- private readonly idFactory;
1367
- constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator, idFactory?: PartIdFactory);
1717
+ constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator);
1368
1718
  moveVideoClips(input: MoveVideoClipsInput, options?: CommitOptions): Promise<void>;
1369
1719
  /**
1370
1720
  * Reorder main-track clips relative to an anchor clip, moving them as one block.
@@ -1492,6 +1842,19 @@ declare class SemanticEditor {
1492
1842
  private computeAddInsertIndex;
1493
1843
  }
1494
1844
  //#endregion
1845
+ //#region src/document/document-mutation-guard.d.ts
1846
+ /**
1847
+ * @internal
1848
+ * Shared by synchronous mutation entry points for one document. The session
1849
+ * closes it before teardown callbacks can attempt another write.
1850
+ */
1851
+ declare class DocumentMutationGuard {
1852
+ private running;
1853
+ private closed;
1854
+ run<T>(mutation: () => T): T;
1855
+ close(): void;
1856
+ }
1857
+ //#endregion
1495
1858
  //#region src/document/mirror-adapter.d.ts
1496
1859
  interface MirrorVideoDocumentOptions {
1497
1860
  peerId?: PeerID;
@@ -1507,22 +1870,23 @@ interface MirrorVideoDocumentOptions {
1507
1870
  * - `transact(edit, audit)` runs the whole op in one `mirror.setState` callback:
1508
1871
  * one diff, one `doc.commit` carrying the audit message. The callback edits an
1509
1872
  * immer draft, so a throw inside it discards the draft and never touches Loro
1510
- * (natural rollback) — no `guard` / `rollback` / `openTransaction` machinery.
1873
+ * (natural rollback) without a document checkout or compensating commit.
1511
1874
  * - mirror's `idSelector` (track items keyed by `part_id`) diffs reorders to
1512
1875
  * real Loro `move` ops on every lane, so per-item CRDT identity survives on
1513
1876
  * main and secondary tracks alike.
1514
1877
  */
1515
1878
  declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
1516
1879
  readonly doc: LoroDoc;
1880
+ private readonly mutationGuard;
1517
1881
  private readonly mirror;
1518
- constructor(doc: LoroDoc);
1882
+ private disposed;
1883
+ constructor(doc: LoroDoc, mutationGuard?: DocumentMutationGuard);
1519
1884
  snapshot(): VideoDocument;
1520
1885
  /**
1521
- * True once the doc holds real document content. A fresh mirror over an empty
1522
- * doc still reports defaulted root maps, so probe the stored `schema_version`
1523
- * (empty until a snapshot is bootstrapped or synced in).
1886
+ * Release mirror subscriptions; do not reuse this adapter afterwards.
1887
+ * The caller still owns the borrowed LoroDoc.
1524
1888
  */
1525
- hasContent(): boolean;
1889
+ dispose(): void;
1526
1890
  /**
1527
1891
  * Apply one op as a single transaction. `edit` mutates the immer draft; mirror
1528
1892
  * diffs the result and commits once with the audit `message`. A throw in `edit`
@@ -1530,72 +1894,20 @@ declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
1530
1894
  * skips the commit — matching the prior "empty op leaves no audit" behavior.
1531
1895
  */
1532
1896
  transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
1897
+ private assertActive;
1533
1898
  }
1534
1899
  /** Build a fresh Loro doc seeded with `document` through the mirror. */
1535
1900
  declare function createMirrorVideoDocument(document: VideoDocument, options?: MirrorVideoDocumentOptions): LoroDoc;
1536
1901
  /** Build a `MirrorVideoDocumentAdapter` over a fresh doc seeded with `document`. */
1537
1902
  declare function createMirrorVideoDocumentAdapter(document: VideoDocument, options?: MirrorVideoDocumentOptions): MirrorVideoDocumentAdapter;
1538
- /** Host-only replacement of a derived view, retaining the existing Loro history. */
1539
- declare function applyEntityTimelineProjection(doc: LoroDoc, projection: VideoDocument, entityRevision: number): Uint8Array;
1540
- /** Write a whole `VideoDocument` into a draft (seed a fresh doc / plain-memory state). */
1541
- declare function writeVideoDocumentToDraft(draft: VideoDocumentDraft, document: VideoDocument): void;
1542
- //#endregion
1543
- //#region src/document/plain-memory-adapter.d.ts
1544
- /**
1545
- * A `TransactAudit` widened with the ordered ids minted during that transact.
1546
- * `generated_ids` is empty when the op never called the id factory.
1547
- */
1548
- interface JournalEntry extends TransactAudit {
1549
- /** Ids produced by the adapter's id factory during this transact, in mint order. */
1550
- generated_ids: string[];
1551
- }
1552
- interface PlainMemoryAdapterOptions {
1553
- /** Underlying id mint; wrapped so each call inside a transact is journaled. */
1554
- idFactory?: PartIdFactory;
1555
- }
1556
- /**
1557
- * Pure in-memory `SemanticDocumentAdapter` — no Loro/WASM. Holds a
1558
- * `VideoDocumentDraft` object and applies each `transact` via immer `produce`,
1559
- * journaling every audit that actually mutated state (plus any ids minted
1560
- * during that transact).
1561
- *
1562
- * Known benign difference vs `MirrorVideoDocumentAdapter`: the editor's
1563
- * `setPart` assigns a fresh part object on every call, so a same-value rewrite
1564
- * produces a new immer state and IS journaled here, while the mirror's deep
1565
- * diff emits no commit. Terminal `snapshot()` stays equal; replay is idempotent.
1566
- */
1567
- declare class PlainMemoryAdapter implements SemanticDocumentAdapter {
1568
- private state;
1569
- private readonly _journal;
1570
- private readonly baseIdFactory;
1571
- /** Non-null only while a `transact` edit callback is running. */
1572
- private pendingIds;
1573
- /**
1574
- * Recording wrapper around the underlying factory. Callers (sandbox editor)
1575
- * use this so every minted id is appended to the current transact's list.
1576
- */
1577
- readonly idFactory: PartIdFactory;
1578
- constructor(document: VideoDocument, options?: PlainMemoryAdapterOptions);
1579
- get journal(): readonly JournalEntry[];
1580
- hasContent(): boolean;
1581
- snapshot(): VideoDocument;
1582
- /**
1583
- * Apply one op via immer. A throw in `edit` discards the draft (state and
1584
- * journal unchanged). When `produce` returns the same reference, there was
1585
- * no structural change — skip journal, matching mirror "no change, no commit".
1586
- */
1587
- transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
1588
- }
1589
- /** Build a `PlainMemoryAdapter` seeded with `document`. */
1590
- declare function createPlainMemoryAdapter(document: VideoDocument, options?: PlainMemoryAdapterOptions): PlainMemoryAdapter;
1591
1903
  //#endregion
1592
1904
  //#region src/document/mirror-read.d.ts
1593
1905
  /**
1594
1906
  * Project the mirror state (`VideoDocumentDraft`) into the authoritative
1595
1907
  * `VideoDocument`. The storage shape is isomorphic to the domain shape (RFC 03
1596
- * §4, reference/17 §4: meta map + a single `tracks` list + part_library), so this
1908
+ * §4, reference/17 §4: timeline + a single `tracks` list + part_library), so this
1597
1909
  * is a near-identity — it reads `time_position` / `fallback_abs_ms` JSON blobs
1598
- * back into structured values and trims empty strings, nothing more.
1910
+ * back into structured values and selects content fields. Legacy meta is ignored.
1599
1911
  *
1600
1912
  * It maps only authoritative facts (RFC 02 §6): `part_id` + `time_position`. The
1601
1913
  * projection-derived `VideoDraft` read-view (absolute time, `part_aggregations`,
@@ -1645,7 +1957,7 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
1645
1957
  id: z.ZodOptional<z.ZodString>;
1646
1958
  kind: z.ZodLiteral<"caption">;
1647
1959
  initial_duration_ms: z.ZodNumber;
1648
- speech_part_id: z.ZodOptional<z.ZodString>;
1960
+ speech_part_id: z.ZodString;
1649
1961
  text: z.ZodString;
1650
1962
  start_ms: z.ZodNumber;
1651
1963
  style: z.ZodOptional<z.ZodObject<{
@@ -1671,29 +1983,16 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
1671
1983
  }, z.core.$loose>;
1672
1984
  }, z.core.$loose>]>;
1673
1985
  declare const videoDocumentSchema: z.ZodObject<{
1674
- meta: z.ZodObject<{
1675
- schema_version: z.ZodEnum<{
1676
- "video-document/v0": "video-document/v0";
1677
- "video-document/entity-projection-v1": "video-document/entity-projection-v1";
1678
- }>;
1679
- draft_id: z.ZodOptional<z.ZodString>;
1680
- project_id: z.ZodOptional<z.ZodString>;
1681
- owner_id: z.ZodOptional<z.ZodString>;
1682
- thumbnail_storage_key: z.ZodOptional<z.ZodString>;
1683
- chat_session_id: z.ZodOptional<z.ZodString>;
1684
- video_creation_settings: z.ZodOptional<z.ZodUnknown>;
1685
- version: z.ZodOptional<z.ZodNumber>;
1686
- }, z.core.$loose>;
1687
1986
  timeline: z.ZodOptional<z.ZodObject<{
1688
1987
  unit_time_ms: z.ZodOptional<z.ZodNumber>;
1689
1988
  }, z.core.$loose>>;
1690
1989
  tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
1691
1990
  id: z.ZodOptional<z.ZodString>;
1692
1991
  parts_kind: z.ZodOptional<z.ZodEnum<{
1693
- video_clip: "video_clip";
1694
- speech: "speech";
1695
- caption: "caption";
1696
1992
  bgm: "bgm";
1993
+ caption: "caption";
1994
+ speech: "speech";
1995
+ video_clip: "video_clip";
1697
1996
  }>>;
1698
1997
  is_hidden: z.ZodOptional<z.ZodBoolean>;
1699
1998
  items: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1748,7 +2047,7 @@ declare const videoDocumentSchema: z.ZodObject<{
1748
2047
  id: z.ZodOptional<z.ZodString>;
1749
2048
  kind: z.ZodLiteral<"caption">;
1750
2049
  initial_duration_ms: z.ZodNumber;
1751
- speech_part_id: z.ZodOptional<z.ZodString>;
2050
+ speech_part_id: z.ZodString;
1752
2051
  text: z.ZodString;
1753
2052
  start_ms: z.ZodNumber;
1754
2053
  style: z.ZodOptional<z.ZodObject<{
@@ -1775,4 +2074,4 @@ declare const videoDocumentSchema: z.ZodObject<{
1775
2074
  }, z.core.$loose>]>>>;
1776
2075
  }, z.core.$loose>;
1777
2076
  //#endregion
1778
- export { SequenceRange as $, generatePartId as A, VideoDraft as At, ResolvedEntityClipPlacement as B, Track$1 as Bt, PlannedSemanticOpKind as C, TrackItemTimePosition as Ct, SnapshotReadable as D, VideoDocumentSchemaVersion as Dt, SchemaValidator as E, VideoDocument as Et, videoDocumentMirrorSchema as F, CaptionPart$1 as Ft, EntityTimelineProjectionError as G, ResolvedEntityTrack as H, VideoDocumentValidationError as I, CaptionStyle as It, RelationRow as J, EntityRelationRows as K, assertValidVideoDocument as L, PartAggregation as Lt, TrackItemDraft as M, effectiveVideoClipDurationMs as Mt, VideoDocumentDraft as N, speedOf as Nt, ValidationError as O, VideoDocumentValidationIssue as Ot, VideoDocumentMirrorSchema as P, Attachment as Pt, SequenceDuration as Q, validateVideoDocument as R, SpeedShift as Rt, ImplementedSemanticOpKind as S, TrackItem as St, isImplementedSemanticOpKind as T, VideoClipPart as Tt, resolveEntityTimelineLayout as U, ResolvedEntityTimelineLayout as V, TrackItem$1 as Vt, projectEntityTimeline as W, CaptionStyleFields as X, CaptionSegmentSelection as Y, ScriptTextSegment as Z, SemanticEditor as _, PartKind as _t, PlainMemoryAdapter as a, buildInitialVideoDocument as at, TransactAudit as b, Timeline as bt, MirrorVideoDocumentAdapter as c, buildSpeechHostMap as ct, createMirrorVideoDocument as d, toVideoDocument as dt, VoiceDescriptor as et, createMirrorVideoDocumentAdapter as f, BgmPart as ft, SemanticDocumentAdapter as g, ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION as gt, OpActor as h, DEFAULT_UNIT_TIME_MS as ht, JournalEntry as i, InitialDocumentFacts as it, TrackDraft as j, VideoDraftPartUnion as jt, PartIdFactory as k, VideoDocumentValidationIssueCode as kt, MirrorVideoDocumentOptions as l, derivePositionFromAbs as lt, CommitOptions as m, CaptionPart as mt, videoDocumentSchema as n, JsonValue as nt, PlainMemoryAdapterOptions as o, DerivedItemPosition as ot, writeVideoDocumentToDraft as p, CaptionDisplayCue as pt, EntityRow as q, readVideoDocumentFromDraft as r, EntityId as rt, createPlainMemoryAdapter as s, SpeechHostMap as st, partUnionSchema as t, JsonObject as tt, applyEntityTimelineProjection as u, fromVideoDocument as ut, SemanticOpInput as v, PartUnion as vt, SemanticOpKind as w, VIDEO_DOCUMENT_SCHEMA_VERSION as wt, IMPLEMENTED_SEMANTIC_OP_KINDS as x, Track as xt, SemanticOpName as y, SpeechPart as yt, EntityTimelineTrackRole as z, Timeline$1 as zt };
2077
+ export { VideoDraft as $, assertValidVideoDocument as A, CaptionPart as B, index_d_exports as C, VideoDocumentMirrorSchema as D, VideoDocumentDraft as E, buildSpeechHostMap as F, Timeline as G, PartKind as H, derivePositionFromAbs as I, TrackItemTimePosition as J, Track as K, fromVideoDocument as L, buildInitialVideoDocument as M, DerivedItemPosition as N, videoDocumentMirrorSchema as O, SpeechHostMap as P, VideoDocumentValidationIssueCode as Q, toVideoDocument as R, ValidationError as S, TrackItemDraft as T, PartUnion as U, DEFAULT_UNIT_TIME_MS as V, SpeechPart as W, VideoDocument as X, VideoClipPart as Y, VideoDocumentValidationIssue as Z, PlannedSemanticOpKind as _, MirrorVideoDocumentOptions as a, PartAggregation as at, SchemaValidator as b, CommitOptions as c, Track$1 as ct, SemanticEditor as d, VideoDraftContent as et, SemanticOpInput as f, ImplementedSemanticOpKind as g, IMPLEMENTED_SEMANTIC_OP_KINDS as h, MirrorVideoDocumentAdapter as i, CaptionStyle as it, validateVideoDocument as j, VideoDocumentValidationError as k, OpActor as l, TrackItem$1 as lt, TransactAudit as m, videoDocumentSchema as n, Attachment as nt, createMirrorVideoDocument as o, SpeedShift as ot, SemanticOpName as p, TrackItem as q, readVideoDocumentFromDraft as r, CaptionPart$1 as rt, createMirrorVideoDocumentAdapter as s, Timeline$1 as st, partUnionSchema as t, VideoDraftPartUnion as tt, SemanticDocumentAdapter as u, SemanticOpKind as v, TrackDraft as w, SnapshotReadable as x, isImplementedSemanticOpKind as y, BgmPart as z };