@mengine/medeo-client 2.0.1-alpha.9 → 2.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/dist/schemas.js DELETED
@@ -1,482 +0,0 @@
1
- import { t as __exportAll } from "./chunk-D7D4PA-g.js";
2
- import { a as speechIdSchema, c as timelineMsSchema, i as positiveMsSchema, l as voiceSchema, n as clipIdsSchema, o as speechIdsSchema, r as mediaIdSchema, s as speedShiftSchema, t as clipIdSchema, u as volumeSchema } from "./shared-iWnU2osE.js";
3
- import { z } from "zod";
4
- //#region src/editor/schemas/speech-assets.ts
5
- /**
6
- * The materialized TTS result shared by `AddSpeeches` / `ChangeSpeechScript` /
7
- * `ChangeSpeechVoice` (see `results/phase-4-side-effect-payload-contract.md`
8
- * §1/§2). The side effect (TTS/ASR + billing) runs upstream; the op receives the
9
- * stable speech + caption parts and writes them as authoritative facts. No
10
- * cascade runs on write — the projection derives absolute positions on read.
11
- *
12
- * Each speech carries the anchoring fact directly (RFC 02 §4): the host video
13
- * clip `anchor_part_id` and the `offset_ms` within it. The upstream caller
14
- * already knows which clip a speech attaches to, so the op writes
15
- * `{ mode:'anchored', anchorPartId, offsetMs }` verbatim — no write-time
16
- * host-picking. Captions anchor to their speech via the caption part's
17
- * `start_ms` (offset within the speech).
18
- */
19
- const speechAssetSchema = z.object({
20
- speech_id: speechIdSchema.describe("The speech part ID (= side-effect speech_parts[].id)"),
21
- anchor_part_id: clipIdSchema.describe("Host video clip part ID the speech anchors to (RFC 02 §4)"),
22
- offset_ms: timelineMsSchema.describe("Offset within the host clip (speech.abs = host.abs + offset_ms)"),
23
- audio_storage_key: z.string().min(1),
24
- duration_ms: positiveMsSchema,
25
- audio_script: z.string(),
26
- volume: volumeSchema,
27
- voice: voiceSchema,
28
- origin_speech_id: z.string().min(1),
29
- caption_ids: z.array(z.string().min(1)).describe("Caption part IDs owned by this speech")
30
- });
31
- const captionAssetSchema = z.object({
32
- caption_id: z.string().min(1).describe("The caption part ID (= side-effect created_caption_parts[].id)"),
33
- speech_part_id: speechIdSchema.describe("The owning speech part ID"),
34
- text: z.string(),
35
- start_ms: timelineMsSchema.describe("Offset within the host speech (caption.abs = speech.abs + start_ms)"),
36
- duration_ms: positiveMsSchema
37
- });
38
- /** A materialized speech-subtree write (speeches + their captions). */
39
- const speechAssetsSchema = z.object({
40
- speeches: z.array(speechAssetSchema).min(1).describe("Materialized speech parts to write"),
41
- captions: z.array(captionAssetSchema).describe("Materialized caption parts owned by the speeches")
42
- });
43
- //#endregion
44
- //#region src/editor/schemas/add-speeches.ts
45
- /**
46
- * Add speeches (and their captions). TTS runs upstream; the stable speech /
47
- * caption parts arrive materialized (see `speech-assets.ts`). The op writes the
48
- * parts and each speech's `{ mode:'anchored', anchorPartId, offsetMs }` fact
49
- * verbatim — no write-time host-picking, no cascade (RFC 02 §4). The projection
50
- * derives absolute positions on read.
51
- */
52
- const addSpeechesInputSchema = speechAssetsSchema.describe("Materialized speeches + captions to add");
53
- //#endregion
54
- //#region src/editor/schemas/add-video-clips.ts
55
- /**
56
- * Add video clips to a track. Each clip's duration facts are separated so a
57
- * single number is never overloaded (RFC 02 / `reference/16` §0b):
58
- *
59
- * - `media_duration_ms` is the source media's intrinsic full length (a resource
60
- * fact, written to the part);
61
- * - `play_in` / `play_out` are the optional trim window into that media; when
62
- * omitted the whole media is used (`play_in=0`, `play_out=media_duration_ms`).
63
- *
64
- * The clip's effective timeline duration is derived by the projection from the
65
- * trim window and `speed_shift` — it is never an input here.
66
- */
67
- const addVideoClipsInputSchema = z.object({
68
- clips: z.array(z.object({
69
- media_id: mediaIdSchema.describe("The media asset ID for the video clip"),
70
- start_ms: timelineMsSchema.optional().describe("Absolute start time in milliseconds on the timeline"),
71
- media_duration_ms: positiveMsSchema.describe("The source media's intrinsic full length in ms"),
72
- play_in: timelineMsSchema.optional().describe("Trim window start in the media (default 0)"),
73
- play_out: positiveMsSchema.optional().describe("Trim window end in the media (default media_duration_ms)"),
74
- track_id: z.string().min(1).optional().describe("Target track ID (optional, defaults to main track)")
75
- })).min(1).describe("List of video clips to create"),
76
- before_clip_id: z.string().min(1).optional().describe("Insert new clips before this clip ID"),
77
- after_clip_id: z.string().min(1).optional().describe("Insert new clips after this clip ID")
78
- }).superRefine((data, ctx) => {
79
- if (data.before_clip_id != null && data.after_clip_id != null) {
80
- ctx.addIssue({
81
- code: z.ZodIssueCode.custom,
82
- message: "Cannot provide both before_clip_id and after_clip_id"
83
- });
84
- return;
85
- }
86
- const hasRelative = data.before_clip_id != null || data.after_clip_id != null;
87
- for (let i = 0; i < data.clips.length; i++) {
88
- const clip = data.clips[i];
89
- if (hasRelative && clip.start_ms != null) ctx.addIssue({
90
- code: z.ZodIssueCode.custom,
91
- message: `clips[${i}].start_ms must not be provided when using before_clip_id or after_clip_id`,
92
- path: [
93
- "clips",
94
- i,
95
- "start_ms"
96
- ]
97
- });
98
- if (!hasRelative && clip.start_ms == null) ctx.addIssue({
99
- code: z.ZodIssueCode.custom,
100
- message: `clips[${i}].start_ms is required when not using relative positioning`,
101
- path: [
102
- "clips",
103
- i,
104
- "start_ms"
105
- ]
106
- });
107
- const playIn = clip.play_in ?? 0;
108
- const playOut = clip.play_out ?? clip.media_duration_ms;
109
- if (playOut > clip.media_duration_ms) ctx.addIssue({
110
- code: z.ZodIssueCode.custom,
111
- message: `clips[${i}].play_out ${playOut}ms exceeds media_duration_ms ${clip.media_duration_ms}ms`,
112
- path: [
113
- "clips",
114
- i,
115
- "play_out"
116
- ]
117
- });
118
- if (playIn >= playOut) ctx.addIssue({
119
- code: z.ZodIssueCode.custom,
120
- message: `clips[${i}].play_in ${playIn}ms must be less than play_out ${playOut}ms`,
121
- path: [
122
- "clips",
123
- i,
124
- "play_in"
125
- ]
126
- });
127
- }
128
- });
129
- //#endregion
130
- //#region src/editor/schemas/adjust-bgm-volume.ts
131
- const adjustBgmVolumeInputSchema = z.object({ bgm: z.array(z.object({
132
- bgm_id: clipIdSchema.describe("The bgm part ID to adjust volume for"),
133
- volume: volumeSchema.describe("Volume in decibels (-60.0 to 20.0; 0.0 = original)")
134
- })).min(1).describe("List of bgm parts with their new volume settings") });
135
- //#endregion
136
- //#region src/editor/schemas/adjust-speech-volume.ts
137
- const adjustSpeechVolumeInputSchema = z.object({ speeches: z.array(z.object({
138
- speech_id: speechIdSchema.describe("The speech part ID to adjust volume for"),
139
- volume: volumeSchema.describe("Volume in decibels (-60.0 to 20.0; 0.0 = original)")
140
- })).min(1).describe("List of speeches with their new volume settings") });
141
- //#endregion
142
- //#region src/editor/schemas/adjust-video-clip-duration.ts
143
- /**
144
- * Re-trim existing video clips (the user-facing "adjust duration" gesture is a
145
- * trim of the source window). The new `play_in` / `play_out` are the facts; the
146
- * effective timeline duration is derived from them and the clip's `speed_shift`,
147
- * and the change reflows downstream clips, speeches, and the timeline inside the
148
- * op's transaction (no caller-materialized cascade).
149
- */
150
- const adjustVideoClipDurationInputSchema = z.object({ clips: z.array(z.object({
151
- clip_id: clipIdSchema.describe("The video clip part ID to re-trim"),
152
- play_in: timelineMsSchema.describe("New trim window start in the source media"),
153
- play_out: positiveMsSchema.describe("New trim window end in the source media")
154
- })).min(1).describe("Video clips with their new trim windows") });
155
- //#endregion
156
- //#region src/editor/schemas/adjust-video-clip-volume.ts
157
- const adjustVideoClipVolumeInputSchema = z.object({ clips: z.array(z.object({
158
- clip_id: clipIdSchema.describe("The video clip part ID to adjust volume for"),
159
- volume: volumeSchema.describe("Volume in decibels (-60.0 to 20.0; 0.0 = original)")
160
- })).min(1).describe("List of video clips with their new volume settings") });
161
- //#endregion
162
- //#region src/editor/schemas/change-speech.ts
163
- /**
164
- * Change a speech's script or voice. Both re-run TTS upstream and return the
165
- * regenerated speech / caption parts in the same materialized shape as
166
- * `AddSpeeches` (`speech-assets.ts`); the op upserts them by id (the speech part
167
- * id is preserved across a re-TTS), re-seats at `start_ms`, and reflows. Old
168
- * caption parts no longer owned by the speech are removed via `caption_ids`.
169
- */
170
- const changeSpeechScriptInputSchema = speechAssetsSchema.describe("Regenerated speeches + captions (new script)");
171
- const changeSpeechVoiceInputSchema = speechAssetsSchema.describe("Regenerated speeches + captions (new voice)");
172
- //#endregion
173
- //#region src/editor/schemas/delete-bgm.ts
174
- /**
175
- * Remove the document BGM. Pure document edit: clears the bgm lane and removes
176
- * the bgm part. Takes no input (a document holds at most one bgm); an empty
177
- * object keeps the op signature uniform with the rest.
178
- */
179
- const deleteBgmInputSchema = z.object({}).describe("Remove the document BGM (no parameters)");
180
- //#endregion
181
- //#region src/editor/schemas/delete-speeches.ts
182
- /**
183
- * Delete speeches with their captions. Pure document edit (no side effect): the
184
- * op removes each speech part, cascade-deletes the captions it owns (via
185
- * `caption_ids` / `speech_part_id`), drops their track items, and reflows.
186
- */
187
- const deleteSpeechesInputSchema = z.object({ speech_ids: speechIdsSchema.describe("Speech part IDs to delete (their captions cascade-delete)") });
188
- //#endregion
189
- //#region src/editor/schemas/delete-video-clips.ts
190
- /**
191
- * How a delete handles the anchored subtree (speeches anchored to a deleted clip,
192
- * and their captions) — a delete-op policy, not a data-model field (reference/17
193
- * §6). `cascade` (default) removes the subtree; `detach` keeps the direct
194
- * anchored children, re-pinning them to `absolute` so they stay on the timeline.
195
- */
196
- const anchoredDeletePolicySchema = z.enum(["cascade", "detach"]);
197
- const deleteVideoClipsInputSchema = z.object({
198
- clip_ids: clipIdsSchema.describe("List of video clip part IDs to delete from the main track"),
199
- on_anchored: anchoredDeletePolicySchema.optional().describe("How to treat anchored children (default cascade)")
200
- });
201
- //#endregion
202
- //#region src/editor/schemas/move-speeches.ts
203
- /**
204
- * Move speeches in time. Pure document edit: the op re-seats each speech at its
205
- * new absolute `start_ms`; the cascade reassigns it to the host video clip,
206
- * resolves overlaps, and reflows. Captions follow their speech.
207
- */
208
- const moveSpeechesInputSchema = z.object({ speeches: z.array(z.object({
209
- speech_id: speechIdSchema.describe("The speech part ID to move"),
210
- new_start_ms: timelineMsSchema.describe("New absolute start time on the timeline")
211
- })).min(1).describe("Speeches to move to new positions") });
212
- //#endregion
213
- //#region src/editor/schemas/move-video-clips-by-anchor.ts
214
- /**
215
- * Where the moved block lands on the main track.
216
- *
217
- * A discriminated union rather than two optional `before_clip_id` /
218
- * `after_clip_id` fields (the shape `addVideoClips` had to use, because there the
219
- * two modes share a whole clip description): here the alternatives carry nothing
220
- * in common, so making them mutually exclusive *by type* removes three runtime
221
- * `superRefine` checks that would otherwise have to be written and tested.
222
- *
223
- * `track_start` is an explicit member, not the absence of an anchor. The
224
- * agent-harness mutation this maps from treats "neither anchor given" as
225
- * "move to the front" (`applyBatchMoveVideoClips` falls back to `insertIndex = 0`),
226
- * which is a default buried in a tool description. Requiring the caller to name
227
- * that intent keeps a forgotten field from silently reordering the timeline.
228
- */
229
- const moveAnchorSchema = z.discriminatedUnion("position", [
230
- z.object({
231
- position: z.literal("before"),
232
- clip_id: clipIdSchema.describe("The moved block lands immediately before this clip")
233
- }),
234
- z.object({
235
- position: z.literal("after"),
236
- clip_id: clipIdSchema.describe("The moved block lands immediately after this clip")
237
- }),
238
- z.object({ position: z.literal("track_start") })
239
- ]).describe("Where the moved block lands: before/after a reference clip, or at the head of the track");
240
- /**
241
- * What happens to the speeches anchored to the clips being moved.
242
- *
243
- * - `follow` keeps each speech anchored where it is, so it travels with its clip
244
- * to the new position. In the anchored model this is the *no-op* branch: a
245
- * speech's authoritative fact is `{ anchorPartId, offsetMs }` and its absolute
246
- * time is derived on read from the host's position, so moving the host moves
247
- * the speech with no write to the speech at all.
248
- * - `keep_absolute` preserves each speech's current absolute landing instead, then
249
- * re-anchors it to whichever clip now covers that time (RFC 02 §9.1/§11.1). This
250
- * is the branch that costs an extra pass, and the one the FE timeline uses.
251
- *
252
- * **Required, with no default**, matching `deleteVideoClips` and
253
- * `replaceVideoClipSequence`. The two branches decide which picture the user's
254
- * narration ends up over, which is too consequential to infer from a missing
255
- * field — and neither branch is "safe enough" to be the implicit one.
256
- */
257
- const movedClipAnchoredPolicySchema = z.enum(["follow", "keep_absolute"]);
258
- /**
259
- * Reorder a set of main-track clips relative to a reference clip.
260
- *
261
- * Distinct from `moveVideoClips`, which positions clips by absolute time
262
- * (`new_start_ms`) and is what the FE timeline dispatches after a drag. Main-track
263
- * clips are `sequential`-positioned, so absolute time is not authoritative state
264
- * there (RFC 02 §4/§7): `moveVideoClips` has to *guess* an index back out of the
265
- * time it was handed, whereas an anchor already is the ordinal fact being changed.
266
- * Keeping them separate also isolates blast radius — this method can diverge on
267
- * speech policy without touching the FE path.
268
- *
269
- * `clip_ids` need not be contiguous. They move as one block, keeping their
270
- * relative order, which is the agent-harness `batch_move_video_clips` contract.
271
- */
272
- const moveVideoClipsByAnchorInputSchema = z.object({
273
- clip_ids: clipIdsSchema.describe("Clips to move as one block, keeping their relative order. Need not be contiguous on the track."),
274
- anchor: moveAnchorSchema,
275
- on_anchored: movedClipAnchoredPolicySchema.describe("What happens to speeches anchored to the moved clips (required — see the policy doc)")
276
- });
277
- //#endregion
278
- //#region src/editor/schemas/move-video-clips.ts
279
- const moveVideoClipsInputSchema = z.object({ clips: z.array(z.object({
280
- clip_id: clipIdSchema.describe("The video clip part ID to move"),
281
- new_start_ms: timelineMsSchema.describe("New absolute start time in milliseconds on the timeline"),
282
- new_track_id: z.string().min(1).optional().describe("Target track ID to move the clip to (optional)")
283
- })).min(1).describe("List of video clips to move to new positions") });
284
- //#endregion
285
- //#region src/editor/schemas/replace-video-clip-content.ts
286
- /**
287
- * Replace the media backing existing video clips. The media import runs upstream
288
- * (Director); its stable result — the new media id, intrinsic length, and the
289
- * reset trim window — arrives materialized (see
290
- * `results/phase-4-side-effect-payload-contract.md` §4). Director resets
291
- * `play_in=0` / `play_out=media_duration_ms` and clears `speed_shift` on
292
- * replacement. The clip `part_id`s (hence their track items) are unchanged; the
293
- * editor reflows the main track from the new effective durations.
294
- */
295
- const replaceVideoClipContentInputSchema = z.object({ clips: z.array(z.object({
296
- clip_id: clipIdSchema.describe("Existing video clip part ID to re-point"),
297
- origin_media_id: mediaIdSchema.describe("The new media asset ID"),
298
- media_duration_ms: positiveMsSchema.describe("The new media's intrinsic full length"),
299
- play_in: timelineMsSchema.describe("Trim window start in the new media (usually 0)"),
300
- play_out: positiveMsSchema.describe("Trim window end in the new media (usually = media_duration_ms)"),
301
- volume: volumeSchema
302
- })).min(1).describe("Video clips whose media is being replaced") });
303
- //#endregion
304
- //#region src/editor/schemas/replace-video-clip-sequence.ts
305
- /**
306
- * What happens to the speeches anchored to the clips being replaced.
307
- *
308
- * - `remap` re-anchors each surviving speech to the new clip in the SAME POSITION
309
- * of the sequence, keeping its offset — old[i]'s children become new[i]'s
310
- * children. An old clip with no counterpart (fewer new clips than old) has its
311
- * subtree deleted, because there is nothing left to anchor to.
312
- * - `cascade` deletes every anchored speech (and its captions) outright, like
313
- * `deleteVideoClips`.
314
- *
315
- * **Required, with no default.** The two branches differ in whether the user's
316
- * narration survives, and the agent tool that drives this op makes its
317
- * `preserve_speeches` flag required for that reason. A default here would let a
318
- * caller that forgot the field silently delete speech.
319
- */
320
- const anchoredReplacePolicySchema = z.enum(["remap", "cascade"]);
321
- /**
322
- * Replace a contiguous run of main-track clips with a new run.
323
- *
324
- * A composite of delete + insert that cannot be expressed as the two ops in
325
- * sequence, because the anchored speeches have to survive *across* the swap: with
326
- * `remap` they are re-anchored positionally, which needs both the old and the new
327
- * ids in the same transaction (ADR 0009 — the cascade stays in the editor, callers
328
- * never re-wire anchors themselves).
329
- *
330
- * Duration facts follow `addVideoClips`: `media_duration_ms` is the source's
331
- * intrinsic length and the trim window defaults to the whole media. The effective
332
- * timeline duration is derived by the projection, never an input.
333
- *
334
- * `media_id` is optional: omitting it creates a **deliberate empty placeholder
335
- * clip** (`origin_media_id: ''`) — structure with no picture. This is the only op
336
- * that can produce one, and it is authoritative state, unlike the gap fillers the
337
- * read-side solve mints (which never enter the document).
338
- */
339
- const replaceVideoClipSequenceInputSchema = z.object({
340
- old_clip_ids: clipIdsSchema.describe("The clips being replaced: a contiguous main-track run, listed in timeline order"),
341
- new_clips: z.array(z.object({
342
- media_id: mediaIdSchema.optional().describe("The replacement media asset ID. Omit to create an empty placeholder clip."),
343
- media_duration_ms: positiveMsSchema.describe("The source media's intrinsic full length in ms"),
344
- play_in: timelineMsSchema.optional().describe("Trim window start in the media (default 0)"),
345
- play_out: positiveMsSchema.optional().describe("Trim window end in the media (default media_duration_ms)")
346
- })).min(1).describe("The replacement clips, in the order they take on the track"),
347
- on_anchored: anchoredReplacePolicySchema.describe("What happens to speeches anchored to the replaced clips (required — see the policy doc)")
348
- }).superRefine((data, ctx) => {
349
- for (let i = 0; i < data.new_clips.length; i++) {
350
- const clip = data.new_clips[i];
351
- const playIn = clip.play_in ?? 0;
352
- const playOut = clip.play_out ?? clip.media_duration_ms;
353
- if (playOut > clip.media_duration_ms) ctx.addIssue({
354
- code: z.ZodIssueCode.custom,
355
- message: `new_clips[${i}].play_out ${playOut}ms exceeds media_duration_ms ${clip.media_duration_ms}ms`,
356
- path: [
357
- "new_clips",
358
- i,
359
- "play_out"
360
- ]
361
- });
362
- if (playIn >= playOut) ctx.addIssue({
363
- code: z.ZodIssueCode.custom,
364
- message: `new_clips[${i}].play_in ${playIn}ms must be less than play_out ${playOut}ms`,
365
- path: [
366
- "new_clips",
367
- i,
368
- "play_in"
369
- ]
370
- });
371
- }
372
- });
373
- //#endregion
374
- //#region src/editor/schemas/set-bgm.ts
375
- /**
376
- * Set the document BGM. The media's stable result (storage key) arrives
377
- * materialized from upstream (see
378
- * `results/phase-4-side-effect-payload-contract.md` §3). The op upserts the bgm
379
- * part and seats it on the bgm lane; its effective length is always the whole
380
- * timeline, derived by the projection on read — so there is no `duration_ms`
381
- * input or fact (RFC 02 / `reference/16` §0b). A `bgm_id` lets the op replace an
382
- * existing bgm part by id.
383
- */
384
- const setBgmInputSchema = z.object({
385
- bgm_id: z.string().min(1).describe("The bgm part ID to write"),
386
- audio_storage_key: z.string().min(1),
387
- origin_media_id: mediaIdSchema,
388
- volume: volumeSchema
389
- });
390
- //#endregion
391
- //#region src/editor/schemas/set-caption-style.ts
392
- /**
393
- * Set the caption visual style. GLOBAL by design: the style applies to every
394
- * caption part in the document — it carries NO `caption_id`. This mirrors the FE,
395
- * whose caption-style store (`caption-style.ts:persistCaptionStylePatch`) iterates
396
- * ALL captions and writes the same normalized style to each; the product has a
397
- * single document-wide caption style, not per-caption styling.
398
- *
399
- * Every field is optional and maps to a `CaptionStyle` attribute (snake_case
400
- * IDL). A field present in the input is written to every caption; a field ABSENT
401
- * from the input is left untouched on each caption (the editor merges the patch
402
- * onto each caption's existing style — this is a value edit, not a full-style
403
- * replace, so a partial patch such as "recolor only" does not wipe font size).
404
- *
405
- * Pure document edit, no cascade — captions keep their positions; only the style
406
- * sub-map of each caption part changes.
407
- */
408
- const setCaptionStyleInputSchema = z.object({
409
- font_id: z.string().min(1).optional().describe("Font ID referencing a font from the font library"),
410
- font_size: z.number().positive().optional().describe("Font size in points"),
411
- font_color: z.string().min(1).optional().describe("Font color as hex string, e.g. \"#FFFFFF\""),
412
- font_weight: z.number().int().optional().describe("Numeric font weight, e.g. 400 or 700"),
413
- entrance_animation: z.string().optional().describe("Entrance animation preset ID, e.g. \"fade\" or \"none\""),
414
- entrance_animation_duration_ms: z.number().min(0).optional().describe("Entrance animation duration in ms"),
415
- stroke_color: z.string().min(1).optional().describe("Outline/stroke color as hex string, e.g. \"#000000\""),
416
- stroke_width: z.number().min(0).optional().describe("Outline/stroke width in pixels"),
417
- position_x: z.number().optional().describe("Caption center X as a fraction (0.0 to 1.0)"),
418
- position_y: z.number().optional().describe("Caption center Y as a fraction (0.0 to 1.0)")
419
- }).describe("Document-wide caption style patch (no caption_id; applies to every caption)");
420
- //#endregion
421
- //#region src/editor/schemas/set-caption-visibility.ts
422
- /**
423
- * Toggle caption visibility (the caption track's `is_hidden` flag). Pure
424
- * document edit, no cascade — captions keep their positions; only the lane's
425
- * hidden flag changes.
426
- */
427
- const setCaptionVisibilityInputSchema = z.object({ is_hidden: z.boolean().describe("Whether the caption track is hidden") });
428
- //#endregion
429
- //#region src/editor/schemas/set-video-clip-speed-shift.ts
430
- /**
431
- * Set the playback speed of existing video clips. Per the speed-shift decision
432
- * (`reference/16` §0): the op writes only the `speed_shift` fact — it does NOT
433
- * store an effective `duration_ms` (projection derives it from the trim window /
434
- * speed) and does NOT scale anchored speeches' relative offsets (offsets stay
435
- * put; the cascade reflows absolute positions). A `null` speed_shift clears the
436
- * speed back to original (1×).
437
- */
438
- const setVideoClipSpeedShiftInputSchema = z.object({ clips: z.array(z.object({
439
- clip_id: clipIdSchema.describe("The video clip part ID to set speed for"),
440
- speed_shift: speedShiftSchema.nullable().describe("The new speed setting, or null to reset to 1×")
441
- })).min(1).describe("Video clips with their new speed settings") });
442
- //#endregion
443
- //#region src/editor/schemas/index.ts
444
- var schemas_exports = /* @__PURE__ */ __exportAll({
445
- addSpeechesInputSchema: () => addSpeechesInputSchema,
446
- addVideoClipsInputSchema: () => addVideoClipsInputSchema,
447
- adjustBgmVolumeInputSchema: () => adjustBgmVolumeInputSchema,
448
- adjustSpeechVolumeInputSchema: () => adjustSpeechVolumeInputSchema,
449
- adjustVideoClipDurationInputSchema: () => adjustVideoClipDurationInputSchema,
450
- adjustVideoClipVolumeInputSchema: () => adjustVideoClipVolumeInputSchema,
451
- anchoredDeletePolicySchema: () => anchoredDeletePolicySchema,
452
- anchoredReplacePolicySchema: () => anchoredReplacePolicySchema,
453
- changeSpeechScriptInputSchema: () => changeSpeechScriptInputSchema,
454
- changeSpeechVoiceInputSchema: () => changeSpeechVoiceInputSchema,
455
- clipIdSchema: () => clipIdSchema,
456
- clipIdsSchema: () => clipIdsSchema,
457
- deleteBgmInputSchema: () => deleteBgmInputSchema,
458
- deleteSpeechesInputSchema: () => deleteSpeechesInputSchema,
459
- deleteVideoClipsInputSchema: () => deleteVideoClipsInputSchema,
460
- mediaIdSchema: () => mediaIdSchema,
461
- moveAnchorSchema: () => moveAnchorSchema,
462
- moveSpeechesInputSchema: () => moveSpeechesInputSchema,
463
- moveVideoClipsByAnchorInputSchema: () => moveVideoClipsByAnchorInputSchema,
464
- moveVideoClipsInputSchema: () => moveVideoClipsInputSchema,
465
- movedClipAnchoredPolicySchema: () => movedClipAnchoredPolicySchema,
466
- positiveMsSchema: () => positiveMsSchema,
467
- replaceVideoClipContentInputSchema: () => replaceVideoClipContentInputSchema,
468
- replaceVideoClipSequenceInputSchema: () => replaceVideoClipSequenceInputSchema,
469
- setBgmInputSchema: () => setBgmInputSchema,
470
- setCaptionStyleInputSchema: () => setCaptionStyleInputSchema,
471
- setCaptionVisibilityInputSchema: () => setCaptionVisibilityInputSchema,
472
- setVideoClipSpeedShiftInputSchema: () => setVideoClipSpeedShiftInputSchema,
473
- speechAssetsSchema: () => speechAssetsSchema,
474
- speechIdSchema: () => speechIdSchema,
475
- speechIdsSchema: () => speechIdsSchema,
476
- speedShiftSchema: () => speedShiftSchema,
477
- timelineMsSchema: () => timelineMsSchema,
478
- voiceSchema: () => voiceSchema,
479
- volumeSchema: () => volumeSchema
480
- });
481
- //#endregion
482
- export { addSpeechesInputSchema, addVideoClipsInputSchema, adjustBgmVolumeInputSchema, adjustSpeechVolumeInputSchema, adjustVideoClipDurationInputSchema, adjustVideoClipVolumeInputSchema, anchoredDeletePolicySchema, anchoredReplacePolicySchema, changeSpeechScriptInputSchema, changeSpeechVoiceInputSchema, clipIdSchema, clipIdsSchema, deleteBgmInputSchema, deleteSpeechesInputSchema, deleteVideoClipsInputSchema, mediaIdSchema, moveAnchorSchema, moveSpeechesInputSchema, moveVideoClipsByAnchorInputSchema, moveVideoClipsInputSchema, movedClipAnchoredPolicySchema, positiveMsSchema, replaceVideoClipContentInputSchema, replaceVideoClipSequenceInputSchema, setBgmInputSchema, setCaptionStyleInputSchema, setCaptionVisibilityInputSchema, setVideoClipSpeedShiftInputSchema, speechAssetsSchema, speechIdSchema, speechIdsSchema, speedShiftSchema, schemas_exports as t, timelineMsSchema, voiceSchema, volumeSchema };
@@ -1,39 +0,0 @@
1
- import { z } from "zod";
2
- //#region src/editor/schemas/shared.ts
3
- const clipIdSchema = z.string().min(1).describe("The clip part ID on the timeline");
4
- const clipIdsSchema = z.array(clipIdSchema).min(1).refine((ids) => new Set(ids).size === ids.length, { message: "Duplicate clip IDs are not allowed" }).describe("List of clip part IDs (no duplicates allowed)");
5
- const mediaIdSchema = z.string().min(1).describe("The media asset ID");
6
- const speechIdSchema = z.string().min(1).describe("The speech part ID on the timeline");
7
- const timelineMsSchema = z.number().int().min(0).describe("Time position in milliseconds on the timeline (>= 0)");
8
- const positiveMsSchema = z.number().int().positive().describe("Duration in milliseconds (> 0)");
9
- const volumeSchema = z.number().min(-60).max(20).describe("Volume in decibels (-60.0 to 20.0; 0.0 = original, -60 = mute, +20 = max)");
10
- const speechIdsSchema = z.array(speechIdSchema).min(1).refine((ids) => new Set(ids).size === ids.length, { message: "Duplicate speech IDs are not allowed" }).describe("List of speech part IDs (no duplicates allowed)");
11
- const tangentHandleSchema = z.object({
12
- x: z.number().finite(),
13
- y: z.number().finite()
14
- }).describe("Bezier tangent handle (x, y)");
15
- const speedKeyframeSchema = z.object({
16
- position: z.number().min(0).max(1),
17
- rate: z.number().min(0),
18
- in_tangent: tangentHandleSchema.optional(),
19
- out_tangent: tangentHandleSchema.optional()
20
- }).describe("A speed keyframe: normalized position (0..1), rate, optional tangents");
21
- /**
22
- * A clip's playback-speed fact, the only thing `SetVideoClipSpeedShift` writes.
23
- * Mirrors the IDL `SpeedShift`: `category` is `linear` | `curve`, and `config`
24
- * is a discriminated union — `{ linear: { speed } }` for a constant multiplier
25
- * (the multiplier projection reads at `config.linear.speed`) or `{ curve: {
26
- * keyframes } }` for a Bezier-controlled variable speed (RFC 02 / `reference/16`
27
- * §0). Exactly one of `linear` / `curve` is present.
28
- */
29
- const speedShiftSchema = z.object({
30
- category: z.enum(["linear", "curve"]),
31
- mode: z.string(),
32
- config: z.union([z.object({ linear: z.object({ speed: z.number().finite().positive() }) }), z.object({ curve: z.object({ keyframes: z.array(speedKeyframeSchema).min(2) }) })])
33
- }).describe("Speed shift: linear multiplier or Bezier curve, mirroring the IDL shape");
34
- const voiceSchema = z.object({
35
- id: z.string().min(1),
36
- name: z.string()
37
- }).describe("TTS voice summary attached to a speech");
38
- //#endregion
39
- export { speechIdSchema as a, timelineMsSchema as c, positiveMsSchema as i, voiceSchema as l, clipIdsSchema as n, speechIdsSchema as o, mediaIdSchema as r, speedShiftSchema as s, clipIdSchema as t, volumeSchema as u };