dsh-thinking-levels 3.2.0 → 3.3.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.
- package/lib/client.js +108 -13
- package/lib/client.js.map +1 -1
- package/package.json +3 -2
package/lib/client.js
CHANGED
|
@@ -865,8 +865,8 @@ window.__ModuleLoader__.load({
|
|
|
865
865
|
* Thinking-levels settings card — the family settings tab face of the
|
|
866
866
|
* dsh-thinking-levels plugin.
|
|
867
867
|
*
|
|
868
|
-
* The card binds
|
|
869
|
-
*
|
|
868
|
+
* The card binds this plugin's entry config through the `configForms` cordis
|
|
869
|
+
* service and renders its fields: the level picker
|
|
870
870
|
* (off / on / minimal / low / medium / high / xhigh / max / auto) plus the
|
|
871
871
|
* scheduler toggles. Every change commits immediately through the scope (no
|
|
872
872
|
* staged form): the decision is read per model request, so a committed change
|
|
@@ -2023,14 +2023,79 @@ window.__ModuleLoader__.load({
|
|
|
2023
2023
|
}
|
|
2024
2024
|
//#endregion
|
|
2025
2025
|
//#region src/client/family-tab.tsx
|
|
2026
|
-
|
|
2027
|
-
|
|
2026
|
+
/**
|
|
2027
|
+
* FamilySettingsSection — the top-level 「起子插件设置」 settings section.
|
|
2028
|
+
*
|
|
2029
|
+
* One `settings.section` nav entry (registered by this plugin) whose entry
|
|
2030
|
+
* declares the `dsh-family.tab` child slot; sibling plugins (session-guard
|
|
2031
|
+
* first) contribute their cards there via `ctx.slots.inject('dsh-family.tab',
|
|
2032
|
+
* …)`. The section renders the family's own thinking-levels card as the first
|
|
2033
|
+
* tab and every contributor as a following tab — the same tabs-around-pages
|
|
2034
|
+
* pattern the built-in Plugins section uses (ui-settings-plugins): the tab
|
|
2035
|
+
* ledger is a HostObservable projected from the child-slot registry, and the
|
|
2036
|
+
* active tab mounts through `renderSlot(key, {}, { only: id })`.
|
|
2037
|
+
*
|
|
2038
|
+
* When this section is absent the whole family surface is absent; a
|
|
2039
|
+
* contributor's inject simply idles (an undischarged wait never blocks the
|
|
2040
|
+
* client half), so plugins stay fully functional without their card.
|
|
2041
|
+
*/
|
|
2042
|
+
/** This plugin's own tab, always first: the thinking-levels card itself. */
|
|
2043
|
+
const OWN_TAB_ID = "thinking-levels";
|
|
2044
|
+
function FamilySettingsSection(props) {
|
|
2045
|
+
const { t, renderSlot, scope, piAiScope } = props;
|
|
2046
|
+
const { useTabs } = props;
|
|
2047
|
+
const contributors = useTabs((value) => value);
|
|
2048
|
+
const [activeId, setActiveId] = (0, react.useState)(OWN_TAB_ID);
|
|
2049
|
+
const rows = [{
|
|
2050
|
+
id: OWN_TAB_ID,
|
|
2051
|
+
order: Number.NEGATIVE_INFINITY,
|
|
2052
|
+
label: t("card.title")
|
|
2053
|
+
}, ...contributors];
|
|
2054
|
+
const active = rows.some((row) => row.id === activeId) ? activeId : OWN_TAB_ID;
|
|
2028
2055
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2029
2056
|
style: {
|
|
2030
2057
|
display: "grid",
|
|
2031
|
-
gap: "
|
|
2058
|
+
gap: "12px"
|
|
2032
2059
|
},
|
|
2033
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2060
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2061
|
+
role: "tablist",
|
|
2062
|
+
"aria-label": t("family.title"),
|
|
2063
|
+
style: {
|
|
2064
|
+
display: "flex",
|
|
2065
|
+
flexWrap: "wrap",
|
|
2066
|
+
gap: "4px"
|
|
2067
|
+
},
|
|
2068
|
+
children: rows.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2069
|
+
type: "button",
|
|
2070
|
+
role: "tab",
|
|
2071
|
+
"aria-selected": row.id === active,
|
|
2072
|
+
onClick: () => {
|
|
2073
|
+
setActiveId(row.id);
|
|
2074
|
+
},
|
|
2075
|
+
style: {
|
|
2076
|
+
appearance: "none",
|
|
2077
|
+
font: "inherit",
|
|
2078
|
+
cursor: "pointer",
|
|
2079
|
+
border: "1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))",
|
|
2080
|
+
background: row.id === active ? "var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.08))" : "none",
|
|
2081
|
+
color: "var(--dsw-alias-label-primary, inherit)",
|
|
2082
|
+
borderRadius: "8px",
|
|
2083
|
+
padding: "5px 12px",
|
|
2084
|
+
fontSize: "13px"
|
|
2085
|
+
},
|
|
2086
|
+
children: row.label
|
|
2087
|
+
}, row.id))
|
|
2088
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2089
|
+
role: "tabpanel",
|
|
2090
|
+
children: active === OWN_TAB_ID ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThinkingLevelsCard, {
|
|
2091
|
+
t,
|
|
2092
|
+
scope,
|
|
2093
|
+
piAiScope
|
|
2094
|
+
}) : renderSlot("dsh-family.tab", {}, {
|
|
2095
|
+
only: active,
|
|
2096
|
+
fallback: null
|
|
2097
|
+
})
|
|
2098
|
+
})]
|
|
2034
2099
|
});
|
|
2035
2100
|
}
|
|
2036
2101
|
//#endregion
|
|
@@ -2073,22 +2138,52 @@ window.__ModuleLoader__.load({
|
|
|
2073
2138
|
}
|
|
2074
2139
|
}, ContextQuick);
|
|
2075
2140
|
});
|
|
2076
|
-
|
|
2141
|
+
/** Registrant labels arrive as a string or a locale thunk; unwrap either. */
|
|
2142
|
+
const resolveLabel = (label) => typeof label === "function" ? label() : typeof label === "string" ? label : "";
|
|
2143
|
+
let tabsVersion = -1;
|
|
2144
|
+
let tabsRevision = -1;
|
|
2145
|
+
let tabs = [];
|
|
2146
|
+
const sectionInjected = () => ({
|
|
2147
|
+
scope: ctx.configForms.get("dsh-thinking-levels"),
|
|
2148
|
+
piAiScope: ctx.configForms.get("llm-pi-ai"),
|
|
2149
|
+
hooks: { tabs: {
|
|
2150
|
+
getSnapshot: () => {
|
|
2151
|
+
const version = ctx.slots.getVersion("dsh-family.tab");
|
|
2152
|
+
const revision = ctx.locale.getSnapshot().revision;
|
|
2153
|
+
if (version !== tabsVersion || revision !== tabsRevision) {
|
|
2154
|
+
tabsVersion = version;
|
|
2155
|
+
tabsRevision = revision;
|
|
2156
|
+
tabs = ctx.slots.entries("dsh-family.tab").map((entry) => ({
|
|
2157
|
+
id: entry.options.id ?? "",
|
|
2158
|
+
order: entry.options.order ?? 0,
|
|
2159
|
+
label: resolveLabel(entry.options.label)
|
|
2160
|
+
})).sort((a, b) => a.order - b.order);
|
|
2161
|
+
}
|
|
2162
|
+
return tabs;
|
|
2163
|
+
},
|
|
2164
|
+
subscribe: (listener) => {
|
|
2165
|
+
const offLedger = ctx.slots.subscribe("dsh-family.tab", listener);
|
|
2166
|
+
const offLocale = ctx.locale.subscribe(listener);
|
|
2167
|
+
return () => {
|
|
2168
|
+
offLedger();
|
|
2169
|
+
offLocale();
|
|
2170
|
+
};
|
|
2171
|
+
}
|
|
2172
|
+
} }
|
|
2173
|
+
});
|
|
2174
|
+
ctx.slots.inject("settings.section", function* () {
|
|
2077
2175
|
yield ctx.slots.register({
|
|
2078
|
-
name: "settings.
|
|
2176
|
+
name: "settings.section",
|
|
2079
2177
|
id: "dsh-family",
|
|
2080
2178
|
order: 40,
|
|
2081
2179
|
label: () => t("family.title"),
|
|
2082
2180
|
locale: NS,
|
|
2083
|
-
inject:
|
|
2084
|
-
scope: ctx.configForms.get("dsh-thinking-levels"),
|
|
2085
|
-
piAiScope: ctx.configForms.get("llm-pi-ai")
|
|
2086
|
-
}),
|
|
2181
|
+
inject: sectionInjected,
|
|
2087
2182
|
children: { "dsh-family.tab": {
|
|
2088
2183
|
kind: "list",
|
|
2089
2184
|
scope: "root"
|
|
2090
2185
|
} }
|
|
2091
|
-
},
|
|
2186
|
+
}, FamilySettingsSection);
|
|
2092
2187
|
});
|
|
2093
2188
|
}
|
|
2094
2189
|
//#endregion
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["rowStyle","labelStyle","providersOf","useSyncExternalStore","useState","useSyncExternalStore","useState"],"sources":["../src/client/locales.ts","../src/context-window.ts","../src/client/context-quick.tsx","../src/client/card.tsx","../src/client/family-tab.tsx","../src/client/index.ts"],"sourcesContent":["/** `thinking-levels` client dictionaries (zh / en / ja / ko). */\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'thinking-levels'\n\n/** Simplified Chinese dictionary (the key-set source of truth). */\nexport const zh = {\n 'card.title': '思考档位',\n 'family.title': '起子插件设置',\n 'card.description': '在模型选择器中可选 Auto(mask):按工具调用历史自动在 low / high / max 间调度后提交 API。此处配置默认档位、调度边界与模型能力(档位 → 网关线上值映射)。',\n 'card.level': '默认档位',\n 'card.level.off': 'off — 关闭思考(仅手动,永不自动选择)',\n 'card.level.on': 'on — 开启思考(仅 toggle 型模型;只发 enable_thinking,不发 effort)',\n 'card.level.minimal': 'minimal — 最低(极轻任务)',\n 'card.level.low': 'low — 低(简单任务,廉价轮保持廉价)',\n 'card.level.medium': 'medium — 中',\n 'card.level.high': 'high — 高(官方默认)',\n 'card.level.xhigh': 'xhigh — 特高',\n 'card.level.max': 'max — 最大(重任务)',\n 'card.level.auto': 'auto — 按工具历史自动调度(默认)',\n 'card.enabled': '启用',\n 'card.allowDowngrade': '允许降档(auto 可降至 low)',\n 'card.allowUpgrade': '允许升档(auto 可升至 max)',\n 'card.unavailable': '设置命名空间不可用:请确认 dsh-thinking-levels 已装配进 profile。',\n 'card.readonly': '只读',\n 'card.capabilities': '模型能力(llm-pi-ai 自定义提供方)',\n 'card.capabilities.hint': '直接读写 llm-pi-ai 配置:勾选档位并填写发送给网关的线上值(例如 high → ultra);off 留空表示不发送。视觉决定图片输入;思考开关决定 enable_thinking 置位;thinkingFormat 决定 wire 序列化格式。',\n 'card.capabilities.empty': 'llm-pi-ai 中没有已配置模型的自定义提供方。请先在「设置 → 模型」添加提供方与模型。',\n 'card.capabilities.unavailable': 'llm-pi-ai 设置命名空间不可用。',\n 'card.capabilities.none': '(无模型)',\n 'card.capabilities.search': '搜索模型(名称或 ID)…',\n 'card.capabilities.noMatches': '没有匹配的模型',\n 'card.capabilities.quickSettings': '一键设置',\n 'card.capabilities.presetOfficial': '应用到全部:Off / High / Max(官方 DeepSeek 风格)',\n 'card.capabilities.presetGeneric': '应用到全部:Off / Low / Medium / High(通用)',\n 'card.capabilities.vendor': '提供方',\n 'card.capabilities.developerRole': '网关不支持 developer 角色',\n 'card.capabilities.developerRoleHint': '官方兼容开关(dsh ≥ v0.1.0-rc.8):写入路由级 compat.supportsDeveloperRole: false,系统提示词按 system 角色发送,修复 vLLM / SGLang 等网关的 Unexpected message role 400。取消勾选 = 删除该字段、恢复继承。',\n 'card.capabilities.expandProvider': '展开提供方',\n 'card.capabilities.collapseProvider': '收起提供方',\n 'card.capabilities.openModelSettings': '打开模型设置',\n 'card.capabilities.closeModelSettings': '收起模型设置',\n 'card.capabilities.vision': '视觉模型',\n 'card.capabilities.thinking': '思考模型',\n 'card.capabilities.supportsEffort': '支持 think effort',\n 'card.capabilities.efforts': '思考档位(勾选后填写线上值)',\n 'card.capabilities.wirePlaceholder': '线上值,如 ultra',\n 'card.capabilities.offPlaceholder': '留空 = 不发送',\n 'card.capabilities.atLeastThinking': '至少需要一个思考档位(off 除外)',\n 'card.capabilities.applyLevel': '应用此档位',\n 'card.capabilities.restoreDefault': '恢复默认档位',\n 'card.capabilities.unsaved': '未保存',\n 'card.capabilities.saveChanges': '保存更改',\n 'card.capabilities.saved': '已保存',\n 'card.capabilities.thinkingFormat': '思考格式',\n 'card.capabilities.thinkingFormat.inherit': '继承',\n 'card.capabilities.contextWindow': '上下文窗口上限',\n 'card.capabilities.contextCustomPlaceholder': '自定义整数,如 256000',\n 'card.capabilities.contextClear': '清除',\n 'card.capabilities.contextInteger': '上下文长度必须是整数(2000-1000000)',\n 'card.capabilities.contextRange': '上下文长度必须在 2000 到 1000000 之间',\n 'card.capabilities.contextHint': '选择预设或输入整数(2000–1000000),写入 llm-pi-ai 供上下文压力/压缩使用,无需重启即对下一请求生效。',\n 'input.context.title': '上下文窗口',\n 'input.context.globalHint': '全局生效:作用于所有使用该模型的会话(清除可恢复默认)',\n 'input.context.unset': '未设',\n 'input.context.custom': '自定义',\n 'input.context.noModel': '暂无会话模型',\n 'input.context.customPlaceholder': '自定义整数,如 256000',\n 'input.context.apply': '应用',\n 'input.context.clear': '清除',\n 'input.context.integer': '上下文长度必须是整数(2000-1000000)',\n 'input.context.range': '上下文长度必须在 2000 到 1000000 之间',\n 'card.capabilities.failed': '保存失败:配置被拒绝或冲突,请检查值。',\n} satisfies Record<string, string>\n\n/** English dictionary (keys mirror zh). */\nexport const en: Record<keyof typeof zh, string> = {\n 'card.title': 'Thinking Levels',\n 'family.title': 'Qizi Plugin Settings',\n 'card.description': 'Pick Auto in the model selector: the plugin schedules low / high / max per tool round before submitting the API effort. Here you configure the default level, scheduler bounds, and per-model capabilities (level → gateway wire value mapping).',\n 'card.level': 'Default level',\n 'card.level.off': 'off — disable thinking (manual only, never auto-picked)',\n 'card.level.on': 'on — enable thinking (toggle-only models only; sends enable_thinking, never an effort)',\n 'card.level.minimal': 'minimal — least (very light tasks)',\n 'card.level.low': 'low — cheap rounds stay cheap',\n 'card.level.medium': 'medium — medium',\n 'card.level.high': 'high — the official default',\n 'card.level.xhigh': 'xhigh — extra high',\n 'card.level.max': 'max — heavy work',\n 'card.level.auto': 'auto — schedule from tool history (default)',\n 'card.enabled': 'Enabled',\n 'card.allowDowngrade': 'Allow downgrade (auto may drop to low)',\n 'card.allowUpgrade': 'Allow upgrade (auto may lift to max)',\n 'card.unavailable': 'Settings namespace unavailable: make sure dsh-thinking-levels is assembled into this profile.',\n 'card.readonly': 'Read-only',\n 'card.capabilities': 'Model capabilities (llm-pi-ai custom providers)',\n 'card.capabilities.hint': 'Reads and writes the llm-pi-ai config directly: tick a level and enter the exact value sent to the gateway (e.g. high → ultra); leaving off empty means “do not send”. Vision gates image input; the thinking toggle drives enable_thinking; thinkingFormat picks the wire serialization.',\n 'card.capabilities.empty': 'No custom provider has models configured in llm-pi-ai. Add a provider and models under Settings → Models first.',\n 'card.capabilities.unavailable': 'The llm-pi-ai settings namespace is unavailable.',\n 'card.capabilities.none': '(no models)',\n 'card.capabilities.search': 'Search models by name or ID…',\n 'card.capabilities.noMatches': 'No matching models',\n 'card.capabilities.quickSettings': 'Quick settings',\n 'card.capabilities.presetOfficial': 'Apply to all: Off / High / Max (official DeepSeek style)',\n 'card.capabilities.presetGeneric': 'Apply to all: Off / Low / Medium / High (generic)',\n 'card.capabilities.vendor': 'Provider',\n 'card.capabilities.developerRole': 'Gateway rejects the developer role',\n 'card.capabilities.developerRoleHint': 'Official compat switch (dsh ≥ v0.1.0-rc.8): writes route-level compat.supportsDeveloperRole: false so the system prompt is sent as role system — fixes the Unexpected message role 400 on vLLM / SGLang gateways. Unchecking deletes the field and restores inheritance.',\n 'card.capabilities.expandProvider': 'Expand provider',\n 'card.capabilities.collapseProvider': 'Collapse provider',\n 'card.capabilities.openModelSettings': 'Open model settings',\n 'card.capabilities.closeModelSettings': 'Collapse model settings',\n 'card.capabilities.vision': 'Vision model',\n 'card.capabilities.thinking': 'Thinking model',\n 'card.capabilities.supportsEffort': 'Supports think effort',\n 'card.capabilities.efforts': 'Thinking effort levels (tick, then enter the wire value)',\n 'card.capabilities.wirePlaceholder': 'Wire value, e.g. ultra',\n 'card.capabilities.offPlaceholder': 'Empty = do not send',\n 'card.capabilities.atLeastThinking': 'Select at least one thinking level (other than off)',\n 'card.capabilities.applyLevel': 'Apply levels',\n 'card.capabilities.restoreDefault': 'Restore defaults',\n 'card.capabilities.unsaved': 'Unsaved',\n 'card.capabilities.saveChanges': 'Save changes',\n 'card.capabilities.saved': 'Saved',\n 'card.capabilities.thinkingFormat': 'Thinking format',\n 'card.capabilities.thinkingFormat.inherit': 'Inherit',\n 'card.capabilities.contextWindow': 'Context window limit',\n 'card.capabilities.contextCustomPlaceholder': 'Custom integer, e.g. 256000',\n 'card.capabilities.contextClear': 'Clear',\n 'card.capabilities.contextInteger': 'Context length must be an integer (2000-1000000)',\n 'card.capabilities.contextRange': 'Context length must be between 2000 and 1000000',\n 'card.capabilities.contextHint': 'Pick a preset or enter an integer (2000–1000000); written to llm-pi-ai for context pressure/compaction and applied to the next request without a restart.',\n 'input.context.title': 'Context window',\n 'input.context.globalHint': 'Applies globally to every session using this model (Clear restores the default)',\n 'input.context.unset': 'Unset',\n 'input.context.custom': 'Custom',\n 'input.context.noModel': 'No session model yet',\n 'input.context.customPlaceholder': 'Custom integer, e.g. 256000',\n 'input.context.apply': 'Apply',\n 'input.context.clear': 'Clear',\n 'input.context.integer': 'Context length must be an integer (2000-1000000)',\n 'input.context.range': 'Context length must be between 2000 and 1000000',\n 'card.capabilities.failed': 'Save failed: the value was rejected or conflicted. Check it.',\n}\n\n/** Japanese dictionary (keys mirror zh). */\nexport const ja: Record<keyof typeof zh, string> = {\n 'card.title': '思考レベル',\n 'family.title': '起子プラグイン設定',\n 'card.description': 'モデルセレクターで Auto(マスク)を選択すると、ツール呼び出し履歴から low / high / max を自動スケジュールして API に送信します。ここでは既定レベル、スケジューラーの境界、モデル能力(レベル → ゲートウェイ送信値のマッピング)を設定します。',\n 'card.level': '既定レベル',\n 'card.level.off': 'off — 思考を無効化(手動のみ、自動選択はされません)',\n 'card.level.on': 'on — 思考を有効化(トグルのみのモデル向け。enable_thinking のみ送信、effort は送信しません)',\n 'card.level.minimal': 'minimal — 最小(非常に軽いタスク)',\n 'card.level.low': 'low — 低(軽いラウンドは軽いまま)',\n 'card.level.medium': 'medium — 中',\n 'card.level.high': 'high — 高(公式既定値)',\n 'card.level.xhigh': 'xhigh — 特高',\n 'card.level.max': 'max — 最大(重いタスク)',\n 'card.level.auto': 'auto — ツール履歴から自動スケジュール(既定)',\n 'card.enabled': '有効',\n 'card.allowDowngrade': '降格を許可(auto は low まで下げられる)',\n 'card.allowUpgrade': '昇格を許可(auto は max まで上げられる)',\n 'card.unavailable': '設定名前空間が利用できません:dsh-thinking-levels が profile に組み込まれているか確認してください。',\n 'card.readonly': '読み取り専用',\n 'card.capabilities': 'モデル能力(llm-pi-ai カスタムプロバイダー)',\n 'card.capabilities.hint': 'llm-pi-ai 設定を直接読み書きします:レベルにチェックを入れ、ゲートウェイに送信する値を入力(例:high → ultra)。off を空欄にすると送信しません。視覚は画像入力を決定、思考トグルは enable_thinking を制御、thinkingFormat は wire シリアライズ形式を選択します。',\n 'card.capabilities.empty': 'llm-pi-ai にモデルが設定されたカスタムプロバイダーがありません。先に「設定 → モデル」でプロバイダーとモデルを追加してください。',\n 'card.capabilities.unavailable': 'llm-pi-ai の設定名前空間が利用できません。',\n 'card.capabilities.none': '(モデルなし)',\n 'card.capabilities.search': 'モデル名または ID で検索…',\n 'card.capabilities.noMatches': '一致するモデルがありません',\n 'card.capabilities.quickSettings': 'クイック設定',\n 'card.capabilities.presetOfficial': 'すべてに適用:Off / High / Max(公式 DeepSeek 形式)',\n 'card.capabilities.presetGeneric': 'すべてに適用:Off / Low / Medium / High(汎用)',\n 'card.capabilities.vendor': 'プロバイダー',\n 'card.capabilities.developerRole': 'ゲートウェイは developer ロール非対応',\n 'card.capabilities.developerRoleHint': '公式互換スイッチ(dsh ≥ v0.1.0-rc.8):ルートレベルの compat.supportsDeveloperRole: false を書き込み、システムプロンプトを system ロールで送信します。vLLM / SGLang などの Unexpected message role 400 を修正。チェックを外すとフィールドを削除し継承に戻します。',\n 'card.capabilities.expandProvider': 'プロバイダーを展開',\n 'card.capabilities.collapseProvider': 'プロバイダーを折りたたむ',\n 'card.capabilities.openModelSettings': 'モデル設定を開く',\n 'card.capabilities.closeModelSettings': 'モデル設定を折りたたむ',\n 'card.capabilities.vision': '視覚モデル',\n 'card.capabilities.thinking': '思考モデル',\n 'card.capabilities.supportsEffort': 'think effort をサポート',\n 'card.capabilities.efforts': '思考レベル(チェック後、送信値を入力)',\n 'card.capabilities.wirePlaceholder': '送信値(例:ultra)',\n 'card.capabilities.offPlaceholder': '空欄 = 送信しない',\n 'card.capabilities.atLeastThinking': '思考レベルを 1 つ以上選択してください(off 以外)',\n 'card.capabilities.applyLevel': 'レベルを適用',\n 'card.capabilities.restoreDefault': '既定値に戻す',\n 'card.capabilities.unsaved': '未保存',\n 'card.capabilities.saveChanges': '変更を保存',\n 'card.capabilities.saved': '保存済み',\n 'card.capabilities.thinkingFormat': '思考形式',\n 'card.capabilities.thinkingFormat.inherit': '継承',\n 'card.capabilities.contextWindow': 'コンテキストウィンドウ上限',\n 'card.capabilities.contextCustomPlaceholder': 'カスタム整数(例:256000)',\n 'card.capabilities.contextClear': 'クリア',\n 'card.capabilities.contextInteger': 'コンテキスト長は整数で入力してください(2000-1000000)',\n 'card.capabilities.contextRange': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\n 'card.capabilities.contextHint': 'プリセットを選ぶか整数を入力(2000–1000000)。llm-pi-ai に書き込まれ、コンテキスト圧力/圧縮に使用され、再起動なしで次のリクエストに反映されます。',\n 'input.context.title': 'コンテキストウィンドウ',\n 'input.context.globalHint': 'グローバルに有効:このモデルを使用するすべてのセッションに適用されます(クリアで既定値に戻ります)',\n 'input.context.unset': '未設定',\n 'input.context.custom': 'カスタム',\n 'input.context.noModel': 'セッションモデルがまだありません',\n 'input.context.customPlaceholder': 'カスタム整数(例:256000)',\n 'input.context.apply': '適用',\n 'input.context.clear': 'クリア',\n 'input.context.integer': 'コンテキスト長は整数で入力してください(2000-1000000)',\n 'input.context.range': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\n 'card.capabilities.failed': '保存に失敗しました:値が拒否されたか競合しています。確認してください。',\n}\n\n/** Korean dictionary (keys mirror zh). */\nexport const ko: Record<keyof typeof zh, string> = {\n 'card.title': '사고 수준',\n 'family.title': '起子 플러그인 설정',\n 'card.description': '모델 선택기에서 Auto(마스크)를 선택하면 도구 호출 기록을 기반으로 low / high / max 를 자동 스케줄링하여 API에 제출합니다. 여기서 기본 수준, 스케줄러 경계, 모델 기능(수준 → 게이트웨이 전송 값 매핑)을 구성합니다.',\n 'card.level': '기본 수준',\n 'card.level.off': 'off — 사고 비활성화(수동 전용, 자동 선택 안 됨)',\n 'card.level.on': 'on — 사고 활성화(토글 전용 모델용. enable_thinking만 전송, effort는 전송하지 않음)',\n 'card.level.minimal': 'minimal — 최소(매우 가벼운 작업)',\n 'card.level.low': 'low — 낮음(가벼운 라운드는 가볍게 유지)',\n 'card.level.medium': 'medium — 중간',\n 'card.level.high': 'high — 높음(공식 기본값)',\n 'card.level.xhigh': 'xhigh — 특별히 높음',\n 'card.level.max': 'max — 최대(무거운 작업)',\n 'card.level.auto': 'auto — 도구 기록에서 자동 스케줄링(기본값)',\n 'card.enabled': '활성화',\n 'card.allowDowngrade': '다운그레이드 허용(auto가 low까지 내릴 수 있음)',\n 'card.allowUpgrade': '업그레이드 허용(auto가 max까지 올릴 수 있음)',\n 'card.unavailable': '설정 네임스페이스를 사용할 수 없습니다: dsh-thinking-levels가 이 profile에 조립되었는지 확인하세요.',\n 'card.readonly': '읽기 전용',\n 'card.capabilities': '모델 기능(llm-pi-ai 사용자 지정 제공자)',\n 'card.capabilities.hint': 'llm-pi-ai 설정을 직접 읽고 씁니다: 수준을 체크하고 게이트웨이에 보낼 값을 입력(예: high → ultra). off를 비워 두면 전송하지 않습니다. 시각은 이미지 입력을 결정하고, 사고 토글은 enable_thinking을 제어하며, thinkingFormat은 wire 직렬화 형식을 선택합니다.',\n 'card.capabilities.empty': 'llm-pi-ai에 모델이 구성된 사용자 지정 제공자가 없습니다. 먼저 「설정 → 모델」에서 제공자와 모델을 추가하세요.',\n 'card.capabilities.unavailable': 'llm-pi-ai 설정 네임스페이스를 사용할 수 없습니다.',\n 'card.capabilities.none': '(모델 없음)',\n 'card.capabilities.search': '모델 이름 또는 ID로 검색…',\n 'card.capabilities.noMatches': '일치하는 모델이 없습니다',\n 'card.capabilities.quickSettings': '빠른 설정',\n 'card.capabilities.presetOfficial': '전체에 적용: Off / High / Max(공식 DeepSeek 방식)',\n 'card.capabilities.presetGeneric': '전체에 적용: Off / Low / Medium / High(일반 방식)',\n 'card.capabilities.vendor': '제공자',\n 'card.capabilities.developerRole': '게이트웨이가 developer 역할 미지원',\n 'card.capabilities.developerRoleHint': '공식 호환 스위치(dsh ≥ v0.1.0-rc.8): 라우트 수준 compat.supportsDeveloperRole: false 를 기록하여 시스템 프롬프트를 system 역할로 전송합니다. vLLM / SGLang 등의 Unexpected message role 400 을 수정. 체크 해제 시 필드를 삭제하고 상속을 복원합니다.',\n 'card.capabilities.expandProvider': '제공자 펼치기',\n 'card.capabilities.collapseProvider': '제공자 접기',\n 'card.capabilities.openModelSettings': '모델 설정 열기',\n 'card.capabilities.closeModelSettings': '모델 설정 접기',\n 'card.capabilities.vision': '시각 모델',\n 'card.capabilities.thinking': '사고 모델',\n 'card.capabilities.supportsEffort': 'think effort 지원',\n 'card.capabilities.efforts': '사고 수준(체크 후 전송 값 입력)',\n 'card.capabilities.wirePlaceholder': '전송 값(예: ultra)',\n 'card.capabilities.offPlaceholder': '비워 둠 = 전송하지 않음',\n 'card.capabilities.atLeastThinking': '사고 수준을 하나 이상 선택하세요(off 제외)',\n 'card.capabilities.applyLevel': '수준 적용',\n 'card.capabilities.restoreDefault': '기본값 복원',\n 'card.capabilities.unsaved': '저장되지 않음',\n 'card.capabilities.saveChanges': '변경 사항 저장',\n 'card.capabilities.saved': '저장됨',\n 'card.capabilities.thinkingFormat': '사고 형식',\n 'card.capabilities.thinkingFormat.inherit': '상속',\n 'card.capabilities.contextWindow': '컨텍스트 창 상한',\n 'card.capabilities.contextCustomPlaceholder': '사용자 지정 정수(예: 256000)',\n 'card.capabilities.contextClear': '지우기',\n 'card.capabilities.contextInteger': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\n 'card.capabilities.contextRange': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\n 'card.capabilities.contextHint': '프리셋을 선택하거나 정수를 입력하세요(2000–1000000). llm-pi-ai에 기록되어 컨텍스트 압력/압축에 사용되며, 재시작 없이 다음 요청에 반영됩니다.',\n 'input.context.title': '컨텍스트 창',\n 'input.context.globalHint': '전역 적용: 이 모델을 사용하는 모든 세션에 적용됩니다(지우면 기본값 복원)',\n 'input.context.unset': '미설정',\n 'input.context.custom': '사용자 지정',\n 'input.context.noModel': '세션 모델이 아직 없습니다',\n 'input.context.customPlaceholder': '사용자 지정 정수(예: 256000)',\n 'input.context.apply': '적용',\n 'input.context.clear': '지우기',\n 'input.context.integer': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\n 'input.context.range': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\n 'card.capabilities.failed': '저장 실패: 값이 거부되었거나 충돌합니다. 확인하세요.',\n}\n","/**\n * Pure context-window helpers for the dsh-thinking-levels plugin.\n *\n * The context-window limit of a custom gateway model is declared in the\n * llm-pi-ai model entry (`contextWindow`, a positive integer). The harness\n * consumes it through `resolveModelInfo(...).context.contextWindow` for\n * compaction thresholds, context-overflow detection and context-pressure\n * projections — a settings write takes effect on the next request without a\n * restart. This module centralizes the legal range, the common presets and\n * the display formatting shared by the config schema, the settings card and\n * the tests. Kept dependency-free (pure inputs -> output).\n */\n\n/** Smallest accepted context window (tokens), aligned with dsh-thinking-effort. */\nexport const CONTEXT_WINDOW_MIN = 2000\n/** Largest accepted context window (tokens), e.g. third-party DeepSeek 1M. */\nexport const CONTEXT_WINDOW_MAX = 1_000_000\n\n/** One selectable context-window preset. */\nexport interface ContextWindowPreset {\n /** Human-readable label shown on the card button and the model badge. */\n label: string\n /** The token count written to the llm-pi-ai model entry. */\n value: number\n}\n\n/** The multi-level context-window presets, in ascending order. */\nexport const CONTEXT_WINDOW_PRESETS: readonly ContextWindowPreset[] = [\n { label: '64K', value: 64_000 },\n { label: '128K', value: 131_072 },\n { label: '256K', value: 256_000 },\n { label: '400K', value: 400_000 },\n { label: '512K', value: 524_288 },\n { label: '1M', value: 1_000_000 },\n] as const\n\n/** Format a token count as a readable label (exact presets keep their label). */\nexport function formatContextWindow(value: number): string {\n const preset = CONTEXT_WINDOW_PRESETS.find(candidate => candidate.value === value)\n if (preset !== undefined) return preset.label\n if (value >= CONTEXT_WINDOW_MAX) return '1M'\n if (value >= 1024) return `${Math.round(value / 1024)}K`\n return String(value)\n}\n\n/** The result of validating a context-window value. */\nexport type ContextWindowValidation =\n | { ok: true; value: number }\n | { ok: false; reason: 'integer' | 'range' }\n\n/**\n * Validate a context-window candidate (number or numeric string). Accepts only\n * base-10 integers inside [CONTEXT_WINDOW_MIN, CONTEXT_WINDOW_MAX]; anything\n * else (float, 'abc', '1e3', out-of-range) is rejected with a reason.\n */\nexport function validateContextWindow(value: unknown): ContextWindowValidation {\n const raw = typeof value === 'string' ? value.trim() : value\n const asString = typeof raw === 'string' ? raw : String(raw)\n if (!/^\\d+$/.test(asString)) return { ok: false, reason: 'integer' }\n const numeric = Number(asString)\n if (!Number.isSafeInteger(numeric)) return { ok: false, reason: 'integer' }\n if (numeric < CONTEXT_WINDOW_MIN || numeric > CONTEXT_WINDOW_MAX) {\n return { ok: false, reason: 'range' }\n }\n return { ok: true, value: numeric }\n}\n","/**\n * Context-window quick control for the composer tool row\n * (`conversation.input.right`, the seat just left of the model/effort select).\n *\n * Why this seat: the model *card* has no injection point (the shipped\n * `ModelSelect` calls `renderSlot` zero times and owns its popup outright), so a\n * plugin can only contribute inside the composer area. `conversation.input.right`\n * is a session-scoped `list` seat, which is where the harness lets any plugin put\n * a tool-row control. The trigger is a compact pill showing the committed value\n * only; the popover holds one slider row over the shared presets, a collapsed\n * custom-integer editor and Clear — no preset button grid.\n *\n * Model source: whichever session seat this harness provides, in order —\n * `useTrajectory` (the trajectory ledger's `requests`, DSH 0.1.2+) or\n * `useConversation` (`ConversationSnapshot.views.get('trajectory')`). Every\n * renderer standard seat is a `useSyncExternalStoreWithSelector` selector hook\n * and the selector is mandatory: calling one without a selector throws\n * `TypeError: <minified> is not a function` inside the binding shim and takes the\n * whole slot entry down. A harness that provides neither seat renders nothing\n * here instead of a dead control.\n *\n * Two model families are served, each with its own writable config form\n * (both consumed live by `resolveModelInfo(...).context.contextWindow`,\n * so a write takes effect on the next request without a restart):\n * - Custom gateways (`llm-pi-ai` providers): writes the model entry's\n * `contextWindow` under `providers[provider].models[i]`.\n * - Official DeepSeek models (`deepseek-official`, the `llm-deepseek`\n * entry): writes the catalog model's `contextWindow` when the model is\n * listed, otherwise caps via `defaultContextWindow`.\n *\n * Write discipline: dragging the slider only moves a local draft; the config\n * write happens once per gesture (pointer release, key release, blur), so a\n * drag never floods the host with intermediate values.\n *\n * Kept dependency-free beyond react + the injected scopes: plain HTML controls\n * with token-based inline styling, and validation reuses the shared\n * `validateContextWindow`.\n */\nimport { useState, useSyncExternalStore } from 'react'\nimport type { CSSProperties, JSX } from 'react'\nimport type { SettingsScope } from './scope-face.ts'\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\n\n/** The official DeepSeek provider route owned by the llm-deepseek adapter. */\nconst DEEPSEEK_PROVIDER = 'deepseek-official'\n/** llm-deepseek's native default context capacity (DEFAULT_CONTEXT_WINDOW). */\nconst DEEPSEEK_DEFAULT_WINDOW = 1_000_000\n/** Slider stop an unset window parks on: the thumb needs a position, the readout stays \"unset\". */\nconst UNSET_STOP_INDEX = CONTEXT_WINDOW_PRESETS.findIndex(preset => preset.value === 256_000)\n\n/** One injected face: the `llm-pi-ai` and `llm-deepseek` config forms. */\nexport interface ContextQuickInjected {\n /** The `llm-pi-ai` config form (custom gateway models). */\n piAiScope: SettingsScope<unknown>\n /** The `llm-deepseek` config form (official DeepSeek models). */\n deepseekScope: SettingsScope<unknown>\n}\n\n/** The narrow trajectory-view slice the component reads for provider/model. */\ninterface TrajectoryLike {\n requests?: readonly {\n purpose?: string\n prompt?: { config?: { provider?: string; model?: string } }\n }[]\n}\n\n/** The conversation snapshot face this component reads (views store only). */\ninterface ConversationLike {\n views?: { get?: (target: string) => unknown }\n}\n\n/**\n * One renderer standard seat: a `useSyncExternalStoreWithSelector`-bound\n * selector hook over a host observable. The selector is required — the kit\n * never defaults it (compare `useProjection`, which does).\n */\ntype SnapshotSelectorHook<Snapshot> = <Selected>(\n selector: (snapshot: Snapshot) => Selected,\n isEqual?: (a: Selected, b: Selected) => boolean,\n) => Selected\n\n/** Full props: injected scopes + the session standard seats + locale copy. */\nexport interface ContextQuickProps extends ContextQuickInjected {\n /** The session id of the slot's owning conversation (standard seat). */\n sessionId: string\n /** The session trajectory seat (DSH 0.1.2+); absent on a harness without it. */\n useTrajectory?: SnapshotSelectorHook<TrajectoryLike>\n /** The session conversation seat (legacy lines); absent on a harness without it. */\n useConversation?: SnapshotSelectorHook<ConversationLike>\n /** Locale copy thunk. */\n t: (key: string) => string\n}\n\n/* ── shared inline styling (no CSS modules in the client bundle) ───────── */\n\nconst pillStyle: CSSProperties = {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '4px',\n height: '24px',\n padding: '0 8px',\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-secondary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '6px',\n fontSize: '11px',\n lineHeight: '16px',\n fontFamily: 'var(--ds-font-family-code, monospace)',\n cursor: 'pointer',\n whiteSpace: 'nowrap',\n}\n\nconst popStyle: CSSProperties = {\n position: 'absolute',\n bottom: 'calc(100% + 8px)',\n right: '0',\n zIndex: 1200,\n minWidth: '260px',\n padding: '10px',\n background: 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))',\n color: 'var(--dsw-alias-label-primary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '10px',\n boxShadow: '0 8px 28px rgba(0,0,0,0.18)',\n display: 'flex',\n flexDirection: 'column',\n gap: '8px',\n}\n\nconst backdropStyle: CSSProperties = { position: 'fixed', inset: 0, zIndex: 1199 }\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n fontSize: '12px',\n lineHeight: '18px',\n color: 'var(--dsw-alias-label-secondary)',\n}\n\nconst labelStyle: CSSProperties = {\n flex: '0 0 auto',\n minWidth: '0',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n color: 'var(--dsw-alias-label-tertiary)',\n}\n\nconst sliderStyle: CSSProperties = {\n flex: '1 1 auto',\n minWidth: '56px',\n height: '14px',\n margin: '0',\n accentColor: 'var(--dsw-alias-state-business-primary)',\n cursor: 'pointer',\n}\n\nconst valueStyle: CSSProperties = {\n flex: '0 0 auto',\n minWidth: '40px',\n textAlign: 'right',\n color: 'var(--dsw-alias-label-primary)',\n fontFamily: 'var(--ds-font-family-code, monospace)',\n fontVariantNumeric: 'tabular-nums',\n}\n\nconst glyphButtonStyle: CSSProperties = {\n flex: '0 0 auto',\n height: '18px',\n padding: '0 5px',\n border: '1px solid transparent',\n borderRadius: '4px',\n background: 'transparent',\n color: 'var(--dsw-alias-label-tertiary)',\n font: 'inherit',\n cursor: 'pointer',\n}\n\nconst actionButtonStyle: CSSProperties = {\n flex: '0 0 auto',\n height: '18px',\n padding: '0 6px',\n border: '1px solid transparent',\n borderRadius: '4px',\n background: 'transparent',\n color: 'var(--dsw-alias-label-secondary)',\n font: 'inherit',\n cursor: 'pointer',\n}\n\nconst customRowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '6px',\n}\n\nconst inputStyle: CSSProperties = {\n flex: '1 1 auto',\n minWidth: '0',\n boxSizing: 'border-box',\n padding: '2px 6px',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '5px',\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-primary)',\n font: 'inherit',\n}\n\nconst errorStyle: CSSProperties = {\n flex: '0 0 auto',\n color: 'var(--dsw-alias-danger, #e5484d)',\n}\n\n/* ── helpers over the settings user layer ──────────────────────────────── */\n\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\n if (typeof snapshot !== 'object' || snapshot === null) return {}\n const user = (snapshot as { user?: unknown }).user\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\n const providers = (user as Record<string, unknown>)['providers']\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\n ? providers as Record<string, unknown>\n : {}\n}\n\n/** The user-layer `models`/`defaultContextWindow` of the llm-deepseek namespace. */\nfunction deepseekSectionOf(snapshot: unknown): {\n models?: Record<string, unknown>[]\n defaultContextWindow?: number\n} {\n if (typeof snapshot !== 'object' || snapshot === null) return {}\n const user = (snapshot as { user?: unknown }).user\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\n const section = user as { models?: unknown; defaultContextWindow?: unknown }\n const models = Array.isArray(section.models)\n ? section.models.filter((model): model is Record<string, unknown> =>\n typeof model === 'object' && model !== null && !Array.isArray(model))\n : undefined\n const defaultContextWindow = typeof section.defaultContextWindow === 'number'\n ? section.defaultContextWindow\n : undefined\n return {\n ...models === undefined ? {} : { models },\n ...defaultContextWindow === undefined ? {} : { defaultContextWindow },\n }\n}\n\n/**\n * The stable trajectory-ledger selector (the `useTrajectory` seat): the seat\n * memoizes its selection on the selector reference, so it must not be a fresh\n * closure per render. The ledger is a store-owned array whose reference only\n * moves when the trajectory changes.\n * @param snapshot - the current trajectory snapshot.\n * @returns the request ledger.\n */\nconst selectRequests = (snapshot: TrajectoryLike): unknown => snapshot.requests\n\n/**\n * The stable trajectory-view selector (the `useConversation` seat): selecting\n * the view snapshot (a store-owned reference, not a derived object) keeps the\n * selected value stable between snapshots — a selector that built a new object\n * would re-render forever.\n * @param snapshot - the current conversation snapshot.\n * @returns the trajectory view snapshot, absent while the view is unregistered.\n */\nconst selectTrajectory = (snapshot: ConversationLike): unknown => snapshot.views?.get?.('trajectory')\n\n/**\n * The current session's active model, taken from the trajectory ledger's\n * latest assistant request prompt config. Absent for a blank session (no\n * request yet) — the control then renders disabled.\n * @param source - the request ledger, or a trajectory snapshot carrying it.\n * @returns the provider/model pair, or undefined when the ledger has none.\n */\nfunction activeModelOf(source: unknown): { provider: string; model: string } | undefined {\n const requests = Array.isArray(source)\n ? source as TrajectoryLike['requests'] ?? []\n : typeof source === 'object' && source !== null\n ? (source as TrajectoryLike).requests ?? []\n : []\n for (let index = requests.length - 1; index >= 0; index -= 1) {\n const config = requests[index]?.prompt?.config\n if (requests[index]?.purpose === 'assistant'\n && typeof config?.provider === 'string'\n && typeof config?.model === 'string') {\n return { provider: config.provider, model: config.model }\n }\n }\n return undefined\n}\n\n/** One model entry's declared contextWindow, when present. */\nfunction contextWindowOf(model: Record<string, unknown>): number | undefined {\n const value = model['contextWindow']\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : undefined\n}\n\n/**\n * The slider stop nearest to a committed token count; a window that matches no\n * preset still parks the thumb on its closest stop.\n * @param value - the committed context window, when one is set.\n * @returns the stop index, or the unset park position.\n */\nfunction stopIndexOf(value: number | undefined): number {\n if (value === undefined) return UNSET_STOP_INDEX\n let best = 0\n let bestDistance = Number.POSITIVE_INFINITY\n CONTEXT_WINDOW_PRESETS.forEach((preset, index) => {\n const distance = Math.abs(preset.value - value)\n if (distance < bestDistance) {\n bestDistance = distance\n best = index\n }\n })\n return best\n}\n\n/**\n * The composer context-window quick control. Renders nothing when this harness\n * provides neither session seat, so a missing seat never leaves a dead control\n * (or a crash) in the tool row.\n * @param props - injected scopes, session standard seats, copy.\n */\nexport function ContextQuick(props: ContextQuickProps): JSX.Element | null {\n // The seat choice is a prop fact fixed for this registration, and each branch\n // renders a component that calls exactly one hook unconditionally.\n if (typeof props.useTrajectory === 'function') {\n return <TrajectoryBound {...props} useTrajectory={props.useTrajectory} />\n }\n if (typeof props.useConversation === 'function') {\n return <ConversationBound {...props} useConversation={props.useConversation} />\n }\n return null\n}\n\n/**\n * The trajectory-seat binding (DSH 0.1.2+).\n * @param props - the control props plus the present trajectory seat.\n */\nfunction TrajectoryBound(\n { useTrajectory, ...rest }: ContextQuickProps & { useTrajectory: SnapshotSelectorHook<TrajectoryLike> },\n): JSX.Element {\n return <ContextQuickView {...rest} active={activeModelOf(useTrajectory(selectRequests))} />\n}\n\n/**\n * The conversation-seat binding (harness lines without the trajectory seat).\n * @param props - the control props plus the present conversation seat.\n */\nfunction ConversationBound(\n { useConversation, ...rest }: ContextQuickProps & { useConversation: SnapshotSelectorHook<ConversationLike> },\n): JSX.Element {\n return <ContextQuickView {...rest} active={activeModelOf(useConversation(selectTrajectory))} />\n}\n\n/**\n * The bound control: a value pill that opens a one-row slider popover\n * (preset slider, committed value, collapsed custom-integer editor, Clear).\n * Custom gateways and official DeepSeek models are both supported (see module\n * doc for the namespace each writes).\n * @param props - injected scopes, the resolved active model, copy.\n */\nfunction ContextQuickView(\n { active, piAiScope, deepseekScope, t }:\n ContextQuickInjected & { active: { provider: string; model: string } | undefined; t: (key: string) => string },\n): JSX.Element {\n const official = active !== undefined && active.provider === DEEPSEEK_PROVIDER\n\n const piSnapshot = useSyncExternalStore(\n (listener) => piAiScope.subscribe(listener),\n () => piAiScope.getSnapshot(),\n )\n const dsSnapshot = useSyncExternalStore(\n (listener) => deepseekScope.subscribe(listener),\n () => deepseekScope.getSnapshot(),\n )\n const snapshot = official ? dsSnapshot : piSnapshot\n const unavailable = snapshot.status === 'unavailable'\n const readonly = unavailable || !snapshot.writable\n const providers = official ? {} : providersOf(piSnapshot)\n const dsSection = official ? deepseekSectionOf(dsSnapshot) : undefined\n\n // Resolve the effective window and whether a write target exists.\n let currentWindow: number | undefined\n let writableTarget = false\n if (official && active !== undefined) {\n const models = dsSection?.models ?? []\n const index = models.findIndex(model => model['id'] === active.model)\n currentWindow = index >= 0 ? contextWindowOf(models[index]) : undefined\n if (currentWindow === undefined) currentWindow = dsSection?.defaultContextWindow\n writableTarget = true\n } else if (active !== undefined) {\n const profile = providers[active.provider] as { models?: unknown[] } | undefined\n const model = profile !== undefined && Array.isArray(profile.models)\n ? profile.models.find((candidate): candidate is Record<string, unknown> =>\n typeof candidate === 'object' && candidate !== null && (candidate as Record<string, unknown>)['id'] === active.model)\n : undefined\n currentWindow = model === undefined ? undefined : contextWindowOf(model)\n writableTarget = model !== undefined\n }\n\n // UI-only state: the popover, the uncommitted stop, the custom draft and its error.\n const [open, setOpen] = useState(false)\n const [draft, setDraft] = useState<number | null>(null)\n const [custom, setCustom] = useState(false)\n const [raw, setRaw] = useState('')\n const [error, setError] = useState<string | null>(null)\n const [busy, setBusy] = useState(false)\n\n const disabled = readonly || busy || active === undefined || !writableTarget\n const stop = draft ?? stopIndexOf(currentWindow)\n\n /** Commit (or delete) the active model's context window. */\n const commitWindow = (value: number | undefined): void => {\n if (active === undefined || snapshot.status !== 'ready' || !writableTarget) {\n setDraft(null)\n return\n }\n setBusy(true)\n if (official) {\n // Official DeepSeek: cap the catalog model when listed, else the provider default.\n const models = (deepseekSectionOf(dsSnapshot).models ?? []).map(model => ({ ...model }))\n const index = models.findIndex(model => model['id'] === active.model)\n const commit = index >= 0\n ? deepseekScope.set('models', models.map((model, at) => {\n if (at !== index) return model\n if (value === undefined) {\n const rest = { ...model }\n delete rest['contextWindow']\n return rest\n }\n return { ...model, contextWindow: value }\n }))\n : deepseekScope.set('defaultContextWindow', value === undefined ? DEEPSEEK_DEFAULT_WINDOW : value)\n commit.then(() => { setBusy(false); setDraft(null) }).catch(() => { setBusy(false); setDraft(null) })\n return\n }\n const next = structuredClone(providers)\n const profile = next[active.provider] as { models?: unknown[] } | undefined\n const entry = profile?.models?.find(candidate =>\n typeof candidate === 'object' && candidate !== null && (candidate as Record<string, unknown>)['id'] === active.model)\n if (entry === undefined) {\n setBusy(false)\n setDraft(null)\n return\n }\n if (value === undefined) delete (entry as Record<string, unknown>)['contextWindow']\n else (entry as Record<string, unknown>)['contextWindow'] = value\n void piAiScope.set('providers', next)\n .then(() => { setBusy(false); setDraft(null) })\n .catch(() => { setBusy(false); setDraft(null) })\n }\n\n /** Write the stop the gesture landed on; a drag only moves the draft. */\n const commitStop = (): void => {\n if (disabled || draft === null) return\n commitWindow(CONTEXT_WINDOW_PRESETS[draft]?.value)\n }\n\n /** Validate and commit the custom input; empty clears. */\n const applyCustom = (): void => {\n const trimmed = raw.trim()\n if (trimmed === '') {\n setError(null)\n commitWindow(undefined)\n return\n }\n const validation = validateContextWindow(trimmed)\n if (!validation.ok) {\n setError(t(validation.reason === 'integer' ? 'input.context.integer' : 'input.context.range'))\n return\n }\n setError(null)\n commitWindow(validation.value)\n }\n\n const value = draft === null\n ? currentWindow === undefined ? t('input.context.unset') : formatContextWindow(currentWindow)\n : formatContextWindow(CONTEXT_WINDOW_PRESETS[draft]?.value ?? 0)\n\n return (\n <div style={{ position: 'relative' }}>\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n aria-label={t('input.context.title')}\n title={active === undefined ? t('input.context.noModel') : `${active.provider}/${active.model}`}\n style={{\n ...pillStyle,\n cursor: disabled ? 'default' : 'pointer',\n opacity: disabled ? 0.55 : 1,\n }}\n onClick={() => { setOpen(value => !value); setError(null) }}\n >\n {value}\n </button>\n {open\n ? (\n <>\n <div style={backdropStyle} onClick={() => { setOpen(false); setError(null) }} />\n <div style={popStyle} role=\"group\" aria-label={t('input.context.title')}>\n <div style={rowStyle}>\n <span style={labelStyle} title={t('input.context.globalHint')}>{t('input.context.title')}</span>\n <input\n type=\"range\"\n min={0}\n max={CONTEXT_WINDOW_PRESETS.length - 1}\n step={1}\n value={stop}\n disabled={disabled}\n aria-label={t('input.context.title')}\n style={{ ...sliderStyle, cursor: disabled ? 'default' : 'pointer', opacity: disabled ? 0.55 : 1 }}\n onChange={(event) => { setDraft(Number(event.currentTarget.value)) }}\n onPointerUp={commitStop}\n onKeyUp={commitStop}\n onBlur={commitStop}\n />\n <span style={valueStyle}>{value}</span>\n <button\n type=\"button\"\n disabled={disabled}\n aria-label={t('input.context.custom')}\n aria-expanded={custom}\n title={t('input.context.custom')}\n style={{ ...glyphButtonStyle, cursor: disabled ? 'default' : 'pointer', opacity: disabled ? 0.55 : 1 }}\n onClick={() => { setCustom(open => !open); setError(null) }}\n >\n ⋯\n </button>\n <button\n type=\"button\"\n disabled={disabled || currentWindow === undefined}\n style={{\n ...actionButtonStyle,\n cursor: disabled || currentWindow === undefined ? 'default' : 'pointer',\n opacity: disabled || currentWindow === undefined ? 0.55 : 1,\n }}\n onClick={() => { setDraft(null); setError(null); setRaw(''); commitWindow(undefined) }}\n >\n {t('input.context.clear')}\n </button>\n </div>\n {custom\n ? (\n <div style={customRowStyle}>\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={raw}\n disabled={disabled}\n placeholder={t('input.context.customPlaceholder')}\n aria-label={t('input.context.customPlaceholder')}\n style={inputStyle}\n onChange={(event) => { setRaw(event.currentTarget.value) }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') applyCustom()\n }}\n />\n <button\n type=\"button\"\n disabled={disabled}\n style={{ ...actionButtonStyle, cursor: disabled ? 'default' : 'pointer', opacity: disabled ? 0.55 : 1 }}\n onClick={applyCustom}\n >\n {t('input.context.apply')}\n </button>\n {error !== null && <span style={errorStyle}>{error}</span>}\n </div>\n )\n : null}\n </div>\n </>\n )\n : null}\n </div>\n )\n}\n\nexport default ContextQuick\n","/**\n * Thinking-levels settings card — the family settings tab face of the\n * dsh-thinking-levels plugin.\n *\n * The card binds the `thinking-levels` settings namespace through the\n * `settingsScope` cordis service and renders its fields: the level picker\n * (off / on / minimal / low / medium / high / xhigh / max / auto) plus the\n * scheduler toggles. Every change commits immediately through the scope (no\n * staged form): the decision is read per model request, so a committed change\n * applies to the next request without a restart.\n *\n * Below the scheduler rows, a \"model capabilities\" block edits the\n * `llm-pi-ai` namespace directly (read + write through the same settings\n * transport), borrowing dsh-thinking-effort's presentation: providers group\n * their models, each model row shows capability badges and expands into a\n * per-level editor where a level is ticked and its gateway wire value entered\n * (e.g. `high` → `ultra`); `off` left empty means \"do not send\". A search box\n * filters models and one-click presets apply official/generic level sets to\n * every thinking model.\n *\n * Kept dependency-free beyond react: the scopes are subscribed with\n * `useSyncExternalStore`, and the controls are plain HTML so the client bundle\n * needs no CSS modules and no primitives value import.\n */\nimport { useState, useSyncExternalStore } from 'react'\nimport type { CSSProperties, JSX } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { SettingsScope } from './scope-face.ts'\nimport type { EffortId } from '../thinking-level.ts'\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\nimport type { ThinkingLevelsConfig } from '../index.ts'\n\n/** One injected face: the plugin's own scope plus the llm-pi-ai namespace scope. */\nexport interface ThinkingLevelsCardInjected {\n scope: SettingsScope<ThinkingLevelsConfig>\n /** The `llm-pi-ai` settings namespace, read and written for model capabilities. */\n piAiScope: SettingsScope<unknown>\n}\n\n/** Full props: locale seat + the injected scopes. */\nexport type ThinkingLevelsCardProps = PropsLocale<'thinking-levels'> & ThinkingLevelsCardInjected\n\n/** The user-facing levels, in picker order: eight standard levels plus the auto scheduler sentinel. */\nconst EFFORT_OPTIONS: readonly EffortId[] = [\n 'off', 'on', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'auto',\n]\n\n/**\n * The levels the capability editor offers. This is the llm-pi-ai\n * `reasoningEfforts` table-key space — pi-ai's fixed seven levels (schema\n * rejects any other key). `on` (the enable-thinking toggle) is a selector /\n * injection-level concept, expressed here by the `off` + `high` pair\n * (enable_thinking false/true), so it has no table key of its own.\n */\nconst CAPABILITY_LEVELS: readonly EffortId[] = [\n 'off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max',\n] as const\n\n/** One-click presets, mirroring dsh-thinking-effort: official DeepSeek style and a generic set. */\nconst PRESETS: readonly { key: 'official' | 'generic'; levels: Record<string, unknown> }[] = [\n { key: 'official', levels: { off: null, high: 'high', max: 'max' } },\n { key: 'generic', levels: { off: null, low: 'low', medium: 'medium', high: 'high' } },\n]\n\n/** The wire thinking formats offered (llm-pi-ai's nameable set, incl. qwen-chat-template). */\nconst THINKING_FORMATS = [\n 'openai', 'deepseek', 'openrouter', 'together', 'zai', 'qwen',\n 'qwen-chat-template', 'string-thinking', 'ant-ling',\n] as const\n\n/* ── shared row styling (inline; keeps the client bundle CSS-free) ──────── */\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '12px',\n padding: '6px 0',\n fontSize: '13px',\n lineHeight: '20px',\n}\n\nconst labelStyle: CSSProperties = { margin: 0, color: 'var(--dsw-alias-label-primary)' }\n\nconst controlStyle: CSSProperties = {\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-primary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '3px 8px',\n fontSize: '13px',\n}\n\nconst sectionStyle: CSSProperties = {\n marginTop: '14px',\n paddingTop: '12px',\n borderTop: '1px solid var(--dsw-alias-border-l2)',\n}\n\nconst fieldStyle: CSSProperties = { display: 'flex', flexDirection: 'column', gap: '4px' }\n\nconst fieldLabelStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\n\nconst hintStyle: CSSProperties = { margin: '6px 0 0', fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\n\n/** Provider group shell: an outlined row grouping its models. */\nconst providerStyle: CSSProperties = {\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '8px',\n margin: '8px 0 0',\n overflow: 'hidden',\n}\n\nconst providerHeadStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '7px 10px',\n background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,0.06))',\n}\n\nconst providerNameStyle: CSSProperties = {\n margin: 0,\n flex: '1 1 auto',\n minWidth: 0,\n fontFamily: 'var(--ds-font-family-code, monospace)',\n fontSize: '12px',\n lineHeight: '18px',\n fontWeight: 600,\n color: 'var(--dsw-alias-label-primary)',\n overflowWrap: 'anywhere',\n}\n\nconst providerBadgeStyle: CSSProperties = {\n margin: 0,\n fontSize: '10px',\n lineHeight: '16px',\n color: 'var(--dsw-alias-label-tertiary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '0 5px',\n whiteSpace: 'nowrap',\n}\n\nconst iconButtonStyle: CSSProperties = {\n background: 'none',\n border: 'none',\n color: 'var(--dsw-alias-label-tertiary)',\n cursor: 'pointer',\n padding: '2px 4px',\n display: 'inline-flex',\n alignItems: 'center',\n}\n\n/** One model row inside a provider group. */\nconst modelRowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '7px 10px',\n borderTop: '1px solid var(--dsw-alias-border-l2)',\n}\n\nconst modelIdStyle: CSSProperties = {\n margin: 0,\n flex: '1 1 auto',\n minWidth: 0,\n fontFamily: 'var(--ds-font-family-code, monospace)',\n fontSize: '12px',\n lineHeight: '18px',\n color: 'var(--dsw-alias-label-secondary)',\n overflowWrap: 'anywhere',\n}\n\n/** Capability badge chips (text / image / context). */\nconst badgeStyle: CSSProperties = {\n fontSize: '10px',\n lineHeight: '16px',\n color: 'var(--dsw-alias-label-tertiary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '0 5px',\n whiteSpace: 'nowrap',\n}\n\n/** The per-level editor grid: one row per level with a toggle, a label and a wire input. */\nconst levelRowStyle: CSSProperties = {\n display: 'grid',\n gridTemplateColumns: 'auto 92px minmax(0, 1fr)',\n alignItems: 'center',\n gap: '8px',\n padding: '4px 0',\n fontSize: '13px',\n}\n\nconst levelNameStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-secondary)' }\n\nconst wireInputStyle: CSSProperties = {\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-primary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '3px 8px',\n fontSize: '12px',\n width: '100%',\n boxSizing: 'border-box',\n}\n\n/* ── helpers over the llm-pi-ai user layer ─────────────────────────────── */\n\n/** A row's `reasoningEfforts` as stored in the user layer. */\nfunction effortsOf(model: Record<string, unknown>): false | Record<string, unknown> | undefined {\n const value = model['reasoningEfforts']\n if (value === false) return false\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n return value as Record<string, unknown>\n }\n return undefined\n}\n\n/**\n * Build a `reasoningEfforts` table from a level→wire draft. `off` maps to\n * `null` (omit the reasoning option → enable_thinking false) unless the user\n * typed a wire value; every other ticked level keeps its typed wire value.\n * pi-ai rejects a table offering nothing beyond `off`, so a selection of only\n * `off` falls back to the default `high` level.\n */\nfunction effortTableOf(draft: Record<string, string | null>): Record<string, unknown> {\n const table: Record<string, unknown> = {}\n for (const level of CAPABILITY_LEVELS) {\n const wire = draft[level]\n if (wire === undefined || wire === null) continue\n const trimmed = typeof wire === 'string' ? wire.trim() : ''\n if (level === 'off') table[level] = trimmed === '' ? null : trimmed\n else if (trimmed !== '') table[level] = trimmed\n }\n if (Object.keys(table).length === 0 || Object.keys(table).every(level => table[level] === null)) {\n return { ...table, high: 'high' }\n }\n return table\n}\n\n/** Whether a row declares `compat.supportsReasoningEffort` (the wire sends reasoning_effort). */\nfunction supportsEffortOf(model: Record<string, unknown>): boolean {\n const compat = model['compat']\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\n return (compat as Record<string, unknown>)['supportsReasoningEffort'] === true\n}\n\n/** Patch one row's `compat` object, merging rather than replacing sibling fields. */\nfunction patchCompat(\n row: Record<string, unknown>,\n patch: (compat: Record<string, unknown>) => void,\n): void {\n const compat = typeof row['compat'] === 'object' && row['compat'] !== null && !Array.isArray(row['compat'])\n ? { ...(row['compat'] as Record<string, unknown>) }\n : {}\n patch(compat)\n if (Object.keys(compat).length === 0) delete row['compat']\n else row['compat'] = compat\n}\n\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\n if (typeof snapshot !== 'object' || snapshot === null) return {}\n const user = (snapshot as { user?: unknown }).user\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\n const providers = (user as Record<string, unknown>)['providers']\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\n ? providers as Record<string, unknown>\n : {}\n}\n\n/** Whether a route-level profile declares `compat.supportsDeveloperRole: false`. */\nfunction developerRoleDisabledOf(profile: unknown): boolean {\n if (typeof profile !== 'object' || profile === null) return false\n const compat = (profile as Record<string, unknown>)['compat']\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\n return (compat as Record<string, unknown>)['supportsDeveloperRole'] === false\n}\n\n/** One flattened capability entry: a provider's model at an array index. */\ninterface CapabilityEntry {\n providerId: string\n index: number\n model: Record<string, unknown>\n modelId: string\n /** The provider-level `compat`, applied to models that declare none (display parity). */\n providerCompat?: unknown\n /** The provider-level `defaultInput`, applied to models that declare none (display parity). */\n providerInput?: unknown[]\n}\n\n/** The effective `compat` of an entry: its own `compat` merged over the provider-level `compat`. */\nfunction compatOf(entry: CapabilityEntry): Record<string, unknown> {\n const base = typeof entry.providerCompat === 'object' && entry.providerCompat !== null\n ? entry.providerCompat as Record<string, unknown>\n : {}\n const own = entry.model['compat']\n return typeof own === 'object' && own !== null && !Array.isArray(own)\n ? { ...base, ...(own as Record<string, unknown>) }\n : base\n}\n\n/** Flatten the user-layer providers into capability entries (models arrays only). */\nfunction entriesOf(providers: Record<string, unknown>): CapabilityEntry[] {\n return Object.entries(providers).flatMap(([providerId, profile]) => {\n const raw = profile as Record<string, unknown>\n const models = raw['models']\n if (!Array.isArray(models)) return []\n const providerCompat = raw['compat']\n const providerInput = Array.isArray(raw['defaultInput']) ? raw['defaultInput'] as unknown[] : undefined\n return models.map((model, index) => ({\n providerId,\n index,\n model: (typeof model === 'object' && model !== null && !Array.isArray(model)\n ? model as Record<string, unknown>\n : {}),\n modelId: typeof model === 'object' && model !== null && typeof (model as Record<string, unknown>)['id'] === 'string'\n ? (model as Record<string, unknown>)['id'] as string\n : `#${index + 1}`,\n providerCompat,\n providerInput,\n }))\n })\n}\n\n/** Human-readable capability summary of one entry (input modalities + declared context window). */\nfunction summaryOf(entry: CapabilityEntry): { text: boolean; image: boolean; context: string | null } {\n // Modalities fall back to the provider-level `defaultInput` so a vision\n // gateway declared once on the route shows every model as vision, matching\n // llm-pi-ai's resolution and the adapter's runtime gate.\n const input = Array.isArray(entry.model['input'])\n ? entry.model['input'] as unknown[]\n : entry.providerInput\n const text = !Array.isArray(input) || input.length === 0 || input.includes('text')\n const image = Array.isArray(input) && input.includes('image')\n const contextWindow = entry.model['contextWindow']\n const context = typeof contextWindow === 'number' && Number.isFinite(contextWindow) && contextWindow > 0\n ? formatContextWindow(contextWindow)\n : null\n return { text, image, context }\n}\n\n/** A tiny inline chevron icon (no CSS modules). */\nfunction ChevronIcon({ open }: { open: boolean }): JSX.Element {\n return (\n <svg\n width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" aria-hidden\n style={{ transform: open ? 'rotate(180deg)' : 'none', transition: 'transform 0.16s' }}\n >\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )\n}\n\n/**\n * The llm-pi-ai model-capability editor block (dsh-thinking-effort style:\n * provider groups, model rows with badges, per-level wire editors, search and\n * one-click presets).\n * @param scope - the `llm-pi-ai` namespace scope.\n * @param t - copy lookup.\n * @param readonly - whether writes are forbidden.\n * @returns the capabilities block, or a placeholder when nothing is configured.\n */\nfunction ModelCapabilities(props: {\n scope: SettingsScope<unknown>\n t: (key: string) => string\n readonly: boolean\n}): JSX.Element {\n const { scope, t, readonly } = props\n const snapshot = useSyncExternalStore(\n (listener) => scope.subscribe(listener),\n () => scope.getSnapshot(),\n )\n const unavailable = snapshot.status === 'unavailable'\n const providers = snapshot.status === 'ready' ? providersOf(snapshot) : {}\n // Every llm-pi-ai provider is listed with its models — no list gating: the\n // official compat surface (dsh ≥ rc.8) means pi-ai serves every route\n // natively, so each model is editable right here.\n const allEntries = entriesOf(providers)\n\n // UI-only state: provider/model expansion, the wire drafts, and the query.\n const [query, setQuery] = useState('')\n const [expandedProviders, setExpandedProviders] = useState<Record<string, boolean>>({})\n const [expandedModels, setExpandedModels] = useState<Record<string, boolean>>({})\n const [drafts, setDrafts] = useState<Record<string, Record<string, string | null>>>({})\n const [busy, setBusy] = useState(false)\n const [contextRaw, setContextRaw] = useState<Record<string, string>>({})\n const [contextError, setContextError] = useState<Record<string, string>>({})\n\n const entryKey = (entry: CapabilityEntry): string => `${entry.providerId}\\u0000${entry.index}`\n\n /** Commit one patch over the user-layer providers. */\n const commitProviders = (mutate: (current: Record<string, unknown>) => Record<string, unknown>): void => {\n if (snapshot.status !== 'ready' || readonly) return\n setBusy(true)\n void scope.set('providers', mutate(structuredClone(providers)))\n .then(() => { setBusy(false) })\n .catch(() => { setBusy(false) })\n }\n\n /** Toggle the route-level official compat flag: unchecked = inherit (unset). */\n const toggleDeveloperRole = (providerId: string, next: boolean): void => {\n commitProviders((current) => {\n const profile = current[providerId] as Record<string, unknown> | undefined\n if (profile === undefined) return current\n const compat = typeof profile['compat'] === 'object' && profile['compat'] !== null && !Array.isArray(profile['compat'])\n ? { ...(profile['compat'] as Record<string, unknown>) }\n : {}\n if (next) compat['supportsDeveloperRole'] = false\n else delete compat['supportsDeveloperRole']\n if (Object.keys(compat).length === 0) delete profile['compat']\n else profile['compat'] = compat\n return current\n })\n }\n\n /** Patch one model row of one provider. */\n const patchModel = (\n providerId: string,\n index: number,\n patch: (model: Record<string, unknown>) => void,\n ): void => {\n commitProviders((current) => {\n const profile = current[providerId] as { models?: unknown[] } | undefined\n if (profile === undefined || !Array.isArray(profile.models)) return current\n const model = profile.models[index]\n if (typeof model !== 'object' || model === null) return current\n patch(model as Record<string, unknown>)\n return current\n })\n }\n\n /** Toggle whether a model is a thinking model (reasoningEfforts table vs false). */\n const toggleThinking = (entry: CapabilityEntry, next: boolean): void => {\n patchModel(entry.providerId, entry.index, (row) => {\n if (next) {\n // Thinking on: a table must exist so the wire drives enable_thinking /\n // reasoning_effort. Start from the persisted table or the default high\n // set; a toggle model (no effort) keeps supportsReasoningEffort false.\n const effortCapable = supportsEffortOf(row)\n row['reasoningEfforts'] = effortCapable\n ? effortTableOf({ high: 'high' })\n : { off: null, high: 'high' }\n // Toggle-style thinking models need the official qwen format so pi-ai\n // sends enable_thinking (early vLLM thinking models return no thinking\n // content without that flag, and reject reasoning_effort). Only fills\n // an absent format — an explicit choice is never clobbered.\n if (!effortCapable) {\n patchCompat(row, (compat) => {\n if (compat['thinkingFormat'] === undefined) compat['thinkingFormat'] = 'qwen-chat-template'\n })\n }\n } else {\n // Thinking off: a non-reasoning model never takes an effort.\n row['reasoningEfforts'] = false\n }\n })\n }\n\n /** Toggle whether a model accepts reasoning_effort levels. */\n const toggleEffortCapable = (entry: CapabilityEntry, next: boolean): void => {\n patchModel(entry.providerId, entry.index, (row) => {\n patchCompat(row, (compat) => {\n compat['supportsReasoningEffort'] = next\n // Counterpart of the auto-fill in toggleThinking: effort-capable rows\n // need reasoning_effort on the wire, so drop the toggle-style qwen\n // format when effort turns on (it would drive enable_thinking instead).\n if (next && compat['thinkingFormat'] === 'qwen-chat-template') delete compat['thinkingFormat']\n })\n })\n }\n\n /** Apply one model's wire draft as its `reasoningEfforts` table. */\n const applyDraft = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n const draft = drafts[key]\n if (draft === undefined) return\n const table = effortTableOf(draft)\n patchModel(entry.providerId, entry.index, (row) => {\n row['reasoningEfforts'] = table\n // Mark effort support only when the model already had it or the user\n // ticked a reasoning_effort-only level (minimal/low/medium/xhigh/max).\n // A toggle-only model (Qwen3.6: off/high = enable_thinking) must keep\n // supportsReasoningEffort false — flipping it would make the adapter\n // send a reasoning_effort the gateway rejects (400).\n const extended = Object.keys(table).some(level => level !== 'off' && level !== 'on' && level !== 'high')\n if (supportsEffortOf(row) || extended) {\n patchCompat(row, (compat) => {\n compat['supportsReasoningEffort'] = true\n })\n }\n })\n }\n\n /** Reset a model's draft to its persisted table (or the default high set). */\n const resetDraft = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setDrafts(current => {\n const next = { ...current }\n const table = effortsOf(entry.model)\n if (typeof table === 'object' && table !== null) {\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\n level,\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\n ]))\n } else {\n next[key] = { off: '', high: 'high' }\n }\n return next\n })\n }\n\n /** Seed a model's draft when it is first expanded. */\n const ensureDraft = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setDrafts(current => {\n if (current[key] !== undefined) return current\n const next = { ...current }\n const table = effortsOf(entry.model)\n if (typeof table === 'object' && table !== null) {\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\n level,\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\n ]))\n } else {\n next[key] = { off: '', high: 'high' }\n }\n return next\n })\n }\n\n /** Apply a one-click preset to every thinking model. */\n const applyPreset = (levels: Record<string, unknown>): void => {\n commitProviders((current) => {\n for (const entry of entriesOf(current)) {\n const profile = current[entry.providerId] as { models?: unknown[] } | undefined\n if (profile === undefined || !Array.isArray(profile.models)) continue\n const model = profile.models[entry.index]\n if (typeof model !== 'object' || model === null) continue\n const row = model as Record<string, unknown>\n if (effortsOf(row) === undefined) continue // only thinking models\n // Replace the table but never touch supportsReasoningEffort: a\n // toggle-only model (Qwen3.6) must stay Off/On (enable_thinking), so\n // the request guard keeps clamping any injected level to its default\n // strength instead of sending a reasoning_effort the gateway rejects.\n row['reasoningEfforts'] = levels\n }\n return current\n })\n }\n\n /** Seed a model's context-window input when it is first expanded. */\n const seedContext = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setContextRaw(current => {\n if (current[key] !== undefined) return current\n const value = entry.model['contextWindow']\n return {\n ...current,\n [key]: typeof value === 'number' && Number.isFinite(value) ? String(value) : '',\n }\n })\n }\n\n /** Write (or delete) a model's `contextWindow` in the llm-pi-ai entry. */\n const commitContextWindow = (entry: CapabilityEntry, value: number | undefined): void => {\n const key = entryKey(entry)\n patchModel(entry.providerId, entry.index, (row) => {\n if (value === undefined) delete row['contextWindow']\n else row['contextWindow'] = value\n })\n setContextError(current => {\n const next = { ...current }\n delete next[key]\n return next\n })\n }\n\n /** Apply one preset immediately. */\n const applyContextPreset = (entry: CapabilityEntry, value: number): void => {\n const key = entryKey(entry)\n setContextRaw(current => ({ ...current, [key]: String(value) }))\n commitContextWindow(entry, value)\n }\n\n /** Validate and commit the custom input (blur / Enter); empty clears it. */\n const applyContextInput = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n const raw = (contextRaw[key] ?? '').trim()\n if (raw === '') {\n commitContextWindow(entry, undefined)\n return\n }\n const validation = validateContextWindow(raw)\n if (!validation.ok) {\n setContextError(current => ({\n ...current,\n [key]: t(validation.reason === 'integer'\n ? 'card.capabilities.contextInteger'\n : 'card.capabilities.contextRange'),\n }))\n return\n }\n commitContextWindow(entry, validation.value)\n }\n\n /** Clear the model's context-window declaration (delete the field). */\n const clearContext = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setContextRaw(current => ({ ...current, [key]: '' }))\n commitContextWindow(entry, undefined)\n }\n\n if (unavailable) {\n return (\n <div style={sectionStyle}>\n <p style={hintStyle}>{t('card.capabilities.unavailable')}</p>\n </div>\n )\n }\n if (allEntries.length === 0) {\n return (\n <div style={sectionStyle}>\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\n <p style={hintStyle}>{t('card.capabilities.empty')}</p>\n </div>\n )\n }\n\n const needle = query.trim().toLowerCase()\n const visible = needle === ''\n ? allEntries\n : allEntries.filter(entry =>\n entry.modelId.toLowerCase().includes(needle)\n || entry.providerId.toLowerCase().includes(needle))\n const providerIds = [...new Set(visible.map(entry => entry.providerId))]\n\n return (\n <div style={sectionStyle}>\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\n <p style={hintStyle}>{t('card.capabilities.hint')}</p>\n\n {/* Search + one-click presets */}\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap', alignItems: 'center', margin: '8px 0 2px' }}>\n <input\n type=\"text\"\n value={query}\n placeholder={t('card.capabilities.search')}\n disabled={readonly || busy}\n style={{ ...controlStyle, flex: '1 1 160px', minWidth: '140px' }}\n onChange={(event) => setQuery(event.currentTarget.value)}\n />\n {PRESETS.map(preset => (\n <button\n key={preset.key}\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => applyPreset(preset.levels)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t(`card.capabilities.preset${preset.key === 'official' ? 'Official' : 'Generic'}`)}\n </button>\n ))}\n </div>\n\n {visible.length === 0\n ? <p style={hintStyle}>{t('card.capabilities.noMatches')}</p>\n : providerIds.map(providerId => {\n const providerEntries = visible.filter(entry => entry.providerId === providerId)\n const providerOpen = expandedProviders[providerId] === true || needle !== ''\n return (\n <div key={providerId} style={providerStyle}>\n <div style={providerHeadStyle}>\n <button\n type=\"button\"\n aria-expanded={providerOpen}\n disabled={readonly || busy}\n onClick={() => setExpandedProviders(current => ({\n ...current,\n [providerId]: current[providerId] !== true,\n }))}\n style={{\n ...iconButtonStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n }}\n title={providerOpen ? t('card.capabilities.collapseProvider') : t('card.capabilities.expandProvider')}\n >\n <ChevronIcon open={providerOpen} />\n </button>\n <p style={providerNameStyle}>{providerId}</p>\n <label\n style={{ display: 'inline-flex', alignItems: 'center', gap: '5px', fontSize: '11px', whiteSpace: 'nowrap', color: 'var(--dsw-alias-label-secondary)' }}\n title={t('card.capabilities.developerRoleHint')}\n >\n <input\n type=\"checkbox\"\n checked={developerRoleDisabledOf(providers[providerId])}\n disabled={readonly || busy}\n onChange={(event) => toggleDeveloperRole(providerId, event.currentTarget.checked)}\n />\n <span>{t('card.capabilities.developerRole')}</span>\n </label>\n <p style={providerBadgeStyle}>{providerEntries.length}</p>\n </div>\n {providerOpen\n ? providerEntries.map(entry => {\n const key = entryKey(entry)\n const modelOpen = expandedModels[key] === true\n const efforts = effortsOf(entry.model)\n const thinking = typeof efforts === 'object'\n // Display falls back to the provider-level `compat` so a\n // route-declared thinking/effort posture shows on every model.\n const compat = compatOf(entry)\n const supportsEffort = compat['supportsReasoningEffort'] === true\n const meta = summaryOf(entry)\n const format = typeof compat['thinkingFormat'] === 'string'\n ? compat['thinkingFormat']\n : undefined\n return (\n <div key={key}>\n <div style={modelRowStyle}>\n <button\n type=\"button\"\n aria-expanded={modelOpen}\n disabled={readonly || busy}\n onClick={() => {\n const next = expandedModels[key] !== true\n setExpandedModels(current => ({ ...current, [key]: next }))\n if (next) { ensureDraft(entry); seedContext(entry) }\n }}\n style={{\n ...iconButtonStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n }}\n title={modelOpen ? t('card.capabilities.closeModelSettings') : t('card.capabilities.openModelSettings')}\n >\n <ChevronIcon open={modelOpen} />\n </button>\n <p style={modelIdStyle}>{entry.modelId}</p>\n <span style={badgeStyle} title=\"text\">{meta.text ? 'T' : '–'}</span>\n <span style={badgeStyle} title=\"image\">{meta.image ? 'IMG' : '–'}</span>\n {meta.context !== null && <span style={badgeStyle}>{meta.context}</span>}\n {thinking && !supportsEffort && <span style={badgeStyle}>On/Off</span>}\n </div>\n {modelOpen\n ? (\n <div style={{ padding: '4px 10px 10px', borderTop: '1px solid var(--dsw-alias-border-l2)' }}>\n {/* Layer 1 — base capabilities: is it a thinking model? A vision model? */}\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', margin: '2px 0 8px' }}>\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\n <input\n type=\"checkbox\"\n checked={thinking}\n disabled={readonly || busy}\n onChange={(event) => toggleThinking(entry, event.currentTarget.checked)}\n />\n <span>{t('card.capabilities.thinking')}</span>\n </label>\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\n <input\n type=\"checkbox\"\n checked={meta.image}\n disabled={readonly || busy}\n onChange={(event) => {\n patchModel(entry.providerId, entry.index, (row) => {\n // Image input implies text input; the pair is written together.\n row['input'] = event.currentTarget.checked ? ['text', 'image'] : ['text']\n })\n }}\n />\n <span>{t('card.capabilities.vision')}</span>\n </label>\n </div>\n {/* Layer 2 — only for thinking models: does it take reasoning_effort levels? */}\n {thinking\n ? (\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px', margin: '0 0 8px' }}>\n <input\n type=\"checkbox\"\n checked={supportsEffort}\n disabled={readonly || busy}\n onChange={(event) => toggleEffortCapable(entry, event.currentTarget.checked)}\n />\n <span>{t('card.capabilities.supportsEffort')}</span>\n </label>\n )\n : null}\n {thinking && supportsEffort\n ? (\n <>\n {/* Per-level wire editor — only for effort-capable thinking models */}\n <p style={fieldLabelStyle}>{t('card.capabilities.efforts')}</p>\n <div style={{ margin: '4px 0 6px' }}>\n {CAPABILITY_LEVELS.map(level => {\n const wire = drafts[key]?.[level]\n const on = wire !== undefined && wire !== null\n return (\n <div key={level} style={levelRowStyle}>\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\n <input\n type=\"checkbox\"\n checked={on}\n disabled={readonly || busy}\n onChange={(event) => {\n const checked = event.currentTarget.checked\n setDrafts(current => {\n const draft = { ...(current[key] ?? {}) }\n draft[level] = checked\n ? (level === 'off' ? '' : level)\n : null\n return { ...current, [key]: draft }\n })\n }}\n />\n <span>{level}</span>\n </label>\n <span style={levelNameStyle}>{level === 'off' ? t('card.capabilities.offPlaceholder') : '→'}</span>\n <input\n type=\"text\"\n value={wire ?? ''}\n disabled={readonly || busy || !on}\n placeholder={t('card.capabilities.wirePlaceholder')}\n style={wireInputStyle}\n onChange={(event) => {\n setDrafts(current => {\n const draft = { ...(current[key] ?? {}) }\n draft[level] = event.currentTarget.value\n return { ...current, [key]: draft }\n })\n }}\n />\n </div>\n )\n })}\n </div>\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>\n <button\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => applyDraft(entry)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t('card.capabilities.applyLevel')}\n </button>\n <button\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => resetDraft(entry)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t('card.capabilities.restoreDefault')}\n </button>\n </div>\n </>\n )\n : null}\n {/* Layer 4 — thinking format (wire serialization) */}\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\n <label style={fieldStyle}>\n <span style={fieldLabelStyle}>{t('card.capabilities.thinkingFormat')}</span>\n <select\n style={controlStyle}\n value={format ?? 'inherit'}\n disabled={readonly || busy}\n onChange={(event) => {\n const next = event.currentTarget.value\n patchModel(entry.providerId, entry.index, (row) => {\n patchCompat(row, (compat) => {\n if (next === 'inherit') delete compat['thinkingFormat']\n else compat['thinkingFormat'] = next\n })\n })\n }}\n >\n <option value=\"inherit\">{t('card.capabilities.thinkingFormat.inherit')}</option>\n {THINKING_FORMATS.map(formatOption => (\n <option key={formatOption} value={formatOption}>{formatOption}</option>\n ))}\n </select>\n </label>\n </div>\n {/* Context-window limit: presets + custom integer (written to llm-pi-ai, live on next request) */}\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\n <label style={fieldStyle}>\n <span style={fieldLabelStyle}>{t('card.capabilities.contextWindow')}</span>\n <div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', alignItems: 'center' }}>\n {CONTEXT_WINDOW_PRESETS.map(preset => (\n <button\n key={preset.value}\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => applyContextPreset(entry, preset.value)}\n style={{\n ...controlStyle,\n padding: '2px 8px',\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {preset.label}\n </button>\n ))}\n <input\n type=\"text\"\n value={contextRaw[key] ?? ''}\n disabled={readonly || busy}\n placeholder={t('card.capabilities.contextCustomPlaceholder')}\n style={{ ...controlStyle, width: '120px' }}\n onChange={(event) => {\n const next = event.currentTarget.value\n setContextRaw(current => ({ ...current, [key]: next }))\n }}\n onBlur={() => applyContextInput(entry)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') event.currentTarget.blur()\n }}\n />\n <button\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => clearContext(entry)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t('card.capabilities.contextClear')}\n </button>\n </div>\n {contextError[key] !== undefined\n ? (\n <span style={{ margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-danger, #e5484d)' }}>\n {contextError[key]}\n </span>\n )\n : null}\n </label>\n </div>\n </div>\n )\n : null}\n </div>\n )\n })\n : null}\n </div>\n )\n })}\n {readonly ? <p style={hintStyle}>{t('card.readonly')}</p> : null}\n </div>\n )\n}\n\n/**\n * The card body, wrapped in a disclosure shell like every peer settings card:\n * a header (name + description + chevron) that toggles the body, collapsed by\n * default so the plugin tab stays a tidy list of drawers.\n * @param props - locale copy and the injected scopes.\n */\nexport function ThinkingLevelsCard({ t, scope, piAiScope }: ThinkingLevelsCardProps): JSX.Element {\n const [open, setOpen] = useState(false)\n const snapshot = useSyncExternalStore(\n (listener) => scope.subscribe(listener),\n () => scope.getSnapshot(),\n )\n const unavailable = snapshot.status === 'unavailable'\n const readonly = unavailable || !snapshot.writable\n // configForms serves the STORED doc: volatile fields arrive as plain values\n // (simplify() unwraps the live refs before persistence), so the card sees a\n // plain config shape even though the host-side type carries Volatile unions.\n const value = (snapshot.value ?? {}) as unknown as Partial<{\n enabled: boolean\n level: EffortId\n allowDowngrade: boolean\n allowUpgrade: boolean\n }>\n const level = EFFORT_OPTIONS.includes(value.level as EffortId) ? value.level as EffortId : 'auto'\n\n return (\n <div style={{\n border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))',\n background: 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))',\n borderRadius: '12px',\n transition: 'border-color 0.16s, background 0.16s',\n }}>\n <button\n type=\"button\"\n aria-expanded={open}\n style={{\n appearance: 'none',\n width: '100%',\n font: 'inherit',\n color: 'inherit',\n textAlign: 'left',\n cursor: 'pointer',\n background: 'none',\n border: 0,\n borderRadius: '12px',\n display: 'flex',\n alignItems: 'center',\n gap: '12px',\n padding: '14px 16px',\n }}\n onClick={() => { setOpen(current => !current) }}\n >\n <span style={{ flex: '1 1 0%', minWidth: 0 }}>\n <div style={{ fontSize: '14px', fontWeight: 600, color: 'var(--dsw-alias-label-primary)' }}>{t('card.title')}</div>\n <div style={{ color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))', fontSize: '13px', lineHeight: 1.5 }}>{t('card.description')}</div>\n </span>\n <svg\n width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden\n style={{\n color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))',\n flex: '0 0 auto',\n transition: 'transform 0.16s',\n transform: open ? 'rotate(180deg)' : 'none',\n }}\n >\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </button>\n {open\n ? (\n <div style={{ padding: '12px 16px' }}>\n {unavailable\n ? (\n <div style={{ fontSize: '13px', color: 'var(--dsw-alias-label-tertiary)' }}>\n {t('card.unavailable')}\n </div>\n )\n : (\n <>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-level\" style={labelStyle}>{t('card.level')}</label>\n <select\n id=\"plugin-config-thinking-levels-level\"\n value={level}\n disabled={readonly}\n style={controlStyle}\n onChange={(event) => { void scope.set('level', event.currentTarget.value as EffortId) }}\n >\n {EFFORT_OPTIONS.map((option) => (\n <option key={option} value={option}>{t(`card.level.${option}`)}</option>\n ))}\n </select>\n </div>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-enabled\" style={labelStyle}>{t('card.enabled')}</label>\n <input\n id=\"plugin-config-thinking-levels-enabled\"\n type=\"checkbox\"\n checked={value.enabled ?? true}\n disabled={readonly}\n onChange={(event) => { void scope.set('enabled', event.currentTarget.checked) }}\n />\n </div>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-downgrade\" style={labelStyle}>{t('card.allowDowngrade')}</label>\n <input\n id=\"plugin-config-thinking-levels-downgrade\"\n type=\"checkbox\"\n checked={value.allowDowngrade ?? true}\n disabled={readonly || value.level !== 'auto'}\n onChange={(event) => { void scope.set('allowDowngrade', event.currentTarget.checked) }}\n />\n </div>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-upgrade\" style={labelStyle}>{t('card.allowUpgrade')}</label>\n <input\n id=\"plugin-config-thinking-levels-upgrade\"\n type=\"checkbox\"\n checked={value.allowUpgrade ?? false}\n disabled={readonly || value.level !== 'auto'}\n onChange={(event) => { void scope.set('allowUpgrade', event.currentTarget.checked) }}\n />\n </div>\n {!snapshot.writable\n && <p style={{ margin: '8px 0 0', fontSize: '12px', color: 'var(--dsw-alias-label-tertiary)' }}>{t('card.readonly')}</p>}\n <ModelCapabilities scope={piAiScope} t={t} readonly={readonly} />\n </>\n )}\n </div>\n )\n : null}\n </div>\n )\n}\n","/**\n * FamilySettingsTab — the body of the plugin-family shared settings tab.\n *\n * Renders this plugin's own thinking-levels card, then the `dsh-family.tab`\n * child slot this tab entry declares: sibling plugins (session-guard first)\n * contribute their cards there via `ctx.slots.inject('dsh-family.tab', …)`.\n * The child slot renders nothing while no contributor is registered, so the\n * tab degrades to this plugin's card alone.\n */\nimport type { JSX, ReactNode } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { ThinkingLevelsCard, type ThinkingLevelsCardInjected } from './card.tsx'\n\n/** The framework-delivered child-slot dispatcher, narrowed to our one child key. */\ninterface FamilyRenderSlots {\n renderSlot(key: 'dsh-family.tab', owner?: object, opts?: { fallback?: ReactNode }): ReactNode\n}\n\n/** Full props: locale seat + injected card face + the child-slot dispatcher. */\nexport type FamilySettingsTabProps = PropsLocale<'thinking-levels'> & ThinkingLevelsCardInjected & FamilyRenderSlots\n\nexport function FamilySettingsTab(props: FamilySettingsTabProps): JSX.Element {\n const { renderSlot } = props\n return (\n <div style={{ display: 'grid', gap: '10px' }}>\n <ThinkingLevelsCard {...props} />\n {renderSlot('dsh-family.tab', {}, { fallback: null })}\n </div>\n )\n}\n","/**\n * dsh-thinking-levels — browser half.\n *\n * Registers the `thinking-levels` dictionaries and one composer tool-row\n * control (`conversation.input.right`) for the context-window quick editor.\n *\n * The plugin's own settings (default level, enable toggle, scheduler bounds)\n * have NO client registration since the DSH 0.1.7 line: the host renders the\n * Plugins settings form declaratively from the `.volatile()` fields of the\n * schema in src/index.ts, and the runtime values flow through the\n * `configForms` service keyed by the composition entry id. The former\n * per-plugin settings card was dropped with that migration (its seat no\n * longer exists in 0.1.7), including its llm-pi-ai model-capability editor —\n * the composer quick control below keeps serving the context-window edits.\n *\n * All @deepseek-ai/* imports are type-only: collaboration happens through\n * cordis services (`configForms`) and slot registration only (client bundle\n * purity).\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// DSH 0.1.5 moved the `ctx.slots` Context augmentation here (it used to live in\n// the retired `dsh-client-runtime` package): importing the client types restores\n// the typed `ctx.slots` member on the cordis Context surface.\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport { NS, en, ja, ko, zh } from './locales.ts'\nimport { ContextQuick, type ContextQuickInjected } from './context-quick.tsx'\nimport { FamilySettingsTab } from './family-tab.tsx'\nimport type { ThinkingLevelsCardInjected } from './card.tsx'\nimport type { ThinkingLevelsConfig } from '../index.ts'\n\n/**\n * The plugin-family shared settings tab. One `settings.plugins.tab` entry\n * (label 「起子插件设置」-style family brand) hosts this plugin's own card and\n * a declared child slot (`dsh-family.tab`) that sibling plugins contribute\n * their cards into — session-guard today, more later. Declaring is claiming\n * (ui-slots): the child slot exists exactly while this tab entry does, and a\n * contributor's `ctx.slots.inject('dsh-family.tab', …)` idles harmlessly if\n * this plugin is absent (an undischarged inject never blocks the client half).\n */\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface SlotMap {\n 'dsh-family.tab': { kind: 'list'; scope: 'root' }\n }\n}\n\n/** Services required by the browser half. */\nexport const inject = ['slots', 'locale', 'configForms']\n\n/**\n * Client plugin body: dictionaries plus the composer quick-control slot.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n const t = ctx.locale.bind(NS)\n // `register(ns, dicts)` is typed to the built-in locale ids (`zh` / `en`\n // only); the shipped `ja` / `ko` dictionaries go through the single-locale\n // overload, so they are installed and ready once DSH publishes those ids.\n ctx.effect(() => {\n const disposers = [\n ctx.locale.register(NS, { zh, en }),\n ctx.locale.register(NS, 'ja', ja),\n ctx.locale.register(NS, 'ko', ko),\n ]\n return () => { for (const dispose of disposers) dispose() }\n }, 'dsh-thinking-levels: dictionaries')\n\n // Composer tool row: one compact context-window control next to the\n // model/effort select (`conversation.input.right`, a session-scoped list seat\n // any plugin may occupy). It edits the current session model's `contextWindow`\n // live: custom gateways write the `llm-pi-ai` entry config (same config form\n // the card used), official DeepSeek models write the `llm-deepseek` entry\n // (its `models[].contextWindow`, else the provider default). The model card\n // itself is not an option: the shipped `ModelSelect` renders no slots, so a\n // plugin cannot contribute inside that popup.\n ctx.slots.inject('conversation.input.right', function* () {\n yield ctx.slots.register({\n name: 'conversation.input.right',\n id: 'context-window-quick',\n locale: NS,\n inject: (): ContextQuickInjected => {\n // Entry ids of the target plugins: each dsh llm plugin's composition\n // entry id matches its settings namespace (`llm-pi-ai` / `llm-deepseek`).\n const piAiScope = ctx.configForms.get<unknown>('llm-pi-ai')\n const deepseekScope = ctx.configForms.get<unknown>('llm-deepseek')\n return { piAiScope, deepseekScope }\n },\n }, ContextQuick)\n })\n\n // Family settings tab (see the SlotMap note above): this plugin's own card\n // first, then every contributor registered under `dsh-family.tab`.\n ctx.slots.inject('settings.plugins.tab', function* () {\n yield ctx.slots.register({\n name: 'settings.plugins.tab',\n id: 'dsh-family',\n order: 40,\n label: () => t('family.title'),\n locale: NS,\n inject: (): ThinkingLevelsCardInjected => ({\n scope: ctx.configForms.get<ThinkingLevelsConfig>('dsh-thinking-levels'),\n piAiScope: ctx.configForms.get<unknown>('llm-pi-ai'),\n }),\n children: { 'dsh-family.tab': { kind: 'list', scope: 'root' } },\n }, FamilySettingsTab)\n })\n}\n"],"mappings":";;;;;;;;;;;EAGA,MAAa,KAAK;;EAGlB,MAAa,KAAK;GAChB,cAAc;GACd,gBAAgB;GAChB,oBAAoB;GACpB,cAAc;GACd,kBAAkB;GAClB,iBAAiB;GACjB,sBAAsB;GACtB,kBAAkB;GAClB,qBAAqB;GACrB,mBAAmB;GACnB,oBAAoB;GACpB,kBAAkB;GAClB,mBAAmB;GACnB,gBAAgB;GAChB,uBAAuB;GACvB,qBAAqB;GACrB,oBAAoB;GACpB,iBAAiB;GACjB,qBAAqB;GACrB,0BAA0B;GAC1B,2BAA2B;GAC3B,iCAAiC;GACjC,0BAA0B;GAC1B,4BAA4B;GAC5B,+BAA+B;GAC/B,mCAAmC;GACnC,oCAAoC;GACpC,mCAAmC;GACnC,4BAA4B;GAC5B,mCAAmC;GACnC,uCAAuC;GACvC,oCAAoC;GACpC,sCAAsC;GACtC,uCAAuC;GACvC,wCAAwC;GACxC,4BAA4B;GAC5B,8BAA8B;GAC9B,oCAAoC;GACpC,6BAA6B;GAC7B,qCAAqC;GACrC,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C;EACH"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["rowStyle","labelStyle","providersOf","useSyncExternalStore","useState","useSyncExternalStore","useState","useState"],"sources":["../src/client/locales.ts","../src/context-window.ts","../src/client/context-quick.tsx","../src/client/card.tsx","../src/client/family-tab.tsx","../src/client/index.ts"],"sourcesContent":["/** `thinking-levels` client dictionaries (zh / en / ja / ko). */\n\n/** Dictionary namespace owned by this plugin. */\nexport const NS = 'thinking-levels'\n\n/** Simplified Chinese dictionary (the key-set source of truth). */\nexport const zh = {\n 'card.title': '思考档位',\n 'family.title': '起子插件设置',\n 'card.description': '在模型选择器中可选 Auto(mask):按工具调用历史自动在 low / high / max 间调度后提交 API。此处配置默认档位、调度边界与模型能力(档位 → 网关线上值映射)。',\n 'card.level': '默认档位',\n 'card.level.off': 'off — 关闭思考(仅手动,永不自动选择)',\n 'card.level.on': 'on — 开启思考(仅 toggle 型模型;只发 enable_thinking,不发 effort)',\n 'card.level.minimal': 'minimal — 最低(极轻任务)',\n 'card.level.low': 'low — 低(简单任务,廉价轮保持廉价)',\n 'card.level.medium': 'medium — 中',\n 'card.level.high': 'high — 高(官方默认)',\n 'card.level.xhigh': 'xhigh — 特高',\n 'card.level.max': 'max — 最大(重任务)',\n 'card.level.auto': 'auto — 按工具历史自动调度(默认)',\n 'card.enabled': '启用',\n 'card.allowDowngrade': '允许降档(auto 可降至 low)',\n 'card.allowUpgrade': '允许升档(auto 可升至 max)',\n 'card.unavailable': '设置命名空间不可用:请确认 dsh-thinking-levels 已装配进 profile。',\n 'card.readonly': '只读',\n 'card.capabilities': '模型能力(llm-pi-ai 自定义提供方)',\n 'card.capabilities.hint': '直接读写 llm-pi-ai 配置:勾选档位并填写发送给网关的线上值(例如 high → ultra);off 留空表示不发送。视觉决定图片输入;思考开关决定 enable_thinking 置位;thinkingFormat 决定 wire 序列化格式。',\n 'card.capabilities.empty': 'llm-pi-ai 中没有已配置模型的自定义提供方。请先在「设置 → 模型」添加提供方与模型。',\n 'card.capabilities.unavailable': 'llm-pi-ai 设置命名空间不可用。',\n 'card.capabilities.none': '(无模型)',\n 'card.capabilities.search': '搜索模型(名称或 ID)…',\n 'card.capabilities.noMatches': '没有匹配的模型',\n 'card.capabilities.quickSettings': '一键设置',\n 'card.capabilities.presetOfficial': '应用到全部:Off / High / Max(官方 DeepSeek 风格)',\n 'card.capabilities.presetGeneric': '应用到全部:Off / Low / Medium / High(通用)',\n 'card.capabilities.vendor': '提供方',\n 'card.capabilities.developerRole': '网关不支持 developer 角色',\n 'card.capabilities.developerRoleHint': '官方兼容开关(dsh ≥ v0.1.0-rc.8):写入路由级 compat.supportsDeveloperRole: false,系统提示词按 system 角色发送,修复 vLLM / SGLang 等网关的 Unexpected message role 400。取消勾选 = 删除该字段、恢复继承。',\n 'card.capabilities.expandProvider': '展开提供方',\n 'card.capabilities.collapseProvider': '收起提供方',\n 'card.capabilities.openModelSettings': '打开模型设置',\n 'card.capabilities.closeModelSettings': '收起模型设置',\n 'card.capabilities.vision': '视觉模型',\n 'card.capabilities.thinking': '思考模型',\n 'card.capabilities.supportsEffort': '支持 think effort',\n 'card.capabilities.efforts': '思考档位(勾选后填写线上值)',\n 'card.capabilities.wirePlaceholder': '线上值,如 ultra',\n 'card.capabilities.offPlaceholder': '留空 = 不发送',\n 'card.capabilities.atLeastThinking': '至少需要一个思考档位(off 除外)',\n 'card.capabilities.applyLevel': '应用此档位',\n 'card.capabilities.restoreDefault': '恢复默认档位',\n 'card.capabilities.unsaved': '未保存',\n 'card.capabilities.saveChanges': '保存更改',\n 'card.capabilities.saved': '已保存',\n 'card.capabilities.thinkingFormat': '思考格式',\n 'card.capabilities.thinkingFormat.inherit': '继承',\n 'card.capabilities.contextWindow': '上下文窗口上限',\n 'card.capabilities.contextCustomPlaceholder': '自定义整数,如 256000',\n 'card.capabilities.contextClear': '清除',\n 'card.capabilities.contextInteger': '上下文长度必须是整数(2000-1000000)',\n 'card.capabilities.contextRange': '上下文长度必须在 2000 到 1000000 之间',\n 'card.capabilities.contextHint': '选择预设或输入整数(2000–1000000),写入 llm-pi-ai 供上下文压力/压缩使用,无需重启即对下一请求生效。',\n 'input.context.title': '上下文窗口',\n 'input.context.globalHint': '全局生效:作用于所有使用该模型的会话(清除可恢复默认)',\n 'input.context.unset': '未设',\n 'input.context.custom': '自定义',\n 'input.context.noModel': '暂无会话模型',\n 'input.context.customPlaceholder': '自定义整数,如 256000',\n 'input.context.apply': '应用',\n 'input.context.clear': '清除',\n 'input.context.integer': '上下文长度必须是整数(2000-1000000)',\n 'input.context.range': '上下文长度必须在 2000 到 1000000 之间',\n 'card.capabilities.failed': '保存失败:配置被拒绝或冲突,请检查值。',\n} satisfies Record<string, string>\n\n/** English dictionary (keys mirror zh). */\nexport const en: Record<keyof typeof zh, string> = {\n 'card.title': 'Thinking Levels',\n 'family.title': 'Qizi Plugin Settings',\n 'card.description': 'Pick Auto in the model selector: the plugin schedules low / high / max per tool round before submitting the API effort. Here you configure the default level, scheduler bounds, and per-model capabilities (level → gateway wire value mapping).',\n 'card.level': 'Default level',\n 'card.level.off': 'off — disable thinking (manual only, never auto-picked)',\n 'card.level.on': 'on — enable thinking (toggle-only models only; sends enable_thinking, never an effort)',\n 'card.level.minimal': 'minimal — least (very light tasks)',\n 'card.level.low': 'low — cheap rounds stay cheap',\n 'card.level.medium': 'medium — medium',\n 'card.level.high': 'high — the official default',\n 'card.level.xhigh': 'xhigh — extra high',\n 'card.level.max': 'max — heavy work',\n 'card.level.auto': 'auto — schedule from tool history (default)',\n 'card.enabled': 'Enabled',\n 'card.allowDowngrade': 'Allow downgrade (auto may drop to low)',\n 'card.allowUpgrade': 'Allow upgrade (auto may lift to max)',\n 'card.unavailable': 'Settings namespace unavailable: make sure dsh-thinking-levels is assembled into this profile.',\n 'card.readonly': 'Read-only',\n 'card.capabilities': 'Model capabilities (llm-pi-ai custom providers)',\n 'card.capabilities.hint': 'Reads and writes the llm-pi-ai config directly: tick a level and enter the exact value sent to the gateway (e.g. high → ultra); leaving off empty means “do not send”. Vision gates image input; the thinking toggle drives enable_thinking; thinkingFormat picks the wire serialization.',\n 'card.capabilities.empty': 'No custom provider has models configured in llm-pi-ai. Add a provider and models under Settings → Models first.',\n 'card.capabilities.unavailable': 'The llm-pi-ai settings namespace is unavailable.',\n 'card.capabilities.none': '(no models)',\n 'card.capabilities.search': 'Search models by name or ID…',\n 'card.capabilities.noMatches': 'No matching models',\n 'card.capabilities.quickSettings': 'Quick settings',\n 'card.capabilities.presetOfficial': 'Apply to all: Off / High / Max (official DeepSeek style)',\n 'card.capabilities.presetGeneric': 'Apply to all: Off / Low / Medium / High (generic)',\n 'card.capabilities.vendor': 'Provider',\n 'card.capabilities.developerRole': 'Gateway rejects the developer role',\n 'card.capabilities.developerRoleHint': 'Official compat switch (dsh ≥ v0.1.0-rc.8): writes route-level compat.supportsDeveloperRole: false so the system prompt is sent as role system — fixes the Unexpected message role 400 on vLLM / SGLang gateways. Unchecking deletes the field and restores inheritance.',\n 'card.capabilities.expandProvider': 'Expand provider',\n 'card.capabilities.collapseProvider': 'Collapse provider',\n 'card.capabilities.openModelSettings': 'Open model settings',\n 'card.capabilities.closeModelSettings': 'Collapse model settings',\n 'card.capabilities.vision': 'Vision model',\n 'card.capabilities.thinking': 'Thinking model',\n 'card.capabilities.supportsEffort': 'Supports think effort',\n 'card.capabilities.efforts': 'Thinking effort levels (tick, then enter the wire value)',\n 'card.capabilities.wirePlaceholder': 'Wire value, e.g. ultra',\n 'card.capabilities.offPlaceholder': 'Empty = do not send',\n 'card.capabilities.atLeastThinking': 'Select at least one thinking level (other than off)',\n 'card.capabilities.applyLevel': 'Apply levels',\n 'card.capabilities.restoreDefault': 'Restore defaults',\n 'card.capabilities.unsaved': 'Unsaved',\n 'card.capabilities.saveChanges': 'Save changes',\n 'card.capabilities.saved': 'Saved',\n 'card.capabilities.thinkingFormat': 'Thinking format',\n 'card.capabilities.thinkingFormat.inherit': 'Inherit',\n 'card.capabilities.contextWindow': 'Context window limit',\n 'card.capabilities.contextCustomPlaceholder': 'Custom integer, e.g. 256000',\n 'card.capabilities.contextClear': 'Clear',\n 'card.capabilities.contextInteger': 'Context length must be an integer (2000-1000000)',\n 'card.capabilities.contextRange': 'Context length must be between 2000 and 1000000',\n 'card.capabilities.contextHint': 'Pick a preset or enter an integer (2000–1000000); written to llm-pi-ai for context pressure/compaction and applied to the next request without a restart.',\n 'input.context.title': 'Context window',\n 'input.context.globalHint': 'Applies globally to every session using this model (Clear restores the default)',\n 'input.context.unset': 'Unset',\n 'input.context.custom': 'Custom',\n 'input.context.noModel': 'No session model yet',\n 'input.context.customPlaceholder': 'Custom integer, e.g. 256000',\n 'input.context.apply': 'Apply',\n 'input.context.clear': 'Clear',\n 'input.context.integer': 'Context length must be an integer (2000-1000000)',\n 'input.context.range': 'Context length must be between 2000 and 1000000',\n 'card.capabilities.failed': 'Save failed: the value was rejected or conflicted. Check it.',\n}\n\n/** Japanese dictionary (keys mirror zh). */\nexport const ja: Record<keyof typeof zh, string> = {\n 'card.title': '思考レベル',\n 'family.title': '起子プラグイン設定',\n 'card.description': 'モデルセレクターで Auto(マスク)を選択すると、ツール呼び出し履歴から low / high / max を自動スケジュールして API に送信します。ここでは既定レベル、スケジューラーの境界、モデル能力(レベル → ゲートウェイ送信値のマッピング)を設定します。',\n 'card.level': '既定レベル',\n 'card.level.off': 'off — 思考を無効化(手動のみ、自動選択はされません)',\n 'card.level.on': 'on — 思考を有効化(トグルのみのモデル向け。enable_thinking のみ送信、effort は送信しません)',\n 'card.level.minimal': 'minimal — 最小(非常に軽いタスク)',\n 'card.level.low': 'low — 低(軽いラウンドは軽いまま)',\n 'card.level.medium': 'medium — 中',\n 'card.level.high': 'high — 高(公式既定値)',\n 'card.level.xhigh': 'xhigh — 特高',\n 'card.level.max': 'max — 最大(重いタスク)',\n 'card.level.auto': 'auto — ツール履歴から自動スケジュール(既定)',\n 'card.enabled': '有効',\n 'card.allowDowngrade': '降格を許可(auto は low まで下げられる)',\n 'card.allowUpgrade': '昇格を許可(auto は max まで上げられる)',\n 'card.unavailable': '設定名前空間が利用できません:dsh-thinking-levels が profile に組み込まれているか確認してください。',\n 'card.readonly': '読み取り専用',\n 'card.capabilities': 'モデル能力(llm-pi-ai カスタムプロバイダー)',\n 'card.capabilities.hint': 'llm-pi-ai 設定を直接読み書きします:レベルにチェックを入れ、ゲートウェイに送信する値を入力(例:high → ultra)。off を空欄にすると送信しません。視覚は画像入力を決定、思考トグルは enable_thinking を制御、thinkingFormat は wire シリアライズ形式を選択します。',\n 'card.capabilities.empty': 'llm-pi-ai にモデルが設定されたカスタムプロバイダーがありません。先に「設定 → モデル」でプロバイダーとモデルを追加してください。',\n 'card.capabilities.unavailable': 'llm-pi-ai の設定名前空間が利用できません。',\n 'card.capabilities.none': '(モデルなし)',\n 'card.capabilities.search': 'モデル名または ID で検索…',\n 'card.capabilities.noMatches': '一致するモデルがありません',\n 'card.capabilities.quickSettings': 'クイック設定',\n 'card.capabilities.presetOfficial': 'すべてに適用:Off / High / Max(公式 DeepSeek 形式)',\n 'card.capabilities.presetGeneric': 'すべてに適用:Off / Low / Medium / High(汎用)',\n 'card.capabilities.vendor': 'プロバイダー',\n 'card.capabilities.developerRole': 'ゲートウェイは developer ロール非対応',\n 'card.capabilities.developerRoleHint': '公式互換スイッチ(dsh ≥ v0.1.0-rc.8):ルートレベルの compat.supportsDeveloperRole: false を書き込み、システムプロンプトを system ロールで送信します。vLLM / SGLang などの Unexpected message role 400 を修正。チェックを外すとフィールドを削除し継承に戻します。',\n 'card.capabilities.expandProvider': 'プロバイダーを展開',\n 'card.capabilities.collapseProvider': 'プロバイダーを折りたたむ',\n 'card.capabilities.openModelSettings': 'モデル設定を開く',\n 'card.capabilities.closeModelSettings': 'モデル設定を折りたたむ',\n 'card.capabilities.vision': '視覚モデル',\n 'card.capabilities.thinking': '思考モデル',\n 'card.capabilities.supportsEffort': 'think effort をサポート',\n 'card.capabilities.efforts': '思考レベル(チェック後、送信値を入力)',\n 'card.capabilities.wirePlaceholder': '送信値(例:ultra)',\n 'card.capabilities.offPlaceholder': '空欄 = 送信しない',\n 'card.capabilities.atLeastThinking': '思考レベルを 1 つ以上選択してください(off 以外)',\n 'card.capabilities.applyLevel': 'レベルを適用',\n 'card.capabilities.restoreDefault': '既定値に戻す',\n 'card.capabilities.unsaved': '未保存',\n 'card.capabilities.saveChanges': '変更を保存',\n 'card.capabilities.saved': '保存済み',\n 'card.capabilities.thinkingFormat': '思考形式',\n 'card.capabilities.thinkingFormat.inherit': '継承',\n 'card.capabilities.contextWindow': 'コンテキストウィンドウ上限',\n 'card.capabilities.contextCustomPlaceholder': 'カスタム整数(例:256000)',\n 'card.capabilities.contextClear': 'クリア',\n 'card.capabilities.contextInteger': 'コンテキスト長は整数で入力してください(2000-1000000)',\n 'card.capabilities.contextRange': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\n 'card.capabilities.contextHint': 'プリセットを選ぶか整数を入力(2000–1000000)。llm-pi-ai に書き込まれ、コンテキスト圧力/圧縮に使用され、再起動なしで次のリクエストに反映されます。',\n 'input.context.title': 'コンテキストウィンドウ',\n 'input.context.globalHint': 'グローバルに有効:このモデルを使用するすべてのセッションに適用されます(クリアで既定値に戻ります)',\n 'input.context.unset': '未設定',\n 'input.context.custom': 'カスタム',\n 'input.context.noModel': 'セッションモデルがまだありません',\n 'input.context.customPlaceholder': 'カスタム整数(例:256000)',\n 'input.context.apply': '適用',\n 'input.context.clear': 'クリア',\n 'input.context.integer': 'コンテキスト長は整数で入力してください(2000-1000000)',\n 'input.context.range': 'コンテキスト長は 2000 から 1000000 の範囲で指定してください',\n 'card.capabilities.failed': '保存に失敗しました:値が拒否されたか競合しています。確認してください。',\n}\n\n/** Korean dictionary (keys mirror zh). */\nexport const ko: Record<keyof typeof zh, string> = {\n 'card.title': '사고 수준',\n 'family.title': '起子 플러그인 설정',\n 'card.description': '모델 선택기에서 Auto(마스크)를 선택하면 도구 호출 기록을 기반으로 low / high / max 를 자동 스케줄링하여 API에 제출합니다. 여기서 기본 수준, 스케줄러 경계, 모델 기능(수준 → 게이트웨이 전송 값 매핑)을 구성합니다.',\n 'card.level': '기본 수준',\n 'card.level.off': 'off — 사고 비활성화(수동 전용, 자동 선택 안 됨)',\n 'card.level.on': 'on — 사고 활성화(토글 전용 모델용. enable_thinking만 전송, effort는 전송하지 않음)',\n 'card.level.minimal': 'minimal — 최소(매우 가벼운 작업)',\n 'card.level.low': 'low — 낮음(가벼운 라운드는 가볍게 유지)',\n 'card.level.medium': 'medium — 중간',\n 'card.level.high': 'high — 높음(공식 기본값)',\n 'card.level.xhigh': 'xhigh — 특별히 높음',\n 'card.level.max': 'max — 최대(무거운 작업)',\n 'card.level.auto': 'auto — 도구 기록에서 자동 스케줄링(기본값)',\n 'card.enabled': '활성화',\n 'card.allowDowngrade': '다운그레이드 허용(auto가 low까지 내릴 수 있음)',\n 'card.allowUpgrade': '업그레이드 허용(auto가 max까지 올릴 수 있음)',\n 'card.unavailable': '설정 네임스페이스를 사용할 수 없습니다: dsh-thinking-levels가 이 profile에 조립되었는지 확인하세요.',\n 'card.readonly': '읽기 전용',\n 'card.capabilities': '모델 기능(llm-pi-ai 사용자 지정 제공자)',\n 'card.capabilities.hint': 'llm-pi-ai 설정을 직접 읽고 씁니다: 수준을 체크하고 게이트웨이에 보낼 값을 입력(예: high → ultra). off를 비워 두면 전송하지 않습니다. 시각은 이미지 입력을 결정하고, 사고 토글은 enable_thinking을 제어하며, thinkingFormat은 wire 직렬화 형식을 선택합니다.',\n 'card.capabilities.empty': 'llm-pi-ai에 모델이 구성된 사용자 지정 제공자가 없습니다. 먼저 「설정 → 모델」에서 제공자와 모델을 추가하세요.',\n 'card.capabilities.unavailable': 'llm-pi-ai 설정 네임스페이스를 사용할 수 없습니다.',\n 'card.capabilities.none': '(모델 없음)',\n 'card.capabilities.search': '모델 이름 또는 ID로 검색…',\n 'card.capabilities.noMatches': '일치하는 모델이 없습니다',\n 'card.capabilities.quickSettings': '빠른 설정',\n 'card.capabilities.presetOfficial': '전체에 적용: Off / High / Max(공식 DeepSeek 방식)',\n 'card.capabilities.presetGeneric': '전체에 적용: Off / Low / Medium / High(일반 방식)',\n 'card.capabilities.vendor': '제공자',\n 'card.capabilities.developerRole': '게이트웨이가 developer 역할 미지원',\n 'card.capabilities.developerRoleHint': '공식 호환 스위치(dsh ≥ v0.1.0-rc.8): 라우트 수준 compat.supportsDeveloperRole: false 를 기록하여 시스템 프롬프트를 system 역할로 전송합니다. vLLM / SGLang 등의 Unexpected message role 400 을 수정. 체크 해제 시 필드를 삭제하고 상속을 복원합니다.',\n 'card.capabilities.expandProvider': '제공자 펼치기',\n 'card.capabilities.collapseProvider': '제공자 접기',\n 'card.capabilities.openModelSettings': '모델 설정 열기',\n 'card.capabilities.closeModelSettings': '모델 설정 접기',\n 'card.capabilities.vision': '시각 모델',\n 'card.capabilities.thinking': '사고 모델',\n 'card.capabilities.supportsEffort': 'think effort 지원',\n 'card.capabilities.efforts': '사고 수준(체크 후 전송 값 입력)',\n 'card.capabilities.wirePlaceholder': '전송 값(예: ultra)',\n 'card.capabilities.offPlaceholder': '비워 둠 = 전송하지 않음',\n 'card.capabilities.atLeastThinking': '사고 수준을 하나 이상 선택하세요(off 제외)',\n 'card.capabilities.applyLevel': '수준 적용',\n 'card.capabilities.restoreDefault': '기본값 복원',\n 'card.capabilities.unsaved': '저장되지 않음',\n 'card.capabilities.saveChanges': '변경 사항 저장',\n 'card.capabilities.saved': '저장됨',\n 'card.capabilities.thinkingFormat': '사고 형식',\n 'card.capabilities.thinkingFormat.inherit': '상속',\n 'card.capabilities.contextWindow': '컨텍스트 창 상한',\n 'card.capabilities.contextCustomPlaceholder': '사용자 지정 정수(예: 256000)',\n 'card.capabilities.contextClear': '지우기',\n 'card.capabilities.contextInteger': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\n 'card.capabilities.contextRange': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\n 'card.capabilities.contextHint': '프리셋을 선택하거나 정수를 입력하세요(2000–1000000). llm-pi-ai에 기록되어 컨텍스트 압력/압축에 사용되며, 재시작 없이 다음 요청에 반영됩니다.',\n 'input.context.title': '컨텍스트 창',\n 'input.context.globalHint': '전역 적용: 이 모델을 사용하는 모든 세션에 적용됩니다(지우면 기본값 복원)',\n 'input.context.unset': '미설정',\n 'input.context.custom': '사용자 지정',\n 'input.context.noModel': '세션 모델이 아직 없습니다',\n 'input.context.customPlaceholder': '사용자 지정 정수(예: 256000)',\n 'input.context.apply': '적용',\n 'input.context.clear': '지우기',\n 'input.context.integer': '컨텍스트 길이는 정수여야 합니다 (2000-1000000)',\n 'input.context.range': '컨텍스트 길이는 2000에서 1000000 사이여야 합니다',\n 'card.capabilities.failed': '저장 실패: 값이 거부되었거나 충돌합니다. 확인하세요.',\n}\n","/**\n * Pure context-window helpers for the dsh-thinking-levels plugin.\n *\n * The context-window limit of a custom gateway model is declared in the\n * llm-pi-ai model entry (`contextWindow`, a positive integer). The harness\n * consumes it through `resolveModelInfo(...).context.contextWindow` for\n * compaction thresholds, context-overflow detection and context-pressure\n * projections — a settings write takes effect on the next request without a\n * restart. This module centralizes the legal range, the common presets and\n * the display formatting shared by the config schema, the settings card and\n * the tests. Kept dependency-free (pure inputs -> output).\n */\n\n/** Smallest accepted context window (tokens), aligned with dsh-thinking-effort. */\nexport const CONTEXT_WINDOW_MIN = 2000\n/** Largest accepted context window (tokens), e.g. third-party DeepSeek 1M. */\nexport const CONTEXT_WINDOW_MAX = 1_000_000\n\n/** One selectable context-window preset. */\nexport interface ContextWindowPreset {\n /** Human-readable label shown on the card button and the model badge. */\n label: string\n /** The token count written to the llm-pi-ai model entry. */\n value: number\n}\n\n/** The multi-level context-window presets, in ascending order. */\nexport const CONTEXT_WINDOW_PRESETS: readonly ContextWindowPreset[] = [\n { label: '64K', value: 64_000 },\n { label: '128K', value: 131_072 },\n { label: '256K', value: 256_000 },\n { label: '400K', value: 400_000 },\n { label: '512K', value: 524_288 },\n { label: '1M', value: 1_000_000 },\n] as const\n\n/** Format a token count as a readable label (exact presets keep their label). */\nexport function formatContextWindow(value: number): string {\n const preset = CONTEXT_WINDOW_PRESETS.find(candidate => candidate.value === value)\n if (preset !== undefined) return preset.label\n if (value >= CONTEXT_WINDOW_MAX) return '1M'\n if (value >= 1024) return `${Math.round(value / 1024)}K`\n return String(value)\n}\n\n/** The result of validating a context-window value. */\nexport type ContextWindowValidation =\n | { ok: true; value: number }\n | { ok: false; reason: 'integer' | 'range' }\n\n/**\n * Validate a context-window candidate (number or numeric string). Accepts only\n * base-10 integers inside [CONTEXT_WINDOW_MIN, CONTEXT_WINDOW_MAX]; anything\n * else (float, 'abc', '1e3', out-of-range) is rejected with a reason.\n */\nexport function validateContextWindow(value: unknown): ContextWindowValidation {\n const raw = typeof value === 'string' ? value.trim() : value\n const asString = typeof raw === 'string' ? raw : String(raw)\n if (!/^\\d+$/.test(asString)) return { ok: false, reason: 'integer' }\n const numeric = Number(asString)\n if (!Number.isSafeInteger(numeric)) return { ok: false, reason: 'integer' }\n if (numeric < CONTEXT_WINDOW_MIN || numeric > CONTEXT_WINDOW_MAX) {\n return { ok: false, reason: 'range' }\n }\n return { ok: true, value: numeric }\n}\n","/**\n * Context-window quick control for the composer tool row\n * (`conversation.input.right`, the seat just left of the model/effort select).\n *\n * Why this seat: the model *card* has no injection point (the shipped\n * `ModelSelect` calls `renderSlot` zero times and owns its popup outright), so a\n * plugin can only contribute inside the composer area. `conversation.input.right`\n * is a session-scoped `list` seat, which is where the harness lets any plugin put\n * a tool-row control. The trigger is a compact pill showing the committed value\n * only; the popover holds one slider row over the shared presets, a collapsed\n * custom-integer editor and Clear — no preset button grid.\n *\n * Model source: whichever session seat this harness provides, in order —\n * `useTrajectory` (the trajectory ledger's `requests`, DSH 0.1.2+) or\n * `useConversation` (`ConversationSnapshot.views.get('trajectory')`). Every\n * renderer standard seat is a `useSyncExternalStoreWithSelector` selector hook\n * and the selector is mandatory: calling one without a selector throws\n * `TypeError: <minified> is not a function` inside the binding shim and takes the\n * whole slot entry down. A harness that provides neither seat renders nothing\n * here instead of a dead control.\n *\n * Two model families are served, each with its own writable config form\n * (both consumed live by `resolveModelInfo(...).context.contextWindow`,\n * so a write takes effect on the next request without a restart):\n * - Custom gateways (`llm-pi-ai` providers): writes the model entry's\n * `contextWindow` under `providers[provider].models[i]`.\n * - Official DeepSeek models (`deepseek-official`, the `llm-deepseek`\n * entry): writes the catalog model's `contextWindow` when the model is\n * listed, otherwise caps via `defaultContextWindow`.\n *\n * Write discipline: dragging the slider only moves a local draft; the config\n * write happens once per gesture (pointer release, key release, blur), so a\n * drag never floods the host with intermediate values.\n *\n * Kept dependency-free beyond react + the injected scopes: plain HTML controls\n * with token-based inline styling, and validation reuses the shared\n * `validateContextWindow`.\n */\nimport { useState, useSyncExternalStore } from 'react'\nimport type { CSSProperties, JSX } from 'react'\nimport type { SettingsScope } from './scope-face.ts'\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\n\n/** The official DeepSeek provider route owned by the llm-deepseek adapter. */\nconst DEEPSEEK_PROVIDER = 'deepseek-official'\n/** llm-deepseek's native default context capacity (DEFAULT_CONTEXT_WINDOW). */\nconst DEEPSEEK_DEFAULT_WINDOW = 1_000_000\n/** Slider stop an unset window parks on: the thumb needs a position, the readout stays \"unset\". */\nconst UNSET_STOP_INDEX = CONTEXT_WINDOW_PRESETS.findIndex(preset => preset.value === 256_000)\n\n/** One injected face: the `llm-pi-ai` and `llm-deepseek` config forms. */\nexport interface ContextQuickInjected {\n /** The `llm-pi-ai` config form (custom gateway models). */\n piAiScope: SettingsScope<unknown>\n /** The `llm-deepseek` config form (official DeepSeek models). */\n deepseekScope: SettingsScope<unknown>\n}\n\n/** The narrow trajectory-view slice the component reads for provider/model. */\ninterface TrajectoryLike {\n requests?: readonly {\n purpose?: string\n prompt?: { config?: { provider?: string; model?: string } }\n }[]\n}\n\n/** The conversation snapshot face this component reads (views store only). */\ninterface ConversationLike {\n views?: { get?: (target: string) => unknown }\n}\n\n/**\n * One renderer standard seat: a `useSyncExternalStoreWithSelector`-bound\n * selector hook over a host observable. The selector is required — the kit\n * never defaults it (compare `useProjection`, which does).\n */\ntype SnapshotSelectorHook<Snapshot> = <Selected>(\n selector: (snapshot: Snapshot) => Selected,\n isEqual?: (a: Selected, b: Selected) => boolean,\n) => Selected\n\n/** Full props: injected scopes + the session standard seats + locale copy. */\nexport interface ContextQuickProps extends ContextQuickInjected {\n /** The session id of the slot's owning conversation (standard seat). */\n sessionId: string\n /** The session trajectory seat (DSH 0.1.2+); absent on a harness without it. */\n useTrajectory?: SnapshotSelectorHook<TrajectoryLike>\n /** The session conversation seat (legacy lines); absent on a harness without it. */\n useConversation?: SnapshotSelectorHook<ConversationLike>\n /** Locale copy thunk. */\n t: (key: string) => string\n}\n\n/* ── shared inline styling (no CSS modules in the client bundle) ───────── */\n\nconst pillStyle: CSSProperties = {\n display: 'inline-flex',\n alignItems: 'center',\n gap: '4px',\n height: '24px',\n padding: '0 8px',\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-secondary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '6px',\n fontSize: '11px',\n lineHeight: '16px',\n fontFamily: 'var(--ds-font-family-code, monospace)',\n cursor: 'pointer',\n whiteSpace: 'nowrap',\n}\n\nconst popStyle: CSSProperties = {\n position: 'absolute',\n bottom: 'calc(100% + 8px)',\n right: '0',\n zIndex: 1200,\n minWidth: '260px',\n padding: '10px',\n background: 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))',\n color: 'var(--dsw-alias-label-primary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '10px',\n boxShadow: '0 8px 28px rgba(0,0,0,0.18)',\n display: 'flex',\n flexDirection: 'column',\n gap: '8px',\n}\n\nconst backdropStyle: CSSProperties = { position: 'fixed', inset: 0, zIndex: 1199 }\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n fontSize: '12px',\n lineHeight: '18px',\n color: 'var(--dsw-alias-label-secondary)',\n}\n\nconst labelStyle: CSSProperties = {\n flex: '0 0 auto',\n minWidth: '0',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n color: 'var(--dsw-alias-label-tertiary)',\n}\n\nconst sliderStyle: CSSProperties = {\n flex: '1 1 auto',\n minWidth: '56px',\n height: '14px',\n margin: '0',\n accentColor: 'var(--dsw-alias-state-business-primary)',\n cursor: 'pointer',\n}\n\nconst valueStyle: CSSProperties = {\n flex: '0 0 auto',\n minWidth: '40px',\n textAlign: 'right',\n color: 'var(--dsw-alias-label-primary)',\n fontFamily: 'var(--ds-font-family-code, monospace)',\n fontVariantNumeric: 'tabular-nums',\n}\n\nconst glyphButtonStyle: CSSProperties = {\n flex: '0 0 auto',\n height: '18px',\n padding: '0 5px',\n border: '1px solid transparent',\n borderRadius: '4px',\n background: 'transparent',\n color: 'var(--dsw-alias-label-tertiary)',\n font: 'inherit',\n cursor: 'pointer',\n}\n\nconst actionButtonStyle: CSSProperties = {\n flex: '0 0 auto',\n height: '18px',\n padding: '0 6px',\n border: '1px solid transparent',\n borderRadius: '4px',\n background: 'transparent',\n color: 'var(--dsw-alias-label-secondary)',\n font: 'inherit',\n cursor: 'pointer',\n}\n\nconst customRowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '6px',\n}\n\nconst inputStyle: CSSProperties = {\n flex: '1 1 auto',\n minWidth: '0',\n boxSizing: 'border-box',\n padding: '2px 6px',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '5px',\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-primary)',\n font: 'inherit',\n}\n\nconst errorStyle: CSSProperties = {\n flex: '0 0 auto',\n color: 'var(--dsw-alias-danger, #e5484d)',\n}\n\n/* ── helpers over the settings user layer ──────────────────────────────── */\n\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\n if (typeof snapshot !== 'object' || snapshot === null) return {}\n const user = (snapshot as { user?: unknown }).user\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\n const providers = (user as Record<string, unknown>)['providers']\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\n ? providers as Record<string, unknown>\n : {}\n}\n\n/** The user-layer `models`/`defaultContextWindow` of the llm-deepseek namespace. */\nfunction deepseekSectionOf(snapshot: unknown): {\n models?: Record<string, unknown>[]\n defaultContextWindow?: number\n} {\n if (typeof snapshot !== 'object' || snapshot === null) return {}\n const user = (snapshot as { user?: unknown }).user\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\n const section = user as { models?: unknown; defaultContextWindow?: unknown }\n const models = Array.isArray(section.models)\n ? section.models.filter((model): model is Record<string, unknown> =>\n typeof model === 'object' && model !== null && !Array.isArray(model))\n : undefined\n const defaultContextWindow = typeof section.defaultContextWindow === 'number'\n ? section.defaultContextWindow\n : undefined\n return {\n ...models === undefined ? {} : { models },\n ...defaultContextWindow === undefined ? {} : { defaultContextWindow },\n }\n}\n\n/**\n * The stable trajectory-ledger selector (the `useTrajectory` seat): the seat\n * memoizes its selection on the selector reference, so it must not be a fresh\n * closure per render. The ledger is a store-owned array whose reference only\n * moves when the trajectory changes.\n * @param snapshot - the current trajectory snapshot.\n * @returns the request ledger.\n */\nconst selectRequests = (snapshot: TrajectoryLike): unknown => snapshot.requests\n\n/**\n * The stable trajectory-view selector (the `useConversation` seat): selecting\n * the view snapshot (a store-owned reference, not a derived object) keeps the\n * selected value stable between snapshots — a selector that built a new object\n * would re-render forever.\n * @param snapshot - the current conversation snapshot.\n * @returns the trajectory view snapshot, absent while the view is unregistered.\n */\nconst selectTrajectory = (snapshot: ConversationLike): unknown => snapshot.views?.get?.('trajectory')\n\n/**\n * The current session's active model, taken from the trajectory ledger's\n * latest assistant request prompt config. Absent for a blank session (no\n * request yet) — the control then renders disabled.\n * @param source - the request ledger, or a trajectory snapshot carrying it.\n * @returns the provider/model pair, or undefined when the ledger has none.\n */\nfunction activeModelOf(source: unknown): { provider: string; model: string } | undefined {\n const requests = Array.isArray(source)\n ? source as TrajectoryLike['requests'] ?? []\n : typeof source === 'object' && source !== null\n ? (source as TrajectoryLike).requests ?? []\n : []\n for (let index = requests.length - 1; index >= 0; index -= 1) {\n const config = requests[index]?.prompt?.config\n if (requests[index]?.purpose === 'assistant'\n && typeof config?.provider === 'string'\n && typeof config?.model === 'string') {\n return { provider: config.provider, model: config.model }\n }\n }\n return undefined\n}\n\n/** One model entry's declared contextWindow, when present. */\nfunction contextWindowOf(model: Record<string, unknown>): number | undefined {\n const value = model['contextWindow']\n return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : undefined\n}\n\n/**\n * The slider stop nearest to a committed token count; a window that matches no\n * preset still parks the thumb on its closest stop.\n * @param value - the committed context window, when one is set.\n * @returns the stop index, or the unset park position.\n */\nfunction stopIndexOf(value: number | undefined): number {\n if (value === undefined) return UNSET_STOP_INDEX\n let best = 0\n let bestDistance = Number.POSITIVE_INFINITY\n CONTEXT_WINDOW_PRESETS.forEach((preset, index) => {\n const distance = Math.abs(preset.value - value)\n if (distance < bestDistance) {\n bestDistance = distance\n best = index\n }\n })\n return best\n}\n\n/**\n * The composer context-window quick control. Renders nothing when this harness\n * provides neither session seat, so a missing seat never leaves a dead control\n * (or a crash) in the tool row.\n * @param props - injected scopes, session standard seats, copy.\n */\nexport function ContextQuick(props: ContextQuickProps): JSX.Element | null {\n // The seat choice is a prop fact fixed for this registration, and each branch\n // renders a component that calls exactly one hook unconditionally.\n if (typeof props.useTrajectory === 'function') {\n return <TrajectoryBound {...props} useTrajectory={props.useTrajectory} />\n }\n if (typeof props.useConversation === 'function') {\n return <ConversationBound {...props} useConversation={props.useConversation} />\n }\n return null\n}\n\n/**\n * The trajectory-seat binding (DSH 0.1.2+).\n * @param props - the control props plus the present trajectory seat.\n */\nfunction TrajectoryBound(\n { useTrajectory, ...rest }: ContextQuickProps & { useTrajectory: SnapshotSelectorHook<TrajectoryLike> },\n): JSX.Element {\n return <ContextQuickView {...rest} active={activeModelOf(useTrajectory(selectRequests))} />\n}\n\n/**\n * The conversation-seat binding (harness lines without the trajectory seat).\n * @param props - the control props plus the present conversation seat.\n */\nfunction ConversationBound(\n { useConversation, ...rest }: ContextQuickProps & { useConversation: SnapshotSelectorHook<ConversationLike> },\n): JSX.Element {\n return <ContextQuickView {...rest} active={activeModelOf(useConversation(selectTrajectory))} />\n}\n\n/**\n * The bound control: a value pill that opens a one-row slider popover\n * (preset slider, committed value, collapsed custom-integer editor, Clear).\n * Custom gateways and official DeepSeek models are both supported (see module\n * doc for the namespace each writes).\n * @param props - injected scopes, the resolved active model, copy.\n */\nfunction ContextQuickView(\n { active, piAiScope, deepseekScope, t }:\n ContextQuickInjected & { active: { provider: string; model: string } | undefined; t: (key: string) => string },\n): JSX.Element {\n const official = active !== undefined && active.provider === DEEPSEEK_PROVIDER\n\n const piSnapshot = useSyncExternalStore(\n (listener) => piAiScope.subscribe(listener),\n () => piAiScope.getSnapshot(),\n )\n const dsSnapshot = useSyncExternalStore(\n (listener) => deepseekScope.subscribe(listener),\n () => deepseekScope.getSnapshot(),\n )\n const snapshot = official ? dsSnapshot : piSnapshot\n const unavailable = snapshot.status === 'unavailable'\n const readonly = unavailable || !snapshot.writable\n const providers = official ? {} : providersOf(piSnapshot)\n const dsSection = official ? deepseekSectionOf(dsSnapshot) : undefined\n\n // Resolve the effective window and whether a write target exists.\n let currentWindow: number | undefined\n let writableTarget = false\n if (official && active !== undefined) {\n const models = dsSection?.models ?? []\n const index = models.findIndex(model => model['id'] === active.model)\n currentWindow = index >= 0 ? contextWindowOf(models[index]) : undefined\n if (currentWindow === undefined) currentWindow = dsSection?.defaultContextWindow\n writableTarget = true\n } else if (active !== undefined) {\n const profile = providers[active.provider] as { models?: unknown[] } | undefined\n const model = profile !== undefined && Array.isArray(profile.models)\n ? profile.models.find((candidate): candidate is Record<string, unknown> =>\n typeof candidate === 'object' && candidate !== null && (candidate as Record<string, unknown>)['id'] === active.model)\n : undefined\n currentWindow = model === undefined ? undefined : contextWindowOf(model)\n writableTarget = model !== undefined\n }\n\n // UI-only state: the popover, the uncommitted stop, the custom draft and its error.\n const [open, setOpen] = useState(false)\n const [draft, setDraft] = useState<number | null>(null)\n const [custom, setCustom] = useState(false)\n const [raw, setRaw] = useState('')\n const [error, setError] = useState<string | null>(null)\n const [busy, setBusy] = useState(false)\n\n const disabled = readonly || busy || active === undefined || !writableTarget\n const stop = draft ?? stopIndexOf(currentWindow)\n\n /** Commit (or delete) the active model's context window. */\n const commitWindow = (value: number | undefined): void => {\n if (active === undefined || snapshot.status !== 'ready' || !writableTarget) {\n setDraft(null)\n return\n }\n setBusy(true)\n if (official) {\n // Official DeepSeek: cap the catalog model when listed, else the provider default.\n const models = (deepseekSectionOf(dsSnapshot).models ?? []).map(model => ({ ...model }))\n const index = models.findIndex(model => model['id'] === active.model)\n const commit = index >= 0\n ? deepseekScope.set('models', models.map((model, at) => {\n if (at !== index) return model\n if (value === undefined) {\n const rest = { ...model }\n delete rest['contextWindow']\n return rest\n }\n return { ...model, contextWindow: value }\n }))\n : deepseekScope.set('defaultContextWindow', value === undefined ? DEEPSEEK_DEFAULT_WINDOW : value)\n commit.then(() => { setBusy(false); setDraft(null) }).catch(() => { setBusy(false); setDraft(null) })\n return\n }\n const next = structuredClone(providers)\n const profile = next[active.provider] as { models?: unknown[] } | undefined\n const entry = profile?.models?.find(candidate =>\n typeof candidate === 'object' && candidate !== null && (candidate as Record<string, unknown>)['id'] === active.model)\n if (entry === undefined) {\n setBusy(false)\n setDraft(null)\n return\n }\n if (value === undefined) delete (entry as Record<string, unknown>)['contextWindow']\n else (entry as Record<string, unknown>)['contextWindow'] = value\n void piAiScope.set('providers', next)\n .then(() => { setBusy(false); setDraft(null) })\n .catch(() => { setBusy(false); setDraft(null) })\n }\n\n /** Write the stop the gesture landed on; a drag only moves the draft. */\n const commitStop = (): void => {\n if (disabled || draft === null) return\n commitWindow(CONTEXT_WINDOW_PRESETS[draft]?.value)\n }\n\n /** Validate and commit the custom input; empty clears. */\n const applyCustom = (): void => {\n const trimmed = raw.trim()\n if (trimmed === '') {\n setError(null)\n commitWindow(undefined)\n return\n }\n const validation = validateContextWindow(trimmed)\n if (!validation.ok) {\n setError(t(validation.reason === 'integer' ? 'input.context.integer' : 'input.context.range'))\n return\n }\n setError(null)\n commitWindow(validation.value)\n }\n\n const value = draft === null\n ? currentWindow === undefined ? t('input.context.unset') : formatContextWindow(currentWindow)\n : formatContextWindow(CONTEXT_WINDOW_PRESETS[draft]?.value ?? 0)\n\n return (\n <div style={{ position: 'relative' }}>\n <button\n type=\"button\"\n disabled={disabled}\n aria-expanded={open}\n aria-label={t('input.context.title')}\n title={active === undefined ? t('input.context.noModel') : `${active.provider}/${active.model}`}\n style={{\n ...pillStyle,\n cursor: disabled ? 'default' : 'pointer',\n opacity: disabled ? 0.55 : 1,\n }}\n onClick={() => { setOpen(value => !value); setError(null) }}\n >\n {value}\n </button>\n {open\n ? (\n <>\n <div style={backdropStyle} onClick={() => { setOpen(false); setError(null) }} />\n <div style={popStyle} role=\"group\" aria-label={t('input.context.title')}>\n <div style={rowStyle}>\n <span style={labelStyle} title={t('input.context.globalHint')}>{t('input.context.title')}</span>\n <input\n type=\"range\"\n min={0}\n max={CONTEXT_WINDOW_PRESETS.length - 1}\n step={1}\n value={stop}\n disabled={disabled}\n aria-label={t('input.context.title')}\n style={{ ...sliderStyle, cursor: disabled ? 'default' : 'pointer', opacity: disabled ? 0.55 : 1 }}\n onChange={(event) => { setDraft(Number(event.currentTarget.value)) }}\n onPointerUp={commitStop}\n onKeyUp={commitStop}\n onBlur={commitStop}\n />\n <span style={valueStyle}>{value}</span>\n <button\n type=\"button\"\n disabled={disabled}\n aria-label={t('input.context.custom')}\n aria-expanded={custom}\n title={t('input.context.custom')}\n style={{ ...glyphButtonStyle, cursor: disabled ? 'default' : 'pointer', opacity: disabled ? 0.55 : 1 }}\n onClick={() => { setCustom(open => !open); setError(null) }}\n >\n ⋯\n </button>\n <button\n type=\"button\"\n disabled={disabled || currentWindow === undefined}\n style={{\n ...actionButtonStyle,\n cursor: disabled || currentWindow === undefined ? 'default' : 'pointer',\n opacity: disabled || currentWindow === undefined ? 0.55 : 1,\n }}\n onClick={() => { setDraft(null); setError(null); setRaw(''); commitWindow(undefined) }}\n >\n {t('input.context.clear')}\n </button>\n </div>\n {custom\n ? (\n <div style={customRowStyle}>\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={raw}\n disabled={disabled}\n placeholder={t('input.context.customPlaceholder')}\n aria-label={t('input.context.customPlaceholder')}\n style={inputStyle}\n onChange={(event) => { setRaw(event.currentTarget.value) }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') applyCustom()\n }}\n />\n <button\n type=\"button\"\n disabled={disabled}\n style={{ ...actionButtonStyle, cursor: disabled ? 'default' : 'pointer', opacity: disabled ? 0.55 : 1 }}\n onClick={applyCustom}\n >\n {t('input.context.apply')}\n </button>\n {error !== null && <span style={errorStyle}>{error}</span>}\n </div>\n )\n : null}\n </div>\n </>\n )\n : null}\n </div>\n )\n}\n\nexport default ContextQuick\n","/**\n * Thinking-levels settings card — the family settings tab face of the\n * dsh-thinking-levels plugin.\n *\n * The card binds this plugin's entry config through the `configForms` cordis\n * service and renders its fields: the level picker\n * (off / on / minimal / low / medium / high / xhigh / max / auto) plus the\n * scheduler toggles. Every change commits immediately through the scope (no\n * staged form): the decision is read per model request, so a committed change\n * applies to the next request without a restart.\n *\n * Below the scheduler rows, a \"model capabilities\" block edits the\n * `llm-pi-ai` namespace directly (read + write through the same settings\n * transport), borrowing dsh-thinking-effort's presentation: providers group\n * their models, each model row shows capability badges and expands into a\n * per-level editor where a level is ticked and its gateway wire value entered\n * (e.g. `high` → `ultra`); `off` left empty means \"do not send\". A search box\n * filters models and one-click presets apply official/generic level sets to\n * every thinking model.\n *\n * Kept dependency-free beyond react: the scopes are subscribed with\n * `useSyncExternalStore`, and the controls are plain HTML so the client bundle\n * needs no CSS modules and no primitives value import.\n */\nimport { useState, useSyncExternalStore } from 'react'\nimport type { CSSProperties, JSX } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { SettingsScope } from './scope-face.ts'\nimport type { EffortId } from '../thinking-level.ts'\nimport { CONTEXT_WINDOW_PRESETS, formatContextWindow, validateContextWindow } from '../context-window.ts'\nimport type { ThinkingLevelsConfig } from '../index.ts'\n\n/** One injected face: the plugin's own scope plus the llm-pi-ai namespace scope. */\nexport interface ThinkingLevelsCardInjected {\n scope: SettingsScope<ThinkingLevelsConfig>\n /** The `llm-pi-ai` settings namespace, read and written for model capabilities. */\n piAiScope: SettingsScope<unknown>\n}\n\n/** Full props: locale seat + the injected scopes. */\nexport type ThinkingLevelsCardProps = PropsLocale<'thinking-levels'> & ThinkingLevelsCardInjected\n\n/** The user-facing levels, in picker order: eight standard levels plus the auto scheduler sentinel. */\nconst EFFORT_OPTIONS: readonly EffortId[] = [\n 'off', 'on', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'auto',\n]\n\n/**\n * The levels the capability editor offers. This is the llm-pi-ai\n * `reasoningEfforts` table-key space — pi-ai's fixed seven levels (schema\n * rejects any other key). `on` (the enable-thinking toggle) is a selector /\n * injection-level concept, expressed here by the `off` + `high` pair\n * (enable_thinking false/true), so it has no table key of its own.\n */\nconst CAPABILITY_LEVELS: readonly EffortId[] = [\n 'off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max',\n] as const\n\n/** One-click presets, mirroring dsh-thinking-effort: official DeepSeek style and a generic set. */\nconst PRESETS: readonly { key: 'official' | 'generic'; levels: Record<string, unknown> }[] = [\n { key: 'official', levels: { off: null, high: 'high', max: 'max' } },\n { key: 'generic', levels: { off: null, low: 'low', medium: 'medium', high: 'high' } },\n]\n\n/** The wire thinking formats offered (llm-pi-ai's nameable set, incl. qwen-chat-template). */\nconst THINKING_FORMATS = [\n 'openai', 'deepseek', 'openrouter', 'together', 'zai', 'qwen',\n 'qwen-chat-template', 'string-thinking', 'ant-ling',\n] as const\n\n/* ── shared row styling (inline; keeps the client bundle CSS-free) ──────── */\n\nconst rowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: '12px',\n padding: '6px 0',\n fontSize: '13px',\n lineHeight: '20px',\n}\n\nconst labelStyle: CSSProperties = { margin: 0, color: 'var(--dsw-alias-label-primary)' }\n\nconst controlStyle: CSSProperties = {\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-primary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '3px 8px',\n fontSize: '13px',\n}\n\nconst sectionStyle: CSSProperties = {\n marginTop: '14px',\n paddingTop: '12px',\n borderTop: '1px solid var(--dsw-alias-border-l2)',\n}\n\nconst fieldStyle: CSSProperties = { display: 'flex', flexDirection: 'column', gap: '4px' }\n\nconst fieldLabelStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\n\nconst hintStyle: CSSProperties = { margin: '6px 0 0', fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-tertiary)' }\n\n/** Provider group shell: an outlined row grouping its models. */\nconst providerStyle: CSSProperties = {\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '8px',\n margin: '8px 0 0',\n overflow: 'hidden',\n}\n\nconst providerHeadStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '7px 10px',\n background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,0.06))',\n}\n\nconst providerNameStyle: CSSProperties = {\n margin: 0,\n flex: '1 1 auto',\n minWidth: 0,\n fontFamily: 'var(--ds-font-family-code, monospace)',\n fontSize: '12px',\n lineHeight: '18px',\n fontWeight: 600,\n color: 'var(--dsw-alias-label-primary)',\n overflowWrap: 'anywhere',\n}\n\nconst providerBadgeStyle: CSSProperties = {\n margin: 0,\n fontSize: '10px',\n lineHeight: '16px',\n color: 'var(--dsw-alias-label-tertiary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '0 5px',\n whiteSpace: 'nowrap',\n}\n\nconst iconButtonStyle: CSSProperties = {\n background: 'none',\n border: 'none',\n color: 'var(--dsw-alias-label-tertiary)',\n cursor: 'pointer',\n padding: '2px 4px',\n display: 'inline-flex',\n alignItems: 'center',\n}\n\n/** One model row inside a provider group. */\nconst modelRowStyle: CSSProperties = {\n display: 'flex',\n alignItems: 'center',\n gap: '8px',\n padding: '7px 10px',\n borderTop: '1px solid var(--dsw-alias-border-l2)',\n}\n\nconst modelIdStyle: CSSProperties = {\n margin: 0,\n flex: '1 1 auto',\n minWidth: 0,\n fontFamily: 'var(--ds-font-family-code, monospace)',\n fontSize: '12px',\n lineHeight: '18px',\n color: 'var(--dsw-alias-label-secondary)',\n overflowWrap: 'anywhere',\n}\n\n/** Capability badge chips (text / image / context). */\nconst badgeStyle: CSSProperties = {\n fontSize: '10px',\n lineHeight: '16px',\n color: 'var(--dsw-alias-label-tertiary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '0 5px',\n whiteSpace: 'nowrap',\n}\n\n/** The per-level editor grid: one row per level with a toggle, a label and a wire input. */\nconst levelRowStyle: CSSProperties = {\n display: 'grid',\n gridTemplateColumns: 'auto 92px minmax(0, 1fr)',\n alignItems: 'center',\n gap: '8px',\n padding: '4px 0',\n fontSize: '13px',\n}\n\nconst levelNameStyle: CSSProperties = { margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-label-secondary)' }\n\nconst wireInputStyle: CSSProperties = {\n background: 'var(--dsw-alias-bg-surface, #fff)',\n color: 'var(--dsw-alias-label-primary)',\n border: '1px solid var(--dsw-alias-border-l2)',\n borderRadius: '4px',\n padding: '3px 8px',\n fontSize: '12px',\n width: '100%',\n boxSizing: 'border-box',\n}\n\n/* ── helpers over the llm-pi-ai user layer ─────────────────────────────── */\n\n/** A row's `reasoningEfforts` as stored in the user layer. */\nfunction effortsOf(model: Record<string, unknown>): false | Record<string, unknown> | undefined {\n const value = model['reasoningEfforts']\n if (value === false) return false\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n return value as Record<string, unknown>\n }\n return undefined\n}\n\n/**\n * Build a `reasoningEfforts` table from a level→wire draft. `off` maps to\n * `null` (omit the reasoning option → enable_thinking false) unless the user\n * typed a wire value; every other ticked level keeps its typed wire value.\n * pi-ai rejects a table offering nothing beyond `off`, so a selection of only\n * `off` falls back to the default `high` level.\n */\nfunction effortTableOf(draft: Record<string, string | null>): Record<string, unknown> {\n const table: Record<string, unknown> = {}\n for (const level of CAPABILITY_LEVELS) {\n const wire = draft[level]\n if (wire === undefined || wire === null) continue\n const trimmed = typeof wire === 'string' ? wire.trim() : ''\n if (level === 'off') table[level] = trimmed === '' ? null : trimmed\n else if (trimmed !== '') table[level] = trimmed\n }\n if (Object.keys(table).length === 0 || Object.keys(table).every(level => table[level] === null)) {\n return { ...table, high: 'high' }\n }\n return table\n}\n\n/** Whether a row declares `compat.supportsReasoningEffort` (the wire sends reasoning_effort). */\nfunction supportsEffortOf(model: Record<string, unknown>): boolean {\n const compat = model['compat']\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\n return (compat as Record<string, unknown>)['supportsReasoningEffort'] === true\n}\n\n/** Patch one row's `compat` object, merging rather than replacing sibling fields. */\nfunction patchCompat(\n row: Record<string, unknown>,\n patch: (compat: Record<string, unknown>) => void,\n): void {\n const compat = typeof row['compat'] === 'object' && row['compat'] !== null && !Array.isArray(row['compat'])\n ? { ...(row['compat'] as Record<string, unknown>) }\n : {}\n patch(compat)\n if (Object.keys(compat).length === 0) delete row['compat']\n else row['compat'] = compat\n}\n\n/** The user-layer `providers` value of the llm-pi-ai namespace, when present. */\nfunction providersOf(snapshot: unknown): Record<string, unknown> {\n if (typeof snapshot !== 'object' || snapshot === null) return {}\n const user = (snapshot as { user?: unknown }).user\n if (typeof user !== 'object' || user === null || Array.isArray(user)) return {}\n const providers = (user as Record<string, unknown>)['providers']\n return typeof providers === 'object' && providers !== null && !Array.isArray(providers)\n ? providers as Record<string, unknown>\n : {}\n}\n\n/** Whether a route-level profile declares `compat.supportsDeveloperRole: false`. */\nfunction developerRoleDisabledOf(profile: unknown): boolean {\n if (typeof profile !== 'object' || profile === null) return false\n const compat = (profile as Record<string, unknown>)['compat']\n if (typeof compat !== 'object' || compat === null || Array.isArray(compat)) return false\n return (compat as Record<string, unknown>)['supportsDeveloperRole'] === false\n}\n\n/** One flattened capability entry: a provider's model at an array index. */\ninterface CapabilityEntry {\n providerId: string\n index: number\n model: Record<string, unknown>\n modelId: string\n /** The provider-level `compat`, applied to models that declare none (display parity). */\n providerCompat?: unknown\n /** The provider-level `defaultInput`, applied to models that declare none (display parity). */\n providerInput?: unknown[]\n}\n\n/** The effective `compat` of an entry: its own `compat` merged over the provider-level `compat`. */\nfunction compatOf(entry: CapabilityEntry): Record<string, unknown> {\n const base = typeof entry.providerCompat === 'object' && entry.providerCompat !== null\n ? entry.providerCompat as Record<string, unknown>\n : {}\n const own = entry.model['compat']\n return typeof own === 'object' && own !== null && !Array.isArray(own)\n ? { ...base, ...(own as Record<string, unknown>) }\n : base\n}\n\n/** Flatten the user-layer providers into capability entries (models arrays only). */\nfunction entriesOf(providers: Record<string, unknown>): CapabilityEntry[] {\n return Object.entries(providers).flatMap(([providerId, profile]) => {\n const raw = profile as Record<string, unknown>\n const models = raw['models']\n if (!Array.isArray(models)) return []\n const providerCompat = raw['compat']\n const providerInput = Array.isArray(raw['defaultInput']) ? raw['defaultInput'] as unknown[] : undefined\n return models.map((model, index) => ({\n providerId,\n index,\n model: (typeof model === 'object' && model !== null && !Array.isArray(model)\n ? model as Record<string, unknown>\n : {}),\n modelId: typeof model === 'object' && model !== null && typeof (model as Record<string, unknown>)['id'] === 'string'\n ? (model as Record<string, unknown>)['id'] as string\n : `#${index + 1}`,\n providerCompat,\n providerInput,\n }))\n })\n}\n\n/** Human-readable capability summary of one entry (input modalities + declared context window). */\nfunction summaryOf(entry: CapabilityEntry): { text: boolean; image: boolean; context: string | null } {\n // Modalities fall back to the provider-level `defaultInput` so a vision\n // gateway declared once on the route shows every model as vision, matching\n // llm-pi-ai's resolution and the adapter's runtime gate.\n const input = Array.isArray(entry.model['input'])\n ? entry.model['input'] as unknown[]\n : entry.providerInput\n const text = !Array.isArray(input) || input.length === 0 || input.includes('text')\n const image = Array.isArray(input) && input.includes('image')\n const contextWindow = entry.model['contextWindow']\n const context = typeof contextWindow === 'number' && Number.isFinite(contextWindow) && contextWindow > 0\n ? formatContextWindow(contextWindow)\n : null\n return { text, image, context }\n}\n\n/** A tiny inline chevron icon (no CSS modules). */\nfunction ChevronIcon({ open }: { open: boolean }): JSX.Element {\n return (\n <svg\n width=\"12\" height=\"12\" viewBox=\"0 0 16 16\" aria-hidden\n style={{ transform: open ? 'rotate(180deg)' : 'none', transition: 'transform 0.16s' }}\n >\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n )\n}\n\n/**\n * The llm-pi-ai model-capability editor block (dsh-thinking-effort style:\n * provider groups, model rows with badges, per-level wire editors, search and\n * one-click presets).\n * @param scope - the `llm-pi-ai` namespace scope.\n * @param t - copy lookup.\n * @param readonly - whether writes are forbidden.\n * @returns the capabilities block, or a placeholder when nothing is configured.\n */\nfunction ModelCapabilities(props: {\n scope: SettingsScope<unknown>\n t: (key: string) => string\n readonly: boolean\n}): JSX.Element {\n const { scope, t, readonly } = props\n const snapshot = useSyncExternalStore(\n (listener) => scope.subscribe(listener),\n () => scope.getSnapshot(),\n )\n const unavailable = snapshot.status === 'unavailable'\n const providers = snapshot.status === 'ready' ? providersOf(snapshot) : {}\n // Every llm-pi-ai provider is listed with its models — no list gating: the\n // official compat surface (dsh ≥ rc.8) means pi-ai serves every route\n // natively, so each model is editable right here.\n const allEntries = entriesOf(providers)\n\n // UI-only state: provider/model expansion, the wire drafts, and the query.\n const [query, setQuery] = useState('')\n const [expandedProviders, setExpandedProviders] = useState<Record<string, boolean>>({})\n const [expandedModels, setExpandedModels] = useState<Record<string, boolean>>({})\n const [drafts, setDrafts] = useState<Record<string, Record<string, string | null>>>({})\n const [busy, setBusy] = useState(false)\n const [contextRaw, setContextRaw] = useState<Record<string, string>>({})\n const [contextError, setContextError] = useState<Record<string, string>>({})\n\n const entryKey = (entry: CapabilityEntry): string => `${entry.providerId}\\u0000${entry.index}`\n\n /** Commit one patch over the user-layer providers. */\n const commitProviders = (mutate: (current: Record<string, unknown>) => Record<string, unknown>): void => {\n if (snapshot.status !== 'ready' || readonly) return\n setBusy(true)\n void scope.set('providers', mutate(structuredClone(providers)))\n .then(() => { setBusy(false) })\n .catch(() => { setBusy(false) })\n }\n\n /** Toggle the route-level official compat flag: unchecked = inherit (unset). */\n const toggleDeveloperRole = (providerId: string, next: boolean): void => {\n commitProviders((current) => {\n const profile = current[providerId] as Record<string, unknown> | undefined\n if (profile === undefined) return current\n const compat = typeof profile['compat'] === 'object' && profile['compat'] !== null && !Array.isArray(profile['compat'])\n ? { ...(profile['compat'] as Record<string, unknown>) }\n : {}\n if (next) compat['supportsDeveloperRole'] = false\n else delete compat['supportsDeveloperRole']\n if (Object.keys(compat).length === 0) delete profile['compat']\n else profile['compat'] = compat\n return current\n })\n }\n\n /** Patch one model row of one provider. */\n const patchModel = (\n providerId: string,\n index: number,\n patch: (model: Record<string, unknown>) => void,\n ): void => {\n commitProviders((current) => {\n const profile = current[providerId] as { models?: unknown[] } | undefined\n if (profile === undefined || !Array.isArray(profile.models)) return current\n const model = profile.models[index]\n if (typeof model !== 'object' || model === null) return current\n patch(model as Record<string, unknown>)\n return current\n })\n }\n\n /** Toggle whether a model is a thinking model (reasoningEfforts table vs false). */\n const toggleThinking = (entry: CapabilityEntry, next: boolean): void => {\n patchModel(entry.providerId, entry.index, (row) => {\n if (next) {\n // Thinking on: a table must exist so the wire drives enable_thinking /\n // reasoning_effort. Start from the persisted table or the default high\n // set; a toggle model (no effort) keeps supportsReasoningEffort false.\n const effortCapable = supportsEffortOf(row)\n row['reasoningEfforts'] = effortCapable\n ? effortTableOf({ high: 'high' })\n : { off: null, high: 'high' }\n // Toggle-style thinking models need the official qwen format so pi-ai\n // sends enable_thinking (early vLLM thinking models return no thinking\n // content without that flag, and reject reasoning_effort). Only fills\n // an absent format — an explicit choice is never clobbered.\n if (!effortCapable) {\n patchCompat(row, (compat) => {\n if (compat['thinkingFormat'] === undefined) compat['thinkingFormat'] = 'qwen-chat-template'\n })\n }\n } else {\n // Thinking off: a non-reasoning model never takes an effort.\n row['reasoningEfforts'] = false\n }\n })\n }\n\n /** Toggle whether a model accepts reasoning_effort levels. */\n const toggleEffortCapable = (entry: CapabilityEntry, next: boolean): void => {\n patchModel(entry.providerId, entry.index, (row) => {\n patchCompat(row, (compat) => {\n compat['supportsReasoningEffort'] = next\n // Counterpart of the auto-fill in toggleThinking: effort-capable rows\n // need reasoning_effort on the wire, so drop the toggle-style qwen\n // format when effort turns on (it would drive enable_thinking instead).\n if (next && compat['thinkingFormat'] === 'qwen-chat-template') delete compat['thinkingFormat']\n })\n })\n }\n\n /** Apply one model's wire draft as its `reasoningEfforts` table. */\n const applyDraft = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n const draft = drafts[key]\n if (draft === undefined) return\n const table = effortTableOf(draft)\n patchModel(entry.providerId, entry.index, (row) => {\n row['reasoningEfforts'] = table\n // Mark effort support only when the model already had it or the user\n // ticked a reasoning_effort-only level (minimal/low/medium/xhigh/max).\n // A toggle-only model (Qwen3.6: off/high = enable_thinking) must keep\n // supportsReasoningEffort false — flipping it would make the adapter\n // send a reasoning_effort the gateway rejects (400).\n const extended = Object.keys(table).some(level => level !== 'off' && level !== 'on' && level !== 'high')\n if (supportsEffortOf(row) || extended) {\n patchCompat(row, (compat) => {\n compat['supportsReasoningEffort'] = true\n })\n }\n })\n }\n\n /** Reset a model's draft to its persisted table (or the default high set). */\n const resetDraft = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setDrafts(current => {\n const next = { ...current }\n const table = effortsOf(entry.model)\n if (typeof table === 'object' && table !== null) {\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\n level,\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\n ]))\n } else {\n next[key] = { off: '', high: 'high' }\n }\n return next\n })\n }\n\n /** Seed a model's draft when it is first expanded. */\n const ensureDraft = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setDrafts(current => {\n if (current[key] !== undefined) return current\n const next = { ...current }\n const table = effortsOf(entry.model)\n if (typeof table === 'object' && table !== null) {\n next[key] = Object.fromEntries(CAPABILITY_LEVELS.map(level => [\n level,\n table[level] === undefined ? null : (table[level] === null ? '' : String(table[level])),\n ]))\n } else {\n next[key] = { off: '', high: 'high' }\n }\n return next\n })\n }\n\n /** Apply a one-click preset to every thinking model. */\n const applyPreset = (levels: Record<string, unknown>): void => {\n commitProviders((current) => {\n for (const entry of entriesOf(current)) {\n const profile = current[entry.providerId] as { models?: unknown[] } | undefined\n if (profile === undefined || !Array.isArray(profile.models)) continue\n const model = profile.models[entry.index]\n if (typeof model !== 'object' || model === null) continue\n const row = model as Record<string, unknown>\n if (effortsOf(row) === undefined) continue // only thinking models\n // Replace the table but never touch supportsReasoningEffort: a\n // toggle-only model (Qwen3.6) must stay Off/On (enable_thinking), so\n // the request guard keeps clamping any injected level to its default\n // strength instead of sending a reasoning_effort the gateway rejects.\n row['reasoningEfforts'] = levels\n }\n return current\n })\n }\n\n /** Seed a model's context-window input when it is first expanded. */\n const seedContext = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setContextRaw(current => {\n if (current[key] !== undefined) return current\n const value = entry.model['contextWindow']\n return {\n ...current,\n [key]: typeof value === 'number' && Number.isFinite(value) ? String(value) : '',\n }\n })\n }\n\n /** Write (or delete) a model's `contextWindow` in the llm-pi-ai entry. */\n const commitContextWindow = (entry: CapabilityEntry, value: number | undefined): void => {\n const key = entryKey(entry)\n patchModel(entry.providerId, entry.index, (row) => {\n if (value === undefined) delete row['contextWindow']\n else row['contextWindow'] = value\n })\n setContextError(current => {\n const next = { ...current }\n delete next[key]\n return next\n })\n }\n\n /** Apply one preset immediately. */\n const applyContextPreset = (entry: CapabilityEntry, value: number): void => {\n const key = entryKey(entry)\n setContextRaw(current => ({ ...current, [key]: String(value) }))\n commitContextWindow(entry, value)\n }\n\n /** Validate and commit the custom input (blur / Enter); empty clears it. */\n const applyContextInput = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n const raw = (contextRaw[key] ?? '').trim()\n if (raw === '') {\n commitContextWindow(entry, undefined)\n return\n }\n const validation = validateContextWindow(raw)\n if (!validation.ok) {\n setContextError(current => ({\n ...current,\n [key]: t(validation.reason === 'integer'\n ? 'card.capabilities.contextInteger'\n : 'card.capabilities.contextRange'),\n }))\n return\n }\n commitContextWindow(entry, validation.value)\n }\n\n /** Clear the model's context-window declaration (delete the field). */\n const clearContext = (entry: CapabilityEntry): void => {\n const key = entryKey(entry)\n setContextRaw(current => ({ ...current, [key]: '' }))\n commitContextWindow(entry, undefined)\n }\n\n if (unavailable) {\n return (\n <div style={sectionStyle}>\n <p style={hintStyle}>{t('card.capabilities.unavailable')}</p>\n </div>\n )\n }\n if (allEntries.length === 0) {\n return (\n <div style={sectionStyle}>\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\n <p style={hintStyle}>{t('card.capabilities.empty')}</p>\n </div>\n )\n }\n\n const needle = query.trim().toLowerCase()\n const visible = needle === ''\n ? allEntries\n : allEntries.filter(entry =>\n entry.modelId.toLowerCase().includes(needle)\n || entry.providerId.toLowerCase().includes(needle))\n const providerIds = [...new Set(visible.map(entry => entry.providerId))]\n\n return (\n <div style={sectionStyle}>\n <p style={fieldLabelStyle}>{t('card.capabilities')}</p>\n <p style={hintStyle}>{t('card.capabilities.hint')}</p>\n\n {/* Search + one-click presets */}\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap', alignItems: 'center', margin: '8px 0 2px' }}>\n <input\n type=\"text\"\n value={query}\n placeholder={t('card.capabilities.search')}\n disabled={readonly || busy}\n style={{ ...controlStyle, flex: '1 1 160px', minWidth: '140px' }}\n onChange={(event) => setQuery(event.currentTarget.value)}\n />\n {PRESETS.map(preset => (\n <button\n key={preset.key}\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => applyPreset(preset.levels)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t(`card.capabilities.preset${preset.key === 'official' ? 'Official' : 'Generic'}`)}\n </button>\n ))}\n </div>\n\n {visible.length === 0\n ? <p style={hintStyle}>{t('card.capabilities.noMatches')}</p>\n : providerIds.map(providerId => {\n const providerEntries = visible.filter(entry => entry.providerId === providerId)\n const providerOpen = expandedProviders[providerId] === true || needle !== ''\n return (\n <div key={providerId} style={providerStyle}>\n <div style={providerHeadStyle}>\n <button\n type=\"button\"\n aria-expanded={providerOpen}\n disabled={readonly || busy}\n onClick={() => setExpandedProviders(current => ({\n ...current,\n [providerId]: current[providerId] !== true,\n }))}\n style={{\n ...iconButtonStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n }}\n title={providerOpen ? t('card.capabilities.collapseProvider') : t('card.capabilities.expandProvider')}\n >\n <ChevronIcon open={providerOpen} />\n </button>\n <p style={providerNameStyle}>{providerId}</p>\n <label\n style={{ display: 'inline-flex', alignItems: 'center', gap: '5px', fontSize: '11px', whiteSpace: 'nowrap', color: 'var(--dsw-alias-label-secondary)' }}\n title={t('card.capabilities.developerRoleHint')}\n >\n <input\n type=\"checkbox\"\n checked={developerRoleDisabledOf(providers[providerId])}\n disabled={readonly || busy}\n onChange={(event) => toggleDeveloperRole(providerId, event.currentTarget.checked)}\n />\n <span>{t('card.capabilities.developerRole')}</span>\n </label>\n <p style={providerBadgeStyle}>{providerEntries.length}</p>\n </div>\n {providerOpen\n ? providerEntries.map(entry => {\n const key = entryKey(entry)\n const modelOpen = expandedModels[key] === true\n const efforts = effortsOf(entry.model)\n const thinking = typeof efforts === 'object'\n // Display falls back to the provider-level `compat` so a\n // route-declared thinking/effort posture shows on every model.\n const compat = compatOf(entry)\n const supportsEffort = compat['supportsReasoningEffort'] === true\n const meta = summaryOf(entry)\n const format = typeof compat['thinkingFormat'] === 'string'\n ? compat['thinkingFormat']\n : undefined\n return (\n <div key={key}>\n <div style={modelRowStyle}>\n <button\n type=\"button\"\n aria-expanded={modelOpen}\n disabled={readonly || busy}\n onClick={() => {\n const next = expandedModels[key] !== true\n setExpandedModels(current => ({ ...current, [key]: next }))\n if (next) { ensureDraft(entry); seedContext(entry) }\n }}\n style={{\n ...iconButtonStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n }}\n title={modelOpen ? t('card.capabilities.closeModelSettings') : t('card.capabilities.openModelSettings')}\n >\n <ChevronIcon open={modelOpen} />\n </button>\n <p style={modelIdStyle}>{entry.modelId}</p>\n <span style={badgeStyle} title=\"text\">{meta.text ? 'T' : '–'}</span>\n <span style={badgeStyle} title=\"image\">{meta.image ? 'IMG' : '–'}</span>\n {meta.context !== null && <span style={badgeStyle}>{meta.context}</span>}\n {thinking && !supportsEffort && <span style={badgeStyle}>On/Off</span>}\n </div>\n {modelOpen\n ? (\n <div style={{ padding: '4px 10px 10px', borderTop: '1px solid var(--dsw-alias-border-l2)' }}>\n {/* Layer 1 — base capabilities: is it a thinking model? A vision model? */}\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', margin: '2px 0 8px' }}>\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\n <input\n type=\"checkbox\"\n checked={thinking}\n disabled={readonly || busy}\n onChange={(event) => toggleThinking(entry, event.currentTarget.checked)}\n />\n <span>{t('card.capabilities.thinking')}</span>\n </label>\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\n <input\n type=\"checkbox\"\n checked={meta.image}\n disabled={readonly || busy}\n onChange={(event) => {\n patchModel(entry.providerId, entry.index, (row) => {\n // Image input implies text input; the pair is written together.\n row['input'] = event.currentTarget.checked ? ['text', 'image'] : ['text']\n })\n }}\n />\n <span>{t('card.capabilities.vision')}</span>\n </label>\n </div>\n {/* Layer 2 — only for thinking models: does it take reasoning_effort levels? */}\n {thinking\n ? (\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px', margin: '0 0 8px' }}>\n <input\n type=\"checkbox\"\n checked={supportsEffort}\n disabled={readonly || busy}\n onChange={(event) => toggleEffortCapable(entry, event.currentTarget.checked)}\n />\n <span>{t('card.capabilities.supportsEffort')}</span>\n </label>\n )\n : null}\n {thinking && supportsEffort\n ? (\n <>\n {/* Per-level wire editor — only for effort-capable thinking models */}\n <p style={fieldLabelStyle}>{t('card.capabilities.efforts')}</p>\n <div style={{ margin: '4px 0 6px' }}>\n {CAPABILITY_LEVELS.map(level => {\n const wire = drafts[key]?.[level]\n const on = wire !== undefined && wire !== null\n return (\n <div key={level} style={levelRowStyle}>\n <label style={{ display: 'inline-flex', alignItems: 'center', gap: '6px', fontSize: '12px' }}>\n <input\n type=\"checkbox\"\n checked={on}\n disabled={readonly || busy}\n onChange={(event) => {\n const checked = event.currentTarget.checked\n setDrafts(current => {\n const draft = { ...(current[key] ?? {}) }\n draft[level] = checked\n ? (level === 'off' ? '' : level)\n : null\n return { ...current, [key]: draft }\n })\n }}\n />\n <span>{level}</span>\n </label>\n <span style={levelNameStyle}>{level === 'off' ? t('card.capabilities.offPlaceholder') : '→'}</span>\n <input\n type=\"text\"\n value={wire ?? ''}\n disabled={readonly || busy || !on}\n placeholder={t('card.capabilities.wirePlaceholder')}\n style={wireInputStyle}\n onChange={(event) => {\n setDrafts(current => {\n const draft = { ...(current[key] ?? {}) }\n draft[level] = event.currentTarget.value\n return { ...current, [key]: draft }\n })\n }}\n />\n </div>\n )\n })}\n </div>\n <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>\n <button\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => applyDraft(entry)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t('card.capabilities.applyLevel')}\n </button>\n <button\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => resetDraft(entry)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t('card.capabilities.restoreDefault')}\n </button>\n </div>\n </>\n )\n : null}\n {/* Layer 4 — thinking format (wire serialization) */}\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\n <label style={fieldStyle}>\n <span style={fieldLabelStyle}>{t('card.capabilities.thinkingFormat')}</span>\n <select\n style={controlStyle}\n value={format ?? 'inherit'}\n disabled={readonly || busy}\n onChange={(event) => {\n const next = event.currentTarget.value\n patchModel(entry.providerId, entry.index, (row) => {\n patchCompat(row, (compat) => {\n if (next === 'inherit') delete compat['thinkingFormat']\n else compat['thinkingFormat'] = next\n })\n })\n }}\n >\n <option value=\"inherit\">{t('card.capabilities.thinkingFormat.inherit')}</option>\n {THINKING_FORMATS.map(formatOption => (\n <option key={formatOption} value={formatOption}>{formatOption}</option>\n ))}\n </select>\n </label>\n </div>\n {/* Context-window limit: presets + custom integer (written to llm-pi-ai, live on next request) */}\n <div style={{ display: 'flex', gap: '16px', flexWrap: 'wrap', marginTop: '10px' }}>\n <label style={fieldStyle}>\n <span style={fieldLabelStyle}>{t('card.capabilities.contextWindow')}</span>\n <div style={{ display: 'flex', gap: '6px', flexWrap: 'wrap', alignItems: 'center' }}>\n {CONTEXT_WINDOW_PRESETS.map(preset => (\n <button\n key={preset.value}\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => applyContextPreset(entry, preset.value)}\n style={{\n ...controlStyle,\n padding: '2px 8px',\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {preset.label}\n </button>\n ))}\n <input\n type=\"text\"\n value={contextRaw[key] ?? ''}\n disabled={readonly || busy}\n placeholder={t('card.capabilities.contextCustomPlaceholder')}\n style={{ ...controlStyle, width: '120px' }}\n onChange={(event) => {\n const next = event.currentTarget.value\n setContextRaw(current => ({ ...current, [key]: next }))\n }}\n onBlur={() => applyContextInput(entry)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') event.currentTarget.blur()\n }}\n />\n <button\n type=\"button\"\n disabled={readonly || busy}\n onClick={() => clearContext(entry)}\n style={{\n ...controlStyle,\n cursor: readonly || busy ? 'default' : 'pointer',\n opacity: readonly || busy ? 0.5 : 1,\n }}\n >\n {t('card.capabilities.contextClear')}\n </button>\n </div>\n {contextError[key] !== undefined\n ? (\n <span style={{ margin: 0, fontSize: '12px', lineHeight: '18px', color: 'var(--dsw-alias-danger, #e5484d)' }}>\n {contextError[key]}\n </span>\n )\n : null}\n </label>\n </div>\n </div>\n )\n : null}\n </div>\n )\n })\n : null}\n </div>\n )\n })}\n {readonly ? <p style={hintStyle}>{t('card.readonly')}</p> : null}\n </div>\n )\n}\n\n/**\n * The card body, wrapped in a disclosure shell like every peer settings card:\n * a header (name + description + chevron) that toggles the body, collapsed by\n * default so the plugin tab stays a tidy list of drawers.\n * @param props - locale copy and the injected scopes.\n */\nexport function ThinkingLevelsCard({ t, scope, piAiScope }: ThinkingLevelsCardProps): JSX.Element {\n const [open, setOpen] = useState(false)\n const snapshot = useSyncExternalStore(\n (listener) => scope.subscribe(listener),\n () => scope.getSnapshot(),\n )\n const unavailable = snapshot.status === 'unavailable'\n const readonly = unavailable || !snapshot.writable\n // configForms serves the STORED doc: volatile fields arrive as plain values\n // (simplify() unwraps the live refs before persistence), so the card sees a\n // plain config shape even though the host-side type carries Volatile unions.\n const value = (snapshot.value ?? {}) as unknown as Partial<{\n enabled: boolean\n level: EffortId\n allowDowngrade: boolean\n allowUpgrade: boolean\n }>\n const level = EFFORT_OPTIONS.includes(value.level as EffortId) ? value.level as EffortId : 'auto'\n\n return (\n <div style={{\n border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))',\n background: 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))',\n borderRadius: '12px',\n transition: 'border-color 0.16s, background 0.16s',\n }}>\n <button\n type=\"button\"\n aria-expanded={open}\n style={{\n appearance: 'none',\n width: '100%',\n font: 'inherit',\n color: 'inherit',\n textAlign: 'left',\n cursor: 'pointer',\n background: 'none',\n border: 0,\n borderRadius: '12px',\n display: 'flex',\n alignItems: 'center',\n gap: '12px',\n padding: '14px 16px',\n }}\n onClick={() => { setOpen(current => !current) }}\n >\n <span style={{ flex: '1 1 0%', minWidth: 0 }}>\n <div style={{ fontSize: '14px', fontWeight: 600, color: 'var(--dsw-alias-label-primary)' }}>{t('card.title')}</div>\n <div style={{ color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))', fontSize: '13px', lineHeight: 1.5 }}>{t('card.description')}</div>\n </span>\n <svg\n width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-hidden\n style={{\n color: 'var(--dsw-alias-label-tertiary, rgba(127,127,127,0.8))',\n flex: '0 0 auto',\n transition: 'transform 0.16s',\n transform: open ? 'rotate(180deg)' : 'none',\n }}\n >\n <path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n </button>\n {open\n ? (\n <div style={{ padding: '12px 16px' }}>\n {unavailable\n ? (\n <div style={{ fontSize: '13px', color: 'var(--dsw-alias-label-tertiary)' }}>\n {t('card.unavailable')}\n </div>\n )\n : (\n <>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-level\" style={labelStyle}>{t('card.level')}</label>\n <select\n id=\"plugin-config-thinking-levels-level\"\n value={level}\n disabled={readonly}\n style={controlStyle}\n onChange={(event) => { void scope.set('level', event.currentTarget.value as EffortId) }}\n >\n {EFFORT_OPTIONS.map((option) => (\n <option key={option} value={option}>{t(`card.level.${option}`)}</option>\n ))}\n </select>\n </div>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-enabled\" style={labelStyle}>{t('card.enabled')}</label>\n <input\n id=\"plugin-config-thinking-levels-enabled\"\n type=\"checkbox\"\n checked={value.enabled ?? true}\n disabled={readonly}\n onChange={(event) => { void scope.set('enabled', event.currentTarget.checked) }}\n />\n </div>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-downgrade\" style={labelStyle}>{t('card.allowDowngrade')}</label>\n <input\n id=\"plugin-config-thinking-levels-downgrade\"\n type=\"checkbox\"\n checked={value.allowDowngrade ?? true}\n disabled={readonly || value.level !== 'auto'}\n onChange={(event) => { void scope.set('allowDowngrade', event.currentTarget.checked) }}\n />\n </div>\n <div style={rowStyle}>\n <label htmlFor=\"plugin-config-thinking-levels-upgrade\" style={labelStyle}>{t('card.allowUpgrade')}</label>\n <input\n id=\"plugin-config-thinking-levels-upgrade\"\n type=\"checkbox\"\n checked={value.allowUpgrade ?? false}\n disabled={readonly || value.level !== 'auto'}\n onChange={(event) => { void scope.set('allowUpgrade', event.currentTarget.checked) }}\n />\n </div>\n {!snapshot.writable\n && <p style={{ margin: '8px 0 0', fontSize: '12px', color: 'var(--dsw-alias-label-tertiary)' }}>{t('card.readonly')}</p>}\n <ModelCapabilities scope={piAiScope} t={t} readonly={readonly} />\n </>\n )}\n </div>\n )\n : null}\n </div>\n )\n}\n","/**\n * FamilySettingsSection — the top-level 「起子插件设置」 settings section.\n *\n * One `settings.section` nav entry (registered by this plugin) whose entry\n * declares the `dsh-family.tab` child slot; sibling plugins (session-guard\n * first) contribute their cards there via `ctx.slots.inject('dsh-family.tab',\n * …)`. The section renders the family's own thinking-levels card as the first\n * tab and every contributor as a following tab — the same tabs-around-pages\n * pattern the built-in Plugins section uses (ui-settings-plugins): the tab\n * ledger is a HostObservable projected from the child-slot registry, and the\n * active tab mounts through `renderSlot(key, {}, { only: id })`.\n *\n * When this section is absent the whole family surface is absent; a\n * contributor's inject simply idles (an undischarged wait never blocks the\n * client half), so plugins stay fully functional without their card.\n */\nimport { useState } from 'react'\nimport type { JSX } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport { ThinkingLevelsCard, type ThinkingLevelsCardInjected } from './card.tsx'\n\n/**\n * Structural mirrors of the ui-slots faces this section consumes (the same\n * pattern as scope-face.ts: the package's `export *` type graph resolves\n * unreliably outside the harness workspace, so the handful of shapes are\n * declared locally instead).\n */\ntype HostObservable<T> = {\n getSnapshot(): T\n subscribe(listener: () => void): () => void\n}\n\n/** One contributor tab projected from the `dsh-family.tab` ledger. */\nexport interface FamilyTabEntry {\n id: string\n order: number\n label: string\n}\n\n/** Registration-side business face for the section. */\nexport interface FamilySectionInjected extends ThinkingLevelsCardInjected {\n hooks: {\n /** Ordered projection of the contributor ledger (locale-aware). */\n tabs: HostObservable<readonly FamilyTabEntry[]>\n }\n}\n\n/** The framework-delivered child-slot dispatcher, narrowed to our one child key. */\ninterface FamilyRenderSlots {\n renderSlot(key: 'dsh-family.tab', owner?: object, opts?: { only?: string; fallback?: React.ReactNode }): React.ReactNode\n}\n\n/** Full props: locale + contributor dispatcher + the resolved inject face. */\nexport type FamilySettingsSectionProps =\n PropsLocale<'thinking-levels'>\n & FamilyRenderSlots\n & FamilySectionInjected\n\n/** This plugin's own tab, always first: the thinking-levels card itself. */\nconst OWN_TAB_ID = 'thinking-levels'\n\n/** The hooks-compartment selector hook face (bound `use<Name>` hook). */\ninterface FamilyHooksFace {\n useTabs: <S>(selector: (value: readonly FamilyTabEntry[]) => S) => S\n}\n\nexport function FamilySettingsSection(props: FamilySettingsSectionProps): JSX.Element {\n const { t, renderSlot, scope, piAiScope } = props\n const { useTabs } = props as unknown as FamilyHooksFace\n const contributors = useTabs(value => value)\n const [activeId, setActiveId] = useState<string>(OWN_TAB_ID)\n const rows = [\n { id: OWN_TAB_ID, order: Number.NEGATIVE_INFINITY, label: t('card.title') },\n ...contributors,\n ]\n const active = rows.some(row => row.id === activeId) ? activeId : OWN_TAB_ID\n\n return (\n <div style={{ display: 'grid', gap: '12px' }}>\n <div role=\"tablist\" aria-label={t('family.title')} style={{ display: 'flex', flexWrap: 'wrap', gap: '4px' }}>\n {rows.map(row => (\n <button\n key={row.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={row.id === active}\n onClick={() => { setActiveId(row.id) }}\n style={{\n appearance: 'none',\n font: 'inherit',\n cursor: 'pointer',\n border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,0.35))',\n background: row.id === active ? 'var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.08))' : 'none',\n color: 'var(--dsw-alias-label-primary, inherit)',\n borderRadius: '8px',\n padding: '5px 12px',\n fontSize: '13px',\n }}\n >\n {row.label}\n </button>\n ))}\n </div>\n <div role=\"tabpanel\">\n {active === OWN_TAB_ID\n ? <ThinkingLevelsCard t={t} scope={scope} piAiScope={piAiScope} />\n : renderSlot('dsh-family.tab', {}, { only: active, fallback: null })}\n </div>\n </div>\n )\n}\n","/**\n * dsh-thinking-levels — browser half.\n *\n * Registers the `thinking-levels` dictionaries and one composer tool-row\n * control (`conversation.input.right`) for the context-window quick editor.\n *\n * The plugin's own settings (default level, enable toggle, scheduler bounds)\n * have NO client registration since the DSH 0.1.7 line: the host renders the\n * Plugins settings form declaratively from the `.volatile()` fields of the\n * schema in src/index.ts, and the runtime values flow through the\n * `configForms` service keyed by the composition entry id. The former\n * per-plugin settings card was dropped with that migration (its seat no\n * longer exists in 0.1.7), including its llm-pi-ai model-capability editor —\n * the composer quick control below keeps serving the context-window edits.\n *\n * All @deepseek-ai/* imports are type-only: collaboration happens through\n * cordis services (`configForms`) and slot registration only (client bundle\n * purity).\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n// DSH 0.1.5 moved the `ctx.slots` Context augmentation here (it used to live in\n// the retired `dsh-client-runtime` package): importing the client types restores\n// the typed `ctx.slots` member on the cordis Context surface.\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport { NS, en, ja, ko, zh } from './locales.ts'\nimport { ContextQuick, type ContextQuickInjected } from './context-quick.tsx'\nimport { FamilySettingsSection, type FamilySectionInjected, type FamilyTabEntry } from './family-tab.tsx'\nimport type { ThinkingLevelsCardInjected } from './card.tsx'\nimport type { ThinkingLevelsConfig } from '../index.ts'\n// Type-only: pulls the settings shell's SlotMap merges ('settings.section').\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\n\n/**\n * The plugin-family shared settings surface: ONE top-level `settings.section`\n * nav entry (「起子插件设置」) whose entry declares the `dsh-family.tab` child\n * slot; sibling plugins contribute their cards there (session-guard first) and\n * the section renders them as tabs — the built-in Plugins section's\n * tabs-around-pages pattern. Declaring is claiming (ui-slots): the child slot\n * exists exactly while this section entry does, and a contributor's\n * `ctx.slots.inject('dsh-family.tab', …)` idles harmlessly if this plugin is\n * absent (an undischarged inject never blocks the client half).\n */\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface SlotMap {\n 'dsh-family.tab': { kind: 'list'; scope: 'root' }\n }\n}\n\n/** Services required by the browser half. */\nexport const inject = ['slots', 'locale', 'configForms']\n\n/**\n * Client plugin body: dictionaries plus the composer quick-control slot.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n const t = ctx.locale.bind(NS)\n // `register(ns, dicts)` is typed to the built-in locale ids (`zh` / `en`\n // only); the shipped `ja` / `ko` dictionaries go through the single-locale\n // overload, so they are installed and ready once DSH publishes those ids.\n ctx.effect(() => {\n const disposers = [\n ctx.locale.register(NS, { zh, en }),\n ctx.locale.register(NS, 'ja', ja),\n ctx.locale.register(NS, 'ko', ko),\n ]\n return () => { for (const dispose of disposers) dispose() }\n }, 'dsh-thinking-levels: dictionaries')\n\n // Composer tool row: one compact context-window control next to the\n // model/effort select (`conversation.input.right`, a session-scoped list seat\n // any plugin may occupy). It edits the current session model's `contextWindow`\n // live: custom gateways write the `llm-pi-ai` entry config (same config form\n // the card used), official DeepSeek models write the `llm-deepseek` entry\n // (its `models[].contextWindow`, else the provider default). The model card\n // itself is not an option: the shipped `ModelSelect` renders no slots, so a\n // plugin cannot contribute inside that popup.\n ctx.slots.inject('conversation.input.right', function* () {\n yield ctx.slots.register({\n name: 'conversation.input.right',\n id: 'context-window-quick',\n locale: NS,\n inject: (): ContextQuickInjected => {\n // Entry ids of the target plugins: each dsh llm plugin's composition\n // entry id matches its settings namespace (`llm-pi-ai` / `llm-deepseek`).\n const piAiScope = ctx.configForms.get<unknown>('llm-pi-ai')\n const deepseekScope = ctx.configForms.get<unknown>('llm-deepseek')\n return { piAiScope, deepseekScope }\n },\n }, ContextQuick)\n })\n\n // Family settings section (see the SlotMap note above): the contributor\n // ledger is projected exactly like the built-in Plugins section projects its\n // tab ledger (cache until ledger/locale revision bumps, so useSyncExternalStore\n // sees a stable snapshot).\n/** Registrant labels arrive as a string or a locale thunk; unwrap either. */\nconst resolveLabel = (label: unknown): string =>\n typeof label === 'function' ? (label as () => string)() : typeof label === 'string' ? label : ''\n\n let tabsVersion = -1\n let tabsRevision = -1\n let tabs: readonly FamilyTabEntry[] = []\n const sectionInjected = (): FamilySectionInjected => ({\n scope: ctx.configForms.get<ThinkingLevelsConfig>('dsh-thinking-levels'),\n piAiScope: ctx.configForms.get<unknown>('llm-pi-ai'),\n hooks: {\n tabs: {\n getSnapshot: () => {\n const version = ctx.slots.getVersion('dsh-family.tab')\n const revision = ctx.locale.getSnapshot().revision\n if (version !== tabsVersion || revision !== tabsRevision) {\n tabsVersion = version\n tabsRevision = revision\n tabs = ctx.slots.entries('dsh-family.tab')\n .map(entry => ({\n id: entry.options.id ?? '',\n order: entry.options.order ?? 0,\n label: resolveLabel(entry.options.label),\n }))\n .sort((a, b) => a.order - b.order)\n }\n return tabs\n },\n subscribe: (listener) => {\n const offLedger = ctx.slots.subscribe('dsh-family.tab', listener)\n const offLocale = ctx.locale.subscribe(listener)\n return () => {\n offLedger()\n offLocale()\n }\n },\n },\n },\n })\n\n ctx.slots.inject('settings.section', function* () {\n yield ctx.slots.register({\n name: 'settings.section',\n id: 'dsh-family',\n order: 40,\n label: () => t('family.title'),\n locale: NS,\n inject: sectionInjected,\n children: { 'dsh-family.tab': { kind: 'list', scope: 'root' } },\n }, FamilySettingsSection)\n })\n}\n"],"mappings":";;;;;;;;;;;EAGA,MAAa,KAAK;;EAGlB,MAAa,KAAK;GAChB,cAAc;GACd,gBAAgB;GAChB,oBAAoB;GACpB,cAAc;GACd,kBAAkB;GAClB,iBAAiB;GACjB,sBAAsB;GACtB,kBAAkB;GAClB,qBAAqB;GACrB,mBAAmB;GACnB,oBAAoB;GACpB,kBAAkB;GAClB,mBAAmB;GACnB,gBAAgB;GAChB,uBAAuB;GACvB,qBAAqB;GACrB,oBAAoB;GACpB,iBAAiB;GACjB,qBAAqB;GACrB,0BAA0B;GAC1B,2BAA2B;GAC3B,iCAAiC;GACjC,0BAA0B;GAC1B,4BAA4B;GAC5B,+BAA+B;GAC/B,mCAAmC;GACnC,oCAAoC;GACpC,mCAAmC;GACnC,4BAA4B;GAC5B,mCAAmC;GACnC,uCAAuC;GACvC,oCAAoC;GACpC,sCAAsC;GACtC,uCAAuC;GACvC,wCAAwC;GACxC,4BAA4B;GAC5B,8BAA8B;GAC9B,oCAAoC;GACpC,6BAA6B;GAC7B,qCAAqC;GACrC,oCAAoC;GACpC,qCAAqC;GACrC,gCAAgC;GAChC,oCAAoC;GACpC,6BAA6B;GAC7B,iCAAiC;GACjC,2BAA2B;GAC3B,oCAAoC;GACpC,4CAA4C;GAC5C,mCAAmC;GACnC,8CAA8C;GAC9C,kCAAkC;GAClC,o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,UAAU,QAAQ;MAC/C,aAAa;OACX,UAAU;OACV,UAAU;MACZ;KACF;IACF,EACF;GACF;GAEA,IAAI,MAAM,OAAO,oBAAoB,aAAa;IAChD,MAAM,IAAI,MAAM,SAAS;KACvB,MAAM;KACN,IAAI;KACJ,OAAO;KACP,aAAa,EAAE,cAAc;KAC7B,QAAQ;KACR,QAAQ;KACR,UAAU,EAAE,kBAAkB;MAAE,MAAM;MAAQ,OAAO;KAAO,EAAE;IAChE,GAAG,qBAAqB;GAC1B,CAAC;EACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-thinking-levels",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org",
|
|
6
6
|
"access": "public",
|
|
@@ -88,7 +88,8 @@
|
|
|
88
88
|
"typescript-eslint": "^8.67.0",
|
|
89
89
|
"vitest": "^3.0.0",
|
|
90
90
|
"@deepseek-ai/schemastery": "^3.18.4",
|
|
91
|
-
"@deepseek-ai/cosmokit": "^1.8.5"
|
|
91
|
+
"@deepseek-ai/cosmokit": "^1.8.5",
|
|
92
|
+
"@deepseek-ai/dsh-client-store": "0.1.7-rc.2"
|
|
92
93
|
},
|
|
93
94
|
"scripts": {
|
|
94
95
|
"build": "tsc -p tsconfig.build.json && tsdown",
|