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