Enhance token refresh functionality across multiple executors

- Updated refreshCredentials methods in various executors (Antigravity, Base, Default, Github, Kiro) to accept optional proxyOptions for improved proxy handling.
- Modified token refresh logic to utilize proxy-aware fetch for better network management.
- Enhanced usage retrieval functions to support proxy options, ensuring seamless integration with proxy configurations.
- Updated ModelSelectModal and ProviderInfoCard components to incorporate kind filtering for improved user experience in model selection.
- Added validation for API keys in the provider validation route, including support for webSearch/webFetch providers.
This commit is contained in:
decolua
2026-04-28 17:28:57 +07:00
parent 1bb621317d
commit 8f81363675
45 changed files with 2924 additions and 289 deletions

View File

@@ -2,24 +2,20 @@
import Card from "./Card";
// Field schema — config-driven, used for both searchConfig and fetchConfig
// Only show fields user actually cares about
const FIELD_SCHEMA = {
mode: { label: "Mode", format: (v) => v },
defaultModel: { label: "Model", format: (v) => v, mono: true },
baseUrl: { label: "Endpoint", format: (v) => v, isLink: true, mono: true },
method: { label: "Method", format: (v) => v },
authType: { label: "Auth", format: (v) => v },
authHeader: { label: "Auth Header", format: (v) => v, mono: true },
costPerQuery: { label: "Cost / call", format: (v) => v === 0 ? "Free" : `$${v.toFixed(4)}` },
freeMonthlyQuota: { label: "Free quota", format: (v) => v === 0 ? "—" : v >= 999999 ? "Unlimited" : `${v.toLocaleString()} / mo` },
searchTypes: { label: "Types", format: (v) => v.join(", ") },
formats: { label: "Formats", format: (v) => v.join(", ") },
defaultMaxResults: { label: "Default results", format: (v) => v },
maxMaxResults: { label: "Max results", format: (v) => v },
maxCharacters: { label: "Max chars", format: (v) => v.toLocaleString() },
timeoutMs: { label: "Timeout", format: (v) => `${v / 1000}s` },
cacheTTLMs: { label: "Cache TTL", format: (v) => `${v / 60000}m` },
};
export default function ProviderInfoCard({ config, title = "Provider Info" }) {
export default function ProviderInfoCard({ config, provider, title = "Provider Info" }) {
if (!config) return null;
const rows = Object.entries(FIELD_SCHEMA)
@@ -33,9 +29,24 @@ export default function ProviderInfoCard({ config, title = "Provider Info" }) {
raw: config[key],
}));
const signupUrl = provider?.notice?.apiKeyUrl || provider?.website;
return (
<Card>
<h2 className="text-lg font-semibold mb-3">{title}</h2>
<div className="flex items-center justify-between mb-3">
<h2 className="text-lg font-semibold">{title}</h2>
{signupUrl && (
<a
href={signupUrl}
target="_blank"
rel="noopener noreferrer"
className="text-xs text-primary hover:underline inline-flex items-center gap-1"
>
<span className="material-symbols-outlined text-sm">open_in_new</span>
Get API Key
</a>
)}
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2">
{rows.map((r) => (
<div key={r.key} className="flex items-center gap-3 min-w-0">