dsh-desktop-enhance 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +212 -161
- package/package.json +17 -12
package/lib/client.js
CHANGED
|
@@ -1857,9 +1857,29 @@ window.__ModuleLoader__.load({
|
|
|
1857
1857
|
const items = buckets.get(scope) ?? [];
|
|
1858
1858
|
if (items.length === 0) continue;
|
|
1859
1859
|
items.sort((a, b) => compareCodeUnits(a.name, b.name));
|
|
1860
|
+
const subBuckets = new Map();
|
|
1861
|
+
for (const item of items) {
|
|
1862
|
+
const label = item.sourceBadge !== "" ? item.sourceBadge : scope;
|
|
1863
|
+
const list = subBuckets.get(label);
|
|
1864
|
+
if (list !== void 0) list.push(item);
|
|
1865
|
+
else subBuckets.set(label, [item]);
|
|
1866
|
+
}
|
|
1867
|
+
const subgroups = [...subBuckets.keys()].sort(compareCodeUnits).map((label) => {
|
|
1868
|
+
const subItems = subBuckets.get(label) ?? [];
|
|
1869
|
+
const subDisabled = subItems.reduce((sum, item) => sum + (item.disabled ? 1 : 0), 0);
|
|
1870
|
+
return {
|
|
1871
|
+
key: `${scope}:${label}`,
|
|
1872
|
+
scope,
|
|
1873
|
+
label,
|
|
1874
|
+
items: subItems,
|
|
1875
|
+
total: subItems.length,
|
|
1876
|
+
disabled: subDisabled
|
|
1877
|
+
};
|
|
1878
|
+
});
|
|
1860
1879
|
const disabledCount = items.reduce((sum, item) => sum + (item.disabled ? 1 : 0), 0);
|
|
1861
1880
|
groups.push({
|
|
1862
1881
|
scope,
|
|
1882
|
+
subgroups,
|
|
1863
1883
|
items,
|
|
1864
1884
|
total: items.length,
|
|
1865
1885
|
disabled: disabledCount
|
|
@@ -2563,9 +2583,7 @@ window.__ModuleLoader__.load({
|
|
|
2563
2583
|
disabledCount: node.disabled,
|
|
2564
2584
|
controlDisabled: disabled,
|
|
2565
2585
|
depth,
|
|
2566
|
-
onToggleOpen: () =>
|
|
2567
|
-
setCollapsedNodes((curr) => curr.includes(node.prefix) ? curr.filter((p) => p !== node.prefix) : [...curr, node.prefix]);
|
|
2568
|
-
},
|
|
2586
|
+
onToggleOpen: () => setCollapsedNodes((curr) => toggleKeyInList(curr, node.prefix)),
|
|
2569
2587
|
onBatchToggle: () => commitSet(toggleNodeInSet(disabledSet, node))
|
|
2570
2588
|
}), isOpen ? h("div", {
|
|
2571
2589
|
key: "children",
|
|
@@ -2612,9 +2630,7 @@ window.__ModuleLoader__.load({
|
|
|
2612
2630
|
disabledCount: group.disabled,
|
|
2613
2631
|
controlDisabled: disabled,
|
|
2614
2632
|
depth: 0,
|
|
2615
|
-
onToggleOpen: () =>
|
|
2616
|
-
setCollapsedNodes((curr) => curr.includes(scopeKey) ? curr.filter((p) => p !== scopeKey) : [...curr, scopeKey]);
|
|
2617
|
-
},
|
|
2633
|
+
onToggleOpen: () => setCollapsedNodes((curr) => toggleKeyInList(curr, scopeKey)),
|
|
2618
2634
|
onBatchToggle: () => commitSet(toggleToolScopeGroupInSet(disabledSet, group))
|
|
2619
2635
|
}), isOpen ? h("div", {
|
|
2620
2636
|
key: "children",
|
|
@@ -2623,11 +2639,17 @@ window.__ModuleLoader__.load({
|
|
|
2623
2639
|
})
|
|
2624
2640
|
});
|
|
2625
2641
|
}
|
|
2642
|
+
function toggleKeyInList(list, nodeKey) {
|
|
2643
|
+
return list.includes(nodeKey) ? list.filter((item) => item !== nodeKey) : [...list, nodeKey];
|
|
2644
|
+
}
|
|
2626
2645
|
function DefaultSkillsManager({ t, disabledRaw, disabled, onSave }) {
|
|
2627
2646
|
const [catalog, setCatalog] = React.useState(null);
|
|
2628
2647
|
const [open, setOpen] = React.useState(false);
|
|
2629
2648
|
const [query, setQuery] = React.useState("");
|
|
2630
|
-
const [
|
|
2649
|
+
const [collapsedNodes, setCollapsedNodes] = React.useState([]);
|
|
2650
|
+
const toggleNodeCollapse = (nodeKey) => {
|
|
2651
|
+
setCollapsedNodes((curr) => toggleKeyInList(curr, nodeKey));
|
|
2652
|
+
};
|
|
2631
2653
|
React.useEffect(() => {
|
|
2632
2654
|
if (typeof globalThis.fetch !== "function") return void 0;
|
|
2633
2655
|
let live = true;
|
|
@@ -2682,7 +2704,7 @@ window.__ModuleLoader__.load({
|
|
|
2682
2704
|
onEnableAll: () => commitSet(new Set()),
|
|
2683
2705
|
onRefresh: refreshCatalog,
|
|
2684
2706
|
treeElements: groups.map((group) => {
|
|
2685
|
-
const isOpen = query.trim() !== "" || !
|
|
2707
|
+
const isOpen = query.trim() !== "" || !collapsedNodes.includes(group.scope);
|
|
2686
2708
|
return h("div", {
|
|
2687
2709
|
key: `group:${group.scope}`,
|
|
2688
2710
|
className: "de-defaults-group",
|
|
@@ -2697,51 +2719,72 @@ window.__ModuleLoader__.load({
|
|
|
2697
2719
|
total: group.total,
|
|
2698
2720
|
disabledCount: group.disabled,
|
|
2699
2721
|
controlDisabled: disabled,
|
|
2700
|
-
onToggleOpen: () =>
|
|
2701
|
-
setCollapsedScopes((curr) => curr.includes(group.scope) ? curr.filter((s) => s !== group.scope) : [...curr, group.scope]);
|
|
2702
|
-
},
|
|
2722
|
+
onToggleOpen: () => toggleNodeCollapse(group.scope),
|
|
2703
2723
|
onBatchToggle: () => commitSet(toggleSkillGroupInSet(disabledSet, group))
|
|
2704
2724
|
}), isOpen ? h("div", {
|
|
2705
|
-
key: "
|
|
2725
|
+
key: "subgroups",
|
|
2706
2726
|
className: "de-defaults-group-children"
|
|
2707
|
-
}, group.
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
"
|
|
2729
|
-
}, item
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2727
|
+
}, group.subgroups.map((subgroup) => {
|
|
2728
|
+
const subOpen = query.trim() !== "" || !collapsedNodes.includes(subgroup.key);
|
|
2729
|
+
return h("div", {
|
|
2730
|
+
key: `subgroup:${subgroup.key}`,
|
|
2731
|
+
className: "de-defaults-group",
|
|
2732
|
+
"data-default-skill-subgroup": subgroup.key
|
|
2733
|
+
}, [renderDefaultGroupHeader({
|
|
2734
|
+
t,
|
|
2735
|
+
headerAttr: "data-default-skill-subgroup-header",
|
|
2736
|
+
batchAttr: "data-default-skill-subgroup-batch",
|
|
2737
|
+
groupKey: subgroup.key,
|
|
2738
|
+
label: subgroup.label,
|
|
2739
|
+
isOpen: subOpen,
|
|
2740
|
+
total: subgroup.total,
|
|
2741
|
+
disabledCount: subgroup.disabled,
|
|
2742
|
+
controlDisabled: disabled,
|
|
2743
|
+
depth: 1,
|
|
2744
|
+
onToggleOpen: () => toggleNodeCollapse(subgroup.key),
|
|
2745
|
+
onBatchToggle: () => commitSet(toggleSkillGroupInSet(disabledSet, subgroup))
|
|
2746
|
+
}), subOpen ? h("div", {
|
|
2747
|
+
key: "items",
|
|
2748
|
+
className: "de-defaults-group-children"
|
|
2749
|
+
}, subgroup.items.map((item) => h("div", {
|
|
2750
|
+
key: `skill:${item.name}`,
|
|
2751
|
+
className: "de-defaults-leaf",
|
|
2752
|
+
"data-default-skill-leaf": item.name,
|
|
2753
|
+
"data-skill-scope": item.scope,
|
|
2754
|
+
"data-disabled": item.disabled ? "true" : "false",
|
|
2755
|
+
style: { paddingLeft: "40px" }
|
|
2756
|
+
}, [h("div", {
|
|
2757
|
+
key: "info",
|
|
2758
|
+
className: "de-defaults-leaf-info"
|
|
2759
|
+
}, [h("div", {
|
|
2760
|
+
key: "head",
|
|
2761
|
+
className: "de-defaults-leaf-head"
|
|
2762
|
+
}, [
|
|
2763
|
+
h("span", {
|
|
2764
|
+
key: "name",
|
|
2765
|
+
className: "de-defaults-leaf-name"
|
|
2766
|
+
}, item.name),
|
|
2767
|
+
h("span", {
|
|
2768
|
+
key: "badge",
|
|
2769
|
+
className: "de-defaults-source-badge",
|
|
2770
|
+
"data-skill-scope": item.scope
|
|
2771
|
+
}, item.sourceBadge),
|
|
2772
|
+
!item.modelInvocable ? h("span", {
|
|
2773
|
+
key: "user-only",
|
|
2774
|
+
className: "de-defaults-source-badge"
|
|
2775
|
+
}, t("settings.skills.userOnly")) : null
|
|
2776
|
+
]), item.description !== "" ? h("div", {
|
|
2777
|
+
key: "desc",
|
|
2778
|
+
className: "de-defaults-leaf-desc"
|
|
2779
|
+
}, item.description) : null]), renderDefaultLeafControls({
|
|
2780
|
+
t,
|
|
2781
|
+
itemDisabled: item.disabled,
|
|
2782
|
+
toggleAttr: "data-default-skill-toggle",
|
|
2783
|
+
itemName: item.name,
|
|
2784
|
+
controlDisabled: disabled,
|
|
2785
|
+
onToggle: () => commitSet(toggleToolInSet(disabledSet, item.name, !item.disabled))
|
|
2786
|
+
})]))) : null]);
|
|
2787
|
+
})) : null]);
|
|
2745
2788
|
})
|
|
2746
2789
|
});
|
|
2747
2790
|
}
|
|
@@ -4160,7 +4203,7 @@ window.__ModuleLoader__.load({
|
|
|
4160
4203
|
return scopeGroups.map(buildScopeGroupDom);
|
|
4161
4204
|
}
|
|
4162
4205
|
function buildSkillGroupDomNodes(opts) {
|
|
4163
|
-
const { t, skillsCatalog, disabledSet, searchQuery,
|
|
4206
|
+
const { t, skillsCatalog, disabledSet, searchQuery, collapsedSkillNodes, includeProject, writable, onToggleSkillNode, onCommitSet, onPreviewSkill } = opts;
|
|
4164
4207
|
const groups = buildSkillScopeGroups(skillsCatalog, disabledSet, searchQuery, { includeProject });
|
|
4165
4208
|
if (groups.length === 0) {
|
|
4166
4209
|
const empty = globalThis.document.createElement("div");
|
|
@@ -4170,111 +4213,119 @@ window.__ModuleLoader__.load({
|
|
|
4170
4213
|
return [empty];
|
|
4171
4214
|
}
|
|
4172
4215
|
const buildGroupDom = (group) => {
|
|
4173
|
-
const isOpen = searchQuery.trim() !== "" ||
|
|
4216
|
+
const isOpen = searchQuery.trim() !== "" || !collapsedSkillNodes.has(group.scope);
|
|
4174
4217
|
const groupEl = globalThis.document.createElement("div");
|
|
4175
4218
|
groupEl.setAttribute("data-tools-node", group.scope);
|
|
4176
4219
|
groupEl.setAttribute("data-skills-group", group.scope);
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4220
|
+
groupEl.appendChild(buildCollapsibleGroupHeaderDom({
|
|
4221
|
+
t,
|
|
4222
|
+
headerAttr: "data-tools-node-header",
|
|
4223
|
+
headerValue: group.scope,
|
|
4224
|
+
extraHeaderAttr: {
|
|
4225
|
+
name: "data-skills-group-header",
|
|
4226
|
+
value: group.scope
|
|
4227
|
+
},
|
|
4228
|
+
batchAttr: "data-skills-batch",
|
|
4229
|
+
batchValue: group.scope,
|
|
4230
|
+
labelText: t(`settings.skills.scope.${group.scope}`),
|
|
4231
|
+
isOpen,
|
|
4232
|
+
total: group.total,
|
|
4233
|
+
disabledCount: group.disabled,
|
|
4234
|
+
writable,
|
|
4235
|
+
depth: 0,
|
|
4236
|
+
onToggleOpen: () => onToggleSkillNode(group.scope),
|
|
4237
|
+
onBatchToggle: () => onCommitSet(toggleSkillGroupInSet(disabledSet, group))
|
|
4238
|
+
}));
|
|
4239
|
+
if (isOpen) for (const subgroup of group.subgroups) {
|
|
4240
|
+
const subOpen = searchQuery.trim() !== "" || !collapsedSkillNodes.has(subgroup.key);
|
|
4241
|
+
const subEl = globalThis.document.createElement("div");
|
|
4242
|
+
subEl.setAttribute("data-tools-node", subgroup.key);
|
|
4243
|
+
subEl.setAttribute("data-skills-subgroup", subgroup.key);
|
|
4244
|
+
subEl.appendChild(buildCollapsibleGroupHeaderDom({
|
|
4245
|
+
t,
|
|
4246
|
+
headerAttr: "data-tools-node-header",
|
|
4247
|
+
headerValue: subgroup.key,
|
|
4248
|
+
extraHeaderAttr: {
|
|
4249
|
+
name: "data-skills-subgroup-header",
|
|
4250
|
+
value: subgroup.key
|
|
4251
|
+
},
|
|
4252
|
+
batchAttr: "data-skills-subgroup-batch",
|
|
4253
|
+
batchValue: subgroup.key,
|
|
4254
|
+
labelText: subgroup.label,
|
|
4255
|
+
isOpen: subOpen,
|
|
4256
|
+
total: subgroup.total,
|
|
4257
|
+
disabledCount: subgroup.disabled,
|
|
4258
|
+
writable,
|
|
4259
|
+
depth: 1,
|
|
4260
|
+
onToggleOpen: () => onToggleSkillNode(subgroup.key),
|
|
4261
|
+
onBatchToggle: () => onCommitSet(toggleSkillGroupInSet(disabledSet, subgroup))
|
|
4262
|
+
}));
|
|
4263
|
+
if (subOpen) for (const item of subgroup.items) {
|
|
4264
|
+
const row = globalThis.document.createElement("div");
|
|
4265
|
+
row.setAttribute("data-tools-leaf", item.name);
|
|
4266
|
+
row.setAttribute("data-skills-leaf", item.name);
|
|
4267
|
+
row.setAttribute("data-skill-scope", item.scope);
|
|
4268
|
+
row.setAttribute("data-disabled", item.disabled ? "true" : "false");
|
|
4269
|
+
row.setAttribute("style", "padding-left: 44px;");
|
|
4270
|
+
const info = globalThis.document.createElement("div");
|
|
4271
|
+
info.setAttribute("data-tools-leaf-info", "");
|
|
4272
|
+
const nameRow = globalThis.document.createElement("div");
|
|
4273
|
+
nameRow.setAttribute("data-skills-leaf-header", "");
|
|
4274
|
+
const nameEl = globalThis.document.createElement("span");
|
|
4275
|
+
nameEl.setAttribute("data-tools-leaf-name", "");
|
|
4276
|
+
nameEl.setAttribute("data-skills-leaf-name", "");
|
|
4277
|
+
nameEl.textContent = item.name;
|
|
4278
|
+
nameRow.appendChild(nameEl);
|
|
4279
|
+
const sourceBadge = globalThis.document.createElement("span");
|
|
4280
|
+
sourceBadge.setAttribute("data-skills-source-badge", item.scope);
|
|
4281
|
+
sourceBadge.textContent = item.sourceBadge;
|
|
4282
|
+
nameRow.appendChild(sourceBadge);
|
|
4283
|
+
if (!item.modelInvocable) {
|
|
4284
|
+
const userOnly = globalThis.document.createElement("span");
|
|
4285
|
+
userOnly.setAttribute("data-skills-user-only", "");
|
|
4286
|
+
userOnly.textContent = t("settings.skills.userOnly");
|
|
4287
|
+
nameRow.appendChild(userOnly);
|
|
4288
|
+
}
|
|
4289
|
+
if (onPreviewSkill !== void 0) {
|
|
4290
|
+
const previewBtn = globalThis.document.createElement("button");
|
|
4291
|
+
previewBtn.setAttribute("type", "button");
|
|
4292
|
+
previewBtn.setAttribute("data-skills-preview", item.name);
|
|
4293
|
+
previewBtn.textContent = t("settings.skills.preview");
|
|
4294
|
+
previewBtn.addEventListener("click", (e) => {
|
|
4295
|
+
e?.stopPropagation?.();
|
|
4296
|
+
onPreviewSkill(item.name);
|
|
4297
|
+
});
|
|
4298
|
+
nameRow.appendChild(previewBtn);
|
|
4299
|
+
}
|
|
4300
|
+
info.appendChild(nameRow);
|
|
4301
|
+
if (item.description !== "") {
|
|
4302
|
+
const descEl = globalThis.document.createElement("div");
|
|
4303
|
+
descEl.setAttribute("data-tools-leaf-desc", "");
|
|
4304
|
+
descEl.textContent = item.description;
|
|
4305
|
+
info.appendChild(descEl);
|
|
4306
|
+
}
|
|
4307
|
+
row.appendChild(info);
|
|
4308
|
+
const itemCtrls = globalThis.document.createElement("div");
|
|
4309
|
+
itemCtrls.setAttribute("data-tools-controls", "");
|
|
4310
|
+
const itemPill = globalThis.document.createElement("span");
|
|
4311
|
+
itemPill.setAttribute("data-tools-pill", "");
|
|
4312
|
+
itemPill.setAttribute("data-disabled", item.disabled ? "true" : "false");
|
|
4313
|
+
itemPill.textContent = item.disabled ? t("settings.tools.disabled") : t("settings.tools.enabled");
|
|
4314
|
+
itemCtrls.appendChild(itemPill);
|
|
4315
|
+
const toggleBtn = globalThis.document.createElement("button");
|
|
4316
|
+
toggleBtn.setAttribute("type", "button");
|
|
4317
|
+
toggleBtn.setAttribute("data-tools-btn", "");
|
|
4318
|
+
toggleBtn.setAttribute("data-skills-toggle", item.name);
|
|
4319
|
+
toggleBtn.textContent = item.disabled ? t("settings.tools.enable") : t("settings.tools.disable");
|
|
4320
|
+
if (!writable) toggleBtn.setAttribute("disabled", "");
|
|
4321
|
+
toggleBtn.addEventListener("click", () => {
|
|
4322
|
+
onCommitSet(toggleToolInSet(disabledSet, item.name, !item.disabled));
|
|
4248
4323
|
});
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
if (item.description !== "") {
|
|
4253
|
-
const descEl = globalThis.document.createElement("div");
|
|
4254
|
-
descEl.setAttribute("data-tools-leaf-desc", "");
|
|
4255
|
-
descEl.textContent = item.description;
|
|
4256
|
-
info.appendChild(descEl);
|
|
4324
|
+
itemCtrls.appendChild(toggleBtn);
|
|
4325
|
+
row.appendChild(itemCtrls);
|
|
4326
|
+
subEl.appendChild(row);
|
|
4257
4327
|
}
|
|
4258
|
-
|
|
4259
|
-
const itemCtrls = globalThis.document.createElement("div");
|
|
4260
|
-
itemCtrls.setAttribute("data-tools-controls", "");
|
|
4261
|
-
const itemPill = globalThis.document.createElement("span");
|
|
4262
|
-
itemPill.setAttribute("data-tools-pill", "");
|
|
4263
|
-
itemPill.setAttribute("data-disabled", item.disabled ? "true" : "false");
|
|
4264
|
-
itemPill.textContent = item.disabled ? t("settings.tools.disabled") : t("settings.tools.enabled");
|
|
4265
|
-
itemCtrls.appendChild(itemPill);
|
|
4266
|
-
const toggleBtn = globalThis.document.createElement("button");
|
|
4267
|
-
toggleBtn.setAttribute("type", "button");
|
|
4268
|
-
toggleBtn.setAttribute("data-tools-btn", "");
|
|
4269
|
-
toggleBtn.setAttribute("data-skills-toggle", item.name);
|
|
4270
|
-
toggleBtn.textContent = item.disabled ? t("settings.tools.enable") : t("settings.tools.disable");
|
|
4271
|
-
if (!writable) toggleBtn.setAttribute("disabled", "");
|
|
4272
|
-
toggleBtn.addEventListener("click", () => {
|
|
4273
|
-
onCommitSet(toggleToolInSet(disabledSet, item.name, !item.disabled));
|
|
4274
|
-
});
|
|
4275
|
-
itemCtrls.appendChild(toggleBtn);
|
|
4276
|
-
row.appendChild(itemCtrls);
|
|
4277
|
-
groupEl.appendChild(row);
|
|
4328
|
+
groupEl.appendChild(subEl);
|
|
4278
4329
|
}
|
|
4279
4330
|
return groupEl;
|
|
4280
4331
|
};
|
|
@@ -4418,7 +4469,7 @@ window.__ModuleLoader__.load({
|
|
|
4418
4469
|
});
|
|
4419
4470
|
}
|
|
4420
4471
|
function syncSkillsPopover(props) {
|
|
4421
|
-
const { root, t, skillsCatalog, disabledSet, disabledInCatalog, customized = false, searchQuery,
|
|
4472
|
+
const { root, t, skillsCatalog, disabledSet, disabledInCatalog, customized = false, searchQuery, collapsedSkillNodes, writable, compact = false, onSearchChange, onToggleSkillNode, onCommitSet, onResetOverride, onRefreshCatalog, onPreviewSkill, onClose } = props;
|
|
4422
4473
|
return syncAnchoredPopoverShell({
|
|
4423
4474
|
root,
|
|
4424
4475
|
popoverAttr: SKILLS_POPOVER_ATTR,
|
|
@@ -4444,10 +4495,10 @@ window.__ModuleLoader__.load({
|
|
|
4444
4495
|
skillsCatalog,
|
|
4445
4496
|
disabledSet,
|
|
4446
4497
|
searchQuery,
|
|
4447
|
-
|
|
4498
|
+
collapsedSkillNodes,
|
|
4448
4499
|
includeProject: true,
|
|
4449
4500
|
writable,
|
|
4450
|
-
|
|
4501
|
+
onToggleSkillNode,
|
|
4451
4502
|
onCommitSet,
|
|
4452
4503
|
onPreviewSkill
|
|
4453
4504
|
})
|
|
@@ -4529,7 +4580,7 @@ window.__ModuleLoader__.load({
|
|
|
4529
4580
|
skillsDisabledCanonical: state.skillsDisabledCanonical,
|
|
4530
4581
|
skillsCustomized: state.skillsCustomized,
|
|
4531
4582
|
skillsSearchQuery: state.skillsSearchQuery,
|
|
4532
|
-
|
|
4583
|
+
collapsedSkills: [...state.collapsedSkillNodes].sort(),
|
|
4533
4584
|
activePopover: state.activePopover
|
|
4534
4585
|
});
|
|
4535
4586
|
}
|
|
@@ -4644,7 +4695,7 @@ window.__ModuleLoader__.load({
|
|
|
4644
4695
|
let skillsCatalogAttemptedFor = null;
|
|
4645
4696
|
let skillsLoading = false;
|
|
4646
4697
|
let skillsSearchQuery = "";
|
|
4647
|
-
const
|
|
4698
|
+
const collapsedSkillNodes = new Set();
|
|
4648
4699
|
function removeToolsPopover() {
|
|
4649
4700
|
if (mountedToolsPopover !== null) {
|
|
4650
4701
|
mountedToolsPopover.remove();
|
|
@@ -4790,7 +4841,7 @@ window.__ModuleLoader__.load({
|
|
|
4790
4841
|
skillsDisabledCanonical,
|
|
4791
4842
|
skillsCustomized,
|
|
4792
4843
|
skillsSearchQuery,
|
|
4793
|
-
|
|
4844
|
+
collapsedSkillNodes,
|
|
4794
4845
|
activePopover
|
|
4795
4846
|
});
|
|
4796
4847
|
let panel = root.querySelector(`[${SESSION_INFO_ATTR}]`);
|
|
@@ -4997,7 +5048,7 @@ window.__ModuleLoader__.load({
|
|
|
4997
5048
|
disabledInCatalog: disabledSkillsInCatalog,
|
|
4998
5049
|
customized: skillsCustomized,
|
|
4999
5050
|
searchQuery: skillsSearchQuery,
|
|
5000
|
-
|
|
5051
|
+
collapsedSkillNodes,
|
|
5001
5052
|
writable: skillsWritable,
|
|
5002
5053
|
compact,
|
|
5003
5054
|
onSearchChange: (nextQuery) => {
|
|
@@ -5005,9 +5056,9 @@ window.__ModuleLoader__.load({
|
|
|
5005
5056
|
lastSignature = "";
|
|
5006
5057
|
paint(root, sessionId);
|
|
5007
5058
|
},
|
|
5008
|
-
|
|
5009
|
-
if (
|
|
5010
|
-
else
|
|
5059
|
+
onToggleSkillNode: (key) => {
|
|
5060
|
+
if (collapsedSkillNodes.has(key)) collapsedSkillNodes.delete(key);
|
|
5061
|
+
else collapsedSkillNodes.add(key);
|
|
5011
5062
|
lastSignature = "";
|
|
5012
5063
|
paint(root, sessionId);
|
|
5013
5064
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-desktop-enhance",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "DSH Desktop 界面增强:页内查找(Cmd+F)、轮次编号、上下文压缩行常显、建议、每步耗时、会话信息、工具管理、Skill 管理。",
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
5
8
|
"type": "module",
|
|
6
9
|
"exports": {
|
|
7
10
|
".": "./lib/index.js",
|
|
@@ -26,6 +29,18 @@
|
|
|
26
29
|
"lib",
|
|
27
30
|
"cordis.patch.yml"
|
|
28
31
|
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"dev": "tsdown --watch",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"test": "node --test tests/*.test.mjs",
|
|
37
|
+
"test:isolation": "./tools/test-isolation.sh",
|
|
38
|
+
"verify": "pnpm typecheck && pnpm build && pnpm test && pnpm test:isolation",
|
|
39
|
+
"prepack": "pnpm build",
|
|
40
|
+
"prepublishOnly": "pnpm verify",
|
|
41
|
+
"release:patch": "npm version patch && pnpm publish",
|
|
42
|
+
"release:minor": "npm version minor && pnpm publish"
|
|
43
|
+
},
|
|
29
44
|
"publishConfig": {
|
|
30
45
|
"access": "public"
|
|
31
46
|
},
|
|
@@ -43,15 +58,5 @@
|
|
|
43
58
|
"@types/react": "^18.3.31",
|
|
44
59
|
"tsdown": "0.23.0",
|
|
45
60
|
"typescript": "5.9.3"
|
|
46
|
-
},
|
|
47
|
-
"scripts": {
|
|
48
|
-
"build": "tsdown",
|
|
49
|
-
"dev": "tsdown --watch",
|
|
50
|
-
"typecheck": "tsc --noEmit",
|
|
51
|
-
"test": "node --test tests/*.test.mjs",
|
|
52
|
-
"test:isolation": "./tools/test-isolation.sh",
|
|
53
|
-
"verify": "pnpm typecheck && pnpm build && pnpm test && pnpm test:isolation",
|
|
54
|
-
"release:patch": "npm version patch && pnpm publish",
|
|
55
|
-
"release:minor": "npm version minor && pnpm publish"
|
|
56
61
|
}
|
|
57
|
-
}
|
|
62
|
+
}
|