Skip to content

Commit be4e2e7

Browse files
feat(cli): hyperframes open hands the project to the app on Windows and Linux too (#6484)
1 parent 75bee42 commit be4e2e7

2 files changed

Lines changed: 30 additions & 7 deletions

File tree

‎packages/cli/src/utils/desktopApp.test.ts‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
1414
import { readSeen } from "./appHistory.js";
1515
import {
1616
AGENT_HANDOFF_FILE,
17-
HANDOFF_READY,
1817
agentSession,
1918
desktopHint,
2019
desktopInstalled,
2120
openCommandFor,
2221
openInDesktop,
2322
} from "./desktopApp.js";
2423

25-
// The live path (ready) is what ships once the app takes handed-over folders; CI exercises it here.
2624
const LIVE = { ready: true, platform: "darwin" as const, env: {}, installed: () => true };
2725
const MAC_DOWNLOAD = "https://hyperframes.dev/studio/download?src=cli";
2826
const MAC_HINT = `Keep editing by chatting with Framey in the HyperFrames desktop app → ${MAC_DOWNLOAD}`;
@@ -33,15 +31,41 @@ const never = () => {
3331

3432
describe("openInDesktop", () => {
3533
it("opens and writes nothing while the app cannot take a project", () => {
36-
// Only the Mac app reads a handed-over folder in a released build so far.
37-
expect(HANDOFF_READY).toBe(process.platform === "darwin");
3834
expect(openInDesktop(FILM, { ready: false, platform: "darwin", open: never })).toEqual({
3935
opened: false,
4036
reason: "handoff-unavailable",
4137
downloadUrl: MAC_DOWNLOAD,
4238
});
4339
});
4440

41+
it("hands the folder to the Windows app on its command line, with no override", () => {
42+
const launched: string[] = [];
43+
const result = openInDesktop(FILM, {
44+
platform: "win32",
45+
env: { LOCALAPPDATA: "C:\\Users\\a\\AppData\\Local" },
46+
exists: () => true,
47+
launch: (executable, dir) => (launched.push(`${executable} ${dir}`), true),
48+
});
49+
expect(result).toMatchObject({ opened: true, app: "the HyperFrames desktop app" });
50+
expect(launched).toEqual([
51+
`C:\\Users\\a\\AppData\\Local\\Programs\\HyperFrames\\HyperFrames.exe ${FILM}`,
52+
]);
53+
});
54+
55+
it("hands the folder to the Linux AppImage on its command line, with no override", () => {
56+
const launched: string[] = [];
57+
const result = openInDesktop(FILM, {
58+
platform: "linux",
59+
env: {},
60+
home: "/home/a",
61+
exists: () => true,
62+
read: () => JSON.stringify({ appImage: "/opt/HyperFrames.AppImage" }),
63+
launch: (executable, dir) => (launched.push(`${executable} ${dir}`), true),
64+
});
65+
expect(result).toMatchObject({ opened: true, app: "the HyperFrames desktop app" });
66+
expect(launched).toEqual([`/opt/HyperFrames.AppImage ${FILM}`]);
67+
});
68+
4569
it("hands the folder to the released app when it is installed", () => {
4670
const asked: string[] = [];
4771
const result = openInDesktop(FILM, {

‎packages/cli/src/utils/desktopApp.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ export const desktopDownloadUrl = (
3535
export const downloadHint = (url: string): string =>
3636
`Keep editing by chatting with Framey in the HyperFrames desktop app → ${url}`;
3737

38-
// ponytail: the Mac app takes a handed-over folder since b254 (hyperframes-internal#2601); Windows and Linux join
39-
// once its folder-argv change ships. Until then every surface offers the download and writes no hand-off.
40-
export const HANDOFF_READY = process.platform === "darwin";
38+
// Every build of the app takes a handed-over folder: macOS as open-file, Windows and Linux on their command line.
39+
export const HANDOFF_READY = true;
4140

4241
export interface AgentSession {
4342
engine: "claude" | "codex" | "grok";

0 commit comments

Comments
 (0)