@happyvertical/smrt-video 0.37.2 → 0.37.4

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/index.js CHANGED
@@ -1,1904 +1,1164 @@
1
- import { ObjectRegistry, crossPackageRef, smrt, SmrtObject, foreignKey, SmrtCollection, field, SmrtJunction } from "@happyvertical/smrt-core";
2
- import { withSystemContext, tenantId, TenantScoped, queryGlobal } from "@happyvertical/smrt-tenancy";
3
- import { AssetCollection, Asset } from "@happyvertical/smrt-assets";
4
- import { persistMediaBundleInspection } from "@happyvertical/smrt-assets";
1
+ import { a as listLegacyOwnedAssetIds, i as listCanonicalOwnedAssetIds, n as assertValidVideoAssetSortOrder, o as mergeOwnedAssetIds, r as legacyVideoAssetMetaTypes, s as resolveOwnedAssets, t as assertValidVideoAssetRole } from "./chunks/owned-asset-utils-Da0Tlhhl.js";
2
+ import { t as Performer } from "./chunks/performer-DlDaK50F.js";
3
+ import { t as Scene } from "./chunks/scene-CCQdUj6S.js";
4
+ import { ObjectRegistry, SmrtCollection, SmrtJunction, SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
5
+ import { TenantScoped, queryGlobal, tenantId } from "@happyvertical/smrt-tenancy";
6
+ import { Asset, persistMediaBundleInspection } from "@happyvertical/smrt-assets";
5
7
  import { Content } from "@happyvertical/smrt-content";
6
8
  import { createLogger } from "@happyvertical/logger";
7
- ObjectRegistry.registerPackageManifest(
8
- new URL("./manifest.json", import.meta.url)
9
- );
10
- const VIDEO_ASSET_ROLE_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_-]*$/;
11
- const VIDEO_ASSET_OWNER_COLUMNS = [
12
- "character_id",
13
- "performer_id",
14
- "scene_id",
15
- "video_shot_id",
16
- "video_sequence_id",
17
- "video_composition_id"
18
- ];
19
- function getQueryRows(result) {
20
- if (Array.isArray(result)) {
21
- return result;
22
- }
23
- if (typeof result === "object" && result !== null && "rows" in result && Array.isArray(result.rows)) {
24
- return result.rows;
25
- }
26
- return [];
27
- }
28
- function isMissingSchemaError(error, target) {
29
- const message = error instanceof Error ? error.message.toLowerCase() : String(error).toLowerCase();
30
- const isMissing = message.includes("no such table") || message.includes("no such column") || message.includes("does not exist") || message.includes("unknown column");
31
- if (!isMissing) {
32
- return false;
33
- }
34
- return !target || message.includes(target.toLowerCase());
35
- }
36
- function buildPlaceholders(count) {
37
- return Array.from({ length: count }, () => "?").join(", ");
38
- }
39
- function uniqueAssetIds(assetIds) {
40
- const seen = /* @__PURE__ */ new Set();
41
- const result = [];
42
- for (const assetId of assetIds) {
43
- if (!assetId || seen.has(assetId)) {
44
- continue;
45
- }
46
- seen.add(assetId);
47
- result.push(assetId);
48
- }
49
- return result;
50
- }
51
- function mergeOwnedAssetIds(...groups) {
52
- const seen = /* @__PURE__ */ new Set();
53
- const merged = [];
54
- for (const group of groups) {
55
- for (const assetId of group) {
56
- if (!assetId || seen.has(assetId)) {
57
- continue;
58
- }
59
- seen.add(assetId);
60
- merged.push(assetId);
61
- }
62
- }
63
- return merged;
64
- }
65
- function assertValidVideoAssetRole(role) {
66
- if (!VIDEO_ASSET_ROLE_PATTERN.test(role)) {
67
- throw new Error(
68
- `Invalid asset role "${role}"; must start with a letter or underscore and contain only letters, digits, underscores, and hyphens`
69
- );
70
- }
71
- }
72
- function assertValidVideoAssetSortOrder(sortOrder) {
73
- if (!Number.isInteger(sortOrder) || sortOrder < 0 || sortOrder > 2147483647) {
74
- throw new Error(
75
- `Invalid sortOrder "${sortOrder}"; must be a non-negative integer`
76
- );
77
- }
78
- }
79
- async function resolveOwnedAssets(db, tenantId2, assetIds) {
80
- const orderedIds = uniqueAssetIds(assetIds);
81
- if (orderedIds.length === 0) {
82
- return [];
83
- }
84
- const assets = await AssetCollection.create({ db });
85
- let resolved;
86
- try {
87
- resolved = tenantId2 ? await withSystemContext(async () => assets.listByIds(orderedIds)) : await assets.listByIds(orderedIds);
88
- } catch (error) {
89
- if (isMissingSchemaError(error, "assets")) {
90
- return [];
91
- }
92
- throw error;
93
- }
94
- const visibleAssets = tenantId2 ? resolved.filter(
95
- (asset) => asset.tenantId === tenantId2 || asset.tenantId === null
96
- ) : resolved;
97
- const assetsById = new Map(
98
- visibleAssets.filter((asset) => asset.id).map((asset) => [asset.id, asset])
99
- );
100
- return orderedIds.map((assetId) => assetsById.get(assetId)).filter(Boolean);
101
- }
102
- async function listCanonicalOwnedAssetIds(options) {
103
- try {
104
- return uniqueAssetIds(
105
- (await options.loadLinks()).map((link) => link.assetId)
106
- );
107
- } catch (error) {
108
- if (isMissingSchemaError(error, options.tableName)) {
109
- return [];
110
- }
111
- throw error;
112
- }
113
- }
114
- async function listLegacyOwnedAssetIds(options) {
115
- const { db, ownerColumn, ownerId, role, metaTypes } = options;
116
- if (!ownerId || metaTypes.length === 0) {
117
- return [];
118
- }
119
- if (!VIDEO_ASSET_OWNER_COLUMNS.includes(ownerColumn)) {
120
- throw new Error(`Unsupported video asset owner column "${ownerColumn}"`);
121
- }
122
- const params = [ownerId, ...metaTypes];
123
- const clauses = [
124
- `${ownerColumn} = ?`,
125
- `_meta_type IN (${buildPlaceholders(metaTypes.length)})`
126
- ];
127
- if (role) {
128
- clauses.push("role = ?");
129
- params.push(role);
130
- }
131
- try {
132
- const result = await db.query(
133
- `SELECT id
134
- FROM assets
135
- WHERE ${clauses.join(" AND ")}
136
- ORDER BY created_at ASC, id ASC`,
137
- ...params
138
- );
139
- return uniqueAssetIds(
140
- getQueryRows(result).map((row) => String(row?.id || ""))
141
- );
142
- } catch (error) {
143
- if (isMissingSchemaError(error)) {
144
- return [];
145
- }
146
- throw error;
147
- }
148
- }
149
- function legacyVideoAssetMetaTypes(className) {
150
- return [className, `@happyvertical/smrt-video:${className}`];
151
- }
152
- var __defProp$j = Object.defineProperty;
153
- var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
154
- var __decorateClass$k = (decorators, target, key, kind) => {
155
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
156
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
157
- if (decorator = decorators[i])
158
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
159
- if (kind && result) __defProp$j(target, key, result);
160
- return result;
9
+ //#region \0rolldown/runtime.js
10
+ var __defProp$19 = Object.defineProperty;
11
+ var __exportAll = (all, no_symbols) => {
12
+ let target = {};
13
+ for (var name in all) __defProp$19(target, name, {
14
+ get: all[name],
15
+ enumerable: true
16
+ });
17
+ if (!no_symbols) __defProp$19(target, Symbol.toStringTag, { value: "Module" });
18
+ return target;
161
19
  };
162
- let Performer = class extends SmrtObject {
163
- tenantId = null;
164
- /** Human-readable name */
165
- name = "";
166
- /** Description */
167
- description = null;
168
- /** Performer DNA for consistent face generation */
169
- dna = {
170
- gender: "neutral",
171
- ageRange: "adult",
172
- ipAdapterWeight: 0.7
173
- };
174
- /** Reference images for IP-Adapter (multiple angles/expressions) */
175
- referenceAssetIds = [];
176
- seedImageAssetId = null;
177
- voiceProfileId = null;
178
- /** Performer status */
179
- status = "pending";
180
- profileId = null;
181
- constructor(options = {}) {
182
- super(options);
183
- if (options.name !== void 0) this.name = options.name;
184
- if (options.description !== void 0)
185
- this.description = options.description;
186
- if (options.dna !== void 0) this.dna = options.dna;
187
- if (options.referenceAssetIds !== void 0)
188
- this.referenceAssetIds = options.referenceAssetIds;
189
- if (options.seedImageAssetId !== void 0)
190
- this.seedImageAssetId = options.seedImageAssetId;
191
- if (options.voiceProfileId !== void 0)
192
- this.voiceProfileId = options.voiceProfileId;
193
- if (options.status !== void 0) this.status = options.status;
194
- if (options.profileId !== void 0) this.profileId = options.profileId;
195
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
196
- }
197
- async getPerformerAssetCollection() {
198
- const { PerformerOwnedAssetCollection: PerformerOwnedAssetCollection2 } = await Promise.resolve().then(() => performerAssets);
199
- return PerformerOwnedAssetCollection2.create({ db: this.db });
200
- }
201
- getLegacyFieldAssetIds(role) {
202
- if (role === "reference") {
203
- return this.referenceAssetIds;
204
- }
205
- if (role === "seed") {
206
- return this.seedImageAssetId ? [this.seedImageAssetId] : [];
207
- }
208
- return [...this.referenceAssetIds, this.seedImageAssetId].filter(
209
- (assetId) => Boolean(assetId)
210
- );
211
- }
212
- setLegacyFieldAssetId(role, assetId) {
213
- if (role === "seed") {
214
- if (this.seedImageAssetId === assetId) {
215
- return false;
216
- }
217
- this.seedImageAssetId = assetId;
218
- return true;
219
- }
220
- if (this.referenceAssetIds.includes(assetId)) {
221
- return false;
222
- }
223
- this.referenceAssetIds = [...this.referenceAssetIds, assetId];
224
- return true;
225
- }
226
- clearLegacyFieldAssetId(assetId, role) {
227
- let changed = false;
228
- if ((!role || role === "seed") && this.seedImageAssetId === assetId) {
229
- this.seedImageAssetId = null;
230
- changed = true;
231
- }
232
- if (!role || role === "reference") {
233
- const remaining = this.referenceAssetIds.filter(
234
- (referenceAssetId) => referenceAssetId !== assetId
235
- );
236
- if (remaining.length !== this.referenceAssetIds.length) {
237
- this.referenceAssetIds = remaining;
238
- changed = true;
239
- }
240
- }
241
- return changed;
242
- }
243
- async getAssets(role) {
244
- const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
245
- tableName: "performer_assets",
246
- loadLinks: async () => (await this.getPerformerAssetCollection()).byLeft(
247
- this.id,
248
- role ? { role } : {}
249
- )
250
- }) : [];
251
- const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
252
- const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
253
- db: this.db,
254
- ownerColumn: "performer_id",
255
- ownerId: this.id,
256
- role,
257
- metaTypes: legacyVideoAssetMetaTypes("PerformerAsset")
258
- }) : [];
259
- return resolveOwnedAssets(
260
- this.db,
261
- this.tenantId,
262
- mergeOwnedAssetIds(
263
- canonicalAssetIds,
264
- legacyFieldAssetIds,
265
- legacyOwnedAssetIds
266
- )
267
- );
268
- }
269
- async getAssetByRole(role) {
270
- const assets = await this.getAssets(role);
271
- return assets[0] || null;
272
- }
273
- async addAsset(asset, role = "reference", sortOrder = 0) {
274
- if (!this.id || !asset.id) {
275
- throw new Error("Cannot associate unsaved performer or asset");
276
- }
277
- assertValidVideoAssetRole(role);
278
- assertValidVideoAssetSortOrder(sortOrder);
279
- const performerAssets2 = await this.getPerformerAssetCollection();
280
- await performerAssets2.attach(this.id, asset.id, {
281
- role,
282
- sortOrder,
283
- tenantId: this.tenantId
284
- });
285
- if (this.setLegacyFieldAssetId(role, asset.id)) {
286
- await this.save();
287
- }
288
- }
289
- async removeAsset(assetId, role) {
290
- if (!this.id) {
291
- return;
292
- }
293
- const performerAssets2 = await this.getPerformerAssetCollection();
294
- await performerAssets2.detach(this.id, assetId, role ? { role } : {});
295
- if (this.clearLegacyFieldAssetId(assetId, role)) {
296
- await this.save();
297
- }
298
- }
299
- /** Check if the performer has reference images */
300
- get hasReferences() {
301
- return this.referenceAssetIds.length > 0;
302
- }
303
- /** Check if the performer has a face embedding */
304
- get hasFaceEmbedding() {
305
- return Array.isArray(this.dna.faceEmbedding) && this.dna.faceEmbedding.length > 0;
306
- }
307
- /** Check if the performer is ready for generation */
308
- get isReady() {
309
- return this.status === "ready" && this.hasReferences;
310
- }
20
+ //#endregion
21
+ //#region src/__smrt-register__.ts
22
+ ObjectRegistry.registerPackageManifest(new URL("./manifest.json", "" + import.meta.url));
23
+ //#endregion
24
+ //#region src/character.ts
25
+ var __defProp$18 = Object.defineProperty;
26
+ var __getOwnPropDesc$18 = Object.getOwnPropertyDescriptor;
27
+ var __decorateClass$18 = (decorators, target, key, kind) => {
28
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$18(target, key) : target;
29
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
30
+ if (kind && result) __defProp$18(target, key, result);
31
+ return result;
311
32
  };
312
- __decorateClass$k([
313
- tenantId({ nullable: true })
314
- ], Performer.prototype, "tenantId", 2);
315
- __decorateClass$k([
316
- crossPackageRef("@happyvertical/smrt-assets:Asset")
317
- ], Performer.prototype, "seedImageAssetId", 2);
318
- __decorateClass$k([
319
- crossPackageRef("@happyvertical/smrt-voice:VoiceProfile")
320
- ], Performer.prototype, "voiceProfileId", 2);
321
- __decorateClass$k([
322
- crossPackageRef("@happyvertical/smrt-profiles:Profile")
323
- ], Performer.prototype, "profileId", 2);
324
- Performer = __decorateClass$k([
325
- TenantScoped({ mode: "optional" }),
326
- smrt({
327
- tableStrategy: "sti",
328
- api: {
329
- include: ["list", "get", "create", "update", "delete"]
330
- },
331
- mcp: {
332
- include: ["list", "get"]
333
- },
334
- cli: true
335
- })
336
- ], Performer);
337
- var __defProp$i = Object.defineProperty;
338
- var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
339
- var __decorateClass$j = (decorators, target, key, kind) => {
340
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
341
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
342
- if (decorator = decorators[i])
343
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
344
- if (kind && result) __defProp$i(target, key, result);
345
- return result;
33
+ var Character = class extends SmrtObject {
34
+ tenantId = null;
35
+ /** Human-readable name for the character */
36
+ name = "";
37
+ /** Description of the character persona */
38
+ description = null;
39
+ imageAssetId = null;
40
+ baseMotionAssetId = null;
41
+ voiceProfileId = null;
42
+ /** Branding configuration for video overlays */
43
+ brandingKit = {};
44
+ /** Character status */
45
+ status = "pending";
46
+ performerId = null;
47
+ defaultSceneId = null;
48
+ /** Scene-specific configurations */
49
+ sceneConfigs = [];
50
+ profileId = null;
51
+ constructor(options = {}) {
52
+ super(options);
53
+ if (options.name !== void 0) this.name = options.name;
54
+ if (options.description !== void 0) this.description = options.description;
55
+ if (options.imageAssetId !== void 0) this.imageAssetId = options.imageAssetId;
56
+ if (options.baseMotionAssetId !== void 0) this.baseMotionAssetId = options.baseMotionAssetId;
57
+ if (options.voiceProfileId !== void 0) this.voiceProfileId = options.voiceProfileId;
58
+ if (options.brandingKit !== void 0) this.brandingKit = options.brandingKit;
59
+ if (options.status !== void 0) this.status = options.status;
60
+ if (options.performerId !== void 0) this.performerId = options.performerId;
61
+ if (options.defaultSceneId !== void 0) this.defaultSceneId = options.defaultSceneId;
62
+ if (options.sceneConfigs !== void 0) this.sceneConfigs = options.sceneConfigs;
63
+ if (options.profileId !== void 0) this.profileId = options.profileId;
64
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
65
+ }
66
+ async getCharacterAssetCollection() {
67
+ const { CharacterOwnedAssetCollection } = await Promise.resolve().then(() => character_assets_exports);
68
+ return CharacterOwnedAssetCollection.create({ db: this.db });
69
+ }
70
+ getLegacyFieldAssetIds(role) {
71
+ if (role === "seed-image") return this.imageAssetId ? [this.imageAssetId] : [];
72
+ if (role === "base-motion") return this.baseMotionAssetId ? [this.baseMotionAssetId] : [];
73
+ if (role === "logo") return this.brandingKit.logoAssetId ? [this.brandingKit.logoAssetId] : [];
74
+ return [
75
+ this.imageAssetId,
76
+ this.baseMotionAssetId,
77
+ this.brandingKit.logoAssetId || null
78
+ ].filter((assetId) => Boolean(assetId));
79
+ }
80
+ setLegacyFieldAssetId(role, assetId) {
81
+ if (role === "seed-image") {
82
+ if (this.imageAssetId === assetId) return false;
83
+ this.imageAssetId = assetId;
84
+ return true;
85
+ }
86
+ if (role === "base-motion") {
87
+ if (this.baseMotionAssetId === assetId) return false;
88
+ this.baseMotionAssetId = assetId;
89
+ return true;
90
+ }
91
+ if ((this.brandingKit.logoAssetId || null) === assetId) return false;
92
+ this.brandingKit = {
93
+ ...this.brandingKit,
94
+ logoAssetId: assetId
95
+ };
96
+ return true;
97
+ }
98
+ clearLegacyFieldAssetId(assetId, role) {
99
+ let changed = false;
100
+ if ((!role || role === "seed-image") && this.imageAssetId === assetId) {
101
+ this.imageAssetId = null;
102
+ changed = true;
103
+ }
104
+ if ((!role || role === "base-motion") && this.baseMotionAssetId === assetId) {
105
+ this.baseMotionAssetId = null;
106
+ changed = true;
107
+ }
108
+ if ((!role || role === "logo") && this.brandingKit.logoAssetId === assetId) {
109
+ this.brandingKit = {
110
+ ...this.brandingKit,
111
+ logoAssetId: null
112
+ };
113
+ changed = true;
114
+ }
115
+ return changed;
116
+ }
117
+ async getAssets(role) {
118
+ const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
119
+ tableName: "character_assets",
120
+ loadLinks: async () => (await this.getCharacterAssetCollection()).byLeft(this.id, role ? { role } : {})
121
+ }) : [];
122
+ const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
123
+ const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
124
+ db: this.db,
125
+ ownerColumn: "character_id",
126
+ ownerId: this.id,
127
+ role,
128
+ metaTypes: legacyVideoAssetMetaTypes("CharacterAsset")
129
+ }) : [];
130
+ return resolveOwnedAssets(this.db, this.tenantId, mergeOwnedAssetIds(canonicalAssetIds, legacyFieldAssetIds, legacyOwnedAssetIds));
131
+ }
132
+ async getAssetByRole(role) {
133
+ return (await this.getAssets(role))[0] || null;
134
+ }
135
+ async addAsset(asset, role = "seed-image", sortOrder = 0) {
136
+ if (!this.id || !asset.id) throw new Error("Cannot associate unsaved character or asset");
137
+ assertValidVideoAssetRole(role);
138
+ assertValidVideoAssetSortOrder(sortOrder);
139
+ await (await this.getCharacterAssetCollection()).attach(this.id, asset.id, {
140
+ role,
141
+ sortOrder,
142
+ tenantId: this.tenantId
143
+ });
144
+ if (this.setLegacyFieldAssetId(role, asset.id)) await this.save();
145
+ }
146
+ async removeAsset(assetId, role) {
147
+ if (!this.id) return;
148
+ await (await this.getCharacterAssetCollection()).detach(this.id, assetId, role ? { role } : {});
149
+ if (this.clearLegacyFieldAssetId(assetId, role)) await this.save();
150
+ }
151
+ /**
152
+ * Check if the character has a pre-baked base motion video
153
+ * @deprecated Use getAssetByRole('base-motion') instead
154
+ */
155
+ get hasBaseMotion() {
156
+ return this.baseMotionAssetId !== null;
157
+ }
158
+ /** Check if the character is complete and ready for video generation */
159
+ get isComplete() {
160
+ return this.imageAssetId !== null && this.voiceProfileId !== null && this.status === "ready";
161
+ }
346
162
  };
347
- let Scene = class extends SmrtObject {
348
- tenantId = null;
349
- /** Human-readable name */
350
- name = "";
351
- /** Description */
352
- description = null;
353
- sourceAssetId = null;
354
- /** Type of source media */
355
- sourceType = "image";
356
- /** Projection type for panoramas */
357
- projection = null;
358
- /** Extracted camera angles from 360° panoramas */
359
- viewpoints = [];
360
- /** Lighting analysis for IC-Light matching */
361
- lightingProfile = null;
362
- /** Location metadata */
363
- location = null;
364
- /** Anchor points for character placement */
365
- anchorPoints = [];
366
- /** Scene status */
367
- status = "pending";
368
- constructor(options = {}) {
369
- super(options);
370
- if (options.name !== void 0) this.name = options.name;
371
- if (options.description !== void 0)
372
- this.description = options.description;
373
- if (options.sourceAssetId !== void 0)
374
- this.sourceAssetId = options.sourceAssetId;
375
- if (options.sourceType !== void 0) this.sourceType = options.sourceType;
376
- if (options.projection !== void 0) this.projection = options.projection;
377
- if (options.viewpoints !== void 0) this.viewpoints = options.viewpoints;
378
- if (options.lightingProfile !== void 0)
379
- this.lightingProfile = options.lightingProfile;
380
- if (options.location !== void 0) this.location = options.location;
381
- if (options.anchorPoints !== void 0)
382
- this.anchorPoints = options.anchorPoints;
383
- if (options.status !== void 0) this.status = options.status;
384
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
385
- }
386
- async getSceneAssetCollection() {
387
- const { SceneOwnedAssetCollection: SceneOwnedAssetCollection2 } = await Promise.resolve().then(() => sceneAssets);
388
- return SceneOwnedAssetCollection2.create({ db: this.db });
389
- }
390
- getLegacyFieldAssetIds(role) {
391
- if (role === "source") {
392
- return this.sourceAssetId ? [this.sourceAssetId] : [];
393
- }
394
- if (role === "env-map") {
395
- return this.lightingProfile?.envMapAssetId ? [this.lightingProfile.envMapAssetId] : [];
396
- }
397
- if (role === "viewpoint-extract") {
398
- return this.viewpoints.map((viewpoint) => viewpoint.extractedAssetId || null).filter((assetId) => Boolean(assetId));
399
- }
400
- return [
401
- this.sourceAssetId,
402
- this.lightingProfile?.envMapAssetId || null,
403
- ...this.viewpoints.map((viewpoint) => viewpoint.extractedAssetId || null)
404
- ].filter((assetId) => Boolean(assetId));
405
- }
406
- setLegacyFieldAssetId(role, assetId) {
407
- if (role === "source") {
408
- if (this.sourceAssetId === assetId) {
409
- return false;
410
- }
411
- this.sourceAssetId = assetId;
412
- return true;
413
- }
414
- if (role === "env-map") {
415
- if ((this.lightingProfile?.envMapAssetId || null) === assetId) {
416
- return false;
417
- }
418
- this.lightingProfile = {
419
- ...this.lightingProfile || {},
420
- envMapAssetId: assetId
421
- };
422
- return true;
423
- }
424
- return false;
425
- }
426
- clearLegacyFieldAssetId(assetId, role) {
427
- let changed = false;
428
- if ((!role || role === "source") && this.sourceAssetId === assetId) {
429
- this.sourceAssetId = null;
430
- changed = true;
431
- }
432
- if ((!role || role === "env-map") && this.lightingProfile?.envMapAssetId === assetId) {
433
- this.lightingProfile = {
434
- ...this.lightingProfile || {},
435
- envMapAssetId: void 0
436
- };
437
- changed = true;
438
- }
439
- if (!role || role === "viewpoint-extract") {
440
- let viewpointChanged = false;
441
- const nextViewpoints = this.viewpoints.map((viewpoint) => {
442
- if (viewpoint.extractedAssetId !== assetId) {
443
- return viewpoint;
444
- }
445
- viewpointChanged = true;
446
- return {
447
- ...viewpoint,
448
- extractedAssetId: void 0
449
- };
450
- });
451
- if (viewpointChanged) {
452
- this.viewpoints = nextViewpoints;
453
- changed = true;
454
- }
455
- }
456
- return changed;
457
- }
458
- async getAssets(role) {
459
- const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
460
- tableName: "scene_assets",
461
- loadLinks: async () => (await this.getSceneAssetCollection()).byLeft(
462
- this.id,
463
- role ? { role } : {}
464
- )
465
- }) : [];
466
- const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
467
- const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
468
- db: this.db,
469
- ownerColumn: "scene_id",
470
- ownerId: this.id,
471
- role,
472
- metaTypes: legacyVideoAssetMetaTypes("SceneAsset")
473
- }) : [];
474
- return resolveOwnedAssets(
475
- this.db,
476
- this.tenantId,
477
- mergeOwnedAssetIds(
478
- canonicalAssetIds,
479
- legacyFieldAssetIds,
480
- legacyOwnedAssetIds
481
- )
482
- );
483
- }
484
- async getAssetByRole(role) {
485
- const assets = await this.getAssets(role);
486
- return assets[0] || null;
487
- }
488
- async addAsset(asset, role = "source", sortOrder = 0) {
489
- if (!this.id || !asset.id) {
490
- throw new Error("Cannot associate unsaved scene or asset");
491
- }
492
- assertValidVideoAssetRole(role);
493
- assertValidVideoAssetSortOrder(sortOrder);
494
- const sceneAssets2 = await this.getSceneAssetCollection();
495
- await sceneAssets2.attach(this.id, asset.id, {
496
- role,
497
- sortOrder,
498
- tenantId: this.tenantId
499
- });
500
- if (this.setLegacyFieldAssetId(role, asset.id)) {
501
- await this.save();
502
- }
503
- }
504
- async removeAsset(assetId, role) {
505
- if (!this.id) {
506
- return;
507
- }
508
- const sceneAssets2 = await this.getSceneAssetCollection();
509
- await sceneAssets2.detach(this.id, assetId, role ? { role } : {});
510
- if (this.clearLegacyFieldAssetId(assetId, role)) {
511
- await this.save();
512
- }
513
- }
514
- /** Check if this is a 360° panorama */
515
- get isPanorama() {
516
- return this.sourceType === "panorama_360" || this.sourceType === "panorama_180";
517
- }
518
- /** Check if the scene has viewpoints extracted */
519
- get hasViewpoints() {
520
- return this.viewpoints.length > 0;
521
- }
522
- /** Check if the scene is ready for compositing */
523
- get isReady() {
524
- return this.status === "ready" && this.sourceAssetId !== null;
525
- }
163
+ __decorateClass$18([tenantId({ nullable: true })], Character.prototype, "tenantId", 2);
164
+ __decorateClass$18([crossPackageRef("@happyvertical/smrt-assets:Asset")], Character.prototype, "imageAssetId", 2);
165
+ __decorateClass$18([crossPackageRef("@happyvertical/smrt-assets:Asset")], Character.prototype, "baseMotionAssetId", 2);
166
+ __decorateClass$18([crossPackageRef("@happyvertical/smrt-voice:VoiceProfile")], Character.prototype, "voiceProfileId", 2);
167
+ __decorateClass$18([foreignKey(() => Performer)], Character.prototype, "performerId", 2);
168
+ __decorateClass$18([foreignKey(() => Scene)], Character.prototype, "defaultSceneId", 2);
169
+ __decorateClass$18([crossPackageRef("@happyvertical/smrt-profiles:Profile")], Character.prototype, "profileId", 2);
170
+ Character = __decorateClass$18([TenantScoped({ mode: "optional" }), smrt({
171
+ tableStrategy: "sti",
172
+ api: { include: [
173
+ "list",
174
+ "get",
175
+ "create",
176
+ "update",
177
+ "delete"
178
+ ] },
179
+ mcp: { include: ["list", "get"] },
180
+ cli: true
181
+ })], Character);
182
+ //#endregion
183
+ //#region src/characters.ts
184
+ var CharacterCollection = class extends SmrtCollection {
185
+ static _itemClass = Character;
186
+ /** Find all characters belonging to a specific tenant */
187
+ async findByTenant(tenantId) {
188
+ return await this.list({ where: { tenantId } });
189
+ }
190
+ /**
191
+ * Find all global characters (no tenant association).
192
+ *
193
+ * Routes through the shared tenant-global helper so it does not throw under
194
+ * an active tenant context (an explicit `tenant_id IS NULL` filter would be
195
+ * flagged as an isolation violation). (#1600)
196
+ */
197
+ async findGlobal() {
198
+ return queryGlobal(this);
199
+ }
200
+ /** Find characters by performer */
201
+ async findByPerformer(performerId) {
202
+ return await this.list({ where: { performerId } });
203
+ }
204
+ /** Find characters that are ready for video generation */
205
+ async findReady() {
206
+ return await this.list({ where: { status: "ready" } });
207
+ }
526
208
  };
527
- __decorateClass$j([
528
- tenantId({ nullable: true })
529
- ], Scene.prototype, "tenantId", 2);
530
- __decorateClass$j([
531
- crossPackageRef("@happyvertical/smrt-assets:Asset")
532
- ], Scene.prototype, "sourceAssetId", 2);
533
- Scene = __decorateClass$j([
534
- TenantScoped({ mode: "optional" }),
535
- smrt({
536
- tableStrategy: "sti",
537
- api: {
538
- include: ["list", "get", "create", "update", "delete"]
539
- },
540
- mcp: {
541
- include: ["list", "get"]
542
- },
543
- cli: true
544
- })
545
- ], Scene);
546
- var __defProp$h = Object.defineProperty;
547
- var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
548
- var __decorateClass$i = (decorators, target, key, kind) => {
549
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
550
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
551
- if (decorator = decorators[i])
552
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
553
- if (kind && result) __defProp$h(target, key, result);
554
- return result;
209
+ //#endregion
210
+ //#region src/composite-job.ts
211
+ var __defProp$17 = Object.defineProperty;
212
+ var __getOwnPropDesc$17 = Object.getOwnPropertyDescriptor;
213
+ var __decorateClass$17 = (decorators, target, key, kind) => {
214
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$17(target, key) : target;
215
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
216
+ if (kind && result) __defProp$17(target, key, result);
217
+ return result;
555
218
  };
556
- let Character = class extends SmrtObject {
557
- tenantId = null;
558
- /** Human-readable name for the character */
559
- name = "";
560
- /** Description of the character persona */
561
- description = null;
562
- imageAssetId = null;
563
- baseMotionAssetId = null;
564
- voiceProfileId = null;
565
- /** Branding configuration for video overlays */
566
- brandingKit = {};
567
- /** Character status */
568
- status = "pending";
569
- performerId = null;
570
- defaultSceneId = null;
571
- /** Scene-specific configurations */
572
- sceneConfigs = [];
573
- profileId = null;
574
- constructor(options = {}) {
575
- super(options);
576
- if (options.name !== void 0) this.name = options.name;
577
- if (options.description !== void 0)
578
- this.description = options.description;
579
- if (options.imageAssetId !== void 0)
580
- this.imageAssetId = options.imageAssetId;
581
- if (options.baseMotionAssetId !== void 0)
582
- this.baseMotionAssetId = options.baseMotionAssetId;
583
- if (options.voiceProfileId !== void 0)
584
- this.voiceProfileId = options.voiceProfileId;
585
- if (options.brandingKit !== void 0)
586
- this.brandingKit = options.brandingKit;
587
- if (options.status !== void 0) this.status = options.status;
588
- if (options.performerId !== void 0)
589
- this.performerId = options.performerId;
590
- if (options.defaultSceneId !== void 0)
591
- this.defaultSceneId = options.defaultSceneId;
592
- if (options.sceneConfigs !== void 0)
593
- this.sceneConfigs = options.sceneConfigs;
594
- if (options.profileId !== void 0) this.profileId = options.profileId;
595
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
596
- }
597
- async getCharacterAssetCollection() {
598
- const { CharacterOwnedAssetCollection: CharacterOwnedAssetCollection2 } = await Promise.resolve().then(() => characterAssets);
599
- return CharacterOwnedAssetCollection2.create({ db: this.db });
600
- }
601
- getLegacyFieldAssetIds(role) {
602
- if (role === "seed-image") {
603
- return this.imageAssetId ? [this.imageAssetId] : [];
604
- }
605
- if (role === "base-motion") {
606
- return this.baseMotionAssetId ? [this.baseMotionAssetId] : [];
607
- }
608
- if (role === "logo") {
609
- return this.brandingKit.logoAssetId ? [this.brandingKit.logoAssetId] : [];
610
- }
611
- return [
612
- this.imageAssetId,
613
- this.baseMotionAssetId,
614
- this.brandingKit.logoAssetId || null
615
- ].filter((assetId) => Boolean(assetId));
616
- }
617
- setLegacyFieldAssetId(role, assetId) {
618
- if (role === "seed-image") {
619
- if (this.imageAssetId === assetId) {
620
- return false;
621
- }
622
- this.imageAssetId = assetId;
623
- return true;
624
- }
625
- if (role === "base-motion") {
626
- if (this.baseMotionAssetId === assetId) {
627
- return false;
628
- }
629
- this.baseMotionAssetId = assetId;
630
- return true;
631
- }
632
- if ((this.brandingKit.logoAssetId || null) === assetId) {
633
- return false;
634
- }
635
- this.brandingKit = {
636
- ...this.brandingKit,
637
- logoAssetId: assetId
638
- };
639
- return true;
640
- }
641
- clearLegacyFieldAssetId(assetId, role) {
642
- let changed = false;
643
- if ((!role || role === "seed-image") && this.imageAssetId === assetId) {
644
- this.imageAssetId = null;
645
- changed = true;
646
- }
647
- if ((!role || role === "base-motion") && this.baseMotionAssetId === assetId) {
648
- this.baseMotionAssetId = null;
649
- changed = true;
650
- }
651
- if ((!role || role === "logo") && this.brandingKit.logoAssetId === assetId) {
652
- this.brandingKit = {
653
- ...this.brandingKit,
654
- logoAssetId: null
655
- };
656
- changed = true;
657
- }
658
- return changed;
659
- }
660
- async getAssets(role) {
661
- const canonicalAssetIds = this.id ? await listCanonicalOwnedAssetIds({
662
- tableName: "character_assets",
663
- loadLinks: async () => (await this.getCharacterAssetCollection()).byLeft(
664
- this.id,
665
- role ? { role } : {}
666
- )
667
- }) : [];
668
- const legacyFieldAssetIds = this.getLegacyFieldAssetIds(role);
669
- const legacyOwnedAssetIds = this.id ? await listLegacyOwnedAssetIds({
670
- db: this.db,
671
- ownerColumn: "character_id",
672
- ownerId: this.id,
673
- role,
674
- metaTypes: legacyVideoAssetMetaTypes("CharacterAsset")
675
- }) : [];
676
- return resolveOwnedAssets(
677
- this.db,
678
- this.tenantId,
679
- mergeOwnedAssetIds(
680
- canonicalAssetIds,
681
- legacyFieldAssetIds,
682
- legacyOwnedAssetIds
683
- )
684
- );
685
- }
686
- async getAssetByRole(role) {
687
- const assets = await this.getAssets(role);
688
- return assets[0] || null;
689
- }
690
- async addAsset(asset, role = "seed-image", sortOrder = 0) {
691
- if (!this.id || !asset.id) {
692
- throw new Error("Cannot associate unsaved character or asset");
693
- }
694
- assertValidVideoAssetRole(role);
695
- assertValidVideoAssetSortOrder(sortOrder);
696
- const characterAssets2 = await this.getCharacterAssetCollection();
697
- await characterAssets2.attach(this.id, asset.id, {
698
- role,
699
- sortOrder,
700
- tenantId: this.tenantId
701
- });
702
- if (this.setLegacyFieldAssetId(role, asset.id)) {
703
- await this.save();
704
- }
705
- }
706
- async removeAsset(assetId, role) {
707
- if (!this.id) {
708
- return;
709
- }
710
- const characterAssets2 = await this.getCharacterAssetCollection();
711
- await characterAssets2.detach(this.id, assetId, role ? { role } : {});
712
- if (this.clearLegacyFieldAssetId(assetId, role)) {
713
- await this.save();
714
- }
715
- }
716
- /**
717
- * Check if the character has a pre-baked base motion video
718
- * @deprecated Use getAssetByRole('base-motion') instead
719
- */
720
- get hasBaseMotion() {
721
- return this.baseMotionAssetId !== null;
722
- }
723
- /** Check if the character is complete and ready for video generation */
724
- get isComplete() {
725
- return this.imageAssetId !== null && this.voiceProfileId !== null && this.status === "ready";
726
- }
219
+ var CompositeJob = class extends SmrtObject {
220
+ tenantId = null;
221
+ characterVideoAssetId = null;
222
+ sceneId = null;
223
+ /** Viewpoint ID (for 360° scenes) */
224
+ viewpointId = null;
225
+ /** Anchor point ID for placement */
226
+ anchorPointId = null;
227
+ /** Character scale */
228
+ scale = 1;
229
+ /** Character position (normalized 0-1) */
230
+ position = {
231
+ x: .5,
232
+ y: .5
233
+ };
234
+ /** Job status */
235
+ status = "pending";
236
+ /** Progress percentage (0-100) */
237
+ progress = 0;
238
+ outputAssetId = null;
239
+ /** Error message if failed */
240
+ errorMessage = null;
241
+ constructor(options = {}) {
242
+ super(options);
243
+ if (options.characterVideoAssetId !== void 0) this.characterVideoAssetId = options.characterVideoAssetId;
244
+ if (options.sceneId !== void 0) this.sceneId = options.sceneId;
245
+ if (options.viewpointId !== void 0) this.viewpointId = options.viewpointId;
246
+ if (options.anchorPointId !== void 0) this.anchorPointId = options.anchorPointId;
247
+ if (options.scale !== void 0) this.scale = options.scale;
248
+ if (options.position !== void 0) this.position = options.position;
249
+ if (options.status !== void 0) this.status = options.status;
250
+ if (options.progress !== void 0) this.progress = options.progress;
251
+ if (options.outputAssetId !== void 0) this.outputAssetId = options.outputAssetId;
252
+ if (options.errorMessage !== void 0) this.errorMessage = options.errorMessage;
253
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
254
+ }
255
+ /** Check if the job is complete */
256
+ get isComplete() {
257
+ return this.status === "complete" && this.outputAssetId !== null;
258
+ }
259
+ /** Check if the job is in progress */
260
+ get isProcessing() {
261
+ return this.status !== "pending" && this.status !== "complete" && this.status !== "failed";
262
+ }
727
263
  };
728
- __decorateClass$i([
729
- tenantId({ nullable: true })
730
- ], Character.prototype, "tenantId", 2);
731
- __decorateClass$i([
732
- crossPackageRef("@happyvertical/smrt-assets:Asset")
733
- ], Character.prototype, "imageAssetId", 2);
734
- __decorateClass$i([
735
- crossPackageRef("@happyvertical/smrt-assets:Asset")
736
- ], Character.prototype, "baseMotionAssetId", 2);
737
- __decorateClass$i([
738
- crossPackageRef("@happyvertical/smrt-voice:VoiceProfile")
739
- ], Character.prototype, "voiceProfileId", 2);
740
- __decorateClass$i([
741
- foreignKey(() => Performer)
742
- ], Character.prototype, "performerId", 2);
743
- __decorateClass$i([
744
- foreignKey(() => Scene)
745
- ], Character.prototype, "defaultSceneId", 2);
746
- __decorateClass$i([
747
- crossPackageRef("@happyvertical/smrt-profiles:Profile")
748
- ], Character.prototype, "profileId", 2);
749
- Character = __decorateClass$i([
750
- TenantScoped({ mode: "optional" }),
751
- smrt({
752
- tableStrategy: "sti",
753
- api: {
754
- include: ["list", "get", "create", "update", "delete"]
755
- },
756
- mcp: {
757
- include: ["list", "get"]
758
- },
759
- cli: true
760
- })
761
- ], Character);
762
- class CharacterCollection extends SmrtCollection {
763
- static _itemClass = Character;
764
- /** Find all characters belonging to a specific tenant */
765
- async findByTenant(tenantId2) {
766
- return await this.list({ where: { tenantId: tenantId2 } });
767
- }
768
- /**
769
- * Find all global characters (no tenant association).
770
- *
771
- * Routes through the shared tenant-global helper so it does not throw under
772
- * an active tenant context (an explicit `tenant_id IS NULL` filter would be
773
- * flagged as an isolation violation). (#1600)
774
- */
775
- async findGlobal() {
776
- return queryGlobal(this);
777
- }
778
- /** Find characters by performer */
779
- async findByPerformer(performerId) {
780
- return await this.list({ where: { performerId } });
781
- }
782
- /** Find characters that are ready for video generation */
783
- async findReady() {
784
- return await this.list({ where: { status: "ready" } });
785
- }
786
- }
787
- var __defProp$g = Object.defineProperty;
788
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
789
- var __decorateClass$h = (decorators, target, key, kind) => {
790
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
791
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
792
- if (decorator = decorators[i])
793
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
794
- if (kind && result) __defProp$g(target, key, result);
795
- return result;
264
+ __decorateClass$17([tenantId({ nullable: true })], CompositeJob.prototype, "tenantId", 2);
265
+ __decorateClass$17([crossPackageRef("@happyvertical/smrt-assets:Asset")], CompositeJob.prototype, "characterVideoAssetId", 2);
266
+ __decorateClass$17([foreignKey(() => Scene)], CompositeJob.prototype, "sceneId", 2);
267
+ __decorateClass$17([crossPackageRef("@happyvertical/smrt-assets:Asset")], CompositeJob.prototype, "outputAssetId", 2);
268
+ CompositeJob = __decorateClass$17([TenantScoped({ mode: "optional" }), smrt({
269
+ tableStrategy: "sti",
270
+ api: { include: [
271
+ "list",
272
+ "get",
273
+ "create",
274
+ "update"
275
+ ] },
276
+ mcp: { include: ["list", "get"] },
277
+ cli: true
278
+ })], CompositeJob);
279
+ //#endregion
280
+ //#region src/video-composition.ts
281
+ var __defProp$16 = Object.defineProperty;
282
+ var __getOwnPropDesc$16 = Object.getOwnPropertyDescriptor;
283
+ var __decorateClass$16 = (decorators, target, key, kind) => {
284
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$16(target, key) : target;
285
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
286
+ if (kind && result) __defProp$16(target, key, result);
287
+ return result;
796
288
  };
797
- let CompositeJob = class extends SmrtObject {
798
- tenantId = null;
799
- characterVideoAssetId = null;
800
- sceneId = null;
801
- /** Viewpoint ID (for 360° scenes) */
802
- viewpointId = null;
803
- /** Anchor point ID for placement */
804
- anchorPointId = null;
805
- /** Character scale */
806
- scale = 1;
807
- /** Character position (normalized 0-1) */
808
- position = { x: 0.5, y: 0.5 };
809
- /** Job status */
810
- status = "pending";
811
- /** Progress percentage (0-100) */
812
- progress = 0;
813
- outputAssetId = null;
814
- /** Error message if failed */
815
- errorMessage = null;
816
- constructor(options = {}) {
817
- super(options);
818
- if (options.characterVideoAssetId !== void 0)
819
- this.characterVideoAssetId = options.characterVideoAssetId;
820
- if (options.sceneId !== void 0) this.sceneId = options.sceneId;
821
- if (options.viewpointId !== void 0)
822
- this.viewpointId = options.viewpointId;
823
- if (options.anchorPointId !== void 0)
824
- this.anchorPointId = options.anchorPointId;
825
- if (options.scale !== void 0) this.scale = options.scale;
826
- if (options.position !== void 0) this.position = options.position;
827
- if (options.status !== void 0) this.status = options.status;
828
- if (options.progress !== void 0) this.progress = options.progress;
829
- if (options.outputAssetId !== void 0)
830
- this.outputAssetId = options.outputAssetId;
831
- if (options.errorMessage !== void 0)
832
- this.errorMessage = options.errorMessage;
833
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
834
- }
835
- /** Check if the job is complete */
836
- get isComplete() {
837
- return this.status === "complete" && this.outputAssetId !== null;
838
- }
839
- /** Check if the job is in progress */
840
- get isProcessing() {
841
- return this.status !== "pending" && this.status !== "complete" && this.status !== "failed";
842
- }
289
+ var VideoComposition = class extends Content {
290
+ /** Frames per second — everything downstream is in frames */
291
+ fps = 30;
292
+ /** Render width in pixels */
293
+ width = 1920;
294
+ /** Render height in pixels */
295
+ height = 1080;
296
+ /** Computed total: sum of sequences minus transition overlaps */
297
+ durationInFrames = 0;
298
+ /** Render status */
299
+ renderStatus = "draft";
300
+ /** Render progress (0-100) */
301
+ renderProgress = 0;
302
+ constructor(options = {}) {
303
+ super({
304
+ ...options,
305
+ type: "video-composition"
306
+ });
307
+ if (options.fps !== void 0) this.fps = options.fps;
308
+ if (options.width !== void 0) this.width = options.width;
309
+ if (options.height !== void 0) this.height = options.height;
310
+ if (options.durationInFrames !== void 0) this.durationInFrames = options.durationInFrames;
311
+ if (options.renderStatus !== void 0) this.renderStatus = options.renderStatus;
312
+ if (options.renderProgress !== void 0) this.renderProgress = options.renderProgress;
313
+ }
314
+ /** Duration in seconds */
315
+ get durationInSeconds() {
316
+ if (this.fps === 0) return 0;
317
+ return this.durationInFrames / this.fps;
318
+ }
319
+ /** Check if the composition is ready for publishing */
320
+ get isReady() {
321
+ return this.renderStatus === "ready";
322
+ }
323
+ /** Check if the composition is currently rendering */
324
+ get isRendering() {
325
+ return this.renderStatus === "rendering";
326
+ }
327
+ async getAssets(relationship) {
328
+ const canonicalAssets = await super.getAssets(relationship);
329
+ if (!this.id) return canonicalAssets;
330
+ const role = relationship;
331
+ const legacyAssets = await resolveOwnedAssets(this.db, this.tenantId, await listLegacyOwnedAssetIds({
332
+ db: this.db,
333
+ ownerColumn: "video_composition_id",
334
+ ownerId: this.id,
335
+ role,
336
+ metaTypes: legacyVideoAssetMetaTypes("VideoCompositionAsset")
337
+ }));
338
+ return [...canonicalAssets, ...legacyAssets.filter((asset) => asset.id && !canonicalAssets.some((canonicalAsset) => canonicalAsset.id === asset.id))];
339
+ }
340
+ async getAssetByRole(role) {
341
+ return (await this.getAssets(role))[0] || null;
342
+ }
843
343
  };
844
- __decorateClass$h([
845
- tenantId({ nullable: true })
846
- ], CompositeJob.prototype, "tenantId", 2);
847
- __decorateClass$h([
848
- crossPackageRef("@happyvertical/smrt-assets:Asset")
849
- ], CompositeJob.prototype, "characterVideoAssetId", 2);
850
- __decorateClass$h([
851
- foreignKey(() => Scene)
852
- ], CompositeJob.prototype, "sceneId", 2);
853
- __decorateClass$h([
854
- crossPackageRef("@happyvertical/smrt-assets:Asset")
855
- ], CompositeJob.prototype, "outputAssetId", 2);
856
- CompositeJob = __decorateClass$h([
857
- TenantScoped({ mode: "optional" }),
858
- smrt({
859
- tableStrategy: "sti",
860
- api: {
861
- include: ["list", "get", "create", "update"]
862
- },
863
- mcp: {
864
- include: ["list", "get"]
865
- },
866
- cli: true
867
- })
868
- ], CompositeJob);
869
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
870
- var __decorateClass$g = (decorators, target, key, kind) => {
871
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
872
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
873
- if (decorator = decorators[i])
874
- result = decorator(result) || result;
875
- return result;
344
+ VideoComposition = __decorateClass$16([TenantScoped({ mode: "optional" }), smrt({
345
+ tableStrategy: "sti",
346
+ api: { include: [
347
+ "list",
348
+ "get",
349
+ "create",
350
+ "update",
351
+ "delete"
352
+ ] },
353
+ mcp: { include: ["list", "get"] },
354
+ cli: true
355
+ })], VideoComposition);
356
+ //#endregion
357
+ //#region src/video-compositions.ts
358
+ var VideoCompositionCollection = class extends SmrtCollection {
359
+ static _itemClass = VideoComposition;
360
+ /** Find compositions by render status */
361
+ async findByRenderStatus(renderStatus) {
362
+ return await this.list({ where: { renderStatus } });
363
+ }
364
+ /** Find compositions that are ready for publishing */
365
+ async findReady() {
366
+ return await this.list({ where: { renderStatus: "ready" } });
367
+ }
876
368
  };
877
- let VideoComposition = class extends Content {
878
- /** Frames per second — everything downstream is in frames */
879
- fps = 30;
880
- /** Render width in pixels */
881
- width = 1920;
882
- /** Render height in pixels */
883
- height = 1080;
884
- /** Computed total: sum of sequences minus transition overlaps */
885
- durationInFrames = 0;
886
- /** Render status */
887
- renderStatus = "draft";
888
- /** Render progress (0-100) */
889
- renderProgress = 0;
890
- constructor(options = {}) {
891
- super({
892
- ...options,
893
- type: "video-composition"
894
- });
895
- if (options.fps !== void 0) this.fps = options.fps;
896
- if (options.width !== void 0) this.width = options.width;
897
- if (options.height !== void 0) this.height = options.height;
898
- if (options.durationInFrames !== void 0)
899
- this.durationInFrames = options.durationInFrames;
900
- if (options.renderStatus !== void 0)
901
- this.renderStatus = options.renderStatus;
902
- if (options.renderProgress !== void 0)
903
- this.renderProgress = options.renderProgress;
904
- }
905
- /** Duration in seconds */
906
- get durationInSeconds() {
907
- if (this.fps === 0) return 0;
908
- return this.durationInFrames / this.fps;
909
- }
910
- /** Check if the composition is ready for publishing */
911
- get isReady() {
912
- return this.renderStatus === "ready";
913
- }
914
- /** Check if the composition is currently rendering */
915
- get isRendering() {
916
- return this.renderStatus === "rendering";
917
- }
918
- async getAssets(relationship) {
919
- const canonicalAssets = await super.getAssets(relationship);
920
- if (!this.id) {
921
- return canonicalAssets;
922
- }
923
- const role = relationship;
924
- const legacyAssets = await resolveOwnedAssets(
925
- this.db,
926
- this.tenantId,
927
- await listLegacyOwnedAssetIds({
928
- db: this.db,
929
- ownerColumn: "video_composition_id",
930
- ownerId: this.id,
931
- role,
932
- metaTypes: legacyVideoAssetMetaTypes("VideoCompositionAsset")
933
- })
934
- );
935
- return [
936
- ...canonicalAssets,
937
- ...legacyAssets.filter(
938
- (asset) => asset.id && !canonicalAssets.some(
939
- (canonicalAsset) => canonicalAsset.id === asset.id
940
- )
941
- )
942
- ];
943
- }
944
- async getAssetByRole(role) {
945
- const assets = await this.getAssets(role);
946
- return assets[0] || null;
947
- }
369
+ //#endregion
370
+ //#region src/video-sequence.ts
371
+ var __defProp$15 = Object.defineProperty;
372
+ var __getOwnPropDesc$15 = Object.getOwnPropertyDescriptor;
373
+ var __decorateClass$15 = (decorators, target, key, kind) => {
374
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$15(target, key) : target;
375
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
376
+ if (kind && result) __defProp$15(target, key, result);
377
+ return result;
948
378
  };
949
- VideoComposition = __decorateClass$g([
950
- TenantScoped({ mode: "optional" }),
951
- smrt({
952
- tableStrategy: "sti",
953
- api: {
954
- include: ["list", "get", "create", "update", "delete"]
955
- },
956
- mcp: {
957
- include: ["list", "get"]
958
- },
959
- cli: true
960
- })
961
- ], VideoComposition);
962
- class VideoCompositionCollection extends SmrtCollection {
963
- static _itemClass = VideoComposition;
964
- /** Find compositions by render status */
965
- async findByRenderStatus(renderStatus) {
966
- return await this.list({
967
- where: { renderStatus }
968
- });
969
- }
970
- /** Find compositions that are ready for publishing */
971
- async findReady() {
972
- return await this.list({
973
- where: { renderStatus: "ready" }
974
- });
975
- }
976
- }
977
- var __defProp$f = Object.defineProperty;
978
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
979
- var __decorateClass$f = (decorators, target, key, kind) => {
980
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
981
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
982
- if (decorator = decorators[i])
983
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
984
- if (kind && result) __defProp$f(target, key, result);
985
- return result;
379
+ var VideoSequence = class extends Content {
380
+ compositionId = null;
381
+ /** Order within composition */
382
+ position = 0;
383
+ /** Computed duration: sum of shot frames */
384
+ durationInFrames = 0;
385
+ /** Transition type to the next sequence */
386
+ transitionType = "none";
387
+ /** Overlap frames with next sequence for transition */
388
+ transitionDurationFrames = 0;
389
+ constructor(options = {}) {
390
+ super({
391
+ ...options,
392
+ type: "video-sequence"
393
+ });
394
+ if (options.compositionId !== void 0) this.compositionId = options.compositionId;
395
+ if (options.position !== void 0) this.position = options.position;
396
+ if (options.durationInFrames !== void 0) this.durationInFrames = options.durationInFrames;
397
+ if (options.transitionType !== void 0) this.transitionType = options.transitionType;
398
+ if (options.transitionDurationFrames !== void 0) this.transitionDurationFrames = options.transitionDurationFrames;
399
+ }
400
+ async getAssets(relationship) {
401
+ const canonicalAssets = await super.getAssets(relationship);
402
+ if (!this.id) return canonicalAssets;
403
+ const role = relationship;
404
+ const legacyAssets = await resolveOwnedAssets(this.db, this.tenantId, await listLegacyOwnedAssetIds({
405
+ db: this.db,
406
+ ownerColumn: "video_sequence_id",
407
+ ownerId: this.id,
408
+ role,
409
+ metaTypes: legacyVideoAssetMetaTypes("VideoSequenceAsset")
410
+ }));
411
+ return [...canonicalAssets, ...legacyAssets.filter((asset) => asset.id && !canonicalAssets.some((canonicalAsset) => canonicalAsset.id === asset.id))];
412
+ }
413
+ async getAssetByRole(role) {
414
+ return (await this.getAssets(role))[0] || null;
415
+ }
986
416
  };
987
- let VideoSequence = class extends Content {
988
- compositionId = null;
989
- /** Order within composition */
990
- position = 0;
991
- /** Computed duration: sum of shot frames */
992
- durationInFrames = 0;
993
- /** Transition type to the next sequence */
994
- transitionType = "none";
995
- /** Overlap frames with next sequence for transition */
996
- transitionDurationFrames = 0;
997
- constructor(options = {}) {
998
- super({
999
- ...options,
1000
- type: "video-sequence"
1001
- });
1002
- if (options.compositionId !== void 0)
1003
- this.compositionId = options.compositionId;
1004
- if (options.position !== void 0) this.position = options.position;
1005
- if (options.durationInFrames !== void 0)
1006
- this.durationInFrames = options.durationInFrames;
1007
- if (options.transitionType !== void 0)
1008
- this.transitionType = options.transitionType;
1009
- if (options.transitionDurationFrames !== void 0)
1010
- this.transitionDurationFrames = options.transitionDurationFrames;
1011
- }
1012
- async getAssets(relationship) {
1013
- const canonicalAssets = await super.getAssets(relationship);
1014
- if (!this.id) {
1015
- return canonicalAssets;
1016
- }
1017
- const role = relationship;
1018
- const legacyAssets = await resolveOwnedAssets(
1019
- this.db,
1020
- this.tenantId,
1021
- await listLegacyOwnedAssetIds({
1022
- db: this.db,
1023
- ownerColumn: "video_sequence_id",
1024
- ownerId: this.id,
1025
- role,
1026
- metaTypes: legacyVideoAssetMetaTypes("VideoSequenceAsset")
1027
- })
1028
- );
1029
- return [
1030
- ...canonicalAssets,
1031
- ...legacyAssets.filter(
1032
- (asset) => asset.id && !canonicalAssets.some(
1033
- (canonicalAsset) => canonicalAsset.id === asset.id
1034
- )
1035
- )
1036
- ];
1037
- }
1038
- async getAssetByRole(role) {
1039
- const assets = await this.getAssets(role);
1040
- return assets[0] || null;
1041
- }
417
+ __decorateClass$15([foreignKey("VideoComposition")], VideoSequence.prototype, "compositionId", 2);
418
+ VideoSequence = __decorateClass$15([TenantScoped({ mode: "optional" }), smrt({
419
+ tableStrategy: "sti",
420
+ api: { include: [
421
+ "list",
422
+ "get",
423
+ "create",
424
+ "update",
425
+ "delete"
426
+ ] },
427
+ mcp: { include: ["list", "get"] },
428
+ cli: true
429
+ })], VideoSequence);
430
+ //#endregion
431
+ //#region src/video-sequences.ts
432
+ var VideoSequenceCollection = class extends SmrtCollection {
433
+ static _itemClass = VideoSequence;
434
+ /** Find sequences belonging to a composition, ordered by position */
435
+ async findByComposition(compositionId) {
436
+ return await this.list({
437
+ where: { compositionId },
438
+ orderBy: "position ASC"
439
+ });
440
+ }
441
+ /** Find standalone sequences (not in any composition) */
442
+ async findStandalone() {
443
+ return await this.list({ where: { compositionId: null } });
444
+ }
1042
445
  };
1043
- __decorateClass$f([
1044
- foreignKey("VideoComposition")
1045
- ], VideoSequence.prototype, "compositionId", 2);
1046
- VideoSequence = __decorateClass$f([
1047
- TenantScoped({ mode: "optional" }),
1048
- smrt({
1049
- tableStrategy: "sti",
1050
- api: {
1051
- include: ["list", "get", "create", "update", "delete"]
1052
- },
1053
- mcp: {
1054
- include: ["list", "get"]
1055
- },
1056
- cli: true
1057
- })
1058
- ], VideoSequence);
1059
- class VideoSequenceCollection extends SmrtCollection {
1060
- static _itemClass = VideoSequence;
1061
- /** Find sequences belonging to a composition, ordered by position */
1062
- async findByComposition(compositionId) {
1063
- return await this.list({
1064
- where: { compositionId },
1065
- orderBy: "position ASC"
1066
- });
1067
- }
1068
- /** Find standalone sequences (not in any composition) */
1069
- async findStandalone() {
1070
- return await this.list({
1071
- where: { compositionId: null }
1072
- });
1073
- }
1074
- }
1075
- var __defProp$e = Object.defineProperty;
1076
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
1077
- var __decorateClass$e = (decorators, target, key, kind) => {
1078
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
1079
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1080
- if (decorator = decorators[i])
1081
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1082
- if (kind && result) __defProp$e(target, key, result);
1083
- return result;
446
+ //#endregion
447
+ //#region src/video-shot.ts
448
+ var __defProp$14 = Object.defineProperty;
449
+ var __getOwnPropDesc$14 = Object.getOwnPropertyDescriptor;
450
+ var __decorateClass$14 = (decorators, target, key, kind) => {
451
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$14(target, key) : target;
452
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
453
+ if (kind && result) __defProp$14(target, key, result);
454
+ return result;
1084
455
  };
1085
- let VideoShot = class extends Content {
1086
- sequenceId = null;
1087
- sceneId = null;
1088
- /** Order within sequence */
1089
- position = 0;
1090
- /** Actual frame count of generated clip */
1091
- durationInFrames = 0;
1092
- /** Frames to skip at start (overlap handling) */
1093
- trimBeforeFrames = 0;
1094
- /** Frames to skip at end */
1095
- trimAfterFrames = 0;
1096
- /** Script text to be spoken */
1097
- scriptText = "";
1098
- /** Word count in the script */
1099
- scriptWordCount = 0;
1100
- /** Target duration in seconds */
1101
- targetDuration = 30;
1102
- /** Video generation status */
1103
- shotStatus = "draft";
1104
- /** Generation progress (0-100) */
1105
- progress = 0;
1106
- /** Error message if status is 'failed' */
1107
- errorMessage = null;
1108
- /** Detailed status message for progress tracking */
1109
- statusMessage = null;
1110
- /** Video metadata (duration, resolution, etc.) */
1111
- videoMetadata = {};
1112
- constructor(options = {}) {
1113
- super({
1114
- ...options,
1115
- type: "video-shot"
1116
- });
1117
- if (options.sequenceId !== void 0) this.sequenceId = options.sequenceId;
1118
- if (options.sceneId !== void 0) this.sceneId = options.sceneId;
1119
- if (options.position !== void 0) this.position = options.position;
1120
- if (options.durationInFrames !== void 0)
1121
- this.durationInFrames = options.durationInFrames;
1122
- if (options.trimBeforeFrames !== void 0)
1123
- this.trimBeforeFrames = options.trimBeforeFrames;
1124
- if (options.trimAfterFrames !== void 0)
1125
- this.trimAfterFrames = options.trimAfterFrames;
1126
- if (options.scriptText !== void 0) {
1127
- this.scriptText = options.scriptText;
1128
- this.scriptWordCount = this.scriptText.split(/\s+/).filter(Boolean).length;
1129
- }
1130
- if (options.scriptWordCount !== void 0)
1131
- this.scriptWordCount = options.scriptWordCount;
1132
- if (options.targetDuration !== void 0)
1133
- this.targetDuration = options.targetDuration;
1134
- if (options.shotStatus !== void 0) this.shotStatus = options.shotStatus;
1135
- if (options.progress !== void 0) this.progress = options.progress;
1136
- if (options.errorMessage !== void 0)
1137
- this.errorMessage = options.errorMessage;
1138
- if (options.statusMessage !== void 0)
1139
- this.statusMessage = options.statusMessage;
1140
- if (options.videoMetadata !== void 0)
1141
- this.videoMetadata = options.videoMetadata;
1142
- }
1143
- /** Estimate speech duration based on word count (2.7 words/sec) */
1144
- get estimatedDuration() {
1145
- return this.scriptWordCount / 2.7;
1146
- }
1147
- /** Check if the script length matches target duration (+/- 15%) */
1148
- get isScriptLengthValid() {
1149
- const estimated = this.estimatedDuration;
1150
- const tolerance = this.targetDuration * 0.15;
1151
- return estimated >= this.targetDuration - tolerance && estimated <= this.targetDuration + tolerance;
1152
- }
1153
- /** Get the recommended word count for target duration */
1154
- get recommendedWordCount() {
1155
- const wordsPerSecond = 2.7;
1156
- const target = Math.round(this.targetDuration * wordsPerSecond);
1157
- const tolerance = Math.round(target * 0.15);
1158
- return {
1159
- min: target - tolerance,
1160
- max: target + tolerance,
1161
- target
1162
- };
1163
- }
1164
- /** Effective frame count after trimming */
1165
- get effectiveFrames() {
1166
- return Math.max(
1167
- 0,
1168
- this.durationInFrames - this.trimBeforeFrames - this.trimAfterFrames
1169
- );
1170
- }
1171
- /** Check if video generation is in progress */
1172
- get isGenerating() {
1173
- return this.shotStatus === "queued" || this.shotStatus === "processing";
1174
- }
1175
- /** Check if video is ready for publishing */
1176
- get isReady() {
1177
- return this.shotStatus === "ready";
1178
- }
1179
- async getAssets(relationship) {
1180
- const canonicalAssets = await super.getAssets(relationship);
1181
- if (!this.id) {
1182
- return canonicalAssets;
1183
- }
1184
- const role = relationship;
1185
- const legacyAssets = await resolveOwnedAssets(
1186
- this.db,
1187
- this.tenantId,
1188
- await listLegacyOwnedAssetIds({
1189
- db: this.db,
1190
- ownerColumn: "video_shot_id",
1191
- ownerId: this.id,
1192
- role,
1193
- metaTypes: legacyVideoAssetMetaTypes("VideoShotAsset")
1194
- })
1195
- );
1196
- return [
1197
- ...canonicalAssets,
1198
- ...legacyAssets.filter(
1199
- (asset) => asset.id && !canonicalAssets.some(
1200
- (canonicalAsset) => canonicalAsset.id === asset.id
1201
- )
1202
- )
1203
- ];
1204
- }
1205
- async getAssetByRole(role) {
1206
- const assets = await this.getAssets(role);
1207
- return assets[0] || null;
1208
- }
1209
- /** Update script text and recalculate word count */
1210
- setScript(text) {
1211
- this.scriptText = text;
1212
- this.scriptWordCount = text.split(/\s+/).filter(Boolean).length;
1213
- }
456
+ var VideoShot = class extends Content {
457
+ sequenceId = null;
458
+ sceneId = null;
459
+ /** Order within sequence */
460
+ position = 0;
461
+ /** Actual frame count of generated clip */
462
+ durationInFrames = 0;
463
+ /** Frames to skip at start (overlap handling) */
464
+ trimBeforeFrames = 0;
465
+ /** Frames to skip at end */
466
+ trimAfterFrames = 0;
467
+ /** Script text to be spoken */
468
+ scriptText = "";
469
+ /** Word count in the script */
470
+ scriptWordCount = 0;
471
+ /** Target duration in seconds */
472
+ targetDuration = 30;
473
+ /** Video generation status */
474
+ shotStatus = "draft";
475
+ /** Generation progress (0-100) */
476
+ progress = 0;
477
+ /** Error message if status is 'failed' */
478
+ errorMessage = null;
479
+ /** Detailed status message for progress tracking */
480
+ statusMessage = null;
481
+ /** Video metadata (duration, resolution, etc.) */
482
+ videoMetadata = {};
483
+ constructor(options = {}) {
484
+ super({
485
+ ...options,
486
+ type: "video-shot"
487
+ });
488
+ if (options.sequenceId !== void 0) this.sequenceId = options.sequenceId;
489
+ if (options.sceneId !== void 0) this.sceneId = options.sceneId;
490
+ if (options.position !== void 0) this.position = options.position;
491
+ if (options.durationInFrames !== void 0) this.durationInFrames = options.durationInFrames;
492
+ if (options.trimBeforeFrames !== void 0) this.trimBeforeFrames = options.trimBeforeFrames;
493
+ if (options.trimAfterFrames !== void 0) this.trimAfterFrames = options.trimAfterFrames;
494
+ if (options.scriptText !== void 0) {
495
+ this.scriptText = options.scriptText;
496
+ this.scriptWordCount = this.scriptText.split(/\s+/).filter(Boolean).length;
497
+ }
498
+ if (options.scriptWordCount !== void 0) this.scriptWordCount = options.scriptWordCount;
499
+ if (options.targetDuration !== void 0) this.targetDuration = options.targetDuration;
500
+ if (options.shotStatus !== void 0) this.shotStatus = options.shotStatus;
501
+ if (options.progress !== void 0) this.progress = options.progress;
502
+ if (options.errorMessage !== void 0) this.errorMessage = options.errorMessage;
503
+ if (options.statusMessage !== void 0) this.statusMessage = options.statusMessage;
504
+ if (options.videoMetadata !== void 0) this.videoMetadata = options.videoMetadata;
505
+ }
506
+ /** Estimate speech duration based on word count (2.7 words/sec) */
507
+ get estimatedDuration() {
508
+ return this.scriptWordCount / 2.7;
509
+ }
510
+ /** Check if the script length matches target duration (+/- 15%) */
511
+ get isScriptLengthValid() {
512
+ const estimated = this.estimatedDuration;
513
+ const tolerance = this.targetDuration * .15;
514
+ return estimated >= this.targetDuration - tolerance && estimated <= this.targetDuration + tolerance;
515
+ }
516
+ /** Get the recommended word count for target duration */
517
+ get recommendedWordCount() {
518
+ const target = Math.round(this.targetDuration * 2.7);
519
+ const tolerance = Math.round(target * .15);
520
+ return {
521
+ min: target - tolerance,
522
+ max: target + tolerance,
523
+ target
524
+ };
525
+ }
526
+ /** Effective frame count after trimming */
527
+ get effectiveFrames() {
528
+ return Math.max(0, this.durationInFrames - this.trimBeforeFrames - this.trimAfterFrames);
529
+ }
530
+ /** Check if video generation is in progress */
531
+ get isGenerating() {
532
+ return this.shotStatus === "queued" || this.shotStatus === "processing";
533
+ }
534
+ /** Check if video is ready for publishing */
535
+ get isReady() {
536
+ return this.shotStatus === "ready";
537
+ }
538
+ async getAssets(relationship) {
539
+ const canonicalAssets = await super.getAssets(relationship);
540
+ if (!this.id) return canonicalAssets;
541
+ const role = relationship;
542
+ const legacyAssets = await resolveOwnedAssets(this.db, this.tenantId, await listLegacyOwnedAssetIds({
543
+ db: this.db,
544
+ ownerColumn: "video_shot_id",
545
+ ownerId: this.id,
546
+ role,
547
+ metaTypes: legacyVideoAssetMetaTypes("VideoShotAsset")
548
+ }));
549
+ return [...canonicalAssets, ...legacyAssets.filter((asset) => asset.id && !canonicalAssets.some((canonicalAsset) => canonicalAsset.id === asset.id))];
550
+ }
551
+ async getAssetByRole(role) {
552
+ return (await this.getAssets(role))[0] || null;
553
+ }
554
+ /** Update script text and recalculate word count */
555
+ setScript(text) {
556
+ this.scriptText = text;
557
+ this.scriptWordCount = text.split(/\s+/).filter(Boolean).length;
558
+ }
1214
559
  };
1215
- __decorateClass$e([
1216
- foreignKey(() => VideoSequence)
1217
- ], VideoShot.prototype, "sequenceId", 2);
1218
- __decorateClass$e([
1219
- foreignKey(() => Scene)
1220
- ], VideoShot.prototype, "sceneId", 2);
1221
- VideoShot = __decorateClass$e([
1222
- TenantScoped({ mode: "optional" }),
1223
- smrt({
1224
- tableStrategy: "sti",
1225
- api: {
1226
- include: ["list", "get", "create", "update", "delete"]
1227
- },
1228
- mcp: {
1229
- include: ["list", "get"]
1230
- },
1231
- cli: true
1232
- })
1233
- ], VideoShot);
1234
- var __defProp$d = Object.defineProperty;
1235
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
1236
- var __decorateClass$d = (decorators, target, key, kind) => {
1237
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
1238
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1239
- if (decorator = decorators[i])
1240
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1241
- if (kind && result) __defProp$d(target, key, result);
1242
- return result;
560
+ __decorateClass$14([foreignKey(() => VideoSequence)], VideoShot.prototype, "sequenceId", 2);
561
+ __decorateClass$14([foreignKey(() => Scene)], VideoShot.prototype, "sceneId", 2);
562
+ VideoShot = __decorateClass$14([TenantScoped({ mode: "optional" }), smrt({
563
+ tableStrategy: "sti",
564
+ api: { include: [
565
+ "list",
566
+ "get",
567
+ "create",
568
+ "update",
569
+ "delete"
570
+ ] },
571
+ mcp: { include: ["list", "get"] },
572
+ cli: true
573
+ })], VideoShot);
574
+ //#endregion
575
+ //#region src/video-shot-character.ts
576
+ var __defProp$13 = Object.defineProperty;
577
+ var __getOwnPropDesc$13 = Object.getOwnPropertyDescriptor;
578
+ var __decorateClass$13 = (decorators, target, key, kind) => {
579
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$13(target, key) : target;
580
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
581
+ if (kind && result) __defProp$13(target, key, result);
582
+ return result;
1243
583
  };
1244
- let VideoShotCharacter = class extends SmrtObject {
1245
- tenantId = null;
1246
- videoShotId = "";
1247
- characterId = "";
1248
- /** Role of the character in this shot */
1249
- role = "primary";
1250
- /** Order/layer position within the shot */
1251
- position = 0;
1252
- constructor(options) {
1253
- super(options);
1254
- this.videoShotId = options.videoShotId;
1255
- this.characterId = options.characterId;
1256
- if (options.role !== void 0) this.role = options.role;
1257
- if (options.position !== void 0) this.position = options.position;
1258
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
1259
- }
584
+ var VideoShotCharacter = class extends SmrtObject {
585
+ tenantId = null;
586
+ videoShotId = "";
587
+ characterId = "";
588
+ /** Role of the character in this shot */
589
+ role = "primary";
590
+ /** Order/layer position within the shot */
591
+ position = 0;
592
+ constructor(options) {
593
+ super(options);
594
+ this.videoShotId = options.videoShotId;
595
+ this.characterId = options.characterId;
596
+ if (options.role !== void 0) this.role = options.role;
597
+ if (options.position !== void 0) this.position = options.position;
598
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
599
+ }
1260
600
  };
1261
- __decorateClass$d([
1262
- tenantId({ nullable: true })
1263
- ], VideoShotCharacter.prototype, "tenantId", 2);
1264
- __decorateClass$d([
1265
- foreignKey(() => VideoShot, { required: true })
1266
- ], VideoShotCharacter.prototype, "videoShotId", 2);
1267
- __decorateClass$d([
1268
- foreignKey(() => Character, { required: true })
1269
- ], VideoShotCharacter.prototype, "characterId", 2);
1270
- VideoShotCharacter = __decorateClass$d([
1271
- TenantScoped({ mode: "optional" }),
1272
- smrt({
1273
- tableStrategy: "sti",
1274
- api: {
1275
- include: ["list", "get", "create", "delete"]
1276
- },
1277
- mcp: {
1278
- include: ["list", "get"]
1279
- },
1280
- cli: true
1281
- })
1282
- ], VideoShotCharacter);
1283
- class VideoShotCharacterCollection extends SmrtCollection {
1284
- static _itemClass = VideoShotCharacter;
1285
- /** Find all character links for a shot, ordered by position */
1286
- async findByShot(videoShotId) {
1287
- return await this.list({
1288
- where: { videoShotId },
1289
- orderBy: "position ASC"
1290
- });
1291
- }
1292
- /** Find all shot links for a character */
1293
- async findByCharacter(characterId) {
1294
- return await this.list({
1295
- where: { characterId }
1296
- });
1297
- }
1298
- }
1299
- class VideoShotCollection extends SmrtCollection {
1300
- static _itemClass = VideoShot;
1301
- /** Find shots belonging to a specific sequence, ordered by position */
1302
- async findBySequence(sequenceId) {
1303
- return await this.list({
1304
- where: { sequenceId },
1305
- orderBy: "position ASC"
1306
- });
1307
- }
1308
- /** Find shots by status */
1309
- async findByStatus(shotStatus) {
1310
- return await this.list({ where: { shotStatus } });
1311
- }
1312
- /** Find standalone shots (not in any sequence) */
1313
- async findStandalone() {
1314
- return await this.list({ where: { sequenceId: null } });
1315
- }
1316
- }
1317
- var __defProp$c = Object.defineProperty;
1318
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
1319
- var __decorateClass$c = (decorators, target, key, kind) => {
1320
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
1321
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1322
- if (decorator = decorators[i])
1323
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1324
- if (kind && result) __defProp$c(target, key, result);
1325
- return result;
601
+ __decorateClass$13([tenantId({ nullable: true })], VideoShotCharacter.prototype, "tenantId", 2);
602
+ __decorateClass$13([foreignKey(() => VideoShot, { required: true })], VideoShotCharacter.prototype, "videoShotId", 2);
603
+ __decorateClass$13([foreignKey(() => Character, { required: true })], VideoShotCharacter.prototype, "characterId", 2);
604
+ VideoShotCharacter = __decorateClass$13([TenantScoped({ mode: "optional" }), smrt({
605
+ tableStrategy: "sti",
606
+ api: { include: [
607
+ "list",
608
+ "get",
609
+ "create",
610
+ "delete"
611
+ ] },
612
+ mcp: { include: ["list", "get"] },
613
+ cli: true
614
+ })], VideoShotCharacter);
615
+ //#endregion
616
+ //#region src/video-shot-characters.ts
617
+ var VideoShotCharacterCollection = class extends SmrtCollection {
618
+ static _itemClass = VideoShotCharacter;
619
+ /** Find all character links for a shot, ordered by position */
620
+ async findByShot(videoShotId) {
621
+ return await this.list({
622
+ where: { videoShotId },
623
+ orderBy: "position ASC"
624
+ });
625
+ }
626
+ /** Find all shot links for a character */
627
+ async findByCharacter(characterId) {
628
+ return await this.list({ where: { characterId } });
629
+ }
1326
630
  };
1327
- const logger = createLogger({ level: "info" });
1328
- let VideoWorkflow = class extends SmrtObject {
1329
- tenantId = null;
1330
- /**
1331
- * Human-readable name for the workflow
1332
- */
1333
- name = "";
1334
- /**
1335
- * Description of what this workflow does
1336
- */
1337
- description = null;
1338
- /**
1339
- * Workflow type classification
1340
- * - prebake: Pre-generate base motion from seed image
1341
- * - broadcast: Full video generation pipeline
1342
- * - lipsync: Lip-sync only (requires base video + audio)
1343
- * - postprod: Post-production overlays and effects
1344
- * - custom: User-defined workflow
1345
- */
1346
- workflowType = "custom";
1347
- /**
1348
- * ComfyUI API format JSON
1349
- * This is the workflow definition that will be sent to ComfyUI
1350
- */
1351
- workflowJson = null;
1352
- /**
1353
- * Node ID mappings for dynamic parameter injection
1354
- * Maps semantic names to ComfyUI node IDs
1355
- */
1356
- nodeMapping = {};
1357
- /**
1358
- * Estimated processing time in seconds
1359
- * Used for progress estimation
1360
- */
1361
- estimatedTime = 300;
1362
- /**
1363
- * Whether this workflow is active/usable
1364
- */
1365
- isActive = true;
1366
- /**
1367
- * ComfyUI models required by this workflow
1368
- * Used for validation before queuing
1369
- */
1370
- requiredModels = [];
1371
- constructor(options = {}) {
1372
- super(options);
1373
- if (options.name !== void 0) this.name = options.name;
1374
- if (options.description !== void 0)
1375
- this.description = options.description;
1376
- if (options.workflowType !== void 0)
1377
- this.workflowType = options.workflowType;
1378
- if (options.workflowJson !== void 0)
1379
- this.workflowJson = options.workflowJson;
1380
- if (options.nodeMapping !== void 0)
1381
- this.nodeMapping = options.nodeMapping;
1382
- if (options.estimatedTime !== void 0)
1383
- this.estimatedTime = options.estimatedTime;
1384
- if (options.isActive !== void 0) this.isActive = options.isActive;
1385
- if (options.requiredModels !== void 0)
1386
- this.requiredModels = options.requiredModels;
1387
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
1388
- }
1389
- /**
1390
- * Check if the workflow has all required node mappings
1391
- */
1392
- get hasRequiredMappings() {
1393
- const required = ["outputVideo"];
1394
- return required.every((key) => this.nodeMapping[key] !== void 0);
1395
- }
1396
- /**
1397
- * Get a copy of the workflow JSON with injected parameters
1398
- *
1399
- * Parameter injection follows ComfyUI node structure conventions:
1400
- * - seedImage, audioFile, baseVideo → node.inputs.image (file path)
1401
- * - prompt → node.inputs.text (string)
1402
- * - Other parameters → node.inputs[paramKey]
1403
- *
1404
- * @param params - Key-value pairs of parameters to inject
1405
- * @returns Modified workflow JSON or null if no workflowJson set
1406
- */
1407
- injectParameters(params) {
1408
- if (!this.workflowJson) return null;
1409
- const workflow = JSON.parse(JSON.stringify(this.workflowJson));
1410
- const warnings = [];
1411
- for (const [paramKey, nodeId] of Object.entries(this.nodeMapping)) {
1412
- if (nodeId && params[paramKey] !== void 0) {
1413
- if (!workflow[nodeId]) {
1414
- warnings.push(
1415
- `Node mapping '${paramKey}' references node '${nodeId}' which does not exist in workflow`
1416
- );
1417
- continue;
1418
- }
1419
- workflow[nodeId].inputs = workflow[nodeId].inputs || {};
1420
- if (paramKey === "seedImage" || paramKey === "audioFile" || paramKey === "baseVideo") {
1421
- workflow[nodeId].inputs.image = params[paramKey];
1422
- } else if (paramKey === "prompt") {
1423
- workflow[nodeId].inputs.text = params[paramKey];
1424
- } else {
1425
- workflow[nodeId].inputs[paramKey] = params[paramKey];
1426
- }
1427
- }
1428
- }
1429
- if (warnings.length > 0 && process.env.NODE_ENV !== "production") {
1430
- logger.warn(
1431
- `[VideoWorkflow] Parameter injection warnings:
1432
- ${warnings.join("\n")}`
1433
- );
1434
- }
1435
- return workflow;
1436
- }
631
+ //#endregion
632
+ //#region src/video-shots.ts
633
+ var VideoShotCollection = class extends SmrtCollection {
634
+ static _itemClass = VideoShot;
635
+ /** Find shots belonging to a specific sequence, ordered by position */
636
+ async findBySequence(sequenceId) {
637
+ return await this.list({
638
+ where: { sequenceId },
639
+ orderBy: "position ASC"
640
+ });
641
+ }
642
+ /** Find shots by status */
643
+ async findByStatus(shotStatus) {
644
+ return await this.list({ where: { shotStatus } });
645
+ }
646
+ /** Find standalone shots (not in any sequence) */
647
+ async findStandalone() {
648
+ return await this.list({ where: { sequenceId: null } });
649
+ }
1437
650
  };
1438
- __decorateClass$c([
1439
- tenantId({ nullable: true })
1440
- ], VideoWorkflow.prototype, "tenantId", 2);
1441
- VideoWorkflow = __decorateClass$c([
1442
- TenantScoped({ mode: "optional" }),
1443
- smrt({
1444
- tableStrategy: "sti",
1445
- api: {
1446
- include: ["list", "get", "create", "update"]
1447
- },
1448
- mcp: {
1449
- include: ["list", "get"]
1450
- },
1451
- cli: true
1452
- })
1453
- ], VideoWorkflow);
1454
- var __defProp$b = Object.defineProperty;
1455
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
1456
- var __decorateClass$b = (decorators, target, key, kind) => {
1457
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
1458
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1459
- if (decorator = decorators[i])
1460
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1461
- if (kind && result) __defProp$b(target, key, result);
1462
- return result;
651
+ //#endregion
652
+ //#region src/video-workflow.ts
653
+ var __defProp$12 = Object.defineProperty;
654
+ var __getOwnPropDesc$12 = Object.getOwnPropertyDescriptor;
655
+ var __decorateClass$12 = (decorators, target, key, kind) => {
656
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$12(target, key) : target;
657
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
658
+ if (kind && result) __defProp$12(target, key, result);
659
+ return result;
1463
660
  };
1464
- let CharacterAsset = class extends Asset {
1465
- characterId = null;
1466
- role = "seed-image";
1467
- constructor(options = {}) {
1468
- super(options);
1469
- if (options.characterId !== void 0)
1470
- this.characterId = options.characterId;
1471
- if (options.role !== void 0) this.role = options.role;
1472
- }
661
+ var logger = createLogger({ level: "info" });
662
+ var VideoWorkflow = class extends SmrtObject {
663
+ tenantId = null;
664
+ /**
665
+ * Human-readable name for the workflow
666
+ */
667
+ name = "";
668
+ /**
669
+ * Description of what this workflow does
670
+ */
671
+ description = null;
672
+ /**
673
+ * Workflow type classification
674
+ * - prebake: Pre-generate base motion from seed image
675
+ * - broadcast: Full video generation pipeline
676
+ * - lipsync: Lip-sync only (requires base video + audio)
677
+ * - postprod: Post-production overlays and effects
678
+ * - custom: User-defined workflow
679
+ */
680
+ workflowType = "custom";
681
+ /**
682
+ * ComfyUI API format JSON
683
+ * This is the workflow definition that will be sent to ComfyUI
684
+ */
685
+ workflowJson = null;
686
+ /**
687
+ * Node ID mappings for dynamic parameter injection
688
+ * Maps semantic names to ComfyUI node IDs
689
+ */
690
+ nodeMapping = {};
691
+ /**
692
+ * Estimated processing time in seconds
693
+ * Used for progress estimation
694
+ */
695
+ estimatedTime = 300;
696
+ /**
697
+ * Whether this workflow is active/usable
698
+ */
699
+ isActive = true;
700
+ /**
701
+ * ComfyUI models required by this workflow
702
+ * Used for validation before queuing
703
+ */
704
+ requiredModels = [];
705
+ constructor(options = {}) {
706
+ super(options);
707
+ if (options.name !== void 0) this.name = options.name;
708
+ if (options.description !== void 0) this.description = options.description;
709
+ if (options.workflowType !== void 0) this.workflowType = options.workflowType;
710
+ if (options.workflowJson !== void 0) this.workflowJson = options.workflowJson;
711
+ if (options.nodeMapping !== void 0) this.nodeMapping = options.nodeMapping;
712
+ if (options.estimatedTime !== void 0) this.estimatedTime = options.estimatedTime;
713
+ if (options.isActive !== void 0) this.isActive = options.isActive;
714
+ if (options.requiredModels !== void 0) this.requiredModels = options.requiredModels;
715
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
716
+ }
717
+ /**
718
+ * Check if the workflow has all required node mappings
719
+ */
720
+ get hasRequiredMappings() {
721
+ return ["outputVideo"].every((key) => this.nodeMapping[key] !== void 0);
722
+ }
723
+ /**
724
+ * Get a copy of the workflow JSON with injected parameters
725
+ *
726
+ * Parameter injection follows ComfyUI node structure conventions:
727
+ * - seedImage, audioFile, baseVideo → node.inputs.image (file path)
728
+ * - prompt → node.inputs.text (string)
729
+ * - Other parameters → node.inputs[paramKey]
730
+ *
731
+ * @param params - Key-value pairs of parameters to inject
732
+ * @returns Modified workflow JSON or null if no workflowJson set
733
+ */
734
+ injectParameters(params) {
735
+ if (!this.workflowJson) return null;
736
+ const workflow = JSON.parse(JSON.stringify(this.workflowJson));
737
+ const warnings = [];
738
+ for (const [paramKey, nodeId] of Object.entries(this.nodeMapping)) if (nodeId && params[paramKey] !== void 0) {
739
+ if (!workflow[nodeId]) {
740
+ warnings.push(`Node mapping '${paramKey}' references node '${nodeId}' which does not exist in workflow`);
741
+ continue;
742
+ }
743
+ workflow[nodeId].inputs = workflow[nodeId].inputs || {};
744
+ if (paramKey === "seedImage" || paramKey === "audioFile" || paramKey === "baseVideo") workflow[nodeId].inputs.image = params[paramKey];
745
+ else if (paramKey === "prompt") workflow[nodeId].inputs.text = params[paramKey];
746
+ else workflow[nodeId].inputs[paramKey] = params[paramKey];
747
+ }
748
+ if (warnings.length > 0 && process.env.NODE_ENV !== "production") logger.warn(`[VideoWorkflow] Parameter injection warnings:
749
+ ${warnings.join("\n")}`);
750
+ return workflow;
751
+ }
1473
752
  };
1474
- __decorateClass$b([
1475
- foreignKey(() => Character)
1476
- ], CharacterAsset.prototype, "characterId", 2);
1477
- CharacterAsset = __decorateClass$b([
1478
- smrt({
1479
- api: { include: ["list", "get", "create", "update", "delete"] },
1480
- mcp: { include: ["list", "get"] },
1481
- cli: true
1482
- })
1483
- ], CharacterAsset);
1484
- var __defProp$a = Object.defineProperty;
1485
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
1486
- var __decorateClass$a = (decorators, target, key, kind) => {
1487
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
1488
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1489
- if (decorator = decorators[i])
1490
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1491
- if (kind && result) __defProp$a(target, key, result);
1492
- return result;
753
+ __decorateClass$12([tenantId({ nullable: true })], VideoWorkflow.prototype, "tenantId", 2);
754
+ VideoWorkflow = __decorateClass$12([TenantScoped({ mode: "optional" }), smrt({
755
+ tableStrategy: "sti",
756
+ api: { include: [
757
+ "list",
758
+ "get",
759
+ "create",
760
+ "update"
761
+ ] },
762
+ mcp: { include: ["list", "get"] },
763
+ cli: true
764
+ })], VideoWorkflow);
765
+ //#endregion
766
+ //#region src/character-asset.ts
767
+ var __defProp$11 = Object.defineProperty;
768
+ var __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor;
769
+ var __decorateClass$11 = (decorators, target, key, kind) => {
770
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$11(target, key) : target;
771
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
772
+ if (kind && result) __defProp$11(target, key, result);
773
+ return result;
1493
774
  };
1494
- let CharacterOwnedAsset = class extends SmrtObject {
1495
- tenantId = null;
1496
- characterId = "";
1497
- assetId = "";
1498
- role = "seed-image";
1499
- sortOrder = 0;
1500
- constructor(options = {}) {
1501
- super(options);
1502
- if (options.characterId) this.characterId = options.characterId;
1503
- if (options.assetId) this.assetId = options.assetId;
1504
- if (options.role !== void 0) this.role = options.role;
1505
- if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
1506
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
1507
- }
775
+ var CharacterAsset = class extends Asset {
776
+ characterId = null;
777
+ role = "seed-image";
778
+ constructor(options = {}) {
779
+ super(options);
780
+ if (options.characterId !== void 0) this.characterId = options.characterId;
781
+ if (options.role !== void 0) this.role = options.role;
782
+ }
1508
783
  };
1509
- __decorateClass$a([
1510
- tenantId({ nullable: true })
1511
- ], CharacterOwnedAsset.prototype, "tenantId", 2);
1512
- __decorateClass$a([
1513
- foreignKey(() => Character, { required: true })
1514
- ], CharacterOwnedAsset.prototype, "characterId", 2);
1515
- __decorateClass$a([
1516
- crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })
1517
- ], CharacterOwnedAsset.prototype, "assetId", 2);
1518
- __decorateClass$a([
1519
- field({ required: true })
1520
- ], CharacterOwnedAsset.prototype, "role", 2);
1521
- __decorateClass$a([
1522
- field()
1523
- ], CharacterOwnedAsset.prototype, "sortOrder", 2);
1524
- CharacterOwnedAsset = __decorateClass$a([
1525
- TenantScoped({ mode: "optional" }),
1526
- smrt({
1527
- name: "CharacterOwnedAsset",
1528
- tableName: "character_assets",
1529
- conflictColumns: ["character_id", "asset_id", "role"],
1530
- api: false,
1531
- mcp: false,
1532
- cli: false
1533
- })
1534
- ], CharacterOwnedAsset);
784
+ __decorateClass$11([foreignKey(() => Character)], CharacterAsset.prototype, "characterId", 2);
785
+ CharacterAsset = __decorateClass$11([smrt({
786
+ api: { include: [
787
+ "list",
788
+ "get",
789
+ "create",
790
+ "update",
791
+ "delete"
792
+ ] },
793
+ mcp: { include: ["list", "get"] },
794
+ cli: true
795
+ })], CharacterAsset);
796
+ //#endregion
797
+ //#region src/character-owned-asset.ts
798
+ var __defProp$10 = Object.defineProperty;
799
+ var __getOwnPropDesc$10 = Object.getOwnPropertyDescriptor;
800
+ var __decorateClass$10 = (decorators, target, key, kind) => {
801
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$10(target, key) : target;
802
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
803
+ if (kind && result) __defProp$10(target, key, result);
804
+ return result;
805
+ };
806
+ var CharacterOwnedAsset = class extends SmrtObject {
807
+ tenantId = null;
808
+ characterId = "";
809
+ assetId = "";
810
+ role = "seed-image";
811
+ sortOrder = 0;
812
+ constructor(options = {}) {
813
+ super(options);
814
+ if (options.characterId) this.characterId = options.characterId;
815
+ if (options.assetId) this.assetId = options.assetId;
816
+ if (options.role !== void 0) this.role = options.role;
817
+ if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
818
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
819
+ }
820
+ };
821
+ __decorateClass$10([tenantId({ nullable: true })], CharacterOwnedAsset.prototype, "tenantId", 2);
822
+ __decorateClass$10([foreignKey(() => Character, { required: true })], CharacterOwnedAsset.prototype, "characterId", 2);
823
+ __decorateClass$10([crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })], CharacterOwnedAsset.prototype, "assetId", 2);
824
+ __decorateClass$10([field({ required: true })], CharacterOwnedAsset.prototype, "role", 2);
825
+ __decorateClass$10([field()], CharacterOwnedAsset.prototype, "sortOrder", 2);
826
+ CharacterOwnedAsset = __decorateClass$10([TenantScoped({ mode: "optional" }), smrt({
827
+ name: "CharacterOwnedAsset",
828
+ tableName: "character_assets",
829
+ conflictColumns: [
830
+ "character_id",
831
+ "asset_id",
832
+ "role"
833
+ ],
834
+ api: false,
835
+ mcp: false,
836
+ cli: false
837
+ })], CharacterOwnedAsset);
838
+ //#endregion
839
+ //#region src/character-assets.ts
840
+ var character_assets_exports = /* @__PURE__ */ __exportAll({ CharacterOwnedAssetCollection: () => CharacterOwnedAssetCollection });
1535
841
  var __defProp$9 = Object.defineProperty;
1536
842
  var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
1537
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
843
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$9(obj, key, {
844
+ enumerable: true,
845
+ configurable: true,
846
+ writable: true,
847
+ value
848
+ }) : obj[key] = value;
1538
849
  var __decorateClass$9 = (decorators, target, key, kind) => {
1539
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
1540
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1541
- if (decorator = decorators[i])
1542
- result = decorator(result) || result;
1543
- return result;
850
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
851
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
852
+ if (kind && result) __defProp$9(target, key, result);
853
+ return result;
1544
854
  };
1545
- var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, key + "", value);
1546
- let CharacterOwnedAssetCollection = class extends SmrtJunction {
1547
- leftField = "characterId";
1548
- rightField = "assetId";
855
+ var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
856
+ var CharacterOwnedAssetCollection = class extends SmrtJunction {
857
+ leftField = "characterId";
858
+ rightField = "assetId";
1549
859
  };
1550
860
  __publicField$2(CharacterOwnedAssetCollection, "_itemClass", CharacterOwnedAsset);
1551
- CharacterOwnedAssetCollection = __decorateClass$9([
1552
- smrt({
1553
- api: false,
1554
- mcp: false,
1555
- cli: false
1556
- })
1557
- ], CharacterOwnedAssetCollection);
1558
- const characterAssets = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1559
- __proto__: null,
1560
- get CharacterOwnedAssetCollection() {
1561
- return CharacterOwnedAssetCollection;
1562
- }
1563
- }, Symbol.toStringTag, { value: "Module" }));
861
+ CharacterOwnedAssetCollection = __decorateClass$9([smrt({
862
+ api: false,
863
+ mcp: false,
864
+ cli: false
865
+ })], CharacterOwnedAssetCollection);
866
+ //#endregion
867
+ //#region src/performer-asset.ts
1564
868
  var __defProp$8 = Object.defineProperty;
1565
869
  var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
1566
870
  var __decorateClass$8 = (decorators, target, key, kind) => {
1567
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
1568
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1569
- if (decorator = decorators[i])
1570
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1571
- if (kind && result) __defProp$8(target, key, result);
1572
- return result;
871
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
872
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
873
+ if (kind && result) __defProp$8(target, key, result);
874
+ return result;
1573
875
  };
1574
- let PerformerAsset = class extends Asset {
1575
- performerId = null;
1576
- role = "reference";
1577
- constructor(options = {}) {
1578
- super(options);
1579
- if (options.performerId !== void 0)
1580
- this.performerId = options.performerId;
1581
- if (options.role !== void 0) this.role = options.role;
1582
- }
876
+ var PerformerAsset = class extends Asset {
877
+ performerId = null;
878
+ role = "reference";
879
+ constructor(options = {}) {
880
+ super(options);
881
+ if (options.performerId !== void 0) this.performerId = options.performerId;
882
+ if (options.role !== void 0) this.role = options.role;
883
+ }
1583
884
  };
1584
- __decorateClass$8([
1585
- foreignKey(() => Performer)
1586
- ], PerformerAsset.prototype, "performerId", 2);
1587
- PerformerAsset = __decorateClass$8([
1588
- smrt({
1589
- api: { include: ["list", "get", "create", "update", "delete"] },
1590
- mcp: { include: ["list", "get"] },
1591
- cli: true
1592
- })
1593
- ], PerformerAsset);
885
+ __decorateClass$8([foreignKey(() => Performer)], PerformerAsset.prototype, "performerId", 2);
886
+ PerformerAsset = __decorateClass$8([smrt({
887
+ api: { include: [
888
+ "list",
889
+ "get",
890
+ "create",
891
+ "update",
892
+ "delete"
893
+ ] },
894
+ mcp: { include: ["list", "get"] },
895
+ cli: true
896
+ })], PerformerAsset);
897
+ //#endregion
898
+ //#region src/performer-owned-asset.ts
1594
899
  var __defProp$7 = Object.defineProperty;
1595
900
  var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
1596
901
  var __decorateClass$7 = (decorators, target, key, kind) => {
1597
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
1598
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1599
- if (decorator = decorators[i])
1600
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1601
- if (kind && result) __defProp$7(target, key, result);
1602
- return result;
902
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
903
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
904
+ if (kind && result) __defProp$7(target, key, result);
905
+ return result;
1603
906
  };
1604
- let PerformerOwnedAsset = class extends SmrtObject {
1605
- tenantId = null;
1606
- performerId = "";
1607
- assetId = "";
1608
- role = "reference";
1609
- sortOrder = 0;
1610
- constructor(options = {}) {
1611
- super(options);
1612
- if (options.performerId) this.performerId = options.performerId;
1613
- if (options.assetId) this.assetId = options.assetId;
1614
- if (options.role !== void 0) this.role = options.role;
1615
- if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
1616
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
1617
- }
907
+ var PerformerOwnedAsset = class extends SmrtObject {
908
+ tenantId = null;
909
+ performerId = "";
910
+ assetId = "";
911
+ role = "reference";
912
+ sortOrder = 0;
913
+ constructor(options = {}) {
914
+ super(options);
915
+ if (options.performerId) this.performerId = options.performerId;
916
+ if (options.assetId) this.assetId = options.assetId;
917
+ if (options.role !== void 0) this.role = options.role;
918
+ if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
919
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
920
+ }
1618
921
  };
1619
- __decorateClass$7([
1620
- tenantId({ nullable: true })
1621
- ], PerformerOwnedAsset.prototype, "tenantId", 2);
1622
- __decorateClass$7([
1623
- foreignKey(() => Performer, { required: true })
1624
- ], PerformerOwnedAsset.prototype, "performerId", 2);
1625
- __decorateClass$7([
1626
- crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })
1627
- ], PerformerOwnedAsset.prototype, "assetId", 2);
1628
- __decorateClass$7([
1629
- field({ required: true })
1630
- ], PerformerOwnedAsset.prototype, "role", 2);
1631
- __decorateClass$7([
1632
- field()
1633
- ], PerformerOwnedAsset.prototype, "sortOrder", 2);
1634
- PerformerOwnedAsset = __decorateClass$7([
1635
- TenantScoped({ mode: "optional" }),
1636
- smrt({
1637
- name: "PerformerOwnedAsset",
1638
- tableName: "performer_assets",
1639
- conflictColumns: ["performer_id", "asset_id", "role"],
1640
- api: false,
1641
- mcp: false,
1642
- cli: false
1643
- })
1644
- ], PerformerOwnedAsset);
922
+ __decorateClass$7([tenantId({ nullable: true })], PerformerOwnedAsset.prototype, "tenantId", 2);
923
+ __decorateClass$7([foreignKey(() => Performer, { required: true })], PerformerOwnedAsset.prototype, "performerId", 2);
924
+ __decorateClass$7([crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })], PerformerOwnedAsset.prototype, "assetId", 2);
925
+ __decorateClass$7([field({ required: true })], PerformerOwnedAsset.prototype, "role", 2);
926
+ __decorateClass$7([field()], PerformerOwnedAsset.prototype, "sortOrder", 2);
927
+ PerformerOwnedAsset = __decorateClass$7([TenantScoped({ mode: "optional" }), smrt({
928
+ name: "PerformerOwnedAsset",
929
+ tableName: "performer_assets",
930
+ conflictColumns: [
931
+ "performer_id",
932
+ "asset_id",
933
+ "role"
934
+ ],
935
+ api: false,
936
+ mcp: false,
937
+ cli: false
938
+ })], PerformerOwnedAsset);
939
+ //#endregion
940
+ //#region src/performer-assets.ts
941
+ var performer_assets_exports = /* @__PURE__ */ __exportAll({ PerformerOwnedAssetCollection: () => PerformerOwnedAssetCollection });
1645
942
  var __defProp$6 = Object.defineProperty;
1646
943
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
1647
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
944
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$6(obj, key, {
945
+ enumerable: true,
946
+ configurable: true,
947
+ writable: true,
948
+ value
949
+ }) : obj[key] = value;
1648
950
  var __decorateClass$6 = (decorators, target, key, kind) => {
1649
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
1650
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1651
- if (decorator = decorators[i])
1652
- result = decorator(result) || result;
1653
- return result;
951
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
952
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
953
+ if (kind && result) __defProp$6(target, key, result);
954
+ return result;
1654
955
  };
1655
- var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "", value);
1656
- let PerformerOwnedAssetCollection = class extends SmrtJunction {
1657
- leftField = "performerId";
1658
- rightField = "assetId";
956
+ var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
957
+ var PerformerOwnedAssetCollection = class extends SmrtJunction {
958
+ leftField = "performerId";
959
+ rightField = "assetId";
1659
960
  };
1660
961
  __publicField$1(PerformerOwnedAssetCollection, "_itemClass", PerformerOwnedAsset);
1661
- PerformerOwnedAssetCollection = __decorateClass$6([
1662
- smrt({
1663
- api: false,
1664
- mcp: false,
1665
- cli: false
1666
- })
1667
- ], PerformerOwnedAssetCollection);
1668
- const performerAssets = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1669
- __proto__: null,
1670
- get PerformerOwnedAssetCollection() {
1671
- return PerformerOwnedAssetCollection;
1672
- }
1673
- }, Symbol.toStringTag, { value: "Module" }));
962
+ PerformerOwnedAssetCollection = __decorateClass$6([smrt({
963
+ api: false,
964
+ mcp: false,
965
+ cli: false
966
+ })], PerformerOwnedAssetCollection);
967
+ //#endregion
968
+ //#region src/scene-asset.ts
1674
969
  var __defProp$5 = Object.defineProperty;
1675
970
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
1676
971
  var __decorateClass$5 = (decorators, target, key, kind) => {
1677
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
1678
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1679
- if (decorator = decorators[i])
1680
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1681
- if (kind && result) __defProp$5(target, key, result);
1682
- return result;
972
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
973
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
974
+ if (kind && result) __defProp$5(target, key, result);
975
+ return result;
1683
976
  };
1684
- let SceneAsset = class extends Asset {
1685
- sceneId = null;
1686
- role = "source";
1687
- constructor(options = {}) {
1688
- super(options);
1689
- if (options.sceneId !== void 0) this.sceneId = options.sceneId;
1690
- if (options.role !== void 0) this.role = options.role;
1691
- }
977
+ var SceneAsset = class extends Asset {
978
+ sceneId = null;
979
+ role = "source";
980
+ constructor(options = {}) {
981
+ super(options);
982
+ if (options.sceneId !== void 0) this.sceneId = options.sceneId;
983
+ if (options.role !== void 0) this.role = options.role;
984
+ }
1692
985
  };
1693
- __decorateClass$5([
1694
- foreignKey(() => Scene)
1695
- ], SceneAsset.prototype, "sceneId", 2);
1696
- SceneAsset = __decorateClass$5([
1697
- smrt({
1698
- api: { include: ["list", "get", "create", "update", "delete"] },
1699
- mcp: { include: ["list", "get"] },
1700
- cli: true
1701
- })
1702
- ], SceneAsset);
986
+ __decorateClass$5([foreignKey(() => Scene)], SceneAsset.prototype, "sceneId", 2);
987
+ SceneAsset = __decorateClass$5([smrt({
988
+ api: { include: [
989
+ "list",
990
+ "get",
991
+ "create",
992
+ "update",
993
+ "delete"
994
+ ] },
995
+ mcp: { include: ["list", "get"] },
996
+ cli: true
997
+ })], SceneAsset);
998
+ //#endregion
999
+ //#region src/scene-owned-asset.ts
1703
1000
  var __defProp$4 = Object.defineProperty;
1704
1001
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
1705
1002
  var __decorateClass$4 = (decorators, target, key, kind) => {
1706
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
1707
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1708
- if (decorator = decorators[i])
1709
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1710
- if (kind && result) __defProp$4(target, key, result);
1711
- return result;
1003
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
1004
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1005
+ if (kind && result) __defProp$4(target, key, result);
1006
+ return result;
1712
1007
  };
1713
- let SceneOwnedAsset = class extends SmrtObject {
1714
- tenantId = null;
1715
- sceneId = "";
1716
- assetId = "";
1717
- role = "source";
1718
- sortOrder = 0;
1719
- constructor(options = {}) {
1720
- super(options);
1721
- if (options.sceneId) this.sceneId = options.sceneId;
1722
- if (options.assetId) this.assetId = options.assetId;
1723
- if (options.role !== void 0) this.role = options.role;
1724
- if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
1725
- if (options.tenantId !== void 0) this.tenantId = options.tenantId;
1726
- }
1008
+ var SceneOwnedAsset = class extends SmrtObject {
1009
+ tenantId = null;
1010
+ sceneId = "";
1011
+ assetId = "";
1012
+ role = "source";
1013
+ sortOrder = 0;
1014
+ constructor(options = {}) {
1015
+ super(options);
1016
+ if (options.sceneId) this.sceneId = options.sceneId;
1017
+ if (options.assetId) this.assetId = options.assetId;
1018
+ if (options.role !== void 0) this.role = options.role;
1019
+ if (options.sortOrder !== void 0) this.sortOrder = options.sortOrder;
1020
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
1021
+ }
1727
1022
  };
1728
- __decorateClass$4([
1729
- tenantId({ nullable: true })
1730
- ], SceneOwnedAsset.prototype, "tenantId", 2);
1731
- __decorateClass$4([
1732
- foreignKey(() => Scene, { required: true })
1733
- ], SceneOwnedAsset.prototype, "sceneId", 2);
1734
- __decorateClass$4([
1735
- crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })
1736
- ], SceneOwnedAsset.prototype, "assetId", 2);
1737
- __decorateClass$4([
1738
- field({ required: true })
1739
- ], SceneOwnedAsset.prototype, "role", 2);
1740
- __decorateClass$4([
1741
- field()
1742
- ], SceneOwnedAsset.prototype, "sortOrder", 2);
1743
- SceneOwnedAsset = __decorateClass$4([
1744
- TenantScoped({ mode: "optional" }),
1745
- smrt({
1746
- name: "SceneOwnedAsset",
1747
- tableName: "scene_assets",
1748
- conflictColumns: ["scene_id", "asset_id", "role"],
1749
- api: false,
1750
- mcp: false,
1751
- cli: false
1752
- })
1753
- ], SceneOwnedAsset);
1023
+ __decorateClass$4([tenantId({ nullable: true })], SceneOwnedAsset.prototype, "tenantId", 2);
1024
+ __decorateClass$4([foreignKey(() => Scene, { required: true })], SceneOwnedAsset.prototype, "sceneId", 2);
1025
+ __decorateClass$4([crossPackageRef("@happyvertical/smrt-assets:Asset", { required: true })], SceneOwnedAsset.prototype, "assetId", 2);
1026
+ __decorateClass$4([field({ required: true })], SceneOwnedAsset.prototype, "role", 2);
1027
+ __decorateClass$4([field()], SceneOwnedAsset.prototype, "sortOrder", 2);
1028
+ SceneOwnedAsset = __decorateClass$4([TenantScoped({ mode: "optional" }), smrt({
1029
+ name: "SceneOwnedAsset",
1030
+ tableName: "scene_assets",
1031
+ conflictColumns: [
1032
+ "scene_id",
1033
+ "asset_id",
1034
+ "role"
1035
+ ],
1036
+ api: false,
1037
+ mcp: false,
1038
+ cli: false
1039
+ })], SceneOwnedAsset);
1040
+ //#endregion
1041
+ //#region src/scene-assets.ts
1042
+ var scene_assets_exports = /* @__PURE__ */ __exportAll({ SceneOwnedAssetCollection: () => SceneOwnedAssetCollection });
1754
1043
  var __defProp$3 = Object.defineProperty;
1755
1044
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
1756
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1045
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
1046
+ enumerable: true,
1047
+ configurable: true,
1048
+ writable: true,
1049
+ value
1050
+ }) : obj[key] = value;
1757
1051
  var __decorateClass$3 = (decorators, target, key, kind) => {
1758
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
1759
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1760
- if (decorator = decorators[i])
1761
- result = decorator(result) || result;
1762
- return result;
1052
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
1053
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1054
+ if (kind && result) __defProp$3(target, key, result);
1055
+ return result;
1763
1056
  };
1764
- var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
1765
- let SceneOwnedAssetCollection = class extends SmrtJunction {
1766
- leftField = "sceneId";
1767
- rightField = "assetId";
1057
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
1058
+ var SceneOwnedAssetCollection = class extends SmrtJunction {
1059
+ leftField = "sceneId";
1060
+ rightField = "assetId";
1768
1061
  };
1769
1062
  __publicField(SceneOwnedAssetCollection, "_itemClass", SceneOwnedAsset);
1770
- SceneOwnedAssetCollection = __decorateClass$3([
1771
- smrt({
1772
- api: false,
1773
- mcp: false,
1774
- cli: false
1775
- })
1776
- ], SceneOwnedAssetCollection);
1777
- const sceneAssets = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1778
- __proto__: null,
1779
- get SceneOwnedAssetCollection() {
1780
- return SceneOwnedAssetCollection;
1781
- }
1782
- }, Symbol.toStringTag, { value: "Module" }));
1063
+ SceneOwnedAssetCollection = __decorateClass$3([smrt({
1064
+ api: false,
1065
+ mcp: false,
1066
+ cli: false
1067
+ })], SceneOwnedAssetCollection);
1068
+ //#endregion
1069
+ //#region src/video-composition-asset.ts
1783
1070
  var __defProp$2 = Object.defineProperty;
1784
1071
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
1785
1072
  var __decorateClass$2 = (decorators, target, key, kind) => {
1786
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
1787
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1788
- if (decorator = decorators[i])
1789
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1790
- if (kind && result) __defProp$2(target, key, result);
1791
- return result;
1073
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
1074
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1075
+ if (kind && result) __defProp$2(target, key, result);
1076
+ return result;
1792
1077
  };
1793
- let VideoCompositionAsset = class extends Asset {
1794
- videoCompositionId = null;
1795
- role = "video";
1796
- constructor(options = {}) {
1797
- super(options);
1798
- if (options.videoCompositionId !== void 0)
1799
- this.videoCompositionId = options.videoCompositionId;
1800
- if (options.role !== void 0) this.role = options.role;
1801
- }
1078
+ var VideoCompositionAsset = class extends Asset {
1079
+ videoCompositionId = null;
1080
+ role = "video";
1081
+ constructor(options = {}) {
1082
+ super(options);
1083
+ if (options.videoCompositionId !== void 0) this.videoCompositionId = options.videoCompositionId;
1084
+ if (options.role !== void 0) this.role = options.role;
1085
+ }
1802
1086
  };
1803
- __decorateClass$2([
1804
- foreignKey(() => VideoComposition)
1805
- ], VideoCompositionAsset.prototype, "videoCompositionId", 2);
1806
- VideoCompositionAsset = __decorateClass$2([
1807
- smrt({
1808
- api: { include: ["list", "get", "create", "update", "delete"] },
1809
- mcp: { include: ["list", "get"] },
1810
- cli: true
1811
- })
1812
- ], VideoCompositionAsset);
1087
+ __decorateClass$2([foreignKey(() => VideoComposition)], VideoCompositionAsset.prototype, "videoCompositionId", 2);
1088
+ VideoCompositionAsset = __decorateClass$2([smrt({
1089
+ api: { include: [
1090
+ "list",
1091
+ "get",
1092
+ "create",
1093
+ "update",
1094
+ "delete"
1095
+ ] },
1096
+ mcp: { include: ["list", "get"] },
1097
+ cli: true
1098
+ })], VideoCompositionAsset);
1099
+ //#endregion
1100
+ //#region src/video-sequence-asset.ts
1813
1101
  var __defProp$1 = Object.defineProperty;
1814
1102
  var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
1815
1103
  var __decorateClass$1 = (decorators, target, key, kind) => {
1816
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
1817
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1818
- if (decorator = decorators[i])
1819
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1820
- if (kind && result) __defProp$1(target, key, result);
1821
- return result;
1104
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
1105
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1106
+ if (kind && result) __defProp$1(target, key, result);
1107
+ return result;
1822
1108
  };
1823
- let VideoSequenceAsset = class extends Asset {
1824
- videoSequenceId = null;
1825
- role = "video";
1826
- constructor(options = {}) {
1827
- super(options);
1828
- if (options.videoSequenceId !== void 0)
1829
- this.videoSequenceId = options.videoSequenceId;
1830
- if (options.role !== void 0) this.role = options.role;
1831
- }
1109
+ var VideoSequenceAsset = class extends Asset {
1110
+ videoSequenceId = null;
1111
+ role = "video";
1112
+ constructor(options = {}) {
1113
+ super(options);
1114
+ if (options.videoSequenceId !== void 0) this.videoSequenceId = options.videoSequenceId;
1115
+ if (options.role !== void 0) this.role = options.role;
1116
+ }
1832
1117
  };
1833
- __decorateClass$1([
1834
- foreignKey(() => VideoSequence)
1835
- ], VideoSequenceAsset.prototype, "videoSequenceId", 2);
1836
- VideoSequenceAsset = __decorateClass$1([
1837
- smrt({
1838
- api: { include: ["list", "get", "create", "update", "delete"] },
1839
- mcp: { include: ["list", "get"] },
1840
- cli: true
1841
- })
1842
- ], VideoSequenceAsset);
1118
+ __decorateClass$1([foreignKey(() => VideoSequence)], VideoSequenceAsset.prototype, "videoSequenceId", 2);
1119
+ VideoSequenceAsset = __decorateClass$1([smrt({
1120
+ api: { include: [
1121
+ "list",
1122
+ "get",
1123
+ "create",
1124
+ "update",
1125
+ "delete"
1126
+ ] },
1127
+ mcp: { include: ["list", "get"] },
1128
+ cli: true
1129
+ })], VideoSequenceAsset);
1130
+ //#endregion
1131
+ //#region src/video-shot-asset.ts
1843
1132
  var __defProp = Object.defineProperty;
1844
1133
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1845
1134
  var __decorateClass = (decorators, target, key, kind) => {
1846
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1847
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
1848
- if (decorator = decorators[i])
1849
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1850
- if (kind && result) __defProp(target, key, result);
1851
- return result;
1852
- };
1853
- let VideoShotAsset = class extends Asset {
1854
- videoShotId = null;
1855
- role = "video";
1856
- constructor(options = {}) {
1857
- super(options);
1858
- if (options.videoShotId !== void 0)
1859
- this.videoShotId = options.videoShotId;
1860
- if (options.role !== void 0) this.role = options.role;
1861
- }
1135
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1136
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1137
+ if (kind && result) __defProp(target, key, result);
1138
+ return result;
1862
1139
  };
1863
- __decorateClass([
1864
- foreignKey(() => VideoShot)
1865
- ], VideoShotAsset.prototype, "videoShotId", 2);
1866
- VideoShotAsset = __decorateClass([
1867
- smrt({
1868
- api: { include: ["list", "get", "create", "update", "delete"] },
1869
- mcp: { include: ["list", "get"] },
1870
- cli: true
1871
- })
1872
- ], VideoShotAsset);
1873
- export {
1874
- Character,
1875
- CharacterAsset,
1876
- CharacterCollection,
1877
- CharacterOwnedAsset,
1878
- CharacterOwnedAssetCollection,
1879
- CompositeJob,
1880
- Performer,
1881
- PerformerAsset,
1882
- PerformerOwnedAsset,
1883
- PerformerOwnedAssetCollection,
1884
- Character as PersonalityProfile,
1885
- Scene,
1886
- SceneAsset,
1887
- SceneOwnedAsset,
1888
- SceneOwnedAssetCollection,
1889
- VideoComposition,
1890
- VideoCompositionAsset,
1891
- VideoCompositionCollection,
1892
- VideoShot as VideoContent,
1893
- VideoSequence,
1894
- VideoSequenceAsset,
1895
- VideoSequenceCollection,
1896
- VideoShot,
1897
- VideoShotAsset,
1898
- VideoShotCharacter,
1899
- VideoShotCharacterCollection,
1900
- VideoShotCollection,
1901
- VideoWorkflow,
1902
- persistMediaBundleInspection
1140
+ var VideoShotAsset = class extends Asset {
1141
+ videoShotId = null;
1142
+ role = "video";
1143
+ constructor(options = {}) {
1144
+ super(options);
1145
+ if (options.videoShotId !== void 0) this.videoShotId = options.videoShotId;
1146
+ if (options.role !== void 0) this.role = options.role;
1147
+ }
1903
1148
  };
1904
- //# sourceMappingURL=index.js.map
1149
+ __decorateClass([foreignKey(() => VideoShot)], VideoShotAsset.prototype, "videoShotId", 2);
1150
+ VideoShotAsset = __decorateClass([smrt({
1151
+ api: { include: [
1152
+ "list",
1153
+ "get",
1154
+ "create",
1155
+ "update",
1156
+ "delete"
1157
+ ] },
1158
+ mcp: { include: ["list", "get"] },
1159
+ cli: true
1160
+ })], VideoShotAsset);
1161
+ //#endregion
1162
+ export { Character, Character as PersonalityProfile, CharacterAsset, CharacterCollection, CharacterOwnedAsset, CharacterOwnedAssetCollection, CompositeJob, Performer, PerformerAsset, PerformerOwnedAsset, PerformerOwnedAssetCollection, Scene, SceneAsset, SceneOwnedAsset, SceneOwnedAssetCollection, VideoComposition, VideoCompositionAsset, VideoCompositionCollection, VideoShot as VideoContent, VideoShot, VideoSequence, VideoSequenceAsset, VideoSequenceCollection, VideoShotAsset, VideoShotCharacter, VideoShotCharacterCollection, VideoShotCollection, VideoWorkflow, performer_assets_exports as n, persistMediaBundleInspection, scene_assets_exports as t };
1163
+
1164
+ //# sourceMappingURL=index.js.map