The VS Code of video editing, built for agents.
TypeScript
Update README and enhance Windows signing process
konstantin-paulus3198fbade43c
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex e9f04121..426f5692 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -54,3 +54,106 @@ jobs:APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}run: npm run publish --workspace=@diffusionstudio/desktop++ # Signed with Azure Artifact Signing; apps/desktop/WINDOWS.md (stage 5) has+ # the account setup and the secrets and variables this job expects. Runs+ # after the macOS job so both append their assets to the one draft release+ # instead of racing to create it. Squirrel's RELEASES file and the nupkg+ # land next to the setup exe; the updater needs all three.+ publish-windows:+ needs: publish-macos+ runs-on: windows-latest+ # The environment name is the subject of the OIDC token that Azure's+ # federated credential for this repository is bound to.+ environment: release+ permissions:+ contents: write+ id-token: write # OIDC sign-in to Azure, no client secret+ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-node@v4+ with:+ node-version: 20+ cache: npm++ - name: Check versions match tag+ shell: bash+ run: |+ TAG="${GITHUB_REF_NAME#v}"+ for PKG in package.json apps/desktop/package.json apps/cli/package.json apps/web/package.json; do+ V="$(node -p "require('./$PKG').version")"+ if [ "$V" != "$TAG" ]; then+ echo "Version mismatch in $PKG: $V, tag is $TAG"+ exit 1+ fi+ done++ - run: npm ci++ - name: Provide client env for web build+ shell: bash+ run: cp apps/web/.env.example apps/web/.env++ - name: Sign in to Azure+ uses: azure/login@v2+ with:+ client-id: ${{ secrets.AZURE_CLIENT_ID }}+ tenant-id: ${{ secrets.AZURE_TENANT_ID }}+ subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}++ # signtool.exe from the newest Windows SDK on the runner (the dlib needs+ # 10.0.2261.755 or later), the Artifact Signing dlib from NuGet, and a+ # metadata file naming the account. forge.config.ts reads the three+ # paths from the environment. Authentication goes through the Azure CLI+ # session from the step above; every other credential source is+ # excluded so a misconfiguration fails fast instead of timing out.+ - name: Set up Artifact Signing+ shell: pwsh+ env:+ ENDPOINT: ${{ vars.ARTIFACT_SIGNING_ENDPOINT }}+ ACCOUNT: ${{ vars.ARTIFACT_SIGNING_ACCOUNT }}+ PROFILE: ${{ vars.ARTIFACT_SIGNING_PROFILE }}+ run: |+ $ErrorActionPreference = "Stop"+ foreach ($name in "ENDPOINT", "ACCOUNT", "PROFILE") {+ if (-not (Get-Item "env:$name").Value) { throw "Repository variable ARTIFACT_SIGNING_$name is not set" }+ }++ $signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.*\x64\signtool.exe" |+ Sort-Object { [version]$_.Directory.Parent.Name } | Select-Object -Last 1+ if (-not $signtool) { throw "signtool.exe not found in the Windows SDK" }++ $dir = Join-Path $env:RUNNER_TEMP "artifact-signing"+ nuget install Microsoft.ArtifactSigning.Client -ExcludeVersion -OutputDirectory $dir+ $dlib = Join-Path $dir "Microsoft.ArtifactSigning.Client\bin\x64\Azure.CodeSigning.Dlib.dll"+ if (-not (Test-Path $dlib)) { throw "Artifact Signing dlib not found at $dlib" }++ $metadata = Join-Path $dir "metadata.json"+ @{+ Endpoint = $env:ENDPOINT+ CodeSigningAccountName = $env:ACCOUNT+ CertificateProfileName = $env:PROFILE+ CorrelationId = "$env:GITHUB_REPOSITORY $env:GITHUB_REF_NAME"+ ExcludeCredentials = @(+ "EnvironmentCredential",+ "WorkloadIdentityCredential",+ "ManagedIdentityCredential",+ "SharedTokenCacheCredential",+ "VisualStudioCredential",+ "VisualStudioCodeCredential",+ "AzurePowerShellCredential",+ "AzureDeveloperCliCredential",+ "InteractiveBrowserCredential"+ )+ } | ConvertTo-Json | Set-Content -Path $metadata -Encoding utf8++ "WINDOWS_SIGNTOOL_PATH=$($signtool.FullName)" >> $env:GITHUB_ENV+ "WINDOWS_SIGN_DLIB=$dlib" >> $env:GITHUB_ENV+ "WINDOWS_SIGN_METADATA=$metadata" >> $env:GITHUB_ENV++ - name: Build, sign, and publish draft release+ shell: bash+ env:+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}+ run: npm run publish --workspace=@diffusionstudio/desktopdiff --git a/README.md b/README.mdindex e31075ae..a32fdacf 100644--- a/README.md+++ b/README.md@@ -7,7 +7,7 @@<p align="center">The professional video editor built for agents</p><p align="center">- <a href="https://www.diffusion.studio/download"><img src="https://img.shields.io/badge/Download-macOS%20Apple%20Silicon-161616?style=flat&logo=apple&logoColor=F8F8F8&labelColor=000000" alt="Download for macOS (Apple Silicon)" /></a>+ <a href="https://www.diffusion.studio/download"><img src="https://img.shields.io/badge/Download-macOS%20%7C%20Windows-161616?style=flat&labelColor=000000" alt="Download for macOS or Windows" /></a><a href="https://discord.com/invite/zPQJrNGuFB"><img src="https://img.shields.io/discord/1115673443141156924?style=flat&logo=discord&logoColor=F8F8F8&label=Discord&labelColor=000000&color=161616" alt="Discord" /></a><a href="https://x.com/diffusionhq"><img src="https://img.shields.io/badge/Follow%20for-Updates-161616?style=flat&logo=x&logoColor=F8F8F8&labelColor=000000" alt="Follow on X" /></a><a href="https://www.ycombinator.com/companies/diffusion-studio"><img src="https://img.shields.io/badge/Combinator-F24-161616?style=flat&logo=ycombinator&logoColor=F8F8F8&labelColor=000000" alt="Y Combinator F24" /></a>@@ -63,9 +63,9 @@ The desktop app includes command-line tools that let agents watch and listen to## Getting started-Download the desktop app, it walks you through setting everything up:+Download the desktop app for macOS (Apple Silicon) or Windows (x64), it walks you through setting everything up:-<a href="https://www.diffusion.studio/download"><img src="https://img.shields.io/badge/Download-Diffusion%20Studio-161616?style=for-the-badge&logo=apple&logoColor=F8F8F8&labelColor=000000" alt="Download Diffusion Studio" /></a>+<a href="https://www.diffusion.studio/download"><img src="https://img.shields.io/badge/Download-Diffusion%20Studio-161616?style=for-the-badge&labelColor=000000" alt="Download Diffusion Studio" /></a>Use with Claude Code, Codex, Cursor, Copilot, or Gemini CLI. The app registers its MCP server with your agent, so just ask for what you want in plain language. Every session's instructions carry the editing and watching skills, so the agent reads the guidance it needs up front. `dapi` is the same set of tools as a CLI.diff --git a/apps/desktop/WINDOWS.md b/apps/desktop/WINDOWS.mdindex a8070340..3652545e 100644--- a/apps/desktop/WINDOWS.md+++ b/apps/desktop/WINDOWS.md@@ -77,6 +77,9 @@ Status: the dev build runs on a Windows machine (2026-09-21), which coverspath uses. The installer has not been built or run yet: tasks 2 to 5 are inplace but unexercised, so `.github/workflows/build-windows.yml`(workflow_dispatch) is the next step, followed by the acceptance checks.+GitHub only lists a manually triggered workflow once its file is on the+default branch, so the workflow file has to reach `main` (a merge, or a+cherry-pick of that one file) before it can be run against this branch.One fix came out of the dev run: `basename` in `packages/assets/src/types.ts`split on `/` only and now handles backslashes and trailing separators. Squirrel's`iconUrl` points at `assets/icon.ico` on `main`, so Add/Remove Programs@@ -374,36 +377,53 @@ Acceptance:Goal: a signed installer that SmartScreen accepts, published by the tagworkflow next to the DMG, updating itself.+Status: everything but the Azure account is in place (2026-09-22) and none+of it has run yet, since signing needs the account. The certificate is+Azure Artifact Signing, the service Microsoft launched as Trusted Signing+and renamed in 2026; the setup is in the next section. Differences from the+tasks as written:+- Signing is `windowsSign` in `forge.config.ts`, on the packager and on the+ Squirrel maker, so the app's executables, the nupkg contents, and+ `Setup.exe` are all signed with the same options: the Windows SDK+ `signtool.exe`, Microsoft's dlib plugin, a metadata file naming the+ account, Microsoft's timestamp authority, SHA-256 only. The three paths+ come from `WINDOWS_SIGNTOOL_PATH`, `WINDOWS_SIGN_DLIB`, and+ `WINDOWS_SIGN_METADATA`; a Windows build without them fails unless+ `SKIP_SIGN=1`, the same rule as `osxSign`. For the Squirrel side,+ `electron-winstaller` swaps its bundled `signtool.exe` for a Node+ single-executable stub that calls `@electron/windows-sign`, which is why+ the maker takes the options object and not a `signWithParams` string.+- `release.yml` has the `publish-windows` job. It signs in to Azure with+ OIDC (`azure/login`, no client secret), installs the dlib from NuGet,+ picks the newest SDK signtool on the runner, writes the metadata file,+ and publishes. It runs after the macOS job so the two do not race to+ create the draft release.+- The site (`desktop-app.ts`) serves `Diffusion-Studio-x64-Setup.exe` on+ Windows and the DMG on macOS; the promos' copy names the platform; the+ README lists both.+- `assets/app.manifest` is Electron 43's own manifest, read out of+ `electron.exe`, plus `longPathAware`. The packager replaces the manifest+ wholesale, so the file has to be refreshed when Electron's changes.+- Windows on ARM gets the x64 installer under emulation; see stage 6.+Tasks:-1. **Certificate.** Options, in order of preference:- - Azure Trusted Signing: cheapest, cloud HSM, no token, works in CI.- Needs an Azure tenant and organization validation.- - OV or EV Authenticode cert on a cloud HSM (DigiCert KeyLocker, SSL.com- eSigner). Also CI-friendly, more expensive.- - A cert on a USB token cannot sign in GitHub Actions.- Ops task; everything below assumes Trusted Signing.-2. **Signing hook** (`forge.config.ts` `packagerConfig.windowsSign`):- configure `@electron/windows-sign` with a custom `signWithParams` (or- the `hookFunction`) that calls the Trusted Signing CLI. Squirrel also- signs `Setup.exe` and the nupkg contents through the maker's- `signWithParams`, so both places take the same command.-3. **Release workflow** (`.github/workflows/release.yml`): add a- `publish-windows` job on `windows-latest` that runs the same version- check, `npm ci`, env copy, and `npm run publish --workspace=@diffusionstudio/desktop`- with the signing secrets. Both jobs publish to the same draft release;- the GitHub publisher appends assets. Squirrel's `RELEASES` file must land- in the release for the updater to work.+1. **Certificate.** Azure Artifact Signing: cheapest, cloud HSM, no token,+ works in CI. Ops task; the next section is the runbook. Alternatives+ would have been an OV or EV cert on a cloud HSM (DigiCert KeyLocker,+ SSL.com eSigner); a cert on a USB token cannot sign in GitHub Actions.+2. **Signing hook** (`forge.config.ts` `windowsSign`): done, see status.+3. **Release workflow** (`.github/workflows/release.yml` `publish-windows`):+ done, see status. Squirrel's `RELEASES` file and the nupkg land in the+ release next to the setup exe; the updater needs all three.4. **Updater** (`main.ts`): `updateElectronApp({ repo })` already covers- Squirrel. Verify it finds `RELEASES` and the nupkg and that the- `--squirrel-updated` hook from stage 2 runs.-5. **Website and README**: `apps/web/src/lib/desktop-app.ts` picks the- setup exe on Windows (name it version-independent, like the DMG, so- `releases/latest/download/` resolves); the README badge and download- copy list Windows. `bump-cask.yml` is macOS-only and stays as is.-6. **Long paths**: add `longPathAware` to the app manifest via the packager's- `win32metadata` options so deep `node_modules` trees in projects do not- hit `MAX_PATH`.+ Squirrel; update.electronjs.org serves `RELEASES` from the release it+ finds for the `.exe` asset. Verify on hardware that the app finds the+ nupkg and that the `--squirrel-updated` hook from stage 2 runs.+5. **Website and README**: done, see status. `bump-cask.yml` is macOS-only+ and stays as is.+6. **Long paths**: done, see status. Windows honours the flag only with the+ `LongPathsEnabled` policy, on by default on Windows 11.Acceptance:- Fresh Windows 11 VM, no dev tools: download from the site, no SmartScreen@@ -412,6 +432,69 @@ Acceptance:background and the next launch is N+1. `dapi` and the Claude Desktopregistration still work after the update.+### Signing setup on Azure++One-time ops work; nothing in the repo changes. The result is four GitHub+secrets and three repository variables that `publish-windows` reads.++1. **Azure.** A Microsoft Entra tenant and a subscription. Register the+ `Microsoft.CodeSigning` resource provider on the subscription+ (Subscriptions, Resource providers, Register; or+ `az provider register --namespace Microsoft.CodeSigning`).+2. **Account.** Create an *Artifact Signing account* (portal search, or+ `az extension add --name artifact-signing` then+ `az artifact-signing create -n <account> -g <group> -l <region> --sku Basic`).+ Basic is enough: 5,000 signatures a month, and a release signs a few+ dozen files. The region fixes the endpoint, one of+ `https://<code>.codesigning.azure.net` (`weu` for West Europe, `neu` for+ North Europe, `eus` for East US, ...); pick one and keep account and+ profile in it, a mismatch is a 403 at signing time.+3. **Roles.** On the account, assign yourself *Artifact Signing Identity+ Verifier* (needed to create the validation below). Assign the CI+ identity from step 5 *Artifact Signing Certificate Profile Signer*.+4. **Identity validation.** Account, Identity validations, New identity,+ Organization, Public. Legal entity name, website, a monitored mailbox on+ the company domain (a verification link arrives there and expires in+ seven days), business identifier (the register number), address, and the+ name of the person who completes the individual check. Microsoft+ validates against public records; one to twenty business days, with+ document requests by email. This is the step to start first; everything+ else can be done while it is pending, and the Public Trust profile below+ cannot be created until it is Completed.+5. **CI identity.** An Entra app registration (Microsoft Entra ID, App+ registrations, New registration, no redirect URI) with a federated+ credential for GitHub Actions: Certificates & secrets, Federated+ credentials, Add credential, scenario "GitHub Actions deploying Azure+ resources", organization `diffusionstudio`, repository `editor`, entity+ type Environment, environment name `release`. The job declares+ `environment: release`, which is what puts that subject in its OIDC+ token; a tag name would change with every release, an environment does+ not. Create the `release` environment under the repository's Settings,+ Environments (no protection rules needed). No client secret is created;+ the workflow's `id-token: write` permission is the credential.+6. **Certificate profile.** Account, Certificate profiles, Create, Public+ Trust, pick the validated identity. The profile name is the value+ `CertificateProfileName` in the metadata. Certificates are issued per+ signature and live three days, which is why every signature is+ timestamped.+7. **GitHub.** Secrets: `AZURE_TENANT_ID`, `AZURE_CLIENT_ID` (the app+ registration's application ID), `AZURE_SUBSCRIPTION_ID`. Variables:+ `ARTIFACT_SIGNING_ENDPOINT` (the regional URL), `ARTIFACT_SIGNING_ACCOUNT`,+ `ARTIFACT_SIGNING_PROFILE`. `GITHUB_TOKEN` is the fourth secret and is+ automatic.+8. **Check before the first tag.** Run the workflow's signing steps by+ hand on any Windows machine with the Azure CLI signed in as a user who+ has the Signer role: `nuget install Microsoft.ArtifactSigning.Client -x`,+ write the metadata file, then+ `signtool sign /fd SHA256 /tr http://timestamp.acs.microsoft.com /td SHA256 /dlib <dlib> /dmdf <metadata> <any exe>`+ and `signtool verify /pa /v <exe>`. The subject should read the legal+ entity from step 4.++SmartScreen reputation is separate from the signature. Public Trust+certificates from Artifact Signing start with reputation carried over from+Microsoft's validation, so the warning normally does not appear, but a brand+new publisher can still see it for the first downloads.+## Stage 6: dev workflow and polishGoal: developing on a Windows machine is as easy as on macOS, and the app@@ -427,7 +510,13 @@ on Windows on 2026-09-22. A terminal only sees the new PATH when its parentprocess started after the change: one opened from VS Code inherits VS Code'senvironment until VS Code is restarted, which is why the script says to opena new terminal. Task 3 (Mica) was-tried and dropped, see below. Tasks 4 and 5 are open.+tried and dropped, see below. Tasks 4 and 5 are open. arm64 has one+constraint beyond a matrix entry: update.electronjs.org reads a single+`RELEASES` file from each release for every Windows architecture, so a+second Squirrel output needs either its own release tag or a different+update feed; the x64 installer runs under emulation on Windows on ARM in+the meantime. winget waits for the first signed release, since the manifest+carries the installer's hash.Mica, tried on Windows on 2026-09-21 and reverted: the window stays solid.The material worked with `titleBarStyle: "hidden"` and a transparentdiff --git a/apps/desktop/assets/app.manifest b/apps/desktop/assets/app.manifestnew file mode 100644index 00000000..560a8a32--- /dev/null+++ b/apps/desktop/assets/app.manifest@@ -0,0 +1,46 @@+<?xml version="1.0" encoding="UTF-8"?>+<!--+ Application manifest embedded into "Diffusion Studio.exe" on Windows+ (win32metadata['application-manifest'] in forge.config.ts). The packager+ replaces Electron's own manifest wholesale, so this is Electron 43's+ manifest (read out of electron.exe) plus one addition: longPathAware, which+ lets the app open project folders whose paths exceed MAX_PATH, such as+ deep node_modules trees. Windows honours it only when the LongPathsEnabled+ policy is on, which it is on Windows 11 by default. Keep the rest in step+ with Electron when the Electron version changes.+-->+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">+ <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">+ <disableWindowFiltering xmlns="http://schemas.microsoft.com/SMI/2011/WindowsSettings">true</disableWindowFiltering>+ </asmv3:windowsSettings>+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">+ <dpiAware>true/pm</dpiAware>+ </asmv3:windowsSettings>+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">+ <longPathAware>true</longPathAware>+ </asmv3:windowsSettings>+ </asmv3:application>+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">+ <security>+ <requestedPrivileges>+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>+ </requestedPrivileges>+ </security>+ </trustInfo>+ <dependency>+ <dependentAssembly>+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>+ </dependentAssembly>+ </dependency>+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">+ <application>+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>+ <maxversiontested Id="10.0.18362.0"/>+ </application>+ </compatibility>+</assembly>diff --git a/apps/desktop/forge.config.ts b/apps/desktop/forge.config.tsindex 881ad49f..a0161753 100644--- a/apps/desktop/forge.config.ts+++ b/apps/desktop/forge.config.ts@@ -2,7 +2,6 @@* 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 type { ForgeConfig } from '@electron-forge/shared-types';import { MakerDMG } from '@electron-forge/maker-dmg';import { MakerSquirrel } from '@electron-forge/maker-squirrel';import { MakerZIP } from '@electron-forge/maker-zip';@@ -10,8 +9,14 @@ import { PublisherGithub } from '@electron-forge/publisher-github';import { readFileSync } from 'node:fs';import { join } from 'node:path';+import type { ForgeConfig } from '@electron-forge/shared-types';+import type { MakerSquirrelConfig } from '@electron-forge/maker-squirrel';+const { version } = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf8'));++const sign = windowsSign();+const config: ForgeConfig = {packagerConfig: {name: 'Diffusion Studio',@@ -23,6 +28,7 @@ const config: ForgeConfig = {CompanyName: 'Diffusion Studio',ProductName: 'Diffusion Studio',FileDescription: 'Diffusion Studio',+ 'application-manifest': join(__dirname, 'assets', 'app.manifest'),},protocols: [{ name: 'Diffusion Studio', schemes: ['diffusion'] }],prune: false,@@ -40,11 +46,12 @@ const config: ForgeConfig = {osxNotarize:process.env.APPLE_ID && process.env.APPLE_PASSWORD && process.env.APPLE_TEAM_ID? {- appleId: process.env.APPLE_ID,- appleIdPassword: process.env.APPLE_PASSWORD,- teamId: process.env.APPLE_TEAM_ID,- }+ appleId: process.env.APPLE_ID,+ appleIdPassword: process.env.APPLE_PASSWORD,+ teamId: process.env.APPLE_TEAM_ID,+ }: undefined,+ windowsSign: sign,},makers: [new MakerZIP({}, ['darwin']),@@ -57,6 +64,7 @@ const config: ForgeConfig = {// Shown by Add/Remove Programs; Squirrel only takes a URL.iconUrl: 'https://raw.githubusercontent.com/diffusionstudio/editor/main/apps/desktop/assets/icon.ico',noMsi: true,+ windowsSign: sign,}),new MakerDMG({name: `Diffusion-Studio-${process.arch}`,@@ -82,4 +90,32 @@ const config: ForgeConfig = {],};+++function windowsSign() {+ if (process.platform !== 'win32' || process.env.SKIP_SIGN) {+ return undefined;+ }++ const {+ WINDOWS_SIGNTOOL_PATH: signToolPath,+ WINDOWS_SIGN_DLIB: dlib,+ WINDOWS_SIGN_METADATA: metadata+ } = process.env;++ if (!signToolPath || !dlib || !metadata) {+ throw new Error(+ 'Windows signing needs WINDOWS_SIGNTOOL_PATH, WINDOWS_SIGN_DLIB and WINDOWS_SIGN_METADATA; set SKIP_SIGN=1 for an unsigned build.',+ );+ }++ return {+ signToolPath,+ automaticallySelectCertificate: false,+ signWithParams: ['/dlib', dlib, '/dmdf', metadata],+ timestampServer: 'http://timestamp.acs.microsoft.com',+ hashes: ['sha256'],+ } as unknown as MakerSquirrelConfig;+}+export default config;diff --git a/apps/web/src/components/canvas/desktop-app-banner.tsx b/apps/web/src/components/canvas/desktop-app-banner.tsxindex 5db091c6..3e1cc99a 100644--- a/apps/web/src/components/canvas/desktop-app-banner.tsx+++ b/apps/web/src/components/canvas/desktop-app-banner.tsx@@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button";import { Icon } from "@/components/ui/icon";import { useEditorApi } from "@/dapi";import { createStoredSignal } from "@/lib/store";-import { downloadDesktopApp } from "@/lib/desktop-app";+import { desktopAppDownloadLabel, downloadDesktopApp } from "@/lib/desktop-app";import { track } from "@/lib/analytics";import { store } from "@/init";@@ -57,7 +57,7 @@ export function DesktopAppBanner() {</p></div><Button variant="secondary" class="w-full" onClick={handleDownload}>- Download for macOS+ {desktopAppDownloadLabel()}</Button></div></div>diff --git a/apps/web/src/components/dashboard/get-desktop-app.tsx b/apps/web/src/components/dashboard/get-desktop-app.tsxindex b060832a..fd7eb069 100644--- a/apps/web/src/components/dashboard/get-desktop-app.tsx+++ b/apps/web/src/components/dashboard/get-desktop-app.tsx@@ -11,7 +11,7 @@ import {ContextMenuPortal,ContextMenuTrigger,} from "@/components/ui/context-menu";-import { downloadDesktopApp } from "@/lib/desktop-app";+import { desktopAppDownloadLabel, downloadDesktopApp } from "@/lib/desktop-app";import { createStoredSignal } from "@/lib/store";import { track } from "@/lib/analytics";import { store } from "@/init";@@ -46,13 +46,13 @@ export function DashboardGetDesktopApp() {<div class="flex min-w-0 flex-1 flex-col gap-0.5"><p class="text-xs font-450 leading-4 text-foreground">Get desktop app</p><p class="text-xxs leading-3.5 text-muted-foreground">- The Mac app lets Claude Code, Codex, and any coding agents work with your footage- and project.+ The desktop app lets Claude Code, Codex, and any coding agents work with your+ footage and project.</p></div></div><Button variant="secondary" onClick={() => downloadDesktopApp("dashboard_footer")}>- Download for macOS+ {desktopAppDownloadLabel()}</Button></ContextMenuTrigger><ContextMenuPortal>diff --git a/apps/web/src/components/sidebar-left/project-menu/index.tsx b/apps/web/src/components/sidebar-left/project-menu/index.tsxindex 716c3692..66d3f0e3 100644--- a/apps/web/src/components/sidebar-left/project-menu/index.tsx+++ b/apps/web/src/components/sidebar-left/project-menu/index.tsx@@ -20,7 +20,7 @@ import { useLocation, useNavigate } from "@solidjs/router";import { Show, onCleanup, onMount } from "solid-js";import { isInputTarget } from "@/utils";import { useEditorApi } from "@/dapi";-import { downloadDesktopApp } from "@/lib/desktop-app";+import { desktopAppPlatformLabel, downloadDesktopApp } from "@/lib/desktop-app";import type { ProjectRouteState } from "@/hooks/use-project-route";import { FileMenu } from "./file-menu";import { EditMenu } from "./edit-menu";@@ -158,7 +158,7 @@ export function ProjectMenu() {<span class="grid h-7 w-6 shrink-0 place-items-center overflow-clip"><Icon name="download" class="size-6" /></span>- Get desktop app (macOS)+ Get desktop app{desktopAppPlatformLabel() ? ` (${desktopAppPlatformLabel()})` : ""}</DropdownMenuItem></DropdownMenuGroup></Show>diff --git a/apps/web/src/lib/desktop-app.ts b/apps/web/src/lib/desktop-app.tsindex 7c460b92..ca78c233 100644--- a/apps/web/src/lib/desktop-app.ts+++ b/apps/web/src/lib/desktop-app.ts@@ -7,43 +7,66 @@ import { toast } from "somoto";import { track } from "@/lib/analytics";/**- * Electron Forge only makes darwin artifacts, so releases are macOS-only, and- * the DMG name is version-independent (see `MakerDMG` in `forge.config.ts`) —- * which is what lets GitHub's `/releases/latest/download/` alias resolve to the- * newest build.+ * The asset names are version-independent (see the makers in+ * `forge.config.ts`), which is what lets GitHub's `/releases/latest/download/`+ * alias resolve to the newest build.*/-const DOWNLOAD_URL =- "https://github.com/diffusionstudio/editor/releases/latest/download/Diffusion-Studio-arm64.dmg";+const RELEASES = "https://github.com/diffusionstudio/editor/releases/latest/download/";++const DOWNLOADS = {+ macos: { url: `${RELEASES}Diffusion-Studio-arm64.dmg`, label: "macOS" },+ windows: { url: `${RELEASES}Diffusion-Studio-x64-Setup.exe`, label: "Windows" },+} as const;++export type DesktopAppPlatform = keyof typeof DOWNLOADS;/** Where a download was started from, so the promos can be compared. */export type DesktopAppDownloadSource = "canvas_banner" | "dashboard_footer" | "main_menu" | "chat_panel";-function isMacOS() {+/** The platform the desktop app is built for that this browser runs on, if any. */+export function desktopAppPlatform(): DesktopAppPlatform | null {const uaData = (navigator as { userAgentData?: { platform?: string } }).userAgentData;- return /mac/i.test(uaData?.platform ?? navigator.platform);+ const platform = uaData?.platform ?? navigator.platform;+ if (/mac/i.test(platform)) return "macos";+ if (/win/i.test(platform)) return "windows";+ return null;+}++/** "macOS" or "Windows" for the promos' copy, null where there is no build. */+export function desktopAppPlatformLabel(): string | null {+ const platform = desktopAppPlatform();+ return platform ? DOWNLOADS[platform].label : null;+}++/** Button copy for the promos: names the platform when there is a build for it. */+export function desktopAppDownloadLabel(): string {+ const label = desktopAppPlatformLabel();+ return label ? `Download for ${label}` : "Download desktop app";}/**- * Pulls the latest DMG. GitHub serves the asset with `Content-Disposition:- * attachment`, so this starts a download rather than navigating away.+ * Pulls the latest installer for this platform. GitHub serves the asset with+ * `Content-Disposition: attachment`, so this starts a download rather than+ * navigating away.*- * The promos run on every platform to gauge interest, but there is only a- * macOS build to hand out — everywhere else this explains that instead.+ * The promos run on every platform to gauge interest, but there are only+ * macOS and Windows builds to hand out — everywhere else this explains that+ * instead.*/export function downloadDesktopApp(source: DesktopAppDownloadSource) {- const supported = isMacOS();- track("desktop_app_download", { source, supported });+ const platform = desktopAppPlatform();+ track("desktop_app_download", { source, supported: platform !== null, platform: platform ?? "other" });- if (!supported) {- toast("Available for macOS only", {+ if (!platform) {+ toast("Available for macOS and Windows", {description:- "The desktop app currently ships as a macOS build. Open Diffusion Studio on a Mac to install it.",+ "The desktop app ships for macOS and Windows. Open Diffusion Studio on one of those to install it.",});return;}const a = document.createElement("a");- a.href = DOWNLOAD_URL;+ a.href = DOWNLOADS[platform].url;a.download = "";document.body.appendChild(a);a.click();