@atlisp/mcp 1.8.29 → 1.8.30

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.
Binary file
@@ -4,6 +4,24 @@ import { log } from '../logger.js';
4
4
  import { withCadConnection, mcpSuccess, mcpError, escapeLispString } from '../handler-utils.js';
5
5
  import { analyzeLispCode } from '../lint-analyzer.js';
6
6
 
7
+ export async function openCad(platform = null) {
8
+ log(`open_cad called${platform ? ` (target: ${platform})` : ''}`);
9
+ try {
10
+ const connected = await cad.connect(platform);
11
+ if (!connected) {
12
+ return mcpError('未能打开或连接 CAD,请确保 CAD 已安装');
13
+ }
14
+ const platformName = cad.getPlatform();
15
+ const version = cad.getVersion();
16
+ await cad.bringToFront();
17
+ initAtlisp().catch(e => log(`open_cad: initAtlisp failed: ${e.message}`));
18
+ return mcpSuccess(`已打开 ${platformName} ${version} 并切换到前台`);
19
+ } catch (e) {
20
+ log('open_cad error: ' + e.message);
21
+ return mcpError(`打开 CAD 失败: ${e.message}`);
22
+ }
23
+ }
24
+
7
25
  export async function connectCad(platform = null) {
8
26
  log(`connect_cad called${platform ? ` (target: ${platform})` : ''}, cad.connected before: ${cad.connected}`);
9
27
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlisp/mcp",
3
- "version": "1.8.29",
3
+ "version": "1.8.30",
4
4
  "description": "MCP Server for @lisp on CAD,support AutoCAD/GstarCAD/ZWCAD/BricsCAD or CAD platform compatible with AutoLISP",
5
5
  "type": "module",
6
6
  "bin": {