Skip to content

The open alternative to Salesforce, designed for AI.

[3/4] Desktop Recorder: add the Twenty desktop app (#25616)

Thomas des Francs984781d2e53e
diff --git a/.github/workflows/ci-companion.yaml b/.github/workflows/ci-companion.yaml
new file mode 100644
index 00000000000..316935fba82
--- /dev/null
+++ b/.github/workflows/ci-companion.yaml
@@ -0,0 +1,43 @@
+name: CI Desktop
+
+on:
+ pull_request:
+ paths:
+ - 'packages/twenty-companion/**'
+ - 'packages/twenty-ui/**'
+ - 'packages/twenty-front/**'
+ - 'packages/twenty-shared/**'
+ - 'package.json'
+ - 'yarn.lock'
+ - '.github/workflows/ci-companion.yaml'
+ push:
+ branches: [main]
+ paths:
+ - 'packages/twenty-companion/**'
+ - 'packages/twenty-ui/**'
+ - 'packages/twenty-front/**'
+ - 'packages/twenty-shared/**'
+ - 'package.json'
+ - 'yarn.lock'
+ - '.github/workflows/ci-companion.yaml'
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+jobs:
+ desktop:
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ steps:
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
+ - uses: ./.github/actions/yarn-install
+ - name: Typecheck
+ run: yarn workspace @twentyhq/companion typecheck
+ - name: Test
+ run: yarn workspace @twentyhq/companion test
+ - name: Build
+ run: yarn workspace @twentyhq/companion build
diff --git a/package.json b/package.json
index 1ab56c24c47..49e405b8ddb 100644
--- a/package.json
+++ b/package.json
@@ -84,7 +84,8 @@
"packages/create-twenty-app",
"packages/twenty-agent-skills",
"packages/twenty-oxlint-rules",
- "packages/twenty-claude-skills"
+ "packages/twenty-claude-skills",
+ "packages/twenty-companion"
]
},
"prettier": {
diff --git a/packages/twenty-companion/.gitignore b/packages/twenty-companion/.gitignore
new file mode 100644
index 00000000000..c84e5a767f2
--- /dev/null
+++ b/packages/twenty-companion/.gitignore
@@ -0,0 +1,6 @@
+node_modules/
+.yarn/
+dist/
+release/
+.env
+*.log
diff --git a/packages/twenty-companion/README.md b/packages/twenty-companion/README.md
new file mode 100644
index 00000000000..eae45c92703
--- /dev/null
+++ b/packages/twenty-companion/README.md
@@ -0,0 +1,174 @@
+# Twenty
+
+See upcoming meetings, record calls, and open transcripts and summaries in your Twenty workspace.
+
+Twenty brings your calendar and recording controls to your desktop. Join upcoming meetings, capture unscheduled conversations, and keep recordings connected to the workspace you choose. A native menu keeps your next meeting and recording controls within reach while you work.
+
+## What you can do
+
+- **See what's next.** Home shows your next three calendar events, with an option to see more. The native menu shows meeting titles, times, and shortcuts to join.
+- **Join on time.** Open a meeting yourself or let auto-join open its link when the event starts. You can skip auto-join for an individual event; the meeting provider may still require confirmation to enter.
+- **Record scheduled and unscheduled conversations.** Twenty records conversations, including Discord calls, using your microphone and system audio. A separately installed Call Recorder can continue handling calendar meetings with a bot.
+- **Stay in control.** Start, pause, resume, and finish desktop recordings. Automatic recording of detected calls is optional and off by default.
+- **Continue in Twenty.** See your five most recent recordings, open a recording directly, or choose **View all in Twenty** to browse and search your history in the workspace.
+
+## Requirements and setup
+
+This is an Electron development build for **Apple Silicon Macs running macOS 14.2 or newer**. Windows and Linux builds are planned; recording and packaging for those platforms are not implemented yet.
+
+1. A workspace administrator installs the independent Desktop Recorder integration and configures Recall. See [Workspace setup](#workspace-setup).
+2. Open Twenty, enter your workspace URL, and sign in through Twenty in your browser. After authorization, Twenty comes to the foreground automatically; the browser callback tab can be closed.
+3. Grant microphone, system audio, and meeting-detection permissions in the guided setup.
+4. Connect a calendar in Twenty to see upcoming events, or choose **New recording** to capture an unscheduled conversation.
+
+The app uses your connected workspace's calendar and recording settings. Desktop recording requires an internet connection; AI summaries also require AI to be configured in Twenty. Let participants know when you record.
+
+Open the main window from Raycast, Finder, the Dock, or **⌘⇧Space**. Closing the window keeps the app running in the menu bar; quitting stops it.
+
+## Desktop flow
+
+- Setup follows Connect → Permissions → Ready. Microphone, system audio, and meeting detection each have their own explanation and enable action. Continue requires all three permissions; completing setup never starts recording.
+- Permission denial opens the corresponding system pane. Returning to the app refreshes permissions without interrupting capture.
+- General settings include System/Light/Dark appearance, launch at login, and the meeting countdown beside the tray icon. Hiding the countdown keeps the recording and paused indicators visible. Appearance also applies to native Electron UI. Preferences persist locally; older installations retain their choices and receive defaults for new controls.
+- Meetings settings include auto-join, automatic desktop recording, and call-detection notifications. Turning off call-detection notifications leaves detection and recording-interruption alerts active. The Speaker tags row reflects meeting-detection permission. Calendar settings opens the connected Twenty workspace's accounts page; Recording permissions opens the existing full permission checklist.
+- The top-left workspace dropdown displays the workspace logo when available, falls back to the Twenty icon, and includes Settings, refresh, opening Twenty, and disconnect. The header has no Home tag. The dropdown supports keyboard navigation, Escape, and dismissal outside the menu.
+- Home shows the next three events grouped by local calendar day, with large day numbers and meeting time ranges, followed by the five most recent recordings. See more expands the event list when additional meetings are available. View all in Twenty opens Call Recordings in the connected workspace. Clicking any recording opens its record directly in that workspace, including processing or failed recordings. Finishing capture keeps the current page open and updates the recording status in the list.
+- Pause and Resume control the same Recall recording. The timer excludes paused time. Finish works while paused; failed pause/resume requests retain the actual previous status.
+- The main window uses normal native window controls and remains visible after losing focus. The native meeting menu shows the next three events grouped by local day, with titles and time ranges, Now/starting-soon context, per-meeting Join and Skip auto-join actions, and calendar recording policy. A direct Join action appears when exactly one meeting is imminent and no call is active. View calendar opens Home. macOS 14.4+ uses native sublabels; other platforms keep timing inline. Launch at login remains in Settings. File → Meeting menu (⌘/Ctrl⇧M) opens the same menu when the tray icon is hard to reach. Native actions use the same recording and meeting commands as the main window. Menu updates wait until an open menu closes to preserve keyboard selection.
+- Controls, cards, tags, avatars, and interface typography use Twenty UI directly in both themes. Emphasized actions use its blue primary accent. All typography uses Inter. Native popover positioning, desktop layouts, and the onboarding cloud are desktop-specific compositions using shared tokens.
+- Transcripts and summaries open in Twenty’s standard Call Recording view. This iteration does not add Granola's note editor, AI chat, or folders.
+
+The behavior reference is [Granola's desktop overview](https://docs.granola.ai/help-center/getting-started/granola-101) and [pause/resume interaction](https://docs.granola.ai/help-center/taking-notes/transcription), plus the live permissions screen. Desktop auto-recording is controlled by Twenty’s local preferences.
+
+## Recording behavior
+
+- **Optional calendar bot:** A separately installed Call Recorder can schedule bots independently. Twenty does not require it and uses its own backend, while both apps store results in Twenty's standard `callRecording` object.
+- **Auto-join:** enabled by default. The companion opens the user's meeting link at its start time. A provider's pre-join or waiting-room confirmation may still require the user. It never turns the camera or microphone on. Stale agendas, overlapping meetings, an active call, and per-meeting skips prevent an automatic opening.
+- **Desktop capture:** Recall's native SDK records supported detected calls. Automatic desktop recording is opt-in. Scheduled meetings on platforms that have no calendar bot can use desktop capture when automatic recording is enabled locally.
+- **Discord and other audio:** choose **New recording**, then **Finish**. This captures system audio and microphone; Discord detection and participant names are not promised. Avoid playing unrelated audio during capture. Audio-only capture has no video.
+- The desktop and authenticated backend reserve identified scheduled bot meetings for the bot. An unrelated calendar event does not block manual system-audio recording. Manual capture records all computer audio, so do not start it for a meeting already being recorded by its calendar bot.
+- Participants should be told when recording. Capture requires macOS permissions. A network loss stops capture; restart it after reconnecting. There is no offline recording or automatic restart after a network loss.
+- Completion, media import, transcript generation, and summaries use the independent Desktop Recorder integration. Desktop sessions additionally retain their owner and Recall upload ID. Missed completion webhooks are recovered by a bounded maintenance job. The shared credit-charging path has unresolved issues listed under [Verification boundary](#verification-boundary).
+
+## Architecture
+
+```text
+Electron renderer → validated IPC → Electron main process
+ ├─ macOS Keychain-backed OAuth storage
+ ├─ Twenty OAuth discovery + PKCE + loopback callback
+ └─ Recall Desktop SDK ← short-lived upload token
+
+Desktop Recorder authenticated /companion/desktop route
+ ├─ personal calendar channels and agenda (runAs: user)
+ ├─ recording ownership and active calendar-bot checks
+ └─ Recall SDK upload creation (server-held API key)
+
+Recall signed webhooks → Desktop Recorder durable importer → CallRecording
+```
+
+No Recall API key or Twenty OAuth token is exposed to the renderer. OAuth tokens are encrypted using Electron `safeStorage`; only the main process can read them. Function domains and frontend workspace links are discovered from the authenticated Twenty server, including hosted isolated function domains.
+
+## Development
+
+Use Node 24 and the repository's Yarn version. Desktop is the `@twentyhq/companion` Yarn workspace and `twenty-companion` Nx project. Install from the repository root; the root lockfile owns desktop, Twenty UI, and their dependencies. Do not install a separate desktop dependency tree.
+
+```sh
+yarn install --immutable
+yarn workspace @twentyhq/companion dev
+```
+
+`dev` shares the production Electron build configuration and watches main/preload dependencies. A successful rebuild requests a graceful Electron restart; capture startup, active or paused recording, and stopping defer it until idle. Repeated rebuilds use the latest successful output. Failed compilations leave the running app untouched. Renderer edits continue to use Vite. Quitting Electron closes the watcher and Vite server.
+
+`yarn workspace @twentyhq/companion preview` serves the renderer at `http://127.0.0.1:4317`. Use `?preview` for an interactive sample Home, `?preview=welcome` for the full setup, `?preview=permissions` for permission setup, `?preview=denied` for denial, or `?preview=recording` for active capture controls. The native menu is available only in the desktop app. Preview actions simulate state transitions; no audio is captured, no workspace writes or external calls are made. This mode is excluded from production. Stop the preview before running the desktop `dev` command, which uses the same port.
+
+From the repository root:
+
+```sh
+yarn workspace @twentyhq/companion typecheck
+yarn workspace @twentyhq/companion test
+yarn workspace @twentyhq/companion build
+yarn workspace @twentyhq/companion package
+"packages/twenty-companion/release/Twenty-darwin-arm64/Twenty.app/Contents/MacOS/Twenty" --smoke
+```
+
+The equivalent Nx project targets are `twenty-companion:build`, `:typecheck`, and `:test`. Native packaging targets are uncached and run only when requested. Desktop imports the current Twenty UI workspace source through Vite aliases; its explicit workspace dependency provides the shared dependency graph.
+
+Root installs keep native install scripts disabled. `dev`, `start`, `package`, and `package:archive` run `native:setup`, which downloads missing Electron and Recall binaries on Apple Silicon macOS. Typecheck, unit tests, renderer preview, and JavaScript builds do not require these downloads.
+
+Packaging stages only `dist`, native image assets, a runtime manifest, and Recall's resolved runtime dependencies in a temporary directory. It never packages the workspace `node_modules` tree. Recall's binaries and frameworks remain outside ASAR; the staging directory is removed after packaging.
+
+The smoke command uses a temporary user-data directory, checks secure IPC in the single main window and construction of the native tray menu, initializes the native Recall SDK without requesting recording permissions, and exits. It does not record audio or launch a meeting bot. Quit a running normal copy before using it.
+
+The package command verifies Recall's executable is outside the ASAR archive. The generated `.app` is a local unsigned development build, not a notarized distribution. Apple signing, notarization, a release update channel, and supported-provider recording checks are required before distributing to users. Follow Recall's current signing instructions for its embedded executable and frameworks.
+
+## Workspace setup
+
+The backend is [Desktop Recorder](../twenty-apps/public/companion/README.md), an independently installable Twenty application. It owns `/companion/desktop`, the `companionSession` ownership field, import/recovery functions, its summarizer agent, and Recall credentials. Follow its [setup instructions](../twenty-apps/public/companion/SETUP.md). Call Recorder is optional.
+
+The desktop reuses the CLI OAuth client and browser sign-in flow used by `twenty remote:add`, with PKCE and a local callback. Tokens stay in the desktop's secure store. After sign-in, the desktop checks the backend and offers installation if it is missing. An administrator installs the integration in each target workspace. Existing completed desktop recordings can be transferred using the integration's one-time migration script without replacing their media or record IDs.
+
+## Code structure
+
+- `src/main/services/Companion.ts` owns workspace and recording state. Only the main process holds credentials and Recall upload tokens.
+- `src/main/services/TwentyClient.ts` discovers the workspace endpoint, refreshes OAuth credentials, and validates backend responses. Credential writes are serialized so sign-out wins over an in-flight refresh.
+- `src/shared/types.ts` defines the IPC commands, response schemas, and state types. Settings commands carry patches; the main process merges and persists them in order.
+- `src/renderer/components/CompanionApp.tsx` composes the shell. `Onboarding`, `Home`, `RecordingList`, and `Settings` own their screen layout and local UI state, using the same shared controls.
+- `HalftoneBackground` renders the bundled cloud photo through the image-only Halftone Studio shader in `halftone.ts`. The image covers the full window with centered cropping. Dash spacing stays fixed in CSS pixels while power and a soft contrast wave animate, with sparse drifting particles. It stops rendering when hidden or reduced motion is enabled, releases GPU resources on unmount, and leaves the normal background if WebGL is unavailable.
+- The Desktop Recorder integration owns persistence, processing, and its Twenty billing calls. Lifecycle updates use conditional status filters; a stale webhook or recovery job cannot move a completed recording back to processing.
+
+Capture controls remain visible until Recall acknowledges a stop. Network interruption triggers an explicit stop; a failed stop leaves the controls available for retry. Quitting waits for pending capture setup and releases SDK listeners.
+
+## Verification boundary
+
+Local checks have covered unit tests, TypeScript, the app manifest build, renderer navigation, packaging, and native SDK startup. A desktop recording was verified on September 7–8, 2026: Recall completed the audio and transcript, and the local **Apple** workspace stored the recording, transcript, and summary. This validates that desktop recording path; it does not validate every call provider or calendar-bot behavior.
+
+The backend test suite covers desktop provisioning, webhook processing, recovery, import, summaries, and charge calculation. These tests mock billing. The local Twenty server has billing disabled, so the recording test did **not** verify a workspace credit deduction.
+
+Desktop Recorder uses the existing SDK billing path and does not change platform pricing, credit accounting, or billing infrastructure. Validate deductions and exhausted-credit behavior in a billing-enabled test workspace before production distribution. Automatic retries of ambiguous charges are intentionally excluded from this delivery.
+
+Signing, notarization, update delivery, and supported-provider recording checks are also required before distribution.
+
+References: [Recall Desktop SDK](https://docs.recall.ai/docs/desktop-sdk), [platform support](https://docs.recall.ai/docs/dsdk-supported-platforms), [system audio capture](https://docs.recall.ai/docs/adhoc-meetings-in-person-meetings), [Muesli inspiration](https://github.com/recallai/muesli-public).
+
+## Local end-to-end testing
+
+The local test server runs in Docker as `twenty-app-dev-test` at
+`http://localhost:2021`. Its seeded workspace is **Apple**; both the login email
+and password are `[email protected]`. Seeded meetings are sample data, not a live
+Google or Microsoft calendar connection.
+
+From `packages/twenty-apps/public/companion`:
+
+```sh
+yarn twenty -r companion-local apply
+```
+
+The `companion-local` remote targets port 2021. It is separate from the normal
+local development database. The local server administrator must claim the
+Desktop Recorder registration for Apple so its server webhook can resolve the
+installed function. Configure Recall in that registration's server variables.
+
+In Twenty Settings, disconnect the cloud workspace, enter
+`http://localhost:2021`, and authorize the local Apple workspace. For the first
+live test, complete permission setup, choose **New recording**, speak for about
+20 seconds, then choose **Finish**. Check Recordings and the Call Recordings object in local
+Twenty for processing and transcript arrival. Keep Docker and the webhook
+tunnel running until processing finishes.
+
+The Recall callback uses a temporary Cloudflare tunnel to port 2021 and the
+path `/webhooks/server/2f955a7f-9d03-44c6-bb12-fbc8f6e33b07`. Restarting a quick
+tunnel changes its URL; update the dedicated Recall local-test webhook endpoint
+when that happens. Stop or disable that endpoint when the local test environment
+is retired. Calendar bot testing additionally requires a real connected
+calendar and a meeting you intend to record.
+
+## Renderer messages
+
+The renderer loads its compiled English Lingui catalog once in `src/renderer/main.tsx`.
+Use `i18n._('Message')` where a label is declared; translate each branch of a
+conditional separately so extraction can see every message. Pass translated
+strings into presentation components. Typed recording notices are translated in
+`notice-message.ts`, including named interpolation values.
+
+Run `yarn lingui:extract` after changing copy. Build, preview, and packaging
+commands compile the catalog. English is the only shipping locale for now.
diff --git a/packages/twenty-companion/assets/tray.png b/packages/twenty-companion/assets/tray.png
new file mode 100644
index 00000000000..6e57eb613a5
Binary files /dev/null and b/packages/twenty-companion/assets/tray.png differ
diff --git a/packages/twenty-companion/assets/tray.svg b/packages/twenty-companion/assets/tray.svg
new file mode 100644
index 00000000000..25f1ef3ad63
--- /dev/null
+++ b/packages/twenty-companion/assets/tray.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="16 16 64 64">
+ <path fill="black" d="M 19.25 35.746094 C 19.25 30.5 23.507812 26.246094 28.75 26.246094 L 47.039062 26.246094 C 47.308594 26.246094 47.554688 26.40625 47.667969 26.652344 C 47.78125 26.902344 47.730469 27.191406 47.546875 27.394531 L 43.539062 31.75 C 42.839844 32.507812 41.859375 32.945312 40.828125 32.945312 L 28.800781 32.945312 C 27.226562 32.945312 25.949219 34.222656 25.949219 35.796875 L 25.949219 42.980469 C 25.949219 43.90625 25.199219 44.652344 24.273438 44.652344 L 20.929688 44.652344 C 20.003906 44.652344 19.257812 43.90625 19.257812 42.980469 L 19.257812 35.746094 Z M 19.25 35.746094 "/>
+ <path fill="black" d="M 76.152344 60.253906 C 76.152344 65.5 71.894531 69.753906 66.648438 69.753906 L 58.878906 69.753906 C 53.632812 69.753906 49.375 65.5 49.375 60.253906 L 49.375 46.652344 C 49.375 45.726562 49.722656 44.835938 50.351562 44.152344 L 54.882812 39.234375 C 55.074219 39.027344 55.371094 38.957031 55.636719 39.054688 C 55.898438 39.164062 56.074219 39.410156 56.074219 39.691406 L 56.074219 60.210938 C 56.074219 61.785156 57.351562 63.0625 58.925781 63.0625 L 66.605469 63.0625 C 68.179688 63.0625 69.457031 61.785156 69.457031 60.210938 L 69.457031 35.796875 C 69.457031 34.222656 68.179688 32.945312 66.605469 32.945312 L 57.675781 32.945312 C 56.652344 32.945312 55.679688 33.375 54.980469 34.121094 L 28.347656 63.0625 L 44.351562 63.0625 C 45.273438 63.0625 46.023438 63.8125 46.023438 64.738281 L 46.023438 68.082031 C 46.023438 69.007812 45.273438 69.753906 44.351562 69.753906 L 22.785156 69.753906 C 20.832031 69.753906 19.242188 68.167969 19.242188 66.210938 L 19.242188 64.441406 C 19.242188 63.550781 19.574219 62.695312 20.179688 62.039062 L 50.039062 29.605469 C 52.015625 27.457031 54.789062 26.246094 57.707031 26.246094 L 66.640625 26.246094 C 71.886719 26.246094 76.144531 30.5 76.144531 35.746094 L 76.144531 60.253906 Z M 76.152344 60.253906 "/>
+</svg>
diff --git a/packages/twenty-companion/assets/trayLogo.png b/packages/twenty-companion/assets/trayLogo.png
new file mode 100644
index 00000000000..07293d28926
Binary files /dev/null and b/packages/twenty-companion/assets/trayLogo.png differ
diff --git a/packages/twenty-companion/assets/[email protected] b/packages/twenty-companion/assets/[email protected]
new file mode 100644
index 00000000000..d1da4b7fe73
Binary files /dev/null and b/packages/twenty-companion/assets/[email protected] differ
diff --git a/packages/twenty-companion/assets/twenty.icns b/packages/twenty-companion/assets/twenty.icns
new file mode 100644
index 00000000000..6aba8367000
Binary files /dev/null and b/packages/twenty-companion/assets/twenty.icns differ
diff --git a/packages/twenty-companion/docs/installation.md b/packages/twenty-companion/docs/installation.md
new file mode 100644
index 00000000000..1ac13215c15
--- /dev/null
+++ b/packages/twenty-companion/docs/installation.md
@@ -0,0 +1,26 @@
+# Workspace installation and personal sign-in
+
+1. A workspace administrator installs **Desktop Recorder** in Twenty Settings → Apps and configures its recording provider.
+2. Its Settings tab includes **Download Twenty for macOS**. Members can also find the same read-only instructions in Settings → Desktop app, without application administration permission.
+3. Each member installs **Twenty**, enters their workspace URL, and authorizes the existing Desktop Recorder OAuth client in their browser.
+4. Twenty checks the backend recording configuration before saving the desktop connection. It never creates or installs another application during desktop sign-in.
+
+Desktop authentication is a public OAuth client using loopback redirects and PKCE. Access and refresh tokens retain the authorizing user and workspace identity. Disconnect revokes the personal grant; it does not uninstall the workspace application.
+
+## Download distribution
+
+No desktop installer was found among Twenty's published GitHub releases on 2026-09-08. Do not use an assumed release URL.
+
+Run `yarn package:archive` in `packages/twenty-companion` to create `release/Twenty-0.1.0-macos-arm64.zip` and its SHA-256 checksum. This is a development build. Production distribution still needs Developer ID signing and notarization before uploading to a release host, such as the existing `twentyhq/twenty` GitHub Releases.
+
+Once the verified installer is hosted, set **macOS download URL** (`DESKTOP_DOWNLOAD_URL`) in Desktop Recorder's settings to its HTTPS download URL. An empty or invalid URL disables the download button. The current build supports Apple silicon and macOS 14.2+, not Windows or Intel Macs.
+
+Deploy the updated Twenty server/frontend and sync or upgrade Desktop Recorder before distributing the updated desktop app. Registration creation and manifest updates configure its existing OAuth client as a public native client. Earlier OAuth-only registrations are not deleted automatically; reconnect through the installed integration before an administrator removes obsolete registrations.
+
+## Architecture context
+
+[Martmull app archi, September 8](https://app.fireflies.ai/view/01M20GB6PQH23MN9ZZCRN94Z0K) confirmed one installed app with separate user connections, ownership associated with each workspace member, and a two-user verification. General user-level app settings can follow later.
+
+Linear connection providers authorize Twenty to call an external service. Desktop authorization runs in the other direction: Electron calls Twenty. Reusing the installed app registration avoids empty apps without creating a provider that has no external service to connect to. Provider import loops remain app-specific when integrating external services.
+
+Personal desktop agenda and upload ownership checks do not themselves establish CRM row-level privacy. CRM record visibility follows workspace roles. User/workspace connection visibility must not be presented as a guarantee of private CRM records without explicit row-level permission enforcement and multi-user verification.
diff --git a/packages/twenty-companion/index.html b/packages/twenty-companion/index.html
new file mode 100644
index 00000000000..bd012265528
--- /dev/null
+++ b/packages/twenty-companion/index.html
@@ -0,0 +1,16 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta
+ http-equiv="Content-Security-Policy"
+ content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https: http://localhost:* http://127.0.0.1:*; connect-src 'self' ws://127.0.0.1:4317; object-src 'none'; base-uri 'none'"
+ />
+ <title>Twenty</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="/src/renderer/main.tsx"></script>
+ </body>
+</html>
diff --git a/packages/twenty-companion/lingui.config.ts b/packages/twenty-companion/lingui.config.ts
new file mode 100644
index 00000000000..9e9a68d2baf
--- /dev/null
+++ b/packages/twenty-companion/lingui.config.ts
@@ -0,0 +1,15 @@
+import { defineConfig } from '@lingui/conf';
+
+export default defineConfig({
+ sourceLocale: 'en',
+ locales: ['en'],
+ catalogs: [
+ {
+ path: '<rootDir>/src/renderer/locales/{locale}',
+ include: ['<rootDir>/src/renderer'],
+ exclude: ['**/__tests__/**', '**/locales/**', '**/preview.ts'],
+ },
+ ],
+ format: 'po',
+ compileNamespace: 'ts',
+});
diff --git a/packages/twenty-companion/package.json b/packages/twenty-companion/package.json
new file mode 100644
index 00000000000..e3a3de3c78e
--- /dev/null
+++ b/packages/twenty-companion/package.json
@@ -0,0 +1,58 @@
+{
+ "name": "@twentyhq/companion",
+ "productName": "Twenty",
+ "version": "0.1.0",
+ "private": true,
+ "description": "See upcoming meetings, record calls, and open transcripts and summaries in your Twenty workspace.",
+ "license": "AGPL-3.0",
+ "type": "module",
+ "main": "dist/main.cjs",
+ "packageManager": "[email protected]",
+ "engines": {
+ "node": "^24.5.0"
+ },
+ "scripts": {
+ "dev": "yarn native:setup && yarn lingui:compile && node scripts/dev.mjs",
+ "build": "yarn lingui:compile && node scripts/build.mjs",
+ "start": "yarn native:setup && electron .",
+ "preview": "yarn lingui:compile && vite --host 127.0.0.1 --port 4317",
+ "typecheck": "tsc --noEmit",
+ "test": "vitest run --passWithNoTests",
+ "package": "yarn native:setup && yarn lingui:compile && node scripts/package.mjs",
+ "package:archive": "yarn native:setup && yarn lingui:compile && node scripts/archive.mjs",
+ "lingui:extract": "lingui extract",
+ "lingui:compile": "lingui compile",
+ "native:setup": "node scripts/setup-native.mjs"
+ },
+ "dependencies": {
+ "@base-ui/react": "^1.5.0",
+ "@fontsource/inter": "^5.2.8",
+ "@lingui/core": "5.9.5",
+ "@recallai/desktop-sdk": "2.0.29",
+ "clsx": "^2.1.1",
+ "react": "^19.2.0",
+ "react-dom": "^19.2.0",
+ "twenty-ui": "workspace:*",
+ "zod": "^4.1.0"
+ },
+ "devDependencies": {
+ "@electron/packager": "^19.0.0",
+ "@lingui/cli": "5.9.5",
+ "@lingui/conf": "5.9.5",
+ "@testing-library/dom": "^10.4.1",
+ "@testing-library/react": "^16.3.0",
+ "@testing-library/user-event": "^14.6.1",
+ "@types/node": "^24.7.2",
+ "@types/react": "^19.2.0",
+ "@types/react-dom": "^19.2.0",
+ "electron": "44.1.0",
+ "esbuild": "^0.28.1",
+ "jsdom": "^30.0.1",
+ "monaco-editor": "^0.52.2",
+ "sass": "^1.83.0",
+ "typescript": "^5.9.3",
+ "vite": "^7.3.0",
+ "vite-plugin-svgr": "^4.3.0",
+ "vitest": "^4.1.0"
+ }
+}
diff --git a/packages/twenty-companion/project.json b/packages/twenty-companion/project.json
new file mode 100644
index 00000000000..85554d472d1
--- /dev/null
+++ b/packages/twenty-companion/project.json
@@ -0,0 +1,58 @@
+{
+ "name": "twenty-companion",
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
+ "projectType": "application",
+ "sourceRoot": "packages/twenty-companion/src",
+ "implicitDependencies": ["twenty-ui"],
+ "targets": {
+ "build": {
+ "executor": "nx:run-commands",
+ "cache": true,
+ "dependsOn": [],
+ "options": {
+ "cwd": "packages/twenty-companion",
+ "command": "yarn build"
+ },
+ "inputs": ["default", "^default"],
+ "outputs": ["{projectRoot}/dist"]
+ },
+ "typecheck": {
+ "executor": "nx:run-commands",
+ "cache": true,
+ "dependsOn": [],
+ "options": {
+ "cwd": "packages/twenty-companion",
+ "command": "yarn typecheck"
+ },
+ "inputs": ["default", "^default"]
+ },
+ "test": {
+ "executor": "nx:run-commands",
+ "cache": true,
+ "dependsOn": [],
+ "options": {
+ "cwd": "packages/twenty-companion",
+ "command": "yarn test"
+ },
+ "inputs": ["default", "^default"]
+ },
+ "package": {
+ "executor": "nx:run-commands",
+ "cache": false,
+ "dependsOn": [],
+ "options": {
+ "cwd": "packages/twenty-companion",
+ "command": "yarn package"
+ }
+ },
+ "package:archive": {
+ "executor": "nx:run-commands",
+ "cache": false,
+ "dependsOn": [],
+ "options": {
+ "cwd": "packages/twenty-companion",
+ "command": "yarn package:archive"
+ }
+ }
+ }
+}
diff --git a/packages/twenty-companion/public/images/placeholders/background/no_call_recording_bg.png b/packages/twenty-companion/public/images/placeholders/background/no_call_recording_bg.png
new file mode 100644
index 00000000000..b885ddde4b7
Binary files /dev/null and b/packages/twenty-companion/public/images/placeholders/background/no_call_recording_bg.png differ
diff --git a/packages/twenty-companion/public/images/placeholders/dark-background/no_call_recording_bg.png b/packages/twenty-companion/public/images/placeholders/dark-background/no_call_recording_bg.png
new file mode 100644
index 00000000000..cdf9816224c
Binary files /dev/null and b/packages/twenty-companion/public/images/placeholders/dark-background/no_call_recording_bg.png differ
diff --git a/packages/twenty-companion/public/images/placeholders/dark-moving-image/no_call_recording.png b/packages/twenty-companion/public/images/placeholders/dark-moving-image/no_call_recording.png
new file mode 100644
index 00000000000..3706fb24429
Binary files /dev/null and b/packages/twenty-companion/public/images/placeholders/dark-moving-image/no_call_recording.png differ
diff --git a/packages/twenty-companion/public/images/placeholders/moving-image/no_call_recording.png b/packages/twenty-companion/public/images/placeholders/moving-image/no_call_recording.png
new file mode 100644
index 00000000000..5f1bcfeb478
Binary files /dev/null and b/packages/twenty-companion/public/images/placeholders/moving-image/no_call_recording.png differ
diff --git a/packages/twenty-companion/public/twenty.svg b/packages/twenty-companion/public/twenty.svg
new file mode 100644
index 00000000000..bb5819bc266
--- /dev/null
+++ b/packages/twenty-companion/public/twenty.svg
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96px" height="96px" viewBox="0 0 96 96" version="1.1">
+<defs>
+<clipPath id="clip1">
+ <path d="M 11.292969 0 L 84.707031 0 C 90.945312 0 96 5.054688 96 11.292969 L 96 84.707031 C 96 90.945312 90.945312 96 84.707031 96 L 11.292969 96 C 5.054688 96 0 90.945312 0 84.707031 L 0 11.292969 C 0 5.054688 5.054688 0 11.292969 0 Z M 11.292969 0 "/>
+</clipPath>
+<clipPath id="clip2">
+ <path d="M 19 26 L 48 26 L 48 45 L 19 45 Z M 19 26 "/>
+</clipPath>
+<clipPath id="clip3">
+ <path d="M 11.292969 0 L 84.707031 0 C 90.945312 0 96 5.054688 96 11.292969 L 96 84.707031 C 96 90.945312 90.945312 96 84.707031 96 L 11.292969 96 C 5.054688 96 0 90.945312 0 84.707031 L 0 11.292969 C 0 5.054688 5.054688 0 11.292969 0 Z M 11.292969 0 "/>
+</clipPath>
+<clipPath id="clip4">
+ <path d="M 19 26 L 77 26 L 77 70 L 19 70 Z M 19 26 "/>
+</clipPath>
+<clipPath id="clip5">
+ <path d="M 11.292969 0 L 84.707031 0 C 90.945312 0 96 5.054688 96 11.292969 L 96 84.707031 C 96 90.945312 90.945312 96 84.707031 96 L 11.292969 96 C 5.054688 96 0 90.945312 0 84.707031 L 0 11.292969 C 0 5.054688 5.054688 0 11.292969 0 Z M 11.292969 0 "/>
+</clipPath>
+</defs>
+<g id="surface1">
+<g clip-path="url(#clip1)" clip-rule="nonzero">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 96 0 L 0 0 L 0 96 L 96 96 Z M 19.25 35.746094 C 19.25 30.5 23.507812 26.246094 28.75 26.246094 L 47.039062 26.246094 C 47.308594 26.246094 47.554688 26.40625 47.667969 26.652344 C 47.78125 26.902344 47.730469 27.191406 47.546875 27.394531 L 43.539062 31.75 C 42.839844 32.507812 41.859375 32.945312 40.828125 32.945312 L 28.800781 32.945312 C 27.226562 32.945312 25.949219 34.222656 25.949219 35.796875 L 25.949219 42.980469 C 25.949219 43.90625 25.199219 44.652344 24.273438 44.652344 L 20.929688 44.652344 C 20.003906 44.652344 19.257812 43.90625 19.257812 42.980469 L 19.257812 35.746094 Z M 76.152344 60.253906 C 76.152344 65.5 71.894531 69.753906 66.648438 69.753906 L 58.878906 69.753906 C 53.632812 69.753906 49.375 65.5 49.375 60.253906 L 49.375 46.652344 C 49.375 45.726562 49.722656 44.835938 50.351562 44.152344 L 54.882812 39.234375 C 55.074219 39.027344 55.371094 38.957031 55.636719 39.054688 C 55.898438 39.164062 56.074219 39.410156 56.074219 39.691406 L 56.074219 60.210938 C 56.074219 61.785156 57.351562 63.0625 58.925781 63.0625 L 66.605469 63.0625 C 68.179688 63.0625 69.457031 61.785156 69.457031 60.210938 L 69.457031 35.796875 C 69.457031 34.222656 68.179688 32.945312 66.605469 32.945312 L 57.675781 32.945312 C 56.652344 32.945312 55.679688 33.375 54.980469 34.121094 L 28.347656 63.0625 L 44.351562 63.0625 C 45.273438 63.0625 46.023438 63.8125 46.023438 64.738281 L 46.023438 68.082031 C 46.023438 69.007812 45.273438 69.753906 44.351562 69.753906 L 22.785156 69.753906 C 20.832031 69.753906 19.242188 68.167969 19.242188 66.210938 L 19.242188 64.441406 C 19.242188 63.550781 19.574219 62.695312 20.179688 62.039062 L 50.039062 29.605469 C 52.015625 27.457031 54.789062 26.246094 57.707031 26.246094 L 66.640625 26.246094 C 71.886719 26.246094 76.144531 30.5 76.144531 35.746094 L 76.144531 60.253906 Z M 76.152344 60.253906 "/>
+</g>
+<g clip-path="url(#clip2)" clip-rule="nonzero">
+<g clip-path="url(#clip3)" clip-rule="nonzero">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 19.25 35.746094 C 19.25 30.5 23.507812 26.246094 28.75 26.246094 L 47.039062 26.246094 C 47.308594 26.246094 47.554688 26.40625 47.667969 26.652344 C 47.78125 26.902344 47.730469 27.191406 47.546875 27.394531 L 43.539062 31.75 C 42.839844 32.507812 41.859375 32.945312 40.828125 32.945312 L 28.800781 32.945312 C 27.226562 32.945312 25.949219 34.222656 25.949219 35.796875 L 25.949219 42.980469 C 25.949219 43.90625 25.199219 44.652344 24.273438 44.652344 L 20.929688 44.652344 C 20.003906 44.652344 19.257812 43.90625 19.257812 42.980469 L 19.257812 35.746094 Z M 19.25 35.746094 "/>
+</g>
+</g>
+<g clip-path="url(#clip4)" clip-rule="nonzero">
+<g clip-path="url(#clip5)" clip-rule="nonzero">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 76.152344 60.253906 C 76.152344 65.5 71.894531 69.753906 66.648438 69.753906 L 58.878906 69.753906 C 53.632812 69.753906 49.375 65.5 49.375 60.253906 L 49.375 46.652344 C 49.375 45.726562 49.722656 44.835938 50.351562 44.152344 L 54.882812 39.234375 C 55.074219 39.027344 55.371094 38.957031 55.636719 39.054688 C 55.898438 39.164062 56.074219 39.410156 56.074219 39.691406 L 56.074219 60.210938 C 56.074219 61.785156 57.351562 63.0625 58.925781 63.0625 L 66.605469 63.0625 C 68.179688 63.0625 69.457031 61.785156 69.457031 60.210938 L 69.457031 35.796875 C 69.457031 34.222656 68.179688 32.945312 66.605469 32.945312 L 57.675781 32.945312 C 56.652344 32.945312 55.679688 33.375 54.980469 34.121094 L 28.347656 63.0625 L 44.351562 63.0625 C 45.273438 63.0625 46.023438 63.8125 46.023438 64.738281 L 46.023438 68.082031 C 46.023438 69.007812 45.273438 69.753906 44.351562 69.753906 L 22.785156 69.753906 C 20.832031 69.753906 19.242188 68.167969 19.242188 66.210938 L 19.242188 64.441406 C 19.242188 63.550781 19.574219 62.695312 20.179688 62.039062 L 50.039062 29.605469 C 52.015625 27.457031 54.789062 26.246094 57.707031 26.246094 L 66.640625 26.246094 C 71.886719 26.246094 76.144531 30.5 76.144531 35.746094 L 76.144531 60.253906 Z M 76.152344 60.253906 "/>
+</g>
+</g>
+</g>
+</svg>
diff --git a/packages/twenty-companion/scripts/archive.mjs b/packages/twenty-companion/scripts/archive.mjs
new file mode 100644
index 00000000000..32a0c588728
--- /dev/null
+++ b/packages/twenty-companion/scripts/archive.mjs
@@ -0,0 +1,27 @@
+import { execFileSync } from 'node:child_process';
+import { createHash } from 'node:crypto';
+import { createReadStream } from 'node:fs';
+import { readFile, writeFile } from 'node:fs/promises';
+import { basename, resolve } from 'node:path';
+import './package.mjs';
+
+const { version } = JSON.parse(await readFile('package.json', 'utf8'));
+const outputDirectory = resolve(
+ process.env.TWENTY_COMPANION_OUTPUT_DIR ?? 'release',
+);
+const archive = resolve(outputDirectory, `Twenty-${version}-macos-arm64.zip`);
+execFileSync('ditto', [
+ '-c',
+ '-k',
+ '--sequesterRsrc',
+ '--keepParent',
+ resolve(outputDirectory, 'Twenty-darwin-arm64/Twenty.app'),
+ archive,
+]);
+const checksum = createHash('sha256');
+for await (const chunk of createReadStream(archive)) checksum.update(chunk);
+await writeFile(
+ `${archive}.sha256`,
+ `${checksum.digest('hex')} ${basename(archive)}\n`,
+);
+console.log(archive);
diff --git a/packages/twenty-companion/scripts/build.mjs b/packages/twenty-companion/scripts/build.mjs
new file mode 100644
index 00000000000..a7b6bc790fc
--- /dev/null
+++ b/packages/twenty-companion/scripts/build.mjs
@@ -0,0 +1,6 @@
+import { build } from 'esbuild';
+import { build as buildRenderer } from 'vite';
+import { electronBuildOptions } from './electron-build.mjs';
+
+await build(electronBuildOptions);
+await buildRenderer();
diff --git a/packages/twenty-companion/scripts/dev.mjs b/packages/twenty-companion/scripts/dev.mjs
new file mode 100644
index 00000000000..75bbbe241ee
--- /dev/null
+++ b/packages/twenty-companion/scripts/dev.mjs
@@ -0,0 +1,97 @@
+import { spawn } from 'node:child_process';
+import { mkdir, writeFile } from 'node:fs/promises';
+import { dirname } from 'node:path';
+import { createServer } from 'vite';
+import { context } from 'esbuild';
+import electron from 'electron';
+import { electronBuildOptions } from './electron-build.mjs';
+
+const server = await createServer();
+let watcher;
+let child;
+let stopping = false;
+let building = false;
+let launchPending = false;
+
+const stop = async (code = 0) => {
+ if (stopping) return;
+ stopping = true;
+ child?.kill('SIGTERM');
+ await watcher?.dispose();
+ await server.close();
+ process.exit(code);
+};
+
+const launch = () => {
+ if (building) {
+ launchPending = true;
+ return;
+ }
+ launchPending = false;
+ let restarting = false;
+ child = spawn(electron, ['.'], {
+ stdio: ['inherit', 'inherit', 'inherit', 'ipc'],
+ env: { ...process.env, TWENTY_COMPANION_DEV_URL: 'http://127.0.0.1:4317' },
+ });
+ child.on('message', (message) => {
+ if (message?.type === 'development-restarting') restarting = true;
+ });
+ child.on('error', (error) => {
+ console.error('Could not launch Electron.', error);
+ void stop(1);
+ });
+ child.on('exit', (code) => {
+ child = undefined;
+ if (stopping) return;
+ if (restarting && code === 0) launch();
+ else void stop(code ?? 1);
+ });
+};
+
+try {
+ await server.listen();
+ watcher = await context({
+ ...electronBuildOptions,
+ // A failed compilation must not replace either half of the working Electron build.
+ write: false,
+ plugins: [
+ {
+ name: 'restart-electron',
+ setup(build) {
+ build.onStart(() => {
+ building = true;
+ });
+ build.onEnd(async (result) => {
+ try {
+ if (stopping || result.errors.length) return;
+ for (const output of result.outputFiles) {
+ await mkdir(dirname(output.path), { recursive: true });
+ await writeFile(output.path, output.contents);
+ }
+ if (stopping) return;
+ if (!child) launch();
+ else if (child.connected) {
+ console.log(
+ 'Electron rebuilt; restart will wait for recording to finish.',
+ );
+ child.send({ type: 'development-restart' }, (error) => {
+ if (error && child?.connected)
+ console.error('Could not request restart.', error);
+ });
+ }
+ } finally {
+ building = false;
+ if (!stopping && launchPending) launch();
+ }
+ });
+ },
+ },
+ ],
+ });
+ await watcher.watch();
+} catch (error) {
+ console.error(error);
+ await stop(1);
+}
+process.on('SIGINT', () => void stop());
+process.on('SIGTERM', () => void stop());
diff --git a/packages/twenty-companion/scripts/electron-build.mjs b/packages/twenty-companion/scripts/electron-build.mjs
new file mode 100644
index 00000000000..061a6327496
--- /dev/null
+++ b/packages/twenty-companion/scripts/electron-build.mjs
@@ -0,0 +1,11 @@
+export const electronBuildOptions = {
+ entryPoints: { main: 'src/main/main.ts', preload: 'src/main/preload.ts' },
+ bundle: true,
+ platform: 'node',
+ target: 'node22',
+ format: 'cjs',
+ outdir: 'dist',
+ outExtension: { '.js': '.cjs' },
+ external: ['electron', '@recallai/desktop-sdk'],
+ sourcemap: true,
+};
diff --git a/packages/twenty-companion/scripts/package.mjs b/packages/twenty-companion/scripts/package.mjs
new file mode 100644
index 00000000000..7f7b17203d2
--- /dev/null
+++ b/packages/twenty-companion/scripts/package.mjs
@@ -0,0 +1,92 @@
+import { packager } from '@electron/packager';
+import { access, cp, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
+import { createRequire } from 'node:module';
+import { tmpdir } from 'node:os';
+import { dirname, join, resolve } from 'node:path';
+import './build.mjs';
+
+const manifest = JSON.parse(await readFile('package.json', 'utf8'));
+const stagingDirectory = await mkdtemp(
+ join(tmpdir(), 'twenty-desktop-package-'),
+);
+
+// Resolve each dependency from its owner so hoisting cannot change the packaged runtime.
+const copyRuntimeDependency = async (name, ownerManifest, destination) => {
+ const manifestPath = createRequire(ownerManifest).resolve(
+ `${name}/package.json`,
+ );
+ const dependency = JSON.parse(await readFile(manifestPath, 'utf8'));
+ const target = join(destination, 'node_modules', name);
+ await cp(dirname(manifestPath), target, {
+ recursive: true,
+ verbatimSymlinks: true,
+ filter: (source) => source !== join(dirname(manifestPath), 'node_modules'),
+ });
+ for (const child of Object.keys(dependency.dependencies ?? {}))
+ await copyRuntimeDependency(child, manifestPath, target);
+};
+
+try {
+ await cp('dist', join(stagingDirectory, 'dist'), { recursive: true });
+ await cp('assets', join(stagingDirectory, 'assets'), { recursive: true });
+ await writeFile(
+ join(stagingDirectory, 'package.json'),
+ JSON.stringify(
+ {
+ name: manifest.name,
+ productName: manifest.productName,
+ version: manifest.version,
+ description: manifest.description,
+ license: manifest.license,
+ main: manifest.main,
+ dependencies: {
+ '@recallai/desktop-sdk':
+ manifest.dependencies['@recallai/desktop-sdk'],
+ },
+ },
+ null,
+ 2,
+ ),
+ );
+ await copyRuntimeDependency(
+ '@recallai/desktop-sdk',
+ resolve('package.json'),
+ stagingDirectory,
+ );
+ const paths = await packager({
+ dir: stagingDirectory,
+ out: process.env.TWENTY_COMPANION_OUTPUT_DIR ?? 'release',
+ name: 'Twenty',
+ executableName: 'Twenty',
+ appBundleId: 'com.twenty.companion',
+ icon: join(process.cwd(), 'assets/twenty.icns'),
+ platform: 'darwin',
+ electronVersion: manifest.devDependencies.electron,
+ arch: 'arm64',
+ overwrite: true,
+ prune: false,
+ electronZipDir: process.env.TWENTY_COMPANION_ELECTRON_ZIP_DIR,
+ // Recall launches its native framework by path outside the Electron archive.
+ asar: { unpackDir: 'node_modules/@recallai/desktop-sdk' },
+ extendInfo: {
+ LSUIElement: false,
+ LSMinimumSystemVersion: '14.2',
+ NSMicrophoneUsageDescription:
+ 'Twenty records your voice during calls you choose to capture.',
+ NSAudioCaptureUsageDescription:
+ 'Twenty records call audio so it can be saved to your Twenty workspace.',
+ NSAccessibilityUsageDescription:
+ 'Twenty detects meetings and shows recording controls.',
+ },
+ });
+ for (const directory of paths)
+ await access(
+ join(
+ directory,
+ 'Twenty.app/Contents/Resources/app.asar.unpacked/node_modules/@recallai/desktop-sdk/desktop_sdk_macos_exe',
+ ),
+ );
+ console.log(paths.join('\n'));
+} finally {
+ await rm(stagingDirectory, { recursive: true, force: true });
+}
diff --git a/packages/twenty-companion/scripts/setup-native.mjs b/packages/twenty-companion/scripts/setup-native.mjs
new file mode 100644
index 00000000000..d82506eda8f
--- /dev/null
+++ b/packages/twenty-companion/scripts/setup-native.mjs
@@ -0,0 +1,27 @@
+import { access } from 'node:fs/promises';
+import { createRequire } from 'node:module';
+import { dirname, join } from 'node:path';
+import { execFileSync } from 'node:child_process';
+
+if (process.platform !== 'darwin' || process.arch !== 'arm64')
+ throw new Error('Desktop launch and packaging require an Apple Silicon Mac.');
+
+const require = createRequire(import.meta.url);
+for (const [name, artifact, installer] of [
+ ['electron', 'dist/Electron.app/Contents/MacOS/Electron', 'install.js'],
+ ['@recallai/desktop-sdk', 'desktop_sdk_macos_exe', 'setup.js'],
+]) {
+ const directory = dirname(require.resolve(`${name}/package.json`));
+ const artifactPath = join(directory, artifact);
+ try {
+ await access(artifactPath);
+ continue;
+ } catch (error) {
+ if (error.code !== 'ENOENT') throw error;
+ }
+ execFileSync(process.execPath, [join(directory, installer)], {
+ cwd: directory,
+ stdio: 'inherit',
+ });
+ await access(artifactPath);
+}
diff --git a/packages/twenty-companion/src/main/errors/DesktopRecorderUnavailableError.ts b/packages/twenty-companion/src/main/errors/DesktopRecorderUnavailableError.ts
new file mode 100644
index 00000000000..c66978dc1ca
--- /dev/null
+++ b/packages/twenty-companion/src/main/errors/DesktopRecorderUnavailableError.ts
@@ -0,0 +1,8 @@
+export class DesktopRecorderUnavailableError extends Error {
+ constructor(readonly serverUrl: string) {
+ super(
+ 'Desktop Recorder is unavailable in this workspace. Install it to continue.',
+ );
+ this.name = 'DesktopRecorderUnavailableError';
+ }
+}
diff --git a/packages/twenty-companion/src/main/errors/SettingsRecoveryError.ts b/packages/twenty-companion/src/main/errors/SettingsRecoveryError.ts
new file mode 100644
index 00000000000..0efd40b5415
--- /dev/null
+++ b/packages/twenty-companion/src/main/errors/SettingsRecoveryError.ts
@@ -0,0 +1,10 @@
+import { type Settings } from '../../shared/types/Settings';
+
+export class SettingsRecoveryError extends Error {
+ constructor(
+ readonly settings: Settings,
+ message: string,
+ ) {
+ super(message);
+ }
+}
diff --git a/packages/twenty-companion/src/main/errors/TwentyRequestError.ts b/packages/twenty-companion/src/main/errors/TwentyRequestError.ts
new file mode 100644
index 00000000000..309b2514461
--- /dev/null
+++ b/packages/twenty-companion/src/main/errors/TwentyRequestError.ts
@@ -0,0 +1,11 @@
+export class TwentyRequestError extends Error {
+ constructor(
+ readonly status: number,
+ url: string,
+ ) {
+ super(
+ `Twenty returned ${status} for ${new URL(url).pathname}. ${status === 401 ? 'Reconnect your workspace.' : 'Please try again.'}`,
+ );
+ this.name = 'TwentyRequestError';
+ }
+}
diff --git a/packages/twenty-companion/src/main/main.ts b/packages/twenty-companion/src/main/main.ts
new file mode 100644
index 00000000000..48965959b3f
--- /dev/null
+++ b/packages/twenty-companion/src/main/main.ts
@@ -0,0 +1,404 @@
+import { mkdtempSync, rmSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { pathToFileURL } from 'node:url';
+import { join } from 'node:path';
+import RecallAiSdk from '@recallai/desktop-sdk';
+import {
+ app,
+ BrowserWindow,
+ Tray,
+ nativeImage,
+ globalShortcut,
+ Menu,
+ powerMonitor,
+ dialog,
+ ipcMain,
+} from 'electron';
+import { getUpcomingMeetings } from '../shared/utils/getUpcomingMeetings';
+import { Companion } from './services/Companion';
+import { createDevelopmentRestart } from './utils/createDevelopmentRestart';
+import { createTrayMenuTemplate } from './utils/createTrayMenuTemplate';
+import { getTrayTitle } from './utils/getTrayTitle';
+import { commandSchema } from '../shared/validation-schemas/commandSchema';
+import { type CompanionPage } from '../shared/types/CompanionPage';
+
+let mainWindow: BrowserWindow;
+let tray: Tray;
+let trayMenu: Menu;
+let trayMenuSignature = '';
+let trayMenuOpen = false;
+let companion: Companion;
+let quitting = false;
+let shutdownPending = false;
+let initialized = false;
+const SMOKE = process.argv.includes('--smoke');
+const OPEN_IN_BACKGROUND = process.argv.includes('--background');
+const DEVELOPMENT_URL = process.env.TWENTY_COMPANION_DEV_URL;
+const RENDERER_PATH = join(__dirname, 'renderer/index.html');
+const rendererReady = new Set<number>();
+let pendingPage: CompanionPage | undefined;
+const [MACOS_MAJOR, MACOS_MINOR] =
+ process.platform === 'darwin'
+ ? process.getSystemVersion().split('.').map(Number)
+ : [0, 0];
+const MENU_PRESENTATION = {
+ supportsHeaders: MACOS_MAJOR >= 14,
+ supportsSublabels:
+ MACOS_MAJOR > 14 || (MACOS_MAJOR === 14 && MACOS_MINOR >= 4),
+};
+
+const showApp = (page?: CompanionPage) => {
+ if (quitting || !mainWindow || mainWindow.isDestroyed()) return;
+ if (mainWindow.isMinimized()) mainWindow.restore();
+ mainWindow.show();
+ mainWindow.focus();
+ if (page) {
+ if (rendererReady.has(mainWindow.webContents.id))
+ mainWindow.webContents.send('companion:navigate', page);
+ else pendingPage = page;
+ }
+};
+
+const runCommand = async (command: unknown) => {
+ const parsed = commandSchema.parse(command);
+ if (parsed.type === 'open-app') {
+ showApp(parsed.page);
+ return;
+ }
+ await companion.command(parsed);
+ if (
+ companion.state.error ||
+ (parsed.type === 'record' && companion.state.activeRecording)
+ )
+ showApp();
+};
+
+const updateTrayMenu = () => {
+ if (!companion || quitting || tray.isDestroyed() || trayMenuOpen) return;
+ const template = createTrayMenuTemplate(
+ companion.state,
+ {
+ command: (command) => void runCommand(command),
+ openApp: showApp,
+ setSetting: (key, value) =>
+ void runCommand({
+ type: 'settings',
+ settings: { [key]: value },
+ }),
+ quit: () => app.quit(),
+ },
+ Date.now(),
+ { ...MENU_PRESENTATION, locale: app.getLocale() },
+ );
+ const signature = JSON.stringify({
+ template,
+ meetingIds: companion.state.meetings.map((meeting) => meeting.id),
+ recordingId: companion.state.activeRecording?.id,
+ });
+ if (signature === trayMenuSignature) return;
+ trayMenuSignature = signature;
+ trayMenu = Menu.buildFromTemplate(template);
+ // Replacing a menu during keyboard navigation would move the user's selection.
+ trayMenu.on('menu-will-show', () => {
+ trayMenuOpen = true;
+ });
+ trayMenu.on('menu-will-close', () => {
+ trayMenuOpen = false;
+ setImmediate(updateTrayMenu);
+ });
+ tray.setContextMenu(trayMenu);
+};
+
+const assertSender = (event: Electron.IpcMainInvokeEvent) => {
+ const url = event.senderFrame?.url;
+ const expected = DEVELOPMENT_URL
+ ? new URL(DEVELOPMENT_URL).origin
+ : pathToFileURL(RENDERER_PATH).href;
+ if (
+ event.senderFrame !== event.sender.mainFrame ||
+ event.sender !== mainWindow.webContents ||
+ !url ||
+ (DEVELOPMENT_URL
+ ? new URL(url).origin !== expected
+ : url.split('#')[0] !== expected)
+ )
+ throw new Error('Untrusted companion window.');
+};
+
+// Keep existing connections and settings when the visible app name changes.
+if (!SMOKE)
+ app.setPath('userData', join(app.getPath('appData'), 'Twenty Companion'));
+
+if (!app.requestSingleInstanceLock()) app.quit();
+else {
+ // Electron binds macOS encryption to this name before ready.
+ app.setName('Twenty Companion');
+ if (SMOKE) {
+ const directory = mkdtempSync(join(tmpdir(), 'twenty-companion-smoke-'));
+ app.setPath('userData', directory);
+ app.on('quit', () => {
+ try {
+ // Chromium can finish writing its cache while the smoke app exits.
+ rmSync(directory, { recursive: true, force: true, maxRetries: 3 });
+ } catch {
+ console.warn(
+ 'Smoke cache cleanup deferred to the system temporary directory.',
+ );
+ }
+ });
+ }
+ app.on('second-instance', () => showApp());
+ app.on('activate', () => showApp());
+ void app
+ .whenReady()
+ .then(async () => {
+ app.setName('Twenty');
+ await app.dock?.show();
+ const webPreferences = {
+ preload: join(__dirname, 'preload.cjs'),
+ contextIsolation: true,
+ nodeIntegration: false,
+ sandbox: true,
+ };
+ mainWindow = new BrowserWindow({
+ width: 1040,
+ height: 740,
+ minWidth: 760,
+ minHeight: 580,
+ show: false,
+ title: 'Twenty',
+ titleBarStyle:
+ process.platform === 'darwin' ? 'hiddenInset' : 'default',
+ trafficLightPosition: { x: 18, y: 25 },
+ backgroundColor: '#171717',
+ webPreferences,
+ });
+ mainWindow.webContents.on('did-start-loading', () =>
+ rendererReady.delete(mainWindow.webContents.id),
+ );
+ mainWindow.webContents.setWindowOpenHandler(() => ({ action: 'deny' }));
+ mainWindow.webContents.on('will-navigate', (event) =>
+ event.preventDefault(),
+ );
+ mainWindow.on('focus', () => companion?.refreshPermissions());
+ mainWindow.on('close', (event) => {
+ if (!quitting) {
+ event.preventDefault();
+ mainWindow.hide();
+ }
+ });
+ const trayImage = nativeImage.createFromPath(
+ join(__dirname, '../assets/trayLogo.png'),
+ );
+ if (trayImage.isEmpty()) throw new Error('The menu bar icon is missing.');
+ if (process.platform === 'darwin') trayImage.setTemplateImage(true);
+ tray = new Tray(trayImage, '8fd0b192-e117-4987-8b6f-98ef6f6f0c35');
+ tray.setToolTip('Twenty');
+ if (process.platform === 'win32')
+ tray.on('click', () => tray.popUpContextMenu());
+ const updateApplicationMenu = (shortcut: string) =>
+ Menu.setApplicationMenu(
+ Menu.buildFromTemplate([
+ ...(process.platform === 'darwin'
+ ? [{ role: 'appMenu' as const }]
+ : []),
+ {
+ label: 'File',
+ submenu: [
+ {
+ id: 'open-companion',
+ label: 'Open app',
+ accelerator: shortcut,
+ click: () => showApp(),
+ },
+ {
+ label: 'Meeting menu',
+ accelerator: 'CommandOrControl+Shift+M',
+ click: () => {
+ updateTrayMenu();
+ tray.popUpContextMenu();
+ },
+ },
+ {
+ label: 'Settings…',
+ accelerator: 'CommandOrControl+,',
+ click: () => showApp('settings'),
+ },
+ { type: 'separator' },
+ { role: 'close' },
+ ],
+ },
+ { role: 'editMenu' },
+ { role: 'viewMenu' },
+ { role: 'windowMenu' },
+ ]),
+ );
+ updateApplicationMenu('CommandOrControl+Shift+Space');
+ let registeredOpenShortcut: string | undefined;
+ companion = new Companion(
+ (state) => {
+ if (!mainWindow.webContents.isDestroyed())
+ mainWindow.webContents.send('companion:state', state);
+ updateTrayMenu();
+ const next = getUpcomingMeetings({
+ meetings: state.meetings,
+ now: Date.now(),
+ })[0];
+ const recording = state.activeRecording;
+ tray.setTitle(getTrayTitle(state));
+ tray.setToolTip(
+ recording
+ ? (recording.status === 'paused' ? 'Paused' : 'Recording') +
+ ' · ' +
+ recording.title
+ : next
+ ? 'Twenty · ' + next.title
+ : 'Twenty',
+ );
+ },
+ () => showApp(),
+ (shortcut) => {
+ if (shortcut === registeredOpenShortcut) return;
+ let registered = false;
+ try {
+ registered = globalShortcut.register(shortcut, () => showApp());
+ } catch {
+ throw new Error(
+ 'This shortcut is invalid. Choose another key combination.',
+ );
+ }
+ if (!registered)
+ throw new Error(
+ 'This shortcut is already in use. Choose another key combination.',
+ );
+ try {
+ // Electron accelerators are immutable after menu construction.
+ updateApplicationMenu(shortcut);
+ } catch (error) {
+ globalShortcut.unregister(shortcut);
+ throw error;
+ }
+ if (registeredOpenShortcut)
+ globalShortcut.unregister(registeredOpenShortcut);
+ registeredOpenShortcut = shortcut;
+ },
+ );
+ updateTrayMenu();
+ ipcMain.handle('companion:state', (event) => {
+ assertSender(event);
+ rendererReady.add(event.sender.id);
+ if (pendingPage) {
+ event.sender.send('companion:navigate', pendingPage);
+ pendingPage = undefined;
+ }
+ return companion.state;
+ });
+ ipcMain.handle('companion:command', async (event, value: unknown) => {
+ assertSender(event);
+ await runCommand(value);
+ });
+ if (DEVELOPMENT_URL) {
+ if (new URL(DEVELOPMENT_URL).origin !== 'http://127.0.0.1:4317')
+ throw new Error('Unexpected development server.');
+ await mainWindow.loadURL(DEVELOPMENT_URL);
+ } else {
+ await mainWindow.loadFile(RENDERER_PATH);
+ }
+ powerMonitor.on(
+ 'resume',
+ () => void companion.command({ type: 'refresh' }),
+ );
+ await companion.initialize();
+ initialized = true;
+ if (SMOKE) {
+ await RecallAiSdk.init({
+ apiUrl: 'https://eu-central-1.recall.ai',
+ acquirePermissionsOnStartup: [],
+ });
+ await RecallAiSdk.shutdown();
+ if (
+ rendererReady.size !== 1 ||
+ BrowserWindow.getAllWindows().length !== 1 ||
+ !trayMenu?.items.length
+ )
+ throw new Error(
+ 'The main window must establish secure IPC and the native tray menu must be ready.',
+ );
+ console.log(
+ 'Companion smoke passed: one main window, native tray menu, secure IPC, native Recall SDK.',
+ );
+ await companion.shutdown();
+ quitting = true;
+ setImmediate(() => app.quit());
+ return;
+ }
+ if (!OPEN_IN_BACKGROUND && !app.getLoginItemSettings().wasOpenedAtLogin)
+ showApp();
+ })
+ .catch((error: unknown) => {
+ if (SMOKE) {
+ console.error('Companion smoke failed:', error);
+ app.exit(1);
+ return;
+ }
+ dialog.showErrorBox(
+ 'Twenty could not start',
+ error instanceof Error
+ ? error.message
+ : 'Restart the app to try again.',
+ );
+ quitting = true;
+ app.quit();
+ });
+ if (DEVELOPMENT_URL && process.send) {
+ const developmentRestart = createDevelopmentRestart(
+ () => !initialized || shutdownPending || companion.isRecording,
+ () => {
+ process.send?.({ type: 'development-restarting' });
+ app.quit();
+ },
+ );
+ process.on('message', (message) => {
+ if (
+ typeof message === 'object' &&
+ message !== null &&
+ 'type' in message &&
+ message.type === 'development-restart'
+ )
+ developmentRestart.request();
+ });
+ app.on('quit', developmentRestart.dispose);
+ }
+ app.on('before-quit', (event) => {
+ if (quitting) return;
+ event.preventDefault();
+ if (shutdownPending) return;
+ shutdownPending = true;
+ void (async () => {
+ try {
+ if (companion?.state.activeRecording) {
+ const { response } = await dialog.showMessageBox(mainWindow, {
+ type: 'question',
+ message: 'Stop recording and quit?',
+ detail: 'The recording will finish processing in Twenty.',
+ buttons: ['Keep recording', 'Stop and quit'],
+ cancelId: 0,
+ defaultId: 0,
+ });
+ if (response === 0) return;
+ }
+ await companion?.shutdown();
+ quitting = true;
+ globalShortcut.unregisterAll();
+ setImmediate(() => app.quit());
+ } catch (error) {
+ dialog.showErrorBox(
+ 'Twenty could not finish quitting',
+ error instanceof Error ? error.message : 'Try quitting again.',
+ );
+ } finally {
+ shutdownPending = false;
+ }
+ })();
+ });
+}
diff --git a/packages/twenty-companion/src/main/preload.ts b/packages/twenty-companion/src/main/preload.ts
new file mode 100644
index 00000000000..f994e3c09d0
--- /dev/null
+++ b/packages/twenty-companion/src/main/preload.ts
@@ -0,0 +1,26 @@
+import { contextBridge, ipcRenderer } from 'electron';
+import { type CompanionBridge } from '../shared/types/CompanionBridge';
+import { type CompanionState } from '../shared/types/CompanionState';
+import { type CompanionPage } from '../shared/types/CompanionPage';
+
+const bridge: CompanionBridge = {
+ getState: () => ipcRenderer.invoke('companion:state'),
+ command: (command) => ipcRenderer.invoke('companion:command', command),
+ onState: (listener) => {
+ const handler = (
+ _event: Electron.IpcRendererEvent,
+ state: CompanionState,
+ ) => listener(state);
+ ipcRenderer.on('companion:state', handler);
+ return () => {
+ ipcRenderer.removeListener('companion:state', handler);
+ };
+ },
+ onNavigate: (listener) => {
+ const handler = (_event: Electron.IpcRendererEvent, page: CompanionPage) =>
+ listener(page);
+ ipcRenderer.on('companion:navigate', handler);
+ return () => ipcRenderer.removeListener('companion:navigate', handler);
+ },
+};
+contextBridge.exposeInMainWorld('companion', bridge);
diff --git a/packages/twenty-companion/src/main/services/Companion.ts b/packages/twenty-companion/src/main/services/Companion.ts
new file mode 100644
index 00000000000..944a748d7eb
--- /dev/null
+++ b/packages/twenty-companion/src/main/services/Companion.ts
@@ -0,0 +1,508 @@
+import { SettingsRecoveryError } from '../errors/SettingsRecoveryError';
+import { app, shell, Notification, nativeTheme } from 'electron';
+import { type Agenda } from '../../shared/types/Agenda';
+import { type Settings } from '../../shared/types/Settings';
+import { type CompanionCommand } from '../../shared/types/CompanionCommand';
+import { type CompanionState } from '../../shared/types/CompanionState';
+import { getDueMeetings } from '../../shared/utils/getDueMeetings';
+import { getMeetingUrl } from '../../shared/utils/getMeetingUrl';
+import { getMeetingOccurrenceKey } from '../../shared/utils/getMeetingOccurrenceKey';
+import { createInitialState } from '../../shared/utils/createInitialState';
+import { connectOAuth } from '../utils/connectOAuth';
+import { getDesktopInstallationUrl } from '../utils/getDesktopInstallationUrl';
+import { DesktopRecorderUnavailableError } from '../errors/DesktopRecorderUnavailableError';
+import { SecureStore } from './SecureStore';
+import { TwentyClient } from './TwentyClient';
+import { RecordingController } from './RecordingController';
+
+export class Companion {
+ state = createInitialState();
+ private store = new SecureStore(app.getPath('userData'));
+ private client = new TwentyClient(this.store);
+ private handledIds = new Set<string>();
+ private refreshing = false;
+ private connectionVersion = 0;
+ private changingConnection = false;
+ private connectionAbort: AbortController | null = null;
+ private stopped = false;
+ private settingsUpdate: Promise<void> = Promise.resolve();
+ private syncingTimer?: NodeJS.Timeout;
+ private joiningTimer?: NodeJS.Timeout;
+ private joiningMeetings = new Set<string>();
+ private recording = new RecordingController(this.state, this.client, {
+ emit: () => this.emit(),
+ openApp: () => this.openApp(),
+ notify: (title, body) => this.notify(title, body),
+ fail: (error) => this.fail(error),
+ refresh: () => this.refresh(),
+ canRecord: () => !this.stopped && !this.changingConnection,
+ isStopping: () => this.stopped,
+ });
+
+ constructor(
+ private publish: (state: CompanionState) => void,
+ private openApp: () => void = () => undefined,
+ private registerOpenShortcut: (shortcut: string) => void = () => undefined,
+ ) {}
+
+ async initialize(): Promise<void> {
+ if (this.recording.listening) return;
+ this.stopped = false;
+ this.recording.listenToRecording();
+ let settingsError: unknown;
+ try {
+ this.state.settings = await this.store.readSettings();
+ } catch (error) {
+ if (error instanceof SettingsRecoveryError)
+ this.state.settings = error.settings;
+ else
+ this.state.settings = {
+ ...this.state.settings,
+ autoJoin: false,
+ autoRecord: false,
+ };
+ settingsError = error;
+ }
+ try {
+ this.registerOpenShortcut(this.state.settings.openShortcut);
+ } catch (error) {
+ this.fail(error);
+ }
+ nativeTheme.themeSource = this.state.settings.appearance;
+ try {
+ this.handledIds = new Set(await this.store.readHandledMeetings());
+ } catch (error) {
+ this.state.settings.autoJoin = false;
+ settingsError = error;
+ }
+ try {
+ const credentials = await this.client.restore();
+ if (credentials) {
+ this.state.serverUrl = credentials.serverUrl;
+ this.state.connection = 'connected';
+ await this.refresh();
+ }
+ } catch (error) {
+ this.fail(error);
+ }
+ if (settingsError) this.fail(settingsError);
+ if (!this.stopped) this.startTimers();
+ this.emit();
+ }
+
+ private startTimers(): void {
+ this.syncingTimer = setInterval(
+ () => void this.refresh().catch((error) => this.fail(error)),
+ 30_000,
+ );
+ this.joiningTimer = setInterval(
+ () => void this.tick().catch((error) => this.fail(error)),
+ 1000,
+ );
+ this.emit();
+ }
+
+ async command(command: CompanionCommand): Promise<void> {
+ if (this.stopped) return;
+ try {
+ this.state.error = null;
+ switch (command.type) {
+ case 'cancel-connect':
+ this.connectionAbort?.abort();
+ break;
+ case 'connect': {
+ if (this.changingConnection || this.recording.isRecording) return;
+ this.changingConnection = true;
+ const previousConnection = this.state.connection;
+ let credentialsSaved = false;
+ const connectionAbort = new AbortController();
+ this.connectionAbort = connectionAbort;
+ try {
+ this.state.connection = 'connecting';
+ this.emit();
+ const credentials = await connectOAuth(
+ command.serverUrl,
+ (url) => shell.openExternal(url),
+ connectionAbort.signal,
+ );
+ connectionAbort.signal.throwIfAborted();
+ if (this.stopped) return;
+ this.openApp();
+ if (process.platform === 'darwin') app.focus({ steal: true });
+ await this.client.connect(credentials, connectionAbort.signal);
+ credentialsSaved = true;
+ this.connectionVersion++;
+ this.refreshing = false;
+ await this.recording.resetSdk();
+ connectionAbort.signal.throwIfAborted();
+ if (this.stopped) return;
+ this.resetWorkspaceState();
+ this.state.serverUrl = credentials.serverUrl;
+ this.state.connection = 'connected';
+ await this.refresh();
+ connectionAbort.signal.throwIfAborted();
+ } catch (error) {
+ if (credentialsSaved) {
+ this.connectionVersion++;
+ this.resetWorkspaceState();
+ await this.client.disconnect();
+ }
+ if (this.state.connection === 'connecting')
+ this.state.connection = previousConnection;
+ if (!connectionAbort.signal.aborted) throw error;
+ } finally {
+ this.connectionAbort = null;
+ this.changingConnection = false;
+ }
+ break;
+ }
+ case 'disconnect': {
+ if (this.recording.isRecording || this.changingConnection)
+ throw new Error(
+ 'Stop the recording before disconnecting your workspace.',
+ );
+ this.connectionVersion++;
+ this.changingConnection = true;
+ this.resetWorkspaceState();
+ this.refreshing = false;
+ try {
+ await this.client.disconnect();
+ await this.recording.resetSdk();
+ await this.store.writeHandledMeetings([]);
+ } finally {
+ this.changingConnection = false;
+ }
+ break;
+ }
+ case 'settings':
+ await this.updateSettings(command.settings);
+ break;
+ case 'begin-permission-setup':
+ if (this.state.activeRecording) return;
+ this.state.permissionSetup = {};
+ await this.recording.initializeSdk();
+ this.recording.refreshPermissions();
+ this.openApp();
+ break;
+ case 'complete-setup':
+ this.recording.refreshPermissions();
+ if (
+ !Object.values(this.state.permissions).every(
+ (status) => status === 'granted',
+ )
+ )
+ throw new Error(
+ 'Enable microphone, system audio, and meeting detection to continue.',
+ );
+ await this.updateSettings({ setupCompleted: true });
+ this.state.permissionSetup = null;
+ break;
+ case 'permission':
+ await this.recording.requestPermission(command.permission);
+ break;
+ case 'cancel-permission-setup':
+ this.state.permissionSetup = null;
+ break;
+ case 'refresh':
+ await this.refresh();
+ break;
+ case 'skip':
+ await this.markHandled(command.meetingId);
+ break;
+ case 'unskip': {
+ const meeting = this.state.meetings.find(
+ (item) => item.id === command.meetingId,
+ );
+ if (!meeting) throw new Error('This meeting is no longer available.');
+ this.handledIds.delete(getMeetingOccurrenceKey(meeting));
+ this.state.skippedMeetingIds = this.state.skippedMeetingIds.filter(
+ (id) => id !== meeting.id,
+ );
+ await this.store.writeHandledMeetings([...this.handledIds]);
+ break;
+ }
+ case 'join':
+ await this.join(command.meetingId);
+ break;
+ case 'record':
+ await this.recording.record(command.windowId);
+ break;
+ case 'stop':
+ await this.recording.stopRecording();
+ break;
+ case 'pause':
+ case 'resume':
+ await this.recording.pause(command.type === 'pause');
+ break;
+ case 'open-recording':
+ if (
+ !this.state.recordings.some(
+ (recording) => recording.id === command.recordingId,
+ )
+ )
+ throw new Error('Recording is unavailable. Refresh and try again.');
+ await shell.openExternal(
+ `${this.client.workspaceUrl ?? this.state.serverUrl}/object/callRecording/${command.recordingId}`,
+ );
+ break;
+ case 'open-recordings':
+ await shell.openExternal(
+ `${this.client.workspaceUrl ?? this.state.serverUrl}/objects/callRecordings`,
+ );
+ break;
+ case 'open-calendar-settings':
+ await shell.openExternal(
+ `${this.client.workspaceUrl ?? this.state.serverUrl}/settings/accounts`,
+ );
+ break;
+ case 'open-desktop-setup':
+ await shell.openExternal(
+ await getDesktopInstallationUrl(command.serverUrl),
+ );
+ break;
+ case 'open-desktop-installation':
+ await shell.openExternal(
+ await getDesktopInstallationUrl(command.serverUrl),
+ );
+ break;
+ case 'dismiss-error':
+ this.state.notice = null;
+ break;
+ }
+ } catch (error) {
+ if (this.state.connection === 'connecting')
+ this.state.connection = 'disconnected';
+ this.fail(error);
+ } finally {
+ this.emit();
+ }
+ }
+
+ private resetWorkspaceState(): void {
+ Object.assign(this.state, {
+ connection: 'disconnected',
+ workspace: null,
+ meetings: [],
+ recordings: [],
+ calendarConnected: false,
+ updatedAt: null,
+ detectedCalls: [],
+ permissionSetup: null,
+ skippedMeetingIds: [],
+ notice: null,
+ });
+ this.handledIds.clear();
+ this.recording.resetWorkspace();
+ }
+
+ private updateSettings(patch: Partial<Settings>): Promise<void> {
+ const update = this.settingsUpdate.then(async () => {
+ const settings = { ...this.state.settings, ...patch };
+ const shortcutChanged =
+ settings.openShortcut !== this.state.settings.openShortcut;
+ if (shortcutChanged) this.registerOpenShortcut(settings.openShortcut);
+ try {
+ await this.store.writeSettings(settings);
+ } catch (error) {
+ if (shortcutChanged)
+ this.registerOpenShortcut(this.state.settings.openShortcut);
+ throw error;
+ }
+ if (settings.launchAtLogin !== this.state.settings.launchAtLogin)
+ app.setLoginItemSettings({
+ openAtLogin: settings.launchAtLogin,
+ });
+ this.state.settings = settings;
+ nativeTheme.themeSource = settings.appearance;
+ });
+ this.settingsUpdate = update.catch(() => undefined);
+ return update;
+ }
+
+ async refresh(): Promise<void> {
+ if (
+ this.stopped ||
+ this.state.connection !== 'connected' ||
+ this.refreshing
+ )
+ return;
+ this.refreshing = true;
+ const connectionVersion = this.connectionVersion;
+ try {
+ const agenda = await this.client.companion<Agenda>({ action: 'agenda' });
+ if (
+ this.state.connection !== 'connected' ||
+ connectionVersion !== this.connectionVersion
+ )
+ return;
+ this.state.workspace = agenda.workspace;
+ if (this.client.workspace?.id === agenda.workspace.id)
+ this.state.workspace.logoUrl = this.client.workspace.logoUrl;
+ this.state.meetings = agenda.meetings;
+ this.state.skippedMeetingIds = agenda.meetings
+ .filter((meeting) =>
+ this.handledIds.has(getMeetingOccurrenceKey(meeting)),
+ )
+ .map((meeting) => meeting.id);
+ // Completion webhooks can lag behind the local recording-ended event.
+ const finishing = this.state.recordings.filter(
+ (recording) =>
+ recording.status === 'PROCESSING' &&
+ recording.endedAt &&
+ Date.now() - Date.parse(recording.endedAt) < 120_000 &&
+ !agenda.recordings.some(
+ (remote) =>
+ remote.id === recording.id &&
+ ['COMPLETED', 'FAILED'].includes(remote.status),
+ ),
+ );
+ this.state.recordings = [
+ ...finishing,
+ ...agenda.recordings.filter(
+ (recording) => !finishing.some((local) => local.id === recording.id),
+ ),
+ ];
+ this.state.recordings = this.state.recordings.map((recording) => ({
+ ...recording,
+ participants: recording.participants?.map((participant) => ({
+ ...participant,
+ avatarUrl: this.client.resolveImageUrl(participant.avatarUrl),
+ })),
+ }));
+ this.state.calendarConnected = agenda.calendarConnected;
+ this.state.updatedAt = new Date().toISOString();
+ this.state.error = null;
+ await this.recording.initializeSdk();
+ } catch (error) {
+ if (connectionVersion === this.connectionVersion && this.client.workspace)
+ this.state.workspace = this.client.workspace;
+ throw error;
+ } finally {
+ if (connectionVersion === this.connectionVersion) this.refreshing = false;
+ this.emit();
+ }
+ }
+
+ private async tick(): Promise<void> {
+ if (this.state.permissionSetup || !this.state.settings.setupCompleted)
+ this.recording.refreshPermissions();
+ if (
+ this.state.connection !== 'connected' ||
+ this.stopped ||
+ !this.state.settings.setupCompleted ||
+ !this.state.settings.autoJoin ||
+ !this.state.updatedAt
+ )
+ return;
+ const due = getDueMeetings({
+ meetings: this.state.meetings,
+ handledIds: this.handledIds,
+ now: Date.now(),
+ lastSyncedAt: Date.parse(this.state.updatedAt),
+ });
+ for (const meeting of due) {
+ if (
+ this.recording.isRecording ||
+ this.state.detectedCalls.length > 0 ||
+ due.length > 1
+ ) {
+ await this.markHandled(meeting.id);
+ this.notify(
+ 'Your next meeting is starting',
+ `${meeting.title}. Open Twenty to join when you are ready.`,
+ );
+ } else {
+ await this.join(meeting.id);
+ }
+ }
+ }
+
+ private async join(meetingId: string): Promise<void> {
+ const meeting = this.state.meetings.find((item) => item.id === meetingId);
+ if (!meeting?.url) throw new Error('This meeting has no join link.');
+ const connectionVersion = this.connectionVersion;
+ const url = getMeetingUrl(meeting.url);
+ if (this.joiningMeetings.has(meeting.id)) return;
+ if (
+ this.stopped ||
+ this.state.connection !== 'connected' ||
+ connectionVersion !== this.connectionVersion
+ )
+ return;
+ this.joiningMeetings.add(meeting.id);
+ try {
+ await shell.openExternal(url);
+ if (this.stopped || connectionVersion !== this.connectionVersion) return;
+ await this.markHandled(meeting.id);
+ this.state.notice = { type: 'opening-meeting', title: meeting.title };
+ } finally {
+ this.joiningMeetings.delete(meeting.id);
+ }
+ }
+
+ private async markHandled(id: string): Promise<void> {
+ const meeting = this.state.meetings.find((item) => item.id === id);
+ if (!meeting) throw new Error('This meeting is no longer available.');
+ const key = getMeetingOccurrenceKey(meeting);
+ if (this.handledIds.has(key)) return;
+ this.handledIds.add(key);
+ this.state.skippedMeetingIds = [
+ ...new Set([...this.state.skippedMeetingIds, id]),
+ ];
+ await this.store.writeHandledMeetings([...this.handledIds]);
+ }
+
+ private notify(title: string, body: string): void {
+ if (Notification.isSupported()) {
+ const notification = new Notification({ title, body });
+ notification.on('click', this.openApp);
+ notification.show();
+ }
+ }
+
+ private fail(error: unknown): void {
+ this.state.error = {
+ message:
+ error instanceof Error
+ ? error.message
+ : 'Something went wrong. Please try again.',
+ ...(error instanceof DesktopRecorderUnavailableError
+ ? {
+ recovery: {
+ type: 'open-desktop-installation' as const,
+ serverUrl: error.serverUrl,
+ },
+ }
+ : {}),
+ };
+ this.emit();
+ }
+
+ private emit(): void {
+ this.publish(structuredClone(this.state));
+ }
+
+ get isRecording(): boolean {
+ return this.recording.isRecording;
+ }
+
+ refreshPermissions(): void {
+ this.recording.refreshPermissions();
+ }
+
+ async shutdown(): Promise<void> {
+ this.stopped = true;
+ this.connectionVersion++;
+ clearInterval(this.syncingTimer);
+ clearInterval(this.joiningTimer);
+ try {
+ await this.recording.shutdown();
+ await this.settingsUpdate;
+ } catch (error) {
+ this.stopped = false;
+ this.startTimers();
+ throw error;
+ }
+ this.recording.dispose();
+ }
+}
diff --git a/packages/twenty-companion/src/main/services/RecordingController.ts b/packages/twenty-companion/src/main/services/RecordingController.ts
new file mode 100644
index 00000000000..87275708203
--- /dev/null
+++ b/packages/twenty-companion/src/main/services/RecordingController.ts
@@ -0,0 +1,498 @@
+import { randomUUID } from 'node:crypto';
+import { shell, systemPreferences } from 'electron';
+import RecallAiSdk, {
+ type RecallAiSdkWindow,
+ type EventTypeToPayloadMap,
+} from '@recallai/desktop-sdk';
+import { type RecordingUpload } from '../../shared/types/RecordingUpload';
+import { type RecordingConfiguration } from '../../shared/types/RecordingConfiguration';
+import { type RecordingResult } from '../../shared/types/RecordingResult';
+import { type CompanionState } from '../../shared/types/CompanionState';
+import { matchMeeting } from '../../shared/utils/matchMeeting';
+import { type TwentyClient } from './TwentyClient';
+
+const RECALL_REGIONS = new Set([
+ 'https://eu-central-1.recall.ai',
+ 'https://us-east-1.recall.ai',
+ 'https://us-west-2.recall.ai',
+ 'https://ap-northeast-1.recall.ai',
+]);
+
+type RecordingEvents = {
+ emit: () => void;
+ openApp: () => void;
+ notify: (title: string, body: string) => void;
+ fail: (error: unknown) => void;
+ refresh: () => Promise<void>;
+ canRecord: () => boolean;
+ isStopping: () => boolean;
+};
+
+export class RecordingController {
+ private sdkRegion: string | null = null;
+ private sdkInitialization: Promise<void> | null = null;
+ private autoHandledWindows = new Set<string>();
+ private interruptedByNetwork = false;
+ private networkConnected = true;
+ private recordingPause: Promise<void> | null = null;
+ private recordingStop: Promise<void> | null = null;
+ private recordingStart: Promise<void> | null = null;
+ private unsubscribeRecording: (() => void)[] = [];
+
+ constructor(
+ private state: CompanionState,
+ private client: TwentyClient,
+ private events: RecordingEvents,
+ ) {}
+
+ get isRecording(): boolean {
+ return !!this.state.activeRecording || !!this.recordingStart;
+ }
+
+ get listening(): boolean {
+ return this.unsubscribeRecording.length > 0;
+ }
+
+ async resetSdk(): Promise<void> {
+ await this.sdkInitialization;
+ await this.stopSdk();
+ }
+
+ resetWorkspace(): void {
+ this.autoHandledWindows.clear();
+ }
+
+ async shutdown(): Promise<void> {
+ await this.recordingStart?.catch(() => undefined);
+ await this.sdkInitialization?.catch(() => undefined);
+ await this.stopRecording();
+ await this.stopSdk();
+ }
+
+ dispose(): void {
+ this.unsubscribeRecording.forEach((unsubscribe) => unsubscribe());
+ this.unsubscribeRecording = [];
+ }
+
+ async pause(pausing: boolean): Promise<void> {
+ if (this.recordingPause) return;
+ this.recordingPause = this.changeRecordingPause(pausing).finally(() => {
+ this.recordingPause = null;
+ });
+ await this.recordingPause;
+ }
+
+ private async changeRecordingPause(pausing: boolean): Promise<void> {
+ const recording = this.state.activeRecording;
+
+ if (
+ this.recordingStop ||
+ !recording ||
+ recording.status !== (pausing ? 'recording' : 'paused')
+ )
+ return;
+ recording.status = pausing ? 'pausing' : 'resuming';
+ this.events.emit();
+ try {
+ if (pausing)
+ await RecallAiSdk.pauseRecording({
+ windowId: recording.windowId,
+ });
+ else
+ await RecallAiSdk.resumeRecording({
+ windowId: recording.windowId,
+ });
+ if (
+ this.state.activeRecording !== recording ||
+ recording.status !== (pausing ? 'pausing' : 'resuming')
+ )
+ return;
+ if (pausing) recording.pausedAt = new Date().toISOString();
+ else {
+ recording.pausedMilliseconds =
+ (recording.pausedMilliseconds ?? 0) +
+ (recording.pausedAt
+ ? Date.now() - Date.parse(recording.pausedAt)
+ : 0);
+ recording.pausedAt = undefined;
+ }
+ recording.status = pausing ? 'paused' : 'recording';
+ } catch (error) {
+ if (
+ this.state.activeRecording === recording &&
+ recording.status === (pausing ? 'pausing' : 'resuming')
+ )
+ recording.status = pausing ? 'recording' : 'paused';
+ throw error;
+ }
+ }
+
+ stopRecording(): Promise<void> {
+ this.recordingStop ??= this.finishCapture().finally(() => {
+ this.recordingStop = null;
+ });
+ return this.recordingStop;
+ }
+
+ private async finishCapture(): Promise<void> {
+ await this.recordingStart?.catch(() => undefined);
+ await this.recordingPause?.catch(() => undefined);
+ const recording = this.state.activeRecording;
+ if (!recording) return;
+ const previousStatus = recording.status;
+ recording.status = 'stopping';
+ this.events.emit();
+ try {
+ await RecallAiSdk.stopRecording({ windowId: recording.windowId });
+ this.finishRecording(recording.windowId);
+ } catch (error) {
+ if (this.state.activeRecording === recording)
+ recording.status = previousStatus;
+ throw error;
+ }
+ }
+
+ async initializeSdk(region?: string): Promise<void> {
+ if (this.sdkInitialization) await this.sdkInitialization;
+ if (this.events.isStopping()) return;
+ if (this.sdkRegion && (!region || region === this.sdkRegion)) return;
+ this.sdkInitialization = this.startSdk(region).finally(() => {
+ this.sdkInitialization = null;
+ });
+ await this.sdkInitialization;
+ }
+
+ private async startSdk(region?: string): Promise<void> {
+ if (process.platform !== 'darwin' || process.arch !== 'arm64')
+ throw new Error('Recording requires an Apple Silicon Mac.');
+ const [major, minor] = process.getSystemVersion().split('.').map(Number);
+ if (major < 14 || (major === 14 && minor < 2))
+ throw new Error('Audio recording requires macOS 14.2 or later.');
+ const apiUrl =
+ region ??
+ (
+ await this.client.companion<RecordingConfiguration>({
+ action: 'configuration',
+ })
+ ).apiUrl;
+ if (!RECALL_REGIONS.has(apiUrl))
+ throw new Error('The workspace returned an unsupported Recall region.');
+ if (this.sdkRegion === apiUrl) return;
+ await this.stopSdk();
+ await RecallAiSdk.init({ apiUrl, acquirePermissionsOnStartup: [] });
+ this.sdkRegion = apiUrl;
+ this.refreshPermissions();
+ }
+
+ private async stopSdk(): Promise<void> {
+ if (this.sdkRegion) await RecallAiSdk.shutdown();
+ this.sdkRegion = null;
+ }
+
+ private async openPermissionSettings(
+ permission: 'microphone' | 'system-audio' | 'accessibility',
+ ): Promise<void> {
+ const pane = {
+ microphone: 'Privacy_Microphone',
+ accessibility: 'Privacy_Accessibility',
+ 'system-audio': 'Privacy_ScreenCapture',
+ }[permission];
+ await shell.openExternal(
+ `x-apple.systempreferences:com.apple.preference.security?${pane}`,
+ );
+ }
+
+ refreshPermissions(): void {
+ if (process.platform !== 'darwin') return;
+ const accessibility = systemPreferences.isTrustedAccessibilityClient(false);
+ const status = accessibility
+ ? 'granted'
+ : this.state.permissions.accessibility === 'not_requested'
+ ? 'not_requested'
+ : 'denied';
+ // Recall can retain a denial after approval in System Settings.
+ // Audio permissions belong to the SDK's capture process.
+ if (status !== this.state.permissions.accessibility) {
+ this.state.permissions.accessibility = status;
+ this.events.emit();
+ }
+ }
+
+ async requestPermission(
+ permission: 'microphone' | 'system-audio' | 'accessibility',
+ ): Promise<void> {
+ this.refreshPermissions();
+ // A known denial must still open Settings when SDK initialization is unavailable.
+ if (this.state.permissions[permission] !== 'denied')
+ await this.initializeSdk();
+ this.refreshPermissions();
+ if (this.state.permissions[permission] === 'granted') return;
+ if (this.state.permissions[permission] === 'denied') {
+ await this.openPermissionSettings(permission);
+ return;
+ }
+ await RecallAiSdk.requestPermission(permission);
+ }
+
+ async record(windowId?: string): Promise<void> {
+ if (this.state.activeRecording || this.recordingStart) return;
+ if (!this.events.canRecord() || this.state.connection !== 'connected')
+ throw new Error('Connect your workspace before recording.');
+ if (!this.networkConnected)
+ throw new Error('Reconnect to the internet before recording.');
+ this.recordingStart = this.startRecording(windowId);
+ try {
+ await this.recordingStart;
+ } finally {
+ this.recordingStart = null;
+ }
+ }
+
+ private async startRecording(windowId?: string): Promise<void> {
+ let recordingId: string | undefined;
+ let selectedWindowId: string | undefined;
+ try {
+ await this.initializeSdk();
+ this.refreshPermissions();
+ const missingPermission = (
+ ['microphone', 'system-audio', 'accessibility'] as const
+ ).find((permission) => this.state.permissions[permission] !== 'granted');
+ if (missingPermission) {
+ this.state.permissionSetup = { windowId, intent: 'record' };
+ this.events.emit();
+ this.events.openApp();
+ return;
+ }
+ this.state.permissionSetup = null;
+ const detected = windowId
+ ? this.state.detectedCalls.find((call) => call.id === windowId)
+ : undefined;
+ if (windowId && !detected)
+ throw new Error('This call has ended. Refresh and try again.');
+ if (
+ !this.state.updatedAt ||
+ Date.now() - Date.parse(this.state.updatedAt) > 90_000
+ )
+ throw new Error('Refresh your agenda before recording.');
+ const calendarEvent = matchMeeting({
+ meetings: this.state.meetings,
+ url: detected?.url,
+ now: Date.now(),
+ });
+ if (
+ calendarEvent &&
+ (calendarEvent.usesCalendarBot || !calendarEvent.recordingEnabled)
+ )
+ throw new Error(
+ 'This meeting uses its calendar bot. Desktop recording is available for unscheduled calls.',
+ );
+ const title =
+ calendarEvent?.title ?? detected?.title ?? 'Unscheduled conversation';
+ recordingId = randomUUID();
+ const upload = await this.client.companion<RecordingUpload>({
+ action: 'create-upload',
+ sessionId: recordingId,
+ title,
+ calendarEventId: calendarEvent?.id,
+ meetingUrl: detected?.url,
+ platform: detected?.platform ?? 'desktop-audio',
+ });
+ await this.initializeSdk(upload.apiUrl);
+ selectedWindowId =
+ windowId ?? (await RecallAiSdk.prepareDesktopAudioRecording());
+ if (!this.events.canRecord() || !this.networkConnected)
+ throw new Error('Recording setup was interrupted. Try again.');
+ this.state.activeRecording = {
+ id: upload.callRecordingId,
+ windowId: selectedWindowId,
+ title,
+ startedAt: new Date().toISOString(),
+ status: 'starting',
+ };
+ this.events.emit();
+ await RecallAiSdk.startRecording({
+ windowId: selectedWindowId,
+ uploadToken: upload.uploadToken,
+ });
+ if (
+ this.state.activeRecording?.windowId === selectedWindowId &&
+ this.state.activeRecording.status === 'starting'
+ )
+ this.state.activeRecording.status = 'recording';
+ } catch (error) {
+ if (selectedWindowId && this.state.activeRecording) {
+ try {
+ await RecallAiSdk.stopRecording({ windowId: selectedWindowId });
+ } catch {
+ this.state.activeRecording.status = 'recording';
+ throw new Error(
+ 'Capture may still be running. Use Stop recording or quit the app to stop it.',
+ );
+ }
+ }
+ this.state.activeRecording = null;
+ if (recordingId)
+ await this.client
+ .companion<RecordingResult>({
+ action: 'capture-failed',
+ sessionId: recordingId,
+ })
+ .catch(() => undefined);
+ throw error;
+ } finally {
+ this.events.emit();
+ }
+ }
+
+ listenToRecording(): void {
+ const listen = <TEvent extends keyof EventTypeToPayloadMap>(
+ event: TEvent,
+ listener: (payload: EventTypeToPayloadMap[TEvent]) => void,
+ ) => {
+ RecallAiSdk.addEventListener(event, listener);
+ this.unsubscribeRecording.push(() =>
+ RecallAiSdk.removeEventListener(event, listener),
+ );
+ };
+ const detected = (window: RecallAiSdkWindow) => {
+ const call = {
+ id: window.id,
+ title: window.title ?? 'Detected call',
+ platform: window.platform ?? 'Meeting',
+ url: window.url,
+ };
+ this.state.detectedCalls = [
+ ...this.state.detectedCalls.filter((item) => item.id !== call.id),
+ call,
+ ];
+ this.events.emit();
+ };
+ const handleDetection = (
+ window: RecallAiSdkWindow,
+ shouldNotify: boolean,
+ ) => {
+ if (this.events.isStopping() || this.state.connection !== 'connected')
+ return;
+ detected(window);
+ // Calendar meetings keep their scheduled bot; unsupported platforms can use desktop capture.
+ const meeting = matchMeeting({
+ meetings: this.state.meetings,
+ url: window.url,
+ now: Date.now(),
+ });
+ if (
+ this.state.settings.autoRecord &&
+ this.state.settings.setupCompleted &&
+ this.networkConnected &&
+ (!meeting || (meeting.recordingEnabled && !meeting.usesCalendarBot)) &&
+ window.url &&
+ this.state.updatedAt &&
+ Date.now() - Date.parse(this.state.updatedAt) < 90_000 &&
+ !this.autoHandledWindows.has(window.id)
+ ) {
+ this.autoHandledWindows.add(window.id);
+ void this.record(window.id)
+ .catch((error) => this.events.fail(error))
+ .finally(() => {
+ if (this.state.activeRecording?.windowId !== window.id)
+ this.autoHandledWindows.delete(window.id);
+ });
+ } else if (
+ shouldNotify &&
+ this.state.settings.notifyOnDetectedCall &&
+ !meeting?.usesCalendarBot
+ )
+ this.events.notify(
+ 'Call detected',
+ 'Open Twenty to record this conversation.',
+ );
+ };
+ listen('meeting-detected', ({ window }) => handleDetection(window, true));
+ listen('meeting-updated', ({ window }) => handleDetection(window, false));
+ listen('meeting-closed', ({ window }) => {
+ this.autoHandledWindows.delete(window.id);
+ this.state.detectedCalls = this.state.detectedCalls.filter(
+ (call) => call.id !== window.id,
+ );
+ this.events.emit();
+ });
+ listen('recording-started', ({ window }) => {
+ if (
+ this.state.activeRecording?.windowId === window.id &&
+ this.state.activeRecording.status === 'starting'
+ )
+ this.state.activeRecording.status = 'recording';
+ this.events.emit();
+ });
+ listen('recording-ended', ({ window }) => this.finishRecording(window.id));
+ listen('permission-status', ({ permission, status }) => {
+ if (
+ permission === 'microphone' ||
+ permission === 'accessibility' ||
+ permission === 'system-audio'
+ )
+ this.state.permissions[permission] = status;
+ this.refreshPermissions();
+ this.events.emit();
+ });
+ listen('network-status', ({ status }) => {
+ this.networkConnected = status !== 'disconnected';
+ if (!this.networkConnected && this.state.activeRecording) {
+ this.interruptedByNetwork = true;
+ this.state.notice = { type: 'network-lost' };
+ this.events.notify(
+ 'Recording interrupted',
+ 'Network connection lost. Stopping this recording. Reconnect before starting a new recording.',
+ );
+ void this.stopRecording().catch((error) => this.events.fail(error));
+ } else if (this.networkConnected && this.interruptedByNetwork) {
+ this.interruptedByNetwork = false;
+ this.state.notice = this.state.activeRecording
+ ? { type: 'network-restored-active' }
+ : { type: 'network-restored' };
+ }
+ this.events.emit();
+ });
+ listen('error', () => {
+ this.events.fail(
+ new Error(
+ this.state.activeRecording
+ ? 'Recall reported a capture error. Stop this recording before starting another.'
+ : 'Recording is unavailable. Check permissions and try again.',
+ ),
+ );
+ });
+ listen('media-capture-status', ({ type, capturing, window }) => {
+ if (
+ type === 'audio' &&
+ !capturing &&
+ this.state.activeRecording?.windowId === window.id &&
+ this.state.activeRecording.status === 'recording'
+ ) {
+ this.state.notice = { type: 'audio-interrupted' };
+ this.events.emit();
+ }
+ });
+ }
+
+ private finishRecording(windowId: string): void {
+ if (this.state.activeRecording?.windowId !== windowId) return;
+ const recording = this.state.activeRecording;
+ this.state.recordings = [
+ {
+ id: recording.id,
+ title: recording.title,
+ status: 'PROCESSING',
+ startedAt: recording.startedAt,
+ endedAt: new Date().toISOString(),
+ },
+ ...this.state.recordings.filter((item) => item.id !== recording.id),
+ ];
+ this.state.activeRecording = null;
+ this.state.notice = this.networkConnected
+ ? { type: 'recording-finished' }
+ : { type: 'recording-stopped-offline' };
+ this.events.emit();
+ void this.events.refresh().catch((error) => this.events.fail(error));
+ }
+}
diff --git a/packages/twenty-companion/src/main/services/SecureStore.ts b/packages/twenty-companion/src/main/services/SecureStore.ts
new file mode 100644
index 00000000000..a98615a70dc
--- /dev/null
+++ b/packages/twenty-companion/src/main/services/SecureStore.ts
@@ -0,0 +1,157 @@
+import { randomUUID } from 'node:crypto';
+import {
+ readFile,
+ writeFile,
+ rename,
+ mkdir,
+ unlink,
+ copyFile,
+} from 'node:fs/promises';
+import { join } from 'node:path';
+import { safeStorage } from 'electron';
+import { z } from 'zod';
+import { DEFAULT_SETTINGS } from '../../shared/constants/DEFAULT_SETTINGS';
+import { settingsSchema } from '../../shared/validation-schemas/settingsSchema';
+import { type Settings } from '../../shared/types/Settings';
+import { credentialsSchema } from '../validation-schemas/credentialsSchema';
+import { type Credentials } from '../types/Credentials';
+import { SettingsRecoveryError } from '../errors/SettingsRecoveryError';
+
+export class SecureStore {
+ private handledWrite: Promise<void> = Promise.resolve();
+
+ constructor(private directory: string) {}
+
+ async readCredentials(): Promise<Credentials | null> {
+ try {
+ return credentialsSchema.parse(
+ JSON.parse(
+ safeStorage.decryptString(
+ await readFile(join(this.directory, 'credentials')),
+ ),
+ ),
+ );
+ } catch (error) {
+ if ((error as NodeJS.ErrnoException).code === 'ENOENT') return null;
+ throw new Error(
+ 'Could not unlock your Twenty connection. Reconnect to Twenty.',
+ );
+ }
+ }
+
+ async writeCredentials(credentials: Credentials): Promise<void> {
+ if (!safeStorage.isEncryptionAvailable())
+ throw new Error(
+ 'macOS Keychain is unavailable. Your connection could not be saved.',
+ );
+ await this.writeAtomic(
+ 'credentials',
+ safeStorage.encryptString(JSON.stringify(credentials)),
+ );
+ }
+
+ async clearCredentials(): Promise<void> {
+ await unlink(join(this.directory, 'credentials')).catch(
+ (error: NodeJS.ErrnoException) => {
+ if (error.code !== 'ENOENT') throw error;
+ },
+ );
+ }
+
+ async readSettings(): Promise<Settings> {
+ const path = join(this.directory, 'settings.json');
+ let contents: string;
+ try {
+ contents = await readFile(path, 'utf8');
+ } catch (error) {
+ if ((error as NodeJS.ErrnoException).code === 'ENOENT')
+ return { ...DEFAULT_SETTINGS };
+ throw new SettingsRecoveryError(
+ { ...DEFAULT_SETTINGS, autoJoin: false, autoRecord: false },
+ 'Could not read your settings. Automatic joining and recording are off. Check Settings before continuing.',
+ );
+ }
+ let saved: unknown;
+ try {
+ saved = JSON.parse(contents);
+ } catch {
+ saved = null;
+ }
+ const savedObject = z.record(z.string(), z.unknown()).safeParse(saved);
+ const migrated = settingsSchema.safeParse({
+ ...DEFAULT_SETTINGS,
+ ...(savedObject.success ? savedObject.data : {}),
+ });
+ if (savedObject.success && migrated.success) return migrated.data;
+
+ const recovered = {
+ ...DEFAULT_SETTINGS,
+ autoJoin: false,
+ autoRecord: false,
+ };
+ if (savedObject.success) {
+ for (const [key, schema] of Object.entries(settingsSchema.shape)) {
+ const field = schema.safeParse(savedObject.data[key]);
+ if (field.success) Object.assign(recovered, { [key]: field.data });
+ }
+ }
+ // Keep the original available even if a later preference change saves the recovered settings.
+ await copyFile(path, `${path}.damaged-${randomUUID()}`);
+ throw new SettingsRecoveryError(
+ recovered,
+ 'Some settings could not be restored. A backup was saved and valid preferences were kept. Review Settings before continuing.',
+ );
+ }
+
+ async writeSettings(settings: Settings): Promise<void> {
+ await this.writeAtomic(
+ 'settings.json',
+ JSON.stringify(settingsSchema.parse(settings)),
+ );
+ }
+
+ async readHandledMeetings(): Promise<string[]> {
+ try {
+ return z
+ .array(z.string())
+ .parse(
+ JSON.parse(
+ await readFile(
+ join(this.directory, 'handled-meetings.json'),
+ 'utf8',
+ ),
+ ),
+ );
+ } catch (error) {
+ if ((error as NodeJS.ErrnoException).code === 'ENOENT') return [];
+ throw new Error(
+ 'Could not restore skipped meetings. Automatic joining is off. Review Settings before continuing.',
+ { cause: error },
+ );
+ }
+ }
+
+ async writeHandledMeetings(ids: string[]): Promise<void> {
+ const contents = JSON.stringify(ids.slice(-500));
+ const write = this.handledWrite.then(() =>
+ this.writeAtomic('handled-meetings.json', contents),
+ );
+ this.handledWrite = write.catch(() => undefined);
+ await write;
+ }
+
+ private async writeAtomic(
+ name: string,
+ data: string | Buffer,
+ ): Promise<void> {
+ await mkdir(this.directory, { recursive: true, mode: 0o700 });
+ const path = join(this.directory, name);
+ const temporaryPath = `${path}.${randomUUID()}.tmp`;
+ try {
+ await writeFile(temporaryPath, data, { mode: 0o600 });
+ await rename(temporaryPath, path);
+ } finally {
+ await unlink(temporaryPath).catch(() => undefined);
+ }
+ }
+}
diff --git a/packages/twenty-companion/src/main/services/TwentyClient.ts b/packages/twenty-companion/src/main/services/TwentyClient.ts
new file mode 100644
index 00000000000..fbda502d880
--- /dev/null
+++ b/packages/twenty-companion/src/main/services/TwentyClient.ts
@@ -0,0 +1,272 @@
+import { getFunctionsBaseUrl } from '../../../../twenty-front/src/modules/settings/logic-functions/utils/getLogicFunctionHttpUrl';
+import { type SecureStore } from './SecureStore';
+import { type Credentials } from '../types/Credentials';
+import { refreshCredentials } from '../utils/refreshCredentials';
+import { requestJson } from '../utils/requestJson';
+import { validateServerUrl } from '../utils/validateServerUrl';
+import { TwentyRequestError } from '../errors/TwentyRequestError';
+import { DesktopRecorderUnavailableError } from '../errors/DesktopRecorderUnavailableError';
+import { type RecordingConfiguration } from '../../shared/types/RecordingConfiguration';
+import { type Agenda } from '../../shared/types/Agenda';
+import { getImageAbsoluteURI } from '../../../../twenty-shared/src/utils/image/getImageAbsoluteURI';
+
+type ConnectionContext = {
+ endpoint: string;
+ workspaceUrl: string;
+ workspace: Agenda['workspace'];
+};
+
+const resolveImageUrl = (
+ imageUrl: string | null | undefined,
+ baseUrl: string,
+): string | null => {
+ if (!imageUrl) return null;
+ try {
+ const url = new URL(getImageAbsoluteURI({ imageUrl, baseUrl }), baseUrl);
+ validateServerUrl(url.origin);
+ return !url.username && !url.password ? url.href : null;
+ } catch {
+ return null;
+ }
+};
+
+export class TwentyClient {
+ private credentials: Credentials | null = null;
+ private context: ConnectionContext | null = null;
+ get workspaceUrl() {
+ return this.context?.workspaceUrl ?? null;
+ }
+ get workspace() {
+ return this.context?.workspace ?? null;
+ }
+ private refreshing: Promise<void> | null = null;
+ private credentialWrite: Promise<void> = Promise.resolve();
+ private connectionVersion = 0;
+
+ constructor(
+ private store: Pick<
+ SecureStore,
+ 'readCredentials' | 'writeCredentials' | 'clearCredentials'
+ >,
+ ) {}
+
+ resolveImageUrl(imageUrl?: string | null): string | null {
+ return this.credentials
+ ? resolveImageUrl(imageUrl, this.credentials.serverUrl)
+ : null;
+ }
+
+ async restore(): Promise<Credentials | null> {
+ const connectionVersion = this.connectionVersion;
+ const credentials = await this.store.readCredentials();
+ if (connectionVersion === this.connectionVersion)
+ this.credentials = credentials;
+ return this.credentials;
+ }
+
+ async connect(credentials: Credentials, signal?: AbortSignal): Promise<void> {
+ const previousConnectionVersion = this.connectionVersion;
+ const context = await this.discoverEndpoint(credentials, signal);
+ try {
+ const configuration = await requestJson<RecordingConfiguration>(
+ context.endpoint,
+ {
+ signal,
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${credentials.accessToken}`,
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({ action: 'configuration' }),
+ },
+ );
+ validateServerUrl(configuration.apiUrl);
+ } catch (error) {
+ if (error instanceof TwentyRequestError && error.status === 404)
+ throw new DesktopRecorderUnavailableError(credentials.serverUrl);
+ throw error;
+ }
+ signal?.throwIfAborted();
+ if (previousConnectionVersion !== this.connectionVersion)
+ throw new Error('Your workspace connection changed. Try again.');
+ const connectionVersion = ++this.connectionVersion;
+ const previous = this.credentials;
+ const previousContext = this.context;
+ this.refreshing = null;
+ this.credentials = null;
+ this.context = null;
+ try {
+ await this.persistCredentials(async () => {
+ signal?.throwIfAborted();
+ await this.store.writeCredentials(credentials);
+ if (signal?.aborted) {
+ if (connectionVersion === this.connectionVersion) {
+ if (previous) await this.store.writeCredentials(previous);
+ else await this.store.clearCredentials();
+ }
+ signal.throwIfAborted();
+ }
+ });
+ if (connectionVersion === this.connectionVersion) {
+ this.credentials = credentials;
+ this.context = context;
+ }
+ } catch (error) {
+ if (connectionVersion === this.connectionVersion) {
+ this.credentials = previous;
+ this.context = previousContext;
+ }
+ throw error;
+ }
+ }
+
+ async disconnect(): Promise<void> {
+ const credentials = this.credentials;
+ this.connectionVersion++;
+ this.refreshing = null;
+ this.credentials = null;
+ this.context = null;
+ await this.persistCredentials(() => this.store.clearCredentials());
+ if (credentials) {
+ await fetch(`${credentials.serverUrl}/oauth/revoke`, {
+ method: 'POST',
+ body: new URLSearchParams({
+ token: credentials.refreshToken,
+ client_id: credentials.clientId,
+ }),
+ signal: AbortSignal.timeout(5000),
+ redirect: 'error',
+ }).catch(() => undefined);
+ }
+ }
+
+ private persistCredentials(write: () => Promise<void>): Promise<void> {
+ const pending = this.credentialWrite.then(write);
+ this.credentialWrite = pending.catch(() => undefined);
+ return pending;
+ }
+
+ async companion<TResponse>(body: object): Promise<TResponse> {
+ const connectionVersion = this.connectionVersion;
+ if (!this.credentials)
+ throw new Error('Connect your Twenty workspace first.');
+ if (this.credentials.expiresAt < Date.now() + 60_000) {
+ if (!this.refreshing) {
+ const refreshing = this.refresh().finally(() => {
+ if (this.refreshing === refreshing) this.refreshing = null;
+ });
+ this.refreshing = refreshing;
+ }
+ await this.refreshing;
+ }
+ if (!this.credentials || connectionVersion !== this.connectionVersion)
+ throw new Error('Reconnect your Twenty workspace.');
+ if (!this.context) {
+ const context = await this.discoverEndpoint(this.credentials);
+ if (connectionVersion === this.connectionVersion) this.context = context;
+ }
+ if (
+ !this.context ||
+ !this.credentials ||
+ connectionVersion !== this.connectionVersion
+ )
+ throw new Error('Reconnect your Twenty workspace.');
+ const serverUrl = this.credentials.serverUrl;
+ try {
+ const response = await requestJson<TResponse>(this.context.endpoint, {
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${this.credentials.accessToken}`,
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify(body),
+ });
+ if (connectionVersion !== this.connectionVersion)
+ throw new Error('Your workspace connection changed. Try again.');
+ return response;
+ } catch (error) {
+ if (error instanceof TwentyRequestError && error.status === 404) {
+ throw new DesktopRecorderUnavailableError(serverUrl);
+ }
+ throw error;
+ }
+ }
+
+ private async discoverEndpoint(
+ credentials: Credentials,
+ signal?: AbortSignal,
+ ): Promise<ConnectionContext> {
+ const [configuration, metadata] = await Promise.all([
+ requestJson<{ publicFunctionDomain?: string | null }>(
+ `${credentials.serverUrl}/client-config`,
+ { signal },
+ ),
+ requestJson<{
+ errors?: { message: string }[];
+ data: {
+ currentWorkspace: {
+ id: string;
+ displayName: string | null;
+ logo?: string | null;
+ subdomain: string;
+ workspaceUrls: { subdomainUrl: string; customUrl?: string | null };
+ };
+ };
+ }>(`${credentials.serverUrl}/metadata`, {
+ signal,
+ method: 'POST',
+ headers: {
+ Authorization: `Bearer ${credentials.accessToken}`,
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ query:
+ 'query CompanionWorkspace { currentWorkspace { id displayName logo subdomain workspaceUrls { subdomainUrl customUrl } } }',
+ }),
+ }),
+ ]);
+ if (metadata.errors?.length) {
+ throw new Error(
+ 'Twenty could not load your workspace. Try refreshing, or reconnect in Settings if this continues.',
+ );
+ }
+ const { publicFunctionDomain } = configuration;
+ const { currentWorkspace } = metadata.data;
+ const workspace: Agenda['workspace'] = {
+ id: currentWorkspace.id,
+ name: currentWorkspace.displayName ?? currentWorkspace.subdomain,
+ };
+ const logoUrl = resolveImageUrl(
+ currentWorkspace.logo,
+ credentials.serverUrl,
+ );
+ if (logoUrl) workspace.logoUrl = logoUrl;
+ const workspaceUrl = validateServerUrl(
+ currentWorkspace.workspaceUrls.customUrl ??
+ currentWorkspace.workspaceUrls.subdomainUrl,
+ );
+ const functionsBaseUrl = getFunctionsBaseUrl({
+ serverBaseUrl: credentials.serverUrl,
+ publicFunctionDomain,
+ workspaceSubdomain: currentWorkspace.subdomain,
+ });
+ validateServerUrl(new URL(functionsBaseUrl).origin);
+ return {
+ endpoint: `${functionsBaseUrl}/companion/desktop`,
+ workspace,
+ workspaceUrl,
+ };
+ }
+
+ private async refresh(): Promise<void> {
+ const previous = this.credentials;
+ if (!previous) return;
+ const credentials = await refreshCredentials(previous);
+ if (this.credentials !== previous) return;
+ await this.persistCredentials(async () => {
+ if (this.credentials !== previous) return;
+ await this.store.writeCredentials(credentials);
+ if (this.credentials === previous) this.credentials = credentials;
+ });
+ }
+}
diff --git a/packages/twenty-companion/src/main/types/Credentials.ts b/packages/twenty-companion/src/main/types/Credentials.ts
new file mode 100644
index 00000000000..117c4f7fee0
--- /dev/null
+++ b/packages/twenty-companion/src/main/types/Credentials.ts
@@ -0,0 +1,4 @@
+import { z } from 'zod';
+import { credentialsSchema } from '../validation-schemas/credentialsSchema';
+
+export type Credentials = z.infer<typeof credentialsSchema>;
diff --git a/packages/twenty-companion/src/main/types/OAuthDiscovery.ts b/packages/twenty-companion/src/main/types/OAuthDiscovery.ts
new file mode 100644
index 00000000000..ad0a2d9a22e
--- /dev/null
+++ b/packages/twenty-companion/src/main/types/OAuthDiscovery.ts
@@ -0,0 +1,6 @@
+export type OAuthDiscovery = {
+ issuer: string;
+ authorization_endpoint: string;
+ cli_client_id?: string;
+ authorization_response_iss_parameter_supported?: boolean;
+};
diff --git a/packages/twenty-companion/src/main/types/TokenResponse.ts b/packages/twenty-companion/src/main/types/TokenResponse.ts
new file mode 100644
index 00000000000..cddec33b5be
--- /dev/null
+++ b/packages/twenty-companion/src/main/types/TokenResponse.ts
@@ -0,0 +1,5 @@
+export type TokenResponse = {
+ access_token: string;
+ refresh_token: string;
+ expires_in: number;
+};
diff --git a/packages/twenty-companion/src/main/utils/connectOAuth.ts b/packages/twenty-companion/src/main/utils/connectOAuth.ts
new file mode 100644
index 00000000000..c1e629ef7e6
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/connectOAuth.ts
@@ -0,0 +1,136 @@
+import { type OAuthDiscovery } from '../types/OAuthDiscovery';
+import { type TokenResponse } from '../types/TokenResponse';
+import { createHash, randomBytes, timingSafeEqual } from 'node:crypto';
+import { createServer } from 'node:http';
+import { type Credentials } from '../types/Credentials';
+import { validateServerUrl } from './validateServerUrl';
+import { requestJson } from './requestJson';
+
+export const connectOAuth = async (
+ serverUrlInput: string,
+ openBrowser: (url: string) => Promise<void>,
+ signal?: AbortSignal,
+): Promise<Credentials> => {
+ const serverUrl = validateServerUrl(serverUrlInput);
+ const discovery = await requestJson<OAuthDiscovery>(
+ `${serverUrl}/.well-known/oauth-authorization-server`,
+ { signal },
+ );
+ if (discovery.issuer !== serverUrl)
+ throw new Error('Twenty returned a different OAuth issuer.');
+ if (!discovery.cli_client_id)
+ throw new Error(
+ 'This Twenty server does not support CLI sign-in. Update Twenty to connect.',
+ );
+ const clientId = discovery.cli_client_id;
+ const authorizationEndpoint = new URL(discovery.authorization_endpoint);
+ validateServerUrl(authorizationEndpoint.origin);
+ const verifier = randomBytes(32).toString('base64url');
+ const state = randomBytes(32).toString('base64url');
+ const challenge = createHash('sha256').update(verifier).digest('base64url');
+ let resolveCode: (value: string) => void;
+ let rejectCode: (error: Error) => void;
+ const codePromise = new Promise<string>((resolve, reject) => {
+ resolveCode = resolve;
+ rejectCode = reject;
+ });
+ // Handle cancellation even if the browser takes longer than the callback deadline.
+ void codePromise.catch(() => undefined);
+ const server = createServer((request, response) => {
+ const url = new URL(request.url ?? '/', 'http://127.0.0.1');
+ if (request.method !== 'GET' || url.pathname !== '/callback') {
+ response.writeHead(404).end();
+ return;
+ }
+ const receivedState = Buffer.from(url.searchParams.get('state') ?? '');
+ const expectedState = Buffer.from(state);
+ if (
+ receivedState.length !== expectedState.length ||
+ !timingSafeEqual(receivedState, expectedState)
+ ) {
+ response.writeHead(400).end('Invalid authorization state.');
+ return;
+ }
+ if (
+ (discovery.authorization_response_iss_parameter_supported ||
+ url.searchParams.has('iss')) &&
+ url.searchParams.get('iss') !== discovery.issuer
+ ) {
+ response.writeHead(400).end('Invalid authorization issuer.');
+ rejectCode(new Error('Twenty returned a different OAuth issuer.'));
+ return;
+ }
+ const code = url.searchParams.get('code');
+ response
+ .writeHead(200, {
+ 'Content-Type': 'text/plain',
+ 'Cache-Control': 'no-store',
+ })
+ .end(
+ code
+ ? 'Returning to Twenty… You can close this tab.'
+ : 'Connection canceled. Return to Twenty.',
+ );
+ if (code) resolveCode(code);
+ else rejectCode(new Error('Twenty connection was canceled.'));
+ });
+ await new Promise<void>((resolve, reject) => {
+ server.once('error', reject);
+ server.listen(0, 'localhost', resolve);
+ });
+ const timer = setTimeout(
+ () => rejectCode(new Error('Connection timed out. Try connecting again.')),
+ 180_000,
+ );
+ const abort = () => rejectCode(new Error('Connection canceled.'));
+ signal?.addEventListener('abort', abort, { once: true });
+ try {
+ signal?.throwIfAborted();
+ const address = server.address();
+ if (!address || typeof address === 'string')
+ throw new Error('Could not start the OAuth callback.');
+ const redirectUri = `http://localhost:${address.port}/callback`;
+ const authorizationUrl = authorizationEndpoint;
+ const authorizationParameters = new URLSearchParams({
+ client_id: clientId,
+ response_type: 'code',
+ redirect_uri: redirectUri,
+ scope: 'api profile',
+ state,
+ code_challenge: challenge,
+ code_challenge_method: 'S256',
+ });
+ authorizationParameters.forEach((value, name) =>
+ authorizationUrl.searchParams.set(name, value),
+ );
+ signal?.throwIfAborted();
+ await openBrowser(authorizationUrl.href);
+ const code = await codePromise;
+ const result = await requestJson<TokenResponse>(
+ `${serverUrl}/oauth/token`,
+ {
+ method: 'POST',
+ signal,
+ body: new URLSearchParams({
+ grant_type: 'authorization_code',
+ code,
+ redirect_uri: redirectUri,
+ client_id: clientId,
+ code_verifier: verifier,
+ }),
+ },
+ );
+ return {
+ serverUrl,
+ clientId,
+ accessToken: result.access_token,
+ refreshToken: result.refresh_token,
+ expiresAt: Date.now() + result.expires_in * 1000,
+ };
+ } finally {
+ signal?.removeEventListener('abort', abort);
+ clearTimeout(timer);
+ server.closeAllConnections();
+ server.close();
+ }
+};
diff --git a/packages/twenty-companion/src/main/utils/createDevelopmentRestart.ts b/packages/twenty-companion/src/main/utils/createDevelopmentRestart.ts
new file mode 100644
index 00000000000..ad28f52ba1f
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/createDevelopmentRestart.ts
@@ -0,0 +1,25 @@
+export const createDevelopmentRestart = (
+ isBusy: () => boolean,
+ restart: () => void,
+) => {
+ let timer: ReturnType<typeof setInterval> | undefined;
+ let restarting = false;
+ const dispose = () => {
+ clearInterval(timer);
+ timer = undefined;
+ };
+ const attempt = () => {
+ if (isBusy()) return;
+ restarting = true;
+ dispose();
+ restart();
+ };
+ return {
+ request: () => {
+ if (timer || restarting) return;
+ timer = setInterval(attempt, 250);
+ attempt();
+ },
+ dispose,
+ };
+};
diff --git a/packages/twenty-companion/src/main/utils/createTrayMenuTemplate.ts b/packages/twenty-companion/src/main/utils/createTrayMenuTemplate.ts
new file mode 100644
index 00000000000..a9f18600309
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/createTrayMenuTemplate.ts
@@ -0,0 +1,258 @@
+import { getUpcomingMeetings } from '../../shared/utils/getUpcomingMeetings';
+import { type MenuItemConstructorOptions } from 'electron';
+import { i18n } from '@lingui/core';
+import { type CompanionCommand } from '../../shared/types/CompanionCommand';
+import { type CompanionPage } from '../../shared/types/CompanionPage';
+import { type CompanionState } from '../../shared/types/CompanionState';
+import { type Meeting } from '../../shared/types/Meeting';
+
+type TrayMenuActions = {
+ command: (command: CompanionCommand) => void;
+ openApp: (page?: CompanionPage) => void;
+ setSetting: (key: 'autoJoin', value: boolean) => void;
+ quit: () => void;
+};
+
+i18n.load('en', {});
+i18n.activate('en');
+
+const text = (message: string) => i18n._(message);
+
+const menuLabel = (value: string) =>
+ value.replace(/[\r\n\t]/g, ' ').replace(/&/g, '&&');
+
+type MenuPresentation = {
+ supportsSublabels: boolean;
+ supportsHeaders: boolean;
+ locale?: string;
+};
+
+const meetingTime = (meeting: Meeting, locale?: string) => {
+ const format = (value: string) =>
+ new Date(value).toLocaleTimeString(locale, {
+ hour: '2-digit',
+ minute: '2-digit',
+ });
+ return `${format(meeting.startsAt)} – ${format(meeting.endsAt)}`;
+};
+
+const meetingDay = (meeting: Meeting, now: number, locale?: string) => {
+ const date = new Date(meeting.startsAt);
+ const today = new Date(now);
+ const tomorrow = new Date(now);
+ tomorrow.setDate(tomorrow.getDate() + 1);
+ if (date.toDateString() === today.toDateString()) return text('Today');
+ if (date.toDateString() === tomorrow.toDateString()) return text('Tomorrow');
+ return date.toLocaleDateString(locale, {
+ weekday: 'short',
+ month: 'short',
+ day: 'numeric',
+ });
+};
+
+export const createTrayMenuTemplate = (
+ state: CompanionState,
+ actions: TrayMenuActions,
+ now = Date.now(),
+ presentation: MenuPresentation = {
+ supportsSublabels: false,
+ supportsHeaders: false,
+ },
+): MenuItemConstructorOptions[] => {
+ const connected = state.connection === 'connected';
+ const recording = state.activeRecording;
+ const age = now - Date.parse(state.updatedAt ?? '');
+ const ready = connected && age >= 0 && age <= 90_000;
+ const menu: MenuItemConstructorOptions[] = [
+ {
+ label: text('Open app'),
+ accelerator: state.settings.openShortcut,
+ click: () => actions.openApp(),
+ },
+ ];
+
+ if (recording) {
+ const paused = recording.status === 'paused';
+ const stable = recording.status === 'recording' || paused;
+ menu.push(
+ {
+ label: menuLabel(recording.title),
+ enabled: false,
+ },
+ {
+ label: text(
+ {
+ starting: 'Starting recording…',
+ recording: 'Pause recording',
+ pausing: 'Pausing…',
+ paused: 'Resume recording',
+ resuming: 'Resuming…',
+ stopping: 'Finishing recording…',
+ }[recording.status],
+ ),
+ enabled: stable,
+ click: () => actions.command({ type: paused ? 'resume' : 'pause' }),
+ },
+ {
+ label: text('Finish recording'),
+ enabled: stable,
+ click: () => actions.command({ type: 'stop' }),
+ },
+ );
+ } else if (!connected || !state.settings.setupCompleted) {
+ menu.push({
+ label: text(connected ? 'Continue setup…' : 'Connect workspace…'),
+ enabled: state.connection !== 'connecting',
+ click: () => actions.openApp(),
+ });
+ } else {
+ menu.push({
+ label: text('New recording'),
+ enabled: ready,
+ click: () => actions.command({ type: 'record' }),
+ });
+ }
+
+ if (connected) {
+ const meetings = getUpcomingMeetings({
+ meetings: state.meetings,
+ now: now,
+ }).slice(0, 3);
+ menu.push({ type: 'separator' });
+ if (meetings.length) {
+ const imminent = meetings.filter(
+ (meeting) =>
+ meeting.url && Date.parse(meeting.startsAt) <= now + 10 * 60_000,
+ );
+ if (
+ ready &&
+ imminent.length === 1 &&
+ !recording &&
+ !state.detectedCalls.length
+ ) {
+ const next = imminent[0];
+ menu.push(
+ {
+ label: menuLabel(
+ `${text('Join')} ${next.title.length > 42 ? next.title.slice(0, 41) + '…' : next.title}`,
+ ),
+ toolTip: next.title,
+ click: () => actions.command({ type: 'join', meetingId: next.id }),
+ },
+ { type: 'separator' },
+ );
+ }
+ let previousDay = '';
+ for (const meeting of meetings) {
+ const day = meetingDay(meeting, now, presentation.locale);
+ if (day !== previousDay) {
+ if (previousDay) menu.push({ type: 'separator' });
+ menu.push({
+ label: day,
+ type: presentation.supportsHeaders ? 'header' : 'normal',
+ enabled: false,
+ });
+ previousDay = day;
+ }
+ const minutes = Math.ceil(
+ (Date.parse(meeting.startsAt) - now) / 60_000,
+ );
+ const when = meetingTime(meeting, presentation.locale);
+ const skipped = state.skippedMeetingIds.includes(meeting.id);
+ const title =
+ meeting.title.length > 42
+ ? meeting.title.slice(0, 41) + '…'
+ : meeting.title;
+ const timing =
+ minutes <= 0
+ ? text('Now')
+ : minutes <= 60
+ ? `${text('In')} ${minutes} ${text('min')}`
+ : '';
+ const details = [
+ when,
+ timing,
+ skipped ? text('Auto-join skipped') : '',
+ !meeting.url ? text('No meeting link') : '',
+ ]
+ .filter(Boolean)
+ .join(' · ');
+ menu.push({
+ label: menuLabel(
+ presentation.supportsSublabels ? title : `${details} · ${title}`,
+ ),
+ ...(presentation.supportsSublabels ? { sublabel: details } : {}),
+ accessibilityLabel: `${meeting.title}, ${day}, ${details}`,
+ toolTip: `${meeting.title}\n${day} · ${when}`,
+ submenu: [
+ {
+ label: text(meeting.url ? 'Join meeting' : 'No meeting link'),
+ enabled: ready && !!meeting.url,
+ click: () =>
+ actions.command({ type: 'join', meetingId: meeting.id }),
+ },
+ {
+ label: text(skipped ? 'Restore auto-join' : 'Skip auto-join'),
+ enabled:
+ ready &&
+ !!meeting.url &&
+ state.settings.autoJoin &&
+ Date.parse(meeting.startsAt) > now,
+ click: () =>
+ actions.command({
+ type: skipped ? 'unskip' : 'skip',
+ meetingId: meeting.id,
+ }),
+ },
+ { type: 'separator' },
+ {
+ label: text(
+ !meeting.recordingEnabled
+ ? 'Recording off'
+ : meeting.usesCalendarBot
+ ? 'Calendar bot scheduled'
+ : 'Desktop recording available',
+ ),
+ enabled: false,
+ },
+ ],
+ });
+ }
+ } else {
+ menu.push({ label: text('No upcoming meetings'), enabled: false });
+ }
+ if (!state.calendarConnected) {
+ menu.push({
+ label: text('Connect a calendar…'),
+ click: () => actions.command({ type: 'open-calendar-settings' }),
+ });
+ }
+ }
+ if (state.error) {
+ menu.push({
+ label: text('Something needs your attention…'),
+ click: () => actions.openApp(),
+ });
+ }
+ menu.push(
+ { type: 'separator' },
+ {
+ label: text('Automatically join meetings'),
+ type: 'checkbox',
+ checked: state.settings.autoJoin,
+ enabled: connected,
+ click: () => actions.setSetting('autoJoin', !state.settings.autoJoin),
+ },
+ {
+ label: text('Settings…'),
+ accelerator: 'CommandOrControl+,',
+ click: () => actions.openApp('settings'),
+ },
+ { type: 'separator' },
+ {
+ label: text('Quit'),
+ click: actions.quit,
+ },
+ );
+ return menu;
+};
diff --git a/packages/twenty-companion/src/main/utils/getDesktopInstallationUrl.ts b/packages/twenty-companion/src/main/utils/getDesktopInstallationUrl.ts
new file mode 100644
index 00000000000..ddb2b0a1442
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/getDesktopInstallationUrl.ts
@@ -0,0 +1,18 @@
+import { type OAuthDiscovery } from '../types/OAuthDiscovery';
+import { validateServerUrl } from './validateServerUrl';
+import { requestJson } from './requestJson';
+
+export const getDesktopInstallationUrl = async (
+ serverUrlInput: string,
+): Promise<string> => {
+ const serverUrl = validateServerUrl(serverUrlInput);
+ const discovery = await requestJson<OAuthDiscovery>(
+ `${serverUrl}/.well-known/oauth-authorization-server`,
+ );
+ if (discovery.issuer !== serverUrl)
+ throw new Error('Twenty returned a different OAuth issuer.');
+ const frontendUrl = validateServerUrl(
+ new URL(discovery.authorization_endpoint).origin,
+ );
+ return `${frontendUrl}/settings/applications/available/8bdaaa9f-dc53-4247-a89b-aa386c9b3244`;
+};
diff --git a/packages/twenty-companion/src/main/utils/getTrayTitle.ts b/packages/twenty-companion/src/main/utils/getTrayTitle.ts
new file mode 100644
index 00000000000..4ababc657b9
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/getTrayTitle.ts
@@ -0,0 +1,21 @@
+import { getUpcomingMeetings } from '../../shared/utils/getUpcomingMeetings';
+import { type CompanionState } from '../../shared/types/CompanionState';
+
+export const getTrayTitle = (
+ state: CompanionState,
+ now = Date.now(),
+): string => {
+ if (state.activeRecording)
+ return state.activeRecording.status === 'paused' ? 'Paused' : '●';
+ if (!state.settings.showMeetingCountdown) return '';
+ const next = getUpcomingMeetings({ meetings: state.meetings, now: now })[0];
+ if (!next) return '';
+ const minutes = Math.max(
+ 0,
+ Math.ceil((Date.parse(next.startsAt) - now) / 60_000),
+ );
+ if (minutes <= 60) return `${minutes}m`;
+ const hours = Math.floor(minutes / 60);
+ const remainingMinutes = minutes % 60;
+ return remainingMinutes ? `${hours}h ${remainingMinutes}m` : `${hours}h`;
+};
diff --git a/packages/twenty-companion/src/main/utils/refreshCredentials.ts b/packages/twenty-companion/src/main/utils/refreshCredentials.ts
new file mode 100644
index 00000000000..58c6c4947c6
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/refreshCredentials.ts
@@ -0,0 +1,25 @@
+import { type TokenResponse } from '../types/TokenResponse';
+import { type Credentials } from '../types/Credentials';
+import { requestJson } from './requestJson';
+
+export const refreshCredentials = async (
+ credentials: Credentials,
+): Promise<Credentials> => {
+ const result = await requestJson<TokenResponse>(
+ `${credentials.serverUrl}/oauth/token`,
+ {
+ method: 'POST',
+ body: new URLSearchParams({
+ grant_type: 'refresh_token',
+ refresh_token: credentials.refreshToken,
+ client_id: credentials.clientId,
+ }),
+ },
+ );
+ return {
+ ...credentials,
+ accessToken: result.access_token,
+ refreshToken: result.refresh_token,
+ expiresAt: Date.now() + result.expires_in * 1000,
+ };
+};
diff --git a/packages/twenty-companion/src/main/utils/requestJson.ts b/packages/twenty-companion/src/main/utils/requestJson.ts
new file mode 100644
index 00000000000..d961632b5ce
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/requestJson.ts
@@ -0,0 +1,18 @@
+import { TwentyRequestError } from '../errors/TwentyRequestError';
+
+export const requestJson = async <TResponse = unknown>(
+ url: string,
+ init: RequestInit = {},
+): Promise<TResponse> => {
+ const response = await fetch(url, {
+ ...init,
+ redirect: 'error',
+ signal: init.signal
+ ? AbortSignal.any([init.signal, AbortSignal.timeout(30_000)])
+ : AbortSignal.timeout(30_000),
+ });
+ if (!response.ok) {
+ throw new TwentyRequestError(response.status, url);
+ }
+ return response.json();
+};
diff --git a/packages/twenty-companion/src/main/utils/validateServerUrl.ts b/packages/twenty-companion/src/main/utils/validateServerUrl.ts
new file mode 100644
index 00000000000..333f1a62390
--- /dev/null
+++ b/packages/twenty-companion/src/main/utils/validateServerUrl.ts
@@ -0,0 +1,17 @@
+export const validateServerUrl = (value: string): string => {
+ const url = new URL(value);
+ const loopback = ['localhost', '127.0.0.1'].includes(url.hostname);
+ if (
+ (url.protocol !== 'https:' && !(url.protocol === 'http:' && loopback)) ||
+ url.username ||
+ url.password ||
+ url.search ||
+ url.hash ||
+ url.pathname !== '/'
+ ) {
+ throw new Error(
+ 'Enter your Twenty workspace URL, using HTTPS or localhost.',
+ );
+ }
+ return url.origin;
+};
diff --git a/packages/twenty-companion/src/main/validation-schemas/credentialsSchema.ts b/packages/twenty-companion/src/main/validation-schemas/credentialsSchema.ts
new file mode 100644
index 00000000000..f0c27bcff51
--- /dev/null
+++ b/packages/twenty-companion/src/main/validation-schemas/credentialsSchema.ts
@@ -0,0 +1,9 @@
+import { z } from 'zod';
+
+export const credentialsSchema = z.object({
+ serverUrl: z.string().url(),
+ clientId: z.string(),
+ accessToken: z.string(),
+ refreshToken: z.string(),
+ expiresAt: z.number(),
+});
diff --git a/packages/twenty-companion/src/renderer/assets.d.ts b/packages/twenty-companion/src/renderer/assets.d.ts
new file mode 100644
index 00000000000..dd12ad12e3d
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/assets.d.ts
@@ -0,0 +1,5 @@
+declare module '*.svg?react' {
+ import { type FunctionComponent, type SVGProps } from 'react';
+ const component: FunctionComponent<SVGProps<SVGSVGElement>>;
+ export default component;
+}
diff --git a/packages/twenty-companion/src/renderer/assets/onboarding-clouds.png b/packages/twenty-companion/src/renderer/assets/onboarding-clouds.png
new file mode 100644
index 00000000000..cfa35b2b0d5
Binary files /dev/null and b/packages/twenty-companion/src/renderer/assets/onboarding-clouds.png differ
diff --git a/packages/twenty-companion/src/renderer/assets/twenty-logo.svg b/packages/twenty-companion/src/renderer/assets/twenty-logo.svg
new file mode 100644
index 00000000000..bb5819bc266
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/assets/twenty-logo.svg
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="96px" height="96px" viewBox="0 0 96 96" version="1.1">
+<defs>
+<clipPath id="clip1">
+ <path d="M 11.292969 0 L 84.707031 0 C 90.945312 0 96 5.054688 96 11.292969 L 96 84.707031 C 96 90.945312 90.945312 96 84.707031 96 L 11.292969 96 C 5.054688 96 0 90.945312 0 84.707031 L 0 11.292969 C 0 5.054688 5.054688 0 11.292969 0 Z M 11.292969 0 "/>
+</clipPath>
+<clipPath id="clip2">
+ <path d="M 19 26 L 48 26 L 48 45 L 19 45 Z M 19 26 "/>
+</clipPath>
+<clipPath id="clip3">
+ <path d="M 11.292969 0 L 84.707031 0 C 90.945312 0 96 5.054688 96 11.292969 L 96 84.707031 C 96 90.945312 90.945312 96 84.707031 96 L 11.292969 96 C 5.054688 96 0 90.945312 0 84.707031 L 0 11.292969 C 0 5.054688 5.054688 0 11.292969 0 Z M 11.292969 0 "/>
+</clipPath>
+<clipPath id="clip4">
+ <path d="M 19 26 L 77 26 L 77 70 L 19 70 Z M 19 26 "/>
+</clipPath>
+<clipPath id="clip5">
+ <path d="M 11.292969 0 L 84.707031 0 C 90.945312 0 96 5.054688 96 11.292969 L 96 84.707031 C 96 90.945312 90.945312 96 84.707031 96 L 11.292969 96 C 5.054688 96 0 90.945312 0 84.707031 L 0 11.292969 C 0 5.054688 5.054688 0 11.292969 0 Z M 11.292969 0 "/>
+</clipPath>
+</defs>
+<g id="surface1">
+<g clip-path="url(#clip1)" clip-rule="nonzero">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 96 0 L 0 0 L 0 96 L 96 96 Z M 19.25 35.746094 C 19.25 30.5 23.507812 26.246094 28.75 26.246094 L 47.039062 26.246094 C 47.308594 26.246094 47.554688 26.40625 47.667969 26.652344 C 47.78125 26.902344 47.730469 27.191406 47.546875 27.394531 L 43.539062 31.75 C 42.839844 32.507812 41.859375 32.945312 40.828125 32.945312 L 28.800781 32.945312 C 27.226562 32.945312 25.949219 34.222656 25.949219 35.796875 L 25.949219 42.980469 C 25.949219 43.90625 25.199219 44.652344 24.273438 44.652344 L 20.929688 44.652344 C 20.003906 44.652344 19.257812 43.90625 19.257812 42.980469 L 19.257812 35.746094 Z M 76.152344 60.253906 C 76.152344 65.5 71.894531 69.753906 66.648438 69.753906 L 58.878906 69.753906 C 53.632812 69.753906 49.375 65.5 49.375 60.253906 L 49.375 46.652344 C 49.375 45.726562 49.722656 44.835938 50.351562 44.152344 L 54.882812 39.234375 C 55.074219 39.027344 55.371094 38.957031 55.636719 39.054688 C 55.898438 39.164062 56.074219 39.410156 56.074219 39.691406 L 56.074219 60.210938 C 56.074219 61.785156 57.351562 63.0625 58.925781 63.0625 L 66.605469 63.0625 C 68.179688 63.0625 69.457031 61.785156 69.457031 60.210938 L 69.457031 35.796875 C 69.457031 34.222656 68.179688 32.945312 66.605469 32.945312 L 57.675781 32.945312 C 56.652344 32.945312 55.679688 33.375 54.980469 34.121094 L 28.347656 63.0625 L 44.351562 63.0625 C 45.273438 63.0625 46.023438 63.8125 46.023438 64.738281 L 46.023438 68.082031 C 46.023438 69.007812 45.273438 69.753906 44.351562 69.753906 L 22.785156 69.753906 C 20.832031 69.753906 19.242188 68.167969 19.242188 66.210938 L 19.242188 64.441406 C 19.242188 63.550781 19.574219 62.695312 20.179688 62.039062 L 50.039062 29.605469 C 52.015625 27.457031 54.789062 26.246094 57.707031 26.246094 L 66.640625 26.246094 C 71.886719 26.246094 76.144531 30.5 76.144531 35.746094 L 76.144531 60.253906 Z M 76.152344 60.253906 "/>
+</g>
+<g clip-path="url(#clip2)" clip-rule="nonzero">
+<g clip-path="url(#clip3)" clip-rule="nonzero">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 19.25 35.746094 C 19.25 30.5 23.507812 26.246094 28.75 26.246094 L 47.039062 26.246094 C 47.308594 26.246094 47.554688 26.40625 47.667969 26.652344 C 47.78125 26.902344 47.730469 27.191406 47.546875 27.394531 L 43.539062 31.75 C 42.839844 32.507812 41.859375 32.945312 40.828125 32.945312 L 28.800781 32.945312 C 27.226562 32.945312 25.949219 34.222656 25.949219 35.796875 L 25.949219 42.980469 C 25.949219 43.90625 25.199219 44.652344 24.273438 44.652344 L 20.929688 44.652344 C 20.003906 44.652344 19.257812 43.90625 19.257812 42.980469 L 19.257812 35.746094 Z M 19.25 35.746094 "/>
+</g>
+</g>
+<g clip-path="url(#clip4)" clip-rule="nonzero">
+<g clip-path="url(#clip5)" clip-rule="nonzero">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 76.152344 60.253906 C 76.152344 65.5 71.894531 69.753906 66.648438 69.753906 L 58.878906 69.753906 C 53.632812 69.753906 49.375 65.5 49.375 60.253906 L 49.375 46.652344 C 49.375 45.726562 49.722656 44.835938 50.351562 44.152344 L 54.882812 39.234375 C 55.074219 39.027344 55.371094 38.957031 55.636719 39.054688 C 55.898438 39.164062 56.074219 39.410156 56.074219 39.691406 L 56.074219 60.210938 C 56.074219 61.785156 57.351562 63.0625 58.925781 63.0625 L 66.605469 63.0625 C 68.179688 63.0625 69.457031 61.785156 69.457031 60.210938 L 69.457031 35.796875 C 69.457031 34.222656 68.179688 32.945312 66.605469 32.945312 L 57.675781 32.945312 C 56.652344 32.945312 55.679688 33.375 54.980469 34.121094 L 28.347656 63.0625 L 44.351562 63.0625 C 45.273438 63.0625 46.023438 63.8125 46.023438 64.738281 L 46.023438 68.082031 C 46.023438 69.007812 45.273438 69.753906 44.351562 69.753906 L 22.785156 69.753906 C 20.832031 69.753906 19.242188 68.167969 19.242188 66.210938 L 19.242188 64.441406 C 19.242188 63.550781 19.574219 62.695312 20.179688 62.039062 L 50.039062 29.605469 C 52.015625 27.457031 54.789062 26.246094 57.707031 26.246094 L 66.640625 26.246094 C 71.886719 26.246094 76.144531 30.5 76.144531 35.746094 L 76.144531 60.253906 Z M 76.152344 60.253906 "/>
+</g>
+</g>
+</g>
+</svg>
diff --git a/packages/twenty-companion/src/renderer/assets/twenty-mark.svg b/packages/twenty-companion/src/renderer/assets/twenty-mark.svg
new file mode 100644
index 00000000000..01a0adfce2b
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/assets/twenty-mark.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><path fill="white" d="M 19.25 35.746094 C 19.25 30.5 23.507812 26.246094 28.75 26.246094 L 47.039062 26.246094 C 47.308594 26.246094 47.554688 26.40625 47.667969 26.652344 C 47.78125 26.902344 47.730469 27.191406 47.546875 27.394531 L 43.539062 31.75 C 42.839844 32.507812 41.859375 32.945312 40.828125 32.945312 L 28.800781 32.945312 C 27.226562 32.945312 25.949219 34.222656 25.949219 35.796875 L 25.949219 42.980469 C 25.949219 43.90625 25.199219 44.652344 24.273438 44.652344 L 20.929688 44.652344 C 20.003906 44.652344 19.257812 43.90625 19.257812 42.980469 L 19.257812 35.746094 Z M 19.25 35.746094 "/><path fill="white" d="M 76.152344 60.253906 C 76.152344 65.5 71.894531 69.753906 66.648438 69.753906 L 58.878906 69.753906 C 53.632812 69.753906 49.375 65.5 49.375 60.253906 L 49.375 46.652344 C 49.375 45.726562 49.722656 44.835938 50.351562 44.152344 L 54.882812 39.234375 C 55.074219 39.027344 55.371094 38.957031 55.636719 39.054688 C 55.898438 39.164062 56.074219 39.410156 56.074219 39.691406 L 56.074219 60.210938 C 56.074219 61.785156 57.351562 63.0625 58.925781 63.0625 L 66.605469 63.0625 C 68.179688 63.0625 69.457031 61.785156 69.457031 60.210938 L 69.457031 35.796875 C 69.457031 34.222656 68.179688 32.945312 66.605469 32.945312 L 57.675781 32.945312 C 56.652344 32.945312 55.679688 33.375 54.980469 34.121094 L 28.347656 63.0625 L 44.351562 63.0625 C 45.273438 63.0625 46.023438 63.8125 46.023438 64.738281 L 46.023438 68.082031 C 46.023438 69.007812 45.273438 69.753906 44.351562 69.753906 L 22.785156 69.753906 C 20.832031 69.753906 19.242188 68.167969 19.242188 66.210938 L 19.242188 64.441406 C 19.242188 63.550781 19.574219 62.695312 20.179688 62.039062 L 50.039062 29.605469 C 52.015625 27.457031 54.789062 26.246094 57.707031 26.246094 L 66.640625 26.246094 C 71.886719 26.246094 76.144531 30.5 76.144531 35.746094 L 76.144531 60.253906 Z M 76.152344 60.253906 "/></svg>
diff --git a/packages/twenty-companion/src/renderer/components/CalendarDayLabel.module.scss b/packages/twenty-companion/src/renderer/components/CalendarDayLabel.module.scss
new file mode 100644
index 00000000000..f13f5ad845a
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/CalendarDayLabel.module.scss
@@ -0,0 +1,25 @@
+.label {
+ text-align: center;
+ width: var(--t-spacing-6);
+ font-family: var(--t-font-family);
+ font-size: var(--t-font-size-md);
+ color: var(--t-font-color-primary);
+}
+.weekday {
+ color: var(--t-font-color-tertiary);
+ font-size: var(--t-font-size-xxs);
+ font-weight: var(--t-font-weight-semi-bold);
+}
+.day {
+ font-weight: var(--t-font-weight-medium);
+}
+.indicator {
+ background: var(--t-tag-background-gray);
+ border-radius: var(--t-border-radius-xs);
+ height: 100%;
+ width: var(--t-spacing-1);
+ flex-shrink: 0;
+}
+.indicator[data-active] {
+ background: var(--t-tag-background-red);
+}
diff --git a/packages/twenty-companion/src/renderer/components/CalendarDayLabel.module.scss.d.ts b/packages/twenty-companion/src/renderer/components/CalendarDayLabel.module.scss.d.ts
new file mode 100644
index 00000000000..5f5c2a0d699
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/CalendarDayLabel.module.scss.d.ts
@@ -0,0 +1,7 @@
+declare const styles: {
+ readonly indicator: string;
+ readonly label: string;
+ readonly weekday: string;
+ readonly day: string;
+};
+export default styles;
diff --git a/packages/twenty-companion/src/renderer/components/CalendarDayLabel.tsx b/packages/twenty-companion/src/renderer/components/CalendarDayLabel.tsx
new file mode 100644
index 00000000000..e13399ea9b1
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/CalendarDayLabel.tsx
@@ -0,0 +1,10 @@
+import styles from './CalendarDayLabel.module.scss';
+
+type CalendarDayLabelProps = { weekday: string; day: string };
+
+export const CalendarDayLabel = ({ weekday, day }: CalendarDayLabelProps) => (
+ <div className={styles.label}>
+ <div className={styles.weekday}>{weekday}</div>
+ <div className={styles.day}>{day}</div>
+ </div>
+);
diff --git a/packages/twenty-companion/src/renderer/components/CalendarEventIndicator.tsx b/packages/twenty-companion/src/renderer/components/CalendarEventIndicator.tsx
new file mode 100644
index 00000000000..eb4e7555791
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/CalendarEventIndicator.tsx
@@ -0,0 +1,15 @@
+import { clsx } from 'clsx';
+import styles from './CalendarDayLabel.module.scss';
+
+type CalendarEventIndicatorProps = { active?: boolean; className?: string };
+
+export const CalendarEventIndicator = ({
+ active,
+ className,
+}: CalendarEventIndicatorProps) => (
+ <div
+ aria-hidden
+ className={clsx(styles.indicator, className)}
+ data-active={active || undefined}
+ />
+);
diff --git a/packages/twenty-companion/src/renderer/components/CompanionApp.tsx b/packages/twenty-companion/src/renderer/components/CompanionApp.tsx
new file mode 100644
index 00000000000..10ba646c580
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/CompanionApp.tsx
@@ -0,0 +1,133 @@
+import { i18n } from '@lingui/core';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import {
+ IconRefresh,
+ IconCircleDot,
+ IconHome,
+ IconSettings,
+} from 'twenty-ui/icon';
+import { NavigationModeSwitcher } from './NavigationModeSwitcher';
+import { useCompanion } from '../hooks/useCompanion';
+import { IS_PREVIEW } from '../constants/IS_PREVIEW';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { Empty } from './Empty';
+import { Notice } from './Notice';
+import { RecordingControls } from './RecordingControls';
+import { Onboarding } from './Onboarding';
+import { Home } from './Home';
+import { Settings } from './Settings';
+import { HalftoneBackground } from './HalftoneBackground';
+import { CompanionTheme } from './CompanionTheme';
+
+export const CompanionApp = () => {
+ const { state, isPending, loaded, command, page, navigate } = useCompanion();
+ const connected = state.connection === 'connected';
+ const setup =
+ connected && (!state.settings.setupCompleted || !!state.permissionSetup);
+ const onboarding = !connected || setup;
+ return (
+ <CompanionTheme appearance={state.settings.appearance}>
+ <main className={'app-shell ' + (onboarding ? 'onboarding' : '')}>
+ <div className="main-area">
+ {onboarding && <HalftoneBackground />}
+ <header
+ className={
+ 'titlebar ' +
+ (onboarding ? 'setup-titlebar ' : '') +
+ (window.companion && navigator.platform.startsWith('Mac')
+ ? 'mac-titlebar'
+ : '')
+ }
+ >
+ {!onboarding && (
+ <div className="header-navigation">
+ <NavigationModeSwitcher
+ ariaLabel={i18n._('Navigation modes')}
+ size="medium"
+ activeItemName={page === 'settings' ? 'settings' : 'home'}
+ items={[
+ {
+ name: 'home',
+ label: i18n._('Home'),
+ Icon: IconHome,
+ onClick: () => navigate('agenda'),
+ },
+ {
+ name: 'settings',
+ label: i18n._('Settings'),
+ Icon: IconSettings,
+ onClick: () => navigate('settings'),
+ },
+ ]}
+ />
+ </div>
+ )}
+ {!onboarding && (
+ <div className="button-group">
+ <Button
+ variant="primary"
+ accent="blue"
+ size="medium"
+ disabled={
+ isPending('record') ||
+ !!state.activeRecording ||
+ !state.updatedAt
+ }
+ onClick={() => void command({ type: 'record' })}
+ Icon={IconCircleDot}
+ title={i18n._('New recording')}
+ />
+ </div>
+ )}
+ </header>
+ {IS_PREVIEW && (
+ <div className="preview-label">
+ {i18n._(
+ 'Interactive preview · sample data · no audio is captured',
+ )}
+ </div>
+ )}
+ <Notice state={state} command={command} isPending={isPending} />
+ <div className="scroll-area">
+ {!loaded ? (
+ <Empty
+ icon={
+ <IconRefresh
+ size={THEME_COMMON.icon.size.xl}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={i18n._('Opening your workspace')}
+ >
+ <p>{i18n._('Loading your calendar and conversations…')}</p>
+ </Empty>
+ ) : onboarding ? (
+ <Onboarding
+ state={state}
+ isPending={isPending}
+ command={command}
+ />
+ ) : (
+ <div className="page-content">
+ <RecordingControls
+ state={state}
+ isPending={isPending}
+ command={command}
+ />
+ {page === 'settings' ? (
+ <Settings
+ state={state}
+ isPending={isPending}
+ command={command}
+ />
+ ) : (
+ <Home state={state} isPending={isPending} command={command} />
+ )}
+ </div>
+ )}
+ </div>
+ </div>
+ </main>
+ </CompanionTheme>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/CompanionTheme.tsx b/packages/twenty-companion/src/renderer/components/CompanionTheme.tsx
new file mode 100644
index 00000000000..051d6b039ad
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/CompanionTheme.tsx
@@ -0,0 +1,30 @@
+import { type ReactNode, useSyncExternalStore } from 'react';
+import { ThemeProvider } from '@ui/theme-constants/ThemeProvider';
+import '@ui/theme-constants/theme-light.css';
+import '@ui/theme-constants/theme-dark.css';
+import '@fontsource/inter/latin-400.css';
+import '@fontsource/inter/latin-500.css';
+import '@fontsource/inter/latin-600.css';
+import { type Settings } from '../../shared/types/Settings';
+
+const subscribe = (listener: () => void) => {
+ const query = window.matchMedia('(prefers-color-scheme: dark)');
+ query.addEventListener('change', listener);
+ return () => query.removeEventListener('change', listener);
+};
+
+const getSnapshot = () =>
+ window.matchMedia('(prefers-color-scheme: dark)').matches;
+
+export const CompanionTheme = ({
+ appearance,
+ children,
+}: {
+ appearance: Settings['appearance'];
+ children: ReactNode;
+}) => {
+ const systemDark = useSyncExternalStore(subscribe, getSnapshot);
+ const colorScheme =
+ appearance === 'system' ? (systemDark ? 'dark' : 'light') : appearance;
+ return <ThemeProvider colorScheme={colorScheme}>{children}</ThemeProvider>;
+};
diff --git a/packages/twenty-companion/src/renderer/components/Empty.tsx b/packages/twenty-companion/src/renderer/components/Empty.tsx
new file mode 100644
index 00000000000..22a1f3b9cbe
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Empty.tsx
@@ -0,0 +1,32 @@
+import {
+ AnimatedPlaceholder,
+ type AnimatedPlaceholderType,
+} from '@ui/primitives/feedback/AnimatedPlaceholder/AnimatedPlaceholder';
+import { type ReactNode } from 'react';
+
+export const Empty = ({
+ icon,
+ animatedPlaceholderType,
+ title,
+ children,
+ actions,
+}: {
+ icon?: ReactNode;
+ animatedPlaceholderType?: AnimatedPlaceholderType;
+ title: string;
+ children: ReactNode;
+ actions?: ReactNode;
+}) => (
+ <div className="empty">
+ {animatedPlaceholderType ? (
+ <AnimatedPlaceholder type={animatedPlaceholderType} assetBasePath="." />
+ ) : (
+ <span className="empty-icon">{icon}</span>
+ )}
+ <div className="empty-copy">
+ <h2>{title}</h2>
+ <div className="muted">{children}</div>
+ </div>
+ {actions != null && <div className="empty-actions">{actions}</div>}
+ </div>
+);
diff --git a/packages/twenty-companion/src/renderer/components/HalftoneBackground.tsx b/packages/twenty-companion/src/renderer/components/HalftoneBackground.tsx
new file mode 100644
index 00000000000..5ceb5bc0a54
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/HalftoneBackground.tsx
@@ -0,0 +1,67 @@
+import { useEffect, useRef } from 'react';
+import { createHalftone } from '../utils/createHalftone';
+import cloudImageUrl from '../assets/onboarding-clouds.png';
+
+const useHalftoneBackground = () => {
+ const canvasReference = useRef<HTMLCanvasElement>(null);
+
+ useEffect(() => {
+ const canvas = canvasReference.current;
+ if (!canvas) return;
+ const image = new Image();
+ let disposed = false;
+ let disposeRenderer: (() => void) | undefined;
+
+ const start = () => {
+ if (disposed) return;
+ disposeRenderer?.();
+ disposeRenderer = undefined;
+ try {
+ disposeRenderer = createHalftone(canvas, image);
+ } catch (error) {
+ console.warn('Could not render the onboarding background.', error);
+ }
+ };
+ const onContextLost = (event: Event) => {
+ event.preventDefault();
+ disposeRenderer?.();
+ disposeRenderer = undefined;
+ };
+
+ canvas.addEventListener('webglcontextlost', onContextLost);
+ canvas.addEventListener('webglcontextrestored', start);
+ image.src = cloudImageUrl;
+ void image
+ .decode()
+ .then(start)
+ .catch((error: unknown) => {
+ if (image.complete && image.naturalWidth > 0) {
+ start();
+ return;
+ }
+ if (!disposed)
+ console.warn('Could not load the onboarding background.', error);
+ });
+
+ return () => {
+ disposed = true;
+ disposeRenderer?.();
+ canvas.removeEventListener('webglcontextlost', onContextLost);
+ canvas.removeEventListener('webglcontextrestored', start);
+ };
+ }, []);
+
+ return canvasReference;
+};
+
+export const HalftoneBackground = () => {
+ const canvasReference = useHalftoneBackground();
+
+ return (
+ <canvas
+ className="halftone-background"
+ ref={canvasReference}
+ aria-hidden="true"
+ />
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/Home.tsx b/packages/twenty-companion/src/renderer/components/Home.tsx
new file mode 100644
index 00000000000..bb3fead8f53
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Home.tsx
@@ -0,0 +1,160 @@
+import { useNow } from '../hooks/useNow';
+import { MeetingRow } from './MeetingRow';
+import { i18n } from '@lingui/core';
+import { SettingsCardContent } from './SettingsCardContent';
+import { H2Title } from '@ui/primitives/typography/H2Title/H2Title';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import { Card } from '@ui/primitives/surfaces/Card/Card';
+import { CalendarDayLabel } from './CalendarDayLabel';
+import { useState } from 'react';
+import {
+ IconCalendarEvent,
+ IconArrowUpRight,
+ IconChevronRight,
+} from 'twenty-ui/icon';
+import { getUpcomingMeetings } from '../../shared/utils/getUpcomingMeetings';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { type ActionProps } from '../types/ActionProps';
+import { RecordingList } from './RecordingList';
+
+const UpcomingMeetings = ({ state, isPending, command }: ActionProps) => {
+ const [showAllMeetings, setShowAllMeetings] = useState(false);
+ const now = useNow(1000);
+ const meetings = getUpcomingMeetings({ meetings: state.meetings, now: now });
+ const calendarTitle = new Date(
+ meetings[0]?.startsAt ?? now,
+ ).toLocaleDateString([], { month: 'long' });
+ const visibleMeetings = showAllMeetings ? meetings : meetings.slice(0, 3);
+ const meetingDays = new Map<string, typeof visibleMeetings>();
+ for (const meeting of visibleMeetings) {
+ const day = new Date(meeting.startsAt).toDateString();
+ const dayMeetings = meetingDays.get(day) ?? [];
+ dayMeetings.push(meeting);
+ meetingDays.set(day, dayMeetings);
+ }
+ return (
+ <section aria-label={calendarTitle}>
+ <H2Title title={calendarTitle} />
+ {meetings.length ? (
+ <>
+ <Card
+ className="agenda-list"
+ backgroundColor="var(--t-background-secondary)"
+ >
+ {Array.from(meetingDays, ([day, dayMeetings]) => (
+ <div className="agenda-day" key={day}>
+ <time
+ className="agenda-date"
+ dateTime={dayMeetings[0].startsAt}
+ aria-label={new Date(
+ dayMeetings[0].startsAt,
+ ).toLocaleDateString([], { dateStyle: 'full' })}
+ >
+ <CalendarDayLabel
+ weekday={new Date(
+ dayMeetings[0].startsAt,
+ ).toLocaleDateString([], {
+ weekday: 'short',
+ })}
+ day={new Date(dayMeetings[0].startsAt).toLocaleDateString(
+ [],
+ { day: 'numeric' },
+ )}
+ />
+ </time>
+ <div className="agenda-day-meetings">
+ {dayMeetings.map((meeting) => (
+ <MeetingRow
+ key={meeting.id}
+ meeting={meeting}
+ skipped={state.skippedMeetingIds.includes(meeting.id)}
+ isNext={meeting.id === meetings[0]?.id}
+ autoJoin={state.settings.autoJoin}
+ now={now}
+ command={command}
+ isPending={isPending}
+ />
+ ))}
+ </div>
+ </div>
+ ))}
+ </Card>
+ {meetings.length > 3 && (
+ <div>
+ <Button
+ variant="tertiary"
+ className="see-more"
+ ariaExpanded={showAllMeetings}
+ onClick={() => setShowAllMeetings(!showAllMeetings)}
+ size="medium"
+ title={
+ showAllMeetings ? i18n._('Show less') : i18n._('See more')
+ }
+ Icon={IconChevronRight}
+ />
+ </div>
+ )}
+ </>
+ ) : (
+ <Card backgroundColor="var(--t-background-secondary)">
+ <SettingsCardContent
+ icon={
+ <IconCalendarEvent
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={
+ state.calendarConnected
+ ? i18n._('Your calendar is clear')
+ : i18n._('Bring your calendar along')
+ }
+ description={
+ state.calendarConnected
+ ? i18n._('Start a recording for an unscheduled conversation.')
+ : i18n._(
+ 'Connect a calendar in Twenty to see your upcoming meetings.',
+ )
+ }
+ >
+ {!state.calendarConnected && (
+ <Button
+ onClick={() => void command({ type: 'open-calendar-settings' })}
+ variant="secondary"
+ size="medium"
+ title={i18n._('Connect calendar')}
+ Icon={IconArrowUpRight}
+ />
+ )}
+ </SettingsCardContent>
+ </Card>
+ )}
+ </section>
+ );
+};
+
+export const Home = ({ state, command, isPending }: ActionProps) => {
+ return (
+ <>
+ <UpcomingMeetings state={state} command={command} isPending={isPending} />
+ <section
+ className="section recordings-section"
+ aria-label={i18n._('Recordings')}
+ >
+ <H2Title
+ title={i18n._('Recordings')}
+ adornment={
+ <Button
+ variant="tertiary"
+ title={i18n._('View all in Twenty')}
+ Icon={IconArrowUpRight}
+ disabled={isPending('open-recordings')}
+ onClick={() => void command({ type: 'open-recordings' })}
+ />
+ }
+ />
+ <RecordingList state={state} isPending={isPending} command={command} />
+ </section>
+ </>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/MeetingRow.module.scss b/packages/twenty-companion/src/renderer/components/MeetingRow.module.scss
new file mode 100644
index 00000000000..03fa75a585f
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/MeetingRow.module.scss
@@ -0,0 +1,9 @@
+.popup {
+ backdrop-filter: var(--t-blur-medium);
+ background: var(--t-background-transparent-primary);
+ border: 1px solid var(--t-border-color-medium);
+ border-radius: var(--t-border-radius-md);
+ box-shadow: var(--t-box-shadow-strong);
+ overflow: hidden;
+ padding: var(--t-spacing-1);
+}
diff --git a/packages/twenty-companion/src/renderer/components/MeetingRow.module.scss.d.ts b/packages/twenty-companion/src/renderer/components/MeetingRow.module.scss.d.ts
new file mode 100644
index 00000000000..12672df8d89
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/MeetingRow.module.scss.d.ts
@@ -0,0 +1,4 @@
+declare const styles: {
+ readonly popup: string;
+};
+export default styles;
diff --git a/packages/twenty-companion/src/renderer/components/MeetingRow.tsx b/packages/twenty-companion/src/renderer/components/MeetingRow.tsx
new file mode 100644
index 00000000000..a1231d56d9d
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/MeetingRow.tsx
@@ -0,0 +1,125 @@
+import { i18n } from '@lingui/core';
+import { Menu } from '@base-ui/react/menu';
+import { CalendarEventIndicator } from './CalendarEventIndicator';
+import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { MenuItem } from '@ui/primitives/navigation/MenuItem/MenuItem';
+import styles from './MeetingRow.module.scss';
+import {
+ IconCalendarEvent,
+ IconCalendarX,
+ IconDotsVertical,
+ IconArrowUpRight,
+} from 'twenty-ui/icon';
+import { type Meeting } from '../../shared/types/Meeting';
+import { type ActionProps } from '../types/ActionProps';
+import { formatTime } from '../utils/formatTime';
+
+type MeetingRowProps = Pick<ActionProps, 'command' | 'isPending'> & {
+ meeting: Meeting;
+ skipped: boolean;
+ isNext: boolean;
+ autoJoin: boolean;
+ now: number;
+};
+
+export const MeetingRow = ({
+ meeting,
+ skipped,
+ isNext,
+ autoJoin,
+ now,
+ command,
+ isPending,
+}: MeetingRowProps) => (
+ <div className="agenda-row" data-next={isNext || undefined}>
+ <div className="grow agenda-meeting-details">
+ <CalendarEventIndicator className="agenda-event-indicator" />
+ <strong>{meeting.title}</strong>
+ <span
+ className="small muted"
+ title={
+ skipped
+ ? i18n._('Auto-join skipped')
+ : meeting.usesCalendarBot
+ ? i18n._('Calendar bot recording')
+ : meeting.recordingEnabled
+ ? i18n._('Desktop recording available')
+ : i18n._('Recording is off')
+ }
+ >
+ {formatTime(meeting.startsAt)} – {formatTime(meeting.endsAt)}
+ {(skipped || !meeting.recordingEnabled || meeting.usesCalendarBot) && (
+ <>
+ {' '}
+ ·{' '}
+ {skipped
+ ? i18n._('Auto-join skipped')
+ : meeting.usesCalendarBot
+ ? i18n._('Calendar bot')
+ : i18n._('Recording off')}
+ </>
+ )}
+ </span>
+ </div>
+ <div className="agenda-actions">
+ {autoJoin && meeting.url && Date.parse(meeting.startsAt) > now && (
+ <Menu.Root>
+ <Menu.Trigger
+ render={
+ <IconButton
+ variant="tertiary"
+ Icon={IconDotsVertical}
+ size="medium"
+ ariaLabel={i18n._('Meeting options')}
+ />
+ }
+ />
+ <Menu.Portal>
+ <Menu.Positioner
+ side="bottom"
+ align="end"
+ sideOffset={4}
+ className="meeting-menu"
+ >
+ <Menu.Popup className={styles.popup}>
+ <Menu.Item
+ disabled={isPending('skip', 'unskip')}
+ onClick={() =>
+ void command({
+ type: skipped ? 'unskip' : 'skip',
+ meetingId: meeting.id,
+ })
+ }
+ >
+ <MenuItem
+ disabled={isPending('skip', 'unskip')}
+ LeftIcon={skipped ? IconCalendarEvent : IconCalendarX}
+ text={
+ skipped
+ ? i18n._('Restore auto-join')
+ : i18n._('Skip auto-join')
+ }
+ />
+ </Menu.Item>
+ </Menu.Popup>
+ </Menu.Positioner>
+ </Menu.Portal>
+ </Menu.Root>
+ )}
+ <Button
+ disabled={!meeting.url || isPending('join')}
+ onClick={() =>
+ void command({
+ type: 'join',
+ meetingId: meeting.id,
+ })
+ }
+ variant="secondary"
+ size="medium"
+ title={i18n._('Join')}
+ Icon={IconArrowUpRight}
+ />
+ </div>
+ </div>
+);
diff --git a/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.module.scss b/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.module.scss
new file mode 100644
index 00000000000..02395d729c9
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.module.scss
@@ -0,0 +1,72 @@
+.container {
+ align-items: center;
+ display: flex;
+ gap: var(--t-spacing-0_5);
+}
+.mode {
+ align-items: center;
+ background: transparent;
+ border: none;
+ border-radius: var(--t-border-radius-sm-round);
+ color: var(--t-font-color-tertiary);
+ corner-shape: round;
+ cursor: pointer;
+ display: flex;
+ flex-shrink: 0;
+ font-family: inherit;
+ font-size: var(--t-font-size-md);
+ font-weight: var(--t-font-weight-medium);
+ gap: 0;
+ height: var(--t-spacing-7);
+ padding: 0 var(--t-spacing-1_5);
+ transition:
+ background duration(fast) ease,
+ color duration(fast) ease,
+ gap duration(normal) ease;
+ &[data-size='medium'] {
+ height: var(--t-spacing-8);
+ }
+ &[data-active] {
+ background: var(--t-background-transparent-light);
+ color: var(--t-font-color-primary);
+ gap: var(--t-spacing-1);
+ }
+ &:hover {
+ background: var(--t-background-transparent-lighter);
+ color: var(--t-font-color-primary);
+ }
+ &[data-active]:hover {
+ background: var(--t-background-transparent-light);
+ }
+ &:focus-visible {
+ outline: 2px solid var(--t-color-blue);
+ outline-offset: 2px;
+ }
+}
+.icon {
+ align-items: center;
+ display: flex;
+ flex-shrink: 0;
+ height: var(--t-spacing-4);
+ justify-content: center;
+ width: var(--t-spacing-4);
+}
+.label {
+ display: grid;
+ grid-template-columns: 0fr;
+ transition: grid-template-columns duration(normal) ease;
+}
+.mode[data-active] .label {
+ grid-template-columns: 1fr;
+}
+.labelText {
+ min-width: 0;
+ overflow: hidden;
+ white-space: nowrap;
+}
+@media (prefers-reduced-motion: reduce) {
+ .mode,
+ .label {
+ transition: none;
+ }
+}
diff --git a/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.module.scss.d.ts b/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.module.scss.d.ts
new file mode 100644
index 00000000000..556b7bc4d0f
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.module.scss.d.ts
@@ -0,0 +1,8 @@
+declare const styles: {
+ readonly container: string;
+ readonly mode: string;
+ readonly icon: string;
+ readonly label: string;
+ readonly labelText: string;
+};
+export default styles;
diff --git a/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.tsx b/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.tsx
new file mode 100644
index 00000000000..477012b221d
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/NavigationModeSwitcher.tsx
@@ -0,0 +1,46 @@
+import { type IconComponent } from '@ui/icon/types/IconComponent';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import styles from './NavigationModeSwitcher.module.scss';
+
+type NavigationModeSwitcherProps = {
+ activeItemName: string;
+ ariaLabel: string;
+ size?: 'small' | 'medium';
+ items: {
+ name: string;
+ label: string;
+ Icon: IconComponent;
+ onClick: () => void;
+ }[];
+};
+
+export const NavigationModeSwitcher = ({
+ activeItemName,
+ ariaLabel,
+ items,
+ size = 'small',
+}: NavigationModeSwitcherProps) => (
+ <div className={styles.container} role="group" aria-label={ariaLabel}>
+ {items.map(({ name, label, Icon, onClick }) => {
+ const isActive = name === activeItemName;
+ return (
+ <button
+ key={name}
+ type="button"
+ className={styles.mode}
+ data-active={isActive || undefined}
+ data-size={size}
+ aria-current={isActive}
+ onClick={onClick}
+ >
+ <span className={styles.icon}>
+ <Icon size={THEME_COMMON.icon.size.md} aria-hidden />
+ </span>
+ <span className={styles.label}>
+ <span className={styles.labelText}>{label}</span>
+ </span>
+ </button>
+ );
+ })}
+ </div>
+);
diff --git a/packages/twenty-companion/src/renderer/components/Notice.tsx b/packages/twenty-companion/src/renderer/components/Notice.tsx
new file mode 100644
index 00000000000..f78f5f386f5
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Notice.tsx
@@ -0,0 +1,46 @@
+import { noticeMessage } from '../utils/noticeMessage';
+import { Banner } from '@ui/primitives/feedback/Banner/Banner';
+import { Notification } from './Notification';
+import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { i18n } from '@lingui/core';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { IconX } from 'twenty-ui/icon';
+import { type ActionProps } from '../types/ActionProps';
+
+export const Notice = ({ state, command }: ActionProps) =>
+ !state.error && state.notice?.type === 'recording-finished' ? (
+ <div className="notification-container">
+ <Notification
+ message={noticeMessage(state.notice)}
+ closeLabel={i18n._('Dismiss message')}
+ onClose={() => void command({ type: 'dismiss-error' })}
+ />
+ </div>
+ ) : state.error || state.notice ? (
+ <div className="notice" role={state.error ? 'alert' : 'status'}>
+ <Banner color={state.error ? 'danger' : 'blue'}>
+ <span className="notice-text">
+ {state.error?.message ??
+ (state.notice && noticeMessage(state.notice))}
+ </span>
+ {state.error?.recovery && (
+ <Button
+ title={i18n._('Install Desktop Recorder')}
+ variant="secondary"
+ inverted
+ onClick={() =>
+ state.error?.recovery && void command(state.error.recovery)
+ }
+ />
+ )}
+ <IconButton
+ className="notice-close"
+ variant="tertiary"
+ ariaLabel={i18n._('Dismiss message')}
+ onClick={() => void command({ type: 'dismiss-error' })}
+ size="medium"
+ Icon={IconX}
+ />
+ </Banner>
+ </div>
+ ) : null;
diff --git a/packages/twenty-companion/src/renderer/components/Notification.module.scss b/packages/twenty-companion/src/renderer/components/Notification.module.scss
new file mode 100644
index 00000000000..cc0cd741da5
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Notification.module.scss
@@ -0,0 +1,35 @@
+.container {
+ backdrop-filter: var(--t-blur-medium);
+ background: var(--t-background-transparent-primary);
+ border-radius: var(--t-border-radius-md);
+ box-shadow: var(--t-box-shadow-strong);
+ box-sizing: border-box;
+ padding: var(--t-spacing-2);
+ position: relative;
+ width: 296px;
+ max-width: 100%;
+ overflow: hidden;
+}
+.content {
+ position: relative;
+ display: flex;
+ align-items: center;
+ gap: var(--t-spacing-2);
+ > svg {
+ flex-shrink: 0;
+ }
+}
+.message {
+ flex: 1;
+ color: var(--t-font-color-secondary);
+ font-family: var(--t-font-family);
+ font-size: var(--t-font-size-sm);
+}
+.progress {
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ > [role='progressbar'] {
+ height: 100%;
+ }
+}
diff --git a/packages/twenty-companion/src/renderer/components/Notification.module.scss.d.ts b/packages/twenty-companion/src/renderer/components/Notification.module.scss.d.ts
new file mode 100644
index 00000000000..ebc34e2d50a
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Notification.module.scss.d.ts
@@ -0,0 +1,7 @@
+declare const styles: {
+ readonly container: string;
+ readonly content: string;
+ readonly message: string;
+ readonly progress: string;
+};
+export default styles;
diff --git a/packages/twenty-companion/src/renderer/components/Notification.tsx b/packages/twenty-companion/src/renderer/components/Notification.tsx
new file mode 100644
index 00000000000..3b701afd356
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Notification.tsx
@@ -0,0 +1,57 @@
+import { useState } from 'react';
+import { IconInfoCircle, IconX } from '@ui/icon';
+import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { ProgressBar } from '@ui/primitives/feedback/ProgressBar/ProgressBar';
+import { useTheme } from '@ui/theme-constants';
+import styles from './Notification.module.scss';
+
+type NotificationProps = {
+ message: string;
+ closeLabel: string;
+ onClose: () => void;
+};
+
+export const Notification = ({
+ message,
+ closeLabel,
+ onClose,
+}: NotificationProps) => {
+ const theme = useTheme();
+ const [paused, setPaused] = useState(false);
+ return (
+ <div
+ className={styles.container}
+ role="status"
+ aria-live="polite"
+ onMouseEnter={() => setPaused(true)}
+ onMouseLeave={() => setPaused(false)}
+ onFocus={() => setPaused(true)}
+ onBlur={() => setPaused(false)}
+ >
+ <div className={styles.progress}>
+ <ProgressBar
+ value={100}
+ barColor={theme.snackBar.info.backgroundColor}
+ countdownDurationInMs={6000}
+ isCountdownPaused={paused}
+ onCountdownComplete={onClose}
+ />
+ </div>
+ <div className={styles.content}>
+ <IconInfoCircle
+ size={theme.icon.size.md}
+ color={theme.snackBar.info.color}
+ aria-hidden
+ />
+ <span className={styles.message}>{message}</span>
+ <IconButton
+ Icon={IconX}
+ ariaLabel={closeLabel}
+ onClick={onClose}
+ variant="tertiary"
+ size="medium"
+ />
+ </div>
+ </div>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/Onboarding.tsx b/packages/twenty-companion/src/renderer/components/Onboarding.tsx
new file mode 100644
index 00000000000..be1ef8861a2
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Onboarding.tsx
@@ -0,0 +1,136 @@
+import { i18n } from '@lingui/core';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import { useState } from 'react';
+import { type CompanionState } from '../../shared/types/CompanionState';
+import { Field } from '@ui/primitives/input/Field/Field';
+import { MainButton } from '@ui/primitives/input/MainButton/MainButton';
+import { IconArrowUpRight, IconRefresh } from 'twenty-ui/icon';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { type ActionProps } from '../types/ActionProps';
+import { SetupHeading } from './SetupHeading';
+import { Empty } from './Empty';
+import { IS_PREVIEW } from '../constants/IS_PREVIEW';
+import { Permissions } from './Permissions';
+
+const Welcome = ({ state, isPending, command }: ActionProps) => {
+ const [serverUrl, setServerUrl] = useState(state.serverUrl);
+ return (
+ <section className="setup-card welcome">
+ <SetupHeading
+ title={i18n._('Connect your workspace')}
+ description={i18n._(
+ 'Enter your workspace URL to sign in through your browser.',
+ )}
+ />
+ <form
+ onSubmit={(event) => {
+ event.preventDefault();
+ void command({ type: 'connect', serverUrl });
+ }}
+ >
+ <Field.Root className="workspace-url-field">
+ <Field.Control
+ id="workspace-url"
+ aria-label={i18n._('Workspace URL')}
+ value={serverUrl}
+ onChange={(event) => {
+ setServerUrl(event.target.value);
+ if (state.connection === 'connecting')
+ void command({ type: 'cancel-connect' });
+ }}
+ placeholder="https://your-workspace.twenty.com"
+ type="url"
+ required
+ autoComplete="url"
+ />
+ <Field.Error />
+ </Field.Root>
+ <MainButton
+ fullWidth
+ type="submit"
+ disabled={isPending('connect') || (!window.companion && !IS_PREVIEW)}
+ title={
+ state.connection === 'connecting'
+ ? i18n._('Waiting for your browser…')
+ : i18n._('Connect to Twenty')
+ }
+ Icon={IconArrowUpRight}
+ />
+ </form>
+ </section>
+ );
+};
+
+const getOnboardingStep = (state: CompanionState) => {
+ if (state.connection !== 'connected') return 'welcome';
+ if (!state.updatedAt) return 'loading';
+ return 'permissions';
+};
+
+const OnboardingContent = ({ state, isPending, command }: ActionProps) => {
+ switch (getOnboardingStep(state)) {
+ case 'welcome':
+ return <Welcome state={state} command={command} isPending={isPending} />;
+ case 'loading':
+ return (
+ <Empty
+ icon={
+ <IconRefresh
+ size={THEME_COMMON.icon.size.xl}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={
+ state.error
+ ? i18n._('Your workspace needs attention')
+ : i18n._('Connecting your workspace')
+ }
+ actions={
+ <Button
+ disabled={isPending('refresh')}
+ onClick={() => void command({ type: 'refresh' })}
+ variant="secondary"
+ size="medium"
+ title={i18n._('Try again')}
+ />
+ }
+ >
+ <p>
+ {i18n._(
+ 'Your calendar and recording integration need to finish loading before setup can continue.',
+ )}
+ </p>
+ </Empty>
+ );
+ case 'permissions':
+ return (
+ <Permissions
+ state={state}
+ command={command}
+ isPending={isPending}
+ intentToRecord={
+ state.permissionSetup?.intent === 'record' &&
+ state.settings.setupCompleted
+ }
+ onContinue={() => {
+ void command(
+ state.settings.setupCompleted
+ ? { type: 'cancel-permission-setup' }
+ : { type: 'complete-setup' },
+ );
+ }}
+ />
+ );
+ }
+};
+
+export const Onboarding = (props: ActionProps) => {
+ return (
+ <div className="setup-frame">
+ <span className="setup-logo" role="img" aria-label="Twenty" />
+ <div className="setup-container">
+ <OnboardingContent {...props} />
+ </div>
+ </div>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/OnboardingSubtitle.tsx b/packages/twenty-companion/src/renderer/components/OnboardingSubtitle.tsx
new file mode 100644
index 00000000000..a1ea69f8dcb
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/OnboardingSubtitle.tsx
@@ -0,0 +1,10 @@
+import { clsx } from 'clsx';
+import { type ComponentPropsWithoutRef } from 'react';
+import styles from './OnboardingText.module.scss';
+
+export const OnboardingSubtitle = ({
+ className,
+ ...props
+}: ComponentPropsWithoutRef<'p'>) => (
+ <p className={clsx(styles.subtitle, className)} {...props} />
+);
diff --git a/packages/twenty-companion/src/renderer/components/OnboardingText.module.scss b/packages/twenty-companion/src/renderer/components/OnboardingText.module.scss
new file mode 100644
index 00000000000..71093ae5479
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/OnboardingText.module.scss
@@ -0,0 +1,17 @@
+.title {
+ color: var(--t-font-color-primary);
+ font-family: var(--t-font-family);
+ font-size: var(--t-font-size-xl);
+ font-weight: var(--t-font-weight-semi-bold);
+ line-height: 1.2;
+ letter-spacing: normal;
+ margin: 0;
+}
+.subtitle {
+ color: var(--t-font-color-secondary);
+ font-family: var(--t-font-family);
+ font-size: var(--t-font-size-md);
+ line-height: 1.4;
+ letter-spacing: normal;
+ margin: 0;
+}
diff --git a/packages/twenty-companion/src/renderer/components/OnboardingText.module.scss.d.ts b/packages/twenty-companion/src/renderer/components/OnboardingText.module.scss.d.ts
new file mode 100644
index 00000000000..49eb828bfa2
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/OnboardingText.module.scss.d.ts
@@ -0,0 +1,2 @@
+declare const styles: { readonly title: string; readonly subtitle: string };
+export default styles;
diff --git a/packages/twenty-companion/src/renderer/components/OnboardingTitle.tsx b/packages/twenty-companion/src/renderer/components/OnboardingTitle.tsx
new file mode 100644
index 00000000000..104b04d3cbc
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/OnboardingTitle.tsx
@@ -0,0 +1,13 @@
+import { clsx } from 'clsx';
+import { type ComponentPropsWithoutRef } from 'react';
+import styles from './OnboardingText.module.scss';
+
+export const OnboardingTitle = ({
+ className,
+ children,
+ ...props
+}: ComponentPropsWithoutRef<'h1'>) => (
+ <h1 className={clsx(styles.title, className)} {...props}>
+ {children}
+ </h1>
+);
diff --git a/packages/twenty-companion/src/renderer/components/Permissions.tsx b/packages/twenty-companion/src/renderer/components/Permissions.tsx
new file mode 100644
index 00000000000..2b33fd38360
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Permissions.tsx
@@ -0,0 +1,120 @@
+import { i18n } from '@lingui/core';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import { Card } from '@ui/primitives/surfaces/Card/Card';
+import { MainButton } from '@ui/primitives/input/MainButton/MainButton';
+import {
+ IconMicrophone,
+ IconHeadphones,
+ IconUsers,
+ IconArrowUpRight,
+ IconCircleDot,
+} from 'twenty-ui/icon';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { type ActionProps } from '../types/ActionProps';
+import { SetupHeading } from './SetupHeading';
+import { Status } from '@ui/primitives/data-display/Status/Status';
+
+const PermissionChecklist = ({ state, isPending, command }: ActionProps) => (
+ <Card
+ className="permission-list"
+ backgroundColor="var(--t-background-secondary)"
+ >
+ {(
+ [
+ {
+ permission: 'microphone',
+ label: i18n._('Record your voice'),
+ button: i18n._('Enable microphone'),
+ Icon: IconMicrophone,
+ },
+ {
+ permission: 'system-audio',
+ label: i18n._('Record call audio'),
+ button: i18n._('Enable system audio'),
+ Icon: IconHeadphones,
+ },
+ {
+ permission: 'accessibility',
+ label: i18n._('Detect calls and speakers'),
+ button: i18n._('Enable accessibility'),
+ Icon: IconUsers,
+ },
+ ] as const
+ ).map(({ permission, label, button, Icon }) => {
+ const status = state.permissions[permission];
+ const granted = status === 'granted';
+ const denied = status === 'denied';
+ return (
+ <div className="permission-item" key={permission}>
+ <span className="permission-icon">
+ <Icon
+ size={THEME_COMMON.icon.size.lg}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ </span>
+ <strong className="grow">{label}</strong>
+ {granted ? (
+ <span role="status">
+ <Status color="blue">{i18n._('Enabled')}</Status>
+ </span>
+ ) : (
+ <Button
+ variant="secondary"
+ disabled={isPending('permission') || !state.updatedAt}
+ onClick={() =>
+ void command({
+ type: 'permission',
+ permission,
+ })
+ }
+ size="medium"
+ title={denied ? i18n._('Open settings') : button}
+ Icon={denied ? IconArrowUpRight : undefined}
+ />
+ )}
+ </div>
+ );
+ })}
+ </Card>
+);
+
+export const Permissions = ({
+ state,
+ isPending,
+ command,
+ onContinue,
+ intentToRecord,
+}: ActionProps & { onContinue: () => void; intentToRecord: boolean }) => {
+ const granted = Object.values(state.permissions).every(
+ (status) => status === 'granted',
+ );
+ return (
+ <section className="setup-card permissions-setup">
+ <SetupHeading
+ title={i18n._('Set up recording')}
+ description={i18n._(
+ 'Enable audio access to transcribe your conversations and save them in Twenty.',
+ )}
+ />
+ <PermissionChecklist
+ state={state}
+ isPending={isPending}
+ command={command}
+ />
+ <MainButton
+ fullWidth
+ disabled={isPending('record', 'complete-setup') || !granted}
+ onClick={() =>
+ intentToRecord
+ ? void command({
+ type: 'record',
+ windowId: state.permissionSetup?.windowId,
+ })
+ : onContinue()
+ }
+ Icon={intentToRecord ? IconCircleDot : undefined}
+ title={intentToRecord ? i18n._('Start recording') : i18n._('Finish')}
+ />
+ </section>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/RecordingAvatar.tsx b/packages/twenty-companion/src/renderer/components/RecordingAvatar.tsx
new file mode 100644
index 00000000000..cb9d8172420
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/RecordingAvatar.tsx
@@ -0,0 +1,17 @@
+import { Avatar } from '@ui/primitives/data-display/Avatar/Avatar';
+import { type Recording } from '../../shared/types/Recording';
+
+export const RecordingAvatar = ({ recording }: { recording: Recording }) => {
+ const participant = recording.participants?.[0];
+ return (
+ <span aria-hidden="true">
+ <Avatar
+ src={participant?.avatarUrl}
+ name={participant?.name ?? '?'}
+ colorSeed={participant?.id}
+ size="lg"
+ shape="square"
+ />
+ </span>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/RecordingControls.tsx b/packages/twenty-companion/src/renderer/components/RecordingControls.tsx
new file mode 100644
index 00000000000..0feb4e4df15
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/RecordingControls.tsx
@@ -0,0 +1,80 @@
+import { Avatar } from '@ui/primitives/data-display/Avatar/Avatar';
+import { H1Title, H1TitleFontColor } from '@ui/primitives/typography/H1Title/H1Title';
+import { Card } from '@ui/primitives/surfaces/Card/Card';
+import { i18n } from '@lingui/core';
+import { Button } from '@ui/primitives/input/Button/Button';
+import {
+ IconPlayerPause,
+ IconPlayerPlay,
+ IconPlayerStop,
+} from 'twenty-ui/icon';
+import { RecordingTimer } from './RecordingTimer';
+import { type ActionProps } from '../types/ActionProps';
+
+export const RecordingControls = ({
+ state,
+ isPending,
+ command,
+}: ActionProps) => {
+ const active = state.activeRecording;
+ if (!active) return null;
+ const paused = active.status === 'paused';
+ const transitional = !['recording', 'paused'].includes(active.status);
+ const label = {
+ starting: i18n._('Starting recording…'),
+ recording: i18n._('Recording'),
+ pausing: i18n._('Pausing…'),
+ paused: i18n._('Recording paused'),
+ resuming: i18n._('Resuming…'),
+ stopping: i18n._('Finishing recording…'),
+ }[active.status];
+ return (
+ <Card
+ className="live-card"
+ aria-label={i18n._('Current recording')}
+ backgroundColor="var(--t-background-secondary)"
+ >
+ <div className="live-heading">
+ <Avatar
+ name={active.title}
+ colorSeed={active.id}
+ size="xl"
+ shape="rounded-square"
+ />
+ <div className="grow">
+ <H1Title
+ className="live-title"
+ title={active.title}
+ fontColor={H1TitleFontColor.Primary}
+ />
+ <span className="small muted" role="status">
+ {label} · <RecordingTimer recording={active} />
+ </span>
+ </div>
+ </div>
+ <div className="live-actions">
+ <Button
+ disabled={
+ isPending('pause', 'resume', 'stop', 'record') || transitional
+ }
+ onClick={() => void command({ type: paused ? 'resume' : 'pause' })}
+ variant="secondary"
+ size="medium"
+ Icon={paused ? IconPlayerPlay : IconPlayerPause}
+ title={paused ? i18n._('Resume') : i18n._('Pause')}
+ />
+ <Button
+ disabled={
+ isPending('pause', 'resume', 'stop', 'record') || transitional
+ }
+ onClick={() => void command({ type: 'stop' })}
+ variant="secondary"
+ accent="danger"
+ size="medium"
+ Icon={IconPlayerStop}
+ title={i18n._('Finish recording')}
+ />
+ </div>
+ </Card>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/RecordingList.tsx b/packages/twenty-companion/src/renderer/components/RecordingList.tsx
new file mode 100644
index 00000000000..7408d76d569
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/RecordingList.tsx
@@ -0,0 +1,74 @@
+import { i18n } from '@lingui/core';
+import { Card } from '@ui/primitives/surfaces/Card/Card';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import { IconCircleDot } from 'twenty-ui/icon';
+import { type ActionProps } from '../types/ActionProps';
+import { Empty } from './Empty';
+import { Status } from './Status';
+import { RecordingAvatar } from './RecordingAvatar';
+import { formatDate } from '../utils/formatDate';
+
+export const RecordingList = ({ state, isPending, command }: ActionProps) => {
+ const recordings = state.recordings.slice(0, 5);
+ return recordings.length ? (
+ <Card
+ className="recording-list"
+ backgroundColor="var(--t-background-secondary)"
+ >
+ {recordings.map((recording) => (
+ <button
+ className="recording-row"
+ key={recording.id}
+ disabled={isPending('open-recording')}
+ title={i18n._('Open in Twenty')}
+ onClick={() =>
+ void command({ type: 'open-recording', recordingId: recording.id })
+ }
+ >
+ <RecordingAvatar recording={recording} />
+ <div className="grow">
+ <strong>{recording.title}</strong>
+ <span
+ className="small muted"
+ title={recording.participants
+ ?.map((participant) => participant.name)
+ .join(', ')}
+ >
+ {recording.participants?.[0]?.name ||
+ i18n._('Unknown participant')}
+ {(recording.participants?.length ?? 0) > 1 &&
+ ` +${(recording.participants?.length ?? 1) - 1}`}
+ </span>
+ </div>
+ <div className="recording-metadata">
+ <span className="small muted">
+ {recording.startedAt
+ ? formatDate(recording.startedAt)
+ : i18n._('Recent conversation')}
+ </span>
+ {recording.status !== 'COMPLETED' && (
+ <Status status={recording.status} />
+ )}
+ </div>
+ </button>
+ ))}
+ </Card>
+ ) : (
+ <Empty
+ icon={
+ <IconCircleDot
+ size={THEME_COMMON.icon.size.xl}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ animatedPlaceholderType="noCallRecording"
+ title={i18n._('A place for every conversation')}
+ >
+ <p>
+ {i18n._(
+ 'Your recorded conversations will appear here and in your Twenty workspace.',
+ )}
+ </p>
+ </Empty>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/RecordingTimer.tsx b/packages/twenty-companion/src/renderer/components/RecordingTimer.tsx
new file mode 100644
index 00000000000..13edbe16163
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/RecordingTimer.tsx
@@ -0,0 +1,12 @@
+import { type ActiveRecording } from '../../shared/types/ActiveRecording';
+import { elapsedRecording } from '../utils/elapsedRecording';
+import { useNow } from '../hooks/useNow';
+
+export const RecordingTimer = ({
+ recording,
+}: {
+ recording: ActiveRecording;
+}) => {
+ const now = useNow(recording.pausedAt ? null : 1000);
+ return <time>{elapsedRecording(recording, now)}</time>;
+};
diff --git a/packages/twenty-companion/src/renderer/components/Settings.tsx b/packages/twenty-companion/src/renderer/components/Settings.tsx
new file mode 100644
index 00000000000..318de3bca30
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Settings.tsx
@@ -0,0 +1,283 @@
+import { i18n } from '@lingui/core';
+import { H2Title } from '@ui/primitives/typography/H2Title/H2Title';
+import { SettingsCardContent } from './SettingsCardContent';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import { Card } from '@ui/primitives/surfaces/Card/Card';
+import { type ReactNode } from 'react';
+import { Switch } from '@ui/primitives/input/Switch/Switch';
+import { Status } from '@ui/primitives/data-display/Status/Status';
+import { SegmentedControl } from '@ui/primitives/input/SegmentedControl/SegmentedControl';
+import {
+ IconCalendarEvent,
+ IconCircleDot,
+ IconArrowUpRight,
+ IconChevronRight,
+ IconLogin2,
+ IconUsers,
+ IconMicrophone,
+ IconBell,
+ IconClock,
+ IconSettings,
+} from 'twenty-ui/icon';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { type ActionProps } from '../types/ActionProps';
+import { ShortcutSetting } from './ShortcutSetting';
+import { WorkspaceIcon } from './WorkspaceIcon';
+
+const SettingsToggle = ({
+ state,
+ isPending,
+ command,
+ setting,
+ icon,
+ label,
+ description,
+}: ActionProps & {
+ setting:
+ | 'autoJoin'
+ | 'autoRecord'
+ | 'launchAtLogin'
+ | 'notifyOnDetectedCall'
+ | 'showMeetingCountdown';
+ icon: ReactNode;
+ label: string;
+ description: string;
+}) => (
+ <label className="toggle-row">
+ <SettingsCardContent icon={icon} title={label} description={description}>
+ <Switch
+ aria-label={label}
+ checked={state.settings[setting]}
+ disabled={isPending('settings')}
+ onCheckedChange={(value) =>
+ void command({
+ type: 'settings',
+ settings: { [setting]: value },
+ })
+ }
+ />
+ </SettingsCardContent>
+ </label>
+);
+
+export const Settings = ({ state, isPending, command }: ActionProps) => (
+ <section className="settings-page">
+ <H2Title title={i18n._('General')} />
+ <Card
+ className="settings-group"
+ backgroundColor="var(--t-background-secondary)"
+ >
+ <ShortcutSetting state={state} isPending={isPending} command={command} />
+ <SettingsCardContent
+ icon={
+ <IconSettings
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={i18n._('Appearance')}
+ description={i18n._('Choose how Twenty looks on this computer.')}
+ >
+ <SegmentedControl
+ itemWidth="content"
+ ariaLabel={i18n._('Appearance')}
+ value={state.settings.appearance}
+ options={(
+ [
+ { value: 'system', label: i18n._('System') },
+ { value: 'light', label: i18n._('Light') },
+ { value: 'dark', label: i18n._('Dark') },
+ ] as const
+ ).map((option) => ({ ...option, disabled: isPending('settings') }))}
+ onChange={(appearance) =>
+ void command({ type: 'settings', settings: { appearance } })
+ }
+ />
+ </SettingsCardContent>
+ <SettingsToggle
+ state={state}
+ isPending={isPending}
+ command={command}
+ setting="launchAtLogin"
+ icon={
+ <IconLogin2
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ label={i18n._('Launch at login')}
+ description={i18n._(
+ 'Keep Twenty ready in the background when you sign in.',
+ )}
+ />
+ <SettingsToggle
+ state={state}
+ isPending={isPending}
+ command={command}
+ setting="showMeetingCountdown"
+ icon={
+ <IconClock
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ label={i18n._('Meeting countdown')}
+ description={i18n._(
+ 'Show time until your next meeting beside the tray icon.',
+ )}
+ />
+ </Card>
+ <H2Title title={i18n._('Meetings')} className="section" />
+ <Card
+ className="settings-group"
+ backgroundColor="var(--t-background-secondary)"
+ >
+ {(
+ [
+ {
+ key: 'autoJoin',
+ Icon: IconCalendarEvent,
+ label: i18n._('Auto-join meetings'),
+ description: i18n._(
+ 'Open the meeting link when your calendar event starts.',
+ ),
+ },
+ {
+ key: 'autoRecord',
+ Icon: IconCircleDot,
+ label: i18n._('Record unscheduled calls automatically'),
+ description: i18n._(
+ 'Start recording detected calls outside your calendar.',
+ ),
+ },
+ {
+ key: 'notifyOnDetectedCall',
+ Icon: IconBell,
+ label: i18n._('Call detection notifications'),
+ description: i18n._(
+ 'Notify you when a call is detected and needs manual recording.',
+ ),
+ },
+ ] as const
+ ).map(({ key, Icon, label, description }) => (
+ <SettingsToggle
+ key={key}
+ state={state}
+ isPending={isPending}
+ command={command}
+ setting={key}
+ icon={
+ <Icon
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ label={label}
+ description={description}
+ />
+ ))}
+ <SettingsCardContent
+ icon={
+ <IconUsers
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={i18n._('Speaker tags')}
+ description={i18n._('Identify who is speaking in supported calls.')}
+ >
+ {state.permissions.accessibility === 'granted' ? (
+ <span role="status">
+ <Status color="blue">{i18n._('Enabled')}</Status>
+ </span>
+ ) : (
+ <Button
+ disabled={
+ isPending('permission') ||
+ !!state.activeRecording ||
+ !state.updatedAt
+ }
+ onClick={() =>
+ void command({
+ type: 'permission',
+ permission: 'accessibility',
+ })
+ }
+ variant="secondary"
+ size="medium"
+ title={
+ state.permissions.accessibility === 'denied'
+ ? i18n._('Open settings')
+ : i18n._('Enable')
+ }
+ />
+ )}
+ </SettingsCardContent>
+ <button
+ className="settings-link"
+ disabled={
+ isPending('begin-permission-setup') || !!state.activeRecording
+ }
+ onClick={() => void command({ type: 'begin-permission-setup' })}
+ >
+ <SettingsCardContent
+ icon={
+ <IconMicrophone
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={i18n._('Recording permissions')}
+ description={i18n._(
+ 'Manage microphone, system audio, and call detection access.',
+ )}
+ >
+ <IconChevronRight
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ </SettingsCardContent>
+ </button>
+ </Card>
+ <H2Title title={i18n._('Workspace')} className="section" />
+ <Card
+ className="settings-group"
+ backgroundColor="var(--t-background-secondary)"
+ >
+ <button
+ className="settings-link"
+ disabled={isPending('open-calendar-settings')}
+ onClick={() => void command({ type: 'open-calendar-settings' })}
+ >
+ <SettingsCardContent
+ icon={
+ <IconCalendarEvent
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={i18n._('Calendar settings')}
+ description={i18n._('Manage your connected calendars in Twenty.')}
+ >
+ <IconArrowUpRight
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ </SettingsCardContent>
+ </button>
+ <SettingsCardContent
+ icon={<WorkspaceIcon workspace={state.workspace} />}
+ title={state.workspace?.name}
+ description={<span className="selectable">{state.serverUrl}</span>}
+ >
+ <Button
+ disabled={isPending('disconnect') || !!state.activeRecording}
+ onClick={() => void command({ type: 'disconnect' })}
+ variant="secondary"
+ size="medium"
+ title={i18n._('Disconnect')}
+ />
+ </SettingsCardContent>
+ </Card>
+ </section>
+);
diff --git a/packages/twenty-companion/src/renderer/components/SettingsCardContent.module.scss b/packages/twenty-companion/src/renderer/components/SettingsCardContent.module.scss
new file mode 100644
index 00000000000..852bd0b97bb
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/SettingsCardContent.module.scss
@@ -0,0 +1,38 @@
+.content {
+ align-items: center;
+ display: flex;
+ gap: var(--t-spacing-3);
+ padding: var(--t-spacing-4);
+}
+.icon {
+ align-items: center;
+ background-color: var(--t-background-primary);
+ border: 2px solid var(--t-border-color-light);
+ border-radius: var(--t-border-radius-sm);
+ box-sizing: border-box;
+ display: flex;
+ height: var(--t-spacing-8);
+ justify-content: center;
+ min-width: var(--t-spacing-8);
+ width: var(--t-spacing-8);
+}
+.text {
+ flex: 1;
+ min-width: 0;
+}
+.title {
+ color: var(--t-font-color-primary);
+ font-size: var(--t-font-size-md);
+ font-weight: var(--t-font-weight-medium);
+ margin-bottom: var(--t-spacing-1);
+}
+.description {
+ color: var(--t-font-color-secondary);
+ font-size: var(--t-font-size-sm);
+ line-height: var(--t-text-line-height-lg);
+ overflow: hidden;
+}
+.actions {
+ flex-shrink: 0;
+ margin-left: auto;
+}
diff --git a/packages/twenty-companion/src/renderer/components/SettingsCardContent.module.scss.d.ts b/packages/twenty-companion/src/renderer/components/SettingsCardContent.module.scss.d.ts
new file mode 100644
index 00000000000..438a3dd3411
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/SettingsCardContent.module.scss.d.ts
@@ -0,0 +1,9 @@
+declare const styles: {
+ readonly content: string;
+ readonly icon: string;
+ readonly text: string;
+ readonly title: string;
+ readonly description: string;
+ readonly actions: string;
+};
+export default styles;
diff --git a/packages/twenty-companion/src/renderer/components/SettingsCardContent.tsx b/packages/twenty-companion/src/renderer/components/SettingsCardContent.tsx
new file mode 100644
index 00000000000..e03baaa44b0
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/SettingsCardContent.tsx
@@ -0,0 +1,27 @@
+import { type ReactNode } from 'react';
+import styles from './SettingsCardContent.module.scss';
+
+type SettingsCardContentProps = {
+ icon?: ReactNode;
+ title: ReactNode;
+ description?: ReactNode;
+ children?: ReactNode;
+};
+
+export const SettingsCardContent = ({
+ icon,
+ title,
+ description,
+ children,
+}: SettingsCardContentProps) => (
+ <div className={styles.content}>
+ {icon != null && <div className={styles.icon}>{icon}</div>}
+ <div className={styles.text}>
+ <div className={styles.title}>{title}</div>
+ {description != null && (
+ <div className={styles.description}>{description}</div>
+ )}
+ </div>
+ {children != null && <div className={styles.actions}>{children}</div>}
+ </div>
+);
diff --git a/packages/twenty-companion/src/renderer/components/SetupHeading.tsx b/packages/twenty-companion/src/renderer/components/SetupHeading.tsx
new file mode 100644
index 00000000000..644f5968314
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/SetupHeading.tsx
@@ -0,0 +1,29 @@
+import { OnboardingTitle } from './OnboardingTitle';
+import { OnboardingSubtitle } from './OnboardingSubtitle';
+
+type SetupHeadingProps = {
+ title: string;
+ continuation?: string;
+ description?: string;
+};
+
+export const SetupHeading = ({
+ title,
+ continuation,
+ description,
+}: SetupHeadingProps) => (
+ <header className="setup-heading">
+ <OnboardingTitle>
+ {continuation ? (
+ <>
+ <span>{title}</span> <span>{continuation}</span>
+ </>
+ ) : (
+ title
+ )}
+ </OnboardingTitle>
+ {description != null && (
+ <OnboardingSubtitle>{description}</OnboardingSubtitle>
+ )}
+ </header>
+);
diff --git a/packages/twenty-companion/src/renderer/components/ShortcutSetting.tsx b/packages/twenty-companion/src/renderer/components/ShortcutSetting.tsx
new file mode 100644
index 00000000000..ba848e51447
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/ShortcutSetting.tsx
@@ -0,0 +1,86 @@
+import { DEFAULT_SETTINGS } from '../../shared/constants/DEFAULT_SETTINGS';
+import { shortcutFromKeyboardEvent } from '../utils/shortcutFromKeyboardEvent';
+import { formatShortcut } from '../utils/formatShortcut';
+import { i18n } from '@lingui/core';
+import { SettingsCardContent } from './SettingsCardContent';
+import { THEME_COMMON } from '@ui/theme/constants/ThemeCommon';
+import { IconButton } from '@ui/primitives/input/IconButton/IconButton';
+import { useState } from 'react';
+import { IconCommand, IconRestore } from 'twenty-ui/icon';
+import { Button } from '@ui/primitives/input/Button/Button';
+import { type ActionProps } from '../types/ActionProps';
+
+export const ShortcutSetting = ({ state, isPending, command }: ActionProps) => {
+ const [capturing, setCapturing] = useState(false);
+ return (
+ <SettingsCardContent
+ icon={
+ <IconCommand
+ size={THEME_COMMON.icon.size.md}
+ stroke={THEME_COMMON.icon.stroke.sm}
+ />
+ }
+ title={i18n._('Open companion shortcut')}
+ description={
+ capturing
+ ? i18n._(
+ 'Press Control, Option / Alt, or Command with a key. Escape cancels.',
+ )
+ : i18n._('Open Twenty from anywhere on your computer.')
+ }
+ >
+ <div className="button-group shortcut-actions">
+ {state.settings.openShortcut !== DEFAULT_SETTINGS.openShortcut && (
+ <IconButton
+ variant="tertiary"
+ ariaLabel={i18n._('Reset shortcut')}
+ disabled={isPending('settings')}
+ onClick={() =>
+ void command({
+ type: 'settings',
+ settings: { openShortcut: DEFAULT_SETTINGS.openShortcut },
+ })
+ }
+ size="medium"
+ Icon={IconRestore}
+ />
+ )}
+ <div
+ onBlur={() => setCapturing(false)}
+ onKeyDown={(event) => {
+ if (!capturing) return;
+ event.preventDefault();
+ event.stopPropagation();
+ if (event.key === 'Escape') {
+ setCapturing(false);
+ return;
+ }
+ const shortcut = shortcutFromKeyboardEvent(event);
+ if (!shortcut) return;
+ setCapturing(false);
+ void command({
+ type: 'settings',
+ settings: { openShortcut: shortcut },
+ });
+ }}
+ >
+ <Button
+ ariaLabel={i18n._('Change open companion shortcut')}
+ disabled={isPending('settings')}
+ onClick={() => setCapturing(true)}
+ variant="secondary"
+ size="medium"
+ title={
+ capturing
+ ? i18n._('Press shortcut…')
+ : formatShortcut(
+ state.settings.openShortcut,
+ navigator.platform.startsWith('Mac'),
+ )
+ }
+ />
+ </div>
+ </div>
+ </SettingsCardContent>
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/components/Status.tsx b/packages/twenty-companion/src/renderer/components/Status.tsx
new file mode 100644
index 00000000000..eb88c129fdf
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/Status.tsx
@@ -0,0 +1,16 @@
+import { Tag as StatusChip } from '@ui/primitives/data-display/Tag/Tag';
+import { recordingLabel } from '../utils/recordingLabel';
+
+export const Status = ({ status }: { status: string }) => (
+ <StatusChip
+ color={
+ status.toUpperCase() === 'FAILED'
+ ? 'red'
+ : status.toUpperCase() === 'PROCESSING'
+ ? 'blue'
+ : 'gray'
+ }
+ >
+ {recordingLabel(status)}
+ </StatusChip>
+);
diff --git a/packages/twenty-companion/src/renderer/components/WorkspaceIcon.tsx b/packages/twenty-companion/src/renderer/components/WorkspaceIcon.tsx
new file mode 100644
index 00000000000..f25328efec8
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/components/WorkspaceIcon.tsx
@@ -0,0 +1,17 @@
+import { Avatar } from '@ui/primitives/data-display/Avatar/Avatar';
+import { type Agenda } from '../../shared/types/Agenda';
+
+export const WorkspaceIcon = ({
+ workspace,
+}: {
+ workspace: Agenda['workspace'] | null;
+}) => (
+ <span aria-hidden="true" className="workspace-avatar">
+ <Avatar
+ src={workspace?.logoUrl || './twenty.svg'}
+ name={workspace?.name ?? 'Twenty'}
+ size="lg"
+ shape="square"
+ />
+ </span>
+);
diff --git a/packages/twenty-companion/src/renderer/constants/IS_PREVIEW.ts b/packages/twenty-companion/src/renderer/constants/IS_PREVIEW.ts
new file mode 100644
index 00000000000..32bd3647553
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/constants/IS_PREVIEW.ts
@@ -0,0 +1,4 @@
+export const IS_PREVIEW =
+ import.meta.env.DEV &&
+ !window.companion &&
+ new URLSearchParams(window.location.search).has('preview');
diff --git a/packages/twenty-companion/src/renderer/hooks/useCompanion.ts b/packages/twenty-companion/src/renderer/hooks/useCompanion.ts
new file mode 100644
index 00000000000..ee1c098bf56
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/hooks/useCompanion.ts
@@ -0,0 +1,96 @@
+import { i18n } from '@lingui/core';
+import { useEffect, useState } from 'react';
+import { type CompanionCommand } from '../../shared/types/CompanionCommand';
+import { type CompanionPage } from '../../shared/types/CompanionPage';
+import { type CompanionState } from '../../shared/types/CompanionState';
+import { createInitialState } from '../../shared/utils/createInitialState';
+import { previewState } from '../utils/previewState';
+import { previewCommand } from '../utils/previewCommand';
+import { IS_PREVIEW } from '../constants/IS_PREVIEW';
+
+export const useCompanion = () => {
+ const [state, setState] = useState(() =>
+ IS_PREVIEW ? previewState(createInitialState()) : createInitialState(),
+ );
+ const [page, setPage] = useState<CompanionPage>('agenda');
+ const [pending, setPending] = useState<
+ Partial<Record<CompanionCommand['type'], number>>
+ >({});
+ const [loaded, setLoaded] = useState(!window.companion);
+ useEffect(() => {
+ const bridge = window.companion;
+ if (!bridge) return;
+ let receivedUpdate = false;
+ let disposed = false;
+ const acceptState = (value: CompanionState) => {
+ if (disposed) return;
+ setState(value);
+ setLoaded(true);
+ };
+ const unsubscribe = bridge.onState((value) => {
+ receivedUpdate = true;
+ acceptState(value);
+ });
+ const unsubscribeNavigation = bridge.onNavigate(setPage);
+ void bridge
+ .getState()
+ .then((value) => {
+ if (!receivedUpdate) acceptState(value);
+ })
+ .catch(() => {
+ if (!disposed) {
+ setState((value) => ({
+ ...value,
+ error: {
+ message: i18n._('Could not connect to the app. Reopen Twenty.'),
+ },
+ }));
+ setLoaded(true);
+ }
+ });
+ return () => {
+ disposed = true;
+ unsubscribe();
+ unsubscribeNavigation();
+ };
+ }, []);
+ const command = async (value: CompanionCommand) => {
+ if (value.type === 'open-app' && !window.companion) {
+ setPage(value.page ?? 'agenda');
+ return;
+ }
+ setPending((previous) => ({
+ ...previous,
+ [value.type]: (previous[value.type] ?? 0) + 1,
+ }));
+ try {
+ if (window.companion) await window.companion.command(value);
+ else if (IS_PREVIEW) {
+ setState((previous) => previewCommand(previous, value));
+ }
+ } catch {
+ setState((previous) => ({
+ ...previous,
+ error: {
+ message: i18n._(
+ 'The app could not complete this action. Please try again.',
+ ),
+ },
+ }));
+ } finally {
+ setPending((previous) => ({
+ ...previous,
+ [value.type]: (previous[value.type] ?? 1) - 1,
+ }));
+ }
+ };
+ return {
+ state,
+ page,
+ navigate: setPage,
+ isPending: (...types: CompanionCommand['type'][]) =>
+ types.some((type) => (pending[type] ?? 0) > 0),
+ loaded,
+ command,
+ };
+};
diff --git a/packages/twenty-companion/src/renderer/hooks/useNow.ts b/packages/twenty-companion/src/renderer/hooks/useNow.ts
new file mode 100644
index 00000000000..cb97b9f1d8f
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/hooks/useNow.ts
@@ -0,0 +1,12 @@
+import { useEffect, useState } from 'react';
+
+export const useNow = (intervalMilliseconds: number | null) => {
+ const [now, setNow] = useState(Date.now);
+ useEffect(() => {
+ if (intervalMilliseconds === null) return;
+ setNow(Date.now());
+ const timer = setInterval(() => setNow(Date.now()), intervalMilliseconds);
+ return () => clearInterval(timer);
+ }, [intervalMilliseconds]);
+ return now;
+};
diff --git a/packages/twenty-companion/src/renderer/locales/en.po b/packages/twenty-companion/src/renderer/locales/en.po
new file mode 100644
index 00000000000..70fe7f45ffa
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/locales/en.po
@@ -0,0 +1,607 @@
+msgid ""
+msgstr ""
+"POT-Creation-Date: 2026-09-08 15:51+0200\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: @lingui/cli\n"
+"Language: en\n"
+"Project-Id-Version: \n"
+"Report-Msgid-Bugs-To: \n"
+"PO-Revision-Date: \n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Plural-Forms: \n"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:75
+msgid "Meeting options"
+msgstr "Meeting options"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:101
+msgid "Restore auto-join"
+msgstr "Restore auto-join"
+
+#. js-lingui-explicit-id
+#: src/renderer/notice-message.ts:9
+msgid "Opening {title}. Complete any meeting provider confirmation to enter."
+msgstr "Opening {title}. Complete any meeting provider confirmation to enter."
+
+#. js-lingui-explicit-id
+#: src/renderer/notice-message.ts:14
+msgid "Recording ended. Twenty is processing your conversation."
+msgstr "Recording ended. Twenty is processing your conversation."
+
+#. js-lingui-explicit-id
+#: src/renderer/notice-message.ts:16
+msgid "Network connection lost. Stopping this recording. Reconnect before starting a new recording."
+msgstr "Network connection lost. Stopping this recording. Reconnect before starting a new recording."
+
+#. js-lingui-explicit-id
+#: src/renderer/notice-message.ts:20
+msgid "Connection restored. Finish the interrupted recording before starting another."
+msgstr "Connection restored. Finish the interrupted recording before starting another."
+
+#. js-lingui-explicit-id
+#: src/renderer/notice-message.ts:24
+msgid "Connection restored. Start a new recording to continue capturing."
+msgstr "Connection restored. Start a new recording to continue capturing."
+
+#. js-lingui-explicit-id
+#: src/renderer/notice-message.ts:28
+msgid "Audio capture was interrupted. Check your microphone and speaker settings."
+msgstr "Audio capture was interrupted. Check your microphone and speaker settings."
+
+#. js-lingui-explicit-id
+#: src/renderer/notice-message.ts:32
+msgid "Recording stopped after the connection was lost. Reconnect to check its processing status."
+msgstr "Recording stopped after the connection was lost. Reconnect to check its processing status."
+
+#. js-lingui-explicit-id
+#: src/renderer/format.ts:13
+msgid "Saved to Twenty"
+msgstr "Saved to Twenty"
+
+#. js-lingui-explicit-id
+#: src/renderer/format.ts:14
+msgid "Processing"
+msgstr "Processing"
+
+#. js-lingui-explicit-id
+#: src/renderer/format.ts:15
+msgid "Recording failed"
+msgstr "Recording failed"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:145
+#: src/renderer/format.ts:16
+msgid "Recording"
+msgstr "Recording"
+
+#. js-lingui-explicit-id
+#: src/renderer/format.ts:17
+#: src/renderer/format.ts:18
+msgid "Preparing"
+msgstr "Preparing"
+
+#. js-lingui-explicit-id
+#: src/renderer/useCompanion.ts:59
+msgid "Could not connect to the app. Reopen Twenty."
+msgstr "Could not connect to the app. Reopen Twenty."
+
+#. js-lingui-explicit-id
+#: src/renderer/useCompanion.ts:89
+msgid "The app could not complete this action. Please try again."
+msgstr "The app could not complete this action. Please try again."
+
+#. js-lingui-explicit-id
+#: src/renderer/ShortcutSetting.tsx:16
+msgid "Open companion shortcut"
+msgstr "Open companion shortcut"
+
+#. js-lingui-explicit-id
+#: src/renderer/ShortcutSetting.tsx:19
+msgid "Press Control, Option / Alt, or Command with a key. Escape cancels."
+msgstr "Press Control, Option / Alt, or Command with a key. Escape cancels."
+
+#. js-lingui-explicit-id
+#: src/renderer/ShortcutSetting.tsx:22
+msgid "Open Twenty from anywhere on your computer."
+msgstr "Open Twenty from anywhere on your computer."
+
+#. js-lingui-explicit-id
+#: src/renderer/ShortcutSetting.tsx:29
+msgid "Reset shortcut"
+msgstr "Reset shortcut"
+
+#. js-lingui-explicit-id
+#: src/renderer/ShortcutSetting.tsx:61
+msgid "Change open companion shortcut"
+msgstr "Change open companion shortcut"
+
+#. js-lingui-explicit-id
+#: src/renderer/ShortcutSetting.tsx:68
+msgid "Press shortcut…"
+msgstr "Press shortcut…"
+
+#. js-lingui-explicit-id
+#: src/renderer/Recordings.tsx:32
+msgid "Open in Twenty"
+msgstr "Open in Twenty"
+
+#. js-lingui-explicit-id
+#: src/renderer/Recordings.tsx:47
+msgid "Unknown participant"
+msgstr "Unknown participant"
+
+#. js-lingui-explicit-id
+#: src/renderer/Recordings.tsx:56
+msgid "Recent conversation"
+msgstr "Recent conversation"
+
+#. js-lingui-explicit-id
+#: src/renderer/Recordings.tsx:71
+msgid "No matching recordings"
+msgstr "No matching recordings"
+
+#. js-lingui-explicit-id
+#: src/renderer/Recordings.tsx:72
+msgid "A place for every conversation"
+msgstr "A place for every conversation"
+
+#. js-lingui-explicit-id
+#: src/renderer/Recordings.tsx:77
+msgid "Try another meeting title."
+msgstr "Try another meeting title."
+
+#. js-lingui-explicit-id
+#: src/renderer/Recordings.tsx:78
+msgid "Your recorded conversations will appear here and in your Twenty workspace."
+msgstr "Your recorded conversations will appear here and in your Twenty workspace."
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:64
+#: src/renderer/components.tsx:88
+msgid "Dismiss message"
+msgstr "Dismiss message"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:77
+msgid "Install Desktop Recorder"
+msgstr "Install Desktop Recorder"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:144
+msgid "Starting recording…"
+msgstr "Starting recording…"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:146
+msgid "Pausing…"
+msgstr "Pausing…"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:147
+msgid "Recording paused"
+msgstr "Recording paused"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:148
+msgid "Resuming…"
+msgstr "Resuming…"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:149
+msgid "Finishing recording…"
+msgstr "Finishing recording…"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:154
+msgid "Current recording"
+msgstr "Current recording"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:184
+msgid "Resume"
+msgstr "Resume"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:184
+msgid "Pause"
+msgstr "Pause"
+
+#. js-lingui-explicit-id
+#: src/renderer/components.tsx:195
+msgid "Finish recording"
+msgstr "Finish recording"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:44
+#: src/renderer/MeetingRow.tsx:58
+msgid "Auto-join skipped"
+msgstr "Auto-join skipped"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:46
+msgid "Calendar bot recording"
+msgstr "Calendar bot recording"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:48
+msgid "Desktop recording available"
+msgstr "Desktop recording available"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:49
+msgid "Recording is off"
+msgstr "Recording is off"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:60
+msgid "Calendar bot"
+msgstr "Calendar bot"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:61
+msgid "Recording off"
+msgstr "Recording off"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:102
+msgid "Skip auto-join"
+msgstr "Skip auto-join"
+
+#. js-lingui-explicit-id
+#: src/renderer/MeetingRow.tsx:122
+msgid "Join"
+msgstr "Join"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:24
+msgid "Record your voice"
+msgstr "Record your voice"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:25
+msgid "Enable microphone"
+msgstr "Enable microphone"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:30
+msgid "Record call audio"
+msgstr "Record call audio"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:31
+msgid "Enable system audio"
+msgstr "Enable system audio"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:36
+msgid "Detect calls and speakers"
+msgstr "Detect calls and speakers"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:37
+msgid "Enable accessibility"
+msgstr "Enable accessibility"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:57
+#: src/renderer/Settings.tsx:166
+msgid "Enabled"
+msgstr "Enabled"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:73
+#: src/renderer/Settings.tsx:188
+msgid "Open settings"
+msgstr "Open settings"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:96
+msgid "Set up recording"
+msgstr "Set up recording"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:97
+msgid "Enable audio access to transcribe your conversations and save them in Twenty."
+msgstr "Enable audio access to transcribe your conversations and save them in Twenty."
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:119
+msgid "Start recording"
+msgstr "Start recording"
+
+#. js-lingui-explicit-id
+#: src/renderer/Permissions.tsx:119
+msgid "Finish"
+msgstr "Finish"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:90
+msgid "Show less"
+msgstr "Show less"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:90
+msgid "See more"
+msgstr "See more"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:105
+msgid "Your calendar is clear"
+msgstr "Your calendar is clear"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:106
+msgid "Bring your calendar along"
+msgstr "Bring your calendar along"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:110
+msgid "Start a recording for an unscheduled conversation."
+msgstr "Start a recording for an unscheduled conversation."
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:111
+msgid "Connect a calendar in Twenty to see your upcoming meetings."
+msgstr "Connect a calendar in Twenty to see your upcoming meetings."
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:121
+msgid "Connect calendar"
+msgstr "Connect calendar"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:139
+#: src/renderer/Home.tsx:142
+msgid "Recordings"
+msgstr "Recordings"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:146
+msgid "Search recordings"
+msgstr "Search recordings"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:147
+msgid "Search recordings…"
+msgstr "Search recordings…"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:65
+msgid "General"
+msgstr "General"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:73
+#: src/renderer/Settings.tsx:78
+msgid "Appearance"
+msgstr "Appearance"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:74
+msgid "Choose how Twenty looks on this computer."
+msgstr "Choose how Twenty looks on this computer."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:82
+msgid "System"
+msgstr "System"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:83
+msgid "Light"
+msgstr "Light"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:84
+msgid "Dark"
+msgstr "Dark"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:98
+msgid "Launch at login"
+msgstr "Launch at login"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:99
+msgid "Keep Twenty ready in the background when you sign in."
+msgstr "Keep Twenty ready in the background when you sign in."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:109
+msgid "Meeting countdown"
+msgstr "Meeting countdown"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:110
+msgid "Show time until your next meeting beside the tray icon."
+msgstr "Show time until your next meeting beside the tray icon."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:115
+msgid "Meetings"
+msgstr "Meetings"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:125
+msgid "Auto-join meetings"
+msgstr "Auto-join meetings"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:126
+msgid "Open the meeting link when your calendar event starts."
+msgstr "Open the meeting link when your calendar event starts."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:133
+msgid "Record unscheduled calls automatically"
+msgstr "Record unscheduled calls automatically"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:134
+msgid "Start recording detected calls outside your calendar."
+msgstr "Start recording detected calls outside your calendar."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:141
+msgid "Call detection notifications"
+msgstr "Call detection notifications"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:142
+msgid "Notify you when a call is detected and needs manual recording."
+msgstr "Notify you when a call is detected and needs manual recording."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:161
+msgid "Speaker tags"
+msgstr "Speaker tags"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:162
+msgid "Identify who is speaking in supported calls."
+msgstr "Identify who is speaking in supported calls."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:189
+msgid "Enable"
+msgstr "Enable"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:203
+msgid "Recording permissions"
+msgstr "Recording permissions"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:204
+msgid "Manage microphone, system audio, and call detection access."
+msgstr "Manage microphone, system audio, and call detection access."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:212
+msgid "Workspace"
+msgstr "Workspace"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:226
+msgid "Calendar settings"
+msgstr "Calendar settings"
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:227
+msgid "Manage your connected calendars in Twenty."
+msgstr "Manage your connected calendars in Twenty."
+
+#. js-lingui-explicit-id
+#: src/renderer/Settings.tsx:242
+msgid "Disconnect"
+msgstr "Disconnect"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:17
+msgid "Connect your workspace"
+msgstr "Connect your workspace"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:18
+msgid "Enter your workspace URL to sign in through your browser."
+msgstr "Enter your workspace URL to sign in through your browser."
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:29
+#: src/renderer/Onboarding.tsx:32
+msgid "Workspace URL"
+msgstr "Workspace URL"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:55
+msgid "Waiting for your browser…"
+msgstr "Waiting for your browser…"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:56
+msgid "Connect to Twenty"
+msgstr "Connect to Twenty"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:64
+msgid "Set up Desktop Recorder in Twenty"
+msgstr "Set up Desktop Recorder in Twenty"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:75
+msgid "You are ready"
+msgstr "You are ready"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:76
+msgid "for your next conversation"
+msgstr "for your next conversation"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:83
+msgid "Open my workspace"
+msgstr "Open my workspace"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:118
+msgid "Your workspace needs attention"
+msgstr "Your workspace needs attention"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:119
+msgid "Connecting your workspace"
+msgstr "Connecting your workspace"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:127
+msgid "Try again"
+msgstr "Try again"
+
+#. js-lingui-explicit-id
+#: src/renderer/Onboarding.tsx:132
+msgid "Your calendar and recording integration need to finish loading before setup can continue."
+msgstr "Your calendar and recording integration need to finish loading before setup can continue."
+
+#. js-lingui-explicit-id
+#: src/renderer/CompanionApp.tsx:41
+msgid "Navigation modes"
+msgstr "Navigation modes"
+
+#. js-lingui-explicit-id
+#: src/renderer/CompanionApp.tsx:47
+msgid "Home"
+msgstr "Home"
+
+#. js-lingui-explicit-id
+#: src/renderer/CompanionApp.tsx:53
+msgid "Settings"
+msgstr "Settings"
+
+#. js-lingui-explicit-id
+#: src/renderer/CompanionApp.tsx:74
+msgid "New recording"
+msgstr "New recording"
+
+#. js-lingui-explicit-id
+#: src/renderer/CompanionApp.tsx:81
+msgid "Interactive preview · sample data · no audio is captured"
+msgstr "Interactive preview · sample data · no audio is captured"
+
+#. js-lingui-explicit-id
+#: src/renderer/CompanionApp.tsx:93
+msgid "Opening your workspace"
+msgstr "Opening your workspace"
+
+#. js-lingui-explicit-id
+#: src/renderer/CompanionApp.tsx:95
+msgid "Loading your calendar and conversations…"
+msgstr "Loading your calendar and conversations…"
+
+#. js-lingui-explicit-id
+#: src/renderer/Home.tsx:43
+#: src/renderer/Home.tsx:44
diff --git a/packages/twenty-companion/src/renderer/locales/en.ts b/packages/twenty-companion/src/renderer/locales/en.ts
new file mode 100644
index 00000000000..483a0583ab0
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/locales/en.ts
@@ -0,0 +1,4 @@
+/*eslint-disable*/ import type { Messages } from '@lingui/core';
+export const messages = JSON.parse(
+ '{"A place for every conversation":["A place for every conversation"],"Appearance":["Appearance"],"Audio capture was interrupted. Check your microphone and speaker settings.":["Audio capture was interrupted. Check your microphone and speaker settings."],"Auto-join meetings":["Auto-join meetings"],"Auto-join skipped":["Auto-join skipped"],"Bring your calendar along":["Bring your calendar along"],"Calendar bot":["Calendar bot"],"Calendar bot recording":["Calendar bot recording"],"Calendar settings":["Calendar settings"],"Call detection notifications":["Call detection notifications"],"Change open companion shortcut":["Change open companion shortcut"],"Choose how Twenty looks on this computer.":["Choose how Twenty looks on this computer."],"Connect a calendar in Twenty to see your upcoming meetings.":["Connect a calendar in Twenty to see your upcoming meetings."],"Connect calendar":["Connect calendar"],"Connect to Twenty":["Connect to Twenty"],"Connect your workspace":["Connect your workspace"],"Connecting your workspace":["Connecting your workspace"],"Connection restored. Finish the interrupted recording before starting another.":["Connection restored. Finish the interrupted recording before starting another."],"Connection restored. Start a new recording to continue capturing.":["Connection restored. Start a new recording to continue capturing."],"Could not connect to the app. Reopen Twenty.":["Could not connect to the app. Reopen Twenty."],"Current recording":["Current recording"],"Dark":["Dark"],"Desktop recording available":["Desktop recording available"],"Detect calls and speakers":["Detect calls and speakers"],"Disconnect":["Disconnect"],"Dismiss message":["Dismiss message"],"Enable":["Enable"],"Enable accessibility":["Enable accessibility"],"Enable audio access to transcribe your conversations and save them in Twenty.":["Enable audio access to transcribe your conversations and save them in Twenty."],"Enable microphone":["Enable microphone"],"Enable system audio":["Enable system audio"],"Enabled":["Enabled"],"Enter your workspace URL to sign in through your browser.":["Enter your workspace URL to sign in through your browser."],"Finish":["Finish"],"Finish recording":["Finish recording"],"Finishing recording…":["Finishing recording…"],"General":["General"],"Home":["Home"],"Identify who is speaking in supported calls.":["Identify who is speaking in supported calls."],"Install Desktop Recorder":["Install Desktop Recorder"],"Interactive preview · sample data · no audio is captured":["Interactive preview · sample data · no audio is captured"],"Join":["Join"],"Keep Twenty ready in the background when you sign in.":["Keep Twenty ready in the background when you sign in."],"Launch at login":["Launch at login"],"Light":["Light"],"Loading your calendar and conversations…":["Loading your calendar and conversations…"],"Manage microphone, system audio, and call detection access.":["Manage microphone, system audio, and call detection access."],"Manage your connected calendars in Twenty.":["Manage your connected calendars in Twenty."],"Meeting countdown":["Meeting countdown"],"Meeting options":["Meeting options"],"Meetings":["Meetings"],"Navigation modes":["Navigation modes"],"Network connection lost. Stopping this recording. Reconnect before starting a new recording.":["Network connection lost. Stopping this recording. Reconnect before starting a new recording."],"New recording":["New recording"],"No matching recordings":["No matching recordings"],"Notify you when a call is detected and needs manual recording.":["Notify you when a call is detected and needs manual recording."],"Open Twenty from anywhere on your computer.":["Open Twenty from anywhere on your computer."],"Open companion shortcut":["Open companion shortcut"],"Open in Twenty":["Open in Twenty"],"Open my workspace":["Open my workspace"],"Open settings":["Open settings"],"Open the meeting link when your calendar event starts.":["Open the meeting link when your calendar event starts."],"Opening your workspace":["Opening your workspace"],"Opening {title}. Complete any meeting provider confirmation to enter.":["Opening ",["title"],". Complete any meeting provider confirmation to enter."],"Pause":["Pause"],"Pausing…":["Pausing…"],"Preparing":["Preparing"],"Press Control, Option / Alt, or Command with a key. Escape cancels.":["Press Control, Option / Alt, or Command with a key. Escape cancels."],"Press shortcut…":["Press shortcut…"],"Processing":["Processing"],"Recent conversation":["Recent conversation"],"Record call audio":["Record call audio"],"Record unscheduled calls automatically":["Record unscheduled calls automatically"],"Record your voice":["Record your voice"],"Recording":["Recording"],"Recording ended. Twenty is processing your conversation.":["Recording ended. Twenty is processing your conversation."],"Recording failed":["Recording failed"],"Recording is off":["Recording is off"],"Recording off":["Recording off"],"Recording paused":["Recording paused"],"Recording permissions":["Recording permissions"],"Recording stopped after the connection was lost. Reconnect to check its processing status.":["Recording stopped after the connection was lost. Reconnect to check its processing status."],"Recordings":["Recordings"],"Reset shortcut":["Reset shortcut"],"Restore auto-join":["Restore auto-join"],"Resume":["Resume"],"Resuming…":["Resuming…"],"Saved to Twenty":["Saved to Twenty"],"Search recordings":["Search recordings"],"Search recordings…":["Search recordings…"],"See more":["See more"],"Set up Desktop Recorder in Twenty":["Set up Desktop Recorder in Twenty"],"Set up recording":["Set up recording"],"Settings":["Settings"],"Show less":["Show less"],"Show time until your next meeting beside the tray icon.":["Show time until your next meeting beside the tray icon."],"Skip auto-join":["Skip auto-join"],"Speaker tags":["Speaker tags"],"Start a recording for an unscheduled conversation.":["Start a recording for an unscheduled conversation."],"Start recording":["Start recording"],"Start recording detected calls outside your calendar.":["Start recording detected calls outside your calendar."],"Starting recording…":["Starting recording…"],"System":["System"],"The app could not complete this action. Please try again.":["The app could not complete this action. Please try again."],"Try again":["Try again"],"Try another meeting title.":["Try another meeting title."],"Unknown participant":["Unknown participant"],"Waiting for your browser…":["Waiting for your browser…"],"Workspace":["Workspace"],"Workspace URL":["Workspace URL"],"You are ready":["You are ready"],"Your calendar and recording integration need to finish loading before setup can continue.":["Your calendar and recording integration need to finish loading before setup can continue."],"Your calendar is clear":["Your calendar is clear"],"Your recorded conversations will appear here and in your Twenty workspace.":["Your recorded conversations will appear here and in your Twenty workspace."],"Your workspace needs attention":["Your workspace needs attention"],"for your next conversation":["for your next conversation"]}',
+) as Messages;
diff --git a/packages/twenty-companion/src/renderer/main.tsx b/packages/twenty-companion/src/renderer/main.tsx
new file mode 100644
index 00000000000..b015953a386
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/main.tsx
@@ -0,0 +1,10 @@
+import { i18n } from '@lingui/core';
+import { messages } from './locales/en';
+import { createRoot } from 'react-dom/client';
+import { CompanionApp } from './components/CompanionApp';
+import './style.css';
+
+i18n.load('en', messages);
+i18n.activate('en');
+
+createRoot(document.getElementById('root')!).render(<CompanionApp />);
diff --git a/packages/twenty-companion/src/renderer/style.css b/packages/twenty-companion/src/renderer/style.css
new file mode 100644
index 00000000000..05e6355d5f8
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/style.css
@@ -0,0 +1,625 @@
+:root {
+ --onboarding-logo-opacity: 0.5;
+ --control-height-medium: 32px;
+ font-family: var(--t-font-family);
+ /* Twenty UI's rem tokens use the same 13 px baseline as twenty-front. */
+ font-size: 13px;
+ -webkit-font-smoothing: antialiased;
+ line-height: 1.45;
+ font-synthesis: none;
+ color-scheme: light dark;
+ color: var(--t-font-color-primary);
+ background: var(--t-background-primary);
+}
+* {
+ box-sizing: border-box;
+}
+body {
+ margin: 0;
+}
+button,
+input,
+select {
+ font: inherit;
+ color: inherit;
+}
+button {
+ cursor: pointer;
+}
+button,
+a,
+input,
+select {
+ -webkit-app-region: no-drag;
+}
+.recording-row:focus-visible,
+.settings-link:focus-visible,
+.workspace-url-field input:focus-visible {
+ outline: 2px solid var(--t-color-blue);
+ outline-offset: 3px;
+}
+h1,
+h2,
+h3,
+p {
+ margin: 0;
+}
+.setup-card h1 {
+ font-size: var(--t-font-size-xxl);
+ line-height: 1.3;
+ letter-spacing: -0.5px;
+}
+.setup-card h2 {
+ font-size: var(--t-font-size-xl);
+ line-height: 1.35;
+ letter-spacing: -0.3px;
+}
+strong {
+ font-weight: var(--t-font-weight-medium);
+}
+.setup-heading h1,
+.empty h2 {
+ font-family: var(--t-font-family);
+ font-weight: var(--t-font-weight-medium);
+}
+p {
+ line-height: 1.6;
+}
+.muted {
+ color: var(--t-font-color-secondary);
+}
+.small {
+ font-size: var(--t-font-size-sm);
+ line-height: 1.5;
+}
+.grow {
+ flex: 1;
+ min-width: 0;
+}
+.grow > .small {
+ display: block;
+}
+.button-group {
+ display: flex;
+ align-items: center;
+ gap: var(--t-spacing-2);
+}
+.shortcut-actions {
+ gap: var(--t-spacing-1);
+}
+.titlebar .button-group > div {
+ height: var(--header-control-height);
+}
+.workspace-url-field input {
+ width: 100%;
+ min-width: 0;
+ border: 1px solid var(--t-border-color-medium);
+ background: var(--t-background-primary);
+ border-radius: var(--t-border-radius-md);
+ height: var(--control-height-medium);
+ padding: 0 var(--t-spacing-2);
+}
+.app-shell {
+ --content-gutter: var(--t-spacing-4);
+ height: 100dvh;
+ min-height: 480px;
+ display: flex;
+}
+
+.main-area {
+ flex: 1;
+ min-width: 0;
+ display: flex;
+ flex-direction: column;
+ background: var(--t-background-primary);
+}
+.titlebar {
+ --header-control-height: var(--control-height-medium);
+ height: calc(var(--header-control-height) + 2 * var(--content-gutter));
+ flex-shrink: 0;
+ padding: 0 var(--content-gutter);
+ display: grid;
+ grid-template-columns: 1fr auto auto;
+ column-gap: var(--t-spacing-4);
+ align-items: center;
+ -webkit-app-region: drag;
+}
+.setup-titlebar {
+ position: absolute;
+ top: 0;
+ inset-inline: 0;
+ z-index: 2;
+}
+.scroll-area {
+ overflow: auto;
+ flex: 1;
+ min-height: 0;
+}
+.page-content {
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ max-width: 760px;
+ margin-inline: auto;
+ min-height: 100%;
+ box-sizing: border-box;
+ padding: var(--t-spacing-8) var(--content-gutter) var(--t-spacing-12);
+}
+.notice {
+ flex-shrink: 0;
+}
+.notification-container {
+ position: fixed;
+ right: var(--t-spacing-3);
+ bottom: var(--t-spacing-3);
+ max-width: calc(100% - 2 * var(--t-spacing-3));
+ z-index: 1000;
+}
+.notice-text {
+ flex: 1;
+ text-align: center;
+ margin-left: var(--t-spacing-8);
+}
+.notice .notice-close {
+ color: var(--t-font-color-inverted);
+}
+.preview-label {
+ background: var(--t-background-secondary);
+ border-bottom: 1px solid var(--t-border-color-medium);
+ padding: var(--t-spacing-1) var(--t-spacing-5);
+ color: var(--t-font-color-secondary);
+ font-size: var(--t-font-size-xs);
+ text-align: center;
+}
+.onboarding .main-area {
+ position: relative;
+ overflow: hidden;
+ isolation: isolate;
+ background: var(--t-background-tertiary);
+}
+.halftone-background {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+}
+.onboarding .scroll-area {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ padding: var(--t-spacing-12) var(--t-spacing-6);
+}
+.onboarding .notice,
+.onboarding .preview-label {
+ position: relative;
+ z-index: 2;
+ margin-top: var(--t-spacing-11);
+}
+.onboarding .preview-label + .notice {
+ margin-top: 0;
+}
+.setup-frame {
+ width: 100%;
+ max-width: calc(440px + 2 * var(--t-spacing-8) + 2px);
+ flex-shrink: 0;
+ margin: auto;
+ position: relative;
+}
+.setup-logo {
+ position: absolute;
+ width: 40px;
+ height: 40px;
+ left: 50%;
+ top: min(-28px, calc((100% - 100vh) / 4));
+ transform: translate(-50%, -50%);
+ background: var(--t-background-tertiary);
+ border-radius: var(--t-border-radius-md);
+ corner-shape: squircle;
+}
+.setup-logo::before {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: var(--t-font-color-primary);
+ opacity: var(--onboarding-logo-opacity);
+ mask: url('./assets/twenty-mark.svg') center / contain no-repeat;
+}
+.light .setup-logo::before {
+ background: url('./assets/twenty-logo.svg') center / contain no-repeat;
+ opacity: 1;
+ mask: none;
+}
+.setup-container {
+ width: 100%;
+ max-width: calc(440px + 2 * var(--t-spacing-8) + 2px);
+ flex-shrink: 0;
+ margin: auto;
+ padding: var(--t-spacing-8);
+ border-radius: var(--t-border-radius-md);
+ border: 1px solid var(--t-border-color-medium);
+ background: var(--t-background-primary);
+}
+.setup-container .permission-list,
+.setup-container .permission-item + .permission-item,
+.setup-container input {
+ border-color: var(--t-border-color-medium);
+}
+.setup-card {
+ display: grid;
+ gap: var(--t-spacing-8);
+}
+.setup-heading {
+ text-align: center;
+ display: grid;
+ gap: var(--t-spacing-4);
+}
+.setup-heading h1 > span {
+ display: block;
+}
+.setup-heading p {
+ text-wrap: balance;
+}
+.permission-list {
+ overflow: hidden;
+}
+.permission-item {
+ display: flex;
+ align-items: center;
+ padding: var(--t-spacing-4);
+ gap: var(--t-spacing-3);
+}
+.permission-item + .permission-item {
+ border-top: 1px solid var(--t-border-color-medium);
+}
+.permission-icon {
+ color: var(--t-font-color-secondary);
+ display: flex;
+}
+.welcome form {
+ display: grid;
+ gap: var(--t-spacing-6);
+}
+.workspace-url-field {
+ display: grid;
+ gap: var(--t-spacing-2);
+}
+.welcome label {
+ font-size: var(--t-font-size-sm);
+ font-weight: var(--t-font-weight-medium);
+}
+.section {
+ margin-top: var(--t-spacing-9);
+}
+.agenda-list {
+ overflow: hidden;
+}
+.agenda-day {
+ display: flex;
+ gap: var(--t-spacing-3);
+ padding: 0 var(--t-spacing-4);
+}
+.agenda-day + .agenda-day {
+ border-top: 1px solid var(--t-border-color-light);
+}
+.agenda-date {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ align-self: flex-start;
+ gap: 0;
+ width: var(--t-spacing-6);
+ min-height: var(--t-spacing-16);
+ flex-shrink: 0;
+}
+.agenda-day-meetings {
+ min-width: 0;
+ flex: 1;
+}
+.agenda-row {
+ display: flex;
+ align-items: center;
+ gap: var(--t-spacing-2);
+ min-height: var(--t-spacing-16);
+ padding: var(--t-spacing-3) 0;
+}
+.agenda-meeting-details {
+ min-width: 0;
+ position: relative;
+}
+.agenda-actions {
+ display: flex;
+ align-items: center;
+ gap: var(--t-spacing-1);
+ flex-shrink: 0;
+}
+.meeting-menu {
+ z-index: 1000;
+}
+@media (hover: hover) and (pointer: fine) {
+ .agenda-row:not([data-next]):not(:hover):not(:focus-within) .agenda-actions {
+ opacity: 0;
+ pointer-events: none;
+ }
+}
+.agenda-meeting-details .agenda-event-indicator {
+ background: var(--t-border-color-strong);
+ width: 1px;
+}
+.agenda-event-indicator {
+ position: absolute;
+ left: calc(-1 * var(--t-spacing-2));
+ top: 0;
+ bottom: 0;
+}
+.agenda-meeting-details strong {
+ display: block;
+ font-size: var(--t-font-size-md);
+ font-weight: var(--t-font-weight-medium);
+ color: var(--t-font-color-primary);
+ overflow-wrap: anywhere;
+}
+.agenda-meeting-details .small {
+ margin-top: var(--t-spacing-1);
+ font-size: var(--t-font-size-sm);
+ font-variant-numeric: tabular-nums;
+ color: var(--t-font-color-tertiary);
+}
+.recording-list {
+ display: grid;
+ overflow: hidden;
+}
+.recording-row {
+ display: flex;
+ align-items: center;
+ gap: var(--t-spacing-3);
+ padding: var(--t-spacing-3) var(--t-spacing-4);
+ margin: 0;
+ width: 100%;
+ text-align: left;
+ background: transparent;
+ border: 0;
+ border-radius: 0;
+ color: var(--t-font-color-primary);
+ min-height: var(--t-spacing-16);
+}
+.recording-row:hover:not(:disabled) {
+ background: var(--t-background-tertiary);
+}
+.recording-row .grow {
+ display: grid;
+ gap: var(--t-spacing-1);
+}
+.recording-row strong {
+ font-size: var(--t-font-size-md);
+ font-weight: var(--t-font-weight-medium);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.recording-row + .recording-row {
+ border-top: 1px solid var(--t-border-color-light);
+}
+.recording-metadata {
+ display: grid;
+ justify-items: end;
+ align-self: flex-start;
+ gap: var(--t-spacing-1);
+ flex-shrink: 0;
+}
+.empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ text-align: center;
+ padding: var(--t-spacing-11) var(--t-spacing-6);
+ gap: var(--t-spacing-6);
+}
+.empty-copy {
+ display: grid;
+ justify-items: center;
+ gap: var(--t-spacing-3);
+}
+.empty-actions {
+ display: flex;
+ justify-content: center;
+ gap: var(--t-spacing-2);
+}
+.empty-icon {
+ color: var(--t-font-color-tertiary);
+ display: grid;
+ place-items: center;
+ width: 48px;
+ height: 48px;
+ background: var(--t-background-secondary);
+ border-radius: var(--t-border-radius-md);
+ margin-bottom: var(--t-spacing-1);
+}
+.empty h2 {
+ color: var(--t-font-color-primary);
+ font-size: var(--t-font-size-lg);
+ font-weight: var(--t-font-weight-semi-bold);
+ line-height: 1.2;
+}
+.empty .muted {
+ text-wrap: balance;
+ max-width: 400px;
+ color: var(--t-font-color-tertiary);
+ font-size: var(--t-font-size-md);
+ font-weight: var(--t-font-weight-regular);
+ line-height: 1.4;
+}
+.live-card {
+ padding: var(--t-spacing-4) var(--t-spacing-5);
+ margin-bottom: var(--t-spacing-6);
+}
+.live-heading {
+ display: flex;
+ gap: var(--t-spacing-3);
+ align-items: center;
+}
+.live-heading .small {
+ margin-top: var(--t-spacing-1);
+}
+.live-heading .live-title {
+ margin-bottom: var(--t-spacing-1);
+}
+.live-actions {
+ display: flex;
+ gap: var(--t-spacing-2);
+ margin-top: var(--t-spacing-4);
+}
+.live-card time {
+ font-variant-numeric: tabular-nums;
+}
+.settings-group {
+ overflow: hidden;
+}
+.toggle-row {
+ display: block;
+ cursor: pointer;
+}
+.settings-group > :not(:last-child) {
+ border-bottom: 1px solid var(--t-border-color-medium);
+}
+.settings-link {
+ padding: 0;
+ width: 100%;
+ border: 0;
+ background: transparent;
+ text-align: left;
+}
+.settings-link:not(:disabled):hover {
+ background: var(--t-background-transparent-light);
+}
+.settings-link:focus-visible {
+ outline-offset: -3px;
+}
+.workspace-avatar {
+ display: flex;
+ flex-shrink: 0;
+}
+@media (prefers-reduced-motion: reduce) {
+ *,
+ *::before,
+ *::after {
+ animation: none !important;
+ transition: none !important;
+ }
+}
+
+/* Reserve native window controls and the sharing indicator independently of navigation. */
+.mac-titlebar {
+ grid-template-columns: 96px 1fr auto auto;
+}
+.mac-titlebar::before {
+ content: '';
+ grid-column: 1;
+ grid-row: 1;
+}
+.titlebar > .header-navigation {
+ grid-column: -3;
+ grid-row: 1;
+ height: var(--header-control-height);
+}
+.titlebar > .button-group {
+ grid-column: -2;
+ grid-row: 1;
+ height: var(--header-control-height);
+ padding-left: var(--t-spacing-4);
+ position: relative;
+}
+.titlebar > .button-group::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ height: var(--t-spacing-5);
+ border-left: 1px solid var(--t-border-color-medium);
+}
+.titlebar .header-navigation button,
+.titlebar .button-group button {
+ box-sizing: border-box;
+ height: var(--header-control-height);
+ min-height: var(--header-control-height);
+}
+.header-navigation {
+ display: flex;
+ align-items: center;
+ gap: var(--t-spacing-3);
+ min-width: 0;
+}
+.see-more {
+ margin-top: var(--t-spacing-2);
+}
+
+.settings-link:disabled,
+.recording-row:disabled {
+ color: var(--t-font-color-extra-light);
+ cursor: not-allowed;
+}
+.settings-link:disabled > *,
+.settings-link:disabled .muted,
+.recording-row:disabled .muted,
+.settings-link:disabled > svg {
+ color: inherit;
+}
+
+.recordings-section:has(> .empty) {
+ display: flex;
+ flex-direction: column;
+ flex: 1;
+}
+.recordings-section > .empty {
+ flex: 1;
+ justify-content: center;
+}
+.light {
+ --halftone-opacity: 0.1;
+ --halftone-accent-opacity: 0;
+ --halftone-accent-center-y: 0.84;
+ --halftone-accent-radius-x: 0.32;
+ --halftone-accent-radius-y: 0.25;
+ --halftone-edge-fade: 1;
+}
+.dark {
+ --halftone-opacity: 0.55;
+ --halftone-accent-opacity: 0.55;
+ --halftone-accent-center-y: 0.65;
+ --halftone-accent-radius-x: 0.55;
+ --halftone-accent-radius-y: 0.75;
+ --halftone-edge-fade: 0;
+}
+@media (max-width: 880px) {
+ .page-content {
+ padding: var(--t-spacing-7) var(--content-gutter) var(--t-spacing-10);
+ }
+ .permission-item {
+ padding: var(--t-spacing-4) var(--t-spacing-3);
+ gap: var(--t-spacing-2);
+ }
+ .header-navigation {
+ gap: var(--t-spacing-2);
+ }
+}
+@media (max-width: 680px) {
+ .onboarding .scroll-area {
+ padding: var(--t-spacing-16) var(--t-spacing-4) var(--t-spacing-6);
+ }
+ .setup-container {
+ padding: var(--t-spacing-7) var(--t-spacing-6);
+ }
+ .page-content {
+ padding: var(--t-spacing-6) var(--content-gutter);
+ }
+ .permission-item {
+ flex-wrap: wrap;
+ }
+ .permission-item > .grow {
+ min-width: 170px;
+ }
+}
+
+.settings-link:disabled {
+ opacity: 0.5;
+}
diff --git a/packages/twenty-companion/src/renderer/types/ActionProps.ts b/packages/twenty-companion/src/renderer/types/ActionProps.ts
new file mode 100644
index 00000000000..24f92ea1a31
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/types/ActionProps.ts
@@ -0,0 +1,8 @@
+import { type CompanionCommand } from '../../shared/types/CompanionCommand';
+import { type CompanionState } from '../../shared/types/CompanionState';
+
+export type ActionProps = {
+ state: CompanionState;
+ isPending: (...types: CompanionCommand['type'][]) => boolean;
+ command: (command: CompanionCommand) => Promise<void>;
+};
diff --git a/packages/twenty-companion/src/renderer/types/Window.d.ts b/packages/twenty-companion/src/renderer/types/Window.d.ts
new file mode 100644
index 00000000000..b27b1d93498
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/types/Window.d.ts
@@ -0,0 +1,7 @@
+import { type CompanionBridge } from '../../shared/types/CompanionBridge';
+
+declare global {
+ interface Window {
+ companion?: CompanionBridge;
+ }
+}
diff --git a/packages/twenty-companion/src/renderer/utils/createHalftone.ts b/packages/twenty-companion/src/renderer/utils/createHalftone.ts
new file mode 100644
index 00000000000..621eb0e96fd
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/createHalftone.ts
@@ -0,0 +1,302 @@
+// Based on the supplied Halftone Studio export. The grid stays
+// in CSS pixels so resizing the window never magnifies the dashes.
+const EFFECT_SCALE = 1.04;
+
+const TILE_SIZE = 10.91 * (4 / 6) * EFFECT_SCALE;
+
+const POWER = -0.07;
+
+const POWER_AMPLITUDE = 0.28;
+
+const ANIMATION_PERIOD_MS = 8_000;
+
+const FRAME_INTERVAL_MS = 1_000 / 24;
+
+const VERTEX_SHADER = `#version 300 es
+ in vec2 position;
+ out vec2 imagePosition;
+ void main() {
+ imagePosition = position * 0.5 + 0.5;
+ gl_Position = vec4(position, 0.0, 1.0);
+ }
+`;
+
+const FRAGMENT_SHADER = `#version 300 es
+ precision highp float;
+ uniform sampler2D sourceImage;
+ uniform vec2 viewportSize;
+ uniform float imageAspect;
+ uniform float effectScale;
+ uniform float tileSize;
+ uniform float power;
+ uniform float time;
+ uniform float inkOpacity;
+ uniform float accentOpacity;
+ uniform vec3 accentRegion;
+ uniform float edgeFade;
+ in vec2 imagePosition;
+ out vec4 fragmentColor;
+
+ vec2 coverImage(vec2 position) {
+ float viewportAspect = viewportSize.x / viewportSize.y;
+ if (imageAspect > viewportAspect) {
+ position.x = (position.x - 0.5) * viewportAspect / imageAspect + 0.5;
+ } else {
+ position.y = (position.y - 0.5) * imageAspect / viewportAspect + 0.5;
+ }
+ return (position - 0.5) / effectScale + 0.5;
+ }
+
+ vec3 linearColor(vec3 color) {
+ return mix(pow((color + 0.055) / 1.055, vec3(2.4)),
+ color / 12.92, lessThanEqual(color, vec3(0.04045)));
+ }
+
+ void main() {
+ vec2 gridPosition = imagePosition * viewportSize / tileSize;
+ vec2 samplePosition = (floor(gridPosition) + 0.5) * tileSize / viewportSize;
+ vec2 sampleUv = coverImage(samplePosition);
+ vec4 sampleColor = texture(sourceImage, clamp(sampleUv, 0.0, 1.0));
+ float tone = dot(linearColor(sampleColor.rgb), vec3(1.0 / 3.0));
+ float wave = sin(samplePosition.x * 5.0 + samplePosition.y * 3.0 - time * 0.65);
+ float radius = clamp(tone + (power + wave * 0.16) * length(vec2(0.5)) / 3.0, 0.0, 1.0) * 0.93;
+ vec2 cellPosition = fract(gridPosition) - 0.5;
+ float distanceToSegment = length(vec2(
+ max(abs(cellPosition.x) - radius, 0.0), cellPosition.y));
+ float signedDistance = distanceToSegment - 0.46 * radius;
+ float edge = max(0.02, fwidth(signedDistance));
+ float alpha = (1.0 - smoothstep(0.0, edge, signedDistance))
+ * step(0.0001, radius) * sampleColor.a;
+ float ink = (60.0 + 12.0 * wave) / 255.0;
+ float blueWeight = 1.0 - smoothstep(0.15, 1.0,
+ length((imagePosition - vec2(0.5, accentRegion.x)) / accentRegion.yz));
+ blueWeight *= step(0.0001, accentOpacity);
+ float edgeVisibility = mix(1.0,
+ (1.0 - smoothstep(0.2, 0.5, abs(imagePosition.x - 0.5)))
+ * smoothstep(0.0, 0.55, imagePosition.y), edgeFade);
+ vec3 brandBlue = vec3(25.0, 97.0, 237.0) / 255.0;
+ float opacity = mix(inkOpacity, accentOpacity, blueWeight);
+ vec3 inkColor = mix(vec3(ink) * inkOpacity, brandBlue * accentOpacity, blueWeight);
+
+ // One sparse mote per cell avoids a particle loop at every screen pixel.
+ vec2 pixelPosition = imagePosition * viewportSize;
+ vec2 particleCell = floor(pixelPosition / 180.0);
+ float seed = fract(sin(dot(particleCell, vec2(127.1, 311.7))) * 43758.5453);
+ float phase = fract(time / 18.0 + seed);
+ vec2 particlePosition = vec2(
+ 45.0 + seed * 90.0 + sin(time * 0.35 + seed * 6.28) * 12.0,
+ 25.0 + phase * 130.0);
+ float particleDistance = length(mod(pixelPosition, 180.0) - particlePosition);
+ float particle = (1.0 - smoothstep(0.7, 2.0, particleDistance))
+ * pow(sin(phase * 3.14159), 2.0) * 0.45 * inkOpacity;
+ vec3 particleColor = mix(vec3(0.52), vec3(0.38, 0.62, 0.95), blueWeight);
+ fragmentColor = vec4(particleColor * particle + inkColor * alpha * (1.0 - particle),
+ particle + alpha * opacity * (1.0 - particle)) * edgeVisibility;
+ }
+`;
+
+const compileShader = (
+ context: WebGL2RenderingContext,
+ shaderType: number,
+ source: string,
+) => {
+ const shader = context.createShader(shaderType);
+ if (!shader) throw new Error('Could not create the halftone shader.');
+ context.shaderSource(shader, source);
+ context.compileShader(shader);
+ if (!context.getShaderParameter(shader, context.COMPILE_STATUS)) {
+ const message = context.getShaderInfoLog(shader);
+ context.deleteShader(shader);
+ throw new Error(message ?? 'Could not compile the halftone shader.');
+ }
+ return shader;
+};
+
+export const createHalftone = (
+ canvas: HTMLCanvasElement,
+ image: HTMLImageElement,
+) => {
+ const context = canvas.getContext('webgl2', {
+ alpha: true,
+ antialias: false,
+ depth: false,
+ powerPreference: 'low-power',
+ });
+ if (!context) return;
+
+ const program = context.createProgram();
+ const buffer = context.createBuffer();
+ const texture = context.createTexture();
+ const shaders: WebGLShader[] = [];
+ const disposeResources = () => {
+ shaders.forEach((shader) => context.deleteShader(shader));
+ context.deleteTexture(texture);
+ context.deleteBuffer(buffer);
+ context.deleteProgram(program);
+ };
+
+ try {
+ if (!program || !buffer || !texture)
+ throw new Error('Could not allocate the halftone renderer.');
+ shaders.push(compileShader(context, context.VERTEX_SHADER, VERTEX_SHADER));
+ shaders.push(
+ compileShader(context, context.FRAGMENT_SHADER, FRAGMENT_SHADER),
+ );
+ shaders.forEach((shader) => context.attachShader(program, shader));
+ context.linkProgram(program);
+ if (!context.getProgramParameter(program, context.LINK_STATUS))
+ throw new Error(
+ context.getProgramInfoLog(program) ??
+ 'Could not link the halftone shader.',
+ );
+ context.useProgram(program);
+ context.bindBuffer(context.ARRAY_BUFFER, buffer);
+ context.bufferData(
+ context.ARRAY_BUFFER,
+ new Float32Array([-1, -1, 3, -1, -1, 3]),
+ context.STATIC_DRAW,
+ );
+ const position = context.getAttribLocation(program, 'position');
+ context.enableVertexAttribArray(position);
+ context.vertexAttribPointer(position, 2, context.FLOAT, false, 0, 0);
+ context.bindTexture(context.TEXTURE_2D, texture);
+ context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true);
+ context.texParameteri(
+ context.TEXTURE_2D,
+ context.TEXTURE_MIN_FILTER,
+ context.LINEAR,
+ );
+ context.texParameteri(
+ context.TEXTURE_2D,
+ context.TEXTURE_MAG_FILTER,
+ context.LINEAR,
+ );
+ context.texParameteri(
+ context.TEXTURE_2D,
+ context.TEXTURE_WRAP_S,
+ context.CLAMP_TO_EDGE,
+ );
+ context.texParameteri(
+ context.TEXTURE_2D,
+ context.TEXTURE_WRAP_T,
+ context.CLAMP_TO_EDGE,
+ );
+ context.texImage2D(
+ context.TEXTURE_2D,
+ 0,
+ context.RGBA,
+ context.RGBA,
+ context.UNSIGNED_BYTE,
+ image,
+ );
+ context.uniform1i(context.getUniformLocation(program, 'sourceImage'), 0);
+ context.uniform1f(
+ context.getUniformLocation(program, 'imageAspect'),
+ image.naturalWidth / image.naturalHeight,
+ );
+ context.uniform1f(
+ context.getUniformLocation(program, 'tileSize'),
+ TILE_SIZE,
+ );
+ context.uniform1f(
+ context.getUniformLocation(program, 'effectScale'),
+ EFFECT_SCALE,
+ );
+ } catch (error) {
+ disposeResources();
+ throw error;
+ }
+
+ const viewportUniform = context.getUniformLocation(program, 'viewportSize');
+ const powerUniform = context.getUniformLocation(program, 'power');
+ const timeUniform = context.getUniformLocation(program, 'time');
+ const inkOpacityUniform = context.getUniformLocation(program, 'inkOpacity');
+ const accentOpacityUniform = context.getUniformLocation(
+ program,
+ 'accentOpacity',
+ );
+ const accentRegionUniform = context.getUniformLocation(
+ program,
+ 'accentRegion',
+ );
+ const edgeFadeUniform = context.getUniformLocation(program, 'edgeFade');
+ const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
+ let animationFrame = 0;
+ let previousFrame = 0;
+ let elapsed = 0;
+
+ const draw = () => {
+ const style = getComputedStyle(canvas);
+ context.uniform1f(
+ inkOpacityUniform,
+ Number(style.getPropertyValue('--halftone-opacity')),
+ );
+ context.uniform1f(
+ accentOpacityUniform,
+ Number(style.getPropertyValue('--halftone-accent-opacity')),
+ );
+ context.uniform3f(
+ accentRegionUniform,
+ Number(style.getPropertyValue('--halftone-accent-center-y')),
+ Number(style.getPropertyValue('--halftone-accent-radius-x')),
+ Number(style.getPropertyValue('--halftone-accent-radius-y')),
+ );
+ context.uniform1f(
+ edgeFadeUniform,
+ Number(style.getPropertyValue('--halftone-edge-fade')),
+ );
+ const power =
+ POWER +
+ (reducedMotion.matches
+ ? 0
+ : POWER_AMPLITUDE *
+ Math.sin((elapsed * 2 * Math.PI) / ANIMATION_PERIOD_MS));
+ context.uniform1f(powerUniform, power);
+ context.uniform1f(timeUniform, reducedMotion.matches ? 0 : elapsed / 1_000);
+ context.drawArrays(context.TRIANGLES, 0, 3);
+ };
+ const animate = (timestamp: number) => {
+ if (timestamp - previousFrame >= FRAME_INTERVAL_MS) {
+ elapsed += Math.min(timestamp - previousFrame, 100);
+ previousFrame = timestamp;
+ draw();
+ }
+ animationFrame = window.requestAnimationFrame(animate);
+ };
+ const updateAnimation = () => {
+ window.cancelAnimationFrame(animationFrame);
+ if (document.hidden) return;
+ draw();
+ previousFrame = performance.now();
+ if (!reducedMotion.matches)
+ animationFrame = window.requestAnimationFrame(animate);
+ };
+ const resize = () => {
+ const { width, height } = canvas.getBoundingClientRect();
+ const pixelRatio = Math.min(window.devicePixelRatio, 2);
+ canvas.width = Math.max(1, Math.round(width * pixelRatio));
+ canvas.height = Math.max(1, Math.round(height * pixelRatio));
+ context.viewport(0, 0, canvas.width, canvas.height);
+ context.uniform2f(viewportUniform, Math.max(width, 1), Math.max(height, 1));
+ updateAnimation();
+ };
+ const observer = new ResizeObserver(resize);
+ observer.observe(canvas);
+ document.addEventListener('visibilitychange', updateAnimation);
+ reducedMotion.addEventListener('change', updateAnimation);
+ const themeObserver = new MutationObserver(updateAnimation);
+ themeObserver.observe(document.documentElement, {
+ attributes: true,
+ attributeFilter: ['class'],
+ });
+ resize();
+
+ return () => {
+ window.cancelAnimationFrame(animationFrame);
+ observer.disconnect();
+ themeObserver.disconnect();
+ document.removeEventListener('visibilitychange', updateAnimation);
+ reducedMotion.removeEventListener('change', updateAnimation);
+ disposeResources();
+ };
+};
diff --git a/packages/twenty-companion/src/renderer/utils/elapsedRecording.ts b/packages/twenty-companion/src/renderer/utils/elapsedRecording.ts
new file mode 100644
index 00000000000..971575dc8ee
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/elapsedRecording.ts
@@ -0,0 +1,21 @@
+import { type ActiveRecording } from '../../shared/types/ActiveRecording';
+
+export const elapsedRecording = (recording: ActiveRecording, now: number) => {
+ const end = recording.pausedAt ? Date.parse(recording.pausedAt) : now;
+ const seconds = Math.max(
+ 0,
+ Math.floor(
+ (end -
+ Date.parse(recording.startedAt) -
+ (recording.pausedMilliseconds ?? 0)) /
+ 1000,
+ ),
+ );
+ return (
+ Math.floor(seconds / 60)
+ .toString()
+ .padStart(2, '0') +
+ ':' +
+ (seconds % 60).toString().padStart(2, '0')
+ );
+};
diff --git a/packages/twenty-companion/src/renderer/utils/formatDate.ts b/packages/twenty-companion/src/renderer/utils/formatDate.ts
new file mode 100644
index 00000000000..5f7db4e3336
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/formatDate.ts
@@ -0,0 +1,2 @@
+export const formatDate = (value: string) =>
+ new Date(value).toLocaleDateString([], { month: 'short', day: 'numeric' });
diff --git a/packages/twenty-companion/src/renderer/utils/formatShortcut.ts b/packages/twenty-companion/src/renderer/utils/formatShortcut.ts
new file mode 100644
index 00000000000..6b5f0434fb9
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/formatShortcut.ts
@@ -0,0 +1,12 @@
+export const formatShortcut = (shortcut: string, isMac: boolean): string => {
+ const modifiers: Record<string, string> = {
+ CommandOrControl: isMac ? '⌘' : 'Ctrl',
+ Command: '⌘',
+ Control: 'Ctrl',
+ Alt: isMac ? '⌥' : 'Alt',
+ };
+ return shortcut
+ .split('+')
+ .map((key) => modifiers[key] ?? key)
+ .join(' + ');
+};
diff --git a/packages/twenty-companion/src/renderer/utils/formatTime.ts b/packages/twenty-companion/src/renderer/utils/formatTime.ts
new file mode 100644
index 00000000000..ad9caee655e
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/formatTime.ts
@@ -0,0 +1,5 @@
+export const formatTime = (value: string) =>
+ new Date(value).toLocaleTimeString([], {
+ hour: '2-digit',
+ minute: '2-digit',
+ });
diff --git a/packages/twenty-companion/src/renderer/utils/noticeMessage.ts b/packages/twenty-companion/src/renderer/utils/noticeMessage.ts
new file mode 100644
index 00000000000..af096e36dce
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/noticeMessage.ts
@@ -0,0 +1,36 @@
+import { i18n } from '@lingui/core';
+import { type CompanionNotice } from '../../shared/types/CompanionNotice';
+
+export const noticeMessage = (notice: CompanionNotice): string => {
+ switch (notice.type) {
+ case 'preview':
+ return notice.message;
+ case 'opening-meeting':
+ return i18n._(
+ 'Opening {title}. Complete any meeting provider confirmation to enter.',
+ { title: notice.title },
+ );
+ case 'recording-finished':
+ return i18n._('Recording ended. Twenty is processing your conversation.');
+ case 'network-lost':
+ return i18n._(
+ 'Network connection lost. Stopping this recording. Reconnect before starting a new recording.',
+ );
+ case 'network-restored-active':
+ return i18n._(
+ 'Connection restored. Finish the interrupted recording before starting another.',
+ );
+ case 'network-restored':
+ return i18n._(
+ 'Connection restored. Start a new recording to continue capturing.',
+ );
+ case 'audio-interrupted':
+ return i18n._(
+ 'Audio capture was interrupted. Check your microphone and speaker settings.',
+ );
+ case 'recording-stopped-offline':
+ return i18n._(
+ 'Recording stopped after the connection was lost. Reconnect to check its processing status.',
+ );
+ }
+};
diff --git a/packages/twenty-companion/src/renderer/utils/previewCommand.ts b/packages/twenty-companion/src/renderer/utils/previewCommand.ts
new file mode 100644
index 00000000000..e1a67522cdb
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/previewCommand.ts
@@ -0,0 +1,144 @@
+import { type CompanionCommand } from '../../shared/types/CompanionCommand';
+import { type CompanionState } from '../../shared/types/CompanionState';
+
+export const previewCommand = (
+ state: CompanionState,
+ command: CompanionCommand,
+): CompanionState => {
+ const next = structuredClone(state);
+ next.error = null;
+ switch (command.type) {
+ case 'connect':
+ next.connection = 'connected';
+ next.serverUrl = command.serverUrl;
+ next.updatedAt = new Date().toISOString();
+ break;
+ case 'disconnect':
+ Object.assign(next, {
+ connection: 'disconnected',
+ workspace: null,
+ meetings: [],
+ recordings: [],
+ calendarConnected: false,
+ updatedAt: null,
+ detectedCalls: [],
+ permissionSetup: null,
+ skippedMeetingIds: [],
+ notice: null,
+ });
+ break;
+ case 'permission':
+ next.permissions[command.permission] = 'granted';
+ break;
+ case 'begin-permission-setup':
+ next.permissionSetup = {};
+ break;
+ case 'cancel-permission-setup':
+ next.permissionSetup = null;
+ break;
+ case 'complete-setup':
+ if (
+ Object.values(next.permissions).every((status) => status === 'granted')
+ ) {
+ next.settings.setupCompleted = true;
+ next.permissionSetup = null;
+ }
+ break;
+ case 'record':
+ if (
+ !Object.values(next.permissions).every((status) => status === 'granted')
+ ) {
+ next.permissionSetup = { windowId: command.windowId, intent: 'record' };
+ break;
+ }
+ next.permissionSetup = null;
+ next.activeRecording = {
+ id: '00000000-0000-4000-8000-000000000006',
+ windowId: 'preview-call',
+ title: 'Unscheduled conversation',
+ startedAt: new Date().toISOString(),
+ status: 'recording',
+ };
+ break;
+ case 'pause':
+ if (next.activeRecording) {
+ next.activeRecording.status = 'paused';
+ next.activeRecording.pausedAt = new Date().toISOString();
+ }
+ break;
+ case 'resume':
+ if (next.activeRecording) {
+ next.activeRecording.status = 'recording';
+ next.activeRecording.pausedMilliseconds =
+ (next.activeRecording.pausedMilliseconds ?? 0) +
+ (next.activeRecording.pausedAt
+ ? Date.now() - Date.parse(next.activeRecording.pausedAt)
+ : 0);
+ next.activeRecording.pausedAt = undefined;
+ }
+ break;
+ case 'stop':
+ if (next.activeRecording)
+ next.recordings.unshift({
+ id: next.activeRecording.id,
+ title: next.activeRecording.title,
+ startedAt: next.activeRecording.startedAt,
+ endedAt: new Date().toISOString(),
+ status: 'PROCESSING',
+ });
+ next.activeRecording = null;
+ next.notice = {
+ type: 'preview',
+ message:
+ 'Preview recording finished. Refresh to simulate completed processing.',
+ };
+ break;
+ case 'settings':
+ next.settings = { ...next.settings, ...command.settings };
+ break;
+ case 'skip':
+ next.skippedMeetingIds.push(command.meetingId);
+ break;
+ case 'unskip':
+ next.skippedMeetingIds = next.skippedMeetingIds.filter(
+ (id) => id !== command.meetingId,
+ );
+ break;
+ case 'join':
+ next.notice = {
+ type: 'preview',
+ message:
+ 'Preview only. A live meeting link would open in your browser.',
+ };
+ break;
+ case 'open-recording':
+ next.notice = {
+ type: 'preview',
+ message:
+ 'Preview only. This opens the recording in your Twenty workspace.',
+ };
+ break;
+ case 'open-recordings':
+ next.notice = {
+ type: 'preview',
+ message:
+ 'Preview only. This opens all recordings in your Twenty workspace.',
+ };
+ break;
+ case 'open-calendar-settings':
+ next.notice = {
+ type: 'preview',
+ message: 'Preview only. This opens calendar settings in Twenty.',
+ };
+ break;
+ case 'refresh':
+ next.recordings.forEach((recording) => {
+ if (recording.status === 'PROCESSING') recording.status = 'COMPLETED';
+ });
+ break;
+ case 'dismiss-error':
+ next.notice = null;
+ break;
+ }
+ return next;
+};
diff --git a/packages/twenty-companion/src/renderer/utils/previewState.ts b/packages/twenty-companion/src/renderer/utils/previewState.ts
new file mode 100644
index 00000000000..6a2f26a5b9f
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/previewState.ts
@@ -0,0 +1,142 @@
+import { type CompanionState } from '../../shared/types/CompanionState';
+
+export const previewState = (initial: CompanionState): CompanionState => {
+ const now = Date.now();
+ const at = (minutes: number) =>
+ new Date(now + minutes * 60_000).toISOString();
+ const scenario = new URLSearchParams(window.location.search).get('preview');
+ const state: CompanionState = {
+ ...initial,
+ connection: 'connected',
+ workspace: { id: 'preview', name: 'Acme' },
+ calendarConnected: true,
+ settings: {
+ ...initial.settings,
+ setupCompleted: !['welcome', 'permissions', 'denied'].includes(
+ scenario ?? '',
+ ),
+ },
+ permissions: ['welcome', 'permissions', 'denied'].includes(scenario ?? '')
+ ? {
+ microphone: scenario === 'denied' ? 'denied' : 'not_requested',
+ 'system-audio': 'not_requested',
+ accessibility: 'not_requested',
+ }
+ : {
+ microphone: 'granted',
+ 'system-audio': 'granted',
+ accessibility: 'granted',
+ },
+ updatedAt: at(0),
+ meetings: [
+ {
+ id: '00000000-0000-4000-8000-000000000001',
+ title: 'Design sync',
+ startsAt: at(7),
+ endsAt: at(37),
+ url: 'https://meet.google.com/example',
+ recordingEnabled: true,
+ usesCalendarBot: true,
+ },
+ {
+ id: '00000000-0000-4000-8000-000000000002',
+ title: 'Customer conversation',
+ startsAt: at(67),
+ endsAt: at(97),
+ url: 'https://meet.google.com/example-two',
+ recordingEnabled: true,
+ usesCalendarBot: true,
+ },
+ {
+ id: '00000000-0000-4000-8000-000000000003',
+ title: 'Weekly team check-in',
+ startsAt: at(127),
+ endsAt: at(157),
+ url: 'https://meet.google.com/example-three',
+ recordingEnabled: false,
+ usesCalendarBot: false,
+ },
+ {
+ id: '00000000-0000-4000-8000-000000000007',
+ title: 'Project planning',
+ startsAt: at(187),
+ endsAt: at(217),
+ url: 'https://meet.google.com/example-four',
+ recordingEnabled: true,
+ usesCalendarBot: true,
+ },
+ {
+ id: '00000000-0000-4000-8000-000000000008',
+ title: 'Customer onboarding',
+ startsAt: at(247),
+ endsAt: at(277),
+ url: 'https://meet.google.com/example-five',
+ recordingEnabled: true,
+ usesCalendarBot: true,
+ },
+ ],
+ recordings: [
+ {
+ id: '00000000-0000-4000-8000-000000000004',
+ title: 'A new way to organize your day',
+ status: 'COMPLETED',
+ startedAt: at(-90),
+ endedAt: at(-60),
+ participants: [
+ { id: 'email:[email protected]', name: 'Alex Martin' },
+ { id: 'email:[email protected]', name: 'Sam Lee' },
+ { id: 'email:[email protected]', name: 'Jules Garcia' },
+ ],
+ },
+ {
+ id: '00000000-0000-4000-8000-000000000005',
+ title: 'Product catch-up',
+ status: 'PROCESSING',
+ startedAt: at(-45),
+ endedAt: at(-10),
+ participants: [{ id: 'email:[email protected]', name: 'Morgan Chen' }],
+ },
+ {
+ id: '00000000-0000-4000-8000-000000000009',
+ title: 'Unscheduled conversation',
+ status: 'COMPLETED',
+ startedAt: at(-180),
+ endedAt: at(-160),
+ participants: [],
+ },
+ ],
+ };
+ if (scenario === 'welcome') {
+ state.connection = 'disconnected';
+ state.updatedAt = null;
+ }
+ if (scenario === 'error') {
+ state.connection = 'disconnected';
+ state.error = {
+ message: 'Could not unlock your Twenty connection. Reconnect to Twenty.',
+ };
+ }
+ if (scenario === 'missing-integration') {
+ state.error = {
+ message:
+ 'Desktop Recorder is unavailable in this workspace. Install it to continue.',
+ recovery: {
+ type: 'open-desktop-installation',
+ serverUrl: state.serverUrl,
+ },
+ };
+ }
+ if (scenario === 'empty') {
+ state.recordings = [];
+ state.meetings = [];
+ }
+ if (scenario === 'recording')
+ state.activeRecording = {
+ id: '00000000-0000-4000-8000-000000000006',
+ windowId: 'preview-call',
+ title: 'Customer conversation',
+ startedAt: at(-4),
+ status: 'recording',
+ };
+ return state;
+};
diff --git a/packages/twenty-companion/src/renderer/utils/recordingLabel.ts b/packages/twenty-companion/src/renderer/utils/recordingLabel.ts
new file mode 100644
index 00000000000..946632de57b
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/recordingLabel.ts
@@ -0,0 +1,10 @@
+import { i18n } from '@lingui/core';
+
+export const recordingLabel = (status: string) =>
+ ({
+ COMPLETED: i18n._('Saved to Twenty'),
+ PROCESSING: i18n._('Processing'),
+ FAILED: i18n._('Recording failed'),
+ RECORDING: i18n._('Recording'),
+ PENDING: i18n._('Preparing'),
+ })[status] ?? i18n._('Preparing');
diff --git a/packages/twenty-companion/src/renderer/utils/shortcutFromKeyboardEvent.ts b/packages/twenty-companion/src/renderer/utils/shortcutFromKeyboardEvent.ts
new file mode 100644
index 00000000000..6daeaecfde9
--- /dev/null
+++ b/packages/twenty-companion/src/renderer/utils/shortcutFromKeyboardEvent.ts
@@ -0,0 +1,26 @@
+type ShortcutKeyboardEvent = Pick<
+ KeyboardEvent,
+ 'key' | 'code' | 'repeat' | 'metaKey' | 'ctrlKey' | 'altKey' | 'shiftKey'
+>;
+
+export const shortcutFromKeyboardEvent = (
+ event: ShortcutKeyboardEvent,
+): string | null => {
+ if (event.repeat || !(event.metaKey || event.ctrlKey || event.altKey))
+ return null;
+ let key: string;
+ if (event.code === 'Space') key = 'Space';
+ else if (/^Key[A-Z]$/.test(event.code)) key = event.code.slice(3);
+ else if (/^Digit[0-9]$/.test(event.code)) key = event.code.slice(5);
+ else if (/^F([1-9]|1[0-9]|2[0-4])$/.test(event.code)) key = event.code;
+ else return null;
+ return [
+ event.metaKey && 'Command',
+ event.ctrlKey && 'Control',
+ event.altKey && 'Alt',
+ event.shiftKey && 'Shift',
+ key,
+ ]
+ .filter(Boolean)
+ .join('+');
+};
diff --git a/packages/twenty-companion/src/shared/constants/DEFAULT_SETTINGS.ts b/packages/twenty-companion/src/shared/constants/DEFAULT_SETTINGS.ts
new file mode 100644
index 00000000000..a5b4b39adf0
--- /dev/null
+++ b/packages/twenty-companion/src/shared/constants/DEFAULT_SETTINGS.ts
@@ -0,0 +1,12 @@
+import { type Settings } from '../types/Settings';
+
+export const DEFAULT_SETTINGS: Settings = {
+ openShortcut: 'CommandOrControl+Shift+Space',
+ autoJoin: true,
+ autoRecord: false,
+ launchAtLogin: false,
+ appearance: 'system',
+ notifyOnDetectedCall: true,
+ showMeetingCountdown: true,
+ setupCompleted: false,
+};
diff --git a/packages/twenty-companion/src/shared/types/ActiveRecording.ts b/packages/twenty-companion/src/shared/types/ActiveRecording.ts
new file mode 100644
index 00000000000..486ceae5f97
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/ActiveRecording.ts
@@ -0,0 +1,15 @@
+export type ActiveRecording = {
+ id: string;
+ windowId: string;
+ title: string;
+ startedAt: string;
+ status:
+ | 'starting'
+ | 'recording'
+ | 'pausing'
+ | 'paused'
+ | 'resuming'
+ | 'stopping';
+ pausedAt?: string;
+ pausedMilliseconds?: number;
+};
diff --git a/packages/twenty-companion/src/shared/types/Agenda.ts b/packages/twenty-companion/src/shared/types/Agenda.ts
new file mode 100644
index 00000000000..66845b5cd1c
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/Agenda.ts
@@ -0,0 +1,9 @@
+import { type Meeting } from './Meeting';
+import { type Recording } from './Recording';
+
+export type Agenda = {
+ workspace: { id: string; name: string; logoUrl?: string };
+ meetings: Meeting[];
+ recordings: Recording[];
+ calendarConnected: boolean;
+};
diff --git a/packages/twenty-companion/src/shared/types/CompanionBridge.ts b/packages/twenty-companion/src/shared/types/CompanionBridge.ts
new file mode 100644
index 00000000000..86fb860dc32
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/CompanionBridge.ts
@@ -0,0 +1,10 @@
+import { type CompanionState } from './CompanionState';
+import { type CompanionCommand } from './CompanionCommand';
+import { type CompanionPage } from './CompanionPage';
+
+export type CompanionBridge = {
+ getState: () => Promise<CompanionState>;
+ command: (command: CompanionCommand) => Promise<void>;
+ onState: (listener: (state: CompanionState) => void) => () => void;
+ onNavigate: (listener: (page: CompanionPage) => void) => () => void;
+};
diff --git a/packages/twenty-companion/src/shared/types/CompanionCommand.ts b/packages/twenty-companion/src/shared/types/CompanionCommand.ts
new file mode 100644
index 00000000000..c784a00b398
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/CompanionCommand.ts
@@ -0,0 +1,4 @@
+import { z } from 'zod';
+import { commandSchema } from '../validation-schemas/commandSchema';
+
+export type CompanionCommand = z.infer<typeof commandSchema>;
diff --git a/packages/twenty-companion/src/shared/types/CompanionError.ts b/packages/twenty-companion/src/shared/types/CompanionError.ts
new file mode 100644
index 00000000000..a6c0e0ada3b
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/CompanionError.ts
@@ -0,0 +1,4 @@
+export type CompanionError = {
+ message: string;
+ recovery?: { type: 'open-desktop-installation'; serverUrl: string };
+};
diff --git a/packages/twenty-companion/src/shared/types/CompanionNotice.ts b/packages/twenty-companion/src/shared/types/CompanionNotice.ts
new file mode 100644
index 00000000000..f6e483400ea
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/CompanionNotice.ts
@@ -0,0 +1,12 @@
+export type CompanionNotice =
+ | { type: 'preview'; message: string }
+ | { type: 'opening-meeting'; title: string }
+ | {
+ type:
+ | 'recording-finished'
+ | 'network-lost'
+ | 'network-restored-active'
+ | 'network-restored'
+ | 'audio-interrupted'
+ | 'recording-stopped-offline';
+ };
diff --git a/packages/twenty-companion/src/shared/types/CompanionPage.ts b/packages/twenty-companion/src/shared/types/CompanionPage.ts
new file mode 100644
index 00000000000..5e7ffa7fbe3
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/CompanionPage.ts
@@ -0,0 +1 @@
+export type CompanionPage = 'agenda' | 'settings';
diff --git a/packages/twenty-companion/src/shared/types/CompanionState.ts b/packages/twenty-companion/src/shared/types/CompanionState.ts
new file mode 100644
index 00000000000..7292555789d
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/CompanionState.ts
@@ -0,0 +1,26 @@
+import { type Settings } from './Settings';
+import { type Meeting } from './Meeting';
+import { type Recording } from './Recording';
+import { type DetectedCall } from './DetectedCall';
+import { type ActiveRecording } from './ActiveRecording';
+import { type Agenda } from './Agenda';
+import { type CompanionError } from './CompanionError';
+import { type CompanionNotice } from './CompanionNotice';
+
+export type CompanionState = {
+ connection: 'disconnected' | 'connecting' | 'connected';
+ serverUrl: string;
+ workspace: Agenda['workspace'] | null;
+ meetings: Meeting[];
+ recordings: Recording[];
+ calendarConnected: boolean;
+ detectedCalls: DetectedCall[];
+ activeRecording: ActiveRecording | null;
+ permissions: Record<'microphone' | 'accessibility' | 'system-audio', string>;
+ settings: Settings;
+ skippedMeetingIds: string[];
+ updatedAt: string | null;
+ error: CompanionError | null;
+ notice: CompanionNotice | null;
+ permissionSetup: { windowId?: string; intent?: 'record' } | null;
+};
diff --git a/packages/twenty-companion/src/shared/types/DetectedCall.ts b/packages/twenty-companion/src/shared/types/DetectedCall.ts
new file mode 100644
index 00000000000..d2de20e9ede
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/DetectedCall.ts
@@ -0,0 +1,6 @@
+export type DetectedCall = {
+ id: string;
+ title: string;
+ platform: string;
+ url?: string;
+};
diff --git a/packages/twenty-companion/src/shared/types/Meeting.ts b/packages/twenty-companion/src/shared/types/Meeting.ts
new file mode 100644
index 00000000000..1cb8414879e
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/Meeting.ts
@@ -0,0 +1,9 @@
+export type Meeting = {
+ id: string;
+ title: string;
+ startsAt: string;
+ endsAt: string;
+ url: string | null;
+ recordingEnabled: boolean;
+ usesCalendarBot: boolean;
+};
diff --git a/packages/twenty-companion/src/shared/types/Recording.ts b/packages/twenty-companion/src/shared/types/Recording.ts
new file mode 100644
index 00000000000..8a695142cb6
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/Recording.ts
@@ -0,0 +1,11 @@
+import { type RecordingStatus } from './RecordingStatus';
+
+export type Recording = {
+ participants?: { id: string; name: string; avatarUrl?: string | null }[];
+ id: string;
+ title: string;
+ status: RecordingStatus;
+ startedAt?: string | null;
+ endedAt?: string | null;
+ calendarEventId?: string | null;
+};
diff --git a/packages/twenty-companion/src/shared/types/RecordingConfiguration.ts b/packages/twenty-companion/src/shared/types/RecordingConfiguration.ts
new file mode 100644
index 00000000000..3b9e14a3f6b
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/RecordingConfiguration.ts
@@ -0,0 +1 @@
+export type RecordingConfiguration = { apiUrl: string };
diff --git a/packages/twenty-companion/src/shared/types/RecordingResult.ts b/packages/twenty-companion/src/shared/types/RecordingResult.ts
new file mode 100644
index 00000000000..083e8ef5113
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/RecordingResult.ts
@@ -0,0 +1 @@
+export type RecordingResult = { callRecordingId: string };
diff --git a/packages/twenty-companion/src/shared/types/RecordingStatus.ts b/packages/twenty-companion/src/shared/types/RecordingStatus.ts
new file mode 100644
index 00000000000..dffa6d8c0dd
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/RecordingStatus.ts
@@ -0,0 +1,8 @@
+export type RecordingStatus =
+ | 'SCHEDULED'
+ | 'JOINING'
+ | 'RECORDING'
+ | 'PROCESSING'
+ | 'FAILED'
+ | 'NOT_RECORDED'
+ | 'COMPLETED';
diff --git a/packages/twenty-companion/src/shared/types/RecordingUpload.ts b/packages/twenty-companion/src/shared/types/RecordingUpload.ts
new file mode 100644
index 00000000000..f5e890a2639
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/RecordingUpload.ts
@@ -0,0 +1,6 @@
+import { type RecordingConfiguration } from './RecordingConfiguration';
+
+export type RecordingUpload = RecordingConfiguration & {
+ callRecordingId: string;
+ uploadToken: string;
+};
diff --git a/packages/twenty-companion/src/shared/types/Settings.ts b/packages/twenty-companion/src/shared/types/Settings.ts
new file mode 100644
index 00000000000..7aef0518df6
--- /dev/null
+++ b/packages/twenty-companion/src/shared/types/Settings.ts
@@ -0,0 +1,4 @@
+import { z } from 'zod';
+import { settingsSchema } from '../validation-schemas/settingsSchema';
+
+export type Settings = z.infer<typeof settingsSchema>;
diff --git a/packages/twenty-companion/src/shared/utils/createInitialState.ts b/packages/twenty-companion/src/shared/utils/createInitialState.ts
new file mode 100644
index 00000000000..f464efde3a5
--- /dev/null
+++ b/packages/twenty-companion/src/shared/utils/createInitialState.ts
@@ -0,0 +1,24 @@
+import { DEFAULT_SETTINGS } from '../constants/DEFAULT_SETTINGS';
+import { type CompanionState } from '../types/CompanionState';
+
+export const createInitialState = (): CompanionState => ({
+ connection: 'disconnected',
+ serverUrl: 'https://api.twenty.com',
+ workspace: null,
+ meetings: [],
+ recordings: [],
+ detectedCalls: [],
+ activeRecording: null,
+ calendarConnected: false,
+ permissions: {
+ microphone: 'not_requested',
+ accessibility: 'not_requested',
+ 'system-audio': 'not_requested',
+ },
+ settings: { ...DEFAULT_SETTINGS },
+ skippedMeetingIds: [],
+ updatedAt: null,
+ error: null,
+ notice: null,
+ permissionSetup: null,
+});
diff --git a/packages/twenty-companion/src/shared/utils/getDueMeetings.ts b/packages/twenty-companion/src/shared/utils/getDueMeetings.ts
new file mode 100644
index 00000000000..d3a493b13c8
--- /dev/null
+++ b/packages/twenty-companion/src/shared/utils/getDueMeetings.ts
@@ -0,0 +1,34 @@
+import { type Meeting } from '../types/Meeting';
+import { normalizeMeetingUrl } from './normalizeMeetingUrl';
+import { getMeetingOccurrenceKey } from './getMeetingOccurrenceKey';
+
+export const getDueMeetings = ({
+ meetings,
+ handledIds,
+ now,
+ lastSyncedAt,
+}: {
+ meetings: Meeting[];
+ handledIds: ReadonlySet<string>;
+ now: number;
+ lastSyncedAt: number;
+}): Meeting[] => {
+ // A stale agenda must never open a canceled or moved meeting after wake or reconnection.
+ if (
+ !Number.isFinite(lastSyncedAt) ||
+ now < lastSyncedAt ||
+ now - lastSyncedAt > 90_000
+ ) {
+ return [];
+ }
+ return meetings.filter(
+ (meeting) =>
+ meeting.url &&
+ normalizeMeetingUrl(meeting.url) !== null &&
+ !handledIds.has(getMeetingOccurrenceKey(meeting)) &&
+ !handledIds.has(meeting.id) &&
+ Date.parse(meeting.startsAt) <= now &&
+ now - Date.parse(meeting.startsAt) < 60_000 &&
+ Date.parse(meeting.endsAt) > now,
+ );
+};
diff --git a/packages/twenty-companion/src/shared/utils/getMeetingOccurrenceKey.ts b/packages/twenty-companion/src/shared/utils/getMeetingOccurrenceKey.ts
new file mode 100644
index 00000000000..e9b30b94c2a
--- /dev/null
+++ b/packages/twenty-companion/src/shared/utils/getMeetingOccurrenceKey.ts
@@ -0,0 +1,4 @@
+import { type Meeting } from '../types/Meeting';
+
+export const getMeetingOccurrenceKey = (meeting: Meeting): string =>
+ `${meeting.id}:${meeting.startsAt}`;
diff --git a/packages/twenty-companion/src/shared/utils/getMeetingUrl.ts b/packages/twenty-companion/src/shared/utils/getMeetingUrl.ts
new file mode 100644
index 00000000000..fa3a4d75106
--- /dev/null
+++ b/packages/twenty-companion/src/shared/utils/getMeetingUrl.ts
@@ -0,0 +1,7 @@
+export const getMeetingUrl = (value: string): string => {
+ const url = new URL(value);
+ if (url.protocol !== 'https:' || url.username || url.password) {
+ throw new Error('Meeting links must use HTTPS.');
+ }
+ return url.href;
+};
diff --git a/packages/twenty-companion/src/shared/utils/getUpcomingMeetings.ts b/packages/twenty-companion/src/shared/utils/getUpcomingMeetings.ts
new file mode 100644
index 00000000000..80e4a245e07
--- /dev/null
+++ b/packages/twenty-companion/src/shared/utils/getUpcomingMeetings.ts
@@ -0,0 +1,15 @@
+import { type Meeting } from '../types/Meeting';
+
+export const getUpcomingMeetings = ({
+ meetings,
+ now,
+}: {
+ meetings: Meeting[];
+ now: number;
+}): Meeting[] =>
+ meetings
+ .filter((meeting) => Date.parse(meeting.endsAt) > now)
+ .sort(
+ (first, second) =>
+ Date.parse(first.startsAt) - Date.parse(second.startsAt),
+ );
diff --git a/packages/twenty-companion/src/shared/utils/matchMeeting.ts b/packages/twenty-companion/src/shared/utils/matchMeeting.ts
new file mode 100644
index 00000000000..c976186af9a
--- /dev/null
+++ b/packages/twenty-companion/src/shared/utils/matchMeeting.ts
@@ -0,0 +1,30 @@
+import { type Meeting } from '../types/Meeting';
+import { normalizeMeetingUrl } from './normalizeMeetingUrl';
+
+export const matchMeeting = ({
+ meetings,
+ url,
+ now,
+}: {
+ meetings: Meeting[];
+ url: string | undefined;
+ now: number;
+}): Meeting | undefined => {
+ const normalizedUrl = url ? normalizeMeetingUrl(url) : null;
+ if (!normalizedUrl) {
+ return;
+ }
+ const matches = meetings.filter(
+ (meeting) =>
+ meeting.url &&
+ normalizeMeetingUrl(meeting.url) === normalizedUrl &&
+ Date.parse(meeting.startsAt) - 15 * 60_000 <= now &&
+ Date.parse(meeting.endsAt) + 15 * 60_000 >= now,
+ );
+ // Multiple calendar copies still reserve this room for its calendar recording policy.
+ return (
+ matches.find(
+ (meeting) => meeting.usesCalendarBot || !meeting.recordingEnabled,
+ ) ?? matches[0]
+ );
+};
diff --git a/packages/twenty-companion/src/shared/utils/normalizeMeetingUrl.ts b/packages/twenty-companion/src/shared/utils/normalizeMeetingUrl.ts
new file mode 100644
index 00000000000..e865e92433e
--- /dev/null
+++ b/packages/twenty-companion/src/shared/utils/normalizeMeetingUrl.ts
@@ -0,0 +1,17 @@
+import { getMeetingUrl } from './getMeetingUrl';
+
+export const normalizeMeetingUrl = (value: string): string | null => {
+ try {
+ const url = new URL(getMeetingUrl(value));
+ // Provider join tokens do not change the room; other query parameters can identify it.
+ for (const key of ['pwd', 'authuser', 'hs', 'pli', 'utm_source'])
+ url.searchParams.delete(key);
+ url.searchParams.sort();
+ if (url.hostname === 'www.zoom.us') {
+ url.hostname = 'zoom.us';
+ }
+ return `${url.host.toLowerCase()}${url.pathname.replace(/\/$/, '')}${url.search}`;
+ } catch {
+ return null;
+ }
+};
diff --git a/packages/twenty-companion/src/shared/validation-schemas/commandSchema.ts b/packages/twenty-companion/src/shared/validation-schemas/commandSchema.ts
new file mode 100644
index 00000000000..02fdfc817ec
--- /dev/null
+++ b/packages/twenty-companion/src/shared/validation-schemas/commandSchema.ts
@@ -0,0 +1,46 @@
+import { preferencesSchema } from './preferencesSchema';
+import { z } from 'zod';
+
+export const commandSchema = z.discriminatedUnion('type', [
+ z.object({ type: z.literal('connect'), serverUrl: z.string().max(2048) }),
+ z.object({ type: z.literal('disconnect') }),
+ z.object({ type: z.literal('cancel-connect') }),
+ z.object({ type: z.literal('refresh') }),
+ z.object({
+ type: z.literal('settings'),
+ settings: preferencesSchema.partial(),
+ }),
+ z.object({
+ type: z.literal('permission'),
+ permission: z.enum(['microphone', 'accessibility', 'system-audio']),
+ }),
+ z.object({ type: z.literal('complete-setup') }),
+ z.object({ type: z.literal('begin-permission-setup') }),
+ z.object({ type: z.literal('cancel-permission-setup') }),
+ z.object({ type: z.literal('join'), meetingId: z.string().uuid() }),
+ z.object({ type: z.literal('skip'), meetingId: z.string().uuid() }),
+ z.object({ type: z.literal('unskip'), meetingId: z.string().uuid() }),
+ z.object({
+ type: z.literal('record'),
+ windowId: z.string().max(256).optional(),
+ }),
+ z.object({ type: z.literal('stop') }),
+ z.object({ type: z.literal('pause') }),
+ z.object({ type: z.literal('resume') }),
+ z.object({
+ type: z.literal('open-app'),
+ page: z.enum(['agenda', 'settings']).optional(),
+ }),
+ z.object({
+ type: z.literal('open-recording'),
+ recordingId: z.string().uuid(),
+ }),
+ z.object({ type: z.literal('open-recordings') }),
+ z.object({ type: z.literal('open-calendar-settings') }),
+ z.object({
+ type: z.literal('open-desktop-installation'),
+ serverUrl: z.string(),
+ }),
+ z.object({ type: z.literal('open-desktop-setup'), serverUrl: z.string() }),
+ z.object({ type: z.literal('dismiss-error') }),
+]);
diff --git a/packages/twenty-companion/src/shared/validation-schemas/preferencesSchema.ts b/packages/twenty-companion/src/shared/validation-schemas/preferencesSchema.ts
new file mode 100644
index 00000000000..e88e034af21
--- /dev/null
+++ b/packages/twenty-companion/src/shared/validation-schemas/preferencesSchema.ts
@@ -0,0 +1,11 @@
+import { z } from 'zod';
+
+export const preferencesSchema = z.object({
+ openShortcut: z.string().min(1).max(100),
+ autoJoin: z.boolean(),
+ autoRecord: z.boolean(),
+ launchAtLogin: z.boolean(),
+ appearance: z.enum(['system', 'light', 'dark']),
+ notifyOnDetectedCall: z.boolean(),
+ showMeetingCountdown: z.boolean(),
+});
diff --git a/packages/twenty-companion/src/shared/validation-schemas/settingsSchema.ts b/packages/twenty-companion/src/shared/validation-schemas/settingsSchema.ts
new file mode 100644
index 00000000000..6eed61feb4b
--- /dev/null
+++ b/packages/twenty-companion/src/shared/validation-schemas/settingsSchema.ts
@@ -0,0 +1,6 @@
+import { preferencesSchema } from './preferencesSchema';
+import { z } from 'zod';
+
+export const settingsSchema = preferencesSchema.extend({
+ setupCompleted: z.boolean(),
+});
diff --git a/packages/twenty-companion/tsconfig.json b/packages/twenty-companion/tsconfig.json
new file mode 100644
index 00000000000..33d061e91f3
--- /dev/null
+++ b/packages/twenty-companion/tsconfig.json
@@ -0,0 +1,22 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "jsx": "react-jsx",
+ "strict": true,
+ "skipLibCheck": true,
+ "esModuleInterop": true,
+ "resolveJsonModule": true,
+ "noEmit": true,
+ "types": ["node", "vite/client"],
+ "paths": {
+ "twenty-ui/icon": ["../twenty-ui/src/icon/index.ts"],
+ "@ui/*": ["../twenty-ui/src/*"],
+ "@assets/*": ["../twenty-ui/src/assets/*"],
+ "@styles/*": ["../twenty-ui/src/styles/*"],
+ "@test-utilities/*": ["../twenty-ui/src/test-utilities/*"]
+ }
+ },
+ "include": ["src", "vite.config.ts"]
+}
diff --git a/packages/twenty-companion/vite.config.ts b/packages/twenty-companion/vite.config.ts
new file mode 100644
index 00000000000..d3543ff19b0
--- /dev/null
+++ b/packages/twenty-companion/vite.config.ts
@@ -0,0 +1,40 @@
+import { defineConfig } from 'vite';
+import { fileURLToPath } from 'node:url';
+import svgr from 'vite-plugin-svgr';
+
+export default defineConfig({
+ base: './',
+ // Packaged Electron releases contain large HTML license files, not app entry points.
+ optimizeDeps: { entries: ['index.html'] },
+ plugins: [svgr()],
+ css: {
+ modules: { localsConvention: 'camelCaseOnly' },
+ preprocessorOptions: {
+ scss: {
+ loadPaths: [
+ fileURLToPath(new URL('../twenty-ui/src/styles', import.meta.url)),
+ ],
+ additionalData:
+ "@use 'abstracts/functions' as *;\n@use 'abstracts/mixins' as *;\n@use 'abstracts/breakpoints' as *;\n",
+ },
+ },
+ },
+ resolve: {
+ alias: {
+ 'twenty-ui/icon': fileURLToPath(
+ new URL('../twenty-ui/src/icon/index.ts', import.meta.url),
+ ),
+ '@assets': fileURLToPath(
+ new URL('../twenty-ui/src/assets', import.meta.url),
+ ),
+ '@ui': fileURLToPath(new URL('../twenty-ui/src', import.meta.url)),
+ },
+ },
+ build: { outDir: 'dist/renderer', emptyOutDir: true },
+ server: {
+ host: '127.0.0.1',
+ port: 4317,
+ strictPort: true,
+ watch: { ignored: ['**/release/**', '**/dist/**'] },
+ },
+});
diff --git a/yarn.lock b/yarn.lock
index c84af1393d8..4ada919303f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4478,7 +4478,7 @@ __metadata:
languageName: node
linkType: hard
-"@base-ui/react@npm:^1.8.0":
+"@base-ui/react@npm:^1.5.0, @base-ui/react@npm:^1.8.0":
version: 1.8.0
resolution: "@base-ui/react@npm:1.8.0"
dependencies:
@@ -5387,6 +5387,142 @@ __metadata:
languageName: node
linkType: hard
+"@electron-internal/extract-zip@npm:^1.0.1":
+ version: 1.0.5
+ resolution: "@electron-internal/extract-zip@npm:1.0.5"
+ checksum: 10c0/d3341937dcb37097fd4927b7e5dfb7cb6b1ba56a42b00d62a55a7a9bbd093545dd8c6711ab39b321b2696d968b2cc32c29ed9d60a1fa6aa1665588e03e60d4e1
+ languageName: node
+ linkType: hard
+
+"@electron/asar@npm:^4.0.0, @electron/asar@npm:^4.0.1":
+ version: 4.3.0
+ resolution: "@electron/asar@npm:4.3.0"
+ dependencies:
+ glob: "npm:^13.0.2"
+ minimatch: "npm:^10.0.1"
+ dependenciesMeta:
+ electron:
+ built: true
+ bin:
+ asar: bin/asar.mjs
+ checksum: 10c0/a1d682e60f9e0f6280bf85f4b4ff8b0bf03828f7f795703d4662a83938f11f48615795874af2bc83a8d94bac972c2915f0bfee1aeb24b34e41853017e57d7570
+ languageName: node
+ linkType: hard
+
+"@electron/get@npm:^4.0.2":
+ version: 4.0.3
+ resolution: "@electron/get@npm:4.0.3"
+ dependencies:
+ debug: "npm:^4.1.1"
+ env-paths: "npm:^3.0.0"
+ global-agent: "npm:^3.0.0"
+ got: "npm:^14.4.5"
+ graceful-fs: "npm:^4.2.11"
+ progress: "npm:^2.0.3"
+ semver: "npm:^7.6.3"
+ sumchecker: "npm:^3.0.1"
+ dependenciesMeta:
+ global-agent:
+ optional: true
+ checksum: 10c0/66e1e45857b035a3424adcd1752d19805b4c98818d6e02a84e201936bf9c528e1b6774b99a357e073ee91a2b4a3a5b8a8620d71b90ab146bfba806232bd3f167
+ languageName: node
+ linkType: hard
+
+"@electron/get@npm:^5.0.0":
+ version: 5.1.0
+ resolution: "@electron/get@npm:5.1.0"
+ dependencies:
+ debug: "npm:^4.1.1"
+ env-paths: "npm:^3.0.0"
+ graceful-fs: "npm:^4.2.11"
+ progress: "npm:^2.0.3"
+ semver: "npm:^7.6.3"
+ sumchecker: "npm:^3.0.1"
+ undici: "npm:^7.24.4"
+ dependenciesMeta:
+ undici:
+ optional: true
+ checksum: 10c0/50e037c7f64197a6efcd219a0796566422c3fec056134144530da4a15c8bfaa0c5e7233bcc0c9a56ccb1b4c5d86878da6911d237a527684d70619dfd7a3f9675
+ languageName: node
+ linkType: hard
+
+"@electron/notarize@npm:^3.1.0":
+ version: 3.1.1
+ resolution: "@electron/notarize@npm:3.1.1"
+ dependencies:
+ debug: "npm:^4.4.0"
+ promise-retry: "npm:^2.0.1"
+ checksum: 10c0/1e9adc0cafc1c2e79c39a41c97de912d6a899d661de506301310e17c569dc2885c9729c21840ceb70871f2e648ab983d3731149c6dc4ea354a001ad463c83e7e
+ languageName: node
+ linkType: hard
+
+"@electron/osx-sign@npm:^2.2.0":
+ version: 2.7.0
+ resolution: "@electron/osx-sign@npm:2.7.0"
+ dependencies:
+ debug: "npm:^4.3.4"
+ isbinaryfile: "npm:^4.0.8"
+ plist: "npm:^3.0.5"
+ semver: "npm:^7.7.1"
+ bin:
+ electron-osx-flat: bin/electron-osx-flat.mjs
+ electron-osx-sign: bin/electron-osx-sign.mjs
+ checksum: 10c0/187f300f612724c48d7364ce2e5cc69288fd57b501c4a07feefa9bd69295492976f60751228ece028d140a99845024ef0e67eee341b86fb5ddd51ace88c882f6
+ languageName: node
+ linkType: hard
+
+"@electron/packager@npm:^19.0.0":
+ version: 19.1.1
+ resolution: "@electron/packager@npm:19.1.1"
+ dependencies:
+ "@electron/asar": "npm:^4.0.1"
+ "@electron/get": "npm:^4.0.2"
+ "@electron/notarize": "npm:^3.1.0"
+ "@electron/osx-sign": "npm:^2.2.0"
+ "@electron/universal": "npm:^3.0.1"
+ "@electron/windows-sign": "npm:^2.0.2"
+ "@malept/cross-spawn-promise": "npm:^2.0.0"
+ debug: "npm:^4.4.1"
+ extract-zip: "npm:^2.0.1"
+ filenamify: "npm:^6.0.0"
+ galactus: "npm:^2.0.2"
+ graceful-fs: "npm:^4.2.11"
+ junk: "npm:^4.0.1"
+ parse-author: "npm:^2.0.0"
+ plist: "npm:^3.1.0"
+ resedit: "npm:^2.0.3"
+ semver: "npm:^7.7.2"
+ yargs-parser: "npm:^22.0.0"
+ bin:
+ electron-packager: bin/electron-packager.mjs
+ checksum: 10c0/09c25f0fbfe56f87d6e2c28d4350f7a995100321c1c3a9fe678ab3b1a4d1f387b06e7a7895fe1b54d89b06253667653392ec4cf43e5878177d901b5af266d0fd
+ languageName: node
+ linkType: hard
+
+"@electron/universal@npm:^3.0.1":
+ version: 3.0.6
+ resolution: "@electron/universal@npm:3.0.6"
+ dependencies:
+ "@electron/asar": "npm:^4.0.0"
+ debug: "npm:^4.3.1"
+ plist: "npm:^3.1.0"
+ checksum: 10c0/517a4c0b1dff7a67afc5994770c9aeffc2e4dc5ff5e8cd20c9d7e21107852e0b1199d405cfc408dc6aa93d4f967e5066df1928851b2e2013a24155c120103e59
+ languageName: node
+ linkType: hard
+
+"@electron/windows-sign@npm:^2.0.2":
+ version: 2.1.0
+ resolution: "@electron/windows-sign@npm:2.1.0"
+ dependencies:
+ debug: "npm:^4.3.4"
+ graceful-fs: "npm:^4.2.11"
+ postject: "npm:^1.0.0-alpha.6"
+ bin:
+ electron-windows-sign: bin/electron-windows-sign.mjs
+ checksum: 10c0/954bce4db68a11e041a19be91017d57c4190beca94e1d05eb3434e2dc464176ff541764f0d8c41eff157b6b8cd498cf2e671cf9239b694da8e852f2f281f4d21
+ languageName: node
+ linkType: hard
+
"@eloqnt/cli@npm:^0.6.29":
version: 0.6.29
resolution: "@eloqnt/cli@npm:0.6.29"
@@ -10036,6 +10172,15 @@ __metadata:
languageName: node
linkType: hard
+"@malept/cross-spawn-promise@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "@malept/cross-spawn-promise@npm:2.0.0"
+ dependencies:
+ cross-spawn: "npm:^7.0.1"
+ checksum: 10c0/84d60b8d467f4252114849f0a33c3763f07898335269eec5c94978ccac9d5680e1e268d993dd1a6d25a91476f9e0992759d7e1f385f9f3a090d862f9bb949603
+ languageName: node
+ linkType: hard
+
"@mantine/core@npm:^8.3.11":
version: 8.3.15
resolution: "@mantine/core@npm:8.3.15"
@@ -10990,6 +11135,13 @@ __metadata:
languageName: node
linkType: hard
+"@napi-rs/lzma-linux-x64-gnu@npm:1.5.1":
+ version: 1.5.1
+ resolution: "@napi-rs/lzma-linux-x64-gnu@npm:1.5.1"
+ conditions: os=linux & cpu=x64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@napi-rs/nice-android-arm-eabi@npm:1.1.1":
version: 1.1.1
resolution: "@napi-rs/nice-android-arm-eabi@npm:1.1.1"
@@ -15347,6 +15499,16 @@ __metadata:
languageName: node
linkType: hard
+"@recallai/desktop-sdk@npm:2.0.29":
+ version: 2.0.29
+ resolution: "@recallai/desktop-sdk@npm:2.0.29"
+ dependencies:
+ tar: "npm:^7.4.3"
+ uuid: "npm:^11.1.0"
+ checksum: 10c0/21a1a1798cc6e1abef7a2653941a7532ab863271a3001dc40571e4e7291414289b07a157e10759e6b44ec4684c580a46a65b6f9057c76641f35316e287f47890
+ languageName: node
+ linkType: hard
+
"@redis/bloom@npm:1.2.0, @redis/bloom@npm:^1.2.0":
version: 1.2.0
resolution: "@redis/bloom@npm:1.2.0"
@@ -15759,6 +15921,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-android-arm-eabi@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-android-arm-eabi@npm:4.63.2"
+ conditions: os=android & cpu=arm
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-android-arm64@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-android-arm64@npm:4.59.0"
@@ -15766,6 +15935,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-android-arm64@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-android-arm64@npm:4.63.2"
+ conditions: os=android & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-darwin-arm64@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-darwin-arm64@npm:4.59.0"
@@ -15773,6 +15949,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-darwin-arm64@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-darwin-arm64@npm:4.63.2"
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-darwin-x64@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-darwin-x64@npm:4.59.0"
@@ -15780,6 +15963,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-darwin-x64@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-darwin-x64@npm:4.63.2"
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-freebsd-arm64@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-freebsd-arm64@npm:4.59.0"
@@ -15787,6 +15977,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-freebsd-arm64@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-freebsd-arm64@npm:4.63.2"
+ conditions: os=freebsd & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-freebsd-x64@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-freebsd-x64@npm:4.59.0"
@@ -15794,6 +15991,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-freebsd-x64@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-freebsd-x64@npm:4.63.2"
+ conditions: os=freebsd & cpu=x64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-arm-gnueabihf@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.59.0"
@@ -15801,6 +16005,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-arm-gnueabihf@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.63.2"
+ conditions: os=linux & cpu=arm & libc=glibc
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-arm-musleabihf@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.59.0"
@@ -15808,6 +16019,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-arm-musleabihf@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.63.2"
+ conditions: os=linux & cpu=arm & libc=musl
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-arm64-gnu@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.59.0"
@@ -15815,6 +16033,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-arm64-gnu@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.63.2"
+ conditions: os=linux & cpu=arm64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-arm64-musl@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-arm64-musl@npm:4.59.0"
@@ -15822,6 +16047,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-arm64-musl@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-arm64-musl@npm:4.63.2"
+ conditions: os=linux & cpu=arm64 & libc=musl
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-loong64-gnu@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.59.0"
@@ -15829,6 +16061,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-loong64-gnu@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-loong64-gnu@npm:4.63.2"
+ conditions: os=linux & cpu=loong64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-loong64-musl@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-loong64-musl@npm:4.59.0"
@@ -15836,6 +16075,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-loong64-musl@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-loong64-musl@npm:4.63.2"
+ conditions: os=linux & cpu=loong64 & libc=musl
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-ppc64-gnu@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.59.0"
@@ -15843,6 +16089,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-ppc64-gnu@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-ppc64-gnu@npm:4.63.2"
+ conditions: os=linux & cpu=ppc64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-ppc64-musl@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.59.0"
@@ -15850,6 +16103,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-ppc64-musl@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-ppc64-musl@npm:4.63.2"
+ conditions: os=linux & cpu=ppc64 & libc=musl
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-riscv64-gnu@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.59.0"
@@ -15857,6 +16117,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-riscv64-gnu@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.63.2"
+ conditions: os=linux & cpu=riscv64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-riscv64-musl@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.59.0"
@@ -15864,6 +16131,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-riscv64-musl@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-riscv64-musl@npm:4.63.2"
+ conditions: os=linux & cpu=riscv64 & libc=musl
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-s390x-gnu@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.59.0"
@@ -15871,6 +16145,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-s390x-gnu@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.63.2"
+ conditions: os=linux & cpu=s390x & libc=glibc
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-x64-gnu@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-x64-gnu@npm:4.59.0"
@@ -15878,6 +16159,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-x64-gnu@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-x64-gnu@npm:4.63.2"
+ conditions: os=linux & cpu=x64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-linux-x64-musl@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-linux-x64-musl@npm:4.59.0"
@@ -15885,6 +16173,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-linux-x64-musl@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-linux-x64-musl@npm:4.63.2"
+ conditions: os=linux & cpu=x64 & libc=musl
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-openbsd-x64@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-openbsd-x64@npm:4.59.0"
@@ -15892,6 +16187,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-openbsd-x64@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-openbsd-x64@npm:4.63.2"
+ conditions: os=openbsd & cpu=x64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-openharmony-arm64@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-openharmony-arm64@npm:4.59.0"
@@ -15899,6 +16201,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-openharmony-arm64@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-openharmony-arm64@npm:4.63.2"
+ conditions: os=openharmony & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-win32-arm64-msvc@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.59.0"
@@ -15906,6 +16215,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-win32-arm64-msvc@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.63.2"
+ conditions: os=win32 & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-win32-ia32-msvc@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.59.0"
@@ -15913,6 +16229,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-win32-ia32-msvc@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.63.2"
+ conditions: os=win32 & cpu=ia32
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-win32-x64-gnu@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-win32-x64-gnu@npm:4.59.0"
@@ -15920,6 +16243,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-win32-x64-gnu@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-win32-x64-gnu@npm:4.63.2"
+ conditions: os=win32 & cpu=x64
+ languageName: node
+ linkType: hard
+
"@rollup/rollup-win32-x64-msvc@npm:4.59.0":
version: 4.59.0
resolution: "@rollup/rollup-win32-x64-msvc@npm:4.59.0"
@@ -15927,6 +16257,13 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/rollup-win32-x64-msvc@npm:4.63.2":
+ version: 4.63.2
+ resolution: "@rollup/rollup-win32-x64-msvc@npm:4.63.2"
+ conditions: os=win32 & cpu=x64
+ languageName: node
+ linkType: hard
+
"@rspack/binding-darwin-arm64@npm:1.6.8":
version: 1.6.8
resolution: "@rspack/binding-darwin-arm64@npm:1.6.8"
@@ -19154,7 +19491,7 @@ __metadata:
languageName: node
linkType: hard
-"@testing-library/dom@npm:^10.4.0":
+"@testing-library/dom@npm:^10.4.0, @testing-library/dom@npm:^10.4.1":
version: 10.4.1
resolution: "@testing-library/dom@npm:10.4.1"
dependencies:
@@ -19643,6 +19980,40 @@ __metadata:
languageName: node
linkType: hard
+"@twentyhq/companion@workspace:packages/twenty-companion":
+ version: 0.0.0-use.local
+ resolution: "@twentyhq/companion@workspace:packages/twenty-companion"
+ dependencies:
+ "@base-ui/react": "npm:^1.5.0"
+ "@electron/packager": "npm:^19.0.0"
+ "@fontsource/inter": "npm:^5.2.8"
+ "@lingui/cli": "npm:5.9.5"
+ "@lingui/conf": "npm:5.9.5"
+ "@lingui/core": "npm:5.9.5"
+ "@recallai/desktop-sdk": "npm:2.0.29"
+ "@testing-library/dom": "npm:^10.4.1"
+ "@testing-library/react": "npm:^16.3.0"
+ "@testing-library/user-event": "npm:^14.6.1"
+ "@types/node": "npm:^24.7.2"
+ "@types/react": "npm:^19.2.0"
+ "@types/react-dom": "npm:^19.2.0"
+ clsx: "npm:^2.1.1"
+ electron: "npm:44.1.0"
+ esbuild: "npm:^0.28.1"
+ jsdom: "npm:^30.0.1"
+ monaco-editor: "npm:^0.52.2"
+ react: "npm:^19.2.0"
+ react-dom: "npm:^19.2.0"
+ sass: "npm:^1.83.0"
+ twenty-ui: "workspace:*"
+ typescript: "npm:^5.9.3"
+ vite: "npm:^7.3.0"
+ vite-plugin-svgr: "npm:^4.3.0"
+ vitest: "npm:^4.1.0"
+ zod: "npm:^4.1.0"
+ languageName: unknown
+ linkType: soft
+
"@tybys/wasm-util@npm:0.9.0, @tybys/wasm-util@npm:^0.9.0":
version: 0.9.0
resolution: "@tybys/wasm-util@npm:0.9.0"
@@ -20165,6 +20536,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/estree@npm:1.0.9":
+ version: 1.0.9
+ resolution: "@types/estree@npm:1.0.9"
+ checksum: 10c0/3ad3286ca2988cd550dafb8f2ad599c8474868e954fa601a36655bdfefd8039f7c714b8c1c7f2ae219ffbd58bd4660e66fa7479a0120fc02d4777057d4865387
+ languageName: node
+ linkType: hard
+
"@types/expect@npm:^1.20.4":
version: 1.20.4
resolution: "@types/expect@npm:1.20.4"
@@ -20812,6 +21190,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/node@npm:^24.7.2, @types/node@npm:^24.9.0":
+ version: 24.13.4
+ resolution: "@types/node@npm:24.13.4"
+ dependencies:
+ undici-types: "npm:~7.18.0"
+ checksum: 10c0/a12196e984cb09ead549651217b4b395961ea011f3a3791a9f78311d70b5f3be343c6fc935376553c06a34c14d963d4f637ad7829837b0c88cf441919f422893
+ languageName: node
+ linkType: hard
+
"@types/node@npm:^25.2.3":
version: 25.3.0
resolution: "@types/node@npm:25.3.0"
@@ -21366,6 +21753,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/yauzl@npm:^2.9.1":
+ version: 2.10.3
+ resolution: "@types/yauzl@npm:2.10.3"
+ dependencies:
+ "@types/node": "npm:*"
+ checksum: 10c0/f1b7c1b99fef9f2fe7f1985ef7426d0cebe48cd031f1780fcdc7451eec7e31ac97028f16f50121a59bcf53086a1fc8c856fd5b7d3e00970e43d92ae27d6b43dc
+ languageName: node
+ linkType: hard
+
"@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260116.1":
version: 7.0.0-dev.20260116.1
resolution: "@typescript/native-preview-darwin-arm64@npm:7.0.0-dev.20260116.1"
@@ -22944,6 +23340,13 @@ __metadata:
languageName: node
linkType: hard
+"@xmldom/xmldom@npm:^0.9.10":
+ version: 0.9.12
+ resolution: "@xmldom/xmldom@npm:0.9.12"
+ checksum: 10c0/0a9ef38e203213717dde8d16c62743c26c37eb4195aeb4f286550a0aec2145c063a6c3633f253c29f75202f922d7c961d1acaad4dd93e5db1ef05c813354d178
+ languageName: node
+ linkType: hard
+
"@xtuc/ieee754@npm:^1.2.0":
version: 1.2.0
resolution: "@xtuc/ieee754@npm:1.2.0"
@@ -24904,6 +25307,13 @@ __metadata:
languageName: node
linkType: hard
+"author-regex@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "author-regex@npm:1.0.0"
+ checksum: 10c0/3f3a5ad6660be010bd5b979fac180f435bd9615e81db2b1cdac081eb3f639461f6c3927ced956e377a5c91cc789e3de3a3e900e296c1423971043c8fd8be0b73
+ languageName: node
+ linkType: hard
+
"auto-bind@npm:^5.0.1":
version: 5.0.1
resolution: "auto-bind@npm:5.0.1"
@@ -25427,7 +25837,7 @@ __metadata:
languageName: node
linkType: hard
-"base64-js@npm:1.5.1, base64-js@npm:^1.0.2, base64-js@npm:^1.1.2, base64-js@npm:^1.3.0, base64-js@npm:^1.3.1":
+"base64-js@npm:1.5.1, base64-js@npm:^1.0.2, base64-js@npm:^1.1.2, base64-js@npm:^1.3.0, base64-js@npm:^1.3.1, base64-js@npm:^1.5.1":
version: 1.5.1
resolution: "base64-js@npm:1.5.1"
checksum: 10c0/f23823513b63173a001030fae4f2dabe283b99a9d324ade3ad3d148e218134676f1ee8568c877cd79ec1c53158dcf2d2ba527a97c606618928ba99dd930102bf
@@ -25672,6 +26082,13 @@ __metadata:
languageName: node
linkType: hard
+"boolean@npm:^3.0.1":
+ version: 3.2.0
+ resolution: "boolean@npm:3.2.0"
+ checksum: 10c0/6a0dc9668f6f3dda42a53c181fcbdad223169c8d87b6c4011b87a8b14a21770efb2934a778f063d7ece17280f8c06d313c87f7b834bb1dd526a867ffcd00febf
+ languageName: node
+ linkType: hard
+
"bowser@npm:^2.11.0":
version: 2.11.0
resolution: "bowser@npm:2.11.0"
@@ -27016,7 +27433,7 @@ __metadata:
languageName: node
linkType: hard
-"commander@npm:^9.0.0":
+"commander@npm:^9.0.0, commander@npm:^9.4.0":
version: 9.5.0
resolution: "commander@npm:9.5.0"
checksum: 10c0/5f7784fbda2aaec39e89eb46f06a999e00224b3763dc65976e05929ec486e174fe9aac2655f03ba6a5e83875bd173be5283dc19309b7c65954701c02025b3c1d
@@ -27626,7 +28043,7 @@ __metadata:
languageName: node
linkType: hard
-"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6":
+"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.1, cross-spawn@npm:^7.0.3, cross-spawn@npm:^7.0.6":
version: 7.0.6
resolution: "cross-spawn@npm:7.0.6"
dependencies:
@@ -28698,6 +29115,13 @@ __metadata:
languageName: node
linkType: hard
+"detect-node@npm:^2.0.4":
+ version: 2.1.0
+ resolution: "detect-node@npm:2.1.0"
+ checksum: 10c0/f039f601790f2e9d4654e499913259a798b1f5246ae24f86ab5e8bd4aaf3bce50484234c494f11fb00aecb0c6e2733aa7b1cf3f530865640b65fbbd65b2c4e09
+ languageName: node
+ linkType: hard
+
"detect-port@npm:1.5.1":
version: 1.5.1
resolution: "detect-port@npm:1.5.1"
@@ -29301,6 +29725,20 @@ __metadata:
languageName: node
linkType: hard
+"electron@npm:44.1.0":
+ version: 44.1.0
+ resolution: "electron@npm:44.1.0"
+ dependencies:
+ "@electron-internal/extract-zip": "npm:^1.0.1"
+ "@electron/get": "npm:^5.0.0"
+ "@types/node": "npm:^24.9.0"
+ bin:
+ electron: cli.js
+ install-electron: install.js
+ checksum: 10c0/93e274242b7f87714d401c99294184037079abcb494ca09a73090e6d34b2bba711c5018b71342e9c72da4d4038e67e8af4babe9ba29b00501553b1fbf890f19d
+ languageName: node
+ linkType: hard
+
"email-reply-parser@npm:^2.3.5":
version: 2.3.9
resolution: "email-reply-parser@npm:2.3.9"
@@ -29532,6 +29970,13 @@ __metadata:
languageName: node
linkType: hard
+"err-code@npm:^2.0.2":
+ version: 2.0.3
+ resolution: "err-code@npm:2.0.3"
+ checksum: 10c0/b642f7b4dd4a376e954947550a3065a9ece6733ab8e51ad80db727aaae0817c2e99b02a97a3d6cecc648a97848305e728289cf312d09af395403a90c9d4d8a66
+ languageName: node
+ linkType: hard
+
"error-ex@npm:^1.3.1":
version: 1.3.2
resolution: "error-ex@npm:1.3.2"
@@ -29722,6 +30167,13 @@ __metadata:
languageName: node
linkType: hard
+"es6-error@npm:^4.1.1":
+ version: 4.1.1
+ resolution: "es6-error@npm:4.1.1"
+ checksum: 10c0/357663fb1e845c047d548c3d30f86e005db71e122678f4184ced0693f634688c3f3ef2d7de7d4af732f734de01f528b05954e270f06aa7d133679fb9fe6600ef
+ languageName: node
+ linkType: hard
+
"esast-util-from-estree@npm:^2.0.0":
version: 2.0.0
resolution: "esast-util-from-estree@npm:2.0.0"
@@ -29835,7 +30287,7 @@ __metadata:
languageName: node
linkType: hard
-"esbuild@npm:^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.26.0 || ^0.27.0 || ^0.28.0":
+"esbuild@npm:^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.26.0 || ^0.27.0 || ^0.28.0, esbuild@npm:^0.27.0 || ^0.28.0":
version: 0.28.2
resolution: "esbuild@npm:0.28.2"
dependencies:
@@ -30696,6 +31148,23 @@ __metadata:
languageName: node
linkType: hard
+"extract-zip@npm:^2.0.1":
+ version: 2.0.1
+ resolution: "extract-zip@npm:2.0.1"
+ dependencies:
+ "@types/yauzl": "npm:^2.9.1"
+ debug: "npm:^4.1.1"
+ get-stream: "npm:^5.1.0"
+ yauzl: "npm:^2.10.0"
+ dependenciesMeta:
+ "@types/yauzl":
+ optional: true
+ bin:
+ extract-zip: cli.js
+ checksum: 10c0/9afbd46854aa15a857ae0341a63a92743a7b89c8779102c3b4ffc207516b2019337353962309f85c66ee3d9092202a83cdc26dbf449a11981272038443974aee
+ languageName: node
+ linkType: hard
+
"extsprintf@npm:1.3.0":
version: 1.3.0
resolution: "extsprintf@npm:1.3.0"
@@ -31049,6 +31518,13 @@ __metadata:
languageName: node
linkType: hard
+"filename-reserved-regex@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "filename-reserved-regex@npm:3.0.0"
+ checksum: 10c0/2b1df851a37f84723f9d8daf885ddfadd3dea2a124474db405295962abc1a01d6c9b6b27edec33bad32ef601e1a220f8a34d34f30ca5a911709700e2b517e268
+ languageName: node
+ linkType: hard
+
"filename-reserved-regex@npm:^4.0.0":
version: 4.0.0
resolution: "filename-reserved-regex@npm:4.0.0"
@@ -31056,6 +31532,15 @@ __metadata:
languageName: node
linkType: hard
+"filenamify@npm:^6.0.0":
+ version: 6.0.0
+ resolution: "filenamify@npm:6.0.0"
+ dependencies:
+ filename-reserved-regex: "npm:^3.0.0"
+ checksum: 10c0/6798be1f7eea9eddb4517527a890a9d1b97083a6392b0ca392b79034d02d92411830d1b0e29f85ebfcb5cd4f8494388c7f9975fbada9d5f4088fc8474fdf20ae
+ languageName: node
+ linkType: hard
+
"filenamify@npm:^7.0.1":
version: 7.0.1
resolution: "filenamify@npm:7.0.1"
@@ -31239,6 +31724,15 @@ __metadata:
languageName: node
linkType: hard
+"flora-colossus@npm:^3.0.2":
+ version: 3.0.2
+ resolution: "flora-colossus@npm:3.0.2"
+ dependencies:
+ debug: "npm:^4.4.1"
+ checksum: 10c0/1b56ca02d75b6eb5b0d70123b0f71ef320a8cb2bfd8def952de854121b7a8ea67fb2fa6e75e2bbef61a753b31c117a4405cd9b2597f54ca714bafa4ca3ef9504
+ languageName: node
+ linkType: hard
+
"flow-parser@npm:0.*":
version: 0.243.0
resolution: "flow-parser@npm:0.243.0"
@@ -31712,6 +32206,16 @@ __metadata:
languageName: node
linkType: hard
+"galactus@npm:^2.0.2":
+ version: 2.0.2
+ resolution: "galactus@npm:2.0.2"
+ dependencies:
+ debug: "npm:^4.4.1"
+ flora-colossus: "npm:^3.0.2"
+ checksum: 10c0/ee851b76250f946f97981ab4103a7121450632ab0bdc1285c80246325ca67dec7acd69c01706b6867a572cce3127b39b9d712fa1d815be4a8f8c3a1f7aeafaf1
+ languageName: node
+ linkType: hard
+
"gaxios@npm:7.1.5, gaxios@npm:^7.0.0, gaxios@npm:^7.0.0-rc.4, gaxios@npm:^7.1.4":
version: 7.1.5
resolution: "gaxios@npm:7.1.5"
@@ -31851,6 +32355,15 @@ __metadata:
languageName: node
linkType: hard
+"get-stream@npm:^5.1.0":
+ version: 5.2.0
+ resolution: "get-stream@npm:5.2.0"
+ dependencies:
+ pump: "npm:^3.0.0"
+ checksum: 10c0/43797ffd815fbb26685bf188c8cfebecb8af87b3925091dd7b9a9c915993293d78e3c9e1bce125928ff92f2d0796f3889b92b5ec6d58d1041b574682132e0a80
+ languageName: node
+ linkType: hard
+
"get-stream@npm:^6.0.0, get-stream@npm:^6.0.1":
version: 6.0.1
resolution: "get-stream@npm:6.0.1"
@@ -32048,7 +32561,7 @@ __metadata:
languageName: node
linkType: hard
-"glob@npm:^13.0.0, glob@npm:^13.0.1, glob@npm:^13.0.6":
+"glob@npm:^13.0.0, glob@npm:^13.0.1, glob@npm:^13.0.2, glob@npm:^13.0.6":
version: 13.0.6
resolution: "glob@npm:13.0.6"
dependencies:
@@ -32086,6 +32599,20 @@ __metadata:
languageName: node
linkType: hard
+"global-agent@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "global-agent@npm:3.0.0"
+ dependencies:
+ boolean: "npm:^3.0.1"
+ es6-error: "npm:^4.1.1"
+ matcher: "npm:^3.0.0"
+ roarr: "npm:^2.15.3"
+ semver: "npm:^7.3.2"
+ serialize-error: "npm:^7.0.1"
+ checksum: 10c0/bb8750d026b25da437072762fd739098bad92ff72f66483c3929db4579e072f5523960f7e7fd70ee0d75db48898067b5dc1c9c1d17888128cff008fcc34d1bd3
+ languageName: node
+ linkType: hard
+
"global-directory@npm:^4.0.1":
version: 4.0.1
resolution: "global-directory@npm:4.0.1"
@@ -32126,7 +32653,7 @@ __metadata:
languageName: node
linkType: hard
-"globalthis@npm:^1.0.4":
+"globalthis@npm:^1.0.1, globalthis@npm:^1.0.4":
version: 1.0.4
resolution: "globalthis@npm:1.0.4"
dependencies:
@@ -32294,7 +32821,7 @@ __metadata:
languageName: node
linkType: hard
-"got@npm:^14.6.6":
+"got@npm:^14.4.5, got@npm:^14.6.6":
version: 14.6.6
resolution: "got@npm:14.6.6"
dependencies:
@@ -34973,6 +35500,13 @@ __metadata:
languageName: node
linkType: hard
+"isbinaryfile@npm:^4.0.8":
+ version: 4.0.10
+ resolution: "isbinaryfile@npm:4.0.10"
+ checksum: 10c0/0703d8cfeb69ed79e6d173120f327450011a066755150a6bbf97ffecec1069a5f2092777868315b21359098c84b54984871cad1abce877ad9141fb2caf3dcabf
+ languageName: node
+ linkType: hard
+
"isexe@npm:^2.0.0":
version: 2.0.0
resolution: "isexe@npm:2.0.0"
@@ -36529,7 +37063,7 @@ __metadata:
languageName: node
linkType: hard
-"json-stringify-safe@npm:~5.0.1":
+"json-stringify-safe@npm:^5.0.1, json-stringify-safe@npm:~5.0.1":
version: 5.0.1
resolution: "json-stringify-safe@npm:5.0.1"
checksum: 10c0/7dbf35cd0411d1d648dceb6d59ce5857ec939e52e4afc37601aa3da611f0987d5cee5b38d58329ceddf3ed48bd7215229c8d52059ab01f2444a338bf24ed0f37
@@ -36684,6 +37218,13 @@ __metadata:
languageName: node
linkType: hard
+"junk@npm:^4.0.1":
+ version: 4.0.1
+ resolution: "junk@npm:4.0.1"
+ checksum: 10c0/091117a5dcf65b19a3e4b8506d95d6ab152b5b5fe6f10e8998de950b0f9d689f14d9b63bb07863b8c86c18511fd1b9a21e9a16e686246436558338ed2e8a4548
+ languageName: node
+ linkType: hard
+
"just-diff-apply@npm:^5.2.0":
version: 5.5.0
resolution: "just-diff-apply@npm:5.5.0"
@@ -37933,6 +38474,15 @@ __metadata:
languageName: node
linkType: hard
+"matcher@npm:^3.0.0":
+ version: 3.0.0
+ resolution: "matcher@npm:3.0.0"
+ dependencies:
+ escape-string-regexp: "npm:^4.0.0"
+ checksum: 10c0/2edf24194a2879690bcdb29985fc6bc0d003df44e04df21ebcac721fa6ce2f6201c579866bb92f9380bffe946f11ecd8cd31f34117fb67ebf8aca604918e127e
+ languageName: node
+ linkType: hard
+
"matchmediaquery@npm:^0.3.0":
version: 0.3.1
resolution: "matchmediaquery@npm:0.3.1"
@@ -39123,7 +39673,7 @@ __metadata:
languageName: node
linkType: hard
-"minimatch@npm:10.2.6":
+"minimatch@npm:10.2.6, minimatch@npm:^10.0.1":
version: 10.2.6
resolution: "minimatch@npm:10.2.6"
dependencies:
@@ -39386,7 +39936,7 @@ __metadata:
languageName: node
linkType: hard
-"monaco-editor@npm:0.52.2":
+"monaco-editor@npm:0.52.2, monaco-editor@npm:^0.52.2":
version: 0.52.2
resolution: "monaco-editor@npm:0.52.2"
checksum: 10c0/5a92da64f1e2ab375c0ce99364137f794d057c97bed10ecc65a08d6e6846804b8ecbd377eacf01e498f7dfbe1b21e8be64f728256681448f0484df90e767b435
@@ -39674,6 +40224,15 @@ __metadata:
languageName: node
linkType: hard
+"nanoid@npm:^3.3.18":
+ version: 3.3.19
+ resolution: "nanoid@npm:3.3.19"
+ bin:
+ nanoid: bin/nanoid.cjs
+ checksum: 10c0/ce7afa6258bfaa00bdc8de291cfe9913280eaa403b7d9cff3db4e4200c1913e7163577df74897958da144db473a96c67f74f57db0f542fbfe409df677bae3255
+ languageName: node
+ linkType: hard
+
"nanoid@npm:^5.0.7, nanoid@npm:^5.1.3, nanoid@npm:^5.1.6, nanoid@npm:^5.1.7":
version: 5.1.16
resolution: "nanoid@npm:5.1.16"
@@ -41563,6 +42122,15 @@ __metadata:
languageName: node
linkType: hard
+"parse-author@npm:^2.0.0":
+ version: 2.0.0
+ resolution: "parse-author@npm:2.0.0"
+ dependencies:
+ author-regex: "npm:^1.0.0"
+ checksum: 10c0/8b4c19523588a4271c89f64e8167be7c80b4765059c865d38a996c37d080c7e5123e3e2d07d47290891628ad27f4dfb692e3b61156c52fcc0af6cdce3ed57afd
+ languageName: node
+ linkType: hard
+
"parse-conflict-json@npm:^5.0.1":
version: 5.0.1
resolution: "parse-conflict-json@npm:5.0.1"
@@ -42039,6 +42607,13 @@ __metadata:
languageName: node
linkType: hard
+"pe-library@npm:^1.0.1":
+ version: 1.0.1
+ resolution: "pe-library@npm:1.0.1"
+ checksum: 10c0/1204201126db9477d1119e5312f09228ce1e0e6d6545fc5811f6166c259fe24a890297557abc5971ec8029f28777628ed71ba8c186ed6bd09ed1152c8a88b33d
+ languageName: node
+ linkType: hard
+
"peberminta@npm:^0.9.0":
version: 0.9.0
resolution: "peberminta@npm:0.9.0"
@@ -42430,6 +43005,17 @@ __metadata:
languageName: node
linkType: hard
+"plist@npm:^3.0.5, plist@npm:^3.1.0":
+ version: 3.1.1
+ resolution: "plist@npm:3.1.1"
+ dependencies:
+ "@xmldom/xmldom": "npm:^0.9.10"
+ base64-js: "npm:^1.5.1"
+ xmlbuilder: "npm:^15.1.1"
+ checksum: 10c0/af681277c2e541c6aab0ddee57f59459c43beeea1ee7aa2d4218aa39595fb41c068e2d2be3e4abb17e3252eaf2c1b806ecfb1d402fa5a3f4a6e1a7a32c880c9a
+ languageName: node
+ linkType: hard
+
"plugin-error@npm:^1.0.1":
version: 1.0.1
resolution: "plugin-error@npm:1.0.1"
@@ -42675,6 +43261,17 @@ __metadata:
languageName: node
linkType: hard
+"postcss@npm:^8.5.6":
+ version: 8.5.28
+ resolution: "postcss@npm:8.5.28"
+ dependencies:
+ nanoid: "npm:^3.3.18"
+ picocolors: "npm:^1.1.1"
+ source-map-js: "npm:^1.2.1"
+ checksum: 10c0/9fe44215a6628d89c8a75184b92f5b2f77e16f9e5b13b39b9009bb7e8e6eccddf82c8854bae922db1f17ace6ef3445073fe38abff513caeb03e5285b1b55620a
+ languageName: node
+ linkType: hard
+
"postgres-array@npm:~2.0.0":
version: 2.0.0
resolution: "postgres-array@npm:2.0.0"
@@ -42714,6 +43311,17 @@ __metadata:
languageName: node
linkType: hard
+"postject@npm:^1.0.0-alpha.6":
+ version: 1.0.0-alpha.6
+ resolution: "postject@npm:1.0.0-alpha.6"
+ dependencies:
+ commander: "npm:^9.4.0"
+ bin:
+ postject: dist/cli.js
+ checksum: 10c0/7d5c5ffdb63190d48cc4b4b617ef2fa144f2bfd5f035231af08a8d7465298ed2a08ee4b354df198b4c96b32d3d873e562b6d23caacd80eb0ec722d81381e4a3e
+ languageName: node
+ linkType: hard
+
"powershell-utils@npm:^0.1.0":
version: 0.1.0
resolution: "powershell-utils@npm:0.1.0"
@@ -42932,6 +43540,13 @@ __metadata:
languageName: node
linkType: hard
+"progress@npm:^2.0.3":
+ version: 2.0.3
+ resolution: "progress@npm:2.0.3"
+ checksum: 10c0/1697e07cb1068055dbe9fe858d242368ff5d2073639e652b75a7eb1f2a1a8d4afd404d719de23c7b48481a6aa0040686310e2dac2f53d776daa2176d3f96369c
+ languageName: node
+ linkType: hard
+
"promise-all-reject-late@npm:^1.0.0":
version: 1.0.1
resolution: "promise-all-reject-late@npm:1.0.1"
@@ -42960,6 +43575,16 @@ __metadata:
languageName: node
linkType: hard
+"promise-retry@npm:^2.0.1":
+ version: 2.0.1
+ resolution: "promise-retry@npm:2.0.1"
+ dependencies:
+ err-code: "npm:^2.0.2"
+ retry: "npm:^0.12.0"
+ checksum: 10c0/9c7045a1a2928094b5b9b15336dcd2a7b1c052f674550df63cc3f36cd44028e5080448175b6f6ca32b642de81150f5e7b1a98b728f15cb069f2dd60ac2616b96
+ languageName: node
+ linkType: hard
+
"prompts@npm:2.4.2, prompts@npm:^2.0.1":
version: 2.4.2
resolution: "prompts@npm:2.4.2"
@@ -44937,6 +45562,15 @@ __metadata:
languageName: node
linkType: hard
+"resedit@npm:^2.0.3":
+ version: 2.0.3
+ resolution: "resedit@npm:2.0.3"
+ dependencies:
+ pe-library: "npm:^1.0.1"
+ checksum: 10c0/d9ec8fc3900f3bf8fe818260149fdd6180b45d42f08d8bdf098a7a841d995363f44fd2d633948889e300a3ad8e7860b2d92fff9afcdcea21999994f5f526ffb0
+ languageName: node
+ linkType: hard
+
"reselect@npm:5.2.0, reselect@npm:^5.1.0":
version: 5.2.0
resolution: "reselect@npm:5.2.0"
@@ -45271,6 +45905,20 @@ __metadata:
languageName: node
linkType: hard
+"roarr@npm:^2.15.3":
+ version: 2.15.4
+ resolution: "roarr@npm:2.15.4"
+ dependencies:
+ boolean: "npm:^3.0.1"
+ detect-node: "npm:^2.0.4"
+ globalthis: "npm:^1.0.1"
+ json-stringify-safe: "npm:^5.0.1"
+ semver-compare: "npm:^1.0.0"
+ sprintf-js: "npm:^1.1.2"
+ checksum: 10c0/7d01d4c14513c461778dd673a8f9e53255221f8d04173aafeb8e11b23d8b659bb83f1c90cfe81af7f9c213b8084b404b918108fd792bda76678f555340cc64ec
+ languageName: node
+ linkType: hard
+
"robust-predicates@npm:^3.0.2":
version: 3.0.2
resolution: "robust-predicates@npm:3.0.2"
@@ -45512,6 +46160,99 @@ __metadata:
languageName: node
linkType: hard
+"rollup@npm:^4.43.0":
+ version: 4.63.2
+ resolution: "rollup@npm:4.63.2"
+ dependencies:
+ "@napi-rs/lzma-linux-x64-gnu": "npm:1.5.1"
+ "@rollup/rollup-android-arm-eabi": "npm:4.63.2"
+ "@rollup/rollup-android-arm64": "npm:4.63.2"
+ "@rollup/rollup-darwin-arm64": "npm:4.63.2"
+ "@rollup/rollup-darwin-x64": "npm:4.63.2"
+ "@rollup/rollup-freebsd-arm64": "npm:4.63.2"
+ "@rollup/rollup-freebsd-x64": "npm:4.63.2"
+ "@rollup/rollup-linux-arm-gnueabihf": "npm:4.63.2"
+ "@rollup/rollup-linux-arm-musleabihf": "npm:4.63.2"
+ "@rollup/rollup-linux-arm64-gnu": "npm:4.63.2"
+ "@rollup/rollup-linux-arm64-musl": "npm:4.63.2"
+ "@rollup/rollup-linux-loong64-gnu": "npm:4.63.2"
+ "@rollup/rollup-linux-loong64-musl": "npm:4.63.2"
+ "@rollup/rollup-linux-ppc64-gnu": "npm:4.63.2"
+ "@rollup/rollup-linux-ppc64-musl": "npm:4.63.2"
+ "@rollup/rollup-linux-riscv64-gnu": "npm:4.63.2"
+ "@rollup/rollup-linux-riscv64-musl": "npm:4.63.2"
+ "@rollup/rollup-linux-s390x-gnu": "npm:4.63.2"
+ "@rollup/rollup-linux-x64-gnu": "npm:4.63.2"
+ "@rollup/rollup-linux-x64-musl": "npm:4.63.2"
+ "@rollup/rollup-openbsd-x64": "npm:4.63.2"
+ "@rollup/rollup-openharmony-arm64": "npm:4.63.2"
+ "@rollup/rollup-win32-arm64-msvc": "npm:4.63.2"
+ "@rollup/rollup-win32-ia32-msvc": "npm:4.63.2"
+ "@rollup/rollup-win32-x64-gnu": "npm:4.63.2"
+ "@rollup/rollup-win32-x64-msvc": "npm:4.63.2"
+ "@types/estree": "npm:1.0.9"
+ fsevents: "npm:~2.3.2"
+ dependenciesMeta:
+ "@napi-rs/lzma-linux-x64-gnu":
+ optional: true
+ "@rollup/rollup-android-arm-eabi":
+ optional: true
+ "@rollup/rollup-android-arm64":
+ optional: true
+ "@rollup/rollup-darwin-arm64":
+ optional: true
+ "@rollup/rollup-darwin-x64":
+ optional: true
+ "@rollup/rollup-freebsd-arm64":
+ optional: true
+ "@rollup/rollup-freebsd-x64":
+ optional: true
+ "@rollup/rollup-linux-arm-gnueabihf":
+ optional: true
+ "@rollup/rollup-linux-arm-musleabihf":
+ optional: true
+ "@rollup/rollup-linux-arm64-gnu":
+ optional: true
+ "@rollup/rollup-linux-arm64-musl":
+ optional: true
+ "@rollup/rollup-linux-loong64-gnu":
+ optional: true
+ "@rollup/rollup-linux-loong64-musl":
+ optional: true
+ "@rollup/rollup-linux-ppc64-gnu":
+ optional: true
+ "@rollup/rollup-linux-ppc64-musl":
+ optional: true
+ "@rollup/rollup-linux-riscv64-gnu":
+ optional: true
+ "@rollup/rollup-linux-riscv64-musl":
+ optional: true
+ "@rollup/rollup-linux-s390x-gnu":
+ optional: true
+ "@rollup/rollup-linux-x64-gnu":
+ optional: true
+ "@rollup/rollup-linux-x64-musl":
+ optional: true
+ "@rollup/rollup-openbsd-x64":
+ optional: true
+ "@rollup/rollup-openharmony-arm64":
+ optional: true
+ "@rollup/rollup-win32-arm64-msvc":
+ optional: true
+ "@rollup/rollup-win32-ia32-msvc":
+ optional: true
+ "@rollup/rollup-win32-x64-gnu":
+ optional: true
+ "@rollup/rollup-win32-x64-msvc":
+ optional: true
+ fsevents:
+ optional: true
+ bin:
+ rollup: dist/bin/rollup
+ checksum: 10c0/3fc54d1ca6395b03a79594c0406e1f3549a96320d3f2261d0140c470977446d96d944d9728388fffeaa6cb605b125965c7d4aa224ab3ac05d0dac8c0c68ccc8e
+ languageName: node
+ linkType: hard
+
"rope-sequence@npm:^1.3.0":
version: 1.3.4
resolution: "rope-sequence@npm:1.3.4"
@@ -46068,6 +46809,13 @@ __metadata:
languageName: node
linkType: hard
+"semver-compare@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "semver-compare@npm:1.0.0"
+ checksum: 10c0/9ef4d8b81847556f0865f46ddc4d276bace118c7cb46811867af82e837b7fc473911981d5a0abc561fa2db487065572217e5b06e18701c4281bcdd2a1affaff1
+ languageName: node
+ linkType: hard
+
"semver-regex@npm:^4.0.5":
version: 4.0.5
resolution: "semver-regex@npm:4.0.5"
@@ -46120,7 +46868,7 @@ __metadata:
languageName: node
linkType: hard
-"semver@npm:7.8.5, semver@npm:^7.8.5":
+"semver@npm:7.8.5, semver@npm:^7.3.2, semver@npm:^7.7.1, semver@npm:^7.8.5":
version: 7.8.5
resolution: "semver@npm:7.8.5"
bin:
@@ -46235,6 +46983,15 @@ __metadata:
languageName: node
linkType: hard
+"serialize-error@npm:^7.0.1":
+ version: 7.0.1
+ resolution: "serialize-error@npm:7.0.1"
+ dependencies:
+ type-fest: "npm:^0.13.1"
+ checksum: 10c0/7982937d578cd901276c8ab3e2c6ed8a4c174137730f1fb0402d005af209a0e84d04acc874e317c936724c7b5b26c7a96ff7e4b8d11a469f4924a4b0ea814c05
+ languageName: node
+ linkType: hard
+
"serve-static@npm:^2.2.0":
version: 2.2.0
resolution: "serve-static@npm:2.2.0"
@@ -47068,6 +47825,13 @@ __metadata:
languageName: node
linkType: hard
+"sprintf-js@npm:^1.1.2":
+ version: 1.1.3
+ resolution: "sprintf-js@npm:1.1.3"
+ checksum: 10c0/09270dc4f30d479e666aee820eacd9e464215cdff53848b443964202bf4051490538e5dd1b42e1a65cf7296916ca17640aebf63dae9812749c7542ee5f288dec
+ languageName: node
+ linkType: hard
+
"sprintf-js@npm:~1.0.2":
version: 1.0.3
resolution: "sprintf-js@npm:1.0.3"
@@ -47839,6 +48603,15 @@ __metadata:
languageName: node
linkType: hard
+"sumchecker@npm:^3.0.1":
+ version: 3.0.1
+ resolution: "sumchecker@npm:3.0.1"
+ dependencies:
+ debug: "npm:^4.1.0"
+ checksum: 10c0/43c387be9dfe22dbeaf39dfa4ffb279847aeb37a42a8988c0b066f548bbd209aa8c65e03da29f2b29be1a66b577801bf89fff0007df4183db2f286263a9569e5
+ languageName: node
+ linkType: hard
+
"super-regex@npm:^1.0.0":
version: 1.1.0
resolution: "super-regex@npm:1.1.0"
@@ -49954,6 +50727,13 @@ __metadata:
languageName: node
linkType: hard
+"type-fest@npm:^0.13.1":
+ version: 0.13.1
+ resolution: "type-fest@npm:0.13.1"
+ checksum: 10c0/0c0fa07ae53d4e776cf4dac30d25ad799443e9eef9226f9fddbb69242db86b08584084a99885cfa5a9dfe4c063ebdc9aa7b69da348e735baede8d43f1aeae93b
+ languageName: node
+ linkType: hard
+
"type-fest@npm:^0.20.2":
version: 0.20.2
resolution: "type-fest@npm:0.20.2"
@@ -50429,6 +51209,13 @@ __metadata:
languageName: node
linkType: hard
+"undici@npm:^7.24.4":
+ version: 7.29.1
+ resolution: "undici@npm:7.29.1"
+ checksum: 10c0/5a419b1364531071ebdfd93748f7f2392d4eb6d68dd99814e1020f8fc6a517e3298129004c871516ee204bac68aba93541f587200b04a7449b8d45683a7d86f6
+ languageName: node
+ linkType: hard
+
"undici@npm:^8.4.1, undici@npm:^8.9.0":
version: 8.9.0
resolution: "undici@npm:8.9.0"
@@ -51125,7 +51912,7 @@ __metadata:
languageName: node
linkType: hard
-"uuid@npm:11.1.1, uuid@npm:^11.1.1":
+"uuid@npm:11.1.1, uuid@npm:^11.1.0, uuid@npm:^11.1.1":
version: 11.1.1
resolution: "uuid@npm:11.1.1"
bin:
@@ -51560,6 +52347,61 @@ __metadata:
languageName: node
linkType: hard
+"vite@npm:^7.3.0":
+ version: 7.3.6
+ resolution: "vite@npm:7.3.6"
+ dependencies:
+ esbuild: "npm:^0.27.0 || ^0.28.0"
+ fdir: "npm:^6.5.0"
+ fsevents: "npm:~2.3.3"
+ picomatch: "npm:^4.0.3"
+ postcss: "npm:^8.5.6"
+ rollup: "npm:^4.43.0"
+ tinyglobby: "npm:^0.2.15"
+ peerDependencies:
+ "@types/node": ^20.19.0 || >=22.12.0
+ jiti: ">=1.21.0"
+ less: ^4.0.0
+ lightningcss: ^1.21.0
+ sass: ^1.70.0
+ sass-embedded: ^1.70.0
+ stylus: ">=0.54.8"
+ sugarss: ^5.0.0
+ terser: ^5.16.0
+ tsx: ^4.8.1
+ yaml: ^2.4.2
+ dependenciesMeta:
+ fsevents:
+ optional: true
+ peerDependenciesMeta:
+ "@types/node":
+ optional: true
+ jiti:
+ optional: true
+ less:
+ optional: true
+ lightningcss:
+ optional: true
+ sass:
+ optional: true
+ sass-embedded:
+ optional: true
+ stylus:
+ optional: true
+ sugarss:
+ optional: true
+ terser:
+ optional: true
+ tsx:
+ optional: true
+ yaml:
+ optional: true
+ bin:
+ vite: bin/vite.js
+ checksum: 10c0/c6d359f84ad362f5c97ff7988b77c90add04162c60cdf6059375a7d9e3217848c53a8cb6b6c48517bef84b6bba4c9bc85319a889b5236acb7d5a2bc8cb7b9a8d
+ languageName: node
+ linkType: hard
+
"vitest@npm:^4.1.0":
version: 4.1.11
resolution: "vitest@npm:4.1.11"
@@ -52763,7 +53605,7 @@ __metadata:
languageName: node
linkType: hard
-"yauzl@npm:^2.4.2":
+"yauzl@npm:^2.10.0, yauzl@npm:^2.4.2":
version: 2.10.0
resolution: "yauzl@npm:2.10.0"
dependencies:
@@ -53075,6 +53917,13 @@ __metadata:
languageName: node
linkType: hard
+"zod@npm:^4.1.0":
+ version: 4.6.2
+ resolution: "zod@npm:4.6.2"
+ checksum: 10c0/0d0dc2dc37c62e8777bb2d691e7fb8a0c80cc57e343df69fa62a57f26e0ac20107b14afda34f3bed98b27e5378eee2bbc7c5d23c203c3602690148a014dec7cd
+ languageName: node
+ linkType: hard
+
"zod@npm:^4.1.11":
version: 4.1.11
resolution: "zod@npm:4.1.11"