@mevdragon/vidfarm-devcli 0.5.2 → 0.6.0
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/README.md +3 -3
- package/demo/README.md +28 -0
- package/demo/dist/app.css +1 -0
- package/demo/dist/app.js +1184 -0
- package/demo/dist/chunks/chunk-DXB73IDG.js +1 -0
- package/demo/dist/chunks/chunk-S7OWAJDS.js +36 -0
- package/demo/dist/chunks/chunk-VTIBZ6AN.js +1 -0
- package/demo/dist/chunks/dist-ADSJKBVE.js +332 -0
- package/demo/dist/chunks/domEditingLayers-VZMLL4AP-SGHWPND4.js +1 -0
- package/demo/dist/chunks/hyperframes-player-XB65TCD6.js +425 -0
- package/demo/dist/chunks/lib-XAQ37YOE.js +1 -0
- package/demo/dist/chunks/src-TJ2QYA4U.js +207 -0
- package/demo/dist/favicon.ico +0 -0
- package/demo/dist/icons/timeline/audio.svg +7 -0
- package/demo/dist/icons/timeline/captions.svg +5 -0
- package/demo/dist/icons/timeline/composition.svg +12 -0
- package/demo/dist/icons/timeline/image.svg +18 -0
- package/demo/dist/icons/timeline/music.svg +10 -0
- package/demo/dist/icons/timeline/text.svg +3 -0
- package/demo/dist/index.html +15 -0
- package/dist/src/account-pages-legacy.js +9396 -0
- package/dist/src/account-pages.js +61 -0
- package/dist/src/app.js +14378 -0
- package/dist/src/cli.js +1 -1
- package/dist/src/composition-runtime.js +613 -0
- package/dist/src/config.js +166 -0
- package/dist/src/context.js +447 -0
- package/dist/src/dev-app-legacy.js +739 -0
- package/dist/src/dev-app.js +6 -0
- package/dist/src/domain.js +2 -0
- package/dist/src/editor-chat-history.js +82 -0
- package/dist/src/editor-chat.js +449 -0
- package/dist/src/editor-dark-theme.js +1128 -0
- package/dist/src/frontend/debug.js +71 -0
- package/dist/src/frontend/flockposter-cache-store.js +124 -0
- package/dist/src/frontend/homepage-client.js +182 -0
- package/dist/src/frontend/homepage-shared.js +4 -0
- package/dist/src/frontend/homepage-store.js +28 -0
- package/dist/src/frontend/homepage-view.js +547 -0
- package/dist/src/frontend/page-runtime-client.js +132 -0
- package/dist/src/frontend/page-runtime-store.js +9 -0
- package/dist/src/frontend/sentry.js +42 -0
- package/dist/src/frontend/template-editor-chat.js +3960 -0
- package/dist/src/help-page.js +346 -0
- package/dist/src/homepage.js +1235 -0
- package/dist/src/hyperframes/composition.js +180 -0
- package/dist/src/index.js +16 -0
- package/dist/src/instrument.js +30 -0
- package/dist/src/lib/crypto.js +45 -0
- package/dist/src/lib/dev-log.js +54 -0
- package/dist/src/lib/display-name.js +11 -0
- package/dist/src/lib/ids.js +24 -0
- package/dist/src/lib/images.js +19 -0
- package/dist/src/lib/json.js +15 -0
- package/dist/src/lib/package-root.js +47 -0
- package/dist/src/lib/template-paths.js +28 -0
- package/dist/src/lib/time.js +7 -0
- package/dist/src/lib/url-clean.js +85 -0
- package/dist/src/page-runtime.js +2 -0
- package/dist/src/page-shell.js +1381 -0
- package/dist/src/primitive-context.js +357 -0
- package/dist/src/primitive-registry.js +2436 -0
- package/dist/src/primitive-sdk.js +4 -0
- package/dist/src/primitives/hyperframes-media.js +108 -0
- package/dist/src/react-page-shell.js +35 -0
- package/dist/src/ready-post-schedule-component.js +1540 -0
- package/dist/src/registry.js +296 -0
- package/dist/src/runtime.js +35 -0
- package/dist/src/services/api-call-history.js +249 -0
- package/dist/src/services/auth.js +152 -0
- package/dist/src/services/billing-pricing.js +39 -0
- package/dist/src/services/billing.js +228 -0
- package/dist/src/services/cast.js +127 -0
- package/dist/src/services/chat-threads.js +92 -0
- package/dist/src/services/composition-sanitize.js +124 -0
- package/dist/src/services/composition-watch.js +79 -0
- package/dist/src/services/fork-access.js +93 -0
- package/dist/src/services/fork-manifest.js +42 -0
- package/dist/src/services/ghostcut.js +179 -0
- package/dist/src/services/hyperframes.js +2307 -0
- package/dist/src/services/job-capacity.js +14 -0
- package/dist/src/services/job-logs.js +197 -0
- package/dist/src/services/jobs.js +136 -0
- package/dist/src/services/local-dynamo.js +0 -0
- package/dist/src/services/media-processing.js +766 -0
- package/dist/src/services/primitive-media-lambda.js +280 -0
- package/dist/src/services/providers.js +2926 -0
- package/dist/src/services/rate-limits.js +262 -0
- package/dist/src/services/serverless-auth.js +382 -0
- package/dist/src/services/serverless-jobs.js +1082 -0
- package/dist/src/services/serverless-provider-keys.js +409 -0
- package/dist/src/services/serverless-records.js +1385 -0
- package/dist/src/services/serverless-template-configs.js +75 -0
- package/dist/src/services/storage.js +383 -0
- package/dist/src/services/template-certification.js +413 -0
- package/dist/src/services/template-loader.js +99 -0
- package/dist/src/services/template-runtime-bundles.js +217 -0
- package/dist/src/services/template-sources.js +1017 -0
- package/dist/src/services/video-normalization.js +2 -0
- package/dist/src/services/webhooks.js +62 -0
- package/dist/src/template-editor-pages.js +2576 -0
- package/dist/src/template-editor-shell.js +2840 -0
- package/dist/src/template-sdk.js +4 -0
- package/dist/src/worker.js +17 -0
- package/package.json +6 -4
- package/public/assets/homepage-app.js +54 -0
- package/public/assets/homepage-client-app.js +80 -0
- package/public/assets/page-runtime-client-app.js +94 -0
- package/src/assets/SELLING_AWARENESS_STAGES.md +579 -0
- package/src/assets/SELLING_WITH_HOOKS.md +377 -0
- package/src/assets/SELLING_WITH_VSLS.md +606 -0
- package/src/assets/favicon.ico +0 -0
- package/src/assets/logo-vidfarm.png +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// HyperFrames composition builders for the media primitives that used to render
|
|
2
|
+
// on Remotion (html-image.tsx, media-dedupe.tsx). Each function emits a
|
|
3
|
+
// self-contained composition HTML document that the in-process HyperFrames
|
|
4
|
+
// renderer (HyperframesService.renderStill / render) turns into a still or MP4.
|
|
5
|
+
// The DOM/CSS mirrors the original Remotion components 1:1 so output matches.
|
|
6
|
+
// Matches DEFAULT_EFFECTS in the old media-dedupe.tsx.
|
|
7
|
+
export const DEDUPE_DEFAULT_EFFECTS = {
|
|
8
|
+
zoom: 1.04,
|
|
9
|
+
tilt: 3,
|
|
10
|
+
rotate: 3,
|
|
11
|
+
saturation: 1.05,
|
|
12
|
+
speed: 1.05,
|
|
13
|
+
horizontal_flip: false,
|
|
14
|
+
contrast: 1.05,
|
|
15
|
+
brightness: 1.05,
|
|
16
|
+
hue_rotate: 0,
|
|
17
|
+
blur: 0
|
|
18
|
+
};
|
|
19
|
+
// Arbitrary HTML + CSS rendered as a single-frame still. `html`/`css` are the
|
|
20
|
+
// primitive's intended payload (the same trust model as the old Remotion
|
|
21
|
+
// dangerouslySetInnerHTML) so they are injected verbatim; only the wrapper
|
|
22
|
+
// colors/dimensions are sanitized.
|
|
23
|
+
export function buildHtmlImageCompositionHtml(input) {
|
|
24
|
+
const bg = safeCssColor(input.backgroundColor, "#ffffff");
|
|
25
|
+
return `<!doctype html>
|
|
26
|
+
<html>
|
|
27
|
+
<head><meta charset="UTF-8" />
|
|
28
|
+
<style>
|
|
29
|
+
html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:${bg};font-family:Arial,sans-serif}
|
|
30
|
+
[data-composition-id]{position:relative;width:100vw;height:100vh;overflow:hidden;background:${bg}}
|
|
31
|
+
${input.css ?? ""}
|
|
32
|
+
</style>
|
|
33
|
+
</head>
|
|
34
|
+
<body>
|
|
35
|
+
<div data-composition-id="${escapeAttr(input.compositionId)}" data-width="${intAttr(input.width, 1080)}" data-height="${intAttr(input.height, 1920)}" data-duration="0.1">
|
|
36
|
+
<div data-hf-id="html-image-content" data-layer-kind="html" data-layer-mode="both" data-start="0" data-duration="0.1" data-track-index="0" style="position:absolute;left:0;top:0;width:100%;height:100%">${input.html}</div>
|
|
37
|
+
</div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>`;
|
|
40
|
+
}
|
|
41
|
+
// Source image/video with dedupe transforms (zoom/tilt/rotate/flip) + CSS filter
|
|
42
|
+
// (saturation/contrast/brightness/hue/blur) + a tint overlay — the exact DOM the
|
|
43
|
+
// old media-dedupe.tsx produced. `durationSeconds` is the OUTPUT duration; the
|
|
44
|
+
// caller pre-divides by `speed` so the frame count matches the old behavior (the
|
|
45
|
+
// per-clip playbackRate remap has no static-HTML equivalent, so speed manifests
|
|
46
|
+
// as a shorter clip at 1x source sampling — acceptable for a dedupe perturbation).
|
|
47
|
+
export function buildMediaDedupeCompositionHtml(input) {
|
|
48
|
+
const e = { ...DEDUPE_DEFAULT_EFFECTS, ...(input.effects ?? {}) };
|
|
49
|
+
const horizontalScale = e.horizontal_flip ? -1 : 1;
|
|
50
|
+
const transform = `scale(${num(e.zoom)}) rotate(${num(e.rotate)}deg) rotateX(${num(e.tilt)}deg) scaleX(${horizontalScale})`;
|
|
51
|
+
const filter = `saturate(${num(e.saturation)}) contrast(${num(e.contrast)}) brightness(${num(e.brightness)}) hue-rotate(${num(e.hue_rotate)}deg) blur(${num(e.blur)}px)`;
|
|
52
|
+
const tint = hexToRgba(input.tintColor, input.tintOpacity);
|
|
53
|
+
const bg = safeCssColor(input.backgroundColor, "#000000");
|
|
54
|
+
const objectFit = safeCssToken(input.objectFit, "cover");
|
|
55
|
+
const objectPosition = safeCssToken(input.objectPosition, "center center");
|
|
56
|
+
const dur = Math.max(0.05, input.durationSeconds);
|
|
57
|
+
const mediaStyle = `position:absolute;left:0;top:0;width:100%;height:100%;object-fit:${objectFit};object-position:${objectPosition};display:block`;
|
|
58
|
+
const mediaEl = input.mediaType === "video"
|
|
59
|
+
? `<video data-hf-id="dedupe-media" data-layer-kind="video" data-layer-mode="both" data-start="0" data-duration="${num(dur)}" data-track-index="0" src="${escapeAttr(input.sourceMediaUrl)}" ${input.muted ? "muted " : ""}playsinline preload="auto" style="${mediaStyle}"></video>`
|
|
60
|
+
: `<img data-hf-id="dedupe-media" data-layer-kind="image" data-layer-mode="both" data-start="0" data-duration="${num(dur)}" data-track-index="0" src="${escapeAttr(input.sourceMediaUrl)}" alt="" style="${mediaStyle}" />`;
|
|
61
|
+
return `<!doctype html>
|
|
62
|
+
<html>
|
|
63
|
+
<head><meta charset="UTF-8" />
|
|
64
|
+
<style>
|
|
65
|
+
html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;background:${bg}}
|
|
66
|
+
[data-composition-id]{position:relative;width:100vw;height:100vh;overflow:hidden;background:${bg};perspective:1000px}
|
|
67
|
+
</style>
|
|
68
|
+
</head>
|
|
69
|
+
<body>
|
|
70
|
+
<div data-composition-id="${escapeAttr(input.compositionId)}" data-width="${intAttr(input.width, 1080)}" data-height="${intAttr(input.height, 1920)}" data-duration="${num(dur)}">
|
|
71
|
+
<div style="position:absolute;left:0;top:0;width:100%;height:100%;transform:${transform};filter:${filter};transform-origin:center center">
|
|
72
|
+
${mediaEl}
|
|
73
|
+
<div style="position:absolute;left:0;top:0;width:100%;height:100%;background:${tint};pointer-events:none"></div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</body>
|
|
77
|
+
</html>`;
|
|
78
|
+
}
|
|
79
|
+
function num(value, fallback = 0) {
|
|
80
|
+
return Number.isFinite(value) ? value : fallback;
|
|
81
|
+
}
|
|
82
|
+
function intAttr(value, fallback) {
|
|
83
|
+
const n = Math.round(Number(value));
|
|
84
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
85
|
+
}
|
|
86
|
+
function escapeAttr(value) {
|
|
87
|
+
return String(value ?? "").replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
88
|
+
}
|
|
89
|
+
// Colors/positions land inside a CSS declaration, so strip anything that could
|
|
90
|
+
// break out of the value (`;`, `{`, `}`, `<`, `>`, quotes). Falls back when the
|
|
91
|
+
// sanitized value is empty.
|
|
92
|
+
function safeCssColor(value, fallback) {
|
|
93
|
+
const cleaned = String(value ?? "").replace(/[;{}<>"'`]/g, "").trim();
|
|
94
|
+
return cleaned || fallback;
|
|
95
|
+
}
|
|
96
|
+
function safeCssToken(value, fallback) {
|
|
97
|
+
const cleaned = String(value ?? "").replace(/[;{}<>"'`]/g, "").trim();
|
|
98
|
+
return cleaned || fallback;
|
|
99
|
+
}
|
|
100
|
+
function hexToRgba(hex, opacity) {
|
|
101
|
+
const normalized = /^#?[0-9a-f]{6}$/i.test(hex) ? hex.replace("#", "") : "FF8C00";
|
|
102
|
+
const red = Number.parseInt(normalized.slice(0, 2), 16);
|
|
103
|
+
const green = Number.parseInt(normalized.slice(2, 4), 16);
|
|
104
|
+
const blue = Number.parseInt(normalized.slice(4, 6), 16);
|
|
105
|
+
const alpha = Math.max(0, Math.min(1, Number.isFinite(opacity) ? opacity : 0.08));
|
|
106
|
+
return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=hyperframes-media.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
3
|
+
import { escapeHtml } from "./page-shell.js";
|
|
4
|
+
function extractTagContent(documentHtml, tagName) {
|
|
5
|
+
const match = documentHtml.match(new RegExp(`<${tagName}[^>]*>([\\s\\S]*?)<\\/${tagName}>`, "i"));
|
|
6
|
+
return match?.[1] ?? "";
|
|
7
|
+
}
|
|
8
|
+
export function parseLegacyDocument(documentHtml) {
|
|
9
|
+
return {
|
|
10
|
+
title: extractTagContent(documentHtml, "title"),
|
|
11
|
+
bodyHtml: extractTagContent(documentHtml, "body"),
|
|
12
|
+
styleText: extractTagContent(documentHtml, "style")
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function ReactDocument(input) {
|
|
16
|
+
const runtimeBoot = input.runtimeBoot ?? {
|
|
17
|
+
pageKind: "legacy",
|
|
18
|
+
title: input.title || "VidFarm AI"
|
|
19
|
+
};
|
|
20
|
+
return (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1, viewport-fit=cover" }), _jsx("title", { children: input.title }), _jsx("link", { rel: "icon", href: "/assets/favicon.ico", sizes: "any" }), _jsx("link", { rel: "preconnect", href: "https://fonts.googleapis.com" }), _jsx("link", { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "" }), _jsx("link", { href: "https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Manrope:wght@400;500;600;700;800&display=swap", rel: "stylesheet" }), _jsx("style", { dangerouslySetInnerHTML: { __html: input.styleText } })] }), _jsxs("body", { children: [_jsx("div", { dangerouslySetInnerHTML: { __html: input.bodyHtml } }), _jsx("div", { id: "page-runtime-root", hidden: true }), _jsx("script", { id: "page-runtime-boot", type: "application/json", dangerouslySetInnerHTML: { __html: JSON.stringify(runtimeBoot).replace(/</g, "\\u003c").replace(/>/g, "\\u003e").replace(/&/g, "\\u0026") } }), _jsx("script", { type: "module", src: "/assets/page-runtime-client-app.js" })] })] }));
|
|
21
|
+
}
|
|
22
|
+
export function renderParsedDocument(input) {
|
|
23
|
+
return `<!doctype html>${renderToStaticMarkup(_jsx(ReactDocument, { ...input }))}`;
|
|
24
|
+
}
|
|
25
|
+
export function renderLegacyPageAsReact(documentHtml, runtimeBoot) {
|
|
26
|
+
const parsed = parseLegacyDocument(documentHtml);
|
|
27
|
+
const safeTitle = parsed.title ? parsed.title : escapeHtml("VidFarm AI");
|
|
28
|
+
return renderParsedDocument({
|
|
29
|
+
title: safeTitle,
|
|
30
|
+
bodyHtml: parsed.bodyHtml,
|
|
31
|
+
styleText: parsed.styleText,
|
|
32
|
+
runtimeBoot
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=react-page-shell.js.map
|