@vivix-labs/dashboard-projects 1.0.0-beta.20 → 1.0.0-beta.21
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/client-code.js +133 -101
- package/package.json +1 -1
package/dist/client-code.js
CHANGED
|
@@ -1,53 +1,86 @@
|
|
|
1
1
|
// packages/dashboard-projects/src/client.tsx
|
|
2
2
|
import * as React2 from "react";
|
|
3
|
-
import { z as
|
|
3
|
+
import { z as z5 } from "vivix-studio/sdk/shared";
|
|
4
4
|
|
|
5
5
|
// packages/project-studio/dist/shared.js
|
|
6
|
-
import { z as z2
|
|
6
|
+
import { PluginError, z as z2 } from "vivix-studio/sdk/shared";
|
|
7
7
|
import { z } from "vivix-studio/sdk/shared";
|
|
8
|
+
import { z as z4, defineOperation } from "vivix-studio/sdk/shared";
|
|
9
|
+
import { z as z3 } from "vivix-studio/sdk/shared";
|
|
8
10
|
var creditsFormat = new Intl.NumberFormat("en-US", {
|
|
9
11
|
minimumFractionDigits: 1,
|
|
10
12
|
maximumFractionDigits: 1,
|
|
11
13
|
useGrouping: false
|
|
12
14
|
});
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var taskBilling = z.object({
|
|
16
|
+
status: z.enum(["pending", "settled", "released", "unavailable"]),
|
|
17
|
+
credits: z.string().regex(/^\d+(?:\.\d+)?$/).nullable()
|
|
18
|
+
}).strict().refine(
|
|
19
|
+
(value) => value.status === "settled" ? value.credits !== null : value.status === "released" ? value.credits === "0" : value.credits === null
|
|
20
|
+
);
|
|
21
|
+
var vivixVoiceModel = "vivix-tts-1.0";
|
|
22
|
+
var defaultVoiceOperations = ["voice.design", "voice.clone"];
|
|
23
|
+
function resolveGenerationInput(input, ctx) {
|
|
24
|
+
const defaultsToVivix = defaultVoiceOperations.some(
|
|
25
|
+
(operation) => operation === input.capabilityId
|
|
26
|
+
);
|
|
27
|
+
const modelId = input.modelId ?? (defaultsToVivix ? vivixVoiceModel : void 0);
|
|
28
|
+
if (!modelId) {
|
|
29
|
+
ctx.addIssue({
|
|
30
|
+
code: "custom",
|
|
31
|
+
path: ["modelId"],
|
|
32
|
+
message: "Select a model for this operation."
|
|
33
|
+
});
|
|
34
|
+
return z2.NEVER;
|
|
35
|
+
}
|
|
36
|
+
if (input.prompt === void 0 && !defaultsToVivix && input.capabilityId !== "voice.create") {
|
|
37
|
+
ctx.addIssue({
|
|
38
|
+
code: "custom",
|
|
39
|
+
path: ["prompt"],
|
|
40
|
+
message: "A prompt is required for this operation."
|
|
41
|
+
});
|
|
42
|
+
return z2.NEVER;
|
|
43
|
+
}
|
|
44
|
+
return { ...input, modelId, prompt: input.prompt ?? "" };
|
|
45
|
+
}
|
|
46
|
+
var fixedRef = z3.object({ storeId: z3.uuid(), objectId: z3.uuid(), versionId: z3.uuid() }).strict();
|
|
47
|
+
var copy = z3.string().max(8e3).default("");
|
|
48
|
+
var clipScript = z3.object({
|
|
49
|
+
title: z3.string().trim().min(1).max(200),
|
|
17
50
|
visual: copy,
|
|
18
51
|
voiceover: copy,
|
|
19
52
|
onScreenText: copy,
|
|
20
53
|
cta: copy,
|
|
21
|
-
plannedDurationMs:
|
|
54
|
+
plannedDurationMs: z3.number().int().positive().nullable().default(null)
|
|
22
55
|
}).strict();
|
|
23
|
-
var adBrief =
|
|
56
|
+
var adBrief = z3.object({
|
|
24
57
|
product: copy,
|
|
25
58
|
category: copy,
|
|
26
59
|
audience: copy,
|
|
27
60
|
sellingPoints: copy,
|
|
28
61
|
channel: copy,
|
|
29
|
-
aspectRatio:
|
|
30
|
-
targetDurationMs:
|
|
62
|
+
aspectRatio: z3.string().max(40).nullable().default(null),
|
|
63
|
+
targetDurationMs: z3.number().int().positive().nullable().default(null),
|
|
31
64
|
body: copy,
|
|
32
|
-
productRefs:
|
|
33
|
-
modelRefs:
|
|
65
|
+
productRefs: z3.array(fixedRef).max(100).default([]),
|
|
66
|
+
modelRefs: z3.array(fixedRef).max(100).default([])
|
|
34
67
|
}).strict();
|
|
35
|
-
var adFilm =
|
|
36
|
-
title:
|
|
68
|
+
var adFilm = z3.object({
|
|
69
|
+
title: z3.string().trim().min(1).max(150),
|
|
37
70
|
source: fixedRef,
|
|
38
|
-
width:
|
|
39
|
-
height:
|
|
40
|
-
aspectRatio:
|
|
71
|
+
width: z3.number().int().positive().max(8192),
|
|
72
|
+
height: z3.number().int().positive().max(8192),
|
|
73
|
+
aspectRatio: z3.string().regex(/^\d+:\d+$/)
|
|
41
74
|
}).strict();
|
|
42
|
-
var adStoryboard =
|
|
75
|
+
var adStoryboard = z3.object({
|
|
43
76
|
brief: adBrief,
|
|
44
|
-
films:
|
|
45
|
-
clips:
|
|
46
|
-
|
|
47
|
-
assetId:
|
|
48
|
-
filmId:
|
|
77
|
+
films: z3.array(adFilm).max(100).optional(),
|
|
78
|
+
clips: z3.array(
|
|
79
|
+
z3.object({
|
|
80
|
+
assetId: z3.uuid(),
|
|
81
|
+
filmId: z3.uuid().optional(),
|
|
49
82
|
script: clipScript,
|
|
50
|
-
edits:
|
|
83
|
+
edits: z3.array(z3.object({ sourceVersionId: z3.uuid(), editRef: fixedRef }).strict()).max(200)
|
|
51
84
|
}).strict()
|
|
52
85
|
).max(200)
|
|
53
86
|
}).strict().superRefine((value, context) => {
|
|
@@ -60,33 +93,33 @@ var adStoryboard = z.object({
|
|
|
60
93
|
message: "Each candidate has one current edit binding."
|
|
61
94
|
});
|
|
62
95
|
});
|
|
63
|
-
var projectType =
|
|
64
|
-
var studioConfig =
|
|
65
|
-
role:
|
|
96
|
+
var projectType = z4.enum(["short-drama", "product-ad", "other"]);
|
|
97
|
+
var studioConfig = z4.object({
|
|
98
|
+
role: z4.enum(["project", "coordinator"]).default("project"),
|
|
66
99
|
projectType: projectType.optional(),
|
|
67
|
-
dataInstance:
|
|
68
|
-
apiInstance:
|
|
69
|
-
libraryInstance:
|
|
70
|
-
coordinatorInstance:
|
|
100
|
+
dataInstance: z4.string().min(1).default("user:data"),
|
|
101
|
+
apiInstance: z4.string().min(1).default("api"),
|
|
102
|
+
libraryInstance: z4.string().min(1).nullable().default(null),
|
|
103
|
+
coordinatorInstance: z4.string().min(1).optional()
|
|
71
104
|
}).strict();
|
|
72
|
-
var versionRef =
|
|
73
|
-
var tags =
|
|
74
|
-
var kind =
|
|
75
|
-
var projectData =
|
|
76
|
-
name:
|
|
77
|
-
description:
|
|
78
|
-
status:
|
|
79
|
-
aspectRatio:
|
|
105
|
+
var versionRef = z4.object({ storeId: z4.uuid(), objectId: z4.uuid(), versionId: z4.uuid() }).strict();
|
|
106
|
+
var tags = z4.array(z4.string().trim().min(1).max(64)).max(50).transform((x) => [...new Set(x)]).default([]);
|
|
107
|
+
var kind = z4.enum(["text", "image", "video", "audio", "file"]);
|
|
108
|
+
var projectData = z4.object({
|
|
109
|
+
name: z4.string().trim().min(1).max(120),
|
|
110
|
+
description: z4.string().max(4e3).default(""),
|
|
111
|
+
status: z4.enum(["draft", "active", "archived"]).default("draft"),
|
|
112
|
+
aspectRatio: z4.string().nullable().default(null),
|
|
80
113
|
projectType: projectType.optional(),
|
|
81
114
|
coverRef: versionRef.nullable().default(null),
|
|
82
|
-
briefRef:
|
|
115
|
+
briefRef: z4.object({ storeId: z4.uuid(), objectId: z4.uuid() }).strict().nullable().optional().transform(() => void 0),
|
|
83
116
|
tags
|
|
84
117
|
}).strict();
|
|
85
|
-
var assetData =
|
|
86
|
-
projectId:
|
|
87
|
-
name:
|
|
118
|
+
var assetData = z4.object({
|
|
119
|
+
projectId: z4.uuid(),
|
|
120
|
+
name: z4.string().trim().min(1).max(200),
|
|
88
121
|
kind,
|
|
89
|
-
purpose:
|
|
122
|
+
purpose: z4.enum([
|
|
90
123
|
"reference",
|
|
91
124
|
"script",
|
|
92
125
|
"shot",
|
|
@@ -97,57 +130,56 @@ var assetData = z2.object({
|
|
|
97
130
|
"final",
|
|
98
131
|
"other"
|
|
99
132
|
]).default("other"),
|
|
100
|
-
origin:
|
|
101
|
-
orderKey:
|
|
133
|
+
origin: z4.enum(["upload", "library", "generated", "authored"]),
|
|
134
|
+
orderKey: z4.number().int().nullable().default(null),
|
|
102
135
|
tags,
|
|
103
|
-
lifecycle:
|
|
136
|
+
lifecycle: z4.enum(["draft", "ready", "archived"]).default("draft"),
|
|
104
137
|
sourceRef: versionRef.nullable().default(null),
|
|
105
|
-
adoptedVersionId:
|
|
138
|
+
adoptedVersionId: z4.uuid().nullable().default(null)
|
|
106
139
|
}).strict();
|
|
107
140
|
var storedAssetData = assetData.extend({
|
|
108
|
-
purpose:
|
|
141
|
+
purpose: z4.union([assetData.shape.purpose, z4.literal("speech")])
|
|
109
142
|
});
|
|
110
|
-
var generationFields =
|
|
111
|
-
targetAssetId:
|
|
112
|
-
taskName:
|
|
113
|
-
context:
|
|
143
|
+
var generationFields = z4.object({
|
|
144
|
+
targetAssetId: z4.uuid().optional(),
|
|
145
|
+
taskName: z4.string().trim().min(1).max(200).optional(),
|
|
146
|
+
context: z4.record(z4.string().min(1).max(64), z4.string().min(1).max(200)).describe(
|
|
114
147
|
"Owning-domain binding stored with the task. Short drama passes { episodeId, shotId } so the finished take attaches to that shot; production.generateShot sets it automatically."
|
|
115
148
|
).optional(),
|
|
116
|
-
expectedRevision:
|
|
117
|
-
newAsset:
|
|
118
|
-
name:
|
|
119
|
-
kind:
|
|
149
|
+
expectedRevision: z4.number().int().positive().optional(),
|
|
150
|
+
newAsset: z4.object({
|
|
151
|
+
name: z4.string().trim().min(1).max(200),
|
|
152
|
+
kind: z4.enum(["image", "video", "audio"]),
|
|
120
153
|
purpose: assetData.shape.purpose.unwrap().optional(),
|
|
121
154
|
tags: tags.unwrap().optional()
|
|
122
155
|
}).strict().optional(),
|
|
123
|
-
modelId:
|
|
124
|
-
capabilityId:
|
|
125
|
-
prompt:
|
|
156
|
+
modelId: z4.string().min(1),
|
|
157
|
+
capabilityId: z4.string().min(1),
|
|
158
|
+
prompt: z4.string().max(32e3).optional(),
|
|
126
159
|
voiceRef: versionRef.optional(),
|
|
127
|
-
parameters:
|
|
128
|
-
outputCount:
|
|
129
|
-
inputs:
|
|
130
|
-
|
|
160
|
+
parameters: z4.record(z4.string(), z4.unknown()).default({}),
|
|
161
|
+
outputCount: z4.number().int().min(1).max(100).default(1),
|
|
162
|
+
inputs: z4.array(
|
|
163
|
+
z4.object({
|
|
131
164
|
ref: versionRef,
|
|
132
|
-
role:
|
|
133
|
-
order:
|
|
134
|
-
weight:
|
|
165
|
+
role: z4.string().min(1),
|
|
166
|
+
order: z4.number().int().nonnegative(),
|
|
167
|
+
weight: z4.number().finite().nullable().default(null)
|
|
135
168
|
}).strict()
|
|
136
169
|
).max(100).default([]),
|
|
137
|
-
baseVersionId:
|
|
138
|
-
changeRequest:
|
|
139
|
-
preserveRequest:
|
|
140
|
-
anchor:
|
|
141
|
-
retryOfTaskId:
|
|
142
|
-
acknowledgeUnknown:
|
|
170
|
+
baseVersionId: z4.uuid().optional(),
|
|
171
|
+
changeRequest: z4.string().trim().min(1).max(4e3).optional(),
|
|
172
|
+
preserveRequest: z4.string().max(4e3).default(""),
|
|
173
|
+
anchor: z4.object({ kind: z4.literal("whole") }).strict().optional().describe("Deprecated whole-version selection."),
|
|
174
|
+
retryOfTaskId: z4.uuid().optional(),
|
|
175
|
+
acknowledgeUnknown: z4.boolean().optional()
|
|
143
176
|
}).strict();
|
|
144
|
-
var generationInput = generationFields.
|
|
145
|
-
(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
expectedRevision: z2.number().int().positive(),
|
|
177
|
+
var generationInput = generationFields.extend({
|
|
178
|
+
modelId: generationFields.shape.modelId.optional().describe("Defaults to vivix-tts-1.0 for voice.design and voice.clone.")
|
|
179
|
+
}).transform(resolveGenerationInput);
|
|
180
|
+
var projectSettingsInput = z4.object({
|
|
181
|
+
projectId: z4.uuid(),
|
|
182
|
+
expectedRevision: z4.number().int().positive(),
|
|
151
183
|
changes: projectData.pick({ name: true, description: true, tags: true, aspectRatio: true, coverRef: true }).extend({
|
|
152
184
|
description: projectData.shape.description.unwrap(),
|
|
153
185
|
tags: projectData.shape.tags.unwrap(),
|
|
@@ -159,12 +191,12 @@ function generationReceiptPredecessors() {
|
|
|
159
191
|
const legacy = generationFields.omit({ voiceRef: true }).extend({
|
|
160
192
|
prompt: generationFields.shape.prompt.unwrap(),
|
|
161
193
|
newAsset: generationFields.shape.newAsset.unwrap().omit({ purpose: true, tags: true }).optional(),
|
|
162
|
-
anchor:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
kind:
|
|
166
|
-
startMs:
|
|
167
|
-
endMs:
|
|
194
|
+
anchor: z4.discriminatedUnion("kind", [
|
|
195
|
+
z4.object({ kind: z4.literal("whole") }).strict(),
|
|
196
|
+
z4.object({
|
|
197
|
+
kind: z4.literal("timeRange"),
|
|
198
|
+
startMs: z4.number().int().nonnegative(),
|
|
199
|
+
endMs: z4.number().int().nonnegative()
|
|
168
200
|
}).strict()
|
|
169
201
|
]).default({ kind: "whole" })
|
|
170
202
|
});
|
|
@@ -193,7 +225,7 @@ function generationReceiptPredecessors() {
|
|
|
193
225
|
{ packageVersion: "1.0.0-beta.25", input: generationInput },
|
|
194
226
|
// The non-voice beta.22 branch used the original required prompt schema.
|
|
195
227
|
{ packageVersion: "1.0.0-beta.22", input: legacy }
|
|
196
|
-
].map((previous) => ({ ...previous, output:
|
|
228
|
+
].map((previous) => ({ ...previous, output: z4.any() }));
|
|
197
229
|
}
|
|
198
230
|
var generationSubmitOperation = defineOperation({
|
|
199
231
|
id: "generation.submit",
|
|
@@ -201,22 +233,22 @@ var generationSubmitOperation = defineOperation({
|
|
|
201
233
|
description: "Submit one media generation without approval, retaining its paid request identity. Pass context with the owning domain identifiers; without it the output is only stored in the media library.",
|
|
202
234
|
input: generationInput,
|
|
203
235
|
receiptPredecessors: generationReceiptPredecessors,
|
|
204
|
-
output:
|
|
236
|
+
output: z4.any(),
|
|
205
237
|
effects: ["write", "paid"],
|
|
206
238
|
confirm: "none"
|
|
207
239
|
});
|
|
208
|
-
var favoriteData =
|
|
209
|
-
var sqlScalar =
|
|
210
|
-
var globalQueryInput =
|
|
211
|
-
sql:
|
|
212
|
-
params:
|
|
213
|
-
timeoutMs:
|
|
214
|
-
maxRows:
|
|
215
|
-
limit:
|
|
216
|
-
offset:
|
|
217
|
-
source:
|
|
218
|
-
excludeProjectIds:
|
|
219
|
-
catalog:
|
|
240
|
+
var favoriteData = z4.object({ ref: versionRef }).strict();
|
|
241
|
+
var sqlScalar = z4.union([z4.string(), z4.number().finite(), z4.null()]);
|
|
242
|
+
var globalQueryInput = z4.object({
|
|
243
|
+
sql: z4.string().trim().min(1),
|
|
244
|
+
params: z4.union([z4.array(sqlScalar), z4.record(z4.string(), sqlScalar)]).optional(),
|
|
245
|
+
timeoutMs: z4.number().int().positive().optional(),
|
|
246
|
+
maxRows: z4.number().int().positive().optional(),
|
|
247
|
+
limit: z4.number().int().min(1).max(200).optional(),
|
|
248
|
+
offset: z4.number().int().nonnegative().optional(),
|
|
249
|
+
source: z4.enum(["projects", "assets", "tasks"]),
|
|
250
|
+
excludeProjectIds: z4.array(z4.uuid()).optional(),
|
|
251
|
+
catalog: z4.array(z4.object({ id: z4.string().min(1), name: z4.string(), available: z4.boolean() }).strict()).optional()
|
|
220
252
|
}).strict();
|
|
221
253
|
var projectListSql = "SELECT rowId, projectId, name, available, createdAt, coverRef FROM studio_projects ORDER BY createdAt DESC, rowId ASC";
|
|
222
254
|
|
|
@@ -786,7 +818,7 @@ function NewProjectDialog({
|
|
|
786
818
|
|
|
787
819
|
// packages/dashboard-projects/src/client.tsx
|
|
788
820
|
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
789
|
-
var Config =
|
|
821
|
+
var Config = z5.object({ studioInstance: z5.string().min(1).nullable().default(null) });
|
|
790
822
|
var dependencies = (config) => config.studioInstance ? [config.studioInstance] : [];
|
|
791
823
|
function decodeRef(value) {
|
|
792
824
|
let item = value;
|