The VS Code of video editing, built for agents.
TypeScript
Remove legacy skills cleanup functionality
konstantin-paulusf023adb4cdaf
diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.tsindex 6b557684..5c380d62 100644--- a/apps/desktop/src/main.ts+++ b/apps/desktop/src/main.ts@@ -15,7 +15,6 @@ import { agentChatEndpoint, deleteProjectChats, startAgentChat, stopAgentChat }import { cliStatus, installCli, uninstallCli } from "./cli-install";import { applyMcp, healMcpRegistrations, mcpStatus } from "./mcp-install";import { enableHeadless } from "./headless";-import { pruneLegacySkills } from "./skills-cleanup";import { trackInstall } from "./analytics";import { setupAppMenu } from "./menu";import { mainBridge } from "./main-manager";@@ -424,7 +423,6 @@ if (app.requestSingleInstanceLock()) {version: app.getVersion(),}),);- pruneLegacySkills();healMcpRegistrations();trackInstall();createWindow(!isHiddenLaunch(process.argv));diff --git a/apps/desktop/src/skills-cleanup.ts b/apps/desktop/src/skills-cleanup.tsdeleted file mode 100644index b7a54d1f..00000000--- a/apps/desktop/src/skills-cleanup.ts+++ /dev/null@@ -1,66 +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 { lstatSync, readFileSync, readlinkSync, rmSync } from "node:fs";-import { homedir } from "node:os";-import { join } from "node:path";--/** The skills we shipped, by the directory name they were installed under. */-const LEGACY_SKILLS = ["editor", "watch"];--/** Home-relative folders of the agents older builds installed skills for. */-const AGENT_DIRS = [".claude", ".codex", ".cursor", ".gemini", ".codeium/windsurf"];--/**- * Where an agent keeps its global skills: `skills/` inside its folder —- * `~/.claude/skills`, `~/.codex/skills`, and so on.- */-const skillsDirs = (): string[] =>- AGENT_DIRS.map((dir) => join(homedir(), dir, "skills"));--/** The link's target, or null when `path` is missing or not a symlink. */-function linkTarget(path: string): string | null {- try {- return lstatSync(path).isSymbolicLink() ? readlinkSync(path) : null;- } catch {- return null;- }-}--/**- * Whether the skill at `path` is one of ours. A symlink into a Diffusion- * Studio bundle is ours even when it dangles — that is the case the app- * moving leaves behind. Anything else has to say so in its own SKILL.md,- * which is what keeps a user's unrelated `editor` skill safe.- */-function isOurs(path: string, name: string): boolean {- const target = linkTarget(path);- if (target?.includes("Diffusion Studio") || target?.includes("/AppTranslocation/")) return true;- try {- const text = readFileSync(join(path, "SKILL.md"), "utf8");- return text.includes(`name: ${name}`) && text.includes("Diffusion Studio");- } catch {- return false; // no SKILL.md to vouch for it- }-}--/**- * Removes every stale skill of ours from the agents we support, and returns- * the paths it removed. Best effort: a skill it cannot read or delete is- * left where it is. Removing a symlink removes the link, never its target.- */-export function pruneLegacySkills(): string[] {- const removed: string[] = [];- for (const dir of skillsDirs()) {- for (const name of LEGACY_SKILLS) {- const path = join(dir, name);- if (!isOurs(path, name)) continue;- try {- rmSync(path, { recursive: true, force: true });- removed.push(path);- } catch { /* Ignore errors */ }- }- }- return removed;-}