@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.
Files changed (2) hide show
  1. package/dist/client-code.js +138 -101
  2. package/package.json +1 -1
@@ -1,53 +1,91 @@
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 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: z.number().int().positive().nullable().default(null)
59
+ plannedDurationMs: z3.number().int().positive().nullable().default(null)
22
60
  }).strict();
23
- var adBrief = z.object({
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: z.string().max(40).nullable().default(null),
30
- targetDurationMs: z.number().int().positive().nullable().default(null),
67
+ aspectRatio: z3.string().max(40).nullable().default(null),
68
+ targetDurationMs: z3.number().int().positive().nullable().default(null),
31
69
  body: copy,
32
- productRefs: z.array(fixedRef).max(100).default([]),
33
- modelRefs: z.array(fixedRef).max(100).default([])
70
+ productRefs: z3.array(fixedRef).max(100).default([]),
71
+ modelRefs: z3.array(fixedRef).max(100).default([])
34
72
  }).strict();
35
- var adFilm = z.object({
36
- title: z.string().trim().min(1).max(150),
73
+ var adFilm = z3.object({
74
+ title: z3.string().trim().min(1).max(150),
37
75
  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+$/)
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 = z.object({
80
+ var adStoryboard = z3.object({
43
81
  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(),
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: z.array(z.object({ sourceVersionId: z.uuid(), editRef: fixedRef }).strict()).max(200)
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 = z2.enum(["short-drama", "product-ad", "other"]);
64
- var studioConfig = z2.object({
65
- role: z2.enum(["project", "coordinator"]).default("project"),
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: 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()
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 = 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),
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: z2.object({ storeId: z2.uuid(), objectId: z2.uuid() }).strict().nullable().optional().transform(() => void 0),
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 = z2.object({
86
- projectId: z2.uuid(),
87
- name: z2.string().trim().min(1).max(200),
123
+ var assetData = z4.object({
124
+ projectId: z4.uuid(),
125
+ name: z4.string().trim().min(1).max(200),
88
126
  kind,
89
- purpose: z2.enum([
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: z2.enum(["upload", "library", "generated", "authored"]),
101
- orderKey: z2.number().int().nullable().default(null),
138
+ origin: z4.enum(["upload", "library", "generated", "authored"]),
139
+ orderKey: z4.number().int().nullable().default(null),
102
140
  tags,
103
- lifecycle: z2.enum(["draft", "ready", "archived"]).default("draft"),
141
+ lifecycle: z4.enum(["draft", "ready", "archived"]).default("draft"),
104
142
  sourceRef: versionRef.nullable().default(null),
105
- adoptedVersionId: z2.uuid().nullable().default(null)
143
+ adoptedVersionId: z4.uuid().nullable().default(null)
106
144
  }).strict();
107
145
  var storedAssetData = assetData.extend({
108
- purpose: z2.union([assetData.shape.purpose, z2.literal("speech")])
146
+ purpose: z4.union([assetData.shape.purpose, z4.literal("speech")])
109
147
  });
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(
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: 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"]),
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: z2.string().min(1),
124
- capabilityId: z2.string().min(1),
125
- prompt: z2.string().max(32e3).optional(),
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: 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({
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: z2.string().min(1),
133
- order: z2.number().int().nonnegative(),
134
- weight: z2.number().finite().nullable().default(null)
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: 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()
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.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(),
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: 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()
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: z2.any() }));
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: z2.any(),
241
+ output: z4.any(),
205
242
  effects: ["write", "paid"],
206
243
  confirm: "none"
207
244
  });
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()
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 = z3.object({ studioInstance: z3.string().min(1).nullable().default(null) });
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;
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.22",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",