@mengine/medeo-client 2.1.1-dsl.24 → 2.1.1-dsl.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/{dsl-Bvv_51Ns.js → dsl-SmWJTQWV.js} +2119 -5
- package/dist/dsl.d.ts +1 -2
- package/dist/dsl.js +1 -2
- package/dist/{index-CmuDB_Gm.d.ts → index-B1Lqm_Z1.d.ts} +883 -5
- package/dist/{index-BOgr8p8C.d.ts → index-pULoWyd9.d.ts} +199 -2
- package/dist/index.d.ts +2 -4
- package/dist/index.js +803 -4
- package/dist/schemas.d.ts +21 -21
- package/dist/schemas.js +57 -21
- package/dist/testing.d.ts +1 -4
- package/dist/testing.js +27 -40
- package/package.json +7 -8
- package/dist/index-BGEcTwoD.d.ts +0 -202
- package/dist/legacy.d.ts +0 -1044
- package/dist/legacy.js +0 -4349
- package/dist/shared-iWnU2osE.js +0 -39
- package/dist/storage-evqvKS4B.js +0 -805
- package/dist/video-draft-types-DRGBN0we.js +0 -1551
- package/dist/video-draft-types-slnHaNs9.d.ts +0 -882
package/dist/schemas.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
//#region src/
|
|
3
|
+
//#region src/schemas/add-speeches.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Add speeches (and their captions). TTS runs upstream; the stable speech /
|
|
6
6
|
* caption parts arrive materialized (see `speech-assets.ts`). The op writes the
|
|
@@ -34,7 +34,7 @@ declare const addSpeechesInputSchema: z.ZodObject<{
|
|
|
34
34
|
}, z.core.$strip>;
|
|
35
35
|
type AddSpeechesInput = z.infer<typeof addSpeechesInputSchema>;
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region src/
|
|
37
|
+
//#region src/schemas/add-video-clips.d.ts
|
|
38
38
|
/**
|
|
39
39
|
* Add video clips to a track. Each clip's duration facts are separated so a
|
|
40
40
|
* single number is never overloaded (RFC 02 / `reference/16` §0b):
|
|
@@ -61,7 +61,7 @@ declare const addVideoClipsInputSchema: z.ZodObject<{
|
|
|
61
61
|
}, z.core.$strip>;
|
|
62
62
|
type AddVideoClipsInput = z.infer<typeof addVideoClipsInputSchema>;
|
|
63
63
|
//#endregion
|
|
64
|
-
//#region src/
|
|
64
|
+
//#region src/schemas/adjust-bgm-volume.d.ts
|
|
65
65
|
declare const adjustBgmVolumeInputSchema: z.ZodObject<{
|
|
66
66
|
bgm: z.ZodArray<z.ZodObject<{
|
|
67
67
|
bgm_id: z.ZodString;
|
|
@@ -70,7 +70,7 @@ declare const adjustBgmVolumeInputSchema: z.ZodObject<{
|
|
|
70
70
|
}, z.core.$strip>;
|
|
71
71
|
type AdjustBgmVolumeInput = z.infer<typeof adjustBgmVolumeInputSchema>;
|
|
72
72
|
//#endregion
|
|
73
|
-
//#region src/
|
|
73
|
+
//#region src/schemas/adjust-speech-volume.d.ts
|
|
74
74
|
declare const adjustSpeechVolumeInputSchema: z.ZodObject<{
|
|
75
75
|
speeches: z.ZodArray<z.ZodObject<{
|
|
76
76
|
speech_id: z.ZodString;
|
|
@@ -79,7 +79,7 @@ declare const adjustSpeechVolumeInputSchema: z.ZodObject<{
|
|
|
79
79
|
}, z.core.$strip>;
|
|
80
80
|
type AdjustSpeechVolumeInput = z.infer<typeof adjustSpeechVolumeInputSchema>;
|
|
81
81
|
//#endregion
|
|
82
|
-
//#region src/
|
|
82
|
+
//#region src/schemas/adjust-video-clip-duration.d.ts
|
|
83
83
|
/**
|
|
84
84
|
* Re-trim existing video clips (the user-facing "adjust duration" gesture is a
|
|
85
85
|
* trim of the source window). The new `play_in` / `play_out` are the facts; the
|
|
@@ -96,7 +96,7 @@ declare const adjustVideoClipDurationInputSchema: z.ZodObject<{
|
|
|
96
96
|
}, z.core.$strip>;
|
|
97
97
|
type AdjustVideoClipDurationInput = z.infer<typeof adjustVideoClipDurationInputSchema>;
|
|
98
98
|
//#endregion
|
|
99
|
-
//#region src/
|
|
99
|
+
//#region src/schemas/adjust-video-clip-volume.d.ts
|
|
100
100
|
declare const adjustVideoClipVolumeInputSchema: z.ZodObject<{
|
|
101
101
|
clips: z.ZodArray<z.ZodObject<{
|
|
102
102
|
clip_id: z.ZodString;
|
|
@@ -105,7 +105,7 @@ declare const adjustVideoClipVolumeInputSchema: z.ZodObject<{
|
|
|
105
105
|
}, z.core.$strip>;
|
|
106
106
|
type AdjustVideoClipVolumeInput = z.infer<typeof adjustVideoClipVolumeInputSchema>;
|
|
107
107
|
//#endregion
|
|
108
|
-
//#region src/
|
|
108
|
+
//#region src/schemas/change-speech.d.ts
|
|
109
109
|
/**
|
|
110
110
|
* Change a speech's script or voice. Both re-run TTS upstream and return the
|
|
111
111
|
* regenerated speech / caption parts in the same materialized shape as
|
|
@@ -164,7 +164,7 @@ declare const changeSpeechVoiceInputSchema: z.ZodObject<{
|
|
|
164
164
|
type ChangeSpeechScriptInput = z.infer<typeof changeSpeechScriptInputSchema>;
|
|
165
165
|
type ChangeSpeechVoiceInput = z.infer<typeof changeSpeechVoiceInputSchema>;
|
|
166
166
|
//#endregion
|
|
167
|
-
//#region src/
|
|
167
|
+
//#region src/schemas/delete-bgm.d.ts
|
|
168
168
|
/**
|
|
169
169
|
* Remove the document BGM. Pure document edit: clears the bgm lane and removes
|
|
170
170
|
* the bgm part. Takes no input (a document holds at most one bgm); an empty
|
|
@@ -173,7 +173,7 @@ type ChangeSpeechVoiceInput = z.infer<typeof changeSpeechVoiceInputSchema>;
|
|
|
173
173
|
declare const deleteBgmInputSchema: z.ZodObject<{}, z.core.$strip>;
|
|
174
174
|
type DeleteBgmInput = z.infer<typeof deleteBgmInputSchema>;
|
|
175
175
|
//#endregion
|
|
176
|
-
//#region src/
|
|
176
|
+
//#region src/schemas/delete-speeches.d.ts
|
|
177
177
|
/**
|
|
178
178
|
* Delete speeches with their captions. Pure document edit (no side effect): the
|
|
179
179
|
* op removes each speech part, cascade-deletes the captions it owns (via
|
|
@@ -184,7 +184,7 @@ declare const deleteSpeechesInputSchema: z.ZodObject<{
|
|
|
184
184
|
}, z.core.$strip>;
|
|
185
185
|
type DeleteSpeechesInput = z.infer<typeof deleteSpeechesInputSchema>;
|
|
186
186
|
//#endregion
|
|
187
|
-
//#region src/
|
|
187
|
+
//#region src/schemas/delete-video-clips.d.ts
|
|
188
188
|
/**
|
|
189
189
|
* How a delete handles the anchored subtree (speeches anchored to a deleted clip,
|
|
190
190
|
* and their captions) — a delete-op policy, not a data-model field (reference/17
|
|
@@ -205,7 +205,7 @@ declare const deleteVideoClipsInputSchema: z.ZodObject<{
|
|
|
205
205
|
}, z.core.$strip>;
|
|
206
206
|
type DeleteVideoClipsInput = z.infer<typeof deleteVideoClipsInputSchema>;
|
|
207
207
|
//#endregion
|
|
208
|
-
//#region src/
|
|
208
|
+
//#region src/schemas/move-speeches.d.ts
|
|
209
209
|
/**
|
|
210
210
|
* Move speeches in time. Pure document edit: the op re-seats each speech at its
|
|
211
211
|
* new absolute `start_ms`; the cascade reassigns it to the host video clip,
|
|
@@ -219,7 +219,7 @@ declare const moveSpeechesInputSchema: z.ZodObject<{
|
|
|
219
219
|
}, z.core.$strip>;
|
|
220
220
|
type MoveSpeechesInput = z.infer<typeof moveSpeechesInputSchema>;
|
|
221
221
|
//#endregion
|
|
222
|
-
//#region src/
|
|
222
|
+
//#region src/schemas/move-video-clips-by-anchor.d.ts
|
|
223
223
|
/**
|
|
224
224
|
* Where the moved block lands on the main track.
|
|
225
225
|
*
|
|
@@ -299,7 +299,7 @@ type MoveAnchor = z.infer<typeof moveAnchorSchema>;
|
|
|
299
299
|
type MovedClipAnchoredPolicy = z.infer<typeof movedClipAnchoredPolicySchema>;
|
|
300
300
|
type MoveVideoClipsByAnchorInput = z.infer<typeof moveVideoClipsByAnchorInputSchema>;
|
|
301
301
|
//#endregion
|
|
302
|
-
//#region src/
|
|
302
|
+
//#region src/schemas/move-video-clips.d.ts
|
|
303
303
|
declare const moveVideoClipsInputSchema: z.ZodObject<{
|
|
304
304
|
clips: z.ZodArray<z.ZodObject<{
|
|
305
305
|
clip_id: z.ZodString;
|
|
@@ -309,7 +309,7 @@ declare const moveVideoClipsInputSchema: z.ZodObject<{
|
|
|
309
309
|
}, z.core.$strip>;
|
|
310
310
|
type MoveVideoClipsInput = z.infer<typeof moveVideoClipsInputSchema>;
|
|
311
311
|
//#endregion
|
|
312
|
-
//#region src/
|
|
312
|
+
//#region src/schemas/replace-video-clip-content.d.ts
|
|
313
313
|
/**
|
|
314
314
|
* Replace the media backing existing video clips. The media import runs upstream
|
|
315
315
|
* (Director); its stable result — the new media id, intrinsic length, and the
|
|
@@ -331,7 +331,7 @@ declare const replaceVideoClipContentInputSchema: z.ZodObject<{
|
|
|
331
331
|
}, z.core.$strip>;
|
|
332
332
|
type ReplaceVideoClipContentInput = z.infer<typeof replaceVideoClipContentInputSchema>;
|
|
333
333
|
//#endregion
|
|
334
|
-
//#region src/
|
|
334
|
+
//#region src/schemas/replace-video-clip-sequence.d.ts
|
|
335
335
|
/**
|
|
336
336
|
* What happens to the speeches anchored to the clips being replaced.
|
|
337
337
|
*
|
|
@@ -385,7 +385,7 @@ declare const replaceVideoClipSequenceInputSchema: z.ZodObject<{
|
|
|
385
385
|
}, z.core.$strip>;
|
|
386
386
|
type ReplaceVideoClipSequenceInput = z.infer<typeof replaceVideoClipSequenceInputSchema>;
|
|
387
387
|
//#endregion
|
|
388
|
-
//#region src/
|
|
388
|
+
//#region src/schemas/set-bgm.d.ts
|
|
389
389
|
/**
|
|
390
390
|
* Set the document BGM. The media's stable result (storage key) arrives
|
|
391
391
|
* materialized from upstream (see
|
|
@@ -403,7 +403,7 @@ declare const setBgmInputSchema: z.ZodObject<{
|
|
|
403
403
|
}, z.core.$strip>;
|
|
404
404
|
type SetBgmInput = z.infer<typeof setBgmInputSchema>;
|
|
405
405
|
//#endregion
|
|
406
|
-
//#region src/
|
|
406
|
+
//#region src/schemas/set-caption-style.d.ts
|
|
407
407
|
/**
|
|
408
408
|
* Set the caption visual style. GLOBAL by design: the style applies to every
|
|
409
409
|
* caption part in the document — it carries NO `caption_id`. This mirrors the FE,
|
|
@@ -434,7 +434,7 @@ declare const setCaptionStyleInputSchema: z.ZodObject<{
|
|
|
434
434
|
}, z.core.$strip>;
|
|
435
435
|
type SetCaptionStyleInput = z.infer<typeof setCaptionStyleInputSchema>;
|
|
436
436
|
//#endregion
|
|
437
|
-
//#region src/
|
|
437
|
+
//#region src/schemas/set-caption-visibility.d.ts
|
|
438
438
|
/**
|
|
439
439
|
* Toggle caption visibility (the caption track's `is_hidden` flag). Pure
|
|
440
440
|
* document edit, no cascade — captions keep their positions; only the lane's
|
|
@@ -445,7 +445,7 @@ declare const setCaptionVisibilityInputSchema: z.ZodObject<{
|
|
|
445
445
|
}, z.core.$strip>;
|
|
446
446
|
type SetCaptionVisibilityInput = z.infer<typeof setCaptionVisibilityInputSchema>;
|
|
447
447
|
//#endregion
|
|
448
|
-
//#region src/
|
|
448
|
+
//#region src/schemas/set-video-clip-speed-shift.d.ts
|
|
449
449
|
/**
|
|
450
450
|
* Set the playback speed of existing video clips. Per the speed-shift decision
|
|
451
451
|
* (`reference/16` §0): the op writes only the `speed_shift` fact — it does NOT
|
|
@@ -488,7 +488,7 @@ declare const setVideoClipSpeedShiftInputSchema: z.ZodObject<{
|
|
|
488
488
|
}, z.core.$strip>;
|
|
489
489
|
type SetVideoClipSpeedShiftInput = z.infer<typeof setVideoClipSpeedShiftInputSchema>;
|
|
490
490
|
//#endregion
|
|
491
|
-
//#region src/
|
|
491
|
+
//#region src/schemas/shared.d.ts
|
|
492
492
|
declare const clipIdSchema: z.ZodString;
|
|
493
493
|
declare const clipIdsSchema: z.ZodArray<z.ZodString>;
|
|
494
494
|
declare const mediaIdSchema: z.ZodString;
|
|
@@ -537,7 +537,7 @@ declare const voiceSchema: z.ZodObject<{
|
|
|
537
537
|
name: z.ZodString;
|
|
538
538
|
}, z.core.$strip>;
|
|
539
539
|
//#endregion
|
|
540
|
-
//#region src/
|
|
540
|
+
//#region src/schemas/speech-assets.d.ts
|
|
541
541
|
/**
|
|
542
542
|
* The materialized TTS result shared by `AddSpeeches` / `ChangeSpeechScript` /
|
|
543
543
|
* `ChangeSpeechVoice` (see `results/phase-4-side-effect-payload-contract.md`
|
package/dist/schemas.js
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
|
-
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";
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
//#region src/
|
|
2
|
+
//#region src/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
|
+
//#region src/schemas/speech-assets.ts
|
|
4
40
|
/**
|
|
5
41
|
* The materialized TTS result shared by `AddSpeeches` / `ChangeSpeechScript` /
|
|
6
42
|
* `ChangeSpeechVoice` (see `results/phase-4-side-effect-payload-contract.md`
|
|
@@ -40,7 +76,7 @@ const speechAssetsSchema = z.object({
|
|
|
40
76
|
captions: z.array(captionAssetSchema).describe("Materialized caption parts owned by the speeches")
|
|
41
77
|
});
|
|
42
78
|
//#endregion
|
|
43
|
-
//#region src/
|
|
79
|
+
//#region src/schemas/add-speeches.ts
|
|
44
80
|
/**
|
|
45
81
|
* Add speeches (and their captions). TTS runs upstream; the stable speech /
|
|
46
82
|
* caption parts arrive materialized (see `speech-assets.ts`). The op writes the
|
|
@@ -50,7 +86,7 @@ const speechAssetsSchema = z.object({
|
|
|
50
86
|
*/
|
|
51
87
|
const addSpeechesInputSchema = speechAssetsSchema.describe("Materialized speeches + captions to add");
|
|
52
88
|
//#endregion
|
|
53
|
-
//#region src/
|
|
89
|
+
//#region src/schemas/add-video-clips.ts
|
|
54
90
|
/**
|
|
55
91
|
* Add video clips to a track. Each clip's duration facts are separated so a
|
|
56
92
|
* single number is never overloaded (RFC 02 / `reference/16` §0b):
|
|
@@ -126,19 +162,19 @@ const addVideoClipsInputSchema = z.object({
|
|
|
126
162
|
}
|
|
127
163
|
});
|
|
128
164
|
//#endregion
|
|
129
|
-
//#region src/
|
|
165
|
+
//#region src/schemas/adjust-bgm-volume.ts
|
|
130
166
|
const adjustBgmVolumeInputSchema = z.object({ bgm: z.array(z.object({
|
|
131
167
|
bgm_id: clipIdSchema.describe("The bgm part ID to adjust volume for"),
|
|
132
168
|
volume: volumeSchema.describe("Volume in decibels (-60.0 to 20.0; 0.0 = original)")
|
|
133
169
|
})).min(1).describe("List of bgm parts with their new volume settings") });
|
|
134
170
|
//#endregion
|
|
135
|
-
//#region src/
|
|
171
|
+
//#region src/schemas/adjust-speech-volume.ts
|
|
136
172
|
const adjustSpeechVolumeInputSchema = z.object({ speeches: z.array(z.object({
|
|
137
173
|
speech_id: speechIdSchema.describe("The speech part ID to adjust volume for"),
|
|
138
174
|
volume: volumeSchema.describe("Volume in decibels (-60.0 to 20.0; 0.0 = original)")
|
|
139
175
|
})).min(1).describe("List of speeches with their new volume settings") });
|
|
140
176
|
//#endregion
|
|
141
|
-
//#region src/
|
|
177
|
+
//#region src/schemas/adjust-video-clip-duration.ts
|
|
142
178
|
/**
|
|
143
179
|
* Re-trim existing video clips (the user-facing "adjust duration" gesture is a
|
|
144
180
|
* trim of the source window). The new `play_in` / `play_out` are the facts; the
|
|
@@ -152,13 +188,13 @@ const adjustVideoClipDurationInputSchema = z.object({ clips: z.array(z.object({
|
|
|
152
188
|
play_out: positiveMsSchema.describe("New trim window end in the source media")
|
|
153
189
|
})).min(1).describe("Video clips with their new trim windows") });
|
|
154
190
|
//#endregion
|
|
155
|
-
//#region src/
|
|
191
|
+
//#region src/schemas/adjust-video-clip-volume.ts
|
|
156
192
|
const adjustVideoClipVolumeInputSchema = z.object({ clips: z.array(z.object({
|
|
157
193
|
clip_id: clipIdSchema.describe("The video clip part ID to adjust volume for"),
|
|
158
194
|
volume: volumeSchema.describe("Volume in decibels (-60.0 to 20.0; 0.0 = original)")
|
|
159
195
|
})).min(1).describe("List of video clips with their new volume settings") });
|
|
160
196
|
//#endregion
|
|
161
|
-
//#region src/
|
|
197
|
+
//#region src/schemas/change-speech.ts
|
|
162
198
|
/**
|
|
163
199
|
* Change a speech's script or voice. Both re-run TTS upstream and return the
|
|
164
200
|
* regenerated speech / caption parts in the same materialized shape as
|
|
@@ -169,7 +205,7 @@ const adjustVideoClipVolumeInputSchema = z.object({ clips: z.array(z.object({
|
|
|
169
205
|
const changeSpeechScriptInputSchema = speechAssetsSchema.describe("Regenerated speeches + captions (new script)");
|
|
170
206
|
const changeSpeechVoiceInputSchema = speechAssetsSchema.describe("Regenerated speeches + captions (new voice)");
|
|
171
207
|
//#endregion
|
|
172
|
-
//#region src/
|
|
208
|
+
//#region src/schemas/delete-bgm.ts
|
|
173
209
|
/**
|
|
174
210
|
* Remove the document BGM. Pure document edit: clears the bgm lane and removes
|
|
175
211
|
* the bgm part. Takes no input (a document holds at most one bgm); an empty
|
|
@@ -177,7 +213,7 @@ const changeSpeechVoiceInputSchema = speechAssetsSchema.describe("Regenerated sp
|
|
|
177
213
|
*/
|
|
178
214
|
const deleteBgmInputSchema = z.object({}).describe("Remove the document BGM (no parameters)");
|
|
179
215
|
//#endregion
|
|
180
|
-
//#region src/
|
|
216
|
+
//#region src/schemas/delete-speeches.ts
|
|
181
217
|
/**
|
|
182
218
|
* Delete speeches with their captions. Pure document edit (no side effect): the
|
|
183
219
|
* op removes each speech part, cascade-deletes the captions it owns (via
|
|
@@ -185,7 +221,7 @@ const deleteBgmInputSchema = z.object({}).describe("Remove the document BGM (no
|
|
|
185
221
|
*/
|
|
186
222
|
const deleteSpeechesInputSchema = z.object({ speech_ids: speechIdsSchema.describe("Speech part IDs to delete (their captions cascade-delete)") });
|
|
187
223
|
//#endregion
|
|
188
|
-
//#region src/
|
|
224
|
+
//#region src/schemas/delete-video-clips.ts
|
|
189
225
|
/**
|
|
190
226
|
* How a delete handles the anchored subtree (speeches anchored to a deleted clip,
|
|
191
227
|
* and their captions) — a delete-op policy, not a data-model field (reference/17
|
|
@@ -198,7 +234,7 @@ const deleteVideoClipsInputSchema = z.object({
|
|
|
198
234
|
on_anchored: anchoredDeletePolicySchema.optional().describe("How to treat anchored children (default cascade)")
|
|
199
235
|
});
|
|
200
236
|
//#endregion
|
|
201
|
-
//#region src/
|
|
237
|
+
//#region src/schemas/move-speeches.ts
|
|
202
238
|
/**
|
|
203
239
|
* Move speeches in time. Pure document edit: the op re-seats each speech at its
|
|
204
240
|
* new absolute `start_ms`; the cascade reassigns it to the host video clip,
|
|
@@ -209,7 +245,7 @@ const moveSpeechesInputSchema = z.object({ speeches: z.array(z.object({
|
|
|
209
245
|
new_start_ms: timelineMsSchema.describe("New absolute start time on the timeline")
|
|
210
246
|
})).min(1).describe("Speeches to move to new positions") });
|
|
211
247
|
//#endregion
|
|
212
|
-
//#region src/
|
|
248
|
+
//#region src/schemas/move-video-clips-by-anchor.ts
|
|
213
249
|
/**
|
|
214
250
|
* Where the moved block lands on the main track.
|
|
215
251
|
*
|
|
@@ -274,14 +310,14 @@ const moveVideoClipsByAnchorInputSchema = z.object({
|
|
|
274
310
|
on_anchored: movedClipAnchoredPolicySchema.describe("What happens to speeches anchored to the moved clips (required — see the policy doc)")
|
|
275
311
|
});
|
|
276
312
|
//#endregion
|
|
277
|
-
//#region src/
|
|
313
|
+
//#region src/schemas/move-video-clips.ts
|
|
278
314
|
const moveVideoClipsInputSchema = z.object({ clips: z.array(z.object({
|
|
279
315
|
clip_id: clipIdSchema.describe("The video clip part ID to move"),
|
|
280
316
|
new_start_ms: timelineMsSchema.describe("New absolute start time in milliseconds on the timeline"),
|
|
281
317
|
new_track_id: z.string().min(1).optional().describe("Target track ID to move the clip to (optional)")
|
|
282
318
|
})).min(1).describe("List of video clips to move to new positions") });
|
|
283
319
|
//#endregion
|
|
284
|
-
//#region src/
|
|
320
|
+
//#region src/schemas/replace-video-clip-content.ts
|
|
285
321
|
/**
|
|
286
322
|
* Replace the media backing existing video clips. The media import runs upstream
|
|
287
323
|
* (Director); its stable result — the new media id, intrinsic length, and the
|
|
@@ -300,7 +336,7 @@ const replaceVideoClipContentInputSchema = z.object({ clips: z.array(z.object({
|
|
|
300
336
|
volume: volumeSchema
|
|
301
337
|
})).min(1).describe("Video clips whose media is being replaced") });
|
|
302
338
|
//#endregion
|
|
303
|
-
//#region src/
|
|
339
|
+
//#region src/schemas/replace-video-clip-sequence.ts
|
|
304
340
|
/**
|
|
305
341
|
* What happens to the speeches anchored to the clips being replaced.
|
|
306
342
|
*
|
|
@@ -370,7 +406,7 @@ const replaceVideoClipSequenceInputSchema = z.object({
|
|
|
370
406
|
}
|
|
371
407
|
});
|
|
372
408
|
//#endregion
|
|
373
|
-
//#region src/
|
|
409
|
+
//#region src/schemas/set-bgm.ts
|
|
374
410
|
/**
|
|
375
411
|
* Set the document BGM. The media's stable result (storage key) arrives
|
|
376
412
|
* materialized from upstream (see
|
|
@@ -387,7 +423,7 @@ const setBgmInputSchema = z.object({
|
|
|
387
423
|
volume: volumeSchema
|
|
388
424
|
});
|
|
389
425
|
//#endregion
|
|
390
|
-
//#region src/
|
|
426
|
+
//#region src/schemas/set-caption-style.ts
|
|
391
427
|
/**
|
|
392
428
|
* Set the caption visual style. GLOBAL by design: the style applies to every
|
|
393
429
|
* caption part in the document — it carries NO `caption_id`. This mirrors the FE,
|
|
@@ -417,7 +453,7 @@ const setCaptionStyleInputSchema = z.object({
|
|
|
417
453
|
position_y: z.number().optional().describe("Caption center Y as a fraction (0.0 to 1.0)")
|
|
418
454
|
}).describe("Document-wide caption style patch (no caption_id; applies to every caption)");
|
|
419
455
|
//#endregion
|
|
420
|
-
//#region src/
|
|
456
|
+
//#region src/schemas/set-caption-visibility.ts
|
|
421
457
|
/**
|
|
422
458
|
* Toggle caption visibility (the caption track's `is_hidden` flag). Pure
|
|
423
459
|
* document edit, no cascade — captions keep their positions; only the lane's
|
|
@@ -425,7 +461,7 @@ const setCaptionStyleInputSchema = z.object({
|
|
|
425
461
|
*/
|
|
426
462
|
const setCaptionVisibilityInputSchema = z.object({ is_hidden: z.boolean().describe("Whether the caption track is hidden") });
|
|
427
463
|
//#endregion
|
|
428
|
-
//#region src/
|
|
464
|
+
//#region src/schemas/set-video-clip-speed-shift.ts
|
|
429
465
|
/**
|
|
430
466
|
* Set the playback speed of existing video clips. Per the speed-shift decision
|
|
431
467
|
* (`reference/16` §0): the op writes only the `speed_shift` fact — it does NOT
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as MedeoDsl } from "./index-CmuDB_Gm.js";
|
|
1
|
+
import { M as MedeoDsl, d as VideoDraft } from "./index-B1Lqm_Z1.js";
|
|
3
2
|
import { LoroDoc } from "loro-crdt";
|
|
4
3
|
|
|
5
4
|
//#region src/testing/in-memory-mengine-server.d.ts
|
|
@@ -16,7 +15,6 @@ import { LoroDoc } from "loro-crdt";
|
|
|
16
15
|
declare class InMemoryMengineServer {
|
|
17
16
|
private readonly doc;
|
|
18
17
|
private readonly updates;
|
|
19
|
-
private readonly revisions;
|
|
20
18
|
private readonly subscribers;
|
|
21
19
|
private seq;
|
|
22
20
|
private hasSnapshot;
|
|
@@ -29,7 +27,6 @@ declare class InMemoryMengineServer {
|
|
|
29
27
|
readonly fetchImpl: typeof fetch;
|
|
30
28
|
private parsePath;
|
|
31
29
|
private version;
|
|
32
|
-
private handleDraft;
|
|
33
30
|
private handleSnapshot;
|
|
34
31
|
private handleBootstrap;
|
|
35
32
|
private handleSync;
|
package/dist/testing.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { n as bytesToBase64, t as base64ToBytes } from "./base64-D-jd-dr5.js";
|
|
2
|
-
import { a as
|
|
3
|
-
import { i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl } from "./dsl-Bvv_51Ns.js";
|
|
2
|
+
import { a as DslEditor, d as documentFormat, i as createInitialMedeoDsl, l as assertDslDocument, n as toVideoDraft, s as MedeoDsl, u as assertPhoneticBindingFormat } from "./dsl-SmWJTQWV.js";
|
|
4
3
|
import { t as classifyUpdate } from "./loro-relay-doc-Bi6JKqtQ.js";
|
|
5
4
|
import { LoroDoc, VersionVector, encodeFrontiers } from "loro-crdt";
|
|
6
5
|
//#region src/testing/in-memory-mengine-server.ts
|
|
@@ -17,7 +16,6 @@ import { LoroDoc, VersionVector, encodeFrontiers } from "loro-crdt";
|
|
|
17
16
|
var InMemoryMengineServer = class {
|
|
18
17
|
doc = new LoroDoc();
|
|
19
18
|
updates = [];
|
|
20
|
-
revisions = /* @__PURE__ */ new Map();
|
|
21
19
|
subscribers = /* @__PURE__ */ new Set();
|
|
22
20
|
seq = 0;
|
|
23
21
|
hasSnapshot = false;
|
|
@@ -41,7 +39,6 @@ var InMemoryMengineServer = class {
|
|
|
41
39
|
try {
|
|
42
40
|
this.doc.import(dsl.doc.export({ mode: "snapshot" }));
|
|
43
41
|
this.hasSnapshot = true;
|
|
44
|
-
this.revisions.set(0, this.doc.export({ mode: "snapshot" }));
|
|
45
42
|
return new Response(await this.handleSnapshot().text(), {
|
|
46
43
|
status: 201,
|
|
47
44
|
headers: { "content-type": "application/json" }
|
|
@@ -50,9 +47,24 @@ var InMemoryMengineServer = class {
|
|
|
50
47
|
dsl.dispose();
|
|
51
48
|
}
|
|
52
49
|
}
|
|
53
|
-
if (path === "draft" && method === "GET")
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
if (path === "draft" && method === "GET") {
|
|
51
|
+
if (!this.hasSnapshot) return this.handleSnapshot();
|
|
52
|
+
assertDslDocument(this.doc);
|
|
53
|
+
const dsl = new MedeoDsl(this.doc);
|
|
54
|
+
try {
|
|
55
|
+
return Response.json({
|
|
56
|
+
...toVideoDraft(dsl.getSnapshot()),
|
|
57
|
+
version: this.version()
|
|
58
|
+
});
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return Response.json({ error: {
|
|
61
|
+
code: "projection_unsupported",
|
|
62
|
+
message: String(error)
|
|
63
|
+
} }, { status: 422 });
|
|
64
|
+
} finally {
|
|
65
|
+
dsl.dispose();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
56
68
|
if (/^\/internal\/mengine\/v1\/docs\/[^/]+\/bootstrap$/.test(new URL(url).pathname) && method === "POST") return this.handleBootstrap(init);
|
|
57
69
|
if (path.startsWith("sync") && method === "GET") return this.handleSync(url);
|
|
58
70
|
if (path === "updates" && method === "POST") return this.handlePush(init);
|
|
@@ -69,37 +81,13 @@ var InMemoryMengineServer = class {
|
|
|
69
81
|
const afterDocId = url.slice(start + 21);
|
|
70
82
|
return afterDocId.slice(afterDocId.indexOf("/") + 1);
|
|
71
83
|
}
|
|
72
|
-
version(
|
|
84
|
+
version() {
|
|
73
85
|
return {
|
|
74
|
-
update_seq: seq,
|
|
75
|
-
server_vv: bytesToBase64(doc.oplogVersion().encode()),
|
|
76
|
-
frontiers: bytesToBase64(encodeFrontiers(doc.oplogFrontiers()))
|
|
86
|
+
update_seq: this.seq,
|
|
87
|
+
server_vv: bytesToBase64(this.doc.oplogVersion().encode()),
|
|
88
|
+
frontiers: bytesToBase64(encodeFrontiers(this.doc.oplogFrontiers()))
|
|
77
89
|
};
|
|
78
90
|
}
|
|
79
|
-
handleDraft(updateSeq) {
|
|
80
|
-
if (!this.hasSnapshot) return this.handleSnapshot();
|
|
81
|
-
const seq = updateSeq ?? this.seq;
|
|
82
|
-
const snapshot = this.revisions.get(seq);
|
|
83
|
-
if (!snapshot) return Response.json({ code: "not_found" }, { status: 404 });
|
|
84
|
-
const doc = new LoroDoc();
|
|
85
|
-
doc.import(snapshot);
|
|
86
|
-
const dsl = new MedeoDsl(doc);
|
|
87
|
-
try {
|
|
88
|
-
assertDslDocument(doc);
|
|
89
|
-
return Response.json({
|
|
90
|
-
...toVideoDraft(dsl.getSnapshot()),
|
|
91
|
-
version: this.version(doc, seq)
|
|
92
|
-
});
|
|
93
|
-
} catch (error) {
|
|
94
|
-
return Response.json({
|
|
95
|
-
code: updateSeq === void 0 ? "projection_unsupported" : "revision_unprojectable",
|
|
96
|
-
message: String(error)
|
|
97
|
-
}, { status: 422 });
|
|
98
|
-
} finally {
|
|
99
|
-
dsl.dispose();
|
|
100
|
-
doc.free();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
91
|
handleSnapshot() {
|
|
104
92
|
if (!this.hasSnapshot) return Response.json({
|
|
105
93
|
kind: "rejected",
|
|
@@ -116,7 +104,6 @@ var InMemoryMengineServer = class {
|
|
|
116
104
|
if (body.snapshot != null && !this.hasSnapshot) {
|
|
117
105
|
this.doc.import(base64ToBytes(body.snapshot));
|
|
118
106
|
this.hasSnapshot = true;
|
|
119
|
-
this.revisions.set(0, this.doc.export({ mode: "snapshot" }));
|
|
120
107
|
}
|
|
121
108
|
return this.handleSnapshot();
|
|
122
109
|
}
|
|
@@ -179,8 +166,9 @@ var InMemoryMengineServer = class {
|
|
|
179
166
|
try {
|
|
180
167
|
probe.import(this.doc.export({ mode: "snapshot" }));
|
|
181
168
|
probe.import(data);
|
|
182
|
-
|
|
183
|
-
|
|
169
|
+
const format = documentFormat(probe);
|
|
170
|
+
let unsupported = format === "legacy" || format === "mixed";
|
|
171
|
+
if (format === "dsl") try {
|
|
184
172
|
assertPhoneticBindingFormat(probe);
|
|
185
173
|
} catch {
|
|
186
174
|
unsupported = true;
|
|
@@ -188,7 +176,7 @@ var InMemoryMengineServer = class {
|
|
|
188
176
|
if (unsupported) return Response.json({
|
|
189
177
|
kind: "rejected",
|
|
190
178
|
code: "unsupported_document_format",
|
|
191
|
-
message: "
|
|
179
|
+
message: "Retired document content roots are not supported",
|
|
192
180
|
server_version: serverVersion
|
|
193
181
|
}, { status: 422 });
|
|
194
182
|
} finally {
|
|
@@ -197,7 +185,6 @@ var InMemoryMengineServer = class {
|
|
|
197
185
|
this.doc.import(data);
|
|
198
186
|
this.hasSnapshot = true;
|
|
199
187
|
this.seq += 1;
|
|
200
|
-
this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
|
|
201
188
|
const meta = extractMeta(this.doc, baseVV);
|
|
202
189
|
const stored = {
|
|
203
190
|
updateSeq: this.seq,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mengine/medeo-client",
|
|
3
|
-
"version": "2.1.1-dsl.
|
|
3
|
+
"version": "2.1.1-dsl.26",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": "./dist/index.js",
|
|
17
17
|
"./dsl": "./dist/dsl.js",
|
|
18
|
-
"./legacy": "./dist/legacy.js",
|
|
19
18
|
"./relay": "./dist/relay.js",
|
|
20
19
|
"./schemas": "./dist/schemas.js",
|
|
21
20
|
"./testing": "./dist/testing.js",
|
|
@@ -27,11 +26,10 @@
|
|
|
27
26
|
},
|
|
28
27
|
"dependencies": {
|
|
29
28
|
"@noble/hashes": "^2.4.0",
|
|
30
|
-
"immer": "^10.2.0",
|
|
31
29
|
"zod": "^4.4.3",
|
|
32
|
-
"@mengine/storage": "2.1.1-dsl.
|
|
33
|
-
"@mengine/sync": "2.1.1-dsl.
|
|
34
|
-
"@mengine/utils": "2.1.1-dsl.
|
|
30
|
+
"@mengine/storage": "2.1.1-dsl.26",
|
|
31
|
+
"@mengine/sync": "2.1.1-dsl.26",
|
|
32
|
+
"@mengine/utils": "2.1.1-dsl.26"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
35
|
"@types/node": "^25.9.1",
|
|
@@ -42,13 +40,14 @@
|
|
|
42
40
|
"typescript": "^6.0.3",
|
|
43
41
|
"vite-plugin-wasm": "^3.6.0",
|
|
44
42
|
"vite-plus": "^0.1.23",
|
|
45
|
-
"@mengine/
|
|
46
|
-
"@mengine/
|
|
43
|
+
"@mengine/idl-codegen": "0.0.0",
|
|
44
|
+
"@mengine/medeo-dsl": "0.0.0"
|
|
47
45
|
},
|
|
48
46
|
"peerDependencies": {
|
|
49
47
|
"loro-crdt": "^1.16.1"
|
|
50
48
|
},
|
|
51
49
|
"inlinedDependencies": {
|
|
50
|
+
"immer": "10.2.0",
|
|
52
51
|
"loro-mirror": "2.3.3"
|
|
53
52
|
},
|
|
54
53
|
"scripts": {
|