@linxin666/dsh-liangshen 0.4.3 → 0.4.5
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.i18n.yaml +2 -2
- package/README.md +16 -3
- package/README.zh.md +15 -2
- package/lib/client.js +57 -18
- package/lib/client.js.map +1 -1
- package/lib/types/client/PluginSettingsCard.d.ts +7 -0
- package/lib/types/client/settings-form.d.ts +16 -0
- package/package.json +15 -15
- package/src/client/PluginSettingsCard.tsx +9 -0
- package/src/client/settings-card.module.css +31 -5
- package/src/client/settings-form.ts +27 -1
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# node scripts/verify-docs.mjs --write <dir>
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 61cc24061f07a91da827f15cee77a5fcce173d29
|
|
6
|
+
README.zh.md: 97ff422495565eb9394131fd310f48c50ffb5b13
|
package/README.md
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
# dsh-liangshen
|
|
1
|
+
# dsh-liangshen · Minimal LiangShen Persona & Programmatic Tool Transport for DeepSeek Harness (DSH)
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://img.shields.io/npm/v/@linxin666/dsh-liangshen?style=flat-square" alt="Version">
|
|
7
|
+
|
|
8
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.0--rc.2-4c6ef5?style=flat-square&labelColor=454a54" alt="DSH">
|
|
9
|
+
|
|
10
|
+
<img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<strong>Minimal LiangShen Persona & Programmatic Tool Transport for DeepSeek Harness (DSH)</strong><br>
|
|
15
|
+
<em>Minimal Persona · Native & run_code Dual Transport · Gentle MCP Paging · Runtime Degradation Fuse · Fact Register</em>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
An all-in-one plugin for DeepSeek Harness (DSH) Web GUI and desktop client: declares the built-in "LiangShen Mode" preset to the official agent-preset registry upon activation and offers a slot-machine lever toggle alongside the model selector in the blank conversation page. Keeps system prompts concise to a minimal persona with strict operational disciplines while workspace instructions arrive via user turns. Tools operate under a unified presentation contract (defaulting to `both`: cohabiting native tools with `run_code` for batching and fan-outs). Features gentle MCP namespace paging, runtime degradation safety fuses, and a key fact register for long-horizon context retention.
|
|
6
19
|
|
|
7
20
|
## Why
|
|
8
21
|
|
|
@@ -130,7 +143,7 @@ All fields are editable in the web settings surface (plugin config) or through t
|
|
|
130
143
|
- The preset carries the same trust level as shell access — review `presets/liangshen/` before installing;
|
|
131
144
|
- The plugin makes no network requests and adds no telemetry;
|
|
132
145
|
- Do not switch presets mid-conversation;
|
|
133
|
-
- Requires DSH 0.
|
|
146
|
+
- Requires DSH 0.2.0-rc.2+ (preset mechanism, the `system-prompt/assemble` waterfall, the persona `prefix` schema, and the PTC presentation API).
|
|
134
147
|
|
|
135
148
|
## License
|
|
136
149
|
|
package/README.zh.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
# dsh-liangshen
|
|
1
|
+
# dsh-liangshen · DeepSeek Harness (DSH) 极简梁神模式与低开销程序化工具传输插件
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://img.shields.io/npm/v/@linxin666/dsh-liangshen?style=flat-square" alt="Version">
|
|
7
|
+
|
|
8
|
+
<img src="https://img.shields.io/badge/DSH-%3E%3D0.2.0--rc.2-4c6ef5?style=flat-square&labelColor=454a54" alt="DSH">
|
|
9
|
+
|
|
10
|
+
<img src="https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square" alt="License">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<strong>DeepSeek Harness(DSH)官方 Web GUI 与桌面客户端极简 Agent 预设与高效代码工具传输引擎</strong><br>
|
|
15
|
+
<em>极简 Persona 系统提示词 · 原生直调与 run_code 混合传输 · MCP 工具温和分页 · 运行时退化熔断 · 关键事实登记簿</em>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
5
18
|
把梁神模式做成 DSH 全家桶里的一键安装插件:Host 半区在激活时把内置 preset 直接声明给 harness 的 agent-preset registry(声明即启用),新建会话即可在预设选择器中选择「梁神模式」,浏览器半区还在新建会话页的模型选择器旁提供一台老虎机拨杆来开关该模式。该 preset 让系统提示词保持极简 persona——外加本模式的固定工作纪律与会话工作区目录——AGENTS.md 类工作区指令交由 harness 以自己的 user 角色消息送达;工具面则从第一条用户消息起作为持久 user 消息注入在用户消息之后——形状与 harness 注入 skill 目录一致,且只宣告该次请求实际开放的工具。wire 在整个会话中保持由 `presentation` 选定的同一种呈现(出厂默认 `presentation: 'both'`):原生清单与 `run_code` 传输工具同驻——日常单步工作走原生直调,程序化批处理、并发扇出与多步数据塑形走 `run_code`;未挂载 code runtime 的部署回退为原生呈现并一次性告警,而不是宣告一个该请求无法承载的传输工具。被分页扣留的匹配工具(默认 `mcp__*`)在激活前不可达:它们以命名空间摘要出现在目录里,`ptc` 下同时不出现在生成的 SDK 中——分页是注册表级限制,不只是 wire 过滤。`tool_activate` 把一个命名空间挂回整个可达面。全部通过官方 NPM SDK 实现,不修改 DSH 源码。
|
|
6
19
|
|
|
7
20
|
## 原理
|
|
@@ -130,7 +143,7 @@ dsh plugin --profile web remove @linxin666/dsh-liangshen
|
|
|
130
143
|
- preset 与 shell 访问具有相同信任等级,安装前可自行审阅 `presets/liangshen/`;
|
|
131
144
|
- 插件不发起网络请求,也不增加遥测;
|
|
132
145
|
- 不要在已经产生内容的会话中途切换 preset;
|
|
133
|
-
- 需要 DSH 0.
|
|
146
|
+
- 需要 DSH 0.2.0-rc.2+(preset 机制、`system-prompt/assemble` 瀑布、persona 的 `prefix` schema,以及 PTC 呈现 API)。
|
|
134
147
|
|
|
135
148
|
## 许可
|
|
136
149
|
|
package/lib/client.js
CHANGED
|
@@ -613,7 +613,7 @@ window.__ModuleLoader__.load({
|
|
|
613
613
|
}
|
|
614
614
|
//#endregion
|
|
615
615
|
//#region \0dsh-css:packages/dsh-liangshen/src/client/settings-card.module.css.mjs
|
|
616
|
-
const css = "._9t79wq_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}._9t79wq_card:hover{border-color:var(--dsw-alias-label-dimmed)}._9t79wq_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}._9t79wq_header{appearance:none;box-sizing:border-box;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:
|
|
616
|
+
const css = "._9t79wq_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}._9t79wq_card:hover{border-color:var(--dsw-alias-label-dimmed)}._9t79wq_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}._9t79wq_header{appearance:none;box-sizing:border-box;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:13px;padding:16px;display:flex}._9t79wq_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}._9t79wq_headerStatic{box-sizing:border-box;border-radius:12px;align-items:center;gap:13px;width:100%;padding:16px;display:flex}._9t79wq_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}._9t79wq_mark{background:var(--dsw-alias-bg-module-platform);width:34px;height:34px;color:var(--dsw-alias-label-secondary);border-radius:10px;flex:none;place-items:center;transition:color .16s;display:grid}._9t79wq_header:hover ._9t79wq_mark,._9t79wq_cardOpen ._9t79wq_mark{color:var(--dsw-alias-label-primary)}._9t79wq_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}._9t79wq_description{color:var(--dsw-alias-label-secondary);font-size:13px;line-height:1.5}._9t79wq_pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}._9t79wq_chevron{color:var(--dsw-alias-label-tertiary);flex:none;width:16px;height:16px;transition:transform .16s,color .16s}._9t79wq_header:hover ._9t79wq_chevron{color:var(--dsw-alias-label-secondary)}._9t79wq_chevronOpen{transform:rotate(180deg)}._9t79wq_body{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}._9t79wq_readOnly{color:var(--dsw-alias-label-secondary);margin:12px 0 0;font-size:12px;line-height:1.5}._9t79wq_notExposed{color:var(--dsw-alias-state-warn-primary);margin:12px 0 0;font-size:12px;line-height:1.5}._9t79wq_footer{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}._9t79wq_failed{min-width:0;color:var(--dsw-alias-state-error-primary,#b42318);text-overflow:ellipsis;white-space:nowrap;flex:1;margin:0;font-size:12px;line-height:1.5;overflow:hidden}._9t79wq_discard,._9t79wq_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5}._9t79wq_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}._9t79wq_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}._9t79wq_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}._9t79wq_discard:disabled,._9t79wq_save:disabled{opacity:.4;cursor:default}._9t79wq_discard:focus-visible,._9t79wq_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}._9t79wq_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}._9t79wq_field+._9t79wq_field{border-top:1px solid var(--dsw-alias-border-l2)}._9t79wq_head{align-items:center;gap:8px;display:flex}._9t79wq_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}._9t79wq_badges{align-items:center;gap:8px;display:inline-flex}._9t79wq_badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}._9t79wq_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}._9t79wq_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}._9t79wq_reset:disabled{cursor:default}._9t79wq_reset:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px;outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}._9t79wq_input,._9t79wq_select{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}._9t79wq_input:focus-visible,._9t79wq_select:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}._9t79wq_input:disabled,._9t79wq_select:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}._9t79wq_inputInvalid{border:1px solid var(--dsw-alias-state-error-primary,#b42318);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}._9t79wq_inputInvalid:focus-visible{outline:2px solid var(--dsw-alias-state-error-primary,#b42318);outline-offset:1px;border-color:var(--dsw-alias-state-error-primary,#b42318)}._9t79wq_selectWrap{position:relative}._9t79wq_selectButton{appearance:none;text-align:left;cursor:pointer;justify-content:space-between;align-items:center;gap:8px;width:100%;display:flex}._9t79wq_selectLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._9t79wq_selectChevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}._9t79wq_selectChevronOpen{transform:rotate(180deg)}._9t79wq_selectPopup{z-index:40;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);max-height:240px;box-shadow:0 8px 24px var(--dsw-alias-bg-mask-2);opacity:0;border-radius:8px;flex-direction:column;padding:4px;transition:opacity .1s,transform .1s;display:flex;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;transform:translateY(-4px)}._9t79wq_selectPopupOpen{opacity:1;transform:none}._9t79wq_selectPopupClose{opacity:0;pointer-events:none;transform:translateY(-4px)}._9t79wq_selectOption{color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-overflow:ellipsis;border-radius:6px;flex-shrink:0;padding:6px 10px;font-size:13px;line-height:1.5;overflow:hidden}._9t79wq_selectOption:hover,._9t79wq_selectOptionActive{background:var(--dsw-alias-interactive-bg-hover)}._9t79wq_selectOptionSelected{color:var(--dsw-alias-brand-primary);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 10%, transparent);font-weight:500}._9t79wq_invalid{color:var(--dsw-alias-state-error-primary,#b42318);margin:0;font-size:12px;line-height:1.5}._9t79wq_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:1.5}@media (prefers-reduced-motion:reduce){._9t79wq_card,._9t79wq_header,._9t79wq_mark,._9t79wq_chevron,._9t79wq_chevronOpen,._9t79wq_discard,._9t79wq_save,._9t79wq_selectChevron,._9t79wq_selectChevronOpen,._9t79wq_selectPopup{transition:none}}";
|
|
617
617
|
const tagId = "@linxin666/dsh-liangshen/packages/dsh-liangshen/src/client/settings-card.module.css";
|
|
618
618
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
619
619
|
const tag = document.createElement("style");
|
|
@@ -644,6 +644,7 @@ window.__ModuleLoader__.load({
|
|
|
644
644
|
"inputInvalid": "_9t79wq_inputInvalid",
|
|
645
645
|
"invalid": "_9t79wq_invalid",
|
|
646
646
|
"label": "_9t79wq_label",
|
|
647
|
+
"mark": "_9t79wq_mark",
|
|
647
648
|
"name": "_9t79wq_name",
|
|
648
649
|
"notExposed": "_9t79wq_notExposed",
|
|
649
650
|
"pending": "_9t79wq_pending",
|
|
@@ -689,22 +690,30 @@ window.__ModuleLoader__.load({
|
|
|
689
690
|
const cardClass = expanded ? `${settings_card_module_css_default.cardOpen} ${settings_card_module_css_default.card}` : settings_card_module_css_default.card;
|
|
690
691
|
const header = alwaysOpen === true ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
691
692
|
className: settings_card_module_css_default.headerStatic,
|
|
692
|
-
children: [
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
className: settings_card_module_css_default.
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
693
|
+
children: [
|
|
694
|
+
props.icon !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
695
|
+
className: settings_card_module_css_default.mark,
|
|
696
|
+
"aria-hidden": "true",
|
|
697
|
+
children: props.icon
|
|
698
|
+
}) : null,
|
|
699
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
700
|
+
className: settings_card_module_css_default.headText,
|
|
701
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
702
|
+
className: settings_card_module_css_default.name,
|
|
703
|
+
title,
|
|
704
|
+
children: title
|
|
705
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
706
|
+
className: settings_card_module_css_default.description,
|
|
707
|
+
title: description,
|
|
708
|
+
children: props.descriptionNode ?? description
|
|
709
|
+
})]
|
|
710
|
+
}),
|
|
711
|
+
state.dirty ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
712
|
+
className: settings_card_module_css_default.pending,
|
|
713
|
+
title: props.t("settings.unsaved"),
|
|
714
|
+
children: props.t("settings.unsaved")
|
|
715
|
+
}) : null
|
|
716
|
+
]
|
|
708
717
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
709
718
|
type: "button",
|
|
710
719
|
className: settings_card_module_css_default.header,
|
|
@@ -714,6 +723,11 @@ window.__ModuleLoader__.load({
|
|
|
714
723
|
setOpen(!open);
|
|
715
724
|
},
|
|
716
725
|
children: [
|
|
726
|
+
props.icon !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
727
|
+
className: settings_card_module_css_default.mark,
|
|
728
|
+
"aria-hidden": "true",
|
|
729
|
+
children: props.icon
|
|
730
|
+
}) : null,
|
|
717
731
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
718
732
|
className: settings_card_module_css_default.headText,
|
|
719
733
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1180,6 +1194,8 @@ window.__ModuleLoader__.load({
|
|
|
1180
1194
|
disposeForm;
|
|
1181
1195
|
disposed = false;
|
|
1182
1196
|
saving = false;
|
|
1197
|
+
/** A save asked for while one was in flight; it runs once the first settles (#1754). */
|
|
1198
|
+
saveQueued = false;
|
|
1183
1199
|
failed = false;
|
|
1184
1200
|
failedReason;
|
|
1185
1201
|
/** @param scope - the bound configuration form for this card's namespace. */
|
|
@@ -1255,7 +1271,7 @@ window.__ModuleLoader__.load({
|
|
|
1255
1271
|
});
|
|
1256
1272
|
},
|
|
1257
1273
|
save: () => {
|
|
1258
|
-
this.
|
|
1274
|
+
this.requestSave();
|
|
1259
1275
|
},
|
|
1260
1276
|
discard: () => {
|
|
1261
1277
|
if (this.staged.size === 0 && !this.failed) return;
|
|
@@ -1282,6 +1298,29 @@ window.__ModuleLoader__.load({
|
|
|
1282
1298
|
* the user can correct them instead of retyping.
|
|
1283
1299
|
* @returns settlement after the mutation and the read-back.
|
|
1284
1300
|
*/
|
|
1301
|
+
/**
|
|
1302
|
+
* Run one save, and re-run it once if another was asked for while this one
|
|
1303
|
+
* was still in flight.
|
|
1304
|
+
*
|
|
1305
|
+
* A save is a Host round trip that also drives the profile reconcile, and
|
|
1306
|
+
* the Host runs that write inside one exclusive transaction. Answering a
|
|
1307
|
+
* press that arrives mid-flight by returning immediately dropped the edit
|
|
1308
|
+
* with no explanation, which is the "the save button stops working after a
|
|
1309
|
+
* few rounds" report (#1754). Serializing instead means a save pressed while
|
|
1310
|
+
* another is still settling runs against the settled state - which is what
|
|
1311
|
+
* the operator meant by pressing it again.
|
|
1312
|
+
* @returns settlement after the mutation and the read-back.
|
|
1313
|
+
*/
|
|
1314
|
+
async requestSave() {
|
|
1315
|
+
if (this.saving) {
|
|
1316
|
+
this.saveQueued = true;
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
await this.save();
|
|
1320
|
+
if (!this.saveQueued) return;
|
|
1321
|
+
this.saveQueued = false;
|
|
1322
|
+
await this.requestSave();
|
|
1323
|
+
}
|
|
1285
1324
|
async save() {
|
|
1286
1325
|
const plan = this.plan();
|
|
1287
1326
|
const valid = plan.filter((item) => item.judge !== void 0);
|