From be4e2e78065b6f3a117ada200de11c35701447ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Mon, 26 Oct 2026 23:01:07 +0000 Subject: [PATCH] feat(cli): hyperframes open hands the project to the app on Windows and Linux too (#6484) --- packages/cli/src/utils/desktopApp.test.ts | 32 ++++++++++++++++++++--- packages/cli/src/utils/desktopApp.ts | 5 ++-- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/utils/desktopApp.test.ts b/packages/cli/src/utils/desktopApp.test.ts index e30f075e59..5c4e24cc56 100644 --- a/packages/cli/src/utils/desktopApp.test.ts +++ b/packages/cli/src/utils/desktopApp.test.ts @@ -14,7 +14,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { readSeen } from "./appHistory.js"; import { AGENT_HANDOFF_FILE, - HANDOFF_READY, agentSession, desktopHint, desktopInstalled, @@ -22,7 +21,6 @@ import { openInDesktop, } from "./desktopApp.js"; -// The live path (ready) is what ships once the app takes handed-over folders; CI exercises it here. const LIVE = { ready: true, platform: "darwin" as const, env: {}, installed: () => true }; const MAC_DOWNLOAD = "https://hyperframes.dev/studio/download?src=cli"; const MAC_HINT = `Keep editing by chatting with Framey in the HyperFrames desktop app → ${MAC_DOWNLOAD}`; @@ -33,8 +31,6 @@ const never = () => { describe("openInDesktop", () => { it("opens and writes nothing while the app cannot take a project", () => { - // Only the Mac app reads a handed-over folder in a released build so far. - expect(HANDOFF_READY).toBe(process.platform === "darwin"); expect(openInDesktop(FILM, { ready: false, platform: "darwin", open: never })).toEqual({ opened: false, reason: "handoff-unavailable", @@ -42,6 +38,34 @@ describe("openInDesktop", () => { }); }); + it("hands the folder to the Windows app on its command line, with no override", () => { + const launched: string[] = []; + const result = openInDesktop(FILM, { + platform: "win32", + env: { LOCALAPPDATA: "C:\\Users\\a\\AppData\\Local" }, + exists: () => true, + launch: (executable, dir) => (launched.push(`${executable} ${dir}`), true), + }); + expect(result).toMatchObject({ opened: true, app: "the HyperFrames desktop app" }); + expect(launched).toEqual([ + `C:\\Users\\a\\AppData\\Local\\Programs\\HyperFrames\\HyperFrames.exe ${FILM}`, + ]); + }); + + it("hands the folder to the Linux AppImage on its command line, with no override", () => { + const launched: string[] = []; + const result = openInDesktop(FILM, { + platform: "linux", + env: {}, + home: "/home/a", + exists: () => true, + read: () => JSON.stringify({ appImage: "/opt/HyperFrames.AppImage" }), + launch: (executable, dir) => (launched.push(`${executable} ${dir}`), true), + }); + expect(result).toMatchObject({ opened: true, app: "the HyperFrames desktop app" }); + expect(launched).toEqual([`/opt/HyperFrames.AppImage ${FILM}`]); + }); + it("hands the folder to the released app when it is installed", () => { const asked: string[] = []; const result = openInDesktop(FILM, { diff --git a/packages/cli/src/utils/desktopApp.ts b/packages/cli/src/utils/desktopApp.ts index 4db40e6b2b..a0ecaf9632 100644 --- a/packages/cli/src/utils/desktopApp.ts +++ b/packages/cli/src/utils/desktopApp.ts @@ -35,9 +35,8 @@ export const desktopDownloadUrl = ( export const downloadHint = (url: string): string => `Keep editing by chatting with Framey in the HyperFrames desktop app → ${url}`; -// ponytail: the Mac app takes a handed-over folder since b254 (hyperframes-internal#2601); Windows and Linux join -// once its folder-argv change ships. Until then every surface offers the download and writes no hand-off. -export const HANDOFF_READY = process.platform === "darwin"; +// Every build of the app takes a handed-over folder: macOS as open-file, Windows and Linux on their command line. +export const HANDOFF_READY = true; export interface AgentSession { engine: "claude" | "codex" | "grok";