dsh-cohub 0.13.24 → 0.13.25
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 +1 -1
- package/lib/client.js +243 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dsh-cohub
|
|
2
2
|
|
|
3
|
-
> 本文对应 **v0.13.
|
|
3
|
+
> 本文对应 **v0.13.25**;完整变更历史见 [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
|
@@ -713,6 +713,16 @@ window.__ModuleLoader__.load({
|
|
|
713
713
|
roleDetailBuiltinHint: "内置,只读",
|
|
714
714
|
roleDetailCustomHint: "自定义,只读",
|
|
715
715
|
roleDetailReadOnly: "仅展示:编辑提示词请用角色卡片里的「提示词」字段。",
|
|
716
|
+
roleDetailNameLabel: "角色名",
|
|
717
|
+
roleDetailNoDescription: "(未填写职责)",
|
|
718
|
+
roleDetailModel: "模型",
|
|
719
|
+
roleDetailModelInherit: "继承默认",
|
|
720
|
+
roleRestoreTemplate: "恢复为模板默认",
|
|
721
|
+
roleRestoreTemplateHint: "将按当前模板重新填充字段",
|
|
722
|
+
roleRestoreTemplateNone: "空白角色没有模板可恢复",
|
|
723
|
+
roleDuplicate: "另存为副本",
|
|
724
|
+
roleDuplicateHint: "以当前字段生成一条新的自定义角色(名称加 -copy)。",
|
|
725
|
+
roleGoEdit: "去编辑",
|
|
716
726
|
// ── 内置角色覆盖(Config.roleOverrides)────────────────────────
|
|
717
727
|
roleBuiltinBadge: "内置",
|
|
718
728
|
roleBuiltinOverridden: "已覆盖",
|
|
@@ -729,6 +739,7 @@ window.__ModuleLoader__.load({
|
|
|
729
739
|
roleOverrideTierInvalid: "档位不合法:请选择一个档位。",
|
|
730
740
|
roleOverrideSaved: "覆盖已保存。",
|
|
731
741
|
roleOverrideFailed: "覆盖保存失败,请重试。",
|
|
742
|
+
roleOverrideResetModelNote: "「恢复默认」只还原提示词 / 档位 / 工具,模型配置请在模型区单独恢复默认。",
|
|
732
743
|
// ── 模板新建 / 绑定工具 / 运行模型 ──────────────────────────────
|
|
733
744
|
roleTemplateSection: "选择一个模板开始",
|
|
734
745
|
roleTemplateHint: "选中模板会自动填好名称(加 -copy 后缀防重名)、职责、提示词、档位与绑定工具。",
|
|
@@ -755,6 +766,11 @@ window.__ModuleLoader__.load({
|
|
|
755
766
|
roleModelPickModel: "选择模型",
|
|
756
767
|
roleModelReasoning: "推理强度",
|
|
757
768
|
roleModelReasoningHint: "默认 = 跟随会话设置",
|
|
769
|
+
// 推理强度分段按钮下方的只读生效值(前缀 + 档位名 / 「跟随会话设置」)。
|
|
770
|
+
roleModelEffortNowPrefix: "当前:",
|
|
771
|
+
roleModelEffortInherit: "跟随会话设置",
|
|
772
|
+
roleModelEffortUnknown: "未知({value})",
|
|
773
|
+
roleModelEffortUnsupported: "该模型不支持调整推理强度",
|
|
758
774
|
roleModelMaxOutput: "最大输出",
|
|
759
775
|
roleModelMaxOutputPlaceholder: "例如 4000",
|
|
760
776
|
roleModelReset: "恢复默认",
|
|
@@ -940,6 +956,16 @@ window.__ModuleLoader__.load({
|
|
|
940
956
|
roleDetailBuiltinHint: "built-in, read-only",
|
|
941
957
|
roleDetailCustomHint: "custom, read-only",
|
|
942
958
|
roleDetailReadOnly: "Read-only view — edit the prompt in the role card's \"Prompt\" field.",
|
|
959
|
+
roleDetailNameLabel: "Role name",
|
|
960
|
+
roleDetailNoDescription: "(no responsibility set)",
|
|
961
|
+
roleDetailModel: "Model",
|
|
962
|
+
roleDetailModelInherit: "Inherit default",
|
|
963
|
+
roleRestoreTemplate: "Restore template defaults",
|
|
964
|
+
roleRestoreTemplateHint: "Refills every field from the current template",
|
|
965
|
+
roleRestoreTemplateNone: "A blank role has no template to restore",
|
|
966
|
+
roleDuplicate: "Save as copy",
|
|
967
|
+
roleDuplicateHint: "Creates a new custom role from the current fields (name gets a -copy suffix).",
|
|
968
|
+
roleGoEdit: "Edit role",
|
|
943
969
|
// ── Built-in overrides (Config.roleOverrides) ──────────────────
|
|
944
970
|
roleBuiltinBadge: "Built-in",
|
|
945
971
|
roleBuiltinOverridden: "Overridden",
|
|
@@ -956,6 +982,7 @@ window.__ModuleLoader__.load({
|
|
|
956
982
|
roleOverrideTierInvalid: "Invalid tier — pick one of the listed tiers.",
|
|
957
983
|
roleOverrideSaved: "Override saved.",
|
|
958
984
|
roleOverrideFailed: "Saving the override failed. Please retry.",
|
|
985
|
+
roleOverrideResetModelNote: "\"Restore default\" only restores prompt / tier / tools; reset the model separately in the Model block.",
|
|
959
986
|
roleTemplateSection: "Start from a template",
|
|
960
987
|
roleTemplateHint: "Picking a template fills in the name (-copy suffix avoids collisions), description, prompt, tier and bound tools.",
|
|
961
988
|
roleTemplateBlank: "Blank role",
|
|
@@ -981,6 +1008,10 @@ window.__ModuleLoader__.load({
|
|
|
981
1008
|
roleModelPickModel: "Pick a model",
|
|
982
1009
|
roleModelReasoning: "Reasoning effort",
|
|
983
1010
|
roleModelReasoningHint: "Default follows the session setting",
|
|
1011
|
+
roleModelEffortNowPrefix: "Current: ",
|
|
1012
|
+
roleModelEffortInherit: "Follow the session setting",
|
|
1013
|
+
roleModelEffortUnknown: "Unknown ({value})",
|
|
1014
|
+
roleModelEffortUnsupported: "This model does not support reasoning effort",
|
|
984
1015
|
roleModelMaxOutput: "Max output",
|
|
985
1016
|
roleModelMaxOutputPlaceholder: "e.g. 4000",
|
|
986
1017
|
roleModelReset: "Reset",
|
|
@@ -3073,6 +3104,50 @@ window.__ModuleLoader__.load({
|
|
|
3073
3104
|
publish();
|
|
3074
3105
|
}
|
|
3075
3106
|
|
|
3107
|
+
/**
|
|
3108
|
+
* 「另存为副本」:以当前行字段生成一条新的自定义角色草稿(name 加 -copy 并消歧)。
|
|
3109
|
+
* 只写草稿(保存后随机整表写回 Config.customRoles),模板标记沿用原行的来源。
|
|
3110
|
+
*/
|
|
3111
|
+
function duplicateRole(index) {
|
|
3112
|
+
if (!canEdit()) return;
|
|
3113
|
+
var current = beginRolesDraft();
|
|
3114
|
+
if (index < 0 || index >= current.rows.length) return;
|
|
3115
|
+
var source = current.rows[index];
|
|
3116
|
+
var taken = [];
|
|
3117
|
+
for (var i = 0; i < current.rows.length; i += 1) {
|
|
3118
|
+
if (typeof current.rows[i].name === "string" && current.rows[i].name !== "") taken.push(current.rows[i].name);
|
|
3119
|
+
}
|
|
3120
|
+
for (var b = 0; b < BUILTIN_ROLE_NAMES.length; b += 1) taken.push(BUILTIN_ROLE_NAMES[b]);
|
|
3121
|
+
var copy = copyRole(source);
|
|
3122
|
+
copy.name = templateRoleName(source.name, taken);
|
|
3123
|
+
var next = [];
|
|
3124
|
+
for (var j = 0; j < current.rows.length; j += 1) next.push(copyRole(current.rows[j]));
|
|
3125
|
+
next.push(copy);
|
|
3126
|
+
var marks = [];
|
|
3127
|
+
for (var m = 0; m < roleTemplates.length; m += 1) marks.push(roleTemplates[m]);
|
|
3128
|
+
syncRoleTemplates(next.length);
|
|
3129
|
+
for (var s = 0; s < marks.length; s += 1) roleTemplates[s] = marks[s];
|
|
3130
|
+
roleTemplates[next.length - 1] = index < roleTemplates.length ? roleTemplates[index] : "";
|
|
3131
|
+
rolesDraft.rows = next;
|
|
3132
|
+
roleErrors = roleErrors.length > 0 ? validateRoles(next) : [];
|
|
3133
|
+
rolePicker = -1;
|
|
3134
|
+
rolesSaved = false;
|
|
3135
|
+
rolesFailed = false;
|
|
3136
|
+
publish();
|
|
3137
|
+
}
|
|
3138
|
+
|
|
3139
|
+
/**
|
|
3140
|
+
* 「去编辑」(团队成员详情 → 角色 tab):切到角色 tab、确保该角色详情展开,
|
|
3141
|
+
* 并收起团队编辑区(teamIndex 有效时)。纯 UI 状态,不写配置。
|
|
3142
|
+
*/
|
|
3143
|
+
function focusRoleEditor(name, teamIndex) {
|
|
3144
|
+
var key = typeof name === "string" ? name.trim() : "";
|
|
3145
|
+
if (key !== "") expandedRole = key;
|
|
3146
|
+
if (typeof teamIndex === "number" && expandedTeam === teamIndex) expandedTeam = -1;
|
|
3147
|
+
tab = "roles";
|
|
3148
|
+
publish();
|
|
3149
|
+
}
|
|
3150
|
+
|
|
3076
3151
|
function discardRoles() {
|
|
3077
3152
|
if (saving) return;
|
|
3078
3153
|
rolesDraft = null;
|
|
@@ -3775,6 +3850,8 @@ window.__ModuleLoader__.load({
|
|
|
3775
3850
|
editRole: editRole,
|
|
3776
3851
|
addRole: addRole,
|
|
3777
3852
|
removeRole: removeRole,
|
|
3853
|
+
duplicateRole: duplicateRole,
|
|
3854
|
+
focusRoleEditor: focusRoleEditor,
|
|
3778
3855
|
discardRoles: discardRoles,
|
|
3779
3856
|
saveRoles: saveRoles,
|
|
3780
3857
|
chooseTemplate: chooseTemplate,
|
|
@@ -3920,7 +3997,13 @@ window.__ModuleLoader__.load({
|
|
|
3920
3997
|
".cohub-tool-plugin{margin-left:6px;color:var(--dsw-alias-label-tertiary);}",
|
|
3921
3998
|
".cohub-check-item{display:flex;flex-direction:column;gap:4px;flex:1 1 220px;min-width:0;}",
|
|
3922
3999
|
".cohub-tier-chip{align-self:flex-start;background:transparent;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;padding:0 8px;font:inherit;font-size:11px;line-height:17px;color:var(--dsw-alias-label-tertiary);cursor:pointer;}",
|
|
3923
|
-
".cohub-tier-chip:hover{color:var(--dsw-alias-label-primary);}",
|
|
4000
|
+
".cohub-tier-chip:hover:not(:disabled){color:var(--dsw-alias-label-primary);}",
|
|
4001
|
+
// 选中态必须一眼可辨:主色实底 + 白字(未选中仍是描边),并覆盖 hover 的字色。
|
|
4002
|
+
".cohub-tier-chip:disabled{opacity:.45;cursor:default;}",
|
|
4003
|
+
".cohub-tier-chip.cohub-tier-chip-on{background:var(--dsw-alias-brand-primary,#2f6feb);border-color:var(--dsw-alias-brand-primary,#2f6feb);color:#fff;font-weight:650;}",
|
|
4004
|
+
".cohub-tier-chip.cohub-tier-chip-on:hover:not(:disabled){background:var(--dsw-alias-brand-primary,#2f6feb);border-color:var(--dsw-alias-brand-primary,#2f6feb);color:#fff;}",
|
|
4005
|
+
".cohub-effort-now{margin:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);}",
|
|
4006
|
+
".cohub-effort-now strong{font-weight:650;color:var(--dsw-alias-label-primary);}",
|
|
3924
4007
|
".cohub-tier-dist{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:17px;}",
|
|
3925
4008
|
// ── 角色类型(队长 / 队员 分段按钮)与队长提示词预览(只读 pre) ──
|
|
3926
4009
|
".cohub-kind-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}",
|
|
@@ -4081,6 +4164,26 @@ window.__ModuleLoader__.load({
|
|
|
4081
4164
|
return skillLabel(templateId);
|
|
4082
4165
|
}
|
|
4083
4166
|
|
|
4167
|
+
/**
|
|
4168
|
+
* 推理强度 id → 语义槽(low / medium / high)。
|
|
4169
|
+
* 档位 id 由 adapter 决定(low/medium/high,也可能 minimal/…/max/xhigh),
|
|
4170
|
+
* 归一到槽之后,「当前值 === 按钮」的判定才不会被别名/字段差异弄成永远不等。
|
|
4171
|
+
*/
|
|
4172
|
+
function effortSlotOf(value) {
|
|
4173
|
+
if (value === "minimal" || value === "low") return "low";
|
|
4174
|
+
if (value === "medium") return "medium";
|
|
4175
|
+
if (value === "high" || value === "max" || value === "xhigh") return "high";
|
|
4176
|
+
return "";
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
/** 推理强度档位 → 展示名(空 = 跟随会话设置;未知档位带括号原样显示,不裸甩 id)。 */
|
|
4180
|
+
function effortLabelOf(value) {
|
|
4181
|
+
if (value === "") return t("roleModelEffortInherit");
|
|
4182
|
+
var slot = effortSlotOf(value);
|
|
4183
|
+
if (slot !== "") return t("effort." + slot);
|
|
4184
|
+
return t("roleModelEffortUnknown", { value: value });
|
|
4185
|
+
}
|
|
4186
|
+
|
|
4084
4187
|
/**
|
|
4085
4188
|
* 模型区:供应商(真实目录,取不到只有「继承默认」)→ 模型联动 →
|
|
4086
4189
|
* 推理强度分段按钮(默认/低/中/高 = ""/low/medium/high)→ 最大输出 → 恢复默认。
|
|
@@ -4106,23 +4209,56 @@ window.__ModuleLoader__.load({
|
|
|
4106
4209
|
modelOptions.push(React.createElement("option", { key: models[m].id, value: models[m].id }, models[m].label));
|
|
4107
4210
|
}
|
|
4108
4211
|
}
|
|
4109
|
-
|
|
4212
|
+
// 模型目录口径:effortsByModel[provider][modelId] 缺失 = 该模型不支持推理强度;
|
|
4213
|
+
// 目录未就绪(loading/error)时不做判断,避免加载中把控件误禁用。
|
|
4214
|
+
var effortCatalog = state.effortsByModel || {};
|
|
4215
|
+
var providerEfforts = provider !== "" && effortCatalog[provider] ? effortCatalog[provider] : null;
|
|
4216
|
+
var modelEfforts = providerEfforts !== null && model !== "" && Array.isArray(providerEfforts[model])
|
|
4217
|
+
? providerEfforts[model]
|
|
4218
|
+
: null;
|
|
4219
|
+
var effortUnsupported = !disabled && provider !== "" && model !== ""
|
|
4220
|
+
&& state.catalogStatus === "ready"
|
|
4221
|
+
&& (modelEfforts === null || modelEfforts.length === 0);
|
|
4222
|
+
var effortDisabled = disabled || effortUnsupported;
|
|
4223
|
+
// 四个按钮:默认 + 三个语义槽,槽的真实 id 取自模型目录
|
|
4224
|
+
// (档位 id 由 adapter 决定,点「高」必须写入该 provider 支持的 id,不能硬编码 high)。
|
|
4225
|
+
var effortChoices = [{ id: "", slot: "", labelKey: "effort.default" }];
|
|
4226
|
+
var effortSlots = [["low", "effort.low"], ["medium", "effort.medium"], ["high", "effort.high"]];
|
|
4227
|
+
for (var s = 0; s < effortSlots.length; s += 1) {
|
|
4228
|
+
var slot = effortSlots[s][0];
|
|
4229
|
+
var pick = modelEfforts === null ? slot : "";
|
|
4230
|
+
if (modelEfforts !== null) {
|
|
4231
|
+
for (var c = 0; c < modelEfforts.length; c += 1) {
|
|
4232
|
+
if (effortSlotOf(modelEfforts[c].id) === slot) pick = modelEfforts[c].id;
|
|
4233
|
+
}
|
|
4234
|
+
// 目录里没有这一槽 → 不出按钮,绝不写入 provider 不支持的档位。
|
|
4235
|
+
if (pick === "") continue;
|
|
4236
|
+
}
|
|
4237
|
+
effortChoices.push({ id: pick, slot: slot, labelKey: effortSlots[s][1] });
|
|
4238
|
+
}
|
|
4110
4239
|
var effortButtons = [];
|
|
4111
4240
|
for (var e = 0; e < effortChoices.length; e += 1) {
|
|
4112
|
-
var choice = effortChoices[e]
|
|
4113
|
-
|
|
4241
|
+
var choice = effortChoices[e];
|
|
4242
|
+
// 选中态按语义槽比对:当前值 max 也点亮「高」,未知值 xx 则一个都不亮。
|
|
4243
|
+
var active = choice.slot === ""
|
|
4244
|
+
? effort === ""
|
|
4245
|
+
: (effort !== "" && effortSlotOf(effort) === choice.slot);
|
|
4114
4246
|
effortButtons.push(React.createElement("button", {
|
|
4115
|
-
key: choice === "" ? "__default" : choice,
|
|
4247
|
+
key: choice.slot === "" ? "__default" : choice.slot,
|
|
4116
4248
|
type: "button",
|
|
4117
|
-
className: active ? "cohub-tier-chip cohub-
|
|
4249
|
+
className: active ? "cohub-tier-chip cohub-tier-chip-on" : "cohub-tier-chip",
|
|
4118
4250
|
"aria-pressed": active,
|
|
4119
|
-
|
|
4251
|
+
// 实际写入 Config.skills[].reasoningEffort 的档位 id(来自模型目录,默认档为空串)。
|
|
4252
|
+
value: choice.id,
|
|
4253
|
+
disabled: effortDisabled,
|
|
4120
4254
|
onClick: function (value) {
|
|
4121
4255
|
return function () {
|
|
4256
|
+
// 与供应商/模型同一通道:写 Config.skills 草稿并 publish 触发重渲染,
|
|
4257
|
+
// 点击后立刻看到高亮与下方「当前:」文案变化。
|
|
4122
4258
|
props.editSkill(name, "reasoningEffort", value);
|
|
4123
4259
|
};
|
|
4124
|
-
}(choice)
|
|
4125
|
-
}, t(
|
|
4260
|
+
}(choice.id)
|
|
4261
|
+
}, t(choice.labelKey)));
|
|
4126
4262
|
}
|
|
4127
4263
|
return React.createElement("div", { className: "cohub-detail-block cohub-model-block" },
|
|
4128
4264
|
React.createElement("p", { className: "cohub-label" }, t("roleModelTitle")),
|
|
@@ -4153,7 +4289,12 @@ window.__ModuleLoader__.load({
|
|
|
4153
4289
|
React.createElement("div", { className: "cohub-field" },
|
|
4154
4290
|
React.createElement("span", { className: "cohub-label" }, t("roleModelReasoning")),
|
|
4155
4291
|
React.createElement("div", { className: "cohub-actions" }, effortButtons),
|
|
4156
|
-
React.createElement("
|
|
4292
|
+
React.createElement("p", { className: "cohub-effort-now" },
|
|
4293
|
+
t("roleModelEffortNowPrefix"),
|
|
4294
|
+
React.createElement("strong", null, effortLabelOf(effort))),
|
|
4295
|
+
effortUnsupported
|
|
4296
|
+
? React.createElement("small", { className: "cohub-desc cohub-notice-warn" }, t("roleModelEffortUnsupported"))
|
|
4297
|
+
: React.createElement("small", { className: "cohub-desc" }, t("roleModelReasoningHint"))
|
|
4157
4298
|
),
|
|
4158
4299
|
React.createElement("div", { className: "cohub-field" },
|
|
4159
4300
|
React.createElement("label", { className: "cohub-label" }, t("roleModelMaxOutput")),
|
|
@@ -4335,7 +4476,32 @@ window.__ModuleLoader__.load({
|
|
|
4335
4476
|
var promptHint = detail.promptSource === "custom"
|
|
4336
4477
|
? t("roleDetailCustomHint")
|
|
4337
4478
|
: detail.promptSource === "builtin" ? t("roleDetailBuiltinHint") : "";
|
|
4479
|
+
// 只读模型行:取 Config.skills 里该角色的那一行(内置 / 自定义同名共用同一份),
|
|
4480
|
+
// 未配置供应商时显示「继承默认」——只读文本,控件仍只在角色卡片里。
|
|
4481
|
+
var modelRow = skillRowOf(detail.name);
|
|
4482
|
+
var modelProvider = modelRow && typeof modelRow.provider === "string" ? modelRow.provider : "";
|
|
4483
|
+
var modelId = modelRow && typeof modelRow.model === "string" ? modelRow.model : "";
|
|
4484
|
+
var modelEffort = modelRow ? effortOf(modelRow) : "";
|
|
4485
|
+
var effortLabel = t("effort." + (modelEffort === "" ? "default" : modelEffort));
|
|
4486
|
+
var modelText = modelProvider === ""
|
|
4487
|
+
? t("roleDetailModelInherit")
|
|
4488
|
+
: [modelProvider, modelId !== "" ? modelId : t("roleModelInherit"), effortLabel].join(" · ");
|
|
4338
4489
|
return React.createElement("div", { className: "cohub-role-detail" },
|
|
4490
|
+
// 头部:本地化角色名 + 原始角色名(等宽小字,复制到配置里用得上)+「已覆盖」徽标。
|
|
4491
|
+
React.createElement("div", { className: "cohub-detail-head" },
|
|
4492
|
+
React.createElement("span", { className: "cohub-label" }, t("roleDetailNameLabel")),
|
|
4493
|
+
React.createElement("span", { className: "cohub-row-name" }, skillLabel(detail.name)),
|
|
4494
|
+
React.createElement("span", { className: "cohub-row-id cohub-mono" }, detail.name),
|
|
4495
|
+
detail.overridden === true
|
|
4496
|
+
? React.createElement("span", { className: "cohub-badge cohub-badge-lead" }, t("roleBuiltinOverridden"))
|
|
4497
|
+
: null
|
|
4498
|
+
),
|
|
4499
|
+
React.createElement("p", { className: "cohub-desc" },
|
|
4500
|
+
detail.description !== "" ? detail.description : t("roleDetailNoDescription")),
|
|
4501
|
+
React.createElement("div", { className: "cohub-detail-line" },
|
|
4502
|
+
React.createElement("span", { className: "cohub-label" }, t("roleDetailModel")),
|
|
4503
|
+
React.createElement("span", { className: "cohub-desc cohub-mono" }, modelText)
|
|
4504
|
+
),
|
|
4339
4505
|
React.createElement("div", { className: "cohub-detail-line" },
|
|
4340
4506
|
React.createElement("span", { className: "cohub-label" }, t("roleDetailTier")),
|
|
4341
4507
|
React.createElement("span", { className: "cohub-badge cohub-badge-tier" }, roleTierLabel(detail)),
|
|
@@ -4394,7 +4560,12 @@ window.__ModuleLoader__.load({
|
|
|
4394
4560
|
disabled: true,
|
|
4395
4561
|
"aria-label": name + " · " + t("roleName")
|
|
4396
4562
|
}),
|
|
4397
|
-
React.createElement("p", { className: "cohub-desc" }, t("roleOverrideNameNote"))
|
|
4563
|
+
React.createElement("p", { className: "cohub-desc" }, t("roleOverrideNameNote")),
|
|
4564
|
+
// 只读摘要:档位 · N 个工具 —— 免得为了看工具数还要另开详情。
|
|
4565
|
+
React.createElement("p", {
|
|
4566
|
+
className: "cohub-desc cohub-mono",
|
|
4567
|
+
"aria-label": name + " · " + t("roleDetailTools")
|
|
4568
|
+
}, roleToolSummary(detail))
|
|
4398
4569
|
),
|
|
4399
4570
|
React.createElement("div", { className: "cohub-field" },
|
|
4400
4571
|
React.createElement("label", { className: "cohub-label" }, t("roleKind")),
|
|
@@ -4461,6 +4632,11 @@ window.__ModuleLoader__.load({
|
|
|
4461
4632
|
props.applyBuiltinTier(tier);
|
|
4462
4633
|
}
|
|
4463
4634
|
}),
|
|
4635
|
+
// 模型区(供应商 / 模型 / 推理强度 / 最大输出):与自定义角色共用 renderRoleModel,
|
|
4636
|
+
// 按**内置角色名**定位 Config.skills 里的那一行(不是 customRoles,也不吃 roleOverrides)。
|
|
4637
|
+
// 它走独立的 skills 草稿 → 保存通道,所以「保存」「恢复默认」只作用于上面的 roleOverrides。
|
|
4638
|
+
renderRoleModel(name, locked),
|
|
4639
|
+
React.createElement("p", { className: "cohub-desc" }, t("roleModelBuiltinNote")),
|
|
4464
4640
|
React.createElement("p", { className: "cohub-desc" }, t("roleOverrideDiffNote")),
|
|
4465
4641
|
React.createElement("div", { className: "cohub-actions" },
|
|
4466
4642
|
React.createElement("button", {
|
|
@@ -4471,6 +4647,7 @@ window.__ModuleLoader__.load({
|
|
|
4471
4647
|
props.resetBuiltinOverride(name);
|
|
4472
4648
|
}
|
|
4473
4649
|
}, t("roleOverrideReset")),
|
|
4650
|
+
React.createElement("small", { className: "cohub-desc" }, t("roleOverrideResetModelNote")),
|
|
4474
4651
|
React.createElement("button", {
|
|
4475
4652
|
type: "button",
|
|
4476
4653
|
className: "cohub-button",
|
|
@@ -4547,8 +4724,12 @@ window.__ModuleLoader__.load({
|
|
|
4547
4724
|
expanded
|
|
4548
4725
|
? React.createElement("div", { key: "builtin-detail" },
|
|
4549
4726
|
renderRoleDetail(name),
|
|
4550
|
-
|
|
4551
|
-
|
|
4727
|
+
// 编辑面板里已有模型区:同时展开详情时不重复渲染同一块,
|
|
4728
|
+
// 避免同一角色名出现两组会互相打脸的模型控件。
|
|
4729
|
+
editing
|
|
4730
|
+
? null
|
|
4731
|
+
: React.createElement("p", { className: "cohub-desc" }, t("roleModelBuiltinNote")),
|
|
4732
|
+
editing ? null : renderRoleModel(name, locked)
|
|
4552
4733
|
)
|
|
4553
4734
|
: null
|
|
4554
4735
|
);
|
|
@@ -4707,6 +4888,30 @@ window.__ModuleLoader__.load({
|
|
|
4707
4888
|
}, t("roleTemplateReselect"))
|
|
4708
4889
|
),
|
|
4709
4890
|
pickerOpen ? renderTemplatePicker(index) : null,
|
|
4891
|
+
// 模板动作:恢复为模板默认(按当前模板整行重填,清掉手动改动)/ 另存为副本(复制本行为新草稿)。
|
|
4892
|
+
React.createElement("div", { className: "cohub-actions cohub-template-head" },
|
|
4893
|
+
React.createElement("button", {
|
|
4894
|
+
type: "button",
|
|
4895
|
+
className: "cohub-button cohub-button-ghost",
|
|
4896
|
+
disabled: locked || !hasTemplate,
|
|
4897
|
+
"aria-label": typeLabel + " · " + t("roleRestoreTemplate"),
|
|
4898
|
+
onClick: function () {
|
|
4899
|
+
props.chooseTemplate(index, templateId);
|
|
4900
|
+
}
|
|
4901
|
+
}, t("roleRestoreTemplate")),
|
|
4902
|
+
React.createElement("small", { className: "cohub-desc" },
|
|
4903
|
+
hasTemplate ? t("roleRestoreTemplateHint") : t("roleRestoreTemplateNone")),
|
|
4904
|
+
React.createElement("button", {
|
|
4905
|
+
type: "button",
|
|
4906
|
+
className: "cohub-button cohub-button-ghost",
|
|
4907
|
+
disabled: locked,
|
|
4908
|
+
"aria-label": typeLabel + " · " + t("roleDuplicate"),
|
|
4909
|
+
onClick: function () {
|
|
4910
|
+
props.duplicateRole(index);
|
|
4911
|
+
}
|
|
4912
|
+
}, t("roleDuplicate")),
|
|
4913
|
+
React.createElement("small", { className: "cohub-desc" }, t("roleDuplicateHint"))
|
|
4914
|
+
),
|
|
4710
4915
|
renderToolPicker(index, role, locked || !hasTemplate),
|
|
4711
4916
|
roleTitle !== "" ? renderRoleModel(role.name, locked || !hasTemplate) : null,
|
|
4712
4917
|
message !== "" ? React.createElement("p", { className: "cohub-role-error" }, message) : null,
|
|
@@ -4831,7 +5036,25 @@ window.__ModuleLoader__.load({
|
|
|
4831
5036
|
};
|
|
4832
5037
|
}(name)
|
|
4833
5038
|
}, roleToolSummary(memberDetail)),
|
|
4834
|
-
|
|
5039
|
+
// 详情旁的「去编辑」:切到角色 tab 并展开该角色,同时收起当前团队编辑区。
|
|
5040
|
+
state.expandedRole === name
|
|
5041
|
+
? React.createElement("div", { className: "cohub-member-detail" },
|
|
5042
|
+
renderRoleDetail(name),
|
|
5043
|
+
React.createElement("div", { className: "cohub-actions" },
|
|
5044
|
+
React.createElement("button", {
|
|
5045
|
+
type: "button",
|
|
5046
|
+
className: "cohub-button cohub-button-ghost",
|
|
5047
|
+
disabled: locked,
|
|
5048
|
+
"aria-label": skillLabel(name) + " · " + t("roleGoEdit"),
|
|
5049
|
+
onClick: function (roleName, teamIndex) {
|
|
5050
|
+
return function () {
|
|
5051
|
+
props.focusRoleEditor(roleName, teamIndex);
|
|
5052
|
+
};
|
|
5053
|
+
}(name, index)
|
|
5054
|
+
}, t("roleGoEdit"))
|
|
5055
|
+
)
|
|
5056
|
+
)
|
|
5057
|
+
: null
|
|
4835
5058
|
));
|
|
4836
5059
|
}
|
|
4837
5060
|
if (boxes.length === 0) continue;
|
|
@@ -5501,6 +5724,12 @@ window.__ModuleLoader__.load({
|
|
|
5501
5724
|
removeRole: function (index) {
|
|
5502
5725
|
controller.removeRole(index);
|
|
5503
5726
|
},
|
|
5727
|
+
duplicateRole: function (index) {
|
|
5728
|
+
controller.duplicateRole(index);
|
|
5729
|
+
},
|
|
5730
|
+
focusRoleEditor: function (name, teamIndex) {
|
|
5731
|
+
controller.focusRoleEditor(name, teamIndex);
|
|
5732
|
+
},
|
|
5504
5733
|
discardRoles: function () {
|
|
5505
5734
|
controller.discardRoles();
|
|
5506
5735
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cohub",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.25",
|
|
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",
|