dsh-web-search-enhanced 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/lib/client.cjs +98 -61
- package/lib/client.cjs.map +1 -1
- package/lib/index.js +185 -52
- package/package.json +60 -60
package/lib/client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs","names":["documentVersion","z","z","z","useCallback","useSyncExternalStore","useState","Menu","IconChevronDownOutlineRegular","Button","documentVersion","useMemo","useRef","useState","objectOf","isObject","createSnapshotStore","createSnapshotStore","PairingsStatus","createSnapshotStore","CredentialStatus","createSnapshotStore","documentVersion","inspectDocumentVersion","sparseSettingOperations","resetSettingsOperations","useId","useState","Tag","Input","Button","Input","useState","connectionChoices","connectionName","useId","useState","Input","textOf","Switch","useId","useState","StateDot","Tag","Button","IconChevronDownOutlineRegular","Switch","SegmentedControl","IconRightUpOutlineRegular","useState","StateDot","Button","StateDot","useId","Switch","useState","Button","useId","useState","Input","Checkbox","Button","useState","Button","IconPlusOutlineRegular","StateDot","Tag","Switch","z","CoreCredentialStatus","CorePairingsStatus","useState","createElement","css","SegmentedControl","css","catalogChoices","catalogConnectionName","css","css","css","Switch","css","css","css","css","StateDot","createSnapshotStore"],"sources":["../../core/src/shared/ids.ts","../../core/src/shared/url.ts","../../core/src/shared/connections.ts","../../core/src/shared/route.ts","../../core/src/shared/search.ts","../../core/src/shared/settings.ts","../../../node_modules/.pnpm/@deepseek-ai+dsh-typert-protocol@0.2.1-rc.2_@deepseek-ai+cordis@4.0.5/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.js","../../core/src/shared/selection.ts","../src/catalog.ts","../src/contract.ts","../../core/src/client/use-observable.ts","../../core/src/client/settings/parts.tsx","../../core/src/client/settings/document.ts","../../core/src/client/remote-services.ts","../../core/src/client/command.ts","../../core/src/client/selection.ts","../../core/src/client/route.ts","../../core/src/client/pairings.ts","../../core/src/client/credentials.ts","../../core/src/client/settings/sparse.ts","../../core/src/client/settings/CredentialEditor.tsx","../../core/src/client/settings/fields.ts","../../core/src/client/settings/OptionsEditor.tsx","../../core/src/client/settings/model.ts","../../core/src/client/settings/ServiceFields.tsx","../../core/src/client/settings/ServicesSection.tsx","../../core/src/client/settings/PairingsSection.tsx","../../core/src/client/settings/DefaultsSection.tsx","../../core/src/client/settings/EnhancedToolsSection.tsx","../../core/src/client/settings/ResetSection.tsx","../../core/src/client/settings/RouteNotice.tsx","../../core/src/client/settings/secret-diagnostics.ts","../../core/src/client/settings/connection-form.ts","../../core/src/client/settings/ConnectionEditor.tsx","../../core/src/client/settings/CustomConnections.tsx","../src/settings/retired.ts","../src/settings/resolve.ts","../src/client/connections.ts","../src/client/command.ts","../src/client/credentials.ts","../src/client/locales.ts","../src/client/pairings.ts","../src/client/route.ts","../src/client/section.ts","../src/client/selection.ts","../src/client/settings/CredentialEditor.tsx","../src/client/settings/model.ts","../src/client/settings/parts.tsx","../src/client/settings/OptionsEditor.tsx","../src/client/settings/sparse.ts","../src/client/settings/CustomConnections.tsx","../src/client/settings/DefaultsSection.tsx","../src/client/settings/EnhancedToolsSection.tsx","../src/client/settings/PairingsSection.tsx","../src/client/settings/ServicesSection.tsx","../src/client/settings/SettingsPage.tsx","../src/client/index.tsx"],"sourcesContent":["/**\n * Identities that bind the profile bundle, its rows, and both faces together.\n * The profile's patch writes these ids, the plugins register them, and the\n * browser faces key their slots by them; tests assert all three agree.\n * Nothing here imports Node, the browser, or a Host package.\n */\n\n/** npm name of the profile bundle users install; the Plugins page keys bundle and row pages by it. */\nexport const PROFILE_PACKAGE = 'dsh-tool-web-enhanced-profile'\n\n/** A package the profile mounts as one row. */\nexport interface RowIdentity {\n /** npm package name; the profile bundle depends on it and names it in its row. */\n readonly packageName: string\n /** Row id the profile patch inserts; also the Settings namespace and the Cordis plugin name. */\n readonly rowId: string\n}\n\n/**\n * The two model-facing tools a capability registers while the operator has\n * them turned on and the `web` row routes the capability to this plugin.\n * Model-facing text calls a connection a \"provider\".\n */\nexport interface EnhancedToolNames {\n /** Runs one request on a provider the Agent names. */\n readonly action: string\n /** Lists the providers the Agent may name in this conversation. */\n readonly list: string\n}\n\n/** A row that serves one web capability. */\nexport interface PluginIdentity extends RowIdentity {\n /** Provider id registered in `ctx.web`; the profile writes it into the `web` row. */\n readonly providerId: string\n readonly tools: EnhancedToolNames\n /** Host command, without the slash, that shows or changes the Session's connection. */\n readonly command: string\n}\n\nexport const SEARCH: PluginIdentity = {\n packageName: 'dsh-web-search-enhanced',\n rowId: 'web-search-enhanced',\n providerId: 'search-enhanced',\n tools: { action: 'web_search_enhanced', list: 'list_web_search_providers' },\n command: 'setup-search',\n}\n\nexport const FETCH: PluginIdentity = {\n packageName: 'dsh-web-fetch-enhanced',\n rowId: 'web-fetch-enhanced',\n providerId: 'fetch-enhanced',\n tools: { action: 'web_fetch_enhanced', list: 'list_web_fetch_providers' },\n command: 'setup-fetch',\n}\n\n/** The browser-only row holding the shared composer connection menu. */\nexport const UI: RowIdentity = {\n packageName: 'dsh-tool-web-enhanced-ui',\n rowId: 'tool-web-enhanced-ui',\n}\n\n/**\n * Key of a row's configuration page on the Plugins page (`plugins.row.config`).\n * @param row - the row the page configures.\n * @returns `<profile package>#<row id>`.\n */\nexport function rowConfigKey(row: RowIdentity): string {\n return `${PROFILE_PACKAGE}#${row.rowId}`\n}\n","/** URL shape checks both faces apply to endpoints and to search sources. */\n\n/** Absolute http(s) URL without credentials, query or fragment: what an API endpoint may look like. */\nexport function isEndpoint(value: string): boolean {\n if (!URL.canParse(value)) return false\n const url = new URL(value)\n return (url.protocol === 'https:' || url.protocol === 'http:') && url.username === '' && url.password === '' && url.search === '' && url.hash === ''\n}\n\n/** Longest URL a search source may carry. */\nexport const MAX_SOURCE_URL_LENGTH = 8192\n\n/**\n * A public http(s) URL without user information, as a search source may cite.\n * @returns the raw string and its normalized href, or undefined when the value is not acceptable.\n */\nexport function sourceUrl(value: unknown): { readonly raw: string; readonly href: string } | undefined {\n if (typeof value !== 'string') return undefined\n const raw = value.trim()\n if (raw === '' || raw.length > MAX_SOURCE_URL_LENGTH || !URL.canParse(raw)) return undefined\n const url = new URL(raw)\n if ((url.protocol !== 'http:' && url.protocol !== 'https:') || url.username !== '' || url.password !== '') return undefined\n return { raw, href: url.href }\n}\n","/**\n * The connection grammar both capabilities share: how connections are named,\n * how a catalog entry describes itself, and how operator-supplied options are\n * checked against that description. Pure and isomorphic.\n */\n\nimport { isEndpoint } from './url.ts'\n\n/** Upper bound on any text option; a pattern runs only on text within it. */\nexport const TEXT_MAX_LENGTH = 2000\n\n/** A connection the operator can select: a catalog entry or an operator-defined one. */\nexport type ConnectionId = `builtin:${string}` | `custom:${string}`\n\nexport const BUILTIN_PREFIX = 'builtin:'\nexport const CUSTOM_PREFIX = 'custom:'\n\n/** Operator-defined connection ids: `custom:` plus a short, readable name. */\nexport const CUSTOM_CONNECTION_ID = /^custom:[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/u\n\n/** Catalog connection ids: `builtin:` plus a lower-case, hyphenated catalog key. */\nexport const BUILTIN_CONNECTION_ID = /^builtin:[a-z0-9]{1,50}(?:-[a-z0-9]{1,50}){0,5}$/u\n\n/** Whether a string, such as an untrusted tool argument, has the grammar of a connection id; it may still name nothing. */\nexport const isConnectionId = (value: string): value is ConnectionId => BUILTIN_CONNECTION_ID.test(value) || CUSTOM_CONNECTION_ID.test(value)\n\n/** A DSH Credentials reference, the only form a key is ever stored in. */\nexport const CREDENTIAL_REF = /^[A-Za-z_][A-Za-z0-9_]*$/u\n\n/** Persisted access modes; `account` is derived per call from the Session's model route. */\nexport type AccessMode = 'keyless' | 'api-key'\n\n/** How a call actually authenticates. */\nexport type Access = AccessMode | 'account'\n\n/** The four backend kinds (docs/architecture.md, \"后端种类与执行层\"). */\nexport type BackendKind = 'native' | 'adapter' | 'model' | 'local'\n\n/**\n * One accepted operator option of a connection. `keyless` narrows the option\n * on the anonymous route: omitted accepts it unchanged, `false` rejects it, a\n * list narrows the accepted enum values.\n */\nexport type OptionRule =\n | { readonly kind: 'enum'; readonly values: readonly string[]; readonly keyless?: readonly string[] | false }\n /** Text matching `pattern`; never longer than `maxLength` (default {@link TEXT_MAX_LENGTH}), checked before the pattern runs. */\n | { readonly kind: 'text'; readonly pattern: RegExp; readonly maxLength?: number; readonly keyless?: false }\n /** An absolute http(s) URL without credentials, query or fragment (see `isEndpoint`). */\n | { readonly kind: 'url'; readonly keyless?: false }\n | { readonly kind: 'boolean'; readonly keyless?: false }\n | { readonly kind: 'integer'; readonly min: number; readonly max: number; readonly keyless?: false }\n /** A list of strings, each matching `pattern`; capabilities add semantic checks (CIDR syntax) on top. */\n | { readonly kind: 'list'; readonly pattern: RegExp; readonly max: number }\n\n/** How a catalog entry can be reached. */\nexport interface AccessFacts {\n /** An anonymous route exists; built-in connections then default to it. */\n readonly keyless: boolean\n /** Personal-key access and the DSH Credentials reference it resolves by default. */\n readonly apiKey: { readonly credentialRef: string } | false\n /** A DeepSeek account sign-in can authenticate Sessions on the account route. */\n readonly account: boolean\n}\n\n/**\n * Secret-free catalog facts about one built-in connection. Validation, the\n * settings page, and status views all read it; a capability extends it with\n * its own facts (endpoint, freshness support, …).\n */\nexport interface Descriptor {\n readonly label: string\n readonly homepage?: string\n readonly kind: BackendKind\n /** Whether the query or URL leaves this machine for a third-party service; only drives explanatory text. */\n readonly remote: boolean\n /** A remote service the operator must turn on: the built-in connection starts disabled (docs/design.md, \"连接与目录\"). */\n readonly optIn: boolean\n /** Short English phrase on what the connection is for, shown to the Agent only where it changes the choice. */\n readonly use?: string\n readonly access: AccessFacts\n readonly options: Readonly<Record<string, OptionRule>>\n /** Pairs of options at most one of which may be set. */\n readonly exclusive?: readonly ExclusiveOptions[]\n}\n\n/** Two option names an operator may not set together. */\nexport type ExclusiveOptions = readonly [string, string]\n\n/**\n * A model wire protocol a custom `model` connection may name, with the\n * operator options it accepts; the counterpart of an adapter catalog entry\n * for custom adapter connections.\n */\nexport interface ProtocolDescriptor {\n readonly label: string\n /** Same meaning as {@link Descriptor.use}, for custom connections of this protocol. */\n readonly use?: string\n readonly options: Readonly<Record<string, OptionRule>>\n /** Pairs of options at most one of which may be set. */\n readonly exclusive?: readonly ExclusiveOptions[]\n}\n\nexport const builtinId = (key: string): ConnectionId => `${BUILTIN_PREFIX}${key}`\n\nexport const isBuiltinId = (id: string): boolean => id.startsWith(BUILTIN_PREFIX)\nexport const isCustomId = (id: string): boolean => CUSTOM_CONNECTION_ID.test(id)\n\n/** The catalog key of a built-in connection id, or undefined for any other id. */\nexport function builtinKey(id: string): string | undefined {\n return id.startsWith(BUILTIN_PREFIX) ? id.slice(BUILTIN_PREFIX.length) : undefined\n}\n\n/** The default access of a catalog entry: anonymous when it exists, else a personal key. */\nexport function defaultAccess(access: AccessFacts): AccessMode {\n return access.keyless ? 'keyless' : 'api-key'\n}\n\n/**\n * Check operator options against a descriptor's rules.\n * @param label - connection label used in the problems.\n * @param rules - the descriptor's option rules.\n * @param options - the operator's options.\n * @param access - persisted access mode; keyless may reject or narrow an option.\n * @param exclusive - the descriptor's option pairs that may not both be set.\n * @returns one English problem per invalid option or exclusive pair; empty when all are valid.\n */\nexport function validateOptions(label: string, rules: Readonly<Record<string, OptionRule>>, options: Readonly<Record<string, unknown>>, access: AccessMode, exclusive: readonly ExclusiveOptions[] = []): string[] {\n const invalid = Object.entries(options).flatMap(([key, value]) => {\n const rule = Object.hasOwn(rules, key) ? rules[key] : undefined\n if (rule === undefined) return [`${label} has no option \"${key}\"`]\n if (!accepts(rule, value)) return [`${label} option \"${key}\" has an invalid value`]\n if (access === 'keyless' && !keylessAccepts(rule, value)) return [`${label} option \"${key}\" = ${JSON.stringify(value)} needs API-key access`]\n return []\n })\n const combined = exclusive\n .filter(([first, second]) => Object.hasOwn(options, first) && Object.hasOwn(options, second))\n .map(([first, second]) => `${label} options \"${first}\" and \"${second}\" cannot both be set`)\n return [...invalid, ...combined]\n}\n\nfunction accepts(rule: OptionRule, value: unknown): boolean {\n switch (rule.kind) {\n case 'enum': return typeof value === 'string' && rule.values.includes(value)\n case 'text': return typeof value === 'string' && value.length <= (rule.maxLength ?? TEXT_MAX_LENGTH) && rule.pattern.test(value)\n case 'url': return typeof value === 'string' && value.length <= TEXT_MAX_LENGTH && isEndpoint(value)\n case 'boolean': return typeof value === 'boolean'\n case 'integer': return Number.isInteger(value) && (value as number) >= rule.min && (value as number) <= rule.max\n case 'list': return Array.isArray(value) && value.length <= rule.max && value.every(item => typeof item === 'string' && rule.pattern.test(item))\n }\n}\n\nfunction keylessAccepts(rule: OptionRule, value: unknown): boolean {\n if (!('keyless' in rule) || rule.keyless === undefined) return true\n if (rule.keyless === false) return false\n return rule.keyless.includes(value as string)\n}\n","/**\n * Whether the shared `web` row routes a capability to this plugin, judged the\n * way `WebRuntime` selects: the row's field, else the process environment\n * variable, else auto-selection. The Host reads the row through the public\n * Settings data; the browser reads it through `configForms.get('web')`. When\n * the row cannot be read, the answer is `unknown` and callers treat it as\n * \"not routed\".\n */\n\nexport type Route =\n /** The `web` row is not readable, or the Host has not answered yet. */\n | { readonly kind: 'unknown' }\n | { readonly kind: 'this' }\n /** Nothing pins a provider: `WebRuntime` auto-selects and fails while several are usable. */\n | { readonly kind: 'auto'; readonly providerId: string }\n /** Another provider serves the capability, so this plugin's settings have no effect. */\n | { readonly kind: 'other'; readonly provider: string; readonly providerId: string }\n\n/** The two `web` row fields and the environment variables `WebRuntime` reads instead. */\nexport const WEB_ROW = 'web'\nexport const WEB_FIELD = { search: 'searchProvider', fetch: 'fetchProvider' } as const\nexport const WEB_ENV = { search: 'DSH_WEB_SEARCH_PROVIDER', fetch: 'DSH_WEB_FETCH_PROVIDER' } as const\n\n/**\n * @param row - the `web` row's effective value, or undefined when it cannot be read.\n * @param field - which capability's field to judge.\n * @param envProvider - the process variable of that capability, or null when unset.\n * @param providerId - the id this plugin registered.\n */\nexport function routeOf(row: Readonly<Record<string, unknown>> | undefined, field: string, envProvider: string | null, providerId: string): Route {\n if (row === undefined) return { kind: 'unknown' }\n const configured = row[field]\n // Like `WebRuntime` (`config.searchProvider.get() ?? env`): only an absent field falls back to the variable.\n const pinned = typeof configured === 'string' ? configured : envProvider\n if (pinned === null) return { kind: 'auto', providerId }\n return pinned === providerId ? { kind: 'this' } : { kind: 'other', provider: pinned, providerId }\n}\n\n/** Whether the capability reaches this plugin; `unknown` and `auto` count as not routed. */\nexport const isRouted = (route: Route): boolean => route.kind === 'this'\n","/** Search vocabulary shared by the catalog, settings, browser and the provider wires. */\n\n/** Content-cache preference, not a publication-date filter. */\nexport const FRESHNESS = ['auto', 'fresh', 'realtime'] as const\nexport type Freshness = typeof FRESHNESS[number]\n","import { z } from 'zod'\nimport { builtinId, builtinKey, CREDENTIAL_REF, CUSTOM_CONNECTION_ID, defaultAccess, TEXT_MAX_LENGTH, validateOptions, type AccessMode, type Descriptor, type ProtocolDescriptor } from './connections.ts'\nimport { isEndpoint } from './url.ts'\n\n// Unversioned documents are permanently the first unified grammar, not the latest release.\nexport const UNVERSIONED_SETTINGS_VERSION = 2 as const\nexport const CURRENT_SETTINGS_VERSION = 2 as const\nexport const SETTINGS_RESET_HINT = 'this release does not read 0.1.x settings; remove the field or use Reset on the settings page'\nexport const SETTINGS_FIELDS = ['version', 'defaultConnection', 'showSelector', 'enhancedTools', 'defaults', 'connections'] as const\n\nexport type DocumentVersion =\n | { readonly kind: 'current' }\n | { readonly kind: 'older'; readonly version: number }\n | { readonly kind: 'newer'; readonly version: number }\n | { readonly kind: 'invalid'; readonly reason: string }\n\nexport function documentVersion(document: unknown, currentVersion: number = CURRENT_SETTINGS_VERSION): DocumentVersion {\n if (document === null || typeof document !== 'object' || Array.isArray(document)) return { kind: 'invalid', reason: 'settings must be an object' }\n const storedVersion = (document as Record<string, unknown>).version\n const version = storedVersion === undefined ? UNVERSIONED_SETTINGS_VERSION : storedVersion\n if (version === currentVersion) return { kind: 'current' }\n if (typeof version !== 'number' || !Number.isSafeInteger(version) || version < 1) return { kind: 'invalid', reason: 'settings.version must be a positive integer' }\n return { kind: version < currentVersion ? 'older' : 'newer', version }\n}\n\nexport type SettingsMigration = (document: Readonly<Record<string, unknown>>) => Record<string, unknown>\nexport interface SettingsMigrations {\n readonly currentVersion: number\n readonly steps: ReadonlyMap<number, SettingsMigration>\n}\n// Add only this grammar's future N → N+1 steps; predecessor formats have no steps.\nexport const SETTINGS_MIGRATIONS: SettingsMigrations = { currentVersion: CURRENT_SETTINGS_VERSION, steps: new Map() }\n\n/** Pure upgrade pipeline. Never guesses a predecessor's schema or rewrites its fields. */\nexport function migrateDocument(document: unknown, migrations: SettingsMigrations = SETTINGS_MIGRATIONS): Record<string, unknown> {\n validateDocumentBounds(document)\n const state = documentVersion(document, migrations.currentVersion)\n if (state.kind === 'invalid') throw new Error(state.reason)\n if (state.kind === 'newer') throw new Error('settings.version is newer than supported; upgrade the plugin')\n let result = structuredClone(document) as Record<string, unknown>\n if (state.kind === 'older') {\n for (let version = state.version; version < migrations.currentVersion; version += 1) {\n const migrate = migrations.steps.get(version)\n if (migrate === undefined) throw new Error('settings.version: no migration from version ' + version + '; ' + SETTINGS_RESET_HINT)\n result = { ...migrate(result), version: version + 1 }\n validateDocumentBounds(result)\n }\n }\n return result\n}\n\n/**\n * Operator text shown as one line (a label in menus, error messages and the\n * Agent's provider list): control characters and line or paragraph separators\n * become spaces, runs of whitespace one space, the ends trimmed.\n */\nexport function singleLine(value: string): string {\n return value.replaceAll(/[\\p{Cc}\\p{Zl}\\p{Zp}]/gu, ' ').replaceAll(/\\s+/gu, ' ').trim()\n}\n\nconst text = z.string().trim().min(1).max(TEXT_MAX_LENGTH)\nconst label = z.string().transform(singleLine).pipe(z.string().min(1).max(200))\nconst credentialRef = text.regex(CREDENTIAL_REF, 'must be a credential reference such as EXA_API_KEY')\nconst endpoint = text.refine(isEndpoint, 'must be an absolute http(s) URL without credentials, query or fragment')\nconst options = z.record(z.string(), z.unknown())\n\nexport function documentSchema<S extends z.ZodRawShape>(defaults: z.ZodObject<S>, currentVersion: number = CURRENT_SETTINGS_VERSION) {\n return z.strictObject({\n version: z.literal(currentVersion).optional(),\n defaultConnection: z.string().min(1).max(200).optional(),\n showSelector: z.boolean().optional(),\n enhancedTools: z.boolean().optional(),\n defaults: defaults.optional(),\n connections: z.record(z.string().max(200), z.unknown()).refine(value => Object.keys(value).length <= 200, 'must contain at most 200 connections').optional(),\n })\n}\n\nexport const builtinOverrideSchema = z.strictObject({\n label: label.optional(), disabled: z.boolean().optional(),\n access: z.enum(['keyless', 'api-key']).optional(), credentialRef: credentialRef.optional(),\n trustedEndpoint: z.boolean().optional(), options: options.optional(),\n})\nexport interface BuiltinOverride {\n label?: string\n disabled?: boolean\n access?: AccessMode\n credentialRef?: string\n trustedEndpoint?: boolean\n options?: Record<string, unknown>\n}\n\n/** A persisted operator-defined connection; its grammar is customConnectionSchema, and a test keeps the two identical. */\nexport interface CustomAdapterConnection<A extends string = string> {\n readonly kind: 'adapter'\n readonly adapter: A\n readonly label: string\n readonly credentialRef: string\n readonly endpoint?: string | undefined\n readonly trustedEndpoint?: boolean | undefined\n readonly disabled?: boolean | undefined\n readonly options?: Record<string, unknown> | undefined\n}\n\nexport interface CustomModelConnection<P extends string = string> {\n readonly kind: 'model'\n readonly protocol: P\n readonly model: string\n readonly label: string\n readonly credentialRef: string\n readonly endpoint: string\n readonly trustedEndpoint: true\n readonly disabled?: boolean | undefined\n readonly options?: Record<string, unknown> | undefined\n}\nexport type CustomConnection<A extends string = string, P extends string = string> = CustomAdapterConnection<A> | CustomModelConnection<P>\n\nexport function customConnectionSchema<A extends string, P extends string>(adapterKeys: readonly A[], protocolKeys: readonly P[]) {\n const adapterSchema = z.strictObject({\n kind: z.literal('adapter'), adapter: z.enum(adapterKeys), label, credentialRef,\n endpoint: endpoint.optional(), trustedEndpoint: z.boolean().optional(),\n disabled: z.boolean().optional(), options: options.optional(),\n })\n const modelSchema = z.strictObject({\n kind: z.literal('model'), protocol: z.enum(protocolKeys),\n model: z.string().min(1).max(200).regex(/^[^\\p{Cc}]+$/u, 'must not contain control characters').trim().min(1),\n label, credentialRef, endpoint, trustedEndpoint: z.literal(true),\n disabled: z.boolean().optional(), options: options.optional(),\n })\n if (adapterKeys.length === 0 && protocolKeys.length === 0) return z.never()\n if (adapterKeys.length === 0) return z.discriminatedUnion('kind', [modelSchema])\n if (protocolKeys.length === 0) return z.discriminatedUnion('kind', [adapterSchema])\n return z.discriminatedUnion('kind', [adapterSchema, modelSchema])\n}\n\ninterface CommonConnection {\n readonly id: string\n readonly label: string\n readonly disabled: boolean\n readonly remote: boolean\n readonly trustedEndpoint: boolean\n readonly options: Readonly<Record<string, unknown>>\n readonly catalogKey: string\n}\nexport type ResolvedModel<P extends string = string> =\n | { readonly kind: 'session' }\n | { readonly kind: 'fixed'; readonly protocol: P; readonly model: string; readonly endpoint: string; readonly credentialRef: string }\nexport type ResolvedBase<P extends string = string> = CommonConnection & (\n | { readonly kind: 'local'; readonly access: 'keyless' }\n | { readonly kind: 'model'; readonly route: ResolvedModel<P> }\n | { readonly kind: 'native' | 'adapter'; readonly access: AccessMode; readonly credentialRef: string; readonly endpoint: string }\n)\nexport interface ResolvedDocument<D, C = ResolvedBase> {\n readonly version: number\n readonly defaultConnection: string\n readonly showSelector: boolean\n /** Whether the operator turned on this capability's two enhanced model tools (docs/design.md, \"增强工具\"). */\n readonly enhancedTools: boolean\n readonly defaults: D\n readonly connections: ReadonlyMap<string, C>\n}\nexport type SettingsDescriptor = Descriptor & { readonly endpoint?: string }\n\n/**\n * Where a resolved connection comes from. A built-in connection without a\n * `disabled` override takes the catalog's `optIn` (remote services start off);\n * an operator-defined one starts enabled (docs/design.md, \"远程服务缺省停用\").\n */\ntype ConnectionOrigin =\n | { readonly kind: 'builtin' }\n | { readonly kind: 'custom'; readonly endpoint: string | undefined }\n\n/** Resolve the identical document and connection grammar for Host and browser. */\nexport function resolveDocument<S extends z.ZodRawShape, P extends string = never>({ catalog, document, defaults, capabilityLabel, protocols, retiredFields = [], migrations = SETTINGS_MIGRATIONS }: {\n readonly catalog: Readonly<Record<string, SettingsDescriptor>>\n readonly protocols?: Readonly<Record<P, ProtocolDescriptor>>\n readonly document: unknown\n readonly defaults: { readonly schema: z.ZodObject<S>; readonly defaultConnection: string }\n readonly capabilityLabel: string\n readonly retiredFields?: readonly string[]\n readonly migrations?: SettingsMigrations\n}): ResolvedDocument<z.output<z.ZodObject<S>>, ResolvedBase<P>> {\n const fail = (path: string, message: string): never => { throw new Error('invalid ' + capabilityLabel + ' settings: ' + path + ': ' + message) }\n const parse = <T>(schema: z.ZodType<T>, value: unknown, path: string): T => {\n const result = schema.safeParse(value)\n if (result.success) return result.data\n const issues = result.error.issues.map(issue => {\n const field = [path, ...issue.path.map(String)].join('.')\n const retired = issue.code === 'unrecognized_keys' && path === 'settings' && issue.path.length === 0\n ? issue.keys.filter(key => retiredFields.includes(key)) : []\n const retirement = retired.map(key => key + ' is a 0.1.x setting this release does not read; remove it or use Reset')\n return field + ': ' + [...retirement, issue.message].join('; ') + (issue.code === 'unrecognized_keys' ? '; ' + SETTINGS_RESET_HINT : '')\n })\n return fail(path, issues.join('; '))\n }\n const settings = parse(documentSchema(defaults.schema, migrations.currentVersion), migrateDocument(document, migrations), 'settings')\n const overrides = settings.connections ?? {}\n const adapterKeys = Object.keys(catalog).filter(key => catalog[key]!.kind === 'adapter')\n const protocolKeys = protocols === undefined ? [] : Object.keys(protocols) as P[]\n const customSchema = customConnectionSchema(adapterKeys, protocolKeys)\n const connections = new Map<string, ResolvedBase<P>>()\n const rejectId = (id: string, path: string): never => fail(path, 'unknown connection id \"' + id + '\"; ' + SETTINGS_RESET_HINT)\n const resolve = (id: string, key: string, override: z.infer<typeof builtinOverrideSchema>, origin: ConnectionOrigin): ResolvedBase<P> => {\n const info = catalog[key]!\n const path = 'connections.' + id\n const access = info.kind === 'model' ? 'api-key' : override.access ?? defaultAccess(info.access)\n if (access === 'keyless' && !info.access.keyless) fail(path + '.access', 'no keyless access')\n if (info.kind !== 'model' && access === 'api-key' && !info.access.apiKey) fail(path + '.access', 'no API-key access')\n if (override.credentialRef !== undefined && !info.access.apiKey) fail(path + '.credentialRef', 'this connection does not accept credentials')\n const values = override.options ?? {}\n const problems = validateOptions(info.label, info.options, values, access, info.exclusive)\n if (problems.length > 0) fail(path + '.options', problems.join('; ') + '; ' + SETTINGS_RESET_HINT)\n const trustedEndpoint = override.trustedEndpoint ?? false\n for (const [name, rule] of Object.entries(info.options)) {\n if (rule.kind === 'url' && values[name] !== undefined && values[name] !== info.endpoint && !trustedEndpoint) {\n fail(path + '.trustedEndpoint', 'a non-official ' + name + ' needs trustedEndpoint: true')\n }\n }\n const disabled = override.disabled ?? (origin.kind === 'builtin' ? info.optIn : false)\n const base = { id, catalogKey: key, label: override.label ?? info.label, disabled, remote: info.remote, trustedEndpoint, options: values }\n if (info.kind === 'model') return { ...base, kind: 'model', route: { kind: 'session' } }\n if (info.kind === 'local') return { ...base, kind: 'local', access: 'keyless' }\n if (info.kind !== 'native' && info.kind !== 'adapter') return fail(path + '.kind', 'unsupported catalog kind')\n if (!info.access.apiKey || info.endpoint === undefined) return fail(path, 'remote catalog entry needs credentials and an endpoint')\n const url = origin.kind === 'custom' && origin.endpoint !== undefined ? origin.endpoint : info.endpoint\n if (url !== info.endpoint && !trustedEndpoint) fail(path + '.trustedEndpoint', 'a custom endpoint needs trustedEndpoint: true')\n return { ...base, kind: info.kind, access, credentialRef: override.credentialRef ?? info.access.apiKey.credentialRef, endpoint: url }\n }\n for (const key of Object.keys(catalog)) {\n const id = builtinId(key)\n const raw = overrides[id]\n if (catalog[key]!.kind === 'model' && raw !== null && typeof raw === 'object') {\n for (const field of ['access', 'credentialRef', 'trustedEndpoint']) {\n if (Object.hasOwn(raw, field)) fail('connections.' + id + '.' + field, 'this connection takes its route from the Session model')\n }\n }\n const override = raw === undefined ? {} : parse(builtinOverrideSchema, raw, 'connections.' + id)\n connections.set(id, resolve(id, key, override, { kind: 'builtin' }))\n }\n for (const [id, raw] of Object.entries(overrides)) {\n if (connections.has(id)) continue\n if ((adapterKeys.length === 0 && protocolKeys.length === 0) || !CUSTOM_CONNECTION_ID.test(id) || builtinKey(id) !== undefined) rejectId(id, 'connections.' + id)\n const path = 'connections.' + id\n const custom = parse(customSchema, raw, path)\n if (custom.kind === 'adapter') {\n connections.set(id, resolve(id, custom.adapter, { ...custom, access: 'api-key' }, { kind: 'custom', endpoint: custom.endpoint }))\n } else {\n const info = protocols![custom.protocol]\n const values = custom.options ?? {}\n const problems = validateOptions(info.label, info.options, values, 'api-key', info.exclusive)\n if (problems.length > 0) fail(path + '.options', problems.join('; ') + '; ' + SETTINGS_RESET_HINT)\n connections.set(id, {\n id, catalogKey: custom.protocol, kind: 'model', label: custom.label, disabled: custom.disabled ?? false,\n remote: true, trustedEndpoint: true, options: values,\n route: { kind: 'fixed', protocol: custom.protocol, model: custom.model, endpoint: custom.endpoint, credentialRef: custom.credentialRef },\n })\n }\n }\n const defaultConnection = settings.defaultConnection ?? defaults.defaultConnection\n if (!connections.has(defaultConnection)) rejectId(defaultConnection, 'defaultConnection')\n return { version: migrations.currentVersion, defaultConnection, showSelector: settings.showSelector ?? true, enhancedTools: settings.enhancedTools ?? false, defaults: settings.defaults ?? parse(defaults.schema, {}, 'defaults'), connections }\n}\n\n/** Bound traversal and cloning before parsing even unknown fields. */\nfunction validateDocumentBounds(value: unknown): void {\n const pending = [{ value, path: 'settings', depth: 0 }]\n const visited = new Set<object>()\n let nodes = 1\n while (pending.length > 0) {\n const current = pending.pop()!\n if (typeof current.value === 'string' && current.value.length > TEXT_MAX_LENGTH) throw new Error(current.path + ': text must contain at most ' + TEXT_MAX_LENGTH + ' characters')\n if (current.value === null || typeof current.value !== 'object') continue\n if (current.depth > 20) throw new Error(current.path + ': settings depth exceeds 20')\n if (visited.has(current.value)) continue\n visited.add(current.value)\n if (Array.isArray(current.value) && current.value.length > 200) throw new Error(current.path + ': must contain at most 200 entries')\n let entries = 0\n for (const key in current.value) {\n if (!Object.hasOwn(current.value, key)) continue\n entries += 1\n if (entries > 200) throw new Error(current.path + ': must contain at most 200 entries')\n if (key.length > TEXT_MAX_LENGTH) throw new Error(current.path + ': key must contain at most ' + TEXT_MAX_LENGTH + ' characters')\n const path = current.path + '.' + key\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') throw new Error(path + ': unsafe key; ' + SETTINGS_RESET_HINT)\n nodes += 1\n if (nodes > 100_000) throw new Error('settings: node budget exceeds 100000')\n pending.push({ value: (current.value as Record<string, unknown>)[key], path, depth: current.depth + 1 })\n }\n }\n}\n","/** Lazy assembly of generated Remote definitions using caller-supplied Zod; no runtime imports. */\n/**\n * Retain one generated definition per endpoint without constructing parsers or projections.\n * The class instance builds its shared descriptor/method index on first access;\n * input schemas and JSON Schema projections are cached only when requested.\n * @param spec - compiler-produced method facts and Zod factories.\n * @param zod - the generated artifact's Zod runtime for named-input parsers.\n * @returns a lazy, mountable info instance with no registration or transport effects.\n */\nexport function createTypertRemoteInfo(spec, zod) {\n return new RemoteInfo(spec, zod);\n}\nclass RemoteInfo {\n spec;\n zod;\n index;\n constructor(spec, zod) {\n this.spec = spec;\n this.zod = zod;\n }\n get package() { return this.spec.package; }\n get descriptors() { return this.resolve().descriptors; }\n get methods() { return this.resolve().methods; }\n resolve() {\n if (this.index !== undefined)\n return this.index;\n const zod = this.zod;\n const descriptors = [];\n const methods = Object.create(null);\n for (const [endpoint, definition] of Object.entries(this.spec.methods)) {\n const separator = endpoint.indexOf('/');\n const namespace = endpoint.slice(0, separator);\n const method = endpoint.slice(separator + 1);\n const parameters = definition.parameters.map(parameter => ({ ...parameter, wire: parameter.wire ?? parameter.name }));\n const descriptor = {\n ...definition,\n id: `${this.spec.package}#${endpoint}`,\n namespace,\n method,\n parameters,\n result: definition.result.description === undefined ? definition.result : new ResultValue(definition.result),\n };\n if (definition.invocation.kind === 'direct') {\n const inputs = [];\n const direct = Object.assign(descriptor, {\n input(options) {\n const strict = options?.strict === true;\n return inputs[strict ? 1 : 0] ??= new NamedInput(parameters, strict, zod);\n },\n invoke(remote, input, signal) {\n const named = input;\n const values = parameters.map(parameter => named[parameter.wire]);\n if (definition.cancellation !== undefined)\n values.push(signal);\n // Namespace access retains the Gateway's mount checks and scoped receiver policy.\n const receiver = Reflect.get(remote, namespace);\n const call = Reflect.get(receiver, method);\n return call.apply(receiver, values);\n },\n });\n // The generated namespace return type is selected by this same descriptor's mode.\n methods[endpoint] = direct;\n }\n descriptors.push(descriptor);\n }\n return this.index = { descriptors, methods };\n }\n}\n/**\n * Narrow a Registry descriptor to its generated direct-method capabilities.\n * @param descriptor - a live descriptor, including possible source fallback or Context-only receivers.\n * @returns whether generated named input and direct invocation are available.\n */\nexport function isTypertRemoteMethod(descriptor) {\n return descriptor.invocation.kind === 'direct' && descriptor.result.mode === 'strict'\n && 'input' in descriptor && typeof descriptor.input === 'function'\n && 'invoke' in descriptor && typeof descriptor.invoke === 'function';\n}\nfunction optional(parameter) {\n return parameter.source === 'json' && parameter.acceptsUndefined === true;\n}\nclass NamedInput {\n parameters;\n strict;\n zod;\n schema;\n projection;\n constructor(parameters, strict, zod) {\n this.parameters = parameters;\n this.strict = strict;\n this.zod = zod;\n }\n codec(parameter) {\n return this.strict ? parameter.strictCodec : parameter.codec;\n }\n create = () => this.schema ??= this.zod.strictObject(Object.fromEntries(this.parameters.map((parameter) => {\n const value = this.codec(parameter).create();\n return [parameter.wire, optional(parameter) ? value.optional() : value.nonoptional()];\n })));\n get jsonSchema() { return this.project().jsonSchema; }\n get jsonSchemaError() { return this.project().jsonSchemaError; }\n project() {\n if (this.projection !== undefined)\n return this.projection;\n const unavailable = this.parameters.find(parameter => this.codec(parameter).jsonSchema === undefined);\n if (unavailable !== undefined) {\n return this.projection = { jsonSchemaError: this.codec(unavailable).jsonSchemaError ?? `No JSON Schema for parameter ${unavailable.wire}` };\n }\n return this.projection = {\n jsonSchema: {\n type: 'object',\n properties: Object.fromEntries(this.parameters.map(parameter => [parameter.wire, {\n ...this.codec(parameter).jsonSchema,\n ...(parameter.description === undefined ? {} : { description: parameter.description }),\n }])),\n required: this.parameters.filter(parameter => !optional(parameter)).map(parameter => parameter.wire),\n additionalProperties: false,\n },\n };\n }\n}\nclass ResultValue {\n spec;\n projection;\n constructor(spec) {\n this.spec = spec;\n }\n get mode() { return this.spec.mode; }\n get typeSymbol() { return this.spec.typeSymbol; }\n get create() { return this.spec.create; }\n get decode() { return this.spec.decode; }\n get encode() { return this.spec.encode; }\n get description() { return this.spec.description; }\n get jsonSchemaError() { return this.spec.jsonSchemaError; }\n get jsonSchema() {\n if (this.projection === undefined) {\n const schema = this.spec.jsonSchema;\n this.projection = { value: schema === undefined ? undefined : { ...schema, description: this.spec.description } };\n }\n return this.projection.value;\n }\n}\n//# sourceMappingURL=remote-info.js.map","/**\n * The per-Session selection vocabulary and the `<ns>/get` · `<ns>/set` ·\n * `<ns>/provider` · `<ns>/pairings` · `<ns>/forgetPairing` Remote contract\n * both capabilities expose. A capability instantiates the zod fragments with\n * its own session options schema and connection extras; Host service and\n * browser store then parse the same shapes.\n */\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nimport { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-info'\nimport { z } from 'zod'\nimport type { Access, BackendKind } from './connections.ts'\n\n/** What a Session chose: a connection, or `null` for off; revision 0 means it never chose. */\nexport interface Selection<O> {\n readonly connectionId: string | null\n readonly revision: number\n readonly options: O\n}\n\n/** Where the Session's current connection comes from; the UI explains it. */\nexport const SELECTION_SOURCES = ['session', 'inherited', 'model', 'default'] as const\nexport type SelectionSource = typeof SELECTION_SOURCES[number]\n\n/** Model memory: the connection last chosen in a Session of this model; `null` remembers \"off\". */\nexport interface Pairing {\n readonly provider: string\n readonly model: string\n readonly connectionId: string | null\n}\n\n/**\n * Whether a connection can serve this Session, judged from local facts only:\n * `ready` never proves upstream access, quota or health.\n */\nexport const CONNECTION_STATUS = ['ready', 'disabled', 'needs-credential', 'unsupported'] as const\nexport type ConnectionStatus = typeof CONNECTION_STATUS[number]\n\n/**\n * Why a connection that follows the Session model cannot serve its current\n * route: no model yet, a provider without a public route, an undeclared or\n * unsupported protocol, no usable endpoint, custom request headers, or no\n * single credential reference. The browser words each reason.\n */\nexport const UNSUPPORTED_REASONS = ['no-model', 'unknown-route', 'protocol', 'endpoint', 'headers', 'credential'] as const\nexport type UnsupportedReason = typeof UNSUPPORTED_REASONS[number]\n\nconst KINDS = ['native', 'adapter', 'model', 'local'] as const satisfies readonly BackendKind[]\nconst ACCESS = ['keyless', 'api-key', 'account'] as const satisfies readonly Access[]\n\nexport const sessionId = z.string().min(1).max(256)\nexport const connectionId = z.string().min(1).max(128)\n\n/** Fields every connection view carries; a capability adds its own with `extras`. */\nexport const connectionViewBase = z.object({\n id: connectionId,\n label: z.string(),\n kind: z.enum(KINDS),\n /** Whether the query or URL is sent to a third-party service. */\n remote: z.boolean(),\n /** How the next call would authenticate. */\n access: z.enum(ACCESS),\n status: z.enum(CONNECTION_STATUS),\n /** Present exactly when `status` is `unsupported`. */\n reason: z.enum(UNSUPPORTED_REASONS).optional(),\n})\n\nexport const selectionRequest = z.object({ sessionId }).strict()\nexport const providerRequest = z.object({}).strict()\nexport const pairingsRequest = z.object({}).strict()\nexport const forgetPairingRequest = z.object({ provider: z.string().min(1), model: z.string().min(1) }).strict()\n\nexport const pairingView = z.object({ provider: z.string(), model: z.string(), connectionId: z.string().nullable() }).strict()\nexport const pairingsView = z.object({ pairings: z.array(pairingView) }).strict()\n\n/**\n * The two facts the browser cannot see when it judges the route from\n * `configForms.get('web')`: the id this plugin registered and the process\n * variable `WebRuntime` falls back to.\n */\nexport const providerView = z.object({\n providerId: z.string(),\n envProvider: z.string().nullable(),\n}).strict()\n\nexport type SelectionRequest = z.infer<typeof selectionRequest>\nexport type ProviderRequest = z.infer<typeof providerRequest>\nexport type ProviderView = z.infer<typeof providerView>\nexport type PairingsRequest = z.infer<typeof pairingsRequest>\nexport type ForgetPairingRequest = z.infer<typeof forgetPairingRequest>\nexport type PairingsView = z.infer<typeof pairingsView>\n\n/** What a capability hands the contract factory. */\nexport interface SelectionContractSpec<O extends z.ZodRawShape, E extends z.ZodRawShape> {\n /** Remote namespace, e.g. `searchConnections`. */\n readonly namespace: string\n /** npm name of the plugin, recorded in the generated Remote info. */\n readonly packageName: string\n /** Session options shape (search: `{ freshness }`; fetch: `{}`); a change may carry any subset of it. */\n readonly options: O\n /** Capability-specific connection view fields (search: `{ freshness: z.boolean() }`). */\n readonly extras: E\n}\n\n/**\n * Build the zod fragments and the mountable Remote info of one capability.\n * Request and result schemas are strict at both ends.\n */\nexport function selectionContract<O extends z.ZodRawShape, E extends z.ZodRawShape>(spec: SelectionContractSpec<O, E>) {\n const { namespace, packageName } = spec\n const options = z.strictObject(spec.options)\n const optionsChange = options.partial()\n const connectionView = connectionViewBase.extend(spec.extras).strict()\n const selection = z.object({ connectionId: z.string().nullable(), revision: z.number().int().nonnegative(), options }).strict()\n const selectionView = z.object({\n selection,\n source: z.enum(SELECTION_SOURCES),\n connections: z.array(connectionView),\n }).strict()\n const selectionChange = z.object({\n sessionId,\n /** A connection id, or null to turn the capability off for the Session. */\n connectionId: connectionId.nullable().optional(),\n /** Session options to change; omitted fields keep their value. */\n options: optionsChange.optional(),\n /** Revision the caller observed; a stale one fails with `<ns>/conflict`. */\n expectedRevision: z.number().int().nonnegative(),\n }).strict().refine(change => change.connectionId !== undefined || change.options !== undefined, 'a change needs connectionId or options')\n\n const strict = (typeSymbol: string, create: () => z.ZodType) => ({ mode: 'strict', typeSymbol, create }) as const\n const request = (typeSymbol: string, create: () => z.ZodType) => ({ name: 'request', source: 'json', codec: strict(typeSymbol, create), strictCodec: strict(typeSymbol, create) }) as const\n const method = (name: string, parameter: ReturnType<typeof request>, result: ReturnType<typeof strict>) =>\n [`${namespace}/${name}`, { service: namespace, invocation: { kind: 'direct' }, parameters: [parameter], result }] as const\n const Type = (name: string) => `${namespace[0]!.toUpperCase()}${namespace.slice(1)}${name}`\n\n /** Client contribution; mount with `ctx.remote.$mount(remoteInfo)`. */\n const remoteInfo = createTypertRemoteInfo({\n package: packageName,\n methods: Object.fromEntries([\n method('get', request(Type('SelectionRequest'), () => selectionRequest), strict(Type('SelectionView'), () => selectionView)),\n method('set', request(Type('SelectionChange'), () => selectionChange), strict(Type('SelectionView'), () => selectionView)),\n method('provider', request(Type('ProviderRequest'), () => providerRequest), strict(Type('ProviderView'), () => providerView)),\n method('pairings', request(Type('PairingsRequest'), () => pairingsRequest), strict(Type('PairingsView'), () => pairingsView)),\n method('forgetPairing', request(Type('ForgetPairingRequest'), () => forgetPairingRequest), strict(Type('PairingsView'), () => pairingsView)),\n ]),\n }, z)\n\n return { namespace, options, optionsChange, connectionView, selection, selectionView, selectionChange, remoteInfo }\n}\n\nexport type SelectionContract<O extends z.ZodRawShape, E extends z.ZodRawShape> = ReturnType<typeof selectionContract<O, E>>\nexport type ConnectionViewOf<C> = C extends { connectionView: z.ZodType<infer V> } ? V : never\nexport type SelectionViewOf<C> = C extends { selectionView: z.ZodType<infer V> } ? V : never\nexport type SelectionChangeOf<C> = C extends { selectionChange: z.ZodType<infer V> } ? V : never\n\n/**\n * The capability-agnostic views, for code that handles either capability (the\n * ui package). A capability's own types (`SelectionViewOf<typeof contract>`)\n * are assignable to them.\n */\nexport type ConnectionView = z.infer<typeof connectionViewBase> & Readonly<Record<string, unknown>>\nexport interface SelectionView<O extends Record<string, unknown> = Record<string, unknown>> {\n readonly selection: Selection<O>\n readonly source: SelectionSource\n readonly connections: readonly ConnectionView[]\n}\n/** A change as any capability's `<ns>/set` accepts it; the capability's contract narrows `options`. */\nexport interface SelectionChange<O extends Record<string, unknown> = Record<string, unknown>> {\n readonly sessionId: string\n readonly connectionId?: string | null | undefined\n readonly options?: Partial<O> | undefined\n readonly expectedRevision: number\n}\n\n/**\n * The method map a capability merges into `TypertRemoteMap`:\n * `interface TypertRemoteMap extends ConnectionsRemoteMap<'searchConnections', SearchSelectionView> {}`.\n */\nexport type ConnectionsRemoteMap<NS extends string, V, C = SelectionChange> = {\n [K in `${NS}/get`]: (request: SelectionRequest) => Promise<RemoteResult<V>>\n} & {\n [K in `${NS}/set`]: (request: C) => Promise<RemoteResult<V>>\n} & {\n [K in `${NS}/provider`]: (request: ProviderRequest) => Promise<RemoteResult<ProviderView>>\n} & {\n [K in `${NS}/pairings`]: (request: PairingsRequest) => Promise<RemoteResult<PairingsView>>\n} & {\n [K in `${NS}/forgetPairing`]: (request: ForgetPairingRequest) => Promise<RemoteResult<PairingsView>>\n}\n\n/** The error details a capability merges into `RemoteErrorDetailsMap`. */\nexport type ConnectionsRemoteErrors<NS extends string> = {\n /** The row document is invalid; repair it on the settings page. */\n [K in `${NS}/invalid-settings`]: {}\n} & {\n /** The selection changed after the caller read it; re-read and retry. */\n [K in `${NS}/conflict`]: {}\n} & {\n /** The requested connection is missing or disabled. */\n [K in `${NS}/unavailable`]: { readonly connectionId: string }\n}\n","import type { AccessMode, Descriptor, ProtocolDescriptor } from 'dsh-tool-web-enhanced-core/shared'\n\nexport { FRESHNESS, type Freshness } from 'dsh-tool-web-enhanced-core/shared'\n\nexport type SearchDescriptor = Descriptor & { readonly freshness: readonly AccessMode[] } & (\n | { readonly kind: 'native' | 'adapter'; readonly endpoint: string }\n | { readonly kind: 'model' }\n)\n\nconst noControl = /^[\\u0020-\\u{10ffff}]+$/u\nconst nativeAccess = { keyless: false, apiKey: { credentialRef: 'DEEPSEEK_API_KEY' }, account: true } as const\nconst baseURL = { kind: 'url' } as const\n\n/**\n * Model search options. Names are unique across protocols: a custom model\n * connection accepts its protocol's subset, the Session-model connection\n * accepts all of them and applies those of the route it follows. Unset\n * options keep each API's own default; defaults follow the current Anthropic\n * and OpenAI standards, and another vendor's compatibility is the operator's\n * to tune here.\n */\nconst maxTokens = { kind: 'integer', min: 1, max: 128_000 } as const\n/** Anthropic Messages tool versions, newest first. */\nconst anthropicTool = { kind: 'enum', values: ['web_search_20260318', 'web_search_20260209', 'web_search_20250305'] } as const\nconst maxUses = { kind: 'integer', min: 1, max: 50 } as const\n/** `direct` is required by models without programmatic tool calling on web_search_20260209 and later. */\nconst allowedCallers = { kind: 'enum', values: ['direct', 'code_execution_20260120'] } as const\nconst responseInclusion = { kind: 'enum', values: ['full', 'excluded'] } as const\nconst responsesTool = { kind: 'enum', values: ['web_search', 'web_search_preview'] } as const\nconst searchContextSize = { kind: 'enum', values: ['low', 'medium', 'high'] } as const\nconst externalWebAccess = { kind: 'boolean' } as const\nconst returnTokenBudget = { kind: 'enum', values: ['default', 'unlimited'] } as const\n/** A bare domain with an optional path and no scheme, as both vendors document; disjoint classes keep the match linear. */\nconst DOMAIN = /^[A-Za-z0-9.-]{1,253}(?:\\/[\\x21-\\x7e]{1,200})?$/u\nconst allowedDomains = { kind: 'list', pattern: DOMAIN, max: 100 } as const\nconst blockedDomains = { kind: 'list', pattern: DOMAIN, max: 100 } as const\nconst userCity = { kind: 'text', pattern: noControl, maxLength: 200 } as const\nconst userRegion = { kind: 'text', pattern: noControl, maxLength: 200 } as const\nconst userCountry = { kind: 'text', pattern: /^[A-Za-z]{2}$/u } as const\nconst userTimezone = { kind: 'text', pattern: /^[A-Za-z][A-Za-z0-9_+-]*(?:\\/[A-Za-z0-9_+-]+){0,3}$/u, maxLength: 64 } as const\nconst location = { userCity, userRegion, userCountry, userTimezone } as const\n\n/** Wire protocols of `model` connections, in display order; custom model connections name one of these keys. */\nexport const MODEL_PROTOCOLS = {\n 'anthropic-messages': {\n label: 'Anthropic Messages', use: 'the model searches and answers',\n options: { maxTokens, anthropicTool, maxUses, allowedCallers, responseInclusion, allowedDomains, blockedDomains, ...location },\n /** Anthropic takes one domain policy; Responses takes both. */\n exclusive: [['allowedDomains', 'blockedDomains']],\n },\n 'openai-responses': {\n label: 'OpenAI Responses', use: 'the model searches and answers',\n options: { maxTokens, responsesTool, searchContextSize, externalWebAccess, returnTokenBudget, allowedDomains, blockedDomains, ...location },\n },\n 'openai-chat-completions': {\n label: 'OpenAI Chat Completions', use: 'the model searches and answers',\n options: { maxTokens, searchContextSize, ...location },\n },\n} as const satisfies Record<string, ProtocolDescriptor>\nexport type ModelProtocol = keyof typeof MODEL_PROTOCOLS\n\n/** Every protocol's options: the Session-model connection's rules. */\nexport const MODEL_OPTIONS = {\n ...MODEL_PROTOCOLS['anthropic-messages'].options,\n ...MODEL_PROTOCOLS['openai-responses'].options,\n ...MODEL_PROTOCOLS['openai-chat-completions'].options,\n} as const\n\n/**\n * What a request sends when the operator sets nothing. Anthropic requires\n * max_tokens; OpenAI token caps stay unset. Tool versions are each vendor's\n * current standard; DeepSeek's Messages dialect supplies different defaults\n * in model/deepseek.ts, unless the operator explicitly selects a tool version.\n */\nexport const MODEL_DEFAULTS = {\n maxTokens: 4096,\n maxUses: 5,\n anthropicTool: 'web_search_20260318',\n responsesTool: 'web_search',\n} as const\n\n/** Display order and secret-free facts shared by settings, Host and browser. */\nexport const CATALOG = {\n 'deepseek-messages': {\n label: 'DeepSeek Messages', kind: 'native', remote: true, optIn: false, use: 'answers with a summary and sources',\n endpoint: 'https://api.deepseek.com/anthropic/v1', homepage: 'https://platform.deepseek.com',\n access: nativeAccess, freshness: [],\n options: {\n baseURL,\n model: { kind: 'text', pattern: /[\\s\\S]*/u },\n apiVersion: { kind: 'text', pattern: /[\\s\\S]*/u },\n maxTokens: { kind: 'integer', min: 1, max: Number.POSITIVE_INFINITY },\n maxUses: { kind: 'integer', min: 1, max: Number.POSITIVE_INFINITY },\n },\n },\n 'deepseek-search-api': {\n label: 'DeepSeek Search API', kind: 'native', remote: true, optIn: true,\n endpoint: 'https://api.deepseek.com/v1/tools', homepage: 'https://platform.deepseek.com',\n access: nativeAccess, freshness: [],\n options: {\n baseURL,\n count: { kind: 'integer', min: 1, max: 50 },\n sendOriginalQuestion: { kind: 'boolean' },\n },\n },\n 'session-model': {\n label: 'Session model', kind: 'model', remote: true, optIn: false, use: 'the session model searches and answers',\n access: { keyless: false, apiKey: false, account: false }, freshness: [], options: MODEL_OPTIONS,\n // It mostly follows Messages routes, so it keeps the stricter Anthropic rule.\n exclusive: MODEL_PROTOCOLS['anthropic-messages'].exclusive,\n },\n exa: {\n label: 'Exa', endpoint: 'https://api.exa.ai/search', access: { keyless: true, apiKey: { credentialRef: 'EXA_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: ['api-key'], homepage: 'https://exa.ai',\n options: { type: { kind: 'enum', values: ['auto', 'fast', 'instant'], keyless: false } },\n },\n firecrawl: {\n label: 'Firecrawl', endpoint: 'https://api.firecrawl.dev/v2/search', access: { keyless: true, apiKey: { credentialRef: 'FIRECRAWL_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: ['keyless', 'api-key'], homepage: 'https://www.firecrawl.dev',\n options: { country: { kind: 'text', pattern: /^[A-Za-z]{2}$/u }, location: { kind: 'text', pattern: noControl, maxLength: 200 }, safe: { kind: 'boolean' } },\n },\n tavily: {\n label: 'Tavily', endpoint: 'https://api.tavily.com/search', access: { keyless: true, apiKey: { credentialRef: 'TAVILY_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://www.tavily.com',\n options: {\n search_depth: { kind: 'enum', values: ['basic', 'advanced', 'fast', 'ultra-fast'] },\n topic: { kind: 'enum', values: ['general', 'news', 'finance'] },\n },\n },\n tinyfish: {\n label: 'Tinyfish', endpoint: 'https://api.search.tinyfish.ai', access: { keyless: true, apiKey: { credentialRef: 'TINYFISH_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://www.tinyfish.ai',\n options: {\n location: { kind: 'text', pattern: /^[A-Za-z]{2}$/u },\n language: { kind: 'text', pattern: /^[A-Za-z]{2,3}(?:-[A-Za-z]{2,4})?$/u },\n purpose: { kind: 'text', pattern: /^[\\u0020-\\u{10ffff}]+$/u },\n domain_type: { kind: 'enum', values: ['web', 'news', 'research_paper'], keyless: ['web', 'news'] },\n },\n },\n openalex: {\n label: 'OpenAlex', endpoint: 'https://api.openalex.org/works', access: { keyless: true, apiKey: { credentialRef: 'OPENALEX_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://openalex.org',\n use: 'scholarly works (papers, citations); keyword queries',\n options: {\n sort: { kind: 'text', pattern: /^[a-z_]+:(?:asc|desc)(?:,[a-z_]+:(?:asc|desc))*$/u },\n filter: { kind: 'text', pattern: /^[\\u0020-\\u{10ffff}]+$/u, maxLength: 500 },\n is_oa: { kind: 'boolean' },\n // The core checks length first; @ and dot delimit disjoint, linear segments.\n mailto: { kind: 'text', maxLength: 254, pattern: /^[^\\s@]+@[^\\s@.]+(?:\\.[^\\s@.]+)+$/u },\n },\n },\n semanticscholar: {\n label: 'Semantic Scholar', endpoint: 'https://api.semanticscholar.org/graph/v1/paper/search', access: { keyless: false, apiKey: { credentialRef: 'SEMANTIC_SCHOLAR_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://www.semanticscholar.org/product/api',\n use: 'academic papers (citations, TL;DR); keyword queries',\n options: {\n year: { kind: 'text', pattern: /^\\d{4}(?:-\\d{4})?$/u },\n fieldsOfStudy: { kind: 'text', pattern: /^[A-Za-z ,]+$/u, maxLength: 100 },\n publicationTypes: { kind: 'text', pattern: /^[A-Za-z,]+$/u, maxLength: 100 },\n },\n },\n} as const satisfies Record<string, SearchDescriptor>\n\nexport type CatalogKey = keyof typeof CATALOG\nexport const NATIVE_KEYS = ['deepseek-messages', 'deepseek-search-api'] as const satisfies readonly CatalogKey[]\nexport const ADAPTER_KEYS = ['exa', 'firecrawl', 'tavily', 'tinyfish', 'openalex', 'semanticscholar'] as const satisfies readonly CatalogKey[]\nexport const MODEL_KEYS = ['session-model'] as const satisfies readonly CatalogKey[]\nexport type AdapterKey = typeof ADAPTER_KEYS[number]\nexport const isCatalogKey = (value: unknown): value is CatalogKey => typeof value === 'string' && Object.hasOwn(CATALOG, value)\n\nexport function honorsFreshness(key: CatalogKey, access: AccessMode): boolean {\n const modes: readonly AccessMode[] = CATALOG[key].freshness\n return modes.includes(access)\n}\n\nexport const DEFAULT_CONNECTION = 'builtin:deepseek-messages'\n","import type { TypertRemoteNamespace } from '@deepseek-ai/dsh-typert-protocol'\nimport { SEARCH, selectionContract, type ConnectionsRemoteErrors, type ConnectionsRemoteMap } from 'dsh-tool-web-enhanced-core/shared'\nimport { z } from 'zod'\nimport { FRESHNESS } from './catalog.ts'\n\nexport const contract = selectionContract({\n namespace: 'searchConnections', packageName: SEARCH.packageName,\n options: { freshness: z.enum(FRESHNESS) },\n extras: { freshness: z.boolean() },\n})\n/** The Session options schema; `contract.optionsChange` accepts any subset of it. */\nexport const searchOptions = contract.options\n\nexport type SearchConnectionView = z.infer<typeof contract.connectionView>\nexport type SearchSelectionView = z.infer<typeof contract.selectionView>\nexport type SearchSelectionChange = z.infer<typeof contract.selectionChange>\n\ndeclare module '@deepseek-ai/dsh-typert-protocol' {\n interface TypertRemoteMap extends ConnectionsRemoteMap<'searchConnections', SearchSelectionView, SearchSelectionChange> {}\n interface TypertRemoteNamespaceMap {\n searchConnections: TypertRemoteNamespace<'searchConnections'>\n }\n interface RemoteErrorDetailsMap extends ConnectionsRemoteErrors<'searchConnections'> {}\n}\n","import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport { useCallback, useSyncExternalStore } from 'react'\n\n/**\n * Read an observable snapshot in a component. The subscribe and getSnapshot\n * callbacks are stable per source, so React subscribes once per source rather\n * than once per render; a source that publishes on subscription would\n * otherwise re-render and re-subscribe without end.\n */\nexport function useObservable<T>(source: ObservableSnapshot<T>): T {\n const subscribe = useCallback((listener: () => void) => source.subscribe(listener), [source])\n const getSnapshot = useCallback(() => source.getSnapshot(), [source])\n return useSyncExternalStore(subscribe, getSnapshot)\n}\n","/** Building blocks shared by the settings sections. */\nimport { useState, type ReactNode } from 'react'\nimport { Button, IconChevronDownOutlineRegular, Menu } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsLayers } from './sparse.ts'\nexport type SettingsClasses = Readonly<Record<string, string>>\n\nexport function classNames(...args: unknown[]): string {\n return args\n .flat(Number.POSITIVE_INFINITY)\n .filter(Boolean)\n .map(arg => {\n if (typeof arg === 'string') return arg\n if (typeof arg === 'object' && arg !== null) {\n return Object.entries(arg)\n .filter(([, v]) => Boolean(v))\n .map(([k]) => k)\n .join(' ')\n }\n return ''\n })\n .filter(Boolean)\n .join(' ')\n}\n\n/** The accepted document a section edits. */\nexport interface SettingsDoc<S = unknown> {\n readonly config: S\n readonly layers: SettingsLayers\n readonly revision: number\n /** Writable and in the current schema version. */\n readonly editable: boolean\n}\n\n/**\n * Operations computed from the layers they will apply to: the page runs it\n * once the writes before it have settled, on the document they left.\n */\nexport type SettingsChange = (layers: SettingsLayers) => readonly SettingsPathOpView[]\n\n/**\n * Submit a change after the page's earlier writes; resolves whether the Host\n * accepted it. Operations are fenced by a revision (default: the one the page\n * shows), so a form that edited what it displayed is refused once that changed;\n * a {@link SettingsChange} is fenced by the revision it was computed on. No\n * operations is a no-op success.\n */\nexport type WriteSettings = (change: readonly SettingsPathOpView[] | SettingsChange, revision?: number) => Promise<boolean>\n\n/** A local schema failure whose diagnostic stays out of the translated message. */\nexport class SettingsValidationError extends Error {}\n\nexport interface WriteState {\n readonly busy: boolean\n readonly error: string | undefined\n readonly errorTitle: string | undefined\n /** Run one write, recording a refusal or a transport failure as this section's error. */\n run(work: () => Promise<boolean>): Promise<boolean>\n}\n\nexport interface SelectOption<T extends string = string> { readonly id: T; readonly label: string }\n\nexport function createSettingsParts<K extends string>({ classes: css, keys }: {\n classes: SettingsClasses\n keys: Readonly<Record<'refused' | 'invalid' | 'failed', K>>\n}) {\n /** `titleId` lets a control inside name itself by the section title. */\n function Section({ title, titleId, actions, children }: { title: string; titleId?: string | undefined; actions?: ReactNode; children: ReactNode }) {\n return (\n <section className={css.section}>\n <div className={css.sectionHead}>\n <h4 id={titleId} className={css.sectionTitle}>{title}</h4>\n {actions}\n </div>\n {children}\n </section>\n )\n }\n \n /** Title and hint on the left, one control on the right; wraps under the text on narrow pages. */\n function SettingRow({ title, hint, children }: { title: string; hint: ReactNode; children: ReactNode }) {\n return (\n <div className={css.settingRow}>\n <div className={css.settingText}>\n <div className={css.settingTitle}>{title}</div>\n <div className={css.hint}>{hint}</div>\n </div>\n <div className={css.settingControl}>{children}</div>\n </div>\n )\n }\n \n \n \n /** A dropdown in the settings pill style, built on the shared Menu. */\n function SelectMenu<T extends string = string>({ label, title, value, options, disabled, onChange, compact = false }: {\n label: string\n /** Hover text, e.g. the upstream name of an option. */\n title?: string\n value: T\n options: readonly SelectOption<T>[]\n disabled: boolean\n onChange: (id: T) => void\n compact?: boolean\n }) {\n const [open, setOpen] = useState(false)\n const current = options.find(option => option.id === value)\n return (\n <Menu\n open={open}\n onClose={() => { setOpen(false) }}\n items={options.map(option => ({ id: option.id, label: option.label }))}\n selectedId={value}\n onSelect={(id) => {\n setOpen(false)\n if (id !== value) onChange(id as T)\n }}\n align=\"end\"\n portal\n anchor={(\n <button\n type=\"button\"\n className={compact ? css.selectCompact : css.select}\n aria-label={label}\n title={title}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n disabled={disabled}\n onClick={() => { setOpen(!open) }}\n >\n <span className={css.selectValue}>{current?.label ?? value}</span>\n <IconChevronDownOutlineRegular className={css.selectChevron} />\n </button>\n )}\n />\n )\n }\n \n /** Pending state and the last failure of one section's writes. */\n function useWrite(t: ClientTranslate<K>): WriteState {\n const [state, setState] = useState<{ busy: boolean; error: string | undefined; errorTitle: string | undefined }>({ busy: false, error: undefined, errorTitle: undefined })\n const run = async (work: () => Promise<boolean>): Promise<boolean> => {\n setState({ busy: true, error: undefined, errorTitle: undefined })\n try {\n const accepted = await work()\n setState({ busy: false, error: accepted ? undefined : t(keys.refused), errorTitle: undefined })\n return accepted\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n const invalid = error instanceof SettingsValidationError\n setState({\n busy: false,\n error: invalid ? t(keys.invalid) : message || t(keys.failed),\n errorTitle: invalid ? message : undefined,\n })\n return false\n }\n }\n return { ...state, run }\n }\n \n function ErrorText({ children, title }: { children: string | undefined; title?: string | undefined }) {\n return children === undefined ? null : <p className={css.error} role=\"alert\" title={title}>{children}</p>\n }\n \n /** Inline confirmation of a destructive action: the question beside cancel and confirm. */\n function ConfirmRow({ message, confirmLabel, cancelLabel, disabled, onConfirm, onCancel }: {\n message: string\n confirmLabel: string\n cancelLabel: string\n disabled: boolean\n onConfirm: () => void\n onCancel: () => void\n }) {\n return (\n <div className={css.confirmRow} role=\"group\" aria-label={message}>\n <span className={css.confirmText}>{message}</span>\n <div className={css.actions}>\n <Button variant=\"ghost\" size=\"sm\" onClick={onCancel}>{cancelLabel}</Button>\n <Button variant=\"outline\" size=\"sm\" className={css.danger} disabled={disabled} onClick={onConfirm}>{confirmLabel}</Button>\n </div>\n </div>\n )\n }\n \n \n return { Section, SettingRow, SelectMenu, ErrorText, ConfirmRow, useWrite }\n}\nexport type SettingsParts<K extends string> = ReturnType<typeof createSettingsParts<K>>\n\nexport function applyOps(user: unknown, ops: readonly SettingsPathOpView[]): Record<string, unknown> {\n const root = structuredClone(user !== null && typeof user === 'object' && !Array.isArray(user) ? user as Record<string, unknown> : {})\n for (const op of ops) {\n if (op.path.length === 0) continue\n if (op.op === 'set') {\n let current: Record<string, unknown> = root\n for (let i = 0; i < op.path.length - 1; i++) {\n const seg = op.path[i]!\n if (current[seg] === null || typeof current[seg] !== 'object' || Array.isArray(current[seg])) {\n current[seg] = {}\n }\n current = current[seg] as Record<string, unknown>\n }\n current[op.path.at(-1)!] = structuredClone(op.value)\n } else if (op.op === 'unset') {\n let current: Record<string, unknown> = root\n for (let i = 0; i < op.path.length - 1; i++) {\n const seg = op.path[i]!\n if (current[seg] === null || typeof current[seg] !== 'object' || Array.isArray(current[seg])) {\n break\n }\n current = current[seg] as Record<string, unknown>\n }\n delete current[op.path.at(-1)!]\n }\n }\n return root\n}\n","import { useEffect, useMemo, useRef, useState } from 'react'\nimport type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { SettingsDocumentSnapshot } from './secret-diagnostics.ts'\nimport { CURRENT_SETTINGS_VERSION, SETTINGS_MIGRATIONS, documentVersion, migrateDocument, type SettingsMigrations } from '../../shared/settings.ts'\nimport { applyOps, SettingsValidationError, type WriteSettings } from './parts.tsx'\nimport type { SettingsLayers } from './sparse.ts'\n\ntype Document = Record<string, unknown>\ntype ResolveSettings = (document: unknown) => unknown\ntype Mutate = (operations: SettingsPathOpView[], revision: number) => Promise<boolean>\n\nexport type SettingsDocumentView<S> =\n | { readonly kind: 'ready'; readonly config: S; readonly layers: SettingsLayers; readonly needsWriteback: boolean }\n | { readonly kind: 'invalid'; readonly diagnostic: string; readonly layers: SettingsLayers; readonly needsWriteback: false }\n\n/** ConfigForm.value is schema-projected; the raw layers retain unknown fields for validation. */\nexport function effectiveDocument(snapshot: SettingsLayers): Document {\n return merge(snapshot.base, snapshot.user)\n}\n\n/** Validate before exposing normal editors; only successful older migrations need writeback. */\nexport function editableSettings<S>(raw: unknown, layers: SettingsLayers, writable: boolean, resolve: ResolveSettings, migrations: SettingsMigrations = SETTINGS_MIGRATIONS): SettingsDocumentView<S> {\n try {\n const version = documentVersion(raw, migrations.currentVersion)\n const config = migrateDocument(raw, migrations)\n resolve(config)\n return { kind: 'ready', config: config as S, layers, needsWriteback: writable && version.kind === 'older' }\n } catch (error) {\n return { kind: 'invalid', diagnostic: diagnostic(error), layers, needsWriteback: false }\n }\n}\n\n/** Check the exact recursively overlaid candidate that the settings store will persist. */\nexport function settingsOperations(layers: SettingsLayers, operations: readonly SettingsPathOpView[], resolve: ResolveSettings): SettingsPathOpView[] {\n try {\n const candidate = effectiveDocument({ base: layers.base, user: applyOps(layers.user, operations) })\n const result = [...operations]\n if (result.some(op => op.op === 'set') && candidate.version === undefined) {\n result.push({ op: 'set', path: ['version'], value: CURRENT_SETTINGS_VERSION })\n candidate.version = CURRENT_SETTINGS_VERSION\n }\n resolve(candidate)\n return result\n } catch (error) {\n throw new SettingsValidationError(diagnostic(error))\n }\n}\n\n/**\n * Share validation, revision fencing and automatic future migrations between both pages.\n * @param snapshot - the settings snapshot the page renders.\n * @param read - the settings snapshot now, which a write the form accepted has already updated.\n */\nexport function useSettingsDocument<S>(snapshot: SettingsDocumentSnapshot<S>, read: () => SettingsDocumentSnapshot<S>, resolve: ResolveSettings, mutate: Mutate, migrations: SettingsMigrations = SETTINGS_MIGRATIONS) {\n const view = useMemo((): SettingsDocumentView<S> | undefined => {\n if (snapshot.status === 'unavailable' || snapshot.value === undefined || snapshot.revision === undefined) return undefined\n const result = editableSettings<S>(effectiveDocument(snapshot), { base: snapshot.base, user: snapshot.user }, snapshot.writable, resolve, migrations)\n if (snapshot.diagnostic === undefined) return result\n return { kind: 'invalid', layers: result.layers, needsWriteback: false,\n diagnostic: result.kind === 'invalid' ? result.diagnostic + '; ' + snapshot.diagnostic : snapshot.diagnostic }\n }, [snapshot, resolve, migrations])\n const attemptedRevision = useRef<number | undefined>(undefined)\n const [failure, setFailure] = useState<{ revision: number; diagnostic: string }>()\n const revision = snapshot.revision\n\n useEffect(() => {\n if (view?.kind !== 'ready' || !view.needsWriteback || revision === undefined || attemptedRevision.current === revision) return\n attemptedRevision.current = revision\n const writeback = async () => {\n try {\n const operations = replaceDocumentOperations(view.layers.user, view.config as Document)\n await mutate(settingsOperations(view.layers, operations, resolve), revision)\n } catch (error) {\n setFailure({ revision, diagnostic: diagnostic(error) })\n }\n }\n void writeback()\n }, [view, revision, resolve, mutate])\n\n // Sections write independently; one at a time, each on what the one before it left.\n const queue = useRef<Promise<unknown>>(Promise.resolve())\n const submit = async (change: Parameters<WriteSettings>[0], displayedRevision: number | undefined): Promise<boolean> => {\n if (typeof change !== 'function') {\n if (change.length === 0) return true\n if (view === undefined || !snapshot.writable || displayedRevision === undefined) return false\n return mutate(settingsOperations(view.layers, change, resolve), displayedRevision)\n }\n const current = read()\n if (current.status !== 'ready' || !current.writable || current.revision === undefined) return false\n const layers = { base: current.base, user: current.user }\n const operations = change(layers)\n if (operations.length === 0) return true\n return mutate(settingsOperations(layers, operations, resolve), current.revision)\n }\n const write: WriteSettings = (change, expectedRevision = revision) => {\n const task = queue.current.then(() => submit(change, expectedRevision))\n queue.current = task.then(() => {}, () => {})\n return task\n }\n return { view, write, migrationError: failure?.revision === revision ? failure?.diagnostic : undefined }\n}\n\nfunction replaceDocumentOperations(user: unknown, document: Document): SettingsPathOpView[] {\n const operations: SettingsPathOpView[] = Object.keys(objectOf(user))\n .filter(key => !Object.hasOwn(document, key))\n .map(key => ({ op: 'unset', path: [key] }))\n for (const [key, value] of Object.entries(document)) {\n operations.push({ op: 'set', path: [key], value: value as Extract<SettingsPathOpView, { op: 'set' }>['value'] })\n }\n return operations\n}\n\nfunction diagnostic(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction isObject(value: unknown): value is Document {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction objectOf(value: unknown): Document {\n return isObject(value) ? value : {}\n}\n\nfunction merge(base: unknown, user: unknown): Document {\n const result = { ...objectOf(base) }\n for (const [key, value] of Object.entries(objectOf(user))) {\n Object.defineProperty(result, key, { value: isObject(value) && isObject(result[key]) ? merge(result[key], value) : value, enumerable: true, writable: true, configurable: true })\n }\n return result\n}\n","/**\n * The composer menu's \"more services in settings\" fact, derived from the row\n * settings by the same resolution the Host uses (docs/design.md, \"远程服务缺省停用\").\n */\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { builtinId, type Descriptor } from '../shared/connections.ts'\nimport { effectiveDocument, editableSettings } from './settings/document.ts'\n\n/** What the fact reads of a resolved document. */\nexport interface ResolvedConnections {\n readonly connections: ReadonlyMap<string, { readonly disabled: boolean }>\n}\n\n/** Whether the catalog has remote services and every one of them is off. */\nexport function remoteServicesOff(catalog: Readonly<Record<string, Descriptor>>, resolved: ResolvedConnections): boolean {\n const remote = Object.keys(catalog).filter(key => catalog[key]!.optIn)\n return remote.length > 0 && remote.every(key => resolved.connections.get(builtinId(key))!.disabled)\n}\n\n/** The fact for the current row settings, recomputed only when the settings snapshot changes. */\nexport function remoteServicesOffSource<S>(settings: ObservableSnapshot<ConfigFormSnapshot<S>>, catalog: Readonly<Record<string, Descriptor>>, resolve: (document: unknown) => ResolvedConnections): ObservableSnapshot<boolean> {\n let cached: { readonly source: ConfigFormSnapshot<S>; readonly off: boolean } | undefined\n const compute = (source: ConfigFormSnapshot<S>): boolean => {\n if (source.value === undefined) return false\n const view = editableSettings(effectiveDocument(source), source, false, resolve)\n return view.kind === 'ready' && remoteServicesOff(catalog, resolve(view.config))\n }\n return {\n getSnapshot() {\n const source = settings.getSnapshot()\n if (cached === undefined || cached.source !== source) cached = { source, off: compute(source) }\n return cached.off\n },\n subscribe: listener => settings.subscribe(listener),\n }\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { CommandDecoration, SelectOption, SelectOptionGroup } from '@deepseek-ai/dsh-client-ui-commands/client'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-typert-protocol'\nimport type { SelectionView } from '../shared/selection.ts'\nimport type { ConnectionText, SelectionState, SelectionStore, SelectionUpdate } from './section.ts'\n\nexport type ClientTranslate<K extends string = string> = (key: K, params?: Record<string, string | number>) => string\nexport type CommandCopyKey = 'placeholder' | 'empty' | 'noResults' | 'readFailed' | 'current' | 'off'\nexport type CommandDetail = (hint: string | undefined, current: boolean) => { detail?: string }\n\nexport interface CommandOptions<V extends SelectionView> {\n choices(view: V, detail: CommandDetail): readonly SelectOption[]\n parse(id: string): SelectionUpdate | undefined\n isCurrent(update: SelectionUpdate, selection: V['selection']): boolean\n}\n\nexport interface SelectionCommandSpec<V extends SelectionView, K extends string> {\n /** The capability's Host command (`PluginIdentity.command`). */\n readonly name: string\n readonly t: ClientTranslate<K>\n readonly keys: Readonly<Record<CommandCopyKey, K>>\n readonly groups: (view: V) => readonly { group: SelectOptionGroup; connections: readonly V['connections'][number][] }[]\n readonly describe: (connection: V['connections'][number]) => ConnectionText\n readonly writeFailureText: (error: RemoteFailure) => string\n readonly options?: CommandOptions<V>\n}\n\n/** Shared ids cannot be shadowed by capability-specific option groups. */\nexport function parseSelectionCommandOption(id: string, parseOptions?: (id: string) => SelectionUpdate | undefined): SelectionUpdate | undefined {\n if (id === 'off') return { connectionId: null }\n const prefix = 'connection:'\n if (id.startsWith(prefix) && id.length > prefix.length) return { connectionId: id.slice(prefix.length) }\n return parseOptions?.(id)\n}\n\n/**\n * The browser's bare invocation of the capability's Host command: a popup over\n * the same per-session store the composer menu uses. The Host command keeps its\n * menu row and runs every line with arguments.\n */\nexport function selectionCommand<V extends SelectionView, K extends string>(\n selections: SelectionStore<V> & { current(sessionId: string): Promise<SelectionState<V>> },\n spec: SelectionCommandSpec<V, K>,\n): CommandDecoration {\n const t = (key: CommandCopyKey) => spec.t(spec.keys[key])\n const read = async (sessionId: string) => {\n const { view, readFailure } = await selections.current(sessionId)\n if (view === undefined || readFailure !== undefined) throw new Error(t('readFailed'))\n return view\n }\n return {\n name: spec.name,\n available: () => true,\n ui: {\n kind: 'popupSelect',\n searchLabels: () => ({ placeholder: t('placeholder'), empty: t('empty'), noResults: t('noResults') }),\n async options(session) {\n const view = await read(session.sessionId)\n const { connectionId } = view.selection\n const detail: CommandDetail = (hint, current) => {\n const text = [hint, current ? t('current') : undefined].filter(part => part !== undefined).join(' · ')\n return text === '' ? {} : { detail: text }\n }\n const options: SelectOption[] = [\n { id: 'off', label: t('off'), ...detail(undefined, connectionId === null), ...(connectionId === null ? { active: true } : {}) },\n ]\n for (const { group, connections } of spec.groups(view)) {\n for (const connection of connections) {\n if (connection.status !== 'ready') continue\n const text = spec.describe(connection)\n options.push({ id: 'connection:' + connection.id, label: text.label, group,\n ...detail(text.caption, connection.id === connectionId), ...(connection.id === connectionId ? { active: true } : {}) })\n }\n }\n if (spec.options !== undefined) options.push(...spec.options.choices(view, detail))\n return options\n },\n async onSelect(option, session) {\n const options = spec.options\n const update = parseSelectionCommandOption(option.id, options === undefined ? undefined : id => options.parse(id))\n if (update === undefined) return\n const { selection } = await read(session.sessionId)\n const current = update.connectionId !== undefined\n ? update.connectionId === selection.connectionId\n : spec.options !== undefined && spec.options.isCurrent(update, selection)\n if (current) return\n const result = await selections.set(session.sessionId, update)\n if (!result.ok) throw new Error(spec.writeFailureText(result.error))\n },\n },\n }\n}\n\n/**\n * Call `ran` after this browser ran the Host command `name` in a Session. A line\n * with arguments (`/setup-search off`) writes on the Host without the selection\n * store, so that Session's views must read again. DSH reports each Host command\n * this browser executed with `command/executed`, without its arguments, so every\n * run counts; runs from another browser or the TUI are not reported here.\n * @returns the listener's disposer; it also ends with `ctx`'s fiber.\n */\nexport function followHostCommand(ctx: Context, name: string, ran: (sessionId: string) => void): () => void {\n return ctx.on('command/executed', (sessionId, executed) => {\n if (executed === name) ran(sessionId)\n })\n}\n","import { createSnapshotStore, type ObservableSnapshot, type SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nimport type { SelectionStore, SelectionState, WriteResult } from './section.ts'\nimport type { SelectionChange, SelectionView } from '../shared/selection.ts'\n\n/** Capability callers keep their option type; the shared UI consumes SelectionStore. */\nexport interface CapabilitySelectionUpdate<V extends SelectionView> {\n readonly connectionId?: string | null\n readonly options?: Readonly<Partial<V['selection']['options']>>\n}\n\nexport interface SelectionRemote<V extends SelectionView> {\n get(request: { sessionId: string }): Promise<RemoteResult<V>>\n set(request: SelectionChange<V['selection']['options']>): Promise<RemoteResult<V>>\n}\n\ninterface Entry<V extends SelectionView> {\n readonly sessionId: string\n readonly store: SnapshotStore<SelectionState<V>>\n readonly source: ObservableSnapshot<SelectionState<V>>\n observers: number\n /** Whether the stored view may be outdated. */\n stale: boolean\n /** Session model the view was read for. */\n modelKey: string | undefined\n /** Bumped by every event that outdates an in-flight read. */\n epoch: number\n reading: Promise<void> | undefined\n}\n\nexport class ConnectionSelectionStore<V extends SelectionView> implements SelectionStore<V> {\n private readonly entries = new Map<string, Entry<V>>()\n\n constructor(private readonly remote: SelectionRemote<V>, private readonly changed: () => void = () => {}) {}\n\n /** Stable observable of one session; the renderer caches its hook binding per source. */\n source(sessionId: string): ObservableSnapshot<SelectionState<V>> {\n return this.entry(sessionId).source\n }\n\n /**\n * Make sure the session's view is current, reading only when it is missing,\n * outdated, or was read for another session model.\n */\n load(sessionId: string, modelKey?: string): Promise<void> {\n const entry = this.entry(sessionId)\n if (modelKey !== undefined && modelKey !== entry.modelKey) {\n entry.modelKey = modelKey\n this.outdate(entry)\n }\n return entry.stale ? this.read(entry) : entry.reading ?? Promise.resolve()\n }\n\n /** Read the session again, joining a read already in flight. */\n refresh(sessionId: string): Promise<void> {\n return this.read(this.entry(sessionId))\n }\n\n /** The latest view of a session after making sure it is current. */\n async current(sessionId: string): Promise<SelectionState<V>> {\n await this.refresh(sessionId)\n return this.entry(sessionId).store.getSnapshot()\n }\n\n /**\n * Write a change against the revision the views show. The confirmed view\n * replaces the stored one; a refused write rereads so every view shows what\n * the Host holds now.\n */\n async set(sessionId: string, update: CapabilitySelectionUpdate<V>): Promise<WriteResult> {\n const entry = this.entry(sessionId)\n const { view } = entry.store.getSnapshot()\n if (view === undefined) throw new Error('connection selection has not been read yet')\n this.outdate(entry)\n const writeEpoch = entry.epoch\n let invalidated = false\n this.publish(entry, { saving: true })\n let result: Awaited<ReturnType<SelectionRemote<V>['set']>>\n try {\n result = await this.remote.set({ sessionId, ...update, expectedRevision: view.selection.revision })\n } finally {\n // Settings/model changes during a write still require a newer read.\n invalidated = entry.epoch !== writeEpoch\n this.outdate(entry)\n this.publish(entry, { saving: false })\n }\n if (result.ok) {\n entry.stale = invalidated\n this.publish(entry, { view: result.value, saving: false, readFailure: undefined })\n if (invalidated) await this.read(entry)\n this.changed()\n return { ok: true }\n }\n this.publish(entry, { saving: false })\n await this.read(entry)\n return result\n }\n\n /**\n * Settings, credentials, or the Host connection changed: observed sessions\n * read again, the others read on their next load.\n */\n invalidate(): void {\n for (const entry of this.entries.values()) this.reread(entry)\n }\n\n /**\n * The Session's selection changed without this store (its Host command ran):\n * its views read again, at once when observed, otherwise on their next load.\n * A read already in flight reads once more.\n */\n invalidateSession(sessionId: string): void {\n const entry = this.entries.get(sessionId)\n if (entry !== undefined) this.reread(entry)\n }\n\n private entry(sessionId: string): Entry<V> {\n const existing = this.entries.get(sessionId)\n if (existing !== undefined) return existing\n const store = createSnapshotStore<SelectionState<V>>({ view: undefined, saving: false, readFailure: undefined })\n const entry: Entry<V> = {\n sessionId, store, observers: 0, stale: true, modelKey: undefined, epoch: 0, reading: undefined,\n source: {\n getSnapshot: () => store.getSnapshot(),\n subscribe: (listener) => {\n entry.observers += 1\n const unsubscribe = store.subscribe(listener)\n return () => {\n entry.observers -= 1\n unsubscribe()\n }\n },\n },\n }\n this.entries.set(sessionId, entry)\n return entry\n }\n\n private reread(entry: Entry<V>): void {\n this.outdate(entry)\n if (entry.observers > 0) void this.read(entry)\n }\n\n private outdate(entry: Entry<V>): void {\n entry.stale = true\n entry.epoch += 1\n }\n\n private read(entry: Entry<V>): Promise<void> {\n entry.reading ??= this.fetch(entry).finally(() => { entry.reading = undefined })\n return entry.reading\n }\n\n /** Read until a result arrives that nothing outdated while it was in flight. */\n private async fetch(entry: Entry<V>): Promise<void> {\n for (;;) {\n const epoch = entry.epoch\n const result = await this.remote.get({ sessionId: entry.sessionId })\n if (epoch !== entry.epoch) continue\n entry.stale = false\n if (result.ok) {\n this.publish(entry, { view: result.value, readFailure: undefined })\n } else {\n const readFailure = result.error.code.endsWith('/invalid-settings') ? 'invalid-settings' : 'failed'\n this.publish(entry, { readFailure })\n }\n return\n }\n }\n\n private publish(entry: Entry<V>, patch: Partial<SelectionState<V>>): void {\n entry.store.set({ ...entry.store.getSnapshot(), ...patch })\n }\n}\n","import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ConfigForm, ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { RouteStore } from './section.ts'\nimport { routeOf, type Route } from '../shared/route.ts'\nimport type { ProviderView } from '../shared/selection.ts'\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nexport interface ProviderRemote { provider(request: Record<string, never>): Promise<RemoteResult<ProviderView>> }\n\nexport type WebSelection = Readonly<Record<string, unknown>>\nexport function clientRoute(web: ConfigFormSnapshot<WebSelection>, host: ProviderView | undefined, field: string): Route {\n if (host === undefined || web.status !== 'ready') return { kind: 'unknown' }\n return routeOf(web.value, field, host.envProvider, host.providerId)\n}\n\nexport class RouteStatus implements RouteStore {\n readonly source: ObservableSnapshot<Route>\n private readonly store = createSnapshotStore<Route>({ kind: 'unknown' })\n private host: ProviderView | undefined\n private reader: ProviderRemote | undefined\n private observers = 0\n private unwatch: (() => void) | undefined\n private epoch = 0\n\n constructor(private readonly web: ConfigForm<WebSelection>, private readonly field: string) {\n this.source = {\n getSnapshot: () => this.store.getSnapshot(),\n subscribe: listener => {\n const unsubscribe = this.store.subscribe(listener)\n this.observers += 1\n if (this.observers === 1) {\n this.unwatch = web.subscribe(() => { this.publish() })\n this.publish()\n this.refresh()\n }\n return () => {\n this.observers -= 1\n if (this.observers === 0) {\n if (this.unwatch !== undefined) this.unwatch()\n this.unwatch = undefined\n this.epoch += 1\n }\n unsubscribe()\n }\n },\n }\n }\n\n attach(reader: ProviderRemote): () => void {\n this.reader = reader\n this.refresh()\n return () => {\n if (this.reader !== reader) return\n this.reader = undefined\n this.host = undefined\n this.epoch += 1\n this.publish()\n }\n }\n\n refresh(): void {\n const reader = this.reader\n if (reader === undefined || this.observers === 0) return\n const epoch = ++this.epoch\n void reader.provider({}).then(result => {\n if (epoch !== this.epoch) return\n this.host = result.ok ? result.value : undefined\n this.publish()\n })\n }\n\n /** Publish only a changed route: observers re-render per publish, and some subscribe inside render. */\n private publish(): void {\n const next = clientRoute(this.web.getSnapshot(), this.host, this.field)\n if (!sameRoute(this.store.getSnapshot(), next)) this.store.set(next)\n }\n}\n\nfunction sameRoute(a: Route, b: Route): boolean {\n if (a.kind !== b.kind) return false\n switch (a.kind) {\n case 'unknown': return true\n case 'this': return true\n case 'auto': return a.providerId === (b as typeof a).providerId\n case 'other': return a.provider === (b as typeof a).provider && a.providerId === (b as typeof a).providerId\n }\n}\n","import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nimport type { Pairing, PairingsView } from '../shared/selection.ts'\n\nexport type PairingsState =\n | { readonly state: 'loading' }\n | { readonly state: 'ready'; readonly pairings: Pairing[] }\n | { readonly state: 'failed'; readonly message: string }\n\nexport interface PairingsRemote {\n pairings(request: Record<string, never>): Promise<RemoteResult<PairingsView>>\n forgetPairing(request: { provider: string; model: string }): Promise<RemoteResult<PairingsView>>\n}\n\nexport class PairingsStatus {\n readonly source: ObservableSnapshot<PairingsState>\n private readonly store = createSnapshotStore<PairingsState>({ state: 'loading' })\n private observers = 0\n private epoch = 0\n\n constructor(private readonly remote: PairingsRemote, private readonly forgetFailureText: () => string) {\n this.source = {\n getSnapshot: () => this.store.getSnapshot(),\n subscribe: listener => {\n const unsubscribe = this.store.subscribe(listener)\n this.observers += 1\n if (this.observers === 1) void this.refresh()\n return () => {\n this.observers -= 1\n if (this.observers === 0) this.epoch += 1\n unsubscribe()\n }\n },\n }\n }\n\n invalidate(): void {\n this.epoch += 1\n this.store.set({ state: 'loading' })\n if (this.observers > 0) void this.refresh()\n }\n\n async refresh(): Promise<void> {\n const epoch = ++this.epoch\n this.store.set({ state: 'loading' })\n const result = await this.remote.pairings({})\n if (epoch !== this.epoch) return\n this.store.set(result.ok ? { state: 'ready', pairings: result.value.pairings } : { state: 'failed', message: result.error.message })\n }\n\n async forget(provider: string, model: string): Promise<void> {\n const result = await this.remote.forgetPairing({ provider, model })\n if (!result.ok) throw new Error(this.forgetFailureText())\n await this.refresh()\n }\n}\n","import type { CredentialInfo, RemoteResult } from '@deepseek-ai/dsh-api-remotes/client'\nimport { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nexport type CredentialStatusMap = Readonly<Record<string, 'configured' | 'missing' | 'unknown'>>\n\nexport interface CredentialDescriber {\n describe(refs: string[]): Promise<RemoteResult<Record<string, CredentialInfo>>>\n}\n\nexport class CredentialStatus<S> {\n readonly source: ObservableSnapshot<CredentialStatusMap>\n private readonly store = createSnapshotStore<CredentialStatusMap>({})\n private observers = 0\n private epoch = 0\n\n constructor(private readonly settings: () => S | undefined, private readonly credentials: CredentialDescriber, private readonly refs: (settings: S) => Iterable<string>) {\n this.source = {\n getSnapshot: () => this.store.getSnapshot(),\n subscribe: listener => {\n const unsubscribe = this.store.subscribe(listener)\n this.observers += 1\n if (this.observers === 1) this.refresh()\n return () => {\n this.observers -= 1\n if (this.observers === 0) this.epoch += 1\n unsubscribe()\n }\n },\n }\n }\n\n refresh(): void {\n if (this.observers === 0) return\n const epoch = ++this.epoch\n const settings = this.settings()\n if (settings === undefined) {\n this.store.set({})\n return\n }\n const refs = new Set(this.refs(settings))\n void this.credentials.describe([...refs]).then(result => {\n if (epoch !== this.epoch) return\n const states: Record<string, 'configured' | 'missing' | 'unknown'> = {}\n for (const ref of refs) {\n const info = result.ok ? result.value[ref] : undefined\n states[ref] = info === undefined ? 'unknown' : info.configured ? 'configured' : 'missing'\n }\n this.store.set(states)\n })\n }\n}\n","/**\n * Sparse settings writes. The catalog supplies every default, so a write\n * stores only what differs from the inherited (composition) layer, and\n * returning a value to its inherited state removes the user entry instead of\n * materializing it.\n */\nimport type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client'\nimport { documentVersion as inspectDocumentVersion, type DocumentVersion } from '../../shared/settings.ts'\nexport type { DocumentVersion } from '../../shared/settings.ts'\n\n\n/** The two layers of a ConfigForm snapshot. */\nexport interface SettingsLayers {\n readonly base?: unknown\n readonly user?: unknown\n}\n\ntype Settable = Extract<SettingsPathOpView, { op: 'set' }>['value']\ntype Json = Record<string, unknown>\n\nconst objectOf = (value: unknown): Json =>\n value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Json : {}\n\nconst isObject = (value: unknown): value is Json => value !== null && typeof value === 'object' && !Array.isArray(value)\n\nfunction equal(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true\n if (Array.isArray(a) || Array.isArray(b)) {\n return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((value, index) => equal(value, b[index]))\n }\n if (!isObject(a) || !isObject(b)) return false\n const keys = Object.keys(a)\n return keys.length === Object.keys(b).length && keys.every(key => Object.hasOwn(b, key) && equal(a[key], b[key]))\n}\n\n/** Remove what an object value shares with its inherited counterpart, key by key. */\nfunction delta(value: unknown, inherited: unknown): unknown {\n if (equal(value, inherited)) return undefined\n if (!isObject(value)) return value\n const base = objectOf(inherited)\n return Object.fromEntries(Object.entries(value)\n .map(([key, child]) => [key, delta(child, base[key])] as const)\n .filter(([, child]) => child !== undefined))\n}\n\nfunction documentVersion(layers: SettingsLayers): DocumentVersion {\n return inspectDocumentVersion({ ...objectOf(layers.base), ...objectOf(layers.user) })\n}\n\nfunction assertCurrentVersion(layers: SettingsLayers): void {\n const state = documentVersion(layers)\n if (state.kind !== 'current') throw new Error('settings document version is ' + state.kind)\n}\n\n/**\n * Operations that make `path` hold `target`, touching only that path.\n * @param fallback - the catalog default used when the base layer has no value.\n * @param target - the desired effective value; undefined returns the path to its inherited value.\n */\nfunction sparseSettingOperations(spec: SparseSettingsSpec, layers: SettingsLayers, path: readonly string[], target: unknown, fallback?: unknown): SettingsPathOpView[] {\n assertCurrentVersion(layers)\n const inherited = valueAt(layers.base, path) ?? fallback\n const user = valueAt(layers.user, path)\n const ops: SettingsPathOpView[] = []\n if (target === undefined || equal(target, inherited)) {\n if (user !== undefined) ops.push({ op: 'unset', path: prunedPath(layers.user, path) })\n } else {\n const sparse = delta(target, inherited)\n if (!equal(sparse, user)) ops.push({ op: 'set', path: [...path], value: sparse as Settable })\n }\n if (ops.some(op => op.op === 'set') && objectOf(layers.user).version !== spec.version) {\n ops.push({ op: 'set', path: ['version'], value: spec.version })\n }\n return ops\n}\n\nfunction valueAt(root: unknown, path: readonly string[]): unknown {\n return path.reduce<unknown>((value, key) => objectOf(value)[key], root)\n}\n\n/**\n * The path to unset so no empty object stays behind: removing the only key of\n * a user-layer object removes that object instead, up to a top-level field.\n */\nfunction prunedPath(user: unknown, path: readonly string[]): string[] {\n let end = path.length\n while (end > 1 && Object.keys(objectOf(valueAt(user, path.slice(0, end - 1)))).length === 1) end -= 1\n return path.slice(0, end)\n}\n\n\n\n/** Unset every field this plugin stores in the user layer; inherited values and credentials stay. */\nfunction resetSettingsOperations(layers: SettingsLayers): SettingsPathOpView[] {\n return Object.keys(objectOf(layers.user)).map(key => ({ op: 'unset', path: [key] }))\n}\n\nexport interface SparseSettingsSpec {\n readonly version: number\n readonly fields: readonly string[]\n}\n\n/** Bind the current document version and fields; no predecessor schema is inferred. */\nexport function createSparseSettings(spec: SparseSettingsSpec) {\n return {\n documentVersion: (layers: SettingsLayers) => documentVersion(layers),\n sparseSettingOperations: (layers: SettingsLayers, path: readonly string[], target: unknown, fallback?: unknown) => sparseSettingOperations(spec, layers, path, target, fallback),\n resetSettingsOperations: (layers: SettingsLayers) => resetSettingsOperations(layers),\n }\n}\nexport type SparseSettings = ReturnType<typeof createSparseSettings>\n","/** Write-only key entry: the value goes to DSH Credentials and never into settings. */\nimport { useId, useState } from 'react'\nimport { Button, Input, Tag } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { CredentialStatusMap } from '../credentials.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses } from './parts.tsx'\n\n\nexport type SaveCredential = (ref: string, value: string) => Promise<void>\n\ntype Outcome = { readonly kind: 'saved' } | { readonly kind: 'failed'; readonly message: string } | undefined\n\nexport type CredentialCopyKey = \"credential.label\" | \"credential.set\" | \"credential.unset\" | \"credential.placeholder\" | \"saving\" | \"credential.save\" | \"credential.saved\" | \"credential.failed\" | \"credential.hint\"\nexport function createCredentialEditor<K extends string>({ classes: css, keys }: {\n classes: SettingsClasses\n keys: Readonly<Record<CredentialCopyKey, K>>\n}) {\n function CredentialEditor({ credentialRef, status, save, t }: {\n credentialRef: string\n status: CredentialStatusMap[string] | undefined\n save: SaveCredential\n t: ClientTranslate<K>\n }) {\n const id = useId()\n const [value, setValue] = useState('')\n const [busy, setBusy] = useState(false)\n const [outcome, setOutcome] = useState<Outcome>(undefined)\n \n const submit = async (): Promise<void> => {\n const trimmed = value.trim()\n if (!trimmed) return\n setBusy(true)\n setOutcome(undefined)\n try {\n await save(credentialRef, trimmed)\n setValue('')\n setOutcome({ kind: 'saved' })\n } catch (error) {\n setOutcome({ kind: 'failed', message: error instanceof Error ? error.message : String(error) })\n } finally {\n setBusy(false)\n }\n }\n \n const isConfigured = status === 'configured'\n const isMissing = status === 'missing'\n \n return (\n <div className={css.formField}>\n <div className={css.fieldHead}>\n <label className={css.fieldLabel} htmlFor={id}>{t(keys['credential.label'])}</label>\n {isConfigured ? <Tag tone=\"success\">{t(keys['credential.set'])}</Tag> : null}\n {isMissing ? <Tag tone=\"warning\">{t(keys['credential.unset'])}</Tag> : null}\n </div>\n <div className={css.inline}>\n <Input\n id={id}\n className={css.input as string}\n type=\"password\"\n value={value}\n disabled={busy}\n placeholder={t(keys['credential.placeholder'])}\n autoComplete=\"off\"\n spellCheck={false}\n aria-label={t(keys['credential.label'])}\n onChange={event => { setValue(event.target.value) }}\n onKeyDown={event => {\n if (event.key === 'Enter' && !event.nativeEvent.isComposing) {\n event.preventDefault()\n void submit()\n }\n }}\n />\n <Button\n variant=\"outline\"\n size=\"md\"\n disabled={busy || value.trim() === ''}\n onClick={() => { void submit() }}\n >\n {busy ? t(keys['saving']) : t(keys['credential.save'])}\n </Button>\n </div>\n {outcome?.kind === 'saved' ? <p className={css.success} role=\"status\">{t(keys['credential.saved'])}</p> : null}\n {outcome?.kind === 'failed' ? <p className={css.error} role=\"alert\">{outcome.message || t(keys['credential.failed'])}</p> : null}\n <p className={css.hint}>{t(keys['credential.hint'], { ref: credentialRef })}</p>\n </div>\n )\n }\n return CredentialEditor\n}\nexport type CredentialEditorComponent<K extends string> = ReturnType<typeof createCredentialEditor<K>>\n","import { isEndpoint } from '../../shared/url.ts'\nimport type { ClientTranslate } from '../command.ts'\n\n/** One optional request option as the forms show it; empty text means the default. */\nexport interface OptionField<K extends string = string> {\n readonly name: string\n readonly label: K\n readonly kind: 'text' | 'url' | 'integer' | 'boolean' | 'enum' | 'list'\n /** Accepted enum values on this route. */\n readonly values: readonly string[]\n /** What a text value, or each item of a list, must match. */\n readonly pattern?: RegExp\n readonly min?: number\n readonly max?: number\n /** Most items a list holds. */\n readonly maxItems?: number\n /** Options that may not be set together with this one (catalog `exclusive`). */\n readonly exclusive?: readonly string[]\n /** Localized example or the default value. */\n readonly placeholder: (t: ClientTranslate<K>) => string | undefined\n /** A note below the field, such as what a special value means or a unit conversion. */\n readonly hint?: K\n}\n\n/**\n * A titled subset of an entry's options, such as those some model protocols\n * apply; derived from catalog data (`protocolGroups`).\n */\nexport interface OptionGroup {\n readonly title: string\n readonly options: readonly string[]\n}\n\n/** Editor text per field name. */\nexport type FieldTexts = Readonly<Record<string, string>>\n\n/** Editor text of a stored value; empty means the default. A list is one item per line. */\nexport const fieldText = (value: unknown): string => {\n if (value === undefined || value === null) return ''\n if (typeof value === 'string') return value\n if (Array.isArray(value) && value.every(item => typeof item === 'string')) return value.join('\\n')\n if (typeof value === 'number' || typeof value === 'boolean') return `${value}`\n return JSON.stringify(value)\n}\n\n/** The items of list text: one per line, blank lines ignored. */\nfunction listLines(text: string): { readonly line: number; readonly item: string }[] {\n return text.split('\\n').map((raw, index) => ({ line: index + 1, item: raw.trim() })).filter(entry => entry.item !== '')\n}\n\n/** What is wrong with list text: the first line that does not match, or too many items. */\nexport type ListProblem = { readonly kind: 'line'; readonly line: number; readonly item: string } | { readonly kind: 'count'; readonly max: number }\n\nexport function listProblem<K extends string>(field: OptionField<K>, text: string): ListProblem | undefined {\n const lines = listLines(text)\n const bad = lines.find(entry => field.pattern !== undefined && !field.pattern.test(entry.item))\n if (bad !== undefined) return { kind: 'line', line: bad.line, item: bad.item }\n if (field.maxItems !== undefined && lines.length > field.maxItems) return { kind: 'count', max: field.maxItems }\n return undefined\n}\n\n/** Whether editor text is acceptable; empty always is. */\nexport function isValidText<K extends string>(field: OptionField<K>, text: string): boolean {\n if (text === '') return true\n switch (field.kind) {\n case 'list': return listProblem(field, text) === undefined\n case 'enum': return field.values.includes(text)\n case 'boolean': return text === 'true' || text === 'false'\n case 'integer': {\n // Canonical decimal text only: no leading zeros, no \"-0\", no exponent.\n if (!/^(?:0|-?[1-9]\\d{0,15})$/u.test(text)) return false\n const num = Number(text)\n if (!Number.isSafeInteger(num)) return false\n if (field.min !== undefined && num < field.min) return false\n if (field.max !== undefined && num > field.max) return false\n return true\n }\n case 'url': return isEndpoint(text)\n case 'text': return field.pattern === undefined || field.pattern.test(text)\n }\n}\n\n/** The first other field with a value that this one, when it has a value too, may not be set with. */\nexport function conflictOf<K extends string>(field: OptionField<K>, fields: readonly OptionField<K>[], texts: FieldTexts): OptionField<K> | undefined {\n const exclusive = field.exclusive\n if (exclusive === undefined || !isSet(field, texts)) return undefined\n return fields.find(other => exclusive.includes(other.name) && isSet(other, texts))\n}\n\nfunction isSet<K extends string>(field: OptionField<K>, texts: FieldTexts): boolean {\n const text = Object.hasOwn(texts, field.name) ? texts[field.name]! : ''\n return fieldValue(field, text) !== undefined\n}\n\n/** Stored value of valid editor text; undefined returns the option to its default. */\nexport function fieldValue<K extends string>(field: OptionField<K>, text: string): unknown {\n if (text === '') return undefined\n switch (field.kind) {\n case 'boolean': return text === 'true'\n case 'integer': return Number(text)\n case 'list': {\n const items = listLines(text).map(entry => entry.item)\n return items.length === 0 ? undefined : items\n }\n default: return text\n }\n}\n\n/** Options with every field's text applied; empty text removes the option. Other keys stay. */\nexport function applyFields<K extends string>(fields: readonly OptionField<K>[], texts: FieldTexts, stored: Readonly<Record<string, unknown>>): Record<string, unknown> {\n const next: Record<string, unknown> = { ...stored }\n for (const field of fields) {\n const value = fieldValue(field, texts[field.name] ?? fieldText(stored[field.name]))\n if (value === undefined) delete next[field.name]\n else next[field.name] = value\n }\n return next\n}\n","/** Optional request options: labelled inputs over editor text, and a self-saving form around them. */\nimport { useState, type KeyboardEvent } from 'react'\nimport { Input } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ClientTranslate } from '../command.ts'\nimport { conflictOf, fieldText, fieldValue, isValidText, listProblem, type OptionField, type OptionGroup, type FieldTexts } from './fields.ts'\nimport { classNames, type SettingsClasses, type SettingsParts } from './parts.tsx'\n\n/**\n * `options.invalidItem` names a refused list line (`{line}`, `{item}`);\n * `options.invalidLine` is kept for dictionaries that still carry it;\n * `options.exclusive` names the option (`{other}`) that may not be set too.\n */\nexport type OptionsCopyKey = 'options.default' | 'options.invalid' | 'options.invalidLine' | 'options.invalidItem' | 'options.tooMany' | 'options.exclusive' | 'options.on' | 'options.off'\n\n/** How much of a refused list item the error quotes. */\nconst QUOTED_ITEM = 40\n\nexport type { OptionGroup } from './fields.ts'\n\nexport function createOptionsEditor<K extends string>({ classes: css, keys, parts: { SelectMenu }, valueLabel }: {\n classes: SettingsClasses\n keys: Readonly<Record<OptionsCopyKey, K>>\n parts: SettingsParts<K>\n valueLabel: (value: string, t: ClientTranslate<K>) => string\n}) {\n /**\n * A grid of option inputs; empty text means the default. \\`onSettle\\` marks\n * a finished edit: a choice from a menu at once, typed text on blur or Enter\n * (a list, typed one item per line, on blur). With \\`groups\\`, options outside\n * every group come first, then each group under its title. Two options the\n * catalog declares exclusive are both marked while both have a value.\n */\n function OptionFields({ id, fields, groups, texts, disabled, onEdit, onSettle, t }: {\n id: string\n fields: readonly OptionField<K>[]\n groups?: readonly OptionGroup[] | undefined\n texts: FieldTexts\n disabled: boolean\n onEdit: (name: string, text: string) => void\n onSettle?: (name: string, text: string) => void\n t: ClientTranslate<K>\n }) {\n const grid = (subset: readonly OptionField<K>[]) => (\n <div className={css.optionGrid}>\n {subset.map(field => (\n <OptionInput\n key={field.name}\n id={id + '-' + field.name}\n field={field}\n text={texts[field.name] ?? ''}\n conflict={conflictOf(field, fields, texts)}\n disabled={disabled}\n t={t}\n onEdit={text => onEdit(field.name, text)}\n onSettle={text => onSettle?.(field.name, text)}\n />\n ))}\n </div>\n )\n if (groups === undefined) return grid(fields)\n const grouped = new Set(groups.flatMap(group => group.options))\n const loose = fields.filter(field => !grouped.has(field.name))\n return (\n <>\n {loose.length === 0 ? null : grid(loose)}\n {groups.map(group => {\n const subset = group.options.flatMap(name => fields.filter(field => field.name === name))\n if (subset.length === 0) return null\n return (\n <div key={group.title} className={css.optionGroup} role=\"group\" aria-label={group.title}>\n <span className={css.optionGroupTitle}>{group.title}</span>\n {grid(subset)}\n </div>\n )\n })}\n </>\n )\n }\n\n /** Why the text is refused: a list names its first bad line or its item limit; a valid value names the option it conflicts with. */\n function problemText(field: OptionField<K>, text: string, conflict: OptionField<K> | undefined, t: ClientTranslate<K>): string | undefined {\n if (isValidText(field, text)) return conflict === undefined ? undefined : t(keys['options.exclusive'], { other: t(conflict.label) })\n if (field.kind !== 'list') return t(keys['options.invalid'])\n const problem = listProblem(field, text)\n if (problem === undefined) return t(keys['options.invalid'])\n if (problem.kind === 'count') return t(keys['options.tooMany'], { max: problem.max })\n const chars = Array.from(problem.item)\n const item = chars.length > QUOTED_ITEM ? chars.slice(0, QUOTED_ITEM).join('') + '…' : problem.item\n return t(keys['options.invalidItem'], { line: problem.line, item })\n }\n\n function OptionInput({ id, field, text, conflict, disabled, onEdit, onSettle, t }: {\n id: string\n field: OptionField<K>\n text: string\n /** The option this one may not be set together with, while both have a value. */\n conflict: OptionField<K> | undefined\n disabled: boolean\n onEdit: (text: string) => void\n onSettle: (text: string) => void\n t: ClientTranslate<K>\n }) {\n const label = t(field.label)\n const hintId = id + '-hint'\n const errorId = id + '-error'\n const hint = field.hint === undefined ? null : <span className={css.hint} id={hintId}>{t(field.hint)}</span>\n const problem = problemText(field, text, conflict, t)\n const error = problem === undefined ? null : <span className={css.fieldError} id={errorId}>{problem}</span>\n // The error, then the hint: what is wrong is read before what the field is for.\n const describedBy = [problem === undefined ? undefined : errorId, hint === null ? undefined : hintId].filter(part => part !== undefined).join(' ')\n const description = describedBy === '' ? undefined : describedBy\n\n if (field.kind === 'list') {\n return (\n <div className={classNames(css.option, css.optionWide)}>\n <label className={css.optionName} htmlFor={id}>{label}</label>\n <textarea\n id={id}\n className={css.textarea}\n rows={3}\n value={text}\n disabled={disabled}\n aria-invalid={problem !== undefined}\n aria-describedby={description}\n spellCheck={false}\n title={field.name}\n placeholder={field.placeholder(t) ?? t(keys['options.default'])}\n onChange={event => { onEdit(event.target.value.trim() === '' ? '' : event.target.value) }}\n onBlur={() => { onSettle(text) }}\n />\n {error}\n {hint}\n </div>\n )\n }\n\n if (field.kind === 'text' || field.kind === 'url' || field.kind === 'integer') {\n const settleOnEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter' || event.nativeEvent.isComposing) return\n event.preventDefault()\n onSettle(text)\n }\n return (\n <div className={css.option}>\n <label className={css.optionName} htmlFor={id}>{label}</label>\n <Input\n id={id}\n className={css.input as string}\n type={field.kind === 'url' ? 'url' : 'text'}\n value={text}\n disabled={disabled}\n aria-invalid={problem !== undefined}\n aria-describedby={description}\n spellCheck={false}\n title={field.name}\n inputMode={field.kind === 'integer' ? 'numeric' : undefined}\n placeholder={field.placeholder(t) ?? t(keys['options.default'])}\n onChange={event => { onEdit(event.target.value.trim() === '' ? '' : event.target.value) }}\n onBlur={() => { onSettle(text) }}\n onKeyDown={settleOnEnter}\n />\n {error}\n {hint}\n </div>\n )\n }\n\n // Unset is the service's own default, which the catalog does not claim to know; a boolean is no exception.\n const choices = field.kind === 'boolean'\n ? [{ id: 'true', label: t(keys['options.on']) }, { id: 'false', label: t(keys['options.off']) }]\n : field.values.map(value => ({ id: value, label: valueLabel(value, t) }))\n return (\n <div className={css.option}>\n <span className={css.optionName}>{label}</span>\n <SelectMenu\n compact\n label={label}\n title={field.name}\n value={text}\n disabled={disabled}\n options={[{ id: '', label: t(keys['options.default']) }, ...choices]}\n onChange={choice => {\n onEdit(choice)\n onSettle(choice)\n }}\n />\n {error}\n {hint}\n </div>\n )\n }\n\n /**\n * Options that save themselves, one path per option: a menu choice at once,\n * typed text once it settles and is valid. An invalid draft, or one that\n * conflicts with an exclusive option, stays visible with its error and is not\n * written; once the conflict is cleared, the held draft saves too.\n */\n function OptionsForm({ id, title, hint, fields, groups, stored, disabled, onCommit, t }: {\n id: string\n title: string\n hint: string\n fields: readonly OptionField<K>[]\n groups?: readonly OptionGroup[] | undefined\n stored: Readonly<Record<string, unknown>>\n disabled: boolean\n /** Settled option changes, written atomically under one settings revision. */\n onCommit: (changes: Readonly<Record<string, unknown>>) => Promise<boolean>\n t: ClientTranslate<K>\n }) {\n const [drafts, setDrafts] = useState<Record<string, string>>({})\n if (fields.length === 0) return null\n const texts: FieldTexts = Object.fromEntries(fields.map(field => [field.name, drafts[field.name] ?? fieldText(stored[field.name])]))\n\n const settle = async (name: string, text: string): Promise<void> => {\n const field = fields.find(candidate => candidate.name === name)\n if (!field) return\n const current = { ...texts, [name]: text }\n const valid = (candidate: OptionField<K>) => isValidText(candidate, current[candidate.name]!) && conflictOf(candidate, fields, current) === undefined\n if (!valid(field)) return\n // Clearing one option can release a held draft. Validate and write both\n // together, never through successive writes using the same old revision.\n const released = fields.filter(candidate => field.exclusive?.includes(candidate.name) && Object.hasOwn(drafts, candidate.name) && valid(candidate))\n const settled = [field, ...released]\n const changes = Object.fromEntries(settled\n .map(candidate => [candidate.name, fieldValue(candidate, current[candidate.name]!)] as const)\n .filter(([option, value]) => fieldText(value) !== fieldText(stored[option])))\n if (Object.keys(changes).length > 0 && !await onCommit(changes)) return\n const names = new Set(settled.map(candidate => candidate.name))\n setDrafts(previous => Object.fromEntries(Object.entries(previous).filter(([option]) => !names.has(option))))\n }\n return (\n <div className={css.field}>\n <div className={css.fieldHead}><span className={css.fieldLabel}>{title}</span></div>\n <OptionFields\n id={id}\n fields={fields}\n groups={groups}\n texts={texts}\n disabled={disabled}\n t={t}\n onEdit={(name, text) => { setDrafts(current => ({ ...current, [name]: text })) }}\n onSettle={(name, text) => { void settle(name, text) }}\n />\n <p className={css.hint}>{hint}</p>\n </div>\n )\n }\n return { OptionFields, OptionsForm }\n}\nexport type OptionsEditor<K extends string> = ReturnType<typeof createOptionsEditor<K>>\n","/**\n * Read-only facts a settings page derives from a validated document and its\n * capability's catalog. Everything is keyed by the catalog, so a new catalog\n * entry appears on the page without page code naming it.\n */\nimport { builtinId, builtinKey, CUSTOM_CONNECTION_ID, type AccessMode, type Descriptor, type ExclusiveOptions, type OptionRule, type ProtocolDescriptor } from '../../shared/connections.ts'\nimport { singleLine, type BuiltinOverride, type CustomConnection, type SettingsDescriptor } from '../../shared/settings.ts'\nexport type { CustomConnection, CustomAdapterConnection, CustomModelConnection } from '../../shared/settings.ts'\nimport type { OptionField, OptionGroup } from './fields.ts'\n\n/** A capability catalog; key order is display order. */\nexport type SettingsCatalog = Readonly<Record<string, SettingsDescriptor>>\n\n/** Catalog keys of adapter entries: the formats a custom connection can use. */\nexport type AdapterKeyOf<T extends SettingsCatalog> = { [Key in keyof T]: T[Key]['kind'] extends 'adapter' ? Key : never }[keyof T] & string\n\n/** The document fields these helpers read; both capability documents have them. */\nexport interface CatalogSettings {\n readonly defaultConnection?: string | undefined\n readonly connections?: Readonly<Record<string, unknown>> | undefined\n}\n\nexport interface Choice { readonly id: string; readonly label: string }\n\n/** Locale keys for one option: its label, an optional placeholder and an optional hint shown below the field. */\nexport interface OptionCopy<K extends string> { readonly label: K; readonly placeholder?: K; readonly hint?: K }\n\n/** A plugin's copy for the options of one catalog entry. */\nexport interface OptionCopyTable<K extends string> {\n readonly options: Readonly<Partial<Record<string, OptionCopy<K>>>>\n /** Label of an option that has no copy of its own yet. */\n readonly fallback: K\n}\n\n/** The entry of a key taken from the same catalog. */\nexport function catalogEntry<T extends SettingsCatalog>(catalog: T, key: keyof T & string): SettingsDescriptor {\n const info = catalog[key]\n if (info === undefined) throw new Error('unknown catalog key ' + key)\n return info\n}\n\nexport function adapterKeys<T extends SettingsCatalog>(catalog: T): AdapterKeyOf<T>[] {\n return Object.entries(catalog).filter(([, info]) => info.kind === 'adapter').map(([key]) => key as AdapterKeyOf<T>)\n}\n\n/** A built-in entry's override as stored, its label on one line as the grammar reads it. */\nexport function builtinOverride(config: CatalogSettings, key: string): BuiltinOverride {\n const stored = config.connections === undefined ? undefined : config.connections[builtinId(key)] as BuiltinOverride | undefined\n if (stored === undefined) return {}\n return stored.label === undefined ? stored : { ...stored, label: singleLine(stored.label) }\n}\n\n/** Custom connections in document order, labels on one line; the document has passed the capability's validation. */\nexport function customConnections<A extends string = string, P extends string = string>(config: CatalogSettings): [string, CustomConnection<A, P>][] {\n if (config.connections === undefined) return []\n return Object.entries(config.connections)\n .filter(([id]) => CUSTOM_CONNECTION_ID.test(id))\n .map(([id, stored]) => {\n const connection = stored as CustomConnection<A, P>\n return [id, { ...connection, label: singleLine(connection.label) }]\n })\n}\n\n/**\n * The access an operator configures for a built-in entry: one of its routes,\n * or `none` when the catalog offers neither a keyless nor an API-key route\n * (the entry takes its route and credentials from the Session model).\n */\nexport type BuiltinAccess = AccessMode | 'none'\n\n/** Built-in connections default to the anonymous route where one exists. */\nexport function builtinAccess(info: Descriptor, override: BuiltinOverride): BuiltinAccess {\n if (info.access.keyless) return override.access ?? 'keyless'\n return info.access.apiKey ? 'api-key' : 'none'\n}\n\n/** The credential a built-in connection resolves on its API-key route, and the catalog's name for it. */\nexport interface BuiltinCredential {\n readonly ref: string\n readonly catalogRef: string\n}\n\n/** Undefined for an entry without an API-key route. */\nexport function builtinCredential(info: Descriptor, override: BuiltinOverride): BuiltinCredential | undefined {\n if (!info.access.apiKey) return undefined\n const catalogRef = info.access.apiKey.credentialRef\n return { ref: override.credentialRef ?? catalogRef, catalogRef }\n}\n\n/** Every credential the page reports on: each catalog entry with API-key access and every custom connection. */\nexport function credentialRefs(catalog: SettingsCatalog, config: CatalogSettings): string[] {\n const builtin = Object.entries(catalog).flatMap(([key, info]) => {\n const credential = builtinCredential(info, builtinOverride(config, key))\n return credential === undefined ? [] : [credential.ref]\n })\n const custom = customConnections(config).map(([, connection]) => connection.credentialRef)\n return [...new Set([...builtin, ...custom])]\n}\n\n/** Connections a default can name: the catalog in order, then custom connections. */\nexport function connectionChoices<C extends string>(catalog: Readonly<Record<C, SettingsDescriptor>>, config: CatalogSettings, catalogLabel: (key: C) => string): Choice[] {\n return [\n ...(Object.keys(catalog) as C[]).map(key => ({ id: builtinId(key), label: builtinOverride(config, key).label ?? catalogLabel(key) })),\n ...customConnections(config).map(([id, connection]) => ({ id, label: connection.label })),\n ]\n}\n\n/** Display name of any connection id; an id that names nothing is shown as is. */\nexport function connectionName<C extends string>(catalog: Readonly<Record<C, SettingsDescriptor>>, config: CatalogSettings, id: string, catalogLabel: (key: C) => string): string {\n const key = builtinKey(id)\n if (key !== undefined && Object.hasOwn(catalog, key)) return builtinOverride(config, key).label ?? catalogLabel(key as C)\n const custom = customConnections(config).find(([candidate]) => candidate === id)\n return custom === undefined ? id : custom[1].label\n}\n\n/**\n * Editable fields for a catalog entry's option rules. The keyless route drops\n * options it rejects and narrows enums it limits; `restricted` reports either.\n * A list option is edited one item per line; a plugin editor that owns it\n * (`ExtraEditor.options`) takes it over.\n */\nexport function catalogFields<K extends string>(rules: Readonly<Record<string, OptionRule>>, access: AccessMode, copy: OptionCopyTable<K>, exclusive: readonly ExclusiveOptions[] = []): { fields: OptionField<K>[]; restricted: boolean } {\n const fields: OptionField<K>[] = []\n let restricted = false\n for (const [name, rule] of Object.entries(rules)) {\n const scope: KeylessScope = access === 'keyless' ? keylessScope(rule) : { kind: 'all' }\n if (scope.kind === 'none') {\n restricted = true\n continue\n }\n let values: readonly string[] = []\n if (rule.kind === 'enum') {\n values = scope.kind === 'values' ? scope.values : rule.values\n if (values.length < rule.values.length) restricted = true\n }\n const optionCopy = copy.options[name]\n const placeholder = optionCopy === undefined ? undefined : optionCopy.placeholder\n fields.push({\n name,\n label: optionCopy === undefined ? copy.fallback : optionCopy.label,\n kind: rule.kind,\n values,\n placeholder: t => placeholder === undefined ? undefined : t(placeholder),\n ...(optionCopy?.hint === undefined ? {} : { hint: optionCopy.hint }),\n ...(rule.kind === 'text' ? { pattern: rule.pattern } : {}),\n ...(rule.kind === 'integer' ? { min: rule.min, max: rule.max } : {}),\n ...(rule.kind === 'list' ? { pattern: rule.pattern, maxItems: rule.max } : {}),\n ...exclusiveWith(name, exclusive),\n })\n }\n return { fields, restricted }\n}\n\n/**\n * The options of several protocols, grouped by the protocols that apply them:\n * one group per distinct set, in order of first appearance, titled with those\n * protocols' labels. An entry that takes every protocol's options (one that\n * follows the Session model) shows which apply where.\n */\nexport function protocolGroups(protocols: Readonly<Record<string, ProtocolDescriptor>>): OptionGroup[] {\n const entries = Object.values(protocols)\n const groups = new Map<string, { title: string; options: string[] }>()\n for (const option of new Set(entries.flatMap(entry => Object.keys(entry.options)))) {\n const title = entries.filter(entry => Object.hasOwn(entry.options, option)).map(entry => entry.label).join(' / ')\n const group = groups.get(title)\n if (group === undefined) groups.set(title, { title, options: [option] })\n else group.options.push(option)\n }\n return [...groups.values()]\n}\n\n/** The options an option is declared exclusive with; nothing when it has none. */\nfunction exclusiveWith(name: string, exclusive: readonly ExclusiveOptions[]): { exclusive?: readonly string[] } {\n const others = exclusive.flatMap(([first, second]) => first === name ? [second] : second === name ? [first] : [])\n return others.length === 0 ? {} : { exclusive: others }\n}\n\n/** What the keyless route accepts of one option: all of it, nothing, or only some enum values. */\ntype KeylessScope = { readonly kind: 'all' } | { readonly kind: 'none' } | { readonly kind: 'values'; readonly values: readonly string[] }\n\nfunction keylessScope(rule: OptionRule): KeylessScope {\n if (rule.kind === 'list' || rule.keyless === undefined) return { kind: 'all' }\n if (rule.keyless === false) return { kind: 'none' }\n return { kind: 'values', values: rule.keyless }\n}\n\n/** Names of stored options the keyless route rejects, by the rule {@link catalogFields} applies. */\nexport function keylessRejected(rules: Readonly<Record<string, OptionRule>>, stored: Readonly<Record<string, unknown>>): string[] {\n return Object.keys(stored).filter(name => {\n const rule = Object.hasOwn(rules, name) ? rules[name] : undefined\n if (rule === undefined) return false\n const scope = keylessScope(rule)\n return scope.kind === 'none' || (scope.kind === 'values' && !scope.values.some(value => value === stored[name]))\n })\n}\n","/** Per-connection editors every built-in connection gets from its catalog facts. */\nimport { useId, useState, type KeyboardEvent } from 'react'\nimport { Input, Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { CREDENTIAL_REF } from '../../shared/connections.ts'\nimport type { BuiltinOverride } from '../../shared/settings.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport { isValidText, type OptionField } from './fields.ts'\nimport type { SettingsClasses, SettingsDoc, SettingsParts, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type ServiceFieldsCopyKey = 'credential.reference' | 'credential.referenceHint' | 'services.trust' | 'services.trustUnsaved' | 'options.invalid' | 'options.default'\n\nconst onEnter = (commit: () => void) => (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter' || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit()\n}\n\nexport function createServiceFields<K extends string>({ classes: css, keys, parts: { ErrorText, useWrite }, sparse }: {\n classes: SettingsClasses\n keys: Readonly<Record<ServiceFieldsCopyKey, K>>\n parts: SettingsParts<K>\n sparse: SparseSettings\n}) {\n interface FieldProps {\n connectionId: string\n doc: SettingsDoc\n write: WriteSettings\n disabled: boolean\n t: ClientTranslate<K>\n }\n\n /** The DSH Credentials name the API-key route resolves; empty returns to the catalog's name. */\n function CredentialRefField({ connectionId, credentialRef, catalogRef, doc, write, disabled, t }: FieldProps & {\n credentialRef: string\n catalogRef: string\n }) {\n const id = useId()\n const [draft, setDraft] = useState<string | undefined>(undefined)\n const action = useWrite(t)\n const text = draft === undefined ? credentialRef : draft\n const valid = text === '' || CREDENTIAL_REF.test(text)\n\n const commit = async (): Promise<void> => {\n if (!valid || text === credentialRef) return\n const ops = sparse.sparseSettingOperations(doc.layers, ['connections', connectionId, 'credentialRef'], text === '' ? undefined : text, catalogRef)\n if (await action.run(() => write(ops))) setDraft(undefined)\n }\n\n return (\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={id}>{t(keys['credential.reference'])}</label>\n <Input\n id={id}\n className={css.input as string}\n value={text}\n placeholder={catalogRef}\n disabled={disabled || action.busy}\n aria-invalid={!valid}\n autoComplete=\"off\"\n spellCheck={false}\n onChange={event => { setDraft(event.target.value) }}\n onBlur={() => { void commit() }}\n onKeyDown={onEnter(() => { void commit() })}\n />\n <p className={css.hint}>{t(keys['credential.referenceHint'])}</p>\n {valid ? null : <p className={css.fieldError}>{t(keys['options.invalid'])}</p>}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n )\n }\n\n /**\n * A URL option such as a native base URL. A value other than the catalog\n * endpoint is written only together with `trustedEndpoint: true`, and only\n * after the trust switch was turned on for that very address: a stored trust\n * covers the stored address, not a new one typed over it. Turning an active\n * trust off revokes it for the whole connection and returns every URL option\n * to the official endpoint in the same write.\n */\n function UrlOptionField({ connectionId, field, official, override, urlOptions, doc, write, disabled, t }: FieldProps & {\n field: OptionField<K>\n official: string | undefined\n override: BuiltinOverride\n /** Names of every URL option of this connection. */\n urlOptions: readonly string[]\n }) {\n const id = useId()\n const stored = override.options === undefined ? {} : override.options\n const storedText = textOf(stored, field.name)\n const storedTrust = override.trustedEndpoint === true\n const [urlDraft, setUrlDraft] = useState<string | undefined>(undefined)\n /** The address the switch was turned on for in this edit. */\n const [confirmed, setConfirmed] = useState<string | undefined>(undefined)\n const action = useWrite(t)\n\n const url = urlDraft === undefined ? storedText : urlDraft\n const valid = isValidText(field, url)\n const differs = (text: string) => text !== '' && text !== official\n const needsTrust = differs(url)\n const trusted = url === confirmed || (url === storedText && storedTrust)\n const othersNeedTrust = urlOptions.some(name => name !== field.name && differs(textOf(stored, name)))\n const path = ['connections', connectionId]\n\n const settled = (accepted: boolean) => {\n if (!accepted) return\n setUrlDraft(undefined)\n setConfirmed(undefined)\n }\n\n /** Store the address with the trust it needs; an unconfirmed other address stays a draft. */\n const save = async (trust: boolean): Promise<void> => {\n if (!valid || (needsTrust && !trust)) return\n const ops = [\n ...sparse.sparseSettingOperations(doc.layers, [...path, 'options', field.name], url === '' ? official : url, official),\n ...sparse.sparseSettingOperations(doc.layers, [...path, 'trustedEndpoint'], needsTrust || othersNeedTrust, false),\n ]\n settled(await action.run(() => write(ops)))\n }\n\n const revoke = async (): Promise<void> => {\n const ops = [\n ...urlOptions.flatMap(name => differs(textOf(stored, name)) ? sparse.sparseSettingOperations(doc.layers, [...path, 'options', name], official, official) : []),\n ...sparse.sparseSettingOperations(doc.layers, [...path, 'trustedEndpoint'], false, false),\n ]\n settled(await action.run(() => write(ops)))\n }\n\n const toggle = (on: boolean) => {\n if (on) {\n setConfirmed(url)\n void save(true)\n } else if (storedTrust && url === storedText) {\n void revoke()\n } else {\n setConfirmed(undefined)\n }\n }\n\n return (\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={id}>{t(field.label)}</label>\n <Input\n id={id}\n className={css.input as string}\n type=\"url\"\n value={url}\n placeholder={official === undefined ? t(keys['options.default']) : official}\n title={field.name}\n disabled={disabled || action.busy}\n aria-invalid={!valid}\n spellCheck={false}\n onChange={event => { setUrlDraft(event.target.value.trim() === '' ? '' : event.target.value) }}\n onBlur={() => { void save(trusted) }}\n onKeyDown={onEnter(() => { void save(trusted) })}\n />\n {valid ? null : <p className={css.fieldError}>{t(keys['options.invalid'])}</p>}\n {needsTrust ? (\n <div className={css.inline}>\n <Switch\n checked={trusted}\n disabled={disabled || action.busy}\n label={t(keys['services.trust'])}\n onChange={toggle}\n />\n <span className={css.hint}>{t(keys['services.trust'])}</span>\n </div>\n ) : null}\n {needsTrust && valid && !trusted ? <p className={css.fieldError}>{t(keys['services.trustUnsaved'])}</p> : null}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n )\n }\n\n return { CredentialRefField, UrlOptionField }\n}\n\nfunction textOf(options: Readonly<Record<string, unknown>>, name: string): string {\n const value = Object.hasOwn(options, name) ? options[name] : undefined\n return typeof value === 'string' ? value : ''\n}\n","/**\n * Catalog-driven built-in connection controls. Every entry gets its access\n * switch, credential, URL options with endpoint trust and a self-saving option\n * form from its catalog facts; a plugin registers extra editors by catalog key.\n * An entry without an access route of its own (a `model` entry following the\n * Session model) gets only its switch and options; its plugin says who\n * receives the query in the entry's summary and note.\n */\nimport { useId, useState, type ComponentType } from 'react'\nimport { Button, IconChevronDownOutlineRegular, IconRightUpOutlineRegular, SegmentedControl, StateDot, Switch, Tag, type StateDotState } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { builtinId, type AccessMode } from '../../shared/connections.ts'\nimport type { SettingsDescriptor } from '../../shared/settings.ts'\nimport type { CredentialStatusMap } from '../credentials.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { CredentialEditorComponent, SaveCredential } from './CredentialEditor.tsx'\nimport type { OptionGroup, OptionsEditor } from './OptionsEditor.tsx'\nimport { builtinAccess, builtinCredential, builtinOverride, catalogFields, keylessRejected, type BuiltinAccess, type CatalogSettings, type OptionCopyTable } from './model.ts'\nimport { effectiveDocument } from './document.ts'\nimport { applyOps, classNames, type SettingsClasses, type SettingsParts, type SettingsDoc, type WriteSettings } from './parts.tsx'\nimport { createServiceFields, type ServiceFieldsCopyKey } from './ServiceFields.tsx'\nimport type { SettingsLayers, SparseSettings } from './sparse.ts'\n\n/**\n * Configuration only, not service health or a conversation's account\n * availability; only an API-key route needs something here. An entry without\n * an access route has nothing on this page to configure: neutral, not done.\n */\nexport function configurationState(enabled: boolean, access: BuiltinAccess, status: string | undefined): StateDotState {\n if (!enabled || access === 'none') return 'idle'\n if (access === 'keyless' || status === 'configured') return 'done'\n return 'warning'\n}\n\nexport interface ExtraEditorProps<S, K extends string> {\n doc: SettingsDoc<S>\n write: WriteSettings\n disabled: boolean\n t: ClientTranslate<K>\n}\n\n/** A capability's own editor for one catalog entry. */\nexport interface ExtraEditor<S, K extends string> {\n /** Options this editor owns; the shared option form leaves them out. */\n readonly options: readonly string[]\n readonly Editor: ComponentType<ExtraEditorProps<S, K>>\n}\n\nexport type ServicesCopyKey = ServiceFieldsCopyKey | \"services.title\" | \"services.optInNotice\" | \"options.hint\" | \"options.keylessMore\" | \"services.remoteNotice\" | \"services.off\" | \"services.configureLabel\" | \"services.configure\" | \"services.enable\" | \"services.access\" | \"services.accessKeyless\" | \"services.accessPersonal\" | \"services.accessHint.keyless\" | \"services.accessHint.apiKey\" | \"services.accountHint\" | \"services.getKey\" | \"options.title\" | \"services.keyless\" | \"services.account\" | \"services.personalKey\" | \"credential.set\" | \"credential.unset\"\nexport function createServicesSection<S extends CatalogSettings, C extends string, K extends string>({\n classes: css, keys, parts, CredentialEditor, optionsEditor: { OptionsForm }, sparse,\n catalog, optionCopy, label, notes = {}, summaries = {}, optionGroups = {}, extras = {},\n}: {\n classes: SettingsClasses\n keys: Readonly<Record<ServicesCopyKey, K>>\n parts: SettingsParts<K>\n CredentialEditor: CredentialEditorComponent<K>\n optionsEditor: OptionsEditor<K>\n sparse: SparseSettings\n catalog: Readonly<Record<C, SettingsDescriptor>>\n /** Copy for the options of each catalog entry. */\n optionCopy: (key: C) => OptionCopyTable<K>\n label?: (key: C, t: ClientTranslate<K>) => string\n /** A plain note per entry, such as how a remote service caches or keeps what it receives, or who receives the query of an entry without a catalog endpoint. */\n notes?: { readonly [Key in C]?: K }\n /** A fixed row summary per entry in place of the access summary, such as how a local connection reaches pages; an entry without an access route needs one. */\n summaries?: { readonly [Key in C]?: K }\n /** Titled option groups per entry, such as the options each model protocol applies. */\n optionGroups?: { readonly [Key in C]?: readonly OptionGroup[] }\n extras?: { readonly [Key in C]?: ExtraEditor<S, K> }\n}) {\n const { Section, ErrorText, useWrite } = parts\n const { CredentialRefField, UrlOptionField } = createServiceFields({ classes: css, keys, parts, sparse })\n\n interface ServiceProps {\n doc: SettingsDoc<S>\n write: WriteSettings\n credentials: CredentialStatusMap\n saveCredential: SaveCredential\n t: ClientTranslate<K>\n }\n\n function ServicesSection(props: ServiceProps) {\n const catalogKeys = Object.keys(catalog) as C[]\n // Said once for the list; each panel names its own recipient.\n const optIn = catalogKeys.some(key => catalog[key].optIn)\n return (\n <Section title={props.t(keys['services.title'])}>\n {optIn ? <p className={css.note}>{props.t(keys['services.optInNotice'])}</p> : null}\n <ul className={css.list}>\n {catalogKeys.map(key => <ServiceRow key={key} catalogKey={key} {...props} />)}\n </ul>\n </Section>\n )\n }\n\n function ServiceRow({ catalogKey, doc, write, credentials, saveCredential, t }: ServiceProps & { catalogKey: C }) {\n const id = useId()\n const [open, setOpen] = useState(false)\n const action = useWrite(t)\n\n const info = catalog[catalogKey]\n const connectionId = builtinId(catalogKey)\n const override = builtinOverride(doc.config, catalogKey)\n const name = override.label ?? (label === undefined ? info.label : label(catalogKey, t))\n const access = builtinAccess(info, override)\n // The route options are checked on; without an access route of its own nothing narrows an entry's options.\n const route: AccessMode = access === 'keyless' ? 'keyless' : 'api-key'\n const credential = builtinCredential(info, override)\n const credentialRef = credential === undefined ? undefined : credential.ref\n const credentialStatus = credentialRef === undefined ? undefined : credentials[credentialRef]\n // Without an override of its own, an entry is as the catalog starts it: a remote service is off.\n const enabled = !(override.disabled ?? info.optIn)\n const disabled = !doc.editable || action.busy\n\n // Each write is computed on the document the page's earlier writes left, not on this render's.\n const operations = (layers: SettingsLayers, path: string[], target: unknown, fallback?: unknown) =>\n sparse.sparseSettingOperations(layers, ['connections', connectionId, ...path], target, fallback)\n const save = (path: string[], target: unknown, fallback?: unknown) => action.run(() => write(layers => operations(layers, path, target, fallback)))\n const stored = override.options === undefined ? {} : override.options\n const saveOptions = (changes: Readonly<Record<string, unknown>>) => action.run(() => write(initial => {\n let layers = initial\n return Object.entries(changes).flatMap(([option, value]) => {\n const next = sparse.sparseSettingOperations(layers, ['connections', connectionId, 'options', option], value)\n // A sparse unset may prune an empty parent; subsequent paths must see\n // that change before this one atomic write is validated and submitted.\n layers = { ...layers, user: applyOps(layers.user, next) }\n return next\n })\n }))\n\n /**\n * The keyless route takes only the options it accepts; the rest go in the\n * same write. Which ones those are is read from the layers the write runs\n * on: options changed while it waited stay as they are now.\n */\n const switchAccess = (next: AccessMode) => {\n if (next === 'api-key') return save(['access'], next, 'keyless')\n return action.run(() => write(layers => {\n const current = builtinOverride(effectiveDocument(layers), catalogKey).options\n const options = current === undefined ? {} : current\n const rejected = keylessRejected(info.options, options)\n const kept = Object.fromEntries(Object.entries(options).filter(([option]) => !rejected.includes(option)))\n return [\n ...operations(layers, ['access'], next, 'keyless'),\n ...(rejected.length === 0 ? [] : operations(layers, ['options'], Object.keys(kept).length === 0 ? undefined : kept)),\n ]\n }))\n }\n\n const note = notes[catalogKey]\n const extra = extras[catalogKey]\n const owned: readonly string[] = extra === undefined ? [] : extra.options\n const options = catalogFields(info.options, route, optionCopy(catalogKey), info.exclusive)\n const shared = options.fields.filter(field => !owned.includes(field.name))\n const urlFields = shared.filter(field => field.kind === 'url')\n const formFields = shared.filter(field => field.kind !== 'url')\n const optionsHint = t(keys['options.hint']) + (options.restricted ? ' ' + t(keys['options.keylessMore']) : '')\n\n // The catalog service receives the query at its own endpoint; without one, the plugin's note names the recipient.\n const remoteNoticeText = info.remote && info.endpoint !== undefined ? t(keys['services.remoteNotice'], { name }) : undefined\n // The summary stays short; who receives what is said once, in the panel.\n const summary = summaries[catalogKey]\n const summaryText = summary === undefined ? accessSummary(info, access, credentialRef, credentialStatus, t) : t(summary)\n\n return (\n <li className={css.row}>\n <div className={css.rowLine}>\n <StateDot state={configurationState(enabled, access, credentialStatus)} />\n <div className={css.rowMain}>\n <span className={css.rowTitle}>\n {name}\n {enabled ? null : <Tag tone=\"neutral\">{t(keys['services.off'])}</Tag>}\n </span>\n <span className={css.rowMeta}>{summaryText}</span>\n </div>\n <div className={css.rowActions}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={css.disclosure}\n aria-expanded={open}\n aria-controls={id}\n aria-label={t(keys['services.configureLabel'], { name })}\n onClick={() => { setOpen(!open) }}\n >\n {t(keys['services.configure'])}\n <IconChevronDownOutlineRegular className={classNames(css.disclosureIcon, open && css.disclosureOpen)} />\n </Button>\n <Switch\n checked={enabled}\n label={t(keys['services.enable'], { name })}\n disabled={disabled}\n onChange={next => void save(['disabled'], !next, info.optIn)}\n />\n </div>\n </div>\n {open ? null : <ErrorText title={action.errorTitle}>{action.error}</ErrorText>}\n {open ? (\n <div className={css.panel} id={id}>\n {remoteNoticeText ? <p className={css.note}>{remoteNoticeText}</p> : null}\n {note === undefined ? null : <p className={css.note}>{t(note)}</p>}\n {info.access.keyless && info.access.apiKey ? (\n <div className={css.field}>\n <span className={css.fieldLabel}>{t(keys['services.access'])}</span>\n <SegmentedControl<AccessMode>\n id={id + '-access'}\n className={css.segmented}\n label={t(keys['services.access'])}\n value={route}\n disabled={disabled}\n options={[\n { value: 'keyless', label: t(keys['services.accessKeyless']) },\n { value: 'api-key', label: t(keys['services.accessPersonal']) },\n ]}\n onChange={next => void switchAccess(next)}\n />\n <p className={css.hint}>{t(keys[access === 'keyless' ? 'services.accessHint.keyless' : 'services.accessHint.apiKey'])}</p>\n </div>\n ) : null}\n {info.access.account ? <p className={css.note}>{t(keys['services.accountHint'])}</p> : null}\n {access === 'api-key' && credential !== undefined ? (\n <>\n <CredentialRefField\n connectionId={connectionId}\n credentialRef={credential.ref}\n catalogRef={credential.catalogRef}\n doc={doc}\n write={write}\n disabled={disabled}\n t={t}\n />\n <CredentialEditor credentialRef={credential.ref} status={credentialStatus} save={saveCredential} t={t} />\n {info.homepage ? (\n <a className={css.link} href={info.homepage} target=\"_blank\" rel=\"noopener noreferrer\">\n {t(keys['services.getKey'])}\n <IconRightUpOutlineRegular size={12} />\n </a>\n ) : null}\n </>\n ) : null}\n {extra === undefined ? null : <extra.Editor doc={doc} write={write} disabled={disabled} t={t} />}\n {urlFields.map(field => (\n <UrlOptionField\n key={field.name}\n connectionId={connectionId}\n field={field}\n official={info.endpoint}\n override={override}\n urlOptions={urlFields.map(candidate => candidate.name)}\n doc={doc}\n write={write}\n disabled={disabled}\n t={t}\n />\n ))}\n {formFields.length === 0 && options.restricted ? <p className={css.hint}>{t(keys['options.keylessMore'])}</p> : null}\n <OptionsForm\n key={access}\n id={id + '-options'}\n title={t(keys['options.title'])}\n hint={optionsHint}\n fields={formFields}\n groups={optionGroups[catalogKey]}\n stored={stored}\n disabled={disabled}\n t={t}\n onCommit={saveOptions}\n />\n {/* With the panel open, a refused write is reported after the fields it most likely came from. */}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n ) : null}\n </li>\n )\n }\n\n function accessSummary(info: SettingsDescriptor, access: BuiltinAccess, ref: string | undefined, status: string | undefined, t: ClientTranslate<K>): string {\n if (access === 'none') return ''\n if (access === 'keyless' || ref === undefined) return t(keys['services.keyless'])\n const route = t(keys[info.access.account ? 'services.account' : 'services.personalKey'], { ref })\n if (status === 'configured') return route + ' · ' + t(keys['credential.set'])\n if (status === 'missing') return route + ' · ' + t(keys['credential.unset'])\n return route\n }\n return ServicesSection\n}\n","import { useState } from 'react'\nimport { Button, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PairingsState } from '../pairings.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses, SettingsParts } from './parts.tsx'\nexport type PairingsCopyKey = \"pairings.forgetFailed\" | \"pairings.title\" | \"pairings.hint\" | \"pairings.failed\" | \"pairings.loading\" | \"pairings.empty\" | \"connection.off\" | \"saving\" | \"pairings.forget\"\nexport function createPairingsSection<S, K extends string>({ classes: css, keys, parts: { Section, ErrorText }, formatConnectionName }: {\n classes: SettingsClasses\n keys: Readonly<Record<PairingsCopyKey, K>>\n parts: SettingsParts<K>\n formatConnectionName: (id: string, config: S, t: ClientTranslate<K>) => string\n}) {\n function PairingsSection({\n pairingsState,\n config,\n forgetPairing,\n t,\n }: {\n pairingsState: PairingsState\n config: S\n forgetPairing: (provider: string, model: string) => Promise<void>\n t: ClientTranslate<K>\n }) {\n const [busyKeys, setBusyKeys] = useState<ReadonlySet<string>>(new Set())\n const [error, setError] = useState<string | undefined>(undefined)\n \n const handleForget = async (provider: string, model: string) => {\n const key = `${provider}:${model}`\n setBusyKeys(prev => new Set(prev).add(key))\n setError(undefined)\n try {\n await forgetPairing(provider, model)\n } catch {\n setError(t(keys['pairings.forgetFailed']))\n } finally {\n setBusyKeys(prev => {\n const next = new Set(prev)\n next.delete(key)\n return next\n })\n }\n }\n \n const items = pairingsState.state === 'ready' ? pairingsState.pairings : []\n \n return (\n <Section title={t(keys['pairings.title'])}>\n <p className={css.hint}>{t(keys['pairings.hint'])}</p>\n <ErrorText>{error}</ErrorText>\n {pairingsState.state === 'failed' ? (\n <ErrorText title={pairingsState.message}>{t(keys['pairings.failed'])}</ErrorText>\n ) : pairingsState.state === 'loading' ? (\n <p className={css.status} role=\"status\">\n <StateDot state=\"ongoing\" />\n {t(keys['pairings.loading'])}\n </p>\n ) : items.length === 0 ? (\n <p className={css.empty}>{t(keys['pairings.empty'])}</p>\n ) : (\n <ul className={css.list}>\n {items.map(pairing => {\n const itemKey = `${pairing.provider}:${pairing.model}`\n const isBusy = busyKeys.has(itemKey)\n const targetText = pairing.connectionId === null\n ? t(keys['connection.off'])\n : formatConnectionName(pairing.connectionId, config, t)\n \n return (\n <li key={itemKey} className={css.row}>\n <div className={css.rowLine}>\n <StateDot state={pairing.connectionId === null ? 'idle' : 'done'} />\n <div className={css.rowMain}>\n <span className={css.rowTitle}>\n {pairing.provider} / {pairing.model}\n </span>\n <span className={css.rowMeta}>{targetText}</span>\n </div>\n <div className={css.rowActions}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n disabled={isBusy}\n onClick={() => { void handleForget(pairing.provider, pairing.model) }}\n >\n {isBusy ? t(keys['saving']) : t(keys['pairings.forget'])}\n </Button>\n </div>\n </div>\n </li>\n )\n })}\n </ul>\n )}\n </Section>\n )\n }\n \n \n return PairingsSection\n}\n","import type { ReactNode } from 'react'\nimport { StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { configurationState } from './ServicesSection.tsx'\nimport type { ClientTranslate } from '../command.ts'\nimport type { BuiltinAccess } from './model.ts'\nimport type { SettingsDoc, SettingsParts, WriteSettings, SelectOption } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type DefaultsCopyKey = 'title' | 'connection' | 'connectionHint' | 'connectionUnset' | 'connectionMissing'\nexport interface DefaultsControls {\n readonly disabled: boolean\n readonly save: (path: string[], target: unknown, fallback?: unknown) => void\n}\n\n/** Default connection plus capability-owned controls sharing one write/error state. */\nexport function createDefaultsSection<K extends string>({ parts: { Section, SettingRow, SelectMenu, ErrorText, useWrite }, sparse, keys }: {\n parts: SettingsParts<K>\n sparse: SparseSettings\n keys: Readonly<Record<DefaultsCopyKey, K>>\n}) {\n return function DefaultsSection({ doc, write, t, defaultConnection, defaultLabel, defaultAvailability, choices, children }: {\n doc: SettingsDoc\n write: WriteSettings\n t: ClientTranslate<K>\n defaultConnection: string | undefined\n defaultLabel: string\n defaultAvailability?: {\n readonly disabled: boolean\n readonly access: BuiltinAccess\n readonly credentialStatus: string | undefined\n readonly warning: string\n } | undefined\n choices: readonly SelectOption[]\n children?: (controls: DefaultsControls) => ReactNode\n }) {\n const action = useWrite(t)\n const disabled = !doc.editable || action.busy\n const save = (path: string[], target: unknown, fallback?: unknown) => {\n void action.run(() => write(layers => sparse.sparseSettingOperations(layers, path, target, fallback)))\n }\n const missing = defaultConnection !== undefined && !choices.some(choice => choice.id === defaultConnection)\n const warning = missing ? t(keys.connectionMissing, { id: defaultConnection })\n : defaultAvailability && (defaultAvailability.disabled || configurationState(true, defaultAvailability.access, defaultAvailability.credentialStatus) === 'warning')\n ? defaultAvailability.warning : undefined\n const connectionOptions = [\n { id: '', label: t(keys.connectionUnset, { name: defaultLabel }) },\n ...(missing ? [{ id: defaultConnection, label: t(keys.connectionMissing, { id: defaultConnection }) }] : []),\n ...choices,\n ]\n return (\n <Section title={t(keys.title)}>\n <SettingRow title={t(keys.connection)} hint={<>\n <span>{t(keys.connectionHint)}</span>\n {warning && <span role=\"status\"><StateDot state=\"warning\" />{warning}</span>}\n </>}>\n <SelectMenu label={t(keys.connection)} value={defaultConnection ?? ''} options={connectionOptions} disabled={disabled}\n onChange={next => { save(['defaultConnection'], next === '' ? undefined : next) }} />\n </SettingRow>\n {children?.({ disabled, save })}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </Section>\n )\n }\n}\n","/**\n * The row's Enhanced tools switch (docs/design.md, \"开关与同意\"): what turning\n * it on lets the Agent do, and what the operator agrees to by doing so.\n */\nimport { useId } from 'react'\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses, SettingsDoc, SettingsParts, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type EnhancedToolsCopyKey = 'title' | 'description' | 'consent'\n\n/** The document field this section edits; both capability documents have it. */\nexport interface EnhancedToolsSettings {\n readonly enhancedTools?: boolean | undefined\n}\n\nexport function createEnhancedToolsSection<K extends string>({ classes: css, parts: { Section, ErrorText, useWrite }, sparse, keys }: {\n classes: SettingsClasses\n parts: SettingsParts<K>\n sparse: SparseSettings\n keys: Readonly<Record<EnhancedToolsCopyKey, K>>\n}) {\n return function EnhancedToolsSection({ doc, write, t }: {\n doc: SettingsDoc<EnhancedToolsSettings>\n write: WriteSettings\n t: ClientTranslate<K>\n }) {\n const id = useId()\n const action = useWrite(t)\n const enabled = doc.config.enhancedTools ?? false\n // Off unless a layer turns it on: the user layer stores only a difference from the inherited value.\n const save = (next: boolean) => action.run(() => write(layers => sparse.sparseSettingOperations(layers, ['enhancedTools'], next, false)))\n return (\n <Section title={t(keys.title)} titleId={id + '-title'}>\n {/* A screen reader entering the switch hears what it does and what turning it on agrees to. */}\n <div className={css.settingRow} role=\"group\" aria-labelledby={id + '-title'} aria-describedby={id + '-description ' + id + '-consent'}>\n <div className={css.settingText}>\n <p id={id + '-description'} className={css.settingLead}>{t(keys.description)}</p>\n <p id={id + '-consent'} className={css.hint}>{t(keys.consent)}</p>\n </div>\n <div className={css.settingControl}>\n <Switch checked={enabled} label={t(keys.title)} disabled={!doc.editable || action.busy} onChange={next => void save(next)} />\n </div>\n </div>\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </Section>\n )\n }\n}\n","import { useState } from 'react'\nimport { Button } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses, SettingsParts, SettingsDoc, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\nexport type ResetCopyKey = \"reset.confirm\" | \"reset.confirmButton\" | \"confirm.cancel\" | \"reset.hint\" | \"reset.button\"\nexport function createResetSection<K extends string>({ classes: css, keys, parts: { ConfirmRow, ErrorText, useWrite }, sparse }: {\n classes: SettingsClasses\n keys: Readonly<Record<ResetCopyKey, K>>\n parts: SettingsParts<K>\n sparse: SparseSettings\n}) {\n return function ResetSection({ doc, write, t }: { doc: SettingsDoc; write: WriteSettings; t: ClientTranslate<K> }) {\n const [confirming, setConfirming] = useState(false)\n const action = useWrite(t)\n const disabled = !doc.editable || action.busy\n \n const reset = async () => {\n if (await action.run(() => write(sparse.resetSettingsOperations(doc.layers)))) {\n setConfirming(false)\n }\n }\n \n return (\n <div className={css.reset}>\n {confirming ? (\n <ConfirmRow\n message={t(keys['reset.confirm'])}\n confirmLabel={t(keys['reset.confirmButton'])}\n cancelLabel={t(keys['confirm.cancel'])}\n disabled={disabled}\n onConfirm={() => { void reset() }}\n onCancel={() => { setConfirming(false) }}\n />\n ) : (\n <div className={css.confirmRow}>\n <span className={css.confirmText}>{t(keys['reset.hint'])}</span>\n <Button variant=\"outline\" size=\"sm\" disabled={disabled} onClick={() => { setConfirming(true) }}>\n {t(keys['reset.button'])}\n </Button>\n </div>\n )}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n )\n }\n}\n","import type { Route } from '../../shared/route.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses } from './parts.tsx'\nexport function createRouteNotice<K extends string>({ classes: css, keys, other }: {\n classes: SettingsClasses\n keys: Readonly<Record<'unknown' | 'auto' | 'other', K>>\n other?: (route: Extract<Route, { kind: 'other' }>, t: ClientTranslate<K>) => string | undefined\n}) {\n return function RouteNotice({ route, t }: { route: Route; t: ClientTranslate<K> }) {\n let text: string | undefined\n switch (route.kind) {\n case 'this': return null\n case 'unknown': text = t(keys.unknown); break\n case 'auto': text = t(keys.auto, { id: route.providerId }); break\n case 'other': text = other?.(route, t) ?? t(keys.other, { provider: route.provider, id: route.providerId }); break\n }\n return <p className={css.warning} role=\"status\">{text}</p>\n }\n}\n","import type { ConfigForm, ConfigFormSnapshot, SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client'\n\nexport type SettingsDocumentSnapshot<S> = ConfigFormSnapshot<S> & { readonly diagnostic?: string }\n\n/** Add public secret-presence diagnostics without guessing which redacted layer owns a secret. */\nexport function withRetiredSecretDiagnostics<S>(form: ConfigForm<S>, describe: SettingsDescribeFace, namespace: string, retiredFields: readonly string[], formatDiagnostic: (fields: readonly string[]) => string): ConfigForm<S> {\n let cached: { source: ConfigFormSnapshot<S>; diagnostic: string | undefined; snapshot: SettingsDocumentSnapshot<S> } | undefined\n const getSnapshot = (): SettingsDocumentSnapshot<S> => {\n const source = form.getSnapshot()\n const row = describe.getSnapshot().view?.namespaces.find(entry => entry.ns === namespace)\n const fields = row === undefined ? [] : row.secrets.filter(secret => secret.set && secret.path.length === 1 && retiredFields.includes(secret.path[0]!)).map(secret => secret.path[0]!)\n const diagnostic = fields.length === 0 ? undefined : formatDiagnostic(fields)\n if (cached === undefined || cached.source !== source || cached.diagnostic !== diagnostic) {\n cached = { source, diagnostic, snapshot: diagnostic === undefined ? source : { ...source, diagnostic } }\n }\n return cached.snapshot\n }\n return {\n getSnapshot,\n subscribe(listener) {\n let previous = getSnapshot()\n const notify = () => {\n const next = getSnapshot()\n if (next === previous) return\n previous = next\n listener()\n }\n const stopForm = form.subscribe(notify)\n const stopDescribe = describe.subscribe(notify)\n return () => { stopForm(); stopDescribe() }\n },\n mutate: (operations, revision) => form.mutate(operations, revision),\n set: (field, value) => form.set(field, value),\n unset: field => form.unset(field),\n }\n}\n","/**\n * Custom connection form: a catalog adapter, or a model protocol the plugin\n * passes. Endpoint trust always comes from explicit consent, given for one\n * destination.\n */\nimport { CREDENTIAL_REF, CUSTOM_CONNECTION_ID, CUSTOM_PREFIX, type ProtocolDescriptor } from '../../shared/connections.ts'\nimport { singleLine } from '../../shared/settings.ts'\nimport { isEndpoint } from '../../shared/url.ts'\nimport { applyFields, conflictOf, fieldText, isValidText, type FieldTexts, type OptionField } from './fields.ts'\nimport { adapterKeys, catalogEntry, catalogFields, type AdapterKeyOf, type CustomConnection, type OptionCopyTable, type SettingsCatalog } from './model.ts'\n\n/** What a custom connection talks to: a catalog adapter, or a model over one protocol. */\nexport type Format<A extends string = string, P extends string = string> =\n | { readonly kind: 'adapter'; readonly adapter: A }\n | { readonly kind: 'model'; readonly protocol: P }\n\ninterface FormFields {\n readonly id: string\n readonly label: string\n readonly credentialRef: string\n readonly options: FieldTexts\n readonly endpoint: string\n}\nexport type ConnectionForm<A extends string = string, P extends string = string> =\n | FormFields & { readonly kind: 'adapter'; readonly adapter: A }\n | FormFields & { readonly kind: 'model'; readonly protocol: P; readonly model: string }\n\nexport type FormError = 'id' | 'duplicate' | 'label' | 'model' | 'credentialRef' | 'endpoint' | 'options' | 'trust'\nexport type BuildResult<A extends string = string, P extends string = string> =\n | { readonly ok: true; readonly id: string; readonly connection: CustomConnection<A, P> }\n | { readonly ok: false; readonly error: FormError }\n\n/** The model protocols a capability offers to custom connections, with copy for their options. */\nexport interface ProtocolTable<P extends string, K extends string> {\n readonly catalog: Readonly<Record<P, ProtocolDescriptor>>\n readonly optionCopy: (protocol: P) => OptionCopyTable<K>\n}\n\n/** Same bound as the settings grammar: 1–200 characters, no control characters. */\nconst MODEL_ID = /^[^\\p{Cc}]{1,200}$/u\n\nexport function emptyForm<A extends string, P extends string>(format: Format<A, P>): ConnectionForm<A, P> {\n const fields: FormFields = { id: CUSTOM_PREFIX, label: '', credentialRef: '', options: {}, endpoint: '' }\n return format.kind === 'adapter'\n ? { ...fields, kind: 'adapter', adapter: format.adapter }\n : { ...fields, kind: 'model', protocol: format.protocol, model: '' }\n}\n\n/** The form in another format: name, id, credential and endpoint stay; options belong to the format they were set for. */\nexport function withFormat<A extends string, P extends string>(form: ConnectionForm<A, P>, format: Format<A, P>): ConnectionForm<A, P> {\n const fields: FormFields = { id: form.id, label: form.label, credentialRef: form.credentialRef, endpoint: form.endpoint, options: {} }\n if (format.kind === 'adapter') return { ...fields, kind: 'adapter', adapter: format.adapter }\n return { ...fields, kind: 'model', protocol: format.protocol, model: form.kind === 'model' ? form.model : '' }\n}\n\nexport function formatOf<A extends string, P extends string>(form: ConnectionForm<A, P> | CustomConnection<A, P>): Format<A, P> {\n return form.kind === 'adapter' ? { kind: 'adapter', adapter: form.adapter } : { kind: 'model', protocol: form.protocol }\n}\n\n/** A stable key of a format, unique across adapters and protocols. */\nexport function formatKey(format: Format): string {\n return format.kind === 'adapter' ? 'adapter:' + format.adapter : 'model:' + format.protocol\n}\n\nexport function formOf<A extends string, P extends string>(id: string, connection: CustomConnection<A, P>): ConnectionForm<A, P> {\n const options = connection.options === undefined ? {} : connection.options\n const fields: FormFields = {\n id, label: singleLine(connection.label), credentialRef: connection.credentialRef,\n endpoint: connection.endpoint === undefined ? '' : connection.endpoint,\n options: Object.fromEntries(Object.entries(options).map(([name, value]) => [name, fieldText(value)])),\n }\n return connection.kind === 'adapter'\n ? { ...fields, kind: 'adapter', adapter: connection.adapter }\n : { ...fields, kind: 'model', protocol: connection.protocol, model: connection.model }\n}\n\nexport function suggestCredentialRef(id: string): string {\n const name = id.slice(CUSTOM_PREFIX.length).toUpperCase().replace(/[^A-Z0-9]+/gu, '_').replace(/^_+|_+$/gu, '')\n return name === '' ? '' : 'CUSTOM_' + name + '_API_KEY'\n}\n\n/**\n * The form rules of one catalog: its adapter entries, then the protocols the\n * plugin passes, are the formats; options use the API-key route.\n */\nexport function createConnectionForm<T extends SettingsCatalog, K extends string, P extends string = never>({ catalog, optionCopy, protocols }: {\n catalog: T\n optionCopy: (key: AdapterKeyOf<T>) => OptionCopyTable<K>\n protocols?: ProtocolTable<P, K> | undefined\n}) {\n type A = AdapterKeyOf<T>\n type Form = ConnectionForm<A, P>\n\n const protocolKeys = protocols === undefined ? [] : Object.keys(protocols.catalog) as P[]\n const formats: Format<A, P>[] = [\n ...adapterKeys(catalog).map(adapter => ({ kind: 'adapter', adapter }) as const),\n ...protocolKeys.map(protocol => ({ kind: 'model', protocol }) as const),\n ]\n\n function protocolEntry(protocol: P): { readonly info: ProtocolDescriptor; readonly copy: OptionCopyTable<K> } {\n if (protocols === undefined || !Object.hasOwn(protocols.catalog, protocol)) throw new Error('unknown protocol ' + protocol)\n return { info: protocols.catalog[protocol], copy: protocols.optionCopy(protocol) }\n }\n\n const formFields = (form: Form): OptionField<K>[] => {\n if (form.kind === 'adapter') {\n const entry = catalogEntry(catalog, form.adapter)\n return catalogFields(entry.options, 'api-key', optionCopy(form.adapter), entry.exclusive).fields\n }\n const { info, copy } = protocolEntry(form.protocol)\n return catalogFields(info.options, 'api-key', copy, info.exclusive).fields\n }\n\n const urlTexts = (form: Form): string[] =>\n formFields(form).filter(field => field.kind === 'url').map(field => textOf(form.options, field.name).trim())\n\n /**\n * Another endpoint, or a URL option off the catalog endpoint, sends the key\n * elsewhere. A model connection has no catalog endpoint to compare with: it\n * always needs trust.\n */\n function needsTrust(form: Form): boolean {\n if (form.kind === 'model') return true\n const official = catalogEntry(catalog, form.adapter).endpoint\n const differs = (text: string) => text !== '' && text !== official\n return [form.endpoint.trim(), ...urlTexts(form)].some(differs)\n }\n\n /** Everything that decides where the key goes; endpoint consent is given for one destination. */\n const destination = (form: Form): string => JSON.stringify([formatKey(formatOf(form)), form.endpoint.trim(), ...urlTexts(form)])\n\n function buildConnection(input: Form, consent: boolean, taken: readonly string[], previous?: CustomConnection<A, P>): BuildResult<A, P> {\n const fail = (error: FormError): BuildResult<A, P> => ({ ok: false, error })\n const form: Form = { ...input, id: input.id.trim(), label: singleLine(input.label), credentialRef: input.credentialRef.trim(), endpoint: input.endpoint.trim() }\n if (!CUSTOM_CONNECTION_ID.test(form.id)) return fail('id')\n if (taken.includes(form.id)) return fail('duplicate')\n if (form.label === '' || form.label.length > 200) return fail('label')\n const model = form.kind === 'model' ? form.model.trim() : ''\n if (form.kind === 'model' && !MODEL_ID.test(model)) return fail('model')\n if (!CREDENTIAL_REF.test(form.credentialRef) || form.credentialRef.length > 2000) return fail('credentialRef')\n const fields = formFields(form)\n const valid = (field: OptionField<K>) => isValidText(field, textOf(form.options, field.name)) && conflictOf(field, fields, form.options) === undefined\n if (!fields.every(valid)) return fail('options')\n // A model connection names its endpoint; an adapter one may leave it to the catalog.\n const endpointMissing = form.endpoint === '' && form.kind === 'model'\n if (endpointMissing || (form.endpoint !== '' && !isEndpoint(form.endpoint))) return fail('endpoint')\n const trusted = needsTrust(form)\n if (trusted && !consent) return fail('trust')\n const options = applyFields(fields, form.options, {})\n const common = {\n label: form.label, credentialRef: form.credentialRef,\n ...(previous === undefined || previous.disabled === undefined ? {} : { disabled: previous.disabled }),\n ...(Object.keys(options).length === 0 ? {} : { options }),\n }\n if (form.kind === 'model') {\n return { ok: true, id: form.id, connection: { ...common, kind: 'model', protocol: form.protocol, model, endpoint: form.endpoint, trustedEndpoint: true } }\n }\n return { ok: true, id: form.id, connection: {\n ...common, kind: 'adapter', adapter: form.adapter,\n ...(form.endpoint === '' ? {} : { endpoint: form.endpoint }),\n ...(trusted ? { trustedEndpoint: true } : {}),\n } }\n }\n\n return { formats, formFields, needsTrust, destination, buildConnection }\n}\nexport type ConnectionFormRules<T extends SettingsCatalog, K extends string, P extends string = never> = ReturnType<typeof createConnectionForm<T, K, P>>\n\nfunction textOf(texts: FieldTexts, name: string): string {\n return Object.hasOwn(texts, name) ? texts[name]! : ''\n}\n","/**\n * Add or edit one custom connection with plain fields: a catalog adapter, or a\n * model over one of the protocols the plugin passes. The editor keeps the\n * document layers and revision it opened with, so a save never overwrites a\n * change made since. An optional key goes to DSH Credentials once the\n * connection is saved.\n */\nimport { useId, useState } from 'react'\nimport { Button, Checkbox, Input } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { CUSTOM_PREFIX } from '../../shared/connections.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport {\n emptyForm, formatKey, formatOf, formOf, suggestCredentialRef, withFormat,\n type ConnectionForm, type ConnectionFormRules, type Format, type FormError, type ProtocolTable,\n} from './connection-form.ts'\nimport type { SaveCredential } from './CredentialEditor.tsx'\nimport { catalogEntry, type AdapterKeyOf, type CatalogSettings, type CustomConnection, type SettingsCatalog } from './model.ts'\nimport type { OptionsEditor } from './OptionsEditor.tsx'\nimport { classNames, type SettingsClasses, type SettingsDoc, type SettingsParts, type WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type CustomEditorTarget = { readonly kind: 'new' } | { readonly kind: 'edit'; readonly id: string }\n\nexport interface CustomEditorProps<S, K extends string> {\n target: CustomEditorTarget\n doc: SettingsDoc<S>\n write: WriteSettings\n saveCredential: SaveCredential\n /** Ids of every existing connection. */\n taken: readonly string[]\n t: ClientTranslate<K>\n /** Close the editor, with a problem to report after the connection saved. */\n onClose: (problem?: string) => void\n}\n\nexport type EditorCopyKey =\n | 'editor.titleNew' | 'editor.titleEdit' | 'editor.id' | 'editor.idHint' | 'editor.idPlaceholder' | 'editor.label' | 'editor.adapter'\n | 'editor.endpoint' | 'editor.endpointHint' | 'editor.credentialRef' | 'editor.credentialRefHint' | 'editor.trust' | 'editor.trustUnnamed'\n | 'editor.save' | 'editor.cancel' | 'editor.stale' | 'editor.optionsHint' | 'editor.apiKey' | 'editor.apiKeyHint' | 'editor.keyFailed'\n | 'draft.id' | 'draft.duplicate' | 'draft.label' | 'draft.trust' | 'draft.credentialRef' | 'draft.endpoint' | 'draft.options'\n | 'options.title' | 'credential.placeholder' | 'saving'\n\n/** Copy of the model formats: \\`model.format\\` names a protocol (\\`{protocol}\\`) in the format list and on a row. */\nexport type ModelCopyKey = 'model.format' | 'model.id' | 'model.idHint' | 'model.endpointHint' | 'model.note' | 'draft.model'\n\n/** Model protocols a capability offers to custom connections, after its adapter formats. */\nexport interface ModelFormats<P extends string, K extends string> extends ProtocolTable<P, K> {\n readonly keys: Readonly<Record<ModelCopyKey, K>>\n /** A note per protocol shown while it is chosen, such as which services run web search over it. */\n readonly notes?: { readonly [Key in P]?: K }\n}\n\nconst FORM_ERRORS = {\n id: 'draft.id',\n duplicate: 'draft.duplicate',\n label: 'draft.label',\n credentialRef: 'draft.credentialRef',\n endpoint: 'draft.endpoint',\n options: 'draft.options',\n trust: 'draft.trust',\n} as const satisfies Record<Exclude<FormError, 'model'>, EditorCopyKey>\n\n/** The model formats of a capability that has them; a model form exists only then. */\nexport function modelFormats<P extends string, K extends string>(protocols: ModelFormats<P, K> | undefined): ModelFormats<P, K> {\n if (protocols === undefined) throw new Error('this capability has no model protocols')\n return protocols\n}\n\n/** Display name of a format: the catalog adapter, or \"model search · <protocol>\". */\nexport function formatLabel<T extends SettingsCatalog, P extends string, K extends string>(\n catalog: T, protocols: ModelFormats<P, K> | undefined, format: Format<AdapterKeyOf<T>, P>, t: ClientTranslate<K>,\n): string {\n if (format.kind === 'adapter') return catalogEntry(catalog, format.adapter).label\n const models = modelFormats(protocols)\n return t(models.keys['model.format'], { protocol: models.catalog[format.protocol].label })\n}\n\nexport function createConnectionEditor<S extends CatalogSettings, T extends SettingsCatalog, K extends string, P extends string = never>({\n classes: css, keys, parts: { ErrorText, SelectMenu, useWrite }, optionsEditor: { OptionFields }, sparse, catalog, rules, initialFormat, protocols,\n}: {\n classes: SettingsClasses\n keys: Readonly<Record<EditorCopyKey, K>>\n parts: SettingsParts<K>\n optionsEditor: OptionsEditor<K>\n sparse: SparseSettings\n catalog: T\n rules: ConnectionFormRules<T, K, P>\n /** The format a new connection starts with. */\n initialFormat: Format<AdapterKeyOf<T>, P>\n protocols?: ModelFormats<P, K> | undefined\n}) {\n type A = AdapterKeyOf<T>\n type Form = ConnectionForm<A, P>\n const { formats, buildConnection, destination, formFields, needsTrust } = rules\n\n const errorText = (error: FormError, t: ClientTranslate<K>): string =>\n error === 'model' ? t(modelFormats(protocols).keys['draft.model']) : t(keys[FORM_ERRORS[error]])\n\n function ConnectionEditor({ target, doc, write, saveCredential, taken, onClose, t }: CustomEditorProps<S, K>) {\n const formId = useId()\n const [opened] = useState(() => ({\n layers: doc.layers,\n revision: doc.revision,\n previous: target.kind === 'edit' ? storedConnection(doc.config, target.id) : undefined,\n }))\n const [form, setForm] = useState<Form>(() => opened.previous === undefined || target.kind !== 'edit'\n ? emptyForm(initialFormat)\n : formOf(target.id, opened.previous))\n\n // The reference follows the id until the user edits it.\n const [refEdited, setRefEdited] = useState(target.kind === 'edit')\n const [apiKey, setApiKey] = useState('')\n // Consent covers the destination it was given for; a stored trust covers the stored one.\n const [consentFor, setConsentFor] = useState<string | undefined>(() =>\n opened.previous !== undefined && opened.previous.trustedEndpoint === true ? destination(form) : undefined)\n const consent = consentFor === destination(form)\n const [error, setError] = useState<FormError | undefined>(undefined)\n const action = useWrite(t)\n\n const change = (next: (current: Form) => Form) => {\n setForm(next)\n setError(undefined)\n }\n const update = (patch: Partial<Pick<Form, 'id' | 'label' | 'credentialRef' | 'endpoint' | 'options'>>) => {\n change(current => ({ ...current, ...patch }))\n }\n\n const changeId = (suffix: string) => {\n const id = CUSTOM_PREFIX + suffix\n update(refEdited ? { id } : { id, credentialRef: suggestCredentialRef(id) })\n }\n\n const askTrust = needsTrust(form)\n const awaitingTrust = askTrust && !consent\n\n const submit = async (): Promise<void> => {\n const others = target.kind === 'edit' ? taken.filter(existing => existing !== target.id) : taken\n const result = buildConnection(form, consent, others, opened.previous)\n if (!result.ok) return setError(result.error)\n const ops = sparse.sparseSettingOperations(opened.layers, ['connections', result.id], result.connection)\n if (!await action.run(() => write(ops, opened.revision))) return\n\n const key = apiKey.trim()\n if (key === '') return onClose()\n\n try {\n await saveCredential(form.credentialRef.trim(), key)\n onClose()\n } catch {\n onClose(t(keys['editor.keyFailed']))\n }\n }\n\n const trustLabel = form.credentialRef.trim() === ''\n ? t(keys['editor.trustUnnamed'])\n : t(keys['editor.trust'], { ref: form.credentialRef.trim() })\n\n const current = formatKey(formatOf(form))\n const choose = (key: string) => {\n const format = formats.find(candidate => formatKey(candidate) === key)\n if (format !== undefined) change(previous => withFormat(previous, format))\n }\n\n return (\n <form className={css.editor} aria-labelledby={formId + '-title'} onSubmit={event => { event.preventDefault(); void submit() }}>\n <h5 className={css.editorTitle} id={formId + '-title'}>\n {target.kind === 'edit' ? t(keys['editor.titleEdit'], { id: target.id }) : t(keys['editor.titleNew'])}\n </h5>\n <div className={css.formGrid}>\n <TextField id={formId + '-label'} label={t(keys['editor.label'])} value={form.label} onChange={label => update({ label })} />\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={formId + '-id'}>{t(keys['editor.id'])}</label>\n <span className={classNames(css.prefixed, target.kind === 'edit' && css.prefixedDisabled)}>\n <span className={css.prefix} aria-hidden=\"true\">{CUSTOM_PREFIX}</span>\n <input\n id={formId + '-id'}\n className={css.prefixedInput}\n value={form.id.slice(CUSTOM_PREFIX.length)}\n disabled={target.kind === 'edit'}\n placeholder={t(keys['editor.idPlaceholder'])}\n autoComplete=\"off\"\n spellCheck={false}\n aria-describedby={formId + '-id-hint'}\n onChange={event => { changeId(event.target.value) }}\n />\n </span>\n <p className={css.hint} id={formId + '-id-hint'}>{t(keys['editor.idHint'])}</p>\n </div>\n <div className={css.formField}>\n <span className={css.fieldLabel}>{t(keys['editor.adapter'])}</span>\n <SelectMenu\n compact\n label={t(keys['editor.adapter'])}\n value={current}\n options={formats.map(format => ({ id: formatKey(format), label: formatLabel(catalog, protocols, format, t) }))}\n disabled={false}\n onChange={choose}\n />\n {form.kind === 'model' ? <ModelNotes protocol={form.protocol} t={t} /> : null}\n </div>\n {form.kind === 'model' ? (\n <TextField\n id={formId + '-model'}\n label={t(modelFormats(protocols).keys['model.id'])}\n hint={t(modelFormats(protocols).keys['model.idHint'])}\n value={form.model}\n onChange={model => { change(previous => previous.kind === 'model' ? { ...previous, model } : previous) }}\n />\n ) : null}\n <TextField\n id={formId + '-endpoint'}\n label={t(keys['editor.endpoint'])}\n hint={form.kind === 'model' ? t(modelFormats(protocols).keys['model.endpointHint']) : t(keys['editor.endpointHint'])}\n type=\"url\"\n placeholder={form.kind === 'adapter' ? catalogEntry(catalog, form.adapter).endpoint : undefined}\n value={form.endpoint}\n onChange={endpoint => update({ endpoint })}\n />\n <TextField\n id={formId + '-ref'}\n label={t(keys['editor.credentialRef'])}\n hint={t(keys['editor.credentialRefHint'])}\n value={form.credentialRef}\n onChange={credentialRef => {\n setRefEdited(true)\n update({ credentialRef })\n }}\n />\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={formId + '-key'}>{t(keys['editor.apiKey'])}</label>\n <Input\n id={formId + '-key'}\n className={css.input as string}\n type=\"password\"\n autoComplete=\"new-password\"\n spellCheck={false}\n placeholder={t(keys['credential.placeholder'])}\n value={apiKey}\n onChange={event => { setApiKey(event.target.value) }}\n />\n <p className={css.hint}>{t(keys['editor.apiKeyHint'])}</p>\n </div>\n {/* Consent sits with the endpoint and the key it covers, before the options. */}\n {askTrust ? (\n <div className={classNames(css.formWide, css.trust)}>\n <Checkbox className={css.trustCheck} checked={consent} onChange={checked => { setConsentFor(checked ? destination(form) : undefined) }} label={trustLabel} />\n </div>\n ) : null}\n </div>\n <div className={css.field}>\n <span className={css.fieldLabel}>{t(keys['options.title'])}</span>\n <OptionFields\n id={formId + '-option'}\n fields={formFields(form)}\n texts={form.options}\n disabled={false}\n t={t}\n onEdit={(name, value) => update({ options: { ...form.options, [name]: value } })}\n />\n <p className={css.hint}>{t(keys['editor.optionsHint'])}</p>\n </div>\n {doc.revision === opened.revision ? null : <p className={css.warning} role=\"alert\">{t(keys['editor.stale'])}</p>}\n <ErrorText title={error === undefined ? action.errorTitle : undefined}>{error === undefined ? action.error : errorText(error, t)}</ErrorText>\n <div className={css.actions}>\n {awaitingTrust ? <span className={css.hint} id={formId + '-save-blocked'}>{t(keys['draft.trust'])}</span> : null}\n <Button type=\"button\" variant=\"ghost\" onClick={() => { onClose() }}>{t(keys['editor.cancel'])}</Button>\n <Button type=\"submit\" variant=\"primary\" aria-describedby={awaitingTrust ? formId + '-save-blocked' : undefined} disabled={awaitingTrust || !doc.editable || action.busy}>\n {action.busy ? t(keys['saving']) : t(keys['editor.save'])}\n </Button>\n </div>\n </form>\n )\n }\n\n /** What the chosen protocol is good for, then what any model connection returns and costs. */\n function ModelNotes({ protocol, t }: { protocol: P; t: ClientTranslate<K> }) {\n const models = modelFormats(protocols)\n const note = models.notes === undefined ? undefined : models.notes[protocol]\n return (\n <>\n {note === undefined ? null : <p className={css.hint}>{t(note)}</p>}\n <p className={css.hint}>{t(models.keys['model.note'])}</p>\n </>\n )\n }\n\n function storedConnection(config: S, id: string): CustomConnection<A, P> | undefined {\n const stored = config.connections === undefined ? undefined : config.connections[id]\n return stored === undefined ? undefined : stored as CustomConnection<A, P>\n }\n\n function TextField({ id, label, hint, value, onChange, type = 'text', placeholder }: {\n id: string\n label: string\n hint?: string\n value: string\n onChange: (value: string) => void\n type?: string\n placeholder?: string | undefined\n }) {\n return (\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={id}>{label}</label>\n <Input\n id={id}\n className={css.input as string}\n type={type}\n value={value}\n placeholder={placeholder}\n autoComplete=\"off\"\n spellCheck={false}\n onChange={event => { onChange(event.target.value) }}\n />\n {hint === undefined ? null : <p className={css.hint}>{hint}</p>}\n </div>\n )\n }\n\n return ConnectionEditor\n}\n","/**\n * Operator-defined connections. The catalog's adapter entries, then the model\n * protocols a plugin passes, are the formats; without any the section does\n * not render. Removing the connection that is the default restores the\n * catalog default in the same write.\n */\nimport { useState, type ReactNode } from 'react'\nimport { Button, IconPlusOutlineRegular, StateDot, Switch, Tag } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { CredentialStatusMap } from '../credentials.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport { createConnectionForm, formatOf } from './connection-form.ts'\nimport { createConnectionEditor, formatLabel, type CustomEditorTarget, type EditorCopyKey, type ModelFormats } from './ConnectionEditor.tsx'\nimport type { CredentialEditorComponent, SaveCredential } from './CredentialEditor.tsx'\nimport { catalogEntry, customConnections, type AdapterKeyOf, type CatalogSettings, type CustomConnection, type OptionCopyTable, type SettingsCatalog } from './model.ts'\nimport type { OptionsEditor } from './OptionsEditor.tsx'\nimport type { SettingsClasses, SettingsParts, SettingsDoc, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type CustomCopyKey = EditorCopyKey | \"services.remoteNotice\" | \"custom.title\" | \"custom.addStructured\" | \"custom.empty\" | \"custom.kindStructured\" | \"credential.set\" | \"credential.unset\" | \"credential.manage\" | \"custom.edit\" | \"custom.remove\" | \"services.enable\" | \"custom.removeConfirm\" | \"confirm.cancel\"\n\ninterface CustomProps<S, K extends string> {\n doc: SettingsDoc<S>\n write: WriteSettings\n credentials: CredentialStatusMap\n saveCredential: SaveCredential\n t: ClientTranslate<K>\n}\n\nexport function createCustomConnectionsSection<S extends CatalogSettings, T extends SettingsCatalog, K extends string, P extends string = never>({\n classes: css, keys, parts, CredentialEditor, optionsEditor, sparse, catalog, optionCopy, protocols, defaultConnection,\n}: {\n classes: SettingsClasses\n keys: Readonly<Record<CustomCopyKey, K>>\n parts: SettingsParts<K>\n CredentialEditor: CredentialEditorComponent<K>\n optionsEditor: OptionsEditor<K>\n sparse: SparseSettings\n catalog: T\n /** Copy for the options of each adapter entry. */\n optionCopy: (key: AdapterKeyOf<T>) => OptionCopyTable<K>\n /** Model protocols offered after the adapters; a capability without model connections omits them. */\n protocols?: ModelFormats<P, K> | undefined\n /** The catalog default that replaces a removed default connection. */\n defaultConnection: string\n}): (props: CustomProps<S, K>) => ReactNode {\n type A = AdapterKeyOf<T>\n const { Section, ErrorText, ConfirmRow, useWrite } = parts\n const rules = createConnectionForm<T, K, P>({ catalog, optionCopy, protocols })\n const [initialFormat] = rules.formats\n if (initialFormat === undefined) return () => null\n const ConnectionEditor = createConnectionEditor<S, T, K, P>({ classes: css, keys, parts, optionsEditor, sparse, catalog, rules, initialFormat, protocols })\n\n /**\n * Who receives what a connection sends: the catalog service, and the host\n * when the endpoint is not the catalog's; a model connection's own endpoint host.\n */\n function recipient(connection: CustomConnection<A, P>): string {\n if (connection.kind === 'model') return new URL(connection.endpoint).host\n const info = catalogEntry(catalog, connection.adapter)\n if (connection.endpoint === undefined || connection.endpoint === info.endpoint) return info.label\n return info.label + ' (' + new URL(connection.endpoint).host + ')'\n }\n\n function CustomConnectionsSection({ doc, write, credentials, saveCredential, t }: CustomProps<S, K>) {\n const [editor, setEditor] = useState<CustomEditorTarget | undefined>(undefined)\n const [notice, setNotice] = useState<string | undefined>(undefined)\n const connections = customConnections<A, P>(doc.config)\n const taken = doc.config.connections === undefined ? [] : Object.keys(doc.config.connections)\n\n const open = (target: CustomEditorTarget | undefined) => {\n setNotice(undefined)\n setEditor(target)\n }\n\n const editorFor = (target: CustomEditorTarget) => (\n <ConnectionEditor\n key={target.kind === 'edit' ? target.id : 'new'}\n target={target}\n doc={doc}\n write={write}\n saveCredential={saveCredential}\n taken={taken}\n t={t}\n onClose={(problem) => {\n setEditor(undefined)\n setNotice(problem)\n }}\n />\n )\n\n const editing = (id: string) => editor !== undefined && editor.kind === 'edit' && editor.id === id\n\n return (\n <Section\n title={t(keys['custom.title'])}\n actions={(\n <div className={css.sectionActions}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<IconPlusOutlineRegular size={14} />}\n disabled={!doc.editable}\n onClick={() => { open({ kind: 'new' }) }}\n >\n {t(keys['custom.addStructured'])}\n </Button>\n </div>\n )}\n >\n <ErrorText>{notice}</ErrorText>\n {editor !== undefined && editor.kind === 'new' ? editorFor(editor) : null}\n {connections.length === 0 ? <p className={css.empty}>{t(keys['custom.empty'])}</p> : (\n <ul className={css.list}>\n {connections.map(([id, connection]) => (\n <CustomRow\n key={id}\n id={id}\n connection={connection}\n doc={doc}\n write={write}\n credentials={credentials}\n saveCredential={saveCredential}\n t={t}\n editing={editing(id)}\n onEdit={() => { open(editing(id) ? undefined : { kind: 'edit', id }) }}\n editor={editing(id) ? editorFor({ kind: 'edit', id }) : null}\n />\n ))}\n </ul>\n )}\n </Section>\n )\n }\n\n function CustomRow({ id, connection, doc, write, credentials, saveCredential, editing, onEdit, editor, t }: CustomProps<S, K> & {\n id: string\n connection: CustomConnection<A, P>\n editing: boolean\n onEdit: () => void\n editor: ReactNode\n }) {\n const [keyOpen, setKeyOpen] = useState(false)\n const [confirming, setConfirming] = useState(false)\n const action = useWrite(t)\n const credentialRef = connection.credentialRef\n const credentialStatus = credentials[credentialRef]\n const enabled = connection.disabled !== true\n const disabled = !doc.editable || action.busy\n\n const userConnections = (doc.layers.user as { connections?: Record<string, unknown> } | undefined)?.connections\n const removable = userConnections !== undefined && Object.hasOwn(userConnections, id)\n\n const save = (path: string[], target: unknown, fallback?: unknown) =>\n action.run(() => write(layers => sparse.sparseSettingOperations(layers, ['connections', id, ...path], target, fallback)))\n\n /** Removing the default connection puts the catalog default back in the same write. */\n const remove = () => {\n const ops = sparse.sparseSettingOperations(doc.layers, ['connections', id], undefined)\n const restore = doc.config.defaultConnection === id ? sparse.sparseSettingOperations(doc.layers, ['defaultConnection'], defaultConnection, defaultConnection) : []\n return action.run(() => write([...ops, ...restore]))\n }\n\n return (\n <li className={css.row}>\n <div className={css.rowLine}>\n <StateDot state={!enabled ? 'idle' : credentialStatus === 'configured' ? 'done' : 'warning'} />\n <div className={css.rowMain}>\n <span className={css.rowTitle}>\n {connection.label}\n <Tag tone=\"neutral\">{connection.kind === 'adapter' ? t(keys['custom.kindStructured']) : formatLabel(catalog, protocols, formatOf(connection), t)}</Tag>\n </span>\n <span className={css.rowMeta}>\n <code>{id}</code>\n {' · '}\n {connection.kind === 'model' ? <><code>{connection.model}</code>{' · '}</> : null}\n <code>{credentialRef}</code>\n {credentialStatus === 'configured' ? ' · ' + t(keys['credential.set']) : ''}\n {credentialStatus === 'missing' ? ' · ' + t(keys['credential.unset']) : ''}\n {' · ' + t(keys['services.remoteNotice'], { name: recipient(connection) })}\n </span>\n </div>\n <div className={css.rowActions}>\n <Button variant=\"ghost\" size=\"sm\" aria-expanded={keyOpen} onClick={() => { setKeyOpen(!keyOpen) }}>{t(keys['credential.manage'])}</Button>\n <Button variant=\"ghost\" size=\"sm\" aria-expanded={editing} disabled={!doc.editable} onClick={onEdit}>{t(keys['custom.edit'])}</Button>\n {removable ? (\n <Button variant=\"ghost\" size=\"sm\" className={css.danger} disabled={disabled} aria-expanded={confirming} onClick={() => { setConfirming(true) }}>\n {t(keys['custom.remove'])}\n </Button>\n ) : null}\n </div>\n <Switch\n checked={enabled}\n label={t(keys['services.enable'], { name: connection.label })}\n disabled={disabled}\n onChange={next => void save(['disabled'], !next, false)}\n />\n </div>\n {confirming ? (\n <ConfirmRow\n message={t(keys['custom.removeConfirm'], { name: connection.label })}\n confirmLabel={t(keys['custom.remove'])}\n cancelLabel={t(keys['confirm.cancel'])}\n disabled={disabled}\n onConfirm={() => { void remove() }}\n onCancel={() => { setConfirming(false) }}\n />\n ) : null}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n {keyOpen ? (\n <div className={css.panel}>\n <CredentialEditor credentialRef={credentialRef} status={credentialStatus} save={saveCredential} t={t} />\n </div>\n ) : null}\n {editor}\n </li>\n )\n }\n\n return CustomConnectionsSection\n}\n","/** Only exposes retired fields to the browser so Reset can remove them; resolveSettings still rejects them. */\nexport const RETIRED_FIELDS = [\"providerId\",\"freshness\",\"modelMode\",\"protocol\",\"baseURL\",\"model\",\"fallbackModel\",\"apiKey\",\"apiKeyEnv\",\"apiVersion\",\"toolIdentifier\",\"maxTokens\",\"maxUses\",\"chatSearchMode\",\"searchContextSize\"] as const\n","import { z } from 'zod'\nimport { RETIRED_FIELDS } from './retired.ts'\nimport { resolveDocument, type AccessMode, type ResolvedDocument } from 'dsh-tool-web-enhanced-core/shared'\nimport { CATALOG, DEFAULT_CONNECTION, FRESHNESS, MODEL_PROTOCOLS, type AdapterKey, type Freshness, type ModelProtocol } from '../catalog.ts'\n\ninterface ConnectionBase {\n readonly id: string\n readonly label: string\n readonly disabled: boolean\n readonly remote: boolean\n readonly trustedEndpoint: boolean\n readonly options: Readonly<Record<string, unknown>>\n}\nexport interface NativeConnection extends ConnectionBase {\n readonly kind: 'native'\n readonly access: AccessMode\n readonly credentialRef: string\n readonly native: 'deepseek-messages' | 'deepseek-search-api'\n}\nexport interface AdapterConnection extends ConnectionBase {\n readonly kind: 'adapter'\n readonly access: AccessMode\n readonly credentialRef: string\n readonly adapter: AdapterKey\n readonly endpoint: string\n}\nexport interface ModelConnection extends ConnectionBase {\n readonly kind: 'model'\n readonly route:\n | { readonly kind: 'session' }\n | { readonly kind: 'fixed'; readonly protocol: ModelProtocol; readonly model: string; readonly endpoint: string; readonly credentialRef: string }\n}\nexport type Connection = NativeConnection | AdapterConnection | ModelConnection\nexport type ResolvedSettings = ResolvedDocument<{ readonly freshness: Freshness }, Connection>\n\nconst defaultsSchema = z.strictObject({ freshness: z.enum(FRESHNESS).default('auto') })\n\n/** Pure sparse resolution shared by Host and browser. */\nexport function resolveSettings(document: unknown = {}): ResolvedSettings {\n const resolved = resolveDocument({ catalog: CATALOG, protocols: MODEL_PROTOCOLS, document, retiredFields: RETIRED_FIELDS, defaults: { schema: defaultsSchema, defaultConnection: DEFAULT_CONNECTION }, capabilityLabel: 'search' })\n const connections = new Map<string, Connection>()\n for (const [id, connection] of resolved.connections) {\n const { catalogKey, ...base } = connection\n switch (base.kind) {\n case 'local': throw new Error('search catalog cannot contain a local connection')\n case 'model':\n connections.set(id, base)\n break\n case 'native':\n connections.set(id, { ...base, kind: 'native', native: catalogKey as NativeConnection['native'] })\n break\n case 'adapter':\n connections.set(id, { ...base, kind: 'adapter', adapter: catalogKey as AdapterKey })\n break\n }\n }\n return { ...resolved, connections }\n}","import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-typert-protocol'\nimport type { ConnectionText } from 'dsh-tool-web-enhanced-core/client'\nimport { builtinId, isBuiltinId, type Access, type ConnectionView, type SelectionView, type UnsupportedReason } from 'dsh-tool-web-enhanced-core/shared'\nimport { CATALOG, type Freshness } from '../catalog.ts'\nimport type { LocaleKey, NS } from './locales.ts'\n\nexport type Translate = TranslateNS<typeof NS>\n\n/** The Session-model connection keeps its catalog name only until the operator renames it; that name is localized. */\nexport function connectionLabel(connection: Pick<ConnectionView, 'id' | 'label'>, t: Translate): string {\n const sessionModel = connection.id === builtinId('session-model') && connection.label === CATALOG['session-model'].label\n return sessionModel ? t('connection.sessionModel') : connection.label\n}\n\nconst ACCESS_LABELS = { keyless: 'access.keyless', 'api-key': 'access.apiKey', account: 'access.account' } as const satisfies Record<Access, LocaleKey>\n\n/** Why the conversation model cannot serve, worded so the operator knows where to fix it. */\nconst REASON_TEXT = {\n 'no-model': 'status.reason.no-model',\n 'unknown-route': 'status.reason.unknown-route',\n protocol: 'status.reason.protocol',\n endpoint: 'status.reason.endpoint',\n headers: 'status.reason.headers',\n credential: 'status.reason.credential',\n} as const satisfies Record<UnsupportedReason, LocaleKey>\n\nexport function describe(connection: ConnectionView, t: Translate): ConnectionText {\n const label = connectionLabel(connection, t)\n switch (connection.status) {\n case 'disabled': return { label, caption: t('services.off'), reason: t('status.disabled', { name: label }) }\n case 'unsupported': {\n const reason = connection.reason === undefined ? t('status.unsupported', { name: label }) : t(REASON_TEXT[connection.reason])\n return { label, caption: t('status.short.unsupported'), reason }\n }\n case 'needs-credential': {\n const need = credentialNeed(connection)\n // A sign-in is not a key: the short caption (/setup-search) must not send the operator to configure one.\n return { label, caption: t(need === 'status.sessionModelNeedsSignIn' ? 'status.short.needsSignIn' : 'status.short.needsCredential'), reason: t(need) }\n }\n case 'ready': return { label, caption: readyCaption(connection, label, t) }\n }\n}\n\n/**\n * What a connection waits for. The conversation model names its own key, or on\n * the DeepSeek account route a fresh sign-in (that route never falls back to a\n * key); native connections take an account or a key; the rest a key.\n */\nfunction credentialNeed(connection: ConnectionView): 'status.sessionModelNeedsSignIn' | 'status.sessionModelNeedsKey' | 'status.needsAccount' | 'status.needsCredential' {\n if (connection.kind === 'model' && isBuiltinId(connection.id)) {\n return connection.access === 'account' ? 'status.sessionModelNeedsSignIn' : 'status.sessionModelNeedsKey'\n }\n return connection.kind === 'native' ? 'status.needsAccount' : 'status.needsCredential'\n}\n\n/**\n * How the connection authenticates, and for a remote one who receives the\n * query: the service, or for a model connection the conversation model's\n * provider (built-in, follows the conversation) or the fixed connection.\n */\nfunction readyCaption(connection: ConnectionView, label: string, t: Translate): string {\n const access = t(ACCESS_LABELS[connection.access])\n if (!connection.remote) return access\n if (connection.kind !== 'model') return t('status.remoteReady', { access, name: label })\n return isBuiltinId(connection.id) ? t('status.sessionModelReady', { access }) : t('status.modelReady', { access, name: label })\n}\n\nexport function sourceText(view: SelectionView, t: Translate): string {\n const keys = { session: 'source.session', inherited: 'source.inherited', model: 'source.model', default: 'source.default' } as const\n return t(keys[view.source])\n}\n\n/** Names joined as the dictionary's language joins them: \"A and B\", \"A和B\". */\nexport function listText(items: readonly string[], t: Translate): string {\n return new Intl.ListFormat(t('list.locale'), { type: 'conjunction' }).format(items)\n}\n\nconst FRESHNESS_LABELS = { auto: 'freshness.auto', fresh: 'freshness.fresh', realtime: 'freshness.realtime' } as const satisfies Record<Freshness, LocaleKey>\nexport function freshnessLabel(freshness: Freshness, t: Translate): string {\n return t(FRESHNESS_LABELS[freshness])\n}\n\nexport function pickerGroups<V extends ConnectionView>(view: { connections: V[] }): { services: V[] } {\n const visible = view.connections.filter(connection => connection.status !== 'disabled')\n return { services: visible }\n}\n\nexport function writeFailureText(error: RemoteFailure, t: Translate): string {\n switch (error.code) {\n case 'searchConnections/conflict': return t('write.conflict')\n case 'searchConnections/unavailable': return t('write.unavailable')\n default: return t('write.failed')\n }\n}\n","import { parseSelectionCommandOption, selectionCommand, type CommandOptions } from 'dsh-tool-web-enhanced-core/client'\nimport { SEARCH } from 'dsh-tool-web-enhanced-core/shared'\nimport { FRESHNESS } from '../catalog.ts'\nimport type { SearchSelectionView } from '../contract.ts'\nimport { freshnessLabel, pickerGroups, describe, writeFailureText, type Translate } from './connections.ts'\nimport type { SearchSelectionStore, SelectionUpdate } from './selection.ts'\n\nexport const SEARCH_COMMAND = SEARCH.command\nconst FRESHNESS_PREFIX = 'freshness:'\nconst parseFreshness = (id: string): SelectionUpdate | undefined => {\n const freshness = FRESHNESS.find(mode => id === FRESHNESS_PREFIX + mode)\n return freshness === undefined ? undefined : { options: { freshness } }\n}\nexport const parseCommandOption = (id: string): SelectionUpdate | undefined => parseSelectionCommandOption(id, parseFreshness)\n\nexport function searchCommand(selections: SearchSelectionStore, t: Translate) {\n const options: CommandOptions<SearchSelectionView> = {\n parse: parseFreshness,\n isCurrent: (update, selection) => update.options !== undefined && update.options.freshness === selection.options.freshness,\n choices(view, detail) {\n const selected = view.connections.find(connection => connection.id === view.selection.connectionId)\n if (selected === undefined || !selected.freshness) return []\n const group = { name: 'freshness', label: t('selector.freshness') }\n return FRESHNESS.map(mode => ({ id: FRESHNESS_PREFIX + mode, label: freshnessLabel(mode, t), group,\n ...detail(undefined, mode === view.selection.options.freshness) }))\n },\n }\n return selectionCommand(selections, {\n name: SEARCH_COMMAND, t,\n keys: { placeholder: 'command.placeholder', empty: 'command.empty', noResults: 'command.noResults',\n readFailed: 'command.readFailed', current: 'command.current', off: 'selector.offRow' },\n groups: view => {\n const { services } = pickerGroups(view)\n return [\n { group: { name: 'services', label: t('selector.services') }, connections: services },\n ]\n },\n describe: connection => describe(connection, t),\n writeFailureText: error => writeFailureText(error, t),\n options,\n })\n}\n","import { CredentialStatus as CoreCredentialStatus, editableSettings, type CredentialDescriber } from 'dsh-tool-web-enhanced-core/client'\nimport { resolveSettings } from '../settings/resolve.ts'\nimport type { Connection } from '../settings/resolve.ts'\nimport type { SearchSettings } from '../settings/types.ts'\nexport type { CredentialDescriber } from 'dsh-tool-web-enhanced-core/client'\n\n/** The DSH credential a connection names; the Session-model connection uses the Session route's own. */\nexport function credentialRefsOf(connection: Connection): string[] {\n if (connection.kind !== 'model') return [connection.credentialRef]\n return connection.route.kind === 'fixed' ? [connection.route.credentialRef] : []\n}\n\nexport class CredentialStatus extends CoreCredentialStatus<SearchSettings> {\n constructor(settings: () => SearchSettings | undefined, credentials: CredentialDescriber) {\n super(() => {\n const config = settings()\n if (config === undefined) return undefined\n const view = editableSettings<SearchSettings>(config, {}, false, resolveSettings)\n // The settings page presents this same validation diagnostic; invalid documents have no credential queries.\n return view.kind === 'ready' ? view.config : undefined\n }, credentials, config => [...resolveSettings(config).connections.values()].flatMap(credentialRefsOf))\n }\n}\n","/** Copy for every surface of the plugin's browser half; zh is the primary language. */\n\n/** Dictionary namespace registered with ctx.locale. */\nexport const NS = 'web-search-enhanced'\n\nexport const en = {\n 'list.separator': ', ',\n /** Language of this dictionary, for Intl.ListFormat: lists follow the sentence they sit in. */\n 'list.locale': 'en',\n 'section.title': 'Search',\n 'source.session': 'This conversation',\n 'source.inherited': 'Parent conversation',\n 'source.model': \"Model's last choice\",\n 'source.default': 'Default connection',\n 'access.apiKey': 'API key',\n 'pairings.failed': 'Could not load model memories. Try again.',\n 'pairings.forgetFailed': 'Model memory was not cleared. Try again.',\n 'route.unknown': 'Cannot confirm that web_search is served by this plugin.',\n 'services.remoteNotice': 'Search queries are sent to {name}.',\n 'pairings.title': 'Model memories',\n 'pairings.hint': \"Choosing a connection in a conversation (including off) remembers it for that conversation's model; new conversations with that model start with it. After you clear it, conversations that have not chosen use the default connection.\",\n 'pairings.loading': 'Loading model memories…',\n 'pairings.empty': 'No model memories.',\n 'pairings.forget': 'Clear memory',\n 'option.native.baseURL': 'API base URL',\n 'option.native.model': 'Model',\n 'option.native.apiVersion': 'API version',\n 'option.native.maxTokens': 'Max output tokens',\n 'option.native.maxUses': 'Max searches per request',\n 'option.native.count': 'Results per search',\n 'option.native.sendOriginalQuestion': \"Include the user's question\",\n\n 'saving': 'Saving…',\n\n 'connection.off': 'Search off',\n\n 'access.keyless': 'No key needed',\n 'access.account': 'DeepSeek account',\n\n 'freshness.auto': 'Auto',\n 'freshness.fresh': 'Within 24 hours',\n 'freshness.realtime': 'Live',\n\n 'status.disabled': '{name} is turned off in settings.',\n 'status.needsCredential': 'Needs an API key',\n 'status.needsAccount': 'Needs a DeepSeek account or API key',\n 'status.unsupported': '{name} is not supported in this version.',\n 'status.short.needsCredential': 'Needs key',\n 'status.short.needsSignIn': 'Sign-in needed',\n 'status.short.unsupported': 'Not supported',\n 'status.remoteReady': '{access} · the query is sent to {name}',\n\n 'selector.services': 'Search connections',\n 'selector.freshness': 'Content freshness',\n 'selector.freshnessIgnored': '{name} ignores this preference.',\n 'selector.offRow': 'Off',\n\n 'write.conflict': 'Search was changed elsewhere. The menu now shows the current choice.',\n 'write.unavailable': 'That connection is turned off or was removed.',\n 'write.failed': 'Not saved. Try again.',\n\n 'command.label': 'Search connection',\n 'command.description': 'Switch the search connection and freshness of this conversation',\n 'command.placeholder': 'Filter search options',\n 'command.empty': 'No search connection is enabled',\n 'command.noResults': 'No matching option',\n 'command.current': 'Current',\n 'command.readFailed': 'Couldn’t load search settings. Try again.',\n\n 'settings.intro': 'Each conversation chooses a search connection with the globe button or /setup-search. Set the defaults and each connection below. Status dots show configuration only, not quota or service health.',\n 'settings.loading': 'Loading settings…',\n 'settings.retiredSecret': '{fields}: these 0.1.x settings are not read. Their source layer is redacted; remove them manually from the bundle settings.',\n 'settings.readOnly': 'These settings are read-only.',\n 'settings.unsupported': \"These search settings can't be read. They may be from 0.1.x or a newer version. Restore the defaults below, or upgrade the plugin.\",\n 'settings.refused': 'Not saved. The settings may have changed elsewhere; check them and try again.',\n 'settings.invalid': 'Invalid settings; not saved.',\n 'settings.failed': 'Not saved. Check the connection to DSH and try again.',\n 'route.auto': 'The web row names no search provider, so these settings may not apply. Open this bundle on the Plugins page and switch back to {id}.',\n 'route.other': 'web_search is served by {provider}, not {id}, so these settings have no effect. Open this bundle on the Plugins page and switch back to {id}.',\n 'route.deepseekApi': 'Search uses the built-in API provider, not {id}. Open the bundle page to review and restore both enhanced provider routes.',\n\n 'defaults.title': 'Defaults',\n 'defaults.connection': 'Default connection',\n 'defaults.connectionHint': \"A conversation that hasn't chosen uses, in order: its parent's choice (forked conversations only), the last choice for its model, then the default.\",\n 'defaults.connectionUnset': 'Default ({name})',\n 'defaults.connectionMissing': 'Missing: {id}',\n 'defaults.freshness': 'Default freshness',\n 'defaults.freshnessHint': 'For new conversations. Only {services} honor it; other connections ignore it.',\n 'defaults.showSelector': 'Show search connections in the composer menu',\n 'defaults.showSelectorHint': 'When hidden, switch the current conversation with /setup-search.',\n 'defaults.freshnessKeyOnly': '{name} (personal key)',\n\n 'services.title': 'Search connections',\n 'services.optInNotice': 'Remote services are off by default.',\n 'enhanced.title': 'Enhanced tools',\n 'enhanced.description': 'Lets the Agent pick which enabled service runs a search with web_search_enhanced, and see the choices with list_web_search_providers. Applies to conversations started afterwards.',\n 'enhanced.consent': 'Turning this on means you agree that when the Agent picks a service, the query is sent to that service.',\n 'services.enable': 'Enable {name}',\n 'services.configure': 'Configure',\n 'services.configureLabel': 'Configure {name}',\n 'services.off': 'Off',\n 'services.keyless': 'No key needed',\n 'services.personalKey': 'Personal key {ref}',\n 'services.account': 'DeepSeek account or {ref}',\n 'services.access': 'Access',\n 'services.accessKeyless': 'Keyless',\n 'services.accessPersonal': 'Personal key',\n 'services.accountHint': 'Conversations using a DeepSeek account model search through the account; others use the API key below.',\n 'services.getKey': 'Get an API key',\n 'services.accessHint.keyless': 'Uses the public endpoint and shared limits of the service; your key is never sent.',\n 'services.accessHint.apiKey': 'Uses your API key and personal limits; request options are available.',\n\n 'credential.label': 'API key',\n 'credential.placeholder': 'Enter a new key',\n 'credential.save': 'Save key',\n 'credential.saved': 'Key saved.',\n 'credential.failed': 'The key was not saved. Try again.',\n 'credential.hint': 'Stored in DSH Credentials under {ref}, never in settings.',\n 'credential.set': 'Configured',\n 'credential.unset': 'Not configured',\n 'credential.manage': 'Set key',\n 'credential.reference': 'Credential name',\n 'credential.referenceHint': 'The name in DSH Credentials, not the key itself. Leave empty for the default.',\n 'services.trustUnsaved': 'Not saved: confirm that you trust this address first.',\n 'options.on': 'On',\n 'options.off': 'Off',\n\n 'options.title': 'Request options',\n 'options.hint': 'Saved as you change them. Leave a field empty for the service default.',\n 'options.default': 'Default',\n 'options.invalid': 'Invalid value',\n 'options.keylessMore': 'More options are available with a personal key.',\n\n\n 'custom.title': 'Custom connections',\n 'custom.empty': 'No custom connections yet.',\n 'custom.addStructured': 'Add search service',\n 'custom.kindStructured': 'Search service',\n 'custom.edit': 'Edit',\n 'custom.remove': 'Remove',\n 'custom.removeConfirm': 'Remove the custom connection “{name}”? Its credential is not deleted.',\n\n 'editor.titleNew': 'New connection',\n 'editor.titleEdit': 'Edit {id}',\n 'editor.id': 'ID',\n 'editor.idHint': 'Letters, digits, dots, underscores or hyphens.',\n 'editor.label': 'Name',\n 'editor.adapter': 'Service',\n 'editor.endpoint': 'Endpoint',\n 'editor.endpointHint': 'Leave empty for the official endpoint.',\n 'editor.credentialRef': 'Credential name',\n 'editor.credentialRefHint': 'Name of a DSH credential, such as SEARCH_API_KEY. Not the key itself.',\n 'editor.trust': 'I trust this endpoint: send search queries and the credential {ref} to it.',\n 'editor.trustUnnamed': \"I trust this endpoint: send search queries and this connection's credential to it.\",\n 'editor.save': 'Save',\n 'editor.cancel': 'Cancel',\n 'editor.stale': 'Settings changed after you opened this editor. Cancel and reopen it to avoid overwriting those changes.',\n 'editor.idPlaceholder': 'my-search',\n 'editor.searchOptions': 'Search options',\n 'editor.optionsHint': 'Leave a field empty for the default.',\n 'editor.apiKey': 'API key (optional)',\n 'editor.apiKeyHint': 'Saved to DSH Credentials under the credential name above after the connection is saved.',\n 'editor.keyFailed': 'The connection was saved, but its key was not. Set the key from the list.',\n\n 'draft.id': 'The ID must start with custom: followed by letters, digits, dots, underscores or hyphens.',\n 'draft.duplicate': 'This ID is already in use.',\n 'draft.label': 'Enter a name.',\n 'draft.trust': 'Confirm that you trust this endpoint.',\n 'draft.credentialRef': 'A credential name uses letters, digits and underscores and does not start with a digit.',\n 'draft.endpoint': 'Enter a full http(s) address.',\n 'draft.options': 'Fix the highlighted options.',\n\n 'reset.button': 'Restore default settings',\n 'reset.hint': 'Returns every search setting to its default and deletes custom connections. Saved keys are kept.',\n 'reset.confirm': 'Restore every search setting to its default?',\n 'reset.confirmButton': 'Restore',\n\n 'option.exa.type': 'Search type',\n 'option.firecrawl.country': 'Country or region',\n 'option.firecrawl.country.placeholder': 'Two-letter code, e.g. us',\n 'option.firecrawl.location': 'Location',\n 'option.firecrawl.location.placeholder': 'e.g. San Francisco, California',\n 'option.firecrawl.safe': 'Safe search',\n 'option.tavily.search_depth': 'Search depth',\n 'option.tavily.topic': 'Topic',\n 'option.tinyfish.location': 'Region',\n 'option.tinyfish.location.placeholder': 'Two-letter code, e.g. us',\n 'option.tinyfish.language': 'Language',\n 'option.tinyfish.language.placeholder': 'e.g. en or zh-CN',\n 'option.tinyfish.purpose': 'Purpose',\n 'option.tinyfish.purpose.placeholder': 'What the searches are for',\n 'option.tinyfish.domain_type': 'Content type',\n 'option.openalex.sort': 'Sort',\n 'option.openalex.sort.placeholder': 'e.g. cited_by_count:desc',\n 'option.openalex.filter': 'Filter',\n 'option.openalex.filter.placeholder': 'e.g. publication_year:2024',\n 'option.openalex.is_oa': 'Open access only',\n 'option.openalex.mailto': 'Contact email (polite pool)',\n 'option.openalex.mailto.placeholder': 'you@example.org',\n 'option.semanticscholar.year': 'Year',\n 'option.semanticscholar.year.placeholder': 'e.g. 2020 or 2018-2024',\n 'option.semanticscholar.fieldsOfStudy': 'Fields of study',\n 'option.semanticscholar.fieldsOfStudy.placeholder': 'e.g. Computer Science',\n 'option.semanticscholar.publicationTypes': 'Publication types',\n 'option.semanticscholar.publicationTypes.placeholder': 'e.g. JournalArticle,Review',\n\n 'value.auto': 'Auto',\n 'value.fast': 'Fast',\n 'value.instant': 'Instant',\n 'value.basic': 'Basic',\n 'value.advanced': 'Advanced',\n 'value.ultra-fast': 'Ultra-fast',\n 'value.general': 'General',\n 'value.news': 'News',\n 'value.finance': 'Finance',\n 'value.web': 'Web',\n 'value.research_paper': 'Research papers',\n 'value.low': 'Low',\n 'value.medium': 'Medium',\n 'value.high': 'High',\n\n 'options.invalidLine': 'Line {line} is not valid',\n 'options.tooMany': 'At most {max} lines',\n 'options.invalidItem': 'Line {line} (“{item}”) is not a domain with an optional path',\n 'options.exclusive': 'Clear “{other}” first: only one of the two lists can be set',\n\n 'connection.sessionModel': 'Conversation model',\n 'services.sessionModel.summary': 'Follows the conversation model · key or sign-in is checked per conversation',\n 'services.sessionModel.note': \"Searches with the conversation's current model, endpoint and credentials: a DeepSeek API key or account, or a route in Models settings that declares one of the three protocols. The query goes to that model's provider, which bills server-side search per search; the model's answer and the sources it cites are returned. Each option applies only on the protocols named above it. DeepSeek routes use web_search_20250305 unless a search tool version is set here.\",\n 'status.sessionModelReady': \"{access} · sent to the conversation model's provider\",\n 'status.modelReady': '{access} · model search · sent to {name}',\n 'status.sessionModelNeedsKey': \"The conversation model's API key isn't set\",\n 'status.sessionModelNeedsSignIn': 'Sign in to the DeepSeek account again',\n 'status.reason.no-model': \"The model for this conversation's next request isn't known yet\",\n 'status.reason.unknown-route': \"Can't read the settings of this model's provider\",\n 'status.reason.protocol': 'Its route declares no supported api',\n 'status.reason.endpoint': 'Its route has no fixed endpoint',\n 'status.reason.headers': \"Its route's custom headers aren't supported\",\n 'status.reason.credential': \"Its route doesn't name a single API key\",\n\n 'model.format': 'Model search · {protocol}',\n 'model.id': 'Model',\n 'model.idHint': 'The model ID the service expects, such as claude-sonnet-4-5 or gpt-5-search-api.',\n 'model.endpointHint': 'Required: the API base URL. See the example under Service.',\n 'model.note': \"The query and this connection's key go to the endpoint below; server-side search is billed per search. The model's answer and the sources it cites are returned.\",\n 'model.protocol.anthropic-messages': \"Anthropic's server-side web search. Endpoint such as https://api.anthropic.com (/v1 is added). For DeepSeek use https://api.deepseek.com/anthropic and set Search tool version to web_search_20250305 or web_search_20260209.\",\n 'model.protocol.openai-responses': \"OpenAI's web_search tool. Endpoint such as https://api.openai.com/v1 (include /v1). DeepSeek runs it only on deepseek-v4-pro and returns no sources.\",\n 'model.protocol.openai-chat-completions': \"For OpenAI search models such as gpt-5-search-api and compatible gateways. Endpoint such as https://api.openai.com/v1 (include /v1). DeepSeek's Chat Completions has no server-side search; for DeepSeek use Anthropic Messages.\",\n 'draft.model': 'Enter a model ID of up to 200 characters without control characters.',\n\n 'option.model.maxTokens': 'Max output tokens',\n 'option.model.maxTokens.hint': 'Anthropic Messages defaults to 4096; OpenAI sends no limit unless set, and Responses needs at least 16.',\n 'option.model.maxTokens.anthropicHint': 'Defaults to 4096.',\n 'option.model.maxTokens.responsesHint': 'No limit is sent unless set; at least 16.',\n 'option.model.maxTokens.chatHint': 'No limit is sent unless set.',\n 'option.model.anthropicTool': 'Search tool version',\n 'option.model.anthropicTool.hint': 'Defaults to web_search_20260318, or web_search_20250305 when the conversation model is on a DeepSeek route. DeepSeek accepts only web_search_20250305 and web_search_20260209.',\n 'option.model.anthropicTool.fixedHint': 'Defaults to web_search_20260318. DeepSeek accepts only web_search_20250305 and web_search_20260209.',\n 'option.model.maxUses': 'Max searches per request',\n 'option.model.maxUses.hint': 'Defaults to 5.',\n 'option.model.allowedCallers': 'Allowed callers',\n 'option.model.allowedCallers.hint': 'web_search_20260209 and later run search through code execution by default; models without programmatic tool calling need direct, or the request is refused.',\n 'option.model.responseInclusion': 'Search results in the reply',\n 'option.model.responseInclusion.hint': 'web_search_20260318 or later. Left out drops results that code execution already consumed from the reply, and so from the returned sources; direct searches always include them.',\n 'option.model.responsesTool': 'Search tool',\n 'option.model.responsesTool.hint': 'Defaults to web_search. web_search_preview is the older tool: no domain filters or result token budget, and it ignores Live web access.',\n 'option.model.searchContextSize': 'Search context size',\n 'option.model.searchContextSize.hint': 'More context costs more and takes longer.',\n 'option.model.externalWebAccess': 'Live web access',\n 'option.model.externalWebAccess.hint': 'When off, the search uses cached content instead of fetching pages live.',\n 'option.model.returnTokenBudget': 'Result token budget',\n 'option.model.returnTokenBudget.hint': 'Applies only to reasoning search on GPT-5 and later.',\n 'option.model.allowedDomains': 'Only these domains',\n 'option.model.blockedDomains': 'Never these domains',\n 'option.model.domains.placeholder': 'example.com\\ndocs.example.com/api',\n 'option.model.domains.sessionHint': 'One per line: a domain with an optional path, without https://. Set only one of the two lists.',\n 'option.model.domains.exclusiveHint': 'One per line: a domain with an optional path, without https://. Anthropic Messages accepts only one of the two lists.',\n 'option.model.domains.bothHint': 'One per line: a domain with an optional path, without https://. OpenAI Responses accepts both lists together.',\n 'option.model.userCity': 'City',\n 'option.model.userRegion': 'Region',\n 'option.model.userCountry': 'Country or region',\n 'option.model.userCountry.placeholder': 'Two-letter code, e.g. US',\n 'option.model.userTimezone': 'Time zone',\n 'option.model.userTimezone.placeholder': 'e.g. America/New_York',\n 'option.model.location.hint': 'Approximate user location used to localize results.',\n\n 'value.full': 'Included',\n 'value.excluded': 'Left out',\n 'value.default': 'Standard',\n 'value.unlimited': 'Unlimited',\n\n 'confirm.cancel': 'Cancel',\n} as const\n\n/** Every key of the namespace. */\nexport type LocaleKey = keyof typeof en\n\nexport const zh: Record<LocaleKey, string> = {\n 'list.separator': '、',\n 'list.locale': 'zh-CN',\n 'section.title': '搜索',\n 'source.session': '本会话',\n 'source.inherited': '来自父会话',\n 'source.model': '该模型上次的选择',\n 'source.default': '默认连接',\n 'access.apiKey': 'API Key',\n 'pairings.failed': '读取模型记忆失败,请重试。',\n 'pairings.forgetFailed': '未清除模型记忆,请重试。',\n 'route.unknown': '无法确认 web_search 是否由本插件提供。',\n 'services.remoteNotice': '搜索查询会发送给 {name}。',\n 'pairings.title': '模型记忆',\n 'pairings.hint': '在会话里选择连接(包括关闭)时,会为该会话的模型记住这次选择,该模型的新会话会沿用它。清除后,还没有自行选择的会话改用默认连接。',\n 'pairings.loading': '正在读取模型记忆…',\n 'pairings.empty': '没有模型记忆。',\n 'pairings.forget': '清除记忆',\n 'option.native.baseURL': 'API 基础地址',\n 'option.native.model': '模型',\n 'option.native.apiVersion': 'API 版本',\n 'option.native.maxTokens': '最大输出 Token',\n 'option.native.maxUses': '单次请求最多搜索次数',\n 'option.native.count': '每次搜索结果数',\n 'option.native.sendOriginalQuestion': '附带用户原始问题',\n\n 'saving': '正在保存…',\n\n 'connection.off': '搜索已关闭',\n\n 'access.keyless': '无需密钥',\n 'access.account': 'DeepSeek 账号',\n\n 'freshness.auto': '自动',\n 'freshness.fresh': '24 小时内',\n 'freshness.realtime': '实时',\n\n 'status.disabled': '{name} 未在设置中启用。',\n 'status.needsCredential': '需要 API Key',\n 'status.needsAccount': '需要 DeepSeek 账号或 API Key',\n 'status.unsupported': '本版本不支持 {name}。',\n 'status.short.needsCredential': '未配置密钥',\n 'status.short.needsSignIn': '需要登录',\n 'status.short.unsupported': '不支持',\n 'status.remoteReady': '{access} · 查询会发送给 {name}',\n\n 'selector.services': '搜索连接',\n 'selector.freshness': '内容实时性',\n 'selector.freshnessIgnored': '{name} 不支持此偏好,选择不会生效。',\n 'selector.offRow': '关闭',\n\n 'write.conflict': '搜索设置已在别处更改,菜单已显示最新选择。',\n 'write.unavailable': '该连接未启用或已移除。',\n 'write.failed': '保存失败,请重试。',\n\n 'command.label': '搜索连接',\n 'command.description': '切换当前会话的搜索连接与内容实时性',\n 'command.placeholder': '筛选搜索选项',\n 'command.empty': '没有已启用的搜索连接',\n 'command.noResults': '没有匹配的选项',\n 'command.current': '当前',\n 'command.readFailed': '读取搜索设置失败,请重试。',\n\n 'settings.intro': '每个会话通过地球按钮或 /setup-search 选择搜索连接。本页设置默认值及各连接的参数。状态点只反映配置,不代表额度或服务可用性。',\n 'settings.loading': '正在读取设置…',\n 'settings.retiredSecret': '{fields}:本版本不读取这些 0.1.x 设置。来源层已隐藏,请手动从组合包设置中移除。',\n 'settings.readOnly': '当前设置为只读。',\n 'settings.unsupported': '无法读取这些搜索设置,可能来自 0.1.x 或更新的版本。请在下方恢复默认设置,或升级插件。',\n 'settings.refused': '未保存:设置可能已在别处更改,请检查后重试。',\n 'settings.invalid': '设置无效,未保存。',\n 'settings.failed': '未保存,请检查与 DSH 的连接后重试。',\n 'route.auto': 'web 行没有指定搜索 provider,这里的设置可能不生效。请在插件页打开本组合包,改回 {id}。',\n 'route.other': 'web_search 当前由 {provider} 提供,不是 {id},这里的设置不会生效。请在插件页打开本组合包,改回 {id}。',\n 'route.deepseekApi': '搜索正在使用内置 API provider,而非 {id}。请在 组合包页面检查并恢复两项增强 provider 路由。',\n\n 'defaults.title': '默认值',\n 'defaults.connection': '默认连接',\n 'defaults.connectionHint': '未自行选择的会话依次使用:父会话的选择(仅限分叉出的会话)、该模型上次的选择、默认连接。',\n 'defaults.connectionUnset': '默认({name})',\n 'defaults.connectionMissing': '不存在:{id}',\n 'defaults.freshness': '默认实时性',\n 'defaults.freshnessHint': '用于新会话。仅对 {services} 生效,其他连接忽略。',\n 'defaults.showSelector': '在输入框菜单中显示搜索连接',\n 'defaults.showSelectorHint': '隐藏后可用 /setup-search 切换当前会话。',\n 'defaults.freshnessKeyOnly': '{name}(个人密钥)',\n\n 'services.title': '搜索连接',\n 'services.optInNotice': '远程服务默认关闭。',\n 'enhanced.title': '增强工具',\n 'enhanced.description': '让 Agent 用 web_search_enhanced 在已启用的服务中自行选择本次搜索用哪个,并用 list_web_search_providers 查看可选项。只影响之后新建的会话。',\n 'enhanced.consent': '打开即表示同意:Agent 选用某个服务时,查询会发送给该服务。',\n 'services.enable': '启用 {name}',\n 'services.configure': '配置',\n 'services.configureLabel': '配置 {name}',\n 'services.off': '未启用',\n 'services.keyless': '无需密钥',\n 'services.personalKey': '个人密钥 {ref}',\n 'services.account': 'DeepSeek 账号或 {ref}',\n 'services.access': '访问方式',\n 'services.accessKeyless': '免密钥',\n 'services.accessPersonal': '个人密钥',\n 'services.accountHint': '使用 DeepSeek 账号模型的会话通过账号搜索;其他会话使用下方的 API Key。',\n 'services.getKey': '获取 API Key',\n 'services.accessHint.keyless': '使用服务的公共接口和共享额度,不发送你的密钥。',\n 'services.accessHint.apiKey': '使用你的 API Key 和个人额度,可设置请求参数。',\n\n 'credential.label': 'API Key',\n 'credential.placeholder': '输入新的密钥',\n 'credential.save': '保存密钥',\n 'credential.saved': '密钥已保存。',\n 'credential.failed': '密钥未保存,请重试。',\n 'credential.hint': '以 {ref} 保存到 DSH 凭据,不写入设置。',\n 'credential.set': '已配置',\n 'credential.unset': '未配置',\n 'credential.manage': '设置密钥',\n 'credential.reference': '凭据名称',\n 'credential.referenceHint': 'DSH 凭据中的名称,不是密钥本身。留空使用默认名称。',\n 'services.trustUnsaved': '尚未保存:请先确认信任此地址。',\n 'options.on': '开',\n 'options.off': '关',\n\n 'options.title': '请求参数',\n 'options.hint': '修改后自动保存。留空使用服务默认值。',\n 'options.default': '默认',\n 'options.invalid': '格式无效',\n 'options.keylessMore': '使用个人密钥时可设置更多参数。',\n\n\n 'custom.title': '自定义连接',\n 'custom.empty': '还没有自定义连接。',\n 'custom.addStructured': '添加搜索服务',\n 'custom.kindStructured': '搜索服务',\n 'custom.edit': '编辑',\n 'custom.remove': '移除',\n 'custom.removeConfirm': '确定移除自定义连接“{name}”?凭据不会删除。',\n\n 'editor.titleNew': '新建连接',\n 'editor.titleEdit': '编辑 {id}',\n 'editor.id': 'ID',\n 'editor.idHint': '字母、数字、点、下划线或连字符。',\n 'editor.label': '名称',\n 'editor.adapter': '服务',\n 'editor.endpoint': '接口地址',\n 'editor.endpointHint': '留空使用官方地址。',\n 'editor.credentialRef': '凭据名称',\n 'editor.credentialRefHint': 'DSH 凭据的名称,例如 SEARCH_API_KEY,不是密钥本身。',\n 'editor.trust': '我信任此地址:允许向它发送搜索查询与凭据 {ref}。',\n 'editor.trustUnnamed': '我信任此地址:允许向它发送搜索查询与此连接的凭据。',\n 'editor.save': '保存',\n 'editor.cancel': '取消',\n 'editor.stale': '打开编辑器后设置已变化。请取消后重新打开,以免覆盖这些修改。',\n 'editor.idPlaceholder': 'my-search',\n 'editor.searchOptions': '搜索参数',\n 'editor.optionsHint': '留空使用默认值。',\n 'editor.apiKey': 'API Key(可选)',\n 'editor.apiKeyHint': '连接保存后,以上面的凭据名称写入 DSH 凭据。',\n 'editor.keyFailed': '连接已保存,但密钥未保存,请在列表中重新设置密钥。',\n\n 'draft.id': 'ID 必须以 custom: 开头,后接字母、数字、点、下划线或连字符。',\n 'draft.duplicate': '此 ID 已被使用。',\n 'draft.label': '请填写名称。',\n 'draft.trust': '请确认信任此地址。',\n 'draft.credentialRef': '凭据名称只能包含字母、数字和下划线,且不能以数字开头。',\n 'draft.endpoint': '请输入完整的 http(s) 地址。',\n 'draft.options': '请修正标红的参数。',\n\n 'reset.button': '恢复默认设置',\n 'reset.hint': '将全部搜索设置恢复为默认值,自定义连接也会被删除;已保存的密钥不受影响。',\n 'reset.confirm': '确定将全部搜索设置恢复为默认值?',\n 'reset.confirmButton': '恢复',\n\n 'option.exa.type': '搜索类型',\n 'option.firecrawl.country': '国家/地区',\n 'option.firecrawl.country.placeholder': '两位代码,如 us',\n 'option.firecrawl.location': '位置',\n 'option.firecrawl.location.placeholder': '如 Shanghai, China',\n 'option.firecrawl.safe': '安全搜索',\n 'option.tavily.search_depth': '搜索深度',\n 'option.tavily.topic': '主题',\n 'option.tinyfish.location': '地区',\n 'option.tinyfish.location.placeholder': '两位代码,如 cn',\n 'option.tinyfish.language': '语言',\n 'option.tinyfish.language.placeholder': '如 zh 或 en-US',\n 'option.tinyfish.purpose': '用途说明',\n 'option.tinyfish.purpose.placeholder': '简述搜索目的',\n 'option.tinyfish.domain_type': '内容类型',\n 'option.openalex.sort': '排序',\n 'option.openalex.sort.placeholder': '如 cited_by_count:desc',\n 'option.openalex.filter': '过滤条件',\n 'option.openalex.filter.placeholder': '如 publication_year:2024',\n 'option.openalex.is_oa': '仅开放获取',\n 'option.openalex.mailto': '联系邮箱(Polite Pool)',\n 'option.openalex.mailto.placeholder': 'you@example.org',\n 'option.semanticscholar.year': '年份',\n 'option.semanticscholar.year.placeholder': '如 2020 或 2018-2024',\n 'option.semanticscholar.fieldsOfStudy': '学科',\n 'option.semanticscholar.fieldsOfStudy.placeholder': '如 Computer Science',\n 'option.semanticscholar.publicationTypes': '出版类型',\n 'option.semanticscholar.publicationTypes.placeholder': '如 JournalArticle,Review',\n\n 'value.auto': '自动',\n 'value.fast': '快速',\n 'value.instant': '即时',\n 'value.basic': '基础',\n 'value.advanced': '深入',\n 'value.ultra-fast': '超快',\n 'value.general': '通用',\n 'value.news': '新闻',\n 'value.finance': '财经',\n 'value.web': '网页',\n 'value.research_paper': '学术论文',\n 'value.low': '低',\n 'value.medium': '中',\n 'value.high': '高',\n\n 'options.invalidLine': '第 {line} 行格式无效',\n 'options.tooMany': '最多 {max} 行',\n 'options.invalidItem': '第 {line} 行(“{item}”)不是域名或域名加路径',\n 'options.exclusive': '请先清空“{other}”:两项只能填一项',\n\n 'connection.sessionModel': '会话模型',\n 'services.sessionModel.summary': '跟随会话模型 · 密钥或登录按会话检查',\n 'services.sessionModel.note': '用会话当前的模型、接口地址与凭据搜索:DeepSeek API Key 或账号,或在模型设置里声明了三种协议之一的路由。查询发送给该模型的服务商,服务端网页搜索按次计费;返回模型的回答与它引用的来源。每项参数只在其分组标题列出的协议上生效。DeepSeek 路由使用 web_search_20250305,除非这里设置了搜索工具版本。',\n 'status.sessionModelReady': '{access} · 查询发送给会话模型的服务商',\n 'status.modelReady': '{access} · 模型搜索 · 查询发送给 {name}',\n 'status.sessionModelNeedsKey': '会话模型的 API Key 未设置',\n 'status.sessionModelNeedsSignIn': '请重新登录 DeepSeek 账号',\n 'status.reason.no-model': '还不知道本会话下一次请求用哪个模型',\n 'status.reason.unknown-route': '无法读取会话模型服务商的设置',\n 'status.reason.protocol': '该路由在模型设置里没有声明支持的 api',\n 'status.reason.endpoint': '该路由在模型设置里没有固定的接口地址',\n 'status.reason.headers': '该路由带自定义请求头,暂不支持',\n 'status.reason.credential': '该路由没有指明唯一的 API Key 名称',\n\n 'model.format': '模型搜索 · {protocol}',\n 'model.id': '模型',\n 'model.idHint': '服务方要求的模型 ID,例如 claude-sonnet-4-5 或 gpt-5-search-api。',\n 'model.endpointHint': '必填:API 的基础地址,示例见上方“服务”的说明。',\n 'model.note': '查询与此连接的密钥会发送到下方的接口地址;服务端网页搜索按次计费。返回模型的回答与它引用的来源。',\n 'model.protocol.anthropic-messages': 'Anthropic 的服务端网页搜索。接口地址如 https://api.anthropic.com(会自动补 /v1)。用于 DeepSeek 时请填写 https://api.deepseek.com/anthropic,并把搜索工具版本设为 web_search_20250305 或 web_search_20260209。',\n 'model.protocol.openai-responses': 'OpenAI 的 web_search 工具。接口地址如 https://api.openai.com/v1(需要写上 /v1)。DeepSeek 只在 deepseek-v4-pro 上执行,且不返回来源。',\n 'model.protocol.openai-chat-completions': '用于 OpenAI 搜索模型(如 gpt-5-search-api)与兼容网关。接口地址如 https://api.openai.com/v1(需要写上 /v1)。DeepSeek 的 Chat Completions 没有服务端网页搜索,DeepSeek 请用 Anthropic Messages。',\n 'draft.model': '请填写模型 ID(不超过 200 个字符,不含控制字符)。',\n\n 'option.model.maxTokens': '最大输出 Token',\n 'option.model.maxTokens.hint': 'Anthropic Messages 缺省 4096;OpenAI 不设时不发送上限,Responses 至少为 16。',\n 'option.model.maxTokens.anthropicHint': '缺省 4096。',\n 'option.model.maxTokens.responsesHint': '不设时不发送上限;至少为 16。',\n 'option.model.maxTokens.chatHint': '不设时不发送上限。',\n 'option.model.anthropicTool': '搜索工具版本',\n 'option.model.anthropicTool.hint': '缺省 web_search_20260318;会话模型跟随 DeepSeek 路由时为 web_search_20250305。DeepSeek 只接受 web_search_20250305 与 web_search_20260209。',\n 'option.model.anthropicTool.fixedHint': '缺省 web_search_20260318。DeepSeek 只接受 web_search_20250305 与 web_search_20260209。',\n 'option.model.maxUses': '单次请求最多搜索次数',\n 'option.model.maxUses.hint': '缺省 5。',\n 'option.model.allowedCallers': '允许的调用方',\n 'option.model.allowedCallers.hint': 'web_search_20260209 及以后的版本缺省经代码执行调用搜索;不支持程序化工具调用的模型要设为 direct,否则请求被拒。',\n 'option.model.responseInclusion': '回复中的搜索结果',\n 'option.model.responseInclusion.hint': '只对 web_search_20260318 及以后的版本生效。选“不包含”时,已被代码执行消费的搜索结果不进回复,也就不进返回的来源;直接搜索的结果总会包含。',\n 'option.model.responsesTool': '搜索工具',\n 'option.model.responsesTool.hint': '缺省 web_search。web_search_preview 是旧版工具:不支持域名过滤与结果 Token 预算,忽略“实时访问网页”。',\n 'option.model.searchContextSize': '搜索上下文大小',\n 'option.model.searchContextSize.hint': '越大收集的上下文越多,费用与延迟也越高。',\n 'option.model.externalWebAccess': '实时访问网页',\n 'option.model.externalWebAccess.hint': '关闭时只用缓存的内容,不实时抓取网页。',\n 'option.model.returnTokenBudget': '结果 Token 预算',\n 'option.model.returnTokenBudget.hint': '只对 GPT-5 及以上的推理搜索生效。',\n 'option.model.allowedDomains': '只搜索这些域名',\n 'option.model.blockedDomains': '排除这些域名',\n 'option.model.domains.placeholder': 'example.com\\ndocs.example.com/api',\n 'option.model.domains.sessionHint': '一行一个,只写域名与可选路径,不写 https://。两项只能二选一。',\n 'option.model.domains.exclusiveHint': '一行一个,只写域名与可选路径,不写 https://。Anthropic Messages 上两项只能二选一。',\n 'option.model.domains.bothHint': '一行一个,只写域名与可选路径,不写 https://。OpenAI Responses 可同时设置两项。',\n 'option.model.userCity': '城市',\n 'option.model.userRegion': '地区',\n 'option.model.userCountry': '国家/地区',\n 'option.model.userCountry.placeholder': '两位代码,如 CN',\n 'option.model.userTimezone': '时区',\n 'option.model.userTimezone.placeholder': '如 Asia/Shanghai',\n 'option.model.location.hint': '用户的大致位置,用于本地化结果。',\n\n 'value.full': '包含',\n 'value.excluded': '不包含',\n 'value.default': '标准',\n 'value.unlimited': '不限',\n\n 'confirm.cancel': '取消',\n}\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Composer search selector, /setup-search, and settings page. */\n 'web-search-enhanced': LocaleKey\n }\n}\n","import { PairingsStatus as CorePairingsStatus } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchConnectionsRemote } from './selection.ts'\nimport type { Translate } from './connections.ts'\nexport class PairingsStatus extends CorePairingsStatus {\n constructor(remote: SearchConnectionsRemote, t: Translate) { super(remote, () => t('pairings.forgetFailed')) }\n}\n","import type { ConfigForm, ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { RouteStatus, clientRoute, type WebSelection } from 'dsh-tool-web-enhanced-core/client'\nimport { WEB_FIELD, type ProviderView } from 'dsh-tool-web-enhanced-core/shared'\nimport type { SearchConnectionsRemote } from './selection.ts'\nexport type { WebSelection } from 'dsh-tool-web-enhanced-core/client'\nexport const searchRoute = (web: ConfigFormSnapshot<WebSelection>, host: ProviderView | undefined) => clientRoute(web, host, WEB_FIELD.search)\nexport class SearchRouteStatus extends RouteStatus {\n constructor(web: ConfigForm<WebSelection>) { super(web, WEB_FIELD.search) }\n override attach(reader: SearchConnectionsRemote): () => void { return super.attach(reader) }\n}\n","import { createElement, useEffect, useState } from 'react'\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport { SegmentedControl } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { useObservable, type ConnectionSection } from 'dsh-tool-web-enhanced-core/client'\nimport { FRESHNESS, type Freshness } from '../catalog.ts'\nimport { describe, freshnessLabel, sourceText, writeFailureText, type Translate } from './connections.ts'\nimport type { SearchSelectionStore } from './selection.ts'\nimport css from './Section.module.css'\n\nexport function searchSection(selection: SearchSelectionStore, settings: ObservableSnapshot<(() => void) | undefined>, remoteServicesOff: ObservableSnapshot<boolean>, t: Translate): ConnectionSection {\n function Options({ sessionId }: { readonly sessionId: string }) {\n const state = useObservable(selection.source(sessionId))\n const [error, setError] = useState('')\n useEffect(() => { void selection.load(sessionId) }, [sessionId])\n const view = state.view\n if (view === undefined || view.selection.connectionId === null) return null\n const selected = view.connections.find(connection => connection.id === view.selection.connectionId)\n if (selected === undefined) return null\n if (!selected.freshness) return createElement('p', { className: css.caption }, t('selector.freshnessIgnored', { name: describe(selected, t).label }))\n const onChange = async (next: Freshness) => {\n const result = await selection.set(sessionId, { options: { freshness: next } })\n setError(result.ok ? '' : writeFailureText(result.error, t))\n }\n return createElement('div', { className: css.container },\n createElement('div', { className: css.label }, t('selector.freshness')),\n createElement(SegmentedControl<Freshness>, {\n id: `search-freshness-${sessionId}`,\n label: t('selector.freshness'),\n value: view.selection.options.freshness,\n disabled: state.saving,\n options: FRESHNESS.map(mode => ({\n value: mode,\n label: freshnessLabel(mode, t),\n })),\n onChange,\n className: css.segmented,\n }),\n error === '' ? null : createElement('p', { role: 'alert', className: css.error }, error))\n }\n return {\n capability: 'search', order: 10, title: () => t('section.title'), selection, settings, remoteServicesOff, Options,\n describe: connection => describe(connection, t),\n sourceText: view => sourceText(view, t),\n writeFailureText: error => writeFailureText(error, t),\n }\n}\n","import type { TypertRemoteNamespace } from '@deepseek-ai/dsh-typert-protocol'\nimport { ConnectionSelectionStore, type SelectionState as CoreSelectionState } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchSelectionView } from '../contract.ts'\nexport type { SelectionUpdate, WriteResult } from 'dsh-tool-web-enhanced-core/client'\nexport type SearchConnectionsRemote = TypertRemoteNamespace<'searchConnections'>\nexport type SelectionState = CoreSelectionState<SearchSelectionView>\nexport class SearchSelectionStore extends ConnectionSelectionStore<SearchSelectionView> {\n constructor(remote: SearchConnectionsRemote, changed: () => void = () => {}) { super(remote, changed) }\n}\n","import { createCredentialEditor } from 'dsh-tool-web-enhanced-core/client'\nimport type { LocaleKey } from '../locales.ts'\nimport css from './Settings.module.css'\nexport type { SaveCredential } from 'dsh-tool-web-enhanced-core/client'\nexport const CredentialEditor = createCredentialEditor<LocaleKey>({ classes: css, keys: {\n 'credential.label': 'credential.label',\n 'credential.set': 'credential.set',\n 'credential.unset': 'credential.unset',\n 'credential.placeholder': 'credential.placeholder',\n 'saving': 'saving',\n 'credential.save': 'credential.save',\n 'credential.saved': 'credential.saved',\n 'credential.failed': 'credential.failed',\n 'credential.hint': 'credential.hint',\n} })\n","/** Read-only facts the settings page derives from the effective settings and the catalog. */\nimport {\n connectionChoices as catalogChoices, connectionName as catalogConnectionName, protocolGroups,\n type ClientTranslate, type Choice, type OptionCopy, type OptionCopyTable, type OptionGroup,\n} from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG, MODEL_PROTOCOLS, type CatalogKey, type ModelProtocol } from '../../catalog.ts'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { Translate } from '../connections.ts'\nimport type { LocaleKey } from '../locales.ts'\n\n/** Catalog names are service names, except the Session-model connection, which is described in the reader's language. */\nexport function localLabel(key: CatalogKey, t: ClientTranslate<LocaleKey>): string {\n return key === 'session-model' ? t('connection.sessionModel') : CATALOG[key].label\n}\n\n/** Connections a default can name, in catalog order. */\nexport const connectionChoices = (config: SearchSettings, t: Translate): Choice[] => catalogChoices(CATALOG, config, key => localLabel(key, t))\n\nexport const connectionName = (id: string, config: SearchSettings, t: ClientTranslate<LocaleKey>): string => catalogConnectionName(CATALOG, config, id, key => localLabel(key, t))\n\n/** Model options; the group title (Conversation model) or the protocol (fixed connection) says where each applies. */\nconst MODEL_COPY = {\n maxTokens: { label: 'option.model.maxTokens', hint: 'option.model.maxTokens.hint' },\n anthropicTool: { label: 'option.model.anthropicTool', hint: 'option.model.anthropicTool.hint' },\n maxUses: { label: 'option.model.maxUses', hint: 'option.model.maxUses.hint' },\n allowedCallers: { label: 'option.model.allowedCallers', hint: 'option.model.allowedCallers.hint' },\n responseInclusion: { label: 'option.model.responseInclusion', hint: 'option.model.responseInclusion.hint' },\n responsesTool: { label: 'option.model.responsesTool', hint: 'option.model.responsesTool.hint' },\n searchContextSize: { label: 'option.model.searchContextSize', hint: 'option.model.searchContextSize.hint' },\n externalWebAccess: { label: 'option.model.externalWebAccess', hint: 'option.model.externalWebAccess.hint' },\n returnTokenBudget: { label: 'option.model.returnTokenBudget', hint: 'option.model.returnTokenBudget.hint' },\n allowedDomains: { label: 'option.model.allowedDomains', placeholder: 'option.model.domains.placeholder', hint: 'option.model.domains.sessionHint' },\n blockedDomains: { label: 'option.model.blockedDomains', placeholder: 'option.model.domains.placeholder', hint: 'option.model.domains.sessionHint' },\n // The location is explained once, on its first field.\n userCity: { label: 'option.model.userCity', hint: 'option.model.location.hint' },\n userRegion: { label: 'option.model.userRegion' },\n userCountry: { label: 'option.model.userCountry', placeholder: 'option.model.userCountry.placeholder' },\n userTimezone: { label: 'option.model.userTimezone', placeholder: 'option.model.userTimezone.placeholder' },\n} as const satisfies Readonly<Record<string, OptionCopy<LocaleKey>>>\n\n/**\n * A fixed connection speaks one protocol, so its hints say only what holds\n * there: that protocol's token default, whether it takes both domain lists,\n * and the tool default without the conversation model's DeepSeek rule.\n */\nconst PROTOCOL_HINTS = {\n 'anthropic-messages': { maxTokens: 'option.model.maxTokens.anthropicHint', domains: 'option.model.domains.exclusiveHint' },\n 'openai-responses': { maxTokens: 'option.model.maxTokens.responsesHint', domains: 'option.model.domains.bothHint' },\n 'openai-chat-completions': { maxTokens: 'option.model.maxTokens.chatHint', domains: 'option.model.domains.bothHint' },\n} as const satisfies Record<ModelProtocol, { readonly maxTokens: LocaleKey; readonly domains: LocaleKey }>\n\n/** Copy for the options of one protocol of a custom model connection. */\nexport function protocolCopy(protocol: ModelProtocol): OptionCopyTable<LocaleKey> {\n const hints = PROTOCOL_HINTS[protocol]\n return { fallback: 'options.title', options: {\n ...MODEL_COPY,\n maxTokens: { ...MODEL_COPY.maxTokens, hint: hints.maxTokens },\n anthropicTool: { ...MODEL_COPY.anthropicTool, hint: 'option.model.anthropicTool.fixedHint' },\n allowedDomains: { ...MODEL_COPY.allowedDomains, hint: hints.domains },\n blockedDomains: { ...MODEL_COPY.blockedDomains, hint: hints.domains },\n } }\n}\n\n/** The Session-model connection takes every protocol's options; grouped by the protocols that apply them. */\nexport const SESSION_MODEL_GROUPS: readonly OptionGroup[] = protocolGroups(MODEL_PROTOCOLS)\n\nconst OPTION_COPY: Readonly<Record<CatalogKey, Readonly<Record<string, OptionCopy<LocaleKey>>>>> = {\n 'deepseek-messages': {\n baseURL: { label: 'option.native.baseURL' },\n model: { label: 'option.native.model' },\n apiVersion: { label: 'option.native.apiVersion' },\n maxTokens: { label: 'option.native.maxTokens' },\n maxUses: { label: 'option.native.maxUses' },\n },\n 'deepseek-search-api': {\n baseURL: { label: 'option.native.baseURL' },\n count: { label: 'option.native.count' },\n sendOriginalQuestion: { label: 'option.native.sendOriginalQuestion' },\n },\n 'session-model': MODEL_COPY,\n exa: {\n type: { label: 'option.exa.type' },\n },\n firecrawl: {\n country: { label: 'option.firecrawl.country', placeholder: 'option.firecrawl.country.placeholder' },\n location: { label: 'option.firecrawl.location', placeholder: 'option.firecrawl.location.placeholder' },\n safe: { label: 'option.firecrawl.safe' },\n },\n tavily: {\n search_depth: { label: 'option.tavily.search_depth' },\n topic: { label: 'option.tavily.topic' },\n },\n tinyfish: {\n location: { label: 'option.tinyfish.location', placeholder: 'option.tinyfish.location.placeholder' },\n language: { label: 'option.tinyfish.language', placeholder: 'option.tinyfish.language.placeholder' },\n purpose: { label: 'option.tinyfish.purpose', placeholder: 'option.tinyfish.purpose.placeholder' },\n domain_type: { label: 'option.tinyfish.domain_type' },\n },\n openalex: {\n sort: { label: 'option.openalex.sort', placeholder: 'option.openalex.sort.placeholder' },\n filter: { label: 'option.openalex.filter', placeholder: 'option.openalex.filter.placeholder' },\n is_oa: { label: 'option.openalex.is_oa' },\n mailto: { label: 'option.openalex.mailto', placeholder: 'option.openalex.mailto.placeholder' },\n },\n semanticscholar: {\n year: { label: 'option.semanticscholar.year', placeholder: 'option.semanticscholar.year.placeholder' },\n fieldsOfStudy: { label: 'option.semanticscholar.fieldsOfStudy', placeholder: 'option.semanticscholar.fieldsOfStudy.placeholder' },\n publicationTypes: { label: 'option.semanticscholar.publicationTypes', placeholder: 'option.semanticscholar.publicationTypes.placeholder' },\n },\n}\n\n/** Copy for the options of one catalog entry. */\nexport const optionCopy = (key: CatalogKey): OptionCopyTable<LocaleKey> => ({ options: OPTION_COPY[key], fallback: 'options.title' })\n\nconst VALUE_LABELS: Readonly<Record<string, LocaleKey>> = {\n 'auto': 'value.auto', 'fast': 'value.fast', 'instant': 'value.instant', 'basic': 'value.basic', 'advanced': 'value.advanced',\n 'ultra-fast': 'value.ultra-fast', 'general': 'value.general', 'news': 'value.news', 'finance': 'value.finance', 'web': 'value.web',\n 'research_paper': 'value.research_paper', 'low': 'value.low', 'medium': 'value.medium', 'high': 'value.high',\n 'full': 'value.full', 'excluded': 'value.excluded', 'default': 'value.default', 'unlimited': 'value.unlimited',\n}\n\n/** Localized enum value where it is a word; codes stay verbatim. */\nexport function valueLabel(value: string, t: ClientTranslate<LocaleKey>): string {\n const key = VALUE_LABELS[value]\n return key === undefined ? value : t(key)\n}\n","import { createSettingsParts, type SettingsDoc as CoreSettingsDoc } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport css from './Settings.module.css'\nexport { classNames, applyOps, SettingsValidationError, type WriteSettings, type WriteState, type SelectOption } from 'dsh-tool-web-enhanced-core/client'\nexport type SettingsDoc = CoreSettingsDoc<SearchSettings>\nexport const settingsParts = createSettingsParts<LocaleKey>({ classes: css, keys: {\n refused: 'settings.refused', invalid: 'settings.invalid', failed: 'settings.failed',\n} })\nexport const { Section, SettingRow, SelectMenu, ErrorText, ConfirmRow, useWrite } = settingsParts\n","import { createOptionsEditor } from 'dsh-tool-web-enhanced-core/client'\nimport type { LocaleKey } from '../locales.ts'\nimport { valueLabel } from './model.ts'\nimport { settingsParts } from './parts.tsx'\nimport css from './Settings.module.css'\nexport const optionsEditor = createOptionsEditor<LocaleKey>({ classes: css, parts: settingsParts, valueLabel,\n keys: { 'options.default': 'options.default', 'options.invalid': 'options.invalid', 'options.invalidLine': 'options.invalidLine', 'options.tooMany': 'options.tooMany', 'options.invalidItem': 'options.invalidItem', 'options.exclusive': 'options.exclusive', 'options.on': 'options.on', 'options.off': 'options.off' },\n})\nexport const { OptionFields, OptionsForm } = optionsEditor\n","import { createSparseSettings } from 'dsh-tool-web-enhanced-core/client'\nimport { CURRENT_SETTINGS_VERSION, SETTINGS_FIELDS } from 'dsh-tool-web-enhanced-core/shared'\nexport type { SettingsLayers, DocumentVersion } from 'dsh-tool-web-enhanced-core/client'\n\nexport const { documentVersion, sparseSettingOperations, resetSettingsOperations } = createSparseSettings({\n version: CURRENT_SETTINGS_VERSION, fields: SETTINGS_FIELDS,\n})\n","import { createCustomConnectionsSection } from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG, DEFAULT_CONNECTION, MODEL_PROTOCOLS, type ModelProtocol } from '../../catalog.ts'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { CredentialEditor } from './CredentialEditor.tsx'\nimport { optionCopy, protocolCopy } from './model.ts'\nimport { optionsEditor } from './OptionsEditor.tsx'\nimport { settingsParts } from './parts.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\n\nexport const CustomConnectionsSection = createCustomConnectionsSection<SearchSettings, typeof CATALOG, LocaleKey, ModelProtocol>({\n classes: css, parts: settingsParts, CredentialEditor, optionsEditor, sparse, catalog: CATALOG, optionCopy, defaultConnection: DEFAULT_CONNECTION,\n protocols: {\n catalog: MODEL_PROTOCOLS,\n optionCopy: protocolCopy,\n notes: {\n 'anthropic-messages': 'model.protocol.anthropic-messages',\n 'openai-responses': 'model.protocol.openai-responses',\n 'openai-chat-completions': 'model.protocol.openai-chat-completions',\n },\n keys: {\n 'model.format': 'model.format',\n 'model.id': 'model.id',\n 'model.idHint': 'model.idHint',\n 'model.endpointHint': 'model.endpointHint',\n 'model.note': 'model.note',\n 'draft.model': 'draft.model',\n },\n },\n keys: {\n 'services.remoteNotice': 'services.remoteNotice',\n 'custom.title': 'custom.title',\n 'custom.addStructured': 'custom.addStructured',\n 'custom.empty': 'custom.empty',\n 'custom.kindStructured': 'custom.kindStructured',\n 'credential.set': 'credential.set',\n 'credential.unset': 'credential.unset',\n 'credential.manage': 'credential.manage',\n 'credential.placeholder': 'credential.placeholder',\n 'custom.edit': 'custom.edit',\n 'custom.remove': 'custom.remove',\n 'services.enable': 'services.enable',\n 'custom.removeConfirm': 'custom.removeConfirm',\n 'confirm.cancel': 'confirm.cancel',\n 'editor.titleNew': 'editor.titleNew',\n 'editor.titleEdit': 'editor.titleEdit',\n 'editor.id': 'editor.id',\n 'editor.idHint': 'editor.idHint',\n 'editor.idPlaceholder': 'editor.idPlaceholder',\n 'editor.label': 'editor.label',\n 'editor.adapter': 'editor.adapter',\n 'editor.endpoint': 'editor.endpoint',\n 'editor.endpointHint': 'editor.endpointHint',\n 'editor.credentialRef': 'editor.credentialRef',\n 'editor.credentialRefHint': 'editor.credentialRefHint',\n 'editor.trust': 'editor.trust',\n 'editor.trustUnnamed': 'editor.trustUnnamed',\n 'editor.save': 'editor.save',\n 'editor.cancel': 'editor.cancel',\n 'editor.stale': 'editor.stale',\n 'editor.optionsHint': 'editor.optionsHint',\n 'editor.apiKey': 'editor.apiKey',\n 'editor.apiKeyHint': 'editor.apiKeyHint',\n 'editor.keyFailed': 'editor.keyFailed',\n 'draft.id': 'draft.id',\n 'draft.duplicate': 'draft.duplicate',\n 'draft.label': 'draft.label',\n 'draft.trust': 'draft.trust',\n 'draft.credentialRef': 'draft.credentialRef',\n 'draft.endpoint': 'draft.endpoint',\n 'draft.options': 'draft.options',\n 'options.title': 'options.title',\n 'saving': 'saving',\n },\n})\n","/** Defaults for new sessions and the composer button switch. */\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { CATALOG, FRESHNESS, honorsFreshness, type CatalogKey, type Freshness } from '../../catalog.ts'\nimport { connectionLabel, freshnessLabel, listText, type Translate } from '../connections.ts'\nimport { connectionChoices } from './model.ts'\nimport { createDefaultsSection, type CredentialStatusMap } from 'dsh-tool-web-enhanced-core/client'\nimport { resolveSettings, type Connection } from '../../settings/resolve.ts'\nimport { credentialRefsOf } from '../credentials.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { settingsParts, SelectMenu, SettingRow, type SettingsDoc, type WriteSettings } from './parts.tsx'\nimport * as sparse from './sparse.ts'\n\nconst BaseDefaultsSection = createDefaultsSection<LocaleKey>({ parts: settingsParts, sparse, keys: {\n title: 'defaults.title', connection: 'defaults.connection', connectionHint: 'defaults.connectionHint',\n connectionUnset: 'defaults.connectionUnset', connectionMissing: 'defaults.connectionMissing',\n} })\n\n/**\n * What the page can tell about the default from local facts: whether it is on\n * and has its key. The Session-model connection's route, and so its\n * credential, is known only per conversation.\n */\nfunction availability(connection: Connection, credentials: CredentialStatusMap, t: Translate) {\n const [ref] = credentialRefsOf(connection)\n const warning = t(connection.disabled ? 'status.disabled' : connection.kind === 'native' ? 'status.needsAccount' : 'status.needsCredential', { name: connectionLabel(connection, t) })\n if (ref === undefined) return { disabled: connection.disabled, access: 'none', credentialStatus: undefined, warning } as const\n return { disabled: connection.disabled, access: connection.kind === 'model' ? 'api-key' : connection.access, credentialStatus: credentials[ref], warning } as const\n}\n\nexport function DefaultsSection({ doc, write, credentials = {}, t }: { doc: SettingsDoc; write: WriteSettings; credentials?: CredentialStatusMap; t: Translate }) {\n const { defaultConnection, showSelector = true } = doc.config\n const freshness = doc.config.defaults?.freshness ?? 'auto'\n const choices = connectionChoices(doc.config, t)\n const resolved = resolveSettings(doc.config)\n const connection = resolved.connections.get(resolved.defaultConnection)\n const defaultAvailability = connection && availability(connection, credentials, t)\n\n const freshnessOptions = FRESHNESS.map(value => ({\n id: value,\n label: freshnessLabel(value, t),\n }))\n\n const freshnessServices = listText((Object.keys(CATALOG) as CatalogKey[])\n .filter(key => CATALOG[key].freshness.length > 0)\n .map(key => {\n const name = CATALOG[key].label\n return honorsFreshness(key, 'api-key') && !honorsFreshness(key, 'keyless')\n ? t('defaults.freshnessKeyOnly', { name })\n : name\n }), t)\n\n return (\n <BaseDefaultsSection doc={doc} write={write} t={t} choices={choices} defaultConnection={defaultConnection} defaultLabel={CATALOG['deepseek-messages'].label} defaultAvailability={defaultAvailability}>\n {({ disabled, save }) => <>\n <SettingRow\n title={t('defaults.freshness')}\n hint={t('defaults.freshnessHint', { services: freshnessServices })}\n >\n <SelectMenu<Freshness>\n label={t('defaults.freshness')}\n value={freshness}\n options={freshnessOptions}\n disabled={disabled}\n onChange={next => { save(['defaults', 'freshness'], next, 'auto') }}\n />\n </SettingRow>\n\n <SettingRow title={t('defaults.showSelector')} hint={t('defaults.showSelectorHint')}>\n <Switch\n checked={showSelector}\n label={t('defaults.showSelector')}\n disabled={disabled}\n onChange={next => { save(['showSelector'], next, true) }}\n />\n </SettingRow>\n\n </>}\n </BaseDefaultsSection>\n )\n}\n","import { createEnhancedToolsSection } from 'dsh-tool-web-enhanced-core/client'\nimport type { LocaleKey } from '../locales.ts'\nimport { settingsParts } from './parts.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\n\nexport const EnhancedToolsSection = createEnhancedToolsSection<LocaleKey>({\n classes: css, parts: settingsParts, sparse,\n keys: { title: 'enhanced.title', description: 'enhanced.description', consent: 'enhanced.consent' },\n})\n","import { createPairingsSection } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { connectionName } from './model.ts'\nimport { settingsParts } from './parts.tsx'\nimport css from './Settings.module.css'\nexport const PairingsSection = createPairingsSection<SearchSettings, LocaleKey>({ classes: css, parts: settingsParts, formatConnectionName: connectionName, keys: {\n 'pairings.forgetFailed': 'pairings.forgetFailed',\n 'pairings.title': 'pairings.title',\n 'pairings.hint': 'pairings.hint',\n 'pairings.failed': 'pairings.failed',\n 'pairings.loading': 'pairings.loading',\n 'pairings.empty': 'pairings.empty',\n 'connection.off': 'connection.off',\n 'saving': 'saving',\n 'pairings.forget': 'pairings.forget',\n} })\n","import { createServicesSection } from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG, type CatalogKey } from '../../catalog.ts'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { CredentialEditor } from './CredentialEditor.tsx'\nimport { localLabel, optionCopy, SESSION_MODEL_GROUPS } from './model.ts'\nimport { optionsEditor } from './OptionsEditor.tsx'\nimport { settingsParts } from './parts.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\nexport const ServicesSection = createServicesSection<SearchSettings, CatalogKey, LocaleKey>({\n classes: css, parts: settingsParts, CredentialEditor, optionsEditor, sparse, catalog: CATALOG, optionCopy, label: localLabel,\n notes: { 'session-model': 'services.sessionModel.note' },\n summaries: { 'session-model': 'services.sessionModel.summary' },\n optionGroups: { 'session-model': SESSION_MODEL_GROUPS },\n keys: {\n 'services.title': 'services.title',\n 'services.optInNotice': 'services.optInNotice',\n 'options.hint': 'options.hint',\n 'options.keylessMore': 'options.keylessMore',\n 'options.invalid': 'options.invalid',\n 'options.default': 'options.default',\n 'services.remoteNotice': 'services.remoteNotice',\n 'services.off': 'services.off',\n 'services.configureLabel': 'services.configureLabel',\n 'services.configure': 'services.configure',\n 'services.enable': 'services.enable',\n 'services.access': 'services.access',\n 'services.accessKeyless': 'services.accessKeyless',\n 'services.accessPersonal': 'services.accessPersonal',\n 'services.accessHint.keyless': 'services.accessHint.keyless',\n 'services.accessHint.apiKey': 'services.accessHint.apiKey',\n 'services.accountHint': 'services.accountHint',\n 'services.getKey': 'services.getKey',\n 'services.trust': 'editor.trustUnnamed',\n 'options.title': 'options.title',\n 'services.keyless': 'services.keyless',\n 'services.account': 'services.account',\n 'services.personalKey': 'services.personalKey',\n 'credential.set': 'credential.set',\n 'credential.unset': 'credential.unset',\n 'credential.reference': 'credential.reference',\n 'credential.referenceHint': 'credential.referenceHint',\n 'services.trustUnsaved': 'services.trustUnsaved',\n },\n})\n","/**\n * The search plugin's row settings page on plugins.row.config.\n * Controls write immediately as sparse operations against the revision the\n * page shows; credentials go to DSH Credentials only.\n */\nimport { StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { createResetSection, createRouteNotice, useSettingsDocument } from 'dsh-tool-web-enhanced-core/client'\nimport { resolveSettings } from '../../settings/resolve.ts'\nimport type { SettingsPageInjected } from '../injected.ts'\nimport type { NS, LocaleKey } from '../locales.ts'\nimport { CustomConnectionsSection } from './CustomConnections.tsx'\nimport { DefaultsSection } from './DefaultsSection.tsx'\nimport { EnhancedToolsSection } from './EnhancedToolsSection.tsx'\nimport { PairingsSection } from './PairingsSection.tsx'\nimport { settingsParts, type SettingsDoc } from './parts.tsx'\nimport { ServicesSection } from './ServicesSection.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\n\nexport type SettingsPageProps =\n & PropsRuntime<'plugins.row.config'>\n & InjectFace<SettingsPageInjected>\n & PropsLocale<typeof NS>\n\nexport function SettingsPage({\n useSettings,\n useCredentials,\n useRoute,\n usePairings,\n readSettings,\n mutate,\n saveCredential,\n forgetPairing,\n t,\n}: SettingsPageProps) {\n const snapshot = useSettings(value => value)\n const credentials = useCredentials(value => value)\n const route = useRoute(value => value)\n const pairings = usePairings(value => value)\n const { view, write, migrationError } = useSettingsDocument(snapshot, readSettings, resolveSettings, mutate)\n\n if (snapshot.status === 'unavailable') return null\n if (snapshot.value === undefined || snapshot.revision === undefined) {\n return <p className={css.status} role=\"status\"><StateDot state=\"ongoing\" />{t('settings.loading')}</p>\n }\n\n if (view === undefined) return null\n const resetDoc = { config: snapshot.value, layers: view.layers, revision: snapshot.revision, editable: snapshot.writable }\n if (view.kind === 'invalid') return <div className={css.page}>\n <p className={css.warning} role=\"alert\" title={view.diagnostic}>{t('settings.unsupported')}</p>\n <ResetSection doc={resetDoc} write={write} t={t} />\n </div>\n const doc: SettingsDoc = { ...resetDoc, config: view.config, editable: snapshot.writable && !view.needsWriteback }\n\n return (\n <div className={css.page}>\n <p className={css.intro}>{t('settings.intro')}</p>\n {view.needsWriteback ? <p className={css.warning} role=\"status\">{t('settings.loading')}</p> : null}\n {snapshot.writable ? null : <p className={css.warning} role=\"status\">{t('settings.readOnly')}</p>}\n {migrationError === undefined ? null : <p className={css.warning} role=\"alert\" title={migrationError}>{t('settings.invalid')}</p>}\n <RouteNotice route={route} t={t} />\n <DefaultsSection doc={doc} write={write} credentials={credentials} t={t} />\n <EnhancedToolsSection doc={doc} write={write} t={t} />\n <ServicesSection doc={doc} write={write} credentials={credentials} saveCredential={saveCredential} t={t} />\n <CustomConnectionsSection doc={doc} write={write} credentials={credentials} saveCredential={saveCredential} t={t} />\n <PairingsSection pairingsState={pairings} config={doc.config} forgetPairing={forgetPairing} t={t} />\n <ResetSection doc={resetDoc} write={write} t={t} />\n </div>\n )\n}\n\nconst RouteNotice = createRouteNotice<LocaleKey>({ classes: css, keys: { unknown: 'route.unknown', auto: 'route.auto', other: 'route.other' },\n other: (route, t) => route.provider === 'deepseek-search-api' ? t('route.deepseekApi', { id: route.providerId }) : undefined,\n})\nconst ResetSection = createResetSection<LocaleKey>({ classes: css, parts: settingsParts, sparse, keys: {\n 'reset.confirm': 'reset.confirm',\n 'reset.confirmButton': 'reset.confirmButton',\n 'confirm.cancel': 'confirm.cancel',\n 'reset.hint': 'reset.hint',\n 'reset.button': 'reset.button',\n} })\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-api-remotes/client'\nimport { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-commands/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport { SEARCH, PROFILE_PACKAGE, WEB_ROW, rowConfigKey } from 'dsh-tool-web-enhanced-core/shared'\nimport { contract } from '../contract.ts'\nimport { followHostCommand, remoteServicesOffSource, withRetiredSecretDiagnostics } from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG } from '../catalog.ts'\nimport { resolveSettings } from '../settings/resolve.ts'\nimport { RETIRED_FIELDS } from '../settings/retired.ts'\nimport type { SearchSettings } from '../settings/types.ts'\nimport { searchCommand } from './command.ts'\nimport { listText } from './connections.ts'\nimport { CredentialStatus } from './credentials.ts'\nimport type { SettingsPageInjected } from './injected.ts'\nimport { en, NS, zh } from './locales.ts'\nimport { PairingsStatus } from './pairings.ts'\nimport { SearchRouteStatus, type WebSelection } from './route.ts'\nimport { searchSection } from './section.ts'\nimport { SearchSelectionStore } from './selection.ts'\nimport { SettingsPage } from './settings/SettingsPage.tsx'\n\n// rc.2 exports the public handle but does not augment its carrier service.\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n connection: ConnectionHandle\n }\n}\n\nexport const inject = ['connection', 'slots', 'locale', 'configForms', 'remote', 'remote.credentials']\n\nexport async function apply(ctx: Context): Promise<void> {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'search: dictionaries')\n const t = ctx.locale.bind(NS)\n const settings = withRetiredSecretDiagnostics(ctx.configForms.get<SearchSettings>(SEARCH.rowId), ctx.configForms.describe(), SEARCH.rowId, RETIRED_FIELDS,\n fields => t('settings.retiredSecret', { fields: listText(fields, t) }))\n const navigationState = createSnapshotStore<{ open: (() => void) | undefined }>({ open: undefined })\n const navigation: ObservableSnapshot<(() => void) | undefined> = {\n getSnapshot: () => navigationState.getSnapshot().open,\n subscribe: listener => navigationState.subscribe(listener),\n }\n ctx.inject(['pluginNavigation'], scope => {\n scope.effect(() => {\n // rc.2 exposes openBundle only; do not inspect private navigation state.\n navigationState.set({ open: () => { scope.pluginNavigation.openBundle(PROFILE_PACKAGE) } })\n return () => { navigationState.set({ open: undefined }) }\n }, 'search: settings link')\n })\n const unmount = await ctx.remote.$mount(contract.remoteInfo)\n ctx.effect(() => unmount, 'search: remote')\n ctx.inject(['remote.searchConnections'], scope => {\n const remote = scope.remote.searchConnections\n const credentials = new CredentialStatus(() => settings.getSnapshot().value, scope.remote.credentials)\n const route = new SearchRouteStatus(scope.configForms.get<WebSelection>(WEB_ROW))\n scope.effect(() => route.attach(remote), 'search: provider facts')\n const pairings = new PairingsStatus(remote, t)\n const selection = new SearchSelectionStore(remote, () => { pairings.invalidate() })\n const page: SettingsPageInjected = {\n hooks: { settings, credentials: credentials.source, route: route.source, pairings: pairings.source },\n readSettings: () => settings.getSnapshot(),\n async mutate(ops, revision) {\n return settings.mutate(ops, revision)\n },\n async saveCredential(ref, value) {\n const result = await scope.remote.credentials.set(ref, value)\n if (!result.ok) throw new Error(t('credential.failed'))\n },\n refreshPairings: () => pairings.refresh(),\n async forgetPairing(provider, model) {\n await pairings.forget(provider, model)\n selection.invalidate()\n },\n }\n scope.effect(() => scope.configForms.whileServed([SEARCH.rowId], () => scope.slots.inject('plugins.row.config', () => scope.slots.register({\n name: 'plugins.row.config', key: rowConfigKey(SEARCH), locale: NS, inject: () => page,\n }, SettingsPage))), 'search: settings page')\n const section = searchSection(selection, navigation, remoteServicesOffSource(settings, CATALOG, resolveSettings), t)\n scope.inject(['webConnections'], ui => {\n ui.effect(() => ui.webConnections.registerRoute('search', route), 'search: route facts')\n ui.effect(() => {\n let unregister: (() => void) | undefined\n const sync = () => {\n const visible = settings.getSnapshot().value?.showSelector !== false\n if (visible && unregister === undefined) unregister = ui.webConnections.register(section)\n if (!visible && unregister !== undefined) {\n unregister()\n unregister = undefined\n }\n }\n const unsubscribe = settings.subscribe(sync)\n sync()\n return () => {\n unsubscribe()\n if (unregister !== undefined) unregister()\n }\n }, 'search: composer section')\n })\n scope.inject(['commandUi'], command => {\n command.effect(() => command.commandUi.decorate(searchCommand(selection, t)), 'search: /setup-search')\n followHostCommand(command, SEARCH.command, sessionId => {\n selection.invalidateSession(sessionId)\n pairings.invalidate()\n })\n })\n const invalidate = () => {\n selection.invalidate()\n credentials.refresh()\n pairings.invalidate()\n route.refresh()\n }\n scope.effect(() => settings.subscribe(invalidate), 'search: row settings')\n scope.effect(() => scope.remote.$on('settings/document-updated', invalidate), 'search: settings updates')\n scope.effect(() => scope.remote.$on('credentials/reference-updated', invalidate), 'search: credential updates')\n scope.inject(['connection'], connected => {\n connected.effect(() => connected.connection.generation.subscribe(invalidate), 'search: connection updates')\n })\n })\n}\n"],"ignoreList":[6],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAa,kBAAkB;EA+B/B,MAAa,SAAyB;GACpC,aAAa;GACb,OAAO;GACP,YAAY;GACZ,OAAO;IAAE,QAAQ;IAAuB,MAAM;GAA4B;GAC1E,SAAS;EACX;;;;;;EAqBA,SAAgB,aAAa,KAA0B;GACrD,OAAO,GAAG,gBAAgB,GAAG,IAAI;EACnC;;;;;ECjEA,SAAgB,WAAW,OAAwB;GACjD,I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IACA,MAAM,aAAa,SAAS,UAAU,UAAU,GAAG,sBAAsB;IACzE,MAAM,aAAa,MAAM,OAAO,IAAI,6BAA6B,UAAU,GAAG,0BAA0B;IACxG,MAAM,aAAa,MAAM,OAAO,IAAI,iCAAiC,UAAU,GAAG,4BAA4B;IAC9G,MAAM,OAAO,CAAC,YAAY,IAAG,cAAa;KACxC,UAAU,aAAa,UAAU,WAAW,WAAW,UAAU,UAAU,GAAG,4BAA4B;IAC5G,CAAC;GACH,CAAC;EACH"}
|
|
1
|
+
{"version":3,"file":"client.cjs","names":["documentVersion","z","z","z","useCallback","useSyncExternalStore","useState","Menu","IconChevronDownOutlineRegular","Button","documentVersion","useMemo","useRef","useState","objectOf","isObject","createSnapshotStore","createSnapshotStore","PairingsStatus","createSnapshotStore","CredentialStatus","createSnapshotStore","documentVersion","inspectDocumentVersion","sparseSettingOperations","resetSettingsOperations","useId","useState","Tag","Input","Button","Input","useState","connectionChoices","connectionName","useId","useState","Input","textOf","Switch","useId","useState","StateDot","Tag","Button","IconChevronDownOutlineRegular","Switch","SegmentedControl","IconRightUpOutlineRegular","useState","StateDot","Button","StateDot","useId","Switch","useState","Button","useId","useState","Input","Checkbox","Button","useState","Button","IconPlusOutlineRegular","StateDot","Tag","Switch","z","CoreCredentialStatus","CorePairingsStatus","useState","createElement","css","SegmentedControl","css","catalogChoices","catalogConnectionName","css","css","css","Switch","css","css","css","css","StateDot","createSnapshotStore"],"sources":["../../core/src/shared/ids.ts","../../core/src/shared/url.ts","../../core/src/shared/connections.ts","../../core/src/shared/route.ts","../../core/src/shared/search.ts","../../core/src/shared/settings.ts","../../../node_modules/.pnpm/@deepseek-ai+dsh-typert-protocol@0.2.2-rc.1_@deepseek-ai+cordis@4.1.0/node_modules/@deepseek-ai/dsh-typert-protocol/lib/types/remote-info.js","../../core/src/shared/selection.ts","../src/catalog.ts","../src/contract.ts","../../core/src/client/use-observable.ts","../../core/src/client/settings/parts.tsx","../../core/src/client/settings/document.ts","../../core/src/client/remote-services.ts","../../core/src/client/command.ts","../../core/src/client/selection.ts","../../core/src/client/route.ts","../../core/src/client/pairings.ts","../../core/src/client/credentials.ts","../../core/src/client/settings/sparse.ts","../../core/src/client/settings/CredentialEditor.tsx","../../core/src/client/settings/fields.ts","../../core/src/client/settings/OptionsEditor.tsx","../../core/src/client/settings/model.ts","../../core/src/client/settings/ServiceFields.tsx","../../core/src/client/settings/ServicesSection.tsx","../../core/src/client/settings/PairingsSection.tsx","../../core/src/client/settings/DefaultsSection.tsx","../../core/src/client/settings/EnhancedToolsSection.tsx","../../core/src/client/settings/ResetSection.tsx","../../core/src/client/settings/RouteNotice.tsx","../../core/src/client/settings/secret-diagnostics.ts","../../core/src/client/settings/connection-form.ts","../../core/src/client/settings/ConnectionEditor.tsx","../../core/src/client/settings/CustomConnections.tsx","../src/settings/retired.ts","../src/settings/resolve.ts","../src/client/connections.ts","../src/client/command.ts","../src/client/credentials.ts","../src/client/locales.ts","../src/client/pairings.ts","../src/client/route.ts","../src/client/section.ts","../src/client/selection.ts","../src/client/settings/CredentialEditor.tsx","../src/client/settings/model.ts","../src/client/settings/parts.tsx","../src/client/settings/OptionsEditor.tsx","../src/client/settings/sparse.ts","../src/client/settings/CustomConnections.tsx","../src/client/settings/DefaultsSection.tsx","../src/client/settings/EnhancedToolsSection.tsx","../src/client/settings/PairingsSection.tsx","../src/client/settings/ServicesSection.tsx","../src/client/settings/SettingsPage.tsx","../src/client/index.tsx"],"sourcesContent":["/**\n * Identities that bind the profile bundle, its rows, and both faces together.\n * The profile's patch writes these ids, the plugins register them, and the\n * browser faces key their slots by them; tests assert all three agree.\n * Nothing here imports Node, the browser, or a Host package.\n */\n\n/** npm name of the profile bundle users install; the Plugins page keys bundle and row pages by it. */\nexport const PROFILE_PACKAGE = 'dsh-tool-web-enhanced-profile'\n\n/** A package the profile mounts as one row. */\nexport interface RowIdentity {\n /** npm package name; the profile bundle depends on it and names it in its row. */\n readonly packageName: string\n /** Row id the profile patch inserts; also the Settings namespace and the Cordis plugin name. */\n readonly rowId: string\n}\n\n/**\n * The two model-facing tools a capability registers while the operator has\n * them turned on and the `web` row routes the capability to this plugin.\n * Model-facing text calls a connection a \"provider\".\n */\nexport interface EnhancedToolNames {\n /** Runs one request on a provider the Agent names. */\n readonly action: string\n /** Lists the providers the Agent may name in this conversation. */\n readonly list: string\n}\n\n/** A row that serves one web capability. */\nexport interface PluginIdentity extends RowIdentity {\n /** Provider id registered in `ctx.web`; the profile writes it into the `web` row. */\n readonly providerId: string\n readonly tools: EnhancedToolNames\n /** Host command, without the slash, that shows or changes the Session's connection. */\n readonly command: string\n}\n\nexport const SEARCH: PluginIdentity = {\n packageName: 'dsh-web-search-enhanced',\n rowId: 'web-search-enhanced',\n providerId: 'search-enhanced',\n tools: { action: 'web_search_enhanced', list: 'list_web_search_providers' },\n command: 'setup-search',\n}\n\nexport const FETCH: PluginIdentity = {\n packageName: 'dsh-web-fetch-enhanced',\n rowId: 'web-fetch-enhanced',\n providerId: 'fetch-enhanced',\n tools: { action: 'web_fetch_enhanced', list: 'list_web_fetch_providers' },\n command: 'setup-fetch',\n}\n\n/** The browser-only row holding the shared composer connection menu. */\nexport const UI: RowIdentity = {\n packageName: 'dsh-tool-web-enhanced-ui',\n rowId: 'tool-web-enhanced-ui',\n}\n\n/**\n * Key of a row's configuration page on the Plugins page (`plugins.row.config`).\n * @param row - the row the page configures.\n * @returns `<profile package>#<row id>`.\n */\nexport function rowConfigKey(row: RowIdentity): string {\n return `${PROFILE_PACKAGE}#${row.rowId}`\n}\n","/** URL shape checks both faces apply to endpoints and to search sources. */\n\n/** Absolute http(s) URL without credentials, query or fragment: what an API endpoint may look like. */\nexport function isEndpoint(value: string): boolean {\n if (!URL.canParse(value)) return false\n const url = new URL(value)\n return (url.protocol === 'https:' || url.protocol === 'http:') && url.username === '' && url.password === '' && url.search === '' && url.hash === ''\n}\n\n/** Longest URL a search source may carry. */\nexport const MAX_SOURCE_URL_LENGTH = 8192\n\n/**\n * A public http(s) URL without user information, as a search source may cite.\n * @returns the raw string and its normalized href, or undefined when the value is not acceptable.\n */\nexport function sourceUrl(value: unknown): { readonly raw: string; readonly href: string } | undefined {\n if (typeof value !== 'string') return undefined\n const raw = value.trim()\n if (raw === '' || raw.length > MAX_SOURCE_URL_LENGTH || !URL.canParse(raw)) return undefined\n const url = new URL(raw)\n if ((url.protocol !== 'http:' && url.protocol !== 'https:') || url.username !== '' || url.password !== '') return undefined\n return { raw, href: url.href }\n}\n","/**\n * The connection grammar both capabilities share: how connections are named,\n * how a catalog entry describes itself, and how operator-supplied options are\n * checked against that description. Pure and isomorphic.\n */\n\nimport { isEndpoint } from './url.ts'\n\n/** Upper bound on any text option; a pattern runs only on text within it. */\nexport const TEXT_MAX_LENGTH = 2000\n\n/** A connection the operator can select: a catalog entry or an operator-defined one. */\nexport type ConnectionId = `builtin:${string}` | `custom:${string}`\n\nexport const BUILTIN_PREFIX = 'builtin:'\nexport const CUSTOM_PREFIX = 'custom:'\n\n/** Operator-defined connection ids: `custom:` plus a short, readable name. */\nexport const CUSTOM_CONNECTION_ID = /^custom:[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/u\n\n/** Catalog connection ids: `builtin:` plus a lower-case, hyphenated catalog key. */\nexport const BUILTIN_CONNECTION_ID = /^builtin:[a-z0-9]{1,50}(?:-[a-z0-9]{1,50}){0,5}$/u\n\n/** Whether a string, such as an untrusted tool argument, has the grammar of a connection id; it may still name nothing. */\nexport const isConnectionId = (value: string): value is ConnectionId => BUILTIN_CONNECTION_ID.test(value) || CUSTOM_CONNECTION_ID.test(value)\n\n/** A DSH Credentials reference, the only form a key is ever stored in. */\nexport const CREDENTIAL_REF = /^[A-Za-z_][A-Za-z0-9_]*$/u\n\n/** Persisted access modes; `account` is derived per call from the Session's model route. */\nexport type AccessMode = 'keyless' | 'api-key'\n\n/** How a call actually authenticates. */\nexport type Access = AccessMode | 'account'\n\n/** The four backend kinds (docs/architecture.md, \"后端种类与执行层\"). */\nexport type BackendKind = 'native' | 'adapter' | 'model' | 'local'\n\n/**\n * One accepted operator option of a connection. `keyless` narrows the option\n * on the anonymous route: omitted accepts it unchanged, `false` rejects it, a\n * list narrows the accepted enum values.\n */\nexport type OptionRule =\n | { readonly kind: 'enum'; readonly values: readonly string[]; readonly keyless?: readonly string[] | false }\n /** Text matching `pattern`; never longer than `maxLength` (default {@link TEXT_MAX_LENGTH}), checked before the pattern runs. */\n | { readonly kind: 'text'; readonly pattern: RegExp; readonly maxLength?: number; readonly keyless?: false }\n /** An absolute http(s) URL without credentials, query or fragment (see `isEndpoint`). */\n | { readonly kind: 'url'; readonly keyless?: false }\n | { readonly kind: 'boolean'; readonly keyless?: false }\n | { readonly kind: 'integer'; readonly min: number; readonly max: number; readonly keyless?: false }\n /** A list of strings, each matching `pattern`; capabilities add semantic checks (CIDR syntax) on top. */\n | { readonly kind: 'list'; readonly pattern: RegExp; readonly max: number }\n\n/** How a catalog entry can be reached. */\nexport interface AccessFacts {\n /** An anonymous route exists; built-in connections then default to it. */\n readonly keyless: boolean\n /** Personal-key access and the DSH Credentials reference it resolves by default. */\n readonly apiKey: { readonly credentialRef: string } | false\n /** A DeepSeek account sign-in can authenticate Sessions on the account route. */\n readonly account: boolean\n}\n\n/**\n * Secret-free catalog facts about one built-in connection. Validation, the\n * settings page, and status views all read it; a capability extends it with\n * its own facts (endpoint, freshness support, …).\n */\nexport interface Descriptor {\n readonly label: string\n readonly homepage?: string\n readonly kind: BackendKind\n /** Whether the query or URL leaves this machine for a third-party service; only drives explanatory text. */\n readonly remote: boolean\n /** A remote service the operator must turn on: the built-in connection starts disabled (docs/design.md, \"连接与目录\"). */\n readonly optIn: boolean\n /** Short English phrase on what the connection is for, shown to the Agent only where it changes the choice. */\n readonly use?: string\n readonly access: AccessFacts\n readonly options: Readonly<Record<string, OptionRule>>\n /** Pairs of options at most one of which may be set. */\n readonly exclusive?: readonly ExclusiveOptions[]\n}\n\n/** Two option names an operator may not set together. */\nexport type ExclusiveOptions = readonly [string, string]\n\n/**\n * A model wire protocol a custom `model` connection may name, with the\n * operator options it accepts; the counterpart of an adapter catalog entry\n * for custom adapter connections.\n */\nexport interface ProtocolDescriptor {\n readonly label: string\n /** Same meaning as {@link Descriptor.use}, for custom connections of this protocol. */\n readonly use?: string\n readonly options: Readonly<Record<string, OptionRule>>\n /** Pairs of options at most one of which may be set. */\n readonly exclusive?: readonly ExclusiveOptions[]\n}\n\nexport const builtinId = (key: string): ConnectionId => `${BUILTIN_PREFIX}${key}`\n\nexport const isBuiltinId = (id: string): boolean => id.startsWith(BUILTIN_PREFIX)\nexport const isCustomId = (id: string): boolean => CUSTOM_CONNECTION_ID.test(id)\n\n/** The catalog key of a built-in connection id, or undefined for any other id. */\nexport function builtinKey(id: string): string | undefined {\n return id.startsWith(BUILTIN_PREFIX) ? id.slice(BUILTIN_PREFIX.length) : undefined\n}\n\n/** The default access of a catalog entry: anonymous when it exists, else a personal key. */\nexport function defaultAccess(access: AccessFacts): AccessMode {\n return access.keyless ? 'keyless' : 'api-key'\n}\n\n/**\n * Check operator options against a descriptor's rules.\n * @param label - connection label used in the problems.\n * @param rules - the descriptor's option rules.\n * @param options - the operator's options.\n * @param access - persisted access mode; keyless may reject or narrow an option.\n * @param exclusive - the descriptor's option pairs that may not both be set.\n * @returns one English problem per invalid option or exclusive pair; empty when all are valid.\n */\nexport function validateOptions(label: string, rules: Readonly<Record<string, OptionRule>>, options: Readonly<Record<string, unknown>>, access: AccessMode, exclusive: readonly ExclusiveOptions[] = []): string[] {\n const invalid = Object.entries(options).flatMap(([key, value]) => {\n const rule = Object.hasOwn(rules, key) ? rules[key] : undefined\n if (rule === undefined) return [`${label} has no option \"${key}\"`]\n if (!accepts(rule, value)) return [`${label} option \"${key}\" has an invalid value`]\n if (access === 'keyless' && !keylessAccepts(rule, value)) return [`${label} option \"${key}\" = ${JSON.stringify(value)} needs API-key access`]\n return []\n })\n const combined = exclusive\n .filter(([first, second]) => Object.hasOwn(options, first) && Object.hasOwn(options, second))\n .map(([first, second]) => `${label} options \"${first}\" and \"${second}\" cannot both be set`)\n return [...invalid, ...combined]\n}\n\nfunction accepts(rule: OptionRule, value: unknown): boolean {\n switch (rule.kind) {\n case 'enum': return typeof value === 'string' && rule.values.includes(value)\n case 'text': return typeof value === 'string' && value.length <= (rule.maxLength ?? TEXT_MAX_LENGTH) && rule.pattern.test(value)\n case 'url': return typeof value === 'string' && value.length <= TEXT_MAX_LENGTH && isEndpoint(value)\n case 'boolean': return typeof value === 'boolean'\n case 'integer': return Number.isInteger(value) && (value as number) >= rule.min && (value as number) <= rule.max\n case 'list': return Array.isArray(value) && value.length <= rule.max && value.every(item => typeof item === 'string' && rule.pattern.test(item))\n }\n}\n\nfunction keylessAccepts(rule: OptionRule, value: unknown): boolean {\n if (!('keyless' in rule) || rule.keyless === undefined) return true\n if (rule.keyless === false) return false\n return rule.keyless.includes(value as string)\n}\n","/**\n * Whether the shared `web` row routes a capability to this plugin, judged the\n * way `WebRuntime` selects: the row's field, else the process environment\n * variable, else auto-selection. The Host reads the row through the public\n * Settings data; the browser reads it through `configForms.get('web')`. When\n * the row cannot be read, the answer is `unknown` and callers treat it as\n * \"not routed\".\n */\n\nexport type Route =\n /** The `web` row is not readable, or the Host has not answered yet. */\n | { readonly kind: 'unknown' }\n | { readonly kind: 'this' }\n /** Nothing pins a provider: `WebRuntime` auto-selects and fails while several are usable. */\n | { readonly kind: 'auto'; readonly providerId: string }\n /** Another provider serves the capability, so this plugin's settings have no effect. */\n | { readonly kind: 'other'; readonly provider: string; readonly providerId: string }\n\n/** The two `web` row fields and the environment variables `WebRuntime` reads instead. */\nexport const WEB_ROW = 'web'\nexport const WEB_FIELD = { search: 'searchProvider', fetch: 'fetchProvider' } as const\nexport const WEB_ENV = { search: 'DSH_WEB_SEARCH_PROVIDER', fetch: 'DSH_WEB_FETCH_PROVIDER' } as const\n\n/**\n * @param row - the `web` row's effective value, or undefined when it cannot be read.\n * @param field - which capability's field to judge.\n * @param envProvider - the process variable of that capability, or null when unset.\n * @param providerId - the id this plugin registered.\n */\nexport function routeOf(row: Readonly<Record<string, unknown>> | undefined, field: string, envProvider: string | null, providerId: string): Route {\n if (row === undefined) return { kind: 'unknown' }\n const configured = row[field]\n // Like `WebRuntime` (`config.searchProvider.get() ?? env`): only an absent field falls back to the variable.\n const pinned = typeof configured === 'string' ? configured : envProvider\n if (pinned === null) return { kind: 'auto', providerId }\n return pinned === providerId ? { kind: 'this' } : { kind: 'other', provider: pinned, providerId }\n}\n\n/** Whether the capability reaches this plugin; `unknown` and `auto` count as not routed. */\nexport const isRouted = (route: Route): boolean => route.kind === 'this'\n","/** Search vocabulary shared by the catalog, settings, browser and the provider wires. */\n\n/** Content-cache preference, not a publication-date filter. */\nexport const FRESHNESS = ['auto', 'fresh', 'realtime'] as const\nexport type Freshness = typeof FRESHNESS[number]\n","import { z } from 'zod'\nimport { builtinId, builtinKey, CREDENTIAL_REF, CUSTOM_CONNECTION_ID, defaultAccess, TEXT_MAX_LENGTH, validateOptions, type AccessMode, type Descriptor, type ProtocolDescriptor } from './connections.ts'\nimport { isEndpoint } from './url.ts'\n\n// Unversioned documents are permanently the first unified grammar, not the latest release.\nexport const UNVERSIONED_SETTINGS_VERSION = 2 as const\nexport const CURRENT_SETTINGS_VERSION = 2 as const\nexport const SETTINGS_RESET_HINT = 'this release does not read 0.1.x settings; remove the field or use Reset on the settings page'\nexport const SETTINGS_FIELDS = ['version', 'defaultConnection', 'showSelector', 'enhancedTools', 'defaults', 'connections'] as const\n\nexport type DocumentVersion =\n | { readonly kind: 'current' }\n | { readonly kind: 'older'; readonly version: number }\n | { readonly kind: 'newer'; readonly version: number }\n | { readonly kind: 'invalid'; readonly reason: string }\n\nexport function documentVersion(document: unknown, currentVersion: number = CURRENT_SETTINGS_VERSION): DocumentVersion {\n if (document === null || typeof document !== 'object' || Array.isArray(document)) return { kind: 'invalid', reason: 'settings must be an object' }\n const storedVersion = (document as Record<string, unknown>).version\n const version = storedVersion === undefined ? UNVERSIONED_SETTINGS_VERSION : storedVersion\n if (version === currentVersion) return { kind: 'current' }\n if (typeof version !== 'number' || !Number.isSafeInteger(version) || version < 1) return { kind: 'invalid', reason: 'settings.version must be a positive integer' }\n return { kind: version < currentVersion ? 'older' : 'newer', version }\n}\n\nexport type SettingsMigration = (document: Readonly<Record<string, unknown>>) => Record<string, unknown>\nexport interface SettingsMigrations {\n readonly currentVersion: number\n readonly steps: ReadonlyMap<number, SettingsMigration>\n}\n// Add only this grammar's future N → N+1 steps; predecessor formats have no steps.\nexport const SETTINGS_MIGRATIONS: SettingsMigrations = { currentVersion: CURRENT_SETTINGS_VERSION, steps: new Map() }\n\n/** Pure upgrade pipeline. Never guesses a predecessor's schema or rewrites its fields. */\nexport function migrateDocument(document: unknown, migrations: SettingsMigrations = SETTINGS_MIGRATIONS): Record<string, unknown> {\n validateDocumentBounds(document)\n const state = documentVersion(document, migrations.currentVersion)\n if (state.kind === 'invalid') throw new Error(state.reason)\n if (state.kind === 'newer') throw new Error('settings.version is newer than supported; upgrade the plugin')\n let result = structuredClone(document) as Record<string, unknown>\n if (state.kind === 'older') {\n for (let version = state.version; version < migrations.currentVersion; version += 1) {\n const migrate = migrations.steps.get(version)\n if (migrate === undefined) throw new Error('settings.version: no migration from version ' + version + '; ' + SETTINGS_RESET_HINT)\n result = { ...migrate(result), version: version + 1 }\n validateDocumentBounds(result)\n }\n }\n return result\n}\n\n/**\n * Operator text shown as one line (a label in menus, error messages and the\n * Agent's provider list): control characters and line or paragraph separators\n * become spaces, runs of whitespace one space, the ends trimmed.\n */\nexport function singleLine(value: string): string {\n return value.replaceAll(/[\\p{Cc}\\p{Zl}\\p{Zp}]/gu, ' ').replaceAll(/\\s+/gu, ' ').trim()\n}\n\nconst text = z.string().trim().min(1).max(TEXT_MAX_LENGTH)\nconst label = z.string().transform(singleLine).pipe(z.string().min(1).max(200))\nconst credentialRef = text.regex(CREDENTIAL_REF, 'must be a credential reference such as EXA_API_KEY')\nconst endpoint = text.refine(isEndpoint, 'must be an absolute http(s) URL without credentials, query or fragment')\nconst options = z.record(z.string(), z.unknown())\n\nexport function documentSchema<S extends z.ZodRawShape>(defaults: z.ZodObject<S>, currentVersion: number = CURRENT_SETTINGS_VERSION) {\n return z.strictObject({\n version: z.literal(currentVersion).optional(),\n defaultConnection: z.string().min(1).max(200).optional(),\n showSelector: z.boolean().optional(),\n enhancedTools: z.boolean().optional(),\n defaults: defaults.optional(),\n connections: z.record(z.string().max(200), z.unknown()).refine(value => Object.keys(value).length <= 200, 'must contain at most 200 connections').optional(),\n })\n}\n\nexport const builtinOverrideSchema = z.strictObject({\n label: label.optional(), disabled: z.boolean().optional(),\n access: z.enum(['keyless', 'api-key']).optional(), credentialRef: credentialRef.optional(),\n trustedEndpoint: z.boolean().optional(), options: options.optional(),\n})\nexport interface BuiltinOverride {\n label?: string\n disabled?: boolean\n access?: AccessMode\n credentialRef?: string\n trustedEndpoint?: boolean\n options?: Record<string, unknown>\n}\n\n/** A persisted operator-defined connection; its grammar is customConnectionSchema, and a test keeps the two identical. */\nexport interface CustomAdapterConnection<A extends string = string> {\n readonly kind: 'adapter'\n readonly adapter: A\n readonly label: string\n readonly credentialRef: string\n readonly endpoint?: string | undefined\n readonly trustedEndpoint?: boolean | undefined\n readonly disabled?: boolean | undefined\n readonly options?: Record<string, unknown> | undefined\n}\n\nexport interface CustomModelConnection<P extends string = string> {\n readonly kind: 'model'\n readonly protocol: P\n readonly model: string\n readonly label: string\n readonly credentialRef: string\n readonly endpoint: string\n readonly trustedEndpoint: true\n readonly disabled?: boolean | undefined\n readonly options?: Record<string, unknown> | undefined\n}\nexport type CustomConnection<A extends string = string, P extends string = string> = CustomAdapterConnection<A> | CustomModelConnection<P>\n\nexport function customConnectionSchema<A extends string, P extends string>(adapterKeys: readonly A[], protocolKeys: readonly P[]) {\n const adapterSchema = z.strictObject({\n kind: z.literal('adapter'), adapter: z.enum(adapterKeys), label, credentialRef,\n endpoint: endpoint.optional(), trustedEndpoint: z.boolean().optional(),\n disabled: z.boolean().optional(), options: options.optional(),\n })\n const modelSchema = z.strictObject({\n kind: z.literal('model'), protocol: z.enum(protocolKeys),\n model: z.string().min(1).max(200).regex(/^[^\\p{Cc}]+$/u, 'must not contain control characters').trim().min(1),\n label, credentialRef, endpoint, trustedEndpoint: z.literal(true),\n disabled: z.boolean().optional(), options: options.optional(),\n })\n if (adapterKeys.length === 0 && protocolKeys.length === 0) return z.never()\n if (adapterKeys.length === 0) return z.discriminatedUnion('kind', [modelSchema])\n if (protocolKeys.length === 0) return z.discriminatedUnion('kind', [adapterSchema])\n return z.discriminatedUnion('kind', [adapterSchema, modelSchema])\n}\n\ninterface CommonConnection {\n readonly id: string\n readonly label: string\n readonly disabled: boolean\n readonly remote: boolean\n readonly trustedEndpoint: boolean\n readonly options: Readonly<Record<string, unknown>>\n readonly catalogKey: string\n}\nexport type ResolvedModel<P extends string = string> =\n | { readonly kind: 'session' }\n | { readonly kind: 'fixed'; readonly protocol: P; readonly model: string; readonly endpoint: string; readonly credentialRef: string }\nexport type ResolvedBase<P extends string = string> = CommonConnection & (\n | { readonly kind: 'local'; readonly access: 'keyless' }\n | { readonly kind: 'model'; readonly route: ResolvedModel<P> }\n | { readonly kind: 'native' | 'adapter'; readonly access: AccessMode; readonly credentialRef: string; readonly endpoint: string }\n)\nexport interface ResolvedDocument<D, C = ResolvedBase> {\n readonly version: number\n readonly defaultConnection: string\n readonly showSelector: boolean\n /** Whether the operator turned on this capability's two enhanced model tools (docs/design.md, \"增强工具\"). */\n readonly enhancedTools: boolean\n readonly defaults: D\n readonly connections: ReadonlyMap<string, C>\n}\nexport type SettingsDescriptor = Descriptor & { readonly endpoint?: string }\n\n/**\n * Where a resolved connection comes from. A built-in connection without a\n * `disabled` override takes the catalog's `optIn` (remote services start off);\n * an operator-defined one starts enabled (docs/design.md, \"远程服务缺省停用\").\n */\ntype ConnectionOrigin =\n | { readonly kind: 'builtin' }\n | { readonly kind: 'custom'; readonly endpoint: string | undefined }\n\n/** Resolve the identical document and connection grammar for Host and browser. */\nexport function resolveDocument<S extends z.ZodRawShape, P extends string = never>({ catalog, document, defaults, capabilityLabel, protocols, retiredFields = [], migrations = SETTINGS_MIGRATIONS }: {\n readonly catalog: Readonly<Record<string, SettingsDescriptor>>\n readonly protocols?: Readonly<Record<P, ProtocolDescriptor>>\n readonly document: unknown\n readonly defaults: { readonly schema: z.ZodObject<S>; readonly defaultConnection: string }\n readonly capabilityLabel: string\n readonly retiredFields?: readonly string[]\n readonly migrations?: SettingsMigrations\n}): ResolvedDocument<z.output<z.ZodObject<S>>, ResolvedBase<P>> {\n const fail = (path: string, message: string): never => { throw new Error('invalid ' + capabilityLabel + ' settings: ' + path + ': ' + message) }\n const parse = <T>(schema: z.ZodType<T>, value: unknown, path: string): T => {\n const result = schema.safeParse(value)\n if (result.success) return result.data\n const issues = result.error.issues.map(issue => {\n const field = [path, ...issue.path.map(String)].join('.')\n const retired = issue.code === 'unrecognized_keys' && path === 'settings' && issue.path.length === 0\n ? issue.keys.filter(key => retiredFields.includes(key)) : []\n const retirement = retired.map(key => key + ' is a 0.1.x setting this release does not read; remove it or use Reset')\n return field + ': ' + [...retirement, issue.message].join('; ') + (issue.code === 'unrecognized_keys' ? '; ' + SETTINGS_RESET_HINT : '')\n })\n return fail(path, issues.join('; '))\n }\n const settings = parse(documentSchema(defaults.schema, migrations.currentVersion), migrateDocument(document, migrations), 'settings')\n const overrides = settings.connections ?? {}\n const adapterKeys = Object.keys(catalog).filter(key => catalog[key]!.kind === 'adapter')\n const protocolKeys = protocols === undefined ? [] : Object.keys(protocols) as P[]\n const customSchema = customConnectionSchema(adapterKeys, protocolKeys)\n const connections = new Map<string, ResolvedBase<P>>()\n const rejectId = (id: string, path: string): never => fail(path, 'unknown connection id \"' + id + '\"; ' + SETTINGS_RESET_HINT)\n const resolve = (id: string, key: string, override: z.infer<typeof builtinOverrideSchema>, origin: ConnectionOrigin): ResolvedBase<P> => {\n const info = catalog[key]!\n const path = 'connections.' + id\n const access = info.kind === 'model' ? 'api-key' : override.access ?? defaultAccess(info.access)\n if (access === 'keyless' && !info.access.keyless) fail(path + '.access', 'no keyless access')\n if (info.kind !== 'model' && access === 'api-key' && !info.access.apiKey) fail(path + '.access', 'no API-key access')\n if (override.credentialRef !== undefined && !info.access.apiKey) fail(path + '.credentialRef', 'this connection does not accept credentials')\n const values = override.options ?? {}\n const problems = validateOptions(info.label, info.options, values, access, info.exclusive)\n if (problems.length > 0) fail(path + '.options', problems.join('; ') + '; ' + SETTINGS_RESET_HINT)\n const trustedEndpoint = override.trustedEndpoint ?? false\n for (const [name, rule] of Object.entries(info.options)) {\n if (rule.kind === 'url' && values[name] !== undefined && values[name] !== info.endpoint && !trustedEndpoint) {\n fail(path + '.trustedEndpoint', 'a non-official ' + name + ' needs trustedEndpoint: true')\n }\n }\n const disabled = override.disabled ?? (origin.kind === 'builtin' ? info.optIn : false)\n const base = { id, catalogKey: key, label: override.label ?? info.label, disabled, remote: info.remote, trustedEndpoint, options: values }\n if (info.kind === 'model') return { ...base, kind: 'model', route: { kind: 'session' } }\n if (info.kind === 'local') return { ...base, kind: 'local', access: 'keyless' }\n if (info.kind !== 'native' && info.kind !== 'adapter') return fail(path + '.kind', 'unsupported catalog kind')\n if (!info.access.apiKey || info.endpoint === undefined) return fail(path, 'remote catalog entry needs credentials and an endpoint')\n const url = origin.kind === 'custom' && origin.endpoint !== undefined ? origin.endpoint : info.endpoint\n if (url !== info.endpoint && !trustedEndpoint) fail(path + '.trustedEndpoint', 'a custom endpoint needs trustedEndpoint: true')\n return { ...base, kind: info.kind, access, credentialRef: override.credentialRef ?? info.access.apiKey.credentialRef, endpoint: url }\n }\n for (const key of Object.keys(catalog)) {\n const id = builtinId(key)\n const raw = overrides[id]\n if (catalog[key]!.kind === 'model' && raw !== null && typeof raw === 'object') {\n for (const field of ['access', 'credentialRef', 'trustedEndpoint']) {\n if (Object.hasOwn(raw, field)) fail('connections.' + id + '.' + field, 'this connection takes its route from the Session model')\n }\n }\n const override = raw === undefined ? {} : parse(builtinOverrideSchema, raw, 'connections.' + id)\n connections.set(id, resolve(id, key, override, { kind: 'builtin' }))\n }\n for (const [id, raw] of Object.entries(overrides)) {\n if (connections.has(id)) continue\n if ((adapterKeys.length === 0 && protocolKeys.length === 0) || !CUSTOM_CONNECTION_ID.test(id) || builtinKey(id) !== undefined) rejectId(id, 'connections.' + id)\n const path = 'connections.' + id\n const custom = parse(customSchema, raw, path)\n if (custom.kind === 'adapter') {\n connections.set(id, resolve(id, custom.adapter, { ...custom, access: 'api-key' }, { kind: 'custom', endpoint: custom.endpoint }))\n } else {\n const info = protocols![custom.protocol]\n const values = custom.options ?? {}\n const problems = validateOptions(info.label, info.options, values, 'api-key', info.exclusive)\n if (problems.length > 0) fail(path + '.options', problems.join('; ') + '; ' + SETTINGS_RESET_HINT)\n connections.set(id, {\n id, catalogKey: custom.protocol, kind: 'model', label: custom.label, disabled: custom.disabled ?? false,\n remote: true, trustedEndpoint: true, options: values,\n route: { kind: 'fixed', protocol: custom.protocol, model: custom.model, endpoint: custom.endpoint, credentialRef: custom.credentialRef },\n })\n }\n }\n const defaultConnection = settings.defaultConnection ?? defaults.defaultConnection\n if (!connections.has(defaultConnection)) rejectId(defaultConnection, 'defaultConnection')\n return { version: migrations.currentVersion, defaultConnection, showSelector: settings.showSelector ?? true, enhancedTools: settings.enhancedTools ?? false, defaults: settings.defaults ?? parse(defaults.schema, {}, 'defaults'), connections }\n}\n\n/** Bound traversal and cloning before parsing even unknown fields. */\nfunction validateDocumentBounds(value: unknown): void {\n const pending = [{ value, path: 'settings', depth: 0 }]\n const visited = new Set<object>()\n let nodes = 1\n while (pending.length > 0) {\n const current = pending.pop()!\n if (typeof current.value === 'string' && current.value.length > TEXT_MAX_LENGTH) throw new Error(current.path + ': text must contain at most ' + TEXT_MAX_LENGTH + ' characters')\n if (current.value === null || typeof current.value !== 'object') continue\n if (current.depth > 20) throw new Error(current.path + ': settings depth exceeds 20')\n if (visited.has(current.value)) continue\n visited.add(current.value)\n if (Array.isArray(current.value) && current.value.length > 200) throw new Error(current.path + ': must contain at most 200 entries')\n let entries = 0\n for (const key in current.value) {\n if (!Object.hasOwn(current.value, key)) continue\n entries += 1\n if (entries > 200) throw new Error(current.path + ': must contain at most 200 entries')\n if (key.length > TEXT_MAX_LENGTH) throw new Error(current.path + ': key must contain at most ' + TEXT_MAX_LENGTH + ' characters')\n const path = current.path + '.' + key\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') throw new Error(path + ': unsafe key; ' + SETTINGS_RESET_HINT)\n nodes += 1\n if (nodes > 100_000) throw new Error('settings: node budget exceeds 100000')\n pending.push({ value: (current.value as Record<string, unknown>)[key], path, depth: current.depth + 1 })\n }\n }\n}\n","/** Lazy assembly of generated Remote definitions using caller-supplied Zod; no runtime imports. */\n/**\n * Retain one generated definition per endpoint without constructing parsers or projections.\n * The class instance builds its shared descriptor/method index on first access;\n * input schemas and JSON Schema projections are cached only when requested.\n * @param spec - compiler-produced method facts and Zod factories.\n * @param zod - the generated artifact's Zod runtime for named-input parsers.\n * @returns a lazy, mountable info instance with no registration or transport effects.\n */\nexport function createTypertRemoteInfo(spec, zod) {\n return new RemoteInfo(spec, zod);\n}\nclass RemoteInfo {\n spec;\n zod;\n index;\n constructor(spec, zod) {\n this.spec = spec;\n this.zod = zod;\n }\n get package() { return this.spec.package; }\n get descriptors() { return this.resolve().descriptors; }\n get methods() { return this.resolve().methods; }\n resolve() {\n if (this.index !== undefined)\n return this.index;\n const zod = this.zod;\n const descriptors = [];\n const methods = Object.create(null);\n for (const [endpoint, definition] of Object.entries(this.spec.methods)) {\n const separator = endpoint.indexOf('/');\n const namespace = endpoint.slice(0, separator);\n const method = endpoint.slice(separator + 1);\n const parameters = definition.parameters.map(parameter => ({ ...parameter, wire: parameter.wire ?? parameter.name }));\n const descriptor = {\n ...definition,\n id: `${this.spec.package}#${endpoint}`,\n namespace,\n method,\n parameters,\n result: definition.result.description === undefined ? definition.result : new ResultValue(definition.result),\n };\n if (definition.invocation.kind === 'direct') {\n const inputs = [];\n const direct = Object.assign(descriptor, {\n input(options) {\n const strict = options?.strict === true;\n return inputs[strict ? 1 : 0] ??= new NamedInput(parameters, strict, zod);\n },\n invoke(remote, input, signal) {\n const named = input;\n const values = parameters.map(parameter => named[parameter.wire]);\n if (definition.cancellation !== undefined)\n values.push(signal);\n // Namespace access retains the Gateway's mount checks and scoped receiver policy.\n const receiver = Reflect.get(remote, namespace);\n const call = Reflect.get(receiver, method);\n return call.apply(receiver, values);\n },\n });\n // The generated namespace return type is selected by this same descriptor's mode.\n methods[endpoint] = direct;\n }\n descriptors.push(descriptor);\n }\n return this.index = { descriptors, methods };\n }\n}\n/**\n * Narrow a Registry descriptor to its generated direct-method capabilities.\n * @param descriptor - a live descriptor, including possible source fallback or Context-only receivers.\n * @returns whether generated named input and direct invocation are available.\n */\nexport function isTypertRemoteMethod(descriptor) {\n return descriptor.invocation.kind === 'direct' && descriptor.result.mode === 'strict'\n && 'input' in descriptor && typeof descriptor.input === 'function'\n && 'invoke' in descriptor && typeof descriptor.invoke === 'function';\n}\nfunction optional(parameter) {\n return parameter.source === 'json' && parameter.acceptsUndefined === true;\n}\nclass NamedInput {\n parameters;\n strict;\n zod;\n schema;\n projection;\n constructor(parameters, strict, zod) {\n this.parameters = parameters;\n this.strict = strict;\n this.zod = zod;\n }\n codec(parameter) {\n return this.strict ? parameter.strictCodec : parameter.codec;\n }\n create = () => this.schema ??= this.zod.strictObject(Object.fromEntries(this.parameters.map((parameter) => {\n const value = this.codec(parameter).create();\n return [parameter.wire, optional(parameter) ? value.optional() : value.nonoptional()];\n })));\n get jsonSchema() { return this.project().jsonSchema; }\n get jsonSchemaError() { return this.project().jsonSchemaError; }\n project() {\n if (this.projection !== undefined)\n return this.projection;\n const unavailable = this.parameters.find(parameter => this.codec(parameter).jsonSchema === undefined);\n if (unavailable !== undefined) {\n return this.projection = { jsonSchemaError: this.codec(unavailable).jsonSchemaError ?? `No JSON Schema for parameter ${unavailable.wire}` };\n }\n return this.projection = {\n jsonSchema: {\n type: 'object',\n properties: Object.fromEntries(this.parameters.map(parameter => [parameter.wire, {\n ...this.codec(parameter).jsonSchema,\n ...(parameter.description === undefined ? {} : { description: parameter.description }),\n }])),\n required: this.parameters.filter(parameter => !optional(parameter)).map(parameter => parameter.wire),\n additionalProperties: false,\n },\n };\n }\n}\nclass ResultValue {\n spec;\n projection;\n constructor(spec) {\n this.spec = spec;\n }\n get mode() { return this.spec.mode; }\n get typeSymbol() { return this.spec.typeSymbol; }\n get create() { return this.spec.create; }\n get decode() { return this.spec.decode; }\n get encode() { return this.spec.encode; }\n get description() { return this.spec.description; }\n get jsonSchemaError() { return this.spec.jsonSchemaError; }\n get jsonSchema() {\n if (this.projection === undefined) {\n const schema = this.spec.jsonSchema;\n this.projection = { value: schema === undefined ? undefined : { ...schema, description: this.spec.description } };\n }\n return this.projection.value;\n }\n}\n//# sourceMappingURL=remote-info.js.map","/**\n * The per-Session selection vocabulary and the `<ns>/get` · `<ns>/set` ·\n * `<ns>/provider` · `<ns>/pairings` · `<ns>/forgetPairing` Remote contract\n * both capabilities expose. A capability instantiates the zod fragments with\n * its own session options schema and connection extras; Host service and\n * browser store then parse the same shapes.\n */\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nimport { createTypertRemoteInfo } from '@deepseek-ai/dsh-typert-protocol/remote-info'\nimport { z } from 'zod'\nimport type { Access, BackendKind } from './connections.ts'\n\n/** What a Session chose: a connection, or `null` for off; revision 0 means it never chose. */\nexport interface Selection<O> {\n readonly connectionId: string | null\n readonly revision: number\n readonly options: O\n}\n\n/** Where the Session's current connection comes from; the UI explains it. */\nexport const SELECTION_SOURCES = ['session', 'inherited', 'model', 'default'] as const\nexport type SelectionSource = typeof SELECTION_SOURCES[number]\n\n/** Model memory: the connection last chosen in a Session of this model; `null` remembers \"off\". */\nexport interface Pairing {\n readonly provider: string\n readonly model: string\n readonly connectionId: string | null\n}\n\n/**\n * Whether a connection can serve this Session, judged from local facts only:\n * `ready` never proves upstream access, quota or health.\n */\nexport const CONNECTION_STATUS = ['ready', 'disabled', 'needs-credential', 'unsupported'] as const\nexport type ConnectionStatus = typeof CONNECTION_STATUS[number]\n\n/**\n * Why a connection that follows the Session model cannot serve its current\n * route: no model yet, a provider without a public route, an undeclared or\n * unsupported protocol, no usable endpoint, custom request headers, or no\n * single credential reference. The browser words each reason.\n */\nexport const UNSUPPORTED_REASONS = ['no-model', 'unknown-route', 'protocol', 'endpoint', 'headers', 'credential'] as const\nexport type UnsupportedReason = typeof UNSUPPORTED_REASONS[number]\n\nconst KINDS = ['native', 'adapter', 'model', 'local'] as const satisfies readonly BackendKind[]\nconst ACCESS = ['keyless', 'api-key', 'account'] as const satisfies readonly Access[]\n\nexport const sessionId = z.string().min(1).max(256)\nexport const connectionId = z.string().min(1).max(128)\n\n/** Fields every connection view carries; a capability adds its own with `extras`. */\nexport const connectionViewBase = z.object({\n id: connectionId,\n label: z.string(),\n kind: z.enum(KINDS),\n /** Whether the query or URL is sent to a third-party service. */\n remote: z.boolean(),\n /** How the next call would authenticate. */\n access: z.enum(ACCESS),\n status: z.enum(CONNECTION_STATUS),\n /** Present exactly when `status` is `unsupported`. */\n reason: z.enum(UNSUPPORTED_REASONS).optional(),\n})\n\nexport const selectionRequest = z.object({ sessionId }).strict()\nexport const providerRequest = z.object({}).strict()\nexport const pairingsRequest = z.object({}).strict()\nexport const forgetPairingRequest = z.object({ provider: z.string().min(1), model: z.string().min(1) }).strict()\n\nexport const pairingView = z.object({ provider: z.string(), model: z.string(), connectionId: z.string().nullable() }).strict()\nexport const pairingsView = z.object({ pairings: z.array(pairingView) }).strict()\n\n/**\n * The two facts the browser cannot see when it judges the route from\n * `configForms.get('web')`: the id this plugin registered and the process\n * variable `WebRuntime` falls back to.\n */\nexport const providerView = z.object({\n providerId: z.string(),\n envProvider: z.string().nullable(),\n}).strict()\n\nexport type SelectionRequest = z.infer<typeof selectionRequest>\nexport type ProviderRequest = z.infer<typeof providerRequest>\nexport type ProviderView = z.infer<typeof providerView>\nexport type PairingsRequest = z.infer<typeof pairingsRequest>\nexport type ForgetPairingRequest = z.infer<typeof forgetPairingRequest>\nexport type PairingsView = z.infer<typeof pairingsView>\n\n/** What a capability hands the contract factory. */\nexport interface SelectionContractSpec<O extends z.ZodRawShape, E extends z.ZodRawShape> {\n /** Remote namespace, e.g. `searchConnections`. */\n readonly namespace: string\n /** npm name of the plugin, recorded in the generated Remote info. */\n readonly packageName: string\n /** Session options shape (search: `{ freshness }`; fetch: `{}`); a change may carry any subset of it. */\n readonly options: O\n /** Capability-specific connection view fields (search: `{ freshness: z.boolean() }`). */\n readonly extras: E\n}\n\n/**\n * Build the zod fragments and the mountable Remote info of one capability.\n * Request and result schemas are strict at both ends.\n */\nexport function selectionContract<O extends z.ZodRawShape, E extends z.ZodRawShape>(spec: SelectionContractSpec<O, E>) {\n const { namespace, packageName } = spec\n const options = z.strictObject(spec.options)\n const optionsChange = options.partial()\n const connectionView = connectionViewBase.extend(spec.extras).strict()\n const selection = z.object({ connectionId: z.string().nullable(), revision: z.number().int().nonnegative(), options }).strict()\n const selectionView = z.object({\n selection,\n source: z.enum(SELECTION_SOURCES),\n connections: z.array(connectionView),\n }).strict()\n const selectionChange = z.object({\n sessionId,\n /** A connection id, or null to turn the capability off for the Session. */\n connectionId: connectionId.nullable().optional(),\n /** Session options to change; omitted fields keep their value. */\n options: optionsChange.optional(),\n /** Revision the caller observed; a stale one fails with `<ns>/conflict`. */\n expectedRevision: z.number().int().nonnegative(),\n }).strict().refine(change => change.connectionId !== undefined || change.options !== undefined, 'a change needs connectionId or options')\n\n const strict = (typeSymbol: string, create: () => z.ZodType) => ({ mode: 'strict', typeSymbol, create }) as const\n const request = (typeSymbol: string, create: () => z.ZodType) => ({ name: 'request', source: 'json', codec: strict(typeSymbol, create), strictCodec: strict(typeSymbol, create) }) as const\n const method = (name: string, parameter: ReturnType<typeof request>, result: ReturnType<typeof strict>) =>\n [`${namespace}/${name}`, { service: namespace, invocation: { kind: 'direct' }, parameters: [parameter], result }] as const\n const Type = (name: string) => `${namespace[0]!.toUpperCase()}${namespace.slice(1)}${name}`\n\n /** Client contribution; mount with `ctx.remote.$mount(remoteInfo)`. */\n const remoteInfo = createTypertRemoteInfo({\n package: packageName,\n methods: Object.fromEntries([\n method('get', request(Type('SelectionRequest'), () => selectionRequest), strict(Type('SelectionView'), () => selectionView)),\n method('set', request(Type('SelectionChange'), () => selectionChange), strict(Type('SelectionView'), () => selectionView)),\n method('provider', request(Type('ProviderRequest'), () => providerRequest), strict(Type('ProviderView'), () => providerView)),\n method('pairings', request(Type('PairingsRequest'), () => pairingsRequest), strict(Type('PairingsView'), () => pairingsView)),\n method('forgetPairing', request(Type('ForgetPairingRequest'), () => forgetPairingRequest), strict(Type('PairingsView'), () => pairingsView)),\n ]),\n }, z)\n\n return { namespace, options, optionsChange, connectionView, selection, selectionView, selectionChange, remoteInfo }\n}\n\nexport type SelectionContract<O extends z.ZodRawShape, E extends z.ZodRawShape> = ReturnType<typeof selectionContract<O, E>>\nexport type ConnectionViewOf<C> = C extends { connectionView: z.ZodType<infer V> } ? V : never\nexport type SelectionViewOf<C> = C extends { selectionView: z.ZodType<infer V> } ? V : never\nexport type SelectionChangeOf<C> = C extends { selectionChange: z.ZodType<infer V> } ? V : never\n\n/**\n * The capability-agnostic views, for code that handles either capability (the\n * ui package). A capability's own types (`SelectionViewOf<typeof contract>`)\n * are assignable to them.\n */\nexport type ConnectionView = z.infer<typeof connectionViewBase> & Readonly<Record<string, unknown>>\nexport interface SelectionView<O extends Record<string, unknown> = Record<string, unknown>> {\n readonly selection: Selection<O>\n readonly source: SelectionSource\n readonly connections: readonly ConnectionView[]\n}\n/** A change as any capability's `<ns>/set` accepts it; the capability's contract narrows `options`. */\nexport interface SelectionChange<O extends Record<string, unknown> = Record<string, unknown>> {\n readonly sessionId: string\n readonly connectionId?: string | null | undefined\n readonly options?: Partial<O> | undefined\n readonly expectedRevision: number\n}\n\n/**\n * The method map a capability merges into `TypertRemoteMap`:\n * `interface TypertRemoteMap extends ConnectionsRemoteMap<'searchConnections', SearchSelectionView> {}`.\n */\nexport type ConnectionsRemoteMap<NS extends string, V, C = SelectionChange> = {\n [K in `${NS}/get`]: (request: SelectionRequest) => Promise<RemoteResult<V>>\n} & {\n [K in `${NS}/set`]: (request: C) => Promise<RemoteResult<V>>\n} & {\n [K in `${NS}/provider`]: (request: ProviderRequest) => Promise<RemoteResult<ProviderView>>\n} & {\n [K in `${NS}/pairings`]: (request: PairingsRequest) => Promise<RemoteResult<PairingsView>>\n} & {\n [K in `${NS}/forgetPairing`]: (request: ForgetPairingRequest) => Promise<RemoteResult<PairingsView>>\n}\n\n/** The error details a capability merges into `RemoteErrorDetailsMap`. */\nexport type ConnectionsRemoteErrors<NS extends string> = {\n /** The row document is invalid; repair it on the settings page. */\n [K in `${NS}/invalid-settings`]: {}\n} & {\n /** The selection changed after the caller read it; re-read and retry. */\n [K in `${NS}/conflict`]: {}\n} & {\n /** The requested connection is missing or disabled. */\n [K in `${NS}/unavailable`]: { readonly connectionId: string }\n}\n","import type { AccessMode, Descriptor, ProtocolDescriptor } from 'dsh-tool-web-enhanced-core/shared'\n\nexport { FRESHNESS, type Freshness } from 'dsh-tool-web-enhanced-core/shared'\n\nexport type SearchDescriptor = Descriptor & { readonly freshness: readonly AccessMode[] } & (\n | { readonly kind: 'native' | 'adapter'; readonly endpoint: string }\n | { readonly kind: 'model' }\n)\n\nconst noControl = /^[\\u0020-\\u{10ffff}]+$/u\nconst nativeAccess = { keyless: false, apiKey: { credentialRef: 'DEEPSEEK_API_KEY' }, account: true } as const\nconst baseURL = { kind: 'url' } as const\n\n/**\n * Model search options. Names are unique across protocols: a custom model\n * connection accepts its protocol's subset, the Session-model connection\n * accepts all of them and applies those of the route it follows. Unset\n * options keep each API's own default; defaults follow the current Anthropic\n * and OpenAI standards, and another vendor's compatibility is the operator's\n * to tune here.\n */\nconst maxTokens = { kind: 'integer', min: 1, max: 128_000 } as const\n/** Anthropic Messages tool versions, newest first. */\nconst anthropicTool = { kind: 'enum', values: ['web_search_20260318', 'web_search_20260209', 'web_search_20250305'] } as const\nconst maxUses = { kind: 'integer', min: 1, max: 50 } as const\n/** `direct` is required by models without programmatic tool calling on web_search_20260209 and later. */\nconst allowedCallers = { kind: 'enum', values: ['direct', 'code_execution_20260120'] } as const\nconst responseInclusion = { kind: 'enum', values: ['full', 'excluded'] } as const\nconst responsesTool = { kind: 'enum', values: ['web_search', 'web_search_preview'] } as const\nconst searchContextSize = { kind: 'enum', values: ['low', 'medium', 'high'] } as const\nconst externalWebAccess = { kind: 'boolean' } as const\nconst returnTokenBudget = { kind: 'enum', values: ['default', 'unlimited'] } as const\n/** A bare domain with an optional path and no scheme, as both vendors document; disjoint classes keep the match linear. */\nconst DOMAIN = /^[A-Za-z0-9.-]{1,253}(?:\\/[\\x21-\\x7e]{1,200})?$/u\nconst allowedDomains = { kind: 'list', pattern: DOMAIN, max: 100 } as const\nconst blockedDomains = { kind: 'list', pattern: DOMAIN, max: 100 } as const\nconst userCity = { kind: 'text', pattern: noControl, maxLength: 200 } as const\nconst userRegion = { kind: 'text', pattern: noControl, maxLength: 200 } as const\nconst userCountry = { kind: 'text', pattern: /^[A-Za-z]{2}$/u } as const\nconst userTimezone = { kind: 'text', pattern: /^[A-Za-z][A-Za-z0-9_+-]*(?:\\/[A-Za-z0-9_+-]+){0,3}$/u, maxLength: 64 } as const\nconst location = { userCity, userRegion, userCountry, userTimezone } as const\n\n/** Wire protocols of `model` connections, in display order; custom model connections name one of these keys. */\nexport const MODEL_PROTOCOLS = {\n 'anthropic-messages': {\n label: 'Anthropic Messages', use: 'the model searches and answers',\n options: { maxTokens, anthropicTool, maxUses, allowedCallers, responseInclusion, allowedDomains, blockedDomains, ...location },\n /** Anthropic takes one domain policy; Responses takes both. */\n exclusive: [['allowedDomains', 'blockedDomains']],\n },\n 'openai-responses': {\n label: 'OpenAI Responses', use: 'the model searches and answers',\n options: { maxTokens, responsesTool, searchContextSize, externalWebAccess, returnTokenBudget, allowedDomains, blockedDomains, ...location },\n },\n 'openai-chat-completions': {\n label: 'OpenAI Chat Completions', use: 'the model searches and answers',\n options: { maxTokens, searchContextSize, ...location },\n },\n} as const satisfies Record<string, ProtocolDescriptor>\nexport type ModelProtocol = keyof typeof MODEL_PROTOCOLS\n\n/** Every protocol's options: the Session-model connection's rules. */\nexport const MODEL_OPTIONS = {\n ...MODEL_PROTOCOLS['anthropic-messages'].options,\n ...MODEL_PROTOCOLS['openai-responses'].options,\n ...MODEL_PROTOCOLS['openai-chat-completions'].options,\n} as const\n\n/**\n * What a request sends when the operator sets nothing. Anthropic requires\n * max_tokens; OpenAI token caps stay unset. Tool versions are each vendor's\n * current standard; DeepSeek's Messages dialect supplies different defaults\n * in model/deepseek.ts, unless the operator explicitly selects a tool version.\n */\nexport const MODEL_DEFAULTS = {\n maxTokens: 4096,\n maxUses: 5,\n anthropicTool: 'web_search_20260318',\n responsesTool: 'web_search',\n} as const\n\n/** Display order and secret-free facts shared by settings, Host and browser. */\nexport const CATALOG = {\n 'deepseek-messages': {\n label: 'DeepSeek Messages', kind: 'native', remote: true, optIn: false, use: 'answers with a summary and sources',\n endpoint: 'https://api.deepseek.com/anthropic/v1', homepage: 'https://platform.deepseek.com',\n access: nativeAccess, freshness: [],\n options: {\n baseURL,\n model: { kind: 'text', pattern: /[\\s\\S]*/u },\n apiVersion: { kind: 'text', pattern: /[\\s\\S]*/u },\n maxTokens: { kind: 'integer', min: 1, max: Number.POSITIVE_INFINITY },\n maxUses: { kind: 'integer', min: 1, max: Number.POSITIVE_INFINITY },\n },\n },\n 'deepseek-search-api': {\n label: 'DeepSeek Search API', kind: 'native', remote: true, optIn: true,\n endpoint: 'https://api.deepseek.com/v1/tools', homepage: 'https://platform.deepseek.com',\n access: nativeAccess, freshness: [],\n options: {\n baseURL,\n count: { kind: 'integer', min: 1, max: 50 },\n sendOriginalQuestion: { kind: 'boolean' },\n },\n },\n 'session-model': {\n label: 'Session model', kind: 'model', remote: true, optIn: false, use: 'the session model searches and answers',\n access: { keyless: false, apiKey: false, account: false }, freshness: [], options: MODEL_OPTIONS,\n // It mostly follows Messages routes, so it keeps the stricter Anthropic rule.\n exclusive: MODEL_PROTOCOLS['anthropic-messages'].exclusive,\n },\n exa: {\n label: 'Exa', endpoint: 'https://api.exa.ai/search', access: { keyless: true, apiKey: { credentialRef: 'EXA_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: ['api-key'], homepage: 'https://exa.ai',\n options: { type: { kind: 'enum', values: ['auto', 'fast', 'instant'], keyless: false } },\n },\n firecrawl: {\n label: 'Firecrawl', endpoint: 'https://api.firecrawl.dev/v2/search', access: { keyless: true, apiKey: { credentialRef: 'FIRECRAWL_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: ['keyless', 'api-key'], homepage: 'https://www.firecrawl.dev',\n options: { country: { kind: 'text', pattern: /^[A-Za-z]{2}$/u }, location: { kind: 'text', pattern: noControl, maxLength: 200 }, safe: { kind: 'boolean' } },\n },\n tavily: {\n label: 'Tavily', endpoint: 'https://api.tavily.com/search', access: { keyless: true, apiKey: { credentialRef: 'TAVILY_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://www.tavily.com',\n options: {\n search_depth: { kind: 'enum', values: ['basic', 'advanced', 'fast', 'ultra-fast'] },\n topic: { kind: 'enum', values: ['general', 'news', 'finance'] },\n },\n },\n tinyfish: {\n label: 'Tinyfish', endpoint: 'https://api.search.tinyfish.ai', access: { keyless: true, apiKey: { credentialRef: 'TINYFISH_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://www.tinyfish.ai',\n options: {\n location: { kind: 'text', pattern: /^[A-Za-z]{2}$/u },\n language: { kind: 'text', pattern: /^[A-Za-z]{2,3}(?:-[A-Za-z]{2,4})?$/u },\n purpose: { kind: 'text', pattern: /^[\\u0020-\\u{10ffff}]+$/u },\n domain_type: { kind: 'enum', values: ['web', 'news', 'research_paper'], keyless: ['web', 'news'] },\n },\n },\n anysearch: {\n label: 'AnySearch', endpoint: 'https://api.anysearch.com/v1/search',\n // The service has an anonymous tier; this plugin offers personal keys only (free accounts exist).\n access: { keyless: false, apiKey: { credentialRef: 'ANYSEARCH_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://www.anysearch.com',\n options: {\n zone: { kind: 'enum', values: ['cn', 'intl'] },\n language: { kind: 'text', pattern: /^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8}){0,2}$/u },\n },\n },\n openalex: {\n label: 'OpenAlex', endpoint: 'https://api.openalex.org/works', access: { keyless: true, apiKey: { credentialRef: 'OPENALEX_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://openalex.org',\n use: 'scholarly works (papers, citations); keyword queries',\n options: {\n sort: { kind: 'text', pattern: /^[a-z_]+:(?:asc|desc)(?:,[a-z_]+:(?:asc|desc))*$/u },\n filter: { kind: 'text', pattern: /^[\\u0020-\\u{10ffff}]+$/u, maxLength: 500 },\n is_oa: { kind: 'boolean' },\n // The core checks length first; @ and dot delimit disjoint, linear segments.\n mailto: { kind: 'text', maxLength: 254, pattern: /^[^\\s@]+@[^\\s@.]+(?:\\.[^\\s@.]+)+$/u },\n },\n },\n semanticscholar: {\n label: 'Semantic Scholar', endpoint: 'https://api.semanticscholar.org/graph/v1/paper/search', access: { keyless: false, apiKey: { credentialRef: 'SEMANTIC_SCHOLAR_API_KEY' }, account: false },\n kind: 'adapter', remote: true, optIn: true, freshness: [], homepage: 'https://www.semanticscholar.org/product/api',\n use: 'academic papers (citations, TL;DR); keyword queries',\n options: {\n year: { kind: 'text', pattern: /^\\d{4}(?:-\\d{4})?$/u },\n fieldsOfStudy: { kind: 'text', pattern: /^[A-Za-z ,]+$/u, maxLength: 100 },\n publicationTypes: { kind: 'text', pattern: /^[A-Za-z,]+$/u, maxLength: 100 },\n },\n },\n} as const satisfies Record<string, SearchDescriptor>\n\nexport type CatalogKey = keyof typeof CATALOG\nexport const NATIVE_KEYS = ['deepseek-messages', 'deepseek-search-api'] as const satisfies readonly CatalogKey[]\nexport const ADAPTER_KEYS = ['exa', 'firecrawl', 'tavily', 'tinyfish', 'anysearch', 'openalex', 'semanticscholar'] as const satisfies readonly CatalogKey[]\nexport const MODEL_KEYS = ['session-model'] as const satisfies readonly CatalogKey[]\nexport type AdapterKey = typeof ADAPTER_KEYS[number]\nexport const isCatalogKey = (value: unknown): value is CatalogKey => typeof value === 'string' && Object.hasOwn(CATALOG, value)\n\nexport function honorsFreshness(key: CatalogKey, access: AccessMode): boolean {\n const modes: readonly AccessMode[] = CATALOG[key].freshness\n return modes.includes(access)\n}\n\nexport const DEFAULT_CONNECTION = 'builtin:deepseek-messages'\n","import type { TypertRemoteNamespace } from '@deepseek-ai/dsh-typert-protocol'\nimport { SEARCH, selectionContract, type ConnectionsRemoteErrors, type ConnectionsRemoteMap } from 'dsh-tool-web-enhanced-core/shared'\nimport { z } from 'zod'\nimport { FRESHNESS } from './catalog.ts'\n\nexport const contract = selectionContract({\n namespace: 'searchConnections', packageName: SEARCH.packageName,\n options: { freshness: z.enum(FRESHNESS) },\n extras: { freshness: z.boolean() },\n})\n/** The Session options schema; `contract.optionsChange` accepts any subset of it. */\nexport const searchOptions = contract.options\n\nexport type SearchConnectionView = z.infer<typeof contract.connectionView>\nexport type SearchSelectionView = z.infer<typeof contract.selectionView>\nexport type SearchSelectionChange = z.infer<typeof contract.selectionChange>\n\ndeclare module '@deepseek-ai/dsh-typert-protocol' {\n interface TypertRemoteMap extends ConnectionsRemoteMap<'searchConnections', SearchSelectionView, SearchSelectionChange> {}\n interface TypertRemoteNamespaceMap {\n searchConnections: TypertRemoteNamespace<'searchConnections'>\n }\n interface RemoteErrorDetailsMap extends ConnectionsRemoteErrors<'searchConnections'> {}\n}\n","import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport { useCallback, useSyncExternalStore } from 'react'\n\n/**\n * Read an observable snapshot in a component. The subscribe and getSnapshot\n * callbacks are stable per source, so React subscribes once per source rather\n * than once per render; a source that publishes on subscription would\n * otherwise re-render and re-subscribe without end.\n */\nexport function useObservable<T>(source: ObservableSnapshot<T>): T {\n const subscribe = useCallback((listener: () => void) => source.subscribe(listener), [source])\n const getSnapshot = useCallback(() => source.getSnapshot(), [source])\n return useSyncExternalStore(subscribe, getSnapshot)\n}\n","/** Building blocks shared by the settings sections. */\nimport { useState, type ReactNode } from 'react'\nimport { Button, IconChevronDownOutlineRegular, Menu } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsLayers } from './sparse.ts'\nexport type SettingsClasses = Readonly<Record<string, string>>\n\nexport function classNames(...args: unknown[]): string {\n return args\n .flat(Number.POSITIVE_INFINITY)\n .filter(Boolean)\n .map(arg => {\n if (typeof arg === 'string') return arg\n if (typeof arg === 'object' && arg !== null) {\n return Object.entries(arg)\n .filter(([, v]) => Boolean(v))\n .map(([k]) => k)\n .join(' ')\n }\n return ''\n })\n .filter(Boolean)\n .join(' ')\n}\n\n/** The accepted document a section edits. */\nexport interface SettingsDoc<S = unknown> {\n readonly config: S\n readonly layers: SettingsLayers\n readonly revision: number\n /** Writable and in the current schema version. */\n readonly editable: boolean\n}\n\n/**\n * Operations computed from the layers they will apply to: the page runs it\n * once the writes before it have settled, on the document they left.\n */\nexport type SettingsChange = (layers: SettingsLayers) => readonly SettingsPathOpView[]\n\n/**\n * Submit a change after the page's earlier writes; resolves whether the Host\n * accepted it. Operations are fenced by a revision (default: the one the page\n * shows), so a form that edited what it displayed is refused once that changed;\n * a {@link SettingsChange} is fenced by the revision it was computed on. No\n * operations is a no-op success.\n */\nexport type WriteSettings = (change: readonly SettingsPathOpView[] | SettingsChange, revision?: number) => Promise<boolean>\n\n/** A local schema failure whose diagnostic stays out of the translated message. */\nexport class SettingsValidationError extends Error {}\n\nexport interface WriteState {\n readonly busy: boolean\n readonly error: string | undefined\n readonly errorTitle: string | undefined\n /** Run one write, recording a refusal or a transport failure as this section's error. */\n run(work: () => Promise<boolean>): Promise<boolean>\n}\n\nexport interface SelectOption<T extends string = string> { readonly id: T; readonly label: string }\n\nexport function createSettingsParts<K extends string>({ classes: css, keys }: {\n classes: SettingsClasses\n keys: Readonly<Record<'refused' | 'invalid' | 'failed', K>>\n}) {\n /** `titleId` lets a control inside name itself by the section title. */\n function Section({ title, titleId, actions, children }: { title: string; titleId?: string | undefined; actions?: ReactNode; children: ReactNode }) {\n return (\n <section className={css.section}>\n <div className={css.sectionHead}>\n <h4 id={titleId} className={css.sectionTitle}>{title}</h4>\n {actions}\n </div>\n {children}\n </section>\n )\n }\n \n /** Title and hint on the left, one control on the right; wraps under the text on narrow pages. */\n function SettingRow({ title, hint, children }: { title: string; hint: ReactNode; children: ReactNode }) {\n return (\n <div className={css.settingRow}>\n <div className={css.settingText}>\n <div className={css.settingTitle}>{title}</div>\n <div className={css.hint}>{hint}</div>\n </div>\n <div className={css.settingControl}>{children}</div>\n </div>\n )\n }\n \n \n \n /** A dropdown in the settings pill style, built on the shared Menu. */\n function SelectMenu<T extends string = string>({ label, title, value, options, disabled, onChange, compact = false }: {\n label: string\n /** Hover text, e.g. the upstream name of an option. */\n title?: string\n value: T\n options: readonly SelectOption<T>[]\n disabled: boolean\n onChange: (id: T) => void\n compact?: boolean\n }) {\n const [open, setOpen] = useState(false)\n const current = options.find(option => option.id === value)\n return (\n <Menu\n open={open}\n onClose={() => { setOpen(false) }}\n items={options.map(option => ({ id: option.id, label: option.label }))}\n selectedId={value}\n onSelect={(id) => {\n setOpen(false)\n if (id !== value) onChange(id as T)\n }}\n align=\"end\"\n portal\n anchor={(\n <button\n type=\"button\"\n className={compact ? css.selectCompact : css.select}\n aria-label={label}\n title={title}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n disabled={disabled}\n onClick={() => { setOpen(!open) }}\n >\n <span className={css.selectValue}>{current?.label ?? value}</span>\n <IconChevronDownOutlineRegular className={css.selectChevron} />\n </button>\n )}\n />\n )\n }\n \n /** Pending state and the last failure of one section's writes. */\n function useWrite(t: ClientTranslate<K>): WriteState {\n const [state, setState] = useState<{ busy: boolean; error: string | undefined; errorTitle: string | undefined }>({ busy: false, error: undefined, errorTitle: undefined })\n const run = async (work: () => Promise<boolean>): Promise<boolean> => {\n setState({ busy: true, error: undefined, errorTitle: undefined })\n try {\n const accepted = await work()\n setState({ busy: false, error: accepted ? undefined : t(keys.refused), errorTitle: undefined })\n return accepted\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n const invalid = error instanceof SettingsValidationError\n setState({\n busy: false,\n error: invalid ? t(keys.invalid) : message || t(keys.failed),\n errorTitle: invalid ? message : undefined,\n })\n return false\n }\n }\n return { ...state, run }\n }\n \n function ErrorText({ children, title }: { children: string | undefined; title?: string | undefined }) {\n return children === undefined ? null : <p className={css.error} role=\"alert\" title={title}>{children}</p>\n }\n \n /** Inline confirmation of a destructive action: the question beside cancel and confirm. */\n function ConfirmRow({ message, confirmLabel, cancelLabel, disabled, onConfirm, onCancel }: {\n message: string\n confirmLabel: string\n cancelLabel: string\n disabled: boolean\n onConfirm: () => void\n onCancel: () => void\n }) {\n return (\n <div className={css.confirmRow} role=\"group\" aria-label={message}>\n <span className={css.confirmText}>{message}</span>\n <div className={css.actions}>\n <Button variant=\"ghost\" size=\"sm\" onClick={onCancel}>{cancelLabel}</Button>\n <Button variant=\"outline\" size=\"sm\" className={css.danger} disabled={disabled} onClick={onConfirm}>{confirmLabel}</Button>\n </div>\n </div>\n )\n }\n \n \n return { Section, SettingRow, SelectMenu, ErrorText, ConfirmRow, useWrite }\n}\nexport type SettingsParts<K extends string> = ReturnType<typeof createSettingsParts<K>>\n\nexport function applyOps(user: unknown, ops: readonly SettingsPathOpView[]): Record<string, unknown> {\n const root = structuredClone(user !== null && typeof user === 'object' && !Array.isArray(user) ? user as Record<string, unknown> : {})\n for (const op of ops) {\n if (op.path.length === 0) continue\n if (op.op === 'set') {\n let current: Record<string, unknown> = root\n for (let i = 0; i < op.path.length - 1; i++) {\n const seg = op.path[i]!\n if (current[seg] === null || typeof current[seg] !== 'object' || Array.isArray(current[seg])) {\n current[seg] = {}\n }\n current = current[seg] as Record<string, unknown>\n }\n current[op.path.at(-1)!] = structuredClone(op.value)\n } else if (op.op === 'unset') {\n let current: Record<string, unknown> = root\n for (let i = 0; i < op.path.length - 1; i++) {\n const seg = op.path[i]!\n if (current[seg] === null || typeof current[seg] !== 'object' || Array.isArray(current[seg])) {\n break\n }\n current = current[seg] as Record<string, unknown>\n }\n delete current[op.path.at(-1)!]\n }\n }\n return root\n}\n","import { useEffect, useMemo, useRef, useState } from 'react'\nimport type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client'\nimport type { SettingsDocumentSnapshot } from './secret-diagnostics.ts'\nimport { CURRENT_SETTINGS_VERSION, SETTINGS_MIGRATIONS, documentVersion, migrateDocument, type SettingsMigrations } from '../../shared/settings.ts'\nimport { applyOps, SettingsValidationError, type WriteSettings } from './parts.tsx'\nimport type { SettingsLayers } from './sparse.ts'\n\ntype Document = Record<string, unknown>\ntype ResolveSettings = (document: unknown) => unknown\ntype Mutate = (operations: SettingsPathOpView[], revision: number) => Promise<boolean>\n\nexport type SettingsDocumentView<S> =\n | { readonly kind: 'ready'; readonly config: S; readonly layers: SettingsLayers; readonly needsWriteback: boolean }\n | { readonly kind: 'invalid'; readonly diagnostic: string; readonly layers: SettingsLayers; readonly needsWriteback: false }\n\n/** ConfigForm.value is schema-projected; the raw layers retain unknown fields for validation. */\nexport function effectiveDocument(snapshot: SettingsLayers): Document {\n return merge(snapshot.base, snapshot.user)\n}\n\n/** Validate before exposing normal editors; only successful older migrations need writeback. */\nexport function editableSettings<S>(raw: unknown, layers: SettingsLayers, writable: boolean, resolve: ResolveSettings, migrations: SettingsMigrations = SETTINGS_MIGRATIONS): SettingsDocumentView<S> {\n try {\n const version = documentVersion(raw, migrations.currentVersion)\n const config = migrateDocument(raw, migrations)\n resolve(config)\n return { kind: 'ready', config: config as S, layers, needsWriteback: writable && version.kind === 'older' }\n } catch (error) {\n return { kind: 'invalid', diagnostic: diagnostic(error), layers, needsWriteback: false }\n }\n}\n\n/** Check the exact recursively overlaid candidate that the settings store will persist. */\nexport function settingsOperations(layers: SettingsLayers, operations: readonly SettingsPathOpView[], resolve: ResolveSettings): SettingsPathOpView[] {\n try {\n const candidate = effectiveDocument({ base: layers.base, user: applyOps(layers.user, operations) })\n const result = [...operations]\n if (result.some(op => op.op === 'set') && candidate.version === undefined) {\n result.push({ op: 'set', path: ['version'], value: CURRENT_SETTINGS_VERSION })\n candidate.version = CURRENT_SETTINGS_VERSION\n }\n resolve(candidate)\n return result\n } catch (error) {\n throw new SettingsValidationError(diagnostic(error))\n }\n}\n\n/**\n * Share validation, revision fencing and automatic future migrations between both pages.\n * @param snapshot - the settings snapshot the page renders.\n * @param read - the settings snapshot now, which a write the form accepted has already updated.\n */\nexport function useSettingsDocument<S>(snapshot: SettingsDocumentSnapshot<S>, read: () => SettingsDocumentSnapshot<S>, resolve: ResolveSettings, mutate: Mutate, migrations: SettingsMigrations = SETTINGS_MIGRATIONS) {\n const view = useMemo((): SettingsDocumentView<S> | undefined => {\n if (snapshot.status === 'unavailable' || snapshot.value === undefined || snapshot.revision === undefined) return undefined\n const result = editableSettings<S>(effectiveDocument(snapshot), { base: snapshot.base, user: snapshot.user }, snapshot.writable, resolve, migrations)\n if (snapshot.diagnostic === undefined) return result\n return { kind: 'invalid', layers: result.layers, needsWriteback: false,\n diagnostic: result.kind === 'invalid' ? result.diagnostic + '; ' + snapshot.diagnostic : snapshot.diagnostic }\n }, [snapshot, resolve, migrations])\n const attemptedRevision = useRef<number | undefined>(undefined)\n const [failure, setFailure] = useState<{ revision: number; diagnostic: string }>()\n const revision = snapshot.revision\n\n useEffect(() => {\n if (view?.kind !== 'ready' || !view.needsWriteback || revision === undefined || attemptedRevision.current === revision) return\n attemptedRevision.current = revision\n const writeback = async () => {\n try {\n const operations = replaceDocumentOperations(view.layers.user, view.config as Document)\n await mutate(settingsOperations(view.layers, operations, resolve), revision)\n } catch (error) {\n setFailure({ revision, diagnostic: diagnostic(error) })\n }\n }\n void writeback()\n }, [view, revision, resolve, mutate])\n\n // Sections write independently; one at a time, each on what the one before it left.\n const queue = useRef<Promise<unknown>>(Promise.resolve())\n const submit = async (change: Parameters<WriteSettings>[0], displayedRevision: number | undefined): Promise<boolean> => {\n if (typeof change !== 'function') {\n if (change.length === 0) return true\n if (view === undefined || !snapshot.writable || displayedRevision === undefined) return false\n return mutate(settingsOperations(view.layers, change, resolve), displayedRevision)\n }\n const current = read()\n if (current.status !== 'ready' || !current.writable || current.revision === undefined) return false\n const layers = { base: current.base, user: current.user }\n const operations = change(layers)\n if (operations.length === 0) return true\n return mutate(settingsOperations(layers, operations, resolve), current.revision)\n }\n const write: WriteSettings = (change, expectedRevision = revision) => {\n const task = queue.current.then(() => submit(change, expectedRevision))\n queue.current = task.then(() => {}, () => {})\n return task\n }\n return { view, write, migrationError: failure?.revision === revision ? failure?.diagnostic : undefined }\n}\n\nfunction replaceDocumentOperations(user: unknown, document: Document): SettingsPathOpView[] {\n const operations: SettingsPathOpView[] = Object.keys(objectOf(user))\n .filter(key => !Object.hasOwn(document, key))\n .map(key => ({ op: 'unset', path: [key] }))\n for (const [key, value] of Object.entries(document)) {\n operations.push({ op: 'set', path: [key], value: value as Extract<SettingsPathOpView, { op: 'set' }>['value'] })\n }\n return operations\n}\n\nfunction diagnostic(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction isObject(value: unknown): value is Document {\n return value !== null && typeof value === 'object' && !Array.isArray(value)\n}\n\nfunction objectOf(value: unknown): Document {\n return isObject(value) ? value : {}\n}\n\nfunction merge(base: unknown, user: unknown): Document {\n const result = { ...objectOf(base) }\n for (const [key, value] of Object.entries(objectOf(user))) {\n Object.defineProperty(result, key, { value: isObject(value) && isObject(result[key]) ? merge(result[key], value) : value, enumerable: true, writable: true, configurable: true })\n }\n return result\n}\n","/**\n * The composer menu's \"more services in settings\" fact, derived from the row\n * settings by the same resolution the Host uses (docs/design.md, \"远程服务缺省停用\").\n */\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { builtinId, type Descriptor } from '../shared/connections.ts'\nimport { effectiveDocument, editableSettings } from './settings/document.ts'\n\n/** What the fact reads of a resolved document. */\nexport interface ResolvedConnections {\n readonly connections: ReadonlyMap<string, { readonly disabled: boolean }>\n}\n\n/** Whether the catalog has remote services and every one of them is off. */\nexport function remoteServicesOff(catalog: Readonly<Record<string, Descriptor>>, resolved: ResolvedConnections): boolean {\n const remote = Object.keys(catalog).filter(key => catalog[key]!.optIn)\n return remote.length > 0 && remote.every(key => resolved.connections.get(builtinId(key))!.disabled)\n}\n\n/** The fact for the current row settings, recomputed only when the settings snapshot changes. */\nexport function remoteServicesOffSource<S>(settings: ObservableSnapshot<ConfigFormSnapshot<S>>, catalog: Readonly<Record<string, Descriptor>>, resolve: (document: unknown) => ResolvedConnections): ObservableSnapshot<boolean> {\n let cached: { readonly source: ConfigFormSnapshot<S>; readonly off: boolean } | undefined\n const compute = (source: ConfigFormSnapshot<S>): boolean => {\n if (source.value === undefined) return false\n const view = editableSettings(effectiveDocument(source), source, false, resolve)\n return view.kind === 'ready' && remoteServicesOff(catalog, resolve(view.config))\n }\n return {\n getSnapshot() {\n const source = settings.getSnapshot()\n if (cached === undefined || cached.source !== source) cached = { source, off: compute(source) }\n return cached.off\n },\n subscribe: listener => settings.subscribe(listener),\n }\n}\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { CommandDecoration, SelectOption, SelectOptionGroup } from '@deepseek-ai/dsh-client-ui-commands/client'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-typert-protocol'\nimport type { SelectionView } from '../shared/selection.ts'\nimport type { ConnectionText, SelectionState, SelectionStore, SelectionUpdate } from './section.ts'\n\nexport type ClientTranslate<K extends string = string> = (key: K, params?: Record<string, string | number>) => string\nexport type CommandCopyKey = 'placeholder' | 'empty' | 'noResults' | 'readFailed' | 'current' | 'off'\nexport type CommandDetail = (hint: string | undefined, current: boolean) => { detail?: string }\n\nexport interface CommandOptions<V extends SelectionView> {\n choices(view: V, detail: CommandDetail): readonly SelectOption[]\n parse(id: string): SelectionUpdate | undefined\n isCurrent(update: SelectionUpdate, selection: V['selection']): boolean\n}\n\nexport interface SelectionCommandSpec<V extends SelectionView, K extends string> {\n /** The capability's Host command (`PluginIdentity.command`). */\n readonly name: string\n readonly t: ClientTranslate<K>\n readonly keys: Readonly<Record<CommandCopyKey, K>>\n readonly groups: (view: V) => readonly { group: SelectOptionGroup; connections: readonly V['connections'][number][] }[]\n readonly describe: (connection: V['connections'][number]) => ConnectionText\n readonly writeFailureText: (error: RemoteFailure) => string\n readonly options?: CommandOptions<V>\n}\n\n/** Shared ids cannot be shadowed by capability-specific option groups. */\nexport function parseSelectionCommandOption(id: string, parseOptions?: (id: string) => SelectionUpdate | undefined): SelectionUpdate | undefined {\n if (id === 'off') return { connectionId: null }\n const prefix = 'connection:'\n if (id.startsWith(prefix) && id.length > prefix.length) return { connectionId: id.slice(prefix.length) }\n return parseOptions?.(id)\n}\n\n/**\n * The browser's bare invocation of the capability's Host command: a popup over\n * the same per-session store the composer menu uses. The Host command keeps its\n * menu row and runs every line with arguments.\n */\nexport function selectionCommand<V extends SelectionView, K extends string>(\n selections: SelectionStore<V> & { current(sessionId: string): Promise<SelectionState<V>> },\n spec: SelectionCommandSpec<V, K>,\n): CommandDecoration {\n const t = (key: CommandCopyKey) => spec.t(spec.keys[key])\n const read = async (sessionId: string) => {\n const { view, readFailure } = await selections.current(sessionId)\n if (view === undefined || readFailure !== undefined) throw new Error(t('readFailed'))\n return view\n }\n return {\n name: spec.name,\n available: () => true,\n ui: {\n kind: 'popupSelect',\n searchLabels: () => ({ placeholder: t('placeholder'), empty: t('empty'), noResults: t('noResults') }),\n async options(session) {\n const view = await read(session.sessionId)\n const { connectionId } = view.selection\n const detail: CommandDetail = (hint, current) => {\n const text = [hint, current ? t('current') : undefined].filter(part => part !== undefined).join(' · ')\n return text === '' ? {} : { detail: text }\n }\n const options: SelectOption[] = [\n { id: 'off', label: t('off'), ...detail(undefined, connectionId === null), ...(connectionId === null ? { active: true } : {}) },\n ]\n for (const { group, connections } of spec.groups(view)) {\n for (const connection of connections) {\n if (connection.status !== 'ready') continue\n const text = spec.describe(connection)\n options.push({ id: 'connection:' + connection.id, label: text.label, group,\n ...detail(text.caption, connection.id === connectionId), ...(connection.id === connectionId ? { active: true } : {}) })\n }\n }\n if (spec.options !== undefined) options.push(...spec.options.choices(view, detail))\n return options\n },\n async onSelect(option, session) {\n const options = spec.options\n const update = parseSelectionCommandOption(option.id, options === undefined ? undefined : id => options.parse(id))\n if (update === undefined) return\n const { selection } = await read(session.sessionId)\n const current = update.connectionId !== undefined\n ? update.connectionId === selection.connectionId\n : spec.options !== undefined && spec.options.isCurrent(update, selection)\n if (current) return\n const result = await selections.set(session.sessionId, update)\n if (!result.ok) throw new Error(spec.writeFailureText(result.error))\n },\n },\n }\n}\n\n/**\n * Call `ran` after this browser ran the Host command `name` in a Session. A line\n * with arguments (`/setup-search off`) writes on the Host without the selection\n * store, so that Session's views must read again. DSH reports each Host command\n * this browser executed with `command/executed`, without its arguments, so every\n * run counts; runs from another browser or the TUI are not reported here.\n * @returns the listener's disposer; it also ends with `ctx`'s fiber.\n */\nexport function followHostCommand(ctx: Context, name: string, ran: (sessionId: string) => void): () => void {\n return ctx.on('command/executed', (sessionId, executed) => {\n if (executed === name) ran(sessionId)\n })\n}\n","import { createSnapshotStore, type ObservableSnapshot, type SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nimport type { SelectionStore, SelectionState, WriteResult } from './section.ts'\nimport type { SelectionChange, SelectionView } from '../shared/selection.ts'\n\n/** Capability callers keep their option type; the shared UI consumes SelectionStore. */\nexport interface CapabilitySelectionUpdate<V extends SelectionView> {\n readonly connectionId?: string | null\n readonly options?: Readonly<Partial<V['selection']['options']>>\n}\n\nexport interface SelectionRemote<V extends SelectionView> {\n get(request: { sessionId: string }): Promise<RemoteResult<V>>\n set(request: SelectionChange<V['selection']['options']>): Promise<RemoteResult<V>>\n}\n\ninterface Entry<V extends SelectionView> {\n readonly sessionId: string\n readonly store: SnapshotStore<SelectionState<V>>\n readonly source: ObservableSnapshot<SelectionState<V>>\n observers: number\n /** Whether the stored view may be outdated. */\n stale: boolean\n /** Session model the view was read for. */\n modelKey: string | undefined\n /** Bumped by every event that outdates an in-flight read. */\n epoch: number\n reading: Promise<void> | undefined\n}\n\nexport class ConnectionSelectionStore<V extends SelectionView> implements SelectionStore<V> {\n private readonly entries = new Map<string, Entry<V>>()\n\n constructor(private readonly remote: SelectionRemote<V>, private readonly changed: () => void = () => {}) {}\n\n /** Stable observable of one session; the renderer caches its hook binding per source. */\n source(sessionId: string): ObservableSnapshot<SelectionState<V>> {\n return this.entry(sessionId).source\n }\n\n /**\n * Make sure the session's view is current, reading only when it is missing,\n * outdated, or was read for another session model.\n */\n load(sessionId: string, modelKey?: string): Promise<void> {\n const entry = this.entry(sessionId)\n if (modelKey !== undefined && modelKey !== entry.modelKey) {\n entry.modelKey = modelKey\n this.outdate(entry)\n }\n return entry.stale ? this.read(entry) : entry.reading ?? Promise.resolve()\n }\n\n /** Read the session again, joining a read already in flight. */\n refresh(sessionId: string): Promise<void> {\n return this.read(this.entry(sessionId))\n }\n\n /** The latest view of a session after making sure it is current. */\n async current(sessionId: string): Promise<SelectionState<V>> {\n await this.refresh(sessionId)\n return this.entry(sessionId).store.getSnapshot()\n }\n\n /**\n * Write a change against the revision the views show. The confirmed view\n * replaces the stored one; a refused write rereads so every view shows what\n * the Host holds now.\n */\n async set(sessionId: string, update: CapabilitySelectionUpdate<V>): Promise<WriteResult> {\n const entry = this.entry(sessionId)\n const { view } = entry.store.getSnapshot()\n if (view === undefined) throw new Error('connection selection has not been read yet')\n this.outdate(entry)\n const writeEpoch = entry.epoch\n let invalidated = false\n this.publish(entry, { saving: true })\n let result: Awaited<ReturnType<SelectionRemote<V>['set']>>\n try {\n result = await this.remote.set({ sessionId, ...update, expectedRevision: view.selection.revision })\n } finally {\n // Settings/model changes during a write still require a newer read.\n invalidated = entry.epoch !== writeEpoch\n this.outdate(entry)\n this.publish(entry, { saving: false })\n }\n if (result.ok) {\n entry.stale = invalidated\n this.publish(entry, { view: result.value, saving: false, readFailure: undefined })\n if (invalidated) await this.read(entry)\n this.changed()\n return { ok: true }\n }\n this.publish(entry, { saving: false })\n await this.read(entry)\n return result\n }\n\n /**\n * Settings, credentials, or the Host connection changed: observed sessions\n * read again, the others read on their next load.\n */\n invalidate(): void {\n for (const entry of this.entries.values()) this.reread(entry)\n }\n\n /**\n * The Session's selection changed without this store (its Host command ran):\n * its views read again, at once when observed, otherwise on their next load.\n * A read already in flight reads once more.\n */\n invalidateSession(sessionId: string): void {\n const entry = this.entries.get(sessionId)\n if (entry !== undefined) this.reread(entry)\n }\n\n private entry(sessionId: string): Entry<V> {\n const existing = this.entries.get(sessionId)\n if (existing !== undefined) return existing\n const store = createSnapshotStore<SelectionState<V>>({ view: undefined, saving: false, readFailure: undefined })\n const entry: Entry<V> = {\n sessionId, store, observers: 0, stale: true, modelKey: undefined, epoch: 0, reading: undefined,\n source: {\n getSnapshot: () => store.getSnapshot(),\n subscribe: (listener) => {\n entry.observers += 1\n const unsubscribe = store.subscribe(listener)\n return () => {\n entry.observers -= 1\n unsubscribe()\n }\n },\n },\n }\n this.entries.set(sessionId, entry)\n return entry\n }\n\n private reread(entry: Entry<V>): void {\n this.outdate(entry)\n if (entry.observers > 0) void this.read(entry)\n }\n\n private outdate(entry: Entry<V>): void {\n entry.stale = true\n entry.epoch += 1\n }\n\n private read(entry: Entry<V>): Promise<void> {\n entry.reading ??= this.fetch(entry).finally(() => { entry.reading = undefined })\n return entry.reading\n }\n\n /** Read until a result arrives that nothing outdated while it was in flight. */\n private async fetch(entry: Entry<V>): Promise<void> {\n for (;;) {\n const epoch = entry.epoch\n const result = await this.remote.get({ sessionId: entry.sessionId })\n if (epoch !== entry.epoch) continue\n entry.stale = false\n if (result.ok) {\n this.publish(entry, { view: result.value, readFailure: undefined })\n } else {\n const readFailure = result.error.code.endsWith('/invalid-settings') ? 'invalid-settings' : 'failed'\n this.publish(entry, { readFailure })\n }\n return\n }\n }\n\n private publish(entry: Entry<V>, patch: Partial<SelectionState<V>>): void {\n entry.store.set({ ...entry.store.getSnapshot(), ...patch })\n }\n}\n","import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { ConfigForm, ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { RouteStore } from './section.ts'\nimport { routeOf, type Route } from '../shared/route.ts'\nimport type { ProviderView } from '../shared/selection.ts'\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nexport interface ProviderRemote { provider(request: Record<string, never>): Promise<RemoteResult<ProviderView>> }\n\nexport type WebSelection = Readonly<Record<string, unknown>>\nexport function clientRoute(web: ConfigFormSnapshot<WebSelection>, host: ProviderView | undefined, field: string): Route {\n if (host === undefined || web.status !== 'ready') return { kind: 'unknown' }\n return routeOf(web.value, field, host.envProvider, host.providerId)\n}\n\nexport class RouteStatus implements RouteStore {\n readonly source: ObservableSnapshot<Route>\n private readonly store = createSnapshotStore<Route>({ kind: 'unknown' })\n private host: ProviderView | undefined\n private reader: ProviderRemote | undefined\n private observers = 0\n private unwatch: (() => void) | undefined\n private epoch = 0\n\n constructor(private readonly web: ConfigForm<WebSelection>, private readonly field: string) {\n this.source = {\n getSnapshot: () => this.store.getSnapshot(),\n subscribe: listener => {\n const unsubscribe = this.store.subscribe(listener)\n this.observers += 1\n if (this.observers === 1) {\n this.unwatch = web.subscribe(() => { this.publish() })\n this.publish()\n this.refresh()\n }\n return () => {\n this.observers -= 1\n if (this.observers === 0) {\n if (this.unwatch !== undefined) this.unwatch()\n this.unwatch = undefined\n this.epoch += 1\n }\n unsubscribe()\n }\n },\n }\n }\n\n attach(reader: ProviderRemote): () => void {\n this.reader = reader\n this.refresh()\n return () => {\n if (this.reader !== reader) return\n this.reader = undefined\n this.host = undefined\n this.epoch += 1\n this.publish()\n }\n }\n\n refresh(): void {\n const reader = this.reader\n if (reader === undefined || this.observers === 0) return\n const epoch = ++this.epoch\n void reader.provider({}).then(result => {\n if (epoch !== this.epoch) return\n this.host = result.ok ? result.value : undefined\n this.publish()\n })\n }\n\n /** Publish only a changed route: observers re-render per publish, and some subscribe inside render. */\n private publish(): void {\n const next = clientRoute(this.web.getSnapshot(), this.host, this.field)\n if (!sameRoute(this.store.getSnapshot(), next)) this.store.set(next)\n }\n}\n\nfunction sameRoute(a: Route, b: Route): boolean {\n if (a.kind !== b.kind) return false\n switch (a.kind) {\n case 'unknown': return true\n case 'this': return true\n case 'auto': return a.providerId === (b as typeof a).providerId\n case 'other': return a.provider === (b as typeof a).provider && a.providerId === (b as typeof a).providerId\n }\n}\n","import { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol'\nimport type { Pairing, PairingsView } from '../shared/selection.ts'\n\nexport type PairingsState =\n | { readonly state: 'loading' }\n | { readonly state: 'ready'; readonly pairings: Pairing[] }\n | { readonly state: 'failed'; readonly message: string }\n\nexport interface PairingsRemote {\n pairings(request: Record<string, never>): Promise<RemoteResult<PairingsView>>\n forgetPairing(request: { provider: string; model: string }): Promise<RemoteResult<PairingsView>>\n}\n\nexport class PairingsStatus {\n readonly source: ObservableSnapshot<PairingsState>\n private readonly store = createSnapshotStore<PairingsState>({ state: 'loading' })\n private observers = 0\n private epoch = 0\n\n constructor(private readonly remote: PairingsRemote, private readonly forgetFailureText: () => string) {\n this.source = {\n getSnapshot: () => this.store.getSnapshot(),\n subscribe: listener => {\n const unsubscribe = this.store.subscribe(listener)\n this.observers += 1\n if (this.observers === 1) void this.refresh()\n return () => {\n this.observers -= 1\n if (this.observers === 0) this.epoch += 1\n unsubscribe()\n }\n },\n }\n }\n\n invalidate(): void {\n this.epoch += 1\n this.store.set({ state: 'loading' })\n if (this.observers > 0) void this.refresh()\n }\n\n async refresh(): Promise<void> {\n const epoch = ++this.epoch\n this.store.set({ state: 'loading' })\n const result = await this.remote.pairings({})\n if (epoch !== this.epoch) return\n this.store.set(result.ok ? { state: 'ready', pairings: result.value.pairings } : { state: 'failed', message: result.error.message })\n }\n\n async forget(provider: string, model: string): Promise<void> {\n const result = await this.remote.forgetPairing({ provider, model })\n if (!result.ok) throw new Error(this.forgetFailureText())\n await this.refresh()\n }\n}\n","import type { CredentialInfo, RemoteResult } from '@deepseek-ai/dsh-api-remotes/client'\nimport { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nexport type CredentialStatusMap = Readonly<Record<string, 'configured' | 'missing' | 'unknown'>>\n\nexport interface CredentialDescriber {\n describe(refs: string[]): Promise<RemoteResult<Record<string, CredentialInfo>>>\n}\n\nexport class CredentialStatus<S> {\n readonly source: ObservableSnapshot<CredentialStatusMap>\n private readonly store = createSnapshotStore<CredentialStatusMap>({})\n private observers = 0\n private epoch = 0\n\n constructor(private readonly settings: () => S | undefined, private readonly credentials: CredentialDescriber, private readonly refs: (settings: S) => Iterable<string>) {\n this.source = {\n getSnapshot: () => this.store.getSnapshot(),\n subscribe: listener => {\n const unsubscribe = this.store.subscribe(listener)\n this.observers += 1\n if (this.observers === 1) this.refresh()\n return () => {\n this.observers -= 1\n if (this.observers === 0) this.epoch += 1\n unsubscribe()\n }\n },\n }\n }\n\n refresh(): void {\n if (this.observers === 0) return\n const epoch = ++this.epoch\n const settings = this.settings()\n if (settings === undefined) {\n this.store.set({})\n return\n }\n const refs = new Set(this.refs(settings))\n void this.credentials.describe([...refs]).then(result => {\n if (epoch !== this.epoch) return\n const states: Record<string, 'configured' | 'missing' | 'unknown'> = {}\n for (const ref of refs) {\n const info = result.ok ? result.value[ref] : undefined\n states[ref] = info === undefined ? 'unknown' : info.configured ? 'configured' : 'missing'\n }\n this.store.set(states)\n })\n }\n}\n","/**\n * Sparse settings writes. The catalog supplies every default, so a write\n * stores only what differs from the inherited (composition) layer, and\n * returning a value to its inherited state removes the user entry instead of\n * materializing it.\n */\nimport type { SettingsPathOpView } from '@deepseek-ai/dsh-api-remotes/client'\nimport { documentVersion as inspectDocumentVersion, type DocumentVersion } from '../../shared/settings.ts'\nexport type { DocumentVersion } from '../../shared/settings.ts'\n\n\n/** The two layers of a ConfigForm snapshot. */\nexport interface SettingsLayers {\n readonly base?: unknown\n readonly user?: unknown\n}\n\ntype Settable = Extract<SettingsPathOpView, { op: 'set' }>['value']\ntype Json = Record<string, unknown>\n\nconst objectOf = (value: unknown): Json =>\n value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Json : {}\n\nconst isObject = (value: unknown): value is Json => value !== null && typeof value === 'object' && !Array.isArray(value)\n\nfunction equal(a: unknown, b: unknown): boolean {\n if (Object.is(a, b)) return true\n if (Array.isArray(a) || Array.isArray(b)) {\n return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((value, index) => equal(value, b[index]))\n }\n if (!isObject(a) || !isObject(b)) return false\n const keys = Object.keys(a)\n return keys.length === Object.keys(b).length && keys.every(key => Object.hasOwn(b, key) && equal(a[key], b[key]))\n}\n\n/** Remove what an object value shares with its inherited counterpart, key by key. */\nfunction delta(value: unknown, inherited: unknown): unknown {\n if (equal(value, inherited)) return undefined\n if (!isObject(value)) return value\n const base = objectOf(inherited)\n return Object.fromEntries(Object.entries(value)\n .map(([key, child]) => [key, delta(child, base[key])] as const)\n .filter(([, child]) => child !== undefined))\n}\n\nfunction documentVersion(layers: SettingsLayers): DocumentVersion {\n return inspectDocumentVersion({ ...objectOf(layers.base), ...objectOf(layers.user) })\n}\n\nfunction assertCurrentVersion(layers: SettingsLayers): void {\n const state = documentVersion(layers)\n if (state.kind !== 'current') throw new Error('settings document version is ' + state.kind)\n}\n\n/**\n * Operations that make `path` hold `target`, touching only that path.\n * @param fallback - the catalog default used when the base layer has no value.\n * @param target - the desired effective value; undefined returns the path to its inherited value.\n */\nfunction sparseSettingOperations(spec: SparseSettingsSpec, layers: SettingsLayers, path: readonly string[], target: unknown, fallback?: unknown): SettingsPathOpView[] {\n assertCurrentVersion(layers)\n const inherited = valueAt(layers.base, path) ?? fallback\n const user = valueAt(layers.user, path)\n const ops: SettingsPathOpView[] = []\n if (target === undefined || equal(target, inherited)) {\n if (user !== undefined) ops.push({ op: 'unset', path: prunedPath(layers.user, path) })\n } else {\n const sparse = delta(target, inherited)\n if (!equal(sparse, user)) ops.push({ op: 'set', path: [...path], value: sparse as Settable })\n }\n if (ops.some(op => op.op === 'set') && objectOf(layers.user).version !== spec.version) {\n ops.push({ op: 'set', path: ['version'], value: spec.version })\n }\n return ops\n}\n\nfunction valueAt(root: unknown, path: readonly string[]): unknown {\n return path.reduce<unknown>((value, key) => objectOf(value)[key], root)\n}\n\n/**\n * The path to unset so no empty object stays behind: removing the only key of\n * a user-layer object removes that object instead, up to a top-level field.\n */\nfunction prunedPath(user: unknown, path: readonly string[]): string[] {\n let end = path.length\n while (end > 1 && Object.keys(objectOf(valueAt(user, path.slice(0, end - 1)))).length === 1) end -= 1\n return path.slice(0, end)\n}\n\n\n\n/** Unset every field this plugin stores in the user layer; inherited values and credentials stay. */\nfunction resetSettingsOperations(layers: SettingsLayers): SettingsPathOpView[] {\n return Object.keys(objectOf(layers.user)).map(key => ({ op: 'unset', path: [key] }))\n}\n\nexport interface SparseSettingsSpec {\n readonly version: number\n readonly fields: readonly string[]\n}\n\n/** Bind the current document version and fields; no predecessor schema is inferred. */\nexport function createSparseSettings(spec: SparseSettingsSpec) {\n return {\n documentVersion: (layers: SettingsLayers) => documentVersion(layers),\n sparseSettingOperations: (layers: SettingsLayers, path: readonly string[], target: unknown, fallback?: unknown) => sparseSettingOperations(spec, layers, path, target, fallback),\n resetSettingsOperations: (layers: SettingsLayers) => resetSettingsOperations(layers),\n }\n}\nexport type SparseSettings = ReturnType<typeof createSparseSettings>\n","/** Write-only key entry: the value goes to DSH Credentials and never into settings. */\nimport { useId, useState } from 'react'\nimport { Button, Input, Tag } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { CredentialStatusMap } from '../credentials.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses } from './parts.tsx'\n\n\nexport type SaveCredential = (ref: string, value: string) => Promise<void>\n\ntype Outcome = { readonly kind: 'saved' } | { readonly kind: 'failed'; readonly message: string } | undefined\n\nexport type CredentialCopyKey = \"credential.label\" | \"credential.set\" | \"credential.unset\" | \"credential.placeholder\" | \"saving\" | \"credential.save\" | \"credential.saved\" | \"credential.failed\" | \"credential.hint\"\nexport function createCredentialEditor<K extends string>({ classes: css, keys }: {\n classes: SettingsClasses\n keys: Readonly<Record<CredentialCopyKey, K>>\n}) {\n function CredentialEditor({ credentialRef, status, save, t }: {\n credentialRef: string\n status: CredentialStatusMap[string] | undefined\n save: SaveCredential\n t: ClientTranslate<K>\n }) {\n const id = useId()\n const [value, setValue] = useState('')\n const [busy, setBusy] = useState(false)\n const [outcome, setOutcome] = useState<Outcome>(undefined)\n \n const submit = async (): Promise<void> => {\n const trimmed = value.trim()\n if (!trimmed) return\n setBusy(true)\n setOutcome(undefined)\n try {\n await save(credentialRef, trimmed)\n setValue('')\n setOutcome({ kind: 'saved' })\n } catch (error) {\n setOutcome({ kind: 'failed', message: error instanceof Error ? error.message : String(error) })\n } finally {\n setBusy(false)\n }\n }\n \n const isConfigured = status === 'configured'\n const isMissing = status === 'missing'\n \n return (\n <div className={css.formField}>\n <div className={css.fieldHead}>\n <label className={css.fieldLabel} htmlFor={id}>{t(keys['credential.label'])}</label>\n {isConfigured ? <Tag tone=\"success\">{t(keys['credential.set'])}</Tag> : null}\n {isMissing ? <Tag tone=\"warning\">{t(keys['credential.unset'])}</Tag> : null}\n </div>\n <div className={css.inline}>\n <Input\n id={id}\n className={css.input as string}\n type=\"password\"\n value={value}\n disabled={busy}\n placeholder={t(keys['credential.placeholder'])}\n autoComplete=\"off\"\n spellCheck={false}\n aria-label={t(keys['credential.label'])}\n onChange={event => { setValue(event.target.value) }}\n onKeyDown={event => {\n if (event.key === 'Enter' && !event.nativeEvent.isComposing) {\n event.preventDefault()\n void submit()\n }\n }}\n />\n <Button\n variant=\"outline\"\n size=\"md\"\n disabled={busy || value.trim() === ''}\n onClick={() => { void submit() }}\n >\n {busy ? t(keys['saving']) : t(keys['credential.save'])}\n </Button>\n </div>\n {outcome?.kind === 'saved' ? <p className={css.success} role=\"status\">{t(keys['credential.saved'])}</p> : null}\n {outcome?.kind === 'failed' ? <p className={css.error} role=\"alert\">{outcome.message || t(keys['credential.failed'])}</p> : null}\n <p className={css.hint}>{t(keys['credential.hint'], { ref: credentialRef })}</p>\n </div>\n )\n }\n return CredentialEditor\n}\nexport type CredentialEditorComponent<K extends string> = ReturnType<typeof createCredentialEditor<K>>\n","import { isEndpoint } from '../../shared/url.ts'\nimport type { ClientTranslate } from '../command.ts'\n\n/** One optional request option as the forms show it; empty text means the default. */\nexport interface OptionField<K extends string = string> {\n readonly name: string\n readonly label: K\n readonly kind: 'text' | 'url' | 'integer' | 'boolean' | 'enum' | 'list'\n /** Accepted enum values on this route. */\n readonly values: readonly string[]\n /** What a text value, or each item of a list, must match. */\n readonly pattern?: RegExp\n readonly min?: number\n readonly max?: number\n /** Most items a list holds. */\n readonly maxItems?: number\n /** Options that may not be set together with this one (catalog `exclusive`). */\n readonly exclusive?: readonly string[]\n /** Localized example or the default value. */\n readonly placeholder: (t: ClientTranslate<K>) => string | undefined\n /** A note below the field, such as what a special value means or a unit conversion. */\n readonly hint?: K\n}\n\n/**\n * A titled subset of an entry's options, such as those some model protocols\n * apply; derived from catalog data (`protocolGroups`).\n */\nexport interface OptionGroup {\n readonly title: string\n readonly options: readonly string[]\n}\n\n/** Editor text per field name. */\nexport type FieldTexts = Readonly<Record<string, string>>\n\n/** Editor text of a stored value; empty means the default. A list is one item per line. */\nexport const fieldText = (value: unknown): string => {\n if (value === undefined || value === null) return ''\n if (typeof value === 'string') return value\n if (Array.isArray(value) && value.every(item => typeof item === 'string')) return value.join('\\n')\n if (typeof value === 'number' || typeof value === 'boolean') return `${value}`\n return JSON.stringify(value)\n}\n\n/** The items of list text: one per line, blank lines ignored. */\nfunction listLines(text: string): { readonly line: number; readonly item: string }[] {\n return text.split('\\n').map((raw, index) => ({ line: index + 1, item: raw.trim() })).filter(entry => entry.item !== '')\n}\n\n/** What is wrong with list text: the first line that does not match, or too many items. */\nexport type ListProblem = { readonly kind: 'line'; readonly line: number; readonly item: string } | { readonly kind: 'count'; readonly max: number }\n\nexport function listProblem<K extends string>(field: OptionField<K>, text: string): ListProblem | undefined {\n const lines = listLines(text)\n const bad = lines.find(entry => field.pattern !== undefined && !field.pattern.test(entry.item))\n if (bad !== undefined) return { kind: 'line', line: bad.line, item: bad.item }\n if (field.maxItems !== undefined && lines.length > field.maxItems) return { kind: 'count', max: field.maxItems }\n return undefined\n}\n\n/** Whether editor text is acceptable; empty always is. */\nexport function isValidText<K extends string>(field: OptionField<K>, text: string): boolean {\n if (text === '') return true\n switch (field.kind) {\n case 'list': return listProblem(field, text) === undefined\n case 'enum': return field.values.includes(text)\n case 'boolean': return text === 'true' || text === 'false'\n case 'integer': {\n // Canonical decimal text only: no leading zeros, no \"-0\", no exponent.\n if (!/^(?:0|-?[1-9]\\d{0,15})$/u.test(text)) return false\n const num = Number(text)\n if (!Number.isSafeInteger(num)) return false\n if (field.min !== undefined && num < field.min) return false\n if (field.max !== undefined && num > field.max) return false\n return true\n }\n case 'url': return isEndpoint(text)\n case 'text': return field.pattern === undefined || field.pattern.test(text)\n }\n}\n\n/** The first other field with a value that this one, when it has a value too, may not be set with. */\nexport function conflictOf<K extends string>(field: OptionField<K>, fields: readonly OptionField<K>[], texts: FieldTexts): OptionField<K> | undefined {\n const exclusive = field.exclusive\n if (exclusive === undefined || !isSet(field, texts)) return undefined\n return fields.find(other => exclusive.includes(other.name) && isSet(other, texts))\n}\n\nfunction isSet<K extends string>(field: OptionField<K>, texts: FieldTexts): boolean {\n const text = Object.hasOwn(texts, field.name) ? texts[field.name]! : ''\n return fieldValue(field, text) !== undefined\n}\n\n/** Stored value of valid editor text; undefined returns the option to its default. */\nexport function fieldValue<K extends string>(field: OptionField<K>, text: string): unknown {\n if (text === '') return undefined\n switch (field.kind) {\n case 'boolean': return text === 'true'\n case 'integer': return Number(text)\n case 'list': {\n const items = listLines(text).map(entry => entry.item)\n return items.length === 0 ? undefined : items\n }\n default: return text\n }\n}\n\n/** Options with every field's text applied; empty text removes the option. Other keys stay. */\nexport function applyFields<K extends string>(fields: readonly OptionField<K>[], texts: FieldTexts, stored: Readonly<Record<string, unknown>>): Record<string, unknown> {\n const next: Record<string, unknown> = { ...stored }\n for (const field of fields) {\n const value = fieldValue(field, texts[field.name] ?? fieldText(stored[field.name]))\n if (value === undefined) delete next[field.name]\n else next[field.name] = value\n }\n return next\n}\n","/** Optional request options: labelled inputs over editor text, and a self-saving form around them. */\nimport { useState, type KeyboardEvent } from 'react'\nimport { Input } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ClientTranslate } from '../command.ts'\nimport { conflictOf, fieldText, fieldValue, isValidText, listProblem, type OptionField, type OptionGroup, type FieldTexts } from './fields.ts'\nimport { classNames, type SettingsClasses, type SettingsParts } from './parts.tsx'\n\n/**\n * `options.invalidItem` names a refused list line (`{line}`, `{item}`);\n * `options.invalidLine` is kept for dictionaries that still carry it;\n * `options.exclusive` names the option (`{other}`) that may not be set too.\n */\nexport type OptionsCopyKey = 'options.default' | 'options.invalid' | 'options.invalidLine' | 'options.invalidItem' | 'options.tooMany' | 'options.exclusive' | 'options.on' | 'options.off'\n\n/** How much of a refused list item the error quotes. */\nconst QUOTED_ITEM = 40\n\nexport type { OptionGroup } from './fields.ts'\n\nexport function createOptionsEditor<K extends string>({ classes: css, keys, parts: { SelectMenu }, valueLabel }: {\n classes: SettingsClasses\n keys: Readonly<Record<OptionsCopyKey, K>>\n parts: SettingsParts<K>\n valueLabel: (value: string, t: ClientTranslate<K>) => string\n}) {\n /**\n * A grid of option inputs; empty text means the default. \\`onSettle\\` marks\n * a finished edit: a choice from a menu at once, typed text on blur or Enter\n * (a list, typed one item per line, on blur). With \\`groups\\`, options outside\n * every group come first, then each group under its title. Two options the\n * catalog declares exclusive are both marked while both have a value.\n */\n function OptionFields({ id, fields, groups, texts, disabled, onEdit, onSettle, t }: {\n id: string\n fields: readonly OptionField<K>[]\n groups?: readonly OptionGroup[] | undefined\n texts: FieldTexts\n disabled: boolean\n onEdit: (name: string, text: string) => void\n onSettle?: (name: string, text: string) => void\n t: ClientTranslate<K>\n }) {\n const grid = (subset: readonly OptionField<K>[]) => (\n <div className={css.optionGrid}>\n {subset.map(field => (\n <OptionInput\n key={field.name}\n id={id + '-' + field.name}\n field={field}\n text={texts[field.name] ?? ''}\n conflict={conflictOf(field, fields, texts)}\n disabled={disabled}\n t={t}\n onEdit={text => onEdit(field.name, text)}\n onSettle={text => onSettle?.(field.name, text)}\n />\n ))}\n </div>\n )\n if (groups === undefined) return grid(fields)\n const grouped = new Set(groups.flatMap(group => group.options))\n const loose = fields.filter(field => !grouped.has(field.name))\n return (\n <>\n {loose.length === 0 ? null : grid(loose)}\n {groups.map(group => {\n const subset = group.options.flatMap(name => fields.filter(field => field.name === name))\n if (subset.length === 0) return null\n return (\n <div key={group.title} className={css.optionGroup} role=\"group\" aria-label={group.title}>\n <span className={css.optionGroupTitle}>{group.title}</span>\n {grid(subset)}\n </div>\n )\n })}\n </>\n )\n }\n\n /** Why the text is refused: a list names its first bad line or its item limit; a valid value names the option it conflicts with. */\n function problemText(field: OptionField<K>, text: string, conflict: OptionField<K> | undefined, t: ClientTranslate<K>): string | undefined {\n if (isValidText(field, text)) return conflict === undefined ? undefined : t(keys['options.exclusive'], { other: t(conflict.label) })\n if (field.kind !== 'list') return t(keys['options.invalid'])\n const problem = listProblem(field, text)\n if (problem === undefined) return t(keys['options.invalid'])\n if (problem.kind === 'count') return t(keys['options.tooMany'], { max: problem.max })\n const chars = Array.from(problem.item)\n const item = chars.length > QUOTED_ITEM ? chars.slice(0, QUOTED_ITEM).join('') + '…' : problem.item\n return t(keys['options.invalidItem'], { line: problem.line, item })\n }\n\n function OptionInput({ id, field, text, conflict, disabled, onEdit, onSettle, t }: {\n id: string\n field: OptionField<K>\n text: string\n /** The option this one may not be set together with, while both have a value. */\n conflict: OptionField<K> | undefined\n disabled: boolean\n onEdit: (text: string) => void\n onSettle: (text: string) => void\n t: ClientTranslate<K>\n }) {\n const label = t(field.label)\n const hintId = id + '-hint'\n const errorId = id + '-error'\n const hint = field.hint === undefined ? null : <span className={css.hint} id={hintId}>{t(field.hint)}</span>\n const problem = problemText(field, text, conflict, t)\n const error = problem === undefined ? null : <span className={css.fieldError} id={errorId}>{problem}</span>\n // The error, then the hint: what is wrong is read before what the field is for.\n const describedBy = [problem === undefined ? undefined : errorId, hint === null ? undefined : hintId].filter(part => part !== undefined).join(' ')\n const description = describedBy === '' ? undefined : describedBy\n\n if (field.kind === 'list') {\n return (\n <div className={classNames(css.option, css.optionWide)}>\n <label className={css.optionName} htmlFor={id}>{label}</label>\n <textarea\n id={id}\n className={css.textarea}\n rows={3}\n value={text}\n disabled={disabled}\n aria-invalid={problem !== undefined}\n aria-describedby={description}\n spellCheck={false}\n title={field.name}\n placeholder={field.placeholder(t) ?? t(keys['options.default'])}\n onChange={event => { onEdit(event.target.value.trim() === '' ? '' : event.target.value) }}\n onBlur={() => { onSettle(text) }}\n />\n {error}\n {hint}\n </div>\n )\n }\n\n if (field.kind === 'text' || field.kind === 'url' || field.kind === 'integer') {\n const settleOnEnter = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter' || event.nativeEvent.isComposing) return\n event.preventDefault()\n onSettle(text)\n }\n return (\n <div className={css.option}>\n <label className={css.optionName} htmlFor={id}>{label}</label>\n <Input\n id={id}\n className={css.input as string}\n type={field.kind === 'url' ? 'url' : 'text'}\n value={text}\n disabled={disabled}\n aria-invalid={problem !== undefined}\n aria-describedby={description}\n spellCheck={false}\n title={field.name}\n inputMode={field.kind === 'integer' ? 'numeric' : undefined}\n placeholder={field.placeholder(t) ?? t(keys['options.default'])}\n onChange={event => { onEdit(event.target.value.trim() === '' ? '' : event.target.value) }}\n onBlur={() => { onSettle(text) }}\n onKeyDown={settleOnEnter}\n />\n {error}\n {hint}\n </div>\n )\n }\n\n // Unset is the service's own default, which the catalog does not claim to know; a boolean is no exception.\n const choices = field.kind === 'boolean'\n ? [{ id: 'true', label: t(keys['options.on']) }, { id: 'false', label: t(keys['options.off']) }]\n : field.values.map(value => ({ id: value, label: valueLabel(value, t) }))\n return (\n <div className={css.option}>\n <span className={css.optionName}>{label}</span>\n <SelectMenu\n compact\n label={label}\n title={field.name}\n value={text}\n disabled={disabled}\n options={[{ id: '', label: t(keys['options.default']) }, ...choices]}\n onChange={choice => {\n onEdit(choice)\n onSettle(choice)\n }}\n />\n {error}\n {hint}\n </div>\n )\n }\n\n /**\n * Options that save themselves, one path per option: a menu choice at once,\n * typed text once it settles and is valid. An invalid draft, or one that\n * conflicts with an exclusive option, stays visible with its error and is not\n * written; once the conflict is cleared, the held draft saves too.\n */\n function OptionsForm({ id, title, hint, fields, groups, stored, disabled, onCommit, t }: {\n id: string\n title: string\n hint: string\n fields: readonly OptionField<K>[]\n groups?: readonly OptionGroup[] | undefined\n stored: Readonly<Record<string, unknown>>\n disabled: boolean\n /** Settled option changes, written atomically under one settings revision. */\n onCommit: (changes: Readonly<Record<string, unknown>>) => Promise<boolean>\n t: ClientTranslate<K>\n }) {\n const [drafts, setDrafts] = useState<Record<string, string>>({})\n if (fields.length === 0) return null\n const texts: FieldTexts = Object.fromEntries(fields.map(field => [field.name, drafts[field.name] ?? fieldText(stored[field.name])]))\n\n const settle = async (name: string, text: string): Promise<void> => {\n const field = fields.find(candidate => candidate.name === name)\n if (!field) return\n const current = { ...texts, [name]: text }\n const valid = (candidate: OptionField<K>) => isValidText(candidate, current[candidate.name]!) && conflictOf(candidate, fields, current) === undefined\n if (!valid(field)) return\n // Clearing one option can release a held draft. Validate and write both\n // together, never through successive writes using the same old revision.\n const released = fields.filter(candidate => field.exclusive?.includes(candidate.name) && Object.hasOwn(drafts, candidate.name) && valid(candidate))\n const settled = [field, ...released]\n const changes = Object.fromEntries(settled\n .map(candidate => [candidate.name, fieldValue(candidate, current[candidate.name]!)] as const)\n .filter(([option, value]) => fieldText(value) !== fieldText(stored[option])))\n if (Object.keys(changes).length > 0 && !await onCommit(changes)) return\n const names = new Set(settled.map(candidate => candidate.name))\n setDrafts(previous => Object.fromEntries(Object.entries(previous).filter(([option]) => !names.has(option))))\n }\n return (\n <div className={css.field}>\n <div className={css.fieldHead}><span className={css.fieldLabel}>{title}</span></div>\n <OptionFields\n id={id}\n fields={fields}\n groups={groups}\n texts={texts}\n disabled={disabled}\n t={t}\n onEdit={(name, text) => { setDrafts(current => ({ ...current, [name]: text })) }}\n onSettle={(name, text) => { void settle(name, text) }}\n />\n <p className={css.hint}>{hint}</p>\n </div>\n )\n }\n return { OptionFields, OptionsForm }\n}\nexport type OptionsEditor<K extends string> = ReturnType<typeof createOptionsEditor<K>>\n","/**\n * Read-only facts a settings page derives from a validated document and its\n * capability's catalog. Everything is keyed by the catalog, so a new catalog\n * entry appears on the page without page code naming it.\n */\nimport { builtinId, builtinKey, CUSTOM_CONNECTION_ID, type AccessMode, type Descriptor, type ExclusiveOptions, type OptionRule, type ProtocolDescriptor } from '../../shared/connections.ts'\nimport { singleLine, type BuiltinOverride, type CustomConnection, type SettingsDescriptor } from '../../shared/settings.ts'\nexport type { CustomConnection, CustomAdapterConnection, CustomModelConnection } from '../../shared/settings.ts'\nimport type { OptionField, OptionGroup } from './fields.ts'\n\n/** A capability catalog; key order is display order. */\nexport type SettingsCatalog = Readonly<Record<string, SettingsDescriptor>>\n\n/** Catalog keys of adapter entries: the formats a custom connection can use. */\nexport type AdapterKeyOf<T extends SettingsCatalog> = { [Key in keyof T]: T[Key]['kind'] extends 'adapter' ? Key : never }[keyof T] & string\n\n/** The document fields these helpers read; both capability documents have them. */\nexport interface CatalogSettings {\n readonly defaultConnection?: string | undefined\n readonly connections?: Readonly<Record<string, unknown>> | undefined\n}\n\nexport interface Choice { readonly id: string; readonly label: string }\n\n/** Locale keys for one option: its label, an optional placeholder and an optional hint shown below the field. */\nexport interface OptionCopy<K extends string> { readonly label: K; readonly placeholder?: K; readonly hint?: K }\n\n/** A plugin's copy for the options of one catalog entry. */\nexport interface OptionCopyTable<K extends string> {\n readonly options: Readonly<Partial<Record<string, OptionCopy<K>>>>\n /** Label of an option that has no copy of its own yet. */\n readonly fallback: K\n}\n\n/** The entry of a key taken from the same catalog. */\nexport function catalogEntry<T extends SettingsCatalog>(catalog: T, key: keyof T & string): SettingsDescriptor {\n const info = catalog[key]\n if (info === undefined) throw new Error('unknown catalog key ' + key)\n return info\n}\n\nexport function adapterKeys<T extends SettingsCatalog>(catalog: T): AdapterKeyOf<T>[] {\n return Object.entries(catalog).filter(([, info]) => info.kind === 'adapter').map(([key]) => key as AdapterKeyOf<T>)\n}\n\n/** A built-in entry's override as stored, its label on one line as the grammar reads it. */\nexport function builtinOverride(config: CatalogSettings, key: string): BuiltinOverride {\n const stored = config.connections === undefined ? undefined : config.connections[builtinId(key)] as BuiltinOverride | undefined\n if (stored === undefined) return {}\n return stored.label === undefined ? stored : { ...stored, label: singleLine(stored.label) }\n}\n\n/** Custom connections in document order, labels on one line; the document has passed the capability's validation. */\nexport function customConnections<A extends string = string, P extends string = string>(config: CatalogSettings): [string, CustomConnection<A, P>][] {\n if (config.connections === undefined) return []\n return Object.entries(config.connections)\n .filter(([id]) => CUSTOM_CONNECTION_ID.test(id))\n .map(([id, stored]) => {\n const connection = stored as CustomConnection<A, P>\n return [id, { ...connection, label: singleLine(connection.label) }]\n })\n}\n\n/**\n * The access an operator configures for a built-in entry: one of its routes,\n * or `none` when the catalog offers neither a keyless nor an API-key route\n * (the entry takes its route and credentials from the Session model).\n */\nexport type BuiltinAccess = AccessMode | 'none'\n\n/** Built-in connections default to the anonymous route where one exists. */\nexport function builtinAccess(info: Descriptor, override: BuiltinOverride): BuiltinAccess {\n if (info.access.keyless) return override.access ?? 'keyless'\n return info.access.apiKey ? 'api-key' : 'none'\n}\n\n/** The credential a built-in connection resolves on its API-key route, and the catalog's name for it. */\nexport interface BuiltinCredential {\n readonly ref: string\n readonly catalogRef: string\n}\n\n/** Undefined for an entry without an API-key route. */\nexport function builtinCredential(info: Descriptor, override: BuiltinOverride): BuiltinCredential | undefined {\n if (!info.access.apiKey) return undefined\n const catalogRef = info.access.apiKey.credentialRef\n return { ref: override.credentialRef ?? catalogRef, catalogRef }\n}\n\n/** Every credential the page reports on: each catalog entry with API-key access and every custom connection. */\nexport function credentialRefs(catalog: SettingsCatalog, config: CatalogSettings): string[] {\n const builtin = Object.entries(catalog).flatMap(([key, info]) => {\n const credential = builtinCredential(info, builtinOverride(config, key))\n return credential === undefined ? [] : [credential.ref]\n })\n const custom = customConnections(config).map(([, connection]) => connection.credentialRef)\n return [...new Set([...builtin, ...custom])]\n}\n\n/** Connections a default can name: the catalog in order, then custom connections. */\nexport function connectionChoices<C extends string>(catalog: Readonly<Record<C, SettingsDescriptor>>, config: CatalogSettings, catalogLabel: (key: C) => string): Choice[] {\n return [\n ...(Object.keys(catalog) as C[]).map(key => ({ id: builtinId(key), label: builtinOverride(config, key).label ?? catalogLabel(key) })),\n ...customConnections(config).map(([id, connection]) => ({ id, label: connection.label })),\n ]\n}\n\n/** Display name of any connection id; an id that names nothing is shown as is. */\nexport function connectionName<C extends string>(catalog: Readonly<Record<C, SettingsDescriptor>>, config: CatalogSettings, id: string, catalogLabel: (key: C) => string): string {\n const key = builtinKey(id)\n if (key !== undefined && Object.hasOwn(catalog, key)) return builtinOverride(config, key).label ?? catalogLabel(key as C)\n const custom = customConnections(config).find(([candidate]) => candidate === id)\n return custom === undefined ? id : custom[1].label\n}\n\n/**\n * Editable fields for a catalog entry's option rules. The keyless route drops\n * options it rejects and narrows enums it limits; `restricted` reports either.\n * A list option is edited one item per line; a plugin editor that owns it\n * (`ExtraEditor.options`) takes it over.\n */\nexport function catalogFields<K extends string>(rules: Readonly<Record<string, OptionRule>>, access: AccessMode, copy: OptionCopyTable<K>, exclusive: readonly ExclusiveOptions[] = []): { fields: OptionField<K>[]; restricted: boolean } {\n const fields: OptionField<K>[] = []\n let restricted = false\n for (const [name, rule] of Object.entries(rules)) {\n const scope: KeylessScope = access === 'keyless' ? keylessScope(rule) : { kind: 'all' }\n if (scope.kind === 'none') {\n restricted = true\n continue\n }\n let values: readonly string[] = []\n if (rule.kind === 'enum') {\n values = scope.kind === 'values' ? scope.values : rule.values\n if (values.length < rule.values.length) restricted = true\n }\n const optionCopy = copy.options[name]\n const placeholder = optionCopy === undefined ? undefined : optionCopy.placeholder\n fields.push({\n name,\n label: optionCopy === undefined ? copy.fallback : optionCopy.label,\n kind: rule.kind,\n values,\n placeholder: t => placeholder === undefined ? undefined : t(placeholder),\n ...(optionCopy?.hint === undefined ? {} : { hint: optionCopy.hint }),\n ...(rule.kind === 'text' ? { pattern: rule.pattern } : {}),\n ...(rule.kind === 'integer' ? { min: rule.min, max: rule.max } : {}),\n ...(rule.kind === 'list' ? { pattern: rule.pattern, maxItems: rule.max } : {}),\n ...exclusiveWith(name, exclusive),\n })\n }\n return { fields, restricted }\n}\n\n/**\n * The options of several protocols, grouped by the protocols that apply them:\n * one group per distinct set, in order of first appearance, titled with those\n * protocols' labels. An entry that takes every protocol's options (one that\n * follows the Session model) shows which apply where.\n */\nexport function protocolGroups(protocols: Readonly<Record<string, ProtocolDescriptor>>): OptionGroup[] {\n const entries = Object.values(protocols)\n const groups = new Map<string, { title: string; options: string[] }>()\n for (const option of new Set(entries.flatMap(entry => Object.keys(entry.options)))) {\n const title = entries.filter(entry => Object.hasOwn(entry.options, option)).map(entry => entry.label).join(' / ')\n const group = groups.get(title)\n if (group === undefined) groups.set(title, { title, options: [option] })\n else group.options.push(option)\n }\n return [...groups.values()]\n}\n\n/** The options an option is declared exclusive with; nothing when it has none. */\nfunction exclusiveWith(name: string, exclusive: readonly ExclusiveOptions[]): { exclusive?: readonly string[] } {\n const others = exclusive.flatMap(([first, second]) => first === name ? [second] : second === name ? [first] : [])\n return others.length === 0 ? {} : { exclusive: others }\n}\n\n/** What the keyless route accepts of one option: all of it, nothing, or only some enum values. */\ntype KeylessScope = { readonly kind: 'all' } | { readonly kind: 'none' } | { readonly kind: 'values'; readonly values: readonly string[] }\n\nfunction keylessScope(rule: OptionRule): KeylessScope {\n if (rule.kind === 'list' || rule.keyless === undefined) return { kind: 'all' }\n if (rule.keyless === false) return { kind: 'none' }\n return { kind: 'values', values: rule.keyless }\n}\n\n/** Names of stored options the keyless route rejects, by the rule {@link catalogFields} applies. */\nexport function keylessRejected(rules: Readonly<Record<string, OptionRule>>, stored: Readonly<Record<string, unknown>>): string[] {\n return Object.keys(stored).filter(name => {\n const rule = Object.hasOwn(rules, name) ? rules[name] : undefined\n if (rule === undefined) return false\n const scope = keylessScope(rule)\n return scope.kind === 'none' || (scope.kind === 'values' && !scope.values.some(value => value === stored[name]))\n })\n}\n","/** Per-connection editors every built-in connection gets from its catalog facts. */\nimport { useId, useState, type KeyboardEvent } from 'react'\nimport { Input, Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { CREDENTIAL_REF } from '../../shared/connections.ts'\nimport type { BuiltinOverride } from '../../shared/settings.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport { isValidText, type OptionField } from './fields.ts'\nimport type { SettingsClasses, SettingsDoc, SettingsParts, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type ServiceFieldsCopyKey = 'credential.reference' | 'credential.referenceHint' | 'services.trust' | 'services.trustUnsaved' | 'options.invalid' | 'options.default'\n\nconst onEnter = (commit: () => void) => (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter' || event.nativeEvent.isComposing) return\n event.preventDefault()\n commit()\n}\n\nexport function createServiceFields<K extends string>({ classes: css, keys, parts: { ErrorText, useWrite }, sparse }: {\n classes: SettingsClasses\n keys: Readonly<Record<ServiceFieldsCopyKey, K>>\n parts: SettingsParts<K>\n sparse: SparseSettings\n}) {\n interface FieldProps {\n connectionId: string\n doc: SettingsDoc\n write: WriteSettings\n disabled: boolean\n t: ClientTranslate<K>\n }\n\n /** The DSH Credentials name the API-key route resolves; empty returns to the catalog's name. */\n function CredentialRefField({ connectionId, credentialRef, catalogRef, doc, write, disabled, t }: FieldProps & {\n credentialRef: string\n catalogRef: string\n }) {\n const id = useId()\n const [draft, setDraft] = useState<string | undefined>(undefined)\n const action = useWrite(t)\n const text = draft === undefined ? credentialRef : draft\n const valid = text === '' || CREDENTIAL_REF.test(text)\n\n const commit = async (): Promise<void> => {\n if (!valid || text === credentialRef) return\n const ops = sparse.sparseSettingOperations(doc.layers, ['connections', connectionId, 'credentialRef'], text === '' ? undefined : text, catalogRef)\n if (await action.run(() => write(ops))) setDraft(undefined)\n }\n\n return (\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={id}>{t(keys['credential.reference'])}</label>\n <Input\n id={id}\n className={css.input as string}\n value={text}\n placeholder={catalogRef}\n disabled={disabled || action.busy}\n aria-invalid={!valid}\n autoComplete=\"off\"\n spellCheck={false}\n onChange={event => { setDraft(event.target.value) }}\n onBlur={() => { void commit() }}\n onKeyDown={onEnter(() => { void commit() })}\n />\n <p className={css.hint}>{t(keys['credential.referenceHint'])}</p>\n {valid ? null : <p className={css.fieldError}>{t(keys['options.invalid'])}</p>}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n )\n }\n\n /**\n * A URL option such as a native base URL. A value other than the catalog\n * endpoint is written only together with `trustedEndpoint: true`, and only\n * after the trust switch was turned on for that very address: a stored trust\n * covers the stored address, not a new one typed over it. Turning an active\n * trust off revokes it for the whole connection and returns every URL option\n * to the official endpoint in the same write.\n */\n function UrlOptionField({ connectionId, field, official, override, urlOptions, doc, write, disabled, t }: FieldProps & {\n field: OptionField<K>\n official: string | undefined\n override: BuiltinOverride\n /** Names of every URL option of this connection. */\n urlOptions: readonly string[]\n }) {\n const id = useId()\n const stored = override.options === undefined ? {} : override.options\n const storedText = textOf(stored, field.name)\n const storedTrust = override.trustedEndpoint === true\n const [urlDraft, setUrlDraft] = useState<string | undefined>(undefined)\n /** The address the switch was turned on for in this edit. */\n const [confirmed, setConfirmed] = useState<string | undefined>(undefined)\n const action = useWrite(t)\n\n const url = urlDraft === undefined ? storedText : urlDraft\n const valid = isValidText(field, url)\n const differs = (text: string) => text !== '' && text !== official\n const needsTrust = differs(url)\n const trusted = url === confirmed || (url === storedText && storedTrust)\n const othersNeedTrust = urlOptions.some(name => name !== field.name && differs(textOf(stored, name)))\n const path = ['connections', connectionId]\n\n const settled = (accepted: boolean) => {\n if (!accepted) return\n setUrlDraft(undefined)\n setConfirmed(undefined)\n }\n\n /** Store the address with the trust it needs; an unconfirmed other address stays a draft. */\n const save = async (trust: boolean): Promise<void> => {\n if (!valid || (needsTrust && !trust)) return\n const ops = [\n ...sparse.sparseSettingOperations(doc.layers, [...path, 'options', field.name], url === '' ? official : url, official),\n ...sparse.sparseSettingOperations(doc.layers, [...path, 'trustedEndpoint'], needsTrust || othersNeedTrust, false),\n ]\n settled(await action.run(() => write(ops)))\n }\n\n const revoke = async (): Promise<void> => {\n const ops = [\n ...urlOptions.flatMap(name => differs(textOf(stored, name)) ? sparse.sparseSettingOperations(doc.layers, [...path, 'options', name], official, official) : []),\n ...sparse.sparseSettingOperations(doc.layers, [...path, 'trustedEndpoint'], false, false),\n ]\n settled(await action.run(() => write(ops)))\n }\n\n const toggle = (on: boolean) => {\n if (on) {\n setConfirmed(url)\n void save(true)\n } else if (storedTrust && url === storedText) {\n void revoke()\n } else {\n setConfirmed(undefined)\n }\n }\n\n return (\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={id}>{t(field.label)}</label>\n <Input\n id={id}\n className={css.input as string}\n type=\"url\"\n value={url}\n placeholder={official === undefined ? t(keys['options.default']) : official}\n title={field.name}\n disabled={disabled || action.busy}\n aria-invalid={!valid}\n spellCheck={false}\n onChange={event => { setUrlDraft(event.target.value.trim() === '' ? '' : event.target.value) }}\n onBlur={() => { void save(trusted) }}\n onKeyDown={onEnter(() => { void save(trusted) })}\n />\n {valid ? null : <p className={css.fieldError}>{t(keys['options.invalid'])}</p>}\n {needsTrust ? (\n <div className={css.inline}>\n <Switch\n checked={trusted}\n disabled={disabled || action.busy}\n label={t(keys['services.trust'])}\n onChange={toggle}\n />\n <span className={css.hint}>{t(keys['services.trust'])}</span>\n </div>\n ) : null}\n {needsTrust && valid && !trusted ? <p className={css.fieldError}>{t(keys['services.trustUnsaved'])}</p> : null}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n )\n }\n\n return { CredentialRefField, UrlOptionField }\n}\n\nfunction textOf(options: Readonly<Record<string, unknown>>, name: string): string {\n const value = Object.hasOwn(options, name) ? options[name] : undefined\n return typeof value === 'string' ? value : ''\n}\n","/**\n * Catalog-driven built-in connection controls. Every entry gets its access\n * switch, credential, URL options with endpoint trust and a self-saving option\n * form from its catalog facts; a plugin registers extra editors by catalog key.\n * An entry without an access route of its own (a `model` entry following the\n * Session model) gets only its switch and options; its plugin says who\n * receives the query in the entry's summary and note.\n */\nimport { useId, useState, type ComponentType } from 'react'\nimport { Button, IconChevronDownOutlineRegular, IconRightUpOutlineRegular, SegmentedControl, StateDot, Switch, Tag, type StateDotState } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { builtinId, type AccessMode } from '../../shared/connections.ts'\nimport type { SettingsDescriptor } from '../../shared/settings.ts'\nimport type { CredentialStatusMap } from '../credentials.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { CredentialEditorComponent, SaveCredential } from './CredentialEditor.tsx'\nimport type { OptionGroup, OptionsEditor } from './OptionsEditor.tsx'\nimport { builtinAccess, builtinCredential, builtinOverride, catalogFields, keylessRejected, type BuiltinAccess, type CatalogSettings, type OptionCopyTable } from './model.ts'\nimport { effectiveDocument } from './document.ts'\nimport { applyOps, classNames, type SettingsClasses, type SettingsParts, type SettingsDoc, type WriteSettings } from './parts.tsx'\nimport { createServiceFields, type ServiceFieldsCopyKey } from './ServiceFields.tsx'\nimport type { SettingsLayers, SparseSettings } from './sparse.ts'\n\n/**\n * Configuration only, not service health or a conversation's account\n * availability; only an API-key route needs something here. An entry without\n * an access route has nothing on this page to configure: neutral, not done.\n */\nexport function configurationState(enabled: boolean, access: BuiltinAccess, status: string | undefined): StateDotState {\n if (!enabled || access === 'none') return 'idle'\n if (access === 'keyless' || status === 'configured') return 'done'\n return 'warning'\n}\n\nexport interface ExtraEditorProps<S, K extends string> {\n doc: SettingsDoc<S>\n write: WriteSettings\n disabled: boolean\n t: ClientTranslate<K>\n}\n\n/** A capability's own editor for one catalog entry. */\nexport interface ExtraEditor<S, K extends string> {\n /** Options this editor owns; the shared option form leaves them out. */\n readonly options: readonly string[]\n readonly Editor: ComponentType<ExtraEditorProps<S, K>>\n}\n\nexport type ServicesCopyKey = ServiceFieldsCopyKey | \"services.title\" | \"services.optInNotice\" | \"options.hint\" | \"options.keylessMore\" | \"services.remoteNotice\" | \"services.off\" | \"services.configureLabel\" | \"services.configure\" | \"services.enable\" | \"services.access\" | \"services.accessKeyless\" | \"services.accessPersonal\" | \"services.accessHint.keyless\" | \"services.accessHint.apiKey\" | \"services.accountHint\" | \"services.getKey\" | \"options.title\" | \"services.keyless\" | \"services.account\" | \"services.personalKey\" | \"credential.set\" | \"credential.unset\"\nexport function createServicesSection<S extends CatalogSettings, C extends string, K extends string>({\n classes: css, keys, parts, CredentialEditor, optionsEditor: { OptionsForm }, sparse,\n catalog, optionCopy, label, notes = {}, summaries = {}, optionGroups = {}, extras = {},\n}: {\n classes: SettingsClasses\n keys: Readonly<Record<ServicesCopyKey, K>>\n parts: SettingsParts<K>\n CredentialEditor: CredentialEditorComponent<K>\n optionsEditor: OptionsEditor<K>\n sparse: SparseSettings\n catalog: Readonly<Record<C, SettingsDescriptor>>\n /** Copy for the options of each catalog entry. */\n optionCopy: (key: C) => OptionCopyTable<K>\n label?: (key: C, t: ClientTranslate<K>) => string\n /** A plain note per entry, such as how a remote service caches or keeps what it receives, or who receives the query of an entry without a catalog endpoint. */\n notes?: { readonly [Key in C]?: K }\n /** A fixed row summary per entry in place of the access summary, such as how a local connection reaches pages; an entry without an access route needs one. */\n summaries?: { readonly [Key in C]?: K }\n /** Titled option groups per entry, such as the options each model protocol applies. */\n optionGroups?: { readonly [Key in C]?: readonly OptionGroup[] }\n extras?: { readonly [Key in C]?: ExtraEditor<S, K> }\n}) {\n const { Section, ErrorText, useWrite } = parts\n const { CredentialRefField, UrlOptionField } = createServiceFields({ classes: css, keys, parts, sparse })\n\n interface ServiceProps {\n doc: SettingsDoc<S>\n write: WriteSettings\n credentials: CredentialStatusMap\n saveCredential: SaveCredential\n t: ClientTranslate<K>\n }\n\n function ServicesSection(props: ServiceProps) {\n const catalogKeys = Object.keys(catalog) as C[]\n // Said once for the list; each panel names its own recipient.\n const optIn = catalogKeys.some(key => catalog[key].optIn)\n return (\n <Section title={props.t(keys['services.title'])}>\n {optIn ? <p className={css.note}>{props.t(keys['services.optInNotice'])}</p> : null}\n <ul className={css.list}>\n {catalogKeys.map(key => <ServiceRow key={key} catalogKey={key} {...props} />)}\n </ul>\n </Section>\n )\n }\n\n function ServiceRow({ catalogKey, doc, write, credentials, saveCredential, t }: ServiceProps & { catalogKey: C }) {\n const id = useId()\n const [open, setOpen] = useState(false)\n const action = useWrite(t)\n\n const info = catalog[catalogKey]\n const connectionId = builtinId(catalogKey)\n const override = builtinOverride(doc.config, catalogKey)\n const name = override.label ?? (label === undefined ? info.label : label(catalogKey, t))\n const access = builtinAccess(info, override)\n // The route options are checked on; without an access route of its own nothing narrows an entry's options.\n const route: AccessMode = access === 'keyless' ? 'keyless' : 'api-key'\n const credential = builtinCredential(info, override)\n const credentialRef = credential === undefined ? undefined : credential.ref\n const credentialStatus = credentialRef === undefined ? undefined : credentials[credentialRef]\n // Without an override of its own, an entry is as the catalog starts it: a remote service is off.\n const enabled = !(override.disabled ?? info.optIn)\n const disabled = !doc.editable || action.busy\n\n // Each write is computed on the document the page's earlier writes left, not on this render's.\n const operations = (layers: SettingsLayers, path: string[], target: unknown, fallback?: unknown) =>\n sparse.sparseSettingOperations(layers, ['connections', connectionId, ...path], target, fallback)\n const save = (path: string[], target: unknown, fallback?: unknown) => action.run(() => write(layers => operations(layers, path, target, fallback)))\n const stored = override.options === undefined ? {} : override.options\n const saveOptions = (changes: Readonly<Record<string, unknown>>) => action.run(() => write(initial => {\n let layers = initial\n return Object.entries(changes).flatMap(([option, value]) => {\n const next = sparse.sparseSettingOperations(layers, ['connections', connectionId, 'options', option], value)\n // A sparse unset may prune an empty parent; subsequent paths must see\n // that change before this one atomic write is validated and submitted.\n layers = { ...layers, user: applyOps(layers.user, next) }\n return next\n })\n }))\n\n /**\n * The keyless route takes only the options it accepts; the rest go in the\n * same write. Which ones those are is read from the layers the write runs\n * on: options changed while it waited stay as they are now.\n */\n const switchAccess = (next: AccessMode) => {\n if (next === 'api-key') return save(['access'], next, 'keyless')\n return action.run(() => write(layers => {\n const current = builtinOverride(effectiveDocument(layers), catalogKey).options\n const options = current === undefined ? {} : current\n const rejected = keylessRejected(info.options, options)\n const kept = Object.fromEntries(Object.entries(options).filter(([option]) => !rejected.includes(option)))\n return [\n ...operations(layers, ['access'], next, 'keyless'),\n ...(rejected.length === 0 ? [] : operations(layers, ['options'], Object.keys(kept).length === 0 ? undefined : kept)),\n ]\n }))\n }\n\n const note = notes[catalogKey]\n const extra = extras[catalogKey]\n const owned: readonly string[] = extra === undefined ? [] : extra.options\n const options = catalogFields(info.options, route, optionCopy(catalogKey), info.exclusive)\n const shared = options.fields.filter(field => !owned.includes(field.name))\n const urlFields = shared.filter(field => field.kind === 'url')\n const formFields = shared.filter(field => field.kind !== 'url')\n const optionsHint = t(keys['options.hint']) + (options.restricted ? ' ' + t(keys['options.keylessMore']) : '')\n\n // The catalog service receives the query at its own endpoint; without one, the plugin's note names the recipient.\n const remoteNoticeText = info.remote && info.endpoint !== undefined ? t(keys['services.remoteNotice'], { name }) : undefined\n // The summary stays short; who receives what is said once, in the panel.\n const summary = summaries[catalogKey]\n const summaryText = summary === undefined ? accessSummary(info, access, credentialRef, credentialStatus, t) : t(summary)\n\n return (\n <li className={css.row}>\n <div className={css.rowLine}>\n <StateDot state={configurationState(enabled, access, credentialStatus)} />\n <div className={css.rowMain}>\n <span className={css.rowTitle}>\n {name}\n {enabled ? null : <Tag tone=\"neutral\">{t(keys['services.off'])}</Tag>}\n </span>\n <span className={css.rowMeta}>{summaryText}</span>\n </div>\n <div className={css.rowActions}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={css.disclosure}\n aria-expanded={open}\n aria-controls={id}\n aria-label={t(keys['services.configureLabel'], { name })}\n onClick={() => { setOpen(!open) }}\n >\n {t(keys['services.configure'])}\n <IconChevronDownOutlineRegular className={classNames(css.disclosureIcon, open && css.disclosureOpen)} />\n </Button>\n <Switch\n checked={enabled}\n label={t(keys['services.enable'], { name })}\n disabled={disabled}\n onChange={next => void save(['disabled'], !next, info.optIn)}\n />\n </div>\n </div>\n {open ? null : <ErrorText title={action.errorTitle}>{action.error}</ErrorText>}\n {open ? (\n <div className={css.panel} id={id}>\n {remoteNoticeText ? <p className={css.note}>{remoteNoticeText}</p> : null}\n {note === undefined ? null : <p className={css.note}>{t(note)}</p>}\n {info.access.keyless && info.access.apiKey ? (\n <div className={css.field}>\n <span className={css.fieldLabel}>{t(keys['services.access'])}</span>\n <SegmentedControl<AccessMode>\n id={id + '-access'}\n className={css.segmented}\n label={t(keys['services.access'])}\n value={route}\n disabled={disabled}\n options={[\n { value: 'keyless', label: t(keys['services.accessKeyless']) },\n { value: 'api-key', label: t(keys['services.accessPersonal']) },\n ]}\n onChange={next => void switchAccess(next)}\n />\n <p className={css.hint}>{t(keys[access === 'keyless' ? 'services.accessHint.keyless' : 'services.accessHint.apiKey'])}</p>\n </div>\n ) : null}\n {info.access.account ? <p className={css.note}>{t(keys['services.accountHint'])}</p> : null}\n {access === 'api-key' && credential !== undefined ? (\n <>\n <CredentialRefField\n connectionId={connectionId}\n credentialRef={credential.ref}\n catalogRef={credential.catalogRef}\n doc={doc}\n write={write}\n disabled={disabled}\n t={t}\n />\n <CredentialEditor credentialRef={credential.ref} status={credentialStatus} save={saveCredential} t={t} />\n {info.homepage ? (\n <a className={css.link} href={info.homepage} target=\"_blank\" rel=\"noopener noreferrer\">\n {t(keys['services.getKey'])}\n <IconRightUpOutlineRegular size={12} />\n </a>\n ) : null}\n </>\n ) : null}\n {extra === undefined ? null : <extra.Editor doc={doc} write={write} disabled={disabled} t={t} />}\n {urlFields.map(field => (\n <UrlOptionField\n key={field.name}\n connectionId={connectionId}\n field={field}\n official={info.endpoint}\n override={override}\n urlOptions={urlFields.map(candidate => candidate.name)}\n doc={doc}\n write={write}\n disabled={disabled}\n t={t}\n />\n ))}\n {formFields.length === 0 && options.restricted ? <p className={css.hint}>{t(keys['options.keylessMore'])}</p> : null}\n <OptionsForm\n key={access}\n id={id + '-options'}\n title={t(keys['options.title'])}\n hint={optionsHint}\n fields={formFields}\n groups={optionGroups[catalogKey]}\n stored={stored}\n disabled={disabled}\n t={t}\n onCommit={saveOptions}\n />\n {/* With the panel open, a refused write is reported after the fields it most likely came from. */}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n ) : null}\n </li>\n )\n }\n\n function accessSummary(info: SettingsDescriptor, access: BuiltinAccess, ref: string | undefined, status: string | undefined, t: ClientTranslate<K>): string {\n if (access === 'none') return ''\n if (access === 'keyless' || ref === undefined) return t(keys['services.keyless'])\n const route = t(keys[info.access.account ? 'services.account' : 'services.personalKey'], { ref })\n if (status === 'configured') return route + ' · ' + t(keys['credential.set'])\n if (status === 'missing') return route + ' · ' + t(keys['credential.unset'])\n return route\n }\n return ServicesSection\n}\n","import { useState } from 'react'\nimport { Button, StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PairingsState } from '../pairings.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses, SettingsParts } from './parts.tsx'\nexport type PairingsCopyKey = \"pairings.forgetFailed\" | \"pairings.title\" | \"pairings.hint\" | \"pairings.failed\" | \"pairings.loading\" | \"pairings.empty\" | \"connection.off\" | \"saving\" | \"pairings.forget\"\nexport function createPairingsSection<S, K extends string>({ classes: css, keys, parts: { Section, ErrorText }, formatConnectionName }: {\n classes: SettingsClasses\n keys: Readonly<Record<PairingsCopyKey, K>>\n parts: SettingsParts<K>\n formatConnectionName: (id: string, config: S, t: ClientTranslate<K>) => string\n}) {\n function PairingsSection({\n pairingsState,\n config,\n forgetPairing,\n t,\n }: {\n pairingsState: PairingsState\n config: S\n forgetPairing: (provider: string, model: string) => Promise<void>\n t: ClientTranslate<K>\n }) {\n const [busyKeys, setBusyKeys] = useState<ReadonlySet<string>>(new Set())\n const [error, setError] = useState<string | undefined>(undefined)\n \n const handleForget = async (provider: string, model: string) => {\n const key = `${provider}:${model}`\n setBusyKeys(prev => new Set(prev).add(key))\n setError(undefined)\n try {\n await forgetPairing(provider, model)\n } catch {\n setError(t(keys['pairings.forgetFailed']))\n } finally {\n setBusyKeys(prev => {\n const next = new Set(prev)\n next.delete(key)\n return next\n })\n }\n }\n \n const items = pairingsState.state === 'ready' ? pairingsState.pairings : []\n \n return (\n <Section title={t(keys['pairings.title'])}>\n <p className={css.hint}>{t(keys['pairings.hint'])}</p>\n <ErrorText>{error}</ErrorText>\n {pairingsState.state === 'failed' ? (\n <ErrorText title={pairingsState.message}>{t(keys['pairings.failed'])}</ErrorText>\n ) : pairingsState.state === 'loading' ? (\n <p className={css.status} role=\"status\">\n <StateDot state=\"ongoing\" />\n {t(keys['pairings.loading'])}\n </p>\n ) : items.length === 0 ? (\n <p className={css.empty}>{t(keys['pairings.empty'])}</p>\n ) : (\n <ul className={css.list}>\n {items.map(pairing => {\n const itemKey = `${pairing.provider}:${pairing.model}`\n const isBusy = busyKeys.has(itemKey)\n const targetText = pairing.connectionId === null\n ? t(keys['connection.off'])\n : formatConnectionName(pairing.connectionId, config, t)\n \n return (\n <li key={itemKey} className={css.row}>\n <div className={css.rowLine}>\n <StateDot state={pairing.connectionId === null ? 'idle' : 'done'} />\n <div className={css.rowMain}>\n <span className={css.rowTitle}>\n {pairing.provider} / {pairing.model}\n </span>\n <span className={css.rowMeta}>{targetText}</span>\n </div>\n <div className={css.rowActions}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n disabled={isBusy}\n onClick={() => { void handleForget(pairing.provider, pairing.model) }}\n >\n {isBusy ? t(keys['saving']) : t(keys['pairings.forget'])}\n </Button>\n </div>\n </div>\n </li>\n )\n })}\n </ul>\n )}\n </Section>\n )\n }\n \n \n return PairingsSection\n}\n","import type { ReactNode } from 'react'\nimport { StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { configurationState } from './ServicesSection.tsx'\nimport type { ClientTranslate } from '../command.ts'\nimport type { BuiltinAccess } from './model.ts'\nimport type { SettingsDoc, SettingsParts, WriteSettings, SelectOption } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type DefaultsCopyKey = 'title' | 'connection' | 'connectionHint' | 'connectionUnset' | 'connectionMissing'\nexport interface DefaultsControls {\n readonly disabled: boolean\n readonly save: (path: string[], target: unknown, fallback?: unknown) => void\n}\n\n/** Default connection plus capability-owned controls sharing one write/error state. */\nexport function createDefaultsSection<K extends string>({ parts: { Section, SettingRow, SelectMenu, ErrorText, useWrite }, sparse, keys }: {\n parts: SettingsParts<K>\n sparse: SparseSettings\n keys: Readonly<Record<DefaultsCopyKey, K>>\n}) {\n return function DefaultsSection({ doc, write, t, defaultConnection, defaultLabel, defaultAvailability, choices, children }: {\n doc: SettingsDoc\n write: WriteSettings\n t: ClientTranslate<K>\n defaultConnection: string | undefined\n defaultLabel: string\n defaultAvailability?: {\n readonly disabled: boolean\n readonly access: BuiltinAccess\n readonly credentialStatus: string | undefined\n readonly warning: string\n } | undefined\n choices: readonly SelectOption[]\n children?: (controls: DefaultsControls) => ReactNode\n }) {\n const action = useWrite(t)\n const disabled = !doc.editable || action.busy\n const save = (path: string[], target: unknown, fallback?: unknown) => {\n void action.run(() => write(layers => sparse.sparseSettingOperations(layers, path, target, fallback)))\n }\n const missing = defaultConnection !== undefined && !choices.some(choice => choice.id === defaultConnection)\n const warning = missing ? t(keys.connectionMissing, { id: defaultConnection })\n : defaultAvailability && (defaultAvailability.disabled || configurationState(true, defaultAvailability.access, defaultAvailability.credentialStatus) === 'warning')\n ? defaultAvailability.warning : undefined\n const connectionOptions = [\n { id: '', label: t(keys.connectionUnset, { name: defaultLabel }) },\n ...(missing ? [{ id: defaultConnection, label: t(keys.connectionMissing, { id: defaultConnection }) }] : []),\n ...choices,\n ]\n return (\n <Section title={t(keys.title)}>\n <SettingRow title={t(keys.connection)} hint={<>\n <span>{t(keys.connectionHint)}</span>\n {warning && <span role=\"status\"><StateDot state=\"warning\" />{warning}</span>}\n </>}>\n <SelectMenu label={t(keys.connection)} value={defaultConnection ?? ''} options={connectionOptions} disabled={disabled}\n onChange={next => { save(['defaultConnection'], next === '' ? undefined : next) }} />\n </SettingRow>\n {children?.({ disabled, save })}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </Section>\n )\n }\n}\n","/**\n * The row's Enhanced tools switch (docs/design.md, \"开关与同意\"): what turning\n * it on lets the Agent do, and what the operator agrees to by doing so.\n */\nimport { useId } from 'react'\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses, SettingsDoc, SettingsParts, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type EnhancedToolsCopyKey = 'title' | 'description' | 'consent'\n\n/** The document field this section edits; both capability documents have it. */\nexport interface EnhancedToolsSettings {\n readonly enhancedTools?: boolean | undefined\n}\n\nexport function createEnhancedToolsSection<K extends string>({ classes: css, parts: { Section, ErrorText, useWrite }, sparse, keys }: {\n classes: SettingsClasses\n parts: SettingsParts<K>\n sparse: SparseSettings\n keys: Readonly<Record<EnhancedToolsCopyKey, K>>\n}) {\n return function EnhancedToolsSection({ doc, write, t }: {\n doc: SettingsDoc<EnhancedToolsSettings>\n write: WriteSettings\n t: ClientTranslate<K>\n }) {\n const id = useId()\n const action = useWrite(t)\n const enabled = doc.config.enhancedTools ?? false\n // Off unless a layer turns it on: the user layer stores only a difference from the inherited value.\n const save = (next: boolean) => action.run(() => write(layers => sparse.sparseSettingOperations(layers, ['enhancedTools'], next, false)))\n return (\n <Section title={t(keys.title)} titleId={id + '-title'}>\n {/* A screen reader entering the switch hears what it does and what turning it on agrees to. */}\n <div className={css.settingRow} role=\"group\" aria-labelledby={id + '-title'} aria-describedby={id + '-description ' + id + '-consent'}>\n <div className={css.settingText}>\n <p id={id + '-description'} className={css.settingLead}>{t(keys.description)}</p>\n <p id={id + '-consent'} className={css.hint}>{t(keys.consent)}</p>\n </div>\n <div className={css.settingControl}>\n <Switch checked={enabled} label={t(keys.title)} disabled={!doc.editable || action.busy} onChange={next => void save(next)} />\n </div>\n </div>\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </Section>\n )\n }\n}\n","import { useState } from 'react'\nimport { Button } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses, SettingsParts, SettingsDoc, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\nexport type ResetCopyKey = \"reset.confirm\" | \"reset.confirmButton\" | \"confirm.cancel\" | \"reset.hint\" | \"reset.button\"\nexport function createResetSection<K extends string>({ classes: css, keys, parts: { ConfirmRow, ErrorText, useWrite }, sparse }: {\n classes: SettingsClasses\n keys: Readonly<Record<ResetCopyKey, K>>\n parts: SettingsParts<K>\n sparse: SparseSettings\n}) {\n return function ResetSection({ doc, write, t }: { doc: SettingsDoc; write: WriteSettings; t: ClientTranslate<K> }) {\n const [confirming, setConfirming] = useState(false)\n const action = useWrite(t)\n const disabled = !doc.editable || action.busy\n \n const reset = async () => {\n if (await action.run(() => write(sparse.resetSettingsOperations(doc.layers)))) {\n setConfirming(false)\n }\n }\n \n return (\n <div className={css.reset}>\n {confirming ? (\n <ConfirmRow\n message={t(keys['reset.confirm'])}\n confirmLabel={t(keys['reset.confirmButton'])}\n cancelLabel={t(keys['confirm.cancel'])}\n disabled={disabled}\n onConfirm={() => { void reset() }}\n onCancel={() => { setConfirming(false) }}\n />\n ) : (\n <div className={css.confirmRow}>\n <span className={css.confirmText}>{t(keys['reset.hint'])}</span>\n <Button variant=\"outline\" size=\"sm\" disabled={disabled} onClick={() => { setConfirming(true) }}>\n {t(keys['reset.button'])}\n </Button>\n </div>\n )}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n </div>\n )\n }\n}\n","import type { Route } from '../../shared/route.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport type { SettingsClasses } from './parts.tsx'\nexport function createRouteNotice<K extends string>({ classes: css, keys, other }: {\n classes: SettingsClasses\n keys: Readonly<Record<'unknown' | 'auto' | 'other', K>>\n other?: (route: Extract<Route, { kind: 'other' }>, t: ClientTranslate<K>) => string | undefined\n}) {\n return function RouteNotice({ route, t }: { route: Route; t: ClientTranslate<K> }) {\n let text: string | undefined\n switch (route.kind) {\n case 'this': return null\n case 'unknown': text = t(keys.unknown); break\n case 'auto': text = t(keys.auto, { id: route.providerId }); break\n case 'other': text = other?.(route, t) ?? t(keys.other, { provider: route.provider, id: route.providerId }); break\n }\n return <p className={css.warning} role=\"status\">{text}</p>\n }\n}\n","import type { ConfigForm, ConfigFormSnapshot, SettingsDescribeFace } from '@deepseek-ai/dsh-client-ui-settings/client'\n\nexport type SettingsDocumentSnapshot<S> = ConfigFormSnapshot<S> & { readonly diagnostic?: string }\n\n/** Add public secret-presence diagnostics without guessing which redacted layer owns a secret. */\nexport function withRetiredSecretDiagnostics<S>(form: ConfigForm<S>, describe: SettingsDescribeFace, namespace: string, retiredFields: readonly string[], formatDiagnostic: (fields: readonly string[]) => string): ConfigForm<S> {\n let cached: { source: ConfigFormSnapshot<S>; diagnostic: string | undefined; snapshot: SettingsDocumentSnapshot<S> } | undefined\n const getSnapshot = (): SettingsDocumentSnapshot<S> => {\n const source = form.getSnapshot()\n const row = describe.getSnapshot().view?.namespaces.find(entry => entry.ns === namespace)\n const fields = row === undefined ? [] : row.secrets.filter(secret => secret.set && secret.path.length === 1 && retiredFields.includes(secret.path[0]!)).map(secret => secret.path[0]!)\n const diagnostic = fields.length === 0 ? undefined : formatDiagnostic(fields)\n if (cached === undefined || cached.source !== source || cached.diagnostic !== diagnostic) {\n cached = { source, diagnostic, snapshot: diagnostic === undefined ? source : { ...source, diagnostic } }\n }\n return cached.snapshot\n }\n return {\n getSnapshot,\n subscribe(listener) {\n let previous = getSnapshot()\n const notify = () => {\n const next = getSnapshot()\n if (next === previous) return\n previous = next\n listener()\n }\n const stopForm = form.subscribe(notify)\n const stopDescribe = describe.subscribe(notify)\n return () => { stopForm(); stopDescribe() }\n },\n mutate: (operations, revision) => form.mutate(operations, revision),\n set: (field, value) => form.set(field, value),\n unset: field => form.unset(field),\n }\n}\n","/**\n * Custom connection form: a catalog adapter, or a model protocol the plugin\n * passes. Endpoint trust always comes from explicit consent, given for one\n * destination.\n */\nimport { CREDENTIAL_REF, CUSTOM_CONNECTION_ID, CUSTOM_PREFIX, type ProtocolDescriptor } from '../../shared/connections.ts'\nimport { singleLine } from '../../shared/settings.ts'\nimport { isEndpoint } from '../../shared/url.ts'\nimport { applyFields, conflictOf, fieldText, isValidText, type FieldTexts, type OptionField } from './fields.ts'\nimport { adapterKeys, catalogEntry, catalogFields, type AdapterKeyOf, type CustomConnection, type OptionCopyTable, type SettingsCatalog } from './model.ts'\n\n/** What a custom connection talks to: a catalog adapter, or a model over one protocol. */\nexport type Format<A extends string = string, P extends string = string> =\n | { readonly kind: 'adapter'; readonly adapter: A }\n | { readonly kind: 'model'; readonly protocol: P }\n\ninterface FormFields {\n readonly id: string\n readonly label: string\n readonly credentialRef: string\n readonly options: FieldTexts\n readonly endpoint: string\n}\nexport type ConnectionForm<A extends string = string, P extends string = string> =\n | FormFields & { readonly kind: 'adapter'; readonly adapter: A }\n | FormFields & { readonly kind: 'model'; readonly protocol: P; readonly model: string }\n\nexport type FormError = 'id' | 'duplicate' | 'label' | 'model' | 'credentialRef' | 'endpoint' | 'options' | 'trust'\nexport type BuildResult<A extends string = string, P extends string = string> =\n | { readonly ok: true; readonly id: string; readonly connection: CustomConnection<A, P> }\n | { readonly ok: false; readonly error: FormError }\n\n/** The model protocols a capability offers to custom connections, with copy for their options. */\nexport interface ProtocolTable<P extends string, K extends string> {\n readonly catalog: Readonly<Record<P, ProtocolDescriptor>>\n readonly optionCopy: (protocol: P) => OptionCopyTable<K>\n}\n\n/** Same bound as the settings grammar: 1–200 characters, no control characters. */\nconst MODEL_ID = /^[^\\p{Cc}]{1,200}$/u\n\nexport function emptyForm<A extends string, P extends string>(format: Format<A, P>): ConnectionForm<A, P> {\n const fields: FormFields = { id: CUSTOM_PREFIX, label: '', credentialRef: '', options: {}, endpoint: '' }\n return format.kind === 'adapter'\n ? { ...fields, kind: 'adapter', adapter: format.adapter }\n : { ...fields, kind: 'model', protocol: format.protocol, model: '' }\n}\n\n/** The form in another format: name, id, credential and endpoint stay; options belong to the format they were set for. */\nexport function withFormat<A extends string, P extends string>(form: ConnectionForm<A, P>, format: Format<A, P>): ConnectionForm<A, P> {\n const fields: FormFields = { id: form.id, label: form.label, credentialRef: form.credentialRef, endpoint: form.endpoint, options: {} }\n if (format.kind === 'adapter') return { ...fields, kind: 'adapter', adapter: format.adapter }\n return { ...fields, kind: 'model', protocol: format.protocol, model: form.kind === 'model' ? form.model : '' }\n}\n\nexport function formatOf<A extends string, P extends string>(form: ConnectionForm<A, P> | CustomConnection<A, P>): Format<A, P> {\n return form.kind === 'adapter' ? { kind: 'adapter', adapter: form.adapter } : { kind: 'model', protocol: form.protocol }\n}\n\n/** A stable key of a format, unique across adapters and protocols. */\nexport function formatKey(format: Format): string {\n return format.kind === 'adapter' ? 'adapter:' + format.adapter : 'model:' + format.protocol\n}\n\nexport function formOf<A extends string, P extends string>(id: string, connection: CustomConnection<A, P>): ConnectionForm<A, P> {\n const options = connection.options === undefined ? {} : connection.options\n const fields: FormFields = {\n id, label: singleLine(connection.label), credentialRef: connection.credentialRef,\n endpoint: connection.endpoint === undefined ? '' : connection.endpoint,\n options: Object.fromEntries(Object.entries(options).map(([name, value]) => [name, fieldText(value)])),\n }\n return connection.kind === 'adapter'\n ? { ...fields, kind: 'adapter', adapter: connection.adapter }\n : { ...fields, kind: 'model', protocol: connection.protocol, model: connection.model }\n}\n\nexport function suggestCredentialRef(id: string): string {\n const name = id.slice(CUSTOM_PREFIX.length).toUpperCase().replace(/[^A-Z0-9]+/gu, '_').replace(/^_+|_+$/gu, '')\n return name === '' ? '' : 'CUSTOM_' + name + '_API_KEY'\n}\n\n/**\n * The form rules of one catalog: its adapter entries, then the protocols the\n * plugin passes, are the formats; options use the API-key route.\n */\nexport function createConnectionForm<T extends SettingsCatalog, K extends string, P extends string = never>({ catalog, optionCopy, protocols }: {\n catalog: T\n optionCopy: (key: AdapterKeyOf<T>) => OptionCopyTable<K>\n protocols?: ProtocolTable<P, K> | undefined\n}) {\n type A = AdapterKeyOf<T>\n type Form = ConnectionForm<A, P>\n\n const protocolKeys = protocols === undefined ? [] : Object.keys(protocols.catalog) as P[]\n const formats: Format<A, P>[] = [\n ...adapterKeys(catalog).map(adapter => ({ kind: 'adapter', adapter }) as const),\n ...protocolKeys.map(protocol => ({ kind: 'model', protocol }) as const),\n ]\n\n function protocolEntry(protocol: P): { readonly info: ProtocolDescriptor; readonly copy: OptionCopyTable<K> } {\n if (protocols === undefined || !Object.hasOwn(protocols.catalog, protocol)) throw new Error('unknown protocol ' + protocol)\n return { info: protocols.catalog[protocol], copy: protocols.optionCopy(protocol) }\n }\n\n const formFields = (form: Form): OptionField<K>[] => {\n if (form.kind === 'adapter') {\n const entry = catalogEntry(catalog, form.adapter)\n return catalogFields(entry.options, 'api-key', optionCopy(form.adapter), entry.exclusive).fields\n }\n const { info, copy } = protocolEntry(form.protocol)\n return catalogFields(info.options, 'api-key', copy, info.exclusive).fields\n }\n\n const urlTexts = (form: Form): string[] =>\n formFields(form).filter(field => field.kind === 'url').map(field => textOf(form.options, field.name).trim())\n\n /**\n * Another endpoint, or a URL option off the catalog endpoint, sends the key\n * elsewhere. A model connection has no catalog endpoint to compare with: it\n * always needs trust.\n */\n function needsTrust(form: Form): boolean {\n if (form.kind === 'model') return true\n const official = catalogEntry(catalog, form.adapter).endpoint\n const differs = (text: string) => text !== '' && text !== official\n return [form.endpoint.trim(), ...urlTexts(form)].some(differs)\n }\n\n /** Everything that decides where the key goes; endpoint consent is given for one destination. */\n const destination = (form: Form): string => JSON.stringify([formatKey(formatOf(form)), form.endpoint.trim(), ...urlTexts(form)])\n\n function buildConnection(input: Form, consent: boolean, taken: readonly string[], previous?: CustomConnection<A, P>): BuildResult<A, P> {\n const fail = (error: FormError): BuildResult<A, P> => ({ ok: false, error })\n const form: Form = { ...input, id: input.id.trim(), label: singleLine(input.label), credentialRef: input.credentialRef.trim(), endpoint: input.endpoint.trim() }\n if (!CUSTOM_CONNECTION_ID.test(form.id)) return fail('id')\n if (taken.includes(form.id)) return fail('duplicate')\n if (form.label === '' || form.label.length > 200) return fail('label')\n const model = form.kind === 'model' ? form.model.trim() : ''\n if (form.kind === 'model' && !MODEL_ID.test(model)) return fail('model')\n if (!CREDENTIAL_REF.test(form.credentialRef) || form.credentialRef.length > 2000) return fail('credentialRef')\n const fields = formFields(form)\n const valid = (field: OptionField<K>) => isValidText(field, textOf(form.options, field.name)) && conflictOf(field, fields, form.options) === undefined\n if (!fields.every(valid)) return fail('options')\n // A model connection names its endpoint; an adapter one may leave it to the catalog.\n const endpointMissing = form.endpoint === '' && form.kind === 'model'\n if (endpointMissing || (form.endpoint !== '' && !isEndpoint(form.endpoint))) return fail('endpoint')\n const trusted = needsTrust(form)\n if (trusted && !consent) return fail('trust')\n const options = applyFields(fields, form.options, {})\n const common = {\n label: form.label, credentialRef: form.credentialRef,\n ...(previous === undefined || previous.disabled === undefined ? {} : { disabled: previous.disabled }),\n ...(Object.keys(options).length === 0 ? {} : { options }),\n }\n if (form.kind === 'model') {\n return { ok: true, id: form.id, connection: { ...common, kind: 'model', protocol: form.protocol, model, endpoint: form.endpoint, trustedEndpoint: true } }\n }\n return { ok: true, id: form.id, connection: {\n ...common, kind: 'adapter', adapter: form.adapter,\n ...(form.endpoint === '' ? {} : { endpoint: form.endpoint }),\n ...(trusted ? { trustedEndpoint: true } : {}),\n } }\n }\n\n return { formats, formFields, needsTrust, destination, buildConnection }\n}\nexport type ConnectionFormRules<T extends SettingsCatalog, K extends string, P extends string = never> = ReturnType<typeof createConnectionForm<T, K, P>>\n\nfunction textOf(texts: FieldTexts, name: string): string {\n return Object.hasOwn(texts, name) ? texts[name]! : ''\n}\n","/**\n * Add or edit one custom connection with plain fields: a catalog adapter, or a\n * model over one of the protocols the plugin passes. The editor keeps the\n * document layers and revision it opened with, so a save never overwrites a\n * change made since. An optional key goes to DSH Credentials once the\n * connection is saved.\n */\nimport { useId, useState } from 'react'\nimport { Button, Checkbox, Input } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { CUSTOM_PREFIX } from '../../shared/connections.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport {\n emptyForm, formatKey, formatOf, formOf, suggestCredentialRef, withFormat,\n type ConnectionForm, type ConnectionFormRules, type Format, type FormError, type ProtocolTable,\n} from './connection-form.ts'\nimport type { SaveCredential } from './CredentialEditor.tsx'\nimport { catalogEntry, type AdapterKeyOf, type CatalogSettings, type CustomConnection, type SettingsCatalog } from './model.ts'\nimport type { OptionsEditor } from './OptionsEditor.tsx'\nimport { classNames, type SettingsClasses, type SettingsDoc, type SettingsParts, type WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type CustomEditorTarget = { readonly kind: 'new' } | { readonly kind: 'edit'; readonly id: string }\n\nexport interface CustomEditorProps<S, K extends string> {\n target: CustomEditorTarget\n doc: SettingsDoc<S>\n write: WriteSettings\n saveCredential: SaveCredential\n /** Ids of every existing connection. */\n taken: readonly string[]\n t: ClientTranslate<K>\n /** Close the editor, with a problem to report after the connection saved. */\n onClose: (problem?: string) => void\n}\n\nexport type EditorCopyKey =\n | 'editor.titleNew' | 'editor.titleEdit' | 'editor.id' | 'editor.idHint' | 'editor.idPlaceholder' | 'editor.label' | 'editor.adapter'\n | 'editor.endpoint' | 'editor.endpointHint' | 'editor.credentialRef' | 'editor.credentialRefHint' | 'editor.trust' | 'editor.trustUnnamed'\n | 'editor.save' | 'editor.cancel' | 'editor.stale' | 'editor.optionsHint' | 'editor.apiKey' | 'editor.apiKeyHint' | 'editor.keyFailed'\n | 'draft.id' | 'draft.duplicate' | 'draft.label' | 'draft.trust' | 'draft.credentialRef' | 'draft.endpoint' | 'draft.options'\n | 'options.title' | 'credential.placeholder' | 'saving'\n\n/** Copy of the model formats: \\`model.format\\` names a protocol (\\`{protocol}\\`) in the format list and on a row. */\nexport type ModelCopyKey = 'model.format' | 'model.id' | 'model.idHint' | 'model.endpointHint' | 'model.note' | 'draft.model'\n\n/** Model protocols a capability offers to custom connections, after its adapter formats. */\nexport interface ModelFormats<P extends string, K extends string> extends ProtocolTable<P, K> {\n readonly keys: Readonly<Record<ModelCopyKey, K>>\n /** A note per protocol shown while it is chosen, such as which services run web search over it. */\n readonly notes?: { readonly [Key in P]?: K }\n}\n\nconst FORM_ERRORS = {\n id: 'draft.id',\n duplicate: 'draft.duplicate',\n label: 'draft.label',\n credentialRef: 'draft.credentialRef',\n endpoint: 'draft.endpoint',\n options: 'draft.options',\n trust: 'draft.trust',\n} as const satisfies Record<Exclude<FormError, 'model'>, EditorCopyKey>\n\n/** The model formats of a capability that has them; a model form exists only then. */\nexport function modelFormats<P extends string, K extends string>(protocols: ModelFormats<P, K> | undefined): ModelFormats<P, K> {\n if (protocols === undefined) throw new Error('this capability has no model protocols')\n return protocols\n}\n\n/** Display name of a format: the catalog adapter, or \"model search · <protocol>\". */\nexport function formatLabel<T extends SettingsCatalog, P extends string, K extends string>(\n catalog: T, protocols: ModelFormats<P, K> | undefined, format: Format<AdapterKeyOf<T>, P>, t: ClientTranslate<K>,\n): string {\n if (format.kind === 'adapter') return catalogEntry(catalog, format.adapter).label\n const models = modelFormats(protocols)\n return t(models.keys['model.format'], { protocol: models.catalog[format.protocol].label })\n}\n\nexport function createConnectionEditor<S extends CatalogSettings, T extends SettingsCatalog, K extends string, P extends string = never>({\n classes: css, keys, parts: { ErrorText, SelectMenu, useWrite }, optionsEditor: { OptionFields }, sparse, catalog, rules, initialFormat, protocols,\n}: {\n classes: SettingsClasses\n keys: Readonly<Record<EditorCopyKey, K>>\n parts: SettingsParts<K>\n optionsEditor: OptionsEditor<K>\n sparse: SparseSettings\n catalog: T\n rules: ConnectionFormRules<T, K, P>\n /** The format a new connection starts with. */\n initialFormat: Format<AdapterKeyOf<T>, P>\n protocols?: ModelFormats<P, K> | undefined\n}) {\n type A = AdapterKeyOf<T>\n type Form = ConnectionForm<A, P>\n const { formats, buildConnection, destination, formFields, needsTrust } = rules\n\n const errorText = (error: FormError, t: ClientTranslate<K>): string =>\n error === 'model' ? t(modelFormats(protocols).keys['draft.model']) : t(keys[FORM_ERRORS[error]])\n\n function ConnectionEditor({ target, doc, write, saveCredential, taken, onClose, t }: CustomEditorProps<S, K>) {\n const formId = useId()\n const [opened] = useState(() => ({\n layers: doc.layers,\n revision: doc.revision,\n previous: target.kind === 'edit' ? storedConnection(doc.config, target.id) : undefined,\n }))\n const [form, setForm] = useState<Form>(() => opened.previous === undefined || target.kind !== 'edit'\n ? emptyForm(initialFormat)\n : formOf(target.id, opened.previous))\n\n // The reference follows the id until the user edits it.\n const [refEdited, setRefEdited] = useState(target.kind === 'edit')\n const [apiKey, setApiKey] = useState('')\n // Consent covers the destination it was given for; a stored trust covers the stored one.\n const [consentFor, setConsentFor] = useState<string | undefined>(() =>\n opened.previous !== undefined && opened.previous.trustedEndpoint === true ? destination(form) : undefined)\n const consent = consentFor === destination(form)\n const [error, setError] = useState<FormError | undefined>(undefined)\n const action = useWrite(t)\n\n const change = (next: (current: Form) => Form) => {\n setForm(next)\n setError(undefined)\n }\n const update = (patch: Partial<Pick<Form, 'id' | 'label' | 'credentialRef' | 'endpoint' | 'options'>>) => {\n change(current => ({ ...current, ...patch }))\n }\n\n const changeId = (suffix: string) => {\n const id = CUSTOM_PREFIX + suffix\n update(refEdited ? { id } : { id, credentialRef: suggestCredentialRef(id) })\n }\n\n const askTrust = needsTrust(form)\n const awaitingTrust = askTrust && !consent\n\n const submit = async (): Promise<void> => {\n const others = target.kind === 'edit' ? taken.filter(existing => existing !== target.id) : taken\n const result = buildConnection(form, consent, others, opened.previous)\n if (!result.ok) return setError(result.error)\n const ops = sparse.sparseSettingOperations(opened.layers, ['connections', result.id], result.connection)\n if (!await action.run(() => write(ops, opened.revision))) return\n\n const key = apiKey.trim()\n if (key === '') return onClose()\n\n try {\n await saveCredential(form.credentialRef.trim(), key)\n onClose()\n } catch {\n onClose(t(keys['editor.keyFailed']))\n }\n }\n\n const trustLabel = form.credentialRef.trim() === ''\n ? t(keys['editor.trustUnnamed'])\n : t(keys['editor.trust'], { ref: form.credentialRef.trim() })\n\n const current = formatKey(formatOf(form))\n const choose = (key: string) => {\n const format = formats.find(candidate => formatKey(candidate) === key)\n if (format !== undefined) change(previous => withFormat(previous, format))\n }\n\n return (\n <form className={css.editor} aria-labelledby={formId + '-title'} onSubmit={event => { event.preventDefault(); void submit() }}>\n <h5 className={css.editorTitle} id={formId + '-title'}>\n {target.kind === 'edit' ? t(keys['editor.titleEdit'], { id: target.id }) : t(keys['editor.titleNew'])}\n </h5>\n <div className={css.formGrid}>\n <TextField id={formId + '-label'} label={t(keys['editor.label'])} value={form.label} onChange={label => update({ label })} />\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={formId + '-id'}>{t(keys['editor.id'])}</label>\n <span className={classNames(css.prefixed, target.kind === 'edit' && css.prefixedDisabled)}>\n <span className={css.prefix} aria-hidden=\"true\">{CUSTOM_PREFIX}</span>\n <input\n id={formId + '-id'}\n className={css.prefixedInput}\n value={form.id.slice(CUSTOM_PREFIX.length)}\n disabled={target.kind === 'edit'}\n placeholder={t(keys['editor.idPlaceholder'])}\n autoComplete=\"off\"\n spellCheck={false}\n aria-describedby={formId + '-id-hint'}\n onChange={event => { changeId(event.target.value) }}\n />\n </span>\n <p className={css.hint} id={formId + '-id-hint'}>{t(keys['editor.idHint'])}</p>\n </div>\n <div className={css.formField}>\n <span className={css.fieldLabel}>{t(keys['editor.adapter'])}</span>\n <SelectMenu\n compact\n label={t(keys['editor.adapter'])}\n value={current}\n options={formats.map(format => ({ id: formatKey(format), label: formatLabel(catalog, protocols, format, t) }))}\n disabled={false}\n onChange={choose}\n />\n {form.kind === 'model' ? <ModelNotes protocol={form.protocol} t={t} /> : null}\n </div>\n {form.kind === 'model' ? (\n <TextField\n id={formId + '-model'}\n label={t(modelFormats(protocols).keys['model.id'])}\n hint={t(modelFormats(protocols).keys['model.idHint'])}\n value={form.model}\n onChange={model => { change(previous => previous.kind === 'model' ? { ...previous, model } : previous) }}\n />\n ) : null}\n <TextField\n id={formId + '-endpoint'}\n label={t(keys['editor.endpoint'])}\n hint={form.kind === 'model' ? t(modelFormats(protocols).keys['model.endpointHint']) : t(keys['editor.endpointHint'])}\n type=\"url\"\n placeholder={form.kind === 'adapter' ? catalogEntry(catalog, form.adapter).endpoint : undefined}\n value={form.endpoint}\n onChange={endpoint => update({ endpoint })}\n />\n <TextField\n id={formId + '-ref'}\n label={t(keys['editor.credentialRef'])}\n hint={t(keys['editor.credentialRefHint'])}\n value={form.credentialRef}\n onChange={credentialRef => {\n setRefEdited(true)\n update({ credentialRef })\n }}\n />\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={formId + '-key'}>{t(keys['editor.apiKey'])}</label>\n <Input\n id={formId + '-key'}\n className={css.input as string}\n type=\"password\"\n autoComplete=\"new-password\"\n spellCheck={false}\n placeholder={t(keys['credential.placeholder'])}\n value={apiKey}\n onChange={event => { setApiKey(event.target.value) }}\n />\n <p className={css.hint}>{t(keys['editor.apiKeyHint'])}</p>\n </div>\n {/* Consent sits with the endpoint and the key it covers, before the options. */}\n {askTrust ? (\n <div className={classNames(css.formWide, css.trust)}>\n <Checkbox className={css.trustCheck} checked={consent} onChange={checked => { setConsentFor(checked ? destination(form) : undefined) }} label={trustLabel} />\n </div>\n ) : null}\n </div>\n <div className={css.field}>\n <span className={css.fieldLabel}>{t(keys['options.title'])}</span>\n <OptionFields\n id={formId + '-option'}\n fields={formFields(form)}\n texts={form.options}\n disabled={false}\n t={t}\n onEdit={(name, value) => update({ options: { ...form.options, [name]: value } })}\n />\n <p className={css.hint}>{t(keys['editor.optionsHint'])}</p>\n </div>\n {doc.revision === opened.revision ? null : <p className={css.warning} role=\"alert\">{t(keys['editor.stale'])}</p>}\n <ErrorText title={error === undefined ? action.errorTitle : undefined}>{error === undefined ? action.error : errorText(error, t)}</ErrorText>\n <div className={css.actions}>\n {awaitingTrust ? <span className={css.hint} id={formId + '-save-blocked'}>{t(keys['draft.trust'])}</span> : null}\n <Button type=\"button\" variant=\"ghost\" onClick={() => { onClose() }}>{t(keys['editor.cancel'])}</Button>\n <Button type=\"submit\" variant=\"primary\" aria-describedby={awaitingTrust ? formId + '-save-blocked' : undefined} disabled={awaitingTrust || !doc.editable || action.busy}>\n {action.busy ? t(keys['saving']) : t(keys['editor.save'])}\n </Button>\n </div>\n </form>\n )\n }\n\n /** What the chosen protocol is good for, then what any model connection returns and costs. */\n function ModelNotes({ protocol, t }: { protocol: P; t: ClientTranslate<K> }) {\n const models = modelFormats(protocols)\n const note = models.notes === undefined ? undefined : models.notes[protocol]\n return (\n <>\n {note === undefined ? null : <p className={css.hint}>{t(note)}</p>}\n <p className={css.hint}>{t(models.keys['model.note'])}</p>\n </>\n )\n }\n\n function storedConnection(config: S, id: string): CustomConnection<A, P> | undefined {\n const stored = config.connections === undefined ? undefined : config.connections[id]\n return stored === undefined ? undefined : stored as CustomConnection<A, P>\n }\n\n function TextField({ id, label, hint, value, onChange, type = 'text', placeholder }: {\n id: string\n label: string\n hint?: string\n value: string\n onChange: (value: string) => void\n type?: string\n placeholder?: string | undefined\n }) {\n return (\n <div className={css.formField}>\n <label className={css.fieldLabel} htmlFor={id}>{label}</label>\n <Input\n id={id}\n className={css.input as string}\n type={type}\n value={value}\n placeholder={placeholder}\n autoComplete=\"off\"\n spellCheck={false}\n onChange={event => { onChange(event.target.value) }}\n />\n {hint === undefined ? null : <p className={css.hint}>{hint}</p>}\n </div>\n )\n }\n\n return ConnectionEditor\n}\n","/**\n * Operator-defined connections. The catalog's adapter entries, then the model\n * protocols a plugin passes, are the formats; without any the section does\n * not render. Removing the connection that is the default restores the\n * catalog default in the same write.\n */\nimport { useState, type ReactNode } from 'react'\nimport { Button, IconPlusOutlineRegular, StateDot, Switch, Tag } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { CredentialStatusMap } from '../credentials.ts'\nimport type { ClientTranslate } from '../command.ts'\nimport { createConnectionForm, formatOf } from './connection-form.ts'\nimport { createConnectionEditor, formatLabel, type CustomEditorTarget, type EditorCopyKey, type ModelFormats } from './ConnectionEditor.tsx'\nimport type { CredentialEditorComponent, SaveCredential } from './CredentialEditor.tsx'\nimport { catalogEntry, customConnections, type AdapterKeyOf, type CatalogSettings, type CustomConnection, type OptionCopyTable, type SettingsCatalog } from './model.ts'\nimport type { OptionsEditor } from './OptionsEditor.tsx'\nimport type { SettingsClasses, SettingsParts, SettingsDoc, WriteSettings } from './parts.tsx'\nimport type { SparseSettings } from './sparse.ts'\n\nexport type CustomCopyKey = EditorCopyKey | \"services.remoteNotice\" | \"custom.title\" | \"custom.addStructured\" | \"custom.empty\" | \"custom.kindStructured\" | \"credential.set\" | \"credential.unset\" | \"credential.manage\" | \"custom.edit\" | \"custom.remove\" | \"services.enable\" | \"custom.removeConfirm\" | \"confirm.cancel\"\n\ninterface CustomProps<S, K extends string> {\n doc: SettingsDoc<S>\n write: WriteSettings\n credentials: CredentialStatusMap\n saveCredential: SaveCredential\n t: ClientTranslate<K>\n}\n\nexport function createCustomConnectionsSection<S extends CatalogSettings, T extends SettingsCatalog, K extends string, P extends string = never>({\n classes: css, keys, parts, CredentialEditor, optionsEditor, sparse, catalog, optionCopy, protocols, defaultConnection,\n}: {\n classes: SettingsClasses\n keys: Readonly<Record<CustomCopyKey, K>>\n parts: SettingsParts<K>\n CredentialEditor: CredentialEditorComponent<K>\n optionsEditor: OptionsEditor<K>\n sparse: SparseSettings\n catalog: T\n /** Copy for the options of each adapter entry. */\n optionCopy: (key: AdapterKeyOf<T>) => OptionCopyTable<K>\n /** Model protocols offered after the adapters; a capability without model connections omits them. */\n protocols?: ModelFormats<P, K> | undefined\n /** The catalog default that replaces a removed default connection. */\n defaultConnection: string\n}): (props: CustomProps<S, K>) => ReactNode {\n type A = AdapterKeyOf<T>\n const { Section, ErrorText, ConfirmRow, useWrite } = parts\n const rules = createConnectionForm<T, K, P>({ catalog, optionCopy, protocols })\n const [initialFormat] = rules.formats\n if (initialFormat === undefined) return () => null\n const ConnectionEditor = createConnectionEditor<S, T, K, P>({ classes: css, keys, parts, optionsEditor, sparse, catalog, rules, initialFormat, protocols })\n\n /**\n * Who receives what a connection sends: the catalog service, and the host\n * when the endpoint is not the catalog's; a model connection's own endpoint host.\n */\n function recipient(connection: CustomConnection<A, P>): string {\n if (connection.kind === 'model') return new URL(connection.endpoint).host\n const info = catalogEntry(catalog, connection.adapter)\n if (connection.endpoint === undefined || connection.endpoint === info.endpoint) return info.label\n return info.label + ' (' + new URL(connection.endpoint).host + ')'\n }\n\n function CustomConnectionsSection({ doc, write, credentials, saveCredential, t }: CustomProps<S, K>) {\n const [editor, setEditor] = useState<CustomEditorTarget | undefined>(undefined)\n const [notice, setNotice] = useState<string | undefined>(undefined)\n const connections = customConnections<A, P>(doc.config)\n const taken = doc.config.connections === undefined ? [] : Object.keys(doc.config.connections)\n\n const open = (target: CustomEditorTarget | undefined) => {\n setNotice(undefined)\n setEditor(target)\n }\n\n const editorFor = (target: CustomEditorTarget) => (\n <ConnectionEditor\n key={target.kind === 'edit' ? target.id : 'new'}\n target={target}\n doc={doc}\n write={write}\n saveCredential={saveCredential}\n taken={taken}\n t={t}\n onClose={(problem) => {\n setEditor(undefined)\n setNotice(problem)\n }}\n />\n )\n\n const editing = (id: string) => editor !== undefined && editor.kind === 'edit' && editor.id === id\n\n return (\n <Section\n title={t(keys['custom.title'])}\n actions={(\n <div className={css.sectionActions}>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<IconPlusOutlineRegular size={14} />}\n disabled={!doc.editable}\n onClick={() => { open({ kind: 'new' }) }}\n >\n {t(keys['custom.addStructured'])}\n </Button>\n </div>\n )}\n >\n <ErrorText>{notice}</ErrorText>\n {editor !== undefined && editor.kind === 'new' ? editorFor(editor) : null}\n {connections.length === 0 ? <p className={css.empty}>{t(keys['custom.empty'])}</p> : (\n <ul className={css.list}>\n {connections.map(([id, connection]) => (\n <CustomRow\n key={id}\n id={id}\n connection={connection}\n doc={doc}\n write={write}\n credentials={credentials}\n saveCredential={saveCredential}\n t={t}\n editing={editing(id)}\n onEdit={() => { open(editing(id) ? undefined : { kind: 'edit', id }) }}\n editor={editing(id) ? editorFor({ kind: 'edit', id }) : null}\n />\n ))}\n </ul>\n )}\n </Section>\n )\n }\n\n function CustomRow({ id, connection, doc, write, credentials, saveCredential, editing, onEdit, editor, t }: CustomProps<S, K> & {\n id: string\n connection: CustomConnection<A, P>\n editing: boolean\n onEdit: () => void\n editor: ReactNode\n }) {\n const [keyOpen, setKeyOpen] = useState(false)\n const [confirming, setConfirming] = useState(false)\n const action = useWrite(t)\n const credentialRef = connection.credentialRef\n const credentialStatus = credentials[credentialRef]\n const enabled = connection.disabled !== true\n const disabled = !doc.editable || action.busy\n\n const userConnections = (doc.layers.user as { connections?: Record<string, unknown> } | undefined)?.connections\n const removable = userConnections !== undefined && Object.hasOwn(userConnections, id)\n\n const save = (path: string[], target: unknown, fallback?: unknown) =>\n action.run(() => write(layers => sparse.sparseSettingOperations(layers, ['connections', id, ...path], target, fallback)))\n\n /** Removing the default connection puts the catalog default back in the same write. */\n const remove = () => {\n const ops = sparse.sparseSettingOperations(doc.layers, ['connections', id], undefined)\n const restore = doc.config.defaultConnection === id ? sparse.sparseSettingOperations(doc.layers, ['defaultConnection'], defaultConnection, defaultConnection) : []\n return action.run(() => write([...ops, ...restore]))\n }\n\n return (\n <li className={css.row}>\n <div className={css.rowLine}>\n <StateDot state={!enabled ? 'idle' : credentialStatus === 'configured' ? 'done' : 'warning'} />\n <div className={css.rowMain}>\n <span className={css.rowTitle}>\n {connection.label}\n <Tag tone=\"neutral\">{connection.kind === 'adapter' ? t(keys['custom.kindStructured']) : formatLabel(catalog, protocols, formatOf(connection), t)}</Tag>\n </span>\n <span className={css.rowMeta}>\n <code>{id}</code>\n {' · '}\n {connection.kind === 'model' ? <><code>{connection.model}</code>{' · '}</> : null}\n <code>{credentialRef}</code>\n {credentialStatus === 'configured' ? ' · ' + t(keys['credential.set']) : ''}\n {credentialStatus === 'missing' ? ' · ' + t(keys['credential.unset']) : ''}\n {' · ' + t(keys['services.remoteNotice'], { name: recipient(connection) })}\n </span>\n </div>\n <div className={css.rowActions}>\n <Button variant=\"ghost\" size=\"sm\" aria-expanded={keyOpen} onClick={() => { setKeyOpen(!keyOpen) }}>{t(keys['credential.manage'])}</Button>\n <Button variant=\"ghost\" size=\"sm\" aria-expanded={editing} disabled={!doc.editable} onClick={onEdit}>{t(keys['custom.edit'])}</Button>\n {removable ? (\n <Button variant=\"ghost\" size=\"sm\" className={css.danger} disabled={disabled} aria-expanded={confirming} onClick={() => { setConfirming(true) }}>\n {t(keys['custom.remove'])}\n </Button>\n ) : null}\n </div>\n <Switch\n checked={enabled}\n label={t(keys['services.enable'], { name: connection.label })}\n disabled={disabled}\n onChange={next => void save(['disabled'], !next, false)}\n />\n </div>\n {confirming ? (\n <ConfirmRow\n message={t(keys['custom.removeConfirm'], { name: connection.label })}\n confirmLabel={t(keys['custom.remove'])}\n cancelLabel={t(keys['confirm.cancel'])}\n disabled={disabled}\n onConfirm={() => { void remove() }}\n onCancel={() => { setConfirming(false) }}\n />\n ) : null}\n <ErrorText title={action.errorTitle}>{action.error}</ErrorText>\n {keyOpen ? (\n <div className={css.panel}>\n <CredentialEditor credentialRef={credentialRef} status={credentialStatus} save={saveCredential} t={t} />\n </div>\n ) : null}\n {editor}\n </li>\n )\n }\n\n return CustomConnectionsSection\n}\n","/** Only exposes retired fields to the browser so Reset can remove them; resolveSettings still rejects them. */\nexport const RETIRED_FIELDS = [\"providerId\",\"freshness\",\"modelMode\",\"protocol\",\"baseURL\",\"model\",\"fallbackModel\",\"apiKey\",\"apiKeyEnv\",\"apiVersion\",\"toolIdentifier\",\"maxTokens\",\"maxUses\",\"chatSearchMode\",\"searchContextSize\"] as const\n","import { z } from 'zod'\nimport { RETIRED_FIELDS } from './retired.ts'\nimport { resolveDocument, type AccessMode, type ResolvedDocument } from 'dsh-tool-web-enhanced-core/shared'\nimport { CATALOG, DEFAULT_CONNECTION, FRESHNESS, MODEL_PROTOCOLS, type AdapterKey, type Freshness, type ModelProtocol } from '../catalog.ts'\n\ninterface ConnectionBase {\n readonly id: string\n readonly label: string\n readonly disabled: boolean\n readonly remote: boolean\n readonly trustedEndpoint: boolean\n readonly options: Readonly<Record<string, unknown>>\n}\nexport interface NativeConnection extends ConnectionBase {\n readonly kind: 'native'\n readonly access: AccessMode\n readonly credentialRef: string\n readonly native: 'deepseek-messages' | 'deepseek-search-api'\n}\nexport interface AdapterConnection extends ConnectionBase {\n readonly kind: 'adapter'\n readonly access: AccessMode\n readonly credentialRef: string\n readonly adapter: AdapterKey\n readonly endpoint: string\n}\nexport interface ModelConnection extends ConnectionBase {\n readonly kind: 'model'\n readonly route:\n | { readonly kind: 'session' }\n | { readonly kind: 'fixed'; readonly protocol: ModelProtocol; readonly model: string; readonly endpoint: string; readonly credentialRef: string }\n}\nexport type Connection = NativeConnection | AdapterConnection | ModelConnection\nexport type ResolvedSettings = ResolvedDocument<{ readonly freshness: Freshness }, Connection>\n\nconst defaultsSchema = z.strictObject({ freshness: z.enum(FRESHNESS).default('auto') })\n\n/** Pure sparse resolution shared by Host and browser. */\nexport function resolveSettings(document: unknown = {}): ResolvedSettings {\n const resolved = resolveDocument({ catalog: CATALOG, protocols: MODEL_PROTOCOLS, document, retiredFields: RETIRED_FIELDS, defaults: { schema: defaultsSchema, defaultConnection: DEFAULT_CONNECTION }, capabilityLabel: 'search' })\n const connections = new Map<string, Connection>()\n for (const [id, connection] of resolved.connections) {\n const { catalogKey, ...base } = connection\n switch (base.kind) {\n case 'local': throw new Error('search catalog cannot contain a local connection')\n case 'model':\n connections.set(id, base)\n break\n case 'native':\n connections.set(id, { ...base, kind: 'native', native: catalogKey as NativeConnection['native'] })\n break\n case 'adapter':\n connections.set(id, { ...base, kind: 'adapter', adapter: catalogKey as AdapterKey })\n break\n }\n }\n return { ...resolved, connections }\n}","import type { TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { RemoteFailure } from '@deepseek-ai/dsh-typert-protocol'\nimport type { ConnectionText } from 'dsh-tool-web-enhanced-core/client'\nimport { builtinId, isBuiltinId, type Access, type ConnectionView, type SelectionView, type UnsupportedReason } from 'dsh-tool-web-enhanced-core/shared'\nimport { CATALOG, type Freshness } from '../catalog.ts'\nimport type { LocaleKey, NS } from './locales.ts'\n\nexport type Translate = TranslateNS<typeof NS>\n\n/** The Session-model connection keeps its catalog name only until the operator renames it; that name is localized. */\nexport function connectionLabel(connection: Pick<ConnectionView, 'id' | 'label'>, t: Translate): string {\n const sessionModel = connection.id === builtinId('session-model') && connection.label === CATALOG['session-model'].label\n return sessionModel ? t('connection.sessionModel') : connection.label\n}\n\nconst ACCESS_LABELS = { keyless: 'access.keyless', 'api-key': 'access.apiKey', account: 'access.account' } as const satisfies Record<Access, LocaleKey>\n\n/** Why the conversation model cannot serve, worded so the operator knows where to fix it. */\nconst REASON_TEXT = {\n 'no-model': 'status.reason.no-model',\n 'unknown-route': 'status.reason.unknown-route',\n protocol: 'status.reason.protocol',\n endpoint: 'status.reason.endpoint',\n headers: 'status.reason.headers',\n credential: 'status.reason.credential',\n} as const satisfies Record<UnsupportedReason, LocaleKey>\n\nexport function describe(connection: ConnectionView, t: Translate): ConnectionText {\n const label = connectionLabel(connection, t)\n switch (connection.status) {\n case 'disabled': return { label, caption: t('services.off'), reason: t('status.disabled', { name: label }) }\n case 'unsupported': {\n const reason = connection.reason === undefined ? t('status.unsupported', { name: label }) : t(REASON_TEXT[connection.reason])\n return { label, caption: t('status.short.unsupported'), reason }\n }\n case 'needs-credential': {\n const need = credentialNeed(connection)\n // A sign-in is not a key: the short caption (/setup-search) must not send the operator to configure one.\n return { label, caption: t(need === 'status.sessionModelNeedsSignIn' ? 'status.short.needsSignIn' : 'status.short.needsCredential'), reason: t(need) }\n }\n case 'ready': return { label, caption: readyCaption(connection, label, t) }\n }\n}\n\n/**\n * What a connection waits for. The conversation model names its own key, or on\n * the DeepSeek account route a fresh sign-in (that route never falls back to a\n * key); native connections take an account or a key; the rest a key.\n */\nfunction credentialNeed(connection: ConnectionView): 'status.sessionModelNeedsSignIn' | 'status.sessionModelNeedsKey' | 'status.needsAccount' | 'status.needsCredential' {\n if (connection.kind === 'model' && isBuiltinId(connection.id)) {\n return connection.access === 'account' ? 'status.sessionModelNeedsSignIn' : 'status.sessionModelNeedsKey'\n }\n return connection.kind === 'native' ? 'status.needsAccount' : 'status.needsCredential'\n}\n\n/**\n * How the connection authenticates, and for a remote one who receives the\n * query: the service, or for a model connection the conversation model's\n * provider (built-in, follows the conversation) or the fixed connection.\n */\nfunction readyCaption(connection: ConnectionView, label: string, t: Translate): string {\n const access = t(ACCESS_LABELS[connection.access])\n if (!connection.remote) return access\n if (connection.kind !== 'model') return t('status.remoteReady', { access, name: label })\n return isBuiltinId(connection.id) ? t('status.sessionModelReady', { access }) : t('status.modelReady', { access, name: label })\n}\n\nexport function sourceText(view: SelectionView, t: Translate): string {\n const keys = { session: 'source.session', inherited: 'source.inherited', model: 'source.model', default: 'source.default' } as const\n return t(keys[view.source])\n}\n\n/** Names joined as the dictionary's language joins them: \"A and B\", \"A和B\". */\nexport function listText(items: readonly string[], t: Translate): string {\n return new Intl.ListFormat(t('list.locale'), { type: 'conjunction' }).format(items)\n}\n\nconst FRESHNESS_LABELS = { auto: 'freshness.auto', fresh: 'freshness.fresh', realtime: 'freshness.realtime' } as const satisfies Record<Freshness, LocaleKey>\nexport function freshnessLabel(freshness: Freshness, t: Translate): string {\n return t(FRESHNESS_LABELS[freshness])\n}\n\nexport function pickerGroups<V extends ConnectionView>(view: { connections: V[] }): { services: V[] } {\n const visible = view.connections.filter(connection => connection.status !== 'disabled')\n return { services: visible }\n}\n\nexport function writeFailureText(error: RemoteFailure, t: Translate): string {\n switch (error.code) {\n case 'searchConnections/conflict': return t('write.conflict')\n case 'searchConnections/unavailable': return t('write.unavailable')\n default: return t('write.failed')\n }\n}\n","import { parseSelectionCommandOption, selectionCommand, type CommandOptions } from 'dsh-tool-web-enhanced-core/client'\nimport { SEARCH } from 'dsh-tool-web-enhanced-core/shared'\nimport { FRESHNESS } from '../catalog.ts'\nimport type { SearchSelectionView } from '../contract.ts'\nimport { freshnessLabel, pickerGroups, describe, writeFailureText, type Translate } from './connections.ts'\nimport type { SearchSelectionStore, SelectionUpdate } from './selection.ts'\n\nexport const SEARCH_COMMAND = SEARCH.command\nconst FRESHNESS_PREFIX = 'freshness:'\nconst parseFreshness = (id: string): SelectionUpdate | undefined => {\n const freshness = FRESHNESS.find(mode => id === FRESHNESS_PREFIX + mode)\n return freshness === undefined ? undefined : { options: { freshness } }\n}\nexport const parseCommandOption = (id: string): SelectionUpdate | undefined => parseSelectionCommandOption(id, parseFreshness)\n\nexport function searchCommand(selections: SearchSelectionStore, t: Translate) {\n const options: CommandOptions<SearchSelectionView> = {\n parse: parseFreshness,\n isCurrent: (update, selection) => update.options !== undefined && update.options.freshness === selection.options.freshness,\n choices(view, detail) {\n const selected = view.connections.find(connection => connection.id === view.selection.connectionId)\n if (selected === undefined || !selected.freshness) return []\n const group = { name: 'freshness', label: t('selector.freshness') }\n return FRESHNESS.map(mode => ({ id: FRESHNESS_PREFIX + mode, label: freshnessLabel(mode, t), group,\n ...detail(undefined, mode === view.selection.options.freshness) }))\n },\n }\n return selectionCommand(selections, {\n name: SEARCH_COMMAND, t,\n keys: { placeholder: 'command.placeholder', empty: 'command.empty', noResults: 'command.noResults',\n readFailed: 'command.readFailed', current: 'command.current', off: 'selector.offRow' },\n groups: view => {\n const { services } = pickerGroups(view)\n return [\n { group: { name: 'services', label: t('selector.services') }, connections: services },\n ]\n },\n describe: connection => describe(connection, t),\n writeFailureText: error => writeFailureText(error, t),\n options,\n })\n}\n","import { CredentialStatus as CoreCredentialStatus, editableSettings, type CredentialDescriber } from 'dsh-tool-web-enhanced-core/client'\nimport { resolveSettings } from '../settings/resolve.ts'\nimport type { Connection } from '../settings/resolve.ts'\nimport type { SearchSettings } from '../settings/types.ts'\nexport type { CredentialDescriber } from 'dsh-tool-web-enhanced-core/client'\n\n/** The DSH credential a connection names; the Session-model connection uses the Session route's own. */\nexport function credentialRefsOf(connection: Connection): string[] {\n if (connection.kind !== 'model') return [connection.credentialRef]\n return connection.route.kind === 'fixed' ? [connection.route.credentialRef] : []\n}\n\nexport class CredentialStatus extends CoreCredentialStatus<SearchSettings> {\n constructor(settings: () => SearchSettings | undefined, credentials: CredentialDescriber) {\n super(() => {\n const config = settings()\n if (config === undefined) return undefined\n const view = editableSettings<SearchSettings>(config, {}, false, resolveSettings)\n // The settings page presents this same validation diagnostic; invalid documents have no credential queries.\n return view.kind === 'ready' ? view.config : undefined\n }, credentials, config => [...resolveSettings(config).connections.values()].flatMap(credentialRefsOf))\n }\n}\n","/** Copy for every surface of the plugin's browser half; zh is the primary language. */\n\n/** Dictionary namespace registered with ctx.locale. */\nexport const NS = 'web-search-enhanced'\n\nexport const en = {\n 'list.separator': ', ',\n /** Language of this dictionary, for Intl.ListFormat: lists follow the sentence they sit in. */\n 'list.locale': 'en',\n 'section.title': 'Search',\n 'source.session': 'This conversation',\n 'source.inherited': 'Parent conversation',\n 'source.model': \"Model's last choice\",\n 'source.default': 'Default connection',\n 'access.apiKey': 'API key',\n 'pairings.failed': 'Could not load model memories. Try again.',\n 'pairings.forgetFailed': 'Model memory was not cleared. Try again.',\n 'route.unknown': 'Cannot confirm that web_search is served by this plugin.',\n 'services.remoteNotice': 'Search queries are sent to {name}.',\n 'pairings.title': 'Model memories',\n 'pairings.hint': \"Choosing a connection in a conversation (including off) remembers it for that conversation's model; new conversations with that model start with it. After you clear it, conversations that have not chosen use the default connection.\",\n 'pairings.loading': 'Loading model memories…',\n 'pairings.empty': 'No model memories.',\n 'pairings.forget': 'Clear memory',\n 'option.native.baseURL': 'API base URL',\n 'option.native.model': 'Model',\n 'option.native.apiVersion': 'API version',\n 'option.native.maxTokens': 'Max output tokens',\n 'option.native.maxUses': 'Max searches per request',\n 'option.native.count': 'Results per search',\n 'option.native.sendOriginalQuestion': \"Include the user's question\",\n\n 'saving': 'Saving…',\n\n 'connection.off': 'Search off',\n\n 'access.keyless': 'No key needed',\n 'access.account': 'DeepSeek account',\n\n 'freshness.auto': 'Auto',\n 'freshness.fresh': 'Within 24 hours',\n 'freshness.realtime': 'Live',\n\n 'status.disabled': '{name} is turned off in settings.',\n 'status.needsCredential': 'Needs an API key',\n 'status.needsAccount': 'Needs a DeepSeek account or API key',\n 'status.unsupported': '{name} is not supported in this version.',\n 'status.short.needsCredential': 'Needs key',\n 'status.short.needsSignIn': 'Sign-in needed',\n 'status.short.unsupported': 'Not supported',\n 'status.remoteReady': '{access} · the query is sent to {name}',\n\n 'selector.services': 'Search connections',\n 'selector.freshness': 'Content freshness',\n 'selector.freshnessIgnored': '{name} ignores this preference.',\n 'selector.offRow': 'Off',\n\n 'write.conflict': 'Search was changed elsewhere. The menu now shows the current choice.',\n 'write.unavailable': 'That connection is turned off or was removed.',\n 'write.failed': 'Not saved. Try again.',\n\n 'command.label': 'Search connection',\n 'command.description': 'Switch the search connection and freshness of this conversation',\n 'command.placeholder': 'Filter search options',\n 'command.empty': 'No search connection is enabled',\n 'command.noResults': 'No matching option',\n 'command.current': 'Current',\n 'command.readFailed': 'Couldn’t load search settings. Try again.',\n\n 'settings.intro': 'Each conversation chooses a search connection with the globe button or /setup-search. Set the defaults and each connection below. Status dots show configuration only, not quota or service health.',\n 'settings.loading': 'Loading settings…',\n 'settings.retiredSecret': '{fields}: these 0.1.x settings are not read. Their source layer is redacted; remove them manually from the bundle settings.',\n 'settings.readOnly': 'These settings are read-only.',\n 'settings.unsupported': \"These search settings can't be read. They may be from 0.1.x or a newer version. Restore the defaults below, or upgrade the plugin.\",\n 'settings.refused': 'Not saved. The settings may have changed elsewhere; check them and try again.',\n 'settings.invalid': 'Invalid settings; not saved.',\n 'settings.failed': 'Not saved. Check the connection to DSH and try again.',\n 'route.auto': 'The web row names no search provider, so these settings may not apply. Open this bundle on the Plugins page and switch back to {id}.',\n 'route.other': 'web_search is served by {provider}, not {id}, so these settings have no effect. Open this bundle on the Plugins page and switch back to {id}.',\n 'route.deepseekApi': 'Search uses the built-in API provider, not {id}. Open the bundle page to review and restore both enhanced provider routes.',\n\n 'defaults.title': 'Defaults',\n 'defaults.connection': 'Default connection',\n 'defaults.connectionHint': \"A conversation that hasn't chosen uses its model's last choice, then the default. Only subagent_fork inherits a parent's choice; ordinary forks and spawn are independent.\",\n 'defaults.connectionUnset': 'Default ({name})',\n 'defaults.connectionMissing': 'Missing: {id}',\n 'defaults.freshness': 'Default freshness',\n 'defaults.freshnessHint': 'For new conversations. Only {services} honor it; other connections ignore it.',\n 'defaults.showSelector': 'Show search connections in the composer menu',\n 'defaults.showSelectorHint': 'When hidden, switch the current conversation with /setup-search.',\n 'defaults.freshnessKeyOnly': '{name} (personal key)',\n\n 'services.title': 'Search connections',\n 'services.optInNotice': 'Remote services are off by default.',\n 'enhanced.title': 'Enhanced tools',\n 'enhanced.description': 'Lets the Agent pick which enabled service runs a search with web_search_enhanced, and see the choices with list_web_search_providers. Applies to conversations started afterwards.',\n 'enhanced.consent': 'Turning this on means you agree that when the Agent picks a service, the query is sent to that service.',\n 'services.enable': 'Enable {name}',\n 'services.configure': 'Configure',\n 'services.configureLabel': 'Configure {name}',\n 'services.off': 'Off',\n 'services.keyless': 'No key needed',\n 'services.personalKey': 'Personal key {ref}',\n 'services.account': 'DeepSeek account or {ref}',\n 'services.access': 'Access',\n 'services.accessKeyless': 'Keyless',\n 'services.accessPersonal': 'Personal key',\n 'services.accountHint': 'Conversations using a DeepSeek account model search through the account; others use the API key below.',\n 'services.getKey': 'Get an API key',\n 'services.accessHint.keyless': 'Uses the public endpoint and shared limits of the service; your key is never sent.',\n 'services.accessHint.apiKey': 'Uses your API key and personal limits; request options are available.',\n\n 'credential.label': 'API key',\n 'credential.placeholder': 'Enter a new key',\n 'credential.save': 'Save key',\n 'credential.saved': 'Key saved.',\n 'credential.failed': 'The key was not saved. Try again.',\n 'credential.hint': 'Stored in DSH Credentials under {ref}, never in settings.',\n 'credential.set': 'Configured',\n 'credential.unset': 'Not configured',\n 'credential.manage': 'Set key',\n 'credential.reference': 'Credential name',\n 'credential.referenceHint': 'The name in DSH Credentials, not the key itself. Leave empty for the default.',\n 'services.trustUnsaved': 'Not saved: confirm that you trust this address first.',\n 'options.on': 'On',\n 'options.off': 'Off',\n\n 'options.title': 'Request options',\n 'options.hint': 'Saved as you change them. Leave a field empty for the service default.',\n 'options.default': 'Default',\n 'options.invalid': 'Invalid value',\n 'options.keylessMore': 'More options are available with a personal key.',\n\n\n 'custom.title': 'Custom connections',\n 'custom.empty': 'No custom connections yet.',\n 'custom.addStructured': 'Add search service',\n 'custom.kindStructured': 'Search service',\n 'custom.edit': 'Edit',\n 'custom.remove': 'Remove',\n 'custom.removeConfirm': 'Remove the custom connection “{name}”? Its credential is not deleted.',\n\n 'editor.titleNew': 'New connection',\n 'editor.titleEdit': 'Edit {id}',\n 'editor.id': 'ID',\n 'editor.idHint': 'Letters, digits, dots, underscores or hyphens.',\n 'editor.label': 'Name',\n 'editor.adapter': 'Service',\n 'editor.endpoint': 'Endpoint',\n 'editor.endpointHint': 'Leave empty for the official endpoint.',\n 'editor.credentialRef': 'Credential name',\n 'editor.credentialRefHint': 'Name of a DSH credential, such as SEARCH_API_KEY. Not the key itself.',\n 'editor.trust': 'I trust this endpoint: send search queries and the credential {ref} to it.',\n 'editor.trustUnnamed': \"I trust this endpoint: send search queries and this connection's credential to it.\",\n 'editor.save': 'Save',\n 'editor.cancel': 'Cancel',\n 'editor.stale': 'Settings changed after you opened this editor. Cancel and reopen it to avoid overwriting those changes.',\n 'editor.idPlaceholder': 'my-search',\n 'editor.searchOptions': 'Search options',\n 'editor.optionsHint': 'Leave a field empty for the default.',\n 'editor.apiKey': 'API key (optional)',\n 'editor.apiKeyHint': 'Saved to DSH Credentials under the credential name above after the connection is saved.',\n 'editor.keyFailed': 'The connection was saved, but its key was not. Set the key from the list.',\n\n 'draft.id': 'The ID must start with custom: followed by letters, digits, dots, underscores or hyphens.',\n 'draft.duplicate': 'This ID is already in use.',\n 'draft.label': 'Enter a name.',\n 'draft.trust': 'Confirm that you trust this endpoint.',\n 'draft.credentialRef': 'A credential name uses letters, digits and underscores and does not start with a digit.',\n 'draft.endpoint': 'Enter a full http(s) address.',\n 'draft.options': 'Fix the highlighted options.',\n\n 'reset.button': 'Restore default settings',\n 'reset.hint': 'Returns every search setting to its default and deletes custom connections. Saved keys are kept.',\n 'reset.confirm': 'Restore every search setting to its default?',\n 'reset.confirmButton': 'Restore',\n\n 'option.exa.type': 'Search type',\n 'option.firecrawl.country': 'Country or region',\n 'option.firecrawl.country.placeholder': 'Two-letter code, e.g. us',\n 'option.firecrawl.location': 'Location',\n 'option.firecrawl.location.placeholder': 'e.g. San Francisco, California',\n 'option.firecrawl.safe': 'Safe search',\n 'option.tavily.search_depth': 'Search depth',\n 'option.tavily.topic': 'Topic',\n 'option.tinyfish.location': 'Region',\n 'option.tinyfish.location.placeholder': 'Two-letter code, e.g. us',\n 'option.tinyfish.language': 'Language',\n 'option.tinyfish.language.placeholder': 'e.g. en or zh-CN',\n 'option.tinyfish.purpose': 'Purpose',\n 'option.tinyfish.purpose.placeholder': 'What the searches are for',\n 'option.tinyfish.domain_type': 'Content type',\n 'option.anysearch.zone': 'Region',\n 'option.anysearch.language': 'Preferred language',\n 'option.anysearch.language.placeholder': 'e.g. zh-CN or en',\n 'option.openalex.sort': 'Sort',\n 'option.openalex.sort.placeholder': 'e.g. cited_by_count:desc',\n 'option.openalex.filter': 'Filter',\n 'option.openalex.filter.placeholder': 'e.g. publication_year:2024',\n 'option.openalex.is_oa': 'Open access only',\n 'option.openalex.mailto': 'Contact email (polite pool)',\n 'option.openalex.mailto.placeholder': 'you@example.org',\n 'option.semanticscholar.year': 'Year',\n 'option.semanticscholar.year.placeholder': 'e.g. 2020 or 2018-2024',\n 'option.semanticscholar.fieldsOfStudy': 'Fields of study',\n 'option.semanticscholar.fieldsOfStudy.placeholder': 'e.g. Computer Science',\n 'option.semanticscholar.publicationTypes': 'Publication types',\n 'option.semanticscholar.publicationTypes.placeholder': 'e.g. JournalArticle,Review',\n\n 'value.auto': 'Auto',\n 'value.fast': 'Fast',\n 'value.instant': 'Instant',\n 'value.basic': 'Basic',\n 'value.advanced': 'Advanced',\n 'value.ultra-fast': 'Ultra-fast',\n 'value.general': 'General',\n 'value.news': 'News',\n 'value.finance': 'Finance',\n 'value.web': 'Web',\n 'value.research_paper': 'Research papers',\n 'value.low': 'Low',\n 'value.medium': 'Medium',\n 'value.high': 'High',\n\n 'options.invalidLine': 'Line {line} is not valid',\n 'options.tooMany': 'At most {max} lines',\n 'options.invalidItem': 'Line {line} (“{item}”) is not a domain with an optional path',\n 'options.exclusive': 'Clear “{other}” first: only one of the two lists can be set',\n\n 'connection.sessionModel': 'Conversation model',\n 'services.sessionModel.summary': 'Follows the conversation model · key or sign-in is checked per conversation',\n 'services.sessionModel.note': \"Searches with the conversation's current model, endpoint and credentials: a DeepSeek API key or account, or a route in Models settings that declares one of the three protocols. The query goes to that model's provider, which bills server-side search per search; the model's answer and the sources it cites are returned. Each option applies only on the protocols named above it. DeepSeek routes use web_search_20250305 unless a search tool version is set here.\",\n 'status.sessionModelReady': \"{access} · sent to the conversation model's provider\",\n 'status.modelReady': '{access} · model search · sent to {name}',\n 'status.sessionModelNeedsKey': \"The conversation model's API key isn't set\",\n 'status.sessionModelNeedsSignIn': 'Sign in to the DeepSeek account again',\n 'status.reason.no-model': \"The model for this conversation's next request isn't known yet\",\n 'status.reason.unknown-route': \"Can't read the settings of this model's provider\",\n 'status.reason.protocol': 'Its route declares no supported api',\n 'status.reason.endpoint': 'Its route has no fixed endpoint',\n 'status.reason.headers': \"Its route's custom headers aren't supported\",\n 'status.reason.credential': \"Its route doesn't name a single API key\",\n\n 'model.format': 'Model search · {protocol}',\n 'model.id': 'Model',\n 'model.idHint': 'The model ID the service expects, such as claude-sonnet-4-5 or gpt-5-search-api.',\n 'model.endpointHint': 'Required: the API base URL. See the example under Service.',\n 'model.note': \"The query and this connection's key go to the endpoint below; server-side search is billed per search. The model's answer and the sources it cites are returned.\",\n 'model.protocol.anthropic-messages': \"Anthropic's server-side web search. Endpoint such as https://api.anthropic.com (/v1 is added). For DeepSeek use https://api.deepseek.com/anthropic and set Search tool version to web_search_20250305 or web_search_20260209.\",\n 'model.protocol.openai-responses': \"OpenAI's web_search tool. Endpoint such as https://api.openai.com/v1 (include /v1). DeepSeek runs it only on deepseek-v4-pro and returns no sources.\",\n 'model.protocol.openai-chat-completions': \"For OpenAI search models such as gpt-5-search-api and compatible gateways. Endpoint such as https://api.openai.com/v1 (include /v1). DeepSeek's Chat Completions has no server-side search; for DeepSeek use Anthropic Messages.\",\n 'draft.model': 'Enter a model ID of up to 200 characters without control characters.',\n\n 'option.model.maxTokens': 'Max output tokens',\n 'option.model.maxTokens.hint': 'Anthropic Messages defaults to 4096; OpenAI sends no limit unless set, and Responses needs at least 16.',\n 'option.model.maxTokens.anthropicHint': 'Defaults to 4096.',\n 'option.model.maxTokens.responsesHint': 'No limit is sent unless set; at least 16.',\n 'option.model.maxTokens.chatHint': 'No limit is sent unless set.',\n 'option.model.anthropicTool': 'Search tool version',\n 'option.model.anthropicTool.hint': 'Defaults to web_search_20260318, or web_search_20250305 when the conversation model is on a DeepSeek route. DeepSeek accepts only web_search_20250305 and web_search_20260209.',\n 'option.model.anthropicTool.fixedHint': 'Defaults to web_search_20260318. DeepSeek accepts only web_search_20250305 and web_search_20260209.',\n 'option.model.maxUses': 'Max searches per request',\n 'option.model.maxUses.hint': 'Defaults to 5.',\n 'option.model.allowedCallers': 'Allowed callers',\n 'option.model.allowedCallers.hint': 'web_search_20260209 and later run search through code execution by default; models without programmatic tool calling need direct, or the request is refused.',\n 'option.model.responseInclusion': 'Search results in the reply',\n 'option.model.responseInclusion.hint': 'web_search_20260318 or later. Left out drops results that code execution already consumed from the reply, and so from the returned sources; direct searches always include them.',\n 'option.model.responsesTool': 'Search tool',\n 'option.model.responsesTool.hint': 'Defaults to web_search. web_search_preview is the older tool: no domain filters or result token budget, and it ignores Live web access.',\n 'option.model.searchContextSize': 'Search context size',\n 'option.model.searchContextSize.hint': 'More context costs more and takes longer.',\n 'option.model.externalWebAccess': 'Live web access',\n 'option.model.externalWebAccess.hint': 'When off, the search uses cached content instead of fetching pages live.',\n 'option.model.returnTokenBudget': 'Result token budget',\n 'option.model.returnTokenBudget.hint': 'Applies only to reasoning search on GPT-5 and later.',\n 'option.model.allowedDomains': 'Only these domains',\n 'option.model.blockedDomains': 'Never these domains',\n 'option.model.domains.placeholder': 'example.com\\ndocs.example.com/api',\n 'option.model.domains.sessionHint': 'One per line: a domain with an optional path, without https://. Set only one of the two lists.',\n 'option.model.domains.exclusiveHint': 'One per line: a domain with an optional path, without https://. Anthropic Messages accepts only one of the two lists.',\n 'option.model.domains.bothHint': 'One per line: a domain with an optional path, without https://. OpenAI Responses accepts both lists together.',\n 'option.model.userCity': 'City',\n 'option.model.userRegion': 'Region',\n 'option.model.userCountry': 'Country or region',\n 'option.model.userCountry.placeholder': 'Two-letter code, e.g. US',\n 'option.model.userTimezone': 'Time zone',\n 'option.model.userTimezone.placeholder': 'e.g. America/New_York',\n 'option.model.location.hint': 'Approximate user location used to localize results.',\n\n 'value.full': 'Included',\n 'value.excluded': 'Left out',\n 'value.default': 'Standard',\n 'value.unlimited': 'Unlimited',\n\n 'confirm.cancel': 'Cancel',\n} as const\n\n/** Every key of the namespace. */\nexport type LocaleKey = keyof typeof en\n\nexport const zh: Record<LocaleKey, string> = {\n 'list.separator': '、',\n 'list.locale': 'zh-CN',\n 'section.title': '搜索',\n 'source.session': '本会话',\n 'source.inherited': '来自父会话',\n 'source.model': '该模型上次的选择',\n 'source.default': '默认连接',\n 'access.apiKey': 'API Key',\n 'pairings.failed': '读取模型记忆失败,请重试。',\n 'pairings.forgetFailed': '未清除模型记忆,请重试。',\n 'route.unknown': '无法确认 web_search 是否由本插件提供。',\n 'services.remoteNotice': '搜索查询会发送给 {name}。',\n 'pairings.title': '模型记忆',\n 'pairings.hint': '在会话里选择连接(包括关闭)时,会为该会话的模型记住这次选择,该模型的新会话会沿用它。清除后,还没有自行选择的会话改用默认连接。',\n 'pairings.loading': '正在读取模型记忆…',\n 'pairings.empty': '没有模型记忆。',\n 'pairings.forget': '清除记忆',\n 'option.native.baseURL': 'API 基础地址',\n 'option.native.model': '模型',\n 'option.native.apiVersion': 'API 版本',\n 'option.native.maxTokens': '最大输出 Token',\n 'option.native.maxUses': '单次请求最多搜索次数',\n 'option.native.count': '每次搜索结果数',\n 'option.native.sendOriginalQuestion': '附带用户原始问题',\n\n 'saving': '正在保存…',\n\n 'connection.off': '搜索已关闭',\n\n 'access.keyless': '无需密钥',\n 'access.account': 'DeepSeek 账号',\n\n 'freshness.auto': '自动',\n 'freshness.fresh': '24 小时内',\n 'freshness.realtime': '实时',\n\n 'status.disabled': '{name} 未在设置中启用。',\n 'status.needsCredential': '需要 API Key',\n 'status.needsAccount': '需要 DeepSeek 账号或 API Key',\n 'status.unsupported': '本版本不支持 {name}。',\n 'status.short.needsCredential': '未配置密钥',\n 'status.short.needsSignIn': '需要登录',\n 'status.short.unsupported': '不支持',\n 'status.remoteReady': '{access} · 查询会发送给 {name}',\n\n 'selector.services': '搜索连接',\n 'selector.freshness': '内容实时性',\n 'selector.freshnessIgnored': '{name} 不支持此偏好,选择不会生效。',\n 'selector.offRow': '关闭',\n\n 'write.conflict': '搜索设置已在别处更改,菜单已显示最新选择。',\n 'write.unavailable': '该连接未启用或已移除。',\n 'write.failed': '保存失败,请重试。',\n\n 'command.label': '搜索连接',\n 'command.description': '切换当前会话的搜索连接与内容实时性',\n 'command.placeholder': '筛选搜索选项',\n 'command.empty': '没有已启用的搜索连接',\n 'command.noResults': '没有匹配的选项',\n 'command.current': '当前',\n 'command.readFailed': '读取搜索设置失败,请重试。',\n\n 'settings.intro': '每个会话通过地球按钮或 /setup-search 选择搜索连接。本页设置默认值及各连接的参数。状态点只反映配置,不代表额度或服务可用性。',\n 'settings.loading': '正在读取设置…',\n 'settings.retiredSecret': '{fields}:本版本不读取这些 0.1.x 设置。来源层已隐藏,请手动从组合包设置中移除。',\n 'settings.readOnly': '当前设置为只读。',\n 'settings.unsupported': '无法读取这些搜索设置,可能来自 0.1.x 或更新的版本。请在下方恢复默认设置,或升级插件。',\n 'settings.refused': '未保存:设置可能已在别处更改,请检查后重试。',\n 'settings.invalid': '设置无效,未保存。',\n 'settings.failed': '未保存,请检查与 DSH 的连接后重试。',\n 'route.auto': 'web 行没有指定搜索 provider,这里的设置可能不生效。请在插件页打开本组合包,改回 {id}。',\n 'route.other': 'web_search 当前由 {provider} 提供,不是 {id},这里的设置不会生效。请在插件页打开本组合包,改回 {id}。',\n 'route.deepseekApi': '搜索正在使用内置 API provider,而非 {id}。请在 组合包页面检查并恢复两项增强 provider 路由。',\n\n 'defaults.title': '默认值',\n 'defaults.connection': '默认连接',\n 'defaults.connectionHint': '未自行选择的会话依次使用该模型上次的选择、默认连接。仅 subagent_fork 继承父会话选择;普通分叉与 spawn 独立选择。',\n 'defaults.connectionUnset': '默认({name})',\n 'defaults.connectionMissing': '不存在:{id}',\n 'defaults.freshness': '默认实时性',\n 'defaults.freshnessHint': '用于新会话。仅对 {services} 生效,其他连接忽略。',\n 'defaults.showSelector': '在输入框菜单中显示搜索连接',\n 'defaults.showSelectorHint': '隐藏后可用 /setup-search 切换当前会话。',\n 'defaults.freshnessKeyOnly': '{name}(个人密钥)',\n\n 'services.title': '搜索连接',\n 'services.optInNotice': '远程服务默认关闭。',\n 'enhanced.title': '增强工具',\n 'enhanced.description': '让 Agent 用 web_search_enhanced 在已启用的服务中自行选择本次搜索用哪个,并用 list_web_search_providers 查看可选项。只影响之后新建的会话。',\n 'enhanced.consent': '打开即表示同意:Agent 选用某个服务时,查询会发送给该服务。',\n 'services.enable': '启用 {name}',\n 'services.configure': '配置',\n 'services.configureLabel': '配置 {name}',\n 'services.off': '未启用',\n 'services.keyless': '无需密钥',\n 'services.personalKey': '个人密钥 {ref}',\n 'services.account': 'DeepSeek 账号或 {ref}',\n 'services.access': '访问方式',\n 'services.accessKeyless': '免密钥',\n 'services.accessPersonal': '个人密钥',\n 'services.accountHint': '使用 DeepSeek 账号模型的会话通过账号搜索;其他会话使用下方的 API Key。',\n 'services.getKey': '获取 API Key',\n 'services.accessHint.keyless': '使用服务的公共接口和共享额度,不发送你的密钥。',\n 'services.accessHint.apiKey': '使用你的 API Key 和个人额度,可设置请求参数。',\n\n 'credential.label': 'API Key',\n 'credential.placeholder': '输入新的密钥',\n 'credential.save': '保存密钥',\n 'credential.saved': '密钥已保存。',\n 'credential.failed': '密钥未保存,请重试。',\n 'credential.hint': '以 {ref} 保存到 DSH 凭据,不写入设置。',\n 'credential.set': '已配置',\n 'credential.unset': '未配置',\n 'credential.manage': '设置密钥',\n 'credential.reference': '凭据名称',\n 'credential.referenceHint': 'DSH 凭据中的名称,不是密钥本身。留空使用默认名称。',\n 'services.trustUnsaved': '尚未保存:请先确认信任此地址。',\n 'options.on': '开',\n 'options.off': '关',\n\n 'options.title': '请求参数',\n 'options.hint': '修改后自动保存。留空使用服务默认值。',\n 'options.default': '默认',\n 'options.invalid': '格式无效',\n 'options.keylessMore': '使用个人密钥时可设置更多参数。',\n\n\n 'custom.title': '自定义连接',\n 'custom.empty': '还没有自定义连接。',\n 'custom.addStructured': '添加搜索服务',\n 'custom.kindStructured': '搜索服务',\n 'custom.edit': '编辑',\n 'custom.remove': '移除',\n 'custom.removeConfirm': '确定移除自定义连接“{name}”?凭据不会删除。',\n\n 'editor.titleNew': '新建连接',\n 'editor.titleEdit': '编辑 {id}',\n 'editor.id': 'ID',\n 'editor.idHint': '字母、数字、点、下划线或连字符。',\n 'editor.label': '名称',\n 'editor.adapter': '服务',\n 'editor.endpoint': '接口地址',\n 'editor.endpointHint': '留空使用官方地址。',\n 'editor.credentialRef': '凭据名称',\n 'editor.credentialRefHint': 'DSH 凭据的名称,例如 SEARCH_API_KEY,不是密钥本身。',\n 'editor.trust': '我信任此地址:允许向它发送搜索查询与凭据 {ref}。',\n 'editor.trustUnnamed': '我信任此地址:允许向它发送搜索查询与此连接的凭据。',\n 'editor.save': '保存',\n 'editor.cancel': '取消',\n 'editor.stale': '打开编辑器后设置已变化。请取消后重新打开,以免覆盖这些修改。',\n 'editor.idPlaceholder': 'my-search',\n 'editor.searchOptions': '搜索参数',\n 'editor.optionsHint': '留空使用默认值。',\n 'editor.apiKey': 'API Key(可选)',\n 'editor.apiKeyHint': '连接保存后,以上面的凭据名称写入 DSH 凭据。',\n 'editor.keyFailed': '连接已保存,但密钥未保存,请在列表中重新设置密钥。',\n\n 'draft.id': 'ID 必须以 custom: 开头,后接字母、数字、点、下划线或连字符。',\n 'draft.duplicate': '此 ID 已被使用。',\n 'draft.label': '请填写名称。',\n 'draft.trust': '请确认信任此地址。',\n 'draft.credentialRef': '凭据名称只能包含字母、数字和下划线,且不能以数字开头。',\n 'draft.endpoint': '请输入完整的 http(s) 地址。',\n 'draft.options': '请修正标红的参数。',\n\n 'reset.button': '恢复默认设置',\n 'reset.hint': '将全部搜索设置恢复为默认值,自定义连接也会被删除;已保存的密钥不受影响。',\n 'reset.confirm': '确定将全部搜索设置恢复为默认值?',\n 'reset.confirmButton': '恢复',\n\n 'option.exa.type': '搜索类型',\n 'option.firecrawl.country': '国家/地区',\n 'option.firecrawl.country.placeholder': '两位代码,如 us',\n 'option.firecrawl.location': '位置',\n 'option.firecrawl.location.placeholder': '如 Shanghai, China',\n 'option.firecrawl.safe': '安全搜索',\n 'option.tavily.search_depth': '搜索深度',\n 'option.tavily.topic': '主题',\n 'option.tinyfish.location': '地区',\n 'option.tinyfish.location.placeholder': '两位代码,如 cn',\n 'option.tinyfish.language': '语言',\n 'option.tinyfish.language.placeholder': '如 zh 或 en-US',\n 'option.tinyfish.purpose': '用途说明',\n 'option.tinyfish.purpose.placeholder': '简述搜索目的',\n 'option.tinyfish.domain_type': '内容类型',\n 'option.anysearch.zone': '地区',\n 'option.anysearch.language': '偏好语言',\n 'option.anysearch.language.placeholder': '如 zh-CN 或 en',\n 'option.openalex.sort': '排序',\n 'option.openalex.sort.placeholder': '如 cited_by_count:desc',\n 'option.openalex.filter': '过滤条件',\n 'option.openalex.filter.placeholder': '如 publication_year:2024',\n 'option.openalex.is_oa': '仅开放获取',\n 'option.openalex.mailto': '联系邮箱(Polite Pool)',\n 'option.openalex.mailto.placeholder': 'you@example.org',\n 'option.semanticscholar.year': '年份',\n 'option.semanticscholar.year.placeholder': '如 2020 或 2018-2024',\n 'option.semanticscholar.fieldsOfStudy': '学科',\n 'option.semanticscholar.fieldsOfStudy.placeholder': '如 Computer Science',\n 'option.semanticscholar.publicationTypes': '出版类型',\n 'option.semanticscholar.publicationTypes.placeholder': '如 JournalArticle,Review',\n\n 'value.auto': '自动',\n 'value.fast': '快速',\n 'value.instant': '即时',\n 'value.basic': '基础',\n 'value.advanced': '深入',\n 'value.ultra-fast': '超快',\n 'value.general': '通用',\n 'value.news': '新闻',\n 'value.finance': '财经',\n 'value.web': '网页',\n 'value.research_paper': '学术论文',\n 'value.low': '低',\n 'value.medium': '中',\n 'value.high': '高',\n\n 'options.invalidLine': '第 {line} 行格式无效',\n 'options.tooMany': '最多 {max} 行',\n 'options.invalidItem': '第 {line} 行(“{item}”)不是域名或域名加路径',\n 'options.exclusive': '请先清空“{other}”:两项只能填一项',\n\n 'connection.sessionModel': '会话模型',\n 'services.sessionModel.summary': '跟随会话模型 · 密钥或登录按会话检查',\n 'services.sessionModel.note': '用会话当前的模型、接口地址与凭据搜索:DeepSeek API Key 或账号,或在模型设置里声明了三种协议之一的路由。查询发送给该模型的服务商,服务端网页搜索按次计费;返回模型的回答与它引用的来源。每项参数只在其分组标题列出的协议上生效。DeepSeek 路由使用 web_search_20250305,除非这里设置了搜索工具版本。',\n 'status.sessionModelReady': '{access} · 查询发送给会话模型的服务商',\n 'status.modelReady': '{access} · 模型搜索 · 查询发送给 {name}',\n 'status.sessionModelNeedsKey': '会话模型的 API Key 未设置',\n 'status.sessionModelNeedsSignIn': '请重新登录 DeepSeek 账号',\n 'status.reason.no-model': '还不知道本会话下一次请求用哪个模型',\n 'status.reason.unknown-route': '无法读取会话模型服务商的设置',\n 'status.reason.protocol': '该路由在模型设置里没有声明支持的 api',\n 'status.reason.endpoint': '该路由在模型设置里没有固定的接口地址',\n 'status.reason.headers': '该路由带自定义请求头,暂不支持',\n 'status.reason.credential': '该路由没有指明唯一的 API Key 名称',\n\n 'model.format': '模型搜索 · {protocol}',\n 'model.id': '模型',\n 'model.idHint': '服务方要求的模型 ID,例如 claude-sonnet-4-5 或 gpt-5-search-api。',\n 'model.endpointHint': '必填:API 的基础地址,示例见上方“服务”的说明。',\n 'model.note': '查询与此连接的密钥会发送到下方的接口地址;服务端网页搜索按次计费。返回模型的回答与它引用的来源。',\n 'model.protocol.anthropic-messages': 'Anthropic 的服务端网页搜索。接口地址如 https://api.anthropic.com(会自动补 /v1)。用于 DeepSeek 时请填写 https://api.deepseek.com/anthropic,并把搜索工具版本设为 web_search_20250305 或 web_search_20260209。',\n 'model.protocol.openai-responses': 'OpenAI 的 web_search 工具。接口地址如 https://api.openai.com/v1(需要写上 /v1)。DeepSeek 只在 deepseek-v4-pro 上执行,且不返回来源。',\n 'model.protocol.openai-chat-completions': '用于 OpenAI 搜索模型(如 gpt-5-search-api)与兼容网关。接口地址如 https://api.openai.com/v1(需要写上 /v1)。DeepSeek 的 Chat Completions 没有服务端网页搜索,DeepSeek 请用 Anthropic Messages。',\n 'draft.model': '请填写模型 ID(不超过 200 个字符,不含控制字符)。',\n\n 'option.model.maxTokens': '最大输出 Token',\n 'option.model.maxTokens.hint': 'Anthropic Messages 缺省 4096;OpenAI 不设时不发送上限,Responses 至少为 16。',\n 'option.model.maxTokens.anthropicHint': '缺省 4096。',\n 'option.model.maxTokens.responsesHint': '不设时不发送上限;至少为 16。',\n 'option.model.maxTokens.chatHint': '不设时不发送上限。',\n 'option.model.anthropicTool': '搜索工具版本',\n 'option.model.anthropicTool.hint': '缺省 web_search_20260318;会话模型跟随 DeepSeek 路由时为 web_search_20250305。DeepSeek 只接受 web_search_20250305 与 web_search_20260209。',\n 'option.model.anthropicTool.fixedHint': '缺省 web_search_20260318。DeepSeek 只接受 web_search_20250305 与 web_search_20260209。',\n 'option.model.maxUses': '单次请求最多搜索次数',\n 'option.model.maxUses.hint': '缺省 5。',\n 'option.model.allowedCallers': '允许的调用方',\n 'option.model.allowedCallers.hint': 'web_search_20260209 及以后的版本缺省经代码执行调用搜索;不支持程序化工具调用的模型要设为 direct,否则请求被拒。',\n 'option.model.responseInclusion': '回复中的搜索结果',\n 'option.model.responseInclusion.hint': '只对 web_search_20260318 及以后的版本生效。选“不包含”时,已被代码执行消费的搜索结果不进回复,也就不进返回的来源;直接搜索的结果总会包含。',\n 'option.model.responsesTool': '搜索工具',\n 'option.model.responsesTool.hint': '缺省 web_search。web_search_preview 是旧版工具:不支持域名过滤与结果 Token 预算,忽略“实时访问网页”。',\n 'option.model.searchContextSize': '搜索上下文大小',\n 'option.model.searchContextSize.hint': '越大收集的上下文越多,费用与延迟也越高。',\n 'option.model.externalWebAccess': '实时访问网页',\n 'option.model.externalWebAccess.hint': '关闭时只用缓存的内容,不实时抓取网页。',\n 'option.model.returnTokenBudget': '结果 Token 预算',\n 'option.model.returnTokenBudget.hint': '只对 GPT-5 及以上的推理搜索生效。',\n 'option.model.allowedDomains': '只搜索这些域名',\n 'option.model.blockedDomains': '排除这些域名',\n 'option.model.domains.placeholder': 'example.com\\ndocs.example.com/api',\n 'option.model.domains.sessionHint': '一行一个,只写域名与可选路径,不写 https://。两项只能二选一。',\n 'option.model.domains.exclusiveHint': '一行一个,只写域名与可选路径,不写 https://。Anthropic Messages 上两项只能二选一。',\n 'option.model.domains.bothHint': '一行一个,只写域名与可选路径,不写 https://。OpenAI Responses 可同时设置两项。',\n 'option.model.userCity': '城市',\n 'option.model.userRegion': '地区',\n 'option.model.userCountry': '国家/地区',\n 'option.model.userCountry.placeholder': '两位代码,如 CN',\n 'option.model.userTimezone': '时区',\n 'option.model.userTimezone.placeholder': '如 Asia/Shanghai',\n 'option.model.location.hint': '用户的大致位置,用于本地化结果。',\n\n 'value.full': '包含',\n 'value.excluded': '不包含',\n 'value.default': '标准',\n 'value.unlimited': '不限',\n\n 'confirm.cancel': '取消',\n}\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Composer search selector, /setup-search, and settings page. */\n 'web-search-enhanced': LocaleKey\n }\n}\n","import { PairingsStatus as CorePairingsStatus } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchConnectionsRemote } from './selection.ts'\nimport type { Translate } from './connections.ts'\nexport class PairingsStatus extends CorePairingsStatus {\n constructor(remote: SearchConnectionsRemote, t: Translate) { super(remote, () => t('pairings.forgetFailed')) }\n}\n","import type { ConfigForm, ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { RouteStatus, clientRoute, type WebSelection } from 'dsh-tool-web-enhanced-core/client'\nimport { WEB_FIELD, type ProviderView } from 'dsh-tool-web-enhanced-core/shared'\nimport type { SearchConnectionsRemote } from './selection.ts'\nexport type { WebSelection } from 'dsh-tool-web-enhanced-core/client'\nexport const searchRoute = (web: ConfigFormSnapshot<WebSelection>, host: ProviderView | undefined) => clientRoute(web, host, WEB_FIELD.search)\nexport class SearchRouteStatus extends RouteStatus {\n constructor(web: ConfigForm<WebSelection>) { super(web, WEB_FIELD.search) }\n override attach(reader: SearchConnectionsRemote): () => void { return super.attach(reader) }\n}\n","import { createElement, useEffect, useState } from 'react'\nimport type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport { SegmentedControl } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { useObservable, type ConnectionSection } from 'dsh-tool-web-enhanced-core/client'\nimport { FRESHNESS, type Freshness } from '../catalog.ts'\nimport { describe, freshnessLabel, sourceText, writeFailureText, type Translate } from './connections.ts'\nimport type { SearchSelectionStore } from './selection.ts'\nimport css from './Section.module.css'\n\nexport function searchSection(selection: SearchSelectionStore, settings: ObservableSnapshot<(() => void) | undefined>, remoteServicesOff: ObservableSnapshot<boolean>, t: Translate): ConnectionSection {\n function Options({ sessionId }: { readonly sessionId: string }) {\n const state = useObservable(selection.source(sessionId))\n const [error, setError] = useState('')\n useEffect(() => { void selection.load(sessionId) }, [sessionId])\n const view = state.view\n if (view === undefined || view.selection.connectionId === null) return null\n const selected = view.connections.find(connection => connection.id === view.selection.connectionId)\n if (selected === undefined) return null\n if (!selected.freshness) return createElement('p', { className: css.caption }, t('selector.freshnessIgnored', { name: describe(selected, t).label }))\n const onChange = async (next: Freshness) => {\n const result = await selection.set(sessionId, { options: { freshness: next } })\n setError(result.ok ? '' : writeFailureText(result.error, t))\n }\n return createElement('div', { className: css.container },\n createElement('div', { className: css.label }, t('selector.freshness')),\n createElement(SegmentedControl<Freshness>, {\n id: `search-freshness-${sessionId}`,\n label: t('selector.freshness'),\n value: view.selection.options.freshness,\n disabled: state.saving,\n options: FRESHNESS.map(mode => ({\n value: mode,\n label: freshnessLabel(mode, t),\n })),\n onChange,\n className: css.segmented,\n }),\n error === '' ? null : createElement('p', { role: 'alert', className: css.error }, error))\n }\n return {\n capability: 'search', order: 10, title: () => t('section.title'), selection, settings, remoteServicesOff, Options,\n describe: connection => describe(connection, t),\n sourceText: view => sourceText(view, t),\n writeFailureText: error => writeFailureText(error, t),\n }\n}\n","import type { TypertRemoteNamespace } from '@deepseek-ai/dsh-typert-protocol'\nimport { ConnectionSelectionStore, type SelectionState as CoreSelectionState } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchSelectionView } from '../contract.ts'\nexport type { SelectionUpdate, WriteResult } from 'dsh-tool-web-enhanced-core/client'\nexport type SearchConnectionsRemote = TypertRemoteNamespace<'searchConnections'>\nexport type SelectionState = CoreSelectionState<SearchSelectionView>\nexport class SearchSelectionStore extends ConnectionSelectionStore<SearchSelectionView> {\n constructor(remote: SearchConnectionsRemote, changed: () => void = () => {}) { super(remote, changed) }\n}\n","import { createCredentialEditor } from 'dsh-tool-web-enhanced-core/client'\nimport type { LocaleKey } from '../locales.ts'\nimport css from './Settings.module.css'\nexport type { SaveCredential } from 'dsh-tool-web-enhanced-core/client'\nexport const CredentialEditor = createCredentialEditor<LocaleKey>({ classes: css, keys: {\n 'credential.label': 'credential.label',\n 'credential.set': 'credential.set',\n 'credential.unset': 'credential.unset',\n 'credential.placeholder': 'credential.placeholder',\n 'saving': 'saving',\n 'credential.save': 'credential.save',\n 'credential.saved': 'credential.saved',\n 'credential.failed': 'credential.failed',\n 'credential.hint': 'credential.hint',\n} })\n","/** Read-only facts the settings page derives from the effective settings and the catalog. */\nimport {\n connectionChoices as catalogChoices, connectionName as catalogConnectionName, protocolGroups,\n type ClientTranslate, type Choice, type OptionCopy, type OptionCopyTable, type OptionGroup,\n} from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG, MODEL_PROTOCOLS, type CatalogKey, type ModelProtocol } from '../../catalog.ts'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { Translate } from '../connections.ts'\nimport type { LocaleKey } from '../locales.ts'\n\n/** Catalog names are service names, except the Session-model connection, which is described in the reader's language. */\nexport function localLabel(key: CatalogKey, t: ClientTranslate<LocaleKey>): string {\n return key === 'session-model' ? t('connection.sessionModel') : CATALOG[key].label\n}\n\n/** Connections a default can name, in catalog order. */\nexport const connectionChoices = (config: SearchSettings, t: Translate): Choice[] => catalogChoices(CATALOG, config, key => localLabel(key, t))\n\nexport const connectionName = (id: string, config: SearchSettings, t: ClientTranslate<LocaleKey>): string => catalogConnectionName(CATALOG, config, id, key => localLabel(key, t))\n\n/** Model options; the group title (Conversation model) or the protocol (fixed connection) says where each applies. */\nconst MODEL_COPY = {\n maxTokens: { label: 'option.model.maxTokens', hint: 'option.model.maxTokens.hint' },\n anthropicTool: { label: 'option.model.anthropicTool', hint: 'option.model.anthropicTool.hint' },\n maxUses: { label: 'option.model.maxUses', hint: 'option.model.maxUses.hint' },\n allowedCallers: { label: 'option.model.allowedCallers', hint: 'option.model.allowedCallers.hint' },\n responseInclusion: { label: 'option.model.responseInclusion', hint: 'option.model.responseInclusion.hint' },\n responsesTool: { label: 'option.model.responsesTool', hint: 'option.model.responsesTool.hint' },\n searchContextSize: { label: 'option.model.searchContextSize', hint: 'option.model.searchContextSize.hint' },\n externalWebAccess: { label: 'option.model.externalWebAccess', hint: 'option.model.externalWebAccess.hint' },\n returnTokenBudget: { label: 'option.model.returnTokenBudget', hint: 'option.model.returnTokenBudget.hint' },\n allowedDomains: { label: 'option.model.allowedDomains', placeholder: 'option.model.domains.placeholder', hint: 'option.model.domains.sessionHint' },\n blockedDomains: { label: 'option.model.blockedDomains', placeholder: 'option.model.domains.placeholder', hint: 'option.model.domains.sessionHint' },\n // The location is explained once, on its first field.\n userCity: { label: 'option.model.userCity', hint: 'option.model.location.hint' },\n userRegion: { label: 'option.model.userRegion' },\n userCountry: { label: 'option.model.userCountry', placeholder: 'option.model.userCountry.placeholder' },\n userTimezone: { label: 'option.model.userTimezone', placeholder: 'option.model.userTimezone.placeholder' },\n} as const satisfies Readonly<Record<string, OptionCopy<LocaleKey>>>\n\n/**\n * A fixed connection speaks one protocol, so its hints say only what holds\n * there: that protocol's token default, whether it takes both domain lists,\n * and the tool default without the conversation model's DeepSeek rule.\n */\nconst PROTOCOL_HINTS = {\n 'anthropic-messages': { maxTokens: 'option.model.maxTokens.anthropicHint', domains: 'option.model.domains.exclusiveHint' },\n 'openai-responses': { maxTokens: 'option.model.maxTokens.responsesHint', domains: 'option.model.domains.bothHint' },\n 'openai-chat-completions': { maxTokens: 'option.model.maxTokens.chatHint', domains: 'option.model.domains.bothHint' },\n} as const satisfies Record<ModelProtocol, { readonly maxTokens: LocaleKey; readonly domains: LocaleKey }>\n\n/** Copy for the options of one protocol of a custom model connection. */\nexport function protocolCopy(protocol: ModelProtocol): OptionCopyTable<LocaleKey> {\n const hints = PROTOCOL_HINTS[protocol]\n return { fallback: 'options.title', options: {\n ...MODEL_COPY,\n maxTokens: { ...MODEL_COPY.maxTokens, hint: hints.maxTokens },\n anthropicTool: { ...MODEL_COPY.anthropicTool, hint: 'option.model.anthropicTool.fixedHint' },\n allowedDomains: { ...MODEL_COPY.allowedDomains, hint: hints.domains },\n blockedDomains: { ...MODEL_COPY.blockedDomains, hint: hints.domains },\n } }\n}\n\n/** The Session-model connection takes every protocol's options; grouped by the protocols that apply them. */\nexport const SESSION_MODEL_GROUPS: readonly OptionGroup[] = protocolGroups(MODEL_PROTOCOLS)\n\nconst OPTION_COPY: Readonly<Record<CatalogKey, Readonly<Record<string, OptionCopy<LocaleKey>>>>> = {\n 'deepseek-messages': {\n baseURL: { label: 'option.native.baseURL' },\n model: { label: 'option.native.model' },\n apiVersion: { label: 'option.native.apiVersion' },\n maxTokens: { label: 'option.native.maxTokens' },\n maxUses: { label: 'option.native.maxUses' },\n },\n 'deepseek-search-api': {\n baseURL: { label: 'option.native.baseURL' },\n count: { label: 'option.native.count' },\n sendOriginalQuestion: { label: 'option.native.sendOriginalQuestion' },\n },\n 'session-model': MODEL_COPY,\n exa: {\n type: { label: 'option.exa.type' },\n },\n firecrawl: {\n country: { label: 'option.firecrawl.country', placeholder: 'option.firecrawl.country.placeholder' },\n location: { label: 'option.firecrawl.location', placeholder: 'option.firecrawl.location.placeholder' },\n safe: { label: 'option.firecrawl.safe' },\n },\n tavily: {\n search_depth: { label: 'option.tavily.search_depth' },\n topic: { label: 'option.tavily.topic' },\n },\n tinyfish: {\n location: { label: 'option.tinyfish.location', placeholder: 'option.tinyfish.location.placeholder' },\n language: { label: 'option.tinyfish.language', placeholder: 'option.tinyfish.language.placeholder' },\n purpose: { label: 'option.tinyfish.purpose', placeholder: 'option.tinyfish.purpose.placeholder' },\n domain_type: { label: 'option.tinyfish.domain_type' },\n },\n anysearch: {\n zone: { label: 'option.anysearch.zone' },\n language: { label: 'option.anysearch.language', placeholder: 'option.anysearch.language.placeholder' },\n },\n openalex: {\n sort: { label: 'option.openalex.sort', placeholder: 'option.openalex.sort.placeholder' },\n filter: { label: 'option.openalex.filter', placeholder: 'option.openalex.filter.placeholder' },\n is_oa: { label: 'option.openalex.is_oa' },\n mailto: { label: 'option.openalex.mailto', placeholder: 'option.openalex.mailto.placeholder' },\n },\n semanticscholar: {\n year: { label: 'option.semanticscholar.year', placeholder: 'option.semanticscholar.year.placeholder' },\n fieldsOfStudy: { label: 'option.semanticscholar.fieldsOfStudy', placeholder: 'option.semanticscholar.fieldsOfStudy.placeholder' },\n publicationTypes: { label: 'option.semanticscholar.publicationTypes', placeholder: 'option.semanticscholar.publicationTypes.placeholder' },\n },\n}\n\n/** Copy for the options of one catalog entry. */\nexport const optionCopy = (key: CatalogKey): OptionCopyTable<LocaleKey> => ({ options: OPTION_COPY[key], fallback: 'options.title' })\n\nconst VALUE_LABELS: Readonly<Record<string, LocaleKey>> = {\n 'auto': 'value.auto', 'fast': 'value.fast', 'instant': 'value.instant', 'basic': 'value.basic', 'advanced': 'value.advanced',\n 'ultra-fast': 'value.ultra-fast', 'general': 'value.general', 'news': 'value.news', 'finance': 'value.finance', 'web': 'value.web',\n 'research_paper': 'value.research_paper', 'low': 'value.low', 'medium': 'value.medium', 'high': 'value.high',\n 'full': 'value.full', 'excluded': 'value.excluded', 'default': 'value.default', 'unlimited': 'value.unlimited',\n}\n\n/** Localized enum value where it is a word; codes stay verbatim. */\nexport function valueLabel(value: string, t: ClientTranslate<LocaleKey>): string {\n const key = VALUE_LABELS[value]\n return key === undefined ? value : t(key)\n}\n","import { createSettingsParts, type SettingsDoc as CoreSettingsDoc } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport css from './Settings.module.css'\nexport { classNames, applyOps, SettingsValidationError, type WriteSettings, type WriteState, type SelectOption } from 'dsh-tool-web-enhanced-core/client'\nexport type SettingsDoc = CoreSettingsDoc<SearchSettings>\nexport const settingsParts = createSettingsParts<LocaleKey>({ classes: css, keys: {\n refused: 'settings.refused', invalid: 'settings.invalid', failed: 'settings.failed',\n} })\nexport const { Section, SettingRow, SelectMenu, ErrorText, ConfirmRow, useWrite } = settingsParts\n","import { createOptionsEditor } from 'dsh-tool-web-enhanced-core/client'\nimport type { LocaleKey } from '../locales.ts'\nimport { valueLabel } from './model.ts'\nimport { settingsParts } from './parts.tsx'\nimport css from './Settings.module.css'\nexport const optionsEditor = createOptionsEditor<LocaleKey>({ classes: css, parts: settingsParts, valueLabel,\n keys: { 'options.default': 'options.default', 'options.invalid': 'options.invalid', 'options.invalidLine': 'options.invalidLine', 'options.tooMany': 'options.tooMany', 'options.invalidItem': 'options.invalidItem', 'options.exclusive': 'options.exclusive', 'options.on': 'options.on', 'options.off': 'options.off' },\n})\nexport const { OptionFields, OptionsForm } = optionsEditor\n","import { createSparseSettings } from 'dsh-tool-web-enhanced-core/client'\nimport { CURRENT_SETTINGS_VERSION, SETTINGS_FIELDS } from 'dsh-tool-web-enhanced-core/shared'\nexport type { SettingsLayers, DocumentVersion } from 'dsh-tool-web-enhanced-core/client'\n\nexport const { documentVersion, sparseSettingOperations, resetSettingsOperations } = createSparseSettings({\n version: CURRENT_SETTINGS_VERSION, fields: SETTINGS_FIELDS,\n})\n","import { createCustomConnectionsSection } from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG, DEFAULT_CONNECTION, MODEL_PROTOCOLS, type ModelProtocol } from '../../catalog.ts'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { CredentialEditor } from './CredentialEditor.tsx'\nimport { optionCopy, protocolCopy } from './model.ts'\nimport { optionsEditor } from './OptionsEditor.tsx'\nimport { settingsParts } from './parts.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\n\nexport const CustomConnectionsSection = createCustomConnectionsSection<SearchSettings, typeof CATALOG, LocaleKey, ModelProtocol>({\n classes: css, parts: settingsParts, CredentialEditor, optionsEditor, sparse, catalog: CATALOG, optionCopy, defaultConnection: DEFAULT_CONNECTION,\n protocols: {\n catalog: MODEL_PROTOCOLS,\n optionCopy: protocolCopy,\n notes: {\n 'anthropic-messages': 'model.protocol.anthropic-messages',\n 'openai-responses': 'model.protocol.openai-responses',\n 'openai-chat-completions': 'model.protocol.openai-chat-completions',\n },\n keys: {\n 'model.format': 'model.format',\n 'model.id': 'model.id',\n 'model.idHint': 'model.idHint',\n 'model.endpointHint': 'model.endpointHint',\n 'model.note': 'model.note',\n 'draft.model': 'draft.model',\n },\n },\n keys: {\n 'services.remoteNotice': 'services.remoteNotice',\n 'custom.title': 'custom.title',\n 'custom.addStructured': 'custom.addStructured',\n 'custom.empty': 'custom.empty',\n 'custom.kindStructured': 'custom.kindStructured',\n 'credential.set': 'credential.set',\n 'credential.unset': 'credential.unset',\n 'credential.manage': 'credential.manage',\n 'credential.placeholder': 'credential.placeholder',\n 'custom.edit': 'custom.edit',\n 'custom.remove': 'custom.remove',\n 'services.enable': 'services.enable',\n 'custom.removeConfirm': 'custom.removeConfirm',\n 'confirm.cancel': 'confirm.cancel',\n 'editor.titleNew': 'editor.titleNew',\n 'editor.titleEdit': 'editor.titleEdit',\n 'editor.id': 'editor.id',\n 'editor.idHint': 'editor.idHint',\n 'editor.idPlaceholder': 'editor.idPlaceholder',\n 'editor.label': 'editor.label',\n 'editor.adapter': 'editor.adapter',\n 'editor.endpoint': 'editor.endpoint',\n 'editor.endpointHint': 'editor.endpointHint',\n 'editor.credentialRef': 'editor.credentialRef',\n 'editor.credentialRefHint': 'editor.credentialRefHint',\n 'editor.trust': 'editor.trust',\n 'editor.trustUnnamed': 'editor.trustUnnamed',\n 'editor.save': 'editor.save',\n 'editor.cancel': 'editor.cancel',\n 'editor.stale': 'editor.stale',\n 'editor.optionsHint': 'editor.optionsHint',\n 'editor.apiKey': 'editor.apiKey',\n 'editor.apiKeyHint': 'editor.apiKeyHint',\n 'editor.keyFailed': 'editor.keyFailed',\n 'draft.id': 'draft.id',\n 'draft.duplicate': 'draft.duplicate',\n 'draft.label': 'draft.label',\n 'draft.trust': 'draft.trust',\n 'draft.credentialRef': 'draft.credentialRef',\n 'draft.endpoint': 'draft.endpoint',\n 'draft.options': 'draft.options',\n 'options.title': 'options.title',\n 'saving': 'saving',\n },\n})\n","/** Defaults for new sessions and the composer button switch. */\nimport { Switch } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { CATALOG, FRESHNESS, honorsFreshness, type CatalogKey, type Freshness } from '../../catalog.ts'\nimport { connectionLabel, freshnessLabel, listText, type Translate } from '../connections.ts'\nimport { connectionChoices } from './model.ts'\nimport { createDefaultsSection, type CredentialStatusMap } from 'dsh-tool-web-enhanced-core/client'\nimport { resolveSettings, type Connection } from '../../settings/resolve.ts'\nimport { credentialRefsOf } from '../credentials.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { settingsParts, SelectMenu, SettingRow, type SettingsDoc, type WriteSettings } from './parts.tsx'\nimport * as sparse from './sparse.ts'\n\nconst BaseDefaultsSection = createDefaultsSection<LocaleKey>({ parts: settingsParts, sparse, keys: {\n title: 'defaults.title', connection: 'defaults.connection', connectionHint: 'defaults.connectionHint',\n connectionUnset: 'defaults.connectionUnset', connectionMissing: 'defaults.connectionMissing',\n} })\n\n/**\n * What the page can tell about the default from local facts: whether it is on\n * and has its key. The Session-model connection's route, and so its\n * credential, is known only per conversation.\n */\nfunction availability(connection: Connection, credentials: CredentialStatusMap, t: Translate) {\n const [ref] = credentialRefsOf(connection)\n const warning = t(connection.disabled ? 'status.disabled' : connection.kind === 'native' ? 'status.needsAccount' : 'status.needsCredential', { name: connectionLabel(connection, t) })\n if (ref === undefined) return { disabled: connection.disabled, access: 'none', credentialStatus: undefined, warning } as const\n return { disabled: connection.disabled, access: connection.kind === 'model' ? 'api-key' : connection.access, credentialStatus: credentials[ref], warning } as const\n}\n\nexport function DefaultsSection({ doc, write, credentials = {}, t }: { doc: SettingsDoc; write: WriteSettings; credentials?: CredentialStatusMap; t: Translate }) {\n const { defaultConnection, showSelector = true } = doc.config\n const freshness = doc.config.defaults?.freshness ?? 'auto'\n const choices = connectionChoices(doc.config, t)\n const resolved = resolveSettings(doc.config)\n const connection = resolved.connections.get(resolved.defaultConnection)\n const defaultAvailability = connection && availability(connection, credentials, t)\n\n const freshnessOptions = FRESHNESS.map(value => ({\n id: value,\n label: freshnessLabel(value, t),\n }))\n\n const freshnessServices = listText((Object.keys(CATALOG) as CatalogKey[])\n .filter(key => CATALOG[key].freshness.length > 0)\n .map(key => {\n const name = CATALOG[key].label\n return honorsFreshness(key, 'api-key') && !honorsFreshness(key, 'keyless')\n ? t('defaults.freshnessKeyOnly', { name })\n : name\n }), t)\n\n return (\n <BaseDefaultsSection doc={doc} write={write} t={t} choices={choices} defaultConnection={defaultConnection} defaultLabel={CATALOG['deepseek-messages'].label} defaultAvailability={defaultAvailability}>\n {({ disabled, save }) => <>\n <SettingRow\n title={t('defaults.freshness')}\n hint={t('defaults.freshnessHint', { services: freshnessServices })}\n >\n <SelectMenu<Freshness>\n label={t('defaults.freshness')}\n value={freshness}\n options={freshnessOptions}\n disabled={disabled}\n onChange={next => { save(['defaults', 'freshness'], next, 'auto') }}\n />\n </SettingRow>\n\n <SettingRow title={t('defaults.showSelector')} hint={t('defaults.showSelectorHint')}>\n <Switch\n checked={showSelector}\n label={t('defaults.showSelector')}\n disabled={disabled}\n onChange={next => { save(['showSelector'], next, true) }}\n />\n </SettingRow>\n\n </>}\n </BaseDefaultsSection>\n )\n}\n","import { createEnhancedToolsSection } from 'dsh-tool-web-enhanced-core/client'\nimport type { LocaleKey } from '../locales.ts'\nimport { settingsParts } from './parts.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\n\nexport const EnhancedToolsSection = createEnhancedToolsSection<LocaleKey>({\n classes: css, parts: settingsParts, sparse,\n keys: { title: 'enhanced.title', description: 'enhanced.description', consent: 'enhanced.consent' },\n})\n","import { createPairingsSection } from 'dsh-tool-web-enhanced-core/client'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { connectionName } from './model.ts'\nimport { settingsParts } from './parts.tsx'\nimport css from './Settings.module.css'\nexport const PairingsSection = createPairingsSection<SearchSettings, LocaleKey>({ classes: css, parts: settingsParts, formatConnectionName: connectionName, keys: {\n 'pairings.forgetFailed': 'pairings.forgetFailed',\n 'pairings.title': 'pairings.title',\n 'pairings.hint': 'pairings.hint',\n 'pairings.failed': 'pairings.failed',\n 'pairings.loading': 'pairings.loading',\n 'pairings.empty': 'pairings.empty',\n 'connection.off': 'connection.off',\n 'saving': 'saving',\n 'pairings.forget': 'pairings.forget',\n} })\n","import { createServicesSection } from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG, type CatalogKey } from '../../catalog.ts'\nimport type { SearchSettings } from '../../settings/types.ts'\nimport type { LocaleKey } from '../locales.ts'\nimport { CredentialEditor } from './CredentialEditor.tsx'\nimport { localLabel, optionCopy, SESSION_MODEL_GROUPS } from './model.ts'\nimport { optionsEditor } from './OptionsEditor.tsx'\nimport { settingsParts } from './parts.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\nexport const ServicesSection = createServicesSection<SearchSettings, CatalogKey, LocaleKey>({\n classes: css, parts: settingsParts, CredentialEditor, optionsEditor, sparse, catalog: CATALOG, optionCopy, label: localLabel,\n notes: { 'session-model': 'services.sessionModel.note' },\n summaries: { 'session-model': 'services.sessionModel.summary' },\n optionGroups: { 'session-model': SESSION_MODEL_GROUPS },\n keys: {\n 'services.title': 'services.title',\n 'services.optInNotice': 'services.optInNotice',\n 'options.hint': 'options.hint',\n 'options.keylessMore': 'options.keylessMore',\n 'options.invalid': 'options.invalid',\n 'options.default': 'options.default',\n 'services.remoteNotice': 'services.remoteNotice',\n 'services.off': 'services.off',\n 'services.configureLabel': 'services.configureLabel',\n 'services.configure': 'services.configure',\n 'services.enable': 'services.enable',\n 'services.access': 'services.access',\n 'services.accessKeyless': 'services.accessKeyless',\n 'services.accessPersonal': 'services.accessPersonal',\n 'services.accessHint.keyless': 'services.accessHint.keyless',\n 'services.accessHint.apiKey': 'services.accessHint.apiKey',\n 'services.accountHint': 'services.accountHint',\n 'services.getKey': 'services.getKey',\n 'services.trust': 'editor.trustUnnamed',\n 'options.title': 'options.title',\n 'services.keyless': 'services.keyless',\n 'services.account': 'services.account',\n 'services.personalKey': 'services.personalKey',\n 'credential.set': 'credential.set',\n 'credential.unset': 'credential.unset',\n 'credential.reference': 'credential.reference',\n 'credential.referenceHint': 'credential.referenceHint',\n 'services.trustUnsaved': 'services.trustUnsaved',\n },\n})\n","/**\n * The search plugin's row settings page on plugins.row.config.\n * Controls write immediately as sparse operations against the revision the\n * page shows; credentials go to DSH Credentials only.\n */\nimport { StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport { createResetSection, createRouteNotice, useSettingsDocument } from 'dsh-tool-web-enhanced-core/client'\nimport { resolveSettings } from '../../settings/resolve.ts'\nimport type { SettingsPageInjected } from '../injected.ts'\nimport type { NS, LocaleKey } from '../locales.ts'\nimport { CustomConnectionsSection } from './CustomConnections.tsx'\nimport { DefaultsSection } from './DefaultsSection.tsx'\nimport { EnhancedToolsSection } from './EnhancedToolsSection.tsx'\nimport { PairingsSection } from './PairingsSection.tsx'\nimport { settingsParts, type SettingsDoc } from './parts.tsx'\nimport { ServicesSection } from './ServicesSection.tsx'\nimport * as sparse from './sparse.ts'\nimport css from './Settings.module.css'\n\nexport type SettingsPageProps =\n & PropsRuntime<'plugins.row.config'>\n & InjectFace<SettingsPageInjected>\n & PropsLocale<typeof NS>\n\nexport function SettingsPage({\n useSettings,\n useCredentials,\n useRoute,\n usePairings,\n readSettings,\n mutate,\n saveCredential,\n forgetPairing,\n t,\n}: SettingsPageProps) {\n const snapshot = useSettings(value => value)\n const credentials = useCredentials(value => value)\n const route = useRoute(value => value)\n const pairings = usePairings(value => value)\n const { view, write, migrationError } = useSettingsDocument(snapshot, readSettings, resolveSettings, mutate)\n\n if (snapshot.status === 'unavailable') return null\n if (snapshot.value === undefined || snapshot.revision === undefined) {\n return <p className={css.status} role=\"status\"><StateDot state=\"ongoing\" />{t('settings.loading')}</p>\n }\n\n if (view === undefined) return null\n const resetDoc = { config: snapshot.value, layers: view.layers, revision: snapshot.revision, editable: snapshot.writable }\n if (view.kind === 'invalid') return <div className={css.page}>\n <p className={css.warning} role=\"alert\" title={view.diagnostic}>{t('settings.unsupported')}</p>\n <ResetSection doc={resetDoc} write={write} t={t} />\n </div>\n const doc: SettingsDoc = { ...resetDoc, config: view.config, editable: snapshot.writable && !view.needsWriteback }\n\n return (\n <div className={css.page}>\n <p className={css.intro}>{t('settings.intro')}</p>\n {view.needsWriteback ? <p className={css.warning} role=\"status\">{t('settings.loading')}</p> : null}\n {snapshot.writable ? null : <p className={css.warning} role=\"status\">{t('settings.readOnly')}</p>}\n {migrationError === undefined ? null : <p className={css.warning} role=\"alert\" title={migrationError}>{t('settings.invalid')}</p>}\n <RouteNotice route={route} t={t} />\n <DefaultsSection doc={doc} write={write} credentials={credentials} t={t} />\n <EnhancedToolsSection doc={doc} write={write} t={t} />\n <ServicesSection doc={doc} write={write} credentials={credentials} saveCredential={saveCredential} t={t} />\n <CustomConnectionsSection doc={doc} write={write} credentials={credentials} saveCredential={saveCredential} t={t} />\n <PairingsSection pairingsState={pairings} config={doc.config} forgetPairing={forgetPairing} t={t} />\n <ResetSection doc={resetDoc} write={write} t={t} />\n </div>\n )\n}\n\nconst RouteNotice = createRouteNotice<LocaleKey>({ classes: css, keys: { unknown: 'route.unknown', auto: 'route.auto', other: 'route.other' },\n other: (route, t) => route.provider === 'deepseek-search-api' ? t('route.deepseekApi', { id: route.providerId }) : undefined,\n})\nconst ResetSection = createResetSection<LocaleKey>({ classes: css, parts: settingsParts, sparse, keys: {\n 'reset.confirm': 'reset.confirm',\n 'reset.confirmButton': 'reset.confirmButton',\n 'confirm.cancel': 'confirm.cancel',\n 'reset.hint': 'reset.hint',\n 'reset.button': 'reset.button',\n} })\n","import type { Context } from '@deepseek-ai/cordis'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-api-remotes/client'\nimport { createSnapshotStore, type ObservableSnapshot } from '@deepseek-ai/dsh-client-store'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-commands/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport { SEARCH, PROFILE_PACKAGE, WEB_ROW, rowConfigKey } from 'dsh-tool-web-enhanced-core/shared'\nimport { contract } from '../contract.ts'\nimport { followHostCommand, remoteServicesOffSource, withRetiredSecretDiagnostics } from 'dsh-tool-web-enhanced-core/client'\nimport { CATALOG } from '../catalog.ts'\nimport { resolveSettings } from '../settings/resolve.ts'\nimport { RETIRED_FIELDS } from '../settings/retired.ts'\nimport type { SearchSettings } from '../settings/types.ts'\nimport { searchCommand } from './command.ts'\nimport { listText } from './connections.ts'\nimport { CredentialStatus } from './credentials.ts'\nimport type { SettingsPageInjected } from './injected.ts'\nimport { en, NS, zh } from './locales.ts'\nimport { PairingsStatus } from './pairings.ts'\nimport { SearchRouteStatus, type WebSelection } from './route.ts'\nimport { searchSection } from './section.ts'\nimport { SearchSelectionStore } from './selection.ts'\nimport { SettingsPage } from './settings/SettingsPage.tsx'\n\n// rc.2 exports the public handle but does not augment its carrier service.\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n connection: ConnectionHandle\n }\n}\n\nexport const inject = ['connection', 'slots', 'locale', 'configForms', 'remote', 'remote.credentials']\n\nexport async function apply(ctx: Context): Promise<void> {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'search: dictionaries')\n const t = ctx.locale.bind(NS)\n const settings = withRetiredSecretDiagnostics(ctx.configForms.get<SearchSettings>(SEARCH.rowId), ctx.configForms.describe(), SEARCH.rowId, RETIRED_FIELDS,\n fields => t('settings.retiredSecret', { fields: listText(fields, t) }))\n const navigationState = createSnapshotStore<{ open: (() => void) | undefined }>({ open: undefined })\n const navigation: ObservableSnapshot<(() => void) | undefined> = {\n getSnapshot: () => navigationState.getSnapshot().open,\n subscribe: listener => navigationState.subscribe(listener),\n }\n ctx.inject(['pluginNavigation'], scope => {\n scope.effect(() => {\n // rc.2 exposes openBundle only; do not inspect private navigation state.\n navigationState.set({ open: () => { scope.pluginNavigation.openBundle(PROFILE_PACKAGE) } })\n return () => { navigationState.set({ open: undefined }) }\n }, 'search: settings link')\n })\n const unmount = await ctx.remote.$mount(contract.remoteInfo)\n ctx.effect(() => unmount, 'search: remote')\n ctx.inject(['remote.searchConnections'], scope => {\n const remote = scope.remote.searchConnections\n const credentials = new CredentialStatus(() => settings.getSnapshot().value, scope.remote.credentials)\n const route = new SearchRouteStatus(scope.configForms.get<WebSelection>(WEB_ROW))\n scope.effect(() => route.attach(remote), 'search: provider facts')\n const pairings = new PairingsStatus(remote, t)\n const selection = new SearchSelectionStore(remote, () => { pairings.invalidate() })\n const page: SettingsPageInjected = {\n hooks: { settings, credentials: credentials.source, route: route.source, pairings: pairings.source },\n readSettings: () => settings.getSnapshot(),\n async mutate(ops, revision) {\n return settings.mutate(ops, revision)\n },\n async saveCredential(ref, value) {\n const result = await scope.remote.credentials.set(ref, value)\n if (!result.ok) throw new Error(t('credential.failed'))\n },\n refreshPairings: () => pairings.refresh(),\n async forgetPairing(provider, model) {\n await pairings.forget(provider, model)\n selection.invalidate()\n },\n }\n scope.effect(() => scope.configForms.whileServed([SEARCH.rowId], () => scope.slots.inject('plugins.row.config', () => scope.slots.register({\n name: 'plugins.row.config', key: rowConfigKey(SEARCH), locale: NS, inject: () => page,\n }, SettingsPage))), 'search: settings page')\n const section = searchSection(selection, navigation, remoteServicesOffSource(settings, CATALOG, resolveSettings), t)\n scope.inject(['webConnections'], ui => {\n ui.effect(() => ui.webConnections.registerRoute('search', route), 'search: route facts')\n ui.effect(() => {\n let unregister: (() => void) | undefined\n const sync = () => {\n const visible = settings.getSnapshot().value?.showSelector !== false\n if (visible && unregister === undefined) unregister = ui.webConnections.register(section)\n if (!visible && unregister !== undefined) {\n unregister()\n unregister = undefined\n }\n }\n const unsubscribe = settings.subscribe(sync)\n sync()\n return () => {\n unsubscribe()\n if (unregister !== undefined) unregister()\n }\n }, 'search: composer section')\n })\n scope.inject(['commandUi'], command => {\n command.effect(() => command.commandUi.decorate(searchCommand(selection, t)), 'search: /setup-search')\n followHostCommand(command, SEARCH.command, sessionId => {\n selection.invalidateSession(sessionId)\n pairings.invalidate()\n })\n })\n const invalidate = () => {\n selection.invalidate()\n credentials.refresh()\n pairings.invalidate()\n route.refresh()\n }\n scope.effect(() => settings.subscribe(invalidate), 'search: row settings')\n scope.effect(() => scope.remote.$on('settings/document-updated', invalidate), 'search: settings updates')\n scope.effect(() => scope.remote.$on('credentials/reference-updated', invalidate), 'search: credential updates')\n scope.inject(['connection'], connected => {\n connected.effect(() => connected.connection.generation.subscribe(invalidate), 'search: connection updates')\n })\n })\n}\n"],"ignoreList":[6],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAa,kBAAkB;EA+B/B,MAAa,SAAyB;GACpC,aAAa;GACb,OAAO;GACP,YAAY;GACZ,OAAO;IAAE,QAAQ;IAAuB,MAAM;GAA4B;GAC1E,SAAS;EACX;;;;;;EAqBA,SAAgB,aAAa,KAA0B;GACrD,OAAO,GAAG,gBAAgB,GAAG,IAAI;EACnC;;;;;ECjEA,SAAgB,WAAW,OAAwB;GACjD,IAAI,CAAC,IAAI,SAAS,KAAK,GAAG,OAAO;GACjC,MAAM,MAAM,IAAI,IAAI,KAAK;GACzB,QAAQ,IAAI,aAAa,YAAY,IAAI,aAAa,YAAY,IAAI,aAAa,MAAM,IAAI,aAAa,MAAM,IAAI,WAAW,MAAM,IAAI,SAAS;EACpJ;;;;;;;;;ECEA,MAAa,kBAAkB;EAK/B,MAAa,iBAAiB;EAC9B,MAAa,gBAAgB;;EAG7B,MAAa,uBAAuB;;EASpC,MAAa,iBAAiB;EA2E9B,MAAa,aAAa,QAA8B,GAAG,iBAAiB;EAE5E,MAAa,eAAe,OAAwB,GAAG,WAAW,cAAc;;EAIhF,SAAgB,WAAW,IAAgC;GACzD,OAAO,GAAG,WAAA,UAAyB,IAAI,GAAG,MAAM,CAAqB,IAAI,KAAA;EAC3E;;EAGA,SAAgB,cAAc,QAAiC;GAC7D,OA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