The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(desktop): delete the old ::onboarding / ::ask onboarding chain
alt-glitchcc791d5d3e14
diff --git a/apps/desktop/src/api/mcp.ts b/apps/desktop/src/api/mcp.tsindex 764a4828e4e..94a22dc6279 100644--- a/apps/desktop/src/api/mcp.ts+++ b/apps/desktop/src/api/mcp.ts@@ -114,11 +114,10 @@ export function setMcpServerEnabled(name: string, enabled: boolean): Promise<{ o})}-export function getMcpCatalog(profile?: ProfileScope, detectApps = false): Promise<McpCatalogResponse> {+export function getMcpCatalog(profile?: ProfileScope): Promise<McpCatalogResponse> {return window.hermesDesktop.api<McpCatalogResponse>({...capabilityScoped(profile),- path: `/api/mcp/catalog${detectApps ? '?detect_apps=true' : ''}`,- ...(detectApps ? { timeoutMs: 5000 } : {})+ path: '/api/mcp/catalog'})}diff --git a/apps/desktop/src/app/chat/composer/hooks/use-middleware-submit.ts b/apps/desktop/src/app/chat/composer/hooks/use-middleware-submit.tsindex de13c1cf35e..3f81360ed6f 100644--- a/apps/desktop/src/app/chat/composer/hooks/use-middleware-submit.ts+++ b/apps/desktop/src/app/chat/composer/hooks/use-middleware-submit.ts@@ -5,7 +5,7 @@ import { interceptsTypedVoiceStop } from '@/lib/voice-stop-word'import { runComposerMiddleware } from '../contrib'import type { ChatBarProps } from '../types'-export interface VoiceStopHandle {+interface VoiceStopHandle {active: booleanend: () => void}diff --git a/apps/desktop/src/app/contrib/controller.tsx b/apps/desktop/src/app/contrib/controller.tsxindex 337bae9ff10..f2e5260490d 100644--- a/apps/desktop/src/app/contrib/controller.tsx+++ b/apps/desktop/src/app/contrib/controller.tsx@@ -6,10 +6,8 @@ import { SessionDraftTitle } from '@/app/chat/session-draft-title'import { SessionStatusDot } from '@/app/chat/session-status-dot'import { PALETTE_AREA, type PaletteContribution, paletteToggle } from '@/app/command-palette/contrib'import { type StatusbarItem } from '@/app/shell/statusbar-controls'-import { AskDirective } from '@/components/assistant-ui/ask-directive'import { InlinePreviewDirective } from '@/components/assistant-ui/inline-preview-directive'import { IdleMount } from '@/components/idle-mount'-import { OnboardingChatDirective } from '@/components/onboarding-chat/directive'import { $layoutEditMode, toggleLayoutEditMode } from '@/components/pane-shell/edit-mode'import { allPaneIds } from '@/components/pane-shell/tree/model'import { LayoutTreeRoot } from '@/components/pane-shell/tree/renderer'@@ -54,7 +52,6 @@ import {Zap} from '@/lib/icons'import { type KeybindContribution, KEYBINDS_AREA } from '@/lib/keybinds/actions'-import { isOnboardingEnabled } from '@/lib/onboarding-enabled'import { TRANSCRIPT_DIRECTIVE_AREA, type TranscriptDirectiveContribution } from '@/lib/transcript-directives'import { setYoloEnabled } from '@/lib/yolo-session'import { $connectionsRegistry } from '@/store/connection-registry-state'@@ -351,28 +348,6 @@ registry.registerMany([render: ({ attrs, streaming }) => <InlinePreviewDirective attrs={attrs} streaming={streaming} />} satisfies TranscriptDirectiveContribution},- ...(isOnboardingEnabled()- ? [- {- id: 'transcript.onboarding',- area: TRANSCRIPT_DIRECTIVE_AREA,- data: {- name: 'onboarding',- render: ({ attrs, streaming }) => <OnboardingChatDirective attrs={attrs} streaming={streaming} />- } satisfies TranscriptDirectiveContribution- },- // ::ask is the guided chat's question card, registered only with the- // onboarding flag. B4 decides its wider use.- {- id: 'transcript.ask',- area: TRANSCRIPT_DIRECTIVE_AREA,- data: {- name: 'ask',- render: ({ attrs, streaming }) => <AskDirective attrs={attrs} streaming={streaming} />- } satisfies TranscriptDirectiveContribution- }- ]- : []),{id: 'layout.reset',area: PALETTE_AREA,diff --git a/apps/desktop/src/app/contrib/handoff-leg.ts b/apps/desktop/src/app/contrib/handoff-leg.tsdeleted file mode 100644index 56f73d410d5..00000000000--- a/apps/desktop/src/app/contrib/handoff-leg.ts+++ /dev/null@@ -1,164 +0,0 @@-import { JsonRpcGatewayError } from '@hermes/shared'--import type { ClientSessionState } from '@/app/types'-import type { HandoffPlan } from '@/components/onboarding-chat/setup-profile'-import type { SessionMessage } from '@/types/hermes'--import type { AmbientGatewayRequest } from './session-rpc-dispatcher'--export const BUILD_PROFILE = 'default'--export interface HandoffTask {- task: string- brief: string- plan: HandoffPlan-}--export interface HandoffReceipt extends HandoffTask {- runtimeId: string- storedId: string- owner: { connectionId: null | string; profile: typeof BUILD_PROFILE }- status: 'created' | 'submitting' | 'accepted'-}--export interface HandoffSnapshot {- session_id: string- session_key: string- running: boolean- hydrating?: boolean- messages_omitted?: boolean- messages?: SessionMessage[]-}--export interface HandoffDeps {- create: () => Promise<Pick<HandoffReceipt, 'runtimeId' | 'storedId' | 'owner'>>- personalize: () => Promise<void>- request: <T>(- owner: HandoffReceipt['owner'],- method: string,- params: NonNullable<Parameters<AmbientGatewayRequest>[1]>- ) => Promise<T>- read: () => HandoffReceipt | null- save: (receipt: HandoffReceipt) => void- bind: (receipt: HandoffReceipt, running: boolean, snapshot?: HandoffSnapshot) => void-}--const PREFLIGHT_REJECTIONS = new Set([4001, 4004, 4009, 4018, 4090, 4091, 4120, 4121, 5070, 5071, 5072, 5122])--interface HydratedHandoffSnapshot extends HandoffSnapshot {- messages: SessionMessage[]-}--function verifyHandoffSnapshot(snapshot: HandoffSnapshot): asserts snapshot is HydratedHandoffSnapshot {- if (- snapshot.hydrating ||- snapshot.messages_omitted ||- !snapshot.session_id ||- !snapshot.session_key ||- !Array.isArray(snapshot.messages) ||- (snapshot.running !== true && snapshot.running !== false)- ) {- throw new Error('Could not verify the first build. Retry when the connection recovers.')- }-}--export async function startHandoff(deps: HandoffDeps, task: HandoffTask, recoverGone = true): Promise<HandoffReceipt> {- let receipt = deps.read()-- if (!receipt) {- await deps.personalize()- const identity = await deps.create()- receipt = { ...task, ...identity, status: 'created' }- deps.save(receipt)- } else {- const snapshot = await deps.request<HandoffSnapshot>(receipt.owner, 'session.resume', {- session_id: receipt.storedId,- omit_messages: false- })-- verifyHandoffSnapshot(snapshot)-- receipt = { ...receipt, runtimeId: snapshot.session_id }-- if (- (receipt.status === 'submitting' && snapshot.running) ||- snapshot.messages.some(message => message.role === 'user' && message.display_kind !== 'hidden')- ) {- receipt = { ...receipt, status: 'accepted' }- }-- deps.save(receipt)- deps.bind(receipt, snapshot.running, snapshot)-- if (receipt.status === 'accepted') {- return receipt- }-- if (snapshot.running) {- throw new Error(- 'The first build has no confirmed start, but its session still reports running. Retry when it is idle; no duplicate was sent.'- )- }-- if (receipt.status === 'submitting') {- throw new Error(- 'The first build has not acknowledged its start. Check its session before retrying; no duplicate was sent.'- )- }- }-- deps.bind(receipt, true)- receipt = { ...receipt, status: 'submitting' }- deps.save(receipt)-- try {- const response = await deps.request<{ status?: string }>(receipt.owner, 'prompt.submit', {- session_id: receipt.runtimeId,- text: receipt.brief- })-- if (response.status !== 'streaming') {- throw new Error('The first build did not acknowledge starting. Check its session before retrying.')- }- } catch (error) {- const code = error instanceof JsonRpcGatewayError ? error.code : undefined-- if (code !== undefined && PREFLIGHT_REJECTIONS.has(code)) {- receipt = { ...receipt, status: 'created' }- deps.save(receipt)-- if (code === 4001 && recoverGone) {- return startHandoff(deps, task, false)- }- }-- throw error- }-- receipt = { ...receipt, status: 'accepted' }- deps.save(receipt)-- return receipt-}--export function paintHandoffBrief(state: ClientSessionState, brief: string, storedId: string): ClientSessionState {- const id = `user-handoff-brief-${storedId}`-- return {- ...state,- messages: state.messages.some(message => message.id === id)- ? state.messages- : [- ...state.messages,- {- id,- role: 'user',- parts: [{ text: brief, type: 'text' }],- timestamp: Date.now() / 1000- }- ],- busy: true,- awaitingResponse: true,- turnStartedAt: state.turnStartedAt ?? Date.now()- }-}diff --git a/apps/desktop/src/app/contrib/handoff-receipt.ts b/apps/desktop/src/app/contrib/handoff-receipt.tsdeleted file mode 100644index f9aa3278588..00000000000--- a/apps/desktop/src/app/contrib/handoff-receipt.ts+++ /dev/null@@ -1,71 +0,0 @@-import { readKey, writeJson, writeKey } from '@/lib/storage'--import type { HandoffReceipt } from './handoff-leg'--const unsavedReceipts = new Map<string, HandoffReceipt>()--export function handoffReceiptKey(connection: null | string, guideStoredId: string): string {- return `hermes.onboarding.handoff.v1.connection.${encodeURIComponent(connection ?? 'ambient')}.profile.default.guide.${encodeURIComponent(guideStoredId)}`-}--export function readHandoffReceipt(key: string): HandoffReceipt | null {- const unsaved = unsavedReceipts.get(key)-- if (unsaved) {- return unsaved- }-- const raw = readKey(key)-- if (raw === null) {- return null- }-- let value: HandoffReceipt-- try {- value = JSON.parse(raw)- } catch {- throw new Error(- 'The saved first-build receipt could not be read. Check your sessions before starting another build.'- )- }-- const hasTextFields = [value?.storedId, value?.runtimeId, value?.task, value?.brief].every(- field => field?.constructor === String- )-- const connectionId = value?.owner?.connectionId- const validConnection = connectionId === null || (connectionId?.constructor === String && connectionId.length > 0)-- if (- !hasTextFields ||- !value.storedId ||- !validConnection ||- value.owner?.profile !== 'default' ||- !['build', 'plugin', 'machine-setup'].includes(value.plan) ||- !['created', 'submitting', 'accepted'].includes(value.status)- ) {- throw new Error(- 'The saved first-build receipt could not be read. Check your sessions before starting another build.'- )- }-- return value-}--export function quarantineHandoffReceipt(key: string): void {- writeKey(`${key}.unreadable`, readKey(key))- writeKey(key, null)-}--export function saveHandoffReceipt(key: string, receipt: HandoffReceipt): void {- unsavedReceipts.set(key, receipt)- writeJson(key, receipt)-- if (readKey(key) !== JSON.stringify(receipt)) {- throw new Error('Could not save the first-build session for recovery. No new start was sent.')- }-- unsavedReceipts.delete(key)-}diff --git a/apps/desktop/src/app/contrib/onboarding-handoff.ts b/apps/desktop/src/app/contrib/onboarding-handoff.tsdeleted file mode 100644index 7410d21f112..00000000000--- a/apps/desktop/src/app/contrib/onboarding-handoff.ts+++ /dev/null@@ -1,335 +0,0 @@-import { useStore } from '@nanostores/react'-import { useEffect } from 'react'--import { PROMPT_SUBMIT_REQUEST_TIMEOUT_MS } from '@/api/client'-import type { useSessionActions } from '@/app/session/hooks/use-session-actions'-import { $setupCheckIn, watchFirstBuild } from '@/components/onboarding-chat/first-build'-import {- $handoffError,- $setupHandoff,- $setupSession,- buildFirstTaskSeedMessages,- buildHandoffCompleteNote,- firstTaskTitle,- guideSourceConnectionId,- readGuideHandoffReceipt,- retrySetupHandoff-} from '@/components/onboarding-chat/setup-profile'-import { showHandoffTour } from '@/components/onboarding-chat/signpost'-import { findGroupOfPane } from '@/components/pane-shell/tree/model'-import { $layoutTree, activateTreePane } from '@/components/pane-shell/tree/store'-import { toChatMessages } from '@/lib/chat-messages'-import { connectorTitle } from '@/lib/connector-tools'-import { isOnboardingEnabled } from '@/lib/onboarding-enabled'-import { requestGatewayForAgent } from '@/store/gateway'-import { dismissNotification, notify } from '@/store/notifications'-import { $onboardingAnswers } from '@/store/onboarding-answers'-import { beginOnboardingHandoff, completeOnboardingFlow } from '@/store/onboarding-gate'-import { watchPluginOutcomes } from '@/store/onboarding-plugin-outcomes'-import { $activeGatewayProfile, $newChatProfile, $newChatRoute, ensureGatewayAgent } from '@/store/profile'-import {- $activeSessionId,- $selectedStoredSessionId,- forgetSessionOwnerHintsForSession,- setActiveSessionId,- setAwaitingResponse,- setBusy,- setSessionOwnerHint-} from '@/store/session'-import { $sessionStates, patchSessionTile } from '@/store/session-states'--import { BUILD_PROFILE, type HandoffDeps, type HandoffReceipt, paintHandoffBrief, startHandoff } from './handoff-leg'-import { saveHandoffReceipt } from './handoff-receipt'-import type { AmbientGatewayRequest } from './session-rpc-dispatcher'--export interface OnboardingHandoffOptions extends Pick<- Parameters<typeof useSessionActions>[0],- 'activeSessionIdRef' | 'ensureSessionState' | 'updateSessionState'-> {- createBackendSessionForSend: ReturnType<typeof useSessionActions>['createBackendSessionForSend']- requestGateway: AmbientGatewayRequest- runCreatePinnedTo: <T>(profile: string, create: () => Promise<T>) => Promise<T>-}--export function useOnboardingHandoff({- activeSessionIdRef,- ensureSessionState,- updateSessionState,- createBackendSessionForSend,- requestGateway,- runCreatePinnedTo-}: OnboardingHandoffOptions) {- const setupHandoff = useStore($setupHandoff)- const selectedStoredId = useStore($selectedStoredSessionId)- const activeSessionId = useStore($activeSessionId)-- useEffect(() => watchPluginOutcomes(() => $setupSession.get()?.runtimeId), [])-- useEffect(() => {- if (- !isOnboardingEnabled() ||- $setupHandoff.get() ||- !selectedStoredId ||- !activeSessionId ||- $sessionStates.get()[activeSessionId]?.storedSessionId !== selectedStoredId- ) {- return- }-- const connectionId = guideSourceConnectionId(selectedStoredId)-- try {- const { receipt: saved } = readGuideHandoffReceipt(selectedStoredId)-- if (!saved) {- return- }-- if (saved.status === 'accepted') {- completeOnboardingFlow()- $setupHandoff.set({- task: saved.task,- brief: saved.brief,- plan: saved.plan,- phase: 'done',- sessionTitle: firstTaskTitle(saved.task)- })-- return- }-- $setupSession.set({- connectionId,- profile: $activeGatewayProfile.get(),- runtimeId: activeSessionId,- storedId: selectedStoredId- })- $setupHandoff.set({ task: saved.task, brief: saved.brief, plan: saved.plan, phase: 'pending' })- } catch (error) {- notify({- kind: 'error',- title: 'First build needs attention',- message: error instanceof Error ? error.message : 'The first-build receipt could not be read.'- })- }- }, [activeSessionId, selectedStoredId])-- // eslint-disable-next-line no-restricted-syntax- useEffect(() => {- if (!isOnboardingEnabled() || setupHandoff?.phase !== 'pending' || $setupHandoff.get() !== setupHandoff) {- return- }-- beginOnboardingHandoff()- $setupHandoff.set({ ...setupHandoff, phase: 'opening' })-- void (async () => {- const setupSession = setupHandoff.guide ?? $setupSession.get()- const connectionId = setupSession?.connectionId ?? null-- const previousNewChatProfile = $newChatProfile.get()- const previousNewChatRoute = $newChatRoute.get()- let receipt: HandoffReceipt | null = null-- const request: HandoffDeps['request'] = (owner, method, params) =>- requestGatewayForAgent(owner.connectionId, owner.profile, method, params, PROMPT_SUBMIT_REQUEST_TIMEOUT_MS)-- try {- if (!setupSession?.storedId) {- throw new Error('The welcome chat owner is not available yet. Reopen it and retry the first build.')- }-- $setupSession.set(setupSession)- const { key: receiptKey, receipt: saved } = readGuideHandoffReceipt(setupSession.storedId)- receipt = saved- const owner: HandoffReceipt['owner'] = receipt?.owner ?? { connectionId, profile: BUILD_PROFILE }- receipt = await startHandoff(- {- read: () => receipt,- save: value => {- receipt = value- saveHandoffReceipt(receiptKey, value)- },- personalize: async () => {- const answers = $onboardingAnswers.get()-- const result = await request<{ saved?: boolean; profile?: string; target?: string }>(- owner,- 'profiles.remember_onboarding',- {- answers: { ...answers, connectors: answers.connectors.map(connectorTitle), plugins: answers.plugins }- }- )-- if (!result.saved || result.profile !== BUILD_PROFILE || result.target !== 'user') {- throw new Error('Could not save your onboarding preferences. Retry before starting the first build.')- }- },- create: async () => {- await ensureGatewayAgent(owner.connectionId, owner.profile)- $newChatProfile.set(BUILD_PROFILE)- $newChatRoute.set(- owner.connectionId ? { connectionId: owner.connectionId, profile: owner.profile } : null- )-- const seed = await buildFirstTaskSeedMessages(- setupHandoff.task,- $onboardingAnswers.get(),- setupHandoff.plan- )-- const runtimeId = await runCreatePinnedTo(BUILD_PROFILE, () =>- createBackendSessionForSend(setupHandoff.brief, seed)- )-- if (!runtimeId) {- throw new Error('Could not open the first-build session.')- }-- const storedId =- ensureSessionState(runtimeId).storedSessionId ??- ($activeSessionId.get() === runtimeId ? $selectedStoredSessionId.get() : null)-- if (!storedId || storedId === setupSession.storedId) {- throw new Error(- 'The first-build session did not return a durable identity. Check your sessions before retrying.'- )- }-- return { runtimeId, storedId, owner }- },- request,- bind: (value, running, snapshot) => {- if (value.owner.connectionId) {- const ownerRoute = { connectionId: value.owner.connectionId, profile: value.owner.profile }-- setSessionOwnerHint(value.storedId, ownerRoute)- patchSessionTile(value.storedId, { runtimeId: value.runtimeId, ownerRoute })- } else {- forgetSessionOwnerHintsForSession(value.storedId)- patchSessionTile(value.storedId, { runtimeId: value.runtimeId, ownerRoute: undefined })- }-- ensureSessionState(value.runtimeId, value.storedId)- updateSessionState(- value.runtimeId,- state =>- snapshot- ? {- ...state,- messages: toChatMessages(snapshot.messages ?? []),- busy: running,- awaitingResponse: running- }- : paintHandoffBrief(state, value.brief, value.storedId),- value.storedId- )-- if ($selectedStoredSessionId.get() === value.storedId) {- activeSessionIdRef.current = value.runtimeId- setActiveSessionId(value.runtimeId)- setAwaitingResponse(running)- setBusy(running)- }- }- },- setupHandoff- )-- 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)- )- completeOnboardingFlow()- $handoffError.set(null)- dismissNotification('onboarding-handoff')- $setupHandoff.set({- brief: receipt.brief,- phase: 'done',- plan: receipt.plan,- sessionTitle: chatTitle,- task: receipt.task- })- watchFirstBuild(receipt.runtimeId, receipt.owner.profile)- const tree = $layoutTree.get()- const sessionsGroup = tree ? findGroupOfPane(tree, 'sessions') : null-- if (sessionsGroup && sessionsGroup.active !== 'sessions') {- activateTreePane(sessionsGroup.id, 'sessions')- }-- void requestGatewayForAgent(- connectionId,- setupSession.profile ?? BUILD_PROFILE,- 'prompt.submit',- {- display_kind: 'hidden',- session_id: setupSession.runtimeId,- text: buildHandoffCompleteNote(receipt.task)- },- PROMPT_SUBMIT_REQUEST_TIMEOUT_MS- ).catch(error => console.warn('[handoff] guide note was not delivered', error))-- if ($selectedStoredSessionId.get() === receipt.storedId) {- void showHandoffTour()- }- } catch (error) {- console.error('[handoff] first build needs recovery', error)-- if (receipt) {- const briefId = `user-handoff-brief-${receipt.storedId}`- updateSessionState(- receipt.runtimeId,- state => ({- ...state,- busy: false,- awaitingResponse: false,- turnStartedAt: null,- messages: state.messages.filter(message => message.id !== briefId)- }),- receipt.storedId- )-- if ($selectedStoredSessionId.get() === receipt.storedId) {- setAwaitingResponse(false)- setBusy(false)- }- }-- $newChatProfile.set(previousNewChatProfile)- $newChatRoute.set(previousNewChatRoute)- const message = error instanceof Error ? error.message : 'The first build could not be started.'- $handoffError.set(message)- $setupHandoff.set({ ...setupHandoff, phase: 'error' })- notify({- id: 'onboarding-handoff',- kind: 'error',- title: 'First build needs attention',- message,- action: { label: 'Retry first build', onClick: retrySetupHandoff }- })- }- })()- }, [- activeSessionIdRef,- createBackendSessionForSend,- ensureSessionState,- runCreatePinnedTo,- setupHandoff,- updateSessionState- ])-- const checkIn = useStore($setupCheckIn)-- useEffect(() => {- if (!isOnboardingEnabled() || !checkIn) {- return- }-- void requestGateway(- 'prompt.submit',- { display_kind: 'hidden', session_id: checkIn.sessionId, text: checkIn.note },- PROMPT_SUBMIT_REQUEST_TIMEOUT_MS- ).catch(() => undefined)- }, [checkIn, requestGateway])-}diff --git a/apps/desktop/src/app/contrib/onboarding-kickoff-machine.ts b/apps/desktop/src/app/contrib/onboarding-kickoff-machine.tsindex 09efa07c574..95e146f51d1 100644--- a/apps/desktop/src/app/contrib/onboarding-kickoff-machine.ts+++ b/apps/desktop/src/app/contrib/onboarding-kickoff-machine.ts@@ -12,7 +12,7 @@ import { $gatewayState } from '@/store/session'* RPC error response, the backend process exiting, a result it does not expect, or `stop` (the person chose* to go on without setup once the wait outlasted the boot budget).*/-export type KickoffState = 'waiting-backend' | 'preparing' | 'opening' | 'started' | 'off' | 'failed'+type KickoffState = 'waiting-backend' | 'preparing' | 'opening' | 'started' | 'off' | 'failed'/** json-rpc-channel arms a call's timer only for a positive timeout, so 0 waits for the answer. */export const NO_DEADLINE = 0@@ -53,7 +53,7 @@ function log(line: string): void {window.hermesDesktop?.logLine?.(text)}-export interface KickoffMachine {+interface KickoffMachine {enter(next: KickoffState, detail?: string): void/** Runs `step` once the gateway is open. A dial that times out on a starting backend runs it again; a* dropped connection runs it again once. Anything else, or the backend exiting, rejects. */diff --git a/apps/desktop/src/app/contrib/onboarding-kickoff.ts b/apps/desktop/src/app/contrib/onboarding-kickoff.tsindex eeedf56ffa7..780bf485861 100644--- a/apps/desktop/src/app/contrib/onboarding-kickoff.ts+++ b/apps/desktop/src/app/contrib/onboarding-kickoff.ts@@ -4,7 +4,7 @@ import { useCallback } from 'react'import type { useSessionActions } from '@/app/session/hooks/use-session-actions'import { $chatOnboardingThreadIds, endChatOnboardingSolo, takeGuideShape } from '@/components/onboarding-chat/assembly'import { $introTurnSent, openIntro, rememberLaunchSource } from '@/components/onboarding-chat/intro'-import { $setupSession, guideSourceConnectionId } from '@/components/onboarding-chat/setup-profile'+import { $setupSession, guideSourceConnectionId } from '@/components/onboarding-chat/setup-session'import type { ChatMessagePart } from '@/lib/chat-messages'import { isOnboardingEnabled } from '@/lib/onboarding-enabled'import { BACKEND_BOOT_WAIT_TIMEOUT_MS } from '@/lib/with-timeout'@@ -37,7 +37,7 @@ function prefetchGuideCatalogs(storedId: null | string): void {/** Runs a slash command as if typed; `hidden` keeps its user row out of every transcript. */export type KickoffSlashCommand = (command: string, options: { hidden: true; sessionId: string }) => Promise<void>-export interface OnboardingKickoffOptions extends Pick<ReturnType<typeof useSessionActions>, 'resumeSession'> {+interface OnboardingKickoffOptions extends Pick<ReturnType<typeof useSessionActions>, 'resumeSession'> {requestGateway: AmbientGatewayRequestrunSlashCommand: KickoffSlashCommand}diff --git a/apps/desktop/src/app/contrib/wiring.tsx b/apps/desktop/src/app/contrib/wiring.tsxindex d66d6fe63b3..355455a3b8f 100644--- a/apps/desktop/src/app/contrib/wiring.tsx+++ b/apps/desktop/src/app/contrib/wiring.tsx@@ -48,7 +48,6 @@ import { $desktopBoot } from '@/store/boot'import { requestVoiceConversationStart } from '@/store/composer'import { $activeConnectionId } from '@/store/connections'import { $cronReviewRequest, setCronFocusJobId } from '@/store/cron'-import { requestGatewayForProfile } from '@/store/gateway'import { reconnectGateway } from '@/store/gateway-reconnect'import { $interfaceMode, shownInMode } from '@/store/interface-mode'import { $pinnedSessionIds, pinSession, restoreWorktree, unpinSession } from '@/store/layout'@@ -167,7 +166,6 @@ import { usePetBridge } from './hooks/use-pet-bridge'import { useQuickEntryBridge } from './hooks/use-quick-entry-bridge'import { useSessionTileDelegate } from './hooks/use-session-tile-delegate'import { McpInstallDeepLinkDialog } from './mcp-install-deeplink-dialog'-import { useOnboardingHandoff } from './onboarding-handoff'import { type KickoffSlashCommand, useOnboardingKickoff } from './onboarding-kickoff'import { useTitlebarToolContributions } from './panes'import { type AmbientGatewayRequest, createSessionRpcDispatcher } from './session-rpc-dispatcher'@@ -198,9 +196,6 @@ const StarmapView = lazy(async () => ({ default: (await import('../starmap')).St// the controller that assembles them.export { WiredPane } from './context'-// Only the RPCs issued by session creation follow the handoff's profile pin.-const HANDOFF_CREATE_LEG_METHODS = new Set(['config.set', 'session.close', 'session.create'])-// Generic in-app route intents raised by toast recovery buttons (Open Keys,// Open Gateways, Maintenance …) fired from stores with no router context.function useRouteRequestNavigation(navigate: ReturnType<typeof useNavigate>): void {@@ -393,12 +388,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {const { connectionRef, gateway, gatewayRef, requestGateway: ambientRequestGateway } = useGatewayRequest()- // The guide remains selected while handoff creates on another profile.- // Without this pin, the owner ladder sends session.create to the setup profile- // despite the gateway switch (#89206). Scope it to the create leg so- // concurrent session traffic keeps its recorded owner.- const handoffCreateProfileRef = useRef<null | string>(null)-// When chrome stays on the launch backend (Bot Mode / all-profiles// navigation), session-owned RPCs still have to hit the session's backend.// The routing itself lives in createSessionRpcDispatcher (routed by the@@ -417,14 +406,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {const requestGateway = useCallback<AmbientGatewayRequest>((method, params, timeoutMs, signal) => {- // The new build belongs to the handoff target; the selected guide's- // owner ladder would send its create to the wrong socket (#89206).- const handoffProfile = handoffCreateProfileRef.current-- if (handoffProfile !== null && HANDOFF_CREATE_LEG_METHODS.has(method)) {- return requestGatewayForProfile(handoffProfile, method, params ?? {}, timeoutMs, signal)- }-return dispatchSessionRpc(method, params, timeoutMs, signal)},[dispatchSessionRpc]@@ -631,16 +612,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {}}, [startSessionInWorkspace, startWorkSessionRequest])- const runCreatePinnedTo = useCallback(async <T,>(profile: string, create: () => Promise<T>): Promise<T> => {- handoffCreateProfileRef.current = profile-- try {- return await create()- } finally {- handoffCreateProfileRef.current = null- }- }, [])-const adoptSessionRoute = useCallback(async (storedSessionId: string) => {creatingSessionRef.current = true@@ -660,15 +631,6 @@ export function ContribWiring({ children }: { children: ReactNode }) {[navigate, resumeSession])- useOnboardingHandoff({- activeSessionIdRef,- ensureSessionState,- updateSessionState,- createBackendSessionForSend,- requestGateway,- runCreatePinnedTo- })-// "New project" DRAG completion: the dialog created a project that was// dropped onto a chat zone (tab-strip slot / pane edge / pane center). Open// its fresh session draft exactly there — the same `openNewSessionTile`diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/message-stream.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/message-stream.tsindex cfd80d57fa5..15f4fad8c41 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/message-stream.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/message-stream.ts@@ -2,7 +2,6 @@ import type { BillingBlock } from '@hermes/shared'import { burstVibeHearts } from '@/components/chat/vibe-hearts'import { $chatOnboardingThreadIds } from '@/components/onboarding-chat/assembly'-import { reportFirstBuildTurnComplete } from '@/components/onboarding-chat/first-build'import { translateNow } from '@/i18n'import type { GatewayEventPayload } from '@/lib/chat-messages'import { coerceGatewayText, coerceThinkingText } from '@/lib/chat-runtime'@@ -85,11 +84,7 @@ function turnFailure(payload: GatewayEventPayload | undefined, finalText: string}}-function reportOnboardingTurnComplete(ctx: GatewayEventContext, sessionId: string, finalText: string): void {- // Onboarding's first build: between turns is the only moment Setup may- // put a check-in into that session (no-op everywhere else).- reportFirstBuildTurnComplete(sessionId, finalText)-+function reportOnboardingTurnComplete(ctx: GatewayEventContext, sessionId: string): void {// The whole agent loop has returned: the end of a task, not a step in one.// Only the session on screen counts, which drops subagent mirrors (child ids).if (!ctx.isActiveEvent) {@@ -412,7 +407,7 @@ export function handleMessageStreamEvent(ctx: GatewayEventContext): boolean {payload?.response_reused === true)- reportOnboardingTurnComplete(ctx, sessionId, finalText)+ reportOnboardingTurnComplete(ctx, sessionId)// Structured billing wall forwarded by the gateway (out of credits /// payment required) — cache it + raise a billing-specific toast.diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools.tsindex 63294ad9848..d82968f8c01 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/tools.ts@@ -1,5 +1,4 @@import { isPreviewableTarget, toolPreviewOutcome } from '@/components/assistant-ui/tool/fallback-model'-import { reportFirstBuildToolComplete } from '@/components/onboarding-chat/first-build'import { finishGuidedOnboarding } from '@/components/onboarding-chat/intro'import { type GatewayEventPayload, toolCallOwnerMessageId } from '@/lib/chat-messages'import { invalidateSlashCompletions } from '@/lib/slash-completion-cache'@@ -121,10 +120,6 @@ export function handleToolEvent(ctx: GatewayEventContext): boolean {recordToolPreview(ctx, sessionId, state?.cwd ?? '', pendingProduction)}- // Onboarding's first build paces its check-ins off real work done- // (no-op in every other session).- reportFirstBuildToolComplete(sessionId)-if (!event.replayed) {reportStartChatHandoff(payload, sessionId)}diff --git a/apps/desktop/src/components/assistant-ui/ask-directive.tsx b/apps/desktop/src/components/assistant-ui/ask-directive.tsxdeleted file mode 100644index 73ded970c9c..00000000000--- a/apps/desktop/src/components/assistant-ui/ask-directive.tsx+++ /dev/null@@ -1,79 +0,0 @@-import { useAuiState } from '@assistant-ui/react'-import { useStore } from '@nanostores/react'-import { useState } from 'react'--import { requestComposerSubmit } from '@/app/chat/composer/focus'-import { useSessionView } from '@/app/chat/session-view'-import { answeredAfter } from '@/lib/chat-messages/parts'-import { cn } from '@/lib/utils'--const settled = new Set<string>()--export function AskDirective({ attrs, streaming }: { attrs: Record<string, string>; streaming: boolean }) {- const view = useSessionView()- const storedId = useStore(view.$storedId)- const runtimeId = useStore(view.$runtimeId)- const messageId = useAuiState(state => state.message.id)- const question = (attrs.question ?? '').trim()- const identity = JSON.stringify([storedId ?? runtimeId, messageId, question])- const target = view.kind === 'tile' ? `tile:${storedId}` : 'main'-- const options = (attrs.options ?? '')- .split('|')- .map(option => option.trim())- .filter(Boolean)- .slice(0, 6)-- const wantsInput = attrs.input === 'true' || attrs.input === 'yes'- const [picked, setPicked] = useState<null | string>(() => (settled.has(identity) ? '' : null))-- const answeredInComposer = answeredAfter(useStore(view.$messages), messageId)-- const closed = picked !== null || answeredInComposer-- if (!question || (options.length === 0 && !wantsInput)) {- return null- }-- const submit = (value: string) => {- if (closed || streaming || !value.trim()) {- return- }-- if (requestComposerSubmit(value.trim(), { target })) {- settled.add(identity)- setPicked(value.trim())- }- }-- return (- <div- className="my-3 flex min-w-0 max-w-full flex-col gap-2 overflow-visible duration-300 animate-in fade-in-0 slide-in-from-bottom-2"- data-onboarding-card- >- <div className="text-[length:var(--conversation-text-font-size)] font-medium">{question}</div>- {options.length > 0 && (- <div className="flex min-w-0 max-w-full flex-wrap gap-2">- {options.map(option => (- <button- className={cn(- 'max-w-full shrink-0 rounded-full border px-3 py-1.5 text-left text-[12px] whitespace-normal wrap-anywhere transition-colors',- picked === option- ? 'border-primary bg-primary text-primary-foreground'- : closed- ? 'border-border/60 text-muted-foreground/50'- : 'border-border bg-card hover:border-primary/50 hover:bg-primary/10'- )}- disabled={closed || streaming}- key={option}- onClick={() => submit(option)}- type="button"- >- {option}- </button>- ))}- </div>- )}- </div>- )-}diff --git a/apps/desktop/src/components/assistant-ui/clarify/setup-pickers.tsx b/apps/desktop/src/components/assistant-ui/clarify/setup-pickers.tsxindex 11d084bb89c..fcf296a15a3 100644--- a/apps/desktop/src/components/assistant-ui/clarify/setup-pickers.tsx+++ b/apps/desktop/src/components/assistant-ui/clarify/setup-pickers.tsx@@ -21,7 +21,7 @@ import { getBaseColors } from '@/themes/context'import { ChoiceLabel } from './core/choice-row'import type { SetupRow } from './setup-rows'-export interface SetupPickerProps {+interface SetupPickerProps {cursor: null | numberonPick: (index: number) => voidonStage: (id: string) => void@@ -203,14 +203,7 @@ function PluginPicker(props: SetupPickerProps) {const needsApp = (row: SetupRow) => Boolean(plugins?.some(plugin => plugin.name === row.id && pluginNeedsApp(plugin)))- return (- <ChipPicker- {...props}- dim={needsApp}- icon={pluginIcon}- sub={t.assistant.setupChoose.plugin}- />- )+ return <ChipPicker {...props} dim={needsApp} icon={pluginIcon} sub={t.assistant.setupChoose.plugin} />}export const SETUP_PICKERS: Record<SetupPickerKind, FC<SetupPickerProps>> = {diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.tsx b/apps/desktop/src/components/assistant-ui/markdown-text.tsxindex 1fede3a83fa..c16596f238d 100644--- a/apps/desktop/src/components/assistant-ui/markdown-text.tsx+++ b/apps/desktop/src/components/assistant-ui/markdown-text.tsx@@ -36,11 +36,9 @@ import {resolveMediaPlaybackSrc,validImageDimensions} from '@/lib/media'-import { isOnboardingEnabled } from '@/lib/onboarding-enabled'import { previewTargetFromMarkdownHref } from '@/lib/preview-targets'import { remarkSoftBreaks } from '@/lib/remark-soft-breaks'import { sessionRefFromMarkdownHref } from '@/lib/session-refs'-import { isDirectiveInProgress } from '@/lib/transcript-directives'import { cn } from '@/lib/utils'import { useForcedTextDirection } from '@/store/text-direction'@@ -50,8 +48,6 @@ import { detectEmbed, extractAlert, MarkdownAlert, RichCodeBlock, UrlEmbed } froimport { ResizableMarkdownTable, ResizableMarkdownTh } from './markdown-table'import { paragraphPlainText, TranscriptDirectiveLeaf, useResolvedParagraph } from './transcript-directive'-const onboardingEnabled = isOnboardingEnabled()-// Math rendering plugin (KaTeX). Configured once at module scope — the// plugin is stateless beyond its internal cache so re-creating per-render// would needlessly thrash. We use a memoizing wrapper around rehype-katex@@ -491,8 +487,8 @@ interface MarkdownTextSurfaceProps {/** This text is the model's private scratchpad (reasoning), so nothing in it* may be promoted into app chrome: no artifact cards from fenced blocks (a* draft must not register artifact versions), and no transcript directives- * (a `::onboarding{step="look"}` the model was only reminding itself about- * otherwise mounted a live accent picker inside the thinking block). */+ * (a directive the model was only reminding itself about would otherwise+ * mount a live plugin card inside the thinking block). */scratchpad?: boolean/** Disable artifact-card promotion for fenced blocks (reasoning text — a* model's scratchpad draft must not register artifact versions). */@@ -601,18 +597,6 @@ function MarkdownParagraph({)}- // Directive-in-progress: while the message is still streaming, a paragraph- // that begins with `::` is a directive whose closing shape hasn't fully- // arrived (directives always sit alone in their own paragraph — FLOW.md),- // so it can't be claimed yet. Rendering the plain <p> here is the raw-text- // flash (`::ask{question="Wha…`) that snaps into a card on settle — hold- // the slot empty instead. Once streaming ends this branch is dead, so a- // SETTLED malformed/unclaimed directive still shows as prose (an authoring- // bug the user should see).- if (onboardingEnabled && streaming && plain !== null && isDirectiveInProgress(plain)) {- return null- }-return (<p className={paragraphClass} {...props}>{children}diff --git a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsxindex ddeda674cf8..b59d9b0cc01 100644--- a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx@@ -354,7 +354,7 @@ const ReasoningAccordionGroup: FC<{ children?: ReactNode; endIndex: number; starconst messageId = useAuiState(s => s.message.id)const messageRunning = useAuiState(s => s.message.status?.type === 'running')// The guide's reasoning is it reading its own runbook ("Now step 4: offer- // the tour with ::ask"), and a first-time user reading that alongside the+ // the layout picker"), and a first-time user reading that alongside the// greeting breaks the one conversation the guide is trying to have.const guidedChat = useOnboardingChatActive()diff --git a/apps/desktop/src/components/onboarding-chat/assembly.ts b/apps/desktop/src/components/onboarding-chat/assembly.tsindex 183e608424e..39653230d2f 100644--- a/apps/desktop/src/components/onboarding-chat/assembly.ts+++ b/apps/desktop/src/components/onboarding-chat/assembly.ts@@ -54,7 +54,7 @@ export function takeGuideShape(): void {}}-export function startChatOnboardingSolo(): void {+function startChatOnboardingSolo(): void {if (!isOnboardingEnabled() || $chatOnboardingSolo.get()) {return}diff --git a/apps/desktop/src/components/onboarding-chat/cards/build.tsx b/apps/desktop/src/components/onboarding-chat/cards/build.tsxdeleted file mode 100644index 9e0ffdacb3f..00000000000--- a/apps/desktop/src/components/onboarding-chat/cards/build.tsx+++ /dev/null@@ -1,271 +0,0 @@-import { useAuiState } from '@assistant-ui/react'-import { useStore } from '@nanostores/react'-import { useEffect, useMemo } from 'react'--import { requestComposerSubmit } from '@/app/chat/composer/focus'-import { useSessionView } from '@/app/chat/session-view'-import { quarantineHandoffReceipt } from '@/app/contrib/handoff-receipt'-import { resolveSessionOwner } from '@/app/session/hooks/use-session-actions/utils'-import type { CardProps } from '@/components/onboarding-chat/cards/frame'-import { Chip } from '@/components/onboarding-chat/chip'-import { readPersistedHandoff } from '@/components/onboarding-chat/persisted-handoff'-import {- $handoffError,- $setupHandoff,- $setupSession,- firstTaskTitle,- guideHandoffReceiptKey,- parseHandoffPlan,- readGuideHandoffReceipt,- requestSetupHandoff,- retrySetupHandoff-} from '@/components/onboarding-chat/setup-profile'-import { Button } from '@/components/ui/button'-import { answeredAfter } from '@/lib/chat-messages/parts'-import { segmentTranscriptDirectives } from '@/lib/transcript-directives'-import { cn } from '@/lib/utils'-import { $onboardingAnswers, markStepCommitted } from '@/store/onboarding-answers'-import { $activeGatewayProfile } from '@/store/profile'-import { assertSessionOwnerResolved } from '@/store/session-owner-resolution'-import { isSessionOwnerRoute } from '@/store/session-request-router'--const FALLBACK_OPTION = "Let's figure it out together"--export function FirstBuildCard({ attrs, locked }: CardProps) {- const view = useSessionView()- const storedId = useStore(view.$storedId)- const target = view.kind === 'tile' ? `tile:${storedId}` : 'main'- const messageId = useAuiState(state => state.message.id)-- const answeredInComposer = answeredAfter(useStore(view.$messages), messageId)-- const committed =- useStore($onboardingAnswers)- .committed.find(step => step.startsWith('first:'))- ?.slice(6) ?? null-- const picked = committed ?? (answeredInComposer ? '' : null)-- const seen = new Set<string>()-- const parsed = (attrs.options ?? '')- .split('|')- .map(option => option.trim().replace(/\s+/g, ' '))- .filter(option => {- const key = option.toLowerCase()-- if (option.length === 0 || option.length > 60 || seen.has(key)) {- return false- }-- seen.add(key)-- return true- })- .slice(0, 4)-- const options = parsed.length < 2 ? [FALLBACK_OPTION] : parsed-- const pick = (option: string) => {- if (picked !== null || locked) {- return- }-- if (requestComposerSubmit(option, { target })) {- markStepCommitted(`first:${option}`)- }- }-- return (- <div className="my-3 grid min-w-0 max-w-md gap-4" data-onboarding-card inert={locked || undefined}>- <div className="flex min-w-0 max-w-full flex-wrap gap-2">- {options.map(option => (- <Chip key={option} label={option} on={picked === option} onToggle={() => pick(option)} variant="pill" />- ))}- </div>- </div>- )-}--export function HandoffCard({ attrs, locked }: CardProps) {- const view = useSessionView()- const storedId = useStore(view.$storedId)- const runtimeId = useStore(view.$runtimeId)- const task = (attrs.task ?? '').trim().slice(0, 60)- const brief = (attrs.brief ?? '').trim().slice(0, 240)- const plan = parseHandoffPlan(attrs.plan)- const state = useStore($setupHandoff)- const replyRunning = useAuiState(s => s.message.status?.type === 'running')-- const receipt = useMemo(() => {- try {- return {- completed: !!storedId && readGuideHandoffReceipt(storedId).receipt?.status === 'accepted',- error: null- }- } catch (error) {- return { completed: false, error: String(error) }- }- }, [storedId, state?.phase])-- const error = useStore($handoffError) ?? receipt.error- const completed = receipt.completed-- useEffect(() => {- if (!task || !brief || locked || replyRunning || !storedId || !runtimeId || $setupHandoff.get() || completed) {- return- }-- let cancelled = false- void resolveSessionOwner(storedId)- .then(async owner => {- assertSessionOwnerResolved(owner, { method: 'onboarding.handoff', sessionId: storedId })-- const connectionId = isSessionOwnerRoute(owner) ? owner.connectionId : null-- const profile = isSessionOwnerRoute(owner)- ? owner.profile- : owner || $setupSession.get()?.profile || $activeGatewayProfile.get()-- 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)-- if (!cancelled) {- requestSetupHandoff(- persistedTask || task,- persistedBrief || brief,- persisted ? parseHandoffPlan(persisted.plan) : plan,- { storedId, runtimeId, connectionId, profile }- )- }- })- .catch(error => {- if (!cancelled) {- $handoffError.set(String(error))- $setupHandoff.set({ task, brief, plan, phase: 'error' })- }- })-- return () => {- cancelled = true- }- }, [brief, locked, plan, replyRunning, task, storedId, runtimeId, completed])-- if (!task || !brief) {- return null- }-- const settled = state?.phase === 'done' || (state === null && completed)- const failed = state?.phase === 'error' || error !== null- const title = state?.sessionTitle ?? firstTaskTitle(task)-- const retry = async () => {- if (state?.phase !== 'error') {- return- }-- try {- if (receipt.error && storedId) {- quarantineHandoffReceipt(guideHandoffReceiptKey(storedId))- }-- if (!state.guide && storedId && runtimeId) {- const owner = await resolveSessionOwner(storedId)- assertSessionOwnerResolved(owner, { method: 'onboarding.handoff', sessionId: storedId })- $setupHandoff.set({- ...state,- guide: {- storedId,- runtimeId,- connectionId: isSessionOwnerRoute(owner) ? owner.connectionId : null,- profile: isSessionOwnerRoute(owner)- ? owner.profile- : owner || $setupSession.get()?.profile || $activeGatewayProfile.get()- }- })- }-- retrySetupHandoff()- } catch (error) {- $handoffError.set(String(error))- }- }-- return (- <div className="my-3 flex max-w-md items-center gap-2 text-sm" data-onboarding-card>- <StatusDot live={!settled && !failed} />- <span className="text-(--ui-text-secondary)">- {failed- ? (error ?? 'The first build could not be started. Retry to check its session.')- : settled- ? `${title} was started — find it in your sessions`- : `Opening ${title}\u2026`}- </span>- {state?.phase === 'error' && (- <Button disabled={locked} onClick={() => void retry()} size="sm" variant="text">- Retry first build- </Button>- )}- </div>- )-}--export function ProgressCard({ attrs, locked }: CardProps) {- const view = useSessionView()- const messages = useStore(view.$messages)- const messageId = useAuiState(state => state.message.id)- const title = (attrs.title ?? '').trim() || 'Working on it'-- const index = messages.findIndex(message => message.id === messageId)- const previous = index < 0 ? [] : messages.slice(0, index)-- const steps = previous.flatMap(message => {- const directives = message.parts.flatMap(part =>- part.type === 'text' ? (segmentTranscriptDirectives(part.text) ?? []) : []- )-- const progress = directives- .filter(- segment =>- segment.kind === 'directive' &&- segment.directive.name === 'onboarding' &&- segment.directive.attrs.step === 'progress'- )- .at(-1)-- return progress?.kind === 'directive'- ? [{ id: message.id, title: progress.directive.attrs.title?.trim() || 'Working on it' }]- : []- })-- return (- <div className="my-3 grid max-w-md gap-1.5" data-onboarding-card>- {[...steps, { id: messageId, title }].map(step => {- const current = step.id === messageId-- return (- <div className="flex items-center gap-2 text-sm" key={step.id}>- <StatusDot live={current && locked} muted={!current} />- <span className={current ? 'text-(--ui-text-secondary)' : 'text-(--ui-text-quaternary)'}>- {current && locked ? `${step.title}…` : step.title}- </span>- </div>- )- })}- </div>- )-}--function StatusDot({ live, muted = !live }: { live: boolean; muted?: boolean }) {- return (- <span- aria-hidden- className={cn(- 'inline-block size-1.5 shrink-0 rounded-full',- muted ? 'bg-(--ui-text-quaternary)' : 'bg-(--ui-accent)',- live && 'animate-pulse'- )}- />- )-}diff --git a/apps/desktop/src/components/onboarding-chat/cards/frame.tsx b/apps/desktop/src/components/onboarding-chat/cards/frame.tsxdeleted file mode 100644index b9179ec2dd0..00000000000--- a/apps/desktop/src/components/onboarding-chat/cards/frame.tsx+++ /dev/null@@ -1,71 +0,0 @@-import { useStore } from '@nanostores/react'--import { requestComposerSubmit } from '@/app/chat/composer/focus'-import { useSessionView } from '@/app/chat/session-view'-import { Button } from '@/components/ui/button'-import { cn } from '@/lib/utils'-import { $onboardingAnswers, markStepCommitted } from '@/store/onboarding-answers'--export interface CardProps {- attrs: Record<string, string>- messageId?: string- locked: boolean-}--export function useCardCommit(step: string) {- const view = useSessionView()- const storedId = useStore(view.$storedId)- const target = view.kind === 'tile' ? `tile:${storedId}` : 'main'- const done = useStore($onboardingAnswers).committed.includes(step)-- const commit = (summary: string): boolean => {- const sent = requestComposerSubmit(`[setup] ${summary}`, { displayKind: 'hidden', target })-- if (sent) {- markStepCommitted(step)- }-- return sent- }-- return { commit, done }-}--export function CardFrame({- children,- continueLabel = 'Continue',- disabled = false,- done,- locked = false,- onContinue-}: {- children: React.ReactNode- continueLabel?: string- disabled?: boolean- done: boolean- locked?: boolean- onContinue: () => void-}) {- return (- <div- className={cn(- 'my-3 grid w-full min-w-0 max-w-md gap-4 duration-300 animate-in fade-in-0 slide-in-from-bottom-2',- done && 'opacity-75 transition-opacity duration-500'- )}- data-onboarding-card- inert={locked || undefined}- >- {children}- <div className="flex justify-start">- <Button- className={cn(done && 'scale-95 transition-transform duration-200')}- disabled={done || disabled || locked}- onClick={onContinue}- size="sm"- >- {done ? '✓ Done' : continueLabel}- </Button>- </div>- </div>- )-}diff --git a/apps/desktop/src/components/onboarding-chat/cards/setup.tsx b/apps/desktop/src/components/onboarding-chat/cards/setup.tsxdeleted file mode 100644index 24f6af85a28..00000000000--- a/apps/desktop/src/components/onboarding-chat/cards/setup.tsx+++ /dev/null@@ -1,275 +0,0 @@-import { useStore } from '@nanostores/react'-import { Puzzle } from 'lucide-react'-import { useEffect, useMemo, useState } from 'react'--import { useSessionView } from '@/app/chat/session-view'-import { $chatLayoutPicked, assembleChatOnboarding } from '@/components/onboarding-chat/assembly'-import { CardFrame, type CardProps, useCardCommit } from '@/components/onboarding-chat/cards/frame'-import { Chip } from '@/components/onboarding-chat/chip'-import {- accentsFor,- AccentSwatch,- LayoutPreviewCard,- LAYOUTS,- NOUS_ACCENT,- orderConnectorPicks-} from '@/components/onboarding-chat/options'-import type { LayoutNode } from '@/components/pane-shell/tree/model'-import { ConnectorLogo } from '@/components/ui/connector-logo'-import { SearchField } from '@/components/ui/search-field'-import { registry } from '@/contrib/registry'-import { connectorIconUrl, connectorTitle } from '@/lib/connector-tools'-import { cn } from '@/lib/utils'-import { type ConnectorCatalog, useConnectorCatalog } from '@/store/connector-catalog'-import { $onboardingAnswers, setOnboardingAnswers } from '@/store/onboarding-answers'-import { type OnboardingPlugin, pluginNeedsApp, useOnboardingPluginList } from '@/store/onboarding-plugins'-import { useTheme } from '@/themes'-import { setAccentOverride } from '@/themes/accent-override'-import { normalizeHex } from '@/themes/color'--export function ConnectorsCard({ locked }: CardProps) {- const view = useSessionView()- const storedId = useStore(view.$storedId)- const { commit, done } = useCardCommit('connectors')- const catalog = useConnectorCatalog(storedId)- const plugins = useOnboardingPluginList(storedId) ?? []-- return <ConnectorPicks catalog={catalog} commit={commit} done={done} locked={locked} plugins={plugins} />-}--interface ConnectorPicksProps {- catalog: ConnectorCatalog- commit: (summary: string) => boolean- done: boolean- locked: boolean- plugins: OnboardingPlugin[]-}--export function ConnectorPicks({ catalog, commit, done, locked, plugins }: ConnectorPicksProps) {- const answers = useStore($onboardingAnswers)- const [query, setQuery] = useState('')-- const rows = useMemo(() => (catalog.status === 'ready' ? orderConnectorPicks(catalog.rows) : []), [catalog])- const search = query.trim().toLowerCase()-- const shown = search- ? rows.filter(row => connectorTitle(row.connector).toLowerCase().includes(search))- : rows.slice(0, Math.max(0, 12 - plugins.length))-- const shownPlugins = search ? plugins.filter(plugin => plugin.title.toLowerCase().includes(search)) : plugins- const picked = rows.filter(row => answers.connectors.includes(row.connector))- const pickedPlugins = plugins.filter(plugin => answers.plugins.includes(plugin.name))- const pickedCount = picked.length + pickedPlugins.length-- const toggle = (id: string) =>- setOnboardingAnswers({- connectors: answers.connectors.includes(id)- ? answers.connectors.filter(item => item !== id)- : [...answers.connectors, id]- })-- const togglePlugin = (name: string) =>- setOnboardingAnswers({- plugins: answers.plugins.includes(name)- ? answers.plugins.filter(item => item !== name)- : [...answers.plugins, name]- })-- const summary = () => {- const apps = picked.length > 0 ? picked.map(row => row.connector).join(', ') : 'none for now'- const tools = pickedPlugins.map(plugin => plugin.name).join(', ')-- return `apps I use, not connected yet: ${apps}${tools ? `; plugins picked, not installed yet: ${tools}` : ''}`- }-- const noApps = catalog.status === 'unavailable' || (catalog.status === 'ready' && rows.length === 0)-- const noAppsLine = (- <p className="text-sm text-muted-foreground">Connections aren’t available right now — this can be set up later.</p>- )-- if (plugins.length === 0 && noApps) {- return (- <CardFrame- continueLabel="Skip this"- done={done}- locked={locked}- onContinue={() => commit('apps I use: none for now')}- >- {noAppsLine}- </CardFrame>- )- }-- return (- <CardFrame- continueLabel={pickedCount > 0 ? `Continue with ${pickedCount}` : 'None of these'}- disabled={catalog.status === 'loading'}- done={done}- locked={locked}- onContinue={() => void commit(summary())}- >- {catalog.status === 'loading' ? (- <div className="grid grid-cols-3 gap-2">- {Array.from({ length: 9 }, (_, index) => (- <div className="h-10 animate-pulse rounded-lg bg-muted/40" key={index} />- ))}- </div>- ) : (- <>- {noApps ? noAppsLine : null}- {rows.length + plugins.length > 12 ? (- <SearchField onChange={setQuery} placeholder="Find an app" value={query} />- ) : null}- <div className="grid max-h-72 grid-cols-3 gap-2 overflow-y-auto">- {shownPlugins.map(plugin => (- <Chip- className={cn(pluginNeedsApp(plugin) && 'opacity-60')}- icon={- <span className="grid size-7 shrink-0 place-items-center rounded-full bg-background text-muted-foreground">- <Puzzle className="size-4" />- </span>- }- key={`plugin:${plugin.name}`}- label={plugin.title}- on={answers.plugins.includes(plugin.name)}- onToggle={() => togglePlugin(plugin.name)}- sub={pluginNeedsApp(plugin) ? plugin.sentence : 'Plugin'}- />- ))}- {shown.map(row => (- <Chip- icon={- <ConnectorLogo- className="size-7 rounded-full text-sm"- connector={{- iconUrl: connectorIconUrl(row.connector),- name: row.connector,- title: connectorTitle(row.connector)- }}- />- }- key={row.connector}- label={connectorTitle(row.connector)}- on={answers.connectors.includes(row.connector)}- onToggle={() => toggle(row.connector)}- />- ))}- </div>- </>- )}- <p className="text-xs text-muted-foreground">- <strong className="font-medium text-foreground">Nothing connects or installs yet.</strong> Hermes will offer to- link these, or install a plugin, when a task needs them, and asks first.- </p>- </CardFrame>- )-}--function pickAccent(value: string, receipt?: string): void {- const hex = normalizeHex(value)-- if (!hex) {- return- }-- const accent = hex === NOUS_ACCENT ? null : hex-- setOnboardingAnswers({- accent,- ...(receipt ? { committed: [...$onboardingAnswers.get().committed, receipt] } : {})- })- setAccentOverride(accent)-}--export function LookCard({ attrs, locked, messageId }: CardProps) {- const answers = useStore($onboardingAnswers)- const { renderedMode } = useTheme()- const { commit, done } = useCardCommit('look')- const accents = accentsFor(renderedMode === 'dark')- const accent = answers.accent ?? NOUS_ACCENT- const picked = accents.find(swatch => swatch.hex === accent.toLowerCase())-- const requested = normalizeHex(attrs.value)- const receipt = messageId && requested ? `look-color:${JSON.stringify([messageId, requested])}` : null-- useEffect(() => {- if (locked || done) {- return- }-- if (requested && receipt && !answers.committed.includes(receipt)) {- pickAccent(requested, receipt)- } else {- setAccentOverride(answers.accent)- }- }, [answers.accent, answers.committed, done, locked, receipt, requested])-- if (attrs.value !== undefined) {- return null- }-- return (- <CardFrame done={done} locked={locked} onContinue={() => commit(`accent color: ${picked?.name ?? accent}`)}>- <div className="flex flex-wrap gap-2.5">- {accents.map(swatch => (- <AccentSwatch- active={accent.toLowerCase() === swatch.hex}- hex={swatch.hex}- key={swatch.name}- name={swatch.name}- onPick={() => pickAccent(swatch.hex)}- />- ))}- <AccentSwatch active={!picked} hex={accent} name="Custom color" onColorChange={pickAccent} />- </div>- </CardFrame>- )-}--export function LayoutCard({ locked }: CardProps) {- const answers = useStore($onboardingAnswers)- const { commit, done } = useCardCommit('layout')- const picked = useStore($chatLayoutPicked)-- const pickLayout = (id: string) => {- $chatLayoutPicked.set(true)- setOnboardingAnswers({ layout: id })-- const layout = LAYOUTS.find(candidate => candidate.id === id)-- const preset = registry.getArea('layouts').find(contribution => contribution.id === id)-- if (!preset?.data) {- return- }-- assembleChatOnboarding(preset.id, preset.data as LayoutNode, layout?.mode)- }-- return (- <CardFrame- disabled={!picked}- done={done}- locked={locked}- onContinue={() => {- const choice = LAYOUTS.find(layout => layout.id === answers.layout)-- commit(`layout: ${choice?.name ?? answers.layout}`)- }}- >- <div className="grid grid-cols-2 gap-3">- {LAYOUTS.map(layout => (- <LayoutPreviewCard- active={picked && answers.layout === layout.id}- description={layout.description}- key={layout.id}- name={layout.name}- onSelect={() => pickLayout(layout.id)}- tree={layout.tree}- />- ))}- </div>- </CardFrame>- )-}diff --git a/apps/desktop/src/components/onboarding-chat/directive.tsx b/apps/desktop/src/components/onboarding-chat/directive.tsxdeleted file mode 100644index 7e673d34440..00000000000--- a/apps/desktop/src/components/onboarding-chat/directive.tsx+++ /dev/null@@ -1,75 +0,0 @@-import { useAuiState } from '@assistant-ui/react'-import { useStore } from '@nanostores/react'-import { useEffect } from 'react'--import { useSessionView } from '@/app/chat/session-view'-import { FirstBuildCard, HandoffCard, ProgressCard } from '@/components/onboarding-chat/cards/build'-import type { CardProps } from '@/components/onboarding-chat/cards/frame'-import { ConnectorsCard, LayoutCard, LookCard } from '@/components/onboarding-chat/cards/setup'-import { type DesktopOnboardingStep, recordOnboarding } from '@/store/desktop-metrics'-import { $onboardingAnswers, setOnboardingAnswers } from '@/store/onboarding-answers'-import { $onboardingGate } from '@/store/onboarding-gate'--type AnswerField = 'name' | 'context'--const DATA_STEPS = new Map<string, AnswerField>([- ['name', 'name'],- ['working', 'context']-])--/** Guided-setup cards counted as first-run funnel steps (hermes.desktop.onboarding). */-const FUNNEL_STEPS = new Map<string, DesktopOnboardingStep>([- ['connectors', 'guide_connectors'],- ['first', 'guide_first_build'],- ['layout', 'guide_layout'],- ['look', 'guide_look']-])--const STEP_CARDS = new Map<string, (props: CardProps) => React.ReactNode>([- ['connectors', ConnectorsCard],- ['first', FirstBuildCard],- ['handoff', HandoffCard],- ['layout', LayoutCard],- ['look', LookCard],- ['progress', ProgressCard]-])--function DataDirective({ field, value }: { field: AnswerField; value: string }) {- useEffect(() => {- if (!value || $onboardingAnswers.get()[field] === value) {- return- }-- setOnboardingAnswers({ [field]: value })- }, [field, value])-- return null-}--export function OnboardingChatDirective({ attrs, streaming }: { attrs: Record<string, string>; streaming: boolean }) {- const view = useSessionView()- const storedId = useStore(view.$storedId)- const runtimeId = useStore(view.$runtimeId)- const messageId = useAuiState(state => state.message.id)- const identity = JSON.stringify([storedId ?? runtimeId, messageId])- const step = attrs.step ?? ''-- useEffect(() => {- const funnelStep = FUNNEL_STEPS.get(step)-- // Only while the guide is live — a finished setup transcript re-renders its cards on every visit.- if (funnelStep && $onboardingGate.get().phase === 'guided') {- recordOnboarding(funnelStep, 'reached')- }- }, [step])-- const field = DATA_STEPS.get(step)-- if (field) {- return <DataDirective field={field} value={(attrs.value ?? '').trim()} />- }-- const Card = STEP_CARDS.get(step)-- 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.tsdeleted file mode 100644index 4d21853e079..00000000000--- a/apps/desktop/src/components/onboarding-chat/first-build.ts+++ /dev/null@@ -1,59 +0,0 @@-import { atom } from 'nanostores'--import { segmentTranscriptDirectives } from '@/lib/transcript-directives'--const CHECK_IN_AT = [8, 20] as const--const 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: string- sessionId: string- tools: number- checkedInAt: number-}--let build: FirstBuild | null = null--export const $setupCheckIn = atom<null | { note: string; profile: string; sessionId: string; token: number }>(null)--let token = 0--export function watchFirstBuild(sessionId: string, profile: string): void {- build = { checkedInAt: 0, profile, sessionId, tools: 0 }-}--export function reportFirstBuildToolComplete(sessionId: null | string | undefined): void {- if (!build || build.sessionId !== sessionId) {- return- }-- build.tools += 1-}--export function reportFirstBuildTurnComplete(sessionId: null | string | undefined, finalText: string): void {- const current = build-- if (!current || current.sessionId !== sessionId) {- return- }-- const due = CHECK_IN_AT.filter(at => current.tools >= at && at > current.checkedInAt).pop()-- if (due === undefined || endsInAsk(finalText)) {- return- }-- current.checkedInAt = due- token += 1- $setupCheckIn.set({ note: CHECK_IN_NOTE, profile: current.profile, sessionId, token })-}--function endsInAsk(text: string): boolean {- return (- segmentTranscriptDirectives(text)?.some(- segment => segment.kind === 'directive' && segment.directive.name === 'ask'- ) === true- )-}diff --git a/apps/desktop/src/components/onboarding-chat/guide-loading.css b/apps/desktop/src/components/onboarding-chat/guide-loading.cssdeleted file mode 100644index 826edf14d77..00000000000--- a/apps/desktop/src/components/onboarding-chat/guide-loading.css+++ /dev/null@@ -1,14 +0,0 @@-@keyframes guide-controls-arrive {- from { opacity: 0; }- to { opacity: 1; }-}--[data-guide-arrived] [data-slot='composer-dock'] {- animation: guide-controls-arrive 100ms ease-out;-}--@media (prefers-reduced-motion: reduce) {- [data-guide-arrived] [data-slot='composer-dock'] {- animation: none;- }-}diff --git a/apps/desktop/src/components/onboarding-chat/intro-copy.css b/apps/desktop/src/components/onboarding-chat/intro-copy.cssindex 47b9200a27f..f3d5ec2cba2 100644--- a/apps/desktop/src/components/onboarding-chat/intro-copy.css+++ b/apps/desktop/src/components/onboarding-chat/intro-copy.css@@ -69,3 +69,23 @@transition: none;}}++/* The composer dock fades in once the setup guide has arrived (data-guide-arrived on the chat). */+@keyframes guide-controls-arrive {+ from {+ opacity: 0;+ }+ to {+ opacity: 1;+ }+}++[data-guide-arrived] [data-slot='composer-dock'] {+ animation: guide-controls-arrive 100ms ease-out;+}++@media (prefers-reduced-motion: reduce) {+ [data-guide-arrived] [data-slot='composer-dock'] {+ animation: none;+ }+}diff --git a/apps/desktop/src/components/onboarding-chat/intro-copy.tsx b/apps/desktop/src/components/onboarding-chat/intro-copy.tsxindex de56774ac91..b84f0dff510 100644--- a/apps/desktop/src/components/onboarding-chat/intro-copy.tsx+++ b/apps/desktop/src/components/onboarding-chat/intro-copy.tsx@@ -1,4 +1,3 @@-import './guide-loading.css'import './intro-copy.css'import { useStore } from '@nanostores/react'diff --git a/apps/desktop/src/components/onboarding-chat/intro.ts b/apps/desktop/src/components/onboarding-chat/intro.tsindex e9f0755674e..f346c54c7a7 100644--- a/apps/desktop/src/components/onboarding-chat/intro.ts+++ b/apps/desktop/src/components/onboarding-chat/intro.ts@@ -29,7 +29,7 @@ import { showHandoffTour } from './signpost'* the top (`landed`) until the backend's first assistant row, which carries the same words,* takes its place.*/-export type IntroCopyStage = 'hidden' | 'landed' | 'playing'+type IntroCopyStage = 'hidden' | 'landed' | 'playing'export const $introCopy = atom<IntroCopyStage>('hidden')diff --git a/apps/desktop/src/components/onboarding-chat/options.tsx b/apps/desktop/src/components/onboarding-chat/options.tsxindex af8444af0e9..d9022e30a92 100644--- a/apps/desktop/src/components/onboarding-chat/options.tsx+++ b/apps/desktop/src/components/onboarding-chat/options.tsx@@ -8,7 +8,7 @@ import { cn } from '@/lib/utils'import type { InterfaceMode } from '@/store/interface-mode'import { readableInk } from '@/themes/color'-export const CONNECTOR_LEAD_ORDER = [+const CONNECTOR_LEAD_ORDER = ['gmail','googlecalendar','googledrive',@@ -23,7 +23,7 @@ export const CONNECTOR_LEAD_ORDER = ['todoist']-export const CONNECTOR_PICKER_HIDDEN = new Set(['discord', 'discordbot', 'microsoft_teams'])+const CONNECTOR_PICKER_HIDDEN = new Set(['discord', 'discordbot', 'microsoft_teams'])export function orderConnectorPicks<T extends { connector: string; enabled?: boolean }>(rows: T[]): T[] {const rank = new Map(CONNECTOR_LEAD_ORDER.map((slug, index) => [slug, index]))@@ -103,9 +103,9 @@ export function AccentSwatch({)}-export type MiniNode = 1 | { dir: 'column' | 'row'; children: MiniNode[]; weights: number[] }+type MiniNode = 1 | { dir: 'column' | 'row'; children: MiniNode[]; weights: number[] }-export const ELITE_LAYOUT_ID = 'terminal-deck'+const ELITE_LAYOUT_ID = 'terminal-deck'export const LAYOUTS: Array<{ description: string; id: string; mode: InterfaceMode; name: string; tree: MiniNode }> = [{@@ -128,7 +128,7 @@ export const LAYOUTS: Array<{ description: string; id: string; mode: InterfaceMo}]-export function MiniTree({ node }: { node: MiniNode }) {+function MiniTree({ node }: { node: MiniNode }) {if (node === 1) {return <div className="min-h-0 min-w-0 flex-1 rounded-[3px] bg-foreground/15" />}diff --git a/apps/desktop/src/components/onboarding-chat/persisted-handoff.ts b/apps/desktop/src/components/onboarding-chat/persisted-handoff.tsdeleted file mode 100644index eb44893566e..00000000000--- a/apps/desktop/src/components/onboarding-chat/persisted-handoff.ts+++ /dev/null@@ -1,41 +0,0 @@-import type { SessionHistoryResult } from '@hermes/shared'--import { segmentTranscriptDirectives } from '@/lib/transcript-directives'-import { requestGatewayForAgent } from '@/store/gateway'--export async function readPersistedHandoff(- connectionId: null | string,- profile: string,- runtimeId: string-): Promise<null | Readonly<Record<string, string>>> {- const history = await requestGatewayForAgent<Partial<SessionHistoryResult>>(- connectionId,- profile,- 'session.history',- {- session_id: runtimeId- }- )-- const messages = Array.isArray(history?.messages) ? history.messages : []-- for (let index = messages.length - 1; index >= 0; index -= 1) {- const message = messages[index]-- if (message?.role !== 'assistant' || message.text == null) {- continue- }-- for (const segment of segmentTranscriptDirectives(message.text) ?? []) {- if (- segment.kind === 'directive' &&- segment.directive.name === 'onboarding' &&- segment.directive.attrs.step === 'handoff'- ) {- return segment.directive.attrs- }- }- }-- return null-}diff --git a/apps/desktop/src/components/onboarding-chat/setup-profile.ts b/apps/desktop/src/components/onboarding-chat/setup-profile.tsdeleted file mode 100644index b5fae246aba..00000000000--- a/apps/desktop/src/components/onboarding-chat/setup-profile.ts+++ /dev/null@@ -1,254 +0,0 @@-import { atom } from 'nanostores'--import type { ProfileScope } from '@/api/client'-import type { HandoffReceipt } from '@/app/contrib/handoff-leg'-import { handoffReceiptKey, readHandoffReceipt } from '@/app/contrib/handoff-receipt'-import { CONNECTOR_LEAD_ORDER } from '@/components/onboarding-chat/options'-import { connectorTitle } from '@/lib/connector-tools'-import { activeGatewayConnectionId } from '@/store/gateway'-import { machineDescription } from '@/store/machine'-import type { OnboardingAnswers } from '@/store/onboarding-answers'-import { readOnboardingCapabilities } from '@/store/onboarding-capabilities'-import { FIRST_USE_GUIDANCE, PLAIN_SPEECH } from '@/store/onboarding-script'-import { getSessionOwnerHint } from '@/store/session'--export type SetupHandoffPhase = 'done' | 'error' | 'opening' | 'pending'--export type HandoffPlan = 'build' | 'machine-setup' | 'plugin'--const HANDOFF_PLANS: readonly HandoffPlan[] = ['build', 'machine-setup', 'plugin']--export function parseHandoffPlan(raw: string | undefined): HandoffPlan {- const value = (raw ?? '').trim().toLowerCase()-- return HANDOFF_PLANS.find(plan => plan === value) ?? 'build'-}--export interface SetupHandoffState {- guide?: SetupSession- task: string- brief: string- phase: SetupHandoffPhase- plan: HandoffPlan- sessionTitle?: string-}--export const $setupHandoff = atom<null | SetupHandoffState>(null)-export const $handoffError = atom<string | null>(null)--export function retrySetupHandoff(): void {- const state = $setupHandoff.get()-- if (state?.phase !== 'error') {- return- }-- $handoffError.set(null)- $setupHandoff.set({ ...state, phase: 'pending' })-}--export interface SetupSession {- connectionId: null | string- profile: string- runtimeId: string- storedId: null | string-}--export const $setupSession = atom<null | SetupSession>(null)--export function guideSourceConnectionId(guideStoredId: null | string | undefined): null | string {- return (guideStoredId && getSessionOwnerHint(guideStoredId)?.connectionId) || activeGatewayConnectionId() || null-}--export function guideHandoffReceiptKey(guideStoredId: string): string {- return handoffReceiptKey(guideSourceConnectionId(guideStoredId), guideStoredId)-}--export function readGuideHandoffReceipt(guideStoredId: string): { key: string; receipt: HandoffReceipt | null } {- const key = guideHandoffReceiptKey(guideStoredId)-- return { key, receipt: readHandoffReceipt(key) }-}--export function requestSetupHandoff(task: string, brief: string, plan: HandoffPlan, guide: SetupSession): boolean {- if (- $setupHandoff.get() !== null ||- (guide.storedId && readGuideHandoffReceipt(guide.storedId).receipt?.status === 'accepted')- ) {- return false- }-- $setupHandoff.set({ brief, phase: 'pending', plan, task, guide })-- return true-}--export function firstTaskTitle(task: string): string {- const trimmed = task.trim()-- return trimmed.length > 28 ? `${trimmed.slice(0, 27).trimEnd()}…` : trimmed || 'First build'-}--export function buildFirstTaskRunbook(- task: string,- answers: OnboardingAnswers,- plan: HandoffPlan = 'build',- pluginRoot = '',- capabilities = ''-): string {- const name = (answers.name ?? '').trim()- const context = (answers.context ?? '').trim()- const tools = (answers.connectors ?? []).filter(slug => CONNECTOR_LEAD_ORDER.includes(slug))- const connectFirst = tools.length > 0 && plan !== 'machine-setup'-- return [- `You are Hermes. The user's welcome chat just opened this session so one task can have room to run: ${task.trim()}.`,- 'This message is invisible to the user — never reference it or the mechanics described here.',- name ? `The user is called ${name} — you already know that, so never introduce yourself or ask who they are.` : '',- context- ? `They already said what they are working on: ${context}. Let it shape your choices without re-asking.`- : '',- tools.length && !connectFirst- ? `Apps they said they use: ${tools.map(connectorTitle).join(', ')}. Some may already be connected from onboarding; check with manage_connections action="status" before assuming either way, and never require an unconnected one for this first build.`- : '',- connectFirst- ? 'Their next message is the go signal. Before any plan and before any other tool, connect their apps as the CONNECT FIRST section says; the work itself starts the moment that call returns.'- : 'Their next message is the go signal: really begin the work — plan briefly, then build (scaffold, research, first artifact).',- "As you start, tell them in one short sentence: you'll ask for permissions as you go, and they can say no to anything or redirect you.",- capabilities,- FIRST_USE_GUIDANCE,- ...planRunbook(plan, pluginRoot, connectFirst),- ...(connectFirst ? connectFirstRunbook(tools) : []),- pluginsRunbook(answers),- 'While the work runs, place ::onboarding{step="progress" title="what you\'re doing"} as its own paragraph at the start of each status turn — the card shows the build breathing live. Keep the titles short and present-tense ("Scaffolding the project", "Wiring the reminder"). Emit each exactly like that, alone on its own line.',- 'When the first pass of the build is DONE: end that turn with ::ask{question="Does this match what you wanted?" options="Looks right|Change something|Take it further"} alone as its own paragraph, emitted EXACTLY as written. Act on their pick immediately. One unreviewed first output is how a build reads as broken; the ask is how it reads as a collaboration.',- PLAIN_SPEECH- ]- .filter(Boolean)- .join(' ')-}--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.'--function connectFirstRunbook(picks: string[]): string[] {- const named = picks.map(slug => `${slug} (${connectorTitle(slug)})`).join(', ')-- return [- `CONNECT FIRST. During setup the user picked these apps, given here as exact gateway slugs: ${named}. Your first action in this session, before any plan and before any other tool call, is ONE manage_connections call with action="connect" and connectors set to every one of those slugs. Do not call action="status" first; the slugs are exact and the catalog check is already done.`,- 'That one call shows the user one card with a row per app and blocks until every app is connected, or the user presses Continue, or the deadline passes. Never paste links, and never call "connect" again while the card is up. Its result lists each app as connected, skipped or not_connected.',- 'When the result shows every app connected, begin the task at once. When some are skipped or not_connected, the user moved on: begin with the connected apps only, build the version of the task that needs no account for the rest, and say in one line what each missing connection would have added. Do not offer to connect again; the user asks when they want that.',- 'Account data comes from the connected apps first. Tools already signed in on this machine, like a logged-in gh, are fair to use when the task benefits; say so in one line when you do.',- "Discover a connected app's tools with tool_search and use real results for the task; never fabricate account data. Reading is separate from sending, deleting or scheduling: ask before those. No recurring job unless that is what they asked for.",- 'Make the result something they can open: a single HTML page when the idea allows it, and at least one real reading or action through a connected app.'- ]-}--export function pluginsRunbook(answers: Pick<OnboardingAnswers, 'pluginOutcomes' | 'plugins'>): string {- const outcomes = answers.pluginOutcomes ?? {}- const names = [...new Set([...(answers.plugins ?? []), ...Object.keys(outcomes)])]-- if (names.length === 0) {- return ''- }-- const installed = names.filter(name => outcomes[name]?.state === 'installed')- const offered = names.filter(name => outcomes[name] && outcomes[name].state !== 'installed')- const notOffered = names.filter(name => !outcomes[name])-- const ready = installed.map(name => {- const { skill, tools } = outcomes[name]- const parts = [tools.length ? `${tools.length} tools` : '', skill ? `skill ${skill}` : ''].filter(Boolean)-- return parts.length ? `${name} (${parts.join(', ')})` : name- })-- const missed = offered.map(name => {- const { detail, state } = outcomes[name]-- return `${name} (${state === 'failed' ? `failed: ${detail || 'no reason given'}` : 'skipped by the user'})`- })-- return [- 'PLUGINS FROM ONBOARDING.',- ready.length- ? `Installed during onboarding and ready in this chat now: ${ready.join(', ')}. Discover their tools with tool_search and use them when the task benefits; read a named skill with skill_view using that exact name. A tool whose app is not running reports that; say so plainly.`- : '',- missed.length ? `Offered during onboarding and not installed: ${missed.join(', ')}.` : '',- notOffered.length ? `Picked during onboarding but not offered for install: ${notOffered.join(', ')}.` : '',- 'Do not install plugins yourself and do not ask to; if they want one later, they can add it from Settings, Plugins.'- ]- .filter(Boolean)- .join(' ')-}--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.',- 'MATCH THE PLAN TO THEIR USE. Email, calendars, documents and meetings do not require a developer stack. WSL runs Linux tools on Windows; CUDA lets compatible software compute on an NVIDIA GPU. Recommend either only for a verified prerequisite of their chosen task, explain that concrete benefit before asking, and omit it otherwise. Prefer native or already-working tools. Do not suggest WSL on Linux or macOS, or reinstall CUDA just because this is a Spark.',- 'THEN PROPOSE, THEN ASK. Turn the gaps into a short numbered plan, cheapest and most obviously useful first: system updates, a package manager if missing, their everyday tools, sane defaults, and only then anything exotic. End that turn with ::ask{question="Want me to run this?" options="Go ahead|Change the list|Just the essentials"} alone as its own paragraph, emitted EXACTLY as written.',- 'THEN WORK IT ONE STEP AT A TIME, saying in one short line what each step is for before you run it. Prefer the official package manager over downloading installers. Never install something they did not agree to, never overwrite existing config without asking first, never disable security settings, and stop and ask the moment anything looks destructive or wants a password you were not given.',- 'Hardware and drivers: on Windows, check for missing/unknown devices and vendor GPU drivers, and say plainly when the OS already has it handled. On macOS, system updates and the App Store cover drivers — say so instead of inventing work. On Linux, check the kernel/driver pairing for the GPU before touching it.',- 'If the machine is Arm (an Arm64 Windows PC, an Apple silicon Mac), architecture is the first thing you check for every install: prefer the native arm64 build, say so when only an emulated x64 one exists, and never assume a tool has an Arm release because it is popular. On an Arm Windows PC with NVIDIA silicon, treat CUDA and anything GPU-adjacent as arm64-specific — verify the build before installing it.',- 'Anything that genuinely needs their sign-in, a licence key, or a payment: do not attempt it. Collect those into a short "yours to do" list for the end.',- '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.'-]--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.`,- 'LOOK BEFORE YOU WRITE. Read the `building-hermes-desktop-plugins` skill first — it has the SDK surface, the areas you can render into, and the traps. If the machine has a checkout of NousResearch/plugins, read a plugin close to what you are making; those thirteen are reviewed and show the real shapes (a statusbar chip, a composer action, a full pane).',- 'START SMALL AND VISIBLE. The first save should put something on screen even if it only renders a label — a chip that says the right word beats a half-written dashboard, because they SEE it work and everything after that is refinement they are watching. Build up from there in passes.',- 'Say what you are doing in one short line per pass, and tell them where to look the first time it appears ("bottom right of the status bar" / "it is in the right pane now"). A plugin that loaded silently reads as nothing having happened.',- '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.'-]--function planRunbook(plan: HandoffPlan, pluginRoot: string, connectFirst: boolean): string[] {- switch (plan) {- case 'machine-setup':- return machineSetupRunbook()-- case 'plugin':- if (!pluginRoot) {- throw new Error('The desktop plugin folder is unavailable. Retry before starting the first build.')- }-- return connectFirst ? pluginRunbook(pluginRoot) : [...pluginRunbook(pluginRoot), NO_AUTH_RULE]-- default:- return connectFirst ? [] : [NO_AUTH_RULE]- }-}--function machineSetupRunbook(): string[] {- const description = machineDescription()-- return description- ? [`App-reported setup and hardware signals, not proof of device age: ${description}.`, ...MACHINE_SETUP_RUNBOOK]- : MACHINE_SETUP_RUNBOOK-}--export async function buildFirstTaskSeedMessages(- task: string,- answers: OnboardingAnswers,- plan: HandoffPlan = 'build',- scope?: ProfileScope-): Promise<{ content: string; display_kind?: 'hidden'; role: 'assistant' | 'user' }[]> {- const root = plan === 'plugin' ? await window.hermesDesktop?.desktopPluginsRoot?.() : undefined-- const capabilities =- plan === 'machine-setup'- ? ''- : await readOnboardingCapabilities(scope, {- apps: answers.connectors,- context: `${task} ${answers.context}`- })-- return [- { content: buildFirstTaskRunbook(task, answers, plan, root, capabilities), display_kind: 'hidden', role: 'user' }- ]-}--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/setup-session.ts b/apps/desktop/src/components/onboarding-chat/setup-session.tsnew file mode 100644index 00000000000..b3f5a175836--- /dev/null+++ b/apps/desktop/src/components/onboarding-chat/setup-session.ts@@ -0,0 +1,17 @@+import { atom } from 'nanostores'++import { activeGatewayConnectionId } from '@/store/gateway'+import { getSessionOwnerHint } from '@/store/session'++export interface SetupSession {+ connectionId: null | string+ profile: string+ runtimeId: string+ storedId: null | string+}++export const $setupSession = atom<null | SetupSession>(null)++export function guideSourceConnectionId(guideStoredId: null | string | undefined): null | string {+ return (guideStoredId && getSessionOwnerHint(guideStoredId)?.connectionId) || activeGatewayConnectionId() || null+}diff --git a/apps/desktop/src/components/onboarding-chat/signpost.ts b/apps/desktop/src/components/onboarding-chat/signpost.tsindex b95f1418b4c..ede78c30469 100644--- a/apps/desktop/src/components/onboarding-chat/signpost.ts+++ b/apps/desktop/src/components/onboarding-chat/signpost.ts@@ -46,8 +46,8 @@ export async function showHandoffTour(): Promise<void> {const localVisible = localModel !== null && pillVisibleconst copy = (key: string, ...args: unknown[]) => translateNow(`handoffTour.${key}`, ...args)- // 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.+ // Imported here instead of at the top: this module is reachable from the boot path through intro.ts+ // (finishGuidedOnboarding), 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/hooks/use-mobile.ts b/apps/desktop/src/hooks/use-mobile.tsindex 7865d3cb706..8f4077e8a0c 100644--- a/apps/desktop/src/hooks/use-mobile.ts+++ b/apps/desktop/src/hooks/use-mobile.ts@@ -3,6 +3,6 @@ import { useMediaQuery } from './use-media-query'/** Narrower than this and the sidebar stops being a docked column: it renders* as a floating Sheet over the content instead (components/ui/sidebar.tsx).* Anything that sizes a window around a docked sidebar has to clear it. */-export const DOCKED_SIDEBAR_MIN_PX = 768+const DOCKED_SIDEBAR_MIN_PX = 768export const useIsMobile = () => useMediaQuery(`(max-width: ${(DOCKED_SIDEBAR_MIN_PX - 1) / 16}rem)`)diff --git a/apps/desktop/src/i18n/ar_boot.ts b/apps/desktop/src/i18n/ar_boot.tsindex 5e74fdba4f5..cdbd5addefd 100644--- a/apps/desktop/src/i18n/ar_boot.ts+++ b/apps/desktop/src/i18n/ar_boot.ts@@ -315,8 +315,6 @@ export const arBoot = {copyAuthCode: 'انسخ رمز التفويض وألصقه أدناه.',pasteAuthCode: 'ألصق رمز التفويض',reopenAuthPage: 'إعادة فتح صفحة التفويض',- autoBrowser: provider => `فتحنا ${provider} في المتصفح. صرّح لـ Hermes هناك وسيتم الاتصال تلقائياً دون نسخ أو لصق.`,- reopenSignInPage: 'إعادة فتح صفحة تسجيل الدخول',waitingAuthorize: 'بانتظار التفويض...',externalPending: provider =>`${provider} يسجل الدخول عبر أداة سطر الأوامر الخاصة به. شغّل هذا الأمر في الطرفية، ثم عد واختر "سجلت الدخول":`,diff --git a/apps/desktop/src/i18n/de_onboarding.ts b/apps/desktop/src/i18n/de_onboarding.tsindex 2b0805f868f..5af5a481b24 100644--- a/apps/desktop/src/i18n/de_onboarding.ts+++ b/apps/desktop/src/i18n/de_onboarding.ts@@ -82,9 +82,6 @@ export const deOnboarding: TranslationOverrides['onboarding'] = {copyAuthCode: 'Kopieren Sie den Autorisierungscode und fügen Sie ihn unten ein.',pasteAuthCode: 'Autorisierungscode einfügen',reopenAuthPage: 'Autorisierungsseite erneut öffnen',- autoBrowser: provider =>- `Wir haben ${provider} in Ihrem Browser geöffnet. Autorisieren Sie Hermes dort, und Sie werden automatisch verbunden – nichts zu kopieren oder einzufügen.`,- reopenSignInPage: 'Anmeldeseite erneut öffnen',waitingAuthorize: 'Warten auf Ihre Autorisierung…',externalPending: provider =>`${provider} meldet sich über seine eigene CLI an. Führen Sie diesen Befehl in einem Terminal aus, kehren Sie dann zurück und wählen Sie „Ich habe mich angemeldet“:`,diff --git a/apps/desktop/src/i18n/en_onboarding.ts b/apps/desktop/src/i18n/en_onboarding.tsindex 49acf80a9c9..b176a9e981e 100644--- a/apps/desktop/src/i18n/en_onboarding.ts+++ b/apps/desktop/src/i18n/en_onboarding.ts@@ -70,9 +70,6 @@ export const enOnboarding: Translations['onboarding'] = {copyAuthCode: 'Copy the authorization code and paste it below.',pasteAuthCode: 'Paste authorization code',reopenAuthPage: 'Re-open authorization page',- autoBrowser: provider =>- `We opened ${provider} in your browser. Authorize Hermes there and you'll be connected automatically — nothing to copy or paste.`,- reopenSignInPage: 'Re-open sign-in page',waitingAuthorize: 'Waiting for you to authorize...',externalPending: provider =>`${provider} signs in through its own CLI. Run this command in a terminal, then come back and pick "I've signed in":`,diff --git a/apps/desktop/src/i18n/es_onboarding.ts b/apps/desktop/src/i18n/es_onboarding.tsindex 08219c49015..95b66b73b64 100644--- a/apps/desktop/src/i18n/es_onboarding.ts+++ b/apps/desktop/src/i18n/es_onboarding.ts@@ -81,9 +81,6 @@ export const esOnboarding: TranslationOverrides['onboarding'] = {copyAuthCode: 'Copia el código de autorización y pégalo abajo.',pasteAuthCode: 'Pegar código de autorización',reopenAuthPage: 'Volver a abrir página de autorización',- autoBrowser: provider =>- `Abrimos ${provider} en tu navegador. Autoriza Hermes allí y te conectarás automáticamente; no hay nada que copiar o pegar.`,- reopenSignInPage: 'Volver a abrir página de inicio de sesión',waitingAuthorize: 'Esperando tu autorización...',externalPending: provider =>`${provider} inicia sesión con su propia CLI. Ejecuta este comando en una terminal y luego vuelve y elige "Ya inicié sesión":`,diff --git a/apps/desktop/src/i18n/fr_onboarding.ts b/apps/desktop/src/i18n/fr_onboarding.tsindex b2c5e8e183a..28989fb9f0b 100644--- a/apps/desktop/src/i18n/fr_onboarding.ts+++ b/apps/desktop/src/i18n/fr_onboarding.ts@@ -82,9 +82,6 @@ export const frOnboarding: TranslationOverrides['onboarding'] = {copyAuthCode: "Copiez le code d'autorisation et collez-le ci-dessous.",pasteAuthCode: "Coller le code d'autorisation",reopenAuthPage: "Rouvrir la page d'autorisation",- autoBrowser: provider =>- `Nous avons ouvert ${provider} dans votre navigateur. Autorisez Hermes là-bas et vous serez connecté automatiquement — rien à copier ou coller.`,- reopenSignInPage: 'Rouvrir la page de connexion',waitingAuthorize: 'En attente de votre autorisation...',externalPending: provider =>`${provider} se connecte via sa propre CLI. Exécutez cette commande dans un terminal, puis revenez et choisissez « Je me suis connecté » :`,diff --git a/apps/desktop/src/i18n/ja_onboarding.ts b/apps/desktop/src/i18n/ja_onboarding.tsindex d13568dbeeb..34a147883c7 100644--- a/apps/desktop/src/i18n/ja_onboarding.ts+++ b/apps/desktop/src/i18n/ja_onboarding.ts@@ -64,9 +64,6 @@ export const jaOnboarding: TranslationOverrides['onboarding'] = {copyAuthCode: '認証コードをコピーして以下に貼り付けてください。',pasteAuthCode: '認証コードを貼り付け',reopenAuthPage: '認証ページを再度開く',- autoBrowser: provider =>- `${provider} をブラウザーで開きました。Hermes をそこで承認すれば自動接続されます。コピーや貼り付けは不要です。`,- reopenSignInPage: 'サインインページを再度開く',waitingAuthorize: '承認を待っています...',externalPending: provider =>`${provider} は独自の CLI からサインインします。ターミナルでこのコマンドを実行してから、戻って「サインインしました」を選択してください:`,diff --git a/apps/desktop/src/i18n/ru_onboarding.ts b/apps/desktop/src/i18n/ru_onboarding.tsindex 8925a2f8404..ecaab514d63 100644--- a/apps/desktop/src/i18n/ru_onboarding.ts+++ b/apps/desktop/src/i18n/ru_onboarding.ts@@ -61,9 +61,6 @@ export const ruOnboarding: TranslationOverrides['onboarding'] = {copyAuthCode: 'Скопируйте код авторизации и вставьте его ниже.',pasteAuthCode: 'Вставьте код авторизации',reopenAuthPage: 'Открыть страницу авторизации снова',- autoBrowser: provider =>- `Мы открыли ${provider} в вашем браузере. Авторизуйте Hermes там, и подключение произойдёт автоматически — ничего копировать и вставлять не нужно.`,- reopenSignInPage: 'Открыть страницу входа снова',waitingAuthorize: 'Ждём вашей авторизации...',externalPending: provider =>`${provider} входит через собственный CLI. Выполните эту команду в терминале, затем вернитесь и выберите «Я вошёл»:`,diff --git a/apps/desktop/src/i18n/types_onboarding.ts b/apps/desktop/src/i18n/types_onboarding.tsindex 610c6e09b13..752a736d6d8 100644--- a/apps/desktop/src/i18n/types_onboarding.ts+++ b/apps/desktop/src/i18n/types_onboarding.ts@@ -46,8 +46,6 @@ export interface OnboardingTranslations {copyAuthCode: stringpasteAuthCode: stringreopenAuthPage: string- autoBrowser: (provider: string) => string- reopenSignInPage: stringwaitingAuthorize: stringexternalPending: (provider: string) => stringsignedIn: stringdiff --git a/apps/desktop/src/i18n/zh-hant_boot.ts b/apps/desktop/src/i18n/zh-hant_boot.tsindex 4a8b1f109ef..5f6aa70b4cd 100644--- a/apps/desktop/src/i18n/zh-hant_boot.ts+++ b/apps/desktop/src/i18n/zh-hant_boot.ts@@ -318,8 +318,6 @@ export const zhHantBoot = {copyAuthCode: '複製授權碼並貼到下方。',pasteAuthCode: '貼上授權碼',reopenAuthPage: '重新開啟授權頁面',- autoBrowser: provider => `已在瀏覽器中開啟 ${provider}。請在那裡授權 Hermes,連線會自動完成,無需複製或貼上。`,- reopenSignInPage: '重新開啟登入頁面',waitingAuthorize: '等待您授權...',externalPending: provider => `${provider} 透過自己的 CLI 登入。請在終端機執行此指令,然後回來選擇「我已登入」:`,signedIn: '我已登入',diff --git a/apps/desktop/src/i18n/zh_onboarding.ts b/apps/desktop/src/i18n/zh_onboarding.tsindex c1d5a228c1a..b820a034184 100644--- a/apps/desktop/src/i18n/zh_onboarding.ts+++ b/apps/desktop/src/i18n/zh_onboarding.ts@@ -59,8 +59,6 @@ export const zhOnboarding: TranslationOverrides['onboarding'] = {copyAuthCode: '复制授权码并粘贴到下面。',pasteAuthCode: '粘贴授权码',reopenAuthPage: '重新打开授权页面',- autoBrowser: provider => `已在浏览器中打开 ${provider}。请在那里授权 Hermes,连接会自动完成,无需复制或粘贴。`,- reopenSignInPage: '重新打开登录页面',waitingAuthorize: '等待你授权...',externalPending: provider => `${provider} 通过自己的 CLI 登录。请在终端运行此命令,然后回来选择“我已登录”:`,signedIn: '我已登录',diff --git a/apps/desktop/src/lib/chat-messages/parts.ts b/apps/desktop/src/lib/chat-messages/parts.tsindex dd468f9b1fa..a983c0d84a9 100644--- a/apps/desktop/src/lib/chat-messages/parts.ts+++ b/apps/desktop/src/lib/chat-messages/parts.ts@@ -645,11 +645,3 @@ export function appendAssistantTextPart(return next}--/** True when a visible user message follows `messageId` — the reader has moved- * on, so a question card at `messageId` counts as answered. */-export function answeredAfter(messages: ChatMessage[], messageId: string): boolean {- const at = messages.findIndex(message => message.id === messageId)-- return at !== -1 && messages.slice(at + 1).some(message => message.role === 'user' && !message.hidden)-}diff --git a/apps/desktop/src/lib/onboarding-recommendations.ts b/apps/desktop/src/lib/onboarding-recommendations.tsdeleted file mode 100644index 58d8e1ae398..00000000000--- a/apps/desktop/src/lib/onboarding-recommendations.ts+++ /dev/null@@ -1,82 +0,0 @@-import type { McpCatalogEntry } from '@/types/hermes'--export interface OnboardingInterests {- apps?: readonly string[]- context?: string-}--export interface OnboardingRecommendation {- name: string- description: string- examples: string[]- detectedApps: string[]- readiness: 'configured_unverified' | 'setup_required'- requiresApp: boolean- authType: string- setupAction: 'install' | 'enable' | null-}--const words = (text: string): string =>- text- .toLowerCase()- .split(/[^\p{L}\p{N}]+/u)- .filter(Boolean)- .join(' ')--export function onboardingRecommendations(- entries: readonly McpCatalogEntry[],- { apps = [], context = '' }: OnboardingInterests = {}-): OnboardingRecommendation[] {- const selected = new Set(apps.map(words))- const subject = ` ${words(context)} `-- const candidates = entries.flatMap(entry => {- const examples = [...new Set(entry.suggest?.examples ?? [])].filter(text => text.trim())-- const terms = [entry.name, ...(entry.suggest?.keywords ?? []), ...(entry.suggest?.applications ?? [])]- .map(words)- .filter(Boolean)-- const preferred = terms.some(term => selected.has(term))- const topical = terms.some(term => subject.includes(` ${term} `))- const detectedApps = entry.detected_apps ?? []- const configured = entry.installed && entry.enabled-- if (entry.installed && !entry.enabled && !preferred && !topical) {- return []- }-- if (entry.suggest?.requires_app && !detectedApps.length && !entry.installed) {- return []- }-- if (!configured && !detectedApps.length && !preferred && !topical) {- return []- }-- const recommendation: OnboardingRecommendation = {- name: entry.name,- description: entry.description,- examples: examples.slice(0, preferred || topical ? 3 : 1),- detectedApps,- readiness: configured ? 'configured_unverified' : 'setup_required',- requiresApp: entry.suggest?.requires_app === true,- authType: entry.auth_type,- setupAction: !entry.installed ? 'install' : !entry.enabled ? 'enable' : null- }-- return [{ recommendation, topical, preferred, configured, detected: detectedApps.length > 0 }]- })-- return candidates- .sort(- (a, b) =>- Number(b.topical) - Number(a.topical) ||- Number(b.preferred) - Number(a.preferred) ||- Number(b.configured) - Number(a.configured) ||- Number(b.detected) - Number(a.detected) ||- a.recommendation.name.localeCompare(b.recommendation.name)- )- .slice(0, 6)- .map(candidate => candidate.recommendation)-}diff --git a/apps/desktop/src/lib/transcript-directives.ts b/apps/desktop/src/lib/transcript-directives.tsindex 91c117f690a..a01f771c362 100644--- a/apps/desktop/src/lib/transcript-directives.ts+++ b/apps/desktop/src/lib/transcript-directives.ts@@ -17,10 +17,8 @@ import type { ReactNode } from 'react'* a name nobody registered — and a malformed one — stays exactly the text it* always was. Position used to be the guard too (a directive had to be the* whole paragraph), and that cost more than it bought: a model that wrote the- * directive at the end of its sentence instead of alone under it put raw- * `::onboarding{step="look"}` in front of the user AND swallowed the card,- * which on a step whose card is the only way forward stops the conversation- * dead. So a directive is recognised wherever it starts a word, and the+ * directive at the end of its sentence instead of alone under it put the raw+ * directive in front of the user AND swallowed the card. So a directive is recognised wherever it starts a word, and the* paragraph around it keeps rendering as prose.** Attributes are untrusted model output: plugins validate their own fields.@@ -108,25 +106,6 @@ function parseAttrs(body: string | undefined): ParsedTranscriptDirective['attrs'return attrs}-/**- * True when a STILL-STREAMING paragraph should be withheld as a directive in- * progress. Deltas land ~3 chars at a time, and `::ask{question="Wha` cannot- * parse until the final `}` lands — exactly the window where raw directive- * text used to flash. A lone `:` is the same line one delta earlier. The- * check covers the paragraph-leading case (the authored shape for onboarding- * cards); a directive a model appends mid-sentence streams as prose until it- * completes, which reads as ordinary typing rather than leaked markup.- *- * Only ever consult this while the message is streaming: a SETTLED paragraph- * that starts with `::` but doesn't parse is an authoring bug the user should- * see as text, and callers must keep that behavior.- */-export function isDirectiveInProgress(text: string): boolean {- const trimmed = text.trimStart()-- return trimmed === ':' || trimmed.startsWith('::')-}-/*** Split a paragraph into its prose runs and the directives embedded in them,* in the order they were written. Null when it holds no directive at all.diff --git a/apps/desktop/src/store/clarify.ts b/apps/desktop/src/store/clarify.tsindex 1e336c8c2fd..893d2ca6bf9 100644--- a/apps/desktop/src/store/clarify.ts+++ b/apps/desktop/src/store/clarify.ts@@ -243,7 +243,7 @@ export function clearClarifyRequest(requestId?: string, sessionId?: string | nul}}-export interface SetupChooseStage {+interface SetupChooseStage {draft: string/*** The name each row of the card shows, by id: a typed answer still names the rows staged with it, anddiff --git a/apps/desktop/src/store/connector-catalog.ts b/apps/desktop/src/store/connector-catalog.tsindex ea0b9b3c958..64857974cfa 100644--- a/apps/desktop/src/store/connector-catalog.ts+++ b/apps/desktop/src/store/connector-catalog.ts@@ -30,8 +30,7 @@ import { $activeGatewayProfile } from '@/store/profile'import { assertSessionOwnerResolved } from '@/store/session-owner-resolution'import { isSessionOwnerRoute } from '@/store/session-request-router'-export type ConnectorCatalog =- { status: 'loading' } | { status: 'ready'; rows: ConnectorRow[] } | { status: 'unavailable' }+type ConnectorCatalog = { status: 'loading' } | { status: 'ready'; rows: ConnectorRow[] } | { status: 'unavailable' }/** The picks card remounts on every transcript rebuild (each hidden submit, each turn end), so the read is* held in the query cache per session: a remount paints the rows it already has instead of flashing back todiff --git a/apps/desktop/src/store/desktop-metrics.ts b/apps/desktop/src/store/desktop-metrics.tsindex 3898f4c69cf..e76db469408 100644--- a/apps/desktop/src/store/desktop-metrics.ts+++ b/apps/desktop/src/store/desktop-metrics.ts@@ -183,7 +183,6 @@ export type DesktopNoticeId =| 'install_method'| 'mcp_health'| 'model_warning'- | 'onboarding_handoff'| 'other'| 'restored_draft'| 'runtime_not_ready'@@ -204,7 +203,6 @@ const NOTICE_IDS: Record<string, DesktopNoticeId> = {'desktop-update-available': 'update_available','gui-contract-skew': 'gui_skew','install-method-not-supported': 'install_method',- 'onboarding-handoff': 'onboarding_handoff','runtime-not-ready': 'runtime_not_ready','terminal-backend-unavailable': 'terminal_backend','voice-live-unavailable': 'voice_live_unavailable',@@ -253,10 +251,6 @@ export type DesktopOnboardingStep =| 'first_message'| 'free_tier_ready'| 'guide'- | 'guide_connectors'- | 'guide_first_build'- | 'guide_layout'- | 'guide_look'| 'guide_skip'| 'model_pick'| 'provider_api_key'diff --git a/apps/desktop/src/store/local-setup-offer.ts b/apps/desktop/src/store/local-setup-offer.tsindex 01c7c011702..5b4e1484635 100644--- a/apps/desktop/src/store/local-setup-offer.ts+++ b/apps/desktop/src/store/local-setup-offer.ts@@ -307,12 +307,6 @@ export function acceptLocalSetupOffer(): void {transition('accepted', {})}-/** The card is live: shown, still eligible. The composer adds "and this session is idle". */-export const $localSetupCardLive = computed(- [$localSetupOffer, $localSetupEligibility],- (offer, eligibility) => offer.state === 'shown' && Boolean(eligibility?.fit)-)-/** The model-menu row stays until setup completes, whatever happened to the card. */export const $localSetupRowFit = computed($localSetupEligibility, eligibility => eligibility?.fit ?? null)diff --git a/apps/desktop/src/store/machine.ts b/apps/desktop/src/store/machine.tsdeleted file mode 100644index 80adfe27137..00000000000--- a/apps/desktop/src/store/machine.ts+++ /dev/null@@ -1,139 +0,0 @@-/** Machine facts load before the runbook is built so a new computer or a Spark can lead with machine setup as- * the first task. */--import { atom } from 'nanostores'--import type { DesktopMachineProfile } from '@/global'--/** 21 days leaves time to finish setup without counting a daily-use machine as new. */-const NEW_MACHINE_DAYS = 21--export const $machine = atom<DesktopMachineProfile | null>(null)--export async function loadMachineProfile(): Promise<void> {- if ($machine.get()) {- return- }-- const profile = await window.hermesDesktop?.getMachineProfile?.().catch(() => null)-- if (profile) {- $machine.set(profile)- }-}--/** An unknown age counts as not new. Machine setup is still offered; age makes it lead only when the age is- * known and within NEW_MACHINE_DAYS. */-export function machineLooksNew(): boolean {- const age = $machine.get()?.ageDays-- return age != null && age <= NEW_MACHINE_DAYS-}--/** Generic login names that are not a person's name. A short handle such as 'akp' is still usable. */-const NON_NAME_USERNAMES = new Set([- 'admin',- 'administrator',- 'default',- 'guest',- 'me',- 'owner',- 'root',- 'test',- 'user'-])--/** The login handle is only a suggestion; the user still chooses their name.- * Null means the guide asks without a default. */-export function machineUserName(): string | null {- const raw = ($machine.get()?.username ?? '').trim()-- if (raw.length < 2 || raw.length > 20) {- return null- }-- return NON_NAME_USERNAMES.has(raw.toLowerCase()) ? null : raw-}--/** Names the OS language for the model, independent of the UI's bundled locales. Returns null for English and- * for a missing or invalid tag, which need no language instruction. */-export function machineLanguageName(): string | null {- const tag = ($machine.get()?.locale ?? '').trim()-- if (!tag || /^en\b/i.test(tag)) {- return null- }-- try {- const name = new Intl.DisplayNames(['en'], { fallback: 'code', type: 'language' }).of(tag)-- return name && name.toLowerCase() !== 'english' ? name : null- } catch {- return null- }-}--/** Recognize RTX Sparks by platform/architecture/GPU and DGX Sparks by model.- * Device-tree underscores separate words: real units report NVIDIA_DGX_Spark. */-export function machineIsSpark(): boolean {- const profile = $machine.get()-- if (!profile) {- return false- }-- const rtx = profile.platform === 'win32' && profile.arch === 'arm64' && profile.nvidia- const dgx = /\b(dgx|spark|gb10)\b/i.test(profile.model.replace(/_/g, ' '))-- return rtx || dgx-}--/** True when machine setup should be the only first task shown, with the other options behind one more tap. */-export function machineSetupLeads(): boolean {- return machineIsSpark() || machineLooksNew()-}--export function machineKind(): string {- if (machineIsSpark()) {- return 'Spark'- }-- switch ($machine.get()?.platform) {- case 'darwin':- return 'Mac'-- case 'win32':- return 'PC'-- default:- return 'computer'- }-}--/** The age comes first in the description because a new machine needs setup work that a daily-use machine may- * already have done. */-export function machineDescription(): string {- const profile = $machine.get()-- if (!profile) {- return ''- }-- return [- machineLooksNew() ? `set up ${daysAgo(profile.ageDays)}` : '',- machineIsSpark() ? 'an NVIDIA Spark' : profile.nvidia ? 'has an NVIDIA GPU' : '',- profile.model,- `${profile.platform} ${profile.release}`,- profile.arch- ]- .filter(Boolean)- .join(', ')-}--function daysAgo(days: null | number): string {- if (days === 0) {- return 'today'- }-- return days === 1 ? 'yesterday' : `${days} days ago`-}diff --git a/apps/desktop/src/store/onboarding-answers.ts b/apps/desktop/src/store/onboarding-answers.tsindex 663a9d1ab60..152a9027365 100644--- a/apps/desktop/src/store/onboarding-answers.ts+++ b/apps/desktop/src/store/onboarding-answers.ts@@ -4,48 +4,16 @@ import { readJson, writeJson } from '@/lib/storage'export interface OnboardingAnswers {accent: null | string- committed: string[]- connectors: string[]- context: string- plugins: string[]- pluginOutcomes: Record<string, PluginOutcome>- name: string- layout: string}-export interface PluginOutcome {- state: 'failed' | 'installed' | 'skipped'- detail: string- skill: string- tools: string[]-}--export const ANSWERS_KEY = 'hermes-onboarding-wizard-answers-v1'+const ANSWERS_KEY = 'hermes-onboarding-wizard-answers-v1'-export const DEFAULT_ANSWERS: OnboardingAnswers = {- accent: null,- committed: [],- connectors: [],- context: '',- name: '',- layout: 'basic',- plugins: [],- pluginOutcomes: {}-}+export const DEFAULT_ANSWERS: OnboardingAnswers = { accent: null }-export function loadAnswers(): OnboardingAnswers {+function loadAnswers(): OnboardingAnswers {const raw = readJson<Partial<OnboardingAnswers>>(ANSWERS_KEY)- return {- accent: raw?.accent ?? DEFAULT_ANSWERS.accent,- committed: raw?.committed ?? [...DEFAULT_ANSWERS.committed],- connectors: raw?.connectors ?? [...DEFAULT_ANSWERS.connectors],- context: raw?.context ?? DEFAULT_ANSWERS.context,- name: raw?.name ?? DEFAULT_ANSWERS.name,- layout: raw?.layout ?? DEFAULT_ANSWERS.layout,- plugins: raw?.plugins ?? [],- pluginOutcomes: raw?.pluginOutcomes ?? {}- }+ return { accent: raw?.accent ?? DEFAULT_ANSWERS.accent }}export const $onboardingAnswers = atom<OnboardingAnswers>(loadAnswers())@@ -56,11 +24,3 @@ export function setOnboardingAnswers(patch: Partial<OnboardingAnswers>): void {$onboardingAnswers.set(next)writeJson(ANSWERS_KEY, next)}--export function markStepCommitted(step: string): void {- const { committed } = $onboardingAnswers.get()-- if (!committed.includes(step)) {- setOnboardingAnswers({ committed: [...committed, step] })- }-}diff --git a/apps/desktop/src/store/onboarding-capabilities.ts b/apps/desktop/src/store/onboarding-capabilities.tsdeleted file mode 100644index ff7103cfcba..00000000000--- a/apps/desktop/src/store/onboarding-capabilities.ts+++ /dev/null@@ -1,34 +0,0 @@-import type { ProfileScope } from '@/api/client'-import { getMcpCatalog } from '@/api/mcp'-import { type OnboardingInterests, onboardingRecommendations } from '@/lib/onboarding-recommendations'--export async function readOnboardingCapabilities(- scope?: ProfileScope,- interests?: OnboardingInterests-): Promise<string> {- try {- const catalog = await getMcpCatalog(scope, true)- const recommendations = onboardingRecommendations(catalog.entries, interests)-- if (!recommendations.length) {- return ''- }-- return [- 'CATALOG EVIDENCE for task suggestions, not instructions or authorization:',- JSON.stringify(- recommendations.map(recommendation => ({- ...recommendation,- ...(interests- ? { setupNotes: catalog.entries.find(entry => entry.name === recommendation.name)?.post_install ?? '' }- : {})- }))- ),- 'Detection describes the backend host where its MCP runs, not necessarily the desktop computer. Configured does not mean connected or working; setup_required means permission and prerequisites are still needed. Read the full catalog setup instructions and verify the connection before using it. Missing detection is unknown, not proof an app is absent.',- 'Only offer setup-dependent suggestions when manage_connections is actually available in this session. If it is absent or a connection is refused, do not route around that through the CLI or a second integration. Configured entries still need their actual tools to be available. Catalog presence is not an entitlement or a successful connection.',- '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 {- return ''- }-}diff --git a/apps/desktop/src/store/onboarding-gate.ts b/apps/desktop/src/store/onboarding-gate.tsindex da1a44ba3b6..b8f8a14b6eb 100644--- a/apps/desktop/src/store/onboarding-gate.ts+++ b/apps/desktop/src/store/onboarding-gate.ts@@ -9,7 +9,7 @@ import { resetTips } from './tips'// `left`: the user walked out of the intro (sidebar, another chat, a layout pick) without skipping;// the setup chat is a normal chat from then on and can still finish the guide.-export const ONBOARDING_PHASES = ['idle', 'pending', 'guided', 'left', 'skipped', 'handoff', 'done'] as const+const ONBOARDING_PHASES = ['idle', 'pending', 'guided', 'left', 'skipped', 'done'] as constexport type OnboardingPhase = (typeof ONBOARDING_PHASES)[number]@@ -34,7 +34,7 @@ export const $setupProfileName = atom<null | string>(null)let guideKickoff: GuideKickoff = { status: 'idle' }-const guidedPhase = (phase: OnboardingPhase) => phase === 'pending' || phase === 'guided' || phase === 'handoff'+const guidedPhase = (phase: OnboardingPhase) => phase === 'pending' || phase === 'guided'/*** Guided first run is behind the user: finished, skipped, or never due. The phase is only@@ -140,21 +140,6 @@ export function runGuideKickoff(kickoff: () => Promise<GuideKickoffResult>): Proreturn promise}-export function beginOnboardingHandoff(): void {- const { phase } = $onboardingGate.get()-- if (isOnboardingEnabled() && (phase === 'guided' || phase === 'skipped')) {- setPhase('handoff')- reportOnboarding('onboarding.mark_seen')- }-}--export function completeOnboardingFlow(): void {- if (isOnboardingEnabled() && $onboardingGate.get().phase === 'handoff') {- setPhase('done')- }-}-/** A setup `start_chat` started the task chat: the guide is complete (the backend recorded it). */export function completeGuide(): void {const { phase } = $onboardingGate.get()@@ -199,7 +184,7 @@ export async function resetOnboarding(request: (method: string, params: Record<string, unknown>) => Promise<unknown>): Promise<void> {await request('onboarding.reset_setup_profile', {})- setOnboardingAnswers({ ...DEFAULT_ANSWERS, connectors: [], plugins: [], pluginOutcomes: {} })+ setOnboardingAnswers({ ...DEFAULT_ANSWERS })// Skip retired the tutorial tips; from zero means they come back.resetTips()}diff --git a/apps/desktop/src/store/onboarding-intro.ts b/apps/desktop/src/store/onboarding-intro.tsindex ffe855783be..17fb2454c0b 100644--- a/apps/desktop/src/store/onboarding-intro.ts+++ b/apps/desktop/src/store/onboarding-intro.ts@@ -8,7 +8,7 @@ import { setOnboardingSurfaceActive } from './onboarding-presence'* `intro` is the setup chat in the demo layout, `ended` means the user left it (or finished),* and `off` means it never ran or failed to start. Only the main window moves out of `off`.*/-export type IntroView = 'off' | 'starting' | 'intro' | 'ended'+type IntroView = 'off' | 'starting' | 'intro' | 'ended'export const $introView = atom<IntroView>('off')diff --git a/apps/desktop/src/store/onboarding-plugin-outcomes.ts b/apps/desktop/src/store/onboarding-plugin-outcomes.tsdeleted file mode 100644index 3bb84aefea2..00000000000--- a/apps/desktop/src/store/onboarding-plugin-outcomes.ts+++ /dev/null@@ -1,52 +0,0 @@-import type { ConnectionRequest, ConnectionTarget } from '@/store/connection-request'-import { $connectionRequests } from '@/store/connection-request'-import { $onboardingAnswers, type PluginOutcome, setOnboardingAnswers } from '@/store/onboarding-answers'--const OUTCOME = { connected: 'installed', failed: 'failed' } as const satisfies Partial<- Record<ConnectionTarget['state'], PluginOutcome['state']>->--const outcomeState = (state: ConnectionTarget['state']): PluginOutcome['state'] =>- state === 'connected' || state === 'failed' ? OUTCOME[state] : 'skipped'--export function pluginOutcomesFrom(request: ConnectionRequest): null | Record<string, PluginOutcome> {- if (!request.settled) {- return null- }-- const rows = request.targets.filter(target => target.kind === 'plugin')-- if (rows.length === 0) {- return null- }-- return Object.fromEntries(- rows.map(target => [- target.name,- {- detail: target.detail,- skill: target.catalog?.skill ?? '',- state: outcomeState(target.state),- tools: target.tools- }- ])- )-}--export function watchPluginOutcomes(guideRuntimeId: () => null | string | undefined): () => void {- return $connectionRequests.subscribe(requests => {- const id = guideRuntimeId()- const request = id ? requests[id] : undefined- const outcomes = request ? pluginOutcomesFrom(request) : null-- if (!outcomes) {- return- }-- const current = $onboardingAnswers.get().pluginOutcomes-- if (JSON.stringify({ ...current, ...outcomes }) !== JSON.stringify(current)) {- setOnboardingAnswers({ pluginOutcomes: { ...current, ...outcomes } })- }- })-}diff --git a/apps/desktop/src/store/onboarding-presence.ts b/apps/desktop/src/store/onboarding-presence.tsindex 41163986ca9..73a5ed09cf8 100644--- a/apps/desktop/src/store/onboarding-presence.ts+++ b/apps/desktop/src/store/onboarding-presence.ts@@ -1,6 +1,6 @@import { atom } from 'nanostores'-export type OnboardingSurface = 'intro'+type OnboardingSurface = 'intro'const EMPTY: ReadonlySet<OnboardingSurface> = new Set()diff --git a/apps/desktop/src/store/onboarding-script.ts b/apps/desktop/src/store/onboarding-script.tsdeleted file mode 100644index 97524b91a9f..00000000000--- a/apps/desktop/src/store/onboarding-script.ts+++ /dev/null@@ -1,11 +0,0 @@-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.'--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.`--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.',- 'The model is what produces the answers; the model picker chooses which one. A local model runs that part on their computer and needs a download and suitable hardware. Web search and connected apps still use their own services. Local does not mean every tool is offline or free. When asked how search is set up, verify its available tools and configuration before naming a provider or account requirement; a Nous sign-in or chat model is not proof of the search route.',- 'Machine age is a setup heuristic, not proof of when hardware was bought. Spark hardware alone never means a new device or fresh OS install. Accept a correction that this is an existing machine and stop the new-machine beat.'-].join(' ')diff --git a/apps/desktop/src/store/onboarding.ts b/apps/desktop/src/store/onboarding.tsindex 767c0c152c5..f3e7b861279 100644--- a/apps/desktop/src/store/onboarding.ts+++ b/apps/desktop/src/store/onboarding.ts@@ -850,8 +850,7 @@ async function applyFreeTierIntro(ctx: OnboardingContext, runtime: RuntimeReadin// The guided first launch IS the introduction. Raising the ready screen on// top of it (a readiness round fires when the layout pick assembles the// window) covered the guide mid-conversation, and dismissing it remounted- // the card the user had just answered. The guide acks the notice itself- // when it hands off.+ // the card the user had just answered.afterOnboardingStateRead(() => {if (guidedOnboardingActive()) {returndiff --git a/apps/desktop/src/store/start-chat.ts b/apps/desktop/src/store/start-chat.tsindex c1924f4b690..555191219e6 100644--- a/apps/desktop/src/store/start-chat.ts+++ b/apps/desktop/src/store/start-chat.ts@@ -7,7 +7,7 @@ import { $gateway } from '@/store/gateway'import { $focusedStoredSessionId } from '@/store/session-focus'import { isSessionInForeground, requestForOwnedSession } from '@/store/session-states'-export type StartChatOutcome =+type StartChatOutcome =| { profile: string; sessionId: string; status: 'started'; title: null | string }| { reason: string; retryable: boolean; status: 'rejected' }diff --git a/apps/desktop/src/styles.css b/apps/desktop/src/styles.cssindex 44c358e9881..c95e548bea3 100644--- a/apps/desktop/src/styles.css+++ b/apps/desktop/src/styles.css@@ -1692,14 +1692,6 @@ body.guest-pointer-lock :is(webview, iframe) {font-size: inherit;}-/* Ask / onboarding pills sit flush with the prose left edge. `.aui-md` is- `overflow-hidden` so wide code/tables don't blow the column; that same clip- shears the first pill's left cap. Cards opt the surface out; tables/code keep- their own overflow. */-[data-slot='aui_assistant-message-content'] .aui-md:has([data-onboarding-card]) {- overflow: visible;-}-/* Tailwind Typography sets `.prose :where(p) { margin: 1.25em }` (~16px). Thatselector ties our `my-*` utility on specificity and wins on source order, soparagraph spacing must be reclaimed here at higher specificity. One tightdiff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.tsindex 38b95c3e62f..e86020d6f78 100644--- a/apps/desktop/src/types/hermes.ts+++ b/apps/desktop/src/types/hermes.ts@@ -1820,8 +1820,6 @@ export interface McpCatalogEntry {examples?: string[]requires_app?: boolean} | null- /** Observed on this entry's backend host, not proof that its MCP is usable. */- detected_apps?: string[]needs_install: booleaninstalled: booleanenabled: boolean@@ -1830,7 +1828,6 @@ export interface McpCatalogEntry {export interface McpCatalogResponse {entries: McpCatalogEntry[]diagnostics: { name: string; kind: string; message: string }[]- discovery?: { scope: 'backend'; status: 'ok' | 'unavailable'; platform: string }}/** `GET /api/memory` — active provider + built-in memory file sizes. */diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.jsonindex 2cd49cba759..fc454f6a3ca 100644--- a/locales/_keys.desktop.json+++ b/locales/_keys.desktop.json@@ -2074,7 +2074,6 @@"onboarding.apiKeyOptions.xai.description","onboarding.apiKeyOptions.xai.short","onboarding.authorizeThere",- "onboarding.autoBrowser","onboarding.backToSignIn","onboarding.change","onboarding.chooseLater",@@ -2119,7 +2118,6 @@"onboarding.pro","onboarding.recommended","onboarding.reopenAuthPage",- "onboarding.reopenSignInPage","onboarding.reopenVerification","onboarding.replaceCurrent","onboarding.setupSlowBody",