@mengine/medeo-tool 1.2.1-alpha.0 → 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.
@@ -192,6 +192,9 @@ 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
+ */
195
198
  interface MoveVideoClipsByAnchorInput {
196
199
  /**
197
200
  * Clips to move as one block, keeping their relative order. Need not be contiguous on the track.
@@ -415,6 +418,9 @@ interface ReplaceVideoClipContentInput {
415
418
  volume: number;
416
419
  }[];
417
420
  }
421
+ /**
422
+ * Replace a contiguous run of main-track clips with a new run.
423
+ */
418
424
  interface ReplaceVideoClipSequenceInput {
419
425
  /**
420
426
  * The clips being replaced: a contiguous main-track run, listed in timeline order
@@ -657,6 +663,7 @@ interface AdjustBgmVolumeInput {
657
663
  /** Agent write surface — one method per SemanticOp kind. */
658
664
  interface EditApi {
659
665
  moveVideoClips(input: MoveVideoClipsInput): Promise<void>;
666
+ /** Reorder a set of main-track clips relative to a reference clip. */
660
667
  moveVideoClipsByAnchor(input: MoveVideoClipsByAnchorInput): Promise<void>;
661
668
  deleteVideoClips(input: DeleteVideoClipsInput): Promise<void>;
662
669
  /** Add video clips to a track. */
@@ -666,6 +673,7 @@ interface EditApi {
666
673
  setVideoClipSpeedShift(input: SetVideoClipSpeedShiftInput): Promise<void>;
667
674
  /** Replace the media backing existing video clips. */
668
675
  replaceVideoClipContent(input: ReplaceVideoClipContentInput): Promise<void>;
676
+ /** Replace a contiguous run of main-track clips with a new run. */
669
677
  replaceVideoClipSequence(input: ReplaceVideoClipSequenceInput): Promise<void>;
670
678
  /** Re-trim existing video clips (the user-facing "adjust duration" gesture is a trim of the source window). */
671
679
  adjustVideoClipDuration(input: AdjustVideoClipDurationInput): Promise<void>;
@@ -689,6 +697,169 @@ interface EditApi {
689
697
  deleteBgm(input: DeleteBgmInput): Promise<void>;
690
698
  adjustBgmVolume(input: AdjustBgmVolumeInput): Promise<void>;
691
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
+ }
692
863
  /** Clip hit from `clipsInRange`. */
693
864
  interface TimelineClipDescriptor {
694
865
  id: string;
@@ -731,12 +902,14 @@ interface SandboxCheckpoint {
731
902
  }
732
903
  declare const edit: EditApi;
733
904
  declare const timeline: TimelineApi;
905
+ declare const entities: EntityApi;
906
+ declare const relations: RelationApi;
734
907
  /** Capture a rollback point. */
735
908
  declare function checkpoint(): SandboxCheckpoint;
736
909
  /** Roll the sandbox document back to a prior checkpoint. */
737
910
  declare function rollbackTo(cp: SandboxCheckpoint): void;
738
- /** Host-injected script arguments (opaque). */
739
- declare const inputs: unknown;
911
+ /** Host-injected, pre-materialized facts. Validate each field before use. */
912
+ declare const inputs: Readonly<Record<string, unknown>>;
740
913
  //#endregion
741
- export type { AddSpeechesInput, AddVideoClipsInput, AdjustBgmVolumeInput, AdjustSpeechVolumeInput, AdjustVideoClipDurationInput, AdjustVideoClipVolumeInput, ChangeSpeechScriptInput, ChangeSpeechVoiceInput, DeleteBgmInput, DeleteSpeechesInput, DeleteVideoClipsInput, EditApi, MoveSpeechesInput, MoveVideoClipsByAnchorInput, MoveVideoClipsInput, ReplaceVideoClipContentInput, ReplaceVideoClipSequenceInput, 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 };
742
915
  //# sourceMappingURL=sandbox-api.d.mts.map