Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.
feat(desktop): show the local account after install and sign in with it
claude-opus-5-5-medium85448136c428
diff --git a/apps/desktop/AGENTS.md b/apps/desktop/AGENTS.mdindex 7fb535ae..da814d5e 100644--- a/apps/desktop/AGENTS.md+++ b/apps/desktop/AGENTS.md@@ -72,7 +72,17 @@ Gateway and runs Agents. The daemon exits with the app.(`GET /api/instances/desktop/runtime`) as `runtimeEnvironment` in theDesktop config, signs in with the local owner account, switches the windowto the server and enrolls this computer, so setup ends on "Linger is- ready". The default AI runtime is the+ ready". That screen shows the owner account from the instance's+ owner-only `local-account.json` (`setup-account.ts`): the email, the+ password masked until Show, Copy (the main process writes the clipboard)+ and "Open account file location" (`shell.showItemInFolder`); an unreadable+ file shows why instead. After a logout the SPA's login page asks+ `window.lingerDesktop.localAccount.available()`, which is true only while+ the window shows the origin in `local-server.json`, and offers "Sign in+ with this computer's account": `localAccount.signIn()` reads the file in+ the main process and signs the window's session in with+ `signInWithPassword`; the page gets only `{ ok }` or the reason it failed,+ never the password. The default AI runtime is theinstaller's recommendation, or Codex when the installer cannot inspect thecomputer. It records the install location, source, origin and engine in`desktop/local-server.json` under the default home and, while the windowdiff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex f4259d11..68ab8554 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -24,6 +24,7 @@"@types/yazl": "3.3.1","electron": "44.7.2","esbuild": "0.28.1",+ "jsdom": "29.1.1","typescript": "6.0.3","vitest": "4.1.9"}diff --git a/apps/desktop/src/main/desktop-ipc.test.ts b/apps/desktop/src/main/desktop-ipc.test.tsnew file mode 100644index 00000000..cb11b88e--- /dev/null+++ b/apps/desktop/src/main/desktop-ipc.test.ts@@ -0,0 +1,100 @@+import { afterEach, describe, expect, it, vi } from "vitest";++import { IPC } from "../shared/api.js";++const handlers = vi.hoisted(+ () => new Map<string, (event: unknown, ...args: unknown[]) => unknown>(),+);+vi.mock("electron", () => ({+ ipcMain: {+ handle: (+ channel: string,+ handler: (event: unknown, ...args: unknown[]) => unknown,+ ) => handlers.set(channel, handler),+ removeHandler: (channel: string) => handlers.delete(channel),+ },+}));++const { DesktopIpcModule } = await import("./desktop-ipc.js");+const { stubModule, testHost } = await import("./test-support.js");++const SERVER = "http://localhost:3000";+const PASSWORD = "a-private-password";++const fixture = async (+ localServer: {+ servesWindow?: () => Promise<boolean>;+ signInWithAccount?: () => Promise<void>;+ } = {},+) => {+ const local = {+ ...stubModule("LocalServer"),+ servesWindow: vi.fn(localServer.servesWindow ?? (async () => true)),+ signInWithAccount: vi.fn(localServer.signInWithAccount ?? (async () => {})),+ };+ const host = testHost(+ [+ stubModule("Enrollment"),+ stubModule("PowerGuard"),+ stubModule("ComputerDaemon"),+ stubModule("WindowManager"),+ stubModule("WorkspaceGrants"),+ local as never,+ new DesktopIpcModule({ defaultDisplayName: "Desk" }),+ ],+ { serverUrl: SERVER },+ );+ await host.start();+ const invoke = (channel: string, origin = SERVER) =>+ handlers.get(channel)!({ senderFrame: { origin } });+ return { host, local, invoke };+};++afterEach(() => handlers.clear());++describe("DesktopIpcModule local account", () => {+ it("offers the account only for the installed server", async () => {+ const f = await fixture({ servesWindow: async () => false });+ expect(await f.invoke(IPC.localAccountAvailable)).toBe(false);+ f.local.servesWindow.mockResolvedValue(true);+ expect(await f.invoke(IPC.localAccountAvailable)).toBe(true);+ await f.host.stop("quit");+ });++ it("rejects pages from any other origin", async () => {+ const f = await fixture();+ expect(() =>+ f.invoke(IPC.localAccountSignIn, "https://evil.example.com"),+ ).toThrow("Not allowed");+ expect(() =>+ f.invoke(IPC.localAccountAvailable, "https://evil.example.com"),+ ).toThrow("Not allowed");+ expect(f.local.signInWithAccount).not.toHaveBeenCalled();+ await f.host.stop("quit");+ });++ it("signs in and returns no account data to the page", async () => {+ const f = await fixture();+ expect(await f.invoke(IPC.localAccountSignIn)).toEqual({ ok: true });+ expect(f.local.signInWithAccount).toHaveBeenCalledOnce();+ await f.host.stop("quit");+ });++ it("returns why signing in failed", async () => {+ const f = await fixture({+ signInWithAccount: async () => {+ throw new Error(+ "The local account file must be private and owned by the current user (chmod 600).",+ );+ },+ });+ const result = await f.invoke(IPC.localAccountSignIn);+ expect(result).toEqual({+ ok: false,+ message:+ "The local account file must be private and owned by the current user (chmod 600).",+ });+ expect(JSON.stringify(result)).not.toContain(PASSWORD);+ await f.host.stop("quit");+ });+});diff --git a/apps/desktop/src/main/desktop-ipc.ts b/apps/desktop/src/main/desktop-ipc.tsindex 32f56215..24c5c042 100644--- a/apps/desktop/src/main/desktop-ipc.ts+++ b/apps/desktop/src/main/desktop-ipc.ts@@ -5,11 +5,13 @@ import {IPC,type ComputerStatus,type DesktopSettings,+ type LocalAccountSignIn,type WorkspaceGrantView,} from "../shared/api.js";import type { ComputerDaemonModule } from "./computer-daemon.js";import type { WorkspaceGrant } from "./config.js";import type { EnrollmentModule } from "./enrollment.js";+import type { LocalServerModule } from "./local-server.js";import type { Module, ModuleContext } from "./modules.js";import { sameOrigin } from "./navigation.js";import type { PowerGuardModule } from "./power-guard.js";@@ -56,6 +58,7 @@ export class DesktopIpcModule implements Module {readonly name = "DesktopIpc";readonly dependsOn = ["Enrollment",+ "LocalServer","PowerGuard","ComputerDaemon","WindowManager",@@ -80,6 +83,7 @@ export class DesktopIpcModule implements Module {const grants = ctx.get<WorkspaceGrantsModule>("WorkspaceGrants");const windows = ctx.get<WindowManagerModule>("WindowManager");const power = ctx.get<PowerGuardModule>("PowerGuard");+ const localServer = ctx.get<LocalServerModule>("LocalServer");const status = (): ComputerStatus => {const computerId = ctx.config.get().computerId;@@ -134,6 +138,21 @@ export class DesktopIpcModule implements Module {return settings();});+ // The handler already checked that the caller is the window's server, so+ // only the window's server needs to be the installed one.+ handle(IPC.localAccountAvailable, () => localServer.servesWindow());+ handle(IPC.localAccountSignIn, async (): Promise<LocalAccountSignIn> => {+ try {+ await localServer.signInWithAccount();+ ctx.log.info("local_server.account_signed_in", {});+ return { ok: true };+ } catch (error) {+ const message = error instanceof Error ? error.message : String(error);+ ctx.log.warn("local_server.account_sign_in_failed", { error: message });+ return { ok: false, message };+ }+ });+const permissions = this.#permissions;if (permissions)handle(IPC.permissionAct, (step) =>diff --git a/apps/desktop/src/main/local-server.test.ts b/apps/desktop/src/main/local-server.test.tsindex 019eb72c..4c44706c 100644--- a/apps/desktop/src/main/local-server.test.ts+++ b/apps/desktop/src/main/local-server.test.ts@@ -2153,3 +2153,102 @@ describe("LocalServerModule on Windows", () => {await f.host.stop("quit");});});++describe("LocalServerModule owner account", () => {+ const ORIGIN = "http://localhost:3000";+ const installed =+ (account?: Record<string, unknown>, mode = 0o600) =>+ (home: string) => {+ mkdirSync(path.join(home, "desktop"), { recursive: true });+ writeFileSync(+ path.join(home, "desktop", "local-server.json"),+ JSON.stringify({ home, repo: "/source", origin: ORIGIN }),+ );+ if (!account) return;+ const directory = path.join(home, "instances", LOCAL_INSTANCE);+ mkdirSync(directory, { recursive: true });+ const file = path.join(directory, "local-account.json");+ writeFileSync(file, JSON.stringify(account));+ chmodSync(file, mode);+ };+ const OWNER = {+ email: "[email protected]",+ password: "a-private-password",+ provisioned: true,+ };++ it("signs the window in to the installed server with the account file", async () => {+ const f = fixture({}, { serverUrl: ORIGIN }, installed(OWNER));+ await f.host.start();+ await vi.waitFor(() => expect(f.module.status().phase).toBe("ready"));+ expect(await f.module.servesWindow()).toBe(true);+ expect(await f.module.account()).toEqual({+ email: OWNER.email,+ password: OWNER.password,+ file: path.join(+ f.home,+ "instances",+ LOCAL_INSTANCE,+ "local-account.json",+ ),+ });+ await f.module.signInWithAccount();+ expect(f.signIn).toHaveBeenCalledWith(ORIGIN, OWNER.email, OWNER.password);+ await f.host.stop("quit");+ });++ it("does not offer the account to another server", async () => {+ const f = fixture(+ {},+ { serverUrl: "https://team.example.com" },+ installed(OWNER),+ );+ await f.host.start();+ expect(await f.module.servesWindow()).toBe(false);+ await expect(f.module.signInWithAccount()).rejects.toThrow(+ "This window is not showing the Linger on this computer.",+ );+ expect(f.signIn).not.toHaveBeenCalled();+ await f.host.stop("quit");+ });++ it("does not offer it before Linger is installed here", async () => {+ const f = fixture({}, { serverUrl: ORIGIN });+ await f.host.start();+ expect(await f.module.servesWindow()).toBe(false);+ await expect(f.module.account()).rejects.toThrow(+ "Linger is not installed on this computer.",+ );+ await f.host.stop("quit");+ });++ it.each([+ [+ "missing",+ installed(),+ /^The account file of Linger on this computer is missing \(.*local-account\.json\)\.$/,+ ],+ [+ "readable by others",+ installed(OWNER, 0o644),+ "The local account file must be private and owned by the current user (chmod 600).",+ ],+ [+ "not provisioned",+ installed({ ...OWNER, provisioned: false }),+ "The local account file is invalid or the account has not been created.",+ ],+ ])(+ "says why a %s account file cannot sign in",+ async (_case, prepare, message) => {+ const f = fixture({}, { serverUrl: ORIGIN }, prepare);+ await f.host.start();+ await vi.waitFor(() => expect(f.module.status().phase).toBe("ready"));+ const failure = f.module.signInWithAccount();+ await expect(failure).rejects.toThrow(message);+ await expect(failure).rejects.not.toThrow(OWNER.password);+ expect(f.signIn).not.toHaveBeenCalled();+ await f.host.stop("quit");+ },+ );+});diff --git a/apps/desktop/src/main/local-server.ts b/apps/desktop/src/main/local-server.tsindex 68037571..3f7b6f5d 100644--- a/apps/desktop/src/main/local-server.ts+++ b/apps/desktop/src/main/local-server.ts@@ -20,6 +20,7 @@ import { pipeline } from "node:stream/promises";import { setTimeout as delay } from "node:timers/promises";import { createZstdDecompress } from "node:zlib";+import { readLocalLogin } from "@linger/local-installation/account";import { downloadVerified } from "@linger/local-installation/download";import {removeRetrying,@@ -43,6 +44,7 @@ import {nodeRuntimeDownloadUrls,} from "../../../../scripts/local-computer-node-distributions.mjs";import type { Module, ModuleContext } from "./modules.js";+import { sameOrigin } from "./navigation.js";import { humanTenant, type EnrollmentModule } from "./enrollment.js";import type { WindowManagerModule } from "./window-manager.js";import {@@ -793,6 +795,36 @@ export class LocalServerModule implements Module {this.#opened = undefined;}+ // Whether the window shows the Linger this app installed here; only then+ // can its owner account sign the window in.+ async servesWindow(): Promise<boolean> {+ const record = await this.#readRecord();+ const serverUrl = this.#ctx?.config.get().serverUrl;+ return !!record && !!serverUrl && sameOrigin(record.origin, serverUrl);+ }++ // The owner account the installer created, read from its private file on+ // every call so the password is never kept in memory.+ async account(): Promise<LocalAccount> {+ const record = await this.#readRecord();+ if (!record) throw new Error("Linger is not installed on this computer.");+ return readLocalAccount(+ path.join(record.home, "instances", LOCAL_INSTANCE),+ );+ }++ // Signs the window in to the installed Linger with its owner account; the+ // password goes from the file to the server and nowhere else.+ async signInWithAccount(): Promise<void> {+ const record = await this.#readRecord();+ if (!record || !(await this.servesWindow()))+ throw new Error(+ "This window is not showing the Linger on this computer.",+ );+ const account = await this.account();+ await this.#options.signIn(record.origin, account.email, account.password);+ }+// Starts the runtime's own login (the installer runs it), or hands it the// code the vendor's page showed.async startSignIn(code?: string): Promise<void> {@@ -2234,6 +2266,26 @@ export const parseSetCookie = (header: string): SetCookie | undefined => {return cookie;};+export interface LocalAccount {+ readonly email: string;+ readonly password: string;+ // The private local-account.json it came from.+ readonly file: string;+}++// Reads an instance's owner account; a missing file says where it should be.+export async function readLocalAccount(root: string): Promise<LocalAccount> {+ try {+ return await readLocalLogin({ root });+ } catch (error) {+ if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;+ throw new Error(+ `The account file of Linger on this computer is missing (${path.join(root, "local-account.json")}).`,+ { cause: error },+ );+ }+}+// Signs in to the local server with its owner and hands the session cookies// to the app's web session; the password is never stored.export const signInWithPassword = async (diff --git a/apps/desktop/src/main/setup-account.test.ts b/apps/desktop/src/main/setup-account.test.tsnew file mode 100644index 00000000..a910d349--- /dev/null+++ b/apps/desktop/src/main/setup-account.test.ts@@ -0,0 +1,74 @@+import { describe, expect, it, vi } from "vitest";++import { SetupAccount } from "./setup-account.js";++const ACCOUNT = {+ email: "[email protected]",+ password: "a-private-password",+ file: "/home/me/.simplexai/instances/desktop/local-account.json",+};++const setupAccount = (read = vi.fn(async () => ACCOUNT)) => {+ const copy = vi.fn();+ const showFile = vi.fn();+ return {+ account: new SetupAccount({ read, copy, showFile }),+ copy,+ showFile,+ };+};++describe("SetupAccount", () => {+ it("shows the email and keeps the password back until asked", async () => {+ const { account } = setupAccount();+ expect(account.view()).toBeUndefined();+ await account.refresh();+ expect(account.view()).toEqual({ email: ACCOUNT.email });+ account.show(true);+ expect(account.view()).toEqual({+ email: ACCOUNT.email,+ password: ACCOUNT.password,+ });+ account.show(false);+ expect(account.view()).toEqual({ email: ACCOUNT.email });+ });++ it("copies the password and reveals the file without the page", async () => {+ const { account, copy, showFile } = setupAccount();+ await account.refresh();+ account.copy();+ account.reveal();+ expect(copy).toHaveBeenCalledWith(ACCOUNT.password);+ expect(showFile).toHaveBeenCalledWith(ACCOUNT.file);+ expect(account.view()).not.toHaveProperty("password");+ });++ it("says why the file could not be read and offers nothing else", async () => {+ const { account, copy, showFile } = setupAccount(+ vi.fn(async () => {+ throw new Error("The local account file must be private");+ }),+ );+ await account.refresh();+ account.show(true);+ account.copy();+ account.reveal();+ expect(account.view()).toEqual({+ error: "The local account file must be private",+ });+ expect(copy).not.toHaveBeenCalled();+ expect(showFile).not.toHaveBeenCalled();+ });++ it("hides a shown password once the file stops reading", async () => {+ const read = vi.fn(async () => ACCOUNT);+ const { account } = setupAccount(read);+ await account.refresh();+ account.show(true);+ read.mockRejectedValueOnce(new Error("gone"));+ await account.refresh();+ read.mockResolvedValueOnce(ACCOUNT);+ await account.refresh();+ expect(account.view()).toEqual({ email: ACCOUNT.email });+ });+});diff --git a/apps/desktop/src/main/setup-account.ts b/apps/desktop/src/main/setup-account.tsnew file mode 100644index 00000000..ea5d5ec8--- /dev/null+++ b/apps/desktop/src/main/setup-account.ts@@ -0,0 +1,61 @@+import type { SetupLocalAccount } from "../shared/setup.js";+import type { LocalAccount } from "./local-server.js";++export interface SetupAccountOptions {+ // Reads the installation's local-account.json.+ readonly read: () => Promise<LocalAccount>;+ readonly copy: (text: string) => void;+ readonly showFile: (file: string) => void;+}++// The owner account the setup page shows once Linger is installed. The page+// gets the password only while the person chose to show it; copying and+// revealing the file happen here.+export class SetupAccount {+ readonly #options: SetupAccountOptions;+ #account: LocalAccount | { readonly error: string } | undefined;+ #shown = false;++ constructor(options: SetupAccountOptions) {+ this.#options = options;+ }++ async refresh(): Promise<void> {+ try {+ this.#account = await this.#options.read();+ } catch (error) {+ this.#account = {+ error: error instanceof Error ? error.message : String(error),+ };+ this.#shown = false;+ }+ }++ view(): SetupLocalAccount | undefined {+ const account = this.#account;+ if (!account || "error" in account) return account;+ return {+ email: account.email,+ ...(this.#shown ? { password: account.password } : {}),+ };+ }++ show(on: boolean): void {+ this.#shown = on && this.#readable() !== undefined;+ }++ copy(): void {+ const account = this.#readable();+ if (account) this.#options.copy(account.password);+ }++ reveal(): void {+ const account = this.#readable();+ if (account) this.#options.showFile(account.file);+ }++ #readable(): LocalAccount | undefined {+ const account = this.#account;+ return account && !("error" in account) ? account : undefined;+ }+}diff --git a/apps/desktop/src/main/setup-command.test.ts b/apps/desktop/src/main/setup-command.test.tsindex 54b6f87b..a53acf56 100644--- a/apps/desktop/src/main/setup-command.test.ts+++ b/apps/desktop/src/main/setup-command.test.ts@@ -38,6 +38,16 @@ describe("parseSetupCommand", () => {expect(parseSetupCommand({ op: "local.signin.cancel" })).toEqual({op: "local.signin.cancel",});+ expect(parseSetupCommand({ op: "local.account.show", on: true })).toEqual({+ op: "local.account.show",+ on: true,+ });+ expect(parseSetupCommand({ op: "local.account.copy" })).toEqual({+ op: "local.account.copy",+ });+ expect(parseSetupCommand({ op: "local.account.reveal" })).toEqual({+ op: "local.account.reveal",+ });expect(parseSetupCommand({ op: "local.signin.switch", runtime: "claude" }),).toEqual({ op: "local.signin.switch", runtime: "claude" });@@ -105,6 +115,11 @@ describe("parseSetupCommand", () => {expect(() =>parseSetupCommand({ op: "local.signin.switch", runtime: "local" }),).toThrow();+ // The account file is the installation's own; the page never names one.+ expect(() =>+ parseSetupCommand({ op: "local.account.reveal", file: "/etc/passwd" }),+ ).toThrow();+ expect(() => parseSetupCommand({ op: "local.account.show" })).toThrow();// Task access modes were removed with the runtime host.expect(() =>parseSetupCommand({ op: "sandbox.set", mode: "ask" }),diff --git a/apps/desktop/src/main/setup-command.ts b/apps/desktop/src/main/setup-command.tsindex 4b4fd742..98951fdb 100644--- a/apps/desktop/src/main/setup-command.ts+++ b/apps/desktop/src/main/setup-command.ts@@ -45,6 +45,9 @@ const setupCommand = z.discriminatedUnion("op", [runtime: z.enum(["codex", "claude", "pi"]),}).strict(),+ z.object({ op: z.literal("local.account.show"), on: z.boolean() }).strict(),+ z.object({ op: z.literal("local.account.copy") }).strict(),+ z.object({ op: z.literal("local.account.reveal") }).strict(),z.object({ op: z.literal("signin.open") }).strict(),z.object({ op: z.literal("computer.connect") }).strict(),z.object({ op: z.literal("notifications.test") }).strict(),diff --git a/apps/desktop/src/main/setup-window.ts b/apps/desktop/src/main/setup-window.tsindex ea847bd5..53074925 100644--- a/apps/desktop/src/main/setup-window.ts+++ b/apps/desktop/src/main/setup-window.ts@@ -1,6 +1,7 @@import {BrowserWindow,Notification,+ clipboard,dialog,ipcMain,nativeImage,@@ -23,6 +24,7 @@ import setupHtml from "../shell/setup.html";import {SETUP_IPC,type SetupCommand,+ type SetupLocalAccount,type SetupState,} from "../shared/setup.js";import type { DiagnosticsModule } from "./diagnostics.js";@@ -35,6 +37,7 @@ import {} from "./mac-permissions.js";import type { Module, ModuleContext } from "./modules.js";import type { PowerGuardModule } from "./power-guard.js";+import { SetupAccount } from "./setup-account.js";import { parseSetupCommand } from "./setup-command.js";import { INVALID_SERVER, type WindowManagerModule } from "./window-manager.js";import type { WorkspaceGrantsModule } from "./workspace-grants.js";@@ -75,6 +78,7 @@ export class SetupWindowModule implements Module {#signedIn = false;#permissions: PermissionStatuses | undefined;#diagnostics: SetupState["diagnostics"];+ #account: SetupAccount | undefined;readonly #unsubscribe: (() => void)[] = [];constructor(options: SetupWindowOptions) {@@ -83,6 +87,12 @@ export class SetupWindowModule implements Module {async start(ctx: ModuleContext): Promise<void> {this.#ctx = ctx;+ const local = ctx.get<LocalServerModule>("LocalServer");+ this.#account = new SetupAccount({+ read: () => local.account(),+ copy: (text) => clipboard.writeText(text),+ showFile: (file) => shell.showItemInFolder(file),+ });const pages = this.#session();pages.protocol.handle("app", (request) => this.#serve(request));const fromSetup = (event: IpcMainInvokeEvent): void => {@@ -94,7 +104,11 @@ export class SetupWindowModule implements Module {};ipcMain.handle(SETUP_IPC.state, async (event) => {fromSetup(event);- await Promise.all([this.#refreshSignedIn(), this.#refreshPermissions()]);+ await Promise.all([+ this.#refreshSignedIn(),+ this.#refreshPermissions(),+ this.#refreshAccount(),+ ]);return this.#state();});ipcMain.handle(SETUP_IPC.run, async (event, command: unknown) => {@@ -105,6 +119,12 @@ export class SetupWindowModule implements Module {const push = (): void => this.#push();// Signing in happens in the main window; its cookies tell us when.const onCookie = (): void => void this.#refreshSignedIn().then(push);+ // The account file exists once the installation is ready.+ const onLocal = (): void => {+ push();+ if (local.status().phase === "ready")+ void this.#refreshAccount().then(push);+ };session.defaultSession.cookies.on("changed", onCookie);this.#unsubscribe.push(() => ipcMain.removeHandler(SETUP_IPC.state),@@ -114,7 +134,7 @@ export class SetupWindowModule implements Module {ctx.bus.on("computer.changed", push),ctx.bus.on("power.changed", push),ctx.bus.on("grants.changed", push),- ctx.bus.on("local-server.changed", push),+ ctx.bus.on("local-server.changed", onLocal),ctx.bus.on("server.changed", onCookie),);if (this.#options.show) this.show();@@ -231,6 +251,15 @@ export class SetupWindowModule implements Module {.get<LocalServerModule>("LocalServer").switchRuntime(command.runtime);return;+ case "local.account.show":+ this.#account?.show(command.on);+ return;+ case "local.account.copy":+ this.#account?.copy();+ return;+ case "local.account.reveal":+ this.#account?.reveal();+ return;case "signin.open":windows.show();return;@@ -301,7 +330,10 @@ export class SetupWindowModule implements Module {label,path,})),- localServer: localServerState(ctx.get<LocalServerModule>("LocalServer")),+ localServer: localServerState(+ ctx.get<LocalServerModule>("LocalServer"),+ this.#account?.view(),+ ),...(this.#diagnostics ? { diagnostics: this.#diagnostics } : {}),...(this.#permissions ? { permissions: this.#permissions } : {}),};@@ -315,6 +347,11 @@ export class SetupWindowModule implements Module {this.#signedIn = signedIn;}+ async #refreshAccount(): Promise<void> {+ const local = this.#ctx!.get<LocalServerModule>("LocalServer");+ if (local.status().phase === "ready") await this.#account?.refresh();+ }+async #refreshPermissions(): Promise<void> {const permissions = this.#options.permissions;if (!permissions) return;@@ -358,6 +395,7 @@ export class SetupWindowModule implements Module {const localServerState = (local: LocalServerModule,+ account: SetupLocalAccount | undefined,): SetupState["localServer"] => {const {available,@@ -391,5 +429,6 @@ const localServerState = (},keys,...(signIn ? { signIn } : {}),+ ...(account ? { account } : {}),};};diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.tsindex 583236fb..a8b8f45e 100644--- a/apps/desktop/src/preload/index.ts+++ b/apps/desktop/src/preload/index.ts@@ -34,6 +34,10 @@ const api: LingerDesktopApi = {get: () => ipcRenderer.invoke(IPC.settingsGet),set: (patch) => ipcRenderer.invoke(IPC.settingsSet, patch),},+ localAccount: {+ available: () => ipcRenderer.invoke(IPC.localAccountAvailable),+ signIn: () => ipcRenderer.invoke(IPC.localAccountSignIn),+ },...(process.platform === "darwin"? {permissions: {diff --git a/apps/desktop/src/shared/api.ts b/apps/desktop/src/shared/api.tsindex c3e806f7..8438e3aa 100644--- a/apps/desktop/src/shared/api.ts+++ b/apps/desktop/src/shared/api.ts@@ -29,6 +29,12 @@ export interface DesktopSettings {readonly displayName: string;}+// Signing in with the owner account of the Linger this app installed; the+// password stays in the main process.+export type LocalAccountSignIn =+ | { readonly ok: true }+ | { readonly ok: false; readonly message: string };+export type DesktopPermissionId = "screen_recording" | "accessibility";// A permission step this app takes on its own Mac. Linger is this app, so@@ -65,6 +71,12 @@ export interface LingerDesktopApi {get(): Promise<DesktopSettings>;set(patch: { displayName?: string }): Promise<DesktopSettings>;};+ // The owner account of the Linger installed on this computer.+ readonly localAccount: {+ // Whether the window shows that Linger; false for any other server.+ available(): Promise<boolean>;+ signIn(): Promise<LocalAccountSignIn>;+ };// macOS only.readonly permissions?: {act(step: DesktopPermissionStep): Promise<void>;@@ -82,4 +94,6 @@ export const IPC = {settingsGet: "settings.get",settingsSet: "settings.set",permissionAct: "permission.act",+ localAccountAvailable: "local-account.available",+ localAccountSignIn: "local-account.sign-in",} as const;diff --git a/apps/desktop/src/shared/setup.ts b/apps/desktop/src/shared/setup.tsindex a39fd54e..66f167c5 100644--- a/apps/desktop/src/shared/setup.ts+++ b/apps/desktop/src/shared/setup.ts@@ -42,8 +42,18 @@ export interface SetupLocalServer {};// While the "signin" step shows: the AI runtime's own sign-in.readonly signIn?: SetupRuntimeSignIn;+ // Once installed: the owner account, for signing in again after logging+ // out.+ readonly account?: SetupLocalAccount;}+// The owner account in the installation's local-account.json. The password+// is present only while the person chose to show it; error says why the+// file could not be read.+export type SetupLocalAccount =+ | { readonly email: string; readonly password?: string }+ | { readonly error: string };+export type SetupLocalStep =| "prepare"| "download"@@ -147,6 +157,11 @@ export type SetupCommand =readonly op: "local.signin.switch";readonly runtime: "codex" | "claude" | "pi";}+ // The finished install's account: show or hide the password, copy it to+ // the clipboard, or show its file in the file manager.+ | { readonly op: "local.account.show"; readonly on: boolean }+ | { readonly op: "local.account.copy" }+ | { readonly op: "local.account.reveal" }| { readonly op: "signin.open" }| { readonly op: "computer.connect" }| { readonly op: "notifications.test" }diff --git a/apps/desktop/src/shell/setup-page.test.ts b/apps/desktop/src/shell/setup-page.test.tsnew file mode 100644index 00000000..db41a473--- /dev/null+++ b/apps/desktop/src/shell/setup-page.test.ts@@ -0,0 +1,157 @@+// @vitest-environment jsdom+import { readFileSync } from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";++import { beforeEach, describe, expect, it, vi } from "vitest";++import type {+ SetupCommand,+ SetupLocalAccount,+ SetupState,+} from "../shared/setup.js";++const page = readFileSync(+ path.join(path.dirname(fileURLToPath(import.meta.url)), "setup.html"),+ "utf8",+);+const PASSWORD = "a-private-password";++const state = (+ phase: SetupState["localServer"]["phase"],+ account?: SetupLocalAccount,+): SetupState => ({+ platform: "linux",+ version: "1.0.0",+ serverUrl: "http://localhost:3000",+ signedIn: phase === "ready",+ enrolled: phase === "ready",+ displayName: "Desk",+ preventSleep: false,+ openAtLogin: false,+ folders: [],+ localServer: {+ available: true,+ phase,+ message: "",+ steps: ["prepare", "services", "connect", "agents"],+ step: phase === "ready" ? "agents" : "services",+ progress: phase === "ready" ? 1 : 0.5,+ attempt: 1,+ localModels: { state: "unavailable" },+ location: { path: "~/.simplexai", custom: false },+ keys: { composio: false, soniox: false, xai: false },+ ...(account ? { account } : {}),+ },+});++// Loads the setup page with a fake main process that starts mid-install.+const openPage = async () => {+ const [, body] = /<body[^>]*>([\s\S]*)<\/body>/.exec(page)!;+ const [, script] = /<script>([\s\S]*)<\/script>/.exec(body!)!;+ document.body.innerHTML = body!.replace(/<script>[\s\S]*<\/script>/, "");+ let listener: ((next: SetupState) => void) | undefined;+ let current = state("installing");+ const run = vi.fn(async (command: SetupCommand) => {+ if (command.op === "local.account.show")+ current = state("ready", {+ email: "[email protected]",+ ...(command.on ? { password: PASSWORD } : {}),+ });+ return current;+ });+ Object.assign(window, {+ matchMedia: () => ({ matches: true }),+ lingerSetup: {+ getState: async () => current,+ onState: (callback: (next: SetupState) => void) => {+ listener = callback;+ return () => {};+ },+ run,+ },+ });+ new Function(script!)();+ await vi.waitFor(() =>+ expect(+ document.querySelector('section[data-step="installing"].active'),+ ).not.toBeNull(),+ );+ const push = (next: SetupState) => {+ current = next;+ listener!(next);+ };+ return { run, push };+};++const $ = (id: string) => document.getElementById(id)!;++beforeEach(() => {+ document.body.innerHTML = "";+});++describe("setup page finish screen", () => {+ it("shows the account email with the password masked", async () => {+ const { push } = await openPage();+ push(state("ready", { email: "[email protected]" }));+ expect(+ document.querySelector('section[data-step="ready"].active'),+ ).not.toBeNull();+ expect($("account").hidden).toBe(false);+ expect($("account-email").textContent).toBe("[email protected]");+ expect($("account-password").textContent).toBe("•".repeat(12));+ expect($("account").textContent).not.toContain(PASSWORD);+ expect($("account-show").textContent).toBe("Show");+ expect($("account-copy").textContent).toBe("Copy");+ expect($("account-reveal").textContent?.trim()).toBe(+ "Open account file location",+ );+ });++ it("shows the password only after Show and hides it again", async () => {+ const { push, run } = await openPage();+ push(state("ready", { email: "[email protected]" }));+ $("account-show").click();+ await vi.waitFor(() =>+ expect($("account-password").textContent).toBe(PASSWORD),+ );+ expect(run).toHaveBeenCalledWith({ op: "local.account.show", on: true });+ expect($("account-show").textContent).toBe("Hide");+ $("account-show").click();+ await vi.waitFor(() =>+ expect($("account-password").textContent).toBe("•".repeat(12)),+ );+ expect(run).toHaveBeenLastCalledWith({+ op: "local.account.show",+ on: false,+ });+ });++ it("asks the main process to copy the password and reveal the file", async () => {+ const { push, run } = await openPage();+ push(state("ready", { email: "[email protected]" }));+ $("account-copy").click();+ await vi.waitFor(() =>+ expect($("account-copy").textContent).toBe("Copied"),+ );+ expect(run).toHaveBeenCalledWith({ op: "local.account.copy" });+ $("account-reveal").click();+ await vi.waitFor(() =>+ expect(run).toHaveBeenCalledWith({ op: "local.account.reveal" }),+ );+ });++ it("says why the account cannot be shown", async () => {+ const { push } = await openPage();+ push(+ state("ready", {+ error:+ "The local account file must be private and owned by the current user (chmod 600).",+ }),+ );+ expect($("account").hidden).toBe(false);+ expect($("account-fields").hidden).toBe(true);+ expect($("account-note").hidden).toBe(true);+ expect($("account-error").textContent).toContain("chmod 600");+ });+});diff --git a/apps/desktop/src/shell/setup.html b/apps/desktop/src/shell/setup.htmlindex 9980c530..0cafeff6 100644--- a/apps/desktop/src/shell/setup.html+++ b/apps/desktop/src/shell/setup.html@@ -1207,6 +1207,70 @@section.active .connected {animation: enter 420ms 120ms var(--ease) both;}+ /* The owner account of the finished install. */+ .account {+ width: 100%;+ max-width: 420px;+ margin: 18px auto 0;+ padding: 12px 14px;+ border: 1px solid var(--line);+ border-radius: 10px;+ background: rgba(255, 255, 255, 0.86);+ text-align: left;+ }+ .account-title {+ margin: 0 0 8px;+ color: var(--ink);+ font-size: 12.5px;+ font-weight: 600;+ }+ .account dl {+ display: grid;+ grid-template-columns: 64px 1fr auto auto;+ align-items: center;+ gap: 6px 8px;+ margin: 0;+ }+ .account dt {+ color: #5f5e55;+ font-size: 12px;+ font-weight: 500;+ }+ .account dd {+ min-width: 0;+ margin: 0;+ overflow: hidden;+ color: var(--ink);+ font-size: 12.5px;+ text-overflow: ellipsis;+ white-space: nowrap;+ user-select: text;+ -webkit-user-select: text;+ }+ .account dd.email {+ grid-column: 2 / -1;+ }+ .account dd.secret {+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;+ letter-spacing: 0.02em;+ }+ .account-note {+ margin: 8px 0 0;+ color: var(--muted);+ font-size: 11.5px;+ }+ .account-note .link {+ padding: 2px 4px;+ font-size: 11.5px;+ }+ .account-error {+ margin: 0;+ color: var(--error);+ font-size: 12px;+ }+ section.active .account {+ animation: enter 420ms 160ms var(--ease) both;+ }/* Confetti for a finished install, drawn over the whole window. */#confetti {position: fixed;@@ -1518,6 +1582,24 @@<p class="connected"><span class="live"></span>This computer is connected</p>+ <div class="account" id="account" hidden>+ <p class="account-title">Your account on this computer</p>+ <dl id="account-fields">+ <dt>Email</dt>+ <dd class="email" id="account-email"></dd>+ <dt>Password</dt>+ <dd class="secret" id="account-password"></dd>+ <button class="change" id="account-show" type="button">Show</button>+ <button class="change" id="account-copy" type="button">Copy</button>+ </dl>+ <p class="account-note" id="account-note">+ Use these to log in again if you log out.+ <button class="link" id="account-reveal" type="button">+ Open account file location+ </button>+ </p>+ <p class="account-error" id="account-error" role="alert"></p>+ </div><div class="start"><button class="primary large" id="open" type="button"><span>Open Linger</span@@ -2218,6 +2300,30 @@);}$("ready-lead").textContent = "Running on this computer, just for you.";+ renderAccount(local.account);+ };++ // The password stays masked until Show; the main process copies it.+ let copied = false;+ const renderAccount = (account) => {+ $("account").hidden = !account;+ if (!account) return;+ const error = account.error ?? "";+ $("account-error").textContent = error;+ $("account-error").hidden = !error;+ $("account-fields").hidden = !!error;+ $("account-note").hidden = !!error;+ if (error) return;+ $("account-email").textContent = account.email;+ $("account-password").textContent =+ account.password ?? "\u2022".repeat(12);+ $("account-show").textContent = account.password ? "Hide" : "Show";+ $("account-show").setAttribute(+ "aria-label",+ (account.password ? "Hide" : "Show") + " password",+ );+ $("account-copy").textContent = copied ? "Copied" : "Copy";+ $("account-copy").setAttribute("aria-label", "Copy password");};const render = () => {@@ -2443,6 +2549,24 @@render();});$("open").addEventListener("click", () => run({ op: "finish" }));+ $("account-show").addEventListener("click", () =>+ run({+ op: "local.account.show",+ on: !state.localServer.account?.password,+ }),+ );+ $("account-copy").addEventListener("click", async () => {+ if (!(await run({ op: "local.account.copy" }))) return;+ copied = true;+ render();+ setTimeout(() => {+ copied = false;+ render();+ }, 1500);+ });+ $("account-reveal").addEventListener("click", () =>+ run({ op: "local.account.reveal" }),+ );$("signin").addEventListener("click", () => {if (state.signedIn) return show("connect");if (pending !== null && pending !== "signin.open") return;diff --git a/apps/web/src/features/auth/desktop-local-account.ts b/apps/web/src/features/auth/desktop-local-account.tsnew file mode 100644index 00000000..ccb31120--- /dev/null+++ b/apps/web/src/features/auth/desktop-local-account.ts@@ -0,0 +1,45 @@+import { useEffect, useState } from "react";++export type DesktopLocalAccountSignIn =+ | { readonly ok: true }+ | { readonly ok: false; readonly message: string };++// The desktop app's sign-in with the owner account of the Linger it installed+// on this computer (`window.lingerDesktop.localAccount`). The desktop reads+// the account file and signs this window in itself; the page never sees the+// password.+export interface DesktopLocalAccount {+ available(): Promise<boolean>;+ signIn(): Promise<DesktopLocalAccountSignIn>;+}++function desktopLocalAccount(): DesktopLocalAccount | undefined {+ return typeof window === "undefined"+ ? undefined+ : (window as { lingerDesktop?: { localAccount?: DesktopLocalAccount } })+ .lingerDesktop?.localAccount;+}++/**+ * The account sign-in when this page runs in the desktop app and shows the+ * Linger installed on this computer; undefined in a browser, in older desktop+ * builds and for any other server.+ */+export function useDesktopLocalAccount(): DesktopLocalAccount | undefined {+ const [account, setAccount] = useState<DesktopLocalAccount>();+ useEffect(() => {+ const api = desktopLocalAccount();+ if (!api) return;+ let active = true;+ api+ .available()+ .then((available) => {+ if (active && available) setAccount(api);+ })+ .catch(() => undefined);+ return () => {+ active = false;+ };+ }, []);+ return account;+}diff --git a/apps/web/src/features/auth/teamhub-authentication.ts b/apps/web/src/features/auth/teamhub-authentication.tsindex 4720d79a..ea499518 100644--- a/apps/web/src/features/auth/teamhub-authentication.ts+++ b/apps/web/src/features/auth/teamhub-authentication.ts@@ -14,6 +14,7 @@ import { useTeamHubRuntime } from "@/features/teamhub/teamhub-runtime";import type { TeamHubSession } from "@/features/teamhub/teamhub-types";import { authenticationOperation } from "./authentication-operation";+import type { DesktopLocalAccount } from "./desktop-local-account";export interface AuthenticationResult {kind: "login";@@ -76,10 +77,7 @@ export function useTeamHubAuthentication(input: {initialAuthenticationState,);- async function completeAuthentication(- result: AuthenticationResult,- signal: AbortSignal,- ) {+ async function completeAuthentication(signal: AbortSignal) {let session: TeamHubSession;try {session = await authenticationOperation(signal, (signal) =>@@ -100,7 +98,7 @@ export function useTeamHubAuthentication(input: {clearTeamHubQueries(queryClient);queryClient.setQueryData(teamHubSessionQueryKey, session);queryClient.setQueryData(teamHubIdentityQueryKey, session.identity);- result = { ...result, session };+ const result: AuthenticationResult = { kind: "login", session };announceTeamHubAuthenticated();if (input.onAuthenticated)await authenticationOperation(signal, async () =>@@ -127,11 +125,8 @@ export function useTeamHubAuthentication(input: {});return;}- const attempt = new AbortController();- activeSubmit.current = attempt;- dispatch({ type: "submit-start" });- try {- const session = await authenticationOperation(attempt.signal, (signal) =>+ await runAttempt(async (signal) => {+ await authenticationOperation(signal, (signal) =>teamHubData(client.api.POST("/v0/auth/login", {body: { identifier: email, password: state.password },@@ -139,8 +134,35 @@ export function useTeamHubAuthentication(input: {}),),);+ return true;+ });+ }++ // The desktop app signs this window in with the account of the Linger on+ // this computer and sets the Session cookie; the page only confirms it.+ async function signInWithDesktopAccount(account: DesktopLocalAccount) {+ await runAttempt(async (signal) => {+ const result = await authenticationOperation(signal, () =>+ account.signIn().catch(() => ({+ message: DESKTOP_ACCOUNT_UNAVAILABLE,+ ok: false as const,+ })),+ );+ if (result.ok) return true;+ dispatch({ error: result.message, type: "operation-error" });+ return false;+ });+ }++ async function runAttempt(signIn: (signal: AbortSignal) => Promise<boolean>) {+ if (activeSubmit.current) return;+ const attempt = new AbortController();+ activeSubmit.current = attempt;+ dispatch({ type: "submit-start" });+ try {+ const signedIn = await signIn(attempt.signal);attempt.signal.throwIfAborted();- await completeAuthentication({ kind: "login", session }, attempt.signal);+ if (signedIn) await completeAuthentication(attempt.signal);} catch (error) {if (activeSubmit.current === attempt)dispatch({@@ -159,10 +181,14 @@ export function useTeamHubAuthentication(input: {changeField: (field: "email" | "password", value: string) =>dispatch({ field, type: "change-field", value }),handleSubmit,+ signInWithDesktopAccount,state,};}+const DESKTOP_ACCOUNT_UNAVAILABLE =+ "This computer's account could not be used. Log in with your email and password.";+function readAuthenticationError(error: unknown) {if (error instanceof TeamHubError) return error.message;return "TeamHub could not be reached. Try again.";diff --git a/apps/web/src/features/auth/teamhub-login-page.test.tsx b/apps/web/src/features/auth/teamhub-login-page.test.tsxindex 8b54f834..b8427c90 100644--- a/apps/web/src/features/auth/teamhub-login-page.test.tsx+++ b/apps/web/src/features/auth/teamhub-login-page.test.tsx@@ -390,6 +390,97 @@ describe("TeamHubLoginPage", () => {});});+describe("TeamHubLoginPage in the desktop app", () => {+ const LOCAL_BUTTON = "Sign in with this computer's account";+ const desktop = (localAccount: {+ available: () => Promise<boolean>;+ signIn: () => Promise<unknown>;+ }) => {+ Object.assign(window, { lingerDesktop: { localAccount } });+ return localAccount;+ };+ afterEach(() => {+ delete (window as { lingerDesktop?: unknown }).lingerDesktop;+ });++ it("offers no account button in a browser", () => {+ renderAuthenticationPage({});+ expect(+ screen.queryByRole("button", { name: LOCAL_BUTTON }),+ ).not.toBeInTheDocument();+ });++ it("offers no account button for a server this computer did not install", async () => {+ const account = desktop({+ available: vi.fn(async () => false),+ signIn: vi.fn(),+ });+ renderAuthenticationPage({});+ await waitFor(() => expect(account.available).toHaveBeenCalled());+ expect(+ screen.queryByRole("button", { name: LOCAL_BUTTON }),+ ).not.toBeInTheDocument();+ });++ it("signs in with one click and confirms the Session the desktop set", async () => {+ const verified = {+ id: "local-session",+ identity: { account: { id: "owner" }, actors: [] },+ };+ const login = vi.fn();+ const account = desktop({+ available: async () => true,+ signIn: vi.fn(async () => ({ ok: true })),+ });+ const onAuthenticated = vi.fn();+ renderAuthenticationPage(+ { login, getSession: () => verified },+ { onAuthenticated },+ );+ fireEvent.click(await screen.findByRole("button", { name: LOCAL_BUTTON }));+ await waitFor(() =>+ expect(onAuthenticated).toHaveBeenCalledWith({+ kind: "login",+ session: verified,+ }),+ );+ expect(account.signIn).toHaveBeenCalledOnce();+ expect(login).not.toHaveBeenCalled();+ });++ it("shows why the desktop could not sign in", async () => {+ desktop({+ available: async () => true,+ signIn: async () => ({+ ok: false,+ message: "The account file of Linger on this computer is missing.",+ }),+ });+ const onAuthenticated = vi.fn();+ renderAuthenticationPage({}, { onAuthenticated });+ fireEvent.click(await screen.findByRole("button", { name: LOCAL_BUTTON }));+ expect(await screen.findByRole("alert")).toHaveTextContent(+ "The account file of Linger on this computer is missing.",+ );+ expect(onAuthenticated).not.toHaveBeenCalled();+ expect(screen.getByRole("button", { name: LOCAL_BUTTON })).toBeEnabled();+ });++ it("asks for the email and password when the desktop call fails", async () => {+ desktop({+ available: async () => true,+ signIn: async () => {+ throw new Error("Not allowed");+ },+ });+ renderAuthenticationPage({});+ fireEvent.click(await screen.findByRole("button", { name: LOCAL_BUTTON }));+ expect(await screen.findByRole("alert")).toHaveTextContent(+ "This computer's account could not be used. Log in with your email and password.",+ );+ });+});+/*** Answers login and the Session check from the given handlers. Without a* Session handler, the Session echoes the latest login result.diff --git a/apps/web/src/features/auth/teamhub-login-page.tsx b/apps/web/src/features/auth/teamhub-login-page.tsxindex 73558fcc..3bbc26cc 100644--- a/apps/web/src/features/auth/teamhub-login-page.tsx+++ b/apps/web/src/features/auth/teamhub-login-page.tsx@@ -1,5 +1,6 @@import {ArrowRight02Icon,+ ComputerIcon,Mail01Icon,SquareLock02Icon,ViewIcon,@@ -15,6 +16,10 @@ import { Icon } from "@/components/ui/icon";import { AuthShell } from "./auth-shell";import { safeAuthenticationReturnTo } from "./authentication-return-to";+import {+ type DesktopLocalAccount,+ useDesktopLocalAccount,+} from "./desktop-local-account";import {type AuthenticationResult,useTeamHubAuthentication,@@ -33,6 +38,7 @@ export function TeamHubLoginPage({onAuthenticated,returnTo,});+ const localAccount = useDesktopLocalAccount();const authenticationNotice =searchParams.get("reason") === "session-expired"? "Your session has expired. Sign in again to continue."@@ -45,11 +51,48 @@ export function TeamHubLoginPage({<FormFeedback tone="danger">{authenticationNotice}</FormFeedback></div>) : null}+ {localAccount ? (+ <LocalAccountSignIn+ account={localAccount}+ authentication={authentication}+ />+ ) : null}<AuthenticationForm authentication={authentication} /></AuthShell>);}+function LocalAccountSignIn({+ account,+ authentication,+}: {+ account: DesktopLocalAccount;+ authentication: AuthenticationController;+}) {+ return (+ <div className="mb-4">+ <Button+ className="w-full"+ disabled={authentication.state.isSubmitting}+ onClick={() => {+ void authentication.signInWithDesktopAccount(account);+ }}+ size="large"+ tone="secondary"+ type="button"+ >+ <Icon icon={ComputerIcon} size={16} />+ <span>Sign in with this computer's account</span>+ </Button>+ <div className="mt-4 flex items-center gap-3 text-xs text-muted-foreground">+ <span className="h-px flex-1 bg-border" />+ <span>or</span>+ <span className="h-px flex-1 bg-border" />+ </div>+ </div>+ );+}+function AuthenticationForm({authentication,}: {diff --git a/packages/local-installation/src/account.ts b/packages/local-installation/src/account.tsindex 941df49f..c161f11b 100644--- a/packages/local-installation/src/account.ts+++ b/packages/local-installation/src/account.ts@@ -2,7 +2,8 @@ import { windowsPrivatePath } from "./windows-private.js";import { randomBytes } from "node:crypto";import { lstat, readFile } from "node:fs/promises";import path from "node:path";-import { atomicPrivate, type Instance } from "./instance.js";+import type { Instance } from "./instance.js";+import { atomicPrivate } from "./private-files.js";export function validateLocalCredentials(options: {email?: string;@@ -24,7 +25,7 @@ export function validateLocalCredentials(options: {);}export async function readLocalLogin(- instance: Instance,+ instance: Pick<Instance, "root">,): Promise<{ email: string; password: string; file: string }> {const file = path.join(instance.root, "local-account.json");const info = await lstat(file);diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 577d0428..3aa46326 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -168,6 +168,9 @@ importers:esbuild:specifier: 0.28.1version: 0.28.1+ jsdom:+ specifier: 29.1.1+ version: 29.1.1(@noble/[email protected])typescript:specifier: 6.0.3version: 6.0.3