lceda-connect 0.1.1 → 0.3.0

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 (42) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +24 -17
  3. package/assets/skills/cdp-connect/SKILL.md +5 -11
  4. package/assets/skills/cdp-connect/SOURCE.md +4 -2
  5. package/assets/skills/cdp-connect/references/restart-and-relaunch.md +3 -3
  6. package/assets/skills/cdp-connect/references/setup-guide.md +5 -9
  7. package/assets/skills/easyeda-connect/SOURCE.md +3 -1
  8. package/assets/skills/easyeda-connect/references/setup-guide.md +2 -2
  9. package/dist/{analyze-DBkWgG82.mjs → analyze-TRlZx-Jv.mjs} +2 -190
  10. package/dist/cli-C4ZkWlV2.mjs +1253 -0
  11. package/dist/{cli-DSk_viv1.mjs → cli-C6saKrQp.mjs} +3 -2
  12. package/dist/{cli-BegYbK44.mjs → cli-C8-HjAP0.mjs} +2 -2
  13. package/dist/cli-CHbcaMwS.mjs +1 -0
  14. package/dist/cli-CZEoeuFW.mjs +1 -0
  15. package/dist/{cli-DphIx1EQ.mjs → cli-CZmNLW3Q.mjs} +1 -1
  16. package/dist/{cli-DhHRbgp_.mjs → cli-CjcJVM6z.mjs} +151 -5
  17. package/dist/cli-bridge.mjs +1 -1
  18. package/dist/cli-cdp.mjs +1 -1
  19. package/dist/cli-mcp.mjs +1 -1
  20. package/dist/cli.mjs +1 -1
  21. package/dist/{discover-D4ouuCrn.mjs → discover-D5mRrsxg.mjs} +1 -27
  22. package/dist/index.d.mts +1 -0
  23. package/dist/index.mjs +9 -8
  24. package/dist/{main-D4XmxX8M.mjs → main-CcKvXSJG.mjs} +21 -15
  25. package/dist/{registry-D6ReiPB6.mjs → registry-Dmti2u6s.mjs} +34 -8
  26. package/dist/registry-zIKWeXV6.mjs +1 -0
  27. package/dist/{server-C7NJHDXj.mjs → server-BduSjwzu.mjs} +4 -4
  28. package/dist/server-Chka6eAQ.mjs +1 -0
  29. package/dist/{targets-DiGwICXT.mjs → session-DvIXO5Hf.mjs} +2 -36
  30. package/dist/{sideEffects-B34zsl2C.mjs → sideEffects-DF_tIVsf.mjs} +653 -3
  31. package/dist/targets-D5nmbsyz.mjs +36 -0
  32. package/dist/term-DlGIoccA.mjs +27 -0
  33. package/dist/{touchstone-DOhfmSNh.mjs → touchstone-D4Fdg4Om.mjs} +1 -1
  34. package/dist/{verbs-CcrO8f9q.mjs → verbs-5M7rj1-E.mjs} +3 -2
  35. package/dist/zip-CAd_yYte.mjs +190 -0
  36. package/docs/cdp-input.md +33 -0
  37. package/docs/extensions.md +207 -0
  38. package/package.json +3 -1
  39. package/dist/cli-BqILMvnF.mjs +0 -1
  40. package/dist/cli-BzrDKC7x.mjs +0 -1
  41. package/dist/registry-Bs3kpMhy.mjs +0 -1
  42. package/dist/server-s5NZcVym.mjs +0 -1
@@ -1,6 +1,7 @@
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 { T as loadConfig, b as hr, x as paint } from "./discover-D4ouuCrn.mjs";
3
- 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-CcrO8f9q.mjs";
2
+ import { C as loadConfig } from "./discover-D5mRrsxg.mjs";
3
+ import { n as paint, t as hr } from "./term-DlGIoccA.mjs";
4
+ 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-5M7rj1-E.mjs";
4
5
  import { readFileSync } from "node:fs";
5
6
  // src/eda/cli.ts
6
7
  /**
@@ -1,6 +1,6 @@
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 { lt as ProjectError } from "./analyze-DBkWgG82.mjs";
3
- import { A as listSimSidecarScripts, At as generateNetlist, C as stackupSummaryLines, Cn as SimError, D as viaParasitics, Et as validateIr, I as readNetlistFile, L as runSimulation, Ot as buildPinNetTable, T as traceParams, at as metricSummaryLine, bt as loadSimIr, c as touchstoneMetrics, et as parseRawFile, hn as loadSimConfig, j as probePython, m as Stackup, mt as probeNgspice, o as parseTouchstone, tt as plotsToCsv, vt as fromEpro2File } from "./touchstone-DOhfmSNh.mjs";
2
+ import { lt as ProjectError } from "./analyze-TRlZx-Jv.mjs";
3
+ import { A as listSimSidecarScripts, At as generateNetlist, C as stackupSummaryLines, Cn as SimError, D as viaParasitics, Et as validateIr, I as readNetlistFile, L as runSimulation, Ot as buildPinNetTable, T as traceParams, at as metricSummaryLine, bt as loadSimIr, c as touchstoneMetrics, et as parseRawFile, hn as loadSimConfig, j as probePython, m as Stackup, mt as probeNgspice, o as parseTouchstone, tt as plotsToCsv, vt as fromEpro2File } from "./touchstone-D4Fdg4Om.mjs";
4
4
  import path from "node:path";
5
5
  import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
6
6
  // src/sim/cli.ts
@@ -0,0 +1 @@
1
+ export { n as runEpro2Command } from "./cli-CZmNLW3Q.mjs";
@@ -0,0 +1 @@
1
+ export { t as runSimCommand } from "./cli-C8-HjAP0.mjs";
@@ -1,5 +1,5 @@
1
1
  import { a as parseArgs, n as boolValue, o as stringValue, r as formatOptions, t as CliUsageError } from "./cliArgs-BI3bJgCZ.mjs";
2
- import { c as runSingle, lt as ProjectError, o as inspectProject, s as runDiff, t as analyzeSummary } from "./analyze-DBkWgG82.mjs";
2
+ import { c as runSingle, lt as ProjectError, o as inspectProject, s as runDiff, t as analyzeSummary } from "./analyze-TRlZx-Jv.mjs";
3
3
  // src/epro2/cli.ts
4
4
  const ANALYZE_OPTIONS = [
5
5
  {
@@ -1,12 +1,14 @@
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 { _ as asCdpError, a as defaultPortFromEnv, b as hr, d as profileLabel, f as requireLoopbackHost, g as CdpError, h as versionWebSocketUrl, m as versionBrowser, o as discover, p as resolveEndpoint, r as attributionOf, s as endpointUrl, u as parsePortRange, x as paint } from "./discover-D4ouuCrn.mjs";
3
- import { a as activeDocument, c as Board, d as pickPage, i as screenshotToFile, n as firstSideEffectPattern, o as listDocuments, r as hasSideEffects, s as openDocument } from "./sideEffects-B34zsl2C.mjs";
4
- import { a as CdpSession, d as redact, i as listTargets, l as evaluateInContext, n as flattenFrameTree, o as EvalUsageError, r as formatFrameTree, t as fetchFrameTree, u as planEval } from "./targets-DiGwICXT.mjs";
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-DF_tIVsf.mjs";
4
+ import { _ as asCdpError, a as defaultPortFromEnv, d as profileLabel, f as requireLoopbackHost, g as CdpError, h as versionWebSocketUrl, m as versionBrowser, o as discover, p as resolveEndpoint, r as attributionOf, s as endpointUrl, u as parsePortRange } from "./discover-D5mRrsxg.mjs";
5
+ import { a as evaluateInContext, l as redact, n as EvalUsageError, o as planEval, t as CdpSession } from "./session-DvIXO5Hf.mjs";
6
+ import { i as listTargets, n as flattenFrameTree, r as formatFrameTree, t as fetchFrameTree } from "./targets-D5nmbsyz.mjs";
5
7
  // src/cdp/cli.ts
6
8
  /**
7
9
  * `lceda-connect cdp-client <动作>` 的实现(源仓库 lceda_cdp.py 的 CLI 部分)。
8
10
  *
9
- * 动作:discover / targets / frames / eval / shot / docs。
11
+ * 动作:discover / targets / frames / eval / shot / docs / input。
10
12
  * 只连回环地址;`eval` 默认拒绝有副作用的表达式。退出码沿用源仓库口径:
11
13
  * 0 成功 / 1 未找到或用法 / 2 端点或选页失败 / 3 拒绝(副作用、非回环)/ 4 协议错误。
12
14
  */
@@ -140,8 +142,150 @@ const ACTIONS = [
140
142
  "frames",
141
143
  "eval",
142
144
  "shot",
143
- "docs"
145
+ "docs",
146
+ "input"
144
147
  ];
148
+ const INPUT_OPTIONS = [
149
+ {
150
+ name: "port",
151
+ type: "string",
152
+ placeholder: "PORT",
153
+ description: "本机调试端口(必填,不自动发现)"
154
+ },
155
+ {
156
+ name: "target",
157
+ type: "string",
158
+ placeholder: "ID",
159
+ description: "精确 page target ID(必填)"
160
+ },
161
+ {
162
+ name: "document",
163
+ type: "string",
164
+ placeholder: "UUID",
165
+ description: "当前 PCB 文档 UUID(必填)"
166
+ },
167
+ {
168
+ name: "confirm",
169
+ type: "boolean",
170
+ description: "确认派发到指定 PCB 页面,可能改动工程"
171
+ },
172
+ {
173
+ name: "x",
174
+ type: "string",
175
+ placeholder: "X",
176
+ description: "顶层页面视口 CSS 像素坐标"
177
+ },
178
+ {
179
+ name: "y",
180
+ type: "string",
181
+ placeholder: "Y",
182
+ description: "顶层页面视口 CSS 像素坐标"
183
+ },
184
+ {
185
+ name: "button",
186
+ type: "string",
187
+ placeholder: "left|right",
188
+ description: "鼠标键(默认 left)"
189
+ },
190
+ {
191
+ name: "click-count",
192
+ type: "string",
193
+ placeholder: "1|2",
194
+ description: "点击次数(默认 1)"
195
+ },
196
+ {
197
+ name: "key",
198
+ type: "string",
199
+ placeholder: "KEY",
200
+ description: "Escape / Enter / Tab / ArrowUp / ArrowDown / ArrowLeft / ArrowRight / Backspace"
201
+ },
202
+ {
203
+ name: "text",
204
+ type: "string",
205
+ placeholder: "TEXT",
206
+ description: "插入到当前获得焦点的可编辑控件"
207
+ },
208
+ {
209
+ name: "json",
210
+ type: "boolean",
211
+ description: "以 JSON 输出"
212
+ }
213
+ ];
214
+ const INPUT_ACTION_OPTIONS = {
215
+ click: [
216
+ "x",
217
+ "y",
218
+ "button",
219
+ "click-count"
220
+ ],
221
+ key: ["key"],
222
+ text: ["text"]
223
+ };
224
+ const INPUT_COMMON = /* @__PURE__ */ new Set([
225
+ "port",
226
+ "target",
227
+ "document",
228
+ "confirm",
229
+ "json"
230
+ ]);
231
+ function inputHelp(io) {
232
+ io.out("用法: lceda-connect cdp input <click|key|text> --port PORT --target ID --document UUID --confirm [选项]");
233
+ io.out("仅向指定 PCB 页面派发;不会启动客户端、拉前台或使用系统键鼠。响应只确认 CDP 收到事件。");
234
+ for (const line of formatOptions(INPUT_OPTIONS)) io.out(line);
235
+ }
236
+ async function cmdInput(argv, io) {
237
+ if (argv.length === 0 || argv[0] === "help" || argv[0] === "--help" || argv[0] === "-h") {
238
+ inputHelp(io);
239
+ return 0;
240
+ }
241
+ let json = false;
242
+ try {
243
+ const parsed = parseArgs(argv, INPUT_OPTIONS);
244
+ json = boolValue(parsed, "json");
245
+ const kind = parsed.positionals[0];
246
+ if (parsed.positionals.length !== 1 || kind !== "click" && kind !== "key" && kind !== "text") throw new CliUsageError("input 需要且只接受一个动作:click / key / text");
247
+ const allowed = INPUT_ACTION_OPTIONS[kind];
248
+ for (const flag of Object.keys(parsed.values)) if (!INPUT_COMMON.has(flag) && !allowed.includes(flag)) throw new CliUsageError(`input ${kind} 不接受 --${flag}`);
249
+ const port = stringValue(parsed, "port");
250
+ const target = stringValue(parsed, "target");
251
+ const documentUuid = stringValue(parsed, "document");
252
+ if (!port || !/^\d{1,5}$/.test(port) || !target || !documentUuid) throw new CliUsageError("input 必须显式提供 --port(整数)、--target 和 --document");
253
+ const decimal = (name) => {
254
+ const value = stringValue(parsed, name);
255
+ return value && /^\d+(?:\.\d+)?$/.test(value) ? Number(value) : NaN;
256
+ };
257
+ const count = stringValue(parsed, "click-count");
258
+ const action = cdpInputActionSchema.safeParse(kind === "click" ? {
259
+ kind,
260
+ x: decimal("x"),
261
+ y: decimal("y"),
262
+ button: stringValue(parsed, "button"),
263
+ clickCount: count === void 0 ? void 0 : count === "1" ? 1 : count === "2" ? 2 : NaN
264
+ } : kind === "key" ? {
265
+ kind,
266
+ key: stringValue(parsed, "key")
267
+ } : {
268
+ kind,
269
+ text: stringValue(parsed, "text")
270
+ });
271
+ if (!action.success) throw new CliUsageError("input 动作参数不合法;请查看 cdp input --help");
272
+ const result = await sendCdpInput({
273
+ port: Number(port),
274
+ target,
275
+ documentUuid,
276
+ confirm: boolValue(parsed, "confirm"),
277
+ action: action.data
278
+ });
279
+ if (json) emitJson(io, {
280
+ ok: true,
281
+ ...result
282
+ });
283
+ else io.out(`CDP 已确认 ${result.dispatched} 个事件;请另行回读编辑器操作结果。`);
284
+ return 0;
285
+ } catch (error) {
286
+ return reportError(io, error instanceof CliUsageError ? new CdpError("CDP_INPUT_INVALID", error.message, { exitCode: 1 }) : error, json);
287
+ }
288
+ }
145
289
  function cdpClientHelp() {
146
290
  return [
147
291
  "",
@@ -156,6 +300,7 @@ function cdpClientHelp() {
156
300
  " eval 在页面里执行 JS(默认只读)",
157
301
  " shot 截取当前页面可视区",
158
302
  " docs 文档列表 / 当前文档 / 打开文档",
303
+ " input 向指定 PCB 页面派发输入(input --help)",
159
304
  " help 这个帮助",
160
305
  "",
161
306
  paint.white(" 通用选项:"),
@@ -502,6 +647,7 @@ async function cmdDocs(rest, parsed, io, host, port, env, json) {
502
647
  }
503
648
  async function runCdpClientCommand(argv, io, env) {
504
649
  const first = argv[0]?.toLowerCase();
650
+ if (first === "input") return await cmdInput(argv.slice(1), io);
505
651
  if (argv.length === 0 || first === "help" || first === "-h" || first === "--help") {
506
652
  printHelp(io);
507
653
  return 0;
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as main } from "./main-D4XmxX8M.mjs";
2
+ import { t as main } from "./main-CcKvXSJG.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-D4XmxX8M.mjs";
2
+ import { t as main } from "./main-CcKvXSJG.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-D4XmxX8M.mjs";
2
+ import { t as main } from "./main-CcKvXSJG.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-D4XmxX8M.mjs";
2
+ import { t as main } from "./main-CcKvXSJG.mjs";
3
3
  // src/cli.ts
4
4
  process.exitCode = await main({ argv: process.argv.slice(2) });
5
5
  export {};
@@ -62,32 +62,6 @@ function loadConfig(env = process.env, overrides = {}) {
62
62
  }
63
63
  };
64
64
  }
65
- // src/core/term.ts
66
- /** 极简 ANSI 着色:非 TTY / NO_COLOR / --json 场景自动降级为纯文本。 */
67
- const COLOR_ENABLED = (() => {
68
- const env = process.env;
69
- if (env.NO_COLOR !== void 0 && env.NO_COLOR !== "") return false;
70
- if (env.FORCE_COLOR !== void 0 && env.FORCE_COLOR !== "0") return true;
71
- return Boolean(process.stdout.isTTY);
72
- })();
73
- function painter(open, close) {
74
- return (text) => COLOR_ENABLED ? `\u001B[${open}m${text}\u001B[${close}m` : text;
75
- }
76
- const paint = {
77
- cyan: painter(36, 39),
78
- green: painter(32, 39),
79
- yellow: painter(33, 39),
80
- red: painter(31, 39),
81
- gray: painter(90, 39),
82
- white: painter(97, 39),
83
- darkRed: painter(31, 39),
84
- bold: painter(1, 22),
85
- dim: painter(2, 22)
86
- };
87
- /** 中文对齐时 `-` 分隔线(按显示宽度无关的固定长度即可)。 */
88
- function hr(width = 58) {
89
- return "-".repeat(width);
90
- }
91
65
  // src/cdp/errors.ts
92
66
  /**
93
67
  * CDP 客户端的领域错误。
@@ -368,4 +342,4 @@ function parsePortRange(text) {
368
342
  if (low <= 0 || low > 65535 || high < low || high > 65535) return null;
369
343
  return [low, high];
370
344
  }
371
- export { DEFAULT_PRO_EXE as C, DEFAULT_CDP_PORT$1 as S, loadConfig as T, asCdpError as _, defaultPortFromEnv as a, hr as b, fetchJson as c, profileLabel as d, requireLoopbackHost as f, CdpError as g, versionWebSocketUrl as h, browserUuid as i, parseBrowserUuidLine as l, versionBrowser as m, DEFAULT_CDP_PORT as n, discover as o, resolveEndpoint as p, attributionOf as r, endpointUrl as s, DEFAULT_CDP_HOST as t, parsePortRange as u, clipText as v, homeDir as w, paint as x, coerceText as y };
345
+ export { loadConfig as C, homeDir as S, asCdpError as _, defaultPortFromEnv as a, DEFAULT_CDP_PORT$1 as b, fetchJson as c, profileLabel as d, requireLoopbackHost as f, CdpError as g, versionWebSocketUrl as h, browserUuid as i, parseBrowserUuidLine as l, versionBrowser as m, DEFAULT_CDP_PORT as n, discover as o, resolveEndpoint as p, attributionOf as r, endpointUrl as s, DEFAULT_CDP_HOST as t, parsePortRange as u, clipText as v, DEFAULT_PRO_EXE as x, coerceText as y };
package/dist/index.d.mts CHANGED
@@ -6,6 +6,7 @@ export declare const DEFAULT_CDP_PORT = 9222;
6
6
  interface CdpConfig {
7
7
  exePath: string;
8
8
  port: number;
9
+ /** CLI 探测端点的回环地址,不控制客户端的监听地址。 */
9
10
  bindHost: string;
10
11
  runtimeDir: string;
11
12
  pidFile: string;
package/dist/index.mjs CHANGED
@@ -1,17 +1,18 @@
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-D4XmxX8M.mjs";
2
+ import { C as loadConfig, b as DEFAULT_CDP_PORT, x as DEFAULT_PRO_EXE } from "./discover-D5mRrsxg.mjs";
3
+ import { n as runCdpAction, r as runBridgeAction, t as main } from "./main-CcKvXSJG.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-D6ReiPB6.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-Dmti2u6s.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-C7NJHDXj.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 { i as serveStdio, n as createServer } from "./server-BduSjwzu.mjs";
15
16
  import { n as defineTool, t as ToolError } from "./types-D5d7ZRYF.mjs";
16
17
  // src/epro2/index.ts
17
18
  var epro2_exports = /* @__PURE__ */ __exportAll({
@@ -1,5 +1,6 @@
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 { T as loadConfig, b as hr, l as parseBrowserUuidLine, w as homeDir, x as paint } from "./discover-D4ouuCrn.mjs";
2
+ import { C as loadConfig, S as homeDir, l as parseBrowserUuidLine } from "./discover-D5mRrsxg.mjs";
3
+ import { n as paint, t as hr } from "./term-DlGIoccA.mjs";
3
4
  import { t as packageVersion } from "./version-B39-elun.mjs";
4
5
  import { a as packageRoot } from "./assets-D48xh-kr.mjs";
5
6
  import { t as run } from "./exec-FuC8m-_m.mjs";
@@ -1453,13 +1454,11 @@ function clearProxyEnvironment(env) {
1453
1454
  return cleared;
1454
1455
  }
1455
1456
  /**
1456
- * 拼启动参数。**顺序不可重排**:客户端内部有两条自重启路径,其中「清理缓存」那条
1457
- * 只把 process.argv[1] 传给新进程(app.js: spawn(process.argv[0], [process.argv[1], ...]))。
1458
- * 端口放第一位,自重启后才还能带上调试端口;绑地址与代理参数会被丢掉——绑地址默认
1459
- * 就是 127.0.0.1,代理参数只在显式指定 --proxy-server 时有差异。
1457
+ * 调试端口放在第一位,兼容只透传 process.argv[1] 的客户端重启路径。
1458
+ * 为兼容不识别 --remote-debugging-address 的客户端,监听地址交由 Chromium 默认处理。
1460
1459
  */
1461
- function buildStartArgs(port, bindHost, proxyServer) {
1462
- const args = [`--remote-debugging-port=${port}`, `--remote-debugging-address=${bindHost}`];
1460
+ function buildStartArgs(port, proxyServer) {
1461
+ const args = [`--remote-debugging-port=${port}`];
1463
1462
  if (proxyServer) args.push(`--proxy-server=${proxyServer}`);
1464
1463
  return args;
1465
1464
  }
@@ -1669,7 +1668,7 @@ async function runStart(options, ctx, label = "start") {
1669
1668
  for (const item of cleared) reporter.say(` ${item}`);
1670
1669
  }
1671
1670
  }
1672
- const startArgs = buildStartArgs(cfg.cdp.port, cfg.cdp.bindHost, options.proxyServer);
1671
+ const startArgs = buildStartArgs(cfg.cdp.port, options.proxyServer);
1673
1672
  let ready = await probeNetReady();
1674
1673
  if (!ready && options.waitOnlineSec > 0) {
1675
1674
  reporter.say(`网络未就绪,最多等 ${options.waitOnlineSec} 秒(先让代理 / 校园网连上)…`, paint.yellow);
@@ -2127,6 +2126,7 @@ function cdpHelp() {
2127
2126
  " eval 在编辑器页面里求值(默认拒绝有副作用的表达式)",
2128
2127
  " shot 截图落盘",
2129
2128
  " docs 文档列表 / 当前文档 / 打开文档",
2129
+ " input 向指定 PCB 页面派发输入;见 input --help",
2130
2130
  paint.gray(" (lceda-cdp eval --help 查看这些动作的详细参数)"),
2131
2131
  "",
2132
2132
  paint.white(" 选项:"),
@@ -2175,6 +2175,11 @@ function bridgeHelp() {
2175
2175
  * 启动时把所有领域模块都读进来。
2176
2176
  */
2177
2177
  const DOMAIN_GROUPS = [
2178
+ {
2179
+ name: "extension",
2180
+ summary: "预检 .eext;在隔离的可见客户端安装、卸载扩展(实验性,仅 CLI)",
2181
+ load: async () => (await import("./cli-C4ZkWlV2.mjs")).runExtensionCommand
2182
+ },
2178
2183
  {
2179
2184
  name: "api",
2180
2185
  summary: "离线检索 EasyEDA Pro 扩展 API 文档(search / get)",
@@ -2183,7 +2188,7 @@ const DOMAIN_GROUPS = [
2183
2188
  {
2184
2189
  name: "epro2",
2185
2190
  summary: "离线解析 .epro2 工程:网表、PCB 几何、一致性报告、版本对比",
2186
- load: async () => (await import("./cli-BzrDKC7x.mjs")).runEpro2Command
2191
+ load: async () => (await import("./cli-CHbcaMwS.mjs")).runEpro2Command
2187
2192
  },
2188
2193
  {
2189
2194
  name: "eprj3",
@@ -2198,12 +2203,12 @@ const DOMAIN_GROUPS = [
2198
2203
  {
2199
2204
  name: "eda",
2200
2205
  summary: "编辑器动词:双通道自检、读板、DRC、板指纹、自动布线、动词台账检索",
2201
- load: async () => (await import("./cli-DSk_viv1.mjs")).runEdaCommand
2206
+ load: async () => (await import("./cli-C6saKrQp.mjs")).runEdaCommand
2202
2207
  },
2203
2208
  {
2204
2209
  name: "sim",
2205
2210
  summary: "ngspice 仿真:网表生成、运行、raw 解析、指标、叠层与 Touchstone",
2206
- load: async () => (await import("./cli-BqILMvnF.mjs")).runSimCommand
2211
+ load: async () => (await import("./cli-CZEoeuFW.mjs")).runSimCommand
2207
2212
  }
2208
2213
  ];
2209
2214
  /** cdp 命令组里由 CDP 客户端(src/cdp)处理的动作,其余仍归启动器。 */
@@ -2213,7 +2218,8 @@ const CDP_CLIENT_ACTIONS = [
2213
2218
  "frames",
2214
2219
  "eval",
2215
2220
  "shot",
2216
- "docs"
2221
+ "docs",
2222
+ "input"
2217
2223
  ];
2218
2224
  /** bridge 命令组里由 bridge 客户端(src/bridge)处理的动作,其余仍归服务管理。 */
2219
2225
  const BRIDGE_CLIENT_ACTIONS = [
@@ -2272,7 +2278,7 @@ async function runMcpGroup(argv, io, env) {
2272
2278
  }
2273
2279
  const selected = toolsets ?? env.LCEDA_TOOLSETS;
2274
2280
  if (action === "tools") {
2275
- const { toolsForEnv } = await import("./registry-Bs3kpMhy.mjs");
2281
+ const { toolsForEnv } = await import("./registry-zIKWeXV6.mjs");
2276
2282
  try {
2277
2283
  for (const tool of toolsForEnv(env, selected)) io.out(`${paint.cyan(tool.name.padEnd(28))} ${tool.description.split("。")[0] ?? ""}`);
2278
2284
  return 0;
@@ -2282,7 +2288,7 @@ async function runMcpGroup(argv, io, env) {
2282
2288
  }
2283
2289
  }
2284
2290
  if (action === "serve") {
2285
- const { serveStdio } = await import("./server-s5NZcVym.mjs");
2291
+ const { serveStdio } = await import("./server-Chka6eAQ.mjs");
2286
2292
  try {
2287
2293
  await serveStdio(env, selected);
2288
2294
  return 0;
@@ -2333,7 +2339,7 @@ async function main(options) {
2333
2339
  }
2334
2340
  const clientAction = tail[0]?.trim().toLowerCase() ?? "";
2335
2341
  if (group === "cdp" && CDP_CLIENT_ACTIONS.includes(clientAction)) {
2336
- const { runCdpClientCommand } = await import("./cli-DhHRbgp_.mjs");
2342
+ const { runCdpClientCommand } = await import("./cli-CjcJVM6z.mjs");
2337
2343
  return await runCdpClientCommand(tail, io, env);
2338
2344
  }
2339
2345
  if (group === "bridge" && BRIDGE_CLIENT_ACTIONS.includes(clientAction)) {
@@ -3,17 +3,18 @@ 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 activeDocument, c as Board, i as screenshotToFile, l as detectState, o as listDocuments, s as openDocument, t as classifyEval, u as normalizeState } from "./sideEffects-B34zsl2C.mjs";
7
- import { _ as asCdpError, h as versionWebSocketUrl, m as versionBrowser, o as discover$1, p as resolveEndpoint, r as attributionOf, s as endpointUrl, u as parsePortRange } from "./discover-D4ouuCrn.mjs";
8
- import { d as redact, i as listTargets, l as evaluateInContext, u as planEval } from "./targets-DiGwICXT.mjs";
9
- 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-CcrO8f9q.mjs";
10
- import { C as compare, Ct as safeWriteText, D as summarize, St as safeWriteJson, c as runSingle, lt as ProjectError, n as checkConsistency, o as inspectProject, r as collect, s as runDiff, t as analyzeSummary, yt as ensureSafeOutputDir } from "./analyze-DBkWgG82.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-DF_tIVsf.mjs";
7
+ import { _ as asCdpError, h as versionWebSocketUrl, m as versionBrowser, o as discover$1, p as resolveEndpoint, r as attributionOf, s as endpointUrl, u as parsePortRange } from "./discover-D5mRrsxg.mjs";
8
+ import { a as evaluateInContext, l as redact, o as planEval } from "./session-DvIXO5Hf.mjs";
9
+ import { i as listTargets } from "./targets-D5nmbsyz.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-5M7rj1-E.mjs";
11
+ 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";
11
12
  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";
12
13
  import { a as getPrimitive, i as getFormatLog, o as listTypes, r as getExample } from "./knowledge-CX8Hrnoe.mjs";
13
14
  import { i as validateLine, r as validateFormat } from "./record-CHXWiMWA.mjs";
14
- 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-DOhfmSNh.mjs";
15
+ 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";
15
16
  import { i as listAssetFiles, r as assetsDir, s as readAssetText, t as assetExists } from "./assets-D48xh-kr.mjs";
16
- import "./main-D4XmxX8M.mjs";
17
+ import "./main-CcKvXSJG.mjs";
17
18
  import path from "node:path";
18
19
  import { existsSync, readFileSync } from "node:fs";
19
20
  import { z } from "zod";
@@ -1617,6 +1618,30 @@ const cdpUiStateTool = defineTool({
1617
1618
  }
1618
1619
  }
1619
1620
  });
1621
+ const cdpInputTool = defineTool({
1622
+ name: "cdp_input",
1623
+ description: "向本机指定 PCB 页面派发一次鼠标点击、有限按键或文本,不启动客户端或拉前台。仅在编辑器 API 不适用时使用;必须确认并指定端口、精确 target 和当前 PCB UUID。结果仅代表 CDP 确认,须另行回读实际效果;结果不确定时不要自动重试。",
1624
+ input: {
1625
+ port: z.number().int().min(1).max(65535),
1626
+ target: z.string().min(1).max(128).describe("cdp_targets 返回的精确页面 target ID"),
1627
+ documentUuid: z.string().min(1).max(128).describe("预期的当前 PCB 文档 UUID"),
1628
+ action: cdpInputActionSchema,
1629
+ confirm: z.boolean().optional()
1630
+ },
1631
+ annotations: {
1632
+ readOnlyHint: false,
1633
+ destructiveHint: true,
1634
+ idempotentHint: false,
1635
+ openWorldHint: false
1636
+ },
1637
+ handler: async (args, ctx) => {
1638
+ try {
1639
+ return await sendCdpInput(args, { signal: ctx.signal });
1640
+ } catch (error) {
1641
+ fail$1(error);
1642
+ }
1643
+ }
1644
+ });
1620
1645
  function parseScan(value) {
1621
1646
  if (!value) return void 0;
1622
1647
  const range = parsePortRange(value);
@@ -1632,7 +1657,8 @@ const cdpTools = [
1632
1657
  cdpDocListTool,
1633
1658
  cdpDocActiveTool,
1634
1659
  cdpDocOpenTool,
1635
- cdpUiStateTool
1660
+ cdpUiStateTool,
1661
+ cdpInputTool
1636
1662
  ];
1637
1663
  // src/eda/mcpTools.ts
1638
1664
  /**
@@ -0,0 +1 @@
1
+ export { r as toolsForEnv } from "./registry-Dmti2u6s.mjs";
@@ -1,9 +1,9 @@
1
1
  import { i as listAssetFiles, s as readAssetText } from "./assets-D48xh-kr.mjs";
2
- import { T as loadConfig } from "./discover-D4ouuCrn.mjs";
3
- import { bt as resolveMcpWritePath } from "./analyze-DBkWgG82.mjs";
2
+ import { C as loadConfig } from "./discover-D5mRrsxg.mjs";
3
+ import { pt as resolveMcpWritePath } from "./analyze-TRlZx-Jv.mjs";
4
4
  import { t as packageVersion } from "./version-B39-elun.mjs";
5
- import "./main-D4XmxX8M.mjs";
6
- import { i as toolsetsForTools, r as toolsForEnv } from "./registry-D6ReiPB6.mjs";
5
+ import "./main-CcKvXSJG.mjs";
6
+ import { i as toolsetsForTools, r as toolsForEnv } from "./registry-Dmti2u6s.mjs";
7
7
  import { r as normalizeToolContext, t as ToolError } from "./types-D5d7ZRYF.mjs";
8
8
  import os from "node:os";
9
9
  import path from "node:path";
@@ -0,0 +1 @@
1
+ export { i as serveStdio } from "./server-BduSjwzu.mjs";
@@ -1,4 +1,4 @@
1
- import { c as fetchJson, f as requireLoopbackHost, g as CdpError, n as DEFAULT_CDP_PORT, v as clipText, y as coerceText } from "./discover-D4ouuCrn.mjs";
1
+ import { f as requireLoopbackHost, g as CdpError, n as DEFAULT_CDP_PORT, v as clipText, y as coerceText } from "./discover-D5mRrsxg.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";
@@ -741,38 +741,4 @@ function parseResponse(raw) {
741
741
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) throw new CdpError("CDP_PROTOCOL", "CDP 返回的 JSON 不是对象");
742
742
  return parsed;
743
743
  }
744
- // src/cdp/targets.ts
745
- /** `GET /json/list`;拿不到或返回不是数组时返回空列表(与源仓库一致)。 */
746
- async function listTargets(host, port, timeoutMs, signal) {
747
- const payload = await fetchJson(host, port, "/json/list", timeoutMs, signal);
748
- if (!Array.isArray(payload)) return [];
749
- return payload.filter((item) => item !== null && typeof item === "object" && !Array.isArray(item));
750
- }
751
- /** 打开 Page 域并取当前页面的 frame 树。 */
752
- async function fetchFrameTree(session) {
753
- await session.call("Page.enable");
754
- return (await session.call("Page.getFrameTree")).frameTree ?? null;
755
- }
756
- /** 深度优先压平 frame 树;name 缺失时用 `(main)` 占位(源仓库口径)。 */
757
- function flattenFrameTree(tree, depth = 0) {
758
- if (!tree) return [];
759
- const frame = tree.frame ?? {};
760
- const rows = [{
761
- depth,
762
- name: typeof frame.name === "string" && frame.name !== "" ? frame.name : "(main)",
763
- url: typeof frame.url === "string" && frame.url !== "" ? frame.url : "about:blank"
764
- }];
765
- for (const child of tree.childFrames ?? []) rows.push(...flattenFrameTree(child, depth + 1));
766
- return rows;
767
- }
768
- /** 每行 frame 输出两行文本:`- name` 与缩进后的 url(与源仓库 `frames` 同形)。 */
769
- function formatFrameTree(rows) {
770
- const lines = [];
771
- for (const row of rows) {
772
- const indent = " ".repeat(row.depth);
773
- lines.push(`${indent}- ${row.name}`);
774
- lines.push(`${indent} ${row.url}`);
775
- }
776
- return lines;
777
- }
778
- export { CdpSession as a, evaluateExpression as c, redact as d, listTargets as i, evaluateInContext as l, flattenFrameTree as n, EvalUsageError as o, formatFrameTree as r, apiExpression as s, fetchFrameTree as t, planEval as u };
744
+ export { evaluateInContext as a, probeUiShell as c, evaluateExpression as i, redact as l, EvalUsageError as n, planEval as o, apiExpression as r, UI_SHELL_MARKERS as s, CdpSession as t };