@240xu/dsh-websearch 2.13.5 → 2.13.6
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 +1 -1
- package/lib/client.js +25 -9
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/client.js
CHANGED
|
@@ -143,6 +143,7 @@ window.__ModuleLoader__.load({
|
|
|
143
143
|
interventionBalanced: "平衡(确定性去噪 + 去重/遥测,默认)",
|
|
144
144
|
interventionThorough: "彻底(相关性重排 + 深度覆盖)",
|
|
145
145
|
interventionHint: "official 把查询与结果呈现完全交给官方工具;balanced 只剥明确的口语前缀;thorough 会重排并扩大后端请求,延迟与额度消耗更高。内部多查询仍是独立开关。",
|
|
146
|
+
officialHint: "官方档会覆盖:结果条数、相关性重排、结果健康遥测、引用提示头——这四项在你离开 official 前不生效。",
|
|
146
147
|
unavailable: "设置暂不可用:宿主没有返回配置快照(服务未就绪或路由未挂载)。",
|
|
147
148
|
retry: "重试",
|
|
148
149
|
loading: "载入中…",
|
|
@@ -235,6 +236,7 @@ window.__ModuleLoader__.load({
|
|
|
235
236
|
interventionBalanced: "Balanced (deterministic cleanup + dedupe/telemetry, default)",
|
|
236
237
|
interventionThorough: "Thorough (relevance rerank + deep coverage)",
|
|
237
238
|
interventionHint: "official leaves query construction and presentation to the host tool; balanced strips only explicit conversational prefixes; thorough reranks and widens backend requests, costing more latency and quota. Internal multi-query stays a separate opt-in.",
|
|
239
|
+
officialHint: "Official also overrides Results, Relevance rerank, Result health telemetry and Citation header; those controls have no effect until you leave official.",
|
|
238
240
|
unavailable: "Settings are unavailable: the host returned no configuration snapshot (service not ready or route not mounted).",
|
|
239
241
|
retry: "Retry",
|
|
240
242
|
loading: "Loading…",
|
|
@@ -861,6 +863,8 @@ window.__ModuleLoader__.load({
|
|
|
861
863
|
react_jsx_runtime.jsx("select", {
|
|
862
864
|
className: "wsc-input",
|
|
863
865
|
"aria-label": props.label,
|
|
866
|
+
"aria-describedby": props.describedBy,
|
|
867
|
+
disabled: props.disabled === true,
|
|
864
868
|
value: props.value,
|
|
865
869
|
onChange: (e) => props.onChange(e.target.value),
|
|
866
870
|
children: props.options.map((o) =>
|
|
@@ -950,6 +954,12 @@ window.__ModuleLoader__.load({
|
|
|
950
954
|
const { state, card, t } = props;
|
|
951
955
|
const selVal = (f, dflt) => state.stagedText(f) ?? String(state.value[f] ?? dflt);
|
|
952
956
|
const cacheOn = selVal("cacheEnabled", "true") !== "false";
|
|
957
|
+
const official = selVal("intervention", "balanced") === "official";
|
|
958
|
+
const hasDraft = (f) => state.stagedText(f) !== undefined;
|
|
959
|
+
// A gate only locks untouched fields; a field with a pending edit
|
|
960
|
+
// stays editable so the user can correct or discard it.
|
|
961
|
+
const officialLocked = (f) => official && !hasDraft(f);
|
|
962
|
+
const ttlLocked = !cacheOn && !hasDraft("cacheTtl");
|
|
953
963
|
const recencyOptions = [
|
|
954
964
|
{ value: "any", label: t("recencyAny") },
|
|
955
965
|
{ value: "day", label: t("recencyDay") },
|
|
@@ -978,24 +988,25 @@ window.__ModuleLoader__.load({
|
|
|
978
988
|
options: interventionOptions,
|
|
979
989
|
onChange: (v) => card.edit("intervention", v),
|
|
980
990
|
}) }),
|
|
981
|
-
react_jsx_runtime.jsx("p", { className: "wsc-hint", children: t("interventionHint") }),
|
|
991
|
+
react_jsx_runtime.jsx("p", { className: "wsc-hint", id: "wsc-intervention-hint", children: t("interventionHint") + (official ? " " + t("officialHint") : "") }),
|
|
982
992
|
react_jsx_runtime.jsx("h4", { className: "wsc-sectionTitle", children: t("globalsTitle") }),
|
|
983
993
|
react_jsx_runtime.jsxs("div", { className: "wsc-grid", children: [
|
|
984
994
|
react_jsx_runtime.jsxs("div", { children: [
|
|
985
995
|
react_jsx_runtime.jsx("div", { className: "wsc-fieldHead", children: react_jsx_runtime.jsx("span", { className: "wsc-label", children: t("numResultsLabel") }) }),
|
|
986
|
-
react_jsx_runtime.jsx("input", { className: "wsc-input", "aria-label": t("numResultsLabel"), value: state.stagedText("numResults") ?? String(state.value.numResults ?? ""), onChange: (e) => card.edit("numResults", e.target.value), inputMode: "numeric" }),
|
|
996
|
+
react_jsx_runtime.jsx("input", { className: "wsc-input", "aria-label": t("numResultsLabel"), "aria-describedby": official ? "wsc-intervention-hint" : undefined, "aria-invalid": state.failedFields.includes("numResults") || undefined, disabled: officialLocked("numResults"), value: state.stagedText("numResults") ?? String(state.value.numResults ?? ""), onChange: (e) => card.edit("numResults", e.target.value), inputMode: "numeric" }),
|
|
987
997
|
] }),
|
|
988
998
|
react_jsx_runtime.jsxs("div", { children: [
|
|
989
999
|
react_jsx_runtime.jsx("div", { className: "wsc-fieldHead", children: react_jsx_runtime.jsx("span", { className: "wsc-label", children: t("concurrencyLabel") }) }),
|
|
990
|
-
react_jsx_runtime.jsx("input", { className: "wsc-input", "aria-label": t("concurrencyLabel"), value: state.stagedText("concurrency") ?? String(state.value.concurrency ?? ""), onChange: (e) => card.edit("concurrency", e.target.value), inputMode: "numeric" }),
|
|
1000
|
+
react_jsx_runtime.jsx("input", { className: "wsc-input", "aria-label": t("concurrencyLabel"), "aria-invalid": state.failedFields.includes("concurrency") || undefined, value: state.stagedText("concurrency") ?? String(state.value.concurrency ?? ""), onChange: (e) => card.edit("concurrency", e.target.value), inputMode: "numeric" }),
|
|
991
1001
|
] }),
|
|
992
1002
|
react_jsx_runtime.jsxs("div", { children: [
|
|
993
1003
|
react_jsx_runtime.jsx("div", { className: "wsc-fieldHead", children: react_jsx_runtime.jsx("span", { className: "wsc-label", children: t("timeoutLabel") }) }),
|
|
994
|
-
react_jsx_runtime.jsx("input", { className: "wsc-input", "aria-label": t("timeoutLabel"), value: state.stagedText("backendTimeoutMs") ?? String(state.value.backendTimeoutMs ?? ""), onChange: (e) => card.edit("backendTimeoutMs", e.target.value), inputMode: "numeric" }),
|
|
1004
|
+
react_jsx_runtime.jsx("input", { className: "wsc-input", "aria-label": t("timeoutLabel"), "aria-invalid": state.failedFields.includes("backendTimeoutMs") || undefined, value: state.stagedText("backendTimeoutMs") ?? String(state.value.backendTimeoutMs ?? ""), onChange: (e) => card.edit("backendTimeoutMs", e.target.value), inputMode: "numeric" }),
|
|
995
1005
|
] }),
|
|
1006
|
+
react_jsx_runtime.jsx(SelectField, { label: t("cacheLabel"), value: selVal("cacheEnabled", "true"), options: boolOptions, onChange: (v) => card.edit("cacheEnabled", v) }),
|
|
996
1007
|
react_jsx_runtime.jsxs("div", { children: [
|
|
997
1008
|
react_jsx_runtime.jsx("div", { className: "wsc-fieldHead", children: react_jsx_runtime.jsx("span", { className: "wsc-label", children: t("cacheTtlLabel") }) }),
|
|
998
|
-
react_jsx_runtime.jsx("input", { className: "wsc-input", id: "wsc-cacheTtl", "aria-label": t("cacheTtlLabel"), "aria-describedby": "wsc-cacheTtl-hint", "aria-invalid": state.failedFields.includes("cacheTtl") || undefined, disabled:
|
|
1009
|
+
react_jsx_runtime.jsx("input", { className: "wsc-input", id: "wsc-cacheTtl", "aria-label": t("cacheTtlLabel"), "aria-describedby": "wsc-cacheTtl-hint", "aria-invalid": state.failedFields.includes("cacheTtl") || undefined, disabled: ttlLocked, value: state.stagedText("cacheTtl") ?? String(state.value.cacheTtl ?? ""), onChange: (e) => card.edit("cacheTtl", e.target.value), inputMode: "numeric" }),
|
|
999
1010
|
react_jsx_runtime.jsx("p", { className: "wsc-hint", id: "wsc-cacheTtl-hint", children: cacheOn ? t("cacheTtlHint") : t("cacheTtlHint") + " " + t("cacheOffHint") }),
|
|
1000
1011
|
] }),
|
|
1001
1012
|
] }),
|
|
@@ -1015,11 +1026,10 @@ window.__ModuleLoader__.load({
|
|
|
1015
1026
|
] }),
|
|
1016
1027
|
react_jsx_runtime.jsx(SelectField, { label: t("recencyLabel"), value: selVal("recency", "any"), options: recencyOptions, onChange: (v) => card.edit("recency", v) }),
|
|
1017
1028
|
react_jsx_runtime.jsx(SelectField, { label: t("dedupLabel"), value: selVal("dedupStrategy", "url"), options: dedupOptions, onChange: (v) => card.edit("dedupStrategy", v) }),
|
|
1018
|
-
react_jsx_runtime.jsx(SelectField, { label: t("rerankLabel"), value: selVal("rerank", "false"), options: boolOptions, onChange: (v) => card.edit("rerank", v) }),
|
|
1029
|
+
react_jsx_runtime.jsx(SelectField, { label: t("rerankLabel"), value: selVal("rerank", "false"), options: boolOptions, disabled: officialLocked("rerank"), describedBy: official ? "wsc-intervention-hint" : undefined, onChange: (v) => card.edit("rerank", v) }),
|
|
1019
1030
|
react_jsx_runtime.jsx(SelectField, { label: t("safeSearchLabel"), value: selVal("safeSearch", "true"), options: boolOptions, onChange: (v) => card.edit("safeSearch", v) }),
|
|
1020
|
-
react_jsx_runtime.jsx(SelectField, { label: t("telemetryLabel"), value: selVal("resultTelemetry", "true"), options: boolOptions, onChange: (v) => card.edit("resultTelemetry", v) }),
|
|
1021
|
-
react_jsx_runtime.jsx(SelectField, { label: t("resultHeaderLabel"), value: selVal("resultHeader", "true"), options: boolOptions, onChange: (v) => card.edit("resultHeader", v) }),
|
|
1022
|
-
react_jsx_runtime.jsx(SelectField, { label: t("cacheLabel"), value: selVal("cacheEnabled", "true"), options: boolOptions, onChange: (v) => card.edit("cacheEnabled", v) }),
|
|
1031
|
+
react_jsx_runtime.jsx(SelectField, { label: t("telemetryLabel"), value: selVal("resultTelemetry", "true"), options: boolOptions, disabled: officialLocked("resultTelemetry"), describedBy: official ? "wsc-intervention-hint" : undefined, onChange: (v) => card.edit("resultTelemetry", v) }),
|
|
1032
|
+
react_jsx_runtime.jsx(SelectField, { label: t("resultHeaderLabel"), value: selVal("resultHeader", "true"), options: boolOptions, disabled: officialLocked("resultHeader"), describedBy: official ? "wsc-intervention-hint" : undefined, onChange: (v) => card.edit("resultHeader", v) }),
|
|
1023
1033
|
] }),
|
|
1024
1034
|
] });
|
|
1025
1035
|
}
|
|
@@ -1123,6 +1133,12 @@ window.__ModuleLoader__.load({
|
|
|
1123
1133
|
];
|
|
1124
1134
|
const selVal = (f, dflt) => state.stagedText(f) ?? String(state.value[f] ?? dflt);
|
|
1125
1135
|
const cacheOn = selVal("cacheEnabled", "true") !== "false";
|
|
1136
|
+
const official = selVal("intervention", "balanced") === "official";
|
|
1137
|
+
const hasDraft = (f) => state.stagedText(f) !== undefined;
|
|
1138
|
+
// A gate only locks untouched fields; a field with a pending edit
|
|
1139
|
+
// stays editable so the user can correct or discard it.
|
|
1140
|
+
const officialLocked = (f) => official && !hasDraft(f);
|
|
1141
|
+
const ttlLocked = !cacheOn && !hasDraft("cacheTtl");
|
|
1126
1142
|
|
|
1127
1143
|
return react_jsx_runtime.jsxs("div", { className: "wsc-card", children: [
|
|
1128
1144
|
react_jsx_runtime.jsx(StatusSummary, { state, enabledCount, hasOverride: override.length > 0, keysReady, t: props.t }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@240xu/dsh-websearch",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.6",
|
|
4
4
|
"description": "Unified web search provider for DeepSeek Harness (ctx.web): 13 backends — Exa + Parallel + DDG + SearXNG (keyless), DeepSeek + Anthropic + OpenAI + Brave + Tavily + Serper + Mojeek (key-gated via Settings credentials), Firecrawl + TinyFish (metered keyless, opt-in). Registers provider id \"unified\" for zero-config web_search. 统一网页搜索聚合:13 后端并发扇出、去重合并。See CHANGELOG.md for version history.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|