dsh-model-extension 0.1.0 → 0.2.0
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 +12 -0
- package/lib/client.js +46 -2
- package/lib/client.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|

|
|
5
5
|
|
|
6
|
+
> **作者建议(非AI编写)**
|
|
7
|
+
> 安装该插件或该类型插件:clone仓库源码 -> 执行安全检查/扫描 -> 从源码构建 -> 安装
|
|
6
8
|
|
|
7
9
|
## 功能
|
|
8
10
|
|
|
@@ -22,6 +24,12 @@ dsh plugin --profile web add github:lovezi0/dsh-model-extension
|
|
|
22
24
|
|
|
23
25
|
仓库自带构建产物 `lib/`,安装即用、无需本地构建。
|
|
24
26
|
|
|
27
|
+
也可从 npm 安装(已发布至 npmjs):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
dsh plugin --profile web add dsh-model-extension
|
|
31
|
+
```
|
|
32
|
+
|
|
25
33
|
## 从源码构建
|
|
26
34
|
|
|
27
35
|
构建期需要 DeepSeek Harness 宿主源码(版本须与 `package.json` 的 `dsh.adapter` 锚点一致):
|
|
@@ -48,6 +56,10 @@ dsh plugin --profile web add github:lovezi0/dsh-model-extension
|
|
|
48
56
|
|
|
49
57
|
## 版本历史
|
|
50
58
|
|
|
59
|
+
- **0.2.0**
|
|
60
|
+
- 🔥新增允许以 developer 角色发送系统提示
|
|
61
|
+
- **0.1.1**
|
|
62
|
+
- 🐛修复peer范围bug
|
|
51
63
|
- **0.1.0**
|
|
52
64
|
- 🔥新增[模型+]开启dsh隐藏设置
|
|
53
65
|
|
package/lib/client.js
CHANGED
|
@@ -795,6 +795,8 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
|
|
|
795
795
|
extSection: "Model extensions",
|
|
796
796
|
extSectionHint: "Extra per-model fields that live in settings.yaml.",
|
|
797
797
|
supportsReasoningEffort: "Endpoint accepts reasoning effort",
|
|
798
|
+
supportsDeveloperRole: "System prompt may use the developer role",
|
|
799
|
+
supportsDeveloperRoleHint: "Reasoning-model system prompts go out as \"developer\"; uncheck to keep \"system\" for gateways that reject it.",
|
|
798
800
|
reasoningEfforts: "Reasoning efforts",
|
|
799
801
|
reasoningEffortLevel: "Level",
|
|
800
802
|
reasoningEffortWire: "Wire value",
|
|
@@ -903,6 +905,8 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
|
|
|
903
905
|
extSection: "模型扩展",
|
|
904
906
|
extSectionHint: "settings.yaml 中按模型生效的扩展字段。",
|
|
905
907
|
supportsReasoningEffort: "端点接受推理挡位参数(reasoning_effort)",
|
|
908
|
+
supportsDeveloperRole: "允许以 developer 角色发送系统提示",
|
|
909
|
+
supportsDeveloperRoleHint: "推理模型的系统提示将以 developer 角色发出;网关拒绝该角色时取消勾选,改用 system。",
|
|
906
910
|
reasoningEfforts: "推理挡位",
|
|
907
911
|
reasoningEffortLevel: "挡位",
|
|
908
912
|
reasoningEffortWire: "线上取值",
|
|
@@ -989,10 +993,11 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
|
|
|
989
993
|
const modalityLabel = (modality) => isZh ? MODALITY_LABELS[modality]?.zh ?? modality : MODALITY_LABELS[modality]?.en ?? modality;
|
|
990
994
|
const compat = compatOf(model);
|
|
991
995
|
const supportsReasoningEffort = compat["supportsReasoningEffort"] === true;
|
|
996
|
+
const supportsDeveloperRole = compat["supportsDeveloperRole"] !== false;
|
|
992
997
|
/** Write one key into `compat`, merging into the row's existing compat and
|
|
993
998
|
* clearing the whole `compat` node when it would become empty. Used for
|
|
994
|
-
* `supportsReasoningEffort` and `
|
|
995
|
-
* model extension fields that live under `compat`. */
|
|
999
|
+
* `supportsReasoningEffort`, `thinkingFormat` and `supportsDeveloperRole`
|
|
1000
|
+
* ONLY — those are the only model extension fields that live under `compat`. */
|
|
996
1001
|
const setCompatKey = (key, value) => {
|
|
997
1002
|
const next = { ...compat };
|
|
998
1003
|
if (value === void 0) delete next[key];
|
|
@@ -1058,6 +1063,45 @@ if (typeof document !== 'undefined' && document.querySelector('style[data-plugin
|
|
|
1058
1063
|
gap: 14
|
|
1059
1064
|
},
|
|
1060
1065
|
children: [
|
|
1066
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1067
|
+
style: {
|
|
1068
|
+
borderTop: "0.5px solid var(--color-border-tertiary, rgba(0,0,0,0.15))",
|
|
1069
|
+
paddingTop: 12
|
|
1070
|
+
},
|
|
1071
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1072
|
+
style: {
|
|
1073
|
+
display: "flex",
|
|
1074
|
+
alignItems: "flex-start",
|
|
1075
|
+
gap: 8,
|
|
1076
|
+
cursor: "pointer"
|
|
1077
|
+
},
|
|
1078
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1079
|
+
type: "checkbox",
|
|
1080
|
+
style: checkboxStyle,
|
|
1081
|
+
checked: supportsDeveloperRole,
|
|
1082
|
+
disabled,
|
|
1083
|
+
onChange: (event) => {
|
|
1084
|
+
setCompatKey("supportsDeveloperRole", event.target.checked ? void 0 : false);
|
|
1085
|
+
}
|
|
1086
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1087
|
+
style: {
|
|
1088
|
+
display: "flex",
|
|
1089
|
+
flexDirection: "column",
|
|
1090
|
+
gap: 2
|
|
1091
|
+
},
|
|
1092
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1093
|
+
className: ModelsSection_ext_module_default["modelFieldLabel"],
|
|
1094
|
+
children: t("supportsDeveloperRole")
|
|
1095
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1096
|
+
style: {
|
|
1097
|
+
fontSize: 12,
|
|
1098
|
+
color: "var(--color-text-tertiary, #999)"
|
|
1099
|
+
},
|
|
1100
|
+
children: t("supportsDeveloperRoleHint")
|
|
1101
|
+
})]
|
|
1102
|
+
})]
|
|
1103
|
+
})
|
|
1104
|
+
}),
|
|
1061
1105
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1062
1106
|
style: {
|
|
1063
1107
|
borderTop: "0.5px solid var(--color-border-tertiary, rgba(0,0,0,0.15))",
|