@mengine/medeo-client 1.2.1-alpha.7 → 1.2.1-alpha.9
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 +63 -1
- package/dist/{document-49OdvviW.js → document-Df6awJDH.js} +1442 -6
- package/dist/{index-InEWX9rk.d.ts → index-CMa6ZCtX.d.ts} +2 -2
- package/dist/{index-BO2fSUKi.d.ts → index-CbuWTReu.d.ts} +164 -19
- package/dist/index.d.ts +346 -3
- package/dist/index.js +2172 -7
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +1 -37
- package/dist/shared-iWnU2osE.js +39 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +6 -5
|
@@ -459,8 +459,8 @@ declare const setVideoClipSpeedShiftInputSchema: z.ZodObject<{
|
|
|
459
459
|
clip_id: z.ZodString;
|
|
460
460
|
speed_shift: z.ZodNullable<z.ZodObject<{
|
|
461
461
|
category: z.ZodEnum<{
|
|
462
|
-
curve: "curve";
|
|
463
462
|
linear: "linear";
|
|
463
|
+
curve: "curve";
|
|
464
464
|
}>;
|
|
465
465
|
mode: z.ZodString;
|
|
466
466
|
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -507,8 +507,8 @@ declare const speechIdsSchema: z.ZodArray<z.ZodString>;
|
|
|
507
507
|
*/
|
|
508
508
|
declare const speedShiftSchema: z.ZodObject<{
|
|
509
509
|
category: z.ZodEnum<{
|
|
510
|
-
curve: "curve";
|
|
511
510
|
linear: "linear";
|
|
511
|
+
curve: "curve";
|
|
512
512
|
}>;
|
|
513
513
|
mode: z.ZodString;
|
|
514
514
|
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as MoveVideoClipsInput, J as ChangeSpeechScriptInput, K as DeleteBgmInput, N as MoveVideoClipsByAnchorInput, O as ReplaceVideoClipContentInput, Q as AdjustVideoClipVolumeInput, R as MoveSpeechesInput, S as SetBgmInput, T as ReplaceVideoClipSequenceInput, V as DeleteVideoClipsInput, W as DeleteSpeechesInput, Y as ChangeSpeechVoiceInput, b as SetCaptionStyleInput, ct as AddSpeechesInput, et as AdjustVideoClipDurationInput, g as SetVideoClipSpeedShiftInput, it as AdjustBgmVolumeInput, nt as AdjustSpeechVolumeInput, ot as AddVideoClipsInput, v as SetCaptionVisibilityInput } from "./index-
|
|
1
|
+
import { A as MoveVideoClipsInput, J as ChangeSpeechScriptInput, K as DeleteBgmInput, N as MoveVideoClipsByAnchorInput, O as ReplaceVideoClipContentInput, Q as AdjustVideoClipVolumeInput, R as MoveSpeechesInput, S as SetBgmInput, T as ReplaceVideoClipSequenceInput, V as DeleteVideoClipsInput, W as DeleteSpeechesInput, Y as ChangeSpeechVoiceInput, b as SetCaptionStyleInput, ct as AddSpeechesInput, et as AdjustVideoClipDurationInput, g as SetVideoClipSpeedShiftInput, it as AdjustBgmVolumeInput, nt as AdjustSpeechVolumeInput, ot as AddVideoClipsInput, v as SetCaptionVisibilityInput } from "./index-CMa6ZCtX.js";
|
|
2
2
|
import { InferInputType } from "loro-mirror";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { LoroDoc, PeerID } from "loro-crdt";
|
|
@@ -30,10 +30,10 @@ import { LoroDoc, PeerID } from "loro-crdt";
|
|
|
30
30
|
* @enum
|
|
31
31
|
*/
|
|
32
32
|
declare const PartKind$1: {
|
|
33
|
-
readonly BGM:
|
|
34
|
-
readonly CAPTION:
|
|
35
|
-
readonly SPEECH:
|
|
36
|
-
readonly VIDEO_CLIP:
|
|
33
|
+
readonly BGM: "bgm";
|
|
34
|
+
readonly CAPTION: "caption";
|
|
35
|
+
readonly SPEECH: "speech";
|
|
36
|
+
readonly VIDEO_CLIP: "video_clip";
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* @public
|
|
@@ -145,8 +145,8 @@ interface CaptionPart$1 {
|
|
|
145
145
|
* @enum
|
|
146
146
|
*/
|
|
147
147
|
declare const AspectRatio: {
|
|
148
|
-
readonly RATIO_16_9:
|
|
149
|
-
readonly RATIO_9_16:
|
|
148
|
+
readonly RATIO_16_9: "16:9";
|
|
149
|
+
readonly RATIO_9_16: "9:16";
|
|
150
150
|
};
|
|
151
151
|
/**
|
|
152
152
|
* @public
|
|
@@ -157,10 +157,10 @@ type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
|
|
|
157
157
|
* @enum
|
|
158
158
|
*/
|
|
159
159
|
declare const AssetSource: {
|
|
160
|
-
readonly AI_IMAGES:
|
|
161
|
-
readonly AI_VIDEOS:
|
|
162
|
-
readonly MY_UPLOADED_ASSETS:
|
|
163
|
-
readonly STOCK_VIDEOS:
|
|
160
|
+
readonly AI_IMAGES: "ai_images";
|
|
161
|
+
readonly AI_VIDEOS: "ai_videos";
|
|
162
|
+
readonly MY_UPLOADED_ASSETS: "my_uploaded_assets";
|
|
163
|
+
readonly STOCK_VIDEOS: "stock_videos";
|
|
164
164
|
};
|
|
165
165
|
/**
|
|
166
166
|
* @public
|
|
@@ -254,11 +254,11 @@ declare const SpeedShiftCategory: {
|
|
|
254
254
|
/**
|
|
255
255
|
* Variable speed controlled by Bezier keyframes
|
|
256
256
|
*/
|
|
257
|
-
readonly CURVE:
|
|
257
|
+
readonly CURVE: "curve";
|
|
258
258
|
/**
|
|
259
259
|
* Constant speed multiplier across the entire clip
|
|
260
260
|
*/
|
|
261
|
-
readonly LINEAR:
|
|
261
|
+
readonly LINEAR: "linear";
|
|
262
262
|
};
|
|
263
263
|
/**
|
|
264
264
|
* @public
|
|
@@ -442,8 +442,10 @@ interface VideoDraft$1 {
|
|
|
442
442
|
}
|
|
443
443
|
//#endregion
|
|
444
444
|
//#region src/document/types.d.ts
|
|
445
|
-
declare const VIDEO_DOCUMENT_SCHEMA_VERSION:
|
|
446
|
-
|
|
445
|
+
declare const VIDEO_DOCUMENT_SCHEMA_VERSION: "video-document/v0";
|
|
446
|
+
/** A server-derived compatibility view, never an editor write authority. */
|
|
447
|
+
declare const ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION: "video-document/entity-projection-v1";
|
|
448
|
+
type VideoDocumentSchemaVersion = typeof VIDEO_DOCUMENT_SCHEMA_VERSION | typeof ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION;
|
|
447
449
|
type PartKind = 'video_clip' | 'speech' | 'caption' | 'bgm';
|
|
448
450
|
/**
|
|
449
451
|
* Project-level creation settings. Mirrors the IDL, but keeps the two fields the
|
|
@@ -672,6 +674,7 @@ interface VideoDocumentMeta {
|
|
|
672
674
|
thumbnail_storage_key: VideoDraft['thumbnail_storage_key'];
|
|
673
675
|
chat_session_id: VideoDraft['chat_session_id'];
|
|
674
676
|
video_creation_settings: VideoDraft['video_creation_settings'];
|
|
677
|
+
/** Legacy imported version for v0; committed Entity revision for entity-projection-v1. */
|
|
675
678
|
version: VideoDraft['version'];
|
|
676
679
|
}
|
|
677
680
|
/**
|
|
@@ -832,6 +835,143 @@ interface InitialDocumentFacts {
|
|
|
832
835
|
*/
|
|
833
836
|
declare function buildInitialVideoDocument(facts: InitialDocumentFacts): VideoDocument;
|
|
834
837
|
//#endregion
|
|
838
|
+
//#region ../medeo-dsl/src/ids.d.ts
|
|
839
|
+
declare const entityIdBrand: unique symbol;
|
|
840
|
+
declare const relationIdBrand: unique symbol;
|
|
841
|
+
type EntityId = string & {
|
|
842
|
+
readonly [entityIdBrand]: 'EntityId';
|
|
843
|
+
};
|
|
844
|
+
type RelationId = string & {
|
|
845
|
+
readonly [relationIdBrand]: 'RelationId';
|
|
846
|
+
};
|
|
847
|
+
//#endregion
|
|
848
|
+
//#region ../medeo-dsl/src/entities.d.ts
|
|
849
|
+
type KnownEntityKind = 'axvideo' | 'timeline' | 'track' | 'clip' | 'asset' | 'video' | 'audio' | 'voice' | 'image' | 'sequence-marker' | 'viewport' | 'audio-script' | 'phonetic-script' | 'caption';
|
|
850
|
+
declare const extensionEntityKindBrand: unique symbol;
|
|
851
|
+
type ExtensionEntityKind = string & {
|
|
852
|
+
readonly [extensionEntityKindBrand]: 'ExtensionEntityKind';
|
|
853
|
+
};
|
|
854
|
+
/** Extensions require explicit branding so removed or reserved domain kinds cannot reappear accidentally. */
|
|
855
|
+
type EntityKind = KnownEntityKind | ExtensionEntityKind;
|
|
856
|
+
interface SequenceRange<Point = unknown> {
|
|
857
|
+
readonly start: Point;
|
|
858
|
+
readonly end: Point;
|
|
859
|
+
}
|
|
860
|
+
type SequenceDuration<Span = unknown> = {
|
|
861
|
+
readonly mode: 'from-source';
|
|
862
|
+
} | {
|
|
863
|
+
readonly mode: 'fixed';
|
|
864
|
+
readonly value: Span;
|
|
865
|
+
};
|
|
866
|
+
interface VoiceDescriptor {
|
|
867
|
+
readonly system: 'voice-library';
|
|
868
|
+
readonly key: string;
|
|
869
|
+
readonly name?: string;
|
|
870
|
+
}
|
|
871
|
+
interface CaptionFontDescriptor {
|
|
872
|
+
readonly system: 'font-library';
|
|
873
|
+
readonly key: string;
|
|
874
|
+
}
|
|
875
|
+
interface CaptionStyleFields {
|
|
876
|
+
readonly font?: CaptionFontDescriptor;
|
|
877
|
+
readonly fontSize?: number;
|
|
878
|
+
readonly fontColor?: string;
|
|
879
|
+
readonly fontWeight?: number;
|
|
880
|
+
readonly entranceAnimation?: string;
|
|
881
|
+
readonly entranceAnimationDurationMs?: number;
|
|
882
|
+
readonly strokeColor?: string;
|
|
883
|
+
readonly strokeWidth?: number;
|
|
884
|
+
readonly positionX?: number;
|
|
885
|
+
readonly positionY?: number;
|
|
886
|
+
}
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region ../medeo-dsl/src/json-values.d.ts
|
|
889
|
+
type JsonPrimitive = string | number | boolean | null;
|
|
890
|
+
type JsonValue = JsonPrimitive | JsonObject | readonly JsonValue[];
|
|
891
|
+
type JsonObject = {
|
|
892
|
+
readonly [key: string]: JsonValue;
|
|
893
|
+
};
|
|
894
|
+
//#endregion
|
|
895
|
+
//#region ../medeo-dsl/src/relations.d.ts
|
|
896
|
+
type KnownRelationKind = 'timeline-track' | 'track-clip' | 'clip-marker' | 'marker-content' | 'axvideo-marker' | 'marker-timeline' | 'physical-asset' | 'generated' | 'phonetic-script-provenance' | 'caption-provenance' | 'caption-alignment' | 'clip-anchor' | 'audio-script-render';
|
|
897
|
+
type RelationKind = KnownRelationKind | (string & {});
|
|
898
|
+
type RelationTrace = JsonObject;
|
|
899
|
+
/**
|
|
900
|
+
* Authoritative persisted relation value.
|
|
901
|
+
*
|
|
902
|
+
* A kind may assign semantic roles to endpoint 0 and endpoint 1. Callers and
|
|
903
|
+
* storage adapters must preserve the submitted positions; kinds whose
|
|
904
|
+
* semantics are unordered simply do not interpret those positions.
|
|
905
|
+
*/
|
|
906
|
+
interface RelationRow<K extends RelationKind = RelationKind, Metadata extends JsonObject = JsonObject> {
|
|
907
|
+
readonly relationId: RelationId;
|
|
908
|
+
readonly endpoint0EntityId: EntityId;
|
|
909
|
+
readonly endpoint1EntityId: EntityId;
|
|
910
|
+
readonly relationKind: K;
|
|
911
|
+
readonly metadata: Metadata;
|
|
912
|
+
readonly trace: RelationTrace;
|
|
913
|
+
}
|
|
914
|
+
//#endregion
|
|
915
|
+
//#region ../medeo-dsl/src/rows.d.ts
|
|
916
|
+
/** One persisted first-class entity. Its owned fields live directly in payload. */
|
|
917
|
+
interface EntityRow<K extends EntityKind = EntityKind> {
|
|
918
|
+
readonly entityId: EntityId;
|
|
919
|
+
readonly entityKind: K;
|
|
920
|
+
readonly payload: JsonObject;
|
|
921
|
+
}
|
|
922
|
+
/** Complete persistence value for an entity set and its authoritative relations. */
|
|
923
|
+
interface EntityRelationRows {
|
|
924
|
+
readonly entities: readonly EntityRow[];
|
|
925
|
+
readonly relations: readonly RelationRow[];
|
|
926
|
+
}
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region src/document/entity-projection-values.d.ts
|
|
929
|
+
/** A graph cannot be represented faithfully by the compatibility reader. */
|
|
930
|
+
declare class EntityTimelineProjectionError extends Error {
|
|
931
|
+
constructor(message: string);
|
|
932
|
+
}
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region src/document/entity-projection.d.ts
|
|
935
|
+
/**
|
|
936
|
+
* One-way compatibility view over the Entity graph. A legacy part is never
|
|
937
|
+
* consulted as an editing fact. Peer IDs appear only in this derived read
|
|
938
|
+
* contract, reconstructed from relations; they are not stored in payloads.
|
|
939
|
+
*/
|
|
940
|
+
declare function projectEntityTimeline(rows: EntityRelationRows, meta: VideoDocumentMeta): VideoDocument;
|
|
941
|
+
//#endregion
|
|
942
|
+
//#region src/document/entity-timeline-layout.d.ts
|
|
943
|
+
type EntityTimelineTrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
|
|
944
|
+
interface ResolvedEntityClipPlacement {
|
|
945
|
+
readonly clipEntityId: string;
|
|
946
|
+
readonly markerEntityId: string;
|
|
947
|
+
readonly contentEntityId: string;
|
|
948
|
+
readonly trackEntityId: string;
|
|
949
|
+
readonly start: number;
|
|
950
|
+
readonly duration: number;
|
|
951
|
+
readonly mode: 'sequential' | 'absolute' | 'anchored';
|
|
952
|
+
readonly anchorClipEntityId?: string;
|
|
953
|
+
readonly anchorOffset?: number;
|
|
954
|
+
}
|
|
955
|
+
interface ResolvedEntityTrack {
|
|
956
|
+
readonly entityId: string;
|
|
957
|
+
readonly role: EntityTimelineTrackRole;
|
|
958
|
+
readonly order: number;
|
|
959
|
+
readonly hidden: boolean;
|
|
960
|
+
readonly clips: readonly ResolvedEntityClipPlacement[];
|
|
961
|
+
}
|
|
962
|
+
interface ResolvedEntityTimelineLayout {
|
|
963
|
+
readonly tracks: readonly ResolvedEntityTrack[];
|
|
964
|
+
readonly clips: ReadonlyMap<string, ResolvedEntityClipPlacement>;
|
|
965
|
+
/** Background music fills this duration; it never extends the timeline. */
|
|
966
|
+
readonly durationMs: number;
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* Resolve only entity-owned placement facts. This does not choose new anchors,
|
|
970
|
+
* manufacture clips, or mutate a graph while reading. Write-side operations
|
|
971
|
+
* must express any detach/reparent/overlap decision in their entity plan.
|
|
972
|
+
*/
|
|
973
|
+
declare function resolveEntityTimelineLayout(rows: EntityRelationRows): ResolvedEntityTimelineLayout;
|
|
974
|
+
//#endregion
|
|
835
975
|
//#region src/document/validation.d.ts
|
|
836
976
|
/**
|
|
837
977
|
* Business-level schema guard for `VideoDocument` (RFC 03 §9). It is the gate
|
|
@@ -1356,6 +1496,8 @@ declare class MirrorVideoDocumentAdapter implements SemanticDocumentAdapter {
|
|
|
1356
1496
|
declare function createMirrorVideoDocument(document: VideoDocument, options?: MirrorVideoDocumentOptions): LoroDoc;
|
|
1357
1497
|
/** Build a `MirrorVideoDocumentAdapter` over a fresh doc seeded with `document`. */
|
|
1358
1498
|
declare function createMirrorVideoDocumentAdapter(document: VideoDocument, options?: MirrorVideoDocumentOptions): MirrorVideoDocumentAdapter;
|
|
1499
|
+
/** Host-only replacement of a derived view, retaining the existing Loro history. */
|
|
1500
|
+
declare function applyEntityTimelineProjection(doc: LoroDoc, projection: VideoDocument, entityRevision: number): Uint8Array;
|
|
1359
1501
|
/** Write a whole `VideoDocument` into a draft (seed a fresh doc / plain-memory state). */
|
|
1360
1502
|
declare function writeVideoDocumentToDraft(draft: VideoDocumentDraft, document: VideoDocument): void;
|
|
1361
1503
|
//#endregion
|
|
@@ -1491,7 +1633,10 @@ declare const partUnionSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
1491
1633
|
}, z.core.$loose>]>;
|
|
1492
1634
|
declare const videoDocumentSchema: z.ZodObject<{
|
|
1493
1635
|
meta: z.ZodObject<{
|
|
1494
|
-
schema_version: z.
|
|
1636
|
+
schema_version: z.ZodEnum<{
|
|
1637
|
+
"video-document/v0": "video-document/v0";
|
|
1638
|
+
"video-document/entity-projection-v1": "video-document/entity-projection-v1";
|
|
1639
|
+
}>;
|
|
1495
1640
|
draft_id: z.ZodOptional<z.ZodString>;
|
|
1496
1641
|
project_id: z.ZodOptional<z.ZodString>;
|
|
1497
1642
|
owner_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1506,9 +1651,9 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
1506
1651
|
tracks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1507
1652
|
id: z.ZodOptional<z.ZodString>;
|
|
1508
1653
|
parts_kind: z.ZodOptional<z.ZodEnum<{
|
|
1509
|
-
bgm: "bgm";
|
|
1510
|
-
caption: "caption";
|
|
1511
1654
|
speech: "speech";
|
|
1655
|
+
caption: "caption";
|
|
1656
|
+
bgm: "bgm";
|
|
1512
1657
|
video_clip: "video_clip";
|
|
1513
1658
|
}>>;
|
|
1514
1659
|
is_hidden: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1591,4 +1736,4 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
1591
1736
|
}, z.core.$loose>]>>>;
|
|
1592
1737
|
}, z.core.$loose>;
|
|
1593
1738
|
//#endregion
|
|
1594
|
-
export {
|
|
1739
|
+
export { EntityId as $, generatePartId as A, CaptionPart$1 as At, ResolvedEntityClipPlacement as B, PlannedSemanticOpKind as C, VideoDocumentValidationIssue as Ct, SnapshotReadable as D, effectiveVideoClipDurationMs as Dt, SchemaValidator as E, VideoDraftPartUnion as Et, videoDocumentMirrorSchema as F, Track$1 as Ft, EntityTimelineProjectionError as G, ResolvedEntityTrack as H, VideoDocumentValidationError as I, TrackItem$1 as It, JsonValue as J, EntityRelationRows as K, assertValidVideoDocument as L, TrackItemDraft as M, PartAggregation as Mt, VideoDocumentDraft as N, SpeedShift as Nt, ValidationError as O, speedOf as Ot, VideoDocumentMirrorSchema as P, Timeline$1 as Pt, VoiceDescriptor as Q, validateVideoDocument as R, ImplementedSemanticOpKind as S, VideoDocumentSchemaVersion as St, isImplementedSemanticOpKind as T, VideoDraft as Tt, resolveEntityTimelineLayout as U, ResolvedEntityTimelineLayout as V, projectEntityTimeline as W, SequenceDuration as X, CaptionStyleFields as Y, SequenceRange as Z, SemanticEditor as _, TrackItem as _t, PlainMemoryAdapter as a, derivePositionFromAbs as at, TransactAudit as b, VideoClipPart as bt, MirrorVideoDocumentAdapter as c, BgmPart as ct, createMirrorVideoDocument as d, ENTITY_TIMELINE_PROJECTION_SCHEMA_VERSION as dt, InitialDocumentFacts as et, createMirrorVideoDocumentAdapter as f, PartKind as ft, SemanticDocumentAdapter as g, Track as gt, OpActor as h, Timeline as ht, JournalEntry as i, buildSpeechHostMap as it, TrackDraft as j, CaptionStyle as jt, PartIdFactory as k, Attachment as kt, MirrorVideoDocumentOptions as l, CaptionPart as lt, CommitOptions as m, SpeechPart as mt, videoDocumentSchema as n, DerivedItemPosition as nt, PlainMemoryAdapterOptions as o, fromVideoDocument as ot, writeVideoDocumentToDraft as p, PartUnion as pt, JsonObject as q, readVideoDocumentFromDraft as r, SpeechHostMap as rt, createPlainMemoryAdapter as s, toVideoDocument as st, partUnionSchema as t, buildInitialVideoDocument as tt, applyEntityTimelineProjection as u, DEFAULT_UNIT_TIME_MS as ut, SemanticOpInput as v, TrackItemTimePosition as vt, SemanticOpKind as w, VideoDocumentValidationIssueCode as wt, IMPLEMENTED_SEMANTIC_OP_KINDS as x, VideoDocument as xt, SemanticOpName as y, VIDEO_DOCUMENT_SCHEMA_VERSION as yt, EntityTimelineTrackRole as z };
|