videobook-engine 2.0.1 → 5.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 +99 -68
- package/dist/artifacts.d.ts +4 -9
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +78 -138
- package/dist/artifacts.js.map +1 -1
- package/dist/books.d.ts +1 -1
- package/dist/books.d.ts.map +1 -1
- package/dist/books.js +18 -10
- package/dist/books.js.map +1 -1
- package/dist/cas.d.ts +27 -1
- package/dist/cas.d.ts.map +1 -1
- package/dist/cas.js +78 -6
- package/dist/cas.js.map +1 -1
- package/dist/catalog-metadata.d.ts +56 -0
- package/dist/catalog-metadata.d.ts.map +1 -0
- package/dist/catalog-metadata.js +42 -0
- package/dist/catalog-metadata.js.map +1 -0
- package/dist/communications.js +4 -2
- package/dist/communications.js.map +1 -1
- package/dist/context.d.ts +9 -6
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +42 -51
- package/dist/context.js.map +1 -1
- package/dist/domain.d.ts +39 -2
- package/dist/domain.d.ts.map +1 -1
- package/dist/domain.js +846 -64
- package/dist/domain.js.map +1 -1
- package/dist/edit-policy.d.ts +3 -0
- package/dist/edit-policy.d.ts.map +1 -0
- package/dist/edit-policy.js +6 -0
- package/dist/edit-policy.js.map +1 -0
- package/dist/edits.d.ts +10 -0
- package/dist/edits.d.ts.map +1 -0
- package/dist/edits.js +1392 -0
- package/dist/edits.js.map +1 -0
- package/dist/engine-types.d.ts +171 -86
- package/dist/engine-types.d.ts.map +1 -1
- package/dist/engine-types.js +32 -0
- package/dist/engine-types.js.map +1 -1
- package/dist/engine.d.ts +89 -26
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +27 -21
- package/dist/engine.js.map +1 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +32 -28
- package/dist/files.js.map +1 -1
- package/dist/fork.d.ts +148 -0
- package/dist/fork.d.ts.map +1 -0
- package/dist/fork.js +602 -0
- package/dist/fork.js.map +1 -0
- package/dist/generations.d.ts +9 -0
- package/dist/generations.d.ts.map +1 -0
- package/dist/generations.js +175 -0
- package/dist/generations.js.map +1 -0
- package/dist/history.d.ts +2 -5
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +183 -640
- package/dist/history.js.map +1 -1
- package/dist/index.d.ts +21 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/job-queue.d.ts +2 -0
- package/dist/job-queue.d.ts.map +1 -1
- package/dist/job-queue.js +29 -2
- package/dist/job-queue.js.map +1 -1
- package/dist/media.d.ts +3 -3
- package/dist/media.d.ts.map +1 -1
- package/dist/media.js +6 -5
- package/dist/media.js.map +1 -1
- package/dist/merge-policy.d.ts +83 -0
- package/dist/merge-policy.d.ts.map +1 -0
- package/dist/merge-policy.js +203 -0
- package/dist/merge-policy.js.map +1 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +17 -23
- package/dist/metadata.js.map +1 -1
- package/dist/migration.d.ts +9 -0
- package/dist/migration.d.ts.map +1 -0
- package/dist/migration.js +564 -0
- package/dist/migration.js.map +1 -0
- package/dist/mvp-contract-fixtures.d.ts +244 -0
- package/dist/mvp-contract-fixtures.d.ts.map +1 -0
- package/dist/mvp-contract-fixtures.js +556 -0
- package/dist/mvp-contract-fixtures.js.map +1 -0
- package/dist/mvp-contracts.d.ts +761 -0
- package/dist/mvp-contracts.d.ts.map +1 -0
- package/dist/mvp-contracts.js +59 -0
- package/dist/mvp-contracts.js.map +1 -0
- package/dist/mvp-time.d.ts +54 -0
- package/dist/mvp-time.d.ts.map +1 -0
- package/dist/mvp-time.js +148 -0
- package/dist/mvp-time.js.map +1 -0
- package/dist/notebook/types.d.ts +85 -8
- package/dist/notebook/types.d.ts.map +1 -1
- package/dist/notebook-grid.d.ts +37 -0
- package/dist/notebook-grid.d.ts.map +1 -0
- package/dist/notebook-grid.js +160 -0
- package/dist/notebook-grid.js.map +1 -0
- package/dist/notebook-media-artifact.d.ts +23 -0
- package/dist/notebook-media-artifact.d.ts.map +1 -0
- package/dist/notebook-media-artifact.js +67 -0
- package/dist/notebook-media-artifact.js.map +1 -0
- package/dist/notebook-mentions.d.ts +20 -0
- package/dist/notebook-mentions.d.ts.map +1 -0
- package/dist/notebook-mentions.js +53 -0
- package/dist/notebook-mentions.js.map +1 -0
- package/dist/order-keys.d.ts +22 -0
- package/dist/order-keys.d.ts.map +1 -0
- package/dist/order-keys.js +262 -0
- package/dist/order-keys.js.map +1 -0
- package/dist/runtime-services.js +8 -11
- package/dist/runtime-services.js.map +1 -1
- package/dist/schema.d.ts +8 -5
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +624 -141
- package/dist/schema.js.map +1 -1
- package/dist/search-benchmark.d.ts +4 -0
- package/dist/search-benchmark.d.ts.map +1 -0
- package/dist/search-benchmark.js +144 -0
- package/dist/search-benchmark.js.map +1 -0
- package/dist/sequences.d.ts +20 -0
- package/dist/sequences.d.ts.map +1 -0
- package/dist/sequences.js +825 -0
- package/dist/sequences.js.map +1 -0
- package/dist/similarity.js +10 -10
- package/dist/similarity.js.map +1 -1
- package/dist/status.js +8 -10
- package/dist/status.js.map +1 -1
- package/dist/storage.d.ts +3 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +388 -7
- package/dist/storage.js.map +1 -1
- package/dist/store.d.ts +64 -3
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +354 -68
- package/dist/store.js.map +1 -1
- package/dist/streams.d.ts +10 -0
- package/dist/streams.d.ts.map +1 -0
- package/dist/streams.js +183 -0
- package/dist/streams.js.map +1 -0
- package/dist/temporal-models.d.ts +48 -0
- package/dist/temporal-models.d.ts.map +1 -0
- package/dist/temporal-models.js +278 -0
- package/dist/temporal-models.js.map +1 -0
- package/dist/temporal-search.d.ts +29 -0
- package/dist/temporal-search.d.ts.map +1 -0
- package/dist/temporal-search.js +1551 -0
- package/dist/temporal-search.js.map +1 -0
- package/dist/transcripts.d.ts +16 -0
- package/dist/transcripts.d.ts.map +1 -0
- package/dist/transcripts.js +519 -0
- package/dist/transcripts.js.map +1 -0
- package/docs/engine-layout.md +345 -110
- package/docs/mvp-prd.md +918 -0
- package/fixtures/media/vancat.mp4 +0 -0
- package/fixtures/media/vancat_profile.jpg +0 -0
- package/fixtures/v5/contract-fixtures.json +1532 -0
- package/package.json +42 -5
- package/dist/history-types.d.ts +0 -74
- package/dist/history-types.d.ts.map +0 -1
- package/dist/history-types.js +0 -2
- package/dist/history-types.js.map +0 -1
- package/dist/resolver.d.ts +0 -15
- package/dist/resolver.d.ts.map +0 -1
- package/dist/resolver.js +0 -81
- package/dist/resolver.js.map +0 -1
- package/dist/timeline.d.ts +0 -9
- package/dist/timeline.d.ts.map +0 -1
- package/dist/timeline.js +0 -236
- package/dist/timeline.js.map +0 -1
package/dist/fork.d.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { CatalogBackupConfig, ContentStore, EngineIdentity } from "./engine-types.js";
|
|
2
|
+
import { type Engine } from "./engine.js";
|
|
3
|
+
/**
|
|
4
|
+
* Fork bootstrap and merge-back integration (ve-mim.7; see
|
|
5
|
+
* docs/engine-layout.md "Forks and merge-back integration").
|
|
6
|
+
*
|
|
7
|
+
* A fork is, from the engine's point of view:
|
|
8
|
+
*
|
|
9
|
+
* 1. a platform fork — creating the hosted copy of the catalog and giving it
|
|
10
|
+
* a URL is the hosting layer's job, out of engine scope;
|
|
11
|
+
* 2. a clone of the catalog into a local engine root (`bootstrapFork`);
|
|
12
|
+
* 3. a public-read object store keyed by SHA-256. `ContentStore` stays the
|
|
13
|
+
* abstraction; the existing `ensureLocal` lazy fetch in src/cas.ts makes
|
|
14
|
+
* upstream objects readable to forkers on first touch. Whether the
|
|
15
|
+
* fork's store proxies to upstream's is a hosting concern — the engine
|
|
16
|
+
* only ever sees one `ContentStore` per engine root.
|
|
17
|
+
*
|
|
18
|
+
* The live-engine never-pulls rule stands: an open engine never fetches,
|
|
19
|
+
* pulls, or merges. Integration happens in a DEDICATED merge-back flow
|
|
20
|
+
* (`mergeBack`) that runs on a throwaway copy of a closed catalog database
|
|
21
|
+
* in a temp directory, never on the user's open live catalog.
|
|
22
|
+
*
|
|
23
|
+
* ve-wsu routing (doltlite 0.11.37, verified empirically):
|
|
24
|
+
*
|
|
25
|
+
* - `dolt_clone` of the full 28-table catalog produces a malformed database
|
|
26
|
+
* (`invalid rootpage` on a secondary autoindex; the file cannot even be
|
|
27
|
+
* opened for reads). `bootstrapFork` therefore bootstraps from a byte
|
|
28
|
+
* snapshot of a healthy catalog database; a URL clone is attempted and
|
|
29
|
+
* health-validated, and surfaces a typed FEATURE_UNAVAILABLE error while
|
|
30
|
+
* the upstream bug stands.
|
|
31
|
+
* - `dolt_merge`'s uncommitted-changes guard misfires on the full catalog
|
|
32
|
+
* (every table reports phantom `modified` status with zero row diffs).
|
|
33
|
+
* Committing the phantom dirt passes the guard, but the merge then dies
|
|
34
|
+
* in schema loading (`schema conflict on table 'sqlite_autoindex_*'`),
|
|
35
|
+
* and `dolt_checkout` corrupts the working set, so no branch dance can
|
|
36
|
+
* produce a true two-parent merge commit either. `mergeBack` therefore
|
|
37
|
+
* performs the same three-way merge at the projection layer
|
|
38
|
+
* (`dolt_merge_base` + `dolt_at_<table>` snapshots, which are unaffected)
|
|
39
|
+
* under the exact src/merge-policy.ts policy, and lands a forward
|
|
40
|
+
* integration commit on main that records the integrated fork head in a
|
|
41
|
+
* `merged-revision` trailer. When ve-wsu is fixed, the projection merge
|
|
42
|
+
* in `mergeRefs` is the single swap point for `mergeWithPolicy` +
|
|
43
|
+
* `dolt_merge`.
|
|
44
|
+
*/
|
|
45
|
+
export interface ForkBootstrapOptions {
|
|
46
|
+
dataDir: string;
|
|
47
|
+
workspaceDir: string;
|
|
48
|
+
/**
|
|
49
|
+
* Byte snapshot of a healthy upstream catalog database (a copy of its
|
|
50
|
+
* `videobook.db` taken while the upstream engine was closed). This is the
|
|
51
|
+
* bootstrap that works with doltlite 0.11.37; the hosting layer provides
|
|
52
|
+
* the snapshot when it creates the platform fork.
|
|
53
|
+
*/
|
|
54
|
+
snapshotPath?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Upstream catalog remote URL to `dolt_clone`. Currently blocked by
|
|
57
|
+
* ve-wsu for full engine catalogs; the clone is attempted and the result
|
|
58
|
+
* health-validated so this path starts working unchanged once doltlite
|
|
59
|
+
* is fixed. Mutually exclusive with `snapshotPath`.
|
|
60
|
+
*/
|
|
61
|
+
upstreamUrl?: string;
|
|
62
|
+
remoteObjects?: ContentStore;
|
|
63
|
+
objectPrefix?: string;
|
|
64
|
+
/** Remote registration for the fork's own catalog remote (push target). */
|
|
65
|
+
catalogBackup?: CatalogBackupConfig;
|
|
66
|
+
identity?: EngineIdentity;
|
|
67
|
+
}
|
|
68
|
+
export interface MergeBackOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Path to a healthy upstream catalog database file (its `videobook.db`).
|
|
71
|
+
* The file is only read — it is copied into a temp workspace and all
|
|
72
|
+
* merging happens there. The upstream engine must be closed (or pass a
|
|
73
|
+
* snapshot taken while it was closed) so the copy is consistent.
|
|
74
|
+
*/
|
|
75
|
+
upstreamDbPath: string;
|
|
76
|
+
/**
|
|
77
|
+
* Upstream catalog remote to push the integration commit to. Defaults to
|
|
78
|
+
* the `origin` remote already registered in the upstream database.
|
|
79
|
+
*/
|
|
80
|
+
upstreamRemote?: CatalogBackupConfig;
|
|
81
|
+
/** Fork catalog remote to fetch the fork's commits from. */
|
|
82
|
+
forkRemote: {
|
|
83
|
+
name?: string;
|
|
84
|
+
url: string;
|
|
85
|
+
};
|
|
86
|
+
forkBranch?: string;
|
|
87
|
+
/** Upstream object store: fork objects are uploaded here before push. */
|
|
88
|
+
upstreamObjects?: ContentStore;
|
|
89
|
+
/** Fork object store (public-read): source of the fork's new objects. */
|
|
90
|
+
forkObjects?: ContentStore;
|
|
91
|
+
objectPrefix?: string;
|
|
92
|
+
/** Commit author for the integration commit. */
|
|
93
|
+
author?: string;
|
|
94
|
+
/** Directory for the throwaway merge workspace (defaults to a temp dir). */
|
|
95
|
+
workDir?: string;
|
|
96
|
+
/** Keep the merge workspace for inspection instead of deleting it. */
|
|
97
|
+
keepWorkDir?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface MergeBackResult {
|
|
100
|
+
/** HEAD of upstream main after the flow (the integration commit). */
|
|
101
|
+
integrationCommit: string;
|
|
102
|
+
/** Merge base used for the three-way merge. */
|
|
103
|
+
baseRevision: string;
|
|
104
|
+
/** Upstream main head before the merge. */
|
|
105
|
+
oursRevision: string;
|
|
106
|
+
/** Integrated fork head, recorded in the commit's merged-revision trailer. */
|
|
107
|
+
theirsRevision: string;
|
|
108
|
+
/** True when the fork was already fully integrated (no commit minted). */
|
|
109
|
+
alreadyIntegrated: boolean;
|
|
110
|
+
/** Fork object hashes uploaded to the upstream object store. */
|
|
111
|
+
uploadedObjects: string[];
|
|
112
|
+
reconciledTranscripts: number;
|
|
113
|
+
reconciledSequences: number;
|
|
114
|
+
/** Merge workspace path when `keepWorkDir` was set. */
|
|
115
|
+
workDir?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface RowConflict {
|
|
118
|
+
table: string;
|
|
119
|
+
key: Record<string, unknown>;
|
|
120
|
+
reason: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Bootstraps a fork: clones the upstream catalog into a new local engine
|
|
124
|
+
* root and opens it as a normal engine. The fork is a full citizen from
|
|
125
|
+
* there — it commits on its own main, backs up to its own catalog remote,
|
|
126
|
+
* and reads upstream objects lazily through its configured `ContentStore`.
|
|
127
|
+
* It never pulls; integration is the merge-back flow's job.
|
|
128
|
+
*/
|
|
129
|
+
export declare function bootstrapFork(options: ForkBootstrapOptions): Promise<Engine>;
|
|
130
|
+
/**
|
|
131
|
+
* Integrates a fork back into upstream main.
|
|
132
|
+
*
|
|
133
|
+
* Runs entirely in a throwaway copy of the upstream catalog inside a temp
|
|
134
|
+
* directory: fetches the fork, merges under the engine merge policy
|
|
135
|
+
* (same-schema precondition, constraint verification, deterministic
|
|
136
|
+
* singleton reconcile; artifact identity is artifact_id, so there is no
|
|
137
|
+
* name-conflict class to check), uploads the fork's new
|
|
138
|
+
* objects to the upstream object store BEFORE the catalog ref moves — the
|
|
139
|
+
* same objects-before-push ordering as engine.storage.backup — lands one
|
|
140
|
+
* forward integration commit on main, and pushes it.
|
|
141
|
+
*
|
|
142
|
+
* The caller's open engines are never touched: the upstream database file
|
|
143
|
+
* is only read (copied), and the fork is only fetched from. Conflicts and
|
|
144
|
+
* violations surface as the typed MERGE_CONFLICT / MERGE_VIOLATION /
|
|
145
|
+
* SCHEMA_INCOMPATIBLE errors from src/merge-policy.ts.
|
|
146
|
+
*/
|
|
147
|
+
export declare function mergeBack(options: MergeBackOptions): Promise<MergeBackResult>;
|
|
148
|
+
//# sourceMappingURL=fork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fork.d.ts","sourceRoot":"","sources":["../src/fork.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B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