@michengai/dsh-agency-agents 0.1.39 → 0.1.41

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 CHANGED
@@ -4,6 +4,14 @@
4
4
 
5
5
  The five most recent published versions are listed below.
6
6
 
7
+ ## 0.1.41 - 2026-09-12
8
+
9
+ - Fix navigation from the chat Experts button to Settings → Experts when all experts are disabled, supporting both native DSH dialogs and Codex UI settings pages.
10
+
11
+ ## 0.1.40 - 2026-09-11
12
+
13
+ - Fix the Experts plugin moving the attachment button to the end of the toolbar, preserving the original host button order.
14
+
7
15
  ## 0.1.39 - 2026-09-11
8
16
 
9
17
  - Add compatibility with DSH `0.1.5-rc.2` while retaining support for previously supported RC versions.
@@ -4,6 +4,14 @@
4
4
 
5
5
  以下记录最近发布的五个版本。
6
6
 
7
+ ## 0.1.41 - 2026-09-12
8
+
9
+ - 修复全部专家禁用时,聊天输入栏的「专家」按钮无法跳转到「设置 → 专家」的问题,兼容原生 DSH 设置弹窗和 Codex UI 设置页。
10
+
11
+ ## 0.1.40 - 2026-09-11
12
+
13
+ - 修复专家插件将附件按钮移到工具栏末尾的问题,保留宿主按钮的原有顺序。
14
+
7
15
  ## 0.1.39 - 2026-09-11
8
16
 
9
17
  - 新增对 DSH `0.1.5-rc.2` 的兼容支持,保留已支持的旧 RC 版本。
package/lib/client.js CHANGED
@@ -8723,7 +8723,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8723
8723
  const MENU_NAME_OVERRIDE = DIVISION_ORDER.map((division) => inputTriggerSourceId(division)).map((name) => `[role="listbox"] div[data-source=${JSON.stringify(name)}] ~ button`).map((selector) => `${selector} span:last-child`).join(",");
8724
8724
  /** Windows 优先使用彩色 emoji 字体,名称中的普通文字由后续字体安全回退。 */
8725
8725
  const EXPERT_MENU_NAME_STYLE = "flex:1 1 auto;max-width:none;min-width:0;font-family:\"Segoe UI Emoji\",\"Apple Color Emoji\",\"Noto Color Emoji\",sans-serif!important;font-variant-emoji:emoji!important";
8726
- const COMPOSER_CSS = ".aag-btn-wrap{position:relative;order:1;display:inline-flex;flex:0 0 auto}.aag-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:28px;padding:0 8px;white-space:nowrap;border:none;border-radius:24px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px;font-weight:500;cursor:pointer}.aag-btn:hover,.aag-btn[aria-expanded=\"true\"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.aag-btn:focus-visible{outline:2px solid #92b2ff;outline-offset:2px}.aag-btn>svg{flex:none}.aag-menu{position:absolute;bottom:calc(100% + 4px);left:0;box-sizing:border-box;padding:4px;display:flex;flex-direction:column;gap:0;width:300px;max-width:360px;max-height:calc(100dvh - 24px);overflow-y:auto;border:1px solid var(--dsw-alias-border-inverted);border-radius:12px;background:var(--dsw-specific-menu);box-shadow:var(--dsw-shadow-lv3);z-index:10000}.aag-menu[data-placement=\"below\"]{top:calc(100% + 4px);bottom:auto}.aag-menu-title{padding:8px 10px;font-size:12px;line-height:16px;color:var(--dsw-alias-label-tertiary)}.aag-menu-item{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:8px 10px;border:none;border-radius:10px;background:transparent;cursor:pointer;text-align:left;font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary);box-sizing:border-box}.aag-menu-item:hover{background:var(--dsw-alias-interactive-bg-hover)}.aag-emoji{flex:0 0 auto;font-size:16px}.aag-menu-empty{padding:8px 10px;color:var(--dsw-alias-label-secondary);font-size:13px}[data-composer-card] :has(> button[aria-haspopup=\"listbox\"]) > :nth-child(2){order:2}";
8726
+ const COMPOSER_CSS = ".aag-btn-wrap{position:relative;order:1;display:inline-flex;flex:0 0 auto}.aag-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:28px;padding:0 8px;white-space:nowrap;border:none;border-radius:24px;background:transparent;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px;font-weight:500;cursor:pointer}.aag-btn:hover,.aag-btn[aria-expanded=\"true\"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.aag-btn:focus-visible{outline:2px solid #92b2ff;outline-offset:2px}.aag-btn>svg{flex:none}.aag-menu{position:absolute;bottom:calc(100% + 4px);left:0;box-sizing:border-box;padding:4px;display:flex;flex-direction:column;gap:0;width:300px;max-width:360px;max-height:calc(100dvh - 24px);overflow-y:auto;border:1px solid var(--dsw-alias-border-inverted);border-radius:12px;background:var(--dsw-specific-menu);box-shadow:var(--dsw-shadow-lv3);z-index:10000}.aag-menu[data-placement=\"below\"]{top:calc(100% + 4px);bottom:auto}.aag-menu-title{padding:8px 10px;font-size:12px;line-height:16px;color:var(--dsw-alias-label-tertiary)}.aag-menu-item{display:flex;align-items:center;gap:8px;width:100%;min-height:40px;padding:8px 10px;border:none;border-radius:10px;background:transparent;cursor:pointer;text-align:left;font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary);box-sizing:border-box}.aag-menu-item:hover{background:var(--dsw-alias-interactive-bg-hover)}.aag-emoji{flex:0 0 auto;font-size:16px}.aag-menu-empty{padding:8px 10px;color:var(--dsw-alias-label-secondary);font-size:13px}";
8727
8727
  const SETTINGS_CSS = `
8728
8728
  .aag-section{box-sizing:border-box;display:flex;min-width:0;max-width:760px;width:100%;margin:0 auto;flex-direction:column;gap:16px;padding:0 0 32px;color:var(--dsw-alias-label-primary)}
8729
8729
  .aag-toolbar{display:flex;align-items:flex-start;gap:16px;padding-bottom:12px}
@@ -8988,7 +8988,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8988
8988
  return pickHostSettingsTrigger(collectSettingsTriggerCandidates(root))?.button;
8989
8989
  }
8990
8990
  function findExpertSettingsNavButton(root, navLabel) {
8991
- for (const dialog of root.querySelectorAll("[role=\"dialog\"]")) for (const button of dialog.querySelectorAll("nav button")) if (button instanceof HTMLElement && (button.textContent ?? "").trim() === navLabel) return button;
8991
+ for (const dialog of root.querySelectorAll("[data-dcu-settings-page], [role=\"dialog\"]")) for (const button of dialog.querySelectorAll("nav button")) if (button instanceof HTMLElement && (button.textContent ?? "").trim() === navLabel) return button;
8992
8992
  }
8993
8993
  function queueSettingsNav(work) {
8994
8994
  if (typeof requestAnimationFrame === "function") {
@@ -9008,9 +9008,42 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9008
9008
  }
9009
9009
  const trigger = findHostSettingsTrigger(root);
9010
9010
  if (trigger === void 0) return false;
9011
+ if (trigger.hasAttribute("data-dcu-settings-trigger")) {
9012
+ const request = new CustomEvent("dcu-settings-open-section", {
9013
+ detail: { labels: [navLabel] },
9014
+ cancelable: true
9015
+ });
9016
+ if (!trigger.dispatchEvent(request)) return true;
9017
+ }
9018
+ let finished = false;
9019
+ const observer = new MutationObserver(() => {
9020
+ select();
9021
+ });
9022
+ const timeout = setTimeout(() => {
9023
+ if (select()) return;
9024
+ cleanup();
9025
+ console.warn(`[agency-agents] 未找到设置分区:${navLabel}`);
9026
+ }, 4e3);
9027
+ const cleanup = () => {
9028
+ finished = true;
9029
+ observer.disconnect();
9030
+ clearTimeout(timeout);
9031
+ };
9032
+ const select = () => {
9033
+ if (finished) return false;
9034
+ const target = findExpertSettingsNavButton(root, navLabel);
9035
+ if (target === void 0) return false;
9036
+ cleanup();
9037
+ target.click();
9038
+ return true;
9039
+ };
9040
+ observer.observe(root, {
9041
+ childList: true,
9042
+ subtree: true
9043
+ });
9011
9044
  trigger.click();
9012
9045
  schedule(() => {
9013
- findExpertSettingsNavButton(root, navLabel)?.click();
9046
+ select();
9014
9047
  });
9015
9048
  return true;
9016
9049
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@michengai/dsh-agency-agents",
3
3
  "description": "Agency Experts — a summonable domain-expert roster for DSH (expert mode)",
4
- "version": "0.1.39",
4
+ "version": "0.1.41",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.22.0",
7
7
  "engines": {