dsh-cabinet-mode 0.9.0 → 0.9.1

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 CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [0.9.1] - 2026-11-13
6
+
7
+ ### Changed
8
+
9
+ - Replace the running-card rotating gradient with a bounded Motion Path dot. Only actual agent activity enables it; stale in-progress tasks do not imply an active agent.
10
+ - Hide the dot for reduced-motion preferences and unsupported Motion Path engines; restore normal behavior when reduced motion is disabled.
11
+ - This maintenance release does not add currency or model-cost estimates.
12
+
13
+ ### Tests
14
+
15
+ - Restore 11 browser-runner failure-injection regressions covering diagnostic screenshots, original-error preservation, and browser/server cleanup, adapted to the current native-send workflow.
16
+ - Add native computed-style checks for normal/reduced/resumed motion and an isolated unsupported-feature-query fallback check. The latter verifies the fallback declaration, not compatibility with every older browser engine.
17
+
5
18
  ## [0.9.0] - 2026-11-13
6
19
 
7
20
  ### Added
package/README.md CHANGED
@@ -300,7 +300,7 @@ On failure, show the exact error. For $.format must be 1, replace the webpage so
300
300
  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:
301
301
 
302
302
  ```sh
303
- dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.0/dsh-cabinet-mode-0.9.0.tgz
303
+ dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.1/dsh-cabinet-mode-0.9.1.tgz
304
304
  dsh plugin --profile desktop list
305
305
  ```
306
306
 
@@ -315,7 +315,7 @@ the same install command with the new version URL (or pick the new `.tgz` in the
315
315
  plugin page), then fully quit and restart DeepSeek Harness:
316
316
 
317
317
  ```sh
318
- dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.0/dsh-cabinet-mode-0.9.0.tgz
318
+ dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.1/dsh-cabinet-mode-0.9.1.tgz
319
319
  ```
320
320
 
321
321
  `dsh plugin --profile desktop list` should report the new version. Upgrades were
package/README.zh.md CHANGED
@@ -231,7 +231,7 @@ https://raw.githubusercontent.com/luodaoyi/dsh-cabinet-mode/market-index/marketp
231
231
  仅在商店不可用或本地开发时使用。先完全退出桌面 DSH,释放 profile 锁,再执行:
232
232
 
233
233
  ```sh
234
- dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.0/dsh-cabinet-mode-0.9.0.tgz
234
+ dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.1/dsh-cabinet-mode-0.9.1.tgz
235
235
  dsh plugin --profile desktop list
236
236
  ```
237
237
 
@@ -242,7 +242,7 @@ dsh plugin --profile desktop list
242
242
  若通过插件市场安装:刷新市场,先在**已安装**页卸载旧版本,再从**插件市场**安装新版本,然后重启——没有 tgz URL 要换,也没有一键更新。否则用同一条安装命令换新版本 URL(或在插件页选新 `.tgz`),然后完全退出并重启 DeepSeek Harness:
243
243
 
244
244
  ```sh
245
- dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.0/dsh-cabinet-mode-0.9.0.tgz
245
+ dsh plugin --profile desktop add https://github.com/luodaoyi/dsh-cabinet-mode/releases/download/v0.9.1/dsh-cabinet-mode-0.9.1.tgz
246
246
  ```
247
247
 
248
248
  `dsh plugin --profile desktop list` 应显示新版本。升级已在 Windows 实测:
package/client.js CHANGED
@@ -2389,14 +2389,14 @@ window.__ModuleLoader__.load({
2389
2389
  const STYLE_CSS = [
2390
2390
  // status dot pulse (panel)
2391
2391
  '@keyframes cabinetPulse{0%{box-shadow:0 0 0 0 rgba(34,197,94,.55)}70%{box-shadow:0 0 0 7px rgba(34,197,94,0)}100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}}',
2392
- // 走马灯边框(方案B 旋转大圆):卡自身 overflow:hidden 当裁窗,::before 用
2393
- // 家族色 conic 渐变大圆只转 transform(GPU 合成),卡内容 z-index 盖住中段,
2394
- // 只露出贴边的一段亮光在绕框跑。@property 在旧内核静默失效,故不用方案A。
2392
+ // A bounded dot follows the real running card perimeter. Unsupported engines
2393
+ // hide it, rather than painting a stationary/misplaced activity indicator.
2395
2394
  '[data-cabinet-sweep]{position:relative;overflow:hidden;border-radius:12px}',
2396
- '[data-cabinet-sweep]::before{content:"";position:absolute;inset:-60%;background:conic-gradient(from 0deg, transparent 0%, var(--cab-live-hue, rgba(127,127,127,.55)) 18%, transparent 42%);animation:cabinetSpin 2.4s linear infinite;will-change:transform;pointer-events:none}',
2395
+ '[data-cabinet-sweep]::before{content:"";position:absolute;top:0;left:0;width:6px;height:6px;border-radius:50%;background:var(--cab-live-hue, rgba(127,127,127,.55));box-shadow:0 0 6px var(--cab-live-hue, rgba(127,127,127,.55));offset-path:rect(0 100% 100% 0 round 12px);offset-distance:0%;animation:cabinetDotRun 2s linear infinite;will-change:offset-distance;pointer-events:none}',
2396
+ '@keyframes cabinetDotRun{to{offset-distance:100%}}',
2397
+ '@supports not (offset-path:rect(0 100% 100% 0 round 12px)){[data-cabinet-sweep]::before{display:none}}',
2397
2398
  '[data-cabinet-sweep] > *{position:relative;z-index:1}',
2398
- // cabinetSpin keyframes 上游已有(头像活动环 :2403 同名复用,勿重复定义)。
2399
- '@media (prefers-reduced-motion: reduce){[data-cabinet-sweep]::before{animation:none}}',
2399
+ '@media (prefers-reduced-motion: reduce){[data-cabinet-sweep]::before{animation:none!important;display:none}}',
2400
2400
  // 右栏拖拽手柄 hover 高亮(宽度可调,见 CABINET_RAIL_DEFAULT_WIDTH)。
2401
2401
  '[data-cabinet-rail-handle]:hover{background:rgba(79,140,255,.45)}',
2402
2402
  // running avatar: rotating conic ring (panel + native roster) and glow
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cabinet-mode",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
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",
@@ -0,0 +1,38 @@
1
+ import assert from 'node:assert/strict';import fs from 'node:fs';import vm from 'node:vm';let checks=0;
2
+ // Execute the actual headless runner with controlled browser failures. This
3
+ // verifies diagnostic cleanup only; it is not browser/layout acceptance.
4
+ const browserSource=fs.readFileSync(new URL('./test-groupchat-browser.mjs',import.meta.url),'utf8');
5
+ const headlessStart=browserSource.indexOf("if(process.argv.includes('--headless')){");
6
+ assert.notEqual(headlessStart,-1,'headless runner exists');
7
+ for(const scenario of [
8
+ {name:'normal screenshot',screenshots:1},
9
+ {name:'group assertion failure',fail:'group',screenshots:1},
10
+ {name:'keyboard assertion failure',fail:'keyboard',screenshots:1},
11
+ {name:'failed diagnostic screenshot preserves group error',fail:'group',badScreenshot:true,screenshots:1},
12
+ {name:'failed diagnostic screenshot preserves keyboard error',fail:'keyboard',badScreenshot:true,screenshots:1},
13
+ {name:'no screenshot configured',noScreenshot:true,screenshots:0},
14
+ {name:'no screenshot configured on assertion failure',fail:'group',noScreenshot:true,screenshots:0},
15
+ {name:'navigation failure before page load',fail:'goto',screenshots:0},
16
+ {name:'browser close failure preserves assertion and closes server',fail:'group',badClose:true,screenshots:1},
17
+ {name:'screenshot and browser close failures preserve assertion',fail:'keyboard',badScreenshot:true,badClose:true,screenshots:1},
18
+ {name:'browser close failure is reported without a primary error',badClose:true,screenshots:1},
19
+ ]){
20
+ const original=Error(scenario.name),closeError=Error('browser close failed'),shots=[];let evaluated=0,closed=0,serverClosed=0;
21
+ const page={on(){},async goto(){if(scenario.fail==='goto')throw original},
22
+ async evaluate(){if(++evaluated===1){if(scenario.fail==='group')throw original;return{passed:['fixture']}}if(evaluated===2)return ['mate'];return{}},
23
+ locator(){const node={first(){return node},last(){return node},async focus(){},async fill(){},async click(){},async press(){},async pressSequentially(){},async inputValue(){return 'fixture draft'}};return node},keyboard:{async press(){}},async waitForTimeout(){},
24
+ async waitForFunction(){if(scenario.fail==='keyboard')throw original},
25
+ async screenshot(options){shots.push(options);if(scenario.badScreenshot)throw Error('diagnostic screenshot failed')},
26
+ };
27
+ let caught;
28
+ try{await vm.runInNewContext('(async()=>{'+browserSource.slice(headlessStart)+'})()',{
29
+ process:{argv:['--headless'],env:{CHROME_PATH:'/fixture/chromium',...(!scenario.noScreenshot&&{CABINET_SCREENSHOT:'/fixture/evidence.png'})}},
30
+ require(){return{chromium:{async launch(){return{async newPage(){return page},async close(){closed++;if(scenario.badClose)throw closeError}}}}}},
31
+ server:{close(){serverClosed++}},url:'http://fixture.invalid',console:{log(){}},
32
+ })}catch(error){caught=error}
33
+ assert.equal(caught,scenario.fail?original:scenario.badClose?closeError:undefined,scenario.name+' preserves original outcome');
34
+ assert.equal(shots.length,scenario.screenshots,scenario.name+' screenshot attempts');
35
+ for(const shot of shots){assert.equal(shot.path,'/fixture/evidence.png');assert.equal(shot.fullPage,true)}
36
+ assert.equal(closed,1);assert.equal(serverClosed,1);checks++;console.log('PASS runner cleanup: '+scenario.name);
37
+ }
38
+ console.log('PASS group-chat regressions: '+checks);
@@ -871,11 +871,11 @@ assert.ok(String(taskMark.props.style.animation).includes('cabinetPulse'), 'the
871
871
  // keyframes 必须真的在 STYLE_CSS 里——只有 animation 没有 @keyframes 会被浏览器静默忽略。
872
872
  const pulseCss = Array.isArray(client.STYLE_CSS) ? client.STYLE_CSS.join('\n') : String(client.STYLE_CSS || '');
873
873
  assert.ok(pulseCss.includes('@keyframes cabinetPulse'), 'cabinetPulse keyframes are injected via STYLE_CSS (no silent-ignore)');
874
- assert.ok(pulseCss.includes('@keyframes cabinetSpin'), 'cabinetSpin keyframes are injected (the sweep must not silently ignore)');
875
- assert.ok(pulseCss.includes('[data-cabinet-sweep]::before') && pulseCss.includes('conic-gradient'), 'the border sweep is a conic-gradient rule scoped to the live marker');
876
- assert.ok(pulseCss.includes('cabinetSpin 2.4s linear infinite'), 'the sweep runs on the shared spin animation');
874
+ assert.ok(pulseCss.includes('@keyframes cabinetSpin'), 'cabinetSpin remains for the avatar ring');
875
+ assert.ok(pulseCss.includes('[data-cabinet-sweep]::before') && pulseCss.includes('offset-path:rect(0 100% 100% 0 round 12px)'), 'the border dot follows the rounded card perimeter');
876
+ assert.ok(pulseCss.includes('cabinetDotRun 2s linear infinite') && pulseCss.includes('@keyframes cabinetDotRun{to{offset-distance:100%}}'), 'the dot runs via offset distance');
877
877
  assert.ok(pulseCss.includes('prefers-reduced-motion'), 'the sweep stops under prefers-reduced-motion');
878
- assert.ok(pulseCss.includes('will-change:transform'), 'the sweep animates transform only (GPU compositing), will-change hinted');
878
+ assert.ok(pulseCss.includes('will-change:offset-distance'), 'the dot hints only its animated offset distance');
879
879
  assert.ok(pulseCss.includes('pointer-events:none'), 'the sweep layer never blocks card clicks');
880
880
  // 成本:宿主无 ¥ 数据源(tokenUsage 投影只有 4 个分项 token,无金额字段)——卡上不出现货币符号、不编数。
881
881
  const costProbe = elements(client.MemberCard({
@@ -90,7 +90,7 @@ document.getElementById('run').onclick=async()=>{const passed=[];try{
90
90
  mounted=true;live=false;render();await wait();document.getElementById('result').textContent='PASS '+passed.length+' '+passed.join('; ');stats();
91
91
  }catch(e){document.getElementById('result').textContent='FAIL '+e.stack;stats()}};
92
92
  window.taskNavigationCount=()=>opens.length;
93
- window.motionMount=async()=>{taskRoot.render(React.createElement(cabinet.MemberCard,{member:{id:'motion',name:'motion',phase:'active'},activeTask:{id:'motion-task',subject:'Running',status:'in_progress'},statusLabel:s=>s,t:k=>k}));await wait();};
93
+ window.motionMount=async(running=false)=>{taskRoot.render(React.createElement(cabinet.MemberCard,{member:{id:'motion',name:'motion',phase:'active'},running,activeTask:{id:'motion-task',subject:'Running',status:'in_progress'},statusLabel:s=>s,t:k=>k}));await wait();};
94
94
  window.taskKeyboardMount=async()=>{taskRoot.render(React.createElement(cabinet.TaskLine,{task:tasks[0],blockerOf:id=>tasks.find(t=>t.id===id),t:k=>cabinet.en[k]||k,taskLabel:s=>s,onOpenOwner:()=>opens.push(['mate'])}));await wait();return opens.length;};
95
95
  window.panelUnmount=async()=>{taskRoot.render(null);mounted=false;render();await wait();assert(timers.size===0,'final unmount cleanup');stats();return{timers:timers.size,errors};};
96
96
  render();stats();
@@ -156,6 +156,26 @@ if(process.argv.includes('--headless')){
156
156
  if(await mark.evaluate(el=>getComputedStyle(el).animationName)!=='none')throw Error('task pulse ignores reduced motion');
157
157
  await page.emulateMedia({reducedMotion:'no-preference'});
158
158
  if(await mark.evaluate(el=>getComputedStyle(el).animationName)!=='cabinetPulse')throw Error('task pulse failed to resume');
159
+ // Stale in-progress task alone must not animate an idle agent.
160
+ if(await page.locator('#task-fixture [data-cabinet-sweep]').count())throw Error('idle task falsely animates agent');
161
+ await page.evaluate(()=>window.motionMount(true));
162
+ const runningCard=page.locator('#task-fixture [data-cabinet-sweep]');
163
+ await runningCard.waitFor();
164
+ const supported=await page.evaluate(()=>CSS.supports('offset-path','rect(0 100% 100% 0 round 12px)'));
165
+ const motion=()=>runningCard.evaluate(el=>{const c=getComputedStyle(el,'::before');return {animation:c.animationName,display:c.display,path:c.offsetPath,pointer:c.pointerEvents}});
166
+ let normal=await motion();
167
+ if(supported){if(normal.animation!=='cabinetDotRun'||normal.path==='none'||normal.display==='none'||normal.pointer!=='none')throw Error('motion dot computed style');}
168
+ else if(normal.display!=='none')throw Error('unsupported native engine must hide dot');
169
+ await page.emulateMedia({reducedMotion:'reduce'});
170
+ const reduced=await motion();if(reduced.animation!=='none'||reduced.display!=='none')throw Error('motion dot ignores reduced motion');
171
+ await page.emulateMedia({reducedMotion:'no-preference'});
172
+ if(supported&&(await motion()).animation!=='cabinetDotRun')throw Error('motion dot does not resume');
173
+ // Exercise the exact fallback declaration through a deliberately unsupported
174
+ // feature query in an isolated stylesheet; not an unsupported-engine claim.
175
+ await page.evaluate(()=>{const rule=cabinet.STYLE_CSS.match(/@supports not \(offset-path:rect\(0 100% 100% 0 round 12px\)\)\{\[data-cabinet-sweep\]::before\{display:none\}\}/)?.[0];if(!rule)throw Error('missing unsupported fallback');const style=document.createElement('style');style.id='fallback-probe';style.textContent=rule.replace('offset-path:rect(0 100% 100% 0 round 12px)','cabinet-unsupported-probe:yes');document.head.append(style)});
176
+ if((await motion()).display!=='none')throw Error('unsupported fallback declaration not applied');
177
+ await page.evaluate(()=>document.getElementById('fallback-probe').remove());
178
+ if(supported&&(await motion()).display==='none')throw Error('fallback probe leaked');
159
179
  if(process.env.CABINET_SCREENSHOT)await page.screenshot({path:process.env.CABINET_SCREENSHOT,fullPage:true});
160
180
  const cleanup=await page.evaluate(()=>window.panelUnmount());
161
181
  if(errors.length||cleanup.errors.length)throw Error([...errors,...cleanup.errors].join('\n'));
@@ -385,7 +385,7 @@ if (existsSync(PATCH_PATH)) {
385
385
  }
386
386
 
387
387
  // ---------- fallback scripts ----------
388
- for (const test of ['test-member-settings.mjs', 'test-model-routing.mjs', 'test-model-picker.mjs', 'test-install.mjs', 'test-client.mjs', 'test-rail-redesign-regression.mjs', 'test-groupchat-reducer.mjs', 'test-groupchat-v2-regression.mjs', 'test-groupchat-lifecycle.mjs', 'test-client-inject.mjs', 'test-avatars.mjs', 'test-roster.mjs']) {
388
+ for (const test of ['test-member-settings.mjs', 'test-model-routing.mjs', 'test-model-picker.mjs', 'test-install.mjs', 'test-client.mjs', 'test-rail-redesign-regression.mjs', 'test-browser-runner-cleanup.mjs', 'test-groupchat-reducer.mjs', 'test-groupchat-v2-regression.mjs', 'test-groupchat-lifecycle.mjs', 'test-client-inject.mjs', 'test-avatars.mjs', 'test-roster.mjs']) {
389
389
  const result = spawnSync(process.execPath, [join(ROOT, 'scripts', test)], {
390
390
  encoding: 'utf8', timeout: 30000, windowsHide: true,
391
391
  });