lceda-connect 0.4.1 → 0.4.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +17 -3
  3. package/dist/{cli-CXk5pvVm.mjs → cli-D-PphUlG.mjs} +1 -1
  4. package/dist/{cli-DFqBHofJ.mjs → cli-D-kNq1F6.mjs} +2 -2
  5. package/dist/{cli-1_urvve3.mjs → cli-Dja1oai7.mjs} +4 -4
  6. package/dist/cli-bridge.mjs +1 -1
  7. package/dist/cli-cdp.mjs +1 -1
  8. package/dist/cli-mcp.mjs +1 -1
  9. package/dist/cli.mjs +1 -1
  10. package/dist/{config-BKbwyvsG.mjs → config-B3dElEFD.mjs} +3 -3
  11. package/dist/{discover-DmRYlAlR.mjs → discover-D-YAeRWh.mjs} +1 -1
  12. package/dist/{environment-Clx1-nDW.mjs → environment-MMVlAqxo.mjs} +1 -1
  13. package/dist/http-BNbYGS4p.mjs +1 -0
  14. package/dist/{http-Cdp6S2rm.mjs → http-C9RtNg_O.mjs} +2 -2
  15. package/dist/index.mjs +6 -6
  16. package/dist/{main-B3aaKvqY.mjs → main-CFHsfo5I.mjs} +84 -13
  17. package/dist/{registry-3WTFCZsR.mjs → registry-Be9DNS6F.mjs} +6 -6
  18. package/dist/registry-KmkmrusO.mjs +1 -0
  19. package/dist/{server-zw6t1Pmk.mjs → server-4ROmddm7.mjs} +2 -2
  20. package/dist/{session-AQbRX6Ys.mjs → session-BypD6Iab.mjs} +1 -1
  21. package/dist/{sideEffects-Ds_T-_B4.mjs → sideEffects-3OHHy4VU.mjs} +3 -3
  22. package/dist/stdio-Ji0B6uQT.mjs +1 -0
  23. package/dist/{stdio-BZPlcfDR.mjs → stdio-rNTpzX2t.mjs} +1 -1
  24. package/dist/{targets-8LBEgvbq.mjs → targets-DVmXbqhN.mjs} +1 -1
  25. package/dist/{verbs-DjQQTL2k.mjs → verbs-d3wbVcHt.mjs} +3 -3
  26. package/docs/environments.md +1 -1
  27. package/docs/quickstart.md +3 -3
  28. package/docs/transports.md +13 -11
  29. package/package.json +1 -1
  30. package/dist/http-D7sYy2y4.mjs +0 -1
  31. package/dist/registry-DdJ8LEdd.mjs +0 -1
  32. package/dist/stdio-Du1oLqfJ.mjs +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  本项目较重要的变更都记在这里。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号按 [语义化版本](https://semver.org/lang/zh-CN/) 走。
4
4
 
5
+ ## [0.4.2] - 2026-11-27
6
+
7
+ - 统一 CLI 调用约定:文档以 `lceda-connect` 为主体,明确免安装用 `npx -y lceda-connect`、全局安装后直接 `lceda-connect`;全局安装提供 `lceda-connect` / `lceda-cdp` / `lceda-bridge` / `lceda-mcp` 四个入口。
8
+ - 帮助输出补齐:全局帮助新增调用方式、安装命令、`help <命令组>` 与四个入口;新增 `help <命令组>` 路由,帮助优先于配置文件加载;MCP 帮助补充免安装写法。
9
+
5
10
  ## [0.4.1] - 2026-11-27
6
11
 
7
12
  - 修正默认组 `env` 路由测试对 bridge 自检退出码的假设,使 0.4.x 能在 CI 上通过并发布。
package/README.md CHANGED
@@ -16,6 +16,19 @@
16
16
  | `mcp` | 以 stdio / Streamable HTTP 运行 MCP;`mcp host` 可在 WSL 里拉起 Windows 侧实例 |
17
17
  | `env` | 执行环境自检:环境判定、客户端可执行文件、在线通道策略与配置来源 |
18
18
 
19
+ ## 安装与调用
20
+
21
+ 两种等价写法,选一种固定使用:
22
+
23
+ - **免安装**:`npx -y lceda-connect <命令组> <动作>`
24
+ - **全局安装**:`npm install -g lceda-connect`(或 `pnpm add -g lceda-connect`),之后 `lceda-connect <命令组> <动作>`
25
+
26
+ 全局安装同时提供 `lceda-connect`、`lceda-cdp`、`lceda-bridge`、`lceda-mcp` 四个入口;后三者分别是 `cdp`、`bridge`、`mcp serve` 的快捷方式。
27
+
28
+ 本文示例以 `lceda-connect` 为主体;未全局安装时在前面加 `npx -y`。MCP 客户端配置统一写 `npx -y lceda-connect mcp`,全局安装后可改成 `"command": "lceda-connect", "args": ["mcp"]`。
29
+
30
+ 完整帮助:`npx -y lceda-connect --help`、`npx -y lceda-connect help <命令组>`;全局安装后去掉 `npx -y`。
31
+
19
32
  ## Quick Start
20
33
 
21
34
  ### 1. 验证 npx 与 stdio MCP
@@ -56,7 +69,8 @@ MCP 进程和 EasyEDA 是否在同一网络命名空间,决定在线工具能
56
69
  { "command": "npx", "args": ["-y", "lceda-connect", "mcp", "host", "--start-client", "--port", "9333"] }
57
70
 
58
71
  // B. Windows 常驻 Streamable HTTP,WSL 客户端连虚拟网卡地址
59
- // 先在 Windows 执行:lceda-mcp http --host wsl --port 3939 --token my-secret
72
+ // 先在 Windows 执行:lceda-connect mcp http --host wsl --port 3939 --token my-secret
73
+ // (全局安装后的写法;未安装用 npx -y lceda-connect mcp http ...)
60
74
  // 只有 `mcp http` 会启动 HTTP;非回环绑定强制要求 token
61
75
  { "type": "http", "url": "http://<宿主WSL网卡IP>:3939/mcp",
62
76
  "headers": { "Authorization": "Bearer my-secret" } }
@@ -153,7 +167,7 @@ claude mcp add --scope project --transport stdio lceda -- npx -y lceda-connect m
153
167
 
154
168
  ## MCP 服务
155
169
 
156
- 全局安装后也可以直接写 `"command": "lceda-mcp"`。不做全局安装时,等价的独立入口是 `npx --yes --package=lceda-connect -- lceda-mcp`,同样接受 `--toolsets`。工具清单用 `lceda-connect mcp tools`。接口约定:
170
+ MCP 客户端推荐 `"command": "npx", "args": ["-y", "lceda-connect", "mcp"]`;全局安装后可改成 `"command": "lceda-connect", "args": ["mcp"]`,或使用快捷入口 `lceda-mcp`。工具清单用 `npx -y lceda-connect mcp tools`。接口约定:
157
171
 
158
172
  - 写操作(在编辑器里执行代码、自动布线、建工程、调用外部脚本)默认不执行,要传 `confirm: true`。`cdp_eval` 只放行能确认为只读的表达式(如 `getX` / `listX` 一类查询调用和普通 DOM 读取),其余都要 `confirm: true`;旧参数 `allowSideEffects` 作为弃用别名保留。
159
173
  - 返回对象的工具同时给出 `structuredContent`。
@@ -161,7 +175,7 @@ claude mcp add --scope project --transport stdio lceda -- npx -y lceda-connect m
161
175
  - 随包发布的 SKILL.md 与 references 以 `lceda://skills/{+path}` 资源模板提供,也可用 `skill_docs` 工具读取。
162
176
  - 写路径只允许在客户端声明的 roots、`LCEDA_ALLOWED_ROOTS` 和默认根(当前目录、系统临时目录、connect home)之内,越界报 `PATH_NOT_ALLOWED`。读路径不受限制。
163
177
  - 支持请求取消(报 `CANCELLED`);`sim_run`、`eprj3_gates` 等长任务会发送进度通知。
164
- - 传输模式:stdio(默认)、Streamable HTTP(`lceda-mcp http --host 127.0.0.1 --port 3939`,默认只绑回环)、WSL→Windows stdio(`lceda-connect mcp host`)。HTTP 支持 Bearer token、`/health` 与 `--stateless`;详见 [docs/transports.md](docs/transports.md)。
178
+ - 传输模式:stdio(默认)、Streamable HTTP(`lceda-connect mcp http --host 127.0.0.1 --port 3939`,默认只绑回环)、WSL→Windows stdio(`lceda-connect mcp host`)。HTTP 支持 Bearer token、`/health` 与 `--stateless`;详见 [docs/transports.md](docs/transports.md)。
165
179
  - 工具集可裁剪:`lceda-connect mcp --toolsets offline,eda`,或设置 `LCEDA_TOOLSETS`。可选 `core` / `offline` / `live`,以及 `cdp`、`bridge`、`eda`、`api`、`format`、`epro2`、`eprj3`、`sim`;`core` 总是保留。
166
180
 
167
181
  ## 执行环境(Windows / WSL2 / Linux / macOS)
@@ -1,5 +1,5 @@
1
1
  import { a as parseArgs, n as boolValue, o as stringValue } from "./cliArgs-BI3bJgCZ.mjs";
2
- import { c as probeUiShell, i as evaluateExpression, t as CdpSession } from "./session-AQbRX6Ys.mjs";
2
+ import { c as probeUiShell, i as evaluateExpression, t as CdpSession } from "./session-BypD6Iab.mjs";
3
3
  import { a as readZip, i as looksLikeZip, n as crc32, t as ZipError } from "./zip-CAd_yYte.mjs";
4
4
  import { tmpdir } from "node:os";
5
5
  import path from "node:path";
@@ -1,8 +1,8 @@
1
1
  import { a as parseArgs, i as numberValue, n as boolValue, o as stringValue, r as formatOptions, t as CliUsageError } from "./cliArgs-BI3bJgCZ.mjs";
2
- import { i as loadConfig } from "./config-BKbwyvsG.mjs";
2
+ import { i as loadConfig } from "./config-B3dElEFD.mjs";
3
3
  import { c as liveStrategy, r as describeEnvironment } from "./environment-BegP0n2N.mjs";
4
4
  import { n as paint, t as hr } from "./term-DlGIoccA.mjs";
5
- import { a as routeNets, c as EdaVerbError, d as capabilitySummary, f as lookupCapability, i as readBoardState, l as createDefaultExecContext, n as docInfo, o as routeNetsPreview, r as evalApi, s as runDrc, t as boardDigestState, u as checkEnvironment } from "./verbs-DjQQTL2k.mjs";
5
+ import { a as routeNets, c as EdaVerbError, d as capabilitySummary, f as lookupCapability, i as readBoardState, l as createDefaultExecContext, n as docInfo, o as routeNetsPreview, r as evalApi, s as runDrc, t as boardDigestState, u as checkEnvironment } from "./verbs-d3wbVcHt.mjs";
6
6
  import { readFileSync } from "node:fs";
7
7
  // src/eda/cli.ts
8
8
  /**
@@ -1,9 +1,9 @@
1
1
  import { a as parseArgs, i as numberValue, n as boolValue, o as stringValue, r as formatOptions, t as CliUsageError } from "./cliArgs-BI3bJgCZ.mjs";
2
2
  import { n as paint, t as hr } from "./term-DlGIoccA.mjs";
3
- import { a as cdpInputActionSchema, c as listDocuments, i as screenshotToFile, l as openDocument, n as firstSideEffectPattern, o as sendCdpInput, p as pickPage, r as hasSideEffects, s as activeDocument, u as Board } from "./sideEffects-Ds_T-_B4.mjs";
4
- import { _ as CdpError, a as defaultPortFromEnv, d as profileLabel, g as versionWebSocketUrl, h as versionBrowser, m as resolveEndpoint, o as discover, p as requireLoopbackHost, r as attributionOf, s as endpointUrl, u as parsePortRange, v as asCdpError } from "./discover-DmRYlAlR.mjs";
5
- import { a as evaluateInContext, l as redact, n as EvalUsageError, o as planEval, t as CdpSession } from "./session-AQbRX6Ys.mjs";
6
- import { i as listTargets, n as flattenFrameTree, r as formatFrameTree, t as fetchFrameTree } from "./targets-8LBEgvbq.mjs";
3
+ import { a as cdpInputActionSchema, c as listDocuments, i as screenshotToFile, l as openDocument, n as firstSideEffectPattern, o as sendCdpInput, p as pickPage, r as hasSideEffects, s as activeDocument, u as Board } from "./sideEffects-3OHHy4VU.mjs";
4
+ import { _ as CdpError, a as defaultPortFromEnv, d as profileLabel, g as versionWebSocketUrl, h as versionBrowser, m as resolveEndpoint, o as discover, p as requireLoopbackHost, r as attributionOf, s as endpointUrl, u as parsePortRange, v as asCdpError } from "./discover-D-YAeRWh.mjs";
5
+ import { a as evaluateInContext, l as redact, n as EvalUsageError, o as planEval, t as CdpSession } from "./session-BypD6Iab.mjs";
6
+ import { i as listTargets, n as flattenFrameTree, r as formatFrameTree, t as fetchFrameTree } from "./targets-DVmXbqhN.mjs";
7
7
  // src/cdp/cli.ts
8
8
  /**
9
9
  * `lceda-connect cdp-client <动作>` 的实现(源仓库 lceda_cdp.py 的 CLI 部分)。
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as main } from "./main-B3aaKvqY.mjs";
2
+ import { t as main } from "./main-CFHsfo5I.mjs";
3
3
  // src/cli-bridge.ts
4
4
  process.exitCode = await main({
5
5
  argv: process.argv.slice(2),
package/dist/cli-cdp.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as main } from "./main-B3aaKvqY.mjs";
2
+ import { t as main } from "./main-CFHsfo5I.mjs";
3
3
  // src/cli-cdp.ts
4
4
  process.exitCode = await main({
5
5
  argv: process.argv.slice(2),
package/dist/cli-mcp.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as main } from "./main-B3aaKvqY.mjs";
2
+ import { t as main } from "./main-CFHsfo5I.mjs";
3
3
  // src/cli-mcp.ts
4
4
  process.exitCode = await main({ argv: ["mcp", ...process.argv.slice(2)] });
5
5
  export {};
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as main } from "./main-B3aaKvqY.mjs";
2
+ import { t as main } from "./main-CFHsfo5I.mjs";
3
3
  // src/cli.ts
4
4
  process.exitCode = await main({ argv: process.argv.slice(2) });
5
5
  export {};
@@ -42,9 +42,9 @@ function pushCandidate(list, seen, candidate) {
42
42
  function expandMacAppBundle(value) {
43
43
  if (!value.toLowerCase().endsWith(".app")) return [];
44
44
  return [
45
- path.join(value, "Contents", "MacOS", "lceda-pro"),
46
- path.join(value, "Contents", "MacOS", "EasyEDA Pro"),
47
- path.join(value, "Contents", "MacOS", "EasyEDA")
45
+ path.posix.join(value, "Contents", "MacOS", "lceda-pro"),
46
+ path.posix.join(value, "Contents", "MacOS", "EasyEDA Pro"),
47
+ path.posix.join(value, "Contents", "MacOS", "EasyEDA")
48
48
  ];
49
49
  }
50
50
  function windowsNativeCandidates(env) {
@@ -1,4 +1,4 @@
1
- import { r as homeDir } from "./config-BKbwyvsG.mjs";
1
+ import { r as homeDir } from "./config-B3dElEFD.mjs";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs";
4
4
  // src/cdp/errors.ts
@@ -1,4 +1,4 @@
1
- import { i as loadConfig } from "./config-BKbwyvsG.mjs";
1
+ import { i as loadConfig } from "./config-B3dElEFD.mjs";
2
2
  import { c as liveStrategy, r as describeEnvironment } from "./environment-BegP0n2N.mjs";
3
3
  import { a as parseArgs, n as boolValue } from "./cliArgs-BI3bJgCZ.mjs";
4
4
  import { n as paint, t as hr } from "./term-DlGIoccA.mjs";
@@ -0,0 +1 @@
1
+ export { a as startHttpTransport } from "./http-C9RtNg_O.mjs";
@@ -1,7 +1,7 @@
1
- import { i as loadConfig } from "./config-BKbwyvsG.mjs";
1
+ import { i as loadConfig } from "./config-B3dElEFD.mjs";
2
2
  import { o as isLoopbackAddress } from "./environment-BegP0n2N.mjs";
3
3
  import { t as packageVersion } from "./version-B39-elun.mjs";
4
- import { r as createServerFactory, t as SERVER_NAME } from "./server-zw6t1Pmk.mjs";
4
+ import { r as createServerFactory, t as SERVER_NAME } from "./server-4ROmddm7.mjs";
5
5
  import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
6
6
  import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js";
7
7
  import { createServer } from "node:http";
package/dist/index.mjs CHANGED
@@ -1,20 +1,20 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
2
- import { i as loadConfig, n as DEFAULT_PRO_EXE, t as DEFAULT_CDP_PORT } from "./config-BKbwyvsG.mjs";
3
- import { n as runCdpAction, r as runBridgeAction, t as main } from "./main-B3aaKvqY.mjs";
2
+ import { i as loadConfig, n as DEFAULT_PRO_EXE, t as DEFAULT_CDP_PORT } from "./config-B3dElEFD.mjs";
3
+ import { n as runCdpAction, r as runBridgeAction, t as main } from "./main-CFHsfo5I.mjs";
4
4
  import { t as packageVersion } from "./version-B39-elun.mjs";
5
5
  import { $ as docsOf, A as buildGeometry, B as buildDevices, C as compare, D as summarize, E as stripVolatile, F as padNetKey, G as num, H as buildSymbols, I as padNetMap, J as transformPin, K as placementOf, L as pcbDocs, M as componentMeta, N as formatNetlistCsv, O as MIL_TO_MM, P as naturalKey, Q as docTitle, R as polyPoints, S as VOLATILE_KEYS, T as diffRecords, U as componentType, V as buildFootprints, W as deviceUuidOf, X as attrMap, Y as valueLike, Z as docElements, _ as pointKey, a as findFloating, at as pythonJson, b as renderReport, c as runSingle, ct as Project, d as writeText, et as flatMap, f as TOL, g as pinKey, h as pageToIr, i as duplicateDesignators, it as parseRecords, j as buildNetlist, k as asId, l as slug, lt as ProjectError, m as onSegment, n as checkConsistency, nt as makeRecordKey, o as inspectProject, ot as splitRecordKey, p as buildNets, q as text, r as collect, rt as normId, s as runDiff, st as scalarText, t as analyzeSummary, tt as isPlainRecord, u as writeJson, ut as openProject, v as splitPinKey, w as diffNetlist, x as NOISE_TYPES, y as validate, z as rotate } from "./analyze-TRlZx-Jv.mjs";
6
6
  import { n as runEpro2Command, t as epro2Help } from "./cli-CZmNLW3Q.mjs";
7
7
  import { a as readZip, i as looksLikeZip, n as crc32, o as cp437TextToBytes, r as extractEntry, s as decodeMemberName, t as ZipError } from "./zip-CAd_yYte.mjs";
8
- import { C as epro2Tools, D as reportTool, E as pcbNetlistTool, O as schematicNetsTool, S as diffTool, T as pcbGeometryTool, _ as eprj3NetlistTool, a as metricsTool, b as eprj3ValidateTool, c as runTool, d as stackupTool, f as touchstoneTool, g as eprj3InspectTool, h as eprj3GatesTool, l as sidecarTool, m as eprj3EditTool, o as netlistTool, p as eprj3BuildTool, s as probeTool, t as allTools, u as simTools, v as eprj3ReadRecordsTool, w as inspectTool, x as crosscheckTool, y as eprj3Tools } from "./registry-3WTFCZsR.mjs";
8
+ import { C as epro2Tools, D as reportTool, E as pcbNetlistTool, O as schematicNetsTool, S as diffTool, T as pcbGeometryTool, _ as eprj3NetlistTool, a as metricsTool, b as eprj3ValidateTool, c as runTool, d as stackupTool, f as touchstoneTool, g as eprj3InspectTool, h as eprj3GatesTool, l as sidecarTool, m as eprj3EditTool, o as netlistTool, p as eprj3BuildTool, s as probeTool, t as allTools, u as simTools, v as eprj3ReadRecordsTool, w as inspectTool, x as crosscheckTool, y as eprj3Tools } from "./registry-Be9DNS6F.mjs";
9
9
  import { n as runEprj3Command, t as eprj3HelpLines } from "./cli-ZuAl89m5.mjs";
10
10
  import { $ as stripBom, A as findIndexFile, B as formatRecord, C as round, D as documentFiles, E as describeDocumentFile, F as resolveProjectPath, G as readDocumentFile, H as metaOf, I as schematicDir, J as readTextBomSafe, K as readLines, L as sheetFile, M as loadEprj3Project, N as panelFile, O as ecfgFile, P as pcbFile, Q as splitDocumentLines, R as clientIdFrom, S as rotate$1, T as Eprj3ProjectError, U as normalizeRecordId, V as isDocHeadLine, W as parseRecord, X as reduceKey, Y as reduceDocSection, Z as reduceRecords, _ as parseSymbolEntry, a as EPRJ3_SCRIPTS, b as pointSegDist, c as eprj3ScriptsDir, d as isEprj3ScriptName, f as listEprj3Scripts, g as netlistProject, h as netKey, i as EPRJ3_GATE_NAMES, j as inspectEprj3Project, k as evarFile, l as eprj3SidecarDir, m as runEprj3Script, n as EPRJ3_EDIT_OPS, o as EPRJ3_SIDECAR_TIMEOUT_MS, p as resolveEprj3ScriptPath, q as readRecords, r as EPRJ3_GATES, s as eprj3GateArgs, t as validateEprj3Project, u as isEprj3EditOp, v as pcbNetlist, w as sheetNetlist, x as readSheet, y as pinTip, z as docTypeNumber } from "./validate-COx5r3o4.mjs";
11
11
  import { _ as loadSchema, a as validateOuter, b as applyRelaxations, c as validateSchema, d as hasSchema, f as isKnownDocType, g as loadRegistry, h as loadOuterSchema, i as validateLine, l as clearFormatCaches, m as knownDocTypes, n as parseRecordLine, o as describeValue, p as isRegisteredPair, r as validateFormat, s as typeOfValue, t as RecordParseError, u as formatAssetsRoot, v as resolveSchemaKey, x as relaxationRules, y as schemaRelativePath } from "./record-CHXWiMWA.mjs";
12
12
  import { a as getPrimitive, i as getFormatLog, n as getDocument, o as listTypes, r as getExample, s as schemaAssetPath, t as formatAssetsPresent } from "./knowledge-CX8Hrnoe.mjs";
13
13
  import { n as simHelp, t as runSimCommand } from "./cli-C8-HjAP0.mjs";
14
14
  import { $ as parseRawBuffer, $t as ROLE_VOCAB, A as listSimSidecarScripts, At as generateNetlist, B as fidelityLines, Bt as fmt, C as stackupSummaryLines, Cn as SimError, Ct as pinNetTableOf, D as viaParasitics, Dt as NetlistBuilder, E as traceSummaryLine, Et as validateIr, F as simSidecarDir, Ft as ParasiticError, G as DECK_DEFAULT_ARGS, Gt as resistor, H as manifestSummaryLines, Ht as formatSignificant, I as readNetlistFile, It as capacitor, J as cleanNetlist, Jt as transmissionLine, K as DeckError, Kt as seriesChain, L as runSimulation, Lt as capacitorModel, M as pythonCandidates, Mt as parseVoltage, N as resolveSimSidecarScript, Nt as sanitizeDes, O as viaSummaryLine, Ot as buildPinNetTable, P as runSimSidecar, Pt as NetCtx, Q as parseRawBinary, Qt as ModelResolver, R as LEVEL_NAMES, Rt as connectorModel, S as stackupFileExists, Sn as spiceNode, St as normalizeIr, T as traceParams, Tt as saveSimIr, U as ngspiceVersion, Ut as inductor, V as fileHash, Vt as fmtTime, W as writeManifest, Wt as parseEng, X as RawParseError, Xt as waveformText, Y as hasControlBlock, Yt as viaModel, Z as parseRawAscii, Zt as MappingError, _ as VIA_FIDELITY, _n as resolvePath, _t as cleanValue, a as loadTouchstoneOrNone, an as GroundMapError, at as metricSummaryLine, b as estimateVias, bn as simSkillDocsDir, bt as loadSimIr, c as touchstoneMetrics, cn as Namer, ct as NgspiceError, d as DEFAULT_ANTIPAD_CLEARANCE_MM, dn as deepMerge, dt as ngspiceCandidates, en as parseModelNames, et as parseRawFile, f as ExtractError, fn as displayNode, ft as ngspiceExists, g as TRACE_FIDELITY, gn as quotePath, gt as runNgspiceBatch, h as StackupError, hn as loadSimConfig, ht as resolveExecutable, i as impedance1Port, in as GroundMap, it as findVar, j as probePython, jt as loadModelLibrary, k as SIDECAR_TIMEOUT_MS, kt as designatorPrefix, l as COPPER_RESISTIVITY, ln as SKILL_VERSION, lt as findNgspiceSync, m as Stackup, mn as loadJsonFile, mt as probeNgspice, n as TouchstoneError, nn as provenanceText, nt as MetricError, o as parseTouchstone, on as isGroundLike, ot as NGSPICE_PROBE_TIMEOUT_MS, p as PLATING_THICKNESS_MM, pn as isVirtual, pt as parseNgspiceVersion, q as buildDeck, qt as tdFromLength, r as dbOf, rn as DEFAULT_ZERO_NETS, rt as computeMetrics, s as touchstoneLoss, sn as DEFAULTS, st as NGSPICE_RUN_TIMEOUT_MS, t as Touchstone, tn as parseSubcktPins, tt as plotsToCsv, u as C_PS_PER_MM, un as VIRTUAL_PREFIXES, ut as getNgspiceVersion, v as estimateGeometryTrace, vn as simModelsDir, vt as fromEpro2File, w as striplineZ0, wn as asText, wt as roundCoord, x as microstripZ0, xn as spiceIdent, xt as newSimIr, y as estimateNetTrace, yn as simScriptsDir, yt as fromSchematicIr, z as buildManifest, zt as ferriteModel } from "./touchstone-D4Fdg4Om.mjs";
15
- import { n as createServer, r as createServerFactory } from "./server-zw6t1Pmk.mjs";
16
- import { n as startStdioTransport, t as serveStdio } from "./stdio-BZPlcfDR.mjs";
17
- import { a as startHttpTransport } from "./http-Cdp6S2rm.mjs";
15
+ import { n as createServer, r as createServerFactory } from "./server-4ROmddm7.mjs";
16
+ import { n as startStdioTransport, t as serveStdio } from "./stdio-rNTpzX2t.mjs";
17
+ import { a as startHttpTransport } from "./http-C9RtNg_O.mjs";
18
18
  import { n as defineTool, t as ToolError } from "./types-D5d7ZRYF.mjs";
19
19
  // src/epro2/index.ts
20
20
  var epro2_exports = /* @__PURE__ */ __exportAll({
@@ -1,10 +1,10 @@
1
1
  import { a as parseArgs, i as numberValue, n as boolValue, o as stringValue, r as formatOptions, t as CliUsageError } from "./cliArgs-BI3bJgCZ.mjs";
2
- import { i as loadConfig, r as homeDir } from "./config-BKbwyvsG.mjs";
2
+ import { i as loadConfig, r as homeDir } from "./config-B3dElEFD.mjs";
3
3
  import { n as paint, t as hr } from "./term-DlGIoccA.mjs";
4
4
  import { t as packageVersion } from "./version-B39-elun.mjs";
5
5
  import { a as packageRoot } from "./assets-D48xh-kr.mjs";
6
6
  import { t as run } from "./exec-FuC8m-_m.mjs";
7
- import { l as parseBrowserUuidLine } from "./discover-DmRYlAlR.mjs";
7
+ import { l as parseBrowserUuidLine } from "./discover-D-YAeRWh.mjs";
8
8
  import { o as isLoopbackAddress, r as describeEnvironment } from "./environment-BegP0n2N.mjs";
9
9
  import os from "node:os";
10
10
  import path from "node:path";
@@ -2434,6 +2434,7 @@ function mcpHelp() {
2434
2434
  paint.cyan(" lceda-connect mcp -- MCP 服务(stdio / streamable-http / WSL→Windows)"),
2435
2435
  paint.gray(` ${hr()}`),
2436
2436
  " 用法: lceda-connect mcp [动作] [选项] (也可直接用 lceda-mcp)",
2437
+ " 免安装: npx -y lceda-connect mcp [动作]",
2437
2438
  "",
2438
2439
  paint.white(" 动作:"),
2439
2440
  " serve 以 stdio 运行 MCP 服务(默认动作,给 MCP 客户端调用)",
@@ -2493,7 +2494,7 @@ async function runMcpGroup(argv, io, env, runtime) {
2493
2494
  if (requested.length > 0) io.err(paint.yellow(` ! 检测到 HTTP 参数(${requested.join(", ")}),但当前动作是 ${action};未启动 HTTP 服务。需要 HTTP 请显式运行 \`mcp http\``));
2494
2495
  }
2495
2496
  if (action === "tools") {
2496
- const { toolsForEnv } = await import("./registry-DdJ8LEdd.mjs");
2497
+ const { toolsForEnv } = await import("./registry-KmkmrusO.mjs");
2497
2498
  try {
2498
2499
  for (const tool of toolsForEnv(effectiveEnv, selected)) io.out(`${paint.cyan(tool.name.padEnd(28))} ${tool.description.split("。")[0] ?? ""}`);
2499
2500
  return 0;
@@ -2507,7 +2508,7 @@ async function runMcpGroup(argv, io, env, runtime) {
2507
2508
  io.err(paint.red(` 多余的参数: ${extras.join(" ")}`));
2508
2509
  return 1;
2509
2510
  }
2510
- const { serveStdio } = await import("./stdio-Du1oLqfJ.mjs");
2511
+ const { serveStdio } = await import("./stdio-Ji0B6uQT.mjs");
2511
2512
  try {
2512
2513
  const cfg = loadConfig(effectiveEnv);
2513
2514
  io.err(paint.gray(` 环境: ${describeEnvironment(cfg.environment)}` + (runtime?.configPath ? ` · 配置 ${runtime.configPath}` : "") + (runtime?.envFilePath ? ` · .env ${runtime.envFilePath}` : "")));
@@ -2549,7 +2550,7 @@ async function runMcpGroup(argv, io, env, runtime) {
2549
2550
  io.err(paint.red(" 绑定非回环地址时必须提供 Bearer token(--token / LCEDA_HTTP_TOKEN / 配置 mcp.http.token);已拒绝启动 HTTP 服务"));
2550
2551
  return 1;
2551
2552
  }
2552
- const { startHttpTransport } = await import("./http-D7sYy2y4.mjs");
2553
+ const { startHttpTransport } = await import("./http-BNbYGS4p.mjs");
2553
2554
  try {
2554
2555
  const handle = await startHttpTransport({
2555
2556
  env: effectiveEnv,
@@ -2712,6 +2713,12 @@ function globalHelp() {
2712
2713
  paint.gray(` ${hr()}`),
2713
2714
  " 用法: lceda-connect <命令组> <动作> [选项]",
2714
2715
  "",
2716
+ paint.white(" 调用方式:"),
2717
+ " 免安装: npx -y lceda-connect <命令组> <动作>",
2718
+ " 全局安装: npm install -g lceda-connect (或 pnpm add -g lceda-connect)",
2719
+ " lceda-connect <命令组> <动作>",
2720
+ " 别名: lceda-cdp / lceda-bridge / lceda-mcp(仅全局安装后提供)",
2721
+ "",
2715
2722
  paint.white(" 命令组:"),
2716
2723
  " cdp 带 CDP 调试端口启动 / 管理立创EDA专业版",
2717
2724
  " bridge EasyEDA AI Bridge 服务管理",
@@ -2723,11 +2730,16 @@ function globalHelp() {
2723
2730
  " lceda-bridge <动作> 等价于 lceda-connect bridge <动作>",
2724
2731
  " lceda-mcp 等价于 lceda-connect mcp serve",
2725
2732
  "",
2733
+ paint.white(" 帮助:"),
2734
+ " lceda-connect help <命令组> 查看单个命令组的完整帮助",
2735
+ " lceda-connect <命令组> --help 同上",
2736
+ "",
2726
2737
  paint.white(" 例子:"),
2727
- " npx lceda-connect cdp start",
2728
- " npx lceda-connect bridge status --json",
2729
- " npx lceda-cdp endpoint",
2730
- " npx lceda-bridge logs --follow",
2738
+ " npx -y lceda-connect cdp start",
2739
+ " npx -y lceda-connect bridge status --json",
2740
+ " npx -y lceda-connect env",
2741
+ " npx -y lceda-connect mcp tools",
2742
+ " lceda-connect help mcp # 全局安装后",
2731
2743
  "",
2732
2744
  paint.white(" 全局选项:"),
2733
2745
  " --version, -v 打印版本",
@@ -2808,12 +2820,12 @@ const DOMAIN_GROUPS = [
2808
2820
  {
2809
2821
  name: "env",
2810
2822
  summary: "执行环境、客户端路径与在线通道策略自检(auto / windows-native / wsl2 / linux / macos)",
2811
- load: async () => (await import("./environment-Clx1-nDW.mjs")).runEnvironmentCommand
2823
+ load: async () => (await import("./environment-MMVlAqxo.mjs")).runEnvironmentCommand
2812
2824
  },
2813
2825
  {
2814
2826
  name: "extension",
2815
2827
  summary: "预检 .eext;在隔离的可见客户端安装、卸载扩展(实验性,仅 CLI)",
2816
- load: async () => (await import("./cli-CXk5pvVm.mjs")).runExtensionCommand
2828
+ load: async () => (await import("./cli-D-PphUlG.mjs")).runExtensionCommand
2817
2829
  },
2818
2830
  {
2819
2831
  name: "api",
@@ -2838,7 +2850,7 @@ const DOMAIN_GROUPS = [
2838
2850
  {
2839
2851
  name: "eda",
2840
2852
  summary: "编辑器动词:双通道自检、读板、DRC、板指纹、自动布线、动词台账检索",
2841
- load: async () => (await import("./cli-DFqBHofJ.mjs")).runEdaCommand
2853
+ load: async () => (await import("./cli-D-kNq1F6.mjs")).runEdaCommand
2842
2854
  },
2843
2855
  {
2844
2856
  name: "sim",
@@ -2883,6 +2895,60 @@ function findGroupIndex(argv) {
2883
2895
  function print(io, lines) {
2884
2896
  for (const line of lines) io.out(line);
2885
2897
  }
2898
+ async function showGroupHelp(target, io, env) {
2899
+ const name = (target ?? "").trim().toLowerCase();
2900
+ if (!name) {
2901
+ print(io, globalHelp());
2902
+ return 0;
2903
+ }
2904
+ if (name === "cdp") {
2905
+ print(io, cdpHelp());
2906
+ return 0;
2907
+ }
2908
+ if (name === "bridge") {
2909
+ print(io, bridgeHelp());
2910
+ return 0;
2911
+ }
2912
+ if (name === "mcp") {
2913
+ print(io, mcpHelp());
2914
+ return 0;
2915
+ }
2916
+ const domain = DOMAIN_GROUPS.find((group) => group.name === name);
2917
+ if (domain) return await (await domain.load())(["--help"], io, env);
2918
+ io.err(paint.red(` 不认识的命令组: ${name}`));
2919
+ print(io, globalHelp());
2920
+ return 1;
2921
+ }
2922
+ /** 顶层帮助不依赖配置文件;先于 resolveRuntime 处理。 */
2923
+ async function handleEarlyHelp(rawArgv, io, env, defaultGroup) {
2924
+ const first = rawArgv[0] ?? "";
2925
+ if (!(first === "help" || first === "--help" || first === "-h" || first === "-help")) {
2926
+ if (first === "mcp" && rawArgv.slice(1).some((token) => token === "--help" || token === "-h")) {
2927
+ print(io, mcpHelp());
2928
+ return 0;
2929
+ }
2930
+ const helpIndex = rawArgv.findIndex((token) => token === "--help" || token === "-h" || token === "-help");
2931
+ if (helpIndex >= 0) {
2932
+ const idx = findGroupIndex(rawArgv);
2933
+ if (idx === -1) {
2934
+ print(io, defaultGroup ? defaultGroup === "cdp" ? cdpHelp() : bridgeHelp() : globalHelp());
2935
+ return 0;
2936
+ }
2937
+ if (helpIndex === idx + 1) return await showGroupHelp(rawArgv[idx], io, env);
2938
+ }
2939
+ return null;
2940
+ }
2941
+ if (defaultGroup && first !== "help") return await showGroupHelp(defaultGroup, io, env);
2942
+ const target = first === "help" ? rawArgv[1] : void 0;
2943
+ if (defaultGroup && first === "help" && target === void 0) return await showGroupHelp(defaultGroup, io, env);
2944
+ return await showGroupHelp(target, io, env);
2945
+ }
2946
+ /** `lceda-connect <组> --help` 不依赖配置文件。 */
2947
+ async function handleGroupHelp(rawArgv, io, env) {
2948
+ const [group, second] = rawArgv;
2949
+ if (!group || !(second === "--help" || second === "-h" || second === "-help" || second === "help") || !COMMAND_GROUP_TOKENS.has(group)) return null;
2950
+ return await showGroupHelp(group, io, env);
2951
+ }
2886
2952
  /**
2887
2953
  * CLI 主入口:解析命令组 / 动作 / 选项,交给对应命令实现,返回进程退出码。
2888
2954
  * 三种 bin(lceda-connect / lceda-cdp / lceda-bridge)共用这一份逻辑,靠 defaultGroup 区分。
@@ -2894,6 +2960,11 @@ async function main(options) {
2894
2960
  io.out(`lceda-connect v${packageVersion()}`);
2895
2961
  return 0;
2896
2962
  }
2963
+ const earlyEnv = options.env ?? process.env;
2964
+ const earlyHelp = await handleEarlyHelp(rawArgv, io, earlyEnv, options.defaultGroup);
2965
+ if (earlyHelp !== null) return earlyHelp;
2966
+ const groupHelp = await handleGroupHelp(rawArgv, io, earlyEnv);
2967
+ if (groupHelp !== null) return groupHelp;
2897
2968
  const groupIndex = findGroupIndex(rawArgv);
2898
2969
  const localOptions = (groupIndex >= 0 ? rawArgv[groupIndex] : options.defaultGroup) === "sim" ? ["config"] : [];
2899
2970
  let runtime;
@@ -2938,7 +3009,7 @@ async function main(options) {
2938
3009
  }
2939
3010
  const clientAction = tail[0]?.trim().toLowerCase() ?? "";
2940
3011
  if (group === "cdp" && CDP_CLIENT_ACTIONS.includes(clientAction)) {
2941
- const { runCdpClientCommand } = await import("./cli-1_urvve3.mjs");
3012
+ const { runCdpClientCommand } = await import("./cli-Dja1oai7.mjs");
2942
3013
  return await runCdpClientCommand(tail, io, env);
2943
3014
  }
2944
3015
  if (group === "bridge" && BRIDGE_CLIENT_ACTIONS.includes(clientAction)) {
@@ -3,11 +3,11 @@ import { a as search, i as getFormatDoc, n as apiDocsAvailable, r as getEntry }
3
3
  import { a as requireConnected, i as execute, n as bridgeErrorHint, o as selectWindow, r as discover, s as windows, t as BridgeClientError } from "./client-_LVz5Zg0.mjs";
4
4
  import { t as packageVersion } from "./version-B39-elun.mjs";
5
5
  import { c as BRIDGE_MAX_CODE_BYTES, h as BRIDGE_SERVICE_ID } from "./protocol-B4UcGrGa.mjs";
6
- import { a as cdpInputActionSchema, c as listDocuments, d as detectState, f as normalizeState, i as screenshotToFile, l as openDocument, o as sendCdpInput, s as activeDocument, t as classifyEval, u as Board } from "./sideEffects-Ds_T-_B4.mjs";
7
- import { g as versionWebSocketUrl, h as versionBrowser, m as resolveEndpoint, o as discover$1, r as attributionOf, s as endpointUrl, u as parsePortRange, v as asCdpError } from "./discover-DmRYlAlR.mjs";
8
- import { a as evaluateInContext, l as redact, o as planEval } from "./session-AQbRX6Ys.mjs";
9
- import { i as listTargets } from "./targets-8LBEgvbq.mjs";
10
- import { a as routeNets, c as EdaVerbError, d as capabilitySummary, f as lookupCapability, i as readBoardState, l as createDefaultExecContext, n as docInfo, o as routeNetsPreview, r as evalApi, s as runDrc, t as boardDigestState, u as checkEnvironment } from "./verbs-DjQQTL2k.mjs";
6
+ import { a as cdpInputActionSchema, c as listDocuments, d as detectState, f as normalizeState, i as screenshotToFile, l as openDocument, o as sendCdpInput, s as activeDocument, t as classifyEval, u as Board } from "./sideEffects-3OHHy4VU.mjs";
7
+ import { g as versionWebSocketUrl, h as versionBrowser, m as resolveEndpoint, o as discover$1, r as attributionOf, s as endpointUrl, u as parsePortRange, v as asCdpError } from "./discover-D-YAeRWh.mjs";
8
+ import { a as evaluateInContext, l as redact, o as planEval } from "./session-BypD6Iab.mjs";
9
+ import { i as listTargets } from "./targets-DVmXbqhN.mjs";
10
+ import { a as routeNets, c as EdaVerbError, d as capabilitySummary, f as lookupCapability, i as readBoardState, l as createDefaultExecContext, n as docInfo, o as routeNetsPreview, r as evalApi, s as runDrc, t as boardDigestState, u as checkEnvironment } from "./verbs-d3wbVcHt.mjs";
11
11
  import { c as liveStrategy } from "./environment-BegP0n2N.mjs";
12
12
  import { C as compare, D as summarize, c as runSingle, ft as ensureSafeOutputDir, gt as safeWriteText, ht as safeWriteJson, lt as ProjectError, n as checkConsistency, o as inspectProject, r as collect, s as runDiff, t as analyzeSummary } from "./analyze-TRlZx-Jv.mjs";
13
13
  import { D as documentFiles, F as resolveProjectPath, G as readDocumentFile, M as loadEprj3Project, Y as reduceDocSection, g as netlistProject, i as EPRJ3_GATE_NAMES, j as inspectEprj3Project, m as runEprj3Script, n as EPRJ3_EDIT_OPS, r as EPRJ3_GATES, s as eprj3GateArgs, t as validateEprj3Project, u as isEprj3EditOp } from "./validate-COx5r3o4.mjs";
@@ -15,7 +15,7 @@ import { a as getPrimitive, i as getFormatLog, o as listTypes, r as getExample }
15
15
  import { i as validateLine, r as validateFormat } from "./record-CHXWiMWA.mjs";
16
16
  import { A as listSimSidecarScripts, At as generateNetlist, Cn as SimError, D as viaParasitics, Et as validateIr, F as simSidecarDir, I as readNetlistFile, L as runSimulation, Ot as buildPinNetTable, P as runSimSidecar, T as traceParams, bt as loadSimIr, c as touchstoneMetrics, et as parseRawFile, hn as loadSimConfig, j as probePython, m as Stackup, mt as probeNgspice, o as parseTouchstone, rt as computeMetrics, tt as plotsToCsv, vt as fromEpro2File } from "./touchstone-D4Fdg4Om.mjs";
17
17
  import { i as listAssetFiles, r as assetsDir, s as readAssetText, t as assetExists } from "./assets-D48xh-kr.mjs";
18
- import "./main-B3aaKvqY.mjs";
18
+ import "./main-CFHsfo5I.mjs";
19
19
  import path from "node:path";
20
20
  import { existsSync, readFileSync } from "node:fs";
21
21
  import { z } from "zod";
@@ -0,0 +1 @@
1
+ export { r as toolsForEnv } from "./registry-Be9DNS6F.mjs";
@@ -1,8 +1,8 @@
1
1
  import { i as listAssetFiles, s as readAssetText } from "./assets-D48xh-kr.mjs";
2
- import { i as loadConfig } from "./config-BKbwyvsG.mjs";
2
+ import { i as loadConfig } from "./config-B3dElEFD.mjs";
3
3
  import { pt as resolveMcpWritePath } from "./analyze-TRlZx-Jv.mjs";
4
4
  import { t as packageVersion } from "./version-B39-elun.mjs";
5
- import { i as toolsetsForTools, r as toolsForEnv } from "./registry-3WTFCZsR.mjs";
5
+ import { i as toolsetsForTools, r as toolsForEnv } from "./registry-Be9DNS6F.mjs";
6
6
  import { r as normalizeToolContext, t as ToolError } from "./types-D5d7ZRYF.mjs";
7
7
  import os from "node:os";
8
8
  import path from "node:path";
@@ -1,4 +1,4 @@
1
- import { _ as CdpError, b as coerceText, f as requireAllowedHost, n as DEFAULT_CDP_PORT, y as clipText } from "./discover-DmRYlAlR.mjs";
1
+ import { _ as CdpError, b as coerceText, f as requireAllowedHost, n as DEFAULT_CDP_PORT, y as clipText } from "./discover-D-YAeRWh.mjs";
2
2
  import { t as ToolError } from "./types-D5d7ZRYF.mjs";
3
3
  import { createHash, randomBytes } from "node:crypto";
4
4
  import net from "node:net";
@@ -1,7 +1,7 @@
1
- import { _ as CdpError, b as coerceText, m as resolveEndpoint, t as DEFAULT_CDP_HOST, y as clipText } from "./discover-DmRYlAlR.mjs";
1
+ import { _ as CdpError, b as coerceText, m as resolveEndpoint, t as DEFAULT_CDP_HOST, y as clipText } from "./discover-D-YAeRWh.mjs";
2
2
  import { t as ToolError } from "./types-D5d7ZRYF.mjs";
3
- import { i as evaluateExpression, r as apiExpression, s as UI_SHELL_MARKERS, t as CdpSession } from "./session-AQbRX6Ys.mjs";
4
- import { i as listTargets } from "./targets-8LBEgvbq.mjs";
3
+ import { i as evaluateExpression, r as apiExpression, s as UI_SHELL_MARKERS, t as CdpSession } from "./session-BypD6Iab.mjs";
4
+ import { i as listTargets } from "./targets-DVmXbqhN.mjs";
5
5
  import path from "node:path";
6
6
  import fs from "node:fs";
7
7
  import { z } from "zod";
@@ -0,0 +1 @@
1
+ export { t as serveStdio } from "./stdio-rNTpzX2t.mjs";
@@ -1,5 +1,5 @@
1
1
  import { t as packageVersion } from "./version-B39-elun.mjs";
2
- import { r as createServerFactory, t as SERVER_NAME } from "./server-zw6t1Pmk.mjs";
2
+ import { r as createServerFactory, t as SERVER_NAME } from "./server-4ROmddm7.mjs";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  // src/mcp/transports/stdio.ts
5
5
  async function startStdioTransport(options) {
@@ -1,4 +1,4 @@
1
- import { c as fetchJson } from "./discover-DmRYlAlR.mjs";
1
+ import { c as fetchJson } from "./discover-D-YAeRWh.mjs";
2
2
  // src/cdp/targets.ts
3
3
  /** `GET /json/list`;拿不到或返回不是数组时返回空列表(与源仓库一致)。 */
4
4
  async function listTargets(host, port, timeoutMs, signal) {
@@ -1,11 +1,11 @@
1
1
  import { c as liveStrategy, n as cdpProbeHosts, r as describeEnvironment } from "./environment-BegP0n2N.mjs";
2
2
  import { o as readAssetJson } from "./assets-D48xh-kr.mjs";
3
3
  import { t as packageVersion } from "./version-B39-elun.mjs";
4
- import { a as defaultPortFromEnv, c as fetchJson, h as versionBrowser, i as browserUuid, m as resolveEndpoint, o as discover, v as asCdpError } from "./discover-DmRYlAlR.mjs";
4
+ import { a as defaultPortFromEnv, c as fetchJson, h as versionBrowser, i as browserUuid, m as resolveEndpoint, o as discover, v as asCdpError } from "./discover-D-YAeRWh.mjs";
5
5
  import "./protocol-B4UcGrGa.mjs";
6
6
  import { i as execute, r as discover$1, s as windows, t as BridgeClientError } from "./client-_LVz5Zg0.mjs";
7
- import { i as evaluateExpression, t as CdpSession } from "./session-AQbRX6Ys.mjs";
8
- import { i as listTargets } from "./targets-8LBEgvbq.mjs";
7
+ import { i as evaluateExpression, t as CdpSession } from "./session-BypD6Iab.mjs";
8
+ import { i as listTargets } from "./targets-DVmXbqhN.mjs";
9
9
  import path from "node:path";
10
10
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
11
11
  import { createHash } from "node:crypto";
@@ -137,7 +137,7 @@ LCEDA_CDP_PORT=9222
137
137
 
138
138
  ### 5.1 WSL2 NAT + 客户端在宿主时的可行做法
139
139
 
140
- 1. **在 Windows 侧运行 MCP(推荐)**:Windows 上 `npm i -g lceda-connect`,让 MCP 客户端指向 Windows 命令。此时客户端与 MCP 共享回环,所有在线工具按原生逻辑工作。WSL 里的 stdio 客户端可以让这条命令自动完成:`npx lceda-connect mcp host`;也可让 Windows 常驻 `lceda-mcp http --host wsl --token ...`,WSL 用 HTTP 连。见 [传输模式](transports.md)。
140
+ 1. **在 Windows 侧运行 MCP(推荐)**:Windows 上 `npm i -g lceda-connect`,让 MCP 客户端指向 Windows 命令。此时客户端与 MCP 共享回环,所有在线工具按原生逻辑工作。WSL 里的 stdio 客户端可以让这条命令自动完成:`npx -y lceda-connect mcp host`;也可让 Windows 常驻 `lceda-connect mcp http --host wsl --token ...`,WSL 用 HTTP 连。见 [传输模式](transports.md)。
141
141
  2. **启用 WSL mirrored 网络**:在 `%USERPROFILE%\.wslconfig` 写 `[wsl2]` / `networkingMode=mirrored`,重启 WSL 后回环重新共享。注意这会改变整体 WSL 网络行为,且需要 WSL 2.0+。
142
142
  3. **把客户端装进 WSL VM**:按 `--lceda-in vm` 使用 Linux 版客户端,回环直连。
143
143
 
@@ -50,16 +50,16 @@ MCP stdio 与其他子命令共用全局参数,可直接写在客户端 args
50
50
 
51
51
  ## Streamable HTTP / WSL→Windows
52
52
 
53
- HTTP 模式(默认只监听 `127.0.0.1`):
53
+ HTTP 模式(默认只监听 `127.0.0.1`;以下为全局安装写法,未安装时加 `npx -y`):
54
54
 
55
55
  ```bash
56
- lceda-mcp http --host 127.0.0.1 --port 3939
56
+ lceda-connect mcp http --host 127.0.0.1 --port 3939
57
57
  ```
58
58
 
59
59
  跨 WSL 时在 **Windows** 侧启动并绑 WSL 虚拟网卡:
60
60
 
61
61
  ```powershell
62
- lceda-mcp http --host wsl --port 3939 --token my-secret
62
+ lceda-connect mcp http --host wsl --port 3939 --token my-secret
63
63
  ```
64
64
 
65
65
  WSL 侧客户端用 `http://<宿主WSL网卡IP>:3939/mcp` 连接。只绑 `127.0.0.1` 的 Windows 服务在 WSL NAT 里不可达,别按「宿主 IP + 回环」组合排查。
@@ -2,26 +2,28 @@
2
2
 
3
3
  三种使用方式共用同一套 MCP 组装(工具/资源/权限),只在传输适配层不同;分层边界见 [架构说明](architecture.md)。
4
4
 
5
+ > **调用约定**:本文命令默认使用全局安装后的 `lceda-connect`;未全局安装时在命令前加 `npx -y`。`lceda-mcp` 是 `lceda-connect mcp serve` 的全局快捷入口,示例统一使用 `lceda-connect mcp ...`。
6
+
5
7
  lceda-connect 的 MCP 服务支持三种使用方式,区别在于 **MCP 进程跑在哪一侧**,这直接决定在线工具(CDP / bridge)能不能看到客户端。
6
8
 
7
9
  | 模式 | 命令 | MCP 进程位置 | 适用 |
8
10
  | ----------------- | --------------------------------------- | ------------------------------------- | --------------------------------------- |
9
- | stdio | `lceda-mcp` / `npx lceda-connect mcp` | 调用方所在环境 | 绝大多数本机客户端 |
10
- | Streamable HTTP | `lceda-mcp http --host wsl --port 3939` | 你启动它的环境(可放 Windows 侧常驻) | 跨 WSL/宿主、多客户端共享一个 MCP |
11
- | WSL→Windows stdio | `npx lceda-connect mcp host` | 由 WSL 进程拉起的 **Windows 侧** MCP | WSL 里的客户端想用 Windows 客户端的回环 |
11
+ | stdio | `lceda-connect mcp` / `lceda-mcp` | 调用方所在环境 | 绝大多数本机客户端 |
12
+ | Streamable HTTP | `lceda-connect mcp http --host wsl ...` | 你启动它的环境(可放 Windows 侧常驻) | 跨 WSL/宿主、多客户端共享一个 MCP |
13
+ | WSL→Windows stdio | `lceda-connect mcp host` | 由 WSL 进程拉起的 **Windows 侧** MCP | WSL 里的客户端想用 Windows 客户端的回环 |
12
14
 
13
15
  ## 1. Streamable HTTP
14
16
 
15
17
  ```bash
16
18
  # 默认:只监听 127.0.0.1:3939,端点 /mcp
17
- lceda-mcp http
19
+ lceda-connect mcp http
18
20
 
19
21
  # 跨 WSL:自动取 WSL 虚拟网卡地址(Windows 侧启动时取 WSL 默认网关)
20
22
  # 非回环绑定必须带 token,否则拒绝启动
21
- lceda-mcp http --host wsl --port 3939 --token my-secret
23
+ lceda-connect mcp http --host wsl --port 3939 --token my-secret
22
24
 
23
25
  # 指定端点路径 / 无状态模式
24
- lceda-mcp http --host 172.18.224.1 --port 3939 --path /mcp --stateless
26
+ lceda-connect mcp http --host 172.18.224.1 --port 3939 --path /mcp --stateless
25
27
  ```
26
28
 
27
29
  选项:
@@ -98,7 +100,7 @@ MCP 客户端配置(支持 HTTP 传输的客户端):
98
100
  HTTP 模式的价值是启动一次、WSL 与 Windows 都能连。建议在 Windows PowerShell 里:
99
101
 
100
102
  ```powershell
101
- lceda-mcp http --host wsl --port 3939 --token my-secret
103
+ lceda-connect mcp http --host wsl --port 3939 --token my-secret
102
104
  ```
103
105
 
104
106
  (需要先在 Windows 安装:`pnpm add -g lceda-connect` 或 `npm i -g lceda-connect`。)
@@ -128,7 +130,7 @@ WSL 的 MCP 客户端按标准 stdio 配置,但让 MCP 进程实际跑在 Wind
128
130
  想让 MCP 启动时顺带确保 EasyEDA 带调试端口运行,加 `--start-client`(`--port` 指定调试端口):
129
131
 
130
132
  ```bash
131
- npx lceda-connect mcp host --start-client --port 9333
133
+ npx -y lceda-connect mcp host --start-client --port 9333
132
134
  ```
133
135
 
134
136
  它委托 Windows 侧 `lceda-cdp status/start`:客户端已在目标端口 → 直接复用;已在别的端口或没有调试端口 → **报错并提示手动退出,绝不杀进程**(未保存工程不会被自动关闭)。启动后最多等 45 秒端点就绪,避免超过 MCP 客户端 60 秒初始化上限。
@@ -143,7 +145,7 @@ npx lceda-connect mcp host --start-client --port 9333
143
145
  非全局安装或自定义路径:
144
146
 
145
147
  ```bash
146
- npx lceda-connect mcp host --script 'D:\tools\lceda-connect\dist\cli-mcp.mjs'
148
+ npx -y lceda-connect mcp host --script 'D:\tools\lceda-connect\dist\cli-mcp.mjs'
147
149
  ```
148
150
 
149
151
  ### 2.2 直接写 Windows 命令
@@ -151,7 +153,7 @@ npx lceda-connect mcp host --script 'D:\tools\lceda-connect\dist\cli-mcp.mjs'
151
153
  ### 2.4 自动启动客户端(可选)
152
154
 
153
155
  ```bash
154
- npx lceda-connect mcp host --start-client --port 9333
156
+ npx -y lceda-connect mcp host --start-client --port 9333
155
157
  ```
156
158
 
157
159
  安全边界:只启动,不结束任何用户进程;若 EasyEDA 已在运行但没有调试端口(或端口不一致),命令直接失败并提示先保存、退出客户端。这是刻意设计,避免自动化误关未保存工程。
@@ -174,7 +176,7 @@ WSL 的 `binfmt` 互操作会把这个 `/mnt/c/.../node.exe` 进程当 Windows
174
176
 
175
177
  ### 2.3 注意
176
178
 
177
- - `mcp host` 只在 Linux/WSL 侧有意义;Windows 原生直接用 `lceda-mcp` 即可。
179
+ - `mcp host` 只在 Linux/WSL 侧有意义;Windows 原生直接用 `lceda-connect mcp`(全局安装后也可用快捷入口 `lceda-mcp`)即可。
178
180
  - 当前进程里的 `/tmp/...`、`/root/...` 等纯 WSL 路径无法被 Windows 读取,会从子进程环境移除并告警;配置文件请放在 `/mnt/<盘>/...`。
179
181
  - 启动比 Linux 侧多花几秒(Windows node + 模块加载),但 MCP 会话只启动一次。
180
182
  - 结束 `mcp host` 时子进程会随信号退出;若客户端强杀进程后 Windows 侧仍有残留,用任务管理器结束对应 `node.exe`。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lceda-connect",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "嘉立创EDA专业版 (EasyEDA Pro) 一体化工具箱:MCP 服务 + CLI,覆盖 CDP/AI Bridge 连接、工程文件解析、格式校验、API 文档检索与 ngspice 仿真。",
5
5
  "keywords": [
6
6
  "ai-bridge",
@@ -1 +0,0 @@
1
- export { a as startHttpTransport } from "./http-Cdp6S2rm.mjs";
@@ -1 +0,0 @@
1
- export { r as toolsForEnv } from "./registry-3WTFCZsR.mjs";
@@ -1 +0,0 @@
1
- export { t as serveStdio } from "./stdio-BZPlcfDR.mjs";