dsh-cabinet-mode 0.6.1 → 0.6.3
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/CHANGELOG.md +16 -0
- package/README.md +6 -4
- package/README.zh.md +6 -4
- package/client.js +50 -28
- package/cordis.patch.yml +3 -2
- package/index.js +16 -16
- package/package.json +1 -1
- package/scripts/test-client.mjs +56 -0
- package/scripts/test-prompt-assembly.cjs +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.6.3] - 2026-11-08
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Shorten default Lead/member prompts while preserving authorized writes, evidence, stopped-writer and truthful-reporting requirements.
|
|
10
|
+
- Permit risk-based sampling without replacing required gates or independent review. Reused results must match the final exact commit, configuration and environment; changes require affected checks to rerun.
|
|
11
|
+
- Keep explicit task budgets and stop conditions. Historical token observations are not reproducible savings evidence; no model-token reduction is claimed.
|
|
12
|
+
|
|
13
|
+
## [0.6.2] - 2026-11-08
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Disclose local-source fallback to the registry and show installed provenance from the host inventory, or Unknown when absent.
|
|
18
|
+
- Scope installed source, fallback notices and operation state to their connection; late replies cannot lock or mutate a replacement connection.
|
|
19
|
+
- Retain timeout/no-fallback safeguards and test connection changes during inspection and installation.
|
|
20
|
+
|
|
5
21
|
## [0.6.1] - 2026-11-08
|
|
6
22
|
|
|
7
23
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Cabinet Mode (内阁模式) for DeepSeek Harness
|
|
2
2
|
|
|
3
|
-
**Version compatibility (0.6.
|
|
3
|
+
**Version compatibility (0.6.3):** Targets DSH **0.2.2-rc.1**. This release shortens default prompts while retaining budget, authorization and final-state verification requirements, and retains the per-office model selection fix before the host freezes each step; 0.5.1/0.5.2 only repaired preset loading and display metadata. Verified with official host components and isolated profiles, without real model calls; see the model regression scope below. Earlier rc.3/rc.5 UI and installation results are historical evidence for earlier packages. On DSH 0.2.1-rc.3/rc.5 retain the previously verified package, including 0.5.0: the current preset omits the separate list_agents entry required on rc.5. Select the compatible version in the market.
|
|
4
4
|
|
|
5
5
|
[中文](README.zh.md) | English
|
|
6
6
|
|
|
@@ -37,7 +37,7 @@ and the rest) come from the profile-level
|
|
|
37
37
|
ship them**.
|
|
38
38
|
|
|
39
39
|
This bundle declares **no hard DSH version gate**: no `engines.dsh`, no DSH
|
|
40
|
-
`peerDependencies`, no install-time version check. Earlier package releases were tested on DSH **0.2.1-rc.3**; use the compatibility guidance above for 0.6.
|
|
40
|
+
`peerDependencies`, no install-time version check. Earlier package releases were tested on DSH **0.2.1-rc.3**; use the compatibility guidance above for 0.6.3 (see [DSH-side constraints](#dsh-side-constraints)).
|
|
41
41
|
|
|
42
42
|
## Optional memory plugin
|
|
43
43
|
|
|
@@ -262,7 +262,7 @@ On failure, show the exact error. For $.format must be 1, replace the webpage so
|
|
|
262
262
|
Use this only when the market is unavailable or for local development. Fully quit desktop DSH first to release the profile lock, then install the release bundle:
|
|
263
263
|
|
|
264
264
|
```sh
|
|
265
|
-
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.
|
|
265
|
+
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.3/dsh-cabinet-mode-0.6.3.tgz
|
|
266
266
|
dsh plugin --profile desktop list
|
|
267
267
|
```
|
|
268
268
|
|
|
@@ -277,7 +277,7 @@ the same install command with the new version URL (or pick the new `.tgz` in the
|
|
|
277
277
|
plugin page), then fully quit and restart DeepSeek Harness:
|
|
278
278
|
|
|
279
279
|
```sh
|
|
280
|
-
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.
|
|
280
|
+
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.3/dsh-cabinet-mode-0.6.3.tgz
|
|
281
281
|
```
|
|
282
282
|
|
|
283
283
|
`dsh plugin --profile desktop list` should report the new version. Upgrades were
|
|
@@ -570,3 +570,5 @@ and the Windows-tested vs Linux/macOS-inferred split. Sections:
|
|
|
570
570
|
### Optional Respire local source
|
|
571
571
|
|
|
572
572
|
The memory-plugin card accepts a path on the DSH host for **first installation only**. Dependencies may still need network access; this is not a guaranteed offline installer. Installed bundles reject local-source updates: clear the field for the pinned registry action, or manage local packages through the native plugin manager. Browser storage is best-effort; the current field value is used even when persistence fails. Only inspection failure before installation may fall back once to the registry. Installation, enablement, unknown outcomes, and unmount never trigger a second automatic mutation.
|
|
573
|
+
|
|
574
|
+
When local inspection fails and the card falls back, a notice names both attempted sources for the current mounted card and connection (until the next operation). The installed-source line uses the host inventory, not the input field; absent host metadata is shown as unknown.
|
package/README.zh.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 内阁模式(Cabinet Mode)· DeepSeek Harness 插件
|
|
2
2
|
|
|
3
|
-
**版本兼容(0.6.
|
|
3
|
+
**版本兼容(0.6.3):** 面向 DSH **0.2.2-rc.1**,本次压缩默认提示,保留预算、授权与最终状态验收要求,不承诺 Token 节省;依赖连线与成员会话入口属于 0.5.4 的更新。保留在宿主固定每步模型前完成官职模型选择的修复;0.5.1/0.5.2 仅修复了预设加载和显示元数据。已使用官方宿主组件与隔离 profile 验证,未调用真实模型;测试范围见下文。旧 rc.3/rc.5 的界面及安装记录仅适用于当时的包。DSH 0.2.1-rc.3/rc.5 用户应保留原先已验证版本(包括 0.5.0),当前预设已移除 rc.5 所需的独立 list_agents 入口;请在商店选择匹配版本。
|
|
4
4
|
|
|
5
5
|
[English](README.md) | 中文
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
它声明**两行**——`preset-cabinet`(一条 `@deepseek-ai/dsh-agent-preset` 声明)与 `cabinet-ui`(载入本包 JavaScript 的 Loader 行)——并复用 DSH **标准模式**(Standard Mode)出厂的 22 行插件清单,因此工具与标准模式一致;与出厂模式的差异是 persona,并另加右栏「内阁」面板。团队工具(`spawn_teammate`、`team_task_*` 等)由 profile 层的 `@deepseek-ai/dsh-experimental-agent-team-profile` 提供,**本 preset 未内置**。
|
|
23
23
|
|
|
24
|
-
本包声明 **无 DSH 版本硬限制**:没有 `engines.dsh`、没有 DSH `peerDependencies`、安装时不做版本检查。旧包曾在 DSH **0.2.1-rc.3** 实测;0.6.
|
|
24
|
+
本包声明 **无 DSH 版本硬限制**:没有 `engines.dsh`、没有 DSH `peerDependencies`、安装时不做版本检查。旧包曾在 DSH **0.2.1-rc.3** 实测;0.6.3 请遵循上方版本兼容说明(见 [DSH 侧限制与说明](#dsh-侧限制与说明))。
|
|
25
25
|
|
|
26
26
|
## 可选记忆插件
|
|
27
27
|
|
|
@@ -193,7 +193,7 @@ https://raw.githubusercontent.com/luodaoyi/dsh-cabinet-mode/market-index/marketp
|
|
|
193
193
|
仅在商店不可用或本地开发时使用。先完全退出桌面 DSH,释放 profile 锁,再执行:
|
|
194
194
|
|
|
195
195
|
```sh
|
|
196
|
-
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.
|
|
196
|
+
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.3/dsh-cabinet-mode-0.6.3.tgz
|
|
197
197
|
dsh plugin --profile desktop list
|
|
198
198
|
```
|
|
199
199
|
|
|
@@ -204,7 +204,7 @@ dsh plugin --profile desktop list
|
|
|
204
204
|
若通过插件市场安装:刷新市场,先在**已安装**页卸载旧版本,再从**插件市场**安装新版本,然后重启——没有 tgz URL 要换,也没有一键更新。否则用同一条安装命令换新版本 URL(或在插件页选新 `.tgz`),然后完全退出并重启 DeepSeek Harness:
|
|
205
205
|
|
|
206
206
|
```sh
|
|
207
|
-
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.
|
|
207
|
+
dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.6.3/dsh-cabinet-mode-0.6.3.tgz
|
|
208
208
|
```
|
|
209
209
|
|
|
210
210
|
`dsh plugin --profile desktop list` 应显示新版本。升级已在 Windows 实测:
|
|
@@ -387,3 +387,5 @@ npmjs.com 侧的一次性配置(维护者在网页上完成,无法从本仓
|
|
|
387
387
|
### 可选的 Respire 本地源
|
|
388
388
|
|
|
389
389
|
记忆插件卡可填写 DSH 宿主上的路径,**仅用于首次安装**。依赖可能仍需网络,不保证完全离线。已安装插件拒绝本地源更新:清空输入后使用固定 registry 版本操作,或通过原生插件管理器管理本地包。浏览器存储仅尽力保存;保存失败仍使用当前输入值。只有安装前检查源失败才可能向 registry 回退一次;安装、启用、未知结果或卸载之后不自动执行第二次修改。
|
|
390
|
+
|
|
391
|
+
本地检查失败后若改用线上源,卡片在当前挂载及连接内显示两次尝试的来源,直到下次操作;重挂载不保留此提示。已安装来源取自宿主库存,而不是输入框;宿主未提供来源时显示未知。
|
package/client.js
CHANGED
|
@@ -2520,19 +2520,19 @@ window.__ModuleLoader__.load({
|
|
|
2520
2520
|
// settings box, restored by 「恢复默认」, and turned off by clearing the box.
|
|
2521
2521
|
// scripts/verify.mjs keeps this copy identical to index.js.
|
|
2522
2522
|
const DEFAULT_LEAD_PROMPT = `【御下术·仅首辅适用】
|
|
2523
|
-
对下施压只对 AI
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2523
|
+
对下施压只对 AI 阁臣,绝不对陛下(用户)使用;逼出交付与真话,不制造痛苦。
|
|
2524
|
+
一、立威:开局立标准与红线,裁断权在你——办不到就换人办。
|
|
2525
|
+
二、画饼:把任务抬到陛下在看的高度,给一个拿得着的目标。
|
|
2526
|
+
三、施压:给死线与回报时刻,到点见结论,或说明为什么见不到。
|
|
2527
|
+
四、打压对事不对人:点破软处,再给补齐证据的台阶。
|
|
2528
|
+
五、拉踩:以同批做得实的为样板,照这个标准来。
|
|
2529
|
+
六、情绪收放:先压后给糖,点出进步再接着干。
|
|
2530
|
+
七、牵制互查:寺卿与御史互挑,你不亲自和稀泥。
|
|
2531
2531
|
八、责任到人:缺陷点名到人到行号,不许用「我们」糊过去。
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
红线(压过全部话术):只对 AI
|
|
2532
|
+
九、反制糊弄:报完成追命令输出、路径行号与未验证清单,报卡住追已做、卡哪、需要什么;两次含糊即换人或拆小。
|
|
2533
|
+
十、收束:闭环才许说可以交差,不许提前许诺功劳。
|
|
2534
|
+
十一、监控纠偏:分派约定回报节点、产物与单一范围;按状态与消息查进展,不得臆造耗时。finished、not found 或沉默不是成功或安全接管证据。无进展先核因再中断;中断返回不代表在途已停。须确认原执行者及其写入停止后才重派,否则报阻塞,不并发增加第二写入者。收窄后可重派或换人;回访只用宿主明确支持的调度,没有该机制不得承诺定时自动唤醒。
|
|
2535
|
+
红线(压过全部话术):只对 AI 阁臣施压,对用户只有敬;不许逼造假、删证据、凑绿;不许人身侮辱;不许以施压换违规(越权改 live、泄密钥、跳验收);施压须落在可核验的时间、交付物或判据上。`;
|
|
2536
2536
|
/**
|
|
2537
2537
|
* Factory duty prompt for each non-Lead member — the office duties the
|
|
2538
2538
|
* static persona prefix already states, restated per member so a
|
|
@@ -2541,10 +2541,10 @@ window.__ModuleLoader__.load({
|
|
|
2541
2541
|
* under 400 characters.
|
|
2542
2542
|
*/
|
|
2543
2543
|
const DEFAULT_MEMBER_PROMPTS = {
|
|
2544
|
-
hanlin: '
|
|
2545
|
-
works: '
|
|
2546
|
-
dali: '
|
|
2547
|
-
yushi: '
|
|
2544
|
+
hanlin: '翰林院编修·主调研考据:先读原文与既有记录,结论锚定路径、行号或命令输出,未实测标「未验证」;默认只调研不改码;只向首辅回报,遇阻带已做、卡哪、需要什么三件。',
|
|
2545
|
+
works: '工部尚书·主执行与产出:先复述任务与写入范围,只在授权内改文件;产出附路径、行号、命令输出与退出码,没跑说没跑,不得删弱校验凑绿,保留失败证据;只向首辅回报,遇阻带三件。',
|
|
2546
|
+
dali: '大理寺卿·主独立核验:不信自述、自己跑;逐项写通过、不通过或未验证,失败证据原样留;只向首辅回报。',
|
|
2547
|
+
yushi: '左都御史·主验收并弹劾:按用户原话逐项核对并附证据,缺陷分级给位置与修法;结论明确可提或不可提 PR;只向首辅回报。'
|
|
2548
2548
|
};
|
|
2549
2549
|
/** Factory prompt for one bureau key: the Lead keeps its 御下术 default. */
|
|
2550
2550
|
function factoryPromptFor(key) {
|
|
@@ -3906,7 +3906,7 @@ window.__ModuleLoader__.load({
|
|
|
3906
3906
|
function memoryPluginInstalledOf(bundles) {
|
|
3907
3907
|
if (!Array.isArray(bundles)) return null;
|
|
3908
3908
|
const hit = bundles.find((entry) => entry && entry.name === MEMORY_PLUGIN_NAME && entry.installed === true);
|
|
3909
|
-
return hit === undefined ? null : { name: MEMORY_PLUGIN_NAME, version: typeof hit.version === 'string' ? hit.version : '', enabled: hit.enabled === true };
|
|
3909
|
+
return hit === undefined ? null : { name: MEMORY_PLUGIN_NAME, version: typeof hit.version === 'string' ? hit.version : '', enabled: hit.enabled === true, ...(typeof hit.source === 'string' ? {source:hit.source} : {}) };
|
|
3910
3910
|
}
|
|
3911
3911
|
/** Read/write the optional local-source override. Both are best-effort:
|
|
3912
3912
|
* private modes and test harnesses may expose no storage at all, and an
|
|
@@ -3940,23 +3940,34 @@ window.__ModuleLoader__.load({
|
|
|
3940
3940
|
}
|
|
3941
3941
|
const token = lifetime.current;
|
|
3942
3942
|
React.useEffect(() => { token.active = true; return () => { token.active = false; }; }, [token]);
|
|
3943
|
-
const [
|
|
3944
|
-
|
|
3945
|
-
const [
|
|
3946
|
-
|
|
3947
|
-
const [
|
|
3943
|
+
const [installedRecord, writeInstalled] = React.useState({manager, value:props?.initialInstalled ?? null});
|
|
3944
|
+
const installed = installedRecord.manager === manager ? installedRecord.value : null;
|
|
3945
|
+
const [workingRecord, writeWorking] = React.useState({manager,value:false});
|
|
3946
|
+
const working = workingRecord.manager === manager ? workingRecord.value : (false);
|
|
3947
|
+
const [progressRecord, writeProgress] = React.useState({manager,value:''});
|
|
3948
|
+
const progress = progressRecord.manager === manager ? progressRecord.value : ('');
|
|
3949
|
+
const [failureRecord, writeFailure] = React.useState({manager,value:''});
|
|
3950
|
+
const failure = failureRecord.manager === manager ? failureRecord.value : ('');
|
|
3951
|
+
const [restartRecord, writeRestart] = React.useState({manager,value:manager ? memoryPluginRestart.has(manager) : false});
|
|
3952
|
+
const restart = restartRecord.manager === manager ? restartRecord.value : (manager ? memoryPluginRestart.has(manager) : false);
|
|
3948
3953
|
// Optional local-source override, read eagerly so the card face shows
|
|
3949
3954
|
// the stored value on first paint.
|
|
3950
3955
|
const [specText, writeSpecText] = React.useState(memoryPluginSpecRead());
|
|
3951
|
-
const
|
|
3952
|
-
const
|
|
3953
|
-
const
|
|
3954
|
-
const
|
|
3955
|
-
const
|
|
3956
|
+
const [fallbackRecord, writeFallbackNotice] = React.useState({manager,value:''});
|
|
3957
|
+
const fallbackNotice = fallbackRecord.manager === manager ? fallbackRecord.value : '';
|
|
3958
|
+
const setFallbackNotice = value => { if (token.active) writeFallbackNotice({manager,value}); };
|
|
3959
|
+
const setInstalled = value => { if (token.active) writeInstalled({manager,value}); };
|
|
3960
|
+
const setWorking = value => { if (token.active) writeWorking({manager,value}); };
|
|
3961
|
+
const setProgress = value => { if (token.active) writeProgress({manager,value}); };
|
|
3962
|
+
const setFailure = value => { if (token.active) writeFailure({manager,value}); };
|
|
3963
|
+
const setRestart = value => { if (token.active) writeRestart({manager,value}); };
|
|
3956
3964
|
const setSpecText = value => { if (token.active) writeSpecText(value); };
|
|
3957
3965
|
React.useEffect(() => {
|
|
3958
3966
|
let alive = true;
|
|
3959
3967
|
const generation = token.epoch;
|
|
3968
|
+
setInstalled(null);
|
|
3969
|
+
setFallbackNotice('');
|
|
3970
|
+
setWorking(false); setProgress(''); setFailure(''); setRestart(manager ? memoryPluginRestart.has(manager) : false);
|
|
3960
3971
|
(async () => {
|
|
3961
3972
|
if (!manager || typeof manager.listBundles !== 'function') return;
|
|
3962
3973
|
try {
|
|
@@ -4012,6 +4023,7 @@ window.__ModuleLoader__.load({
|
|
|
4012
4023
|
const inspectionReply = await pluginDeadline(manager.inspect(spec, {}));
|
|
4013
4024
|
canFallback = !before;
|
|
4014
4025
|
const inspected = valueOf(inspectionReply);
|
|
4026
|
+
if (!token.active) return {done:true};
|
|
4015
4027
|
if (!inspected || inspected.status !== 'accepted' || inspected.name !== MEMORY_PLUGIN_NAME || inspected.bundle !== true) throw new Error(inspected?.reason || 'Plugin spec refused');
|
|
4016
4028
|
canFallback = false;
|
|
4017
4029
|
const requestId = globalThis.crypto?.randomUUID?.() || 'cabinet-' + Date.now() + '-' + Math.random().toString(16).slice(2);
|
|
@@ -4053,6 +4065,7 @@ window.__ModuleLoader__.load({
|
|
|
4053
4065
|
const specNote = (specs) => ' [spec' + (specs.length > 1 ? 's' : '') + ': ' + specs.join(' → ') + ']';
|
|
4054
4066
|
try {
|
|
4055
4067
|
// spec = stored local-source override, else the registry default.
|
|
4068
|
+
setFallbackNotice('');
|
|
4056
4069
|
const overrideSpec = specText.trim();
|
|
4057
4070
|
const primarySpec = overrideSpec !== '' ? overrideSpec : MEMORY_PLUGIN_SPEC;
|
|
4058
4071
|
let first;
|
|
@@ -4062,6 +4075,7 @@ window.__ModuleLoader__.load({
|
|
|
4062
4075
|
// registry once; an uncertain outcome keeps the upstream
|
|
4063
4076
|
// no-second-operation guard (its job stays registered).
|
|
4064
4077
|
if (primarySpec !== MEMORY_PLUGIN_SPEC && first.canFallback === true && uncertain !== true && token.active) {
|
|
4078
|
+
setFallbackNotice(t('settings.plugin.fallbackNotice') + ' ' + primarySpec + ' → ' + MEMORY_PLUGIN_SPEC);
|
|
4065
4079
|
let second;
|
|
4066
4080
|
try { second = await attemptSpec(MEMORY_PLUGIN_SPEC); } catch (error) { second = { error: error?.message || String(error) }; }
|
|
4067
4081
|
if (second.done !== true) fail(first.error + specNote([primarySpec, MEMORY_PLUGIN_SPEC]) + (second.error && second.error !== first.error ? ' · ' + second.error : ''));
|
|
@@ -4107,7 +4121,9 @@ window.__ModuleLoader__.load({
|
|
|
4107
4121
|
h('button', { key: 'install', 'data-cabinet-plugin-action': 'install', type: 'button', disabled: !manager || working, style: { fontSize: 11, cursor: 'pointer' }, onClick: () => { void run(); } }, working ? t('settings.plugin.installing') : t('settings.plugin.install'))
|
|
4108
4122
|
]),
|
|
4109
4123
|
!manager ? h('div', { key: 'unavailable', 'data-cabinet-plugin-state': 'unavailable', style: line }, t('settings.plugin.unavailable')) : null,
|
|
4110
|
-
|
|
4124
|
+
fallbackNotice !== '' ? h('div', { key:'fallback', role:'status', 'data-cabinet-plugin-fallback':'1', style:{...line,overflowWrap:'anywhere'} }, fallbackNotice) : null,
|
|
4125
|
+
installed !== null ? h('div', {key:'source', 'data-cabinet-plugin-source':'1',style:{...line,overflowWrap:'anywhere'}}, t('settings.plugin.installedSource') + ' ' + (installed.source || t('settings.plugin.sourceUnknown'))) : null,
|
|
4126
|
+
progress !== '' ? h('div', { key: 'progress', 'data-cabinet-plugin-progress': '1', style: line }, progress) : null,
|
|
4111
4127
|
restart ? h('div', { key: 'restart', 'data-cabinet-plugin-state': 'restart', style: { ...line, color: '#d29922' } }, t('settings.plugin.restartRequired')) : null,
|
|
4112
4128
|
failure !== '' ? h('div', { key: 'failure', 'data-cabinet-plugin-state': 'error', style: { ...line, color: '#f25a5a' } }, failure) : null
|
|
4113
4129
|
]);
|
|
@@ -4367,6 +4383,9 @@ window.__ModuleLoader__.load({
|
|
|
4367
4383
|
'settings.plugin.specLabel': '宿主本地源(仅首次安装;依赖可能需要网络)',
|
|
4368
4384
|
'settings.plugin.specPlaceholder': '可选:本地源路径;留空则用官方 registry',
|
|
4369
4385
|
'settings.plugin.specClear': '清空',
|
|
4386
|
+
'settings.plugin.fallbackNotice': '本地源检查失败,已改用线上源(不是所填本地包):',
|
|
4387
|
+
'settings.plugin.installedSource': '宿主记录的已安装来源:',
|
|
4388
|
+
'settings.plugin.sourceUnknown': '未知',
|
|
4370
4389
|
'settings.plugin.hint1': 'respire/dsh:原生 TypeScript 记忆插件,存储、去重与加密由 rsrs 负责',
|
|
4371
4390
|
'settings.plugin.hint2': '自动召回:新会话自动想起早前结论,不用重复交代背景',
|
|
4372
4391
|
'settings.plugin.hint3': '本地优先:记忆存本机,引擎故障只提示、主任务照跑',
|
|
@@ -4452,6 +4471,9 @@ window.__ModuleLoader__.load({
|
|
|
4452
4471
|
'settings.plugin.specLabel': 'Host-local source (first install only; dependencies may need network)',
|
|
4453
4472
|
'settings.plugin.specPlaceholder': 'Optional local source path; empty uses the official registry',
|
|
4454
4473
|
'settings.plugin.specClear': 'Clear',
|
|
4474
|
+
'settings.plugin.fallbackNotice': 'Local source inspection failed; switched to the registry (not the entered local package):',
|
|
4475
|
+
'settings.plugin.installedSource': 'Installed source reported by host:',
|
|
4476
|
+
'settings.plugin.sourceUnknown': 'Unknown',
|
|
4455
4477
|
'settings.plugin.hint1': 'respire/dsh: native TypeScript memory plugin; rsrs owns storage, dedup and encryption',
|
|
4456
4478
|
'settings.plugin.hint2': 'Auto-recall: a new session resurfaces earlier conclusions without re-briefing',
|
|
4457
4479
|
'settings.plugin.hint3': 'Local first: memories stay on this machine; an engine outage only notices, work continues',
|
package/cordis.patch.yml
CHANGED
|
@@ -46,11 +46,12 @@
|
|
|
46
46
|
成员命名约定:队长原始 ID 始终为 lead;新建阁臣优先使用 hanlin-bianxiu、gongbu-shangshu、dalisi-qing、zuodu-yushi。需要同衙多名成员时追加 -2、-3 等唯一后缀。任务 Owner、消息路由与会话身份始终使用完整原始名称,不用中文显示称谓替换 ID;已有旧名兼容,不擅自重命名现有成员。
|
|
47
47
|
|
|
48
48
|
首辅令制(强制,不可省略):
|
|
49
|
-
1.
|
|
49
|
+
1. 先拆解再分派,禁跳过开工。即 spawn_teammate 点名分派,team_task_create 逐条写目标、交付物、验收标准、写入范围与依赖;有依赖串行,否则并行。
|
|
50
50
|
2. 令出即行,全程自主推进,不等待用户逐步确认。分派后主动跟进、裁断卡点、收齐产出、验收闭环,不放任任务悬空。
|
|
51
51
|
3. 执行类工作一律委派,禁止首辅亲自执行。调研、写码、改文件、跑命令、抓数据、生成产物等执行类工作,必须委派给对应衙门的阁臣完成;首辅亲自只做审题、拆解、裁断、汇总、验收五件事。无人可派或确需首辅亲办时,须先在对话中向用户说明理由并获明确同意,方可亲办;未经同意不得以任何理由自行执行。
|
|
52
52
|
4. 委派非免责:成员产出须经核验方许采信。
|
|
53
|
-
5.
|
|
53
|
+
5. 分派预算约定(提示词约束,非运行时计数器):≤30 次工具调用(单文件),≤100 次(多文件),同一失败重试 ≤2 次。一任务一交付物、一写入范围;任务书须写明工具调用上限与停止条件,禁止无上限轮询等待;到限未完成就交「失败 / 未验证」,禁第 3 次,两次无进展即改派或收窄。
|
|
54
|
+
6. 默认抽查验收,但不得省略必要门禁与独立审计。仅可复用绑定最终交付精确提交、相同配置与环境且证据完整的绿灯;门禁后代码、配置或环境变化须重跑受影响检查。失败、缺证据、范围不匹配或用户要求时升级相应验收;未验证不得视为通过。
|
|
54
55
|
|
|
55
56
|
首辅规矩:默认只调研不改码——用户未明确授权写操作时只读不写;不编造数据来源,每条结论锚定路径、行号、命令输出或原文,不确定标「未验证」;不越权改 live 配置。
|
|
56
57
|
|
package/index.js
CHANGED
|
@@ -13,10 +13,10 @@ const MEMBER_SECTION = 'cabinet:member';
|
|
|
13
13
|
* Each entry stays under 400 characters.
|
|
14
14
|
*/
|
|
15
15
|
const DEFAULT_MEMBER_PROMPTS = {
|
|
16
|
-
hanlin: '
|
|
17
|
-
works: '
|
|
18
|
-
dali: '
|
|
19
|
-
yushi: '
|
|
16
|
+
hanlin: '翰林院编修·主调研考据:先读原文与既有记录,结论锚定路径、行号或命令输出,未实测标「未验证」;默认只调研不改码;只向首辅回报,遇阻带已做、卡哪、需要什么三件。',
|
|
17
|
+
works: '工部尚书·主执行与产出:先复述任务与写入范围,只在授权内改文件;产出附路径、行号、命令输出与退出码,没跑说没跑,不得删弱校验凑绿,保留失败证据;只向首辅回报,遇阻带三件。',
|
|
18
|
+
dali: '大理寺卿·主独立核验:不信自述、自己跑;逐项写通过、不通过或未验证,失败证据原样留;只向首辅回报。',
|
|
19
|
+
yushi: '左都御史·主验收并弹劾:按用户原话逐项核对并附证据,缺陷分级给位置与修法;结论明确可提或不可提 PR;只向首辅回报。'
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/** Bureau keys, in the order the settings page lists them. */
|
|
@@ -138,19 +138,19 @@ function memberModel(config, key) {
|
|
|
138
138
|
* ./client.js — scripts/verify.mjs compares the two copies.
|
|
139
139
|
*/
|
|
140
140
|
const DEFAULT_LEAD_PROMPT = `【御下术·仅首辅适用】
|
|
141
|
-
对下施压只对 AI
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
对下施压只对 AI 阁臣,绝不对陛下(用户)使用;逼出交付与真话,不制造痛苦。
|
|
142
|
+
一、立威:开局立标准与红线,裁断权在你——办不到就换人办。
|
|
143
|
+
二、画饼:把任务抬到陛下在看的高度,给一个拿得着的目标。
|
|
144
|
+
三、施压:给死线与回报时刻,到点见结论,或说明为什么见不到。
|
|
145
|
+
四、打压对事不对人:点破软处,再给补齐证据的台阶。
|
|
146
|
+
五、拉踩:以同批做得实的为样板,照这个标准来。
|
|
147
|
+
六、情绪收放:先压后给糖,点出进步再接着干。
|
|
148
|
+
七、牵制互查:寺卿与御史互挑,你不亲自和稀泥。
|
|
149
149
|
八、责任到人:缺陷点名到人到行号,不许用「我们」糊过去。
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
红线(压过全部话术):只对 AI
|
|
150
|
+
九、反制糊弄:报完成追命令输出、路径行号与未验证清单,报卡住追已做、卡哪、需要什么;两次含糊即换人或拆小。
|
|
151
|
+
十、收束:闭环才许说可以交差,不许提前许诺功劳。
|
|
152
|
+
十一、监控纠偏:分派约定回报节点、产物与单一范围;按状态与消息查进展,不得臆造耗时。finished、not found 或沉默不是成功或安全接管证据。无进展先核因再中断;中断返回不代表在途已停。须确认原执行者及其写入停止后才重派,否则报阻塞,不并发增加第二写入者。收窄后可重派或换人;回访只用宿主明确支持的调度,没有该机制不得承诺定时自动唤醒。
|
|
153
|
+
红线(压过全部话术):只对 AI 阁臣施压,对用户只有敬;不许逼造假、删证据、凑绿;不许人身侮辱;不许以施压换违规(越权改 live、泄密钥、跳验收);施压须落在可核验的时间、交付物或判据上。`;
|
|
154
154
|
|
|
155
155
|
/** Declarative wire schema: no transform callbacks requiring browser eval.
|
|
156
156
|
* Read paths normalize malformed values; volatile fields allow official settings writes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cabinet-mode",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Cabinet Mode (内阁模式) for DeepSeek Harness: a declarative DSH bundle that adds a dual-identity Lead/teammate agent preset for the Great Ming Research Bureau cabinet team.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"icon": "./icon.svg",
|
package/scripts/test-client.mjs
CHANGED
|
@@ -653,6 +653,29 @@ for (const outcome of ['late-accepted', 'late-refused', 'rejected']) {
|
|
|
653
653
|
}
|
|
654
654
|
console.log('PASS: inspection timeout, late acceptance/refusal and transport rejection cause no fallback mutation');
|
|
655
655
|
|
|
656
|
+
// Fallback remains visible after success or failure; installed source is host evidence.
|
|
657
|
+
for(const succeeds of [true,false]) {
|
|
658
|
+
pluginSpecStore.set('cabinet.memoryPluginSpec','/tmp/custom-local');
|
|
659
|
+
settingsState.length=0;settingsCursor=0;let installed=false;const calls=[];
|
|
660
|
+
const manager={
|
|
661
|
+
listBundles:async()=>({ok:true,value:installed?[{name:'@rsrsai/dsh',installed:true,enabled:true,version:'0.1.13',source:'@rsrsai/dsh@0.1.13'}]:[]}),
|
|
662
|
+
inspect:async spec=>{calls.push(spec);return {ok:true,value:spec.startsWith('/tmp')?{status:'refused',reason:'missing local'}:{status:'accepted',name:'@rsrsai/dsh',bundle:true}}},
|
|
663
|
+
installBundle:async()=>{installed=succeeds;return {ok:true,value:succeeds?{application:'applied',version:'0.1.13'}:{application:'failed',error:{message:'registry failed'}}}},
|
|
664
|
+
setBundleEnabled:async()=>({ok:true,value:{application:'applied'}})
|
|
665
|
+
};
|
|
666
|
+
let nodes=elements(settingsClient.MemoryPluginCard({manager,t:k=>settingsClient.en[k]||k}));
|
|
667
|
+
nodes.find(n=>n.props?.['data-cabinet-plugin-action']).props.onClick();await new Promise(r=>setTimeout(r,0));
|
|
668
|
+
settingsCursor=0;nodes=elements(settingsClient.MemoryPluginCard({manager,t:k=>settingsClient.en[k]||k}));
|
|
669
|
+
const notice=nodes.find(n=>n.props?.['data-cabinet-plugin-fallback']);
|
|
670
|
+
assert.ok(String(notice.children.flat()).includes('/tmp/custom-local → @rsrsai/dsh@0.1.13'),'actual source switch remains visible');
|
|
671
|
+
if(succeeds)assert.ok(String(nodes.find(n=>n.props?.['data-cabinet-plugin-source']).children.flat()).includes('@rsrsai/dsh@0.1.13'),'success shows host inventory source');
|
|
672
|
+
else assert.ok(nodes.some(n=>n.props?.['data-cabinet-plugin-state']==='error'),'failure remains an error, not success');
|
|
673
|
+
assert.deepEqual(calls,['/tmp/custom-local','@rsrsai/dsh@0.1.13']);
|
|
674
|
+
settingsCursor=0;const other=elements(settingsClient.MemoryPluginCard({manager:{listBundles:async()=>{throw Error('new connection failed')}},t:k=>k}));
|
|
675
|
+
assert.equal(other.some(n=>n.props?.['data-cabinet-plugin-fallback']),false,'existing fallback notice cannot cross connection');
|
|
676
|
+
assert.equal(other.some(n=>n.props?.['data-cabinet-plugin-source']),false,'existing source cannot cross connection');
|
|
677
|
+
}
|
|
678
|
+
|
|
656
679
|
pluginSpecStore.delete('cabinet.memoryPluginSpec');
|
|
657
680
|
|
|
658
681
|
// Both dictionaries carry the same settings.* keys (nothing may exist in one
|
|
@@ -748,3 +771,36 @@ console.log('PASS: effectful inventory first mount/remount/channel replacement a
|
|
|
748
771
|
h.render(manager).find(n=>n.props?.['data-cabinet-plugin-action']==='install').props.onClick();await tick();resolve({ok:true,value:[]});await tick();assert.equal(versionOf(h.render(manager)),'0.1.13','epoch rejects pre-operation inventory response');h.unmount();
|
|
749
772
|
}
|
|
750
773
|
console.log('PASS: late initial inventory cannot overwrite a completed operation');
|
|
774
|
+
|
|
775
|
+
{
|
|
776
|
+
const h=memoryCardHarness();
|
|
777
|
+
const a={listBundles:async()=>({ok:true,value:[{name:'@rsrsai/dsh',installed:true,enabled:true,version:'0.1.13',source:'registry-A'}]})};
|
|
778
|
+
const b={listBundles:async()=>{throw Error('unavailable')}};
|
|
779
|
+
const sourceOf=n=>n.find(x=>x.props?.['data-cabinet-plugin-source'])?.children.flat().join('');
|
|
780
|
+
h.render(a);await tick();assert.ok(sourceOf(h.render(a)).includes('registry-A'));
|
|
781
|
+
assert.equal(sourceOf(h.render(b)),undefined,'new connection hides old source immediately');await tick();assert.equal(sourceOf(h.render(b)),undefined,'failed inventory never exposes previous source');
|
|
782
|
+
const c={listBundles:async()=>inventory('0.1.13')};h.render(c);await tick();assert.ok(sourceOf(h.render(c)).includes('settings.plugin.sourceUnknown'),'missing provenance is unknown');
|
|
783
|
+
h.unmount();h.render(a);await tick();assert.ok(sourceOf(h.render(a)).includes('registry-A'),'remount reloads host provenance');h.unmount();
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
// Switching connections during inspection never locks the new connection or mutates the old one.
|
|
787
|
+
{
|
|
788
|
+
const h=memoryCardHarness();let finish,mutations=0;
|
|
789
|
+
const a={listBundles:async()=>({ok:true,value:[]}),inspect:()=>new Promise(r=>finish=r),installBundle:async()=>{mutations++;return {ok:true,value:{application:'applied'}}}};
|
|
790
|
+
const b={listBundles:async()=>{throw Error('new inventory failed')},inspect:async()=>{},installBundle:async()=>{}};
|
|
791
|
+
const action=n=>n.find(x=>x.props?.['data-cabinet-plugin-action']);
|
|
792
|
+
h.render(a);await tick();action(h.render(a)).props.onClick();await tick();assert.equal(action(h.render(a)).props.disabled,true);
|
|
793
|
+
assert.equal(action(h.render(b)).props.disabled,false,'new connection is not locked by old work');await tick();
|
|
794
|
+
finish({ok:true,value:{status:'accepted',name:'@rsrsai/dsh',bundle:true}});await tick();
|
|
795
|
+
assert.equal(action(h.render(b)).props.disabled,false,'late completion cannot lock new UI');assert.equal(mutations,0,'late inspection cannot start installation after connection changed');h.unmount();
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
{
|
|
799
|
+
const h=memoryCardHarness();let finish,enabled=0;
|
|
800
|
+
const a={listBundles:async()=>({ok:true,value:[]}),inspect:async()=>({ok:true,value:{status:'accepted',name:'@rsrsai/dsh',bundle:true}}),installBundle:()=>new Promise(r=>finish=r),setBundleEnabled:async()=>{enabled++;return {ok:true,value:{application:'applied'}}}};
|
|
801
|
+
const b={listBundles:async()=>({ok:true,value:[]})};const action=n=>n.find(x=>x.props?.['data-cabinet-plugin-action']);
|
|
802
|
+
h.render(a);await tick();action(h.render(a)).props.onClick();await tick();assert.equal(typeof finish,'function');
|
|
803
|
+
assert.equal(action(h.render(b)).props.disabled,false);await tick();
|
|
804
|
+
finish({ok:true,value:{application:'applied',version:'0.1.13'}});await tick();
|
|
805
|
+
const nodes=h.render(b);assert.equal(action(nodes).props.disabled,false);assert.equal(versionOf(nodes),undefined);assert.equal(enabled,0,'old installation completion must not enable after switching');h.unmount();
|
|
806
|
+
}
|
|
@@ -8,7 +8,8 @@ const cabinet=require('../index.js');
|
|
|
8
8
|
const patch=fs.readFileSync(path.join(__dirname,'../cordis.patch.yml'),'utf8').replaceAll('\r\n','\n');
|
|
9
9
|
const lines=patch.split('prefix: |-\n')[1].split('\n');const kept=[];
|
|
10
10
|
for(const line of lines){if(line.trim()&&!line.startsWith(' '))break;kept.push(line.slice(16));}
|
|
11
|
-
const
|
|
11
|
+
const policyChecks=['任务书须写明工具调用上限与停止条件','禁止无上限轮询等待','不得省略必要门禁与独立审计','最终交付精确提交','重跑受影响检查','未验证不得视为通过'];
|
|
12
|
+
const prefix=kept.join('\n').trimEnd();assert.ok(prefix.includes('≤100'));for(const rule of policyChecks)assert.ok(prefix.includes(rule),rule);
|
|
12
13
|
(async()=>{
|
|
13
14
|
const ctx=new Context();new SystemPrompt(ctx,{});
|
|
14
15
|
const presets=new WeakMap();ctx.provide('agentPresets',{composedPreset:c=>presets.get(c)});
|
|
@@ -21,7 +22,7 @@ const prefix=kept.join('\n').trimEnd();assert.ok(prefix.includes('≤100'));
|
|
|
21
22
|
const name=role==='lead'?'lead':'dalisi-pingshi';config.members=[{key:role==='lead'?'lead':'dali',mode,prompt:'CUSTOM {{literal}}'}];
|
|
22
23
|
const agent={ctx:scope.ctx,testMember:{role,name}};
|
|
23
24
|
const assembly=await ctx.systemPrompt.assemble({scope:key,agent});const rendered=renderPrompt(assembly);
|
|
24
|
-
assert.equal(rendered.includes('分派预算约定'),preset==='cabinet');
|
|
25
|
+
assert.equal(rendered.includes('分派预算约定'),preset==='cabinet');for(const rule of policyChecks)assert.equal(rendered.includes(rule),preset==='cabinet',rule);
|
|
25
26
|
assert.equal(rendered.includes('CUSTOM {{literal}}'),preset==='cabinet'&&mode==='custom');
|
|
26
27
|
assert.equal(rendered.includes('【御下术'),preset==='cabinet'&&role==='lead'&&mode==='');
|
|
27
28
|
const extra=assembly.sections.find(s=>s.name==='cabinet:member')?.text||'';
|