@mengine/medeo-client 1.2.1-alpha.5 → 1.2.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{document-ClBRZtLn.js → document-49OdvviW.js} +140 -100
- package/dist/{index-DpD_SncO.d.ts → index-BO2fSUKi.d.ts} +113 -635
- package/dist/index-InEWX9rk.d.ts +609 -0
- package/dist/index.d.ts +40 -36
- package/dist/index.js +165 -683
- package/dist/schemas.d.ts +2 -0
- package/dist/schemas.js +518 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +40 -1
- package/package.json +7 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A as MoveVideoClipsInput, J as ChangeSpeechScriptInput, K as DeleteBgmInput, N as MoveVideoClipsByAnchorInput, O as ReplaceVideoClipContentInput, Q as AdjustVideoClipVolumeInput, R as MoveSpeechesInput, S as SetBgmInput, T as ReplaceVideoClipSequenceInput, V as DeleteVideoClipsInput, W as DeleteSpeechesInput, Y as ChangeSpeechVoiceInput, b as SetCaptionStyleInput, ct as AddSpeechesInput, et as AdjustVideoClipDurationInput, g as SetVideoClipSpeedShiftInput, it as AdjustBgmVolumeInput, nt as AdjustSpeechVolumeInput, ot as AddVideoClipsInput, v as SetCaptionVisibilityInput } from "./index-InEWX9rk.js";
|
|
1
2
|
import { InferInputType } from "loro-mirror";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { LoroDoc, PeerID } from "loro-crdt";
|
|
@@ -545,8 +546,6 @@ interface TrackItem {
|
|
|
545
546
|
part_id: string;
|
|
546
547
|
time_position: TrackItemTimePosition;
|
|
547
548
|
fallback_abs_ms?: number | undefined;
|
|
548
|
-
/** Presentation window for this placement; currently used by caption resize. */
|
|
549
|
-
duration_override_ms?: number | undefined;
|
|
550
549
|
}
|
|
551
550
|
interface Track {
|
|
552
551
|
id: string | undefined;
|
|
@@ -554,6 +553,19 @@ interface Track {
|
|
|
554
553
|
is_hidden: boolean | undefined;
|
|
555
554
|
items: TrackItem[] | undefined;
|
|
556
555
|
}
|
|
556
|
+
/** The linear speed multiplier of a `speed_shift`, defaulting to 1 (original). */
|
|
557
|
+
declare function speedOf(speedShift: SpeedShift | undefined): number;
|
|
558
|
+
/**
|
|
559
|
+
* A video clip's effective timeline duration, derived from authoritative facts
|
|
560
|
+
* (RFC 02, `reference/16` §4, reference/17 §5): the trim window
|
|
561
|
+
* `play_out - play_in` divided by the speed multiplier, rounded to integer ms.
|
|
562
|
+
* `play_in` / `play_out` are optional in the IDL but every write path sets them
|
|
563
|
+
* (defaulting to the whole media), and the legacy-ingest projection backfills the
|
|
564
|
+
* window from a legacy `duration_ms` — so an authoritative clip always carries a
|
|
565
|
+
* trim window and there is no stored `duration_ms` to fall back to. A clip with
|
|
566
|
+
* neither bound yields 0. Speeds the clip up (>1× → shorter) or down (<1×).
|
|
567
|
+
*/
|
|
568
|
+
declare function effectiveVideoClipDurationMs(clip: VideoClipPart): number;
|
|
557
569
|
/**
|
|
558
570
|
* Authoritative part union: a flat discriminated union over the four part kinds.
|
|
559
571
|
* Deliberately *not* the IDL's namespace union (no `$unknown` / `visit`): engine
|
|
@@ -937,623 +949,35 @@ type TrackDraft = NonNullable<NonNullable<VideoDocumentDraft['tracks']>[number]>
|
|
|
937
949
|
/** A single track item in a draft. */
|
|
938
950
|
type TrackItemDraft = NonNullable<NonNullable<TrackDraft['items']>[number]>;
|
|
939
951
|
//#endregion
|
|
940
|
-
//#region src/editor/
|
|
941
|
-
/**
|
|
942
|
-
* Add speeches (and their captions). TTS runs upstream; the stable speech /
|
|
943
|
-
* caption parts arrive materialized (see `speech-assets.ts`). The op writes the
|
|
944
|
-
* parts and each speech's `{ mode:'anchored', anchorPartId, offsetMs }` fact
|
|
945
|
-
* verbatim — no write-time host-picking, no cascade (RFC 02 §4). The projection
|
|
946
|
-
* derives absolute positions on read.
|
|
947
|
-
*/
|
|
948
|
-
declare const addSpeechesInputSchema: z.ZodObject<{
|
|
949
|
-
speeches: z.ZodArray<z.ZodObject<{
|
|
950
|
-
speech_id: z.ZodString;
|
|
951
|
-
anchor_part_id: z.ZodNullable<z.ZodString>;
|
|
952
|
-
offset_ms: z.ZodNumber;
|
|
953
|
-
audio_storage_key: z.ZodString;
|
|
954
|
-
duration_ms: z.ZodNumber;
|
|
955
|
-
audio_script: z.ZodString;
|
|
956
|
-
volume: z.ZodNumber;
|
|
957
|
-
voice: z.ZodObject<{
|
|
958
|
-
id: z.ZodString;
|
|
959
|
-
name: z.ZodString;
|
|
960
|
-
}, z.core.$strip>;
|
|
961
|
-
origin_speech_id: z.ZodString;
|
|
962
|
-
caption_ids: z.ZodArray<z.ZodString>;
|
|
963
|
-
}, z.core.$strip>>;
|
|
964
|
-
captions: z.ZodArray<z.ZodObject<{
|
|
965
|
-
caption_id: z.ZodString;
|
|
966
|
-
speech_part_id: z.ZodString;
|
|
967
|
-
text: z.ZodString;
|
|
968
|
-
start_ms: z.ZodNumber;
|
|
969
|
-
duration_ms: z.ZodNumber;
|
|
970
|
-
}, z.core.$strip>>;
|
|
971
|
-
}, z.core.$strip>;
|
|
972
|
-
type AddSpeechesInput = z.infer<typeof addSpeechesInputSchema>;
|
|
973
|
-
//#endregion
|
|
974
|
-
//#region src/editor/schemas/add-video-clips.d.ts
|
|
952
|
+
//#region src/editor/id-gen.d.ts
|
|
975
953
|
/**
|
|
976
|
-
*
|
|
977
|
-
* single number is never overloaded (RFC 02 / `reference/16` §0b):
|
|
954
|
+
* Part-id generation, aligned with the online ecosystem.
|
|
978
955
|
*
|
|
979
|
-
*
|
|
980
|
-
*
|
|
981
|
-
*
|
|
982
|
-
*
|
|
956
|
+
* The authoritative online producers — agent-harness (`@harness/shared`
|
|
957
|
+
* `genObjId`) and director.v2 (`common/obj_id.py` `gen_obj_id`) — both mint part
|
|
958
|
+
* ids as `` `${prefix}_${ulid()}` ``, and real captured drafts use exactly that
|
|
959
|
+
* shape (`clip_…` / `spe_…` / `cap_…` / `bgm_…`, each a 26-char ULID). The engine
|
|
960
|
+
* previously emitted `vc_<base36 timestamp><6 random>`, a different prefix AND a
|
|
961
|
+
* different encoding — the sole cross-repo id divergence. This module removes it
|
|
962
|
+
* by emitting the same `<prefix>_<ULID>` bytes.
|
|
983
963
|
*
|
|
984
|
-
* The
|
|
985
|
-
*
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
//#region src/editor/schemas/adjust-bgm-volume.d.ts
|
|
1002
|
-
declare const adjustBgmVolumeInputSchema: z.ZodObject<{
|
|
1003
|
-
bgm: z.ZodArray<z.ZodObject<{
|
|
1004
|
-
bgm_id: z.ZodString;
|
|
1005
|
-
volume: z.ZodNumber;
|
|
1006
|
-
}, z.core.$strip>>;
|
|
1007
|
-
}, z.core.$strip>;
|
|
1008
|
-
type AdjustBgmVolumeInput = z.infer<typeof adjustBgmVolumeInputSchema>;
|
|
1009
|
-
//#endregion
|
|
1010
|
-
//#region src/editor/schemas/adjust-speech-volume.d.ts
|
|
1011
|
-
declare const adjustSpeechVolumeInputSchema: z.ZodObject<{
|
|
1012
|
-
speeches: z.ZodArray<z.ZodObject<{
|
|
1013
|
-
speech_id: z.ZodString;
|
|
1014
|
-
volume: z.ZodNumber;
|
|
1015
|
-
}, z.core.$strip>>;
|
|
1016
|
-
}, z.core.$strip>;
|
|
1017
|
-
type AdjustSpeechVolumeInput = z.infer<typeof adjustSpeechVolumeInputSchema>;
|
|
1018
|
-
//#endregion
|
|
1019
|
-
//#region src/editor/schemas/adjust-video-clip-duration.d.ts
|
|
1020
|
-
/**
|
|
1021
|
-
* Re-trim existing video clips (the user-facing "adjust duration" gesture is a
|
|
1022
|
-
* trim of the source window). The new `play_in` / `play_out` are the facts; the
|
|
1023
|
-
* effective timeline duration is derived from them and the clip's `speed_shift`,
|
|
1024
|
-
* and the change reflows downstream clips, speeches, and the timeline inside the
|
|
1025
|
-
* op's transaction (no caller-materialized cascade).
|
|
1026
|
-
*/
|
|
1027
|
-
declare const adjustVideoClipDurationInputSchema: z.ZodObject<{
|
|
1028
|
-
clips: z.ZodArray<z.ZodObject<{
|
|
1029
|
-
clip_id: z.ZodString;
|
|
1030
|
-
play_in: z.ZodNumber;
|
|
1031
|
-
play_out: z.ZodNumber;
|
|
1032
|
-
}, z.core.$strip>>;
|
|
1033
|
-
}, z.core.$strip>;
|
|
1034
|
-
type AdjustVideoClipDurationInput = z.infer<typeof adjustVideoClipDurationInputSchema>;
|
|
1035
|
-
//#endregion
|
|
1036
|
-
//#region src/editor/schemas/adjust-video-clip-volume.d.ts
|
|
1037
|
-
declare const adjustVideoClipVolumeInputSchema: z.ZodObject<{
|
|
1038
|
-
clips: z.ZodArray<z.ZodObject<{
|
|
1039
|
-
clip_id: z.ZodString;
|
|
1040
|
-
volume: z.ZodNumber;
|
|
1041
|
-
}, z.core.$strip>>;
|
|
1042
|
-
}, z.core.$strip>;
|
|
1043
|
-
type AdjustVideoClipVolumeInput = z.infer<typeof adjustVideoClipVolumeInputSchema>;
|
|
1044
|
-
//#endregion
|
|
1045
|
-
//#region src/editor/schemas/change-speech.d.ts
|
|
1046
|
-
/**
|
|
1047
|
-
* Change a speech's script or voice. Both re-run TTS upstream and return the
|
|
1048
|
-
* regenerated speech / caption parts in the same materialized shape as
|
|
1049
|
-
* `AddSpeeches` (`speech-assets.ts`); the op upserts them by id (the speech part
|
|
1050
|
-
* id is preserved across a re-TTS), re-seats at `start_ms`, and reflows. Old
|
|
1051
|
-
* caption parts no longer owned by the speech are removed via `caption_ids`.
|
|
1052
|
-
*/
|
|
1053
|
-
declare const changeSpeechScriptInputSchema: z.ZodObject<{
|
|
1054
|
-
speeches: z.ZodArray<z.ZodObject<{
|
|
1055
|
-
speech_id: z.ZodString;
|
|
1056
|
-
anchor_part_id: z.ZodNullable<z.ZodString>;
|
|
1057
|
-
offset_ms: z.ZodNumber;
|
|
1058
|
-
audio_storage_key: z.ZodString;
|
|
1059
|
-
duration_ms: z.ZodNumber;
|
|
1060
|
-
audio_script: z.ZodString;
|
|
1061
|
-
volume: z.ZodNumber;
|
|
1062
|
-
voice: z.ZodObject<{
|
|
1063
|
-
id: z.ZodString;
|
|
1064
|
-
name: z.ZodString;
|
|
1065
|
-
}, z.core.$strip>;
|
|
1066
|
-
origin_speech_id: z.ZodString;
|
|
1067
|
-
caption_ids: z.ZodArray<z.ZodString>;
|
|
1068
|
-
}, z.core.$strip>>;
|
|
1069
|
-
captions: z.ZodArray<z.ZodObject<{
|
|
1070
|
-
caption_id: z.ZodString;
|
|
1071
|
-
speech_part_id: z.ZodString;
|
|
1072
|
-
text: z.ZodString;
|
|
1073
|
-
start_ms: z.ZodNumber;
|
|
1074
|
-
duration_ms: z.ZodNumber;
|
|
1075
|
-
}, z.core.$strip>>;
|
|
1076
|
-
}, z.core.$strip>;
|
|
1077
|
-
declare const changeSpeechVoiceInputSchema: z.ZodObject<{
|
|
1078
|
-
speeches: z.ZodArray<z.ZodObject<{
|
|
1079
|
-
speech_id: z.ZodString;
|
|
1080
|
-
anchor_part_id: z.ZodNullable<z.ZodString>;
|
|
1081
|
-
offset_ms: z.ZodNumber;
|
|
1082
|
-
audio_storage_key: z.ZodString;
|
|
1083
|
-
duration_ms: z.ZodNumber;
|
|
1084
|
-
audio_script: z.ZodString;
|
|
1085
|
-
volume: z.ZodNumber;
|
|
1086
|
-
voice: z.ZodObject<{
|
|
1087
|
-
id: z.ZodString;
|
|
1088
|
-
name: z.ZodString;
|
|
1089
|
-
}, z.core.$strip>;
|
|
1090
|
-
origin_speech_id: z.ZodString;
|
|
1091
|
-
caption_ids: z.ZodArray<z.ZodString>;
|
|
1092
|
-
}, z.core.$strip>>;
|
|
1093
|
-
captions: z.ZodArray<z.ZodObject<{
|
|
1094
|
-
caption_id: z.ZodString;
|
|
1095
|
-
speech_part_id: z.ZodString;
|
|
1096
|
-
text: z.ZodString;
|
|
1097
|
-
start_ms: z.ZodNumber;
|
|
1098
|
-
duration_ms: z.ZodNumber;
|
|
1099
|
-
}, z.core.$strip>>;
|
|
1100
|
-
}, z.core.$strip>;
|
|
1101
|
-
type ChangeSpeechScriptInput = z.infer<typeof changeSpeechScriptInputSchema>;
|
|
1102
|
-
type ChangeSpeechVoiceInput = z.infer<typeof changeSpeechVoiceInputSchema>;
|
|
1103
|
-
//#endregion
|
|
1104
|
-
//#region src/editor/schemas/delete-bgm.d.ts
|
|
1105
|
-
/**
|
|
1106
|
-
* Remove the document BGM. Pure document edit: clears the bgm lane and removes
|
|
1107
|
-
* the bgm part. Takes no input (a document holds at most one bgm); an empty
|
|
1108
|
-
* object keeps the op signature uniform with the rest.
|
|
1109
|
-
*/
|
|
1110
|
-
declare const deleteBgmInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
1111
|
-
type DeleteBgmInput = z.infer<typeof deleteBgmInputSchema>;
|
|
1112
|
-
//#endregion
|
|
1113
|
-
//#region src/editor/schemas/delete-speeches.d.ts
|
|
1114
|
-
/**
|
|
1115
|
-
* Delete speeches with their captions. Pure document edit (no side effect): the
|
|
1116
|
-
* op removes each speech part, cascade-deletes the captions it owns (via
|
|
1117
|
-
* `caption_ids` / `speech_part_id`), drops their track items, and reflows.
|
|
1118
|
-
*/
|
|
1119
|
-
declare const deleteSpeechesInputSchema: z.ZodObject<{
|
|
1120
|
-
speech_ids: z.ZodArray<z.ZodString>;
|
|
1121
|
-
}, z.core.$strip>;
|
|
1122
|
-
type DeleteSpeechesInput = z.infer<typeof deleteSpeechesInputSchema>;
|
|
1123
|
-
//#endregion
|
|
1124
|
-
//#region src/editor/schemas/delete-video-clips.d.ts
|
|
1125
|
-
/**
|
|
1126
|
-
* How a delete handles the anchored subtree (speeches anchored to a deleted clip,
|
|
1127
|
-
* and their captions) — a delete-op policy, not a data-model field (reference/17
|
|
1128
|
-
* §6). `cascade` (default) removes the subtree; `detach` keeps the direct
|
|
1129
|
-
* anchored children, re-pinning them to `absolute` so they stay on the timeline.
|
|
1130
|
-
*/
|
|
1131
|
-
declare const anchoredDeletePolicySchema: z.ZodEnum<{
|
|
1132
|
-
cascade: "cascade";
|
|
1133
|
-
detach: "detach";
|
|
1134
|
-
}>;
|
|
1135
|
-
type AnchoredDeletePolicy = z.infer<typeof anchoredDeletePolicySchema>;
|
|
1136
|
-
declare const deleteVideoClipsInputSchema: z.ZodObject<{
|
|
1137
|
-
clip_ids: z.ZodArray<z.ZodString>;
|
|
1138
|
-
on_anchored: z.ZodOptional<z.ZodEnum<{
|
|
1139
|
-
cascade: "cascade";
|
|
1140
|
-
detach: "detach";
|
|
1141
|
-
}>>;
|
|
1142
|
-
}, z.core.$strip>;
|
|
1143
|
-
type DeleteVideoClipsInput = z.infer<typeof deleteVideoClipsInputSchema>;
|
|
1144
|
-
//#endregion
|
|
1145
|
-
//#region src/editor/schemas/move-speeches.d.ts
|
|
1146
|
-
/**
|
|
1147
|
-
* Move speeches in time. Pure document edit: the op re-seats each speech at its
|
|
1148
|
-
* new absolute `start_ms`; the cascade reassigns it to the host video clip,
|
|
1149
|
-
* resolves overlaps, and reflows. Captions follow their speech.
|
|
1150
|
-
*/
|
|
1151
|
-
declare const moveSpeechesInputSchema: z.ZodObject<{
|
|
1152
|
-
speeches: z.ZodArray<z.ZodObject<{
|
|
1153
|
-
speech_id: z.ZodString;
|
|
1154
|
-
new_start_ms: z.ZodNumber;
|
|
1155
|
-
}, z.core.$strip>>;
|
|
1156
|
-
}, z.core.$strip>;
|
|
1157
|
-
type MoveSpeechesInput = z.infer<typeof moveSpeechesInputSchema>;
|
|
1158
|
-
//#endregion
|
|
1159
|
-
//#region src/editor/schemas/move-bgm.d.ts
|
|
1160
|
-
declare const moveBgmInputSchema: z.ZodObject<{
|
|
1161
|
-
new_start_ms: z.ZodNumber;
|
|
1162
|
-
}, z.core.$strip>;
|
|
1163
|
-
type MoveBgmInput = z.infer<typeof moveBgmInputSchema>;
|
|
1164
|
-
//#endregion
|
|
1165
|
-
//#region src/editor/schemas/move-video-clips-by-anchor.d.ts
|
|
1166
|
-
/**
|
|
1167
|
-
* Where the moved block lands on the main track.
|
|
1168
|
-
*
|
|
1169
|
-
* A discriminated union rather than two optional `before_clip_id` /
|
|
1170
|
-
* `after_clip_id` fields (the shape `addVideoClips` had to use, because there the
|
|
1171
|
-
* two modes share a whole clip description): here the alternatives carry nothing
|
|
1172
|
-
* in common, so making them mutually exclusive *by type* removes three runtime
|
|
1173
|
-
* `superRefine` checks that would otherwise have to be written and tested.
|
|
1174
|
-
*
|
|
1175
|
-
* `track_start` is an explicit member, not the absence of an anchor. The
|
|
1176
|
-
* agent-harness mutation this maps from treats "neither anchor given" as
|
|
1177
|
-
* "move to the front" (`applyBatchMoveVideoClips` falls back to `insertIndex = 0`),
|
|
1178
|
-
* which is a default buried in a tool description. Requiring the caller to name
|
|
1179
|
-
* that intent keeps a forgotten field from silently reordering the timeline.
|
|
1180
|
-
*/
|
|
1181
|
-
declare const moveAnchorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1182
|
-
position: z.ZodLiteral<"before">;
|
|
1183
|
-
clip_id: z.ZodString;
|
|
1184
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1185
|
-
position: z.ZodLiteral<"after">;
|
|
1186
|
-
clip_id: z.ZodString;
|
|
1187
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1188
|
-
position: z.ZodLiteral<"track_start">;
|
|
1189
|
-
}, z.core.$strip>], "position">;
|
|
1190
|
-
/**
|
|
1191
|
-
* What happens to the speeches anchored to the clips being moved.
|
|
1192
|
-
*
|
|
1193
|
-
* - `follow` keeps each speech anchored where it is, so it travels with its clip
|
|
1194
|
-
* to the new position. In the anchored model this is the *no-op* branch: a
|
|
1195
|
-
* speech's authoritative fact is `{ anchorPartId, offsetMs }` and its absolute
|
|
1196
|
-
* time is derived on read from the host's position, so moving the host moves
|
|
1197
|
-
* the speech with no write to the speech at all.
|
|
1198
|
-
* - `keep_absolute` preserves each speech's current absolute landing instead, then
|
|
1199
|
-
* re-anchors it to whichever clip now covers that time (RFC 02 §9.1/§11.1). This
|
|
1200
|
-
* is the branch that costs an extra pass, and the one the FE timeline uses.
|
|
1201
|
-
*
|
|
1202
|
-
* **Required, with no default**, matching `deleteVideoClips` and
|
|
1203
|
-
* `replaceVideoClipSequence`. The two branches decide which picture the user's
|
|
1204
|
-
* narration ends up over, which is too consequential to infer from a missing
|
|
1205
|
-
* field — and neither branch is "safe enough" to be the implicit one.
|
|
1206
|
-
*/
|
|
1207
|
-
declare const movedClipAnchoredPolicySchema: z.ZodEnum<{
|
|
1208
|
-
follow: "follow";
|
|
1209
|
-
keep_absolute: "keep_absolute";
|
|
1210
|
-
}>;
|
|
1211
|
-
/**
|
|
1212
|
-
* Reorder a set of main-track clips relative to a reference clip.
|
|
1213
|
-
*
|
|
1214
|
-
* Distinct from `moveVideoClips`, which positions clips by absolute time
|
|
1215
|
-
* (`new_start_ms`) and is what the FE timeline dispatches after a drag. Main-track
|
|
1216
|
-
* clips are `sequential`-positioned, so absolute time is not authoritative state
|
|
1217
|
-
* there (RFC 02 §4/§7): `moveVideoClips` has to *guess* an index back out of the
|
|
1218
|
-
* time it was handed, whereas an anchor already is the ordinal fact being changed.
|
|
1219
|
-
* Keeping them separate also isolates blast radius — this method can diverge on
|
|
1220
|
-
* speech policy without touching the FE path.
|
|
1221
|
-
*
|
|
1222
|
-
* `clip_ids` need not be contiguous. They move as one block, keeping their
|
|
1223
|
-
* relative order, which is the agent-harness `batch_move_video_clips` contract.
|
|
1224
|
-
*/
|
|
1225
|
-
declare const moveVideoClipsByAnchorInputSchema: z.ZodObject<{
|
|
1226
|
-
clip_ids: z.ZodArray<z.ZodString>;
|
|
1227
|
-
anchor: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1228
|
-
position: z.ZodLiteral<"before">;
|
|
1229
|
-
clip_id: z.ZodString;
|
|
1230
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1231
|
-
position: z.ZodLiteral<"after">;
|
|
1232
|
-
clip_id: z.ZodString;
|
|
1233
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1234
|
-
position: z.ZodLiteral<"track_start">;
|
|
1235
|
-
}, z.core.$strip>], "position">;
|
|
1236
|
-
on_anchored: z.ZodEnum<{
|
|
1237
|
-
follow: "follow";
|
|
1238
|
-
keep_absolute: "keep_absolute";
|
|
1239
|
-
}>;
|
|
1240
|
-
}, z.core.$strip>;
|
|
1241
|
-
type MoveAnchor = z.infer<typeof moveAnchorSchema>;
|
|
1242
|
-
type MovedClipAnchoredPolicy = z.infer<typeof movedClipAnchoredPolicySchema>;
|
|
1243
|
-
type MoveVideoClipsByAnchorInput = z.infer<typeof moveVideoClipsByAnchorInputSchema>;
|
|
1244
|
-
//#endregion
|
|
1245
|
-
//#region src/editor/schemas/move-video-clips.d.ts
|
|
1246
|
-
declare const moveVideoClipsInputSchema: z.ZodObject<{
|
|
1247
|
-
clips: z.ZodArray<z.ZodObject<{
|
|
1248
|
-
clip_id: z.ZodString;
|
|
1249
|
-
new_start_ms: z.ZodNumber;
|
|
1250
|
-
new_track_id: z.ZodOptional<z.ZodString>;
|
|
1251
|
-
}, z.core.$strip>>;
|
|
1252
|
-
}, z.core.$strip>;
|
|
1253
|
-
type MoveVideoClipsInput = z.infer<typeof moveVideoClipsInputSchema>;
|
|
1254
|
-
//#endregion
|
|
1255
|
-
//#region src/editor/schemas/replace-video-clip-content.d.ts
|
|
1256
|
-
/**
|
|
1257
|
-
* Replace the media backing existing video clips. The media import runs upstream
|
|
1258
|
-
* (Director); its stable result — the new media id, intrinsic length, and the
|
|
1259
|
-
* reset trim window — arrives materialized (see
|
|
1260
|
-
* `results/phase-4-side-effect-payload-contract.md` §4). Director resets
|
|
1261
|
-
* `play_in=0` / `play_out=media_duration_ms` and clears `speed_shift` on
|
|
1262
|
-
* replacement. The clip `part_id`s (hence their track items) are unchanged; the
|
|
1263
|
-
* editor reflows the main track from the new effective durations.
|
|
1264
|
-
*/
|
|
1265
|
-
declare const replaceVideoClipContentInputSchema: z.ZodObject<{
|
|
1266
|
-
clips: z.ZodArray<z.ZodObject<{
|
|
1267
|
-
clip_id: z.ZodString;
|
|
1268
|
-
origin_media_id: z.ZodString;
|
|
1269
|
-
media_duration_ms: z.ZodNumber;
|
|
1270
|
-
play_in: z.ZodNumber;
|
|
1271
|
-
play_out: z.ZodNumber;
|
|
1272
|
-
volume: z.ZodNumber;
|
|
1273
|
-
}, z.core.$strip>>;
|
|
1274
|
-
}, z.core.$strip>;
|
|
1275
|
-
type ReplaceVideoClipContentInput = z.infer<typeof replaceVideoClipContentInputSchema>;
|
|
1276
|
-
//#endregion
|
|
1277
|
-
//#region src/editor/schemas/replace-video-clip-sequence.d.ts
|
|
1278
|
-
/**
|
|
1279
|
-
* What happens to the speeches anchored to the clips being replaced.
|
|
1280
|
-
*
|
|
1281
|
-
* - `remap` re-anchors each surviving speech to the new clip in the SAME POSITION
|
|
1282
|
-
* of the sequence, keeping its offset — old[i]'s children become new[i]'s
|
|
1283
|
-
* children. An old clip with no counterpart (fewer new clips than old) has its
|
|
1284
|
-
* subtree deleted, because there is nothing left to anchor to.
|
|
1285
|
-
* - `cascade` deletes every anchored speech (and its captions) outright, like
|
|
1286
|
-
* `deleteVideoClips`.
|
|
1287
|
-
*
|
|
1288
|
-
* **Required, with no default.** The two branches differ in whether the user's
|
|
1289
|
-
* narration survives, and the agent tool that drives this op makes its
|
|
1290
|
-
* `preserve_speeches` flag required for that reason. A default here would let a
|
|
1291
|
-
* caller that forgot the field silently delete speech.
|
|
1292
|
-
*/
|
|
1293
|
-
declare const anchoredReplacePolicySchema: z.ZodEnum<{
|
|
1294
|
-
cascade: "cascade";
|
|
1295
|
-
remap: "remap";
|
|
1296
|
-
}>;
|
|
1297
|
-
type AnchoredReplacePolicy = z.infer<typeof anchoredReplacePolicySchema>;
|
|
1298
|
-
/**
|
|
1299
|
-
* Replace a contiguous run of main-track clips with a new run.
|
|
1300
|
-
*
|
|
1301
|
-
* A composite of delete + insert that cannot be expressed as the two ops in
|
|
1302
|
-
* sequence, because the anchored speeches have to survive *across* the swap: with
|
|
1303
|
-
* `remap` they are re-anchored positionally, which needs both the old and the new
|
|
1304
|
-
* ids in the same transaction (ADR 0009 — the cascade stays in the editor, callers
|
|
1305
|
-
* never re-wire anchors themselves).
|
|
1306
|
-
*
|
|
1307
|
-
* Duration facts follow `addVideoClips`: `media_duration_ms` is the source's
|
|
1308
|
-
* intrinsic length and the trim window defaults to the whole media. The effective
|
|
1309
|
-
* timeline duration is derived by the projection, never an input.
|
|
1310
|
-
*
|
|
1311
|
-
* `media_id` is optional: omitting it creates a **deliberate empty placeholder
|
|
1312
|
-
* clip** (`origin_media_id: ''`) — structure with no picture. This is the only op
|
|
1313
|
-
* that can produce one, and it is authoritative state, unlike the gap fillers the
|
|
1314
|
-
* read-side solve mints (which never enter the document).
|
|
1315
|
-
*/
|
|
1316
|
-
declare const replaceVideoClipSequenceInputSchema: z.ZodObject<{
|
|
1317
|
-
old_clip_ids: z.ZodArray<z.ZodString>;
|
|
1318
|
-
new_clips: z.ZodArray<z.ZodObject<{
|
|
1319
|
-
media_id: z.ZodOptional<z.ZodString>;
|
|
1320
|
-
media_duration_ms: z.ZodNumber;
|
|
1321
|
-
play_in: z.ZodOptional<z.ZodNumber>;
|
|
1322
|
-
play_out: z.ZodOptional<z.ZodNumber>;
|
|
1323
|
-
}, z.core.$strip>>;
|
|
1324
|
-
on_anchored: z.ZodEnum<{
|
|
1325
|
-
cascade: "cascade";
|
|
1326
|
-
remap: "remap";
|
|
1327
|
-
}>;
|
|
1328
|
-
}, z.core.$strip>;
|
|
1329
|
-
type ReplaceVideoClipSequenceInput = z.infer<typeof replaceVideoClipSequenceInputSchema>;
|
|
1330
|
-
//#endregion
|
|
1331
|
-
//#region src/editor/schemas/resize-caption.d.ts
|
|
1332
|
-
/** Resize one caption placement without changing its cue/source duration. */
|
|
1333
|
-
declare const resizeCaptionInputSchema: z.ZodObject<{
|
|
1334
|
-
caption_id: z.ZodString;
|
|
1335
|
-
duration_ms: z.ZodNumber;
|
|
1336
|
-
}, z.core.$strip>;
|
|
1337
|
-
type ResizeCaptionInput = z.infer<typeof resizeCaptionInputSchema>;
|
|
1338
|
-
//#endregion
|
|
1339
|
-
//#region src/editor/schemas/set-bgm.d.ts
|
|
1340
|
-
/**
|
|
1341
|
-
* Set the document BGM. The media's stable result (storage key) arrives
|
|
1342
|
-
* materialized from upstream (see
|
|
1343
|
-
* `results/phase-4-side-effect-payload-contract.md` §3). The op upserts the bgm
|
|
1344
|
-
* part and seats it on the bgm lane; its effective length is always the whole
|
|
1345
|
-
* timeline, derived by the projection on read — so there is no `duration_ms`
|
|
1346
|
-
* input or fact (RFC 02 / `reference/16` §0b). A `bgm_id` lets the op replace an
|
|
1347
|
-
* existing bgm part by id.
|
|
1348
|
-
*/
|
|
1349
|
-
declare const setBgmInputSchema: z.ZodObject<{
|
|
1350
|
-
bgm_id: z.ZodString;
|
|
1351
|
-
audio_storage_key: z.ZodString;
|
|
1352
|
-
origin_media_id: z.ZodString;
|
|
1353
|
-
volume: z.ZodNumber;
|
|
1354
|
-
}, z.core.$strip>;
|
|
1355
|
-
type SetBgmInput = z.infer<typeof setBgmInputSchema>;
|
|
1356
|
-
//#endregion
|
|
1357
|
-
//#region src/editor/schemas/set-caption-style.d.ts
|
|
1358
|
-
/**
|
|
1359
|
-
* Set the caption visual style. GLOBAL by design: the style applies to every
|
|
1360
|
-
* caption part in the document — it carries NO `caption_id`. This mirrors the FE,
|
|
1361
|
-
* whose caption-style store (`caption-style.ts:persistCaptionStylePatch`) iterates
|
|
1362
|
-
* ALL captions and writes the same normalized style to each; the product has a
|
|
1363
|
-
* single document-wide caption style, not per-caption styling.
|
|
1364
|
-
*
|
|
1365
|
-
* Every field is optional and maps to a `CaptionStyle` attribute (snake_case
|
|
1366
|
-
* IDL). A field present in the input is written to every caption; a field ABSENT
|
|
1367
|
-
* from the input is left untouched on each caption (the editor merges the patch
|
|
1368
|
-
* onto each caption's existing style — this is a value edit, not a full-style
|
|
1369
|
-
* replace, so a partial patch such as "recolor only" does not wipe font size).
|
|
1370
|
-
*
|
|
1371
|
-
* Pure document edit, no cascade — captions keep their positions; only the style
|
|
1372
|
-
* sub-map of each caption part changes.
|
|
1373
|
-
*/
|
|
1374
|
-
declare const setCaptionStyleInputSchema: z.ZodObject<{
|
|
1375
|
-
font_id: z.ZodOptional<z.ZodString>;
|
|
1376
|
-
font_size: z.ZodOptional<z.ZodNumber>;
|
|
1377
|
-
font_color: z.ZodOptional<z.ZodString>;
|
|
1378
|
-
font_weight: z.ZodOptional<z.ZodNumber>;
|
|
1379
|
-
entrance_animation: z.ZodOptional<z.ZodString>;
|
|
1380
|
-
entrance_animation_duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
1381
|
-
stroke_color: z.ZodOptional<z.ZodString>;
|
|
1382
|
-
stroke_width: z.ZodOptional<z.ZodNumber>;
|
|
1383
|
-
position_x: z.ZodOptional<z.ZodNumber>;
|
|
1384
|
-
position_y: z.ZodOptional<z.ZodNumber>;
|
|
1385
|
-
}, z.core.$strip>;
|
|
1386
|
-
type SetCaptionStyleInput = z.infer<typeof setCaptionStyleInputSchema>;
|
|
1387
|
-
//#endregion
|
|
1388
|
-
//#region src/editor/schemas/set-caption-visibility.d.ts
|
|
1389
|
-
/**
|
|
1390
|
-
* Toggle caption visibility (the caption track's `is_hidden` flag). Pure
|
|
1391
|
-
* document edit, no cascade — captions keep their positions; only the lane's
|
|
1392
|
-
* hidden flag changes.
|
|
1393
|
-
*/
|
|
1394
|
-
declare const setCaptionVisibilityInputSchema: z.ZodObject<{
|
|
1395
|
-
is_hidden: z.ZodBoolean;
|
|
1396
|
-
}, z.core.$strip>;
|
|
1397
|
-
type SetCaptionVisibilityInput = z.infer<typeof setCaptionVisibilityInputSchema>;
|
|
1398
|
-
//#endregion
|
|
1399
|
-
//#region src/editor/schemas/set-video-clip-speed-shift.d.ts
|
|
1400
|
-
/**
|
|
1401
|
-
* Set the playback speed of existing video clips. Per the speed-shift decision
|
|
1402
|
-
* (`reference/16` §0): the op writes only the `speed_shift` fact — it does NOT
|
|
1403
|
-
* store an effective `duration_ms` (projection derives it from the trim window /
|
|
1404
|
-
* speed) and does NOT scale anchored speeches' relative offsets (offsets stay
|
|
1405
|
-
* put; the cascade reflows absolute positions). A `null` speed_shift clears the
|
|
1406
|
-
* speed back to original (1×).
|
|
1407
|
-
*/
|
|
1408
|
-
declare const setVideoClipSpeedShiftInputSchema: z.ZodObject<{
|
|
1409
|
-
clips: z.ZodArray<z.ZodObject<{
|
|
1410
|
-
clip_id: z.ZodString;
|
|
1411
|
-
speed_shift: z.ZodNullable<z.ZodObject<{
|
|
1412
|
-
category: z.ZodEnum<{
|
|
1413
|
-
curve: "curve";
|
|
1414
|
-
linear: "linear";
|
|
1415
|
-
}>;
|
|
1416
|
-
mode: z.ZodString;
|
|
1417
|
-
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
1418
|
-
linear: z.ZodObject<{
|
|
1419
|
-
speed: z.ZodNumber;
|
|
1420
|
-
}, z.core.$strip>;
|
|
1421
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1422
|
-
curve: z.ZodObject<{
|
|
1423
|
-
keyframes: z.ZodArray<z.ZodObject<{
|
|
1424
|
-
position: z.ZodNumber;
|
|
1425
|
-
rate: z.ZodNumber;
|
|
1426
|
-
in_tangent: z.ZodOptional<z.ZodObject<{
|
|
1427
|
-
x: z.ZodNumber;
|
|
1428
|
-
y: z.ZodNumber;
|
|
1429
|
-
}, z.core.$strip>>;
|
|
1430
|
-
out_tangent: z.ZodOptional<z.ZodObject<{
|
|
1431
|
-
x: z.ZodNumber;
|
|
1432
|
-
y: z.ZodNumber;
|
|
1433
|
-
}, z.core.$strip>>;
|
|
1434
|
-
}, z.core.$strip>>;
|
|
1435
|
-
}, z.core.$strip>;
|
|
1436
|
-
}, z.core.$strip>]>;
|
|
1437
|
-
}, z.core.$strip>>;
|
|
1438
|
-
}, z.core.$strip>>;
|
|
1439
|
-
}, z.core.$strip>;
|
|
1440
|
-
type SetVideoClipSpeedShiftInput = z.infer<typeof setVideoClipSpeedShiftInputSchema>;
|
|
1441
|
-
//#endregion
|
|
1442
|
-
//#region src/editor/schemas/shared.d.ts
|
|
1443
|
-
declare const clipIdSchema: z.ZodString;
|
|
1444
|
-
declare const clipIdsSchema: z.ZodArray<z.ZodString>;
|
|
1445
|
-
declare const mediaIdSchema: z.ZodString;
|
|
1446
|
-
declare const speechIdSchema: z.ZodString;
|
|
1447
|
-
declare const timelineMsSchema: z.ZodNumber;
|
|
1448
|
-
declare const positiveMsSchema: z.ZodNumber;
|
|
1449
|
-
declare const volumeSchema: z.ZodNumber;
|
|
1450
|
-
declare const speechIdsSchema: z.ZodArray<z.ZodString>;
|
|
1451
|
-
/**
|
|
1452
|
-
* A clip's playback-speed fact, the only thing `SetVideoClipSpeedShift` writes.
|
|
1453
|
-
* Mirrors the IDL `SpeedShift`: `category` is `linear` | `curve`, and `config`
|
|
1454
|
-
* is a discriminated union — `{ linear: { speed } }` for a constant multiplier
|
|
1455
|
-
* (the multiplier projection reads at `config.linear.speed`) or `{ curve: {
|
|
1456
|
-
* keyframes } }` for a Bezier-controlled variable speed (RFC 02 / `reference/16`
|
|
1457
|
-
* §0). Exactly one of `linear` / `curve` is present.
|
|
1458
|
-
*/
|
|
1459
|
-
declare const speedShiftSchema: z.ZodObject<{
|
|
1460
|
-
category: z.ZodEnum<{
|
|
1461
|
-
curve: "curve";
|
|
1462
|
-
linear: "linear";
|
|
1463
|
-
}>;
|
|
1464
|
-
mode: z.ZodString;
|
|
1465
|
-
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
1466
|
-
linear: z.ZodObject<{
|
|
1467
|
-
speed: z.ZodNumber;
|
|
1468
|
-
}, z.core.$strip>;
|
|
1469
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
1470
|
-
curve: z.ZodObject<{
|
|
1471
|
-
keyframes: z.ZodArray<z.ZodObject<{
|
|
1472
|
-
position: z.ZodNumber;
|
|
1473
|
-
rate: z.ZodNumber;
|
|
1474
|
-
in_tangent: z.ZodOptional<z.ZodObject<{
|
|
1475
|
-
x: z.ZodNumber;
|
|
1476
|
-
y: z.ZodNumber;
|
|
1477
|
-
}, z.core.$strip>>;
|
|
1478
|
-
out_tangent: z.ZodOptional<z.ZodObject<{
|
|
1479
|
-
x: z.ZodNumber;
|
|
1480
|
-
y: z.ZodNumber;
|
|
1481
|
-
}, z.core.$strip>>;
|
|
1482
|
-
}, z.core.$strip>>;
|
|
1483
|
-
}, z.core.$strip>;
|
|
1484
|
-
}, z.core.$strip>]>;
|
|
1485
|
-
}, z.core.$strip>;
|
|
1486
|
-
declare const voiceSchema: z.ZodObject<{
|
|
1487
|
-
id: z.ZodString;
|
|
1488
|
-
name: z.ZodString;
|
|
1489
|
-
}, z.core.$strip>;
|
|
1490
|
-
//#endregion
|
|
1491
|
-
//#region src/editor/schemas/speech-assets.d.ts
|
|
1492
|
-
/**
|
|
1493
|
-
* The materialized TTS result shared by `AddSpeeches` / `ChangeSpeechScript` /
|
|
1494
|
-
* `ChangeSpeechVoice` (see `results/phase-4-side-effect-payload-contract.md`
|
|
1495
|
-
* §1/§2). The side effect (TTS/ASR + billing) runs upstream; the op receives the
|
|
1496
|
-
* stable speech + caption parts and writes them as authoritative facts. No
|
|
1497
|
-
* cascade runs on write — the projection derives absolute positions on read.
|
|
1498
|
-
*
|
|
1499
|
-
* `anchor_part_id` states the root relationship explicitly: a video/BGM id
|
|
1500
|
-
* creates an anchored speech; `null` creates an absolute audio root.
|
|
1501
|
-
* `offset_ms` is relative to the anchor or absolute for a root. Captions always
|
|
1502
|
-
* anchor to their speech via `start_ms`.
|
|
1503
|
-
*/
|
|
1504
|
-
declare const speechAssetSchema: z.ZodObject<{
|
|
1505
|
-
speech_id: z.ZodString;
|
|
1506
|
-
anchor_part_id: z.ZodNullable<z.ZodString>;
|
|
1507
|
-
offset_ms: z.ZodNumber;
|
|
1508
|
-
audio_storage_key: z.ZodString;
|
|
1509
|
-
duration_ms: z.ZodNumber;
|
|
1510
|
-
audio_script: z.ZodString;
|
|
1511
|
-
volume: z.ZodNumber;
|
|
1512
|
-
voice: z.ZodObject<{
|
|
1513
|
-
id: z.ZodString;
|
|
1514
|
-
name: z.ZodString;
|
|
1515
|
-
}, z.core.$strip>;
|
|
1516
|
-
origin_speech_id: z.ZodString;
|
|
1517
|
-
caption_ids: z.ZodArray<z.ZodString>;
|
|
1518
|
-
}, z.core.$strip>;
|
|
1519
|
-
declare const captionAssetSchema: z.ZodObject<{
|
|
1520
|
-
caption_id: z.ZodString;
|
|
1521
|
-
speech_part_id: z.ZodString;
|
|
1522
|
-
text: z.ZodString;
|
|
1523
|
-
start_ms: z.ZodNumber;
|
|
1524
|
-
duration_ms: z.ZodNumber;
|
|
1525
|
-
}, z.core.$strip>;
|
|
1526
|
-
/** A materialized speech-subtree write (speeches + their captions). */
|
|
1527
|
-
declare const speechAssetsSchema: z.ZodObject<{
|
|
1528
|
-
speeches: z.ZodArray<z.ZodObject<{
|
|
1529
|
-
speech_id: z.ZodString;
|
|
1530
|
-
anchor_part_id: z.ZodNullable<z.ZodString>;
|
|
1531
|
-
offset_ms: z.ZodNumber;
|
|
1532
|
-
audio_storage_key: z.ZodString;
|
|
1533
|
-
duration_ms: z.ZodNumber;
|
|
1534
|
-
audio_script: z.ZodString;
|
|
1535
|
-
volume: z.ZodNumber;
|
|
1536
|
-
voice: z.ZodObject<{
|
|
1537
|
-
id: z.ZodString;
|
|
1538
|
-
name: z.ZodString;
|
|
1539
|
-
}, z.core.$strip>;
|
|
1540
|
-
origin_speech_id: z.ZodString;
|
|
1541
|
-
caption_ids: z.ZodArray<z.ZodString>;
|
|
1542
|
-
}, z.core.$strip>>;
|
|
1543
|
-
captions: z.ZodArray<z.ZodObject<{
|
|
1544
|
-
caption_id: z.ZodString;
|
|
1545
|
-
speech_part_id: z.ZodString;
|
|
1546
|
-
text: z.ZodString;
|
|
1547
|
-
start_ms: z.ZodNumber;
|
|
1548
|
-
duration_ms: z.ZodNumber;
|
|
1549
|
-
}, z.core.$strip>>;
|
|
1550
|
-
}, z.core.$strip>;
|
|
1551
|
-
type SpeechAsset = z.infer<typeof speechAssetSchema>;
|
|
1552
|
-
type CaptionAsset = z.infer<typeof captionAssetSchema>;
|
|
1553
|
-
type SpeechAssets = z.infer<typeof speechAssetsSchema>;
|
|
1554
|
-
declare namespace index_d_exports {
|
|
1555
|
-
export { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, AnchoredDeletePolicy, AnchoredReplacePolicy, CaptionAsset, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, MoveAnchor, MoveBgmInput, MoveSpeechesInput, MoveVideoClipsByAnchorInput, MoveVideoClipsInput, MovedClipAnchoredPolicy, ReplaceVideoClipContentInput, ReplaceVideoClipSequenceInput, ResizeCaptionInput, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput, SpeechAsset, SpeechAssets, addSpeechesInputSchema, addVideoClipsInputSchema, adjustBgmVolumeInputSchema, adjustSpeechVolumeInputSchema, adjustVideoClipDurationInputSchema, adjustVideoClipVolumeInputSchema, anchoredDeletePolicySchema, anchoredReplacePolicySchema, changeSpeechScriptInputSchema, changeSpeechVoiceInputSchema, clipIdSchema, clipIdsSchema, deleteBgmInputSchema, deleteSpeechesInputSchema, deleteVideoClipsInputSchema, mediaIdSchema, moveAnchorSchema, moveBgmInputSchema, moveSpeechesInputSchema, moveVideoClipsByAnchorInputSchema, moveVideoClipsInputSchema, movedClipAnchoredPolicySchema, positiveMsSchema, replaceVideoClipContentInputSchema, replaceVideoClipSequenceInputSchema, resizeCaptionInputSchema, setBgmInputSchema, setCaptionStyleInputSchema, setCaptionVisibilityInputSchema, setVideoClipSpeedShiftInputSchema, speechAssetsSchema, speechIdSchema, speechIdsSchema, speedShiftSchema, timelineMsSchema, voiceSchema, volumeSchema };
|
|
1556
|
-
}
|
|
964
|
+
* The ULID is generated inline (Crockford Base32, 48-bit time + 80-bit random)
|
|
965
|
+
* rather than pulling the `ulid` npm package: the randomness class matches the
|
|
966
|
+
* old generator (both `Math.random`-based) and it keeps `@mengine/medeo-client`
|
|
967
|
+
* dependency-free for a purely mechanical id string. Part ids only need to be
|
|
968
|
+
* unique and lexicographically time-sortable, which this satisfies.
|
|
969
|
+
*/
|
|
970
|
+
/**
|
|
971
|
+
* Online part-id semantic prefixes. `clip` (video clip) is the only value the
|
|
972
|
+
* engine currently mints (see `addVideoClips`); the rest are declared so the
|
|
973
|
+
* type documents the shared vocabulary and guards against reintroducing the old
|
|
974
|
+
* `vc`/`sp`/`cp`/`bg` names. Speech/caption/bgm ids arrive pre-minted in op
|
|
975
|
+
* payloads, so the engine never generates them itself.
|
|
976
|
+
*/
|
|
977
|
+
type PartIdPrefix = 'clip' | 'spe' | 'cap' | 'bgm' | 'ti';
|
|
978
|
+
declare function generatePartId(prefix: PartIdPrefix): string;
|
|
979
|
+
/** Injectable part-id mint; defaults to `generatePartId` on `SemanticEditor`. */
|
|
980
|
+
type PartIdFactory = (prefix: PartIdPrefix) => string;
|
|
1557
981
|
//#endregion
|
|
1558
982
|
//#region src/editor/schema-validator.d.ts
|
|
1559
983
|
interface SnapshotReadable {
|
|
@@ -1601,11 +1025,9 @@ declare class SchemaValidator {
|
|
|
1601
1025
|
validateChangeSpeechVoice(input: ChangeSpeechVoiceInput, doc: SnapshotReadable): void;
|
|
1602
1026
|
validateDeleteSpeeches(input: DeleteSpeechesInput, doc: SnapshotReadable): void;
|
|
1603
1027
|
validateMoveSpeeches(input: MoveSpeechesInput, doc: SnapshotReadable): void;
|
|
1604
|
-
validateMoveBgm(input: MoveBgmInput, doc: SnapshotReadable): void;
|
|
1605
1028
|
validateSetBgm(input: SetBgmInput, _doc: SnapshotReadable): void;
|
|
1606
1029
|
validateDeleteBgm(input: DeleteBgmInput, _doc: SnapshotReadable): void;
|
|
1607
1030
|
validateSetCaptionVisibility(input: SetCaptionVisibilityInput, _doc: SnapshotReadable): void;
|
|
1608
|
-
validateResizeCaption(input: ResizeCaptionInput, doc: SnapshotReadable): void;
|
|
1609
1031
|
validateSetCaptionStyle(input: SetCaptionStyleInput, _doc: SnapshotReadable): void;
|
|
1610
1032
|
private parse;
|
|
1611
1033
|
private mainTrackIds;
|
|
@@ -1614,8 +1036,12 @@ declare class SchemaValidator {
|
|
|
1614
1036
|
/** Each regenerated speech (re-TTS) must already exist in the document. */
|
|
1615
1037
|
private assertSpeechesExist;
|
|
1616
1038
|
/**
|
|
1617
|
-
*
|
|
1618
|
-
*
|
|
1039
|
+
* Each speech's `anchor_part_id` must point at a video clip that already
|
|
1040
|
+
* exists. A relative speech anchored to a missing clip cannot be positioned
|
|
1041
|
+
* by the projection and has no host to recover to (RFC 02 §4/§11.1), so the
|
|
1042
|
+
* write must be rejected rather than landing a dangling reference. (Restores
|
|
1043
|
+
* the dangling-reference guard the old `validateMaterializedPatch` carried;
|
|
1044
|
+
* ADR 0009.)
|
|
1619
1045
|
*/
|
|
1620
1046
|
private assertAnchorsExist;
|
|
1621
1047
|
private assertPartKind;
|
|
@@ -1650,7 +1076,7 @@ declare class SchemaValidator {
|
|
|
1650
1076
|
* side-effect payload contract in
|
|
1651
1077
|
* `docs/projects/medeo-integration/results/phase-4-side-effect-payload-contract.md`.
|
|
1652
1078
|
*/
|
|
1653
|
-
type ImplementedSemanticOpKind = 'MoveVideoClips' | 'MoveVideoClipsByAnchor' | 'DeleteVideoClips' | 'AddVideoClips' | 'AdjustVideoClipVolume' | 'SetVideoClipSpeedShift' | 'ReplaceVideoClipContent' | 'ReplaceVideoClipSequence' | 'AdjustVideoClipDuration' | 'AddSpeeches' | 'DeleteSpeeches' | 'MoveSpeeches' | '
|
|
1079
|
+
type ImplementedSemanticOpKind = 'MoveVideoClips' | 'MoveVideoClipsByAnchor' | 'DeleteVideoClips' | 'AddVideoClips' | 'AdjustVideoClipVolume' | 'SetVideoClipSpeedShift' | 'ReplaceVideoClipContent' | 'ReplaceVideoClipSequence' | 'AdjustVideoClipDuration' | 'AddSpeeches' | 'DeleteSpeeches' | 'MoveSpeeches' | 'ChangeSpeechScript' | 'ChangeSpeechVoice' | 'AdjustSpeechVolume' | 'SetCaptionVisibility' | 'SetCaptionStyle' | 'SetBgm' | 'DeleteBgm' | 'AdjustBgmVolume';
|
|
1654
1080
|
/**
|
|
1655
1081
|
* Operations on the roadmap but NOT yet implemented by `SemanticEditor`. Empty:
|
|
1656
1082
|
* Phase 4 covers every op with a real entry point. Kept as a named type so the
|
|
@@ -1705,14 +1131,19 @@ interface OpActor {
|
|
|
1705
1131
|
role: 'user' | 'agent';
|
|
1706
1132
|
}
|
|
1707
1133
|
interface CommitOptions {
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1134
|
+
/**
|
|
1135
|
+
* Caller-supplied intent attached to the op's audit message.
|
|
1136
|
+
*
|
|
1137
|
+
* Typed as `unknown` to match `TransactAudit.intent`. The wire (real
|
|
1138
|
+
* mengine-server and the in-memory test double) only surfaces **string**
|
|
1139
|
+
* intents onto the audit log — non-string values stay in the Loro commit
|
|
1140
|
+
* message but parse to `null`. Agent callers should pass a string.
|
|
1141
|
+
*/
|
|
1142
|
+
intent?: unknown;
|
|
1712
1143
|
/** Author of this op; omitted for writes with no acting user (bootstrap, repair). */
|
|
1713
1144
|
actor?: OpActor;
|
|
1714
1145
|
}
|
|
1715
|
-
type SemanticOpInput = MoveVideoClipsInput | MoveVideoClipsByAnchorInput | DeleteVideoClipsInput | AddVideoClipsInput | AdjustVideoClipVolumeInput | AdjustSpeechVolumeInput | AdjustBgmVolumeInput | SetVideoClipSpeedShiftInput | ReplaceVideoClipContentInput | ReplaceVideoClipSequenceInput | AdjustVideoClipDurationInput | AddSpeechesInput | DeleteSpeechesInput | MoveSpeechesInput |
|
|
1146
|
+
type SemanticOpInput = MoveVideoClipsInput | MoveVideoClipsByAnchorInput | DeleteVideoClipsInput | AddVideoClipsInput | AdjustVideoClipVolumeInput | AdjustSpeechVolumeInput | AdjustBgmVolumeInput | SetVideoClipSpeedShiftInput | ReplaceVideoClipContentInput | ReplaceVideoClipSequenceInput | AdjustVideoClipDurationInput | AddSpeechesInput | DeleteSpeechesInput | MoveSpeechesInput | SetCaptionVisibilityInput | SetCaptionStyleInput | SetBgmInput | DeleteBgmInput;
|
|
1716
1147
|
type SemanticOpName = ImplementedSemanticOpKind;
|
|
1717
1148
|
/** Audit metadata committed alongside an op's writes. */
|
|
1718
1149
|
interface TransactAudit {
|
|
@@ -1753,7 +1184,8 @@ interface SemanticDocumentAdapter extends SnapshotReadable {
|
|
|
1753
1184
|
declare class SemanticEditor {
|
|
1754
1185
|
private readonly doc;
|
|
1755
1186
|
private readonly validator;
|
|
1756
|
-
|
|
1187
|
+
private readonly idFactory;
|
|
1188
|
+
constructor(doc: SemanticDocumentAdapter, validator?: SchemaValidator, idFactory?: PartIdFactory);
|
|
1757
1189
|
moveVideoClips(input: MoveVideoClipsInput, options?: CommitOptions): Promise<void>;
|
|
1758
1190
|
/**
|
|
1759
1191
|
* Reorder main-track clips relative to an anchor clip, moving them as one block.
|
|
@@ -1828,8 +1260,6 @@ declare class SemanticEditor {
|
|
|
1828
1260
|
* derives absolute positions on read.
|
|
1829
1261
|
*/
|
|
1830
1262
|
moveSpeeches(input: MoveSpeechesInput, options?: CommitOptions): Promise<void>;
|
|
1831
|
-
/** Move the BGM root; any speech/caption descendants follow through their anchors. */
|
|
1832
|
-
moveBgm(input: MoveBgmInput, options?: CommitOptions): Promise<void>;
|
|
1833
1263
|
/** Change a speech's script. Re-TTS runs upstream; the regenerated parts arrive materialized (no cascade). */
|
|
1834
1264
|
changeSpeechScript(input: ChangeSpeechScriptInput, options?: CommitOptions): Promise<void>;
|
|
1835
1265
|
/** Change a speech's voice. Re-TTS runs upstream; the regenerated parts arrive materialized (no cascade). */
|
|
@@ -1860,8 +1290,6 @@ declare class SemanticEditor {
|
|
|
1860
1290
|
deleteBgm(input: DeleteBgmInput, options?: CommitOptions): Promise<void>;
|
|
1861
1291
|
/** Toggle caption visibility (caption track `is_hidden`). */
|
|
1862
1292
|
setCaptionVisibility(input: SetCaptionVisibilityInput, options?: CommitOptions): Promise<void>;
|
|
1863
|
-
/** Resize the caption placement window; cue/source duration stays immutable. */
|
|
1864
|
-
resizeCaption(input: ResizeCaptionInput, options?: CommitOptions): Promise<void>;
|
|
1865
1293
|
/**
|
|
1866
1294
|
* Set the document-wide caption style. GLOBAL (no `caption_id`): the patch is
|
|
1867
1295
|
* merged onto EVERY caption part's `style`, mirroring the FE, which applies a
|
|
@@ -1928,6 +1356,57 @@ declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
|
|
|
1928
1356
|
declare function createMirrorVideoDocument(document: VideoDocument, options?: MirrorVideoDocumentOptions): LoroDoc;
|
|
1929
1357
|
/** Build a `MirrorVideoDocumentAdapter` over a fresh doc seeded with `document`. */
|
|
1930
1358
|
declare function createMirrorVideoDocumentAdapter(document: VideoDocument, options?: MirrorVideoDocumentOptions): MirrorVideoDocumentAdapter;
|
|
1359
|
+
/** Write a whole `VideoDocument` into a draft (seed a fresh doc / plain-memory state). */
|
|
1360
|
+
declare function writeVideoDocumentToDraft(draft: VideoDocumentDraft, document: VideoDocument): void;
|
|
1361
|
+
//#endregion
|
|
1362
|
+
//#region src/document/plain-memory-adapter.d.ts
|
|
1363
|
+
/**
|
|
1364
|
+
* A `TransactAudit` widened with the ordered ids minted during that transact.
|
|
1365
|
+
* `generated_ids` is empty when the op never called the id factory.
|
|
1366
|
+
*/
|
|
1367
|
+
interface JournalEntry extends TransactAudit {
|
|
1368
|
+
/** Ids produced by the adapter's id factory during this transact, in mint order. */
|
|
1369
|
+
generated_ids: string[];
|
|
1370
|
+
}
|
|
1371
|
+
interface PlainMemoryAdapterOptions {
|
|
1372
|
+
/** Underlying id mint; wrapped so each call inside a transact is journaled. */
|
|
1373
|
+
idFactory?: PartIdFactory;
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Pure in-memory `SemanticDocumentAdapter` — no Loro/WASM. Holds a
|
|
1377
|
+
* `VideoDocumentDraft` object and applies each `transact` via immer `produce`,
|
|
1378
|
+
* journaling every audit that actually mutated state (plus any ids minted
|
|
1379
|
+
* during that transact).
|
|
1380
|
+
*
|
|
1381
|
+
* Known benign difference vs `MirrorVideoDocumentAdapter`: the editor's
|
|
1382
|
+
* `setPart` assigns a fresh part object on every call, so a same-value rewrite
|
|
1383
|
+
* produces a new immer state and IS journaled here, while the mirror's deep
|
|
1384
|
+
* diff emits no commit. Terminal `snapshot()` stays equal; replay is idempotent.
|
|
1385
|
+
*/
|
|
1386
|
+
declare class PlainMemoryAdapter implements SemanticDocumentAdapter {
|
|
1387
|
+
private state;
|
|
1388
|
+
private readonly _journal;
|
|
1389
|
+
private readonly baseIdFactory;
|
|
1390
|
+
/** Non-null only while a `transact` edit callback is running. */
|
|
1391
|
+
private pendingIds;
|
|
1392
|
+
/**
|
|
1393
|
+
* Recording wrapper around the underlying factory. Callers (sandbox editor)
|
|
1394
|
+
* use this so every minted id is appended to the current transact's list.
|
|
1395
|
+
*/
|
|
1396
|
+
readonly idFactory: PartIdFactory;
|
|
1397
|
+
constructor(document: VideoDocument, options?: PlainMemoryAdapterOptions);
|
|
1398
|
+
get journal(): readonly JournalEntry[];
|
|
1399
|
+
hasContent(): boolean;
|
|
1400
|
+
snapshot(): VideoDocument;
|
|
1401
|
+
/**
|
|
1402
|
+
* Apply one op via immer. A throw in `edit` discards the draft (state and
|
|
1403
|
+
* journal unchanged). When `produce` returns the same reference, there was
|
|
1404
|
+
* no structural change — skip journal, matching mirror "no change, no commit".
|
|
1405
|
+
*/
|
|
1406
|
+
transact(edit: (draft: VideoDocumentDraft) => void, audit: TransactAudit): void;
|
|
1407
|
+
}
|
|
1408
|
+
/** Build a `PlainMemoryAdapter` seeded with `document`. */
|
|
1409
|
+
declare function createPlainMemoryAdapter(document: VideoDocument, options?: PlainMemoryAdapterOptions): PlainMemoryAdapter;
|
|
1931
1410
|
//#endregion
|
|
1932
1411
|
//#region src/document/mirror-read.d.ts
|
|
1933
1412
|
/**
|
|
@@ -1977,7 +1456,7 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1977
1456
|
volume: z.ZodNumber;
|
|
1978
1457
|
audio_storage_key: z.ZodString;
|
|
1979
1458
|
origin_speech_id: z.ZodString;
|
|
1980
|
-
voice: z.
|
|
1459
|
+
voice: z.ZodUnknown;
|
|
1981
1460
|
caption_ids: z.ZodArray<z.ZodString>;
|
|
1982
1461
|
}, z.core.$loose>;
|
|
1983
1462
|
}, z.core.$loose>, z.ZodObject<{
|
|
@@ -2046,7 +1525,6 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
2046
1525
|
offsetMs: z.ZodNumber;
|
|
2047
1526
|
}, z.core.$loose>], "mode">;
|
|
2048
1527
|
fallback_abs_ms: z.ZodOptional<z.ZodNumber>;
|
|
2049
|
-
duration_override_ms: z.ZodOptional<z.ZodNumber>;
|
|
2050
1528
|
}, z.core.$loose>>>;
|
|
2051
1529
|
}, z.core.$loose>>>;
|
|
2052
1530
|
part_library: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -2078,7 +1556,7 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
2078
1556
|
volume: z.ZodNumber;
|
|
2079
1557
|
audio_storage_key: z.ZodString;
|
|
2080
1558
|
origin_speech_id: z.ZodString;
|
|
2081
|
-
voice: z.
|
|
1559
|
+
voice: z.ZodUnknown;
|
|
2082
1560
|
caption_ids: z.ZodArray<z.ZodString>;
|
|
2083
1561
|
}, z.core.$loose>;
|
|
2084
1562
|
}, z.core.$loose>, z.ZodObject<{
|
|
@@ -2113,4 +1591,4 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
2113
1591
|
}, z.core.$loose>]>>>;
|
|
2114
1592
|
}, z.core.$loose>;
|
|
2115
1593
|
//#endregion
|
|
2116
|
-
export {
|
|
1594
|
+
export { Track as $, TrackDraft as A, DerivedItemPosition as B, SemanticOpKind as C, ValidationError as D, SnapshotReadable as E, VideoDocumentValidationError as F, toVideoDocument as G, buildSpeechHostMap as H, assertValidVideoDocument as I, DEFAULT_UNIT_TIME_MS as J, BgmPart as K, validateVideoDocument as L, VideoDocumentDraft as M, VideoDocumentMirrorSchema as N, PartIdFactory as O, videoDocumentMirrorSchema as P, Timeline as Q, InitialDocumentFacts as R, PlannedSemanticOpKind as S, SchemaValidator as T, derivePositionFromAbs as U, SpeechHostMap as V, fromVideoDocument as W, PartUnion as X, PartKind as Y, SpeechPart as Z, SemanticOpInput as _, Timeline$1 as _t, PlainMemoryAdapter as a, VideoDocumentSchemaVersion as at, IMPLEMENTED_SEMANTIC_OP_KINDS as b, MirrorVideoDocumentAdapter as c, VideoDraft as ct, createMirrorVideoDocumentAdapter as d, speedOf as dt, TrackItem as et, writeVideoDocumentToDraft as f, Attachment as ft, SemanticEditor as g, SpeedShift as gt, SemanticDocumentAdapter as h, PartAggregation as ht, JournalEntry as i, VideoDocument as it, TrackItemDraft as j, generatePartId as k, MirrorVideoDocumentOptions as l, VideoDraftPartUnion as lt, OpActor as m, CaptionStyle as mt, videoDocumentSchema as n, VIDEO_DOCUMENT_SCHEMA_VERSION as nt, PlainMemoryAdapterOptions as o, VideoDocumentValidationIssue as ot, CommitOptions as p, CaptionPart$1 as pt, CaptionPart as q, readVideoDocumentFromDraft as r, VideoClipPart as rt, createPlainMemoryAdapter as s, VideoDocumentValidationIssueCode as st, partUnionSchema as t, TrackItemTimePosition as tt, createMirrorVideoDocument as u, effectiveVideoClipDurationMs as ut, SemanticOpName as v, Track$1 as vt, isImplementedSemanticOpKind as w, ImplementedSemanticOpKind as x, TransactAudit as y, TrackItem$1 as yt, buildInitialVideoDocument as z };
|