@mengine/medeo-client 1.3.1-alpha.9 → 1.4.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/README.md +11 -100
- package/dist/document-DKPAavs9.js +1709 -0
- package/dist/{index-BUkDsU7c.d.ts → index-CX7IXsnp.d.ts} +655 -304
- package/dist/index.d.ts +95 -554
- package/dist/index.js +862 -2669
- package/dist/{loro-relay-doc-ssdYpuef.js → loro-relay-doc-cJSY-uau.js} +7 -2
- package/dist/relay.js +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -41
- package/package.json +8 -12
- package/dist/document-BLYcbv8E.js +0 -3623
- package/dist/index-CMa6ZCtX.d.ts +0 -609
- package/dist/schemas.d.ts +0 -2
- package/dist/schemas.js +0 -482
- package/dist/shared-iWnU2osE.js +0 -39
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { PeerID } from "loro-crdt";
|
|
1
|
+
import { $ as VideoDocumentSchemaVersion, A as assertValidVideoDocument, B as BgmPart, C as index_d_exports, D as VideoDocumentMirrorSchema, E as VideoDocumentDraft, F as SpeechHostMap, G as SpeechPart, H as DEFAULT_UNIT_TIME_MS, I as buildSpeechHostMap, J as TrackItem, K as Timeline, L as derivePositionFromAbs, M as InitialDocumentFacts, N as buildInitialVideoDocument, O as videoDocumentMirrorSchema, P as DerivedItemPosition, Q as VideoDocument, R as fromVideoDocument, S as ValidationError, T as TrackItemDraft, U as PartKind, V as CaptionPart, W as PartUnion, X as VIDEO_DOCUMENT_SCHEMA_VERSION, Y as TrackItemTimePosition, Z as VideoClipPart, _ as PlannedSemanticOpKind, a as MirrorVideoDocumentOptions, at as CaptionPart$1, b as SchemaValidator, c as CommitOptions, ct as SpeedShift, d as SemanticEditor, dt as TrackItem$1, et as VideoDocumentValidationIssue, f as SemanticOpInput, g as ImplementedSemanticOpKind, h as IMPLEMENTED_SEMANTIC_OP_KINDS, i as MirrorVideoDocumentAdapter, it as Attachment, j as validateVideoDocument, k as VideoDocumentValidationError, l as OpActor, lt as Timeline$1, m as TransactAudit, n as videoDocumentSchema, nt as VideoDraft, o as createMirrorVideoDocument, ot as CaptionStyle, p as SemanticOpName, q as Track, r as readVideoDocumentFromDraft, rt as VideoDraftPartUnion, s as createMirrorVideoDocumentAdapter, st as PartAggregation, t as partUnionSchema, tt as VideoDocumentValidationIssueCode, u as SemanticDocumentAdapter, ut as Track$1, v as SemanticOpKind, w as TrackDraft, x as SnapshotReadable, y as isImplementedSemanticOpKind, z as toVideoDocument } from "./index-CX7IXsnp.js";
|
|
2
|
+
import { LoroDoc, PeerID } from "loro-crdt";
|
|
4
3
|
import { DocState } from "@mengine/sync";
|
|
5
4
|
import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
|
|
6
5
|
|
|
@@ -178,524 +177,33 @@ interface MengineEventStreamOptions {
|
|
|
178
177
|
}
|
|
179
178
|
declare function readMengineEventStream(options: MengineEventStreamOptions): Promise<void>;
|
|
180
179
|
//#endregion
|
|
181
|
-
//#region
|
|
182
|
-
type ScriptCompositionIssueCode = 'field_conflict' | 'composition_cycle' | 'invalid_bases' | 'composition_missing' | 'composition_ambiguous' | 'composition_dangling' | 'unknown_segment' | 'empty_selection' | 'invalid_script' | 'invalid_selection';
|
|
183
|
-
/** Assembly fails explicitly when declared bases cannot provide valid, unambiguous content. */
|
|
184
|
-
declare class ScriptCompositionError extends Error {
|
|
185
|
-
readonly code: ScriptCompositionIssueCode;
|
|
186
|
-
readonly entityId: EntityId;
|
|
187
|
-
constructor(code: ScriptCompositionIssueCode, entityId: EntityId, message: string);
|
|
188
|
-
}
|
|
189
|
-
interface AssembledCaptionContent {
|
|
190
|
-
readonly caption: EntityRow<'caption'>;
|
|
191
|
-
readonly audioScript: EntityRow<'audio-script'>;
|
|
192
|
-
/** Selected AudioScript segments in Caption selection order. */
|
|
193
|
-
readonly segments: readonly ScriptTextSegment[];
|
|
194
|
-
/** Complete display text: the selected segments' text joined in order. */
|
|
195
|
-
readonly text: string;
|
|
196
|
-
}
|
|
197
|
-
interface AssembledPhoneticScriptContent {
|
|
198
|
-
readonly phoneticScript: EntityRow<'phonetic-script'>;
|
|
199
|
-
readonly audioScript: EntityRow<'audio-script'>;
|
|
200
|
-
/** All AudioScript segments in script order; the pronunciation variant never reorders text. */
|
|
201
|
-
readonly segments: readonly ScriptTextSegment[];
|
|
202
|
-
/** Complete base text owned by the AudioScript. */
|
|
203
|
-
readonly text: string;
|
|
204
|
-
}
|
|
205
|
-
/** Validate all base providers before applying explicit own fields; ordering cannot resolve ambiguity. */
|
|
206
|
-
declare function assembleEntityContent(rows: EntityRelationRows, entityId: EntityId): EntityRow;
|
|
207
|
-
/** Find the actual AudioScript text owner through direct variant bases. */
|
|
208
|
-
declare function findComposedAudioScript(rows: EntityRelationRows, variantEntityId: EntityId, variantKind: 'caption' | 'phonetic-script'): EntityRow<'audio-script'>;
|
|
209
|
-
/** Join the whole AudioScript text in segment order. */
|
|
210
|
-
declare function assembleScriptText(script: EntityRow<'audio-script'>): string;
|
|
211
|
-
/** Assemble selected text after base-field validation and explicit variant overrides. */
|
|
212
|
-
declare function assembleCaptionContent(rows: EntityRelationRows, captionEntityId: EntityId): AssembledCaptionContent;
|
|
213
|
-
/**
|
|
214
|
-
* Assemble the complete Phonetic Script content for TTS: the composed
|
|
215
|
-
* AudioScript's base text plus the variant's own phoneme and prosody fields.
|
|
216
|
-
*/
|
|
217
|
-
declare function assemblePhoneticScriptContent(rows: EntityRelationRows, phoneticScriptEntityId: EntityId): AssembledPhoneticScriptContent;
|
|
218
|
-
/** Select source text without creating another authoritative text field. */
|
|
219
|
-
declare function selectAudioScriptSegments(script: EntityRow<'audio-script'>, selections: readonly CaptionSegmentSelection[]): readonly ScriptTextSegment[];
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/entity-editor/entity-graph-http-client.d.ts
|
|
222
|
-
/** One authenticated revision of the authoritative Medeo Entity graph. */
|
|
223
|
-
interface EntityGraphState {
|
|
224
|
-
/** Fixed identity of the project's one AudioScript; present in every readable state. */
|
|
225
|
-
readonly audioScriptEntityId: string;
|
|
226
|
-
readonly revision: number;
|
|
227
|
-
readonly rows: EntityRelationRows;
|
|
228
|
-
}
|
|
229
|
-
interface EntityGraphCommitOptions {
|
|
230
|
-
/** Server version vector proving the explicit legacy-to-Entity migration baseline. */
|
|
231
|
-
readonly migrationBaseVv?: string;
|
|
232
|
-
}
|
|
233
|
-
/** Browser-safe authenticated CAS client for a document's Entity graph. */
|
|
234
|
-
declare class EntityGraphHttpClient {
|
|
235
|
-
private readonly options;
|
|
236
|
-
private readonly transport;
|
|
237
|
-
private readonly endpoint;
|
|
238
|
-
constructor(options: MengineHttpClientOptions);
|
|
239
|
-
fetchState(): Promise<EntityGraphState>;
|
|
240
|
-
/**
|
|
241
|
-
* Replace the complete Entity graph under the baseline revision.
|
|
242
|
-
*
|
|
243
|
-
* Deletion intent is derived from baseline IDs omitted from `nextRows`, so a
|
|
244
|
-
* transient create-then-remove never becomes a request to delete unknown
|
|
245
|
-
* persisted data.
|
|
246
|
-
*/
|
|
247
|
-
commit(baseState: Pick<EntityGraphState, 'revision' | 'rows'>, nextRows: EntityRelationRows, options?: EntityGraphCommitOptions): Promise<EntityGraphState>;
|
|
248
|
-
private request;
|
|
249
|
-
}
|
|
250
|
-
//#endregion
|
|
251
|
-
//#region src/entity-editor/types.d.ts
|
|
252
|
-
/** Injectable domain-id mint shared by Entity and Relation authoring surfaces. */
|
|
253
|
-
type EntityTimelineIdFactory = (prefix: 'entity' | 'relation') => string;
|
|
254
|
-
interface ImageMediaAssetFact {
|
|
255
|
-
readonly assetId: string;
|
|
256
|
-
readonly kind: 'image';
|
|
257
|
-
readonly storageKey?: string;
|
|
258
|
-
}
|
|
259
|
-
interface VideoMediaAssetFact {
|
|
260
|
-
readonly assetId: string;
|
|
261
|
-
readonly kind: 'video';
|
|
262
|
-
readonly durationMs: number;
|
|
263
|
-
readonly storageKey?: string;
|
|
264
|
-
}
|
|
265
|
-
interface AudioMediaAssetFact {
|
|
266
|
-
readonly assetId: string;
|
|
267
|
-
readonly kind: 'audio';
|
|
268
|
-
readonly durationMs: number;
|
|
269
|
-
readonly storageKey: string;
|
|
270
|
-
}
|
|
271
|
-
interface VoiceMediaAssetFact {
|
|
272
|
-
/** Stable external speech result id, independent of the placed Clip id. */
|
|
273
|
-
readonly assetId: string;
|
|
274
|
-
readonly kind: 'voice';
|
|
275
|
-
readonly durationMs: number;
|
|
276
|
-
readonly storageKey: string;
|
|
277
|
-
/** Present for synthesized voice, absent for original recorded audio. */
|
|
278
|
-
readonly voice?: VoiceDescriptor;
|
|
279
|
-
}
|
|
280
|
-
/** Facts resolved from media storage. A trim window never substitutes for intrinsic duration. */
|
|
281
|
-
type MediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact | AudioMediaAssetFact | VoiceMediaAssetFact;
|
|
282
|
-
type ClipPlacement = {
|
|
283
|
-
readonly kind: 'sequential';
|
|
284
|
-
readonly order: number;
|
|
285
|
-
} | {
|
|
286
|
-
readonly kind: 'absolute';
|
|
287
|
-
readonly targetRange: SequenceRange<number>;
|
|
288
|
-
} | {
|
|
289
|
-
readonly kind: 'anchored';
|
|
290
|
-
readonly hostClipEntityId: string;
|
|
291
|
-
readonly anchorOffset: number;
|
|
292
|
-
};
|
|
293
|
-
interface InsertPlacedClipInput {
|
|
294
|
-
readonly trackEntityId: string;
|
|
295
|
-
readonly contentEntityId: string;
|
|
296
|
-
readonly sourceRange: SequenceRange<number>;
|
|
297
|
-
readonly duration: SequenceDuration<number>;
|
|
298
|
-
readonly placement: ClipPlacement;
|
|
299
|
-
readonly clipPayload?: JsonObject;
|
|
300
|
-
/** Stable caller-owned placement identity, when one already exists outside the graph. */
|
|
301
|
-
readonly clipEntityId?: string;
|
|
302
|
-
}
|
|
303
|
-
interface SetClipPlacementInput {
|
|
304
|
-
readonly clipEntityId: string;
|
|
305
|
-
readonly placement: ClipPlacement;
|
|
306
|
-
}
|
|
307
|
-
type SequentialClipAnchor = {
|
|
308
|
-
readonly position: 'before' | 'after';
|
|
309
|
-
readonly clipEntityId: string;
|
|
310
|
-
} | {
|
|
311
|
-
readonly position: 'trackStart';
|
|
312
|
-
};
|
|
313
|
-
interface MoveSequentialClipsInput {
|
|
314
|
-
readonly clipEntityIds: readonly string[];
|
|
315
|
-
readonly anchor: SequentialClipAnchor;
|
|
316
|
-
readonly onAnchored: 'follow' | 'keepAbsolute';
|
|
317
|
-
}
|
|
318
|
-
interface MoveClipsToStartsInput {
|
|
319
|
-
readonly moves: readonly {
|
|
320
|
-
readonly clipEntityId: string;
|
|
321
|
-
readonly newStartMs: number;
|
|
322
|
-
}[];
|
|
323
|
-
/** Absolute-time drags preserve every voiceover's current visible landing. */
|
|
324
|
-
readonly onAnchored: 'keepAbsolute';
|
|
325
|
-
}
|
|
326
|
-
interface DeleteClipTreeInput {
|
|
327
|
-
readonly clipEntityIds: readonly string[];
|
|
328
|
-
readonly onAnchored: 'cascade' | 'detach';
|
|
329
|
-
}
|
|
330
|
-
interface VoiceoverCaptionFact {
|
|
331
|
-
/** Stable placed caption identity supplied by the materialized side effect. */
|
|
332
|
-
readonly captionClipEntityId: string;
|
|
333
|
-
/** Directly held bases; includes the AudioScript used by the Voice. */
|
|
334
|
-
readonly baseEntityIds: readonly string[];
|
|
335
|
-
/** Ordered selection of AudioScript segments; caption text is never passed inline. */
|
|
336
|
-
readonly selections: readonly CaptionSegmentSelection[];
|
|
337
|
-
readonly startMs: number;
|
|
338
|
-
readonly durationMs: number;
|
|
339
|
-
readonly style?: CaptionStyleFields;
|
|
340
|
-
}
|
|
341
|
-
type VoiceoverTakeInput = {
|
|
342
|
-
readonly timelineEntityId: string; /** Stable placed speech identity, distinct from media.assetId. */
|
|
343
|
-
readonly voiceoverClipEntityId: string;
|
|
344
|
-
readonly media: VoiceMediaAssetFact; /** Existing pronunciation variant; its composed AudioScript stays the text owner. */
|
|
345
|
-
readonly phoneticScriptEntityId: string;
|
|
346
|
-
readonly volume: number;
|
|
347
|
-
readonly captions: readonly VoiceoverCaptionFact[];
|
|
348
|
-
} & ({
|
|
349
|
-
readonly placement: ClipPlacement;
|
|
350
|
-
readonly hostClipEntityId?: never;
|
|
351
|
-
readonly anchorOffset?: never;
|
|
352
|
-
} | {
|
|
353
|
-
readonly placement?: never;
|
|
354
|
-
readonly hostClipEntityId: string;
|
|
355
|
-
readonly anchorOffset: number;
|
|
356
|
-
});
|
|
357
|
-
type VisualMediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact;
|
|
358
|
-
interface InsertMediaClipInput {
|
|
359
|
-
readonly timelineEntityId: string;
|
|
360
|
-
readonly clipEntityId?: string;
|
|
361
|
-
readonly media: VisualMediaAssetFact;
|
|
362
|
-
/** Source/display window in whole milliseconds. Images use this as their finite display span. */
|
|
363
|
-
readonly sourceRange: SequenceRange<number>;
|
|
364
|
-
readonly placement: ClipPlacement;
|
|
365
|
-
readonly volume?: number;
|
|
366
|
-
}
|
|
367
|
-
interface ReplaceMediaClipInput {
|
|
368
|
-
readonly clipEntityId: string;
|
|
369
|
-
readonly media: VisualMediaAssetFact;
|
|
370
|
-
readonly sourceRange: SequenceRange<number>;
|
|
371
|
-
}
|
|
372
|
-
interface ReplacementMediaClipInput {
|
|
373
|
-
readonly clipEntityId?: string;
|
|
374
|
-
readonly media: VisualMediaAssetFact;
|
|
375
|
-
readonly sourceRange: SequenceRange<number>;
|
|
376
|
-
readonly volume?: number;
|
|
377
|
-
}
|
|
378
|
-
type MediaClipInsertion = {
|
|
379
|
-
readonly kind: 'before';
|
|
380
|
-
readonly clipEntityId: string;
|
|
381
|
-
} | {
|
|
382
|
-
readonly kind: 'after';
|
|
383
|
-
readonly clipEntityId: string;
|
|
384
|
-
} | {
|
|
385
|
-
readonly kind: 'firstStart';
|
|
386
|
-
readonly startMs: number;
|
|
387
|
-
};
|
|
388
|
-
interface InsertMediaClipsInput {
|
|
389
|
-
readonly timelineEntityId: string;
|
|
390
|
-
readonly clips: readonly ReplacementMediaClipInput[];
|
|
391
|
-
/** One placement decision for the whole input-ordered block. */
|
|
392
|
-
readonly insertion: MediaClipInsertion;
|
|
393
|
-
}
|
|
394
|
-
interface ReplaceSequentialClipsInput {
|
|
395
|
-
readonly timelineEntityId: string;
|
|
396
|
-
readonly oldClipEntityIds: readonly string[];
|
|
397
|
-
readonly newClips: readonly ReplacementMediaClipInput[];
|
|
398
|
-
readonly onAnchored: 'remap' | 'cascade';
|
|
399
|
-
}
|
|
400
|
-
interface SetClipVolumeInput {
|
|
401
|
-
readonly clipEntityId: string;
|
|
402
|
-
/** Playback gain in decibels. */
|
|
403
|
-
readonly volume: number;
|
|
404
|
-
}
|
|
405
|
-
interface LinearClipSpeed {
|
|
406
|
-
readonly kind: 'linear';
|
|
407
|
-
readonly rate: number;
|
|
408
|
-
readonly mode?: string;
|
|
409
|
-
}
|
|
410
|
-
interface SetClipSpeedInput {
|
|
411
|
-
readonly clipEntityId: string;
|
|
412
|
-
readonly timeRemapping: LinearClipSpeed | null;
|
|
413
|
-
}
|
|
414
|
-
interface TrimClipInput {
|
|
415
|
-
readonly clipEntityId: string;
|
|
416
|
-
readonly sourceRange: SequenceRange<number>;
|
|
417
|
-
}
|
|
418
|
-
interface VoiceoverTakeResult {
|
|
419
|
-
readonly voiceoverClipEntityId: string;
|
|
420
|
-
readonly voiceEntityId: string;
|
|
421
|
-
/** The pronunciation variant the Voice was rendered from. */
|
|
422
|
-
readonly phoneticScriptEntityId: string;
|
|
423
|
-
/** The base-text owner resolved from the PhoneticScript baseEntityIds. */
|
|
424
|
-
readonly audioScriptEntityId: string;
|
|
425
|
-
readonly captionClipEntityIds: readonly string[];
|
|
426
|
-
}
|
|
427
|
-
interface MoveVoiceoverInput {
|
|
428
|
-
readonly voiceoverClipEntityId: string;
|
|
429
|
-
/** Absolute requested timeline start; MEngine resolves and persists the host relation. */
|
|
430
|
-
readonly newStartMs: number;
|
|
431
|
-
}
|
|
432
|
-
interface DeleteVoiceoverInput {
|
|
433
|
-
readonly voiceoverClipEntityIds: readonly string[];
|
|
434
|
-
}
|
|
435
|
-
interface SetBgmInput {
|
|
436
|
-
readonly timelineEntityId: string;
|
|
437
|
-
readonly bgmClipEntityId: string;
|
|
438
|
-
readonly media: AudioMediaAssetFact;
|
|
439
|
-
readonly volume: number;
|
|
440
|
-
}
|
|
441
|
-
interface DeleteBgmInput {
|
|
442
|
-
readonly timelineEntityId: string;
|
|
443
|
-
}
|
|
444
|
-
interface SetCaptionVisibilityInput {
|
|
445
|
-
readonly timelineEntityId: string;
|
|
446
|
-
readonly hidden: boolean;
|
|
447
|
-
}
|
|
448
|
-
interface PatchCaptionStyleInput {
|
|
449
|
-
readonly timelineEntityId: string;
|
|
450
|
-
readonly style: CaptionStyleFields;
|
|
451
|
-
}
|
|
452
|
-
interface InsertCaptionClipInput {
|
|
453
|
-
readonly timelineEntityId: string;
|
|
454
|
-
/** Stable placed caption identity, distinct from the Caption content identity. */
|
|
455
|
-
readonly captionClipEntityId?: string;
|
|
456
|
-
/** Existing bases composed by this variant; includes an AudioScript text owner. */
|
|
457
|
-
readonly baseEntityIds: readonly string[];
|
|
458
|
-
/** Ordered selection of the AudioScript segments this Caption displays. */
|
|
459
|
-
readonly selections: readonly CaptionSegmentSelection[];
|
|
460
|
-
/** Intrinsic cue length of the Caption entity itself; display comes from the placement. */
|
|
461
|
-
readonly durationMs: number;
|
|
462
|
-
readonly style?: CaptionStyleFields;
|
|
463
|
-
readonly placement: ClipPlacement;
|
|
464
|
-
}
|
|
465
|
-
interface InsertClipInput {
|
|
466
|
-
readonly trackEntityId: string;
|
|
467
|
-
/** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
|
|
468
|
-
readonly contentEntityId: string;
|
|
469
|
-
readonly sourceRange: SequenceRange<number>;
|
|
470
|
-
readonly duration: SequenceDuration<number>;
|
|
471
|
-
readonly targetRange?: SequenceRange<number>;
|
|
472
|
-
readonly clipPayload?: JsonObject;
|
|
473
|
-
}
|
|
474
|
-
interface UpdateClipMarkerInput {
|
|
475
|
-
readonly clipEntityId: string;
|
|
476
|
-
readonly sourceRange?: SequenceRange<number>;
|
|
477
|
-
/** Passing `undefined` explicitly removes the optional target range. */
|
|
478
|
-
readonly targetRange?: SequenceRange<number> | undefined;
|
|
479
|
-
readonly duration?: SequenceDuration<number>;
|
|
480
|
-
/** Passing `undefined` explicitly removes the optional remapping value. */
|
|
481
|
-
readonly timeRemapping?: JsonValue | undefined;
|
|
482
|
-
}
|
|
483
|
-
interface MoveClipInput {
|
|
484
|
-
readonly clipEntityId: string;
|
|
485
|
-
readonly trackEntityId: string;
|
|
486
|
-
}
|
|
487
|
-
interface ReplaceClipContentInput {
|
|
488
|
-
readonly clipEntityId: string;
|
|
489
|
-
/** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
|
|
490
|
-
readonly contentEntityId: string;
|
|
491
|
-
readonly sourceRange: SequenceRange<number>;
|
|
492
|
-
readonly duration: SequenceDuration<number>;
|
|
493
|
-
readonly targetRange?: SequenceRange<number>;
|
|
494
|
-
readonly timeRemapping?: JsonValue;
|
|
495
|
-
}
|
|
496
|
-
interface DeleteClipInput {
|
|
497
|
-
readonly clipEntityId: string;
|
|
498
|
-
}
|
|
499
|
-
interface UpdateClipInput {
|
|
500
|
-
readonly clipEntityId: string;
|
|
501
|
-
/** Complete replacement for the Clip-owned payload. */
|
|
502
|
-
readonly payload: JsonObject;
|
|
503
|
-
}
|
|
504
|
-
type ClipEntityId = EntityId;
|
|
505
|
-
//#endregion
|
|
506
|
-
//#region src/entity-editor/entity-timeline-editor.d.ts
|
|
507
|
-
/**
|
|
508
|
-
* Graph-native timeline authoring over authoritative Medeo Entity and Relation rows.
|
|
509
|
-
*
|
|
510
|
-
* Each mutation is applied to a detached graph, validated as a complete DSL set,
|
|
511
|
-
* and committed only after validation succeeds.
|
|
512
|
-
*/
|
|
513
|
-
declare class EntityTimelineEditor {
|
|
514
|
-
private readonly idFactory;
|
|
515
|
-
private state;
|
|
516
|
-
constructor(initialRows: EntityRelationRows, idFactory?: EntityTimelineIdFactory);
|
|
517
|
-
rows(): EntityRelationRows;
|
|
518
|
-
insertClip(input: InsertClipInput): ClipEntityId;
|
|
519
|
-
insertPlacedClip(input: InsertPlacedClipInput): ClipEntityId;
|
|
520
|
-
updateClipMarker(input: UpdateClipMarkerInput): void;
|
|
521
|
-
setClipPlacement(input: SetClipPlacementInput): void;
|
|
522
|
-
moveSequentialClips(input: MoveSequentialClipsInput): void;
|
|
523
|
-
moveClipsToStarts(input: MoveClipsToStartsInput): void;
|
|
524
|
-
moveClip(input: MoveClipInput): void;
|
|
525
|
-
replaceClipContent(input: ReplaceClipContentInput): void;
|
|
526
|
-
insertMediaClip(input: InsertMediaClipInput): ClipEntityId;
|
|
527
|
-
insertMediaClips(input: InsertMediaClipsInput): readonly ClipEntityId[];
|
|
528
|
-
replaceMediaClip(input: ReplaceMediaClipInput): void;
|
|
529
|
-
setClipVolume(input: SetClipVolumeInput): void;
|
|
530
|
-
setClipSpeed(input: SetClipSpeedInput): void;
|
|
531
|
-
trimClip(input: TrimClipInput): void;
|
|
532
|
-
replaceSequentialClips(input: ReplaceSequentialClipsInput): readonly ClipEntityId[];
|
|
533
|
-
deleteClip(input: DeleteClipInput): void;
|
|
534
|
-
deleteClipTree(input: DeleteClipTreeInput): void;
|
|
535
|
-
updateClip(input: UpdateClipInput): void;
|
|
536
|
-
upsertVoiceoverTake(input: VoiceoverTakeInput): VoiceoverTakeResult;
|
|
537
|
-
moveVoiceover(input: MoveVoiceoverInput): void;
|
|
538
|
-
deleteVoiceover(input: DeleteVoiceoverInput): void;
|
|
539
|
-
setBgm(input: SetBgmInput): ClipEntityId;
|
|
540
|
-
deleteBgm(input: DeleteBgmInput): void;
|
|
541
|
-
setCaptionVisibility(input: SetCaptionVisibilityInput): void;
|
|
542
|
-
patchCaptionStyle(input: PatchCaptionStyleInput): void;
|
|
543
|
-
/**
|
|
544
|
-
* Place a Caption as a composed variant of an existing AudioScript: the
|
|
545
|
-
* entity stores baseEntityIds, selection, optional style, and inherent cue-bounded
|
|
546
|
-
* Sequence. This helper does not copy base text. The Clip and its display Marker describe this use;
|
|
547
|
-
* moving or stretching the returned Clip later changes the Clip/Marker,
|
|
548
|
-
* never the Caption entity or the AudioScript.
|
|
549
|
-
*/
|
|
550
|
-
insertCaptionClip(input: InsertCaptionClipInput): ClipEntityId;
|
|
551
|
-
private insertPlacedClipIntoDraft;
|
|
552
|
-
private ensureRoleTrack;
|
|
553
|
-
/** The existing pronunciation variant a Voice consumes; composition is required. */
|
|
554
|
-
private requireComposedPhoneticScript;
|
|
555
|
-
/** Preserve the factual synthesis input, regardless of persisted endpoint positions. */
|
|
556
|
-
private ensurePhoneticRender;
|
|
557
|
-
private reconcileVoiceoverCaptions;
|
|
558
|
-
private ensureRoleTrackForClip;
|
|
559
|
-
private replaceCaptionAlignment;
|
|
560
|
-
/**
|
|
561
|
-
* Remove one placed Caption use. The composed AudioScript outlives the
|
|
562
|
-
* caption: it may anchor further captions and remains the text owner.
|
|
563
|
-
*/
|
|
564
|
-
private removeCaptionClipGraph;
|
|
565
|
-
private replaceAnchorHost;
|
|
566
|
-
/** Rebuild the legacy edit baseline from current visual order before a high-level cascade. */
|
|
567
|
-
private normalizeMainSequential;
|
|
568
|
-
private resolveOneVoiceoverOverlap;
|
|
569
|
-
private applyClipPlacement;
|
|
570
|
-
private reanchorAtAbsolute;
|
|
571
|
-
private removeAnchoredDescendants;
|
|
572
|
-
private removeClipGraph;
|
|
573
|
-
private transact;
|
|
574
|
-
private mintEntityId;
|
|
575
|
-
private createRelation;
|
|
576
|
-
private relinkRelation;
|
|
577
|
-
private mintRelationId;
|
|
578
|
-
}
|
|
579
|
-
//#endregion
|
|
580
|
-
//#region src/entity-editor/editor-resources.d.ts
|
|
581
|
-
declare const roleOrder: {
|
|
582
|
-
readonly caption: 0;
|
|
583
|
-
readonly video_clip: 1;
|
|
584
|
-
readonly speech: 2;
|
|
585
|
-
readonly bgm: 3;
|
|
586
|
-
};
|
|
587
|
-
type EditorTrackRole = keyof typeof roleOrder;
|
|
588
|
-
interface EditorFoundation {
|
|
589
|
-
readonly rows: EntityRelationRows;
|
|
590
|
-
readonly timelineEntityId: string;
|
|
591
|
-
readonly trackEntityIds: Readonly<Record<EditorTrackRole, string>>;
|
|
592
|
-
/** Fixed identity of the project's one AudioScript, minted here when missing. */
|
|
593
|
-
readonly audioScriptEntityId: string;
|
|
594
|
-
}
|
|
180
|
+
//#region src/editor/id-gen.d.ts
|
|
595
181
|
/**
|
|
596
|
-
*
|
|
182
|
+
* Part-id generation, aligned with the online ecosystem.
|
|
597
183
|
*
|
|
598
|
-
*
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* Commit-transition policy shared by the editor, the HTTP commit boundary, the
|
|
607
|
-
* host tool, and the entity stores. It compares the authoritative before and
|
|
608
|
-
* after rows of one CAS commit and enforces the single-identity write rules
|
|
609
|
-
* on the complete after state, with no exemption for historical graphs:
|
|
184
|
+
* The authoritative online producers — agent-harness (`@harness/shared`
|
|
185
|
+
* `genObjId`) and director.v2 (`common/obj_id.py` `gen_obj_id`) — both mint part
|
|
186
|
+
* ids as `` `${prefix}_${ulid()}` ``, and real captured drafts use exactly that
|
|
187
|
+
* shape (`clip_…` / `spe_…` / `cap_…` / `bgm_…`, each a 26-char ULID). The engine
|
|
188
|
+
* previously emitted `vc_<base36 timestamp><6 random>`, a different prefix AND a
|
|
189
|
+
* different encoding — the sole cross-repo id divergence. This module removes it
|
|
190
|
+
* by emitting the same `<prefix>_<ULID>` bytes.
|
|
610
191
|
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
* Dual-entity media graphs are rejected instead of being migrated or merged
|
|
618
|
-
* implicitly. Deleting media is explicit and allowed.
|
|
192
|
+
* The ULID is generated inline (Crockford Base32, 48-bit time + 80-bit random)
|
|
193
|
+
* rather than pulling the `ulid` npm package: the randomness class matches the
|
|
194
|
+
* old generator (both `Math.random`-based) and it keeps `@mengine/medeo-client`
|
|
195
|
+
* dependency-free for a purely mechanical id string. Part ids only need to be
|
|
196
|
+
* unique and lexicographically time-sortable, which this satisfies.
|
|
619
197
|
*/
|
|
620
|
-
declare function assertMediaAssetWritePolicy(before: EntityRelationRows, after: EntityRelationRows): void;
|
|
621
|
-
/** Add only missing editor structure; existing identities and owned settings are never replaced. */
|
|
622
|
-
declare function ensureEditorFoundation(initial: EntityRelationRows, idFactory?: EntityTimelineIdFactory, timelinePayload?: EntityRow['payload']): EditorFoundation;
|
|
623
|
-
//#endregion
|
|
624
|
-
//#region src/entity-editor/media-asset-import.d.ts
|
|
625
|
-
interface ImportedMediaAsset {
|
|
626
|
-
readonly rows: EntityRelationRows;
|
|
627
|
-
/** The single media variant identity for this asset id; it is its own Asset. */
|
|
628
|
-
readonly contentEntityId: string;
|
|
629
|
-
}
|
|
630
198
|
/**
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
*
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
* the external locator itself, and deduplicates only against existing variants
|
|
637
|
-
* that already carry the same `(system, key)`. Legacy dual-entity graphs
|
|
638
|
-
* (`asset` row plus a `physical-asset` binding) are not reused and are
|
|
639
|
-
* rejected by the canonical resource policy instead of being migrated.
|
|
199
|
+
* Online part-id semantic prefixes. `clip` (video clip) is the only value the
|
|
200
|
+
* engine currently mints (see `addVideoClips`); the rest are declared so the
|
|
201
|
+
* type documents the shared vocabulary and guards against reintroducing the old
|
|
202
|
+
* `vc`/`sp`/`cp`/`bg` names. Speech/caption/bgm ids arrive pre-minted in op
|
|
203
|
+
* payloads, so the engine never generates them itself.
|
|
640
204
|
*/
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
//#region src/entity-editor/legacy-entity-migration.d.ts
|
|
644
|
-
/** One-time import only. Ordinary editor operations must never reverse-diff a legacy document. */
|
|
645
|
-
declare function migrateLegacyTimelineToEntities(legacy: VideoDocument, assetFacts: readonly MediaAssetFact[], initial?: EntityRelationRows, idFactory?: EntityTimelineIdFactory): EntityRelationRows;
|
|
646
|
-
/** Server gate: a cutover may change representation, never the existing render facts. */
|
|
647
|
-
declare function assertEntityProjectionPreservesLegacy(legacy: VideoDocument, projection: VideoDocument, rows: EntityRelationRows): void;
|
|
648
|
-
//#endregion
|
|
649
|
-
//#region src/entity-editor/caption-content.d.ts
|
|
650
|
-
interface CaptionContentInput {
|
|
651
|
-
readonly contentEntityId: string;
|
|
652
|
-
readonly audioScriptEntityId: string;
|
|
653
|
-
readonly text: string;
|
|
654
|
-
readonly selections?: readonly CaptionSegmentSelection[];
|
|
655
|
-
readonly durationMs: number;
|
|
656
|
-
}
|
|
657
|
-
/** Author Caption content from semantic intent; callers never reconcile variant bases or assembled fields. */
|
|
658
|
-
declare function prepareCaptionContent(rows: EntityRelationRows, input: CaptionContentInput): EntityRow<'caption'>;
|
|
659
|
-
//#endregion
|
|
660
|
-
//#region src/entity-editor/document-audio-script.d.ts
|
|
661
|
-
interface DocumentAudioScript {
|
|
662
|
-
readonly entityId: string;
|
|
663
|
-
readonly segments: readonly (ScriptTextSegment & Readonly<Record<string, unknown>>)[];
|
|
664
|
-
}
|
|
665
|
-
/** Any state that carries the fixed document AudioScript identity outlet. */
|
|
666
|
-
interface DocumentAudioScriptState {
|
|
667
|
-
readonly rows: EntityRelationRows;
|
|
668
|
-
/**
|
|
669
|
-
* Fixed identity minted atomically at project initialization. `null` is only
|
|
670
|
-
* the internal revision-0 "not yet initialized" representation; normal
|
|
671
|
-
* projects never carry the legacy null association.
|
|
672
|
-
*/
|
|
673
|
-
readonly audioScriptEntityId: string | null;
|
|
674
|
-
}
|
|
675
|
-
/**
|
|
676
|
-
* Strict read of the project's one fixed AudioScript. The identity is immutable
|
|
677
|
-
* for the project's lifetime; this never selects, clears, or switches a
|
|
678
|
-
* script. Uninitialized or dangling identities are projection errors.
|
|
679
|
-
*/
|
|
680
|
-
declare function readDocumentAudioScript(state: DocumentAudioScriptState): DocumentAudioScript;
|
|
681
|
-
//#endregion
|
|
682
|
-
//#region src/editor/journal.d.ts
|
|
683
|
-
/**
|
|
684
|
-
* Wire a plain-memory adapter + editor that share a recording id factory, so
|
|
685
|
-
* every mutating transact lands in `journal` with ordered `generated_ids`.
|
|
686
|
-
*/
|
|
687
|
-
declare function createEditSandbox(document: VideoDocument, options?: PlainMemoryAdapterOptions): {
|
|
688
|
-
adapter: PlainMemoryAdapter;
|
|
689
|
-
editor: SemanticEditor;
|
|
690
|
-
journal: readonly JournalEntry[];
|
|
691
|
-
};
|
|
692
|
-
/**
|
|
693
|
-
* Re-drive `doc` from a recorded journal, forcing each entry's `generated_ids`
|
|
694
|
-
* through a queue-backed id factory. Never mints fresh ids: an empty queue on
|
|
695
|
-
* demand throws `unrecorded id`; leftover ids after an entry throws
|
|
696
|
-
* `unconsumed ids`. Legacy entries without `generated_ids` are treated as `[]`.
|
|
697
|
-
*/
|
|
698
|
-
declare function replayJournal(doc: SemanticDocumentAdapter, journal: readonly JournalEntry[]): Promise<void>;
|
|
205
|
+
type PartIdPrefix = 'clip' | 'spe' | 'cap' | 'bgm' | 'ti';
|
|
206
|
+
declare function generatePartId(prefix: PartIdPrefix): string;
|
|
699
207
|
//#endregion
|
|
700
208
|
//#region src/editor/snapshot-utils.d.ts
|
|
701
209
|
/** Main-track item identity read from a raw snapshot (only `part_id` is needed). */
|
|
@@ -788,7 +296,9 @@ type PushResultKind = 'ack' | 'duplicate' | 'rejected' | 'failed' | 'nothing_to_
|
|
|
788
296
|
*/
|
|
789
297
|
interface PushResult {
|
|
790
298
|
kind: PushResultKind;
|
|
791
|
-
/** Server
|
|
299
|
+
/** Server document sequence observed after a successful `ack` or `duplicate`. */
|
|
300
|
+
mengineUpdateSeq?: number | undefined;
|
|
301
|
+
/** @deprecated Ack-only sequence retained until consumers adopt `mengineUpdateSeq`. */
|
|
792
302
|
updateSeq?: number | undefined;
|
|
793
303
|
/** Whether the server held ops the local document lacked. See above. */
|
|
794
304
|
collaborated: boolean;
|
|
@@ -914,16 +424,6 @@ declare class ManualSyncDoc {
|
|
|
914
424
|
editorPeerId(): PeerID;
|
|
915
425
|
/** Current document projected to the legacy `VideoDraft` read shape. */
|
|
916
426
|
draft(): VideoDraft;
|
|
917
|
-
/**
|
|
918
|
-
* Replay a deterministic sandbox journal into this document.
|
|
919
|
-
*
|
|
920
|
-
* The adapter stays private so callers cannot bypass the manual-sync
|
|
921
|
-
* lifecycle; journal replay is the one host-side operation that needs the
|
|
922
|
-
* adapter's transaction boundary and recorded id queue. Durability is still
|
|
923
|
-
* explicit: call {@link push} after replay and report success only from its
|
|
924
|
-
* verdict.
|
|
925
|
-
*/
|
|
926
|
-
replayJournal(journal: readonly JournalEntry[]): Promise<void>;
|
|
927
427
|
/**
|
|
928
428
|
* Mark the document state the caller has just observed, for a later
|
|
929
429
|
* {@link hasChangedSince}.
|
|
@@ -1077,12 +577,22 @@ declare class MedeoHttpDocStorage implements DocStorage {
|
|
|
1077
577
|
* tool-level ack wait) subscribe here.
|
|
1078
578
|
*/
|
|
1079
579
|
subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
|
|
580
|
+
/** Authoritative HTTP reads and accepted pushes, never inferred from SSE bytes. */
|
|
581
|
+
subscribeServerVersion(callback: (version: Uint8Array) => void): () => void;
|
|
582
|
+
private reportServerVersion;
|
|
1080
583
|
deleteDoc(_docId: string): Promise<void>;
|
|
1081
584
|
subscribeDocUpdate(callback: (update: DocUpdate, origin: unknown) => void): () => void;
|
|
1082
585
|
private assertDocId;
|
|
1083
586
|
private emitUpdate;
|
|
1084
587
|
}
|
|
1085
588
|
//#endregion
|
|
589
|
+
//#region src/session/document-undo-manager.d.ts
|
|
590
|
+
/** Availability for this document's current editing session, not server revisions. */
|
|
591
|
+
interface MengineUndoState {
|
|
592
|
+
readonly canUndo: boolean;
|
|
593
|
+
readonly canRedo: boolean;
|
|
594
|
+
}
|
|
595
|
+
//#endregion
|
|
1086
596
|
//#region src/session/types.d.ts
|
|
1087
597
|
/**
|
|
1088
598
|
* Local storage contract the runtime depends on. Aliased to the engine
|
|
@@ -1125,6 +635,14 @@ interface WaitForServerAckOptions {
|
|
|
1125
635
|
/** Deadline in ms. Rejects with reason `timeout` when it elapses. */
|
|
1126
636
|
timeoutMs?: number;
|
|
1127
637
|
}
|
|
638
|
+
/** Document-level confirmation is independent of local operation completion. */
|
|
639
|
+
interface MengineDocSyncState {
|
|
640
|
+
/** Remote-only imports do not create a new local confirmation obligation. */
|
|
641
|
+
readonly confirmation: 'unknown' | 'pending' | 'confirmed';
|
|
642
|
+
/** Transport/activity phase. Idle does not imply confirmation; failure details
|
|
643
|
+
* remain available through push outcomes and confirmation wait errors. */
|
|
644
|
+
readonly phase: 'connecting' | 'idle' | 'syncing' | 'offline' | 'failed';
|
|
645
|
+
}
|
|
1128
646
|
interface MengineDocSessionOptions {
|
|
1129
647
|
docId: string;
|
|
1130
648
|
client: MengineHttpClient;
|
|
@@ -1135,23 +653,14 @@ interface MengineDocSessionOptions {
|
|
|
1135
653
|
*/
|
|
1136
654
|
localStorage?: DocStorageLike;
|
|
1137
655
|
sseReconnectDelayMs?: number;
|
|
1138
|
-
/**
|
|
1139
|
-
* Keep remote synchronization read-only: pull snapshot/diffs and subscribe to
|
|
1140
|
-
* SSE updates, but never POST local Loro updates to the server.
|
|
1141
|
-
*/
|
|
1142
|
-
readonlyMode?: boolean;
|
|
1143
656
|
}
|
|
1144
657
|
/**
|
|
1145
658
|
* A live editing session for one Medeo document — the single entry point clients
|
|
1146
659
|
* (FE draft driver, Agent, embeds) use to open, edit, and observe a document.
|
|
1147
660
|
*
|
|
1148
|
-
*
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1151
|
-
* ├─ ClientServerSynchronizer ── DocManager ── LoroDoc
|
|
1152
|
-
* MedeoHttpDocStorage┘ │
|
|
1153
|
-
* (remote = Rust mengine-server) ▼
|
|
1154
|
-
* MirrorVideoDocumentAdapter + SemanticEditor
|
|
661
|
+
* SemanticEditor writes through MirrorVideoDocumentAdapter directly, while
|
|
662
|
+
* DocumentUndoManager observes the same LoroDoc independently. Both mutation
|
|
663
|
+
* paths use the session's DocumentMutationGuard, closed before teardown.
|
|
1155
664
|
*
|
|
1156
665
|
* `DocManager` owns the `LoroDoc`: local edits committed on the adapter are
|
|
1157
666
|
* picked up via `subscribeLocalUpdates`, saved to local storage, then pushed to
|
|
@@ -1172,11 +681,19 @@ declare class MengineDocSession {
|
|
|
1172
681
|
private readonly manager;
|
|
1173
682
|
private readonly events;
|
|
1174
683
|
private readonly disposables;
|
|
684
|
+
private readonly mutationGuard;
|
|
1175
685
|
private adapterValue;
|
|
1176
686
|
private editorValue;
|
|
687
|
+
private undoManagerValue;
|
|
1177
688
|
private started;
|
|
689
|
+
private destroyed;
|
|
690
|
+
private lifetime;
|
|
691
|
+
private hasConnected;
|
|
692
|
+
private initialVersionValue;
|
|
693
|
+
private localVersionValue;
|
|
694
|
+
private pushErrorValue;
|
|
1178
695
|
/**
|
|
1179
|
-
* Latest server oplog version seen on
|
|
696
|
+
* Latest server oplog version seen on an authoritative HTTP response. Lets `waitForServerAck`
|
|
1180
697
|
* return without waiting when the server is already known to cover the local
|
|
1181
698
|
* doc (e.g. nothing was edited since the last confirmed push).
|
|
1182
699
|
*/
|
|
@@ -1191,14 +708,14 @@ declare class MengineDocSession {
|
|
|
1191
708
|
*/
|
|
1192
709
|
subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
|
|
1193
710
|
/**
|
|
1194
|
-
* Resolve once the server has durably accepted the local
|
|
711
|
+
* Resolve once the server has durably accepted the local commits as of
|
|
1195
712
|
* *now* — the capability an Agent tool needs to answer "did my edit land?"
|
|
1196
713
|
* before reporting success.
|
|
1197
714
|
*
|
|
1198
715
|
* Call it right after the editor ops whose durability matters. It snapshots the
|
|
1199
|
-
* local
|
|
1200
|
-
*
|
|
1201
|
-
*
|
|
716
|
+
* latest local commit's version (or the loaded baseline before any edit) and
|
|
717
|
+
* resolves when an authoritative server version covers it. Remote-only
|
|
718
|
+
* imports do not extend this target, matching the displayed confirmation state.
|
|
1202
719
|
*
|
|
1203
720
|
* Version coverage, not byte identity, is the acceptance test — for two reasons:
|
|
1204
721
|
* the ops may reach the server inside a merged blob rather than as the exact
|
|
@@ -1220,20 +737,39 @@ declare class MengineDocSession {
|
|
|
1220
737
|
* step. The committed change drives DocManager's local-update push.
|
|
1221
738
|
*/
|
|
1222
739
|
get editor(): SemanticEditor;
|
|
740
|
+
/** Current document snapshot (read model). */
|
|
741
|
+
snapshot(): VideoDocument;
|
|
742
|
+
/** Current-session undo/redo availability. Loading and closed sessions report false. */
|
|
743
|
+
getUndoState(): MengineUndoState;
|
|
1223
744
|
/**
|
|
1224
|
-
*
|
|
1225
|
-
*
|
|
1226
|
-
* remote-arrived) since the token was taken. Throws when not started.
|
|
745
|
+
* Supplies current availability immediately, then coalesces stack changes in a
|
|
746
|
+
* microtask. Session teardown publishes empty availability synchronously.
|
|
1227
747
|
*/
|
|
1228
|
-
|
|
748
|
+
subscribeUndoState(cb: (state: MengineUndoState) => void): () => void;
|
|
1229
749
|
/**
|
|
1230
|
-
*
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
750
|
+
* Undo a local edit immediately; server confirmation remains asynchronous.
|
|
751
|
+
* On a shared LWW field this writes its prior value, potentially overwriting a
|
|
752
|
+
* later remote edit to that same field. Returns false if no update is produced.
|
|
1233
753
|
*/
|
|
1234
|
-
|
|
1235
|
-
/**
|
|
1236
|
-
|
|
754
|
+
undo(options?: CommitOptions): boolean;
|
|
755
|
+
/**
|
|
756
|
+
* Restore the state visible before undo without rerunning external side effects.
|
|
757
|
+
* Returns false if no update is produced; durable confirmation is separate.
|
|
758
|
+
*/
|
|
759
|
+
redo(options?: CommitOptions): boolean;
|
|
760
|
+
/**
|
|
761
|
+
* Combine existing semantic operations (e.g. trim a clip and adjust its volume)
|
|
762
|
+
* or repeated commits during one drag gesture into a single undo step. A gesture
|
|
763
|
+
* that only previews locally and commits once on release needs no group.
|
|
764
|
+
* Each commit is immediately visible locally and enters sync independently;
|
|
765
|
+
* a later failure does not roll it back.
|
|
766
|
+
* Always pair with endUndoGroup in a finally block. Conflicting remote imports
|
|
767
|
+
* can end/split the group early, and unrelated local edits would join it.
|
|
768
|
+
* Complete asynchronous asset preparation before opening the group.
|
|
769
|
+
*/
|
|
770
|
+
beginUndoGroup(): void;
|
|
771
|
+
/** End a gesture, including one already split by a conflicting remote import. */
|
|
772
|
+
endUndoGroup(): void;
|
|
1237
773
|
/**
|
|
1238
774
|
* Start the sync stack and connect the document.
|
|
1239
775
|
*
|
|
@@ -1242,6 +778,11 @@ declare class MengineDocSession {
|
|
|
1242
778
|
* surfaces through `subscribe`.
|
|
1243
779
|
*/
|
|
1244
780
|
start(): Promise<VideoDocument>;
|
|
781
|
+
getSyncState(): MengineDocSyncState;
|
|
782
|
+
private confirmationTarget;
|
|
783
|
+
/** Immediately supplies current state; unsubscribe when the host changes docs. */
|
|
784
|
+
subscribeSyncState(cb: (state: MengineDocSyncState) => void): () => void;
|
|
785
|
+
private emitSyncState;
|
|
1245
786
|
subscribe(cb: (event: MengineDocSessionUpdateEvent) => void): () => void;
|
|
1246
787
|
onStateChange(cb: (state: DocState) => void): () => void;
|
|
1247
788
|
getState(): DocState;
|
|
@@ -1583,4 +1124,4 @@ declare function hostForAbsMs(ranges: MainClipRange[], absMs: number): MainClipR
|
|
|
1583
1124
|
*/
|
|
1584
1125
|
declare function relativePositionForAbs(ranges: MainClipRange[], absMs: number): TrackItemTimePosition;
|
|
1585
1126
|
//#endregion
|
|
1586
|
-
export { type Aggregation, type
|
|
1127
|
+
export { type Aggregation, type Attachment, type BgmPart, type CaptionPart, type CaptionStyle, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, IMPLEMENTED_SEMANTIC_OP_KINDS, type ImplementedSemanticOpKind, type InitialDocumentFacts, LANE_KINDS_IN_STACK_ORDER, type LaneKind, type MainClipRange, type MakeEmptyPart, ManualSyncDoc, type ManualSyncDocOptions, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, MemoryDocStorage, MengineAckFailedError, type MengineAuditEntry, type MengineAuditResponse, MengineDocSession, type MengineDocSessionOptions, type MengineDocSessionUpdateEvent, type MengineDocSyncState, type MengineDocumentVersion, type MengineEventStreamOptions, MengineHttpClient, type MengineHttpClientOptions, MengineHttpRequestError, MenginePushRejectedError, type MenginePushResponse, type MenginePushUpdateResponse, type MengineRejectedResponse, type MengineSnapshotResponse, type MengineSseUpdateEvent, type MengineSyncResponse, type MengineUndoState, type MengineUpdateMeta, MirrorVideoDocumentAdapter, type MirrorVideoDocumentOptions, type OpActor, type PartAggregation, type PartKind, type PartUnion, type PlannedSemanticOpKind, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, SchemaValidator, type SemanticDocumentAdapter, SemanticEditor, type SemanticOpInput, type SemanticOpKind, type SemanticOpName, type SnapshotReadable, type SolvedVideoDocument, type SpeechHostMap, type SpeechPart, type SpeedShift, TIMELINE_SKELETON_DURATION_MS, type Timeline, type TimelineDoc, type TimelineItem, type Track, type TrackDraft, type TrackItem, type TrackItemDraft, type TrackItemTimePosition, type TransactAudit, VIDEO_DOCUMENT_SCHEMA_VERSION, ValidationError, type VideoClipPart, type VideoDocument, type VideoDocumentDraft, type VideoDocumentMirrorSchema, type VideoDocumentSchemaVersion, VideoDocumentValidationError, type VideoDocumentValidationIssue, type VideoDocumentValidationIssueCode, type VideoDraft, type CaptionPart$1 as VideoDraftCaptionPart, type VideoDraftPartUnion, type Timeline$1 as VideoDraftTimeline, type Track$1 as VideoDraftTrack, type TrackItem$1 as VideoDraftTrackItem, type WaitForServerAckOptions, arrangeMainTrackSeamlessly, assertValidVideoDocument, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, decodeDocVersionMark, derivePositionFromAbs, encodeDocVersionMark, ensureLaneTrack, fillMainTrackTimeGaps, findLaneTrack, fromVideoDocument, generatePartId, getAt, hostForAbsMs, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, laneTrackId, mainTrackRanges, partDurationMs, partUnionSchema, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, resolveAllSpeechOverlaps, resolveSpeechOverlapByShiftingVideos, safeDurationMs, index_d_exports as schemas, snapshotToPlain, solveVideoDocument, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
|