@vivix-labs/media-tools 0.0.0-stage → 1.0.0-beta

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.
Files changed (60) hide show
  1. package/README.md +129 -2
  2. package/dist/Inter-LICENSE.txt +93 -0
  3. package/dist/UI-LICENSE.txt +21 -0
  4. package/dist/assets/35a50-G5EJUNOC.svg +6 -0
  5. package/dist/assets/369ca-BISNKZ3M.svg +6 -0
  6. package/dist/assets/441bc-BCMNQ72W.svg +6 -0
  7. package/dist/assets/483f0-T6ZAGTDG.svg +6 -0
  8. package/dist/assets/6911b-ESLYKSC6.svg +6 -0
  9. package/dist/assets/Inter-LICENSE.txt +93 -0
  10. package/dist/assets/UI-system-LICENSE.txt +21 -0
  11. package/dist/assets/add-JY533O73.svg +5 -0
  12. package/dist/assets/area-P2WOMBT5.svg +9 -0
  13. package/dist/assets/b70bb-BTTOKPOH.svg +6 -0
  14. package/dist/assets/b9919-3S3O6YOT.svg +6 -0
  15. package/dist/assets/calendar-JI6USFRJ.svg +1 -0
  16. package/dist/assets/check-JSRRIXN5.svg +5 -0
  17. package/dist/assets/check-on-content-FQUVG3IZ.svg +5 -0
  18. package/dist/assets/chevron-down-K7YKS2EY.svg +5 -0
  19. package/dist/assets/chevron-left-JQCLK2WZ.svg +3 -0
  20. package/dist/assets/chevron-right-TNE35DBJ.svg +3 -0
  21. package/dist/assets/chevron-up-VBHYAJVB.svg +5 -0
  22. package/dist/assets/clear-XNEZJKFC.svg +5 -0
  23. package/dist/assets/close-GO5F7YFS.svg +10 -0
  24. package/dist/assets/dccd4-CZJXWICW.svg +6 -0
  25. package/dist/assets/dd163-3S3O6YOT.svg +6 -0
  26. package/dist/assets/draw-FOFX5TOM.svg +6 -0
  27. package/dist/assets/e8aed-CZJXWICW.svg +6 -0
  28. package/dist/assets/ea990-CZJXWICW.svg +6 -0
  29. package/dist/assets/expand-IAV75AFA.svg +6 -0
  30. package/dist/assets/fullscreen-L2JCXIN2.svg +6 -0
  31. package/dist/assets/grid-TLG5JYWB.svg +8 -0
  32. package/dist/assets/import-AFBUV2VV.svg +4 -0
  33. package/dist/assets/inter-latin-400-normal-55WT6UWF.woff2 +0 -0
  34. package/dist/assets/inter-latin-500-normal-W62DVTXI.woff2 +0 -0
  35. package/dist/assets/inter-latin-600-normal-R6Y2SZCR.woff2 +0 -0
  36. package/dist/assets/list-5VUAOZUH.svg +9 -0
  37. package/dist/assets/magic-OMME7FOV.svg +9 -0
  38. package/dist/assets/more-AEJ5MHWV.svg +5 -0
  39. package/dist/assets/mute-SXOSCR2U.svg +6 -0
  40. package/dist/assets/pause-2E4UY4FW.svg +6 -0
  41. package/dist/assets/play-WIIT3XQK.svg +5 -0
  42. package/dist/assets/reset-JESMTEMV.svg +6 -0
  43. package/dist/assets/search-JUOSGQRM.svg +6 -0
  44. package/dist/assets/select-VU7WR7B4.svg +7 -0
  45. package/dist/assets/sound-file-YYY6VNYN.svg +3 -0
  46. package/dist/assets/volume-2TYGJL6F.svg +6 -0
  47. package/dist/client.bundle.js +1606 -0
  48. package/dist/client.css +2242 -0
  49. package/dist/client.d.ts +18 -0
  50. package/dist/client.js +3 -0
  51. package/dist/server.d.ts +10 -0
  52. package/dist/server.js +1763 -0
  53. package/dist/shared.d.ts +664 -0
  54. package/dist/shared.js +217 -0
  55. package/dist/worker.d.ts +2 -0
  56. package/dist/worker.js +189 -0
  57. package/package.json +42 -3
  58. package/skills/SKILL.md +49 -0
  59. package/skills/references/processing.md +32 -0
  60. package/studio-plugin.json +11 -0
@@ -0,0 +1,664 @@
1
+ import { CallContext as CallContext$1, z } from 'vivix-studio/sdk/shared';
2
+ import { ReactNode } from 'react';
3
+
4
+ type Scope = {
5
+ kind: 'user' | 'project';
6
+ id: string;
7
+ };
8
+ type CallContext = CallContext$1 & {
9
+ scope?: Scope;
10
+ confirmed?: boolean;
11
+ originalRequestKey?: string;
12
+ sourceOperation?: string;
13
+ };
14
+ type JSONValue = null | boolean | number | string | JSONValue[] | {
15
+ [key: string]: JSONValue;
16
+ };
17
+ interface RecordValue {
18
+ storeId: string;
19
+ scope: Scope;
20
+ objectId: string;
21
+ typeId: string;
22
+ schemaVersion: number;
23
+ revision: number;
24
+ data: any;
25
+ metadata: Record<string, JSONValue>;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ deletedAt: string | null;
29
+ }
30
+ interface VersionRef {
31
+ storeId: string;
32
+ objectId: string;
33
+ versionId: string;
34
+ }
35
+ interface VersionValue {
36
+ versionId: string;
37
+ objectId: string;
38
+ versionNumber: number;
39
+ schemaVersion: number;
40
+ parentVersionId: string | null;
41
+ sourceRef: VersionRef | null;
42
+ origin: string;
43
+ taskId: string | null;
44
+ payload: any;
45
+ metadata: any;
46
+ contentDigest: string;
47
+ createdAt: string;
48
+ }
49
+ interface FileValue {
50
+ fileId: string;
51
+ relativePath: string;
52
+ originalName: string;
53
+ mimeType: string;
54
+ sizeBytes: number;
55
+ sha256: string;
56
+ createdAt: string;
57
+ role: string;
58
+ ordinal: number;
59
+ }
60
+ type ProbeRunner = (path: string, signal?: AbortSignal, context?: {
61
+ directory: string;
62
+ }) => Promise<{
63
+ stdout: string;
64
+ stderr: string;
65
+ }>;
66
+ interface StageOptions {
67
+ signal?: AbortSignal;
68
+ probeRunner?: ProbeRunner;
69
+ onPrepared?: (stagingFileId: string) => void | Promise<void>;
70
+ }
71
+ interface StagedFile {
72
+ stagingFileId: string;
73
+ kind: string;
74
+ mimeType: string;
75
+ sizeBytes: number;
76
+ sha256: string;
77
+ originalName: string;
78
+ details: Record<string, any>;
79
+ }
80
+ type SqlScalar = null | string | number;
81
+ interface SqlInput {
82
+ sql: string;
83
+ params?: SqlScalar[] | Record<string, SqlScalar>;
84
+ timeoutMs?: number;
85
+ maxRows?: number;
86
+ limit?: number;
87
+ offset?: number;
88
+ }
89
+ type SqlRow = Record<string, JSONValue>;
90
+ interface MutationInput {
91
+ table: string;
92
+ action: 'insert' | 'update' | 'delete';
93
+ key?: Record<string, SqlScalar>;
94
+ values?: Record<string, SqlScalar>;
95
+ expectedRevision?: number;
96
+ }
97
+ interface MutationResult {
98
+ changes: number;
99
+ items: SqlRow[];
100
+ }
101
+ interface Query {
102
+ typeId: string;
103
+ search?: string;
104
+ kind?: string;
105
+ tag?: string;
106
+ targetAssetId?: string;
107
+ taskId?: string;
108
+ outputIndex?: number;
109
+ metadataEquals?: Record<string, JSONValue>;
110
+ metadataContains?: Record<string, JSONValue>;
111
+ sort?: 'name' | 'createdAt' | 'updatedAt';
112
+ direction?: 'asc' | 'desc';
113
+ limit?: number;
114
+ offset?: number;
115
+ includeDeleted?: boolean;
116
+ }
117
+ interface Transaction {
118
+ get(id: string, includeDeleted?: boolean): RecordValue;
119
+ create(typeId: string, data: any, metadata?: any, id?: string): RecordValue;
120
+ update(id: string, expectedRevision: number, data: any, metadata?: any, deletedAt?: string | null): RecordValue;
121
+ commitVersion(id: string, expectedRevision: number, value: {
122
+ parentVersionId?: string | null;
123
+ sourceRef?: VersionRef | null;
124
+ origin: string;
125
+ taskId?: string | null;
126
+ payload: any;
127
+ metadata?: any;
128
+ files?: FileValue[];
129
+ versionId?: string;
130
+ }): VersionValue;
131
+ /** Clear only mutable record-level references owned by this binding; version references remain immutable. */
132
+ removeRelations(sourceObjectId: string, kind: 'reference'): void;
133
+ relation(sourceObjectId: string, sourceVersionId: string | null, target: VersionRef, kind: 'source' | 'input' | 'reference'): void;
134
+ }
135
+ interface DataAPI {
136
+ readonly storeId: string;
137
+ readonly scope: Scope;
138
+ get(id: string, includeDeleted?: boolean): RecordValue;
139
+ list(query: Query): {
140
+ items: RecordValue[];
141
+ nextOffset: number | null;
142
+ };
143
+ query(input: SqlInput): Promise<SqlRow[]>;
144
+ mutate(input: MutationInput, call: CallContext): Promise<MutationResult>;
145
+ versions(id: string): VersionValue[];
146
+ version(ref: VersionRef): VersionValue;
147
+ files(ref: VersionRef): FileValue[];
148
+ receipt(name: string, input: unknown, call: CallContext): {
149
+ result: any;
150
+ } | null;
151
+ reserve(name: string, input: unknown, call: CallContext): {
152
+ result: any;
153
+ } | null;
154
+ operation<T>(name: string, input: unknown, call: CallContext, action: (tx: Transaction) => T): T;
155
+ patchMetadata(id: string, revision: number, set: Record<string, JSONValue>, remove: string[], call: CallContext): RecordValue;
156
+ metadataKeys(typeId: string, limit?: number): {
157
+ key: string;
158
+ types: string[];
159
+ observedCount: number;
160
+ }[];
161
+ stage(source: AsyncIterable<Uint8Array>, originalName: string, actorId: string, options?: StageOptions): Promise<StagedFile>;
162
+ stageText(text: string, actorId: string): Promise<StagedFile>;
163
+ publish(stagingIds: string[], objectId: string, versionId: string, operationId: string, actorId: string, fileRoles?: string[]): Promise<{
164
+ files: FileValue[];
165
+ details: any;
166
+ kind: string;
167
+ }>;
168
+ finishFiles(operationId: string): Promise<void>;
169
+ discardStaging(stagingFileId: string): Promise<void>;
170
+ discardPublication(operationId: string): Promise<void>;
171
+ location(ref: VersionRef, fileId?: string): Promise<{
172
+ source: VersionRef;
173
+ absolutePath: string;
174
+ fileId: string;
175
+ mimeType: string;
176
+ availability: 'ready';
177
+ previewUrl: string | null;
178
+ }>;
179
+ availability(ref: VersionRef): Promise<'ready' | 'missing' | 'corrupt'>;
180
+ openFile(ref: VersionRef, fileId: string, signal: AbortSignal): Promise<ReadableStream<Uint8Array>>;
181
+ usages(ref: {
182
+ objectId: string;
183
+ versionId?: string;
184
+ limit?: number;
185
+ offset?: number;
186
+ }): any[];
187
+ usageCount(objectId: string): number;
188
+ documents(action: 'create' | 'update' | 'delete', input: any, call: CallContext): RecordValue;
189
+ impact(id: string): any;
190
+ purge(id: string, revision: number, call: CallContext): any;
191
+ }
192
+
193
+ declare const packageVersion = "0.1.22-ecommerce.20261110.1";
194
+ declare const Config: z.ZodObject<{
195
+ dataInstance: z.ZodDefault<z.ZodString>;
196
+ studioInstance: z.ZodDefault<z.ZodString>;
197
+ executionNamespace: z.ZodDefault<z.ZodString>;
198
+ ffmpegPath: z.ZodDefault<z.ZodString>;
199
+ ffprobePath: z.ZodDefault<z.ZodString>;
200
+ }, z.core.$strict>;
201
+ type MediaToolsConfig = z.infer<typeof Config>;
202
+ declare const versionRef: z.ZodObject<{
203
+ storeId: z.ZodUUID;
204
+ objectId: z.ZodUUID;
205
+ versionId: z.ZodUUID;
206
+ }, z.core.$strict>;
207
+ declare const videoFileRef: z.ZodObject<{
208
+ source: z.ZodObject<{
209
+ storeId: z.ZodUUID;
210
+ objectId: z.ZodUUID;
211
+ versionId: z.ZodUUID;
212
+ }, z.core.$strict>;
213
+ fileId: z.ZodUUID;
214
+ }, z.core.$strict>;
215
+ type VideoFileRef = z.infer<typeof videoFileRef>;
216
+ declare const videoInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
217
+ kind: z.ZodLiteral<"source">;
218
+ file: z.ZodObject<{
219
+ source: z.ZodObject<{
220
+ storeId: z.ZodUUID;
221
+ objectId: z.ZodUUID;
222
+ versionId: z.ZodUUID;
223
+ }, z.core.$strict>;
224
+ fileId: z.ZodUUID;
225
+ }, z.core.$strict>;
226
+ }, z.core.$strict>, z.ZodObject<{
227
+ kind: z.ZodLiteral<"edit">;
228
+ editRef: z.ZodObject<{
229
+ storeId: z.ZodUUID;
230
+ objectId: z.ZodUUID;
231
+ versionId: z.ZodUUID;
232
+ }, z.core.$strict>;
233
+ }, z.core.$strict>], "kind">;
234
+ type VideoInput = z.infer<typeof videoInput>;
235
+ declare const sequenceVideoInput: z.ZodDiscriminatedUnion<[z.ZodObject<{
236
+ kind: z.ZodLiteral<"source">;
237
+ file: z.ZodObject<{
238
+ source: z.ZodObject<{
239
+ storeId: z.ZodUUID;
240
+ objectId: z.ZodUUID;
241
+ versionId: z.ZodUUID;
242
+ }, z.core.$strict>;
243
+ fileId: z.ZodUUID;
244
+ }, z.core.$strict>;
245
+ trimEndMs: z.ZodOptional<z.ZodNumber>;
246
+ }, z.core.$strict>, z.ZodObject<{
247
+ kind: z.ZodLiteral<"edit">;
248
+ editRef: z.ZodObject<{
249
+ storeId: z.ZodUUID;
250
+ objectId: z.ZodUUID;
251
+ versionId: z.ZodUUID;
252
+ }, z.core.$strict>;
253
+ }, z.core.$strict>], "kind">;
254
+ type SequenceVideoInput = z.infer<typeof sequenceVideoInput>;
255
+ declare const recipe: z.ZodObject<{
256
+ trim: z.ZodObject<{
257
+ inMs: z.ZodNumber;
258
+ outMs: z.ZodNumber;
259
+ }, z.core.$strict>;
260
+ crop: z.ZodObject<{
261
+ x: z.ZodNumber;
262
+ y: z.ZodNumber;
263
+ width: z.ZodNumber;
264
+ height: z.ZodNumber;
265
+ }, z.core.$strict>;
266
+ }, z.core.$strict>;
267
+ type Recipe = z.infer<typeof recipe>;
268
+ declare const pixelRect: z.ZodObject<{
269
+ x: z.ZodNumber;
270
+ y: z.ZodNumber;
271
+ width: z.ZodNumber;
272
+ height: z.ZodNumber;
273
+ }, z.core.$strict>;
274
+ type PixelRect = z.infer<typeof pixelRect>;
275
+ declare const geometry: z.ZodObject<{
276
+ displayWidth: z.ZodNumber;
277
+ displayHeight: z.ZodNumber;
278
+ pixelRect: z.ZodObject<{
279
+ x: z.ZodNumber;
280
+ y: z.ZodNumber;
281
+ width: z.ZodNumber;
282
+ height: z.ZodNumber;
283
+ }, z.core.$strict>;
284
+ }, z.core.$strict>;
285
+ type Geometry = z.infer<typeof geometry>;
286
+ declare const metadata: z.ZodObject<{
287
+ durationMs: z.ZodNumber;
288
+ width: z.ZodNumber;
289
+ height: z.ZodNumber;
290
+ displayWidth: z.ZodNumber;
291
+ displayHeight: z.ZodNumber;
292
+ rotation: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>;
293
+ frameRate: z.ZodNumber;
294
+ startTime: z.ZodNumber;
295
+ hasAudio: z.ZodBoolean;
296
+ audioSampleRate: z.ZodNullable<z.ZodNumber>;
297
+ audioChannels: z.ZodNullable<z.ZodNumber>;
298
+ audioStartTime: z.ZodNullable<z.ZodNumber>;
299
+ sizeBytes: z.ZodNumber;
300
+ sha256: z.ZodString;
301
+ colorInterpretation: z.ZodOptional<z.ZodEnum<{
302
+ "declared-bt709": "declared-bt709";
303
+ "assumed-bt709": "assumed-bt709";
304
+ }>>;
305
+ }, z.core.$strict>;
306
+ type VideoMetadata = z.infer<typeof metadata>;
307
+ declare const editDescriptor: z.ZodObject<{
308
+ format: z.ZodLiteral<1>;
309
+ file: z.ZodObject<{
310
+ source: z.ZodObject<{
311
+ storeId: z.ZodUUID;
312
+ objectId: z.ZodUUID;
313
+ versionId: z.ZodUUID;
314
+ }, z.core.$strict>;
315
+ fileId: z.ZodUUID;
316
+ }, z.core.$strict>;
317
+ recipe: z.ZodObject<{
318
+ trim: z.ZodObject<{
319
+ inMs: z.ZodNumber;
320
+ outMs: z.ZodNumber;
321
+ }, z.core.$strict>;
322
+ crop: z.ZodObject<{
323
+ x: z.ZodNumber;
324
+ y: z.ZodNumber;
325
+ width: z.ZodNumber;
326
+ height: z.ZodNumber;
327
+ }, z.core.$strict>;
328
+ }, z.core.$strict>;
329
+ geometry: z.ZodObject<{
330
+ displayWidth: z.ZodNumber;
331
+ displayHeight: z.ZodNumber;
332
+ pixelRect: z.ZodObject<{
333
+ x: z.ZodNumber;
334
+ y: z.ZodNumber;
335
+ width: z.ZodNumber;
336
+ height: z.ZodNumber;
337
+ }, z.core.$strict>;
338
+ }, z.core.$strict>;
339
+ metadata: z.ZodObject<{
340
+ durationMs: z.ZodNumber;
341
+ width: z.ZodNumber;
342
+ height: z.ZodNumber;
343
+ displayWidth: z.ZodNumber;
344
+ displayHeight: z.ZodNumber;
345
+ rotation: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<90>, z.ZodLiteral<180>, z.ZodLiteral<270>]>;
346
+ frameRate: z.ZodNumber;
347
+ startTime: z.ZodNumber;
348
+ hasAudio: z.ZodBoolean;
349
+ audioSampleRate: z.ZodNullable<z.ZodNumber>;
350
+ audioChannels: z.ZodNullable<z.ZodNumber>;
351
+ audioStartTime: z.ZodNullable<z.ZodNumber>;
352
+ sizeBytes: z.ZodNumber;
353
+ sha256: z.ZodString;
354
+ colorInterpretation: z.ZodOptional<z.ZodEnum<{
355
+ "declared-bt709": "declared-bt709";
356
+ "assumed-bt709": "assumed-bt709";
357
+ }>>;
358
+ }, z.core.$strict>;
359
+ }, z.core.$strict>;
360
+ type EditDescriptor = z.infer<typeof editDescriptor>;
361
+ interface SavedEdit {
362
+ editRef: VersionRef;
363
+ revision: number;
364
+ file: VideoFileRef;
365
+ recipe: Recipe;
366
+ geometry: Geometry;
367
+ effectiveDurationMs: number;
368
+ }
369
+ interface ResolvedVideo extends Omit<SavedEdit, 'editRef' | 'revision'> {
370
+ editRef: VersionRef | null;
371
+ revision: number | null;
372
+ input: VideoInput;
373
+ name: string;
374
+ versionNumber: number;
375
+ previewUrl: string;
376
+ durationMs: number;
377
+ displayWidth: number;
378
+ displayHeight: number;
379
+ edited: boolean;
380
+ colorInterpretation?: VideoMetadata['colorInterpretation'];
381
+ }
382
+ declare const saveEdit: z.ZodObject<{
383
+ file: z.ZodObject<{
384
+ source: z.ZodObject<{
385
+ storeId: z.ZodUUID;
386
+ objectId: z.ZodUUID;
387
+ versionId: z.ZodUUID;
388
+ }, z.core.$strict>;
389
+ fileId: z.ZodUUID;
390
+ }, z.core.$strict>;
391
+ recipe: z.ZodObject<{
392
+ trim: z.ZodObject<{
393
+ inMs: z.ZodNumber;
394
+ outMs: z.ZodNumber;
395
+ }, z.core.$strict>;
396
+ crop: z.ZodObject<{
397
+ x: z.ZodNumber;
398
+ y: z.ZodNumber;
399
+ width: z.ZodNumber;
400
+ height: z.ZodNumber;
401
+ }, z.core.$strict>;
402
+ }, z.core.$strict>;
403
+ editId: z.ZodOptional<z.ZodUUID>;
404
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
405
+ }, z.core.$strict>;
406
+ type SaveEdit = z.infer<typeof saveEdit>;
407
+ declare const processVideo: z.ZodObject<{
408
+ input: z.ZodDiscriminatedUnion<[z.ZodObject<{
409
+ kind: z.ZodLiteral<"source">;
410
+ file: z.ZodObject<{
411
+ source: z.ZodObject<{
412
+ storeId: z.ZodUUID;
413
+ objectId: z.ZodUUID;
414
+ versionId: z.ZodUUID;
415
+ }, z.core.$strict>;
416
+ fileId: z.ZodUUID;
417
+ }, z.core.$strict>;
418
+ }, z.core.$strict>, z.ZodObject<{
419
+ kind: z.ZodLiteral<"edit">;
420
+ editRef: z.ZodObject<{
421
+ storeId: z.ZodUUID;
422
+ objectId: z.ZodUUID;
423
+ versionId: z.ZodUUID;
424
+ }, z.core.$strict>;
425
+ }, z.core.$strict>], "kind">;
426
+ outputName: z.ZodString;
427
+ retryOfJobId: z.ZodOptional<z.ZodUUID>;
428
+ }, z.core.$strict>;
429
+ declare const canvas: z.ZodObject<{
430
+ width: z.ZodNumber;
431
+ height: z.ZodNumber;
432
+ }, z.core.$strict>;
433
+ declare const processSequence: z.ZodObject<{
434
+ inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
435
+ kind: z.ZodLiteral<"source">;
436
+ file: z.ZodObject<{
437
+ source: z.ZodObject<{
438
+ storeId: z.ZodUUID;
439
+ objectId: z.ZodUUID;
440
+ versionId: z.ZodUUID;
441
+ }, z.core.$strict>;
442
+ fileId: z.ZodUUID;
443
+ }, z.core.$strict>;
444
+ trimEndMs: z.ZodOptional<z.ZodNumber>;
445
+ }, z.core.$strict>, z.ZodObject<{
446
+ kind: z.ZodLiteral<"edit">;
447
+ editRef: z.ZodObject<{
448
+ storeId: z.ZodUUID;
449
+ objectId: z.ZodUUID;
450
+ versionId: z.ZodUUID;
451
+ }, z.core.$strict>;
452
+ }, z.core.$strict>], "kind">>;
453
+ outputName: z.ZodString;
454
+ canvas: z.ZodObject<{
455
+ width: z.ZodNumber;
456
+ height: z.ZodNumber;
457
+ }, z.core.$strict>;
458
+ retryOfJobId: z.ZodOptional<z.ZodUUID>;
459
+ }, z.core.$strict>;
460
+ type ProcessVideo = z.infer<typeof processVideo>;
461
+ type ProcessSequence = z.infer<typeof processSequence>;
462
+ type MediaRequest = {
463
+ operation: 'video.process';
464
+ input: ProcessVideo;
465
+ } | {
466
+ operation: 'sequence.process';
467
+ input: ProcessSequence;
468
+ };
469
+ declare const mediaRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
470
+ operation: z.ZodLiteral<"video.process">;
471
+ input: z.ZodObject<{
472
+ input: z.ZodDiscriminatedUnion<[z.ZodObject<{
473
+ kind: z.ZodLiteral<"source">;
474
+ file: z.ZodObject<{
475
+ source: z.ZodObject<{
476
+ storeId: z.ZodUUID;
477
+ objectId: z.ZodUUID;
478
+ versionId: z.ZodUUID;
479
+ }, z.core.$strict>;
480
+ fileId: z.ZodUUID;
481
+ }, z.core.$strict>;
482
+ }, z.core.$strict>, z.ZodObject<{
483
+ kind: z.ZodLiteral<"edit">;
484
+ editRef: z.ZodObject<{
485
+ storeId: z.ZodUUID;
486
+ objectId: z.ZodUUID;
487
+ versionId: z.ZodUUID;
488
+ }, z.core.$strict>;
489
+ }, z.core.$strict>], "kind">;
490
+ outputName: z.ZodString;
491
+ retryOfJobId: z.ZodOptional<z.ZodUUID>;
492
+ }, z.core.$strict>;
493
+ }, z.core.$strict>, z.ZodObject<{
494
+ operation: z.ZodLiteral<"sequence.process">;
495
+ input: z.ZodObject<{
496
+ inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
497
+ kind: z.ZodLiteral<"source">;
498
+ file: z.ZodObject<{
499
+ source: z.ZodObject<{
500
+ storeId: z.ZodUUID;
501
+ objectId: z.ZodUUID;
502
+ versionId: z.ZodUUID;
503
+ }, z.core.$strict>;
504
+ fileId: z.ZodUUID;
505
+ }, z.core.$strict>;
506
+ trimEndMs: z.ZodOptional<z.ZodNumber>;
507
+ }, z.core.$strict>, z.ZodObject<{
508
+ kind: z.ZodLiteral<"edit">;
509
+ editRef: z.ZodObject<{
510
+ storeId: z.ZodUUID;
511
+ objectId: z.ZodUUID;
512
+ versionId: z.ZodUUID;
513
+ }, z.core.$strict>;
514
+ }, z.core.$strict>], "kind">>;
515
+ outputName: z.ZodString;
516
+ canvas: z.ZodObject<{
517
+ width: z.ZodNumber;
518
+ height: z.ZodNumber;
519
+ }, z.core.$strict>;
520
+ retryOfJobId: z.ZodOptional<z.ZodUUID>;
521
+ }, z.core.$strict>;
522
+ }, z.core.$strict>], "operation">;
523
+ declare const jobStates: readonly ["queued", "running", "saving", "succeeded", "failed", "canceled", "interrupted"];
524
+ type JobState = (typeof jobStates)[number];
525
+ interface AcceptedJob {
526
+ jobId: string;
527
+ state: JobState;
528
+ }
529
+ interface MediaJob extends AcceptedJob {
530
+ kind: 'video' | 'sequence';
531
+ revision: number;
532
+ progress: number | null;
533
+ cancelRequested: boolean;
534
+ result: VideoFileRef | null;
535
+ error: {
536
+ code: string;
537
+ message: string;
538
+ } | null;
539
+ outputName: string;
540
+ createdAt: string;
541
+ updatedAt: string;
542
+ retryRequest: MediaRequest;
543
+ cleanupPending: boolean;
544
+ }
545
+ declare const jobsQuery: z.ZodObject<{
546
+ limit: z.ZodDefault<z.ZodNumber>;
547
+ offset: z.ZodDefault<z.ZodNumber>;
548
+ request: z.ZodOptional<z.ZodObject<{
549
+ operation: z.ZodEnum<{
550
+ "video.process": "video.process";
551
+ "sequence.process": "sequence.process";
552
+ }>;
553
+ requestKey: z.ZodString;
554
+ intent: z.ZodUnion<readonly [z.ZodObject<{
555
+ input: z.ZodDiscriminatedUnion<[z.ZodObject<{
556
+ kind: z.ZodLiteral<"source">;
557
+ file: z.ZodObject<{
558
+ source: z.ZodObject<{
559
+ storeId: z.ZodUUID;
560
+ objectId: z.ZodUUID;
561
+ versionId: z.ZodUUID;
562
+ }, z.core.$strict>;
563
+ fileId: z.ZodUUID;
564
+ }, z.core.$strict>;
565
+ }, z.core.$strict>, z.ZodObject<{
566
+ kind: z.ZodLiteral<"edit">;
567
+ editRef: z.ZodObject<{
568
+ storeId: z.ZodUUID;
569
+ objectId: z.ZodUUID;
570
+ versionId: z.ZodUUID;
571
+ }, z.core.$strict>;
572
+ }, z.core.$strict>], "kind">;
573
+ outputName: z.ZodString;
574
+ retryOfJobId: z.ZodOptional<z.ZodUUID>;
575
+ }, z.core.$strict>, z.ZodObject<{
576
+ inputs: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
577
+ kind: z.ZodLiteral<"source">;
578
+ file: z.ZodObject<{
579
+ source: z.ZodObject<{
580
+ storeId: z.ZodUUID;
581
+ objectId: z.ZodUUID;
582
+ versionId: z.ZodUUID;
583
+ }, z.core.$strict>;
584
+ fileId: z.ZodUUID;
585
+ }, z.core.$strict>;
586
+ trimEndMs: z.ZodOptional<z.ZodNumber>;
587
+ }, z.core.$strict>, z.ZodObject<{
588
+ kind: z.ZodLiteral<"edit">;
589
+ editRef: z.ZodObject<{
590
+ storeId: z.ZodUUID;
591
+ objectId: z.ZodUUID;
592
+ versionId: z.ZodUUID;
593
+ }, z.core.$strict>;
594
+ }, z.core.$strict>], "kind">>;
595
+ outputName: z.ZodString;
596
+ canvas: z.ZodObject<{
597
+ width: z.ZodNumber;
598
+ height: z.ZodNumber;
599
+ }, z.core.$strict>;
600
+ retryOfJobId: z.ZodOptional<z.ZodUUID>;
601
+ }, z.core.$strict>]>;
602
+ }, z.core.$strict>>;
603
+ }, z.core.$strict>;
604
+ interface JobPage {
605
+ items: MediaJob[];
606
+ nextOffset: number | null;
607
+ }
608
+ interface VideoEditorProps {
609
+ input: VideoInput;
610
+ mode: 'crop' | 'trim';
611
+ onApply(saved: SavedEdit): Promise<void>;
612
+ onClose(): void;
613
+ }
614
+ interface CompareSlot {
615
+ id: string;
616
+ input: VideoInput | null;
617
+ context?: {
618
+ shotName?: string;
619
+ hook?: string;
620
+ cta?: string;
621
+ };
622
+ }
623
+ interface VideoCompareProps {
624
+ slots: CompareSlot[];
625
+ origin: string;
626
+ onSlotsChange(slots: CompareSlot[]): void;
627
+ candidates?: readonly {
628
+ label: string;
629
+ input: VideoInput;
630
+ context?: CompareSlot['context'];
631
+ }[];
632
+ onRequestReplacement?(slotId: string): Promise<VideoInput | null>;
633
+ onOpenDetails(input: VideoInput, back: {
634
+ slots: CompareSlot[];
635
+ origin: string;
636
+ }): void;
637
+ renderSlotActions?(slot: CompareSlot): ReactNode;
638
+ }
639
+ interface MediaJobsProps {
640
+ onOpenResult?(result: VideoFileRef): void;
641
+ }
642
+ interface MediaToolsService {
643
+ readonly capabilityVersion: 'media-tools/1';
644
+ readonly storeId: string;
645
+ readonly projectId: string;
646
+ getEdit(editRef: VersionRef): Promise<SavedEdit>;
647
+ resolve(input: VideoInput): Promise<ResolvedVideo>;
648
+ }
649
+ declare function mediaError(code: string, message: string): never;
650
+ /** Canonical crop grid shared by live previews, saved edits and native execution. */
651
+ declare function normalizeRecipe(raw: Recipe, displayWidth: number, displayHeight: number, durationMs: number): {
652
+ recipe: Recipe;
653
+ geometry: Geometry;
654
+ };
655
+ declare function sameFile(a: VideoFileRef, b: VideoFileRef): boolean;
656
+ type EditReadData = Readonly<Pick<DataAPI, 'storeId' | 'scope' | 'get' | 'version' | 'files'>>;
657
+ declare function readSavedEdit(data: EditReadData, raw: VersionRef): SavedEdit;
658
+ interface MediaToolsClient {
659
+ readonly capabilityVersion: 'media-tools/client/1';
660
+ submit(request: MediaRequest, requestKey: string): Promise<AcceptedJob>;
661
+ resolve(input: VideoInput): Promise<ResolvedVideo>;
662
+ }
663
+
664
+ export { type AcceptedJob, type CompareSlot, Config, type EditDescriptor, type EditReadData, type Geometry, type JobPage, type JobState, type MediaJob, type MediaJobsProps, type MediaRequest, type MediaToolsClient, type MediaToolsConfig, type MediaToolsService, type PixelRect, type ProcessSequence, type ProcessVideo, type Recipe, type ResolvedVideo, type SaveEdit, type SavedEdit, type SequenceVideoInput, type VideoCompareProps, type VideoEditorProps, type VideoFileRef, type VideoInput, type VideoMetadata, canvas, editDescriptor, geometry, jobStates, jobsQuery, mediaError, mediaRequest, metadata, normalizeRecipe, packageVersion, processSequence, processVideo, readSavedEdit, recipe, sameFile, saveEdit, versionRef, videoFileRef, videoInput };