@michengai/dsh-codex-ui 0.2.69 → 0.2.70
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/dist/client.js +0 -68
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -4238,73 +4238,6 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4238
4238
|
"turns.untitled": "Untitled prompt",
|
|
4239
4239
|
"turns.jump": "Jump to turn {index}: {summary}"
|
|
4240
4240
|
};
|
|
4241
|
-
//#endregion
|
|
4242
|
-
//#region src/client/permission-i18n.ts
|
|
4243
|
-
/**
|
|
4244
|
-
* 官方已负责权限文案及布局;这里只给「完全访问权限」保留醒目的风险提示。
|
|
4245
|
-
*/
|
|
4246
|
-
const PERMISSION_RISK_STYLE = "button[role=menuitem][data-dcu-perm=\"danger-full-access\"],button[role=menuitem][data-dcu-perm=\"danger-full-access\"] *{color:var(--dsw-alias-state-warn-label,#e3942a)}";
|
|
4247
|
-
const FULL_ACCESS_LABELS = [
|
|
4248
|
-
"Full access",
|
|
4249
|
-
"Full Access",
|
|
4250
|
-
"danger-full-access",
|
|
4251
|
-
"完全访问权限",
|
|
4252
|
-
"完全访问"
|
|
4253
|
-
];
|
|
4254
|
-
/** 不改动宿主文案,只识别完全访问权限选项以施加风险色。 */
|
|
4255
|
-
function isFullAccessPermission(text) {
|
|
4256
|
-
const normalized = text.trim().replace(/\s+/g, " ");
|
|
4257
|
-
return FULL_ACCESS_LABELS.some((label) => normalized === label || normalized.includes(label));
|
|
4258
|
-
}
|
|
4259
|
-
function markFullAccessPermissionMenus(root) {
|
|
4260
|
-
let changed = 0;
|
|
4261
|
-
for (const button of root.querySelectorAll("button[role=\"menuitem\"]")) {
|
|
4262
|
-
if (!isFullAccessPermission((button.textContent ?? "").replace(/\s+/g, " "))) continue;
|
|
4263
|
-
if (button.getAttribute("data-dcu-perm") === "danger-full-access") continue;
|
|
4264
|
-
button.setAttribute("data-dcu-perm", "danger-full-access");
|
|
4265
|
-
changed += 1;
|
|
4266
|
-
}
|
|
4267
|
-
return changed;
|
|
4268
|
-
}
|
|
4269
|
-
function observePermissionMenus() {
|
|
4270
|
-
if (typeof document === "undefined") return () => {};
|
|
4271
|
-
const styleId = "dcu-permission-risk";
|
|
4272
|
-
if (document.getElementById(styleId) === null) {
|
|
4273
|
-
const style = document.createElement("style");
|
|
4274
|
-
style.id = styleId;
|
|
4275
|
-
style.textContent = PERMISSION_RISK_STYLE;
|
|
4276
|
-
document.head.append(style);
|
|
4277
|
-
}
|
|
4278
|
-
let applying = false;
|
|
4279
|
-
let frame;
|
|
4280
|
-
const apply = () => {
|
|
4281
|
-
if (applying) return;
|
|
4282
|
-
applying = true;
|
|
4283
|
-
try {
|
|
4284
|
-
markFullAccessPermissionMenus(document);
|
|
4285
|
-
} finally {
|
|
4286
|
-
applying = false;
|
|
4287
|
-
}
|
|
4288
|
-
};
|
|
4289
|
-
const schedule = () => {
|
|
4290
|
-
if (frame !== void 0) return;
|
|
4291
|
-
frame = window.requestAnimationFrame(() => {
|
|
4292
|
-
frame = void 0;
|
|
4293
|
-
apply();
|
|
4294
|
-
});
|
|
4295
|
-
};
|
|
4296
|
-
apply();
|
|
4297
|
-
const observer = new MutationObserver(schedule);
|
|
4298
|
-
observer.observe(document.body, {
|
|
4299
|
-
childList: true,
|
|
4300
|
-
subtree: true,
|
|
4301
|
-
characterData: true
|
|
4302
|
-
});
|
|
4303
|
-
return () => {
|
|
4304
|
-
observer.disconnect();
|
|
4305
|
-
if (frame !== void 0) window.cancelAnimationFrame(frame);
|
|
4306
|
-
};
|
|
4307
|
-
}
|
|
4308
4241
|
const SETTINGS_NAV_ICON_HTML = {
|
|
4309
4242
|
experts: "<path fill=\"currentColor\" d=\"M11.0307 5.46369C11.0305 3.78995 9.6734 2.43357 7.99961 2.43357C6.32601 2.43379 4.96972 3.79009 4.96949 5.46369C4.96949 7.13748 6.32587 8.49455 7.99961 8.49477C9.67354 8.49477 11.0307 7.13762 11.0307 5.46369ZM12.3163 5.46369C12.3163 7.84777 10.3837 9.78042 7.99961 9.78042C5.61572 9.7802 3.68288 7.84763 3.68288 5.46369C3.6831 3.07993 5.61586 1.14718 7.99961 1.14695C10.3836 1.14695 12.3161 3.0798 12.3163 5.46369Z\"/><path fill=\"currentColor\" d=\"M8.00002 10.3316C11.7343 10.3316 14.1864 11.8997 15.0387 14.4445L14.4292 14.6483L13.8197 14.8531C13.1955 12.9893 11.3673 11.6182 8.00002 11.6182C4.63277 11.6182 2.80455 12.9893 2.18031 14.8531L1.5708 14.6483L0.961304 14.4445C1.81368 11.8997 4.26579 10.3316 8.00002 10.3316Z\"/>",
|
|
4310
4243
|
skills: "<path fill=\"currentColor\" d=\"M12.5113 15.4067C12.4395 15.6249 12.1308 15.6249 12.059 15.4067L11.643 14.1416C11.454 13.567 11.0033 13.1164 10.4288 12.9274L9.16369 12.5113C8.94544 12.4395 8.94544 12.1308 9.16369 12.059L10.4288 11.643C11.0033 11.454 11.454 11.0033 11.643 10.4288L12.059 9.16369C12.1308 8.94544 12.4395 8.94544 12.5113 9.16369L12.9274 10.4288C13.1164 11.0033 13.567 11.454 14.1416 11.643L15.4067 12.059C15.6249 12.1308 15.6249 12.4395 15.4067 12.5113L14.1416 12.9274C13.567 13.1164 13.1164 13.567 12.9274 14.1416L12.5113 15.4067Z\"/><path fill=\"currentColor\" d=\"M9.02246 0.546878C9.9822 0.546878 10.7564 0.545403 11.374 0.612307C12.0042 0.680586 12.5515 0.826244 13.0273 1.17188C13.3052 1.37376 13.5501 1.61868 13.752 1.89649C14.0975 2.37225 14.2432 2.91984 14.3115 3.54981C14.3784 4.16727 14.377 4.94206 14.377 5.90137V8.51367C13.9611 8.29533 13.5071 8.13985 13.0273 8.06055V5.90137C13.0273 4.9121 13.0259 4.22322 12.9688 3.69532C12.9129 3.18044 12.8098 2.89782 12.6592 2.69043C12.5406 2.52724 12.3966 2.38326 12.2334 2.26465C12.026 2.11404 11.7437 2.0109 11.2285 1.95508C10.7005 1.89789 10.0122 1.89649 9.02246 1.89649H6.55371C5.56395 1.89649 4.87569 1.89787 4.34766 1.95508C3.83242 2.01092 3.55022 2.11398 3.34278 2.26465C3.17953 2.38329 3.03564 2.52719 2.91699 2.69043C2.76642 2.89782 2.66325 3.18042 2.60742 3.69532C2.55027 4.22322 2.54883 4.9121 2.54883 5.90137V10.0986C2.54883 11.0878 2.55031 11.7768 2.60742 12.3047C2.66326 12.8196 2.76642 13.1032 2.91699 13.3105C3.03558 13.4736 3.17966 13.6178 3.34278 13.7363C3.5502 13.8869 3.83265 13.9901 4.34766 14.0459C4.87568 14.1031 5.56398 14.1035 6.55371 14.1035H8.08399C8.27443 14.6025 8.55077 15.0585 8.89551 15.4541H6.55371C5.59402 15.4541 4.81976 15.4546 4.20215 15.3877C3.57204 15.3194 3.02468 15.1738 2.54883 14.8281C2.27111 14.6263 2.02606 14.3813 1.82422 14.1035C1.47883 13.6278 1.33293 13.08 1.26465 12.4502C1.19783 11.8327 1.19922 11.0579 1.19922 10.0986V5.90137C1.19922 4.94206 1.1978 4.16727 1.26465 3.54981C1.33295 2.91984 1.47867 2.37225 1.82422 1.89649C2.02613 1.61864 2.27098 1.37379 2.54883 1.17188C3.02472 0.826181 3.57197 0.6806 4.20215 0.612307C4.81976 0.545393 5.594 0.546877 6.55371 0.546878H9.02246ZM9.19629 9.14649H4.5459V7.84571H9.19629V9.14649ZM11.0303 6.10645H4.5459V4.80567H11.0303V6.10645Z\"/>",
|
|
@@ -4691,7 +4624,6 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4691
4624
|
en
|
|
4692
4625
|
}), "michengai-codex-ui: dictionaries");
|
|
4693
4626
|
const t = ctx.locale.bind(NS);
|
|
4694
|
-
ctx.effect(() => observePermissionMenus(), "michengai-codex-ui: permission risk highlight");
|
|
4695
4627
|
ctx.effect(() => observeSlimSidebar(), "michengai-codex-ui: slim sidebar");
|
|
4696
4628
|
ctx.effect(() => observeSettingsNavIcons(), "michengai-codex-ui: settings nav icons");
|
|
4697
4629
|
ctx.effect(() => observeConversationHeader(), "michengai-codex-ui: conversation header");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@michengai/dsh-codex-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.70",
|
|
4
4
|
"description": "以 Codex 风格重构 DSH Web 侧栏的独立客户端插件",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"build": "tsc --noEmit && tsdown",
|
|
56
|
-
"test": "tsx tests/
|
|
56
|
+
"test": "tsx tests/hover-tip.assert.ts && tsx tests/companion-slots.assert.ts && tsx tests/channel-api.assert.ts && tsx tests/schedule-sessions.assert.ts && tsx tests/session-tree.assert.ts && tsx tests/pinned-sessions.assert.ts && tsx tests/session-manager.assert.ts && tsx tests/workspace-browser.assert.ts && tsx tests/sidebar-search.assert.ts && tsx tests/settings-navigation.assert.ts && tsx tests/settings-nav-icons.assert.ts && tsx tests/locales.assert.ts && vitest run tests/client-runtime.integration.spec.ts && tsx tests/settings-integration.assert.ts && tsx tests/about-dependencies.assert.ts && tsx tests/dependency-manager.assert.ts && tsx tests/conversation-bubbles.assert.ts && tsx tests/conversation-header.assert.ts && tsx tests/conversation-visuals.assert.ts && tsdown && tsx tests/client-bundle.assert.ts && tsx tests/codex-suite.assert.ts"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@deepseek-ai/cordis": ">=4.0.1 <5.0.0",
|