feat(cli): hyperframes open hands the project to the app on Windows and Linux too (#6484)

This commit is contained in:
Miguel Ángel
2026-10-26 23:01:07 +00:00
committed by GitHub
parent 75bee42919
commit be4e2e7806
2 changed files with 30 additions and 7 deletions
+28 -4
View File
@@ -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, {
+2 -3
View File
@@ -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";