dsh-search-enhance 0.1.0

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.
Files changed (201) hide show
  1. package/README.md +218 -0
  2. package/client/client.js +1479 -0
  3. package/client/types/client/SearchEnhancePluginCard.d.ts +7 -0
  4. package/client/types/client/api.d.ts +12 -0
  5. package/client/types/client/index.d.ts +14 -0
  6. package/client/types/client/locales.d.ts +76 -0
  7. package/client/types/web-config/contracts.d.ts +129 -0
  8. package/cordis.patch.yml +3 -0
  9. package/lib/config.d.ts +315 -0
  10. package/lib/config.js +319 -0
  11. package/lib/contracts/index.d.ts +2 -0
  12. package/lib/contracts/index.js +2 -0
  13. package/lib/contracts/sources.d.ts +53 -0
  14. package/lib/contracts/sources.js +22 -0
  15. package/lib/diagnostics/index.d.ts +5 -0
  16. package/lib/diagnostics/index.js +5 -0
  17. package/lib/diagnostics/orchestrator.d.ts +28 -0
  18. package/lib/diagnostics/orchestrator.js +345 -0
  19. package/lib/diagnostics/probes.d.ts +36 -0
  20. package/lib/diagnostics/probes.js +75 -0
  21. package/lib/diagnostics/status.d.ts +17 -0
  22. package/lib/diagnostics/status.js +128 -0
  23. package/lib/diagnostics/types.d.ts +100 -0
  24. package/lib/diagnostics/types.js +43 -0
  25. package/lib/documentation/cache-domain.d.ts +68 -0
  26. package/lib/documentation/cache-domain.js +84 -0
  27. package/lib/documentation/cache.d.ts +109 -0
  28. package/lib/documentation/cache.js +386 -0
  29. package/lib/documentation/context7-cache.d.ts +74 -0
  30. package/lib/documentation/context7-cache.js +293 -0
  31. package/lib/documentation/index.d.ts +5 -0
  32. package/lib/documentation/index.js +5 -0
  33. package/lib/documentation/service.d.ts +179 -0
  34. package/lib/documentation/service.js +899 -0
  35. package/lib/index.d.ts +7 -0
  36. package/lib/index.js +154 -0
  37. package/lib/orchestration/index.d.ts +4 -0
  38. package/lib/orchestration/index.js +4 -0
  39. package/lib/orchestration/orchestrator.d.ts +28 -0
  40. package/lib/orchestration/orchestrator.js +645 -0
  41. package/lib/orchestration/policy.d.ts +11 -0
  42. package/lib/orchestration/policy.js +29 -0
  43. package/lib/orchestration/types.d.ts +75 -0
  44. package/lib/orchestration/types.js +12 -0
  45. package/lib/presentation/diagnostics-card.d.ts +7 -0
  46. package/lib/presentation/diagnostics-card.js +91 -0
  47. package/lib/presentation/index.d.ts +4 -0
  48. package/lib/presentation/index.js +4 -0
  49. package/lib/presentation/render.d.ts +33 -0
  50. package/lib/presentation/render.js +545 -0
  51. package/lib/presentation/research-plan-card.d.ts +9 -0
  52. package/lib/presentation/research-plan-card.js +90 -0
  53. package/lib/presentation/web-card.d.ts +43 -0
  54. package/lib/presentation/web-card.js +432 -0
  55. package/lib/prompt/tool-discovery.d.ts +5 -0
  56. package/lib/prompt/tool-discovery.js +49 -0
  57. package/lib/provider-runtime/abort.d.ts +17 -0
  58. package/lib/provider-runtime/abort.js +91 -0
  59. package/lib/provider-runtime/attempts.d.ts +31 -0
  60. package/lib/provider-runtime/attempts.js +58 -0
  61. package/lib/provider-runtime/errors.d.ts +45 -0
  62. package/lib/provider-runtime/errors.js +117 -0
  63. package/lib/provider-runtime/index.d.ts +6 -0
  64. package/lib/provider-runtime/index.js +6 -0
  65. package/lib/provider-runtime/limits.d.ts +47 -0
  66. package/lib/provider-runtime/limits.js +106 -0
  67. package/lib/provider-runtime/retry.d.ts +51 -0
  68. package/lib/provider-runtime/retry.js +134 -0
  69. package/lib/providers/bounded-result.d.ts +21 -0
  70. package/lib/providers/bounded-result.js +62 -0
  71. package/lib/providers/context7.d.ts +56 -0
  72. package/lib/providers/context7.js +405 -0
  73. package/lib/providers/direct-content.d.ts +47 -0
  74. package/lib/providers/direct-content.js +434 -0
  75. package/lib/providers/direct-fetch.d.ts +29 -0
  76. package/lib/providers/direct-fetch.js +174 -0
  77. package/lib/providers/direct-http.d.ts +47 -0
  78. package/lib/providers/direct-http.js +526 -0
  79. package/lib/providers/exa.d.ts +20 -0
  80. package/lib/providers/exa.js +121 -0
  81. package/lib/providers/firecrawl-scrape.d.ts +29 -0
  82. package/lib/providers/firecrawl-scrape.js +107 -0
  83. package/lib/providers/firecrawl.d.ts +20 -0
  84. package/lib/providers/firecrawl.js +98 -0
  85. package/lib/providers/helpers.d.ts +20 -0
  86. package/lib/providers/helpers.js +129 -0
  87. package/lib/providers/http.d.ts +39 -0
  88. package/lib/providers/http.js +165 -0
  89. package/lib/providers/index.d.ts +17 -0
  90. package/lib/providers/index.js +16 -0
  91. package/lib/providers/search-api-request.d.ts +32 -0
  92. package/lib/providers/search-api-request.js +123 -0
  93. package/lib/providers/search-api.d.ts +104 -0
  94. package/lib/providers/search-api.js +533 -0
  95. package/lib/providers/smart-direct-child.d.ts +12 -0
  96. package/lib/providers/smart-direct-child.js +404 -0
  97. package/lib/providers/smart-direct-profiles.d.ts +11 -0
  98. package/lib/providers/smart-direct-profiles.js +141 -0
  99. package/lib/providers/smart-direct-transport.d.ts +94 -0
  100. package/lib/providers/smart-direct-transport.js +338 -0
  101. package/lib/providers/smart-direct.d.ts +57 -0
  102. package/lib/providers/smart-direct.js +540 -0
  103. package/lib/providers/tavily-extract.d.ts +27 -0
  104. package/lib/providers/tavily-extract.js +86 -0
  105. package/lib/providers/tavily-map.d.ts +21 -0
  106. package/lib/providers/tavily-map.js +163 -0
  107. package/lib/providers/tavily.d.ts +20 -0
  108. package/lib/providers/tavily.js +96 -0
  109. package/lib/providers/types.d.ts +61 -0
  110. package/lib/providers/types.js +7 -0
  111. package/lib/providers/web-extract-common.d.ts +15 -0
  112. package/lib/providers/web-extract-common.js +69 -0
  113. package/lib/research-plan/index.d.ts +27 -0
  114. package/lib/research-plan/index.js +687 -0
  115. package/lib/search/index.d.ts +5 -0
  116. package/lib/search/index.js +5 -0
  117. package/lib/search/parse.d.ts +42 -0
  118. package/lib/search/parse.js +573 -0
  119. package/lib/search/profiles.d.ts +45 -0
  120. package/lib/search/profiles.js +213 -0
  121. package/lib/search/quality/index.d.ts +4 -0
  122. package/lib/search/quality/index.js +4 -0
  123. package/lib/search/quality/limits.d.ts +31 -0
  124. package/lib/search/quality/limits.js +37 -0
  125. package/lib/search/quality/pipeline.d.ts +12 -0
  126. package/lib/search/quality/pipeline.js +320 -0
  127. package/lib/search/quality/url.d.ts +18 -0
  128. package/lib/search/quality/url.js +106 -0
  129. package/lib/search/time-context.d.ts +23 -0
  130. package/lib/search/time-context.js +118 -0
  131. package/lib/site-map/index.d.ts +3 -0
  132. package/lib/site-map/index.js +3 -0
  133. package/lib/site-map/types.d.ts +35 -0
  134. package/lib/site-map/types.js +7 -0
  135. package/lib/site-map/url.d.ts +7 -0
  136. package/lib/site-map/url.js +51 -0
  137. package/lib/source-storage/authorization.d.ts +5 -0
  138. package/lib/source-storage/authorization.js +43 -0
  139. package/lib/source-storage/domain.d.ts +20 -0
  140. package/lib/source-storage/domain.js +70 -0
  141. package/lib/source-storage/index.d.ts +8 -0
  142. package/lib/source-storage/index.js +8 -0
  143. package/lib/source-storage/pagination.d.ts +58 -0
  144. package/lib/source-storage/pagination.js +113 -0
  145. package/lib/source-storage/refs.d.ts +7 -0
  146. package/lib/source-storage/refs.js +15 -0
  147. package/lib/source-storage/retention.d.ts +14 -0
  148. package/lib/source-storage/retention.js +34 -0
  149. package/lib/source-storage/service.d.ts +31 -0
  150. package/lib/source-storage/service.js +33 -0
  151. package/lib/source-storage/store.d.ts +55 -0
  152. package/lib/source-storage/store.js +144 -0
  153. package/lib/source-storage.d.ts +2 -0
  154. package/lib/source-storage.js +2 -0
  155. package/lib/tool-discovery/capabilities.d.ts +24 -0
  156. package/lib/tool-discovery/capabilities.js +120 -0
  157. package/lib/tool-discovery/fold.d.ts +44 -0
  158. package/lib/tool-discovery/fold.js +149 -0
  159. package/lib/tool-discovery/index.d.ts +4 -0
  160. package/lib/tool-discovery/index.js +4 -0
  161. package/lib/tool-discovery/manager.d.ts +47 -0
  162. package/lib/tool-discovery/manager.js +222 -0
  163. package/lib/tools/context7.d.ts +1294 -0
  164. package/lib/tools/context7.js +969 -0
  165. package/lib/tools/docs-search.d.ts +20 -0
  166. package/lib/tools/docs-search.js +214 -0
  167. package/lib/tools/index.d.ts +13 -0
  168. package/lib/tools/index.js +13 -0
  169. package/lib/tools/operations.d.ts +15 -0
  170. package/lib/tools/operations.js +51 -0
  171. package/lib/tools/research-plan.d.ts +13 -0
  172. package/lib/tools/research-plan.js +40 -0
  173. package/lib/tools/schemas.d.ts +1583 -0
  174. package/lib/tools/schemas.js +1008 -0
  175. package/lib/tools/search-diagnostics.d.ts +22 -0
  176. package/lib/tools/search-diagnostics.js +147 -0
  177. package/lib/tools/search-sources.d.ts +18 -0
  178. package/lib/tools/search-sources.js +115 -0
  179. package/lib/tools/search-tools.d.ts +127 -0
  180. package/lib/tools/search-tools.js +215 -0
  181. package/lib/tools/web-extract.d.ts +28 -0
  182. package/lib/tools/web-extract.js +182 -0
  183. package/lib/tools/web-map.d.ts +31 -0
  184. package/lib/tools/web-map.js +211 -0
  185. package/lib/tools/web-search.d.ts +25 -0
  186. package/lib/tools/web-search.js +165 -0
  187. package/lib/web-config/contracts.d.ts +129 -0
  188. package/lib/web-config/contracts.js +40 -0
  189. package/lib/web-config/host.d.ts +12 -0
  190. package/lib/web-config/host.js +632 -0
  191. package/lib/web-extract/bounds.d.ts +10 -0
  192. package/lib/web-extract/bounds.js +59 -0
  193. package/lib/web-extract/index.d.ts +12 -0
  194. package/lib/web-extract/index.js +12 -0
  195. package/lib/web-extract/orchestrator.d.ts +26 -0
  196. package/lib/web-extract/orchestrator.js +384 -0
  197. package/lib/web-extract/types.d.ts +170 -0
  198. package/lib/web-extract/types.js +69 -0
  199. package/lib/web-extract/url.d.ts +13 -0
  200. package/lib/web-extract/url.js +61 -0
  201. package/package.json +185 -0
@@ -0,0 +1,1479 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "dsh-search-enhance",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ let react = require("react");
8
+ let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ //#region src/web-config/contracts.ts
11
+ const WEB_CONFIG_PATH = "/dsh-search-enhance/config";
12
+ const WEB_CREDENTIALS_PATH = "/dsh-search-enhance/credentials";
13
+ const WEB_BASE_URL_MAX_CHARACTERS = 8192;
14
+ const WEB_MODEL_MAX_CHARACTERS = 4096;
15
+ const WEB_CREDENTIAL_VALUE_MAX_CHARACTERS = 16384;
16
+ const WEB_CREDENTIAL_SLOTS = [
17
+ "searchApi",
18
+ "context7",
19
+ "exa",
20
+ "tavily",
21
+ "firecrawl"
22
+ ];
23
+ const WEB_EDITABLE_PATHS = [
24
+ ["defaultProfile"],
25
+ ["defaultDepth"],
26
+ ["toolTimeoutMs"],
27
+ ["toolDiscovery", "mode"],
28
+ ["searchApi", "baseUrl"],
29
+ ["searchApi", "protocol"],
30
+ ["searchApi", "model"],
31
+ ["searchApi", "thinkingLevel"],
32
+ ["searchApi", "credentialRef"],
33
+ ["searchApi", "timeoutMs"],
34
+ [
35
+ "providers",
36
+ "context7",
37
+ "baseUrl"
38
+ ],
39
+ [
40
+ "providers",
41
+ "context7",
42
+ "credentialRef"
43
+ ],
44
+ [
45
+ "providers",
46
+ "context7",
47
+ "timeoutMs"
48
+ ],
49
+ [
50
+ "providers",
51
+ "exa",
52
+ "baseUrl"
53
+ ],
54
+ [
55
+ "providers",
56
+ "exa",
57
+ "credentialRef"
58
+ ],
59
+ [
60
+ "providers",
61
+ "exa",
62
+ "timeoutMs"
63
+ ],
64
+ [
65
+ "providers",
66
+ "tavily",
67
+ "baseUrl"
68
+ ],
69
+ [
70
+ "providers",
71
+ "tavily",
72
+ "credentialRef"
73
+ ],
74
+ [
75
+ "providers",
76
+ "tavily",
77
+ "timeoutMs"
78
+ ],
79
+ [
80
+ "providers",
81
+ "firecrawl",
82
+ "baseUrl"
83
+ ],
84
+ [
85
+ "providers",
86
+ "firecrawl",
87
+ "credentialRef"
88
+ ],
89
+ [
90
+ "providers",
91
+ "firecrawl",
92
+ "timeoutMs"
93
+ ],
94
+ [
95
+ "webExtract",
96
+ "smartDirect",
97
+ "proxyUrl"
98
+ ],
99
+ [
100
+ "webExtract",
101
+ "direct",
102
+ "proxyUrl"
103
+ ]
104
+ ];
105
+ //#endregion
106
+ //#region src/client/api.ts
107
+ const MAX_CLIENT_RESPONSE_CHARACTERS = 262144;
108
+ var WebConfigClientError = class extends Error {
109
+ status;
110
+ code;
111
+ actualRevision;
112
+ constructor(status, code, message, actualRevision) {
113
+ super(message);
114
+ this.status = status;
115
+ this.code = code;
116
+ this.actualRevision = actualRevision;
117
+ }
118
+ };
119
+ function isRecord(value) {
120
+ return typeof value === "object" && value !== null && !Array.isArray(value);
121
+ }
122
+ function parseError(value, status) {
123
+ if (isRecord(value) && isRecord(value["error"])) {
124
+ const error = value["error"];
125
+ if (typeof error.code === "string" && typeof error.message === "string") return new WebConfigClientError(status, error.code, error.message, typeof error.actualRevision === "number" ? error.actualRevision : void 0);
126
+ }
127
+ return new WebConfigClientError(status, "invalid-response", "The Host returned an invalid error response.");
128
+ }
129
+ function parseSnapshot(value) {
130
+ if (!isRecord(value) || value["namespace"] !== "search-enhance" || value["applies"] !== "restart" || !Number.isSafeInteger(value["revision"]) || typeof value["writable"] !== "boolean" || !isRecord(value["value"]) || !isRecord(value["credentials"]) || !isRecord(value["options"]) || !isRecord(value["diagnostics"])) throw new WebConfigClientError(502, "invalid-response", "The Host returned an invalid configuration response.");
131
+ return value;
132
+ }
133
+ async function requestJson(path, init) {
134
+ const response = await fetch(path, {
135
+ credentials: "same-origin",
136
+ cache: "no-store",
137
+ ...init,
138
+ headers: {
139
+ accept: "application/json",
140
+ ...init.headers
141
+ }
142
+ });
143
+ const text = await response.text();
144
+ if ([...text].length > MAX_CLIENT_RESPONSE_CHARACTERS) throw new WebConfigClientError(502, "response-too-large", "The Host response exceeded the client limit.");
145
+ let value;
146
+ try {
147
+ value = JSON.parse(text);
148
+ } catch {
149
+ throw new WebConfigClientError(502, "invalid-response", "The Host returned invalid JSON.");
150
+ }
151
+ if (!response.ok) throw parseError(value, response.status);
152
+ return {
153
+ response,
154
+ value
155
+ };
156
+ }
157
+ async function loadWebConfig(signal) {
158
+ const { value } = await requestJson(WEB_CONFIG_PATH, {
159
+ method: "GET",
160
+ ...signal === void 0 ? {} : { signal }
161
+ });
162
+ return parseSnapshot(value);
163
+ }
164
+ async function saveWebConfig(request, signal) {
165
+ const { value } = await requestJson(WEB_CONFIG_PATH, {
166
+ method: "PATCH",
167
+ ...signal === void 0 ? {} : { signal },
168
+ headers: { "content-type": "application/json; charset=utf-8" },
169
+ body: JSON.stringify(request)
170
+ });
171
+ return parseSnapshot(value);
172
+ }
173
+ async function writeWebCredential(credential, value, signal) {
174
+ const request = {
175
+ credential,
176
+ value
177
+ };
178
+ const response = await requestJson(WEB_CREDENTIALS_PATH, {
179
+ method: "PUT",
180
+ ...signal === void 0 ? {} : { signal },
181
+ headers: { "content-type": "application/json; charset=utf-8" },
182
+ body: JSON.stringify(request)
183
+ });
184
+ if (!isRecord(response.value) || response.value["credential"] !== credential || !isRecord(response.value["state"])) throw new WebConfigClientError(502, "invalid-response", "The Host returned an invalid credential response.");
185
+ return response.value;
186
+ }
187
+ async function deleteWebCredential(credential, signal) {
188
+ const request = { credential };
189
+ const response = await requestJson(WEB_CREDENTIALS_PATH, {
190
+ method: "DELETE",
191
+ ...signal === void 0 ? {} : { signal },
192
+ headers: { "content-type": "application/json; charset=utf-8" },
193
+ body: JSON.stringify(request)
194
+ });
195
+ if (!isRecord(response.value) || response.value["credential"] !== credential || !isRecord(response.value["state"])) throw new WebConfigClientError(502, "invalid-response", "The Host returned an invalid credential response.");
196
+ return response.value;
197
+ }
198
+ //#endregion
199
+ //#region src/client/SearchEnhancePluginCard.tsx
200
+ const SEARCH_ENHANCE_LOCALE_NAMESPACE = "settings.search-enhance";
201
+ const PROVIDERS = [
202
+ "context7",
203
+ "exa",
204
+ "tavily",
205
+ "firecrawl"
206
+ ];
207
+ const PROXY_ROUTES = [["smartDirect", "smartDirectProxy"], ["direct", "directProxy"]];
208
+ const CREDENTIAL_NAME_KEYS = {
209
+ searchApi: "searchApiCredential",
210
+ context7: "context7",
211
+ exa: "exa",
212
+ tavily: "tavily",
213
+ firecrawl: "firecrawl"
214
+ };
215
+ const cardStyle = {
216
+ overflow: "hidden",
217
+ border: "1px solid var(--dsw-alias-border-l2)",
218
+ borderRadius: 10,
219
+ background: "var(--dsw-alias-bg-module-platform)"
220
+ };
221
+ const headerStyle = {
222
+ boxSizing: "border-box",
223
+ width: "100%",
224
+ display: "flex",
225
+ alignItems: "center",
226
+ justifyContent: "space-between",
227
+ gap: 16,
228
+ border: 0,
229
+ padding: "13px 14px",
230
+ background: "transparent",
231
+ color: "var(--dsw-alias-label-primary)",
232
+ font: "inherit",
233
+ textAlign: "left",
234
+ cursor: "pointer"
235
+ };
236
+ const headTextStyle = {
237
+ display: "flex",
238
+ minWidth: 0,
239
+ flexDirection: "column",
240
+ gap: 3
241
+ };
242
+ const nameStyle = {
243
+ fontSize: 14,
244
+ lineHeight: "20px",
245
+ fontWeight: 600
246
+ };
247
+ const descriptionStyle = {
248
+ fontSize: 13,
249
+ lineHeight: "18px",
250
+ color: "var(--dsw-alias-label-tertiary)"
251
+ };
252
+ const chevronStyle = {
253
+ flex: "0 0 auto",
254
+ fontSize: 18,
255
+ lineHeight: 1,
256
+ transition: "transform 120ms ease"
257
+ };
258
+ const bodyContainerStyle = {
259
+ borderTop: "1px solid var(--dsw-alias-border-l2)",
260
+ padding: "16px 14px 18px"
261
+ };
262
+ const bodyStyle = {
263
+ margin: 0,
264
+ fontSize: 13,
265
+ lineHeight: "20px",
266
+ color: "var(--dsw-alias-label-secondary)"
267
+ };
268
+ const sectionStyle = {
269
+ display: "flex",
270
+ flexDirection: "column",
271
+ gap: 12
272
+ };
273
+ const sectionDividerStyle = {
274
+ ...sectionStyle,
275
+ marginTop: 20,
276
+ paddingTop: 18,
277
+ borderTop: "1px solid var(--dsw-alias-border-l2)"
278
+ };
279
+ const headingStyle = {
280
+ margin: 0,
281
+ fontSize: 14,
282
+ lineHeight: "20px",
283
+ fontWeight: 600,
284
+ color: "var(--dsw-alias-label-primary)"
285
+ };
286
+ const gridStyle = {
287
+ display: "grid",
288
+ gridTemplateColumns: "repeat(auto-fit, minmax(210px, 1fr))",
289
+ gap: 12
290
+ };
291
+ const fieldStyle = {
292
+ display: "flex",
293
+ minWidth: 0,
294
+ flexDirection: "column",
295
+ gap: 6
296
+ };
297
+ const labelRowStyle = {
298
+ display: "flex",
299
+ alignItems: "center",
300
+ justifyContent: "space-between",
301
+ gap: 8
302
+ };
303
+ const labelStyle = {
304
+ fontSize: 13,
305
+ lineHeight: "18px",
306
+ fontWeight: 500,
307
+ color: "var(--dsw-alias-label-primary)"
308
+ };
309
+ const layerStyle = {
310
+ fontSize: 11,
311
+ lineHeight: "16px",
312
+ color: "var(--dsw-alias-label-tertiary)"
313
+ };
314
+ const controlStyle = {
315
+ boxSizing: "border-box",
316
+ width: "100%",
317
+ minHeight: 36,
318
+ padding: "7px 10px",
319
+ border: "1px solid var(--dsw-alias-border-l2)",
320
+ borderRadius: 8,
321
+ background: "var(--dsw-alias-bg-layer-1)",
322
+ color: "var(--dsw-alias-label-primary)",
323
+ font: "inherit",
324
+ fontSize: 13
325
+ };
326
+ const noteStyle = {
327
+ ...bodyStyle,
328
+ padding: "9px 10px",
329
+ borderRadius: 8,
330
+ background: "var(--dsw-alias-bg-layer-1)"
331
+ };
332
+ const detailsStyle = {
333
+ border: "1px solid var(--dsw-alias-border-l2)",
334
+ borderRadius: 8,
335
+ padding: "10px 12px"
336
+ };
337
+ const summaryStyle = {
338
+ cursor: "pointer",
339
+ fontSize: 13,
340
+ fontWeight: 600,
341
+ color: "var(--dsw-alias-label-primary)"
342
+ };
343
+ const credentialListStyle = {
344
+ display: "flex",
345
+ flexDirection: "column",
346
+ gap: 10
347
+ };
348
+ const credentialStyle = {
349
+ display: "flex",
350
+ flexDirection: "column",
351
+ gap: 9,
352
+ padding: 12,
353
+ border: "1px solid var(--dsw-alias-border-l2)",
354
+ borderRadius: 8
355
+ };
356
+ const credentialHeaderStyle = {
357
+ display: "flex",
358
+ alignItems: "center",
359
+ justifyContent: "space-between",
360
+ gap: 12,
361
+ flexWrap: "wrap"
362
+ };
363
+ const stateStyle = {
364
+ display: "inline-flex",
365
+ alignItems: "center",
366
+ gap: 6,
367
+ fontSize: 12,
368
+ color: "var(--dsw-alias-label-secondary)"
369
+ };
370
+ const credentialActionsStyle = {
371
+ display: "flex",
372
+ gap: 8,
373
+ flexWrap: "wrap"
374
+ };
375
+ const actionsStyle = {
376
+ display: "flex",
377
+ alignItems: "center",
378
+ justifyContent: "space-between",
379
+ gap: 12,
380
+ flexWrap: "wrap",
381
+ marginTop: 20,
382
+ paddingTop: 16,
383
+ borderTop: "1px solid var(--dsw-alias-border-l2)"
384
+ };
385
+ const buttonsStyle = {
386
+ display: "flex",
387
+ gap: 8,
388
+ flexWrap: "wrap"
389
+ };
390
+ const errorStyle = {
391
+ ...bodyStyle,
392
+ color: "var(--dsw-alias-state-error-primary)"
393
+ };
394
+ const successStyle = {
395
+ ...bodyStyle,
396
+ color: "var(--dsw-alias-state-success-primary, #16825d)"
397
+ };
398
+ function cloneConfig(config) {
399
+ return {
400
+ defaultProfile: config.defaultProfile,
401
+ defaultDepth: config.defaultDepth,
402
+ toolTimeoutMs: config.toolTimeoutMs,
403
+ toolDiscovery: { ...config.toolDiscovery },
404
+ searchApi: { ...config.searchApi },
405
+ providers: {
406
+ context7: { ...config.providers.context7 },
407
+ exa: { ...config.providers.exa },
408
+ tavily: { ...config.providers.tavily },
409
+ firecrawl: { ...config.providers.firecrawl }
410
+ },
411
+ webExtract: {
412
+ smartDirect: { ...config.webExtract.smartDirect },
413
+ direct: { ...config.webExtract.direct }
414
+ }
415
+ };
416
+ }
417
+ function scalarAt(value, path) {
418
+ let current = value;
419
+ for (const part of path) {
420
+ if (typeof current !== "object" || current === null || Array.isArray(current)) return void 0;
421
+ current = current[part];
422
+ }
423
+ return typeof current === "string" || typeof current === "number" ? current : void 0;
424
+ }
425
+ function mutationsFor(current, draft) {
426
+ return WEB_EDITABLE_PATHS.flatMap((path) => {
427
+ const before = scalarAt(current, path);
428
+ const after = scalarAt(draft, path);
429
+ if (Object.is(before, after) || after === void 0) return [];
430
+ return path.at(-1) === "proxyUrl" && after === "" ? [{
431
+ op: "unset",
432
+ path: [...path]
433
+ }] : [{
434
+ op: "set",
435
+ path: [...path],
436
+ value: after
437
+ }];
438
+ });
439
+ }
440
+ function isOverridden(layer, path) {
441
+ return scalarAt(layer, path) !== void 0;
442
+ }
443
+ function positiveInteger(value) {
444
+ return Number.isInteger(value) && value > 0;
445
+ }
446
+ function validTimeouts(config) {
447
+ return [
448
+ config.toolTimeoutMs,
449
+ config.searchApi.timeoutMs,
450
+ ...PROVIDERS.map((provider) => config.providers[provider].timeoutMs)
451
+ ].every(positiveInteger);
452
+ }
453
+ function credentialRef(config, slot) {
454
+ return slot === "searchApi" ? config.searchApi.credentialRef : config.providers[slot].credentialRef;
455
+ }
456
+ function Field({ label, overridden, t, hint, children }) {
457
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
458
+ style: fieldStyle,
459
+ children: [
460
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
461
+ style: labelRowStyle,
462
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
463
+ style: labelStyle,
464
+ children: label
465
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
466
+ style: layerStyle,
467
+ children: t(overridden ? "overridden" : "inherited")
468
+ })]
469
+ }),
470
+ children,
471
+ hint === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
472
+ style: bodyStyle,
473
+ children: hint
474
+ })
475
+ ]
476
+ });
477
+ }
478
+ function Select({ value, options, onChange, disabled }) {
479
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
480
+ style: controlStyle,
481
+ value,
482
+ disabled,
483
+ onChange: (event) => {
484
+ onChange(event.currentTarget.value);
485
+ },
486
+ children: options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
487
+ value: option,
488
+ children: option
489
+ }, option))
490
+ });
491
+ }
492
+ function NumberInput({ value, onChange, disabled, label }) {
493
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
494
+ "aria-label": label,
495
+ style: controlStyle,
496
+ type: "number",
497
+ min: 1,
498
+ step: 1,
499
+ value: Number.isFinite(value) ? value : "",
500
+ disabled,
501
+ onChange: (event) => {
502
+ onChange(event.currentTarget.valueAsNumber);
503
+ }
504
+ });
505
+ }
506
+ function ProviderEditor({ provider, value, disabled, user, t, onChange }) {
507
+ const prefix = ["providers", provider];
508
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
509
+ style: sectionDividerStyle,
510
+ "aria-labelledby": `${provider}-provider-title`,
511
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
512
+ id: `${provider}-provider-title`,
513
+ style: headingStyle,
514
+ children: t(CREDENTIAL_NAME_KEYS[provider])
515
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
516
+ style: gridStyle,
517
+ children: [
518
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
519
+ label: t("baseUrl"),
520
+ overridden: isOverridden(user, [...prefix, "baseUrl"]),
521
+ t,
522
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
523
+ "aria-label": `${t(CREDENTIAL_NAME_KEYS[provider])} ${t("baseUrl")}`,
524
+ style: controlStyle,
525
+ value: value.baseUrl,
526
+ maxLength: WEB_BASE_URL_MAX_CHARACTERS,
527
+ disabled,
528
+ onChange: (event) => {
529
+ onChange({
530
+ ...value,
531
+ baseUrl: event.currentTarget.value
532
+ });
533
+ }
534
+ })
535
+ }),
536
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
537
+ label: t("timeoutMs"),
538
+ overridden: isOverridden(user, [...prefix, "timeoutMs"]),
539
+ t,
540
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, {
541
+ label: `${t(CREDENTIAL_NAME_KEYS[provider])} ${t("timeoutMs")}`,
542
+ value: value.timeoutMs,
543
+ disabled,
544
+ onChange: (timeoutMs) => {
545
+ onChange({
546
+ ...value,
547
+ timeoutMs
548
+ });
549
+ }
550
+ })
551
+ }),
552
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
553
+ label: t("credentialRef"),
554
+ overridden: isOverridden(user, [...prefix, "credentialRef"]),
555
+ t,
556
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
557
+ "aria-label": `${t(CREDENTIAL_NAME_KEYS[provider])} ${t("credentialRef")}`,
558
+ style: controlStyle,
559
+ value: value.credentialRef,
560
+ maxLength: 256,
561
+ disabled,
562
+ onChange: (event) => {
563
+ onChange({
564
+ ...value,
565
+ credentialRef: event.currentTarget.value
566
+ });
567
+ }
568
+ })
569
+ })
570
+ ]
571
+ })]
572
+ });
573
+ }
574
+ function SearchEnhancePluginCard({ t }) {
575
+ const [open, setOpen] = (0, react.useState)(false);
576
+ const [phase, setPhase] = (0, react.useState)("idle");
577
+ const [snapshot, setSnapshot] = (0, react.useState)();
578
+ const [draft, setDraft] = (0, react.useState)();
579
+ const [saving, setSaving] = (0, react.useState)(false);
580
+ const [feedback, setFeedback] = (0, react.useState)("idle");
581
+ const [credentialDrafts, setCredentialDrafts] = (0, react.useState)({});
582
+ const [credentialBusy, setCredentialBusy] = (0, react.useState)();
583
+ const [credentialFeedback, setCredentialFeedback] = (0, react.useState)();
584
+ const controllers = (0, react.useRef)(/* @__PURE__ */ new Set());
585
+ const run = (0, react.useCallback)(async (operation) => {
586
+ const controller = new AbortController();
587
+ controllers.current.add(controller);
588
+ try {
589
+ return await operation(controller.signal);
590
+ } finally {
591
+ controllers.current.delete(controller);
592
+ }
593
+ }, []);
594
+ (0, react.useEffect)(() => () => {
595
+ for (const controller of controllers.current) controller.abort();
596
+ controllers.current.clear();
597
+ }, []);
598
+ const load = (0, react.useCallback)(async () => {
599
+ setPhase("loading");
600
+ setFeedback("idle");
601
+ try {
602
+ const next = await run((signal) => loadWebConfig(signal));
603
+ setSnapshot(next);
604
+ setDraft(cloneConfig(next.value));
605
+ setPhase("ready");
606
+ } catch (error) {
607
+ if (error instanceof DOMException && error.name === "AbortError") return;
608
+ setPhase("error");
609
+ }
610
+ }, [run]);
611
+ (0, react.useEffect)(() => {
612
+ if (open && phase === "idle") load();
613
+ }, [
614
+ load,
615
+ open,
616
+ phase
617
+ ]);
618
+ const mutations = (0, react.useMemo)(() => snapshot === void 0 || draft === void 0 ? [] : mutationsFor(snapshot.value, draft), [draft, snapshot]);
619
+ const dirty = mutations.length > 0;
620
+ const valid = draft !== void 0 && validTimeouts(draft);
621
+ const editable = phase === "ready" && snapshot?.writable === true && !saving;
622
+ const updateProvider = (provider, value) => {
623
+ setDraft((current) => current === void 0 ? current : {
624
+ ...current,
625
+ providers: {
626
+ ...current.providers,
627
+ [provider]: value
628
+ }
629
+ });
630
+ setFeedback("idle");
631
+ };
632
+ const updateProxy = (route, proxyUrl) => {
633
+ setDraft((current) => current === void 0 ? current : {
634
+ ...current,
635
+ webExtract: {
636
+ ...current.webExtract,
637
+ [route]: { proxyUrl }
638
+ }
639
+ });
640
+ setFeedback("idle");
641
+ };
642
+ const save = async () => {
643
+ if (snapshot === void 0 || draft === void 0 || !dirty || !valid || !snapshot.writable) return;
644
+ setSaving(true);
645
+ setFeedback("idle");
646
+ try {
647
+ const next = await run((signal) => saveWebConfig({
648
+ expectedRevision: snapshot.revision,
649
+ mutations
650
+ }, signal));
651
+ setSnapshot(next);
652
+ setDraft(cloneConfig(next.value));
653
+ setFeedback("saved");
654
+ } catch (error) {
655
+ if (error instanceof DOMException && error.name === "AbortError") return;
656
+ setFeedback(error instanceof WebConfigClientError && error.code === "settings-conflict" ? "conflict" : "error");
657
+ } finally {
658
+ setSaving(false);
659
+ }
660
+ };
661
+ const discard = () => {
662
+ if (snapshot === void 0) return;
663
+ setDraft(cloneConfig(snapshot.value));
664
+ setFeedback("idle");
665
+ };
666
+ const applyCredentialState = (slot, state) => {
667
+ setSnapshot((current) => current === void 0 ? current : {
668
+ ...current,
669
+ credentials: {
670
+ ...current.credentials,
671
+ [slot]: state
672
+ }
673
+ });
674
+ };
675
+ const updateCredential = async (slot) => {
676
+ const value = credentialDrafts[slot] ?? "";
677
+ if (value === "" || credentialBusy !== void 0) return;
678
+ setCredentialBusy(slot);
679
+ setCredentialFeedback(void 0);
680
+ try {
681
+ const result = await run((signal) => writeWebCredential(slot, value, signal));
682
+ applyCredentialState(slot, result.state);
683
+ setCredentialDrafts((current) => ({
684
+ ...current,
685
+ [slot]: ""
686
+ }));
687
+ setCredentialFeedback(t("keySaved", { name: t(CREDENTIAL_NAME_KEYS[slot]) }));
688
+ } catch (error) {
689
+ if (error instanceof DOMException && error.name === "AbortError") return;
690
+ setCredentialFeedback(t("keyFailed"));
691
+ } finally {
692
+ setCredentialBusy(void 0);
693
+ }
694
+ };
695
+ const clearCredential = async (slot) => {
696
+ if (credentialBusy !== void 0) return;
697
+ setCredentialBusy(slot);
698
+ setCredentialFeedback(void 0);
699
+ try {
700
+ const result = await run((signal) => deleteWebCredential(slot, signal));
701
+ applyCredentialState(slot, result.state);
702
+ setCredentialDrafts((current) => ({
703
+ ...current,
704
+ [slot]: ""
705
+ }));
706
+ setCredentialFeedback(t("keyCleared", { name: t(CREDENTIAL_NAME_KEYS[slot]) }));
707
+ } catch (error) {
708
+ if (error instanceof DOMException && error.name === "AbortError") return;
709
+ setCredentialFeedback(t("keyFailed"));
710
+ } finally {
711
+ setCredentialBusy(void 0);
712
+ }
713
+ };
714
+ const title = t("title");
715
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
716
+ style: cardStyle,
717
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
718
+ type: "button",
719
+ style: headerStyle,
720
+ "aria-expanded": open,
721
+ "aria-label": `${t(open ? "collapse" : "expand")}: ${title}`,
722
+ onClick: () => {
723
+ setOpen((current) => !current);
724
+ },
725
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
726
+ style: headTextStyle,
727
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
728
+ style: nameStyle,
729
+ children: title
730
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
731
+ style: descriptionStyle,
732
+ children: t("intro")
733
+ })]
734
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
735
+ "aria-hidden": "true",
736
+ style: {
737
+ ...chevronStyle,
738
+ transform: open ? "rotate(180deg)" : "none"
739
+ },
740
+ children: "⌄"
741
+ })]
742
+ }), !open ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
743
+ style: bodyContainerStyle,
744
+ children: [
745
+ phase === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
746
+ style: bodyStyle,
747
+ role: "status",
748
+ children: t("loading")
749
+ }) : null,
750
+ phase === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
751
+ style: sectionStyle,
752
+ role: "alert",
753
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
754
+ style: errorStyle,
755
+ children: t("loadFailed")
756
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
757
+ type: "button",
758
+ size: "sm",
759
+ variant: "outline",
760
+ onClick: () => {
761
+ load();
762
+ },
763
+ children: t("retry")
764
+ }) })]
765
+ }) : null,
766
+ phase !== "ready" || snapshot === void 0 || draft === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
767
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
768
+ style: sectionStyle,
769
+ "aria-labelledby": "search-enhance-grok-heading",
770
+ children: [
771
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
772
+ id: "search-enhance-grok-heading",
773
+ style: headingStyle,
774
+ children: t("grokHeading")
775
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
776
+ style: {
777
+ ...bodyStyle,
778
+ marginTop: 4
779
+ },
780
+ children: t("grokIntro")
781
+ })] }),
782
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
783
+ style: noteStyle,
784
+ children: t("independentNote")
785
+ }),
786
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
787
+ style: gridStyle,
788
+ children: [
789
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
790
+ label: t("baseUrl"),
791
+ overridden: isOverridden(snapshot.user, ["searchApi", "baseUrl"]),
792
+ t,
793
+ hint: t("thirdPartyHint"),
794
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
795
+ "aria-label": t("baseUrl"),
796
+ style: controlStyle,
797
+ value: draft.searchApi.baseUrl,
798
+ maxLength: WEB_BASE_URL_MAX_CHARACTERS,
799
+ disabled: !editable,
800
+ onChange: (event) => {
801
+ const baseUrl = event.currentTarget.value;
802
+ setDraft((current) => current === void 0 ? current : {
803
+ ...current,
804
+ searchApi: {
805
+ ...current.searchApi,
806
+ baseUrl
807
+ }
808
+ });
809
+ setFeedback("idle");
810
+ }
811
+ })
812
+ }),
813
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
814
+ label: t("protocol"),
815
+ overridden: isOverridden(snapshot.user, ["searchApi", "protocol"]),
816
+ t,
817
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
818
+ value: draft.searchApi.protocol,
819
+ options: snapshot.options.protocols,
820
+ disabled: !editable,
821
+ onChange: (protocol) => {
822
+ setDraft((current) => current === void 0 ? current : {
823
+ ...current,
824
+ searchApi: {
825
+ ...current.searchApi,
826
+ protocol
827
+ }
828
+ });
829
+ setFeedback("idle");
830
+ }
831
+ })
832
+ }),
833
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
834
+ label: t("model"),
835
+ overridden: isOverridden(snapshot.user, ["searchApi", "model"]),
836
+ t,
837
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
838
+ "aria-label": t("model"),
839
+ style: controlStyle,
840
+ value: draft.searchApi.model,
841
+ maxLength: WEB_MODEL_MAX_CHARACTERS,
842
+ disabled: !editable,
843
+ onChange: (event) => {
844
+ const model = event.currentTarget.value;
845
+ setDraft((current) => current === void 0 ? current : {
846
+ ...current,
847
+ searchApi: {
848
+ ...current.searchApi,
849
+ model
850
+ }
851
+ });
852
+ setFeedback("idle");
853
+ }
854
+ })
855
+ }),
856
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
857
+ label: t("thinkingLevel"),
858
+ overridden: isOverridden(snapshot.user, ["searchApi", "thinkingLevel"]),
859
+ t,
860
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
861
+ value: draft.searchApi.thinkingLevel,
862
+ options: snapshot.options.thinkingLevels,
863
+ disabled: !editable,
864
+ onChange: (thinkingLevel) => {
865
+ setDraft((current) => current === void 0 ? current : {
866
+ ...current,
867
+ searchApi: {
868
+ ...current.searchApi,
869
+ thinkingLevel
870
+ }
871
+ });
872
+ setFeedback("idle");
873
+ }
874
+ })
875
+ }),
876
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
877
+ label: t("timeoutMs"),
878
+ overridden: isOverridden(snapshot.user, ["searchApi", "timeoutMs"]),
879
+ t,
880
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, {
881
+ label: `Grok ${t("timeoutMs")}`,
882
+ value: draft.searchApi.timeoutMs,
883
+ disabled: !editable,
884
+ onChange: (timeoutMs) => {
885
+ setDraft((current) => current === void 0 ? current : {
886
+ ...current,
887
+ searchApi: {
888
+ ...current.searchApi,
889
+ timeoutMs
890
+ }
891
+ });
892
+ setFeedback("idle");
893
+ }
894
+ })
895
+ }),
896
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
897
+ label: t("credentialRef"),
898
+ overridden: isOverridden(snapshot.user, ["searchApi", "credentialRef"]),
899
+ t,
900
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
901
+ "aria-label": `Grok ${t("credentialRef")}`,
902
+ style: controlStyle,
903
+ value: draft.searchApi.credentialRef,
904
+ maxLength: 256,
905
+ disabled: !editable,
906
+ onChange: (event) => {
907
+ const credentialRef = event.currentTarget.value;
908
+ setDraft((current) => current === void 0 ? current : {
909
+ ...current,
910
+ searchApi: {
911
+ ...current.searchApi,
912
+ credentialRef
913
+ }
914
+ });
915
+ setFeedback("idle");
916
+ }
917
+ })
918
+ })
919
+ ]
920
+ })
921
+ ]
922
+ }),
923
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
924
+ style: sectionDividerStyle,
925
+ "aria-labelledby": "search-enhance-strategy-heading",
926
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
927
+ id: "search-enhance-strategy-heading",
928
+ style: headingStyle,
929
+ children: t("strategyHeading")
930
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
931
+ style: {
932
+ ...bodyStyle,
933
+ marginTop: 4
934
+ },
935
+ children: t("strategyIntro")
936
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
937
+ style: gridStyle,
938
+ children: [
939
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
940
+ label: t("defaultProfile"),
941
+ overridden: isOverridden(snapshot.user, ["defaultProfile"]),
942
+ t,
943
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
944
+ value: draft.defaultProfile,
945
+ options: snapshot.options.profiles,
946
+ disabled: !editable,
947
+ onChange: (defaultProfile) => {
948
+ setDraft((current) => current === void 0 ? current : {
949
+ ...current,
950
+ defaultProfile
951
+ });
952
+ setFeedback("idle");
953
+ }
954
+ })
955
+ }),
956
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
957
+ label: t("defaultDepth"),
958
+ overridden: isOverridden(snapshot.user, ["defaultDepth"]),
959
+ t,
960
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
961
+ value: draft.defaultDepth,
962
+ options: snapshot.options.depths,
963
+ disabled: !editable,
964
+ onChange: (defaultDepth) => {
965
+ setDraft((current) => current === void 0 ? current : {
966
+ ...current,
967
+ defaultDepth
968
+ });
969
+ setFeedback("idle");
970
+ }
971
+ })
972
+ }),
973
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
974
+ label: t("toolDiscoveryMode"),
975
+ overridden: isOverridden(snapshot.user, ["toolDiscovery", "mode"]),
976
+ t,
977
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Select, {
978
+ value: draft.toolDiscovery.mode,
979
+ options: snapshot.options.toolDiscoveryModes,
980
+ disabled: !editable,
981
+ onChange: (mode) => {
982
+ setDraft((current) => current === void 0 ? current : {
983
+ ...current,
984
+ toolDiscovery: { mode }
985
+ });
986
+ setFeedback("idle");
987
+ }
988
+ })
989
+ }),
990
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
991
+ label: t("toolTimeoutMs"),
992
+ overridden: isOverridden(snapshot.user, ["toolTimeoutMs"]),
993
+ t,
994
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(NumberInput, {
995
+ label: t("toolTimeoutMs"),
996
+ value: draft.toolTimeoutMs,
997
+ disabled: !editable,
998
+ onChange: (toolTimeoutMs) => {
999
+ setDraft((current) => current === void 0 ? current : {
1000
+ ...current,
1001
+ toolTimeoutMs
1002
+ });
1003
+ setFeedback("idle");
1004
+ }
1005
+ })
1006
+ })
1007
+ ]
1008
+ })]
1009
+ }),
1010
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1011
+ style: sectionDividerStyle,
1012
+ "aria-labelledby": "search-enhance-providers-heading",
1013
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
1014
+ id: "search-enhance-providers-heading",
1015
+ style: headingStyle,
1016
+ children: t("providersHeading")
1017
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1018
+ style: {
1019
+ ...bodyStyle,
1020
+ marginTop: 4
1021
+ },
1022
+ children: t("providersIntro")
1023
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
1024
+ style: detailsStyle,
1025
+ children: [
1026
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
1027
+ style: summaryStyle,
1028
+ children: t("providersSummary")
1029
+ }),
1030
+ PROVIDERS.map((provider) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProviderEditor, {
1031
+ provider,
1032
+ value: draft.providers[provider],
1033
+ disabled: !editable,
1034
+ user: snapshot.user,
1035
+ t,
1036
+ onChange: (value) => {
1037
+ updateProvider(provider, value);
1038
+ }
1039
+ }, provider)),
1040
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1041
+ style: sectionDividerStyle,
1042
+ "aria-labelledby": "search-enhance-proxy-heading",
1043
+ children: [
1044
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
1045
+ id: "search-enhance-proxy-heading",
1046
+ style: headingStyle,
1047
+ children: t("proxyHeading")
1048
+ }),
1049
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1050
+ style: bodyStyle,
1051
+ children: t("proxyIntro")
1052
+ }),
1053
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1054
+ style: gridStyle,
1055
+ children: PROXY_ROUTES.map(([route, label]) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
1056
+ label: t(label),
1057
+ overridden: isOverridden(snapshot.user, [
1058
+ "webExtract",
1059
+ route,
1060
+ "proxyUrl"
1061
+ ]),
1062
+ t,
1063
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1064
+ "aria-label": t(label),
1065
+ style: controlStyle,
1066
+ value: draft.webExtract[route].proxyUrl,
1067
+ maxLength: snapshot.options.proxyUrlMaxCharacters,
1068
+ placeholder: "http://127.0.0.1:7890",
1069
+ disabled: !editable,
1070
+ onChange: (event) => {
1071
+ updateProxy(route, event.currentTarget.value);
1072
+ }
1073
+ })
1074
+ }, route))
1075
+ }),
1076
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1077
+ style: noteStyle,
1078
+ children: t("proxyHint")
1079
+ })
1080
+ ]
1081
+ })
1082
+ ]
1083
+ })]
1084
+ }),
1085
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1086
+ style: sectionDividerStyle,
1087
+ "aria-labelledby": "search-enhance-credentials-heading",
1088
+ children: [
1089
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
1090
+ id: "search-enhance-credentials-heading",
1091
+ style: headingStyle,
1092
+ children: t("credentialsHeading")
1093
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1094
+ style: {
1095
+ ...bodyStyle,
1096
+ marginTop: 4
1097
+ },
1098
+ children: t("credentialsIntro")
1099
+ })] }),
1100
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1101
+ style: credentialListStyle,
1102
+ children: WEB_CREDENTIAL_SLOTS.map((slot) => {
1103
+ const name = t(CREDENTIAL_NAME_KEYS[slot]);
1104
+ const state = snapshot.credentials[slot];
1105
+ const keyDraft = credentialDrafts[slot] ?? "";
1106
+ const refChanged = credentialRef(draft, slot) !== state.ref;
1107
+ const disabled = credentialBusy === slot || credentialBusy !== void 0 || refChanged || !state.available || !state.writable;
1108
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1109
+ style: credentialStyle,
1110
+ children: [
1111
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1112
+ style: credentialHeaderStyle,
1113
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", {
1114
+ style: labelStyle,
1115
+ children: name
1116
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1117
+ style: bodyStyle,
1118
+ children: t("referenceLabel", { ref: state.ref })
1119
+ })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1120
+ style: stateStyle,
1121
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: !state.available ? "error" : state.configured ? "done" : "warning" }), !state.available ? t("unavailable") : state.configured ? t("configured") : t("missing")]
1122
+ })]
1123
+ }),
1124
+ state.source === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1125
+ style: bodyStyle,
1126
+ children: t("sourceLabel", { source: state.source })
1127
+ }),
1128
+ refChanged ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1129
+ style: errorStyle,
1130
+ children: t("saveConfigFirst")
1131
+ }) : null,
1132
+ !state.writable && state.available ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1133
+ style: bodyStyle,
1134
+ children: t("credentialReadOnly")
1135
+ }) : null,
1136
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
1137
+ style: fieldStyle,
1138
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1139
+ style: labelStyle,
1140
+ children: t("keyValue", { name })
1141
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
1142
+ style: controlStyle,
1143
+ type: "password",
1144
+ autoComplete: "off",
1145
+ value: keyDraft,
1146
+ maxLength: WEB_CREDENTIAL_VALUE_MAX_CHARACTERS,
1147
+ placeholder: t("keyPlaceholder"),
1148
+ disabled,
1149
+ onChange: (event) => {
1150
+ const value = event.currentTarget.value;
1151
+ setCredentialDrafts((current) => ({
1152
+ ...current,
1153
+ [slot]: value
1154
+ }));
1155
+ setCredentialFeedback(void 0);
1156
+ }
1157
+ })]
1158
+ }),
1159
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1160
+ style: credentialActionsStyle,
1161
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1162
+ type: "button",
1163
+ size: "sm",
1164
+ variant: "outline",
1165
+ disabled: disabled || keyDraft === "",
1166
+ onClick: () => {
1167
+ updateCredential(slot);
1168
+ },
1169
+ children: t("updateKey")
1170
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1171
+ type: "button",
1172
+ size: "sm",
1173
+ variant: "ghost",
1174
+ disabled: disabled || !state.configured,
1175
+ onClick: () => {
1176
+ clearCredential(slot);
1177
+ },
1178
+ children: t("clearKey")
1179
+ })]
1180
+ })
1181
+ ]
1182
+ }, slot);
1183
+ })
1184
+ }),
1185
+ credentialFeedback === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1186
+ style: bodyStyle,
1187
+ role: "status",
1188
+ children: credentialFeedback
1189
+ })
1190
+ ]
1191
+ }),
1192
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
1193
+ style: sectionDividerStyle,
1194
+ "aria-labelledby": "search-enhance-diagnostics-heading",
1195
+ children: [
1196
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
1197
+ id: "search-enhance-diagnostics-heading",
1198
+ style: headingStyle,
1199
+ children: t("diagnosticsHeading")
1200
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1201
+ style: {
1202
+ ...bodyStyle,
1203
+ marginTop: 4
1204
+ },
1205
+ children: t("diagnosticsIntro")
1206
+ })] }),
1207
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1208
+ style: noteStyle,
1209
+ children: t("offlineOnly")
1210
+ }),
1211
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1212
+ style: stateStyle,
1213
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: snapshot.diagnostics.minimumProfile.satisfied ? "done" : "warning" }), t(snapshot.diagnostics.minimumProfile.satisfied ? "minimumReady" : "minimumMissing")]
1214
+ }),
1215
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1216
+ style: bodyStyle,
1217
+ children: t("missingCount", { count: snapshot.diagnostics.missingProviders })
1218
+ }),
1219
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1220
+ style: bodyStyle,
1221
+ children: t("unavailableCount", { count: snapshot.diagnostics.unavailableProviders })
1222
+ }),
1223
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1224
+ type: "button",
1225
+ size: "sm",
1226
+ variant: "outline",
1227
+ onClick: () => {
1228
+ load();
1229
+ },
1230
+ children: t("refreshStatus")
1231
+ }) })
1232
+ ]
1233
+ }),
1234
+ !valid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1235
+ style: errorStyle,
1236
+ role: "alert",
1237
+ children: t("invalidNumber")
1238
+ }) : null,
1239
+ !snapshot.writable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
1240
+ style: errorStyle,
1241
+ role: "alert",
1242
+ children: t("readOnly")
1243
+ }) : null,
1244
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1245
+ style: actionsStyle,
1246
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1247
+ "aria-live": "polite",
1248
+ children: [
1249
+ feedback === "saved" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1250
+ style: successStyle,
1251
+ children: t("savedRestart")
1252
+ }) : null,
1253
+ feedback === "conflict" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1254
+ style: errorStyle,
1255
+ children: t("conflict")
1256
+ }) : null,
1257
+ feedback === "error" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1258
+ style: errorStyle,
1259
+ children: t("saveFailed")
1260
+ }) : null
1261
+ ]
1262
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1263
+ style: buttonsStyle,
1264
+ children: [
1265
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1266
+ type: "button",
1267
+ size: "sm",
1268
+ variant: "ghost",
1269
+ disabled: !dirty || saving,
1270
+ onClick: discard,
1271
+ children: t("discard")
1272
+ }),
1273
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1274
+ type: "button",
1275
+ size: "sm",
1276
+ variant: "outline",
1277
+ disabled: saving,
1278
+ onClick: () => {
1279
+ load();
1280
+ },
1281
+ children: t("reload")
1282
+ }),
1283
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1284
+ type: "button",
1285
+ size: "sm",
1286
+ variant: "primary",
1287
+ disabled: !dirty || !valid || !snapshot.writable || saving,
1288
+ onClick: () => {
1289
+ save();
1290
+ },
1291
+ children: saving ? t("saving") : t("save")
1292
+ })
1293
+ ]
1294
+ })]
1295
+ })
1296
+ ] })
1297
+ ]
1298
+ })]
1299
+ });
1300
+ }
1301
+ //#endregion
1302
+ //#region src/client/locales.ts
1303
+ const en = {
1304
+ title: "dsh-search-enhance",
1305
+ intro: "Grok search, default strategy, supplemental providers, credentials, and offline status.",
1306
+ expand: "Expand",
1307
+ collapse: "Collapse",
1308
+ loading: "Loading current configuration…",
1309
+ loadFailed: "The configuration could not be loaded.",
1310
+ retry: "Retry",
1311
+ grokHeading: "Grok search backend",
1312
+ grokIntro: "Use xAI or any explicit third-party Grok-compatible gateway. The endpoint and model are never rewritten to xAI defaults.",
1313
+ independentNote: "This search backend is independent from the llm-pi-ai conversation provider.",
1314
+ baseUrl: "Base URL",
1315
+ protocol: "Protocol",
1316
+ model: "Model",
1317
+ thinkingLevel: "Thinking level",
1318
+ timeoutMs: "Timeout (ms)",
1319
+ credentialRef: "Credential reference name",
1320
+ thirdPartyHint: "Example: https://gateway.example/grok/v1",
1321
+ strategyHeading: "Default search strategy",
1322
+ strategyIntro: "Defaults used when a tool call does not choose its own profile or depth.",
1323
+ defaultProfile: "Default profile",
1324
+ defaultDepth: "Default depth",
1325
+ toolDiscoveryMode: "Tool discovery",
1326
+ toolTimeoutMs: "Whole tool timeout (ms)",
1327
+ providersHeading: "Supplemental providers",
1328
+ providersIntro: "Endpoints and timeouts for documentation, fallback discovery, extraction, and site mapping.",
1329
+ providersSummary: "Advanced provider settings",
1330
+ context7: "Context7",
1331
+ exa: "Exa",
1332
+ tavily: "Tavily",
1333
+ firecrawl: "Firecrawl",
1334
+ proxyHeading: "Web extraction proxies",
1335
+ proxyIntro: "Optional HTTP proxies for the local smart_direct and direct extraction routes. Leave a field blank to remove its user override.",
1336
+ smartDirectProxy: "smart_direct HTTP proxy",
1337
+ directProxy: "direct HTTP proxy",
1338
+ proxyHint: "Use an unauthenticated http:// origin such as http://127.0.0.1:7890. HTTPS, SOCKS, authentication, paths, query strings, and fragments are unsupported; the direct proxy requires Node.js 24.5 or newer.",
1339
+ credentialsHeading: "Credentials",
1340
+ credentialsIntro: "Reference names are Settings values. Secret values go only to DSH Credentials and are never displayed again.",
1341
+ searchApiCredential: "Grok search",
1342
+ referenceLabel: "Reference: {ref}",
1343
+ configured: "Configured",
1344
+ missing: "Not configured",
1345
+ unavailable: "Status unavailable",
1346
+ sourceLabel: "Source: {source}",
1347
+ keyValue: "{name} key value",
1348
+ keyPlaceholder: "Enter a new key; blank keeps the current value",
1349
+ updateKey: "Update key",
1350
+ clearKey: "Clear key",
1351
+ credentialReadOnly: "A read-only source currently supplies this reference.",
1352
+ saveConfigFirst: "Save the changed reference name before editing its key.",
1353
+ keySaved: "{name} credential updated.",
1354
+ keyCleared: "{name} credential cleared.",
1355
+ keyFailed: "The credential operation failed.",
1356
+ diagnosticsHeading: "Configuration diagnostics",
1357
+ diagnosticsIntro: "This check reads validated configuration and credential descriptors only.",
1358
+ offlineOnly: "No Provider network request runs when this card loads or refreshes.",
1359
+ minimumReady: "Required capabilities are configured.",
1360
+ minimumMissing: "One or more required capabilities are not configured.",
1361
+ missingCount: "Missing providers: {count}",
1362
+ unavailableCount: "Unavailable status rows: {count}",
1363
+ refreshStatus: "Refresh status",
1364
+ save: "Save configuration",
1365
+ saving: "Saving…",
1366
+ discard: "Discard changes",
1367
+ reload: "Reload current values",
1368
+ savedRestart: "Saved. Restart DSH for these settings to take effect.",
1369
+ conflict: "The Settings document changed elsewhere. Reload before saving again.",
1370
+ saveFailed: "The configuration could not be saved.",
1371
+ readOnly: "The Settings document is read-only.",
1372
+ invalidNumber: "Timeouts must be positive whole numbers.",
1373
+ overridden: "User override",
1374
+ inherited: "Inherited"
1375
+ };
1376
+ const zh = {
1377
+ title: "dsh-search-enhance",
1378
+ intro: "配置 Grok 搜索、默认策略、补充 Provider、凭据与离线状态。",
1379
+ expand: "展开",
1380
+ collapse: "收起",
1381
+ loading: "正在读取当前配置…",
1382
+ loadFailed: "无法读取配置。",
1383
+ retry: "重试",
1384
+ grokHeading: "Grok 搜索后端",
1385
+ grokIntro: "支持 xAI 官方接口和任意显式第三方 Grok-compatible 网关;不会把端点或模型重置为 xAI 默认值。",
1386
+ independentNote: "该搜索后端与 llm-pi-ai 对话模型 Provider 完全独立。",
1387
+ baseUrl: "接口地址",
1388
+ protocol: "协议",
1389
+ model: "模型",
1390
+ thinkingLevel: "思考等级",
1391
+ timeoutMs: "超时(毫秒)",
1392
+ credentialRef: "凭据引用名",
1393
+ thirdPartyHint: "示例:https://gateway.example/grok/v1",
1394
+ strategyHeading: "默认搜索策略",
1395
+ strategyIntro: "工具调用未显式选择 profile 或 depth 时使用这些默认值。",
1396
+ defaultProfile: "默认 Profile",
1397
+ defaultDepth: "默认深度",
1398
+ toolDiscoveryMode: "工具披露模式",
1399
+ toolTimeoutMs: "工具总超时(毫秒)",
1400
+ providersHeading: "补充 Provider",
1401
+ providersIntro: "配置文档检索、补充发现、网页提取与站点映射所用的端点和超时。",
1402
+ providersSummary: "高级 Provider 设置",
1403
+ context7: "Context7",
1404
+ exa: "Exa",
1405
+ tavily: "Tavily",
1406
+ firecrawl: "Firecrawl",
1407
+ proxyHeading: "网页提取代理",
1408
+ proxyIntro: "分别为本地 smart_direct 与 direct 提取路线设置可选 HTTP 代理;留空会删除对应的用户覆盖。",
1409
+ smartDirectProxy: "smart_direct HTTP 代理",
1410
+ directProxy: "direct HTTP 代理",
1411
+ proxyHint: "仅支持无认证的 http:// origin,例如 http://127.0.0.1:7890;不支持 HTTPS、SOCKS、认证、路径、查询或片段,direct 代理需要 Node.js 24.5 或更高版本。",
1412
+ credentialsHeading: "凭据",
1413
+ credentialsIntro: "引用名属于 Settings;密钥值只写入 DSH Credentials,写入后绝不回显。",
1414
+ searchApiCredential: "Grok 搜索",
1415
+ referenceLabel: "引用:{ref}",
1416
+ configured: "已配置",
1417
+ missing: "未配置",
1418
+ unavailable: "状态不可用",
1419
+ sourceLabel: "来源:{source}",
1420
+ keyValue: "{name} 密钥值",
1421
+ keyPlaceholder: "输入新密钥;留空保持现有值",
1422
+ updateKey: "更新密钥",
1423
+ clearKey: "清除密钥",
1424
+ credentialReadOnly: "当前由只读来源提供该引用。",
1425
+ saveConfigFirst: "请先保存已修改的引用名,再编辑对应密钥。",
1426
+ keySaved: "{name} 凭据已更新。",
1427
+ keyCleared: "{name} 凭据已清除。",
1428
+ keyFailed: "凭据操作失败。",
1429
+ diagnosticsHeading: "配置诊断",
1430
+ diagnosticsIntro: "该检查只读取已校验配置和凭据描述状态。",
1431
+ offlineOnly: "卡片加载或刷新时不会向任何 Provider 发起网络请求。",
1432
+ minimumReady: "必需能力均已配置。",
1433
+ minimumMissing: "一个或多个必需能力尚未配置。",
1434
+ missingCount: "缺少凭据的 Provider:{count}",
1435
+ unavailableCount: "状态不可用项:{count}",
1436
+ refreshStatus: "刷新状态",
1437
+ save: "保存配置",
1438
+ saving: "正在保存…",
1439
+ discard: "放弃修改",
1440
+ reload: "重新读取当前值",
1441
+ savedRestart: "已保存。请重启 DSH 使这些设置生效。",
1442
+ conflict: "Settings 已在其他位置发生变化。请重新读取后再保存。",
1443
+ saveFailed: "无法保存配置。",
1444
+ readOnly: "Settings 文档为只读。",
1445
+ invalidNumber: "超时必须是正整数。",
1446
+ overridden: "用户覆盖",
1447
+ inherited: "继承值"
1448
+ };
1449
+ //#endregion
1450
+ //#region src/client/index.tsx
1451
+ const name = "dsh-search-enhance-client";
1452
+ const inject = ["slots", "locale"];
1453
+ function apply(ctx) {
1454
+ ctx.effect(() => ctx.locale.register(SEARCH_ENHANCE_LOCALE_NAMESPACE, {
1455
+ zh,
1456
+ en
1457
+ }), "dsh-search-enhance: settings dictionaries");
1458
+ ctx.slots.inject("settings.plugin.item", () => ctx.slots.register({
1459
+ name: "settings.plugin.item",
1460
+ id: "dsh-search-enhance",
1461
+ order: 25,
1462
+ locale: SEARCH_ENHANCE_LOCALE_NAMESPACE
1463
+ }, SearchEnhancePluginCard));
1464
+ }
1465
+ //#endregion
1466
+ exports.SearchEnhancePluginCard = SearchEnhancePluginCard;
1467
+ exports.WebConfigClientError = WebConfigClientError;
1468
+ exports.apply = apply;
1469
+ exports.deleteWebCredential = deleteWebCredential;
1470
+ exports.inject = inject;
1471
+ exports.loadWebConfig = loadWebConfig;
1472
+ exports.name = name;
1473
+ exports.saveWebConfig = saveWebConfig;
1474
+ exports.writeWebCredential = writeWebCredential;
1475
+ return module.exports;
1476
+ }
1477
+ });
1478
+
1479
+ //# sourceMappingURL=client.js.map