feat(network): centralize proxy settings and add MCP routing (NAN-315) (#6372)
* feat(network): share proxy settings across features and MCP (NAN-315) * fix(network): address shared proxy review regressions * test(network): align rebased OAuth fixtures with runtime admission * fix(webui): configure shared proxy without leaving connection drafts * feat(webui): add optional shared proxy authentication editor * fix(webui): align proxy save tests and loading skeleton
This commit is contained in:
1 parent
872a83340d
commit
084b6bb394
181 files changed
+3740
-807
No files matched your search
@@ -44,6 +44,7 @@ type ChannelCatalogSetupPresentation = {
|
||||
export type ChannelFieldPresentation = {
|
||||
key: string;
|
||||
section?: string;
|
||||
control?: "switch";
|
||||
};
|
||||
|
||||
export type ChannelFieldSection =
|
||||
@@ -87,6 +88,7 @@ export type ChannelConfigField = {
|
||||
kind?: "string" | "secret" | "int" | "bool" | "list" | "enum" | string;
|
||||
section?: string;
|
||||
defaultValue?: string;
|
||||
control?: "switch";
|
||||
options?: ChannelConfigOption[];
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { SettingsExitGuard } from "@/components/settings/contracts";
|
||||
import { isCapabilitySection, type SettingsSectionKey } from "@/components/settings/contracts";
|
||||
import { SettingsFeature } from "@/components/settings/shared/SettingsFeature";
|
||||
import type { EditCompletion } from "@/components/settings/shared/useEditCompletion";
|
||||
import { SharedProxySetupDialog } from "@/components/settings/shared/SharedProxySetupDialog";
|
||||
import { SettingsSectionSkeleton } from "@/components/settings/shared/SettingsSectionSkeleton";
|
||||
|
||||
import { SkillsCatalogSettings } from "@/components/settings/SkillsCatalogSettings";
|
||||
@@ -94,6 +95,7 @@ export function SettingsPage({
|
||||
const [mcpSetupName, setMcpSetupName] = useState<string | null>(null);
|
||||
const presetDeletedCallback = useRef<(() => void) | null>(null);
|
||||
const [providerPanel, setProviderPanel] = useState<ProviderSettingsEntry | null>(null);
|
||||
const [proxySetupOpen, setProxySetupOpen] = useState(false);
|
||||
const providerSetupOrigin = useRef<{
|
||||
trigger: HTMLButtonElement | null;
|
||||
onAdded?: (provider: string) => void;
|
||||
@@ -129,6 +131,9 @@ export function SettingsPage({
|
||||
transcriptionDirty,
|
||||
} = controller;
|
||||
const { providerOAuthFlow } = modelState;
|
||||
const configureProxy = settings?.runtime_config && !String(settings.runtime_config["network.proxy"] ?? "").trim()
|
||||
? () => setProxySetupOpen(true)
|
||||
: undefined;
|
||||
|
||||
const restartInProgress = isRestarting || hostEngineApplying;
|
||||
const latestExitState = useRef({ requiresRestart: settings?.requires_restart, restartInProgress });
|
||||
@@ -327,6 +332,7 @@ export function SettingsPage({
|
||||
}}
|
||||
/>
|
||||
{providerPanel ? <ProvidersSettings
|
||||
onConfigureProxy={configureProxy}
|
||||
entry={providerPanel}
|
||||
onClose={() => setProviderPanel(null)}
|
||||
onProviderAdded={providerSetupOrigin.current?.onAdded
|
||||
@@ -518,6 +524,7 @@ export function SettingsPage({
|
||||
return (
|
||||
<div className="settings-stack">
|
||||
<AppsCatalogSettings
|
||||
onConfigureProxy={configureProxy}
|
||||
setupName={mcpSetupName}
|
||||
onSetupOpened={() => setMcpSetupName(null)}
|
||||
cliApps={systemState.cliApps}
|
||||
@@ -793,6 +800,11 @@ export function SettingsPage({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{proxySetupOpen ? <SharedProxySetupDialog
|
||||
busy={controller.runtimeConfigState.saving !== null}
|
||||
onClose={() => setProxySetupOpen(false)}
|
||||
onSave={controller.runtimeConfigState.saveProxy}
|
||||
/> : null}
|
||||
</DialogLayoutContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -47,6 +47,7 @@ export function channelSetup(
|
||||
): ChannelConfigField => ({
|
||||
...localizeField(field.key),
|
||||
section: field.section,
|
||||
control: field.control,
|
||||
});
|
||||
const presentation: ChannelSetupPresentation = {
|
||||
...definition,
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import type { ChannelConfigField } from "@/channel-plugins/catalog";
|
||||
import { ToggleButton } from "@/components/ui/toggle-button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
function channelFieldValue(field: ChannelConfigField, values: Record<string, string>): string {
|
||||
@@ -129,6 +130,25 @@ export function CredentialForm({
|
||||
{error}
|
||||
</span>
|
||||
) : null;
|
||||
if (field.control === "switch" && field.kind === "bool") {
|
||||
return (
|
||||
<div key={field.key} className="flex items-center justify-between gap-4 py-2">
|
||||
<label htmlFor={inputId} className="min-w-0">{header}</label>
|
||||
<div className="flex shrink-0 items-center gap-2">
|
||||
{errorMessage}
|
||||
<ToggleButton
|
||||
id={inputId}
|
||||
checked={selectedOption === "true"}
|
||||
disabled={disabled}
|
||||
aria-invalid={Boolean(error)}
|
||||
aria-describedby={describedBy}
|
||||
label={field.label}
|
||||
onChange={(checked) => onChange(field.key, String(checked))}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (field.options?.length) {
|
||||
return (
|
||||
<fieldset
|
||||
|
||||
@@ -25,6 +25,7 @@ import { ModelAPIControl } from "@/components/settings/models/ModelAPIControl";
|
||||
import { ProviderAPIControl } from "@/components/settings/models/ProviderAPIControl";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { SettingsHint } from "@/components/settings/shared/SettingsHint";
|
||||
import { ProxySettingsControl } from "@/components/settings/shared/ProxySettingsControl";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -107,7 +108,7 @@ const CUSTOM_PROVIDER_ADVANCED_FIELDS: ProviderAdvancedField[] = [
|
||||
"extra_headers",
|
||||
"extra_body",
|
||||
"extra_query",
|
||||
"proxy",
|
||||
"use_proxy",
|
||||
"thinking_style",
|
||||
];
|
||||
|
||||
@@ -381,11 +382,13 @@ function ProviderRequestOptions({
|
||||
}
|
||||
|
||||
function ProviderAdvancedOptions({
|
||||
onConfigureProxy,
|
||||
fields,
|
||||
form,
|
||||
onChange,
|
||||
children,
|
||||
}: {
|
||||
onConfigureProxy?: () => void;
|
||||
fields: ProviderAdvancedField[];
|
||||
form: ProviderForm;
|
||||
onChange: (value: Partial<ProviderForm>) => void;
|
||||
@@ -466,22 +469,13 @@ function ProviderAdvancedOptions({
|
||||
</DropdownMenu>
|
||||
</label>
|
||||
) : null}
|
||||
{enabled.has("proxy") ? (
|
||||
<label className="block space-y-1.5 md:col-span-2">
|
||||
<span className="block px-3 text-[12px] font-medium text-muted-foreground">
|
||||
{tx("settings.providers.proxy", "Network proxy")}
|
||||
</span>
|
||||
<Input
|
||||
value={form.proxy}
|
||||
onChange={(event) => onChange({ proxy: event.target.value })}
|
||||
placeholder="http://127.0.0.1:7890"
|
||||
autoCapitalize="none"
|
||||
autoComplete="off"
|
||||
autoCorrect="off"
|
||||
spellCheck={false}
|
||||
className="h-9 rounded-full font-mono text-[12px]"
|
||||
/>
|
||||
</label>
|
||||
{enabled.has("use_proxy") ? (
|
||||
<ProxySettingsControl
|
||||
className="px-3 py-2 md:col-span-2"
|
||||
checked={form.useProxy}
|
||||
onChange={(useProxy) => onChange({ useProxy })}
|
||||
onConfigure={onConfigureProxy}
|
||||
/>
|
||||
) : null}
|
||||
{enabled.has("region") ? (
|
||||
<label className="block space-y-1.5">
|
||||
@@ -535,6 +529,7 @@ type ProviderSettingsView =
|
||||
| { kind: "provider"; name: string; adding: boolean };
|
||||
|
||||
export function ProvidersSettings({
|
||||
onConfigureProxy,
|
||||
entry,
|
||||
onClose,
|
||||
onCloseAutoFocus,
|
||||
@@ -560,6 +555,7 @@ export function ProvidersSettings({
|
||||
onProviderOAuthLogout,
|
||||
}: {
|
||||
entry: ProviderSettingsEntry;
|
||||
onConfigureProxy?: () => void;
|
||||
onClose: () => void;
|
||||
onCloseAutoFocus: (event: Event) => void;
|
||||
onProviderAdded?: (provider: string) => void;
|
||||
@@ -671,7 +667,7 @@ export function ProvidersSettings({
|
||||
const apiBase = form.apiBase.trim();
|
||||
const advancedFields = provider.advanced_fields ?? [];
|
||||
const oauthSettingsDirty = isOauthProvider && (
|
||||
form.proxy.trim() !== (provider.proxy ?? "").trim()
|
||||
form.useProxy !== (provider.use_proxy ?? false)
|
||||
|| form.extraBody.trim() !== providerJsonValue(provider.extra_body).trim()
|
||||
);
|
||||
const oauthSettingsSaving = saving && providerOperation?.action === "save";
|
||||
@@ -680,7 +676,7 @@ export function ProvidersSettings({
|
||||
const hasOptionalProviderSetting = Boolean(
|
||||
apiKey
|
||||
|| apiBase
|
||||
|| form.proxy.trim()
|
||||
|| form.useProxy
|
||||
|| form.extraHeaders.trim()
|
||||
|| form.extraBody.trim()
|
||||
|| form.extraQuery.trim()
|
||||
@@ -787,6 +783,7 @@ export function ProvidersSettings({
|
||||
/>
|
||||
{supportsOauthAdvancedSettings ? (
|
||||
<ProviderAdvancedOptions
|
||||
onConfigureProxy={onConfigureProxy}
|
||||
fields={advancedFields}
|
||||
form={form}
|
||||
onChange={(value) => onChangeProviderForm(provider.name, value)}
|
||||
@@ -902,6 +899,7 @@ export function ProvidersSettings({
|
||||
onChange={(value) => onChangeProviderForm(provider.name, value)}
|
||||
/>
|
||||
<ProviderAdvancedOptions
|
||||
onConfigureProxy={onConfigureProxy}
|
||||
fields={advancedFields}
|
||||
form={form}
|
||||
onChange={(value) => onChangeProviderForm(provider.name, value)}
|
||||
@@ -1039,6 +1037,7 @@ export function ProvidersSettings({
|
||||
</div>
|
||||
</label>
|
||||
<ProviderAdvancedOptions
|
||||
onConfigureProxy={onConfigureProxy}
|
||||
fields={CUSTOM_PROVIDER_ADVANCED_FIELDS}
|
||||
form={customProviderDraft}
|
||||
onChange={(value) =>
|
||||
|
||||
@@ -8,7 +8,7 @@ export type ProviderForm = {
|
||||
apiKey: string;
|
||||
apiBase: string;
|
||||
api: ModelAPIConfig | null;
|
||||
proxy: string;
|
||||
useProxy: boolean;
|
||||
extraHeaders: string;
|
||||
extraBody: string;
|
||||
extraQuery: string;
|
||||
@@ -43,7 +43,7 @@ export function providerFormFromRow(
|
||||
apiKey: "",
|
||||
apiBase: provider.api_base ?? provider.default_api_base ?? "",
|
||||
api: provider.api ?? null,
|
||||
proxy: provider.proxy ?? "",
|
||||
useProxy: provider.use_proxy ?? false,
|
||||
extraHeaders: providerJsonValue(provider.extra_headers),
|
||||
extraBody: providerJsonValue(provider.extra_body),
|
||||
extraQuery: providerJsonValue(provider.extra_query),
|
||||
@@ -60,7 +60,7 @@ export function emptyCustomProviderDraft(): CustomProviderDraft {
|
||||
apiKey: "",
|
||||
apiBase: "",
|
||||
api: { supported_apis: ["chat_completions"], preferred_api: "chat_completions" },
|
||||
proxy: "",
|
||||
useProxy: false,
|
||||
extraHeaders: "",
|
||||
extraBody: "",
|
||||
extraQuery: "",
|
||||
|
||||
@@ -456,7 +456,7 @@ export function useModelSettingsActions({
|
||||
if (provider.provider_api_configurable) update.api = providerForm.api;
|
||||
}
|
||||
for (const field of provider.advanced_fields ?? []) {
|
||||
if (field === "proxy") update.proxy = providerForm.proxy.trim();
|
||||
if (field === "use_proxy") update.use_proxy = providerForm.useProxy;
|
||||
if (field === "extra_headers") {
|
||||
update.extraHeaders = providerForm.extraHeaders.trim();
|
||||
}
|
||||
@@ -500,7 +500,7 @@ export function useModelSettingsActions({
|
||||
apiKey: draft.apiKey.trim() || undefined,
|
||||
apiBase: draft.apiBase.trim(),
|
||||
...(settings?.provider_api_configuration_supported ? { api: draft.api } : {}),
|
||||
proxy: draft.proxy.trim(),
|
||||
use_proxy: draft.useProxy,
|
||||
extraHeaders: draft.extraHeaders.trim(),
|
||||
extraBody: draft.extraBody.trim(),
|
||||
extraQuery: draft.extraQuery.trim(),
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { SettingsHint } from "@/components/settings/shared/SettingsHint";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ToggleButton } from "@/components/ui/toggle-button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export function ProxySettingsControl({ checked, disabled, onChange, onConfigure, className }: {
|
||||
checked: boolean;
|
||||
disabled?: boolean;
|
||||
onChange: (checked: boolean) => void;
|
||||
onConfigure?: () => void;
|
||||
className?: string;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div data-proxy-control className={cn("flex items-center justify-between gap-4", className)}>
|
||||
<SettingsHint description={t("settings.network.useProxyHelp")}>
|
||||
<span className="block text-[13px] font-medium leading-5 text-foreground">{t("settings.network.useProxy")}</span>
|
||||
</SettingsHint>
|
||||
{onConfigure ? (
|
||||
<Button type="button" variant="outline" size="sm" onClick={onConfigure}
|
||||
className="h-7 shrink-0 rounded-full px-3 text-[13px] font-medium leading-5">
|
||||
{t("settings.network.configureProxy")}
|
||||
</Button>
|
||||
) : (
|
||||
<ToggleButton checked={checked} disabled={disabled} onChange={onChange} label={t("settings.network.useProxy")} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -39,9 +39,23 @@ function Group({ controls }: { controls: Control[] }) {
|
||||
return <section><Title /><SettingsGroup>{controls.map((control, index) => <Row key={index} control={control} />)}</SettingsGroup></section>;
|
||||
}
|
||||
|
||||
function ProxyGroup() {
|
||||
return <section><Title /><SettingsGroup>
|
||||
<div className="px-4 py-4 sm:px-5">
|
||||
<div data-shared-proxy-skeleton className="w-full space-y-3">
|
||||
<div data-proxy-address-skeleton className={cn(block, "h-10 w-full rounded-control")} />
|
||||
<div className="flex h-7 items-center justify-between gap-3 py-1">
|
||||
<div className={cn(block, "h-3 w-40")} /><div className={cn(block, "h-3.5 w-3.5 shrink-0")} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</SettingsGroup></section>;
|
||||
}
|
||||
|
||||
function RuntimeGroups({ page }: { page: RuntimeConfigPage }) {
|
||||
return <>{RUNTIME_CONFIG_GROUPS.filter((group) => group.page === page).map((group) => group.id === "chat"
|
||||
? <Group key={group.id} controls={["switch", "segments"]} />
|
||||
: group.id === "proxy" ? <ProxyGroup key={group.id} />
|
||||
: <Group key={group.id} controls={RUNTIME_CONFIG_FIELDS.filter((field) => field.group === group.id && (!field.when || field.when.value === true)).flatMap<Control>((field) =>
|
||||
field.kind === "idle-compaction" ? ["switch", "idle-timeout"] : [
|
||||
field.kind === "boolean" || field.kind === "toggle" ? "switch" : field.kind === "list" ? "edit" : field.kind === "duration" ? "duration" : "input",
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import { useState, type ComponentProps, type Ref } from "react";
|
||||
import { ChevronDown } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { changeProxyAddress, changeProxyAuthentication, isProxyUrlReference, splitProxyUrl } from "@/lib/proxy-url";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type AddressProps = Pick<ComponentProps<typeof Input>, "id" | "aria-describedby" | "aria-invalid">;
|
||||
|
||||
export function SharedProxyEditor({ value, onChange, disabled, inputRef, addressProps, stackCredentials = false }: {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
disabled?: boolean;
|
||||
inputRef?: Ref<HTMLInputElement>;
|
||||
addressProps?: AddressProps;
|
||||
stackCredentials?: boolean;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const parts = splitProxyUrl(value);
|
||||
const [expanded, setExpanded] = useState<boolean | null>(null);
|
||||
const open = expanded ?? parts.userinfo !== null;
|
||||
const reference = isProxyUrlReference(parts.address);
|
||||
const credentialsDisabled = disabled || !parts.address.trim() || reference;
|
||||
return (
|
||||
<div data-shared-proxy-editor className="w-full space-y-3">
|
||||
<Input {...addressProps} ref={inputRef} aria-label={t("settings.runtimeConfig.fields.network_proxy.label")}
|
||||
type="text" value={parts.address} disabled={disabled} autoComplete="off" spellCheck={false}
|
||||
placeholder="http://127.0.0.1:7890" className="h-10 rounded-control text-[13px]"
|
||||
onChange={(event) => onChange(changeProxyAddress(value, event.target.value))} />
|
||||
<button type="button" aria-expanded={open} onClick={() => setExpanded(!open)}
|
||||
className="flex w-full items-center justify-between gap-3 rounded-sm py-1 text-[13px] font-medium leading-5 text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">
|
||||
{t("settings.network.authentication")}
|
||||
<ChevronDown aria-hidden className={cn("h-3.5 w-3.5 shrink-0 transition-transform motion-reduce:transition-none", open && "rotate-180")} />
|
||||
</button>
|
||||
{open ? reference ? (
|
||||
<p className="px-1 text-[12px] leading-5 text-muted-foreground">{t("settings.network.proxyReferenceAuth")}</p>
|
||||
) : (
|
||||
<div className={cn("grid gap-4", !stackCredentials && "sm:grid-cols-2")}>
|
||||
<label className="block space-y-1">
|
||||
<span className="px-1 text-[13px] leading-5 text-muted-foreground">{t("settings.network.username")}</span>
|
||||
<Input type="text" value={parts.username} disabled={credentialsDisabled} autoComplete="off" spellCheck={false}
|
||||
className="h-10 rounded-control text-[13px]"
|
||||
onChange={(event) => { setExpanded(true); onChange(changeProxyAuthentication(value, event.target.value, parts.password)); }} />
|
||||
</label>
|
||||
<label className="block space-y-1">
|
||||
<span className="px-1 text-[13px] leading-5 text-muted-foreground">{t("settings.network.password")}</span>
|
||||
<Input type="password" value={parts.password} disabled={credentialsDisabled} autoComplete="new-password"
|
||||
className="h-10 rounded-control text-[13px]"
|
||||
onChange={(event) => { setExpanded(true); onChange(changeProxyAuthentication(value, parts.username, event.target.value)); }} />
|
||||
</label>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { SettingsHint } from "@/components/settings/shared/SettingsHint";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
||||
import { SharedProxyEditor } from "@/components/settings/shared/SharedProxyEditor";
|
||||
|
||||
export function SharedProxySetupDialog({ onClose, onSave, busy }: {
|
||||
busy: boolean;
|
||||
onClose: () => void;
|
||||
onSave: (address: string) => Promise<void>;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [address, setAddress] = useState("");
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
const input = useRef<HTMLInputElement>(null);
|
||||
const origin = useRef(document.activeElement?.closest("[data-proxy-control]") ?? null);
|
||||
const title = t("settings.runtimeConfig.fields.network_proxy.label");
|
||||
useEffect(() => { if (error && !saving) input.current?.focus(); }, [error, saving]);
|
||||
const save = async () => {
|
||||
if (saving || busy || !address.trim()) return;
|
||||
setSaving(true);
|
||||
setError("");
|
||||
try {
|
||||
await onSave(address);
|
||||
onClose();
|
||||
} catch (cause) {
|
||||
setError(cause instanceof Error ? cause.message : String(cause));
|
||||
} finally {
|
||||
setSaving(false);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Dialog open onOpenChange={(open) => { if (!open && !saving) onClose(); }}>
|
||||
<DialogContent className="max-w-sm" showCloseButton={!saving}
|
||||
onOpenAutoFocus={(event) => { event.preventDefault(); input.current?.focus(); }}
|
||||
onCloseAutoFocus={(event) => {
|
||||
event.preventDefault();
|
||||
const row = origin.current;
|
||||
const target = row?.querySelector<HTMLElement>('[role="switch"]') ?? row?.querySelector<HTMLElement>("button:last-child");
|
||||
target?.focus();
|
||||
}}
|
||||
onEscapeKeyDown={(event) => { if (saving) event.preventDefault(); }}
|
||||
onPointerDownOutside={(event) => { if (saving) event.preventDefault(); }}>
|
||||
<form className="space-y-4" onSubmit={(event) => { event.preventDefault(); void save(); }}>
|
||||
<DialogHeader>
|
||||
<DialogTitle className="pr-6 text-base">
|
||||
<SettingsHint description={t("settings.runtimeConfig.fields.network_proxy.help")}>{title}</SettingsHint>
|
||||
</DialogTitle>
|
||||
<DialogDescription>{t("settings.network.sharedProxyScope")}</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="space-y-2">
|
||||
<SharedProxyEditor value={address} inputRef={input} disabled={saving} stackCredentials
|
||||
addressProps={{ "aria-invalid": Boolean(error), "aria-describedby": error ? "shared-proxy-setup-error" : undefined }}
|
||||
onChange={(next) => { setAddress(next); setError(""); }} />
|
||||
{error ? <p id="shared-proxy-setup-error" role="alert" className="break-words text-[13px] text-destructive">{error}</p> : null}
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Button type="button" variant="outline" disabled={saving} onClick={onClose}>{t("settings.actions.cancel")}</Button>
|
||||
<Button type="submit" disabled={saving || busy || !address.trim()}>{saving ? t("settings.actions.saving") : t("settings.actions.save")}</Button>
|
||||
</DialogFooter>
|
||||
</form>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -32,6 +32,7 @@ import {
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { CatalogSkeleton } from "@/components/settings/shared/CatalogSkeleton";
|
||||
import { ProxySettingsControl } from "@/components/settings/shared/ProxySettingsControl";
|
||||
|
||||
import {
|
||||
DismissibleStatusMessage,
|
||||
@@ -84,6 +85,7 @@ export interface CustomMcpForm {
|
||||
env: string;
|
||||
headers: string;
|
||||
toolTimeout: string;
|
||||
useProxy: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_CUSTOM_MCP_FORM: CustomMcpForm = {
|
||||
@@ -96,11 +98,13 @@ export const DEFAULT_CUSTOM_MCP_FORM: CustomMcpForm = {
|
||||
env: "",
|
||||
headers: "",
|
||||
toolTimeout: "30",
|
||||
useProxy: false,
|
||||
};
|
||||
|
||||
export function AppsCatalogSettings({
|
||||
setupName,
|
||||
onSetupOpened,
|
||||
onConfigureProxy,
|
||||
cliApps,
|
||||
mcpPresets,
|
||||
cliAppsLoading,
|
||||
@@ -146,6 +150,7 @@ export function AppsCatalogSettings({
|
||||
}: {
|
||||
setupName?: string | null;
|
||||
onSetupOpened?: () => void;
|
||||
onConfigureProxy?: () => void;
|
||||
cliApps: CliAppsPayload | null;
|
||||
mcpPresets: McpPresetsPayload | null;
|
||||
cliAppsLoading: boolean;
|
||||
@@ -172,7 +177,7 @@ export function AppsCatalogSettings({
|
||||
onQueryChange: (value: string) => void;
|
||||
onFilterChange: (value: AppsKindFilter) => void;
|
||||
onCliAction: (action: "install" | "update" | "uninstall" | "test", name: string) => void;
|
||||
onMcpAction: (action: "enable" | "disable" | "remove" | "test" | "reconnect", name: string, values?: Record<string, string>) => void;
|
||||
onMcpAction: (action: "enable" | "disable" | "remove" | "test" | "reconnect" | "proxy", name: string, values?: Record<string, string>) => void;
|
||||
onMcpOAuthConnect: (name: string, reset?: boolean, values?: Record<string, string>) => void;
|
||||
onMcpOAuthCancel: () => void;
|
||||
onMcpOAuthOpen: () => void;
|
||||
@@ -325,6 +330,7 @@ export function AppsCatalogSettings({
|
||||
preset={item.preset}
|
||||
openConnection={setupName === item.preset.name}
|
||||
onConnectionOpened={onSetupOpened}
|
||||
onConfigureProxy={onConfigureProxy}
|
||||
values={mcpFieldValues[item.preset.name] ?? {}}
|
||||
actionKey={mcpActionKey}
|
||||
oauthFlow={mcpOAuthFlow?.name === item.preset.name ? mcpOAuthFlow : null}
|
||||
@@ -387,6 +393,7 @@ export function AppsCatalogSettings({
|
||||
|
||||
{filter === "mcp" ? (
|
||||
<McpCustomServerPanel
|
||||
onConfigureProxy={onConfigureProxy}
|
||||
form={customMcpForm}
|
||||
configImport={mcpConfigImport}
|
||||
actionKey={mcpActionKey}
|
||||
@@ -494,6 +501,7 @@ function CliAppsCatalogRow({
|
||||
function McpAppsCatalogRow({
|
||||
openConnection = false,
|
||||
onConnectionOpened,
|
||||
onConfigureProxy,
|
||||
preset,
|
||||
values,
|
||||
actionKey,
|
||||
@@ -515,6 +523,7 @@ function McpAppsCatalogRow({
|
||||
}: {
|
||||
openConnection?: boolean;
|
||||
onConnectionOpened?: () => void;
|
||||
onConfigureProxy?: () => void;
|
||||
preset: McpPresetInfo;
|
||||
values: Record<string, string>;
|
||||
actionKey: string | null;
|
||||
@@ -526,7 +535,7 @@ function McpAppsCatalogRow({
|
||||
showBrandLogos: boolean;
|
||||
showTypeBadge: boolean;
|
||||
onFieldChange: (presetName: string, fieldName: string, value: string) => void;
|
||||
onAction: (action: "enable" | "disable" | "remove" | "test" | "reconnect", name: string, values?: Record<string, string>) => void;
|
||||
onAction: (action: "enable" | "disable" | "remove" | "test" | "reconnect" | "proxy", name: string, values?: Record<string, string>) => void;
|
||||
onOAuthConnect: (name: string, reset?: boolean, values?: Record<string, string>) => void;
|
||||
onOAuthCancel: () => void;
|
||||
onOAuthOpen: () => void;
|
||||
@@ -552,7 +561,8 @@ function McpAppsCatalogRow({
|
||||
const toolsBusy = actionKey === `tools:${preset.name}`;
|
||||
const oauthBusy = actionKey === `oauth:${preset.name}`;
|
||||
const anotherOAuthBusy = Boolean(actionKey?.startsWith("oauth:")) && !oauthBusy;
|
||||
const busy = enableBusy || disableBusy || removeBusy || testBusy || reconnectBusy || toolsBusy || oauthBusy;
|
||||
const proxyBusy = actionKey === `proxy:${preset.name}`;
|
||||
const busy = enableBusy || disableBusy || removeBusy || testBusy || reconnectBusy || toolsBusy || oauthBusy || proxyBusy;
|
||||
const agentPlugin = preset.source === "agent-plugin";
|
||||
const toggleable = preset.enabled !== undefined;
|
||||
const isOAuth = preset.auth === "oauth";
|
||||
@@ -583,7 +593,7 @@ function McpAppsCatalogRow({
|
||||
const callbackErrorId = `${callbackInputId}-error`;
|
||||
|
||||
const enableOrOpenSetup = () => {
|
||||
if (needsSetupInput || (preset.installed && !preset.configured && hasFields)) {
|
||||
if (preset.transport !== "stdio" || needsSetupInput || (preset.installed && !preset.configured && hasFields)) {
|
||||
setManagementTab("connection");
|
||||
setManagementOpen(true);
|
||||
return;
|
||||
@@ -709,7 +719,7 @@ function McpAppsCatalogRow({
|
||||
defaultValue: "Manage {{name}}",
|
||||
})}
|
||||
visibleLabel={tx("settings.mcp.manage", "Manage")}
|
||||
busy={testBusy || toolsBusy || removeBusy || reconnectBusy}
|
||||
busy={testBusy || toolsBusy || removeBusy || reconnectBusy || proxyBusy}
|
||||
disabled={busy}
|
||||
tone={runtimeConnected ? "installed" : "default"}
|
||||
onClick={() => openManagement("overview")}
|
||||
@@ -741,7 +751,7 @@ function McpAppsCatalogRow({
|
||||
visibleLabel={hasFields ? tx("settings.mcp.configure", "Connect") : tx("settings.mcp.enable", "Enable")}
|
||||
busy={enableBusy}
|
||||
onClick={() => {
|
||||
if (hasFields) openManagement("connection");
|
||||
if (hasFields || preset.transport !== "stdio") openManagement("connection");
|
||||
else onAction("enable", preset.name, values);
|
||||
}}
|
||||
/>
|
||||
@@ -873,6 +883,7 @@ function McpAppsCatalogRow({
|
||||
|
||||
{managementOpen ? (
|
||||
<McpManagementDialog
|
||||
onConfigureProxy={onConfigureProxy}
|
||||
preset={preset}
|
||||
values={values}
|
||||
actionKey={actionKey}
|
||||
@@ -994,6 +1005,7 @@ function appsSearchText(item: AppsCatalogItem): string {
|
||||
}
|
||||
|
||||
function McpCustomServerPanel({
|
||||
onConfigureProxy,
|
||||
form,
|
||||
configImport,
|
||||
actionKey,
|
||||
@@ -1002,6 +1014,7 @@ function McpCustomServerPanel({
|
||||
onSave,
|
||||
onImportConfig,
|
||||
}: {
|
||||
onConfigureProxy?: () => void;
|
||||
form: CustomMcpForm;
|
||||
configImport: string;
|
||||
actionKey: string | null;
|
||||
@@ -1160,6 +1173,16 @@ function McpCustomServerPanel({
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{remote ? (
|
||||
<ProxySettingsControl
|
||||
className="mt-3 rounded-control bg-background/55 px-3 py-3"
|
||||
checked={form.useProxy}
|
||||
disabled={customBusy}
|
||||
onChange={(useProxy) => update("useProxy", useProxy)}
|
||||
onConfigure={onConfigureProxy}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{remote && form.auth === "headers" ? (
|
||||
<div className="mt-3 min-w-0">
|
||||
<label
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Check, ExternalLink, Loader2, RotateCcw, Search, Server, Trash2, X } fr
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { SkeletonStatus } from "@/components/settings/shared/SkeletonStatus";
|
||||
import { ProxySettingsControl } from "@/components/settings/shared/ProxySettingsControl";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
Dialog,
|
||||
@@ -20,7 +21,7 @@ import { cn } from "@/lib/utils";
|
||||
|
||||
export type McpManagementTab = "overview" | "tools" | "connection";
|
||||
|
||||
type McpAction = "enable" | "disable" | "remove" | "test" | "reconnect";
|
||||
type McpAction = "enable" | "disable" | "remove" | "test" | "reconnect" | "proxy";
|
||||
|
||||
interface McpManagementDialogProps {
|
||||
preset: McpPresetInfo;
|
||||
@@ -36,6 +37,7 @@ interface McpManagementDialogProps {
|
||||
onAction: (action: McpAction, name: string, values?: Record<string, string>) => void;
|
||||
onOAuthConnect: (name: string, reset?: boolean, values?: Record<string, string>) => void;
|
||||
onToolsChange: (name: string, enabledTools: string[]) => void;
|
||||
onConfigureProxy?: () => void;
|
||||
}
|
||||
|
||||
export function McpManagementDialog({
|
||||
@@ -52,6 +54,7 @@ export function McpManagementDialog({
|
||||
onAction,
|
||||
onOAuthConnect,
|
||||
onToolsChange,
|
||||
onConfigureProxy,
|
||||
}: McpManagementDialogProps) {
|
||||
const { t } = useTranslation();
|
||||
const tx = (key: string, fallback: string) => t(key, { defaultValue: fallback });
|
||||
@@ -68,9 +71,14 @@ export function McpManagementDialog({
|
||||
const enableBusy = actionKey === `enable:${preset.name}`;
|
||||
const toolsBusy = actionKey === `tools:${preset.name}`;
|
||||
const oauthBusy = actionKey === `oauth:${preset.name}`;
|
||||
const busy = testBusy || reconnectBusy || removeBusy || enableBusy || toolsBusy || oauthBusy;
|
||||
const proxyBusy = actionKey === `proxy:${preset.name}`;
|
||||
const busy = testBusy || reconnectBusy || removeBusy || enableBusy || toolsBusy || oauthBusy || proxyBusy;
|
||||
const configuredInstalled = preset.installed && preset.configured;
|
||||
const isOAuth = preset.auth === "oauth";
|
||||
const remote = preset.transport !== "stdio";
|
||||
const useProxy = values.use_proxy ?? String(preset.use_proxy ?? false);
|
||||
const proxyDirty = remote && useProxy !== String(preset.use_proxy ?? false);
|
||||
const connectionValues = remote ? { ...values, use_proxy: useProxy } : values;
|
||||
const inspectionRequestedRef = useRef(false);
|
||||
const allowAllTools = draftEnabledTools.includes("*");
|
||||
const selectedTools = new Set(allowAllTools ? toolNames : draftEnabledTools);
|
||||
@@ -115,10 +123,14 @@ export function McpManagementDialog({
|
||||
const connect = () => {
|
||||
onOpenChange(false);
|
||||
if (isOAuth) {
|
||||
onOAuthConnect(preset.name, configuredInstalled, values);
|
||||
onOAuthConnect(preset.name, configuredInstalled, connectionValues);
|
||||
return;
|
||||
}
|
||||
onAction(configuredInstalled ? "reconnect" : "enable", preset.name, values);
|
||||
if (configuredInstalled && proxyDirty) {
|
||||
onAction("proxy", preset.name, { use_proxy: useProxy });
|
||||
return;
|
||||
}
|
||||
onAction(configuredInstalled ? "reconnect" : "enable", preset.name, configuredInstalled ? values : connectionValues);
|
||||
};
|
||||
|
||||
const inspectTools = () => {
|
||||
@@ -219,8 +231,9 @@ export function McpManagementDialog({
|
||||
/>
|
||||
) : (
|
||||
<ConnectionPanel
|
||||
onConfigureProxy={onConfigureProxy}
|
||||
preset={preset}
|
||||
values={values}
|
||||
values={connectionValues}
|
||||
busy={busy}
|
||||
connectBusy={reconnectBusy || enableBusy || oauthBusy}
|
||||
removeBusy={removeBusy}
|
||||
@@ -235,6 +248,23 @@ export function McpManagementDialog({
|
||||
)}
|
||||
</div>
|
||||
|
||||
{tab === "connection" && preset.installed && proxyDirty ? (
|
||||
<div className="flex shrink-0 items-center justify-end border-t border-border/45 bg-background/95 px-5 py-3 sm:px-6">
|
||||
<Button
|
||||
type="button"
|
||||
disabled={busy}
|
||||
onClick={() => {
|
||||
onOpenChange(false);
|
||||
onAction("proxy", preset.name, { use_proxy: useProxy });
|
||||
}}
|
||||
className="h-9 rounded-full px-4 text-[13px] font-semibold"
|
||||
>
|
||||
{proxyBusy ? <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin motion-reduce:animate-none" aria-hidden /> : null}
|
||||
{tx("settings.mcp.applyChanges", "Apply changes")}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{tab === "tools" && toolsDirty ? (
|
||||
<div className="flex shrink-0 items-center justify-end border-t border-border/45 bg-background/95 px-5 py-3 sm:px-6">
|
||||
<Button
|
||||
@@ -503,6 +533,7 @@ function ToolsPanel({
|
||||
}
|
||||
|
||||
function ConnectionPanel({
|
||||
onConfigureProxy,
|
||||
preset,
|
||||
values,
|
||||
busy,
|
||||
@@ -519,6 +550,7 @@ function ConnectionPanel({
|
||||
connectBusy: boolean;
|
||||
removeBusy: boolean;
|
||||
requiredFieldsComplete: boolean;
|
||||
onConfigureProxy?: () => void;
|
||||
onFieldChange: (presetName: string, fieldName: string, value: string) => void;
|
||||
onConnect: () => void;
|
||||
onRemove: () => void;
|
||||
@@ -599,6 +631,16 @@ function ConnectionPanel({
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{preset.transport !== "stdio" ? (
|
||||
<ProxySettingsControl
|
||||
className="rounded-control bg-muted/40 px-4 py-3.5"
|
||||
checked={values.use_proxy === "true"}
|
||||
disabled={busy}
|
||||
onChange={(checked) => onFieldChange(preset.name, "use_proxy", String(checked))}
|
||||
onConfigure={onConfigureProxy}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{hasFields ? (
|
||||
<section>
|
||||
<h3 className="text-[13px] font-semibold text-foreground">
|
||||
|
||||
@@ -6,6 +6,8 @@ import { SettingsGroup, SettingsRow, SettingsSectionTitle, RestartRequiredNotice
|
||||
import { ProviderPicker } from "@/components/settings/shared/ModelControls";
|
||||
import { TimezonePicker } from "@/components/settings/shared/TimezonePicker";
|
||||
import { SettingsTextEditor } from "@/components/settings/shared/SettingsTextEditor";
|
||||
import { SharedProxyEditor } from "@/components/settings/shared/SharedProxyEditor";
|
||||
import { SettingsHint } from "@/components/settings/shared/SettingsHint";
|
||||
import { ShellRuntimeControl } from "@/components/settings/system/ShellRuntimeControl";
|
||||
import { IdleCompactionControl } from "@/components/settings/system/IdleCompactionControl";
|
||||
import { Input } from "@/components/ui/input";
|
||||
@@ -145,7 +147,18 @@ export function useRuntimeConfigSettings(
|
||||
change(field, next);
|
||||
void save(field.group, { [field.path]: next });
|
||||
};
|
||||
return { value, visible, dirty, discard, change, commit, reject, save, saveList, saving, errors, invalidField, saved };
|
||||
const saveProxy = async (next: string) => {
|
||||
setSaving("proxy");
|
||||
try {
|
||||
const payload = await updateRuntimeConfigSettings(client, { "network.proxy": next.trim() || null });
|
||||
applyPayload(payload, { preserveAgentForm: true, preserveCapabilityForms: true });
|
||||
discard("proxy");
|
||||
setSaved((prev) => ({ ...prev, proxy: true }));
|
||||
} finally {
|
||||
setSaving(null);
|
||||
}
|
||||
};
|
||||
return { value, visible, dirty, discard, change, commit, reject, save, saveList, saveProxy, saving, errors, invalidField, saved };
|
||||
}
|
||||
|
||||
export type RuntimeConfigController = ReturnType<typeof useRuntimeConfigSettings>;
|
||||
@@ -184,7 +197,9 @@ export function RuntimeConfigSettings({
|
||||
const inlineError = fields.some((field) => field.kind === "duration" && state.invalidField === field.path);
|
||||
const section = (
|
||||
<section key={group.id} aria-label={title}>
|
||||
<SettingsSectionTitle>{title}</SettingsSectionTitle>
|
||||
<SettingsSectionTitle>{group.id === "proxy"
|
||||
? <SettingsHint description={tr("fields.network_proxy.help")}>{title}</SettingsHint>
|
||||
: title}</SettingsSectionTitle>
|
||||
<form noValidate onSubmit={(event) => { event.preventDefault(); void state.save(group.id); }}
|
||||
onBlur={(event) => {
|
||||
if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) return;
|
||||
@@ -221,6 +236,14 @@ export function RuntimeConfigSettings({
|
||||
: [...field.options ?? []];
|
||||
// Keep a configured preset visible if it is no longer available.
|
||||
if (field.kind === "preset" && current && !options.includes(String(current))) options.push(String(current));
|
||||
if (field.path === "network.proxy") return (
|
||||
<div key={field.path} className="px-4 py-4 sm:px-5">
|
||||
<span id={`${id}-help`} className="sr-only">{help}</span>
|
||||
<SharedProxyEditor value={String(current)} addressProps={common}
|
||||
disabled={disabled || state.saving !== null || isRestarting}
|
||||
onChange={(next) => state.change(field, next)} />
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<SettingsRow key={field.path} title={text} description={help}>
|
||||
<span id={`${id}-help`} className="sr-only">{help}</span>
|
||||
|
||||
@@ -306,6 +306,20 @@ export function createSystemSettingsActions({
|
||||
setAutomations(payload);
|
||||
};
|
||||
|
||||
const retireMcpProxyDrafts = (names: string[]) => {
|
||||
setMcpFieldValues((prev) => {
|
||||
const next = { ...prev };
|
||||
for (const name of names) {
|
||||
const key = name.trim().toLowerCase();
|
||||
if (prev[key]?.use_proxy === undefined) continue;
|
||||
const fields = { ...prev[key] };
|
||||
delete fields.use_proxy;
|
||||
next[key] = fields;
|
||||
}
|
||||
return next;
|
||||
});
|
||||
};
|
||||
|
||||
const closeMcpOAuthPopup = () => {
|
||||
const popup = mcpOAuthPopupRef.current;
|
||||
mcpOAuthPopupRef.current = null;
|
||||
@@ -390,6 +404,7 @@ export function createSystemSettingsActions({
|
||||
try {
|
||||
const payload = await fetchMcpPresets(getToken());
|
||||
setMcpPresets(payload);
|
||||
retireMcpProxyDrafts([flow.name]);
|
||||
notifyMcpPresetsChanged(payload);
|
||||
setMcpMessage(null);
|
||||
setMcpError(null);
|
||||
@@ -560,7 +575,7 @@ export function createSystemSettingsActions({
|
||||
};
|
||||
|
||||
const handleMcpPresetAction = async (
|
||||
action: "enable" | "disable" | "remove" | "test" | "reconnect",
|
||||
action: "enable" | "disable" | "remove" | "test" | "reconnect" | "proxy",
|
||||
name: string,
|
||||
values: Record<string, string> = {},
|
||||
) => {
|
||||
@@ -578,6 +593,12 @@ export function createSystemSettingsActions({
|
||||
if (payload.requires_restart) {
|
||||
setPendingRestartSections((prev) => ({ ...prev, runtime: true }));
|
||||
}
|
||||
if (
|
||||
(action === "proxy" || action === "remove")
|
||||
&& payload.last_action?.ok !== false
|
||||
) {
|
||||
retireMcpProxyDrafts([name]);
|
||||
}
|
||||
await maybeRestartHostEngine(payload);
|
||||
if (action === "enable") {
|
||||
setMcpFieldValues((prev) => ({ ...prev, [name]: {} }));
|
||||
@@ -615,6 +636,7 @@ export function createSystemSettingsActions({
|
||||
? customMcpForm.headers
|
||||
: "",
|
||||
tool_timeout: customMcpForm.toolTimeout,
|
||||
...(customMcpForm.transport !== "stdio" ? { use_proxy: String(customMcpForm.useProxy) } : {}),
|
||||
});
|
||||
setMcpPresets(payload);
|
||||
applyMcpActionFeedback(
|
||||
@@ -622,6 +644,9 @@ export function createSystemSettingsActions({
|
||||
false,
|
||||
expectsOAuthAuthorization ? name : undefined,
|
||||
);
|
||||
if (payload.last_action?.ok !== false) {
|
||||
retireMcpProxyDrafts([name]);
|
||||
}
|
||||
notifyMcpPresetsChanged(payload);
|
||||
if (payload.requires_restart) {
|
||||
setPendingRestartSections((prev) => ({ ...prev, runtime: true }));
|
||||
@@ -643,6 +668,11 @@ export function createSystemSettingsActions({
|
||||
const payload = await importMcpConfig(client, mcpConfigImport);
|
||||
setMcpPresets(payload);
|
||||
applyMcpActionFeedback(payload);
|
||||
if (payload.last_action?.ok !== false) {
|
||||
// The accepted import has been validated by the server; its response has no name list.
|
||||
const config: { mcpServers?: object } = JSON.parse(mcpConfigImport);
|
||||
retireMcpProxyDrafts(Object.keys(config.mcpServers ?? config));
|
||||
}
|
||||
notifyMcpPresetsChanged(payload);
|
||||
if (payload.requires_restart) {
|
||||
setPendingRestartSections((prev) => ({ ...prev, runtime: true }));
|
||||
|
||||
@@ -21,6 +21,7 @@ export const RUNTIME_CONFIG_GROUPS: { id: string; page: RuntimeConfigPage; enabl
|
||||
{ id: "web", page: "browser" },
|
||||
{ id: "shell", page: "advanced", enabledBy: "tools.exec.enable" },
|
||||
{ id: "network", page: "network" },
|
||||
{ id: "proxy", page: "advanced" },
|
||||
{ id: "safety", page: "advanced" },
|
||||
{ id: "cli", page: "advanced", enabledBy: "tools.cli_apps.enable" },
|
||||
{ id: "gateway", page: "advanced" },
|
||||
@@ -54,7 +55,8 @@ export const RUNTIME_CONFIG_FIELDS: RuntimeConfigField[] = [
|
||||
{ group: "shell", path: "tools.exec.allowed_env_keys", kind: "list" },
|
||||
{ group: "shell", path: "tools.exec.allow_patterns", kind: "list" },
|
||||
{ group: "shell", path: "tools.exec.deny_patterns", kind: "list" },
|
||||
{ group: "network", path: "tools.web.proxy", kind: "nullable" },
|
||||
{ group: "proxy", path: "network.proxy", kind: "nullable", manual: true },
|
||||
{ group: "network", path: "tools.web.use_proxy", kind: "boolean" },
|
||||
{ group: "network", path: "tools.web.user_agent", kind: "nullable" },
|
||||
{ group: "safety", path: "tools.restrict_to_workspace", kind: "boolean" },
|
||||
{ group: "safety", path: "tools.webui_allow_remote_package_install", kind: "boolean" },
|
||||
|
||||
@@ -3,22 +3,22 @@ import type { NanobotFeatureInfo } from "@/lib/types";
|
||||
|
||||
export const channelFeatures: Record<string, NanobotFeatureInfo> = {
|
||||
"dingtalk": {"name": "dingtalk","display_name": "DingTalk","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.dingtalk.clientId","field": "clientId","kind": "string","choices": [],"required": true},{"key": "channels.dingtalk.clientSecret","field": "clientSecret","kind": "secret","choices": [],"required": true},{"key": "channels.dingtalk.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.dingtalk.allowRemoteMediaRedirects","field": "allowRemoteMediaRedirects","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.dingtalk.remoteMediaRedirectAllowedHosts","field": "remoteMediaRedirectAllowedHosts","kind": "list","choices": [],"required": false},{"key": "channels.dingtalk.groupUserIsolation","field": "groupUserIsolation","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.dingtalk.disablePrivateChat","field": "disablePrivateChat","kind": "bool","choices": [],"required": false,"default_value": "false"}],"requirements": [{"alternatives": [["channels.dingtalk.clientId"]]},{"alternatives": [["channels.dingtalk.clientSecret"]]}],"official_url": "https://open.dingtalk.com/"}},
|
||||
"discord": {"name": "discord","display_name": "Discord","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.discord.token","field": "token","kind": "secret","choices": [],"required": true},{"key": "channels.discord.proxy","field": "proxy","kind": "string","choices": [],"required": false},{"key": "channels.discord.proxyUsername","field": "proxyUsername","kind": "string","choices": [],"required": false},{"key": "channels.discord.proxyPassword","field": "proxyPassword","kind": "secret","choices": [],"required": false},{"key": "channels.discord.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.discord.allowChannels","field": "allowChannels","kind": "list","choices": [],"required": false},{"key": "channels.discord.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["mention","open"],"required": false,"default_value": "mention"},{"key": "channels.discord.intents","field": "intents","kind": "int","choices": [],"required": false,"default_value": "37377"},{"key": "channels.discord.readReceiptEmoji","field": "readReceiptEmoji","kind": "string","choices": [],"required": false,"default_value": "👀"},{"key": "channels.discord.workingEmoji","field": "workingEmoji","kind": "string","choices": [],"required": false,"default_value": "🔧"},{"key": "channels.discord.workingEmojiDelay","field": "workingEmojiDelay","kind": "float","choices": [],"required": false,"default_value": "2.0"},{"key": "channels.discord.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.discord.replyToMessage","field": "replyToMessage","kind": "bool","choices": [],"required": false,"default_value": "false"}],"requirements": [{"alternatives": [["channels.discord.token"]]}],"official_url": "https://discord.com/developers/applications","verifies_connection": true}},
|
||||
"discord": {"name": "discord","display_name": "Discord","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.discord.token","field": "token","kind": "secret","choices": [],"required": true},{"key": "channels.discord.useProxy","field": "use_proxy","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.discord.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.discord.allowChannels","field": "allowChannels","kind": "list","choices": [],"required": false},{"key": "channels.discord.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["mention","open"],"required": false,"default_value": "mention"},{"key": "channels.discord.intents","field": "intents","kind": "int","choices": [],"required": false,"default_value": "37377"},{"key": "channels.discord.readReceiptEmoji","field": "readReceiptEmoji","kind": "string","choices": [],"required": false,"default_value": "👀"},{"key": "channels.discord.workingEmoji","field": "workingEmoji","kind": "string","choices": [],"required": false,"default_value": "🔧"},{"key": "channels.discord.workingEmojiDelay","field": "workingEmojiDelay","kind": "float","choices": [],"required": false,"default_value": "2.0"},{"key": "channels.discord.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.discord.replyToMessage","field": "replyToMessage","kind": "bool","choices": [],"required": false,"default_value": "false"}],"requirements": [{"alternatives": [["channels.discord.token"]]}],"official_url": "https://discord.com/developers/applications","verifies_connection": true}},
|
||||
"email": {"name": "email","display_name": "Email","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.email.consentGranted","field": "consentGranted","kind": "bool","choices": [],"required": true,"default_value": "false"},{"key": "channels.email.imapHost","field": "imapHost","kind": "string","choices": [],"required": true},{"key": "channels.email.imapPort","field": "imapPort","kind": "int","choices": [],"required": false,"default_value": "993"},{"key": "channels.email.imapUsername","field": "imapUsername","kind": "string","choices": [],"required": true},{"key": "channels.email.imapPassword","field": "imapPassword","kind": "secret","choices": [],"required": true},{"key": "channels.email.smtpHost","field": "smtpHost","kind": "string","choices": [],"required": true},{"key": "channels.email.smtpPort","field": "smtpPort","kind": "int","choices": [],"required": false,"default_value": "587"},{"key": "channels.email.smtpUsername","field": "smtpUsername","kind": "string","choices": [],"required": true},{"key": "channels.email.smtpPassword","field": "smtpPassword","kind": "secret","choices": [],"required": true},{"key": "channels.email.fromAddress","field": "fromAddress","kind": "string","choices": [],"required": false},{"key": "channels.email.pollIntervalSeconds","field": "pollIntervalSeconds","kind": "int","choices": [],"required": false,"default_value": "30"},{"key": "channels.email.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.email.verifyDkim","field": "verifyDkim","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.email.verifySpf","field": "verifySpf","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.email.imapMailbox","field": "imapMailbox","kind": "string","choices": [],"required": false,"default_value": "INBOX"},{"key": "channels.email.imapUseSsl","field": "imapUseSsl","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.email.smtpUseTls","field": "smtpUseTls","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.email.smtpUseSsl","field": "smtpUseSsl","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.email.autoReplyEnabled","field": "autoReplyEnabled","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.email.markSeen","field": "markSeen","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.email.postAction","field": "postAction","kind": "enum","choices": ["delete","move"],"required": false},{"key": "channels.email.postActionMoveMailbox","field": "postActionMoveMailbox","kind": "string","choices": [],"required": false},{"key": "channels.email.postActionExpunge","field": "postActionExpunge","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.email.postActionIgnoreSkipped","field": "postActionIgnoreSkipped","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.email.maxBodyChars","field": "maxBodyChars","kind": "int","choices": [],"required": false,"default_value": "12000"},{"key": "channels.email.subjectPrefix","field": "subjectPrefix","kind": "string","choices": [],"required": false,"default_value": "Re: "},{"key": "channels.email.allowedAttachmentTypes","field": "allowedAttachmentTypes","kind": "list","choices": [],"required": false},{"key": "channels.email.maxAttachmentSize","field": "maxAttachmentSize","kind": "int","choices": [],"required": false,"default_value": "2000000"},{"key": "channels.email.maxAttachmentsPerEmail","field": "maxAttachmentsPerEmail","kind": "int","choices": [],"required": false,"default_value": "5"},{"key": "channels.email.trustedAuthservIds","field": "trustedAuthservIds","kind": "list","choices": [],"required": false}],"requirements": [{"alternatives": [["channels.email.consentGranted"]]},{"alternatives": [["channels.email.imapHost"]]},{"alternatives": [["channels.email.imapUsername"]]},{"alternatives": [["channels.email.imapPassword"]]},{"alternatives": [["channels.email.smtpHost"]]},{"alternatives": [["channels.email.smtpUsername"]]},{"alternatives": [["channels.email.smtpPassword"]]}],"official_url": "https://support.google.com/accounts/answer/185833","verifies_connection": true}},
|
||||
"feishu": {"name": "feishu","display_name": "Feishu","webui": "webui/index.tsx","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.feishu.appId","field": "appId","kind": "string","choices": [],"required": true},{"key": "channels.feishu.appSecret","field": "appSecret","kind": "secret","choices": [],"required": true},{"key": "channels.feishu.domain","field": "domain","kind": "enum","choices": ["feishu","lark"],"required": false,"default_value": "feishu"},{"key": "channels.feishu.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["mention","open"],"required": false,"default_value": "mention"},{"key": "channels.feishu.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.feishu.topicIsolation","field": "topicIsolation","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.feishu.name","field": "name","kind": "string","choices": [],"required": false,"default_value": "nanobot"},{"key": "channels.feishu.encryptKey","field": "encryptKey","kind": "secret","choices": [],"required": false},{"key": "channels.feishu.verificationToken","field": "verificationToken","kind": "secret","choices": [],"required": false},{"key": "channels.feishu.reactEmoji","field": "reactEmoji","kind": "string","choices": [],"required": false,"default_value": "THUMBSUP"},{"key": "channels.feishu.doneEmoji","field": "doneEmoji","kind": "string","choices": [],"required": false},{"key": "channels.feishu.toolHintPrefix","field": "toolHintPrefix","kind": "string","choices": [],"required": false,"default_value": "🔧"},{"key": "channels.feishu.replyToMessage","field": "replyToMessage","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.feishu.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "true"}],"requirements": [{"alternatives": [["channels.feishu.appId"]]},{"alternatives": [["channels.feishu.appSecret"]]}],"official_url": "https://open.feishu.cn/app"}},
|
||||
"linear": {"name": "linear","display_name": "Linear","webui": "webui/index.tsx","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.linear.clientId","field": "clientId","kind": "string","choices": [],"required": true},{"key": "channels.linear.clientSecret","field": "clientSecret","kind": "secret","choices": [],"required": true},{"key": "channels.linear.webhookSigningSecret","field": "webhookSigningSecret","kind": "secret","choices": [],"required": true},{"key": "channels.linear.publicBaseUrl","field": "publicBaseUrl","kind": "string","choices": [],"required": true},{"key": "channels.linear.host","field": "host","kind": "string","choices": [],"required": false,"default_value": "0.0.0.0"},{"key": "channels.linear.port","field": "port","kind": "int","choices": [],"required": false,"default_value": "3979"},{"key": "channels.linear.webhookPath","field": "webhookPath","kind": "string","choices": [],"required": false,"default_value": "/linear/webhook"},{"key": "channels.linear.oauthCallbackPath","field": "oauthCallbackPath","kind": "string","choices": [],"required": false,"default_value": "/linear/oauth/callback"},{"key": "channels.linear.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.linear.showReasoning","field": "showReasoning","kind": "bool","choices": [],"required": false,"default_value": "true"}],"requirements": [{"alternatives": [["channels.linear.clientId"]]},{"alternatives": [["channels.linear.clientSecret"]]},{"alternatives": [["channels.linear.webhookSigningSecret"]]},{"alternatives": [["channels.linear.publicBaseUrl"]]}],"official_url": "https://linear.app/settings/api/applications/new"}},
|
||||
"matrix": {"name": "matrix","display_name": "Matrix","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.matrix.homeserver","field": "homeserver","kind": "string","choices": [],"required": true,"default_value": "https://matrix.org"},{"key": "channels.matrix.userId","field": "userId","kind": "string","choices": [],"required": true},{"key": "channels.matrix.password","field": "password","kind": "secret","choices": [],"required": false},{"key": "channels.matrix.accessToken","field": "accessToken","kind": "secret","choices": [],"required": false},{"key": "channels.matrix.deviceId","field": "deviceId","kind": "string","choices": [],"required": false},{"key": "channels.matrix.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "open"},{"key": "channels.matrix.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.matrix.e2eeEnabled","field": "e2eeEnabled","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.sasVerification","field": "sasVerification","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.syncStopGraceSeconds","field": "syncStopGraceSeconds","kind": "int","choices": [],"required": false,"default_value": "2"},{"key": "channels.matrix.maxMediaBytes","field": "maxMediaBytes","kind": "int","choices": [],"required": false,"default_value": "20971520"},{"key": "channels.matrix.maxConcurrentMediaDownloads","field": "maxConcurrentMediaDownloads","kind": "int","choices": [],"required": false,"default_value": "2"},{"key": "channels.matrix.groupAllowFrom","field": "groupAllowFrom","kind": "list","choices": [],"required": false},{"key": "channels.matrix.allowRoomMentions","field": "allowRoomMentions","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.proxy","field": "proxy","kind": "string","choices": [],"required": false}],"requirements": [{"alternatives": [["channels.matrix.homeserver"]]},{"alternatives": [["channels.matrix.userId"]]},{"alternatives": [["channels.matrix.password"],["channels.matrix.accessToken","channels.matrix.deviceId"]]}],"official_url": "https://matrix.org/ecosystem/clients/"}},
|
||||
"matrix": {"name": "matrix","display_name": "Matrix","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.matrix.homeserver","field": "homeserver","kind": "string","choices": [],"required": true,"default_value": "https://matrix.org"},{"key": "channels.matrix.userId","field": "userId","kind": "string","choices": [],"required": true},{"key": "channels.matrix.password","field": "password","kind": "secret","choices": [],"required": false},{"key": "channels.matrix.accessToken","field": "accessToken","kind": "secret","choices": [],"required": false},{"key": "channels.matrix.deviceId","field": "deviceId","kind": "string","choices": [],"required": false},{"key": "channels.matrix.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "open"},{"key": "channels.matrix.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.matrix.e2eeEnabled","field": "e2eeEnabled","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.sasVerification","field": "sasVerification","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.syncStopGraceSeconds","field": "syncStopGraceSeconds","kind": "int","choices": [],"required": false,"default_value": "2"},{"key": "channels.matrix.maxMediaBytes","field": "maxMediaBytes","kind": "int","choices": [],"required": false,"default_value": "20971520"},{"key": "channels.matrix.maxConcurrentMediaDownloads","field": "maxConcurrentMediaDownloads","kind": "int","choices": [],"required": false,"default_value": "2"},{"key": "channels.matrix.groupAllowFrom","field": "groupAllowFrom","kind": "list","choices": [],"required": false},{"key": "channels.matrix.allowRoomMentions","field": "allowRoomMentions","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.matrix.useProxy","field": "use_proxy","kind": "bool","choices": [],"required": false,"default_value": "false"}],"requirements": [{"alternatives": [["channels.matrix.homeserver"]]},{"alternatives": [["channels.matrix.userId"]]},{"alternatives": [["channels.matrix.password"],["channels.matrix.accessToken","channels.matrix.deviceId"]]}],"official_url": "https://matrix.org/ecosystem/clients/"}},
|
||||
"mattermost": {"name": "mattermost","display_name": "Mattermost","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.mattermost.serverUrl","field": "serverUrl","kind": "string","choices": [],"required": true},{"key": "channels.mattermost.token","field": "token","kind": "secret","choices": [],"required": true},{"key": "channels.mattermost.teamId","field": "teamId","kind": "string","choices": [],"required": false},{"key": "channels.mattermost.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "mention"},{"key": "channels.mattermost.groupPolicyInThread","field": "groupPolicyInThread","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "mention"},{"key": "channels.mattermost.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.mattermost.allowFromMatchMode","field": "allowFromMatchMode","kind": "enum","choices": ["email","id","username"],"required": false,"default_value": "id"},{"key": "channels.mattermost.groupAllowFrom","field": "groupAllowFrom","kind": "list","choices": [],"required": false},{"key": "channels.mattermost.replyInThread","field": "replyInThread","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.mattermost.includeThreadContext","field": "includeThreadContext","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.mattermost.threadContextLimit","field": "threadContextLimit","kind": "int","choices": [],"required": false,"default_value": "20"},{"key": "channels.mattermost.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.mattermost.reactEmoji","field": "reactEmoji","kind": "string","choices": [],"required": false,"default_value": "eyes"},{"key": "channels.mattermost.doneEmoji","field": "doneEmoji","kind": "string","choices": [],"required": false,"default_value": "white_check_mark"},{"key": "channels.mattermost.sendProgress","field": "sendProgress","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.mattermost.sendToolHints","field": "sendToolHints","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.mattermost.dm.enabled","field": "dm.enabled","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.mattermost.dm.policy","field": "dm.policy","kind": "enum","choices": ["allowlist","open"],"required": false,"default_value": "open"},{"key": "channels.mattermost.dm.allowFrom","field": "dm.allowFrom","kind": "list","choices": [],"required": false}],"requirements": [{"alternatives": [["channels.mattermost.serverUrl"]]},{"alternatives": [["channels.mattermost.token"]]}],"official_url": "https://developers.mattermost.com/integrate/reference/bot-accounts/"}},
|
||||
"mochat": {"name": "mochat","display_name": "MoChat","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.mochat.baseUrl","field": "baseUrl","kind": "string","choices": [],"required": false,"default_value": "https://mochat.io"},{"key": "channels.mochat.clawToken","field": "clawToken","kind": "secret","choices": [],"required": true},{"key": "channels.mochat.agentUserId","field": "agentUserId","kind": "string","choices": [],"required": false},{"key": "channels.mochat.sessions","field": "sessions","kind": "list","choices": [],"required": false},{"key": "channels.mochat.panels","field": "panels","kind": "list","choices": [],"required": false},{"key": "channels.mochat.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.mochat.socketUrl","field": "socketUrl","kind": "string","choices": [],"required": false},{"key": "channels.mochat.socketPath","field": "socketPath","kind": "string","choices": [],"required": false,"default_value": "/socket.io"},{"key": "channels.mochat.socketDisableMsgpack","field": "socketDisableMsgpack","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.mochat.socketReconnectDelayMs","field": "socketReconnectDelayMs","kind": "int","choices": [],"required": false,"default_value": "1000"},{"key": "channels.mochat.socketMaxReconnectDelayMs","field": "socketMaxReconnectDelayMs","kind": "int","choices": [],"required": false,"default_value": "10000"},{"key": "channels.mochat.socketConnectTimeoutMs","field": "socketConnectTimeoutMs","kind": "int","choices": [],"required": false,"default_value": "10000"},{"key": "channels.mochat.refreshIntervalMs","field": "refreshIntervalMs","kind": "int","choices": [],"required": false,"default_value": "30000"},{"key": "channels.mochat.watchTimeoutMs","field": "watchTimeoutMs","kind": "int","choices": [],"required": false,"default_value": "25000"},{"key": "channels.mochat.watchLimit","field": "watchLimit","kind": "int","choices": [],"required": false,"default_value": "100"},{"key": "channels.mochat.retryDelayMs","field": "retryDelayMs","kind": "int","choices": [],"required": false,"default_value": "500"},{"key": "channels.mochat.maxRetryAttempts","field": "maxRetryAttempts","kind": "int","choices": [],"required": false,"default_value": "0"},{"key": "channels.mochat.mention.requireInGroups","field": "mention.requireInGroups","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.mochat.groups","field": "groups","kind": "json","choices": [],"required": false,"default_value": "{}"},{"key": "channels.mochat.replyDelayMode","field": "replyDelayMode","kind": "string","choices": [],"required": false,"default_value": "non-mention"},{"key": "channels.mochat.replyDelayMs","field": "replyDelayMs","kind": "int","choices": [],"required": false,"default_value": "120000"}],"requirements": [{"alternatives": [["channels.mochat.clawToken"]]}],"official_url": "https://mochat.io/"}},
|
||||
"msteams": {"name": "msteams","display_name": "Microsoft Teams","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.msteams.appId","field": "appId","kind": "string","choices": [],"required": true},{"key": "channels.msteams.appPassword","field": "appPassword","kind": "secret","choices": [],"required": true},{"key": "channels.msteams.tenantId","field": "tenantId","kind": "string","choices": [],"required": false},{"key": "channels.msteams.path","field": "path","kind": "string","choices": [],"required": false,"default_value": "/api/messages"},{"key": "channels.msteams.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.msteams.host","field": "host","kind": "string","choices": [],"required": false,"default_value": "0.0.0.0"},{"key": "channels.msteams.port","field": "port","kind": "int","choices": [],"required": false,"default_value": "3978"},{"key": "channels.msteams.replyInThread","field": "replyInThread","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.msteams.mentionOnlyResponse","field": "mentionOnlyResponse","kind": "string","choices": [],"required": false,"default_value": "Hi — what can I help with?"},{"key": "channels.msteams.validateInboundAuth","field": "validateInboundAuth","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.msteams.refTtlDays","field": "refTtlDays","kind": "int","choices": [],"required": false,"default_value": "30"},{"key": "channels.msteams.pruneWebChatRefs","field": "pruneWebChatRefs","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.msteams.pruneNonPersonalRefs","field": "pruneNonPersonalRefs","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.msteams.refTouchIntervalS","field": "refTouchIntervalS","kind": "int","choices": [],"required": false,"default_value": "300"},{"key": "channels.msteams.trustedServiceUrlHosts","field": "trustedServiceUrlHosts","kind": "list","choices": [],"required": false}],"requirements": [{"alternatives": [["channels.msteams.appId"]]},{"alternatives": [["channels.msteams.appPassword"]]}],"official_url": "https://dev.teams.microsoft.com/apps"}},
|
||||
"napcat": {"name": "napcat","display_name": "NapCat","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.napcat.wsUrl","field": "wsUrl","kind": "string","choices": [],"required": true,"default_value": "ws://127.0.0.1:3001"},{"key": "channels.napcat.accessToken","field": "accessToken","kind": "secret","choices": [],"required": false},{"key": "channels.napcat.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.napcat.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["mention","open"],"required": false,"default_value": "mention"},{"key": "channels.napcat.groupPolicyOverrides","field": "groupPolicyOverrides","kind": "json","choices": [],"required": false,"default_value": "{}"},{"key": "channels.napcat.welcomeNewMembers","field": "welcomeNewMembers","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.napcat.maxImageBytes","field": "maxImageBytes","kind": "int","choices": [],"required": false,"default_value": "20971520"}],"requirements": [{"alternatives": [["channels.napcat.wsUrl"]]}],"official_url": "https://napneko.github.io/"}},
|
||||
"qq": {"name": "qq","display_name": "QQ","webui": "webui/index.tsx","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.qq.appId","field": "appId","kind": "string","choices": [],"required": true},{"key": "channels.qq.secret","field": "secret","kind": "secret","choices": [],"required": true},{"key": "channels.qq.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.qq.msgFormat","field": "msgFormat","kind": "enum","choices": ["markdown","plain"],"required": false,"default_value": "plain"},{"key": "channels.qq.ackMessage","field": "ackMessage","kind": "string","choices": [],"required": false,"default_value": "⏳ Processing..."},{"key": "channels.qq.showCompactionNotices","field": "showCompactionNotices","kind": "bool","choices": [],"required": false,"inheritable": true},{"key": "channels.qq.mediaDir","field": "mediaDir","kind": "string","choices": [],"required": false},{"key": "channels.qq.downloadChunkSize","field": "downloadChunkSize","kind": "int","choices": [],"required": false,"default_value": "262144"},{"key": "channels.qq.downloadMaxBytes","field": "downloadMaxBytes","kind": "int","choices": [],"required": false,"default_value": "209715200"}],"requirements": [{"alternatives": [["channels.qq.appId"]]},{"alternatives": [["channels.qq.secret"]]}],"official_url": "https://q.qq.com/"}},
|
||||
"signal": {"name": "signal","display_name": "Signal","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.signal.phoneNumber","field": "phoneNumber","kind": "string","choices": [],"required": true},{"key": "channels.signal.daemonHost","field": "daemonHost","kind": "string","choices": [],"required": false,"default_value": "localhost"},{"key": "channels.signal.daemonPort","field": "daemonPort","kind": "int","choices": [],"required": false,"default_value": "8080"},{"key": "channels.signal.dm.allowFrom","field": "dm.allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.signal.group.allowFrom","field": "group.allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.signal.groupMessageBufferSize","field": "groupMessageBufferSize","kind": "int","choices": [],"required": false,"default_value": "20"},{"key": "channels.signal.attachmentsDir","field": "attachmentsDir","kind": "string","choices": [],"required": false},{"key": "channels.signal.dm.enabled","field": "dm.enabled","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.signal.dm.policy","field": "dm.policy","kind": "enum","choices": ["allowlist","open"],"required": false,"default_value": "allowlist"},{"key": "channels.signal.group.enabled","field": "group.enabled","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.signal.group.policy","field": "group.policy","kind": "enum","choices": ["allowlist","open"],"required": false,"default_value": "allowlist"},{"key": "channels.signal.group.requireMention","field": "group.requireMention","kind": "bool","choices": [],"required": false,"default_value": "true"}],"requirements": [{"alternatives": [["channels.signal.phoneNumber"]]}],"official_url": "https://github.com/bbernhard/signal-cli-rest-api"}},
|
||||
"slack": {"name": "slack","display_name": "Slack","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.slack.appToken","field": "appToken","kind": "secret","choices": [],"required": true},{"key": "channels.slack.botToken","field": "botToken","kind": "secret","choices": [],"required": true},{"key": "channels.slack.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "mention"},{"key": "channels.slack.mode","field": "mode","kind": "enum","choices": ["socket"],"required": false,"default_value": "socket"},{"key": "channels.slack.webhookPath","field": "webhookPath","kind": "string","choices": [],"required": false,"default_value": "/slack/events"},{"key": "channels.slack.replyInThread","field": "replyInThread","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.slack.reactEmoji","field": "reactEmoji","kind": "string","choices": [],"required": false,"default_value": "eyes"},{"key": "channels.slack.doneEmoji","field": "doneEmoji","kind": "string","choices": [],"required": false,"default_value": "white_check_mark"},{"key": "channels.slack.includeThreadContext","field": "includeThreadContext","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.slack.threadContextLimit","field": "threadContextLimit","kind": "int","choices": [],"required": false,"default_value": "20"},{"key": "channels.slack.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.slack.groupAllowFrom","field": "groupAllowFrom","kind": "list","choices": [],"required": false},{"key": "channels.slack.groupRequireMention","field": "groupRequireMention","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.slack.dm.enabled","field": "dm.enabled","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.slack.dm.policy","field": "dm.policy","kind": "enum","choices": ["allowlist","open"],"required": false,"default_value": "open"},{"key": "channels.slack.dm.allowFrom","field": "dm.allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.slack.proxy","field": "proxy","kind": "string","choices": [],"required": false}],"requirements": [{"alternatives": [["channels.slack.appToken"]]},{"alternatives": [["channels.slack.botToken"]]}],"official_url": "https://api.slack.com/apps","verifies_connection": true}},
|
||||
"telegram": {"name": "telegram","display_name": "Telegram","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.telegram.token","field": "token","kind": "secret","choices": [],"required": true},{"key": "channels.telegram.proxy","field": "proxy","kind": "string","choices": [],"required": false},{"key": "channels.telegram.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.telegram.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "mention"},{"key": "channels.telegram.mode","field": "mode","kind": "enum","choices": ["polling","webhook"],"required": false,"default_value": "polling"},{"key": "channels.telegram.replyToMessage","field": "replyToMessage","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.telegram.reactEmoji","field": "reactEmoji","kind": "string","choices": [],"required": false,"default_value": "👀"},{"key": "channels.telegram.connectionPoolSize","field": "connectionPoolSize","kind": "int","choices": [],"required": false,"default_value": "32"},{"key": "channels.telegram.poolTimeout","field": "poolTimeout","kind": "float","choices": [],"required": false,"default_value": "5.0"},{"key": "channels.telegram.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.telegram.inlineKeyboards","field": "inlineKeyboards","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.telegram.richMessages","field": "richMessages","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.telegram.streamEditInterval","field": "streamEditInterval","kind": "float","choices": [],"required": false,"default_value": "0.6"},{"key": "channels.telegram.webhookUrl","field": "webhookUrl","kind": "string","choices": [],"required": false},{"key": "channels.telegram.webhookListenHost","field": "webhookListenHost","kind": "string","choices": [],"required": false,"default_value": "127.0.0.1"},{"key": "channels.telegram.webhookListenPort","field": "webhookListenPort","kind": "int","choices": [],"required": false,"default_value": "8081"},{"key": "channels.telegram.webhookPath","field": "webhookPath","kind": "string","choices": [],"required": false,"default_value": "/telegram"},{"key": "channels.telegram.webhookSecretToken","field": "webhookSecretToken","kind": "secret","choices": [],"required": false},{"key": "channels.telegram.webhookMaxConnections","field": "webhookMaxConnections","kind": "int","choices": [],"required": false,"default_value": "4"}],"requirements": [{"alternatives": [["channels.telegram.token"]]}],"official_url": "https://t.me/BotFather","verifies_connection": true}},
|
||||
"slack": {"name": "slack","display_name": "Slack","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.slack.appToken","field": "appToken","kind": "secret","choices": [],"required": true},{"key": "channels.slack.botToken","field": "botToken","kind": "secret","choices": [],"required": true},{"key": "channels.slack.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "mention"},{"key": "channels.slack.mode","field": "mode","kind": "enum","choices": ["socket"],"required": false,"default_value": "socket"},{"key": "channels.slack.webhookPath","field": "webhookPath","kind": "string","choices": [],"required": false,"default_value": "/slack/events"},{"key": "channels.slack.replyInThread","field": "replyInThread","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.slack.reactEmoji","field": "reactEmoji","kind": "string","choices": [],"required": false,"default_value": "eyes"},{"key": "channels.slack.doneEmoji","field": "doneEmoji","kind": "string","choices": [],"required": false,"default_value": "white_check_mark"},{"key": "channels.slack.includeThreadContext","field": "includeThreadContext","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.slack.threadContextLimit","field": "threadContextLimit","kind": "int","choices": [],"required": false,"default_value": "20"},{"key": "channels.slack.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.slack.groupAllowFrom","field": "groupAllowFrom","kind": "list","choices": [],"required": false},{"key": "channels.slack.groupRequireMention","field": "groupRequireMention","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.slack.dm.enabled","field": "dm.enabled","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.slack.dm.policy","field": "dm.policy","kind": "enum","choices": ["allowlist","open"],"required": false,"default_value": "open"},{"key": "channels.slack.dm.allowFrom","field": "dm.allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.slack.useProxy","field": "use_proxy","kind": "bool","choices": [],"required": false,"default_value": "false"}],"requirements": [{"alternatives": [["channels.slack.appToken"]]},{"alternatives": [["channels.slack.botToken"]]}],"official_url": "https://api.slack.com/apps","verifies_connection": true}},
|
||||
"telegram": {"name": "telegram","display_name": "Telegram","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.telegram.token","field": "token","kind": "secret","choices": [],"required": true},{"key": "channels.telegram.useProxy","field": "use_proxy","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.telegram.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.telegram.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["allowlist","mention","open"],"required": false,"default_value": "mention"},{"key": "channels.telegram.mode","field": "mode","kind": "enum","choices": ["polling","webhook"],"required": false,"default_value": "polling"},{"key": "channels.telegram.replyToMessage","field": "replyToMessage","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.telegram.reactEmoji","field": "reactEmoji","kind": "string","choices": [],"required": false,"default_value": "👀"},{"key": "channels.telegram.connectionPoolSize","field": "connectionPoolSize","kind": "int","choices": [],"required": false,"default_value": "32"},{"key": "channels.telegram.poolTimeout","field": "poolTimeout","kind": "float","choices": [],"required": false,"default_value": "5.0"},{"key": "channels.telegram.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.telegram.inlineKeyboards","field": "inlineKeyboards","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.telegram.richMessages","field": "richMessages","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.telegram.streamEditInterval","field": "streamEditInterval","kind": "float","choices": [],"required": false,"default_value": "0.6"},{"key": "channels.telegram.webhookUrl","field": "webhookUrl","kind": "string","choices": [],"required": false},{"key": "channels.telegram.webhookListenHost","field": "webhookListenHost","kind": "string","choices": [],"required": false,"default_value": "127.0.0.1"},{"key": "channels.telegram.webhookListenPort","field": "webhookListenPort","kind": "int","choices": [],"required": false,"default_value": "8081"},{"key": "channels.telegram.webhookPath","field": "webhookPath","kind": "string","choices": [],"required": false,"default_value": "/telegram"},{"key": "channels.telegram.webhookSecretToken","field": "webhookSecretToken","kind": "secret","choices": [],"required": false},{"key": "channels.telegram.webhookMaxConnections","field": "webhookMaxConnections","kind": "int","choices": [],"required": false,"default_value": "4"}],"requirements": [{"alternatives": [["channels.telegram.token"]]}],"official_url": "https://t.me/BotFather","verifies_connection": true}},
|
||||
"websocket": {"name": "websocket","display_name": "WebSocket","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [],"requirements": [],"official_url": "http://127.0.0.1:8765"}},
|
||||
"wecom": {"name": "wecom","display_name": "WeCom","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.wecom.botId","field": "botId","kind": "string","choices": [],"required": true},{"key": "channels.wecom.secret","field": "secret","kind": "secret","choices": [],"required": true},{"key": "channels.wecom.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.wecom.welcomeMessage","field": "welcomeMessage","kind": "string","choices": [],"required": false}],"requirements": [{"alternatives": [["channels.wecom.botId"]]},{"alternatives": [["channels.wecom.secret"]]}],"official_url": "https://developer.work.weixin.qq.com/"}},
|
||||
"weixin": {"name": "weixin","display_name": "WeChat","webui": "webui/index.tsx","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.weixin.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.weixin.baseUrl","field": "baseUrl","kind": "string","choices": [],"required": false,"default_value": "https://ilinkai.weixin.qq.com"},{"key": "channels.weixin.cdnBaseUrl","field": "cdnBaseUrl","kind": "string","choices": [],"required": false,"default_value": "https://novac2c.cdn.weixin.qq.com/c2c"},{"key": "channels.weixin.routeTag","field": "routeTag","kind": "string","choices": [],"required": false},{"key": "channels.weixin.stateDir","field": "stateDir","kind": "string","choices": [],"required": false},{"key": "channels.weixin.pollTimeout","field": "pollTimeout","kind": "int","choices": [],"required": false,"default_value": "35"},{"key": "channels.weixin.sendProgress","field": "sendProgress","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.weixin.sendToolHints","field": "sendToolHints","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.weixin.replyProgressMessages","field": "replyProgressMessages","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.weixin.replyProgressMaxMessages","field": "replyProgressMaxMessages","kind": "int","choices": [],"required": false,"default_value": "2"},{"key": "channels.weixin.contextMessageBudget","field": "contextMessageBudget","kind": "int","choices": [],"required": false,"default_value": "8"},{"key": "channels.weixin.streaming","field": "streaming","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.weixin.blockStreaming","field": "blockStreaming","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.weixin.blockStreamingMinChars","field": "blockStreamingMinChars","kind": "int","choices": [],"required": false,"default_value": "1200"},{"key": "channels.weixin.blockStreamingMaxMessages","field": "blockStreamingMaxMessages","kind": "int","choices": [],"required": false,"default_value": "3"}],"requirements": [{"alternatives": [["channels.weixin.token"]]}],"official_url": "https://weixin.qq.com/"}},
|
||||
"whatsapp": {"name": "whatsapp","display_name": "WhatsApp","webui": "webui/index.tsx","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.whatsapp.proxy","field": "proxy","kind": "string","choices": [],"required": false},{"key": "channels.whatsapp.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.whatsapp.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["mention","open"],"required": false,"default_value": "open"}],"requirements": [],"official_url": "https://faq.whatsapp.com/"}},
|
||||
"whatsapp": {"name": "whatsapp","display_name": "WhatsApp","webui": "webui/index.tsx","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.whatsapp.useProxy","field": "use_proxy","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.whatsapp.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.whatsapp.groupPolicy","field": "groupPolicy","kind": "enum","choices": ["mention","open"],"required": false,"default_value": "open"}],"requirements": [],"official_url": "https://faq.whatsapp.com/"}},
|
||||
"whatsapp_agent": {"name": "whatsapp_agent","display_name": "WhatsApp Agent Platform","webui": "webui/index.ts","type": "channel","enabled": false,"installed": true,"configured": false,"ready": false,"status": "not_enabled","install_supported": true,"requires_restart": false,"runtime_status": "stopped","config_values": {},"configured_fields": [],"setup": {"fields": [{"key": "channels.whatsapp_agent.token","field": "token","kind": "secret","choices": [],"required": true},{"key": "channels.whatsapp_agent.allowFrom","field": "allowFrom","kind": "list","choices": [],"required": false},{"key": "channels.whatsapp_agent.stateDir","field": "stateDir","kind": "string","choices": [],"required": false},{"key": "channels.whatsapp_agent.pollTimeout","field": "pollTimeout","kind": "int","choices": [],"required": false,"default_value": "25"},{"key": "channels.whatsapp_agent.markRead","field": "markRead","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.whatsapp_agent.typingIndicator","field": "typingIndicator","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.whatsapp_agent.downloadMedia","field": "downloadMedia","kind": "bool","choices": [],"required": false,"default_value": "true"},{"key": "channels.whatsapp_agent.deleteMediaAfterDownload","field": "deleteMediaAfterDownload","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.whatsapp_agent.maxMediaMb","field": "maxMediaMb","kind": "int","choices": [],"required": false,"default_value": "16"},{"key": "channels.whatsapp_agent.retryAmbiguousSends","field": "retryAmbiguousSends","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.whatsapp_agent.sendProgress","field": "sendProgress","kind": "bool","choices": [],"required": false,"default_value": "false"},{"key": "channels.whatsapp_agent.sendToolHints","field": "sendToolHints","kind": "bool","choices": [],"required": false,"default_value": "false"}],"requirements": [{"alternatives": [["channels.whatsapp_agent.token"]]}],"official_url": "https://faq.whatsapp.com/1050934623978152","verifies_connection": true}},
|
||||
};
|
||||
@@ -14,8 +14,8 @@ type ProviderRow = SettingsPayload["providers"][number];
|
||||
const previewProviders: ProviderRow[] = [
|
||||
{ name: "custom", label: "Custom", configured: true, auth_type: "api_key", api_key_hint: "••••••••", api_base: "https://api.example.com/v1" },
|
||||
{ name: "anthropic", label: "Anthropic", configured: true, auth_type: "api_key", api_key_hint: "••••••••", api_base: "https://api.anthropic.com", request_apis: ["anthropic_messages"] },
|
||||
{ name: "openai_codex", label: "OpenAI Codex", configured: true, auth_type: "oauth", api_key_required: false, oauth_login_supported: true, advanced_fields: ["proxy", "extra_body"] },
|
||||
{ name: "xai_grok", label: "xAI Grok", configured: true, auth_type: "oauth", api_key_required: false, oauth_login_supported: true, advanced_fields: ["proxy", "extra_body"] },
|
||||
{ name: "openai_codex", label: "OpenAI Codex", configured: true, auth_type: "oauth", api_key_required: false, oauth_login_supported: true, advanced_fields: ["use_proxy", "extra_body"] },
|
||||
{ name: "xai_grok", label: "xAI Grok", configured: true, auth_type: "oauth", api_key_required: false, oauth_login_supported: true, advanced_fields: ["use_proxy", "extra_body"] },
|
||||
{ name: "deepseek", label: "DeepSeek", configured: true, auth_type: "api_key", api_key_hint: "••••••••", api_base: "https://api.deepseek.com" },
|
||||
{ name: "zhipu", label: "Zhipu AI", configured: true, auth_type: "api_key", api_key_hint: "••••••••", api_base: "https://open.bigmodel.cn/api/paas/v4" },
|
||||
{ name: "minimax", label: "MiniMax", configured: true, auth_type: "api_key", api_key_hint: "••••••••", api_base: "https://api.minimax.io/v1" },
|
||||
@@ -44,7 +44,7 @@ function providerValues(form: ProviderForm) {
|
||||
api_base: form.apiBase.trim() || null,
|
||||
api: form.api,
|
||||
api_key_hint: form.apiKey.trim() ? "••••••••" : undefined,
|
||||
proxy: form.proxy.trim() || null,
|
||||
use_proxy: form.useProxy,
|
||||
extra_headers: extraHeaders,
|
||||
extra_query: extraQuery,
|
||||
extra_body: extraBody,
|
||||
@@ -101,7 +101,7 @@ function ProvidersPreview() {
|
||||
const name = `custom_preview_${nextCustomId.current++}`;
|
||||
const row: ProviderRow = { ...values, name, label: form.name.trim(), is_custom: true,
|
||||
configured: true, auth_type: "api_key", api_key_required: false, provider_api_configurable: true,
|
||||
advanced_fields: ["extra_headers", "extra_body", "extra_query", "proxy", "thinking_style"] };
|
||||
advanced_fields: ["extra_headers", "extra_body", "extra_query", "use_proxy", "thinking_style"] };
|
||||
const next: SettingsPayload = { ...payload, providers: [...payload.providers, row], created_provider: name };
|
||||
setPayload(next);
|
||||
setDrafts((current) => ({ ...current, [name]: providerFormFromRow(row) }));
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "Your changes are saved. Restart to apply them.",
|
||||
"later": "Restart later"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "Use proxy",
|
||||
"useProxyHelp": "Uses the shared proxy in Advanced.",
|
||||
"configureProxy": "Configure proxy",
|
||||
"sharedProxyScope": "Shared by all features with proxy enabled.",
|
||||
"authentication": "Authentication (optional)",
|
||||
"username": "Username",
|
||||
"password": "Password",
|
||||
"proxyReferenceAuth": "Set authentication in the referenced proxy URL."
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "Saved. Restart the API service to apply changes.",
|
||||
"commandRuntime": {
|
||||
@@ -609,9 +619,13 @@
|
||||
"label": "Blocked commands",
|
||||
"help": "Block commands that match these rules.\n\nOne regular expression per line, checked alongside built-in deny rules. Commands that fully match allow rules skip these checks."
|
||||
},
|
||||
"tools_web_proxy": {
|
||||
"label": "Web proxy",
|
||||
"help": "Used for the agent's web search and page reading. Leave blank to use the default network settings, including proxy environment variables.\n\n127.0.0.1 refers to the machine that runs nanobot. This setting does not change model, MCP, or browser connections."
|
||||
"network_proxy": {
|
||||
"label": "Shared proxy",
|
||||
"help": "Address used by features with Use proxy enabled. 127.0.0.1 is the machine running nanobot."
|
||||
},
|
||||
"tools_web_use_proxy": {
|
||||
"label": "Use proxy",
|
||||
"help": "Use the shared proxy for web search and page reading."
|
||||
},
|
||||
"tools_web_user_agent": {
|
||||
"label": "User agent",
|
||||
@@ -699,9 +713,13 @@
|
||||
"title": "Shell and sandbox",
|
||||
"help": "Set command timeouts, environment, and access rules."
|
||||
},
|
||||
"proxy": {
|
||||
"title": "Shared proxy",
|
||||
"help": "Set one address for features that use a proxy."
|
||||
},
|
||||
"network": {
|
||||
"title": "Web connections",
|
||||
"help": "Set the proxy and User-Agent.\n\nSet the proxy and User-Agent header for web requests."
|
||||
"help": "Set the proxy preference and User-Agent for web requests."
|
||||
},
|
||||
"safety": {
|
||||
"title": "Global permissions",
|
||||
@@ -1379,7 +1397,6 @@
|
||||
"defaultAPIDescription": "Presets set to Auto use this API. A preset can choose another API from the supported list.",
|
||||
"declareAPIs": "Set supported APIs",
|
||||
"openaiDefaultAPIDescription": "Sets the default API for presets using Auto. Auto here follows known model rules. Individual presets can override this choice.",
|
||||
"proxy": "Network proxy",
|
||||
"thinkingStyle": "Reasoning format",
|
||||
"region": "Region",
|
||||
"profile": "AWS profile",
|
||||
@@ -1788,9 +1805,6 @@
|
||||
"signInBeforeSaving": "Sign in before saving this provider in the preset.",
|
||||
"signedIn": "Signed in",
|
||||
"notSignedIn": "Not signed in",
|
||||
"proxyLabel": "Network proxy",
|
||||
"proxySaveBeforeSignIn": "Save proxy changes before signing in.",
|
||||
"saveProxy": "Save proxy",
|
||||
"localCodeHelp": "Complete sign-in in your browser. If nanobot does not connect automatically, paste the authorization code below.",
|
||||
"remoteCodeHelp": "Select Sign in to open xAI on your computer. After signing in, paste the authorization code shown by xAI below.",
|
||||
"localCallbackHelp": "Complete sign-in in your browser. If nanobot does not connect automatically, copy the full localhost callback URL from the address bar and paste it below.",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "Los cambios están guardados. Reinicia para aplicarlos.",
|
||||
"later": "Reiniciar más tarde"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "Usar proxy",
|
||||
"useProxyHelp": "Usa el proxy compartido de los ajustes avanzados.",
|
||||
"configureProxy": "Configurar proxy",
|
||||
"sharedProxyScope": "Se comparte entre las funciones con el proxy activado.",
|
||||
"authentication": "Autenticación (opcional)",
|
||||
"username": "Usuario",
|
||||
"password": "Contraseña",
|
||||
"proxyReferenceAuth": "Configura la autenticación en la URL del proxy referenciada."
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "Guardado. Reinicia el servicio API para aplicar los cambios.",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "Variables de entorno", "help": "Variables adicionales para los comandos, un nombre por línea.\n\nVariables adicionales que se pasan a los comandos, una por línea. Las variables básicas necesarias siguen disponibles."},
|
||||
"tools_exec_allow_patterns": {"label": "Comandos permitidos", "help": "Ejecuta solo comandos que coincidan por completo con las reglas permitidas.\n\nUna expresión regular por línea. Si añades reglas, cada segmento del comando debe coincidir por completo con alguna de ellas. Los comandos permitidos omiten las reglas de bloqueo integradas y personalizadas, pero mantienen las restricciones de red y del espacio de trabajo."},
|
||||
"tools_exec_deny_patterns": {"label": "Comandos bloqueados", "help": "Bloquea los comandos que coincidan con estas reglas.\n\nExpresiones regulares de bloqueo adicionales, una por línea. Las reglas de permiso explícitas tienen prioridad sobre las reglas de bloqueo integradas y personalizadas."},
|
||||
"tools_web_proxy": {"label": "Proxy web", "help": "Se usa para las búsquedas web y la lectura de páginas del agente. Déjalo vacío para usar la red predeterminada, incluidas las variables de entorno del proxy.\n\n127.0.0.1 es el equipo que ejecuta nanobot. Este ajuste no cambia las conexiones de modelos, MCP ni del navegador."},
|
||||
"network_proxy": {"label": "Proxy compartido", "help": "Dirección usada por las funciones con el proxy activado. 127.0.0.1 es el equipo que ejecuta nanobot."},
|
||||
"tools_web_use_proxy": {"label": "Usar proxy", "help": "Usa el proxy compartido para buscar en la web y leer páginas."},
|
||||
"tools_web_user_agent": {"label": "Cabecera User-Agent", "help": "User-Agent para solicitudes web; en blanco usa el predeterminado.\n\nCabecera User-Agent personalizada. Déjalo vacío para usar el valor predeterminado."},
|
||||
"tools_restrict_to_workspace": {"label": "Restricción del espacio", "help": "Límites globales del espacio; los permisos de chats WebUI se ajustan aparte.\n\nPolítica global de herramientas. Los permisos de cada conversación WebUI se configuran por separado."},
|
||||
"tools_ssrf_whitelist": {"label": "IP permitidas", "help": "IP o rangos CIDR permitidos, uno por línea.\n\nDirecciones IP o rangos CIDR exentos de la protección de solicitudes salientes, uno por línea."},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "Conversaciones", "help": "Configura chats compartidos entre plataformas."},
|
||||
"tools": {"title": "Herramientas integradas", "help": "Elige las herramientas que puede usar el agente."},
|
||||
"shell": {"title": "Shell y entorno aislado", "help": "Configura los tiempos límite, el entorno y las reglas de acceso."},
|
||||
"network": {"title": "Conexiones web", "help": "Configura el proxy y User-Agent.\n\nProxy e identificación de las solicitudes web."},
|
||||
"proxy": {"title": "Proxy compartido", "help": "Define una dirección para las funciones que usan proxy."},
|
||||
"network": {"title": "Conexiones web", "help": "Configura el uso de proxy y el User-Agent de las solicitudes web."},
|
||||
"safety": {"title": "Permisos globales", "help": "Configura límites del espacio, excepciones de red e instalaciones remotas.\n\nRestricciones del espacio de trabajo, redes privadas e instalaciones remotas."},
|
||||
"cli": {"title": "Límites CLI", "help": "Configura tiempos límite de instalación y ejecución y la duración de caché.\n\nTiempos de instalación, ejecución y caché del catálogo."},
|
||||
"gateway": {"title": "Puerta de enlace", "help": "Configura el despliegue y el reinicio."},
|
||||
@@ -949,7 +961,6 @@
|
||||
"defaultAPIDescription": "Los preajustes configurados en Auto usan esta API. Cada preajuste puede elegir otra API de la lista de API compatibles.",
|
||||
"declareAPIs": "Configurar API compatibles",
|
||||
"openaiDefaultAPIDescription": "Define la API predeterminada para los preajustes que usan Auto. Aquí, Auto sigue las reglas conocidas del modelo. Cada preajuste puede cambiar esta elección.",
|
||||
"proxy": "Proxy de red",
|
||||
"thinkingStyle": "Formato de razonamiento",
|
||||
"region": "Región",
|
||||
"profile": "Perfil de AWS",
|
||||
@@ -1589,9 +1600,6 @@
|
||||
"signInBeforeSaving": "Inicia sesión en este proveedor antes de guardar el preajuste.",
|
||||
"signedIn": "Sesión iniciada",
|
||||
"notSignedIn": "Sin sesión",
|
||||
"proxyLabel": "Proxy de red",
|
||||
"proxySaveBeforeSignIn": "Guarda los cambios del proxy antes de iniciar sesión.",
|
||||
"saveProxy": "Guardar proxy",
|
||||
"localCodeHelp": "Completa el inicio de sesión en el navegador. nanobot suele finalizar automáticamente; si no lo hace, pega el código de autorización abajo.",
|
||||
"remoteCodeHelp": "Selecciona Iniciar sesión para abrir xAI en tu computadora. Después de iniciar sesión, pega abajo el código de autorización que muestra xAI.",
|
||||
"localCallbackHelp": "Completa el inicio de sesión en el navegador. nanobot suele finalizar automáticamente; si no lo hace, copia de la barra de direcciones la URL completa de devolución de localhost y pégala abajo.",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "Vos modifications sont enregistrées. Redémarrez pour les appliquer.",
|
||||
"later": "Redémarrer plus tard"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "Utiliser le proxy",
|
||||
"useProxyHelp": "Utilise le proxy partagé des réglages avancés.",
|
||||
"configureProxy": "Configurer le proxy",
|
||||
"sharedProxyScope": "Partagé par toutes les fonctions utilisant le proxy.",
|
||||
"authentication": "Authentification (facultative)",
|
||||
"username": "Nom d’utilisateur",
|
||||
"password": "Mot de passe",
|
||||
"proxyReferenceAuth": "Configurez l’authentification dans l’URL du proxy référencée."
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "Enregistré. Redémarrez le service API pour appliquer les modifications.",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "Variables d’environnement", "help": "Variables supplémentaires transmises aux commandes, un nom par ligne.\n\nVariables supplémentaires à transmettre aux commandes, une par ligne. Les variables nécessaires au fonctionnement restent disponibles."},
|
||||
"tools_exec_allow_patterns": {"label": "Commandes autorisées", "help": "Exécutez seulement les commandes correspondant entièrement aux règles d’autorisation.\n\nUne expression régulière par ligne. Si cette liste est renseignée, chaque segment de commande doit correspondre entièrement à une règle. Les commandes autorisées échappent aux règles de blocage intégrées et personnalisées, mais restent soumises aux restrictions réseau et d’espace de travail."},
|
||||
"tools_exec_deny_patterns": {"label": "Commandes bloquées", "help": "Bloquez les commandes correspondant à ces règles.\n\nExpressions régulières de blocage supplémentaires, une par ligne. Les règles d’autorisation explicites ont priorité sur ces règles et sur les protections intégrées."},
|
||||
"tools_web_proxy": {"label": "Proxy web", "help": "Utilisé pour la recherche web et la lecture de pages par l’agent. Laissez vide pour utiliser le réseau par défaut, y compris les variables d’environnement du proxy.\n\n127.0.0.1 désigne la machine qui exécute nanobot. Ce réglage ne change pas les connexions des modèles, de MCP ou du navigateur."},
|
||||
"network_proxy": {"label": "Proxy partagé", "help": "Adresse utilisée par les fonctions dont le proxy est activé. 127.0.0.1 désigne la machine qui exécute nanobot."},
|
||||
"tools_web_use_proxy": {"label": "Utiliser le proxy", "help": "Utiliser le proxy partagé pour la recherche web et la lecture de pages."},
|
||||
"tools_web_user_agent": {"label": "En-tête User-Agent", "help": "User-Agent des requêtes web ; laissez vide pour la valeur par défaut.\n\nEn-tête User-Agent personnalisé. Laissez vide pour utiliser la valeur par défaut."},
|
||||
"tools_restrict_to_workspace": {"label": "Restriction de l’espace", "help": "Limites globales de l’espace ; les permissions WebUI sont réglées séparément.\n\nRègle globale des outils. Les autorisations de chaque conversation WebUI sont distinctes."},
|
||||
"tools_ssrf_whitelist": {"label": "IP autorisées", "help": "IP ou plages CIDR autorisées, une par ligne.\n\nAdresses IP ou plages CIDR exemptées de la protection des requêtes sortantes, une par ligne."},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "Conversations", "help": "Configurez les discussions partagées entre plateformes."},
|
||||
"tools": {"title": "Outils intégrés", "help": "Choisissez les outils accessibles à l’agent."},
|
||||
"shell": {"title": "Shell et bac à sable", "help": "Réglez les délais, l’environnement et les règles d’accès des commandes."},
|
||||
"network": {"title": "Connexions web", "help": "Réglez le proxy et le User-Agent.\n\nProxy et identification des requêtes web."},
|
||||
"proxy": {"title": "Proxy partagé", "help": "Définissez une adresse pour les fonctions utilisant un proxy."},
|
||||
"network": {"title": "Connexions web", "help": "Réglez l’utilisation du proxy et le User-Agent des requêtes web."},
|
||||
"safety": {"title": "Permissions globales", "help": "Réglez les limites de l’espace, les exceptions réseau et les installations distantes.\n\nRestrictions de l’espace de travail, réseaux privés et installations à distance."},
|
||||
"cli": {"title": "Limites CLI", "help": "Réglez les délais d’installation et d’exécution, et la durée du cache.\n\nDélais d’installation, d’exécution et de cache du catalogue."},
|
||||
"gateway": {"title": "Passerelle", "help": "Réglez le déploiement et le redémarrage."},
|
||||
@@ -949,7 +961,6 @@
|
||||
"defaultAPIDescription": "Les préréglages définis sur Auto utilisent cette API. Chaque préréglage peut choisir une autre API de la liste des API prises en charge.",
|
||||
"declareAPIs": "Définir les API prises en charge",
|
||||
"openaiDefaultAPIDescription": "Définit l’API par défaut des préréglages utilisant Auto. Ici, Auto suit les règles connues du modèle. Chaque préréglage peut modifier ce choix.",
|
||||
"proxy": "Proxy réseau",
|
||||
"thinkingStyle": "Format du raisonnement",
|
||||
"region": "Région",
|
||||
"profile": "Profil AWS",
|
||||
@@ -1588,9 +1599,6 @@
|
||||
"signInBeforeSaving": "Connectez-vous à ce fournisseur avant d’enregistrer le préréglage.",
|
||||
"signedIn": "Connecté",
|
||||
"notSignedIn": "Non connecté",
|
||||
"proxyLabel": "Proxy réseau",
|
||||
"proxySaveBeforeSignIn": "Enregistrez les modifications du proxy avant de vous connecter.",
|
||||
"saveProxy": "Enregistrer le proxy",
|
||||
"localCodeHelp": "Terminez la connexion dans votre navigateur. nanobot termine généralement automatiquement ; sinon, collez le code d’autorisation ci-dessous.",
|
||||
"remoteCodeHelp": "Sélectionnez Se connecter pour ouvrir xAI sur votre ordinateur. Après la connexion, collez ci-dessous le code d’autorisation affiché par xAI.",
|
||||
"localCallbackHelp": "Terminez la connexion dans votre navigateur. nanobot termine généralement automatiquement ; sinon, copiez l’URL complète de rappel localhost depuis la barre d’adresse et collez-la ci-dessous.",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "Perubahan sudah disimpan. Mulai ulang untuk menerapkannya.",
|
||||
"later": "Mulai ulang nanti"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "Gunakan proxy",
|
||||
"useProxyHelp": "Menggunakan proxy bersama di pengaturan Lanjutan.",
|
||||
"configureProxy": "Atur proxy",
|
||||
"sharedProxyScope": "Dipakai bersama oleh semua fitur yang mengaktifkan proxy.",
|
||||
"authentication": "Autentikasi (opsional)",
|
||||
"username": "Nama pengguna",
|
||||
"password": "Kata sandi",
|
||||
"proxyReferenceAuth": "Atur autentikasi di URL proxy yang dirujuk."
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "Tersimpan. Mulai ulang layanan API untuk menerapkan perubahan.",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "Variabel lingkungan", "help": "Variabel tambahan untuk perintah, satu nama per baris.\n\nVariabel tambahan yang diteruskan ke perintah, satu per baris. Variabel dasar yang diperlukan tetap tersedia."},
|
||||
"tools_exec_allow_patterns": {"label": "Perintah diizinkan", "help": "Hanya jalankan perintah yang cocok sepenuhnya dengan aturan izin.\n\nSatu ekspresi reguler per baris. Jika diisi, setiap bagian perintah harus cocok sepenuhnya dengan salah satu aturan. Perintah yang diizinkan melewati aturan pemblokiran bawaan dan tambahan, tetapi tetap mengikuti batasan jaringan dan ruang kerja."},
|
||||
"tools_exec_deny_patterns": {"label": "Perintah diblokir", "help": "Blokir perintah yang cocok dengan aturan ini.\n\nAturan pemblokiran tambahan berupa ekspresi reguler, satu per baris. Aturan izin eksplisit mengesampingkan aturan pemblokiran bawaan dan tambahan."},
|
||||
"tools_web_proxy": {"label": "Proxy web", "help": "Digunakan untuk pencarian web dan pembacaan halaman oleh agen. Kosongkan untuk memakai pengaturan jaringan default, termasuk variabel lingkungan proxy.\n\n127.0.0.1 adalah mesin yang menjalankan nanobot. Pengaturan ini tidak mengubah koneksi model, MCP, atau browser."},
|
||||
"network_proxy": {"label": "Proxy bersama", "help": "Alamat untuk fitur yang mengaktifkan proxy. 127.0.0.1 adalah perangkat yang menjalankan nanobot."},
|
||||
"tools_web_use_proxy": {"label": "Gunakan proxy", "help": "Gunakan proxy bersama untuk pencarian web dan pembacaan halaman."},
|
||||
"tools_web_user_agent": {"label": "Header User-Agent", "help": "User-Agent untuk permintaan web; kosongkan untuk nilai default.\n\nHeader User-Agent kustom. Kosongkan untuk memakai nilai default."},
|
||||
"tools_restrict_to_workspace": {"label": "Batas ruang kerja", "help": "Batas ruang kerja global; izin chat WebUI diatur terpisah.\n\nKebijakan alat global. Izin setiap percakapan WebUI diatur secara terpisah."},
|
||||
"tools_ssrf_whitelist": {"label": "IP diizinkan", "help": "IP atau rentang CIDR diizinkan, satu per baris.\n\nIP atau rentang CIDR yang dikecualikan dari perlindungan permintaan keluar, satu per baris."},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "Percakapan", "help": "Atur chat bersama di berbagai platform."},
|
||||
"tools": {"title": "Alat bawaan", "help": "Pilih alat yang boleh digunakan agen."},
|
||||
"shell": {"title": "Shell dan sandbox", "help": "Atur batas waktu perintah, lingkungan, dan aturan akses."},
|
||||
"network": {"title": "Koneksi web", "help": "Atur proxy dan User-Agent.\n\nProxy dan identitas permintaan web."},
|
||||
"proxy": {"title": "Proxy bersama", "help": "Tetapkan satu alamat untuk fitur yang menggunakan proxy."},
|
||||
"network": {"title": "Koneksi web", "help": "Atur penggunaan proxy dan User-Agent untuk permintaan web."},
|
||||
"safety": {"title": "Izin global", "help": "Atur batas ruang kerja, pengecualian jaringan, dan pemasangan jarak jauh.\n\nPembatasan ruang kerja, jaringan privat, dan instalasi jarak jauh."},
|
||||
"cli": {"title": "Batas CLI", "help": "Atur batas waktu pemasangan dan eksekusi, serta durasi cache daftar.\n\nBatas waktu instalasi, eksekusi, dan cache katalog."},
|
||||
"gateway": {"title": "Gateway", "help": "Atur opsi penerapan dan mulai ulang."},
|
||||
@@ -949,7 +961,6 @@
|
||||
"defaultAPIDescription": "Preset yang diatur ke Otomatis memakai API ini. Setiap preset dapat memilih API lain dari daftar yang didukung.",
|
||||
"declareAPIs": "Atur API yang didukung",
|
||||
"openaiDefaultAPIDescription": "Menetapkan API default untuk preset yang memakai Otomatis. Otomatis di sini mengikuti aturan model yang sudah diketahui. Setiap preset dapat mengubah pilihan ini.",
|
||||
"proxy": "Proksi jaringan",
|
||||
"thinkingStyle": "Format penalaran",
|
||||
"region": "Wilayah",
|
||||
"profile": "Profil AWS",
|
||||
@@ -1588,9 +1599,6 @@
|
||||
"signInBeforeSaving": "Masuk ke penyedia ini sebelum menyimpan prasetel.",
|
||||
"signedIn": "Sudah masuk",
|
||||
"notSignedIn": "Belum masuk",
|
||||
"proxyLabel": "Proksi jaringan",
|
||||
"proxySaveBeforeSignIn": "Simpan perubahan proksi sebelum login.",
|
||||
"saveProxy": "Simpan proksi",
|
||||
"localCodeHelp": "Selesaikan proses masuk di browser. nanobot biasanya menyelesaikannya secara otomatis; jika tidak, tempel kode otorisasi di bawah.",
|
||||
"remoteCodeHelp": "Pilih Masuk untuk membuka xAI di komputer Anda. Setelah masuk, tempel kode otorisasi yang ditampilkan xAI di bawah.",
|
||||
"localCallbackHelp": "Selesaikan proses masuk di browser. nanobot biasanya menyelesaikannya secara otomatis; jika tidak, salin URL callback localhost lengkap dari bilah alamat dan tempel di bawah.",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "変更は保存されています。反映するには再起動してください。",
|
||||
"later": "後で再起動"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "プロキシを使う",
|
||||
"useProxyHelp": "詳細設定の共有プロキシを使います。",
|
||||
"configureProxy": "プロキシを設定",
|
||||
"sharedProxyScope": "プロキシを有効にしたすべての機能で共有します。",
|
||||
"authentication": "認証(任意)",
|
||||
"username": "ユーザー名",
|
||||
"password": "パスワード",
|
||||
"proxyReferenceAuth": "参照先のプロキシ URL に認証情報を設定してください。"
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "保存しました。API サービスを再起動すると反映されます。",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "環境変数", "help": "コマンドに追加で渡す変数名を1行に1つ指定します。\n\nコマンドに渡す環境変数を追加します。1 行に 1 つ指定してください。動作に必要な基本の環境変数は引き続き渡されます。"},
|
||||
"tools_exec_allow_patterns": {"label": "許可コマンド", "help": "許可ルールに完全一致するコマンドのみ実行します。\n\n1 行に 1 つ正規表現を指定します。設定すると、コマンドの各部分がいずれかのルールに完全一致する場合のみ実行できます。許可されたコマンドには組み込み・追加の禁止ルールを適用しませんが、ネットワークとワークスペースの制限は適用されます。"},
|
||||
"tools_exec_deny_patterns": {"label": "禁止コマンド", "help": "これらのルールに一致するコマンドを禁止します。\n\n追加の禁止ルールを正規表現で 1 行に 1 つ指定します。明示的な許可ルールは、組み込み・追加の禁止ルールより優先されます。"},
|
||||
"tools_web_proxy": {"label": "ウェブプロキシ", "help": "エージェントのウェブ検索とページ読み取りに使用します。空欄では、プロキシ環境変数を含む既定のネットワーク設定を使用します。\n\n127.0.0.1 は nanobot を実行するマシンです。モデル、MCP、ブラウザーの接続には影響しません。"},
|
||||
"network_proxy": {"label": "共有プロキシ", "help": "プロキシを有効にした機能で共有するアドレスです。127.0.0.1 は nanobot を実行する端末を指します。"},
|
||||
"tools_web_use_proxy": {"label": "プロキシを使う", "help": "ウェブ検索とページの読み取りに共有プロキシを使います。"},
|
||||
"tools_web_user_agent": {"label": "User-Agent ヘッダー", "help": "ウェブ要求の User-Agent です。空欄では既定値を使います。\n\nカスタムの User-Agent ヘッダー。空欄の場合は既定値を使用します。"},
|
||||
"tools_restrict_to_workspace": {"label": "ワークスペース制限", "help": "ワークスペースの全体制限です。WebUI のチャット権限は別に設定します。\n\nツール全体のアクセス方針です。WebUI の会話ごとの権限は別途設定します。"},
|
||||
"tools_ssrf_whitelist": {"label": "許可 IP", "help": "許可する IP または CIDR を1行に1つ指定します。\n\n送信リクエストの保護から除外する IP/CIDR 範囲。1 行に 1 つ指定します。"},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "会話", "help": "複数プラットフォーム間のチャット共有を設定します。"},
|
||||
"tools": {"title": "組み込みツール", "help": "エージェントが使えるツールを選びます。"},
|
||||
"shell": {"title": "シェルとサンドボックス", "help": "コマンドの制限時間、環境、アクセスルールを設定します。"},
|
||||
"network": {"title": "ウェブ接続", "help": "プロキシと User-Agent を設定します。\n\nプロキシとリクエストの識別情報。"},
|
||||
"proxy": {"title": "共有プロキシ", "help": "プロキシを使う機能の共有アドレスを設定します。"},
|
||||
"network": {"title": "ウェブ接続", "help": "ウェブリクエストのプロキシ使用と User-Agent を設定します。"},
|
||||
"safety": {"title": "全体の権限", "help": "ワークスペース制限、ネットワーク例外、リモートインストールを設定します。\n\nワークスペース制限、プライベートネットワーク、リモートインストール。"},
|
||||
"cli": {"title": "CLI 制限", "help": "インストール・実行の制限時間と一覧のキャッシュ期間を設定します。\n\nインストール、実行、カタログキャッシュの時間制限。"},
|
||||
"gateway": {"title": "ゲートウェイ", "help": "配置と再起動の方法を設定します。"},
|
||||
@@ -949,7 +961,6 @@
|
||||
"defaultAPIDescription": "自動に設定したプリセットはこの API を使用します。各プリセットでは対応 API の一覧から別の API を選択できます。",
|
||||
"declareAPIs": "対応する API を設定",
|
||||
"openaiDefaultAPIDescription": "自動を使うプリセットのデフォルト API を設定します。ここで自動を選ぶと既知のモデルルールに従います。各プリセットでこの設定を変更できます。",
|
||||
"proxy": "ネットワークプロキシ",
|
||||
"thinkingStyle": "推論の形式",
|
||||
"region": "リージョン",
|
||||
"profile": "AWS プロファイル",
|
||||
@@ -1588,9 +1599,6 @@
|
||||
"signInBeforeSaving": "プリセットを保存する前に、このプロバイダーへサインインしてください。",
|
||||
"signedIn": "サインイン済み",
|
||||
"notSignedIn": "未サインイン",
|
||||
"proxyLabel": "ネットワークプロキシ",
|
||||
"proxySaveBeforeSignIn": "サインイン前にプロキシの変更を保存してください。",
|
||||
"saveProxy": "プロキシを保存",
|
||||
"localCodeHelp": "ブラウザーでサインインを完了してください。通常は nanobot が自動で完了します。完了しない場合は、認証コードを下に貼り付けてください。",
|
||||
"remoteCodeHelp": "「サインイン」を選択して自分のコンピューターで xAI を開いてください。サインイン後、xAI に表示された認証コードを下に貼り付けてください。",
|
||||
"localCallbackHelp": "ブラウザーでサインインを完了してください。通常は nanobot が自動で完了します。完了しない場合は、アドレスバーから localhost の完全なコールバック URL をコピーして下に貼り付けてください。",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "변경 사항이 저장되었습니다. 적용하려면 다시 시작하세요.",
|
||||
"later": "나중에 다시 시작"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "프록시 사용",
|
||||
"useProxyHelp": "고급 설정의 공유 프록시를 사용합니다.",
|
||||
"configureProxy": "프록시 설정",
|
||||
"sharedProxyScope": "프록시를 켠 모든 기능에서 함께 사용합니다.",
|
||||
"authentication": "인증 (선택 사항)",
|
||||
"username": "사용자 이름",
|
||||
"password": "비밀번호",
|
||||
"proxyReferenceAuth": "참조된 프록시 URL에서 인증 정보를 설정하세요."
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "저장했습니다. API 서비스를 다시 시작하면 적용됩니다.",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "환경 변수", "help": "명령에 추가로 전달할 변수 이름을 한 줄에 하나씩 입력하세요.\n\n명령에 전달할 환경 변수를 추가합니다. 한 줄에 하나씩 입력하세요. 실행에 필요한 기본 환경 변수는 계속 전달됩니다."},
|
||||
"tools_exec_allow_patterns": {"label": "허용 명령", "help": "허용 규칙과 완전히 일치하는 명령만 실행합니다.\n\n정규식을 한 줄에 하나씩 입력하세요. 규칙을 추가하면 명령의 각 부분이 규칙 중 하나와 완전히 일치해야 실행됩니다. 허용된 명령에는 기본 및 추가 차단 규칙이 적용되지 않지만, 네트워크와 작업 공간 제한은 유지됩니다."},
|
||||
"tools_exec_deny_patterns": {"label": "차단 명령", "help": "이 규칙과 일치하는 명령을 차단합니다.\n\n추가 차단 정규식을 한 줄에 하나씩 입력하세요. 명시적 허용 규칙이 기본 및 추가 차단 규칙보다 우선합니다."},
|
||||
"tools_web_proxy": {"label": "웹 프록시", "help": "에이전트의 웹 검색과 페이지 읽기에 사용합니다. 비워 두면 프록시 환경 변수를 포함한 기본 네트워크 설정을 사용합니다.\n\n127.0.0.1은 nanobot이 실행되는 기기입니다. 모델, MCP 또는 브라우저 연결에는 영향을 주지 않습니다."},
|
||||
"network_proxy": {"label": "공유 프록시", "help": "프록시 사용이 켜진 기능에서 공유하는 주소입니다. 127.0.0.1은 nanobot을 실행하는 기기를 뜻합니다."},
|
||||
"tools_web_use_proxy": {"label": "프록시 사용", "help": "웹 검색과 페이지 읽기에 공유 프록시를 사용합니다."},
|
||||
"tools_web_user_agent": {"label": "User-Agent 헤더", "help": "웹 요청의 User-Agent입니다. 비워 두면 기본값을 사용합니다.\n\n사용자 지정 User-Agent 헤더입니다. 비워 두면 기본값을 사용합니다."},
|
||||
"tools_restrict_to_workspace": {"label": "작업 공간 제한", "help": "전체 작업 공간 제한입니다. WebUI 채팅 권한은 별도로 설정합니다.\n\n전체 도구 접근 정책입니다. WebUI의 대화별 권한은 별도로 설정합니다."},
|
||||
"tools_ssrf_whitelist": {"label": "허용 IP", "help": "허용할 IP 또는 CIDR 범위를 한 줄에 하나씩 입력하세요.\n\n외부 요청 보호에서 제외할 IP/CIDR 범위를 한 줄에 하나씩 입력하세요."},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "대화", "help": "플랫폼 간 채팅 공유를 설정하세요."},
|
||||
"tools": {"title": "기본 도구", "help": "에이전트가 사용할 도구를 선택하세요."},
|
||||
"shell": {"title": "셸 및 샌드박스", "help": "명령 제한 시간, 환경 및 접근 규칙을 설정하세요."},
|
||||
"network": {"title": "웹 연결", "help": "프록시와 User-Agent를 설정하세요.\n\n웹 프록시 및 요청 식별 정보입니다."},
|
||||
"proxy": {"title": "공유 프록시", "help": "프록시를 사용하는 기능의 공통 주소를 설정합니다."},
|
||||
"network": {"title": "웹 연결", "help": "웹 요청의 프록시 사용 여부와 User-Agent를 설정합니다."},
|
||||
"safety": {"title": "전체 권한", "help": "작업 공간 제한, 네트워크 예외 및 원격 설치를 설정하세요.\n\n작업 공간 제한, 사설 네트워크 및 원격 설치입니다."},
|
||||
"cli": {"title": "CLI 제한", "help": "설치와 실행 제한 시간, 목록 캐시 시간을 설정하세요.\n\n설치, 실행 및 카탈로그 캐시의 시간 제한입니다."},
|
||||
"gateway": {"title": "게이트웨이", "help": "배포와 재시작 옵션을 설정하세요."},
|
||||
@@ -949,7 +961,6 @@
|
||||
"defaultAPIDescription": "자동으로 설정한 프리셋은 이 API를 사용합니다. 개별 프리셋에서는 지원 목록의 다른 API를 선택할 수 있습니다.",
|
||||
"declareAPIs": "지원 API 설정",
|
||||
"openaiDefaultAPIDescription": "자동을 사용하는 프리셋의 기본 API를 설정합니다. 여기서 자동을 선택하면 알려진 모델 규칙을 따릅니다. 개별 프리셋에서 이 설정을 바꿀 수 있습니다.",
|
||||
"proxy": "네트워크 프록시",
|
||||
"thinkingStyle": "추론 형식",
|
||||
"region": "리전",
|
||||
"profile": "AWS 프로필",
|
||||
@@ -1588,9 +1599,6 @@
|
||||
"signInBeforeSaving": "프리셋을 저장하기 전에 이 제공업체에 로그인하세요.",
|
||||
"signedIn": "로그인됨",
|
||||
"notSignedIn": "로그인 안 됨",
|
||||
"proxyLabel": "네트워크 프록시",
|
||||
"proxySaveBeforeSignIn": "로그인하기 전에 프록시 변경 사항을 저장하세요.",
|
||||
"saveProxy": "프록시 저장",
|
||||
"localCodeHelp": "브라우저에서 로그인을 완료하세요. 일반적으로 nanobot이 자동으로 완료합니다. 완료되지 않으면 인증 코드를 아래에 붙여 넣으세요.",
|
||||
"remoteCodeHelp": "로그인을 선택하여 사용자 컴퓨터에서 xAI를 여세요. 로그인 후 xAI에 표시된 인증 코드를 아래에 붙여 넣으세요.",
|
||||
"localCallbackHelp": "브라우저에서 로그인을 완료하세요. 일반적으로 nanobot이 자동으로 완료합니다. 완료되지 않으면 주소 표시줄에서 전체 localhost 콜백 URL을 복사해 아래에 붙여 넣으세요.",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "As alterações foram salvas. Reinicie para aplicá-las.",
|
||||
"later": "Reiniciar mais tarde"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "Usar proxy",
|
||||
"useProxyHelp": "Usa o proxy compartilhado dos ajustes avançados.",
|
||||
"configureProxy": "Configurar proxy",
|
||||
"sharedProxyScope": "Compartilhado por todos os recursos com proxy ativado.",
|
||||
"authentication": "Autenticação (opcional)",
|
||||
"username": "Usuário",
|
||||
"password": "Senha",
|
||||
"proxyReferenceAuth": "Configure a autenticação na URL do proxy referenciada."
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "Salvo. Reinicie o serviço de API para aplicar as alterações.",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "Variáveis de ambiente", "help": "Variáveis extras para os comandos, um nome por linha.\n\nVariáveis adicionais passadas aos comandos, uma por linha. As variáveis básicas necessárias continuam disponíveis."},
|
||||
"tools_exec_allow_patterns": {"label": "Comandos permitidos", "help": "Execute apenas comandos que correspondam totalmente às regras de permissão.\n\nUma expressão regular por linha. Se houver regras, cada trecho do comando deve corresponder por completo a uma delas. Os comandos permitidos ignoram as regras de bloqueio integradas e personalizadas, mas continuam sujeitos às restrições de rede e do espaço de trabalho."},
|
||||
"tools_exec_deny_patterns": {"label": "Comandos bloqueados", "help": "Bloqueie comandos que correspondam a estas regras.\n\nExpressões regulares de bloqueio adicionais, uma por linha. As regras de permissão explícitas têm prioridade sobre as regras de bloqueio integradas e personalizadas."},
|
||||
"tools_web_proxy": {"label": "Proxy web", "help": "Usado para a pesquisa web e a leitura de páginas pelo agente. Deixe em branco para usar a rede padrão, incluindo as variáveis de ambiente de proxy.\n\n127.0.0.1 é a máquina que executa nanobot. Esta configuração não altera as conexões de modelos, MCP ou do navegador."},
|
||||
"network_proxy": {"label": "Proxy compartilhado", "help": "Endereço usado pelos recursos com o proxy ativado. 127.0.0.1 é a máquina que executa nanobot."},
|
||||
"tools_web_use_proxy": {"label": "Usar proxy", "help": "Usa o proxy compartilhado para pesquisar na web e ler páginas."},
|
||||
"tools_web_user_agent": {"label": "Cabeçalho User-Agent", "help": "User-Agent das solicitações web; deixe vazio para usar o padrão.\n\nCabeçalho User-Agent personalizado. Deixe vazio para usar o valor padrão."},
|
||||
"tools_restrict_to_workspace": {"label": "Restrição do espaço", "help": "Limites globais do espaço; permissões de conversas WebUI são separadas.\n\nPolítica global das ferramentas. As permissões de cada conversa WebUI são configuradas separadamente."},
|
||||
"tools_ssrf_whitelist": {"label": "IPs permitidos", "help": "IPs ou faixas CIDR permitidos, um por linha.\n\nEndereços IP ou faixas CIDR isentos da proteção de solicitações de saída, um por linha."},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "Conversas", "help": "Configure conversas compartilhadas entre plataformas."},
|
||||
"tools": {"title": "Ferramentas integradas", "help": "Escolha as ferramentas que o agente pode usar."},
|
||||
"shell": {"title": "Shell e sandbox", "help": "Configure tempos limite, ambiente e regras de acesso dos comandos."},
|
||||
"network": {"title": "Conexões web", "help": "Configure o proxy e o User-Agent.\n\nProxy e identificação das solicitações web."},
|
||||
"proxy": {"title": "Proxy compartilhado", "help": "Defina um endereço para os recursos que usam proxy."},
|
||||
"network": {"title": "Conexões web", "help": "Configure o uso de proxy e o User-Agent das solicitações web."},
|
||||
"safety": {"title": "Permissões globais", "help": "Configure limites do espaço, exceções de rede e instalações remotas.\n\nRestrições do espaço de trabalho, redes privadas e instalações remotas."},
|
||||
"cli": {"title": "Limites CLI", "help": "Configure tempos limite de instalação e execução e duração do cache.\n\nTempos de instalação, execução e cache do catálogo."},
|
||||
"gateway": {"title": "Gateway", "help": "Configure implantação e reinício."},
|
||||
@@ -1193,7 +1205,6 @@
|
||||
"defaultAPIDescription": "As predefinições configuradas como Auto usam esta API. Cada predefinição pode escolher outra API da lista de APIs compatíveis.",
|
||||
"declareAPIs": "Definir APIs compatíveis",
|
||||
"openaiDefaultAPIDescription": "Define a API padrão das predefinições que usam Auto. Aqui, Auto segue as regras conhecidas do modelo. Cada predefinição pode alterar essa escolha.",
|
||||
"proxy": "Proxy de rede",
|
||||
"thinkingStyle": "Formato de raciocínio",
|
||||
"region": "Região",
|
||||
"profile": "Perfil da AWS",
|
||||
@@ -1602,9 +1613,6 @@
|
||||
"signInBeforeSaving": "Entre neste provedor antes de salvar a predefinição.",
|
||||
"signedIn": "Conectado",
|
||||
"notSignedIn": "Desconectado",
|
||||
"proxyLabel": "Proxy de rede",
|
||||
"proxySaveBeforeSignIn": "Salve as alterações do proxy antes de entrar.",
|
||||
"saveProxy": "Salvar proxy",
|
||||
"localCodeHelp": "Conclua o login no navegador. O nanobot geralmente termina automaticamente; caso contrário, cole o código de autorização abaixo.",
|
||||
"remoteCodeHelp": "Selecione Entrar para abrir a xAI no seu computador. Após o login, cole abaixo o código de autorização exibido pela xAI.",
|
||||
"localCallbackHelp": "Conclua o login no navegador. O nanobot geralmente termina automaticamente; caso contrário, copie da barra de endereço a URL completa de callback do localhost e cole abaixo.",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "Thay đổi đã được lưu. Khởi động lại để áp dụng.",
|
||||
"later": "Khởi động lại sau"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "Dùng proxy",
|
||||
"useProxyHelp": "Dùng proxy chung trong phần Nâng cao.",
|
||||
"configureProxy": "Cấu hình proxy",
|
||||
"sharedProxyScope": "Dùng chung cho mọi tính năng đã bật proxy.",
|
||||
"authentication": "Xác thực (tùy chọn)",
|
||||
"username": "Tên người dùng",
|
||||
"password": "Mật khẩu",
|
||||
"proxyReferenceAuth": "Thiết lập xác thực trong URL proxy được tham chiếu."
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "Đã lưu. Khởi động lại dịch vụ API để áp dụng thay đổi.",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "Biến môi trường", "help": "Thêm biến truyền cho lệnh, mỗi dòng một tên.\n\nCác biến môi trường bổ sung được truyền cho lệnh, mỗi dòng một tên. Các biến cơ bản cần cho hoạt động vẫn được truyền."},
|
||||
"tools_exec_allow_patterns": {"label": "Lệnh được phép", "help": "Chỉ chạy lệnh khớp hoàn toàn với quy tắc cho phép.\n\nMỗi dòng một biểu thức chính quy. Khi có quy tắc, từng phần của lệnh phải khớp hoàn toàn với ít nhất một quy tắc. Lệnh được phép sẽ bỏ qua quy tắc chặn tích hợp và bổ sung, nhưng vẫn chịu giới hạn mạng và không gian làm việc."},
|
||||
"tools_exec_deny_patterns": {"label": "Lệnh bị chặn", "help": "Chặn lệnh khớp với các quy tắc này.\n\nQuy tắc chặn bổ sung dưới dạng biểu thức chính quy, mỗi dòng một quy tắc. Quy tắc cho phép được ưu tiên hơn cả quy tắc chặn tích hợp và bổ sung."},
|
||||
"tools_web_proxy": {"label": "Proxy web", "help": "Dùng cho tìm kiếm web và đọc trang của tác nhân. Để trống để dùng mạng mặc định, bao gồm các biến môi trường proxy.\n\n127.0.0.1 là máy chạy nanobot. Cài đặt này không thay đổi kết nối mô hình, MCP hoặc trình duyệt."},
|
||||
"network_proxy": {"label": "Proxy chung", "help": "Địa chỉ dùng cho các tính năng đã bật proxy. 127.0.0.1 là máy chạy nanobot."},
|
||||
"tools_web_use_proxy": {"label": "Dùng proxy", "help": "Dùng proxy chung để tìm kiếm web và đọc trang."},
|
||||
"tools_web_user_agent": {"label": "Header User-Agent", "help": "User-Agent cho yêu cầu web; để trống để dùng mặc định.\n\nHeader User-Agent tùy chỉnh cho yêu cầu web. Để trống để dùng giá trị mặc định."},
|
||||
"tools_restrict_to_workspace": {"label": "Giới hạn vùng làm việc", "help": "Giới hạn vùng làm việc chung; quyền trò chuyện WebUI được đặt riêng.\n\nChính sách công cụ toàn cục. Quyền của từng cuộc trò chuyện WebUI được đặt riêng."},
|
||||
"tools_ssrf_whitelist": {"label": "IP được phép", "help": "IP hoặc dải CIDR được phép, mỗi dòng một mục.\n\nIP hoặc dải CIDR được miễn bảo vệ yêu cầu ra ngoài, mỗi dòng một mục."},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "Cuộc trò chuyện", "help": "Đặt chia sẻ trò chuyện giữa các nền tảng."},
|
||||
"tools": {"title": "Công cụ tích hợp", "help": "Chọn công cụ agent được phép dùng."},
|
||||
"shell": {"title": "Shell và sandbox", "help": "Đặt thời hạn lệnh, môi trường và quy tắc truy cập."},
|
||||
"network": {"title": "Kết nối web", "help": "Đặt proxy và User-Agent.\n\nProxy và thông tin nhận dạng yêu cầu web."},
|
||||
"proxy": {"title": "Proxy chung", "help": "Đặt một địa chỉ cho các tính năng dùng proxy."},
|
||||
"network": {"title": "Kết nối web", "help": "Đặt tùy chọn proxy và User-Agent cho yêu cầu web."},
|
||||
"safety": {"title": "Quyền chung", "help": "Đặt giới hạn vùng làm việc, ngoại lệ mạng và cài đặt từ xa.\n\nGiới hạn không gian làm việc, mạng riêng và cài đặt từ xa."},
|
||||
"cli": {"title": "Giới hạn CLI", "help": "Đặt thời hạn cài đặt, chạy và thời gian cache danh sách.\n\nGiới hạn thời gian cài đặt, thực thi và lưu đệm danh mục."},
|
||||
"gateway": {"title": "Gateway", "help": "Đặt cách triển khai và khởi động lại."},
|
||||
@@ -949,7 +961,6 @@
|
||||
"defaultAPIDescription": "Cấu hình sẵn đặt ở Tự động sẽ dùng API này. Mỗi cấu hình sẵn có thể chọn API khác trong danh sách được hỗ trợ.",
|
||||
"declareAPIs": "Đặt API được hỗ trợ",
|
||||
"openaiDefaultAPIDescription": "Đặt API mặc định cho cấu hình sẵn dùng Tự động. Chọn Tự động tại đây sẽ áp dụng quy tắc đã biết của mô hình. Mỗi cấu hình sẵn có thể thay đổi lựa chọn này.",
|
||||
"proxy": "Proxy mạng",
|
||||
"thinkingStyle": "Định dạng suy luận",
|
||||
"region": "Khu vực",
|
||||
"profile": "Hồ sơ AWS",
|
||||
@@ -1588,9 +1599,6 @@
|
||||
"signInBeforeSaving": "Hãy đăng nhập nhà cung cấp này trước khi lưu cấu hình đặt trước.",
|
||||
"signedIn": "Đã đăng nhập",
|
||||
"notSignedIn": "Chưa đăng nhập",
|
||||
"proxyLabel": "Proxy mạng",
|
||||
"proxySaveBeforeSignIn": "Hãy lưu thay đổi proxy trước khi đăng nhập.",
|
||||
"saveProxy": "Lưu proxy",
|
||||
"localCodeHelp": "Hoàn tất đăng nhập trong trình duyệt. nanobot thường tự động hoàn tất; nếu không, hãy dán mã ủy quyền bên dưới.",
|
||||
"remoteCodeHelp": "Chọn Đăng nhập để mở xAI trên máy tính của bạn. Sau khi đăng nhập, hãy dán mã ủy quyền do xAI hiển thị bên dưới.",
|
||||
"localCallbackHelp": "Hoàn tất đăng nhập trong trình duyệt. nanobot thường tự động hoàn tất; nếu không, hãy sao chép URL callback localhost đầy đủ từ thanh địa chỉ và dán vào bên dưới.",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "更改已保存,重启后生效。",
|
||||
"later": "稍后重启"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "使用代理",
|
||||
"useProxyHelp": "使用高级设置中的共享代理。",
|
||||
"configureProxy": "配置代理",
|
||||
"sharedProxyScope": "供所有启用代理的功能共用。",
|
||||
"authentication": "认证(可选)",
|
||||
"username": "用户名",
|
||||
"password": "密码",
|
||||
"proxyReferenceAuth": "请在引用的代理 URL 中设置认证信息。"
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "已保存,重启 API 服务后生效。",
|
||||
"commandRuntime": {
|
||||
@@ -609,9 +619,13 @@
|
||||
"label": "禁止命令",
|
||||
"help": "阻止匹配规则的命令\n\n每行一个正则表达式,与内置拒绝规则一同检查。完整匹配允许规则的命令会跳过这些检查。"
|
||||
},
|
||||
"tools_web_proxy": {
|
||||
"label": "网页代理",
|
||||
"help": "用于智能体搜索和读取网页。留空使用默认网络设置,包括环境变量中的代理。\n\n127.0.0.1 指运行 nanobot 的机器,不是打开网页的手机。本设置不影响模型、MCP 或浏览器的连接。"
|
||||
"network_proxy": {
|
||||
"label": "共享代理",
|
||||
"help": "启用“使用代理”的功能共用此地址。127.0.0.1 指运行 nanobot 的设备。"
|
||||
},
|
||||
"tools_web_use_proxy": {
|
||||
"label": "使用代理",
|
||||
"help": "网页搜索和读取使用共享代理。"
|
||||
},
|
||||
"tools_web_user_agent": {
|
||||
"label": "User-Agent",
|
||||
@@ -699,9 +713,13 @@
|
||||
"title": "Shell 与沙箱",
|
||||
"help": "设置命令超时、环境和访问规则"
|
||||
},
|
||||
"proxy": {
|
||||
"title": "共享代理",
|
||||
"help": "为使用代理的功能设置共享地址。"
|
||||
},
|
||||
"network": {
|
||||
"title": "网页连接",
|
||||
"help": "设置代理和 User-Agent\n\n设置网页访问代理和 User-Agent 标识。"
|
||||
"help": "设置网页请求的代理开关和 User-Agent。"
|
||||
},
|
||||
"safety": {
|
||||
"title": "全局权限",
|
||||
@@ -1379,7 +1397,6 @@
|
||||
"defaultAPIDescription": "预设选择「自动」时使用此协议。单个预设可改用支持列表中的其他协议。",
|
||||
"declareAPIs": "设置支持的协议",
|
||||
"openaiDefaultAPIDescription": "设为「自动」的预设使用此默认协议。此处选择「自动」会遵循已知模型规则;单个预设可以覆盖此默认值。",
|
||||
"proxy": "网络代理",
|
||||
"thinkingStyle": "推理格式",
|
||||
"region": "区域",
|
||||
"profile": "AWS 配置名称",
|
||||
@@ -1788,9 +1805,6 @@
|
||||
"signInBeforeSaving": "请先登录此提供商,再保存模型预设。",
|
||||
"signedIn": "已登录",
|
||||
"notSignedIn": "未登录",
|
||||
"proxyLabel": "网络代理",
|
||||
"proxySaveBeforeSignIn": "请先保存代理更改再登录。",
|
||||
"saveProxy": "保存代理",
|
||||
"localCodeHelp": "请在浏览器中完成登录。若 nanobot 未自动完成连接,请将授权码粘贴到下方。",
|
||||
"remoteCodeHelp": "点击“登录”在你的电脑上打开 xAI。完成登录后,请将 xAI 显示的授权码粘贴到下方。",
|
||||
"localCallbackHelp": "请在浏览器中完成登录。若 nanobot 未自动完成连接,请复制地址栏中完整的 localhost 回调地址,粘贴到下方。",
|
||||
|
||||
@@ -491,6 +491,16 @@
|
||||
"description": "變更已儲存,重新啟動後生效。",
|
||||
"later": "稍後重新啟動"
|
||||
},
|
||||
"network": {
|
||||
"useProxy": "使用代理",
|
||||
"useProxyHelp": "使用進階設定中的共用代理。",
|
||||
"configureProxy": "設定代理",
|
||||
"sharedProxyScope": "供所有啟用代理的功能共用。",
|
||||
"authentication": "認證(選填)",
|
||||
"username": "使用者名稱",
|
||||
"password": "密碼",
|
||||
"proxyReferenceAuth": "請在參照的代理 URL 中設定認證資訊。"
|
||||
},
|
||||
"runtimeConfig": {
|
||||
"apiSaved": "已儲存,重新啟動 API 服務後生效。",
|
||||
"commandRuntime": {
|
||||
@@ -528,7 +538,8 @@
|
||||
"tools_exec_allowed_env_keys": {"label": "環境變數", "help": "額外傳給命令的變數名,每行一個\n\n除必需變數外,還要從主機傳遞給命令的環境變數名稱,每行一個。"},
|
||||
"tools_exec_allow_patterns": {"label": "允許命令", "help": "只允許完整匹配規則的命令\n\n每行一個正規表示式。填寫後,只允許每段命令都完整匹配規則的命令執行,且優先於內建和自定義拒絕規則;工作區和網路限制仍生效。"},
|
||||
"tools_exec_deny_patterns": {"label": "禁止命令", "help": "阻止匹配規則的命令\n\n每行一個正規表示式,與內建拒絕規則一同檢查。完整匹配允許規則的命令會跳過這些檢查。"},
|
||||
"tools_web_proxy": {"label": "網頁代理", "help": "用於智慧體搜尋和讀取網頁。留空使用預設網路設定,包括環境變數中的代理。\n\n127.0.0.1 指執行 nanobot 的機器,不是開啟網頁的手機。本設定不影響模型、MCP 或瀏覽器的連線。"},
|
||||
"network_proxy": {"label": "共用代理", "help": "啟用「使用代理」的功能共用此位址。127.0.0.1 指執行 nanobot 的裝置。"},
|
||||
"tools_web_use_proxy": {"label": "使用代理", "help": "網頁搜尋與讀取使用共用代理。"},
|
||||
"tools_web_user_agent": {"label": "User-Agent", "help": "網頁請求標識,留空使用預設值\n\n網頁請求使用的 User-Agent 標識,留空使用預設值。"},
|
||||
"tools_restrict_to_workspace": {"label": "目錄限制", "help": "全域性目錄限制,WebUI 許可權另設\n\n設定全域性工作區訪問限制;WebUI 中每個對話的許可權單獨設定。"},
|
||||
"tools_ssrf_whitelist": {"label": "允許 IP", "help": "允許訪問的 IP 或 CIDR,每行一項\n\n允許網頁等出站請求訪問這些受限地址。每行填寫一個 IP 地址或 CIDR 網段。"},
|
||||
@@ -552,7 +563,8 @@
|
||||
"sessions": {"title": "對話", "help": "設定跨平臺對話共享"},
|
||||
"tools": {"title": "內建工具", "help": "選擇智慧體可以使用的工具"},
|
||||
"shell": {"title": "Shell 與沙箱", "help": "設定命令超時、環境和訪問規則"},
|
||||
"network": {"title": "網頁連線", "help": "設定代理和 User-Agent\n\n設定網頁訪問代理和 User-Agent 標識。"},
|
||||
"proxy": {"title": "共用代理", "help": "為使用代理的功能設定共用位址。"},
|
||||
"network": {"title": "網頁連線", "help": "設定網頁請求的代理開關與 User-Agent。"},
|
||||
"safety": {"title": "全域性許可權", "help": "設定目錄限制、網路例外和遠端安裝\n\n設定工作區訪問限制、網路訪問例外和遠端安裝許可權。"},
|
||||
"cli": {"title": "CLI 限制", "help": "設定安裝、執行超時和列表快取\n\n設定安裝和執行超時,以及應用列表的快取時長。"},
|
||||
"gateway": {"title": "閘道器", "help": "設定部署和重啟方式"},
|
||||
@@ -949,7 +961,6 @@
|
||||
"defaultAPIDescription": "預設選擇「自動」時使用此協定。個別預設可改用支援清單中的其他協定。",
|
||||
"declareAPIs": "設定支援的協定",
|
||||
"openaiDefaultAPIDescription": "設為「自動」的預設使用此預設協定。此處選擇「自動」會遵循已知模型規則;個別預設可以覆寫此預設值。",
|
||||
"proxy": "網路代理",
|
||||
"thinkingStyle": "推理格式",
|
||||
"region": "區域",
|
||||
"profile": "AWS 設定檔名稱",
|
||||
@@ -1588,9 +1599,6 @@
|
||||
"signInBeforeSaving": "請先登入此供應商,再儲存模型預設。",
|
||||
"signedIn": "已登入",
|
||||
"notSignedIn": "未登入",
|
||||
"proxyLabel": "網路代理",
|
||||
"proxySaveBeforeSignIn": "請先儲存代理變更再登入。",
|
||||
"saveProxy": "儲存代理",
|
||||
"localCodeHelp": "請在瀏覽器中完成登入。nanobot 通常會自動完成;若未自動完成,請將授權碼貼到下方。",
|
||||
"remoteCodeHelp": "請點選 [登入],在電腦上開啟 xAI。完成登入後,請將 xAI 顯示的授權碼貼到下方。",
|
||||
"localCallbackHelp": "請在瀏覽器中完成登入。nanobot 通常會自動完成;若未自動完成,請複製網址列中的完整 localhost 回呼 URL 並貼到下方。",
|
||||
|
||||
@@ -1211,7 +1211,7 @@ export async function fetchProviderModels(
|
||||
|
||||
export async function runMcpPresetAction(
|
||||
transport: WebUIMutationTransport,
|
||||
action: "enable" | "disable" | "remove" | "test" | "reconnect",
|
||||
action: "enable" | "disable" | "remove" | "test" | "reconnect" | "proxy",
|
||||
name: string,
|
||||
values: Record<string, string> = {},
|
||||
): Promise<McpPresetsPayload> {
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
const environmentReference = /\$\{[A-Za-z_][A-Za-z0-9_]*\}/;
|
||||
|
||||
function decodeCredential(value: string): string {
|
||||
try {
|
||||
return decodeURIComponent(value);
|
||||
} catch {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
function encodeCredential(value: string): string {
|
||||
return value.split(/(\$\{[A-Za-z_][A-Za-z0-9_]*\})/).map((part) =>
|
||||
environmentReference.test(part) ? part : encodeURIComponent(part),
|
||||
).join("");
|
||||
}
|
||||
|
||||
export function splitProxyUrl(value: string) {
|
||||
const schemeEnd = value.indexOf("://");
|
||||
const start = schemeEnd < 0 ? 0 : schemeEnd + 3;
|
||||
const authorityEnd = value.slice(start).search(/[/?#]/);
|
||||
const end = authorityEnd < 0 ? value.length : start + authorityEnd;
|
||||
const at = value.lastIndexOf("@", end - 1);
|
||||
const userinfo = at >= start ? value.slice(start, at) : null;
|
||||
const colon = userinfo?.indexOf(":") ?? -1;
|
||||
const rawUsername = userinfo === null ? "" : colon < 0 ? userinfo : userinfo.slice(0, colon);
|
||||
const rawPassword = userinfo === null || colon < 0 ? "" : userinfo.slice(colon + 1);
|
||||
return {
|
||||
address: userinfo === null ? value : value.slice(0, start) + value.slice(at + 1),
|
||||
username: decodeCredential(rawUsername),
|
||||
password: decodeCredential(rawPassword),
|
||||
rawUsername,
|
||||
rawPassword,
|
||||
userinfo,
|
||||
hasColon: colon >= 0,
|
||||
};
|
||||
}
|
||||
|
||||
function insertUserinfo(address: string, userinfo: string | null): string {
|
||||
if (userinfo === null) return address;
|
||||
const schemeEnd = address.indexOf("://");
|
||||
const start = schemeEnd < 0 ? 0 : schemeEnd + 3;
|
||||
return address.slice(0, start) + userinfo + "@" + address.slice(start);
|
||||
}
|
||||
|
||||
export function changeProxyAddress(value: string, address: string): string {
|
||||
if (!address.trim() || isProxyUrlReference(address)) return address;
|
||||
const pasted = splitProxyUrl(address);
|
||||
if (pasted.userinfo !== null) return address;
|
||||
return insertUserinfo(address, splitProxyUrl(value).userinfo);
|
||||
}
|
||||
|
||||
export function changeProxyAuthentication(value: string, username: string, password: string): string {
|
||||
const current = splitProxyUrl(value);
|
||||
if (!username && !password) return current.address;
|
||||
const user = username === current.username ? current.rawUsername : encodeCredential(username);
|
||||
const pass = password === current.password ? current.rawPassword : encodeCredential(password);
|
||||
const separator = current.hasColon || password ? ":" : "";
|
||||
return insertUserinfo(current.address, user + separator + pass);
|
||||
}
|
||||
|
||||
export function isProxyUrlReference(address: string): boolean {
|
||||
return /^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/.test(address.trim());
|
||||
}
|
||||
@@ -748,12 +748,12 @@ export interface SettingsPayload {
|
||||
oauth_account?: string | null;
|
||||
oauth_expires_at?: number | null;
|
||||
oauth_login_supported?: boolean;
|
||||
proxy?: string | null;
|
||||
use_proxy?: boolean;
|
||||
advanced_fields?: Array<
|
||||
| "extra_headers"
|
||||
| "extra_body"
|
||||
| "extra_query"
|
||||
| "proxy"
|
||||
| "use_proxy"
|
||||
| "thinking_style"
|
||||
| "region"
|
||||
| "profile"
|
||||
@@ -779,7 +779,7 @@ export interface SettingsPayload {
|
||||
};
|
||||
web: {
|
||||
enable: boolean;
|
||||
proxy?: string | null;
|
||||
use_proxy?: boolean;
|
||||
user_agent?: string | null;
|
||||
search: {
|
||||
max_results: number;
|
||||
@@ -1242,6 +1242,7 @@ export interface McpPresetInfo {
|
||||
docs_url: string;
|
||||
transport: "stdio" | "streamableHttp" | "sse" | "oauth" | string;
|
||||
auth?: "oauth" | null;
|
||||
use_proxy?: boolean;
|
||||
requires: string;
|
||||
note: string;
|
||||
install_supported: boolean;
|
||||
@@ -1290,6 +1291,7 @@ export interface McpOAuthFlowPayload {
|
||||
|
||||
export interface McpPresetsPayload {
|
||||
presets: McpPresetInfo[];
|
||||
proxy_configured?: boolean;
|
||||
installed_count: number;
|
||||
requires_restart?: boolean;
|
||||
hot_reload?: {
|
||||
@@ -1376,7 +1378,7 @@ export interface ProviderSettingsUpdate {
|
||||
apiKey?: string;
|
||||
apiBase?: string;
|
||||
api?: ModelAPIConfig | null;
|
||||
proxy?: string;
|
||||
use_proxy?: boolean;
|
||||
extraHeaders?: string;
|
||||
extraBody?: string;
|
||||
extraQuery?: string;
|
||||
@@ -1390,7 +1392,7 @@ export interface ProviderCreationUpdate {
|
||||
apiKey?: string;
|
||||
apiBase: string;
|
||||
api?: ModelAPIConfig | null;
|
||||
proxy?: string;
|
||||
use_proxy?: boolean;
|
||||
extraHeaders?: string;
|
||||
extraBody?: string;
|
||||
extraQuery?: string;
|
||||
|
||||
@@ -841,7 +841,7 @@ describe("webui API helpers", () => {
|
||||
it("serializes OAuth provider advanced settings", async () => {
|
||||
await updateProviderSettings(mutationTransport, {
|
||||
provider: "xai_grok",
|
||||
proxy: "http://127.0.0.1:7890",
|
||||
use_proxy: true,
|
||||
extraBody: '{"tools":[]}',
|
||||
});
|
||||
|
||||
@@ -849,7 +849,7 @@ describe("webui API helpers", () => {
|
||||
"settings.provider.update",
|
||||
{
|
||||
provider: "xai_grok",
|
||||
proxy: "http://127.0.0.1:7890",
|
||||
use_proxy: true,
|
||||
extraBody: '{"tools":[]}',
|
||||
},
|
||||
20_000,
|
||||
@@ -864,7 +864,7 @@ describe("webui API helpers", () => {
|
||||
extraHeaders: '{"X-Tenant":"engineering"}',
|
||||
extraBody: '{"service_tier":"priority"}',
|
||||
extraQuery: '{"api-version":"2026-01-01"}',
|
||||
proxy: "http://127.0.0.1:7890",
|
||||
use_proxy: true,
|
||||
thinkingStyle: "enable_thinking",
|
||||
};
|
||||
await createProviderSettings(mutationTransport, update);
|
||||
@@ -1182,6 +1182,18 @@ describe("webui API helpers", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.each(["true", "false"])("preserves explicit MCP proxy flag %s across setup and edits", async (use_proxy) => {
|
||||
await runMcpPresetAction(mutationTransport, "enable", "notion", { use_proxy });
|
||||
expect(requestMutation).toHaveBeenLastCalledWith("settings.mcp.enable", { name: "notion", use_proxy }, 20_000);
|
||||
await startMcpOAuth(mutationTransport, "notion", false, { use_proxy });
|
||||
expect(requestMutation).toHaveBeenLastCalledWith("settings.mcp.oauth_start", { name: "notion", use_proxy }, 30_000);
|
||||
await runMcpPresetAction(mutationTransport, "proxy", "notion", { use_proxy });
|
||||
expect(requestMutation).toHaveBeenLastCalledWith("settings.mcp.proxy", { name: "notion", use_proxy }, 20_000);
|
||||
const custom = { name: "docs", transport: "sse", url: "https://example.com/sse", use_proxy };
|
||||
await saveCustomMcpServer(mutationTransport, custom);
|
||||
expect(requestMutation).toHaveBeenLastCalledWith("settings.mcp.custom", custom, 20_000);
|
||||
});
|
||||
|
||||
it("serializes custom MCP, mcp.json import, and tool allowlist actions", async () => {
|
||||
const custom = {
|
||||
name: "docs",
|
||||
|
||||
@@ -122,7 +122,7 @@ function baseSettingsPayload() {
|
||||
},
|
||||
web: {
|
||||
enable: true,
|
||||
proxy: null,
|
||||
use_proxy: false,
|
||||
user_agent: null,
|
||||
search: { max_results: 5, timeout: 30 },
|
||||
fetch: { use_jina_reader: true },
|
||||
@@ -3482,7 +3482,7 @@ describe("App layout", () => {
|
||||
},
|
||||
web: {
|
||||
enable: true,
|
||||
proxy: null,
|
||||
use_proxy: false,
|
||||
user_agent: null,
|
||||
search: { max_results: 5, timeout: 30 },
|
||||
fetch: { use_jina_reader: true },
|
||||
|
||||
@@ -54,6 +54,32 @@ describe("CredentialForm", () => {
|
||||
expect(onChange).toHaveBeenCalledWith(key, "");
|
||||
});
|
||||
|
||||
it.each(["telegram", "discord", "matrix", "slack", "whatsapp"])("renders %s proxy configuration as a switch and submits both boolean states", (channel) => {
|
||||
const key = `channels.${channel}.useProxy`;
|
||||
const setup = channelSetup({
|
||||
name: channel, display_name: channel, type: "channel", enabled: true,
|
||||
webui: channel === "whatsapp" ? "webui/index.tsx" : "webui/index.ts",
|
||||
installed: true, ready: true, status: "enabled",
|
||||
install_supported: true, requires_restart: false,
|
||||
setup: { fields: [{ key, field: "use_proxy", kind: "bool", choices: [], required: false, default_value: "false" }] },
|
||||
});
|
||||
const proxyFields = [...setup.fields ?? [], ...setup.manualFields ?? []];
|
||||
expect(proxyFields[0].section).toBe("connection");
|
||||
const onChange = vi.fn();
|
||||
const { rerender } = render(<CredentialForm fields={proxyFields} values={{ [key]: "true" }}
|
||||
visibleSecrets={{}} onChange={onChange} onToggleSecret={vi.fn()} />);
|
||||
const useProxy = screen.getByRole("switch", { name: "Use proxy" });
|
||||
expect(useProxy).toBeChecked();
|
||||
expect(screen.queryByRole("textbox")).not.toBeInTheDocument();
|
||||
fireEvent.click(useProxy);
|
||||
expect(onChange).toHaveBeenCalledWith(key, "false");
|
||||
expect(channelValuesForSubmit(proxyFields, { [key]: "false" }, new Set([key]))).toEqual({ [key]: "false" });
|
||||
rerender(<CredentialForm fields={proxyFields} values={{ [key]: "false" }}
|
||||
visibleSecrets={{}} onChange={onChange} onToggleSecret={vi.fn()} />);
|
||||
fireEvent.click(screen.getByRole("switch", { name: "Use proxy" }));
|
||||
expect(onChange).toHaveBeenLastCalledWith(key, "true");
|
||||
});
|
||||
|
||||
it("uses native radio semantics for option fields", () => {
|
||||
const onChange = vi.fn();
|
||||
render(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { fireEvent, render, screen, waitFor, within } from "@testing-library/react";
|
||||
import { act, fireEvent, render, renderHook, screen, waitFor, within } from "@testing-library/react";
|
||||
import { useState } from "react";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
@@ -6,8 +6,18 @@ import {
|
||||
McpManagementDialog,
|
||||
type McpManagementTab,
|
||||
} from "@/components/settings/system/McpManagementDialog";
|
||||
import { createSystemSettingsActions } from "@/components/settings/system/createSystemSettingsActions";
|
||||
import { useSystemSettingsState } from "@/components/settings/system/useSystemSettingsState";
|
||||
import i18n from "@/i18n";
|
||||
import type { McpPresetInfo } from "@/lib/types";
|
||||
import { NanobotClient } from "@/lib/nanobot-client";
|
||||
import type { McpPresetInfo, McpPresetsPayload } from "@/lib/types";
|
||||
import {
|
||||
installSettingsViewTestHooks,
|
||||
jsonResponse,
|
||||
renderSettingsView,
|
||||
requestMutationMock,
|
||||
settingsPayload,
|
||||
} from "@/tests/settings-test-utils";
|
||||
|
||||
const connectedPreset: McpPresetInfo = {
|
||||
name: "docs",
|
||||
@@ -83,6 +93,51 @@ describe("McpManagementDialog", () => {
|
||||
expect(onAction).toHaveBeenCalledWith("reconnect", "docs", {});
|
||||
});
|
||||
|
||||
it.each(["streamableHttp", "sse"])("edits an existing %s proxy flag without restarting OAuth", (transport) => {
|
||||
const onAction = vi.fn();
|
||||
const { updateDialog } = renderDialog({
|
||||
initialTab: "connection", onAction,
|
||||
preset: { ...connectedPreset, transport, use_proxy: true },
|
||||
});
|
||||
const useProxy = screen.getByRole("switch", { name: "Use proxy" });
|
||||
expect(useProxy).toBeChecked();
|
||||
expect(screen.queryByRole("textbox", { name: /proxy/i })).not.toBeInTheDocument();
|
||||
fireEvent.click(useProxy);
|
||||
expect(onAction).not.toHaveBeenCalled();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Save changes" }));
|
||||
expect(onAction).toHaveBeenCalledWith("proxy", "docs", { use_proxy: "false" });
|
||||
updateDialog({ ...connectedPreset, transport, use_proxy: false });
|
||||
expect(useProxy).not.toBeChecked();
|
||||
expect(screen.queryByRole("button", { name: "Save changes" })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("shows proxy guidance on demand without changing the connection draft", async () => {
|
||||
const onAction = vi.fn();
|
||||
renderDialog({ initialTab: "connection", onAction });
|
||||
expect(screen.queryByText("Uses the shared proxy in Advanced.")).not.toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Use proxy" }));
|
||||
expect(await screen.findByRole("tooltip")).toHaveTextContent("Uses the shared proxy in Advanced.");
|
||||
expect(onAction).not.toHaveBeenCalled();
|
||||
expect(screen.getByRole("switch", { name: "Use proxy" })).not.toBeChecked();
|
||||
expect(screen.queryByRole("button", { name: "Save changes" })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("preserves the configured proxy flag when reconnecting OAuth", () => {
|
||||
const onOAuthConnect = vi.fn();
|
||||
renderDialog({
|
||||
initialTab: "connection", onOAuthConnect,
|
||||
preset: { ...connectedPreset, auth: "oauth", use_proxy: true },
|
||||
});
|
||||
expect(screen.getByRole("switch", { name: "Use proxy" })).toBeChecked();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Reconnect" }));
|
||||
expect(onOAuthConnect).toHaveBeenCalledWith("docs", true, { use_proxy: "true" });
|
||||
});
|
||||
|
||||
it("does not offer a proxy switch for stdio servers", () => {
|
||||
renderDialog({ initialTab: "connection", preset: { ...connectedPreset, transport: "stdio" } });
|
||||
expect(screen.queryByRole("switch", { name: "Use proxy" })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("loads tools on entry and replaces passive inspection copy with recovery", async () => {
|
||||
const onAction = vi.fn();
|
||||
renderDialog({
|
||||
@@ -154,21 +209,24 @@ function renderDialog({
|
||||
initialTab,
|
||||
onAction = vi.fn(),
|
||||
onToolsChange = vi.fn(),
|
||||
onOAuthConnect = vi.fn(),
|
||||
preset = connectedPreset,
|
||||
actionKey = null,
|
||||
}: {
|
||||
initialTab: McpManagementTab;
|
||||
onAction?: ReturnType<typeof vi.fn>;
|
||||
onToolsChange?: ReturnType<typeof vi.fn>;
|
||||
onOAuthConnect?: ReturnType<typeof vi.fn>;
|
||||
preset?: McpPresetInfo;
|
||||
actionKey?: string | null;
|
||||
}) {
|
||||
function Harness({ preset, actionKey }: { preset: McpPresetInfo; actionKey: string | null }) {
|
||||
const [tab, setTab] = useState(initialTab);
|
||||
const [values, setValues] = useState<Record<string, string>>({});
|
||||
return (
|
||||
<McpManagementDialog
|
||||
preset={preset}
|
||||
values={{}}
|
||||
values={values}
|
||||
actionKey={actionKey}
|
||||
statusLabel="Connected"
|
||||
statusTone="success"
|
||||
@@ -176,9 +234,9 @@ function renderDialog({
|
||||
icon={<span aria-hidden>DM</span>}
|
||||
onTabChange={setTab}
|
||||
onOpenChange={vi.fn()}
|
||||
onFieldChange={vi.fn()}
|
||||
onFieldChange={(_name, field, value) => setValues((prev) => ({ ...prev, [field]: value }))}
|
||||
onAction={onAction}
|
||||
onOAuthConnect={vi.fn()}
|
||||
onOAuthConnect={onOAuthConnect}
|
||||
onToolsChange={onToolsChange}
|
||||
/>
|
||||
);
|
||||
@@ -191,3 +249,241 @@ function renderDialog({
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
describe("MCP connection draft lifecycle", () => {
|
||||
installSettingsViewTestHooks();
|
||||
|
||||
const metabasePreset: McpPresetInfo = {
|
||||
...connectedPreset,
|
||||
name: "metabase",
|
||||
display_name: "Metabase",
|
||||
auth: "oauth",
|
||||
source: "preset",
|
||||
required_fields: [{
|
||||
name: "mcp_url", label: "MCP server URL", secret: false, required: true, configured: true,
|
||||
}],
|
||||
};
|
||||
|
||||
it("reopens and reconnects without proxy after OAuth with proxy and a same-endpoint import", async () => {
|
||||
const endpoint = "https://app.xmind.com/api/mcp";
|
||||
let preset: McpPresetInfo = {
|
||||
...connectedPreset,
|
||||
name: "xmind",
|
||||
display_name: "Xmind",
|
||||
auth: "oauth",
|
||||
source: "preset",
|
||||
installed: false,
|
||||
configured: false,
|
||||
available: false,
|
||||
status: "not_installed",
|
||||
runtime_status: undefined,
|
||||
connection_summary: "",
|
||||
use_proxy: false,
|
||||
};
|
||||
const importedConfig = JSON.stringify({
|
||||
mcpServers: { Xmind: { url: endpoint, auth: "oauth", useProxy: false } },
|
||||
});
|
||||
vi.stubGlobal("open", vi.fn(() => null));
|
||||
vi.stubGlobal("fetch", vi.fn(async (input: RequestInfo | URL) => {
|
||||
const url = String(input);
|
||||
if (url === "/api/settings") return jsonResponse(settingsPayload());
|
||||
if (url === "/api/settings/cli-apps") return jsonResponse({ apps: [], installed_count: 0 });
|
||||
if (url === "/api/settings/mcp-presets") {
|
||||
return jsonResponse({ presets: [preset], installed_count: Number(preset.installed) });
|
||||
}
|
||||
if (url === "/api/settings/mcp-oauth/status?flow_id=flow-proxy") {
|
||||
preset = {
|
||||
...preset,
|
||||
installed: true,
|
||||
configured: true,
|
||||
available: true,
|
||||
status: "configured",
|
||||
runtime_status: "connected",
|
||||
connection_summary: endpoint,
|
||||
use_proxy: true,
|
||||
};
|
||||
return jsonResponse({
|
||||
flow_id: "flow-proxy", name: "xmind", status: "connected", expires_in: 299,
|
||||
});
|
||||
}
|
||||
return { ok: false, status: 404, text: async () => "Not found" } as Response;
|
||||
}));
|
||||
requestMutationMock.mockImplementation(async (action: string) => {
|
||||
if (action === "settings.mcp.oauth_start") {
|
||||
return {
|
||||
flow_id: "flow-proxy", name: "xmind", status: "authorization_required", expires_in: 300,
|
||||
authorization_url: "https://accounts.xmind.test/authorize?state=proxy",
|
||||
};
|
||||
}
|
||||
if (action === "settings.mcp.import") {
|
||||
preset = { ...preset, use_proxy: false };
|
||||
return {
|
||||
presets: [preset], installed_count: 1,
|
||||
last_action: { ok: true, message: "Imported 1 MCP server(s)." },
|
||||
};
|
||||
}
|
||||
if (action === "settings.mcp.oauth_cancel") {
|
||||
return { flow_id: "flow-proxy", name: "xmind", status: "cancelled", expires_in: 299 };
|
||||
}
|
||||
throw new Error(`Unexpected mutation: ${action}`);
|
||||
});
|
||||
|
||||
renderSettingsView({ initialSection: "apps" });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Xmind" }));
|
||||
fireEvent.click(screen.getByRole("switch", { name: "Use proxy" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Connect" }));
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.mcp.oauth_start", { name: "xmind", use_proxy: "true" }, 30_000,
|
||||
));
|
||||
await screen.findByRole("button", { name: "Manage Xmind" });
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Import" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Import mcp.json" }));
|
||||
const editor = screen.getByRole("dialog", { name: "Import mcp.json" });
|
||||
fireEvent.change(within(editor).getByRole("textbox", { name: "Import mcp.json" }), {
|
||||
target: { value: importedConfig },
|
||||
});
|
||||
await act(async () => fireEvent.click(within(editor).getByRole("button", { name: "Save" })));
|
||||
await act(async () => fireEvent.click(screen.getAllByRole("button", { name: "Import" })[1]));
|
||||
expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.mcp.import", { config: importedConfig }, 20_000,
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Manage Xmind" }));
|
||||
fireEvent.click(screen.getByRole("tab", { name: "Connection" }));
|
||||
expect(screen.getByRole("switch", { name: "Use proxy" })).not.toBeChecked();
|
||||
expect(screen.getByText(endpoint)).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Reconnect" }));
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenLastCalledWith(
|
||||
"settings.mcp.oauth_start", { name: "xmind", reset: true, use_proxy: "false" }, 30_000,
|
||||
));
|
||||
const cancel = await screen.findByRole("button", { name: "Cancel" });
|
||||
await act(async () => fireEvent.click(cancel));
|
||||
});
|
||||
|
||||
it("retires the consumed OAuth proxy draft only after success, preserving a failed attempt", async () => {
|
||||
const { result } = renderMcpActions();
|
||||
const drafts = { docs: { use_proxy: "true" }, metabase: { mcp_url: "https://analytics.example.com/mcp", use_proxy: "true" } };
|
||||
await act(async () => result.current.state.setMcpFieldValues(drafts));
|
||||
vi.stubGlobal("open", vi.fn(() => null));
|
||||
requestMutationMock.mockResolvedValueOnce({
|
||||
flow_id: "flow-failed", name: "docs", status: "failed", error: "Proxy connection failed", expires_in: 300,
|
||||
});
|
||||
|
||||
await act(async () => result.current.actions.handleMcpOAuthConnect("docs", false, drafts.docs));
|
||||
expect(result.current.state.mcpError).toBe("Proxy connection failed");
|
||||
expect(result.current.state.mcpFieldValues).toEqual(drafts);
|
||||
|
||||
requestMutationMock.mockResolvedValueOnce({
|
||||
flow_id: "flow-connected", name: "docs", status: "connected", expires_in: 300,
|
||||
});
|
||||
vi.stubGlobal("fetch", vi.fn(async () => jsonResponse({
|
||||
presets: [{ ...connectedPreset, auth: "oauth", use_proxy: true }], installed_count: 1,
|
||||
})));
|
||||
await act(async () => result.current.actions.handleMcpOAuthConnect("docs", false, drafts.docs));
|
||||
expect(result.current.state.mcpPresets?.presets[0].use_proxy).toBe(true);
|
||||
expect(result.current.state.mcpFieldValues).toEqual({ docs: {}, metabase: drafts.metabase });
|
||||
});
|
||||
|
||||
it.each([true, false])("reconciles only accepted import names (mcpServers wrapper: %s)", async (wrapped) => {
|
||||
const { result } = renderMcpActions();
|
||||
const drafts = {
|
||||
metabase: { use_proxy: "true", mcp_url: "https://analytics.example.com/mcp" },
|
||||
docs: { use_proxy: "true" },
|
||||
};
|
||||
const servers = { Metabase: { url: metabasePreset.connection_summary, auth: "oauth", useProxy: false } };
|
||||
const config = JSON.stringify(wrapped ? { mcpServers: servers } : servers);
|
||||
await act(async () => {
|
||||
result.current.state.setMcpFieldValues(drafts);
|
||||
result.current.state.setMcpConfigImport(config);
|
||||
});
|
||||
requestMutationMock.mockRejectedValueOnce(new Error("Import could not be saved"));
|
||||
await act(async () => result.current.actions.handleImportMcpConfig());
|
||||
expect(result.current.state.mcpFieldValues).toEqual(drafts);
|
||||
expect(result.current.state.mcpConfigImport).toBe(config);
|
||||
|
||||
requestMutationMock.mockResolvedValueOnce({
|
||||
presets: [{ ...metabasePreset, use_proxy: false }, connectedPreset],
|
||||
installed_count: 2,
|
||||
last_action: { ok: true, message: "Imported 1 MCP server(s)." },
|
||||
});
|
||||
await act(async () => result.current.actions.handleImportMcpConfig());
|
||||
expect(result.current.state.mcpFieldValues).toEqual({
|
||||
metabase: { mcp_url: drafts.metabase.mcp_url }, docs: drafts.docs,
|
||||
});
|
||||
expect(result.current.state.mcpConfigImport).toBe("");
|
||||
});
|
||||
|
||||
it("reconciles a saved custom replacement even while its OAuth authorization is pending", async () => {
|
||||
const { result } = renderMcpActions();
|
||||
await act(async () => {
|
||||
result.current.state.setMcpFieldValues({
|
||||
metabase: { use_proxy: "true", mcp_url: "https://analytics.example.com/mcp" }, docs: { use_proxy: "true" },
|
||||
});
|
||||
result.current.state.setCustomMcpForm((prev) => ({
|
||||
...prev, name: "Metabase", transport: "streamableHttp", auth: "oauth",
|
||||
url: metabasePreset.connection_summary, useProxy: false,
|
||||
}));
|
||||
});
|
||||
requestMutationMock.mockResolvedValueOnce({
|
||||
presets: [{ ...metabasePreset, configured: false, use_proxy: false, status: "authorization_required" }],
|
||||
installed_count: 1,
|
||||
last_action: { ok: true, message: "Saved MCP server metabase." },
|
||||
hot_reload: { ok: false, message: "Authorization required", failed: ["metabase"] },
|
||||
});
|
||||
await act(async () => result.current.actions.handleSaveCustomMcp());
|
||||
expect(result.current.state.mcpError).toBeNull();
|
||||
expect(result.current.state.mcpFieldValues).toEqual({
|
||||
metabase: { mcp_url: "https://analytics.example.com/mcp" }, docs: { use_proxy: "true" },
|
||||
});
|
||||
});
|
||||
|
||||
it("retains failed proxy drafts, then retires applied or removed flags without discarding other edits", async () => {
|
||||
const { result } = renderMcpActions();
|
||||
const drafts = {
|
||||
metabase: { use_proxy: "true", mcp_url: "https://analytics.example.com/mcp" }, docs: { use_proxy: "true" },
|
||||
};
|
||||
await act(async () => result.current.state.setMcpFieldValues(drafts));
|
||||
const payload: McpPresetsPayload = { presets: [{ ...metabasePreset, use_proxy: true }], installed_count: 1 };
|
||||
requestMutationMock.mockRejectedValueOnce(new Error("Proxy could not be saved"));
|
||||
await act(async () => result.current.actions.handleMcpPresetAction("proxy", "metabase", { use_proxy: "true" }));
|
||||
expect(result.current.state.mcpFieldValues).toEqual(drafts);
|
||||
|
||||
requestMutationMock.mockResolvedValueOnce(payload);
|
||||
await act(async () => result.current.actions.handleMcpPresetAction("proxy", "metabase", { use_proxy: "true" }));
|
||||
expect(result.current.state.mcpFieldValues).toEqual({
|
||||
metabase: { mcp_url: drafts.metabase.mcp_url }, docs: drafts.docs,
|
||||
});
|
||||
|
||||
await act(async () => result.current.state.setMcpFieldValues(drafts));
|
||||
requestMutationMock.mockResolvedValueOnce({
|
||||
presets: [], installed_count: 0, last_action: { ok: true, removed: true, message: "Removed MCP server metabase." },
|
||||
});
|
||||
await act(async () => result.current.actions.handleMcpPresetAction("remove", "metabase"));
|
||||
expect(result.current.state.mcpFieldValues).toEqual({
|
||||
metabase: { mcp_url: drafts.metabase.mcp_url }, docs: drafts.docs,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function renderMcpActions() {
|
||||
const client = new NanobotClient({ url: "ws://example.test" });
|
||||
client.requestMutation = requestMutationMock;
|
||||
return renderHook(() => {
|
||||
const state = useSystemSettingsState();
|
||||
const actions = createSystemSettingsActions({
|
||||
state,
|
||||
featureCatalog: [],
|
||||
client,
|
||||
token: "tok",
|
||||
getToken: () => "tok",
|
||||
t: i18n.t,
|
||||
applyPayload: vi.fn(),
|
||||
maybeRestartHostEngine: vi.fn(),
|
||||
setPendingRestartSections: vi.fn(),
|
||||
refreshAutomations: vi.fn(),
|
||||
});
|
||||
return { state, actions };
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { changeProxyAddress, changeProxyAuthentication, splitProxyUrl } from "@/lib/proxy-url";
|
||||
|
||||
describe("Proxy URL credentials", () => {
|
||||
it("separates encoded credentials without changing the address or decoded content", () => {
|
||||
const raw = "socks5://user%40org:p%3Aa%2F%25%2B%E5%AF%86@[::1]:1080/";
|
||||
const parts = splitProxyUrl(raw);
|
||||
expect(parts.address).toBe("socks5://[::1]:1080/");
|
||||
expect(parts.username).toBe("user@org");
|
||||
expect(parts.password).toBe("p:a/%+密");
|
||||
expect(changeProxyAuthentication(raw, parts.username, parts.password)).toBe(raw);
|
||||
});
|
||||
|
||||
it("preserves unchanged credential escapes while changing host", () => {
|
||||
expect(changeProxyAddress("http://u%73er:p%61ss@old:8080", "https://new:8443"))
|
||||
.toBe("https://u%73er:p%61ss@new:8443");
|
||||
});
|
||||
|
||||
it("encodes typed separators, whitespace, percent, plus and Unicode once", () => {
|
||||
const raw = changeProxyAuthentication("http://proxy:8080", "u:@ /%+名", "p:@ /%+密");
|
||||
expect(raw).toBe("http://u%3A%40%20%2F%25%2B%E5%90%8D:p%3A%40%20%2F%25%2B%E5%AF%86@proxy:8080");
|
||||
expect(splitProxyUrl(raw).password).toBe("p:@ /%+密");
|
||||
});
|
||||
|
||||
it("updates only the edited credential and supports username-only authentication", () => {
|
||||
const raw = changeProxyAuthentication("http://user@proxy:8080", "user", "");
|
||||
expect(raw).toBe("http://user@proxy:8080");
|
||||
expect(changeProxyAuthentication(raw, "user", "password")).toBe("http://user:password@proxy:8080");
|
||||
expect(changeProxyAuthentication("http://u:p%61ss@proxy", "new", "pass")).toBe("http://new:p%61ss@proxy");
|
||||
});
|
||||
|
||||
it("preserves raw environment references rather than encoding or resolving them", () => {
|
||||
expect(changeProxyAuthentication("${SCHEME}://${USER}:${PASSWORD}@proxy:8080", "${USER}", "new:@"))
|
||||
.toBe("${SCHEME}://${USER}:new%3A%40@proxy:8080");
|
||||
expect(changeProxyAddress("http://${PROXY_AUTH}@old:8080", "http://new:8080"))
|
||||
.toBe("http://${PROXY_AUTH}@new:8080");
|
||||
expect(splitProxyUrl("${FULL_PROXY}").address).toBe("${FULL_PROXY}");
|
||||
expect(changeProxyAddress("http://u:p@old", "${FULL_PROXY}")).toBe("${FULL_PROXY}");
|
||||
});
|
||||
|
||||
it("uses pasted URL authentication and removes it only on explicit clearing", () => {
|
||||
expect(changeProxyAddress("http://old:pw@proxy", "http://new:secret@next"))
|
||||
.toBe("http://new:secret@next");
|
||||
expect(changeProxyAuthentication("http://u:p@proxy", "", "")).toBe("http://proxy");
|
||||
expect(changeProxyAddress("http://u:p@proxy", "")).toBe("");
|
||||
});
|
||||
|
||||
it("does not throw or rewrite an existing malformed percent escape on an address edit", () => {
|
||||
expect(splitProxyUrl("http://u:p%invalid@old").password).toBe("p%invalid");
|
||||
expect(changeProxyAddress("http://u:p%invalid@old", "http://new")).toBe("http://u:p%invalid@new");
|
||||
});
|
||||
});
|
||||
@@ -18,6 +18,7 @@ const xmindMcpPreset = {
|
||||
docs_url: "https://xmind.com/user-guide/xmind-mcp",
|
||||
transport: "streamableHttp",
|
||||
auth: "oauth" as const,
|
||||
use_proxy: false,
|
||||
requires: "Xmind account",
|
||||
note: "Connects securely in your browser with Xmind OAuth.",
|
||||
install_supported: true,
|
||||
@@ -33,9 +34,46 @@ const xmindMcpPreset = {
|
||||
source: "preset",
|
||||
};
|
||||
|
||||
async function connectXmind() {
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Xmind" }));
|
||||
const dialog = await screen.findByRole("dialog", { name: "Xmind" });
|
||||
fireEvent.click(within(dialog).getByRole("button", { name: "Connect" }));
|
||||
}
|
||||
|
||||
describe("SettingsView Apps catalog", () => {
|
||||
installSettingsViewTestHooks();
|
||||
|
||||
it.each([null, "", " ", "http://127.0.0.1:8080"])("offers inline proxy setup for missing shared proxy %j", async (proxy) => {
|
||||
const settings = { ...settingsPayload(), runtime_config: { "network.proxy": proxy } };
|
||||
vi.stubGlobal("fetch", vi.fn(async (input: RequestInfo | URL) => {
|
||||
const url = String(input);
|
||||
if (url === "/api/settings") return jsonResponse(settings);
|
||||
if (url === "/api/settings/cli-apps") return jsonResponse({ apps: [], installed_count: 0 });
|
||||
if (url === "/api/settings/mcp-presets") return jsonResponse({ presets: [xmindMcpPreset], installed_count: 0 });
|
||||
return { ok: false, status: 404, text: async () => "Not found" } as Response;
|
||||
}));
|
||||
renderSettingsView({ initialSection: "apps" });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Xmind" }));
|
||||
const dialog = await screen.findByRole("dialog", { name: "Xmind" });
|
||||
const configure = within(dialog).queryByRole("button", { name: "Configure proxy" });
|
||||
if (proxy?.trim()) {
|
||||
expect(configure).not.toBeInTheDocument();
|
||||
expect(within(dialog).getByRole("switch", { name: "Use proxy" })).toBeInTheDocument();
|
||||
} else {
|
||||
expect(configure).toBeInTheDocument();
|
||||
expect(within(dialog).queryByRole("switch", { name: "Use proxy" })).not.toBeInTheDocument();
|
||||
fireEvent.click(configure!);
|
||||
const setup = await screen.findByRole("dialog", { name: "Shared proxy" });
|
||||
expect(dialog).toBeInTheDocument();
|
||||
const input = within(setup).getByRole("textbox", { name: "Shared proxy" });
|
||||
await waitFor(() => expect(input).toHaveFocus());
|
||||
fireEvent.click(within(setup).getByRole("button", { name: "Cancel" }));
|
||||
expect(await screen.findByRole("dialog", { name: "Xmind" })).toBe(dialog);
|
||||
}
|
||||
expect(requestMutationMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("collects an instance MCP URL before starting browser authorization", async () => {
|
||||
const metabasePreset = {
|
||||
...xmindMcpPreset,
|
||||
@@ -85,14 +123,14 @@ describe("SettingsView Apps catalog", () => {
|
||||
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.mcp.oauth_start",
|
||||
{ name: "metabase", mcp_url: "https://analytics.example.com/api/metabase-mcp" },
|
||||
{ name: "metabase", mcp_url: "https://analytics.example.com/api/metabase-mcp", use_proxy: "false" },
|
||||
expect.any(Number),
|
||||
));
|
||||
});
|
||||
|
||||
|
||||
|
||||
it("connects an OAuth MCP from the Apps catalog without manual callback input", async () => {
|
||||
it("sets the proxy flag before the first OAuth request, even with no credential fields", async () => {
|
||||
let connected = false;
|
||||
const fetchMock = vi.fn(async (input: RequestInfo | URL) => {
|
||||
const url = String(input);
|
||||
@@ -110,6 +148,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
available: true,
|
||||
status: "configured",
|
||||
connection_summary: "https://app.xmind.com/api/mcp",
|
||||
use_proxy: true,
|
||||
}
|
||||
: xmindMcpPreset],
|
||||
installed_count: connected ? 1 : 0,
|
||||
@@ -164,6 +203,17 @@ describe("SettingsView Apps catalog", () => {
|
||||
const connectButton = await screen.findByRole("button", { name: "Connect Xmind" });
|
||||
expect(connectButton).toHaveTextContent("Connect");
|
||||
fireEvent.click(connectButton);
|
||||
const dialog = await screen.findByRole("dialog", { name: "Xmind" });
|
||||
expect(open).not.toHaveBeenCalled();
|
||||
expect(requestMutationMock).not.toHaveBeenCalled();
|
||||
const useProxy = within(dialog).getByRole("switch", { name: "Use proxy" });
|
||||
expect(useProxy).not.toBeChecked();
|
||||
expect(within(dialog).queryByRole("textbox", { name: /proxy/i })).not.toBeInTheDocument();
|
||||
fireEvent.click(useProxy);
|
||||
fireEvent.click(within(dialog).getByRole("button", { name: "Connect" }));
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.mcp.oauth_start", { name: "xmind", use_proxy: "true" }, 30_000,
|
||||
));
|
||||
|
||||
expect(open).toHaveBeenCalledWith(
|
||||
"about:blank",
|
||||
@@ -185,6 +235,9 @@ describe("SettingsView Apps catalog", () => {
|
||||
expect(await screen.findByRole("button", { name: "Manage Xmind" }, { timeout: 2500 }))
|
||||
.toHaveTextContent("Manage");
|
||||
expect(popup.close).toHaveBeenCalledTimes(1);
|
||||
fireEvent.click(screen.getByRole("button", { name: "Manage Xmind" }));
|
||||
fireEvent.click(screen.getByRole("tab", { name: "Connection" }));
|
||||
expect(screen.getByRole("switch", { name: "Use proxy" })).toBeChecked();
|
||||
expect(replace).toHaveBeenCalledTimes(1);
|
||||
expect(fetchMock).toHaveBeenCalledWith(
|
||||
"/api/settings/mcp-oauth/status?flow_id=flow-123",
|
||||
@@ -250,7 +303,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.mcp.oauth_start",
|
||||
{ name: "xmind", reset: true },
|
||||
{ name: "xmind", reset: true, use_proxy: "false" },
|
||||
30_000,
|
||||
));
|
||||
await act(() => i18n.changeLanguage("en"));
|
||||
@@ -405,6 +458,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
display_name: "team-mcp",
|
||||
source: "custom",
|
||||
installed: true,
|
||||
use_proxy: true,
|
||||
status: "authorization_required",
|
||||
connection_summary: "https://mcp.example.com/mcp",
|
||||
};
|
||||
@@ -464,6 +518,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
screen.getByText("Save the server, then select Connect to sign in."),
|
||||
).toBeInTheDocument();
|
||||
|
||||
fireEvent.click(screen.getByRole("switch", { name: "Use proxy" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Save MCP server" }));
|
||||
|
||||
await waitFor(() => {
|
||||
@@ -477,12 +532,15 @@ describe("SettingsView Apps catalog", () => {
|
||||
transport: "streamableHttp",
|
||||
url: "https://mcp.example.com/mcp",
|
||||
auth: "oauth",
|
||||
use_proxy: "true",
|
||||
});
|
||||
expect(values).not.toHaveProperty("headers");
|
||||
expect(saveCall?.[2]).toBe(20_000);
|
||||
});
|
||||
expect(await screen.findByRole("button", { name: "Connect team-mcp" }))
|
||||
.toBeInTheDocument();
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect team-mcp" }));
|
||||
const connection = await screen.findByRole("dialog", { name: "team-mcp" });
|
||||
expect(within(connection).getByRole("switch", { name: "Use proxy" })).toBeChecked();
|
||||
expect(requestMutationMock).not.toHaveBeenCalledWith("settings.mcp.oauth_start", expect.anything(), expect.anything());
|
||||
});
|
||||
|
||||
it("offers a pasted callback flow when the remote WebUI uses HTTP", async () => {
|
||||
@@ -561,7 +619,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
|
||||
renderSettingsView({ initialSection: "apps" });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Xmind" }));
|
||||
await connectXmind();
|
||||
|
||||
const callbackInput = await screen.findByRole("textbox", { name: "Callback URL" });
|
||||
expect(screen.getByText(/localhost page will not load/i)).toBeInTheDocument();
|
||||
@@ -628,7 +686,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
|
||||
renderSettingsView({ initialSection: "apps" });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Xmind" }));
|
||||
await connectXmind();
|
||||
|
||||
const cancelButton = await screen.findByRole("button", { name: "Cancel" });
|
||||
expect(screen.getByRole("button", { name: "Connecting Xmind" })).toBeInTheDocument();
|
||||
@@ -734,7 +792,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
|
||||
renderSettingsView({ initialSection: "apps" });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Xmind" }));
|
||||
await connectXmind();
|
||||
|
||||
const continueButton = await screen.findByRole("button", { name: "Continue sign-in" });
|
||||
expect(screen.getByRole("status")).toHaveTextContent("Open the sign-in page to continue.");
|
||||
@@ -804,7 +862,7 @@ describe("SettingsView Apps catalog", () => {
|
||||
|
||||
renderSettingsView({ initialSection: "apps" });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Connect Xmind" }));
|
||||
await connectXmind();
|
||||
|
||||
await waitFor(() => expect(statusCalls).toBe(1), { timeout: 2000 });
|
||||
expect(screen.getByRole("status")).toHaveTextContent(
|
||||
|
||||
@@ -317,9 +317,10 @@ describe("Settings capabilities", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("edits the existing web proxy in web access even while disabled, without a duplicate advanced editor", async () => {
|
||||
it("saves the web proxy switch separately from the shared address in Advanced", async () => {
|
||||
let payload = { ...settingsPayload(), runtime_config: {
|
||||
"tools.web.enable": false, "tools.web.proxy": "http://old-proxy.example:8080", "tools.web.user_agent": null,
|
||||
"tools.web.enable": false, "tools.web.use_proxy": false,
|
||||
"network.proxy": "http://old-proxy.example:8080", "tools.web.user_agent": null,
|
||||
} } as SettingsPayload;
|
||||
requestMutationMock.mockImplementation(async (_method, update) => {
|
||||
payload = { ...payload, runtime_config: { ...payload.runtime_config, ...update.values },
|
||||
@@ -329,21 +330,41 @@ describe("Settings capabilities", () => {
|
||||
renderSettingsView({ initialSection: "capabilities", initialSettings: payload });
|
||||
fireEvent.click(within(screen.getByRole("region", { name: "Web access" })).getByRole("button", { name: "Configure" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced options" }));
|
||||
const proxy = screen.getByRole("textbox", { name: "Web proxy" });
|
||||
expect(proxy).toHaveValue("http://old-proxy.example:8080");
|
||||
fireEvent.change(proxy, { target: { value: "http://new-proxy.example:7890" } });
|
||||
const useProxy = screen.getByRole("switch", { name: "Use proxy" });
|
||||
expect(useProxy).not.toBeChecked();
|
||||
expect(screen.queryByRole("textbox", { name: /proxy/i })).not.toBeInTheDocument();
|
||||
expect(screen.queryByLabelText("Shared proxy")).not.toBeInTheDocument();
|
||||
fireEvent.click(useProxy);
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.runtime_config.update", { values: { "tools.web.proxy": "http://new-proxy.example:7890" } }, 20_000,
|
||||
"settings.runtime_config.update", { values: { "tools.web.use_proxy": true } }, 20_000,
|
||||
));
|
||||
expect(await screen.findByText("Saved. Restart to apply changes.")).toBeVisible();
|
||||
fireEvent.change(proxy, { target: { value: "" } });
|
||||
await waitFor(() => expect(useProxy).toBeEnabled());
|
||||
expect(useProxy).toBeChecked();
|
||||
fireEvent.click(useProxy);
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenLastCalledWith(
|
||||
"settings.runtime_config.update", { values: { "tools.web.proxy": null } }, 20_000,
|
||||
"settings.runtime_config.update", { values: { "tools.web.use_proxy": false } }, 20_000,
|
||||
));
|
||||
fireEvent.click(within(screen.getByRole("dialog", { name: "Web access" })).getByRole("button", { name: "Close" }));
|
||||
expect(screen.getByRole("switch", { name: "Web access" })).not.toBeChecked();
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced" }));
|
||||
expect(screen.queryByRole("textbox", { name: "Web proxy" })).not.toBeInTheDocument();
|
||||
const proxy = screen.getByRole("textbox", { name: "Shared proxy" });
|
||||
expect(proxy).toHaveAttribute("type", "text");
|
||||
expect(proxy).toHaveValue("http://old-proxy.example:8080");
|
||||
expect(screen.queryByRole("switch", { name: "Use proxy" })).not.toBeInTheDocument();
|
||||
const address = "http://user:secret@new-proxy.example:7890";
|
||||
fireEvent.change(proxy, { target: { value: address } });
|
||||
expect(proxy).toHaveValue("http://new-proxy.example:7890");
|
||||
expect(screen.getByLabelText("Password")).toHaveAttribute("type", "password");
|
||||
fireEvent.click(within(screen.getByRole("region", { name: "Shared proxy" })).getByRole("button", { name: "Save" }));
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenLastCalledWith(
|
||||
"settings.runtime_config.update", { values: { "network.proxy": address } }, 20_000,
|
||||
));
|
||||
fireEvent.click(screen.getByRole("button", { name: "System" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced" }));
|
||||
expect(screen.getByLabelText("Shared proxy", { selector: "input" })).toHaveValue("http://new-proxy.example:7890");
|
||||
expect(screen.getByLabelText("Username")).toHaveValue("user");
|
||||
expect(screen.getByLabelText("Password")).toHaveValue("secret");
|
||||
expect(document.body).not.toHaveTextContent(address);
|
||||
});
|
||||
|
||||
it("saves optional-key web search providers without an API key", async () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { fireEvent, screen, waitFor, within } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { expect, it, vi } from "vitest";
|
||||
import type { SettingsPayload } from "@/lib/types";
|
||||
import type { ProviderCreationUpdate, SettingsPayload } from "@/lib/types";
|
||||
import { requestMutationMock, jsonResponse, settingsPayload, renderSettingsView, installSettingsViewTestHooks } from "@/tests/settings-test-utils";
|
||||
|
||||
|
||||
@@ -711,7 +711,7 @@ describe("Settings providers", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("saves scoped proxies for xAI and OpenAI Codex OAuth providers", async () => {
|
||||
it("saves proxy switches for xAI and OpenAI Codex OAuth providers before sign-in", async () => {
|
||||
const base = settingsPayload();
|
||||
const providers: SettingsPayload["providers"] = [
|
||||
{
|
||||
@@ -727,8 +727,8 @@ describe("Settings providers", () => {
|
||||
oauth_account: null,
|
||||
oauth_expires_at: null,
|
||||
oauth_login_supported: true,
|
||||
proxy: "http://127.0.0.1:7000",
|
||||
advanced_fields: ["extra_body", "proxy"],
|
||||
use_proxy: true,
|
||||
advanced_fields: ["extra_body", "use_proxy"],
|
||||
extra_body: null,
|
||||
},
|
||||
{
|
||||
@@ -744,8 +744,8 @@ describe("Settings providers", () => {
|
||||
oauth_account: null,
|
||||
oauth_expires_at: null,
|
||||
oauth_login_supported: true,
|
||||
proxy: null,
|
||||
advanced_fields: ["extra_body", "proxy"],
|
||||
use_proxy: false,
|
||||
advanced_fields: ["extra_body", "use_proxy"],
|
||||
extra_body: null,
|
||||
},
|
||||
];
|
||||
@@ -764,7 +764,7 @@ describe("Settings providers", () => {
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
requestMutationMock.mockImplementation(async (
|
||||
_action: string,
|
||||
values: { provider?: string; proxy?: string; extraBody?: string },
|
||||
values: { provider?: string; use_proxy?: boolean; extraBody?: string },
|
||||
) => {
|
||||
payload = {
|
||||
...payload,
|
||||
@@ -772,7 +772,7 @@ describe("Settings providers", () => {
|
||||
provider.name === values.provider
|
||||
? {
|
||||
...provider,
|
||||
proxy: values.proxy || null,
|
||||
use_proxy: values.use_proxy,
|
||||
extra_body: values.extraBody ? JSON.parse(values.extraBody) : null,
|
||||
}
|
||||
: provider,
|
||||
@@ -785,9 +785,10 @@ describe("Settings providers", () => {
|
||||
|
||||
await chooseProviderToConfigure("xAI Grok");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced options" }));
|
||||
const xaiProxy = screen.getByLabelText("Network proxy");
|
||||
expect(xaiProxy).toHaveValue("http://127.0.0.1:7000");
|
||||
fireEvent.change(xaiProxy, { target: { value: "http://127.0.0.1:7890" } });
|
||||
const xaiProxy = screen.getByRole("switch", { name: "Use proxy" });
|
||||
expect(xaiProxy).toBeChecked();
|
||||
expect(screen.queryByPlaceholderText("http://127.0.0.1:7890")).not.toBeInTheDocument();
|
||||
fireEvent.click(xaiProxy);
|
||||
expect(screen.getByRole("button", { name: "Sign in" })).toBeDisabled();
|
||||
expect(screen.getByRole("button", { name: "Sign in" })).toHaveAttribute(
|
||||
"title",
|
||||
@@ -801,7 +802,7 @@ describe("Settings providers", () => {
|
||||
{
|
||||
provider: "xai_grok",
|
||||
extraBody: "",
|
||||
proxy: "http://127.0.0.1:7890",
|
||||
use_proxy: false,
|
||||
},
|
||||
20_000,
|
||||
),
|
||||
@@ -812,9 +813,9 @@ describe("Settings providers", () => {
|
||||
fireEvent.click(screen.getByRole("button", { name: "Back to providers" }));
|
||||
await chooseProviderToConfigure("OpenAI Codex");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced options" }));
|
||||
const codexProxy = screen.getByLabelText("Network proxy");
|
||||
expect(codexProxy).toHaveValue("");
|
||||
fireEvent.change(codexProxy, { target: { value: "http://proxy.example:8080" } });
|
||||
const codexProxy = screen.getByRole("switch", { name: "Use proxy" });
|
||||
expect(codexProxy).not.toBeChecked();
|
||||
fireEvent.click(codexProxy);
|
||||
fireEvent.click(screen.getByRole("button", { name: "Save provider" }));
|
||||
|
||||
await waitFor(() =>
|
||||
@@ -823,13 +824,41 @@ describe("Settings providers", () => {
|
||||
{
|
||||
provider: "openai_codex",
|
||||
extraBody: "",
|
||||
proxy: "http://proxy.example:8080",
|
||||
use_proxy: true,
|
||||
},
|
||||
20_000,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
it("persists a disabled proxy switch on an API-key provider without changing credentials", async () => {
|
||||
const base = settingsPayload();
|
||||
let payload: SettingsPayload = { ...base, providers: [{
|
||||
name: "openrouter", label: "OpenRouter", configured: true,
|
||||
api_key_hint: "sk-••••test", api_base: "https://openrouter.ai/api/v1",
|
||||
use_proxy: true, advanced_fields: ["use_proxy"],
|
||||
}] };
|
||||
requestMutationMock.mockImplementation(async (_action, values) => {
|
||||
payload = { ...payload, providers: payload.providers.map((provider) => ({ ...provider, use_proxy: values.use_proxy })) };
|
||||
return payload;
|
||||
});
|
||||
renderProviderManager({ initialSection: "models", initialSettings: payload });
|
||||
fireEvent.click(screen.getByRole("button", { name: "OpenRouter" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced options" }));
|
||||
const useProxy = screen.getByRole("switch", { name: "Use proxy" });
|
||||
expect(useProxy).toBeChecked();
|
||||
fireEvent.click(useProxy);
|
||||
fireEvent.click(screen.getByRole("button", { name: "Save provider" }));
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.provider.update",
|
||||
{ provider: "openrouter", apiBase: "https://openrouter.ai/api/v1", apiKey: undefined, use_proxy: false },
|
||||
20_000,
|
||||
));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "OpenRouter" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced options" }));
|
||||
expect(screen.getByRole("switch", { name: "Use proxy" })).not.toBeChecked();
|
||||
});
|
||||
|
||||
it("maps provider request switches to raw extraBody fields", async () => {
|
||||
const base = settingsPayload();
|
||||
const providers: SettingsPayload["providers"] = [
|
||||
@@ -841,7 +870,7 @@ describe("Settings providers", () => {
|
||||
api_key_required: false,
|
||||
oauth_account: "grok@example.com",
|
||||
oauth_login_supported: true,
|
||||
advanced_fields: ["extra_body", "proxy"],
|
||||
advanced_fields: ["extra_body", "use_proxy"],
|
||||
extra_body: null,
|
||||
},
|
||||
{
|
||||
@@ -852,7 +881,7 @@ describe("Settings providers", () => {
|
||||
api_key_required: false,
|
||||
oauth_account: "codex@example.com",
|
||||
oauth_login_supported: true,
|
||||
advanced_fields: ["extra_body", "proxy"],
|
||||
advanced_fields: ["extra_body", "use_proxy"],
|
||||
extra_body: null,
|
||||
},
|
||||
{
|
||||
@@ -1056,7 +1085,7 @@ describe("Settings providers", () => {
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
requestMutationMock.mockImplementationOnce(async (
|
||||
_action: string,
|
||||
values: Record<string, string>,
|
||||
values: ProviderCreationUpdate,
|
||||
) => {
|
||||
payload = {
|
||||
...payload,
|
||||
@@ -1076,13 +1105,13 @@ describe("Settings providers", () => {
|
||||
"extra_headers",
|
||||
"extra_body",
|
||||
"extra_query",
|
||||
"proxy",
|
||||
"use_proxy",
|
||||
"thinking_style",
|
||||
],
|
||||
extra_headers: JSON.parse(values.extraHeaders),
|
||||
extra_body: JSON.parse(values.extraBody),
|
||||
extra_query: JSON.parse(values.extraQuery),
|
||||
proxy: values.proxy,
|
||||
extra_headers: JSON.parse(values.extraHeaders ?? "{}"),
|
||||
extra_body: JSON.parse(values.extraBody ?? "{}"),
|
||||
extra_query: JSON.parse(values.extraQuery ?? "{}"),
|
||||
use_proxy: values.use_proxy,
|
||||
thinking_style: values.thinkingStyle,
|
||||
},
|
||||
],
|
||||
@@ -1123,9 +1152,7 @@ describe("Settings providers", () => {
|
||||
fireEvent.click(within(editor).getByRole("button", { name: "Save" }));
|
||||
await waitFor(() => expect(screen.queryByRole("dialog", { name: title })).not.toBeInTheDocument());
|
||||
}
|
||||
fireEvent.change(screen.getByLabelText("Network proxy"), {
|
||||
target: { value: "http://127.0.0.1:7890" },
|
||||
});
|
||||
fireEvent.click(screen.getByRole("switch", { name: "Use proxy" }));
|
||||
fireEvent.pointerDown(screen.getByRole("button", { name: "Reasoning format" }));
|
||||
fireEvent.click(await screen.findByRole("menuitem", { name: "enable_thinking" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Add provider" }));
|
||||
@@ -1139,7 +1166,7 @@ describe("Settings providers", () => {
|
||||
name: "Company Gateway",
|
||||
apiKey: "sk-company",
|
||||
apiBase: "https://gateway.example/v1",
|
||||
proxy: "http://127.0.0.1:7890",
|
||||
use_proxy: true,
|
||||
extraHeaders: '{"X-Tenant":"engineering"}',
|
||||
extraBody: '{"service_tier":"priority"}',
|
||||
extraQuery: '{"api-version":"2026-01-01"}',
|
||||
|
||||
@@ -26,7 +26,8 @@ function runtimeSettings() {
|
||||
"tools.exec.sandbox_ro_binds": [],
|
||||
"tools.exec.sandbox_rw_binds": [],
|
||||
"agents.defaults.max_tool_iterations": 200,
|
||||
"tools.web.proxy": "http://localhost:8080",
|
||||
"network.proxy": "http://localhost:8080",
|
||||
"tools.web.use_proxy": false,
|
||||
};
|
||||
return { ...payload, advanced: { ...payload.advanced, exec_max_runtime_limit: 86400 }, runtime_config: runtimeConfig };
|
||||
}
|
||||
@@ -301,22 +302,47 @@ describe("Runtime configuration settings", () => {
|
||||
});
|
||||
|
||||
it("preserves drafts when navigating away and supports explicit clearing", async () => {
|
||||
renderSettingsView({ initialSection: "capabilities", initialSettings: runtimeSettings() });
|
||||
const openWebSettings = () => {
|
||||
fireEvent.click(within(screen.getByRole("region", { name: "Web access" })).getByRole("button", { name: "Configure" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced options" }));
|
||||
};
|
||||
openWebSettings();
|
||||
const proxy = screen.getByRole("textbox", { name: "Web proxy" });
|
||||
let payload = runtimeSettings();
|
||||
requestMutationMock.mockImplementation(async (_method, update) => {
|
||||
payload = { ...payload, runtime_config: { ...payload.runtime_config, ...update.values } };
|
||||
return payload;
|
||||
});
|
||||
renderSettingsView({ initialSection: "advanced", initialSettings: payload });
|
||||
const proxy = screen.getByRole("textbox", { name: "Shared proxy" });
|
||||
expect(proxy).toHaveAttribute("type", "text");
|
||||
expect(proxy).toHaveValue("http://localhost:8080");
|
||||
fireEvent.change(proxy, { target: { value: "" } });
|
||||
fireEvent.click(within(screen.getByRole("dialog", { name: "Web access" })).getByRole("button", { name: "Close" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "System" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Capabilities" }));
|
||||
openWebSettings();
|
||||
expect(screen.getByRole("textbox", { name: "Web proxy" })).toHaveValue("");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced" }));
|
||||
expect(screen.getByLabelText("Shared proxy", { selector: "input" })).toHaveValue("");
|
||||
fireEvent.click(within(screen.getByRole("region", { name: "Shared proxy" })).getByRole("button", { name: "Save" }));
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.runtime_config.update", { values: { "tools.web.proxy": null } }, 20_000,
|
||||
"settings.runtime_config.update", { values: { "network.proxy": null } }, 20_000,
|
||||
));
|
||||
fireEvent.click(screen.getByRole("button", { name: "System" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Advanced" }));
|
||||
expect(screen.getByLabelText("Shared proxy", { selector: "input" })).toHaveValue("");
|
||||
});
|
||||
|
||||
it("saves proxy address and authentication together without exposing the password in the address", async () => {
|
||||
const payload = runtimeSettings();
|
||||
payload.runtime_config!["network.proxy"] = "http://old:p%40ss@proxy:8080";
|
||||
requestMutationMock.mockImplementation(async (_method, update) => ({
|
||||
...payload, runtime_config: { ...payload.runtime_config, ...update.values }, requires_restart: true,
|
||||
}));
|
||||
renderSettingsView({ initialSection: "advanced", initialSettings: payload });
|
||||
const group = within(screen.getByRole("region", { name: "Shared proxy" }));
|
||||
expect(group.getByRole("textbox", { name: "Shared proxy" })).toHaveValue("http://proxy:8080");
|
||||
expect(group.getByLabelText("Password")).toHaveAttribute("type", "password");
|
||||
expect(group.getByLabelText("Password")).toHaveValue("p@ss");
|
||||
fireEvent.change(group.getByLabelText("Username"), { target: { value: "new@user" } });
|
||||
fireEvent.change(group.getByLabelText("Password"), { target: { value: "p:@ %密" } });
|
||||
expect(requestMutationMock).not.toHaveBeenCalled();
|
||||
fireEvent.click(group.getByRole("button", { name: "Save" }));
|
||||
await waitFor(() => expect(requestMutationMock).toHaveBeenCalledWith(
|
||||
"settings.runtime_config.update", { values: { "network.proxy": "http://new%40user:p%3A%40%20%25%E5%AF%86@proxy:8080" } }, 20_000,
|
||||
));
|
||||
expect(group.getByRole("textbox", { name: "Shared proxy" })).toHaveValue("http://proxy:8080");
|
||||
});
|
||||
|
||||
it("keeps an existing timezone alias selectable and accepts only listed search results", () => {
|
||||
|
||||
@@ -59,7 +59,7 @@ export function settingsPayload(): SettingsPayload {
|
||||
},
|
||||
web: {
|
||||
enable: true,
|
||||
proxy: null,
|
||||
use_proxy: false,
|
||||
user_agent: null,
|
||||
search: { max_results: 5, timeout: 30 },
|
||||
fetch: { use_jina_reader: true },
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import { fireEvent, render, screen } from "@testing-library/react";
|
||||
import { useState } from "react";
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { SharedProxyEditor } from "@/components/settings/shared/SharedProxyEditor";
|
||||
import i18n from "@/i18n";
|
||||
|
||||
function editor(initial: string) {
|
||||
let current = initial;
|
||||
function Harness() {
|
||||
const [value, setValue] = useState(initial);
|
||||
return <SharedProxyEditor value={value} onChange={(next) => { current = next; setValue(next); }} />;
|
||||
}
|
||||
render(<Harness />);
|
||||
return () => current;
|
||||
}
|
||||
|
||||
describe("Shared proxy editor", () => {
|
||||
beforeEach(async () => { await i18n.changeLanguage("en"); });
|
||||
|
||||
it("shows an existing URL password only in a masked password field", () => {
|
||||
const value = editor("http://user:p%40ss@proxy:8080");
|
||||
expect(screen.getByRole("textbox", { name: "Shared proxy" })).toHaveValue("http://proxy:8080");
|
||||
expect(screen.getByRole("textbox", { name: "Username" })).toHaveValue("user");
|
||||
expect(screen.getByLabelText("Password")).toHaveAttribute("type", "password");
|
||||
expect(screen.getByLabelText("Password")).toHaveValue("p@ss");
|
||||
fireEvent.change(screen.getByRole("textbox", { name: "Shared proxy" }), { target: { value: "http://new:8080" } });
|
||||
expect(value()).toBe("http://user:p%40ss@new:8080");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Authentication (optional)" }));
|
||||
expect(value()).toBe("http://user:p%40ss@new:8080");
|
||||
expect(screen.queryByLabelText("Password")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("keeps pasted authentication out of the plain address and encodes credential edits", () => {
|
||||
const value = editor("");
|
||||
const address = screen.getByRole("textbox", { name: "Shared proxy" });
|
||||
fireEvent.change(address, { target: { value: "http://user:secret@proxy:8080" } });
|
||||
expect(address).toHaveValue("http://proxy:8080");
|
||||
expect(screen.getByLabelText("Password")).toHaveAttribute("type", "password");
|
||||
fireEvent.change(screen.getByLabelText("Username"), { target: { value: "new@user" } });
|
||||
fireEvent.change(screen.getByLabelText("Password"), { target: { value: "p:@ %密" } });
|
||||
expect(value()).toBe("http://new%40user:p%3A%40%20%25%E5%AF%86@proxy:8080");
|
||||
expect(address).toHaveValue("http://proxy:8080");
|
||||
});
|
||||
|
||||
it("preserves whole-URL environment references and explains where authentication is set", () => {
|
||||
const value = editor("${FULL_PROXY}");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Authentication (optional)" }));
|
||||
expect(screen.getByText("Set authentication in the referenced proxy URL.")).toBeVisible();
|
||||
expect(screen.queryByLabelText("Password")).not.toBeInTheDocument();
|
||||
expect(value()).toBe("${FULL_PROXY}");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,142 @@
|
||||
import { act, fireEvent, screen, waitFor, within } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import type { McpPresetInfo } from "@/lib/types";
|
||||
import { installSettingsViewTestHooks, jsonResponse, renderSettingsView, requestMutationMock, settingsPayload } from "@/tests/settings-test-utils";
|
||||
|
||||
const preset: McpPresetInfo = {
|
||||
name: "docs", display_name: "Docs MCP", category: "productivity", description: "Docs",
|
||||
docs_url: "https://example.com", transport: "streamableHttp", auth: null, requires: "", note: "",
|
||||
install_supported: true, installed: true, configured: true, available: true, status: "configured",
|
||||
runtime_status: "connected", required_fields: [], connection_summary: "https://example.com/mcp",
|
||||
tool_count: 2, tool_names: ["search_docs", "write_note"], enabled_tools: ["*"], source: "custom",
|
||||
};
|
||||
|
||||
function installProxySettings() {
|
||||
const settings = { ...settingsPayload(), runtime_config: { "network.proxy": null } };
|
||||
vi.stubGlobal("fetch", vi.fn(async (input: RequestInfo | URL) => {
|
||||
const url = String(input);
|
||||
if (url === "/api/settings") return jsonResponse(settings);
|
||||
if (url === "/api/settings/cli-apps") return jsonResponse({ apps: [], installed_count: 0 });
|
||||
if (url === "/api/settings/mcp-presets") return jsonResponse({ presets: [preset], installed_count: 1 });
|
||||
return jsonResponse({});
|
||||
}));
|
||||
return { settings, saved: { ...settings, runtime_config: { "network.proxy": "http://127.0.0.1:7890" }, requires_restart: true } };
|
||||
}
|
||||
|
||||
async function openMcpSetup() {
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Manage Docs MCP" }));
|
||||
const parent = await screen.findByRole("dialog", { name: "Docs MCP" });
|
||||
fireEvent.click(within(parent).getByRole("tab", { name: "Connection" }));
|
||||
fireEvent.click(within(parent).getByRole("button", { name: "Configure proxy" }));
|
||||
return { parent, setup: await screen.findByRole("dialog", { name: "Shared proxy" }) };
|
||||
}
|
||||
|
||||
describe("Inline shared proxy setup", () => {
|
||||
installSettingsViewTestHooks();
|
||||
|
||||
it("keeps custom Provider fields across cancel and successful setup without enabling proxy", async () => {
|
||||
const user = userEvent.setup();
|
||||
const { settings, saved } = installProxySettings();
|
||||
renderSettingsView({ initialSection: "models", initialSettings: settings });
|
||||
await user.click(await screen.findByRole("button", { name: "Manage providers" }));
|
||||
await user.click(screen.getByRole("button", { name: "Add provider" }));
|
||||
await user.click(await screen.findByRole("button", { name: "Custom" }));
|
||||
const parent = screen.getByRole("dialog", { name: "Custom" });
|
||||
const name = within(parent).getByPlaceholderText("My model provider");
|
||||
const url = within(parent).getByPlaceholderText("https://api.example.com/v1");
|
||||
const key = within(parent).getByPlaceholderText("Enter API key");
|
||||
await user.type(name, "Keep this draft");
|
||||
await user.type(url, "https://gateway.example/v1");
|
||||
await user.type(key, "draft-key");
|
||||
await user.click(within(parent).getByRole("button", { name: "Advanced options" }));
|
||||
await user.click(within(parent).getByRole("button", { name: "Configure proxy" }));
|
||||
let setup = await screen.findByRole("dialog", { name: "Shared proxy" });
|
||||
await user.type(within(setup).getByRole("textbox"), "http://127.0.0.1:7890");
|
||||
await user.click(within(setup).getByRole("button", { name: "Cancel" }));
|
||||
expect(name).toHaveValue("Keep this draft");
|
||||
expect(url).toHaveValue("https://gateway.example/v1");
|
||||
expect(key).toHaveValue("draft-key");
|
||||
expect(requestMutationMock).not.toHaveBeenCalled();
|
||||
await user.click(within(parent).getByRole("button", { name: "Configure proxy" }));
|
||||
setup = await screen.findByRole("dialog", { name: "Shared proxy" });
|
||||
expect(within(setup).getByRole("textbox")).toHaveValue("");
|
||||
await user.type(within(setup).getByRole("textbox"), "http://127.0.0.1:7890");
|
||||
requestMutationMock.mockResolvedValueOnce(saved);
|
||||
await user.click(within(setup).getByRole("button", { name: "Save" }));
|
||||
await waitFor(() => expect(screen.queryByRole("dialog", { name: "Shared proxy" })).not.toBeInTheDocument());
|
||||
expect(await screen.findByRole("dialog", { name: "Custom" })).toBe(parent);
|
||||
expect(name).toHaveValue("Keep this draft");
|
||||
expect(url).toHaveValue("https://gateway.example/v1");
|
||||
expect(key).toHaveValue("draft-key");
|
||||
expect(within(parent).getByRole("switch", { name: "Use proxy" })).not.toBeChecked();
|
||||
expect(requestMutationMock).toHaveBeenCalledTimes(1);
|
||||
expect(requestMutationMock).toHaveBeenCalledWith("settings.runtime_config.update", { values: { "network.proxy": "http://127.0.0.1:7890" } }, 20_000);
|
||||
});
|
||||
|
||||
it("saves optional credentials from inline setup without enabling the consumer", async () => {
|
||||
const { settings, saved } = installProxySettings();
|
||||
renderSettingsView({ initialSection: "apps", initialSettings: settings });
|
||||
const { parent, setup } = await openMcpSetup();
|
||||
fireEvent.change(within(setup).getByRole("textbox", { name: "Shared proxy" }), { target: { value: "socks5://proxy:1080" } });
|
||||
fireEvent.click(within(setup).getByRole("button", { name: "Authentication (optional)" }));
|
||||
fireEvent.change(within(setup).getByLabelText("Username"), { target: { value: "user@org" } });
|
||||
fireEvent.change(within(setup).getByLabelText("Password"), { target: { value: "p:a@ss" } });
|
||||
expect(within(setup).getByLabelText("Password")).toHaveAttribute("type", "password");
|
||||
const encoded = "socks5://user%40org:p%3Aa%40ss@proxy:1080";
|
||||
requestMutationMock.mockResolvedValueOnce({ ...saved, runtime_config: { "network.proxy": encoded } });
|
||||
fireEvent.click(within(setup).getByRole("button", { name: "Save" }));
|
||||
await waitFor(() => expect(screen.queryByRole("dialog", { name: "Shared proxy" })).not.toBeInTheDocument());
|
||||
expect(requestMutationMock).toHaveBeenCalledWith("settings.runtime_config.update", { values: { "network.proxy": encoded } }, 20_000);
|
||||
expect(within(parent).getByRole("switch", { name: "Use proxy" })).not.toBeChecked();
|
||||
});
|
||||
|
||||
it("retains MCP tool selections when setup is cancelled", async () => {
|
||||
const { settings } = installProxySettings();
|
||||
renderSettingsView({ initialSection: "apps", initialSettings: settings });
|
||||
fireEvent.click(await screen.findByRole("button", { name: "MCP" }));
|
||||
fireEvent.click(await screen.findByRole("button", { name: "Manage Docs MCP" }));
|
||||
const parent = await screen.findByRole("dialog", { name: "Docs MCP" });
|
||||
fireEvent.click(within(parent).getByRole("tab", { name: "Tools" }));
|
||||
fireEvent.click(within(parent).getByRole("checkbox", { name: "write_note" }));
|
||||
expect(within(parent).getByRole("checkbox", { name: "write_note" })).not.toBeChecked();
|
||||
fireEvent.click(within(parent).getByRole("tab", { name: "Connection" }));
|
||||
fireEvent.click(within(parent).getByRole("button", { name: "Configure proxy" }));
|
||||
const setup = await screen.findByRole("dialog", { name: "Shared proxy" });
|
||||
fireEvent.click(within(setup).getByRole("button", { name: "Cancel" }));
|
||||
fireEvent.click(within(parent).getByRole("tab", { name: "Tools" }));
|
||||
expect(within(parent).getByRole("checkbox", { name: "write_note" })).not.toBeChecked();
|
||||
expect(within(parent).getByRole("button", { name: "Save changes" })).toBeEnabled();
|
||||
expect(requestMutationMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("keeps failed input and inline errors, blocks dismissal while saving and retries", async () => {
|
||||
const { settings, saved } = installProxySettings();
|
||||
renderSettingsView({ initialSection: "apps", initialSettings: settings });
|
||||
const { parent, setup } = await openMcpSetup();
|
||||
const input = within(setup).getByRole("textbox");
|
||||
const save = within(setup).getByRole("button", { name: "Save" });
|
||||
expect(save).toBeDisabled();
|
||||
fireEvent.change(input, { target: { value: "bad-address" } });
|
||||
requestMutationMock.mockRejectedValueOnce(new Error("Unsupported proxy scheme"));
|
||||
fireEvent.click(save);
|
||||
expect(await within(setup).findByRole("alert")).toHaveTextContent("Unsupported proxy scheme");
|
||||
expect(input).toHaveValue("bad-address");
|
||||
await waitFor(() => expect(input).toHaveFocus());
|
||||
fireEvent.change(input, { target: { value: "http://127.0.0.1:7890" } });
|
||||
let resolveSave!: (value: typeof saved) => void;
|
||||
requestMutationMock.mockImplementationOnce(() => new Promise((resolve) => { resolveSave = resolve; }));
|
||||
fireEvent.click(save);
|
||||
expect(within(setup).getByRole("button", { name: "Cancel" })).toBeDisabled();
|
||||
expect(input).toBeDisabled();
|
||||
fireEvent.keyDown(setup, { key: "Escape" });
|
||||
expect(setup).toBeInTheDocument();
|
||||
await act(async () => { resolveSave(saved); });
|
||||
await waitFor(() => expect(screen.queryByRole("dialog", { name: "Shared proxy" })).not.toBeInTheDocument());
|
||||
expect(screen.getByRole("dialog", { name: "Docs MCP" })).toBe(parent);
|
||||
expect(within(parent).getByRole("switch", { name: "Use proxy" })).not.toBeChecked();
|
||||
expect(requestMutationMock).toHaveBeenLastCalledWith("settings.runtime_config.update", { values: { "network.proxy": "http://127.0.0.1:7890" } }, 20_000);
|
||||
});
|
||||
});
|
||||
@@ -522,7 +522,7 @@ function modelSettings(model: string, provider: string): SettingsPayload {
|
||||
},
|
||||
web: {
|
||||
enable: true,
|
||||
proxy: null,
|
||||
use_proxy: false,
|
||||
user_agent: null,
|
||||
search: { max_results: 5, timeout: 30 },
|
||||
fetch: { use_jina_reader: true },
|
||||
|
||||
Reference in new issue
Block a user