@mevdragon/vidfarm-devcli 0.5.3 → 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,132 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "./sentry.js";
|
|
3
|
+
import { useEffect, useMemo, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { createRoot } from "react-dom/client";
|
|
6
|
+
import * as Sentry from "@sentry/react";
|
|
7
|
+
import { useStore } from "zustand";
|
|
8
|
+
import { debugError, debugLog, installGlobalDebugHooks } from "./debug.js";
|
|
9
|
+
import { createFlockPosterCacheStore, readFlockPosterCacheSnapshot } from "./flockposter-cache-store.js";
|
|
10
|
+
import { createPageRuntimeStore } from "./page-runtime-store.js";
|
|
11
|
+
import { TemplateEditorChat } from "./template-editor-chat.js";
|
|
12
|
+
installGlobalDebugHooks();
|
|
13
|
+
function readBoot() {
|
|
14
|
+
const element = document.getElementById("page-runtime-boot");
|
|
15
|
+
if (!element?.textContent) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
return JSON.parse(element.textContent);
|
|
19
|
+
}
|
|
20
|
+
function isoDaysFromNow(days) {
|
|
21
|
+
const date = new Date();
|
|
22
|
+
date.setDate(date.getDate() + days);
|
|
23
|
+
return date.toISOString();
|
|
24
|
+
}
|
|
25
|
+
async function hydrateFlockPosterCacheAtStartup(input) {
|
|
26
|
+
if (!input.userId) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const current = input.store.getState();
|
|
30
|
+
if (!input.force && current.channels.length && current.channelsUpdatedAt) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const params = new URLSearchParams({
|
|
34
|
+
start_date: isoDaysFromNow(-7),
|
|
35
|
+
end_date: isoDaysFromNow(30)
|
|
36
|
+
});
|
|
37
|
+
const response = await fetch(`/u/${encodeURIComponent(input.userId)}/calendar/feed?${params.toString()}`, {
|
|
38
|
+
headers: { accept: "application/json" }
|
|
39
|
+
});
|
|
40
|
+
const payload = await response.json().catch(() => null);
|
|
41
|
+
if (!response.ok || !payload) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
input.store.getState().setCalendarData({
|
|
45
|
+
channels: Array.isArray(payload.channels) ? payload.channels : [],
|
|
46
|
+
posts: Array.isArray(payload.posts) ? payload.posts : [],
|
|
47
|
+
rangeStart: payload.startDate || isoDaysFromNow(-7),
|
|
48
|
+
rangeEnd: payload.endDate || isoDaysFromNow(30),
|
|
49
|
+
replaceRange: true
|
|
50
|
+
});
|
|
51
|
+
window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"));
|
|
52
|
+
}
|
|
53
|
+
function PageRuntimeApp({ boot }) {
|
|
54
|
+
const store = useMemo(() => createPageRuntimeStore(boot), [boot]);
|
|
55
|
+
const title = useStore(store, (state) => state.boot.title);
|
|
56
|
+
const [chatRoot, setChatRoot] = useState(null);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
store.getState().setHydratedAt(new Date().toISOString());
|
|
59
|
+
document.documentElement.dataset.reactRuntime = "true";
|
|
60
|
+
document.documentElement.dataset.reactRuntimePage = boot.pageKind;
|
|
61
|
+
document.title = title;
|
|
62
|
+
}, [boot.pageKind, store, title]);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (!boot.editorChat) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const nextRoot = document.querySelector("[data-template-editor-chat-root]");
|
|
68
|
+
setChatRoot(nextRoot instanceof HTMLElement ? nextRoot : null);
|
|
69
|
+
}, [boot.editorChat]);
|
|
70
|
+
return boot.editorChat && chatRoot
|
|
71
|
+
? createPortal(_jsx(Sentry.ErrorBoundary, { fallback: _jsx(ChatErrorFallback, {}), children: _jsx(TemplateEditorChat, { boot: boot.editorChat }) }), chatRoot)
|
|
72
|
+
: null;
|
|
73
|
+
}
|
|
74
|
+
function ChatErrorFallback() {
|
|
75
|
+
return (_jsxs("div", { style: {
|
|
76
|
+
display: "grid",
|
|
77
|
+
placeItems: "center",
|
|
78
|
+
height: "100%",
|
|
79
|
+
padding: "24px",
|
|
80
|
+
textAlign: "center",
|
|
81
|
+
gap: "12px",
|
|
82
|
+
color: "#5c6a82"
|
|
83
|
+
}, children: [_jsx("div", { style: { fontSize: "0.72rem", fontWeight: 800, letterSpacing: "0.14em", textTransform: "uppercase" }, children: "Chat error" }), _jsx("div", { style: { fontSize: "0.92rem" }, children: "Something went wrong loading the chat. Reload the page to try again." }), _jsx("button", { type: "button", onClick: () => window.location.reload(), style: {
|
|
84
|
+
marginTop: "4px",
|
|
85
|
+
minHeight: "34px",
|
|
86
|
+
padding: "0 16px",
|
|
87
|
+
border: "1px solid rgba(191, 164, 109, 0.34)",
|
|
88
|
+
borderRadius: "999px",
|
|
89
|
+
background: "rgba(255, 255, 255, 0.92)",
|
|
90
|
+
color: "#243041",
|
|
91
|
+
fontWeight: 700,
|
|
92
|
+
cursor: "pointer"
|
|
93
|
+
}, children: "Reload" })] }));
|
|
94
|
+
}
|
|
95
|
+
const boot = readBoot();
|
|
96
|
+
const rootElement = document.getElementById("page-runtime-root");
|
|
97
|
+
const flockPosterCacheStore = createFlockPosterCacheStore(boot?.userId ?? null);
|
|
98
|
+
let flockPosterHydrationPromise = null;
|
|
99
|
+
function ensureFlockPosterCacheHydrated(options = {}) {
|
|
100
|
+
if (!options.force && flockPosterHydrationPromise) {
|
|
101
|
+
return flockPosterHydrationPromise;
|
|
102
|
+
}
|
|
103
|
+
flockPosterHydrationPromise = hydrateFlockPosterCacheAtStartup({
|
|
104
|
+
userId: boot?.userId ?? null,
|
|
105
|
+
store: flockPosterCacheStore,
|
|
106
|
+
force: options.force
|
|
107
|
+
}).catch(() => { });
|
|
108
|
+
return flockPosterHydrationPromise;
|
|
109
|
+
}
|
|
110
|
+
window.__vidfarmFlockPosterCache = {
|
|
111
|
+
readSnapshot: () => readFlockPosterCacheSnapshot(boot?.userId ?? null),
|
|
112
|
+
ensureHydrated: ensureFlockPosterCacheHydrated,
|
|
113
|
+
setChannelsData: (channels) => {
|
|
114
|
+
flockPosterCacheStore.getState().setChannelsData(channels);
|
|
115
|
+
window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"));
|
|
116
|
+
},
|
|
117
|
+
setCalendarData: (input) => {
|
|
118
|
+
flockPosterCacheStore.getState().setCalendarData(input);
|
|
119
|
+
window.dispatchEvent(new CustomEvent("vidfarm:flockposter-cache-updated"));
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
void ensureFlockPosterCacheHydrated();
|
|
123
|
+
debugLog("page_runtime.boot", {
|
|
124
|
+
has_boot: Boolean(boot),
|
|
125
|
+
has_root: Boolean(rootElement),
|
|
126
|
+
page_kind: boot?.pageKind ?? null,
|
|
127
|
+
editor_chat_template_id: boot?.editorChat?.template?.templateId ?? null
|
|
128
|
+
});
|
|
129
|
+
if (boot && rootElement) {
|
|
130
|
+
createRoot(rootElement).render((_jsx(Sentry.ErrorBoundary, { fallback: _jsx(_Fragment, {}), onError: (error) => debugError("page_runtime.render_error", { message: error instanceof Error ? error.message : String(error) }), children: _jsx(PageRuntimeApp, { boot: boot }) })));
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=page-runtime-client.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createStore } from "zustand/vanilla";
|
|
2
|
+
export function createPageRuntimeStore(boot) {
|
|
3
|
+
return createStore((set) => ({
|
|
4
|
+
boot,
|
|
5
|
+
hydratedAt: null,
|
|
6
|
+
setHydratedAt: (hydratedAt) => set({ hydratedAt })
|
|
7
|
+
}));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=page-runtime-store.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/react";
|
|
2
|
+
function readSampleRate(raw, defaultValue) {
|
|
3
|
+
if (raw == null || raw === "")
|
|
4
|
+
return defaultValue;
|
|
5
|
+
const parsed = typeof raw === "number" ? raw : Number(raw);
|
|
6
|
+
return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1 ? parsed : defaultValue;
|
|
7
|
+
}
|
|
8
|
+
const options = window.__vidfarmSentry;
|
|
9
|
+
const dsn = options?.dsn?.trim() || "";
|
|
10
|
+
if (dsn) {
|
|
11
|
+
const environment = options?.environment?.trim() || "development";
|
|
12
|
+
const defaultTracesSampleRate = environment === "production" ? 0.1 : 1.0;
|
|
13
|
+
const defaultReplaySessionSampleRate = environment === "production" ? 0.1 : 1.0;
|
|
14
|
+
const sameOriginTargets = [
|
|
15
|
+
"localhost",
|
|
16
|
+
window.location.origin,
|
|
17
|
+
`${window.location.origin}/api`
|
|
18
|
+
];
|
|
19
|
+
const tracePropagationTargets = Array.from(new Set([
|
|
20
|
+
...sameOriginTargets,
|
|
21
|
+
...(options?.tracePropagationTargets ?? [])
|
|
22
|
+
].filter(Boolean)));
|
|
23
|
+
Sentry.init({
|
|
24
|
+
dsn,
|
|
25
|
+
environment,
|
|
26
|
+
release: options?.release?.trim() || undefined,
|
|
27
|
+
integrations: [
|
|
28
|
+
Sentry.browserTracingIntegration(),
|
|
29
|
+
Sentry.replayIntegration({
|
|
30
|
+
maskAllText: true,
|
|
31
|
+
blockAllMedia: true
|
|
32
|
+
})
|
|
33
|
+
],
|
|
34
|
+
tracesSampleRate: readSampleRate(options?.tracesSampleRate, defaultTracesSampleRate),
|
|
35
|
+
tracePropagationTargets,
|
|
36
|
+
replaysSessionSampleRate: readSampleRate(options?.replaysSessionSampleRate, defaultReplaySessionSampleRate),
|
|
37
|
+
replaysOnErrorSampleRate: readSampleRate(options?.replaysOnErrorSampleRate, 1.0),
|
|
38
|
+
enableLogs: options?.enableLogs ?? true,
|
|
39
|
+
sendDefaultPii: options?.sendDefaultPii ?? true
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=sentry.js.map
|