@mengine/medeo-client 2.1.1-dsl.25 → 2.1.1-dsl.27

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.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
 
3
- //#region src/editor/schemas/add-speeches.d.ts
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/editor/schemas/add-video-clips.d.ts
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/editor/schemas/adjust-bgm-volume.d.ts
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/editor/schemas/adjust-speech-volume.d.ts
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/editor/schemas/adjust-video-clip-duration.d.ts
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/editor/schemas/adjust-video-clip-volume.d.ts
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/editor/schemas/change-speech.d.ts
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/editor/schemas/delete-bgm.d.ts
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/editor/schemas/delete-speeches.d.ts
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/editor/schemas/delete-video-clips.d.ts
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/editor/schemas/move-speeches.d.ts
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/editor/schemas/move-video-clips-by-anchor.d.ts
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/editor/schemas/move-video-clips.d.ts
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/editor/schemas/replace-video-clip-content.d.ts
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/editor/schemas/replace-video-clip-sequence.d.ts
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/editor/schemas/set-bgm.d.ts
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/editor/schemas/set-caption-style.d.ts
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/editor/schemas/set-caption-visibility.d.ts
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/editor/schemas/set-video-clip-speed-shift.d.ts
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/editor/schemas/shared.d.ts
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/editor/schemas/speech-assets.d.ts
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/editor/schemas/speech-assets.ts
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/editor/schemas/add-speeches.ts
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/editor/schemas/add-video-clips.ts
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/editor/schemas/adjust-bgm-volume.ts
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/editor/schemas/adjust-speech-volume.ts
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/editor/schemas/adjust-video-clip-duration.ts
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/editor/schemas/adjust-video-clip-volume.ts
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/editor/schemas/change-speech.ts
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/editor/schemas/delete-bgm.ts
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/editor/schemas/delete-speeches.ts
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/editor/schemas/delete-video-clips.ts
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/editor/schemas/move-speeches.ts
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/editor/schemas/move-video-clips-by-anchor.ts
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/editor/schemas/move-video-clips.ts
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/editor/schemas/replace-video-clip-content.ts
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/editor/schemas/replace-video-clip-sequence.ts
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/editor/schemas/set-bgm.ts
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/editor/schemas/set-caption-style.ts
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/editor/schemas/set-caption-visibility.ts
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/editor/schemas/set-video-clip-speed-shift.ts
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 { i as VideoDraft } from "./video-draft-types-slnHaNs9.js";
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,10 +15,10 @@ 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;
21
+ private readonly revisions;
23
22
  /**
24
23
  * Close every open SSE stream, simulating a network drop. Clients reconnect
25
24
  * (a fresh `/events`) and catch up via their next sync — used to exercise
@@ -29,7 +28,6 @@ declare class InMemoryMengineServer {
29
28
  readonly fetchImpl: typeof fetch;
30
29
  private parsePath;
31
30
  private version;
32
- private handleDraft;
33
31
  private handleSnapshot;
34
32
  private handleBootstrap;
35
33
  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 assertPhoneticBindingFormat, i as assertDslDocument, o as documentFormat } from "./video-draft-types-DRGBN0we.js";
3
- import { i as DslEditor, n as toVideoDraft, o as MedeoDsl, r as createInitialMedeoDsl } from "./dsl-DrQOG0a6.js";
2
+ import { _ as DslProjectionError, 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,10 +16,10 @@ 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;
22
+ revisions = /* @__PURE__ */ new Map();
24
23
  /**
25
24
  * Close every open SSE stream, simulating a network drop. Clients reconnect
26
25
  * (a fresh `/events`) and catch up via their next sync — used to exercise
@@ -41,7 +40,7 @@ var InMemoryMengineServer = class {
41
40
  try {
42
41
  this.doc.import(dsl.doc.export({ mode: "snapshot" }));
43
42
  this.hasSnapshot = true;
44
- this.revisions.set(0, this.doc.export({ mode: "snapshot" }));
43
+ this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
45
44
  return new Response(await this.handleSnapshot().text(), {
46
45
  status: 201,
47
46
  headers: { "content-type": "application/json" }
@@ -50,9 +49,35 @@ var InMemoryMengineServer = class {
50
49
  dsl.dispose();
51
50
  }
52
51
  }
53
- if (path === "draft" && method === "GET") return this.handleDraft();
54
52
  const revision = /^revisions\/(\d+)\/draft$/.exec(path);
55
- if (revision && method === "GET") return this.handleDraft(Number(revision[1]));
53
+ if ((path === "draft" || revision) && method === "GET") {
54
+ if (!this.hasSnapshot) return this.handleSnapshot();
55
+ const seq = revision ? Number(revision[1]) : this.seq;
56
+ const snapshot = this.revisions.get(seq);
57
+ if (!snapshot) return Response.json({
58
+ code: "not_found",
59
+ message: "revision not found"
60
+ }, { status: 404 });
61
+ const attached = new LoroDoc();
62
+ attached.import(snapshot);
63
+ const dsl = new MedeoDsl(attached);
64
+ try {
65
+ assertDslDocument(attached);
66
+ return Response.json({
67
+ ...toVideoDraft(dsl.getSnapshot()),
68
+ version: this.version(attached, seq)
69
+ });
70
+ } catch (error) {
71
+ return Response.json({
72
+ code: revision ? "revision_unprojectable" : "projection_unsupported",
73
+ message: String(error),
74
+ ...error instanceof DslProjectionError ? { issues: error.issues } : {}
75
+ }, { status: 422 });
76
+ } finally {
77
+ dsl.dispose();
78
+ attached.free();
79
+ }
80
+ }
56
81
  if (/^\/internal\/mengine\/v1\/docs\/[^/]+\/bootstrap$/.test(new URL(url).pathname) && method === "POST") return this.handleBootstrap(init);
57
82
  if (path.startsWith("sync") && method === "GET") return this.handleSync(url);
58
83
  if (path === "updates" && method === "POST") return this.handlePush(init);
@@ -76,30 +101,6 @@ var InMemoryMengineServer = class {
76
101
  frontiers: bytesToBase64(encodeFrontiers(doc.oplogFrontiers()))
77
102
  };
78
103
  }
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
104
  handleSnapshot() {
104
105
  if (!this.hasSnapshot) return Response.json({
105
106
  kind: "rejected",
@@ -116,7 +117,7 @@ var InMemoryMengineServer = class {
116
117
  if (body.snapshot != null && !this.hasSnapshot) {
117
118
  this.doc.import(base64ToBytes(body.snapshot));
118
119
  this.hasSnapshot = true;
119
- this.revisions.set(0, this.doc.export({ mode: "snapshot" }));
120
+ this.revisions.set(this.seq, this.doc.export({ mode: "snapshot" }));
120
121
  }
121
122
  return this.handleSnapshot();
122
123
  }
@@ -179,8 +180,9 @@ var InMemoryMengineServer = class {
179
180
  try {
180
181
  probe.import(this.doc.export({ mode: "snapshot" }));
181
182
  probe.import(data);
182
- let unsupported = documentFormat(probe) === "mixed";
183
- if (documentFormat(probe) === "dsl") try {
183
+ const format = documentFormat(probe);
184
+ let unsupported = format === "legacy" || format === "mixed";
185
+ if (format === "dsl") try {
184
186
  assertPhoneticBindingFormat(probe);
185
187
  } catch {
186
188
  unsupported = true;
@@ -188,7 +190,7 @@ var InMemoryMengineServer = class {
188
190
  if (unsupported) return Response.json({
189
191
  kind: "rejected",
190
192
  code: "unsupported_document_format",
191
- message: "Unsupported or mixed DSL storage format",
193
+ message: "Retired document content roots are not supported",
192
194
  server_version: serverVersion
193
195
  }, { status: 422 });
194
196
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mengine/medeo-client",
3
- "version": "2.1.1-dsl.25",
3
+ "version": "2.1.1-dsl.27",
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/sync": "2.1.1-dsl.25",
33
- "@mengine/utils": "2.1.1-dsl.25",
34
- "@mengine/storage": "2.1.1-dsl.25"
30
+ "@mengine/sync": "2.1.1-dsl.27",
31
+ "@mengine/utils": "2.1.1-dsl.27",
32
+ "@mengine/storage": "2.1.1-dsl.27"
35
33
  },
36
34
  "devDependencies": {
37
35
  "@types/node": "^25.9.1",
@@ -49,6 +47,7 @@
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": {