@mengine/medeo-client 2.1.1-dsl.25 → 2.1.1-dsl.27

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 SegmentRange, L as FieldPatch, M as DslMutation, Q as TextEdit, R as MedeoDslSnapshot, T as CaptionStyle, V as PhoneticScript, X as StoredFile, Y as SegmentSelection, at as Voice, c as VideoDraftInput, h as DslIdFactory, it as TrackRole, j as DslDiagnostic, nt as TimeAnchor, o as VideoDraftContent, p as CommitOptions, w as CaptionSelection, z as Media } from "./video-draft-types-slnHaNs9.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,6 +392,18 @@ interface DslClipUpdate {
58
392
  placement?: ClipPlacement;
59
393
  }
60
394
  //#endregion
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
61
407
  //#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
62
408
  /**
63
409
  * Options for schema definitions
@@ -710,7 +1056,7 @@ interface VoiceoverCaptionInput {
710
1056
  start: number;
711
1057
  end: number;
712
1058
  };
713
- style?: CaptionStyle;
1059
+ style?: CaptionStyle$1;
714
1060
  }
715
1061
  interface ApplyVoiceoverInput {
716
1062
  clipId?: string;
@@ -807,7 +1153,7 @@ declare class DslEditor {
807
1153
  start?: never;
808
1154
  end?: never;
809
1155
  }) & {
810
- style?: CaptionStyle;
1156
+ style?: CaptionStyle$1;
811
1157
  }, options?: CommitOptions): string;
812
1158
  /** Show a segment of a script, or a run of it, in place of the Caption's own text. */
813
1159
  setCaptionContent(captionId: string, selection: SegmentRange, options?: CommitOptions): void;
@@ -825,7 +1171,7 @@ declare class DslEditor {
825
1171
  }, options?: CommitOptions): void;
826
1172
  replaceClips(input: ReplaceDslClipsInput, options?: CommitOptions): string[];
827
1173
  updateClips(updates: readonly DslClipUpdate[], options?: CommitOptions): void;
828
- patchCaptionStyle(captionIds: readonly string[], patch: FieldPatch<CaptionStyle>, options?: CommitOptions): void;
1174
+ patchCaptionStyle(captionIds: readonly string[], patch: FieldPatch<CaptionStyle$1>, options?: CommitOptions): void;
829
1175
  applyVoiceover(input: ApplyVoiceoverInput, options?: CommitOptions): VoiceoverResult;
830
1176
  private voiceoverScriptId;
831
1177
  /**
@@ -890,6 +1236,538 @@ declare class DslProjectionError extends Error {
890
1236
  /** Pure deterministic solve. Constraints only move sequential roots; anchors retain their exact offsets. */
891
1237
  declare function resolveDslLayout(snapshot: MedeoDslSnapshot): DslLayout;
892
1238
  //#endregion
1239
+ //#region src/dsl/projection/generated/video-draft-idl.d.ts
1240
+ /**
1241
+ * @generated by @mengine/idl-codegen — DO NOT EDIT MANUALLY.
1242
+ *
1243
+ * VideoDraft read-view types extracted from the Smithy IDL
1244
+ * (medeo-v2-design-materials). Re-run `vp run @mengine/idl-codegen#sync`.
1245
+ * Source IDL commit: 902e82e3fec1e94b36e14ef671de91abd210dc86
1246
+ *
1247
+ * WHY EVERY FIELD IS `T | undefined`:
1248
+ * AWS `smithy-typescript-codegen` widens every structure member to
1249
+ * `T | undefined` regardless of the Smithy `@required` trait — it favours
1250
+ * deserialization robustness (a peer may omit a field on the wire) over
1251
+ * encoding requiredness in the static type. So these generated types are NOT
1252
+ * the source of truth for which fields are required: the Smithy `.smithy`
1253
+ * model is. Many fields here (e.g. `VideoClipPart.play_in` / `play_out` /
1254
+ * `volume` / `origin_media_id`) are `@required` in the contract.
1255
+ *
1256
+ * Requiredness is restored by import and write-time validation, not here.
1257
+ * DSL content constraints are owned by medeo-dsl and enforced at the medeo-client
1258
+ * transaction and import boundaries.
1259
+ * Do not assume a
1260
+ * field is optional just because its type is `| undefined`.
1261
+ */
1262
+ /**
1263
+ * @public
1264
+ * @enum
1265
+ */
1266
+ declare const PartKind: {
1267
+ readonly BGM: "bgm";
1268
+ readonly CAPTION: "caption";
1269
+ readonly SPEECH: "speech";
1270
+ readonly VIDEO_CLIP: "video_clip";
1271
+ };
1272
+ /**
1273
+ * @public
1274
+ */
1275
+ type PartKind = (typeof PartKind)[keyof typeof PartKind];
1276
+ /**
1277
+ * @public
1278
+ */
1279
+ interface VoiceSummary {
1280
+ name: string | undefined;
1281
+ id: string | undefined;
1282
+ }
1283
+ /**
1284
+ * @public
1285
+ */
1286
+ interface SpeechPart$1 {
1287
+ id: string | undefined;
1288
+ duration_ms: number | undefined;
1289
+ /**
1290
+ * Types of parts that can be contained in tracks
1291
+ * @public
1292
+ */
1293
+ kind: PartKind | undefined;
1294
+ audio_script: string | undefined;
1295
+ volume: number | undefined;
1296
+ audio_storage_key: string | undefined;
1297
+ origin_speech_id: string | undefined;
1298
+ voice: VoiceSummary | undefined;
1299
+ caption_ids: string[] | undefined;
1300
+ }
1301
+ /**
1302
+ * Caption visual style configuration
1303
+ * @public
1304
+ */
1305
+ interface CaptionStyle {
1306
+ /**
1307
+ * Font ID referencing a font from the font library. Defaults to system font if not provided
1308
+ * @public
1309
+ */
1310
+ font_id?: string | undefined;
1311
+ /**
1312
+ * Font size in points
1313
+ * @public
1314
+ */
1315
+ font_size?: number | undefined;
1316
+ /**
1317
+ * Font color as hex string (e.g. "#FFFFFF")
1318
+ * @public
1319
+ */
1320
+ font_color?: string | undefined;
1321
+ /**
1322
+ * Numeric font weight, e.g. 400 for regular or 700 for bold
1323
+ * @public
1324
+ */
1325
+ font_weight?: number | undefined;
1326
+ /**
1327
+ * Caption entrance animation preset ID, e.g. "fade", "slideUp", or "none"
1328
+ * @public
1329
+ */
1330
+ entrance_animation?: string | undefined;
1331
+ /**
1332
+ * Caption entrance animation duration in milliseconds
1333
+ * @public
1334
+ */
1335
+ entrance_animation_duration_ms?: number | undefined;
1336
+ /**
1337
+ * Caption outline/stroke color as hex string (e.g. "#000000")
1338
+ * @public
1339
+ */
1340
+ stroke_color?: string | undefined;
1341
+ /**
1342
+ * Caption outline/stroke width in pixels
1343
+ * @public
1344
+ */
1345
+ stroke_width?: number | undefined;
1346
+ /**
1347
+ * Caption center X position as a percentage (0.0 to 1.0)
1348
+ * @public
1349
+ */
1350
+ position_x?: number | undefined;
1351
+ /**
1352
+ * Caption center Y position as a percentage (0.0 to 1.0)
1353
+ * @public
1354
+ */
1355
+ position_y?: number | undefined;
1356
+ }
1357
+ /**
1358
+ * @public
1359
+ */
1360
+ interface CaptionPart$1 {
1361
+ id: string | undefined;
1362
+ duration_ms: number | undefined;
1363
+ /**
1364
+ * Types of parts that can be contained in tracks
1365
+ * @public
1366
+ */
1367
+ kind: PartKind | undefined;
1368
+ speech_part_id: string | undefined;
1369
+ text: string | undefined;
1370
+ start_ms: number | undefined;
1371
+ /**
1372
+ * Caption visual style (font, size, color, weight, animation, outline). Uses default style if not provided
1373
+ * @public
1374
+ */
1375
+ style?: CaptionStyle | undefined;
1376
+ }
1377
+ /**
1378
+ * @public
1379
+ * @enum
1380
+ */
1381
+ declare const AspectRatio: {
1382
+ readonly RATIO_16_9: "16:9";
1383
+ readonly RATIO_9_16: "9:16";
1384
+ };
1385
+ /**
1386
+ * @public
1387
+ */
1388
+ type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
1389
+ /**
1390
+ * @public
1391
+ * @enum
1392
+ */
1393
+ declare const AssetSource: {
1394
+ readonly AI_IMAGES: "ai_images";
1395
+ readonly AI_VIDEOS: "ai_videos";
1396
+ readonly MY_UPLOADED_ASSETS: "my_uploaded_assets";
1397
+ readonly STOCK_VIDEOS: "stock_videos";
1398
+ };
1399
+ /**
1400
+ * @public
1401
+ */
1402
+ type AssetSource = (typeof AssetSource)[keyof typeof AssetSource];
1403
+ /**
1404
+ * An extra aspect ratio variant with independent storage keys for thumbnail,
1405
+ * preview video, and highlight video. Stored inside video_settings JSONB.
1406
+ * @public
1407
+ */
1408
+ interface RatioVariant {
1409
+ aspect_ratio: string | undefined;
1410
+ thumb_storage_key: string | undefined;
1411
+ video_storage_key: string | undefined;
1412
+ highlight_video_storage_key?: string | undefined;
1413
+ }
1414
+ /**
1415
+ * @public
1416
+ */
1417
+ interface VideoCreationSettings$1 {
1418
+ voice_id?: string | undefined;
1419
+ duration_ms?: number | undefined;
1420
+ aspect_ratio?: AspectRatio | undefined;
1421
+ video_style_id?: string | undefined;
1422
+ asset_sources?: AssetSource[] | undefined;
1423
+ recipe_id?: string | undefined;
1424
+ enable_high_cost_confirm?: boolean | undefined;
1425
+ user_confirm_cost_threshold?: number | undefined;
1426
+ /**
1427
+ * Extra aspect ratio variants with independent storage keys.
1428
+ * Each variant carries its own thumbnail, preview video, and optional highlight video.
1429
+ * Used when a recipe supports multiple aspect ratios (e.g. both 16:9 and 9:16).
1430
+ * @public
1431
+ */
1432
+ extra_ratios?: RatioVariant[] | undefined;
1433
+ }
1434
+ /**
1435
+ * @public
1436
+ */
1437
+ interface TrackItem {
1438
+ abs_time_position: number | undefined;
1439
+ part_id: string | undefined;
1440
+ }
1441
+ /**
1442
+ * @public
1443
+ */
1444
+ interface Track {
1445
+ id: string | undefined;
1446
+ /**
1447
+ * Types of parts that can be contained in tracks
1448
+ * @public
1449
+ */
1450
+ parts_kind: PartKind | undefined;
1451
+ is_hidden: boolean | undefined;
1452
+ items: TrackItem[] | undefined;
1453
+ }
1454
+ /**
1455
+ * @public
1456
+ */
1457
+ interface Attachment {
1458
+ part_id: string | undefined;
1459
+ relative_time_position: number | undefined;
1460
+ }
1461
+ /**
1462
+ * @public
1463
+ */
1464
+ interface PartAggregation {
1465
+ body_part_id: string | undefined;
1466
+ attachments: Attachment[] | undefined;
1467
+ }
1468
+ /**
1469
+ * @public
1470
+ */
1471
+ interface BgmPart$1 {
1472
+ id: string | undefined;
1473
+ duration_ms: number | undefined;
1474
+ /**
1475
+ * Types of parts that can be contained in tracks
1476
+ * @public
1477
+ */
1478
+ kind: PartKind | undefined;
1479
+ audio_storage_key: string | undefined;
1480
+ volume: number | undefined;
1481
+ origin_media_id: string | undefined;
1482
+ }
1483
+ /**
1484
+ * @public
1485
+ * @enum
1486
+ */
1487
+ declare const SpeedShiftCategory: {
1488
+ /**
1489
+ * Variable speed controlled by Bezier keyframes
1490
+ */
1491
+ readonly CURVE: "curve";
1492
+ /**
1493
+ * Constant speed multiplier across the entire clip
1494
+ */
1495
+ readonly LINEAR: "linear";
1496
+ };
1497
+ /**
1498
+ * @public
1499
+ */
1500
+ type SpeedShiftCategory = (typeof SpeedShiftCategory)[keyof typeof SpeedShiftCategory];
1501
+ /**
1502
+ * @public
1503
+ */
1504
+ interface TangentHandle {
1505
+ x: number | undefined;
1506
+ y: number | undefined;
1507
+ }
1508
+ /**
1509
+ * @public
1510
+ */
1511
+ interface SpeedKeyframe {
1512
+ position: number | undefined;
1513
+ rate: number | undefined;
1514
+ in_tangent?: TangentHandle | undefined;
1515
+ out_tangent?: TangentHandle | undefined;
1516
+ }
1517
+ /**
1518
+ * @public
1519
+ */
1520
+ interface CurveConfig {
1521
+ keyframes: SpeedKeyframe[] | undefined;
1522
+ }
1523
+ /**
1524
+ * @public
1525
+ */
1526
+ interface LinearConfig {
1527
+ speed: number | undefined;
1528
+ }
1529
+ /**
1530
+ * @public
1531
+ */
1532
+ type SpeedShiftConfigUnion = SpeedShiftConfigUnion.CurveMember | SpeedShiftConfigUnion.LinearMember | SpeedShiftConfigUnion.$UnknownMember;
1533
+ /**
1534
+ * @public
1535
+ */
1536
+ declare namespace SpeedShiftConfigUnion {
1537
+ interface LinearMember {
1538
+ linear: LinearConfig;
1539
+ curve?: never;
1540
+ $unknown?: never;
1541
+ }
1542
+ interface CurveMember {
1543
+ linear?: never;
1544
+ curve: CurveConfig;
1545
+ $unknown?: never;
1546
+ }
1547
+ /**
1548
+ * @public
1549
+ */
1550
+ interface $UnknownMember {
1551
+ linear?: never;
1552
+ curve?: never;
1553
+ $unknown: [string, any];
1554
+ }
1555
+ interface Visitor<T> {
1556
+ linear: (value: LinearConfig) => T;
1557
+ curve: (value: CurveConfig) => T;
1558
+ _: (name: string, value: any) => T;
1559
+ }
1560
+ const visit: <T>(value: SpeedShiftConfigUnion, visitor: Visitor<T>) => T;
1561
+ }
1562
+ /**
1563
+ * @public
1564
+ */
1565
+ interface SpeedShift {
1566
+ category: SpeedShiftCategory | undefined;
1567
+ mode: string | undefined;
1568
+ config: SpeedShiftConfigUnion | undefined;
1569
+ }
1570
+ /**
1571
+ * @public
1572
+ */
1573
+ interface VideoClipPart {
1574
+ id: string | undefined;
1575
+ duration_ms: number | undefined;
1576
+ /**
1577
+ * Types of parts that can be contained in tracks
1578
+ * @public
1579
+ */
1580
+ kind: PartKind | undefined;
1581
+ play_in: number | undefined;
1582
+ play_out: number | undefined;
1583
+ volume: number | undefined;
1584
+ origin_media_id: string | undefined;
1585
+ speed_shift?: SpeedShift | undefined;
1586
+ }
1587
+ /**
1588
+ * @public
1589
+ */
1590
+ type PartUnion = PartUnion.BgmMember | PartUnion.CaptionMember | PartUnion.SpeechMember | PartUnion.Video_clipMember | PartUnion.$UnknownMember;
1591
+ /**
1592
+ * @public
1593
+ */
1594
+ declare namespace PartUnion {
1595
+ interface Video_clipMember {
1596
+ video_clip: VideoClipPart;
1597
+ bgm?: never;
1598
+ speech?: never;
1599
+ caption?: never;
1600
+ $unknown?: never;
1601
+ }
1602
+ interface BgmMember {
1603
+ video_clip?: never;
1604
+ bgm: BgmPart$1;
1605
+ speech?: never;
1606
+ caption?: never;
1607
+ $unknown?: never;
1608
+ }
1609
+ interface SpeechMember {
1610
+ video_clip?: never;
1611
+ bgm?: never;
1612
+ speech: SpeechPart$1;
1613
+ caption?: never;
1614
+ $unknown?: never;
1615
+ }
1616
+ interface CaptionMember {
1617
+ video_clip?: never;
1618
+ bgm?: never;
1619
+ speech?: never;
1620
+ caption: CaptionPart$1;
1621
+ $unknown?: never;
1622
+ }
1623
+ /**
1624
+ * @public
1625
+ */
1626
+ interface $UnknownMember {
1627
+ video_clip?: never;
1628
+ bgm?: never;
1629
+ speech?: never;
1630
+ caption?: never;
1631
+ $unknown: [string, any];
1632
+ }
1633
+ interface Visitor<T> {
1634
+ video_clip: (value: VideoClipPart) => T;
1635
+ bgm: (value: BgmPart$1) => T;
1636
+ speech: (value: SpeechPart$1) => T;
1637
+ caption: (value: CaptionPart$1) => T;
1638
+ _: (name: string, value: any) => T;
1639
+ }
1640
+ const visit: <T>(value: PartUnion, visitor: Visitor<T>) => T;
1641
+ }
1642
+ /**
1643
+ * Timeline configuration for video editing
1644
+ * @public
1645
+ */
1646
+ interface Timeline {
1647
+ duration_ms: number | undefined;
1648
+ unit_time_ms: number | undefined;
1649
+ }
1650
+ /**
1651
+ * Complete video draft information with timeline and tracks
1652
+ * @public
1653
+ */
1654
+ interface VideoDraft$1 {
1655
+ id?: string | undefined;
1656
+ project_id: string | undefined;
1657
+ owner_id: string | undefined;
1658
+ /**
1659
+ * for-code-gen: property value may be empty string ("")
1660
+ * @public
1661
+ */
1662
+ thumbnail_storage_key: string | undefined;
1663
+ /**
1664
+ * Timeline configuration for video editing
1665
+ * @public
1666
+ */
1667
+ timeline?: Timeline | undefined;
1668
+ video_creation_settings?: VideoCreationSettings$1 | undefined;
1669
+ chat_session_id: string | undefined;
1670
+ main_track?: Track | undefined;
1671
+ above_main_tracks: Track[] | undefined;
1672
+ below_main_tracks: Track[] | undefined;
1673
+ part_aggregations: PartAggregation[] | undefined;
1674
+ part_library: Record<string, PartUnion> | undefined;
1675
+ version: number | undefined;
1676
+ }
1677
+ //#endregion
1678
+ //#region src/dsl/projection/video-draft-types.d.ts
1679
+ type VideoDraftTrack = Track;
1680
+ type VideoDraftTrackItem = TrackItem;
1681
+ type VideoDraftTimeline = Timeline;
1682
+ type VideoDraftCaptionStyle = CaptionStyle;
1683
+ interface CaptionDisplayCue {
1684
+ segmentId: string;
1685
+ text: string;
1686
+ startMs: number;
1687
+ durationMs: number;
1688
+ }
1689
+ type VideoCreationSettings = Omit<VideoCreationSettings$1, 'video_style_id' | 'duration_ms'> & {
1690
+ video_style_id?: string | null;
1691
+ duration_ms?: number | null;
1692
+ };
1693
+ type VideoPart = Omit<VideoClipPart, 'duration_ms'>;
1694
+ type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
1695
+ media_duration_ms?: number;
1696
+ };
1697
+ type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
1698
+ initial_duration_ms?: number;
1699
+ display_cues?: CaptionDisplayCue[];
1700
+ };
1701
+ type BgmPart = Omit<BgmPart$1, 'duration_ms'>;
1702
+ /** Legacy inputs may omit derived durations; output always states the field. */
1703
+ type VideoDraftPartUnion = {
1704
+ video_clip: VideoPart & {
1705
+ duration_ms?: number;
1706
+ };
1707
+ speech?: never;
1708
+ caption?: never;
1709
+ bgm?: never;
1710
+ } | {
1711
+ video_clip?: never;
1712
+ speech: SpeechPart & {
1713
+ duration_ms?: number;
1714
+ };
1715
+ caption?: never;
1716
+ bgm?: never;
1717
+ } | {
1718
+ video_clip?: never;
1719
+ speech?: never;
1720
+ caption: CaptionPart & {
1721
+ duration_ms?: number;
1722
+ };
1723
+ bgm?: never;
1724
+ } | {
1725
+ video_clip?: never;
1726
+ speech?: never;
1727
+ caption?: never;
1728
+ bgm: BgmPart & {
1729
+ duration_ms?: number;
1730
+ };
1731
+ };
1732
+ type VideoDraftContentPartUnion = {
1733
+ video_clip: VideoPart & {
1734
+ duration_ms: number | undefined;
1735
+ };
1736
+ speech?: never;
1737
+ caption?: never;
1738
+ bgm?: never;
1739
+ } | {
1740
+ video_clip?: never;
1741
+ speech: SpeechPart & {
1742
+ duration_ms: number | undefined;
1743
+ };
1744
+ caption?: never;
1745
+ bgm?: never;
1746
+ } | {
1747
+ video_clip?: never;
1748
+ speech?: never;
1749
+ caption: CaptionPart & {
1750
+ duration_ms: number | undefined;
1751
+ };
1752
+ bgm?: never;
1753
+ } | {
1754
+ video_clip?: never;
1755
+ speech?: never;
1756
+ caption?: never;
1757
+ bgm: BgmPart & {
1758
+ duration_ms: number | undefined;
1759
+ };
1760
+ };
1761
+ type VideoDraft = Omit<VideoDraft$1, 'part_library' | 'video_creation_settings'> & {
1762
+ part_library: Record<string, VideoDraftPartUnion> | undefined;
1763
+ video_creation_settings?: VideoCreationSettings;
1764
+ };
1765
+ type VideoDraftContent = Pick<VideoDraft, 'timeline' | 'main_track' | 'above_main_tracks' | 'below_main_tracks' | 'part_aggregations'> & {
1766
+ part_library: Record<string, VideoDraftContentPartUnion> | undefined;
1767
+ };
1768
+ type VideoDraftInput = Pick<VideoDraft, keyof VideoDraftContent>;
1769
+ declare const DEFAULT_UNIT_TIME_MS = 33.333;
1770
+ //#endregion
893
1771
  //#region src/dsl/projection/to-video-draft.d.ts
894
1772
  interface VideoDraftProjection {
895
1773
  content: VideoDraftContent;
@@ -970,4 +1848,4 @@ interface ImportedVideoDraft {
970
1848
  /** One-time import into a newly owned document; never reverse-diff a live collaborative document. */
971
1849
  declare function fromVideoDraft(input: VideoDraftInput, options: FromVideoDraftOptions): ImportedVideoDraft;
972
1850
  //#endregion
973
- 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 };
1851
+ 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 };