Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
af05581
Add the Home, device rail and start-anywhere PRD
yansfil Sep 29, 2026
83df191
Remember the agent kind and model every start uses
yansfil Sep 29, 2026
5120d3a
Keep each device's Home folder in step with its projects
yansfil Sep 29, 2026
e1572ba
Read the model catalog while a start surface shows it
yansfil Sep 29, 2026
39a91b8
Start agents in each device's Home and in device checkouts
yansfil Sep 29, 2026
4fb93bc
Document Home, the one start path and the start catalog demand
yansfil Sep 29, 2026
82226e2
Hand the first prompt to the agent CLI as its own argument
yansfil Sep 29, 2026
c4df75d
Start an agent from the phone's start sheet
yansfil Sep 29, 2026
6ba472f
Draw Home, the device rail and the start surfaces in the design files
yansfil Sep 29, 2026
c5b313a
Put each device's Home, a device rail and one start panel in the web …
yansfil Sep 29, 2026
1f7daee
Describe Home, the device rail and the start panel in UI behavior
yansfil Sep 29, 2026
85de995
Send the remembered model as it is, and keep fixture paths neutral
yansfil Sep 29, 2026
0230414
Show a refused Home tab under the Home row
yansfil Sep 29, 2026
0cc2baa
List devices in the palette only beside another device, and drop a ph…
yansfil Sep 29, 2026
b562e0d
Say where a refused Home tab and the palette's device rows show
yansfil Sep 29, 2026
e24b279
Merge remote-tracking branch 'origin/main' into prd/home-device-rail
yansfil Sep 29, 2026
1d61abc
Run one Home's syncs one after the other and link the first change af…
yansfil Sep 29, 2026
98a0330
Start with a new request id after the phone's start is refused
yansfil Sep 29, 2026
8e479bc
Say when Home links are sent and that one Home's syncs run in turn
yansfil Sep 29, 2026
3606935
Never type a first prompt into the pane
yansfil Sep 29, 2026
9560493
Wait longer for a start's answer, and let a phone repeat after a time…
yansfil Sep 29, 2026
5c1381e
Refuse a start that names no place or two
yansfil Sep 29, 2026
776fcdb
Open the start panel in Settings' place with the front device's Home
yansfil Sep 29, 2026
deb47ee
Keep one odd project from failing Home, and keep Home owner-only
yansfil Sep 29, 2026
0bdde67
Leave a linked folder Herdr cannot pass out of a Home agent's roots
yansfil Sep 29, 2026
456c332
Pin the fixture folder by its row and count the Start agent shortcut
yansfil Sep 29, 2026
31ecd4d
Name a Home tab's path Home / ~/hide
yansfil Sep 29, 2026
1abe54c
Document the start panel over Settings and the 90 s start answer
yansfil Sep 29, 2026
bdd96f6
Add a desktop e2e for a device's Home and the device rail over SSH
yansfil Sep 29, 2026
ba9966c
Cap the first prompt at 256 KB
yansfil Sep 29, 2026
ecd8d94
Keep the provider's catalog error text off the phone
yansfil Sep 29, 2026
d2b6d41
Skip a project with a control character in its path from Home
yansfil Sep 29, 2026
62599a1
Remember an explicit CLI default as the next start's model
yansfil Sep 29, 2026
2119425
End the Inbox selection with the device rail
yansfil Sep 29, 2026
f31d84c
Say only the pane is kept when an agent start in place fails
yansfil Sep 29, 2026
5c495c9
Send a Home link change the helper missed once it is ready
yansfil Sep 29, 2026
4648668
Format the new Home and phone catalog tests
yansfil Sep 29, 2026
b053e0d
Merge remote-tracking branch 'origin/main' into prd/home-device-rail
yansfil Sep 29, 2026
6fcbec2
Refuse a first prompt the command line cannot carry before anything o…
yansfil Sep 29, 2026
4a83e63
Settle Home link syncs across a down helper, reordering and a held lock
yansfil Sep 29, 2026
13feb6e
Check Home's files once its tab has opened
yansfil Sep 29, 2026
3c9e2cc
Merge remote-tracking branch 'origin/main' into prd/home-device-rail
yansfil Sep 29, 2026
ba9da0b
Merge main and preserve Home and device kit behavior
yansfil Sep 29, 2026
b7bc34c
Align Home rail checks with device kit consent
yansfil Sep 29, 2026
29279d5
Stabilize GitHub timeout test under parallel load
yansfil Sep 29, 2026
67eb585
Merge main Git refresh with device scoped Home
yansfil Sep 29, 2026
fc478d3
Wait for recorded lineage reconciliation in E2E
yansfil Sep 29, 2026
b9e6c77
Wait for mobile exposure in restart test
yansfil Sep 29, 2026
a56bf37
Give new Herdr workspaces the E2E agent shim
yansfil Sep 29, 2026
6039e9b
Merge main into home device rail
yansfil Sep 29, 2026
9b14479
Merge main brand update into home device rail
yansfil Sep 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions agents/prd/home-device-rail/prd.md

Large diffs are not rendered by default.

49,810 changes: 36,772 additions & 13,038 deletions design/hide-screens.pen

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions design/hide-ui.lib.pen
Original file line number Diff line number Diff line change
Expand Up @@ -35894,6 +35894,24 @@
"type": "number",
"value": 44
},
"--device-remote": {
"type": "color",
"value": [
{
"value": "#A78BFA"
},
{
"value": "#C4B5FD",
"theme": {
"Mode": "Dark"
}
}
]
},
"--size-rail": {
"type": "number",
"value": 52
},
"--size-disk-sheet": {
"type": "number",
"value": 1160
Expand Down
8 changes: 8 additions & 0 deletions design/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@
"value": "#FDBA74",
"light": "#FB923C"
},
"--device-remote": {
"type": "alias",
"value": "--accent-choice-violet"
},
"--warning": {
"type": "color",
"value": "#FFB847",
Expand Down Expand Up @@ -574,6 +578,10 @@
"type": "number",
"value": 69
},
"--size-rail": {
"type": "number",
"value": 52
},
"--size-pane-header": {
"type": "number",
"value": 28
Expand Down
2 changes: 1 addition & 1 deletion desktop/e2e/add-project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ test("Add a project picks a folder with the native picker, and a cancel or a ref
await expect(dialog).toHaveCount(0);

// The Overview's Add project opens the same dialog, and its × closes it.
await page.locator("[data-overview-destination]").click();
await page.locator("[data-home-destination]").click();
await page.locator("[data-main-add-project]").click();
await expect(dialog).toBeVisible();
await captureWindow(app, page, "add-project-dialog");
Expand Down
215 changes: 215 additions & 0 deletions desktop/e2e/device-home.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
// A device's Home and the device rail over real SSH (PRD home-device-rail
// B1, B2, B4, B10, B12, B15, B18, B25, B38, B46). Run with an isolated sshd
// whose port, key and known_hosts are supplied in HIDE_E2E_SSH_*, and whose
// sessions get HIDE_E2E_DEVICE_HOME as HOME, so the device's `~/hide` is made
// there and never in the account's own home. Both Herdr servers, the daemon,
// the helper install and the desktop profile stay private; the agent is the
// fixture's `claude` shim.

import { expect, type ElectronApplication, type Page } from "@playwright/test";
import { execFileSync, spawn } from "node:child_process";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { startHerdr, type HerdrFixture } from "../../web/e2e/herdr-fixture";
import { enterWorkspace } from "../../web/e2e/wire";
import { HIDE_CLI, isolate, relaunch, shellPage, test } from "./fixture";

test.describe.configure({ timeout: 300_000 });
test.skip(!process.env.HIDE_E2E_SSH_PORT || !process.env.HIDE_E2E_DEVICE_HOME, "an isolated SSH server with its own session HOME is required");

const DEVICE = "mini-e2e";
// B46: a long Korean name on the rail tile, the header line and the band.
const DEVICE_LABEL = "연구실 빌드 서버 맥미니";

async function sendFrame(page: Page, state: { port: number; token: string }, frame: Record<string, unknown>): Promise<void> {
await page.evaluate(async ({ port, token, frame }) => {
await new Promise<void>((resolve, reject) => {
const ws = new WebSocket(`ws://127.0.0.1:${port}/ws`);
const timer = setTimeout(() => reject(new Error("frame timed out")), 10_000);
ws.onerror = () => { clearTimeout(timer); reject(new Error("frame socket failed")); };
ws.onopen = () => ws.send(JSON.stringify({ token, schema_version: 2 }));
ws.onmessage = () => {
ws.send(JSON.stringify({ schema_version: 2, ...frame }));
clearTimeout(timer); ws.close(); resolve();
};
});
}, { ...state, frame });
}

/** The device Herdr's pane whose process line carries `text`, with that line. */
function paneRunning(herdr: HerdrFixture, text: string): { pane: string; info: string } | null {
const snapshot = JSON.stringify(herdr.run(["api", "snapshot"]));
const panes = new Set([...snapshot.matchAll(/"pane_id":"([^"]+)"/g)].map((match) => match[1]!));
for (const pane of panes) {
let info = "";
try {
info = execFileSync(herdr.bin, ["pane", "process-info", "--pane", pane], { env: herdr.env, encoding: "utf8", timeout: 10_000 });
} catch {
continue;
}
if (info.includes(text)) return { pane, info };
}
return null;
}

async function openStartPanel(page: Page): Promise<void> {
await page.keyboard.press("Meta+KeyK");
await expect(page.locator('[data-palette="Search"] [data-palette-input]')).toBeFocused();
await page.keyboard.type("에이전트");
await page.locator('[data-palette-row="command:start-agent"]').click();
await expect(page.locator("[data-start-panel]")).toBeVisible();
await expect(page.locator("[data-start-text]")).toBeFocused();
}

/** Submits the start panel and waits until it closes; a refusal fails the test with its reason. */
async function submitStart(page: Page): Promise<void> {
await page.locator("[data-start-submit]").click();
const panel = page.locator("[data-start-panel]");
const failure = panel.locator("[data-start-failure]");
await expect
.poll(async () => ((await failure.count()) > 0 ? `refused: ${await failure.innerText()}` : (await panel.count()) === 0 ? "closed" : "open"), { timeout: 90_000 })
.toBe("closed");
}

async function chooseTarget(page: Page, option: string): Promise<void> {
await page.locator("[data-start-panel] [data-start-target]").click();
await page.locator(option).first().click();
}

/** The window as macOS draws it, in Light and Dark, when a run directory is named. */
async function capture(page: Page, app: ElectronApplication, name: string): Promise<void> {
const dir = process.env.HIDE_E2E_SCREENSHOT_DIR;
if (!dir) return;
fs.mkdirSync(dir, { recursive: true });
const source = await app.evaluate(({ BrowserWindow }) => BrowserWindow.getAllWindows()[0]!.getMediaSourceId());
for (const theme of ["dark", "light"] as const) {
await page.locator("[data-open-settings]").click();
await page.locator('[data-settings-tab="appearance"]').click();
await page.locator(`[data-theme-option="${theme}"]`).click();
await expect(page.locator("html")).toHaveClass(new RegExp(`\\b${theme}\\b`));
await page.keyboard.press("Escape");
await expect(page.locator('[data-settings="true"]')).toHaveCount(0);
await page.waitForTimeout(400);
execFileSync("/usr/sbin/screencapture", ["-x", "-o", "-l", source.split(":")[1]!, path.join(dir, `${name}-${theme}.png`)]);
}
}

test("a device's Home is made on its first start, the rail follows registration, and a device start lands on that device", async () => {
const deviceHome = process.env.HIDE_E2E_DEVICE_HOME!;
const local = await startHerdr({ agents: false });
const device = await startHerdr({ agents: false });
// The device's panes find the fixture's `claude` shim before anything else.
fs.writeFileSync(path.join(device.root, "home", ".zshenv"), `skip_global_compinit=1\nexport PATH="${path.join(device.root, "bin")}:$PATH"\n`);
// The device's `herdr` is the pinned binary, found where hide looks for it on a device.
fs.mkdirSync(path.join(deviceHome, ".local", "bin"), { recursive: true });
fs.rmSync(path.join(deviceHome, ".local", "bin", "herdr"), { force: true });
fs.symlinkSync(device.bin, path.join(deviceHome, ".local", "bin", "herdr"));
const run = isolate(local, "device-home");
const bridge = fs.mkdtempSync("/tmp/hide-dh-");
run.env.HIDE_WORKSPACE_BRIDGE_DIR = bridge;
run.env.HIDE_HOST_HELPER_ROOT = path.join(run.root, "remote-helper");
run.env.HIDE_HOST_CLI_DIR = path.join(run.root, "remote-bin");
run.env.PATH = `${path.join(local.root, "bin")}:${run.env.PATH ?? "/usr/bin:/bin"}`;
const ssh = path.join(run.env.HOME!, ".ssh");
fs.mkdirSync(ssh, { recursive: true });
fs.copyFileSync(process.env.HIDE_E2E_SSH_KNOWN_HOSTS!, path.join(ssh, "known_hosts"));
fs.writeFileSync(path.join(ssh, "config"), [
"Host isolated-device", " HostName 127.0.0.1", ` Port ${process.env.HIDE_E2E_SSH_PORT}`,
` User ${os.userInfo().username}`, ` IdentityFile ${process.env.HIDE_E2E_SSH_KEY}`, " IdentityAgent none", "",
].join("\n"), { mode: 0o600 });
const daemonLog = path.join(run.root, "daemon.log");
const daemonOutput = fs.openSync(daemonLog, "w");
const daemon = spawn(path.join(path.dirname(HIDE_CLI), "hided"), [], { env: run.env, stdio: ["ignore", daemonOutput, daemonOutput] });
fs.closeSync(daemonOutput);
let app: ElectronApplication | undefined;
try {
await expect.poll(() => run.hide(["status", "--json"]).stdout.includes('"running":true'), { timeout: 30_000 }).toBe(true);
// The app attaches to the daemon already running, so the window is read through the main process.
app = await relaunch(run.env);
const page = await shellPage(app);
await enterWorkspace(page, "fixture");
const nav = page.locator("nav[data-sidebar]");

// B11: one device, no rail; the Home row and the footer device button.
await expect(nav).toHaveAttribute("data-sidebar-rail", "none");
await expect(page.locator("[data-home-destination]")).toBeVisible();
await expect(page.locator("[data-footer-device]")).toBeVisible();
await capture(page, app, "device-home-one-device");

const state = JSON.parse(fs.readFileSync(path.join(run.env.HIDE_STATE_DIR!, "hided.json"), "utf8")) as { port: number; token: string };
await sendFrame(page, state, { kind: "register_device", payload: {
id: DEVICE, label: DEVICE_LABEL, ssh_alias: "isolated-device", herdr_socket_path: device.socket, host_consent: true,
} });

// B1, B12: the rail appears with This Mac still in front and the same screen; the footer button is gone.
await expect(nav).toHaveAttribute("data-sidebar-rail", "device");
await expect(page.locator('[data-rail-tile="inbox"]')).toBeVisible();
await expect(page.locator('[data-rail-tile="local"]')).toHaveAttribute("aria-pressed", "true");
await expect(page.locator("[data-footer-device]")).toHaveCount(0);
await expect(page.locator("[data-workspace-screen]")).toBeVisible();
await expect(page.locator(`[data-rail-tile="${DEVICE}"]`)).toHaveAttribute("data-rail-connected", "true", { timeout: 120_000 });
// A device Home start needs the helper, which installs after the route connects.
await expect
.poll(() => fs.readFileSync(daemonLog, "utf8").includes('"kind":"host.ready","target":"mini-e2e"'), { timeout: 120_000 })
.toBe(true);
// Before any Home start the device has no ~/hide (B18).
expect(fs.existsSync(path.join(deviceHome, "hide"))).toBe(false);

// B38, B18: a start aimed at the device's Home makes ~/hide there and runs the agent on that device.
await openStartPanel(page);
await chooseTarget(page, `[data-start-target-option="home:${DEVICE}"]`);
await expect(page.locator("[data-start-panel] [data-start-target]")).toHaveAttribute("data-start-target", `home:${DEVICE}`);
await expect(page.locator("[data-start-panel] [data-agent-kind]")).toHaveAttribute("data-agent-kind", "claude");
await page.locator("[data-start-text]").fill("홈에서 첫 지시 확인");
await submitStart(page);
await expect.poll(() => fs.existsSync(path.join(deviceHome, "hide", ".hide-home.json")), { timeout: 60_000 }).toBe(true);
for (const guide of ["AGENTS.md", "CLAUDE.md"]) expect(fs.existsSync(path.join(deviceHome, "hide", guide))).toBe(true);
await expect.poll(() => paneRunning(device, "홈에서 첫 지시 확인")?.info ?? "", { timeout: 60_000 }).toContain("claude");
const homeAgent = paneRunning(device, "홈에서 첫 지시 확인")!;
const homeCwd = execFileSync(device.bin, ["pane", "get", homeAgent.pane], { env: device.env, encoding: "utf8" });
expect(homeCwd).toContain(fs.realpathSync(path.join(deviceHome, "hide")));
// B15, B2: the center, rail and sidebar moved to that device's pane together, under the device band.
await expect(page.locator(`[data-device-band="${DEVICE}"]`)).toBeVisible({ timeout: 30_000 });
await expect(page.locator(`[data-rail-tile="${DEVICE}"]`)).toHaveAttribute("aria-pressed", "true");
await expect(page.locator("[data-sidebar-title-name]")).toContainText(DEVICE_LABEL);
await expect(page.locator('nav[aria-label="Location"]')).toHaveText("Home/~/hide");
await capture(page, app, "device-home-started");

// B25: with the device's Home pane in front, the panel aims at that device's Home.
await openStartPanel(page);
await expect(page.locator("[data-start-panel] [data-start-target]")).toHaveAttribute("data-start-target", `home:${DEVICE}`);
// B38: a device checkout start runs there too.
await chooseTarget(page, `[data-start-target-option^="checkout:${DEVICE}:"][data-start-target-option$="/fixture"]`);
await page.locator("[data-start-text]").fill("체크아웃 지시 확인");
await submitStart(page);
await expect.poll(() => paneRunning(device, "체크아웃 지시 확인")?.info ?? "", { timeout: 60_000 }).toContain("claude");
await expect(page.locator(`[data-device-band="${DEVICE}"]`)).toBeVisible();

// B4: the Inbox lists both devices' agents with a chip on the device's rows, and the center stays.
await page.locator('[data-rail-tile="inbox"]').click();
await expect(nav).toHaveAttribute("data-sidebar-rail", "inbox");
await expect(page.locator(`[data-device-band="${DEVICE}"]`)).toBeVisible();
await capture(page, app, "device-home-inbox");

// B10, B12: removing the device in front moves the front to This Mac and the rail goes; the device keeps ~/hide and its agents.
await sendFrame(page, state, { kind: "remove_device", payload: { device_id: DEVICE } });
await expect(nav).toHaveAttribute("data-sidebar-rail", "none", { timeout: 30_000 });
await expect(page.locator("[data-footer-device]")).toBeVisible();
await expect(page.locator(`[data-device-band="${DEVICE}"]`)).toHaveCount(0);
expect(fs.existsSync(path.join(deviceHome, "hide", ".hide-home.json"))).toBe(true);
expect(paneRunning(device, "홈에서 첫 지시 확인")).not.toBeNull();
} finally {
await app?.close();
daemon.kill();
const keep = process.env.HIDE_E2E_SCREENSHOT_DIR;
if (keep && fs.existsSync(daemonLog)) fs.copyFileSync(daemonLog, path.join(keep, "device-home-daemon.log"));
// The core's diagnostic log, where each step of a start is recorded.
const diagnostics = path.join(run.env.HIDE_STATE_DIR!, "Logs");
if (keep && fs.existsSync(diagnostics)) fs.cpSync(diagnostics, path.join(keep, "device-home-diagnostics"), { recursive: true });
run.cleanup();
local.stop();
device.stop();
fs.rmSync(bridge, { recursive: true, force: true });
}
});
2 changes: 1 addition & 1 deletion desktop/src/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function accelerator(chord: Chord): string {
*/
export const MENU_LAYOUT: Readonly<Record<"app" | "File" | "Edit" | "View" | "Pane" | "Help", readonly (CommandId | null)[]>> = {
app: ["settings"],
File: ["new_tab", "new_workspace", "reopen_closed_tab", null, "save_file", null, "close_pane", "close_tab"],
File: ["new_tab", "start_agent", "new_workspace", "reopen_closed_tab", null, "save_file", null, "close_pane", "close_tab"],
Edit: ["find_in_pane"],
View: [
"search",
Expand Down
Loading
Loading