The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(desktop): one consent card for connectors and MCP setup
brooklyn!65d46fc3891a
diff --git a/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsx b/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsxindex 5c5f79263fe..4e825909f08 100644--- a/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsx+++ b/apps/desktop/src/components/assistant-ui/mcp-setup-tool.tsx@@ -2,15 +2,13 @@import { type ToolCallMessagePartProps, useAuiState } from '@assistant-ui/react'import { useStore } from '@nanostores/react'-import { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'+import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { capabilityScoped } from '@/api/client'import { useSessionView } from '@/app/chat/session-view'import { ToolFallback } from '@/components/assistant-ui/tool/fallback'import { WIDGET_SHELL_CLASS } from '@/components/chat/widget-shell'-import { Button } from '@/components/ui/button'-import { Codicon } from '@/components/ui/codicon'-import { Input } from '@/components/ui/input'+import { ConnectorCard, type ConnectorCardCopy, ConnectorSummary } from '@/components/ui/connector-card'import {addMcpServer,getActionStatus,@@ -22,8 +20,7 @@ import {} from '@/hermes'import { useI18n } from '@/i18n'import { triggerHaptic } from '@/lib/haptics'-import { AlertCircle, CheckCircle2, Loader2 } from '@/lib/icons'-import { brandFor, brandGlyphStyle } from '@/lib/mcp-brands'+import { Loader2 } from '@/lib/icons'import { completeMcpDesktopOAuth, McpOAuthCancelled } from '@/lib/mcp-dashboard-oauth'import { directoryEntry } from '@/lib/mcp-directory'import { prettyName } from '@/lib/text'@@ -74,18 +71,29 @@ function readSetupResult(result: unknown): SettledResult {const SHELL_CLASS = `${WIDGET_SHELL_CLASS} text-[length:var(--conversation-text-font-size)] text-(--ui-text-primary)`-// Same platform sniff the approval bar uses for its accelerator hint.-const isMac = typeof navigator !== 'undefined' && /Mac|iP(hone|ad|od)/.test(navigator.platform)--const ICON_CLASS = 'mt-px size-4 shrink-0 text-(--ui-text-tertiary)'--function SetupLine({ children, trailing }: { children: ReactNode; trailing?: ReactNode }) {- return (- <div className="flex items-start gap-2">- <div className="min-w-0 flex-1">{children}</div>- {trailing}- </div>- )+/** The card's strings, from this tool's own copy. The verb changes with the+ * action (Install / Enable / Authorize); the rest is the shared consent+ * vocabulary every connector card speaks. */+function cardCopy(copy: ReturnType<typeof useI18n>['t']['assistant']['mcpSetup'], action: SetupAction): ConnectorCardCopy {+ return {+ connectAction: action === 'enable' ? copy.enableAction : action === 'authorize' ? copy.authorizeAction : copy.installAction,+ connectTitle:+ action === 'enable' ? copy.enableTitle : action === 'authorize' ? copy.authorizeTitle : copy.installTitle,+ decline: copy.decline,+ envRequired: copy.envRequired,+ grantAction: copy.authorizeAction,+ retryAction: copy.installAction,+ stateConnected: '',+ stateDeclined: copy.declined,+ stateDisabled: '',+ stateFailed: '',+ stateNeedsAuth: '',+ toolCount: copy.toolCount,+ trustCommunity: '',+ trustCommunityTip: () => '',+ trustVerified: () => '',+ trustVerifiedTip: () => ''+ }}export const McpSetupTool = (props: ToolCallMessagePartProps) => {@@ -134,30 +142,21 @@ function McpSetupSettled({ args, result }: ToolCallMessagePartProps) {const ok = status === 'installed' || status === 'enabled' || status === 'authorized'const neutral = status === 'declined' || status === 'unanswered'const toolCount = Array.isArray(fromResult.tools) ? fromResult.tools.length : 0- const brand = brandFor(server)+ // Settled is scaffolding, the same line a spent connector offer collapses+ // to: the name, then the verdict as meta. A failure keeps its reason.return (- <div className={cn(SHELL_CLASS, 'my-1.5 grid gap-1.5')} data-slot="mcp-setup-inline">- <SetupLine- trailing={- ok ? (- <CheckCircle2 aria-hidden className={cn(ICON_CLASS, 'text-emerald-400')} />- ) : neutral && brand ? (- <brand.Icon aria-hidden className="mt-px size-4 shrink-0 opacity-60" style={brandGlyphStyle(brand)} />- ) : neutral ? (- <Codicon className={ICON_CLASS} name="plug" size="1rem" />- ) : (- <AlertCircle aria-hidden className={cn(ICON_CLASS, 'text-destructive')} />- )- }- >- <span className={cn('font-medium', neutral && 'italic text-(--ui-text-tertiary)')}>{line}</span>- {ok && toolCount > 0 && <span className="ml-2 text-(--ui-text-tertiary)">{copy.toolCount(toolCount)}</span>}- {!ok && !neutral && fromResult.detail ? (- <p className="mt-0.5 text-(--ui-text-secondary)">{fromResult.detail}</p>- ) : null}- </SetupLine>- </div>+ <ConnectorSummary+ connector={{ name: server, title: displayName }}+ meta={+ ok && toolCount > 0+ ? `${line} · ${copy.toolCount(toolCount)}`+ : !ok && !neutral && fromResult.detail+ ? `${line} — ${fromResult.detail}`+ : line+ }+ tone={ok ? 'ok' : neutral ? undefined : 'error'}+ />)}@@ -382,29 +381,14 @@ function McpSetupPending({ args }: ToolCallMessagePartProps) {}}, [action, copy, entry, envDraft, respond, server])- const title =- action === 'enable'- ? copy.enableTitle(prettyName(server))- : action === 'authorize'- ? copy.authorizeTitle(prettyName(server))- : copy.installTitle(prettyName(server))-- const actionLabel =- action === 'enable' ? copy.enableAction : action === 'authorize' ? copy.authorizeAction : copy.installAction+ const displayName = prettyName(server)+ const card = cardCopy(copy, action)// What connecting actually means — the endpoint that will be contacted.- // VS Code's trust dialog links the config it's about to trust; same idea.// Catalog entries carry their transport URL in the API response; the// static directory remains a fallback rung for older backends.const known = directoryEntry(server)const sourceLine = action === 'install' ? (entry?.url ?? known?.url ?? copy.catalogSource) : null- const brand = brandFor(server)-- const trailingIcon = brand ? (- <brand.Icon aria-hidden className="mt-px size-4 shrink-0" style={brandGlyphStyle(brand)} />- ) : (- <Codicon className={ICON_CLASS} name="plug" size="1rem" />- )// ⌘/Ctrl+Enter → approve, Esc → decline/cancel. Same accelerators, same// guard shape as the approval bar (tool/approval.tsx). Unlike approve, Esc@@ -449,67 +433,35 @@ function McpSetupPending({ args }: ToolCallMessagePartProps) {if (!ready) {return (- <div className={cn(SHELL_CLASS, 'my-1.5 flex items-center gap-2')} data-slot="mcp-setup-inline">+ <div className={cn(SHELL_CLASS, 'my-1.5 flex items-center gap-2')} data-slot="connector-card"><Loader2 aria-hidden className="size-4 animate-spin text-(--ui-text-tertiary)" />- <span className="text-(--ui-text-tertiary)">{title}</span>+ <span className="text-(--ui-text-tertiary)">{card.connectTitle?.(displayName)}</span></div>)}+ // The same consent card the connector offer renders: one shape for every+ // "connect this?" in the transcript. `phase` is what flips the card into+ // its working state (spinner on the action, decline becomes cancel).return (- <div className={cn(SHELL_CLASS, 'my-1.5 grid gap-1.5')} data-slot="mcp-setup-inline">- <SetupLine trailing={trailingIcon}>- <span className="font-medium leading-(--conversation-line-height)">{title}</span>- {reason ? <p className="mt-0.5 text-(--ui-text-secondary)">{reason}</p> : null}- {sourceLine && <p className="mt-0.5 truncate text-[0.6875rem] text-(--ui-text-tertiary)">{sourceLine}</p>}- </SetupLine>- {envOpen && entry && entry.required_env.length > 0 && (- <div className="grid gap-2" data-slot="mcp-setup-env">- <p className="text-[0.6875rem] text-(--ui-text-tertiary)">{copy.envRequired}</p>- {entry.required_env.map(env => (- <label className="grid gap-1" key={env.name}>- <span className="text-[0.6875rem] text-(--ui-text-secondary)">- {env.prompt || env.name}- {env.required ? ' *' : ''}- </span>- <Input- className="h-7 text-xs"- onChange={event => setEnvDraft(prev => ({ ...prev, [env.name]: event.currentTarget.value }))}- type="password"- value={envDraft[env.name] ?? ''}- />- </label>- ))}- </div>- )}- {/* Same strip as the tool approval bar (tool/approval.tsx): a bordered- primary-tinted action plus a quiet ghost decline, with the matching- keyboard hints. One consent vocabulary across the transcript. */}- <div className="flex items-center gap-2.5">- <div className="inline-flex h-6 items-stretch overflow-hidden rounded-md border border-primary/25 bg-primary/10 text-primary">- <Button- className="h-full gap-1 rounded-none px-2 text-xs font-medium text-primary hover:bg-primary/15 hover:text-primary"- disabled={working}- onClick={() => void approve()}- size="xs"- variant="ghost"- >- {working ? <Loader2 className="size-3 animate-spin" /> : actionLabel}- {!working && <span className="text-[0.625rem] text-primary/60">{isMac ? '⌘⏎' : 'Ctrl⏎'}</span>}- </Button>- </div>- {/* Never disabled: while a flow is in flight this is the cancel —- a stuck OAuth tab or hung install must always have a way out. */}- <Button- className="h-6 gap-1.5 rounded-md px-1.5 text-xs font-normal text-(--ui-text-tertiary) hover:text-foreground"- onClick={decline}- size="xs"- variant="ghost"- >- {working ? t.common.cancel : copy.decline}- <span className="text-[0.625rem] opacity-55">Esc</span>- </Button>- </div>- </div>+ <ConnectorCard+ accelerators+ connector={{+ description: reason || undefined,+ name: server,+ requiredEnv: entry?.required_env,+ title: displayName+ }}+ copy={{ ...card, decline: working ? t.common.cancel : card.decline }}+ envDraft={envDraft}+ envOpen={envOpen && !!entry && entry.required_env.length > 0}+ onConnect={() => void approve()}+ onDismiss={decline}+ onEnvChange={(key, value) => setEnvDraft(prev => ({ ...prev, [key]: value }))}+ phase={working ? '' : undefined}+ source={sourceLine ? { text: sourceLine } : undefined}+ state="not_configured"+ variant="avatar"+ />)}diff --git a/apps/desktop/src/components/ui/connector-card.tsx b/apps/desktop/src/components/ui/connector-card.tsxindex c274234d22c..a2bfc4ef602 100644--- a/apps/desktop/src/components/ui/connector-card.tsx+++ b/apps/desktop/src/components/ui/connector-card.tsx@@ -6,7 +6,7 @@ import { ConnectorLogo, type ConnectorLogoSubject } from '@/components/ui/connecimport { Input } from '@/components/ui/input'import { Tip } from '@/components/ui/tooltip'import { MarkdownLinkText } from '@/lib/external-link'-import { Loader2 } from '@/lib/icons'+import { CheckCircle2 } from '@/lib/icons'import { cn } from '@/lib/utils'/**@@ -63,6 +63,9 @@ export interface ConnectorCardOutcome {* card stays a leaf that anything can render, tests included. */export interface ConnectorCardCopy {connectAction: string+ /** The live offer's heading as a question — "Connect Gmail?" — the same+ * shape the MCP setup card asks in. Absent, the card leads with the name. */+ connectTitle?: (title: string) => stringdecline: stringenvRequired: stringgrantAction: string@@ -79,8 +82,18 @@ export interface ConnectorCardCopy {trustVerifiedTip: (publisher: string) => string}+/** What connecting actually means — the endpoint that will be contacted,+ * or the catalog it came from. VS Code's trust dialog links the config it+ * is about to trust; same idea. Shown under the description in tertiary. */+export interface ConnectorCardSource {+ text: string+}+const SHELL_CLASS = `${WIDGET_SHELL_CLASS} text-[length:var(--conversation-text-font-size)] text-(--ui-text-primary)`+// Same platform sniff the approval bar uses for its accelerator hint.+const isMac = typeof navigator !== 'undefined' && /Mac|iP(hone|ad|od)/.test(navigator.platform)+const hostOf = (url: null | string | undefined): string => {if (!url) {return ''@@ -124,7 +137,9 @@ export function ConnectorSummary({}: {connector: ConnectorLogoSubjectmeta?: string- tone?: 'error'+ /** `ok` is the settled tool row's emerald; `error` its destructive. Absent+ * is the neutral grey a skip or a no-answer reads in. */+ tone?: 'error' | 'ok'}) {// The scaffold mark goes on the row, never on a container holding several:// opacity opens a stacking context and would pin every sibling to one level.@@ -135,7 +150,17 @@ export function ConnectorSummary({<span className="truncate text-[length:var(--conversation-tool-font-size)] text-(--ui-text-primary)">{connector.title || connector.name}</span>- {meta ? <span className={cn(SCAFFOLD_META_CLASS, tone === 'error' && 'text-destructive')}>{meta}</span> : null}+ {meta ? (+ <span+ className={cn(+ SCAFFOLD_META_CLASS,+ tone === 'error' && 'text-destructive',+ tone === 'ok' && 'text-emerald-600/85 dark:text-emerald-400/85'+ )}+ >+ {meta}+ </span>+ ) : null}</ScaffoldRow></div>)@@ -186,6 +211,15 @@ function TrustBadge({ connector, copy }: { connector: ConnectorCardSubject; copy}export interface ConnectorCardProps {+ /** Show ⌘⏎ / Esc beside the actions. Only the card that also LISTENS for+ * those keys should claim them; a hint on a card that ignores the key is+ * a lie the user finds out about by pressing it. */+ accelerators?: boolean+ /** Settled cards fold to a scaffold line (the MCP setup default). The+ * connector offer keeps the card standing with a green Connected in the+ * action slot: a row of identical cards where one collapses reads as a+ * row where one broke. */+ collapseWhenSettled?: booleanconnector: ConnectorCardSubjectcopy: ConnectorCardCopy/** Waved off by the user. Collapses to the same settled line as success. */@@ -204,7 +238,12 @@ export interface ConnectorCardProps {outcome?: ConnectorCardOutcome/** Present only while working; replaces the resting state label. */phase?: string+ source?: ConnectorCardSourcestate: ConnectorCardState+ /** `avatar` leads with the mark at identity scale in a left gutter, the way+ * the MCP and Messaging headers introduce a service. `compact` (default)+ * trails a small mark on the right like the setup card's tool row. */+ variant?: 'avatar' | 'compact'}/**@@ -216,6 +255,8 @@ export interface ConnectorCardProps {* spent and the space belongs to the ones still asking.*/export function ConnectorCard({+ accelerators = false,+ collapseWhenSettled = true,connector,copy,dismissed = false,@@ -228,7 +269,9 @@ export function ConnectorCard({actionDisabled = false,outcome,phase,- state+ source,+ state,+ variant = 'compact'}: ConnectorCardProps) {const working = phase !== undefinedconst connected = outcome?.status === 'connected'@@ -236,10 +279,18 @@ export function ConnectorCard({// Answered: the offer is spent, so the card collapses to a scaffold line and// gives the space back to whatever is still asking.- if (connected || dismissed) {- return <ConnectorSummary connector={connector} meta={outcomeMeta(outcome ?? { status: 'declined' }, copy)} />+ if ((connected || dismissed) && collapseWhenSettled) {+ return (+ <ConnectorSummary+ connector={connector}+ meta={outcomeMeta(outcome ?? { status: 'declined' }, copy)}+ tone={connected ? 'ok' : undefined}+ />+ )}+ const settled = connected || dismissed+const stateLabel = state === 'disabled' ? copy.stateDisabled : state === 'needs_auth' ? copy.stateNeedsAuth : null// Before the first connect, and again after a failed one. Something that@@ -252,98 +303,131 @@ export function ConnectorCard({const envFields = fixable ? (connector.requiredEnv ?? []) : []const steps = fixable ? (connector.setup ?? []) : []- // Logo owns the left rail; everything the card says and every control it- // offers shares the one text column, so the buttons sit on the copy's grid- // line instead of hanging off the card's edge under the mark.+ // Same shape as the MCP setup card, which is the consent widget users have+ // already met: the ask as a heading, one line of what it means, and the+ // action strip on the shell's own left edge. The mark either trails small+ // on the right (compact) or leads at identity scale in a left gutter+ // (avatar) — the MCP tab and Messaging headers' `items-start gap-3` row,+ // sized up so a first-time user sees WHOSE sign-in is about to open.+ const avatar = variant === 'avatar'+return (- <div className={cn(SHELL_CLASS, 'flex items-start gap-3')} data-slot="connector-card">- <ConnectorLogo connector={connector} />-- <div className="grid min-w-0 flex-1 gap-0.5">- <div className="flex flex-wrap items-baseline gap-x-1.5">- <span className="font-medium">{connector.title}</span>- {/* While the card is working its phase replaces the resting state —- "Signing in…" is the one the user needs, because the browser tab- that just took focus is otherwise unexplained. */}- {working ? (- <span className="text-[0.6875rem] text-(--ui-text-tertiary)">{phase}</span>- ) : (- stateLabel && <span className="text-[0.6875rem] text-(--ui-text-tertiary)">{stateLabel}</span>+ <div className={cn(SHELL_CLASS, 'my-1.5 grid gap-1.5')} data-slot="connector-card">+ <div className={cn('flex items-start', avatar ? 'gap-3' : 'gap-2')}>+ {avatar ? <ConnectorLogo className="size-10 rounded-xl text-base" connector={connector} /> : null}+ <div className="grid min-w-0 flex-1 gap-0.5">+ <div className="flex flex-wrap items-baseline gap-x-1.5">+ <span className="font-medium leading-(--conversation-line-height)">+ {copy.connectTitle ? copy.connectTitle(connector.title) : connector.title}+ </span>+ {/* While the card is working its phase replaces the resting state —+ "Signing in…" is the one the user needs, because the browser tab+ that just took focus is otherwise unexplained. */}+ {working ? (+ <span className="text-[0.6875rem] text-(--ui-text-tertiary)">{phase}</span>+ ) : (+ stateLabel && <span className="text-[0.6875rem] text-(--ui-text-tertiary)">{stateLabel}</span>+ )}+ <TrustBadge connector={connector} copy={copy} />+ </div>++ {connector.description ? <p className="text-(--ui-text-secondary)">{connector.description}</p> : null}++ {source ? <p className="truncate text-[0.6875rem] text-(--ui-text-tertiary)">{source.text}</p> : null}++ {failed && outcome.detail ? <p className="text-[0.6875rem] text-destructive">{outcome.detail}</p> : null}++ {/* The part we cannot do. Numbered because order matters, linked+ because the whole cost of these steps is finding the page. */}+ {steps.length > 0 && (+ <ol className="mt-1.5 grid gap-1" data-slot="connector-card-steps">+ {steps.map((step, index) => (+ <li className="flex gap-1.5 text-[0.6875rem] text-(--ui-text-secondary)" key={step}>+ <span className="tabular-nums text-(--ui-text-tertiary)">{index + 1}.</span>+ <MarkdownLinkText text={step} />+ </li>+ ))}+ </ol>)}- <TrustBadge connector={connector} copy={copy} />- </div>- {connector.description ? <p className="text-(--ui-text-secondary)">{connector.description}</p> : null}-- {failed && outcome.detail ? <p className="text-[0.6875rem] text-destructive">{outcome.detail}</p> : null}-- {/* The part we cannot do. Numbered because order matters, linked- because the whole cost of these steps is finding the page. */}- {steps.length > 0 && (- <ol className="mt-1.5 grid gap-1" data-slot="connector-card-steps">- {steps.map((step, index) => (- <li className="flex gap-1.5 text-[0.6875rem] text-(--ui-text-secondary)" key={step}>- <span className="tabular-nums text-(--ui-text-tertiary)">{index + 1}.</span>- <MarkdownLinkText text={step} />- </li>- ))}- </ol>+ {envOpen && envFields.length > 0 && (+ <div className="mt-1 grid gap-2" data-slot="connector-card-env">+ <p className="text-[0.6875rem] text-(--ui-text-tertiary)">{copy.envRequired}</p>+ {envFields.map(env => (+ <label className="grid gap-1" key={env.name}>+ <span className="text-[0.6875rem] text-(--ui-text-secondary)">+ {env.prompt || env.name}+ {env.required ? ' *' : ''}+ </span>+ <Input+ className="h-7 text-xs"+ onChange={event => onEnvChange?.(env.name, event.currentTarget.value)}+ type="password"+ value={envDraft[env.name] ?? ''}+ />+ </label>+ ))}+ </div>+ )}+ </div>+ {avatar ? null : (+ <ConnectorLogo className="mt-px size-5 rounded-[0.3rem] text-[0.6875rem]" connector={connector} />)}+ </div>- {envOpen && envFields.length > 0 && (- <div className="mt-1 grid gap-2" data-slot="connector-card-env">- <p className="text-[0.6875rem] text-(--ui-text-tertiary)">{copy.envRequired}</p>- {envFields.map(env => (- <label className="grid gap-1" key={env.name}>- <span className="text-[0.6875rem] text-(--ui-text-secondary)">- {env.prompt || env.name}- {env.required ? ' *' : ''}- </span>- <Input- className="h-7 text-xs"- onChange={event => onEnvChange?.(env.name, event.currentTarget.value)}- type="password"- value={envDraft[env.name] ?? ''}- />- </label>- ))}+ {/* Same strip as the tool approval bar (tool/approval.tsx), down to its+ stand-off: a bordered primary-tinted action plus a quiet ghost+ decline. One consent vocabulary across the transcript. In the avatar+ layout the strip sits on the text column, so the gutter stays the+ mark's alone. Settled (and kept standing), the action slot holds the+ verdict in the same box — green Connected, grey Skipped — so the row+ of cards keeps its rhythm and nothing jumps. */}+ <div className={cn('flex items-center gap-2.5', avatar && 'pl-13')}>+ {settled ? (+ <div+ className={cn(+ 'inline-flex h-6 items-stretch overflow-hidden rounded-md border',+ connected+ ? 'border-emerald-600/25 bg-emerald-600/10 text-emerald-700 dark:border-emerald-400/25 dark:bg-emerald-400/10 dark:text-emerald-300'+ : 'border-(--ui-stroke-tertiary) bg-(--ui-bg-quaternary) text-(--ui-text-tertiary)'+ )}+ data-slot="connector-card-verdict"+ >+ <span className="inline-flex h-full items-center gap-1 px-2 text-xs font-medium">+ {connected ? <CheckCircle2 aria-hidden className="size-3" /> : null}+ {outcomeMeta(outcome ?? { status: 'declined' }, copy)}+ </span></div>- )}-- {/* Same strip as the tool approval bar (tool/approval.tsx), down to its- `mt-2` stand-off: a bordered primary-tinted action plus a quiet- ghost decline. One consent vocabulary across the transcript. */}- <div className="mt-2 flex items-center gap-2.5">- <div className="inline-flex h-6 items-stretch overflow-hidden rounded-md border border-primary/25 bg-primary/10 text-primary">+ ) : (+ <>+ <div className="inline-flex h-6 items-stretch overflow-hidden rounded-md border border-primary/25 bg-primary/10 text-primary">+ <Button+ className="h-full gap-1 rounded-none px-2 text-xs font-medium text-primary hover:bg-primary/15 hover:text-primary"+ disabled={otherBusy || actionDisabled}+ loading={working}+ onClick={onConnect}+ size="xs"+ variant="ghost"+ >+ {outcome?.needsAuth ? copy.grantAction : failed ? copy.retryAction : copy.connectAction}+ {accelerators ? (+ <span className="text-[0.625rem] text-primary/60">{isMac ? '⌘⏎' : 'Ctrl⏎'}</span>+ ) : null}+ </Button>+ </div>+ {/* Never disabled: while a connect is in flight this is the way out+ of a stuck sign-in tab or a hung install. */}<Button- className="h-full gap-1 rounded-none px-2 text-xs font-medium text-primary hover:bg-primary/15 hover:text-primary"- disabled={working || otherBusy || actionDisabled}- onClick={onConnect}+ className="h-6 gap-1.5 rounded-md px-1.5 text-xs font-normal text-(--ui-text-tertiary) hover:text-foreground"+ onClick={onDismiss}size="xs"variant="ghost">- {working ? (- <Loader2 className="size-3 animate-spin" />- ) : outcome?.needsAuth ? (- copy.grantAction- ) : failed ? (- copy.retryAction- ) : (- copy.connectAction- )}+ {copy.decline}+ {accelerators ? <span className="text-[0.625rem] opacity-55">Esc</span> : null}</Button>- </div>- {/* Never disabled: while a connect is in flight this is the way out- of a stuck sign-in tab or a hung install. */}- <Button- className="h-6 gap-1.5 rounded-md px-1.5 text-xs font-normal text-(--ui-text-tertiary) hover:text-foreground"- onClick={onDismiss}- size="xs"- variant="ghost"- >- {copy.decline}- </Button>- </div>+ </>+ )}</div></div>)diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.tsindex 304627c1909..b63c79aeb9a 100644--- a/apps/desktop/src/i18n/en.ts+++ b/apps/desktop/src/i18n/en.ts@@ -26,10 +26,9 @@ export const en: Translations = {ownerMissing: 'Reopen this conversation to manage its connections.',search: 'Find an app',empty: 'No matching apps',- continue: 'Continue in chat',- continueBusy: 'Waiting for this turn to finish',- continueFailed: 'Could not continue. Try again.',disclaimer: 'Connecting is optional. Only authorize the apps you want Hermes to use.',+ connectTitle: app => `Connect ${app}?`,+ describe: app => `Hermes signs in to ${app} in your browser and asks before reading anything there.`,execution: 'Connector tools'},diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.tsindex 861a4298542..e32bab5f2b3 100644--- a/apps/desktop/src/i18n/types.ts+++ b/apps/desktop/src/i18n/types.ts@@ -74,10 +74,9 @@ export interface Translations {ownerMissing: stringsearch: stringempty: string- continue: string- continueBusy: string- continueFailed: stringdisclaimer: string+ connectTitle: (app: string) => string+ describe: (app: string) => stringexecution: string}sessionImport: {diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.tsindex 895cb83c3ba..b2e1eefb3e0 100644--- a/apps/desktop/src/i18n/zh.ts+++ b/apps/desktop/src/i18n/zh.ts@@ -26,10 +26,9 @@ export const zh: Translations = {ownerMissing: '请重新打开此对话以管理连接。',search: '查找应用',empty: '没有匹配的应用',- continue: '在对话中继续',- continueBusy: '等待当前操作完成',- continueFailed: '无法继续,请重试。',disclaimer: '连接为可选操作。请仅授权你希望 Hermes 使用的应用。',+ connectTitle: app => `连接 ${app}?`,+ describe: app => `Hermes 会在浏览器中登录 ${app},读取任何内容前都会先询问。`,execution: '连接器工具'},diff --git a/apps/desktop/src/lib/mcp-brands.tsx b/apps/desktop/src/lib/mcp-brands.tsxindex 4bfff908f59..6e9d83aaf62 100644--- a/apps/desktop/src/lib/mcp-brands.tsx+++ b/apps/desktop/src/lib/mcp-brands.tsx@@ -14,9 +14,13 @@ import {SiAsana,SiAtlassian,SiDatadog,+ SiDiscord,SiFigma,SiGithub,SiGitlab,+ SiGmail,+ SiGooglecalendar,+ SiGoogledrive,SiHuggingface,SiIntercom,SiLinear,@@ -26,14 +30,17 @@ import {SiPaypal,SiPostgresql,SiSentry,+ SiSpotify,SiSquare,SiStripe,SiSupabase,+ SiTelegram,SiUnrealengine,SiVercel,SiWebflow,SiZapier} from '@icons-pack/react-simple-icons'+import { IconBrandSlack } from '@tabler/icons-react'import type { ComponentType, SVGProps } from 'react'export interface McpBrand {@@ -50,9 +57,13 @@ export const MCP_BRAND_ICONS: Record<string, McpBrand> = {asana: { Icon: SiAsana, color: '#F06A6A' },atlassian: { Icon: SiAtlassian, color: '#0052CC' },datadog: { Icon: SiDatadog, color: '#632CA6' },+ discord: { Icon: SiDiscord, color: '#5865F2' },figma: { Icon: SiFigma, color: '#F24E1E' },github: { Icon: SiGithub, color: '#181717', monochrome: true },gitlab: { Icon: SiGitlab, color: '#FC6D26' },+ gmail: { Icon: SiGmail, color: '#EA4335' },+ 'google-calendar': { Icon: SiGooglecalendar, color: '#4285F4' },+ 'google-drive': { Icon: SiGoogledrive, color: '#4285F4' },hugging_face: { Icon: SiHuggingface, color: '#FFD21E' },huggingface: { Icon: SiHuggingface, color: '#FFD21E' },intercom: { Icon: SiIntercom, color: '#6AFDEF' },@@ -64,9 +75,15 @@ export const MCP_BRAND_ICONS: Record<string, McpBrand> = {postgres: { Icon: SiPostgresql, color: '#4169E1' },postgresql: { Icon: SiPostgresql, color: '#4169E1' },sentry: { Icon: SiSentry, color: '#362D59' },+ // simple-icons dropped Slack's mark on a trademark request and the site's+ // favicon is a flat purple square that reads as a blank disc at chip size.+ // Tabler's outline pinwheel is the one recognisable Slack we can ship.+ slack: { Icon: IconBrandSlack as ComponentType<SVGProps<SVGSVGElement>>, color: '#4A154B' },+ spotify: { Icon: SiSpotify, color: '#1DB954' },square: { Icon: SiSquare, color: '#3E4348', monochrome: true },stripe: { Icon: SiStripe, color: '#635BFF' },supabase: { Icon: SiSupabase, color: '#3FCF8E' },+ telegram: { Icon: SiTelegram, color: '#26A5E4' },'unreal-engine': { Icon: SiUnrealengine, color: '#0E1128', monochrome: true },vercel: { Icon: SiVercel, color: '#000000', monochrome: true },webflow: { Icon: SiWebflow, color: '#146EF5' },