Skip to content

armgit / avibe

Public Imported from GitHub
0

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.

feat(ui): a quieter Tools page: aligned one-line prices, switches at row end, notes in hints (#3081)

Call White66c65c7f270c
diff --git a/ui/src/components/settings/models/ModelHubInfoHint.tsx b/ui/src/components/settings/models/ModelHubInfoHint.tsx
index 183021f21..72efb82e1 100644
--- a/ui/src/components/settings/models/ModelHubInfoHint.tsx
+++ b/ui/src/components/settings/models/ModelHubInfoHint.tsx
@@ -11,14 +11,16 @@ export const ModelHubInfoHint: React.FC<{
align?: 'start' | 'center' | 'end';
}> = ({ label, content, className, align = 'start' }) => {
const [open, setOpen] = React.useState(false);
+ // A mouse over the trigger has already opened the hint; its click must not toggle it shut again.
+ const hovering = React.useRef(false);
return (
- <Popover open={open} onOpenChange={setOpen}>
+ <Popover open={open} onOpenChange={(next) => setOpen(next || hovering.current)}>
<PopoverTrigger asChild>
<button
type="button"
aria-label={label}
- onPointerEnter={(event) => { if (event.pointerType === 'mouse') setOpen(true); }}
- onPointerLeave={(event) => { if (event.pointerType === 'mouse') setOpen(false); }}
+ onPointerEnter={(event) => { if (event.pointerType === 'mouse') { hovering.current = true; setOpen(true); } }}
+ onPointerLeave={(event) => { if (event.pointerType === 'mouse') { hovering.current = false; setOpen(false); } }}
className={cn('inline-flex size-4 shrink-0 items-center justify-center rounded-full text-muted outline-none transition hover:text-foreground focus-visible:text-foreground', className)}
>
<Info className="size-3.5" />
diff --git a/ui/src/components/settings/models/OrderStepper.tsx b/ui/src/components/settings/models/OrderStepper.tsx
new file mode 100644
index 000000000..a45b72aba
--- /dev/null
+++ b/ui/src/components/settings/models/OrderStepper.tsx
@@ -0,0 +1,36 @@
+import * as React from 'react';
+import { useTranslation } from 'react-i18next';
+import { ChevronDown, ChevronUp } from 'lucide-react';
+
+/** The up and down arrows beside an order position: one stacked control, quiet until hovered. */
+export const OrderStepper: React.FC<{
+ label: string;
+ canUp: boolean;
+ canDown: boolean;
+ pending: boolean;
+ onMove: (direction: -1 | 1) => void;
+ buttonRef?: (direction: -1 | 1, node: HTMLButtonElement | null) => void;
+}> = ({ label, canUp, canDown, pending, onMove, buttonRef }) => {
+ const { t } = useTranslation();
+ return (
+ <span className="model-hub-order-stepper">
+ {([-1, 1] as const).map((direction) => (
+ <button
+ key={direction}
+ ref={buttonRef ? (node) => buttonRef(direction, node) : undefined}
+ type="button"
+ data-direction={direction}
+ className="model-hub-order-step"
+ aria-label={t(direction === -1 ? 'settings.models.tools.order.moveUp' : 'settings.models.tools.order.moveDown', { source: label }) as string}
+ // While a write is out the arrows stay focusable and do nothing:
+ // the next move must be built on the order that write answers.
+ aria-disabled={pending || undefined}
+ disabled={direction === -1 ? !canUp : !canDown}
+ onClick={() => onMove(direction)}
+ >
+ {direction === -1 ? <ChevronUp aria-hidden /> : <ChevronDown aria-hidden />}
+ </button>
+ ))}
+ </span>
+ );
+};
diff --git a/ui/src/components/settings/models/SearchServiceParts.tsx b/ui/src/components/settings/models/SearchServiceParts.tsx
index e966acfa4..cfa1f83f3 100644
--- a/ui/src/components/settings/models/SearchServiceParts.tsx
+++ b/ui/src/components/settings/models/SearchServiceParts.tsx
@@ -15,6 +15,25 @@ import { usageHasNoPrice, type ServiceMonth } from './usageProjection';
import { VendorGlyph } from './vendorGlyph';
import type { HostedExecutorCandidate, HostedSearchServiceVendor, HostedServiceListPrice, HostedToolPut, HostedWebSearchToolStatus, Source } from './types';
+/**
+ * An order row's price: one line in the row's aligned price column. What it is (list price and its date, what is
+ * billed besides) is its tooltip; a list price opens the vendor's pricing page.
+ */
+export const OrderPrice: React.FC<{ text: string; title?: string; href?: string; muted?: boolean }> = ({ text, title, href, muted = false }) => {
+ const className = cn('model-hub-order-price', muted && 'is-muted');
+ return href
+ ? <a href={href} target="_blank" rel="noopener noreferrer" title={title} className={className}>{text}</a>
+ : <span title={title} className={className}>{text}</span>;
+};
+
+/** A search service's price in an order row: free for a built-in service, else its list price per thousand searches. */
+export const SearchServiceOrderPrice: React.FC<{ price: HostedServiceListPrice }> = ({ price }) => {
+ const { t } = useTranslation();
+ return price.usd_per_1k === 0
+ ? <OrderPrice text={t('settings.models.searchServices.free')} title={t('settings.models.searchServices.noKey')} />
+ : <OrderPrice text={t('settings.models.searchServices.price', { usd: formatSmallUsd(price.usd_per_1k) })} title={t('settings.models.searchServices.priceDate', { date: price.as_of })} href={price.url} />;
+};
+
export const SearchVendorGlyph: React.FC<{ vendor: string }> = ({ vendor }) => (
<span className="model-hub-accent-tile--cyan model-hub-accent-ink--cyan flex size-8 shrink-0 items-center justify-center rounded-lg">
<VendorGlyph vendor={vendor} />
@@ -38,7 +57,9 @@ export const SearchCandidateStatus: React.FC<{
candidate: HostedExecutorCandidate;
tool: HostedWebSearchToolStatus;
source?: Source;
-}> = ({ candidate, tool, source }) => {
+ /** In an order row, whose price already says a built-in service is free: only a state worth noticing shows. */
+ inRow?: boolean;
+}> = ({ candidate, tool, source, inRow = false }) => {
const { t, i18n } = useTranslation();
const state = candidate.kind === 'service' ? candidate.state : source?.state;
const success = tool.status.verified.find((row) => row.source_id === candidate.source_id && row.model_id === candidate.model_id);
@@ -50,9 +71,10 @@ export const SearchCandidateStatus: React.FC<{
if (!candidateEnabled(candidate)) {
text = t('settings.models.searchServices.unused');
tone = 'model-hub-accent-pill--neutral';
- } else if (keyless) {
+ } else if (keyless && (until || !inRow)) {
// The built-in service has no credential health or key repair. Only its
- // service cooldown and per-row switch can override the free status.
+ // service cooldown and per-row switch can override the free status; a row,
+ // whose price says free, shows its latest success instead.
text = until ? t('settings.models.searchServices.keylessCooldown') : t('settings.models.searchServices.keylessReady');
if (until) tone = 'model-hub-status-gold';
} else if (state && (state.status === 'needs_action' || state.status === 'error' || state.status === 'cooldown')) {
diff --git a/ui/src/components/settings/models/SearchServices.test.tsx b/ui/src/components/settings/models/SearchServices.test.tsx
index 9442a8496..b9644e114 100644
--- a/ui/src/components/settings/models/SearchServices.test.tsx
+++ b/ui/src/components/settings/models/SearchServices.test.tsx
@@ -16,6 +16,7 @@ import { createSourceCollectionReadAuthority } from './collectionReadAuthority';
import { ApiCallError, modelsApi } from './modelsApi';
import type { SourceMutationSettlement, TrackSourceMutation } from './mutationSettlement';
import { readyRegion } from './regionRead';
+import { formatSmallUsd } from './format';
import { keylessExaSource } from './searchServices';
import { ACTIVE_SEARCH, KEYLESS_ACTIVE_SEARCH, SEARCH_SOURCES } from './searchServices.fixtures';
import { SourceDetailPanel } from './SourceDetailPanel';
@@ -134,11 +135,14 @@ describe('search service activation and mixed order', () => {
const locale = i18n.cloneInstance({ lng });
render(wrap(<ToolsTab read={readyRegion({ tools: [KEYLESS_ACTIVE_SEARCH] })} sources={SEARCH_SOURCES} pending={new Set()} onSave={vi.fn()} onClear={vi.fn()} onRetry={vi.fn()} />, lng));
expect(screen.getByText(locale.t('settings.models.searchServices.vendorName.exa-mcp'))).toBeTruthy();
- expect(screen.getByText(locale.t('settings.models.searchServices.keylessReady'))).toBeTruthy();
expect(screen.getByText(locale.t('settings.models.searchServices.keylessResults', { count: 5 }))).toBeTruthy();
- expect(screen.getByText(locale.t('settings.models.searchServices.free'))).toBeTruthy();
const keylessRow = document.querySelector('[data-executor="src_exakeyless"]') as HTMLElement;
- expect(within(keylessRow).getByText(locale.t('settings.models.searchServices.use'))).toBeTruthy();
+ // The price says free; that it needs no key is its tooltip, not a second pill.
+ expect(within(keylessRow).getByText(locale.t('settings.models.searchServices.free')).getAttribute('title')).toBe(locale.t('settings.models.searchServices.noKey'));
+ expect(within(keylessRow).queryByText(locale.t('settings.models.searchServices.keylessReady'))).toBeNull();
+ // The switch is labelled for assistive tech, with no visible caption beside it.
+ expect(within(keylessRow).getByRole('switch', { name: locale.t('settings.models.searchServices.use') })).toBeTruthy();
+ expect(within(keylessRow).queryByText(locale.t('settings.models.searchServices.use'))).toBeNull();
expect(keylessRow.textContent).not.toMatch(/使用供应商|Uses .* key|invalid key|Replace key|密钥无效/i);
cleanup();
const { onViewOrder } = addDialog(KEYLESS_ACTIVE_SEARCH, lng);
@@ -154,12 +158,14 @@ describe('search service activation and mixed order', () => {
render(wrap(<ToolsTab read={readyRegion({ tools: [KEYLESS_ACTIVE_SEARCH] })} sources={SEARCH_SOURCES} pending={new Set()} onSave={vi.fn()} onClear={vi.fn()} onRetry={vi.fn()} />, lng));
const keylessRow = document.querySelector('[data-executor="src_exakeyless"]') as HTMLElement;
const keylessPrice = KEYLESS_ACTIVE_SEARCH.executor_candidates.find((row) => row.source_id === 'src_exakeyless')!.price!;
- expect(within(keylessRow).getByText(locale.t('settings.models.searchServices.builtInPrice') as string)).toBeTruthy();
- expect(keylessRow.textContent).not.toContain(listPrice(keylessPrice.as_of));
- // A paid service keeps its dated list-price link.
+ const free = within(keylessRow).getByText(locale.t('settings.models.searchServices.free') as string);
+ expect(free.getAttribute('title')).not.toContain(listPrice(keylessPrice.as_of));
+ expect(within(keylessRow).queryByRole('link')).toBeNull();
+ // A paid service's price links its vendor's dated list price.
const paid = KEYLESS_ACTIVE_SEARCH.executor_candidates.find((row) => row.kind === 'service' && (row.price?.usd_per_1k ?? 0) > 0)!;
const paidRow = document.querySelector(`[data-executor="${paid.source_id}"]`) as HTMLElement;
- expect(within(paidRow).getByRole('link', { name: listPrice(paid.price!.as_of) })).toBeTruthy();
+ const link = within(paidRow).getByRole('link', { name: locale.t('settings.models.searchServices.price', { usd: formatSmallUsd(paid.price!.usd_per_1k) }) as string });
+ expect(link.getAttribute('title')).toBe(listPrice(paid.price!.as_of));
cleanup();
addDialog(KEYLESS_ACTIVE_SEARCH, lng);
const builtInCard = screen.getByRole('region', { name: locale.t('settings.models.searchServices.vendorName.exa-mcp') as string });
@@ -268,11 +274,13 @@ describe('search service activation and mixed order', () => {
await waitFor(() => expect(document.activeElement).toBe(screen.getByRole('button', { name: 'Move Exa up' })));
});
- it.each([true, false])('explains the native preference %s and compares live catalog prices with no service added', (prefer_native) => {
+ it.each([true, false])('explains the native preference %s, and leaves the automatic order to the heading\'s hint', async (prefer_native) => {
tab({ ...newVendors(), prefer_native });
expect(screen.getByText(prefer_native ? /When Claude, GPT or Grok/ : /Every model uses the search order below/)).toBeTruthy();
- expect(screen.getByText(/List prices: DeepSeek \$0.75.*Tavily \$8.*Exa \$7/)).toBeTruthy();
expect(screen.queryByText(/full page|page content|\$1/)).toBeNull();
+ expect(screen.queryByText(/Automatic:/)).toBeNull();
+ await userEvent.click(screen.getByRole('button', { name: 'About the search order' }));
+ expect(screen.getByText(/Automatic:/)).toBeTruthy();
});
it('adds the shared dialog entry to Sources only on the active read, and renders search Sources without model claims', async () => {
diff --git a/ui/src/components/settings/models/ToolsTab.test.tsx b/ui/src/components/settings/models/ToolsTab.test.tsx
index 06ad6c719..a28e0512b 100644
--- a/ui/src/components/settings/models/ToolsTab.test.tsx
+++ b/ui/src/components/settings/models/ToolsTab.test.tsx
@@ -455,11 +455,25 @@ describe('ToolsTab executor order', () => {
await user.click(within(card('网页搜索')).getByRole('button', { name: /^高级/ }));
const [grok, relay, subscription] = within(card('网页搜索')).getAllByRole('listitem');
- expect(grok.textContent).toContain('$0.005 / 次API 标价 · 另加 $0.005 / 条帖子');
+ // Every row's price is one line in the same unit, per thousand; what else it means is its tooltip.
+ const price = within(grok).getByRole('link', { name: '$5.00 / 千次' });
+ expect(price.getAttribute('title')).toBe(`API 标价 · ${PRICED.as_of} · 另计 grok-fast 的 token,另加 $0.005 / 条帖子`);
+ expect(price.getAttribute('href')).toBe(PRICED.url);
expect(relay.textContent).toContain('暂无标价');
expect(relay.textContent).not.toContain('$0');
// A subscription is never billed per call, whatever list price its vendor has.
- expect(subscription.textContent).toContain('订阅内含不另计费');
+ expect(within(subscription).getByText('订阅内含').getAttribute('title')).toBe('不另计费');
+ });
+
+ it('prices an executor per the unit its list price bills, so X search reads per post', async () => {
+ const user = userEvent.setup();
+ // The overlay's xAI X search price: $5 per thousand posts, plus $10 per thousand profiles.
+ const perPost = { ...PRICED, unit: 'post' as const, extra: [{ unit: 'profile' as const, usd_per_1k: 10 }] };
+ renderTab({ tools: [search('x_search', { executor_candidates: [candidate(GROK.id, 'grok-fast', { price: perPost })] })] }, { lng: 'zh' });
+
+ await user.click(within(card('X 搜索')).getByRole('button', { name: /^高级/ }));
+ const price = within(card('X 搜索')).getByRole('link', { name: '$5.00 / 千条帖子' });
+ expect(price.getAttribute('title')).toContain('另加 $0.01 / 个账号');
});
});
diff --git a/ui/src/components/settings/models/ToolsTab.tsx b/ui/src/components/settings/models/ToolsTab.tsx
index fc2b6af2a..bddb43165 100644
--- a/ui/src/components/settings/models/ToolsTab.tsx
+++ b/ui/src/components/settings/models/ToolsTab.tsx
@@ -7,7 +7,7 @@
// request. Nothing here checks a Source or decides a route.
import * as React from 'react';
import { useTranslation } from 'react-i18next';
-import { AlertCircle, ArrowDown, ArrowUp, AtSign, CheckCircle2, ChevronRight, Eraser, FileText, Globe, Image as ImageIcon, Info, LockKeyhole, Plus, RotateCcw } from 'lucide-react';
+import { AlertCircle, AtSign, CheckCircle2, ChevronRight, Eraser, FileText, Globe, Image as ImageIcon, Info, LockKeyhole, Plus, RotateCcw } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Select } from '@/components/ui/select';
@@ -17,7 +17,9 @@ import { cooldownTime, formatMonthDay, formatNameList, formatSmallUsd } from './
import { executorOrderAfterMove, imageModelCopyKey, pairEvidence, refusalSummary, type PairEvidence, type RefusalSummary } from './hostedTools';
import { foldRegionRead, regionFailed, type RegionRead } from './regionRead';
import { KEYLESS_EXA_SOURCE_ID, candidateEnabled, searchServicesActive, serviceVendorForSource, webSearchTool } from './searchServices';
-import { SearchCandidateStatus, SearchServicePrice, SearchVendorGlyph } from './SearchServiceParts';
+import { ModelHubInfoHint } from './ModelHubInfoHint';
+import { OrderStepper } from './OrderStepper';
+import { OrderPrice, SearchCandidateStatus, SearchServiceOrderPrice, SearchVendorGlyph } from './SearchServiceParts';
import { WebFetchOrder } from './WebFetchOrder';
import { fetchVendorForSource, webFetchTool } from './webFetch';
import { ACCENT_ICON, ACCENT_PILL, ACCENT_TILE, sourceVisual } from './vendorMeta';
@@ -31,7 +33,6 @@ import type {
HostedWebSearchToolStatus,
HostedToolClear,
HostedToolName,
- HostedToolPriceUnit,
HostedToolPut,
HostedToolsStatus,
HostedToolStatus,
@@ -135,31 +136,37 @@ const StatusLines: React.FC<{ tool: HostedToolStatus; summary: RefusalSummary; l
);
};
-/** What one executor call costs: included on a subscription, else the overlay's list price; unknown is never zero. */
+/**
+ * What one executor call costs, as one line in the row's price column: included on a subscription, else the
+ * overlay's list price per thousand calls; unknown is never zero. The list price's date, the executor model's tokens
+ * billed besides it, and any extra units are its tooltip.
+ */
const ExecutorPrice: React.FC<{ candidate: HostedExecutorCandidate }> = ({ candidate }) => {
const { t } = useTranslation();
- if (candidate.kind === 'service') return <SearchServicePrice price={candidate.price} />;
+ if (candidate.kind === 'service') return <SearchServiceOrderPrice price={candidate.price} />;
if (candidate.billing === 'monthly') {
- return <span className="flex flex-col"><span className="font-semibold text-foreground">{t('settings.models.tools.cost.included')}</span><span className="model-hub-tool-cost-note">{t('settings.models.tools.cost.includedNote')}</span></span>;
+ return <OrderPrice text={t('settings.models.tools.cost.includedShort')} title={t('settings.models.tools.cost.includedNote')} />;
}
const price = candidate.price;
- if (!price) return <span className="model-hub-tool-cost-note">{t('settings.models.tools.cost.unknown')}</span>;
- const perUnit = (usdPer1k: number, unit: HostedToolPriceUnit) => t('settings.models.tools.cost.perUnit', {
- usd: formatSmallUsd(usdPer1k / 1000),
- unit: t(`settings.models.tools.cost.unit.${unit}`),
- }) as string;
+ if (!price) return <OrderPrice text={t('settings.models.tools.cost.unknown')} muted />;
+ const extras = price.extra.map((extra) => t('settings.models.tools.cost.extra', {
+ price: t('settings.models.tools.cost.perUnit', { usd: formatSmallUsd(extra.usd_per_1k / 1000), unit: t(`settings.models.tools.cost.unit.${extra.unit}`) }),
+ }));
+ const title = [t('settings.models.tools.cost.executorTitle', { date: price.as_of, model: candidate.model_id }), ...extras]
+ .join(t('settings.models.tools.cost.extraSeparator'));
+ // Per thousand of the unit billed: a search or call reads as a search, an X search post as a post.
+ return <OrderPrice text={t(`settings.models.tools.cost.per1k.${price.unit}`, { usd: formatSmallUsd(price.usd_per_1k) })} title={title} href={price.url} />;
+};
+
+/** What the search order's ⓘ explains: how the automatic order is built, and where the built-in service sends a query. */
+const SearchOrderHint: React.FC<{ tool: HostedWebSearchToolStatus; custom: boolean }> = ({ tool, custom }) => {
+ const { t } = useTranslation();
+ const keyless = tool.service_vendors?.some((vendor) => vendor.id === 'exa-mcp') === true;
return (
- <span className="flex flex-col">
- <span className="font-semibold text-foreground">{perUnit(price.usd_per_1k, price.unit)}</span>
- <span className="model-hub-tool-cost-note">
- {price.extra.length === 0
- ? t('settings.models.tools.cost.listNote')
- : t('settings.models.tools.cost.listNoteExtras', {
- extras: price.extra
- .map((extra) => t('settings.models.tools.cost.extra', { price: perUnit(extra.usd_per_1k, extra.unit) }))
- .join(t('settings.models.tools.cost.extraSeparator')),
- })}
- </span>
+ <span className="flex flex-col gap-2">
+ <span>{t(keyless ? 'settings.models.searchServices.orderAutoKeyless' : 'settings.models.searchServices.orderAuto')}</span>
+ {custom && <span>{t('settings.models.searchServices.orderCustom')}</span>}
+ {keyless && <span>{t('settings.models.searchServices.keylessQueryDestination')}</span>}
</span>
);
};
@@ -226,9 +233,12 @@ const ExecutorOrder: React.FC<{ tool: HostedSearchToolStatus; lookup: SourceLook
<div className="flex flex-col gap-2">
<div className="flex items-start justify-between gap-3">
<div className="flex min-w-0 flex-col gap-0.5">
- <h4 className="font-semibold text-foreground">{t(activeWeb ? 'settings.models.searchServices.order' : 'settings.models.tools.order.title')}</h4>
+ <span className="flex items-center gap-1.5">
+ <h4 className="font-semibold text-foreground">{t(activeWeb ? 'settings.models.searchServices.order' : 'settings.models.tools.order.title')}</h4>
+ {activeWeb && <ModelHubInfoHint label={t('settings.models.searchServices.orderAbout') as string} content={<SearchOrderHint tool={activeWeb} custom={custom} />} />}
+ </span>
<p className="model-hub-tool-note">{activeWeb
- ? <>{t(activeWeb.prefer_native ? 'settings.models.searchServices.orderNative' : 'settings.models.searchServices.orderAll')} {t(custom ? 'settings.models.searchServices.orderCustom' : activeWeb.service_vendors?.some((vendor) => vendor.id === 'exa-mcp') ? 'settings.models.searchServices.orderAutoKeyless' : 'settings.models.searchServices.orderAuto')}</>
+ ? t(activeWeb.prefer_native ? 'settings.models.searchServices.orderNative' : 'settings.models.searchServices.orderAll')
: t(custom ? 'settings.models.tools.order.captionCustom' : 'settings.models.tools.order.caption')}</p>
</div>
{custom && (
@@ -255,53 +265,32 @@ const ExecutorOrder: React.FC<{ tool: HostedSearchToolStatus; lookup: SourceLook
const switchedOff = !candidateEnabled(candidate);
// A web-search model executor carries its switch on a server that has one (contract v23).
const modelSwitch = candidate.kind === 'model' ? candidate.settings : undefined;
- const arrow = (direction: -1 | 1) => {
- const blocked = switchedOff || (direction === -1 ? index === 0 : index === movable.length - 1);
- return (
- <Button
- ref={(node) => {
- const key = `${candidate.source_id}:${direction}`;
- if (node) buttons.current.set(key, node);
- else buttons.current.delete(key);
- }}
- type="button"
- variant="ghost"
- size="icon"
- className="model-hub-route-action model-hub-order-row-action"
- aria-label={t(direction === -1 ? 'settings.models.tools.order.moveUp' : 'settings.models.tools.order.moveDown', { source: name }) as string}
- // While a write is out the arrows stay focusable and do nothing:
- // the next move must be built on the order that write answers.
- aria-disabled={pending || undefined}
- disabled={blocked}
- onClick={() => move(index, direction)}
- >
- {direction === -1 ? <ArrowUp aria-hidden /> : <ArrowDown aria-hidden />}
- </Button>
- );
- };
+ const stepper = (
+ <OrderStepper
+ label={name}
+ canUp={!switchedOff && index > 0}
+ canDown={!switchedOff && index < movable.length - 1}
+ pending={pending}
+ onMove={(direction) => move(index, direction)}
+ buttonRef={(direction, node) => {
+ const key = `${candidate.source_id}:${direction}`;
+ if (node) buttons.current.set(key, node);
+ else buttons.current.delete(key);
+ }}
+ />
+ );
return (
- <li key={candidate.source_id} className="model-hub-tool-executor-row grid items-center rounded-lg border border-border bg-background" data-executor={candidate.source_id}>
- <span className={cn('model-hub-order-ordinal', index === 0 && 'is-first')}>{switchedOff ? '—' : index + 1}</span>
+ <li key={candidate.source_id} className={cn('model-hub-tool-executor-row grid items-center rounded-lg border border-border bg-background', switchedOff && 'is-off')} data-executor={candidate.source_id}>
+ <span className="flex items-center gap-1.5">{stepper}<span className={cn('model-hub-order-ordinal', index === 0 && !switchedOff && 'is-first')}>{switchedOff ? '—' : index + 1}</span></span>
{activeWeb ? <div className="flex min-w-0 items-center gap-3">
{source ? <SearchVendorGlyph vendor={source.vendor} /> : candidate.kind === 'service' ? <SearchVendorGlyph vendor={vendor?.id ?? candidate.model_id} /> : <SourceGlyph source={source} />}
- <div className="flex min-w-0 flex-col gap-1">
- <div className="flex flex-wrap items-center gap-2">
+ <div className="flex min-w-0 flex-col gap-0.5">
+ <div className="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1">
{candidate.kind === 'service' ? <button type="button" data-search-source={candidate.source_id} className="truncate text-left font-semibold text-foreground hover:underline" onClick={(event) => onOpenService?.(candidate.source_id, event.currentTarget)}>{name}</button> : <span className="truncate font-semibold text-foreground">{name}</span>}
- <span className={cn('model-hub-pill border', candidate.kind === 'service' ? ACCENT_PILL.cyan : ACCENT_PILL.muted)}>{t(candidate.kind === 'service' ? 'settings.models.searchServices.kind' : 'settings.models.searchServices.modelKind')}</span>
- <SearchCandidateStatus candidate={candidate} tool={activeWeb} source={source} />
- {(candidate.kind === 'service' || modelSwitch) && <span className="inline-flex items-center gap-2">
- <span className="model-hub-tool-note">{t('settings.models.searchServices.use')}</span>
- <ToggleSwitch
- enabled={!switchedOff}
- disabled={pending}
- label={t('settings.models.searchServices.use') as string}
- onClick={() => onSave('web_search', candidate.kind === 'service'
- ? { services: { [candidate.source_id]: { enabled: switchedOff } } }
- : { executors: { [candidate.source_id]: { enabled: switchedOff } } })}
- />
- </span>}
+ <span className="model-hub-order-kind">{t(candidate.kind === 'service' ? 'settings.models.searchServices.kind' : 'settings.models.searchServices.modelKind')}</span>
+ <SearchCandidateStatus candidate={candidate} tool={activeWeb} source={source} inRow />
</div>
- <span className="model-hub-tool-note">{candidate.kind === 'service'
+ <span className="model-hub-tool-note truncate">{candidate.kind === 'service'
? <>{cooldown && keyless && <>{t('settings.models.searchServices.keylessCooldownUntil', { time: cooldown })} · </>}{t(keyless ? 'settings.models.searchServices.keylessResults' : source?.protocol === 'search' ? 'settings.models.searchServices.resultCount' : 'settings.models.searchServices.sharedKeyResults', { count: candidate.settings.results, source: name })}</>
: <span className="font-mono">{candidate.model_id}</span>}</span>
{candidate.kind === 'service' && candidate.cooldown_until !== null && <Button variant="outline" size="xs" className="self-start" disabled={pending} onClick={() => onRetryService?.(candidate.source_id)}>{t('settings.models.searchServices.retry')}</Button>}
@@ -313,7 +302,16 @@ const ExecutorOrder: React.FC<{ tool: HostedSearchToolStatus; lookup: SourceLook
{source && <span className={cn('model-hub-pill border', ACCENT_PILL[source.kind === 'api_key' ? 'cyan' : sourceVisual(source).accent])}>{t(`settings.models.upstream.kind.${source.kind === 'subscription' ? 'subscription' : 'apiKey'}`)}</span>}
</span>}
<ExecutorPrice candidate={candidate} />
- <span className="flex items-center gap-1">{arrow(-1)}{arrow(1)}</span>
+ <span className="model-hub-order-switch">{(candidate.kind === 'service' || modelSwitch) && activeWeb && (
+ <ToggleSwitch
+ enabled={!switchedOff}
+ disabled={pending}
+ label={t('settings.models.searchServices.use') as string}
+ onClick={() => onSave('web_search', candidate.kind === 'service'
+ ? { services: { [candidate.source_id]: { enabled: switchedOff } } }
+ : { executors: { [candidate.source_id]: { enabled: switchedOff } } })}
+ />
+ )}</span>
</li>
);
})}
@@ -558,7 +556,7 @@ type ServiceActions = {
};
const WebSearchServices: React.FC<{ tool: HostedWebSearchToolStatus; lookup: SourceLookup; pending: boolean; onSave: Save } & ServiceActions> = ({ tool, lookup, pending, onSave, onAddService, onOpenService, onRetryService }) => {
- const { t, i18n } = useTranslation();
+ const { t } = useTranslation();
const noServices = !tool.service_vendors?.some((vendor) => !vendor.facts.built_in && vendor.source_ids.length > 0);
const hasKeyless = tool.service_vendors?.some((vendor) => vendor.id === 'exa-mcp') === true;
return <div className="flex flex-col gap-4 border-t border-border p-4">
@@ -567,11 +565,10 @@ const WebSearchServices: React.FC<{ tool: HostedWebSearchToolStatus; lookup: Sou
<ToggleSwitch enabled={tool.prefer_native} disabled={pending} label={t('settings.models.searchServices.preferNative')} onClick={() => onSave('web_search', { prefer_native: !tool.prefer_native })} />
</div>
<ExecutorOrder tool={tool} lookup={lookup} pending={pending} onSave={onSave} onOpenService={onOpenService} onRetryService={onRetryService} />
- {noServices && <p className="model-hub-tool-note">{t(hasKeyless ? 'settings.models.searchServices.keylessEmpty' : 'settings.models.searchServices.empty', { prices: formatNameList((tool.service_vendors ?? []).filter((vendor) => !vendor.facts.built_in).map((vendor) => t('settings.models.searchServices.vendorPrice', { vendor: vendor.name, usd: formatSmallUsd(vendor.price.usd_per_1k) })), i18n.language) })}</p>}
- {hasKeyless && <p className="model-hub-tool-note">{t('settings.models.searchServices.keylessQueryDestination')}</p>}
+ <p className="model-hub-tool-note">{t('settings.models.searchServices.priceFootnote')}</p>
<div className="flex flex-wrap items-center justify-between gap-3">
<Button variant={noServices ? 'default' : 'outline'} size="sm" disabled={pending} onClick={(event) => onAddService?.(event.currentTarget)}><Plus aria-hidden />{t('settings.models.searchServices.add')}</Button>
- <p className="model-hub-tool-note flex items-start gap-2"><LockKeyhole className="mt-0.5 size-3.5 shrink-0" aria-hidden />{t(hasKeyless ? 'settings.models.searchServices.keylessCustody' : 'settings.models.searchServices.custody')}</p>
+ <p className="model-hub-tool-note flex items-center gap-1.5" title={t(hasKeyless ? 'settings.models.searchServices.keylessCustody' : 'settings.models.searchServices.custody') as string}><LockKeyhole className="size-3.5 shrink-0" aria-hidden />{t('settings.models.searchServices.custodyShort')}</p>
</div>
</div>;
};
diff --git a/ui/src/components/settings/models/WebFetch.test.tsx b/ui/src/components/settings/models/WebFetch.test.tsx
index b8a7bf023..3f354ae23 100644
--- a/ui/src/components/settings/models/WebFetch.test.tsx
+++ b/ui/src/components/settings/models/WebFetch.test.tsx
@@ -31,21 +31,36 @@ it('shows the numbered automatic order after search and saves only the field cha
const rows = within(card).getAllByRole('listitem');
expect(rows.map((row) => row.getAttribute('data-executor'))).toEqual(['src_localfetch', 'src_tavily01', 'src_exakeyless', 'src_jinakeyless']);
expect(card.textContent).toContain('最近一次由 本机');
- expect(card.textContent).toContain('默认最后兜底');
- expect(card.textContent).toContain('出口 IP');
- expect(card.textContent).toContain('密钥由网关保管');
- expect(card.textContent).toContain('$1.6 / 千页');
+ expect(card.textContent).toContain('可渲染 JS');
+ expect(card.textContent).toContain('密钥只保存在网关');
+ // One line per price, in the row's price column; a list price opens the vendor's page.
+ expect(within(rows[1]).getByRole('link', { name: '$1.60 / 千页' })).toBeTruthy();
+ // The default order and where a read goes are the heading's ⓘ, not text under the list.
+ expect(card.textContent).not.toContain('出口 IP');
+ // Hovered and then clicked, the hint stays open.
+ const about = within(card).getByRole('button', { name: '关于读取顺序' });
+ await userEvent.click(about);
+ expect(screen.getByText(/出口 IP/)).toBeTruthy();
+ await userEvent.unhover(about);
expect(within(card).queryByText('优先使用模型自身的搜索')).toBeNull();
+ // The order is automatic, so there is nothing to reset.
+ expect(within(card).queryByRole('button', { name: '恢复自动' })).toBeNull();
await userEvent.click(within(rows[0]).getByRole('switch'));
await userEvent.click(within(rows[3]).getByRole('button', { name: /上移/ }));
- await userEvent.click(within(card).getByRole('button', { name: '恢复自动' }));
expect(save.mock.calls).toEqual([
['web_fetch', { services: { src_localfetch: { enabled: false } } }],
['web_fetch', { executor_order: ['src_localfetch', 'src_tavily01', 'src_jinakeyless', 'src_exakeyless'] }],
- ['web_fetch', { executor_order: null }],
]);
});
+it('offers a reset only once the fetch order is customized', async () => {
+ const save = vi.fn();
+ const custom = { ...fetch, executor_order: ['src_tavily01', 'src_localfetch'] };
+ render(wrap(<ToolsTab read={readyRegion({ tools: [custom] })} sources={SEARCH_SOURCES} pending={new Set()} onSave={save} onClear={vi.fn()} onRetry={vi.fn()} />));
+ await userEvent.click(within(screen.getByRole('region', { name: '网页读取' })).getByRole('button', { name: '恢复自动' }));
+ expect(save).toHaveBeenCalledWith('web_fetch', { executor_order: null });
+});
+
it('keeps disabled rows visible and immovable, with no key/remove or global local retry', async () => {
const tool = structuredClone(fetch);
tool.executor_candidates[3].settings.enabled = false;
diff --git a/ui/src/components/settings/models/WebFetchOrder.tsx b/ui/src/components/settings/models/WebFetchOrder.tsx
index afc814200..2316b20ea 100644
--- a/ui/src/components/settings/models/WebFetchOrder.tsx
+++ b/ui/src/components/settings/models/WebFetchOrder.tsx
@@ -1,12 +1,15 @@
import * as React from 'react';
import { useTranslation } from 'react-i18next';
-import { ArrowDown, ArrowUp, LockKeyhole, Plus, RotateCcw } from 'lucide-react';
+import { LockKeyhole, Plus, RotateCcw } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { ToggleSwitch } from '../SettingsPrimitives';
-import { SearchVendorGlyph } from './SearchServiceParts';
+import { cn } from '@/lib/utils';
+import { ModelHubInfoHint } from './ModelHubInfoHint';
+import { OrderPrice, SearchVendorGlyph } from './SearchServiceParts';
+import { OrderStepper } from './OrderStepper';
import { executorOrderAfterMove } from './hostedTools';
-import { cooldownTime, formatMonthDay } from './format';
+import { cooldownTime, formatMonthDay, formatSmallUsd } from './format';
import { sourceStatePresentation } from './sourceStatePresentation';
import { fetchVendorForSource } from './webFetch';
import type { HostedFetchExecutorCandidate, HostedToolPut, HostedWebFetchToolStatus, Source } from './types';
@@ -19,7 +22,21 @@ const FetchPrice: React.FC<{ candidate: HostedFetchExecutorCandidate }> = ({ can
</span>;
};
-const FetchStatus: React.FC<{ candidate: HostedFetchExecutorCandidate; tool: HostedWebFetchToolStatus }> = ({ candidate, tool }) => {
+/** A fetch row's price, one line in the row's price column; what it is (local, built in, list price) is its tooltip. */
+const FetchOrderPrice: React.FC<{ candidate: HostedFetchExecutorCandidate }> = ({ candidate }) => {
+ const { t } = useTranslation();
+ const { price } = candidate;
+ if (price.usd_per_1k === 0) {
+ return <OrderPrice text={t('settings.models.searchServices.free')} title={t(candidate.kind === 'local' ? 'settings.models.webFetch.localPrice' : 'settings.models.searchServices.noKey')} />;
+ }
+ return <OrderPrice
+ text={t('settings.models.webFetch.price', { usd: formatSmallUsd(price.usd_per_1k) })}
+ title={t(candidate.model_id === 'tavily/extract' ? 'settings.models.webFetch.tavilyPriceTitle' : 'settings.models.searchServices.priceDate', { date: price.as_of })}
+ href={price.url}
+ />;
+};
+
+const FetchStatus: React.FC<{ candidate: HostedFetchExecutorCandidate; tool: HostedWebFetchToolStatus; inRow?: boolean }> = ({ candidate, tool, inRow = false }) => {
const { t, i18n } = useTranslation();
const vendor = fetchVendorForSource(tool, candidate.source_id);
const success = tool.status.verified.find((row) => row.source_id === candidate.source_id && row.model_id === candidate.model_id);
@@ -29,7 +46,7 @@ const FetchStatus: React.FC<{ candidate: HostedFetchExecutorCandidate; tool: Hos
: candidate.cooldown_until ? t('settings.models.searchServices.cooldown', { time: cooldownTime(candidate.cooldown_until, i18n.language) })
: bad && state.key ? t(state.key, state.values)
: success ? t('settings.models.tools.pair.ok', { date: formatMonthDay(success.at) })
- : vendor?.facts.built_in && candidate.kind !== 'local' ? t('settings.models.searchServices.keylessReady') : null;
+ : vendor?.facts.built_in && candidate.kind !== 'local' && !inRow ? t('settings.models.searchServices.keylessReady') : null;
return text ? <span className={`model-hub-pill border ${!candidate.settings.enabled ? 'model-hub-accent-pill--neutral' : candidate.cooldown_until || bad ? 'model-hub-status-gold' : 'model-hub-status-mint'}`}>{text}</span> : null;
};
@@ -89,26 +106,37 @@ export const WebFetchOrder: React.FC<{
onSave({ executor_order: next });
};
return <div className="flex flex-col gap-3 border-t border-border p-4">
- <div className="flex items-center justify-between gap-3"><h4 className="font-semibold">{t('settings.models.webFetch.order')}</h4><Button variant="outline" size="xs" disabled={pending} onClick={() => onSave({ executor_order: null })}><RotateCcw aria-hidden />{t('settings.models.tools.order.reset')}</Button></div>
- <p className="model-hub-tool-note">{t('settings.models.webFetch.caption')}</p>
+ <div className="flex items-start justify-between gap-3">
+ <div className="flex min-w-0 flex-col gap-0.5">
+ <span className="flex items-center gap-1.5">
+ <h4 className="font-semibold">{t('settings.models.webFetch.order')}</h4>
+ <ModelHubInfoHint label={t('settings.models.webFetch.orderAbout') as string} content={<span className="flex flex-col gap-2"><span>{t('settings.models.webFetch.orderDefault')}</span><span>{t('settings.models.webFetch.egress')}</span></span>} />
+ </span>
+ <p className="model-hub-tool-note">{t('settings.models.webFetch.caption')}</p>
+ </div>
+ {tool.executor_order !== null && <Button variant="outline" size="xs" disabled={pending} onClick={() => onSave({ executor_order: null })}><RotateCcw aria-hidden />{t('settings.models.tools.order.reset')}</Button>}
+ </div>
<ol ref={list} className="flex flex-col gap-1.5" aria-label={t('settings.models.webFetch.order')}>
{rows.map((row, index) => {
const vendor = fetchVendorForSource(tool, row.source_id);
const label = name(row.source_id);
- return <li key={row.source_id} data-executor={row.source_id} className="model-hub-tool-executor-row grid items-center rounded-lg border border-border bg-background">
- <span className="model-hub-order-ordinal">{row.settings.enabled ? index + 1 : '—'}</span>
- <div className="flex min-w-0 items-center gap-3"><SearchVendorGlyph vendor={vendor?.id ?? 'local'} /><div className="flex min-w-0 flex-col gap-1">
- <div className="flex flex-wrap items-center gap-2"><button type="button" data-search-source={row.source_id} className="truncate text-left font-semibold hover:underline" onClick={(event) => vendor?.facts.built_in && vendor.id !== 'exa-mcp' ? setDetail(row.source_id) : onOpen?.(row.source_id, event.currentTarget)}>{label}</button><span className="model-hub-pill model-hub-accent-pill--cyan border">{t(row.kind === 'local' ? 'settings.models.webFetch.local' : 'settings.models.webFetch.kind')}</span><FetchStatus candidate={row} tool={tool} /></div>
- <p className="model-hub-tool-note">{t(`settings.models.webFetch.row.${vendor?.id}`, { defaultValue: row.model_id })}</p>
+ const off = !row.settings.enabled;
+ return <li key={row.source_id} data-executor={row.source_id} className={cn('model-hub-tool-executor-row grid items-center rounded-lg border border-border bg-background', off && 'is-off')}>
+ <span className="flex items-center gap-1.5">
+ <OrderStepper label={label} canUp={!off && index > 0} canDown={!off && index < enabled.length - 1} pending={pending} onMove={(direction) => move(index, direction)} />
+ <span className={cn('model-hub-order-ordinal', index === 0 && !off && 'is-first')}>{off ? '—' : index + 1}</span>
+ </span>
+ <div className="flex min-w-0 items-center gap-3"><SearchVendorGlyph vendor={vendor?.id ?? 'local'} /><div className="flex min-w-0 flex-col gap-0.5">
+ <div className="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1"><button type="button" data-search-source={row.source_id} className="truncate text-left font-semibold hover:underline" onClick={(event) => vendor?.facts.built_in && vendor.id !== 'exa-mcp' ? setDetail(row.source_id) : onOpen?.(row.source_id, event.currentTarget)}>{label}</button><FetchStatus candidate={row} tool={tool} inRow /></div>
+ <p className="model-hub-tool-note truncate">{t(`settings.models.webFetch.row.${vendor?.id}`, { defaultValue: row.model_id })}</p>
{row.kind !== 'local' && row.cooldown_until && <Button variant="outline" size="xs" className="self-start" disabled={pending} onClick={() => onRetry?.(row.source_id)}>{t('settings.models.searchServices.retry')}</Button>}
</div></div>
- <FetchPrice candidate={row} />
- <span className="flex items-center gap-1"><span className="model-hub-tool-note mr-2 hidden xl:inline">{t('settings.models.webFetch.use')}</span><ToggleSwitch enabled={row.settings.enabled} disabled={pending} label={t('settings.models.webFetch.use')} onClick={() => onSave({ services: { [row.source_id]: { enabled: !row.settings.enabled } } })} />{([-1, 1] as const).map((direction) => <Button key={direction} type="button" variant="ghost" size="icon" data-direction={direction} className="model-hub-route-action model-hub-order-row-action" aria-label={t(direction < 0 ? 'settings.models.tools.order.moveUp' : 'settings.models.tools.order.moveDown', { source: label })} disabled={!row.settings.enabled || (direction < 0 ? index === 0 : index === enabled.length - 1)} aria-disabled={pending || undefined} onClick={() => move(index, direction)}>{direction < 0 ? <ArrowUp aria-hidden /> : <ArrowDown aria-hidden />}</Button>)}</span>
+ <FetchOrderPrice candidate={row} />
+ <span className="model-hub-order-switch"><ToggleSwitch enabled={!off} disabled={pending} label={t('settings.models.webFetch.use')} onClick={() => onSave({ services: { [row.source_id]: { enabled: off } } })} /></span>
</li>;
})}
</ol>
- <p className="model-hub-tool-note">{t('settings.models.webFetch.egress')}</p>
- <div className="flex flex-wrap items-center justify-between gap-3"><Button variant="outline" size="sm" disabled={pending} onClick={(event) => onAdd?.(event.currentTarget)}><Plus aria-hidden />{t('settings.models.webFetch.add')}</Button><p className="model-hub-tool-note flex items-start gap-2"><LockKeyhole className="mt-0.5 size-3.5 shrink-0" aria-hidden />{t('settings.models.webFetch.custody')}</p></div>
+ <div className="flex flex-wrap items-center justify-between gap-3"><Button variant="outline" size="sm" disabled={pending} onClick={(event) => onAdd?.(event.currentTarget)}><Plus aria-hidden />{t('settings.models.webFetch.add')}</Button><p className="model-hub-tool-note flex items-center gap-1.5" title={t('settings.models.webFetch.custody') as string}><LockKeyhole className="size-3.5 shrink-0" aria-hidden />{t('settings.models.searchServices.custodyShort')}</p></div>
{detail && <Dialog open onOpenChange={(open) => { if (!open) setDetail(null); }}><DialogContent className="max-w-xl border-border-strong bg-surface" closeLabel={t('common.close')}><DialogHeader><DialogTitle>{name(detail)}</DialogTitle><DialogDescription>{t('settings.models.webFetch.custody')}</DialogDescription></DialogHeader><FetchServiceSettings sourceId={detail} tool={tool} pending={pending} onSave={onSave} onRetry={(id) => onRetry?.(id)} /></DialogContent></Dialog>}
</div>;
};
diff --git a/ui/src/components/settings/models/modelHubSurface.css b/ui/src/components/settings/models/modelHubSurface.css
index eae10882f..584b8a91b 100644
--- a/ui/src/components/settings/models/modelHubSurface.css
+++ b/ui/src/components/settings/models/modelHubSurface.css
@@ -2242,12 +2242,60 @@
row-gap: 6px;
padding: var(--model-hub-tool-row-pad-y) var(--model-hub-tool-row-pad-x);
}
-.model-hub-tool-executor-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, auto) auto; }
+/* An order row: position (arrows, ordinal), identity, price, switch. The price and switch columns have one width in
+ every row, so prices line up down the list whatever their text, and each switch sits at the row's end. */
+.model-hub-tool-executor-row {
+ --model-hub-order-price-width: 8.5rem;
+ --model-hub-order-switch-width: 36px;
+ grid-template-columns: auto minmax(0, 1fr) var(--model-hub-order-price-width) var(--model-hub-order-switch-width);
+}
+.model-hub-tool-executor-row.is-off > :nth-child(2),
+.model-hub-tool-executor-row.is-off > :nth-child(3) { opacity: 0.55; }
+.model-hub-order-price {
+ justify-self: end;
+ max-width: 100%;
+ overflow: hidden;
+ color: var(--foreground);
+ font-size: var(--model-hub-usage-cell-size);
+ font-weight: 500;
+ font-variant-numeric: tabular-nums;
+ line-height: 18px;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+a.model-hub-order-price { text-underline-offset: 2px; }
+a.model-hub-order-price:hover { text-decoration: underline; }
+.model-hub-order-price.is-muted { color: var(--model-hub-usage-note-ink); font-weight: 400; }
+.model-hub-order-switch { display: flex; justify-content: flex-end; }
+.model-hub-order-stepper { display: flex; flex-direction: column; }
+.model-hub-order-step {
+ display: inline-flex;
+ width: 18px;
+ height: 14px;
+ align-items: center;
+ justify-content: center;
+ border-radius: 4px;
+ color: var(--model-hub-usage-note-ink);
+}
+.model-hub-order-step svg { width: 12px; height: 12px; }
+.model-hub-order-step:hover:not(:disabled) { background: var(--model-hub-wash-14); color: var(--foreground); }
+.model-hub-order-step:focus-visible { outline: 2px solid var(--mint); outline-offset: 0; }
+.model-hub-order-step:disabled { opacity: 0.3; }
+.model-hub-order-kind {
+ padding: 0 5px;
+ border: 1px solid var(--border);
+ border-radius: 4px;
+ color: var(--model-hub-usage-note-ink);
+ font-size: var(--model-hub-usage-note-size);
+ line-height: 16px;
+}
.model-hub-tool-pair-row { grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto; }
/* Below md a row stacks: identity, then its state or price, then its actions. */
@media (max-width: 767px) {
.model-hub-tool-executor-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.model-hub-tool-executor-row > :nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
+ .model-hub-tool-executor-row > .model-hub-order-price { justify-self: start; }
.model-hub-tool-pair-row { grid-template-columns: minmax(0, 1fr) auto; }
.model-hub-tool-pair-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
}
diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json
index ada23937c..51e0485f4 100644
--- a/ui/src/i18n/en.json
+++ b/ui/src/i18n/en.json
@@ -2561,7 +2561,16 @@
"listNoteExtras": "At API price · {{extras}}",
"extra": "+ {{price}}",
"extraSeparator": " · ",
- "unknown": "No list price"
+ "unknown": "No list price",
+ "executorTitle": "API list price · {{date}} · plus {{model}} tokens",
+ "includedShort": "Included",
+ "per1k": {
+ "call": "${{usd}} / 1k searches",
+ "search": "${{usd}} / 1k searches",
+ "post": "${{usd}} / 1k posts",
+ "profile": "${{usd}} / 1k profiles",
+ "fetch": "${{usd}} / 1k fetches"
+ }
},
"footnote": "Costs are estimated at the vendor's API price, and a relay may bill differently. Subscriptions add no charge. A Claude subscription can't run these tools.",
"saveFailed": "Couldn't save the {{toolInline}} setting. Please retry.",
@@ -2581,7 +2590,7 @@
"jina-reader": "https://r.jina.ai/"
},
"order": "Fetch order",
- "caption": "When the model calls web_fetch, try in this order; move on after failure. Default: local → configured services → Exa (free) → Jina Reader (free); reorder as needed.",
+ "caption": "Pages are read in this order; a failure tries the next.",
"use": "Use for web fetch",
"unused": "Not used for web fetch",
"kind": "Fetch service",
@@ -2599,12 +2608,12 @@
"jina-reader": "Jina Reader (free)"
},
"row": {
- "local": "Chrome 150 fingerprint · HTML / PDF / text · no JS",
+ "local": "HTML / PDF / text · no JS",
"tavily": "Uses the Tavily key · basic Extract",
"exa": "Uses the Exa key · Contents",
"deepseek": "Uses the official DeepSeek key · Fetch",
- "exa-mcp": "Shares IP limits with web search",
- "jina-reader": "20 per minute · Jina renders JS · default last fallback"
+ "exa-mcp": "Shares limits with web search",
+ "jina-reader": "Renders JS · 20 per minute"
},
"localDetail": "Defaults to the Chrome 150 browser profile and HTTP/2. If native transport cannot load, plain HTTP/2 is used and the call records the reason. No JavaScript execution, user cookies or login credentials. Supports HTML, PDF, plain text, Markdown and JSON.",
"limits": "180 seconds per chain, 30 seconds per attempt; local text up to 16 MiB, PDF 32 MiB. The complete model-facing result is capped at 12,000 estimated tokens (48,000 UTF-8 bytes); any cut is explicit.",
@@ -2614,7 +2623,10 @@
"endpoint": "Endpoint",
"tavilyPrice": "1 credit per 5 URLs (amortized)",
"localPrice": "Read directly from your machine",
- "builtInPrice": "Built in · no key or setup"
+ "builtInPrice": "Built in · no key or setup",
+ "orderAbout": "About the fetch order",
+ "orderDefault": "Default order: Local → configured services → Exa (free) → Jina Reader (free).",
+ "tavilyPriceTitle": "1 credit per 5 URLs (amortized) · API list price · {{date}}"
},
"searchServices": {
"subtitle": "Tools Vibey can use in a conversation. Searches send the query to the vendor or search service that runs them; a failure may retry with the next one in the search order. Image prompts go to the image model's vendor. Metered providers and search services bill under their own rules.",
@@ -2622,8 +2634,8 @@
"nativeOn": "When Claude, GPT or Grok can search natively, use it directly. The model vendor supplies the results and citations.",
"nativeOff": "Every model uses the search order below, including models that can search natively.",
"order": "Search order",
- "orderNative": "Used when the model cannot search natively. A failure tries the next entry.",
- "orderAll": "Used for every model. A failure tries the next entry.",
+ "orderNative": "Used when the model can't search natively; a failure tries the next.",
+ "orderAll": "Every model uses this order; a failure tries the next.",
"orderAuto": "Automatic: search services first, then model executors.",
"orderAutoKeyless": "Automatic: your added search services → enabled official DeepSeek → Exa (free) → model executors; use the arrows to reorder.",
"orderCustom": "Customized order.",
@@ -2636,7 +2648,6 @@
"retry": "Retry now",
"add": "Add search service",
"addVendor": "Add {{vendor}}",
- "empty": "Add a search service to search before model executors. List prices: {{prices}}. Plans and actual bills may differ.",
"price": "${{usd}} / 1k searches",
"free": "Free",
"freeTier": "Free; IP rate-limited",
@@ -2645,8 +2656,6 @@
"keylessResults_other": "{{count}} results · IP rate-limited",
"keylessCooldown": "Rate-limited · retry later",
"keylessCooldownUntil": "Paused until {{time}}",
- "keylessEmpty": "Exa (free) is built in, needs no key, and searches before model executors. Added search services precede it. List prices: {{prices}}. Plans and actual bills may differ.",
- "vendorPrice": "{{vendor}} ${{usd}} / 1k searches",
"priceDate": "API list price · {{date}}",
"builtInPrice": "Built in · no key or setup",
"priceNote": "Prices are the catalog's dated API list prices. Free allowances, plans and actual bills may differ.",
@@ -2703,7 +2712,11 @@
"tavily": "Basic web search with query-relevant snippets, designed for AI agents.",
"exa": "Semantic web search with query-relevant highlights included in the search price.",
"exa-mcp": "Keyless Exa search. Free and IP rate-limited; no key or setup is required."
- }
+ },
+ "noKey": "No key needed",
+ "priceFootnote": "Prices are API list prices. Model executors also use model tokens; your bill is final.",
+ "custodyShort": "Keys stay in the gateway, never with the model",
+ "orderAbout": "About the search order"
},
"capability": {
"readFailed": "Couldn't read this Source's tool capabilities.",
diff --git a/ui/src/i18n/zh.json b/ui/src/i18n/zh.json
index 99913dba6..a3d608f93 100644
--- a/ui/src/i18n/zh.json
+++ b/ui/src/i18n/zh.json
@@ -2561,7 +2561,16 @@
"listNoteExtras": "API 标价 · {{extras}}",
"extra": "另加 {{price}}",
"extraSeparator": ",",
- "unknown": "暂无标价"
+ "unknown": "暂无标价",
+ "executorTitle": "API 标价 · {{date}} · 另计 {{model}} 的 token",
+ "includedShort": "订阅内含",
+ "per1k": {
+ "call": "${{usd}} / 千次",
+ "search": "${{usd}} / 千次",
+ "post": "${{usd}} / 千条帖子",
+ "profile": "${{usd}} / 千个账号",
+ "fetch": "${{usd}} / 千次读取"
+ }
},
"footnote": "费用按厂商 API 标价估算,中转的实际账单可能不同;订阅不另计费。Claude 订阅不能运行这些工具。",
"saveFailed": "{{toolInline}}设置未能保存,请重试。",
@@ -2581,7 +2590,7 @@
"jina-reader": "https://r.jina.ai/"
},
"order": "读取顺序",
- "caption": "模型调用 web_fetch 时按这个顺序读取;失败自动换下一个。默认:本机 → 已配置服务 → Exa(免费) → Jina Reader(免费);可调整顺序。",
+ "caption": "按此顺序读取网页,失败换下一个。",
"use": "用于网页读取",
"unused": "未用于网页读取",
"kind": "读取服务",
@@ -2599,12 +2608,12 @@
"jina-reader": "Jina Reader(免费)"
},
"row": {
- "local": "Chrome 150 指纹 · HTML / PDF / 文本 · 不执行 JS",
+ "local": "HTML / PDF / 文本 · 不执行 JS",
"tavily": "用 Tavily 的密钥 · Extract 基础",
"exa": "用 Exa 的密钥 · Contents",
"deepseek": "用官方 DeepSeek 的密钥 · Fetch",
- "exa-mcp": "与网页搜索共用按 IP 的限流",
- "jina-reader": "每分钟 20 次 · 由 Jina 渲染 JS · 默认最后兜底"
+ "exa-mcp": "与网页搜索共用限流",
+ "jina-reader": "可渲染 JS · 每分钟 20 次"
},
"localDetail": "默认使用 Chrome 150 浏览器画像、HTTP/2。原生传输无法加载时改用普通 HTTP/2,并在调用记录中标记原因。不执行 JavaScript,不读取用户 Cookie 或登录凭据。支持 HTML、PDF、纯文本、Markdown 和 JSON。",
"limits": "整条调用最长 180 秒,每次尝试 30 秒;本机文本上限 16 MiB,PDF 32 MiB;给模型的完整结果最多 12,000 估算 token(48,000 UTF-8 字节),超出会明确截断。",
@@ -2614,7 +2623,10 @@
"endpoint": "接口",
"tavilyPrice": "5 个网址 1 credit(摊算)",
"localPrice": "从你的机器直接读取",
- "builtInPrice": "内置 · 无需密钥或设置"
+ "builtInPrice": "内置 · 无需密钥或设置",
+ "orderAbout": "关于读取顺序",
+ "orderDefault": "默认顺序:本机 → 已配置服务 → Exa(免费)→ Jina Reader(免费)。",
+ "tavilyPriceTitle": "5 个网址 1 credit(摊算)· API 标价 · {{date}}"
},
"searchServices": {
"subtitle": "Vibey 在对话中可使用的工具。搜索会把查询发给执行它的厂商或搜索服务,失败时可能改由顺序中的下一个重试;图片提示词会发给图片模型的厂商。按量付费的供应商和搜索服务按各自的规则计费。",
@@ -2622,8 +2634,8 @@
"nativeOn": "Claude、GPT、Grok 等自己能搜时直接用,结果和引用由模型厂商给出。",
"nativeOff": "所有模型都按下面的顺序搜索,包括能自带搜索的模型。",
"order": "搜索顺序",
- "orderNative": "模型不能自带搜索时,按这个顺序执行;失败后自动换下一个。",
- "orderAll": "所有模型都按这个顺序执行;失败后自动换下一个。",
+ "orderNative": "模型不能自带搜索时,按此顺序执行,失败换下一个。",
+ "orderAll": "所有模型都按此顺序执行,失败换下一个。",
"orderAuto": "自动:搜索服务在前,模型代搜在后。",
"orderAutoKeyless": "自动:已添加的搜索服务 → 已启用的官方 DeepSeek → Exa(免费) → 模型代搜;可上下调整。",
"orderCustom": "已手动调整顺序。",
@@ -2636,7 +2648,6 @@
"retry": "立即重试",
"add": "添加搜索服务",
"addVendor": "添加 {{vendor}}",
- "empty": "添加搜索服务,会在模型代搜之前搜索。标价:{{prices}}。套餐和实际账单可能不同。",
"price": "${{usd}} / 千次",
"free": "免费",
"freeTier": "免费;按 IP 限流",
@@ -2645,8 +2656,6 @@
"keylessResults_other": "{{count}} 个结果 · 按 IP 限流",
"keylessCooldown": "暂时限流 · 稍后重试",
"keylessCooldownUntil": "冷却至 {{time}}",
- "keylessEmpty": "Exa(免费)已内置,无需密钥,在模型代搜之前搜索。添加的搜索服务会排在它前面。标价:{{prices}}。套餐和实际账单可能不同。",
- "vendorPrice": "{{vendor}} ${{usd}} / 千次",
"priceDate": "API 标价 · {{date}}",
"builtInPrice": "内置 · 无需密钥或设置",
"priceNote": "价格为目录标注日期的 API 标价,免费额度、套餐与实际账单可能不同。",
@@ -2703,7 +2712,11 @@
"tavily": "为 AI Agent 设计的基础网页搜索,返回与搜索词相关的片段。",
"exa": "语义网页搜索,查询相关的高亮片段已包含在搜索价格中。",
"exa-mcp": "无需密钥的 Exa 搜索,免费但按 IP 限流;无需设置。"
- }
+ },
+ "noKey": "无需密钥",
+ "priceFootnote": "价格为 API 标价;模型代搜另计模型 token,实际以账单为准。",
+ "custodyShort": "密钥只保存在网关,不会交给模型",
+ "orderAbout": "关于搜索顺序"
},
"capability": {
"readFailed": "未能读取此供应商的工具能力。",