@mengine/medeo-client 2.1.1-dsl.9 → 3.0.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.
@@ -1,6 +1,340 @@
1
- import { B as PhonemeSelection, J as SegmentSelection, L as FieldPatch, M as DslMutation, R as MedeoDslSnapshot, T as CaptionStyle, Y as StoredFile, Z as TextEdit, c as VideoDraftInput, h as DslIdFactory, it as Voice, j as DslDiagnostic, o as VideoDraftContent, p as CommitOptions, q as SegmentRange, rt as TrackRole, tt as TimeAnchor, w as CaptionSelection, z as Media } from "./video-draft-types-GqXnsOzA.js";
2
1
  import { ContainerType, Cursor, LoroDoc, PeerID, TreeID } from "loro-crdt";
3
2
 
3
+ //#region ../medeo-dsl/src/types.d.ts
4
+ type TrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
5
+ type ResourceSystem = 'memota' | 'memota-speech';
6
+ interface Track$1 {
7
+ role: TrackRole;
8
+ hidden?: boolean;
9
+ }
10
+ /**
11
+ * How a Clip plays its content: the window it takes from the source, its pace, and whether it
12
+ * fills the Timeline. One value: concurrent edits of the same marker keep one whole marker.
13
+ */
14
+ interface SeqMarker {
15
+ inMs: number;
16
+ outMs: number;
17
+ rate?: number;
18
+ fillTimeline?: true;
19
+ }
20
+ /**
21
+ * Where a Clip starts: at an absolute time on the Timeline, or following another Clip. No anchor
22
+ * means it plays in Tree order. One value, so concurrent placements keep one whole placement.
23
+ */
24
+ interface TimeAnchor {
25
+ /** The Timeline (absolute) or another Clip (following). */
26
+ to: string;
27
+ offsetMs: number;
28
+ /** The absolute start recorded by the placement edit; used when the anchor cannot be solved. */
29
+ fallback_abs_ms: number;
30
+ }
31
+ /** A Clip's single-valued relations are fields of its own row: its content and its time anchor. */
32
+ interface Clip {
33
+ seqMarker: SeqMarker;
34
+ volume?: number;
35
+ /** The media or Caption this use plays. */
36
+ source: string;
37
+ anchor?: TimeAnchor;
38
+ }
39
+ interface MediaLocator {
40
+ system: ResourceSystem;
41
+ key: string;
42
+ digest?: string;
43
+ }
44
+ type Media = MediaLocator & ({
45
+ kind: 'video';
46
+ durationMs: number;
47
+ storageKey?: string;
48
+ } | {
49
+ kind: 'audio' | 'voiceover-recording';
50
+ durationMs: number;
51
+ storageKey: string;
52
+ } | {
53
+ kind: 'image';
54
+ storageKey?: string;
55
+ });
56
+ /** One segment of a script: its own text, and the id a Caption or PhoneticScript names it by. */
57
+ interface AudioScriptSegment {
58
+ id: string;
59
+ text: string;
60
+ /**
61
+ * Where these words were spoken in the medium the script was read off, as the transcription
62
+ * file it names gave them (D186). Only a transcript's segments state it, both ends together.
63
+ */
64
+ startMs?: number;
65
+ endMs?: number;
66
+ }
67
+ /**
68
+ * A script is segmented text: its segments in order (D181). A transcript names the transcription
69
+ * file its words and times were read from (D186); a written script names none.
70
+ */
71
+ interface AudioScript extends Partial<StoredFile> {
72
+ segments: AudioScriptSegment[];
73
+ defaultLanguage?: string;
74
+ }
75
+ interface CaptionStyle$1 {
76
+ font?: {
77
+ system: 'font-library';
78
+ key: string;
79
+ };
80
+ fontSize?: number;
81
+ fontColor?: string;
82
+ fontWeight?: number;
83
+ entranceAnimation?: string;
84
+ entranceAnimationDurationMs?: number;
85
+ strokeColor?: string;
86
+ strokeWidth?: number;
87
+ /** The caption's center across the frame, from 0 at the left edge to 1 at the right. */
88
+ positionX?: number;
89
+ /** The caption's center down the frame, from 0 at the top edge to 1 at the bottom. */
90
+ positionY?: number;
91
+ }
92
+ /**
93
+ * What a Caption shows or a PhoneticScript is written for: one segment of a script, or a run inside
94
+ * it (D181). The run's ends are Cursors on that segment's Text, so they follow its edits; without
95
+ * them the whole segment is meant, whatever it comes to say. One value: taken or replaced whole.
96
+ */
97
+ interface SegmentSelection {
98
+ audioScriptId: string;
99
+ segmentId: string;
100
+ start?: Cursor;
101
+ end?: Cursor;
102
+ }
103
+ type CaptionContent = SegmentSelection;
104
+ /** Words come from a selected run of a script or from the Caption's own text, never both. */
105
+ interface Caption {
106
+ selection?: CaptionContent;
107
+ text?: string;
108
+ style?: CaptionStyle$1;
109
+ }
110
+ /** The segment a PhoneticScript is written for, selected as a Caption selects one, and its pronunciation. */
111
+ interface Phoneme extends SegmentSelection {
112
+ /** What the voice synthesizes for that selection, written in what the voice accepts. */
113
+ phonemeScript?: string;
114
+ }
115
+ /** A file Memota stored from raw content: how a Media File entity names it, and its digest. */
116
+ interface StoredFile {
117
+ system: 'memota';
118
+ key: string;
119
+ storageKey?: string;
120
+ digest: string;
121
+ }
122
+ /**
123
+ * A variant of an AudioScript: the segment it is written for, plus what to synthesize. It has the Media File
124
+ * trait (D178): its `phonemeScript` is raw content, stored in Memota as a text file whenever it is
125
+ * written, and the file's facts are kept beside it. Without a `phonemeScript` it has no file.
126
+ */
127
+ interface PhoneticScript extends Partial<StoredFile> {
128
+ phoneme: Phoneme;
129
+ }
130
+ interface Voice {
131
+ system: 'voice-library';
132
+ key: string;
133
+ name?: string;
134
+ }
135
+ /** Table keys carry entity identity; values never duplicate an id or a single-table kind. */
136
+ interface EntityValues {
137
+ 'timeline-entities': Record<string, never>;
138
+ 'track-entities': Track$1;
139
+ 'clip-entities': Clip;
140
+ 'media-entities': Media;
141
+ 'audio-script-entities': AudioScript;
142
+ 'phonetic-script-entities': PhoneticScript;
143
+ 'caption-entities': Caption;
144
+ 'voice-entities': Voice;
145
+ }
146
+ /** Only relations an entity may hold many of have tables; single-valued ones are fields of their owner. */
147
+ interface RelationValues {
148
+ 'voice-timbre-relations': {
149
+ recordingId: string;
150
+ voiceId: string;
151
+ };
152
+ /**
153
+ * `sourceDigest`: the source's digest when the product was made from it (D177). A product whose
154
+ * source's digest differs now was made from content the source no longer has.
155
+ */
156
+ 'derived-from-relations': {
157
+ entityId: string;
158
+ sourceId: string;
159
+ sourceDigest?: string;
160
+ };
161
+ }
162
+ /** What a create states: a PhoneticScript's phoneme may follow by set-phoneme in the same write. */
163
+ type EntityInput = Omit<EntityValues, 'phonetic-script-entities'> & {
164
+ 'phonetic-script-entities': Omit<PhoneticScript, 'phoneme'> & {
165
+ phoneme?: Phoneme;
166
+ };
167
+ };
168
+ type EntityTable = keyof EntityValues;
169
+ type RelationTable = keyof RelationValues;
170
+ type EntityTables = { [K in EntityTable]: Record<string, EntityValues[K]> };
171
+ type RelationTables = { [K in RelationTable]: Record<string, RelationValues[K]> };
172
+ type FieldPatch<T> = { [K in keyof T]?: NonNullable<T[K]> extends object ? FieldPatch<NonNullable<T[K]>> : T[K] | undefined };
173
+ type EntityMutation = { [K in EntityTable]: {
174
+ type: 'create-entity';
175
+ table: K;
176
+ id: string;
177
+ value: EntityInput[K];
178
+ } | {
179
+ type: 'patch-entity';
180
+ table: K;
181
+ id: string;
182
+ patch: FieldPatch<EntityValues[K]>;
183
+ } | {
184
+ type: 'delete-entity';
185
+ table: K;
186
+ id: string;
187
+ } }[EntityTable];
188
+ type RelationMutation = { [K in RelationTable]: {
189
+ type: 'set-relation';
190
+ table: K;
191
+ value: RelationValues[K];
192
+ } | {
193
+ type: 'delete-relation';
194
+ table: K;
195
+ id: string;
196
+ } }[RelationTable];
197
+ type ContainMutation = {
198
+ type: 'insert-node';
199
+ entityId: string;
200
+ parentId?: string;
201
+ index?: number;
202
+ } | {
203
+ type: 'move-node';
204
+ entityId: string;
205
+ parentId?: string;
206
+ index?: number;
207
+ } | {
208
+ type: 'delete-node';
209
+ entityId: string;
210
+ };
211
+ /** A segment, or a run of it in UTF-16 offsets of its current text, as a write states it. */
212
+ interface SegmentRange {
213
+ audioScriptId: string;
214
+ segmentId: string;
215
+ start?: number;
216
+ end?: number;
217
+ }
218
+ interface CaptionSelection extends SegmentRange {
219
+ captionId: string;
220
+ }
221
+ interface PhonemeSelection extends SegmentRange {
222
+ phoneticScriptId: string;
223
+ phonemeScript?: string;
224
+ }
225
+ /** A script's segments are added, moved and removed by id; their text is edited in place. */
226
+ type SegmentMutation = {
227
+ type: 'insert-segment';
228
+ audioScriptId: string;
229
+ segmentId: string;
230
+ index?: number;
231
+ text: string;
232
+ startMs?: number;
233
+ endMs?: number;
234
+ } | {
235
+ type: 'move-segment';
236
+ audioScriptId: string;
237
+ segmentId: string;
238
+ index: number;
239
+ } | {
240
+ type: 'delete-segment';
241
+ audioScriptId: string;
242
+ segmentId: string;
243
+ };
244
+ type TextMutation = {
245
+ type: 'edit-caption-text';
246
+ captionId: string;
247
+ expectedBodyId?: string;
248
+ edits: readonly TextEdit[];
249
+ } | {
250
+ type: 'edit-text';
251
+ audioScriptId: string;
252
+ segmentId: string;
253
+ expectedBodyId?: string;
254
+ edits: readonly TextEdit[];
255
+ } | ({
256
+ type: 'set-caption-content';
257
+ } & CaptionSelection) | ({
258
+ type: 'set-phoneme';
259
+ } & PhonemeSelection);
260
+ type DslMutation = EntityMutation | RelationMutation | ContainMutation | SegmentMutation | TextMutation;
261
+ interface ContainNode {
262
+ treeId: TreeID;
263
+ entityId: string;
264
+ children: ContainNode[];
265
+ }
266
+ interface DslDiagnostic {
267
+ code: string;
268
+ path: string;
269
+ message: string;
270
+ }
271
+ interface TextRun {
272
+ insert: string;
273
+ attributes?: Record<string, unknown>;
274
+ }
275
+ interface RichTextSnapshot {
276
+ bodyId: string;
277
+ plainText: string;
278
+ delta: TextRun[];
279
+ }
280
+ /** Selected text, with its UTF-16 range in the Text it lies in: the segment's, or a Caption's own. */
281
+ interface CaptionText {
282
+ text: string;
283
+ start: number;
284
+ end: number;
285
+ bodyId: string;
286
+ }
287
+ type DeepReadonly<T> = T extends Cursor ? T : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
288
+ type MedeoDslSnapshot = DeepReadonly<EntityTables & RelationTables & {
289
+ 'contain-relations': ContainNode[]; /** A Caption's own text by the Caption's id, and each script segment's text by the segment's id. */
290
+ richText: Record<string, RichTextSnapshot>;
291
+ captionText: Record<string, CaptionText>; /** What each PhoneticScript's selection holds now, resolved as a Caption's is. */
292
+ phoneticText: Record<string, CaptionText>;
293
+ diagnostics: DslDiagnostic[];
294
+ }>;
295
+ type TextMark = 'language';
296
+ type TextEdit = {
297
+ type: 'insert';
298
+ at: number;
299
+ text: string;
300
+ } | {
301
+ type: 'delete';
302
+ at: number;
303
+ length: number;
304
+ } | {
305
+ type: 'mark';
306
+ start: number;
307
+ end: number;
308
+ key: TextMark;
309
+ value: string;
310
+ } | {
311
+ type: 'unmark';
312
+ start: number;
313
+ end: number;
314
+ key: TextMark;
315
+ } | {
316
+ type: 'delta';
317
+ delta: TextDelta[];
318
+ };
319
+ type TextDelta = {
320
+ insert: string;
321
+ attributes?: Record<string, string | number | null>;
322
+ } | {
323
+ retain: number;
324
+ attributes?: Record<string, string | number | null>;
325
+ } | {
326
+ delete: number;
327
+ };
328
+ //#endregion
329
+ //#region ../medeo-dsl/src/ids.d.ts
330
+ declare function tupleHash(tuple: readonly string[]): string;
331
+ declare function resourceId(kind: 'media' | 'voice', system: string, key: string): string;
332
+ declare function relationId<K extends RelationTable>(table: K, value: RelationValues[K]): string;
333
+ /** Kinds of id a document mints: its entities', and a script segment's. */
334
+ type EntityIdKind = 'timeline' | 'track' | 'clip' | 'audio-script' | 'segment' | 'phonetic-script' | 'caption';
335
+ type DslIdFactory = (kind: EntityIdKind) => string;
336
+ declare const defaultIdFactory: DslIdFactory;
337
+ //#endregion
4
338
  //#region src/dsl/action-context.d.ts
5
339
  type ClipPlacement = {
6
340
  kind: 'sequential';
@@ -58,7 +392,19 @@ interface DslClipUpdate {
58
392
  placement?: ClipPlacement;
59
393
  }
60
394
  //#endregion
61
- //#region ../../node_modules/.pnpm/loro-mirror@2.3.3_patch_hash=a551a0e4aa4f61ec88b0d9e970a183b5ee2955107a2e0bb03b378bc510c2f395_loro-crdt@1.16.1/node_modules/loro-mirror/dist/schema/types.d.ts
395
+ //#region src/dsl/commit-options.d.ts
396
+ /** Self-reported audit author; authorization remains the server's responsibility. */
397
+ interface OpActor {
398
+ user_id: string;
399
+ role: 'user' | 'agent';
400
+ }
401
+ interface CommitOptions {
402
+ /** The server audit view exposes string intents; other JSON values remain in the native message. */
403
+ intent?: unknown;
404
+ actor?: OpActor;
405
+ }
406
+ //#endregion
407
+ //#region ../../node_modules/.pnpm/loro-mirror@2.3.3_patch_hash=a551a0e4aa4f61ec88b0d9e970a183b5ee2955107a2e0bb03b378bc510c2f395_loro-crdt@1.16.4/node_modules/loro-mirror/dist/schema/types.d.ts
62
408
  /**
63
409
  * Options for schema definitions
64
410
  */
@@ -464,12 +810,20 @@ declare const medeoDslLoroShape: RootSchemaType<{
464
810
  'audio-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
465
811
  segments: /*elided*/any;
466
812
  defaultLanguage: /*elided*/any;
813
+ system: /*elided*/any;
814
+ key: /*elided*/any;
815
+ storageKey: /*elided*/any;
816
+ digest: /*elided*/any;
467
817
  }> & {
468
818
  options: {};
469
819
  } & {
470
820
  catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
471
821
  segments: /*elided*/any;
472
822
  defaultLanguage: /*elided*/any;
823
+ system: /*elided*/any;
824
+ key: /*elided*/any;
825
+ storageKey: /*elided*/any;
826
+ digest: /*elided*/any;
473
827
  }, C>;
474
828
  }> & {
475
829
  options: {};
@@ -629,8 +983,14 @@ interface DslTransaction {
629
983
  /** Offsets use the preview after preceding edits. Existing Text identities are checked when supplied. */
630
984
  editText(audioScriptId: string, segmentId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
631
985
  editCaptionText(captionId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
632
- /** Adds a segment at `index` (the end by default); its id must be new to the script. */
633
- insertSegment(audioScriptId: string, segmentId: string, text: string, index?: number): void;
986
+ /**
987
+ * Adds a segment at `index` (the end by default); its id must be new to the script. A transcript's
988
+ * segment states where its words were spoken in the medium, as its transcription file gave them.
989
+ */
990
+ insertSegment(audioScriptId: string, segmentId: string, text: string, index?: number, time?: {
991
+ startMs: number;
992
+ endMs: number;
993
+ }): void;
634
994
  /** `index` is measured after removing the segment. */
635
995
  moveSegment(audioScriptId: string, segmentId: string, index: number): void;
636
996
  deleteSegment(audioScriptId: string, segmentId: string): void;
@@ -700,7 +1060,7 @@ interface VoiceoverCaptionInput {
700
1060
  start: number;
701
1061
  end: number;
702
1062
  };
703
- style?: CaptionStyle;
1063
+ style?: CaptionStyle$1;
704
1064
  }
705
1065
  interface ApplyVoiceoverInput {
706
1066
  clipId?: string;
@@ -738,7 +1098,10 @@ interface ApplyVoiceoverInput {
738
1098
  sourceDigest?: string;
739
1099
  volume?: number;
740
1100
  voice?: Voice;
741
- /** Complete generated caption set for this use. Other uses of the recording are untouched. */
1101
+ /**
1102
+ * Complete generated caption set for this use. It replaces the Caption Clips showing what the
1103
+ * use's current take says: those whose Caption selects it (D183).
1104
+ */
742
1105
  captions: readonly VoiceoverCaptionInput[];
743
1106
  }
744
1107
  interface VoiceoverResult {
@@ -794,7 +1157,7 @@ declare class DslEditor {
794
1157
  start?: never;
795
1158
  end?: never;
796
1159
  }) & {
797
- style?: CaptionStyle;
1160
+ style?: CaptionStyle$1;
798
1161
  }, options?: CommitOptions): string;
799
1162
  /** Show a segment of a script, or a run of it, in place of the Caption's own text. */
800
1163
  setCaptionContent(captionId: string, selection: SegmentRange, options?: CommitOptions): void;
@@ -812,7 +1175,7 @@ declare class DslEditor {
812
1175
  }, options?: CommitOptions): void;
813
1176
  replaceClips(input: ReplaceDslClipsInput, options?: CommitOptions): string[];
814
1177
  updateClips(updates: readonly DslClipUpdate[], options?: CommitOptions): void;
815
- patchCaptionStyle(captionIds: readonly string[], patch: FieldPatch<CaptionStyle>, options?: CommitOptions): void;
1178
+ patchCaptionStyle(captionIds: readonly string[], patch: FieldPatch<CaptionStyle$1>, options?: CommitOptions): void;
816
1179
  applyVoiceover(input: ApplyVoiceoverInput, options?: CommitOptions): VoiceoverResult;
817
1180
  private voiceoverScriptId;
818
1181
  /**
@@ -877,6 +1240,538 @@ declare class DslProjectionError extends Error {
877
1240
  /** Pure deterministic solve. Constraints only move sequential roots; anchors retain their exact offsets. */
878
1241
  declare function resolveDslLayout(snapshot: MedeoDslSnapshot): DslLayout;
879
1242
  //#endregion
1243
+ //#region src/dsl/projection/generated/video-draft-idl.d.ts
1244
+ /**
1245
+ * @generated by @mengine/idl-codegen — DO NOT EDIT MANUALLY.
1246
+ *
1247
+ * VideoDraft read-view types extracted from the Smithy IDL
1248
+ * (medeo-v2-design-materials). Re-run `vp run @mengine/idl-codegen#sync`.
1249
+ * Source IDL commit: 902e82e3fec1e94b36e14ef671de91abd210dc86
1250
+ *
1251
+ * WHY EVERY FIELD IS `T | undefined`:
1252
+ * AWS `smithy-typescript-codegen` widens every structure member to
1253
+ * `T | undefined` regardless of the Smithy `@required` trait — it favours
1254
+ * deserialization robustness (a peer may omit a field on the wire) over
1255
+ * encoding requiredness in the static type. So these generated types are NOT
1256
+ * the source of truth for which fields are required: the Smithy `.smithy`
1257
+ * model is. Many fields here (e.g. `VideoClipPart.play_in` / `play_out` /
1258
+ * `volume` / `origin_media_id`) are `@required` in the contract.
1259
+ *
1260
+ * Requiredness is restored by import and write-time validation, not here.
1261
+ * DSL content constraints are owned by medeo-dsl and enforced at the medeo-client
1262
+ * transaction and import boundaries.
1263
+ * Do not assume a
1264
+ * field is optional just because its type is `| undefined`.
1265
+ */
1266
+ /**
1267
+ * @public
1268
+ * @enum
1269
+ */
1270
+ declare const PartKind: {
1271
+ readonly BGM: "bgm";
1272
+ readonly CAPTION: "caption";
1273
+ readonly SPEECH: "speech";
1274
+ readonly VIDEO_CLIP: "video_clip";
1275
+ };
1276
+ /**
1277
+ * @public
1278
+ */
1279
+ type PartKind = (typeof PartKind)[keyof typeof PartKind];
1280
+ /**
1281
+ * @public
1282
+ */
1283
+ interface VoiceSummary {
1284
+ name: string | undefined;
1285
+ id: string | undefined;
1286
+ }
1287
+ /**
1288
+ * @public
1289
+ */
1290
+ interface SpeechPart$1 {
1291
+ id: string | undefined;
1292
+ duration_ms: number | undefined;
1293
+ /**
1294
+ * Types of parts that can be contained in tracks
1295
+ * @public
1296
+ */
1297
+ kind: PartKind | undefined;
1298
+ audio_script: string | undefined;
1299
+ volume: number | undefined;
1300
+ audio_storage_key: string | undefined;
1301
+ origin_speech_id: string | undefined;
1302
+ voice: VoiceSummary | undefined;
1303
+ caption_ids: string[] | undefined;
1304
+ }
1305
+ /**
1306
+ * Caption visual style configuration
1307
+ * @public
1308
+ */
1309
+ interface CaptionStyle {
1310
+ /**
1311
+ * Font ID referencing a font from the font library. Defaults to system font if not provided
1312
+ * @public
1313
+ */
1314
+ font_id?: string | undefined;
1315
+ /**
1316
+ * Font size in points
1317
+ * @public
1318
+ */
1319
+ font_size?: number | undefined;
1320
+ /**
1321
+ * Font color as hex string (e.g. "#FFFFFF")
1322
+ * @public
1323
+ */
1324
+ font_color?: string | undefined;
1325
+ /**
1326
+ * Numeric font weight, e.g. 400 for regular or 700 for bold
1327
+ * @public
1328
+ */
1329
+ font_weight?: number | undefined;
1330
+ /**
1331
+ * Caption entrance animation preset ID, e.g. "fade", "slideUp", or "none"
1332
+ * @public
1333
+ */
1334
+ entrance_animation?: string | undefined;
1335
+ /**
1336
+ * Caption entrance animation duration in milliseconds
1337
+ * @public
1338
+ */
1339
+ entrance_animation_duration_ms?: number | undefined;
1340
+ /**
1341
+ * Caption outline/stroke color as hex string (e.g. "#000000")
1342
+ * @public
1343
+ */
1344
+ stroke_color?: string | undefined;
1345
+ /**
1346
+ * Caption outline/stroke width in pixels
1347
+ * @public
1348
+ */
1349
+ stroke_width?: number | undefined;
1350
+ /**
1351
+ * Caption center X position as a percentage (0.0 to 1.0)
1352
+ * @public
1353
+ */
1354
+ position_x?: number | undefined;
1355
+ /**
1356
+ * Caption center Y position as a percentage (0.0 to 1.0)
1357
+ * @public
1358
+ */
1359
+ position_y?: number | undefined;
1360
+ }
1361
+ /**
1362
+ * @public
1363
+ */
1364
+ interface CaptionPart$1 {
1365
+ id: string | undefined;
1366
+ duration_ms: number | undefined;
1367
+ /**
1368
+ * Types of parts that can be contained in tracks
1369
+ * @public
1370
+ */
1371
+ kind: PartKind | undefined;
1372
+ speech_part_id: string | undefined;
1373
+ text: string | undefined;
1374
+ start_ms: number | undefined;
1375
+ /**
1376
+ * Caption visual style (font, size, color, weight, animation, outline). Uses default style if not provided
1377
+ * @public
1378
+ */
1379
+ style?: CaptionStyle | undefined;
1380
+ }
1381
+ /**
1382
+ * @public
1383
+ * @enum
1384
+ */
1385
+ declare const AspectRatio: {
1386
+ readonly RATIO_16_9: "16:9";
1387
+ readonly RATIO_9_16: "9:16";
1388
+ };
1389
+ /**
1390
+ * @public
1391
+ */
1392
+ type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
1393
+ /**
1394
+ * @public
1395
+ * @enum
1396
+ */
1397
+ declare const AssetSource: {
1398
+ readonly AI_IMAGES: "ai_images";
1399
+ readonly AI_VIDEOS: "ai_videos";
1400
+ readonly MY_UPLOADED_ASSETS: "my_uploaded_assets";
1401
+ readonly STOCK_VIDEOS: "stock_videos";
1402
+ };
1403
+ /**
1404
+ * @public
1405
+ */
1406
+ type AssetSource = (typeof AssetSource)[keyof typeof AssetSource];
1407
+ /**
1408
+ * An extra aspect ratio variant with independent storage keys for thumbnail,
1409
+ * preview video, and highlight video. Stored inside video_settings JSONB.
1410
+ * @public
1411
+ */
1412
+ interface RatioVariant {
1413
+ aspect_ratio: string | undefined;
1414
+ thumb_storage_key: string | undefined;
1415
+ video_storage_key: string | undefined;
1416
+ highlight_video_storage_key?: string | undefined;
1417
+ }
1418
+ /**
1419
+ * @public
1420
+ */
1421
+ interface VideoCreationSettings$1 {
1422
+ voice_id?: string | undefined;
1423
+ duration_ms?: number | undefined;
1424
+ aspect_ratio?: AspectRatio | undefined;
1425
+ video_style_id?: string | undefined;
1426
+ asset_sources?: AssetSource[] | undefined;
1427
+ recipe_id?: string | undefined;
1428
+ enable_high_cost_confirm?: boolean | undefined;
1429
+ user_confirm_cost_threshold?: number | undefined;
1430
+ /**
1431
+ * Extra aspect ratio variants with independent storage keys.
1432
+ * Each variant carries its own thumbnail, preview video, and optional highlight video.
1433
+ * Used when a recipe supports multiple aspect ratios (e.g. both 16:9 and 9:16).
1434
+ * @public
1435
+ */
1436
+ extra_ratios?: RatioVariant[] | undefined;
1437
+ }
1438
+ /**
1439
+ * @public
1440
+ */
1441
+ interface TrackItem {
1442
+ abs_time_position: number | undefined;
1443
+ part_id: string | undefined;
1444
+ }
1445
+ /**
1446
+ * @public
1447
+ */
1448
+ interface Track {
1449
+ id: string | undefined;
1450
+ /**
1451
+ * Types of parts that can be contained in tracks
1452
+ * @public
1453
+ */
1454
+ parts_kind: PartKind | undefined;
1455
+ is_hidden: boolean | undefined;
1456
+ items: TrackItem[] | undefined;
1457
+ }
1458
+ /**
1459
+ * @public
1460
+ */
1461
+ interface Attachment {
1462
+ part_id: string | undefined;
1463
+ relative_time_position: number | undefined;
1464
+ }
1465
+ /**
1466
+ * @public
1467
+ */
1468
+ interface PartAggregation {
1469
+ body_part_id: string | undefined;
1470
+ attachments: Attachment[] | undefined;
1471
+ }
1472
+ /**
1473
+ * @public
1474
+ */
1475
+ interface BgmPart$1 {
1476
+ id: string | undefined;
1477
+ duration_ms: number | undefined;
1478
+ /**
1479
+ * Types of parts that can be contained in tracks
1480
+ * @public
1481
+ */
1482
+ kind: PartKind | undefined;
1483
+ audio_storage_key: string | undefined;
1484
+ volume: number | undefined;
1485
+ origin_media_id: string | undefined;
1486
+ }
1487
+ /**
1488
+ * @public
1489
+ * @enum
1490
+ */
1491
+ declare const SpeedShiftCategory: {
1492
+ /**
1493
+ * Variable speed controlled by Bezier keyframes
1494
+ */
1495
+ readonly CURVE: "curve";
1496
+ /**
1497
+ * Constant speed multiplier across the entire clip
1498
+ */
1499
+ readonly LINEAR: "linear";
1500
+ };
1501
+ /**
1502
+ * @public
1503
+ */
1504
+ type SpeedShiftCategory = (typeof SpeedShiftCategory)[keyof typeof SpeedShiftCategory];
1505
+ /**
1506
+ * @public
1507
+ */
1508
+ interface TangentHandle {
1509
+ x: number | undefined;
1510
+ y: number | undefined;
1511
+ }
1512
+ /**
1513
+ * @public
1514
+ */
1515
+ interface SpeedKeyframe {
1516
+ position: number | undefined;
1517
+ rate: number | undefined;
1518
+ in_tangent?: TangentHandle | undefined;
1519
+ out_tangent?: TangentHandle | undefined;
1520
+ }
1521
+ /**
1522
+ * @public
1523
+ */
1524
+ interface CurveConfig {
1525
+ keyframes: SpeedKeyframe[] | undefined;
1526
+ }
1527
+ /**
1528
+ * @public
1529
+ */
1530
+ interface LinearConfig {
1531
+ speed: number | undefined;
1532
+ }
1533
+ /**
1534
+ * @public
1535
+ */
1536
+ type SpeedShiftConfigUnion = SpeedShiftConfigUnion.CurveMember | SpeedShiftConfigUnion.LinearMember | SpeedShiftConfigUnion.$UnknownMember;
1537
+ /**
1538
+ * @public
1539
+ */
1540
+ declare namespace SpeedShiftConfigUnion {
1541
+ interface LinearMember {
1542
+ linear: LinearConfig;
1543
+ curve?: never;
1544
+ $unknown?: never;
1545
+ }
1546
+ interface CurveMember {
1547
+ linear?: never;
1548
+ curve: CurveConfig;
1549
+ $unknown?: never;
1550
+ }
1551
+ /**
1552
+ * @public
1553
+ */
1554
+ interface $UnknownMember {
1555
+ linear?: never;
1556
+ curve?: never;
1557
+ $unknown: [string, any];
1558
+ }
1559
+ interface Visitor<T> {
1560
+ linear: (value: LinearConfig) => T;
1561
+ curve: (value: CurveConfig) => T;
1562
+ _: (name: string, value: any) => T;
1563
+ }
1564
+ const visit: <T>(value: SpeedShiftConfigUnion, visitor: Visitor<T>) => T;
1565
+ }
1566
+ /**
1567
+ * @public
1568
+ */
1569
+ interface SpeedShift {
1570
+ category: SpeedShiftCategory | undefined;
1571
+ mode: string | undefined;
1572
+ config: SpeedShiftConfigUnion | undefined;
1573
+ }
1574
+ /**
1575
+ * @public
1576
+ */
1577
+ interface VideoClipPart {
1578
+ id: string | undefined;
1579
+ duration_ms: number | undefined;
1580
+ /**
1581
+ * Types of parts that can be contained in tracks
1582
+ * @public
1583
+ */
1584
+ kind: PartKind | undefined;
1585
+ play_in: number | undefined;
1586
+ play_out: number | undefined;
1587
+ volume: number | undefined;
1588
+ origin_media_id: string | undefined;
1589
+ speed_shift?: SpeedShift | undefined;
1590
+ }
1591
+ /**
1592
+ * @public
1593
+ */
1594
+ type PartUnion = PartUnion.BgmMember | PartUnion.CaptionMember | PartUnion.SpeechMember | PartUnion.Video_clipMember | PartUnion.$UnknownMember;
1595
+ /**
1596
+ * @public
1597
+ */
1598
+ declare namespace PartUnion {
1599
+ interface Video_clipMember {
1600
+ video_clip: VideoClipPart;
1601
+ bgm?: never;
1602
+ speech?: never;
1603
+ caption?: never;
1604
+ $unknown?: never;
1605
+ }
1606
+ interface BgmMember {
1607
+ video_clip?: never;
1608
+ bgm: BgmPart$1;
1609
+ speech?: never;
1610
+ caption?: never;
1611
+ $unknown?: never;
1612
+ }
1613
+ interface SpeechMember {
1614
+ video_clip?: never;
1615
+ bgm?: never;
1616
+ speech: SpeechPart$1;
1617
+ caption?: never;
1618
+ $unknown?: never;
1619
+ }
1620
+ interface CaptionMember {
1621
+ video_clip?: never;
1622
+ bgm?: never;
1623
+ speech?: never;
1624
+ caption: CaptionPart$1;
1625
+ $unknown?: never;
1626
+ }
1627
+ /**
1628
+ * @public
1629
+ */
1630
+ interface $UnknownMember {
1631
+ video_clip?: never;
1632
+ bgm?: never;
1633
+ speech?: never;
1634
+ caption?: never;
1635
+ $unknown: [string, any];
1636
+ }
1637
+ interface Visitor<T> {
1638
+ video_clip: (value: VideoClipPart) => T;
1639
+ bgm: (value: BgmPart$1) => T;
1640
+ speech: (value: SpeechPart$1) => T;
1641
+ caption: (value: CaptionPart$1) => T;
1642
+ _: (name: string, value: any) => T;
1643
+ }
1644
+ const visit: <T>(value: PartUnion, visitor: Visitor<T>) => T;
1645
+ }
1646
+ /**
1647
+ * Timeline configuration for video editing
1648
+ * @public
1649
+ */
1650
+ interface Timeline {
1651
+ duration_ms: number | undefined;
1652
+ unit_time_ms: number | undefined;
1653
+ }
1654
+ /**
1655
+ * Complete video draft information with timeline and tracks
1656
+ * @public
1657
+ */
1658
+ interface VideoDraft$1 {
1659
+ id?: string | undefined;
1660
+ project_id: string | undefined;
1661
+ owner_id: string | undefined;
1662
+ /**
1663
+ * for-code-gen: property value may be empty string ("")
1664
+ * @public
1665
+ */
1666
+ thumbnail_storage_key: string | undefined;
1667
+ /**
1668
+ * Timeline configuration for video editing
1669
+ * @public
1670
+ */
1671
+ timeline?: Timeline | undefined;
1672
+ video_creation_settings?: VideoCreationSettings$1 | undefined;
1673
+ chat_session_id: string | undefined;
1674
+ main_track?: Track | undefined;
1675
+ above_main_tracks: Track[] | undefined;
1676
+ below_main_tracks: Track[] | undefined;
1677
+ part_aggregations: PartAggregation[] | undefined;
1678
+ part_library: Record<string, PartUnion> | undefined;
1679
+ version: number | undefined;
1680
+ }
1681
+ //#endregion
1682
+ //#region src/dsl/projection/video-draft-types.d.ts
1683
+ type VideoDraftTrack = Track;
1684
+ type VideoDraftTrackItem = TrackItem;
1685
+ type VideoDraftTimeline = Timeline;
1686
+ type VideoDraftCaptionStyle = CaptionStyle;
1687
+ interface CaptionDisplayCue {
1688
+ segmentId: string;
1689
+ text: string;
1690
+ startMs: number;
1691
+ durationMs: number;
1692
+ }
1693
+ type VideoCreationSettings = Omit<VideoCreationSettings$1, 'video_style_id' | 'duration_ms'> & {
1694
+ video_style_id?: string | null;
1695
+ duration_ms?: number | null;
1696
+ };
1697
+ type VideoPart = Omit<VideoClipPart, 'duration_ms'>;
1698
+ type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
1699
+ media_duration_ms?: number;
1700
+ };
1701
+ type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
1702
+ initial_duration_ms?: number;
1703
+ display_cues?: CaptionDisplayCue[];
1704
+ };
1705
+ type BgmPart = Omit<BgmPart$1, 'duration_ms'>;
1706
+ /** Legacy inputs may omit derived durations; output always states the field. */
1707
+ type VideoDraftPartUnion = {
1708
+ video_clip: VideoPart & {
1709
+ duration_ms?: number;
1710
+ };
1711
+ speech?: never;
1712
+ caption?: never;
1713
+ bgm?: never;
1714
+ } | {
1715
+ video_clip?: never;
1716
+ speech: SpeechPart & {
1717
+ duration_ms?: number;
1718
+ };
1719
+ caption?: never;
1720
+ bgm?: never;
1721
+ } | {
1722
+ video_clip?: never;
1723
+ speech?: never;
1724
+ caption: CaptionPart & {
1725
+ duration_ms?: number;
1726
+ };
1727
+ bgm?: never;
1728
+ } | {
1729
+ video_clip?: never;
1730
+ speech?: never;
1731
+ caption?: never;
1732
+ bgm: BgmPart & {
1733
+ duration_ms?: number;
1734
+ };
1735
+ };
1736
+ type VideoDraftContentPartUnion = {
1737
+ video_clip: VideoPart & {
1738
+ duration_ms: number | undefined;
1739
+ };
1740
+ speech?: never;
1741
+ caption?: never;
1742
+ bgm?: never;
1743
+ } | {
1744
+ video_clip?: never;
1745
+ speech: SpeechPart & {
1746
+ duration_ms: number | undefined;
1747
+ };
1748
+ caption?: never;
1749
+ bgm?: never;
1750
+ } | {
1751
+ video_clip?: never;
1752
+ speech?: never;
1753
+ caption: CaptionPart & {
1754
+ duration_ms: number | undefined;
1755
+ };
1756
+ bgm?: never;
1757
+ } | {
1758
+ video_clip?: never;
1759
+ speech?: never;
1760
+ caption?: never;
1761
+ bgm: BgmPart & {
1762
+ duration_ms: number | undefined;
1763
+ };
1764
+ };
1765
+ type VideoDraft = Omit<VideoDraft$1, 'part_library' | 'video_creation_settings'> & {
1766
+ part_library: Record<string, VideoDraftPartUnion> | undefined;
1767
+ video_creation_settings?: VideoCreationSettings;
1768
+ };
1769
+ type VideoDraftContent = Pick<VideoDraft, 'timeline' | 'main_track' | 'above_main_tracks' | 'below_main_tracks' | 'part_aggregations'> & {
1770
+ part_library: Record<string, VideoDraftContentPartUnion> | undefined;
1771
+ };
1772
+ type VideoDraftInput = Pick<VideoDraft, keyof VideoDraftContent>;
1773
+ declare const DEFAULT_UNIT_TIME_MS = 33.333;
1774
+ //#endregion
880
1775
  //#region src/dsl/projection/to-video-draft.d.ts
881
1776
  interface VideoDraftProjection {
882
1777
  content: VideoDraftContent;
@@ -896,7 +1791,14 @@ interface AudioScriptView {
896
1791
  segments: {
897
1792
  id: string;
898
1793
  text: string;
899
- language?: string;
1794
+ language?: string; /** A transcript's segment: where its words were spoken in the medium, as its transcription file gave them. */
1795
+ startMs?: number;
1796
+ endMs?: number;
1797
+ /**
1798
+ * Where that falls on the Timeline (D186): through the Clip playing the medium the script was
1799
+ * read off whose window holds `startMs`. Absent when no Clip plays that moment.
1800
+ */
1801
+ timelineMs?: number;
900
1802
  }[];
901
1803
  /** Media the script was read off (a transcript), through derived-from. */
902
1804
  sourceMediaIds: string[];
@@ -950,4 +1852,4 @@ interface ImportedVideoDraft {
950
1852
  /** One-time import into a newly owned document; never reverse-diff a live collaborative document. */
951
1853
  declare function fromVideoDraft(input: VideoDraftInput, options: FromVideoDraftOptions): ImportedVideoDraft;
952
1854
  //#endregion
953
- export { MedeoDslDraft as A, UnsupportedDocumentFormatError as C, captionContentCodec as D, InvalidAtomic as E, ClipSource as F, DslClipUpdate as I, MoveDslClipsInput as L, medeoDslLoroShape as M, AddDslClip as N, isInvalidAtomic as O, AddDslClipsInput as P, ReplaceDslClipsInput as R, DslTransaction as S, documentFormat as T, VoiceoverCaptionInput as _, toAudioScriptViews as a, MedeoDsl as b, resolveDslLayout as c, DslProjectionError as d, DslTrackLayout as f, ApplyVoiceoverInput as g, UploadText as h, AudioScriptView as i, MedeoDslLoroState as j, timeAnchorCodec as k, DslClipLayout as l, DslEditor as m, ImportedVideoDraft as n, VideoDraftProjection as o, createInitialMedeoDsl as p, fromVideoDraft as r, toVideoDraft as s, FromVideoDraftOptions as t, DslLayout as u, VoiceoverResult as v, assertDslDocument as w, DslAudit as x, CreateMedeoDslOptions as y, ClipPlacement as z };
1855
+ export { ClipPlacement as $, VoiceoverResult as A, RichTextSnapshot as At, isInvalidAtomic as B, Voice as Bt, DslProjectionError as C, MedeoDslSnapshot as Ct, UploadText as D, RelationTables as Dt, DslEditor as E, RelationTable as Et, UnsupportedDocumentFormatError as F, TextMutation as Ft, CommitOptions as G, MedeoDslDraft as H, assertDslDocument as I, TextRun as It, AddDslClipsInput as J, OpActor as K, documentFormat as L, TimeAnchor as Lt, MedeoDsl as M, TextDelta as Mt, DslAudit as N, TextEdit as Nt, ApplyVoiceoverInput as O, RelationValues as Ot, DslTransaction as P, TextMark as Pt, ReplaceDslClipsInput as Q, InvalidAtomic as R, Track$1 as Rt, DslLayout as S, FieldPatch as St, createInitialMedeoDsl as T, RelationMutation as Tt, MedeoDslLoroState as U, timeAnchorCodec as V, medeoDslLoroShape as W, DslClipUpdate as X, ClipSource as Y, MoveDslClipsInput as Z, VideoDraftTimeline as _, DslMutation as _t, toAudioScriptViews as a, tupleHash as at, resolveDslLayout as b, EntityTables as bt, CaptionDisplayCue as c, CaptionContent as ct, VideoDraft as d, CaptionText as dt, DslIdFactory as et, VideoDraftCaptionStyle as f, Clip as ft, VideoDraftPartUnion as g, DslDiagnostic as gt, VideoDraftInput as h, DeepReadonly as ht, AudioScriptView as i, resourceId as it, CreateMedeoDslOptions as j, StoredFile as jt, VoiceoverCaptionInput as k, ResourceSystem as kt, DEFAULT_UNIT_TIME_MS as l, CaptionSelection as lt, VideoDraftContentPartUnion as m, ContainNode as mt, ImportedVideoDraft as n, defaultIdFactory as nt, VideoDraftProjection as o, AudioScript as ot, VideoDraftContent as p, ContainMutation as pt, AddDslClip as q, fromVideoDraft as r, relationId as rt, toVideoDraft as s, Caption as st, FromVideoDraftOptions as t, EntityIdKind as tt, VideoCreationSettings as u, CaptionStyle$1 as ut, VideoDraftTrack as v, EntityMutation as vt, DslTrackLayout as w, Media as wt, DslClipLayout as x, EntityValues as xt, VideoDraftTrackItem as y, EntityTable as yt, captionContentCodec as z, TrackRole as zt };