Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
fix(workbench): primitive cleanup + chat header + agents rebuild
cyh2f8c17c21f32
diff --git a/ui/src/components/ui/button.tsx b/ui/src/components/ui/button.tsxindex e6c161cdc..b4a977acf 100644--- a/ui/src/components/ui/button.tsx+++ b/ui/src/components/ui/button.tsx@@ -19,6 +19,8 @@ const buttonVariants = cva('gap-2 bg-cyan font-bold text-accent-foreground shadow-[0_0_24px_-4px_rgba(63,224,229,0.6)] hover:brightness-105 disabled:shadow-none','brand-gold':'gap-2 bg-gold font-bold text-gold-foreground shadow-[0_0_24px_-4px_rgba(255,200,87,0.55)] hover:brightness-105 disabled:shadow-none',+ 'brand-violet':+ 'gap-2 bg-violet font-bold text-white shadow-[0_0_24px_-4px_rgba(124,91,255,0.55)] hover:brightness-105 disabled:shadow-none',secondary: 'gap-1.5 border border-border bg-secondary text-secondary-foreground hover:border-border-strong',// Outline — bg matches page surface so it sits cleanly on glow gradients.outline:diff --git a/ui/src/components/ui/switch.tsx b/ui/src/components/ui/switch.tsxnew file mode 100644index 000000000..e91538d9a--- /dev/null+++ b/ui/src/components/ui/switch.tsx@@ -0,0 +1,45 @@+import * as React from 'react';+import { cn } from '@/lib/utils';++export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {+ checked: boolean;+ onCheckedChange: (next: boolean) => void;+ /** ARIA label so screen readers can describe what the switch toggles. */+ label?: string;+}++// Mint-on / muted-off toggle. Mirrors design.pen's enable switches used+// across Agents / Harness rows — pill rail + drag-feel thumb that snaps+// to the active end. Keep this the single source of truth so the visual+// stays consistent the next time a toggle ships.+export const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(+ ({ className, checked, onCheckedChange, label, disabled, ...props }, ref) => {+ return (+ <button+ ref={ref}+ type="button"+ role="switch"+ aria-checked={checked}+ aria-label={label}+ disabled={disabled}+ onClick={() => onCheckedChange(!checked)}+ className={cn(+ 'relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border transition disabled:cursor-not-allowed disabled:opacity-50',+ checked+ ? 'border-mint/50 bg-mint shadow-[0_0_12px_-4px_rgba(91,255,160,0.55)]'+ : 'border-border-strong bg-surface-2',+ className,+ )}+ {...props}+ >+ <span+ className={cn(+ 'inline-block size-[18px] translate-x-0.5 rounded-full bg-background shadow-[0_1px_3px_rgba(0,0,0,0.4)] transition-transform',+ checked && 'translate-x-[22px] bg-[#080812]',+ )}+ />+ </button>+ );+ },+);+Switch.displayName = 'Switch';diff --git a/ui/src/components/workbench/AgentsPage.tsx b/ui/src/components/workbench/AgentsPage.tsxindex 8a779bfd0..631461245 100644--- a/ui/src/components/workbench/AgentsPage.tsx+++ b/ui/src/components/workbench/AgentsPage.tsx@@ -1,11 +1,16 @@import { useCallback, useEffect, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';-import { Bot, Plus, RefreshCw, Trash2 } from 'lucide-react';+import { Bot, ChevronDown, Funnel, Loader2, Plus, RefreshCw, Search, Trash2, Upload } from 'lucide-react';import clsx from 'clsx';import { useApi } from '../../context/ApiContext';import type { VibeAgentBrief, VibeAgentFull } from '../../context/ApiContext';+import { useToast } from '../../context/ToastContext';import { NewAgentDialog } from './NewAgentDialog';+import { Badge } from '../ui/badge';+import { Button } from '../ui/button';+import { Switch } from '../ui/switch';+import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';const BACKEND_ORDER = ['claude', 'opencode', 'codex'] as const;type Backend = (typeof BACKEND_ORDER)[number];@@ -16,10 +21,10 @@ const BACKEND_LABEL: Record<Backend, string> = {codex: 'Codex',};-const BACKEND_COLOR: Record<Backend, { ic: string; text: string; soft: string }> = {- claude: { ic: 'text-mint', text: 'text-mint', soft: 'border-mint/30 bg-mint/[0.06]' },- opencode: { ic: 'text-cyan', text: 'text-cyan', soft: 'border-cyan/30 bg-cyan/[0.06]' },- codex: { ic: 'text-violet', text: 'text-violet', soft: 'border-violet/30 bg-violet/[0.06]' },+const BACKEND_ICON_CLASS: Record<Backend, string> = {+ claude: 'text-mint',+ opencode: 'text-cyan',+ codex: 'text-violet',};const EFFORT_OPTIONS = ['low', 'medium', 'high', 'max'];@@ -31,39 +36,50 @@ function isSystemAgent(agent: { source: string }): boolean {export const AgentsPage: React.FC = () => {const { t } = useTranslation();const api = useApi();+ const { showToast } = useToast();const [agents, setAgents] = useState<VibeAgentBrief[]>([]);const [defaultName, setDefaultName] = useState<string | null>(null);const [selected, setSelected] = useState<VibeAgentFull | null>(null);const [loading, setLoading] = useState(false);const [showNew, setShowNew] = useState(false);const [error, setError] = useState<string | null>(null);- const [showDisabled, setShowDisabled] = useState(true);+ const [search, setSearch] = useState('');+ const [backendFilter, setBackendFilter] = useState<Backend | 'all'>('all');+ const [importing, setImporting] = useState<Backend | null>(null);const refresh = useCallback(async () => {setLoading(true);setError(null);try {- const result = await api.listVibeAgents({ includeDisabled: showDisabled });+ const result = await api.listVibeAgents({ includeDisabled: true });setAgents(result.agents);setDefaultName(result.default_agent_name);// Keep the currently-selected agent fresh after edits / refreshes.if (selected) {const fresh = result.agents.find((a) => a.name === selected.name);- if (!fresh) {- setSelected(null);- }+ if (!fresh) setSelected(null);}} catch (err: any) {setError(err?.message ?? String(err));} finally {setLoading(false);}- }, [api, showDisabled, selected]);+ }, [api, selected]);useEffect(() => {refresh();// eslint-disable-next-line react-hooks/exhaustive-deps- }, [showDisabled]);+ }, []);++ // Auto-select the default agent on first load so the detail panel has+ // something to show — eliminates the empty "select an agent" state+ // that confused users on first visit.+ useEffect(() => {+ if (selected || agents.length === 0) return;+ const target = (defaultName && agents.find((a) => a.name === defaultName)) || agents[0];+ if (target) selectAgent(target.name);+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [defaultName, agents]);const selectAgent = useCallback(async (name: string) => {@@ -77,14 +93,29 @@ export const AgentsPage: React.FC = () => {[api],);+ // Apply text search + backend filter; backend grouping is a layout+ // concern that operates on the filtered set.+ const filtered = useMemo(() => {+ const q = search.trim().toLowerCase();+ return agents.filter((agent) => {+ if (backendFilter !== 'all' && agent.backend !== backendFilter) return false;+ if (!q) return true;+ return (+ agent.name.toLowerCase().includes(q) ||+ (agent.description ?? '').toLowerCase().includes(q) ||+ (agent.model ?? '').toLowerCase().includes(q)+ );+ });+ }, [agents, search, backendFilter]);+const grouped = useMemo(() => {const groups: Record<Backend, VibeAgentBrief[]> = { claude: [], opencode: [], codex: [] };- for (const agent of agents) {+ for (const agent of filtered) {const key = (agent.backend as Backend) in groups ? (agent.backend as Backend) : null;if (key) groups[key].push(agent);}return groups;- }, [agents]);+ }, [filtered]);const onCreated = (agent: VibeAgentFull) => {refresh().then(() => setSelected(agent));@@ -122,55 +153,66 @@ export const AgentsPage: React.FC = () => {}};+ const onImport = async (from: Backend) => {+ setImporting(from);+ try {+ const result = await api.importVibeAgents({ from, all: true });+ if (result.ok) {+ const created = result.created?.length ?? 0;+ const skipped = result.skipped?.length ?? 0;+ showToast(t('agents.importSuccess', { created, skipped }), 'success');+ refresh();+ } else {+ showToast(+ t('agents.importFailed', { error: result.message || result.error || result.code || 'unknown' }),+ 'error',+ );+ }+ } catch (err: any) {+ showToast(t('agents.importFailed', { error: err?.message ?? String(err) }), 'error');+ } finally {+ setImporting(null);+ }+ };++ const totalShown = filtered.length;+ const noMatches = totalShown === 0 && agents.length > 0;+return (- <div className="mx-auto flex w-full max-w-[1080px] flex-col gap-5 py-2">- {/* Header */}+ <div className="mx-auto flex w-full max-w-[1200px] flex-col gap-5 py-2">+ {/* Header — design.pen l5V2m: 40x40 mint-soft icon + title + subtitle */}<div className="flex items-center gap-4">- <div className="flex size-12 shrink-0 items-center justify-center rounded-2xl border border-mint/30 bg-mint/[0.08] text-mint shadow-[0_0_24px_-6px_rgba(91,255,160,0.5)]">+ <div className="flex size-10 shrink-0 items-center justify-center rounded-[10px] border border-mint/40 bg-mint-soft text-mint shadow-[0_0_18px_-6px_rgba(91,255,160,0.5)]"><Bot className="size-5" /></div><div className="flex flex-1 flex-col">- <h1 className="text-2xl font-bold text-foreground">{t('agents.title')}</h1>- <p className="text-[13px] text-muted">- {t('agents.subtitle', { count: agents.length })}- </p>+ <h1 className="text-[24px] font-bold text-foreground">{t('agents.title')}</h1>+ <p className="text-[12px] text-muted">{t('agents.subtitle', { count: agents.length })}</p></div>- <button- type="button"- onClick={() => refresh()}- disabled={loading}- className={clsx(- 'flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-[12px] font-medium transition',- loading- ? 'cursor-wait border-border bg-foreground/[0.02] text-muted'- : 'border-border-strong text-foreground hover:bg-foreground/[0.04]',- )}- >+ <Button type="button" variant="outline" size="xs" onClick={() => refresh()} disabled={loading}><RefreshCw className={clsx('size-3.5', loading && 'animate-spin')} />{t('common.refresh')}- </button>+ </Button></div>- {/* Toolbar */}- <div className="flex items-center gap-2">- <label className="inline-flex cursor-pointer items-center gap-2 text-[12px] text-muted">+ {/* Toolbar — design.pen Imduv: search + backend filter + spacer + Import + 新建 Agent */}+ <div className="flex flex-wrap items-center gap-2.5">+ <div className="flex w-[320px] items-center gap-2 rounded-md border border-border-strong bg-surface px-3 py-2">+ <Search className="size-3.5 shrink-0 text-muted" /><input- type="checkbox"- checked={showDisabled}- onChange={(e) => setShowDisabled(e.target.checked)}- className="accent-mint"+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ placeholder={t('agents.searchPlaceholder')}+ className="flex-1 bg-transparent text-[12px] text-foreground outline-none placeholder:text-muted"/>- {t('agents.showDisabled')}- </label>+ </div>+ <BackendFilter value={backendFilter} onChange={setBackendFilter} /><div className="flex-1" />- <button- type="button"- onClick={() => setShowNew(true)}- className="inline-flex items-center gap-1.5 rounded-md bg-mint px-3 py-1.5 text-[12px] font-bold text-[#080812] shadow-[0_0_14px_-4px_rgba(91,255,160,0.6)] hover:brightness-110"- >- <Plus className="size-3.5" />+ <ImportMenu onImport={onImport} importing={importing} />+ <Button type="button" variant="brand" size="xs" onClick={() => setShowNew(true)}>+ <Plus />{t('agents.newAgent')}- </button>+ </Button></div>{error && (@@ -179,72 +221,42 @@ export const AgentsPage: React.FC = () => {</div>)}- {/* Body: list + detail */}- <div className="grid grid-cols-[1fr_380px] gap-5">- <div className="flex flex-col gap-5">+ {/* Body — list + detail. The detail column only renders when a row+ is selected; the empty "select an agent" placeholder used to+ dominate the right side of a fresh page. With auto-select on+ mount it's rarely needed; when it is empty we just collapse+ back to a single column. */}+ <div+ className={clsx(+ 'grid gap-5',+ selected ? 'grid-cols-1 lg:grid-cols-[1fr_420px]' : 'grid-cols-1',+ )}+ >+ <div className="flex flex-col gap-4">{BACKEND_ORDER.map((backend) => {const items = grouped[backend];if (!items || items.length === 0) return null;- const color = BACKEND_COLOR[backend];return (<div key={backend} className="flex flex-col gap-2"><div className="flex items-center gap-2 px-1">- <Bot className={clsx('size-3.5', color.ic)} />- <span className={clsx('text-[13px] font-bold', color.text)}>+ <Bot className={clsx('size-3.5', BACKEND_ICON_CLASS[backend])} />+ <span className={clsx('text-[13px] font-bold', BACKEND_ICON_CLASS[backend])}>{BACKEND_LABEL[backend]}</span>- <span className="font-mono text-[10px] text-muted">{items.length} agents</span>+ <span className="font-mono text-[10px] text-muted">+ {items.length} agents+ </span></div><div className="flex flex-col gap-2">- {items.map((agent) => {- const isSelected = selected?.name === agent.name;- const isDefault = defaultName === agent.name;- return (- <button- key={agent.id}- type="button"- onClick={() => selectAgent(agent.name)}- className={clsx(- 'flex items-center gap-3 rounded-lg border px-4 py-3 text-left transition',- isSelected- ? 'border-mint/40 bg-mint/[0.05]'- : 'border-border bg-surface hover:bg-foreground/[0.03]',- )}- >- <div className="flex flex-1 flex-col gap-0.5">- <div className="flex items-center gap-2">- <span className="text-[14px] font-semibold text-foreground">{agent.name}</span>- {isDefault && (- <span className="rounded border border-mint/40 bg-mint/[0.10] px-1.5 py-0 font-mono text-[9px] font-bold text-mint">- DEFAULT- </span>- )}- {isSystemAgent(agent) && (- <span className="rounded border border-border-strong bg-surface-2 px-1.5 py-0 font-mono text-[9px] text-muted">- SYSTEM- </span>- )}- </div>- <div className="text-[11px] text-muted">- {[agent.model, agent.reasoning_effort, agent.description]- .filter(Boolean)- .join(' · ') || t('agents.noConfig')}- </div>- </div>- <span- className={clsx(- 'inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] font-mono font-bold',- agent.enabled- ? 'border-mint/30 bg-mint/[0.08] text-mint'- : 'border-border-strong bg-foreground/[0.04] text-muted',- )}- >- <span className={clsx('size-1.5 rounded-full', agent.enabled ? 'bg-mint' : 'bg-muted')} />- {agent.enabled ? 'enabled' : 'disabled'}- </span>- </button>- );- })}+ {items.map((agent) => (+ <AgentRow+ key={agent.id}+ agent={agent}+ isSelected={selected?.name === agent.name}+ isDefault={defaultName === agent.name}+ onSelect={() => selectAgent(agent.name)}+ />+ ))}</div></div>);@@ -254,20 +266,22 @@ export const AgentsPage: React.FC = () => {<div className="flex flex-col items-center gap-3 rounded-xl border border-dashed border-border bg-surface px-6 py-16 text-center"><Bot className="size-8 text-muted" /><div className="text-[14px] font-semibold text-foreground">{t('agents.empty')}</div>- <button- type="button"- onClick={() => setShowNew(true)}- className="rounded-md bg-mint px-3 py-1.5 text-[12px] font-bold text-[#080812]"- >+ <Button type="button" variant="brand" size="sm" onClick={() => setShowNew(true)}>+ <Plus />{t('agents.newAgent')}- </button>+ </Button>+ </div>+ )}++ {noMatches && (+ <div className="rounded-xl border border-dashed border-border bg-surface px-6 py-10 text-center text-[12px] text-muted">+ {t('agents.noSearchMatch')}</div>)}</div>- {/* Detail panel */}- <div className="flex flex-col gap-3 self-start rounded-xl border border-border-strong bg-surface p-5">- {selected ? (+ {selected && (+ <div className="self-start rounded-2xl border border-border-strong bg-surface p-5"><AgentDetailPanelagent={selected}isDefault={defaultName === selected.name}@@ -282,13 +296,8 @@ export const AgentsPage: React.FC = () => {}}onDelete={onDelete}/>- ) : (- <div className="flex flex-col items-center justify-center gap-3 py-12 text-center text-[12px] text-muted">- <Bot className="size-6 text-muted" />- {t('agents.selectPrompt')}- </div>- )}- </div>+ </div>+ )}</div><NewAgentDialog open={showNew} onClose={() => setShowNew(false)} onCreated={onCreated} />@@ -296,6 +305,133 @@ export const AgentsPage: React.FC = () => {);};+// One row in the backend-grouped list. Hover state + click selects.+interface AgentRowProps {+ agent: VibeAgentBrief;+ isSelected: boolean;+ isDefault: boolean;+ onSelect: () => void;+}++const AgentRow: React.FC<AgentRowProps> = ({ agent, isSelected, isDefault, onSelect }) => {+ const description = [agent.model, agent.reasoning_effort, agent.description].filter(Boolean).join(' · ');+ return (+ <button+ type="button"+ onClick={onSelect}+ className={clsx(+ 'flex items-center gap-3 rounded-xl border px-4 py-3 text-left transition',+ isSelected+ ? 'border-mint/40 bg-mint-soft shadow-[0_0_18px_-10px_rgba(91,255,160,0.6)]'+ : 'border-border bg-surface hover:border-border-strong hover:bg-surface-2',+ )}+ >+ <div className="flex flex-1 flex-col gap-1">+ <div className="flex items-center gap-2">+ <span className="text-[14px] font-semibold text-foreground">{agent.name}</span>+ {isDefault && <Badge variant="success" className="px-1.5 py-0 text-[9px] font-mono uppercase">DEFAULT</Badge>}+ {isSystemAgent(agent) && (+ <Badge variant="secondary" className="px-1.5 py-0 text-[9px] font-mono uppercase">SYSTEM</Badge>+ )}+ </div>+ {description && <div className="text-[11px] text-muted">{description}</div>}+ </div>+ <Badge variant={agent.enabled ? 'success' : 'secondary'} className="font-mono uppercase">+ <span className={clsx('size-1.5 rounded-full', agent.enabled ? 'bg-mint' : 'bg-muted')} />+ {agent.enabled ? 'enabled' : 'disabled'}+ </Badge>+ </button>+ );+};++interface BackendFilterProps {+ value: Backend | 'all';+ onChange: (next: Backend | 'all') => void;+}++// Compact Popover trigger that mirrors design.pen dMFRl — funnel icon ++// "Backend: All" label + chevron. Replaces the old hand-rolled checkbox.+const BackendFilter: React.FC<BackendFilterProps> = ({ value, onChange }) => {+ const { t } = useTranslation();+ const [open, setOpen] = useState(false);+ const label = value === 'all' ? t('agents.backendAll') : BACKEND_LABEL[value];+ return (+ <Popover open={open} onOpenChange={setOpen}>+ <PopoverTrigger asChild>+ <button+ type="button"+ className="flex items-center gap-1.5 rounded-md border border-border-strong bg-surface px-3 py-2 text-[12px] font-medium text-foreground transition hover:bg-foreground/[0.04]"+ >+ <Funnel className="size-3 text-muted" />+ <span className="text-muted">{t('agents.backendFilter')}:</span>+ <span>{label}</span>+ <ChevronDown className="size-3 text-muted" />+ </button>+ </PopoverTrigger>+ <PopoverContent align="start" className="w-[180px] p-1">+ {(['all', ...BACKEND_ORDER] as const).map((key) => (+ <button+ key={key}+ type="button"+ onClick={() => {+ onChange(key);+ setOpen(false);+ }}+ className={clsx(+ 'flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] transition',+ value === key ? 'bg-cyan-soft text-cyan' : 'text-foreground hover:bg-foreground/[0.04]',+ )}+ >+ {key !== 'all' && <Bot className={clsx('size-3.5', BACKEND_ICON_CLASS[key])} />}+ <span>{key === 'all' ? t('agents.backendAll') : BACKEND_LABEL[key]}</span>+ </button>+ ))}+ </PopoverContent>+ </Popover>+ );+};++interface ImportMenuProps {+ onImport: (from: Backend) => void;+ importing: Backend | null;+}++// Outline Button that opens a popover with one entry per backend. The+// backend supports bulk import via `from=<backend>&all=true`, which+// surfaces every installed agent definition the user already has on+// disk for that backend.+const ImportMenu: React.FC<ImportMenuProps> = ({ onImport, importing }) => {+ const { t } = useTranslation();+ const [open, setOpen] = useState(false);+ return (+ <Popover open={open} onOpenChange={setOpen}>+ <PopoverTrigger asChild>+ <Button type="button" variant="outline" size="xs" disabled={importing !== null}>+ {importing ? <Loader2 className="size-3.5 animate-spin" /> : <Upload className="size-3.5" />}+ {t('agents.import')}+ </Button>+ </PopoverTrigger>+ <PopoverContent align="end" className="w-[200px] p-1">+ {BACKEND_ORDER.map((backend) => (+ <button+ key={backend}+ type="button"+ disabled={importing !== null}+ onClick={() => {+ onImport(backend);+ setOpen(false);+ }}+ className="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12px] text-foreground transition hover:bg-foreground/[0.04] disabled:opacity-50"+ >+ <Bot className={clsx('size-3.5', BACKEND_ICON_CLASS[backend])} />+ <span>{t(`agents.importFrom${BACKEND_LABEL[backend]}` as const)}</span>+ </button>+ ))}+ </PopoverContent>+ </Popover>+ );+};+interface DetailProps {agent: VibeAgentFull;isDefault: boolean;@@ -321,24 +457,14 @@ const AgentDetailPanel: React.FC<DetailProps> = ({ agent, isDefault, onChange, o<div className="flex flex-col gap-4">{/* Header */}<div className="flex items-center gap-2">- {system && (- <span className="rounded border border-border-strong bg-surface-2 px-1.5 py-0 font-mono text-[9px] text-muted">- SYSTEM- </span>- )}+ {system && <Badge variant="secondary" className="px-1.5 py-0 text-[9px] font-mono uppercase">SYSTEM</Badge>}<div className="flex-1 truncate text-[15px] font-bold text-foreground">{agent.name}</div>{isDefault ? (- <span className="rounded border border-mint/40 bg-mint/[0.10] px-1.5 py-0 font-mono text-[9px] font-bold text-mint">- DEFAULT- </span>+ <Badge variant="success" className="px-1.5 py-0 text-[9px] font-mono uppercase">DEFAULT</Badge>) : (- <button- type="button"- onClick={onSetDefault}- className="rounded border border-border-strong px-2 py-0.5 font-mono text-[9px] text-muted hover:text-foreground"- >+ <Button type="button" variant="outline" size="xs" onClick={onSetDefault}>{t('agents.makeDefault')}- </button>+ </Button>)}</div>@@ -346,61 +472,43 @@ const AgentDetailPanel: React.FC<DetailProps> = ({ agent, isDefault, onChange, o<divclassName={clsx('flex items-center justify-between gap-3 rounded-lg border px-3 py-2.5',- agent.enabled- ? 'border-mint/30 bg-mint/[0.06]'- : 'border-border-strong bg-foreground/[0.02]',+ agent.enabled ? 'border-mint/30 bg-mint-soft' : 'border-border-strong bg-surface-2',)}><div className="flex flex-col"><span className="text-[12px] font-bold text-foreground">{t('agents.detail.enabled')}</span><span className="text-[10px] text-muted">{t('agents.detail.enabledHint')}</span></div>- <button- type="button"- onClick={() => onChange({ enabled: !agent.enabled })}- className={clsx(- 'flex h-6 w-11 items-center rounded-full px-0.5 transition',- agent.enabled ? 'justify-end bg-mint' : 'justify-start bg-muted-soft',- )}- >- <span className="size-5 rounded-full bg-white shadow" />- </button>+ <Switch+ checked={agent.enabled}+ onCheckedChange={(next) => onChange({ enabled: next })}+ label={t('agents.detail.enabled')}+ /></div>{/* Backend (read-only) */}- <div className="flex flex-col gap-1.5">- <div className="font-mono text-[10px] font-bold uppercase tracking-[0.12em] text-muted">- {t('agents.detail.backend')}- </div>+ <Field label={t('agents.detail.backend')}><div className="rounded-md border border-border bg-surface-3 px-3 py-2 text-[12px] text-muted"><span className="font-mono font-semibold text-foreground">{agent.backend}</span><span className="ml-2 text-[10px]">{t('agents.detail.backendLocked')}</span></div>- </div>+ </Field>{/* Model */}- <div className="flex flex-col gap-1.5">- <div className="font-mono text-[10px] font-bold uppercase tracking-[0.12em] text-muted">- {t('agents.detail.model')}- </div>+ <Field label={t('agents.detail.model')}><inputvalue={model}onChange={(e) => setModel(e.target.value)}onBlur={() => {- if (model !== (agent.model ?? '')) {- onChange({ model: model.trim() || null });- }+ if (model !== (agent.model ?? '')) onChange({ model: model.trim() || null });}}placeholder={t('agents.create.modelPlaceholder')}className="rounded-md border border-border-strong bg-surface-2 px-3 py-2 font-mono text-[12px] text-foreground outline-none focus:border-cyan"/>- </div>+ </Field>{/* Effort */}- <div className="flex flex-col gap-1.5">- <div className="font-mono text-[10px] font-bold uppercase tracking-[0.12em] text-muted">- {t('agents.detail.effort')}- </div>+ <Field label={t('agents.detail.effort')}><div className="flex rounded-md border border-border-strong bg-surface-2 p-0.5">{EFFORT_OPTIONS.map((opt) => (<button@@ -411,21 +519,18 @@ const AgentDetailPanel: React.FC<DetailProps> = ({ agent, isDefault, onChange, oonChange({ reasoning_effort: opt });}}className={clsx(- 'flex-1 rounded text-[11px] font-semibold capitalize transition',- effort === opt ? 'bg-mint/[0.10] text-mint' : 'text-muted hover:text-foreground',+ 'flex-1 rounded px-2 py-1 text-[11px] font-semibold capitalize transition',+ effort === opt ? 'bg-mint-soft text-mint' : 'text-muted hover:text-foreground',)}>{opt}</button>))}</div>- </div>+ </Field>{/* System prompt */}- <div className="flex flex-col gap-1.5">- <div className="font-mono text-[10px] font-bold uppercase tracking-[0.12em] text-muted">- {t('agents.detail.systemPrompt')}- </div>+ <Field label={t('agents.detail.systemPrompt')}><textareavalue={systemPrompt}onChange={(e) => setSystemPrompt(e.target.value)}@@ -439,24 +544,26 @@ const AgentDetailPanel: React.FC<DetailProps> = ({ agent, isDefault, onChange, oclassName="rounded-md border border-border-strong bg-surface-3 px-3 py-2 text-[12px] text-foreground outline-none focus:border-cyan"/><span className="text-[10px] text-muted">{t('agents.detail.systemPromptHint')}</span>- </div>+ </Field>{/* Footer actions */}<div className="flex items-center gap-2 pt-1">- {!system && (- <button- type="button"- onClick={onDelete}- className="inline-flex items-center gap-1.5 rounded-md border border-pink/40 bg-pink/[0.08] px-3 py-1.5 text-[11px] font-bold text-pink hover:bg-pink/[0.14]"- >- <Trash2 className="size-3.5" />+ {!system ? (+ <Button type="button" variant="outline" size="xs" onClick={onDelete} className="border-pink/40 bg-pink/[0.08] text-pink hover:bg-pink/[0.14]">+ <Trash2 />{t('common.delete')}- </button>- )}- {system && (+ </Button>+ ) : (<span className="text-[10px] text-muted">{t('agents.detail.systemLocked')}</span>)}</div></div>);};++const Field: React.FC<{ label: string; children: React.ReactNode }> = ({ label, children }) => (+ <div className="flex flex-col gap-1.5">+ <div className="font-mono text-[10px] font-bold uppercase tracking-[0.12em] text-muted">{label}</div>+ {children}+ </div>+);diff --git a/ui/src/components/workbench/ChatPage.tsx b/ui/src/components/workbench/ChatPage.tsxindex dfb6b600d..9b385dcb6 100644--- a/ui/src/components/workbench/ChatPage.tsx+++ b/ui/src/components/workbench/ChatPage.tsx@@ -4,9 +4,12 @@ import { useNavigate, useParams } from 'react-router-dom';import { ArrowLeft, Bot, ChevronDown, Loader2, MessageSquare, Pencil, Send, StopCircle } from 'lucide-react';import clsx from 'clsx';+import { Info } from 'lucide-react';+import { useApi } from '../../context/ApiContext';import type { VibeAgentBrief, WorkbenchMessage, WorkbenchSession } from '../../context/ApiContext';import { apiFetch } from '../../lib/apiFetch';+import { Badge } from '../ui/badge';import { Button } from '../ui/button';import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';@@ -319,33 +322,49 @@ const ChatHeaderBar: React.FC<ChatHeaderBarProps> = ({ session, agents, onPatch,<div className="shrink-0 border-b border-border bg-surface/95 px-5 py-3.5 backdrop-blur md:px-8"><div className="mx-auto flex w-full max-w-[1080px] flex-col gap-3"><div className="flex items-center gap-3">- <button+ <Buttontype="button"+ variant="outline"+ size="icon"onClick={onBack}aria-label={t('chat.backToInbox')}- className="flex size-7 shrink-0 items-center justify-center rounded-md border border-border-strong text-muted transition hover:bg-foreground/[0.04] hover:text-foreground"+ className="size-7"><ArrowLeft className="size-3.5" />- </button>+ </Button><ProjectPill projectId={session.project_id} /><TitleField key={session.id} title={session.title} onCommit={(title) => onPatch({ title })} /></div>+ {/* Agent / model / effort cluster — design.pen Q5xIZa wraps these+ three controls in a single cyan-ringed surface so it reads as+ one runtime-settings unit. */}<div className="flex flex-wrap items-center gap-2">- <AgentPicker session={session} agents={agents} onPatch={onPatch} />- <ModelField key={`model-${session.id}`} model={session.model} onCommit={(model) => onPatch({ model })} />- <EffortPicker effort={session.reasoning_effort} onPick={(value) => onPatch({ reasoning_effort: value })} />+ <div className="flex flex-wrap items-center gap-2 rounded-lg border border-cyan/40 bg-surface-2 px-3 py-2">+ <AgentPicker session={session} agents={agents} onPatch={onPatch} />+ <span className="text-muted">·</span>+ <ModelField key={`model-${session.id}`} model={session.model} onCommit={(model) => onPatch({ model })} />+ <span className="text-muted">·</span>+ <EffortPicker effort={session.reasoning_effort} onPick={(value) => onPatch({ reasoning_effort: value })} />+ </div><span className="ml-auto font-mono text-[10px] text-muted">{t('chat.changesPersist')}</span></div>+ {/* Gold info banner — design.pen gSqYM. Explains the session-vs-+ project override semantics. Plain words; the badge alone would+ leave too much for the user to figure out from the UI shape. */}+ <div className="flex items-center gap-2 rounded-lg border border-gold/40 bg-gold/[0.08] px-3.5 py-2">+ <Info className="size-3 shrink-0 text-gold" />+ <span className="text-[11px] font-medium text-gold">{t('chat.sessionOverrideHint')}</span>+ </div></div></div>);};const ProjectPill: React.FC<{ projectId: string | null }> = ({ projectId }) => (- <span className="inline-flex items-center gap-1.5 rounded-md border border-cyan/40 bg-cyan/[0.08] px-2 py-0.5 font-mono text-[10px] font-semibold text-cyan">+ <Badge variant="info" className="font-mono text-[10px]"><span className="size-1.5 rounded-full bg-cyan" />{projectId || 'workbench'}- </span>+ </Badge>);interface TitleFieldProps {diff --git a/ui/src/components/workbench/CreateViaChatDialog.tsx b/ui/src/components/workbench/CreateViaChatDialog.tsxindex 585a3de1e..37d55ca64 100644--- a/ui/src/components/workbench/CreateViaChatDialog.tsx+++ b/ui/src/components/workbench/CreateViaChatDialog.tsx@@ -2,7 +2,6 @@ import { useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';import { useNavigate } from 'react-router-dom';import { ArrowRight, Loader2, Sparkles, X } from 'lucide-react';-import clsx from 'clsx';import { useApi } from '../../context/ApiContext';import type { WorkbenchProject } from '../../context/ApiContext';@@ -175,14 +174,10 @@ export const CreateViaChatDialog: React.FC<CreateViaChatDialogProps> = ({ kind,</button><Buttontype="button"- variant="default"+ variant="brand-violet"size="sm"onClick={open}disabled={submitting || noProjects || !projectId}- className={clsx(- 'gap-1.5 bg-violet text-[12px] font-bold text-white shadow-[0_3px_14px_-4px_rgba(124,91,255,0.6)]',- 'hover:brightness-110 disabled:shadow-none',- )}>{submitting ? (<>diff --git a/ui/src/components/workbench/HarnessPage.tsx b/ui/src/components/workbench/HarnessPage.tsxindex 7fe72f904..5a572a3e6 100644--- a/ui/src/components/workbench/HarnessPage.tsx+++ b/ui/src/components/workbench/HarnessPage.tsx@@ -30,6 +30,8 @@ import type {import { formatRelativeTime } from '../../lib/relativeTime';import { CreateViaChatDialog } from './CreateViaChatDialog';import type { CreateViaChatKind } from './CreateViaChatDialog';+import { Badge } from '../ui/badge';+import { Button } from '../ui/button';type TabKey = 'tasks' | 'watches' | 'webhooks' | 'runs';@@ -221,29 +223,20 @@ export const HarnessPage: React.FC = () => {<p className="text-[13px] text-muted">{t('harness.subtitle')}</p></div>{(tab === 'tasks' || tab === 'watches') && (- <button+ <Buttontype="button"+ variant="brand-violet"+ size="xs"onClick={() => setCreateKind(tab === 'tasks' ? 'task' : 'watch')}- className="flex items-center gap-1.5 rounded-md border border-violet/40 bg-violet/[0.08] px-3 py-1.5 text-[12px] font-bold text-violet shadow-[0_0_18px_-6px_rgba(124,91,255,0.55)] transition hover:brightness-110">- <Plus className="size-3.5" />+ <Plus />{t('harness.create')}- </button>+ </Button>)}- <button- type="button"- onClick={() => refresh()}- disabled={loading}- className={clsx(- 'flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-[12px] font-medium transition',- loading- ? 'cursor-wait border-border bg-foreground/[0.02] text-muted'- : 'border-border-strong text-foreground hover:bg-foreground/[0.04]',- )}- >+ <Button type="button" variant="outline" size="xs" onClick={() => refresh()} disabled={loading}><RefreshCw className={clsx('size-3.5', loading && 'animate-spin')} />{t('common.refresh')}- </button>+ </Button></div>{/* Tab row */}@@ -419,9 +412,9 @@ const TasksList: React.FC<TasksListProps> = ({<div className="flex items-center gap-2"><span className="text-[14px] font-semibold text-foreground">{task.name || task.id}</span>{!task.enabled && (- <span className="rounded border border-border-strong bg-foreground/[0.04] px-1.5 py-0 font-mono text-[9px] uppercase text-muted">+ <Badge variant="secondary" className="font-mono text-[9px] uppercase">{t('harness.runtime.disabled')}- </span>+ </Badge>)}</div><div className="flex items-center gap-3 text-[11px] text-muted">@@ -600,19 +593,19 @@ const WatchesList: React.FC<WatchesListProps> = ({<div className="flex items-center gap-2"><span className="text-[14px] font-semibold text-foreground">{watch.name || watch.id}</span>{watch.runtime.running ? (- <span className="inline-flex items-center gap-1 rounded-full border border-mint/30 bg-mint/[0.08] px-2 py-0 font-mono text-[9px] font-bold uppercase text-mint">+ <Badge variant="success" className="font-mono text-[9px] uppercase"><span className="size-1.5 rounded-full bg-mint" />{t('harness.runtime.running')}- </span>+ </Badge>) : !watch.enabled ? (- <span className="inline-flex items-center gap-1 rounded-full border border-border-strong bg-foreground/[0.04] px-2 py-0 font-mono text-[9px] uppercase text-muted">+ <Badge variant="secondary" className="font-mono text-[9px] uppercase"><PauseCircle className="size-2.5" />{t('harness.runtime.paused')}- </span>+ </Badge>) : (- <span className="rounded border border-border-strong bg-foreground/[0.04] px-1.5 py-0 font-mono text-[9px] uppercase text-muted">+ <Badge variant="secondary" className="font-mono text-[9px] uppercase">{t('harness.runtime.idle')}- </span>+ </Badge>)}</div><div className="truncate font-mono text-[11px] text-muted">{cmd}</div>@@ -888,23 +881,16 @@ const StatusPill: React.FC<StatusPillProps> = ({ enabled, runtimeRunning }) => {const { t } = useTranslation();if (runtimeRunning) {return (- <span className="inline-flex items-center gap-1 rounded-full border border-mint/30 bg-mint/[0.08] px-2 py-0 font-mono text-[9px] font-bold uppercase text-mint">+ <Badge variant="success" className="font-mono text-[9px] uppercase"><span className="size-1.5 rounded-full bg-mint" />{t('harness.runtime.running')}- </span>- );- }- if (!enabled) {- return (- <span className="rounded-full border border-border-strong bg-foreground/[0.04] px-2 py-0 font-mono text-[9px] uppercase text-muted">- {t('harness.runtime.disabled')}- </span>+ </Badge>);}return (- <span className="rounded-full border border-border-strong bg-foreground/[0.04] px-2 py-0 font-mono text-[9px] uppercase text-muted">- {t('harness.runtime.enabled')}- </span>+ <Badge variant="secondary" className="font-mono text-[9px] uppercase">+ {enabled ? t('harness.runtime.enabled') : t('harness.runtime.disabled')}+ </Badge>);};diff --git a/ui/src/components/workbench/WorkbenchSidebar.tsx b/ui/src/components/workbench/WorkbenchSidebar.tsxindex a5d6a392d..0bf9fdd52 100644--- a/ui/src/components/workbench/WorkbenchSidebar.tsx+++ b/ui/src/components/workbench/WorkbenchSidebar.tsx@@ -433,18 +433,20 @@ export const WorkbenchSidebar: React.FC = () => {className={({ isActive }) =>clsx('group flex items-center gap-2.5 rounded-lg border px-3 py-2.5 text-[13px] font-semibold transition-colors',+ // Cyan active state per design.pen ze15A — mint is reserved+ // for sessions / projects so the two reads stay distinct.isActive- ? 'border-mint/30 bg-mint/[0.08] text-foreground shadow-[0_0_16px_-4px_rgba(91,255,160,0.5)]'+ ? 'border-cyan/40 bg-cyan-soft text-foreground shadow-[0_0_16px_-4px_rgba(63,224,229,0.5)]': 'border-border-strong text-foreground hover:bg-foreground/[0.04]',)}>{({ isActive }) => (<>- <Inbox className={clsx('size-4', isActive ? 'text-mint' : 'text-foreground')} />+ <Inbox className={clsx('size-4', isActive ? 'text-cyan' : 'text-foreground')} /><span className="flex-1">{t('workbench.nav.inbox')}</span>{badge && (- <span className="inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-mint px-1.5 py-0.5 font-mono text-[9px] font-bold text-[#080812] shadow-[0_0_10px_-2px_rgba(91,255,160,0.7)]">+ <span className="inline-flex min-w-[1.25rem] items-center justify-center rounded-full bg-cyan px-1.5 py-0.5 font-mono text-[9px] font-bold text-[#080812] shadow-[0_0_10px_-2px_rgba(63,224,229,0.7)]">{badge}</span>)}diff --git a/ui/src/context/ApiContext.tsx b/ui/src/context/ApiContext.tsxindex 9821a22d5..aa3980a64 100644--- a/ui/src/context/ApiContext.tsx+++ b/ui/src/context/ApiContext.tsx@@ -113,6 +113,7 @@ export type ApiContextType = {updateVibeAgent: (name: string, payload: VibeAgentUpdatePayload) => Promise<{ ok: boolean; agent: VibeAgentFull }>;setDefaultVibeAgent: (name: string) => Promise<{ ok: boolean; default_agent_name: string; agent: VibeAgentBrief }>;removeVibeAgent: (name: string) => Promise<{ ok: boolean; code?: string; message?: string; references?: Record<string, number>; removed_agent?: string }>;+ importVibeAgents: (payload: { from?: 'claude' | 'codex' | 'opencode'; name?: string; all?: boolean; file?: string; backend?: string }) => Promise<{ ok: boolean; created?: any[]; skipped?: any[]; error?: string; code?: string; message?: string }>;listHarnessTasks: () => Promise<{ tasks: HarnessTask[] }>;setHarnessTaskEnabled: (taskId: string, enabled: boolean) => Promise<{ ok: boolean; task?: HarnessTask }>;deleteHarnessTask: (taskId: string) => Promise<{ ok: boolean; id?: string }>;@@ -1004,6 +1005,7 @@ export const ApiProvider: React.FC<{ children: React.ReactNode }> = ({ children},setDefaultVibeAgent: (name) => postJson('/agents/default', { name }),removeVibeAgent: (name) => deleteJson(`/agents/${encodeURIComponent(name)}`),+ importVibeAgents: (payload) => postJson('/agents/import', payload),listHarnessTasks: () => getJson('/api/harness/tasks'),setHarnessTaskEnabled: (taskId, enabled) =>patchJson(`/api/harness/tasks/${encodeURIComponent(taskId)}`, { enabled }),diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.jsonindex e32016ca7..9f5615494 100644--- a/ui/src/i18n/en.json+++ b/ui/src/i18n/en.json@@ -1214,6 +1214,16 @@"subtitle": "{{count}} agents registered across all backends.","showDisabled": "Show disabled","newAgent": "New agent",+ "import": "Import",+ "importFromClaude": "Import from Claude",+ "importFromCodex": "Import from Codex",+ "importFromOpencode": "Import from OpenCode",+ "importSuccess": "Imported {{created}}, skipped {{skipped}}.",+ "importFailed": "Import failed: {{error}}",+ "searchPlaceholder": "Search agents…",+ "backendFilter": "Backend",+ "backendAll": "All",+ "noSearchMatch": "No matching agents.","noConfig": "No model or system prompt configured","empty": "No agents yet. Create one to start a conversation.","selectPrompt": "Select an agent to view its configuration.",@@ -1320,6 +1330,7 @@"noAgents": "No enabled agents. Create one on the Agents page.","modelPlaceholder": "Model override","changesPersist": "changes apply on the next reply",+ "sessionOverrideHint": "New sessions inherit the project's defaults; changes here apply immediately and only to this session.","notFound": "Session not found.","missingSessionId": "Missing session id in the URL.","transcriptEmpty": "Type a message below to start the conversation",diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.jsonindex 20ca71821..7cf56428d 100644--- a/ui/src/i18n/zh.json+++ b/ui/src/i18n/zh.json@@ -1214,9 +1214,18 @@"subtitle": "已登记 {{count}} 个 Agent。","showDisabled": "显示已禁用","newAgent": "新建 Agent",+ "import": "导入",+ "importFromClaude": "从 Claude 导入",+ "importFromCodex": "从 Codex 导入",+ "importFromOpencode": "从 OpenCode 导入",+ "importSuccess": "已导入 {{created}} 个,跳过 {{skipped}} 个。",+ "importFailed": "导入失败:{{error}}",+ "searchPlaceholder": "搜索 Agent…",+ "backendFilter": "Backend",+ "backendAll": "全部","noConfig": "未配置模型或系统提示词","empty": "还没有 Agent。先创建一个,再开始对话。",- "selectPrompt": "选择左侧 Agent 查看详情。",+ "noSearchMatch": "没有匹配的 Agent。","makeDefault": "设为默认","deleteConfirm": "确认删除 Agent \"{{name}}\"?此操作不可撤销。","deleteInUse": "Agent \"{{name}}\" 正被一个或多个频道使用,无法删除。",@@ -1320,6 +1329,7 @@"noAgents": "暂无已启用的 Agent。请先在 Agents 页创建。","modelPlaceholder": "模型覆盖","changesPersist": "下次回复时生效",+ "sessionOverrideHint": "新建会话直接进入,所有选项继承项目默认;在这里改即时生效,只覆盖本会话","notFound": "未找到该会话。","missingSessionId": "URL 缺少 session id。","transcriptEmpty": "在下方输入消息开始对话",