dsh-cohub 0.13.15 → 0.13.16

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 (3) hide show
  1. package/README.md +1 -1
  2. package/lib/client.js +25 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-cohub
2
2
 
3
- > 本文对应 **v0.13.15**;完整变更历史见 [CHANGELOG.md](./CHANGELOG.md)。
3
+ > 本文对应 **v0.13.16**;完整变更历史见 [CHANGELOG.md](./CHANGELOG.md)。
4
4
 
5
5
  DeepSeek Harness 版(对照 [OpenCode 版](../oh-my-opencode-cohub/)):中文智能体编排插件。
6
6
  把「纯调度模式 + 内置技能(代理编排体系 + co-cordis 组合创作 + 写作组)+ 多模型共识 + 运行期调度韧性」移植到 DSH 原生能力之上。
package/lib/client.js CHANGED
@@ -1841,6 +1841,8 @@ window.__ModuleLoader__.load({
1841
1841
  expandedTeam: -1,
1842
1842
  // 角色详情面板(提示词 + 绑定工具)展开的是哪个角色名;"" = 全收起。
1843
1843
  expandedRole: "",
1844
+ // 设置页 tab 选中态("teams" | "roles"):只活在 controller 闭包里,不写配置。
1845
+ tab: "teams",
1844
1846
  // 默认预设(remote.agentPresets.list 里 isDefault=true 的那一项);取不到时 null。
1845
1847
  presetStatus: "loading",
1846
1848
  presetDefault: null
@@ -1877,6 +1879,19 @@ window.__ModuleLoader__.load({
1877
1879
  var lastActiveTeam = "";
1878
1880
  var published = null;
1879
1881
 
1882
+ // 设置页 tab 选中态:和草稿一样只活在 controller 闭包里,靠既有的 store 通知通道
1883
+ // 触发重渲染。不放进 React 组件状态——宿主可能以直接函数调用方式渲染组件,
1884
+ // 组件体内的任何 hook 都会抛 Invalid hook call,进而让整个设置节注册失败。
1885
+ var tab = "teams";
1886
+
1887
+ /** 切换设置页 tab:先归一(脏值回落 teams),变了才写闭包态并发布一次。 */
1888
+ function setTab(next) {
1889
+ var normalized = normalizeTab(next);
1890
+ if (normalized === tab) return;
1891
+ tab = normalized;
1892
+ publish();
1893
+ }
1894
+
1880
1895
  // 自定义角色草稿与 skills 草稿各自独立(写的是不同 path),但共用同一 scope、
1881
1896
  // 同一 revision 冲突判定和同一个 saving 互斥位。roleErrors 与行等长,空串 = 合法。
1882
1897
  var rolesDraft = null; // { rows, revision }
@@ -2072,6 +2087,7 @@ window.__ModuleLoader__.load({
2072
2087
  teamsNotice: teamsNotice,
2073
2088
  expandedTeam: expandedTeam,
2074
2089
  expandedRole: expandedRole,
2090
+ tab: tab,
2075
2091
  presetStatus: presetStatus,
2076
2092
  presetDefault: presetDefault
2077
2093
  };
@@ -2108,6 +2124,7 @@ window.__ModuleLoader__.load({
2108
2124
  && left.teamsNotice === right.teamsNotice
2109
2125
  && left.expandedTeam === right.expandedTeam
2110
2126
  && left.expandedRole === right.expandedRole
2127
+ && left.tab === right.tab
2111
2128
  && left.presetStatus === right.presetStatus
2112
2129
  && left.presetDefault === right.presetDefault;
2113
2130
  }
@@ -3062,7 +3079,8 @@ window.__ModuleLoader__.load({
3062
3079
  copyBuiltinTeam: copyBuiltinTeam,
3063
3080
  removeTeam: removeTeam,
3064
3081
  discardTeams: discardTeams,
3065
- saveTeams: saveTeams
3082
+ saveTeams: saveTeams,
3083
+ setTab: setTab
3066
3084
  };
3067
3085
  }
3068
3086
 
@@ -3211,16 +3229,10 @@ window.__ModuleLoader__.load({
3211
3229
  var useSkills = typeof props.useCohubSkills === "function" ? props.useCohubSkills : useStaticState;
3212
3230
  var state = useSkills(selectAllSnapshot) || EMPTY_STATE;
3213
3231
 
3214
- // tab 选中态只活在组件里(不写配置)。切换 tab 只是换渲染分支:
3232
+ // tab 选中态在 controller 闭包里(不写配置、不是 hook)。切换 tab 只是换渲染分支:
3215
3233
  // 团队草稿 / 角色草稿 / 模型草稿都在 controller 闭包里,所以切回来未保存的编辑还在。
3216
- var tabHook = typeof React.useState === "function" ? React.useState("teams") : null;
3217
- var activeTab = normalizeTab(tabHook !== null ? tabHook[0] : "teams");
3218
- var setTab = function (next) {
3219
- var normalized = normalizeTab(next);
3220
- if (tabHook !== null && typeof tabHook[1] === "function" && normalized !== activeTab) {
3221
- tabHook[1](normalized);
3222
- }
3223
- };
3234
+ var activeTab = normalizeTab(state.tab);
3235
+ var setTab = props.setTab;
3224
3236
 
3225
3237
  var header = [
3226
3238
  React.createElement("h2", { key: "title", className: "cohub-title" }, t("title")),
@@ -4479,6 +4491,9 @@ window.__ModuleLoader__.load({
4479
4491
  },
4480
4492
  saveTeams: function () {
4481
4493
  return controller.saveTeams();
4494
+ },
4495
+ setTab: function (next) {
4496
+ controller.setTab(next);
4482
4497
  }
4483
4498
  };
4484
4499
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cohub",
3
- "version": "0.13.15",
3
+ "version": "0.13.16",
4
4
  "description": "DeepSeek Harness 版 CoHub:中文智能体编排——用户可选 2 种工作模式(co-orchestrator 纯调度 / cohub-cordis 创造模式)+ 13 个专职代理技能 + 多模型共识;另由 cohub-subagent-readonly / cohub-subagent-write 两个支撑 preset 实现子代理读写硬隔离(共 4 个 preset)",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",