@mengine/medeo-tool 1.0.1-alpha.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.
@@ -0,0 +1,669 @@
1
+ //#region src/sandbox/generated/edit-sandbox-api.d.ts
2
+ /**
3
+ * @generated by gen:sandbox-dts — DO NOT EDIT MANUALLY
4
+ *
5
+ * Schema version: video-document/v0
6
+ * Semantic ops: 18
7
+ *
8
+ * Boundary: zod `superRefine` / custom refine rules are NOT introspectable and
9
+ * do not appear here. Business mutual-exclusion rules surface via runtime
10
+ * validation errors (L3 feedback channel).
11
+ *
12
+ * @example 读取→计算→批量写
13
+ * ```ts
14
+ * const clips = timeline.clipsInRange(0, 10_000);
15
+ * await edit.setVideoClipSpeedShift({
16
+ * clips: clips.map((c) => ({ clip_id: c.id, speed_shift: { category: 'linear', mode: 'constant', config: { linear: { speed: 1.5 } } } })),
17
+ * });
18
+ * ```
19
+ *
20
+ * @example anchored 删除
21
+ * ```ts
22
+ * await edit.deleteVideoClips({ clip_ids: ['clip_a'], on_anchored: 'detach' });
23
+ * ```
24
+ */
25
+ /**
26
+ * A clip's playback-speed fact, the only thing `SetVideoClipSpeedShift` writes.
27
+ */
28
+ interface SpeedShift {
29
+ category: 'linear' | 'curve';
30
+ mode: string;
31
+ config: {
32
+ linear: {
33
+ /**
34
+ * @constraint positive
35
+ */
36
+ speed: number;
37
+ };
38
+ } | {
39
+ curve: {
40
+ /**
41
+ * @constraint minLength(2)
42
+ */
43
+ keyframes: {
44
+ /**
45
+ * @constraint min(0)
46
+ * @constraint max(1)
47
+ */
48
+ position: number;
49
+ /**
50
+ * @constraint min(0)
51
+ */
52
+ rate: number;
53
+ /**
54
+ * Bezier tangent handle (x, y)
55
+ */
56
+ in_tangent?: {
57
+ x: number;
58
+ y: number;
59
+ };
60
+ /**
61
+ * Bezier tangent handle (x, y)
62
+ */
63
+ out_tangent?: {
64
+ x: number;
65
+ y: number;
66
+ };
67
+ }[];
68
+ };
69
+ };
70
+ }
71
+ /**
72
+ * TTS voice summary attached to a speech
73
+ */
74
+ interface Voice {
75
+ /**
76
+ * @constraint minLength(1)
77
+ */
78
+ id: string;
79
+ name: string;
80
+ }
81
+ /**
82
+ * A materialized speech-subtree write (speeches + their captions).
83
+ */
84
+ interface SpeechAssets {
85
+ /**
86
+ * Materialized speech parts to write
87
+ * @constraint minLength(1)
88
+ */
89
+ speeches: {
90
+ /**
91
+ * The speech part ID (= side-effect speech_parts[].id)
92
+ * @constraint minLength(1)
93
+ */
94
+ speech_id: string;
95
+ /**
96
+ * Host video clip part ID the speech anchors to (RFC 02 §4)
97
+ * @constraint minLength(1)
98
+ */
99
+ anchor_part_id: string;
100
+ /**
101
+ * Offset within the host clip (speech.abs = host.abs + offset_ms)
102
+ * @constraint int
103
+ * @constraint min(0)
104
+ */
105
+ offset_ms: number;
106
+ /**
107
+ * @constraint minLength(1)
108
+ */
109
+ audio_storage_key: string;
110
+ /**
111
+ * Duration in milliseconds (> 0)
112
+ * @constraint int
113
+ * @constraint positive
114
+ */
115
+ duration_ms: number;
116
+ audio_script: string;
117
+ /**
118
+ * Volume in decibels (-60.0 to 20.0; 0.0 = original, -60 = mute, +20 = max)
119
+ * @constraint min(-60)
120
+ * @constraint max(20)
121
+ */
122
+ volume: number;
123
+ /**
124
+ * TTS voice summary attached to a speech
125
+ */
126
+ voice: {
127
+ /**
128
+ * @constraint minLength(1)
129
+ */
130
+ id: string;
131
+ name: string;
132
+ };
133
+ /**
134
+ * @constraint minLength(1)
135
+ */
136
+ origin_speech_id: string;
137
+ /**
138
+ * Caption part IDs owned by this speech
139
+ */
140
+ caption_ids: string[];
141
+ }[];
142
+ /**
143
+ * Materialized caption parts owned by the speeches
144
+ */
145
+ captions: {
146
+ /**
147
+ * The caption part ID (= side-effect created_caption_parts[].id)
148
+ * @constraint minLength(1)
149
+ */
150
+ caption_id: string;
151
+ /**
152
+ * The owning speech part ID
153
+ * @constraint minLength(1)
154
+ */
155
+ speech_part_id: string;
156
+ text: string;
157
+ /**
158
+ * Offset within the host speech (caption.abs = speech.abs + start_ms)
159
+ * @constraint int
160
+ * @constraint min(0)
161
+ */
162
+ start_ms: number;
163
+ /**
164
+ * Duration in milliseconds (> 0)
165
+ * @constraint int
166
+ * @constraint positive
167
+ */
168
+ duration_ms: number;
169
+ }[];
170
+ }
171
+ interface MoveVideoClipsInput {
172
+ /**
173
+ * List of video clips to move to new positions
174
+ * @constraint minLength(1)
175
+ */
176
+ clips: {
177
+ /**
178
+ * The video clip part ID to move
179
+ * @constraint minLength(1)
180
+ */
181
+ clip_id: string;
182
+ /**
183
+ * New absolute start time in milliseconds on the timeline
184
+ * @constraint int
185
+ * @constraint min(0)
186
+ */
187
+ new_start_ms: number;
188
+ /**
189
+ * Target track ID to move the clip to (optional)
190
+ * @constraint minLength(1)
191
+ */
192
+ new_track_id?: string;
193
+ }[];
194
+ }
195
+ interface DeleteVideoClipsInput {
196
+ /**
197
+ * List of video clip part IDs to delete from the main track
198
+ * @constraint minLength(1)
199
+ */
200
+ clip_ids: string[];
201
+ /**
202
+ * How to treat anchored children (default cascade)
203
+ */
204
+ on_anchored?: 'cascade' | 'detach';
205
+ }
206
+ /**
207
+ * Add video clips to a track.
208
+ */
209
+ interface AddVideoClipsInput {
210
+ /**
211
+ * List of video clips to create
212
+ * @constraint minLength(1)
213
+ */
214
+ clips: {
215
+ /**
216
+ * The media asset ID for the video clip
217
+ * @constraint minLength(1)
218
+ */
219
+ media_id: string;
220
+ /**
221
+ * Absolute start time in milliseconds on the timeline
222
+ * @constraint int
223
+ * @constraint min(0)
224
+ */
225
+ start_ms?: number;
226
+ /**
227
+ * The source media's intrinsic full length in ms
228
+ * @constraint int
229
+ * @constraint positive
230
+ */
231
+ media_duration_ms: number;
232
+ /**
233
+ * Trim window start in the media (default 0)
234
+ * @constraint int
235
+ * @constraint min(0)
236
+ */
237
+ play_in?: number;
238
+ /**
239
+ * Trim window end in the media (default media_duration_ms)
240
+ * @constraint int
241
+ * @constraint positive
242
+ */
243
+ play_out?: number;
244
+ /**
245
+ * Target track ID (optional, defaults to main track)
246
+ * @constraint minLength(1)
247
+ */
248
+ track_id?: string;
249
+ }[];
250
+ /**
251
+ * Insert new clips before this clip ID
252
+ * @constraint minLength(1)
253
+ */
254
+ before_clip_id?: string;
255
+ /**
256
+ * Insert new clips after this clip ID
257
+ * @constraint minLength(1)
258
+ */
259
+ after_clip_id?: string;
260
+ }
261
+ interface AdjustVideoClipVolumeInput {
262
+ /**
263
+ * List of video clips with their new volume settings
264
+ * @constraint minLength(1)
265
+ */
266
+ clips: {
267
+ /**
268
+ * The video clip part ID to adjust volume for
269
+ * @constraint minLength(1)
270
+ */
271
+ clip_id: string;
272
+ /**
273
+ * Volume in decibels (-60.0 to 20.0; 0.0 = original)
274
+ * @constraint min(-60)
275
+ * @constraint max(20)
276
+ */
277
+ volume: number;
278
+ }[];
279
+ }
280
+ /**
281
+ * Set the playback speed of existing video clips.
282
+ */
283
+ interface SetVideoClipSpeedShiftInput {
284
+ /**
285
+ * Video clips with their new speed settings
286
+ * @constraint minLength(1)
287
+ */
288
+ clips: {
289
+ /**
290
+ * The video clip part ID to set speed for
291
+ * @constraint minLength(1)
292
+ */
293
+ clip_id: string;
294
+ /**
295
+ * The new speed setting, or null to reset to 1×
296
+ */
297
+ speed_shift: {
298
+ category: 'linear' | 'curve';
299
+ mode: string;
300
+ config: {
301
+ linear: {
302
+ /**
303
+ * @constraint positive
304
+ */
305
+ speed: number;
306
+ };
307
+ } | {
308
+ curve: {
309
+ /**
310
+ * @constraint minLength(2)
311
+ */
312
+ keyframes: {
313
+ /**
314
+ * @constraint min(0)
315
+ * @constraint max(1)
316
+ */
317
+ position: number;
318
+ /**
319
+ * @constraint min(0)
320
+ */
321
+ rate: number;
322
+ /**
323
+ * Bezier tangent handle (x, y)
324
+ */
325
+ in_tangent?: {
326
+ x: number;
327
+ y: number;
328
+ };
329
+ /**
330
+ * Bezier tangent handle (x, y)
331
+ */
332
+ out_tangent?: {
333
+ x: number;
334
+ y: number;
335
+ };
336
+ }[];
337
+ };
338
+ };
339
+ } | null;
340
+ }[];
341
+ }
342
+ /**
343
+ * Replace the media backing existing video clips.
344
+ */
345
+ interface ReplaceVideoClipContentInput {
346
+ /**
347
+ * Video clips whose media is being replaced
348
+ * @constraint minLength(1)
349
+ */
350
+ clips: {
351
+ /**
352
+ * Existing video clip part ID to re-point
353
+ * @constraint minLength(1)
354
+ */
355
+ clip_id: string;
356
+ /**
357
+ * The new media asset ID
358
+ * @constraint minLength(1)
359
+ */
360
+ origin_media_id: string;
361
+ /**
362
+ * The new media's intrinsic full length
363
+ * @constraint int
364
+ * @constraint positive
365
+ */
366
+ media_duration_ms: number;
367
+ /**
368
+ * Trim window start in the new media (usually 0)
369
+ * @constraint int
370
+ * @constraint min(0)
371
+ */
372
+ play_in: number;
373
+ /**
374
+ * Trim window end in the new media (usually = media_duration_ms)
375
+ * @constraint int
376
+ * @constraint positive
377
+ */
378
+ play_out: number;
379
+ /**
380
+ * Volume in decibels (-60.0 to 20.0; 0.0 = original, -60 = mute, +20 = max)
381
+ * @constraint min(-60)
382
+ * @constraint max(20)
383
+ */
384
+ volume: number;
385
+ }[];
386
+ }
387
+ /**
388
+ * Re-trim existing video clips (the user-facing "adjust duration" gesture is a trim of the source window).
389
+ */
390
+ interface AdjustVideoClipDurationInput {
391
+ /**
392
+ * Video clips with their new trim windows
393
+ * @constraint minLength(1)
394
+ */
395
+ clips: {
396
+ /**
397
+ * The video clip part ID to re-trim
398
+ * @constraint minLength(1)
399
+ */
400
+ clip_id: string;
401
+ /**
402
+ * New trim window start in the source media
403
+ * @constraint int
404
+ * @constraint min(0)
405
+ */
406
+ play_in: number;
407
+ /**
408
+ * New trim window end in the source media
409
+ * @constraint int
410
+ * @constraint positive
411
+ */
412
+ play_out: number;
413
+ }[];
414
+ }
415
+ /**
416
+ * Add speeches (and their captions).
417
+ */
418
+ interface AddSpeechesInput extends SpeechAssets {}
419
+ /**
420
+ * Delete speeches with their captions.
421
+ */
422
+ interface DeleteSpeechesInput {
423
+ /**
424
+ * Speech part IDs to delete (their captions cascade-delete)
425
+ * @constraint minLength(1)
426
+ */
427
+ speech_ids: string[];
428
+ }
429
+ /**
430
+ * Move speeches in time.
431
+ */
432
+ interface MoveSpeechesInput {
433
+ /**
434
+ * Speeches to move to new positions
435
+ * @constraint minLength(1)
436
+ */
437
+ speeches: {
438
+ /**
439
+ * The speech part ID to move
440
+ * @constraint minLength(1)
441
+ */
442
+ speech_id: string;
443
+ /**
444
+ * New absolute start time on the timeline
445
+ * @constraint int
446
+ * @constraint min(0)
447
+ */
448
+ new_start_ms: number;
449
+ }[];
450
+ }
451
+ /**
452
+ * Change a speech's script or voice.
453
+ */
454
+ interface ChangeSpeechScriptInput extends SpeechAssets {}
455
+ interface ChangeSpeechVoiceInput extends SpeechAssets {}
456
+ interface AdjustSpeechVolumeInput {
457
+ /**
458
+ * List of speeches with their new volume settings
459
+ * @constraint minLength(1)
460
+ */
461
+ speeches: {
462
+ /**
463
+ * The speech part ID to adjust volume for
464
+ * @constraint minLength(1)
465
+ */
466
+ speech_id: string;
467
+ /**
468
+ * Volume in decibels (-60.0 to 20.0; 0.0 = original)
469
+ * @constraint min(-60)
470
+ * @constraint max(20)
471
+ */
472
+ volume: number;
473
+ }[];
474
+ }
475
+ /**
476
+ * Toggle caption visibility (the caption track's `is_hidden` flag).
477
+ */
478
+ interface SetCaptionVisibilityInput {
479
+ /**
480
+ * Whether the caption track is hidden
481
+ */
482
+ is_hidden: boolean;
483
+ }
484
+ /**
485
+ * Set the caption visual style.
486
+ */
487
+ interface SetCaptionStyleInput {
488
+ /**
489
+ * Font ID referencing a font from the font library
490
+ * @constraint minLength(1)
491
+ */
492
+ font_id?: string;
493
+ /**
494
+ * Font size in points
495
+ * @constraint positive
496
+ */
497
+ font_size?: number;
498
+ /**
499
+ * Font color as hex string, e.g. "#FFFFFF"
500
+ * @constraint minLength(1)
501
+ */
502
+ font_color?: string;
503
+ /**
504
+ * Numeric font weight, e.g. 400 or 700
505
+ * @constraint int
506
+ */
507
+ font_weight?: number;
508
+ /**
509
+ * Entrance animation preset ID, e.g. "fade" or "none"
510
+ */
511
+ entrance_animation?: string;
512
+ /**
513
+ * Entrance animation duration in ms
514
+ * @constraint min(0)
515
+ */
516
+ entrance_animation_duration_ms?: number;
517
+ /**
518
+ * Outline/stroke color as hex string, e.g. "#000000"
519
+ * @constraint minLength(1)
520
+ */
521
+ stroke_color?: string;
522
+ /**
523
+ * Outline/stroke width in pixels
524
+ * @constraint min(0)
525
+ */
526
+ stroke_width?: number;
527
+ /**
528
+ * Caption center X as a fraction (0.0 to 1.0)
529
+ */
530
+ position_x?: number;
531
+ /**
532
+ * Caption center Y as a fraction (0.0 to 1.0)
533
+ */
534
+ position_y?: number;
535
+ }
536
+ /**
537
+ * Set the document BGM.
538
+ */
539
+ interface SetBgmInput {
540
+ /**
541
+ * The bgm part ID to write
542
+ * @constraint minLength(1)
543
+ */
544
+ bgm_id: string;
545
+ /**
546
+ * @constraint minLength(1)
547
+ */
548
+ audio_storage_key: string;
549
+ /**
550
+ * The media asset ID
551
+ * @constraint minLength(1)
552
+ */
553
+ origin_media_id: string;
554
+ /**
555
+ * Volume in decibels (-60.0 to 20.0; 0.0 = original, -60 = mute, +20 = max)
556
+ * @constraint min(-60)
557
+ * @constraint max(20)
558
+ */
559
+ volume: number;
560
+ }
561
+ /**
562
+ * Remove the document BGM.
563
+ */
564
+ interface DeleteBgmInput {
565
+ [key: string]: never;
566
+ }
567
+ interface AdjustBgmVolumeInput {
568
+ /**
569
+ * List of bgm parts with their new volume settings
570
+ * @constraint minLength(1)
571
+ */
572
+ bgm: {
573
+ /**
574
+ * The bgm part ID to adjust volume for
575
+ * @constraint minLength(1)
576
+ */
577
+ bgm_id: string;
578
+ /**
579
+ * Volume in decibels (-60.0 to 20.0; 0.0 = original)
580
+ * @constraint min(-60)
581
+ * @constraint max(20)
582
+ */
583
+ volume: number;
584
+ }[];
585
+ }
586
+ /** Agent write surface — one method per SemanticOp kind. */
587
+ interface EditApi {
588
+ moveVideoClips(input: MoveVideoClipsInput): Promise<void>;
589
+ deleteVideoClips(input: DeleteVideoClipsInput): Promise<void>;
590
+ /** Add video clips to a track. */
591
+ addVideoClips(input: AddVideoClipsInput): Promise<void>;
592
+ adjustVideoClipVolume(input: AdjustVideoClipVolumeInput): Promise<void>;
593
+ /** Set the playback speed of existing video clips. */
594
+ setVideoClipSpeedShift(input: SetVideoClipSpeedShiftInput): Promise<void>;
595
+ /** Replace the media backing existing video clips. */
596
+ replaceVideoClipContent(input: ReplaceVideoClipContentInput): Promise<void>;
597
+ /** Re-trim existing video clips (the user-facing "adjust duration" gesture is a trim of the source window). */
598
+ adjustVideoClipDuration(input: AdjustVideoClipDurationInput): Promise<void>;
599
+ /** Add speeches (and their captions). */
600
+ addSpeeches(input: AddSpeechesInput): Promise<void>;
601
+ /** Delete speeches with their captions. */
602
+ deleteSpeeches(input: DeleteSpeechesInput): Promise<void>;
603
+ /** Move speeches in time. */
604
+ moveSpeeches(input: MoveSpeechesInput): Promise<void>;
605
+ /** Change a speech's script or voice. */
606
+ changeSpeechScript(input: ChangeSpeechScriptInput): Promise<void>;
607
+ changeSpeechVoice(input: ChangeSpeechVoiceInput): Promise<void>;
608
+ adjustSpeechVolume(input: AdjustSpeechVolumeInput): Promise<void>;
609
+ /** Toggle caption visibility (the caption track's `is_hidden` flag). */
610
+ setCaptionVisibility(input: SetCaptionVisibilityInput): Promise<void>;
611
+ /** Set the caption visual style. */
612
+ setCaptionStyle(input: SetCaptionStyleInput): Promise<void>;
613
+ /** Set the document BGM. */
614
+ setBgm(input: SetBgmInput): Promise<void>;
615
+ /** Remove the document BGM. */
616
+ deleteBgm(input: DeleteBgmInput): Promise<void>;
617
+ adjustBgmVolume(input: AdjustBgmVolumeInput): Promise<void>;
618
+ }
619
+ /** Clip hit from `clipsInRange`. */
620
+ interface TimelineClipDescriptor {
621
+ id: string;
622
+ start_ms: number;
623
+ end_ms: number;
624
+ duration_ms: number;
625
+ speed_shift: unknown;
626
+ volume: number | undefined;
627
+ media_id: string | undefined;
628
+ }
629
+ /** Part descriptor from `part(id)`. */
630
+ interface TimelinePartDescriptor {
631
+ id: string;
632
+ kind: string;
633
+ lane: string;
634
+ start_ms: number;
635
+ end_ms: number;
636
+ duration_ms: number;
637
+ part: unknown;
638
+ }
639
+ /** Opaque VideoDraft projection (full IDL lives in host document types). */
640
+ type VideoDraftProjection = {
641
+ readonly timeline?: {
642
+ readonly duration_ms?: number;
643
+ };
644
+ readonly [key: string]: unknown;
645
+ };
646
+ /** Agent read surface over the forked document. */
647
+ interface TimelineApi {
648
+ /** Snapshot the current VideoDraft projection. */
649
+ snapshot(): VideoDraftProjection;
650
+ /** Clips whose midpoint falls in `[startMs, endMs)`. */
651
+ clipsInRange(startMs: number, endMs: number): TimelineClipDescriptor[];
652
+ /** Look up a part by id, or null if missing. */
653
+ part(id: string): TimelinePartDescriptor | null;
654
+ }
655
+ /** Opaque checkpoint handle for rollback. */
656
+ interface SandboxCheckpoint {
657
+ readonly index: number;
658
+ }
659
+ declare const edit: EditApi;
660
+ declare const timeline: TimelineApi;
661
+ /** Capture a rollback point. */
662
+ declare function checkpoint(): SandboxCheckpoint;
663
+ /** Roll the sandbox document back to a prior checkpoint. */
664
+ declare function rollbackTo(cp: SandboxCheckpoint): void;
665
+ /** Host-injected script arguments (opaque). */
666
+ declare const inputs: unknown;
667
+ //#endregion
668
+ export type { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, EditApi, MoveSpeechesInput, MoveVideoClipsInput, ReplaceVideoClipContentInput, SandboxCheckpoint, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput, SpeechAssets, SpeedShift, TimelineApi, TimelineClipDescriptor, TimelinePartDescriptor, VideoDraftProjection, Voice, checkpoint, edit, inputs, rollbackTo, timeline };
669
+ //# sourceMappingURL=sandbox-api.d.mts.map
@@ -0,0 +1 @@
1
+ export {};