dsh-engineering-ui 1.5.0 → 1.5.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🔧 DSH 工程模式 · Engineering Mode
2
2
 
3
- 在 DSH 的插件安装栏输入 `dsh-engineering-ui` 即可安装一体插件。它包含工程 UI、工程预设、SolidWorks 桥接工具和工程技能。DSH 提示重启或重新加载时按提示操作,首次加载会弹出已有的“如何使用”手册,之后可从工程模式卡片重新打开。
3
+ 在 DSH 的插件安装栏输入 `dsh-engineering-ui@1.5.1` 安装当前一体插件。它包含工程 UI、工程预设、SolidWorks 桥接工具和工程技能。DSH 提示重启或重新加载时按提示操作,首次加载会弹出已有的“如何使用”手册,之后可从工程模式卡片重新打开。
4
4
 
5
5
  本机仍需安装 SolidWorks 和带 pywin32 的 Python。首次使用在“设置 → 工程模式”确认程序路径。读图时,插件会引导 Flash 核对视图、尺寸落点和内部结构;信息不足时,可以集中请求指定方向、剖面或文字尺寸。
6
6
 
@@ -35,7 +35,7 @@ Windows 上若 `pwsh` 在执行第一条命令前报告 `grantWrite ... Win32 5`
35
35
  |------|-----|
36
36
  | 目标平台 | DeepSeek Harness **0.2.x**(Electron 桌面版 / `dsh web`) |
37
37
  | 预设 ID | `engineering` · 显示名「工程模式」· `order: 4` |
38
- | 一体插件 | `dsh-engineering-ui` **v1.5.0** |
38
+ | 一体插件 | `dsh-engineering-ui` **v1.5.1** |
39
39
  | 技能 | **7** 个 |
40
40
  | 门禁 / 桥接脚本 | **12** 个核心脚本 + **14** 个物理模块 |
41
41
  | 回归测试 | **30** 个 Python + **12** 个插件测试 |
@@ -679,39 +679,31 @@ window.__ModuleLoader__.load({
679
679
  // ── 【需求1】说明弹窗(两 Tab,外观照抄官方 PresetGuideDialog)────────
680
680
  '.eng-guide-mask{background:rgba(0,0,0,.45);border:0;box-sizing:border-box;bottom:0;left:0;position:fixed;right:0;top:0;'
681
681
  + 'margin:0;max-height:none;max-width:none;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:24px}',
682
- '.eng-guide-dlg{background:var(--dsw-alias-bg-base,#fff);border-radius:12px;'
682
+ '.eng-guide-dlg{background:var(--dsw-alias-bg-layer-1,Canvas);color:var(--dsw-alias-label-primary,CanvasText);border-radius:12px;'
683
683
  + 'box-shadow:0 12px 48px rgba(0,0,0,.28);display:flex;flex-direction:column;'
684
684
  + 'max-height:min(78vh,720px);max-width:640px;width:100%;overflow:hidden}',
685
685
  '.eng-guide-hd{align-items:flex-start;display:flex;gap:12px;padding:20px 22px 12px}',
686
686
  '.eng-guide-title{font-size:17px;font-weight:600}',
687
- '.eng-guide-intro{color:var(--dsw-alias-label-secondary,#5b6472);font-size:12.5px;'
687
+ '.eng-guide-intro{color:var(--dsw-alias-label-secondary,CanvasText);font-size:12.5px;'
688
688
  + 'line-height:1.6;margin-top:6px}',
689
- '.eng-guide-x{background:transparent;border:0;border-radius:6px;color:#8b95a3;cursor:pointer;'
689
+ '.eng-guide-x{background:transparent;border:0;border-radius:6px;color:var(--dsw-alias-label-secondary,CanvasText);cursor:pointer;'
690
690
  + 'flex:0 0 auto;font-size:20px;line-height:1;padding:2px 8px}',
691
- '.eng-guide-x:hover{background:var(--dsw-alias-bg-hover,rgba(127,127,127,.12));color:#1f2328}',
691
+ '.eng-guide-x:hover{background:var(--dsw-alias-bg-layer-3,Canvas);color:var(--dsw-alias-label-primary,CanvasText)}',
692
692
  '.eng-guide-tabs{display:flex;gap:6px;margin:0 22px 4px;'
693
- + 'background:var(--dsw-alias-bg-sunken,#f2f4f7);border-radius:8px;padding:3px}',
694
- '.eng-guide-tab{background:transparent;border:0;border-radius:6px;color:#5b6472;cursor:pointer;'
693
+ + 'background:var(--dsw-alias-bg-layer-2,Canvas);border-radius:8px;padding:3px}',
694
+ '.eng-guide-tab{background:transparent;border:0;border-radius:6px;color:var(--dsw-alias-label-secondary,CanvasText);cursor:pointer;'
695
695
  + 'flex:1 1 0;font-family:inherit;font-size:13px;padding:7px 10px;transition:background .12s}',
696
- '.eng-guide-tab.on{background:var(--dsw-alias-bg-base,#fff);color:#1f2328;font-weight:600;'
696
+ '.eng-guide-tab.on{background:var(--dsw-alias-bg-layer-3,Canvas);color:var(--dsw-alias-label-primary,CanvasText);font-weight:600;'
697
697
  + 'box-shadow:0 1px 3px rgba(0,0,0,.08)}',
698
698
  '.eng-guide-body{overflow-y:auto;padding:14px 22px 22px;font-size:13px;line-height:1.7}',
699
699
  '.eng-guide-h{font-size:14px;font-weight:600;margin:14px 0 8px}',
700
700
  '.eng-guide-h:first-child{margin-top:2px}',
701
- '.eng-guide-p{color:var(--dsw-alias-label-primary,#1f2328);margin:0 0 10px}',
702
- '.eng-guide-tag{background:var(--dsw-alias-bg-sunken,#f2f4f7);border-radius:5px;color:#5b6472;'
701
+ '.eng-guide-p{color:var(--dsw-alias-label-primary,CanvasText);margin:0 0 10px}',
702
+ '.eng-guide-tag{background:var(--dsw-alias-bg-layer-2,Canvas);border-radius:5px;color:var(--dsw-alias-label-secondary,CanvasText);'
703
703
  + 'display:inline-block;font-size:11px;margin:0 0 8px;padding:2px 7px}',
704
- '.eng-guide-quote{background:var(--dsw-alias-bg-sunken,#f7f8fa);'
705
- + 'border-left:3px solid var(--dsw-alias-brand-primary,#3b82f6);border-radius:6px;'
706
- + 'color:var(--dsw-alias-label-primary,#1f2328);margin:0 0 10px;padding:10px 12px}',
707
- // 深色模式适配(宿主用 .dark 类切换)
708
- '.dark .eng-guide-dlg{background:#1c1f24}',
709
- '.dark .eng-guide-title,.dark .eng-guide-h,.dark .eng-guide-p,.dark .eng-guide-quote{color:#e6e8eb}',
710
- '.dark .eng-guide-intro{color:#9aa4b2}',
711
- '.dark .eng-guide-tabs{background:#24282e}',
712
- '.dark .eng-guide-tag{background:#24282e;color:#9aa4b2}',
713
- '.dark .eng-guide-quote{background:#24282e}',
714
- '.dark .eng-guide-tab.on{background:#31363d}',
704
+ '.eng-guide-quote{background:var(--dsw-alias-bg-layer-2,Canvas);'
705
+ + 'border-left:3px solid var(--dsw-alias-border-l2,GrayText);border-radius:6px;'
706
+ + 'color:var(--dsw-alias-label-primary,CanvasText);margin:0 0 10px;padding:10px 12px}',
715
707
  '.dark .eng-help-btn:hover{color:#e6e8eb}',
716
708
  // ── 【需求1】注入到【预设卡片】上的按钮(对齐官方 cardHelp/helpButton)──
717
709
  // 官方:.cardFoot 用 flex 两端对齐,左侧 cardHelp(两个 ghost 按钮),
@@ -4409,6 +4401,12 @@ window.__ModuleLoader__.load({
4409
4401
  ref: dialogRef,
4410
4402
  className: 'eng-guide-mask',
4411
4403
  'aria-label': ENG_GUIDE.name,
4404
+ onKeyDownCapture: function (event) {
4405
+ if (event.key !== 'Escape') return;
4406
+ event.preventDefault();
4407
+ event.stopPropagation();
4408
+ if (typeof onClose === 'function') onClose();
4409
+ },
4412
4410
  onCancel: function (event) {
4413
4411
  event.preventDefault();
4414
4412
  if (typeof onClose === 'function') onClose();
@@ -549,6 +549,13 @@ export function apply(ctx) {
549
549
  if (baselineChanged) replaceRuntime(baselinePath, JSON.stringify(baseline, null, 2) + '\n');
550
550
  }
551
551
  const disposers = [];
552
+ function disposePlugin() {
553
+ try { if (_paPending && _paPending.size) flushPlatformAgents(); } catch (e) {}
554
+ for (const dispose of disposers.splice(0).reverse()) {
555
+ try { dispose(); } catch {}
556
+ }
557
+ }
558
+ ctx.effect(() => disposePlugin);
552
559
 
553
560
  // 文件令牌与路由必须使用本次插件实例的 findToolsDir。
554
561
  function localTokenOf() {
@@ -5623,11 +5630,5 @@ export function apply(ctx) {
5623
5630
  })));
5624
5631
 
5625
5632
 
5626
- return () => {
5627
- // 卸载前把待写记录落盘(尽力而为;失败也绝不能抛)
5628
- try { if (_paPending && _paPending.size) flushPlatformAgents(); } catch (e) {}
5629
- for (const dispose of disposers.reverse()) {
5630
- try { dispose(); } catch {}
5631
- }
5632
- };
5633
+ return disposePlugin;
5633
5634
  }
package/package.json CHANGED
@@ -1,66 +1,66 @@
1
- {
2
- "name": "dsh-engineering-ui",
3
- "version": "1.5.0",
4
- "description": "DeepSeek Harness 工程模式一体插件,包含工程 UI、SolidWorks 建模桥接、读图提示词和使用手册。",
5
- "license": "MIT",
6
- "type": "module",
7
- "main": "engineering/plugins/dsh-engineering-ui/lib/index.js",
8
- "exports": {
9
- ".": "./engineering/plugins/dsh-engineering-ui/lib/index.js",
10
- "./client": "./engineering/plugins/dsh-engineering-ui/lib/client.js",
11
- "./package.json": "./package.json",
12
- "./locale/*.json": "./engineering/plugins/dsh-engineering-ui/locale/*.json",
13
- "./icon": "./engineering/plugins/dsh-engineering-ui/icon.svg"
14
- },
15
- "icon": "./engineering/plugins/dsh-engineering-ui/icon.svg",
16
- "files": [
17
- "engineering/plugins/dsh-engineering-ui/lib/",
18
- "engineering/plugins/dsh-engineering-ui/locale/",
19
- "engineering/plugins/dsh-engineering-ui/icon.svg",
20
- "engineering/plugins/dsh-engineering-ui/cordis.patch.yml",
21
- "engineering/plugins/dsh-engineering-ui/preset-engineering.patch.yml",
22
- "engineering/skills/",
23
- "engineering/tools/*.py",
24
- "!engineering/tools/test*",
25
- "engineering/tools/ac_rules.json",
26
- "engineering/tools/cadx.lsp",
27
- "engineering/tools/LICENSE.Auto-SolidWorks",
28
- "engineering/tools/profile-manifest.ps1",
29
- "engineering/tools/solidworks-modeling.md",
30
- "engineering/tools/examples/*.py",
31
- "engineering/tools/physics/*.py",
32
- "!engineering/tools/physics/_test_imports.py",
33
- "engineering/tools/physics/*.json",
34
- "engineering/tools/physics/rules/*.json",
35
- "engineering/tools/webots_mcp/*.py"
36
- ],
37
- "dsh": {
38
- "manifestVersion": 1,
39
- "client": {
40
- "platform": "web",
41
- "inject": ["@deepseek-ai/dsh-client-ui-conversation"]
42
- },
43
- "bundle": {
44
- "patch": [
45
- "./engineering/plugins/dsh-engineering-ui/cordis.patch.yml",
46
- "./engineering/plugins/dsh-engineering-ui/preset-engineering.patch.yml"
47
- ]
48
- }
49
- },
50
- "peerDependencies": {
51
- "@deepseek-ai/cordis": "^4.0.1",
52
- "react": ">=18 <19"
53
- },
54
- "peerDependenciesMeta": {
55
- "@deepseek-ai/cordis": {"optional": true},
56
- "react": {"optional": true}
57
- },
58
- "engines": {
59
- "node": ">=22",
60
- "dsh": ">=0.2.0-rc.1 <0.3.0"
61
- },
62
- "repository": {
63
- "type": "git",
64
- "url": "git+https://github.com/chadqian2012-sudo/DSH-SolidWorks-MCP.git"
65
- }
66
- }
1
+ {
2
+ "name": "dsh-engineering-ui",
3
+ "version": "1.5.1",
4
+ "description": "DeepSeek Harness 工程模式一体插件,包含工程 UI、SolidWorks 建模桥接、读图提示词和使用手册。",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "engineering/plugins/dsh-engineering-ui/lib/index.js",
8
+ "exports": {
9
+ ".": "./engineering/plugins/dsh-engineering-ui/lib/index.js",
10
+ "./client": "./engineering/plugins/dsh-engineering-ui/lib/client.js",
11
+ "./package.json": "./package.json",
12
+ "./locale/*.json": "./engineering/plugins/dsh-engineering-ui/locale/*.json",
13
+ "./icon": "./engineering/plugins/dsh-engineering-ui/icon.svg"
14
+ },
15
+ "icon": "./engineering/plugins/dsh-engineering-ui/icon.svg",
16
+ "files": [
17
+ "engineering/plugins/dsh-engineering-ui/lib/",
18
+ "engineering/plugins/dsh-engineering-ui/locale/",
19
+ "engineering/plugins/dsh-engineering-ui/icon.svg",
20
+ "engineering/plugins/dsh-engineering-ui/cordis.patch.yml",
21
+ "engineering/plugins/dsh-engineering-ui/preset-engineering.patch.yml",
22
+ "engineering/skills/",
23
+ "engineering/tools/*.py",
24
+ "!engineering/tools/test*",
25
+ "engineering/tools/ac_rules.json",
26
+ "engineering/tools/cadx.lsp",
27
+ "engineering/tools/LICENSE.Auto-SolidWorks",
28
+ "engineering/tools/profile-manifest.ps1",
29
+ "engineering/tools/solidworks-modeling.md",
30
+ "engineering/tools/examples/*.py",
31
+ "engineering/tools/physics/*.py",
32
+ "!engineering/tools/physics/_test_imports.py",
33
+ "engineering/tools/physics/*.json",
34
+ "engineering/tools/physics/rules/*.json",
35
+ "engineering/tools/webots_mcp/*.py"
36
+ ],
37
+ "dsh": {
38
+ "manifestVersion": 1,
39
+ "client": {
40
+ "platform": "web",
41
+ "inject": ["@deepseek-ai/dsh-client-ui-conversation"]
42
+ },
43
+ "bundle": {
44
+ "patch": [
45
+ "./engineering/plugins/dsh-engineering-ui/cordis.patch.yml",
46
+ "./engineering/plugins/dsh-engineering-ui/preset-engineering.patch.yml"
47
+ ]
48
+ }
49
+ },
50
+ "peerDependencies": {
51
+ "@deepseek-ai/cordis": "^4.0.1",
52
+ "react": ">=18 <19"
53
+ },
54
+ "peerDependenciesMeta": {
55
+ "@deepseek-ai/cordis": {"optional": true},
56
+ "react": {"optional": true}
57
+ },
58
+ "engines": {
59
+ "node": ">=22",
60
+ "dsh": ">=0.2.0-rc.1 <0.3.0"
61
+ },
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/chadqian2012-sudo/DSH-SolidWorks-MCP.git"
65
+ }
66
+ }