@michengai/dsh-codex-ui 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/CHANGELOG.zh-CN.md +9 -0
- package/lib/client.js +297 -17
- package/lib/composer-plugin.d.mts +18 -0
- package/lib/composer-plugin.mjs +143 -11
- package/lib/desktop-menu-plugin.mjs +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{profile-resolver-BkTv7lmZ.mjs → profile-resolver-DSHfL3KW.mjs} +1 -0
- package/lib/session-title-plugin.mjs +32 -0
- package/lib/settings-skin-plugin.mjs +1 -1
- package/lib/sidebar-plugin.mjs +1 -1
- package/lib/theme-plugin.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.2.2] - 2026-11-14
|
|
4
|
+
|
|
5
|
+
- **Dedicated Model Selection & Automatic Low Reasoning for Prediction (Issue #98)**:
|
|
6
|
+
- Added a "Prediction model" selector in Settings → Codex UI → Composer Enhancements, matching the single-field experience of the native chat interface;
|
|
7
|
+
- Follows the active conversation's model by default, with the ability to choose any enabled fast model for completions to significantly reduce latency and token consumption;
|
|
8
|
+
- Supports choosing reasoning effort levels for reasoning-capable models, automatically defaulting to the lowest available effort to avoid full-depth thinking during inline typing completions.
|
|
9
|
+
- **Fixed Prediction Route & Configuration Passthrough (Issue #98)**:
|
|
10
|
+
- Fixed an issue where model routing, token bounds, and timeout options specified in Profile configs (`cordis.patch.yml`) were not applied to the prediction engine.
|
|
11
|
+
|
|
3
12
|
## [2.2.1] - 2026-11-13
|
|
4
13
|
|
|
5
14
|
- **Sidebar New Session & Navigation Visibility Fix (Issue #96)**: Fixed an issue where the "New Session" button and custom sidebar navigation items (Tasks, Channels, Scheduled, etc.) disappeared and left a blank area on DeepSeek Harness `0.2.2-rc.3`; added fallback safeguards to ensure native sidebar controls remain visible and functional in all conditions.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [2.2.2] - 2026-11-14
|
|
4
|
+
|
|
5
|
+
- **智能输入预测支持专属模型选择与自动低推理档位(Issue #98)**:
|
|
6
|
+
- 在「设置 → Codex UI → 输入框增强」中新增「预测调用模型」设置项,对齐官方对话界面的单字段极简体验;
|
|
7
|
+
- 默认跟随当前会话模型,同时支持自由指定任意已启用的快速小模型进行输入续写,大幅降低打字补全延迟与 Token 开销;
|
|
8
|
+
- 针对带深度思考的模型,支持展开选择思考强度档位;在未指定时自动选用模型的最低推理强度,避免打字行内预测误跑高强度思考。
|
|
9
|
+
- **预测引擎配置透传修复(Issue #98)**:
|
|
10
|
+
- 修复了此前在 Profile 配置文件(`cordis.patch.yml`)中指定预测模型、最大 Token 限制及超时时间等高级选项未生效的问题。
|
|
11
|
+
|
|
3
12
|
## [2.2.1] - 2026-11-13
|
|
4
13
|
|
|
5
14
|
- **侧栏新会话与导航栏显示修复(Issue #96)**:修复了在 DeepSeek Harness `0.2.2-rc.3` 宿主环境下,展开侧栏时左上角「新建会话」按钮及同组导航项(任务/频道/定时等)消失不见、呈现大面积空白的问题;优化了挂载容错保障,确保在任何异常情况下侧栏原生入口均能平稳回退并保持可用。
|
package/lib/client.js
CHANGED
|
@@ -73,6 +73,7 @@ window.__ModuleLoader__.load({
|
|
|
73
73
|
const FALLBACK_LIST_PEN = createFallbackIcon("M3 4h10M3 8h6M3 12h4m6-3l2 2-5 5H9v-2l5-5z");
|
|
74
74
|
const FALLBACK_LOADING = createFallbackIcon("M8 2a6 6 0 1 0 6 6");
|
|
75
75
|
const FALLBACK_REFRESH = createFallbackIcon("M2.5 8a5.5 5.5 0 1 0 1.2-3.4M2.5 3v3h3");
|
|
76
|
+
const FALLBACK_CHEVRON_DOWN = createFallbackIcon("M4 6l4 4 4-4");
|
|
76
77
|
/**
|
|
77
78
|
* 跨宿主版本图标安全解析器:按候选名依次匹配(新版 → 老版 → Medium/Regular 变体),
|
|
78
79
|
* 全部缺失时才回退到给到的 fallback;没有 fallback 就抛错(由单测保护)。
|
|
@@ -99,6 +100,7 @@ window.__ModuleLoader__.load({
|
|
|
99
100
|
const IconListPenOutlineMedium = hostIcon("IconListPenOutlineMedium", "IconListPenOutline16", FALLBACK_LIST_PEN);
|
|
100
101
|
const IconLoadingOutlineMedium = hostIcon("IconLoadingOutlineMedium", "IconLoadingOutline16", FALLBACK_LOADING);
|
|
101
102
|
const IconRefreshOutlineMedium = hostIcon("IconRefreshOutlineMedium", "IconRefreshOutline16", FALLBACK_REFRESH);
|
|
103
|
+
const IconChevronDownOutlineMedium = hostIcon("IconChevronDownOutlineMedium", "IconChevronDownOutline", FALLBACK_CHEVRON_DOWN);
|
|
102
104
|
//#endregion
|
|
103
105
|
//#region src/business-api.ts
|
|
104
106
|
const CODEX_UI_API_BASE = "/api/michengai/dsh-codex-ui";
|
|
@@ -108,6 +110,7 @@ window.__ModuleLoader__.load({
|
|
|
108
110
|
dependencies: `${CODEX_UI_API_BASE}/dependencies`,
|
|
109
111
|
settingsSkin: `${CODEX_UI_API_BASE}/settings-skin`,
|
|
110
112
|
composer: `${CODEX_UI_API_BASE}/composer`,
|
|
113
|
+
composerModels: `${CODEX_UI_API_BASE}/composer/models`,
|
|
111
114
|
composerPrediction: `${CODEX_UI_API_BASE}/composer/prediction`,
|
|
112
115
|
composerPredictionStream: `${CODEX_UI_API_BASE}/composer/prediction/stream`,
|
|
113
116
|
sidebar: `${CODEX_UI_API_BASE}/sidebar`,
|
|
@@ -3566,7 +3569,7 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
|
3566
3569
|
glassPreset: "codex-ui.glass.preset",
|
|
3567
3570
|
glassGlow: "codex-ui.glass.glow"
|
|
3568
3571
|
});
|
|
3569
|
-
const listeners$
|
|
3572
|
+
const listeners$4 = /* @__PURE__ */ new Set();
|
|
3570
3573
|
const VALID_THEMES = [
|
|
3571
3574
|
"stock",
|
|
3572
3575
|
"codex-dark",
|
|
@@ -3631,7 +3634,7 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
|
3631
3634
|
}
|
|
3632
3635
|
function notify() {
|
|
3633
3636
|
currentSnapshot = computeSnapshot();
|
|
3634
|
-
for (const listener of listeners$
|
|
3637
|
+
for (const listener of listeners$4) try {
|
|
3635
3638
|
listener();
|
|
3636
3639
|
} catch (e) {
|
|
3637
3640
|
console.warn("[codex-ui:theme] listener error:", e);
|
|
@@ -3658,9 +3661,9 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
|
3658
3661
|
notify();
|
|
3659
3662
|
}
|
|
3660
3663
|
function subscribeThemeSettings(listener) {
|
|
3661
|
-
listeners$
|
|
3664
|
+
listeners$4.add(listener);
|
|
3662
3665
|
return () => {
|
|
3663
|
-
listeners$
|
|
3666
|
+
listeners$4.delete(listener);
|
|
3664
3667
|
};
|
|
3665
3668
|
}
|
|
3666
3669
|
if (typeof window !== "undefined") window.addEventListener("storage", (event) => {
|
|
@@ -4591,7 +4594,7 @@ ${SECTION_CARD_CSS}
|
|
|
4591
4594
|
const PREDICTION_STORAGE_KEY = "codex-ui.composer.prediction";
|
|
4592
4595
|
/** 同一窗口内跨标签页同步(storage 事件在写入方自身不触发)。 */
|
|
4593
4596
|
const PREDICTION_STORAGE_EVENT = "codex-ui:prediction-change";
|
|
4594
|
-
const listeners$
|
|
4597
|
+
const listeners$3 = /* @__PURE__ */ new Set();
|
|
4595
4598
|
function safeGetItem(key) {
|
|
4596
4599
|
try {
|
|
4597
4600
|
if (typeof localStorage !== "undefined") return localStorage.getItem(key);
|
|
@@ -4628,7 +4631,7 @@ ${SECTION_CARD_CSS}
|
|
|
4628
4631
|
const next = snapshot();
|
|
4629
4632
|
if (next.subPluginEnabled === cached.subPluginEnabled && next.userEnabled === cached.userEnabled && next.mode === cached.mode && next.hostAllowed === cached.hostAllowed && next.enabled === cached.enabled && next.nextEnabled === cached.nextEnabled && next.continueEnabled === cached.continueEnabled) return;
|
|
4630
4633
|
cached = next;
|
|
4631
|
-
for (const listener of [...listeners$
|
|
4634
|
+
for (const listener of [...listeners$3]) try {
|
|
4632
4635
|
listener();
|
|
4633
4636
|
} catch {}
|
|
4634
4637
|
}
|
|
@@ -4637,8 +4640,8 @@ ${SECTION_CARD_CSS}
|
|
|
4637
4640
|
return cached;
|
|
4638
4641
|
}
|
|
4639
4642
|
function subscribePredictionSettings(listener) {
|
|
4640
|
-
listeners$
|
|
4641
|
-
return () => listeners$
|
|
4643
|
+
listeners$3.add(listener);
|
|
4644
|
+
return () => listeners$3.delete(listener);
|
|
4642
4645
|
}
|
|
4643
4646
|
function setPredictionMode(mode) {
|
|
4644
4647
|
currentMode = mode;
|
|
@@ -4682,7 +4685,7 @@ ${SECTION_CARD_CSS}
|
|
|
4682
4685
|
const HISTORY_SCOPE_STORAGE_KEY = "codex-ui.composer.history-scope";
|
|
4683
4686
|
/** 同一窗口内跨标签页同步(storage 事件在写入方自身不触发)。 */
|
|
4684
4687
|
const HISTORY_SCOPE_STORAGE_EVENT = "codex-ui:history-scope-change";
|
|
4685
|
-
const listeners$
|
|
4688
|
+
const listeners$2 = /* @__PURE__ */ new Set();
|
|
4686
4689
|
function safeStorage() {
|
|
4687
4690
|
try {
|
|
4688
4691
|
if (typeof localStorage !== "undefined") return localStorage;
|
|
@@ -4697,13 +4700,13 @@ ${SECTION_CARD_CSS}
|
|
|
4697
4700
|
return currentScope;
|
|
4698
4701
|
}
|
|
4699
4702
|
function subscribeHistoryScope(listener) {
|
|
4700
|
-
listeners$
|
|
4703
|
+
listeners$2.add(listener);
|
|
4701
4704
|
return () => {
|
|
4702
|
-
listeners$
|
|
4705
|
+
listeners$2.delete(listener);
|
|
4703
4706
|
};
|
|
4704
4707
|
}
|
|
4705
4708
|
function publish() {
|
|
4706
|
-
for (const listener of [...listeners$
|
|
4709
|
+
for (const listener of [...listeners$2]) try {
|
|
4707
4710
|
listener();
|
|
4708
4711
|
} catch {}
|
|
4709
4712
|
}
|
|
@@ -4739,6 +4742,232 @@ ${SECTION_CARD_CSS}
|
|
|
4739
4742
|
};
|
|
4740
4743
|
}
|
|
4741
4744
|
//#endregion
|
|
4745
|
+
//#region src/client/composer/prediction-route-state.ts
|
|
4746
|
+
const PREDICTION_ROUTE_STORAGE_KEY = "codex-ui.composer.prediction-route";
|
|
4747
|
+
let currentRouteChoice = (() => {
|
|
4748
|
+
if (typeof window === "undefined") return null;
|
|
4749
|
+
try {
|
|
4750
|
+
const raw = window.localStorage.getItem(PREDICTION_ROUTE_STORAGE_KEY);
|
|
4751
|
+
if (!raw) return null;
|
|
4752
|
+
const parsed = JSON.parse(raw);
|
|
4753
|
+
if (parsed && typeof parsed === "object" && typeof parsed.provider === "string" && typeof parsed.model === "string" && parsed.provider && parsed.model) return {
|
|
4754
|
+
provider: parsed.provider.trim(),
|
|
4755
|
+
model: parsed.model.trim(),
|
|
4756
|
+
...typeof parsed.reasoningEffort === "string" && parsed.reasoningEffort.trim() !== "" ? { reasoningEffort: parsed.reasoningEffort.trim() } : {}
|
|
4757
|
+
};
|
|
4758
|
+
return null;
|
|
4759
|
+
} catch {
|
|
4760
|
+
return null;
|
|
4761
|
+
}
|
|
4762
|
+
})();
|
|
4763
|
+
const listeners$1 = /* @__PURE__ */ new Set();
|
|
4764
|
+
function getPredictionRoute() {
|
|
4765
|
+
return currentRouteChoice;
|
|
4766
|
+
}
|
|
4767
|
+
function setPredictionRoute(choice) {
|
|
4768
|
+
currentRouteChoice = choice;
|
|
4769
|
+
if (typeof window !== "undefined") try {
|
|
4770
|
+
if (choice && choice.provider && choice.model) window.localStorage.setItem(PREDICTION_ROUTE_STORAGE_KEY, JSON.stringify(choice));
|
|
4771
|
+
else window.localStorage.removeItem(PREDICTION_ROUTE_STORAGE_KEY);
|
|
4772
|
+
} catch {}
|
|
4773
|
+
listeners$1.forEach((fn) => {
|
|
4774
|
+
try {
|
|
4775
|
+
fn();
|
|
4776
|
+
} catch {}
|
|
4777
|
+
});
|
|
4778
|
+
}
|
|
4779
|
+
function subscribePredictionRoute(listener) {
|
|
4780
|
+
listeners$1.add(listener);
|
|
4781
|
+
return () => {
|
|
4782
|
+
listeners$1.delete(listener);
|
|
4783
|
+
};
|
|
4784
|
+
}
|
|
4785
|
+
//#endregion
|
|
4786
|
+
//#region src/client/composer/PredictionModelPicker.tsx
|
|
4787
|
+
let cachedProviders = null;
|
|
4788
|
+
/**
|
|
4789
|
+
* 智能输入预测模型选择器(单字段级联选择组件)
|
|
4790
|
+
* 对齐官方 Chat 式单字段交互:
|
|
4791
|
+
* - 紧凑单字段展示;
|
|
4792
|
+
* - 默认「跟随当前会话」;
|
|
4793
|
+
* - 下拉通过 Menu Submenu 支持推理模型档位级联点选。
|
|
4794
|
+
*/
|
|
4795
|
+
function PredictionModelPicker({ t, disabled = false }) {
|
|
4796
|
+
const currentRoute = (0, react.useSyncExternalStore)(subscribePredictionRoute, getPredictionRoute, getPredictionRoute);
|
|
4797
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
4798
|
+
const [providers, setProviders] = (0, react.useState)(() => cachedProviders ?? []);
|
|
4799
|
+
(0, react.useEffect)(() => {
|
|
4800
|
+
if (!open) return;
|
|
4801
|
+
if (cachedProviders !== null) {
|
|
4802
|
+
setProviders(cachedProviders);
|
|
4803
|
+
return;
|
|
4804
|
+
}
|
|
4805
|
+
let cancelled = false;
|
|
4806
|
+
fetch(CODEX_UI_API_ENDPOINTS.composerModels).then((res) => res.ok ? res.json() : null).then((data) => {
|
|
4807
|
+
if (cancelled || !data?.ok || !Array.isArray(data.providers)) return;
|
|
4808
|
+
cachedProviders = data.providers;
|
|
4809
|
+
setProviders(data.providers);
|
|
4810
|
+
}).catch(() => {});
|
|
4811
|
+
return () => {
|
|
4812
|
+
cancelled = true;
|
|
4813
|
+
};
|
|
4814
|
+
}, [open]);
|
|
4815
|
+
const handleSelect = (id) => {
|
|
4816
|
+
setOpen(false);
|
|
4817
|
+
if (id === "__follow_session__") {
|
|
4818
|
+
setPredictionRoute(null);
|
|
4819
|
+
return;
|
|
4820
|
+
}
|
|
4821
|
+
if (id.startsWith("model::")) {
|
|
4822
|
+
const [, p, m] = id.split("::");
|
|
4823
|
+
if (p && m) setPredictionRoute({
|
|
4824
|
+
provider: p,
|
|
4825
|
+
model: m
|
|
4826
|
+
});
|
|
4827
|
+
return;
|
|
4828
|
+
}
|
|
4829
|
+
if (id.startsWith("effort::")) {
|
|
4830
|
+
const [, p, m, eff] = id.split("::");
|
|
4831
|
+
if (p && m) {
|
|
4832
|
+
if (eff === "__auto__") setPredictionRoute({
|
|
4833
|
+
provider: p,
|
|
4834
|
+
model: m
|
|
4835
|
+
});
|
|
4836
|
+
else setPredictionRoute({
|
|
4837
|
+
provider: p,
|
|
4838
|
+
model: m,
|
|
4839
|
+
reasoningEffort: eff
|
|
4840
|
+
});
|
|
4841
|
+
}
|
|
4842
|
+
}
|
|
4843
|
+
};
|
|
4844
|
+
const triggerText = (() => {
|
|
4845
|
+
if (!currentRoute || !currentRoute.provider || !currentRoute.model) return t("composer.modelFollowSession") || "跟随当前会话 (默认)";
|
|
4846
|
+
let foundModelName = currentRoute.model;
|
|
4847
|
+
for (const p of providers) if (p.id === currentRoute.provider) {
|
|
4848
|
+
const m = p.models.find((item) => item.id === currentRoute.model);
|
|
4849
|
+
if (m?.name) foundModelName = m.name;
|
|
4850
|
+
break;
|
|
4851
|
+
}
|
|
4852
|
+
if (currentRoute.reasoningEffort) return `${foundModelName} · ${currentRoute.reasoningEffort}`;
|
|
4853
|
+
return foundModelName;
|
|
4854
|
+
})();
|
|
4855
|
+
const selectedId = (() => {
|
|
4856
|
+
if (!currentRoute || !currentRoute.provider || !currentRoute.model) return "__follow_session__";
|
|
4857
|
+
if (currentRoute.reasoningEffort) return `effort::${currentRoute.provider}::${currentRoute.model}::${currentRoute.reasoningEffort}`;
|
|
4858
|
+
for (const p of providers) if (p.id === currentRoute.provider) {
|
|
4859
|
+
const m = p.models.find((item) => item.id === currentRoute.model);
|
|
4860
|
+
if (m?.reasoning?.efforts && m.reasoning.efforts.length > 0) return `effort::${currentRoute.provider}::${currentRoute.model}::__auto__`;
|
|
4861
|
+
break;
|
|
4862
|
+
}
|
|
4863
|
+
return `model::${currentRoute.provider}::${currentRoute.model}`;
|
|
4864
|
+
})();
|
|
4865
|
+
const items = [{
|
|
4866
|
+
id: "__follow_session__",
|
|
4867
|
+
label: t("composer.modelFollowSession") || "跟随当前会话 (默认)"
|
|
4868
|
+
}];
|
|
4869
|
+
if (providers.length > 0) {
|
|
4870
|
+
items.push({
|
|
4871
|
+
type: "separator",
|
|
4872
|
+
id: "sep_follow"
|
|
4873
|
+
});
|
|
4874
|
+
for (const p of providers) {
|
|
4875
|
+
items.push({
|
|
4876
|
+
type: "label",
|
|
4877
|
+
id: `group_${p.id}`,
|
|
4878
|
+
text: p.name
|
|
4879
|
+
});
|
|
4880
|
+
for (const m of p.models) {
|
|
4881
|
+
const efforts = m.reasoning?.efforts ?? [];
|
|
4882
|
+
if (efforts.length === 0) items.push({
|
|
4883
|
+
id: `model::${p.id}::${m.id}`,
|
|
4884
|
+
label: m.name || m.id
|
|
4885
|
+
});
|
|
4886
|
+
else {
|
|
4887
|
+
const submenuEntries = [{
|
|
4888
|
+
id: `effort::${p.id}::${m.id}::__auto__`,
|
|
4889
|
+
label: t("composer.effortAuto") || "自动最低档 (推荐)"
|
|
4890
|
+
}];
|
|
4891
|
+
for (const eff of efforts) submenuEntries.push({
|
|
4892
|
+
id: `effort::${p.id}::${m.id}::${eff.id}`,
|
|
4893
|
+
label: eff.name ? `${eff.name} (${eff.id})` : eff.id
|
|
4894
|
+
});
|
|
4895
|
+
items.push({
|
|
4896
|
+
id: `model_parent::${p.id}::${m.id}`,
|
|
4897
|
+
label: m.name || m.id,
|
|
4898
|
+
submenu: submenuEntries
|
|
4899
|
+
});
|
|
4900
|
+
}
|
|
4901
|
+
}
|
|
4902
|
+
}
|
|
4903
|
+
}
|
|
4904
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4905
|
+
className: "dcu-prediction-model-picker-root",
|
|
4906
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: `
|
|
4907
|
+
.dcu-prediction-model-picker-root {
|
|
4908
|
+
display: inline-flex;
|
|
4909
|
+
align-items: center;
|
|
4910
|
+
position: relative;
|
|
4911
|
+
}
|
|
4912
|
+
.dcu-prediction-model-trigger {
|
|
4913
|
+
display: inline-flex;
|
|
4914
|
+
align-items: center;
|
|
4915
|
+
justify-content: space-between;
|
|
4916
|
+
gap: 6px;
|
|
4917
|
+
min-width: 140px;
|
|
4918
|
+
max-width: 280px;
|
|
4919
|
+
height: 32px;
|
|
4920
|
+
padding: 0 10px;
|
|
4921
|
+
font-size: 13px;
|
|
4922
|
+
border-radius: 6px;
|
|
4923
|
+
}
|
|
4924
|
+
.dcu-prediction-model-label {
|
|
4925
|
+
overflow: hidden;
|
|
4926
|
+
text-overflow: ellipsis;
|
|
4927
|
+
white-space: nowrap;
|
|
4928
|
+
flex: 1 1 auto;
|
|
4929
|
+
text-align: left;
|
|
4930
|
+
}
|
|
4931
|
+
.dcu-prediction-model-arrow {
|
|
4932
|
+
flex: 0 0 auto;
|
|
4933
|
+
transition: transform 150ms ease;
|
|
4934
|
+
opacity: 0.7;
|
|
4935
|
+
}
|
|
4936
|
+
.dcu-prediction-model-arrow.is-rotated {
|
|
4937
|
+
transform: rotate(180deg);
|
|
4938
|
+
}
|
|
4939
|
+
` }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
|
4940
|
+
open,
|
|
4941
|
+
anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
4942
|
+
variant: "outline",
|
|
4943
|
+
size: "sm",
|
|
4944
|
+
disabled,
|
|
4945
|
+
"aria-expanded": open,
|
|
4946
|
+
"aria-haspopup": "menu",
|
|
4947
|
+
className: `dcu-prediction-model-trigger ${open ? "is-open" : ""}`,
|
|
4948
|
+
onClick: () => {
|
|
4949
|
+
if (!disabled) setOpen((prev) => !prev);
|
|
4950
|
+
},
|
|
4951
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4952
|
+
className: "dcu-prediction-model-label",
|
|
4953
|
+
title: triggerText,
|
|
4954
|
+
children: triggerText
|
|
4955
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronDownOutlineMedium, {
|
|
4956
|
+
size: 12,
|
|
4957
|
+
className: `dcu-prediction-model-arrow ${open ? "is-rotated" : ""}`
|
|
4958
|
+
})]
|
|
4959
|
+
}),
|
|
4960
|
+
items,
|
|
4961
|
+
selectedId,
|
|
4962
|
+
onClose: () => setOpen(false),
|
|
4963
|
+
onSelect: handleSelect,
|
|
4964
|
+
portal: true,
|
|
4965
|
+
dense: true,
|
|
4966
|
+
align: "end"
|
|
4967
|
+
})]
|
|
4968
|
+
});
|
|
4969
|
+
}
|
|
4970
|
+
//#endregion
|
|
4742
4971
|
//#region src/client/composer/ComposerSettingsCard.tsx
|
|
4743
4972
|
/**
|
|
4744
4973
|
* 输入框增强设置卡片。
|
|
@@ -4808,6 +5037,22 @@ ${SECTION_CARD_CSS}
|
|
|
4808
5037
|
}
|
|
4809
5038
|
})]
|
|
4810
5039
|
}),
|
|
5040
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5041
|
+
className: "dcu-settings-row",
|
|
5042
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5043
|
+
className: "dcu-settings-row-label",
|
|
5044
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5045
|
+
className: "dcu-settings-row-title",
|
|
5046
|
+
children: t("composer.predictionModel")
|
|
5047
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5048
|
+
className: "dcu-settings-row-hint",
|
|
5049
|
+
children: t("composer.predictionModelHint")
|
|
5050
|
+
})]
|
|
5051
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PredictionModelPicker, {
|
|
5052
|
+
t,
|
|
5053
|
+
disabled: lockedByHost || state.mode === "off"
|
|
5054
|
+
})]
|
|
5055
|
+
}),
|
|
4811
5056
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4812
5057
|
className: "dcu-settings-row",
|
|
4813
5058
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -5462,6 +5707,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
5462
5707
|
"composer.modeOff": "オフ",
|
|
5463
5708
|
"composer.modeContinue": "続きのみ",
|
|
5464
5709
|
"composer.modeAll": "予測+続き",
|
|
5710
|
+
"composer.predictionModel": "予測モデル",
|
|
5711
|
+
"composer.predictionModelHint": "デフォルトでは現在の会話に追従します。高速モデルを指定することも可能です。",
|
|
5712
|
+
"composer.modelFollowSession": "現在の会話に従う (デフォルト)",
|
|
5713
|
+
"composer.effortAuto": "自動最少推論 (推奨)",
|
|
5465
5714
|
"composer.historyScope": "履歴の呼び出し範囲",
|
|
5466
5715
|
"composer.historyScopeHint": "現在の会話のみ、または同じワークスペースのすべての会話と共有します。",
|
|
5467
5716
|
"composer.historyScopeSession": "現在の会話",
|
|
@@ -5685,6 +5934,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
5685
5934
|
"composer.modeOff": "Desactivado",
|
|
5686
5935
|
"composer.modeContinue": "Solo continuación",
|
|
5687
5936
|
"composer.modeAll": "Predicción y continuación",
|
|
5937
|
+
"composer.predictionModel": "Modelo de predicción",
|
|
5938
|
+
"composer.predictionModelHint": "Sigue la sesión actual por defecto; o especifique un modelo rápido.",
|
|
5939
|
+
"composer.modelFollowSession": "Seguir sesión actual (por defecto)",
|
|
5940
|
+
"composer.effortAuto": "Esfuerzo mínimo automático (recomendado)",
|
|
5688
5941
|
"composer.historyScope": "Alcance del historial",
|
|
5689
5942
|
"composer.historyScopeHint": "Recupera mensajes solo de esta conversación o compártelos con todas las conversaciones del espacio de trabajo.",
|
|
5690
5943
|
"composer.historyScopeSession": "Esta conversación",
|
|
@@ -5908,6 +6161,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
5908
6161
|
"composer.modeOff": "Désactivé",
|
|
5909
6162
|
"composer.modeContinue": "Continuer seulement",
|
|
5910
6163
|
"composer.modeAll": "Prédiction et continuation",
|
|
6164
|
+
"composer.predictionModel": "Modèle de prédiction",
|
|
6165
|
+
"composer.predictionModelHint": "Suit la session actuelle par défaut ; ou spécifiez un modèle rapide.",
|
|
6166
|
+
"composer.modelFollowSession": "Suivre la session actuelle (par défaut)",
|
|
6167
|
+
"composer.effortAuto": "Effort minimal automatique (recommandé)",
|
|
5911
6168
|
"composer.historyScope": "Portée de l'historique",
|
|
5912
6169
|
"composer.historyScopeHint": "Rappelez les messages de cette conversation uniquement, ou partagez-les avec toutes les conversations de l'espace de travail.",
|
|
5913
6170
|
"composer.historyScopeSession": "Cette conversation",
|
|
@@ -6131,6 +6388,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
6131
6388
|
"composer.modeOff": "Aus",
|
|
6132
6389
|
"composer.modeContinue": "Nur Fortsetzung",
|
|
6133
6390
|
"composer.modeAll": "Vorhersage & Fortsetzung",
|
|
6391
|
+
"composer.predictionModel": "Vorhersagemodell",
|
|
6392
|
+
"composer.predictionModelHint": "Folgt standardmäßig der aktuellen Unterhaltung; oder ein schnelles Modell festlegen.",
|
|
6393
|
+
"composer.modelFollowSession": "Aktueller Unterhaltung folgen (Standard)",
|
|
6394
|
+
"composer.effortAuto": "Automatisch niedrigste Stufe (Empfohlen)",
|
|
6134
6395
|
"composer.historyScope": "Verlaufsbereich",
|
|
6135
6396
|
"composer.historyScopeHint": "Erinnerte Eingaben nur aus dieser Unterhaltung oder gemeinsam mit allen Unterhaltungen im Arbeitsbereich.",
|
|
6136
6397
|
"composer.historyScopeSession": "Diese Unterhaltung",
|
|
@@ -6354,6 +6615,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
6354
6615
|
"composer.modeOff": "Выкл",
|
|
6355
6616
|
"composer.modeContinue": "Только продолжение",
|
|
6356
6617
|
"composer.modeAll": "Предсказание и продолжение",
|
|
6618
|
+
"composer.predictionModel": "Модель предсказания",
|
|
6619
|
+
"composer.predictionModelHint": "По умолчанию следует за текущим диалогом; или укажите быструю модель.",
|
|
6620
|
+
"composer.modelFollowSession": "Следовать за диалогом (по умолчанию)",
|
|
6621
|
+
"composer.effortAuto": "Авто минимальное рассуждение (рекомендуется)",
|
|
6357
6622
|
"composer.historyScope": "Область истории",
|
|
6358
6623
|
"composer.historyScopeHint": "Показывать введённые сообщения только этого диалога или всех диалогов рабочей области.",
|
|
6359
6624
|
"composer.historyScopeSession": "Этот диалог",
|
|
@@ -6577,6 +6842,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
6577
6842
|
"composer.modeOff": "Desativado",
|
|
6578
6843
|
"composer.modeContinue": "Apenas continuação",
|
|
6579
6844
|
"composer.modeAll": "Previsão e continuação",
|
|
6845
|
+
"composer.predictionModel": "Modelo de previsão",
|
|
6846
|
+
"composer.predictionModelHint": "Segue a conversa atual por padrão; ou especifique um modelo rápido.",
|
|
6847
|
+
"composer.modelFollowSession": "Seguir conversa atual (padrão)",
|
|
6848
|
+
"composer.effortAuto": "Esforço mínimo automático (recomendado)",
|
|
6580
6849
|
"composer.historyScope": "Escopo do histórico",
|
|
6581
6850
|
"composer.historyScopeHint": "Recupere mensagens apenas desta conversa ou compartilhe com todas as conversas do espaço de trabalho.",
|
|
6582
6851
|
"composer.historyScopeSession": "Esta conversa",
|
|
@@ -6890,6 +7159,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
6890
7159
|
"composer.modeOff": "关闭",
|
|
6891
7160
|
"composer.modeContinue": "仅续写",
|
|
6892
7161
|
"composer.modeAll": "推测+续写",
|
|
7162
|
+
"composer.predictionModel": "预测调用模型",
|
|
7163
|
+
"composer.predictionModelHint": "默认跟随当前会话;可指定专属轻量小模型以降低延迟与 Token 费用。",
|
|
7164
|
+
"composer.modelFollowSession": "跟随当前会话 (默认)",
|
|
7165
|
+
"composer.effortAuto": "自动最低档 (推荐)",
|
|
6893
7166
|
"composer.historyScope": "历史召回范围",
|
|
6894
7167
|
"composer.historyScopeHint": "仅在当前会话内召回,或与同一工作区的所有会话共享。",
|
|
6895
7168
|
"composer.historyScopeSession": "当前会话",
|
|
@@ -7111,6 +7384,10 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
7111
7384
|
"composer.modeOff": "Off",
|
|
7112
7385
|
"composer.modeContinue": "Continuation only",
|
|
7113
7386
|
"composer.modeAll": "Prediction & continuation",
|
|
7387
|
+
"composer.predictionModel": "Prediction model",
|
|
7388
|
+
"composer.predictionModelHint": "Follows the active session by default; or specify a fast model to reduce latency and token usage.",
|
|
7389
|
+
"composer.modelFollowSession": "Follow current session (default)",
|
|
7390
|
+
"composer.effortAuto": "Auto lowest effort (recommended)",
|
|
7114
7391
|
"composer.historyScope": "History scope",
|
|
7115
7392
|
"composer.historyScopeHint": "Recall prompts from this conversation only, or share them across every conversation in the workspace.",
|
|
7116
7393
|
"composer.historyScopeSession": "This conversation",
|
|
@@ -10783,17 +11060,20 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
10783
11060
|
});
|
|
10784
11061
|
};
|
|
10785
11062
|
try {
|
|
11063
|
+
const selectedRoute = getPredictionRoute();
|
|
11064
|
+
const payload = {
|
|
11065
|
+
sessionId,
|
|
11066
|
+
mode,
|
|
11067
|
+
draft: draftText
|
|
11068
|
+
};
|
|
11069
|
+
if (selectedRoute && selectedRoute.provider && selectedRoute.model) payload.route = selectedRoute;
|
|
10786
11070
|
const response = await fetch(ENDPOINT, {
|
|
10787
11071
|
method: "POST",
|
|
10788
11072
|
headers: {
|
|
10789
11073
|
"content-type": "application/json",
|
|
10790
11074
|
accept: "text/event-stream"
|
|
10791
11075
|
},
|
|
10792
|
-
body: JSON.stringify(
|
|
10793
|
-
sessionId,
|
|
10794
|
-
mode,
|
|
10795
|
-
draft: draftText
|
|
10796
|
-
}),
|
|
11076
|
+
body: JSON.stringify(payload),
|
|
10797
11077
|
signal: controller.signal
|
|
10798
11078
|
});
|
|
10799
11079
|
if (!response.ok || controller.signal.aborted) {
|
|
@@ -14,6 +14,24 @@ type ComposerPluginConfig = {
|
|
|
14
14
|
* @default true
|
|
15
15
|
*/
|
|
16
16
|
prediction?: boolean;
|
|
17
|
+
/** 固定预测调用的 LLM provider(例如 deepseek) */
|
|
18
|
+
provider?: string;
|
|
19
|
+
/** 固定预测调用的 LLM model(例如 deepseek-chat) */
|
|
20
|
+
model?: string;
|
|
21
|
+
/** 预测调用的 reasoning effort(off | low | high | max) */
|
|
22
|
+
reasoningEffort?: string;
|
|
23
|
+
/** 预测生成的最大 token 数(16 ~ 4096,默认 220) */
|
|
24
|
+
maxOutputTokens?: number;
|
|
25
|
+
/** 单次预测超时时间毫秒数(1000 ~ 120000,默认 20000) */
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
/** 纳入上下文的最大历史消息条数(2 ~ 40,默认 10) */
|
|
28
|
+
maxMessages?: number;
|
|
29
|
+
/** 纳入上下文的最大字符数(500 ~ 40000,默认 8000) */
|
|
30
|
+
maxChars?: number;
|
|
31
|
+
/** 返回的最大候选数(1 ~ 5,默认 3) */
|
|
32
|
+
maxSuggestions?: number;
|
|
33
|
+
/** 提取的工具活动摘要条数(0 ~ 20,默认 6) */
|
|
34
|
+
maxToolNotes?: number;
|
|
17
35
|
};
|
|
18
36
|
/** 严格读取配置:只有显式 `false` 才关闭,其余(含未声明、类型错误)一律视为开启。 */
|
|
19
37
|
declare function resolvePredictionAllowed(config: ComposerPluginConfig | undefined): boolean;
|
package/lib/composer-plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-
|
|
1
|
+
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-DSHfL3KW.mjs";
|
|
2
2
|
//#region src/composer-prediction.ts
|
|
3
3
|
/** 使用自研专属命名空间端点,杜绝与社区插件全局路径冲突 */
|
|
4
4
|
const ENDPOINT = CODEX_UI_API_ENDPOINTS.composerPrediction;
|
|
@@ -288,6 +288,16 @@ async function planRequest(ctx, request, response) {
|
|
|
288
288
|
error: "no-draft"
|
|
289
289
|
};
|
|
290
290
|
const seq = Number(session.seq);
|
|
291
|
+
let clientRoute;
|
|
292
|
+
if (body?.route && typeof body.route === "object") {
|
|
293
|
+
const p = typeof body.route.provider === "string" ? body.route.provider.trim() : "";
|
|
294
|
+
const m = typeof body.route.model === "string" ? body.route.model.trim() : "";
|
|
295
|
+
if (p !== "" && m !== "") clientRoute = {
|
|
296
|
+
provider: p,
|
|
297
|
+
model: m,
|
|
298
|
+
...typeof body.route.reasoningEffort === "string" && body.route.reasoningEffort.trim() !== "" ? { reasoningEffort: body.route.reasoningEffort.trim() } : {}
|
|
299
|
+
};
|
|
300
|
+
}
|
|
291
301
|
return {
|
|
292
302
|
sessionId,
|
|
293
303
|
session,
|
|
@@ -298,8 +308,12 @@ async function planRequest(ctx, request, response) {
|
|
|
298
308
|
sessionId,
|
|
299
309
|
seq,
|
|
300
310
|
mode,
|
|
301
|
-
draft
|
|
302
|
-
|
|
311
|
+
draft,
|
|
312
|
+
clientRoute?.provider,
|
|
313
|
+
clientRoute?.model,
|
|
314
|
+
clientRoute?.reasoningEffort
|
|
315
|
+
]),
|
|
316
|
+
clientRoute
|
|
303
317
|
};
|
|
304
318
|
}
|
|
305
319
|
/**
|
|
@@ -316,7 +330,7 @@ async function runPrediction(ctx, options, cache, inflight, plan, signals, onDel
|
|
|
316
330
|
const controller = new AbortController();
|
|
317
331
|
inflight.add(controller);
|
|
318
332
|
try {
|
|
319
|
-
const result = await predict(ctx, options, plan.session, plan.sessionId, plan.mode, plan.draft, joinSignals([controller.signal, ...signals]), onDelta);
|
|
333
|
+
const result = await predict(ctx, options, plan.session, plan.sessionId, plan.mode, plan.draft, joinSignals([controller.signal, ...signals]), onDelta, plan.clientRoute);
|
|
320
334
|
if (result.items.length > 0 && !controller.signal.aborted && !signals.some((signal) => signal.aborted)) remember(cache, plan.key, { items: result.items });
|
|
321
335
|
return result;
|
|
322
336
|
} finally {
|
|
@@ -327,13 +341,13 @@ async function runPrediction(ctx, options, cache, inflight, plan, signals, onDel
|
|
|
327
341
|
* Run one auxiliary model call over the transcript tail and tool activity.
|
|
328
342
|
* @returns `{ items }` on success or `{ items: [], reason }` when none is usable.
|
|
329
343
|
*/
|
|
330
|
-
async function predict(ctx, options, session, sessionId, mode, draft, signal, onDelta) {
|
|
344
|
+
async function predict(ctx, options, session, sessionId, mode, draft, signal, onDelta, clientRoute) {
|
|
331
345
|
const prompt = buildPrompt(session, options, mode, draft);
|
|
332
346
|
if (prompt === null) return {
|
|
333
347
|
items: [],
|
|
334
348
|
reason: "no-conversation"
|
|
335
349
|
};
|
|
336
|
-
const route = resolveRoute(ctx, session, options);
|
|
350
|
+
const route = resolveRoute(ctx, session, options, clientRoute);
|
|
337
351
|
if (route === void 0) return {
|
|
338
352
|
items: [],
|
|
339
353
|
reason: "no-route"
|
|
@@ -361,9 +375,11 @@ async function predict(ctx, options, session, sessionId, mode, draft, signal, on
|
|
|
361
375
|
effortIds = [];
|
|
362
376
|
}
|
|
363
377
|
if (effortIds && effortIds.length > 0) {
|
|
364
|
-
const requested = options.reasoningEffort || "off";
|
|
378
|
+
const requested = clientRoute?.reasoningEffort || options.reasoningEffort || "off";
|
|
365
379
|
if (effortIds.includes(requested)) targetEffort = requested;
|
|
366
380
|
else if (effortIds.includes("off")) targetEffort = "off";
|
|
381
|
+
else if (effortIds.includes("low")) targetEffort = "low";
|
|
382
|
+
else targetEffort = effortIds[0];
|
|
367
383
|
}
|
|
368
384
|
}
|
|
369
385
|
const baseConfig = {
|
|
@@ -443,8 +459,13 @@ function remember(cache, key, entry) {
|
|
|
443
459
|
const oldest = cache.keys().next();
|
|
444
460
|
if (!oldest.done) cache.delete(oldest.value);
|
|
445
461
|
}
|
|
446
|
-
/** Prefer
|
|
447
|
-
function resolveRoute(ctx, session, options) {
|
|
462
|
+
/** Prefer explicit client route first, then fixed host options route, then session route, then default model. */
|
|
463
|
+
function resolveRoute(ctx, session, options, clientRoute) {
|
|
464
|
+
if (clientRoute && clientRoute.provider && clientRoute.model) return {
|
|
465
|
+
provider: clientRoute.provider,
|
|
466
|
+
model: clientRoute.model,
|
|
467
|
+
...clientRoute.reasoningEffort ? { reasoningEffort: clientRoute.reasoningEffort } : {}
|
|
468
|
+
};
|
|
448
469
|
if (options.provider !== "" && options.model !== "") return {
|
|
449
470
|
provider: options.provider,
|
|
450
471
|
model: options.model
|
|
@@ -733,9 +754,93 @@ function timedSignal(signal, timeoutMs) {
|
|
|
733
754
|
};
|
|
734
755
|
}
|
|
735
756
|
//#endregion
|
|
757
|
+
//#region src/composer-models.ts
|
|
758
|
+
let catalogCache;
|
|
759
|
+
const CATALOG_TTL_MS = 3e4;
|
|
760
|
+
/**
|
|
761
|
+
* 收集当前宿主已配置的所有可用提供商与模型目录。
|
|
762
|
+
* 遵循与 dsh-automation / dsh-im-connect 一致的提供商排序规范(官方置顶)。
|
|
763
|
+
* 单模型推理信息探测附带超时保护,杜绝外部提供商异常挂死端点。
|
|
764
|
+
*/
|
|
765
|
+
async function collectModelCatalog(ctx) {
|
|
766
|
+
const now = Date.now();
|
|
767
|
+
if (catalogCache !== void 0 && catalogCache.expiresAt > now) return catalogCache.data;
|
|
768
|
+
const llm = ctx.llm ?? ctx.get?.("llm");
|
|
769
|
+
if (!llm || typeof llm.listProviders !== "function") return [];
|
|
770
|
+
let rawProviders = [];
|
|
771
|
+
try {
|
|
772
|
+
rawProviders = llm.listProviders() ?? [];
|
|
773
|
+
} catch {
|
|
774
|
+
return [];
|
|
775
|
+
}
|
|
776
|
+
const providers = [];
|
|
777
|
+
for (const item of rawProviders) {
|
|
778
|
+
const providerId = String(item.id ?? item.provider ?? "").trim();
|
|
779
|
+
if (!providerId) continue;
|
|
780
|
+
const providerName = String(item.name ?? providerId);
|
|
781
|
+
let modelsRaw = [];
|
|
782
|
+
try {
|
|
783
|
+
if (typeof llm.listModels === "function") modelsRaw = await llm.listModels(providerId) ?? [];
|
|
784
|
+
} catch {
|
|
785
|
+
modelsRaw = [];
|
|
786
|
+
}
|
|
787
|
+
const models = [];
|
|
788
|
+
for (const m of modelsRaw) {
|
|
789
|
+
const modelId = String(m?.id ?? "").trim();
|
|
790
|
+
if (!modelId) continue;
|
|
791
|
+
let reasoning = null;
|
|
792
|
+
try {
|
|
793
|
+
if (typeof llm.resolveModelInfo === "function") {
|
|
794
|
+
let timer;
|
|
795
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
796
|
+
timer = setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 1500);
|
|
797
|
+
});
|
|
798
|
+
try {
|
|
799
|
+
const info = await Promise.race([llm.resolveModelInfo(providerId, modelId), timeoutPromise]);
|
|
800
|
+
if (info?.reasoning && Array.isArray(info.reasoning.efforts) && info.reasoning.efforts.length > 0) reasoning = {
|
|
801
|
+
efforts: info.reasoning.efforts.map((e) => ({
|
|
802
|
+
id: String(e.id ?? ""),
|
|
803
|
+
name: e.name ? String(e.name) : void 0,
|
|
804
|
+
description: e.description ? String(e.description) : void 0
|
|
805
|
+
})).filter((e) => e.id !== ""),
|
|
806
|
+
defaultEffort: info.reasoning.defaultEffort ? String(info.reasoning.defaultEffort) : void 0
|
|
807
|
+
};
|
|
808
|
+
} finally {
|
|
809
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
} catch {
|
|
813
|
+
reasoning = null;
|
|
814
|
+
}
|
|
815
|
+
models.push({
|
|
816
|
+
id: modelId,
|
|
817
|
+
name: m.name ? String(m.name) : modelId,
|
|
818
|
+
description: m.description ? String(m.description) : void 0,
|
|
819
|
+
reasoning
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
if (models.length > 0) providers.push({
|
|
823
|
+
id: providerId,
|
|
824
|
+
name: providerName,
|
|
825
|
+
models
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
providers.sort((a, b) => {
|
|
829
|
+
const rankA = a.id === "deepseek-account" ? 0 : a.id === "deepseek-official" ? 1 : 2;
|
|
830
|
+
const rankB = b.id === "deepseek-account" ? 0 : b.id === "deepseek-official" ? 1 : 2;
|
|
831
|
+
if (rankA !== rankB) return rankA - rankB;
|
|
832
|
+
return a.name.localeCompare(b.name);
|
|
833
|
+
});
|
|
834
|
+
catalogCache = {
|
|
835
|
+
expiresAt: now + CATALOG_TTL_MS,
|
|
836
|
+
data: providers
|
|
837
|
+
};
|
|
838
|
+
return providers;
|
|
839
|
+
}
|
|
840
|
+
//#endregion
|
|
736
841
|
//#region src/composer-plugin.ts
|
|
737
842
|
const name = "codex-ui-composer";
|
|
738
|
-
const inject = ["webServer"];
|
|
843
|
+
const inject = ["webServer", "llm"];
|
|
739
844
|
function isSubPluginDisabledOnDisk(id, homeDir, ctx) {
|
|
740
845
|
return isSubPluginDisabledOnDisk$1(id, homeDir, ctx);
|
|
741
846
|
}
|
|
@@ -754,7 +859,7 @@ function apply(ctx, config) {
|
|
|
754
859
|
const predictionAllowed = resolvePredictionAllowed(config);
|
|
755
860
|
ctx.effect(() => {
|
|
756
861
|
if (isSubPluginDisabledOnDisk("codex-ui-composer", void 0, ctx) || !predictionAllowed) return () => {};
|
|
757
|
-
apply$1(ctx);
|
|
862
|
+
apply$1(ctx, config);
|
|
758
863
|
return () => {};
|
|
759
864
|
}, "michengai-codex-ui: composer predictions engine");
|
|
760
865
|
ctx.effect(() => {
|
|
@@ -775,8 +880,35 @@ function apply(ctx, config) {
|
|
|
775
880
|
}));
|
|
776
881
|
}
|
|
777
882
|
});
|
|
883
|
+
const disposeModels = webServer.register({
|
|
884
|
+
kind: "exact",
|
|
885
|
+
path: CODEX_UI_API_ENDPOINTS.composerModels,
|
|
886
|
+
handler: async (_request, response) => {
|
|
887
|
+
try {
|
|
888
|
+
const providers = await collectModelCatalog(ctx);
|
|
889
|
+
response.writeHead(200, {
|
|
890
|
+
"content-type": "application/json; charset=utf-8",
|
|
891
|
+
"cache-control": "no-store"
|
|
892
|
+
});
|
|
893
|
+
response.end(JSON.stringify({
|
|
894
|
+
ok: true,
|
|
895
|
+
providers
|
|
896
|
+
}));
|
|
897
|
+
} catch (error) {
|
|
898
|
+
response.writeHead(500, {
|
|
899
|
+
"content-type": "application/json; charset=utf-8",
|
|
900
|
+
"cache-control": "no-store"
|
|
901
|
+
});
|
|
902
|
+
response.end(JSON.stringify({
|
|
903
|
+
ok: false,
|
|
904
|
+
error: String(error)
|
|
905
|
+
}));
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
});
|
|
778
909
|
return () => {
|
|
779
910
|
disposeStatus?.();
|
|
911
|
+
disposeModels?.();
|
|
780
912
|
};
|
|
781
913
|
}, "michengai-codex-ui: composer state");
|
|
782
914
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-
|
|
1
|
+
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-DSHfL3KW.mjs";
|
|
2
2
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { dirname, join } from "node:path";
|
package/lib/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveCurrentProfile, r as CODEX_UI_API_ENDPOINTS } from "./profile-resolver-
|
|
1
|
+
import { n as resolveCurrentProfile, r as CODEX_UI_API_ENDPOINTS } from "./profile-resolver-DSHfL3KW.mjs";
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { homedir } from "node:os";
|
|
@@ -9,6 +9,7 @@ const CODEX_UI_API_ENDPOINTS = Object.freeze({
|
|
|
9
9
|
dependencies: `${CODEX_UI_API_BASE}/dependencies`,
|
|
10
10
|
settingsSkin: `${CODEX_UI_API_BASE}/settings-skin`,
|
|
11
11
|
composer: `${CODEX_UI_API_BASE}/composer`,
|
|
12
|
+
composerModels: `${CODEX_UI_API_BASE}/composer/models`,
|
|
12
13
|
composerPrediction: `${CODEX_UI_API_BASE}/composer/prediction`,
|
|
13
14
|
composerPredictionStream: `${CODEX_UI_API_BASE}/composer/prediction/stream`,
|
|
14
15
|
sidebar: `${CODEX_UI_API_BASE}/sidebar`,
|
|
@@ -79,6 +79,10 @@ const ja = {
|
|
|
79
79
|
"composer.modeOff": "オフ",
|
|
80
80
|
"composer.modeContinue": "続きのみ",
|
|
81
81
|
"composer.modeAll": "予測+続き",
|
|
82
|
+
"composer.predictionModel": "予測モデル",
|
|
83
|
+
"composer.predictionModelHint": "デフォルトでは現在の会話に追従します。高速モデルを指定することも可能です。",
|
|
84
|
+
"composer.modelFollowSession": "現在の会話に従う (デフォルト)",
|
|
85
|
+
"composer.effortAuto": "自動最少推論 (推奨)",
|
|
82
86
|
"composer.historyScope": "履歴の呼び出し範囲",
|
|
83
87
|
"composer.historyScopeHint": "現在の会話のみ、または同じワークスペースのすべての会話と共有します。",
|
|
84
88
|
"composer.historyScopeSession": "現在の会話",
|
|
@@ -302,6 +306,10 @@ const es = {
|
|
|
302
306
|
"composer.modeOff": "Desactivado",
|
|
303
307
|
"composer.modeContinue": "Solo continuación",
|
|
304
308
|
"composer.modeAll": "Predicción y continuación",
|
|
309
|
+
"composer.predictionModel": "Modelo de predicción",
|
|
310
|
+
"composer.predictionModelHint": "Sigue la sesión actual por defecto; o especifique un modelo rápido.",
|
|
311
|
+
"composer.modelFollowSession": "Seguir sesión actual (por defecto)",
|
|
312
|
+
"composer.effortAuto": "Esfuerzo mínimo automático (recomendado)",
|
|
305
313
|
"composer.historyScope": "Alcance del historial",
|
|
306
314
|
"composer.historyScopeHint": "Recupera mensajes solo de esta conversación o compártelos con todas las conversaciones del espacio de trabajo.",
|
|
307
315
|
"composer.historyScopeSession": "Esta conversación",
|
|
@@ -525,6 +533,10 @@ const fr = {
|
|
|
525
533
|
"composer.modeOff": "Désactivé",
|
|
526
534
|
"composer.modeContinue": "Continuer seulement",
|
|
527
535
|
"composer.modeAll": "Prédiction et continuation",
|
|
536
|
+
"composer.predictionModel": "Modèle de prédiction",
|
|
537
|
+
"composer.predictionModelHint": "Suit la session actuelle par défaut ; ou spécifiez un modèle rapide.",
|
|
538
|
+
"composer.modelFollowSession": "Suivre la session actuelle (par défaut)",
|
|
539
|
+
"composer.effortAuto": "Effort minimal automatique (recommandé)",
|
|
528
540
|
"composer.historyScope": "Portée de l'historique",
|
|
529
541
|
"composer.historyScopeHint": "Rappelez les messages de cette conversation uniquement, ou partagez-les avec toutes les conversations de l'espace de travail.",
|
|
530
542
|
"composer.historyScopeSession": "Cette conversation",
|
|
@@ -748,6 +760,10 @@ const de = {
|
|
|
748
760
|
"composer.modeOff": "Aus",
|
|
749
761
|
"composer.modeContinue": "Nur Fortsetzung",
|
|
750
762
|
"composer.modeAll": "Vorhersage & Fortsetzung",
|
|
763
|
+
"composer.predictionModel": "Vorhersagemodell",
|
|
764
|
+
"composer.predictionModelHint": "Folgt standardmäßig der aktuellen Unterhaltung; oder ein schnelles Modell festlegen.",
|
|
765
|
+
"composer.modelFollowSession": "Aktueller Unterhaltung folgen (Standard)",
|
|
766
|
+
"composer.effortAuto": "Automatisch niedrigste Stufe (Empfohlen)",
|
|
751
767
|
"composer.historyScope": "Verlaufsbereich",
|
|
752
768
|
"composer.historyScopeHint": "Erinnerte Eingaben nur aus dieser Unterhaltung oder gemeinsam mit allen Unterhaltungen im Arbeitsbereich.",
|
|
753
769
|
"composer.historyScopeSession": "Diese Unterhaltung",
|
|
@@ -971,6 +987,10 @@ const ru = {
|
|
|
971
987
|
"composer.modeOff": "Выкл",
|
|
972
988
|
"composer.modeContinue": "Только продолжение",
|
|
973
989
|
"composer.modeAll": "Предсказание и продолжение",
|
|
990
|
+
"composer.predictionModel": "Модель предсказания",
|
|
991
|
+
"composer.predictionModelHint": "По умолчанию следует за текущим диалогом; или укажите быструю модель.",
|
|
992
|
+
"composer.modelFollowSession": "Следовать за диалогом (по умолчанию)",
|
|
993
|
+
"composer.effortAuto": "Авто минимальное рассуждение (рекомендуется)",
|
|
974
994
|
"composer.historyScope": "Область истории",
|
|
975
995
|
"composer.historyScopeHint": "Показывать введённые сообщения только этого диалога или всех диалогов рабочей области.",
|
|
976
996
|
"composer.historyScopeSession": "Этот диалог",
|
|
@@ -1194,6 +1214,10 @@ const pt = {
|
|
|
1194
1214
|
"composer.modeOff": "Desativado",
|
|
1195
1215
|
"composer.modeContinue": "Apenas continuação",
|
|
1196
1216
|
"composer.modeAll": "Previsão e continuação",
|
|
1217
|
+
"composer.predictionModel": "Modelo de previsão",
|
|
1218
|
+
"composer.predictionModelHint": "Segue a conversa atual por padrão; ou especifique um modelo rápido.",
|
|
1219
|
+
"composer.modelFollowSession": "Seguir conversa atual (padrão)",
|
|
1220
|
+
"composer.effortAuto": "Esforço mínimo automático (recomendado)",
|
|
1197
1221
|
"composer.historyScope": "Escopo do histórico",
|
|
1198
1222
|
"composer.historyScopeHint": "Recupere mensagens apenas desta conversa ou compartilhe com todas as conversas do espaço de trabalho.",
|
|
1199
1223
|
"composer.historyScopeSession": "Esta conversa",
|
|
@@ -1505,6 +1529,10 @@ const zh = {
|
|
|
1505
1529
|
"composer.modeOff": "关闭",
|
|
1506
1530
|
"composer.modeContinue": "仅续写",
|
|
1507
1531
|
"composer.modeAll": "推测+续写",
|
|
1532
|
+
"composer.predictionModel": "预测调用模型",
|
|
1533
|
+
"composer.predictionModelHint": "默认跟随当前会话;可指定专属轻量小模型以降低延迟与 Token 费用。",
|
|
1534
|
+
"composer.modelFollowSession": "跟随当前会话 (默认)",
|
|
1535
|
+
"composer.effortAuto": "自动最低档 (推荐)",
|
|
1508
1536
|
"composer.historyScope": "历史召回范围",
|
|
1509
1537
|
"composer.historyScopeHint": "仅在当前会话内召回,或与同一工作区的所有会话共享。",
|
|
1510
1538
|
"composer.historyScopeSession": "当前会话",
|
|
@@ -1726,6 +1754,10 @@ const en = {
|
|
|
1726
1754
|
"composer.modeOff": "Off",
|
|
1727
1755
|
"composer.modeContinue": "Continuation only",
|
|
1728
1756
|
"composer.modeAll": "Prediction & continuation",
|
|
1757
|
+
"composer.predictionModel": "Prediction model",
|
|
1758
|
+
"composer.predictionModelHint": "Follows the active session by default; or specify a fast model to reduce latency and token usage.",
|
|
1759
|
+
"composer.modelFollowSession": "Follow current session (default)",
|
|
1760
|
+
"composer.effortAuto": "Auto lowest effort (recommended)",
|
|
1729
1761
|
"composer.historyScope": "History scope",
|
|
1730
1762
|
"composer.historyScopeHint": "Recall prompts from this conversation only, or share them across every conversation in the workspace.",
|
|
1731
1763
|
"composer.historyScopeSession": "This conversation",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk } from "./profile-resolver-
|
|
1
|
+
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk } from "./profile-resolver-DSHfL3KW.mjs";
|
|
2
2
|
//#region src/settings-skin-plugin.ts
|
|
3
3
|
const name = "codex-ui-settings-skin";
|
|
4
4
|
const inject = ["webServer"];
|
package/lib/sidebar-plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-
|
|
1
|
+
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-DSHfL3KW.mjs";
|
|
2
2
|
//#region src/sidebar-plugin.ts
|
|
3
3
|
const name = "codex-ui-sidebar";
|
|
4
4
|
const inject = ["webServer"];
|
package/lib/theme-plugin.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-
|
|
1
|
+
import { r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk$1 } from "./profile-resolver-DSHfL3KW.mjs";
|
|
2
2
|
//#region src/theme-plugin.ts
|
|
3
3
|
const name = "codex-ui-theme";
|
|
4
4
|
const inject = ["webServer"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-ui",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "DSH Codex UI — 为 DeepSeek Harness 提供极速历史召回、全屏设置皮肤、原生物理毛玻璃换肤、模块化侧栏与桌面原生窗口菜单 · Input enhancement, settings skin, native glass theme, modular sidebar, and desktop titlebar menu for DSH",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|