dsh-skill-tag 0.1.1 → 0.1.2

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 CHANGED
@@ -37,7 +37,7 @@ office * plugin # 只要 office 包带来的、且是插件相关
37
37
  dsh plugin --profile <your-profile> add dsh-skill-tag
38
38
  ```
39
39
 
40
- 还没发布到 npm 之前,直接用仓库地址装:
40
+ 也可以不走 npm,直接从 GitHub 装:
41
41
 
42
42
  ```bash
43
43
  dsh plugin --profile <your-profile> add github:aawef/dsh-skill-manager-tags
package/lib/client.js CHANGED
@@ -879,6 +879,20 @@ window.__ModuleLoader__.load({
879
879
  /** 菜单注入 ↔ 浮层渲染之间唯一的通信通道(模块级 store) */
880
880
  const manage = { open: false, workspaceId: "", workspaceTitle: "", conversationId: "", sessionTitle: "", listeners: new Set() };
881
881
  function manageSet(patch) {
882
+ // 作用域互斥:workspaceId 与 conversationId 绝不能同时有值。
883
+ // manageScope() 只看 conversationId 是否为空来决定走「工作区版」还是「对话版」,
884
+ // 所以只要残留一个上次打开对话管理时留下的 conversationId,
885
+ // 工作区的「管理标签」就会打开成「管理标签(对话)」。
886
+ // 三个打开入口里,会话行菜单和聊天框「+」都显式清了 workspaceId,
887
+ // 只有 DOM 注入的工作区菜单这一处漏了 —— 于是在这里统一兜住,免得以后再漏。
888
+ if (patch.open === true) {
889
+ if (patch.conversationId) {
890
+ patch.workspaceId = "";
891
+ } else if (patch.workspaceId) {
892
+ patch.conversationId = "";
893
+ patch.sessionTitle = "";
894
+ }
895
+ }
882
896
  Object.assign(manage, patch);
883
897
  for (const fn of [...manage.listeners]) fn();
884
898
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-skill-tag",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "给 DSH 的技能(skill)打标签,用一条布尔表达式在「工作区 / 对话」两级选出要下发给模型的技能子集",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",