dsh-cabinet-mode 0.6.1 → 0.6.2
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 +8 -0
- package/README.md +6 -4
- package/README.zh.md +6 -4
- package/client.js +34 -12
- package/package.json +1 -1
- package/scripts/test-client.mjs +56 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.6.2] - 2026-11-08
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Disclose local-source fallback to the registry and show installed provenance from the host inventory, or Unknown when absent.
|
|
10
|
+
- Scope installed source, fallback notices and operation state to their connection; late replies cannot lock or mutate a replacement connection.
|
|
11
|
+
- Retain timeout/no-fallback safeguards and test connection changes during inspection and installation.
|
|
12
|
+
|
|
5
13
|
## [0.6.1] - 2026-11-08
|
|
6
14
|
|
|
7
15
|
### 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.2):** Targets DSH **0.2.2-rc.1**. This release discloses installation source and isolates state across host connections, 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.2 (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.2/dsh-cabinet-mode-0.6.2.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.2/dsh-cabinet-mode-0.6.2.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.2):** 面向 DSH **0.2.2-rc.1**,本次修复安装来源展示及连接状态隔离;依赖连线与成员会话入口属于 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.2 请遵循上方版本兼容说明(见 [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.2/dsh-cabinet-mode-0.6.2.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.2/dsh-cabinet-mode-0.6.2.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
|
@@ -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-cabinet-mode",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
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
|
+
}
|