diff --git a/.changeset/config.json b/.changeset/config.json
index 07cbd1b..17b6fcd 100644
--- a/.changeset/config.json
+++ b/.changeset/config.json
@@ -7,6 +7,7 @@
"@crypt.fyi/core",
"@crypt.fyi/cli",
"@crypt.fyi/extension",
+ "@crypt.fyi/desktop",
"@crypt.fyi/web",
"@crypt.fyi/server"
]
diff --git a/.changeset/desktop-app.md b/.changeset/desktop-app.md
new file mode 100644
index 0000000..1526c40
--- /dev/null
+++ b/.changeset/desktop-app.md
@@ -0,0 +1,6 @@
+---
+'@crypt.fyi/desktop': patch
+'@crypt.fyi/core': patch
+---
+
+Add a cross-platform desktop app (macOS, Windows, Linux) that lives in the tray and creates end-to-end encrypted secret links from anywhere with a global shortcut, prefilled from the clipboard. Adds its translations to every locale.
diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml
new file mode 100644
index 0000000..0ab0718
--- /dev/null
+++ b/.github/workflows/desktop.yml
@@ -0,0 +1,113 @@
+name: Desktop
+
+# Builds the Tauri desktop app on every platform it ships for. Kept separate from CI so the
+# main pipeline never needs a Rust toolchain or native WebView libraries.
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'packages/desktop/**'
+ - 'packages/core/**'
+ - 'packages/theme/**'
+ - 'pnpm-lock.yaml'
+ - '.github/workflows/desktop.yml'
+ pull_request:
+ branches: [main]
+ paths:
+ - 'packages/desktop/**'
+ - 'packages/core/**'
+ - 'packages/theme/**'
+ - 'pnpm-lock.yaml'
+ - '.github/workflows/desktop.yml'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: desktop-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ name: Build (${{ matrix.name }})
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - name: macOS (Apple Silicon)
+ platform: macos-latest
+ args: --target aarch64-apple-darwin
+ rust-targets: aarch64-apple-darwin
+ - name: macOS (Intel)
+ platform: macos-latest
+ args: --target x86_64-apple-darwin
+ rust-targets: x86_64-apple-darwin
+ - name: Linux
+ platform: ubuntu-22.04
+ args: ''
+ rust-targets: ''
+ - name: Windows
+ platform: windows-latest
+ args: ''
+ rust-targets: ''
+ runs-on: ${{ matrix.platform }}
+
+ steps:
+ - uses: actions/checkout@v7
+
+ - name: Install Linux dependencies
+ if: runner.os == 'Linux'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
+
+ - name: Setup Rust
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: ${{ matrix.rust-targets }}
+
+ - name: Cache Rust build
+ uses: Swatinem/rust-cache@v2
+ with:
+ workspaces: packages/desktop/src-tauri -> target
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v6
+ with:
+ run_install: false
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version-file: .nvmrc
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ # tauri::generate_context! embeds the built frontend, so it must exist before clippy runs;
+ # turbo builds @crypt.fyi/core first because the frontend imports its dist output.
+ - name: Build frontend
+ run: pnpm turbo build --filter=@crypt.fyi/desktop
+
+ - name: Lint Rust
+ working-directory: packages/desktop/src-tauri
+ run: |
+ cargo fmt --check
+ cargo clippy --all-targets ${{ matrix.args }} -- -D warnings
+
+ - name: Upload Cargo.lock
+ if: runner.os == 'Linux'
+ uses: actions/upload-artifact@v7
+ with:
+ name: cargo-lock
+ path: packages/desktop/src-tauri/Cargo.lock
+
+ - name: Build app
+ uses: tauri-apps/tauri-action@v1
+ with:
+ projectPath: packages/desktop
+ tauriScript: pnpm tauri
+ args: ${{ matrix.args }}
+ uploadWorkflowArtifacts: true
diff --git a/.prettierignore b/.prettierignore
index 9d2d335..a612143 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -8,3 +8,5 @@ pnpm-lock.yaml
**/test-results/
**/playwright-report/
**/blob-report/
+**/src-tauri/target
+**/src-tauri/gen
diff --git a/AGENTS.md b/AGENTS.md
index 5323460..21d5daf 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -15,7 +15,8 @@ pnpm + Turborepo monorepo (`Node >= 22`, Active LTS 26 in `.nvmrc`/CI/Docker; `p
| `@crypt.fyi/server` | Fastify API + Redis |
| `@crypt.fyi/cli` | npm CLI |
| `@crypt.fyi/extension` | Chrome extension |
-| `@crypt.fyi/theme` | Design tokens, fonts and theme logic shared by web and extension (private, no build) |
+| `@crypt.fyi/desktop` | Tauri tray app (macOS/Windows/Linux); Rust in `src-tauri` is only built by the Desktop workflow (private) |
+| `@crypt.fyi/theme` | Design tokens, fonts and theme logic shared by web, extension and desktop (private, no build) |
Encryption/decryption and key material live in `@crypt.fyi/core` and must stay client-side. The server stores ciphertext and verification hashes only — never plaintext secrets or raw keys/passwords.
@@ -61,7 +62,7 @@ When adding or changing UI copy:
## Theming
-Change colors, fonts, radii and theme behavior in `packages/theme`, not per package, so web and the extension stay in step. UI components are not shared: web uses React/shadcn and the extension settings page is plain HTML.
+Change colors, fonts, radii and theme behavior in `packages/theme`, not per package, so web, the extension and the desktop app stay in step. UI components are not shared: web uses React/shadcn, while the extension settings page and the desktop app are plain HTML.
## Coding norms
diff --git a/README.md b/README.md
index 8c7d9fa..7b97231 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,7 @@
- 📱 QR code generation
- ⌨️ [CLI](https://www.npmjs.com/package/@crypt.fyi/cli) for interacting with the API
- 🧩 [Chrome Extension](https://chromewebstore.google.com/detail/cryptfyi/hkmbmkjfjfdbpohlllleaacjkacfhald)
+- 🖥️ [Desktop app](./packages/desktop/README.md) for macOS, Windows and Linux: a tray app with a global shortcut that turns your clipboard into a secret link from anywhere
- 🐳 Docker images for the api server and web client
- 🌐 Internationalization support for multiple languages
- Currently supported: [View supported languages](https://github.com/osbytes/crypt.fyi/tree/main/packages/core/src/i18n/locales)
@@ -197,6 +198,7 @@ Publishable packages: `@crypt.fyi/core` and `@crypt.fyi/cli` (npm), plus the Chr
- [Fastify](https://fastify.dev/)
- [Redis](https://redis.io/)
- [OpenTelemetry](https://opentelemetry.io/)
+- [Tauri](https://v2.tauri.app/) (desktop app)
## Known Issues & Development Considerations
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 320dce3..6263ac9 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -34,7 +34,7 @@ export default [
},
// Browser environment config
{
- files: ['packages/web/**/*', 'packages/extension/**/*'],
+ files: ['packages/web/**/*', 'packages/extension/**/*', 'packages/desktop/**/*'],
languageOptions: {
globals: Object.fromEntries(
Object.entries(globals.browser).map(([key, value]) => [key.trim(), value]),
diff --git a/packages/core/src/i18n/locales/de.ts b/packages/core/src/i18n/locales/de.ts
index 454886a..9d53729 100644
--- a/packages/core/src/i18n/locales/de.ts
+++ b/packages/core/src/i18n/locales/de.ts
@@ -437,4 +437,70 @@ export const de: TranslationKeys = {
'Wenn Sie Fragen zu dieser Datenschutzerklärung haben, können Sie uns über unsere',
},
},
+ desktop: {
+ tagline: 'Desktop-App',
+ tray: {
+ newSecret: 'Neues Geheimnis',
+ settings: 'Einstellungen',
+ quit: 'crypt.fyi beenden',
+ },
+ create: {
+ title: 'Neues Geheimnis',
+ contentLabel: 'Geheimnis',
+ contentPlaceholder: 'Text zum Verschlüsseln einfügen oder eingeben',
+ fromClipboard: 'Aus der Zwischenablage übernommen. Vor dem Teilen prüfen.',
+ passwordLabel: 'Passwort (optional)',
+ passwordPlaceholder: 'Teile es dem Empfänger separat mit',
+ ttlLabel: 'Läuft ab nach',
+ burnLabel: 'Nach dem Lesen löschen',
+ burnDescription: 'Löscht das Geheimnis nach dem ersten erfolgreichen Lesen.',
+ submit: 'Verschlüsseln und Link kopieren',
+ submitting: 'Wird verschlüsselt…',
+ shortcutHint: 'Drücke überall {{shortcut}}, um dieses Fenster zu öffnen. Esc blendet es aus.',
+ emptyError: 'Gib ein Geheimnis zum Verschlüsseln ein.',
+ },
+ result: {
+ title: 'Link kopiert',
+ description:
+ 'Das Geheimnis wurde auf diesem Gerät verschlüsselt. Der Server sieht weder den Inhalt noch den Schlüssel.',
+ linkLabel: 'Geheimnis-Link',
+ passwordReminder: 'Sende das Passwort über einen anderen Kanal als den Link.',
+ notificationTitle: 'Geheimnis-Link kopiert',
+ notificationBody: 'Füge ihn überall zum Teilen ein. Er wurde auf diesem Gerät verschlüsselt.',
+ done: 'Fertig',
+ },
+ settings: {
+ title: 'Einstellungen',
+ back: 'Zurück',
+ server: 'Server',
+ apiUrl: 'API-URL',
+ webUrl: 'Web-URL',
+ endpointHint: 'Verwende https. Unverschlüsseltes http ist nur für localhost erlaubt.',
+ shortcut: 'Globales Tastenkürzel',
+ shortcutHint: 'Wähle das Feld aus und drücke eine Tastenkombination mit Strg, Alt oder Cmd.',
+ shortcutRecording: 'Tastenkombination drücken…',
+ defaults: 'Standardwerte für neue Geheimnisse',
+ prefillFromClipboard: 'Neue Geheimnisse aus der Zwischenablage füllen',
+ appearance: 'Darstellung',
+ language: 'Sprache',
+ languageSystem: 'Systemstandard',
+ save: 'Speichern',
+ saved: 'Einstellungen gespeichert.',
+ reset: 'Auf Standardwerte zurücksetzen',
+ invalidUrl: '{{field}} muss eine https-URL sein (http ist nur für localhost erlaubt).',
+ invalidShortcut: 'Verwende eine Tastenkombination mit Strg, Alt oder Cmd.',
+ },
+ errors: {
+ network:
+ '{{host}} ist nicht erreichbar. Prüfe deine Verbindung und die API-URL in den Einstellungen.',
+ rateLimited: 'Zu viele Anfragen. Warte einen Moment und versuche es erneut.',
+ tooLarge: 'Dieses Geheimnis ist zu groß für den Server.',
+ server: 'Der Server hat die Anfrage abgelehnt (Status {{status}}).',
+ unknown: 'Beim Erstellen des Geheimnisses ist ein Fehler aufgetreten.',
+ clipboard:
+ 'Das Geheimnis wurde erstellt, aber der Link konnte nicht kopiert werden. Kopiere ihn unten.',
+ shortcutUnavailable:
+ '{{shortcut}} konnte nicht registriert werden. Eine andere App verwendet es möglicherweise bereits.',
+ },
+ },
};
diff --git a/packages/core/src/i18n/locales/en.ts b/packages/core/src/i18n/locales/en.ts
index 0c5b7f1..fda2306 100644
--- a/packages/core/src/i18n/locales/en.ts
+++ b/packages/core/src/i18n/locales/en.ts
@@ -430,4 +430,68 @@ export const en: TranslationKeys = {
'If you have any questions about this Privacy Policy, you can contact us through our',
},
},
+ desktop: {
+ tagline: 'Desktop app',
+ tray: {
+ newSecret: 'New secret',
+ settings: 'Settings',
+ quit: 'Quit crypt.fyi',
+ },
+ create: {
+ title: 'New secret',
+ contentLabel: 'Secret',
+ contentPlaceholder: 'Paste or type the text to encrypt',
+ fromClipboard: 'Filled from your clipboard. Check it before sharing.',
+ passwordLabel: 'Password (optional)',
+ passwordPlaceholder: 'Share it with the recipient separately',
+ ttlLabel: 'Expires after',
+ burnLabel: 'Burn after reading',
+ burnDescription: 'Delete the secret after the first successful read.',
+ submit: 'Encrypt and copy link',
+ submitting: 'Encrypting…',
+ shortcutHint: 'Press {{shortcut}} anywhere to open this window. Esc hides it.',
+ emptyError: 'Enter a secret to encrypt.',
+ },
+ result: {
+ title: 'Link copied',
+ description:
+ 'The secret was encrypted on this device. The server never sees its content or the key.',
+ linkLabel: 'Secret link',
+ passwordReminder: 'Send the password through a different channel than the link.',
+ notificationTitle: 'Secret link copied',
+ notificationBody: 'Paste it anywhere to share. It was encrypted on this device.',
+ done: 'Done',
+ },
+ settings: {
+ title: 'Settings',
+ back: 'Back',
+ server: 'Server',
+ apiUrl: 'API URL',
+ webUrl: 'Web URL',
+ endpointHint: 'Use https. Plain http is only allowed for localhost.',
+ shortcut: 'Global shortcut',
+ shortcutHint:
+ 'Select the field, then press a key combination that includes Ctrl, Alt or Cmd.',
+ shortcutRecording: 'Press a key combination…',
+ defaults: 'Defaults for new secrets',
+ prefillFromClipboard: 'Fill new secrets from the clipboard',
+ appearance: 'Appearance',
+ language: 'Language',
+ languageSystem: 'System default',
+ save: 'Save',
+ saved: 'Settings saved.',
+ reset: 'Reset to defaults',
+ invalidUrl: '{{field}} must be an https URL (http is only allowed for localhost).',
+ invalidShortcut: 'Use a key combination that includes Ctrl, Alt or Cmd.',
+ },
+ errors: {
+ network: 'Could not reach {{host}}. Check your connection and the API URL in settings.',
+ rateLimited: 'Too many requests. Wait a moment and try again.',
+ tooLarge: 'This secret is too large for the server.',
+ server: 'The server rejected the request (status {{status}}).',
+ unknown: 'Something went wrong while creating the secret.',
+ clipboard: 'The secret was created, but the link could not be copied. Copy it below.',
+ shortcutUnavailable: 'Could not register {{shortcut}}. Another app may already use it.',
+ },
+ },
};
diff --git a/packages/core/src/i18n/locales/es.ts b/packages/core/src/i18n/locales/es.ts
index f8b1ce1..abd5140 100644
--- a/packages/core/src/i18n/locales/es.ts
+++ b/packages/core/src/i18n/locales/es.ts
@@ -435,4 +435,70 @@ export const es: TranslationKeys = {
'Si tienes preguntas sobre esta Política de Privacidad, puedes contactarnos a través de nuestra',
},
},
+ desktop: {
+ tagline: 'Aplicación de escritorio',
+ tray: {
+ newSecret: 'Nuevo secreto',
+ settings: 'Ajustes',
+ quit: 'Salir de crypt.fyi',
+ },
+ create: {
+ title: 'Nuevo secreto',
+ contentLabel: 'Secreto',
+ contentPlaceholder: 'Pega o escribe el texto que quieres cifrar',
+ fromClipboard: 'Rellenado desde tu portapapeles. Revísalo antes de compartirlo.',
+ passwordLabel: 'Contraseña (opcional)',
+ passwordPlaceholder: 'Compártela con el destinatario por separado',
+ ttlLabel: 'Caduca en',
+ burnLabel: 'Destruir después de leer',
+ burnDescription: 'Elimina el secreto tras la primera lectura correcta.',
+ submit: 'Cifrar y copiar enlace',
+ submitting: 'Cifrando…',
+ shortcutHint: 'Pulsa {{shortcut}} en cualquier lugar para abrir esta ventana. Esc la oculta.',
+ emptyError: 'Introduce un secreto para cifrarlo.',
+ },
+ result: {
+ title: 'Enlace copiado',
+ description:
+ 'El secreto se cifró en este dispositivo. El servidor nunca ve su contenido ni la clave.',
+ linkLabel: 'Enlace del secreto',
+ passwordReminder: 'Envía la contraseña por un canal distinto al del enlace.',
+ notificationTitle: 'Enlace del secreto copiado',
+ notificationBody: 'Pégalo donde quieras para compartirlo. Se cifró en este dispositivo.',
+ done: 'Listo',
+ },
+ settings: {
+ title: 'Ajustes',
+ back: 'Volver',
+ server: 'Servidor',
+ apiUrl: 'URL de la API',
+ webUrl: 'URL web',
+ endpointHint: 'Usa https. http solo se permite para localhost.',
+ shortcut: 'Atajo global',
+ shortcutHint:
+ 'Selecciona el campo y pulsa una combinación de teclas que incluya Ctrl, Alt o Cmd.',
+ shortcutRecording: 'Pulsa una combinación de teclas…',
+ defaults: 'Valores predeterminados para nuevos secretos',
+ prefillFromClipboard: 'Rellenar nuevos secretos desde el portapapeles',
+ appearance: 'Apariencia',
+ language: 'Idioma',
+ languageSystem: 'Predeterminado del sistema',
+ save: 'Guardar',
+ saved: 'Ajustes guardados.',
+ reset: 'Restablecer valores predeterminados',
+ invalidUrl: '{{field}} debe ser una URL https (http solo se permite para localhost).',
+ invalidShortcut: 'Usa una combinación de teclas que incluya Ctrl, Alt o Cmd.',
+ },
+ errors: {
+ network:
+ 'No se pudo conectar con {{host}}. Comprueba tu conexión y la URL de la API en los ajustes.',
+ rateLimited: 'Demasiadas solicitudes. Espera un momento y vuelve a intentarlo.',
+ tooLarge: 'Este secreto es demasiado grande para el servidor.',
+ server: 'El servidor rechazó la solicitud (estado {{status}}).',
+ unknown: 'Algo salió mal al crear el secreto.',
+ clipboard: 'El secreto se creó, pero no se pudo copiar el enlace. Cópialo abajo.',
+ shortcutUnavailable:
+ 'No se pudo registrar {{shortcut}}. Puede que otra aplicación ya lo use.',
+ },
+ },
};
diff --git a/packages/core/src/i18n/locales/fr.ts b/packages/core/src/i18n/locales/fr.ts
index e9c43c4..bff3ba2 100644
--- a/packages/core/src/i18n/locales/fr.ts
+++ b/packages/core/src/i18n/locales/fr.ts
@@ -437,4 +437,72 @@ export const fr: TranslationKeys = {
'Si vous avez des questions concernant cette Politique de Confidentialité, vous pouvez nous contacter via notre',
},
},
+ desktop: {
+ tagline: 'Application de bureau',
+ tray: {
+ newSecret: 'Nouveau secret',
+ settings: 'Paramètres',
+ quit: 'Quitter crypt.fyi',
+ },
+ create: {
+ title: 'Nouveau secret',
+ contentLabel: 'Secret',
+ contentPlaceholder: 'Collez ou saisissez le texte à chiffrer',
+ fromClipboard: 'Rempli depuis votre presse-papiers. Vérifiez-le avant de le partager.',
+ passwordLabel: 'Mot de passe (facultatif)',
+ passwordPlaceholder: 'Communiquez-le séparément au destinataire',
+ ttlLabel: 'Expire après',
+ burnLabel: 'Détruire après lecture',
+ burnDescription: 'Supprime le secret après la première lecture réussie.',
+ submit: 'Chiffrer et copier le lien',
+ submitting: 'Chiffrement…',
+ shortcutHint:
+ "Appuyez sur {{shortcut}} n'importe où pour ouvrir cette fenêtre. Échap la masque.",
+ emptyError: 'Saisissez un secret à chiffrer.',
+ },
+ result: {
+ title: 'Lien copié',
+ description:
+ 'Le secret a été chiffré sur cet appareil. Le serveur ne voit jamais son contenu ni la clé.',
+ linkLabel: 'Lien du secret',
+ passwordReminder: 'Envoyez le mot de passe par un autre canal que le lien.',
+ notificationTitle: 'Lien du secret copié',
+ notificationBody:
+ "Collez-le n'importe où pour le partager. Il a été chiffré sur cet appareil.",
+ done: 'Terminé',
+ },
+ settings: {
+ title: 'Paramètres',
+ back: 'Retour',
+ server: 'Serveur',
+ apiUrl: "URL de l'API",
+ webUrl: 'URL web',
+ endpointHint: "Utilisez https. Le http simple n'est autorisé que pour localhost.",
+ shortcut: 'Raccourci global',
+ shortcutHint:
+ 'Sélectionnez le champ, puis appuyez sur une combinaison de touches avec Ctrl, Alt ou Cmd.',
+ shortcutRecording: 'Appuyez sur une combinaison de touches…',
+ defaults: 'Valeurs par défaut des nouveaux secrets',
+ prefillFromClipboard: 'Remplir les nouveaux secrets depuis le presse-papiers',
+ appearance: 'Apparence',
+ language: 'Langue',
+ languageSystem: 'Langue du système',
+ save: 'Enregistrer',
+ saved: 'Paramètres enregistrés.',
+ reset: 'Rétablir les valeurs par défaut',
+ invalidUrl: "{{field}} doit être une URL https (http n'est autorisé que pour localhost).",
+ invalidShortcut: 'Utilisez une combinaison de touches avec Ctrl, Alt ou Cmd.',
+ },
+ errors: {
+ network:
+ "Impossible de joindre {{host}}. Vérifiez votre connexion et l'URL de l'API dans les paramètres.",
+ rateLimited: 'Trop de requêtes. Patientez un instant puis réessayez.',
+ tooLarge: 'Ce secret est trop volumineux pour le serveur.',
+ server: 'Le serveur a refusé la requête (statut {{status}}).',
+ unknown: 'Une erreur est survenue lors de la création du secret.',
+ clipboard: "Le secret a été créé, mais le lien n'a pas pu être copié. Copiez-le ci-dessous.",
+ shortcutUnavailable:
+ "Impossible d'enregistrer {{shortcut}}. Une autre application l'utilise peut-être déjà.",
+ },
+ },
};
diff --git a/packages/core/src/i18n/locales/zh.ts b/packages/core/src/i18n/locales/zh.ts
index d4a2b37..a5fd1ec 100644
--- a/packages/core/src/i18n/locales/zh.ts
+++ b/packages/core/src/i18n/locales/zh.ts
@@ -409,4 +409,66 @@ export const zh: TranslationKeys = {
description: '如果您对本隐私政策有任何问题,您可以通过我们的',
},
},
+ desktop: {
+ tagline: '桌面应用',
+ tray: {
+ newSecret: '新建密文',
+ settings: '设置',
+ quit: '退出 crypt.fyi',
+ },
+ create: {
+ title: '新建密文',
+ contentLabel: '密文',
+ contentPlaceholder: '粘贴或输入要加密的文本',
+ fromClipboard: '已从剪贴板填充。分享前请先检查。',
+ passwordLabel: '密码(可选)',
+ passwordPlaceholder: '请单独告知接收者',
+ ttlLabel: '过期时间',
+ burnLabel: '阅后即焚',
+ burnDescription: '首次成功读取后删除密文。',
+ submit: '加密并复制链接',
+ submitting: '正在加密…',
+ shortcutHint: '在任意位置按 {{shortcut}} 打开此窗口。按 Esc 隐藏。',
+ emptyError: '请输入要加密的密文。',
+ },
+ result: {
+ title: '链接已复制',
+ description: '密文已在此设备上加密。服务器永远看不到其内容或密钥。',
+ linkLabel: '密文链接',
+ passwordReminder: '请通过与链接不同的渠道发送密码。',
+ notificationTitle: '密文链接已复制',
+ notificationBody: '粘贴到任意位置即可分享。内容已在此设备上加密。',
+ done: '完成',
+ },
+ settings: {
+ title: '设置',
+ back: '返回',
+ server: '服务器',
+ apiUrl: 'API 地址',
+ webUrl: '网页地址',
+ endpointHint: '请使用 https。仅 localhost 允许使用 http。',
+ shortcut: '全局快捷键',
+ shortcutHint: '选中此字段,然后按下包含 Ctrl、Alt 或 Cmd 的组合键。',
+ shortcutRecording: '请按下组合键…',
+ defaults: '新密文的默认设置',
+ prefillFromClipboard: '从剪贴板填充新密文',
+ appearance: '外观',
+ language: '语言',
+ languageSystem: '跟随系统',
+ save: '保存',
+ saved: '设置已保存。',
+ reset: '恢复默认设置',
+ invalidUrl: '{{field}} 必须是 https 地址(仅 localhost 允许使用 http)。',
+ invalidShortcut: '请使用包含 Ctrl、Alt 或 Cmd 的组合键。',
+ },
+ errors: {
+ network: '无法连接到 {{host}}。请检查网络连接以及设置中的 API 地址。',
+ rateLimited: '请求过多。请稍后再试。',
+ tooLarge: '此密文过大,服务器无法接收。',
+ server: '服务器拒绝了请求(状态码 {{status}})。',
+ unknown: '创建密文时出错。',
+ clipboard: '密文已创建,但无法复制链接。请在下方复制。',
+ shortcutUnavailable: '无法注册 {{shortcut}}。它可能已被其他应用占用。',
+ },
+ },
};
diff --git a/packages/core/src/i18n/types.ts b/packages/core/src/i18n/types.ts
index c02d49f..50a8913 100644
--- a/packages/core/src/i18n/types.ts
+++ b/packages/core/src/i18n/types.ts
@@ -390,6 +390,68 @@ export interface TranslationKeys {
description: string;
};
};
+ desktop: {
+ tagline: string;
+ tray: {
+ newSecret: string;
+ settings: string;
+ quit: string;
+ };
+ create: {
+ title: string;
+ contentLabel: string;
+ contentPlaceholder: string;
+ fromClipboard: string;
+ passwordLabel: string;
+ passwordPlaceholder: string;
+ ttlLabel: string;
+ burnLabel: string;
+ burnDescription: string;
+ submit: string;
+ submitting: string;
+ shortcutHint: string;
+ emptyError: string;
+ };
+ result: {
+ title: string;
+ description: string;
+ linkLabel: string;
+ passwordReminder: string;
+ notificationTitle: string;
+ notificationBody: string;
+ done: string;
+ };
+ settings: {
+ title: string;
+ back: string;
+ server: string;
+ apiUrl: string;
+ webUrl: string;
+ endpointHint: string;
+ shortcut: string;
+ shortcutHint: string;
+ shortcutRecording: string;
+ defaults: string;
+ prefillFromClipboard: string;
+ appearance: string;
+ language: string;
+ languageSystem: string;
+ save: string;
+ saved: string;
+ reset: string;
+ invalidUrl: string;
+ invalidShortcut: string;
+ };
+ errors: {
+ network: string;
+ rateLimited: string;
+ tooLarge: string;
+ server: string;
+ unknown: string;
+ clipboard: string;
+ shortcutUnavailable: string;
+ };
+ };
}
export type TranslationNamespace = keyof TranslationKeys;
diff --git a/packages/desktop/README.md b/packages/desktop/README.md
new file mode 100644
index 0000000..c9d1bcc
--- /dev/null
+++ b/packages/desktop/README.md
@@ -0,0 +1,75 @@
+# crypt.fyi Desktop
+
+A tray (menu bar) app for macOS, Windows and Linux that creates crypt.fyi secret links from anywhere. Press the global shortcut, the quick-create window opens with your clipboard already filled in, and one keystroke later the encrypted link is on your clipboard.
+
+Built with [Tauri 2](https://v2.tauri.app/): a small native shell around the system WebView, with the same `@crypt.fyi/core` encryption the web client, CLI and browser extension use.
+
+## Features
+
+- Global shortcut (default `Ctrl+Alt+Shift+E`, `⌘⌥⇧E` on macOS) opens or hides the quick-create window from any app
+- Prefills the secret from the clipboard (can be turned off), then replaces the clipboard with the link
+- Per-secret password, expiry (5 minutes to 7 days) and burn after reading
+- A notification confirms the copy; if notifications are blocked, the window shows the link instead
+- Tray menu: New secret, Settings, Quit. Closing the window keeps the app running in the tray
+- Settings: API URL, web URL, shortcut, default expiry and burn, clipboard prefill, language and theme
+- Translated into every language the web client supports
+
+## Usage
+
+| Action | How |
+| --- | --- |
+| Open the quick-create window | Global shortcut, or **New secret** in the tray menu |
+| Create and copy the link | **Encrypt and copy link**, or `Ctrl+Enter` / `⌘↩` in the secret field |
+| Hide the window | `Esc`, the shortcut again, or the window's close button |
+| Change the shortcut | **Settings**, select the shortcut field and press a new combination (it must include Ctrl, Alt or Cmd) |
+| Quit | **Quit crypt.fyi** in the tray menu |
+
+On macOS the app has no Dock icon; look for it in the menu bar. Some Linux desktops (GNOME without the AppIndicator extension, for example) hide tray icons, and global shortcuts are not available under Wayland sessions that block them; the window still opens when you launch the app again.
+
+## Security model
+
+- **Encryption stays on the device.** The key is generated, the content compressed and encrypted, and the verification hash derived inside the app's WebView by `@crypt.fyi/core`. The server only receives ciphertext and the hash, exactly as with the web client. See [SPECIFICATION.md](../../SPECIFICATION.md).
+- **Nothing secret is stored.** Settings (endpoints, shortcut, defaults) live in the WebView's local storage. Secret content, passwords and links are only held in the form while the window is open and cleared whenever it hides. Notifications never contain the link, because notification centers keep a history.
+- **Narrow native surface.** The Rust side only owns the tray and window lifecycle and never sees secret material. The window's [capability](src-tauri/capabilities/default.json) allows clipboard text, the global shortcut, notifications and showing/hiding itself; there is no filesystem, shell, process or HTTP plugin.
+- **Strict CSP.** Scripts, styles and fonts load only from the app bundle. `connect-src` allows `https:` (any API you configure) and plain `http` only on loopback for local development. Settings reject other URLs so a misconfigured endpoint fails up front instead of at request time.
+
+## Development
+
+The frontend is plain TypeScript and Tailwind on Vite, styled with [`@crypt.fyi/theme`](../theme/README.md) like the extension's settings page. Running the app needs the [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/): a Rust toolchain plus, on Linux, `libwebkit2gtk-4.1-dev`, `libappindicator3-dev` and `librsvg2-dev`.
+
+```bash
+pnpm install
+pnpm --filter @crypt.fyi/core build # the app imports core's build output
+
+pnpm --filter @crypt.fyi/desktop tauri:dev
+```
+
+To point the app at a local API (`pnpm dev` at the repo root serves one on `http://localhost:4321`), set the API URL in Settings to `http://localhost:4321` and the web URL to `http://localhost:5173`.
+
+Checks that run in the normal workspace pipeline and need no Rust:
+
+```bash
+pnpm --filter @crypt.fyi/desktop typecheck
+pnpm --filter @crypt.fyi/desktop lint
+pnpm --filter @crypt.fyi/desktop test
+pnpm --filter @crypt.fyi/desktop build # frontend only, into dist/
+```
+
+## Building installers
+
+```bash
+pnpm --filter @crypt.fyi/desktop tauri:build
+```
+
+Bundles land in `src-tauri/target/release/bundle/` (`.dmg`/`.app` on macOS, `.msi`/NSIS `.exe` on Windows, `.deb`/`.rpm`/`.AppImage` on Linux). Each platform has to be built on that platform.
+
+The [Desktop workflow](../../.github/workflows/desktop.yml) builds all of them on GitHub Actions for every change to this package, `core` or `theme`, and attaches the installers to the run as artifacts. The builds are not code-signed yet, so macOS Gatekeeper and Windows SmartScreen will warn on first launch.
+
+## Install from a CI build
+
+1. Open the latest successful [Desktop workflow run](https://github.com/osbytes/crypt.fyi/actions/workflows/desktop.yml) and download the artifact for your platform.
+2. Install it:
+ - **macOS:** open the `.dmg`, drag crypt.fyi to Applications, then right-click the app and choose **Open** the first time (the build is unsigned).
+ - **Windows:** run the `.msi` or `-setup.exe`; in SmartScreen choose **More info → Run anyway**.
+ - **Linux:** install the `.deb` (`sudo apt install ./crypt.fyi_*.deb`) or `.rpm`, or make the `.AppImage` executable and run it.
+3. Launch crypt.fyi. It opens once, then lives in the tray; use the shortcut from then on.
diff --git a/packages/desktop/index.html b/packages/desktop/index.html
new file mode 100644
index 0000000..01c4e72
--- /dev/null
+++ b/packages/desktop/index.html
@@ -0,0 +1,218 @@
+
+
+
+
+
+
+ crypt.fyi
+
+
+
+
+
+
+
+
+ crypt.fyi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/desktop/package.json b/packages/desktop/package.json
new file mode 100644
index 0000000..3b060be
--- /dev/null
+++ b/packages/desktop/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "@crypt.fyi/desktop",
+ "license": "Apache-2.0",
+ "version": "0.2.0",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "dev:frontend": "vite",
+ "build": "tsc --noEmit && vite build",
+ "lint": "eslint src",
+ "typecheck": "tsc --noEmit",
+ "test": "vitest run",
+ "tauri": "tauri",
+ "tauri:dev": "tauri dev",
+ "tauri:build": "tauri build"
+ },
+ "dependencies": {
+ "@crypt.fyi/core": "workspace:*",
+ "@crypt.fyi/theme": "workspace:*",
+ "@tauri-apps/api": "2.12.5",
+ "@tauri-apps/plugin-clipboard-manager": "2.5.0",
+ "@tauri-apps/plugin-global-shortcut": "2.4.1",
+ "@tauri-apps/plugin-notification": "2.8.1",
+ "zod": "^4.6.6"
+ },
+ "devDependencies": {
+ "@tailwindcss/vite": "4.3.3",
+ "@tauri-apps/cli": "2.12.6",
+ "@types/node": "^22.18.0",
+ "eslint": "^9.34.0",
+ "tailwindcss": "^4.3.3",
+ "typescript": "~5.9.2",
+ "vite": "^8.1.6",
+ "vitest": "4.1.12"
+ }
+}
diff --git a/packages/desktop/public/icon.png b/packages/desktop/public/icon.png
new file mode 100644
index 0000000..0d2bc97
Binary files /dev/null and b/packages/desktop/public/icon.png differ
diff --git a/packages/desktop/src-tauri/.gitignore b/packages/desktop/src-tauri/.gitignore
new file mode 100644
index 0000000..27bb6f8
--- /dev/null
+++ b/packages/desktop/src-tauri/.gitignore
@@ -0,0 +1,5 @@
+# Cargo build output
+/target/
+
+# Generated by tauri-build from the capability and plugin permission files
+/gen/schemas
diff --git a/packages/desktop/src-tauri/Cargo.toml b/packages/desktop/src-tauri/Cargo.toml
new file mode 100644
index 0000000..036697e
--- /dev/null
+++ b/packages/desktop/src-tauri/Cargo.toml
@@ -0,0 +1,34 @@
+[package]
+name = "crypt-fyi-desktop"
+version = "0.0.0"
+description = "crypt.fyi desktop app for quick, end-to-end encrypted secret links"
+authors = ["osbytes"]
+license = "Apache-2.0"
+repository = "https://github.com/osbytes/crypt.fyi"
+edition = "2021"
+rust-version = "1.77.2"
+publish = false
+
+[lib]
+# The `_lib` suffix keeps the library name distinct from the binary on Windows.
+name = "crypt_fyi_desktop_lib"
+crate-type = ["staticlib", "cdylib", "rlib"]
+
+[build-dependencies]
+tauri-build = { version = "2.7", features = [] }
+
+[dependencies]
+tauri = { version = "2.12", features = ["tray-icon"] }
+tauri-plugin-clipboard-manager = "2.5"
+tauri-plugin-notification = "2.8"
+
+[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
+tauri-plugin-global-shortcut = "2.4"
+tauri-plugin-single-instance = "2.5"
+
+[profile.release]
+codegen-units = 1
+lto = true
+opt-level = "s"
+panic = "abort"
+strip = true
diff --git a/packages/desktop/src-tauri/build.rs b/packages/desktop/src-tauri/build.rs
new file mode 100644
index 0000000..d860e1e
--- /dev/null
+++ b/packages/desktop/src-tauri/build.rs
@@ -0,0 +1,3 @@
+fn main() {
+ tauri_build::build()
+}
diff --git a/packages/desktop/src-tauri/capabilities/default.json b/packages/desktop/src-tauri/capabilities/default.json
new file mode 100644
index 0000000..53fc81c
--- /dev/null
+++ b/packages/desktop/src-tauri/capabilities/default.json
@@ -0,0 +1,25 @@
+{
+ "$schema": "../gen/schemas/desktop-schema.json",
+ "identifier": "default",
+ "description": "Least privilege for the quick-create window: clipboard text, the global shortcut, notifications and showing/hiding itself. No filesystem, shell, process or HTTP plugin access; requests to the API go through the webview's fetch and are bounded by the CSP connect-src.",
+ "windows": ["main"],
+ "platforms": ["macOS", "windows", "linux"],
+ "permissions": [
+ "core:event:allow-listen",
+ "core:event:allow-unlisten",
+ "core:window:allow-show",
+ "core:window:allow-hide",
+ "core:window:allow-set-focus",
+ "core:window:allow-unminimize",
+ "core:window:allow-is-visible",
+ "core:window:allow-is-focused",
+ "clipboard-manager:allow-read-text",
+ "clipboard-manager:allow-write-text",
+ "global-shortcut:allow-register",
+ "global-shortcut:allow-unregister",
+ "global-shortcut:allow-is-registered",
+ "notification:allow-is-permission-granted",
+ "notification:allow-request-permission",
+ "notification:allow-notify"
+ ]
+}
diff --git a/packages/desktop/src-tauri/icons/128x128.png b/packages/desktop/src-tauri/icons/128x128.png
new file mode 100644
index 0000000..b8ec532
Binary files /dev/null and b/packages/desktop/src-tauri/icons/128x128.png differ
diff --git a/packages/desktop/src-tauri/icons/128x128@2x.png b/packages/desktop/src-tauri/icons/128x128@2x.png
new file mode 100644
index 0000000..ed57de3
Binary files /dev/null and b/packages/desktop/src-tauri/icons/128x128@2x.png differ
diff --git a/packages/desktop/src-tauri/icons/32x32.png b/packages/desktop/src-tauri/icons/32x32.png
new file mode 100644
index 0000000..47cf1ee
Binary files /dev/null and b/packages/desktop/src-tauri/icons/32x32.png differ
diff --git a/packages/desktop/src-tauri/icons/64x64.png b/packages/desktop/src-tauri/icons/64x64.png
new file mode 100644
index 0000000..63615b8
Binary files /dev/null and b/packages/desktop/src-tauri/icons/64x64.png differ
diff --git a/packages/desktop/src-tauri/icons/Square107x107Logo.png b/packages/desktop/src-tauri/icons/Square107x107Logo.png
new file mode 100644
index 0000000..914ee07
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square107x107Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square142x142Logo.png b/packages/desktop/src-tauri/icons/Square142x142Logo.png
new file mode 100644
index 0000000..2379d25
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square142x142Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square150x150Logo.png b/packages/desktop/src-tauri/icons/Square150x150Logo.png
new file mode 100644
index 0000000..2c255fd
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square150x150Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square284x284Logo.png b/packages/desktop/src-tauri/icons/Square284x284Logo.png
new file mode 100644
index 0000000..f1c6b5b
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square284x284Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square30x30Logo.png b/packages/desktop/src-tauri/icons/Square30x30Logo.png
new file mode 100644
index 0000000..3c61b31
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square30x30Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square310x310Logo.png b/packages/desktop/src-tauri/icons/Square310x310Logo.png
new file mode 100644
index 0000000..93f0864
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square310x310Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square44x44Logo.png b/packages/desktop/src-tauri/icons/Square44x44Logo.png
new file mode 100644
index 0000000..395f44e
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square44x44Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square71x71Logo.png b/packages/desktop/src-tauri/icons/Square71x71Logo.png
new file mode 100644
index 0000000..7318654
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square71x71Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/Square89x89Logo.png b/packages/desktop/src-tauri/icons/Square89x89Logo.png
new file mode 100644
index 0000000..bc1e84f
Binary files /dev/null and b/packages/desktop/src-tauri/icons/Square89x89Logo.png differ
diff --git a/packages/desktop/src-tauri/icons/StoreLogo.png b/packages/desktop/src-tauri/icons/StoreLogo.png
new file mode 100644
index 0000000..78ec95e
Binary files /dev/null and b/packages/desktop/src-tauri/icons/StoreLogo.png differ
diff --git a/packages/desktop/src-tauri/icons/icon.icns b/packages/desktop/src-tauri/icons/icon.icns
new file mode 100644
index 0000000..1734955
Binary files /dev/null and b/packages/desktop/src-tauri/icons/icon.icns differ
diff --git a/packages/desktop/src-tauri/icons/icon.ico b/packages/desktop/src-tauri/icons/icon.ico
new file mode 100644
index 0000000..be62f40
Binary files /dev/null and b/packages/desktop/src-tauri/icons/icon.ico differ
diff --git a/packages/desktop/src-tauri/icons/icon.png b/packages/desktop/src-tauri/icons/icon.png
new file mode 100644
index 0000000..444dc4b
Binary files /dev/null and b/packages/desktop/src-tauri/icons/icon.png differ
diff --git a/packages/desktop/src-tauri/src/lib.rs b/packages/desktop/src-tauri/src/lib.rs
new file mode 100644
index 0000000..3c252a9
--- /dev/null
+++ b/packages/desktop/src-tauri/src/lib.rs
@@ -0,0 +1,117 @@
+//! Native shell for the crypt.fyi desktop app.
+//!
+//! This side only owns the tray, window lifecycle and plugin wiring. All encryption happens
+//! in the webview through `@crypt.fyi/core`, so no secret, key or password ever crosses the
+//! IPC bridge into Rust.
+
+use tauri::{
+ menu::{Menu, MenuItem, PredefinedMenuItem},
+ tray::TrayIconBuilder,
+ AppHandle, Emitter, Manager, State, WindowEvent, Wry,
+};
+
+const MAIN_WINDOW: &str = "main";
+/// Payload is the view to show: `"create"` or `"settings"`.
+const OPEN_EVENT: &str = "crypt://open";
+/// Lets the frontend drop any plaintext still held in the form once the window is gone.
+const HIDDEN_EVENT: &str = "crypt://hidden";
+
+struct TrayItems {
+ new_secret: MenuItem,
+ settings: MenuItem,
+ quit: MenuItem,
+}
+
+fn show_main_window(app: &AppHandle, view: &str) {
+ let Some(window) = app.get_webview_window(MAIN_WINDOW) else {
+ return;
+ };
+ let _ = window.unminimize();
+ let _ = window.show();
+ let _ = window.set_focus();
+ let _ = window.emit(OPEN_EVENT, view);
+}
+
+/// The tray is built natively so the app can always be reopened or quit, even if the
+/// webview failed to load. The frontend localizes the labels once its translations load.
+#[tauri::command]
+fn set_tray_labels(
+ items: State<'_, TrayItems>,
+ new_secret: String,
+ settings: String,
+ quit: String,
+) -> Result<(), String> {
+ let labels = [
+ (&items.new_secret, new_secret),
+ (&items.settings, settings),
+ (&items.quit, quit),
+ ];
+ for (item, label) in labels {
+ item.set_text(label).map_err(|e| e.to_string())?;
+ }
+ Ok(())
+}
+
+#[cfg_attr(mobile, tauri::mobile_entry_point)]
+pub fn run() {
+ let mut builder = tauri::Builder::default();
+
+ #[cfg(desktop)]
+ {
+ // A second launch would add a duplicate tray icon and fail to claim the shortcut,
+ // so hand off to the running instance instead.
+ builder = builder
+ .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
+ show_main_window(app, "create");
+ }))
+ .plugin(tauri_plugin_global_shortcut::Builder::new().build());
+ }
+
+ builder
+ .plugin(tauri_plugin_clipboard_manager::init())
+ .plugin(tauri_plugin_notification::init())
+ .invoke_handler(tauri::generate_handler![set_tray_labels])
+ .setup(|app| {
+ // Menu-bar utility: no Dock icon or app switcher entry on macOS.
+ #[cfg(target_os = "macos")]
+ app.set_activation_policy(tauri::ActivationPolicy::Accessory);
+
+ let new_secret = MenuItem::with_id(app, "new", "New secret", true, None::<&str>)?;
+ let settings = MenuItem::with_id(app, "settings", "Settings", true, None::<&str>)?;
+ let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
+ let separator = PredefinedMenuItem::separator(app)?;
+ let menu = Menu::with_items(app, &[&new_secret, &settings, &separator, &quit])?;
+
+ let mut tray = TrayIconBuilder::with_id("main")
+ .tooltip("crypt.fyi")
+ .menu(&menu)
+ .show_menu_on_left_click(true)
+ .on_menu_event(|app, event| match event.id().as_ref() {
+ "new" => show_main_window(app, "create"),
+ "settings" => show_main_window(app, "settings"),
+ "quit" => app.exit(0),
+ _ => {}
+ });
+ if let Some(icon) = app.default_window_icon() {
+ tray = tray.icon(icon.clone());
+ }
+ tray.build(app)?;
+
+ app.manage(TrayItems {
+ new_secret,
+ settings,
+ quit,
+ });
+ Ok(())
+ })
+ .on_window_event(|window, event| {
+ // Closing the window keeps the app in the tray so the shortcut stays available.
+ if let WindowEvent::CloseRequested { api, .. } = event {
+ api.prevent_close();
+ let _ = window.hide();
+ let _ = window.emit(HIDDEN_EVENT, ());
+ }
+ })
+ .run(tauri::generate_context!())
+ .expect("failed to run the crypt.fyi desktop app");
+}
diff --git a/packages/desktop/src-tauri/src/main.rs b/packages/desktop/src-tauri/src/main.rs
new file mode 100644
index 0000000..b66d02e
--- /dev/null
+++ b/packages/desktop/src-tauri/src/main.rs
@@ -0,0 +1,6 @@
+// Prevents an extra console window on Windows in release builds.
+#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
+
+fn main() {
+ crypt_fyi_desktop_lib::run()
+}
diff --git a/packages/desktop/src-tauri/tauri.conf.json b/packages/desktop/src-tauri/tauri.conf.json
new file mode 100644
index 0000000..149cd74
--- /dev/null
+++ b/packages/desktop/src-tauri/tauri.conf.json
@@ -0,0 +1,71 @@
+{
+ "$schema": "https://schema.tauri.app/config/2",
+ "productName": "crypt.fyi",
+ "version": "../package.json",
+ "identifier": "fyi.crypt.desktop",
+ "build": {
+ "beforeDevCommand": "pnpm dev:frontend",
+ "devUrl": "http://localhost:1420",
+ "beforeBuildCommand": "pnpm build",
+ "frontendDist": "../dist"
+ },
+ "app": {
+ "withGlobalTauri": false,
+ "windows": [
+ {
+ "label": "main",
+ "title": "crypt.fyi",
+ "width": 440,
+ "height": 640,
+ "minWidth": 360,
+ "minHeight": 480,
+ "center": true,
+ "visible": false,
+ "alwaysOnTop": true,
+ "skipTaskbar": true
+ }
+ ],
+ "security": {
+ "freezePrototype": true,
+ "csp": {
+ "default-src": "'self'",
+ "script-src": "'self'",
+ "style-src": "'self'",
+ "img-src": "'self' data:",
+ "font-src": "'self'",
+ "connect-src": "ipc: http://ipc.localhost https: http://localhost:* http://127.0.0.1:* http://[::1]:*",
+ "object-src": "'none'",
+ "base-uri": "'none'",
+ "form-action": "'none'",
+ "frame-src": "'none'"
+ },
+ "devCsp": {
+ "default-src": "'self'",
+ "script-src": "'self'",
+ "style-src": "'self' 'unsafe-inline'",
+ "img-src": "'self' data:",
+ "font-src": "'self'",
+ "connect-src": "ipc: http://ipc.localhost https: http://localhost:* http://127.0.0.1:* http://[::1]:* ws://localhost:1420",
+ "object-src": "'none'",
+ "base-uri": "'none'",
+ "form-action": "'none'",
+ "frame-src": "'none'"
+ }
+ }
+ },
+ "bundle": {
+ "active": true,
+ "targets": "all",
+ "category": "Utility",
+ "shortDescription": "Quick, end-to-end encrypted secret links",
+ "longDescription": "Create zero-knowledge, end-to-end encrypted crypt.fyi secret links from anywhere with a global shortcut.",
+ "copyright": "Copyright osbytes. Licensed under Apache-2.0.",
+ "icon": [
+ "icons/32x32.png",
+ "icons/128x128.png",
+ "icons/128x128@2x.png",
+ "icons/icon.icns",
+ "icons/icon.ico"
+ ]
+ }
+}
diff --git a/packages/desktop/src/config.ts b/packages/desktop/src/config.ts
new file mode 100644
index 0000000..f46b477
--- /dev/null
+++ b/packages/desktop/src/config.ts
@@ -0,0 +1,26 @@
+const MINUTE = 1000 * 60;
+const HOUR = MINUTE * 60;
+const DAY = HOUR * 24;
+
+/** Same durations the web client and extension offer, so links behave the same everywhere. */
+export const TTL_OPTIONS = [
+ { value: 5 * MINUTE, unit: 'minute', count: 5 },
+ { value: 30 * MINUTE, unit: 'minute', count: 30 },
+ { value: HOUR, unit: 'hour', count: 1 },
+ { value: 4 * HOUR, unit: 'hour', count: 4 },
+ { value: 12 * HOUR, unit: 'hour', count: 12 },
+ { value: DAY, unit: 'day', count: 1 },
+ { value: 3 * DAY, unit: 'day', count: 3 },
+ { value: 7 * DAY, unit: 'day', count: 7 },
+] as const;
+
+export type TtlUnit = (typeof TTL_OPTIONS)[number]['unit'];
+
+/** Matches the web client and extension; the key is the high-entropy half of the link. */
+export const KEY_LENGTH = 32;
+
+export const DEFAULT_API_URL = 'https://api.crypt.fyi';
+export const DEFAULT_WEB_URL = 'https://crypt.fyi';
+/** Four keys so it is unlikely to collide with an app's own shortcuts. */
+export const DEFAULT_SHORTCUT = 'CommandOrControl+Alt+Shift+E';
+export const DEFAULT_TTL = 30 * MINUTE;
diff --git a/packages/desktop/src/i18n.test.ts b/packages/desktop/src/i18n.test.ts
new file mode 100644
index 0000000..a9d8e1c
--- /dev/null
+++ b/packages/desktop/src/i18n.test.ts
@@ -0,0 +1,60 @@
+import { describe, expect, it } from 'vitest';
+import { resources } from '@crypt.fyi/core';
+import { createTranslator, resolveLanguage } from './i18n';
+
+describe('resolveLanguage', () => {
+ it('honors an explicit preference', () => {
+ expect(resolveLanguage('fr', ['de-DE'])).toBe('fr');
+ });
+
+ it('matches the first supported system language by its base tag', () => {
+ expect(resolveLanguage('system', ['pt-BR', 'zh-CN', 'en-US'])).toBe('zh');
+ });
+
+ it('falls back to English', () => {
+ expect(resolveLanguage('system', ['pt-BR'])).toBe('en');
+ expect(resolveLanguage('system', [])).toBe('en');
+ });
+});
+
+describe('createTranslator', () => {
+ it('looks up nested keys', () => {
+ expect(createTranslator('en')('desktop.tray.newSecret')).toBe('New secret');
+ expect(createTranslator('de')('desktop.tray.newSecret')).toBe('Neues Geheimnis');
+ });
+
+ it('interpolates variables', () => {
+ expect(createTranslator('en')('desktop.errors.server', { status: 503 })).toBe(
+ 'The server rejected the request (status 503).',
+ );
+ });
+
+ it('picks plural forms from count', () => {
+ const t = createTranslator('en');
+ expect(t('common.time.hour', { count: 1 })).toBe('1 hour');
+ expect(t('common.time.hour', { count: 4 })).toBe('4 hours');
+ expect(createTranslator('zh')('common.time.day', { count: 3 })).toBe('3 天');
+ });
+
+ it('every locale fills in every desktop string and keeps its placeholders', () => {
+ const collect = (node: unknown, prefix = ''): [string, string][] =>
+ typeof node === 'string'
+ ? [[prefix, node]]
+ : Object.entries(node as Record).flatMap(([key, value]) =>
+ collect(value, prefix ? `${prefix}.${key}` : key),
+ );
+ const placeholders = (text: string) => (text.match(/\{\{\w+\}\}/g) ?? []).sort();
+ const english = new Map(collect(resources.en.translation.desktop));
+
+ for (const [language, { translation }] of Object.entries(resources)) {
+ const entries = collect(translation.desktop);
+ expect(entries.map(([path]) => path).sort(), language).toEqual([...english.keys()].sort());
+ for (const [path, text] of entries) {
+ expect(text.trim(), `${language}:${path}`).not.toBe('');
+ expect(placeholders(text), `${language}:${path}`).toEqual(
+ placeholders(english.get(path) ?? ''),
+ );
+ }
+ }
+ });
+});
diff --git a/packages/desktop/src/i18n.ts b/packages/desktop/src/i18n.ts
new file mode 100644
index 0000000..61574b3
--- /dev/null
+++ b/packages/desktop/src/i18n.ts
@@ -0,0 +1,68 @@
+import { resources, type TranslationKeys } from '@crypt.fyi/core';
+import type { LanguageCode, LanguagePreference } from './settings';
+
+type Leaves = {
+ [K in keyof T & string]: T[K] extends string ? `${Prefix}${K}` : Leaves;
+}[keyof T & string];
+
+type Leaf = Leaves;
+/** i18next-style plural bases: `common.time.minute` resolves to `_one` / `_other`. */
+type PluralBase = Leaf extends infer L
+ ? L extends `${infer B}_${'one' | 'other'}`
+ ? B
+ : never
+ : never;
+
+export type TranslationKey = Exclude | PluralBase;
+export type Translate = (key: TranslationKey, vars?: Record) => string;
+
+const FALLBACK: LanguageCode = 'en';
+
+function isLanguageCode(value: string): value is LanguageCode {
+ return Object.prototype.hasOwnProperty.call(resources, value);
+}
+
+/** Picks the first supported language from the OS preference list (`zh-CN` matches `zh`). */
+export function resolveLanguage(
+ preference: LanguagePreference,
+ systemLanguages: readonly string[],
+): LanguageCode {
+ if (preference !== 'system') return preference;
+ for (const tag of systemLanguages) {
+ const base = tag.toLowerCase().split('-')[0];
+ if (isLanguageCode(base)) return base;
+ }
+ return FALLBACK;
+}
+
+function lookup(language: LanguageCode, path: string): string | undefined {
+ let node: unknown = resources[language].translation;
+ for (const segment of path.split('.')) {
+ if (node == null || typeof node !== 'object') return undefined;
+ node = (node as Record)[segment];
+ }
+ return typeof node === 'string' ? node : undefined;
+}
+
+function resolve(language: LanguageCode, key: string, count: number | undefined) {
+ if (count !== undefined) {
+ const category = new Intl.PluralRules(language).select(count);
+ return lookup(language, `${key}_${category}`) ?? lookup(language, `${key}_other`);
+ }
+ return lookup(language, key);
+}
+
+/**
+ * A minimal i18next-compatible lookup over the shared core locales: `{{name}}` interpolation
+ * and `count`-driven plurals, falling back to English and then to the key itself.
+ */
+export function createTranslator(language: LanguageCode): Translate {
+ return (key, vars) => {
+ const count = typeof vars?.count === 'number' ? vars.count : undefined;
+ const template = resolve(language, key, count) ?? resolve(FALLBACK, key, count) ?? key;
+ if (!vars) return template;
+ return template.replace(/\{\{\s*(\w+)\s*\}\}/g, (match, name: string) =>
+ name in vars ? String(vars[name]) : match,
+ );
+ };
+}
diff --git a/packages/desktop/src/main.ts b/packages/desktop/src/main.ts
new file mode 100644
index 0000000..52c0351
--- /dev/null
+++ b/packages/desktop/src/main.ts
@@ -0,0 +1,549 @@
+import '@crypt.fyi/theme/fonts/inter';
+import '@crypt.fyi/theme/fonts/space-grotesk';
+import '@crypt.fyi/theme/fonts/jetbrains-mono';
+import './styles.css';
+
+import { Client, supportedLanguages } from '@crypt.fyi/core';
+import {
+ applyResolvedTheme,
+ isThemePreference,
+ readStoredPreference,
+ resolveTheme,
+ subscribeToSystemTheme,
+ systemPrefersDark,
+ writeStoredPreference,
+} from '@crypt.fyi/theme';
+import { invoke } from '@tauri-apps/api/core';
+import { listen } from '@tauri-apps/api/event';
+import { getCurrentWindow } from '@tauri-apps/api/window';
+import { readText, writeText } from '@tauri-apps/plugin-clipboard-manager';
+import { register, unregister, type ShortcutEvent } from '@tauri-apps/plugin-global-shortcut';
+import {
+ isPermissionGranted,
+ requestPermission,
+ sendNotification,
+} from '@tauri-apps/plugin-notification';
+
+import { KEY_LENGTH, TTL_OPTIONS } from './config';
+import { createTranslator, resolveLanguage, type Translate, type TranslationKey } from './i18n';
+import { buildCreateInput, buildSecretUrl, describeCreateError } from './secret';
+import {
+ DEFAULT_SETTINGS,
+ clearSettings,
+ loadSettings,
+ parseSettings,
+ saveSettings,
+ type Settings,
+ type SettingsError,
+} from './settings';
+import { captureShortcut, formatAccelerator } from './shortcut';
+
+type View = 'create' | 'result' | 'settings';
+
+function byId(id: string): T {
+ const element = document.getElementById(id);
+ if (!element) throw new Error(`Missing #${id}`);
+ return element as T;
+}
+
+const el = {
+ alert: byId('alert'),
+ openSettings: byId('open-settings'),
+ views: {
+ create: byId('view-create'),
+ result: byId('view-result'),
+ settings: byId('view-settings'),
+ },
+ createForm: byId('create-form'),
+ content: byId('content'),
+ clipboardHint: byId('clipboard-hint'),
+ password: byId('password'),
+ ttl: byId('ttl'),
+ burn: byId('burn'),
+ createSubmit: byId('create-submit'),
+ shortcutHint: byId('shortcut-hint'),
+ resultUrl: byId('result-url'),
+ resultTitle: byId('result-title'),
+ passwordReminder: byId('password-reminder'),
+ resultDone: byId('result-done'),
+ settingsForm: byId('settings-form'),
+ apiUrl: byId('apiUrl'),
+ webUrl: byId('webUrl'),
+ shortcut: byId('shortcut'),
+ defaultTtl: byId('default-ttl'),
+ defaultBurn: byId('default-burn'),
+ prefill: byId('prefill'),
+ language: byId('language'),
+ theme: byId('theme'),
+ settingsBack: byId('settings-back'),
+ settingsReset: byId('settings-reset'),
+ settingsStatus: byId('settings-status'),
+};
+
+const isMac = /Mac/i.test(navigator.userAgent);
+const appWindow = getCurrentWindow();
+
+let settings: Settings = loadSettings(localStorage);
+let t: Translate = createTranslator(resolveLanguage(settings.language, navigator.languages));
+let currentView: View = 'create';
+let busy = false;
+
+// ---------------------------------------------------------------------------
+// Localization and theme
+// ---------------------------------------------------------------------------
+
+function applyLanguage() {
+ const language = resolveLanguage(settings.language, navigator.languages);
+ t = createTranslator(language);
+ document.documentElement.lang = language;
+
+ // Keys come from our own markup, so a typo shows up as the raw key rather than failing.
+ const attributes = [
+ ['i18n', null],
+ ['i18nPlaceholder', 'placeholder'],
+ ['i18nTitle', 'title'],
+ ['i18nAriaLabel', 'aria-label'],
+ ] as const;
+ for (const [dataKey, attribute] of attributes) {
+ const selector = `[data-${dataKey.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}]`;
+ for (const node of document.querySelectorAll(selector)) {
+ const text = t(node.dataset[dataKey] as TranslationKey);
+ if (attribute) node.setAttribute(attribute, text);
+ else node.textContent = text;
+ }
+ }
+
+ for (const select of [el.ttl, el.defaultTtl]) {
+ const selected = select.value;
+ select.replaceChildren(
+ ...TTL_OPTIONS.map(
+ (option) =>
+ new Option(
+ t(`common.time.${option.unit}`, { count: option.count }),
+ String(option.value),
+ ),
+ ),
+ );
+ if (selected) select.value = selected;
+ }
+
+ const selectedLanguage = el.language.value || settings.language;
+ el.language.replaceChildren(
+ new Option(t('desktop.settings.languageSystem'), 'system'),
+ ...Object.entries(supportedLanguages).map(([code, name]) => new Option(name, code)),
+ );
+ el.language.value = selectedLanguage;
+
+ el.shortcutHint.textContent = t('desktop.create.shortcutHint', {
+ shortcut: formatAccelerator(settings.shortcut, isMac),
+ });
+ if (document.activeElement !== el.shortcut) renderShortcutField();
+
+ invoke('set_tray_labels', {
+ newSecret: t('desktop.tray.newSecret'),
+ settings: t('desktop.tray.settings'),
+ quit: t('desktop.tray.quit'),
+ }).catch(() => {
+ // The tray keeps its built-in English labels.
+ });
+}
+
+function renderTheme() {
+ applyResolvedTheme(resolveTheme(readStoredPreference(), systemPrefersDark()));
+}
+
+// ---------------------------------------------------------------------------
+// Views and window
+// ---------------------------------------------------------------------------
+
+function showAlert(message: string | null) {
+ el.alert.textContent = message ?? '';
+ el.alert.classList.toggle('hidden', !message);
+}
+
+function showView(view: View) {
+ currentView = view;
+ for (const [name, section] of Object.entries(el.views)) {
+ section.hidden = name !== view;
+ }
+ el.openSettings.classList.toggle('invisible', view === 'settings');
+ if (view === 'settings') {
+ el.settingsStatus.classList.add('hidden');
+ fillSettingsForm();
+ el.apiUrl.focus();
+ }
+}
+
+/**
+ * Drops plaintext, password and the last link from the DOM. JavaScript strings can't be
+ * zeroed, but nothing keeps a reference after this, and nothing is ever written to storage.
+ */
+function resetCreateForm() {
+ el.content.value = '';
+ el.password.value = '';
+ el.resultUrl.value = '';
+ el.clipboardHint.classList.add('hidden');
+ el.ttl.value = String(settings.ttl);
+ el.burn.checked = settings.burn;
+}
+
+async function showWindow() {
+ await appWindow.unminimize();
+ await appWindow.show();
+ await appWindow.setFocus();
+}
+
+async function hideWindow() {
+ resetCreateForm();
+ showAlert(null);
+ showView('create');
+ await appWindow.hide();
+}
+
+async function openCreate() {
+ resetCreateForm();
+ showAlert(null);
+ showView('create');
+
+ if (settings.prefillFromClipboard) {
+ let text = '';
+ try {
+ text = await readText();
+ } catch {
+ // Empty or non-text clipboard: start with a blank form.
+ }
+ if (text.trim()) {
+ el.content.value = text;
+ el.clipboardHint.classList.remove('hidden');
+ }
+ }
+
+ el.content.focus();
+ el.content.select();
+}
+
+async function toggleFromShortcut() {
+ if ((await appWindow.isVisible()) && (await appWindow.isFocused())) {
+ await hideWindow();
+ return;
+ }
+ await openCreate();
+ await showWindow();
+ el.content.focus();
+}
+
+// ---------------------------------------------------------------------------
+// Global shortcut
+// ---------------------------------------------------------------------------
+
+let registeredShortcut: string | null = null;
+// Registration is async and native; serializing it keeps focus/blur/save from interleaving.
+let shortcutQueue: Promise = Promise.resolve();
+
+function onShortcut(event: ShortcutEvent) {
+ if (event.state === 'Pressed') void toggleFromShortcut();
+}
+
+function queueShortcut(next: string | null): Promise {
+ const task = shortcutQueue.then(async () => {
+ if (registeredShortcut === next) return true;
+ const previous = registeredShortcut;
+ if (previous) {
+ await unregister(previous).catch(() => {});
+ registeredShortcut = null;
+ }
+ if (!next) return true;
+ try {
+ await register(next, onShortcut);
+ registeredShortcut = next;
+ return true;
+ } catch {
+ if (previous) {
+ await register(previous, onShortcut)
+ .then(() => {
+ registeredShortcut = previous;
+ })
+ .catch(() => {});
+ }
+ return false;
+ }
+ });
+ shortcutQueue = task;
+ return task;
+}
+
+// ---------------------------------------------------------------------------
+// Create
+// ---------------------------------------------------------------------------
+
+function setBusy(next: boolean) {
+ busy = next;
+ el.createSubmit.disabled = next;
+ el.createSubmit.textContent = t(next ? 'desktop.create.submitting' : 'desktop.create.submit');
+}
+
+/** The link is never put in the notification: notification centers keep a history. */
+async function notifyCopied(passwordProtected: boolean): Promise {
+ try {
+ let granted = await isPermissionGranted();
+ if (!granted) granted = (await requestPermission()) === 'granted';
+ if (!granted) return false;
+ const body = t('desktop.result.notificationBody');
+ sendNotification({
+ title: t('desktop.result.notificationTitle'),
+ body: passwordProtected ? `${body} ${t('desktop.result.passwordReminder')}` : body,
+ });
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+function showResult(url: string, passwordProtected: boolean, copied: boolean) {
+ showView('result');
+ el.resultUrl.value = url;
+ el.resultTitle.classList.toggle('hidden', !copied);
+ el.passwordReminder.classList.toggle('hidden', !passwordProtected);
+ showAlert(copied ? null : t('desktop.errors.clipboard'));
+ el.resultUrl.focus();
+ el.resultUrl.select();
+}
+
+async function handleCreate(event: SubmitEvent) {
+ event.preventDefault();
+ if (busy) return;
+
+ const result = buildCreateInput({
+ content: el.content.value,
+ password: el.password.value,
+ ttl: Number(el.ttl.value),
+ burn: el.burn.checked,
+ });
+ if (!result.ok) {
+ showAlert(t(result.error === 'empty' ? 'desktop.create.emptyError' : 'desktop.errors.unknown'));
+ el.content.focus();
+ return;
+ }
+
+ showAlert(null);
+ setBusy(true);
+ const { apiUrl, webUrl } = settings;
+ const passwordProtected = result.input.p !== undefined;
+ let url: string;
+ try {
+ // Encryption, key generation and hashing all happen here, in the webview; the server
+ // only receives ciphertext and a verification hash.
+ const client = new Client({
+ apiUrl,
+ keyLength: KEY_LENGTH,
+ xClient: `@crypt.fyi/desktop:${__APP_VERSION__}`,
+ });
+ const created = await client.create(result.input);
+ url = buildSecretUrl({ webUrl, id: created.id, key: created.key, passwordProtected });
+ } catch (error) {
+ const message = describeCreateError(error, apiUrl);
+ showAlert(t(message.key, message.vars));
+ setBusy(false);
+ return;
+ }
+
+ resetCreateForm();
+ setBusy(false);
+
+ let copied = true;
+ try {
+ // Overwriting the clipboard also removes the plaintext that may have been prefilled from it.
+ await writeText(url);
+ } catch {
+ copied = false;
+ }
+
+ if (copied && (await notifyCopied(passwordProtected))) {
+ await hideWindow();
+ return;
+ }
+ showResult(url, passwordProtected, copied);
+}
+
+// ---------------------------------------------------------------------------
+// Settings
+// ---------------------------------------------------------------------------
+
+function renderShortcutField() {
+ const accelerator = el.shortcut.dataset.accelerator ?? settings.shortcut;
+ el.shortcut.value = formatAccelerator(accelerator, isMac);
+ el.shortcut.placeholder = '';
+}
+
+function fillSettingsForm() {
+ el.apiUrl.value = settings.apiUrl;
+ el.webUrl.value = settings.webUrl;
+ el.shortcut.dataset.accelerator = settings.shortcut;
+ renderShortcutField();
+ el.defaultTtl.value = String(settings.ttl);
+ el.defaultBurn.checked = settings.burn;
+ el.prefill.checked = settings.prefillFromClipboard;
+ el.language.value = settings.language;
+ el.theme.value = readStoredPreference();
+}
+
+function describeSettingsError(error: SettingsError): string {
+ if (error.message === 'invalidShortcut') return t('desktop.settings.invalidShortcut');
+ const field =
+ error.field === 'apiUrl' ? t('desktop.settings.apiUrl') : t('desktop.settings.webUrl');
+ return t('desktop.settings.invalidUrl', { field });
+}
+
+async function applySettings(next: Settings, theme: string) {
+ if (!(await queueShortcut(next.shortcut))) {
+ showAlert(
+ t('desktop.errors.shortcutUnavailable', {
+ shortcut: formatAccelerator(next.shortcut, isMac),
+ }),
+ );
+ return false;
+ }
+ settings = next;
+ if (isThemePreference(theme)) writeStoredPreference(theme);
+ renderTheme();
+ applyLanguage();
+ resetCreateForm();
+ showAlert(null);
+ el.settingsStatus.textContent = t('desktop.settings.saved');
+ el.settingsStatus.classList.remove('hidden');
+ return true;
+}
+
+async function handleSaveSettings(event: SubmitEvent) {
+ event.preventDefault();
+ el.settingsStatus.classList.add('hidden');
+
+ const { settings: next, errors } = parseSettings({
+ apiUrl: el.apiUrl.value,
+ webUrl: el.webUrl.value,
+ shortcut: el.shortcut.dataset.accelerator,
+ ttl: Number(el.defaultTtl.value),
+ burn: el.defaultBurn.checked,
+ prefillFromClipboard: el.prefill.checked,
+ language: el.language.value,
+ });
+ if (errors.length > 0) {
+ showAlert(errors.map(describeSettingsError).join('\n'));
+ return;
+ }
+
+ if (await applySettings(next, el.theme.value)) {
+ saveSettings(localStorage, next);
+ fillSettingsForm();
+ }
+}
+
+async function handleResetSettings() {
+ el.settingsStatus.classList.add('hidden');
+ if (await applySettings({ ...DEFAULT_SETTINGS }, 'system')) {
+ clearSettings(localStorage);
+ fillSettingsForm();
+ }
+}
+
+function handleShortcutKeydown(event: KeyboardEvent) {
+ event.preventDefault();
+ event.stopPropagation();
+ if (event.code === 'Escape' && !event.ctrlKey && !event.metaKey && !event.altKey) {
+ el.shortcut.blur();
+ return;
+ }
+ const result = captureShortcut(event, isMac);
+ if (result.kind === 'pending') return;
+ if (result.kind === 'invalid') {
+ showAlert(t('desktop.settings.invalidShortcut'));
+ return;
+ }
+ showAlert(null);
+ el.shortcut.dataset.accelerator = result.accelerator;
+ el.shortcut.blur();
+}
+
+// ---------------------------------------------------------------------------
+// Wiring
+// ---------------------------------------------------------------------------
+
+el.createForm.addEventListener('submit', (event) => void handleCreate(event));
+el.content.addEventListener('keydown', (event) => {
+ // Cmd/Ctrl+Enter submits without leaving the keyboard; plain Enter keeps adding lines.
+ if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) {
+ event.preventDefault();
+ el.createForm.requestSubmit();
+ }
+});
+el.openSettings.addEventListener('click', () => showView('settings'));
+el.resultDone.addEventListener('click', () => void hideWindow());
+el.settingsForm.addEventListener('submit', (event) => void handleSaveSettings(event));
+el.settingsBack.addEventListener('click', () => {
+ showAlert(null);
+ showView('create');
+});
+el.settingsReset.addEventListener('click', () => void handleResetSettings());
+
+// Recording a shortcut must not trigger the one currently registered.
+el.shortcut.addEventListener('focus', () => {
+ void queueShortcut(null);
+ el.shortcut.value = '';
+ el.shortcut.placeholder = t('desktop.settings.shortcutRecording');
+});
+el.shortcut.addEventListener('blur', () => {
+ renderShortcutField();
+ void queueShortcut(settings.shortcut);
+});
+el.shortcut.addEventListener('keydown', handleShortcutKeydown);
+
+document.addEventListener('keydown', (event) => {
+ if (event.key === 'Escape' && document.activeElement !== el.shortcut) {
+ event.preventDefault();
+ if (currentView === 'settings') {
+ showAlert(null);
+ showView('create');
+ } else {
+ void hideWindow();
+ }
+ }
+});
+
+subscribeToSystemTheme(renderTheme);
+
+void listen('crypt://open', async (event) => {
+ if (event.payload === 'settings') {
+ showAlert(null);
+ showView('settings');
+ } else {
+ await openCreate();
+ }
+});
+void listen('crypt://hidden', () => {
+ resetCreateForm();
+ showAlert(null);
+ showView('create');
+});
+
+async function start() {
+ renderTheme();
+ applyLanguage();
+ resetCreateForm();
+ showView('create');
+
+ const registered = await queueShortcut(settings.shortcut);
+ if (!registered) {
+ showView('settings');
+ showAlert(
+ t('desktop.errors.shortcutUnavailable', {
+ shortcut: formatAccelerator(settings.shortcut, isMac),
+ }),
+ );
+ }
+ // Launching the app is an explicit action, so show the window once; afterwards it lives in
+ // the tray and opens with the shortcut.
+ await showWindow();
+ if (registered) el.content.focus();
+}
+
+void start();
diff --git a/packages/desktop/src/secret.test.ts b/packages/desktop/src/secret.test.ts
new file mode 100644
index 0000000..902f0cc
--- /dev/null
+++ b/packages/desktop/src/secret.test.ts
@@ -0,0 +1,89 @@
+import { describe, expect, it } from 'vitest';
+import { ErrorUnexpectedStatus } from '@crypt.fyi/core';
+import { DEFAULT_TTL } from './config';
+import { buildCreateInput, buildSecretUrl, describeCreateError } from './secret';
+
+describe('buildCreateInput', () => {
+ const base = { content: 'line one\n line two ', password: '', ttl: DEFAULT_TTL, burn: true };
+
+ it('passes content through untouched and omits an empty password', () => {
+ expect(buildCreateInput(base)).toEqual({
+ ok: true,
+ input: { c: 'line one\n line two ', b: true, ttl: DEFAULT_TTL },
+ });
+ });
+
+ it('includes a password when one is set', () => {
+ const result = buildCreateInput({ ...base, password: ' pw ', burn: false });
+ expect(result).toEqual({
+ ok: true,
+ input: { c: base.content, p: ' pw ', b: false, ttl: DEFAULT_TTL },
+ });
+ });
+
+ it('rejects empty and whitespace-only content', () => {
+ expect(buildCreateInput({ ...base, content: '' })).toEqual({ ok: false, error: 'empty' });
+ expect(buildCreateInput({ ...base, content: ' \n\t ' })).toEqual({
+ ok: false,
+ error: 'empty',
+ });
+ });
+
+ it('rejects a TTL the server does not offer', () => {
+ expect(buildCreateInput({ ...base, ttl: 1234 })).toEqual({ ok: false, error: 'invalidTtl' });
+ });
+});
+
+describe('buildSecretUrl', () => {
+ it('keeps the key in the fragment', () => {
+ expect(
+ buildSecretUrl({
+ webUrl: 'https://crypt.fyi/',
+ id: 'abc123',
+ key: 'k3y',
+ passwordProtected: false,
+ }),
+ ).toBe('https://crypt.fyi/abc123#k3y');
+ });
+
+ it('flags password-protected secrets and keeps a self-hosted base path', () => {
+ expect(
+ buildSecretUrl({
+ webUrl: 'https://example.com/secrets',
+ id: 'a/b',
+ key: 'v2.k3y',
+ passwordProtected: true,
+ }),
+ ).toBe('https://example.com/secrets/a%2Fb?p=true#v2.k3y');
+ });
+});
+
+describe('describeCreateError', () => {
+ const apiUrl = 'https://api.crypt.fyi';
+
+ it('maps known HTTP statuses', () => {
+ expect(describeCreateError(new ErrorUnexpectedStatus(429), apiUrl)).toEqual({
+ key: 'desktop.errors.rateLimited',
+ });
+ expect(describeCreateError(new ErrorUnexpectedStatus(413), apiUrl)).toEqual({
+ key: 'desktop.errors.tooLarge',
+ });
+ expect(describeCreateError(new ErrorUnexpectedStatus(500), apiUrl)).toEqual({
+ key: 'desktop.errors.server',
+ vars: { status: 500 },
+ });
+ });
+
+ it('reports network failures with the API host only', () => {
+ expect(describeCreateError(new TypeError('Failed to fetch'), apiUrl)).toEqual({
+ key: 'desktop.errors.network',
+ vars: { host: 'api.crypt.fyi' },
+ });
+ });
+
+ it('never echoes arbitrary error messages', () => {
+ expect(describeCreateError(new Error('something sensitive'), apiUrl)).toEqual({
+ key: 'desktop.errors.unknown',
+ });
+ });
+});
diff --git a/packages/desktop/src/secret.ts b/packages/desktop/src/secret.ts
new file mode 100644
index 0000000..22fe67c
--- /dev/null
+++ b/packages/desktop/src/secret.ts
@@ -0,0 +1,82 @@
+import { ErrorUnexpectedStatus } from '@crypt.fyi/core';
+import { TTL_OPTIONS } from './config';
+import type { TranslationKey } from './i18n';
+
+export type CreateFormValues = {
+ content: string;
+ password: string;
+ ttl: number;
+ burn: boolean;
+};
+
+/** The subset of `Client.create` input the quick-create window exposes. */
+export type CreateInput = {
+ c: string;
+ p?: string;
+ b: boolean;
+ ttl: number;
+};
+
+export type CreateInputResult =
+ | { ok: true; input: CreateInput }
+ | { ok: false; error: 'empty' | 'invalidTtl' };
+
+export function buildCreateInput(values: CreateFormValues): CreateInputResult {
+ // Whitespace-only content is almost always an accidental empty paste.
+ if (values.content.trim() === '') return { ok: false, error: 'empty' };
+ if (!TTL_OPTIONS.some((option) => option.value === values.ttl)) {
+ return { ok: false, error: 'invalidTtl' };
+ }
+
+ // The content itself is sent as typed: trimming could corrupt keys or multi-line secrets.
+ const input: CreateInput = { c: values.content, b: values.burn, ttl: values.ttl };
+ if (values.password !== '') input.p = values.password;
+ return { ok: true, input };
+}
+
+/**
+ * Same link shape as the web client: the key stays in the fragment, which browsers never send
+ * to the server, and `?p=true` tells the reader to prompt for the password.
+ */
+export function buildSecretUrl({
+ webUrl,
+ id,
+ key,
+ passwordProtected,
+}: {
+ webUrl: string;
+ id: string;
+ key: string;
+ passwordProtected: boolean;
+}): string {
+ const base = webUrl.replace(/\/+$/, '');
+ const query = passwordProtected ? '?p=true' : '';
+ return `${base}/${encodeURIComponent(id)}${query}#${key}`;
+}
+
+export type ErrorMessage = { key: TranslationKey; vars?: Record };
+
+/**
+ * Maps a failed create to user-facing copy. Only the status code and API host are surfaced;
+ * the error object never carries plaintext, but its message is still not shown verbatim.
+ */
+export function describeCreateError(error: unknown, apiUrl: string): ErrorMessage {
+ if (error instanceof ErrorUnexpectedStatus) {
+ if (error.status === 429) return { key: 'desktop.errors.rateLimited' };
+ if (error.status === 413) return { key: 'desktop.errors.tooLarge' };
+ return { key: 'desktop.errors.server', vars: { status: error.status } };
+ }
+ // fetch rejects with a TypeError for DNS, TLS, offline and CSP-blocked requests alike.
+ if (error instanceof TypeError) {
+ return { key: 'desktop.errors.network', vars: { host: hostOf(apiUrl) } };
+ }
+ return { key: 'desktop.errors.unknown' };
+}
+
+function hostOf(url: string): string {
+ try {
+ return new URL(url).host;
+ } catch {
+ return url;
+ }
+}
diff --git a/packages/desktop/src/settings.test.ts b/packages/desktop/src/settings.test.ts
new file mode 100644
index 0000000..0cf063d
--- /dev/null
+++ b/packages/desktop/src/settings.test.ts
@@ -0,0 +1,120 @@
+import { describe, expect, it } from 'vitest';
+import {
+ DEFAULT_SETTINGS,
+ SETTINGS_STORAGE_KEY,
+ clearSettings,
+ isAllowedEndpoint,
+ loadSettings,
+ normalizeEndpoint,
+ parseSettings,
+ saveSettings,
+} from './settings';
+
+function memoryStore(initial: Record = {}) {
+ const data = new Map(Object.entries(initial));
+ return {
+ data,
+ getItem: (key: string) => data.get(key) ?? null,
+ setItem: (key: string, value: string) => void data.set(key, value),
+ removeItem: (key: string) => void data.delete(key),
+ };
+}
+
+describe('isAllowedEndpoint', () => {
+ it.each([
+ 'https://api.crypt.fyi',
+ 'https://secrets.internal.example:8443/api',
+ 'http://localhost:4321',
+ 'http://127.0.0.1:4321',
+ 'http://[::1]:4321',
+ ])('allows %s', (url) => {
+ expect(isAllowedEndpoint(url)).toBe(true);
+ });
+
+ it.each([
+ 'http://api.crypt.fyi',
+ 'http://192.168.1.10:4321',
+ 'ftp://api.crypt.fyi',
+ 'javascript:alert(1)',
+ 'https://user:pass@api.crypt.fyi',
+ 'https://api.crypt.fyi/?x=1',
+ 'https://api.crypt.fyi/#frag',
+ 'not a url',
+ '',
+ ])('rejects %j', (url) => {
+ expect(isAllowedEndpoint(url)).toBe(false);
+ });
+});
+
+describe('normalizeEndpoint', () => {
+ it('trims whitespace and trailing slashes', () => {
+ expect(normalizeEndpoint(' https://api.crypt.fyi// ')).toBe('https://api.crypt.fyi');
+ });
+});
+
+describe('parseSettings', () => {
+ it('returns defaults for empty or non-object input', () => {
+ expect(parseSettings(undefined)).toEqual({ settings: DEFAULT_SETTINGS, errors: [] });
+ expect(parseSettings('nope')).toEqual({ settings: DEFAULT_SETTINGS, errors: [] });
+ });
+
+ it('accepts and normalizes valid values', () => {
+ const { settings, errors } = parseSettings({
+ apiUrl: 'https://api.example.com/',
+ webUrl: 'https://example.com',
+ shortcut: 'CommandOrControl+Shift+K',
+ ttl: '3600000',
+ burn: false,
+ prefillFromClipboard: false,
+ language: 'de',
+ });
+ expect(errors).toEqual([]);
+ expect(settings).toEqual({
+ apiUrl: 'https://api.example.com',
+ webUrl: 'https://example.com',
+ shortcut: 'CommandOrControl+Shift+K',
+ ttl: 3600000,
+ burn: false,
+ prefillFromClipboard: false,
+ language: 'de',
+ });
+ });
+
+ it('falls back per field and reports each invalid one', () => {
+ const { settings, errors } = parseSettings({
+ apiUrl: 'http://evil.example',
+ webUrl: 'https://example.com',
+ shortcut: 'K',
+ ttl: 42,
+ language: 'xx',
+ });
+ expect(settings).toEqual({ ...DEFAULT_SETTINGS, webUrl: 'https://example.com' });
+ expect(errors.map((e) => [e.field, e.message])).toEqual([
+ ['apiUrl', 'invalidUrl'],
+ ['shortcut', 'invalidShortcut'],
+ ['ttl', 'invalidTtl'],
+ ['language', expect.any(String)],
+ ]);
+ });
+
+ it('ignores unknown keys', () => {
+ expect(parseSettings({ password: 'hunter2' }).settings).toEqual(DEFAULT_SETTINGS);
+ });
+});
+
+describe('settings storage', () => {
+ it('round-trips through the store', () => {
+ const store = memoryStore();
+ const settings = { ...DEFAULT_SETTINGS, burn: false, language: 'fr' as const };
+ saveSettings(store, settings);
+ expect(loadSettings(store)).toEqual(settings);
+ clearSettings(store);
+ expect(store.data.has(SETTINGS_STORAGE_KEY)).toBe(false);
+ expect(loadSettings(store)).toEqual(DEFAULT_SETTINGS);
+ });
+
+ it('recovers from corrupt JSON', () => {
+ const store = memoryStore({ [SETTINGS_STORAGE_KEY]: '{not json' });
+ expect(loadSettings(store)).toEqual(DEFAULT_SETTINGS);
+ });
+});
diff --git a/packages/desktop/src/settings.ts b/packages/desktop/src/settings.ts
new file mode 100644
index 0000000..801592e
--- /dev/null
+++ b/packages/desktop/src/settings.ts
@@ -0,0 +1,125 @@
+import { z } from 'zod';
+import { supportedLanguages } from '@crypt.fyi/core';
+import {
+ DEFAULT_API_URL,
+ DEFAULT_SHORTCUT,
+ DEFAULT_TTL,
+ DEFAULT_WEB_URL,
+ TTL_OPTIONS,
+} from './config';
+import { isValidAccelerator } from './shortcut';
+
+/** Settings are preferences only. Secrets and passwords are never persisted. */
+export const SETTINGS_STORAGE_KEY = 'crypt.fyi:desktop:settings';
+
+export type LanguageCode = keyof typeof supportedLanguages;
+export type LanguagePreference = 'system' | LanguageCode;
+
+export type Settings = {
+ apiUrl: string;
+ webUrl: string;
+ shortcut: string;
+ ttl: number;
+ burn: boolean;
+ prefillFromClipboard: boolean;
+ language: LanguagePreference;
+};
+
+export const DEFAULT_SETTINGS: Settings = {
+ apiUrl: DEFAULT_API_URL,
+ webUrl: DEFAULT_WEB_URL,
+ shortcut: DEFAULT_SHORTCUT,
+ ttl: DEFAULT_TTL,
+ burn: true,
+ prefillFromClipboard: true,
+ language: 'system',
+};
+
+const LOOPBACK_HOSTS = new Set(['localhost', '127.0.0.1', '[::1]']);
+
+/**
+ * Endpoints must be https, or http on loopback for local development and self-hosting.
+ * This mirrors the CSP `connect-src` in tauri.conf.json, so a URL that passes here is also one
+ * the webview is allowed to reach. Credentials in the URL are rejected because they would be
+ * copied into every shared link (web URL) or sent with every request (API URL).
+ */
+export function isAllowedEndpoint(value: string): boolean {
+ let url: URL;
+ try {
+ url = new URL(value);
+ } catch {
+ return false;
+ }
+ if (url.username || url.password || url.search || url.hash) return false;
+ if (url.protocol === 'https:') return url.hostname.length > 0;
+ if (url.protocol === 'http:') return LOOPBACK_HOSTS.has(url.hostname);
+ return false;
+}
+
+/** Drops trailing slashes so `${apiUrl}/vault` and `${webUrl}/${id}` never double up. */
+export function normalizeEndpoint(value: string): string {
+ return value.trim().replace(/\/+$/, '');
+}
+
+const endpoint = z
+ .string()
+ .transform(normalizeEndpoint)
+ .refine(isAllowedEndpoint, { message: 'invalidUrl' });
+
+const ttlValues: number[] = TTL_OPTIONS.map((option) => option.value);
+const languageValues = ['system', ...Object.keys(supportedLanguages)] as [string, ...string[]];
+
+const fieldSchemas = {
+ apiUrl: endpoint,
+ webUrl: endpoint,
+ shortcut: z.string().refine(isValidAccelerator, { message: 'invalidShortcut' }),
+ ttl: z.coerce.number().refine((n) => ttlValues.includes(n), { message: 'invalidTtl' }),
+ burn: z.boolean(),
+ prefillFromClipboard: z.boolean(),
+ language: z.enum(languageValues).transform((v) => v as LanguagePreference),
+} satisfies { [K in keyof Settings]: z.ZodType };
+
+const SETTING_KEYS = Object.keys(fieldSchemas) as (keyof Settings)[];
+
+export type SettingsError = { field: keyof Settings; message: string };
+
+/**
+ * Validates every field independently. Invalid fields fall back to the defaults so one bad
+ * stored value (for example from an older version) can't lock the user out of the app.
+ */
+export function parseSettings(input: unknown): { settings: Settings; errors: SettingsError[] } {
+ const raw = input != null && typeof input === 'object' ? (input as Record) : {};
+ const settings: Record = { ...DEFAULT_SETTINGS };
+ const errors: SettingsError[] = [];
+
+ for (const key of SETTING_KEYS) {
+ if (raw[key] === undefined) continue;
+ const result = fieldSchemas[key].safeParse(raw[key]);
+ if (result.success) {
+ settings[key] = result.data;
+ } else {
+ errors.push({ field: key, message: result.error.issues[0]?.message ?? 'invalid' });
+ }
+ }
+
+ return { settings: settings as Settings, errors };
+}
+
+type KeyValueStore = Pick;
+
+export function loadSettings(store: KeyValueStore): Settings {
+ try {
+ const stored = store.getItem(SETTINGS_STORAGE_KEY);
+ return parseSettings(stored ? JSON.parse(stored) : {}).settings;
+ } catch {
+ return { ...DEFAULT_SETTINGS };
+ }
+}
+
+export function saveSettings(store: KeyValueStore, settings: Settings): void {
+ store.setItem(SETTINGS_STORAGE_KEY, JSON.stringify(settings));
+}
+
+export function clearSettings(store: KeyValueStore): void {
+ store.removeItem(SETTINGS_STORAGE_KEY);
+}
diff --git a/packages/desktop/src/shortcut.test.ts b/packages/desktop/src/shortcut.test.ts
new file mode 100644
index 0000000..c082449
--- /dev/null
+++ b/packages/desktop/src/shortcut.test.ts
@@ -0,0 +1,94 @@
+import { describe, expect, it } from 'vitest';
+import { captureShortcut, formatAccelerator, isValidAccelerator, type KeyPress } from './shortcut';
+
+const press = (code: string, modifiers: Partial> = {}): KeyPress => ({
+ code,
+ ctrlKey: false,
+ metaKey: false,
+ altKey: false,
+ shiftKey: false,
+ ...modifiers,
+});
+
+describe('captureShortcut', () => {
+ it('maps Ctrl on Windows/Linux and Cmd on macOS to CommandOrControl', () => {
+ expect(captureShortcut(press('KeyK', { ctrlKey: true, shiftKey: true }), false)).toEqual({
+ kind: 'ok',
+ accelerator: 'CommandOrControl+Shift+K',
+ });
+ expect(captureShortcut(press('KeyK', { metaKey: true, shiftKey: true }), true)).toEqual({
+ kind: 'ok',
+ accelerator: 'CommandOrControl+Shift+K',
+ });
+ });
+
+ it('keeps the platform-specific modifier when it is not the primary one', () => {
+ expect(captureShortcut(press('KeyE', { ctrlKey: true, altKey: true }), true)).toEqual({
+ kind: 'ok',
+ accelerator: 'Control+Alt+E',
+ });
+ expect(captureShortcut(press('Digit1', { metaKey: true }), false)).toEqual({
+ kind: 'ok',
+ accelerator: 'Super+1',
+ });
+ });
+
+ it('accepts function and punctuation keys', () => {
+ expect(captureShortcut(press('F5', { altKey: true }), false)).toEqual({
+ kind: 'ok',
+ accelerator: 'Alt+F5',
+ });
+ expect(captureShortcut(press('Period', { ctrlKey: true }), false)).toEqual({
+ kind: 'ok',
+ accelerator: 'CommandOrControl+Period',
+ });
+ });
+
+ it('waits while only modifiers are held', () => {
+ expect(captureShortcut(press('ShiftLeft', { shiftKey: true }), false)).toEqual({
+ kind: 'pending',
+ });
+ expect(captureShortcut(press('MetaRight', { metaKey: true }), true)).toEqual({
+ kind: 'pending',
+ });
+ });
+
+ it('rejects keys without a modifier, Shift-only combinations and unknown keys', () => {
+ expect(captureShortcut(press('KeyA'), false)).toEqual({ kind: 'invalid' });
+ expect(captureShortcut(press('KeyA', { shiftKey: true }), false)).toEqual({ kind: 'invalid' });
+ expect(captureShortcut(press('IntlRo', { ctrlKey: true }), false)).toEqual({
+ kind: 'invalid',
+ });
+ });
+});
+
+describe('isValidAccelerator', () => {
+ it.each([
+ 'CommandOrControl+Alt+Shift+E',
+ 'CmdOrCtrl+K',
+ 'Control+Space',
+ 'Alt+F12',
+ 'Super+Numpad5',
+ 'Option+ArrowUp',
+ ])('accepts %s', (accelerator) => {
+ expect(isValidAccelerator(accelerator)).toBe(true);
+ });
+
+ it.each(['', 'K', 'Shift+K', 'Ctrl+Ctrl+K', 'Hyper+K', 'Ctrl+', 'Ctrl+Shift', 'Ctrl+KeyK'])(
+ 'rejects %j',
+ (accelerator) => {
+ expect(isValidAccelerator(accelerator)).toBe(false);
+ },
+ );
+});
+
+describe('formatAccelerator', () => {
+ it('uses symbols on macOS', () => {
+ expect(formatAccelerator('CommandOrControl+Alt+Shift+E', true)).toBe('⌘⌥⇧E');
+ });
+
+ it('uses names elsewhere', () => {
+ expect(formatAccelerator('CommandOrControl+Alt+Shift+E', false)).toBe('Ctrl+Alt+Shift+E');
+ expect(formatAccelerator('Super+Period', false)).toBe('Super+.');
+ });
+});
diff --git a/packages/desktop/src/shortcut.ts b/packages/desktop/src/shortcut.ts
new file mode 100644
index 0000000..034ac74
--- /dev/null
+++ b/packages/desktop/src/shortcut.ts
@@ -0,0 +1,181 @@
+/**
+ * Global shortcuts use Tauri accelerator strings (e.g. `CommandOrControl+Shift+K`), which the
+ * global-shortcut plugin parses natively. These helpers turn a key press in the settings form
+ * into an accelerator and render one for display.
+ */
+
+export type KeyPress = Pick;
+
+export type CaptureResult =
+ | { kind: 'pending' }
+ | { kind: 'invalid' }
+ | { kind: 'ok'; accelerator: string };
+
+const MODIFIER_CODES = new Set([
+ 'ShiftLeft',
+ 'ShiftRight',
+ 'ControlLeft',
+ 'ControlRight',
+ 'AltLeft',
+ 'AltRight',
+ 'MetaLeft',
+ 'MetaRight',
+ 'OSLeft',
+ 'OSRight',
+ 'CapsLock',
+ 'Fn',
+]);
+
+const NAMED_KEYS = new Set([
+ 'Space',
+ 'Enter',
+ 'Tab',
+ 'Backspace',
+ 'Delete',
+ 'Insert',
+ 'Home',
+ 'End',
+ 'PageUp',
+ 'PageDown',
+ 'ArrowUp',
+ 'ArrowDown',
+ 'ArrowLeft',
+ 'ArrowRight',
+ 'Minus',
+ 'Equal',
+ 'BracketLeft',
+ 'BracketRight',
+ 'Backslash',
+ 'Semicolon',
+ 'Quote',
+ 'Backquote',
+ 'Comma',
+ 'Period',
+ 'Slash',
+]);
+
+const MODIFIERS = new Set([
+ 'CommandOrControl',
+ 'CmdOrCtrl',
+ 'CommandOrCtrl',
+ 'CmdOrControl',
+ 'Command',
+ 'Cmd',
+ 'Super',
+ 'Control',
+ 'Ctrl',
+ 'Alt',
+ 'Option',
+ 'Shift',
+]);
+
+/** Normalizes a `KeyboardEvent.code` to an accelerator key, or null when it can't be one. */
+function keyFromCode(code: string): string | null {
+ const letter = /^Key([A-Z])$/.exec(code);
+ if (letter) return letter[1];
+ const digit = /^Digit([0-9])$/.exec(code);
+ if (digit) return digit[1];
+ if (/^F([1-9]|1[0-9]|2[0-4])$/.test(code)) return code;
+ if (/^Numpad[0-9]$/.test(code)) return code;
+ if (NAMED_KEYS.has(code)) return code;
+ return null;
+}
+
+function isValidKey(key: string): boolean {
+ return /^[A-Z0-9]$/.test(key) || keyFromCode(key) === key;
+}
+
+export function captureShortcut(press: KeyPress, isMac: boolean): CaptureResult {
+ if (MODIFIER_CODES.has(press.code)) return { kind: 'pending' };
+
+ const key = keyFromCode(press.code);
+ if (!key) return { kind: 'invalid' };
+
+ // `CommandOrControl` maps to Cmd on macOS and Ctrl elsewhere, so a shortcut recorded on one
+ // platform keeps working when settings are reused on another.
+ const modifiers: string[] = [];
+ if (isMac ? press.metaKey : press.ctrlKey) modifiers.push('CommandOrControl');
+ if (isMac && press.ctrlKey) modifiers.push('Control');
+ if (!isMac && press.metaKey) modifiers.push('Super');
+ if (press.altKey) modifiers.push('Alt');
+ if (press.shiftKey) modifiers.push('Shift');
+
+ // Shift alone would swallow ordinary capital letters system-wide.
+ if (!isValidShortcutModifiers(modifiers)) return { kind: 'invalid' };
+
+ return { kind: 'ok', accelerator: [...modifiers, key].join('+') };
+}
+
+function isValidShortcutModifiers(modifiers: string[]): boolean {
+ return modifiers.some((modifier) => modifier !== 'Shift');
+}
+
+/** Accepts the accelerator forms this app writes plus the common aliases Tauri understands. */
+export function isValidAccelerator(accelerator: string): boolean {
+ const parts = accelerator.split('+');
+ if (parts.length < 2) return false;
+ const key = parts[parts.length - 1];
+ const modifiers = parts.slice(0, -1);
+ if (!modifiers.every((modifier) => MODIFIERS.has(modifier))) return false;
+ if (new Set(modifiers).size !== modifiers.length) return false;
+ return isValidShortcutModifiers(modifiers) && isValidKey(key);
+}
+
+const MAC_SYMBOLS: Record = {
+ CommandOrControl: '⌘',
+ CmdOrCtrl: '⌘',
+ CommandOrCtrl: '⌘',
+ CmdOrControl: '⌘',
+ Command: '⌘',
+ Cmd: '⌘',
+ Super: '⌘',
+ Control: '⌃',
+ Ctrl: '⌃',
+ Alt: '⌥',
+ Option: '⌥',
+ Shift: '⇧',
+};
+
+const OTHER_LABELS: Record = {
+ CommandOrControl: 'Ctrl',
+ CmdOrCtrl: 'Ctrl',
+ CommandOrCtrl: 'Ctrl',
+ CmdOrControl: 'Ctrl',
+ Command: 'Super',
+ Cmd: 'Super',
+ Super: 'Super',
+ Control: 'Ctrl',
+ Ctrl: 'Ctrl',
+ Alt: 'Alt',
+ Option: 'Alt',
+ Shift: 'Shift',
+};
+
+const KEY_LABELS: Record = {
+ Space: 'Space',
+ ArrowUp: '↑',
+ ArrowDown: '↓',
+ ArrowLeft: '←',
+ ArrowRight: '→',
+ Minus: '-',
+ Equal: '=',
+ BracketLeft: '[',
+ BracketRight: ']',
+ Backslash: '\\',
+ Semicolon: ';',
+ Quote: "'",
+ Backquote: '`',
+ Comma: ',',
+ Period: '.',
+ Slash: '/',
+};
+
+export function formatAccelerator(accelerator: string, isMac: boolean): string {
+ const parts = accelerator.split('+');
+ const key = parts[parts.length - 1];
+ const labels = parts
+ .slice(0, -1)
+ .map((modifier) => (isMac ? MAC_SYMBOLS : OTHER_LABELS)[modifier] ?? modifier);
+ labels.push(KEY_LABELS[key] ?? key);
+ return labels.join(isMac ? '' : '+');
+}
diff --git a/packages/desktop/src/styles.css b/packages/desktop/src/styles.css
new file mode 100644
index 0000000..f3c7346
--- /dev/null
+++ b/packages/desktop/src/styles.css
@@ -0,0 +1,84 @@
+@import 'tailwindcss';
+@import '@crypt.fyi/theme/tokens.css';
+
+/* Plain HTML equivalents of the web client's Input, Button and Card components. */
+@layer base {
+ input[type='url'],
+ input[type='text'],
+ input[type='password'],
+ select,
+ textarea {
+ @apply w-full rounded-lg border border-border bg-muted px-3 py-1 text-sm text-foreground outline-hidden transition-colors hover:border-input;
+ }
+
+ input[type='url'],
+ input[type='text'],
+ input[type='password'],
+ select {
+ @apply h-11;
+ }
+
+ textarea {
+ @apply resize-none py-2.5 font-mono;
+ }
+
+ input[type='checkbox'] {
+ @apply size-4 shrink-0 accent-primary;
+ }
+
+ input:focus-visible,
+ select:focus-visible,
+ textarea:focus-visible,
+ button:focus-visible {
+ @apply ring-2 ring-ring ring-offset-2 ring-offset-background outline-hidden;
+ }
+
+ input:disabled,
+ select:disabled,
+ textarea:disabled,
+ button:disabled {
+ @apply cursor-not-allowed opacity-50;
+ }
+}
+
+@layer components {
+ .card {
+ @apply space-y-4 rounded-xl border bg-card p-5 text-card-foreground shadow-[var(--card-shadow)];
+ }
+
+ .card-title {
+ @apply font-display text-base font-semibold tracking-tight;
+ }
+
+ .field {
+ @apply block space-y-1.5;
+ }
+
+ .field-label {
+ @apply block text-sm font-medium;
+ }
+
+ .field-hint {
+ @apply block text-xs text-muted-foreground;
+ }
+
+ .option-row {
+ @apply flex items-center gap-2.5 text-sm;
+ }
+
+ .btn {
+ @apply inline-flex h-11 cursor-pointer items-center justify-center rounded-lg px-4 text-sm font-semibold whitespace-nowrap transition-colors;
+ }
+
+ .btn-primary {
+ @apply bg-primary text-primary-foreground hover:bg-primary/85;
+ }
+
+ .btn-outline {
+ @apply border border-border bg-card hover:border-input hover:bg-accent;
+ }
+
+ .icon-btn {
+ @apply grid size-9 cursor-pointer place-items-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground;
+ }
+}
diff --git a/packages/desktop/src/vite-env.d.ts b/packages/desktop/src/vite-env.d.ts
new file mode 100644
index 0000000..73aa6cd
--- /dev/null
+++ b/packages/desktop/src/vite-env.d.ts
@@ -0,0 +1,4 @@
+///
+
+/** Injected from package.json by vite.config.ts; sent as the `X-Client` header. */
+declare const __APP_VERSION__: string;
diff --git a/packages/desktop/tsconfig.json b/packages/desktop/tsconfig.json
new file mode 100644
index 0000000..a0861f7
--- /dev/null
+++ b/packages/desktop/tsconfig.json
@@ -0,0 +1,19 @@
+{
+ "compilerOptions": {
+ "target": "ES2020",
+ "useDefineForClassFields": true,
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "types": ["node"],
+ "skipLibCheck": true,
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "noEmit": true,
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noFallthroughCasesInSwitch": true
+ },
+ "include": ["src", "vite.config.ts"]
+}
diff --git a/packages/desktop/vite.config.ts b/packages/desktop/vite.config.ts
new file mode 100644
index 0000000..3f76b77
--- /dev/null
+++ b/packages/desktop/vite.config.ts
@@ -0,0 +1,34 @@
+///
+import fs from 'node:fs';
+import { defineConfig } from 'vite';
+import tailwindcss from '@tailwindcss/vite';
+import { themeInitScript } from '@crypt.fyi/theme/vite';
+
+const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
+
+// https://v2.tauri.app/start/frontend/vite/
+export default defineConfig({
+ plugins: [tailwindcss(), themeInitScript()],
+ define: {
+ __APP_VERSION__: JSON.stringify(pkg.version),
+ },
+ // Keep Rust errors visible in the terminal when running `tauri dev`.
+ clearScreen: false,
+ server: {
+ port: 1420,
+ strictPort: true,
+ watch: {
+ ignored: ['**/src-tauri/**'],
+ },
+ },
+ envPrefix: ['VITE_', 'TAURI_ENV_'],
+ build: {
+ // WebView2 (Windows) and WKWebView on Tauri's supported macOS releases.
+ target: process.env.TAURI_ENV_PLATFORM === 'windows' ? 'chrome105' : 'safari13',
+ minify: !process.env.TAURI_ENV_DEBUG,
+ sourcemap: Boolean(process.env.TAURI_ENV_DEBUG),
+ },
+ test: {
+ include: ['src/**/*.test.ts'],
+ },
+});
diff --git a/packages/theme/README.md b/packages/theme/README.md
index 30527fb..277e62b 100644
--- a/packages/theme/README.md
+++ b/packages/theme/README.md
@@ -1,6 +1,6 @@
# @crypt.fyi/theme
-The design language shared by `@crypt.fyi/web` and `@crypt.fyi/extension`. It is private and has no build step: consumers compile its sources with their own Vite and Tailwind.
+The design language shared by `@crypt.fyi/web`, `@crypt.fyi/extension` and `@crypt.fyi/desktop`. It is private and has no build step: consumers compile its sources with their own Vite and Tailwind.
| Export | Contents |
| --- | --- |
@@ -11,4 +11,4 @@ The design language shared by `@crypt.fyi/web` and `@crypt.fyi/extension`. It is
UI components are deliberately not shared. The web client uses React and shadcn, and the extension's settings page stays plain HTML, so a shared component library would add React to the extension for a single form.
-A preference is stored in `localStorage`, which is per origin. The web client and the extension therefore keep separate choices.
+A preference is stored in `localStorage`, which is per origin. The web client, the extension and the desktop app therefore keep separate choices.
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index dda0e82..47e3b2e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -183,6 +183,55 @@ importers:
specifier: ^5.9.2
version: 5.9.2
+ packages/desktop:
+ dependencies:
+ '@crypt.fyi/core':
+ specifier: workspace:*
+ version: link:../core
+ '@crypt.fyi/theme':
+ specifier: workspace:*
+ version: link:../theme
+ '@tauri-apps/api':
+ specifier: 2.12.5
+ version: 2.12.5
+ '@tauri-apps/plugin-clipboard-manager':
+ specifier: 2.5.0
+ version: 2.5.0
+ '@tauri-apps/plugin-global-shortcut':
+ specifier: 2.4.1
+ version: 2.4.1
+ '@tauri-apps/plugin-notification':
+ specifier: 2.8.1
+ version: 2.8.1
+ zod:
+ specifier: ^4.6.6
+ version: 4.6.7
+ devDependencies:
+ '@tailwindcss/vite':
+ specifier: 4.3.3
+ version: 4.3.3(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0))
+ '@tauri-apps/cli':
+ specifier: 2.12.6
+ version: 2.12.6
+ '@types/node':
+ specifier: ^22.18.0
+ version: 22.20.1
+ eslint:
+ specifier: ^9.34.0
+ version: 9.39.2(jiti@2.7.0)(supports-color@10.2.2)
+ tailwindcss:
+ specifier: ^4.3.3
+ version: 4.3.3
+ typescript:
+ specifier: ~5.9.2
+ version: 5.9.2
+ vite:
+ specifier: 8.3.5
+ version: 8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)
+ vitest:
+ specifier: 4.1.12
+ version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0))
+
packages/extension:
dependencies:
'@crypt.fyi/core':
@@ -375,7 +424,7 @@ importers:
version: 8.12.3
vitest:
specifier: ^4.1.12
- version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)
+ version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0))
packages/theme:
dependencies:
@@ -403,7 +452,7 @@ importers:
version: 8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)
vitest:
specifier: 4.1.12
- version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)
+ version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0))
packages/web:
dependencies:
@@ -572,7 +621,7 @@ importers:
version: 8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)
vitest:
specifier: 4.1.12
- version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)
+ version: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0))
packages:
@@ -3304,6 +3353,94 @@ packages:
resolution: {integrity: sha512-uhOeFyxLcU41HzvrxsGpiWdcMbScY1EDgbZ5K7DVRMYInbLYWAC0EA/kx9wXAoSM8q82bUG2hRl8+EAjE6XAbA==}
engines: {node: '>=20.19'}
+ '@tauri-apps/api@2.12.5':
+ resolution: {integrity: sha512-G9QIMt5fzED+aS4QhVK3w1HWLKpLIwH/MnpCr9z1ugGEHnS2ORmqrLkc0uALOjRK4qXJy+4Yiw8LDl/KicC1Hg==}
+
+ '@tauri-apps/cli-darwin-arm64@2.12.6':
+ resolution: {integrity: sha512-Uokwk1hFfJoG54+kD8iU0St33jAIkNvojnjEfBZ6UbL5rnM10AiFwUS/2DHTJ9R4/Kba4U44v7djfMuWFTQgeg==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@tauri-apps/cli-darwin-x64@2.12.6':
+ resolution: {integrity: sha512-WhahqzcyHCpCzh4Taf0ZbBm6nGkvuOSh5ffrgOO7EdYaYe+RBQK8LOlFu+bbjul5v9cdLDi3kco+0+7IlZtTVA==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [darwin]
+
+ '@tauri-apps/cli-linux-arm-gnueabihf@2.12.6':
+ resolution: {integrity: sha512-GB6weN+iFHxiFZ9SOKW6fINis7gnxohoOldR7sryBe7uaavkFGaMCa0yQs5njeXPWvzlE9WTQ13z8oDjmqK+Ww==}
+ engines: {node: '>= 10'}
+ cpu: [arm]
+ os: [linux]
+
+ '@tauri-apps/cli-linux-arm64-gnu@2.12.6':
+ resolution: {integrity: sha512-mdHoUFYKfztUtPKE0C2hhGkEo7j6swXjg+5yRRKSD7A2gLkRPQFIXWD/DAYhiJdeAkyA8MCP6nvvKvg/4YryWQ==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [glibc]
+
+ '@tauri-apps/cli-linux-arm64-musl@2.12.6':
+ resolution: {integrity: sha512-2BxB+9a3JRN0eJ0t0qGe8IKJfgBLOZDE8a499OXH+yg4J9bMpSK1oHXBxnHuSHFWhby4QnQ/t+sBf7tRC0UZeA==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [linux]
+ libc: [musl]
+
+ '@tauri-apps/cli-linux-riscv64-gnu@2.12.6':
+ resolution: {integrity: sha512-sb58RsNHex9QVqHdN1cf9MMlamUWAtk1NzuxTZalUnBUHfblIbe71hfmdI6whDZ84MufgOdeg/bzvhrbZS1r0w==}
+ engines: {node: '>= 10'}
+ cpu: [riscv64]
+ os: [linux]
+ libc: [glibc]
+
+ '@tauri-apps/cli-linux-x64-gnu@2.12.6':
+ resolution: {integrity: sha512-ZAb4/CHRma3ErjL2RGfHjITTUBIs4zySf0hIli9BddOtEdSx0ze0hEgxl+HfBVc5OEW/QmbiZ2E2+CkkHc8Pcg==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [glibc]
+
+ '@tauri-apps/cli-linux-x64-musl@2.12.6':
+ resolution: {integrity: sha512-ueSzM2Du6r4i1d/lby9kEvrhPnXw5zM/VYvcW1ldEWSpkUyVohsBXkmD+U7vMskEW5tXeCUenki7nYVxyGBGpQ==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [linux]
+ libc: [musl]
+
+ '@tauri-apps/cli-win32-arm64-msvc@2.12.6':
+ resolution: {integrity: sha512-6bmOt2BQSe0Bba+5CJcTKSML7VOYDxyiAKyBrjo86VxMdC1usIQmklu3Xc83s3QoK1rOMwwbANlPF6i5R2mvIg==}
+ engines: {node: '>= 10'}
+ cpu: [arm64]
+ os: [win32]
+
+ '@tauri-apps/cli-win32-ia32-msvc@2.12.6':
+ resolution: {integrity: sha512-9q9ZFNuFreBczwyJuhhlrEOBzGClwWUYirQ2GBl66Y6EaNl17IdLH8TRqoY9wYB1LnctNBi+Fa/WMGtFA4BtFQ==}
+ engines: {node: '>= 10'}
+ cpu: [ia32]
+ os: [win32]
+
+ '@tauri-apps/cli-win32-x64-msvc@2.12.6':
+ resolution: {integrity: sha512-ion7Chbj21ROxMRpjQ7G8rz5sIOaI7IoBQum1oq5sl1V5zGWyc/oYnCrQhVqO2TxK/lBDWxt648BzLi02SY3Xg==}
+ engines: {node: '>= 10'}
+ cpu: [x64]
+ os: [win32]
+
+ '@tauri-apps/cli@2.12.6':
+ resolution: {integrity: sha512-/cOeQgqq8PBDPODOjjT0YHs4qxKCHcQMWMiBm4rLM3JNr9mZE+PHNKOK4zAkhIUtYMNL/0fweW48VNvzD1AbqA==}
+ engines: {node: '>= 10'}
+ hasBin: true
+
+ '@tauri-apps/plugin-clipboard-manager@2.5.0':
+ resolution: {integrity: sha512-dibUy1nKURYDXRMvjNk4deAbTZ5jPQ8wCE4nolt5xniryWgXQ4sK2GkFXoXlHbRdPzfZptZj95BRLfalA7m/2Q==}
+
+ '@tauri-apps/plugin-global-shortcut@2.4.1':
+ resolution: {integrity: sha512-NVCoQ0ShDFncsj9f8iAzhRBTnsJj5sf60vOjcV6emeQHzmEFd6+RXH+fUHHuJAbEYP4mdT2vGlvVOG7tMr/e8g==}
+
+ '@tauri-apps/plugin-notification@2.8.1':
+ resolution: {integrity: sha512-B+OCJv17XCFQxAhe2+fn2bHqQ1fz/hGnYHeT++yv8+q0daOH5o1ghX7MmxWgoGFp7POaNn4UMONclHeZn65mJA==}
+
'@tsconfig/node10@1.0.12':
resolution: {integrity: sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==}
@@ -7000,6 +7137,7 @@ packages:
'@vitest/ui': 4.1.12
happy-dom: '*'
jsdom: '*'
+ vite: 8.3.5
peerDependenciesMeta:
'@edge-runtime/vm':
optional: true
@@ -9861,7 +9999,7 @@ snapshots:
dependencies:
'@types/estree': 1.0.9
estree-walker: 2.0.2
- picomatch: 4.0.5
+ picomatch: 4.0.7
optionalDependencies:
rollup: 4.62.3
@@ -10243,6 +10381,67 @@ snapshots:
'@tanstack/virtual-file-routes@1.162.0': {}
+ '@tauri-apps/api@2.12.5': {}
+
+ '@tauri-apps/cli-darwin-arm64@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-darwin-x64@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-linux-arm-gnueabihf@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-linux-arm64-gnu@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-linux-arm64-musl@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-linux-riscv64-gnu@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-linux-x64-gnu@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-linux-x64-musl@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-win32-arm64-msvc@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-win32-ia32-msvc@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli-win32-x64-msvc@2.12.6':
+ optional: true
+
+ '@tauri-apps/cli@2.12.6':
+ optionalDependencies:
+ '@tauri-apps/cli-darwin-arm64': 2.12.6
+ '@tauri-apps/cli-darwin-x64': 2.12.6
+ '@tauri-apps/cli-linux-arm-gnueabihf': 2.12.6
+ '@tauri-apps/cli-linux-arm64-gnu': 2.12.6
+ '@tauri-apps/cli-linux-arm64-musl': 2.12.6
+ '@tauri-apps/cli-linux-riscv64-gnu': 2.12.6
+ '@tauri-apps/cli-linux-x64-gnu': 2.12.6
+ '@tauri-apps/cli-linux-x64-musl': 2.12.6
+ '@tauri-apps/cli-win32-arm64-msvc': 2.12.6
+ '@tauri-apps/cli-win32-ia32-msvc': 2.12.6
+ '@tauri-apps/cli-win32-x64-msvc': 2.12.6
+
+ '@tauri-apps/plugin-clipboard-manager@2.5.0':
+ dependencies:
+ '@tauri-apps/api': 2.12.5
+
+ '@tauri-apps/plugin-global-shortcut@2.4.1':
+ dependencies:
+ '@tauri-apps/api': 2.12.5
+
+ '@tauri-apps/plugin-notification@2.8.1':
+ dependencies:
+ '@tauri-apps/api': 2.12.5
+
'@tsconfig/node10@1.0.12': {}
'@tsconfig/node12@1.0.11': {}
@@ -10675,7 +10874,7 @@ snapshots:
obug: 2.1.4
std-env: 4.2.0
tinyrainbow: 3.1.0
- vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)
+ vitest: 4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0))
'@vitest/expect@4.1.12':
dependencies:
@@ -12265,7 +12464,7 @@ snapshots:
chalk: 4.1.2
graceful-fs: 4.2.11
jest-util: 30.4.1
- picomatch: 4.0.5
+ picomatch: 4.0.7
pretty-format: 30.4.1
slash: 3.0.0
stack-utils: 2.0.6
@@ -13886,7 +14085,7 @@ snapshots:
unplugin@3.3.0(esbuild@0.25.0)(rolldown@1.2.16)(rollup@4.62.3)(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)):
dependencies:
'@jridgewell/remapping': 2.3.5
- picomatch: 4.0.5
+ picomatch: 4.0.7
webpack-virtual-modules: 0.6.2
optionalDependencies:
esbuild: 0.25.0
@@ -14031,7 +14230,7 @@ snapshots:
jiti: 2.7.0
yaml: 2.9.0
- vitest@4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0):
+ vitest@4.1.12(@opentelemetry/api@1.9.1)(@types/node@22.20.1)(@vitest/coverage-v8@4.1.12)(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0)):
dependencies:
'@vitest/expect': 4.1.12
'@vitest/mocker': 4.1.12(vite@8.3.5(@types/node@22.20.1)(esbuild@0.25.0)(jiti@2.7.0)(yaml@2.9.0))
@@ -14045,7 +14244,7 @@ snapshots:
magic-string: 0.30.21
obug: 2.1.4
pathe: 2.0.3
- picomatch: 4.0.5
+ picomatch: 4.0.7
std-env: 4.2.0
tinybench: 2.9.0
tinyexec: 1.2.4
@@ -14058,18 +14257,7 @@ snapshots:
'@types/node': 22.20.1
'@vitest/coverage-v8': 4.1.12(vitest@4.1.12)
transitivePeerDependencies:
- - '@vitejs/devtools'
- - esbuild
- - jiti
- - less
- msw
- - sass
- - sass-embedded
- - stylus
- - sugarss
- - terser
- - tsx
- - yaml
void-elements@3.1.0: {}