dsh-desktop-enhance 0.6.4 → 0.6.6
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/README.md +10 -0
- package/lib/client.js +360 -1
- package/lib/index.d.ts +66 -0
- package/lib/index.js +42 -0
- package/package.json +16 -13
package/README.md
CHANGED
|
@@ -110,6 +110,16 @@ Web 版(浏览器里打开的那种)键位是 **`Cmd+Shift+.`** —— `Cmd+
|
|
|
110
110
|
|
|
111
111
|
具体安全范围、设置归属与迁移说明见 [远程接入](docs/features/remote-access.md)。
|
|
112
112
|
|
|
113
|
+
### 异常轮次分叉
|
|
114
|
+
|
|
115
|
+
已经报错或停止的轮次,也能在原位置点击 Fork。保留原生操作栏,不增加第二个入口;没有最终答复的轮次会补齐该入口。设置页「会话能力 → 异常轮次分叉」可关闭并恢复原生行为。
|
|
116
|
+
|
|
117
|
+
只支持已保存结束记录的轮次,不处理运行中或损坏记录。**分叉复制对话,不回滚文件和外部操作**。
|
|
118
|
+
|
|
119
|
+
### 子智能体与团队会话模型
|
|
120
|
+
|
|
121
|
+
在输入框原模型位置显示子智能体和团队成员最近请求实际使用的模型与推理档位,只读、不可切换;悬停可查看完整 `provider/model`。普通会话仍使用原生模型选择器。首次自身请求前显示「模型尚未记录」,不把 Fork 继承的父会话模型冒充为子会话模型。设置页「会话能力 → 子会话模型」可单独关闭,恢复原生界面。
|
|
122
|
+
|
|
113
123
|
### 会话信息
|
|
114
124
|
|
|
115
125
|
在主对话区右上角悬浮展示一个可折叠的手风琴看板(标题为 **「会话信息」**,按 **「上下文注入 → Skill → 工具」** 依次排列):
|
package/lib/client.js
CHANGED
|
@@ -123,6 +123,14 @@ window.__ModuleLoader__.load({
|
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/client/strings.ts
|
|
125
125
|
const zh = {
|
|
126
|
+
"sessionModel.oneShotTitle": "一次性子智能体记录",
|
|
127
|
+
"sessionModel.readOnlyTitle": "此子智能体暂时只读",
|
|
128
|
+
"sessionModel.oneShotBody": "一次性任务不支持后续消息,可在这里查看完整执行记录。",
|
|
129
|
+
"sessionModel.offlineBody": "父会话当前不在线,重新打开父会话后即可继续发送消息。",
|
|
130
|
+
"sessionModel.unknownBody": "读取子会话后才能确定是否支持继续对话。",
|
|
131
|
+
"sessionModel.pending": "模型尚未记录",
|
|
132
|
+
"sessionModel.unavailable": "模型信息暂不可用",
|
|
133
|
+
"sessionModel.readOnly": "最近请求使用的模型 · 只读",
|
|
126
134
|
...mobileZh,
|
|
127
135
|
...remoteZh,
|
|
128
136
|
"settings.tabs.label": "增强设置分类",
|
|
@@ -204,6 +212,12 @@ window.__ModuleLoader__.load({
|
|
|
204
212
|
"folderStatus.done": "未读结束",
|
|
205
213
|
"settings.folderStatus": "文件夹状态",
|
|
206
214
|
"settings.folderStatus.hint": "在折叠文件夹右侧显示活动与未读状态计数",
|
|
215
|
+
"abnormalFork.failed": "分叉失败",
|
|
216
|
+
"abnormalFork.created": "分叉已创建,但后续操作失败;请在侧栏查看",
|
|
217
|
+
"settings.abnormalFork": "异常轮次分叉",
|
|
218
|
+
"settings.abnormalFork.hint": "让已报错或停止的轮次也能从原位置分叉;不处理运行中或未完整记录的轮次",
|
|
219
|
+
"settings.sessionModel": "子会话模型",
|
|
220
|
+
"settings.sessionModel.hint": "在子智能体与团队会话的输入区域只读显示实际模型;关闭后恢复原生界面",
|
|
207
221
|
"settings.sessionInfo": "会话信息",
|
|
208
222
|
"settings.sessionInfo.hint": "在主对话区右上角悬浮展示当前会话的信息看板(如已注入的 Skill、触发方式与轮次),点击条目可打开 Skill 预览",
|
|
209
223
|
"settings.toolsManager": "工具管理",
|
|
@@ -265,6 +279,14 @@ window.__ModuleLoader__.load({
|
|
|
265
279
|
"settings.writeFailed": "设置没写进去,开关已退回原状态;请重试。"
|
|
266
280
|
};
|
|
267
281
|
const en = {
|
|
282
|
+
"sessionModel.oneShotTitle": "One-shot subagent record",
|
|
283
|
+
"sessionModel.readOnlyTitle": "This subagent is read-only for now",
|
|
284
|
+
"sessionModel.oneShotBody": "One-shot tasks do not accept follow-ups; review the full execution record here.",
|
|
285
|
+
"sessionModel.offlineBody": "The parent session is offline; reopen it to continue sending messages.",
|
|
286
|
+
"sessionModel.unknownBody": "Read the child session to determine whether it can be continued.",
|
|
287
|
+
"sessionModel.pending": "Model not recorded yet",
|
|
288
|
+
"sessionModel.unavailable": "Model information unavailable",
|
|
289
|
+
"sessionModel.readOnly": "Model used by the latest request · read-only",
|
|
268
290
|
...mobileEn,
|
|
269
291
|
...remoteEn,
|
|
270
292
|
"settings.tabs.label": "Enhancement settings",
|
|
@@ -346,6 +368,12 @@ window.__ModuleLoader__.load({
|
|
|
346
368
|
"folderStatus.done": "Unread completion",
|
|
347
369
|
"settings.folderStatus": "Folder status",
|
|
348
370
|
"settings.folderStatus.hint": "Shows activity and unread counts on the right of collapsed folders",
|
|
371
|
+
"abnormalFork.failed": "Fork failed",
|
|
372
|
+
"abnormalFork.created": "The fork was created, but a later operation failed; check the sidebar",
|
|
373
|
+
"settings.abnormalFork": "Fork interrupted turns",
|
|
374
|
+
"settings.abnormalFork.hint": "Enables branching from the original position after a turn fails or is stopped; excludes running or unclosed turns",
|
|
375
|
+
"settings.sessionModel": "Child session model",
|
|
376
|
+
"settings.sessionModel.hint": "Shows the actual model read-only in subagent and team session input areas; disabling restores the native UI",
|
|
349
377
|
"settings.sessionInfo": "Session info",
|
|
350
378
|
"settings.sessionInfo.hint": "Shows a floating Session Info inspector in the top-right corner of the conversation view (active skills, trigger source, and turn); click an item to open its skill preview",
|
|
351
379
|
"settings.toolsManager": "Tools manager",
|
|
@@ -670,6 +698,8 @@ window.__ModuleLoader__.load({
|
|
|
670
698
|
stepDuration: "data-desktop-enhance-off-step-duration",
|
|
671
699
|
folderStatus: "data-desktop-enhance-off-folder-status",
|
|
672
700
|
sessionInfo: "data-desktop-enhance-off-session-info",
|
|
701
|
+
sessionModel: "data-desktop-enhance-off-session-model",
|
|
702
|
+
abnormalFork: "data-desktop-enhance-off-abnormal-fork",
|
|
673
703
|
toolsManager: "data-desktop-enhance-off-tools-manager",
|
|
674
704
|
skillsManager: "data-desktop-enhance-off-skills-manager"
|
|
675
705
|
};
|
|
@@ -681,6 +711,8 @@ window.__ModuleLoader__.load({
|
|
|
681
711
|
"stepDuration",
|
|
682
712
|
"folderStatus",
|
|
683
713
|
"sessionInfo",
|
|
714
|
+
"sessionModel",
|
|
715
|
+
"abnormalFork",
|
|
684
716
|
"toolsManager",
|
|
685
717
|
"skillsManager"
|
|
686
718
|
];
|
|
@@ -703,6 +735,8 @@ window.__ModuleLoader__.load({
|
|
|
703
735
|
id: "session",
|
|
704
736
|
fields: [
|
|
705
737
|
"sessionInfo",
|
|
738
|
+
"sessionModel",
|
|
739
|
+
"abnormalFork",
|
|
706
740
|
"toolsManager",
|
|
707
741
|
"skillsManager"
|
|
708
742
|
]
|
|
@@ -7732,8 +7766,296 @@ window.__ModuleLoader__.load({
|
|
|
7732
7766
|
};
|
|
7733
7767
|
}
|
|
7734
7768
|
//#endregion
|
|
7769
|
+
//#region \0dsh-desktop-enhance-css:/Users/lijiechengbj/projects/AI-agents/dsh-desktop-enhance/src/client/remote/styles.css.mjs
|
|
7770
|
+
var styles_css_default$2 = "\n[data-desktop-enhance-remote] { display:flex; flex-direction:column; gap:var(--dsh-de-space-section); min-width:0; padding:var(--dsh-de-space-lg); border:1px solid var(--dsh-de-border); border-radius:var(--dsh-de-radius-card); background:var(--dsh-de-surface); }\n[data-desktop-enhance-remote] .de-remote-body,\n[data-desktop-enhance-remote] .de-remote-content { display:flex; flex-direction:column; gap:var(--dsh-de-space-lg); min-width:0; }\n[data-desktop-enhance-remote] h3,\n[data-desktop-enhance-remote] h4,\n[data-desktop-enhance-remote] p { margin:0; }\n[data-desktop-enhance-remote] h3 { font-size:var(--dsh-de-font-heading); font-weight:600; }\n[data-desktop-enhance-remote] h4 { font-size:var(--dsh-de-font-body); font-weight:600; }\n[data-desktop-enhance-remote] p { color:var(--dsh-de-muted); font-size:var(--dsh-de-font-caption); line-height:1.5; overflow-wrap:anywhere; }\n[data-desktop-enhance-remote] [role=\"alert\"] { color:var(--dsh-de-danger); }\n[data-desktop-enhance-remote] .de-remote-heading { display:flex; align-items:center; justify-content:space-between; gap:var(--dsh-de-space-lg); }\n[data-desktop-enhance-remote] .de-remote-heading > div { display:grid; gap:4px; }\n[data-desktop-enhance-remote] .de-remote-port-row,\n[data-desktop-enhance-remote] .de-remote-field,\n[data-desktop-enhance-remote] .de-remote-actions { display:flex; align-items:center; gap:var(--dsh-de-space-md); flex-wrap:wrap; }\n[data-desktop-enhance-remote] .de-remote-field { font-size:var(--dsh-de-font-caption); color:var(--dsh-de-muted); }\n[data-desktop-enhance-remote] .de-remote-pairing,\n[data-desktop-enhance-remote] .de-remote-devices { border-top:1px solid var(--dsh-de-border); padding-top:var(--dsh-de-space-section); }\n[data-desktop-enhance-remote] .de-remote-pairing,\n[data-desktop-enhance-remote] .de-remote-devices { display:grid; gap:var(--dsh-de-space-md); }\n[data-desktop-enhance-remote] input { box-sizing:border-box; width:104px; min-width:0; max-width:100%; min-height:var(--dsh-de-control-height); padding:6px 8px; border:1px solid var(--dsh-de-border); border-radius:var(--dsh-de-radius-control); background:var(--dsh-de-surface); color:var(--dsh-de-text); font:inherit; }\n[data-desktop-enhance-settings] [data-desktop-enhance-remote] button.de-remote-primary { color:var(--dsw-alias-label-primary-bluish); background:var(--dsw-alias-state-business-tertiary); border-color:var(--dsh-de-accent); font-weight:600; }\n[data-desktop-enhance-settings] [data-desktop-enhance-remote] button.de-remote-primary:hover:not(:disabled) { background:var(--dsw-alias-state-business-tertiary); filter:brightness(.96); }\n[data-desktop-enhance-remote] .de-remote-device-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr)); gap:var(--dsh-de-space-md); }\n[data-desktop-enhance-remote] .de-remote-device { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:var(--dsh-de-space-sm); padding:var(--dsh-de-space-lg); border:1px solid var(--dsh-de-border); border-radius:var(--dsh-de-radius-card); background:var(--dsh-de-surface); }\n[data-desktop-enhance-remote] .de-remote-device > .de-remote-heading { align-self:stretch; margin-bottom:4px; }\n[data-desktop-enhance-remote] .de-remote-device strong { overflow-wrap:anywhere; }\n[data-desktop-enhance-remote] .de-remote-device-icon { width:28px; height:28px; color:var(--dsh-de-muted); }\n[data-desktop-enhance-remote] .de-remote-badge { border-radius:var(--dsh-de-radius-control); padding:3px 7px; background:var(--dsh-de-hover); font-size:var(--dsh-de-font-caption); color:var(--dsh-de-muted); }\n[data-desktop-enhance-remote] .de-remote-device[data-revoked=\"true\"] { opacity:.65; }\n[data-desktop-enhance-remote] .de-remote-device-footer { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:var(--dsh-de-space-sm); align-self:stretch; margin-top:auto; padding-top:var(--dsh-de-space-md); border-top:1px solid var(--dsh-de-border); color:var(--dsh-de-muted); font-size:var(--dsh-de-font-caption); }\n[data-desktop-enhance-settings] [data-desktop-enhance-remote] button.de-remote-revoke { padding:4px 0; color:var(--dsh-de-danger); background:transparent; border-color:transparent; font-size:var(--dsh-de-font-caption); }\n[data-desktop-enhance-remote] .de-remote-empty { padding:var(--dsh-de-space-section); border:1px dashed var(--dsh-de-border); border-radius:var(--dsh-de-radius-card); }\n@media (max-width:600px) {\n [data-desktop-enhance-remote] .de-remote-device-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--dsh-de-space-sm); }\n [data-desktop-enhance-remote] .de-remote-device { padding:var(--dsh-de-space-md); }\n}\n@media (max-width:360px) { [data-desktop-enhance-remote] .de-remote-device-grid { grid-template-columns:1fr; } }\n";
|
|
7771
|
+
//#endregion
|
|
7772
|
+
//#region src/shared/session-model.ts
|
|
7773
|
+
const SESSION_MODEL_PROJECTION = "desktop-enhance.session-model";
|
|
7774
|
+
//#endregion
|
|
7775
|
+
//#region src/client/session-model/label.ts
|
|
7776
|
+
function selectReadOnlyModel(owner) {
|
|
7777
|
+
const child = owner.session?.subagent;
|
|
7778
|
+
if (!child || owner.pendingInteraction !== void 0) return null;
|
|
7779
|
+
if (child.address.mode === "unknown" || child.address.mode === "one-shot") return { reason: child.address.mode };
|
|
7780
|
+
return child.parentAvailable === false && !owner.session?.running ? { reason: "parent-unavailable" } : null;
|
|
7781
|
+
}
|
|
7782
|
+
function ReadOnlyModelComposer(props) {
|
|
7783
|
+
const { t, matched } = props;
|
|
7784
|
+
const oneShot = matched.reason === "one-shot";
|
|
7785
|
+
return h("div", { className: "de-readonly-model-composer" }, h("div", {
|
|
7786
|
+
className: "de-readonly-model-notice",
|
|
7787
|
+
role: "status"
|
|
7788
|
+
}, h("strong", null, t(oneShot ? "sessionModel.oneShotTitle" : "sessionModel.readOnlyTitle")), h("span", null, t(matched.reason === "unknown" ? "sessionModel.unknownBody" : oneShot ? "sessionModel.oneShotBody" : "sessionModel.offlineBody"))), h("div", { className: "de-readonly-model-row" }, h(SessionModelLabel, { ...props })));
|
|
7789
|
+
}
|
|
7790
|
+
function SessionModelLabel({ useSession, useProjection, t }) {
|
|
7791
|
+
const child = useSession((session) => session.subagent !== null);
|
|
7792
|
+
const model = useProjection(SESSION_MODEL_PROJECTION);
|
|
7793
|
+
if (!child) return null;
|
|
7794
|
+
const caption = model?.model ?? t(model === null ? "sessionModel.pending" : "sessionModel.unavailable");
|
|
7795
|
+
const title = model ? `${model.provider}/${model.model}${model.reasoningEffort ? ` · ${model.reasoningEffort}` : ""}\n${t("sessionModel.readOnly")}` : caption;
|
|
7796
|
+
return h("span", {
|
|
7797
|
+
"data-desktop-enhance-session-model": "",
|
|
7798
|
+
title,
|
|
7799
|
+
"aria-label": title
|
|
7800
|
+
}, h("span", { className: "de-session-model-name" }, caption), model?.reasoningEffort ? h("span", { className: "de-session-model-effort" }, model.reasoningEffort) : null);
|
|
7801
|
+
}
|
|
7802
|
+
//#endregion
|
|
7803
|
+
//#region \0dsh-desktop-enhance-css:/Users/lijiechengbj/projects/AI-agents/dsh-desktop-enhance/src/client/session-model/styles.css.mjs
|
|
7804
|
+
var styles_css_default$1 = ":root[data-desktop-enhance-off-session-model] [data-desktop-enhance-session-model] { display: none !important; }\n\n\n:root:not([data-desktop-enhance-off-session-model]) [data-desktop-enhance-session-model] {\n display: flex;\n align-items: center;\n gap: 4px;\n min-width: 0;\n max-width: min(360px, 45cqw);\n height: 28px;\n padding: 0 4px 0 8px;\n color: var(--dsw-alias-label-secondary);\n font-size: 13px;\n font-weight: 400;\n line-height: 20px;\n}\n.de-session-model-name,\n.de-session-model-effort {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.de-session-model-effort { flex-shrink: 1000; }\n.de-readonly-model-composer {\n border: 0.5px solid var(--dsw-alias-border-l1);\n border-radius: var(--dsw-radius-lg);\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-secondary);\n margin: 0 24px 20px;\n padding: 10px 16px;\n font-size: 13px;\n line-height: 20px;\n}\n.de-readonly-model-notice {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n gap: 8px;\n}\n.de-readonly-model-notice strong { color: var(--dsw-alias-label-primary); font-weight: 510; }\n.de-readonly-model-row { display: flex; justify-content: flex-end; margin-top: 8px; }\n";
|
|
7805
|
+
//#endregion
|
|
7806
|
+
//#region src/client/abnormal-fork/model.ts
|
|
7807
|
+
function abnormalBoundary(turn) {
|
|
7808
|
+
const end = turn.end;
|
|
7809
|
+
const tail = turn.data.get("turn-tail");
|
|
7810
|
+
if (turn.status !== "closed" || !end || !Number.isSafeInteger(end.data?.turn) || end.data.turn < 1 || !Number.isSafeInteger(end.seq) || end.seq < 0 || tail?.turn !== end.data.turn || tail.seq !== end.seq) return null;
|
|
7811
|
+
if (![
|
|
7812
|
+
"error",
|
|
7813
|
+
"aborted",
|
|
7814
|
+
"interrupted",
|
|
7815
|
+
"max-tokens"
|
|
7816
|
+
].includes(end.data.reason?.kind)) return null;
|
|
7817
|
+
return end.seq;
|
|
7818
|
+
}
|
|
7819
|
+
function createForkAction(services, sessionId, atSeq, allowed, publish) {
|
|
7820
|
+
let state = { busy: false };
|
|
7821
|
+
let live = true;
|
|
7822
|
+
const emit = () => {
|
|
7823
|
+
if (live) publish(state);
|
|
7824
|
+
};
|
|
7825
|
+
return {
|
|
7826
|
+
async run() {
|
|
7827
|
+
if (!live || !allowed() || state.busy || state.created) return;
|
|
7828
|
+
state = { busy: true };
|
|
7829
|
+
emit();
|
|
7830
|
+
try {
|
|
7831
|
+
const id = await services.fork({
|
|
7832
|
+
sessionId,
|
|
7833
|
+
atSeq,
|
|
7834
|
+
increaseTitle: true,
|
|
7835
|
+
onCreated(id) {
|
|
7836
|
+
state = {
|
|
7837
|
+
...state,
|
|
7838
|
+
created: id
|
|
7839
|
+
};
|
|
7840
|
+
}
|
|
7841
|
+
});
|
|
7842
|
+
state = {
|
|
7843
|
+
busy: false,
|
|
7844
|
+
created: id
|
|
7845
|
+
};
|
|
7846
|
+
if (live && allowed()) services.openSession(id);
|
|
7847
|
+
} catch (error) {
|
|
7848
|
+
const rpcError = error !== null && typeof error === "object" && "rpcError" in error ? error.rpcError : null;
|
|
7849
|
+
const created = rpcError?.code === "session/workspace-attach-failed" ? rpcError.details?.sessionId : void 0;
|
|
7850
|
+
state = {
|
|
7851
|
+
...state,
|
|
7852
|
+
...typeof created === "string" && created !== "" ? { created } : {},
|
|
7853
|
+
busy: false,
|
|
7854
|
+
error: error instanceof Error ? error.message : String(error)
|
|
7855
|
+
};
|
|
7856
|
+
}
|
|
7857
|
+
emit();
|
|
7858
|
+
},
|
|
7859
|
+
dispose() {
|
|
7860
|
+
live = false;
|
|
7861
|
+
}
|
|
7862
|
+
};
|
|
7863
|
+
}
|
|
7864
|
+
//#endregion
|
|
7865
|
+
//#region src/client/abnormal-fork/dom.ts
|
|
7866
|
+
const OWNED = "data-desktop-enhance-abnormal-fork-button";
|
|
7867
|
+
function takeNativeFork(root, label, run, isDisabled) {
|
|
7868
|
+
const originals = new Map();
|
|
7869
|
+
const refresh = () => {
|
|
7870
|
+
for (const [button, original] of originals) {
|
|
7871
|
+
if (button.getAttribute("data-unavailable") === "true") continue;
|
|
7872
|
+
button.removeAttribute(OWNED);
|
|
7873
|
+
if (original.title === null) button.removeAttribute("title");
|
|
7874
|
+
else button.setAttribute("title", original.title);
|
|
7875
|
+
originals.delete(button);
|
|
7876
|
+
}
|
|
7877
|
+
const row = root.querySelector(":scope > [data-clock=\"end\"]");
|
|
7878
|
+
for (const child of Array.from(row?.children ?? [])) {
|
|
7879
|
+
if (!(child instanceof globalThis.HTMLButtonElement) || child.getAttribute("aria-label") !== label || child.getAttribute("data-unavailable") !== "true") continue;
|
|
7880
|
+
if (!originals.has(child)) originals.set(child, {
|
|
7881
|
+
disabled: child.getAttribute("aria-disabled"),
|
|
7882
|
+
described: child.getAttribute("aria-describedby"),
|
|
7883
|
+
title: child.getAttribute("title")
|
|
7884
|
+
});
|
|
7885
|
+
child.setAttribute(OWNED, "");
|
|
7886
|
+
const desired = isDisabled() ? "true" : "false";
|
|
7887
|
+
if (child.getAttribute("aria-disabled") !== desired) child.setAttribute("aria-disabled", desired);
|
|
7888
|
+
child.removeAttribute("aria-describedby");
|
|
7889
|
+
child.setAttribute("title", label);
|
|
7890
|
+
}
|
|
7891
|
+
};
|
|
7892
|
+
const onClick = (event) => {
|
|
7893
|
+
const target = event.target instanceof globalThis.Element ? event.target.closest("button") : null;
|
|
7894
|
+
if (!target || !originals.has(target) || target.getAttribute("data-unavailable") !== "true") return;
|
|
7895
|
+
event.preventDefault();
|
|
7896
|
+
event.stopPropagation();
|
|
7897
|
+
if (!isDisabled()) run();
|
|
7898
|
+
};
|
|
7899
|
+
const suppressUnavailableTooltip = (event) => {
|
|
7900
|
+
const target = event.target instanceof globalThis.Element ? event.target.closest("button") : null;
|
|
7901
|
+
if (target && originals.has(target) && target.getAttribute("data-unavailable") === "true") event.stopPropagation();
|
|
7902
|
+
};
|
|
7903
|
+
const tooltipEvents = [
|
|
7904
|
+
"mouseover",
|
|
7905
|
+
"pointerover",
|
|
7906
|
+
"focusin"
|
|
7907
|
+
];
|
|
7908
|
+
for (const name of tooltipEvents) root.addEventListener(name, suppressUnavailableTooltip, true);
|
|
7909
|
+
root.addEventListener("click", onClick, true);
|
|
7910
|
+
const observer = new globalThis.MutationObserver(refresh);
|
|
7911
|
+
observer.observe(root, {
|
|
7912
|
+
childList: true,
|
|
7913
|
+
subtree: true,
|
|
7914
|
+
attributes: true,
|
|
7915
|
+
attributeFilter: [
|
|
7916
|
+
"aria-disabled",
|
|
7917
|
+
"aria-describedby",
|
|
7918
|
+
"data-unavailable"
|
|
7919
|
+
]
|
|
7920
|
+
});
|
|
7921
|
+
refresh();
|
|
7922
|
+
return () => {
|
|
7923
|
+
observer.disconnect();
|
|
7924
|
+
root.removeEventListener("click", onClick, true);
|
|
7925
|
+
for (const name of tooltipEvents) root.removeEventListener(name, suppressUnavailableTooltip, true);
|
|
7926
|
+
for (const [button, original] of originals) {
|
|
7927
|
+
button.removeAttribute(OWNED);
|
|
7928
|
+
if (original.title === null) button.removeAttribute("title");
|
|
7929
|
+
else button.setAttribute("title", original.title);
|
|
7930
|
+
if (button.getAttribute("data-unavailable") !== "true") continue;
|
|
7931
|
+
const attributes = [["aria-disabled", original.disabled], ["aria-describedby", original.described]];
|
|
7932
|
+
for (const [key, value] of attributes) if (value === null) button.removeAttribute(key);
|
|
7933
|
+
else button.setAttribute(key, value);
|
|
7934
|
+
}
|
|
7935
|
+
};
|
|
7936
|
+
}
|
|
7937
|
+
//#endregion
|
|
7938
|
+
//#region src/client/abnormal-fork/index.ts
|
|
7939
|
+
const SLOT = "conversation.chat.turnTail";
|
|
7940
|
+
function installAbnormalFork(ctx, settings, t) {
|
|
7941
|
+
const tNative = ctx.locale.bind("chat");
|
|
7942
|
+
function Controls({ turn, sessionId, boundary, useAccess }) {
|
|
7943
|
+
const allowed = useAccess("session/fork");
|
|
7944
|
+
const root = React.useRef(null);
|
|
7945
|
+
const [state, setState] = React.useState({ busy: false });
|
|
7946
|
+
const current = React.useRef({
|
|
7947
|
+
allowed,
|
|
7948
|
+
state
|
|
7949
|
+
});
|
|
7950
|
+
current.current = {
|
|
7951
|
+
allowed,
|
|
7952
|
+
state
|
|
7953
|
+
};
|
|
7954
|
+
const action = React.useRef(null);
|
|
7955
|
+
const noClosing = turn.data.get("turn-tail")?.closing === null;
|
|
7956
|
+
React.useEffect(() => {
|
|
7957
|
+
const next = createForkAction({
|
|
7958
|
+
fork: (options) => {
|
|
7959
|
+
const sessions = ctx.get("sessions");
|
|
7960
|
+
if (!sessions) throw new Error("sessions service unavailable");
|
|
7961
|
+
return sessions.fork(options);
|
|
7962
|
+
},
|
|
7963
|
+
openSession: (id) => {
|
|
7964
|
+
const workspace = ctx.get("uiWorkspace");
|
|
7965
|
+
if (!workspace) throw new Error("uiWorkspace service unavailable");
|
|
7966
|
+
workspace.openSession(id);
|
|
7967
|
+
}
|
|
7968
|
+
}, sessionId, boundary, () => current.current.allowed && settings.get().value?.abnormalFork !== false, setState);
|
|
7969
|
+
action.current = next;
|
|
7970
|
+
return () => {
|
|
7971
|
+
next.dispose();
|
|
7972
|
+
action.current = null;
|
|
7973
|
+
};
|
|
7974
|
+
}, [sessionId, boundary]);
|
|
7975
|
+
const run = () => {
|
|
7976
|
+
action.current?.run();
|
|
7977
|
+
};
|
|
7978
|
+
const disabled = () => !current.current.allowed || current.current.state.busy || !!current.current.state.created;
|
|
7979
|
+
const label = tNative("message.branch");
|
|
7980
|
+
React.useLayoutEffect(() => {
|
|
7981
|
+
if (!allowed || !root.current || noClosing) return;
|
|
7982
|
+
const tail = root.current.closest("[data-turn-tail]");
|
|
7983
|
+
if (!tail || tail.getAttribute("data-turn-tail") !== String(turn.end?.data.turn)) return;
|
|
7984
|
+
return takeNativeFork(tail, label, run, disabled);
|
|
7985
|
+
}, [
|
|
7986
|
+
allowed,
|
|
7987
|
+
turn,
|
|
7988
|
+
noClosing,
|
|
7989
|
+
label,
|
|
7990
|
+
state.busy,
|
|
7991
|
+
state.created
|
|
7992
|
+
]);
|
|
7993
|
+
if (!allowed) return null;
|
|
7994
|
+
return h("div", {
|
|
7995
|
+
ref: root,
|
|
7996
|
+
"data-desktop-enhance-abnormal-fork": ""
|
|
7997
|
+
}, noClosing ? h("div", { "data-desktop-enhance-abnormal-fork-actions": "" }, h("button", {
|
|
7998
|
+
type: "button",
|
|
7999
|
+
"data-desktop-enhance-abnormal-fork-new": "",
|
|
8000
|
+
"aria-label": label,
|
|
8001
|
+
title: label,
|
|
8002
|
+
disabled: disabled(),
|
|
8003
|
+
onClick: run
|
|
8004
|
+
}, h("svg", {
|
|
8005
|
+
width: 16,
|
|
8006
|
+
height: 16,
|
|
8007
|
+
viewBox: "0 0 16 16",
|
|
8008
|
+
fill: "none",
|
|
8009
|
+
stroke: "currentColor",
|
|
8010
|
+
strokeWidth: 1,
|
|
8011
|
+
"aria-hidden": true
|
|
8012
|
+
}, h("path", { d: "M1.01503 8.0001L5.6964 8.0001C6.41913 8.0001 6.78049 8.0001 7.12115 7.91951C7.4232 7.84804 7.71233 7.73014 7.97821 7.57C8.27809 7.38939 8.5364 7.13669 9.05303 6.63129L11.3281 4.40564" }), h("path", { d: "M1.01221 7.9999L5.6964 7.9999C6.41913 7.9999 6.78049 7.9999 7.12115 8.08049C7.4232 8.15196 7.71233 8.26986 7.97821 8.43C8.27809 8.61061 8.5364 8.86331 9.05303 9.36871L11.3281 11.5944" }), h("circle", {
|
|
8013
|
+
cx: 12.4502,
|
|
8014
|
+
cy: 3.3079,
|
|
8015
|
+
r: 1.56962
|
|
8016
|
+
}), h("circle", {
|
|
8017
|
+
cx: 12.4502,
|
|
8018
|
+
cy: 12.6921,
|
|
8019
|
+
r: 1.56962
|
|
8020
|
+
})))) : null, state.error ? h("div", {
|
|
8021
|
+
role: "alert",
|
|
8022
|
+
"data-desktop-enhance-abnormal-fork-error": ""
|
|
8023
|
+
}, `${t(state.created ? "abnormalFork.created" : "abnormalFork.failed")}: ${state.error}`) : null);
|
|
8024
|
+
}
|
|
8025
|
+
function Contribution(props) {
|
|
8026
|
+
const boundary = abnormalBoundary(props.turn);
|
|
8027
|
+
if (boundary === null) return null;
|
|
8028
|
+
return h(Controls, {
|
|
8029
|
+
...props,
|
|
8030
|
+
boundary,
|
|
8031
|
+
key: `${props.sessionId}:${boundary}`
|
|
8032
|
+
});
|
|
8033
|
+
}
|
|
8034
|
+
return ctx.slots.inject(SLOT, () => {
|
|
8035
|
+
let remove;
|
|
8036
|
+
const sync = () => {
|
|
8037
|
+
if (settings.get().value?.abnormalFork === false) {
|
|
8038
|
+
remove?.();
|
|
8039
|
+
remove = void 0;
|
|
8040
|
+
} else if (!remove) remove = ctx.slots.register({
|
|
8041
|
+
name: SLOT,
|
|
8042
|
+
id: "desktop-enhance.abnormal-fork",
|
|
8043
|
+
order: 100,
|
|
8044
|
+
locale: NS,
|
|
8045
|
+
inject: (sessionId) => ({ sessionId })
|
|
8046
|
+
}, Contribution);
|
|
8047
|
+
};
|
|
8048
|
+
const stop = settings.subscribe(sync);
|
|
8049
|
+
sync();
|
|
8050
|
+
return () => {
|
|
8051
|
+
stop();
|
|
8052
|
+
remove?.();
|
|
8053
|
+
};
|
|
8054
|
+
});
|
|
8055
|
+
}
|
|
8056
|
+
//#endregion
|
|
7735
8057
|
//#region src/client/index.tsx
|
|
7736
|
-
const PLUGIN_STYLESHEET = enhance_css_default + "\n" + tabs_css_default + "\n
|
|
8058
|
+
const PLUGIN_STYLESHEET = enhance_css_default + "\n" + tabs_css_default + "\n" + styles_css_default$2 + "\n" + styles_css_default$1 + "\n\n:root:not([data-desktop-enhance-off-abnormal-fork]) [data-desktop-enhance-abnormal-fork-button] {\n cursor: pointer;\n opacity: 1;\n}\n:root:not([data-desktop-enhance-off-abnormal-fork]) [data-desktop-enhance-abnormal-fork-button][aria-disabled=\"true\"] {\n cursor: default;\n opacity: .45;\n}\n[data-desktop-enhance-abnormal-fork] { display: contents; }\n[data-desktop-enhance-abnormal-fork-actions] {\n display: flex;\n align-items: center;\n gap: 8px;\n height: calc(28px + var(--dsh-content-font-delta, 0px));\n}\n[data-desktop-enhance-abnormal-fork-new] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: calc(28px + var(--dsh-content-font-delta, 0px));\n height: calc(28px + var(--dsh-content-font-delta, 0px));\n padding: 6px;\n border: none;\n border-radius: var(--dsw-radius-sm);\n background: transparent;\n color: var(--dsw-alias-label-tertiary);\n cursor: pointer;\n}\n[data-desktop-enhance-abnormal-fork-new] svg {\n width: calc(17px + var(--dsh-content-font-delta, 0px));\n height: calc(17px + var(--dsh-content-font-delta, 0px));\n}\n[data-desktop-enhance-abnormal-fork-new]:hover {\n background: var(--dsw-alias-interactive-bg-hover);\n color: var(--dsw-alias-label-primary);\n}\n[data-desktop-enhance-abnormal-fork-new]:focus-visible {\n outline: 2px solid var(--dsw-alias-state-business-primary);\n outline-offset: 2px;\n}\n[data-desktop-enhance-abnormal-fork-new]:disabled { opacity: .45; cursor: default; }\n[data-desktop-enhance-abnormal-fork-error] {\n color: var(--dsw-alias-label-primary);\n font-size: var(--dsh-content-font-size-secondary, 13px);\n}\n";
|
|
7737
8059
|
const inject = [
|
|
7738
8060
|
"slots",
|
|
7739
8061
|
"locale",
|
|
@@ -7775,6 +8097,40 @@ window.__ModuleLoader__.load({
|
|
|
7775
8097
|
value: void 0,
|
|
7776
8098
|
writable: true
|
|
7777
8099
|
});
|
|
8100
|
+
ctx.effect(() => installAbnormalFork(ctx, settings, t), "desktop-enhance: abnormal turn fork");
|
|
8101
|
+
ctx.effect(() => {
|
|
8102
|
+
let dispose;
|
|
8103
|
+
const sync = () => {
|
|
8104
|
+
if (!flagOn(settings.get().value, "sessionModel")) {
|
|
8105
|
+
dispose?.();
|
|
8106
|
+
dispose = void 0;
|
|
8107
|
+
return;
|
|
8108
|
+
}
|
|
8109
|
+
if (dispose) return;
|
|
8110
|
+
const offLabel = ctx.slots.inject("conversation.input.right", () => ctx.slots.register({
|
|
8111
|
+
name: "conversation.input.right",
|
|
8112
|
+
id: "desktop-enhance:session-model",
|
|
8113
|
+
order: 100,
|
|
8114
|
+
locale: NS
|
|
8115
|
+
}, SessionModelLabel));
|
|
8116
|
+
const offComposer = ctx.slots.inject("conversation.composer", () => ctx.slots.register({
|
|
8117
|
+
name: "conversation.composer",
|
|
8118
|
+
priority: -11,
|
|
8119
|
+
locale: NS,
|
|
8120
|
+
select: selectReadOnlyModel
|
|
8121
|
+
}, ReadOnlyModelComposer));
|
|
8122
|
+
dispose = () => {
|
|
8123
|
+
offComposer();
|
|
8124
|
+
offLabel();
|
|
8125
|
+
};
|
|
8126
|
+
};
|
|
8127
|
+
sync();
|
|
8128
|
+
const unsubscribe = settings.subscribe(sync);
|
|
8129
|
+
return () => {
|
|
8130
|
+
unsubscribe();
|
|
8131
|
+
dispose?.();
|
|
8132
|
+
};
|
|
8133
|
+
}, "desktop-enhance: session model");
|
|
7778
8134
|
const store = createFindStore();
|
|
7779
8135
|
let form = null;
|
|
7780
8136
|
const settingsCard = () => ({
|
|
@@ -7932,6 +8288,9 @@ window.__ModuleLoader__.load({
|
|
|
7932
8288
|
}
|
|
7933
8289
|
//#endregion
|
|
7934
8290
|
exports.__test = {
|
|
8291
|
+
SessionModelLabel,
|
|
8292
|
+
ReadOnlyModelComposer,
|
|
8293
|
+
selectReadOnlyModel,
|
|
7935
8294
|
collectFolderCounts,
|
|
7936
8295
|
watchFolderStatus,
|
|
7937
8296
|
installFolderStatus,
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import Schema from "@deepseek-ai/schemastery";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/session-model/host.d.ts
|
|
4
|
+
interface RequestEvent {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly seq: number;
|
|
7
|
+
readonly data: unknown;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
2
10
|
//#region src/shared/suggest.d.ts
|
|
3
11
|
declare function buildPrompt(template?: string): string;
|
|
4
12
|
//#endregion
|
|
@@ -177,6 +185,8 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
177
185
|
stepDuration: Schema<boolean, boolean, "volatile-defined">;
|
|
178
186
|
folderStatus: Schema<boolean, boolean, "volatile-defined">;
|
|
179
187
|
sessionInfo: Schema<boolean, boolean, "volatile-defined">;
|
|
188
|
+
sessionModel: Schema<boolean, boolean, "volatile-defined">;
|
|
189
|
+
abnormalFork: Schema<boolean, boolean, "volatile-defined">;
|
|
180
190
|
toolsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
181
191
|
skillsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
182
192
|
suggestModel: Schema<string, string, "volatile-defined">;
|
|
@@ -194,6 +204,8 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
194
204
|
stepDuration: Schema<boolean, boolean, "volatile-defined">;
|
|
195
205
|
folderStatus: Schema<boolean, boolean, "volatile-defined">;
|
|
196
206
|
sessionInfo: Schema<boolean, boolean, "volatile-defined">;
|
|
207
|
+
sessionModel: Schema<boolean, boolean, "volatile-defined">;
|
|
208
|
+
abnormalFork: Schema<boolean, boolean, "volatile-defined">;
|
|
197
209
|
toolsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
198
210
|
skillsManager: Schema<boolean, boolean, "volatile-defined">;
|
|
199
211
|
suggestModel: Schema<string, string, "volatile-defined">;
|
|
@@ -206,6 +218,60 @@ export declare const Config: Schema<Schemastery.ObjectS<NoInfer<{
|
|
|
206
218
|
}>>, "plain">;
|
|
207
219
|
export declare function apply(ctx: ToolsHostContext, config?: unknown): void;
|
|
208
220
|
export declare const __test: {
|
|
221
|
+
sessionModelProjection: {
|
|
222
|
+
key: string;
|
|
223
|
+
stateVersion: number;
|
|
224
|
+
stateSchema: import("zod").ZodObject<{
|
|
225
|
+
inheritedEventCount: import("zod").ZodNumber;
|
|
226
|
+
model: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
227
|
+
provider: import("zod").ZodString;
|
|
228
|
+
model: import("zod").ZodString;
|
|
229
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodString>;
|
|
230
|
+
}, import("zod/v4/core").$strip>>;
|
|
231
|
+
}, import("zod/v4/core").$strip>;
|
|
232
|
+
init: (_header: unknown, inheritedEventCount: number) => {
|
|
233
|
+
inheritedEventCount: number;
|
|
234
|
+
model: {
|
|
235
|
+
provider: string;
|
|
236
|
+
model: string;
|
|
237
|
+
reasoningEffort?: string | undefined;
|
|
238
|
+
} | null;
|
|
239
|
+
};
|
|
240
|
+
apply(state: {
|
|
241
|
+
inheritedEventCount: number;
|
|
242
|
+
model: {
|
|
243
|
+
provider: string;
|
|
244
|
+
model: string;
|
|
245
|
+
reasoningEffort?: string | undefined;
|
|
246
|
+
} | null;
|
|
247
|
+
}, event: RequestEvent): {
|
|
248
|
+
inheritedEventCount: number;
|
|
249
|
+
model: {
|
|
250
|
+
provider: string;
|
|
251
|
+
model: string;
|
|
252
|
+
reasoningEffort?: string | undefined;
|
|
253
|
+
} | null;
|
|
254
|
+
};
|
|
255
|
+
wire: {
|
|
256
|
+
viewSchema: import("zod").ZodNullable<import("zod").ZodObject<{
|
|
257
|
+
provider: import("zod").ZodString;
|
|
258
|
+
model: import("zod").ZodString;
|
|
259
|
+
reasoningEffort: import("zod").ZodOptional<import("zod").ZodString>;
|
|
260
|
+
}, import("zod/v4/core").$strip>>;
|
|
261
|
+
view: (state: {
|
|
262
|
+
inheritedEventCount: number;
|
|
263
|
+
model: {
|
|
264
|
+
provider: string;
|
|
265
|
+
model: string;
|
|
266
|
+
reasoningEffort?: string | undefined;
|
|
267
|
+
} | null;
|
|
268
|
+
}) => {
|
|
269
|
+
provider: string;
|
|
270
|
+
model: string;
|
|
271
|
+
reasoningEffort?: string | undefined;
|
|
272
|
+
} | null;
|
|
273
|
+
};
|
|
274
|
+
};
|
|
209
275
|
SUGGEST_PATH: string;
|
|
210
276
|
SUGGEST_MODELS_PATH: string;
|
|
211
277
|
SUGGEST_EFFORTS_PATH: string;
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
import Schema from "@deepseek-ai/schemastery";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
import * as nodeInspector from "node:inspector";
|
|
4
|
+
//#region src/shared/session-model.ts
|
|
5
|
+
const SESSION_MODEL_PROJECTION = "desktop-enhance.session-model";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/session-model/host.ts
|
|
8
|
+
const modelSchema = z.object({
|
|
9
|
+
provider: z.string().min(1),
|
|
10
|
+
model: z.string().min(1),
|
|
11
|
+
reasoningEffort: z.string().min(1).optional()
|
|
12
|
+
});
|
|
13
|
+
const sessionModelProjection = {
|
|
14
|
+
key: SESSION_MODEL_PROJECTION,
|
|
15
|
+
stateVersion: 1,
|
|
16
|
+
stateSchema: z.object({
|
|
17
|
+
inheritedEventCount: z.number().int().nonnegative(),
|
|
18
|
+
model: modelSchema.nullable()
|
|
19
|
+
}),
|
|
20
|
+
init: (_header, inheritedEventCount) => ({
|
|
21
|
+
inheritedEventCount,
|
|
22
|
+
model: null
|
|
23
|
+
}),
|
|
24
|
+
apply(state, event) {
|
|
25
|
+
if (event.type !== "request/header" || event.seq < state.inheritedEventCount) return state;
|
|
26
|
+
const data = event.data;
|
|
27
|
+
const model = modelSchema.parse(data.header.config);
|
|
28
|
+
if (state.model?.provider === model.provider && state.model.model === model.model && state.model.reasoningEffort === model.reasoningEffort) return state;
|
|
29
|
+
return {
|
|
30
|
+
...state,
|
|
31
|
+
model
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
wire: {
|
|
35
|
+
viewSchema: modelSchema.nullable(),
|
|
36
|
+
view: (state) => state.model
|
|
37
|
+
}
|
|
38
|
+
};
|
|
3
39
|
const ESCAPE_SEQUENCES = /\x1b\[[0-?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]/g;
|
|
4
40
|
const TAG_CHARACTERS = /[\u{E0000}-\u{E007F}]/u;
|
|
5
41
|
const UNSEEN_CHARACTERS = /[\p{Cc}\p{Cf}\p{Cn}\p{Co}\p{Cs}\p{Variation_Selector}\u115f\u1160\u3164\uffa0]/gu;
|
|
@@ -2492,6 +2528,8 @@ const Config = Schema.object({
|
|
|
2492
2528
|
stepDuration: Schema.boolean().default(true).volatile(),
|
|
2493
2529
|
folderStatus: Schema.boolean().default(true).volatile(),
|
|
2494
2530
|
sessionInfo: Schema.boolean().default(true).volatile(),
|
|
2531
|
+
sessionModel: Schema.boolean().default(true).volatile(),
|
|
2532
|
+
abnormalFork: Schema.boolean().default(true).volatile(),
|
|
2495
2533
|
toolsManager: Schema.boolean().default(true).volatile(),
|
|
2496
2534
|
skillsManager: Schema.boolean().default(true).volatile(),
|
|
2497
2535
|
suggestModel: Schema.string().default("").volatile(),
|
|
@@ -2503,6 +2541,9 @@ const Config = Schema.object({
|
|
|
2503
2541
|
sessionSkillOverrides: Schema.string().default("").volatile()
|
|
2504
2542
|
});
|
|
2505
2543
|
function apply(ctx, config) {
|
|
2544
|
+
ctx.inject(["sessionProjections"], (serviceCtx) => {
|
|
2545
|
+
serviceCtx.get("sessionProjections").register(sessionModelProjection);
|
|
2546
|
+
});
|
|
2506
2547
|
ctx.inject(["connection"], (serviceCtx) => {
|
|
2507
2548
|
try {
|
|
2508
2549
|
serviceCtx.effect(() => registerSuggestRoute(serviceCtx), "desktop-enhance: suggest route");
|
|
@@ -2537,6 +2578,7 @@ function apply(ctx, config) {
|
|
|
2537
2578
|
});
|
|
2538
2579
|
}
|
|
2539
2580
|
const __test = {
|
|
2581
|
+
sessionModelProjection,
|
|
2540
2582
|
SUGGEST_PATH,
|
|
2541
2583
|
SUGGEST_MODELS_PATH,
|
|
2542
2584
|
SUGGEST_EFFORTS_PATH,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-desktop-enhance",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "DSH Desktop 界面增强:页内查找(Cmd+F)、轮次编号、上下文压缩行常显、建议、每步耗时、折叠文件夹状态计数、会话信息(含上下文注入 C1 视图)、工具管理、Skill 管理、独立远程接入与手机体验。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "./icon.svg",
|
|
@@ -32,6 +32,18 @@
|
|
|
32
32
|
"icon.svg",
|
|
33
33
|
"cordis.patch.yml"
|
|
34
34
|
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsdown",
|
|
37
|
+
"dev": "tsdown --watch",
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"test": "node --test tests/*.test.mjs",
|
|
40
|
+
"test:isolation": "./tools/test-isolation.sh",
|
|
41
|
+
"verify": "pnpm typecheck && pnpm build && pnpm test && pnpm test:isolation",
|
|
42
|
+
"prepack": "pnpm build",
|
|
43
|
+
"prepublishOnly": "pnpm verify",
|
|
44
|
+
"release:patch": "npm version patch && pnpm publish",
|
|
45
|
+
"release:minor": "npm version minor && pnpm publish"
|
|
46
|
+
},
|
|
35
47
|
"publishConfig": {
|
|
36
48
|
"access": "public"
|
|
37
49
|
},
|
|
@@ -42,22 +54,13 @@
|
|
|
42
54
|
"plugin"
|
|
43
55
|
],
|
|
44
56
|
"dependencies": {
|
|
45
|
-
"@deepseek-ai/schemastery": "3.18.4"
|
|
57
|
+
"@deepseek-ai/schemastery": "3.18.4",
|
|
58
|
+
"zod": "4.4.3"
|
|
46
59
|
},
|
|
47
60
|
"devDependencies": {
|
|
48
61
|
"@types/node": "^22.20.5",
|
|
49
62
|
"@types/react": "^18.3.31",
|
|
50
63
|
"tsdown": "0.23.0",
|
|
51
64
|
"typescript": "5.9.3"
|
|
52
|
-
},
|
|
53
|
-
"scripts": {
|
|
54
|
-
"build": "tsdown",
|
|
55
|
-
"dev": "tsdown --watch",
|
|
56
|
-
"typecheck": "tsc --noEmit",
|
|
57
|
-
"test": "node --test tests/*.test.mjs",
|
|
58
|
-
"test:isolation": "./tools/test-isolation.sh",
|
|
59
|
-
"verify": "pnpm typecheck && pnpm build && pnpm test && pnpm test:isolation",
|
|
60
|
-
"release:patch": "npm version patch && pnpm publish",
|
|
61
|
-
"release:minor": "npm version minor && pnpm publish"
|
|
62
65
|
}
|
|
63
|
-
}
|
|
66
|
+
}
|