@michengai/dsh-codex-ui 2.4.2 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/CHANGELOG.zh-CN.md +11 -0
- package/lib/client.js +72 -15
- package/lib/index.d.mts +12 -1
- package/lib/index.mjs +43 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.4.3] - 2026-11-22
|
|
4
|
+
|
|
5
|
+
- **Improve Prediction Ghost Text Visibility and Layering (Issue #110)**:
|
|
6
|
+
- Fixed an issue where prediction suggestions could be obscured by card backgrounds or input containers, ensuring ghost completions remain clearly legible.
|
|
7
|
+
- **Fix Network Requests and Error Logs When Composer Feature is Disabled (Issue #112)**:
|
|
8
|
+
- Fixed an issue where disabling input composer enhancements in settings caused background probes to repeatedly log 404 errors;
|
|
9
|
+
- Probes now cleanly detect disabled state and halt unnecessary polling, keeping developer tools and network traffic clean.
|
|
10
|
+
- **Enhance Coexistence Compatibility with Third-Party Plugins on Hero Page (Issue #111)**:
|
|
11
|
+
- Fixed an issue where running alongside third-party workspace enhancement plugins could trigger conflicts and prevent hero components from rendering;
|
|
12
|
+
- Improved interface extension tolerance so workspace selection and search remain smooth and stable when multiple plugins are active.
|
|
13
|
+
|
|
3
14
|
## [2.4.2] - 2026-11-21
|
|
4
15
|
|
|
5
16
|
- **Fix Prediction Candidates Display and Control Text Filtering with Reasoning Models (Issue #108, PR #109)**:
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
+
## [2.4.3] - 2026-11-22
|
|
4
|
+
|
|
5
|
+
- **提升输入预测幽灵建议文本的层级显示效果(Issue #110)**:
|
|
6
|
+
- 修复了在部分界面卡片或复杂背景下输入预测幽灵建议文本被底层遮挡的问题,保证智能补全提示始终清晰完整可见。
|
|
7
|
+
- **修复输入框增强功能停用时的网络异常与日志报错(Issue #112)**:
|
|
8
|
+
- 修复了在设置中停用输入框增强后,系统仍会在后台探测并持续产生 404 错误的问题;
|
|
9
|
+
- 优化探活行为,停用状态下直接返回关闭状态并停止不必要的后台请求,保持控制台与网络记录干净无杂音。
|
|
10
|
+
- **增强欢迎页项目选择器与第三方插件的共存兼容性(Issue #111)**:
|
|
11
|
+
- 修复了同时启用包含工作区增强的第三方插件(如部分侧栏与文件夹分类插件)时,欢迎页项目选择器可能发生冲突导致界面加载异常的问题;
|
|
12
|
+
- 提升了界面扩展槽位的容错与兼容能力,确保多插件共存时欢迎页各项操作与搜索功能稳定流畅运行。
|
|
13
|
+
|
|
3
14
|
## [2.4.2] - 2026-11-21
|
|
4
15
|
|
|
5
16
|
- **修复输入预测在推理模型下的候选生成与显示异常(Issue #108、PR #109)**:
|
package/lib/client.js
CHANGED
|
@@ -9940,6 +9940,34 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
9940
9940
|
};
|
|
9941
9941
|
}
|
|
9942
9942
|
//#endregion
|
|
9943
|
+
//#region src/client/composer/slot-safety.ts
|
|
9944
|
+
/**
|
|
9945
|
+
* 安全注册 single slot:
|
|
9946
|
+
* 1. 当遇到同 priority 碰撞报错(例如被第三方插件占用)时,自动递减 priority 至更低档位重试:
|
|
9947
|
+
* 既规避同 priority 冲突崩溃,又在 DSH single slot 机制中以更低数值优先胜出渲染(lowest renders);
|
|
9948
|
+
* 2. 超过最大重试次数或发生不可恢复异常时安全降级,打印警告并返回 no-op 清理函数,
|
|
9949
|
+
* 确保绝不抛出未捕获异常阻塞插件后续生命周期的加载。
|
|
9950
|
+
*/
|
|
9951
|
+
function registerSingleSlotSafely(slots, options, component, maxRetries = 5) {
|
|
9952
|
+
let priority = options.priority ?? 0;
|
|
9953
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) try {
|
|
9954
|
+
return slots.register({
|
|
9955
|
+
...options,
|
|
9956
|
+
priority
|
|
9957
|
+
}, component);
|
|
9958
|
+
} catch (err) {
|
|
9959
|
+
if ((err instanceof Error ? err.message : String(err)).includes("already has a registration at priority") && attempt < maxRetries) {
|
|
9960
|
+
const nextPriority = priority - 1;
|
|
9961
|
+
console.info(`[codex-ui] single slot "${options.name}" already occupied at priority ${priority}, fallback to priority ${nextPriority} to win registration`);
|
|
9962
|
+
priority = nextPriority;
|
|
9963
|
+
continue;
|
|
9964
|
+
}
|
|
9965
|
+
console.warn(`[codex-ui] Failed to register single slot "${options.name}":`, err);
|
|
9966
|
+
return () => {};
|
|
9967
|
+
}
|
|
9968
|
+
return () => {};
|
|
9969
|
+
}
|
|
9970
|
+
//#endregion
|
|
9943
9971
|
//#region src/client/composer/input-history.ts
|
|
9944
9972
|
const HISTORY_KEY = "michengai.codex-ui.input-history.v1";
|
|
9945
9973
|
const LEGACY_HISTORY_KEY = "michengai.btw.history.v1";
|
|
@@ -11071,7 +11099,7 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
11071
11099
|
whiteSpace: "nowrap",
|
|
11072
11100
|
pointerEvents: "none",
|
|
11073
11101
|
userSelect: "none",
|
|
11074
|
-
zIndex:
|
|
11102
|
+
zIndex: 8
|
|
11075
11103
|
};
|
|
11076
11104
|
/** The continuation ghost hugs its text and sits where the caret is. */
|
|
11077
11105
|
const CONTINUE_GHOST_STYLE = {
|
|
@@ -11079,7 +11107,7 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
11079
11107
|
gap: "6px",
|
|
11080
11108
|
padding: "0 4px",
|
|
11081
11109
|
borderRadius: "4px",
|
|
11082
|
-
zIndex:
|
|
11110
|
+
zIndex: 9
|
|
11083
11111
|
};
|
|
11084
11112
|
const TEXT_STYLE = {
|
|
11085
11113
|
flex: "1 1 auto",
|
|
@@ -11795,6 +11823,9 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
11795
11823
|
/**
|
|
11796
11824
|
* 读取 Host 状态:子插件是否启用,以及站点级是否允许预测。
|
|
11797
11825
|
* 网络/解析失败一律返回“全部关闭”,避免在宿主不可达时仍然悄悄花 token。
|
|
11826
|
+
*
|
|
11827
|
+
* `explicitlyDisabled` 区分两种关闭:宿主明确回答 `{ enabled: false }`(子插件被停用)
|
|
11828
|
+
* 与端点不存在/不可达(404、网关未就绪)。前者不再重试,后者允许冷启有界退避。
|
|
11798
11829
|
*/
|
|
11799
11830
|
async function fetchComposerStatus() {
|
|
11800
11831
|
try {
|
|
@@ -11804,17 +11835,20 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
11804
11835
|
});
|
|
11805
11836
|
if (!response.ok) return {
|
|
11806
11837
|
enabled: false,
|
|
11807
|
-
prediction: false
|
|
11838
|
+
prediction: false,
|
|
11839
|
+
explicitlyDisabled: false
|
|
11808
11840
|
};
|
|
11809
11841
|
const data = await response.json();
|
|
11810
11842
|
return {
|
|
11811
11843
|
enabled: data?.enabled === true,
|
|
11812
|
-
prediction: data?.prediction !== false
|
|
11844
|
+
prediction: data?.prediction !== false,
|
|
11845
|
+
explicitlyDisabled: data?.enabled === false
|
|
11813
11846
|
};
|
|
11814
11847
|
} catch {
|
|
11815
11848
|
return {
|
|
11816
11849
|
enabled: false,
|
|
11817
|
-
prediction: false
|
|
11850
|
+
prediction: false,
|
|
11851
|
+
explicitlyDisabled: false
|
|
11818
11852
|
};
|
|
11819
11853
|
}
|
|
11820
11854
|
}
|
|
@@ -11897,7 +11931,7 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
11897
11931
|
...pickerInjected
|
|
11898
11932
|
});
|
|
11899
11933
|
}
|
|
11900
|
-
const unregisterWorkspacePicker = ctx.slots.inject("conversation.hero.workspace", () => ctx.slots
|
|
11934
|
+
const unregisterWorkspacePicker = ctx.slots.inject("conversation.hero.workspace", () => registerSingleSlotSafely(ctx.slots, {
|
|
11901
11935
|
name: "conversation.hero.workspace",
|
|
11902
11936
|
priority: -100,
|
|
11903
11937
|
locale: NS
|
|
@@ -11930,21 +11964,47 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
11930
11964
|
if (typeof document !== "undefined") document.querySelectorAll("[data-dcu-width-handle]").forEach((el) => el.remove());
|
|
11931
11965
|
};
|
|
11932
11966
|
};
|
|
11933
|
-
|
|
11967
|
+
let retryTimer;
|
|
11968
|
+
let startupRetryCount = 0;
|
|
11969
|
+
const MAX_STARTUP_RETRIES = 3;
|
|
11970
|
+
const clearRetry = () => {
|
|
11971
|
+
if (retryTimer !== void 0) {
|
|
11972
|
+
clearTimeout(retryTimer);
|
|
11973
|
+
retryTimer = void 0;
|
|
11974
|
+
}
|
|
11975
|
+
};
|
|
11976
|
+
const sync = async (allowStartupRetry = false) => {
|
|
11934
11977
|
if (disposed) return;
|
|
11935
11978
|
const status = await fetchComposerStatus();
|
|
11936
11979
|
if (disposed) return;
|
|
11937
11980
|
setSubPluginEnabled(status.enabled);
|
|
11938
11981
|
setHostPredictionAllowed(status.prediction);
|
|
11939
11982
|
if (status.enabled) {
|
|
11983
|
+
clearRetry();
|
|
11984
|
+
startupRetryCount = 0;
|
|
11940
11985
|
if (!cleanActive) cleanActive = activate();
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11986
|
+
return;
|
|
11987
|
+
}
|
|
11988
|
+
cleanActive?.();
|
|
11989
|
+
cleanActive = void 0;
|
|
11990
|
+
if (status.explicitlyDisabled) {
|
|
11991
|
+
clearRetry();
|
|
11992
|
+
return;
|
|
11944
11993
|
}
|
|
11994
|
+
if (allowStartupRetry && startupRetryCount < MAX_STARTUP_RETRIES) {
|
|
11995
|
+
startupRetryCount += 1;
|
|
11996
|
+
const delay = startupRetryCount * 1e3;
|
|
11997
|
+
clearRetry();
|
|
11998
|
+
retryTimer = setTimeout(() => {
|
|
11999
|
+
retryTimer = void 0;
|
|
12000
|
+
if (!disposed) sync(true);
|
|
12001
|
+
}, delay);
|
|
12002
|
+
return;
|
|
12003
|
+
}
|
|
12004
|
+
clearRetry();
|
|
11945
12005
|
};
|
|
11946
12006
|
cleanActive = activate();
|
|
11947
|
-
sync();
|
|
12007
|
+
sync(true);
|
|
11948
12008
|
const onFocus = () => {
|
|
11949
12009
|
sync();
|
|
11950
12010
|
};
|
|
@@ -11966,14 +12026,11 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
11966
12026
|
subtree: true
|
|
11967
12027
|
});
|
|
11968
12028
|
}
|
|
11969
|
-
const pollTimer = setInterval(() => {
|
|
11970
|
-
if (typeof document !== "undefined" && document.visibilityState === "visible") sync();
|
|
11971
|
-
}, 15e3);
|
|
11972
12029
|
return () => {
|
|
11973
12030
|
disposed = true;
|
|
11974
12031
|
if (typeof window !== "undefined") window.removeEventListener("focus", onFocus);
|
|
11975
12032
|
observer?.disconnect();
|
|
11976
|
-
|
|
12033
|
+
clearRetry();
|
|
11977
12034
|
cleanActive?.();
|
|
11978
12035
|
cleanActive = void 0;
|
|
11979
12036
|
};
|
package/lib/index.d.mts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { Context } from "@deepseek-ai/cordis";
|
|
2
2
|
//#region src/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* composer 子插件被停用时,由主插件补一个只读状态兜底端点。
|
|
5
|
+
*
|
|
6
|
+
* 客户端以「探活 → 启停输入框增强」驱动 UI:子插件在 cordis.patch.yml 里被停用后,
|
|
7
|
+
* 它自己注册的 `/composer` 端点随之消失,探活只能拿到 404,DevTools 里就会持续报错。
|
|
8
|
+
* 这里在磁盘配置确认停用时接管同一路径,返回 `enabled: false`,客户端据此立即收敛。
|
|
9
|
+
* 子插件启用时不注册,避免与 composer 子插件的同名路由冲突(同一时刻只应有一个注册者)。
|
|
10
|
+
*
|
|
11
|
+
* @returns 路由注销函数;未注册时返回 undefined。
|
|
12
|
+
*/
|
|
13
|
+
declare function registerComposerStatusFallback(ctx: Context): (() => void) | undefined;
|
|
3
14
|
type HostRequest = {
|
|
4
15
|
method?: string;
|
|
5
16
|
url?: string;
|
|
@@ -15,4 +26,4 @@ declare const inject: string[];
|
|
|
15
26
|
/** 提供不泄露地址、命令和凭证的连接器目录。 */
|
|
16
27
|
declare function apply(ctx: Context): void;
|
|
17
28
|
//#endregion
|
|
18
|
-
export { RequestBodyTooLargeError, apply, inject, publicDependencyError, readRequestBody };
|
|
29
|
+
export { RequestBodyTooLargeError, apply, inject, publicDependencyError, readRequestBody, registerComposerStatusFallback };
|
package/lib/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveCurrentProfile, r as CODEX_UI_API_ENDPOINTS } from "./profile-resolver-DSHfL3KW.mjs";
|
|
1
|
+
import { n as resolveCurrentProfile, r as CODEX_UI_API_ENDPOINTS, t as isSubPluginDisabledOnDisk } 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";
|
|
@@ -659,6 +659,41 @@ function writeSectionsDocument(ctx, document) {
|
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region src/index.ts
|
|
661
661
|
const dependenciesEndpoint = CODEX_UI_API_ENDPOINTS.dependencies;
|
|
662
|
+
/**
|
|
663
|
+
* composer 子插件被停用时,由主插件补一个只读状态兜底端点。
|
|
664
|
+
*
|
|
665
|
+
* 客户端以「探活 → 启停输入框增强」驱动 UI:子插件在 cordis.patch.yml 里被停用后,
|
|
666
|
+
* 它自己注册的 `/composer` 端点随之消失,探活只能拿到 404,DevTools 里就会持续报错。
|
|
667
|
+
* 这里在磁盘配置确认停用时接管同一路径,返回 `enabled: false`,客户端据此立即收敛。
|
|
668
|
+
* 子插件启用时不注册,避免与 composer 子插件的同名路由冲突(同一时刻只应有一个注册者)。
|
|
669
|
+
*
|
|
670
|
+
* @returns 路由注销函数;未注册时返回 undefined。
|
|
671
|
+
*/
|
|
672
|
+
function registerComposerStatusFallback(ctx) {
|
|
673
|
+
if (!isSubPluginDisabledOnDisk("codex-ui-composer", void 0, ctx)) return void 0;
|
|
674
|
+
return hostServices(ctx).webServer.register({
|
|
675
|
+
kind: "exact",
|
|
676
|
+
path: CODEX_UI_API_ENDPOINTS.composer,
|
|
677
|
+
handler: async (request, response) => {
|
|
678
|
+
if (request.method && request.method !== "GET") {
|
|
679
|
+
response.writeHead(405, {
|
|
680
|
+
"content-type": "application/json; charset=utf-8",
|
|
681
|
+
"cache-control": "no-store"
|
|
682
|
+
});
|
|
683
|
+
response.end(JSON.stringify({ error: "Method Not Allowed" }));
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
response.writeHead(200, {
|
|
687
|
+
"content-type": "application/json; charset=utf-8",
|
|
688
|
+
"cache-control": "no-store"
|
|
689
|
+
});
|
|
690
|
+
response.end(JSON.stringify({
|
|
691
|
+
enabled: false,
|
|
692
|
+
prediction: false
|
|
693
|
+
}));
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
}
|
|
662
697
|
function headerValue(headers, name) {
|
|
663
698
|
const value = headers[name];
|
|
664
699
|
if (typeof value === "string") return value;
|
|
@@ -729,6 +764,12 @@ function apply(ctx) {
|
|
|
729
764
|
noteHostInstallState(event);
|
|
730
765
|
});
|
|
731
766
|
}, "codex-ui: host plugin-manager install state");
|
|
767
|
+
ctx.effect(() => {
|
|
768
|
+
const disposeFallback = registerComposerStatusFallback(ctx);
|
|
769
|
+
return () => {
|
|
770
|
+
disposeFallback?.();
|
|
771
|
+
};
|
|
772
|
+
}, "michengai-codex-ui: composer status fallback");
|
|
732
773
|
ctx.effect(() => {
|
|
733
774
|
const disposeDependencies = host.webServer.register({
|
|
734
775
|
kind: "exact",
|
|
@@ -872,4 +913,4 @@ function apply(ctx) {
|
|
|
872
913
|
}, "michengai-codex-ui: catalogs");
|
|
873
914
|
}
|
|
874
915
|
//#endregion
|
|
875
|
-
export { RequestBodyTooLargeError, apply, inject, publicDependencyError, readRequestBody };
|
|
916
|
+
export { RequestBodyTooLargeError, apply, inject, publicDependencyError, readRequestBody, registerComposerStatusFallback };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-ui",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
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": {
|