dsh-model-switch 0.4.66 → 0.4.67
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/CHANGELOG.md +11 -0
- package/README.en.md +251 -0
- package/README.md +108 -108
- package/cordis.patch.yml +3 -6
- package/docs/screenshots/composer-picker.png +0 -0
- package/docs/screenshots/plan-review.png +0 -0
- package/docs/screenshots/settings-subagent.png +0 -0
- package/lib/client.js +153 -289
- package/lib/types/client/ModelSwitchSettings.d.ts +0 -2
- package/lib/types/client/locales.d.ts +0 -10
- package/lib/types/client-contract.d.ts +0 -9
- package/lib/types/review-timeout.d.ts +4 -0
- package/package.json +2 -2
- package/README.zh.md +0 -247
package/lib/client.js
CHANGED
|
@@ -447,8 +447,6 @@ window.__ModuleLoader__.load({
|
|
|
447
447
|
enabled: "autoReviewSkipReadOnly",
|
|
448
448
|
tools: "autoReviewAllowlist"
|
|
449
449
|
});
|
|
450
|
-
/** Upstream ceiling enforced by `@deepseek-ai/dsh-timeout` (MAX_TIMER_DELAY_MS). */
|
|
451
|
-
const UPSTREAM_MAX_IDLE_TIMEOUT_MS = 2147483647;
|
|
452
450
|
/**
|
|
453
451
|
* Derive the allowlist editor's value.
|
|
454
452
|
*
|
|
@@ -2025,29 +2023,6 @@ window.__ModuleLoader__.load({
|
|
|
2025
2023
|
})).filter((row) => allowlistQueryText === "" || row.entry.toLowerCase().includes(allowlistQueryText));
|
|
2026
2024
|
const allowlistAvailable = (catalogRows ?? []).filter((row) => !isAllowedByList(row.name, allowlistTools)).filter((row) => allowlistQueryText === "" || row.name.toLowerCase().includes(allowlistQueryText) || row.sourceLabel.toLowerCase().includes(allowlistQueryText));
|
|
2027
2025
|
const allowlistSummaryText = allowlistView === void 0 ? props.t("loading") : allowlistEnabled ? props.t("reviewAllowlistOnSummary").replace("{count}", String(allowlistTools.length)) : props.t("reviewAllowlistOffSummary");
|
|
2028
|
-
/**
|
|
2029
|
-
* The reviewer stream idle timeout, stored in seconds for display; undefined
|
|
2030
|
-
* = follow the provider default. The save path converts to milliseconds and
|
|
2031
|
-
* `0` = cancelled (upstream ceiling) before writing.
|
|
2032
|
-
*/
|
|
2033
|
-
const storedTimeoutMs = switchSettings.value?.autoReviewTimeoutMs;
|
|
2034
|
-
const [timeoutDraft, setTimeoutDraft] = (0, react.useState)(void 0);
|
|
2035
|
-
const timeoutSeconds = timeoutDraft ?? (storedTimeoutMs === void 0 ? void 0 : String(Math.round(storedTimeoutMs / 1e3)));
|
|
2036
|
-
const timeoutCancelled = storedTimeoutMs === 0;
|
|
2037
|
-
const timeoutWritable = switchSettings.status === "ready" && switchSettings.writable;
|
|
2038
|
-
const timeoutSummary = storedTimeoutMs === void 0 ? props.t("reviewTimeoutDefault") : storedTimeoutMs === 0 ? props.t("reviewTimeoutCancelled") : `${Math.round(storedTimeoutMs / 1e3)}s`;
|
|
2039
|
-
const saveTimeout = () => {
|
|
2040
|
-
if (busy !== void 0 || !timeoutWritable) return;
|
|
2041
|
-
const trimmed = (timeoutDraft ?? "").trim();
|
|
2042
|
-
if (trimmed === "") {
|
|
2043
|
-
run("timeout", () => props.saveReviewTimeout(void 0));
|
|
2044
|
-
return;
|
|
2045
|
-
}
|
|
2046
|
-
const seconds = Number(trimmed);
|
|
2047
|
-
if (!Number.isFinite(seconds) || seconds < 1 || !Number.isInteger(seconds)) return;
|
|
2048
|
-
const ms = Math.min(seconds, Math.round(UPSTREAM_MAX_IDLE_TIMEOUT_MS / 1e3)) * 1e3;
|
|
2049
|
-
run("timeout", () => props.saveReviewTimeout(ms));
|
|
2050
|
-
};
|
|
2051
2026
|
const saveSubagent = () => {
|
|
2052
2027
|
if (subagentDraft === void 0 || subagentDraft.mode !== "fixed") return;
|
|
2053
2028
|
const matched = subagentCatalogModel;
|
|
@@ -2877,256 +2852,175 @@ window.__ModuleLoader__.load({
|
|
|
2877
2852
|
}),
|
|
2878
2853
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2879
2854
|
className: ModelSwitchSettings_module_css_default.group,
|
|
2880
|
-
children: [
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2855
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
2856
|
+
className: ModelSwitchSettings_module_css_default.groupLabel,
|
|
2857
|
+
children: props.t("reviewAllowlistGroup")
|
|
2858
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(RouteCard, {
|
|
2859
|
+
title: props.t("reviewAllowlist"),
|
|
2860
|
+
summary: allowlistSummaryText,
|
|
2861
|
+
hint: props.t("reviewAllowlistHelp"),
|
|
2862
|
+
icon: "autoReview",
|
|
2863
|
+
open: open === "allowlist",
|
|
2864
|
+
onToggle: () => {
|
|
2865
|
+
toggle("allowlist");
|
|
2866
|
+
},
|
|
2867
|
+
...allowlistEnabled ? { badge: props.t("reviewAllowlistBadge") } : {},
|
|
2868
|
+
trailing: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstantSwitch, {
|
|
2869
|
+
checked: allowlistEnabled,
|
|
2870
|
+
disabled: busy !== void 0 || !allowlistWritable,
|
|
2871
|
+
label: props.t("reviewAllowlist"),
|
|
2872
|
+
onChange: (value) => {
|
|
2873
|
+
persistAllowlist({
|
|
2874
|
+
enabled: value,
|
|
2875
|
+
tools: allowlistTools
|
|
2876
|
+
});
|
|
2877
|
+
}
|
|
2884
2878
|
}),
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
icon: "autoReview",
|
|
2890
|
-
open: open === "allowlist",
|
|
2891
|
-
onToggle: () => {
|
|
2892
|
-
toggle("allowlist");
|
|
2893
|
-
},
|
|
2894
|
-
...allowlistEnabled ? { badge: props.t("reviewAllowlistBadge") } : {},
|
|
2895
|
-
trailing: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InstantSwitch, {
|
|
2896
|
-
checked: allowlistEnabled,
|
|
2897
|
-
disabled: busy !== void 0 || !allowlistWritable,
|
|
2898
|
-
label: props.t("reviewAllowlist"),
|
|
2899
|
-
onChange: (value) => {
|
|
2900
|
-
persistAllowlist({
|
|
2901
|
-
enabled: value,
|
|
2902
|
-
tools: allowlistTools
|
|
2903
|
-
});
|
|
2904
|
-
}
|
|
2879
|
+
children: [
|
|
2880
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2881
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
2882
|
+
children: props.t("reviewAllowlistNote")
|
|
2905
2883
|
}),
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2884
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2885
|
+
className: ModelSwitchSettings_module_css_default.allowToolbar,
|
|
2886
|
+
children: [
|
|
2887
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2888
|
+
className: ModelSwitchSettings_module_css_default.input,
|
|
2889
|
+
type: "search",
|
|
2890
|
+
value: allowlistQuery,
|
|
2891
|
+
placeholder: props.t("reviewAllowlistSearch"),
|
|
2892
|
+
onChange: (event) => {
|
|
2893
|
+
setAllowlistQuery(event.target.value);
|
|
2894
|
+
}
|
|
2895
|
+
}),
|
|
2896
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2897
|
+
type: "button",
|
|
2898
|
+
className: cx(ModelSwitchSettings_module_css_default.button, ModelSwitchSettings_module_css_default.secondaryButton),
|
|
2899
|
+
disabled: busy !== void 0 || props.scanTools === void 0 || catalogState === "loading",
|
|
2900
|
+
onClick: scanAllowlistTools,
|
|
2901
|
+
children: catalogState === "loading" ? props.t("reviewAllowlistScanning") : props.t("reviewAllowlistScan")
|
|
2902
|
+
}),
|
|
2903
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2904
|
+
type: "button",
|
|
2905
|
+
className: cx(ModelSwitchSettings_module_css_default.button, ModelSwitchSettings_module_css_default.secondaryButton),
|
|
2906
|
+
disabled: busy !== void 0 || !allowlistWritable,
|
|
2907
|
+
onClick: () => {
|
|
2908
|
+
persistAllowlist({
|
|
2909
|
+
enabled: allowlistEnabled,
|
|
2910
|
+
tools: [...DEFAULT_READ_ONLY_TOOLS]
|
|
2911
|
+
});
|
|
2912
|
+
},
|
|
2913
|
+
children: props.t("reviewAllowlistReset")
|
|
2914
|
+
})
|
|
2915
|
+
]
|
|
2916
|
+
}),
|
|
2917
|
+
message?.route === "allowlist" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2918
|
+
className: cx(ModelSwitchSettings_module_css_default.hint, ModelSwitchSettings_module_css_default.message),
|
|
2919
|
+
children: message.text
|
|
2920
|
+
}) : null,
|
|
2921
|
+
reviewStatus === void 0 || reviewStatus.skippedReadOnly === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2922
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
2923
|
+
children: props.t("reviewAllowlistSkipped").replace("{count}", String(reviewStatus.skippedReadOnly))
|
|
2924
|
+
}),
|
|
2925
|
+
reviewStatus?.automode === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2926
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
2927
|
+
children: props.t("reviewAutomodeLinked").replace("{route}", reviewStatus.automode.route ?? (reviewStatus.automode.routeSkipped === "user-set" ? props.t("reviewAutomodeRouteOwn") : props.t("reviewAutomodeRouteUnset"))).replace("{added}", String(reviewStatus.automode.added)).replace("{skipped}", String(reviewStatus.automode.skipped))
|
|
2928
|
+
}),
|
|
2929
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2930
|
+
className: ModelSwitchSettings_module_css_default.allowList,
|
|
2931
|
+
children: allowlistIncluded.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2932
|
+
className: ModelSwitchSettings_module_css_default.allowRow,
|
|
2913
2933
|
children: [
|
|
2914
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
2915
|
-
className: ModelSwitchSettings_module_css_default.
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2934
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
2935
|
+
className: ModelSwitchSettings_module_css_default.allowLabel,
|
|
2936
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2937
|
+
type: "checkbox",
|
|
2938
|
+
checked: true,
|
|
2939
|
+
readOnly: true
|
|
2940
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
2941
|
+
className: ModelSwitchSettings_module_css_default.allowName,
|
|
2942
|
+
children: row.entry
|
|
2943
|
+
})]
|
|
2922
2944
|
}),
|
|
2923
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2945
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2946
|
+
className: ModelSwitchSettings_module_css_default.allowSource,
|
|
2947
|
+
children: [row.source.label, row.source.repo === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2948
|
+
className: ModelSwitchSettings_module_css_default.allowDot,
|
|
2949
|
+
children: "·"
|
|
2950
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
2951
|
+
className: ModelSwitchSettings_module_css_default.allowRepo,
|
|
2952
|
+
href: row.source.repo,
|
|
2953
|
+
target: "_blank",
|
|
2954
|
+
rel: "noreferrer",
|
|
2955
|
+
children: props.t("reviewAllowlistRepo")
|
|
2956
|
+
})] })]
|
|
2929
2957
|
}),
|
|
2930
2958
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2931
2959
|
type: "button",
|
|
2932
2960
|
className: cx(ModelSwitchSettings_module_css_default.button, ModelSwitchSettings_module_css_default.secondaryButton),
|
|
2933
2961
|
disabled: busy !== void 0 || !allowlistWritable,
|
|
2934
2962
|
onClick: () => {
|
|
2935
|
-
|
|
2936
|
-
enabled: allowlistEnabled,
|
|
2937
|
-
tools: [...DEFAULT_READ_ONLY_TOOLS]
|
|
2938
|
-
});
|
|
2963
|
+
setAllowTool(row.entry, false);
|
|
2939
2964
|
},
|
|
2940
|
-
children: props.t("
|
|
2965
|
+
children: props.t("reviewAllowlistRemove")
|
|
2941
2966
|
})
|
|
2942
2967
|
]
|
|
2943
|
-
})
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
className: ModelSwitchSettings_module_css_default.allowRow,
|
|
2960
|
-
children: [
|
|
2961
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
2962
|
-
className: ModelSwitchSettings_module_css_default.allowLabel,
|
|
2963
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2964
|
-
type: "checkbox",
|
|
2965
|
-
checked: true,
|
|
2966
|
-
readOnly: true
|
|
2967
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
2968
|
-
className: ModelSwitchSettings_module_css_default.allowName,
|
|
2969
|
-
children: row.entry
|
|
2970
|
-
})]
|
|
2971
|
-
}),
|
|
2972
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2973
|
-
className: ModelSwitchSettings_module_css_default.allowSource,
|
|
2974
|
-
children: [row.source.label, row.source.repo === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2975
|
-
className: ModelSwitchSettings_module_css_default.allowDot,
|
|
2976
|
-
children: "·"
|
|
2977
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
2978
|
-
className: ModelSwitchSettings_module_css_default.allowRepo,
|
|
2979
|
-
href: row.source.repo,
|
|
2980
|
-
target: "_blank",
|
|
2981
|
-
rel: "noreferrer",
|
|
2982
|
-
children: props.t("reviewAllowlistRepo")
|
|
2983
|
-
})] })]
|
|
2984
|
-
}),
|
|
2985
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2986
|
-
type: "button",
|
|
2987
|
-
className: cx(ModelSwitchSettings_module_css_default.button, ModelSwitchSettings_module_css_default.secondaryButton),
|
|
2988
|
-
disabled: busy !== void 0 || !allowlistWritable,
|
|
2989
|
-
onClick: () => {
|
|
2990
|
-
setAllowTool(row.entry, false);
|
|
2991
|
-
},
|
|
2992
|
-
children: props.t("reviewAllowlistRemove")
|
|
2993
|
-
})
|
|
2994
|
-
]
|
|
2995
|
-
}, row.entry))
|
|
2996
|
-
}),
|
|
2997
|
-
allowlistIncluded.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2998
|
-
className: ModelSwitchSettings_module_css_default.hint,
|
|
2999
|
-
children: props.t("reviewAllowlistNone")
|
|
3000
|
-
}) : null,
|
|
3001
|
-
allowlistAvailable.length === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3002
|
-
className: ModelSwitchSettings_module_css_default.hint,
|
|
3003
|
-
children: props.t("reviewAllowlistAvailable")
|
|
3004
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
3005
|
-
className: ModelSwitchSettings_module_css_default.allowList,
|
|
3006
|
-
children: allowlistAvailable.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
3007
|
-
className: ModelSwitchSettings_module_css_default.allowRow,
|
|
3008
|
-
children: [
|
|
3009
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3010
|
-
className: ModelSwitchSettings_module_css_default.allowLabel,
|
|
3011
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3012
|
-
type: "checkbox",
|
|
3013
|
-
checked: false,
|
|
3014
|
-
readOnly: true
|
|
3015
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
3016
|
-
className: ModelSwitchSettings_module_css_default.allowName,
|
|
3017
|
-
children: row.name
|
|
3018
|
-
})]
|
|
3019
|
-
}),
|
|
3020
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3021
|
-
className: ModelSwitchSettings_module_css_default.allowSource,
|
|
3022
|
-
children: [row.sourceLabel, row.repo === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3023
|
-
className: ModelSwitchSettings_module_css_default.allowDot,
|
|
3024
|
-
children: "·"
|
|
3025
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
3026
|
-
className: ModelSwitchSettings_module_css_default.allowRepo,
|
|
3027
|
-
href: row.repo,
|
|
3028
|
-
target: "_blank",
|
|
3029
|
-
rel: "noreferrer",
|
|
3030
|
-
children: props.t("reviewAllowlistRepo")
|
|
3031
|
-
})] })]
|
|
3032
|
-
}),
|
|
3033
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3034
|
-
type: "button",
|
|
3035
|
-
className: cx(ModelSwitchSettings_module_css_default.button, ModelSwitchSettings_module_css_default.secondaryButton),
|
|
3036
|
-
disabled: busy !== void 0 || !allowlistWritable,
|
|
3037
|
-
onClick: () => {
|
|
3038
|
-
setAllowTool(row.name, true);
|
|
3039
|
-
},
|
|
3040
|
-
children: props.t("reviewAllowlistAdd")
|
|
3041
|
-
})
|
|
3042
|
-
]
|
|
3043
|
-
}, row.name))
|
|
3044
|
-
})] }),
|
|
3045
|
-
catalogState === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3046
|
-
className: cx(ModelSwitchSettings_module_css_default.hint, ModelSwitchSettings_module_css_default.message),
|
|
3047
|
-
children: props.t("reviewAllowlistScanFailed")
|
|
3048
|
-
}) : null
|
|
3049
|
-
]
|
|
3050
|
-
}),
|
|
3051
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(RouteCard, {
|
|
3052
|
-
title: props.t("reviewTimeout"),
|
|
3053
|
-
summary: timeoutSummary,
|
|
3054
|
-
hint: props.t("reviewTimeoutHelp"),
|
|
3055
|
-
icon: "autoReview",
|
|
3056
|
-
open: open === "timeout",
|
|
3057
|
-
onToggle: () => {
|
|
3058
|
-
toggle("timeout");
|
|
3059
|
-
},
|
|
3060
|
-
children: [
|
|
3061
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3062
|
-
className: ModelSwitchSettings_module_css_default.hint,
|
|
3063
|
-
children: props.t("reviewTimeoutScope")
|
|
3064
|
-
}),
|
|
3065
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3066
|
-
className: ModelSwitchSettings_module_css_default.formGrid,
|
|
3067
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3068
|
-
className: ModelSwitchSettings_module_css_default.field,
|
|
3069
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3070
|
-
className: ModelSwitchSettings_module_css_default.fieldLabel,
|
|
3071
|
-
children: props.t("reviewTimeoutSeconds")
|
|
3072
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3073
|
-
className: ModelSwitchSettings_module_css_default.input,
|
|
3074
|
-
type: "number",
|
|
3075
|
-
min: 1,
|
|
3076
|
-
max: Math.round(UPSTREAM_MAX_IDLE_TIMEOUT_MS / 1e3),
|
|
3077
|
-
step: 1,
|
|
3078
|
-
disabled: busy !== void 0 || !timeoutWritable || timeoutCancelled,
|
|
3079
|
-
value: timeoutSeconds ?? "",
|
|
3080
|
-
placeholder: props.t("reviewTimeoutPlaceholder"),
|
|
3081
|
-
onChange: (event) => {
|
|
3082
|
-
setTimeoutDraft(event.target.value);
|
|
3083
|
-
}
|
|
3084
|
-
})]
|
|
3085
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
3086
|
-
className: ModelSwitchSettings_module_css_default.field,
|
|
3087
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3088
|
-
className: ModelSwitchSettings_module_css_default.fieldLabel,
|
|
3089
|
-
children: props.t("reviewTimeoutCancelLabel")
|
|
3090
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
3091
|
-
style: {
|
|
3092
|
-
display: "flex",
|
|
3093
|
-
alignItems: "center",
|
|
3094
|
-
gap: 6
|
|
3095
|
-
},
|
|
2968
|
+
}, row.entry))
|
|
2969
|
+
}),
|
|
2970
|
+
allowlistIncluded.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2971
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
2972
|
+
children: props.t("reviewAllowlistNone")
|
|
2973
|
+
}) : null,
|
|
2974
|
+
allowlistAvailable.length === 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2975
|
+
className: ModelSwitchSettings_module_css_default.hint,
|
|
2976
|
+
children: props.t("reviewAllowlistAvailable")
|
|
2977
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
2978
|
+
className: ModelSwitchSettings_module_css_default.allowList,
|
|
2979
|
+
children: allowlistAvailable.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
2980
|
+
className: ModelSwitchSettings_module_css_default.allowRow,
|
|
2981
|
+
children: [
|
|
2982
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
2983
|
+
className: ModelSwitchSettings_module_css_default.allowLabel,
|
|
3096
2984
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
3097
2985
|
type: "checkbox",
|
|
3098
|
-
checked:
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
run("timeout", () => props.saveReviewTimeout(0));
|
|
3104
|
-
} else run("timeout", () => props.saveReviewTimeout(void 0));
|
|
3105
|
-
}
|
|
3106
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3107
|
-
className: ModelSwitchSettings_module_css_default.hint,
|
|
3108
|
-
children: props.t("reviewTimeoutCancelHint")
|
|
2986
|
+
checked: false,
|
|
2987
|
+
readOnly: true
|
|
2988
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
|
|
2989
|
+
className: ModelSwitchSettings_module_css_default.allowName,
|
|
2990
|
+
children: row.name
|
|
3109
2991
|
})]
|
|
3110
|
-
})
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
2992
|
+
}),
|
|
2993
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2994
|
+
className: ModelSwitchSettings_module_css_default.allowSource,
|
|
2995
|
+
children: [row.sourceLabel, row.repo === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2996
|
+
className: ModelSwitchSettings_module_css_default.allowDot,
|
|
2997
|
+
children: "·"
|
|
2998
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
|
|
2999
|
+
className: ModelSwitchSettings_module_css_default.allowRepo,
|
|
3000
|
+
href: row.repo,
|
|
3001
|
+
target: "_blank",
|
|
3002
|
+
rel: "noreferrer",
|
|
3003
|
+
children: props.t("reviewAllowlistRepo")
|
|
3004
|
+
})] })]
|
|
3005
|
+
}),
|
|
3006
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3007
|
+
type: "button",
|
|
3008
|
+
className: cx(ModelSwitchSettings_module_css_default.button, ModelSwitchSettings_module_css_default.secondaryButton),
|
|
3009
|
+
disabled: busy !== void 0 || !allowlistWritable,
|
|
3010
|
+
onClick: () => {
|
|
3011
|
+
setAllowTool(row.name, true);
|
|
3012
|
+
},
|
|
3013
|
+
children: props.t("reviewAllowlistAdd")
|
|
3014
|
+
})
|
|
3015
|
+
]
|
|
3016
|
+
}, row.name))
|
|
3017
|
+
})] }),
|
|
3018
|
+
catalogState === "failed" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
3019
|
+
className: cx(ModelSwitchSettings_module_css_default.hint, ModelSwitchSettings_module_css_default.message),
|
|
3020
|
+
children: props.t("reviewAllowlistScanFailed")
|
|
3021
|
+
}) : null
|
|
3022
|
+
]
|
|
3023
|
+
})]
|
|
3130
3024
|
}),
|
|
3131
3025
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
3132
3026
|
className: ModelSwitchSettings_module_css_default.group,
|
|
@@ -3533,16 +3427,6 @@ window.__ModuleLoader__.load({
|
|
|
3533
3427
|
reviewAllowlistAvailable: "本机存在但未放行的工具:",
|
|
3534
3428
|
reviewAllowlistRepo: "仓库",
|
|
3535
3429
|
reviewAllowlistSkipped: "本 Host 进程已为纯读调用跳过 {count} 次审查。",
|
|
3536
|
-
reviewTimeout: "审查超时",
|
|
3537
|
-
reviewTimeoutDefault: "跟随 Provider 默认(300 秒)",
|
|
3538
|
-
reviewTimeoutHelp: "设置自动审查请求的流式空闲超时。留空恢复 Provider 默认值;勾选「取消超时」写入上游上限(约 24.8 天),审查将不会因空闲而超时。保存后会立即重挂审查模型所在的 Provider 使其生效,重挂会中断该 Provider 的在途调用;重挂不了时回落到下次启动生效。",
|
|
3539
|
-
reviewTimeoutScope: "注意:该值写入审查模型所在 Provider 的 streamIdleTimeoutMs,对该 Provider 的所有调用(含主对话)生效,不只影响审查请求。",
|
|
3540
|
-
reviewTimeoutSeconds: "超时秒数",
|
|
3541
|
-
reviewTimeoutPlaceholder: "300(默认)",
|
|
3542
|
-
reviewTimeoutCancelLabel: "取消超时",
|
|
3543
|
-
reviewTimeoutCancelHint: "审查调用不再因空闲超时(写入约 24.8 天上限)",
|
|
3544
|
-
reviewTimeoutSave: "保存超时设置",
|
|
3545
|
-
reviewTimeoutCancelled: "已取消超时",
|
|
3546
3430
|
reviewAutomodeLinked: "Auto mode 已接入:审查路由 {route},直通 +{added} 个纯读工具({skipped} 条通配未同步)。",
|
|
3547
3431
|
reviewAutomodeRouteOwn: "沿用其自身配置",
|
|
3548
3432
|
reviewAutomodeRouteUnset: "未配置(沿用会话模型)",
|
|
@@ -3633,16 +3517,6 @@ window.__ModuleLoader__.load({
|
|
|
3633
3517
|
reviewAllowlistAvailable: "Present on this machine but not allowed:",
|
|
3634
3518
|
reviewAllowlistRepo: "repo",
|
|
3635
3519
|
reviewAllowlistSkipped: "This Host process has skipped the reviewer {count} times.",
|
|
3636
|
-
reviewTimeout: "Review timeout",
|
|
3637
|
-
reviewTimeoutDefault: "Follows Provider default (300 s)",
|
|
3638
|
-
reviewTimeoutHelp: "Set the streaming idle timeout for auto-review requests. Leave empty to restore the Provider default. Check \"Cancel timeout\" to write the upstream ceiling (~24.8 days) so reviews never time out on idle. Saving reloads the Provider hosting the reviewer model so the value applies at once; that reload drops the Provider’s in-flight calls. When the reload cannot run, the value applies at the next start.",
|
|
3639
|
-
reviewTimeoutScope: "Note: this value is written to the streamIdleTimeoutMs of the Provider hosting the reviewer model and applies to every call through that Provider (main chat included), not only review requests.",
|
|
3640
|
-
reviewTimeoutSeconds: "Timeout (seconds)",
|
|
3641
|
-
reviewTimeoutPlaceholder: "300 (default)",
|
|
3642
|
-
reviewTimeoutCancelLabel: "Cancel timeout",
|
|
3643
|
-
reviewTimeoutCancelHint: "Reviews never time out on idle (writes ~24.8-day ceiling)",
|
|
3644
|
-
reviewTimeoutSave: "Save timeout",
|
|
3645
|
-
reviewTimeoutCancelled: "Timeout cancelled",
|
|
3646
3520
|
reviewAutomodeLinked: "Auto mode linked: reviewer route {route}, passes +{added} read-only tools ({skipped} pattern entries not synced).",
|
|
3647
3521
|
reviewAutomodeRouteOwn: "its own settings",
|
|
3648
3522
|
reviewAutomodeRouteUnset: "unset (follows the session model)",
|
|
@@ -6398,16 +6272,6 @@ window.__ModuleLoader__.load({
|
|
|
6398
6272
|
value: [...tools]
|
|
6399
6273
|
}])) throw new Error("settings-rejected");
|
|
6400
6274
|
},
|
|
6401
|
-
saveReviewTimeout: async (value) => {
|
|
6402
|
-
if (!await owned.mutate([value === void 0 ? {
|
|
6403
|
-
op: "unset",
|
|
6404
|
-
path: ["autoReviewTimeoutMs"]
|
|
6405
|
-
} : {
|
|
6406
|
-
op: "set",
|
|
6407
|
-
path: ["autoReviewTimeoutMs"],
|
|
6408
|
-
value
|
|
6409
|
-
}])) throw new Error("settings-rejected");
|
|
6410
|
-
},
|
|
6411
6275
|
...connectionRpc === void 0 ? {} : { scanTools: async () => {
|
|
6412
6276
|
const response = await callPluginRpc(connectionRpc, "plugin-rpc/model-switch", "tools", {});
|
|
6413
6277
|
if (!response.ok || response.value === void 0) throw new Error(t("reviewAllowlistScanFailed"));
|
|
@@ -32,8 +32,6 @@ export interface ModelSwitchSettingsFace {
|
|
|
32
32
|
enabled: boolean;
|
|
33
33
|
tools: readonly string[];
|
|
34
34
|
}) => Promise<void>;
|
|
35
|
-
/** Persist the reviewer stream idle timeout; undefined restores provider default. */
|
|
36
|
-
saveReviewTimeout: (value: number | undefined) => Promise<void>;
|
|
37
35
|
/** The Host's live tool catalog; absent on a Host without the `tools` RPC endpoint. */
|
|
38
36
|
scanTools?: () => Promise<{
|
|
39
37
|
rows: readonly ToolCatalogRow[];
|
|
@@ -78,16 +78,6 @@ export declare const zh: {
|
|
|
78
78
|
readonly reviewAllowlistAvailable: "本机存在但未放行的工具:";
|
|
79
79
|
readonly reviewAllowlistRepo: "仓库";
|
|
80
80
|
readonly reviewAllowlistSkipped: "本 Host 进程已为纯读调用跳过 {count} 次审查。";
|
|
81
|
-
readonly reviewTimeout: "审查超时";
|
|
82
|
-
readonly reviewTimeoutDefault: "跟随 Provider 默认(300 秒)";
|
|
83
|
-
readonly reviewTimeoutHelp: "设置自动审查请求的流式空闲超时。留空恢复 Provider 默认值;勾选「取消超时」写入上游上限(约 24.8 天),审查将不会因空闲而超时。保存后会立即重挂审查模型所在的 Provider 使其生效,重挂会中断该 Provider 的在途调用;重挂不了时回落到下次启动生效。";
|
|
84
|
-
readonly reviewTimeoutScope: "注意:该值写入审查模型所在 Provider 的 streamIdleTimeoutMs,对该 Provider 的所有调用(含主对话)生效,不只影响审查请求。";
|
|
85
|
-
readonly reviewTimeoutSeconds: "超时秒数";
|
|
86
|
-
readonly reviewTimeoutPlaceholder: "300(默认)";
|
|
87
|
-
readonly reviewTimeoutCancelLabel: "取消超时";
|
|
88
|
-
readonly reviewTimeoutCancelHint: "审查调用不再因空闲超时(写入约 24.8 天上限)";
|
|
89
|
-
readonly reviewTimeoutSave: "保存超时设置";
|
|
90
|
-
readonly reviewTimeoutCancelled: "已取消超时";
|
|
91
81
|
readonly reviewAutomodeLinked: "Auto mode 已接入:审查路由 {route},直通 +{added} 个纯读工具({skipped} 条通配未同步)。";
|
|
92
82
|
readonly reviewAutomodeRouteOwn: "沿用其自身配置";
|
|
93
83
|
readonly reviewAutomodeRouteUnset: "未配置(沿用会话模型)";
|
|
@@ -16,11 +16,6 @@ export interface ModelSwitchSettingsView {
|
|
|
16
16
|
autoReviewSkipReadOnly?: boolean;
|
|
17
17
|
/** Exact tool names, or trailing-`*` patterns, that skip the reviewer when enabled. */
|
|
18
18
|
autoReviewAllowlist?: readonly string[];
|
|
19
|
-
/**
|
|
20
|
-
* Reviewer stream idle timeout in ms; `0` = cancelled (written as the upstream
|
|
21
|
-
* ceiling); absent = follow the provider default.
|
|
22
|
-
*/
|
|
23
|
-
autoReviewTimeoutMs?: number;
|
|
24
19
|
compactProvider?: string;
|
|
25
20
|
compactModel?: string;
|
|
26
21
|
titleProvider?: string;
|
|
@@ -67,12 +62,8 @@ export declare const AUTO_REVIEW_ALLOWLIST_FIELDS: Readonly<{
|
|
|
67
62
|
readonly enabled: "autoReviewSkipReadOnly";
|
|
68
63
|
readonly tools: "autoReviewAllowlist";
|
|
69
64
|
}>;
|
|
70
|
-
/** Auto-reviewer stream idle timeout: one stored value; absent keeps the provider default. */
|
|
71
|
-
export declare const AUTO_REVIEW_TIMEOUT_FIELD: "autoReviewTimeoutMs";
|
|
72
65
|
/** Upstream ceiling enforced by `@deepseek-ai/dsh-timeout` (MAX_TIMER_DELAY_MS). */
|
|
73
66
|
export declare const UPSTREAM_MAX_IDLE_TIMEOUT_MS = 2147483647;
|
|
74
|
-
/** Upstream default (300 s) when the provider profile leaves the field unset. */
|
|
75
|
-
export declare const UPSTREAM_DEFAULT_IDLE_TIMEOUT_MS = 300000;
|
|
76
67
|
/** One allowlist editor snapshot (switch + entries). */
|
|
77
68
|
export interface AutoReviewAllowlistView {
|
|
78
69
|
enabled: boolean;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Configurable Auto-reviewer stream idle timeout.
|
|
3
3
|
*
|
|
4
|
+
* @deprecated 2026-11-19 冻结:审查超时功能已移除,`model-switch-review-timeout`
|
|
5
|
+
* 行已从 `cordis.patch.yml` 移除,本模块不再被挂载。保留源码仅为可回退,下个大
|
|
6
|
+
* 版本删除;不再修 bug、不再适配新版本。
|
|
7
|
+
*
|
|
4
8
|
* The reviewer call is a normal llm stream, so its idle watchdog is the one
|
|
5
9
|
* `@deepseek-ai/dsh-llm-pi-ai` puts on the **provider profile**:
|
|
6
10
|
* `providers.<id>.streamIdleTimeoutMs` (default 300 000 ms). There is no
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-model-switch",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.67",
|
|
4
4
|
"description": "Explicit model routing plus composer/Plan picker for DeepSeek Harness",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"cordis.patch.yml",
|
|
79
79
|
"CHANGELOG.md",
|
|
80
80
|
"README.md",
|
|
81
|
-
"README.
|
|
81
|
+
"README.en.md",
|
|
82
82
|
"docs/screenshots/*.png",
|
|
83
83
|
"PRODUCT.md",
|
|
84
84
|
"IMPLEMENTATION_PLAN.md"
|