From 4dfcb22b1bbd11abc8cbc323e1b1a6e3feb83304 Mon Sep 17 00:00:00 2001 From: yexi Date: Wed, 18 Nov 2026 04:35:34 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=AE=BF=E4=B8=BB=E5=93=81=E7=89=8C=E6=A0=87=E8=AF=86=E5=AF=B9?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E8=B7=AF=E7=94=B1=20429=20=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E5=9C=BA=E6=99=AF=E7=9A=84=E8=AF=B4=E6=98=8E=EF=BC=88?= =?UTF-8?q?v0.2.13=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 8 ++++---- README.ja.md | 8 ++++---- README.md | 8 ++++---- docs/prompt-fusion.en.md | 2 +- docs/prompt-fusion.ja.md | 2 +- docs/prompt-fusion.md | 2 +- lib/client.js | 4 ++-- lib/client.js.map | 2 +- package.json | 2 +- src/client/locales.ts | 4 ++-- src/node.js | 2 +- tools/verify-live.mjs | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.en.md b/README.en.md index e218c29..5a74ee6 100644 --- a/README.en.md +++ b/README.en.md @@ -94,10 +94,10 @@ The toggle state is saved in the profile's `cordis.patch.yml` and takes effect o ```sh # Install on DSH Web -dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.13 # Install on DSH Desktop -dsh plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.13 ``` Restart `dsh web` or DSH Desktop after installing, then follow [Usage](#usage) to enable it. @@ -108,7 +108,7 @@ Use the update controls in DSH’s built-in plugin manager, or the CLI commands ```sh dsh plugin --profile web remove dsh-unrestricted -dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.13 ``` Restart `dsh web` or DSH Desktop. @@ -138,7 +138,7 @@ Make sure both switches are turned on after installation: The settings card also provides: -- **Strip Host Brand Identity**: An independent option that removes `DeepSeek Harness` / `DSH` identity sections and Web GUI checkout context from assembled prompts to reduce upstream proxy client-fingerprinting blocks. +- **Strip Host Brand Identity**: An independent option that removes `DeepSeek Harness` / `DSH` identity sections and Web GUI checkout context from assembled prompts, preventing HTTP `429` client-fingerprinting blocks on third-party routes (applicable to Google Antigravity reverse proxies, Google AI Studio PG channels, etc.). - **Mode Coverage & Prompt Preview**: Shows active status for Standard, PTC, Cordis, and Minimal modes, with expandable full-prompt preview and one-click copy. --- diff --git a/README.ja.md b/README.ja.md index 3788967..b0cac25 100644 --- a/README.ja.md +++ b/README.ja.md @@ -94,10 +94,10 @@ DSH のセクション名(`deployment:persona-prefix`、`plan:policy`、`tools ```sh # DSH Web へのインストール -dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.13 # DSH Desktop へのインストール -dsh plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.13 ``` インストール後に `dsh web` または DSH Desktop を再起動し、下記の[使い方](#使い方)に従って有効化します。 @@ -108,7 +108,7 @@ dsh plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.12 ```sh dsh plugin --profile web remove dsh-unrestricted -dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.13 ``` 更新後に `dsh web` または DSH Desktop を再起動します。 @@ -138,7 +138,7 @@ dsh plugin --profile web add file:D:/work/dsh/plugin/unrestricted 設定カードでは以下の項目も確認できます: -- **ホストブランド識別子の非表示**:破限スイッチとは独立して動作し、システムプロンプトおよび実行時コンテキストから `DeepSeek Harness` / `DSH` の識別セクションや Web GUI 開発パスを除去して、上流プロキシによるクライアント指紋判定を抑制します。 +- **ホストブランド識別子の非表示**:破限スイッチとは独立して動作し、システムプロンプトおよび実行時コンテキストから `DeepSeek Harness` / `DSH` の識別セクションや Web GUI 開発パスを除去して、サードパーティ経路(Google Antigravity リバースプロキシや Google AI Studio PG チャネルなど)でクライアント指紋検知により `429` が返されるのを防ぎます。 - **モード状態とプロンプトプレビュー**:Standard、PTC、Cordis、Minimal の 4 モードの状態表示、完全なシステムプロンプトの展開プレビューおよびワンクリックコピー。 --- diff --git a/README.md b/README.md index 50ba031..d81de77 100644 --- a/README.md +++ b/README.md @@ -94,10 +94,10 @@ DSH 发起请求时会先组装全局系统提示词(System Prompt)。在普 ```sh # Web 端安装指定版本 -dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.13 # 桌面端安装指定版本(使用桌面端内置 CLI) -& "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.12 +& "$env:LOCALAPPDATA\Programs\DeepSeek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add github:yexi-by/dsh-unrestricted#v0.2.13 ``` 安装后重启 `dsh web` 或 DSH 桌面端,按下方[使用说明](#使用说明)启用。 @@ -108,7 +108,7 @@ dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.12 ```sh dsh plugin --profile web remove dsh-unrestricted -dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.12 +dsh plugin --profile web add github:yexi-by/dsh-unrestricted#v0.2.13 ``` 更新后重启 `dsh web` 或 DSH 桌面端。 @@ -138,7 +138,7 @@ dsh plugin --profile web add file:D:/work/dsh/plugin/unrestricted 设置卡片中同时提供: -- **隐藏宿主品牌标识**:独立于破限主开关的去指纹选项,开启后自动移除系统提示词与运行时上下文中的 `DeepSeek Harness` / `DSH` 身份段落及开发界面路径,减少上游反代触发客户端特征检测。 +- **隐藏宿主品牌标识**:独立于破限主开关的去指纹选项,开启后自动移除系统提示词与运行时上下文中的 `DeepSeek Harness` / `DSH` 身份段落及开发界面路径,避免第三方路由(适用于 Google Antigravity 反重力反代、Google AI Studio PG 渠道等)因客户端特征检测而返回 `429` 拦截。 - **模式覆盖与提示词预览**:显示 Standard、PTC、Cordis、Minimal 四种模式的生效状态,支持展开查看或一键复制各模式最终生成的完整系统提示词。 --- diff --git a/docs/prompt-fusion.en.md b/docs/prompt-fusion.en.md index 6f64463..874e8fb 100644 --- a/docs/prompt-fusion.en.md +++ b/docs/prompt-fusion.en.md @@ -72,7 +72,7 @@ Each DSH preset structures its prompt sections differently: During assembly, the plugin locates and fuses prompt sections by DSH's canonical section names (`deployment:persona-prefix`, `plan:policy`, `tools:ptc-only`, `tool:structured_output`) with idempotency guards, supporting both DSH Web and DSH Desktop without brittle exact-string or hash checks. Additional preset ids can be opted in via `extraPresets`; if a preset omits the persona section, it safely falls back to the stock prompt. ### Host Brand Identity Stripping (Optional) -When **Strip host brand identity** (`stripHostIdentity`) is enabled, the pipeline drops `harness:identity`, `harness:source`, and `app:web-surface` sections plus matching runtime contexts, and neutralizes residual `DeepSeek Harness` / `DSH` brand strings in retained sections (works independently of the main toggle). +When **Strip host brand identity** (`stripHostIdentity`) is enabled, the pipeline drops `harness:identity`, `harness:source`, and `app:web-surface` sections plus matching runtime contexts, and neutralizes residual `DeepSeek Harness` / `DSH` brand strings in retained sections (works independently of the main toggle; useful for avoiding HTTP `429` client-fingerprinting blocks on third-party routes such as Google Antigravity reverse proxies and Google AI Studio PG channels). ### Prompt preview The settings UI queries an RPC endpoint to assemble live baseline previews of the full system prompt, line count, and byte size for each mode (reflecting the strip-identity toggle). Version checks and installation use DSH’s built-in plugin manager. diff --git a/docs/prompt-fusion.ja.md b/docs/prompt-fusion.ja.md index d8fe61e..4193199 100644 --- a/docs/prompt-fusion.ja.md +++ b/docs/prompt-fusion.ja.md @@ -72,7 +72,7 @@ DSH の各実行モードに応じてプロンプトセクションを処理し 組み立て時には DSH の標準セクション名(`deployment:persona-prefix`、`plan:policy`、`tools:ptc-only`、`tool:structured_output`)に基づいて冪等に融合を行うため、文面のハッシュ照合に依存せず DSH Web と DSH Desktop の双方で安定して動作します。`extraPresets` 設定で追加のプリセット名にも対応し、ペルソナセクションがない場合は自動的に標準プロンプトへフォールバックします。 ### ホストブランド識別子の除去(オプション) -**ホストブランド識別子の非表示**(`stripHostIdentity`)を有効にすると、`harness:identity`・`harness:source`・`app:web-surface` セクションおよび対応する実行時コンテキストを除去し、残存セクション内の `DeepSeek Harness` / `DSH` 表記を中立的な表現へ置換します(メインスイッチとは独立して動作します)。 +**ホストブランド識別子の非表示**(`stripHostIdentity`)を有効にすると、`harness:identity`・`harness:source`・`app:web-surface` セクションおよび対応する実行時コンテキストを除去し、残存セクション内の `DeepSeek Harness` / `DSH` 表記を中立的な表現へ置換します(メインスイッチとは独立して動作し、Google Antigravity リバースプロキシや Google AI Studio PG チャネルなどのサードパーティ経路における `429` クライアント検知の回避に適しています)。 ### プロンプトプレビュー 設定画面から RPC エンドポイントを通じて各モードのシステムプロンプト全文、総行数、サイズを基準スコープから都度プレビューできます(識別子除去スイッチも反映されます)。バージョン確認とインストールには DSH 標準のプラグイン管理画面を使用します。 diff --git a/docs/prompt-fusion.md b/docs/prompt-fusion.md index 3d12e7e..f7c732d 100644 --- a/docs/prompt-fusion.md +++ b/docs/prompt-fusion.md @@ -72,7 +72,7 @@ DSH 不同运行模式下的提示词分块结构不同,插件分别处理如 每次组装时,插件按 DSH 官方系统提示词的结构化段落名称(`deployment:persona-prefix`、`plan:policy`、`tools:ptc-only`、`tool:structured_output`)进行定位与幂等融合,不依赖脆弱的逐字文本比对或哈希校验,同时兼容 DSH Web 与 DSH 桌面端。可通过 `extraPresets` 配置扩展预设名称支持动态按结构融合;若目标预设不包含角色设定段落,则自动保留官方原版提示词并在设置界面提示。 ### 宿主品牌标识剥离(可选) -启用「隐藏宿主品牌标识(`stripHostIdentity`)」后,流水线会移除 `harness:identity`、`harness:source`、`app:web-surface` 分块以及对应运行时上下文,并将残留分块中的 `DeepSeek Harness`、`DSH` 等宿主品牌字眼替换为中性表述(可独立于破限主开关生效)。 +启用「隐藏宿主品牌标识(`stripHostIdentity`)」后,流水线会移除 `harness:identity`、`harness:source`、`app:web-surface` 分块以及对应运行时上下文,并将残留分块中的 `DeepSeek Harness`、`DSH` 等宿主品牌字眼替换为中性表述(可独立于破限主开关生效,适用于避免 Google Antigravity 反重力反代、Google AI Studio PG 渠道等第三方路由触发客户端指纹检测返回 `429`)。 ### 提示词预览 前端设置卡片通过 RPC 接口实时按基准作用域生成各运行模式组装后的完整系统提示词、总行数与体积预览(并同步反映去标识开关状态)。版本检查和安装统一使用 DSH 原生插件管理页。 diff --git a/lib/client.js b/lib/client.js index d0040c9..a474d23 100644 --- a/lib/client.js +++ b/lib/client.js @@ -202,7 +202,7 @@ window.__ModuleLoader__.load({ toggle: "启用破限模式", stripHostBadge: "已隐去宿主标识", stripHostTitle: "隐藏宿主品牌标识", - stripHostDesc: "移除系统提示词与运行时上下文中的 DeepSeek Harness / DSH 身份段落及开发界面路径,降低上游反代客户端指纹拦截概率(可独立于破限开关生效)。", + stripHostDesc: "移除系统提示词与运行时上下文中的 DeepSeek Harness / DSH 身份段落及开发界面路径,避免第三方路由(适用于 Google Antigravity 反重力反代、Google AI Studio PG 渠道等)因检测到客户端特征而返回 429 拦截(可独立于破限开关生效)。", scopeNote: "仅作用于由 DSH 组装的系统提示词;模型平台或外部网关的远端策略不在本插件覆盖范围内。", statusTitle: "模式覆盖与提示词预览", statusSubtitle: "覆盖全部 4 种预设及委派子代理,可随时展开核对或复制融合后的完整提示词。", @@ -253,7 +253,7 @@ window.__ModuleLoader__.load({ 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).", + stripHostDesc: "Remove DeepSeek Harness / DSH identity sections and Web GUI checkout context from assembled prompts to prevent HTTP 429 client-fingerprinting blocks on third-party routes such as Google Antigravity proxies and Google AI Studio PG channels (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.", diff --git a/lib/client.js.map b/lib/client.js.map index a99d211..0fcdfb3 100644 --- a/lib/client.js.map +++ b/lib/client.js.map @@ -1 +1 @@ -{"version":3,"file":"client.js","names":["useState","writeClipboard","Tag","Switch","Button","StateDot","fileSizeText"],"sources":["../src/client/controller.ts","../src/client/locales.ts","../src/client/styles.ts","../src/client/UnrestrictedCard.tsx","../src/client/index.tsx"],"sourcesContent":["/**\n * Browser-half controller for the unrestricted card: binds the `unrestricted`\n * settings namespace (the toggle) and reads per-preset state and previews.\n */\nimport type { Context } from '@deepseek-ai/cordis'\nimport type { ConnectionHandle } from '@deepseek-ai/dsh-client-connection/client'\n// Type-only: the ctx.remote Context merge and the forwarded-event key face.\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\n// Type-only: the ctx.configForms Context merge.\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n\n/** The toggle section stored in the `unrestricted` settings namespace. */\nexport interface UnrestrictedSettings {\n enabled?: boolean\n stripHostIdentity?: boolean\n}\n\n/** Per-preset fusion state reported by the host half. */\nexport interface UnrestrictedModeState {\n state: 'off' | 'active' | 'failed'\n issues: string[]\n}\n\n/** Host status endpoint payload. */\nexport interface UnrestrictedStatus {\n enabled: boolean\n stripHostIdentity?: boolean\n /** Current plugin version reported by the host half. */\n version?: string\n modes: Record\n}\n\n/** Deploy preview for one preset: what switching on would actually assemble. */\nexport interface UnrestrictedPreview {\n presetId: string\n available: boolean\n /** `live` = bytes a live agent received; `standing` = preset scope, no agent bound. */\n source?: 'live' | 'standing'\n /** Fused prompt text; present when available. */\n text?: string\n bytes?: number\n lines?: number\n /** Structured error code when unavailable. */\n errorCode?: string\n /** Diagnostic reason when unavailable. */\n reason?: string\n}\n\n/** One fetched preview, keyed by preset, plus its in-flight/error state. */\nexport interface UnrestrictedPreviewEntry {\n status: 'loading' | 'ready' | 'failed'\n preview?: UnrestrictedPreview\n errorCode?: string\n message?: string\n}\n\n/** Full view snapshot the card subscribes to. */\nexport interface UnrestrictedViewSnapshot {\n /** Persisted toggle; false until the settings scope first syncs. */\n enabled: boolean\n /** Persisted host-brand stripping toggle; false until synced. */\n stripHostIdentity: boolean\n /** Whether the Host document accepts writes. */\n writable: boolean\n /** Settings scope sync state. */\n settingsStatus: 'loading' | 'ready' | 'unavailable'\n /** Live host status; null until the first RPC answer. */\n status: UnrestrictedStatus | null\n /** presetId -> fetched deploy preview. */\n previews: Record\n /** Whether a settings write or status refresh is in flight. */\n busy: boolean\n /** Last transport/business failure, if any. */\n message?: string\n}\n\n/** Minimal RPC wire shape (structural copy of the host RpcResult). */\ntype RpcResult = { ok: true; value: T } | { ok: false; error: { code: string; message: string } }\n\n/** Minimal observable contract consumed by the slot renderer's hook binding. */\nexport interface UnrestrictedViewSource {\n getSnapshot(): UnrestrictedViewSnapshot\n subscribe(listener: () => void): () => void\n}\n\n/** Inject face handed to the card at registration. */\nexport interface UnrestrictedCardInjected {\n hooks: {\n /** Reactive card view. */\n view: UnrestrictedViewSource\n }\n /** Persist the toggle. */\n setEnabled: (enabled: boolean) => Promise\n /** Persist whether host identity branding is stripped from prompts. */\n setStripHostIdentity: (strip: boolean) => Promise\n /** Re-validate runtime state and refresh. */\n recheck: () => Promise\n /** Re-read host status and invalidate cached previews. */\n refresh: () => Promise\n /** Fetch the exact fused prompt this preset would deploy. */\n loadPreview: (presetId: string) => Promise\n}\n\nconst RPC_CHANNEL = '/api'\nconst RPC_NAMESPACE = 'dsh-unrestricted'\nconst SETTINGS_NS = 'unrestricted'\n\n/** Human-readable error text for the banner. */\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\n/**\n * Create the card controller bound to the calling plugin's context.\n * @param ctx - the browser plugin context (connection + remote + configForms injected).\n * @returns the controller whose face() feeds the slot inject share.\n */\nexport function createUnrestrictedController(ctx: Context) {\n const connection = ctx.get('connection') as ConnectionHandle\n const settings = ctx.configForms.get(SETTINGS_NS)\n\n let snapshot: UnrestrictedViewSnapshot = {\n enabled: false,\n stripHostIdentity: false,\n writable: false,\n settingsStatus: 'loading',\n status: null,\n previews: {},\n busy: false,\n }\n const listeners = new Set<() => void>()\n const previewRequests = new Map()\n let statusGeneration = 0\n let pendingOperations = 0\n\n const view: UnrestrictedViewSource = {\n getSnapshot: () => snapshot,\n subscribe: (listener) => {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n }\n\n function publish(): void {\n const settingsSnapshot = settings.getSnapshot()\n const enabled = settingsSnapshot.value?.enabled === true\n const stripHostIdentity = settingsSnapshot.value?.stripHostIdentity === true\n if (enabled !== snapshot.enabled || stripHostIdentity !== snapshot.stripHostIdentity) {\n invalidatePreviews()\n }\n snapshot = {\n enabled,\n stripHostIdentity,\n writable: settingsSnapshot.writable,\n settingsStatus: settingsSnapshot.status,\n status: snapshot.status,\n previews: snapshot.previews,\n busy: pendingOperations > 0,\n message: snapshot.message,\n }\n for (const listener of listeners) listener()\n }\n\n function invalidatePreviews(): void {\n previewRequests.clear()\n snapshot = { ...snapshot, previews: {} }\n }\n\n async function call(endpoint: string, payload: unknown): Promise {\n const result = await connection.rpc.call(\n RPC_CHANNEL,\n `${RPC_NAMESPACE}/${endpoint}`,\n payload,\n ) as RpcResult\n if (!result.ok) throw new Error(result.error.message)\n return result.value\n }\n\n async function whileBusy(action: () => Promise): Promise {\n pendingOperations++\n publish()\n try {\n await action()\n } finally {\n pendingOperations--\n publish()\n }\n }\n\n function readStatus(endpoint: 'status' | 'recheck', clearPreviews: boolean): Promise {\n const generation = ++statusGeneration\n return whileBusy(async () => {\n try {\n const status = await call(endpoint, {})\n if (generation !== statusGeneration) return\n if (clearPreviews) invalidatePreviews()\n snapshot = {\n ...snapshot,\n status,\n message: undefined,\n }\n } catch (error) {\n if (generation !== statusGeneration) return\n snapshot = { ...snapshot, message: messageOf(error) }\n }\n })\n }\n\n function refresh(clearPreviews = false): Promise {\n return readStatus('status', clearPreviews)\n }\n\n function updateSetting(\n field: K,\n value: NonNullable,\n ): Promise {\n return whileBusy(async () => {\n try {\n await settings.set(field, value)\n await refresh(true)\n } catch (error) {\n snapshot = { ...snapshot, message: messageOf(error) }\n }\n })\n }\n\n function setEnabled(enabled: boolean): Promise {\n return updateSetting('enabled', enabled)\n }\n\n function setStripHostIdentity(strip: boolean): Promise {\n return updateSetting('stripHostIdentity', strip)\n }\n\n function recheck(): Promise {\n return readStatus('recheck', true)\n }\n\n /**\n * Fetch one preset's deploy preview.\n * @param presetId - preset id from the card's row.\n */\n async function loadPreview(presetId: string): Promise {\n const request = Symbol(presetId)\n previewRequests.set(presetId, request)\n snapshot = {\n ...snapshot,\n previews: { ...snapshot.previews, [presetId]: { status: 'loading' } },\n }\n publish()\n try {\n const preview = await call('preview', { presetId })\n if (previewRequests.get(presetId) !== request) return\n snapshot = {\n ...snapshot,\n previews: { ...snapshot.previews, [presetId]: { status: 'ready', preview } },\n }\n } catch (error) {\n if (previewRequests.get(presetId) !== request) return\n snapshot = {\n ...snapshot,\n previews: {\n ...snapshot.previews,\n [presetId]: {\n status: 'failed',\n errorCode: 'preview-failed',\n message: messageOf(error),\n },\n },\n }\n }\n publish()\n }\n\n ctx.effect(\n () => settings.subscribe(publish),\n 'dsh-unrestricted: settings mirror',\n )\n ctx.effect(\n () => ctx.remote.$on('settings/document-updated', (namespace?: string) => {\n if (namespace === undefined || namespace === SETTINGS_NS) void refresh(true)\n }),\n 'dsh-unrestricted: settings invalidations',\n )\n\n publish()\n void refresh()\n return {\n face: (): UnrestrictedCardInjected => ({\n hooks: { view },\n setEnabled,\n setStripHostIdentity,\n recheck,\n refresh: () => refresh(true),\n loadPreview,\n }),\n }\n}\n","/** Copy dictionaries for the unrestricted settings card and detail badge. */\n\n/** Simplified Chinese dictionary and key source of truth. */\nexport const zh = {\n title: '破限模式',\n summaryEnabled: '已开启',\n summaryDisabled: '已关闭',\n summaryLoading: '读取中',\n summaryUnavailable: '只读模式',\n summaryValidationFailed: '部分模式未生效',\n description: '开启后,各运行模式与委派子代理的系统提示词将自动融合无限制本地执行契约;关闭即恢复 DSH 原版提示词。切换从下一次请求生效,不改动正在执行的请求、工具定义、权限配置与会话历史。',\n toggle: '启用破限模式',\n stripHostBadge: '已隐去宿主标识',\n stripHostTitle: '隐藏宿主品牌标识',\n stripHostDesc: '移除系统提示词与运行时上下文中的 DeepSeek Harness / DSH 身份段落及开发界面路径,降低上游反代客户端指纹拦截概率(可独立于破限开关生效)。',\n scopeNote: '仅作用于由 DSH 组装的系统提示词;模型平台或外部网关的远端策略不在本插件覆盖范围内。',\n statusTitle: '模式覆盖与提示词预览',\n statusSubtitle: '覆盖全部 4 种预设及委派子代理,可随时展开核对或复制融合后的完整提示词。',\n modeStandard: 'Standard 标准模式',\n modeStandardDesc: '日常编码、逆向分析、脚本编写与综合问答',\n modePtc: 'PTC 编程模式',\n modePtcDesc: '基于 run_code 工具链的程序化任务执行',\n modeCordis: 'Cordis 创造模式',\n modeCordisDesc: 'DSH 与 Cordis 插件生态开发调试',\n modeMinimal: 'Minimal 极简模式',\n modeMinimalDesc: '零内置先验的纯净系统提示词与子代理基座',\n subagentNote: '子代理(含结构化输出子代理)随所属会话模式一并生效。',\n stateActive: '已生效',\n stateOff: '待命',\n stateValidationFailed: '已跳过(缺少角色段落)',\n refresh: '刷新状态',\n presetStandard: 'standard',\n presetPtc: 'ptc',\n presetCordis: 'cordis',\n presetMinimal: 'minimal',\n showPreview: '查看提示词',\n hidePreview: '收起预览',\n copyPreview: '复制全文',\n copiedPreview: '已复制',\n previewLoading: '正在生成当前模式的提示词预览…',\n previewUnavailable: '暂无法生成预览:',\n previewSize: '行',\n previewSourceLive: '当前会话实时组装',\n previewSourceStanding: '预设基准组装',\n settingsUnavailable: '当前连接处于只读模式,无法修改设置。',\n settingsLoading: '正在读取配置…',\n operationFailed: '操作失败:',\n issuePersona: '未检测到预设角色前缀段落,已自动保留原版提示词',\n errorRpcDisconnected: '无法连接宿主服务,请确认 DSH 正在运行后刷新重试。',\n errorUnsupportedPreset: '不支持该预设模式的提示词预览。',\n errorMissingPersona: '当前预设未包含角色前缀段落,已自动保留原版提示词。',\n errorPreviewFailed: '生成提示词预览失败,请稍后刷新重试。',\n} satisfies Record\n\n/** Unrestricted card locale key union. */\nexport type UnrestrictedLocaleKey = keyof typeof zh\n\n/** English dictionary checked against the Chinese key set. */\nexport const en = {\n title: 'Unrestricted Mode',\n summaryEnabled: 'Enabled',\n summaryDisabled: 'Disabled',\n summaryLoading: 'Loading',\n summaryUnavailable: 'Read-only',\n summaryValidationFailed: 'Partial mode coverage',\n 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.',\n toggle: 'Enable unrestricted mode',\n stripHostBadge: 'Host identity stripped',\n stripHostTitle: 'Strip host brand identity',\n 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).',\n scopeNote: 'Applies only to system prompts assembled by DSH; upstream model provider policies outside the prompt are out of scope.',\n statusTitle: 'Mode Coverage & Prompt Preview',\n statusSubtitle: 'Covers all 4 built-in presets and delegated subagents. Expand any mode to inspect or copy the full fused prompt.',\n modeStandard: 'Standard',\n modeStandardDesc: 'General coding, reverse engineering, scripting, and technical Q&A',\n modePtc: 'PTC Mode',\n modePtcDesc: 'Programmatic tool calling via the run_code execution environment',\n modeCordis: 'Cordis Mode',\n modeCordisDesc: 'DSH and Cordis plugin development and framework debugging',\n modeMinimal: 'Minimal Mode',\n modeMinimalDesc: 'Zero-prior minimal system prompt and subagent foundation',\n subagentNote: 'Subagents (including structured-output subagents) automatically follow their parent mode.',\n stateActive: 'Active',\n stateOff: 'Standby',\n stateValidationFailed: 'Skipped (missing persona section)',\n refresh: 'Refresh',\n presetStandard: 'standard',\n presetPtc: 'ptc',\n presetCordis: 'cordis',\n presetMinimal: 'minimal',\n showPreview: 'Preview prompt',\n hidePreview: 'Hide preview',\n copyPreview: 'Copy prompt',\n copiedPreview: 'Copied',\n previewLoading: 'Assembling prompt preview…',\n previewUnavailable: 'Preview unavailable: ',\n previewSize: 'lines',\n previewSourceLive: 'Live session assembly',\n previewSourceStanding: 'Preset baseline assembly',\n settingsUnavailable: 'This connection is read-only and cannot modify settings.',\n settingsLoading: 'Loading configuration…',\n operationFailed: 'Operation failed: ',\n issuePersona: 'Preset persona section not found — stock prompt kept',\n errorRpcDisconnected: 'Cannot reach the host service. Please verify DSH is running and refresh.',\n errorUnsupportedPreset: 'Prompt preview is not supported for this preset.',\n errorMissingPersona: 'The preset is missing a persona prefix section; the stock prompt is kept.',\n errorPreviewFailed: 'Could not assemble the prompt preview. Please try refreshing.',\n} satisfies Record\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'settings.unrestricted'\n","/**\n * Stylesheet for the unrestricted settings card. Injected once as a single\n *