The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(onboarding): remove the intro cinematic, the guided-onboarding tests, and their comments (#126139)
Siddharth Balyand9d122a00363
diff --git a/apps/desktop/electron/chat-onboarding-window.ts b/apps/desktop/electron/chat-onboarding-window.tsindex 0e0c9e53292..0de64bbfc17 100644--- a/apps/desktop/electron/chat-onboarding-window.ts+++ b/apps/desktop/electron/chat-onboarding-window.ts@@ -15,7 +15,6 @@ export function registerChatOnboardingWindow({ enabled, mainWindow }: ChatOnboarreturn}- // The request arrives in renderer CSS pixels; growWindowBounds converts it to DIP with the zoom factor below.const bounds = win.getBounds()win.setBounds(diff --git a/apps/desktop/electron/guest-onboarding-flag.test.ts b/apps/desktop/electron/guest-onboarding-flag.test.tsdeleted file mode 100644index 75108f69d93..00000000000--- a/apps/desktop/electron/guest-onboarding-flag.test.ts+++ /dev/null@@ -1,57 +0,0 @@-import assert from 'node:assert/strict'--import { test } from 'vitest'--import { desktopBackendSpawnEnv, guestOnboardingEnabled, skipIntroEnabled } from './guest-onboarding'-import { buildSpawnCommand } from './remote-lifecycle'--test('skipIntroEnabled: exactly "1" in env or --skip-intro on argv skips the first-run film', () => {- assert.equal(skipIntroEnabled([], { HERMES_SKIP_INTRO: '1' }), true)- assert.equal(skipIntroEnabled(['electron', '.', '--skip-intro'], {}), true)-- assert.equal(skipIntroEnabled([], {}), false)- assert.equal(skipIntroEnabled([], { HERMES_SKIP_INTRO: 'true' }), false)-})--test('guestOnboardingEnabled: exactly "1" in env or --guest-onboarding on argv turns the free tier on', () => {- assert.equal(guestOnboardingEnabled([], { HERMES_GUEST_ONBOARDING: '1' }), true)- assert.equal(guestOnboardingEnabled(['electron', '.', '--guest-onboarding'], {}), true)-- assert.equal(guestOnboardingEnabled([], {}), false)- assert.equal(guestOnboardingEnabled([], { HERMES_GUEST_ONBOARDING: 'true' }), false)- assert.equal(guestOnboardingEnabled([], { HERMES_GUEST_ONBOARDING: '0' }), false)- assert.equal(guestOnboardingEnabled(['electron', '.', '--local'], { HERMES_GUEST_ONBOARDING: '' }), false)-})--test('desktopBackendSpawnEnv stamps the launch decision last and never lets an inherited value leak', () => {- const base = {- HERMES_HOME: '/tmp/home',- HERMES_DESKTOP: '1',- HERMES_GUEST_ONBOARDING: '1',- PATH: '/usr/bin'- }-- const on = desktopBackendSpawnEnv({ ...base, HERMES_GUEST_ONBOARDING: '0' }, true)- assert.equal(on.HERMES_GUEST_ONBOARDING, '1')-- const off = desktopBackendSpawnEnv(base, false)- assert.equal(off.HERMES_GUEST_ONBOARDING, '0', 'a stray inherited "1" must not turn the free tier on')-- for (const env of [on, off]) {- assert.equal(env.HERMES_HOME, base.HERMES_HOME)- assert.equal(env.HERMES_DESKTOP, base.HERMES_DESKTOP)- assert.equal(env.PATH, base.PATH)- }-})--test('remote SSH spawn command carries HERMES_GUEST_ONBOARDING=1 only when the launch decided on', () => {- const on = buildSpawnCommand('/x/hermes', 'work', { logPath: '~/.hermes/log', guestOnboarding: true })- assert.match(on, /exec env HERMES_DESKTOP=1 HERMES_GUEST_ONBOARDING=1 /)-- const off = buildSpawnCommand('/x/hermes', 'work', { logPath: '~/.hermes/log', guestOnboarding: false })- assert.match(off, /exec env HERMES_DESKTOP=1 /)- assert.doesNotMatch(off, /HERMES_GUEST_ONBOARDING/)-- const unset = buildSpawnCommand('/x/hermes', 'work', { logPath: '~/.hermes/log' })- assert.doesNotMatch(unset, /HERMES_GUEST_ONBOARDING/)-})diff --git a/apps/desktop/electron/guest-onboarding.ts b/apps/desktop/electron/guest-onboarding.tsindex a82290d9c9a..24ad95e49f7 100644--- a/apps/desktop/electron/guest-onboarding.ts+++ b/apps/desktop/electron/guest-onboarding.ts@@ -1,17 +1,5 @@-// The Nous free tier is gated by ONE launch-time decision. The Python backend-// reads HERMES_GUEST_ONBOARDING and treats exactly "1" as on; the desktop-// decides once at launch (env or `--guest-onboarding` argv) and stamps that-// answer onto every backend it spawns, so the app and its backends can never-// disagree about whether the free tier is live.-export const GUEST_ONBOARDING_ENV = 'HERMES_GUEST_ONBOARDING'export const GUEST_ONBOARDING_FLAG = '--guest-onboarding'-// Skip the first-run film. A rehearsal aid: the intro is a one-time reveal,-// so anyone iterating on the guided chat behind it otherwise sits through it-// on every fresh HERMES_HOME. The guide still runs — only the film is-// skipped. Renderer-only; the backend never sees it.-export const SKIP_INTRO_ENV = 'HERMES_SKIP_INTRO'-export const SKIP_INTRO_FLAG = '--skip-intro'export function guestOnboardingEnabled(argv: readonly string[] = process.argv,@@ -20,17 +8,6 @@ export function guestOnboardingEnabled(return env[GUEST_ONBOARDING_ENV] === '1' || argv.includes(GUEST_ONBOARDING_FLAG)}-export function skipIntroEnabled(- argv: readonly string[] = process.argv,- env: NodeJS.ProcessEnv = process.env-): boolean {- return env[SKIP_INTRO_ENV] === '1' || argv.includes(SKIP_INTRO_FLAG)-}--// Outermost wrapper for a backend spawn env: the flag is written LAST so no-// earlier spread (process.env, backend.env) can resurrect a stray value, and-// "off" is an explicit '0' rather than an absent key so a '1' inherited from-// the parent's environment cannot leak into a backend the launch decided off.export function desktopBackendSpawnEnv(base: NodeJS.ProcessEnv, guestOnboarding: boolean): NodeJS.ProcessEnv {return { ...base, [GUEST_ONBOARDING_ENV]: guestOnboarding ? '1' : '0' }}diff --git a/apps/desktop/electron/intro-reveal-window.ts b/apps/desktop/electron/intro-reveal-window.tsdeleted file mode 100644index 649602a610e..00000000000--- a/apps/desktop/electron/intro-reveal-window.ts+++ /dev/null@@ -1,259 +0,0 @@-import { pathToFileURL } from 'node:url'--import { BrowserWindow, ipcMain, screen } from 'electron'--import { attachRendererConsoleCapture } from './renderer-log'-import { chatWindowWebPreferences } from './session-windows'-import { installWindowRendererLifecycle } from './window-renderer-lifecycle'-import { createWindowRevealController } from './window-reveal'--// Longer than the renderer's INTRO_DEADMAN_MS, so the main process closes the overlay if the renderer clock stalls.-export const INTRO_REVEAL_WATCHDOG_MS = 34_000-const INTRO_FROST_IN_MS = 500-const INTRO_FROST_OUT_MS = 600--interface IntroRevealOpenPayload {- hideMain?: boolean-}--interface IntroRevealClosePayload {- showMain?: boolean-}--interface IntroRevealWindowOptions {- devServer?: string- enabled: boolean- isMac: boolean- loadWindowUrl: (window: BrowserWindow, url: string, label: string) => void- log: (message: string) => void- mainWindow: () => BrowserWindow | null- preloadPath: string- rendererIndex: () => string- showMain: () => void- wireWindow: (window: BrowserWindow) => void-}--export function createIntroRevealWindowController({- devServer,- enabled,- isMac,- loadWindowUrl,- log,- mainWindow,- preloadPath,- rendererIndex,- showMain,- wireWindow-}: IntroRevealWindowOptions) {- let introRevealWindow: BrowserWindow | null = null- let introRevealWatchdog: ReturnType<typeof setTimeout> | null = null- let introRevealShow: ReturnType<typeof createWindowRevealController> | null = null- let frostTimer: ReturnType<typeof setTimeout> | null = null- let mainFadeTimer: ReturnType<typeof setInterval> | null = null- let onboardingFlowHidMain = false-- function clearIntroRevealWatchdog() {- if (introRevealWatchdog) {- clearTimeout(introRevealWatchdog)- introRevealWatchdog = null- }- }-- function introRevealUrl() {- if (devServer) {- return `${devServer.endsWith('/') ? devServer.slice(0, -1) : devServer}/?win=intro#/`- }-- return `${pathToFileURL(rendererIndex()).toString()}?win=intro#/`- }-- function showMainAfterOnboarding() {- onboardingFlowHidMain = false- const main = mainWindow()-- if (!main || main.isDestroyed()) {- return- }-- if (mainFadeTimer) {- clearInterval(mainFadeTimer)- }-- const started = Date.now()-- main.setOpacity(0)- showMain()- mainFadeTimer = setInterval(() => {- if (main.isDestroyed()) {- clearInterval(mainFadeTimer)- mainFadeTimer = null-- return- }-- const t = Math.min(1, (Date.now() - started) / 450)-- main.setOpacity(t * (2 - t))-- if (t >= 1) {- clearInterval(mainFadeTimer)- mainFadeTimer = null- }- }, 16)- }-- function armIntroRevealShow(win: BrowserWindow) {- introRevealShow?.dispose()- introRevealShow = createWindowRevealController({- isDestroyed: () => win.isDestroyed(),- isVisible: () => win.isVisible(),- show: () => {- win.show()-- if (isMac) {- win.setVibrancy('hud', { animationDuration: INTRO_FROST_IN_MS })- }- }- })- // ready-to-show fires on the empty shell; the renderer signals after paint.- win.webContents.once('did-finish-load', introRevealShow.scheduleFallback)- }-- function spawnIntroRevealWindow() {- const win = new BrowserWindow({- ...screen.getPrimaryDisplay().bounds,- alwaysOnTop: true,- backgroundColor: '#00000000',- focusable: true,- frame: false,- fullscreenable: false,- hasShadow: false,- hiddenInMissionControl: isMac,- maximizable: false,- minimizable: false,- movable: false,- resizable: false,- show: false,- skipTaskbar: !isMac,- transparent: true,- type: isMac ? 'panel' : undefined,- visualEffectState: isMac ? 'active' : undefined,- webPreferences: { ...chatWindowWebPreferences(preloadPath), backgroundThrottling: false }- })-- win.setAlwaysOnTop(true, 'screen-saver')-- if (isMac) {- win.setVisibleOnAllWorkspaces(true, { visibleOnFullScreen: true, skipTransformProcessType: true })- }-- wireWindow(win)- armIntroRevealShow(win)- installWindowRendererLifecycle(win, { kind: 'overlay', callbacks: { log } })- attachRendererConsoleCapture(win, 'intro-reveal', log)- win.on('closed', () => {- introRevealShow?.dispose()- introRevealShow = null- introRevealWindow = null- clearIntroRevealWatchdog()-- if (onboardingFlowHidMain) {- showMainAfterOnboarding()- }-- const main = mainWindow()-- if (main && !main.isDestroyed()) {- main.webContents.send('hermes:intro-reveal:closed')- }- })- loadWindowUrl(win, introRevealUrl(), 'Intro reveal')-- return win- }-- function openIntroReveal(payload: IntroRevealOpenPayload = {}) {- if (!enabled) {- return { ok: false }- }-- if (introRevealWindow && !introRevealWindow.isDestroyed()) {- return { ok: true }- }-- introRevealWindow = spawnIntroRevealWindow()- introRevealWatchdog = setTimeout(() => closeIntroReveal({ showMain: true }), INTRO_REVEAL_WATCHDOG_MS)- const main = mainWindow()-- if (payload.hideMain === true && main && !main.isDestroyed()) {- // Set before the overlay's first paint, so a skip during load still shows the main window again.- onboardingFlowHidMain = true- main.hide()- }-- return { ok: true }- }-- function closeIntroReveal(payload: IntroRevealClosePayload = {}) {- clearIntroRevealWatchdog()- introRevealShow?.dispose()- const win = introRevealWindow-- if (win && !win.isDestroyed() && !frostTimer) {- if (isMac) {- win.setVibrancy(null, { animationDuration: INTRO_FROST_OUT_MS })- }-- frostTimer = setTimeout(() => {- frostTimer = null-- if (!win.isDestroyed()) {- win.close()- }- }, INTRO_FROST_OUT_MS)- }-- if (payload.showMain === true && onboardingFlowHidMain) {- showMainAfterOnboarding()- }-- return { ok: true }- }-- function destroy() {- clearIntroRevealWatchdog()- introRevealShow?.dispose()-- if (frostTimer) {- clearTimeout(frostTimer)- frostTimer = null- }-- if (mainFadeTimer) {- clearInterval(mainFadeTimer)- mainFadeTimer = null- }-- // Cleared before destroy, so the 'closed' handler does not show the main window while the app quits.- onboardingFlowHidMain = false- introRevealWindow?.destroy()- introRevealWindow = null- }-- ipcMain.handle('hermes:intro-reveal:open', (_event, payload?: IntroRevealOpenPayload) => openIntroReveal(payload))- ipcMain.handle('hermes:intro-reveal:close', (_event, payload?: IntroRevealClosePayload) => closeIntroReveal(payload))- ipcMain.on('hermes:intro-reveal:ready', event => {- if (event.sender === introRevealWindow?.webContents) {- introRevealShow?.reveal()- }- })- ipcMain.on('hermes:intro-reveal:skip', event => {- const main = mainWindow()-- if (event.sender === introRevealWindow?.webContents && main && !main.isDestroyed()) {- main.webContents.send('hermes:intro-reveal:skip')- }- })-- return { destroy, showMainAfterOnboarding }-}diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.tsindex 9878938485d..a1422c3b7d2 100644--- a/apps/desktop/electron/main.ts+++ b/apps/desktop/electron/main.ts@@ -267,7 +267,7 @@ import { resolveGatewayVersion } from './gateway-version'import { probeGatewayWebSocket, spawnedBackendProbeOptions } from './gateway-ws-probe'import { windowsGitCandidates } from './git-binary-candidates'import { registerGitIpc } from './git-ipc'-import { desktopBackendSpawnEnv, guestOnboardingEnabled, skipIntroEnabled } from './guest-onboarding'+import { desktopBackendSpawnEnv, guestOnboardingEnabled } from './guest-onboarding'import { readAndConsumeHandoffResult } from './handoff-result'import {assertExistingPathForOpen,@@ -311,7 +311,6 @@ import { buildHudWindowUrl } from './hud-url'import { resolveHudWindowing } from './hud-windowing'import { INSTALL_STAMP, installShape } from './install-stamp'import type { InstallStamp } from './install-stamp'-import { createIntroRevealWindowController } from './intro-reveal-window'import { applyLaunchProfileOverride } from './launch-profile'import { CURL_TITLE_WRITE_OUT, parseCurlTitleResponse } from './link-title-curl'import { canonicalTitleCacheKey, isFetchableHttpUrl } from './link-title-url'@@ -1086,7 +1085,6 @@ const BOOT_FAKE_ERROR = process.env.HERMES_DESKTOP_BOOT_FAKE_ERROR || ''const SKIP_QUIT_CONFIRM = process.env.HERMES_DESKTOP_SKIP_QUIT_CONFIRM === '1'// One launch decision must reach both the renderer and every backend spawn.const GUEST_ONBOARDING: boolean = guestOnboardingEnabled()-const SKIP_INTRO: boolean = skipIntroEnabled()const BOOT_FAKE_STEP_MS = (() => {const raw = Number.parseInt(String(process.env.HERMES_DESKTOP_BOOT_FAKE_STEP_MS || ''), 10)@@ -13893,22 +13891,6 @@ const wakeIndicatorController = createWakeIndicatorWindowController({wireWindow: window => wireCommonWindowHandlers(window, zoomWiringForWindowKind('wakeIndicator'))})-const introRevealController: ReturnType<typeof createIntroRevealWindowController> = createIntroRevealWindowController({- devServer: DEV_SERVER,- enabled: GUEST_ONBOARDING,- isMac: IS_MAC,- loadWindowUrl,- log: rememberLog,- mainWindow: (): BrowserWindow | null => mainWindow,- preloadPath: PRELOAD_PATH,- rendererIndex: resolveRendererIndex,- showMain: (): void => {- mainWindow.show()- mainWindow.focus()- },- wireWindow: (window: BrowserWindow): void => wireCommonWindowHandlers(window, zoomWiringForWindowKind('petOverlay'))-})-registerChatOnboardingWindow({ enabled: GUEST_ONBOARDING, mainWindow: (): BrowserWindow | null => mainWindow })registerMachineProfile()@@ -15028,7 +15010,6 @@ function createWindow() {mainWindow.on('closed', () => {closePetOverlay()wakeIndicatorController.close()- introRevealController.destroy()if (mainWindow === createdMainWindow) {mainWindow = null@@ -17816,8 +17797,7 @@ ipcMain.on('hermes:feature-flags', (event: IpcMainEvent): void => {argv: process.argv,canary: resolveUpdaterChannelFromStamp() === 'canary'}),- guestOnboarding: GUEST_ONBOARDING,- skipIntro: SKIP_INTRO+ guestOnboarding: GUEST_ONBOARDING}})@@ -19152,7 +19132,6 @@ app.on('before-quit', event => {// pet can't keep the process alive or float over a quit app.closePetOverlay()wakeIndicatorController.close()- introRevealController.destroy()// Same for the HUD — an always-on-top panel outliving the app would leave a// floating composer with nothing behind it. Close it directly rather than viadiff --git a/apps/desktop/electron/preload-flags.test.ts b/apps/desktop/electron/preload-flags.test.tsindex 3486c8735d8..b76f66ac70c 100644--- a/apps/desktop/electron/preload-flags.test.ts+++ b/apps/desktop/electron/preload-flags.test.ts@@ -4,7 +4,7 @@ const host = vi.hoisted(() => ({exposeInMainWorld: vi.fn(),send: vi.fn<(channel: string, line: string) => void>(),sendSync: vi.fn((channel: string): unknown =>- channel === 'hermes:feature-flags' ? { localModels: true, guestOnboarding: true, skipIntro: true } : {}+ channel === 'hermes:feature-flags' ? { localModels: true, guestOnboarding: true } : {})}))@@ -20,7 +20,7 @@ it('publishes the feature flags answered by main before the renderer starts', asconst registration = host.exposeInMainWorld.mock.calls.find(([name]): boolean => name === 'hermesDesktop')expect(registration).toBeDefined()- expect(registration![1]).toMatchObject({ localModelsEnabled: true, guestOnboardingEnabled: true, skipIntro: true })+ expect(registration![1]).toMatchObject({ localModelsEnabled: true, guestOnboardingEnabled: true })expect(host.sendSync).toHaveBeenCalledWith('hermes:feature-flags')})diff --git a/apps/desktop/electron/preload.ts b/apps/desktop/electron/preload.tsindex 04637b8e7c2..edf6c069ae7 100644--- a/apps/desktop/electron/preload.ts+++ b/apps/desktop/electron/preload.ts@@ -15,7 +15,7 @@ const translucencySupport = ipcRenderer.sendSync('hermes:translucency:support')const hudWindowing = ipcRenderer.sendSync('hermes:hud:windowing')const hudNativeDrag = hudWindowing?.nativeDrag === true-const launchFlags: { localModels?: boolean; guestOnboarding?: boolean; skipIntro?: boolean } | undefined =+const launchFlags: { localModels?: boolean; guestOnboarding?: boolean } | undefined =ipcRenderer.sendSync('hermes:feature-flags')// Local, sanitized skin payload for the first renderer theme paint. This does@@ -34,9 +34,6 @@ contextBridge.exposeInMainWorld('hermesDesktop', {// decision is stamped onto every backend the app spawns.guestOnboardingEnabled: launchFlags?.guestOnboarding === true,localSkin: localSkin && typeof localSkin === 'object' ? localSkin : null,- // Launch-flag fact: skip the first-run film (HERMES_SKIP_INTRO=1 or- // --skip-intro). Rehearsal aid for the guided chat behind it.- skipIntro: launchFlags?.skipIntro === true,getConnection: (profile, opts) => ipcRenderer.invoke('hermes:connection', profile, opts),// Registry-scoped backend resolution: { connectionId, profile } → descriptor.getConnectionFor: payload => ipcRenderer.invoke('hermes:connection:for', payload),@@ -82,26 +79,6 @@ contextBridge.exposeInMainWorld('hermesDesktop', {grow: request => ipcRenderer.send('hermes:chat-onboarding:grow', request),soloBoot: () => ipcRenderer.send('hermes:chat-onboarding:solo-boot')},- introReveal: {- open: (payload?: { hideMain?: boolean }) => ipcRenderer.invoke('hermes:intro-reveal:open', payload),- close: (payload?: { showMain?: boolean }) => ipcRenderer.invoke('hermes:intro-reveal:close', payload),- skip: () => ipcRenderer.send('hermes:intro-reveal:skip'),- ready: () => ipcRenderer.send('hermes:intro-reveal:ready'),- onSkip: callback => {- const listener = () => callback()-- ipcRenderer.on('hermes:intro-reveal:skip', listener)-- return () => ipcRenderer.removeListener('hermes:intro-reveal:skip', listener)- },- onClosed: callback => {- const listener = () => callback()-- ipcRenderer.on('hermes:intro-reveal:closed', listener)-- return () => ipcRenderer.removeListener('hermes:intro-reveal:closed', listener)- }- },petOverlay: {// Main renderer → main process: window lifecycle + drag. `request` is// `{ bounds, screen }`; resolves with the screen bounds it actually used.diff --git a/apps/desktop/electron/window-growth.ts b/apps/desktop/electron/window-growth.tsindex a9470d72bba..a5ba6002b42 100644--- a/apps/desktop/electron/window-growth.ts+++ b/apps/desktop/electron/window-growth.ts@@ -1,39 +1,22 @@-/**- * Geometry for the main window as the guided chat grows it.- *- * Extracted from the `chat-onboarding:grow` handler so the resulting size can be asserted in a unit test- * instead of checked by eye on a first run.- */-import type { Rectangle } from 'electron'export interface GrowRequest {bottom?: numberleft?: number- /** Floor for the resulting viewport width in CSS pixels, used to clear a responsive breakpoint. */minWidth?: numberright?: numbertop?: number}export interface GrowInputs {- /** Current window bounds, frame included. */bounds: { height: number; width: number }- /** `bounds.width` minus the content width, non-zero on platforms that draw a window frame. `minWidth` is a- * viewport floor, so the frame width is added to it. */frameWidth?: number- /** Display work area the result is centred in and clamped to. */workArea: { height: number; width: number; x: number; y: number }- /** Renderer zoom factor. Requests arrive in CSS pixels; window bounds are in DIP. */zoom?: number}-/** Cap on each value converted from the request, so a malformed request cannot ask for an oversized window.- * The work area clamp below is usually the stricter limit. */const MAX_DELTA_PX = 4000-/** Fraction of the display work area a grown window may fill. Below 1 so the result keeps a margin instead- * of looking maximized. */const MAX_WORK_AREA = 0.92export function growWindowBounds(@@ -45,14 +28,9 @@ export function growWindowBounds(const toDip = (value?: number) => dip(value, Math.round)- // The floor uses Math.ceil where the deltas round to nearest. At 118% zoom a 768px floor is 906.24 DIP:- // rounding to nearest would give 906 DIP, a 767.8px viewport, and the media query the floor exists to- // satisfy would stay false.const requestedMin = dip(request?.minWidth, Math.ceil)const grown = bounds.width + toDip(request?.left) + toDip(request?.right)- // The floor applies before the work area clamp, so a floor wider than the display is dropped rather than- // growing the window off-screen to satisfy the breakpoint.const width = Math.min(Math.max(grown, requestedMin ? requestedMin + frameWidth : 0),Math.round(workArea.width * MAX_WORK_AREA)diff --git a/apps/desktop/index.html b/apps/desktop/index.htmlindex f6949decfa8..f78219623d4 100644--- a/apps/desktop/index.html+++ b/apps/desktop/index.html@@ -20,14 +20,12 @@// `transparent: true` already have a clear canvas, and pre-painting a// theme colour there does not prevent a flash, it IS the flash: an// opaque rectangle standing until that window's module graph executes.- // On the full-screen intro cinematic, over the real desktop, on a dev- // server that serves the graph unbundled, that read as seconds of white.// The list is TRANSPARENT_WINDOWS in src/main.tsx — keep the two in step.// `secondary` (a session window) and `browser` are opaque and DO want the// pre-paint.try {const win = new URLSearchParams(window.location.search).get('win')- if (!win || ['hud', 'overlay', 'quick', 'wake', 'intro'].indexOf(win) === -1) {+ if (!win || ['hud', 'overlay', 'quick', 'wake'].indexOf(win) === -1) {let bg = localStorage.getItem('hermes-boot-background')let scheme = localStorage.getItem('hermes-boot-color-scheme')if (!bg) {diff --git a/apps/desktop/public/intro-nous-girl.png b/apps/desktop/public/intro-nous-girl.pngdeleted file mode 100644index c9eb9dd6225..00000000000Binary files a/apps/desktop/public/intro-nous-girl.png and /dev/null differdiff --git a/apps/desktop/public/nous-badge.png b/apps/desktop/public/nous-badge.pngdeleted file mode 100644index 99957de25b9..00000000000Binary files a/apps/desktop/public/nous-badge.png and /dev/null differdiff --git a/apps/desktop/scripts/connector-rehearsal.mjs b/apps/desktop/scripts/connector-rehearsal.mjsindex 7fb860128be..209cd0ac4bc 100644--- a/apps/desktop/scripts/connector-rehearsal.mjs+++ b/apps/desktop/scripts/connector-rehearsal.mjs@@ -2,7 +2,7 @@// Real desktop + real backend. Isolated identity; no copied credentials.// Adds a fixed Vite port and CDP (9344) so the run can be driven and read// from outside. When you only want to click through it yourself:-// D=$(mktemp -d) && env -u HERMES_SHARED_AUTH_DIR HERMES_GUEST_ONBOARDING=1 HERMES_SKIP_INTRO=1 \+// D=$(mktemp -d) && env -u HERMES_SHARED_AUTH_DIR HERMES_GUEST_ONBOARDING=1 \// HERMES_HOME="$D/home" HERMES_DESKTOP_USER_DATA_DIR="$D/userdata" hermes desktopimport { spawn } from 'node:child_process'import fs from 'node:fs'@@ -31,7 +31,7 @@ Object.assign(env, {HERMES_DESKTOP_USER_DATA_DIR: path.join(sandbox, 'electron'), HERMES_DESKTOP_CWD: path.join(sandbox, 'work'),HERMES_DESKTOP_HERMES_ROOT: root, HERMES_DESKTOP_PYTHON: python,HERMES_DESKTOP_IGNORE_EXISTING: '1', HERMES_DESKTOP_APP_NAME: 'Hermes Connector Rehearsal',- HERMES_GUEST_ONBOARDING: '1', HERMES_SKIP_INTRO: '1', HERMES_DESKTOP_DEV_SERVER: url, HERMES_DESKTOP_CDP_PORT: '9344'+ HERMES_GUEST_ONBOARDING: '1', HERMES_DESKTOP_DEV_SERVER: url, HERMES_DESKTOP_CDP_PORT: '9344'})const entry = path.join(desktop, 'dist/connector-rehearsal.mjs')fs.writeFileSync(entry, `import { app } from 'electron'\napp.setAsDefaultProtocolClient = () => false\napp.setAppPath(${JSON.stringify(desktop)})\nawait import('./electron-main.mjs')\n`)diff --git a/apps/desktop/src/app/contrib/handoff-leg.ts b/apps/desktop/src/app/contrib/handoff-leg.tsindex cb7ea93711e..56f73d410d5 100644--- a/apps/desktop/src/app/contrib/handoff-leg.ts+++ b/apps/desktop/src/app/contrib/handoff-leg.ts@@ -1,5 +1,3 @@-/** Starts the first build in its own session. A submit that fails or is unconfirmed keeps that session:- * it must not close the session or start a second build. */import { JsonRpcGatewayError } from '@hermes/shared'import type { ClientSessionState } from '@/app/types'@@ -19,8 +17,6 @@ export interface HandoffTask {export interface HandoffReceipt extends HandoffTask {runtimeId: stringstoredId: string- /** `connectionId: null` is the ambient route for the profile: a local-only install, or a legacy primary- * with no registry id. It does not mean the owner is unknown. */owner: { connectionId: null | string; profile: typeof BUILD_PROFILE }status: 'created' | 'submitting' | 'accepted'}@@ -47,8 +43,6 @@ export interface HandoffDeps {bind: (receipt: HandoffReceipt, running: boolean, snapshot?: HandoffSnapshot) => void}-/** Only these preflight refusal codes from methods_prompt allow a second submit. A generic server error,- * such as a lost ACK, can arrive after the prompt already started. */const PREFLIGHT_REJECTIONS = new Set([4001, 4004, 4009, 4018, 4090, 4091, 4120, 4121, 5070, 5071, 5072, 5122])interface HydratedHandoffSnapshot extends HandoffSnapshot {@@ -86,9 +80,6 @@ export async function startHandoff(deps: HandoffDeps, task: HandoffTask, recoverreceipt = { ...receipt, runtimeId: snapshot.session_id }- // A visible user turn in this session records that the brief was accepted, even after the build finished- // or its context was compressed. Status 'created' records a confirmed refusal, so a stale running flag- // must not mark it accepted.if ((receipt.status === 'submitting' && snapshot.running) ||snapshot.messages.some(message => message.role === 'user' && message.display_kind !== 'hidden')diff --git a/apps/desktop/src/app/contrib/handoff-receipt.test.ts b/apps/desktop/src/app/contrib/handoff-receipt.test.tsdeleted file mode 100644index ac01c18900c..00000000000--- a/apps/desktop/src/app/contrib/handoff-receipt.test.ts+++ /dev/null@@ -1,18 +0,0 @@-import { expect, it } from 'vitest'--import { readKey, writeKey } from '@/lib/storage'--import { handoffReceiptKey, quarantineHandoffReceipt, readHandoffReceipt } from './handoff-receipt'--it('preserves an unreadable receipt and removes it from the retry lookup', () => {- const key = handoffReceiptKey('receipt-recovery', 'guide')- const corrupt = '{unreadable receipt'- writeKey(key, corrupt)-- expect(() => readHandoffReceipt(key)).toThrow()-- quarantineHandoffReceipt(key)-- expect(readKey(`${key}.unreadable`)).toBe(corrupt)- expect(readHandoffReceipt(key)).toBeNull()-})diff --git a/apps/desktop/src/app/contrib/handoff-receipt.ts b/apps/desktop/src/app/contrib/handoff-receipt.tsindex ae81992428c..f9aa3278588 100644--- a/apps/desktop/src/app/contrib/handoff-receipt.ts+++ b/apps/desktop/src/app/contrib/handoff-receipt.ts@@ -2,8 +2,6 @@ import { readKey, writeJson, writeKey } from '@/lib/storage'import type { HandoffReceipt } from './handoff-leg'-// Holds the receipt in memory when the disk write fails, so this window still has the session identity.-// saveHandoffReceipt throws when the write does not read back, so nothing is submitted without a saved receipt.const unsavedReceipts = new Map<string, HandoffReceipt>()export function handoffReceiptKey(connection: null | string, guideStoredId: string): string {@@ -33,8 +31,6 @@ export function readHandoffReceipt(key: string): HandoffReceipt | null {)}- // JSON cannot encode a constructor, so only a primitive string has String as its constructor here.- // Comparing constructors rejects a corrupt id instead of coercing it to text.const hasTextFields = [value?.storedId, value?.runtimeId, value?.task, value?.brief].every(field => field?.constructor === String)diff --git a/apps/desktop/src/app/contrib/onboarding-handoff.ts b/apps/desktop/src/app/contrib/onboarding-handoff.tsindex 363c7fbf77e..f8a39993fe4 100644--- a/apps/desktop/src/app/contrib/onboarding-handoff.ts+++ b/apps/desktop/src/app/contrib/onboarding-handoff.ts@@ -1,5 +1,3 @@-/** Durable first-build handoff and progress check-ins. */-import { useStore } from '@nanostores/react'import { useEffect } from 'react'@@ -50,8 +48,6 @@ export interface OnboardingHandoffOptions extends Pick<> {createBackendSessionForSend: ReturnType<typeof useSessionActions>['createBackendSessionForSend']requestGateway: AmbientGatewayRequest- /** Pins session creation to the target profile while the guide chat is still selected.- * The caller's own requestGateway reads the pin. */runCreatePinnedTo: <T>(profile: string, create: () => Promise<T>) => Promise<T>}@@ -63,17 +59,11 @@ export function useOnboardingHandoff({requestGateway,runCreatePinnedTo}: OnboardingHandoffOptions) {- // The saved receipt survives a failed handoff and a relaunch. Onboarding completes only after the build- // session confirms its start.const setupHandoff = useStore($setupHandoff)const selectedStoredId = useStore($selectedStoredSessionId)- // The guide's install card settles before its handoff card; its per-plugin result rides the answers into the- // build session's runbook.useEffect(() => watchPluginOutcomes(() => $setupSession.get()?.runtimeId), [])- // Resume an existing receipt when the welcome chat is reopened after a relaunch. Recovery reads the saved- // receipt only; it never creates a new build session.useEffect(() => {if (!isOnboardingEnabled() ||@@ -122,7 +112,6 @@ export function useOnboardingHandoff({}}, [selectedStoredId])- // Rebind the runtime pointer after session.resume; this is not an atom-to-ref mirror.// eslint-disable-next-line no-restricted-syntaxuseEffect(() => {if (!isOnboardingEnabled() || setupHandoff?.phase !== 'pending' || $setupHandoff.get() !== setupHandoff) {@@ -149,12 +138,9 @@ export function useOnboardingHandoff({}$setupSession.set(setupSession)- // Resume only has the guide's stored id, so its source must also key the saved receipt.const { key: receiptKey, receipt: saved } = readGuideHandoffReceipt(setupSession.storedId)receipt = savedconst owner: HandoffReceipt['owner'] = receipt?.owner ?? { connectionId, profile: BUILD_PROFILE }- // personalize runs before session.create because the new agent's memory is fixed at creation time.- // A retry reuses the saved receipt; it never creates a second session or copies the guide's memory.receipt = await startHandoff({read: () => receipt,@@ -180,7 +166,6 @@ export function useOnboardingHandoff({create: async () => {await ensureGatewayAgent(owner.connectionId, owner.profile)$newChatProfile.set(BUILD_PROFILE)- // A null connection uses the profile's ambient route.$newChatRoute.set(owner.connectionId ? { connectionId: owner.connectionId, profile: owner.profile } : null)@@ -199,7 +184,6 @@ export function useOnboardingHandoff({throw new Error('Could not open the first-build session.')}- // Ignore selection if the user navigated away during creation.const storedId =ensureSessionState(runtimeId).storedSessionId ??($activeSessionId.get() === runtimeId ? $selectedStoredSessionId.get() : null)@@ -220,7 +204,6 @@ export function useOnboardingHandoff({setSessionOwnerHint(value.storedId, ownerRoute)patchSessionTile(value.storedId, { runtimeId: value.runtimeId, ownerRoute })} else {- // Clear both records: an omitted route survives the tile merge.forgetSessionOwnerHintsForSession(value.storedId)patchSessionTile(value.storedId, { runtimeId: value.runtimeId, ownerRoute: undefined })}@@ -240,7 +223,6 @@ export function useOnboardingHandoff({value.storedId)- // Recovery in the background must not change which session is active.if ($selectedStoredSessionId.get() === value.storedId) {activeSessionIdRef.current = value.runtimeIdsetActiveSessionId(value.runtimeId)@@ -252,8 +234,6 @@ export function useOnboardingHandoff({setupHandoff)- // Older backends return the title from session.create as pending metadata, so the title is set here,- // after acceptance. A failed session.title call then cannot stop the prompt from being submitted.const chatTitle = firstTaskTitle(receipt.task)await request(receipt.owner, 'session.title', { session_id: receipt.runtimeId, title: chatTitle }).catch(error => console.warn('[handoff] title could not be saved', error)@@ -276,7 +256,6 @@ export function useOnboardingHandoff({activateTreePane(sessionsGroup.id, 'sessions')}- // The note tells the guide chat that the build started. It does not start a second build.void requestGatewayForAgent(connectionId,setupSession.profile ?? BUILD_PROFILE,@@ -345,8 +324,6 @@ export function useOnboardingHandoff({return}- // The session dispatcher resolves the stored owner hint and runtime map- // published by the handoff, including its exact registry connection.void requestGateway('prompt.submit',{ display_kind: 'hidden', session_id: checkIn.sessionId, text: checkIn.note },diff --git a/apps/desktop/src/app/contrib/onboarding-kickoff.test.ts b/apps/desktop/src/app/contrib/onboarding-kickoff.test.tsdeleted file mode 100644index 0432e770a8d..00000000000--- a/apps/desktop/src/app/contrib/onboarding-kickoff.test.ts+++ /dev/null@@ -1,107 +0,0 @@-import { afterEach, expect, it, vi } from 'vitest'--import type { ClientSessionState } from '@/app/types'-import { $setupSession } from '@/components/onboarding-chat/setup-profile'-import { assistantTextPart } from '@/lib/chat-messages'-import { $activeGatewayProfile } from '@/store/profile'-import { $activeSessionId, $messages, $selectedStoredSessionId } from '@/store/session'-import { $sessionStates } from '@/store/session-states'--import { adoptGuideSession } from './onboarding-kickoff'--const messages = [{ id: 'greeting', role: 'assistant' as const, parts: [assistantTextPart('Welcome back')] }]-const setupProfile = 'setup-provisioned'--function publishGuide(storedSessionId: string, visible = true) {- const state: ClientSessionState = {- storedSessionId,- messages,- branch: '',- cwd: '',- model: '',- provider: '',- reasoningEffort: '',- serviceTier: '',- fast: false,- yolo: false,- personality: '',- busy: false,- awaitingResponse: false,- streamId: null,- sawAssistantPayload: false,- adoptedRunningTurn: false,- pendingBranchGroup: null,- interrupted: false,- interimBoundaryPending: false,- needsInput: false,- runtimeStartedAt: Date.now(),- turnStartedAt: null,- turnLive: false,- usage: null- }-- $sessionStates.set({ 'runtime-guide': state })- $activeSessionId.set('runtime-guide')- $selectedStoredSessionId.set(storedSessionId)- $activeGatewayProfile.set(setupProfile)- $messages.set(visible ? messages : [])-}--afterEach(() => {- $sessionStates.set({})- $activeSessionId.set(null)- $selectedStoredSessionId.set(null)- $activeGatewayProfile.set('default')- $messages.set([])- $setupSession.set(null)-})--it('adopts the resumed runtime only after the correct saved transcript is visible', async () => {- const request = vi.fn(async () => {- throw new Error('Unexpected configuration request')- })-- await adoptGuideSession(- setupProfile,- { id: 'guide', resolved_id: 'guide-tip' },- false,- async () => {- publishGuide('guide-tip')- },- request- )- expect($setupSession.get()).toMatchObject({ storedId: 'guide', runtimeId: 'runtime-guide', profile: setupProfile })- expect(request).not.toHaveBeenCalled()- expect($messages.get()).toEqual(messages)-})--it.each(['empty', 'wrong-session', 'wrong-profile', 'no-runtime'])(- 'rejects a settled resume with %s instead of releasing startup',- async failure => {- const request = vi.fn(async () => {- throw new Error('Unexpected configuration request')- })-- await expect(- adoptGuideSession(- setupProfile,- { id: 'guide' },- false,- async () => {- publishGuide(failure === 'wrong-session' ? 'other' : 'guide', failure !== 'empty')-- if (failure === 'wrong-profile') {- $activeGatewayProfile.set('default')- }-- if (failure === 'no-runtime') {- $activeSessionId.set(null)- }- },- request- )- ).rejects.toThrow('could not be loaded')- expect($setupSession.get()).toBeNull()- expect(request).not.toHaveBeenCalled()- }-)diff --git a/apps/desktop/src/app/contrib/onboarding-kickoff.ts b/apps/desktop/src/app/contrib/onboarding-kickoff.tsindex 34a1a6402f8..061ff016d40 100644--- a/apps/desktop/src/app/contrib/onboarding-kickoff.ts+++ b/apps/desktop/src/app/contrib/onboarding-kickoff.ts@@ -32,7 +32,6 @@ import { $sessionStates } from '@/store/session-states'import type { AmbientGatewayRequest } from './session-rpc-dispatcher'-/** The connectors card is two turns after the guide opens; its two reads are slow cold, so they start now. */function prefetchGuideCatalogs(storedId: null | string, runtimeId: string): void {if (storedId) {prefetchConnectorCatalog(storedId, runtimeId)@@ -45,7 +44,6 @@ export interface OnboardingKickoffOptions extends Pick<'createBackendSessionForSend' | 'resumeSession'> {requestGateway: AmbientGatewayRequest- /** The caller's own requestGateway reads the pin. */runCreatePinnedTo: <T>(profile: string, create: () => Promise<T>) => Promise<T>}@@ -71,8 +69,6 @@ export async function adoptGuideSession(const adoptedRuntimeId = $activeSessionId.get()const state = adoptedRuntimeId ? $sessionStates.get()[adoptedRuntimeId] : undefined- // resumeSession can settle without adopting (failed or superseded resume).- // Only release the splash for the guide's actual binding and visible transcript.if (!adoptedRuntimeId ||!state?.storedSessionId ||@@ -102,8 +98,6 @@ export async function adoptGuideSession(}}-/** Seeds the runbook and a pre-written greeting on the setup profile before the phase advances.- * The seeded assistant row shows the chat's first message without a model turn. */export function useOnboardingKickoff({createBackendSessionForSend,requestGateway,@@ -129,8 +123,6 @@ export function useOnboardingKickoff({{})- // Probe the guide's own socket before switching profiles so a refusal- // leaves classic onboarding on the user's current backend.const record = await requestGatewayForProfile<SetupStatus>(setupProfile, 'setup.status', {})if (record.ready !== true || record.provider_configured !== true) {@@ -142,16 +134,12 @@ export function useOnboardingKickoff({$newChatProfile.set(setupProfile)await ensureGatewayProfile(setupProfile)- // Idempotent: the gate already took the shape on the tick the guide was- // owed, so no full-size shell painted during the profile round trips.takeGuideShape()await loadMachineProfile()const guideRequest: AmbientGatewayRequest = (method, params, timeout) =>requestGatewayForProfile(setupProfile, method, params, timeout)- // Look the guide up by its exact title: a relaunch adopts the existing guide session before creating- // one, so the backend's UNIQUE(title) constraint cannot leave an untitled duplicate behind.const registryHit = await guideRequest<{ sessions?: GuideSession[] }>('session.list', {include_hidden: true,title: SETUP_CHAT_TITLE@@ -162,7 +150,6 @@ export function useOnboardingKickoff({if (canonical?.id) {await adoptGuideSession(setupProfile, canonical, record.free_tier, resumeSession, guideRequest)- // runGuideKickoff records the guided phase only after adoption.return true}@@ -201,7 +188,6 @@ export function useOnboardingKickoff({storedId})- // Set the title explicitly so the backend does not name the session after the hidden runbook message.await guideRequest('session.title', { session_id: runtimeId, title: SETUP_CHAT_TITLE }).catch(() => undefined)await adoptGuideSession(diff --git a/apps/desktop/src/app/contrib/wiring.tsx b/apps/desktop/src/app/contrib/wiring.tsxindex 2385e89e3bd..2ff8b9eab51 100644--- a/apps/desktop/src/app/contrib/wiring.tsx+++ b/apps/desktop/src/app/contrib/wiring.tsx@@ -21,7 +21,6 @@ import { ExternalOpenFailedDialog } from '@/components/external-open-failed-dialimport { FindBar } from '@/components/find-bar'import { FreeTierSignInDialog } from '@/components/free-tier/sign-in-dialog'import { GatewayConnectingOverlay } from '@/components/gateway-connecting-overlay'-import { IntroRevealGate } from '@/components/intro-reveal'import { NotificationStack } from '@/components/notifications'import { DesktopOnboardingOverlay } from '@/components/onboarding'import { OnboardingChatGate } from '@/components/onboarding-chat/gate'@@ -1334,7 +1333,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {{/* The full real overlay set (mirrors DesktopController's `overlays`). */}<RemoteDisplayBanner />{!isAuxiliaryWindow() && <DesktopInstallOverlay />}- {!isAuxiliaryWindow() && <IntroRevealGate enabled={gatewayState === 'open'} />}{!isAuxiliaryWindow() && (<OnboardingChatGateenabled={gatewayState === 'open'}diff --git a/apps/desktop/src/components/assistant-ui/ask-directive.tsx b/apps/desktop/src/components/assistant-ui/ask-directive.tsxindex 5b4360e4990..2f740f7389e 100644--- a/apps/desktop/src/components/assistant-ui/ask-directive.tsx+++ b/apps/desktop/src/components/assistant-ui/ask-directive.tsx@@ -1,24 +1,3 @@-/**- * `::ask{...}` — the model's interactive question, inline in its message.- *- * The conversational counterpart of a wall of text: whenever the agent needs- * a decision, it emits ONE line and the transcript renders real controls —- * option pills; a single click submits the pick as a visible user turn.- * Works in every session (it is a core transcript directive, not an- * onboarding-only one), so dashboard button responses, refinement dialogues,- * and ordinary chats can all fork interactively.- *- * ::ask{question="Which angle leads?" options="Lead story|Exclusive|Embargoed brief"}- * ::ask{question="Paste the runway number" input="true"}- *- * Options are pipe-separated. `input="true"` means a typed answer is welcome —- * that keeps the QUESTION rendering even with no options, but it draws no- * input row of its own: the composer is always right below the transcript,- * and a second "type here" bar beside it read as clutter (first live-run- * feedback). A pick submits VISIBLY so the user sees their choice become a- * turn.- */-import { useAuiState } from '@assistant-ui/react'import { useStore } from '@nanostores/react'import { useState } from 'react'@@ -28,9 +7,6 @@ import { useSessionView } from '@/app/chat/session-view'import { answeredAfter } from '@/lib/chat-messages/parts'import { cn } from '@/lib/utils'-// Picked questions, module-scoped: transcript virtualization remounts-// directives with fresh local state, which would resurrect a settled picker.-// A repeated question in a later message or another session is a new choice.const settled = new Set<string>()export function AskDirective({ attrs, streaming }: { attrs: Record<string, string>; streaming: boolean }) {@@ -51,10 +27,6 @@ export function AskDirective({ attrs, streaming }: { attrs: Record<string, strinconst wantsInput = attrs.input === 'true' || attrs.input === 'yes'const [picked, setPicked] = useState<null | string>(() => (settled.has(identity) ? '' : null))- // A typed reply answers the question too. The card only knew about its own- // buttons, so someone who answered in the composer came back to six live- // chips under a question they had already dealt with. Any user message- // after this one closes the ask.const answeredInComposer = answeredAfter(useStore(view.$messages), messageId)const closed = picked !== null || answeredInComposerdiff --git a/apps/desktop/src/components/gateway-connecting-overlay.tsx b/apps/desktop/src/components/gateway-connecting-overlay.tsxindex b147d45e2be..f6c4093c9ae 100644--- a/apps/desktop/src/components/gateway-connecting-overlay.tsx+++ b/apps/desktop/src/components/gateway-connecting-overlay.tsx@@ -133,8 +133,8 @@ export function GatewayConnectingOverlay() {return null}- // The guided first launch has its own opening (the film, then the typed- // greeting in a small window). "Connecting…" over it, then "Connected to+ // The guided first launch has its own opening (the typed greeting in a+ // small window). "Connecting…" over it, then "Connected to// localhost", is the app's boot narrating itself in the middle of the// guide's; the guide's surface stays, this one yields. Boot progress still// gates the transcript underneath — nothing paints early.diff --git a/apps/desktop/src/components/intro-reveal/README.md b/apps/desktop/src/components/intro-reveal/README.mddeleted file mode 100644index f373bda6446..00000000000--- a/apps/desktop/src/components/intro-reveal/README.md+++ /dev/null@@ -1,38 +0,0 @@-# Intro reveal--A scripted chat types a request, runs tool rows beside a cube viewport, streams a-reply, expands into parallel agents, then ends on the brand. The seven beats take-22 seconds of wall time, followed by a 900 ms dissolve. Reduced motion shows the-brand briefly instead. Sound is on by default and respects the haptics mute-preference. Fonts are the existing Collapse and JetBrains Mono faces.--Eligibility is `guestOnboardingEnabled && !firstRunSkipped && !hasSeenIntroReveal()`.-Electron sets the flag from `HERMES_GUEST_ONBOARDING=1` or `--guest-onboarding`.-The gate queues the guided chat on completion; the chat gate acknowledges the-free-tier notice as the cinematic starts. With the flag off, neither gate starts.-`HERMES_SKIP_INTRO=1` turns the film off but keeps the guided chat: the gate-records the film as watched and queues the guide directly.--| Piece | Path |-| --- | --- |-| Main-window gate and phase timers | `index.tsx` |-| Phase, seen key and IPC listeners | `../../store/intro-reveal.ts` |-| Overlay boot and surface | `intro-root.tsx`, `intro-reveal-surface.tsx` |-| Clock, score, cube and synthesized sound | `use-intro-clock.ts`, `timeline.ts`, `viewport-cube.ts`, `sound.ts` |-| Constellation, brand and text effects | `scenes/` |-| Native window and preload bridge | `../../../electron/intro-reveal-window.ts`, `../../../electron/preload.ts` |--The transparent native window (`?win=intro`) covers the primary display while the-main app is hidden. The clock runs in the overlay because the hidden main-renderer's animation frames are throttled. The phase and the seen key live in the-main renderer.--The screen must always come back. Four independent layers:--1. Normal completion: the overlay clock finishes → main renderer closes it.-2. Esc/click: local close with a 1.2s fallback that bypasses the main renderer.-3. Local deadman: the overlay force-closes itself `INTRO_DEADMAN_MS` after- mount, even with all IPC dead.-4. Main-process watchdog (34s) destroys the window unconditionally.--Rehearsal with isolated state: see [Desktop Engineering Guide](../../../AGENTS.md#rehearsing-the-guided-onboarding).diff --git a/apps/desktop/src/components/intro-reveal/index.tsx b/apps/desktop/src/components/intro-reveal/index.tsxdeleted file mode 100644index 98df6ed1ac0..00000000000--- a/apps/desktop/src/components/intro-reveal/index.tsx+++ /dev/null@@ -1,91 +0,0 @@-import { useStore } from '@nanostores/react'-import { useEffect, useLayoutEffect } from 'react'--import { takeGuideShape } from '@/components/onboarding-chat/assembly'-import {- $introReveal,- finishIntroReveal,- installIntroRevealBridgeListeners,- isIntroRevealEnabled,- isIntroRevealSkipped,- leaveIntroReveal,- shouldPlayFirstRunIntro,- startIntroReveal-} from '@/store/intro-reveal'-import { $desktopOnboarding } from '@/store/onboarding'-import {- $onboardingGate,- beginOnboardingFlow,- beginOnboardingFlowWithoutIntro,- queueGuideAfterIntro-} from '@/store/onboarding-gate'--import { INTRO_DEADMAN_MS, INTRO_EXIT_MS } from './timeline'--interface IntroRevealGateProps {- enabled: boolean-}--export function IntroRevealGate({ enabled }: IntroRevealGateProps) {- const onboarding = useStore($desktopOnboarding)- const intro = useStore($introReveal)- const reduceMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches-- useEffect(() => {- if (enabled && isIntroRevealEnabled()) {- return installIntroRevealBridgeListeners()- }- }, [enabled])-- useEffect(() => {- if (!enabled || !isIntroRevealEnabled()) {- return- }-- // Observe the store edge directly: a failed native open can finish before- // React renders the playing phase. Take the guide's shape on the same- // tick: finishIntroReveal shows the main window right after this fires.- return $introReveal.listen((state, previous) => {- if (state.phase === 'hidden' && previous?.phase !== 'hidden') {- queueGuideAfterIntro()- takeGuideShape()- }- })- }, [enabled])-- // The skipped-film path needs no backend. Cover the composer before first paint.- useLayoutEffect(() => {- if (isIntroRevealSkipped() && intro.phase === 'hidden') {- beginOnboardingFlowWithoutIntro(onboarding.firstRunSkipped)-- if ($onboardingGate.get().guideQueued) {- takeGuideShape()- }- }- }, [intro.phase, onboarding.firstRunSkipped])-- useEffect(() => {- if (enabled && intro.phase === 'hidden' && shouldPlayFirstRunIntro(onboarding.firstRunSkipped)) {- beginOnboardingFlow()- startIntroReveal()- }- }, [enabled, intro.phase, onboarding.firstRunSkipped])-- // The native surface runs the frame loop: the hidden main renderer's animation frames are throttled.- useEffect(() => {- if (intro.phase === 'hidden') {- return- }-- const total = reduceMotion ? 2600 : INTRO_DEADMAN_MS-- const id = window.setTimeout(- intro.phase === 'leaving' ? finishIntroReveal : leaveIntroReveal,- intro.phase === 'leaving' ? INTRO_EXIT_MS : total- )-- return () => window.clearTimeout(id)- }, [intro.phase, reduceMotion])-- return null-}diff --git a/apps/desktop/src/components/intro-reveal/intro-reveal-surface.tsx b/apps/desktop/src/components/intro-reveal/intro-reveal-surface.tsxdeleted file mode 100644index f5773d508d2..00000000000--- a/apps/desktop/src/components/intro-reveal/intro-reveal-surface.tsx+++ /dev/null@@ -1,372 +0,0 @@-import './intro-reveal.css'--import type { Ref } from 'react'--import { cn } from '@/lib/utils'--import { BrandClose } from './scenes/brand'-import { SideAgents } from './scenes/side-agents'-import { BLUE, BLUE_DIM, EASE, NOUS_SHADOW } from './scenes/style'-import { decoded, SPINNER } from './scenes/text'-import { INTRO_BEATS, INTRO_PROMPT, INTRO_REPLY_WORDS, INTRO_TOOL_ROWS } from './timeline'-import { useIntroClock } from './use-intro-clock'-import { viewportSlot } from './viewport-cube'--const INTRO_BEAT_INDEX: Record<string, number> = Object.fromEntries(INTRO_BEATS.map((b, i) => [b.id, i]))-const SKIP = 'Skip'-const SURFACES = 'Desktop · Messages · Phone · Anywhere'--export function IntroRevealSurface() {- const { frame, leaving, faded, skip, glowRef, stageRef, brandRef, viewportRef } = useIntroClock()- const everywhere = frame.beat >= INTRO_BEAT_INDEX.everywhere- const brand = frame.beat >= INTRO_BEAT_INDEX.brand-- return (- <div- aria-label={SKIP}- aria-modal="true"- className={cn(- 'fixed inset-0 flex items-center justify-center overflow-hidden',- 'transition-opacity ease-out',- leaving ? 'pointer-events-none opacity-0 duration-[900ms]' : faded ? 'opacity-100 duration-700' : 'opacity-0'- )}- onClick={skip}- onKeyDown={e => {- if (e.key === 'Enter') {- skip()- }- }}- role="dialog"- tabIndex={-1}- >- {/* The film stays dark regardless of the desktop beneath it. */}- <div- className="absolute inset-0 bg-black/82"- style={{ opacity: faded && !leaving ? 1 : 0, transition: `opacity 900ms ${EASE}` }}- />-- {/* One frame clock keeps the spotlight and brand group together. */}- <div- className="pointer-events-none absolute left-1/2 top-0 h-[130vmin] w-[150vmin] opacity-0"- ref={glowRef}- style={{- background:- 'radial-gradient(ellipse 46% 44% at 50% 22%, rgba(255,255,255,0.16), rgba(255,255,255,0.045) 48%, transparent 72%)',- transform: 'translate(-50%, -30%) scale(0.9)'- }}- />-- {/* One transform keeps the constellation drifting as a group. */}- <div- className="relative flex items-center justify-center gap-[2vw]"- ref={stageRef}- style={{ perspective: '1400px', transformStyle: 'preserve-3d', willChange: 'transform, opacity' }}- >- <SideAgents active={everywhere && !brand} side="left" tick={frame.tick} />-- <HeroChat frame={frame} viewportRef={viewportRef} />-- <SideAgents active={everywhere && !brand} side="right" tick={frame.tick} />- </div>-- <div- className="pointer-events-none absolute inset-x-0 bottom-[13vh] text-center text-[1.02rem] tracking-[0.34em] text-white/60 uppercase"- style={{- fontFamily: "'Collapse', sans-serif",- opacity: everywhere && !brand ? 1 : 0,- transform: everywhere && !brand ? 'translateY(0)' : 'translateY(12px)',- transition: `opacity 620ms ${EASE} 180ms, transform 620ms ${EASE} 180ms`- }}- >- {SURFACES}- </div>-- <BrandClose ref={brandRef} />-- <button- className="absolute bottom-6 right-7 text-[0.72rem] uppercase tracking-[0.24em] text-white/40 transition-colors hover:text-white/80"- onClick={skip}- style={{ fontFamily: "'Collapse', sans-serif" }}- type="button"- >- {SKIP}- </button>- </div>- )-}--interface HeroChatProps {- frame: ReturnType<typeof useIntroClock>['frame']- viewportRef: Ref<HTMLCanvasElement>-}--function HeroChat({ frame, viewportRef }: HeroChatProps) {- const beat = frame.beat- const sent = beat >= INTRO_BEAT_INDEX.send- const replying = beat >= INTRO_BEAT_INDEX.reply- const everywhere = beat >= INTRO_BEAT_INDEX.everywhere- const typedText = INTRO_PROMPT.slice(0, frame.typed)- const replyText = INTRO_REPLY_WORDS.slice(0, frame.replyWords).join(' ')-- return (- <div- className="relative w-[46vw] min-w-[560px] max-w-[1350px] rounded-xl p-7"- style={{- background: 'rgba(10, 11, 14, 0.88)',- border: '1px solid rgba(255,255,255,0.09)',- boxShadow: NOUS_SHADOW,- animation: 'intro-hover-a 8.4s ease-in-out infinite alternate',- transform: everywhere ? 'rotateX(4deg) translateZ(-60px) scale(0.86)' : 'rotateX(1.6deg) scale(1)',- transition: `transform 1100ms ${EASE}`,- transformOrigin: 'center 60%',- willChange: 'transform'- }}- >- <ViewportNode frame={frame} viewportRef={viewportRef} />-- <div className="flex min-h-[3.9rem] justify-end">- <div- className="max-w-[80%] px-1 py-3.5 text-right text-[1.02rem] leading-7 text-white/92"- style={{- opacity: sent ? 1 : 0,- transform: sent ? 'translateY(0) scale(1)' : 'translateY(10px) scale(0.97)',- transition: `opacity 480ms ${EASE}, transform 480ms ${EASE}`,- willChange: 'transform, opacity'- }}- >- {INTRO_PROMPT}- </div>- </div>-- <div className="mt-5 grid min-h-[10.5rem] content-start gap-2.5">- {INTRO_TOOL_ROWS.map((row, i) => {- const shown = Boolean(frame.toolShown & (1 << i)) && sent- const done = Boolean(frame.toolDone & (1 << i))-- return (- <div- className="flex items-center gap-3 rounded-lg px-4 py-3"- key={row.label}- style={{- background: 'rgba(255,255,255,0.045)',- border: '1px solid rgba(255,255,255,0.06)',- opacity: shown ? 1 : 0,- transform: shown ? 'translateY(0)' : 'translateY(6px)',- transition: `opacity 520ms ${EASE}, transform 520ms ${EASE}`,- willChange: 'transform, opacity'- }}- >- <span- className={cn('w-4 text-center font-mono text-[0.95rem]', !done && 'text-white/55')}- style={{ color: done ? BLUE : undefined, fontFamily: "'JetBrains Mono', monospace" }}- >- {done ? '✓' : SPINNER[frame.tick % SPINNER.length]}- </span>- <span- className="text-[0.66rem] font-bold uppercase tracking-[0.18em] text-white/55"- style={{ fontFamily: "'Collapse', sans-serif" }}- >- {row.label}- </span>- <span- className="ml-auto grid text-[0.8rem] text-white/50"- style={{ fontFamily: "'JetBrains Mono', monospace" }}- >- {/* Stacking keeps the running/done crossfade in place. */}- <span- className="col-start-1 row-start-1 text-right"- style={{ opacity: done ? 0 : 1, transition: `opacity 400ms ${EASE}` }}- >- {shown && !done ? decoded(row.runningText, row.at, frame.tick) : row.runningText}- </span>- <span- className="col-start-1 row-start-1 text-right"- style={{ color: BLUE_DIM, opacity: done ? 1 : 0, transition: `opacity 400ms ${EASE}` }}- >- {done ? decoded(row.doneText, row.doneAt, frame.tick, 380) : row.doneText}- </span>- </span>- </div>- )- })}- </div>-- <div className="mt-5 min-h-[6.5rem]">- <div- className="max-w-[88%] rounded-xl rounded-bl-md px-5 py-3.5 text-[1.02rem] leading-7 text-white/88"- style={{- background: 'rgba(255,255,255,0.055)',- border: '1px solid rgba(255,255,255,0.07)',- opacity: replying ? 1 : 0,- transform: replying ? 'translateY(0)' : 'translateY(6px)',- transition: `opacity 500ms ${EASE}, transform 500ms ${EASE}`,- willChange: 'transform, opacity'- }}- >- {replyText || '\u00a0'}- {replying && frame.replyWords < INTRO_REPLY_WORDS.length ? (- <span- className="dither ml-1 inline-block h-[1.05em] w-[0.5em] translate-y-[3px]"- style={{ animation: 'intro-caret 0.9s step-end infinite', color: BLUE }}- />- ) : null}- </div>- </div>-- <div className="mt-5">- <div- className="rounded-2xl px-3 py-2.5"- style={{- background: 'color-mix(in srgb, #16171b 78%, transparent)',- backdropFilter: 'blur(12px) saturate(1.12)',- border: '1px solid rgba(255,255,255,0.12)'- }}- >- <div className="min-h-[2rem] px-1.5 pt-0.5 text-[1.02rem] leading-7 text-white/90">- {sent || typedText.length === 0 ? (- <span className="text-white/28">Ask anything. Build anything.</span>- ) : (- typedText- )}- {!sent ? (- <span- className="dither ml-0.5 inline-block h-[1.1em] w-[0.52em] translate-y-[3px]"- style={{ animation: 'intro-caret 1.05s step-end infinite', color: BLUE }}- />- ) : null}- </div>- <div className="mt-1.5 flex items-center gap-1.5">- <span className="grid size-6 place-items-center rounded-full text-white/45">- <svg- fill="none"- height="13"- stroke="currentColor"- strokeLinecap="round"- strokeWidth="1.6"- viewBox="0 0 16 16"- width="13"- >- <path d="M8 3.5v9M3.5 8h9" />- </svg>- </span>- <span className="ml-auto grid size-6 place-items-center rounded-full text-white/45">- <svg- fill="none"- height="13"- stroke="currentColor"- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="1.6"- viewBox="0 0 24 24"- width="13"- >- <rect height="12" rx="3" width="6" x="9" y="3" />- <path d="M5 11a7 7 0 0 0 14 0M12 18v3" />- </svg>- </span>- <span- className="grid size-[1.65rem] shrink-0 place-items-center rounded-full"- style={{- background: sent ? 'rgba(255,255,255,0.3)' : 'rgba(255,255,255,0.92)',- color: '#0a0b0e',- transform: !sent && frame.typed >= INTRO_PROMPT.length ? 'scale(1.08)' : 'scale(1)',- transition: `transform 300ms ${EASE}, background 400ms ${EASE}`- }}- >- <svg- fill="none"- height="13"- stroke="currentColor"- strokeLinecap="round"- strokeLinejoin="round"- strokeWidth="2.4"- viewBox="0 0 24 24"- width="13"- >- <path d="M12 19V5M5 12l7-7 7 7" />- </svg>- </span>- </div>- </div>- </div>- </div>- )-}--function ViewportNode({ frame, viewportRef }: HeroChatProps) {- const viewport = viewportSlot(frame.tick * 45)- const sent = frame.beat >= INTRO_BEAT_INDEX.send- const everywhere = frame.beat >= INTRO_BEAT_INDEX.everywhere-- return (- <>- <div- className="absolute -left-64 -top-20 w-52 rounded-xl"- style={{- background: 'rgba(10, 11, 14, 0.88)',- border: '1px solid rgba(255,255,255,0.09)',- boxShadow: NOUS_SHADOW,- animation: 'intro-hover-b 6.8s ease-in-out infinite alternate',- opacity: sent && !everywhere ? 1 : 0,- transform:- sent && !everywhere- ? 'translateZ(70px) rotateX(-2deg) rotateY(2.5deg) translateY(0) scale(1)'- : everywhere- ? 'translateZ(70px) rotateX(-2deg) rotateY(2.5deg) translateY(26px) scale(0.97)'- : 'translateZ(70px) rotateX(-2deg) rotateY(2.5deg) translateY(12px) scale(0.95)',- transition: `opacity 480ms ${EASE}, transform 560ms ${EASE}`,- willChange: 'transform, opacity'- }}- >- <div- className="flex items-center justify-between px-3 pt-2.5 text-[0.5rem] uppercase tracking-[0.2em] text-white/30"- style={{ fontFamily: "'Collapse', sans-serif" }}- >- <span className="flex items-center gap-1.5">- <span- className="inline-block size-1 rounded-full"- style={{ animation: 'intro-dot 1.6s ease-in-out infinite', background: BLUE }}- />- viewport- </span>- <span- className="text-[0.6rem] normal-case tracking-normal"- style={{ color: BLUE_DIM, fontFamily: "'JetBrains Mono', monospace" }}- >- {decoded(viewport.mode, viewport.at, frame.tick, 300)}- </span>- </div>- <canvas className="block h-40 w-full" ref={viewportRef} />-- <span className="absolute -right-[5px] top-1/2 size-2.5 -translate-y-1/2 rounded-full border border-black/55 bg-[#0a0b0e]" />- </div>-- <svg- aria-hidden- className="pointer-events-none absolute -left-12 top-0 h-16 w-12 overflow-visible"- style={{ opacity: everywhere ? 0 : sent ? 1 : 0, transition: `opacity 300ms ${EASE}` }}- viewBox="0 0 48 64"- >- <path- d="M 0 15 C 21 15, 27 44, 48 44"- fill="none"- pathLength={1}- stroke="rgba(0,0,0,0.55)"- strokeDasharray="1"- strokeDashoffset={sent ? 0 : 1}- strokeWidth="1.5"- style={{ transition: `stroke-dashoffset 440ms ${EASE}` }}- />- </svg>-- <span- className="absolute -left-[5px] top-[40px] size-2.5 rounded-full border bg-[#0a0b0e]"- style={{- borderColor: 'rgba(0,0,0,0.55)',- opacity: everywhere ? 0 : sent ? 1 : 0,- transition: `opacity 380ms ${EASE}, border-color 380ms ${EASE}`- }}- />- </>- )-}diff --git a/apps/desktop/src/components/intro-reveal/intro-reveal.css b/apps/desktop/src/components/intro-reveal/intro-reveal.cssdeleted file mode 100644index a344900a572..00000000000--- a/apps/desktop/src/components/intro-reveal/intro-reveal.css+++ /dev/null@@ -1,59 +0,0 @@-@keyframes intro-caret {- 0%,- 55% {- opacity: 1;- }- 56%,- 100% {- opacity: 0;- }-}-@keyframes intro-dot {- 0%,- 100% {- opacity: 0.35;- }- 50% {- opacity: 1;- }-}-@keyframes intro-float-a {- from {- transform: translateY(-5px);- }- to {- transform: translateY(6px);- }-}-@keyframes intro-float-b {- from {- transform: translateY(4px);- }- to {- transform: translateY(-7px);- }-}-@keyframes intro-float-c {- from {- transform: translateY(-3px);- }- to {- transform: translateY(5px);- }-}-@keyframes intro-hover-a {- from {- translate: 0 -4px;- }- to {- translate: 0 5px;- }-}-@keyframes intro-hover-b {- from {- translate: 0 4px;- }- to {- translate: 0 -6px;- }-}diff --git a/apps/desktop/src/components/intro-reveal/intro-root.tsx b/apps/desktop/src/components/intro-reveal/intro-root.tsxdeleted file mode 100644index a511eb9c171..00000000000--- a/apps/desktop/src/components/intro-reveal/intro-root.tsx+++ /dev/null@@ -1,39 +0,0 @@-import '@nous-research/ui/styles/fonts.css'--import { createRoot } from 'react-dom/client'--import { OverlayErrorBoundary } from '@/components/overlay-error-boundary'-import { isOnboardingEnabled } from '@/lib/onboarding-enabled'--import { IntroRevealSurface } from './intro-reveal-surface'--export function mountIntroReveal(): void {- if (!isOnboardingEnabled()) {- return- }-- document.title = 'Hermes'- // Every intro measure is in rem, so this one root size scales the whole- // composition. The app's default 16 px root is sized for a working window, which- // is too small on a display the user sits back from.- document.documentElement.style.fontSize = '150%'- const root = document.getElementById('root')-- if (!root) {- return- }-- // StrictMode would double-start this disposable window's clock and sound.- createRoot(root).render(- <OverlayErrorBoundary label="intro-reveal">- <IntroRevealSurface />- </OverlayErrorBoundary>- )-- // Native ready-to-show can precede the first React paint.- requestAnimationFrame(() =>- requestAnimationFrame(() => {- window.hermesDesktop?.introReveal?.ready()- })- )-}diff --git a/apps/desktop/src/components/intro-reveal/scenes/brand.tsx b/apps/desktop/src/components/intro-reveal/scenes/brand.tsxdeleted file mode 100644index a1ae9cf6a73..00000000000--- a/apps/desktop/src/components/intro-reveal/scenes/brand.tsx+++ /dev/null@@ -1,36 +0,0 @@-import type { ComponentProps } from 'react'--const assetPath = (path: string) => `${import.meta.env.BASE_URL}${path.replace(/^\/+/, '')}`--interface BrandCloseProps extends ComponentProps<'div'> {}--export function BrandClose({ ref }: BrandCloseProps) {- return (- <div- className="pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-[3.2vmin] opacity-0"- ref={ref}- style={{ willChange: 'transform, opacity' }}- >- <img alt="" className="h-[32vmin] w-auto object-contain" src={assetPath('nous-badge.png')} />- <div className="flex flex-col items-center gap-[1.6vmin]">- <h1- className="text-[10.2vmin] leading-none uppercase text-white/95"- style={{- fontFamily: "'Collapse', sans-serif",- fontWeight: 700,- letterSpacing: '0.06em',- textShadow: '0 2px 24px rgba(0,0,0,0.45)'- }}- >- Hermes Agent- </h1>- <p- className="text-[2vmin] uppercase tracking-[0.42em] text-white/50"- style={{ fontFamily: "'Collapse', sans-serif" }}- >- Your agent, everywhere- </p>- </div>- </div>- )-}diff --git a/apps/desktop/src/components/intro-reveal/scenes/side-agents.tsx b/apps/desktop/src/components/intro-reveal/scenes/side-agents.tsxdeleted file mode 100644index b8a4b576d5f..00000000000--- a/apps/desktop/src/components/intro-reveal/scenes/side-agents.tsx+++ /dev/null@@ -1,83 +0,0 @@-import { INTRO_BEATS } from '../timeline'--import { BLUE, BLUE_FAINT, EASE, NOUS_SHADOW } from './style'-import { decoded } from './text'--const EVERYWHERE_T = INTRO_BEATS.find(b => b.id === 'everywhere')!.t--interface SideAgentsProps {- active: boolean- side: 'left' | 'right'- tick: number-}--export function SideAgents({ active, side, tick }: SideAgentsProps) {- const sideCard = (title: string, line1: string, line2: string, offset: string, delayMs = 0, tilt = 0) => (- <div- className="w-full rounded-xl p-5"- style={{- background: 'rgba(12, 13, 16, 0.82)',- border: '1px solid rgba(255,255,255,0.09)',- boxShadow: NOUS_SHADOW,- opacity: active ? 1 : 0,- transform: active- ? `translateZ(-90px) rotateY(${tilt}deg) translateY(0) scale(1)`- : `translateZ(-90px) rotateY(${tilt}deg) translateY(${offset}) scale(0.94)`,- transition: `opacity 760ms ${EASE} ${delayMs}ms, transform 760ms ${EASE} ${delayMs}ms`,- willChange: 'transform, opacity'- }}- >- <div- className="mb-3 flex items-center gap-2 text-[0.72rem] uppercase tracking-[0.18em] text-white/50"- style={{ fontFamily: "'Collapse', sans-serif" }}- >- <span- className="inline-block size-1.5 rounded-full"- style={{ animation: 'intro-dot 1.6s ease-in-out infinite', background: BLUE }}- />- {title}- </div>- <div className="text-[0.95rem] leading-6 text-white/85">{line1}</div>- <div- className="mt-1 text-[0.85rem] leading-6"- style={{ color: BLUE_FAINT, fontFamily: "'JetBrains Mono', monospace" }}- >- {active ? decoded(line2, EVERYWHERE_T + delayMs + 500, tick, 700) : line2}- </div>- </div>- )-- return side === 'left' ? (- <div className="flex w-[19vw] min-w-[240px] flex-col gap-4 self-start pt-[6vh]">- <div style={{ animation: 'intro-float-a 5.2s ease-in-out infinite alternate' }}>- {sideCard(- 'research agent',- 'Apartment hunt: 3 new listings shortlisted',- '↳ compiling tour schedule…',- '26px',- 0,- 7- )}- </div>- <div style={{ animation: 'intro-float-b 6.1s ease-in-out infinite alternate' }}>- {sideCard('groceries', 'Weekly order built from your list', '↳ delivery booked for Sunday', '38px', 220, 7)}- </div>- </div>- ) : (- <div className="flex w-[19vw] min-w-[240px] flex-col gap-4 self-end pb-[5vh]">- <div style={{ animation: 'intro-float-c 5.7s ease-in-out infinite alternate' }}>- {sideCard(- 'inbox agent',- '2 replies drafted, waiting for your ok',- '↳ calendar updated for Friday',- '34px',- 120,- -7- )}- </div>- <div style={{ animation: 'intro-float-a 6.6s ease-in-out infinite alternate' }}>- {sideCard('morning brief', 'Tomorrow: 3 meetings, rain at 8', '↳ ready before you wake', '30px', 340, -7)}- </div>- </div>- )-}diff --git a/apps/desktop/src/components/intro-reveal/scenes/style.ts b/apps/desktop/src/components/intro-reveal/scenes/style.tsdeleted file mode 100644index f7f0916a541..00000000000--- a/apps/desktop/src/components/intro-reveal/scenes/style.ts+++ /dev/null@@ -1,13 +0,0 @@-export const EASE = 'cubic-bezier(0.22, 1, 0.36, 1)'--// Hermes blue: the app's --theme-primary (#0053fd), lightened for a dark background.-export const BLUE = '#4d8dff'-export const BLUE_DIM = 'rgba(77, 141, 255, 0.55)'-export const BLUE_FAINT = 'rgba(77, 141, 255, 0.4)'--// One shadow for every floating surface. It follows --shadow-nous (single top-// light, layered contact to ambient, x = 0, negative spread on each layer) at-// lower opacity for the dark background, so cards do not cast black halos over-// the frost.-export const NOUS_SHADOW =- '0 2px 4px -2px rgba(0,0,0,0.3), 0 8px 12px -6px rgba(0,0,0,0.24), 0 20px 28px -14px rgba(0,0,0,0.2), 0 36px 48px -28px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.05)'diff --git a/apps/desktop/src/components/intro-reveal/scenes/text.ts b/apps/desktop/src/components/intro-reveal/scenes/text.tsdeleted file mode 100644index fe7466b5a5f..00000000000--- a/apps/desktop/src/components/intro-reveal/scenes/text.ts+++ /dev/null@@ -1,17 +0,0 @@-const SCRAMBLE_CHARS = '/\\|-_=+<>~:*'--export const SPINNER = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏']--export const scrambleGlyph = (i: number, tick: number) => {- const n = (i * 2654435761 + tick * 40503) >>> 0-- return SCRAMBLE_CHARS[n % SCRAMBLE_CHARS.length]-}--/** Spaces stay fixed so word boundaries survive the scramble. */-export function decoded(text: string, bornAt: number, tick: number, spanMs = 520): string {- const age = tick * 45 - bornAt- const resolved = Math.max(0, Math.min(text.length, Math.ceil((age / spanMs) * text.length)))-- return Array.from(text, (ch, i) => (ch === ' ' || i < resolved ? ch : scrambleGlyph(i, tick))).join('')-}diff --git a/apps/desktop/src/components/intro-reveal/sound.ts b/apps/desktop/src/components/intro-reveal/sound.tsdeleted file mode 100644index 5386030d39d..00000000000--- a/apps/desktop/src/components/intro-reveal/sound.ts+++ /dev/null@@ -1,217 +0,0 @@-/** Synthesized cues for the intro. The clock in use-intro-clock.ts calls them on the score's beats. */--import { $hapticsMuted } from '@/store/haptics'--interface IntroAudioWindow extends Window {- webkitAudioContext?: typeof AudioContext-}--interface IntroPad {- setLevel: (level: number) => void- stop: () => void-}--let ctx: AudioContext | null = null-let master: GainNode | null = null--function getCtx(): AudioContext | null {- if (globalThis.window === undefined) {- return null- }-- try {- if (!ctx) {- const audioWindow: IntroAudioWindow = window- const Ctor = window.AudioContext || audioWindow.webkitAudioContext-- if (!Ctor) {- return null- }-- ctx = new Ctor()- master = ctx.createGain()- master.gain.value = 0.55- master.connect(ctx.destination)- }-- if (ctx.state === 'suspended') {- void ctx.resume().catch(() => undefined)- }-- return ctx- } catch {- return null- }-}--function env(g: GainNode, t0: number, peak: number, attack: number, decay: number): void {- g.gain.setValueAtTime(0.0001, t0)- g.gain.exponentialRampToValueAtTime(Math.max(peak, 0.0002), t0 + attack)- g.gain.exponentialRampToValueAtTime(0.0001, t0 + attack + decay)-}--export function startPad(): IntroPad {- const ac = getCtx()-- if (!ac || !master || $hapticsMuted.get()) {- return { setLevel: () => undefined, stop: () => undefined }- }-- const lp = ac.createBiquadFilter()-- lp.type = 'lowpass'- lp.frequency.value = 600- lp.Q.value = 0.4-- const g = ac.createGain()-- g.gain.value = 0-- lp.connect(g)- g.connect(master)-- // D3 / A3 / D4 with slight detune per voice for width.- const oscs: OscillatorNode[] = []-- for (const [freq, detune, gain] of [- [146.83, -4, 0.5],- [220.0, 3, 0.35],- [293.66, -2, 0.28]- ] as const) {- const osc = ac.createOscillator()- const vg = ac.createGain()-- osc.type = 'triangle'- osc.frequency.value = freq- osc.detune.value = detune- vg.gain.value = gain- osc.connect(vg)- vg.connect(lp)- osc.start()- oscs.push(osc)- }-- return {- setLevel: v => {- const t = ac.currentTime-- // The lowpass cutoff rises with the level, so the chord brightens as it swells.- lp.frequency.cancelScheduledValues(t)- lp.frequency.setTargetAtTime(600 + v * 900, t, 0.5)- g.gain.setTargetAtTime(v * 0.11, t, 0.35)- },- stop: () => {- const t = ac.currentTime-- g.gain.setTargetAtTime(0, t, 0.4)- window.setTimeout(() => {- for (const osc of oscs) {- osc.stop()- }- }, 1600)- }- }-}--export function playTick(pitch = 1): void {- const ac = getCtx()-- if (!ac || !master || $hapticsMuted.get()) {- return- }-- const t0 = ac.currentTime- const osc = ac.createOscillator()- const g = ac.createGain()-- osc.type = 'triangle'- osc.frequency.setValueAtTime(587.33 * pitch, t0)- osc.frequency.exponentialRampToValueAtTime(440 * pitch, t0 + 0.12)-- env(g, t0, 0.09, 0.004, 0.22)- osc.connect(g)- g.connect(master)- osc.start(t0)- osc.stop(t0 + 0.3)-}--export function playSwell(): void {- const ac = getCtx()-- if (!ac || !master || $hapticsMuted.get()) {- return- }-- const t0 = ac.currentTime- const osc = ac.createOscillator()- const g = ac.createGain()-- osc.type = 'sine'- osc.frequency.setValueAtTime(110, t0)- osc.frequency.exponentialRampToValueAtTime(220, t0 + 2.4)-- g.gain.setValueAtTime(0.0001, t0)- g.gain.exponentialRampToValueAtTime(0.07, t0 + 1.2)- g.gain.exponentialRampToValueAtTime(0.0001, t0 + 3.2)-- osc.connect(g)- g.connect(master)- osc.start(t0)- osc.stop(t0 + 3.4)-}--export function playLatch(): void {- const ac = getCtx()-- if (!ac || !master || $hapticsMuted.get()) {- return- }-- const t0 = ac.currentTime-- for (const [freq, gain, delay] of [- [293.66, 0.13, 0],- [440.0, 0.09, 0.03]- ] as const) {- const osc = ac.createOscillator()- const g = ac.createGain()-- osc.type = 'sine'- osc.frequency.value = freq- env(g, t0 + delay, gain, 0.014, 0.7)- osc.connect(g)- g.connect(master)- osc.start(t0 + delay)- osc.stop(t0 + delay + 0.8)- }-}--export function playResolve(): void {- const ac = getCtx()-- if (!ac || !master || $hapticsMuted.get()) {- return- }-- const t0 = ac.currentTime-- const partials: Array<readonly [number, number, number]> = [- [587.33, 0.08, 0],- [739.99, 0.07, 0.1],- [880.0, 0.06, 0.2],- [1174.66, 0.05, 0.32]- ]-- for (const [freq, gain, delay] of partials) {- const osc = ac.createOscillator()- const g = ac.createGain()-- osc.type = 'triangle'- osc.frequency.value = freq- env(g, t0 + delay, gain, 0.02, 1.1)- osc.connect(g)- g.connect(master)- osc.start(t0 + delay)- osc.stop(t0 + delay + 1.2)- }-}diff --git a/apps/desktop/src/components/intro-reveal/timeline.ts b/apps/desktop/src/components/intro-reveal/timeline.tsdeleted file mode 100644index 0852c5b4d19..00000000000--- a/apps/desktop/src/components/intro-reveal/timeline.ts+++ /dev/null@@ -1,157 +0,0 @@-/** Score time stretches animation and sound together through INTRO_PACE.- * Real timers use wall time so recovery still works if the frame clock stalls. */--/** Playback rate for the score. >1 plays slower. */-export const INTRO_PACE = 1.25--export interface IntroBeat {- cue?: 'latch' | 'resolve' | 'swell' | 'tick'- id: string- /** ms from sequence start. */- t: number-}--export const INTRO_BEATS: IntroBeat[] = [- { id: 'ask', cue: 'tick', t: 0 },- { id: 'send', cue: 'tick', t: 3900 },- { id: 'working', cue: 'swell', t: 4500 },- { id: 'reply', cue: 'latch', t: 7600 },- { id: 'everywhere', t: 10600 },- { id: 'brand', cue: 'resolve', t: 13600 },- { id: 'dissolve', t: 16400 }-]--export const INTRO_TOTAL_MS = 17600--export const INTRO_WALL_MS = Math.round(INTRO_TOTAL_MS * INTRO_PACE)--/** Exit dissolve window after the sequence. index.tsx uses it as a wall-time delay before closing the overlay.- * use-intro-clock.ts adds it to score time for the brand fade and the loop cutoff, so INTRO_PACE scales it there. */-export const INTRO_EXIT_MS = 900--/** Overlay deadman margin: the surface force-closes its own window this long after the nominal end, even if- * the clock stalls. The main process holds an independent watchdog above this. */-export const INTRO_DEADMAN_MS = INTRO_WALL_MS + 4000--export function sampleCurves(t: number) {- const ramp = (from: number, to: number) => {- if (to <= from) {- return t >= to ? 1 : 0- }-- const f = Math.min(1, Math.max(0, (t - from) / (to - from)))-- return f * f * (3 - 2 * f)- }-- const brandT = INTRO_BEATS.find(b => b.id === 'brand')!.t- const dissolveT = INTRO_BEATS.find(b => b.id === 'dissolve')!.t-- return {- glow: ramp(brandT - 300, brandT + 1400) * (1 - ramp(dissolveT, dissolveT + 900)),- scatter: ramp(dissolveT, dissolveT + 1000)- }-}--export const INTRO_PROMPT = 'Model a hero cube in Blender and cycle it through some materials'--export const INTRO_REPLY_WORDS =- 'Done — materials compiled and previewed on the cube. Want a turntable render exported?'.split(' ')--/** Tool activity rows that appear during the `working` beat. `doneAt` changes the trailing status from- * running to done. Times are absolute sequence ms, so the whole piece stays on one clock. */-export interface IntroToolRow {- at: number- doneAt: number- doneText: string- icon: 'browser' | 'cron' | 'terminal'- label: string- runningText: string-}--export const INTRO_TOOL_ROWS: IntroToolRow[] = [- {- at: 4700,- doneAt: 6100,- doneText: 'scene linked',- icon: 'browser',- label: 'blender-mcp',- runningText: 'connecting to Blender…'- },- {- at: 5350,- doneAt: 6800,- doneText: 'metal · rough 0.2',- icon: 'terminal',- label: 'metal',- runningText: 'compiling metal…'- },- {- at: 6000,- doneAt: 7300,- doneText: 'glass · ior 1.45',- icon: 'cron',- label: 'glass',- runningText: 'compiling glass…'- }-]--/** Per-character reveal times for the typed prompt. Delays vary between keys, with longer pauses after- * spaces and punctuation, and come from a seeded LCG so every run is identical. */-export function typingSchedule(text: string, startMs: number, endMs: number): number[] {- let seed = 1337-- const rand = () => {- seed = (seed * 48271) % 2147483647-- return seed / 2147483647- }-- const weights = Array.from(text, ch => {- const base = 1 + rand() * 1.1-- // The extra weight on a space or a punctuation mark is the delay before that character appears.- if (ch === ' ') {- return base + 0.9- }-- if (/[,.!?]/.test(ch)) {- return base + 1.4- }-- return base- })-- const total = weights.reduce((a, b) => a + b, 0)- const span = endMs - startMs- const times: number[] = []- let acc = 0-- for (const w of weights) {- acc += w- times.push(startMs + (acc / total) * span)- }-- return times-}--/** Word reveal times for the streaming reply. easeOutQuad on the index, so early words arrive quicker than- * late ones. */-export function streamingSchedule(wordCount: number, startMs: number, endMs: number): number[] {- const times: number[] = []- const span = endMs - startMs-- for (let i = 0; i < wordCount; i += 1) {- const f = (i + 1) / wordCount-- times.push(startMs + (1 - (1 - f) * (1 - f)) * span)- }-- return times-}--/** Beats in the half-open range (prevT, t]. Callers fire each sound cue once even when the rAF cadence is- * irregular. Pass prevT = -1 on the first frame so the beat at t = 0 fires. */-export function beatsBetween(prevT: number, t: number): IntroBeat[] {- return INTRO_BEATS.filter(b => b.t > prevT && b.t <= t)-}diff --git a/apps/desktop/src/components/intro-reveal/use-intro-clock.ts b/apps/desktop/src/components/intro-reveal/use-intro-clock.tsdeleted file mode 100644index a3896b73a08..00000000000--- a/apps/desktop/src/components/intro-reveal/use-intro-clock.ts+++ /dev/null@@ -1,267 +0,0 @@-import { useCallback, useEffect, useRef, useState } from 'react'--import { playLatch, playResolve, playSwell, playTick, startPad } from './sound'-import {- beatsBetween,- INTRO_BEATS,- INTRO_DEADMAN_MS,- INTRO_EXIT_MS,- INTRO_PACE,- INTRO_PROMPT,- INTRO_REPLY_WORDS,- INTRO_TOOL_ROWS,- INTRO_TOTAL_MS,- type IntroBeat,- sampleCurves,- streamingSchedule,- typingSchedule-} from './timeline'-import { drawViewport, VIEWPORT_END_MS } from './viewport-cube'--const SOUND_CUES = {- tick: (beat: string) => playTick(beat === 'send' ? 1.35 : 1),- swell: playSwell,- latch: playLatch,- resolve: playResolve-} satisfies Record<NonNullable<IntroBeat['cue']>, (beat: string) => void>--const INTRO_BEAT_INDEX: Record<string, number> = Object.fromEntries(INTRO_BEATS.map((b, i) => [b.id, i]))--const SEND_T = INTRO_BEATS.find(b => b.id === 'send')!.t-const REPLY_T = INTRO_BEATS.find(b => b.id === 'reply')!.t-const EVERYWHERE_T = INTRO_BEATS.find(b => b.id === 'everywhere')!.t-const BRAND_T = INTRO_BEATS.find(b => b.id === 'brand')!.t-const TYPE_TIMES = typingSchedule(INTRO_PROMPT, 700, SEND_T - 450)-const WORD_TIMES = streamingSchedule(INTRO_REPLY_WORDS.length, REPLY_T + 150, REPLY_T + 2400)--interface Frame {- beat: number- replyWords: number- /** 45ms quantized clock. Drives the braille spinners and the scramble decodes. */- tick: number- toolDone: number // bitmask- toolShown: number // bitmask- typed: number-}--const INITIAL_FRAME: Frame = { beat: 0, replyWords: 0, tick: 0, toolDone: 0, toolShown: 0, typed: 0 }--function frameAt(t: number, beat: number): Frame {- let typed = 0-- while (typed < TYPE_TIMES.length && TYPE_TIMES[typed] <= t) {- typed += 1- }-- let replyWords = 0-- while (replyWords < WORD_TIMES.length && WORD_TIMES[replyWords] <= t) {- replyWords += 1- }-- let toolShown = 0- let toolDone = 0-- for (let i = 0; i < INTRO_TOOL_ROWS.length; i += 1) {- if (t >= INTRO_TOOL_ROWS[i].at) {- toolShown |= 1 << i- }-- if (t >= INTRO_TOOL_ROWS[i].doneAt) {- toolDone |= 1 << i- }- }-- return { beat, replyWords, tick: Math.floor(t / 45), toolDone, toolShown, typed }-}--export function useIntroClock() {- const glowRef = useRef<HTMLDivElement>(null)- const stageRef = useRef<HTMLDivElement>(null)- const brandRef = useRef<HTMLDivElement>(null)- const viewportRef = useRef<HTMLCanvasElement>(null)- const [frame, setFrame] = useState<Frame>(INITIAL_FRAME)- const [clockLeaving, setClockLeaving] = useState(false)- const [faded, setFaded] = useState(false)- const reduceMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches-- const skip = useCallback(() => {- setClockLeaving(true)-- window.hermesDesktop?.introReveal?.skip?.()- window.setTimeout(() => {- void window.hermesDesktop?.introReveal?.close?.({ showMain: true }).catch(() => undefined)- }, 1200)- }, [])-- useEffect(() => {- const id = window.setTimeout(() => {- void window.hermesDesktop?.introReveal?.close?.({ showMain: true }).catch(() => undefined)- }, INTRO_DEADMAN_MS)-- return () => window.clearTimeout(id)- }, [])-- // The native window keeps the clock running while the main app is hidden.- useEffect(() => {- if (reduceMotion) {- setFrame({ ...INITIAL_FRAME, beat: INTRO_BEAT_INDEX.brand })-- // This branch has no frame loop to reveal the brand or hide the demo.- for (const element of [glowRef.current, brandRef.current]) {- if (element) {- element.style.opacity = '1'- }- }-- if (stageRef.current) {- stageRef.current.style.opacity = '0'- }-- playLatch()-- const id = window.setTimeout(() => {- skip()- }, 2600)-- return () => window.clearTimeout(id)- }-- const pad = startPad()- const start = performance.now()- let prevT = -1- // `start` is wall time; everything downstream of `elapsed` is score time. This- // one division is what makes the beats, the schedules and the cube all play at- // INTRO_PACE.- const elapsed = () => (performance.now() - start) / INTRO_PACE- let raf = 0- let currentBeat = 0- let reportedDone = false- let lastFrameKey = ''-- const tick = () => {- const t = elapsed()-- for (const b of beatsBetween(prevT, t)) {- currentBeat = INTRO_BEAT_INDEX[b.id] ?? currentBeat-- if (b.cue) {- SOUND_CUES[b.cue](b.id)- }- }-- prevT = t-- drawViewportFrame(viewportRef.current, t)-- const next = frameAt(t, currentBeat)- const key = `${next.beat}:${next.typed}:${next.replyWords}:${next.toolShown}:${next.toolDone}`-- if (key !== lastFrameKey) {- lastFrameKey = key- setFrame(next)- }-- const curves = sampleCurves(t)-- pad.setLevel(Math.max(curves.glow, next.beat >= INTRO_BEAT_INDEX.working ? 0.45 : 0.2))-- const ss = (from: number, to: number) => {- const f = Math.min(1, Math.max(0, (t - from) / (to - from)))-- return f * f * (3 - 2 * f)- }-- // The stage transform combines a drift up across the whole piece, a scale- // oscillation of 0.4%, and a lateral shift of -18px as the constellation- // opens, which leaves the hero left of centre once the side agents arrive.- // One transform, so the whole stage stays on the compositor.- if (stageRef.current) {- const rise = -10 - ss(0, INTRO_TOTAL_MS) * 26- const breathe = 1 + Math.sin(t / 2600) * 0.004- const openScale = 1 - ss(EVERYWHERE_T - 600, EVERYWHERE_T + 1200) * 0.06- const lateral = ss(EVERYWHERE_T - 600, EVERYWHERE_T + 1400) * -18- const brandPush = ss(BRAND_T - 300, BRAND_T + 1200)-- stageRef.current.style.transform = `translate(${lateral}px, ${rise + brandPush * -14}px) scale(${breathe * openScale * (1 - brandPush * 0.05)})`- stageRef.current.style.opacity = String(1 - brandPush)- }-- // The glow, badge, wordmark and tagline share one alpha, so no part of the- // brand close is readable against a half-faded glow. The group fades in with- // the glow and fades out through the exit window.- const brandIn = ss(BRAND_T - 200, BRAND_T + 1300)- const brandOut = 1 - ss(INTRO_TOTAL_MS - 500, INTRO_TOTAL_MS + INTRO_EXIT_MS - 100)- const brandAlpha = brandIn * brandOut-- if (glowRef.current) {- glowRef.current.style.opacity = String(brandAlpha)- glowRef.current.style.transform = `translate(-50%, -30%) scale(${0.9 + brandIn * 0.14})`- }-- if (brandRef.current) {- brandRef.current.style.opacity = String(brandAlpha)- brandRef.current.style.transform = `translateY(${(1 - brandIn) * 26 - brandIn * 6}px) scale(${0.94 + brandIn * 0.06})`- }-- if (t >= INTRO_TOTAL_MS && !reportedDone) {- reportedDone = true- skip()- }-- if (t < INTRO_TOTAL_MS + INTRO_EXIT_MS) {- raf = requestAnimationFrame(tick)- }- }-- raf = requestAnimationFrame(tick)-- return () => {- cancelAnimationFrame(raf)- pad.stop()- }- }, [reduceMotion, skip])-- // Esc to skip, handled here so it does not depend on the main renderer.- useEffect(() => {- const onKey = (e: KeyboardEvent) => {- if (e.key === 'Escape') {- skip()- }- }-- window.addEventListener('keydown', onKey)-- return () => window.removeEventListener('keydown', onKey)- }, [skip])-- useEffect(() => {- const id = requestAnimationFrame(() => setFaded(true))-- return () => cancelAnimationFrame(id)- }, [])-- return { frame, leaving: clockLeaving, faded, skip, glowRef, stageRef, brandRef, viewportRef }-}--function drawViewportFrame(canvas: HTMLCanvasElement | null, t: number) {- if (canvas && t < VIEWPORT_END_MS) {- const dpr = Math.min(2, window.devicePixelRatio || 1)- const cw = canvas.clientWidth- const ch = canvas.clientHeight-- if (cw > 0 && ch > 0) {- if (canvas.width !== cw * dpr || canvas.height !== ch * dpr) {- canvas.width = cw * dpr- canvas.height = ch * dpr- }-- const ctx2d = canvas.getContext('2d')-- if (ctx2d) {- ctx2d.setTransform(dpr, 0, 0, dpr, 0, 0)- drawViewport(ctx2d, cw, ch, t)- }- }- }-}diff --git a/apps/desktop/src/components/intro-reveal/viewport-cube.ts b/apps/desktop/src/components/intro-reveal/viewport-cube.tsdeleted file mode 100644index 6212dca6c5e..00000000000--- a/apps/desktop/src/components/intro-reveal/viewport-cube.ts+++ /dev/null@@ -1,514 +0,0 @@-/** Canvas geometry and texture noise derive from score time, so every playback draws the same frames. */--import { INTRO_BEATS } from './timeline'--const N = 4--/** End of the cube's draw window. use-intro-clock.ts stops calling drawViewport at this time. */-export const VIEWPORT_END_MS = INTRO_BEATS.find(b => b.id === 'everywhere')!.t + 700--/** Each material has an explicit start time, so the two `texture` slots sit at chosen moments in the- * sequence. Cycling the list at a fixed interval placed them wherever the modulo fell. */-const VIEWPORT_SCHEDULE = [- { at: 0, mode: 'standard' },- { at: 1900, mode: 'metal' },- { at: 3700, mode: 'texture' },- { at: 5800, mode: 'glass' },- { at: 7000, mode: 'wireframe' },- { at: 8300, mode: 'texture' },- { at: 10500, mode: 'wireframe' }-] as const--const CROSSFADE_MS = 620--export type ViewportMode = (typeof VIEWPORT_SCHEDULE)[number]['mode']--export interface ViewportSlot {- at: number- index: number- mode: ViewportMode- until: number-}--/** The material showing at `t`, with the start and end of its window. Callers use the bounds for the- * crossfade, the tear ramps and the label's decode. */-export function viewportSlot(t: number): ViewportSlot {- let index = 0-- for (let i = 0; i < VIEWPORT_SCHEDULE.length; i += 1) {- if (VIEWPORT_SCHEDULE[i].at <= t) {- index = i- }- }-- return {- at: VIEWPORT_SCHEDULE[index].at,- index,- mode: VIEWPORT_SCHEDULE[index].mode,- until: VIEWPORT_SCHEDULE[index + 1]?.at ?? VIEWPORT_END_MS- }-}--interface Quad {- z: number- pts: [number, number][]- shade: number- /** Grid cell on its face, for texture coordinates. */- cell: [number, number]-}--/** Subdivided cube quads, rotated and projected. The subdivision keeps each texture cell small enough that- * an affine map reads as a perspective one. */-function cubeQuads(t: number, w: number, h: number): Quad[] {- const rx = t * 0.00042- const ry = t * 0.00071- const cx = Math.cos(rx)- const sx = Math.sin(rx)- const cy = Math.cos(ry)- const sy = Math.sin(ry)- // Scaled off the smaller side so the cube stays clear of the viewport frame.- const scale = Math.min(w, h) * 0.24- const quads: Quad[] = []-- const vert = (u: number, v: number, face: number): [number, number, number] => {- const a = -1 + (2 * u) / N- const b = -1 + (2 * v) / N-- const p: [number, number, number] =- face === 0- ? [a, b, 1]- : face === 1- ? [a, b, -1]- : face === 2- ? [1, a, b]- : face === 3- ? [-1, a, b]- : face === 4- ? [a, 1, b]- : [a, -1, b]-- const x1 = p[0] * cy + p[2] * sy- const z1 = -p[0] * sy + p[2] * cy- const y2 = p[1] * cx - z1 * sx- const z2 = p[1] * sx + z1 * cx-- return [x1, y2, z2]- }-- for (let face = 0; face < 6; face += 1) {- for (let u = 0; u < N; u += 1) {- for (let v = 0; v < N; v += 1) {- const c: [number, number, number][] = [- vert(u, v, face),- vert(u + 1, v, face),- vert(u + 1, v + 1, face),- vert(u, v + 1, face)- ]-- const z = (c[0][2] + c[1][2] + c[2][2] + c[3][2]) / 4- const ux = c[1][0] - c[0][0]- const uy = c[1][1] - c[0][1]- const uz = c[1][2] - c[0][2]- const vx = c[3][0] - c[0][0]- const vy = c[3][1] - c[0][1]- const vz = c[3][2] - c[0][2]- const nx = uy * vz - uz * vy- const ny = uz * vx - ux * vz- const nz = ux * vy - uy * vx- const nl = Math.hypot(nx, ny, nz) || 1- const shade = Math.abs(nz / nl)-- quads.push({- z,- shade,- cell: [u, v],- pts: c.map(([x, y, zz]): [number, number] => {- const persp = 3.6 / (3.6 - zz * 0.9)-- return [w / 2 + x * scale * persp, h / 2 + y * scale * persp]- })- })- }- }- }-- return quads.sort((a, b) => a.z - b.z)-}--// Texture pass: the image mapped onto the cube, with an RGB channel separation.-// The cube renders once, is split into red, green and blue copies, and the three-// are re-composited with 'lighter' at diverging offsets. At zero offset they sum-// back to the untouched image.--const CHANNEL_TINTS = ['#ff0000', '#00ff00', '#0000ff'] as const-const SLICES = 14--let texture: HTMLImageElement | null = null-let textureRequested = false--/** Starts the image load on the first call and returns the cached image afterwards. Returns null until the- * image decodes, and paintTexturedCube draws nothing on those frames. */-function textureImage(): HTMLImageElement | null {- if (textureRequested || globalThis.document === undefined) {- return texture- }-- textureRequested = true-- const img = new Image()-- img.onload = () => {- texture = img- }-- // Not `nous-girl.jpg`: that asset is the BrandMark tile art, dark on white, and- // reads as a solid white block once it is wrapped around a cube. This one is- // light-on-dark line work, so the faces keep their shading and the channel- // split has edges to offset.- img.src = `${import.meta.env.BASE_URL}intro-nous-girl.png`-- return null-}--const scratch = new Map<string, HTMLCanvasElement>()--/** A cleared offscreen context at device resolution. `scale` applies the DPR, so callers keep drawing in the- * same CSS pixels the quads are projected into. */-function buffer(key: string, w: number, h: number, scale: number): CanvasRenderingContext2D {- let canvas = scratch.get(key)-- if (!canvas) {- canvas = document.createElement('canvas')- scratch.set(key, canvas)- }-- if (canvas.width !== w || canvas.height !== h) {- canvas.width = w- canvas.height = h- }-- const ctx = canvas.getContext('2d')!-- ctx.setTransform(scale, 0, 0, scale, 0, 0)- ctx.globalCompositeOperation = 'source-over'- ctx.globalAlpha = 1- ctx.clearRect(0, 0, w, h)-- return ctx-}--/** Deterministic value noise. The tear has to replay identically on every playback. */-function hash(n: number): number {- const s = Math.sin(n * 12.9898) * 43758.5453-- return s - Math.floor(s)-}--/** 0 is settled, 1 is fully torn. Starts fully torn and settles over the first 460ms, stutters at random- * during the hold, then tears out over the last 420ms of the slot. */-function tearAmount(local: number, span: number): number {- const arriving = 1 - Math.min(1, local / 460)- const leaving = Math.max(0, (local - (span - 420)) / 420)- const step = Math.floor(local / 90)- const stutter = hash(step) > 0.88 ? hash(step * 1.7) * 0.5 : 0-- return Math.min(1, Math.max(arriving, leaving, stutter))-}--let scanPattern: CanvasPattern | null = null--/** Scanline pattern of one dark row in three, built once. It is filled under the buffer's DPR transform, so- * the lines keep a constant weight in CSS pixels at any scale. */-function scanlines(ctx: CanvasRenderingContext2D): CanvasPattern | null {- if (!scanPattern) {- const canvas = document.createElement('canvas')-- canvas.width = 1- canvas.height = 3-- const tile = canvas.getContext('2d')!-- tile.fillStyle = 'rgba(0, 0, 0, 0.34)'- tile.fillRect(0, 0, 1, 1)- scanPattern = ctx.createPattern(canvas, 'repeat')- }-- return scanPattern-}--function inflate(pts: [number, number][], px: number): [number, number][] {- const cx = (pts[0][0] + pts[1][0] + pts[2][0] + pts[3][0]) / 4- const cy = (pts[0][1] + pts[1][1] + pts[2][1] + pts[3][1]) / 4-- return pts.map(([x, y]): [number, number] => {- const dx = x - cx- const dy = y - cy- const d = Math.hypot(dx, dy) || 1-- return [x + (dx / d) * px, y + (dy / d) * px]- })-}--function paintTexturedCube(- ctx: CanvasRenderingContext2D,- quads: Quad[],- w: number,- h: number,- slot: ViewportSlot,- t: number,- alpha: number-): void {- const img = textureImage()-- if (!img) {- return- }-- const local = t - slot.at-- // The surface passes a DPR-scaled context and CSS-pixel geometry. The offscreens- // use the same DPR, otherwise this pass renders at 1x and is upscaled.- const dpr = ctx.getTransform().a || 1- const dw = Math.ceil(w * dpr)- const dh = Math.ceil(h * dpr)-- const tear = tearAmount(local, slot.until - slot.at)- const cube = buffer('cube', dw, dh, dpr)- const sw = img.naturalWidth / N- const sh = img.naturalHeight / N-- for (const q of quads) {- const [p0, p1, , p3] = q.pts- // Two clips that meet on an edge each antialias to half cover, which on a- // white texture reads as a grey hairline grid. The cells overlap instead: the- // texture is opaque and drawn back to front, so a later cell repaints the seam.- const poly = inflate(q.pts, 0.6)-- cube.save()- cube.beginPath()- cube.moveTo(poly[0][0], poly[0][1])-- for (let i = 1; i < 4; i += 1) {- cube.lineTo(poly[i][0], poly[i][1])- }-- cube.closePath()- cube.clip()- // The image is light-on-dark line work, so each face needs an opaque fill- // first. Without it the cube's unlit areas are the same black as the viewport- // behind it and only stray white curves show. The fill also covers the- // inflated overlap before the line work is drawn.- cube.fillStyle = `rgb(${12 + q.shade * 20}, ${13 + q.shade * 22}, ${17 + q.shade * 28})`- cube.fillRect(0, 0, w, h)- // Affine map from the unit cell to this quad. It ignores the fourth corner, so- // the texture swims slightly across a face (affine texture warping).- cube.transform(p1[0] - p0[0], p1[1] - p0[1], p3[0] - p0[0], p3[1] - p0[1], p0[0], p0[1])- // 'lighter' adds the line work instead of covering the fill: black in the- // image contributes nothing, and the alpha below scales with the face's shade.- cube.globalCompositeOperation = 'lighter'- cube.globalAlpha = 0.55 + q.shade * 0.45- cube.drawImage(img, q.cell[0] * sw, q.cell[1] * sh, sw, sh, -0.06, -0.06, 1.12, 1.12)- cube.restore()- }-- // CRT pass, drawn with 'source-atop' so it stays inside the cube's own alpha and- // does not touch the empty space around the solid. It is composited before the- // channel split below, so the split offsets the sweep and the grille too.- cube.globalCompositeOperation = 'source-atop'-- const sweep = ((local % 1150) / 1150) * 1.3 - 0.15- const bar = cube.createLinearGradient(0, (sweep - 0.13) * h, 0, (sweep + 0.13) * h)-- bar.addColorStop(0, 'rgba(120, 200, 255, 0)')- bar.addColorStop(0.5, 'rgba(165, 220, 255, 0.26)')- bar.addColorStop(1, 'rgba(120, 200, 255, 0)')- cube.fillStyle = bar- cube.fillRect(0, 0, w, h)-- const grille = scanlines(cube)-- if (grille) {- cube.fillStyle = grille- cube.fillRect(0, 0, w, h)- }-- const step = Math.floor(local / 90)- // The 0.7 term keeps a minimum separation, so held frames still show a small- // offset instead of a clean image.- const rip = (tear * 8 + 0.7) * dpr-- ctx.save()- // Composite in device space: the offsets are in device pixels and the buffers- // are already at device resolution.- ctx.setTransform(1, 0, 0, 1, 0, 0)- ctx.globalCompositeOperation = 'lighter'- ctx.globalAlpha = alpha-- for (let c = 0; c < 3; c += 1) {- const chan = buffer('chan', dw, dh, 1)-- chan.drawImage(cube.canvas, 0, 0)- // Isolate one channel: multiply by a primary, then re-apply the cube's own- // alpha, because the full-canvas fill also tints the empty space.- chan.globalCompositeOperation = 'multiply'- chan.fillStyle = CHANNEL_TINTS[c]- chan.fillRect(0, 0, dw, dh)- chan.globalCompositeOperation = 'destination-in'- chan.drawImage(cube.canvas, 0, 0)-- // dx offsets red left and blue right and leaves green at 0. The per-slice- // jitter below breaks the silhouette as well as the colour.- const dx = (c - 1) * rip-- for (let s = 0; s < SLICES; s += 1) {- // Bands are integer and abutting. Overlapping rows would be summed twice by- // 'lighter' and show as bright lines across the cube.- const y0 = Math.round((s * dh) / SLICES)- const band = Math.round(((s + 1) * dh) / SLICES) - y0- const jitter = (hash(step * 31 + s) - 0.5) * 2 * tear * 11 * dpr-- ctx.drawImage(chan.canvas, 0, y0, dw, band, dx + jitter, y0, dw, band)- }- }-- ctx.restore()-}--export function drawViewport(ctx: CanvasRenderingContext2D, w: number, h: number, t: number) {- // Start the image load on the first frame. The first `texture` slot opens at- // 3700ms, and a decode that arrives during a crossfade would show the cube- // empty for those frames.- textureImage()-- const slot = viewportSlot(t)- const mode = slot.mode- // Materials crossfade at slot boundaries: the incoming material fades up over- // the outgoing one.- const prevEntry = VIEWPORT_SCHEDULE[slot.index - 1]- const prevMode = prevEntry?.mode ?? mode- const fade = Math.min(CROSSFADE_MS, (slot.until - slot.at) * 0.4)- const blendF = Math.min(1, (t - slot.at) / fade)- const blend = blendF * blendF * (3 - 2 * blendF)-- ctx.clearRect(0, 0, w, h)-- const quads = cubeQuads(t, w, h)-- ctx.save()- ctx.font = "8px 'JetBrains Mono', monospace"-- const rx = t * 0.00042- const ry = t * 0.00071- const gx = 24- const gy = h - 22-- const axes: [string, number, number, number, string][] = [- ['x', 1, 0, 0, 'rgba(248, 113, 113, 0.8)'],- ['y', 0, -1, 0, 'rgba(74, 222, 128, 0.8)'],- ['z', 0, 0, 1, 'rgba(96, 165, 250, 0.8)']- ]-- for (const [label, ax, ay, az, color] of axes) {- const x1 = ax * Math.cos(ry) + az * Math.sin(ry)- const z1 = -ax * Math.sin(ry) + az * Math.cos(ry)- const y2 = ay * Math.cos(rx) - z1 * Math.sin(rx)- const px = gx + x1 * 13- const py = gy + y2 * 13-- ctx.strokeStyle = color- ctx.lineWidth = 1- ctx.beginPath()- ctx.moveTo(gx, gy)- ctx.lineTo(px, py)- ctx.stroke()- ctx.fillStyle = color- ctx.fillText(label, px + 2, py + 3)- }-- // The 6 * 5 * 5 below is 6 faces times (N + 1)² shared grid vertices, for N = 4.- const deg = (r: number) => ((((r * 180) / Math.PI) % 360) | 0).toString().padStart(3, ' ')-- ctx.fillStyle = 'rgba(255,255,255,0.22)'- ctx.fillText(`rx ${deg(rx)}\u00b0 ry ${deg(ry)}\u00b0`, 12, 14)- const verts = `${6 * 5 * 5} verts \u00b7 ${quads.length} faces`-- ctx.fillText(verts, w - ctx.measureText(verts).width - 12, h - 10)- ctx.restore()-- // One painter per material. `texture` is not handled here: it is a whole-cube- // pass below, because its channel split has to happen in screen space.- const paint = (m: ViewportMode, q: Quad, alpha: number) => {- if (alpha <= 0.01 || m === 'texture') {- return- }-- ctx.globalAlpha = alpha-- if (m === 'standard') {- const l = 152 + q.shade * 88-- ctx.fillStyle = `rgb(${l}, ${l}, ${l + 2})`- ctx.fill()- ctx.strokeStyle = 'rgba(0,0,0,0.16)'- ctx.lineWidth = 0.5- ctx.stroke()- } else if (m === 'metal') {- const s = Math.pow(q.shade, 2.6)- const v = 26 + s * 205-- ctx.fillStyle = `rgb(${v * 0.92}, ${v * 0.97}, ${Math.min(255, v * 1.06 + 6)})`- ctx.fill()- ctx.strokeStyle = 'rgba(255,255,255,0.07)'- ctx.lineWidth = 0.5- ctx.stroke()- } else if (m === 'glass') {- const rim = 1 - q.shade-- ctx.fillStyle = `rgba(140, 180, 255, ${0.05 + rim * 0.17})`- ctx.fill()- ctx.strokeStyle = `rgba(170, 200, 255, ${0.1 + rim * 0.38})`- ctx.lineWidth = 0.7- ctx.stroke()- } else {- ctx.strokeStyle = `rgba(255,255,255,${0.14 + q.shade * 0.2})`- ctx.lineWidth = 1- ctx.stroke()- }- }-- for (const q of quads) {- ctx.beginPath()- ctx.moveTo(q.pts[0][0], q.pts[0][1])-- for (let i = 1; i < 4; i += 1) {- ctx.lineTo(q.pts[i][0], q.pts[i][1])- }-- ctx.closePath()-- if (blend < 1) {- paint(prevMode, q, 1 - blend)- }-- paint(mode, q, blend)- }-- ctx.globalAlpha = 1-- if (mode === 'texture') {- paintTexturedCube(ctx, quads, w, h, slot, t, blend)- } else if (prevMode === 'texture' && prevEntry) {- // The outgoing texture keeps its own slot bounds, so the tear-out that began- // at the end of its window carries through the crossfade. Reading the incoming- // slot's local time restarts the tear ramp instead.- paintTexturedCube(- ctx,- quads,- w,- h,- { at: prevEntry.at, index: slot.index - 1, mode: 'texture', until: slot.at },- t,- 1 - blend- )- }-}diff --git a/apps/desktop/src/components/onboarding-chat/assembly.ts b/apps/desktop/src/components/onboarding-chat/assembly.tsindex 3e5f3900de0..93558527077 100644--- a/apps/desktop/src/components/onboarding-chat/assembly.ts+++ b/apps/desktop/src/components/onboarding-chat/assembly.ts@@ -1,10 +1,3 @@-/**- * The guided chat runs alone in a small window. Picking a layout assembles the app around the conversation.- *- * The window grows by the minimum the new panes need, with a viewport floor that keeps the sidebar docked. The main- * process animates the growth with setBounds (electron/chat-onboarding-window.ts), so no CSS transition is involved.- */-import { useStore } from '@nanostores/react'import { atom } from 'nanostores'@@ -34,20 +27,14 @@ import { setOnboardingSurfaceActive } from '@/store/onboarding-presence'import { $paneStates, type PaneStateSnapshot } from '@/store/panes'import { $activeSessionId, $selectedStoredSessionId } from '@/store/session'-/** True from guide kickoff until assembly places the picked layout. Skip and a failed kickoff also clear it. */export const $chatOnboardingSolo = atom(false)-// Mirrors solo mode into the presence set, which hides ambient UI such as the update toast (onboarding-presence.ts).$chatOnboardingSolo.subscribe(solo => setOnboardingSurfaceActive('solo-chat', solo))-/** The thread list keys by stored id; the composer keys by runtime id. Both- * identify the conversation that gets onboarding transcript treatment. */export const $chatOnboardingThreadIds = atom<readonly string[]>([])-/** The greeting is seeded locally, without an inference request. */export const $onboardingGreeting = atom('')-/** First-write-wins keeps the opener stable through profile and backend boot. */export function pickOnboardingGreeting(): string {const existing = $onboardingGreeting.get()@@ -64,7 +51,6 @@ export function pickOnboardingGreeting(): string {return greeting}-/** Applying a layout remounts the card, so its selection must outlive the component. */export const $chatLayoutPicked = atom(false)let previousLayout: {@@ -74,9 +60,6 @@ let previousLayout: {placed: ReadonlySet<string>} | null = null-/** The guide's shape, all at once: the solo layout and the small centred- * window. Called on the tick the guide is owed (film ended, or a boot that- * finds the guide queued) so no full-size frame paints in between. */export function takeGuideShape(): void {if ($chatOnboardingSolo.get()) {return@@ -84,7 +67,6 @@ export function takeGuideShape(): void {startChatOnboardingSolo()- // startChatOnboardingSolo declines when the guide is off; shrink only when it took.if ($chatOnboardingSolo.get()) {window.hermesDesktop?.chatOnboarding?.soloBoot?.()}@@ -104,12 +86,9 @@ export function startChatOnboardingSolo(): void {$chatOnboardingSolo.set(true)$chatLayoutPicked.set(false)void loadMachineProfile()- // Adoption puts other panes in this same group. Hiding its strip keeps them- // invisible, including reactive arrivals, until a layout places them.applyLayoutPreset('chat-solo', group(['workspace'], { tabStrip: 'never' }))}-/** Called when the guide kickoff fails, so classic onboarding can resume. */export function endChatOnboardingSolo(): void {$chatOnboardingSolo.set(false)$onboardingGreeting.set('')@@ -133,8 +112,6 @@ function restorePreviousLayout() {}}-/** Per-preset growth in pixels, sized to what the new panes need. Deriving the growth from the chat's own size made- * the window much too large. */interface LayoutGrowth {bottom?: numberleft?: number@@ -147,8 +124,6 @@ const LAYOUT_GROWTH = new Map<string, LayoutGrowth>([['terminal-deck', { bottom: 200, left: 220, right: 240 }]])-/** Re-picks must reset persisted dismissals, docks, and sidebar visibility:- * swapping only the tree left Elite's terminal dismissed after Basic. */function reconcileLayout(id: string, tree: LayoutNode): void {applyLayoutPreset(id, tree)@@ -156,10 +131,6 @@ function reconcileLayout(id: string, tree: LayoutNode): void {undismissTreePanes(declared)- // plugins/hermes-bots/plugin.tsx enforces a dock onto Sessions; adoption- // otherwise adds its roster and a tab strip to the sidebar. Dismiss every- // undeclared pane, including registry entries not placed yet, so subsequent- // adoption cannot bring them back. Their own toggles still can.const dismissUndeclared = () => {for (const paneId of new Set([...allPaneIds($layoutTree.get() ?? tree),@@ -171,26 +142,18 @@ function reconcileLayout(id: string, tree: LayoutNode): void {}}- // A persisted closed sidebar would hide the column this pick just requested.setSidebarOpen(true)- // Solo boot consumed dock enforcement before a sidebar existed. Reset that record so adoption can dock against the- // newly placed Sessions column.resetEnforcedDocks()adoptContributedPanes()- // Showing the sidebar can register more plugin panes synchronously. Dismiss last so those panes are dismissed as- // well; Basic otherwise gained an empty Cronjobs column.dismissUndeclared()}-/** Grow only when leaving solo mode: repeating the delta would make the window larger on every re-pick.- * Reconcile panes on every pick. */export function assembleChatOnboarding(id: string, tree: LayoutNode, mode?: InterfaceMode): void {const firstPick = $chatOnboardingSolo.get()if (mode && mode !== $interfaceMode.get()) {- // The guide's temporary solo tree is not an Advanced workspace to remember.restorePreviousLayout()setInterfaceMode(mode)}@@ -204,8 +167,6 @@ export function assembleChatOnboarding(id: string, tree: LayoutNode, mode?: Intebottom: growth.bottom ?? 0,left: growth.left ?? 0,right: growth.right ?? 0,- // Pane deltas can leave Basic below the sidebar's docking breakpoint at- // the user's zoom. Main applies this viewport floor, then the display clamp.minWidth: DOCKED_SIDEBAR_MIN_PX,top: growth.top ?? 0})@@ -216,12 +177,10 @@ export function assembleChatOnboarding(id: string, tree: LayoutNode, mode?: Inte$chatOnboardingSolo.set(false)}-/** Skip ends setup without deleting its conversation; the phase write prevents resuming it. */export function skipChatOnboarding(): void {const preset = registry.getArea('layouts').find(contribution => contribution.id === 'basic')if (preset?.data) {- // SAFETY: Layout presets declare data: LayoutNode (pane-shell/tree/presets.ts).assembleChatOnboarding(preset.id, preset.data as LayoutNode)} else {$chatOnboardingSolo.set(false)@@ -230,7 +189,6 @@ export function skipChatOnboarding(): void {skipGuide()}-/** Suppress floating panels and swap chrome throughout the flow's conversations. */export function useOnboardingChatActive(): boolean {const solo = useStore($chatOnboardingSolo)const threadIds = useStore($chatOnboardingThreadIds)diff --git a/apps/desktop/src/components/onboarding-chat/cards/build.tsx b/apps/desktop/src/components/onboarding-chat/cards/build.tsxindex 85862205f13..9e0ffdacb3f 100644--- a/apps/desktop/src/components/onboarding-chat/cards/build.tsx+++ b/apps/desktop/src/components/onboarding-chat/cards/build.tsx@@ -1,9 +1,3 @@-/**- * The three build cards: choosing what to make, handing it to a session of its own, and reporting progress. Unlike the- * setup cards these read the directive attrs, which the model writes, so each card validates the payload before it- * renders.- */-import { useAuiState } from '@assistant-ui/react'import { useStore } from '@nanostores/react'import { useEffect, useMemo } from 'react'@@ -35,23 +29,12 @@ import { $activeGatewayProfile } from '@/store/profile'import { assertSessionOwnerResolved } from '@/store/session-owner-resolution'import { isSessionOwnerRoute } from '@/store/session-request-router'-/** A tapped option is submitted as the user's own visible message rather than as a hidden [setup] note, so the- * model's next message answers a real turn. */const FALLBACK_OPTION = "Let's figure it out together"-/**- * The last question card before the handoff. The model asks what the user wants to build first, then places this card- * with options it wrote from the conversation so far:- * `::onboarding{step="first" options="Find emails I need to reply to|Plan my day around meetings|…"}`.- */export function FirstBuildCard({ attrs, locked }: CardProps) {const view = useSessionView()const storedId = useStore(view.$storedId)const target = view.kind === 'tile' ? `tile:${storedId}` : 'main'- // The pick lives with the other answers, not in component state: the- // visible submit rebuilds the transcript and a local flag came back null,- // leaving every chip clickable after one had already been sent. A typed- // reply in the composer closes the card the same way a chip does.const messageId = useAuiState(state => state.message.id)const answeredInComposer = answeredAfter(useStore(view.$messages), messageId)@@ -63,9 +46,6 @@ export function FirstBuildCard({ attrs, locked }: CardProps) {const picked = committed ?? (answeredInComposer ? '' : null)- // The 60-character limit keeps an option on one chip. The dedupe is case-insensitive because models repeat- // themselves. Fewer than 2 usable options falls back to FALLBACK_OPTION, because the model's prose has already- // told the user to pick one below.const seen = new Set<string>()const parsed = (attrs.options ?? '')@@ -107,15 +87,6 @@ export function FirstBuildCard({ attrs, locked }: CardProps) {)}-/**- * Moves the first build out of this chat. Setup emits- * `::onboarding{step="handoff" task="…" brief="…"}` once the task is decided. This card sets the request atom, and- * the wiring effect then creates a session on the user's default profile, seeds it, and moves the user there.- *- * The `first` step already settled what to build, so this card asks nothing and only reports the state of the handoff.- * The request atom and the accepted receipt stop a re-parse, a re-mount, or a relaunch from starting a second handoff,- * and a locked (replayed) transcript never starts one.- */export function HandoffCard({ attrs, locked }: CardProps) {const view = useSessionView()const storedId = useStore(view.$storedId)@@ -124,7 +95,6 @@ export function HandoffCard({ attrs, locked }: CardProps) {const brief = (attrs.brief ?? '').trim().slice(0, 240)const plan = parseHandoffPlan(attrs.plan)const state = useStore($setupHandoff)- // `locked` follows this text part; a later part (a tool call, reasoning) settles it while the reply still runs.const replyRunning = useAuiState(s => s.message.status?.type === 'running')const receipt = useMemo(() => {@@ -157,7 +127,6 @@ export function HandoffCard({ attrs, locked }: CardProps) {? owner.profile: owner || $setupSession.get()?.profile || $activeGatewayProfile.get()- // An unreachable history keeps the rendered attrs: today's behaviour, never a stalled handoff.const persisted = await readPersistedHandoff(connectionId, profile, runtimeId).catch(() => null)const persistedTask = (persisted?.task ?? '').trim().slice(0, 60)const persistedBrief = (persisted?.brief ?? '').trim().slice(0, 240)@@ -242,7 +211,6 @@ export function HandoffCard({ attrs, locked }: CardProps) {)}-/** The earlier steps are derived from this transcript on every render, so a re-mount cannot lose or repeat them. */export function ProgressCard({ attrs, locked }: CardProps) {const view = useSessionView()const messages = useStore(view.$messages)diff --git a/apps/desktop/src/components/onboarding-chat/cards/connectors.test.tsx b/apps/desktop/src/components/onboarding-chat/cards/connectors.test.tsxdeleted file mode 100644index 30ac3fd8769..00000000000--- a/apps/desktop/src/components/onboarding-chat/cards/connectors.test.tsx+++ /dev/null@@ -1,59 +0,0 @@-import { cleanup, fireEvent, render, screen } from '@testing-library/react'-import { afterEach, expect, it } from 'vitest'--import { ConnectorPicks } from '@/components/onboarding-chat/cards/setup'-import { $onboardingAnswers, DEFAULT_ANSWERS } from '@/store/onboarding-answers'-import type { OnboardingPlugin } from '@/store/onboarding-plugins'--const plugins: OnboardingPlugin[] = [- {- app_state: 'unknown',- description: '',- name: 'blender',- platforms: [],- sentence: '',- tier: 'official',- title: 'Blender'- },- {- app_state: 'missing_app',- description: '',- name: 'nvidia-app',- platforms: ['windows'],- sentence: 'needs NVIDIA App',- tier: 'official',- title: 'NVIDIA App'- }-]--afterEach(() => {- cleanup()- $onboardingAnswers.set({ ...DEFAULT_ANSWERS, committed: [] })-})--it('lists plugins before connectors; a plugin whose app is missing is greyed with its reason and still picks', () => {- const sent: string[] = []-- render(- <ConnectorPicks- catalog={{ rows: [{ connected: false, connector: 'gmail', enabled: true }], status: 'ready' }}- commit={summary => sent.push(summary) > 0}- done={false}- locked={false}- plugins={plugins}- />- )-- const labels = screen.getAllByRole('button', { pressed: false }).map(button => button.textContent ?? '')- expect(labels.findIndex(text => text.includes('Blender'))).toBeLessThan(labels.findIndex(text => /gmail/i.test(text)))-- const nvidia = screen.getByRole('button', { name: /NVIDIA App/ })- expect(nvidia.textContent).toContain('needs NVIDIA App')-- fireEvent.click(nvidia)- fireEvent.click(screen.getByRole('button', { name: /gmail/i }))- expect($onboardingAnswers.get().plugins).toEqual(['nvidia-app'])-- fireEvent.click(screen.getByRole('button', { name: 'Continue with 2' }))- expect(sent).toEqual(['apps I use, not connected yet: gmail; plugins picked, not installed yet: nvidia-app'])-})diff --git a/apps/desktop/src/components/onboarding-chat/cards/frame.tsx b/apps/desktop/src/components/onboarding-chat/cards/frame.tsxindex 4df988f5d11..b9179ec2dd0 100644--- a/apps/desktop/src/components/onboarding-chat/cards/frame.tsx+++ b/apps/desktop/src/components/onboarding-chat/cards/frame.tsx@@ -1,8 +1,3 @@-/**- * The parts every in-chat onboarding card shares: the frame it renders in, the props it receives, and the commit- * helper that submits the pick as a hidden [setup] message so the model moves on.- */-import { useStore } from '@nanostores/react'import { requestComposerSubmit } from '@/app/chat/composer/focus'@@ -12,17 +7,11 @@ import { cn } from '@/lib/utils'import { $onboardingAnswers, markStepCommitted } from '@/store/onboarding-answers'export interface CardProps {- /** The directive's raw attrs, written by the model. */attrs: Record<string, string>- /** Stable transcript identity for one-time application of model-supplied choices. */messageId?: string- /** True while the surrounding turn is still streaming; the card renders but does not accept clicks. */locked: boolean}-/** `step` names the card so Done survives the card remounting: the hidden- * submit and the turn-end hydrate both rebuild the transcript, and a flag in- * component state came back false each time. */export function useCardCommit(step: string) {const view = useSessionView()const storedId = useStore(view.$storedId)@@ -42,8 +31,6 @@ export function useCardCommit(step: string) {return { commit, done }}-/** The frame draws no border or background, so the picker reads as message content in the transcript rather than as- * a form. */export function CardFrame({children,continueLabel = 'Continue',@@ -53,8 +40,6 @@ export function CardFrame({onContinue}: {children: React.ReactNode- /** The action, named for what it does when the default label says nothing specific.- * "Continue with 2" tells them the picks registered. */continueLabel?: stringdisabled?: booleandone: booleandiff --git a/apps/desktop/src/components/onboarding-chat/cards/look.test.tsx b/apps/desktop/src/components/onboarding-chat/cards/look.test.tsxdeleted file mode 100644index 7c769a011e5..00000000000--- a/apps/desktop/src/components/onboarding-chat/cards/look.test.tsx+++ /dev/null@@ -1,70 +0,0 @@-import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'-import { afterEach, expect, it, vi } from 'vitest'--import { requestComposerSubmit } from '@/app/chat/composer/focus'-import type { CardProps } from '@/components/onboarding-chat/cards/frame'-import { LookCard } from '@/components/onboarding-chat/cards/setup'-import { $onboardingAnswers, DEFAULT_ANSWERS, loadAnswers, setOnboardingAnswers } from '@/store/onboarding-answers'-import { $accentOverride, setAccentOverride } from '@/themes/accent-override'--vi.mock('@/themes', () => ({ useTheme: () => ({ renderedMode: 'dark' }) }))-vi.mock('@/app/chat/composer/focus', () => ({ requestComposerSubmit: vi.fn(() => true) }))--afterEach(() => {- cleanup()- $onboardingAnswers.set({ ...DEFAULT_ANSWERS, committed: [] })- setAccentOverride(null)- localStorage.clear()- vi.clearAllMocks()-})--it('applies and persists a custom color through the same Continue path as a preset', () => {- const custom = '#5a7d62'- const view = render(<LookCard attrs={{}} locked={false} />)- fireEvent.change(screen.getByLabelText('Custom color'), { target: { value: custom } })- expect($accentOverride.get()).toBe(custom)- expect(loadAnswers().accent).toBe(custom)-- view.unmount()- act(() => {- setAccentOverride(null)- $onboardingAnswers.set(loadAnswers())- })- render(<LookCard attrs={{}} locked={false} />)- expect($accentOverride.get()).toBe(custom)- expect(screen.getByLabelText<HTMLInputElement>('Custom color').value).toBe(custom)- fireEvent.click(screen.getByRole('button', { name: 'Continue' }))- expect(requestComposerSubmit).toHaveBeenCalledWith(`[setup] accent color: ${custom}`, expect.any(Object))- expect(loadAnswers().committed).toContain('look')-})--function ChatColor(props: CardProps) {- return (- <>- <LookCard attrs={{}} locked={false} />- <LookCard {...props} />- </>- )-}--it('applies a settled chat color once without replaying old requests over later choices', () => {- const requested = '#654321'- const picked = '#5a7d62'- const view = render(<ChatColor attrs={{ value: requested }} locked messageId="color-1" />)- expect($accentOverride.get()).toBeNull()- expect(screen.getAllByLabelText('Custom color')).toHaveLength(1)- view.rerender(<ChatColor attrs={{ value: requested }} locked={false} messageId="color-1" />)- expect($accentOverride.get()).toBe(requested)- fireEvent.change(screen.getByLabelText('Custom color'), { target: { value: picked } })- view.unmount()-- const replay = render(<ChatColor attrs={{ value: requested }} locked={false} messageId="color-1" />)- expect($accentOverride.get()).toBe(picked)- replay.rerender(<ChatColor attrs={{ value: requested }} locked={false} messageId="color-2" />)- expect($accentOverride.get()).toBe(requested)- replay.rerender(<ChatColor attrs={{ value: 'not-a-color' }} locked={false} messageId="color-3" />)- expect(loadAnswers().accent).toBe(requested)- act(() => setOnboardingAnswers({ committed: [...loadAnswers().committed, 'look'] }))- replay.rerender(<ChatColor attrs={{ value: picked }} locked={false} messageId="color-4" />)- expect(loadAnswers().accent).toBe(requested)-})diff --git a/apps/desktop/src/components/onboarding-chat/cards/setup.tsx b/apps/desktop/src/components/onboarding-chat/cards/setup.tsxindex 83e20003213..95c0e69b54b 100644--- a/apps/desktop/src/components/onboarding-chat/cards/setup.tsx+++ b/apps/desktop/src/components/onboarding-chat/cards/setup.tsx@@ -1,9 +1,3 @@-/**- * The three setup cards: accent, connectors, and layout. The accent and layout picks apply as soon as they are- * clicked; the connector picks are only recorded. The option lists come from onboarding-chat/options.tsx, so the cards- * and the previews stay in agreement without the model listing the options.- */-import { useStore } from '@nanostores/react'import { Puzzle } from 'lucide-react'import { useEffect, useMemo, useState } from 'react'@@ -52,14 +46,10 @@ interface ConnectorPicksProps {plugins: OnboardingPlugin[]}-/** The picks themselves, fed by ConnectorsCard. Plugins lead the one group (NS-960 D1). */export function ConnectorPicks({ catalog, commit, done, locked, plugins }: ConnectorPicksProps) {const answers = useStore($onboardingAnswers)const [query, setQuery] = useState('')- // Only what the gateway carries. A pick is a slug the build chat can hand- // straight to manage_connections; a name the gateway does not carry would be- // a pick the build chat cannot honour.const rows = useMemo(() => (catalog.status === 'ready' ? orderConnectorPicks(catalog.rows) : []), [catalog])const search = query.trim().toLowerCase()@@ -93,8 +83,6 @@ export function ConnectorPicks({ catalog, commit, done, locked, plugins }: Connereturn `apps I use, not connected yet: ${apps}${tools ? `; plugins picked, not installed yet: ${tools}` : ''}`}- // Nothing to pick from: the toolset is off or the gateway is unreachable.- // The step still has to end, so the card offers Skip.if (plugins.length === 0 && (catalog.status === 'unavailable' || (catalog.status === 'ready' && rows.length === 0))) {return (<CardFrame@@ -166,9 +154,6 @@ export function ConnectorPicks({ catalog, commit, done, locked, plugins }: Conne</div></>)}- {/* Picking is a preference, not an authorization: nothing is signed into- here. Saying so is what keeps the Connect cards later from reading as- a second ask for the same thing. */}<p className="text-xs text-muted-foreground"><strong className="font-medium text-foreground">Nothing connects or installs yet.</strong> Hermes will offer tolink these, or install a plugin, when a task needs them, and asks first.@@ -212,12 +197,10 @@ export function LookCard({ attrs, locked, messageId }: CardProps) {if (requested && receipt && !answers.committed.includes(receipt)) {pickAccent(requested, receipt)} else {- // Restore an unfinished choice without replaying a historical directive over a newer pick.setAccentOverride(answers.accent)}}, [answers.accent, answers.committed, done, locked, receipt, requested])- // Chat choices update the existing picker; they do not create a second question card.if (attrs.value !== undefined) {return null}@@ -243,17 +226,12 @@ export function LookCard({ attrs, locked, messageId }: CardProps) {export function LayoutCard({ locked }: CardProps) {const answers = useStore($onboardingAnswers)const { commit, done } = useCardCommit('layout')- // The stored answer defaults to 'basic', so nothing renders selected and Continue stays disabled until the user- // clicks. The flag lives in a store because applying the picked layout replaces the pane tree and remounts this- // card, which would clear local state.const picked = useStore($chatLayoutPicked)const pickLayout = (id: string) => {$chatLayoutPicked.set(true)setOnboardingAnswers({ layout: id })- // The pick answers "how much of the machinery do you want to see" too;- // Skip leaves the mode alone, so only an actual choice sets it.const layout = LAYOUTS.find(candidate => candidate.id === id)const preset = registry.getArea('layouts').find(contribution => contribution.id === id)@@ -262,11 +240,6 @@ export function LayoutCard({ locked }: CardProps) {return}- // Every pick goes through assembly, including re-picks. The first pick grows the window and places the panes,- // holding the chat and the cursor over this card at the same screen position; later picks rearrange in place.- // Swapping only the preset tree on a re-pick kept the previous layout's dismissals and dock records, and the two- // layouts came up mixed together.- // SAFETY: Layout presets declare data: LayoutNode (pane-shell/tree/presets.ts).assembleChatOnboarding(preset.id, preset.data as LayoutNode, layout?.mode)}diff --git a/apps/desktop/src/components/onboarding-chat/chip.tsx b/apps/desktop/src/components/onboarding-chat/chip.tsxindex f06dbc79368..b4575ad3e27 100644--- a/apps/desktop/src/components/onboarding-chat/chip.tsx+++ b/apps/desktop/src/components/onboarding-chat/chip.tsx@@ -2,15 +2,12 @@ import type { ReactNode } from 'react'import { cn } from '@/lib/utils'-/** One selection style for every pickable element in the shell: chips, connector cards, and layout cards. */export const selectableClass = (on: boolean) =>cn('border text-foreground transition-colors',on ? 'border-primary bg-primary/15' : 'border-transparent bg-muted hover:bg-accent/60')-/** Toggleable chip for the guided cards. ConnectorsCard uses the default `card` variant for its connector rows;- * FirstBuildCard uses the compact `pill` variant. */export function Chip({className,icon,diff --git a/apps/desktop/src/components/onboarding-chat/directive.tsx b/apps/desktop/src/components/onboarding-chat/directive.tsxindex 0731139dd0b..7c05fd8c722 100644--- a/apps/desktop/src/components/onboarding-chat/directive.tsx+++ b/apps/desktop/src/components/onboarding-chat/directive.tsx@@ -1,9 +1,3 @@-/**- * Dispatcher for the `::onboarding{step="…"}` transcript directive, which turns a setup step into an interactive- * picker in the transcript. Two tables decide what a step does: one writes an answer to the store, the other renders- * a card. A step in neither table renders nothing. The cards live in ./cards.- */-import { useAuiState } from '@assistant-ui/react'import { useStore } from '@nanostores/react'import { useEffect } from 'react'@@ -14,8 +8,6 @@ import type { CardProps } from '@/components/onboarding-chat/cards/frame'import { ConnectorsCard, LayoutCard, LookCard } from '@/components/onboarding-chat/cards/setup'import { $onboardingAnswers, setOnboardingAnswers } from '@/store/onboarding-answers'-/** Steps that only carry data, mapped to the answer field each one writes. The runbook names the context step- * 'working' (store/onboarding-script.ts), so the step name and the field name differ. */type AnswerField = 'name' | 'context'const DATA_STEPS = new Map<string, AnswerField>([@@ -23,7 +15,6 @@ const DATA_STEPS = new Map<string, AnswerField>([['working', 'context']])-/** Unrecognized steps are silent, including the greeting acknowledgement. */const STEP_CARDS = new Map<string, (props: CardProps) => React.ReactNode>([['connectors', ConnectorsCard],['first', FirstBuildCard],@@ -33,8 +24,6 @@ const STEP_CARDS = new Map<string, (props: CardProps) => React.ReactNode>([['progress', ProgressCard]])-/** Writes the answer from an effect. Writing it during the directive's render triggered React's cross-component- * setState warning and re-entrant renders. */function DataDirective({ field, value }: { field: AnswerField; value: string }) {useEffect(() => {if (!value || $onboardingAnswers.get()[field] === value) {@@ -63,7 +52,5 @@ export function OnboardingChatDirective({ attrs, streaming }: { attrs: Record<stconst Card = STEP_CARDS.get(step)- // Mount as soon as the directive is parsed. Returning null until the turn settles would grow the transcript by a- // card when the turn finishes. The card stays inert while streaming so the growing paragraph cannot be clicked.return Card ? <Card attrs={attrs} locked={streaming} messageId={identity} /> : null}diff --git a/apps/desktop/src/components/onboarding-chat/first-build.ts b/apps/desktop/src/components/onboarding-chat/first-build.tsindex bab4fb239ef..4d21853e079 100644--- a/apps/desktop/src/components/onboarding-chat/first-build.ts+++ b/apps/desktop/src/components/onboarding-chat/first-build.ts@@ -1,45 +1,21 @@-/**- * Progress check-ins during the first build.- *- * Setup hands the first task to a session of its own and then stops. This module counts that session's tool- * calls and sets `$setupCheckIn` at two of them; the wiring turns each one into a hidden `[setup]` note in the- * same session, which asks the agent to say where the work stands and what the user wants next. The note- * arrives in the chat the user is already reading. A cron job would not.- *- * Two rules limit the check-ins:- *- * - A note is set only between turns, on `message.complete`. A note set mid-turn would become a synthetic- * user message inside an assistant turn, which the agent core's role alternation forbids.- * - No note when the turn already ended with a question. The runbook has the agent ask for a verdict after- * the first pass, and a check-in under that ask puts two questions to the user at once.- */-import { atom } from 'nanostores'import { segmentTranscriptDirectives } from '@/lib/transcript-directives'-/** Tool call counts at which Setup checks in: the first once the build is visibly under way, the second far- * enough in that asking whether the work is still what the user wanted is a real question. */const CHECK_IN_AT = [8, 20] as constconst CHECK_IN_NOTE ='[setup] checkpoint — the user has been watching you work for a while and has not said anything. Before you carry on, say in ONE short line where the work actually stands right now, then end the turn with ::ask{question="What do you want next?" options="…|…|…"} alone as its own paragraph, with two or three options drawn from what would genuinely help here (keep going, change direction, explain something, stop). Emit the ask exactly in that shape. Do not summarize everything you have done, do not apologize for the interruption, and never mention this note.'interface FirstBuild {- /** Profile of the build session. The note must be routed to this profile explicitly: the user can return to- * Setup's chat while the build runs, which makes the setup profile the active gateway. */profile: stringsessionId: stringtools: number- /** Highest CHECK_IN_AT tool count already used, not a timestamp. */checkedInAt: number}let build: FirstBuild | null = null-/** Set when a check-in is due. The wiring submits the note to the build's session as a hidden `[setup]` note.- * The token changes on every check-in, so a second check-in with the same note is not read as a duplicate- * value. */export const $setupCheckIn = atom<null | { note: string; profile: string; sessionId: string; token: number }>(null)let token = 0@@ -48,13 +24,6 @@ export function watchFirstBuild(sessionId: string, profile: string): void {build = { checkedInAt: 0, profile, sessionId, tools: 0 }}-export function resetFirstBuildForTests(): void {- build = null- token = 0- $setupCheckIn.set(null)-}--/** Called from the gateway stream on tool.complete. */export function reportFirstBuildToolComplete(sessionId: null | string | undefined): void {if (!build || build.sessionId !== sessionId) {return@@ -63,8 +32,6 @@ export function reportFirstBuildToolComplete(sessionId: null | string | undefinebuild.tools += 1}-/** Called from the gateway stream on message.complete, the only point where a note may be set. The module- * header explains the role alternation rule behind that. */export function reportFirstBuildTurnComplete(sessionId: null | string | undefined, finalText: string): void {const current = build@@ -74,9 +41,6 @@ export function reportFirstBuildTurnComplete(sessionId: null | string | undefineconst due = CHECK_IN_AT.filter(at => current.tools >= at && at > current.checkedInAt).pop()- // Skip the check-in when the turn ended with a question, either the runbook's verdict ask or one the agent- // chose, so the user can answer it. endsInAsk parses the directives instead of matching text, so an `::ask`- // the agent only described in prose does not count.if (due === undefined || endsInAsk(finalText)) {return}diff --git a/apps/desktop/src/components/onboarding-chat/gate.test.tsx b/apps/desktop/src/components/onboarding-chat/gate.test.tsxdeleted file mode 100644index 5301987bf5b..00000000000--- a/apps/desktop/src/components/onboarding-chat/gate.test.tsx+++ /dev/null@@ -1,83 +0,0 @@-import { act, cleanup, render, screen, waitFor } from '@testing-library/react'-import { afterEach, expect, it, vi } from 'vitest'--import { I18nProvider } from '@/i18n'--afterEach(() => {- cleanup()- vi.unstubAllGlobals()-})--it('starts the skipped-film splash before the backend connects and removes it only after adoption', async () => {- vi.resetModules()- vi.stubGlobal('hermesDesktop', { guestOnboardingEnabled: true, skipIntro: true })- const { IntroRevealGate } = await import('@/components/intro-reveal')- const { OnboardingChatGate } = await import('./gate')- const { $onboardingGate } = await import('@/store/onboarding-gate')- const { $desktopOnboarding } = await import('@/store/onboarding')- $onboardingGate.set({ phase: 'idle', guideQueued: false, guideKickoff: 'idle' })- $desktopOnboarding.set({ ...$desktopOnboarding.get(), firstRunSkipped: false })-- let complete = (_ready: boolean) => {}-- const pending = new Promise<boolean>(resolve => {- complete = resolve- })-- const kickoff = vi.fn(() => pending)-- const request = async () => {- throw new Error('No provider notice available')- }-- const view = (enabled: boolean) => (- <I18nProvider>- <IntroRevealGate enabled={enabled} />- <OnboardingChatGate enabled={enabled} onKickoff={kickoff} requestGateway={request} />- </I18nProvider>- )-- const { rerender } = render(view(false))- expect(screen.getByRole('status').textContent).toMatch(/Starting Hermes/)- expect(kickoff).not.toHaveBeenCalled()- rerender(view(true))- await waitFor(() => expect(kickoff).toHaveBeenCalledOnce())- expect(screen.getByRole('status')).toBeTruthy()- await act(async () => {- complete(true)- await pending- })- expect(screen.queryByRole('status')).toBeNull()- expect($onboardingGate.get().guideKickoff).toBe('started')-})--it.each(['refused', 'rejected'])('restores the ordinary app after %s startup', async outcome => {- vi.resetModules()- vi.stubGlobal('hermesDesktop', { guestOnboardingEnabled: true, skipIntro: true })- const { OnboardingChatGate } = await import('./gate')- const { $onboardingGate } = await import('@/store/onboarding-gate')- const { $chatOnboardingSolo } = await import('./assembly')- $onboardingGate.set({ phase: 'cinematic', guideQueued: true, guideKickoff: 'idle' })-- const kickoff = vi.fn(async () => {- if (outcome === 'rejected') {- throw new Error('Backend unavailable')- }-- return false- })-- const request = async () => {- throw new Error('No provider notice available')- }-- render(- <I18nProvider>- <OnboardingChatGate enabled onKickoff={kickoff} requestGateway={request} />- </I18nProvider>- )- await waitFor(() => expect($onboardingGate.get().phase).toBe('skipped'))- expect(screen.queryByRole('status')).toBeNull()- expect($chatOnboardingSolo.get()).toBe(false)- expect(kickoff).toHaveBeenCalledOnce()-})diff --git a/apps/desktop/src/components/onboarding-chat/gate.tsx b/apps/desktop/src/components/onboarding-chat/gate.tsxindex 766fe5f5f40..5c54f26ddad 100644--- a/apps/desktop/src/components/onboarding-chat/gate.tsx+++ b/apps/desktop/src/components/onboarding-chat/gate.tsx@@ -1,12 +1,17 @@import { useStore } from '@nanostores/react'-import { useEffect } from 'react'+import { useEffect, useLayoutEffect } from 'react'import { endChatOnboardingSolo, takeGuideShape } from '@/components/onboarding-chat/assembly'import { isOnboardingEnabled } from '@/lib/onboarding-enabled'import { ackFreeTierNotice, type FreeTierRequester } from '@/store/free-tier'-import { $introReveal } from '@/store/intro-reveal'-import { clearFreeTierIntro } from '@/store/onboarding'-import { $guideOpening, $onboardingGate, runGuideKickoff, skipGuide } from '@/store/onboarding-gate'+import { $desktopOnboarding, clearFreeTierIntro } from '@/store/onboarding'+import {+ $guideOpening,+ $onboardingGate,+ beginOnboardingFlow,+ runGuideKickoff,+ skipGuide+} from '@/store/onboarding-gate'import { GuideLoading } from './guide-loading'@@ -18,19 +23,14 @@ interface OnboardingChatGateProps {export function OnboardingChatGate({ enabled, onKickoff, requestGateway }: OnboardingChatGateProps) {const gate = useStore($onboardingGate)- const intro = useStore($introReveal)const opening = useStore($guideOpening)- // A guide is owed the moment the renderer knows it (cinematic with the film- // seen, or a relaunch mid-guide). Take the solo shape now, before the- // gateway opens. Otherwise the normal shell paints at full size for the- // seconds the backend takes to come up, and then snaps down to the guide.- useEffect(() => {- if (gate.guideQueued && intro.phase === 'hidden') {+ useLayoutEffect(() => {+ beginOnboardingFlow($desktopOnboarding.get().firstRunSkipped)++ if ($onboardingGate.get().guideQueued) {takeGuideShape()}- // Once, on mount: the queued flag is a boot fact, not a live signal.- // eslint-disable-next-line react-hooks/exhaustive-deps}, [])useEffect(() => {@@ -38,10 +38,6 @@ export function OnboardingChatGate({ enabled, onKickoff, requestGateway }: Onboareturn}- // The guide is the free tier's introduction, whichever way it opens: the- // film, or the guided chat directly when the film is skipped. Ack the- // one-time notice as soon as either takes the screen, or a readiness- // round mid-guide raises the ready screen over the conversation.const ack = () => {clearFreeTierIntro()void ackFreeTierNotice(requestGateway).then(acked => {@@ -51,27 +47,15 @@ export function OnboardingChatGate({ enabled, onKickoff, requestGateway }: Onboa})}- // subscribe also sees an intro started by the preceding sibling's effect.- const offIntro = $introReveal.subscribe(state => {- if (state.phase === 'playing') {- ack()- }- })-- const offGate = $onboardingGate.subscribe(state => {+ return $onboardingGate.subscribe(state => {if (state.phase === 'guided') {ack()}})-- return () => {- offIntro()- offGate()- }}, [enabled, requestGateway])useEffect(() => {- if (enabled && gate.guideQueued && intro.phase === 'hidden') {+ if (enabled && gate.guideQueued) {const recover = () => {endChatOnboardingSolo()skipGuide()@@ -83,7 +67,7 @@ export function OnboardingChatGate({ enabled, onKickoff, requestGateway }: Onboa}}, recover)}- }, [enabled, gate.guideQueued, intro.phase, onKickoff])+ }, [enabled, gate.guideQueued, onKickoff])return opening ? <GuideLoading /> : null}diff --git a/apps/desktop/src/components/onboarding-chat/guide-loading.test.tsx b/apps/desktop/src/components/onboarding-chat/guide-loading.test.tsxdeleted file mode 100644index dbf4655f147..00000000000--- a/apps/desktop/src/components/onboarding-chat/guide-loading.test.tsx+++ /dev/null@@ -1,55 +0,0 @@-import { act, cleanup, render, screen } from '@testing-library/react'-import { afterEach, expect, it, vi } from 'vitest'--import { I18nProvider } from '@/i18n'--import { GuideLoading } from './guide-loading'--afterEach(() => {- cleanup()- vi.unstubAllGlobals()-})--it.each([false, true])('keeps startup visible without chat controls (reduced motion: %s)', reducedMotion => {- vi.stubGlobal('matchMedia', () => ({- matches: reducedMotion,- addEventListener: () => {},- removeEventListener: () => {}- }))- let next: FrameRequestCallback | undefined- const cancel = vi.fn()- vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => {- next = callback-- return 1- })- vi.stubGlobal('cancelAnimationFrame', cancel)-- const { container, unmount } = render(- <I18nProvider>- <GuideLoading />- </I18nProvider>- )-- const status = screen.getByRole('status')- expect(status.getAttribute('aria-busy')).toBe('true')- expect(status.textContent).toMatch(/Starting Hermes Desktop/)- expect(container.querySelector('input, textarea, [contenteditable], button')).toBeNull()-- if (reducedMotion) {- expect(next).toBeUndefined()- expect(status.querySelector('img')).not.toBeNull()- } else {- const path = status.querySelector('path')- const before = path?.getAttribute('d')- act(() => next?.(performance.now() + 60_000))- expect(path?.getAttribute('d')).not.toBe(before)- expect(screen.getByRole('status')).toBe(status)- }-- unmount()-- if (!reducedMotion) {- expect(cancel).toHaveBeenCalled()- }-})diff --git a/apps/desktop/src/components/onboarding-chat/guide-loading.tsx b/apps/desktop/src/components/onboarding-chat/guide-loading.tsxindex ab3b3e9143b..c88d74fc2c7 100644--- a/apps/desktop/src/components/onboarding-chat/guide-loading.tsx+++ b/apps/desktop/src/components/onboarding-chat/guide-loading.tsx@@ -5,7 +5,6 @@ import { Loader } from '@/components/ui/loader'import { useMediaQuery } from '@/hooks/use-media-query'import { useI18n } from '@/i18n'-/** Stays independent of greeting discovery and transcript hydration. */export function GuideLoading() {const { t } = useI18n()const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)')diff --git a/apps/desktop/src/components/onboarding-chat/mode-layout.test.ts b/apps/desktop/src/components/onboarding-chat/mode-layout.test.tsdeleted file mode 100644index 7aa8313964f..00000000000--- a/apps/desktop/src/components/onboarding-chat/mode-layout.test.ts+++ /dev/null@@ -1,29 +0,0 @@-import { afterEach, expect, it, vi } from 'vitest'--afterEach(() => vi.unstubAllGlobals())--it('does not save the temporary onboarding layout as the Advanced workspace', async () => {- window.localStorage.clear()- vi.resetModules()- const grow = vi.fn()- vi.stubGlobal('hermesDesktop', { guestOnboardingEnabled: true, chatOnboarding: { grow } })- const { DEFAULT_TREE, BASIC_TREE, registerLayoutPresets } = await import('@/app/contrib/layout-presets')- const tree = await import('@/components/pane-shell/tree/store')- const mode = await import('@/store/interface-mode')- const panes = await import('@/store/panes')- const guide = await import('./assembly')- registerLayoutPresets()- tree.declareDefaultTree(DEFAULT_TREE, BASIC_TREE)- panes.setPaneWidthOverride('chat-sidebar', 310)- const sizes = structuredClone(panes.$paneStates.get())- const before = structuredClone(tree.$layoutTree.get())- guide.startChatOnboardingSolo()- expect(tree.$activePresetId.get()).toBe('chat-solo')- guide.assembleChatOnboarding('sidebar-left', BASIC_TREE, 'simple')- expect(mode.$interfaceMode.get()).toBe('simple')- expect(grow).toHaveBeenCalledOnce()- mode.setInterfaceMode('advanced')- expect(tree.$layoutTree.get()).toEqual(before)- expect(panes.$paneStates.get()).toEqual(sizes)- expect(tree.$activePresetId.get()).toBe('default')-})diff --git a/apps/desktop/src/components/onboarding-chat/onboarding-first-use.test.ts b/apps/desktop/src/components/onboarding-chat/onboarding-first-use.test.tsdeleted file mode 100644index 5eb7db52019..00000000000--- a/apps/desktop/src/components/onboarding-chat/onboarding-first-use.test.ts+++ /dev/null@@ -1,24 +0,0 @@-import { expect, it } from 'vitest'--import { buildFirstTaskRunbook } from '@/components/onboarding-chat/setup-profile'-import { DEFAULT_ANSWERS } from '@/store/onboarding-answers'-import { buildChatOnboardingSeedMessages, FIRST_USE_GUIDANCE } from '@/store/onboarding-script'--it('carries the same first-use guidance through the hidden guide and every first-task plan', () => {- expect(FIRST_USE_GUIDANCE).toBeTruthy()-- const greeting = 'What should I call you?'- const seeds = buildChatOnboardingSeedMessages(greeting)- expect(seeds.filter(seed => seed.display_kind !== 'hidden')).toEqual([{ role: 'assistant', content: greeting }])-- const prompts = [- seeds[0].content,- ...(['build', 'machine-setup', 'plugin'] as const).map(plan =>- buildFirstTaskRunbook('Organize my work', DEFAULT_ANSWERS, plan, '/tmp/example-plugins')- )- ]-- for (const prompt of prompts) {- expect(prompt.split(FIRST_USE_GUIDANCE)).toHaveLength(2)- }-})diff --git a/apps/desktop/src/components/onboarding-chat/options.tsx b/apps/desktop/src/components/onboarding-chat/options.tsxindex 3bb6ed33719..30c6621ae0b 100644--- a/apps/desktop/src/components/onboarding-chat/options.tsx+++ b/apps/desktop/src/components/onboarding-chat/options.tsx@@ -6,8 +6,6 @@ import { cn } from '@/lib/utils'import type { InterfaceMode } from '@/store/interface-mode'import { readableInk } from '@/themes/color'-// Curated leaders for the first-run picker. Other enabled catalog entries-// remain searchable, so newly deployed connectors need no client list update.export const CONNECTOR_LEAD_ORDER = ['gmail','googlecalendar',@@ -23,15 +21,8 @@ export const CONNECTOR_LEAD_ORDER = ['todoist']-// Connectors are the apps Hermes reads and acts on for the user. Chat channels-// (Discord, Telegram, WhatsApp) are how a user talks to Hermes; those live on-// the Messaging page, and offering them here as if they were data sources-// taught users the wrong thing about what "connect" does. The catalog-// carries them for the agent's sake; the first-run picker leaves them out.export const CONNECTOR_PICKER_HIDDEN = new Set(['discord', 'discordbot', 'microsoft_teams'])-// A row the gateway marks `enabled: false` is a toolkit the deployment has-// turned off; the agent cannot connect it, so the picker does not offer it.export function orderConnectorPicks<T extends { connector: string; enabled?: boolean }>(rows: T[]): T[] {const rank = new Map(CONNECTOR_LEAD_ORDER.map((slug, index) => [slug, index]))@@ -45,9 +36,6 @@ export function orderConnectorPicks<T extends { connector: string; enabled?: boo})}-// Each swatch sets the accent override, which `retintTheme` uses to repaint-// the active skin as soon as the swatch is clicked. Nous blue is the default-// and sets no override. Mono is black in light mode and white in dark mode.export const NOUS_ACCENT = '#0053fd'export const accentsFor = (dark: boolean): Array<{ hex: string; name: string }> => [@@ -75,7 +63,6 @@ export function AccentSwatch({onPick?: () => void}) {const className = cn(- // The border keeps the mono swatch visible when its colour matches the background.'relative inline-flex size-9 items-center justify-center rounded-full border border-foreground/15 transition-transform duration-150',!active && 'hover:scale-105')@@ -114,18 +101,10 @@ export function AccentSwatch({)}-// These mini trees copy the basic (BASIC_TREE) and terminal-deck-// (TERMINAL_TREE) presets in app/contrib/layout-presets.ts, drawn like the-// layout editor's thumbnails at a larger size.export type MiniNode = 1 | { dir: 'column' | 'row'; children: MiniNode[]; weights: number[] }export const ELITE_LAYOUT_ID = 'terminal-deck'-// Each pick is an arrangement AND an interface mode. First launch is the one-// place a single question can answer both: someone here to talk to Hermes-// should not have to find Simple mode afterwards, and a developer who asked-// for the terminal deck wants the tooling on. Basic applies Simple's own-// preset so its shelf shows the pick as active.export const LAYOUTS: Array<{ description: string; id: string; mode: InterfaceMode; name: string; tree: MiniNode }> = [{description: 'For talking to Hermes.',@@ -163,11 +142,6 @@ export function MiniTree({ node }: { node: MiniNode }) {)}-/**- * The window buttons on the preview, drawn the way this machine draws them, so the card matches the user's own window.- * `main.ts` makes the same split: macOS puts the traffic lights on the left (`trafficLightPosition`), every other- * platform puts monochrome native controls on the right (`titleBarOverlay`).- */function MiniWindowButtons() {if (IS_MAC) {return (@@ -179,8 +153,6 @@ function MiniWindowButtons() {)}- // Minimize, maximize, close. At 6 px the real glyphs are illegible, so each- // one is a plain shape: a bar, a box, and a cross.return (<span aria-hidden className="flex items-center justify-end gap-1.5 text-foreground/40"><span className="h-px w-1.5 bg-current" />diff --git a/apps/desktop/src/components/onboarding-chat/persisted-handoff.ts b/apps/desktop/src/components/onboarding-chat/persisted-handoff.tsindex 565ef7926cf..eb44893566e 100644--- a/apps/desktop/src/components/onboarding-chat/persisted-handoff.ts+++ b/apps/desktop/src/components/onboarding-chat/persisted-handoff.ts@@ -3,12 +3,6 @@ import type { SessionHistoryResult } from '@hermes/shared'import { segmentTranscriptDirectives } from '@/lib/transcript-directives'import { requestGatewayForAgent } from '@/store/gateway'-/**- * The handoff directive as the backend persisted it for the welcome chat. The build session is named and seeded- * from these attrs, so they come from the stored reply, not the renderer's streamed copy of it: on Windows the- * streamed copy once repeated its own chunks ("Set up mySet up my games…") while the stored reply was intact, and- * the handoff carried the garbled task and brief into the new session. Null when no persisted reply holds one.- */export async function readPersistedHandoff(connectionId: null | string,profile: string,diff --git a/apps/desktop/src/components/onboarding-chat/plugins-runbook.test.ts b/apps/desktop/src/components/onboarding-chat/plugins-runbook.test.tsdeleted file mode 100644index 3cc7611fa7c..00000000000--- a/apps/desktop/src/components/onboarding-chat/plugins-runbook.test.ts+++ /dev/null@@ -1,37 +0,0 @@-import { describe, expect, it } from 'vitest'--import { buildFirstTaskRunbook, pluginsRunbook } from '@/components/onboarding-chat/setup-profile'-import type { DesktopMachineProfile } from '@/global'-import { $machine } from '@/store/machine'-import { DEFAULT_ANSWERS } from '@/store/onboarding-answers'-import { forkOptions } from '@/store/onboarding-script'--describe('plugins in the handoff runbook', () => {- it('adds nothing when no plugin was picked', () => {- expect(pluginsRunbook(DEFAULT_ANSWERS)).toBe('')- expect(buildFirstTaskRunbook('Organize my work', DEFAULT_ANSWERS)).not.toContain('PLUGINS FROM ONBOARDING')- })-})--it('offers the NVIDIA games pill only where its plugins run, and Blender everywhere', () => {- const machine: DesktopMachineProfile = {- ageDays: 400,- arch: 'x64',- locale: 'en-US',- model: 'PC',- nvidia: true,- platform: 'win32',- release: '10',- username: 'sid'- }-- $machine.set(machine)- expect(forkOptions()).toEqual(- expect.arrayContaining(['Set up my games and streaming', 'Help me make something in Blender'])- )-- $machine.set({ ...machine, nvidia: false, platform: 'darwin' })- expect(forkOptions()).toContain('Help me make something in Blender')- expect(forkOptions()).not.toContain('Set up my games and streaming')- $machine.set(null)-})diff --git a/apps/desktop/src/components/onboarding-chat/setup-profile.ts b/apps/desktop/src/components/onboarding-chat/setup-profile.tsindex 82c929c970f..f8846986509 100644--- a/apps/desktop/src/components/onboarding-chat/setup-profile.ts+++ b/apps/desktop/src/components/onboarding-chat/setup-profile.ts@@ -1,15 +1,3 @@-/**- * The welcome chat that guided onboarding runs in, and the seed prompts for the first build session.- *- * The chat belongs to the setup profile, which the backend creates and marks (`onboarding.ensure_setup_profile`), so it- * survives onboarding and can be found again. `setup` is the internal name throughout this module (the atoms, the hidden `[setup]` notes); the user- * sees only Hermes and the title `Welcome to Hermes`.- *- * This module holds the pure pieces: names, souls, seed prompts, and the handoff request atom. The side effects- * (session.create, the chat switch) run in the wiring's kickoff and handoff effects, which hold the- * gateway and session hooks.- */-import { atom } from 'nanostores'import type { ProfileScope } from '@/api/client'@@ -24,14 +12,10 @@ import { readOnboardingCapabilities } from '@/store/onboarding-capabilities'import { FIRST_USE_GUIDANCE, PLAIN_SPEECH } from '@/store/onboarding-script'import { getSessionOwnerHint } from '@/store/session'-/** Title of the welcome chat, and the row the user sees in the sessions list. Kickoff re-finds the chat by exact- * title after a relaunch, so this string is also a lookup key. */export const SETUP_CHAT_TITLE = 'Welcome to Hermes'export type SetupHandoffPhase = 'done' | 'error' | 'opening' | 'pending'-/** Which runbook planRunbook() selects for the first build session. Set from the plan attribute on the model's- * handoff directive. */export type HandoffPlan = 'build' | 'machine-setup' | 'plugin'const HANDOFF_PLANS: readonly HandoffPlan[] = ['build', 'machine-setup', 'plugin']@@ -51,13 +35,9 @@ export interface SetupHandoffState {sessionTitle?: string}-/** Set by HandoffCard, or restored from a saved receipt by the wiring's recovery effect. The wiring's handoff effect- * then advances phase. Null until the model emits the handoff directive. */export const $setupHandoff = atom<null | SetupHandoffState>(null)export const $handoffError = atom<string | null>(null)-/** Called only by the Retry control in HandoffCard and by the "Retry first build" toast, so a re-rendered handoff- * directive cannot clear the error. */export function retrySetupHandoff(): void {const state = $setupHandoff.get()@@ -69,8 +49,6 @@ export function retrySetupHandoff(): void {$setupHandoff.set({ ...state, phase: 'pending' })}-/** Identifies the welcome chat that issued the handoff. The handoff wiring submits the completion note to this- * session, not to whichever session is active when the build starts. */export interface SetupSession {connectionId: null | stringprofile: string@@ -80,8 +58,6 @@ export interface SetupSession {export const $setupSession = atom<null | SetupSession>(null)-/** Returns null for the ambient profile route. Returning 'local' instead would retarget a legacy remote primary onto- * this machine. */export function guideSourceConnectionId(guideStoredId: null | string | undefined): null | string {return (guideStoredId && getSessionOwnerHint(guideStoredId)?.connectionId) || activeGatewayConnectionId() || null}@@ -96,7 +72,6 @@ export function readGuideHandoffReceipt(guideStoredId: string): { key: string; rreturn { key, receipt: readHandoffReceipt(key) }}-/** The request atom suppresses remounts; only an accepted receipt suppresses relaunches. */export function requestSetupHandoff(task: string, brief: string, plan: HandoffPlan, guide: SetupSession): boolean {if ($setupHandoff.get() !== null ||@@ -110,11 +85,6 @@ export function requestSetupHandoff(task: string, brief: string, plan: HandoffPlreturn true}-export function resetSetupHandoffForTests(): void {- $setupHandoff.set(null)- $setupSession.set(null)-}-export function firstTaskTitle(task: string): string {const trimmed = task.trim()@@ -131,8 +101,6 @@ export function buildFirstTaskRunbook(const name = (answers.name ?? '').trim()const context = (answers.context ?? '').trim()const tools = (answers.connectors ?? []).filter(slug => CONNECTOR_LEAD_ORDER.includes(slug))- // Machine setup needs no account anywhere; every other plan connects the- // picked apps before it does anything else (D85).const connectFirst = tools.length > 0 && plan !== 'machine-setup'return [@@ -165,9 +133,6 @@ export function buildFirstTaskRunbook(const NO_AUTH_RULE ='CRITICAL: this first build must be finishable with NO external account or OAuth (no Gmail, no Slack, no Google sign-in) — connectors get wired only with their consent, and an app that is already connected may be used, one that is not may be offered. Everything else is fair game and the more visible the better: web research with the browser shown to the user as you work, scripts, computer use, a small app, a file-based tracker, a scheduled reminder, a generated page. If the idea needs an account that is not connected, build the no-auth core first and offer the connection as the next step. NEVER route around a connector: an unconnected Gmail is not a cue to install an IMAP client, ask for an app password, or find another way into the same account. The connector IS the way in; if they decline it, the app is out of this build.'-/** The picks are gateway slugs the user chose during setup. The connection operation owns the wait: one call, one- * card, and the settled result is the go signal (D85). The card carries Try again and Continue, so neither is a model- * action. */function connectFirstRunbook(picks: string[]): string[] {const named = picks.map(slug => `${slug} (${connectorTitle(slug)})`).join(', ')@@ -181,8 +146,6 @@ function connectFirstRunbook(picks: string[]): string[] {]}-/** What the guide's install card settled (NS-960 D6). This session has no install tool by design (#119491), so- * it never retries: it uses what is installed and names what is not. Empty when nothing was picked. */export function pluginsRunbook(answers: Pick<OnboardingAnswers, 'pluginOutcomes' | 'plugins'>): string {const outcomes = answers.pluginOutcomes ?? {}const names = [...new Set([...(answers.plugins ?? []), ...Object.keys(outcomes)])]@@ -221,8 +184,6 @@ export function pluginsRunbook(answers: Pick<OnboardingAnswers, 'pluginOutcomes'.join(' ')}-/** The machine-setup runbook. The audit comes before the plan because a plan written before looking is how an agent- * installs a second copy of something, or "fixes" drivers that were already correct. */const MACHINE_SETUP_RUNBOOK = ['THIS IS A MACHINE SETUP JOB: get this computer genuinely ready to use, end to end, with the terminal. It is the one first task that does not need an account anywhere — never send them to a sign-in to complete it.','START BY LOOKING, NOT PLANNING. Before proposing anything, use the terminal to find out what is actually here: OS name and version, architecture, pending system updates, free disk, which package manager exists (Homebrew / winget / apt / dnf), and which everyday things are already installed (a browser, an editor, git, python, node, docker, and whatever tools they mentioned earlier). On an NVIDIA machine also check the GPU and driver (nvidia-smi) and whether a container runtime and CUDA toolchain are present. Report what you found in a few short lines — plainly, no tables.',@@ -235,7 +196,6 @@ const MACHINE_SETUP_RUNBOOK = ['FINISH with a few lines: what changed, what you skipped and why, and what is left for them. If a reboot is needed, say so plainly.']-/** The plugin runbook. The save-time reload it promises is implemented in src/contrib/runtime-loader.ts. */const pluginRunbook = (root: string) => ['THIS IS A PLUGIN JOB: the thing you are building is a piece of the Hermes app itself, and it will appear in the window the user is looking at right now. That is the whole point — do not let it become a script in a folder.',`A plugin is ONE file: \`${root}/<name>/plugin.js\`. Plain ESM, no build step, no package.json, no install. It imports from \`@hermes/plugin-sdk\` and calls \`jsx()\` from \`react/jsx-runtime\` directly (there is no JSX compiler in this path — writing \`<div>\` will not work). It default-exports \`{ id, name, register(ctx) }\` and \`register\` calls \`ctx.register({ id, area, order, render })\`. The runtime loads it the moment you save, and reloads it on every later save, so there is no restart to ask them for.`,@@ -245,7 +205,6 @@ const pluginRunbook = (root: string) => ['Never ask them to restart the app, never edit anything outside their plugin folder, and never touch the Hermes install itself. If the plugin errors on load, the app toasts it and keeps running — read the error, fix the file, save again.']-/** A new HandoffPlan takes effect only once it has a case here. */function planRunbook(plan: HandoffPlan, pluginRoot: string, connectFirst: boolean): string[] {switch (plan) {case 'machine-setup':@@ -256,8 +215,6 @@ function planRunbook(plan: HandoffPlan, pluginRoot: string, connectFirst: booleathrow new Error('The desktop plugin folder is unavailable. Retry before starting the first build.')}- // With no picks NO_AUTH_RULE still applies: a plugin that needs an API key on its first run is as- // unfinishable as any other first build that needs an account.return connectFirst ? pluginRunbook(pluginRoot) : [...pluginRunbook(pluginRoot), NO_AUTH_RULE]default:@@ -265,8 +222,6 @@ function planRunbook(plan: HandoffPlan, pluginRoot: string, connectFirst: boolea}}-/** Prefixes MACHINE_SETUP_RUNBOOK with machineDescription(), so the agent does not spend its first turns finding out- * what the app already reports. */function machineSetupRunbook(): string[] {const description = machineDescription()@@ -275,8 +230,6 @@ function machineSetupRunbook(): string[] {: MACHINE_SETUP_RUNBOOK}-/** Seed rows for the build session's session.create: the hidden runbook only. The task brief is submitted as a real- * turn right after, and that is what starts the build. */export async function buildFirstTaskSeedMessages(task: string,answers: OnboardingAnswers,@@ -298,8 +251,6 @@ export async function buildFirstTaskSeedMessages(]}-/** The hidden note sent to the welcome chat once the build session is live. The check-ins after it come from the- * build's own progress, in first-build.ts. */export function buildHandoffCompleteNote(task: string): string {return `[setup] handoff complete — "${task.trim()}" is now building in its own session on the default profile, and the user is watching it there. The app is showing them a short tour of the profile rail and the sessions list right now, so do not describe either. Say ONE short line and then stop: you're around if they want a hand, and this chat stays where it is. Do not ask a question, do not offer a list, do not schedule anything.`}diff --git a/apps/desktop/src/components/onboarding-chat/signpost.ts b/apps/desktop/src/components/onboarding-chat/signpost.tsindex d71122ffb6e..912e444152d 100644--- a/apps/desktop/src/components/onboarding-chat/signpost.ts+++ b/apps/desktop/src/components/onboarding-chat/signpost.ts@@ -1,23 +1,8 @@-/**- * The handoff tour: three steps shown when the build session first appears, because the profile changed under- * the user without their asking. The user was talking to Hermes on its own profile and now sits mid-build in a- * session of their own. Nothing on screen says where the welcome chat went, or that the sessions list now- * belongs to a different profile.- *- * The guide cannot describe this itself: the tour bridge only runs a tour for the session the user is looking- * at, and after the handoff the guide is a background session (desktop AGENTS.md requires offering rather than- * taking over). The app runs the same three steps instead, in the user's language, and the guide's own note in- * the welcome chat does not mention them.- */import { translateNow } from '@/i18n'-/** Tour handles (`data-tour`). A targets scan returns these same selectors, so a curated step and a- * model-driven step point at the same node. */const RAIL = '[data-tour="profile-rail"]'const SESSIONS = '[data-tour="sessions-sidebar"]'-/** Waits for a visible node. The profile rail mounts a render or two after the handoff switches profiles, and- * the tour engine returns a no-match for a selector that is not in the DOM yet. Returns false on timeout. */async function waitFor(selector: string, timeoutMs = 6000): Promise<boolean> {const deadline = Date.now() + timeoutMs@@ -38,7 +23,6 @@ async function waitFor(selector: string, timeoutMs = 6000): Promise<boolean> {return false}-/** The caller does not await this, so the tour does not delay the handoff. */export async function showHandoffTour(): Promise<void> {if (!(await waitFor(RAIL))) {return@@ -46,8 +30,6 @@ export async function showHandoffTour(): Promise<void> {const sessionsVisible = await waitFor(SESSIONS, 1500)const copy = (key: string) => translateNow(`handoffTour.${key}`)- // Imported here instead of at the top: this module is reachable from the boot path through the handoff- // hook, and run-tour.ts keeps driver.js and its stylesheet out of that path.const { startTour } = await import('@/lib/tour')await startTour([diff --git a/apps/desktop/src/components/onboarding-chat/skip.tsx b/apps/desktop/src/components/onboarding-chat/skip.tsxindex e3cb34c1ac1..eef731a15f7 100644--- a/apps/desktop/src/components/onboarding-chat/skip.tsx+++ b/apps/desktop/src/components/onboarding-chat/skip.tsx@@ -1,10 +1,3 @@-/**- * Skips the guided setup. Rendered in the composer's floating strip, the same row as the action badges and the- * suggestion pills, so it aligns with the composer's edges. Skipping assembles the basic layout, sets the onboarding- * phase to skipped, and leaves the user in the full app; the guided chat stays in the transcript. Shown from guide- * kickoff until the layout pick assembles the app ($chatOnboardingSolo).- */-import { useStore } from '@nanostores/react'import { $chatOnboardingSolo, skipChatOnboarding } from '@/components/onboarding-chat/assembly'diff --git a/apps/desktop/src/components/onboarding/index.tsx b/apps/desktop/src/components/onboarding/index.tsxindex f0ccccbaf36..1bd1649ea8e 100644--- a/apps/desktop/src/components/onboarding/index.tsx+++ b/apps/desktop/src/components/onboarding/index.tsx@@ -16,7 +16,6 @@ import { cn } from '@/lib/utils'import { $desktopBoot, type DesktopBootState } from '@/store/boot'import { $freeTierStatus, FREE_TIER_MODEL, freeTierSetupFailure } from '@/store/free-tier'import { openFreeTierSignIn } from '@/store/free-tier-sign-in'-import { $introReveal, shouldPlayFirstRunIntro } from '@/store/intro-reveal'import { $setupReadyTick } from '@/store/live-sync'import { $localModelsEnabled } from '@/store/local-models-flag'import {@@ -207,7 +206,6 @@ export function DesktopOnboardingOverlay({const { t } = useI18n()const onboarding = useStore($desktopOnboarding)const boot = useStore($desktopBoot)- const introReveal = useStore($introReveal)useStore($onboardingSurfaces)const onCompletedRef = useRef(onCompleted)onCompletedRef.current = onCompleted@@ -354,10 +352,7 @@ export function DesktopOnboardingOverlay({}}, [ctx, onboarding.flow.status, onboarding.manual, onboarding.providers])- if (- !onboarding.manual &&- (introReveal.phase !== 'hidden' || onboardingSurfaceActive() || shouldPlayFirstRunIntro(onboarding.firstRunSkipped))- ) {+ if (!onboarding.manual && onboardingSurfaceActive()) {return null}diff --git a/apps/desktop/src/components/overlay-error-boundary.tsx b/apps/desktop/src/components/overlay-error-boundary.tsxindex e1a96aba932..8c146157a20 100644--- a/apps/desktop/src/components/overlay-error-boundary.tsx+++ b/apps/desktop/src/components/overlay-error-boundary.tsx@@ -6,8 +6,7 @@ import { Component, type ErrorInfo, type ReactNode } from 'react'* Same job as `ErrorBoundary`, none of its weight. That one renders the app's* rich fallback, so importing it pulls `Button`, `ErrorState` and the i18n* provider — the app shell these windows exist to avoid, and which their own- * docs claim they don't load. Under the dev server that chain WAS most of the- * intro cinematic's module graph, queued ahead of the surface trying to paint.+ * docs claim they don't load.** An overlay also has nowhere to put a fallback and nobody to click Retry: it* is a see-through window over the user's desktop. So a failure rendersdiff --git a/apps/desktop/src/global.d.ts b/apps/desktop/src/global.d.tsindex c9c85946b97..c44ef0720ab 100644--- a/apps/desktop/src/global.d.ts+++ b/apps/desktop/src/global.d.ts@@ -116,14 +116,6 @@ declare global {grow: (request: GrowRequest) => voidsoloBoot: () => void}- introReveal?: {- open: (payload?: { hideMain?: boolean }) => Promise<{ ok: boolean }>- close: (payload?: { showMain?: boolean }) => Promise<{ ok: boolean }>- skip: () => void- ready: () => void- onSkip: (callback: () => void) => () => void- onClosed: (callback: () => void) => () => void- }// The pop-out pet overlay: a transparent always-on-top window hosting only// the mascot. The main renderer drives it (open/close/drag + state push);// the overlay sends control messages back (pop-in, composer submit).@@ -365,9 +357,6 @@ declare global {guestOnboardingEnabled?: boolean/** Sanitized local `display.skin`, available before any gateway connects. */localSkin?: { profile: string; skin: HermesSkin } | null- /** Launch flag: skip the first-run film (HERMES_SKIP_INTRO=1 or- * --skip-intro) so a fresh HERMES_HOME lands on the guided chat. */- skipIntro?: booleansetTranslucency?: (payload: TranslucencyState) => voidsetKeepAwake?: (on: boolean) => voidminimizeToTray?: {diff --git a/apps/desktop/src/lib/onboarding-enabled.ts b/apps/desktop/src/lib/onboarding-enabled.tsindex 29b3373c5af..39985a4f9f7 100644--- a/apps/desktop/src/lib/onboarding-enabled.ts+++ b/apps/desktop/src/lib/onboarding-enabled.ts@@ -1,4 +1,3 @@-/** The preload launch flag is the only gate for guided onboarding. */export function isOnboardingEnabled(): boolean {return window.hermesDesktop?.guestOnboardingEnabled === true}diff --git a/apps/desktop/src/lib/onboarding-recommendations.test.ts b/apps/desktop/src/lib/onboarding-recommendations.test.tsdeleted file mode 100644index 5202aec5c2c..00000000000--- a/apps/desktop/src/lib/onboarding-recommendations.test.ts+++ /dev/null@@ -1,81 +0,0 @@-import { expect, it } from 'vitest'--import { orderConnectorPicks } from '@/components/onboarding-chat/options'-import { onboardingRecommendations } from '@/lib/onboarding-recommendations'-import type { McpCatalogEntry } from '@/types/hermes'--it('keeps new enabled managed apps searchable without disturbing the curated leaders', () => {- const next = { connector: 'new-reviewed-app', enabled: true }- const lead = { connector: 'gmail', enabled: true }- const disabled = { connector: 'disabled-app', enabled: false }- const channel = { connector: 'discord', enabled: true }- expect(orderConnectorPicks([next, disabled, channel, lead])).toEqual([lead, next])-})--function entry(name: string, patch: Partial<McpCatalogEntry> = {}): McpCatalogEntry {- return {- name,- description: `${name} integration`,- source: 'https://example.test',- transport: 'stdio',- auth_type: 'none',- required_env: [],- command: 'example',- args: [],- url: null,- install_url: null,- install_ref: null,- bootstrap: [],- default_enabled: null,- post_install: 'Enable the app integration.',- needs_install: false,- installed: false,- enabled: false,- suggest: {- keywords: [name],- hosts: [],- applications: [name],- examples: [`Make something in ${name}`],- requires_app: true- },- ...patch- }-}--it('recommends catalog entries from evidence and intent, never from installation as proof of access', () => {- const future = entry('future-paint', { suggest: null, detected_apps: ['Future Paint'] })- expect(onboardingRecommendations([future])).toMatchObject([- {- name: future.name,- description: future.description,- examples: [],- setupAction: 'install'- }- ])- expect(onboardingRecommendations([])).toEqual([])- const local = entry('modeler', { detected_apps: ['Modeler'] })- const newEntry = entry('future-studio', { detected_apps: ['Future Studio'] })- const longerExample = 'Describe the lighting and materials in my scene before suggesting a different render treatment'- newEntry.suggest!.examples!.push(longerExample)- const absent = entry('missing-studio')- const disabled = entry('paused-studio', { installed: true, detected_apps: ['Paused Studio'] })- const configured = entry('notes', { installed: true, enabled: true })- const rows = [absent, disabled, configured, local, newEntry]-- const suggestions = onboardingRecommendations(rows)- expect(new Set(suggestions.map(row => row.name))).toEqual(new Set([newEntry.name, local.name, configured.name]))- expect(suggestions[0].name).toBe(configured.name)- expect(suggestions.every(row => row.examples.length === 1)).toBe(true)- expect(onboardingRecommendations(rows, { context: 'Use future studio' })[0].examples).toContain(longerExample)- expect(suggestions.map(row => row.readiness)).not.toContain('connected')- expect(suggestions.find(row => row.name === local.name)).toMatchObject({- readiness: 'setup_required',- detectedApps: ['Modeler'],- setupAction: 'install'- })- expect(suggestions.find(row => row.name === configured.name)?.setupAction).toBeNull()- expect(onboardingRecommendations(rows, { context: 'Use paused studio' })[0].setupAction).toBe('enable')- expect(suggestions.find(row => row.name === configured.name)?.readiness).toBe('configured_unverified')- expect(onboardingRecommendations(rows, { context: 'Help with my notes' })[0].name).toBe(configured.name)- expect(onboardingRecommendations([entry('legacy', { suggest: { keywords: ['legacy'], hosts: [] } })])).toEqual([])-})diff --git a/apps/desktop/src/lib/onboarding-recommendations.ts b/apps/desktop/src/lib/onboarding-recommendations.tsindex 0831a052f8c..58d8e1ae398 100644--- a/apps/desktop/src/lib/onboarding-recommendations.ts+++ b/apps/desktop/src/lib/onboarding-recommendations.ts@@ -23,7 +23,6 @@ const words = (text: string): string =>.filter(Boolean).join(' ')-/** Rank evidence, not a fixed list of products. The model derives outcomes from catalog descriptions; curated examples are optional. */export function onboardingRecommendations(entries: readonly McpCatalogEntry[],{ apps = [], context = '' }: OnboardingInterests = {}@@ -43,7 +42,6 @@ export function onboardingRecommendations(const detectedApps = entry.detected_apps ?? []const configured = entry.installed && entry.enabled- // An explicit task can request a disabled integration; mere discovery must not undo that choice.if (entry.installed && !entry.enabled && !preferred && !topical) {return []}diff --git a/apps/desktop/src/main.tsx b/apps/desktop/src/main.tsxindex 0e9b8cc2507..de7ba95e11c 100644--- a/apps/desktop/src/main.tsx+++ b/apps/desktop/src/main.tsx@@ -56,7 +56,7 @@ if (winParam === 'hud') {// window) and `browser` are ordinary opaque windows and are deliberately not// in here. index.html's pre-paint script skips exactly this list — keep the// two in step.-const TRANSPARENT_WINDOWS = new Set(['hud', 'overlay', 'quick', 'wake', 'intro'])+const TRANSPARENT_WINDOWS = new Set(['hud', 'overlay', 'quick', 'wake'])// Each transparent root used to force its host layers see-through when it// MOUNTED. That is far too late: `styles.css` above paints the theme's opaque@@ -78,8 +78,6 @@ if (winParam === 'overlay') {void import('./app/quick-entry/quick-entry-root').then(({ mountQuickEntry }) => mountQuickEntry())} else if (winParam === 'wake') {void import('./app/wake-indicator/wake-indicator-root').then(({ mountWakeIndicator }) => mountWakeIndicator())-} else if (winParam === 'intro') {- void import('./components/intro-reveal/intro-root').then(({ mountIntroReveal }) => mountIntroReveal())} else {// CSS animations do not inherit Chromium's JS-loop pause policy. Mirror the// main window's visibility state to :root so decorative infinitediff --git a/apps/desktop/src/store/guide-opening.test.ts b/apps/desktop/src/store/guide-opening.test.tsdeleted file mode 100644index 02ecd4e3386..00000000000--- a/apps/desktop/src/store/guide-opening.test.ts+++ /dev/null@@ -1,49 +0,0 @@-import { afterEach, expect, it, vi } from 'vitest'--afterEach(() => vi.unstubAllGlobals())--it('covers the pre-queue frame and a persisted guide until kickoff completes', async () => {- vi.stubGlobal('hermesDesktop', { guestOnboardingEnabled: true })- const { $guideOpening, $onboardingGate } = await import('./onboarding-gate')-- for (const phase of ['cinematic', 'guided'] as const) {- $onboardingGate.set({ phase, guideQueued: false, guideKickoff: 'idle' })- expect($guideOpening.get()).toBe(true)- $onboardingGate.set({ phase, guideQueued: true, guideKickoff: 'starting' })- expect($guideOpening.get()).toBe(true)- $onboardingGate.set({ phase, guideQueued: false, guideKickoff: 'started' })- expect($guideOpening.get()).toBe(false)- }-- $onboardingGate.set({ phase: 'skipped', guideQueued: false, guideKickoff: 'idle' })- expect($guideOpening.get()).toBe(false)-})--it('keeps the opening visible through a shared kickoff and settles only after the seed is durable', async () => {- vi.stubGlobal('hermesDesktop', { guestOnboardingEnabled: true })- const { $guideOpening, $onboardingGate, runGuideKickoff, skipGuide } = await import('./onboarding-gate')- $onboardingGate.set({ phase: 'cinematic', guideQueued: true, guideKickoff: 'idle' })-- let finishSeed: (ready: boolean) => void = () => {}-- const seed = new Promise<boolean>(resolve => {- finishSeed = resolve- })-- const kickoff = vi.fn(() => seed)- expect($guideOpening.get()).toBe(true)-- const first = runGuideKickoff(kickoff)- const second = runGuideKickoff(kickoff)- expect(first).toBe(second)- expect($onboardingGate.get().guideKickoff).toBe('starting')- expect($guideOpening.get()).toBe(true)- finishSeed(true)- await first- expect(kickoff).toHaveBeenCalledOnce()- expect($guideOpening.get()).toBe(false)- expect($onboardingGate.get().phase).toBe('guided')- skipGuide()- expect($guideOpening.get()).toBe(false)- vi.unstubAllGlobals()-})diff --git a/apps/desktop/src/store/intro-reveal.ts b/apps/desktop/src/store/intro-reveal.tsdeleted file mode 100644index 026af1a12dc..00000000000--- a/apps/desktop/src/store/intro-reveal.ts+++ /dev/null@@ -1,95 +0,0 @@-/**- * The phase lives in this store, in the main renderer; the clock runs in the native overlay, because- * animation frames in the hidden main window are throttled. Native skip and close events come back here, so- * every exit records the seen key and restores the main window.- *- * This store is the only writer of hermes-intro-reveal-seen-v1. First-run eligibility is guest onboarding- * enabled, not explicitly skipped, and not seen. The gate observes completion to queue the guided chat, so- * this store does not depend on the gate.- */-import { atom } from 'nanostores'--import { isOnboardingEnabled } from '@/lib/onboarding-enabled'-import { readKey, writeKey } from '@/lib/storage'-import { setOnboardingSurfaceActive } from '@/store/onboarding-presence'--const SEEN_KEY = 'hermes-intro-reveal-seen-v1'--export type IntroRevealPhase = 'hidden' | 'playing' | 'leaving'--export interface IntroRevealState {- phase: IntroRevealPhase-}--const INITIAL: IntroRevealState = { phase: 'hidden' }--export const $introReveal = atom<IntroRevealState>(INITIAL)--$introReveal.subscribe(state => setOnboardingSurfaceActive('intro', state.phase !== 'hidden'))--export function hasSeenIntroReveal(): boolean {- return readKey(SEEN_KEY) === '1'-}--/** The film will never play for this identity (HERMES_SKIP_INTRO). Record it- * as seen so a later launch without the flag cannot replay it over the- * guided flow that ran in its place. */-export function markIntroRevealSeen(): void {- writeKey(SEEN_KEY, '1')-}--export function isIntroRevealEnabled(): boolean {- return isOnboardingEnabled() && window.hermesDesktop?.skipIntro !== true-}--/** The guided flow is on but its intro film was turned off at launch- * (HERMES_SKIP_INTRO). Distinct from isIntroRevealEnabled(): false there also- * covers onboarding being off entirely, where nothing may queue. */-export function isIntroRevealSkipped(): boolean {- return isOnboardingEnabled() && window.hermesDesktop?.skipIntro === true-}--export function shouldPlayFirstRunIntro(firstRunSkipped: boolean): boolean {- return isIntroRevealEnabled() && !firstRunSkipped && !hasSeenIntroReveal()-}--export function startIntroReveal(): void {- if (!isIntroRevealEnabled() || $introReveal.get().phase !== 'hidden') {- return- }-- $introReveal.set({ phase: 'playing' })- // The overlay covers the desktop, so every exit path has to restore the main window.- void window.hermesDesktop?.introReveal?.open({ hideMain: true }).catch(finishIntroReveal)-}--export function leaveIntroReveal(): void {- if ($introReveal.get().phase === 'playing') {- $introReveal.set({ phase: 'leaving' })- }-}--export function finishIntroReveal(): void {- if ($introReveal.get().phase === 'hidden') {- return- }-- writeKey(SEEN_KEY, '1')- $introReveal.set(INITIAL)- // The gate's listener on that edge queues the guide and takes the solo- // shape (small window, greeting layout) synchronously, so the main window- // is already the guide when it is shown. Showing first and shrinking after- // is what flashed the full app between the film and the greeting.- void window.hermesDesktop?.introReveal?.close({ showMain: true }).catch(() => undefined)-}--export function installIntroRevealBridgeListeners(): () => void {- const bridge = window.hermesDesktop?.introReveal- const offSkip = bridge?.onSkip(leaveIntroReveal)- const offClosed = bridge?.onClosed(finishIntroReveal)-- return () => {- offSkip?.()- offClosed?.()- }-}diff --git a/apps/desktop/src/store/onboarding-answers.ts b/apps/desktop/src/store/onboarding-answers.tsindex ec4fe5431db..663a9d1ab60 100644--- a/apps/desktop/src/store/onboarding-answers.ts+++ b/apps/desktop/src/store/onboarding-answers.ts@@ -4,17 +4,10 @@ import { readJson, writeJson } from '@/lib/storage'export interface OnboardingAnswers {accent: null | string- /** Cards the user has already pressed Continue on. The card's own React- * state dies on every transcript reconcile (the hidden submit and the- * turn-end hydrate both rebuild the message list), so a Done button that- * lived there came back live and let the step be answered twice. */committed: string[]connectors: string[]context: string- /** Catalog plugin names picked on the connectors card. A pick is a wish, not an install. */plugins: string[]- /** The settled install card's result per plugin, written when the guide's manage_catalog card settles. A- * picked plugin with no entry was not offered for install (the chosen task did not need it). */pluginOutcomes: Record<string, PluginOutcome>name: stringlayout: string@@ -23,12 +16,10 @@ export interface OnboardingAnswers {export interface PluginOutcome {state: 'failed' | 'installed' | 'skipped'detail: string- /** The plugin's qualified skill name (`<plugin key>:<skill>`), the only name skill_view resolves. */skill: stringtools: string[]}-// Keep existing fork users' answers when they move to upstream.export const ANSWERS_KEY = 'hermes-onboarding-wizard-answers-v1'export const DEFAULT_ANSWERS: OnboardingAnswers = {@@ -45,8 +36,6 @@ export const DEFAULT_ANSWERS: OnboardingAnswers = {export function loadAnswers(): OnboardingAnswers {const raw = readJson<Partial<OnboardingAnswers>>(ANSWERS_KEY)- // Project the retained fields so retired wizard preferences cannot be sent- // to personalization or written back on the next answer.return {accent: raw?.accent ?? DEFAULT_ANSWERS.accent,committed: raw?.committed ?? [...DEFAULT_ANSWERS.committed],diff --git a/apps/desktop/src/store/onboarding-capabilities.test.ts b/apps/desktop/src/store/onboarding-capabilities.test.tsdeleted file mode 100644index c5b20b943df..00000000000--- a/apps/desktop/src/store/onboarding-capabilities.test.ts+++ /dev/null@@ -1,62 +0,0 @@-import { afterEach, expect, it, vi } from 'vitest'--import { readOnboardingCapabilities } from '@/store/onboarding-capabilities'-import { buildChatOnboardingSeedMessages } from '@/store/onboarding-script'--const api = vi.fn()--it('carries fresh catalog evidence into the guide, read from the pinned backend', async () => {- vi.stubGlobal('window', { hermesDesktop: { api } })-- const entry = {- name: 'future-studio',- auth_type: 'none',- installed: false,- enabled: false,- detected_apps: ['Future Studio'],- suggest: {- keywords: ['future studio'],- applications: ['Future Studio'],- examples: ['Make a scene in Future Studio'],- requires_app: true- }- }-- api.mockResolvedValue({- entries: [entry],- diagnostics: [],- discovery: { scope: 'backend', status: 'ok', platform: 'darwin' }- })- const scope = { connectionId: 'remote-studio', profile: 'default' }- const evidence = await readOnboardingCapabilities(scope)- const guide = buildChatOnboardingSeedMessages('Hi', true, evidence)- expect(guide[0].content).toContain('"name":"future-studio"')- expect(guide[0].content).toContain('"readiness":"setup_required"')- expect(guide[0].display_kind).toBe('hidden')- expect(api).toHaveBeenLastCalledWith(expect.objectContaining(scope))- expect(api.mock.calls.every(([request]) => request.path === '/api/mcp/catalog?detect_apps=true')).toBe(true)-})--afterEach(() => {- vi.unstubAllGlobals()- api.mockReset()-})--it('reads only the pinned backend and degrades safely on old or unavailable discovery', async () => {- vi.stubGlobal('window', { hermesDesktop: { api } })- const scope = { connectionId: 'remote-studio', profile: 'hermes-setup' }- api.mockResolvedValueOnce({ entries: [], diagnostics: [] })- expect(await readOnboardingCapabilities(scope)).toBe('')- expect(api).toHaveBeenCalledWith(- expect.objectContaining({- connectionId: scope.connectionId,- profile: scope.profile,- path: '/api/mcp/catalog?detect_apps=true',- timeoutMs: 5000- })- )-- api.mockRejectedValueOnce(new Error('Offline'))- expect(await readOnboardingCapabilities(scope)).toBe('')- expect(api).toHaveBeenCalledTimes(2)-})diff --git a/apps/desktop/src/store/onboarding-capabilities.ts b/apps/desktop/src/store/onboarding-capabilities.tsindex 62f2afc41b0..ff7103cfcba 100644--- a/apps/desktop/src/store/onboarding-capabilities.ts+++ b/apps/desktop/src/store/onboarding-capabilities.ts@@ -2,7 +2,6 @@ import type { ProfileScope } from '@/api/client'import { getMcpCatalog } from '@/api/mcp'import { type OnboardingInterests, onboardingRecommendations } from '@/lib/onboarding-recommendations'-/** A bounded, read-only seed snapshot. No global cache and no connection authority. */export async function readOnboardingCapabilities(scope?: ProfileScope,interests?: OnboardingInterests@@ -30,7 +29,6 @@ export async function readOnboardingCapabilities('Derive useful tasks from the actual catalog descriptions and the user’s stated work and app choices. Curated examples are optional; their absence must not hide an otherwise relevant catalog entry. Never invent an integration absent from the catalog. Detection earns at most one option per app; do not turn its example into several variants. The rest of the menu comes from the user’s goals and other capabilities. More options within one app are appropriate only when explicitly requested. Do not replace the fresh-machine or Spark setup fork. Keep a connection-free choice. Carry the exact MCP name in the handoff brief when one of these tasks is chosen; the task session uses manage_connections with name and mcp:true.'].join(' ')} catch {- // An older/unreachable catalog must not block the existing welcome or handoff path.return ''}}diff --git a/apps/desktop/src/store/onboarding-gate.test.ts b/apps/desktop/src/store/onboarding-gate.test.tsdeleted file mode 100644index 1c9d0485cef..00000000000--- a/apps/desktop/src/store/onboarding-gate.test.ts+++ /dev/null@@ -1,74 +0,0 @@-import { expect, it, vi } from 'vitest'--import type * as storageModule from '@/lib/storage'--const storage = vi.hoisted(() => new Map<string, string>())--vi.mock('@/lib/onboarding-enabled', () => ({ isOnboardingEnabled: () => true }))-vi.mock('@/lib/storage', async importOriginal => ({- ...(await importOriginal<typeof storageModule>()),- readKey: (key: string) => storage.get(key) ?? null,- writeKey: (key: string, value: string | null) => {- if (value === null) {- storage.delete(key)- } else {- storage.set(key, value)- }- }-}))--it('restores every persisted onboarding phase and rejects unknown phases', async () => {- const { ONBOARDING_PHASES } = await import('./onboarding-gate')-- for (const phase of ONBOARDING_PHASES.filter(phase => phase !== 'idle')) {- storage.clear()- storage.set('hermes-onboarding-phase-v1', phase)- vi.resetModules()- const { $onboardingGate } = await import('./onboarding-gate')-- expect($onboardingGate.get().phase).toBe(phase)- }-- storage.set('hermes-onboarding-phase-v1', 'unknown-phase')- vi.resetModules()- const { $onboardingGate } = await import('./onboarding-gate')-- expect($onboardingGate.get().phase).toBe('idle')-})--it('a skipped intro still queues the guided flow, and never replays the film', async () => {- const { beginOnboardingFlowWithoutIntro } = await import('./onboarding-gate')- const { hasSeenIntroReveal } = await import('./intro-reveal')-- storage.clear()- beginOnboardingFlowWithoutIntro(false)- const { $onboardingGate } = await import('./onboarding-gate')-- expect($onboardingGate.get()).toEqual({ phase: 'cinematic', guideQueued: true, guideKickoff: 'idle' })- // The film is recorded as watched: a later launch without HERMES_SKIP_INTRO- // must adopt the persisted guide, not play the film over it.- expect(hasSeenIntroReveal()).toBe(true)-- // A relaunch boots loadGate() over the same persisted state and re-queues the guide.- vi.resetModules()- const { $onboardingGate: relaunched } = await import('./onboarding-gate')-- expect(relaunched.get().guideQueued).toBe(true)- expect(relaunched.get().phase).toBe('cinematic')-})--it('a skipped intro does nothing when onboarding is off or the first run was skipped', async () => {- vi.doMock('@/lib/onboarding-enabled', () => ({ isOnboardingEnabled: () => false }))- vi.resetModules()- const off = await import('./onboarding-gate')-- off.beginOnboardingFlowWithoutIntro(false)- expect(off.$onboardingGate.get().phase).toBe('idle')-- vi.doUnmock('@/lib/onboarding-enabled')- vi.resetModules()- const on = await import('./onboarding-gate')-- on.beginOnboardingFlowWithoutIntro(true)- expect(on.$onboardingGate.get().phase).toBe('idle')-})diff --git a/apps/desktop/src/store/onboarding-gate.ts b/apps/desktop/src/store/onboarding-gate.tsindex dea0e9510ae..40b17f2b645 100644--- a/apps/desktop/src/store/onboarding-gate.ts+++ b/apps/desktop/src/store/onboarding-gate.ts@@ -4,12 +4,11 @@ import { isOnboardingEnabled } from '@/lib/onboarding-enabled'import { readKey, writeKey } from '@/lib/storage'import { $gateway } from './gateway'-import { $introReveal, hasSeenIntroReveal, markIntroRevealSeen } from './intro-reveal'import { DEFAULT_ANSWERS, setOnboardingAnswers } from './onboarding-answers'const PHASE_KEY = 'hermes-onboarding-phase-v1'-export const ONBOARDING_PHASES = ['idle', 'cinematic', 'guided', 'skipped', 'handoff', 'done'] as const+export const ONBOARDING_PHASES = ['idle', 'pending', 'guided', 'skipped', 'handoff', 'done'] as constexport type OnboardingPhase = (typeof ONBOARDING_PHASES)[number]@@ -30,15 +29,9 @@ function loadGate(): OnboardingGateState {const phase = isOnboardingEnabled() && isOnboardingPhase(saved) ? saved : 'idle'- // Two phases owe a kickoff at boot. `cinematic` with the film already seen- // is the film-to-guide seam. `guided` is a relaunch mid-guide: without a- // kickoff the normal app boots around the persisted solo layout (the- // connected splash, the stock composer and model picker, a small window- // whose sidebars cannot open) while the gate still says the guide is on.- // The kickoff adopts the existing guide chat by title, so nothing is lost.return {phase,- guideQueued: (phase === 'cinematic' && hasSeenIntroReveal()) || phase === 'guided',+ guideQueued: phase === 'pending' || phase === 'guided',guideKickoff: 'idle'}}@@ -47,12 +40,9 @@ export const $onboardingGate = atom<OnboardingGateState>(loadGate())let guideKickoff: GuideKickoff = { status: 'idle' }export const $guideOpening = computed(- [$onboardingGate, $introReveal],- (gate, intro) =>- isOnboardingEnabled() &&- (gate.phase === 'cinematic' || gate.phase === 'guided') &&- intro.phase === 'hidden' &&- gate.guideKickoff !== 'started'+ $onboardingGate,+ gate =>+ isOnboardingEnabled() && (gate.phase === 'pending' || gate.phase === 'guided') && gate.guideKickoff !== 'started')function setGuideKickoff(state: GuideKickoff): void {@@ -65,53 +55,21 @@ function setPhase(phase: OnboardingPhase): void {$onboardingGate.set({ ...$onboardingGate.get(), phase, guideQueued: false })}-/** The guided first launch is on screen or mid-handoff. Ambient chrome that- * would send the user elsewhere (the provider picker, the free-tier chip)- * yields to it: the free tier IS the provider for those phases, and the- * guide's ready screen is where sign-in is offered. */export function guidedOnboardingActive(): boolean {const { phase } = $onboardingGate.get()- return isOnboardingEnabled() && (phase === 'cinematic' || phase === 'guided' || phase === 'handoff')+ return isOnboardingEnabled() && (phase === 'pending' || phase === 'guided' || phase === 'handoff')}-export function beginOnboardingFlow(): void {- if (isOnboardingEnabled() && $onboardingGate.get().phase === 'idle' && !hasSeenIntroReveal()) {- setPhase('cinematic')- }-}--/** The guided first launch without its intro film (HERMES_SKIP_INTRO). Same- * eligibility as the film path minus the film itself: the film is recorded as- * watched and the film-to-guide seam fires immediately, instead of waiting- * for a completion that never comes. */-export function beginOnboardingFlowWithoutIntro(firstRunSkipped: boolean): void {- if (!isOnboardingEnabled() || firstRunSkipped) {+export function beginOnboardingFlow(firstRunSkipped: boolean): void {+ if (!isOnboardingEnabled() || firstRunSkipped || $onboardingGate.get().phase !== 'idle') {return}- beginOnboardingFlow()-- // A prior launch quit mid-film and left the phase at cinematic; the guide- // is owed directly. Everything else (guided/skipped/handoff/done) already- // had its turn and must not re-queue.- if ($onboardingGate.get().phase !== 'cinematic') {- return- }-- markIntroRevealSeen()- queueGuideAfterIntro()-}--export function queueGuideAfterIntro(): void {- const state = $onboardingGate.get()-- if (isOnboardingEnabled() && state.phase === 'cinematic' && !state.guideQueued && hasSeenIntroReveal()) {- $onboardingGate.set({ ...state, guideQueued: true })- }+ setPhase('pending')+ $onboardingGate.set({ ...$onboardingGate.get(), guideQueued: true })}-/** The kickoff returns true only after the guided session's seed is durable. */export function runGuideKickoff(kickoff: () => Promise<boolean>): Promise<boolean> {if (!isOnboardingEnabled()) {return Promise.resolve(false)@@ -129,15 +87,13 @@ export function runGuideKickoff(kickoff: () => Promise<boolean>): Promise<booleareturn Promise.resolve(false)}- // Defer the callback until the shared promise is installed, including for- // callers that re-enter synchronously while starting the session.const promise = Promise.resolve().then(kickoff).then(started => {setGuideKickoff({ status: started ? 'started' : 'idle' })- if (started && $onboardingGate.get().phase === 'cinematic') {+ if (started && $onboardingGate.get().phase === 'pending') {setPhase('guided')}@@ -163,7 +119,6 @@ export function beginOnboardingHandoff(): void {}}-/** Called when the handoff receipt is accepted. */export function completeOnboardingFlow(): void {if (isOnboardingEnabled() && $onboardingGate.get().phase === 'handoff') {setPhase('done')@@ -173,12 +128,11 @@ export function completeOnboardingFlow(): void {export function skipGuide(): void {const { phase } = $onboardingGate.get()- if (isOnboardingEnabled() && (phase === 'cinematic' || phase === 'guided')) {+ if (isOnboardingEnabled() && (phase === 'pending' || phase === 'guided')) {setPhase('skipped')}}-/** Resets the backend's setup profile in place, then the local flow state. */export async function devResetOnboardingFlow(): Promise<void> {if (!import.meta.env.DEV) {returndiff --git a/apps/desktop/src/store/onboarding-never-forces-sign-in.test.ts b/apps/desktop/src/store/onboarding-never-forces-sign-in.test.tsdeleted file mode 100644index 539a5a2857d..00000000000--- a/apps/desktop/src/store/onboarding-never-forces-sign-in.test.ts+++ /dev/null@@ -1,68 +0,0 @@-/**- * The free tier is unmetered and the guided first launch never demands an- * account. This is the acceptance criterion the guided onboarding was built- * to, as a test rather than a memory: a user can work through the guide and- * the first build, tool call after tool call, and the only way a sign-in- * reaches them is the guide's own ready screen at the moment the guide picks.- * Every surface that could push a sign-in over the guide — the provider- * picker, the deferred credential warning, the free-tier ready screen — has- * to yield while the gate is cinematic, guided or handoff.- */-import { expect, it, vi } from 'vitest'--import type * as storageModule from '@/lib/storage'--const storage = vi.hoisted(() => new Map<string, string>())--vi.mock('@/lib/onboarding-enabled', () => ({ isOnboardingEnabled: () => true }))-vi.mock('@/lib/storage', async importOriginal => ({- ...(await importOriginal<typeof storageModule>()),- readKey: (key: string) => storage.get(key) ?? null,- writeKey: (key: string, value: string | null) => {- if (value === null) {- storage.delete(key)- } else {- storage.set(key, value)- }- }-}))--async function load(phase: string) {- storage.clear()- storage.set('hermes-onboarding-phase-v1', phase)- vi.resetModules()-- const gate = await import('./onboarding-gate')- const onboarding = await import('./onboarding')-- return { gate, onboarding }-}--it.each(['cinematic', 'guided', 'handoff'])('the provider picker never opens over the guide (%s)', async phase => {- const { onboarding } = await load(phase)-- onboarding.requestDesktopOnboarding('No inference provider is configured.')-- expect(onboarding.$desktopOnboarding.get().requested).toBe(false)-})--it.each(['cinematic', 'guided', 'handoff'])(- 'a credential warning during the guide is dropped, not deferred (%s)',- async phase => {- const { onboarding } = await load(phase)-- onboarding.requestDesktopOnboardingForCredentialWarning(- "No API key configured for provider 'nous'. First message will fail."- )-- expect(onboarding.consumePendingCredentialWarning()).toBeNull()- }-)--it.each(['idle', 'skipped', 'done'])('outside the guide the picker opens as before (%s)', async phase => {- const { onboarding } = await load(phase)-- onboarding.requestDesktopOnboarding('No inference provider is configured.')-- expect(onboarding.$desktopOnboarding.get().requested).toBe(true)-})diff --git a/apps/desktop/src/store/onboarding-plugin-outcomes.test.ts b/apps/desktop/src/store/onboarding-plugin-outcomes.test.tsdeleted file mode 100644index 81ce5d95e70..00000000000--- a/apps/desktop/src/store/onboarding-plugin-outcomes.test.ts+++ /dev/null@@ -1,65 +0,0 @@-import { expect, it } from 'vitest'--import type { CatalogEntry, ConnectionRequest, ConnectionTarget } from '@/store/connection-request'-import { pluginOutcomesFrom } from '@/store/onboarding-plugin-outcomes'--const row = (- name: string,- state: ConnectionTarget['state'],- kind: ConnectionTarget['kind'] = 'plugin'-): ConnectionTarget => ({- action: 'install',- connectionId: '',- connectUrl: null,- detail: state === 'failed' ? 'nope' : '',- discoveryError: null,- instructions: null,- kind,- name,- requiredEnv: [],- state,- tools: state === 'connected' ? ['mcp__x__y'] : []-})--const catalog = (skill: string): CatalogEntry => ({- appState: null,- description: '',- display: '',- hasDesktopHalf: false,- platforms: [],- repo: null,- requirements: [],- scan: null,- sha: null,- skill,- subdir: null,- targetProfile: 'default',- tier: null-})--const request = (settled: boolean, targets: ConnectionTarget[]): ConnectionRequest => ({- deadlineAt: 1,- opId: 'op',- seq: 1,- sessionId: 's',- settled,- settledBy: settled ? 'continue' : null,- targets,- toolCallId: 't'-})--it('maps a settled card to installed / failed / skipped per plugin row, whether or not the user acted', () => {- const targets = [- { ...row('a', 'connected'), catalog: catalog('agent-plugin-a:a') },- row('b', 'failed'),- row('c', 'pending'),- row('gmail', 'connected', 'connector')- ]-- expect(pluginOutcomesFrom(request(false, targets))).toBeNull()- expect(pluginOutcomesFrom(request(true, targets))).toEqual({- a: { detail: '', skill: 'agent-plugin-a:a', state: 'installed', tools: ['mcp__x__y'] },- b: { detail: 'nope', skill: '', state: 'failed', tools: [] },- c: { detail: '', skill: '', state: 'skipped', tools: [] }- })-})diff --git a/apps/desktop/src/store/onboarding-plugin-outcomes.ts b/apps/desktop/src/store/onboarding-plugin-outcomes.tsindex b264b5b71d5..3bb84aefea2 100644--- a/apps/desktop/src/store/onboarding-plugin-outcomes.ts+++ b/apps/desktop/src/store/onboarding-plugin-outcomes.ts@@ -1,9 +1,3 @@-/**- * Carries the guide's install card result to the handoff (NS-960 D6). The guide calls manage_catalog once,- * as the last beat before handoff; when that card settles, each plugin row's outcome is written into the- * onboarding answers so the build session's runbook can say what is ready and what was offered and not- * installed. The build agent has no install tool, so this record is the only way it learns either.- */import type { ConnectionRequest, ConnectionTarget } from '@/store/connection-request'import { $connectionRequests } from '@/store/connection-request'import { $onboardingAnswers, type PluginOutcome, setOnboardingAnswers } from '@/store/onboarding-answers'@@ -15,7 +9,6 @@ const OUTCOME = { connected: 'installed', failed: 'failed' } as const satisfiesconst outcomeState = (state: ConnectionTarget['state']): PluginOutcome['state'] =>state === 'connected' || state === 'failed' ? OUTCOME[state] : 'skipped'-/** Plugin rows of a settled card, keyed by catalog name. Null while the card is open or has no plugin row. */export function pluginOutcomesFrom(request: ConnectionRequest): null | Record<string, PluginOutcome> {if (!request.settled) {return null@@ -40,7 +33,6 @@ export function pluginOutcomesFrom(request: ConnectionRequest): null | Record<st)}-/** Record outcomes from the guide session's cards. Returns the unsubscribe. */export function watchPluginOutcomes(guideRuntimeId: () => null | string | undefined): () => void {return $connectionRequests.subscribe(requests => {const id = guideRuntimeId()diff --git a/apps/desktop/src/store/onboarding-plugins.ts b/apps/desktop/src/store/onboarding-plugins.tsindex c09ad73922c..a46edc8d92d 100644--- a/apps/desktop/src/store/onboarding-plugins.ts+++ b/apps/desktop/src/store/onboarding-plugins.ts@@ -1,10 +1,3 @@-/**- * The catalog plugins the onboarding card offers beside the hosted connectors (NS-960 D1, D4).- *- * The backend decides which entries are curated (`onboarding: true`) and which this OS runs, and judges- * each app from the plugin's pinned declaration (`plugins.manage action=onboarding`). The card only- * orders and draws them. A failed or missing RPC is an empty list: the connectors half still works.- */import type { OnboardingCatalogPlugin } from '@hermes/shared'import { useQuery } from '@tanstack/react-query'@@ -16,7 +9,6 @@ import { isSessionOwnerRoute } from '@/store/session-request-router'export type OnboardingPlugin = OnboardingCatalogPlugin-/** A plugin whose app is not on this machine stays pickable; the row says what is missing (D5). */export const pluginNeedsApp = (plugin: OnboardingPlugin): boolean => plugin.app_state === 'missing_app'async function readOnboardingPlugins(storedId: string): Promise<OnboardingPlugin[]> {@@ -41,7 +33,6 @@ async function readOnboardingPlugins(storedId: string): Promise<OnboardingPluginconst pluginsKey = (storedId: null | string) => ['onboarding', 'plugins.manage:onboarding', storedId] as const-/** Started with the guide session, like the connector read. */export function prefetchOnboardingPlugins(storedId: string): void {void queryClient.prefetchQuery({queryFn: () => readOnboardingPlugins(storedId),@@ -50,7 +41,6 @@ export function prefetchOnboardingPlugins(storedId: string): void {})}-/** Cached per session like the connector read, so the card's remounts keep the rows. */export function useOnboardingPlugins(storedId: null | string): OnboardingPlugin[] {const query = useQuery({enabled: Boolean(storedId),diff --git a/apps/desktop/src/store/onboarding-presence.ts b/apps/desktop/src/store/onboarding-presence.tsindex f48c5ff7042..c7718613b53 100644--- a/apps/desktop/src/store/onboarding-presence.ts+++ b/apps/desktop/src/store/onboarding-presence.ts@@ -1,9 +1,6 @@-/** Keeps ambient UI from covering onboarding without importing the- * intro-reveal and guided-chat dependency chains into leaf stores. */-import { atom } from 'nanostores'-export type OnboardingSurface = 'intro' | 'solo-chat'+export type OnboardingSurface = 'solo-chat'const EMPTY: ReadonlySet<OnboardingSurface> = new Set()@@ -30,7 +27,3 @@ export function setOnboardingSurfaceActive(surface: OnboardingSurface, active: bexport function onboardingSurfaceActive(): boolean {return $onboardingSurfaces.get().size > 0}--export function resetOnboardingPresenceForTests(): void {- $onboardingSurfaces.set(EMPTY)-}diff --git a/apps/desktop/src/store/onboarding-script.ts b/apps/desktop/src/store/onboarding-script.tsindex e015d392659..483a614952c 100644--- a/apps/desktop/src/store/onboarding-script.ts+++ b/apps/desktop/src/store/onboarding-script.ts@@ -1,11 +1,3 @@-/**- * The text Hermes sends during the guided first run: the runbook handed to the model at session.create, its persona,- * the voice rules, and the option pills.- *- * The runbook pins the option pill values exactly, because the app matches on that text. A pill the model invents- * cannot be interpreted downstream.- */-import {$machine,machineKind,@@ -18,12 +10,8 @@ import {const VOICE_RULES ='Voice rules for EVERYTHING you write: plain declaratives in active voice. No em dashes (use commas or periods). No exclamation marks. Never praise the user. No AI diction (delve, seamless, robust, crucial, pivotal, landscape, testament, elevate, empower). No "not just X, it\'s Y" constructions. No forced lists of three. No generic closers ("you\'re all set", "happy to help", "the future looks bright") — end on the last real point. Contractions are fine. Specifics over adjectives.'-/** Voice rules for the whole first run. setup-profile.ts appends this to the build session's runbook, so the guided- * chat and the build session use one copy. */export const PLAIN_SPEECH = `${VOICE_RULES} Keep every turn short. This is a chat, not a form: no headers, no bullet lists, no emoji, no restating their answer back at them before you reply to it, and none of "Great choice", "Perfect!", "Absolutely", "Certainly", "Great question", "Let me go ahead and". Read each line back as if you were saying it out loud to someone sitting beside you — say the thing itself, not a description of the thing. If it sounds like a form letter or a support macro, write it again.`-/** Seed rows for the guided chat's session.create: the hidden runbook row, then the greeting. Pass the greeting the- * client is already animating (pickOnboardingGreeting) so the stored row and the animation hold the same words. */export function buildChatOnboardingSeedMessages(greeting: string,signedIn = false,@@ -43,7 +31,6 @@ export function buildChatOnboardingSeedMessages(]}-/** Shared first-use guidance for the welcome chat and its task handoff. */export const FIRST_USE_GUIDANCE = ['Assume this is their first AI agent app. Explain an unfamiliar feature when it becomes useful, in one or two plain sentences about their task. Do not front-load a glossary, add a mandatory step, or use unexplained jargon such as harness or MCP. Once they understand a feature, stop explaining it.','Make the first meaningful learning save understandable. A memory carries a fact or preference into later chats in this profile; a skill holds reusable instructions for similar tasks. After a confirmed save, name the actual fact or procedure and its next-time benefit, not just "memory added" or "skill created". Mention once that they can ask to see, change, or remove it. Use the actual write result: failed or pending writes are not saved. Never invent learning, duplicate an onboarding save, create a demonstration skill, expose secrets, or claim the underlying model was retrained. Reuse relevant skills; do not repeat the primer on every write.',@@ -53,7 +40,6 @@ export const FIRST_USE_GUIDANCE = [const FORK_QUESTION = "Know what you'd like it to make?"-/** The fork's pills. Held as data because the runbook pins the same values and the app matches on the exact text. */const FORK_OPTIONS = {automate: 'Automate something I already do',figure: "Let's figure it out together",@@ -73,9 +59,6 @@ export interface PluginTask {const BLENDER_TASK: PluginTask = { label: 'Help me make something in Blender', plugins: ['blender'] }const NVIDIA_TASK: PluginTask = { label: 'Set up my games and streaming', plugins: ['nvidia-app', 'nvidia-broadcast'] }-/** The plugin-backed first tasks and the catalog plugins each installs. Blender runs on all three platforms; the- * NVIDIA App and Broadcast plugins are Windows-only, so the games and streaming job is offered only on a Windows- * PC with an NVIDIA GPU, and it leads there. */export function pluginForkOptions(): PluginTask[] {const machine = $machine.get()@@ -84,22 +67,14 @@ export function pluginForkOptions(): PluginTask[] {const SOMETHING_ELSE = 'Something else'-/** The look-around offer. The runbook places it in the turn after the layout step, because until the layout is- * applied the window holds only the chat pane and the tour would have nothing else to point at. */const TOUR_QUESTION = 'Want a look around first?'-/** The tour pills. The runbook lists them as basics, tour, none, so the short tour reads first; the object below is- * key-sorted. 'basics' and 'tour' both run the tour tool, and differ in length: three steps against four to six. */export const TOUR_OPTIONS = {basics: 'Quick tour',none: 'Skip, let’s build something',tour: 'Show me everything'} as const-/**- * Who the user is talking to. The rest of the runbook is mechanics and the voice rules are prohibitions, which can- * only remove things; without this block the model's turns read as a form letter.- */const PERSONA = ['WHO YOU ARE, in voice: the person at the front desk of somewhere good. Pleased they walked in, and not performing it. Quick, unhurried, never flustered. You make the next thing easy without making a production of it. You have opinions and you offer them lightly ("most people go with the second one"). You remember what they said and use it two beats later instead of repeating it back at them. A little dry humour is welcome when it lands on its own; never reach for it.','What that is NOT: chirpy, eager, apologetic, or formal. Do not thank them for answering. Do not tell them their choice was a good one. Do not announce what you are about to do before doing it. Do not ask if they are ready.',@@ -107,14 +82,8 @@ const PERSONA = ['You are allowed to be brief to the point of terse when the moment is just a card and a nudge. Most of these turns are one sentence. That is not coldness, it is not wasting their time, and it is the main way this reads as a person rather than a wizard.'] as const-/** The cards that wait on an answer, so the turn that places one ends there. RULE 3 lists them by name because a fast- * model reads the numbered steps as one script to run through and places two cards in a single message, which leaves- * two cards on screen, each waiting on an answer. */const QUESTION_CARDS = ['look', 'connectors', 'layout', 'first', 'handoff'].map(step => `::onboarding{step="${step}"}`)-/** The pills the runbook places at the fork. Setting the machine up is always offered, because it is the one first- * task that needs no account anywhere. When machineSetupLeads() is true it is the only offer, and the rest move- * behind "Something else". */export function forkOptions(): string[] {const { automate, figure, mind, skip } = FORK_OPTIONS@@ -123,15 +92,12 @@ export function forkOptions(): string[] {: [mind, automate, machineForkOption(), ...pluginForkOptions().map(task => task.label), figure, skip]}-/** What "Something else" opens onto. Empty when forkOptions() already listed every pill. */export function forkFallbackOptions(): string[] {const { automate, figure, mind, skip } = FORK_OPTIONSreturn machineSetupLeads() ? [mind, automate, ...pluginForkOptions().map(task => task.label), figure, skip] : []}-/** The install beat: the last thing before the handoff card, and the only place the guide installs (NS-960 D2, D3).- * The build session has no install tool, so a plugin the task needs must be in before the handoff. */function installBeat(tasks: PluginTask[]): string {const implied = tasks.map(task => `for "${task.label}", ${task.plugins.join(' and ')}`).join('; ')@@ -156,8 +122,6 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedI...PERSONA,FIRST_USE_GUIDANCE,capabilities,- // machineLanguageName() reports the OS language. The prompt uses that rather than the language of what the user- // typed, because the first turn answers a one-word name and carries no language signal....(language? [`This computer is set to ${language}, so write every visible word to them in ${language} — starting now, including the option pills you place. The greeting they have already seen was in ${language} too. If they write to you in a different language, follow THEM from that point on. Everything below describes what to say, not which language to say it in; the ::onboarding and ::ask directive names, their attribute names, and the exact option values pinned below stay verbatim in English because the app matches on them.`@@ -169,9 +133,6 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedI'RULE 1 — never think out loud. Every visible word you write is spoken TO the user. Never write "Let me check/re-read/reconsider", never recap what step you are on, never mention steps, directives, [setup], prompts, or any mechanics in visible text. When you use tools, visible text is at most ONE short sentence to the user before the work and one after. Planning happens silently or not at all — a message that narrates your process instead of talking to the user is a failure.','RULE 2 — images are welcome but never a surprise and never a delay: deliver the TEXT deliverable first, and only then, when a visual genuinely helps (a header image for an announcement, a mock for a page), you may generate ONE image — always introduced with a short line naming what you made and why ("I generated a header image for the announcement — swap or drop it"). Never let image generation stall or replace the text answer, never more than one per turn, and never for plain lists, plans, or checklists.',`RULE 3 — ONE question per turn, then stop. These hand control back to the user and END your turn the moment you write one: ${QUESTION_CARDS.join(', ')}, and every ::ask. Place exactly one, then stop: never ask the next thing in the same message, and never tell them what is coming. Their answer arrives as the next message, and that is what moves you forward. Two questions in one message is a failure: you asked something whose answer you have not heard yet, and they are looking at two half-answered cards stacked on top of each other. (::onboarding{step="name"} and ::onboarding{step="working"} are NOT questions — they render as nothing and only save what the user just told you, so they belong in the same turn as the question that follows them.)`,- // RULE 4 comes from a live run: after the user typed their name, the model made six API calls over thirty-six- // seconds writing the same fact to memory, and never reached the colour card. Nothing in the prompt said the save- // was already done, and a returned tool result reads to a fast model as a cue to speak again.'RULE 4 — the card beats carry NO tool calls. Placing an ::onboarding card is pure text plus the directive, nothing else: the directive itself is what saves the answer, so there is no tool to reach for. Never repeat an unchanged tool call after it has succeeded. A status check followed by connect, or discovering tools followed by using them, are different actions and are allowed. After a connection card settles, act on its result without opening another copy.','Your first message has ALREADY been sent for you: it greeted them and asked what you should call them. Do not greet again — their next message is their answer.',...(suggestedName@@ -183,8 +144,6 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedI'1. This turn is exactly four things and then you stop: a few warm words about their name, then ::onboarding{step="name" value="THEIR_NAME"} on a line of its own (THEIR_NAME being the name they actually gave; it renders as nothing and just saves it), then one short sentence about their colour, then ::onboarding{step="look"} on a line of its own. That is one turn, not two, and it is not a conflict with RULE 3: the name line is not a question, the look card is, and it is the last thing you write.','2. Then the apps they already use, so Hermes can connect to them later: one short sentence that makes clear what connecting means — you would read and act inside those apps for them (their inbox, their calendar, their repos), not message them there — then ::onboarding{step="connectors"} on a line of its own. The card may also lead with plugins: tools for this computer that Hermes installs and runs locally; picking one only records it, so say that in the same sentence when the card could show one. Chat apps like Discord or Telegram are a different thing (how they reach you) and are not what this card is asking about; if they bring one up, say it lives in Messaging in the app’s settings and move on.','CONNECTING, IF THEY ASK FOR IT HERE. The picks are preferences, not connections — but if at any point they ask you to connect an app, or say they want one wired up now, do it in this chat: call manage_connections action="status" once, then one action="connect" with EVERY app they named as a batch (connectors=["gmail","googlecalendar"], not one call per app). The app renders that as one card with a row per app and the call blocks until every app is connected, or the user presses Continue, or the deadline passes; never paste the links, never describe a settings page. The result lists each app as connected, skipped or not_connected; continue from that. Never call connect a second time for an app that already has a card. If an app is not in the status catalog, say so plainly. There is no Connectors page in Settings; do not send them to one.',- // The only place sign-in is named before it is needed. It sits at the connectors step because the user has just- // listed the accounts they use....(signedIn? []: [@@ -231,7 +190,6 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedI'Memory: the card beats need no memory tool. The ::onboarding lines persist their answers, and the handoff saves the agreed name, context and app preferences into their working profile for later conversations. Do not duplicate that write or narrate its mechanics.','Their picks arrive as invisible messages prefixed [setup] — acknowledge each in a few words, in your own words, never the same phrase twice, and move to the next step.',PLAIN_SPEECH,- // Kept last because a prompt that ends on the list of prohibitions produces flat, cautious turns.'Above all of that: someone just walked in and you are glad to see them. Sound like it.'].join(' ')}diff --git a/apps/desktop/vite.config.ts b/apps/desktop/vite.config.tsindex f313cdd13d7..a45b43d901f 100644--- a/apps/desktop/vite.config.ts+++ b/apps/desktop/vite.config.ts@@ -247,9 +247,6 @@ export default defineConfig(({ command }) => ({host: '127.0.0.1',port: 5174,strictPort: true,- warmup: {- clientFiles: ['./src/components/intro-reveal/intro-root.tsx']- },fs: {allow: fsAllow}diff --git a/hermes_cli/setup_profile.py b/hermes_cli/setup_profile.pyindex 6785bbb2690..a337c361bed 100644--- a/hermes_cli/setup_profile.py+++ b/hermes_cli/setup_profile.py@@ -1,10 +1,3 @@-"""The setup profile: where guided onboarding runs and the guide keeps checking in afterwards.--The backend owns it. One per home, found by ``role: setup`` in ``profile.yaml`` (the name is an-implementation detail). ``ensure_setup_profile`` creates it once and afterwards returns it as-is;-``reset_setup_profile`` restores the created state in place, keeping the directory, name and role.-"""-from __future__ import annotationsimport logging@@ -50,7 +43,6 @@ class SetupProfile(NamedTuple):def find_setup_profile() -> Optional[tuple[str, Path]]:- """``(name, path)`` of the profile carrying ``role: setup``, first by name; None when absent."""found = [(p.name, Path(p.path)) for p in profiles_mod.list_profiles(lazy_skill_count=True)if p.role == profiles_mod.SETUP_ROLE]if len(found) > 1:@@ -60,10 +52,6 @@ def find_setup_profile() -> Optional[tuple[str, Path]]:def ensure_setup_profile() -> SetupProfile:- """Create-or-read. A found profile is returned untouched (soul, memories, skills, config).-- A ``hermes-setup`` profile from before the role existed is adopted: it gets the role and- nothing else, so existing installs keep their guide chat."""found = find_setup_profile()if found is not None:return SetupProfile(found[0], found[1], created=False)@@ -79,9 +67,6 @@ def ensure_setup_profile() -> SetupProfile:def reset_setup_profile() -> SetupProfile:- """Restore the created state in place: soul from the template, memories and skills re-copied- from ``default`` as create copies them. Session history is cleared by the caller, which owns- the live sessions and the session store. Raises LookupError when no setup profile exists."""found = find_setup_profile()if found is None:raise LookupError("no setup profile to reset")@@ -99,14 +84,11 @@ def reset_setup_profile() -> SetupProfile:def _write_soul(path: Path) -> None:- # Bytes, so Windows text mode cannot turn the template's \n into \r\n.from utils import atomic_write_bytesatomic_write_bytes(path / "SOUL.md", SETUP_SOUL.encode("utf-8"))def _replace_dir(directory: Path) -> None:- """Empty *directory*. A link (symlink or NTFS junction) is removed, never followed: its- target belongs to another profile or an external skills root."""if directory.is_symlink() or profiles_mod._junction_target(str(directory)) is not None:directory.unlink() if directory.is_symlink() else directory.rmdir()elif directory.exists():diff --git a/tui_gateway/methods_onboarding.py b/tui_gateway/methods_onboarding.pyindex 8ecfb4ee919..c51a69bc68c 100644--- a/tui_gateway/methods_onboarding.py+++ b/tui_gateway/methods_onboarding.py@@ -1,7 +1,3 @@-"""Onboarding JSON-RPC handlers: the backend owns the setup profile (``hermes_cli.setup_profile``).-Bodies are rebound onto server.py's globals (method_ctx.bind_module) and reference them bare.-"""-from .method_ctx import HandlerRegistry, bind_module_registry = HandlerRegistry()@@ -10,13 +6,10 @@ method = _registry.method@method("onboarding.ensure_setup_profile")def _(rid, params: dict) -> dict:- """Create-or-read the setup profile. Takes no name: the backend picks it and finds it by role."""from hermes_cli.setup_profile import ensure_setup_profiletry:setup = ensure_setup_profile()if setup.created:- # Same credential mirroring profiles.create gives the desktop's clones; auth.json stays- # shared with the root so a token refresh never forks._mirror_launch_credentials(setup.path, {"share_auth": True})except Exception as e:return _err(rid, 5073, str(e))@@ -25,7 +18,6 @@ def _(rid, params: dict) -> dict:@method("onboarding.reset_setup_profile")def _(rid, params: dict) -> dict:- """Restore the setup profile to its created state in place; clears its session history."""from hermes_cli.setup_profile import find_setup_profile, reset_setup_profilefound = find_setup_profile()if found is None:@@ -39,7 +31,6 @@ def _(rid, params: dict) -> dict:def _clear_setup_sessions(profile_dir) -> None:- """Close this process's live sessions in the setup profile, then delete its stored sessions."""target = Path(profile_dir).resolve()with _sessions_lock:live = [sid for sid, sess in _sessions.items()diff --git a/tui_gateway/onboarding_personalization.py b/tui_gateway/onboarding_personalization.pyindex 17edc6f333a..035ca0f85b9 100644--- a/tui_gateway/onboarding_personalization.py+++ b/tui_gateway/onboarding_personalization.py@@ -1,4 +1,3 @@-"""Writes the setup facts agreed during onboarding into the default profile's user memory."""import jsonfrom hermes_constants import reset_hermes_home_override, set_hermes_home_override@@ -30,14 +29,11 @@ def remember_onboarding(answers: dict) -> dict:if len(content) > 2000:raise ValueError('Onboarding facts are too long to remember')- # The entry must land in the 'default' profile directory even when this RPC arrives on the guide's- # backend or under a custom Hermes home.token = set_hermes_home_override(get_profile_dir('default'))try:result = json.loads(memory_tool(action='add', target='user', content=content, store=load_on_disk_store()))if not result.get('success') or result.get('staged'):raise ValueError(result.get('error') or result.get('message') or 'Memory was not saved')- # memory_tool can report success without the entry reaching disk, so read it back from a fresh store.if content not in load_on_disk_store().user_entries:raise ValueError('Could not verify saved onboarding facts')return {'saved': True, 'profile': 'default', 'target': 'user'}