lceda-connect 0.2.0 → 0.4.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +111 -45
  3. package/dist/{analyze-DBkWgG82.mjs → analyze-TRlZx-Jv.mjs} +2 -190
  4. package/dist/{cli-B3GGyoP_.mjs → cli-1_urvve3.mjs} +5 -3
  5. package/dist/{cli-BegYbK44.mjs → cli-C8-HjAP0.mjs} +2 -2
  6. package/dist/cli-CHbcaMwS.mjs +1 -0
  7. package/dist/cli-CXk5pvVm.mjs +1253 -0
  8. package/dist/cli-CZEoeuFW.mjs +1 -0
  9. package/dist/{cli-DphIx1EQ.mjs → cli-CZmNLW3Q.mjs} +1 -1
  10. package/dist/{cli-BekOvZjB.mjs → cli-DFqBHofJ.mjs} +19 -3
  11. package/dist/cli-bridge-server.mjs +1 -1
  12. package/dist/cli-bridge.mjs +1 -1
  13. package/dist/cli-cdp.mjs +1 -1
  14. package/dist/cli-mcp.mjs +1 -1
  15. package/dist/cli.mjs +1 -1
  16. package/dist/config-BKbwyvsG.mjs +516 -0
  17. package/dist/{discover-D4ouuCrn.mjs → discover-DmRYlAlR.mjs} +13 -90
  18. package/dist/environment-BegP0n2N.mjs +439 -0
  19. package/dist/environment-Clx1-nDW.mjs +146 -0
  20. package/dist/http-Cdp6S2rm.mjs +366 -0
  21. package/dist/http-D7sYy2y4.mjs +1 -0
  22. package/dist/index.d.mts +226 -6
  23. package/dist/index.mjs +12 -9
  24. package/dist/{main-CzMqMptH.mjs → main-B3aaKvqY.mjs} +695 -90
  25. package/dist/mcpHost-CRoN6MnG.mjs +331 -0
  26. package/dist/{registry-DaqVJuvF.mjs → registry-3WTFCZsR.mjs} +86 -25
  27. package/dist/registry-DdJ8LEdd.mjs +1 -0
  28. package/dist/{server-qYlcXfzp.mjs → server-zw6t1Pmk.mjs} +10 -15
  29. package/dist/{targets-DYfgkrq3.mjs → session-AQbRX6Ys.mjs} +3 -37
  30. package/dist/{sideEffects-D33hMchc.mjs → sideEffects-Ds_T-_B4.mjs} +3 -2
  31. package/dist/stdio-BZPlcfDR.mjs +27 -0
  32. package/dist/stdio-Du1oLqfJ.mjs +1 -0
  33. package/dist/targets-8LBEgvbq.mjs +36 -0
  34. package/dist/term-DlGIoccA.mjs +27 -0
  35. package/dist/{touchstone-DOhfmSNh.mjs → touchstone-D4Fdg4Om.mjs} +1 -1
  36. package/dist/{verbs-CD4ZM9Es.mjs → verbs-DjQQTL2k.mjs} +191 -53
  37. package/dist/windowsHost-CTZXMA8D.mjs +1 -0
  38. package/dist/windowsHost-CtRidgJp.mjs +309 -0
  39. package/dist/zip-CAd_yYte.mjs +190 -0
  40. package/docs/architecture.md +81 -0
  41. package/docs/environments.md +175 -0
  42. package/docs/extensions.md +207 -0
  43. package/docs/quickstart.md +59 -4
  44. package/docs/transports.md +189 -0
  45. package/package.json +6 -2
  46. package/dist/cli-BqILMvnF.mjs +0 -1
  47. package/dist/cli-BzrDKC7x.mjs +0 -1
  48. package/dist/registry-5K1G1XmC.mjs +0 -1
  49. package/dist/server-DNMAlzZJ.mjs +0 -1
package/dist/index.d.mts CHANGED
@@ -1,24 +1,152 @@
1
1
  import { z } from "zod";
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
- /** 立创EDA专业版默认安装路径(与旧脚本保持一致,可用 LCEDA_PRO_EXE / --exe 覆盖)。 */
3
+ /**
4
+ * 执行环境自动发现。
5
+ *
6
+ * 本工具的在线能力(CDP / bridge)依赖「客户端在哪个操作系统、哪个网络命名空间里」:
7
+ * - Windows 原生:客户端与 MCP 共享回环,127.0.0.1 直连。
8
+ * - WSL2 NAT(默认):MCP 在 Linux 虚拟机里,Windows 的回环与它不互通;只有
9
+ * 宿主地址(默认网关)上的监听才可能可达。
10
+ * - WSL2 mirrored:共享宿主网络命名空间,回环重新可用。
11
+ * 因此先判环境,再决定探测哪些地址、能否启动客户端、失败时该给什么建议。
12
+ *
13
+ * 判定只读:读 /proc、读环境变量、跑一次 `wslinfo --networking-mode`(WSL 自带,
14
+ * 不存在时跳过)。不启动、不修改任何东西。所有外部探测都可注入,便于测试。
15
+ */
16
+ type EnvironmentKind = "windows-native" | "wsl2" | "linux-native" | "macos-native" | "unknown";
17
+ /** 客户端(嘉立创EDA专业版)所在的操作系统。 */
18
+ type HostOs = "windows" | "linux" | "macos" | "unknown";
19
+ type NetworkingMode = "nat" | "mirrored" | "unknown";
20
+ /**
21
+ * 客户端实例相对 MCP 进程的宿主位置。只对 WSL2 有意义:
22
+ * - host:客户端跑在 Windows 宿主机上(WSL2 默认)
23
+ * - vm:客户端跑在 WSL2 这个 Linux 虚拟机里
24
+ * `--lceda-in vm,host` 的顺序就是启动/探测优先级。
25
+ */
26
+ type ClientLocation = "host" | "vm";
27
+ type ClientLocationSource = "default" | "argv" | "config-file" | "env";
28
+ /** 当前 Node 进程寻址文件的方式;WSL2 是 posix(/mnt/c/...),宿主是 Windows。 */
29
+ type PathStyle = "windows" | "posix";
30
+ type EnvironmentKindSource = "argv" | "config-file" | "env" | "auto-detected";
31
+ type Confidence = "certain" | "likely" | "unknown";
32
+ interface EnvironmentEvidence {
33
+ source: string;
34
+ value: string;
35
+ }
36
+ interface EnvironmentInfo {
37
+ kind: EnvironmentKind;
38
+ hostOs: HostOs;
39
+ platform: NodeJS.Platform;
40
+ pathStyle: PathStyle;
41
+ isWsl: boolean;
42
+ /** WSL 发行版名(WSL_DISTRO_NAME),非 WSL 时为 null。 */
43
+ distro: string | null;
44
+ networkingMode: NetworkingMode;
45
+ /** WSL2 下 Windows 宿主的可达地址;原生环境为 null。 */
46
+ windowsHost: string | null;
47
+ /** 客户端实例位置,按优先级排序;原生环境固定为 ["host"]。 */
48
+ clientLocations: ClientLocation[];
49
+ clientLocationSource: ClientLocationSource;
50
+ /** true 表示用户显式指定了环境,没有做自动发现。 */
51
+ explicit: boolean;
52
+ source: EnvironmentKindSource;
53
+ confidence: Confidence;
54
+ evidence: EnvironmentEvidence[];
55
+ warnings: string[];
56
+ }
57
+ /** 环境判定可注入的探针;默认实现读 /proc 并调用 wslinfo。 */
58
+ interface EnvironmentProbes {
59
+ platform?: NodeJS.Platform;
60
+ env?: NodeJS.ProcessEnv;
61
+ readText?: (file: string) => string | null;
62
+ exists?: (file: string) => boolean;
63
+ runText?: (command: string, args: readonly string[], timeoutMs: number) => string | null;
64
+ }
65
+ interface DetectEnvironmentOptions {
66
+ /** 显式环境:`--env` / 配置文件 environment.kind / LCEDA_ENV。 */
67
+ kind?: string | null;
68
+ /** 显式宿主地址:`--windows-host` / 配置文件 / LCEDA_WINDOWS_HOST。 */
69
+ windowsHost?: string | null;
70
+ /** 显式环境来自哪里;默认 argv。 */
71
+ kindSource?: EnvironmentKindSource;
72
+ /** 宿主地址是否也是显式给出的(用于证据与警告)。 */
73
+ windowsHostSource?: EnvironmentKindSource;
74
+ /**
75
+ * 客户端实例位置优先级:`vm` / `host` / `vm,host`。
76
+ * 省略时 WSL2 默认 host,其它环境固定 host。
77
+ */
78
+ clientLocations?: string | readonly string[] | null;
79
+ clientLocationSource?: ClientLocationSource;
80
+ probes?: EnvironmentProbes;
81
+ /** 是否复用自动发现的缓存(默认 true;注入探针或测试时请设 false)。 */
82
+ cache?: boolean;
83
+ }
84
+ /**
85
+ * 客户端可执行文件发现。
86
+ *
87
+ * 候选路径同时取决于两件事:执行环境(windows-native / wsl2 / linux / macos)和
88
+ * 客户端实例位置(WSL2 下 host=Windows 宿主、vm=WSL 虚拟机内)。只做
89
+ * 「列候选 → 逐个 stat」,不猜不存在的位置;找不到时把试过的路径完整吐出来。
90
+ * 跨环境时统一成当前进程能执行的路径(WSL2 + host 是 /mnt/d/...),同时保留
91
+ * Windows 形式的 hostPath 供 pid 记录与提示。
92
+ */
93
+ interface ExeCandidate {
94
+ path: string;
95
+ source: string;
96
+ }
97
+ interface ExeCandidateResult extends ExeCandidate {
98
+ exists: boolean;
99
+ }
100
+ type ClientExeStatus = "explicit" | "discovered" | "explicit_missing" | "not_found";
101
+ interface ClientExeDiscovery {
102
+ status: ClientExeStatus;
103
+ /** 当前进程可直接执行的路径;找不到时为 null。 */
104
+ path: string | null;
105
+ /** 宿主(Windows)风格路径,便于日志 / pid 记录;未知时 null。 */
106
+ hostPath: string | null;
107
+ source: string;
108
+ /** 这个结果对应的实例位置。 */
109
+ location: ClientLocation;
110
+ candidates: ExeCandidateResult[];
111
+ warnings: string[];
112
+ environment: EnvironmentInfo["kind"];
113
+ }
114
+ interface ClientExePlan {
115
+ /** 按 clientLocations 优先级排列,每项对应一个实例位置。 */
116
+ locations: ClientExeDiscovery[];
117
+ /** 第一个找到的可用路径(显式路径优先命中)。 */
118
+ primary: ClientExeDiscovery | null;
119
+ warnings: string[];
120
+ }
121
+ /** 立创EDA专业版历史默认安装路径(仅 Windows 原生环境;可用 `--exe` / LCEDA_PRO_EXE 覆盖)。 */
4
122
  export declare const DEFAULT_PRO_EXE = "D:\\Program Files\\lceda-pro\\lceda-pro.exe";
5
123
  export declare const DEFAULT_CDP_PORT = 9222;
6
124
  interface CdpConfig {
125
+ /** 显式/历史默认的可执行文件路径;实际可执行路径见 `client.exe.path`。 */
7
126
  exePath: string;
8
127
  port: number;
9
128
  /** CLI 探测端点的回环地址,不控制客户端的监听地址。 */
10
129
  bindHost: string;
130
+ /** 当前环境下的首选探测地址(WSL2 可能是宿主地址,而不是回环)。 */
131
+ host: string;
132
+ /** 按客户端位置优先级展开的探测地址列表。 */
133
+ hosts: readonly string[];
11
134
  runtimeDir: string;
12
135
  pidFile: string;
13
136
  logFile: string;
14
137
  /** 旧版 easyeda-cdp-connect 的 pid 文件,迁移期只读兼容。 */
15
138
  legacyPidFile: string;
16
139
  startWaitMs: number;
140
+ /** 附加扫描端口区间(配置 LCEDA_CDP_SCAN=9222-9240)。 */
141
+ scan?: readonly [number, number];
17
142
  }
18
143
  interface BridgeConfig {
19
144
  portFirst: number;
20
145
  portLast: number;
146
+ /** 服务监听地址(契约固定回环,不可跨命名空间)。 */
21
147
  bindHost: string;
148
+ /** 探测地址;默认回环,允许配置覆盖(例如端口转发场景)。 */
149
+ host: string;
22
150
  serviceId: string;
23
151
  runtimeDir: string;
24
152
  logFile: string;
@@ -31,9 +159,19 @@ interface BridgeConfig {
31
159
  /** LCEDA_BRIDGE_SCRIPT 覆盖 */
32
160
  bridgeScript?: string;
33
161
  }
162
+ interface ClientConfig {
163
+ /** 按实例位置优先级排列的发现结果。 */
164
+ plan: ClientExePlan;
165
+ /** 首个可用结果;没有则是 null。 */
166
+ exe: ClientExeDiscovery | null;
167
+ }
34
168
  interface AppConfig {
35
169
  cdp: CdpConfig;
36
170
  bridge: BridgeConfig;
171
+ /** 执行环境(自动发现或显式指定)。 */
172
+ environment: EnvironmentInfo;
173
+ /** 客户端可执行文件发现结果。 */
174
+ client: ClientConfig;
37
175
  }
38
176
  interface CdpOverrides {
39
177
  exePath?: string;
@@ -47,13 +185,23 @@ interface ConfigOverrides {
47
185
  cdp?: CdpOverrides;
48
186
  bridge?: BridgeOverrides;
49
187
  }
188
+ interface LoadConfigOptions {
189
+ /** 环境探测注入(测试用)。 */
190
+ detect?: DetectEnvironmentOptions;
191
+ /** 客户端发现是否走 where/which 深探(较慢,默认关闭)。 */
192
+ deepExe?: boolean;
193
+ /** 注入文件存在性判断(测试用)。 */
194
+ exists?: (file: string) => boolean;
195
+ }
50
196
  /**
51
- * 配置优先级:命令行参数 > 环境变量 > 内置默认值。
197
+ * 配置优先级:命令行参数 > 配置文件 > .env > 环境变量 > 内置默认值
198
+ * (前四级由 core/runtimeConfig 合并成 env,这里只处理 env + 显式 overrides)。
199
+ *
52
200
  * 目录约定:
53
201
  * - CDP 运行态放在 ~/.lceda-connect/cdp(可用 LCEDA_CONNECT_HOME 改根)
54
202
  * - Bridge 运行态沿用 %LOCALAPPDATA%\lceda-bridge,保证老的 state.json / bridge.log 继续可用
55
203
  */
56
- export declare function loadConfig(env?: NodeJS.ProcessEnv, overrides?: ConfigOverrides): AppConfig;
204
+ export declare function loadConfig(env?: NodeJS.ProcessEnv, overrides?: ConfigOverrides, options?: LoadConfigOptions): AppConfig;
57
205
  /** 运行时共享类型。 */
58
206
  interface ProcInfo {
59
207
  pid: number;
@@ -2760,12 +2908,84 @@ type ToolsetSelection = string | readonly string[];
2760
2908
  * `offline`/`live` 聚合名以及 `cdp,bridge,eda,api,...` 精确领域名。
2761
2909
  */
2762
2910
  export declare function allTools(selection?: ToolsetSelection): ToolDef[];
2763
- interface CreateServerOptions {
2911
+ /**
2912
+ * 传输适配层的公共契约。
2913
+ *
2914
+ * 组装(tools/resources/roots/写路径策略)只发生在 `createServer` / `createServerFactory`;
2915
+ * stdio 与 Streamable HTTP 只做「把协议的字节搬到 McpServer 上」这一件事。
2916
+ * 这样新增传输(SSE、WebSocket、进程内 pipe)时只需要写一个适配器,
2917
+ * 不在传输层复制任何业务/权限逻辑。
2918
+ */
2919
+ interface McpServerFactoryOptions {
2764
2920
  env?: NodeJS.ProcessEnv;
2765
2921
  tools?: ToolDef[];
2766
2922
  toolsets?: ToolsetSelection;
2767
2923
  }
2924
+ /** 每次调用返回一个独立的 McpServer;HTTP 每个 session 一个,stdio 一个。 */
2925
+ type McpServerFactory = () => McpServer;
2926
+ interface TransportStartOptions {
2927
+ env: NodeJS.ProcessEnv;
2928
+ toolsets?: ToolsetSelection;
2929
+ /** 嵌入/测试用:覆盖默认的 createServerFactory。 */
2930
+ serverFactory?: McpServerFactory;
2931
+ }
2932
+ /** 传输实例的生命周期句柄;`close` 必须可重复调用。 */
2933
+ interface TransportHandle {
2934
+ /** 监听地址(HTTP);stdio 没有。 */
2935
+ readonly url?: string;
2936
+ close(): Promise<void>;
2937
+ }
2938
+ type CreateServerOptions = McpServerFactoryOptions;
2768
2939
  export declare function createServer(options?: CreateServerOptions): McpServer;
2769
- /** 以 stdio 方式运行 MCP 服务。stdout 归协议所有,日志一律写 stderr。 */
2770
- export declare function serveStdio(env?: NodeJS.ProcessEnv, toolsets?: ToolsetSelection): Promise<void>;
2940
+ /**
2941
+ * 组装工厂:传输适配器只依赖这个函数,不依赖 createServer 的细节。
2942
+ * 每次调用必须返回独立的 McpServer(HTTP 每个 session 一个)。
2943
+ */
2944
+ export declare function createServerFactory(options?: CreateServerOptions): McpServerFactory;
2945
+ /**
2946
+ * stdio 传输适配器(薄层)。
2947
+ *
2948
+ * 只做三件事:从工厂拿一个 McpServer、接到 StdioServerTransport、把就绪日志写 stderr。
2949
+ * stdout 归 JSON-RPC 协议所有,这里不写任何日志。
2950
+ */
2951
+ interface StdioTransportOptions extends TransportStartOptions {
2952
+ /** 诊断日志出口,默认 stderr。 */
2953
+ log?: (line: string) => void;
2954
+ }
2955
+ interface StdioTransportHandle extends TransportHandle {
2956
+ readonly kind: "stdio";
2957
+ }
2958
+ export declare function startStdioTransport(options: StdioTransportOptions): Promise<StdioTransportHandle>;
2959
+ /** 兼容旧入口:连接后即返回(进程由 stdio 传输保持存活)。 */
2960
+ export declare function serveStdio(env?: NodeJS.ProcessEnv, toolsets?: TransportStartOptions["toolsets"]): Promise<void>;
2961
+ /**
2962
+ * MCP Streamable HTTP 传输(2025-03-26 规范)。
2963
+ *
2964
+ * 默认只监听 127.0.0.1;要跨 WSL/宿主访问必须显式 `--host`(建议只绑 WSL 虚拟网卡
2965
+ * 地址,不要 0.0.0.0)。可选 `--token` 要求 Authorization: Bearer。
2966
+ * 规范要求:Host/Origin 校验、未知 session 返回 404、无 SSE 能力时对 GET 返回 405、
2967
+ * 请求体超限返回 413(连接不 reset)。`/health` 只返回非敏感状态。
2968
+ */
2969
+ interface HttpTransportOptions extends TransportStartOptions {
2970
+ /** 监听地址;默认 127.0.0.1。 */
2971
+ host?: string;
2972
+ /** 监听端口;默认 3939,0 表示随机端口。 */
2973
+ port?: number;
2974
+ /** MCP 端点路径;默认 /mcp。 */
2975
+ path?: string;
2976
+ /** 可选的 Bearer token。 */
2977
+ token?: string;
2978
+ /** 无状态模式:每个 POST 独立 server,不下发 session id。 */
2979
+ stateless?: boolean;
2980
+ /** 诊断日志出口,默认 stderr。 */
2981
+ log?: (line: string) => void;
2982
+ }
2983
+ interface HttpTransportHandle extends TransportHandle {
2984
+ kind: "http";
2985
+ url: string;
2986
+ host: string;
2987
+ port: number;
2988
+ path: string;
2989
+ }
2990
+ export declare function startHttpTransport(options: HttpTransportOptions): Promise<HttpTransportHandle>;
2771
2991
  export { type AppConfig, type BridgeAction, type BridgeConfig, type BridgeHealth, type BridgeOptions, type CdpAction, type CdpConfig, type CdpInfo, type CdpOptions, type CommandContext, type ConfigOverrides, type ProcInfo, type TcpListener, type ToolContext, type ToolDef, index_d_exports as eprj3, index_d_exports$1 as epro2, index_d_exports$2 as format, index_d_exports$3 as sim };
package/dist/index.mjs CHANGED
@@ -1,17 +1,20 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D8jQpDG7.mjs";
2
- import { C as DEFAULT_PRO_EXE, S as DEFAULT_CDP_PORT, T as loadConfig } from "./discover-D4ouuCrn.mjs";
3
- import { n as runCdpAction, r as runBridgeAction, t as main } from "./main-CzMqMptH.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";
4
4
  import { t as packageVersion } from "./version-B39-elun.mjs";
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, _t as decodeMemberName, a as findFloating, at as pythonJson, b as renderReport, c as runSingle, ct as Project, d as writeText, dt as ZipError, et as flatMap, f as TOL, ft as crc32, g as pinKey, gt as cp437TextToBytes, h as pageToIr, ht as readZip, i as duplicateDesignators, it as parseRecords, j as buildNetlist, k as asId, l as slug, lt as ProjectError, m as onSegment, mt as looksLikeZip, n as checkConsistency, nt as makeRecordKey, o as inspectProject, ot as splitRecordKey, p as buildNets, pt as extractEntry, 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-DBkWgG82.mjs";
6
- import { n as runEpro2Command, t as epro2Help } from "./cli-DphIx1EQ.mjs";
7
- 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-DaqVJuvF.mjs";
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
+ import { n as runEpro2Command, t as epro2Help } from "./cli-CZmNLW3Q.mjs";
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
9
  import { n as runEprj3Command, t as eprj3HelpLines } from "./cli-ZuAl89m5.mjs";
9
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";
10
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";
11
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";
12
- import { n as simHelp, t as runSimCommand } from "./cli-BegYbK44.mjs";
13
- 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-DOhfmSNh.mjs";
14
- import { i as serveStdio, n as createServer } from "./server-qYlcXfzp.mjs";
13
+ import { n as simHelp, t as runSimCommand } from "./cli-C8-HjAP0.mjs";
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
18
  import { n as defineTool, t as ToolError } from "./types-D5d7ZRYF.mjs";
16
19
  // src/epro2/index.ts
17
20
  var epro2_exports = /* @__PURE__ */ __exportAll({
@@ -344,4 +347,4 @@ var sim_exports = /* @__PURE__ */ __exportAll({
344
347
  waveformText: () => waveformText,
345
348
  writeManifest: () => writeManifest
346
349
  });
347
- export { DEFAULT_CDP_PORT, DEFAULT_PRO_EXE, ToolError, allTools, createServer, defineTool, eprj3_exports as eprj3, epro2_exports as epro2, format_exports as format, loadConfig, main, packageVersion, runBridgeAction, runCdpAction, serveStdio, sim_exports as sim };
350
+ export { DEFAULT_CDP_PORT, DEFAULT_PRO_EXE, ToolError, allTools, createServer, createServerFactory, defineTool, eprj3_exports as eprj3, epro2_exports as epro2, format_exports as format, loadConfig, main, packageVersion, runBridgeAction, runCdpAction, serveStdio, sim_exports as sim, startHttpTransport, startStdioTransport };