@omnimedia/omniso 0.1.1-1 → 0.1.1-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/package.json +1 -1
- package/x/assistant/knowledge.d.ts +1 -1
- package/x/assistant/knowledge.js +1 -2
- package/x/assistant/schema.d.ts +44 -0
- package/x/assistant/schema.js +19 -0
- package/x/assistant/tools.d.ts +4 -0
- package/x/assistant/tools.js +13 -1
- package/x/assistant/types.d.ts +4 -19
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
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\nMedia understanding:\n- When source video
|
|
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\nMedia understanding:\n- When source audio or video determines an answer or edit, call provide_media, then inspect_media for every returned part in order. Pass the returned kind, the part path, and a focused question. Video inspection includes sound. Do not infer audible content from filenames or tags.\n- For questions about the whole edit, use inspect_timeline. It inspects both video and audio sources.\n- These tools analyze original sources, without timeline trims, effects, captions, gain, or the final mix. Part start/end offsets are seconds; map part-local timestamps through those offsets and the current timeline's millisecond trim ranges.\n\nGive short, concrete instructions using the names shown in the interface. Use the current project context when relevant. 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
3
|
export declare const assistantInstructions: (context: AssistantContext, skills: string) => string;
|
package/x/assistant/knowledge.js
CHANGED
|
@@ -20,8 +20,7 @@ Main areas:
|
|
|
20
20
|
- Shortcuts in the top bar lists available keyboard controls.
|
|
21
21
|
|
|
22
22
|
Media understanding:
|
|
23
|
-
- When source video
|
|
24
|
-
- For an audio-only source, use provide_selected_audio, then inspect_audio for every returned part in order. Use this for speech, music, and sound effects; do not infer audible content from filenames or tags.
|
|
23
|
+
- When source audio or video determines an answer or edit, call provide_media, then inspect_media for every returned part in order. Pass the returned kind, the part path, and a focused question. Video inspection includes sound. Do not infer audible content from filenames or tags.
|
|
25
24
|
- For questions about the whole edit, use inspect_timeline. It inspects both video and audio sources.
|
|
26
25
|
- These tools analyze original sources, without timeline trims, effects, captions, gain, or the final mix. Part start/end offsets are seconds; map part-local timestamps through those offsets and the current timeline's millisecond trim ranges.
|
|
27
26
|
|
package/x/assistant/schema.d.ts
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import type { TimelineFile } from "@omnimedia/omnitool";
|
|
3
|
+
export declare const assistantContext: z.ZodObject<{
|
|
4
|
+
projectId: z.ZodCustomStringFormat<"hex">;
|
|
5
|
+
settings: z.ZodObject<{
|
|
6
|
+
resolution: z.ZodString;
|
|
7
|
+
timebase: z.ZodNumber;
|
|
8
|
+
dropFrame: z.ZodBoolean;
|
|
9
|
+
aspectRatio: z.ZodEnum<{
|
|
10
|
+
"16:9": "16:9";
|
|
11
|
+
"9:16": "9:16";
|
|
12
|
+
"1:1": "1:1";
|
|
13
|
+
"3:2": "3:2";
|
|
14
|
+
"4:3": "4:3";
|
|
15
|
+
"21:9": "21:9";
|
|
16
|
+
}>;
|
|
17
|
+
colorSpace: z.ZodEnum<{
|
|
18
|
+
rec709: "rec709";
|
|
19
|
+
"display-p3": "display-p3";
|
|
20
|
+
rec2020: "rec2020";
|
|
21
|
+
}>;
|
|
22
|
+
sampleRate: z.ZodEnum<{
|
|
23
|
+
48000: "48000";
|
|
24
|
+
44100: "44100";
|
|
25
|
+
96000: "96000";
|
|
26
|
+
}>;
|
|
27
|
+
channels: z.ZodEnum<{
|
|
28
|
+
stereo: "stereo";
|
|
29
|
+
mono: "mono";
|
|
30
|
+
5.1: "5.1";
|
|
31
|
+
}>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
media: z.ZodArray<z.ZodObject<{
|
|
34
|
+
mediaHash: z.ZodString;
|
|
35
|
+
filename: z.ZodString;
|
|
36
|
+
type: z.ZodString;
|
|
37
|
+
duration: z.ZodNumber;
|
|
38
|
+
}, z.core.$loose>>;
|
|
39
|
+
kinds: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
40
|
+
timeline: z.ZodCustom<TimelineFile, TimelineFile>;
|
|
41
|
+
timelineRevision: z.ZodNumber;
|
|
42
|
+
playhead: z.ZodNumber;
|
|
43
|
+
viewedItemId: z.ZodString;
|
|
44
|
+
selectedItemId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
}, z.core.$loose>;
|
|
2
46
|
export declare const skillCallParameters: z.ZodObject<{
|
|
3
47
|
skill: z.ZodString;
|
|
4
48
|
path: z.ZodString;
|
package/x/assistant/schema.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import { projectId } from "../schemas/session.js";
|
|
3
|
+
import { projectSettingsSchema } from "../settings.js";
|
|
4
|
+
export const assistantContext = z.looseObject({
|
|
5
|
+
projectId,
|
|
6
|
+
settings: projectSettingsSchema,
|
|
7
|
+
media: z.array(z.looseObject({
|
|
8
|
+
mediaHash: z.string(),
|
|
9
|
+
filename: z.string(),
|
|
10
|
+
type: z.string(),
|
|
11
|
+
duration: z.number(),
|
|
12
|
+
})),
|
|
13
|
+
kinds: z.record(z.string(), z.number()),
|
|
14
|
+
// TODO: Use Omnitool timeline schema when available.
|
|
15
|
+
timeline: z.custom(value => typeof value === "object" && value !== null && !Array.isArray(value)),
|
|
16
|
+
timelineRevision: z.number(),
|
|
17
|
+
playhead: z.number(),
|
|
18
|
+
viewedItemId: z.string(),
|
|
19
|
+
selectedItemId: z.string().nullable(),
|
|
20
|
+
});
|
|
2
21
|
const itemIdSchema = z.string().regex(/^[0-9a-f]{32}$/);
|
|
3
22
|
export const skillCallParameters = z.strictObject({
|
|
4
23
|
skill: z.string(),
|
package/x/assistant/tools.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
export declare const emptyParameters: z.ZodObject<{}, z.core.$strict>;
|
|
3
3
|
export declare const editorTools: {
|
|
4
|
+
read_project_context: {
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: z.ZodObject<{}, z.core.$strict>;
|
|
7
|
+
};
|
|
4
8
|
update_settings: {
|
|
5
9
|
description: string;
|
|
6
10
|
parameters: z.ZodObject<{
|
package/x/assistant/tools.js
CHANGED
|
@@ -3,6 +3,10 @@ import { timelinePatchParameters } from "./schema.js";
|
|
|
3
3
|
import { projectSettingsUpdateParameters } from "../settings.js";
|
|
4
4
|
export const emptyParameters = z.strictObject({});
|
|
5
5
|
export const editorTools = {
|
|
6
|
+
read_project_context: {
|
|
7
|
+
description: "Read project settings, the current timeline, revision, selection, playhead, item kinds, and source metadata. Timing values are in milliseconds. Use the returned timelineRevision as baseRevision for timeline patches.",
|
|
8
|
+
parameters: emptyParameters,
|
|
9
|
+
},
|
|
6
10
|
update_settings: {
|
|
7
11
|
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
12
|
parameters: projectSettingsUpdateParameters,
|
|
@@ -12,7 +16,15 @@ export const editorTools = {
|
|
|
12
16
|
parameters: emptyParameters,
|
|
13
17
|
},
|
|
14
18
|
patch_timeline: {
|
|
15
|
-
description:
|
|
19
|
+
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.
|
|
20
|
+
After all operations, every item in the timeline must reference existing items, even items outside the root. When removing an item, also update or remove every item that references it. set_root does not change or remove the old root or its references; reordering operations alone cannot fix a dangling reference.
|
|
21
|
+
Example: replace a gap in a sequence with a new gap. The IDs and revision below are examples only; use the current revision and actual IDs, obtaining new IDs from create_item.
|
|
22
|
+
{"baseRevision":42,"operations":[
|
|
23
|
+
{"op":"add","item":{"id":"00000000000000000000000000000003","kind":5,"duration":1000}},
|
|
24
|
+
{"op":"replace","itemId":"00000000000000000000000000000001","item":{"id":"00000000000000000000000000000001","kind":0,"childrenIds":["00000000000000000000000000000003"]}},
|
|
25
|
+
{"op":"remove","itemId":"00000000000000000000000000000002"}
|
|
26
|
+
]}
|
|
27
|
+
Each example item must be adapted to the current project. For replacements, include the complete existing item with its changes.`,
|
|
16
28
|
parameters: timelinePatchParameters,
|
|
17
29
|
},
|
|
18
30
|
};
|
package/x/assistant/types.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
export type
|
|
4
|
-
|
|
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
|
-
};
|
|
1
|
+
import type * as z from "zod";
|
|
2
|
+
import type { assistantContext } from "./schema.js";
|
|
3
|
+
export type AssistantContext = z.infer<typeof assistantContext>;
|
|
4
|
+
export type MediaInfo = AssistantContext["media"][number];
|