@morshoto/framekit 0.2.2 → 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/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/canonical-recovery-guard.d.ts +32 -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 +33 -1
- package/dist-package/adapters/final-cut/typescript/src/connection.d.ts +103 -0
- package/dist-package/adapters/final-cut/typescript/src/disposable-native.d.ts +90 -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/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 +6 -1
- package/dist-package/adapters/final-cut/typescript/src/index.d.ts +22 -0
- 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 +8 -0
- 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-session.d.ts +130 -0
- package/dist-package/adapters/final-cut/typescript/src/native.d.ts +828 -0
- package/dist-package/adapters/final-cut/typescript/src/native.js +274 -107
- 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 +18 -2
- package/dist-package/adapters/final-cut/typescript/src/publisher.d.ts +215 -0
- package/dist-package/adapters/final-cut/typescript/src/session.d.ts +43 -0
- 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 +28 -4
- 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/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 +5 -0
- package/dist-package/adapters/headless/typescript/src/ffmpeg-verifier.d.ts +15 -0
- 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/headless-projects.d.ts +3 -0
- package/dist-package/apps/cli/src/main.d.ts +10 -0
- package/dist-package/apps/mcp-server/runtime/ffmpeg-audio-backend.py +129 -0
- package/dist-package/apps/mcp-server/runtime/whisper-speech-backend.py +92 -2
- 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/final-cut-runtime-config.d.ts +5 -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/materialization-jobs.d.ts +204 -0
- 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/server.d.ts +75 -0
- package/dist-package/apps/mcp-server/src/server.js +77 -7
- package/dist-package/apps/mcp-server/src/tools/skills/catalog.d.ts +19 -0
- package/dist-package/apps/mcp-server/src/tools/skills/metadata.d.ts +37 -0
- package/dist-package/apps/mcp-server/src/tools/skills/register.d.ts +11 -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/packages/headless-application/src/headless-projects.js +1 -1
- package/dist-package/packages/headless-application/src/index.d.ts +2 -0
- package/dist-package/packages/headless-application/src/index.js +1 -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-store.d.ts +56 -0
- 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/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/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-service.d.ts +20 -0
- 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/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 +1 -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/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 +32 -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/index.d.ts +4 -0
- package/dist-package/packages/testkit/src/sender-lifecycle-fixture.d.ts +47 -0
- package/dist-package/packages/testkit/src/skill-fixtures.d.ts +3 -0
- package/package.json +17 -12
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ContextRevision, RationalTime } from "./primitives.js";
|
|
2
|
+
import type { ProjectSnapshot } from "./project.js";
|
|
3
|
+
import type { EditorLiveState, EditorChange, ContextChangeSet, ProjectCatalog, ProjectSelection, ProjectSelectionResult } from "./context.js";
|
|
4
|
+
import type { CapturedFrameSource, MediaContext } from "./media.js";
|
|
5
|
+
import type { CapabilityInspectionOptions, EditorIdentity, RuntimeCapabilities } from "./capabilities.js";
|
|
6
|
+
import type { WorkflowOperation, EditOperation } from "./editing.js";
|
|
7
|
+
export interface EditorAdapter {
|
|
8
|
+
read(): Promise<ProjectSnapshot>;
|
|
9
|
+
/** Apply atomically and return the resulting revision for read-failure rollback. */
|
|
10
|
+
apply(operation: EditOperation, expectedRevision: ContextRevision): Promise<ContextRevision>;
|
|
11
|
+
}
|
|
12
|
+
export interface EditorPort extends EditorAdapter {
|
|
13
|
+
/** Share a single canonical observation only within this read operation. */
|
|
14
|
+
withCanonicalReadScope?<T>(operation: () => Promise<T>): Promise<T>;
|
|
15
|
+
getIdentity(): Promise<EditorIdentity>;
|
|
16
|
+
getCapabilities(options?: CapabilityInspectionOptions): Promise<RuntimeCapabilities>;
|
|
17
|
+
getManagedArtifact?(): Promise<ManagedArtifact>;
|
|
18
|
+
getManagedArtifactDigest?(): Promise<string | undefined>;
|
|
19
|
+
readProject(): Promise<ProjectSnapshot>;
|
|
20
|
+
restore(snapshot: ProjectSnapshot, expectedRevision: ContextRevision): Promise<void>;
|
|
21
|
+
listAssets?(query?: AssetSearchQuery): Promise<EditorAsset[]>;
|
|
22
|
+
listMedia?(query?: MediaSearchQuery): Promise<MediaContext[]>;
|
|
23
|
+
/** Optional native change feed; absence falls back to a snapshot diff. */
|
|
24
|
+
readChanges?(since: ContextRevision): Promise<ContextChangeSet>;
|
|
25
|
+
listProjects?(): Promise<ProjectCatalog>;
|
|
26
|
+
selectProject?(selection: ProjectSelection): Promise<ProjectSelectionResult>;
|
|
27
|
+
/** Capture only if the active editor target still matches the inspected revision. */
|
|
28
|
+
captureFrame?(position: RationalTime, expectedRevision: ContextRevision): Promise<CapturedFrameSource>;
|
|
29
|
+
previewTransaction?(operations: WorkflowOperation[], expectedRevision: ContextRevision): Promise<ProjectSnapshot>;
|
|
30
|
+
applyTransaction?(operations: WorkflowOperation[], expectedRevision: ContextRevision): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export interface ManagedArtifact {
|
|
33
|
+
id: string;
|
|
34
|
+
path: string;
|
|
35
|
+
format: "fcpxml";
|
|
36
|
+
digest?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface LiveEditorStatePort {
|
|
39
|
+
readLiveState(): Promise<EditorLiveState>;
|
|
40
|
+
liveChangesSince(revision: ContextRevision, waitMs?: number): Promise<EditorChange[]>;
|
|
41
|
+
}
|
|
42
|
+
export interface EditorAsset {
|
|
43
|
+
id: string;
|
|
44
|
+
kind: "transition" | "effect" | "title" | "generator" | "audio-effect" | "template";
|
|
45
|
+
name: string;
|
|
46
|
+
vendor: string;
|
|
47
|
+
metadata: Record<string, unknown>;
|
|
48
|
+
compatibility?: {
|
|
49
|
+
timelineKinds?: string[];
|
|
50
|
+
mediaKinds?: string[];
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface AssetSearchQuery {
|
|
54
|
+
query?: string;
|
|
55
|
+
kind?: EditorAsset["kind"];
|
|
56
|
+
vendor?: string;
|
|
57
|
+
discovery?: "background" | "native" | "all";
|
|
58
|
+
}
|
|
59
|
+
export interface MediaSearchQuery {
|
|
60
|
+
query?: string;
|
|
61
|
+
mediaKind?: "video" | "audio";
|
|
62
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface ContextRevision {
|
|
2
|
+
id: string;
|
|
3
|
+
sequence: number;
|
|
4
|
+
timestamp: string;
|
|
5
|
+
}
|
|
6
|
+
export interface TimeRange {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
/** Exact representation used when the range crossed an editor boundary. */
|
|
10
|
+
startTime?: RationalTime;
|
|
11
|
+
durationTime?: RationalTime;
|
|
12
|
+
}
|
|
13
|
+
export interface RationalTimeRange {
|
|
14
|
+
start: RationalTime;
|
|
15
|
+
duration: RationalTime;
|
|
16
|
+
}
|
|
17
|
+
/** Exact interchange time; strings keep it JSON-safe at the MCP boundary. */
|
|
18
|
+
export interface RationalTime {
|
|
19
|
+
value: string;
|
|
20
|
+
timescale: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import type { ContextRevision, RationalTime } from "./primitives.js";
|
|
2
|
+
import type { MediaContext } from "./media.js";
|
|
3
|
+
import type { MaskConfiguration } from "./editing.js";
|
|
4
|
+
export type ColorCorrectionPreset = "neutral" | "warm" | "cool" | "high-contrast";
|
|
5
|
+
export interface ColorCorrection {
|
|
6
|
+
exposure: number;
|
|
7
|
+
contrast: number;
|
|
8
|
+
saturation: number;
|
|
9
|
+
temperature: number;
|
|
10
|
+
tint: number;
|
|
11
|
+
preset?: ColorCorrectionPreset;
|
|
12
|
+
}
|
|
13
|
+
export interface PictureInPicturePosition {
|
|
14
|
+
/** Horizontal and vertical offsets in timeline pixels from the canvas center. */
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
export interface PictureInPictureCrop {
|
|
19
|
+
/** Fractions of the source frame to crop from each edge. */
|
|
20
|
+
top: number;
|
|
21
|
+
right: number;
|
|
22
|
+
bottom: number;
|
|
23
|
+
left: number;
|
|
24
|
+
}
|
|
25
|
+
export interface PictureInPictureFrame {
|
|
26
|
+
style: "solid";
|
|
27
|
+
color: string;
|
|
28
|
+
width: number;
|
|
29
|
+
}
|
|
30
|
+
export interface Clip {
|
|
31
|
+
/** Stable identity of this timeline occurrence, never the media resource id. */
|
|
32
|
+
id: string;
|
|
33
|
+
mediaId?: string;
|
|
34
|
+
name: string;
|
|
35
|
+
start: number;
|
|
36
|
+
duration: number;
|
|
37
|
+
/** Source-media start for trimmed occurrences; absent means zero. */
|
|
38
|
+
sourceStart?: number;
|
|
39
|
+
sourceStartTime?: RationalTime;
|
|
40
|
+
track: number;
|
|
41
|
+
gainDb?: number;
|
|
42
|
+
noiseReductionDb?: number;
|
|
43
|
+
colorCorrection?: ColorCorrection;
|
|
44
|
+
mask?: MaskConfiguration;
|
|
45
|
+
fadeIn?: number;
|
|
46
|
+
fadeOut?: number;
|
|
47
|
+
enabled?: boolean;
|
|
48
|
+
role?: "video" | "audio" | "music" | "title";
|
|
49
|
+
/** Exact native audio role, including its subrole. */
|
|
50
|
+
nativeAudioRole?: string;
|
|
51
|
+
attachedTo?: string;
|
|
52
|
+
position?: PictureInPicturePosition;
|
|
53
|
+
scale?: number;
|
|
54
|
+
crop?: PictureInPictureCrop;
|
|
55
|
+
frame?: PictureInPictureFrame;
|
|
56
|
+
/** Authoritative exact timeline coordinates; start/duration are convenience seconds. */
|
|
57
|
+
startTime: RationalTime;
|
|
58
|
+
durationTime: RationalTime;
|
|
59
|
+
}
|
|
60
|
+
export interface Marker {
|
|
61
|
+
id: string;
|
|
62
|
+
start: number;
|
|
63
|
+
duration: number;
|
|
64
|
+
name: string;
|
|
65
|
+
startTime?: RationalTime;
|
|
66
|
+
durationTime?: RationalTime;
|
|
67
|
+
}
|
|
68
|
+
export interface Caption {
|
|
69
|
+
id: string;
|
|
70
|
+
start: number;
|
|
71
|
+
duration: number;
|
|
72
|
+
text: string;
|
|
73
|
+
startTime?: RationalTime;
|
|
74
|
+
durationTime?: RationalTime;
|
|
75
|
+
}
|
|
76
|
+
export interface ProjectSnapshot {
|
|
77
|
+
projectId: string;
|
|
78
|
+
projectName: string;
|
|
79
|
+
/** Optional editor playhead observed with the canonical snapshot. */
|
|
80
|
+
playheadTime?: RationalTime;
|
|
81
|
+
timeline: {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
duration: number;
|
|
85
|
+
durationTime?: RationalTime;
|
|
86
|
+
/** Explicit source timecode origin, when independently present in the artifact. */
|
|
87
|
+
timecodeStart?: RationalTime;
|
|
88
|
+
/** Sequence-coordinate frame-grid origin, when supplied by the snapshot provider. */
|
|
89
|
+
frameGridOrigin?: RationalTime;
|
|
90
|
+
frameDuration?: RationalTime;
|
|
91
|
+
clips: Clip[];
|
|
92
|
+
storyElements: StoryElement[];
|
|
93
|
+
markers: Marker[];
|
|
94
|
+
captions: Caption[];
|
|
95
|
+
};
|
|
96
|
+
media: MediaContext[];
|
|
97
|
+
revision: ContextRevision;
|
|
98
|
+
}
|
|
99
|
+
/** Ordered FCPXML story elements retained so heterogeneous spines are not lost. */
|
|
100
|
+
export interface StoryElement {
|
|
101
|
+
id: string;
|
|
102
|
+
kind: string;
|
|
103
|
+
start: number;
|
|
104
|
+
duration: number;
|
|
105
|
+
startTime?: RationalTime;
|
|
106
|
+
durationTime?: RationalTime;
|
|
107
|
+
lane?: number;
|
|
108
|
+
mediaId?: string;
|
|
109
|
+
assetId?: string;
|
|
110
|
+
text?: string;
|
|
111
|
+
attachedTo?: string;
|
|
112
|
+
beforeClipId?: string;
|
|
113
|
+
afterClipId?: string;
|
|
114
|
+
position?: PictureInPicturePosition;
|
|
115
|
+
scale?: number;
|
|
116
|
+
crop?: PictureInPictureCrop;
|
|
117
|
+
frame?: PictureInPictureFrame;
|
|
118
|
+
mask?: MaskConfiguration;
|
|
119
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ContextRevision } from "./primitives.js";
|
|
2
|
+
import type { CompositeEditPreview, ImportMediaOperation, WorkflowOperation } from "./editing.js";
|
|
3
|
+
import type { MediaContext } from "./media.js";
|
|
4
|
+
import type { ProjectSnapshot } from "./project.js";
|
|
5
|
+
export interface RoughCutConstructionShot {
|
|
6
|
+
occurrenceId: string;
|
|
7
|
+
mediaId: string;
|
|
8
|
+
duration?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface RoughCutConstructionPlanRequest {
|
|
11
|
+
baseRevision: ContextRevision;
|
|
12
|
+
imports?: ImportMediaOperation[];
|
|
13
|
+
shots: RoughCutConstructionShot[];
|
|
14
|
+
}
|
|
15
|
+
export interface RoughCutConstructionPlan {
|
|
16
|
+
projectId: string;
|
|
17
|
+
timelineId: string;
|
|
18
|
+
baseRevision: ContextRevision;
|
|
19
|
+
operations: WorkflowOperation[];
|
|
20
|
+
duration: number;
|
|
21
|
+
}
|
|
22
|
+
export interface RoughCutConstructionPreview extends CompositeEditPreview {
|
|
23
|
+
plan: RoughCutConstructionPlan;
|
|
24
|
+
}
|
|
25
|
+
/** Build a deterministic primary-storyline workflow without mutating a project. */
|
|
26
|
+
export declare function planRoughCutConstruction(snapshot: ProjectSnapshot, request: RoughCutConstructionPlanRequest): RoughCutConstructionPlan;
|
|
27
|
+
export type RoughCutMedia = MediaContext;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { RuntimeCapabilities } from "./capabilities.js";
|
|
2
|
+
import type { ContextRevision, TimeRange } from "./primitives.js";
|
|
3
|
+
import type { ProjectSnapshot } from "./project.js";
|
|
4
|
+
import type { WorkflowOperation } from "./editing.js";
|
|
5
|
+
import type { TimelineDiff } from "./diff.js";
|
|
6
|
+
import type { VerificationPolicy, VerificationReport } from "./verification.js";
|
|
7
|
+
import type { VerificationCheck } from "./verification.js";
|
|
8
|
+
import type { EditTransaction } from "./editing.js";
|
|
9
|
+
import type { AudioMeasurement, NoiseMeasurement, SpeechAnalysis } from "./media.js";
|
|
10
|
+
/** Version of the editor-independent Skill contract. */
|
|
11
|
+
export declare const SKILL_CONTRACT_VERSION: 1;
|
|
12
|
+
/** The ordered phases shared by every Skill implementation. */
|
|
13
|
+
export declare const SKILL_LIFECYCLE: readonly ["discover", "resolve", "plan", "preview", "execute", "verify", "accept", "rollback"];
|
|
14
|
+
export type SkillLifecyclePhase = (typeof SKILL_LIFECYCLE)[number];
|
|
15
|
+
export type SkillSchema = {
|
|
16
|
+
type: "string";
|
|
17
|
+
description?: string;
|
|
18
|
+
enum?: string[];
|
|
19
|
+
minLength?: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: "number";
|
|
22
|
+
description?: string;
|
|
23
|
+
minimum?: number;
|
|
24
|
+
maximum?: number;
|
|
25
|
+
} | {
|
|
26
|
+
type: "integer";
|
|
27
|
+
description?: string;
|
|
28
|
+
minimum?: number;
|
|
29
|
+
maximum?: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "boolean";
|
|
32
|
+
description?: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: "array";
|
|
35
|
+
description?: string;
|
|
36
|
+
items: SkillSchema;
|
|
37
|
+
minItems?: number;
|
|
38
|
+
} | {
|
|
39
|
+
type: "object";
|
|
40
|
+
description?: string;
|
|
41
|
+
properties: Record<string, SkillSchema>;
|
|
42
|
+
required?: string[];
|
|
43
|
+
additionalProperties?: boolean;
|
|
44
|
+
};
|
|
45
|
+
/** A transport-neutral input schema carried by a Skill manifest. */
|
|
46
|
+
export interface SkillInputSchema {
|
|
47
|
+
type: "object";
|
|
48
|
+
properties: Record<string, SkillSchema>;
|
|
49
|
+
required?: string[];
|
|
50
|
+
additionalProperties?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export type EditorSkillCapability = "projectRead" | "timelineSnapshotRead" | "timelineWrite" | "timelineArtifactWrite" | "readAfterWrite" | "rollback" | "assetDiscovery" | "liveStateRead" | "playheadWrite" | "frameCapture" | "artifactPublish" | "projectCatalogRead" | "projectSelection" | "compositeTransactions" | "videoExport" | "mediaImport" | "mediaPlacement" | "pictureInPicture" | "titlePlacement" | "clipMove" | "clipReplace" | "clipRemoval" | "transitionPlacement" | "audioAttachment" | "audioMixing" | "noiseReduction" | "colorCorrection";
|
|
53
|
+
export type AnalyzerSkillCapability = "speechTranscribe" | "speechVad" | "audioLoudness" | "audioNoise" | "visualTrack" | "metadataDescribe";
|
|
54
|
+
/** Semantic operation names are deliberately independent of editor commands. */
|
|
55
|
+
export declare const SKILL_OPERATIONS: readonly ["rename-clip", "trim-clip", "set-gain", "reduce-noise", "set-color-correction", "ripple-delete", "add-marker", "media.import", "timeline.media.add", "timeline.picture-in-picture.add", "timeline.audio.fades", "timeline.title.add", "timeline.media.move", "timeline.media.replace", "timeline.media.remove", "timeline.transition.add", "timeline.audio.attach", "timeline.audio.mix", "timeline.mask.add"];
|
|
56
|
+
export type SkillOperation = (typeof SKILL_OPERATIONS)[number];
|
|
57
|
+
export type SkillRequirement = {
|
|
58
|
+
type: "allOf";
|
|
59
|
+
requirements: SkillRequirement[];
|
|
60
|
+
} | {
|
|
61
|
+
type: "anyOf";
|
|
62
|
+
requirements: SkillRequirement[];
|
|
63
|
+
} | {
|
|
64
|
+
type: "editor";
|
|
65
|
+
capability: EditorSkillCapability;
|
|
66
|
+
} | {
|
|
67
|
+
type: "analyzer";
|
|
68
|
+
capability: AnalyzerSkillCapability;
|
|
69
|
+
} | {
|
|
70
|
+
type: "operation";
|
|
71
|
+
operation: SkillOperation;
|
|
72
|
+
};
|
|
73
|
+
export interface SkillManifest {
|
|
74
|
+
contractVersion: typeof SKILL_CONTRACT_VERSION;
|
|
75
|
+
id: string;
|
|
76
|
+
version: string;
|
|
77
|
+
title: string;
|
|
78
|
+
description: string;
|
|
79
|
+
inputSchema: SkillInputSchema;
|
|
80
|
+
/** Version-pinned values used when the input omits optional policy fields. */
|
|
81
|
+
defaults?: Record<string, unknown>;
|
|
82
|
+
requirements: SkillRequirement;
|
|
83
|
+
verification?: VerificationPolicy;
|
|
84
|
+
}
|
|
85
|
+
export type SkillPlanDecision = "APPLY" | "NO_OP" | "SKIP";
|
|
86
|
+
export interface SkillPlanningContext {
|
|
87
|
+
/** The snapshot is read-only input to a handler; it is not an adapter. */
|
|
88
|
+
project: ProjectSnapshot;
|
|
89
|
+
capabilities: RuntimeCapabilities;
|
|
90
|
+
baseRevision: ContextRevision;
|
|
91
|
+
analyzeSpeech?: (mediaId: string, range?: TimeRange) => Promise<SpeechAnalysis>;
|
|
92
|
+
measureAudio?: (mediaId: string, occurrenceId: string) => Promise<AudioMeasurement>;
|
|
93
|
+
measureNoise?: (mediaId: string, occurrenceId: string) => Promise<NoiseMeasurement>;
|
|
94
|
+
}
|
|
95
|
+
export interface SkillPlan {
|
|
96
|
+
id: string;
|
|
97
|
+
skillId: string;
|
|
98
|
+
skillVersion: string;
|
|
99
|
+
baseRevision: ContextRevision;
|
|
100
|
+
normalizedInput: Record<string, unknown>;
|
|
101
|
+
operations: WorkflowOperation[];
|
|
102
|
+
affectedRanges: TimeRange[];
|
|
103
|
+
warnings: string[];
|
|
104
|
+
decision?: SkillPlanDecision;
|
|
105
|
+
verification?: VerificationPolicy;
|
|
106
|
+
details?: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
export interface SkillPreview {
|
|
109
|
+
previewToken: string;
|
|
110
|
+
plan: SkillPlan;
|
|
111
|
+
expectedDiff?: TimelineDiff;
|
|
112
|
+
expiresAt: string;
|
|
113
|
+
}
|
|
114
|
+
export type SkillExecutionStatus = "VERIFIED" | "ROLLED_BACK" | "FAILED" | "SKIPPED";
|
|
115
|
+
export interface SkillRollbackResult {
|
|
116
|
+
attempted: boolean;
|
|
117
|
+
succeeded: boolean;
|
|
118
|
+
transactionIds: string[];
|
|
119
|
+
reason?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface SkillExecution {
|
|
122
|
+
status: SkillExecutionStatus;
|
|
123
|
+
plan: Pick<SkillPlan, "id" | "skillId" | "skillVersion" | "baseRevision">;
|
|
124
|
+
transactionIds: string[];
|
|
125
|
+
diff?: TimelineDiff;
|
|
126
|
+
verification?: VerificationReport;
|
|
127
|
+
details?: Record<string, unknown>;
|
|
128
|
+
rollback: SkillRollbackResult;
|
|
129
|
+
}
|
|
130
|
+
export interface SkillVerificationContext {
|
|
131
|
+
plan: SkillPlan;
|
|
132
|
+
expectedDiff?: TimelineDiff;
|
|
133
|
+
transaction: EditTransaction;
|
|
134
|
+
measureAudio?: (mediaId: string, occurrenceId: string) => Promise<AudioMeasurement>;
|
|
135
|
+
}
|
|
136
|
+
export interface SkillHandler<Input extends Record<string, unknown> = Record<string, unknown>> {
|
|
137
|
+
normalize(input: unknown): Promise<Input> | Input;
|
|
138
|
+
plan(context: SkillPlanningContext, input: Input): Promise<Omit<SkillPlan, "id" | "skillId" | "skillVersion" | "baseRevision" | "normalizedInput">> | Omit<SkillPlan, "id" | "skillId" | "skillVersion" | "baseRevision" | "normalizedInput">;
|
|
139
|
+
verify?(context: SkillVerificationContext): Promise<VerificationCheck[]> | VerificationCheck[];
|
|
140
|
+
}
|
|
141
|
+
/** Metadata and executable behavior are separate so manifests remain inspectable. */
|
|
142
|
+
export interface SkillDefinition<Input extends Record<string, unknown> = Record<string, unknown>> {
|
|
143
|
+
manifest: SkillManifest;
|
|
144
|
+
handler: SkillHandler<Input>;
|
|
145
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ContextRevision, RationalTime } from "./primitives.js";
|
|
2
|
+
import type { Clip, ProjectSnapshot } from "./project.js";
|
|
3
|
+
/** A rational range addressed on one timeline. */
|
|
4
|
+
export interface TimelineTargetRange {
|
|
5
|
+
start: RationalTime;
|
|
6
|
+
end: RationalTime;
|
|
7
|
+
}
|
|
8
|
+
/** The immutable identity and coordinates captured for one timeline occurrence. */
|
|
9
|
+
export interface TimelineOccurrenceTarget {
|
|
10
|
+
id: string;
|
|
11
|
+
mediaId?: string;
|
|
12
|
+
sourceStartTime?: RationalTime;
|
|
13
|
+
startTime: RationalTime;
|
|
14
|
+
durationTime: RationalTime;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Stable addressing shared by background and headed providers.
|
|
18
|
+
*
|
|
19
|
+
* A native UI handle is intentionally not part of this contract. Providers may
|
|
20
|
+
* derive a short-lived handle internally, but must bind it to this scope,
|
|
21
|
+
* revision, identity, and exact frame grid before a write.
|
|
22
|
+
*/
|
|
23
|
+
export interface TimelineTarget {
|
|
24
|
+
projectId: string;
|
|
25
|
+
sequenceId: string;
|
|
26
|
+
revision: ContextRevision;
|
|
27
|
+
timelineStartTime: RationalTime;
|
|
28
|
+
/** Present only when the captured snapshot explicitly supplied its frame-grid origin. */
|
|
29
|
+
frameGridOriginObserved?: true;
|
|
30
|
+
frameDuration: RationalTime;
|
|
31
|
+
mediaId?: string;
|
|
32
|
+
occurrence?: TimelineOccurrenceTarget;
|
|
33
|
+
range?: TimelineTargetRange;
|
|
34
|
+
}
|
|
35
|
+
export interface TimelineTargetSelection {
|
|
36
|
+
occurrenceId?: string;
|
|
37
|
+
mediaId?: string;
|
|
38
|
+
range?: TimelineTargetRange;
|
|
39
|
+
}
|
|
40
|
+
export interface TimelineTargetResolution {
|
|
41
|
+
target: TimelineTarget;
|
|
42
|
+
occurrence?: Clip;
|
|
43
|
+
}
|
|
44
|
+
/** Capture a target from a canonical snapshot without deriving identity from names or indexes. */
|
|
45
|
+
export declare function createTimelineTarget(snapshot: ProjectSnapshot, selection?: TimelineTargetSelection): TimelineTarget;
|
|
46
|
+
/** Resolve and validate an explicit target against the current canonical snapshot. */
|
|
47
|
+
export declare function resolveTimelineTarget(snapshot: ProjectSnapshot, target: TimelineTarget): TimelineTargetResolution;
|
|
48
|
+
/**
|
|
49
|
+
* Verify that a post-write snapshot still addresses the same target.
|
|
50
|
+
* Coordinates may change for trim and move; occurrence and media identity may
|
|
51
|
+
* not change unless the operation explicitly removes the occurrence.
|
|
52
|
+
*/
|
|
53
|
+
export declare function assertTimelineTargetReadAfterWrite(target: TimelineTarget, before: ProjectSnapshot, after: ProjectSnapshot, options?: {
|
|
54
|
+
allowOccurrenceRemoval?: boolean;
|
|
55
|
+
}): void;
|
|
56
|
+
/** Validate the shape of a target before any provider-specific resolution. */
|
|
57
|
+
export declare function assertValidTimelineTarget(target: TimelineTarget): void;
|
|
@@ -8,7 +8,8 @@ export function createTimelineTarget(snapshot, selection = {}) {
|
|
|
8
8
|
projectId: snapshot.projectId,
|
|
9
9
|
sequenceId: snapshot.timeline.id,
|
|
10
10
|
revision: structuredClone(snapshot.revision),
|
|
11
|
-
timelineStartTime: { value: "0", timescale: "1" },
|
|
11
|
+
timelineStartTime: structuredClone(snapshot.timeline.frameGridOrigin ?? { value: "0", timescale: "1" }),
|
|
12
|
+
...(snapshot.timeline.frameGridOrigin !== undefined ? { frameGridOriginObserved: true } : {}),
|
|
12
13
|
frameDuration: structuredClone(frameDuration),
|
|
13
14
|
...(selection.mediaId !== undefined ? { mediaId: selection.mediaId } : {}),
|
|
14
15
|
...(selection.range ? { range: structuredClone(selection.range) } : {}),
|
|
@@ -42,6 +43,7 @@ export function resolveTimelineTarget(snapshot, target) {
|
|
|
42
43
|
if (!sameRational(target.frameDuration, snapshot.timeline.frameDuration)) {
|
|
43
44
|
throw new Error("FRAME_ALIGNMENT_REQUIRED: target frame duration does not match current timeline");
|
|
44
45
|
}
|
|
46
|
+
assertMatchingFrameGridOrigin(snapshot, target);
|
|
45
47
|
validateTargetCoordinates(snapshot, target);
|
|
46
48
|
const occurrence = target.occurrence
|
|
47
49
|
? findUniqueOccurrence(snapshot, target.occurrence.id)
|
|
@@ -64,6 +66,10 @@ export function assertTimelineTargetReadAfterWrite(target, before, after, option
|
|
|
64
66
|
if (after.projectId !== target.projectId || after.timeline.id !== target.sequenceId) {
|
|
65
67
|
throw new Error("TARGET_MISMATCH: read-after-write snapshot changed the addressed timeline");
|
|
66
68
|
}
|
|
69
|
+
if (!after.timeline.frameDuration || !sameRational(target.frameDuration, after.timeline.frameDuration)) {
|
|
70
|
+
throw new Error("FRAME_ALIGNMENT_REQUIRED: read-after-write frame duration changed or is unavailable");
|
|
71
|
+
}
|
|
72
|
+
assertMatchingFrameGridOrigin(after, target);
|
|
67
73
|
if (!target.occurrence)
|
|
68
74
|
return;
|
|
69
75
|
const matches = findOccurrences(after, target.occurrence.id);
|
|
@@ -79,6 +85,15 @@ export function assertTimelineTargetReadAfterWrite(target, before, after, option
|
|
|
79
85
|
throw new Error(`TARGET_MISMATCH: read-after-write changed media for occurrence ${target.occurrence.id}`);
|
|
80
86
|
}
|
|
81
87
|
}
|
|
88
|
+
function assertMatchingFrameGridOrigin(snapshot, target) {
|
|
89
|
+
if ((target.frameGridOriginObserved === true) !== (snapshot.timeline.frameGridOrigin !== undefined)) {
|
|
90
|
+
throw new Error("FRAME_ALIGNMENT_REQUIRED: target frame-grid origin evidence changed or is unavailable");
|
|
91
|
+
}
|
|
92
|
+
const origin = snapshot.timeline.frameGridOrigin ?? { value: "0", timescale: "1" };
|
|
93
|
+
if (!sameRational(target.timelineStartTime, origin)) {
|
|
94
|
+
throw new Error("FRAME_ALIGNMENT_REQUIRED: target frame-grid origin does not match current timeline");
|
|
95
|
+
}
|
|
96
|
+
}
|
|
82
97
|
/** Validate the shape of a target before any provider-specific resolution. */
|
|
83
98
|
export function assertValidTimelineTarget(target) {
|
|
84
99
|
requireNonEmpty(target.projectId, "projectId");
|
|
@@ -89,6 +104,9 @@ export function assertValidTimelineTarget(target) {
|
|
|
89
104
|
}
|
|
90
105
|
requireNonEmpty(target.revision.timestamp, "revision.timestamp");
|
|
91
106
|
parseRational(target.timelineStartTime, "INVALID_TIMELINE_TARGET: timelineStartTime");
|
|
107
|
+
if (target.frameGridOriginObserved !== undefined && target.frameGridOriginObserved !== true) {
|
|
108
|
+
throw new Error("INVALID_TIMELINE_TARGET: frameGridOriginObserved must be true when present");
|
|
109
|
+
}
|
|
92
110
|
const frame = parseRational(target.frameDuration, "INVALID_TIMELINE_TARGET: frameDuration");
|
|
93
111
|
if (frame.value <= 0n)
|
|
94
112
|
throw new Error("INVALID_TIMELINE_TARGET: frameDuration must be positive");
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { EditTransaction } from "./editing.js";
|
|
2
|
+
import type { EditTarget } from "./editing.js";
|
|
3
|
+
import type { ColorCorrection } from "./project.js";
|
|
4
|
+
export interface AudioAudibilityAssertion {
|
|
5
|
+
type: "audio-audibility";
|
|
6
|
+
mediaId: string;
|
|
7
|
+
minAudibleSamples?: number;
|
|
8
|
+
maxSilenceMs?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface AudioCoverageAssertion {
|
|
11
|
+
type: "audio-coverage";
|
|
12
|
+
mediaId: string;
|
|
13
|
+
start: number;
|
|
14
|
+
duration: number;
|
|
15
|
+
toleranceSeconds?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AudioLoudnessAssertion {
|
|
18
|
+
type: "audio-loudness";
|
|
19
|
+
mediaId: string;
|
|
20
|
+
occurrenceId?: string;
|
|
21
|
+
targetLufs: number;
|
|
22
|
+
toleranceDb?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface AudioNoiseAssertion {
|
|
25
|
+
type: "audio-noise";
|
|
26
|
+
mediaId: string;
|
|
27
|
+
maxNoiseFloorDb: number;
|
|
28
|
+
minConfidence?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface AudioSourceAssertion {
|
|
31
|
+
type: "audio-source";
|
|
32
|
+
mediaId: string;
|
|
33
|
+
sourceDigest?: string;
|
|
34
|
+
source?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface VisualContentAssertion {
|
|
37
|
+
type: "visual-content";
|
|
38
|
+
mediaId: string;
|
|
39
|
+
label: string;
|
|
40
|
+
labelKind?: "scene" | "subject";
|
|
41
|
+
minConfidence?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface DurationAssertion {
|
|
44
|
+
type: "duration";
|
|
45
|
+
target: "timeline";
|
|
46
|
+
expectedSeconds: number;
|
|
47
|
+
toleranceSeconds?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface StreamAssertion {
|
|
50
|
+
type: "stream";
|
|
51
|
+
target: "audio" | "video";
|
|
52
|
+
expected: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface StructureAssertion {
|
|
55
|
+
type: "structure";
|
|
56
|
+
requirement: "media-present" | "occurrence-present" | "operation-present";
|
|
57
|
+
mediaId?: string;
|
|
58
|
+
occurrenceId?: string;
|
|
59
|
+
operationType?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ColorCorrectionAssertion {
|
|
62
|
+
type: "color-correction";
|
|
63
|
+
clipId: string;
|
|
64
|
+
expected: ColorCorrection;
|
|
65
|
+
}
|
|
66
|
+
export type VerificationAssertion = AudioAudibilityAssertion | AudioCoverageAssertion | AudioLoudnessAssertion | AudioNoiseAssertion | AudioSourceAssertion | VisualContentAssertion | DurationAssertion | StreamAssertion | StructureAssertion | ColorCorrectionAssertion;
|
|
67
|
+
export interface VerificationPolicy {
|
|
68
|
+
requireExpectedChange?: boolean;
|
|
69
|
+
maxTruePeakDb?: number;
|
|
70
|
+
requireSpeechContinuity?: boolean;
|
|
71
|
+
targetLufs?: number;
|
|
72
|
+
loudnessToleranceDb?: number;
|
|
73
|
+
assertions?: VerificationAssertion[];
|
|
74
|
+
}
|
|
75
|
+
export type VerificationCheckStatus = "passed" | "failed" | "unavailable";
|
|
76
|
+
export interface VerificationCheck {
|
|
77
|
+
name: string;
|
|
78
|
+
passed: boolean;
|
|
79
|
+
detail: string;
|
|
80
|
+
status?: VerificationCheckStatus;
|
|
81
|
+
expected?: unknown;
|
|
82
|
+
observed?: unknown;
|
|
83
|
+
reason?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface VerificationReport {
|
|
86
|
+
passed: boolean;
|
|
87
|
+
checks: VerificationCheck[];
|
|
88
|
+
target?: EditTarget;
|
|
89
|
+
}
|
|
90
|
+
export interface VerificationEngine {
|
|
91
|
+
verify(transaction: EditTransaction, policy: VerificationPolicy): Promise<VerificationReport>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DialogueNormalizationPreview, DialogueNormalizationRequest } from "../audio/dialogue-normalization.js";
|
|
2
|
+
import type { EditTransaction } from "../domain/editing.js";
|
|
3
|
+
import { MediaAnalysisService } from "../application/media-analysis-service.js";
|
|
4
|
+
import { ProjectService } from "../application/project-service.js";
|
|
5
|
+
import { EditService } from "./edit-service.js";
|
|
6
|
+
import type { EditorPort } from "../domain/ports.js";
|
|
7
|
+
export declare class DialogueNormalizationService {
|
|
8
|
+
private readonly adapter;
|
|
9
|
+
private readonly project;
|
|
10
|
+
private readonly analysis;
|
|
11
|
+
private readonly edits;
|
|
12
|
+
private readonly previews;
|
|
13
|
+
constructor(adapter: EditorPort, project: ProjectService, analysis: MediaAnalysisService, edits: EditService);
|
|
14
|
+
preview(request: DialogueNormalizationRequest): Promise<DialogueNormalizationPreview>;
|
|
15
|
+
execute(previewToken: string): Promise<EditTransaction>;
|
|
16
|
+
private assertCapabilities;
|
|
17
|
+
private rollbackAfterMeasurementFailure;
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { EditorPort } from "../domain/ports.js";
|
|
2
|
+
import type { ArtifactEditTargetInput, CompositeEditPreview, CompositeEditRequest, EditOperation, EditTransaction, EditorTimelineEditTargetInput } from "../domain/editing.js";
|
|
3
|
+
import type { ProjectSnapshot } from "../domain/project.js";
|
|
4
|
+
import type { TimelineDiff } from "../domain/diff.js";
|
|
5
|
+
import type { VerificationEngine, VerificationPolicy } from "../domain/verification.js";
|
|
6
|
+
import { MediaAnalysisService } from "../application/media-analysis-service.js";
|
|
7
|
+
import { ProjectService } from "../application/project-service.js";
|
|
8
|
+
import type { RuntimeOptions } from "../application/runtime-options.js";
|
|
9
|
+
import type { TransactionStore } from "../application/transaction-store.js";
|
|
10
|
+
export declare class EditService {
|
|
11
|
+
private readonly adapter;
|
|
12
|
+
private readonly project;
|
|
13
|
+
private readonly analysis;
|
|
14
|
+
private readonly verificationEngine;
|
|
15
|
+
private readonly options;
|
|
16
|
+
private readonly transactions;
|
|
17
|
+
private readonly editPreviews;
|
|
18
|
+
constructor(adapter: EditorPort, project: ProjectService, analysis: MediaAnalysisService, verificationEngine: VerificationEngine, options: RuntimeOptions, transactions: TransactionStore);
|
|
19
|
+
edit(operation: EditOperation, policy?: VerificationPolicy): Promise<EditTransaction>;
|
|
20
|
+
editArtifact(targetInput: ArtifactEditTargetInput, operation: EditOperation, policy?: VerificationPolicy): Promise<EditTransaction>;
|
|
21
|
+
editTimeline(targetInput: EditorTimelineEditTargetInput, operation: EditOperation, policy?: VerificationPolicy): Promise<EditTransaction>;
|
|
22
|
+
private editWithTarget;
|
|
23
|
+
previewEdit(request: CompositeEditRequest): Promise<CompositeEditPreview>;
|
|
24
|
+
previewArtifactEdit(targetInput: ArtifactEditTargetInput, request: CompositeEditRequest): Promise<CompositeEditPreview>;
|
|
25
|
+
previewTimelineEdit(targetInput: EditorTimelineEditTargetInput, request: CompositeEditRequest): Promise<CompositeEditPreview>;
|
|
26
|
+
private previewEditWithTarget;
|
|
27
|
+
executeEdit(previewToken: string, policy?: VerificationPolicy): Promise<EditTransaction>;
|
|
28
|
+
getDiff(transactionId: string): TimelineDiff;
|
|
29
|
+
getTransaction(transactionId: string): EditTransaction;
|
|
30
|
+
verifyTransaction(transactionId: string): Promise<NonNullable<EditTransaction["verification"]>>;
|
|
31
|
+
private reanalyzeForVerification;
|
|
32
|
+
undo(transactionId: string): Promise<ProjectSnapshot>;
|
|
33
|
+
private assertRestored;
|
|
34
|
+
private assertCompositeCapabilities;
|
|
35
|
+
private defaultTarget;
|
|
36
|
+
private artifactTarget;
|
|
37
|
+
private artifactDescriptor;
|
|
38
|
+
private readArtifactDigest;
|
|
39
|
+
private timelineTarget;
|
|
40
|
+
private assertTarget;
|
|
41
|
+
private assertSurfaceCapability;
|
|
42
|
+
private now;
|
|
43
|
+
private pruneEditPreviews;
|
|
44
|
+
}
|