The VS Code of video editing, built for agents.
TypeScript
Remove headless mode functionality and related components
konstantin-paulusf0e66b3dd6dd
diff --git a/apps/desktop/src/main-channels.ts b/apps/desktop/src/main-channels.tsindex 49b043ca..a6b718db 100644--- a/apps/desktop/src/main-channels.ts+++ b/apps/desktop/src/main-channels.ts@@ -38,7 +38,6 @@ export const MAIN_CHANNELS = {FILE_WRITE_CHUNK: "file:write-chunk",FILE_WRITE_CLOSE: "file:write-close",FILE_WRITE_ABORT: "file:write-abort",- HEADLESS_GET_MODE: "headless:get-mode",LOGS_GET: "logs:get",PROJECTS_PICK_ROOT: "projects:pick-root",PROJECTS_PICK_FOLDER: "projects:pick-folder",@@ -68,7 +67,6 @@ export const MAIN_CHANNELS = {AUTH_CALLBACK: "auth:callback",CHECKOUT_CALLBACK: "checkout:callback",WINDOW_FULLSCREEN_CHANGE: "window:fullscreen-change",- HEADLESS_MODE: "headless:mode",PROJECTS_CHANGED: "projects:changed",} as const;@@ -150,7 +148,6 @@ export type MainRequestMap = {request: { path: string };response: void;};- [MAIN_CHANNELS.HEADLESS_GET_MODE]: { request: void; response: boolean };[MAIN_CHANNELS.LOGS_GET]: { request: void; response: LogEntry[] };[MAIN_CHANNELS.PROJECTS_PICK_ROOT]: {request: void;@@ -263,7 +260,6 @@ export type MainEventMap = {[MAIN_CHANNELS.AUTH_CALLBACK]: { url: string };[MAIN_CHANNELS.CHECKOUT_CALLBACK]: { url: string };[MAIN_CHANNELS.WINDOW_FULLSCREEN_CHANGE]: { fullscreen: boolean };- [MAIN_CHANNELS.HEADLESS_MODE]: { active: boolean };// A file inside a watched project folder changed (path relative to `dir`).[MAIN_CHANNELS.PROJECTS_CHANGED]: { dir: string; path: string };};diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.tsindex 668ea2b9..b0e71225 100644--- a/apps/desktop/src/main.ts+++ b/apps/desktop/src/main.ts@@ -10,7 +10,7 @@ import { randomUUID } from "node:crypto";import type { FileHandle } from "node:fs/promises";import { updateElectronApp } from "update-electron-app";import { DapiServer } from "./dapi/server";-import { enableHeadless, isHeadless } from "./headless";+import { enableHeadless } from "./headless";import { pruneLegacySkills } from "./skills-cleanup";import { trackInstall } from "./analytics";import { setupAppMenu } from "./menu";@@ -109,17 +109,12 @@ function knowledgeDir(): string | null {}// The MCP server agents and the dapi CLI talk to. Started once the app is-// ready; the first connection switches the UI into headless mode.+// ready; the first connection switches the app into headless mode.const dapi = new DapiServer({version: app.getVersion(),logs: () => logBuffer,knowledgeDir: knowledgeDir(),- onFirstConnection() {- enableHeadless();- if (mainWindow && !mainWindow.isDestroyed()) {- mainBridge.emit(mainWindow, MAIN_CHANNELS.HEADLESS_MODE, { active: true });- }- },+ onFirstConnection: enableHeadless,});function pushLog(level: LogEntry["level"], message: string, source: string) {@@ -300,7 +295,6 @@ if (app.requestSingleInstanceLock()) {// A plain Uint8Array over the PNG, so the renderer sees bytes and not a Buffer.return { png: new Uint8Array(png.buffer, png.byteOffset, png.byteLength), width, height };});- mainBridge.handle(MAIN_CHANNELS.HEADLESS_GET_MODE, () => isHeadless());mainBridge.handle(MAIN_CHANNELS.LOGS_GET, () => logBuffer);mainBridge.handle(MAIN_CHANNELS.PROJECTS_PICK_ROOT, () => pickRoot(mainWindow));mainBridge.handle(MAIN_CHANNELS.PROJECTS_PICK_FOLDER, () => pickFolder(mainWindow));diff --git a/apps/web/src/app.tsx b/apps/web/src/app.tsxindex a57cf178..171fbdc1 100644--- a/apps/web/src/app.tsx+++ b/apps/web/src/app.tsx@@ -26,7 +26,7 @@ function AuthGate(props: { children: JSX.Element }) {return (<Show when={!auth.isLoading()}>- <Show when={auth.isAuthenticated() || auth.headless()}>+ <Show when={auth.isAuthenticated()}>{props.children}</Show><Show when={!auth.isAuthenticated()}>diff --git a/apps/web/src/components/headless-indicator.tsx b/apps/web/src/components/headless-indicator.tsxdeleted file mode 100644index f427b42b..00000000--- a/apps/web/src/components/headless-indicator.tsx+++ /dev/null@@ -1,24 +0,0 @@-/* This Source Code Form is subject to the terms of the Mozilla Public- * License, v. 2.0. If a copy of the MPL was not distributed with this- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */--import { Show } from "solid-js";-import { useAuth } from "@/context/auth";--export function HeadlessIndicator() {- const auth = useAuth();-- return (- <Show when={auth.headless()}>- <div- class="pointer-events-none fixed top-3 left-1/2 z-[9999] flex -translate-x-1/2 items-center gap-2 rounded-full border border-border bg-background/90 px-3 py-1.5 shadow-md backdrop-blur"- >- <span class="relative flex size-2">- <span class="absolute inline-flex size-full animate-ping rounded-full bg-primary opacity-75" />- <span class="relative inline-flex size-2 rounded-full bg-primary" />- </span>- <span class="text-xs font-450 text-foreground">Remote controlled</span>- </div>- </Show>- );-}diff --git a/apps/web/src/context/auth.tsx b/apps/web/src/context/auth.tsxindex be1112e7..6d2cf938 100644--- a/apps/web/src/context/auth.tsx+++ b/apps/web/src/context/auth.tsx@@ -30,7 +30,6 @@ type AuthContextValue = {session: Accessor<Session | null>;user: Accessor<User | null>;isAuthenticated: Accessor<boolean>;- headless: Accessor<boolean>;isLoading: Accessor<boolean>;accessLevel: Accessor<number>;remainingCredits: Accessor<number>;@@ -67,22 +66,6 @@ const USER_DATA_QUERY = "lifetime_credit_balance,monthly_credit_balance,monthly_export function AuthProvider(props: { children: JSX.Element }) {const [session, setSession] = createSignal<Session | null>(null);const [isLoading, setIsLoading] = createSignal(true);- const [headless, setHeadless] = createSignal(false);-- onMount(() => {- if (!window.desktop) return;-- mainBridge- .call(MAIN_CHANNELS.HEADLESS_GET_MODE, undefined)- .then(setHeadless)-- const unsubscribe = mainBridge.handle(- MAIN_CHANNELS.HEADLESS_MODE,- ({ active }) => setHeadless(active)- );- onCleanup(unsubscribe);- });-onMount(() => {if (!supabase) {setIsLoading(false);@@ -311,7 +294,6 @@ export function AuthProvider(props: { children: JSX.Element }) {hasStripeCustomer,user: () => session()?.user ?? null,isAuthenticated: () => !!session(),- headless,isLoading,accessLevel,remainingCredits,diff --git a/apps/web/src/pages/login.tsx b/apps/web/src/pages/login.tsxindex b7239b89..0f87cffb 100644--- a/apps/web/src/pages/login.tsx+++ b/apps/web/src/pages/login.tsx@@ -9,7 +9,6 @@ import { Button } from '@/components/ui/button';import { Icon } from '@/components/ui/icon';import { TextField, TextFieldInput, TextFieldLabel } from '@/components/ui/text-field';import { DevAuthCodeInput } from '@/components/dev-auth-code-input';-import { HeadlessIndicator } from '@/components/headless-indicator';import { useAuth } from '@/context/auth';type OAuthButtonProps = {@@ -56,8 +55,6 @@ export function LoginPage() {return (<div class="flex flex-col bg-background fixed inset-0 z-999">- <HeadlessIndicator />-<Show when={!window.desktop}><div class="flex items-center gap-1 p-4"><Icon name="diffusion-logo" class="size-6" />