@cueframe/kernel 0.1.3 → 0.1.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.
Files changed (118) hide show
  1. package/dist/_members/authoring/agent/errors.d.ts +8 -0
  2. package/dist/_members/authoring/motion/materializeMotionPresetOps.d.ts +4 -0
  3. package/dist/_members/authoring/types.d.ts +1 -1
  4. package/dist/_members/cloud-import/CloudImportService.d.ts +3 -4
  5. package/dist/_members/cloud-import/ImportProvider.d.ts +3 -7
  6. package/dist/_members/cloud-import/cloudConfig.d.ts +0 -6
  7. package/dist/_members/cloud-import/index.d.ts +2 -4
  8. package/dist/_members/composition/graphics-plan/schemas.d.ts +20 -20
  9. package/dist/_members/composition/primitive-catalog/projection.d.ts +2 -1
  10. package/dist/_members/composition/projection/behind-readiness.d.ts +4 -2
  11. package/dist/_members/composition/validators/brandKit.d.ts +54 -94
  12. package/dist/_members/composition/validators/composePlan.d.ts +52 -52
  13. package/dist/_members/composition/validators/composition.d.ts +213 -253
  14. package/dist/_members/composition/validators/font.d.ts +2 -2
  15. package/dist/_members/composition/validators/index.d.ts +1 -0
  16. package/dist/_members/composition/validators/opaqueId.d.ts +13 -0
  17. package/dist/_members/composition/validators/project.d.ts +11 -15
  18. package/dist/_members/composition/validators/render.d.ts +372 -534
  19. package/dist/_members/composition/validators/session.d.ts +19 -39
  20. package/dist/_members/composition/validators/webhook.d.ts +8 -16
  21. package/dist/_members/composition-ops/index.d.ts +192 -228
  22. package/dist/_members/director/ai-sdk/messages.d.ts +2 -2
  23. package/dist/_members/director/domain/chat.d.ts +4 -4
  24. package/dist/_members/director/testing/contract.d.ts +1 -1
  25. package/dist/_members/errors/registry.d.ts +12 -0
  26. package/dist/_members/mcp/adapter.d.ts +19 -0
  27. package/dist/_members/mcp/curation.d.ts +4 -0
  28. package/dist/_members/mcp/generated/operations.d.ts +2 -2
  29. package/dist/_members/media-model/api.d.ts +53 -109
  30. package/dist/_members/media-model/generation.d.ts +2 -2
  31. package/dist/_members/media-model/index.d.ts +1 -0
  32. package/dist/_members/media-model/opaqueId.d.ts +10 -0
  33. package/dist/_members/render-harness/localRender.d.ts +3 -0
  34. package/dist/_members/render-harness/localRender.d.ts.map +1 -1
  35. package/dist/authoring/build-tools.js +6 -6
  36. package/dist/authoring/context.js +4 -4
  37. package/dist/authoring/tools.js +5 -5
  38. package/dist/authoring.js +39 -22
  39. package/dist/chunk-2SNY75AR.js +498 -0
  40. package/dist/{chunk-ZPRBGW4Y.js → chunk-7TQCR7AB.js} +1 -1
  41. package/dist/{chunk-SDCEJAO2.js → chunk-7V3F5HO4.js} +1 -1
  42. package/dist/{chunk-BZZTVOGG.js → chunk-D2EGO543.js} +5 -5
  43. package/dist/{chunk-TO4BFNLJ.js → chunk-D6S3ZKIY.js} +1 -1
  44. package/dist/{chunk-ICSZF37W.js → chunk-JRIPQ7DN.js} +1 -1
  45. package/dist/{chunk-TFGKUWHY.js → chunk-JTVFIN6H.js} +15 -19
  46. package/dist/{chunk-DCVJWGIA.js → chunk-JY26PIRP.js} +2 -2
  47. package/dist/{chunk-DWLNPNC4.js → chunk-LSP4HN5N.js} +1 -1
  48. package/dist/{chunk-DJW3UGBH.js → chunk-PJ4R4N4Q.js} +83 -9
  49. package/dist/{chunk-TXSFYUZH.js → chunk-QSDFTYKV.js} +1 -1
  50. package/dist/{chunk-AW57IWNW.js → chunk-R5BMJ2NX.js} +20 -1
  51. package/dist/{chunk-DL7WYISQ.js → chunk-RQ2G4DXI.js} +201 -223
  52. package/dist/{chunk-NQSMEUJ6.js → chunk-RXCEPCAQ.js} +102 -41
  53. package/dist/{chunk-TMB5AY6Q.js → chunk-TLVPDT4R.js} +1 -1
  54. package/dist/{chunk-GIA2SVVB.js → chunk-WTT3GGCA.js} +9 -4
  55. package/dist/{chunk-HBVAZXYO.js → chunk-YE3F4LNJ.js} +17 -17
  56. package/dist/{chunk-KFECIHED.js → chunk-YXEZ75MB.js} +5 -5
  57. package/dist/{chunk-TPA6PYN2.js → chunk-ZBRPF6GV.js} +25 -10
  58. package/dist/cloud-import.js +20 -116
  59. package/dist/compose/renderer.js +17 -17
  60. package/dist/compose.js +18 -18
  61. package/dist/composition/graphics-plan.js +1 -1
  62. package/dist/composition/ops.js +3 -3
  63. package/dist/composition/primitive-catalog.js +1 -1
  64. package/dist/composition/projection.js +2 -2
  65. package/dist/composition/validators.js +4 -2
  66. package/dist/composition-ops.js +6 -6
  67. package/dist/composition.js +6 -4
  68. package/dist/{context-JLLU3MYD.js → context-XWNT6QZH.js} +4 -4
  69. package/dist/core/render.js +3 -3
  70. package/dist/core/select.js +2 -2
  71. package/dist/core.js +3 -3
  72. package/dist/director/ai-sdk.js +3 -3
  73. package/dist/director/domain.js +2 -2
  74. package/dist/director.js +3 -3
  75. package/dist/errors.js +1 -1
  76. package/dist/mcp/adapter.js +18 -11
  77. package/dist/mcp/core.js +1 -1
  78. package/dist/mcp/curation.js +5 -1
  79. package/dist/mcp/server.js +4 -4
  80. package/dist/mcp.js +4 -4
  81. package/dist/media-model/media-kind.js +98 -9
  82. package/dist/media-model.js +83 -77
  83. package/dist/nle-export.js +18 -18
  84. package/dist/primitives/backgrounds.js +2 -2
  85. package/dist/primitives/captions.js +3 -3
  86. package/dist/primitives/effects.js +2 -2
  87. package/dist/primitives/hero-text.js +2 -2
  88. package/dist/primitives/layouts.js +2 -2
  89. package/dist/primitives/lib/index.js +12 -12
  90. package/dist/primitives/lib.js +12 -12
  91. package/dist/primitives/scenes.js +2 -2
  92. package/dist/primitives/text.js +2 -2
  93. package/dist/primitives/ui-blocks.js +2 -2
  94. package/dist/primitives.js +19 -19
  95. package/dist/render-harness.js +4 -2
  96. package/package.json +9 -34
  97. package/dist/_members/authoring/prompts/designReviewerPrompt.d.ts +0 -2
  98. package/dist/_members/cloud-import/MediaItemPreprocessor.d.ts +0 -18
  99. package/dist/_members/cloud-import/multipartUpload.d.ts +0 -12
  100. package/dist/_members/convex-api/api.d.ts +0 -5
  101. package/dist/_members/convex-api/api.generated.d.ts +0 -1444
  102. package/dist/_members/convex-api/dataModel.d.ts +0 -6
  103. package/dist/chunk-6IU2UQI5.js +0 -107
  104. package/dist/chunk-EP2Y6M2J.js +0 -64
  105. package/dist/chunk-WZH57M53.js +0 -494
  106. package/dist/cloud-import/multipart.d.ts +0 -1
  107. package/dist/cloud-import/multipart.js +0 -8
  108. package/dist/convex-api/dataModel.d.ts +0 -1
  109. package/dist/convex-api/dataModel.js +0 -0
  110. package/dist/convex-api.d.ts +0 -1
  111. package/dist/convex-api.js +0 -8
  112. package/dist/{chunk-RP4SXXLJ.js → chunk-3PM6VICZ.js} +3 -3
  113. package/dist/{chunk-UQSOS726.js → chunk-6ABIXGLO.js} +4 -4
  114. package/dist/{chunk-SAMQUUO5.js → chunk-BIBYZJL3.js} +3 -3
  115. package/dist/{chunk-GMD33ZD7.js → chunk-O7GNE4BQ.js} +3 -3
  116. package/dist/{chunk-BKHGL4MB.js → chunk-THJAY7QS.js} +4 -4
  117. package/dist/{chunk-DYZE7JZA.js → chunk-TMIBBD5E.js} +3 -3
  118. package/dist/{chunk-G5BFI32U.js → chunk-XATRRDVG.js} +3 -3
@@ -1,6 +0,0 @@
1
- import type { GenericId } from "convex/values";
2
- import type { SystemTableNames } from "convex/server";
3
- /** Table NAMES only — the vendored surface deliberately omits document
4
- * shapes (Doc/DataModel). Public consumers use exclusively `Id<...>`. */
5
- export type TableNames = "agentMessages" | "agentThreads" | "apiAuditLog" | "billingPlanState" | "brandKits" | "briefs" | "checkpoints" | "clips" | "clipSuggestionRuns" | "componentVersions" | "composeJobs" | "compositionEvents" | "compositionRuns" | "compositions" | "compositionVersions" | "contextFiles" | "conversations" | "corrections" | "critics" | "dashboardInsights" | "directorProfiles" | "directorWorkflows" | "enrichmentCandidates" | "exports" | "idempotencyKeys" | "installedComponents" | "jobs" | "markers" | "mediaFactRequests" | "mediaFacts" | "mediaItems" | "mediaUnderstanding" | "orgGatewayKeys" | "overlays" | "pricingPolicy" | "processingEvents" | "projects" | "providerStates" | "renderJobs" | "sightedJobSnapshots" | "resourceQueryCache" | "resourceRateBuckets" | "restorePoints" | "runs" | "searchQueries" | "sessions" | "sessionTokens" | "settings" | "socialAccounts" | "socialInsights" | "socialMediaItems" | "templateEmbeddings" | "templates" | "timelineClips" | "tracks" | "transcripts" | "uploadTokens" | "usageEvents" | "userSettings" | "videoChunkEmbeddings" | "webhookDeliveries" | "webhookProjectUpdateDebounce" | "webhooks" | "x402Payments";
6
- export type Id<TableName extends TableNames | SystemTableNames> = GenericId<TableName>;
@@ -1,107 +0,0 @@
1
- // ../data-models/media-model/src/media-kind.ts
2
- var IMAGE_CONTENT_TYPES = ["image/png", "image/jpeg", "image/webp"];
3
- var ALLOWED_CONTENT_TYPES = [
4
- "video/mp4",
5
- "video/quicktime",
6
- "video/x-matroska",
7
- "video/webm",
8
- "audio/mpeg",
9
- "audio/wav",
10
- "audio/x-wav",
11
- "audio/mp4",
12
- "audio/aac",
13
- "image/png",
14
- "image/jpeg",
15
- "image/webp",
16
- "image/gif",
17
- "image/svg+xml",
18
- "application/json",
19
- "font/ttf",
20
- "font/otf",
21
- "font/woff",
22
- "font/woff2"
23
- ];
24
- function mediaKind(contentType) {
25
- const ct = (contentType || "").toLowerCase();
26
- if (ct.startsWith("video/")) return "video";
27
- if (ct.startsWith("audio/")) return "audio";
28
- if (IMAGE_CONTENT_TYPES.includes(ct)) return "image";
29
- return "opaque";
30
- }
31
- var EXT = {
32
- "video/mp4": "mp4",
33
- "audio/mp4": "mp4",
34
- "video/quicktime": "mov",
35
- "video/x-matroska": "mkv",
36
- "video/webm": "webm",
37
- "video/x-msvideo": "avi",
38
- "audio/mpeg": "mp3",
39
- "audio/wav": "wav",
40
- "audio/x-wav": "wav",
41
- "audio/aac": "aac",
42
- "audio/ogg": "ogg",
43
- "audio/flac": "flac",
44
- "image/png": "png",
45
- "image/jpeg": "jpg",
46
- "image/webp": "webp",
47
- "font/ttf": "ttf",
48
- "font/otf": "otf",
49
- "font/woff": "woff",
50
- "font/woff2": "woff2",
51
- "application/json": "json",
52
- "image/svg+xml": "svg",
53
- "image/gif": "gif"
54
- };
55
- function extensionForContentType(contentType) {
56
- return EXT[(contentType || "").toLowerCase()] ?? "bin";
57
- }
58
- var CONTENT_TYPE_ALIASES = {
59
- "audio/mp3": "audio/mpeg",
60
- "audio/x-mp3": "audio/mpeg",
61
- "audio/x-mpeg": "audio/mpeg",
62
- "audio/mpeg3": "audio/mpeg",
63
- "audio/x-mpeg-3": "audio/mpeg",
64
- "audio/x-m4a": "audio/mp4",
65
- "audio/m4a": "audio/mp4",
66
- "audio/wave": "audio/wav",
67
- "audio/vnd.wave": "audio/wav",
68
- "audio/x-aac": "audio/aac",
69
- "image/jpg": "image/jpeg",
70
- "video/x-quicktime": "video/quicktime",
71
- "video/mov": "video/quicktime",
72
- "video/x-m4v": "video/mp4",
73
- "video/mkv": "video/x-matroska"
74
- };
75
- var TYPE_BY_EXTENSION = Object.entries(EXT).reduce(
76
- (acc, [contentType, ext]) => {
77
- if (!(ext in acc)) acc[ext] = contentType;
78
- return acc;
79
- },
80
- {}
81
- );
82
- TYPE_BY_EXTENSION["jpeg"] = "image/jpeg";
83
- TYPE_BY_EXTENSION["m4a"] = "audio/mp4";
84
- function mediaKindForFilename(filename) {
85
- return mediaKind(contentTypeForUpload(filename, null));
86
- }
87
- var POOL_EXTENSIONS = Object.entries(TYPE_BY_EXTENSION).filter(([, contentType]) => mediaKind(contentType) !== "opaque").map(([ext]) => ext);
88
- function contentTypeForUpload(filename, claimed) {
89
- const ct = (claimed ?? "").trim().toLowerCase();
90
- const allowed = ALLOWED_CONTENT_TYPES;
91
- if (ct && allowed.includes(ct)) return ct;
92
- if (ct && CONTENT_TYPE_ALIASES[ct]) return CONTENT_TYPE_ALIASES[ct];
93
- const ext = filename.toLowerCase().split(".").pop() ?? "";
94
- const byExt = TYPE_BY_EXTENSION[ext];
95
- if (byExt) return byExt;
96
- return ct;
97
- }
98
-
99
- export {
100
- IMAGE_CONTENT_TYPES,
101
- ALLOWED_CONTENT_TYPES,
102
- mediaKind,
103
- extensionForContentType,
104
- mediaKindForFilename,
105
- POOL_EXTENSIONS,
106
- contentTypeForUpload
107
- };
@@ -1,64 +0,0 @@
1
- import {
2
- contentTypeForUpload
3
- } from "./chunk-6IU2UQI5.js";
4
-
5
- // ../cloud-import/src/multipartUpload.ts
6
- var CHUNK_SIZE = 10 * 1024 * 1024;
7
- async function reasonFrom(res) {
8
- try {
9
- const text = await res.text();
10
- if (!text) return `HTTP ${res.status}`;
11
- try {
12
- const parsed = JSON.parse(text);
13
- if (typeof parsed.error === "string" && parsed.error) return `${parsed.error} (HTTP ${res.status})`;
14
- } catch {
15
- }
16
- return `${text.slice(0, 200)} (HTTP ${res.status})`;
17
- } catch {
18
- return `HTTP ${res.status}`;
19
- }
20
- }
21
- async function multipartUpload(opts) {
22
- const { file, signingUrl, token, metadata, onProgress } = opts;
23
- const baseUrl = signingUrl.replace(/\/$/, "");
24
- const headers = { "uppy-auth-token": token, "Content-Type": "application/json" };
25
- const createRes = await fetch(`${baseUrl}/s3/multipart`, {
26
- method: "POST",
27
- headers,
28
- body: JSON.stringify({
29
- filename: file.name,
30
- type: contentTypeForUpload(file.name, file.type),
31
- metadata: { uploadToken: token, ...metadata }
32
- })
33
- });
34
- if (!createRes.ok) throw new Error(`Upload init failed for ${file.name}: ${await reasonFrom(createRes)}`);
35
- const { uploadId } = await createRes.json();
36
- const totalParts = Math.ceil(file.size / CHUNK_SIZE);
37
- const parts = [];
38
- for (let i = 0; i < totalParts; i++) {
39
- const start = i * CHUNK_SIZE;
40
- const end = Math.min(start + CHUNK_SIZE, file.size);
41
- const chunk = file.slice(start, end);
42
- const partNumber = i + 1;
43
- const urlRes = await fetch(`${baseUrl}/s3/multipart/${uploadId}/${partNumber}`, {
44
- headers: { "uppy-auth-token": token }
45
- });
46
- if (!urlRes.ok) throw new Error(`Presign failed for ${file.name} part ${partNumber}: ${await reasonFrom(urlRes)}`);
47
- const { url } = await urlRes.json();
48
- const putRes = await fetch(url, { method: "PUT", body: chunk });
49
- if (!putRes.ok) throw new Error(`Part ${partNumber} of ${file.name} failed: ${await reasonFrom(putRes)}`);
50
- parts.push({ PartNumber: partNumber, ETag: putRes.headers.get("ETag") ?? "" });
51
- onProgress?.(end / file.size);
52
- }
53
- const completeRes = await fetch(`${baseUrl}/s3/multipart/${uploadId}/complete`, {
54
- method: "POST",
55
- headers,
56
- body: JSON.stringify({ parts })
57
- });
58
- if (!completeRes.ok) throw new Error(`Complete failed for ${file.name}: ${await reasonFrom(completeRes)}`);
59
- return await completeRes.json();
60
- }
61
-
62
- export {
63
- multipartUpload
64
- };
@@ -1,494 +0,0 @@
1
- import {
2
- Reframe
3
- } from "./chunk-2B5VJZHL.js";
4
-
5
- // ../composition/src/validators/composition.ts
6
- import { z } from "zod";
7
- import { zid } from "convex-helpers/server/zod3";
8
- var Format = z.object({
9
- aspectRatio: z.enum(["16:9", "9:16", "1:1", "4:5"]),
10
- fps: z.union([z.literal(24), z.literal(30), z.literal(60)]).optional(),
11
- resolution: z.enum(["hd", "fhd", "4k"]).optional(),
12
- platform: z.string().optional()
13
- });
14
- var Trim = z.object({
15
- start: z.number().nonnegative(),
16
- end: z.number().nonnegative()
17
- });
18
- var ExcludedRange = z.object({
19
- start: z.number().nonnegative(),
20
- end: z.number().nonnegative(),
21
- reason: z.string().optional()
22
- });
23
- var MediaClipSource = z.object({
24
- kind: z.literal("media"),
25
- mediaId: zid("mediaItems"),
26
- trim: Trim.optional(),
27
- excludedRanges: z.array(ExcludedRange).optional(),
28
- volume: z.number().min(0).max(4).optional(),
29
- muted: z.boolean().optional(),
30
- playbackRate: z.number().positive().optional(),
31
- sync: z.enum(["video", "independent"]).optional(),
32
- kenBurns: z.enum(["in", "out", "pan-l", "pan-r", "none"]).optional(),
33
- volumeDb: z.number().optional(),
34
- fadeInMs: z.number().nonnegative().optional(),
35
- fadeOutMs: z.number().nonnegative().optional(),
36
- loop: z.boolean().optional(),
37
- audioRole: z.enum(["sfx", "music", "vo", "ambience"]).optional(),
38
- duck: z.object({
39
- duckDb: z.number().max(0),
40
- attackMs: z.number().nonnegative(),
41
- releaseMs: z.number().nonnegative(),
42
- windows: z.array(z.object({ startMs: z.number(), endMs: z.number() })).optional()
43
- }).optional(),
44
- anchor: z.object({
45
- clipId: z.string().min(1),
46
- offsetMs: z.number()
47
- }).optional(),
48
- reframe: Reframe.optional()
49
- });
50
- var ComponentClipSource = z.object({
51
- kind: z.literal("component"),
52
- componentId: z.string().min(1),
53
- props: z.record(z.string(), z.unknown()),
54
- zPlane: z.enum(["front", "behind-subject"]).optional()
55
- });
56
- var OverlayClipSource = z.object({
57
- kind: z.literal("overlay"),
58
- primitiveId: z.string().min(1),
59
- params: z.record(z.string(), z.unknown()),
60
- zPlane: z.enum(["front", "behind-subject"]).optional(),
61
- anchor: z.object({ space: z.literal("scene"), x: z.number().min(0).max(1), y: z.number().min(0).max(1) }).optional(),
62
- parallax: z.number().min(-0.3).max(0.3).optional()
63
- });
64
- var EffectClipSource = z.object({
65
- kind: z.literal("effect"),
66
- primitiveId: z.string().min(1),
67
- params: z.record(z.string(), z.unknown()).optional()
68
- });
69
- var AlphaLayerClipSource = z.object({
70
- kind: z.literal("alpha-layer"),
71
- componentId: z.string().min(1),
72
- props: z.record(z.string(), z.unknown()),
73
- zPlane: z.enum(["front", "behind-subject"]).optional()
74
- });
75
- var CardClipSource = z.object({
76
- kind: z.literal("card"),
77
- html: z.string().min(1),
78
- tokens: z.record(z.string(), z.string()).optional(),
79
- zPlane: z.literal("front").optional()
80
- });
81
- var CompositionClipSource = z.object({
82
- kind: z.literal("composition"),
83
- compositionId: z.string().min(1),
84
- trim: Trim.optional()
85
- }).strict();
86
- var ClipSource = z.discriminatedUnion("kind", [
87
- MediaClipSource,
88
- ComponentClipSource,
89
- OverlayClipSource,
90
- EffectClipSource,
91
- AlphaLayerClipSource,
92
- CardClipSource,
93
- CompositionClipSource
94
- ]);
95
- var Transition = z.object({
96
- type: z.string().min(1),
97
- duration: z.number().positive()
98
- });
99
- var Position = z.object({
100
- x: z.number(),
101
- y: z.number()
102
- });
103
- var Region = z.object({
104
- x: z.number().min(0).max(1),
105
- y: z.number().min(0).max(1),
106
- w: z.number().positive().max(1),
107
- h: z.number().positive().max(1)
108
- });
109
- var ClipFit = z.enum(["cover", "contain"]);
110
- var PerClipEffect = z.object({
111
- primitiveId: z.string().min(1),
112
- params: z.record(z.string(), z.unknown()).optional()
113
- });
114
- var KeyframeEasing = z.union([
115
- z.enum(["linear", "ease", "easeIn", "easeOut", "easeInOut"]),
116
- z.object({ cubicBezier: z.tuple([z.number(), z.number(), z.number(), z.number()]) }).strict()
117
- ]);
118
- var Keyframe = z.object({
119
- time: z.number().nonnegative(),
120
- value: z.number(),
121
- easing: KeyframeEasing.optional()
122
- }).strict();
123
- var KeyframeChannel = z.array(Keyframe).min(2);
124
- var ANIMATABLE_PARAMS = [
125
- "opacity",
126
- "scale",
127
- "rotation",
128
- "position.x",
129
- "position.y",
130
- "volume"
131
- ];
132
- var TimelineClip = z.object({
133
- id: z.string().min(1),
134
- startTime: z.number().nonnegative(),
135
- duration: z.number().positive(),
136
- source: ClipSource,
137
- kind: z.enum(["video", "audio", "image", "overlay", "effect"]).optional(),
138
- opacity: z.number().min(0).max(1).optional(),
139
- scale: z.number().positive().optional(),
140
- rotation: z.number().optional(),
141
- position: Position.optional(),
142
- region: Region.optional(),
143
- fit: ClipFit.optional(),
144
- effects: z.array(PerClipEffect).optional(),
145
- transitionIn: Transition.optional(),
146
- linkGroupId: z.string().min(1).optional(),
147
- animate: z.record(z.string(), KeyframeChannel).superRefine((channels, ctx) => {
148
- for (const key of Object.keys(channels)) {
149
- if (!ANIMATABLE_PARAMS.includes(key)) {
150
- ctx.addIssue({
151
- code: z.ZodIssueCode.custom,
152
- path: [key],
153
- message: `"${key}" is not an animatable param (${ANIMATABLE_PARAMS.join(", ")})`
154
- });
155
- }
156
- }
157
- }).optional()
158
- }).strict();
159
- var Gap = z.object({
160
- id: z.string().min(1),
161
- startTime: z.number().nonnegative(),
162
- duration: z.number().positive()
163
- }).strict();
164
- var TrackContent = z.unknown().transform((val, ctx) => {
165
- const hasSource = !!val && typeof val === "object" && "source" in val;
166
- const res = (hasSource ? TimelineClip : Gap).safeParse(val);
167
- if (!res.success) {
168
- for (const issue of res.error.issues) ctx.addIssue(issue);
169
- return z.NEVER;
170
- }
171
- return res.data;
172
- });
173
- var Track = z.object({
174
- id: z.string().min(1),
175
- kind: z.enum(["video", "audio", "image", "overlay", "effect"]),
176
- name: z.string().optional(),
177
- enabled: z.boolean().optional(),
178
- volume: z.number().min(0).max(4).optional(),
179
- contents: z.array(TrackContent)
180
- }).strict();
181
- var Marker = z.object({
182
- id: z.string().min(1),
183
- startTime: z.number().nonnegative(),
184
- endTime: z.number().nonnegative().optional(),
185
- kind: z.string().min(1),
186
- name: z.string().optional(),
187
- metadata: z.record(z.string(), z.unknown()).optional()
188
- }).strict();
189
- var AccessControl = z.object({
190
- public: z.boolean().optional(),
191
- readerOrgIds: z.array(z.string()).optional(),
192
- writerOrgIds: z.array(z.string()).optional()
193
- });
194
- var LicenseDeclaration = z.object({
195
- type: z.string().min(1),
196
- source: z.string().optional(),
197
- notes: z.string().optional()
198
- });
199
- var CompositionAccessibility = z.object({
200
- audioDescriptionTrackId: z.string().optional(),
201
- captionsTrackId: z.string().optional(),
202
- signLanguageTrackId: z.string().optional(),
203
- notes: z.string().optional()
204
- });
205
- var CaptionWord = z.object({
206
- text: z.string().min(1),
207
- startMs: z.number().nonnegative(),
208
- endMs: z.number().nonnegative(),
209
- emphasis: z.boolean().optional(),
210
- annotate: z.enum(["circle", "underline"]).optional()
211
- });
212
- var CaptionStyle = z.object({
213
- fontFamily: z.string().min(1).optional(),
214
- fontSize: z.number().min(1, "captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").max(15, "captions style.fontSize is PERCENT of composition height (1-15, default 5) \u2014 px values are not accepted").optional().describe("Font size as % of composition height (1-15, default 5). NOT px."),
215
- fontWeight: z.number().int().min(100).max(900).optional(),
216
- color: z.string().min(1).optional(),
217
- highlightColor: z.string().min(1).optional(),
218
- backgroundColor: z.string().optional(),
219
- plate: z.enum(["glass", "solid", "none"]).optional(),
220
- position: z.enum(["top", "center", "bottom"]).optional(),
221
- textTransform: z.enum(["none", "uppercase", "capitalize"]).optional(),
222
- emphasisColor: z.string().optional(),
223
- emphasisGradient: z.string().optional(),
224
- emphasisScale: z.number().positive().optional(),
225
- emphasisFontFamily: z.string().optional(),
226
- emphasisFontWeight: z.number().int().min(100).max(900).optional(),
227
- emphasisTextTransform: z.enum(["none", "uppercase", "capitalize"]).optional(),
228
- emphasisLetterSpacing: z.number().optional(),
229
- emphasisFontStyle: z.enum(["normal", "italic"]).optional(),
230
- entrance: z.enum(["none", "fade", "word-pop", "stagger-up"]).optional(),
231
- entranceMs: z.number().nonnegative().optional(),
232
- entranceStaggerMs: z.number().nonnegative().optional(),
233
- exitMs: z.number().nonnegative().optional(),
234
- emphasisPlate: z.boolean().optional(),
235
- emphasisPlateColor: z.string().optional(),
236
- emphasisPlateTextColor: z.string().optional(),
237
- emphasisPlateAltColor: z.string().optional(),
238
- emphasisPlateAltTextColor: z.string().optional(),
239
- emphasisPlateRadius: z.number().nonnegative().optional(),
240
- emphasisPlatePadX: z.number().optional(),
241
- emphasisPlatePadY: z.number().optional(),
242
- annotationColor: z.string().optional(),
243
- maxWidthPercent: z.number().positive().max(100, "captions style.maxWidthPercent is % of composition width (max 100)").optional()
244
- });
245
- var CaptionSegment = z.object({
246
- words: z.array(CaptionWord)
247
- });
248
- var CaptionDepth = z.enum(["front", "behind-subject"]).optional();
249
- var CompositionCaptions = z.discriminatedUnion("source", [
250
- z.object({
251
- source: z.literal("derived"),
252
- from: z.object({ clipId: z.string() }),
253
- segments: z.array(CaptionSegment),
254
- style: CaptionStyle.optional(),
255
- zPlane: CaptionDepth
256
- }),
257
- z.object({
258
- source: z.literal("authored"),
259
- segments: z.array(CaptionSegment),
260
- style: CaptionStyle.optional(),
261
- zPlane: CaptionDepth
262
- })
263
- ]);
264
- function captionsAreBehindSubject(captions) {
265
- return captions?.zPlane === "behind-subject";
266
- }
267
- function captionWords(c) {
268
- return c.segments.flatMap((s) => s.words);
269
- }
270
- var Composition = z.object({
271
- v: z.literal(1, {
272
- errorMap: (_issue, ctx) => ctx.data === void 0 ? { message: 'Missing version envelope: add top-level "v": 1 to the composition.' } : { message: `Invalid version envelope: top-level "v" must be the literal 1 (got ${JSON.stringify(ctx.data)}).` }
273
- }),
274
- format: Format,
275
- tracks: z.array(Track),
276
- markers: z.array(Marker).optional(),
277
- captions: CompositionCaptions.optional(),
278
- sourceSuggestionId: z.string().optional(),
279
- license: LicenseDeclaration.optional(),
280
- licenseVerification: z.enum([
281
- "attested",
282
- "cueframe-verified",
283
- "third-party-verified"
284
- ]).optional(),
285
- accessibility: CompositionAccessibility.optional(),
286
- ownerOrgId: z.string().optional(),
287
- acl: AccessControl.optional()
288
- }).strict();
289
- var CompositionAuthorKind = z.enum(["user", "agent", "import"]);
290
- var CompositionVersion = z.object({
291
- id: z.string().min(1),
292
- compositionId: zid("compositions"),
293
- predecessorId: z.string().optional(),
294
- createdAt: z.number(),
295
- // epoch ms — see CONVEX_ADAPTATIONS.md
296
- etag: z.string().min(1),
297
- authorKind: CompositionAuthorKind,
298
- // load-bearing for multi-agent lineage
299
- authorId: z.string().optional(),
300
- // userId for 'user', agentId for 'agent', source for 'import'
301
- composition: Composition
302
- });
303
-
304
- // ../composition/src/graphics-plan/schemas.ts
305
- import { z as z2 } from "zod";
306
- var GRAPHICS_PLAN_VERSION = "gp-1";
307
- var Version = z2.literal(GRAPHICS_PLAN_VERSION);
308
- var PlanRect = Region;
309
- var GraphicRole = z2.enum([
310
- "title-card",
311
- // topic-setter / opener card
312
- "stat",
313
- // a single headline number + label
314
- "lower-third",
315
- // name/title tag over the speaker
316
- "pull-quote",
317
- // a short quoted line
318
- "hero",
319
- // big behind-subject phrase (zPlane: behind-subject)
320
- "logo-tag",
321
- // small brand mark / watermark beat
322
- "enumeration",
323
- "sequence",
324
- // an ordered chain of steps — often the POINT is that it is too long
325
- "comparison"
326
- // labelled values set against each other (a benchmark, a before/after)
327
- ]);
328
- var Copy = z2.object({
329
- headline: z2.string().max(120).optional(),
330
- sub: z2.string().max(200).optional(),
331
- value: z2.string().max(40).optional(),
332
- label: z2.string().max(80).optional(),
333
- items: z2.array(z2.string().max(80)).max(8).optional(),
334
- series: z2.array(z2.object({ label: z2.string().max(40), value: z2.string().max(16) })).max(8).optional()
335
- }).strict();
336
- var ContentBeat = z2.object({
337
- id: z2.string().min(1),
338
- atSec: z2.number().min(0),
339
- durSec: z2.number().positive(),
340
- role: GraphicRole,
341
- copy: Copy,
342
- intent: z2.string().min(1).max(400),
343
- priority: z2.number().int().min(0).max(10).default(5)
344
- }).strict();
345
- var ContentPlan = z2.object({
346
- version: Version,
347
- beats: z2.array(ContentBeat)
348
- }).strict();
349
- var ElementRole = z2.enum([
350
- "headline",
351
- // primary large text
352
- "value",
353
- // the stat number / the one word to remember
354
- "label",
355
- // supporting text
356
- "sublabel",
357
- // secondary supporting text
358
- "logo",
359
- // brand mark
360
- "accent-shape",
361
- // decorative block/line/underline
362
- "backdrop"
363
- // solid fill (takeover cards only)
364
- ]);
365
- var StyleRole = z2.enum([
366
- "heading",
367
- "body",
368
- "accent",
369
- "surface",
370
- "on-accent",
371
- "on-surface"
372
- ]);
373
- var ZPlane = z2.enum(["front", "behind-subject"]);
374
- var LayoutElement = z2.object({
375
- elId: z2.string().min(1),
376
- role: ElementRole,
377
- box: PlanRect,
378
- styleRole: StyleRole,
379
- z: ZPlane.default("front"),
380
- text: z2.string().max(200).optional(),
381
- typeScaleStep: z2.number().int().min(0).max(8).optional()
382
- }).strict();
383
- var EPS = 1e-6;
384
- var rectsOverlapEps = (a, b) => a.x < b.x + b.w - EPS && a.x + a.w > b.x + EPS && a.y < b.y + b.h - EPS && a.y + a.h > b.y + EPS;
385
- var LayoutPlan = z2.object({
386
- version: Version,
387
- beatId: z2.string().min(1),
388
- frame: z2.object({ w: z2.number().positive(), h: z2.number().positive() }).strict(),
389
- keepOut: z2.array(PlanRect),
390
- safe: z2.object({
391
- titleSafe: z2.number().min(0).max(1),
392
- actionSafe: z2.number().min(0).max(1)
393
- }).strict(),
394
- elements: z2.array(LayoutElement),
395
- dropped: z2.object({ reason: z2.string().min(1) }).strict().optional()
396
- }).strict().superRefine((plan, ctx) => {
397
- for (const el of plan.elements) {
398
- if (el.z === "behind-subject") continue;
399
- const b = el.box;
400
- if (b.x + b.w > 1 + EPS || b.y + b.h > 1 + EPS) {
401
- ctx.addIssue({ code: z2.ZodIssueCode.custom, message: `element ${el.elId} box spills past the frame`, path: ["elements"] });
402
- }
403
- for (const ko of plan.keepOut) {
404
- if (rectsOverlapEps(b, ko)) {
405
- ctx.addIssue({ code: z2.ZodIssueCode.custom, message: `element ${el.elId} overlaps a face keep-out (text on the speaker)`, path: ["elements"] });
406
- }
407
- }
408
- }
409
- });
410
- var EnterType = z2.enum(["reveal", "fade", "rise", "count-up", "wipe"]);
411
- var EmphasisType = z2.enum(["pulse", "underline", "color-shift"]);
412
- var ExitType = z2.enum(["fade", "fall", "wipe", "cut"]);
413
- var Ease = z2.enum(["spring", "ease-out", "ease-in-out", "linear"]);
414
- var EnterMotion = z2.object({
415
- type: EnterType,
416
- atMs: z2.number().min(0),
417
- durMs: z2.number().positive(),
418
- ease: Ease.default("spring"),
419
- stagger: z2.number().min(0).optional()
420
- }).strict();
421
- var EmphasisMotion = z2.object({ type: EmphasisType, atMs: z2.number().min(0), durMs: z2.number().positive() }).strict();
422
- var ExitMotion = z2.object({ type: ExitType, atMs: z2.number().min(0), durMs: z2.number().positive() }).strict();
423
- var MotionElement = z2.object({
424
- elId: z2.string().min(1),
425
- enter: EnterMotion,
426
- emphasis: EmphasisMotion.optional(),
427
- exit: ExitMotion.optional()
428
- }).strict();
429
- var MotionPlan = z2.object({
430
- version: Version,
431
- beatId: z2.string().min(1),
432
- elements: z2.array(MotionElement)
433
- }).strict();
434
- var GraphicsPlan = z2.object({
435
- version: Version,
436
- content: ContentPlan,
437
- layouts: z2.array(LayoutPlan),
438
- motions: z2.array(MotionPlan)
439
- }).strict();
440
-
441
- export {
442
- Format,
443
- MediaClipSource,
444
- ComponentClipSource,
445
- OverlayClipSource,
446
- EffectClipSource,
447
- AlphaLayerClipSource,
448
- CardClipSource,
449
- CompositionClipSource,
450
- ClipSource,
451
- Transition,
452
- Region,
453
- ClipFit,
454
- PerClipEffect,
455
- KeyframeEasing,
456
- Keyframe,
457
- KeyframeChannel,
458
- ANIMATABLE_PARAMS,
459
- TimelineClip,
460
- Gap,
461
- TrackContent,
462
- Track,
463
- Marker,
464
- CaptionWord,
465
- CaptionStyle,
466
- CaptionSegment,
467
- CompositionCaptions,
468
- captionsAreBehindSubject,
469
- captionWords,
470
- Composition,
471
- CompositionAuthorKind,
472
- CompositionVersion,
473
- GRAPHICS_PLAN_VERSION,
474
- PlanRect,
475
- GraphicRole,
476
- Copy,
477
- ContentBeat,
478
- ContentPlan,
479
- ElementRole,
480
- StyleRole,
481
- ZPlane,
482
- LayoutElement,
483
- LayoutPlan,
484
- EnterType,
485
- EmphasisType,
486
- ExitType,
487
- Ease,
488
- EnterMotion,
489
- EmphasisMotion,
490
- ExitMotion,
491
- MotionElement,
492
- MotionPlan,
493
- GraphicsPlan
494
- };
@@ -1 +0,0 @@
1
- export * from "../_members/cloud-import/multipartUpload.js";
@@ -1,8 +0,0 @@
1
- import {
2
- multipartUpload
3
- } from "../chunk-EP2Y6M2J.js";
4
- import "../chunk-6IU2UQI5.js";
5
- import "../chunk-2ESYSVXG.js";
6
- export {
7
- multipartUpload
8
- };
@@ -1 +0,0 @@
1
- export * from "../_members/convex-api/dataModel.js";
File without changes
@@ -1 +0,0 @@
1
- export * from "./_members/convex-api/api.js";