📧✨ Beautiful email. For everyone.
feat: launch at login with configurable startup behavior (#55)
Paul Koeckeaf1b8f41c2f
diff --git a/README.md b/README.mdindex d11ce88..082d023 100644--- a/README.md+++ b/README.md@@ -37,7 +37,7 @@ If you run your own mail server, or just have a few accounts at small providers,- **Sending you can trust.** Drafts survive crashes. If a send's response gets lost on the way back, inlark marks the message **unconfirmed** and doesn't retry it on its own, so nobody gets your message twice.- **Private by design.** inlark connects directly to your mail server. There's no inlark account, no sync service and no analytics.- **Dark and light, with equal care.** Both themes get the same attention to detail, and rich HTML mail keeps the look its sender designed.-- **At home on your desktop.** Native notifications, a tray icon with your unread count, and inlark can be your default `mailto:` handler.+- **At home on your desktop.** Native notifications, a tray icon with your unread count, and inlark can be your default `mailto:` handler. Launch automatically when you sign in, quietly in the tray or with an open window.<table><tr>diff --git a/apps/desktop/electron.vite.config.ts b/apps/desktop/electron.vite.config.tsindex aeb3cd7..edd2160 100644--- a/apps/desktop/electron.vite.config.ts+++ b/apps/desktop/electron.vite.config.ts@@ -3,7 +3,14 @@ import { defineConfig } from 'electron-vite'import react from '@vitejs/plugin-react'import tailwindcss from '@tailwindcss/vite'export default defineConfig({- main: { build: { externalizeDeps: false } },+ main: {+ build: {+ externalizeDeps: false,+ // dbus-next optionally uses native sockets and X11 discovery. Flatpak supplies+ // a Unix session-bus path; use its pure Node socket fallback in our bundle.+ commonjsOptions: { ignore: ['usocket', 'x11'] },+ },+ },preload: {build: {externalizeDeps: false,diff --git a/apps/desktop/package.json b/apps/desktop/package.jsonindex b4956cf..4f1f623 100644--- a/apps/desktop/package.json+++ b/apps/desktop/package.json@@ -35,6 +35,7 @@"@tiptap/react": "^3.0.0","@tiptap/starter-kit": "^3.0.0","boring-avatars": "^2.0.4",+ "dbus-next": "^0.10.2","dompurify": "^3.2.0","electron-updater": "^6.8.9","html-to-text": "^10.0.1",diff --git a/apps/desktop/packaging/flatpak/README.md b/apps/desktop/packaging/flatpak/README.mdindex 3c785e7..bd286c7 100644--- a/apps/desktop/packaging/flatpak/README.md+++ b/apps/desktop/packaging/flatpak/README.md@@ -72,3 +72,10 @@ The release workflow waits for Flatpak validation and publishes the tested bundlalongside native installers. Both stable and prerelease tags produce bundles.There is no dependency on Flathub app review or repository access. A signedinlark update repository can be added later using the same application ID.++Startup uses the desktop’s Background portal, which may ask for permission on first launch.+Settings → General lets you enable or disable startup and choose between the tray and an open window.+Declining the request leaves startup off; inlark does not ask again automatically. The desktop must+provide a Background portal backend. If it cannot grant permission, Settings reports the failure and+lets you retry. The switch reflects the last portal response; permissions revoked outside inlark+remain controlled by the desktop.diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.tsindex f71b1f7..737da1e 100644--- a/apps/desktop/src/main/index.ts+++ b/apps/desktop/src/main/index.ts@@ -1,6 +1,7 @@import { openCryptoWorker } from './crypto-open'import {app,+ dialog,BrowserWindow,ipcMain,protocol,@@ -11,6 +12,9 @@ import {nativeTheme,powerMonitor,} from 'electron'+import { homedir } from 'node:os'+import { StartupManager, startInTray, startupArgument } from './startup'+import { requestBackground } from './startup-portal'import { join, resolve, sep } from 'node:path'import { pathToFileURL, fileURLToPath } from 'node:url'import { ipcSchemas, type AppEvent, type Settings } from '@inlark/core'@@ -47,6 +51,9 @@ let unreadCount = 0,// Keep the current window's mode while a saved preference waits for the next restart.let windowUsesSystemTitleBar = falselet restartQueued = false+let hideInitialWindow = false+let startupReady: Promise<void> = Promise.resolve()+let startup: StartupManagerlet service: MailServiceconst updates = new UpdateManager((status) => send({ type: 'update', status }))const pendingEvents: AppEvent[] = []@@ -80,6 +87,7 @@ function send(event: AppEvent) {}}function show() {+ hideInitialWindow = falseif (!window) createWindow()window?.show()window?.focus()@@ -137,7 +145,7 @@ function createWindow() {},})window.on('ready-to-show', () => {- if (!smoke) window?.show()+ if (!smoke && !hideInitialWindow) window?.show()})window.on('close', (event) => {if (!quitting && service?.settings.closeToTray && tray) {@@ -209,7 +217,7 @@ const lock = app.requestSingleInstanceLock()if (!lock) app.quit()else {app.on('second-instance', (_event, args) => {- show()+ if (!args.includes(startupArgument) || args.some((arg) => /^mailto:/i.test(arg))) show()mailtoFromArgs(args)})app.on('open-url', (event, url) => {@@ -255,10 +263,44 @@ else {discover,})await service.init()+ startup = new StartupManager({+ app,+ store: new JsonStore(join(app.getPath('userData'), 'mail')),+ platform: process.platform,+ env: process.env,+ execPath: process.execPath,+ home: homedir(),+ disabled: demo || smoke,+ installed: app.isPackaged || app.getAppPath().startsWith('/nix/store/'),+ requestBackground,+ askMac: async () => {+ const result = await dialog.showMessageBox(window!, {+ type: 'question',+ title: 'Open inlark when you sign in?',+ message: 'Get new email notifications as soon as you sign in.',+ detail:+ 'inlark will start quietly in the tray. You can change this in Settings. macOS may ask you to allow inlark in System Settings → General → Login Items.',+ buttons: ['Enable startup', 'Not now'],+ defaultId: 0,+ cancelId: 1,+ noLink: true,+ })+ return result.response === 0+ },+ })+ await startup.load()// Native surfaces such as the window controls and menus follow inlark's theme setting.nativeTheme.themeSource = service.settings.themenativeTheme.on('updated', followTheme)const handlers: Record<keyof typeof ipcSchemas, (...args: any[]) => unknown> = {+ startupStatus: async () => {+ await startupReady+ return startup.status()+ },+ setStartup: async (preferences) => {+ await startupReady+ return startup.set(preferences)+ },ready: () => {rendererReady = truefor (const event of pendingEvents.splice(0)) window?.webContents.send('mail:event', event)@@ -341,7 +383,6 @@ else {if (!parsed.success) throw new Error('Invalid input. Check the fields and try again.')return handlers[name as keyof typeof ipcSchemas](...parsed.data)})- createWindow()try {tray = new Tray(trayImage())tray.setToolTip('inlark')@@ -363,9 +404,25 @@ else {} catch {tray = null}+ hideInitialWindow = startInTray({+ automatic: startup.wasOpenedAtLogin(process.argv),+ startMinimized: startup.startMinimized,+ trayAvailable: tray !== null,+ hasMailto: process.argv.some((arg) => /^mailto:/i.test(arg)),+ })+ createWindow()+ // Let the window appear before any first-run consent dialog. Development, demo,+ // and smoke runs never register with the host OS.+ startupReady = new Promise<void>((resolve) => window!.once('ready-to-show', () => resolve()))+ .then(() => startup.initialize())+ .catch(() => {+ /* Settings can retry without preventing mail from opening. */+ })powerMonitor.on('resume', () => void service.refresh())if (!demo && !smoke) updates.start()- app.on('activate', show)+ app.on('activate', () => {+ if (!hideInitialWindow || rendererReady) show()+ })mailtoFromArgs(process.argv)// The packaged desktop entry lets the user choose inlark as their mailto handler.})diff --git a/apps/desktop/src/main/startup-portal.ts b/apps/desktop/src/main/startup-portal.tsnew file mode 100644index 0000000..416b688--- /dev/null+++ b/apps/desktop/src/main/startup-portal.ts@@ -0,0 +1,104 @@+import { randomUUID } from 'node:crypto'++/** Keep one session-bus connection for the full portal request/Response lifecycle. */+export async function requestBackground(enabled: boolean): Promise<boolean> {+ const { sessionBus, Message, MessageType, Variant } = await import('dbus-next')+ const bus = sessionBus()+ const destination = 'org.freedesktop.portal.Desktop'+ const token = 'inlark_' + randomUUID().replaceAll('-', '')+ let requestPath: string | undefined+ let timer: ReturnType<typeof setTimeout> | undefined+ try {+ return await new Promise<boolean>((resolve, reject) => {+ const fail = () =>+ reject(+ new Error(+ 'The desktop could not grant startup permission. Check your desktop’s background app settings and try again.',+ ),+ )+ bus.on('error', fail)+ const run = async () => {+ // dbus-next exposes its unique connection name at runtime.+ const name = (bus as typeof bus & { name: string }).name+ requestPath =+ '/org/freedesktop/portal/desktop/request/' ++ name.slice(1).replaceAll('.', '_') ++ '/' ++ token+ bus.on('message', (message) => {+ if (+ message.type !== MessageType.SIGNAL ||+ message.path !== requestPath ||+ message.interface !== 'org.freedesktop.portal.Request' ||+ message.member !== 'Response'+ )+ return+ const [code, results] = message.body+ if (code !== 0) {+ reject(new Error('Startup permission was not granted.'))+ return+ }+ resolve(results.autostart?.value === true)+ })+ await bus.call(+ new Message({+ destination: 'org.freedesktop.DBus',+ path: '/org/freedesktop/DBus',+ interface: 'org.freedesktop.DBus',+ member: 'AddMatch',+ signature: 's',+ body: [+ "type='signal',sender='org.freedesktop.portal.Desktop',interface='org.freedesktop.portal.Request',member='Response',path='" ++ requestPath ++ "'",+ ],+ }),+ )+ await bus.call(+ new Message({+ destination,+ path: '/org/freedesktop/portal/desktop',+ interface: 'org.freedesktop.portal.Background',+ member: 'RequestBackground',+ signature: 'sa{sv}',+ body: [+ '',+ {+ handle_token: new Variant('s', token),+ reason: new Variant(+ 's',+ 'Check for new email and show notifications after you sign in.',+ ),+ autostart: new Variant('b', enabled),+ commandline: new Variant('as', ['inlark', '--autostart']),+ },+ ],+ }),+ )+ }+ timer = setTimeout(() => {+ if (requestPath) {+ try {+ bus.send(+ new Message({+ destination,+ path: requestPath,+ interface: 'org.freedesktop.portal.Request',+ member: 'Close',+ }),+ )+ } catch {+ /* The bus may already have disconnected. */+ }+ }+ fail()+ }, 120_000)+ bus.once('connect', () => {+ void run().catch(fail)+ })+ })+ } finally {+ clearTimeout(timer)+ bus.disconnect()+ }+}diff --git a/apps/desktop/src/main/startup.ts b/apps/desktop/src/main/startup.tsnew file mode 100644index 0000000..8cda5f3--- /dev/null+++ b/apps/desktop/src/main/startup.ts@@ -0,0 +1,220 @@+import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises'+import { isAbsolute, join } from 'node:path'+import type { App } from 'electron'+import type { StartupPreferences, StartupStatus } from '@inlark/core'++export const startupArgument = '--autostart'+interface Store {+ read<T>(name: string, fallback: T): Promise<T>+ write(name: string, value: unknown): Promise<void>+}+interface SavedStartup {+ initialized: boolean+ enabled: boolean+ startMinimized: boolean+}+export interface StartupOptions {+ app: Pick<App, 'isPackaged' | 'getLoginItemSettings' | 'setLoginItemSettings'>+ store: Store+ platform: NodeJS.Platform+ env: NodeJS.ProcessEnv+ execPath: string+ home: string+ disabled: boolean+ installed?: boolean+ askMac: () => Promise<boolean>+ requestBackground: (enabled: boolean) => Promise<boolean>+}++/** Desktop Exec quoting has two escaping layers, and percent introduces field codes. */+export function desktopExec(path: string): string {+ if (/[\r\n\0=]/.test(path)) throw new Error('This application path cannot be used for startup.')+ return (+ '"' ++ path+ .replace(/%/g, '%%')+ .replace(/[\\"`$]/g, (c) => '\\' + c)+ .replace(/\\/g, '\\\\') ++ '"'+ )+}++export function startInTray(options: {+ automatic: boolean+ startMinimized: boolean+ trayAvailable: boolean+ hasMailto: boolean+}): boolean {+ return options.automatic && options.startMinimized && options.trayAvailable && !options.hasMailto+}++export class StartupManager {+ private saved: SavedStartup = { initialized: false, enabled: false, startMinimized: true }+ private error?: string+ private queue = Promise.resolve()+ constructor(private options: StartupOptions) {}+ private get flatpak() {+ return !!this.options.env.FLATPAK_ID+ }+ private get supported() {+ return (+ (this.options.installed ?? this.options.app.isPackaged) &&+ !this.options.disabled &&+ ['linux', 'darwin', 'win32'].includes(this.options.platform)+ )+ }+ private get entry() {+ const config = this.options.env.XDG_CONFIG_HOME+ return join(+ config && isAbsolute(config) ? config : join(this.options.home, '.config'),+ 'autostart',+ 'inlark.desktop',+ )+ }+ private get executable() {+ // AppImage's process.execPath points inside a temporary mount. Nix's store path is+ // versioned; use the installed profile command so upgrades keep working.+ return (+ this.options.env.APPIMAGE ||+ (this.options.execPath.startsWith('/nix/store/') ? 'inlark' : this.options.execPath)+ )+ }+ async load() {+ try {+ const saved = await this.options.store.read('startup', this.saved)+ if (+ !saved ||+ typeof saved.initialized !== 'boolean' ||+ typeof saved.enabled !== 'boolean' ||+ typeof saved.startMinimized !== 'boolean'+ )+ throw new Error('Invalid startup preferences.')+ this.saved = saved+ } catch {+ this.saved.initialized = true+ this.error = 'Could not read startup preferences. Choose your startup settings again.'+ }+ }+ get startMinimized() {+ return this.saved.startMinimized !== false+ }+ wasOpenedAtLogin(args: string[]) {+ return (+ args.includes(startupArgument) ||+ (this.options.platform === 'darwin' &&+ this.options.app.getLoginItemSettings().wasOpenedAtLogin)+ )+ }+ async status(): Promise<StartupStatus> {+ let enabled = this.saved.enabled,+ requiresApproval = false+ if (this.supported) {+ if (this.options.platform === 'darwin') {+ const login = this.options.app.getLoginItemSettings()+ requiresApproval = login.status === 'requires-approval'+ enabled = login.openAtLogin || requiresApproval+ } else if (this.options.platform === 'win32') {+ const login = this.options.app.getLoginItemSettings({+ path: this.options.execPath,+ args: [startupArgument],+ })+ enabled = login.openAtLogin && login.executableWillLaunchAtLogin+ } else if (!this.flatpak) {+ try {+ const entry = await readFile(this.entry, 'utf8')+ enabled =+ !/^Hidden\s*=\s*true\s*$/im.test(entry) &&+ /^Exec=/m.test(entry) &&+ !/^X-GNOME-Autostart-enabled\s*=\s*false\s*$/im.test(entry)+ } catch (error) {+ if ((error as NodeJS.ErrnoException).code !== 'ENOENT')+ this.error = 'Could not read startup settings. Check access to your autostart folder.'+ enabled = false+ }+ }+ }+ return {+ supported: this.supported,+ enabled: this.supported && enabled,+ startMinimized: this.startMinimized,+ requiresApproval,+ error: this.error,+ }+ }+ async initialize() {+ if (!this.supported || this.saved.initialized) return+ // Record the first-run decision even on cancellation/failure; never prompt repeatedly+ // or re-enable an item the user later disabled in their operating system.+ this.saved.initialized = true+ try {+ await this.options.store.write('startup', this.saved)+ const existing = await this.status()+ const enable =+ existing.enabled || this.options.platform !== 'darwin' || (await this.options.askMac())+ await this.set({ enabled: enable })+ } catch {+ this.error = 'Could not enable startup. You can try again in Settings.'+ }+ }+ set(preferences: StartupPreferences): Promise<StartupStatus> {+ const operation = this.queue.then(async () => {+ if (!this.supported) throw new Error('Startup is available in the installed desktop app.')+ const next = { ...this.saved, ...preferences, initialized: true }+ if (preferences.enabled !== undefined) {+ if (this.options.platform === 'linux') {+ if (this.flatpak) {+ next.enabled = await this.options.requestBackground(next.enabled)+ if (preferences.enabled !== next.enabled)+ throw new Error('Startup permission was not granted. You can try again in Settings.')+ } else if (next.enabled) {+ await mkdir(join(this.entry, '..'), { recursive: true })+ const temporary = this.entry + '.tmp'+ try {+ await writeFile(+ temporary,+ '[Desktop Entry]\nType=Application\nName=inlark\nExec=' ++ desktopExec(this.executable) ++ ' ' ++ startupArgument ++ '\nTerminal=false\n',+ { mode: 0o600 },+ )+ await rename(temporary, this.entry)+ } finally {+ await rm(temporary, { force: true })+ }+ } else {+ // Override any system-wide entry as required by the XDG autostart spec.+ await mkdir(join(this.entry, '..'), { recursive: true })+ await writeFile(+ this.entry,+ '[Desktop Entry]\nType=Application\nName=inlark\nHidden=true\n',+ { mode: 0o600 },+ )+ }+ } else {+ this.options.app.setLoginItemSettings({+ openAtLogin: next.enabled,+ ...(this.options.platform === 'win32'+ ? { path: this.options.execPath, args: [startupArgument], enabled: next.enabled }+ : {}),+ })+ }+ }+ await this.options.store.write('startup', next)+ this.saved = next+ this.error = undefined+ const status = await this.status()+ if (preferences.enabled === true && !status.enabled)+ throw new Error(+ 'Startup could not be enabled. Check your operating system’s login item settings.',+ )+ return status+ })+ this.queue = operation.then(+ () => {},+ () => {},+ )+ return operation+ }+}diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.tsindex 18d96a2..e055e90 100644--- a/apps/desktop/src/preload/index.ts+++ b/apps/desktop/src/preload/index.ts@@ -1,6 +1,8 @@import { contextBridge, ipcRenderer } from 'electron'import type { DesktopMailAPI, AppEvent } from '@inlark/core'const methods = [+ 'startupStatus',+ 'setStartup','encryptionStatus','setupEncryption','setEncryptionPreference',diff --git a/apps/desktop/src/renderer/src/Settings.tsx b/apps/desktop/src/renderer/src/Settings.tsxindex 6efa8a1..7aed0ce 100644--- a/apps/desktop/src/renderer/src/Settings.tsx+++ b/apps/desktop/src/renderer/src/Settings.tsx@@ -36,6 +36,7 @@ import { AccountSetup, type SetupMode } from './AccountSetup'import { FolderMappingsDialog } from './FolderMappings'import { AliasesDialog } from './Aliases'import { IndexingMeter } from './IndexingMeter'+import { StartupSettings } from './StartupSettings'import { ShortcutEditor } from './ShortcutEditor'import { EncryptionPanel } from './EncryptionSettings'import { newMessageAccount } from './compose-account'@@ -484,6 +485,7 @@ export function SettingsPanel({onCheckedChange={(closeToTray) => void update({ closeToTray })}/></div>+ <StartupSettings notify={notify} /></div>{bootstrap.accounts.length > 1 && (<divdiff --git a/apps/desktop/src/renderer/src/StartupSettings.tsx b/apps/desktop/src/renderer/src/StartupSettings.tsxnew file mode 100644index 0000000..3414937--- /dev/null+++ b/apps/desktop/src/renderer/src/StartupSettings.tsx@@ -0,0 +1,91 @@+import { useEffect, useState } from 'react'+import { Select, Switch } from '@inlark/ui'+import { friendlyError, type StartupPreferences, type StartupStatus } from '@inlark/core'+import { api } from './api'++export function StartupSettings({+ notify,+}: {+ notify: (message: string, tone?: 'error' | 'info') => void+}) {+ const [status, setStatus] = useState<StartupStatus>()+ const [saving, setSaving] = useState(false)+ const [loadError, setLoadError] = useState(false)+ useEffect(() => {+ let active = true+ const refresh = () => {+ void api+ .startupStatus()+ .then((next) => {+ if (active) {+ setStatus(next)+ setLoadError(false)+ }+ })+ .catch(() => {+ if (active) setLoadError(true)+ })+ }+ refresh()+ window.addEventListener('focus', refresh)+ return () => {+ active = false+ window.removeEventListener('focus', refresh)+ }+ }, [])+ const change = async (preferences: StartupPreferences) => {+ setSaving(true)+ try {+ setStatus(await api.setStartup(preferences))+ } catch (error) {+ notify(friendlyError(error), 'error')+ } finally {+ setSaving(false)+ }+ }+ const row =+ 'setting-row flex items-center justify-between my-3.5 gap-6 [&_strong]:font-normal [&_strong]:text-[13px] [&_p]:text-muted [&_p]:my-[3px] [&_p]:text-[12px] [&_p]:leading-[1.6] max-[700px]:gap-3.5'+ return (+ <>+ <div className={row}>+ <div>+ <strong>Launch on system startup</strong>+ <p>+ {loadError+ ? 'Could not check startup settings. Reopen Settings to try again.'+ : status && !status.supported+ ? 'Available in the installed desktop app.'+ : 'Open inlark automatically when you sign in to your computer.'}+ </p>+ {status?.requiresApproval && (+ <p role="status">Allow inlark in System Settings → General → Login Items.</p>+ )}+ {status?.error && <p role="status">{status.error}</p>}+ </div>+ <Switch+ aria-label="Launch on system startup"+ checked={status?.enabled ?? false}+ disabled={!status?.supported || saving}+ onCheckedChange={(enabled) => void change({ enabled })}+ />+ </div>+ <div className={row}>+ <div>+ <strong>Startup behavior</strong>+ <p>Applies to automatic launches. Opening inlark yourself shows the window.</p>+ </div>+ <Select+ aria-label="Startup behavior"+ className="setting-select w-auto min-w-48 shrink-0"+ value={status?.startMinimized === false ? 'window' : 'tray'}+ options={[+ { value: 'tray', label: 'Start in the tray' },+ { value: 'window', label: 'Open window' },+ ]}+ disabled={!status?.supported || saving}+ onValueChange={(value) => void change({ startMinimized: value === 'tray' })}+ />+ </div>+ </>+ )+}diff --git a/apps/desktop/src/renderer/src/demo.ts b/apps/desktop/src/renderer/src/demo.tsindex d58fb1f..12b4727 100644--- a/apps/desktop/src/renderer/src/demo.ts+++ b/apps/desktop/src/renderer/src/demo.ts@@ -835,6 +835,18 @@ const copyOf = (source: Draft, patch: Partial<Draft>): Draft => ({...patch,})export const demoAPI: DesktopMailAPI = {+ startupStatus: async () => ({+ supported: false,+ enabled: false,+ startMinimized: true,+ requiresApproval: false,+ }),+ setStartup: async () => ({+ supported: false,+ enabled: false,+ startMinimized: true,+ requiresApproval: false,+ }),updateStatus: async () => ({ phase: 'idle' }),encryptionStatus: async () => encryptionState(),setupEncryption: async ({ accountId, identityId, action, password }) => {diff --git a/flake.nix b/flake.nixindex c57910b..2986a3d 100644--- a/flake.nix+++ b/flake.nix@@ -13,7 +13,7 @@nixosModules.default = import ./nix/module.nix;devShells = eachSystem (pkgs: {default = pkgs.mkShell {- packages = with pkgs; [ nodejs_24 pnpm_12 electron_44 python3 ];+ packages = with pkgs; [ nodejs_24 pnpm_12 electron_44 python3 dbus ];ELECTRON_SKIP_BINARY_DOWNLOAD = "1";ELECTRON_EXEC_PATH = "${pkgs.electron_44}/bin/electron";shellHook = ''diff --git a/nix/package.nix b/nix/package.nixindex 9c74925..0742de2 100644--- a/nix/package.nix+++ b/nix/package.nix@@ -1,4 +1,4 @@-{ lib, stdenv, nodejs_24, pnpm_12, fetchPnpmDeps, pnpmConfigHook, makeWrapper, makeDesktopItem, copyDesktopItems, electron_44 }:+{ lib, stdenv, nodejs_24, pnpm_12, fetchPnpmDeps, pnpmConfigHook, makeWrapper, makeDesktopItem, copyDesktopItems, electron_44, dbus }:stdenv.mkDerivation (finalAttrs: {pname = "inlark";version = (builtins.fromJSON (builtins.readFile ../apps/desktop/package.json)).version;@@ -6,13 +6,13 @@ stdenv.mkDerivation (finalAttrs: {src = ../.;filter = path: type: !(builtins.elem (baseNameOf path) [ "node_modules" ".pnpm-store" ".turbo" ".astro" ".wrangler" "out" "dist" "release" ".git" ".test-data" "result" "test-results" ]);};- nativeBuildInputs = [ nodejs_24 pnpm_12 pnpmConfigHook makeWrapper copyDesktopItems ];+ nativeBuildInputs = [ nodejs_24 pnpm_12 pnpmConfigHook makeWrapper copyDesktopItems dbus ];pnpmDeps = fetchPnpmDeps {inherit (finalAttrs) pname version src;pnpm = pnpm_12;fetcherVersion = 4;postPatch = "sed -i /storeDir:/d pnpm-workspace.yaml";- hash = "sha256-eVgjZ0qBHtAgCkYRgVmFFli76oP5C0DCT/e5ITG2yDY=";+ hash = "sha256-21fDziofDzbkQXAC57wd7lbKQdRWDmkJvT4J2W5fBLI=";};postPatch = "sed -i /storeDir:/d pnpm-workspace.yaml";ELECTRON_SKIP_BINARY_DOWNLOAD = "1";diff --git a/packages/core/src/model.ts b/packages/core/src/model.tsindex 67c65cb..ff1a5de 100644--- a/packages/core/src/model.ts+++ b/packages/core/src/model.ts@@ -605,7 +605,20 @@ export interface EncryptionReadiness {recipients: RecipientReadiness[]recommend: boolean}+export interface StartupPreferences {+ enabled?: boolean+ startMinimized?: boolean+}+export interface StartupStatus {+ supported: boolean+ enabled: boolean+ startMinimized: boolean+ requiresApproval: boolean+ error?: string+}export interface DesktopMailAPI {+ startupStatus(): Promise<StartupStatus>+ setStartup(preferences: StartupPreferences): Promise<StartupStatus>encryptionStatus(): Promise<EncryptionStatus>setupEncryption(input: {accountId: stringdiff --git a/packages/core/src/schemas.ts b/packages/core/src/schemas.tsindex 120cb42..5a3a89a 100644--- a/packages/core/src/schemas.ts+++ b/packages/core/src/schemas.ts@@ -210,6 +210,10 @@ export const settingsSchema = z.object({.optional(),})export const ipcSchemas = {+ startupStatus: z.tuple([]),+ setStartup: z.tuple([+ z.object({ enabled: z.boolean().optional(), startMinimized: z.boolean().optional() }).strict(),+ ]),encryptionStatus: z.tuple([]),setupEncryption: z.tuple([z.object({diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 99afbbc..5cc4688 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -187,6 +187,9 @@ importers:boring-avatars:specifier: ^2.0.4+ dbus-next:+ specifier: ^0.10.2+ version: 0.10.2dompurify:specifier: ^3.2.0version: 3.4.15@@ -1783,6 +1786,10 @@ packages:resolution: {integrity: sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==}engines: {node: '>= 20.19.0'}+ '@nornagon/[email protected]':+ resolution: {integrity: sha512-ugvXJjwF5ldtUpa7D95kruNJ41yFQDEKyF5CW4TgKJnh+W/zmlBzXXeKTyqIgwMFrkePN2JqOBqcF0M0oOunow==}+ engines: {node: '>=0.3.0'}+'@oslojs/[email protected]':resolution: {integrity: sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==}@@ -2662,6 +2669,9 @@ packages:'@zone-eu/[email protected]':resolution: {integrity: sha512-LOMzdrKRVgaghLaezIPdHRhsGpfDiWNQo1RptWc84CRllI4dWLwqX/L4x1iTt1CaeyvyUfMXM/6mjIsEisT3Tg==}+ resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==}+resolution: {integrity: sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==}engines: {node: ^20.17.0 || >=22.9.0}@@ -2683,6 +2693,9 @@ packages:peerDependencies:ajv: ^8.0.0-beta.0+ resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==}+resolution: {integrity: sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==}@@ -2690,6 +2703,10 @@ packages:resolution: {integrity: sha512-MxT4XZL7pzLHpuvhDKdMaQHMGGkJDLluKBLsbstn+8wv9sWcFT6h+0ve9qkml95amVTZtZV83gQe2hY+ojgHLg==}hasBin: true+ resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}engines: {node: '>=8'}@@ -2717,6 +2734,13 @@ packages:dmg-builder: 26.15.3electron-builder-squirrel-windows: 26.15.3+ resolution: {integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==}++ resolution: {integrity: sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==}+ deprecated: This package is no longer supported.+resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}@@ -2724,10 +2748,17 @@ packages:resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==}+resolution: {integrity: sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==}engines: {node: '>=12.0.0'}+ resolution: {integrity: sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==}+ engines: {node: '>=0.8'}+resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}engines: {node: '>=12'}@@ -2760,6 +2791,9 @@ packages:resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==}engines: {node: '>=8.0.0'}+ resolution: {integrity: sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==}+resolution: {integrity: sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==}@@ -2785,6 +2819,12 @@ packages:engines: {node: '>=6.0.0'}hasBin: true+ resolution: {integrity: sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==}++ resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==}+resolution: {integrity: sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==}@@ -2853,6 +2893,9 @@ packages:resolution: {integrity: sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==}+ resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}+resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}@@ -2882,6 +2925,10 @@ packages:resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==}engines: {node: '>= 20.19.0'}+ resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}+ engines: {node: '>=10'}+resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==}engines: {node: '>=18'}@@ -2912,6 +2959,10 @@ packages:resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==}engines: {node: '>=6'}+ resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}engines: {node: '>=7.0.0'}@@ -2949,6 +3000,9 @@ packages:resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}+ resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}+resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}@@ -2966,6 +3020,9 @@ packages:resolution: {integrity: sha512-yuToqVvRrj6pfDXREyQAAv8SkAEk/8GS3jQRTiUMm66TVtBYmqQeoEjL2Lmq8Rpo6271vH76InTChTitEAm65w==}engines: {node: '>=22'}+ resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==}+resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}@@ -3001,12 +3058,19 @@ packages:resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}+ resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==}+ engines: {node: '>=0.10'}+resolution: {integrity: sha512-hTIP/z+t+qKwBDcmmsnmjWTduxCg+5KfdqWQvb2X/8C9+knYY6epN/pfxdDuyVlSVeFz0sM5eEfwIUQ70U4ckg==}resolution: {integrity: sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w==}+ resolution: {integrity: sha512-kLNQoadPstLgKKGIXKrnRsMgtAK/o+ix3ZmcfTfvBHzghiO9yHXpoKImGnB50EXwnfSFaSAullW/7UrSkAISSQ==}+resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}engines: {node: '>=6.0'}@@ -3047,6 +3111,9 @@ packages:resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}engines: {node: '>=0.4.0'}+ resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==}+resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}engines: {node: '>=6'}@@ -3112,6 +3179,12 @@ packages:resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==}+ resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}++ resolution: {integrity: sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==}+resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==}engines: {node: '>=0.10.0'}@@ -3247,6 +3320,9 @@ packages:resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}+ resolution: {integrity: sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==}+resolution: {integrity: sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==}@@ -3260,6 +3336,10 @@ packages:resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}+ resolution: {integrity: sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==}+ engines: {'0': node >=0.6.0}+resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}@@ -3267,6 +3347,9 @@ packages:resolution: {integrity: sha512-8unmvA0qrfpFWBYUate9BTGtQdKHWBYt+KdAIkag7Vvxe7wz8Q2nJg7fLMC0bJqe0bjP31kca7Ckaawrs4Istg==}engines: {node: '>=6.0.0'}+ resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}+resolution: {integrity: sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==}@@ -3288,6 +3371,9 @@ packages:picomatch:optional: true+ resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==}+resolution: {integrity: sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==}@@ -3306,10 +3392,20 @@ packages:resolution: {integrity: sha512-Wp1zXWPVUPBmfoa3Cqc9ctaKuzKAV6uLstRqlR56kSjplf5uAce+qeyYym7F+PHbGTk+tCEdkCW6RD7DX/gBZw==}engines: {node: '>=20'}+ resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==}++ resolution: {integrity: sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==}+ engines: {node: '>= 0.12'}+resolution: {integrity: sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==}engines: {node: '>= 6'}+ resolution: {integrity: sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==}+resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}engines: {node: '>=12'}@@ -3334,6 +3430,10 @@ packages:resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==}engines: {node: '>=10'}+ resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}+ engines: {node: '>= 8'}+resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}@@ -3345,6 +3445,10 @@ packages:resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}+ resolution: {integrity: sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==}+ deprecated: This package is no longer supported.+resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}engines: {node: '>=6.9.0'}@@ -3373,6 +3477,9 @@ packages:resolution: {integrity: sha512-7nF7C9fIPFEMHgEMEfgIlO9wDdZ8CyHw27rWciFZfHvHDReIiPhsYuzPRXsfvBCqFy1l8RRyyWV7QLM+ZhUJsQ==}engines: {node: '>=20.20.0'}+ resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==}+resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==}@@ -3402,6 +3509,15 @@ packages:resolution: {integrity: sha512-L3THSe2MPeBwgIZVSH5zLdBBU90TOxarvhK9d04IDY2AmVS8j2Jz2LIWtwsGOU3lu2I5jCN7FNvVfY2+XyF+mg==}+ resolution: {integrity: sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==}+ engines: {node: '>=4'}++ resolution: {integrity: sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==}+ engines: {node: '>=6'}+ deprecated: this library is no longer supported+resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}engines: {node: '>=8'}@@ -3417,6 +3533,9 @@ packages:resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==}+resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==}engines: {node: '>= 0.4'}@@ -3431,6 +3550,10 @@ packages:resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==}hasBin: true+ resolution: {integrity: sha512-ciq6hFsSG/Bpt2DmrZJtv+56zpPdnq+NQ4ijEFrveKN0ZG1mhl/LdT1NQZ9se6ty1fACcI4d4vYqC9v8EYpH2A==}+ hasBin: true+resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==}engines: {node: '>=10'}@@ -3455,6 +3578,10 @@ packages:resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==}engines: {node: '>= 14'}+ resolution: {integrity: sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==}+ engines: {node: '>=0.8', npm: '>=1.3.7'}+resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==}engines: {node: '>=10.19.0'}@@ -3500,6 +3627,10 @@ packages:engines: {node: '>=20'}hasBin: true+ resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}engines: {node: '>=8'}@@ -3508,6 +3639,9 @@ packages:resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==}engines: {node: '>=12'}+ resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==}+resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==}@@ -3534,6 +3668,9 @@ packages:resolution: {integrity: sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==}engines: {node: '>=20'}+ resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==}+resolution: {integrity: sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==}engines: {node: '>=10'}@@ -3553,6 +3690,12 @@ packages:resolution: {integrity: sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==}hasBin: true+ resolution: {integrity: sha512-TzO/62Hxeb26QMb4IGlI/5X+QLr9Uqp1FPkwp2+KOICW+Q+vSuFj61c8pkT6wAns4WcK56X7CmSHhJeDGWOqxQ==}++ resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==}+resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==}engines: {node: '>=6'}@@ -3561,9 +3704,15 @@ packages:resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}+ resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}+resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}+ resolution: {integrity: sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==}+resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}@@ -3584,6 +3733,10 @@ packages:resolution: {integrity: sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==}+ resolution: {integrity: sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==}+ engines: {node: '>=0.6.0'}+resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==}@@ -3770,6 +3923,9 @@ packages:resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==}+ resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==}+resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==}@@ -3801,6 +3957,9 @@ packages:resolution: {integrity: sha512-O7oCYzWW9YH5lHk/y3Z8R8dFnUq8wqaH146BuU2NDt/3MGjdfMLzGF2Ft7WksTCeq00covNKpwxQabcG3zJFqQ==}engines: {node: '>=20.0.0'}+ resolution: {integrity: sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==}+resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==}engines: {node: '>=10'}@@ -3876,10 +4035,22 @@ packages:resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}+ resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==}+ engines: {node: '>=8'}++ resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==}+ engines: {node: '>=8'}+resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==}engines: {node: '>=16 || 14 >=14.17'}+ resolution: {integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==}+ engines: {node: '>= 8'}+resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==}engines: {node: '>= 18'}@@ -3888,6 +4059,11 @@ packages:resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==}hasBin: true+ resolution: {integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==}+ engines: {node: '>=10'}+ hasBin: true+resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==}engines: {node: '>=10'}@@ -3898,6 +4074,9 @@ packages:resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==}+ resolution: {integrity: sha512-P5mokDkSvCGBz6mZDD/2l+w9QoICRXdCyZ9ONGmTePr40oihJg3Kpn0YU3twKd6PJnwSlLBWNQeOT6yWEV2c4A==}+resolution: {integrity: sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==}engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}@@ -3925,6 +4104,11 @@ packages:engines: {node: ^20.17.0 || >=22.9.0}hasBin: true+ resolution: {integrity: sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==}+ engines: {node: '>= 10.12.0'}+ hasBin: true+resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}@@ -3939,6 +4123,11 @@ packages:resolution: {integrity: sha512-He9XskOFms62SyAKkLu8CcGcYHAo+BSHSsORI8s4PJH8qZgZY4L4lDfvyN0twvmbpyG+eGrxpyBlskj9d9rJ8A==}engines: {node: '>=20.0.0'}+ resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==}+ engines: {node: '>=6'}+ hasBin: true+resolution: {integrity: sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==}engines: {node: ^20.17.0 || >=22.9.0}@@ -3952,9 +4141,24 @@ packages:resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==}engines: {node: '>=10'}+ resolution: {integrity: sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==}+ deprecated: This package is no longer supported.+resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==}+ resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==}+ engines: {node: '>=0.10.0'}++ resolution: {integrity: sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==}++ resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}engines: {node: '>= 0.4'}@@ -4041,6 +4245,9 @@ packages:resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==}engines: {node: '>= 14.16'}+ resolution: {integrity: sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==}+resolution: {integrity: sha512-eRWB5LBz7PpDu4PUlwT0PhnQfTQJlDDdPa35urV4Osrm0t0AqQFGn+UIkU3klZvwJ8KPO3VbBFsXquA6p6kqZw==}engines: {node: '>=12', npm: '>=6'}@@ -4048,6 +4255,9 @@ packages:resolution: {integrity: sha512-80B2AsU+I4Qdb0ZAPSfe9UwvGzwkM37IKIFEvdS3D/3Ndgv2bsuJ0bfG1+iEYO+l7Gfd4EUJmuRyq7efLgRMzQ==}+ resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==}+resolution: {integrity: sha512-o8bTeDWjE086iwKrROaDf31K0qC/BENdm15/uH9usSC/uZjJOKb2YGiVHfLY4GhwsERiPI1jmwI2XrA7ACOxVw==}@@ -4171,6 +4381,9 @@ packages:resolution: {integrity: sha512-7qcRaCWM48NC4utNQnx5Obvvs48/jMHXXvOXHH6WlBojmiK15eyxoHYlv5aJARHJHiFccSuWZ7ULW2SPrFAS/g==}+ resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==}+resolution: {integrity: sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==}@@ -4178,6 +4391,10 @@ packages:resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==}engines: {node: '>=6'}+ resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}+ engines: {node: '>=6'}+resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==}@@ -4185,6 +4402,10 @@ packages:resolution: {integrity: sha512-BbubeCEyTuQjVMakvJQ/Sxbc93F2pwmbsxONT/ZRrwU7Ua38d8unYTwXpTVLAKJ4BDuH9IGztCjQcd/N/39Dvg==}engines: {node: '>=16.0.0'}+ resolution: {integrity: sha512-mzR4sElr1bfCaPJe7m8ilJ6ZXdDaGoObcYR0ZHSsktM/Lt21MVHj5De30GQH2eiZ1qGRTO7LCAzQsUeXTNexWQ==}+ engines: {node: '>=0.6'}+resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==}@@ -4251,6 +4472,11 @@ packages:resolution: {integrity: sha512-lMbBMrDoxgsyO+yB3sDcrDuX85yYt7sS8BfQd11jtbW/z5ZWgLZRcEGLsLoYw7I0WSUGQBs8CC8ScIxkTX1+6Q==}+ resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==}+ engines: {node: '>= 6'}+ deprecated: request has been deprecated, see https://github.com/request/request/issues/3142+resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}engines: {node: '>=0.10.0'}@@ -4287,6 +4513,11 @@ packages:deprecated: Rimraf versions prior to v4 are no longer supportedhasBin: true+ resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}+ deprecated: Rimraf versions prior to v4 are no longer supported+ hasBin: true+resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==}engines: {node: '>=8.0'}@@ -4372,6 +4603,9 @@ packages:resolution: {integrity: sha512-AeDcLh0yO2SFm9W71essgnSzLV9DI8ZH0x0knXn2DMnUZj728mpLbxjlbB6IqKCmqh8JA3cEqRyGoNkt584JcQ==}engines: {node: '>=10'}+ resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}+resolution: {integrity: sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==}engines: {node: '>=20.9.0'}@@ -4452,9 +4686,17 @@ packages:resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==}engines: {node: '>= 10.x'}+ resolution: {integrity: sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==}+resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}+ resolution: {integrity: sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==}+ engines: {node: '>=0.10.0'}+ hasBin: true+resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}@@ -4465,6 +4707,13 @@ packages:resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==}+ resolution: {integrity: sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==}++ resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}engines: {node: '>=8'}@@ -4483,6 +4732,10 @@ packages:resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==}+ resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}engines: {node: '>=8'}@@ -4524,6 +4777,11 @@ packages:resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==}engines: {node: '>=6'}+ resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==}+ engines: {node: '>=10'}+ deprecated: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]+resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==}engines: {node: '>=18'}@@ -4539,6 +4797,9 @@ packages:resolution: {integrity: sha512-e2zZ96wSChazBsbENf/Pcm/4swHt2cEKQ92rhUjkL9GCKiTDJIaTBenjE/m9DXi0QBmTMDkFDdOomUy20A1tDQ==}engines: {node: '>=20'}+ resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}+resolution: {integrity: sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==}@@ -4589,6 +4850,10 @@ packages:resolution: {integrity: sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==}engines: {node: '>=14.14'}+ resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==}+ engines: {node: '>=0.8'}+resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}@@ -4601,10 +4866,16 @@ packages:resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}+ resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}+resolution: {integrity: sha512-s0GhnWXlAAN+wb2GRMQxnZgFweRWTAceRWW/4Lk9iHj7QuLZMjDxQQqu+Xoh7Nckuy8UiSim520w6yqP2+ertw==}hasBin: true+ resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==}+resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}engines: {node: '>=10'}@@ -4754,21 +5025,36 @@ packages:peerDependencies:browserslist: '>= 4.21.0'+ resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}+resolution: {integrity: sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==}peerDependencies:react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0+ resolution: {integrity: sha512-V/H02RNiaOCJZuPoKont/y12VJaImC6C5xW7OzPFjYu9qnig0yv9hyp9E7Wqjm6d8yZuZouH3NAfDATVMgh2SQ==}+resolution: {integrity: sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==}resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}+ resolution: {integrity: sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==}+ deprecated: uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).+ hasBin: true+resolution: {integrity: sha512-mMVzj0TXExtVdlDEq+Mzp0eyOuyznNpFobNM3uAqe3HVm/Ps2c+u17BligMkZjZCA6EiXpoon8iRTer3iu40SQ==}engines: {node: '>=18.12.0'}+ resolution: {integrity: sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==}+ engines: {'0': node >=0.6.0}+resolution: {integrity: sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==}@@ -5033,6 +5319,9 @@ packages:engines: {node: '>=8'}hasBin: true+ resolution: {integrity: sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==}+resolution: {integrity: sha512-YojhsWBuZwk3Jk9OC0QfTgVbLeQOD1tK1olC9ZXAUcmeip8z4NE/xtttpxCsuTvQBRqppvy7Tkac0kxPYMjIXA==}engines: {node: '>=16'}@@ -5071,6 +5360,14 @@ packages:utf-8-validate:optional: true+ resolution: {integrity: sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==}+ engines: {node: '>=4.0.0'}++ resolution: {integrity: sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==}+ engines: {node: '>=4.0'}+resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==}engines: {node: '>=8.0'}@@ -6300,6 +6597,8 @@ snapshots:'@noble/[email protected]': {}+ '@nornagon/[email protected]': {}+'@oslojs/[email protected]': {}'@oxc-project/[email protected]': {}@@ -7099,6 +7398,9 @@ snapshots:libmime: 5.4.4libqp: 2.1.1+ optional: true+@@ -7111,6 +7413,14 @@ snapshots:dependencies:ajv: 8.20.0+ dependencies:+ fast-deep-equal: 3.1.3+ fast-json-stable-stringify: 2.1.0+ json-schema-traverse: 0.4.1+ uri-js: 4.4.1+ optional: true+dependencies:fast-deep-equal: 3.1.3@@ -7122,6 +7432,9 @@ snapshots:dependencies:process-ancestry: 0.1.0+ optional: true+@@ -7185,16 +7498,33 @@ snapshots:transitivePeerDependencies:- supports-color+ optional: true++ dependencies:+ delegates: 1.0.0+ readable-stream: 2.3.8+ optional: true++ dependencies:+ safer-buffer: 2.1.2+ optional: true+dependencies:pvtsutils: 1.3.6pvutils: 1.2.0tslib: 2.8.1+ optional: true+@@ -7296,6 +7626,9 @@ snapshots:+ optional: true+@@ -7310,6 +7643,16 @@ snapshots:+ dependencies:+ tweetnacl: 0.14.5+ optional: true++ dependencies:+ file-uri-to-path: 1.0.0+ optional: true+@@ -7396,6 +7739,9 @@ snapshots:+ optional: true+@@ -7425,6 +7771,9 @@ snapshots:dependencies:readdirp: 5.1.1+ optional: true+@@ -7451,6 +7800,9 @@ snapshots:+ optional: true+dependencies:color-name: 1.1.4@@ -7476,6 +7828,9 @@ snapshots:+ optional: true+@@ -7486,6 +7841,9 @@ snapshots:+ optional: true+@@ -7527,10 +7885,27 @@ snapshots:+ dependencies:+ assert-plus: 1.0.0+ optional: true++ dependencies:+ '@nornagon/put': 0.0.8+ event-stream: 3.3.4+ hexy: 0.2.11+ jsbi: 2.0.5+ long: 4.0.0+ safe-buffer: 5.1.2+ xml2js: 0.4.23+ optionalDependencies:+ usocket: 0.3.0+dependencies:ms: 2.1.3@@ -7565,6 +7940,9 @@ snapshots:+ optional: true+@@ -7637,6 +8015,14 @@ snapshots:dependencies:readable-stream: 2.3.8+ [email protected]: {}++ dependencies:+ jsbn: 0.1.1+ safer-buffer: 2.1.2+ optional: true+dependencies:jake: 10.9.4@@ -7877,6 +8263,16 @@ snapshots:dependencies:'@types/estree': 1.0.9+ dependencies:+ duplexer: 0.1.2+ from: 0.1.7+ map-stream: 0.1.0+ pause-stream: 0.0.11+ split: 0.3.3+ stream-combiner: 0.0.4+ through: 2.3.8+@@ -7885,10 +8281,16 @@ snapshots:+ optional: true++ optional: true+@@ -7905,6 +8307,9 @@ snapshots:optionalDependencies:picomatch: 4.0.7+ optional: true+dependencies:minimatch: 5.1.9@@ -7921,6 +8326,16 @@ snapshots:dependencies:tiny-inflate: 1.0.3+ optional: true++ dependencies:+ asynckit: 0.4.0+ combined-stream: 1.0.8+ mime-types: 2.1.35+ optional: true+dependencies:asynckit: 0.4.0@@ -7929,6 +8344,8 @@ snapshots:hasown: 2.0.4mime-types: 2.1.35+ [email protected]: {}+dependencies:graceful-fs: 4.2.11@@ -7966,6 +8383,11 @@ snapshots:jsonfile: 6.2.1universalify: 2.0.1+ dependencies:+ minipass: 3.3.6+ optional: true+@@ -7973,6 +8395,18 @@ snapshots:+ dependencies:+ aproba: 1.2.0+ console-control-strings: 1.1.0+ has-unicode: 2.0.1+ object-assign: 4.1.1+ signal-exit: 3.0.7+ string-width: 1.0.2+ strip-ansi: 3.0.1+ wide-align: 1.1.5+ optional: true+@@ -8005,6 +8439,11 @@ snapshots:dependencies:resolve-pkg-maps: 1.0.0+ dependencies:+ assert-plus: 1.0.0+ optional: true+@@ -8062,6 +8501,15 @@ snapshots:ufo: 1.6.4uncrypto: 0.1.3+ optional: true++ dependencies:+ ajv: 6.15.0+ har-schema: 2.0.0+ optional: true+@@ -8075,6 +8523,9 @@ snapshots:dependencies:has-symbols: 1.1.0+ optional: true+dependencies:function-bind: 1.1.2@@ -8099,6 +8550,8 @@ snapshots:+ [email protected]: {}+dependencies:lru-cache: 6.0.0@@ -8131,6 +8584,13 @@ snapshots:transitivePeerDependencies:- supports-color+ dependencies:+ assert-plus: 1.0.0+ jsprim: 1.4.2+ sshpk: 1.18.0+ optional: true+dependencies:quick-lru: 5.1.1@@ -8179,10 +8639,18 @@ snapshots:+ dependencies:+ number-is-nan: 1.0.1+ optional: true++ optional: true+@@ -8197,6 +8665,9 @@ snapshots:+ optional: true+dependencies:async: 3.2.6@@ -8213,12 +8684,23 @@ snapshots:dependencies:argparse: 2.0.1+ [email protected]: {}++ optional: true++ optional: true++ optional: true+optional: true@@ -8238,6 +8720,14 @@ snapshots:optionalDependencies:graceful-fs: 4.2.11+ dependencies:+ assert-plus: 1.0.0+ extsprintf: 1.3.0+ json-schema: 0.4.0+ verror: 1.10.0+ optional: true+dependencies:json-buffer: 3.0.1@@ -8369,6 +8859,8 @@ snapshots:+ [email protected]: {}+@@ -8410,6 +8902,8 @@ snapshots:punycode.js: 2.3.1tlds: 1.261.0+ [email protected]: {}+dependencies:escape-string-regexp: 4.0.0@@ -8493,8 +8987,22 @@ snapshots:+ dependencies:+ yallist: 4.0.0+ optional: true++ optional: true++ dependencies:+ minipass: 3.3.6+ yallist: 4.0.0+ optional: true+dependencies:minipass: 7.1.3@@ -8503,12 +9011,18 @@ snapshots:dependencies:minimist: 1.2.8+ optional: true++ optional: true+@@ -8540,6 +9054,20 @@ snapshots:undici: 6.28.1which: 6.0.1+ dependencies:+ env-paths: 2.2.1+ glob: 7.2.3+ graceful-fs: 4.2.11+ nopt: 5.0.0+ npmlog: 4.1.2+ request: 2.88.2+ rimraf: 3.0.2+ semver: 7.8.5+ tar: 6.2.1+ which: 2.0.2+ optional: true+@@ -8548,6 +9076,11 @@ snapshots:+ dependencies:+ abbrev: 1.1.1+ optional: true+dependencies:abbrev: 4.0.0@@ -8556,10 +9089,27 @@ snapshots:+ dependencies:+ are-we-there-yet: 1.1.7+ console-control-strings: 1.1.0+ gauge: 2.7.4+ set-blocking: 2.0.0+ optional: true+dependencies:boolbase: 1.0.0+ optional: true++ optional: true++ optional: true+optional: true@@ -8627,10 +9177,17 @@ snapshots:+ dependencies:+ through: 2.3.8++ optional: true+@@ -8807,6 +9364,11 @@ snapshots:prosemirror-state: 1.4.4prosemirror-transform: 1.12.1+ dependencies:+ punycode: 2.3.1+ optional: true+dependencies:end-of-stream: 1.4.5@@ -8814,12 +9376,18 @@ snapshots:+ optional: true+dependencies:tslib: 2.8.1+ optional: true+@@ -8881,6 +9449,30 @@ snapshots:+ dependencies:+ aws-sign2: 0.7.0+ aws4: 1.13.2+ caseless: 0.12.0+ combined-stream: 1.0.8+ extend: 3.0.2+ forever-agent: 0.6.1+ form-data: 2.3.3+ har-validator: 5.1.5+ http-signature: 1.2.0+ is-typedarray: 1.0.0+ isstream: 0.1.2+ json-stringify-safe: 5.0.1+ mime-types: 2.1.35+ oauth-sign: 0.9.0+ performance-now: 2.1.0+ qs: 6.5.5+ safe-buffer: 5.1.2+ tough-cookie: 2.5.0+ tunnel-agent: 0.6.0+ uuid: 3.4.0+ optional: true+@@ -8911,6 +9503,11 @@ snapshots:dependencies:glob: 7.2.3+ dependencies:+ glob: 7.2.3+ optional: true+dependencies:boolean: 3.2.0@@ -9039,6 +9636,9 @@ snapshots:+ optional: true+[email protected](@types/[email protected]):dependencies:'@img/colour': 1.1.0@@ -9165,15 +9765,43 @@ snapshots:+ dependencies:+ through: 2.3.8+optional: true+ dependencies:+ asn1: 0.2.6+ assert-plus: 1.0.0+ bcrypt-pbkdf: 1.0.2+ dashdash: 1.14.1+ ecc-jsbn: 0.1.2+ getpass: 0.1.7+ jsbn: 0.1.1+ safer-buffer: 2.1.2+ tweetnacl: 0.14.5+ optional: true++ dependencies:+ duplexer: 0.1.2++ dependencies:+ code-point-at: 1.1.0+ is-fullwidth-code-point: 1.0.0+ strip-ansi: 3.0.1+ optional: true+dependencies:emoji-regex: 8.0.0@@ -9200,6 +9828,11 @@ snapshots:character-entities-html4: 2.1.0character-entities-legacy: 3.0.0+ dependencies:+ ansi-regex: 2.1.1+ optional: true+dependencies:ansi-regex: 5.0.1@@ -9244,6 +9877,16 @@ snapshots:+ dependencies:+ chownr: 2.0.0+ fs-minipass: 2.1.0+ minipass: 5.0.0+ minizlib: 2.1.2+ mkdirp: 1.0.4+ yallist: 4.0.0+ optional: true+dependencies:'@isaacs/fs-minipass': 4.0.1@@ -9266,6 +9909,8 @@ snapshots:dependencies:real-require: 1.0.0+ [email protected]: {}+dependencies:semver: 5.7.2@@ -9301,6 +9946,12 @@ snapshots:+ dependencies:+ psl: 1.15.0+ punycode: 2.3.1+ optional: true+@@ -9311,6 +9962,11 @@ snapshots:+ dependencies:+ safe-buffer: 5.1.2+ optional: true+optionalDependencies:'@turbo/darwin-64': 2.11.2@@ -9320,6 +9976,9 @@ snapshots:'@turbo/windows-64': 2.11.2'@turbo/windows-arm64': 2.11.2+ optional: true+optional: true@@ -9422,16 +10081,38 @@ snapshots:escalade: 3.2.0picocolors: 1.1.1+ dependencies:+ punycode: 2.3.1+ optional: true+dependencies:react: 19.3.0+ dependencies:+ bindings: 1.5.0+ nan: 2.30.0+ node-gyp: 7.1.2+ optional: true++ optional: true++ dependencies:+ assert-plus: 1.0.0+ core-util-is: 1.0.2+ extsprintf: 1.3.0+ optional: true+dependencies:'@types/unist': 3.0.3@@ -9673,6 +10354,11 @@ snapshots:siginfo: 2.0.0stackback: 0.0.2+ dependencies:+ string-width: 4.2.3+ optional: true+optionalDependencies:'@cloudflare/workerd-darwin-64': 1.20260926.1@@ -9714,6 +10400,13 @@ snapshots:+ dependencies:+ sax: 1.6.1+ xmlbuilder: 11.0.1++ [email protected]: {}+diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 61be05e..08a59e5 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -7,5 +7,7 @@ allowBuilds:esbuild: trueworkerd: trueelectron-winstaller: false+ # The Flatpak portal uses Node sockets; its optional native module is not bundled.+ usocket: falseminimumReleaseAgeExclude:diff --git a/tests/startup-portal.test.ts b/tests/startup-portal.test.tsnew file mode 100644index 0000000..bf10e62--- /dev/null+++ b/tests/startup-portal.test.ts@@ -0,0 +1,81 @@+import { afterEach, expect, it } from 'vitest'+import { spawn } from 'node:child_process'+import { createRequire } from 'node:module'+import { once } from 'node:events'+import { requestBackground } from '../apps/desktop/src/main/startup-portal'++// Exercise real D-Bus serialization, match registration and an immediate portal+// response on a private bus. Never talk to the user's desktop permission service.+const require = createRequire(new URL('../apps/desktop/package.json', import.meta.url))+const { sessionBus, Message, MessageType, Variant } = require('dbus-next')+const originalAddress = process.env.DBUS_SESSION_BUS_ADDRESS+const cleanup: (() => void)[] = []+afterEach(() => {+ cleanup+ .splice(0)+ .reverse()+ .forEach((fn) => fn())+ if (originalAddress === undefined) delete process.env.DBUS_SESSION_BUS_ADDRESS+ else process.env.DBUS_SESSION_BUS_ADDRESS = originalAddress+})++it.skipIf(process.platform !== 'linux')(+ 'waits for the Flatpak portal Response and honors grant, refusal and disabling',+ async () => {+ const daemon = spawn('dbus-daemon', ['--session', '--nofork', '--print-address=1'], {+ stdio: ['ignore', 'pipe', 'pipe'],+ })+ cleanup.push(() => daemon.kill())+ const address = await new Promise<string>((resolve, reject) => {+ daemon.once('error', reject)+ daemon.stdout.once('data', (chunk) => resolve(chunk.toString().trim()))+ daemon.once('exit', (code) => reject(new Error('Private D-Bus exited: ' + code)))+ })+ process.env.DBUS_SESSION_BUS_ADDRESS = address+ const service = sessionBus()+ cleanup.push(() => service.disconnect())+ await once(service, 'connect')+ await service.requestName('org.freedesktop.portal.Desktop', 0)+ let granted = true+ let seen: unknown+ service.addMethodHandler(+ (message: {+ type: number+ interface: string+ member: string+ sender: string+ body: [string, Record<string, { value: unknown }>]+ }) => {+ if (+ message.interface !== 'org.freedesktop.portal.Background' ||+ message.member !== 'RequestBackground'+ )+ return false+ const options = message.body[1]+ seen = options+ const requestPath =+ '/org/freedesktop/portal/desktop/request/' ++ message.sender.slice(1).replaceAll('.', '_') ++ '/' ++ options.handle_token.value+ service.send(Message.newMethodReturn(message, 'o', [requestPath]))+ // The response can arrive before the method's await resumes.+ service.send(+ Message.newSignal(requestPath, 'org.freedesktop.portal.Request', 'Response', 'ua{sv}', [+ granted ? 0 : 1,+ { autostart: new Variant('b', granted && options.autostart.value) },+ ]),+ )+ return true+ },+ )+ expect(await requestBackground(true)).toBe(true)+ expect(seen).toMatchObject({+ autostart: { value: true },+ commandline: { value: ['inlark', '--autostart'] },+ })+ expect(await requestBackground(false)).toBe(false)+ granted = false+ await expect(requestBackground(true)).rejects.toThrow('permission was not granted')+ },+)diff --git a/tests/startup.test.ts b/tests/startup.test.tsnew file mode 100644index 0000000..521c842--- /dev/null+++ b/tests/startup.test.ts@@ -0,0 +1,227 @@+import { afterEach, describe, expect, it, vi } from 'vitest'+import { mkdtemp, mkdir, readFile, rm, writeFile } from 'node:fs/promises'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import {+ StartupManager,+ desktopExec,+ startInTray,+ type StartupOptions,+} from '../apps/desktop/src/main/startup'++const directories: string[] = []+afterEach(async () => {+ await Promise.all(directories.splice(0).map((path) => rm(path, { recursive: true, force: true })))+})+async function fixture(+ platform: NodeJS.Platform = 'linux',+ overrides: Partial<StartupOptions> = {},+) {+ const home = await mkdtemp(join(tmpdir(), 'inlark-startup-'))+ directories.push(home)+ let data: unknown+ const store = {+ read: async <T>(_name: string, fallback: T): Promise<T> =>+ data ? (structuredClone(data) as T) : fallback,+ write: vi.fn(async (_name: string, value: unknown) => {+ data = structuredClone(value)+ }),+ }+ let login = {+ openAtLogin: false,+ executableWillLaunchAtLogin: false,+ wasOpenedAtLogin: false,+ status: 'not-registered',+ }+ const options: StartupOptions = {+ app: {+ isPackaged: true,+ getLoginItemSettings: vi.fn(() => login as Electron.LoginItemSettings),+ setLoginItemSettings: vi.fn((next) => {+ login = {+ ...login,+ openAtLogin: !!next.openAtLogin,+ executableWillLaunchAtLogin: !!next.openAtLogin,+ status: next.openAtLogin ? 'enabled' : 'not-registered',+ }+ }),+ },+ store,+ platform,+ home,+ env: {},+ execPath: '/opt/inlark/inlark',+ disabled: false,+ askMac: vi.fn(async () => true),+ requestBackground: vi.fn(async (enabled) => enabled),+ ...overrides,+ }+ const manager = new StartupManager(options)+ await manager.load()+ return {+ manager,+ options,+ home,+ entry: join(home, '.config/autostart/inlark.desktop'),+ reload: async () => {+ const next = new StartupManager(options)+ await next.load()+ return next+ },+ setLogin: (value: Partial<typeof login>) => {+ login = { ...login, ...value }+ },+ }+}++describe('startup registration', () => {+ it('defaults Linux to startup in the tray and preserves preferences after restart', async () => {+ const f = await fixture()+ await f.manager.initialize()+ expect(await readFile(f.entry, 'utf8')).toContain('Exec="/opt/inlark/inlark" --autostart')+ expect(await f.manager.status()).toMatchObject({ enabled: true, startMinimized: true })+ await f.manager.set({ startMinimized: false })+ await f.manager.set({ enabled: false })+ expect(await readFile(f.entry, 'utf8')).toContain('Hidden=true')+ const next = await f.reload()+ await next.initialize()+ expect(await next.status()).toMatchObject({ enabled: false, startMinimized: false })+ })+ it('does not overwrite a Linux entry disabled through the desktop after initialization', async () => {+ const f = await fixture()+ await f.manager.initialize()+ await writeFile(f.entry, '[Desktop Entry]\nExec=inlark --autostart\nHidden=true\n')+ const next = await f.reload()+ await next.initialize()+ expect((await next.status()).enabled).toBe(false)+ await next.set({ startMinimized: false })+ expect((await next.status()).enabled).toBe(false)+ })+ it('uses XDG_CONFIG_HOME and the durable AppImage path', async () => {+ const f = await fixture()+ const config = join(f.home, 'custom-config')+ f.options.env = { XDG_CONFIG_HOME: config, APPIMAGE: '/home/me/Mail Client.AppImage' }+ await f.manager.initialize()+ expect(await readFile(join(config, 'autostart/inlark.desktop'), 'utf8')).toContain(+ 'Exec="/home/me/Mail Client.AppImage" --autostart',+ )+ })+ it('uses the Nix profile command instead of a versioned store path', async () => {+ const f = await fixture('linux', { execPath: '/nix/store/version-inlark/bin/inlark' })+ await f.manager.initialize()+ expect(await readFile(f.entry, 'utf8')).toContain('Exec="inlark" --autostart')+ })+ it('does not register development, smoke or demo runs', async () => {+ for (const disabled of [true, false]) {+ const f = await fixture('win32', { disabled })+ f.options.app.isPackaged = false+ await f.manager.initialize()+ expect(f.options.app.setLoginItemSettings).not.toHaveBeenCalled()+ expect((await f.manager.status()).supported).toBe(false)+ }+ const f = await fixture('linux', { disabled: true })+ await f.manager.initialize()+ expect(f.options.store.write).not.toHaveBeenCalled()+ })+ it('registers Windows with an automatic-launch marker and honors OS disabling', async () => {+ const f = await fixture('win32')+ await f.manager.initialize()+ expect(f.options.app.setLoginItemSettings).toHaveBeenCalledWith({+ openAtLogin: true,+ enabled: true,+ path: '/opt/inlark/inlark',+ args: ['--autostart'],+ })+ f.setLogin({ executableWillLaunchAtLogin: false })+ const next = await f.reload()+ await next.initialize()+ expect((await next.status()).enabled).toBe(false)+ expect(f.options.app.setLoginItemSettings).toHaveBeenCalledTimes(1)+ })+ it('asks once on macOS and remembers a declined invitation', async () => {+ const f = await fixture('darwin', { askMac: vi.fn(async () => false) })+ await f.manager.initialize()+ expect((await f.manager.status()).enabled).toBe(false)+ const next = await f.reload()+ await next.initialize()+ expect(f.options.askMac).toHaveBeenCalledTimes(1)+ await next.set({ enabled: true })+ expect((await next.status()).enabled).toBe(true)+ })+ it('surfaces macOS approval and detects a login launch without CLI arguments', async () => {+ const f = await fixture('darwin')+ await f.manager.initialize()+ f.setLogin({ openAtLogin: false, status: 'requires-approval', wasOpenedAtLogin: true })+ expect(await f.manager.status()).toMatchObject({ enabled: true, requiresApproval: true })+ expect(f.manager.wasOpenedAtLogin([])).toBe(true)+ })+ it('uses the Flatpak permission portal and does not retry a refusal automatically', async () => {+ const f = await fixture('linux', {+ env: { FLATPAK_ID: 'com.inlark.Inlark' },+ requestBackground: vi.fn(async () => false),+ })+ await f.manager.initialize()+ expect(f.options.requestBackground).toHaveBeenCalledWith(true)+ expect(await f.manager.status()).toMatchObject({ enabled: false, error: expect.any(String) })+ await expect(readFile(f.entry)).rejects.toMatchObject({ code: 'ENOENT' })+ const next = await f.reload()+ await next.initialize()+ expect(f.options.requestBackground).toHaveBeenCalledTimes(1)+ f.options.requestBackground = vi.fn(async (enabled) => enabled)+ expect(await next.set({ enabled: true })).toMatchObject({ enabled: true })+ expect(await next.set({ enabled: false })).toMatchObject({ enabled: false })+ })+ it('keeps mail usable when startup preferences are unreadable', async () => {+ const f = await fixture('win32')+ f.options.store.read = vi.fn(async () => {+ throw new Error('Corrupt file')+ })+ const next = await f.reload()+ await next.initialize()+ expect(await next.status()).toMatchObject({+ enabled: false,+ error: expect.stringContaining('read startup preferences'),+ })+ expect(f.options.app.setLoginItemSettings).not.toHaveBeenCalled()+ expect(await next.set({ enabled: true })).toMatchObject({ enabled: true, error: undefined })+ })+ it('recognizes an installed Nix wrapper despite Electron reporting an unpackaged runtime', async () => {+ const f = await fixture('linux', {+ installed: true,+ execPath: '/nix/store/electron/bin/electron',+ })+ f.options.app.isPackaged = false+ await f.manager.initialize()+ expect((await f.manager.status()).enabled).toBe(true)+ })+ it('recovers from registration failures without blocking subsequent settings saves', async () => {+ const f = await fixture('linux', { env: { XDG_CONFIG_HOME: '/dev/null/config' } })+ await f.manager.initialize()+ expect(await f.manager.status()).toMatchObject({ enabled: false, error: expect.any(String) })+ f.options.env = {}+ expect(await f.manager.set({ enabled: true })).toMatchObject({+ enabled: true,+ error: undefined,+ })+ })+})++describe('launch behavior', () => {+ const automatic = { automatic: true, startMinimized: true, trayAvailable: true, hasMailto: false }+ it('hides only automatic launches with a usable tray', () => {+ expect(startInTray(automatic)).toBe(true)+ for (const patch of [+ { automatic: false },+ { startMinimized: false },+ { trayAvailable: false },+ { hasMailto: true },+ ])+ expect(startInTray({ ...automatic, ...patch })).toBe(false)+ })+ it('quotes desktop paths without exposing shell syntax or desktop field codes', () => {+ expect(desktopExec('/tmp/100% "mail" $x`a`\\b')).toBe(+ '"/tmp/100%% \\\\"mail\\\\" \\\\$x\\\\`a\\\\`\\\\\\\\b"',+ )+ expect(() => desktopExec('/tmp/mail\nExec=evil')).toThrow()+ })+})