@mengine/medeo-tool 1.0.1-alpha.2 → 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/README.md +36 -6
- package/dist/entity-contract-B3txrzTt.d.mts +174 -0
- package/dist/index.d.mts +104 -17
- package/dist/index.mjs +1544 -123
- package/dist/index.mjs.map +1 -1
- package/dist/sandbox-api.d.mts +250 -4
- package/dist/script-session-BF44uKv_.mjs +1501 -0
- package/dist/script-session-BF44uKv_.mjs.map +1 -0
- package/dist/worker-entry.d.mts +2 -0
- package/dist/worker-entry.mjs +23 -4
- package/dist/worker-entry.mjs.map +1 -1
- package/package.json +4 -3
- package/dist/script-session-B8fc9Ccb.mjs +0 -439
- package/dist/script-session-B8fc9Ccb.mjs.map +0 -1
package/dist/sandbox-api.d.mts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @generated by gen:sandbox-dts — DO NOT EDIT MANUALLY
|
|
4
4
|
*
|
|
5
5
|
* Schema version: video-document/v0
|
|
6
|
-
* Semantic ops:
|
|
6
|
+
* Semantic ops: 20
|
|
7
7
|
*
|
|
8
8
|
* Boundary: zod `superRefine` / custom refine rules are NOT introspectable and
|
|
9
9
|
* do not appear here. Business mutual-exclusion rules surface via runtime
|
|
@@ -192,6 +192,40 @@ interface MoveVideoClipsInput {
|
|
|
192
192
|
new_track_id?: string;
|
|
193
193
|
}[];
|
|
194
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Reorder a set of main-track clips relative to a reference clip.
|
|
197
|
+
*/
|
|
198
|
+
interface MoveVideoClipsByAnchorInput {
|
|
199
|
+
/**
|
|
200
|
+
* Clips to move as one block, keeping their relative order. Need not be contiguous on the track.
|
|
201
|
+
* @constraint minLength(1)
|
|
202
|
+
*/
|
|
203
|
+
clip_ids: string[];
|
|
204
|
+
/**
|
|
205
|
+
* Where the moved block lands: before/after a reference clip, or at the head of the track
|
|
206
|
+
*/
|
|
207
|
+
anchor: {
|
|
208
|
+
position: 'before';
|
|
209
|
+
/**
|
|
210
|
+
* The moved block lands immediately before this clip
|
|
211
|
+
* @constraint minLength(1)
|
|
212
|
+
*/
|
|
213
|
+
clip_id: string;
|
|
214
|
+
} | {
|
|
215
|
+
position: 'after';
|
|
216
|
+
/**
|
|
217
|
+
* The moved block lands immediately after this clip
|
|
218
|
+
* @constraint minLength(1)
|
|
219
|
+
*/
|
|
220
|
+
clip_id: string;
|
|
221
|
+
} | {
|
|
222
|
+
position: 'track_start';
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* What happens to speeches anchored to the moved clips (required — see the policy doc)
|
|
226
|
+
*/
|
|
227
|
+
on_anchored: 'follow' | 'keep_absolute';
|
|
228
|
+
}
|
|
195
229
|
interface DeleteVideoClipsInput {
|
|
196
230
|
/**
|
|
197
231
|
* List of video clip part IDs to delete from the main track
|
|
@@ -384,6 +418,49 @@ interface ReplaceVideoClipContentInput {
|
|
|
384
418
|
volume: number;
|
|
385
419
|
}[];
|
|
386
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* Replace a contiguous run of main-track clips with a new run.
|
|
423
|
+
*/
|
|
424
|
+
interface ReplaceVideoClipSequenceInput {
|
|
425
|
+
/**
|
|
426
|
+
* The clips being replaced: a contiguous main-track run, listed in timeline order
|
|
427
|
+
* @constraint minLength(1)
|
|
428
|
+
*/
|
|
429
|
+
old_clip_ids: string[];
|
|
430
|
+
/**
|
|
431
|
+
* The replacement clips, in the order they take on the track
|
|
432
|
+
* @constraint minLength(1)
|
|
433
|
+
*/
|
|
434
|
+
new_clips: {
|
|
435
|
+
/**
|
|
436
|
+
* The replacement media asset ID. Omit to create an empty placeholder clip.
|
|
437
|
+
* @constraint minLength(1)
|
|
438
|
+
*/
|
|
439
|
+
media_id?: string;
|
|
440
|
+
/**
|
|
441
|
+
* The source media's intrinsic full length in ms
|
|
442
|
+
* @constraint int
|
|
443
|
+
* @constraint positive
|
|
444
|
+
*/
|
|
445
|
+
media_duration_ms: number;
|
|
446
|
+
/**
|
|
447
|
+
* Trim window start in the media (default 0)
|
|
448
|
+
* @constraint int
|
|
449
|
+
* @constraint min(0)
|
|
450
|
+
*/
|
|
451
|
+
play_in?: number;
|
|
452
|
+
/**
|
|
453
|
+
* Trim window end in the media (default media_duration_ms)
|
|
454
|
+
* @constraint int
|
|
455
|
+
* @constraint positive
|
|
456
|
+
*/
|
|
457
|
+
play_out?: number;
|
|
458
|
+
}[];
|
|
459
|
+
/**
|
|
460
|
+
* What happens to speeches anchored to the replaced clips (required — see the policy doc)
|
|
461
|
+
*/
|
|
462
|
+
on_anchored: 'remap' | 'cascade';
|
|
463
|
+
}
|
|
387
464
|
/**
|
|
388
465
|
* Re-trim existing video clips (the user-facing "adjust duration" gesture is a trim of the source window).
|
|
389
466
|
*/
|
|
@@ -586,6 +663,8 @@ interface AdjustBgmVolumeInput {
|
|
|
586
663
|
/** Agent write surface — one method per SemanticOp kind. */
|
|
587
664
|
interface EditApi {
|
|
588
665
|
moveVideoClips(input: MoveVideoClipsInput): Promise<void>;
|
|
666
|
+
/** Reorder a set of main-track clips relative to a reference clip. */
|
|
667
|
+
moveVideoClipsByAnchor(input: MoveVideoClipsByAnchorInput): Promise<void>;
|
|
589
668
|
deleteVideoClips(input: DeleteVideoClipsInput): Promise<void>;
|
|
590
669
|
/** Add video clips to a track. */
|
|
591
670
|
addVideoClips(input: AddVideoClipsInput): Promise<void>;
|
|
@@ -594,6 +673,8 @@ interface EditApi {
|
|
|
594
673
|
setVideoClipSpeedShift(input: SetVideoClipSpeedShiftInput): Promise<void>;
|
|
595
674
|
/** Replace the media backing existing video clips. */
|
|
596
675
|
replaceVideoClipContent(input: ReplaceVideoClipContentInput): Promise<void>;
|
|
676
|
+
/** Replace a contiguous run of main-track clips with a new run. */
|
|
677
|
+
replaceVideoClipSequence(input: ReplaceVideoClipSequenceInput): Promise<void>;
|
|
597
678
|
/** Re-trim existing video clips (the user-facing "adjust duration" gesture is a trim of the source window). */
|
|
598
679
|
adjustVideoClipDuration(input: AdjustVideoClipDurationInput): Promise<void>;
|
|
599
680
|
/** Add speeches (and their captions). */
|
|
@@ -616,6 +697,169 @@ interface EditApi {
|
|
|
616
697
|
deleteBgm(input: DeleteBgmInput): Promise<void>;
|
|
617
698
|
adjustBgmVolume(input: AdjustBgmVolumeInput): Promise<void>;
|
|
618
699
|
}
|
|
700
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
701
|
+
type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
702
|
+
interface JsonObject {
|
|
703
|
+
[key: string]: JsonValue;
|
|
704
|
+
}
|
|
705
|
+
type KnownEntityKind = 'axvideo' | 'timeline' | 'track' | 'clip' | 'asset' | 'video' | 'audio' | 'voice' | 'image' | 'sequence-marker' | 'viewport' | 'audio-script' | 'phonetic-script' | 'caption';
|
|
706
|
+
type KnownRelationKind = 'timeline-track' | 'track-clip' | 'clip-marker' | 'marker-content' | 'axvideo-marker' | 'marker-timeline' | 'physical-asset' | 'generated' | 'phonetic-script-provenance' | 'caption-provenance' | 'caption-alignment';
|
|
707
|
+
interface BoundedNativeSequencePayload extends JsonObject {
|
|
708
|
+
/** Use factual recalled coordinates; never invent an end or duration. */
|
|
709
|
+
extent: {
|
|
710
|
+
kind: 'bounded';
|
|
711
|
+
start: number;
|
|
712
|
+
end: number;
|
|
713
|
+
};
|
|
714
|
+
sampling: 'native';
|
|
715
|
+
coordinateSpace: JsonValue;
|
|
716
|
+
}
|
|
717
|
+
interface UnboundedConstantSequencePayload extends JsonObject {
|
|
718
|
+
extent: {
|
|
719
|
+
kind: 'unbounded';
|
|
720
|
+
start: number;
|
|
721
|
+
};
|
|
722
|
+
sampling: 'constant';
|
|
723
|
+
coordinateSpace: JsonValue;
|
|
724
|
+
}
|
|
725
|
+
interface BoundedDerivedSequencePayload extends JsonObject {
|
|
726
|
+
extent: {
|
|
727
|
+
kind: 'bounded';
|
|
728
|
+
start: number;
|
|
729
|
+
end: number;
|
|
730
|
+
};
|
|
731
|
+
sampling: 'derived';
|
|
732
|
+
coordinateSpace: JsonValue;
|
|
733
|
+
}
|
|
734
|
+
type ScriptTextSegment = JsonObject & {
|
|
735
|
+
segmentId: string;
|
|
736
|
+
text: string;
|
|
737
|
+
language?: string;
|
|
738
|
+
};
|
|
739
|
+
interface EntityPayloadByKind {
|
|
740
|
+
axvideo: BoundedDerivedSequencePayload;
|
|
741
|
+
timeline: JsonObject;
|
|
742
|
+
track: JsonObject & {
|
|
743
|
+
hidden?: boolean;
|
|
744
|
+
role?: string;
|
|
745
|
+
};
|
|
746
|
+
clip: JsonObject;
|
|
747
|
+
asset: JsonObject;
|
|
748
|
+
video: BoundedNativeSequencePayload;
|
|
749
|
+
audio: BoundedNativeSequencePayload;
|
|
750
|
+
voice: BoundedNativeSequencePayload;
|
|
751
|
+
image: UnboundedConstantSequencePayload;
|
|
752
|
+
'sequence-marker': JsonObject & {
|
|
753
|
+
sourceRange: {
|
|
754
|
+
start: number;
|
|
755
|
+
end: number;
|
|
756
|
+
};
|
|
757
|
+
targetRange?: {
|
|
758
|
+
start: number;
|
|
759
|
+
end: number;
|
|
760
|
+
};
|
|
761
|
+
duration: {
|
|
762
|
+
mode: 'from-source';
|
|
763
|
+
} | {
|
|
764
|
+
mode: 'fixed';
|
|
765
|
+
value: number;
|
|
766
|
+
};
|
|
767
|
+
timeRemapping?: JsonValue;
|
|
768
|
+
};
|
|
769
|
+
viewport: JsonObject;
|
|
770
|
+
'audio-script': JsonObject & {
|
|
771
|
+
segments: ScriptTextSegment[];
|
|
772
|
+
};
|
|
773
|
+
'phonetic-script': JsonObject & {
|
|
774
|
+
segments: ScriptTextSegment[];
|
|
775
|
+
};
|
|
776
|
+
caption: BoundedNativeSequencePayload;
|
|
777
|
+
}
|
|
778
|
+
type CreateEntityInput = { [K in KnownEntityKind]: {
|
|
779
|
+
entity_id?: string;
|
|
780
|
+
entity_kind: K;
|
|
781
|
+
payload: EntityPayloadByKind[K];
|
|
782
|
+
} }[KnownEntityKind];
|
|
783
|
+
interface ImportAssetInput {
|
|
784
|
+
asset_id: string;
|
|
785
|
+
entity_id?: string;
|
|
786
|
+
payload?: JsonObject;
|
|
787
|
+
}
|
|
788
|
+
interface SandboxEntity<K extends KnownEntityKind = KnownEntityKind> {
|
|
789
|
+
entity_id: string;
|
|
790
|
+
entity_kind: K;
|
|
791
|
+
payload: EntityPayloadByKind[K];
|
|
792
|
+
}
|
|
793
|
+
interface SandboxRelation {
|
|
794
|
+
relation_id: string;
|
|
795
|
+
relation_kind: KnownRelationKind;
|
|
796
|
+
endpoint_0_entity_id: string;
|
|
797
|
+
endpoint_1_entity_id: string;
|
|
798
|
+
metadata: JsonObject;
|
|
799
|
+
trace: JsonObject;
|
|
800
|
+
}
|
|
801
|
+
type EmptyRelationKind = 'timeline-track' | 'track-clip' | 'clip-marker' | 'marker-content' | 'axvideo-marker' | 'marker-timeline';
|
|
802
|
+
type LinkRelationInput = {
|
|
803
|
+
relation_id?: string;
|
|
804
|
+
relation_kind: EmptyRelationKind;
|
|
805
|
+
endpoint_0_entity_id: string;
|
|
806
|
+
endpoint_1_entity_id: string;
|
|
807
|
+
metadata?: {
|
|
808
|
+
[key: string]: never;
|
|
809
|
+
};
|
|
810
|
+
trace?: JsonObject;
|
|
811
|
+
} | {
|
|
812
|
+
relation_id?: string;
|
|
813
|
+
relation_kind: 'physical-asset'; /** Canonical endpoint 0 is sequence media; endpoint 1 is Asset. */
|
|
814
|
+
endpoint_0_entity_id: string;
|
|
815
|
+
endpoint_1_entity_id: string;
|
|
816
|
+
metadata?: JsonObject;
|
|
817
|
+
trace?: JsonObject;
|
|
818
|
+
} | {
|
|
819
|
+
relation_id?: string;
|
|
820
|
+
relation_kind: 'phonetic-script-provenance' | 'caption-provenance';
|
|
821
|
+
endpoint_0_entity_id: string;
|
|
822
|
+
endpoint_1_entity_id: string;
|
|
823
|
+
metadata: JsonObject & {
|
|
824
|
+
segmentAlignment: JsonValue;
|
|
825
|
+
};
|
|
826
|
+
trace?: JsonObject;
|
|
827
|
+
} | {
|
|
828
|
+
relation_id?: string;
|
|
829
|
+
relation_kind: 'caption-alignment';
|
|
830
|
+
endpoint_0_entity_id: string;
|
|
831
|
+
endpoint_1_entity_id: string;
|
|
832
|
+
metadata: JsonObject & {
|
|
833
|
+
alignment: JsonValue;
|
|
834
|
+
};
|
|
835
|
+
trace?: JsonObject;
|
|
836
|
+
};
|
|
837
|
+
interface LinkGeneratedRelationInput {
|
|
838
|
+
relation_id?: string;
|
|
839
|
+
/** Generated output media Entity; persisted as endpoint 0. */
|
|
840
|
+
output_entity_id: string;
|
|
841
|
+
/** Input media Entity used to generate the output; persisted as endpoint 1. */
|
|
842
|
+
input_entity_id: string;
|
|
843
|
+
trace?: JsonObject;
|
|
844
|
+
}
|
|
845
|
+
/** Explicit Entity authoring. Assets and media Entities are not one-to-one. */
|
|
846
|
+
interface EntityApi {
|
|
847
|
+
list(): SandboxEntity[];
|
|
848
|
+
get(entityId: string): SandboxEntity | null;
|
|
849
|
+
/** Call before importAsset; inspect every match and decide whether to reuse one. */
|
|
850
|
+
findByAssetId(assetId: string): SandboxEntity<'asset'>[];
|
|
851
|
+
create(input: CreateEntityInput): string;
|
|
852
|
+
/** Create only an Asset Entity when no existing match should be reused; this does not infer media. */
|
|
853
|
+
importAsset(input: ImportAssetInput): string;
|
|
854
|
+
}
|
|
855
|
+
/** Incident reads ignore endpoint position; relation semantics preserve it. */
|
|
856
|
+
interface RelationApi {
|
|
857
|
+
list(): SandboxRelation[];
|
|
858
|
+
of(entityId: string, relationKind?: KnownRelationKind): SandboxRelation[];
|
|
859
|
+
link(input: LinkRelationInput): string;
|
|
860
|
+
/** Author ordered generated(output,input). */
|
|
861
|
+
linkGenerated(input: LinkGeneratedRelationInput): string;
|
|
862
|
+
}
|
|
619
863
|
/** Clip hit from `clipsInRange`. */
|
|
620
864
|
interface TimelineClipDescriptor {
|
|
621
865
|
id: string;
|
|
@@ -658,12 +902,14 @@ interface SandboxCheckpoint {
|
|
|
658
902
|
}
|
|
659
903
|
declare const edit: EditApi;
|
|
660
904
|
declare const timeline: TimelineApi;
|
|
905
|
+
declare const entities: EntityApi;
|
|
906
|
+
declare const relations: RelationApi;
|
|
661
907
|
/** Capture a rollback point. */
|
|
662
908
|
declare function checkpoint(): SandboxCheckpoint;
|
|
663
909
|
/** Roll the sandbox document back to a prior checkpoint. */
|
|
664
910
|
declare function rollbackTo(cp: SandboxCheckpoint): void;
|
|
665
|
-
/** Host-injected
|
|
666
|
-
declare const inputs: unknown
|
|
911
|
+
/** Host-injected, pre-materialized facts. Validate each field before use. */
|
|
912
|
+
declare const inputs: Readonly<Record<string, unknown>>;
|
|
667
913
|
//#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 };
|
|
914
|
+
export type { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, BoundedDerivedSequencePayload, BoundedNativeSequencePayload, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, CreateEntityInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, EditApi, EmptyRelationKind, EntityApi, EntityPayloadByKind, ImportAssetInput, JsonObject, JsonPrimitive, JsonValue, KnownEntityKind, KnownRelationKind, LinkGeneratedRelationInput, LinkRelationInput, MoveSpeechesInput, MoveVideoClipsByAnchorInput, MoveVideoClipsInput, RelationApi, ReplaceVideoClipContentInput, ReplaceVideoClipSequenceInput, SandboxCheckpoint, SandboxEntity, SandboxRelation, ScriptTextSegment, SetBgmInput, SetCaptionStyleInput, SetCaptionVisibilityInput, SetVideoClipSpeedShiftInput, SpeechAssets, SpeedShift, TimelineApi, TimelineClipDescriptor, TimelinePartDescriptor, UnboundedConstantSequencePayload, VideoDraftProjection, Voice, checkpoint, edit, entities, inputs, relations, rollbackTo, timeline };
|
|
669
915
|
//# sourceMappingURL=sandbox-api.d.mts.map
|