@omnimedia/omniso 0.0.0-stage → 0.1.1-0
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/package.json +36 -5
- package/x/abortable.d.ts +1 -0
- package/x/abortable.js +19 -0
- package/x/api.d.ts +45 -0
- package/x/api.js +1 -0
- package/x/assistant/knowledge.d.ts +3 -0
- package/x/assistant/knowledge.js +29 -0
- package/x/assistant/schema.d.ts +27 -0
- package/x/assistant/schema.js +18 -0
- package/x/assistant/tools.d.ts +63 -0
- package/x/assistant/tools.js +18 -0
- package/x/assistant/types.d.ts +19 -0
- package/x/assistant/types.js +1 -0
- package/x/billing.d.ts +15 -0
- package/x/billing.js +9 -0
- package/x/mcp/protocol.d.ts +20 -0
- package/x/mcp/protocol.js +1 -0
- package/x/schemas/session.d.ts +6 -0
- package/x/schemas/session.js +4 -0
- package/x/settings.d.ts +59 -0
- package/x/settings.js +12 -0
- package/x/timeline.d.ts +31 -0
- package/x/timeline.js +1 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@omnimedia/omniso",
|
|
3
|
+
"version": "0.1.1-0",
|
|
4
|
+
"description": "Shared contracts, schemas, and utilities for Omniclip and its server",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/omni-media/omniso.git"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"x"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
"./*": {
|
|
17
|
+
"types": "./x/*.d.ts",
|
|
18
|
+
"import": "./x/*.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"watch": "tsc -p tsconfig.json -w",
|
|
24
|
+
"prepack": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@e280/stz": "^0.4.7",
|
|
31
|
+
"@omnimedia/omnitool": "^1.1.0-145",
|
|
32
|
+
"zod": "^4.6.5"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"typescript": "6.0.3"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/x/abortable.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function abortable<Result>(promise: Promise<Result>, signal: AbortSignal, onAbort: () => void): Promise<Result>;
|
package/x/abortable.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defer } from "@e280/stz";
|
|
2
|
+
export async function abortable(promise, signal, onAbort) {
|
|
3
|
+
if (signal.aborted) {
|
|
4
|
+
onAbort();
|
|
5
|
+
signal.throwIfAborted();
|
|
6
|
+
}
|
|
7
|
+
const aborted = defer();
|
|
8
|
+
const abort = () => {
|
|
9
|
+
onAbort();
|
|
10
|
+
aborted.reject(signal.reason);
|
|
11
|
+
};
|
|
12
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
13
|
+
try {
|
|
14
|
+
return await Promise.race([promise, aborted.promise]);
|
|
15
|
+
}
|
|
16
|
+
finally {
|
|
17
|
+
signal.removeEventListener("abort", abort);
|
|
18
|
+
}
|
|
19
|
+
}
|
package/x/api.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BillingStatus } from "./billing.js";
|
|
2
|
+
import type { ProjectSession } from "./schemas/session.js";
|
|
3
|
+
export declare const reasoningEfforts: readonly ["none", "low", "medium", "xhigh"];
|
|
4
|
+
export type ReasoningEffort = typeof reasoningEfforts[number];
|
|
5
|
+
export type FileRequest = {
|
|
6
|
+
projectId: string;
|
|
7
|
+
path: string;
|
|
8
|
+
};
|
|
9
|
+
export type VideoRequest = {
|
|
10
|
+
path: string;
|
|
11
|
+
prompt: string;
|
|
12
|
+
reasoningEffort: ReasoningEffort;
|
|
13
|
+
};
|
|
14
|
+
export type UploadedPart = {
|
|
15
|
+
path: string;
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
};
|
|
19
|
+
type Price = {
|
|
20
|
+
amount: number | null;
|
|
21
|
+
currency: string;
|
|
22
|
+
};
|
|
23
|
+
export type BillingApi = {
|
|
24
|
+
status(): Promise<BillingStatus>;
|
|
25
|
+
pricing(): Promise<{
|
|
26
|
+
pro: Price;
|
|
27
|
+
topUp: Price;
|
|
28
|
+
}>;
|
|
29
|
+
buyCredits(): Promise<{
|
|
30
|
+
url: string;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
export type MediaAnalysisApi = {
|
|
34
|
+
uploadTarget(input: FileRequest): Promise<{
|
|
35
|
+
uploadUrl: string;
|
|
36
|
+
}>;
|
|
37
|
+
getUploadedParts(input: FileRequest): Promise<UploadedPart[] | null | undefined>;
|
|
38
|
+
inspectVideo(input: VideoRequest): Promise<{
|
|
39
|
+
analysis: string;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
42
|
+
export type CleanupApi = {
|
|
43
|
+
heartbeat(input: ProjectSession): Promise<void>;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
package/x/api.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const reasoningEfforts = ["none", "low", "medium", "xhigh"];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AssistantContext } from "./types.js";
|
|
2
|
+
export declare const assistantKnowledge = "\nOmniclip is a browser video editor.\n\nTimeline model:\n- A Stack plays its children at the same time on separate rows.\n- A Sequence plays its children one after another.\n- Drag clips to rearrange them. Hold Control while dragging to move their container.\n- Double-click a Stack or Sequence to view its contents. Use the breadcrumb above the timeline to leave it.\n- Right-click a clip to wrap it in a Stack or Sequence.\n- Select a clip before editing it in the inspector.\n\nMain areas:\n- Media imports and browses project media.\n- Text adds titles and captions.\n- Transitions are placed between compatible clips in a Sequence.\n- The inspector edits the selected item's transform, crop, effects, text, and keyframes when supported.\n- The Audio panel controls master gain and mute.\n- Export renders and saves the current project.\n- Settings in the top bar edits project resolution, aspect ratio, frame rate, timecode, color space and audio settings. Current values are in context.settings. Use update_settings to change them; supply both resolution and a matching aspectRatio when changing canvas format. This does not resize or reposition clips. Settings changes are saved separately from timeline undo history.\n- Shortcuts in the top bar lists available keyboard controls.\n\nGive short, concrete instructions using the names shown in the interface. Use the current project context when relevant. When the source video's visual or audio content determines the answer or edit, first call provide_selected_video, then immediately call inspect_video with its path and a focused question. For visual or audio questions about the whole edit, call inspect_timeline with the user's question instead. These analyze original sources, not a rendered timeline. If the answer is not in this manual, context, or an available skill, say that you are not sure. Only edit the project when the user asks for a change, and only claim success after a tool confirms it.";
|
|
3
|
+
export declare const assistantInstructions: (context: AssistantContext, skills: string) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const assistantKnowledge = `
|
|
2
|
+
Omniclip is a browser video editor.
|
|
3
|
+
|
|
4
|
+
Timeline model:
|
|
5
|
+
- A Stack plays its children at the same time on separate rows.
|
|
6
|
+
- A Sequence plays its children one after another.
|
|
7
|
+
- Drag clips to rearrange them. Hold Control while dragging to move their container.
|
|
8
|
+
- Double-click a Stack or Sequence to view its contents. Use the breadcrumb above the timeline to leave it.
|
|
9
|
+
- Right-click a clip to wrap it in a Stack or Sequence.
|
|
10
|
+
- Select a clip before editing it in the inspector.
|
|
11
|
+
|
|
12
|
+
Main areas:
|
|
13
|
+
- Media imports and browses project media.
|
|
14
|
+
- Text adds titles and captions.
|
|
15
|
+
- Transitions are placed between compatible clips in a Sequence.
|
|
16
|
+
- The inspector edits the selected item's transform, crop, effects, text, and keyframes when supported.
|
|
17
|
+
- The Audio panel controls master gain and mute.
|
|
18
|
+
- Export renders and saves the current project.
|
|
19
|
+
- Settings in the top bar edits project resolution, aspect ratio, frame rate, timecode, color space and audio settings. Current values are in context.settings. Use update_settings to change them; supply both resolution and a matching aspectRatio when changing canvas format. This does not resize or reposition clips. Settings changes are saved separately from timeline undo history.
|
|
20
|
+
- Shortcuts in the top bar lists available keyboard controls.
|
|
21
|
+
|
|
22
|
+
Give short, concrete instructions using the names shown in the interface. Use the current project context when relevant. When the source video's visual or audio content determines the answer or edit, first call provide_selected_video, then immediately call inspect_video with its path and a focused question. For visual or audio questions about the whole edit, call inspect_timeline with the user's question instead. These analyze original sources, not a rendered timeline. If the answer is not in this manual, context, or an available skill, say that you are not sure. Only edit the project when the user asks for a change, and only claim success after a tool confirms it.`;
|
|
23
|
+
export const assistantInstructions = (context, skills) => `${assistantKnowledge}
|
|
24
|
+
${skills}
|
|
25
|
+
|
|
26
|
+
Fresh project context is supplied with every request, including after tool calls. Use it as authoritative over earlier messages and inspection results. After a revision mismatch, rebuild the patch using its timeline and timelineRevision; never guess or increment a revision. Video inspection describes original source content, not the current edit. Map source timestamps to the clip ranges in the latest timeline, and only claim an edit succeeded when its editing tool confirms success.
|
|
27
|
+
|
|
28
|
+
Current project context:
|
|
29
|
+
${JSON.stringify(context)}`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const skillCallParameters: z.ZodObject<{
|
|
3
|
+
skill: z.ZodString;
|
|
4
|
+
path: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export type SkillCall = z.infer<typeof skillCallParameters>;
|
|
7
|
+
export declare const timelinePatchParameters: z.ZodObject<{
|
|
8
|
+
baseRevision: z.ZodNumber;
|
|
9
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
10
|
+
op: z.ZodEnum<{
|
|
11
|
+
add: "add";
|
|
12
|
+
replace: "replace";
|
|
13
|
+
remove: "remove";
|
|
14
|
+
set_root: "set_root";
|
|
15
|
+
set_audio: "set_audio";
|
|
16
|
+
}>;
|
|
17
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
18
|
+
item: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
kind: z.ZodNumber;
|
|
21
|
+
}, z.core.$loose>>;
|
|
22
|
+
audio: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
23
|
+
gain: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
}, z.core.$strict>>>;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
}, z.core.$strict>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
const itemIdSchema = z.string().regex(/^[0-9a-f]{32}$/);
|
|
3
|
+
export const skillCallParameters = z.strictObject({
|
|
4
|
+
skill: z.string(),
|
|
5
|
+
path: z.string().describe("SKILL.md or a linked path relative to it"),
|
|
6
|
+
});
|
|
7
|
+
export const timelinePatchParameters = z.strictObject({
|
|
8
|
+
baseRevision: z.number().int(),
|
|
9
|
+
operations: z.array(z.strictObject({
|
|
10
|
+
op: z.enum(["add", "replace", "remove", "set_root", "set_audio"]),
|
|
11
|
+
itemId: itemIdSchema.optional().describe("Required by replace, remove, and set_root."),
|
|
12
|
+
item: z.looseObject({ id: itemIdSchema, kind: z.number().int() }).optional(),
|
|
13
|
+
audio: z.strictObject({
|
|
14
|
+
gain: z.number().optional(),
|
|
15
|
+
enabled: z.boolean().optional(),
|
|
16
|
+
}).nullable().optional().describe("Audio settings required by set_audio; null removes them."),
|
|
17
|
+
})).min(1),
|
|
18
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const emptyParameters: z.ZodObject<{}, z.core.$strict>;
|
|
3
|
+
export declare const editorTools: {
|
|
4
|
+
update_settings: {
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: z.ZodObject<{
|
|
7
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
8
|
+
timebase: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
dropFrame: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
aspectRatio: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
"16:9": "16:9";
|
|
12
|
+
"9:16": "9:16";
|
|
13
|
+
"1:1": "1:1";
|
|
14
|
+
"3:2": "3:2";
|
|
15
|
+
"4:3": "4:3";
|
|
16
|
+
"21:9": "21:9";
|
|
17
|
+
}>>;
|
|
18
|
+
colorSpace: z.ZodOptional<z.ZodEnum<{
|
|
19
|
+
rec709: "rec709";
|
|
20
|
+
"display-p3": "display-p3";
|
|
21
|
+
rec2020: "rec2020";
|
|
22
|
+
}>>;
|
|
23
|
+
sampleRate: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
48000: "48000";
|
|
25
|
+
44100: "44100";
|
|
26
|
+
96000: "96000";
|
|
27
|
+
}>>;
|
|
28
|
+
channels: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
stereo: "stereo";
|
|
30
|
+
mono: "mono";
|
|
31
|
+
5.1: "5.1";
|
|
32
|
+
}>>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
};
|
|
35
|
+
create_item: {
|
|
36
|
+
description: string;
|
|
37
|
+
parameters: z.ZodObject<{}, z.core.$strict>;
|
|
38
|
+
};
|
|
39
|
+
patch_timeline: {
|
|
40
|
+
description: string;
|
|
41
|
+
parameters: z.ZodObject<{
|
|
42
|
+
baseRevision: z.ZodNumber;
|
|
43
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
44
|
+
op: z.ZodEnum<{
|
|
45
|
+
add: "add";
|
|
46
|
+
replace: "replace";
|
|
47
|
+
remove: "remove";
|
|
48
|
+
set_root: "set_root";
|
|
49
|
+
set_audio: "set_audio";
|
|
50
|
+
}>;
|
|
51
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
52
|
+
item: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
kind: z.ZodNumber;
|
|
55
|
+
}, z.core.$loose>>;
|
|
56
|
+
audio: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
57
|
+
gain: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
}, z.core.$strict>>>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { timelinePatchParameters } from "./schema.js";
|
|
3
|
+
import { projectSettingsUpdateParameters } from "../settings.js";
|
|
4
|
+
export const emptyParameters = z.strictObject({});
|
|
5
|
+
export const editorTools = {
|
|
6
|
+
update_settings: {
|
|
7
|
+
description: "Update project settings when the user requests it. Supply only fields to change; other settings are preserved. When changing canvas format, supply both resolution and its matching aspectRatio. This changes canvas settings, not clip transforms or timing. Returns the updated project context. Settings are saved separately from timeline undo history.",
|
|
8
|
+
parameters: projectSettingsUpdateParameters,
|
|
9
|
+
},
|
|
10
|
+
create_item: {
|
|
11
|
+
description: "Create one opaque ID for a new timeline item. Call this before adding, duplicating, or splitting an item; never invent item IDs.",
|
|
12
|
+
parameters: emptyParameters,
|
|
13
|
+
},
|
|
14
|
+
patch_timeline: {
|
|
15
|
+
description: "Atomically edit the current timeline when the user asks for a change. Use stable item IDs and preserve IDs when replacing complete items. Express timing changes by replacing the item; express reordering or reparenting by replacing the affected containers. Use timelineRevision from the latest supplied project context as baseRevision. After a revision mismatch, rebuild the patch from that context; never guess or increment a revision.",
|
|
16
|
+
parameters: timelinePatchParameters,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Id, TimelineFile } from "@omnimedia/omnitool";
|
|
2
|
+
import type { Settings } from "../settings.js";
|
|
3
|
+
export type MediaInfo = {
|
|
4
|
+
mediaHash: string;
|
|
5
|
+
filename: string;
|
|
6
|
+
type: string;
|
|
7
|
+
duration: number;
|
|
8
|
+
};
|
|
9
|
+
export type AssistantContext = {
|
|
10
|
+
projectId: string;
|
|
11
|
+
settings: Settings;
|
|
12
|
+
media: MediaInfo[];
|
|
13
|
+
kinds: Record<string, number>;
|
|
14
|
+
timeline: TimelineFile;
|
|
15
|
+
timelineRevision: number;
|
|
16
|
+
playhead: number;
|
|
17
|
+
viewedItemId: Id;
|
|
18
|
+
selectedItemId: Id | null;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/x/billing.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const billing: {
|
|
2
|
+
readonly plan: "pro";
|
|
3
|
+
readonly monthlyCredits: 100;
|
|
4
|
+
readonly topUpCredits: 50;
|
|
5
|
+
readonly chatCredits: 1;
|
|
6
|
+
readonly videoCredits: 5;
|
|
7
|
+
readonly maxOutputTokens: 4096;
|
|
8
|
+
};
|
|
9
|
+
export interface BillingStatus {
|
|
10
|
+
active: boolean;
|
|
11
|
+
monthly: number;
|
|
12
|
+
purchased: number;
|
|
13
|
+
periodEnd: string | null;
|
|
14
|
+
cancelAt: string | null;
|
|
15
|
+
}
|
package/x/billing.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AssistantContext, MediaInfo } from "../assistant/types.js";
|
|
2
|
+
import type { TimelinePatch, TimelinePatchResult } from "../timeline.js";
|
|
3
|
+
import type { ProjectSettingsUpdate } from "../settings.js";
|
|
4
|
+
export declare const bridgePort = 3789;
|
|
5
|
+
export type EditorRpc = {
|
|
6
|
+
cancel: (id: string) => Promise<void>;
|
|
7
|
+
create_item: () => Promise<{
|
|
8
|
+
id: string;
|
|
9
|
+
}>;
|
|
10
|
+
read_project_context: () => Promise<AssistantContext>;
|
|
11
|
+
update_settings: (settings: ProjectSettingsUpdate) => Promise<AssistantContext>;
|
|
12
|
+
provide_media: (args: {
|
|
13
|
+
mediaHash: string;
|
|
14
|
+
uploadUrl: string;
|
|
15
|
+
}, id: string) => Promise<MediaInfo>;
|
|
16
|
+
patch_timeline: (patch: TimelinePatch, id: string) => Promise<{
|
|
17
|
+
result: TimelinePatchResult;
|
|
18
|
+
context: AssistantContext;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const bridgePort = 3789;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const projectId: z.ZodCustomStringFormat<"hex">;
|
|
3
|
+
export declare const projectSession: z.ZodObject<{
|
|
4
|
+
projectId: z.ZodCustomStringFormat<"hex">;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type ProjectSession = z.infer<typeof projectSession>;
|
package/x/settings.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const projectSettingsSchema: z.ZodObject<{
|
|
3
|
+
resolution: z.ZodString;
|
|
4
|
+
timebase: z.ZodNumber;
|
|
5
|
+
dropFrame: z.ZodBoolean;
|
|
6
|
+
aspectRatio: z.ZodEnum<{
|
|
7
|
+
"16:9": "16:9";
|
|
8
|
+
"9:16": "9:16";
|
|
9
|
+
"1:1": "1:1";
|
|
10
|
+
"3:2": "3:2";
|
|
11
|
+
"4:3": "4:3";
|
|
12
|
+
"21:9": "21:9";
|
|
13
|
+
}>;
|
|
14
|
+
colorSpace: z.ZodEnum<{
|
|
15
|
+
rec709: "rec709";
|
|
16
|
+
"display-p3": "display-p3";
|
|
17
|
+
rec2020: "rec2020";
|
|
18
|
+
}>;
|
|
19
|
+
sampleRate: z.ZodEnum<{
|
|
20
|
+
48000: "48000";
|
|
21
|
+
44100: "44100";
|
|
22
|
+
96000: "96000";
|
|
23
|
+
}>;
|
|
24
|
+
channels: z.ZodEnum<{
|
|
25
|
+
stereo: "stereo";
|
|
26
|
+
mono: "mono";
|
|
27
|
+
5.1: "5.1";
|
|
28
|
+
}>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export type Settings = z.infer<typeof projectSettingsSchema>;
|
|
31
|
+
export declare const projectSettingsUpdateParameters: z.ZodObject<{
|
|
32
|
+
resolution: z.ZodOptional<z.ZodString>;
|
|
33
|
+
timebase: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
dropFrame: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
aspectRatio: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
"16:9": "16:9";
|
|
37
|
+
"9:16": "9:16";
|
|
38
|
+
"1:1": "1:1";
|
|
39
|
+
"3:2": "3:2";
|
|
40
|
+
"4:3": "4:3";
|
|
41
|
+
"21:9": "21:9";
|
|
42
|
+
}>>;
|
|
43
|
+
colorSpace: z.ZodOptional<z.ZodEnum<{
|
|
44
|
+
rec709: "rec709";
|
|
45
|
+
"display-p3": "display-p3";
|
|
46
|
+
rec2020: "rec2020";
|
|
47
|
+
}>>;
|
|
48
|
+
sampleRate: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
48000: "48000";
|
|
50
|
+
44100: "44100";
|
|
51
|
+
96000: "96000";
|
|
52
|
+
}>>;
|
|
53
|
+
channels: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
stereo: "stereo";
|
|
55
|
+
mono: "mono";
|
|
56
|
+
5.1: "5.1";
|
|
57
|
+
}>>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
export type ProjectSettingsUpdate = z.infer<typeof projectSettingsUpdateParameters>;
|
package/x/settings.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export const projectSettingsSchema = z.strictObject({
|
|
3
|
+
resolution: z.string().regex(/^[1-9]\d*x[1-9]\d*$/).describe("Canvas dimensions in pixels, for example 1920x1080 or 1080x1920."),
|
|
4
|
+
timebase: z.number().positive().describe("Project frame rate in frames per second, for example 23.98, 24, 25, 29.97, 30 or 60."),
|
|
5
|
+
dropFrame: z.boolean(),
|
|
6
|
+
aspectRatio: z.enum(["16:9", "9:16", "1:1", "3:2", "4:3", "21:9"]),
|
|
7
|
+
colorSpace: z.enum(["rec709", "display-p3", "rec2020"]),
|
|
8
|
+
sampleRate: z.enum(["48000", "44100", "96000"]),
|
|
9
|
+
channels: z.enum(["stereo", "mono", "5.1"]),
|
|
10
|
+
});
|
|
11
|
+
export const projectSettingsUpdateParameters = projectSettingsSchema.partial()
|
|
12
|
+
.refine(settings => Object.keys(settings).length > 0, "Provide at least one setting to change.");
|
package/x/timeline.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AudioSettings, Id, Item } from "@omnimedia/omnitool";
|
|
2
|
+
export type TimelineOperation = {
|
|
3
|
+
op: "add";
|
|
4
|
+
item: Item.Any;
|
|
5
|
+
} | {
|
|
6
|
+
op: "replace";
|
|
7
|
+
itemId: Id;
|
|
8
|
+
item: Item.Any;
|
|
9
|
+
} | {
|
|
10
|
+
op: "remove";
|
|
11
|
+
itemId: Id;
|
|
12
|
+
} | {
|
|
13
|
+
op: "set_root";
|
|
14
|
+
itemId: Id;
|
|
15
|
+
} | {
|
|
16
|
+
op: "set_audio";
|
|
17
|
+
audio: AudioSettings | null;
|
|
18
|
+
};
|
|
19
|
+
export type TimelinePatch = {
|
|
20
|
+
baseRevision: number;
|
|
21
|
+
operations: TimelineOperation[];
|
|
22
|
+
};
|
|
23
|
+
export type TimelinePatchResult = {
|
|
24
|
+
success: true;
|
|
25
|
+
revision: number;
|
|
26
|
+
summary: string;
|
|
27
|
+
assistantEditId: string;
|
|
28
|
+
} | {
|
|
29
|
+
success: false;
|
|
30
|
+
error: string;
|
|
31
|
+
};
|
package/x/timeline.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/README.md
DELETED