@mengine/medeo-client 2.0.1-alpha.6 → 2.0.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/{document-N-8GwtOX.js → document-Bnxm1p5E.js} +150 -181
- package/dist/{index-B31KeDzA.d.ts → index-CDrPUhBH.d.ts} +276 -181
- package/dist/index.d.ts +94 -134
- package/dist/index.js +368 -104
- 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 +2 -2
- package/dist/testing.js +4 -19
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as index_d_exports } from "./index-CMa6ZCtX.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as SpeechHostMap, A as assertValidVideoDocument, At as VideoDocumentValidationIssueCode, B as EntityRow, Bt as SpeedShift, C as isImplementedSemanticOpKind, Ct as Timeline, D as PartIdFactory, Dt as VideoClipPart, E as ValidationError, Et as TrackItemTimePosition, F as ResolvedEntityTrack, Ft as speedOf, G as SequenceDuration, H as CaptionSegmentSelection, Ht as Track$1, I as resolveEntityTimelineLayout, It as Attachment, J as JsonObject, K as SequenceRange, L as projectEntityTimeline, Lt as CaptionPart$1, M as EntityTimelineTrackRole, Mt as VideoDraftContent, N as ResolvedEntityClipPlacement, Nt as VideoDraftPartUnion, O as generatePartId, Ot as VideoDocument, P as ResolvedEntityTimelineLayout, Pt as effectiveVideoClipDurationMs, Q as DerivedItemPosition, R as EntityTimelineProjectionError, Rt as CaptionStyle, S as SemanticOpKind, St as SpeechPart, T as SnapshotReadable, Tt as TrackItem, U as CaptionStyleFields, Ut as TrackItem$1, V as RelationRow, Vt as Timeline$1, W as ScriptTextSegment, X as EntityId, Y as JsonValue, Z as buildInitialVideoDocument, _ as SemanticOpName, _t as CaptionDisplayCue, a as PlainMemoryAdapter, at as LaneKind, b as ImplementedSemanticOpKind, bt as PartKind, c as MirrorVideoDocumentAdapter, ct as findLaneTrack, d as createMirrorVideoDocumentAdapter, dt as TrackDraft, et as buildSpeechHostMap, f as CommitOptions, ft as TrackItemDraft, g as SemanticOpInput, gt as BgmPart, h as SemanticEditor, ht as videoDocumentMirrorSchema, i as JournalEntry, it as LANE_KINDS_IN_STACK_ORDER, j as validateVideoDocument, jt as VideoDraft, k as VideoDocumentValidationError, kt as VideoDocumentValidationIssue, l as MirrorVideoDocumentOptions, lt as laneTrackId, m as SemanticDocumentAdapter, mt as VideoDocumentMirrorSchema, n as videoDocumentSchema, nt as fromVideoDocument, o as PlainMemoryAdapterOptions, ot as SolvedVideoDocument, p as OpActor, pt as VideoDocumentDraft, q as VoiceDescriptor, r as readVideoDocumentFromDraft, rt as toVideoDocument, s as createPlainMemoryAdapter, st as ensureLaneTrack, t as partUnionSchema, tt as derivePositionFromAbs, u as createMirrorVideoDocument, ut as solveVideoDocument, v as TransactAudit, vt as CaptionPart, w as SchemaValidator, wt as Track, x as PlannedSemanticOpKind, xt as PartUnion, y as IMPLEMENTED_SEMANTIC_OP_KINDS, yt as DEFAULT_UNIT_TIME_MS, z as EntityRelationRows, zt as PartAggregation } from "./index-CDrPUhBH.js";
|
|
3
3
|
import { LoroDoc, PeerID } from "loro-crdt";
|
|
4
4
|
import { DocState } from "@mengine/sync";
|
|
5
5
|
import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
|
|
@@ -134,7 +134,6 @@ declare class MengineHttpClient {
|
|
|
134
134
|
private readonly fetchImpl;
|
|
135
135
|
constructor(options: MengineHttpClientOptions);
|
|
136
136
|
fetchSnapshot(): Promise<MengineSnapshotResponse>;
|
|
137
|
-
bootstrapSnapshot(snapshot: Uint8Array): Promise<MengineSnapshotResponse>;
|
|
138
137
|
/**
|
|
139
138
|
* Loro VV-diff pull: send the caller's oplog `VersionVector.encode` as `from`
|
|
140
139
|
* (omit for a full pull) and receive exactly the updates it is missing plus
|
|
@@ -175,6 +174,8 @@ interface MengineEventStreamOptions {
|
|
|
175
174
|
/** Fired once the stream response is established (HTTP ok, body readable). */
|
|
176
175
|
onOpen?(): void;
|
|
177
176
|
onUpdate(event: MengineSseUpdateEvent): void;
|
|
177
|
+
/** A committed update omitted from live transport; fetch the missing operations by VV. */
|
|
178
|
+
onResync?(): void;
|
|
178
179
|
}
|
|
179
180
|
declare function readMengineEventStream(options: MengineEventStreamOptions): Promise<void>;
|
|
180
181
|
//#endregion
|
|
@@ -953,7 +954,9 @@ type PushResultKind = 'ack' | 'duplicate' | 'rejected' | 'failed' | 'nothing_to_
|
|
|
953
954
|
*/
|
|
954
955
|
interface PushResult {
|
|
955
956
|
kind: PushResultKind;
|
|
956
|
-
/** Server
|
|
957
|
+
/** Server document sequence observed after a successful `ack` or `duplicate`. */
|
|
958
|
+
mengineUpdateSeq?: number | undefined;
|
|
959
|
+
/** @deprecated Ack-only sequence retained until consumers adopt `mengineUpdateSeq`. */
|
|
957
960
|
updateSeq?: number | undefined;
|
|
958
961
|
/** Whether the server held ops the local document lacked. See above. */
|
|
959
962
|
collaborated: boolean;
|
|
@@ -1047,6 +1050,8 @@ declare class ManualSyncDoc {
|
|
|
1047
1050
|
private readonly client;
|
|
1048
1051
|
private readonly doc;
|
|
1049
1052
|
private readonly adapter;
|
|
1053
|
+
/** Whether this document's timeline is owned by the Entity graph. */
|
|
1054
|
+
isEntityDocument(): boolean;
|
|
1050
1055
|
readonly editor: SemanticEditor;
|
|
1051
1056
|
/**
|
|
1052
1057
|
* The version the server is known to hold. Starts empty (nothing confirmed)
|
|
@@ -1060,8 +1065,7 @@ declare class ManualSyncDoc {
|
|
|
1060
1065
|
* Fetches the snapshot up front rather than starting empty and converging: the
|
|
1061
1066
|
* agent's first act is to read the document, so there is no useful state before
|
|
1062
1067
|
* the snapshot lands. This also fails fast and loudly on a document that does
|
|
1063
|
-
* not exist
|
|
1064
|
-
* waiting forever for content that will never arrive.
|
|
1068
|
+
* not exist or whose first snapshot is incomplete or invalid.
|
|
1065
1069
|
*/
|
|
1066
1070
|
static open(options: ManualSyncDocOptions): Promise<ManualSyncDoc>;
|
|
1067
1071
|
/** Current document read model (authoritative shape). */
|
|
@@ -1077,8 +1081,8 @@ declare class ManualSyncDoc {
|
|
|
1077
1081
|
* was passed to the constructor.
|
|
1078
1082
|
*/
|
|
1079
1083
|
editorPeerId(): PeerID;
|
|
1080
|
-
/** Current
|
|
1081
|
-
|
|
1084
|
+
/** Current content projected into the compatible track and part read shape. */
|
|
1085
|
+
content(): VideoDraftContent;
|
|
1082
1086
|
/**
|
|
1083
1087
|
* Replay a deterministic sandbox journal into this document.
|
|
1084
1088
|
*
|
|
@@ -1095,9 +1099,8 @@ declare class ManualSyncDoc {
|
|
|
1095
1099
|
*
|
|
1096
1100
|
* This pair replaces the legacy integer-version comparison that
|
|
1097
1101
|
* `DraftVersionDetector` used to tell the LLM "the draft was modified
|
|
1098
|
-
* externally, reload before editing".
|
|
1099
|
-
*
|
|
1100
|
-
* vectors restores the same capability.
|
|
1102
|
+
* externally, reload before editing". Comparing Loro version vectors covers
|
|
1103
|
+
* all collaborative edits without a business revision field in the document.
|
|
1101
1104
|
*
|
|
1102
1105
|
* Same capability, not a stronger one: like the legacy detector, this only
|
|
1103
1106
|
* reports what changed between two moments the caller chose to sample.
|
|
@@ -1242,12 +1245,24 @@ declare class MedeoHttpDocStorage implements DocStorage {
|
|
|
1242
1245
|
* tool-level ack wait) subscribe here.
|
|
1243
1246
|
*/
|
|
1244
1247
|
subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
|
|
1248
|
+
/** Observe live hints that require VV catch-up without replacing the SSE connection. */
|
|
1249
|
+
subscribeResync(callback: () => void): () => void;
|
|
1250
|
+
/** Authoritative HTTP reads and accepted pushes, never inferred from SSE bytes. */
|
|
1251
|
+
subscribeServerVersion(callback: (version: Uint8Array) => void): () => void;
|
|
1252
|
+
private reportServerVersion;
|
|
1245
1253
|
deleteDoc(_docId: string): Promise<void>;
|
|
1246
1254
|
subscribeDocUpdate(callback: (update: DocUpdate, origin: unknown) => void): () => void;
|
|
1247
1255
|
private assertDocId;
|
|
1248
1256
|
private emitUpdate;
|
|
1249
1257
|
}
|
|
1250
1258
|
//#endregion
|
|
1259
|
+
//#region src/session/document-undo-manager.d.ts
|
|
1260
|
+
/** Availability for this document's current editing session, not server revisions. */
|
|
1261
|
+
interface MengineUndoState {
|
|
1262
|
+
readonly canUndo: boolean;
|
|
1263
|
+
readonly canRedo: boolean;
|
|
1264
|
+
}
|
|
1265
|
+
//#endregion
|
|
1251
1266
|
//#region src/session/types.d.ts
|
|
1252
1267
|
/**
|
|
1253
1268
|
* Local storage contract the runtime depends on. Aliased to the engine
|
|
@@ -1290,6 +1305,14 @@ interface WaitForServerAckOptions {
|
|
|
1290
1305
|
/** Deadline in ms. Rejects with reason `timeout` when it elapses. */
|
|
1291
1306
|
timeoutMs?: number;
|
|
1292
1307
|
}
|
|
1308
|
+
/** Document-level confirmation is independent of local operation completion. */
|
|
1309
|
+
interface MengineDocSyncState {
|
|
1310
|
+
/** Remote-only imports do not create a new local confirmation obligation. */
|
|
1311
|
+
readonly confirmation: 'unknown' | 'pending' | 'confirmed';
|
|
1312
|
+
/** Transport/activity phase. Idle does not imply confirmation; failure details
|
|
1313
|
+
* remain available through push outcomes and confirmation wait errors. */
|
|
1314
|
+
readonly phase: 'connecting' | 'idle' | 'syncing' | 'offline' | 'failed';
|
|
1315
|
+
}
|
|
1293
1316
|
interface MengineDocSessionOptions {
|
|
1294
1317
|
docId: string;
|
|
1295
1318
|
client: MengineHttpClient;
|
|
@@ -1310,13 +1333,9 @@ interface MengineDocSessionOptions {
|
|
|
1310
1333
|
* A live editing session for one Medeo document — the single entry point clients
|
|
1311
1334
|
* (FE draft driver, Agent, embeds) use to open, edit, and observe a document.
|
|
1312
1335
|
*
|
|
1313
|
-
*
|
|
1314
|
-
*
|
|
1315
|
-
*
|
|
1316
|
-
* ├─ ClientServerSynchronizer ── DocManager ── LoroDoc
|
|
1317
|
-
* MedeoHttpDocStorage┘ │
|
|
1318
|
-
* (remote = Rust mengine-server) ▼
|
|
1319
|
-
* MirrorVideoDocumentAdapter + SemanticEditor
|
|
1336
|
+
* SemanticEditor writes through MirrorVideoDocumentAdapter directly, while
|
|
1337
|
+
* DocumentUndoManager observes the same LoroDoc independently. Both mutation
|
|
1338
|
+
* paths use the session's DocumentMutationGuard, closed before teardown.
|
|
1320
1339
|
*
|
|
1321
1340
|
* `DocManager` owns the `LoroDoc`: local edits committed on the adapter are
|
|
1322
1341
|
* picked up via `subscribeLocalUpdates`, saved to local storage, then pushed to
|
|
@@ -1337,11 +1356,20 @@ declare class MengineDocSession {
|
|
|
1337
1356
|
private readonly manager;
|
|
1338
1357
|
private readonly events;
|
|
1339
1358
|
private readonly disposables;
|
|
1359
|
+
private readonly mutationGuard;
|
|
1340
1360
|
private adapterValue;
|
|
1341
1361
|
private editorValue;
|
|
1362
|
+
private undoManagerValue;
|
|
1342
1363
|
private started;
|
|
1364
|
+
private startTask;
|
|
1365
|
+
private destroyed;
|
|
1366
|
+
private lifetime;
|
|
1367
|
+
private hasConnected;
|
|
1368
|
+
private initialVersionValue;
|
|
1369
|
+
private localVersionValue;
|
|
1370
|
+
private pushErrorValue;
|
|
1343
1371
|
/**
|
|
1344
|
-
* Latest server oplog version seen on
|
|
1372
|
+
* Latest server oplog version seen on an authoritative HTTP response. Lets `waitForServerAck`
|
|
1345
1373
|
* return without waiting when the server is already known to cover the local
|
|
1346
1374
|
* doc (e.g. nothing was edited since the last confirmed push).
|
|
1347
1375
|
*/
|
|
@@ -1356,14 +1384,14 @@ declare class MengineDocSession {
|
|
|
1356
1384
|
*/
|
|
1357
1385
|
subscribePushOutcome(callback: (outcome: PushOutcome) => void): () => void;
|
|
1358
1386
|
/**
|
|
1359
|
-
* Resolve once the server has durably accepted the local
|
|
1387
|
+
* Resolve once the server has durably accepted the local commits as of
|
|
1360
1388
|
* *now* — the capability an Agent tool needs to answer "did my edit land?"
|
|
1361
1389
|
* before reporting success.
|
|
1362
1390
|
*
|
|
1363
1391
|
* Call it right after the editor ops whose durability matters. It snapshots the
|
|
1364
|
-
* local
|
|
1365
|
-
*
|
|
1366
|
-
*
|
|
1392
|
+
* latest local commit's version (or the loaded baseline before any edit) and
|
|
1393
|
+
* resolves when an authoritative server version covers it. Remote-only
|
|
1394
|
+
* imports do not extend this target, matching the displayed confirmation state.
|
|
1367
1395
|
*
|
|
1368
1396
|
* Version coverage, not byte identity, is the acceptance test — for two reasons:
|
|
1369
1397
|
* the ops may reach the server inside a merged blob rather than as the exact
|
|
@@ -1399,29 +1427,58 @@ declare class MengineDocSession {
|
|
|
1399
1427
|
get documentAdapter(): SemanticDocumentAdapter;
|
|
1400
1428
|
/** Current document snapshot (read model). */
|
|
1401
1429
|
snapshot(): VideoDocument;
|
|
1430
|
+
/** Current-session undo/redo availability. Loading and closed sessions report false. */
|
|
1431
|
+
getUndoState(): MengineUndoState;
|
|
1432
|
+
/**
|
|
1433
|
+
* Supplies current availability immediately, then coalesces stack changes in a
|
|
1434
|
+
* microtask. Session teardown publishes empty availability synchronously.
|
|
1435
|
+
*/
|
|
1436
|
+
subscribeUndoState(cb: (state: MengineUndoState) => void): () => void;
|
|
1437
|
+
/**
|
|
1438
|
+
* Undo a local edit immediately; server confirmation remains asynchronous.
|
|
1439
|
+
* On a shared LWW field this writes its prior value, potentially overwriting a
|
|
1440
|
+
* later remote edit to that same field. Returns false if no update is produced.
|
|
1441
|
+
*/
|
|
1442
|
+
undo(options?: CommitOptions): boolean;
|
|
1443
|
+
/**
|
|
1444
|
+
* Restore the state visible before undo without rerunning external side effects.
|
|
1445
|
+
* Returns false if no update is produced; durable confirmation is separate.
|
|
1446
|
+
*/
|
|
1447
|
+
redo(options?: CommitOptions): boolean;
|
|
1448
|
+
/**
|
|
1449
|
+
* Combine existing semantic operations (e.g. trim a clip and adjust its volume)
|
|
1450
|
+
* or repeated commits during one drag gesture into a single undo step. A gesture
|
|
1451
|
+
* that only previews locally and commits once on release needs no group.
|
|
1452
|
+
* Each commit is immediately visible locally and enters sync independently;
|
|
1453
|
+
* a later failure does not roll it back.
|
|
1454
|
+
* Always pair with endUndoGroup in a finally block. Conflicting remote imports
|
|
1455
|
+
* can end/split the group early, and unrelated local edits would join it.
|
|
1456
|
+
* Complete asynchronous asset preparation before opening the group.
|
|
1457
|
+
*/
|
|
1458
|
+
beginUndoGroup(): void;
|
|
1459
|
+
/** End a gesture, including one already split by a conflicting remote import. */
|
|
1460
|
+
endUndoGroup(): void;
|
|
1402
1461
|
/**
|
|
1403
1462
|
* Start the sync stack and connect the document.
|
|
1404
1463
|
*
|
|
1405
|
-
* Returns
|
|
1406
|
-
*
|
|
1407
|
-
*
|
|
1464
|
+
* Returns after DocManager loads a local snapshot, or after the first remote
|
|
1465
|
+
* sync when no local snapshot exists. A valid empty document is ready too.
|
|
1466
|
+
* Cached documents can open before SSE connects; subsequent remote changes
|
|
1467
|
+
* surface through `subscribe`.
|
|
1408
1468
|
*/
|
|
1409
1469
|
start(): Promise<VideoDocument>;
|
|
1470
|
+
private open;
|
|
1471
|
+
getSyncState(): MengineDocSyncState;
|
|
1472
|
+
private confirmationTarget;
|
|
1473
|
+
/** Immediately supplies current state; unsubscribe when the host changes docs. */
|
|
1474
|
+
subscribeSyncState(cb: (state: MengineDocSyncState) => void): () => void;
|
|
1475
|
+
private emitSyncState;
|
|
1410
1476
|
subscribe(cb: (event: MengineDocSessionUpdateEvent) => void): () => void;
|
|
1411
1477
|
onStateChange(cb: (state: DocState) => void): () => void;
|
|
1412
1478
|
getState(): DocState;
|
|
1413
1479
|
destroy(): void;
|
|
1414
|
-
/**
|
|
1415
|
-
|
|
1416
|
-
*
|
|
1417
|
-
* `DocManager` loads from local storage, which starts empty for a fresh
|
|
1418
|
-
* client; the server snapshot arrives asynchronously via the first sync job.
|
|
1419
|
-
* `loaded` only means the local load ran, so we wait for actual content
|
|
1420
|
-
* (populated schema roots) instead, surfaced by the doc subscription set up
|
|
1421
|
-
* in `start()`.
|
|
1422
|
-
*/
|
|
1423
|
-
private waitForContent;
|
|
1424
|
-
private hasContent;
|
|
1480
|
+
/** Local absence needs a remote sync; empty business content does not. */
|
|
1481
|
+
private waitForInitialLoad;
|
|
1425
1482
|
}
|
|
1426
1483
|
//#endregion
|
|
1427
1484
|
//#region src/storage/memory-doc-storage.d.ts
|
|
@@ -1608,103 +1665,6 @@ type MakeEmptyPart = (durationMs: number) => {
|
|
|
1608
1665
|
*/
|
|
1609
1666
|
declare function cascadeAfterVideoClipChanges(doc: TimelineDoc, makeEmptyPart: MakeEmptyPart): void;
|
|
1610
1667
|
//#endregion
|
|
1611
|
-
//#region src/timeline-core/bridge.d.ts
|
|
1612
|
-
/**
|
|
1613
|
-
* Bridge between the authoritative `VideoDocument` (position-only facts) and the
|
|
1614
|
-
* flat `TimelineDoc` the cascade primitives solve over.
|
|
1615
|
-
*
|
|
1616
|
-
* The data flow is single-directional (RFC 02 §7/§10): ops write only facts
|
|
1617
|
-
* (`time_position`, parts) to `VideoDocument`; absolute time, `part_aggregations`,
|
|
1618
|
-
* total duration, and gap fillers are NOT stored — the projection derives them
|
|
1619
|
-
* on read by running the cascade. There is no write-back of solved positions.
|
|
1620
|
-
*
|
|
1621
|
-
* - `solveVideoDocument` seeds a `TimelineDoc` from each item's `time_position`,
|
|
1622
|
-
* runs the full cascade, and returns the derived read-view (abs / aggregations
|
|
1623
|
-
* / duration). It is the single solve shared by the legacy `VideoDraft`
|
|
1624
|
-
* projection.
|
|
1625
|
-
* - `ensureLaneTrack` / `findLaneTrack` locate (or mint) a secondary lane's
|
|
1626
|
-
* track row in the draft, so ops can write authoritative facts onto the right
|
|
1627
|
-
* named container (lane = container).
|
|
1628
|
-
*/
|
|
1629
|
-
/** The projection-derived read-view of a `VideoDocument` (RFC 02 §7). */
|
|
1630
|
-
interface SolvedVideoDocument {
|
|
1631
|
-
absByPartId: Map<string, number>;
|
|
1632
|
-
aggregations: PartAggregation[];
|
|
1633
|
-
durationMs: number;
|
|
1634
|
-
partLibrary: Record<string, PartUnion>;
|
|
1635
|
-
/**
|
|
1636
|
-
* Part ids of the gap fillers this solve minted.
|
|
1637
|
-
*
|
|
1638
|
-
* They exist only inside the solve: gap filling needs them so the clips after a
|
|
1639
|
-
* gap land at the right absolute time, but they are not authoritative state and
|
|
1640
|
-
* the read view does not carry them (see `fromVideoDocument`).
|
|
1641
|
-
*
|
|
1642
|
-
* Reported as ids rather than left for the caller to detect, because the caller
|
|
1643
|
-
* *cannot* detect them. The obvious predicate — `origin_media_id === ''` — also
|
|
1644
|
-
* matches an empty clip a writer placed on purpose (`batch_replace_video_clip_sequence`
|
|
1645
|
-
* documents "Omit to create an empty clip placeholder"), and those are
|
|
1646
|
-
* authoritative parts that must survive the projection. The mint callback is the
|
|
1647
|
-
* only place that knows the difference.
|
|
1648
|
-
*
|
|
1649
|
-
* Note this deliberately excludes the fillers that gap filling *extended* rather
|
|
1650
|
-
* than minted (`fillMainTrackTimeGaps` cases 1 and 2): those are authoritative
|
|
1651
|
-
* empty clips already in `part_library`, and only their length is derived.
|
|
1652
|
-
*/
|
|
1653
|
-
derivedFillerPartIds: Set<string>;
|
|
1654
|
-
}
|
|
1655
|
-
/**
|
|
1656
|
-
* Solve a `VideoDocument` (authoritative, position-only) into its derived
|
|
1657
|
-
* read-view: absolute time per item, `part_aggregations`, and total duration.
|
|
1658
|
-
* This is the read side of the single-directional flow — never written back.
|
|
1659
|
-
*/
|
|
1660
|
-
declare function solveVideoDocument(document: VideoDocument): SolvedVideoDocument;
|
|
1661
|
-
/** The named container a secondary lane lives in. */
|
|
1662
|
-
type SecondaryLane = 'speech' | 'caption' | 'bgm';
|
|
1663
|
-
/** A lane's track kind: the `video_clip` main lane plus the three secondary lanes. */
|
|
1664
|
-
type LaneKind = SecondaryLane | 'video_clip';
|
|
1665
|
-
/**
|
|
1666
|
-
* The four lanes in top-to-bottom stack order — the order a `tracks` list holds
|
|
1667
|
-
* them in (see {@link laneRank}).
|
|
1668
|
-
*
|
|
1669
|
-
* Exported so a document can be seeded with all four lanes up front. That seed is
|
|
1670
|
-
* not cosmetic: {@link ensureLaneTrack} is find-then-mint over a `LoroMovableList`,
|
|
1671
|
-
* so two concurrent writers that each mint the same absent lane both keep their
|
|
1672
|
-
* row, and the merged document holds two tracks for one lane. For the main lane
|
|
1673
|
-
* that is fatal — `videoDocumentSchema` allows at most one `video_clip` track, so
|
|
1674
|
-
* the merged document stops being projectable at all, symmetrically on both
|
|
1675
|
-
* replicas. Pre-seeding every lane makes `ensureLaneTrack` always take its find
|
|
1676
|
-
* branch, which removes the race by construction rather than by detection.
|
|
1677
|
-
*
|
|
1678
|
-
* What closes the race is that a track with the lane's `parts_kind` EXISTS — the
|
|
1679
|
-
* lookup is by kind, not by id. So a seed is only safe if it covers every lane:
|
|
1680
|
-
* a partial seed leaves the uncovered lanes exactly as exposed as before.
|
|
1681
|
-
*/
|
|
1682
|
-
declare const LANE_KINDS_IN_STACK_ORDER: readonly LaneKind[];
|
|
1683
|
-
/**
|
|
1684
|
-
* The conventional track id for a lane (`main_track`, `<kind>_track`). Shared by
|
|
1685
|
-
* the up-front seed and {@link ensureLaneTrack}'s lazy mint so a document's lane
|
|
1686
|
-
* ids do not depend on which of the two created the track.
|
|
1687
|
-
*
|
|
1688
|
-
* Ids are cosmetic to the merge itself — lane lookup goes by `parts_kind`, so
|
|
1689
|
-
* drifting them apart would not reopen the concurrent-mint race. They matter to
|
|
1690
|
-
* readers that address a lane by id (the FE editor's panes, fixtures), which is
|
|
1691
|
-
* why there is one convention rather than two.
|
|
1692
|
-
*/
|
|
1693
|
-
declare function laneTrackId(kind: LaneKind): string;
|
|
1694
|
-
/**
|
|
1695
|
-
* Locate a lane's track row in the single `tracks` list by kind, minting an empty
|
|
1696
|
-
* row in lane-stacking order if absent (reference/17 §4: lane = `parts_kind`).
|
|
1697
|
-
* Ops use this to write authoritative items onto the right lane. The track id
|
|
1698
|
-
* comes from {@link laneTrackId}, shared with the up-front seed.
|
|
1699
|
-
*
|
|
1700
|
-
* The mint branch is a concurrency hazard, not a convenience: see
|
|
1701
|
-
* {@link LANE_KINDS_IN_STACK_ORDER}. A document seeded with all four lanes never
|
|
1702
|
-
* reaches it.
|
|
1703
|
-
*/
|
|
1704
|
-
declare function ensureLaneTrack(draft: VideoDocumentDraft, kind: LaneKind): TrackDraft;
|
|
1705
|
-
/** Find a secondary lane's track row without minting it. */
|
|
1706
|
-
declare function findLaneTrack(draft: VideoDocumentDraft, kind: SecondaryLane): TrackDraft | undefined;
|
|
1707
|
-
//#endregion
|
|
1708
1668
|
//#region src/timeline-core/locate.d.ts
|
|
1709
1669
|
/**
|
|
1710
1670
|
* Forward positioning for write-time ops (RFC 02 §9.1) — NOT a cascade.
|
|
@@ -1756,4 +1716,4 @@ declare function hasAudioScriptAsset(payload: JsonObject): boolean;
|
|
|
1756
1716
|
/** Internal fingerprint prevents a resource from silently describing an older text revision. */
|
|
1757
1717
|
declare function audioScriptAssetFields(payload: JsonObject, assetId: string): JsonObject;
|
|
1758
1718
|
//#endregion
|
|
1759
|
-
export { type Aggregation, type AssembledCaptionContent, type AssembledPhoneticScriptContent, type Attachment, type AudioMediaAssetFact, type BgmPart, type CaptionContentInput, type CaptionDisplayCue, type CaptionPart, type CaptionSegmentSelection, type CaptionStyle, type ClipEntityId, type ClipPlacement, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DeleteBgmInput, type DeleteClipInput, type DeleteClipTreeInput, type DeleteVoiceoverInput, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, type DocumentAudioScript, type DocumentAudioScriptState,
|
|
1719
|
+
export { type Aggregation, type AssembledCaptionContent, type AssembledPhoneticScriptContent, type Attachment, type AudioMediaAssetFact, type BgmPart, type CaptionContentInput, type CaptionDisplayCue, type CaptionPart, type CaptionSegmentSelection, type CaptionStyle, type ClipEntityId, type ClipPlacement, type CommitOptions, DEFAULT_UNIT_TIME_MS, type DeleteBgmInput, type DeleteClipInput, type DeleteClipTreeInput, type DeleteVoiceoverInput, type DerivedItemPosition, type DocStorageLike, type DocVersionMark, type DocumentAudioScript, type DocumentAudioScriptState, type EditorFoundation, EntityDocumentState, type EntityGraphCommitOptions, EntityGraphHttpClient, type EntityGraphState, EntityTimelineEditor, type EntityTimelineIdFactory, EntityTimelineProjectionError, type EntityTimelineTrackRole, type FieldChange, type FieldPath, IMPLEMENTED_SEMANTIC_OP_KINDS, type ImageMediaAssetFact, type ImplementedSemanticOpKind, type ImportedMediaAsset, type InsertCaptionClipInput, type InsertClipInput, type InsertMediaClipInput, type InsertMediaClipsInput, type InsertPlacedClipInput, type JournalEntry, LANE_KINDS_IN_STACK_ORDER, LORO_ENTITY_SCHEMA, type LaneKind, type LinearClipSpeed, LoroEntityDocument, LoroEntityDraft, type MainClipRange, type MakeEmptyPart, ManualSyncDoc, type ManualSyncDocOptions, MedeoHttpDocStorage, type MedeoHttpDocStorageOptions, type MediaAssetFact, type MediaClipInsertion, 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 MoveClipInput, type MoveClipsToStartsInput, type MoveSequentialClipsInput, type MoveVoiceoverInput, type OpActor, type PartAggregation, type PartIdFactory, type PartKind, type PartUnion, type PatchCaptionStyleInput, PlainMemoryAdapter, type PlainMemoryAdapterOptions, type PlannedSemanticOpKind, type PullFailureReason, type PullResult, type PushOutcome, type PushOutcomeKind, type PushResult, type PushResultKind, type ReplaceClipContentInput, type ReplaceMediaClipInput, type ReplaceSequentialClipsInput, type ReplacementMediaClipInput, type ResolvedEntityClipPlacement, type ResolvedEntityTimelineLayout, type ResolvedEntityTrack, SchemaValidator, ScriptCompositionError, type SemanticDocumentAdapter, SemanticEditor, type SemanticOpInput, type SemanticOpKind, type SemanticOpName, type SequentialClipAnchor, type SetBgmInput, type SetCaptionVisibilityInput, type SetClipPlacementInput, type SetClipSpeedInput, type SetClipVolumeInput, 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, type TrimClipInput, type UpdateClipInput, type UpdateClipMarkerInput, ValidationError, type VideoClipPart, type VideoDocument, type VideoDocumentDraft, type VideoDocumentMirrorSchema, VideoDocumentValidationError, type VideoDocumentValidationIssue, type VideoDocumentValidationIssueCode, type VideoDraft, type CaptionPart$1 as VideoDraftCaptionPart, type VideoDraftContent, type VideoDraftPartUnion, type Timeline$1 as VideoDraftTimeline, type Track$1 as VideoDraftTrack, type TrackItem$1 as VideoDraftTrackItem, type VideoMediaAssetFact, type VisualMediaAssetFact, type VoiceMediaAssetFact, type VoiceoverCaptionFact, type VoiceoverTakeInput, type VoiceoverTakeResult, type WaitForServerAckOptions, applyEntityRows, applyFieldChanges, arrangeMainTrackSeamlessly, assembleCaptionContent, assembleEntityContent, assemblePhoneticScriptContent, assembleScriptText, assertCanonicalEditorResources, assertEntityProjectionPreservesLegacy, assertFieldChanges, assertMediaAssetWritePolicy, assertValidVideoDocument, audioScriptAssetContent, audioScriptAssetFields, audioScriptAssetHash, base64ToBytes, buildInitialVideoDocument, buildSpeechHostMap, bytesToBase64, cascadeAfterVideoClipChanges, compileEntityRows, createEditSandbox, createMirrorVideoDocument, createMirrorVideoDocumentAdapter, createPlainMemoryAdapter, decodeDocVersionMark, derivePositionFromAbs, effectiveVideoClipDurationMs, encodeDocVersionMark, ensureEditorFoundation, ensureLaneTrack, fillMainTrackTimeGaps, findComposedAudioScript, findLaneTrack, fromVideoDocument, generatePartId, getAt, hasAudioScriptAsset, hostForAbsMs, importMediaAsset, isEmptyVideoClip, isImplementedSemanticOpKind, isMap, laneTrackId, mainTrackRanges, migrateLegacyTimelineToEntities, partDurationMs, partUnionSchema, prepareCaptionContent, projectEntityTimeline, readDocumentAudioScript, readEntityDocument, readMainTrackItems, readMengineEventStream, readPart, readPartDurationMs, readVideoDocumentFromDraft, reassignSpeechesToVideoClipsByTime, recalculateTimelineDuration, relativePositionForAbs, replayJournal, resolveAllSpeechOverlaps, resolveEntityTimelineLayout, resolveFieldPath, resolveSpeechOverlapByShiftingVideos, safeDurationMs, index_d_exports as schemas, selectAudioScriptSegment, snapshotToPlain, solveVideoDocument, speedOf, syncAggregatedClipsTimePosition, toVideoDocument, validateVideoDocument, videoDocumentMirrorSchema, videoDocumentSchema };
|