@vivix-labs/project-studio 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 (61) hide show
  1. package/dist/Inter-LICENSE.txt +93 -0
  2. package/dist/UI-LICENSE.txt +21 -0
  3. package/dist/assets/35a50-G5EJUNOC.svg +6 -0
  4. package/dist/assets/369ca-BISNKZ3M.svg +6 -0
  5. package/dist/assets/441bc-BCMNQ72W.svg +6 -0
  6. package/dist/assets/483f0-T6ZAGTDG.svg +6 -0
  7. package/dist/assets/6911b-ESLYKSC6.svg +6 -0
  8. package/dist/assets/Inter-LICENSE.txt +93 -0
  9. package/dist/assets/UI-system-LICENSE.txt +21 -0
  10. package/dist/assets/add-JY533O73.svg +5 -0
  11. package/dist/assets/area-P2WOMBT5.svg +9 -0
  12. package/dist/assets/b70bb-BTTOKPOH.svg +6 -0
  13. package/dist/assets/b9919-3S3O6YOT.svg +6 -0
  14. package/dist/assets/calendar-JI6USFRJ.svg +1 -0
  15. package/dist/assets/check-JSRRIXN5.svg +5 -0
  16. package/dist/assets/check-on-content-FQUVG3IZ.svg +5 -0
  17. package/dist/assets/chevron-down-K7YKS2EY.svg +5 -0
  18. package/dist/assets/chevron-left-JQCLK2WZ.svg +3 -0
  19. package/dist/assets/chevron-right-TNE35DBJ.svg +3 -0
  20. package/dist/assets/chevron-up-VBHYAJVB.svg +5 -0
  21. package/dist/assets/clear-XNEZJKFC.svg +5 -0
  22. package/dist/assets/close-GO5F7YFS.svg +10 -0
  23. package/dist/assets/dccd4-CZJXWICW.svg +6 -0
  24. package/dist/assets/dd163-3S3O6YOT.svg +6 -0
  25. package/dist/assets/draw-FOFX5TOM.svg +6 -0
  26. package/dist/assets/e8aed-CZJXWICW.svg +6 -0
  27. package/dist/assets/ea990-CZJXWICW.svg +6 -0
  28. package/dist/assets/expand-IAV75AFA.svg +6 -0
  29. package/dist/assets/fullscreen-L2JCXIN2.svg +6 -0
  30. package/dist/assets/grid-TLG5JYWB.svg +8 -0
  31. package/dist/assets/import-AFBUV2VV.svg +4 -0
  32. package/dist/assets/inter-latin-400-normal-55WT6UWF.woff2 +0 -0
  33. package/dist/assets/inter-latin-500-normal-W62DVTXI.woff2 +0 -0
  34. package/dist/assets/inter-latin-600-normal-R6Y2SZCR.woff2 +0 -0
  35. package/dist/assets/list-5VUAOZUH.svg +9 -0
  36. package/dist/assets/magic-OMME7FOV.svg +9 -0
  37. package/dist/assets/more-AEJ5MHWV.svg +5 -0
  38. package/dist/assets/mute-SXOSCR2U.svg +6 -0
  39. package/dist/assets/pause-2E4UY4FW.svg +6 -0
  40. package/dist/assets/play-WIIT3XQK.svg +5 -0
  41. package/dist/assets/reset-JESMTEMV.svg +6 -0
  42. package/dist/assets/search-JUOSGQRM.svg +6 -0
  43. package/dist/assets/select-VU7WR7B4.svg +7 -0
  44. package/dist/assets/sound-file-YYY6VNYN.svg +3 -0
  45. package/dist/assets/volume-2TYGJL6F.svg +6 -0
  46. package/dist/client.bundle.js +1373 -0
  47. package/dist/client.css +1900 -0
  48. package/dist/client.d.ts +19 -0
  49. package/dist/client.js +3 -0
  50. package/dist/events.d.ts +102 -0
  51. package/dist/events.js +244 -0
  52. package/dist/server.d.ts +16 -0
  53. package/dist/server.js +3502 -0
  54. package/dist/shared-BUdviVVD.d.ts +263 -0
  55. package/dist/shared.d.ts +510 -0
  56. package/dist/shared.js +228 -0
  57. package/package.json +50 -3
  58. package/schemas/billing-notice.json +16 -0
  59. package/schemas/task-notice.json +57 -0
  60. package/studio-plugin.json +40 -0
  61. package/README.md +0 -3
package/dist/shared.js ADDED
@@ -0,0 +1,228 @@
1
+ // packages/project-studio/src/cost.ts
2
+ function taskCostLabel(task) {
3
+ const cost = task.cost;
4
+ if (cost?.status === "settled" && cost.credits != null) return `${cost.credits} credits`;
5
+ if (cost?.status === "pending") return "Pending settlement";
6
+ return "-";
7
+ }
8
+
9
+ // packages/project-studio/src/shared.ts
10
+ import { z as z2, defineOperation } from "vivix-studio/sdk/shared";
11
+
12
+ // packages/project-studio/src/ads-shared.ts
13
+ import { z } from "vivix-studio/sdk/shared";
14
+ var fixedRef = z.object({ storeId: z.uuid(), objectId: z.uuid(), versionId: z.uuid() }).strict();
15
+ var copy = z.string().max(8e3).default("");
16
+ var clipScript = z.object({
17
+ title: z.string().trim().min(1).max(200),
18
+ visual: copy,
19
+ voiceover: copy,
20
+ onScreenText: copy,
21
+ cta: copy,
22
+ plannedDurationMs: z.number().int().positive().nullable().default(null)
23
+ }).strict();
24
+ var adBrief = z.object({
25
+ product: copy,
26
+ category: copy,
27
+ audience: copy,
28
+ sellingPoints: copy,
29
+ channel: copy,
30
+ aspectRatio: z.string().max(40).nullable().default(null),
31
+ targetDurationMs: z.number().int().positive().nullable().default(null),
32
+ body: copy,
33
+ productRefs: z.array(fixedRef).max(100).default([]),
34
+ modelRefs: z.array(fixedRef).max(100).default([])
35
+ }).strict();
36
+ var adStoryboard = z.object({
37
+ brief: adBrief,
38
+ clips: z.array(
39
+ z.object({
40
+ assetId: z.uuid(),
41
+ script: clipScript,
42
+ edits: z.array(z.object({ sourceVersionId: z.uuid(), editRef: fixedRef }).strict()).max(200)
43
+ }).strict()
44
+ ).max(200)
45
+ }).strict().superRefine((value, context) => {
46
+ if (new Set(value.clips.map((c) => c.assetId)).size !== value.clips.length)
47
+ context.addIssue({ code: "custom", message: "A clip can appear only once in a storyboard." });
48
+ for (const clip of value.clips)
49
+ if (new Set(clip.edits.map((e) => e.sourceVersionId)).size !== clip.edits.length)
50
+ context.addIssue({
51
+ code: "custom",
52
+ message: "Each candidate has one current edit binding."
53
+ });
54
+ });
55
+ var adTypeId = "studio.adStoryboard";
56
+
57
+ // packages/project-studio/src/shared.ts
58
+ var studioConfig = z2.object({
59
+ role: z2.enum(["project", "coordinator"]).default("project"),
60
+ dataInstance: z2.string().min(1).default("user:data"),
61
+ apiInstance: z2.string().min(1).default("api"),
62
+ libraryInstance: z2.string().min(1).nullable().default(null)
63
+ }).strict();
64
+ var versionRef = z2.object({ storeId: z2.uuid(), objectId: z2.uuid(), versionId: z2.uuid() }).strict();
65
+ var tags = z2.array(z2.string().trim().min(1).max(64)).max(50).transform((x) => [...new Set(x)]).default([]);
66
+ var kind = z2.enum(["text", "image", "video", "audio", "file"]);
67
+ var projectData = z2.object({
68
+ name: z2.string().trim().min(1).max(120),
69
+ description: z2.string().max(4e3).default(""),
70
+ status: z2.enum(["draft", "active", "archived"]).default("draft"),
71
+ aspectRatio: z2.string().nullable().default(null),
72
+ coverRef: versionRef.nullable().default(null),
73
+ briefRef: z2.object({ storeId: z2.uuid(), objectId: z2.uuid() }).strict().nullable().default(null),
74
+ tags
75
+ }).strict();
76
+ var assetData = z2.object({
77
+ projectId: z2.uuid(),
78
+ name: z2.string().trim().min(1).max(200),
79
+ kind,
80
+ purpose: z2.enum(["reference", "script", "shot", "music", "voice", "subtitle", "final", "other"]).default("other"),
81
+ origin: z2.enum(["upload", "library", "generated", "authored"]),
82
+ orderKey: z2.number().int().nullable().default(null),
83
+ tags,
84
+ lifecycle: z2.enum(["draft", "ready", "archived"]).default("draft"),
85
+ sourceRef: versionRef.nullable().default(null),
86
+ adoptedVersionId: z2.uuid().nullable().default(null)
87
+ }).strict();
88
+ var taskStates = [
89
+ "queued",
90
+ "submitting",
91
+ "submission_unknown",
92
+ "running",
93
+ "cancel_requested",
94
+ "remote_succeeded",
95
+ "saving",
96
+ "save_failed",
97
+ "partial",
98
+ "succeeded",
99
+ "failed",
100
+ "canceled"
101
+ ];
102
+ var anchor = z2.discriminatedUnion("kind", [
103
+ z2.object({ kind: z2.literal("whole") }).strict(),
104
+ z2.object({
105
+ kind: z2.literal("timeRange"),
106
+ startMs: z2.number().int().nonnegative(),
107
+ endMs: z2.number().int().nonnegative()
108
+ }).strict()
109
+ ]);
110
+ var generationInput = 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)).optional(),
114
+ expectedRevision: z2.number().int().positive().optional(),
115
+ newAsset: z2.object({
116
+ name: z2.string().trim().min(1).max(200),
117
+ kind: z2.enum(["image", "video", "audio"])
118
+ }).strict().optional(),
119
+ modelId: z2.string().min(1),
120
+ capabilityId: z2.string().min(1),
121
+ prompt: z2.string().max(32e3),
122
+ parameters: z2.record(z2.string(), z2.unknown()).default({}),
123
+ outputCount: z2.number().int().min(1).max(100).default(1),
124
+ inputs: z2.array(
125
+ z2.object({
126
+ ref: versionRef,
127
+ role: z2.string().min(1),
128
+ order: z2.number().int().nonnegative(),
129
+ weight: z2.number().finite().nullable().default(null)
130
+ }).strict()
131
+ ).max(100).default([]),
132
+ baseVersionId: z2.uuid().optional(),
133
+ changeRequest: z2.string().trim().min(1).max(4e3).optional(),
134
+ preserveRequest: z2.string().max(4e3).default(""),
135
+ anchor: anchor.default({ kind: "whole" }),
136
+ retryOfTaskId: z2.uuid().optional(),
137
+ acknowledgeUnknown: z2.boolean().optional()
138
+ }).strict();
139
+ var projectSettingsInput = z2.object({
140
+ projectId: z2.uuid(),
141
+ expectedRevision: z2.number().int().positive(),
142
+ changes: projectData.pick({ name: true, description: true, tags: true, aspectRatio: true, coverRef: true }).extend({
143
+ description: projectData.shape.description.unwrap(),
144
+ tags: projectData.shape.tags.unwrap(),
145
+ aspectRatio: projectData.shape.aspectRatio.unwrap(),
146
+ coverRef: projectData.shape.coverRef.unwrap()
147
+ }).partial().strict()
148
+ }).strict();
149
+ var generationSubmitOperation = defineOperation({
150
+ id: "generation.submit",
151
+ title: "Generate",
152
+ description: "Submit one media generation without approval, retaining its paid request identity.",
153
+ input: generationInput,
154
+ output: z2.any(),
155
+ effects: ["write", "paid"],
156
+ confirm: "none"
157
+ });
158
+ var studioOperations = { generationSubmit: generationSubmitOperation };
159
+ var favoriteData = z2.object({ ref: versionRef }).strict();
160
+ var sqlScalar = z2.union([z2.string(), z2.number().finite(), z2.null()]);
161
+ var globalQueryInput = z2.object({
162
+ sql: z2.string().trim().min(1),
163
+ params: z2.union([z2.array(sqlScalar), z2.record(z2.string(), sqlScalar)]).optional(),
164
+ timeoutMs: z2.number().int().positive().optional(),
165
+ maxRows: z2.number().int().positive().optional(),
166
+ limit: z2.number().int().min(1).max(200).optional(),
167
+ offset: z2.number().int().nonnegative().optional(),
168
+ source: z2.enum(["projects", "assets", "tasks"]),
169
+ catalog: z2.array(z2.object({ id: z2.string().min(1), name: z2.string(), available: z2.boolean() }).strict()).optional()
170
+ }).strict();
171
+ var studioDefaultQueries = {
172
+ projects: "SELECT * FROM studio_projects ORDER BY createdAt DESC, rowId",
173
+ assets: "SELECT * FROM studio_assets ORDER BY createdAt DESC, rowId",
174
+ tasks: "SELECT * FROM studio_tasks ORDER BY createdAt DESC, rowId"
175
+ };
176
+ function generationOperation(model, kind2, referenceCount, action = "") {
177
+ if (!model || model.modality !== kind2) return "";
178
+ const operations = model.operations || [];
179
+ if (kind2 === "image") {
180
+ const name = referenceCount ? "image.edit" : "image.generate";
181
+ return operations.some((operation) => operation.name === name) ? name : "";
182
+ }
183
+ if (operations.length === 1) return operations[0].name;
184
+ return operations.some((operation) => operation.name === action) ? action : "";
185
+ }
186
+ function generationParameters(model, operation, raw, kinds) {
187
+ let parameters;
188
+ try {
189
+ parameters = JSON.parse(raw);
190
+ } catch {
191
+ return raw;
192
+ }
193
+ if (!parameters || typeof parameters !== "object" || Array.isArray(parameters)) return raw;
194
+ const mode = kinds.includes("video") ? "video" : kinds.includes("image") ? "image" : kinds.includes("audio") ? "audio" : "text";
195
+ const declared = model?.operations?.flatMap((item) => item.params || []) || [];
196
+ const active = (model?.operations?.find((item) => item.name === operation)?.params || []).filter((parameter) => !parameter.input_modes || parameter.input_modes.includes(mode));
197
+ return JSON.stringify(
198
+ Object.fromEntries(
199
+ Object.entries(parameters).filter(
200
+ ([name]) => active.some((parameter) => parameter.name === name) || !declared.some((parameter) => parameter.name === name)
201
+ )
202
+ )
203
+ );
204
+ }
205
+ export {
206
+ adBrief,
207
+ adStoryboard,
208
+ adTypeId,
209
+ anchor,
210
+ assetData,
211
+ clipScript,
212
+ favoriteData,
213
+ generationInput,
214
+ generationOperation,
215
+ generationParameters,
216
+ generationSubmitOperation,
217
+ globalQueryInput,
218
+ kind,
219
+ projectData,
220
+ projectSettingsInput,
221
+ studioConfig,
222
+ studioDefaultQueries,
223
+ studioOperations,
224
+ tags,
225
+ taskCostLabel,
226
+ taskStates,
227
+ versionRef
228
+ };
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@vivix-labs/project-studio",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0-beta",
4
+ "type": "module",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/",
8
+ "tag": "beta"
9
+ },
10
+ "license": "MIT",
11
+ "files": [
12
+ "dist",
13
+ "studio-plugin.json",
14
+ "skills",
15
+ "presets",
16
+ "schemas"
17
+ ],
18
+ "engines": {
19
+ "node": ">=22.12.0"
20
+ },
21
+ "exports": {
22
+ "./studio-plugin.json": "./studio-plugin.json",
23
+ "./server": {
24
+ "types": "./dist/server.d.ts",
25
+ "import": "./dist/server.js"
26
+ },
27
+ "./shared": {
28
+ "types": "./dist/shared.d.ts",
29
+ "import": "./dist/shared.js"
30
+ },
31
+ "./client": {
32
+ "types": "./dist/client.d.ts",
33
+ "import": "./dist/client.js"
34
+ },
35
+ "./events": {
36
+ "types": "./dist/events.d.ts",
37
+ "import": "./dist/events.js"
38
+ }
39
+ },
40
+ "peerDependencies": {
41
+ "vivix-studio": ">=2.2.0",
42
+ "@vivix-labs/creative-data": "1.0.0-beta",
43
+ "@vivix-labs/vivix-api": "1.0.0-beta",
44
+ "@vivix-labs/material-library": "1.0.0-beta",
45
+ "react": "19.3.1"
46
+ },
47
+ "devDependencies": {
48
+ "@vivix-labs/ui-system": "1.0.0-beta"
49
+ },
50
+ "scripts": {
51
+ "build": "node ../../scripts/build-product-packages.mjs project-studio"
52
+ }
6
53
  }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "taskId": { "type": "string" },
6
+ "attemptId": { "type": "string" },
7
+ "billingRecordId": { "type": "string" },
8
+ "revision": {
9
+ "type": "integer",
10
+ "exclusiveMinimum": 0,
11
+ "maximum": 9007199254740991
12
+ }
13
+ },
14
+ "required": ["taskId", "attemptId", "billingRecordId", "revision"],
15
+ "additionalProperties": false
16
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "taskId": { "type": "string" },
6
+ "attemptId": { "type": "string" },
7
+ "revision": {
8
+ "type": "integer",
9
+ "exclusiveMinimum": 0,
10
+ "maximum": 9007199254740991
11
+ },
12
+ "requestedCount": {
13
+ "anyOf": [
14
+ {
15
+ "type": "integer",
16
+ "exclusiveMinimum": 0,
17
+ "maximum": 9007199254740991
18
+ },
19
+ { "type": "null" }
20
+ ]
21
+ },
22
+ "resultCount": {
23
+ "anyOf": [
24
+ { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
25
+ { "type": "null" }
26
+ ]
27
+ },
28
+ "partialResults": { "type": ["boolean", "null"] },
29
+ "results": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "object",
33
+ "properties": {
34
+ "remoteTaskId": { "type": "string" },
35
+ "outputIndex": {
36
+ "type": "integer",
37
+ "minimum": 0,
38
+ "maximum": 9007199254740991
39
+ },
40
+ "assetId": { "type": "string" }
41
+ },
42
+ "required": ["remoteTaskId", "outputIndex"],
43
+ "additionalProperties": false
44
+ }
45
+ }
46
+ },
47
+ "required": [
48
+ "taskId",
49
+ "attemptId",
50
+ "revision",
51
+ "requestedCount",
52
+ "resultCount",
53
+ "partialResults",
54
+ "results"
55
+ ],
56
+ "additionalProperties": false
57
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "manifestVersion": "0.2",
3
+ "id": "project-studio",
4
+ "requirements": {
5
+ "studioPluginApi": "^0.2.2"
6
+ },
7
+ "requestedAccess": ["events.publish"],
8
+ "events": {
9
+ "publishes": [
10
+ {
11
+ "name": "project-studio/task.completed",
12
+ "version": 1,
13
+ "mode": "notification",
14
+ "schema": "schemas/task-notice.json",
15
+ "scope": "project"
16
+ },
17
+ {
18
+ "name": "project-studio/task.failed",
19
+ "version": 1,
20
+ "mode": "notification",
21
+ "schema": "schemas/task-notice.json",
22
+ "scope": "project"
23
+ },
24
+ {
25
+ "name": "project-studio/task.cancelled",
26
+ "version": 1,
27
+ "mode": "notification",
28
+ "schema": "schemas/task-notice.json",
29
+ "scope": "project"
30
+ },
31
+ {
32
+ "name": "project-studio/billing.updated",
33
+ "version": 1,
34
+ "mode": "notification",
35
+ "schema": "schemas/billing-notice.json",
36
+ "scope": "project"
37
+ }
38
+ ]
39
+ }
40
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.