@morshoto/framekit 0.1.18 → 0.2.3
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 +17 -12
- package/dist-package/adapters/final-cut/typescript/src/analyzers.d.ts +58 -0
- package/dist-package/adapters/final-cut/typescript/src/analyzers.js +52 -13
- package/dist-package/adapters/final-cut/typescript/src/assets.d.ts +24 -0
- package/dist-package/adapters/final-cut/typescript/src/background-export.d.ts +98 -0
- package/dist-package/adapters/final-cut/typescript/src/background-materialization.d.ts +47 -0
- package/dist-package/adapters/final-cut/typescript/src/background-materialization.js +8 -2
- package/dist-package/adapters/final-cut/typescript/src/canonical-recovery-guard.d.ts +32 -0
- package/dist-package/adapters/final-cut/typescript/src/canonical-recovery-guard.js +275 -0
- package/dist-package/adapters/final-cut/typescript/src/canonical-recovery.d.ts +22 -0
- package/dist-package/adapters/final-cut/typescript/src/canonical-verification.d.ts +11 -0
- package/dist-package/adapters/final-cut/typescript/src/canonical.d.ts +184 -0
- package/dist-package/adapters/final-cut/typescript/src/canonical.js +571 -78
- package/dist-package/adapters/final-cut/typescript/src/connection.d.ts +103 -0
- package/dist-package/adapters/final-cut/typescript/src/connection.js +6 -1
- package/dist-package/adapters/final-cut/typescript/src/disposable-native.d.ts +90 -0
- package/dist-package/adapters/final-cut/typescript/src/disposable-native.js +6 -0
- package/dist-package/adapters/final-cut/typescript/src/documents.d.ts +3 -0
- package/dist-package/adapters/final-cut/typescript/src/documents.js +3 -0
- package/dist-package/adapters/final-cut/typescript/src/experimental.d.ts +8 -0
- package/dist-package/adapters/final-cut/typescript/src/experimental.js +8 -0
- package/dist-package/adapters/final-cut/typescript/src/export.d.ts +125 -0
- package/dist-package/adapters/final-cut/typescript/src/fcpxml-console-experiment.d.ts +54 -0
- package/dist-package/adapters/final-cut/typescript/src/fcpxml.d.ts +75 -0
- package/dist-package/adapters/final-cut/typescript/src/fcpxml.js +28 -9
- package/dist-package/adapters/final-cut/typescript/src/index.d.ts +22 -0
- package/dist-package/adapters/final-cut/typescript/src/index.js +1 -7
- package/dist-package/adapters/final-cut/typescript/src/library-inspection.d.ts +101 -0
- package/dist-package/adapters/final-cut/typescript/src/live.d.ts +101 -0
- package/dist-package/adapters/final-cut/typescript/src/live.js +35 -2
- package/dist-package/adapters/final-cut/typescript/src/media.d.ts +12 -0
- package/dist-package/adapters/final-cut/typescript/src/native-operation.d.ts +6 -0
- package/dist-package/adapters/final-cut/typescript/src/native-recovery-inspection.d.ts +77 -0
- package/dist-package/adapters/final-cut/typescript/src/native-recovery-inspection.js +175 -0
- package/dist-package/adapters/final-cut/typescript/src/native-session.d.ts +130 -0
- package/dist-package/adapters/final-cut/typescript/src/native-session.js +11 -6
- package/dist-package/adapters/final-cut/typescript/src/native.d.ts +828 -0
- package/dist-package/adapters/final-cut/typescript/src/native.js +475 -189
- package/dist-package/adapters/final-cut/typescript/src/pasteboard-snapshot.d.ts +114 -0
- package/dist-package/adapters/final-cut/typescript/src/publish-readback.d.ts +26 -0
- package/dist-package/adapters/final-cut/typescript/src/publish-readback.js +19 -2
- package/dist-package/adapters/final-cut/typescript/src/publisher.d.ts +215 -0
- package/dist-package/adapters/final-cut/typescript/src/publisher.js +255 -14
- package/dist-package/adapters/final-cut/typescript/src/session.d.ts +43 -0
- package/dist-package/adapters/final-cut/typescript/src/session.js +43 -13
- package/dist-package/adapters/final-cut/typescript/src/shadow-mutation.d.ts +51 -0
- package/dist-package/adapters/final-cut/typescript/src/sqlite-experiment.d.ts +156 -0
- package/dist-package/adapters/final-cut/typescript/src/sqlite-inspection.d.ts +134 -0
- package/dist-package/adapters/final-cut/typescript/src/sqlite-materialization.d.ts +110 -0
- package/dist-package/adapters/final-cut/typescript/src/sqlite-wal-observation.d.ts +132 -0
- package/dist-package/adapters/final-cut/typescript/src/timeline-ir-fcpxml.d.ts +61 -0
- package/dist-package/adapters/final-cut/typescript/src/timeline-ir-fcpxml.js +31 -5
- package/dist-package/adapters/final-cut/typescript/src/unattended-editing.d.ts +54 -0
- package/dist-package/adapters/headless/typescript/src/audio-output.d.ts +3 -0
- package/dist-package/adapters/headless/typescript/src/audio-output.js +3 -0
- package/dist-package/adapters/headless/typescript/src/ffmpeg-media-probe.d.ts +11 -0
- package/dist-package/adapters/headless/typescript/src/ffmpeg-media-probe.js +26 -2
- package/dist-package/adapters/headless/typescript/src/ffmpeg-renderer.d.ts +25 -0
- package/dist-package/adapters/headless/typescript/src/ffmpeg-renderer.js +37 -14
- package/dist-package/adapters/headless/typescript/src/ffmpeg-verifier.d.ts +15 -0
- package/dist-package/adapters/headless/typescript/src/ffmpeg-verifier.js +9 -4
- package/dist-package/adapters/headless/typescript/src/index.d.ts +3 -0
- package/dist-package/apps/cli/src/dev-doctor.d.ts +25 -0
- package/dist-package/apps/cli/src/dev-doctor.js +198 -0
- package/dist-package/apps/cli/src/headless-projects.d.ts +3 -0
- package/dist-package/apps/cli/src/headless-projects.js +5 -0
- package/dist-package/apps/cli/src/main.d.ts +10 -0
- package/dist-package/apps/cli/src/main.js +42 -0
- package/dist-package/apps/mcp-server/runtime/ffmpeg-audio-backend.py +129 -0
- package/dist-package/apps/mcp-server/runtime/speech-analyzer-wrapper.mjs +54 -0
- package/dist-package/apps/mcp-server/runtime/whisper-speech-backend.py +271 -0
- package/dist-package/apps/mcp-server/src/build-alignment.d.ts +10 -0
- package/dist-package/apps/mcp-server/src/build-identity.d.ts +7 -0
- package/dist-package/apps/mcp-server/src/build-identity.json +2 -2
- package/dist-package/apps/mcp-server/src/canonical-native-snapshot.d.ts +8 -0
- package/dist-package/apps/mcp-server/src/canonical-native-snapshot.js +18 -0
- package/dist-package/apps/mcp-server/src/final-cut-runtime-config.d.ts +5 -0
- package/dist-package/apps/mcp-server/src/final-cut-runtime-config.js +3 -0
- package/dist-package/apps/mcp-server/src/headless-project-snapshot.d.ts +3 -0
- package/dist-package/apps/mcp-server/src/headless-sessions.d.ts +89 -0
- package/dist-package/apps/mcp-server/src/main.d.ts +1 -0
- package/dist-package/apps/mcp-server/src/main.js +24 -19
- package/dist-package/apps/mcp-server/src/materialization-jobs.d.ts +204 -0
- package/dist-package/apps/mcp-server/src/materialization-jobs.js +143 -10
- package/dist-package/apps/mcp-server/src/readback-policy.d.ts +18 -0
- package/dist-package/apps/mcp-server/src/routing.d.ts +90 -0
- package/dist-package/apps/mcp-server/src/routing.js +2 -0
- package/dist-package/apps/mcp-server/src/server.d.ts +75 -0
- package/dist-package/apps/mcp-server/src/server.js +813 -158
- package/dist-package/apps/mcp-server/src/tools/skills/catalog.d.ts +19 -0
- package/dist-package/apps/mcp-server/src/tools/skills/catalog.js +142 -0
- package/dist-package/apps/mcp-server/src/tools/skills/metadata.d.ts +37 -0
- package/dist-package/apps/mcp-server/src/tools/skills/metadata.js +71 -0
- package/dist-package/apps/mcp-server/src/tools/skills/register.d.ts +11 -0
- package/dist-package/apps/mcp-server/src/tools/skills/register.js +101 -0
- package/dist-package/apps/mcp-server/src/version.d.ts +4 -0
- package/dist-package/packages/headless-application/src/external-edit.d.ts +30 -0
- package/dist-package/packages/headless-application/src/external-edit.js +72 -0
- package/dist-package/packages/headless-application/src/headless-projects.d.ts +233 -0
- package/dist-package/{apps/mcp-server → packages/headless-application}/src/headless-projects.js +392 -59
- package/dist-package/packages/headless-application/src/index.d.ts +2 -0
- package/dist-package/packages/headless-application/src/index.js +2 -0
- package/dist-package/packages/runtime/src/application/duration-policy-service.d.ts +4 -0
- package/dist-package/packages/runtime/src/application/local-media.d.ts +46 -0
- package/dist-package/packages/runtime/src/application/media-analysis-service.d.ts +40 -0
- package/dist-package/packages/runtime/src/application/media-analysis-service.js +105 -15
- package/dist-package/packages/runtime/src/application/project-service.d.ts +35 -0
- package/dist-package/packages/runtime/src/application/project-service.js +5 -1
- package/dist-package/packages/runtime/src/application/project-store.d.ts +56 -0
- package/dist-package/packages/runtime/src/application/project-store.js +13 -36
- package/dist-package/packages/runtime/src/application/project-transactions.d.ts +51 -0
- package/dist-package/packages/runtime/src/application/runtime-options.d.ts +15 -0
- package/dist-package/packages/runtime/src/application/semantic-media-index-store.d.ts +28 -0
- package/dist-package/packages/runtime/src/application/transaction-store.d.ts +10 -0
- package/dist-package/packages/runtime/src/application/transaction-store.js +1 -1
- package/dist-package/packages/runtime/src/audio/analysis.d.ts +3 -0
- package/dist-package/packages/runtime/src/audio/analysis.js +95 -0
- package/dist-package/packages/runtime/src/audio/dialogue-normalization.d.ts +47 -0
- package/dist-package/packages/runtime/src/audio/noise-reduction.d.ts +34 -0
- package/dist-package/packages/runtime/src/capabilities.d.ts +45 -0
- package/dist-package/packages/runtime/src/capabilities.js +1 -1
- package/dist-package/packages/runtime/src/color-correction.d.ts +33 -0
- package/dist-package/packages/runtime/src/context/context-engine.d.ts +28 -0
- package/dist-package/packages/runtime/src/context/context-engine.js +22 -16
- package/dist-package/packages/runtime/src/context/context-service.d.ts +20 -0
- package/dist-package/packages/runtime/src/context/context-service.js +2 -2
- package/dist-package/packages/runtime/src/context/project-catalog.d.ts +12 -0
- package/dist-package/packages/runtime/src/context/revision.d.ts +2 -0
- package/dist-package/packages/runtime/src/domain/capabilities.d.ts +170 -0
- package/dist-package/packages/runtime/src/domain/context.d.ts +179 -0
- package/dist-package/packages/runtime/src/domain/diff.d.ts +104 -0
- package/dist-package/packages/runtime/src/domain/duration.d.ts +63 -0
- package/dist-package/packages/runtime/src/domain/editing.d.ts +227 -0
- package/dist-package/packages/runtime/src/domain/incremental-sync.d.ts +67 -0
- package/dist-package/packages/runtime/src/domain/index.d.ts +14 -0
- package/dist-package/packages/runtime/src/domain/media.d.ts +406 -0
- package/dist-package/packages/runtime/src/domain/ports.d.ts +62 -0
- package/dist-package/packages/runtime/src/domain/primitives.d.ts +21 -0
- package/dist-package/packages/runtime/src/domain/project.d.ts +119 -0
- package/dist-package/packages/runtime/src/domain/rough-cut.d.ts +27 -0
- package/dist-package/packages/runtime/src/domain/skills.d.ts +145 -0
- package/dist-package/packages/runtime/src/domain/timeline-target.d.ts +57 -0
- package/dist-package/packages/runtime/src/domain/timeline-target.js +19 -1
- package/dist-package/packages/runtime/src/domain/types.d.ts +5 -0
- package/dist-package/packages/runtime/src/domain/verification.d.ts +92 -0
- package/dist-package/packages/runtime/src/editing/dialogue-normalization-service.d.ts +18 -0
- package/dist-package/packages/runtime/src/editing/duration-policy.d.ts +3 -0
- package/dist-package/packages/runtime/src/editing/edit-service.d.ts +44 -0
- package/dist-package/packages/runtime/src/editing/edit-service.js +76 -10
- package/dist-package/packages/runtime/src/editing/filler-removal-service.d.ts +23 -0
- package/dist-package/packages/runtime/src/editing/intent.d.ts +97 -0
- package/dist-package/packages/runtime/src/editing/music-service.d.ts +9 -0
- package/dist-package/packages/runtime/src/index.d.ts +32 -0
- package/dist-package/packages/runtime/src/index.js +2 -0
- package/dist-package/packages/runtime/src/planning/rough-cut.d.ts +3 -0
- package/dist-package/packages/runtime/src/render/render-and-verify.d.ts +71 -0
- package/dist-package/packages/runtime/src/render/render-contract.d.ts +96 -0
- package/dist-package/packages/runtime/src/runtime.d.ts +85 -0
- package/dist-package/packages/runtime/src/runtime.js +16 -7
- package/dist-package/packages/runtime/src/skills/builtin.d.ts +2 -0
- package/dist-package/packages/runtime/src/skills/index.d.ts +3 -0
- package/dist-package/packages/runtime/src/skills/registry.d.ts +10 -0
- package/dist-package/packages/runtime/src/skills/requirements.d.ts +38 -0
- package/dist-package/packages/runtime/src/skills/runtime.d.ts +38 -0
- package/dist-package/packages/runtime/src/speech/analysis.d.ts +18 -0
- package/dist-package/packages/runtime/src/speech/analysis.js +67 -0
- package/dist-package/packages/runtime/src/speech/filler-detector.d.ts +49 -0
- package/dist-package/packages/runtime/src/speech/filler-removal.d.ts +37 -0
- package/dist-package/packages/runtime/src/speech/mapping.d.ts +56 -0
- package/dist-package/packages/runtime/src/speech/mapping.js +27 -4
- package/dist-package/packages/runtime/src/speech/safe-cut-resolver.d.ts +52 -0
- package/dist-package/packages/runtime/src/timeline/drift-reconciliation.d.ts +42 -0
- package/dist-package/packages/runtime/src/timeline/editing-session.d.ts +271 -0
- package/dist-package/packages/runtime/src/timeline/editing-session.js +48 -2
- package/dist-package/packages/runtime/src/timeline/fast-observation.d.ts +77 -0
- package/dist-package/packages/runtime/src/timeline/rational-time.d.ts +11 -0
- package/dist-package/packages/runtime/src/timeline/reorder-preview.d.ts +32 -0
- package/dist-package/packages/runtime/src/timeline/reorder-preview.js +202 -0
- package/dist-package/packages/runtime/src/timeline/snapshot-diff.d.ts +3 -0
- package/dist-package/packages/runtime/src/timeline/snapshot-diff.js +1 -0
- package/dist-package/packages/runtime/src/timeline/snapshot-digest.d.ts +3 -0
- package/dist-package/packages/runtime/src/timeline/snapshot-digest.js +1 -1
- package/dist-package/packages/runtime/src/verification/verification.d.ts +6 -0
- package/dist-package/packages/testkit/src/fixture-analyzers.d.ts +37 -0
- package/dist-package/packages/testkit/src/in-memory-editor.d.ts +55 -0
- package/dist-package/packages/testkit/src/in-memory-editor.js +3 -3
- package/dist-package/packages/testkit/src/index.d.ts +4 -0
- package/dist-package/packages/testkit/src/index.js +1 -0
- package/dist-package/packages/testkit/src/sender-lifecycle-fixture.d.ts +47 -0
- package/dist-package/packages/testkit/src/sender-lifecycle-fixture.js +192 -0
- package/dist-package/packages/testkit/src/skill-fixtures.d.ts +3 -0
- package/package.json +41 -14
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type FinalCutSchemaFingerprint, type FinalCutShadowRecipe } from "./sqlite-experiment.js";
|
|
2
|
+
export interface FinalCutShadowBundle {
|
|
3
|
+
sourceBundlePath: string;
|
|
4
|
+
shadowBundlePath: string;
|
|
5
|
+
sourceDigest: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FinalCutShadowBundleMutatorOptions {
|
|
8
|
+
shadowRoot: string;
|
|
9
|
+
sqliteCommand?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RenameFinalCutShadowCollectionRequest {
|
|
12
|
+
shadow: FinalCutShadowBundle;
|
|
13
|
+
databaseRelativePath: string;
|
|
14
|
+
collectionPrimaryKey: number;
|
|
15
|
+
expectedOptimisticVersion: number;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FinalCutShadowMutationResult {
|
|
19
|
+
databasePath: string;
|
|
20
|
+
backupPath: string;
|
|
21
|
+
beforeDigest: string;
|
|
22
|
+
afterDigest: string;
|
|
23
|
+
integrity: "ok";
|
|
24
|
+
}
|
|
25
|
+
export interface ExecuteFinalCutShadowRecipeRequest {
|
|
26
|
+
shadow: FinalCutShadowBundle;
|
|
27
|
+
databaseRelativePath: string;
|
|
28
|
+
expectedFingerprint: FinalCutSchemaFingerprint;
|
|
29
|
+
recipe: FinalCutShadowRecipe;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Experimental writer for disposable shadow copies only. It intentionally has
|
|
33
|
+
* no API for timeline payloads, metadata BLOBs, or arbitrary SQL.
|
|
34
|
+
*/
|
|
35
|
+
export declare class FinalCutShadowBundleMutator {
|
|
36
|
+
private readonly options;
|
|
37
|
+
private readonly sqliteCommand;
|
|
38
|
+
constructor(options: FinalCutShadowBundleMutatorOptions);
|
|
39
|
+
createShadow(sourceBundlePath: string): Promise<FinalCutShadowBundle>;
|
|
40
|
+
renameCollection(request: RenameFinalCutShadowCollectionRequest): Promise<FinalCutShadowMutationResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Executes the sole compiler-produced recipe after proving the exact Core
|
|
43
|
+
* Data schema/model cache. This is deliberately not an arbitrary-SQL API.
|
|
44
|
+
*/
|
|
45
|
+
executeRecipe(request: ExecuteFinalCutShadowRecipeRequest): Promise<FinalCutShadowMutationResult>;
|
|
46
|
+
/** Read-only exact schema/model fingerprint for a recipe/corpus compatibility gate. */
|
|
47
|
+
fingerprintSchema(shadow: FinalCutShadowBundle, databaseRelativePath: string): Promise<FinalCutSchemaFingerprint>;
|
|
48
|
+
private resolveShadowDatabase;
|
|
49
|
+
private assertRenameSchema;
|
|
50
|
+
private run;
|
|
51
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Experimental evidence contracts for Final Cut's undocumented Core Data
|
|
3
|
+
* stores. These contracts intentionally compile only the already-proven
|
|
4
|
+
* shadow control recipe; they never claim a versioned project is writable.
|
|
5
|
+
*/
|
|
6
|
+
export interface FinalCutSchemaFingerprintInput {
|
|
7
|
+
schemaVersion: number;
|
|
8
|
+
tables: ReadonlyArray<{
|
|
9
|
+
name: string;
|
|
10
|
+
sql: string;
|
|
11
|
+
}>;
|
|
12
|
+
modelCache: Uint8Array;
|
|
13
|
+
}
|
|
14
|
+
export interface FinalCutSchemaFingerprint {
|
|
15
|
+
schemaVersion: number;
|
|
16
|
+
sqliteMasterDigest: string;
|
|
17
|
+
modelCacheDigest: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function buildFinalCutSchemaFingerprint(input: FinalCutSchemaFingerprintInput): FinalCutSchemaFingerprint;
|
|
20
|
+
export declare function assertFinalCutSchemaFingerprint(expected: FinalCutSchemaFingerprint, actual: FinalCutSchemaFingerprint): void;
|
|
21
|
+
export interface FinalCutArchiveReference {
|
|
22
|
+
fromObject: number;
|
|
23
|
+
path: string;
|
|
24
|
+
toObject: number;
|
|
25
|
+
}
|
|
26
|
+
export interface ParsedFinalCutKeyedArchive {
|
|
27
|
+
archiver: "NSKeyedArchiver";
|
|
28
|
+
version: number;
|
|
29
|
+
top: unknown;
|
|
30
|
+
objects: unknown[];
|
|
31
|
+
references: FinalCutArchiveReference[];
|
|
32
|
+
}
|
|
33
|
+
export type FinalCutKeyedArchiveJsonDecoder = (payload: Uint8Array) => Promise<unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* Decodes a `bplist00` metadata BLOB through macOS `plutil`. The resulting
|
|
36
|
+
* archive remains evidence only: callers must not re-encode it for mutation.
|
|
37
|
+
*/
|
|
38
|
+
export declare function decodeFinalCutKeyedArchive(payload: Uint8Array, decoder?: FinalCutKeyedArchiveJsonDecoder): Promise<ParsedFinalCutKeyedArchive>;
|
|
39
|
+
/** Parse JSON emitted by `plutil -convert json` for an NSKeyedArchiver blob. */
|
|
40
|
+
export declare function parseFinalCutKeyedArchive(value: unknown): ParsedFinalCutKeyedArchive;
|
|
41
|
+
/**
|
|
42
|
+
* Candidate archive encoder for the Phase 5 proof gate. It preserves the
|
|
43
|
+
* decoded `$top`/`$objects` UID graph, but callers must still prove exact bytes
|
|
44
|
+
* against a Final Cut-authored archive before using it for mutation.
|
|
45
|
+
*/
|
|
46
|
+
export declare function encodeFinalCutKeyedArchiveWithPythonPlistlib(archive: ParsedFinalCutKeyedArchive): Promise<Uint8Array>;
|
|
47
|
+
export interface FinalCutGroundTruthCollection {
|
|
48
|
+
primaryKey: number;
|
|
49
|
+
type: string;
|
|
50
|
+
optimisticVersion: number;
|
|
51
|
+
name?: string;
|
|
52
|
+
identifier?: string;
|
|
53
|
+
metadataId?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface FinalCutGroundTruthMetadata {
|
|
56
|
+
primaryKey: number;
|
|
57
|
+
collectionPrimaryKey?: number;
|
|
58
|
+
optimisticVersion: number;
|
|
59
|
+
archive: unknown;
|
|
60
|
+
/** SHA-256 of the exact ZDICTIONARYDATA bytes collected before decoding. */
|
|
61
|
+
archiveDigest?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface FinalCutGroundTruthRelationship {
|
|
64
|
+
parentPrimaryKey: number;
|
|
65
|
+
childPrimaryKey: number;
|
|
66
|
+
}
|
|
67
|
+
export interface FinalCutGroundTruthSnapshot {
|
|
68
|
+
fingerprint: FinalCutSchemaFingerprint;
|
|
69
|
+
collections: FinalCutGroundTruthCollection[];
|
|
70
|
+
metadata: FinalCutGroundTruthMetadata[];
|
|
71
|
+
relationships: FinalCutGroundTruthRelationship[];
|
|
72
|
+
}
|
|
73
|
+
export type FinalCutGroundTruthOperation = "project-create" | "project-rename" | "clip-rename" | "marker-add" | "trim";
|
|
74
|
+
export interface FinalCutGroundTruthCapture {
|
|
75
|
+
id: string;
|
|
76
|
+
operation: FinalCutGroundTruthOperation;
|
|
77
|
+
before: FinalCutGroundTruthSnapshot;
|
|
78
|
+
after: FinalCutGroundTruthSnapshot;
|
|
79
|
+
nativeEvidence: "unverified" | "reopen-readback";
|
|
80
|
+
}
|
|
81
|
+
export interface FinalCutGroundTruthCorpus {
|
|
82
|
+
schemaVersion: 1;
|
|
83
|
+
fingerprint: FinalCutSchemaFingerprint;
|
|
84
|
+
captures: FinalCutGroundTruthCapture[];
|
|
85
|
+
}
|
|
86
|
+
export interface FinalCutGroundTruthCollectorOptions {
|
|
87
|
+
sqliteCommand?: string;
|
|
88
|
+
executor?: (databasePath: string, query: string) => Promise<string>;
|
|
89
|
+
archiveDecoder?: FinalCutKeyedArchiveJsonDecoder;
|
|
90
|
+
}
|
|
91
|
+
export interface FinalCutGroundTruthPairOptions {
|
|
92
|
+
id: string;
|
|
93
|
+
operation: FinalCutGroundTruthOperation;
|
|
94
|
+
beforeDatabasePath: string;
|
|
95
|
+
afterDatabasePath: string;
|
|
96
|
+
nativeEvidence?: FinalCutGroundTruthCapture["nativeEvidence"];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Reads a UI-produced before/after event database without changing it. The
|
|
100
|
+
* query deliberately assumes the observed Final Cut Core Data tables; a
|
|
101
|
+
* missing column/table is an unsupported schema, not a partial capture.
|
|
102
|
+
*/
|
|
103
|
+
export declare class FinalCutGroundTruthCollector {
|
|
104
|
+
private readonly executor;
|
|
105
|
+
private readonly archiveDecoder;
|
|
106
|
+
constructor(options?: FinalCutGroundTruthCollectorOptions);
|
|
107
|
+
collect(databasePath: string): Promise<FinalCutGroundTruthSnapshot>;
|
|
108
|
+
collectPair(options: FinalCutGroundTruthPairOptions): Promise<FinalCutGroundTruthCapture>;
|
|
109
|
+
}
|
|
110
|
+
/** The only collector SQL: it starts query_only and emits no arbitrary BLOB text. */
|
|
111
|
+
export declare function buildFinalCutGroundTruthSnapshotQuery(): string;
|
|
112
|
+
/** Converts the collector's JSON into a fully decoded, evidence-only snapshot. */
|
|
113
|
+
export declare function parseFinalCutGroundTruthSnapshotResponse(input: string | unknown, decoder?: FinalCutKeyedArchiveJsonDecoder): Promise<FinalCutGroundTruthSnapshot>;
|
|
114
|
+
/** Packages one externally performed UI operation for persistence in a corpus. */
|
|
115
|
+
export declare function createFinalCutGroundTruthCapture(id: string, operation: FinalCutGroundTruthOperation, before: FinalCutGroundTruthSnapshot, after: FinalCutGroundTruthSnapshot, nativeEvidence?: FinalCutGroundTruthCapture["nativeEvidence"]): FinalCutGroundTruthCapture;
|
|
116
|
+
/** Persist corpus evidence without overwriting a prior capture set. */
|
|
117
|
+
export declare function writeFinalCutGroundTruthCorpus(path: string, corpus: FinalCutGroundTruthCorpus): Promise<void>;
|
|
118
|
+
/** Load and validate a corpus against the fixed schema fingerprint. */
|
|
119
|
+
export declare function readFinalCutGroundTruthCorpus(path: string, fingerprint: FinalCutSchemaFingerprint): Promise<FinalCutGroundTruthCorpus>;
|
|
120
|
+
export interface FinalCutGroundTruthDiff {
|
|
121
|
+
collectionChanges: Array<{
|
|
122
|
+
primaryKey: number;
|
|
123
|
+
type: string;
|
|
124
|
+
changed: string[];
|
|
125
|
+
}>;
|
|
126
|
+
relationshipChanges: {
|
|
127
|
+
added: FinalCutGroundTruthRelationship[];
|
|
128
|
+
removed: FinalCutGroundTruthRelationship[];
|
|
129
|
+
};
|
|
130
|
+
archiveChanges: Array<{
|
|
131
|
+
metadataPrimaryKey: number;
|
|
132
|
+
changed: string[];
|
|
133
|
+
}>;
|
|
134
|
+
}
|
|
135
|
+
export declare function diffFinalCutGroundTruthSnapshots(before: FinalCutGroundTruthSnapshot, after: FinalCutGroundTruthSnapshot): FinalCutGroundTruthDiff;
|
|
136
|
+
export declare function validateFinalCutGroundTruthCorpus(corpus: FinalCutGroundTruthCorpus, fingerprint: FinalCutSchemaFingerprint): void;
|
|
137
|
+
export type FinalCutShadowRecipeRequest = {
|
|
138
|
+
kind: "collection-rename-control";
|
|
139
|
+
captureId: string;
|
|
140
|
+
collectionPrimaryKey: number;
|
|
141
|
+
expectedOptimisticVersion: number;
|
|
142
|
+
name: string;
|
|
143
|
+
} | {
|
|
144
|
+
kind: "versioned-project-materialization";
|
|
145
|
+
captureId: string;
|
|
146
|
+
projectName: string;
|
|
147
|
+
sequenceName: string;
|
|
148
|
+
};
|
|
149
|
+
export type FinalCutShadowRecipe = Omit<Extract<FinalCutShadowRecipeRequest, {
|
|
150
|
+
kind: "collection-rename-control";
|
|
151
|
+
}>, "captureId">;
|
|
152
|
+
/**
|
|
153
|
+
* Produces only an allowlisted, observed control recipe. A versioned project
|
|
154
|
+
* requires a reopen-proven archive encoder and is deliberately rejected.
|
|
155
|
+
*/
|
|
156
|
+
export declare function compileFinalCutShadowRecipe(corpus: FinalCutGroundTruthCorpus, fingerprint: FinalCutSchemaFingerprint, request: FinalCutShadowRecipeRequest): FinalCutShadowRecipe;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ContextRevision } from "../../../../packages/runtime/src/index.js";
|
|
2
|
+
export declare const FINAL_CUT_SQLITE_INSPECTION_BACKEND: "final-cut-sqlite-read-only";
|
|
3
|
+
export declare const FINAL_CUT_SQLITE_INSPECTION_TIMEOUT_MS = 30000;
|
|
4
|
+
export type FinalCutSqliteDatabaseKind = "flexolibrary" | "fcpevent" | "unknown";
|
|
5
|
+
export type FinalCutSqliteCoverage = "exact" | "partial" | "unknown";
|
|
6
|
+
export type FinalCutSqliteInspectionIssueCode = "FINAL_CUT_SQLITE_FIELD_UNAVAILABLE" | "FINAL_CUT_SQLITE_INSPECTION_UNAVAILABLE" | "FINAL_CUT_SQLITE_OPAQUE_PAYLOAD" | "FINAL_CUT_SQLITE_RESPONSE_INVALID" | "FINAL_CUT_SQLITE_REVISION_UNAVAILABLE";
|
|
7
|
+
export interface FinalCutSqliteInspectionIssue {
|
|
8
|
+
code: FinalCutSqliteInspectionIssueCode;
|
|
9
|
+
message: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
retryable: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface FinalCutSqliteTableColumn {
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
primaryKey: number;
|
|
17
|
+
}
|
|
18
|
+
export interface FinalCutSqliteTable {
|
|
19
|
+
name: string;
|
|
20
|
+
sql: string;
|
|
21
|
+
columns: FinalCutSqliteTableColumn[];
|
|
22
|
+
rowCount?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface FinalCutSqliteCollectionTypeCount {
|
|
25
|
+
type: string;
|
|
26
|
+
count: number;
|
|
27
|
+
}
|
|
28
|
+
export interface FinalCutSqliteCollectionRow {
|
|
29
|
+
primaryKey: number;
|
|
30
|
+
type: string;
|
|
31
|
+
identifier?: string;
|
|
32
|
+
optimisticVersion?: number;
|
|
33
|
+
catalogId?: number;
|
|
34
|
+
metadataId?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface FinalCutSqliteMetadataRow {
|
|
37
|
+
primaryKey: number;
|
|
38
|
+
collectionId?: number;
|
|
39
|
+
identifier?: string;
|
|
40
|
+
bytes: number;
|
|
41
|
+
archive?: string;
|
|
42
|
+
}
|
|
43
|
+
/** JSON emitted by the read-only sqlite3 query. It intentionally excludes BLOB contents. */
|
|
44
|
+
export interface FinalCutSqliteInspectionPayload {
|
|
45
|
+
version: 1;
|
|
46
|
+
schemaVersion: number;
|
|
47
|
+
userVersion: number;
|
|
48
|
+
tables: FinalCutSqliteTable[];
|
|
49
|
+
rowCounts: Record<string, number>;
|
|
50
|
+
collectionTypes: FinalCutSqliteCollectionTypeCount[];
|
|
51
|
+
collectionRows: FinalCutSqliteCollectionRow[];
|
|
52
|
+
metadataRows: FinalCutSqliteMetadataRow[];
|
|
53
|
+
}
|
|
54
|
+
export interface FinalCutSqliteCoverageReport {
|
|
55
|
+
complete: false;
|
|
56
|
+
projectIdentity: FinalCutSqliteCoverage;
|
|
57
|
+
sequenceIdentity: FinalCutSqliteCoverage;
|
|
58
|
+
clipOccurrences: FinalCutSqliteCoverage;
|
|
59
|
+
mediaIdentity: FinalCutSqliteCoverage;
|
|
60
|
+
rationalTiming: FinalCutSqliteCoverage;
|
|
61
|
+
roles: FinalCutSqliteCoverage;
|
|
62
|
+
storylineRelationships: FinalCutSqliteCoverage;
|
|
63
|
+
markersCaptions: FinalCutSqliteCoverage;
|
|
64
|
+
revision: FinalCutSqliteCoverage;
|
|
65
|
+
}
|
|
66
|
+
/** A source-bound storage observation, never a canonical ProjectSnapshot. */
|
|
67
|
+
export interface FinalCutSqliteObservation extends FinalCutSqliteInspectionPayload {
|
|
68
|
+
backend: typeof FINAL_CUT_SQLITE_INSPECTION_BACKEND;
|
|
69
|
+
sourcePath: string;
|
|
70
|
+
databaseKind: FinalCutSqliteDatabaseKind;
|
|
71
|
+
digest: string;
|
|
72
|
+
revision: ContextRevision;
|
|
73
|
+
canonical: false;
|
|
74
|
+
coverage: FinalCutSqliteCoverageReport;
|
|
75
|
+
}
|
|
76
|
+
export type FinalCutSqliteInspectionResult = {
|
|
77
|
+
status: "partial";
|
|
78
|
+
observation: FinalCutSqliteObservation;
|
|
79
|
+
issues: FinalCutSqliteInspectionIssue[];
|
|
80
|
+
} | {
|
|
81
|
+
status: "unavailable" | "error";
|
|
82
|
+
error: FinalCutSqliteInspectionError;
|
|
83
|
+
};
|
|
84
|
+
export interface FinalCutSqliteInspectionError {
|
|
85
|
+
code: FinalCutSqliteInspectionIssueCode;
|
|
86
|
+
message: string;
|
|
87
|
+
retryable: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface FinalCutSqliteInspectionProviderOptions {
|
|
90
|
+
sqliteCommand?: string;
|
|
91
|
+
executor?: (databasePath: string, query: string, timeoutMs: number) => Promise<string>;
|
|
92
|
+
digest?: (databasePath: string) => Promise<string>;
|
|
93
|
+
timestamp?: () => string;
|
|
94
|
+
}
|
|
95
|
+
export declare class FinalCutSqliteInspectionProviderError extends Error {
|
|
96
|
+
readonly failure: FinalCutSqliteInspectionError;
|
|
97
|
+
readonly code: FinalCutSqliteInspectionIssueCode;
|
|
98
|
+
readonly retryable: boolean;
|
|
99
|
+
constructor(failure: FinalCutSqliteInspectionError);
|
|
100
|
+
toJSON(): FinalCutSqliteInspectionError;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Read-only inspection of Final Cut's Core Data SQLite stores.
|
|
104
|
+
*
|
|
105
|
+
* The provider intentionally returns an observation rather than ProjectSnapshot:
|
|
106
|
+
* the current schema exposes useful object/type/version hints, while the
|
|
107
|
+
* timeline payload lives in undocumented archived BLOBs.
|
|
108
|
+
*/
|
|
109
|
+
export declare class FinalCutSqliteInspectionProvider {
|
|
110
|
+
readonly backend: "final-cut-sqlite-read-only";
|
|
111
|
+
private readonly executor;
|
|
112
|
+
private readonly digest;
|
|
113
|
+
private readonly timestamp;
|
|
114
|
+
constructor(options?: FinalCutSqliteInspectionProviderOptions);
|
|
115
|
+
inspect(databasePath: string): Promise<FinalCutSqliteInspectionResult>;
|
|
116
|
+
readObservation(databasePath: string): Promise<FinalCutSqliteObservation>;
|
|
117
|
+
}
|
|
118
|
+
/** Build the only SQL sent to a Final Cut store; it is schema/data read-only. */
|
|
119
|
+
export declare function buildFinalCutSqliteInspectionQuery(): string;
|
|
120
|
+
export declare function parseFinalCutSqliteInspectionResponse(input: string | unknown): {
|
|
121
|
+
status: "partial";
|
|
122
|
+
payload: FinalCutSqliteInspectionPayload;
|
|
123
|
+
issues: FinalCutSqliteInspectionIssue[];
|
|
124
|
+
} | {
|
|
125
|
+
status: "error";
|
|
126
|
+
error: FinalCutSqliteInspectionError;
|
|
127
|
+
};
|
|
128
|
+
export interface FinalCutSqliteObservationComparison {
|
|
129
|
+
status: "unchanged" | "changed";
|
|
130
|
+
previousDigest: string;
|
|
131
|
+
currentDigest: string;
|
|
132
|
+
reasons: string[];
|
|
133
|
+
}
|
|
134
|
+
export declare function compareFinalCutSqliteObservations(previous: FinalCutSqliteObservation, current: FinalCutSqliteObservation): FinalCutSqliteObservationComparison;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { TimelineIr } from "../../../../packages/runtime/src/index.js";
|
|
2
|
+
import { type FinalCutKeyedArchiveJsonDecoder, type FinalCutSchemaFingerprint } from "./sqlite-experiment.js";
|
|
3
|
+
/** An encoder is supplied only after it has been proven against Final Cut output. */
|
|
4
|
+
export type FinalCutKeyedArchiveEncoder = (archive: unknown) => Promise<Uint8Array>;
|
|
5
|
+
export interface FinalCutArchiveRoundTripProof {
|
|
6
|
+
originalDigest: string;
|
|
7
|
+
encodedDigest: string;
|
|
8
|
+
byteIdentical: true;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Phase 5 gate. This never invents an NSKeyedArchiver encoder: the caller must
|
|
12
|
+
* provide one and the bytes must be exactly identical for this proof to pass.
|
|
13
|
+
*/
|
|
14
|
+
export declare function proveFinalCutArchiveByteRoundTrip(payload: Uint8Array, decoder: FinalCutKeyedArchiveJsonDecoder, encoder: FinalCutKeyedArchiveEncoder): Promise<FinalCutArchiveRoundTripProof>;
|
|
15
|
+
export interface FinalCutGraphAllocationEvidence {
|
|
16
|
+
existingCollectionPrimaryKeys: number[];
|
|
17
|
+
existingMetadataPrimaryKeys: number[];
|
|
18
|
+
existingCatalogPrimaryKeys: number[];
|
|
19
|
+
existingIdentifiers: string[];
|
|
20
|
+
primaryKeyMaxByEntity: Record<string, {
|
|
21
|
+
entity: number;
|
|
22
|
+
max: number;
|
|
23
|
+
}>;
|
|
24
|
+
catalogEntity: number;
|
|
25
|
+
metadataEntity: number;
|
|
26
|
+
}
|
|
27
|
+
export interface FinalCutVersionedGraphNode {
|
|
28
|
+
logicalId: string;
|
|
29
|
+
kind: "project" | "sequence" | "resource" | "occurrence" | "story-element" | "marker" | "caption";
|
|
30
|
+
entity: number;
|
|
31
|
+
primaryKey: number;
|
|
32
|
+
optimisticVersion: 1;
|
|
33
|
+
identifier: string;
|
|
34
|
+
name: string;
|
|
35
|
+
catalogPrimaryKey: number;
|
|
36
|
+
catalogIdentifier: string;
|
|
37
|
+
metadataPrimaryKey: number;
|
|
38
|
+
metadataIdentifier: string;
|
|
39
|
+
archive: Uint8Array;
|
|
40
|
+
}
|
|
41
|
+
export interface FinalCutVersionedGraphEdge {
|
|
42
|
+
parentPrimaryKey: number;
|
|
43
|
+
childPrimaryKey: number;
|
|
44
|
+
}
|
|
45
|
+
export interface FinalCutVersionedGraphPrimaryKeyUpdate {
|
|
46
|
+
entity: number;
|
|
47
|
+
expectedMax: number;
|
|
48
|
+
nextMax: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A typed, insert-only graph recipe. It contains no caller-provided SQL. The
|
|
52
|
+
* shadow executor turns this shape into the small allowlisted transaction.
|
|
53
|
+
*/
|
|
54
|
+
export interface FinalCutVersionedGraphRecipe {
|
|
55
|
+
kind: "versioned-project-materialization";
|
|
56
|
+
fingerprint: FinalCutSchemaFingerprint;
|
|
57
|
+
timelineDigest: string;
|
|
58
|
+
projectUid: string;
|
|
59
|
+
sequenceUid: string;
|
|
60
|
+
nodes: FinalCutVersionedGraphNode[];
|
|
61
|
+
edges: FinalCutVersionedGraphEdge[];
|
|
62
|
+
primaryKeyUpdates: FinalCutVersionedGraphPrimaryKeyUpdate[];
|
|
63
|
+
catalogEntity: number;
|
|
64
|
+
metadataEntity: number;
|
|
65
|
+
}
|
|
66
|
+
export interface CompileFinalCutVersionedGraphRequest {
|
|
67
|
+
timeline: TimelineIr;
|
|
68
|
+
fingerprint: FinalCutSchemaFingerprint;
|
|
69
|
+
existing: FinalCutGraphAllocationEvidence;
|
|
70
|
+
projectUid: string;
|
|
71
|
+
sequenceUid: string;
|
|
72
|
+
archiveEncoder: (node: {
|
|
73
|
+
logicalId: string;
|
|
74
|
+
kind: FinalCutVersionedGraphNode["kind"];
|
|
75
|
+
name: string;
|
|
76
|
+
}) => Promise<Uint8Array>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Phase 6 compiler. IDs are allocated from observed maxima and identifiers are
|
|
80
|
+
* deterministic, content-bound, and collision checked. Existing names are not
|
|
81
|
+
* update targets; every node is an insert into a new versioned graph.
|
|
82
|
+
*/
|
|
83
|
+
export declare function compileFinalCutVersionedGraphRecipe(request: CompileFinalCutVersionedGraphRequest): Promise<FinalCutVersionedGraphRecipe>;
|
|
84
|
+
/** Build the only SQL accepted for a versioned graph recipe. */
|
|
85
|
+
export declare function buildFinalCutVersionedGraphSql(recipe: FinalCutVersionedGraphRecipe): {
|
|
86
|
+
sql: string;
|
|
87
|
+
expectedCasUpdates: number;
|
|
88
|
+
};
|
|
89
|
+
export interface FinalCutNativeVerificationTarget {
|
|
90
|
+
projectUid: string;
|
|
91
|
+
sequenceUid: string;
|
|
92
|
+
}
|
|
93
|
+
export interface FinalCutNativeVerificationReadback {
|
|
94
|
+
target: FinalCutNativeVerificationTarget;
|
|
95
|
+
timeline: TimelineIr;
|
|
96
|
+
}
|
|
97
|
+
export type FinalCutNativeVerificationResult = {
|
|
98
|
+
status: "native_completed";
|
|
99
|
+
target: FinalCutNativeVerificationTarget;
|
|
100
|
+
desiredDigest: string;
|
|
101
|
+
readbackDigest: string;
|
|
102
|
+
} | {
|
|
103
|
+
status: "not_completed";
|
|
104
|
+
reason: string;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Phase 8 gate. Reopen and export are injected headed operations; a digest or
|
|
108
|
+
* target mismatch can never be reported as native completion.
|
|
109
|
+
*/
|
|
110
|
+
export declare function verifyFinalCutNativeReopen(target: FinalCutNativeVerificationTarget, desired: TimelineIr, reopen: () => Promise<void>, exportTarget: (target: FinalCutNativeVerificationTarget) => Promise<FinalCutNativeVerificationReadback>): Promise<FinalCutNativeVerificationResult>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { ContextRevision } from "../../../../packages/runtime/src/index.js";
|
|
2
|
+
import { type FastTimelineObservation } from "../../../../packages/runtime/src/index.js";
|
|
3
|
+
import { FinalCutSqliteInspectionProvider, type FinalCutSqliteCollectionRow, type FinalCutSqliteMetadataRow, type FinalCutSqliteObservation } from "./sqlite-inspection.js";
|
|
4
|
+
export declare const FINAL_CUT_SQLITE_WAL_BACKEND: "final-cut-sqlite-wal-read-only";
|
|
5
|
+
export declare const FINAL_CUT_SQLITE_WAL_SCHEMA_VERSION: 1;
|
|
6
|
+
export interface FinalCutSqliteObservationTarget {
|
|
7
|
+
projectId: string;
|
|
8
|
+
sequenceId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FinalCutSqliteMaterializationProvenance {
|
|
11
|
+
framekitRevision: ContextRevision;
|
|
12
|
+
artifactDigest: string;
|
|
13
|
+
target: FinalCutSqliteObservationTarget;
|
|
14
|
+
}
|
|
15
|
+
export interface FinalCutSqliteStorageFingerprint {
|
|
16
|
+
path: string;
|
|
17
|
+
present: boolean;
|
|
18
|
+
bytes?: number;
|
|
19
|
+
digest?: string;
|
|
20
|
+
modifiedAt?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface FinalCutSqliteWalObservation {
|
|
23
|
+
schemaVersion: typeof FINAL_CUT_SQLITE_WAL_SCHEMA_VERSION;
|
|
24
|
+
backend: typeof FINAL_CUT_SQLITE_WAL_BACKEND;
|
|
25
|
+
canonical: false;
|
|
26
|
+
target: FinalCutSqliteObservationTarget;
|
|
27
|
+
provenance: FinalCutSqliteMaterializationProvenance;
|
|
28
|
+
finalCutVersion: string;
|
|
29
|
+
database: FinalCutSqliteObservation;
|
|
30
|
+
storage: {
|
|
31
|
+
database: FinalCutSqliteStorageFingerprint;
|
|
32
|
+
wal: FinalCutSqliteStorageFingerprint;
|
|
33
|
+
shm: FinalCutSqliteStorageFingerprint;
|
|
34
|
+
capturedAt: string;
|
|
35
|
+
freshness: "storage-observed";
|
|
36
|
+
};
|
|
37
|
+
coverage: {
|
|
38
|
+
storage: "observed";
|
|
39
|
+
structuralRows: "partial";
|
|
40
|
+
archivedPayloads: "opaque";
|
|
41
|
+
semanticOperation: "not-observable";
|
|
42
|
+
editorFreshness: "unknown";
|
|
43
|
+
canonicalTimeline: "unavailable";
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export type FinalCutSqliteWalObservationResult = {
|
|
47
|
+
status: "observed";
|
|
48
|
+
observation: FinalCutSqliteWalObservation;
|
|
49
|
+
issues: string[];
|
|
50
|
+
} | {
|
|
51
|
+
status: "unavailable" | "error";
|
|
52
|
+
error: {
|
|
53
|
+
code: string;
|
|
54
|
+
message: string;
|
|
55
|
+
retryable: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export interface FinalCutSqliteWalObservationProviderOptions {
|
|
59
|
+
inspectionProvider?: Pick<FinalCutSqliteInspectionProvider, "inspect">;
|
|
60
|
+
readFile?: (path: string) => Promise<Uint8Array>;
|
|
61
|
+
statFile?: (path: string) => Promise<{
|
|
62
|
+
size: number;
|
|
63
|
+
mtimeMs: number;
|
|
64
|
+
}>;
|
|
65
|
+
timestamp?: () => string;
|
|
66
|
+
}
|
|
67
|
+
export interface FinalCutSqliteWalCaptureRequest {
|
|
68
|
+
databasePath: string;
|
|
69
|
+
walPath?: string;
|
|
70
|
+
shmPath?: string;
|
|
71
|
+
target: FinalCutSqliteObservationTarget;
|
|
72
|
+
provenance: FinalCutSqliteMaterializationProvenance;
|
|
73
|
+
finalCutVersion: string;
|
|
74
|
+
}
|
|
75
|
+
/** Read-only DB/WAL/SHM observation. This provider never opens a writable SQLite handle. */
|
|
76
|
+
export declare class FinalCutSqliteWalObservationProvider {
|
|
77
|
+
private readonly inspectionProvider;
|
|
78
|
+
private readonly readFile;
|
|
79
|
+
private readonly statFile;
|
|
80
|
+
private readonly timestamp;
|
|
81
|
+
constructor(options?: FinalCutSqliteWalObservationProviderOptions);
|
|
82
|
+
capture(request: FinalCutSqliteWalCaptureRequest): Promise<FinalCutSqliteWalObservationResult>;
|
|
83
|
+
private fingerprint;
|
|
84
|
+
}
|
|
85
|
+
export type FinalCutSqliteRowDelta<T> = {
|
|
86
|
+
added: T[];
|
|
87
|
+
removed: T[];
|
|
88
|
+
modified: Array<{
|
|
89
|
+
before: T;
|
|
90
|
+
after: T;
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
export type FinalCutSqliteDeltaStatus = "unchanged" | "changed" | "ambiguous";
|
|
94
|
+
export interface FinalCutSqliteWalDelta {
|
|
95
|
+
schemaVersion: typeof FINAL_CUT_SQLITE_WAL_SCHEMA_VERSION;
|
|
96
|
+
status: FinalCutSqliteDeltaStatus;
|
|
97
|
+
canonical: false;
|
|
98
|
+
target: FinalCutSqliteObservationTarget;
|
|
99
|
+
from: {
|
|
100
|
+
revision: ContextRevision;
|
|
101
|
+
storage: FinalCutSqliteWalObservation["storage"];
|
|
102
|
+
};
|
|
103
|
+
to: {
|
|
104
|
+
revision: ContextRevision;
|
|
105
|
+
storage: FinalCutSqliteWalObservation["storage"];
|
|
106
|
+
};
|
|
107
|
+
collections: FinalCutSqliteRowDelta<FinalCutSqliteCollectionRow>;
|
|
108
|
+
metadata: FinalCutSqliteRowDelta<FinalCutSqliteMetadataRow>;
|
|
109
|
+
storage: {
|
|
110
|
+
database: "unchanged" | "changed";
|
|
111
|
+
wal: "absent" | "unchanged" | "changed";
|
|
112
|
+
shm: "absent" | "unchanged" | "changed";
|
|
113
|
+
};
|
|
114
|
+
coverage: Omit<FinalCutSqliteWalObservation["coverage"], "semanticOperation"> & {
|
|
115
|
+
semanticOperation: "not-observable" | "ambiguous";
|
|
116
|
+
};
|
|
117
|
+
recommendation: "no-change-observed" | "canonical-resync-required";
|
|
118
|
+
reasons: string[];
|
|
119
|
+
}
|
|
120
|
+
export declare function diffFinalCutSqliteWalObservations(previous: FinalCutSqliteWalObservation, current: FinalCutSqliteWalObservation): FinalCutSqliteWalDelta;
|
|
121
|
+
/** Convert SQLite/WAL evidence into the provider-neutral envelope without inventing Timeline IR. */
|
|
122
|
+
export declare function normalizeFinalCutSqliteWalObservation(observation: FinalCutSqliteWalObservation): FastTimelineObservation;
|
|
123
|
+
export type FinalCutSqliteControlledOperation = "trim-start" | "trim-end" | "move" | "delete" | "reorder" | "add-existing-source" | "repeated-occurrence" | "connected-clip" | "marker" | "project-rename";
|
|
124
|
+
export type FinalCutSqliteOperationCoverage = "proven" | "partial" | "ambiguous" | "not-observable";
|
|
125
|
+
export interface FinalCutSqliteOperationCapability {
|
|
126
|
+
operation: FinalCutSqliteControlledOperation;
|
|
127
|
+
coverage: FinalCutSqliteOperationCoverage;
|
|
128
|
+
evidence: "fixture-matrix";
|
|
129
|
+
canonical: false;
|
|
130
|
+
reason: string;
|
|
131
|
+
}
|
|
132
|
+
export declare const FINAL_CUT_SQLITE_OPERATION_MATRIX: readonly FinalCutSqliteOperationCapability[];
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { TimelineIr } from "../../../../packages/runtime/src/index.js";
|
|
2
|
+
export declare const FRAMEKIT_FCPXML_VERSION: "1.11";
|
|
3
|
+
/** Stable Final Cut identities required for target-bound publication. */
|
|
4
|
+
export interface FinalCutTargetIdentity {
|
|
5
|
+
libraryUid: string;
|
|
6
|
+
eventUid: string;
|
|
7
|
+
projectUid: string;
|
|
8
|
+
sequenceUid: string;
|
|
9
|
+
}
|
|
10
|
+
/** The provider identity that owns the destination project and sequence. */
|
|
11
|
+
export interface TimelineIrToFcpxmlTarget extends FinalCutTargetIdentity {
|
|
12
|
+
provider: "final-cut";
|
|
13
|
+
eventName?: string;
|
|
14
|
+
/** Reusing an existing project is opt-in; versioned is the safe default. */
|
|
15
|
+
materialization?: "versioned" | "reuse-existing";
|
|
16
|
+
}
|
|
17
|
+
export interface TimelineIrToFcpxmlOptions {
|
|
18
|
+
target: TimelineIrToFcpxmlTarget;
|
|
19
|
+
version?: typeof FRAMEKIT_FCPXML_VERSION;
|
|
20
|
+
}
|
|
21
|
+
export interface TimelineIrMaterializationCoverage {
|
|
22
|
+
exact: string[];
|
|
23
|
+
degraded: string[];
|
|
24
|
+
unsupported: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface TimelineIrMaterializationProvenance {
|
|
27
|
+
source: "framekit-timeline-ir";
|
|
28
|
+
schemaVersion: 1;
|
|
29
|
+
projectId: string;
|
|
30
|
+
sequenceId: string;
|
|
31
|
+
revision: TimelineIr["revision"];
|
|
32
|
+
timelineDigest: string;
|
|
33
|
+
target: FinalCutTargetIdentity;
|
|
34
|
+
destination: {
|
|
35
|
+
projectUid: string;
|
|
36
|
+
sequenceUid: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface TimelineIrToFcpxmlResult {
|
|
40
|
+
format: "fcpxml";
|
|
41
|
+
version: typeof FRAMEKIT_FCPXML_VERSION;
|
|
42
|
+
xml: string;
|
|
43
|
+
digest: string;
|
|
44
|
+
target: TimelineIrToFcpxmlTarget;
|
|
45
|
+
destination: {
|
|
46
|
+
mode: "versioned" | "reuse-existing";
|
|
47
|
+
projectUid: string;
|
|
48
|
+
sequenceUid: string;
|
|
49
|
+
projectName: string;
|
|
50
|
+
sequenceName: string;
|
|
51
|
+
};
|
|
52
|
+
resourceIds: Record<string, string>;
|
|
53
|
+
coverage: TimelineIrMaterializationCoverage;
|
|
54
|
+
provenance: TimelineIrMaterializationProvenance;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Compiles a complete provider-neutral Timeline IR into a new FCPXML
|
|
58
|
+
* document. The target binding is mandatory because names are not stable
|
|
59
|
+
* enough to identify a Final Cut destination.
|
|
60
|
+
*/
|
|
61
|
+
export declare function compileTimelineIrToFcpxml(timeline: TimelineIr, options: TimelineIrToFcpxmlOptions): TimelineIrToFcpxmlResult;
|