videobook-engine 2.0.1
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 +214 -0
- package/dist/artifacts.d.ts +20 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +312 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/books.d.ts +7 -0
- package/dist/books.d.ts.map +1 -0
- package/dist/books.js +27 -0
- package/dist/books.js.map +1 -0
- package/dist/cas.d.ts +26 -0
- package/dist/cas.d.ts.map +1 -0
- package/dist/cas.js +139 -0
- package/dist/cas.js.map +1 -0
- package/dist/communications.d.ts +15 -0
- package/dist/communications.d.ts.map +1 -0
- package/dist/communications.js +139 -0
- package/dist/communications.js.map +1 -0
- package/dist/context.d.ts +42 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +197 -0
- package/dist/context.js.map +1 -0
- package/dist/domain.d.ts +32 -0
- package/dist/domain.d.ts.map +1 -0
- package/dist/domain.js +399 -0
- package/dist/domain.js.map +1 -0
- package/dist/engine-types.d.ts +548 -0
- package/dist/engine-types.d.ts.map +1 -0
- package/dist/engine-types.js +10 -0
- package/dist/engine-types.js.map +1 -0
- package/dist/engine.d.ts +213 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +130 -0
- package/dist/engine.js.map +1 -0
- package/dist/files.d.ts +28 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +476 -0
- package/dist/files.js.map +1 -0
- package/dist/history-types.d.ts +74 -0
- package/dist/history-types.d.ts.map +1 -0
- package/dist/history-types.js +2 -0
- package/dist/history-types.js.map +1 -0
- package/dist/history.d.ts +20 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +921 -0
- package/dist/history.js.map +1 -0
- package/dist/ids.d.ts +4 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +14 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/job-queue.d.ts +51 -0
- package/dist/job-queue.d.ts.map +1 -0
- package/dist/job-queue.js +443 -0
- package/dist/job-queue.js.map +1 -0
- package/dist/media.d.ts +7 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +60 -0
- package/dist/media.js.map +1 -0
- package/dist/metadata.d.ts +21 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +222 -0
- package/dist/metadata.js.map +1 -0
- package/dist/notebook/types.d.ts +51 -0
- package/dist/notebook/types.d.ts.map +1 -0
- package/dist/notebook/types.js +2 -0
- package/dist/notebook/types.js.map +1 -0
- package/dist/resolver.d.ts +15 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +81 -0
- package/dist/resolver.js.map +1 -0
- package/dist/runtime-services.d.ts +65 -0
- package/dist/runtime-services.d.ts.map +1 -0
- package/dist/runtime-services.js +584 -0
- package/dist/runtime-services.js.map +1 -0
- package/dist/schema.d.ts +7 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +509 -0
- package/dist/schema.js.map +1 -0
- package/dist/similarity.d.ts +4 -0
- package/dist/similarity.d.ts.map +1 -0
- package/dist/similarity.js +1551 -0
- package/dist/similarity.js.map +1 -0
- package/dist/status.d.ts +9 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +231 -0
- package/dist/status.js.map +1 -0
- package/dist/storage.d.ts +7 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +129 -0
- package/dist/storage.js.map +1 -0
- package/dist/store.d.ts +55 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +378 -0
- package/dist/store.js.map +1 -0
- package/dist/timeline.d.ts +9 -0
- package/dist/timeline.d.ts.map +1 -0
- package/dist/timeline.js +236 -0
- package/dist/timeline.js.map +1 -0
- package/docs/engine-layout.md +489 -0
- package/package.json +55 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
# Videobook engine layout
|
|
2
|
+
|
|
3
|
+
This document is the column-by-column layout of the engine-owned data model.
|
|
4
|
+
It describes schema version 4 as implemented today, then identifies the
|
|
5
|
+
additional structures needed for a full non-linear video editor.
|
|
6
|
+
|
|
7
|
+
The executable source of truth remains
|
|
8
|
+
[`src/schema.ts`](../src/schema.ts). If this document and the DDL disagree, the
|
|
9
|
+
DDL wins. “Entire Dolt schema” below means every engine-owned, versioned table
|
|
10
|
+
and index plus the committed `dolt_ignore` policy; Dolt's generated internal
|
|
11
|
+
system tables are intentionally outside the application schema.
|
|
12
|
+
|
|
13
|
+
## Storage boundary
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
rootDir/
|
|
17
|
+
├── data/
|
|
18
|
+
│ ├── videobook.db
|
|
19
|
+
│ │ ├── Dolt-versioned semantic tables
|
|
20
|
+
│ │ ├── committed dolt_ignore policy
|
|
21
|
+
│ │ └── ignored runtime_* tables and sqlite_sequence
|
|
22
|
+
│ └── objects/
|
|
23
|
+
│ └── sha256/
|
|
24
|
+
│ └── <first two hash characters>/
|
|
25
|
+
│ └── <full 64-character SHA-256>
|
|
26
|
+
└── workspaces/
|
|
27
|
+
└── <artifact UUIDv7>/
|
|
28
|
+
└── <materialized logical artifact paths>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The optional remote object key has the same two-character fan-out:
|
|
32
|
+
`<objectPrefix>/<first two hash characters>/<full SHA-256>`. The default
|
|
33
|
+
prefix is `superlzy-media/videobook/sha256`.
|
|
34
|
+
|
|
35
|
+
```mermaid
|
|
36
|
+
flowchart LR
|
|
37
|
+
API[Engine APIs] --> TX[Serialized semantic mutation]
|
|
38
|
+
TX --> DB[(videobook.db)]
|
|
39
|
+
TX --> OUTBOX[runtime_commit_outbox]
|
|
40
|
+
DB --> STAGE[Allowlisted Dolt staging]
|
|
41
|
+
OUTBOX --> STAGE
|
|
42
|
+
STAGE --> REV[Dolt main revision]
|
|
43
|
+
|
|
44
|
+
FILES[Artifact file APIs] --> CAS[Immutable SHA-256 objects]
|
|
45
|
+
FILES --> MAP[Versioned artifact_files mapping]
|
|
46
|
+
CAS --> WS[Disposable artifact workspace]
|
|
47
|
+
MAP --> WS
|
|
48
|
+
|
|
49
|
+
JOBS[Jobs, leases, status, similarity] --> RUNTIME[Ignored runtime tables]
|
|
50
|
+
RUNTIME -. never staged .-> DB
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Global invariants
|
|
54
|
+
|
|
55
|
+
- One engine catalog contains exactly one `book` row and one matching
|
|
56
|
+
`timeline` row. There is no project scope.
|
|
57
|
+
- The only supported live Dolt branch is `main`.
|
|
58
|
+
- Semantic mutations are SQL transactions followed by forward-only Dolt
|
|
59
|
+
commits. A restore creates a new commit; it never rewinds the live branch.
|
|
60
|
+
- `SEMANTIC_TABLES` is the staging allowlist. Every mutation also records an
|
|
61
|
+
`operations` row.
|
|
62
|
+
- `runtime_%` and `sqlite_sequence` are ignored by Dolt. Runtime state can be
|
|
63
|
+
rebuilt, expired, or invalidated without changing semantic history.
|
|
64
|
+
- Engine-generated surrogate identities are stable UUIDv7 strings; the SQL
|
|
65
|
+
columns are `TEXT`, so UUID form is enforced by engine APIs rather than a
|
|
66
|
+
database check. Content identity is a lowercase, 64-character SHA-256.
|
|
67
|
+
- Timestamps are integer Unix epoch milliseconds. Timeline positions that are
|
|
68
|
+
currently modeled use integer frames.
|
|
69
|
+
- JSON is stored as canonical text with recursively sorted object keys.
|
|
70
|
+
- Deletes are hard deletes. Owned rows cascade; live artifact/entity
|
|
71
|
+
references restrict deletion; immutable objects and prior Dolt revisions
|
|
72
|
+
remain available.
|
|
73
|
+
|
|
74
|
+
## Dolt-versioned semantic schema
|
|
75
|
+
|
|
76
|
+
Notation used below:
|
|
77
|
+
|
|
78
|
+
- Unmarked columns are `NOT NULL`.
|
|
79
|
+
- `?` means nullable.
|
|
80
|
+
- `PK`, `UQ`, and `FK` mean primary key, unique key, and foreign key.
|
|
81
|
+
- `→` names the referenced column.
|
|
82
|
+
- Defaults and checks are shown inline.
|
|
83
|
+
|
|
84
|
+
There are 25 allowlisted semantic tables.
|
|
85
|
+
|
|
86
|
+
### Catalog, artifacts, and content
|
|
87
|
+
|
|
88
|
+
| Table | Columns | Keys, constraints, and purpose |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| `engine_schema` | `singleton INTEGER`<br>`version INTEGER`<br>`created_at INTEGER` | `singleton PK CHECK(singleton = 1)`. Records the clean-break catalog version. Version 4 rejects older catalogs rather than migrating them. |
|
|
91
|
+
| `book` | `book_id TEXT`<br>`slug TEXT`<br>`created_at INTEGER` | `book_id PK`; `slug UQ`. Exactly one row per engine root. |
|
|
92
|
+
| `artifacts` | `artifact_id TEXT`<br>`slug TEXT`<br>`kind TEXT`<br>`created_at INTEGER` | `artifact_id PK`; `slug UQ`; `kind CHECK IN (video, image, audio, script, character, prompt, scene, final)`. The artifact is the stable identity for source media, generated media, documents, and final renders. |
|
|
93
|
+
| `objects` | `object_hash TEXT`<br>`size_bytes INTEGER`<br>`created_at INTEGER` | `object_hash PK`; `size_bytes CHECK >= 0`. This is versioned metadata for immutable bytes stored outside the database. |
|
|
94
|
+
| `artifact_files` | `artifact_id TEXT`<br>`path TEXT`<br>`object_hash TEXT`<br>`mtime_ms INTEGER`<br>`created_at INTEGER` | `(artifact_id, path) PK`; `artifact_id FK → artifacts.artifact_id ON DELETE CASCADE`; `object_hash FK → objects.object_hash ON DELETE RESTRICT`. Maps a logical artifact path to immutable content. |
|
|
95
|
+
| `book_metadata` | `key TEXT`<br>`value_json TEXT` | `key PK`. Singleton-book key/value metadata; no redundant `book_id`. |
|
|
96
|
+
| `artifact_metadata` | `artifact_id TEXT`<br>`key TEXT`<br>`value_json TEXT` | `(artifact_id, key) PK`; `artifact_id FK → artifacts.artifact_id ON DELETE CASCADE`. Extensible artifact metadata that participates in revisions. |
|
|
97
|
+
|
|
98
|
+
### Creative entities and notebook graph
|
|
99
|
+
|
|
100
|
+
| Table | Columns | Keys, constraints, and purpose |
|
|
101
|
+
| --- | --- | --- |
|
|
102
|
+
| `entities` | `entity_id TEXT`<br>`type TEXT`<br>`name TEXT`<br>`description TEXT?`<br>`prompt TEXT?`<br>`data_json TEXT DEFAULT '{}'`<br>`created_at INTEGER` | `entity_id PK`; `type CHECK IN (prompt, character, scene)`. Normalized reusable creative concepts. |
|
|
103
|
+
| `notebooks` | `notebook_id TEXT`<br>`name TEXT`<br>`properties_json TEXT DEFAULT '{}'`<br>`created_at INTEGER` | `notebook_id PK`. Owns a generation/authoring graph. |
|
|
104
|
+
| `cells` | `notebook_id TEXT`<br>`cell_id TEXT`<br>`type TEXT`<br>`title TEXT`<br>`position_x REAL`<br>`position_y REAL`<br>`entity_id TEXT?`<br>`prompt TEXT?`<br>`model TEXT?`<br>`inputs_json TEXT DEFAULT '{}'`<br>`output_artifact_id TEXT?` | `(notebook_id, cell_id) PK`; notebook `FK → notebooks ON DELETE CASCADE`; entity `FK → entities ON DELETE RESTRICT`; output `FK → artifacts ON DELETE RESTRICT`; `type CHECK IN (prompt, character, scene, asset, image, video)`. |
|
|
105
|
+
| `edges` | `notebook_id TEXT`<br>`edge_id TEXT`<br>`source_cell_id TEXT`<br>`target_cell_id TEXT`<br>`target_input TEXT` | `(notebook_id, edge_id) PK`; notebook `FK → notebooks ON DELETE CASCADE`; composite source and target FKs reference cells in the same notebook and cascade on cell deletion. |
|
|
106
|
+
| `runs` | `run_id TEXT`<br>`notebook_id TEXT`<br>`status TEXT`<br>`started_at INTEGER`<br>`completed_at INTEGER`<br>`cell_order_json TEXT`<br>`outputs_json TEXT`<br>`error TEXT?` | `run_id PK`; notebook `FK → notebooks ON DELETE CASCADE`; `status CHECK IN (completed, failed, aborted)`. Terminal, versioned notebook execution records. |
|
|
107
|
+
|
|
108
|
+
### Current timeline and media editing state
|
|
109
|
+
|
|
110
|
+
| Table | Columns | Keys, constraints, and purpose |
|
|
111
|
+
| --- | --- | --- |
|
|
112
|
+
| `timeline` | `book_id TEXT`<br>`render TEXT DEFAULT 'landscape'` | `book_id PK FK → book.book_id ON DELETE CASCADE`; `render CHECK IN (landscape, portrait, square)`. One sequence-level orientation row. |
|
|
113
|
+
| `timeline_slots` | `slot_id TEXT`<br>`artifact_id TEXT`<br>`ordinal INTEGER`<br>`volume REAL?`<br>`audio_fade_in REAL?`<br>`audio_fade_out REAL?` | `slot_id PK`; artifact `FK → artifacts ON DELETE RESTRICT`; `ordinal CHECK >= 0`; volume and fades are null or `>= 0`. A single ordered visual lane; ownership by the singleton timeline is implicit. |
|
|
114
|
+
| `timeline_audio` | `audio_id TEXT`<br>`artifact_id TEXT`<br>`ordinal INTEGER`<br>`start_frame INTEGER`<br>`duration_frames INTEGER`<br>`volume REAL?`<br>`fade_in REAL?`<br>`fade_out REAL?` | `audio_id PK`; artifact `FK → artifacts ON DELETE RESTRICT`; ordinal/start `CHECK >= 0`; duration `CHECK > 0`; volume and fades are null or `>= 0`. Ordered overlays with explicit timeline timing. |
|
|
115
|
+
| `audio_waveforms` | `artifact_id TEXT`<br>`peaks_json TEXT` | `artifact_id PK FK → artifacts.artifact_id ON DELETE CASCADE`. Versioned waveform peaks used by editing UI. |
|
|
116
|
+
|
|
117
|
+
The normalized current relationship is:
|
|
118
|
+
|
|
119
|
+
```mermaid
|
|
120
|
+
erDiagram
|
|
121
|
+
BOOK ||--|| TIMELINE : owns
|
|
122
|
+
ARTIFACTS ||--o{ TIMELINE_SLOTS : supplies
|
|
123
|
+
ARTIFACTS ||--o{ TIMELINE_AUDIO : supplies
|
|
124
|
+
ARTIFACTS ||--o| AUDIO_WAVEFORMS : has
|
|
125
|
+
ARTIFACTS ||--o{ ARTIFACT_FILES : maps
|
|
126
|
+
OBJECTS ||--o{ ARTIFACT_FILES : backs
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
`timeline_slots` order is defined by `(ordinal, slot_id)`. It does not
|
|
130
|
+
currently store timeline start, source in/out, duration, track, transform,
|
|
131
|
+
speed, opacity, effects, or transitions. `timeline_audio` does store start and
|
|
132
|
+
duration frames, but there is no catalog-level frame-rate/timebase row yet.
|
|
133
|
+
|
|
134
|
+
### Prompts and messages
|
|
135
|
+
|
|
136
|
+
| Table | Columns | Keys, constraints, and purpose |
|
|
137
|
+
| --- | --- | --- |
|
|
138
|
+
| `prompt_entries` | `prompt_id TEXT`<br>`surface TEXT`<br>`prompt TEXT`<br>`context_json TEXT DEFAULT '{}'`<br>`created_at INTEGER` | `prompt_id PK`. Semantic prompt history grouped by UI or agent surface. |
|
|
139
|
+
| `messages` | `message_id TEXT`<br>`role TEXT`<br>`body_json TEXT`<br>`created_at INTEGER` | `message_id PK`. Structured semantic conversation history. |
|
|
140
|
+
|
|
141
|
+
### Operations, action graph, and terminal jobs
|
|
142
|
+
|
|
143
|
+
| Table | Columns | Keys, constraints, and purpose |
|
|
144
|
+
| --- | --- | --- |
|
|
145
|
+
| `operations` | `operation_id TEXT`<br>`operation TEXT`<br>`artifact_id TEXT?`<br>`details_json TEXT DEFAULT '{}'`<br>`write_set_json TEXT DEFAULT '[]'`<br>`base_revision TEXT?`<br>`created_at INTEGER`<br>`author TEXT` | `operation_id PK`. One low-level provenance row is written with every semantic mutation. Artifact and revision references are deliberately loose so audit history survives deletion. |
|
|
146
|
+
| `actions` | `action_id TEXT`<br>`operation TEXT`<br>`scope TEXT`<br>`actor TEXT`<br>`lane TEXT`<br>`phase TEXT`<br>`base_revision TEXT?`<br>`target_artifact_id TEXT?`<br>`target_action_id TEXT?`<br>`layout_json TEXT?`<br>`details_json TEXT DEFAULT '{}'`<br>`created_at INTEGER` | `action_id PK`; scope `CHECK IN (book, artifact, layout, external, system)`; phase `CHECK IN (requested, started, completed, failed, cancelled, conflicted)`. High-level workflow/action projection. Targets are loose audit references. |
|
|
147
|
+
| `action_events` | `event_id TEXT`<br>`action_id TEXT`<br>`operation_id TEXT`<br>`phase TEXT`<br>`details_json TEXT DEFAULT '{}'`<br>`created_at INTEGER` | `event_id PK`; action `FK → actions ON DELETE CASCADE`; same phase check as `actions`. `operation_id` is a loose provenance link. |
|
|
148
|
+
| `action_parents` | `action_id TEXT`<br>`parent_action_id TEXT` | `(action_id, parent_action_id) PK`; child `FK → actions ON DELETE CASCADE`; parent `FK → actions ON DELETE RESTRICT`. Forms the action DAG. |
|
|
149
|
+
| `action_artifacts` | `action_id TEXT`<br>`artifact_id TEXT`<br>`direction TEXT` | `(action_id, artifact_id, direction) PK`; action `FK → actions ON DELETE CASCADE`; `direction CHECK IN (input, output)`. Artifact ID is deliberately loose for durable lineage. |
|
|
150
|
+
| `action_write_set` | `action_id TEXT`<br>`resource TEXT` | `(action_id, resource) PK`; action `FK → actions ON DELETE CASCADE`. Normalized resources used for overlap/conflict reasoning. |
|
|
151
|
+
| `job_runs` | `run_id TEXT`<br>`artifact_id TEXT?`<br>`job_type TEXT`<br>`state TEXT`<br>`payload_json TEXT`<br>`result_json TEXT?`<br>`error_json TEXT?`<br>`started_at INTEGER?`<br>`finished_at INTEGER` | `run_id PK`; `state CHECK IN (done, failed, aborted)`. Terminal job audit. Artifact references are loose so completed history survives artifact deletion. |
|
|
152
|
+
|
|
153
|
+
`actions.layout_json` currently maps to the public
|
|
154
|
+
`HistoryLayout { stage: number; column: number }`. It is workflow layout
|
|
155
|
+
metadata, not spatial video composition.
|
|
156
|
+
|
|
157
|
+
### Committed Dolt policy table
|
|
158
|
+
|
|
159
|
+
`dolt_ignore` is created and staged separately from the 25-table allowlist:
|
|
160
|
+
|
|
161
|
+
| Column | Constraint |
|
|
162
|
+
| --- | --- |
|
|
163
|
+
| `pattern TEXT` | `PK` |
|
|
164
|
+
| `ignored TINYINT` | `NOT NULL` |
|
|
165
|
+
|
|
166
|
+
Its committed rows are:
|
|
167
|
+
|
|
168
|
+
| Pattern | Ignored | Meaning |
|
|
169
|
+
| --- | ---: | --- |
|
|
170
|
+
| `runtime_%` | `1` | Never version any engine runtime table. |
|
|
171
|
+
| `sqlite_sequence` | `1` | Never version local AUTOINCREMENT counters. |
|
|
172
|
+
|
|
173
|
+
### Semantic indexes
|
|
174
|
+
|
|
175
|
+
Primary keys and unique declarations create their own backing indexes. The
|
|
176
|
+
schema additionally defines every index below.
|
|
177
|
+
|
|
178
|
+
| Index | Table and ordered columns |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| `artifacts_created` | `artifacts(created_at, artifact_id)` |
|
|
181
|
+
| `artifact_files_object` | `artifact_files(object_hash)` |
|
|
182
|
+
| `entities_type_created` | `entities(type, created_at, entity_id)` |
|
|
183
|
+
| `notebooks_created` | `notebooks(created_at, notebook_id)` |
|
|
184
|
+
| `cells_entity` | `cells(entity_id)` |
|
|
185
|
+
| `cells_output_artifact` | `cells(output_artifact_id)` |
|
|
186
|
+
| `edges_source` | `edges(notebook_id, source_cell_id)` |
|
|
187
|
+
| `edges_target` | `edges(notebook_id, target_cell_id)` |
|
|
188
|
+
| `runs_notebook_completed` | `runs(notebook_id, completed_at, run_id)` |
|
|
189
|
+
| `timeline_slots_order` | `timeline_slots(ordinal, slot_id)` |
|
|
190
|
+
| `timeline_slots_artifact` | `timeline_slots(artifact_id)` |
|
|
191
|
+
| `timeline_audio_order` | `timeline_audio(ordinal, audio_id)` |
|
|
192
|
+
| `timeline_audio_artifact` | `timeline_audio(artifact_id)` |
|
|
193
|
+
| `prompt_entries_lookup` | `prompt_entries(surface, created_at, prompt_id)` |
|
|
194
|
+
| `messages_created` | `messages(created_at, message_id)` |
|
|
195
|
+
| `operations_created` | `operations(created_at, operation_id)` |
|
|
196
|
+
| `operations_artifact_created` | `operations(artifact_id, created_at, operation_id)` |
|
|
197
|
+
| `action_events_action_created` | `action_events(action_id, created_at, event_id)` |
|
|
198
|
+
|
|
199
|
+
## Local-only runtime schema
|
|
200
|
+
|
|
201
|
+
All 14 runtime tables live in `videobook.db`, but match `runtime_%` and must
|
|
202
|
+
never be staged. They coordinate work or cache derivable data.
|
|
203
|
+
|
|
204
|
+
### Engine coordination
|
|
205
|
+
|
|
206
|
+
| Table | Columns | Keys, constraints, and purpose |
|
|
207
|
+
| --- | --- | --- |
|
|
208
|
+
| `runtime_meta` | `key TEXT`<br>`value_json TEXT`<br>`updated_at INTEGER` | `key PK`. Local engine metadata, including the runtime schema-version marker. |
|
|
209
|
+
| `runtime_jobs` | `id INTEGER AUTOINCREMENT`<br>`operation_id TEXT`<br>`type TEXT`<br>`artifact_id TEXT?`<br>`external_task_id TEXT?`<br>`state TEXT`<br>`payload_json TEXT`<br>`result_json TEXT?`<br>`dedupe_key TEXT?`<br>`enqueued_at INTEGER`<br>`started_at INTEGER?`<br>`finished_at INTEGER?`<br>`pid INTEGER?`<br>`lease_expires_at INTEGER?`<br>`attempts INTEGER DEFAULT 0`<br>`max_attempts INTEGER DEFAULT 1`<br>`error_json TEXT?`<br>`fence INTEGER DEFAULT 0` | `id PK`; `state CHECK IN (queued, running, completing, done, failed, aborted)`. Retryable local work queue with deduplication, leases, and fencing. |
|
|
210
|
+
| `runtime_resource_leases` | `lease_id TEXT`<br>`artifact_id TEXT?`<br>`resource_key TEXT`<br>`owner_id TEXT`<br>`owner_kind TEXT`<br>`pid INTEGER?`<br>`state TEXT?`<br>`data_json TEXT DEFAULT '{}'`<br>`fence INTEGER`<br>`acquired_at INTEGER`<br>`expires_at INTEGER`<br>`revoked_at INTEGER?` | `lease_id PK`. Fenced ownership for artifacts or arbitrary resources. |
|
|
211
|
+
| `runtime_object_publications` | `object_hash TEXT`<br>`published_at INTEGER` | `object_hash PK`. Tracks objects verified in remote content storage. |
|
|
212
|
+
| `runtime_workspace_entries` | `artifact_id TEXT`<br>`path TEXT`<br>`hydrated_at INTEGER?`<br>`invalidated_at INTEGER?`<br>`last_accessed_at INTEGER` | `artifact_id PK`; `path UQ`. Tracks disposable workspace materialization. |
|
|
213
|
+
| `runtime_artifact_views` | `artifact_id TEXT`<br>`status TEXT`<br>`meta_json TEXT DEFAULT '{}'`<br>`owner_id TEXT?`<br>`owner_kind TEXT?`<br>`pid INTEGER?`<br>`deadline_at INTEGER?`<br>`updated_at INTEGER`<br>`seen_at INTEGER?`<br>`fence INTEGER DEFAULT 0` | `artifact_id PK`; `status CHECK IN (pending, working, ready, error)`. Current UI/runtime projection of artifact work. |
|
|
214
|
+
| `runtime_pending_tasks` | `artifact_id TEXT`<br>`task_id TEXT`<br>`task_type TEXT`<br>`created_at INTEGER`<br>`meta_json TEXT DEFAULT '{}'`<br>`completing INTEGER DEFAULT 0`<br>`owner_id TEXT?` | `artifact_id PK`; `task_id UQ`. Compatibility projection for active external tasks. |
|
|
215
|
+
| `runtime_generation_errors` | `artifact_id TEXT`<br>`message TEXT`<br>`fail_code TEXT?`<br>`prompt TEXT?`<br>`failed_at INTEGER` | `artifact_id PK`. Latest local generation failure per artifact. |
|
|
216
|
+
| `runtime_settings` | `key TEXT`<br>`value_json TEXT`<br>`updated_at INTEGER` | `key PK`. Local preferences such as viewer orientation. |
|
|
217
|
+
| `runtime_logs` | `id INTEGER AUTOINCREMENT`<br>`name TEXT`<br>`body_json TEXT`<br>`created_at INTEGER` | `id PK`. Structured local logs. |
|
|
218
|
+
| `runtime_commit_outbox` | `operation_id TEXT`<br>`tables_json TEXT`<br>`message TEXT`<br>`created_at INTEGER` | `operation_id PK`. Crash-recovery bridge between a committed SQL mutation and its Dolt commit. |
|
|
219
|
+
|
|
220
|
+
### Similarity and search caches
|
|
221
|
+
|
|
222
|
+
| Table | Columns | Keys, constraints, and purpose |
|
|
223
|
+
| --- | --- | --- |
|
|
224
|
+
| `runtime_similarity_embeddings` | `id INTEGER AUTOINCREMENT`<br>`artifact_id TEXT`<br>`kind TEXT`<br>`source_path TEXT`<br>`object_hash TEXT`<br>`embedding_space TEXT`<br>`dimensions INTEGER`<br>`vector_blob BLOB`<br>`frame_count INTEGER?`<br>`updated_at INTEGER` | `id PK`; `(artifact_id, embedding_space) UQ`; `kind CHECK IN (image, video, audio)`. Derivable media vectors. |
|
|
225
|
+
| `runtime_text_similarity_documents` | `id INTEGER AUTOINCREMENT`<br>`artifact_id TEXT`<br>`source_path TEXT`<br>`object_hash TEXT`<br>`content_hash TEXT`<br>`embedding_space TEXT`<br>`dimensions INTEGER`<br>`chunk_count INTEGER`<br>`updated_at INTEGER` | `id PK`; `(artifact_id, embedding_space) UQ`. One derivable text-index document per artifact and embedding space. |
|
|
226
|
+
| `runtime_text_similarity_chunks` | `id INTEGER AUTOINCREMENT`<br>`document_id INTEGER`<br>`artifact_id TEXT`<br>`embedding_space TEXT`<br>`chunk_index INTEGER`<br>`start_offset INTEGER`<br>`end_offset INTEGER`<br>`chunk_text TEXT`<br>`dimensions INTEGER`<br>`vector_blob BLOB`<br>`updated_at INTEGER` | `id PK`; `(document_id, chunk_index) UQ`; document `FK → runtime_text_similarity_documents.id ON DELETE CASCADE`. Derivable chunk vectors and source spans. |
|
|
227
|
+
|
|
228
|
+
### Runtime indexes
|
|
229
|
+
|
|
230
|
+
| Index | Table and ordered columns or predicate |
|
|
231
|
+
| --- | --- |
|
|
232
|
+
| `runtime_jobs_state` | `runtime_jobs(state, enqueued_at)` |
|
|
233
|
+
| `runtime_jobs_lease` | `runtime_jobs(state, lease_expires_at)` |
|
|
234
|
+
| `runtime_jobs_dedupe` | `UNIQUE runtime_jobs(dedupe_key)` where key is non-null and state is queued/running/completing |
|
|
235
|
+
| `runtime_jobs_external` | `UNIQUE runtime_jobs(type, external_task_id)` where external task ID is non-null |
|
|
236
|
+
| `runtime_resource_active` | `UNIQUE runtime_resource_leases(resource_key)` where `revoked_at IS NULL` |
|
|
237
|
+
| `runtime_resource_artifact` | `runtime_resource_leases(artifact_id, revoked_at)` |
|
|
238
|
+
| `runtime_pending_external` | `UNIQUE runtime_pending_tasks(task_id)` |
|
|
239
|
+
| `runtime_logs_lookup` | `runtime_logs(name, created_at)` |
|
|
240
|
+
| `runtime_similarity_kind` | `runtime_similarity_embeddings(kind, embedding_space, updated_at)` |
|
|
241
|
+
| `runtime_similarity_object` | `runtime_similarity_embeddings(object_hash, embedding_space)` |
|
|
242
|
+
| `runtime_text_similarity_lookup` | `runtime_text_similarity_documents(embedding_space, updated_at)` |
|
|
243
|
+
| `runtime_text_similarity_object` | `runtime_text_similarity_documents(object_hash, embedding_space)` |
|
|
244
|
+
| `runtime_text_similarity_content` | `runtime_text_similarity_documents(content_hash, embedding_space)` |
|
|
245
|
+
| `runtime_text_similarity_chunk_lookup` | `runtime_text_similarity_chunks(embedding_space, document_id, chunk_index)` |
|
|
246
|
+
| `runtime_text_similarity_chunk_document` | `runtime_text_similarity_chunks(document_id, chunk_index)` |
|
|
247
|
+
|
|
248
|
+
## Revision and recovery structures
|
|
249
|
+
|
|
250
|
+
A semantic mutation crosses two atomicity domains and uses the runtime outbox
|
|
251
|
+
to recover safely:
|
|
252
|
+
|
|
253
|
+
1. Start `BEGIN IMMEDIATE`.
|
|
254
|
+
2. Change the requested semantic rows.
|
|
255
|
+
3. Insert the mutation's `operations` row.
|
|
256
|
+
4. Insert `runtime_commit_outbox(operation_id, tables_json, message, created_at)`.
|
|
257
|
+
5. Commit the SQL transaction.
|
|
258
|
+
6. Stage only changed names from `SEMANTIC_TABLES`.
|
|
259
|
+
7. Create a Dolt commit on `main`.
|
|
260
|
+
8. Delete the runtime outbox row in a runtime transaction.
|
|
261
|
+
|
|
262
|
+
On reopen, the engine drains any surviving outbox record. Runtime staging is
|
|
263
|
+
checked before writes and after commits. Historical reads use
|
|
264
|
+
`dolt_at_<semantic_table>(revision)`; history and conflict projections use
|
|
265
|
+
Dolt log, status, and diff APIs. Remote catalog support is push-backup only.
|
|
266
|
+
|
|
267
|
+
## Video-editing structures exposed today
|
|
268
|
+
|
|
269
|
+
The SQL schema is only one part of the editing model. These structures and
|
|
270
|
+
conventions are also important.
|
|
271
|
+
|
|
272
|
+
### Timeline contract
|
|
273
|
+
|
|
274
|
+
```ts
|
|
275
|
+
type TimelineRender = "landscape" | "portrait" | "square";
|
|
276
|
+
|
|
277
|
+
interface Timeline {
|
|
278
|
+
bookId: string;
|
|
279
|
+
render: TimelineRender;
|
|
280
|
+
slots: TimelineSlot[];
|
|
281
|
+
audio: TimelineAudio[];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
interface TimelineSlot {
|
|
285
|
+
id: string; // UUIDv7
|
|
286
|
+
artifactId: string;
|
|
287
|
+
volume?: number;
|
|
288
|
+
audioFadeIn?: number;
|
|
289
|
+
audioFadeOut?: number;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
interface TimelineAudio {
|
|
293
|
+
id: string; // UUIDv7
|
|
294
|
+
artifactId: string;
|
|
295
|
+
startFrame: number;
|
|
296
|
+
durationFrames: number;
|
|
297
|
+
volume?: number;
|
|
298
|
+
fadeIn?: number;
|
|
299
|
+
fadeOut?: number;
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
`engine.timeline.set()` replaces/synchronizes the normalized rows while
|
|
304
|
+
preserving caller-supplied stable IDs. `getAtRevision()` projects the three
|
|
305
|
+
timeline tables at a Dolt revision.
|
|
306
|
+
|
|
307
|
+
### Artifact manifest and content
|
|
308
|
+
|
|
309
|
+
```ts
|
|
310
|
+
interface ArtifactManifestFile {
|
|
311
|
+
name: string;
|
|
312
|
+
sizeBytes: number;
|
|
313
|
+
extension: string | null;
|
|
314
|
+
mtimeMs: number;
|
|
315
|
+
mimeType?: string;
|
|
316
|
+
objectHash: string;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
interface ArtifactManifest {
|
|
320
|
+
artifactId: string;
|
|
321
|
+
slug: string;
|
|
322
|
+
path: string; // disposable workspace path
|
|
323
|
+
fileCount: number;
|
|
324
|
+
files: ArtifactManifestFile[];
|
|
325
|
+
directories?: Record<string, string[]>;
|
|
326
|
+
}
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
The manifest is a projection of `artifacts`, `artifact_files`, and `objects`.
|
|
330
|
+
The bytes live in CAS; workspaces are materialized copies. Version history
|
|
331
|
+
changes the logical path-to-hash mapping, never an existing object.
|
|
332
|
+
|
|
333
|
+
Media lookup follows file conventions rather than additional SQL rows:
|
|
334
|
+
|
|
335
|
+
- source media normally uses `original.<extension>`;
|
|
336
|
+
- recognized video extensions are MP4, MOV, WebM, AVI, and MKV;
|
|
337
|
+
- recognized audio extensions are MP3, WAV, OGG, FLAC, AAC, and M4A;
|
|
338
|
+
- video artifacts may expose extracted audio as `audio_original.mp3`;
|
|
339
|
+
- the `final` artifact uses `timeline_landscape.mp4`,
|
|
340
|
+
`timeline_portrait.mp4`, or `timeline_square.mp4`.
|
|
341
|
+
|
|
342
|
+
### Creative graph
|
|
343
|
+
|
|
344
|
+
The notebook document is a normalized graph projection:
|
|
345
|
+
|
|
346
|
+
```text
|
|
347
|
+
NotebookDocument
|
|
348
|
+
├── properties
|
|
349
|
+
├── cells[]
|
|
350
|
+
│ ├── position { x, y }
|
|
351
|
+
│ ├── optional entity reference
|
|
352
|
+
│ ├── prompt/model/inputs
|
|
353
|
+
│ └── optional output artifact reference
|
|
354
|
+
└── edges[]
|
|
355
|
+
└── source cell → target cell / target input
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Terminal `NotebookRun` values preserve evaluated cell order, artifact outputs,
|
|
359
|
+
status, and error. Entities provide structured prompts, characters, and scenes.
|
|
360
|
+
|
|
361
|
+
### Provenance and concurrency
|
|
362
|
+
|
|
363
|
+
- `Revision` projects Dolt commit hash, operation, artifact, details, and file
|
|
364
|
+
changes.
|
|
365
|
+
- `HistoryAction` projects the action DAG, lifecycle events, input/output
|
|
366
|
+
artifact lineage, workflow layout, and write set.
|
|
367
|
+
- `base_revision` plus normalized write sets detect overlapping semantic
|
|
368
|
+
actions.
|
|
369
|
+
- Runtime jobs, resource leases, artifact views, owner IDs, expiry times, and
|
|
370
|
+
monotonic fences coordinate processors without polluting Dolt history.
|
|
371
|
+
|
|
372
|
+
### Derived editing support
|
|
373
|
+
|
|
374
|
+
- `audio_waveforms.peaks_json` is the current waveform data contract.
|
|
375
|
+
- Media similarity uses image/video/audio vectors; text similarity uses
|
|
376
|
+
document/chunk vectors. These are local, rebuildable caches.
|
|
377
|
+
- Work kinds cover rendering, trimming, cropping, splicing, reversing, speed
|
|
378
|
+
changes, audio replacement, transcription, isolation, cut/SFX application,
|
|
379
|
+
and finalization. These describe running work; they are not yet normalized
|
|
380
|
+
edit decisions.
|
|
381
|
+
|
|
382
|
+
## Full NLE structures not yet implemented
|
|
383
|
+
|
|
384
|
+
Schema v4 can assemble one ordered visual lane plus timed audio overlays. It is
|
|
385
|
+
not yet a complete non-linear editor model. The following is a concrete
|
|
386
|
+
candidate layout for a future clean-break schema. Every name in this section
|
|
387
|
+
is proposed and does **not** exist in schema v4.
|
|
388
|
+
|
|
389
|
+
### Core sequence model
|
|
390
|
+
|
|
391
|
+
| Candidate structure | Minimum normalized fields | Why it matters |
|
|
392
|
+
| --- | --- | --- |
|
|
393
|
+
| `sequences` | `sequence_id`, `book_id`, `name`, `width`, `height`, `pixel_aspect_num`, `pixel_aspect_den`, `frame_rate_num`, `frame_rate_den`, `audio_sample_rate`, `audio_channel_layout`, `background_rgba`, `created_at` | Supports multiple/nested sequences and defines an unambiguous rational timebase and render canvas. |
|
|
394
|
+
| `sequence_tracks` | `track_id`, `sequence_id`, `kind` (video/audio/caption), `ordinal`, `name`, `enabled`, `locked`, `muted`, `solo`, `blend_mode` | Adds compositing order, multiple lanes, track controls, and stable merge boundaries. |
|
|
395
|
+
| `clips` | `clip_id`, `track_id`, `source_artifact_id?`, `source_stream_id?`, `nested_sequence_id?`, `timeline_start_frame`, `duration_frames`, `source_in_tick?`, `source_duration_ticks?`, `speed_num`, `speed_den`, `reverse`, `enabled` | Separates source time from timeline time and makes trims, gaps, overlaps, speed changes, stills, and compound clips first-class. A check should require one artifact/stream source or one nested sequence source. Source ticks use the selected media stream's rational timebase. |
|
|
396
|
+
| `clip_links` | `link_group_id`, `clip_id`, `role` | Keeps split video/audio, captions, and related angles synchronized while permitting unlink/relink. |
|
|
397
|
+
| `clip_transforms` | `clip_id`, position, scale, anchor, rotation, crop edges, opacity, `blend_mode` | Makes spatial composition and crop/opacity editable and revisioned instead of hiding them in ad hoc JSON. |
|
|
398
|
+
|
|
399
|
+
Use integer frames for sequence/timeline coordinates, source ticks for timed
|
|
400
|
+
media, and rational pairs for frame rates, source timebases, and speed. Do not
|
|
401
|
+
use floating-point seconds as authoritative edit positions. Audio sample
|
|
402
|
+
offsets can be added where sub-frame precision is required.
|
|
403
|
+
|
|
404
|
+
### Transitions, effects, and animation
|
|
405
|
+
|
|
406
|
+
| Candidate structure | Minimum normalized fields | Why it matters |
|
|
407
|
+
| --- | --- | --- |
|
|
408
|
+
| `transitions` | `transition_id`, `track_id`, `outgoing_clip_id?`, `incoming_clip_id?`, `kind`, `duration_frames`, `alignment`, `parameters_json` | Represents crossfades, wipes, dip-to-color, and one-sided transitions with explicit adjacency. |
|
|
409
|
+
| `effects` | `effect_id`, `owner_kind`, `owner_id`, `ordinal`, `plugin_id`, `plugin_version`, `enabled`, `parameters_json` | Provides ordered clip/track/sequence video and audio processing while allowing plugin-specific parameters. |
|
|
410
|
+
| `keyframes` | `keyframe_id`, `effect_id?`, `owner_kind`, `owner_id`, `property_path`, `frame`, `value_json`, `interpolation`, in/out tangent values | Animates transforms, effect parameters, opacity, volume, and pan with stable row identities. |
|
|
411
|
+
| `masks` | `mask_id`, `effect_id`, `kind`, `path_json`, `feather`, `opacity`, `inverted` | Supports selective effects and compositing. Mask-path animation can reuse keyframes. |
|
|
412
|
+
| `tracking_data` | `track_data_id`, `mask_id?`, `clip_id`, `source_object_hash`, `points_blob` or chunk rows, `algorithm` | Stores or references expensive motion-tracking results and pins them to exact source bytes. |
|
|
413
|
+
|
|
414
|
+
Core effect identity, ordering, enablement, and ownership should be normalized.
|
|
415
|
+
Plugin payloads are appropriate JSON; IDs, timing, ordering, and references
|
|
416
|
+
should not be hidden inside JSON arrays.
|
|
417
|
+
|
|
418
|
+
### Audio model
|
|
419
|
+
|
|
420
|
+
| Candidate structure | Minimum normalized fields | Why it matters |
|
|
421
|
+
| --- | --- | --- |
|
|
422
|
+
| `audio_buses` | `bus_id`, `sequence_id`, `parent_bus_id?`, `name`, `ordinal`, `gain_db`, `pan`, `muted`, `solo` | Supports master/submix buses and stable routing. |
|
|
423
|
+
| `audio_routes` | `route_id`, `source_kind`, `source_id`, `destination_bus_id`, `send_gain_db`, `pre_fader` | Routes tracks and clips through submixes and sidechains. |
|
|
424
|
+
| `automation_points` | `point_id`, `owner_kind`, `owner_id`, `property`, `frame` or `sample`, `value`, `interpolation` | Models volume, pan, effect, and ducking automation with sub-frame precision where needed. |
|
|
425
|
+
| `audio_analysis` | `artifact_id`, `object_hash`, loudness fields, peak, channel count, sample rate, analysis version | Enables normalization, clipping warnings, and reproducible loudness targets. Derivable analysis can remain runtime-only unless accepted values affect a render. |
|
|
426
|
+
|
|
427
|
+
### Captions, transcripts, and navigation
|
|
428
|
+
|
|
429
|
+
| Candidate structure | Minimum normalized fields | Why it matters |
|
|
430
|
+
| --- | --- | --- |
|
|
431
|
+
| `caption_tracks` | `caption_track_id`, `sequence_id`, `language`, `kind`, `name`, `style_id?`, `ordinal` | Separates subtitles, captions, translations, and burned-in text lanes. |
|
|
432
|
+
| `caption_cues` | `cue_id`, `caption_track_id`, `start_frame`, `end_frame`, `text`, `speaker_id?`, `style_overrides_json` | Makes cue timing and text independently mergeable and exportable. |
|
|
433
|
+
| `caption_styles` | `style_id`, font, size, color, outline, background, alignment, safe-area and position fields | Provides reusable, revisioned caption appearance. |
|
|
434
|
+
| `markers` | `marker_id`, `sequence_id`, `start_frame`, `end_frame?`, `kind`, `label`, `color`, `details_json` | Supports edit notes, chapters, beats, ranges, review flags, and navigation. |
|
|
435
|
+
| `transcript_segments` | `segment_id`, `artifact_id`, `start_time_num`, `start_time_den`, `end_time_num`, `end_time_den`, `speaker_id?`, `text`, confidence and word-timing data | Preserves source-relative transcription separately from sequence captions. |
|
|
436
|
+
|
|
437
|
+
### Media facts, proxies, and delivery
|
|
438
|
+
|
|
439
|
+
| Candidate structure | Minimum normalized fields | Why it matters |
|
|
440
|
+
| --- | --- | --- |
|
|
441
|
+
| `media_streams` | `stream_id`, `artifact_id`, `path`, `object_hash`, `stream_index`, `kind`, codec/profile, timebase numerator/denominator, duration ticks, width/height, sample rate/channels, rotation, color metadata | Pins probe facts to exact bytes and removes ambiguity around VFR media, rotation, codecs, and channel layouts. |
|
|
442
|
+
| `media_derivatives` | `derivative_id`, `source_object_hash`, `kind` (proxy/optimized/thumbnail/waveform), `profile`, `object_hash`, dimensions/rate fields, `created_at` | Maps reproducible proxies and previews to a source object and processing profile. |
|
|
443
|
+
| `render_presets` | `preset_id`, `name`, container/video/audio codec settings, dimensions, frame rate, rate-control and color settings | Makes delivery settings revisioned and reusable. |
|
|
444
|
+
| `render_deliverables` | `deliverable_id`, `sequence_id`, `preset_id`, `range_start_frame`, `range_end_frame`, `output_artifact_id?`, `state`, `requested_revision` | Pins a render request to an exact edit revision, range, preset, and resulting artifact. Active progress belongs in runtime jobs. |
|
|
445
|
+
| `analysis_markers` | `analysis_id`, `artifact_id`, `object_hash`, `kind` (cut/beat/silence/face/object), source-time range, score, model/version, `data_json` | Supports scene detection and assisted editing while keeping derived results tied to source bytes. |
|
|
446
|
+
|
|
447
|
+
Probe results, proxies, thumbnails, tracking, and analysis are rebuildable. Keep
|
|
448
|
+
them local-only when they are merely caches. Version a compact accepted
|
|
449
|
+
projection when a result changes edit semantics, must merge across forks, or
|
|
450
|
+
must reproduce a render.
|
|
451
|
+
|
|
452
|
+
### Schema rules for a future editing model
|
|
453
|
+
|
|
454
|
+
- Give every independently editable or reorderable row a UUIDv7 primary key.
|
|
455
|
+
- Keep an explicit owner FK on every track, clip, transition, effect, cue, and
|
|
456
|
+
marker; schema v4's implicit singleton timeline ownership should not be
|
|
457
|
+
repeated.
|
|
458
|
+
- Use `ON DELETE RESTRICT` for live source references and `CASCADE` only for
|
|
459
|
+
truly owned children.
|
|
460
|
+
- Preserve loose references only in audit/lineage records that must outlive the
|
|
461
|
+
target.
|
|
462
|
+
- Keep order as an integer plus stable ID tie-breaker, or use a documented
|
|
463
|
+
fractional ordering key if frequent insertion warrants it.
|
|
464
|
+
- Put user intent and accepted edit decisions in Dolt. Put playhead position,
|
|
465
|
+
selections, UI panels, decode caches, thumbnails, temporary renders, active
|
|
466
|
+
jobs, locks, and presence in ignored runtime tables.
|
|
467
|
+
- Pin renders and derived analysis to source object hashes and a Dolt revision,
|
|
468
|
+
not mutable artifact slugs or workspace paths.
|
|
469
|
+
- Treat color space, transfer function, matrix, range, alpha mode, rotation,
|
|
470
|
+
sample rate, channel layout, and variable-frame-rate timing as first-class
|
|
471
|
+
media facts.
|
|
472
|
+
- Maintain schema/source compatibility as a clean break: a future expanded
|
|
473
|
+
catalog should increment `SCHEMA_VERSION` and update DDL, public types,
|
|
474
|
+
history restore, staging tests, and this layout together.
|
|
475
|
+
|
|
476
|
+
## Source map
|
|
477
|
+
|
|
478
|
+
| Concern | Implementation |
|
|
479
|
+
| --- | --- |
|
|
480
|
+
| DDL, table allowlists, indexes | [`src/schema.ts`](../src/schema.ts) |
|
|
481
|
+
| SQL transactions, Dolt staging, commits, outbox recovery | [`src/store.ts`](../src/store.ts) |
|
|
482
|
+
| Engine paths and row projections | [`src/context.ts`](../src/context.ts) |
|
|
483
|
+
| Immutable object layout and remote keys | [`src/cas.ts`](../src/cas.ts) |
|
|
484
|
+
| Artifact mappings and workspace materialization | [`src/files.ts`](../src/files.ts) |
|
|
485
|
+
| Current timeline API and row synchronization | [`src/timeline.ts`](../src/timeline.ts) |
|
|
486
|
+
| Public timeline, manifest, job, status, and similarity types | [`src/engine-types.ts`](../src/engine-types.ts) |
|
|
487
|
+
| Entity/notebook graph types | [`src/notebook/types.ts`](../src/notebook/types.ts) |
|
|
488
|
+
| Revision and action projections/restores | [`src/history.ts`](../src/history.ts), [`src/history-types.ts`](../src/history-types.ts) |
|
|
489
|
+
| Media naming and discovery conventions | [`src/media.ts`](../src/media.ts) |
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "videobook-engine",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Dolt-native local-first storage engine for Videobook",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"docs"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
20
|
+
"build": "npm run clean && tsc",
|
|
21
|
+
"prepare": "npm run build",
|
|
22
|
+
"prepack": "npm run build",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"lint": "knip",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest",
|
|
27
|
+
"example:basic": "npm run build && tsx examples/basic-usage.ts",
|
|
28
|
+
"examples": "npm run example:basic"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=22"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@dolthub/doltlite": "^0.11.37",
|
|
35
|
+
"@huggingface/transformers": "4.2.0",
|
|
36
|
+
"node-gyp": "12.1.0",
|
|
37
|
+
"sharp": "0.35.3",
|
|
38
|
+
"usearch": "2.26.0",
|
|
39
|
+
"uuid": "^14.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "^20.0.0",
|
|
43
|
+
"fast-check": "^4.5.3",
|
|
44
|
+
"knip": "^6.11.0",
|
|
45
|
+
"tsx": "^4.19.0",
|
|
46
|
+
"typescript": "^5.5.0",
|
|
47
|
+
"vitest": "^4.1.8"
|
|
48
|
+
},
|
|
49
|
+
"overrides": {
|
|
50
|
+
"adm-zip": "0.6.0",
|
|
51
|
+
"esbuild": "0.28.1",
|
|
52
|
+
"postcss": "^8.5.10",
|
|
53
|
+
"sharp": "0.35.3"
|
|
54
|
+
}
|
|
55
|
+
}
|