Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
remove the fal.ai H3 Max free-tool banner from the video gen page
[._.]/ Adam Eivy1c01804e2380
diff --git a/client/src/components/videoGen/FalH3MaxPromptFallback.jsx b/client/src/components/videoGen/FalH3MaxPromptFallback.jsxdeleted file mode 100644index 216f3a82ab..0000000000--- a/client/src/components/videoGen/FalH3MaxPromptFallback.jsx+++ /dev/null@@ -1,40 +0,0 @@-import Modal from '../ui/Modal';--export default function FalH3MaxPromptFallback({ prompt, onClose }) {- return (- <Modal- open={Boolean(prompt)}- onClose={onClose}- size="lg"- usePortal- ariaLabel="Copy fal H3 Max prompt manually"- >- <div className="space-y-3 rounded-xl border border-port-border bg-port-card p-4">- <div>- <h2 className="text-base font-semibold text-port-text">Copy the fal H3 Max prompt</h2>- <p className="mt-1 text-sm text-port-text-muted">- Automatic clipboard access is unavailable here. Select the prepared prompt below,- copy it manually, and paste it into the fal.ai tab.- </p>- </div>- <textarea- aria-label="Prepared fal H3 Max prompt"- readOnly- value={prompt || ''}- onFocus={(event) => event.currentTarget.select()}- rows={12}- className="w-full resize-y rounded-lg border border-port-border bg-port-bg p-3 text-sm text-port-text"- />- <div className="flex justify-end">- <button- type="button"- onClick={onClose}- className="rounded-lg border border-port-border px-3 py-2 text-sm text-port-text hover:border-port-accent hover:text-port-accent"- >- Done- </button>- </div>- </div>- </Modal>- );-}diff --git a/client/src/lib/README.md b/client/src/lib/README.mdindex aba3eda74d..d7d3c3d50f 100644--- a/client/src/lib/README.md+++ b/client/src/lib/README.md@@ -113,7 +113,7 @@ grep -i "what you want to do" client/src/lib/README.md| `clinicianReport.js` | Pure builders for the MeatSpace clinician-export view (`/meatspace/export`). `buildClinicianReport({ tests, config })` → structured report model (blood panels grouped by category with reference ranges + out-of-range flags, plus a lifestyle summary); `reportToMarkdown(report)` → copy-paste markdown. Reuses the Blood tab's `REFERENCE_RANGES` / `getBloodValueStatus` so printed flags match the UI. Also exports `buildBloodTestModel`, `buildLifestyleModel`, `getCategoryForKey`, `formatRange`. || `quotaBurnPatch.js` | `mergeQuotaBurnPatch(base, patch)` — mirrors the server's quota-burn config merge (top-level + per-family keys merge, a family's `jobs` array replaces) so the Quota Burn page can apply an edit optimistically and accumulate debounced edits into one PUT body. `applyQuotaBurnPreset(job, preset)` / `jobFromPreset(preset, { id, appId })` — copy a catalog prompt preset into a job, preserving the user's own step name and app choice. `quotaBurnJobIsSpent(job, ranAt)` — whether a `run once` step has had its one dispatch, gated on the optimistic config's own `runOnce` so a just-ticked checkbox reads as spent before the save round-trips (the client mirror of the server's `jobIsSpent`). `UNLIMITED_DISPATCHES` / `isUnlimitedDispatchCap(cap)` / `dispatchCapInput(value)` — the -1 "no dispatch cap" sentinel (the default), mirrored from the server. || `clipboard.js` | `copyToClipboard`, `writeClipboardSilently`, `readClipboard` — safe across insecure-origin contexts. Use these instead of `navigator.clipboard.writeText` inline. |-| `falVideoHandoff.js` | `openFalH3MaxFreeTool({prompt, negativePrompt})` opens fal's free MiniMax H3 Max browser tool under the originating click and copies a prepared shot prompt; `buildFalH3MaxPrompt`, `FAL_H3_MAX_FREE_URL`, and `FAL_H3_MAX_FREE_ALLOWANCE_NOTE` expose the handoff contract and current vendor allowance copy. The free web allowance is deliberately a handoff, not the separately metered fal API. |+| `falVideoHandoff.js` | `buildFalH3MaxPrompt(prompt, negativePrompt)` composes the provider-neutral shot prompt fal's free MiniMax H3 Max tool is driven with; `FAL_H3_MAX_FREE_URL` and `FAL_H3_MAX_FREE_ALLOWANCE_NOTE` carry the tool URL and current vendor allowance copy. The free web allowance is deliberately a handoff, not the separately metered fal API. || `compareHelpers.js` | `equalByKeys(a, b, keys)` / `equalListByKeys(a, b, keys)` — typed key-based equality for `useAutoRefetch`'s `compare`. Keys are property names, dotted paths (`'context.running'`), or `(item) => value` accessors. The typed alternative to `sameJsonShape` when a monotonic timestamp or unrendered field would break stringify-equality dedup. || `consoleFilters.js` | `installConsoleFilters()` — drops a small allow-list of known-noise console strings (THREE.js `Clock` deprecation, expected WebGL `Context Lost.`) from `console.{warn,log,debug}`. Idempotent; auto-installed on import. Imported for its side effect from `main.jsx`. || `cosTaskType.js` | CoS task-learning bucket resolver for ETA surfaces: `extractCosTaskType(task)` mirrors the server's metadata-first `extractTaskType` handling for live tasks and archived-agent projections, so `self-improve:*`, `user-task`, and fallback estimates use the same history bucket that recorded the run. |diff --git a/client/src/lib/falVideoHandoff.js b/client/src/lib/falVideoHandoff.jsindex b21d22a9a4..c1301aecbf 100644--- a/client/src/lib/falVideoHandoff.js+++ b/client/src/lib/falVideoHandoff.js@@ -1,5 +1,3 @@-import { copyToClipboard } from './clipboard.js';-export const FAL_H3_MAX_FREE_URL = 'https://fal.ai/tools/minimax-h3-max';export const FAL_H3_MAX_FREE_ALLOWANCE_NOTE ='fal.ai currently advertises up to 5 free videos per day with an account; this vendor-controlled allowance may change.';@@ -15,23 +13,3 @@ export function buildFalH3MaxPrompt(prompt, negativePrompt = '') {if (!shot) return '';return avoid ? `${shot}\n\nAvoid: ${avoid}` : shot;}--/**- * Open the free browser tool while the click still owns user activation, then- * copy the prepared prompt. Opening first avoids popup blockers caused by- * awaiting the Clipboard API before window.open().- */-export function openFalH3MaxFreeTool({- prompt,- negativePrompt = '',- onCopyFailure,-} = {}) {- const prepared = buildFalH3MaxPrompt(prompt, negativePrompt);- if (!prepared) return false;- globalThis.open?.(FAL_H3_MAX_FREE_URL, '_blank', 'noopener,noreferrer');- void copyToClipboard(prepared, 'fal H3 Max prompt copied — paste it into the free tool')- .then((copied) => {- if (!copied) onCopyFailure?.(prepared);- });- return true;-}diff --git a/client/src/lib/falVideoHandoff.test.js b/client/src/lib/falVideoHandoff.test.jsindex 98cf73dd68..9877c58878 100644--- a/client/src/lib/falVideoHandoff.test.js+++ b/client/src/lib/falVideoHandoff.test.js@@ -1,45 +1,10 @@-import { beforeEach, describe, expect, it, vi } from 'vitest';-import {- buildFalH3MaxPrompt, FAL_H3_MAX_FREE_URL, openFalH3MaxFreeTool,-} from './falVideoHandoff.js';--const toastMocks = vi.hoisted(() => ({ error: vi.fn(), success: vi.fn() }));-vi.mock('../components/ui/Toast', () => ({ default: toastMocks }));+import { describe, expect, it } from 'vitest';+import { buildFalH3MaxPrompt } from './falVideoHandoff.js';describe('fal H3 Max free-tool handoff', () => {- beforeEach(() => {- vi.clearAllMocks();- vi.stubGlobal('open', vi.fn());- vi.stubGlobal('navigator', { clipboard: { writeText: vi.fn(async () => {}) } });- });-it('preserves the shot and appends a non-empty avoid list', () => {expect(buildFalH3MaxPrompt(' One continuous tracking shot. ', ' cuts, logos ')).toBe('One continuous tracking shot.\n\nAvoid: cuts, logos');expect(buildFalH3MaxPrompt('A quiet room.', ' ')).toBe('A quiet room.');});-- it('opens the free tool and copies the prepared prompt', async () => {- expect(openFalH3MaxFreeTool({ prompt: 'The door opens.', negativePrompt: 'cuts' })).toBe(true);- expect(globalThis.open).toHaveBeenCalledWith(FAL_H3_MAX_FREE_URL, '_blank', 'noopener,noreferrer');- await vi.waitFor(() => expect(globalThis.navigator.clipboard.writeText)- .toHaveBeenCalledWith('The door opens.\n\nAvoid: cuts'));- });-- it('does nothing when no prompt is ready', () => {- expect(openFalH3MaxFreeTool({ prompt: ' ' })).toBe(false);- expect(globalThis.open).not.toHaveBeenCalled();- });-- it('returns the prepared prompt to the caller when automatic copying fails', async () => {- const onCopyFailure = vi.fn();- globalThis.navigator.clipboard.writeText.mockRejectedValueOnce(new Error('blocked'));-- openFalH3MaxFreeTool({- prompt: 'The door opens.', negativePrompt: 'cuts', onCopyFailure,- });-- await vi.waitFor(() => expect(onCopyFailure)- .toHaveBeenCalledWith('The door opens.\n\nAvoid: cuts'));- });});diff --git a/client/src/pages/VideoGen.composeWhileBusy.test.jsx b/client/src/pages/VideoGen.composeWhileBusy.test.jsxindex 387e9fc80c..7e1b554ee0 100644--- a/client/src/pages/VideoGen.composeWhileBusy.test.jsx+++ b/client/src/pages/VideoGen.composeWhileBusy.test.jsx@@ -192,26 +192,4 @@ describe('VideoGen compose-while-busy', () => {expect(screen.getByTestId('prompt-from-media')).toHaveAttribute('data-disabled', '0');expect(screen.getByRole('button', { name: /Add to queue/ })).toBeEnabled();});-- it('copies the composed prompt and opens fal H3 Max without queueing a paid API job', async () => {- await act(async () => {- render(- <MemoryRouter initialEntries={['/media/video']}>- <VideoGen />- </MemoryRouter>,- );- });-- expect(screen.getByText(/fal\.ai currently advertises up to 5 free videos per day with an account/))- .toBeInTheDocument();- fireEvent.change(await screen.findByLabelText('Prompt'), { target: { value: 'A clockwork bird takes flight.' } });- fireEvent.click(screen.getByRole('button', { name: 'Copy prompt & open fal.ai' }));-- expect(globalThis.open).toHaveBeenCalledWith(- 'https://fal.ai/tools/minimax-h3-max', '_blank', 'noopener,noreferrer',- );- await waitFor(() => expect(globalThis.navigator.clipboard.writeText)- .toHaveBeenCalledWith('A clockwork bird takes flight.'));- expect(state.generateVideo).not.toHaveBeenCalled();- });});diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsxindex 00f3db6924..0651900a07 100644--- a/client/src/pages/VideoGen.jsx+++ b/client/src/pages/VideoGen.jsx@@ -56,8 +56,6 @@ import LiveVideoStage from '../components/videoGen/LiveVideoStage';import { resolveVideoStagePreview, VIDEO_STAGE_KIND } from '../lib/videoStagePreview';import VideoGenGallery from '../components/videoGen/VideoGenGallery';import GalleryImagePicker from '../components/imageGen/GalleryImagePicker';-import GalleryVideoPicker from '../components/videoGen/GalleryVideoPicker';-import FalH3MaxPromptFallback from '../components/videoGen/FalH3MaxPromptFallback';import MediaPreview from '../components/media/MediaPreview';import StylePresetPicker from '../components/media/StylePresetPicker';import PromptEnhancer from '../components/media/PromptEnhancer';@@ -65,7 +63,7 @@ import PromptFromMedia from '../components/media/PromptFromMedia';import { normalizeVideo } from '../components/media/normalize';import {Film, Sparkles, Settings as SettingsIcon, RefreshCw, AlertTriangle,- X, Type, Image as ImageIcon, GitBranch, ListPlus, Music, SlidersHorizontal, ExternalLink,+ X, Type, Image as ImageIcon, GitBranch, ListPlus, Music, SlidersHorizontal,} from 'lucide-react';import toast from '../components/ui/Toast';import BatchQueuePanel from '../components/media/BatchQueuePanel';@@ -101,9 +99,6 @@ import ResolutionField from '../components/media/ResolutionField';import { VIDEO_EDGE_BOUNDS, videoEdgeBoundsForModel, IC_LORA_MODES } from '../lib/videoGenParams.js';import { finishTargetForRecord, isDeliveryVideoModel } from '../lib/videoFinish.js';import { peerModelRequiresInput } from '../lib/federatedMediaReadiness.js';-import {- FAL_H3_MAX_FREE_ALLOWANCE_NOTE, openFalH3MaxFreeTool,-} from '../lib/falVideoHandoff.js';const MODES = [{ id: 'text', label: 'Text', icon: Type, desc: 'Text-to-video' },{ id: 'image', label: 'Image', icon: ImageIcon, desc: 'Image-to-video (start frame)' },@@ -117,7 +112,6 @@ const MODES = [export default function VideoGen() {const [searchParams, setSearchParams] = useSearchParams();- const [falManualPrompt, setFalManualPrompt] = useState('');const settingsOpen = searchParams.get('settings') === '1';const openSettings = () => setSearchParams(prev => { const n = new URLSearchParams(prev); n.set('settings', '1'); return n; });const closeSettings = () => {@@ -194,16 +188,6 @@ export default function VideoGen() {remoteSubmissionFields: remoteTarget.isRemote ? remoteTarget.submissionFields : null,});- // fal's daily H3 Max allowance is browser-only; its API is a separately- // metered product. Keep this as an explicit handoff rather than pretending a- // provider POST can spend the free quota. The exact composed prompt (style +- // no-music envelope) is what gets copied, matching a normal submission.- const falFreeSupported = mode === 'text' || mode === 'image';- const openFalFree = () => openFalH3MaxFreeTool({- prompt: envelopedPrompt,- negativePrompt,- onCopyFailure: setFalManualPrompt,- });// Conditioning the selected peer model cannot take. The server refuses a job// holding any of it (MEDIA_PROVIDER_INPUT_UNSUPPORTED) rather than silently// rendering something else, so the form says so before the user commits.@@ -266,7 +250,6 @@ export default function VideoGen() {// `null` = closed; otherwise `{ kind, index? }` records which slot the pick// lands in, since one modal serves every slot.const [galleryPicker, setGalleryPicker] = useState(null);- const [falImportOpen, setFalImportOpen] = useState(false);const handleGalleryPick = (item) => {const filename = item?.filename;if (!filename || !galleryPicker) return;@@ -885,44 +868,6 @@ export default function VideoGen() {<RuntimeFingerprint runtime={status?.runtime} />- <div className="flex flex-col gap-3 rounded-xl border border-port-accent/35 bg-port-accent/10 p-3 sm:flex-row sm:items-center sm:justify-between">- <div className="min-w-0">- <p className="text-sm font-medium text-port-text">MiniMax H3 Max on fal.ai</p>- <p className="mt-0.5 text-xs text-port-text-muted">- {FAL_H3_MAX_FREE_ALLOWANCE_NOTE} PortOS copies this form’s composed prompt and opens that tool; download the MP4, then upload it to Media History. fal’s app API is separately metered.- </p>- {!falFreeSupported && (- <p className="mt-1 text-xs text-port-warning" role="status">- Switch to Text or Image mode for the H3 Max free-tool handoff.- </p>- )}- </div>- <div className="flex shrink-0 flex-col gap-2 sm:items-stretch">- <button- type="button"- onClick={openFalFree}- disabled={!falFreeSupported || !envelopedPrompt?.trim()}- title={!falFreeSupported- ? 'fal H3 Max free-tool handoff supports Text and Image modes'- : !envelopedPrompt?.trim()- ? 'Write a prompt first'- : mode === 'image'- ? 'Copies the prompt; add your selected start frame in fal after it opens'- : 'Copies the prompt and opens fal H3 Max'}- className="inline-flex items-center justify-center gap-1.5 rounded-lg bg-port-accent px-3 py-2 text-xs font-medium text-white hover:bg-port-accent/80 disabled:cursor-not-allowed disabled:opacity-45"- >- <ExternalLink size={14} aria-hidden="true" /> Copy prompt & open fal.ai- </button>- <button- type="button"- onClick={() => setFalImportOpen(true)}- className="inline-flex items-center justify-center gap-1.5 rounded-lg border border-port-border px-3 py-2 text-xs font-medium text-port-text hover:border-port-accent hover:text-port-accent"- >- Import downloaded video- </button>- </div>- </div>-{status && status.connected === false && (() => {const missingCount = status.missingPackages?.length || 0;const hasPath = !!status.pythonPath;@@ -1576,26 +1521,6 @@ export default function VideoGen() {onSelect={handleGalleryPick}/>- <GalleryVideoPicker- open={falImportOpen}- onClose={() => setFalImportOpen(false)}- onSelect={(_item, context) => {- if (context?.origin === 'upload') {- refreshHistory();- toast.success('Video imported to Media History');- } else {- toast('That video is already in Media History');- }- }}- allowUpload- uploadToGallery- />-- <FalH3MaxPromptFallback- prompt={falManualPrompt}- onClose={() => setFalManualPrompt('')}- />-<Drawer open={settingsOpen} onClose={closeSettings} title="Media Generation Settings" size="lg"><ImageGenTab /></Drawer>