@mengine/medeo-client 1.3.1-alpha.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -100
- package/dist/document-DKPAavs9.js +1709 -0
- package/dist/{index-BUkDsU7c.d.ts → index-CX7IXsnp.d.ts} +655 -304
- package/dist/index.d.ts +95 -539
- package/dist/index.js +864 -2631
- package/dist/{loro-relay-doc-ssdYpuef.js → loro-relay-doc-cJSY-uau.js} +7 -2
- package/dist/relay.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -41
- package/package.json +8 -12
- package/dist/document-BLYcbv8E.js +0 -3623
- package/dist/index-CMa6ZCtX.d.ts +0 -609
- package/dist/schemas.d.ts +0 -2
- package/dist/schemas.js +0 -482
- package/dist/shared-iWnU2osE.js +0 -39
|
@@ -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:
|
|
34
|
-
readonly CAPTION:
|
|
35
|
-
readonly SPEECH:
|
|
36
|
-
readonly 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:
|
|
149
|
-
readonly RATIO_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:
|
|
161
|
-
readonly AI_VIDEOS:
|
|
162
|
-
readonly MY_UPLOADED_ASSETS:
|
|
163
|
-
readonly 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:
|
|
256
|
+
readonly CURVE: 'curve';
|
|
258
257
|
/**
|
|
259
258
|
* Constant speed multiplier across the entire clip
|
|
260
259
|
*/
|
|
261
|
-
readonly LINEAR:
|
|
260
|
+
readonly LINEAR: 'linear';
|
|
262
261
|
};
|
|
263
262
|
/**
|
|
264
263
|
* @public
|
|
@@ -442,10 +441,8 @@ interface VideoDraft$1 {
|
|
|
442
441
|
}
|
|
443
442
|
//#endregion
|
|
444
443
|
//#region src/document/types.d.ts
|
|
445
|
-
declare const VIDEO_DOCUMENT_SCHEMA_VERSION:
|
|
446
|
-
|
|
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
|
+
declare const VIDEO_DOCUMENT_SCHEMA_VERSION: 'video-document/v0';
|
|
445
|
+
type VideoDocumentSchemaVersion = typeof VIDEO_DOCUMENT_SCHEMA_VERSION;
|
|
449
446
|
type PartKind = 'video_clip' | 'speech' | 'caption' | 'bgm';
|
|
450
447
|
/**
|
|
451
448
|
* Project-level creation settings. Mirrors the IDL, but keeps the two fields the
|
|
@@ -487,11 +484,7 @@ type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
|
|
|
487
484
|
*
|
|
488
485
|
* `speech_part_id` / `start_ms` are kept as resource-intrinsic facts (which
|
|
489
486
|
* speech it was split from, and its offset in that source) — reference/17
|
|
490
|
-
* principle 4.
|
|
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.
|
|
487
|
+
* principle 4.
|
|
495
488
|
*/
|
|
496
489
|
type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
|
|
497
490
|
initial_duration_ms?: number | undefined;
|
|
@@ -559,19 +552,6 @@ interface Track {
|
|
|
559
552
|
is_hidden: boolean | undefined;
|
|
560
553
|
items: TrackItem[] | undefined;
|
|
561
554
|
}
|
|
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;
|
|
575
555
|
/**
|
|
576
556
|
* Authoritative part union: a flat discriminated union over the four part kinds.
|
|
577
557
|
* Deliberately *not* the IDL's namespace union (no `$unknown` / `visit`): engine
|
|
@@ -678,7 +658,6 @@ interface VideoDocumentMeta {
|
|
|
678
658
|
thumbnail_storage_key: VideoDraft['thumbnail_storage_key'];
|
|
679
659
|
chat_session_id: VideoDraft['chat_session_id'];
|
|
680
660
|
video_creation_settings: VideoDraft['video_creation_settings'];
|
|
681
|
-
/** Legacy imported version for v0; committed Entity revision for entity-projection-v1. */
|
|
682
661
|
version: VideoDraft['version'];
|
|
683
662
|
}
|
|
684
663
|
/**
|
|
@@ -839,170 +818,6 @@ interface InitialDocumentFacts {
|
|
|
839
818
|
*/
|
|
840
819
|
declare function buildInitialVideoDocument(facts: InitialDocumentFacts): VideoDocument;
|
|
841
820
|
//#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;
|
|
1005
|
-
//#endregion
|
|
1006
821
|
//#region src/document/validation.d.ts
|
|
1007
822
|
/**
|
|
1008
823
|
* Business-level schema guard for `VideoDocument` (RFC 03 §9). It is the gate
|
|
@@ -1120,35 +935,611 @@ type TrackDraft = NonNullable<NonNullable<VideoDocumentDraft['tracks']>[number]>
|
|
|
1120
935
|
/** A single track item in a draft. */
|
|
1121
936
|
type TrackItemDraft = NonNullable<NonNullable<TrackDraft['items']>[number]>;
|
|
1122
937
|
//#endregion
|
|
1123
|
-
//#region src/editor/
|
|
938
|
+
//#region src/editor/schemas/add-speeches.d.ts
|
|
939
|
+
/**
|
|
940
|
+
* Add speeches (and their captions). TTS runs upstream; the stable speech /
|
|
941
|
+
* caption parts arrive materialized (see `speech-assets.ts`). The op writes the
|
|
942
|
+
* parts and each speech's `{ mode:'anchored', anchorPartId, offsetMs }` fact
|
|
943
|
+
* verbatim — no write-time host-picking, no cascade (RFC 02 §4). The projection
|
|
944
|
+
* derives absolute positions on read.
|
|
945
|
+
*/
|
|
946
|
+
declare const addSpeechesInputSchema: z.ZodObject<{
|
|
947
|
+
speeches: z.ZodArray<z.ZodObject<{
|
|
948
|
+
speech_id: z.ZodString;
|
|
949
|
+
anchor_part_id: z.ZodString;
|
|
950
|
+
offset_ms: z.ZodNumber;
|
|
951
|
+
audio_storage_key: z.ZodString;
|
|
952
|
+
duration_ms: z.ZodNumber;
|
|
953
|
+
audio_script: z.ZodString;
|
|
954
|
+
volume: z.ZodNumber;
|
|
955
|
+
voice: z.ZodObject<{
|
|
956
|
+
id: z.ZodString;
|
|
957
|
+
name: z.ZodString;
|
|
958
|
+
}, z.core.$strip>;
|
|
959
|
+
origin_speech_id: z.ZodString;
|
|
960
|
+
caption_ids: z.ZodArray<z.ZodString>;
|
|
961
|
+
}, z.core.$strip>>;
|
|
962
|
+
captions: z.ZodArray<z.ZodObject<{
|
|
963
|
+
caption_id: z.ZodString;
|
|
964
|
+
speech_part_id: z.ZodString;
|
|
965
|
+
text: z.ZodString;
|
|
966
|
+
start_ms: z.ZodNumber;
|
|
967
|
+
duration_ms: z.ZodNumber;
|
|
968
|
+
}, z.core.$strip>>;
|
|
969
|
+
}, z.core.$strip>;
|
|
970
|
+
type AddSpeechesInput = z.infer<typeof addSpeechesInputSchema>;
|
|
971
|
+
//#endregion
|
|
972
|
+
//#region src/editor/schemas/add-video-clips.d.ts
|
|
1124
973
|
/**
|
|
1125
|
-
*
|
|
974
|
+
* Add video clips to a track. Each clip's duration facts are separated so a
|
|
975
|
+
* single number is never overloaded (RFC 02 / `reference/16` §0b):
|
|
1126
976
|
*
|
|
1127
|
-
*
|
|
1128
|
-
*
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
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.
|
|
977
|
+
* - `media_duration_ms` is the source media's intrinsic full length (a resource
|
|
978
|
+
* fact, written to the part);
|
|
979
|
+
* - `play_in` / `play_out` are the optional trim window into that media; when
|
|
980
|
+
* omitted the whole media is used (`play_in=0`, `play_out=media_duration_ms`).
|
|
1134
981
|
*
|
|
1135
|
-
* The
|
|
1136
|
-
*
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
982
|
+
* The clip's effective timeline duration is derived by the projection from the
|
|
983
|
+
* trim window and `speed_shift` — it is never an input here.
|
|
984
|
+
*/
|
|
985
|
+
declare const addVideoClipsInputSchema: z.ZodObject<{
|
|
986
|
+
clips: z.ZodArray<z.ZodObject<{
|
|
987
|
+
media_id: z.ZodString;
|
|
988
|
+
start_ms: z.ZodOptional<z.ZodNumber>;
|
|
989
|
+
media_duration_ms: z.ZodNumber;
|
|
990
|
+
play_in: z.ZodOptional<z.ZodNumber>;
|
|
991
|
+
play_out: z.ZodOptional<z.ZodNumber>;
|
|
992
|
+
track_id: z.ZodOptional<z.ZodString>;
|
|
993
|
+
}, z.core.$strip>>;
|
|
994
|
+
before_clip_id: z.ZodOptional<z.ZodString>;
|
|
995
|
+
after_clip_id: z.ZodOptional<z.ZodString>;
|
|
996
|
+
}, z.core.$strip>;
|
|
997
|
+
type AddVideoClipsInput = z.infer<typeof addVideoClipsInputSchema>;
|
|
998
|
+
//#endregion
|
|
999
|
+
//#region src/editor/schemas/adjust-bgm-volume.d.ts
|
|
1000
|
+
declare const adjustBgmVolumeInputSchema: z.ZodObject<{
|
|
1001
|
+
bgm: z.ZodArray<z.ZodObject<{
|
|
1002
|
+
bgm_id: z.ZodString;
|
|
1003
|
+
volume: z.ZodNumber;
|
|
1004
|
+
}, z.core.$strip>>;
|
|
1005
|
+
}, z.core.$strip>;
|
|
1006
|
+
type AdjustBgmVolumeInput = z.infer<typeof adjustBgmVolumeInputSchema>;
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region src/editor/schemas/adjust-speech-volume.d.ts
|
|
1009
|
+
declare const adjustSpeechVolumeInputSchema: z.ZodObject<{
|
|
1010
|
+
speeches: z.ZodArray<z.ZodObject<{
|
|
1011
|
+
speech_id: z.ZodString;
|
|
1012
|
+
volume: z.ZodNumber;
|
|
1013
|
+
}, z.core.$strip>>;
|
|
1014
|
+
}, z.core.$strip>;
|
|
1015
|
+
type AdjustSpeechVolumeInput = z.infer<typeof adjustSpeechVolumeInputSchema>;
|
|
1016
|
+
//#endregion
|
|
1017
|
+
//#region src/editor/schemas/adjust-video-clip-duration.d.ts
|
|
1018
|
+
/**
|
|
1019
|
+
* Re-trim existing video clips (the user-facing "adjust duration" gesture is a
|
|
1020
|
+
* trim of the source window). The new `play_in` / `play_out` are the facts; the
|
|
1021
|
+
* effective timeline duration is derived from them and the clip's `speed_shift`,
|
|
1022
|
+
* and the change reflows downstream clips, speeches, and the timeline inside the
|
|
1023
|
+
* op's transaction (no caller-materialized cascade).
|
|
1024
|
+
*/
|
|
1025
|
+
declare const adjustVideoClipDurationInputSchema: z.ZodObject<{
|
|
1026
|
+
clips: z.ZodArray<z.ZodObject<{
|
|
1027
|
+
clip_id: z.ZodString;
|
|
1028
|
+
play_in: z.ZodNumber;
|
|
1029
|
+
play_out: z.ZodNumber;
|
|
1030
|
+
}, z.core.$strip>>;
|
|
1031
|
+
}, z.core.$strip>;
|
|
1032
|
+
type AdjustVideoClipDurationInput = z.infer<typeof adjustVideoClipDurationInputSchema>;
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region src/editor/schemas/adjust-video-clip-volume.d.ts
|
|
1035
|
+
declare const adjustVideoClipVolumeInputSchema: z.ZodObject<{
|
|
1036
|
+
clips: z.ZodArray<z.ZodObject<{
|
|
1037
|
+
clip_id: z.ZodString;
|
|
1038
|
+
volume: z.ZodNumber;
|
|
1039
|
+
}, z.core.$strip>>;
|
|
1040
|
+
}, z.core.$strip>;
|
|
1041
|
+
type AdjustVideoClipVolumeInput = z.infer<typeof adjustVideoClipVolumeInputSchema>;
|
|
1042
|
+
//#endregion
|
|
1043
|
+
//#region src/editor/schemas/change-speech.d.ts
|
|
1044
|
+
/**
|
|
1045
|
+
* Change a speech's script or voice. Both re-run TTS upstream and return the
|
|
1046
|
+
* regenerated speech / caption parts in the same materialized shape as
|
|
1047
|
+
* `AddSpeeches` (`speech-assets.ts`); the op upserts them by id (the speech part
|
|
1048
|
+
* id is preserved across a re-TTS), re-seats at `start_ms`, and reflows. Old
|
|
1049
|
+
* caption parts no longer owned by the speech are removed via `caption_ids`.
|
|
1050
|
+
*/
|
|
1051
|
+
declare const changeSpeechScriptInputSchema: z.ZodObject<{
|
|
1052
|
+
speeches: z.ZodArray<z.ZodObject<{
|
|
1053
|
+
speech_id: z.ZodString;
|
|
1054
|
+
anchor_part_id: z.ZodString;
|
|
1055
|
+
offset_ms: z.ZodNumber;
|
|
1056
|
+
audio_storage_key: z.ZodString;
|
|
1057
|
+
duration_ms: z.ZodNumber;
|
|
1058
|
+
audio_script: z.ZodString;
|
|
1059
|
+
volume: z.ZodNumber;
|
|
1060
|
+
voice: z.ZodObject<{
|
|
1061
|
+
id: z.ZodString;
|
|
1062
|
+
name: z.ZodString;
|
|
1063
|
+
}, z.core.$strip>;
|
|
1064
|
+
origin_speech_id: z.ZodString;
|
|
1065
|
+
caption_ids: z.ZodArray<z.ZodString>;
|
|
1066
|
+
}, z.core.$strip>>;
|
|
1067
|
+
captions: z.ZodArray<z.ZodObject<{
|
|
1068
|
+
caption_id: z.ZodString;
|
|
1069
|
+
speech_part_id: z.ZodString;
|
|
1070
|
+
text: z.ZodString;
|
|
1071
|
+
start_ms: z.ZodNumber;
|
|
1072
|
+
duration_ms: z.ZodNumber;
|
|
1073
|
+
}, z.core.$strip>>;
|
|
1074
|
+
}, z.core.$strip>;
|
|
1075
|
+
declare const changeSpeechVoiceInputSchema: z.ZodObject<{
|
|
1076
|
+
speeches: z.ZodArray<z.ZodObject<{
|
|
1077
|
+
speech_id: z.ZodString;
|
|
1078
|
+
anchor_part_id: z.ZodString;
|
|
1079
|
+
offset_ms: z.ZodNumber;
|
|
1080
|
+
audio_storage_key: z.ZodString;
|
|
1081
|
+
duration_ms: z.ZodNumber;
|
|
1082
|
+
audio_script: z.ZodString;
|
|
1083
|
+
volume: z.ZodNumber;
|
|
1084
|
+
voice: z.ZodObject<{
|
|
1085
|
+
id: z.ZodString;
|
|
1086
|
+
name: z.ZodString;
|
|
1087
|
+
}, z.core.$strip>;
|
|
1088
|
+
origin_speech_id: z.ZodString;
|
|
1089
|
+
caption_ids: z.ZodArray<z.ZodString>;
|
|
1090
|
+
}, z.core.$strip>>;
|
|
1091
|
+
captions: z.ZodArray<z.ZodObject<{
|
|
1092
|
+
caption_id: z.ZodString;
|
|
1093
|
+
speech_part_id: z.ZodString;
|
|
1094
|
+
text: z.ZodString;
|
|
1095
|
+
start_ms: z.ZodNumber;
|
|
1096
|
+
duration_ms: z.ZodNumber;
|
|
1097
|
+
}, z.core.$strip>>;
|
|
1098
|
+
}, z.core.$strip>;
|
|
1099
|
+
type ChangeSpeechScriptInput = z.infer<typeof changeSpeechScriptInputSchema>;
|
|
1100
|
+
type ChangeSpeechVoiceInput = z.infer<typeof changeSpeechVoiceInputSchema>;
|
|
1101
|
+
//#endregion
|
|
1102
|
+
//#region src/editor/schemas/delete-bgm.d.ts
|
|
1103
|
+
/**
|
|
1104
|
+
* Remove the document BGM. Pure document edit: clears the bgm lane and removes
|
|
1105
|
+
* the bgm part. Takes no input (a document holds at most one bgm); an empty
|
|
1106
|
+
* object keeps the op signature uniform with the rest.
|
|
1107
|
+
*/
|
|
1108
|
+
declare const deleteBgmInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
1109
|
+
type DeleteBgmInput = z.infer<typeof deleteBgmInputSchema>;
|
|
1110
|
+
//#endregion
|
|
1111
|
+
//#region src/editor/schemas/delete-speeches.d.ts
|
|
1112
|
+
/**
|
|
1113
|
+
* Delete speeches with their captions. Pure document edit (no side effect): the
|
|
1114
|
+
* op removes each speech part, cascade-deletes the captions it owns (via
|
|
1115
|
+
* `caption_ids` / `speech_part_id`), drops their track items, and reflows.
|
|
1116
|
+
*/
|
|
1117
|
+
declare const deleteSpeechesInputSchema: z.ZodObject<{
|
|
1118
|
+
speech_ids: z.ZodArray<z.ZodString>;
|
|
1119
|
+
}, z.core.$strip>;
|
|
1120
|
+
type DeleteSpeechesInput = z.infer<typeof deleteSpeechesInputSchema>;
|
|
1121
|
+
//#endregion
|
|
1122
|
+
//#region src/editor/schemas/delete-video-clips.d.ts
|
|
1123
|
+
/**
|
|
1124
|
+
* How a delete handles the anchored subtree (speeches anchored to a deleted clip,
|
|
1125
|
+
* and their captions) — a delete-op policy, not a data-model field (reference/17
|
|
1126
|
+
* §6). `cascade` (default) removes the subtree; `detach` keeps the direct
|
|
1127
|
+
* anchored children, re-pinning them to `absolute` so they stay on the timeline.
|
|
1128
|
+
*/
|
|
1129
|
+
declare const anchoredDeletePolicySchema: z.ZodEnum<{
|
|
1130
|
+
cascade: "cascade";
|
|
1131
|
+
detach: "detach";
|
|
1132
|
+
}>;
|
|
1133
|
+
type AnchoredDeletePolicy = z.infer<typeof anchoredDeletePolicySchema>;
|
|
1134
|
+
declare const deleteVideoClipsInputSchema: z.ZodObject<{
|
|
1135
|
+
clip_ids: z.ZodArray<z.ZodString>;
|
|
1136
|
+
on_anchored: z.ZodOptional<z.ZodEnum<{
|
|
1137
|
+
cascade: "cascade";
|
|
1138
|
+
detach: "detach";
|
|
1139
|
+
}>>;
|
|
1140
|
+
}, z.core.$strip>;
|
|
1141
|
+
type DeleteVideoClipsInput = z.infer<typeof deleteVideoClipsInputSchema>;
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region src/editor/schemas/move-speeches.d.ts
|
|
1144
|
+
/**
|
|
1145
|
+
* Move speeches in time. Pure document edit: the op re-seats each speech at its
|
|
1146
|
+
* new absolute `start_ms`; the cascade reassigns it to the host video clip,
|
|
1147
|
+
* resolves overlaps, and reflows. Captions follow their speech.
|
|
1148
|
+
*/
|
|
1149
|
+
declare const moveSpeechesInputSchema: z.ZodObject<{
|
|
1150
|
+
speeches: z.ZodArray<z.ZodObject<{
|
|
1151
|
+
speech_id: z.ZodString;
|
|
1152
|
+
new_start_ms: z.ZodNumber;
|
|
1153
|
+
}, z.core.$strip>>;
|
|
1154
|
+
}, z.core.$strip>;
|
|
1155
|
+
type MoveSpeechesInput = z.infer<typeof moveSpeechesInputSchema>;
|
|
1156
|
+
//#endregion
|
|
1157
|
+
//#region src/editor/schemas/move-video-clips-by-anchor.d.ts
|
|
1158
|
+
/**
|
|
1159
|
+
* Where the moved block lands on the main track.
|
|
1160
|
+
*
|
|
1161
|
+
* A discriminated union rather than two optional `before_clip_id` /
|
|
1162
|
+
* `after_clip_id` fields (the shape `addVideoClips` had to use, because there the
|
|
1163
|
+
* two modes share a whole clip description): here the alternatives carry nothing
|
|
1164
|
+
* in common, so making them mutually exclusive *by type* removes three runtime
|
|
1165
|
+
* `superRefine` checks that would otherwise have to be written and tested.
|
|
1166
|
+
*
|
|
1167
|
+
* `track_start` is an explicit member, not the absence of an anchor. The
|
|
1168
|
+
* agent-harness mutation this maps from treats "neither anchor given" as
|
|
1169
|
+
* "move to the front" (`applyBatchMoveVideoClips` falls back to `insertIndex = 0`),
|
|
1170
|
+
* which is a default buried in a tool description. Requiring the caller to name
|
|
1171
|
+
* that intent keeps a forgotten field from silently reordering the timeline.
|
|
1172
|
+
*/
|
|
1173
|
+
declare const moveAnchorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1174
|
+
position: z.ZodLiteral<"before">;
|
|
1175
|
+
clip_id: z.ZodString;
|
|
1176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1177
|
+
position: z.ZodLiteral<"after">;
|
|
1178
|
+
clip_id: z.ZodString;
|
|
1179
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1180
|
+
position: z.ZodLiteral<"track_start">;
|
|
1181
|
+
}, z.core.$strip>], "position">;
|
|
1182
|
+
/**
|
|
1183
|
+
* What happens to the speeches anchored to the clips being moved.
|
|
1184
|
+
*
|
|
1185
|
+
* - `follow` keeps each speech anchored where it is, so it travels with its clip
|
|
1186
|
+
* to the new position. In the anchored model this is the *no-op* branch: a
|
|
1187
|
+
* speech's authoritative fact is `{ anchorPartId, offsetMs }` and its absolute
|
|
1188
|
+
* time is derived on read from the host's position, so moving the host moves
|
|
1189
|
+
* the speech with no write to the speech at all.
|
|
1190
|
+
* - `keep_absolute` preserves each speech's current absolute landing instead, then
|
|
1191
|
+
* re-anchors it to whichever clip now covers that time (RFC 02 §9.1/§11.1). This
|
|
1192
|
+
* is the branch that costs an extra pass, and the one the FE timeline uses.
|
|
1193
|
+
*
|
|
1194
|
+
* **Required, with no default**, matching `deleteVideoClips` and
|
|
1195
|
+
* `replaceVideoClipSequence`. The two branches decide which picture the user's
|
|
1196
|
+
* narration ends up over, which is too consequential to infer from a missing
|
|
1197
|
+
* field — and neither branch is "safe enough" to be the implicit one.
|
|
1198
|
+
*/
|
|
1199
|
+
declare const movedClipAnchoredPolicySchema: z.ZodEnum<{
|
|
1200
|
+
follow: "follow";
|
|
1201
|
+
keep_absolute: "keep_absolute";
|
|
1202
|
+
}>;
|
|
1203
|
+
/**
|
|
1204
|
+
* Reorder a set of main-track clips relative to a reference clip.
|
|
1205
|
+
*
|
|
1206
|
+
* Distinct from `moveVideoClips`, which positions clips by absolute time
|
|
1207
|
+
* (`new_start_ms`) and is what the FE timeline dispatches after a drag. Main-track
|
|
1208
|
+
* clips are `sequential`-positioned, so absolute time is not authoritative state
|
|
1209
|
+
* there (RFC 02 §4/§7): `moveVideoClips` has to *guess* an index back out of the
|
|
1210
|
+
* time it was handed, whereas an anchor already is the ordinal fact being changed.
|
|
1211
|
+
* Keeping them separate also isolates blast radius — this method can diverge on
|
|
1212
|
+
* speech policy without touching the FE path.
|
|
1213
|
+
*
|
|
1214
|
+
* `clip_ids` need not be contiguous. They move as one block, keeping their
|
|
1215
|
+
* relative order, which is the agent-harness `batch_move_video_clips` contract.
|
|
1216
|
+
*/
|
|
1217
|
+
declare const moveVideoClipsByAnchorInputSchema: z.ZodObject<{
|
|
1218
|
+
clip_ids: z.ZodArray<z.ZodString>;
|
|
1219
|
+
anchor: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1220
|
+
position: z.ZodLiteral<"before">;
|
|
1221
|
+
clip_id: z.ZodString;
|
|
1222
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1223
|
+
position: z.ZodLiteral<"after">;
|
|
1224
|
+
clip_id: z.ZodString;
|
|
1225
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1226
|
+
position: z.ZodLiteral<"track_start">;
|
|
1227
|
+
}, z.core.$strip>], "position">;
|
|
1228
|
+
on_anchored: z.ZodEnum<{
|
|
1229
|
+
follow: "follow";
|
|
1230
|
+
keep_absolute: "keep_absolute";
|
|
1231
|
+
}>;
|
|
1232
|
+
}, z.core.$strip>;
|
|
1233
|
+
type MoveAnchor = z.infer<typeof moveAnchorSchema>;
|
|
1234
|
+
type MovedClipAnchoredPolicy = z.infer<typeof movedClipAnchoredPolicySchema>;
|
|
1235
|
+
type MoveVideoClipsByAnchorInput = z.infer<typeof moveVideoClipsByAnchorInputSchema>;
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region src/editor/schemas/move-video-clips.d.ts
|
|
1238
|
+
declare const moveVideoClipsInputSchema: z.ZodObject<{
|
|
1239
|
+
clips: z.ZodArray<z.ZodObject<{
|
|
1240
|
+
clip_id: z.ZodString;
|
|
1241
|
+
new_start_ms: z.ZodNumber;
|
|
1242
|
+
new_track_id: z.ZodOptional<z.ZodString>;
|
|
1243
|
+
}, z.core.$strip>>;
|
|
1244
|
+
}, z.core.$strip>;
|
|
1245
|
+
type MoveVideoClipsInput = z.infer<typeof moveVideoClipsInputSchema>;
|
|
1246
|
+
//#endregion
|
|
1247
|
+
//#region src/editor/schemas/replace-video-clip-content.d.ts
|
|
1248
|
+
/**
|
|
1249
|
+
* Replace the media backing existing video clips. The media import runs upstream
|
|
1250
|
+
* (Director); its stable result — the new media id, intrinsic length, and the
|
|
1251
|
+
* reset trim window — arrives materialized (see
|
|
1252
|
+
* `results/phase-4-side-effect-payload-contract.md` §4). Director resets
|
|
1253
|
+
* `play_in=0` / `play_out=media_duration_ms` and clears `speed_shift` on
|
|
1254
|
+
* replacement. The clip `part_id`s (hence their track items) are unchanged; the
|
|
1255
|
+
* editor reflows the main track from the new effective durations.
|
|
1256
|
+
*/
|
|
1257
|
+
declare const replaceVideoClipContentInputSchema: z.ZodObject<{
|
|
1258
|
+
clips: z.ZodArray<z.ZodObject<{
|
|
1259
|
+
clip_id: z.ZodString;
|
|
1260
|
+
origin_media_id: z.ZodString;
|
|
1261
|
+
media_duration_ms: z.ZodNumber;
|
|
1262
|
+
play_in: z.ZodNumber;
|
|
1263
|
+
play_out: z.ZodNumber;
|
|
1264
|
+
volume: z.ZodNumber;
|
|
1265
|
+
}, z.core.$strip>>;
|
|
1266
|
+
}, z.core.$strip>;
|
|
1267
|
+
type ReplaceVideoClipContentInput = z.infer<typeof replaceVideoClipContentInputSchema>;
|
|
1268
|
+
//#endregion
|
|
1269
|
+
//#region src/editor/schemas/replace-video-clip-sequence.d.ts
|
|
1270
|
+
/**
|
|
1271
|
+
* What happens to the speeches anchored to the clips being replaced.
|
|
1272
|
+
*
|
|
1273
|
+
* - `remap` re-anchors each surviving speech to the new clip in the SAME POSITION
|
|
1274
|
+
* of the sequence, keeping its offset — old[i]'s children become new[i]'s
|
|
1275
|
+
* children. An old clip with no counterpart (fewer new clips than old) has its
|
|
1276
|
+
* subtree deleted, because there is nothing left to anchor to.
|
|
1277
|
+
* - `cascade` deletes every anchored speech (and its captions) outright, like
|
|
1278
|
+
* `deleteVideoClips`.
|
|
1279
|
+
*
|
|
1280
|
+
* **Required, with no default.** The two branches differ in whether the user's
|
|
1281
|
+
* narration survives, and the agent tool that drives this op makes its
|
|
1282
|
+
* `preserve_speeches` flag required for that reason. A default here would let a
|
|
1283
|
+
* caller that forgot the field silently delete speech.
|
|
1284
|
+
*/
|
|
1285
|
+
declare const anchoredReplacePolicySchema: z.ZodEnum<{
|
|
1286
|
+
cascade: "cascade";
|
|
1287
|
+
remap: "remap";
|
|
1288
|
+
}>;
|
|
1289
|
+
type AnchoredReplacePolicy = z.infer<typeof anchoredReplacePolicySchema>;
|
|
1290
|
+
/**
|
|
1291
|
+
* Replace a contiguous run of main-track clips with a new run.
|
|
1292
|
+
*
|
|
1293
|
+
* A composite of delete + insert that cannot be expressed as the two ops in
|
|
1294
|
+
* sequence, because the anchored speeches have to survive *across* the swap: with
|
|
1295
|
+
* `remap` they are re-anchored positionally, which needs both the old and the new
|
|
1296
|
+
* ids in the same transaction (ADR 0009 — the cascade stays in the editor, callers
|
|
1297
|
+
* never re-wire anchors themselves).
|
|
1298
|
+
*
|
|
1299
|
+
* Duration facts follow `addVideoClips`: `media_duration_ms` is the source's
|
|
1300
|
+
* intrinsic length and the trim window defaults to the whole media. The effective
|
|
1301
|
+
* timeline duration is derived by the projection, never an input.
|
|
1302
|
+
*
|
|
1303
|
+
* `media_id` is optional: omitting it creates a **deliberate empty placeholder
|
|
1304
|
+
* clip** (`origin_media_id: ''`) — structure with no picture. This is the only op
|
|
1305
|
+
* that can produce one, and it is authoritative state, unlike the gap fillers the
|
|
1306
|
+
* read-side solve mints (which never enter the document).
|
|
1307
|
+
*/
|
|
1308
|
+
declare const replaceVideoClipSequenceInputSchema: z.ZodObject<{
|
|
1309
|
+
old_clip_ids: z.ZodArray<z.ZodString>;
|
|
1310
|
+
new_clips: z.ZodArray<z.ZodObject<{
|
|
1311
|
+
media_id: z.ZodOptional<z.ZodString>;
|
|
1312
|
+
media_duration_ms: z.ZodNumber;
|
|
1313
|
+
play_in: z.ZodOptional<z.ZodNumber>;
|
|
1314
|
+
play_out: z.ZodOptional<z.ZodNumber>;
|
|
1315
|
+
}, z.core.$strip>>;
|
|
1316
|
+
on_anchored: z.ZodEnum<{
|
|
1317
|
+
cascade: "cascade";
|
|
1318
|
+
remap: "remap";
|
|
1319
|
+
}>;
|
|
1320
|
+
}, z.core.$strip>;
|
|
1321
|
+
type ReplaceVideoClipSequenceInput = z.infer<typeof replaceVideoClipSequenceInputSchema>;
|
|
1322
|
+
//#endregion
|
|
1323
|
+
//#region src/editor/schemas/set-bgm.d.ts
|
|
1324
|
+
/**
|
|
1325
|
+
* Set the document BGM. The media's stable result (storage key) arrives
|
|
1326
|
+
* materialized from upstream (see
|
|
1327
|
+
* `results/phase-4-side-effect-payload-contract.md` §3). The op upserts the bgm
|
|
1328
|
+
* part and seats it on the bgm lane; its effective length is always the whole
|
|
1329
|
+
* timeline, derived by the projection on read — so there is no `duration_ms`
|
|
1330
|
+
* input or fact (RFC 02 / `reference/16` §0b). A `bgm_id` lets the op replace an
|
|
1331
|
+
* existing bgm part by id.
|
|
1332
|
+
*/
|
|
1333
|
+
declare const setBgmInputSchema: z.ZodObject<{
|
|
1334
|
+
bgm_id: z.ZodString;
|
|
1335
|
+
audio_storage_key: z.ZodString;
|
|
1336
|
+
origin_media_id: z.ZodString;
|
|
1337
|
+
volume: z.ZodNumber;
|
|
1338
|
+
}, z.core.$strip>;
|
|
1339
|
+
type SetBgmInput = z.infer<typeof setBgmInputSchema>;
|
|
1340
|
+
//#endregion
|
|
1341
|
+
//#region src/editor/schemas/set-caption-style.d.ts
|
|
1342
|
+
/**
|
|
1343
|
+
* Set the caption visual style. GLOBAL by design: the style applies to every
|
|
1344
|
+
* caption part in the document — it carries NO `caption_id`. This mirrors the FE,
|
|
1345
|
+
* whose caption-style store (`caption-style.ts:persistCaptionStylePatch`) iterates
|
|
1346
|
+
* ALL captions and writes the same normalized style to each; the product has a
|
|
1347
|
+
* single document-wide caption style, not per-caption styling.
|
|
1348
|
+
*
|
|
1349
|
+
* Every field is optional and maps to a `CaptionStyle` attribute (snake_case
|
|
1350
|
+
* IDL). A field present in the input is written to every caption; a field ABSENT
|
|
1351
|
+
* from the input is left untouched on each caption (the editor merges the patch
|
|
1352
|
+
* onto each caption's existing style — this is a value edit, not a full-style
|
|
1353
|
+
* replace, so a partial patch such as "recolor only" does not wipe font size).
|
|
1354
|
+
*
|
|
1355
|
+
* Pure document edit, no cascade — captions keep their positions; only the style
|
|
1356
|
+
* sub-map of each caption part changes.
|
|
1357
|
+
*/
|
|
1358
|
+
declare const setCaptionStyleInputSchema: z.ZodObject<{
|
|
1359
|
+
font_id: z.ZodOptional<z.ZodString>;
|
|
1360
|
+
font_size: z.ZodOptional<z.ZodNumber>;
|
|
1361
|
+
font_color: z.ZodOptional<z.ZodString>;
|
|
1362
|
+
font_weight: z.ZodOptional<z.ZodNumber>;
|
|
1363
|
+
entrance_animation: z.ZodOptional<z.ZodString>;
|
|
1364
|
+
entrance_animation_duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
1365
|
+
stroke_color: z.ZodOptional<z.ZodString>;
|
|
1366
|
+
stroke_width: z.ZodOptional<z.ZodNumber>;
|
|
1367
|
+
position_x: z.ZodOptional<z.ZodNumber>;
|
|
1368
|
+
position_y: z.ZodOptional<z.ZodNumber>;
|
|
1369
|
+
}, z.core.$strip>;
|
|
1370
|
+
type SetCaptionStyleInput = z.infer<typeof setCaptionStyleInputSchema>;
|
|
1371
|
+
//#endregion
|
|
1372
|
+
//#region src/editor/schemas/set-caption-visibility.d.ts
|
|
1373
|
+
/**
|
|
1374
|
+
* Toggle caption visibility (the caption track's `is_hidden` flag). Pure
|
|
1375
|
+
* document edit, no cascade — captions keep their positions; only the lane's
|
|
1376
|
+
* hidden flag changes.
|
|
1377
|
+
*/
|
|
1378
|
+
declare const setCaptionVisibilityInputSchema: z.ZodObject<{
|
|
1379
|
+
is_hidden: z.ZodBoolean;
|
|
1380
|
+
}, z.core.$strip>;
|
|
1381
|
+
type SetCaptionVisibilityInput = z.infer<typeof setCaptionVisibilityInputSchema>;
|
|
1382
|
+
//#endregion
|
|
1383
|
+
//#region src/editor/schemas/set-video-clip-speed-shift.d.ts
|
|
1384
|
+
/**
|
|
1385
|
+
* Set the playback speed of existing video clips. Per the speed-shift decision
|
|
1386
|
+
* (`reference/16` §0): the op writes only the `speed_shift` fact — it does NOT
|
|
1387
|
+
* store an effective `duration_ms` (projection derives it from the trim window /
|
|
1388
|
+
* speed) and does NOT scale anchored speeches' relative offsets (offsets stay
|
|
1389
|
+
* put; the cascade reflows absolute positions). A `null` speed_shift clears the
|
|
1390
|
+
* speed back to original (1×).
|
|
1391
|
+
*/
|
|
1392
|
+
declare const setVideoClipSpeedShiftInputSchema: z.ZodObject<{
|
|
1393
|
+
clips: z.ZodArray<z.ZodObject<{
|
|
1394
|
+
clip_id: z.ZodString;
|
|
1395
|
+
speed_shift: z.ZodNullable<z.ZodObject<{
|
|
1396
|
+
category: z.ZodEnum<{
|
|
1397
|
+
curve: "curve";
|
|
1398
|
+
linear: "linear";
|
|
1399
|
+
}>;
|
|
1400
|
+
mode: z.ZodString;
|
|
1401
|
+
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
1402
|
+
linear: z.ZodObject<{
|
|
1403
|
+
speed: z.ZodNumber;
|
|
1404
|
+
}, z.core.$strip>;
|
|
1405
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1406
|
+
curve: z.ZodObject<{
|
|
1407
|
+
keyframes: z.ZodArray<z.ZodObject<{
|
|
1408
|
+
position: z.ZodNumber;
|
|
1409
|
+
rate: z.ZodNumber;
|
|
1410
|
+
in_tangent: z.ZodOptional<z.ZodObject<{
|
|
1411
|
+
x: z.ZodNumber;
|
|
1412
|
+
y: z.ZodNumber;
|
|
1413
|
+
}, z.core.$strip>>;
|
|
1414
|
+
out_tangent: z.ZodOptional<z.ZodObject<{
|
|
1415
|
+
x: z.ZodNumber;
|
|
1416
|
+
y: z.ZodNumber;
|
|
1417
|
+
}, z.core.$strip>>;
|
|
1418
|
+
}, z.core.$strip>>;
|
|
1419
|
+
}, z.core.$strip>;
|
|
1420
|
+
}, z.core.$strip>]>;
|
|
1421
|
+
}, z.core.$strip>>;
|
|
1422
|
+
}, z.core.$strip>>;
|
|
1423
|
+
}, z.core.$strip>;
|
|
1424
|
+
type SetVideoClipSpeedShiftInput = z.infer<typeof setVideoClipSpeedShiftInputSchema>;
|
|
1425
|
+
//#endregion
|
|
1426
|
+
//#region src/editor/schemas/shared.d.ts
|
|
1427
|
+
declare const clipIdSchema: z.ZodString;
|
|
1428
|
+
declare const clipIdsSchema: z.ZodArray<z.ZodString>;
|
|
1429
|
+
declare const mediaIdSchema: z.ZodString;
|
|
1430
|
+
declare const speechIdSchema: z.ZodString;
|
|
1431
|
+
declare const timelineMsSchema: z.ZodNumber;
|
|
1432
|
+
declare const positiveMsSchema: z.ZodNumber;
|
|
1433
|
+
declare const volumeSchema: z.ZodNumber;
|
|
1434
|
+
declare const speechIdsSchema: z.ZodArray<z.ZodString>;
|
|
1435
|
+
/**
|
|
1436
|
+
* A clip's playback-speed fact, the only thing `SetVideoClipSpeedShift` writes.
|
|
1437
|
+
* Mirrors the IDL `SpeedShift`: `category` is `linear` | `curve`, and `config`
|
|
1438
|
+
* is a discriminated union — `{ linear: { speed } }` for a constant multiplier
|
|
1439
|
+
* (the multiplier projection reads at `config.linear.speed`) or `{ curve: {
|
|
1440
|
+
* keyframes } }` for a Bezier-controlled variable speed (RFC 02 / `reference/16`
|
|
1441
|
+
* §0). Exactly one of `linear` / `curve` is present.
|
|
1442
|
+
*/
|
|
1443
|
+
declare const speedShiftSchema: z.ZodObject<{
|
|
1444
|
+
category: z.ZodEnum<{
|
|
1445
|
+
curve: "curve";
|
|
1446
|
+
linear: "linear";
|
|
1447
|
+
}>;
|
|
1448
|
+
mode: z.ZodString;
|
|
1449
|
+
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
1450
|
+
linear: z.ZodObject<{
|
|
1451
|
+
speed: z.ZodNumber;
|
|
1452
|
+
}, z.core.$strip>;
|
|
1453
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1454
|
+
curve: z.ZodObject<{
|
|
1455
|
+
keyframes: z.ZodArray<z.ZodObject<{
|
|
1456
|
+
position: z.ZodNumber;
|
|
1457
|
+
rate: z.ZodNumber;
|
|
1458
|
+
in_tangent: z.ZodOptional<z.ZodObject<{
|
|
1459
|
+
x: z.ZodNumber;
|
|
1460
|
+
y: z.ZodNumber;
|
|
1461
|
+
}, z.core.$strip>>;
|
|
1462
|
+
out_tangent: z.ZodOptional<z.ZodObject<{
|
|
1463
|
+
x: z.ZodNumber;
|
|
1464
|
+
y: z.ZodNumber;
|
|
1465
|
+
}, z.core.$strip>>;
|
|
1466
|
+
}, z.core.$strip>>;
|
|
1467
|
+
}, z.core.$strip>;
|
|
1468
|
+
}, z.core.$strip>]>;
|
|
1469
|
+
}, z.core.$strip>;
|
|
1470
|
+
declare const voiceSchema: z.ZodObject<{
|
|
1471
|
+
id: z.ZodString;
|
|
1472
|
+
name: z.ZodString;
|
|
1473
|
+
}, z.core.$strip>;
|
|
1474
|
+
//#endregion
|
|
1475
|
+
//#region src/editor/schemas/speech-assets.d.ts
|
|
1476
|
+
/**
|
|
1477
|
+
* The materialized TTS result shared by `AddSpeeches` / `ChangeSpeechScript` /
|
|
1478
|
+
* `ChangeSpeechVoice` (see `results/phase-4-side-effect-payload-contract.md`
|
|
1479
|
+
* §1/§2). The side effect (TTS/ASR + billing) runs upstream; the op receives the
|
|
1480
|
+
* stable speech + caption parts and writes them as authoritative facts. No
|
|
1481
|
+
* cascade runs on write — the projection derives absolute positions on read.
|
|
1482
|
+
*
|
|
1483
|
+
* Each speech carries the anchoring fact directly (RFC 02 §4): the host video
|
|
1484
|
+
* clip `anchor_part_id` and the `offset_ms` within it. The upstream caller
|
|
1485
|
+
* already knows which clip a speech attaches to, so the op writes
|
|
1486
|
+
* `{ mode:'anchored', anchorPartId, offsetMs }` verbatim — no write-time
|
|
1487
|
+
* host-picking. Captions anchor to their speech via the caption part's
|
|
1488
|
+
* `start_ms` (offset within the speech).
|
|
1489
|
+
*/
|
|
1490
|
+
declare const speechAssetSchema: z.ZodObject<{
|
|
1491
|
+
speech_id: z.ZodString;
|
|
1492
|
+
anchor_part_id: z.ZodString;
|
|
1493
|
+
offset_ms: z.ZodNumber;
|
|
1494
|
+
audio_storage_key: z.ZodString;
|
|
1495
|
+
duration_ms: z.ZodNumber;
|
|
1496
|
+
audio_script: z.ZodString;
|
|
1497
|
+
volume: z.ZodNumber;
|
|
1498
|
+
voice: z.ZodObject<{
|
|
1499
|
+
id: z.ZodString;
|
|
1500
|
+
name: z.ZodString;
|
|
1501
|
+
}, z.core.$strip>;
|
|
1502
|
+
origin_speech_id: z.ZodString;
|
|
1503
|
+
caption_ids: z.ZodArray<z.ZodString>;
|
|
1504
|
+
}, z.core.$strip>;
|
|
1505
|
+
declare const captionAssetSchema: z.ZodObject<{
|
|
1506
|
+
caption_id: z.ZodString;
|
|
1507
|
+
speech_part_id: z.ZodString;
|
|
1508
|
+
text: z.ZodString;
|
|
1509
|
+
start_ms: z.ZodNumber;
|
|
1510
|
+
duration_ms: z.ZodNumber;
|
|
1511
|
+
}, z.core.$strip>;
|
|
1512
|
+
/** A materialized speech-subtree write (speeches + their captions). */
|
|
1513
|
+
declare const speechAssetsSchema: z.ZodObject<{
|
|
1514
|
+
speeches: z.ZodArray<z.ZodObject<{
|
|
1515
|
+
speech_id: z.ZodString;
|
|
1516
|
+
anchor_part_id: z.ZodString;
|
|
1517
|
+
offset_ms: z.ZodNumber;
|
|
1518
|
+
audio_storage_key: z.ZodString;
|
|
1519
|
+
duration_ms: z.ZodNumber;
|
|
1520
|
+
audio_script: z.ZodString;
|
|
1521
|
+
volume: z.ZodNumber;
|
|
1522
|
+
voice: z.ZodObject<{
|
|
1523
|
+
id: z.ZodString;
|
|
1524
|
+
name: z.ZodString;
|
|
1525
|
+
}, z.core.$strip>;
|
|
1526
|
+
origin_speech_id: z.ZodString;
|
|
1527
|
+
caption_ids: z.ZodArray<z.ZodString>;
|
|
1528
|
+
}, z.core.$strip>>;
|
|
1529
|
+
captions: z.ZodArray<z.ZodObject<{
|
|
1530
|
+
caption_id: z.ZodString;
|
|
1531
|
+
speech_part_id: z.ZodString;
|
|
1532
|
+
text: z.ZodString;
|
|
1533
|
+
start_ms: z.ZodNumber;
|
|
1534
|
+
duration_ms: z.ZodNumber;
|
|
1535
|
+
}, z.core.$strip>>;
|
|
1536
|
+
}, z.core.$strip>;
|
|
1537
|
+
type SpeechAsset = z.infer<typeof speechAssetSchema>;
|
|
1538
|
+
type CaptionAsset = z.infer<typeof captionAssetSchema>;
|
|
1539
|
+
type SpeechAssets = z.infer<typeof speechAssetsSchema>;
|
|
1540
|
+
declare namespace index_d_exports {
|
|
1541
|
+
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 };
|
|
1542
|
+
}
|
|
1152
1543
|
//#endregion
|
|
1153
1544
|
//#region src/editor/schema-validator.d.ts
|
|
1154
1545
|
interface SnapshotReadable {
|
|
@@ -1302,15 +1693,10 @@ interface OpActor {
|
|
|
1302
1693
|
role: 'user' | 'agent';
|
|
1303
1694
|
}
|
|
1304
1695
|
interface CommitOptions {
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
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;
|
|
1696
|
+
intent?: {
|
|
1697
|
+
kind: string;
|
|
1698
|
+
payload: unknown;
|
|
1699
|
+
};
|
|
1314
1700
|
/** Author of this op; omitted for writes with no acting user (bootstrap, repair). */
|
|
1315
1701
|
actor?: OpActor;
|
|
1316
1702
|
}
|
|
@@ -1345,18 +1731,18 @@ interface SemanticDocumentAdapter extends SnapshotReadable {
|
|
|
1345
1731
|
/** True once the document holds real content (a bootstrapped/synced snapshot). */
|
|
1346
1732
|
hasContent(): boolean;
|
|
1347
1733
|
/**
|
|
1348
|
-
* Apply one op's
|
|
1349
|
-
*
|
|
1734
|
+
* Apply one op's domain mutation in a single synchronous transaction. `edit`
|
|
1735
|
+
* must finish before returning; async callbacks/await are unsupported. The
|
|
1736
|
+
* adapter diffs the resulting draft and commits once with `audit`.
|
|
1350
1737
|
* A throw in `edit` rolls back (the draft is discarded, Loro untouched). An
|
|
1351
|
-
* edit that changes nothing produces no commit (no phantom
|
|
1738
|
+
* edit that changes nothing produces no domain commit (no phantom undo step).
|
|
1352
1739
|
*/
|
|
1353
1740
|
transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
|
|
1354
1741
|
}
|
|
1355
1742
|
declare class SemanticEditor {
|
|
1356
1743
|
private readonly doc;
|
|
1357
1744
|
private readonly validator;
|
|
1358
|
-
|
|
1359
|
-
constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator, idFactory?: PartIdFactory);
|
|
1745
|
+
constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator);
|
|
1360
1746
|
moveVideoClips(input: MoveVideoClipsInput, options?: CommitOptions): Promise<void>;
|
|
1361
1747
|
/**
|
|
1362
1748
|
* Reorder main-track clips relative to an anchor clip, moving them as one block.
|
|
@@ -1484,6 +1870,19 @@ declare class SemanticEditor {
|
|
|
1484
1870
|
private computeAddInsertIndex;
|
|
1485
1871
|
}
|
|
1486
1872
|
//#endregion
|
|
1873
|
+
//#region src/document/document-mutation-guard.d.ts
|
|
1874
|
+
/**
|
|
1875
|
+
* @internal
|
|
1876
|
+
* Shared by synchronous mutation entry points for one document. The session
|
|
1877
|
+
* closes it before teardown callbacks can attempt another write.
|
|
1878
|
+
*/
|
|
1879
|
+
declare class DocumentMutationGuard {
|
|
1880
|
+
private running;
|
|
1881
|
+
private closed;
|
|
1882
|
+
run<T>(mutation: () => T): T;
|
|
1883
|
+
close(): void;
|
|
1884
|
+
}
|
|
1885
|
+
//#endregion
|
|
1487
1886
|
//#region src/document/mirror-adapter.d.ts
|
|
1488
1887
|
interface MirrorVideoDocumentOptions {
|
|
1489
1888
|
peerId?: PeerID;
|
|
@@ -1499,16 +1898,23 @@ interface MirrorVideoDocumentOptions {
|
|
|
1499
1898
|
* - `transact(edit, audit)` runs the whole op in one `mirror.setState` callback:
|
|
1500
1899
|
* one diff, one `doc.commit` carrying the audit message. The callback edits an
|
|
1501
1900
|
* immer draft, so a throw inside it discards the draft and never touches Loro
|
|
1502
|
-
* (natural rollback)
|
|
1901
|
+
* (natural rollback) without a document checkout or compensating commit.
|
|
1503
1902
|
* - mirror's `idSelector` (track items keyed by `part_id`) diffs reorders to
|
|
1504
1903
|
* real Loro `move` ops on every lane, so per-item CRDT identity survives on
|
|
1505
1904
|
* main and secondary tracks alike.
|
|
1506
1905
|
*/
|
|
1507
1906
|
declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
|
|
1508
1907
|
readonly doc: LoroDoc;
|
|
1908
|
+
private readonly mutationGuard;
|
|
1509
1909
|
private readonly mirror;
|
|
1510
|
-
|
|
1910
|
+
private disposed;
|
|
1911
|
+
constructor(doc: LoroDoc, mutationGuard?: DocumentMutationGuard);
|
|
1511
1912
|
snapshot(): VideoDocument;
|
|
1913
|
+
/**
|
|
1914
|
+
* Release mirror subscriptions; do not reuse this adapter afterwards.
|
|
1915
|
+
* The caller still owns the borrowed LoroDoc.
|
|
1916
|
+
*/
|
|
1917
|
+
dispose(): void;
|
|
1512
1918
|
/**
|
|
1513
1919
|
* True once the doc holds real document content. A fresh mirror over an empty
|
|
1514
1920
|
* doc still reports defaulted root maps, so probe the stored `schema_version`
|
|
@@ -1522,64 +1928,12 @@ declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
|
|
|
1522
1928
|
* skips the commit — matching the prior "empty op leaves no audit" behavior.
|
|
1523
1929
|
*/
|
|
1524
1930
|
transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
|
|
1931
|
+
private assertActive;
|
|
1525
1932
|
}
|
|
1526
1933
|
/** Build a fresh Loro doc seeded with `document` through the mirror. */
|
|
1527
1934
|
declare function createMirrorVideoDocument(document: VideoDocument, options?: MirrorVideoDocumentOptions): LoroDoc;
|
|
1528
1935
|
/** Build a `MirrorVideoDocumentAdapter` over a fresh doc seeded with `document`. */
|
|
1529
1936
|
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;
|
|
1583
1937
|
//#endregion
|
|
1584
1938
|
//#region src/document/mirror-read.d.ts
|
|
1585
1939
|
/**
|
|
@@ -1637,7 +1991,7 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1637
1991
|
id: z.ZodOptional<z.ZodString>;
|
|
1638
1992
|
kind: z.ZodLiteral<"caption">;
|
|
1639
1993
|
initial_duration_ms: z.ZodNumber;
|
|
1640
|
-
speech_part_id: z.
|
|
1994
|
+
speech_part_id: z.ZodString;
|
|
1641
1995
|
text: z.ZodString;
|
|
1642
1996
|
start_ms: z.ZodNumber;
|
|
1643
1997
|
style: z.ZodOptional<z.ZodObject<{
|
|
@@ -1664,10 +2018,7 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1664
2018
|
}, z.core.$loose>]>;
|
|
1665
2019
|
declare const videoDocumentSchema: z.ZodObject<{
|
|
1666
2020
|
meta: z.ZodObject<{
|
|
1667
|
-
schema_version: z.
|
|
1668
|
-
"video-document/v0": "video-document/v0";
|
|
1669
|
-
"video-document/entity-projection-v1": "video-document/entity-projection-v1";
|
|
1670
|
-
}>;
|
|
2021
|
+
schema_version: z.ZodLiteral<"video-document/v0">;
|
|
1671
2022
|
draft_id: z.ZodOptional<z.ZodString>;
|
|
1672
2023
|
project_id: z.ZodOptional<z.ZodString>;
|
|
1673
2024
|
owner_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1682,9 +2033,9 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
1682
2033
|
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1683
2034
|
id: z.ZodOptional<z.ZodString>;
|
|
1684
2035
|
parts_kind: z.ZodOptional<z.ZodEnum<{
|
|
1685
|
-
speech: "speech";
|
|
1686
|
-
caption: "caption";
|
|
1687
2036
|
bgm: "bgm";
|
|
2037
|
+
caption: "caption";
|
|
2038
|
+
speech: "speech";
|
|
1688
2039
|
video_clip: "video_clip";
|
|
1689
2040
|
}>>;
|
|
1690
2041
|
is_hidden: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1740,7 +2091,7 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
1740
2091
|
id: z.ZodOptional<z.ZodString>;
|
|
1741
2092
|
kind: z.ZodLiteral<"caption">;
|
|
1742
2093
|
initial_duration_ms: z.ZodNumber;
|
|
1743
|
-
speech_part_id: z.
|
|
2094
|
+
speech_part_id: z.ZodString;
|
|
1744
2095
|
text: z.ZodString;
|
|
1745
2096
|
start_ms: z.ZodNumber;
|
|
1746
2097
|
style: z.ZodOptional<z.ZodObject<{
|
|
@@ -1767,4 +2118,4 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
1767
2118
|
}, z.core.$loose>]>>>;
|
|
1768
2119
|
}, z.core.$loose>;
|
|
1769
2120
|
//#endregion
|
|
1770
|
-
export {
|
|
2121
|
+
export { VideoDocumentSchemaVersion as $, assertValidVideoDocument as A, BgmPart as B, index_d_exports as C, VideoDocumentMirrorSchema as D, VideoDocumentDraft as E, SpeechHostMap as F, SpeechPart as G, DEFAULT_UNIT_TIME_MS as H, buildSpeechHostMap as I, TrackItem as J, Timeline as K, derivePositionFromAbs as L, InitialDocumentFacts as M, buildInitialVideoDocument as N, videoDocumentMirrorSchema as O, DerivedItemPosition as P, VideoDocument as Q, fromVideoDocument as R, ValidationError as S, TrackItemDraft as T, PartKind as U, CaptionPart as V, PartUnion as W, VIDEO_DOCUMENT_SCHEMA_VERSION as X, TrackItemTimePosition as Y, VideoClipPart as Z, PlannedSemanticOpKind as _, MirrorVideoDocumentOptions as a, CaptionPart$1 as at, SchemaValidator as b, CommitOptions as c, SpeedShift as ct, SemanticEditor as d, TrackItem$1 as dt, VideoDocumentValidationIssue as et, SemanticOpInput as f, ImplementedSemanticOpKind as g, IMPLEMENTED_SEMANTIC_OP_KINDS as h, MirrorVideoDocumentAdapter as i, Attachment as it, validateVideoDocument as j, VideoDocumentValidationError as k, OpActor as l, Timeline$1 as lt, TransactAudit as m, videoDocumentSchema as n, VideoDraft as nt, createMirrorVideoDocument as o, CaptionStyle as ot, SemanticOpName as p, Track as q, readVideoDocumentFromDraft as r, VideoDraftPartUnion as rt, createMirrorVideoDocumentAdapter as s, PartAggregation as st, partUnionSchema as t, VideoDocumentValidationIssueCode as tt, SemanticDocumentAdapter as u, Track$1 as ut, SemanticOpKind as v, TrackDraft as w, SnapshotReadable as x, isImplementedSemanticOpKind as y, toVideoDocument as z };
|