The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
feat(desktop): suggest varied first tasks from real integrations
brooklyn!4716ec0ba4e2
diff --git a/apps/desktop/src/api/mcp.ts b/apps/desktop/src/api/mcp.tsindex 9507e8ea9f8..27dd56c3f2b 100644--- a/apps/desktop/src/api/mcp.ts+++ b/apps/desktop/src/api/mcp.ts@@ -114,11 +114,12 @@ export function setMcpServerEnabled(name: string, enabled: boolean): Promise<{ o})}-export function getMcpCatalog(profile?: ProfileScope): Promise<McpCatalogResponse> {+export function getMcpCatalog(profile?: ProfileScope, detectApps = false): Promise<McpCatalogResponse> {return window.hermesDesktop.api<McpCatalogResponse>({...capabilityScoped(profile),...scopedDialPriority(profile),- path: '/api/mcp/catalog'+ path: `/api/mcp/catalog${detectApps ? '?detect_apps=true' : ''}`,+ ...(detectApps ? { timeoutMs: 5000 } : {})})}diff --git a/apps/desktop/src/app/contrib/onboarding-handoff.ts b/apps/desktop/src/app/contrib/onboarding-handoff.tsindex 9245448247a..f7e249f454b 100644--- a/apps/desktop/src/app/contrib/onboarding-handoff.ts+++ b/apps/desktop/src/app/contrib/onboarding-handoff.ts@@ -182,7 +182,8 @@ export function useOnboardingHandoff({const seed = await buildFirstTaskSeedMessages(setupHandoff.task,$onboardingAnswers.get(),- setupHandoff.plan+ setupHandoff.plan,+ owner)const runtimeId = await runCreatePinnedTo(BUILD_PROFILE, () =>diff --git a/apps/desktop/src/app/contrib/onboarding-kickoff.ts b/apps/desktop/src/app/contrib/onboarding-kickoff.tsindex ddce7e40efd..53998f8097e 100644--- a/apps/desktop/src/app/contrib/onboarding-kickoff.ts+++ b/apps/desktop/src/app/contrib/onboarding-kickoff.ts@@ -19,6 +19,7 @@ import { isOnboardingEnabled } from '@/lib/onboarding-enabled'import { activeGatewayConnectionId, requestGatewayForProfile } from '@/store/gateway'import { loadMachineProfile } from '@/store/machine'import { notify } from '@/store/notifications'+import { readOnboardingCapabilities } from '@/store/onboarding-capabilities'import { skipGuide } from '@/store/onboarding-gate'import { buildChatOnboardingSeedMessages } from '@/store/onboarding-script'import {@@ -119,8 +120,6 @@ export function useOnboardingKickoff({takeGuideShape()await loadMachineProfile()- const seedMessages = buildChatOnboardingSeedMessages(pickOnboardingGreeting(), record.free_tier !== true)-const guideRequest: AmbientGatewayRequest = (method, params, timeout) =>requestGatewayForProfile(SETUP_PROFILE, method, params, timeout)@@ -140,6 +139,15 @@ export function useOnboardingKickoff({return true}+ const capabilities = await readOnboardingCapabilities({+ connectionId: previousConnectionId,+ profile: SETUP_PROFILE+ })++ const seedMessages = buildChatOnboardingSeedMessages(+ pickOnboardingGreeting(), record.free_tier !== true, capabilities+ )+const createOverrides: SessionCreateOverrides = { title: SETUP_CHAT_TITLE }if (record.free_tier) {diff --git a/apps/desktop/src/components/onboarding-chat/cards/build.tsx b/apps/desktop/src/components/onboarding-chat/cards/build.tsxindex ed79a91813f..90b8b67ede7 100644--- a/apps/desktop/src/components/onboarding-chat/cards/build.tsx+++ b/apps/desktop/src/components/onboarding-chat/cards/build.tsx@@ -40,7 +40,7 @@ const FALLBACK_OPTION = "Let's figure it out together"/*** The last question card before the handoff. The model asks what the user wants to build first, then places this card* with options it wrote from the conversation so far:- * `::onboarding{step="first" options="A Discord bot|A habit tracker|…"}`.+ * `::onboarding{step="first" options="Find emails I need to reply to|Plan my day around meetings|…"}`.*/export function FirstBuildCard({ attrs, locked }: CardProps) {const view = useSessionView()diff --git a/apps/desktop/src/components/onboarding-chat/cards/setup.tsx b/apps/desktop/src/components/onboarding-chat/cards/setup.tsxindex fc8d5802aff..63acfa18104 100644--- a/apps/desktop/src/components/onboarding-chat/cards/setup.tsx+++ b/apps/desktop/src/components/onboarding-chat/cards/setup.tsx@@ -42,7 +42,12 @@ export function ConnectorsCard({ locked }: CardProps) {// straight to manage_connections; a name the gateway does not carry would be// a pick the build chat cannot honour.const rows = useMemo(() => (catalog.status === 'ready' ? orderConnectorPicks(catalog.rows) : []), [catalog])- const shown = rows.filter(row => connectorTitle(row.connector).toLowerCase().includes(query.toLowerCase()))+ const search = query.trim().toLowerCase()++ const shown = search+ ? rows.filter(row => `${row.name ?? ''} ${connectorTitle(row.connector)}`.toLowerCase().includes(search))+ : rows.slice(0, 12)+const picked = rows.filter(row => answers.connectors.includes(row.connector))const toggle = (id: string) =>diff --git a/apps/desktop/src/components/onboarding-chat/onboarding-recommendations-runbook.test.ts b/apps/desktop/src/components/onboarding-chat/onboarding-recommendations-runbook.test.tsnew file mode 100644index 00000000000..5482407bce0--- /dev/null+++ b/apps/desktop/src/components/onboarding-chat/onboarding-recommendations-runbook.test.ts@@ -0,0 +1,47 @@+import { afterEach, expect, it } from 'vitest'++import { buildFirstTaskRunbook } from '@/components/onboarding-chat/setup-profile'+import { $machine } from '@/store/machine'+import { DEFAULT_ANSWERS } from '@/store/onboarding-answers'+import { buildChatOnboardingPrompt, forkOptions, machineForkOption } from '@/store/onboarding-script'++afterEach(() => $machine.set(null))++it('hands an account task to the connection flow without substituting a no-auth build', () => {+ for (const connectors of [[], ['gmail', 'notion']]) {+ const runbook = buildFirstTaskRunbook('Check my email', { ...DEFAULT_ANSWERS, connectors })++ expect(runbook).toContain('Check my email')+ expect(runbook).toContain('manage_connections action="status"')+ expect(runbook).toContain('only the apps needed for this task')+ expect(runbook).not.toMatch(/must be finishable with NO external|build the no-auth core|connectors set to every one/)+ expect(runbook).toContain('never fabricate account data')+ }+})++it('offers connector-based work without displacing the existing fresh-machine and Spark fork', () => {+ const prompt = buildChatOnboardingPrompt()+ expect(prompt).toContain('Use my email to find messages that need a reply')+ expect(prompt).toContain('at most one option per app')+ expect(prompt).not.toContain('the first task must be FINISHABLE with no external account')++ for (const profile of [+ { platform: 'darwin', arch: 'arm64', nvidia: false, model: 'Mac', ageDays: 1 },+ { platform: 'win32', arch: 'arm64', nvidia: true, model: '', ageDays: null },+ { platform: 'linux', arch: 'arm64', nvidia: true, model: 'NVIDIA_DGX_Spark', ageDays: null }+ ]) {+ $machine.set({ ...profile, release: '', username: '', locale: 'en-US' })+ expect(forkOptions()).toEqual([machineForkOption(), 'Something else'])++ if (profile.ageDays === null) {+ expect(buildChatOnboardingPrompt()).not.toMatch(/\bNEW Spark\b/)+ }++ const machineRunbook = buildFirstTaskRunbook('Set up this computer', {+ ...DEFAULT_ANSWERS, connectors: ['gmail']+ }, 'machine-setup')++ expect(machineRunbook).toContain('START BY LOOKING, NOT PLANNING')+ expect(machineRunbook).not.toContain('CONNECT FOR THIS TASK')+ }+})diff --git a/apps/desktop/src/components/onboarding-chat/options.tsx b/apps/desktop/src/components/onboarding-chat/options.tsxindex 8552cb6952d..79acc32bc9a 100644--- a/apps/desktop/src/components/onboarding-chat/options.tsx+++ b/apps/desktop/src/components/onboarding-chat/options.tsx@@ -3,10 +3,8 @@ import { Tip } from '@/components/ui/tooltip'import { IS_MAC } from '@/lib/keybinds/combo'import { cn } from '@/lib/utils'-// The live-catalog slugs the first-run picker shows, in this order. The catalog-// decides what can be connected; this list picks the everyday apps out of it-// (decision D89). A slug the catalog no longer carries is not shown, and a slug-// the catalog gains is not shown until it is added here.+// Curated leaders for the first-run picker. Other enabled catalog entries+// remain searchable, so newly deployed connectors need no client list update.export const CONNECTOR_LEAD_ORDER = ['gmail','googlecalendar',@@ -35,7 +33,7 @@ export function orderConnectorPicks<T extends { connector: string; enabled?: booconst rank = new Map(CONNECTOR_LEAD_ORDER.map((slug, index) => [slug, index]))return rows- .filter(row => rank.has(row.connector) && row.enabled !== false && !CONNECTOR_PICKER_HIDDEN.has(row.connector))+ .filter(row => row.enabled !== false && !CONNECTOR_PICKER_HIDDEN.has(row.connector)).sort((a, b) => {const ra = rank.get(a.connector) ?? Number.POSITIVE_INFINITYconst rb = rank.get(b.connector) ?? Number.POSITIVE_INFINITYdiff --git a/apps/desktop/src/components/onboarding-chat/setup-profile.ts b/apps/desktop/src/components/onboarding-chat/setup-profile.tsindex c3ab17e2d90..0195a85936f 100644--- a/apps/desktop/src/components/onboarding-chat/setup-profile.ts+++ b/apps/desktop/src/components/onboarding-chat/setup-profile.ts@@ -12,14 +12,15 @@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 type { GatewayRequest } from '@/app/session/hooks/use-prompt-actions/utils'-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 { PLAIN_SPEECH } from '@/store/onboarding-script'import { getSessionOwnerHint } from '@/store/session'@@ -144,14 +145,12 @@ export function buildFirstTaskRunbook(task: string,answers: OnboardingAnswers,plan: HandoffPlan = 'build',- pluginRoot = ''+ pluginRoot = '',+ capabilities = ''): string {const name = (answers.name ?? '').trim()const context = (answers.context ?? '').trim()- const tools = (answers.connectors ?? []).filter(slug => CONNECTOR_LEAD_ORDER.includes(slug))- // Machine setup needs no account anywhere; every other plan connects the- // picked apps before it does anything else (D85).- const connectFirst = tools.length > 0 && plan !== 'machine-setup'+ const tools = [...new Set(answers.connectors ?? [])].filter(slug => /^[a-z0-9][a-z0-9_-]*$/.test(slug))return [`You are Hermes. The user's welcome chat just opened this session so one task can have room to run: ${task.trim()}.`,@@ -160,15 +159,14 @@ export function buildFirstTaskRunbook(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.`+ tools.length+ ? `Apps they said they use, not an authorization or a requirement to connect them all: ${tools.map(slug => `${slug} (${connectorTitle(slug)})`).join(', ')}.`: '',- 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 the wait returns or they tell you to start.'- : 'Their next message is the go signal: really begin the work — plan briefly, then build (scaffold, research, first artifact).',+ 'Their next message is the go signal. Do that task, not a demo inspired by it. If it needs account data, resolve the required connections before doing the work. A local task starts directly, without unrelated connection prompts.',"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.",- ...planRunbook(plan, pluginRoot, connectFirst),- ...(connectFirst ? connectFirstRunbook(tools) : []),+ capabilities,+ ...planRunbook(plan, pluginRoot),+ ...(plan === 'machine-setup' ? [] : CONNECT_FOR_TASK_RUNBOOK),'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@@ -177,25 +175,18 @@ export function buildFirstTaskRunbook(.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.'--/** The picks are gateway slugs the user chose during setup. The agent, rather than the app, waits for the connection- * result, as decided in D85. */-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.`,- 'If every result comes back already active, there is nothing to wait for: begin the task at once.',- 'That one call shows the user a card with one row per app and blocks until every app is connected, skipped, or the deadline passes; never paste links, never call "connect" again while the card is up. Its result lists each app as connected, skipped or not_connected.',- 'The user can start early. A message from them that begins with "Start with" or "Start without" names the apps that are connected and the ones they skipped; treat it as the go signal and begin with the connected apps only.',- 'When the result shows every app connected, begin the task at once. When some are skipped or not_connected, stop and ask in one line: which apps did not connect, and whether they want you to continue without them or try again (a fresh action="connect" mints new links). Wait for their answer. If they choose to continue without an app, build the version of the task that needs no account for that part and say in one line what the connection would have added.',- '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.'- ]-}+/** App preferences shape suggestions; the accepted task decides which permissions are needed. */+const CONNECT_FOR_TASK_RUNBOOK = [+ 'Use only tools actually available in this session. If manage_connections is unavailable, do not invent it or route around the missing permission through CLI setup; explain the unavailable connection and offer another task. Existing configured tools may be used only when they are actually available.',+ 'CONNECT FOR THIS TASK. If the accepted task needs a managed account, first call manage_connections action="status" to check the live catalog and connection state. Use only the apps needed for this task, not every app picked during setup. An empty preference list does not make an explicitly requested email or calendar task a local task.',+ 'Use the exact enabled slugs returned by the catalog. If the user said "email" and their preferences identify one supported mail app, use that; if the account is ambiguous, ask which app once. Never invent a connector or assume a saved preference is still available. If a suitable tool is already available through a configured local integration or MCP, use it rather than asking for a second connection.',+ 'For the needed managed apps that are not connected, say in one short sentence what you will read, then ONE manage_connections action="connect" with just those slugs, batched when the task needs several. Already connected apps need no new sign-in. The call displays the existing connection card and blocks until its targets resolve, the user presses Continue, or the deadline passes. Read its per-target connected, skipped or not_connected result; the card and backend own the wait and retry controls. Never paste authorization links, open them yourself, or repeat connect while the card is open.',+ 'For a local MCP route, use the supplied catalog entry and setupNotes when present; otherwise discover the real entry and prerequisites first. manage_connections action="status" is for managed accounts ONLY, never for an mcp:true target. The catalog snapshot supplies setupAction: install if not configured, enable if disabled, null if configured and enabled. Call manage_connections with that action and connectors=[{"name":"THE_CATALOG_NAME","mcp":true}]. For a null setupAction, discover and verify the existing tools instead of reinstalling; use authorize only when the connection actually requires OAuth. Keep the existing approval flow; do not hand-edit MCP config or invent a server. Newly available tools arrive next turn, so do not pretend they ran before then.',+ 'When the needed apps are connected, continue the accepted task immediately. If a required app is skipped, times out, or is unavailable, say what is blocked and offer to choose another task or use data the user supplies. Do not re-prompt for authorization unless they explicitly ask to retry. Do not replace "check my email" with a sample inbox, a blank dashboard or a file-based tracker and call that done.',+ 'A connection refusal is not permission to route around it through a browser, IMAP client, app password, or another integration into the same account. Leave that app alone. For a partially connected task, only do an independently useful part if the user agrees, and name what is missing.',+ "Discover a connected app's tools with tool_search, load their schemas with tool_describe, 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.",+ 'Match the output to the ask: an inbox triage can be a short answer with links to real messages; a dashboard is appropriate only when they wanted one. Do not scaffold a page or plugin just to make the work look visible.'+]/** The machine-setup runbook. The audit comes before the plan because a plan written before looking is how an agent* installs a second copy of something, or "fixes" drivers that were already correct. */@@ -221,7 +212,7 @@ const pluginRunbook = (root: string) => []/** A new HandoffPlan takes effect only once it has a case here. */-function planRunbook(plan: HandoffPlan, pluginRoot: string, connectFirst: boolean): string[] {+function planRunbook(plan: HandoffPlan, pluginRoot: string): string[] {switch (plan) {case 'machine-setup':return machineSetupRunbook()@@ -231,12 +222,10 @@ function planRunbook(plan: HandoffPlan, pluginRoot: string, connectFirst: booleathrow new Error('The desktop plugin folder is unavailable. Retry before starting the first build.')}- // With no picks NO_AUTH_RULE still applies: a plugin that needs an API key on its first run is as- // unfinishable as any other first build that needs an account.- return connectFirst ? pluginRunbook(pluginRoot) : [...pluginRunbook(pluginRoot), NO_AUTH_RULE]+ return pluginRunbook(pluginRoot)default:- return connectFirst ? [] : [NO_AUTH_RULE]+ return []}}@@ -255,11 +244,17 @@ function machineSetupRunbook(): string[] {export async function buildFirstTaskSeedMessages(task: string,answers: OnboardingAnswers,- plan: HandoffPlan = 'build'+ plan: HandoffPlan = 'build',+ scope?: ProfileScope): Promise<{ content: string; display_kind?: 'hidden'; role: 'assistant' | 'user' }[]> {const root = plan === 'plugin' ? await window.hermesDesktop?.desktopPluginsRoot?.() : undefined- return [{ content: buildFirstTaskRunbook(task, answers, plan, root), display_kind: 'hidden', role: 'user' }]+ 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' }]}/** The hidden note sent to the welcome chat once the build session is live. The check-ins after it come from thediff --git a/apps/desktop/src/lib/onboarding-recommendations.test.ts b/apps/desktop/src/lib/onboarding-recommendations.test.tsnew file mode 100644index 00000000000..b39fddc467a--- /dev/null+++ b/apps/desktop/src/lib/onboarding-recommendations.test.ts@@ -0,0 +1,48 @@+import { expect, it } from 'vitest'++import { orderConnectorPicks } from '@/components/onboarding-chat/options'+import { onboardingRecommendations } from '@/lib/onboarding-recommendations'+import type { McpCatalogEntry } from '@/types/hermes'++it('keeps new enabled managed apps searchable without disturbing the curated leaders', () => {+ const next = { connector: 'new-reviewed-app', enabled: true }+ const lead = { connector: 'gmail', enabled: true }+ const disabled = { connector: 'disabled-app', enabled: false }+ const channel = { connector: 'discord', enabled: true }+ expect(orderConnectorPicks([next, disabled, channel, lead])).toEqual([lead, next])+})++function entry(name: string, patch: Partial<McpCatalogEntry> = {}): McpCatalogEntry {+ return {+ name, description: `${name} integration`, source: 'https://example.test', transport: 'stdio',+ auth_type: 'none', required_env: [], command: 'example', args: [], url: null, install_url: null,+ install_ref: null, bootstrap: [], default_enabled: null, post_install: 'Enable the app integration.',+ needs_install: false, installed: false, enabled: false,+ suggest: { keywords: [name], hosts: [], applications: [name], examples: [`Make something in ${name}`], requires_app: true },+ ...patch+ }+}++it('recommends catalog entries from evidence and intent, never from installation as proof of access', () => {+ const local = entry('modeler', { detected_apps: ['Modeler'] })+ const newEntry = entry('future-studio', { detected_apps: ['Future Studio'] })+ const longerExample = 'Describe the lighting and materials in my scene before suggesting a different render treatment'+ newEntry.suggest!.examples!.push(longerExample)+ const absent = entry('missing-studio')+ const disabled = entry('paused-studio', { installed: true, detected_apps: ['Paused Studio'] })+ const configured = entry('notes', { installed: true, enabled: true })+ const rows = [absent, disabled, configured, local, newEntry]++ const suggestions = onboardingRecommendations(rows)+ expect(new Set(suggestions.map(row => row.name))).toEqual(new Set([newEntry.name, local.name, configured.name]))+ expect(suggestions[0].name).toBe(configured.name)+ expect(suggestions.every(row => row.examples.length === 1)).toBe(true)+ expect(onboardingRecommendations(rows, { context: 'Use future studio' })[0].examples).toContain(longerExample)+ expect(suggestions.map(row => row.readiness)).not.toContain('connected')+ expect(suggestions.find(row => row.name === local.name)).toMatchObject({ readiness: 'setup_required', detectedApps: ['Modeler'], setupAction: 'install' })+ expect(suggestions.find(row => row.name === configured.name)?.setupAction).toBeNull()+ expect(onboardingRecommendations(rows, { context: 'Use paused studio' })[0].setupAction).toBe('enable')+ expect(suggestions.find(row => row.name === configured.name)?.readiness).toBe('configured_unverified')+ expect(onboardingRecommendations(rows, { context: 'Help with my notes' })[0].name).toBe(configured.name)+ expect(onboardingRecommendations([entry('legacy', { suggest: { keywords: ['legacy'], hosts: [] } })])).toEqual([])+})diff --git a/apps/desktop/src/lib/onboarding-recommendations.ts b/apps/desktop/src/lib/onboarding-recommendations.tsnew file mode 100644index 00000000000..d51f1632cfb--- /dev/null+++ b/apps/desktop/src/lib/onboarding-recommendations.ts@@ -0,0 +1,74 @@+import type { McpCatalogEntry } from '@/types/hermes'++export interface OnboardingInterests {+ apps?: readonly string[]+ context?: string+}++export interface OnboardingRecommendation {+ name: 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(' ')++/** Rank evidence, not a fixed list of products. The model personalizes these reviewed outcomes later. */+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())++ if (!examples.length) {+ return []+ }++ 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++ // An explicit task can request a disabled integration; mere discovery must not undo that choice.+ 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,+ 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/store/onboarding-capabilities.test.ts b/apps/desktop/src/store/onboarding-capabilities.test.tsnew file mode 100644index 00000000000..46554649ac0--- /dev/null+++ b/apps/desktop/src/store/onboarding-capabilities.test.ts@@ -0,0 +1,54 @@+import { afterEach, expect, it, vi } from 'vitest'++import { buildFirstTaskSeedMessages } from '@/components/onboarding-chat/setup-profile'+import { DEFAULT_ANSWERS } from '@/store/onboarding-answers'+import { readOnboardingCapabilities } from '@/store/onboarding-capabilities'+import { buildChatOnboardingSeedMessages } from '@/store/onboarding-script'++const api = vi.fn()++it('carries fresh catalog evidence into the guide and the exact working-profile handoff seed', async () => {+ vi.stubGlobal('window', { hermesDesktop: { api } })++ const entry = {+ name: 'future-studio', auth_type: 'none', installed: false, enabled: false,+ detected_apps: ['Future Studio'],+ suggest: { keywords: ['future studio'], applications: ['Future Studio'], examples: ['Make a scene in Future Studio'], requires_app: true }+ }++ api.mockResolvedValue({ entries: [entry], diagnostics: [], discovery: { scope: 'backend', status: 'ok', platform: 'darwin' } })+ const scope = { connectionId: 'remote-studio', profile: 'default' }+ const evidence = await readOnboardingCapabilities(scope)+ const guide = buildChatOnboardingSeedMessages('Hi', true, evidence)+ expect(guide[0].content).toContain('"name":"future-studio"')+ expect(guide[0].content).toContain('"readiness":"setup_required"')+ expect(guide[0].display_kind).toBe('hidden')++ const handoff = await buildFirstTaskSeedMessages('Make a scene in Future Studio', DEFAULT_ANSWERS, 'build', scope)+ expect(handoff[0].content).toContain('"name":"future-studio"')+ expect(handoff[0].content).toContain('not necessarily the desktop computer')+ expect(api).toHaveBeenLastCalledWith(expect.objectContaining(scope))+ expect(api.mock.calls.every(([request]) => request.path === '/api/mcp/catalog?detect_apps=true')).toBe(true)+})++afterEach(() => {+ vi.unstubAllGlobals()+ api.mockReset()+})++it('reads only the pinned backend and degrades safely on old or unavailable discovery', async () => {+ vi.stubGlobal('window', { hermesDesktop: { api } })+ const scope = { connectionId: 'remote-studio', profile: 'hermes-setup' }+ api.mockResolvedValueOnce({ entries: [], diagnostics: [] })+ expect(await readOnboardingCapabilities(scope)).toBe('')+ expect(api).toHaveBeenCalledWith(expect.objectContaining({+ connectionId: scope.connectionId,+ profile: scope.profile,+ path: '/api/mcp/catalog?detect_apps=true',+ timeoutMs: 5000+ }))++ api.mockRejectedValueOnce(new Error('Offline'))+ expect(await readOnboardingCapabilities(scope)).toBe('')+ expect(api).toHaveBeenCalledTimes(2)+})diff --git a/apps/desktop/src/store/onboarding-capabilities.ts b/apps/desktop/src/store/onboarding-capabilities.tsnew file mode 100644index 00000000000..1ae174f160e--- /dev/null+++ b/apps/desktop/src/store/onboarding-capabilities.ts@@ -0,0 +1,29 @@+import type { ProfileScope } from '@/api/client'+import { getMcpCatalog } from '@/api/mcp'+import { type OnboardingInterests, onboardingRecommendations } from '@/lib/onboarding-recommendations'++/** A bounded, read-only seed snapshot. No global cache and no connection authority. */+export async function readOnboardingCapabilities(scope?: ProfileScope, interests?: OnboardingInterests): 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.',+ 'Use the reviewed examples as starting points, then favor the user’s stated work and app choices. Detection earns at most one option per app; do not turn its example into several variants. The rest of the menu comes from the user’s goals and other capabilities. More options within one app are appropriate only when explicitly requested. Do not replace the fresh-machine or Spark setup fork. Keep a connection-free choice. Carry the exact MCP name in the handoff brief when one of these tasks is chosen; the task session uses manage_connections with name and mcp:true.'+ ].join(' ')+ } catch {+ // An older/unreachable catalog must not block the existing welcome or handoff path.+ return ''+ }+}diff --git a/apps/desktop/src/store/onboarding-script.ts b/apps/desktop/src/store/onboarding-script.tsindex 79ad4beeb10..3ba9e0fd4f2 100644--- a/apps/desktop/src/store/onboarding-script.ts+++ b/apps/desktop/src/store/onboarding-script.ts@@ -6,7 +6,7 @@* cannot be interpreted downstream.*/-import { machineKind, machineLanguageName, machineSetupLeads, machineUserName } from '@/store/machine'+import { machineKind, machineLanguageName, machineLooksNew, machineSetupLeads, machineUserName } from '@/store/machine'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.'@@ -19,14 +19,15 @@ export const PLAIN_SPEECH = `${VOICE_RULES} Keep every turn short. This is a cha* client is already animating (pickOnboardingGreeting) so the stored row and the animation hold the same words. */export function buildChatOnboardingSeedMessages(greeting: string,- signedIn = false+ signedIn = false,+ capabilities = ''): {content: stringdisplay_kind?: 'hidden'role: 'assistant' | 'user'}[] {return [- { content: buildChatOnboardingPrompt(machineUserName(), signedIn), display_kind: 'hidden', role: 'user' },+ { content: buildChatOnboardingPrompt(machineUserName(), signedIn, capabilities), display_kind: 'hidden', role: 'user' },{ content: greeting, role: 'assistant' }]}@@ -93,7 +94,7 @@ export function forkFallbackOptions(): string[] {return machineSetupLeads() ? [mind, automate, figure, skip] : []}-export function buildChatOnboardingPrompt(suggestedName?: string | null, signedIn = false): string {+export function buildChatOnboardingPrompt(suggestedName?: string | null, signedIn = false, capabilities = ''): string {const kind = machineKind()const machine = machineForkOption()const fallback = forkFallbackOptions()@@ -102,6 +103,7 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedIreturn ["You are Hermes, and this is a brand-new user's very first conversation with you. Your job right now is to get the app arranged around them and their first real job started.",...PERSONA,+ capabilities,// machineLanguageName() reports the OS language. The prompt uses that rather than the language of what the user// typed, because the first turn answers a one-word name and carries no language signal....(language@@ -118,7 +120,7 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedI// RULE 4 comes from a live run: after the user typed their name, the model made six API calls over thirty-six// seconds writing the same fact to memory, and never reached the colour card. Nothing in the prompt said the save// was already done, and a returned tool result reads to a fast model as a cue to speak again.- 'RULE 4 — the card beats carry NO tool calls. Placing an ::onboarding card is pure text plus the directive, nothing else: the directive itself is what saves the answer, so there is no tool to reach for. And in any turn at all, never call the same tool twice — a returned tool result means that work is DONE, not that you should speak again and re-do it. When a call comes back, finish your one line and stop.',+ 'RULE 4 — the card beats carry NO tool calls. Placing an ::onboarding card is pure text plus the directive, nothing else: the directive itself is what saves the answer, so there is no tool to reach for. Never repeat an unchanged tool call after it has succeeded. A status check followed by connect, or discovering tools followed by using them, are different actions and are allowed. After a connection card settles, act on its result without opening another copy.','Your first message has ALREADY been sent for you: it greeted them and asked what you should call them. Do not greet again — their next message is their answer.',...(suggestedName? [@@ -128,7 +130,7 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedI'From there, walk them through setup conversationally, one turn each, in this order:','1. This turn is exactly four things and then you stop: a few warm words about their name, then ::onboarding{step="name" value="THEIR_NAME"} on a line of its own (THEIR_NAME being the name they actually gave; it renders as nothing and just saves it), then one short sentence about their colour, then ::onboarding{step="look"} on a line of its own. That is one turn, not two, and it is not a conflict with RULE 3: the name line is not a question, the look card is, and it is the last thing you write.','2. Then the apps they already use, so Hermes can connect to them later: one short sentence that makes clear what connecting means — you would read and act inside those apps for them (their inbox, their calendar, their repos), not message them there — then ::onboarding{step="connectors"} on a line of its own. Chat apps like Discord or Telegram are a different thing (how they reach you) and are not what this card is asking about; if they bring one up, say it lives in Messaging in the app’s settings and move on.',- 'CONNECTING, IF THEY ASK FOR IT HERE. The picks are preferences, not connections — but if at any point they ask you to connect an app, or say they want one wired up now, do it in this chat: call manage_connections action="status" once, then one action="connect" with EVERY app they named as a batch (connectors=["gmail","googlecalendar"], not one call per app). The app renders that as a Connect card per app and the call blocks until every app is connected, skipped, or the deadline passes; never paste the links, never describe a settings page. The result lists each app as connected, skipped or not_connected; continue from that. Never call connect a second time for an app that already has a card. If an app is not in the status catalog, say so plainly. There is no Connectors page in Settings; do not send them to one.',+ 'CONNECTING, IF THEY ASK FOR IT HERE. The picks are preferences, not connections — but if at any point they ask you to connect an app, or say they want one wired up now, do it in this chat: call manage_connections action="status" once, then one action="connect" with EVERY app they named as a batch (connectors=["gmail","googlecalendar"], not one call per app). The app renders that as one card with a row per app and the call blocks until every app is connected, the user continues or skips, or the deadline passes; never paste the links, never describe a settings page. The result lists each app as connected, skipped or not_connected; continue from that. Never call connect a second time for an app that already has a card. If an app is not in the status catalog, say so plainly. There is no Connectors page in Settings; do not send them to one.',// The only place sign-in is named before it is needed. It sits at the connectors step because the user has just// listed the accounts they use....(signedIn@@ -146,17 +148,19 @@ export function buildChatOnboardingPrompt(suggestedName?: string | null, signedI`5. Then the fork: one short sentence in your own words — you want to actually build them something, not just talk about it — then the line ::ask{question="${FORK_QUESTION}" options="${forkOptions().join('|')}" input="true"} alone as its own paragraph.`,...(fallback.length? [- ` This ${kind} is barely out of the box, so the fork offers the one job that is obviously worth doing and keeps the rest one tap away. Say so in your sentence: you can see it is a NEW ${kind}, and the setup nobody enjoys — updates, drivers, the tools they just told you about — is a thing you can take off their hands right now. Name it as a fresh machine; that recognition is the point. Do not list what you would install. If they pick "${SOMETHING_ELSE}", reply with one short line and the second ask: ::ask{question="What sounds better?" options="${fallback.join('|')}" input="true"} — same exactness rule — then branch on THAT answer below.`+ ` ${machineLooksNew() ? `The fresh-machine signal is set for this ${kind}. Say it looks newly set up and offer to handle updates, drivers and their everyday tools.` : `This is an NVIDIA Spark. Name that hardware and offer to check its GPU, drivers and local AI tools; do not call it a new OS install when its age is unknown.`} Machine setup leads here; app-based recommendations stay behind Something else. Do not list what you would install before the machine audit. If they pick "${SOMETHING_ELSE}", reply with one short line and the second ask: ::ask{question="What sounds better?" options="${fallback.join('|')}" input="true"} — same exactness rule — then branch on THAT answer below.`]: []),'6. Branch on their answer:',' - SPECIFIC task in mind: skip the options card — go straight to the handoff.',` - "${machine}": the machine itself is the job. Ask ONE question — what they mainly want this ${kind} for (work, gaming, school, creative, a bit of everything) — then hand off with plan="machine-setup", task "Set up this ${kind}", and a brief naming that use plus the tools they gave you earlier. Do not plan the setup yourself and do not list what you would install: the agent you hand to audits the machine first and proposes a plan from what is actually there.`,- ` - GENERAL idea or NOT SURE: first ask in one warm sentence what they are actually working on right now — the real project, deadline, or problem on their plate this week (for a "not sure" user, what they wish they spent less time doing works better). One short follow-up if the answer is vague, then ::onboarding{step="working" value="THEIR_ANSWER"} on a line of its own (THEIR_ANSWER = one line, their key details, under 140 characters; renders as nothing, it just saves what they said). Then a card of options built from that answer plus their apps, again on a line of its own: ::onboarding{step="first" options="First idea|Second idea|Third idea"} — 2 to 4 options, each a short phrase (under 60 chars), spanning simple (a reminder) to complex (a dashboard), all specific to THIS user, separated by |. THE APPS THEY PICKED DRIVE THESE OPTIONS: someone who picked Gmail and Calendar should see an inbox or schedule idea ("A morning brief of today's meetings and unread mail"), someone who picked GitHub and Linear should see a repo or ticket idea, and someone who picked nothing gets ideas that need no account at all. At least one option should stand on its own without any connection, so there is always a pick that runs today. Their tap IS their reply — hand off from it.`,+ ` - GENERAL idea or NOT SURE: ask one short question about their real project, deadline, or what they wish took less time. If they already told you, do not ask again. Save their answer with ::onboarding{step="working" value="THEIR_ANSWER"} on its own line (under 140 characters, renders as nothing), then offer ::onboarding{step="first" options="First idea|Second idea|Third idea|Fourth idea"} on its own line. Use 3 or 4 short actions, each under 60 characters. Favor useful app-backed work when several relevant apps are available, but offer at most one option per app or closely related workflow. Merely detecting Blender or another installed app earns ONE relevant option, not the whole menu. Fill the other slots with distinct tasks from their goals and other available capabilities, including one genuinely connection-free alternative. Do not invent connections to fill the card. Offer several ideas for the same app only when the user explicitly asks for that.`,+ ' CONNECTOR-BASED EXAMPLES, adapted to their actual apps and context: Gmail or Outlook → "Use my email to find messages that need a reply"; Google Calendar → "Find time for focused work around my meetings"; Slack → "Catch me up on decisions in my project channel"; Notion or Google Docs → "Turn my project notes into next steps"; Linear or Jira → "Show me which of my tickets need attention"; Google Sheets → "Find overdue items in my project spreadsheet". These are patterns, not a claim that every app is available. Only name apps from their live-catalog picks or integrations confirmed available in this session. Also consider local apps and configured MCPs in the supplied CATALOG EVIDENCE, even if no managed app was picked. If neither source provides a relevant integration, offer connection-free work unless they explicitly ask for an account task.',+ ' Their tap or typed task is the decision, not a request for another menu. If the app is already clear, hand off immediately. If "email" could mean several accounts, ask which app once. Preserve the requested app and outcome in the handoff brief; the task session connects just what it needs before using real data.',' WHEN A PLUGIN FITS, MAKE IT ONE OF THOSE OPTIONS. Hermes can build pieces of its own interface — a small chip in the status bar, a button by the composer, a panel beside the chat — and the user watches it appear in this window as you write it. That is the best first build available whenever what they described is something they would want to SEE or REACH at a glance: a number they keep checking, a list they keep opening, a status they keep asking about, a thing they wish were one click instead of five. Phrase it as the outcome, never as the mechanism ("A panel with today\'s tickets", not "Write a plugin"). Roughly one option, not the whole card, and only alongside the other shapes — a task that is genuinely just a task (draft this, research that, rename these files) should not be bent into an interface.',' If they pick that one, hand off with plan="plugin" on the handoff line.',` - "${FORK_OPTIONS.skip}": say one short line that the app is theirs and this chat stays here if they ever want a hand, then stand down. No more questions, no handoff.`,- ' CRITICAL for every branch: the first task must be FINISHABLE with no external account or OAuth (no Gmail, no Slack, no Google sign-in). If the option they picked leans on one of their apps, that is fine and expected — the build chat offers the connection as a Connect card and, with their consent, uses it; without it, the task still ships its no-auth core (a local brief, a file-based tracker, a scheduled reminder) and names the connection as the step that lights it up. Web research, scripts, computer use, small apps, file-based trackers, scheduled reminders and generated pages are all fair game.',+ ' Connector-dependent tasks are welcome. They do NOT need a no-account substitute: checking email should read their real email after permission, not build a mock inbox. Explain in one short clause that the task will offer to connect the needed app. If they decline or the integration is unavailable, keep the original task honest about being blocked and let them choose another task or supply the data themselves. Never invent personal data or silently change the goal.','7. THE HANDOFF — you do not build the task in this conversation. Once the task is decided, reply with ONE short sentence framing it (you are giving the work its own chat so it has room, and this one stays open), then ::onboarding{step="handoff" task="short task name" brief="the build instruction, one sentence, written as the user\'s ask"} on a line of its own — task under 40 chars, brief under 200. Add plan="machine-setup" to that same line when the job is setting up their computer, or plan="plugin" when it is a piece of the Hermes interface. The app opens the session, moves the user into it, and starts the build from your brief.','8. Later, invisible [setup] notes will tell you how the handoff went and, over time, what the user has been doing. When the handoff-complete note arrives, follow its instructions: one short line that you are around if they want a hand, then stop. If a handoff-failed note arrives instead, explain briefly that the first build did not start and point to Retry first build. Do not start another copy here or promise the build is running.','Whenever you draft reusable text for them (an email, a pitch, a template, a post), put the draft in a fenced code block so they can copy it in one click — never inline in your prose. Your own commentary stays outside the block.',diff --git a/apps/desktop/src/store/suggestion-providers/mcp.test.ts b/apps/desktop/src/store/suggestion-providers/mcp.test.tsindex 4f5c8d641ca..9581c70bfbd 100644--- a/apps/desktop/src/store/suggestion-providers/mcp.test.ts+++ b/apps/desktop/src/store/suggestion-providers/mcp.test.ts@@ -1,6 +1,14 @@import { describe, expect, it } from 'vitest'-import { matchSuggestions } from './mcp'+import { buildMcpSuggestionIndex, matchSuggestions } from './mcp'++it('does not send local-app or non-OAuth catalog suggestions through the hosted OAuth-only composer flow', () => {+ const hosted = { name: 'hosted', url: 'https://mcp.example.test', auth_type: 'oauth', transport: 'http', suggest: { keywords: ['hosted'], hosts: [] } }+ const editor = { ...hosted, name: 'editor', url: 'http://127.0.0.1:8000/mcp', auth_type: 'none', suggest: { ...hosted.suggest, requires_app: true } }+ const key = { ...hosted, name: 'key', auth_type: 'api_key' }+ const stdio = { ...hosted, name: 'stdio', url: null, transport: 'stdio' }+ expect(buildMcpSuggestionIndex([hosted, editor, key, stdio]).map(row => row.server)).toEqual([hosted.name])+})const INDEX = [{ keywords: ['linear', 'issue tracker', 'ticket'], server: 'linear' },diff --git a/apps/desktop/src/store/suggestion-providers/mcp.ts b/apps/desktop/src/store/suggestion-providers/mcp.tsindex f18c979bdc4..bdf8cbde83d 100644--- a/apps/desktop/src/store/suggestion-providers/mcp.ts+++ b/apps/desktop/src/store/suggestion-providers/mcp.ts@@ -6,6 +6,7 @@ import { prettyName } from '@/lib/text'import { type ComposerSuggestion, registerDraftProvider } from '@/store/composer-suggestions'import { $gateway } from '@/store/gateway'import { notifyError } from '@/store/notifications'+import type { McpCatalogEntry } from '@/types/hermes'/*** The MCP draft provider — the suggestion bus's founding member (PR #85036).@@ -69,9 +70,22 @@ async function loadSuggestible(): Promise<SuggestibleServer[]> {const { entries } = await getMcpCatalog()- const fromCatalog: SuggestibleServer[] = entries- .filter(- entry => entry.suggest && entry.url && (entry.suggest.keywords.length > 0 || entry.suggest.hosts.length > 0)+ const fromCatalog = buildMcpSuggestionIndex(entries)++ suggestible = fromCatalog+ suggestibleAt = Date.now()++ return suggestible+}++/** This older composer path runs hosted OAuth. Local/setup-dependent tasks use manage_connections instead. */+export function buildMcpSuggestionIndex(+ entries: readonly Pick<McpCatalogEntry, 'name' | 'url' | 'suggest' | 'auth_type' | 'transport'>[]+): SuggestibleServer[] {+ return entries+ .filter(entry =>+ entry.transport === 'http' && entry.auth_type === 'oauth' && !entry.suggest?.requires_app+ && entry.suggest && entry.url && (entry.suggest.keywords.length > 0 || entry.suggest.hosts.length > 0)).map(entry => ({hosts: entry.suggest!.hosts,@@ -79,11 +93,6 @@ async function loadSuggestible(): Promise<SuggestibleServer[]> {server: entry.name,url: entry.url!}))-- suggestible = fromCatalog- suggestibleAt = Date.now()-- return suggestible}interface KeywordEntry {diff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.tsindex 30780c322c0..1d7e7354f51 100644--- a/apps/desktop/src/types/hermes.ts+++ b/apps/desktop/src/types/hermes.ts@@ -1636,7 +1636,15 @@ export interface McpCatalogEntry {/** Composer-suggestion triggers (present when the manifest declares a* `suggest` block; null/absent on entries without one and on older* backends that predate the field). */- suggest?: { keywords: string[]; hosts: string[] } | null+ suggest?: {+ keywords: string[]+ hosts: string[]+ applications?: string[]+ 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@@ -1645,6 +1653,7 @@ 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/website/docs/developer-guide/onboarding-recommendations.md b/website/docs/developer-guide/onboarding-recommendations.mdnew file mode 100644index 00000000000..b552602bf0e--- /dev/null+++ b/website/docs/developer-guide/onboarding-recommendations.md@@ -0,0 +1,81 @@+---+title: Onboarding recommendations+sidebar_label: Onboarding recommendations+---++# Onboarding recommendations++Guided onboarding suggests outcomes from the user's app preferences and observed capabilities. It does not grant access or implement a second connection lifecycle. The feature remains inside the existing `HERMES_GUEST_ONBOARDING` flow.++## What takes priority++The existing `machineSetupLeads()` decision still leads with machine setup for a newly set-up machine or a recognized RTX/DGX Spark, with other tasks behind **Something else**. The fresh-machine signal is the existing age heuristic, not proof of the OS installation date. A Spark with unknown age gets a hardware-specific callout, not a claim that its OS is new.++Otherwise the guide favors relevant app-backed tasks, with a connection-free alternative. Detecting an app earns at most one option; the remaining choices come from the user's goals and other capabilities. Several ideas for the same app are appropriate only when explicitly requested. Choosing an inbox task means using real inbox data after permission, not building a mock inbox when permission is missing. A skipped or unavailable required connection leaves that task blocked; the user can choose a different task or supply data.++## Catalog metadata++Extend the reviewed `optional-mcps/<name>/manifest.yaml`, not a product-name switch in the renderer:++```yaml+suggest:+ keywords: [example, modeling]+ hosts: [example.com]+ applications: [Example Studio]+ requires_app: true+ examples:+ - Light a product render in Example Studio+```++- `keywords` and `hosts` retain their existing meaning. `applications`, `examples` and `requires_app` are optional additions.+- `applications` contains up to 16 safe labels/aliases, each at most 80 characters. No paths, shell arguments, regexes or scripts.+- `examples` contains up to six printable single-line outcomes, at most 240 characters each. The model distills those into the existing option chips' shorter labels.+- `requires_app` is true only when the local application is a prerequisite. Desktop-app presence can be a relevance signal for a cloud service without being a requirement.+- Example capabilities and setup prerequisites must be checked against the integration's actual documentation. A catalog entry is not proof of account access, entitlement, add-on readiness or a live tool connection.++The managed-app picker keeps its curated leaders while making other enabled rows from the live catalog searchable. A newly deployed managed connector is no longer discarded merely because its slug is absent from the leader list. No new portal metadata endpoint is required.++## Discovery and scope++`GET /api/mcp/catalog?detect_apps=true` adds:++- `entries[].detected_apps`: matching reviewed application labels only.+- `discovery`: `{scope: "backend", status: "ok" | "unavailable", platform: string}`.++The default catalog request performs no app discovery. The optional scan checks standard application locations and exact safe PATH candidates on the **backend machine**, where its MCP processes run. It never launches apps, starts MCPs, installs packages, reads application documents or contacts the network. It returns neither a full inventory nor filesystem paths.++The scan has directory, entry and time budgets. It is not an exhaustive installed-software inventory. Access failures, an exhausted budget or an unsupported host report `unavailable`; positive observations remain useful, and missing observations are not evidence of absence. macOS app bundles, Linux desktop entries and Windows common program directories have platform-specific readers. Windows registry enumeration is not included.++Desktop pins the catalog request to the guide or handoff's backend/profile. It never combines a desktop-local app observation with a remote MCP host. A temporary-profile API probe can retain the actual OS home for read-only app discovery without reading the installed profile's configuration.++## Recommendation and execution boundaries++Recommendations rank explicit task relevance and selected apps before configuration and app-presence signals. Disabled integrations are not automatically resurfaced without explicit interest. Required local apps need positive detection or an existing configuration before they qualify. Each seed contains a small selection of candidates, not the entire catalog.++The guide receives a read-only snapshot when its session is created. The handoff refreshes that snapshot for the working profile and includes the selected candidates' full setup notes. Neither path mutates an existing system prompt, caches connection authority, or performs setup. An old or unavailable catalog falls back to the existing onboarding behavior.++| Evidence | Meaning | Next action |+| --- | --- | --- |+| App detected, MCP absent | Application signal, setup still needed | Existing `manage_connections` install approval |+| MCP configured but disabled, explicitly requested | Configuration exists, intentionally not active | Existing enable approval |+| MCP configured and enabled | Configuration only; connection unverified | Discover its available tools and verify before use |+| Managed app not connected | Account permission required | Existing managed connect card |+| Skipped, unavailable or missing session capability | Not authorized/usable | Explain the blocked task; no bypass or automatic retry |++For MCP targets, `status` is **not** a supported `manage_connections` action. The snapshot supplies `setupAction` (`install`, `enable`, or null); authorization is requested only when actually required. Managed account status remains a separate supported action. This distinction is verified against actual generated tool arguments, not only prompt text.++The legacy composer suggestion provider can only complete hosted HTTP OAuth. It excludes local-app and non-OAuth entries so new metadata cannot route a local editor into that unrelated flow. Onboarding uses the shared connection operation instead.++## Compatibility with the connection-operation work++The implementation consumes the public `manage_connections` tool and the existing catalog API. It does not modify connection-operation states, generated RPC contracts, account identifiers, OAuth callbacks, retry ownership, watcher behavior or settled-result handling.++It was checked against the current integration and Sid's pending [connection-operation PR](https://github.com/NousResearch/hermes-agent/pull/111008). That PR moves MCP execution into the backend; recommendations do not depend on which side currently executes the operation. Optional catalog fields preserve older clients, and missing fields preserve older backends. Sid's cancelled portal toolkit-metadata endpoint is not a dependency.++There is one intentional product-policy overlap in the onboarding runbooks and their tests: the old requirement to produce a no-account substitute is replaced by the accepted task's actual prerequisites. That overlap must be reconciled when the branches meet, not retained as contradictory instructions. Compatibility with an unknown future breaking API change is not implied.++## Verification boundaries++Contract tests cover catalogue parsing, opt-in read-only discovery, A/B/A profile isolation, missing metadata, ranking, backend-pinned seed creation, legal MCP setup actions and preservation of fresh-machine/Spark priority.++Live inference over synthetic onboarding turns can verify the recommended outcome and generated setup action. Native discovery can verify a real installed app signal. Neither is proof of OAuth completion or execution inside Blender: that still requires the application's add-on/server, the user's approval and a harmless live tool check. See the Blender catalog entry's setup notes for its prerequisites.