@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.
Files changed (2) hide show
  1. package/dist/client-code.js +133 -101
  2. package/package.json +1 -1
@@ -1,53 +1,86 @@
1
1
  // packages/dashboard-projects/src/client.tsx
2
2
  import * as React2 from "react";
3
- import { z as z3 } from "vivix-studio/sdk/shared";
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, defineOperation } from "vivix-studio/sdk/shared";
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 fixedRef = z.object({ storeId: z.uuid(), objectId: z.uuid(), versionId: z.uuid() }).strict();
14
- var copy = z.string().max(8e3).default("");
15
- var clipScript = z.object({
16
- title: z.string().trim().min(1).max(200),
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: z.number().int().positive().nullable().default(null)
54
+ plannedDurationMs: z3.number().int().positive().nullable().default(null)
22
55
  }).strict();
23
- var adBrief = z.object({
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: z.string().max(40).nullable().default(null),
30
- targetDurationMs: z.number().int().positive().nullable().default(null),
62
+ aspectRatio: z3.string().max(40).nullable().default(null),
63
+ targetDurationMs: z3.number().int().positive().nullable().default(null),
31
64
  body: copy,
32
- productRefs: z.array(fixedRef).max(100).default([]),
33
- modelRefs: z.array(fixedRef).max(100).default([])
65
+ productRefs: z3.array(fixedRef).max(100).default([]),
66
+ modelRefs: z3.array(fixedRef).max(100).default([])
34
67
  }).strict();
35
- var adFilm = z.object({
36
- title: z.string().trim().min(1).max(150),
68
+ var adFilm = z3.object({
69
+ title: z3.string().trim().min(1).max(150),
37
70
  source: fixedRef,
38
- width: z.number().int().positive().max(8192),
39
- height: z.number().int().positive().max(8192),
40
- aspectRatio: z.string().regex(/^\d+:\d+$/)
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 = z.object({
75
+ var adStoryboard = z3.object({
43
76
  brief: adBrief,
44
- films: z.array(adFilm).max(100).optional(),
45
- clips: z.array(
46
- z.object({
47
- assetId: z.uuid(),
48
- filmId: z.uuid().optional(),
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: z.array(z.object({ sourceVersionId: z.uuid(), editRef: fixedRef }).strict()).max(200)
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 = z2.enum(["short-drama", "product-ad", "other"]);
64
- var studioConfig = z2.object({
65
- role: z2.enum(["project", "coordinator"]).default("project"),
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: z2.string().min(1).default("user:data"),
68
- apiInstance: z2.string().min(1).default("api"),
69
- libraryInstance: z2.string().min(1).nullable().default(null),
70
- coordinatorInstance: z2.string().min(1).optional()
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 = z2.object({ storeId: z2.uuid(), objectId: z2.uuid(), versionId: z2.uuid() }).strict();
73
- var tags = z2.array(z2.string().trim().min(1).max(64)).max(50).transform((x) => [...new Set(x)]).default([]);
74
- var kind = z2.enum(["text", "image", "video", "audio", "file"]);
75
- var projectData = z2.object({
76
- name: z2.string().trim().min(1).max(120),
77
- description: z2.string().max(4e3).default(""),
78
- status: z2.enum(["draft", "active", "archived"]).default("draft"),
79
- aspectRatio: z2.string().nullable().default(null),
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: z2.object({ storeId: z2.uuid(), objectId: z2.uuid() }).strict().nullable().optional().transform(() => void 0),
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 = z2.object({
86
- projectId: z2.uuid(),
87
- name: z2.string().trim().min(1).max(200),
118
+ var assetData = z4.object({
119
+ projectId: z4.uuid(),
120
+ name: z4.string().trim().min(1).max(200),
88
121
  kind,
89
- purpose: z2.enum([
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: z2.enum(["upload", "library", "generated", "authored"]),
101
- orderKey: z2.number().int().nullable().default(null),
133
+ origin: z4.enum(["upload", "library", "generated", "authored"]),
134
+ orderKey: z4.number().int().nullable().default(null),
102
135
  tags,
103
- lifecycle: z2.enum(["draft", "ready", "archived"]).default("draft"),
136
+ lifecycle: z4.enum(["draft", "ready", "archived"]).default("draft"),
104
137
  sourceRef: versionRef.nullable().default(null),
105
- adoptedVersionId: z2.uuid().nullable().default(null)
138
+ adoptedVersionId: z4.uuid().nullable().default(null)
106
139
  }).strict();
107
140
  var storedAssetData = assetData.extend({
108
- purpose: z2.union([assetData.shape.purpose, z2.literal("speech")])
141
+ purpose: z4.union([assetData.shape.purpose, z4.literal("speech")])
109
142
  });
110
- var generationFields = z2.object({
111
- targetAssetId: z2.uuid().optional(),
112
- taskName: z2.string().trim().min(1).max(200).optional(),
113
- context: z2.record(z2.string().min(1).max(64), z2.string().min(1).max(200)).describe(
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: z2.number().int().positive().optional(),
117
- newAsset: z2.object({
118
- name: z2.string().trim().min(1).max(200),
119
- kind: z2.enum(["image", "video", "audio"]),
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: z2.string().min(1),
124
- capabilityId: z2.string().min(1),
125
- prompt: z2.string().max(32e3).optional(),
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: z2.record(z2.string(), z2.unknown()).default({}),
128
- outputCount: z2.number().int().min(1).max(100).default(1),
129
- inputs: z2.array(
130
- z2.object({
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: z2.string().min(1),
133
- order: z2.number().int().nonnegative(),
134
- weight: z2.number().finite().nullable().default(null)
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: z2.uuid().optional(),
138
- changeRequest: z2.string().trim().min(1).max(4e3).optional(),
139
- preserveRequest: z2.string().max(4e3).default(""),
140
- anchor: z2.object({ kind: z2.literal("whole") }).strict().optional().describe("Deprecated whole-version selection."),
141
- retryOfTaskId: z2.uuid().optional(),
142
- acknowledgeUnknown: z2.boolean().optional()
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.refine(
145
- (input) => input.prompt !== void 0 || ["voice.clone", "voice.create"].includes(input.capabilityId),
146
- { path: ["prompt"], message: "A prompt is required for this operation." }
147
- ).transform((input) => ({ ...input, prompt: input.prompt ?? "" }));
148
- var projectSettingsInput = z2.object({
149
- projectId: z2.uuid(),
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: z2.discriminatedUnion("kind", [
163
- z2.object({ kind: z2.literal("whole") }).strict(),
164
- z2.object({
165
- kind: z2.literal("timeRange"),
166
- startMs: z2.number().int().nonnegative(),
167
- endMs: z2.number().int().nonnegative()
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: z2.any() }));
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: z2.any(),
236
+ output: z4.any(),
205
237
  effects: ["write", "paid"],
206
238
  confirm: "none"
207
239
  });
208
- var favoriteData = z2.object({ ref: versionRef }).strict();
209
- var sqlScalar = z2.union([z2.string(), z2.number().finite(), z2.null()]);
210
- var globalQueryInput = z2.object({
211
- sql: z2.string().trim().min(1),
212
- params: z2.union([z2.array(sqlScalar), z2.record(z2.string(), sqlScalar)]).optional(),
213
- timeoutMs: z2.number().int().positive().optional(),
214
- maxRows: z2.number().int().positive().optional(),
215
- limit: z2.number().int().min(1).max(200).optional(),
216
- offset: z2.number().int().nonnegative().optional(),
217
- source: z2.enum(["projects", "assets", "tasks"]),
218
- excludeProjectIds: z2.array(z2.uuid()).optional(),
219
- catalog: z2.array(z2.object({ id: z2.string().min(1), name: z2.string(), available: z2.boolean() }).strict()).optional()
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 = z3.object({ studioInstance: z3.string().min(1).nullable().default(null) });
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vivix-labs/dashboard-projects",
3
- "version": "1.0.0-beta.20",
3
+ "version": "1.0.0-beta.21",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",