@michengai/dsh-agency-agents 0.1.22 → 0.1.24
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 +15 -15
- package/CHANGELOG.zh-CN.md +15 -15
- package/README.md +0 -1
- package/README.zh-CN.md +0 -1
- package/lib/client.js +63 -21
- package/lib/{i18n-BL3miiHZ.js → i18n-AnXsnJel.js} +31 -6
- package/lib/index.js +2 -3
- package/lib/remote.js +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
The five most recent published versions are listed below.
|
|
6
6
|
|
|
7
|
+
## 0.1.24 — 2026-09-01
|
|
8
|
+
|
|
9
|
+
- Fixed raw keys such as `division.design` and `division.engineering` appearing as group titles in the Chinese `@` expert menu.
|
|
10
|
+
- Fixed expert emoji icons taking up space without rendering on Windows by applying a color-emoji font stack to expert menu items.
|
|
11
|
+
- Group titles now follow the active interface language and refresh after locale changes; added coverage for Chinese, English, and unknown-division fallback behavior.
|
|
12
|
+
|
|
13
|
+
Published package: [`@michengai/dsh-agency-agents@0.1.24`](https://www.npmjs.com/package/@michengai/dsh-agency-agents/v/0.1.24).
|
|
14
|
+
|
|
15
|
+
## 0.1.23 — 2026-08-31
|
|
16
|
+
|
|
17
|
+
- Added a compatibility adapter for the DSH settings API so the plugin works with both the legacy RC runtime and `@deepseek-ai/dsh@0.1.2-alpha.2`.
|
|
18
|
+
- Added regression coverage for both settings API shapes and rebuilt the published bundles.
|
|
19
|
+
|
|
20
|
+
Published package: [`@michengai/dsh-agency-agents@0.1.23`](https://www.npmjs.com/package/@michengai/dsh-agency-agents/v/0.1.23).
|
|
21
|
+
|
|
7
22
|
## 0.1.22 — 2026-08-28
|
|
8
23
|
|
|
9
24
|
- Added the Changelog link to the standard README header navigation, between the language switch and the Apache-2.0 license link.
|
|
@@ -24,18 +39,3 @@ Published package: [`@michengai/dsh-agency-agents@0.1.21`](https://www.npmjs.com
|
|
|
24
39
|
- Refreshed the README with final product artwork.
|
|
25
40
|
|
|
26
41
|
Release tag: [`v0.1.20`](https://github.com/MichengAI/dsh-agency-agents/tree/v0.1.20).
|
|
27
|
-
|
|
28
|
-
## 0.1.19 — 2026-08-17
|
|
29
|
-
|
|
30
|
-
- Enforced task limits for single-agent summons.
|
|
31
|
-
- Added validation for expert names before dispatch.
|
|
32
|
-
|
|
33
|
-
Release tag: [`v0.1.19`](https://github.com/MichengAI/dsh-agency-agents/tree/v0.1.19).
|
|
34
|
-
|
|
35
|
-
## 0.1.18 — 2026-08-17
|
|
36
|
-
|
|
37
|
-
- Tightened plugin dependency declarations and tracked the final README assets.
|
|
38
|
-
- Added one-line agent installation prompts for npm and source installs.
|
|
39
|
-
- Refined the repository banner for stable GitHub rendering.
|
|
40
|
-
|
|
41
|
-
Release tag: [`v0.1.18`](https://github.com/MichengAI/dsh-agency-agents/tree/v0.1.18).
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
以下记录最近发布的五个版本。
|
|
6
6
|
|
|
7
|
+
## 0.1.24 — 2026-09-01
|
|
8
|
+
|
|
9
|
+
- 修复中文界面中 `@` 专家菜单分组标题显示 `division.design`、`division.engineering` 等原始英文键的问题。
|
|
10
|
+
- 修复 Windows 下专家 emoji 图标只占位但不可见的问题,为专家菜单定向补充彩色 emoji 字体栈。
|
|
11
|
+
- 分组标题现在跟随界面语言显示,并在语言切换后自动刷新;新增中英文与未知分区回退测试。
|
|
12
|
+
|
|
13
|
+
发布包:[`@michengai/dsh-agency-agents@0.1.24`](https://www.npmjs.com/package/@michengai/dsh-agency-agents/v/0.1.24)。
|
|
14
|
+
|
|
15
|
+
## 0.1.23 — 2026-08-31
|
|
16
|
+
|
|
17
|
+
- 新增 DSH 设置 API 兼容适配层,同时兼容旧 RC 运行时与 `@deepseek-ai/dsh@0.1.2-alpha.2`。
|
|
18
|
+
- 新增两种设置 API 形态的回归测试,并重新构建发布产物。
|
|
19
|
+
|
|
20
|
+
发布包:[`@michengai/dsh-agency-agents@0.1.23`](https://www.npmjs.com/package/@michengai/dsh-agency-agents/v/0.1.23)。
|
|
21
|
+
|
|
7
22
|
## 0.1.22 — 2026-08-28
|
|
8
23
|
|
|
9
24
|
- 在 README 标准头部导航中加入更新日志入口,位置位于语言切换与 Apache-2.0 许可证链接之间。
|
|
@@ -24,18 +39,3 @@
|
|
|
24
39
|
- 使用最终产品视觉更新 README。
|
|
25
40
|
|
|
26
41
|
发布标签:[`v0.1.20`](https://github.com/MichengAI/dsh-agency-agents/tree/v0.1.20)。
|
|
27
|
-
|
|
28
|
-
## 0.1.19 — 2026-08-17
|
|
29
|
-
|
|
30
|
-
- 对单专家召唤强制执行任务数量限制。
|
|
31
|
-
- 调度前增加专家名称校验。
|
|
32
|
-
|
|
33
|
-
发布标签:[`v0.1.19`](https://github.com/MichengAI/dsh-agency-agents/tree/v0.1.19)。
|
|
34
|
-
|
|
35
|
-
## 0.1.18 — 2026-08-17
|
|
36
|
-
|
|
37
|
-
- 收紧插件依赖声明并纳入最终 README 素材。
|
|
38
|
-
- 增加 npm 与源码安装的一句话 Agent 提示词。
|
|
39
|
-
- 优化仓库横幅,保证 GitHub 稳定渲染。
|
|
40
|
-
|
|
41
|
-
发布标签:[`v0.1.18`](https://github.com/MichengAI/dsh-agency-agents/tree/v0.1.18)。
|
package/README.md
CHANGED
|
@@ -52,7 +52,6 @@ This product can be installed independently or used through the desktop app or W
|
|
|
52
52
|
| --- | --- |
|
|
53
53
|
| [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) | The host runtime that provides models, sessions, tools, and the plugin system |
|
|
54
54
|
| [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop) | A ready-to-install desktop product with this product and the other five feature products built in |
|
|
55
|
-
| [DSH Codex Suite](https://github.com/MichengAI/dsh-codex-ui/tree/main/packages/dsh-codex-suite) | A one-click suite for existing DSH Web environments that installs this product and the other five feature products |
|
|
56
55
|
| Six feature products | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) · [IM Connect](https://github.com/MichengAI/dsh-im-connect) · [Automation](https://github.com/MichengAI/dsh-automation) · [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) · [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) · [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) |
|
|
57
56
|
|
|
58
57
|
## Prerequisites
|
package/README.zh-CN.md
CHANGED
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
| --- | --- |
|
|
53
53
|
| [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) | 本产品的运行宿主,提供模型、会话、工具和插件系统 |
|
|
54
54
|
| [DSH Codex Desktop](https://github.com/MichengAI/dsh-codex-desktop) | 下载安装即用的桌面产品,已内置本产品和其他 5 个功能产品 |
|
|
55
|
-
| [DSH Codex Suite](https://github.com/MichengAI/dsh-codex-ui/tree/main/packages/dsh-codex-suite) | 面向已有 DSH Web 环境的一键套件,会安装本产品和其他 5 个功能产品 |
|
|
56
55
|
| 6 个功能产品 | [Codex UI](https://github.com/MichengAI/dsh-codex-ui) · [IM Connect](https://github.com/MichengAI/dsh-im-connect) · [Automation](https://github.com/MichengAI/dsh-automation) · [Skills Manager](https://github.com/MichengAI/dsh-skills-manager) · [Archive Manager](https://github.com/MichengAI/dsh-archive-manager) · [Agency Agents](https://github.com/MichengAI/dsh-agency-agents) |
|
|
57
56
|
|
|
58
57
|
## 前置条件
|
package/lib/client.js
CHANGED
|
@@ -6717,11 +6717,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6717
6717
|
function displayName(e, active) {
|
|
6718
6718
|
return active === "en" ? e.nameEn : e.name;
|
|
6719
6719
|
}
|
|
6720
|
+
/** 按当前 locale 取 @ 菜单分组标题;未知分区保留原值,便于扩展来源安全降级。 */
|
|
6721
|
+
function inputTriggerSourceName(division, active) {
|
|
6722
|
+
return (active === "en" ? EN_DIVISION : ZH_DIVISION)[division] ?? division;
|
|
6723
|
+
}
|
|
6720
6724
|
/** 按当前 locale 取专家简介:en 用原始英文描述(缺失时回退中文),其余用中文描述。 */
|
|
6721
6725
|
function displayDescription(e, active) {
|
|
6722
6726
|
return active === "en" && e.descriptionEn !== "" ? e.descriptionEn : e.description;
|
|
6723
6727
|
}
|
|
6724
|
-
const
|
|
6728
|
+
const EXPERT_MENU_ITEM_SELECTORS = [...new Set(DIVISION_ORDER.flatMap((division) => [inputTriggerSourceName(division, "zh"), inputTriggerSourceName(division, "en")]))].map((name) => `[role="listbox"] div[data-source=${JSON.stringify(name)}] ~ button`);
|
|
6729
|
+
const MENU_NAME_OVERRIDE = EXPERT_MENU_ITEM_SELECTORS.map((selector) => `${selector} span:last-child`).join(",");
|
|
6730
|
+
/** Windows 优先使用彩色 emoji 字体,避免宿主字体栈让专家图标只占位不显示。 */
|
|
6731
|
+
const EXPERT_EMOJI_FONT_FAMILY = "\"Segoe UI Emoji\",\"Apple Color Emoji\",\"Noto Color Emoji\",sans-serif";
|
|
6732
|
+
const MENU_ICON_OVERRIDE = EXPERT_MENU_ITEM_SELECTORS.map((selector) => `${selector} span:first-child:not(:last-child)`).join(",");
|
|
6733
|
+
const CSS = ".aag-btn-wrap{position:relative;order:1;margin-right:-8px}.aag-btn{display:inline-flex;align-items:center;gap:4px;height:28px;padding:0 4px 0 8px;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{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.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(100vh - 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-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}\n.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)}\n.aag-toolbar{display:flex;align-items:flex-start;gap:16px;padding-bottom:12px}\n.aag-title{margin:0;font-size:20px;line-height:28px;font-weight:650;letter-spacing:-.2px}\n.aag-desc{margin:4px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}\n.aag-actions{display:flex;align-items:center;gap:8px;margin-left:auto}\n.aag-action{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:0 12px;border:1px solid transparent;border-radius:8px;background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);font:inherit;font-size:13px;font-weight:550;cursor:pointer;transition:opacity 180ms ease,background 180ms ease,border-color 180ms ease}\n.aag-action:hover:not(:disabled){opacity:.9}.aag-action:disabled{opacity:.5;cursor:default}\n.aag-action-secondary{background:transparent;border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary)}\n.aag-action:focus-visible{outline:2px solid var(--dsw-alias-state-success-primary);outline-offset:2px}\n.aag-summary{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2)}\n.aag-summary-count{font-size:18px;font-weight:650}.aag-summary-label{color:var(--dsw-alias-label-secondary);font-size:12px}.aag-summary-separator{width:1px;height:24px;background:var(--dsw-alias-border-l2)}\n.aag-group{display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}\n.aag-group-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--dsw-alias-border-l1)}\n.aag-group-title{margin:0;font-size:14px;font-weight:600}.aag-count{color:var(--dsw-alias-label-tertiary);font-size:12px}\n.aag-row{display:flex;align-items:center;gap:12px;padding:13px 16px;border-bottom:1px solid var(--dsw-alias-border-l1)}\n.aag-row:last-child{border-bottom:0}\n.aag-row-main{display:flex;min-width:0;flex:1;flex-direction:column;gap:3px}\n.aag-row-id{display:flex;align-items:center;gap:7px;min-width:0}\n.aag-row-name{overflow:hidden;font-size:13px;font-weight:500;line-height:20px;text-overflow:ellipsis;white-space:nowrap}\n.aag-tag{flex:none;padding:1px 6px;border:1px solid var(--dsw-alias-border-l3);border-radius:4px;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:16px}\n.aag-tag-on{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}\n.aag-tag-off{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}\n.aag-note{overflow:hidden;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;text-overflow:ellipsis;white-space:nowrap}\n.aag-error{color:var(--dsw-alias-state-error-primary);font-size:13px;line-height:20px}\n.aag-filters{display:flex;align-items:flex-end;gap:10px}\n.aag-field{display:flex;min-width:0;flex:1;flex-direction:column;gap:6px}\n.aag-field-category{flex:0 1 220px}\n.aag-field-search{flex:1 1 240px}\n.aag-label{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px}\n.aag-control{box-sizing:border-box;width:100%;min-height:32px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}\n.aag-control:focus-visible{outline:2px solid var(--dsw-alias-state-success-primary);outline-offset:2px}\n.aag-select{position:relative}\n.aag-select-trigger{box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:32px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;text-align:left;cursor:pointer}\n.aag-select-trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.aag-select-trigger:focus-visible{outline:2px solid var(--dsw-alias-state-success-primary);outline-offset:2px}\n.aag-select-trigger[aria-expanded=\"true\"]{border-color:var(--dsw-alias-state-success-primary)}\n.aag-select-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.aag-select-caret{flex:none;width:12px;height:12px;color:var(--dsw-alias-label-tertiary)}\n.aag-select-menu{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:30;box-sizing:border-box;max-height:280px;overflow:auto;padding:4px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-specific-menu,var(--dsw-alias-bg-layer-2));box-shadow:var(--dsw-shadow-lv3)}\n.aag-select-option{box-sizing:border-box;display:flex;align-items:center;width:100%;min-height:32px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;text-align:left;cursor:pointer}\n.aag-select-option:hover,.aag-select-option[data-active=\"true\"]{background:var(--dsw-alias-interactive-bg-hover)}\n.aag-select-option[aria-selected=\"true\"]{color:var(--dsw-alias-state-success-primary)}\n.aag-search-wrap{position:relative;display:flex;align-items:center}\n.aag-search{padding-right:32px}.aag-search::-webkit-search-cancel-button,.aag-search::-webkit-search-decoration{-webkit-appearance:none;appearance:none}\n.aag-search-clear{position:absolute;right:4px;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:16px;line-height:1;cursor:pointer}\n.aag-search-clear:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}\n.aag-search-clear:focus-visible{outline:2px solid var(--dsw-alias-state-success-primary);outline-offset:2px}\n.aag-empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:28px 16px;border:1px dashed var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px;text-align:center}\n.aag-filter-meta{margin-left:auto;color:var(--dsw-alias-label-tertiary);font-size:12px}\n@media (max-width:560px){.aag-toolbar{flex-wrap:wrap}.aag-actions{margin-left:0}.aag-filters{flex-direction:column;align-items:stretch}.aag-field-category,.aag-field-search{flex:none}.aag-row{align-items:flex-start;flex-wrap:wrap}.aag-row>.aag-action{margin-left:auto}.aag-filter-meta{margin-left:0}}\n@media (prefers-reduced-motion:reduce){.aag-action{transition:none}}\n" + MENU_NAME_OVERRIDE + "{flex:1 1 auto;max-width:none;min-width:0}" + MENU_ICON_OVERRIDE + `{font-family:${EXPERT_EMOJI_FONT_FAMILY};font-size:16px;line-height:1;font-variant-emoji:emoji}`;
|
|
6725
6734
|
/** 将写失败映射到 agency 词条;非冲突错误返回 null,由调用方展示原始消息。 */
|
|
6726
6735
|
function writeErrorKey(error, options) {
|
|
6727
6736
|
if (error instanceof Error && error.message.includes("changed since it was read")) {
|
|
@@ -7197,38 +7206,71 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7197
7206
|
remote,
|
|
7198
7207
|
getActive
|
|
7199
7208
|
})));
|
|
7200
|
-
|
|
7201
|
-
const
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7209
|
+
const registerInputTriggerSources = (active) => {
|
|
7210
|
+
const disposers = [];
|
|
7211
|
+
try {
|
|
7212
|
+
for (const [i, div] of DIVISION_ORDER.entries()) {
|
|
7213
|
+
const source = {
|
|
7214
|
+
trigger: "@",
|
|
7215
|
+
name: inputTriggerSourceName(div, active),
|
|
7216
|
+
order: 100 + i,
|
|
7217
|
+
candidates: async (_session, req) => {
|
|
7218
|
+
const enabled = await readEnabled(remote).then((state) => state.enabled).catch(() => /* @__PURE__ */ new Set());
|
|
7219
|
+
const q = String(req.query ?? "").toLowerCase();
|
|
7220
|
+
return EXPERTS.filter((e) => e.division === div && enabled.has(e.slug) && (q === "" || e.name.toLowerCase().includes(q) || e.nameEn.toLowerCase().includes(q) || e.slug.includes(q))).map((e) => ({
|
|
7221
|
+
name: displayName(e, ctx.locale.getSnapshot().active),
|
|
7222
|
+
icon: e.emoji,
|
|
7223
|
+
hint: e.slug
|
|
7224
|
+
}));
|
|
7225
|
+
},
|
|
7226
|
+
onPick: (pick) => ({ text: t("summon.instruction", {
|
|
7227
|
+
name: pick.candidate.name,
|
|
7228
|
+
slug: pick.candidate.hint ?? ""
|
|
7229
|
+
}) })
|
|
7230
|
+
};
|
|
7231
|
+
disposers.push(ctx.inputTriggers.registerSource(source));
|
|
7232
|
+
}
|
|
7233
|
+
} catch (error) {
|
|
7234
|
+
for (const dispose of disposers.reverse()) dispose();
|
|
7235
|
+
throw error;
|
|
7236
|
+
}
|
|
7237
|
+
return () => {
|
|
7238
|
+
for (const dispose of disposers.reverse()) dispose();
|
|
7218
7239
|
};
|
|
7219
|
-
|
|
7220
|
-
|
|
7240
|
+
};
|
|
7241
|
+
ctx.effect(() => {
|
|
7242
|
+
let active = getActive();
|
|
7243
|
+
let disposeSources = registerInputTriggerSources(active);
|
|
7244
|
+
const unsubscribe = ctx.locale.subscribe(() => {
|
|
7245
|
+
const next = getActive();
|
|
7246
|
+
if (next === active) return;
|
|
7247
|
+
disposeSources();
|
|
7248
|
+
try {
|
|
7249
|
+
disposeSources = registerInputTriggerSources(next);
|
|
7250
|
+
active = next;
|
|
7251
|
+
} catch (error) {
|
|
7252
|
+
disposeSources = registerInputTriggerSources(active);
|
|
7253
|
+
console.error("[agency-agents] @ 菜单分组语言切换失败,已恢复原语言来源:", error);
|
|
7254
|
+
}
|
|
7255
|
+
});
|
|
7256
|
+
return () => {
|
|
7257
|
+
unsubscribe();
|
|
7258
|
+
disposeSources();
|
|
7259
|
+
};
|
|
7260
|
+
}, "agency-agents: @ menu sources");
|
|
7221
7261
|
return () => {
|
|
7222
7262
|
disposeRemote();
|
|
7223
7263
|
};
|
|
7224
7264
|
}
|
|
7225
7265
|
//#endregion
|
|
7266
|
+
exports.EXPERT_EMOJI_FONT_FAMILY = EXPERT_EMOJI_FONT_FAMILY;
|
|
7226
7267
|
exports.apply = apply;
|
|
7227
7268
|
exports.applyExpertSummon = applyExpertSummon;
|
|
7228
7269
|
exports.buildSummonInstruction = buildSummonInstruction;
|
|
7229
7270
|
exports.compareExpertName = compareExpertName;
|
|
7230
7271
|
exports.filterExperts = filterExperts;
|
|
7231
7272
|
exports.inject = inject;
|
|
7273
|
+
exports.inputTriggerSourceName = inputTriggerSourceName;
|
|
7232
7274
|
exports.matchExpertQuery = matchExpertQuery;
|
|
7233
7275
|
exports.normalizeExpertQuery = normalizeExpertQuery;
|
|
7234
7276
|
exports.writeErrorKey = writeErrorKey;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as dshSettings from "@deepseek-ai/dsh-settings";
|
|
2
2
|
//#region src/names.ts
|
|
3
3
|
/** 分区目录名 → 中文分区名。 */
|
|
4
4
|
const ZH_DIVISION = {
|
|
@@ -315,11 +315,36 @@ const ZH_NAME = {
|
|
|
315
315
|
"backend-architect-with-memory": "资深后端架构师"
|
|
316
316
|
};
|
|
317
317
|
//#endregion
|
|
318
|
-
//#region src/
|
|
318
|
+
//#region src/settings-compat.ts
|
|
319
|
+
function moduleExport(module, name) {
|
|
320
|
+
return module[name];
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* DSH 0.1.2-alpha.2 accepts validated plain namespace strings and removed the
|
|
324
|
+
* legacy settingsNamespace export. Keep one runtime bridge so the same package
|
|
325
|
+
* can still run on the current RC line.
|
|
326
|
+
*/
|
|
327
|
+
function settingsNamespaceCompat(value, module = dshSettings) {
|
|
328
|
+
const legacy = moduleExport(module, "settingsNamespace");
|
|
329
|
+
return typeof legacy === "function" ? legacy(value) : value;
|
|
330
|
+
}
|
|
319
331
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
332
|
+
* RC releases expose installSettingsSection as a module helper. Alpha.2 moved
|
|
333
|
+
* the same owner-scoped lifecycle wiring onto ctx.settings.installSection.
|
|
322
334
|
*/
|
|
335
|
+
function installSettingsSectionCompat(ctx, namespace, schema, entry, hooks, module = dshSettings) {
|
|
336
|
+
const legacy = moduleExport(module, "installSettingsSection");
|
|
337
|
+
if (typeof legacy === "function") {
|
|
338
|
+
legacy(ctx, namespace, schema, entry, hooks);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const settings = ctx.settings;
|
|
342
|
+
if (settings === void 0 || typeof settings.installSection !== "function") throw new Error("当前 DSH settings 服务不支持 installSection。");
|
|
343
|
+
settings.installSection(ctx, namespace, schema, entry, hooks);
|
|
344
|
+
}
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/i18n.ts
|
|
347
|
+
const LOCALE_SETTINGS_NAMESPACE = settingsNamespaceCompat("locale");
|
|
323
348
|
/** 简体中文宿主文案(key 集真相源)。 */
|
|
324
349
|
const zhHost = {
|
|
325
350
|
"error.rootMissing": "智能体目录 root 不存在或无法访问:\"{root}\"。请设置环境变量 {env} 或提供正确路径。",
|
|
@@ -399,7 +424,7 @@ function formatHost(locale, key, params) {
|
|
|
399
424
|
/** 从宿主 settings 的 locale.preference 读取语言,缺失或异常时回退 zh。 */
|
|
400
425
|
function readHostLocale(ctx) {
|
|
401
426
|
try {
|
|
402
|
-
const section = ctx.settings?.get?.(
|
|
427
|
+
const section = ctx.settings?.get?.(LOCALE_SETTINGS_NAMESPACE);
|
|
403
428
|
return resolveHostLocale(section?.preference);
|
|
404
429
|
} catch {
|
|
405
430
|
return "zh";
|
|
@@ -460,4 +485,4 @@ function renderSummonResults(locale, results) {
|
|
|
460
485
|
}).join("\n\n");
|
|
461
486
|
}
|
|
462
487
|
//#endregion
|
|
463
|
-
export { readHostLocale as a,
|
|
488
|
+
export { readHostLocale as a, installSettingsSectionCompat as c, ZH_NAME as d, matchDivision as i, settingsNamespaceCompat as l, localizedExpertDescription as n, renderExpertList as o, localizedExpertName as r, renderSummonResults as s, formatHost as t, ZH_DIVISION as u };
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { a as readHostLocale, c as
|
|
1
|
+
import { a as readHostLocale, c as installSettingsSectionCompat, d as ZH_NAME, i as matchDivision, l as settingsNamespaceCompat, n as localizedExpertDescription, o as renderExpertList, r as localizedExpertName, s as renderSummonResults, t as formatHost, u as ZH_DIVISION } from "./i18n-AnXsnJel.js";
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
4
|
-
import { installSettingsSection, settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
5
4
|
import { readFile, readdir, stat } from "node:fs/promises";
|
|
6
5
|
import { join } from "node:path";
|
|
7
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -255,7 +254,7 @@ function resolveExpert(experts, query, locale = "zh") {
|
|
|
255
254
|
function apply(ctx, config) {
|
|
256
255
|
const maxDepth = normalizeMaxDepth(config.maxDepth);
|
|
257
256
|
let enabledSource = () => [];
|
|
258
|
-
|
|
257
|
+
installSettingsSectionCompat(ctx, settingsNamespaceCompat("agency-agents"), z.object({ enabled: z.array(z.string()) }), { enabled: [] }, {
|
|
259
258
|
setSource: (current) => {
|
|
260
259
|
enabledSource = () => current().enabled;
|
|
261
260
|
},
|
package/lib/remote.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { t as formatHost } from "./i18n-
|
|
2
|
-
import { settingsNamespace } from "@deepseek-ai/dsh-settings";
|
|
1
|
+
import { l as settingsNamespaceCompat, t as formatHost } from "./i18n-AnXsnJel.js";
|
|
3
2
|
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
//#region src/remote-contract.ts
|
|
@@ -94,6 +93,7 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
94
93
|
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
95
94
|
done = true;
|
|
96
95
|
};
|
|
96
|
+
const AGENCY_SETTINGS_NAMESPACE = settingsNamespaceCompat("agency-agents");
|
|
97
97
|
/**
|
|
98
98
|
* Host 严格描述符。Gateway 优先读取它,避免启动期间的 SRC 扫描缓存遗漏
|
|
99
99
|
* 后加载的外部插件服务。
|
|
@@ -156,8 +156,8 @@ let AgencyAgentsRemote = (() => {
|
|
|
156
156
|
}
|
|
157
157
|
/** 读取当前启用的专家 slug 列表。 */
|
|
158
158
|
getEnabled() {
|
|
159
|
-
const enabled = this.ctx.settings.get(
|
|
160
|
-
const descriptor = this.ctx.settings.describe().find((candidate) => candidate.ns ===
|
|
159
|
+
const enabled = this.ctx.settings.get(AGENCY_SETTINGS_NAMESPACE)?.enabled;
|
|
160
|
+
const descriptor = this.ctx.settings.describe().find((candidate) => candidate.ns === AGENCY_SETTINGS_NAMESPACE);
|
|
161
161
|
if (descriptor === void 0) throw new Error(formatHost("zh", "error.settingsMissing"));
|
|
162
162
|
return {
|
|
163
163
|
enabled: Array.isArray(enabled) ? enabled.filter((slug) => typeof slug === "string") : [],
|
|
@@ -166,7 +166,7 @@ let AgencyAgentsRemote = (() => {
|
|
|
166
166
|
}
|
|
167
167
|
/** 整体替换启用的专家 slug 列表。 */
|
|
168
168
|
async setEnabled(enabled, expectedRevision) {
|
|
169
|
-
await this.ctx.settings.mutate(
|
|
169
|
+
await this.ctx.settings.mutate(AGENCY_SETTINGS_NAMESPACE, [{
|
|
170
170
|
op: "set",
|
|
171
171
|
path: ["enabled"],
|
|
172
172
|
value: enabled
|
package/package.json
CHANGED