dsh-subagent-library 0.2.7 → 0.2.8

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.
Files changed (2) hide show
  1. package/lib/client.js +41 -0
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -917,6 +917,46 @@ function LibrarySettings(props) {
917
917
  });
918
918
  }
919
919
 
920
+ //#endregion
921
+ //#region src/client/nav-icon.ts
922
+ /**
923
+ * Settings-nav icon decoration for this plugin's own row (子代理库).
924
+ *
925
+ * The official settings shell's navIcon(id) table is closed — official ids
926
+ * get drawn icons and everything else falls back to a generic gear. This
927
+ * replaces that fallback <svg> inside OUR nav button (matched by our own
928
+ * registered label text) with the drawn robot-head icon. A MutationObserver
929
+ * re-applies the icon when the panel re-renders; gated on the settings
930
+ * dialog being present so idle chat streams never pay the query cost.
931
+ */
932
+ const NAV_ICON_INNER = "<path d=\"M8 6.5V3.9\"/><circle cx=\"8\" cy=\"2.6\" r=\"0.85\"/><rect x=\"3.25\" y=\"6.5\" width=\"9.5\" height=\"6.5\" rx=\"1.5\"/><path d=\"M5.75 9.25v1.25\"/><path d=\"M10.25 9.25v1.25\"/><path d=\"M1.75 9.25h1.5\"/><path d=\"M12.75 9.25h1.5\"/>";
933
+ const NAV_LABELS = new Set(["子代理库"]);
934
+ function decorateSettingsNavIcon(ctx) {
935
+ ctx.effect(() => {
936
+ const decorate = () => {
937
+ if (document.querySelector("[role=\"dialog\"]") === null) return;
938
+ for (const button of Array.from(document.querySelectorAll("button"))) {
939
+ const label = button.querySelector(":scope > span");
940
+ if (label === null || !NAV_LABELS.has(label.textContent ?? "")) continue;
941
+ const existing = button.firstElementChild;
942
+ if (existing instanceof SVGElement) {
943
+ if (existing.dataset.navIcon === "1") continue;
944
+ const template = document.createElement("template");
945
+ template.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" data-nav-icon="1">${NAV_ICON_INNER}</svg>`;
946
+ existing.replaceWith(template.content.firstElementChild);
947
+ }
948
+ }
949
+ };
950
+ const observer = new MutationObserver(() => decorate());
951
+ observer.observe(document.body, {
952
+ childList: true,
953
+ subtree: true
954
+ });
955
+ decorate();
956
+ return () => observer.disconnect();
957
+ }, "subagent-library: nav icon decoration");
958
+ }
959
+
920
960
  //#endregion
921
961
  //#region src/client/locales.ts
922
962
  const zh = {
@@ -1068,6 +1108,7 @@ function apply(ctx) {
1068
1108
  subscribeRefresh
1069
1109
  })
1070
1110
  }, LibrarySettings));
1111
+ decorateSettingsNavIcon(ctx);
1071
1112
  }
1072
1113
 
1073
1114
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-subagent-library",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Named subagent library for DeepSeek Harness: a settings-driven roster of role subagents (model + persona + tool filter), exposed to every session through the list_subagents and delegate tools, a /subagent command, and a Settings page.",
5
5
  "keywords": [
6
6
  "deepseek-harness",