@mengine/medeo-client 3.0.1-dsl.4 → 3.1.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.
package/dist/dsl.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as RelationValues, B as InvalidAtomic, Bt as Track, C as DslClipLayout, Ct as EntityValues, D as createInitialMedeoDsl, Dt as RelationMutation, E as DslTrackLayout, Et as Media, F as DslAudit, Ft as TextEdit, G as MedeoDslLoroState, H as isInvalidAtomic, Ht as Voice, I as DslTransaction, It as TextMark, J as OpActor, K as medeoDslLoroShape, L as UnsupportedDocumentFormatError, Lt as TextMutation, M as VoiceoverResult, Mt as RichTextSnapshot, N as CreateMedeoDslOptions, Nt as StoredFile, O as DslEditor, Ot as RelationTable, P as MedeoDsl, Pt as TextDelta, Q as DslClipUpdate, R as assertDslDocument, Rt as TextRun, S as resolveDslLayout, St as EntityTables, T as DslProjectionError, Tt as MedeoDslSnapshot, U as timeAnchorCodec, V as captionContentCodec, Vt as TrackRole, W as MedeoDslDraft, X as AddDslClipsInput, Y as AddDslClip, Z as ClipSource, _ as VideoDraftInput, _t as DeepReadonly, a as SpokenScript, at as relationId, b as VideoDraftTrack, bt as EntityMutation, c as VideoDraftProjection, ct as AudioScript, d as DEFAULT_UNIT_TIME_MS, dt as CaptionSelection, et as ReplaceDslClipsInput, f as VideoCreationSettings, ft as CaptionStyle, g as VideoDraftContentPartUnion, gt as ContainNode, h as VideoDraftContent, ht as ContainMutation, i as AudioScriptView, it as defaultIdFactory, j as VoiceoverCaptionInput, jt as ResourceSystem, k as UploadText, kt as RelationTables, l as toVideoDraft, lt as Caption, m as VideoDraftCaptionStyle, mt as Clip, n as ImportedVideoDraft, nt as DslIdFactory, o as spokenScripts, ot as resourceId, p as VideoDraft, pt as CaptionText, q as CommitOptions, r as fromVideoDraft, rt as EntityIdKind, s as toAudioScriptViews, st as tupleHash, t as FromVideoDraftOptions, tt as ClipPlacement, u as CaptionDisplayCue, ut as CaptionContent, v as VideoDraftPartUnion, vt as DslDiagnostic, w as DslLayout, wt as FieldPatch, x as VideoDraftTrackItem, xt as EntityTable, y as VideoDraftTimeline, yt as DslMutation, z as documentFormat, zt as TimeAnchor } from "./index-D1EvUTdG.js";
2
- export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, type Media, type MoveDslClipsInput, type OpActor, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type SpokenScript, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, spokenScripts, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
1
+ import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as RelationTable, B as InvalidAtomic, Bt as TextRun, C as DslClipLayout, Ct as EntityTable, D as createInitialMedeoDsl, Dt as MedeoDslSnapshot, E as DslTrackLayout, Et as FieldPatch, F as DslAudit, Ft as StoredFile, G as MedeoDslLoroState, H as isInvalidAtomic, Ht as Track, I as DslTransaction, It as TextDelta, J as OpActor, K as medeoDslLoroShape, L as UnsupportedDocumentFormatError, Lt as TextEdit, M as VoiceoverResult, Mt as RelationValues, N as CreateMedeoDslOptions, Nt as ResourceSystem, O as DslEditor, Ot as Media, P as MedeoDsl, Pt as RichTextSnapshot, Q as DslClipUpdate, R as assertDslDocument, Rt as TextMark, S as resolveDslLayout, St as EntityMutation, T as DslProjectionError, Tt as EntityValues, U as timeAnchorCodec, Ut as TrackRole, V as captionContentCodec, Vt as TimeAnchor, W as MedeoDslDraft, Wt as Voice, X as AddDslClipsInput, Y as AddDslClip, Z as ClipSource, _ as VideoDraftInput, _t as ContainMutation, a as fromVideoDraft, at as EntityIdKind, b as VideoDraftTrack, bt as DslDiagnostic, c as VideoDraftProjection, ct as resourceId, d as DEFAULT_UNIT_TIME_MS, dt as Caption, et as ReplaceDslClipsInput, f as VideoCreationSettings, ft as CaptionContent, g as VideoDraftContentPartUnion, gt as Clip, h as VideoDraftContent, ht as CaptionText, i as ImportedVideoDraft, it as DslIdFactory, j as VoiceoverCaptionInput, jt as RelationTables, k as UploadText, kt as RelationMutation, l as toVideoDraft, lt as tupleHash, m as VideoDraftCaptionStyle, mt as CaptionStyle, n as normalizeLegacyVideoDraft, nt as BLANK_PLACEHOLDER, o as AudioScriptView, ot as defaultIdFactory, p as VideoDraft, pt as CaptionSelection, q as CommitOptions, r as FromVideoDraftOptions, rt as missingMediaPlaceholder, s as toAudioScriptViews, st as relationId, t as NormalizedLegacyVideoDraft, tt as ClipPlacement, u as CaptionDisplayCue, ut as AudioScript, v as VideoDraftPartUnion, vt as ContainNode, w as DslLayout, wt as EntityTables, x as VideoDraftTrackItem, xt as DslMutation, y as VideoDraftTimeline, yt as DeepReadonly, z as documentFormat, zt as TextMutation } from "./index-BOPcHqIj.js";
2
+ export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, BLANK_PLACEHOLDER, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, type Media, type MoveDslClipsInput, type NormalizedLegacyVideoDraft, type OpActor, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
package/dist/dsl.js CHANGED
@@ -1,2 +1,2 @@
1
- import { S as tupleHash, _ as resolveDslLayout, a as DslEditor, b as relationId, c as MedeoDsl, f as documentFormat, g as timeAnchorCodec, h as isInvalidAtomic, i as createInitialMedeoDsl, l as UnsupportedDocumentFormatError, m as captionContentCodec, n as toVideoDraft, o as spokenScripts, p as medeoDslLoroShape, r as DEFAULT_UNIT_TIME_MS, s as toAudioScriptViews, t as fromVideoDraft, u as assertDslDocument, v as DslProjectionError, x as resourceId, y as defaultIdFactory } from "./dsl-DgUxcAg3.js";
2
- export { DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, MedeoDsl, UnsupportedDocumentFormatError, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, spokenScripts, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
1
+ import { C as tupleHash, S as resourceId, _ as DslProjectionError, a as createInitialMedeoDsl, b as defaultIdFactory, c as MedeoDsl, d as documentFormat, f as medeoDslLoroShape, g as resolveDslLayout, h as timeAnchorCodec, i as DEFAULT_UNIT_TIME_MS, l as UnsupportedDocumentFormatError, m as isInvalidAtomic, n as fromVideoDraft, o as DslEditor, p as captionContentCodec, r as toVideoDraft, s as toAudioScriptViews, t as normalizeLegacyVideoDraft, u as assertDslDocument, v as BLANK_PLACEHOLDER, x as relationId, y as missingMediaPlaceholder } from "./dsl-C0-G8JVT.js";
2
+ export { BLANK_PLACEHOLDER, DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, MedeoDsl, UnsupportedDocumentFormatError, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
@@ -2,7 +2,11 @@ import { ContainerType, Cursor, LoroDoc, PeerID, TreeID } from "loro-crdt";
2
2
 
3
3
  //#region ../medeo-dsl/src/types.d.ts
4
4
  type TrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
5
- type ResourceSystem = 'memota' | 'memota-speech';
5
+ /**
6
+ * Where a resource's bytes live. `placeholder` is no store: its Images stand in for a visual Clip a
7
+ * legacy VideoDraft placed without media ({@link BLANK_PLACEHOLDER}) or with media found missing.
8
+ */
9
+ type ResourceSystem = 'memota' | 'memota-speech' | 'placeholder';
6
10
  interface Track$1 {
7
11
  role: TrackRole;
8
12
  hidden?: boolean;
@@ -335,6 +339,22 @@ type EntityIdKind = 'timeline' | 'track' | 'clip' | 'audio-script' | 'segment' |
335
339
  type DslIdFactory = (kind: EntityIdKind) => string;
336
340
  declare const defaultIdFactory: DslIdFactory;
337
341
  //#endregion
342
+ //#region ../medeo-dsl/src/fields.d.ts
343
+ /**
344
+ * A placeholder medium is an Image with no file, standing in where a legacy VideoDraft placed a
345
+ * visual clip the old editor drew as a blank (D196). The blank one stands in for a clip placed
346
+ * without media (`origin_media_id: ''`); one keyed by a memota media id stands in for media the
347
+ * clip named but Director found missing, so the id survives. Importing keeps the clips' time on
348
+ * them instead of dropping them. Only migration authors them.
349
+ */
350
+ declare const BLANK_PLACEHOLDER: {
351
+ readonly system: "placeholder";
352
+ readonly key: "blank";
353
+ readonly kind: "image";
354
+ };
355
+ /** The placeholder for a memota media id Director found missing. */
356
+ declare function missingMediaPlaceholder(mediaId: string): Media;
357
+ //#endregion
338
358
  //#region src/dsl/action-context.d.ts
339
359
  type ClipPlacement = {
340
360
  kind: 'sequential';
@@ -404,7 +424,7 @@ interface CommitOptions {
404
424
  actor?: OpActor;
405
425
  }
406
426
  //#endregion
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
427
+ //#region ../../node_modules/.pnpm/loro-mirror@2.3.3_patch_hash=a551a0e4aa4f61ec88b0d9e970a183b5ee2955107a2e0bb03b378bc510c2f395_loro-crdt@1.16.4/node_modules/loro-mirror/dist/schema/types.d.ts
408
428
  /**
409
429
  * Options for schema definitions
410
430
  */
@@ -829,12 +849,20 @@ declare const medeoDslLoroShape: RootSchemaType<{
829
849
  options: {};
830
850
  };
831
851
  'phonetic-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
832
- binding: /*elided*/any;
852
+ phoneme: /*elided*/any;
853
+ system: /*elided*/any;
854
+ key: /*elided*/any;
855
+ storageKey: /*elided*/any;
856
+ digest: /*elided*/any;
833
857
  }> & {
834
858
  options: {};
835
859
  } & {
836
860
  catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
837
- binding: /*elided*/any;
861
+ phoneme: /*elided*/any;
862
+ system: /*elided*/any;
863
+ key: /*elided*/any;
864
+ storageKey: /*elided*/any;
865
+ digest: /*elided*/any;
838
866
  }, C>;
839
867
  }> & {
840
868
  options: {};
@@ -927,9 +955,8 @@ type ContainDraftNode = Omit<Input['contain-relations'][number], 'id' | 'childre
927
955
  children: ContainDraftNode[];
928
956
  };
929
957
  type DraftFields<T> = T extends Cursor ? T : T extends (infer Item)[] ? DraftFields<Item>[] : T extends object ? { [K in keyof T as undefined extends T[K] ? never : K]: DraftFields<T[K]> } & { [K in keyof T as undefined extends T[K] ? K : never]?: DraftFields<T[K]> } : T;
930
- type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations' | 'phonetic-script-entities'>> & {
958
+ type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations'>> & {
931
959
  'contain-relations': ContainDraftNode[];
932
- 'phonetic-script-entities': Record<string, PhoneticScript>;
933
960
  };
934
961
  //#endregion
935
962
  //#region ../medeo-dsl/src/schema/codec.d.ts
@@ -953,7 +980,7 @@ declare const captionContentCodec: AtomicCodec<SegmentSelection>;
953
980
  declare function documentFormat(doc: LoroDoc): 'dsl' | 'legacy' | 'mixed' | 'unknown';
954
981
  declare class UnsupportedDocumentFormatError extends Error {
955
982
  readonly code = "unsupported_document_format";
956
- constructor(message?: string);
983
+ constructor();
957
984
  }
958
985
  /** Run after initial import, before opening an editable handle. Empty new documents still have one Timeline. */
959
986
  declare function assertDslDocument(doc: LoroDoc): void;
@@ -1030,8 +1057,6 @@ declare class MedeoDsl {
1030
1057
  applyMutations(mutations: readonly DslMutation[], audit: DslAudit): void;
1031
1058
  editText(scriptId: string, segmentId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
1032
1059
  editCaptionText(captionId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
1033
- /** Check the session's write capability before an Action starts host-owned resource I/O. */
1034
- assertWritable(): void;
1035
1060
  /**
1036
1061
  * A run inside one segment as native Cursors. Local ranges exclude insertions at their start and
1037
1062
  * include insertions at their end. K01 remains deferred.
@@ -1039,7 +1064,6 @@ declare class MedeoDsl {
1039
1064
  textRange(scriptId: string, segmentId: string, start: number, end: number): SegmentSelection;
1040
1065
  dispose(): void;
1041
1066
  private mutate;
1042
- private assertReadyToWrite;
1043
1067
  private notify;
1044
1068
  private assertActive;
1045
1069
  }
@@ -1068,9 +1092,9 @@ interface ApplyVoiceoverInput {
1068
1092
  kind: 'voiceover-recording';
1069
1093
  };
1070
1094
  /**
1071
- * What the recording says: a PhoneticScript it was spoken from, or plain words from an existing
1072
- * or new AudioScript. Plain words get selection-only PhoneticScripts (D190), one per segment;
1073
- * no control content, file or digest is invented. Captions keep selecting the base script.
1095
+ * What the recording says: an existing AudioScript, a new one of these `segments`, or a
1096
+ * PhoneticScript it was spoken from. A recording spoken from a PhoneticScript is derived-from it,
1097
+ * and its captions select segments of that variant's base script.
1074
1098
  */
1075
1099
  script: {
1076
1100
  audioScriptId: string;
@@ -1777,13 +1801,6 @@ interface VideoDraftProjection {
1777
1801
  declare function toVideoDraft(snapshot: MedeoDslSnapshot): VideoDraftProjection;
1778
1802
  //#endregion
1779
1803
  //#region src/dsl/projection/audio-scripts.d.ts
1780
- /** The script a recording says and its phonetic origins; old direct script origins remain readable. */
1781
- interface SpokenScript {
1782
- audioScriptId: string;
1783
- phoneticScriptId?: string;
1784
- /** Several plain selections of the same script; the singular summary is omitted. */
1785
- phoneticScriptIds?: string[];
1786
- }
1787
1804
  /**
1788
1805
  * An AudioScript with everything that says or shows it, read from the same snapshot as the
1789
1806
  * VideoDraft. Speeches and captions come in playback order.
@@ -1819,9 +1836,8 @@ interface AudioScriptView {
1819
1836
  /** Speech Clips playing a recording of these words. */
1820
1837
  speeches: {
1821
1838
  clipId: string;
1822
- recordingId: string; /** Its single phonetic origin; omitted for multiple origins or an old direct script origin. */
1823
- phoneticScriptId?: string; /** Multiple segment selections used by one recording, without duplicating its Clip. */
1824
- phoneticScriptIds?: string[];
1839
+ recordingId: string; /** The PhoneticScript the recording was spoken from; absent when it derives from the script directly. */
1840
+ phoneticScriptId?: string;
1825
1841
  voices: {
1826
1842
  voiceId: string;
1827
1843
  key: string;
@@ -1840,12 +1856,6 @@ interface AudioScriptView {
1840
1856
  segment: number;
1841
1857
  }[];
1842
1858
  }
1843
- /**
1844
- * The scripts a recording says. It follows derived-from from the recording; a PhoneticScript is a
1845
- * variant, so its words are the base its phoneme names, and derived-from is not followed past it.
1846
- * When nothing is found that way, a script read off the recording itself is what it says.
1847
- */
1848
- declare function spokenScripts(snapshot: MedeoDslSnapshot, recordingId: string): SpokenScript[];
1849
1859
  /** Every AudioScript in the document with its PhoneticScripts, the Speech Clips saying it and the Caption Clips showing it. */
1850
1860
  declare function toAudioScriptViews(snapshot: MedeoDslSnapshot): AudioScriptView[];
1851
1861
  //#endregion
@@ -1862,4 +1872,12 @@ interface ImportedVideoDraft {
1862
1872
  /** One-time import into a newly owned document; never reverse-diff a live collaborative document. */
1863
1873
  declare function fromVideoDraft(input: VideoDraftInput, options: FromVideoDraftOptions): ImportedVideoDraft;
1864
1874
  //#endregion
1865
- export { MoveDslClipsInput as $, ApplyVoiceoverInput as A, RelationValues as At, InvalidAtomic as B, Track$1 as Bt, DslClipLayout as C, EntityValues as Ct, createInitialMedeoDsl as D, RelationMutation as Dt, DslTrackLayout as E, Media as Et, DslAudit as F, TextEdit as Ft, MedeoDslLoroState as G, isInvalidAtomic as H, Voice as Ht, DslTransaction as I, TextMark as It, OpActor as J, medeoDslLoroShape as K, UnsupportedDocumentFormatError as L, TextMutation as Lt, VoiceoverResult as M, RichTextSnapshot as Mt, CreateMedeoDslOptions as N, StoredFile as Nt, DslEditor as O, RelationTable as Ot, MedeoDsl as P, TextDelta as Pt, DslClipUpdate as Q, assertDslDocument as R, TextRun as Rt, resolveDslLayout as S, EntityTables as St, DslProjectionError as T, MedeoDslSnapshot as Tt, timeAnchorCodec as U, captionContentCodec as V, TrackRole as Vt, MedeoDslDraft as W, AddDslClipsInput as X, AddDslClip as Y, ClipSource as Z, VideoDraftInput as _, DeepReadonly as _t, SpokenScript as a, relationId as at, VideoDraftTrack as b, EntityMutation as bt, VideoDraftProjection as c, AudioScript as ct, DEFAULT_UNIT_TIME_MS as d, CaptionSelection as dt, ReplaceDslClipsInput as et, VideoCreationSettings as f, CaptionStyle$1 as ft, VideoDraftContentPartUnion as g, ContainNode as gt, VideoDraftContent as h, ContainMutation as ht, AudioScriptView as i, defaultIdFactory as it, VoiceoverCaptionInput as j, ResourceSystem as jt, UploadText as k, RelationTables as kt, toVideoDraft as l, Caption as lt, VideoDraftCaptionStyle as m, Clip as mt, ImportedVideoDraft as n, DslIdFactory as nt, spokenScripts as o, resourceId as ot, VideoDraft as p, CaptionText as pt, CommitOptions as q, fromVideoDraft as r, EntityIdKind as rt, toAudioScriptViews as s, tupleHash as st, FromVideoDraftOptions as t, ClipPlacement as tt, CaptionDisplayCue as u, CaptionContent as ut, VideoDraftPartUnion as v, DslDiagnostic as vt, DslLayout as w, FieldPatch as wt, VideoDraftTrackItem as x, EntityTable as xt, VideoDraftTimeline as y, DslMutation as yt, documentFormat as z, TimeAnchor as zt };
1875
+ //#region src/dsl/projection/normalize-legacy-video-draft.d.ts
1876
+ interface NormalizedLegacyVideoDraft {
1877
+ draft: VideoDraftInput;
1878
+ /** One entry per repair, naming the part or field and its value before and after. */
1879
+ diagnostics: DslDiagnostic[];
1880
+ }
1881
+ declare function normalizeLegacyVideoDraft(input: VideoDraftInput, mediaFacts?: readonly Media[]): NormalizedLegacyVideoDraft;
1882
+ //#endregion
1883
+ export { MoveDslClipsInput as $, ApplyVoiceoverInput as A, RelationTable as At, InvalidAtomic as B, TextRun as Bt, DslClipLayout as C, EntityTable as Ct, createInitialMedeoDsl as D, MedeoDslSnapshot as Dt, DslTrackLayout as E, FieldPatch as Et, DslAudit as F, StoredFile as Ft, MedeoDslLoroState as G, isInvalidAtomic as H, Track$1 as Ht, DslTransaction as I, TextDelta as It, OpActor as J, medeoDslLoroShape as K, UnsupportedDocumentFormatError as L, TextEdit as Lt, VoiceoverResult as M, RelationValues as Mt, CreateMedeoDslOptions as N, ResourceSystem as Nt, DslEditor as O, Media as Ot, MedeoDsl as P, RichTextSnapshot as Pt, DslClipUpdate as Q, assertDslDocument as R, TextMark as Rt, resolveDslLayout as S, EntityMutation as St, DslProjectionError as T, EntityValues as Tt, timeAnchorCodec as U, TrackRole as Ut, captionContentCodec as V, TimeAnchor as Vt, MedeoDslDraft as W, Voice as Wt, AddDslClipsInput as X, AddDslClip as Y, ClipSource as Z, VideoDraftInput as _, ContainMutation as _t, fromVideoDraft as a, EntityIdKind as at, VideoDraftTrack as b, DslDiagnostic as bt, VideoDraftProjection as c, resourceId as ct, DEFAULT_UNIT_TIME_MS as d, Caption as dt, ReplaceDslClipsInput as et, VideoCreationSettings as f, CaptionContent as ft, VideoDraftContentPartUnion as g, Clip as gt, VideoDraftContent as h, CaptionText as ht, ImportedVideoDraft as i, DslIdFactory as it, VoiceoverCaptionInput as j, RelationTables as jt, UploadText as k, RelationMutation as kt, toVideoDraft as l, tupleHash as lt, VideoDraftCaptionStyle as m, CaptionStyle$1 as mt, normalizeLegacyVideoDraft as n, BLANK_PLACEHOLDER as nt, AudioScriptView as o, defaultIdFactory as ot, VideoDraft as p, CaptionSelection as pt, CommitOptions as q, FromVideoDraftOptions as r, missingMediaPlaceholder as rt, toAudioScriptViews as s, relationId as st, NormalizedLegacyVideoDraft as t, ClipPlacement as tt, CaptionDisplayCue as u, AudioScript as ut, VideoDraftPartUnion as v, ContainNode as vt, DslLayout as w, EntityTables as wt, VideoDraftTrackItem as x, DslMutation as xt, VideoDraftTimeline as y, DeepReadonly as yt, documentFormat as z, TextMutation as zt };
@@ -1,4 +1,4 @@
1
- import { O as DslEditor, P as MedeoDsl, Tt as MedeoDslSnapshot, Vt as TrackRole, c as VideoDraftProjection, h as VideoDraftContent, i as AudioScriptView, jt as ResourceSystem, k as UploadText, q as CommitOptions, vt as DslDiagnostic } from "./index-D1EvUTdG.js";
1
+ import { Dt as MedeoDslSnapshot, Nt as ResourceSystem, O as DslEditor, P as MedeoDsl, Ut as TrackRole, bt as DslDiagnostic, c as VideoDraftProjection, h as VideoDraftContent, k as UploadText, o as AudioScriptView, q as CommitOptions } from "./index-BOPcHqIj.js";
2
2
  import { LoroDoc, PeerID, VersionVector } from "loro-crdt";
3
3
  import { DocState, LocalSaveState } from "@mengine/sync";
4
4
  import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
@@ -255,7 +255,7 @@ type PushResultKind = 'ack' | 'duplicate' | 'rejected' | 'failed' | 'nothing_to_
255
255
  */
256
256
  interface PushResult {
257
257
  kind: PushResultKind;
258
- /** Server sequence from an `ack`/`duplicate`, retained on an idle retry so its revision can be verified. */
258
+ /** Server document sequence observed after a successful `ack` or `duplicate`. */
259
259
  mengineUpdateSeq?: number | undefined;
260
260
  /** @deprecated Ack-only sequence retained until consumers adopt `mengineUpdateSeq`. */
261
261
  updateSeq?: number | undefined;
@@ -301,12 +301,10 @@ interface ManualSyncDocOptions {
301
301
  }
302
302
  /** Shared explicit pull/push lifecycle; model-specific editors never implement transport. */
303
303
  declare class ManualSyncTransport {
304
- protected readonly client: MengineHttpClient;
304
+ private readonly client;
305
305
  protected readonly doc: LoroDoc;
306
306
  private watermark;
307
307
  private disposed;
308
- /** A retry with no new bytes still verifies the revision from its last durable receipt. */
309
- private confirmedSequence?;
310
308
  protected constructor(client: MengineHttpClient, doc: LoroDoc, watermark: VersionVector);
311
309
  editorPeerId(): PeerID;
312
310
  protected assertActive(): void;
@@ -540,8 +538,6 @@ declare class ManualSyncDoc extends ManualSyncTransport {
540
538
  }[];
541
539
  };
542
540
  projectVideoDraft(): VideoDraftProjection;
543
- /** Read the acknowledged server revision; without a new push, confirm against the current server view. */
544
- readPersistedDraft(updateSeq?: number): Promise<MengineDraftResponse>;
545
541
  dispose(): void;
546
542
  }
547
543
  //#endregion
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as RelationValues, B as InvalidAtomic, Bt as Track, C as DslClipLayout, Ct as EntityValues, D as createInitialMedeoDsl, Dt as RelationMutation, E as DslTrackLayout, Et as Media, F as DslAudit, Ft as TextEdit, G as MedeoDslLoroState, H as isInvalidAtomic, Ht as Voice, I as DslTransaction, It as TextMark, J as OpActor, K as medeoDslLoroShape, L as UnsupportedDocumentFormatError, Lt as TextMutation, M as VoiceoverResult, Mt as RichTextSnapshot, N as CreateMedeoDslOptions, Nt as StoredFile, O as DslEditor, Ot as RelationTable, P as MedeoDsl, Pt as TextDelta, Q as DslClipUpdate, R as assertDslDocument, Rt as TextRun, S as resolveDslLayout, St as EntityTables, T as DslProjectionError, Tt as MedeoDslSnapshot, U as timeAnchorCodec, V as captionContentCodec, Vt as TrackRole, W as MedeoDslDraft, X as AddDslClipsInput, Y as AddDslClip, Z as ClipSource, _ as VideoDraftInput, _t as DeepReadonly, a as SpokenScript, at as relationId, b as VideoDraftTrack, bt as EntityMutation, c as VideoDraftProjection, ct as AudioScript, d as DEFAULT_UNIT_TIME_MS, dt as CaptionSelection, et as ReplaceDslClipsInput, f as VideoCreationSettings, ft as CaptionStyle, g as VideoDraftContentPartUnion, gt as ContainNode, h as VideoDraftContent, ht as ContainMutation, i as AudioScriptView, it as defaultIdFactory, j as VoiceoverCaptionInput, jt as ResourceSystem, k as UploadText, kt as RelationTables, l as toVideoDraft, lt as Caption, m as VideoDraftCaptionStyle, mt as Clip, n as ImportedVideoDraft, nt as DslIdFactory, o as spokenScripts, ot as resourceId, p as VideoDraft, pt as CaptionText, q as CommitOptions, r as fromVideoDraft, rt as EntityIdKind, s as toAudioScriptViews, st as tupleHash, t as FromVideoDraftOptions, tt as ClipPlacement, u as CaptionDisplayCue, ut as CaptionContent, v as VideoDraftPartUnion, vt as DslDiagnostic, w as DslLayout, wt as FieldPatch, x as VideoDraftTrackItem, xt as EntityTable, y as VideoDraftTimeline, yt as DslMutation, z as documentFormat, zt as TimeAnchor } from "./index-D1EvUTdG.js";
2
- import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, _ as ManualSyncDocOptions, a as MengineDocSessionOptions, b as DocVersionMark, c as WaitForLocalSaveOptions, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDoc, h as PushOutcomeKind, i as MengineAckFailedError, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, n as MengineDocSession, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, r as MengineDocSessionUpdateEvent, s as MengineLocalSaveState, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-iEPbMfoP.js";
3
- export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DocStorageLike, type DocVersionMark, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, ManualSyncDoc, type ManualSyncDocOptions, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type Media, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineDraftResponse, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, type MengineLocalSaveState, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, type MoveDslClipsInput, type OpActor, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type SpokenScript, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, type WaitForLocalSaveOptions, type WaitForServerAckOptions, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, readMengineEventStream, relationId, resolveDslLayout, resourceId, spokenScripts, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
1
+ import { $ as MoveDslClipsInput, A as ApplyVoiceoverInput, At as RelationTable, B as InvalidAtomic, Bt as TextRun, C as DslClipLayout, Ct as EntityTable, D as createInitialMedeoDsl, Dt as MedeoDslSnapshot, E as DslTrackLayout, Et as FieldPatch, F as DslAudit, Ft as StoredFile, G as MedeoDslLoroState, H as isInvalidAtomic, Ht as Track, I as DslTransaction, It as TextDelta, J as OpActor, K as medeoDslLoroShape, L as UnsupportedDocumentFormatError, Lt as TextEdit, M as VoiceoverResult, Mt as RelationValues, N as CreateMedeoDslOptions, Nt as ResourceSystem, O as DslEditor, Ot as Media, P as MedeoDsl, Pt as RichTextSnapshot, Q as DslClipUpdate, R as assertDslDocument, Rt as TextMark, S as resolveDslLayout, St as EntityMutation, T as DslProjectionError, Tt as EntityValues, U as timeAnchorCodec, Ut as TrackRole, V as captionContentCodec, Vt as TimeAnchor, W as MedeoDslDraft, Wt as Voice, X as AddDslClipsInput, Y as AddDslClip, Z as ClipSource, _ as VideoDraftInput, _t as ContainMutation, a as fromVideoDraft, at as EntityIdKind, b as VideoDraftTrack, bt as DslDiagnostic, c as VideoDraftProjection, ct as resourceId, d as DEFAULT_UNIT_TIME_MS, dt as Caption, et as ReplaceDslClipsInput, f as VideoCreationSettings, ft as CaptionContent, g as VideoDraftContentPartUnion, gt as Clip, h as VideoDraftContent, ht as CaptionText, i as ImportedVideoDraft, it as DslIdFactory, j as VoiceoverCaptionInput, jt as RelationTables, k as UploadText, kt as RelationMutation, l as toVideoDraft, lt as tupleHash, m as VideoDraftCaptionStyle, mt as CaptionStyle, n as normalizeLegacyVideoDraft, nt as BLANK_PLACEHOLDER, o as AudioScriptView, ot as defaultIdFactory, p as VideoDraft, pt as CaptionSelection, q as CommitOptions, r as FromVideoDraftOptions, rt as missingMediaPlaceholder, s as toAudioScriptViews, st as relationId, t as NormalizedLegacyVideoDraft, tt as ClipPlacement, u as CaptionDisplayCue, ut as AudioScript, v as VideoDraftPartUnion, vt as ContainNode, w as DslLayout, wt as EntityTables, x as VideoDraftTrackItem, xt as DslMutation, y as VideoDraftTimeline, yt as DeepReadonly, z as documentFormat, zt as TextMutation } from "./index-BOPcHqIj.js";
2
+ import { A as MenginePushRejectedError, B as MengineSyncResponse, C as PushResult, D as MengineHttpClient, E as readMengineEventStream, F as MenginePushResponse, H as base64ToBytes, I as MenginePushUpdateResponse, L as MengineRejectedResponse, M as MengineAuditResponse, N as MengineDocumentVersion, O as MengineHttpClientOptions, P as MengineDraftResponse, R as MengineSnapshotResponse, S as PullResult, T as MengineEventStreamOptions, U as bytesToBase64, V as MengineUpdateMeta, _ as ManualSyncDocOptions, a as MengineDocSessionOptions, b as DocVersionMark, c as WaitForLocalSaveOptions, d as MengineUndoState, f as MedeoHttpDocStorage, g as ManualSyncDoc, h as PushOutcomeKind, i as MengineAckFailedError, j as MengineAuditEntry, k as MengineHttpRequestError, l as WaitForServerAckOptions, m as PushOutcome, n as MengineDocSession, o as MengineDocSyncState, p as MedeoHttpDocStorageOptions, r as MengineDocSessionUpdateEvent, s as MengineLocalSaveState, t as MemoryDocStorage, u as DocStorageLike, v as decodeDocVersionMark, w as PushResultKind, x as PullFailureReason, y as encodeDocVersionMark, z as MengineSseUpdateEvent } from "./index-C_wwGt5k.js";
3
+ export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, BLANK_PLACEHOLDER, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DocStorageLike, type DocVersionMark, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, ManualSyncDoc, type ManualSyncDocOptions, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type Media, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineDraftResponse, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, type MengineLocalSaveState, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, type MoveDslClipsInput, type NormalizedLegacyVideoDraft, type OpActor, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, type WaitForLocalSaveOptions, type WaitForServerAckOptions, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, readMengineEventStream, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
2
- import { S as tupleHash, _ as resolveDslLayout, a as DslEditor, b as relationId, c as MedeoDsl, f as documentFormat, g as timeAnchorCodec, h as isInvalidAtomic, i as createInitialMedeoDsl, l as UnsupportedDocumentFormatError, m as captionContentCodec, n as toVideoDraft, o as spokenScripts, p as medeoDslLoroShape, r as DEFAULT_UNIT_TIME_MS, s as toAudioScriptViews, t as fromVideoDraft, u as assertDslDocument, v as DslProjectionError, x as resourceId, y as defaultIdFactory } from "./dsl-DgUxcAg3.js";
2
+ import { C as tupleHash, S as resourceId, _ as DslProjectionError, a as createInitialMedeoDsl, b as defaultIdFactory, c as MedeoDsl, d as documentFormat, f as medeoDslLoroShape, g as resolveDslLayout, h as timeAnchorCodec, i as DEFAULT_UNIT_TIME_MS, l as UnsupportedDocumentFormatError, m as isInvalidAtomic, n as fromVideoDraft, o as DslEditor, p as captionContentCodec, r as toVideoDraft, s as toAudioScriptViews, t as normalizeLegacyVideoDraft, u as assertDslDocument, v as BLANK_PLACEHOLDER, x as relationId, y as missingMediaPlaceholder } from "./dsl-C0-G8JVT.js";
3
3
  import { LoroDoc, UndoManager, VersionVector, decodeImportBlobMeta } from "loro-crdt";
4
4
  import { ClientServerSynchronizer, DocManager } from "@mengine/sync";
5
5
  import { DisposableSet, EventBus, Task } from "@mengine/utils";
@@ -295,8 +295,6 @@ var ManualSyncTransport = class {
295
295
  doc;
296
296
  watermark;
297
297
  disposed = false;
298
- /** A retry with no new bytes still verifies the revision from its last durable receipt. */
299
- confirmedSequence;
300
298
  constructor(client, doc, watermark) {
301
299
  this.client = client;
302
300
  this.doc = doc;
@@ -399,8 +397,7 @@ var ManualSyncTransport = class {
399
397
  const localVersion = this.doc.oplogVersion();
400
398
  if (covers(this.watermark, localVersion)) return {
401
399
  kind: "nothing_to_push",
402
- collaborated: false,
403
- ...this.confirmedSequence === void 0 ? {} : { mengineUpdateSeq: this.confirmedSequence }
400
+ collaborated: false
404
401
  };
405
402
  const update = this.doc.export({
406
403
  mode: "update",
@@ -410,7 +407,6 @@ var ManualSyncTransport = class {
410
407
  const response = await this.client.pushUpdate(update);
411
408
  const serverVV = this.serverVVFrom(response.version?.server_vv);
412
409
  if (serverVV != null) this.watermark = serverVV;
413
- this.confirmedSequence = response.version?.update_seq ?? response.update_seq ?? void 0;
414
410
  return {
415
411
  kind: response.kind,
416
412
  mengineUpdateSeq: response.version?.update_seq ?? response.update_seq ?? void 0,
@@ -477,15 +473,6 @@ var ManualSyncDoc = class ManualSyncDoc extends ManualSyncTransport {
477
473
  projectVideoDraft() {
478
474
  return toVideoDraft(this.snapshot());
479
475
  }
480
- /** Read the acknowledged server revision; without a new push, confirm against the current server view. */
481
- async readPersistedDraft(updateSeq) {
482
- this.assertActive();
483
- const result = updateSeq === void 0 ? await this.client.fetchDraft() : await this.client.fetchDraftAt(updateSeq);
484
- this.assertActive();
485
- if (updateSeq !== void 0 && result.version.update_seq !== updateSeq) throw new Error("The projected revision does not match the push receipt");
486
- if (!covers(VersionVector.decode(base64ToBytes(result.version.server_vv)), this.doc.oplogVersion())) throw new Error("The projected server revision does not hold the local update");
487
- return result;
488
- }
489
476
  dispose() {
490
477
  this.dsl.dispose();
491
478
  super.dispose();
@@ -1472,4 +1459,4 @@ var MengineDocSession = class extends DocumentSession {
1472
1459
  }
1473
1460
  };
1474
1461
  //#endregion
1475
- export { DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, ManualSyncDoc, MedeoDsl, MedeoHttpDocStorage, MemoryDocStorage, MengineAckFailedError, MengineDocSession, MengineHttpClient, MengineHttpRequestError, MenginePushRejectedError, UnsupportedDocumentFormatError, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, readMengineEventStream, relationId, resolveDslLayout, resourceId, spokenScripts, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
1462
+ export { BLANK_PLACEHOLDER, DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, ManualSyncDoc, MedeoDsl, MedeoHttpDocStorage, MemoryDocStorage, MengineAckFailedError, MengineDocSession, MengineHttpClient, MengineHttpRequestError, MenginePushRejectedError, UnsupportedDocumentFormatError, assertDslDocument, base64ToBytes, bytesToBase64, captionContentCodec, createInitialMedeoDsl, decodeDocVersionMark, defaultIdFactory, documentFormat, encodeDocVersionMark, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, missingMediaPlaceholder, normalizeLegacyVideoDraft, readMengineEventStream, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as MedeoDsl, p as VideoDraft } from "./index-D1EvUTdG.js";
1
+ import { P as MedeoDsl, p as VideoDraft } from "./index-BOPcHqIj.js";
2
2
  import { LoroDoc } from "loro-crdt";
3
3
 
4
4
  //#region src/testing/in-memory-mengine-server.d.ts
@@ -18,7 +18,6 @@ declare class InMemoryMengineServer {
18
18
  private readonly subscribers;
19
19
  private seq;
20
20
  private hasSnapshot;
21
- private readonly revisions;
22
21
  /**
23
22
  * Close every open SSE stream, simulating a network drop. Clients reconnect
24
23
  * (a fresh `/events`) and catch up via their next sync — used to exercise
package/dist/testing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
2
- import { a as DslEditor, c as MedeoDsl, d as assertPhoneticBindingFormat, f as documentFormat, i as createInitialMedeoDsl, n as toVideoDraft, u as assertDslDocument, v as DslProjectionError } from "./dsl-DgUxcAg3.js";
2
+ import { a as createInitialMedeoDsl, c as MedeoDsl, d as documentFormat, o as DslEditor, r as toVideoDraft, u as assertDslDocument } from "./dsl-C0-G8JVT.js";
3
3
  import { t as classifyUpdate } from "./loro-relay-doc-Bi6JKqtQ.js";
4
4
  import { LoroDoc, VersionVector, encodeFrontiers } from "loro-crdt";
5
5
  //#region src/testing/in-memory-mengine-server.ts
@@ -19,7 +19,6 @@ var InMemoryMengineServer = class {
19
19
  subscribers = /* @__PURE__ */ new Set();
20
20
  seq = 0;
21
21
  hasSnapshot = false;
22
- revisions = /* @__PURE__ */ new Map();
23
22
  /**
24
23
  * Close every open SSE stream, simulating a network drop. Clients reconnect
25
24
  * (a fresh `/events`) and catch up via their next sync — used to exercise
@@ -40,7 +39,6 @@ var InMemoryMengineServer = class {
40
39
  try {
41
40
  this.doc.import(dsl.doc.export({ mode: "snapshot" }));
42
41
  this.hasSnapshot = true;
43
- this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
44
42
  return new Response(await this.handleSnapshot().text(), {
45
43
  status: 201,
46
44
  headers: { "content-type": "application/json" }
@@ -49,33 +47,22 @@ var InMemoryMengineServer = class {
49
47
  dsl.dispose();
50
48
  }
51
49
  }
52
- const revision = /^revisions\/(\d+)\/draft$/.exec(path);
53
- if ((path === "draft" || revision) && method === "GET") {
50
+ if (path === "draft" && method === "GET") {
54
51
  if (!this.hasSnapshot) return this.handleSnapshot();
55
- const seq = revision ? Number(revision[1]) : this.seq;
56
- const snapshot = this.revisions.get(seq);
57
- if (!snapshot) return Response.json({
58
- code: "not_found",
59
- message: "revision not found"
60
- }, { status: 404 });
61
- const attached = new LoroDoc();
62
- attached.import(snapshot);
63
- const dsl = new MedeoDsl(attached);
52
+ assertDslDocument(this.doc);
53
+ const dsl = new MedeoDsl(this.doc);
64
54
  try {
65
- assertDslDocument(attached);
66
55
  return Response.json({
67
56
  ...toVideoDraft(dsl.getSnapshot()),
68
- version: this.version(attached, seq)
57
+ version: this.version()
69
58
  });
70
59
  } catch (error) {
71
- return Response.json({
72
- code: revision ? "revision_unprojectable" : "projection_unsupported",
73
- message: String(error),
74
- ...error instanceof DslProjectionError ? { issues: error.issues } : {}
75
- }, { status: 422 });
60
+ return Response.json({ error: {
61
+ code: "projection_unsupported",
62
+ message: String(error)
63
+ } }, { status: 422 });
76
64
  } finally {
77
65
  dsl.dispose();
78
- attached.free();
79
66
  }
80
67
  }
81
68
  if (/^\/internal\/mengine\/v1\/docs\/[^/]+\/bootstrap$/.test(new URL(url).pathname) && method === "POST") return this.handleBootstrap(init);
@@ -94,11 +81,11 @@ var InMemoryMengineServer = class {
94
81
  const afterDocId = url.slice(start + 21);
95
82
  return afterDocId.slice(afterDocId.indexOf("/") + 1);
96
83
  }
97
- version(doc = this.doc, seq = this.seq) {
84
+ version() {
98
85
  return {
99
- update_seq: seq,
100
- server_vv: bytesToBase64(doc.oplogVersion().encode()),
101
- frontiers: bytesToBase64(encodeFrontiers(doc.oplogFrontiers()))
86
+ update_seq: this.seq,
87
+ server_vv: bytesToBase64(this.doc.oplogVersion().encode()),
88
+ frontiers: bytesToBase64(encodeFrontiers(this.doc.oplogFrontiers()))
102
89
  };
103
90
  }
104
91
  handleSnapshot() {
@@ -117,7 +104,6 @@ var InMemoryMengineServer = class {
117
104
  if (body.snapshot != null && !this.hasSnapshot) {
118
105
  this.doc.import(base64ToBytes(body.snapshot));
119
106
  this.hasSnapshot = true;
120
- this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
121
107
  }
122
108
  return this.handleSnapshot();
123
109
  }
@@ -181,13 +167,7 @@ var InMemoryMengineServer = class {
181
167
  probe.import(this.doc.export({ mode: "snapshot" }));
182
168
  probe.import(data);
183
169
  const format = documentFormat(probe);
184
- let unsupported = format === "legacy" || format === "mixed";
185
- if (format === "dsl") try {
186
- assertPhoneticBindingFormat(probe);
187
- } catch {
188
- unsupported = true;
189
- }
190
- if (unsupported) return Response.json({
170
+ if (format === "legacy" || format === "mixed") return Response.json({
191
171
  kind: "rejected",
192
172
  code: "unsupported_document_format",
193
173
  message: "Retired document content roots are not supported",
@@ -199,7 +179,6 @@ var InMemoryMengineServer = class {
199
179
  this.doc.import(data);
200
180
  this.hasSnapshot = true;
201
181
  this.seq += 1;
202
- this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
203
182
  const meta = extractMeta(this.doc, baseVV);
204
183
  const stored = {
205
184
  updateSeq: this.seq,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mengine/medeo-client",
3
- "version": "3.0.1-dsl.4",
3
+ "version": "3.1.0",
4
4
  "license": "UNLICENSED",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,6 @@
16
16
  ".": "./dist/index.js",
17
17
  "./dsl": "./dist/dsl.js",
18
18
  "./relay": "./dist/relay.js",
19
- "./schemas": "./dist/schemas.js",
20
19
  "./testing": "./dist/testing.js",
21
20
  "./package.json": "./package.json"
22
21
  },
@@ -26,15 +25,14 @@
26
25
  },
27
26
  "dependencies": {
28
27
  "@noble/hashes": "^2.4.0",
29
- "zod": "^4.4.3",
30
- "@mengine/storage": "3.0.1-dsl.4",
31
- "@mengine/sync": "3.0.1-dsl.4",
32
- "@mengine/utils": "3.0.1-dsl.4"
28
+ "@mengine/storage": "3.1.0",
29
+ "@mengine/sync": "3.1.0",
30
+ "@mengine/utils": "3.1.0"
33
31
  },
34
32
  "devDependencies": {
35
33
  "@types/node": "^25.9.1",
36
34
  "@typescript/native-preview": "7.0.0-dev.20260521.1",
37
- "loro-crdt": "^1.16.1",
35
+ "loro-crdt": "^1.16.4",
38
36
  "loro-mirror": "2.3.3",
39
37
  "tsx": "^4.22.3",
40
38
  "typescript": "^6.0.3",
@@ -44,7 +42,7 @@
44
42
  "@mengine/medeo-dsl": "0.0.0"
45
43
  },
46
44
  "peerDependencies": {
47
- "loro-crdt": "^1.16.1"
45
+ "loro-crdt": "^1.16.4"
48
46
  },
49
47
  "inlinedDependencies": {
50
48
  "immer": "10.2.0",