mirror of
https://github.com/yexi-by/dsh-unrestricted.git
synced 2026-11-28 02:30:22 +08:00
feat: 新增隐藏宿主品牌标识开关,精简破限提示词并移除实时预览污染(v0.2.12)
This commit is contained in:
1 parent
849fc35ac5
commit
6da4c81b5e
18 files changed
+421
-111
No files matched your search
+71
-11
@@ -25,6 +25,7 @@ window.__ModuleLoader__.load({
|
||||
const settings = ctx.configForms.get(SETTINGS_NS);
|
||||
let snapshot = {
|
||||
enabled: false,
|
||||
stripHostIdentity: false,
|
||||
writable: false,
|
||||
settingsStatus: "loading",
|
||||
status: null,
|
||||
@@ -45,9 +46,11 @@ window.__ModuleLoader__.load({
|
||||
function publish() {
|
||||
const settingsSnapshot = settings.getSnapshot();
|
||||
const enabled = settingsSnapshot.value?.enabled === true;
|
||||
if (enabled !== snapshot.enabled) invalidatePreviews();
|
||||
const stripHostIdentity = settingsSnapshot.value?.stripHostIdentity === true;
|
||||
if (enabled !== snapshot.enabled || stripHostIdentity !== snapshot.stripHostIdentity) invalidatePreviews();
|
||||
snapshot = {
|
||||
enabled,
|
||||
stripHostIdentity,
|
||||
writable: settingsSnapshot.writable,
|
||||
settingsStatus: settingsSnapshot.status,
|
||||
status: snapshot.status,
|
||||
@@ -103,10 +106,10 @@ window.__ModuleLoader__.load({
|
||||
function refresh(clearPreviews = false) {
|
||||
return readStatus("status", clearPreviews);
|
||||
}
|
||||
function setEnabled(enabled) {
|
||||
function updateSetting(field, value) {
|
||||
return whileBusy(async () => {
|
||||
try {
|
||||
await settings.set("enabled", enabled);
|
||||
await settings.set(field, value);
|
||||
await refresh(true);
|
||||
} catch (error) {
|
||||
snapshot = {
|
||||
@@ -116,6 +119,12 @@ window.__ModuleLoader__.load({
|
||||
}
|
||||
});
|
||||
}
|
||||
function setEnabled(enabled) {
|
||||
return updateSetting("enabled", enabled);
|
||||
}
|
||||
function setStripHostIdentity(strip) {
|
||||
return updateSetting("stripHostIdentity", strip);
|
||||
}
|
||||
function recheck() {
|
||||
return readStatus("recheck", true);
|
||||
}
|
||||
@@ -172,6 +181,7 @@ window.__ModuleLoader__.load({
|
||||
return { face: () => ({
|
||||
hooks: { view },
|
||||
setEnabled,
|
||||
setStripHostIdentity,
|
||||
recheck,
|
||||
refresh: () => refresh(true),
|
||||
loadPreview
|
||||
@@ -190,6 +200,9 @@ window.__ModuleLoader__.load({
|
||||
summaryValidationFailed: "部分模式未生效",
|
||||
description: "开启后,各运行模式与委派子代理的系统提示词将自动融合无限制本地执行契约;关闭即恢复 DSH 原版提示词。切换从下一次请求生效,不改动正在执行的请求、工具定义、权限配置与会话历史。",
|
||||
toggle: "启用破限模式",
|
||||
stripHostBadge: "已隐去宿主标识",
|
||||
stripHostTitle: "隐藏宿主品牌标识",
|
||||
stripHostDesc: "移除系统提示词与运行时上下文中的 DeepSeek Harness / DSH 身份段落及开发界面路径,降低上游反代客户端指纹拦截概率(可独立于破限开关生效)。",
|
||||
scopeNote: "仅作用于由 DSH 组装的系统提示词;模型平台或外部网关的远端策略不在本插件覆盖范围内。",
|
||||
statusTitle: "模式覆盖与提示词预览",
|
||||
statusSubtitle: "覆盖全部 4 种预设及委派子代理,可随时展开核对或复制融合后的完整提示词。",
|
||||
@@ -238,6 +251,9 @@ window.__ModuleLoader__.load({
|
||||
summaryValidationFailed: "Partial mode coverage",
|
||||
description: "When enabled, system prompts across all modes and delegated subagents are fused with the unrestricted local execution contract; disabling restores the stock DSH prompt immediately. Takes effect from the next request without altering in-flight turns, tool schemas, permissions, or session history.",
|
||||
toggle: "Enable unrestricted mode",
|
||||
stripHostBadge: "Host identity stripped",
|
||||
stripHostTitle: "Strip host brand identity",
|
||||
stripHostDesc: "Remove DeepSeek Harness / DSH identity sections and Web GUI checkout context from assembled prompts to reduce upstream proxy client-fingerprinting blocks (works independently of the main toggle).",
|
||||
scopeNote: "Applies only to system prompts assembled by DSH; upstream model provider policies outside the prompt are out of scope.",
|
||||
statusTitle: "Mode Coverage & Prompt Preview",
|
||||
statusSubtitle: "Covers all 4 built-in presets and delegated subagents. Expand any mode to inspect or copy the full fused prompt.",
|
||||
@@ -368,6 +384,23 @@ window.__ModuleLoader__.load({
|
||||
color: var(--dsw-alias-label-tertiary);
|
||||
}
|
||||
|
||||
.dsh-unrestricted-optionRow {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px 16px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid var(--dsw-alias-border-l3, var(--dsw-alias-border-l2));
|
||||
}
|
||||
|
||||
.dsh-unrestricted-optionCopy {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.dsh-unrestricted-banner {
|
||||
margin: 0;
|
||||
border: 1px solid var(--dsw-alias-border-l2);
|
||||
@@ -672,14 +705,21 @@ window.__ModuleLoader__.load({
|
||||
className: "dsh-unrestricted-header",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "dsh-unrestricted-headerTitle",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
||||
id: "dsh-unrestricted-main-title",
|
||||
className: "dsh-unrestricted-title",
|
||||
children: t("title")
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
||||
tone: summaryTone,
|
||||
children: t(summaryKey)
|
||||
})]
|
||||
children: [
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
||||
id: "dsh-unrestricted-main-title",
|
||||
className: "dsh-unrestricted-title",
|
||||
children: t("title")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
||||
tone: summaryTone,
|
||||
children: t(summaryKey)
|
||||
}),
|
||||
view.settingsStatus === "ready" && view.stripHostIdentity && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
||||
tone: "outline",
|
||||
children: t("stripHostBadge")
|
||||
})
|
||||
]
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "dsh-unrestricted-headerControls",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
@@ -703,6 +743,26 @@ window.__ModuleLoader__.load({
|
||||
className: "dsh-unrestricted-note",
|
||||
children: t("scopeNote")
|
||||
}),
|
||||
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "dsh-unrestricted-optionRow",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
||||
className: "dsh-unrestricted-optionCopy",
|
||||
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
||||
className: "dsh-unrestricted-modeName",
|
||||
children: t("stripHostTitle")
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "dsh-unrestricted-note",
|
||||
children: t("stripHostDesc")
|
||||
})]
|
||||
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
||||
checked: view.stripHostIdentity,
|
||||
disabled: !view.writable || view.settingsStatus !== "ready" || view.busy,
|
||||
label: t("stripHostTitle"),
|
||||
onChange: (checked) => {
|
||||
props.setStripHostIdentity(checked);
|
||||
}
|
||||
})]
|
||||
}),
|
||||
view.settingsStatus === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
||||
className: "dsh-unrestricted-note",
|
||||
role: "status",
|
||||
|
||||
Reference in new issue
Block a user