easyeda-mcp-pro 0.18.0 → 0.20.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 (39) hide show
  1. package/README.md +66 -29
  2. package/dist/bridge/types.d.ts +1 -0
  3. package/dist/bridge/types.js +1 -0
  4. package/dist/bridge/types.js.map +1 -1
  5. package/dist/circuit/circuit-ir.d.ts +2 -2
  6. package/dist/circuit/compiler.d.ts +7 -4
  7. package/dist/circuit/compiler.js +95 -29
  8. package/dist/circuit/compiler.js.map +1 -1
  9. package/dist/circuit/component-planning.d.ts +63 -0
  10. package/dist/circuit/component-planning.js +140 -0
  11. package/dist/circuit/component-planning.js.map +1 -0
  12. package/dist/circuit/index.d.ts +2 -0
  13. package/dist/circuit/index.js +2 -0
  14. package/dist/circuit/index.js.map +1 -1
  15. package/dist/config/profiles.js +5 -5
  16. package/dist/config/version.d.ts +1 -1
  17. package/dist/config/version.js +1 -1
  18. package/dist/remote/gateway.d.ts +74 -0
  19. package/dist/remote/gateway.js +484 -0
  20. package/dist/remote/gateway.js.map +1 -0
  21. package/dist/remote/index.d.ts +1 -0
  22. package/dist/remote/index.js +1 -0
  23. package/dist/remote/index.js.map +1 -1
  24. package/dist/remote/protocol.d.ts +1 -0
  25. package/dist/remote/session-router.d.ts +2 -0
  26. package/dist/remote/session-router.js +18 -9
  27. package/dist/remote/session-router.js.map +1 -1
  28. package/dist/server/transports/http.d.ts +7 -1
  29. package/dist/server/transports/http.js +68 -12
  30. package/dist/server/transports/http.js.map +1 -1
  31. package/dist/server/transports/oauth-resource-metadata.d.ts +12 -0
  32. package/dist/server/transports/oauth-resource-metadata.js +52 -0
  33. package/dist/server/transports/oauth-resource-metadata.js.map +1 -0
  34. package/dist/tools/L1_schematic_read.js +257 -2
  35. package/dist/tools/L1_schematic_read.js.map +1 -1
  36. package/dist/tools/L1_schematic_write.js +134 -0
  37. package/dist/tools/L1_schematic_write.js.map +1 -1
  38. package/easyeda-bridge-extension.eext +0 -0
  39. package/package.json +1 -1
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Component role and refdes planning for CircuitIR device synthesis.
3
+ *
4
+ * Replaces generic `U?` device stubs with a deterministic, traceable
5
+ * component-role plan: a refdes family, a package/footprint hint, and a
6
+ * planning-state marker that differentiates a confidently-classified
7
+ * candidate device from a low-confidence placeholder.
8
+ *
9
+ * This module intentionally does not select real MPNs, manufacturers, or
10
+ * footprints — it narrows the search space (role + refdes + package family)
11
+ * so a human, BOM-sourcing tool, or downstream planning step can make the
12
+ * final manufacturable selection. See docs/circuit-ir.md for the full
13
+ * synthesis pipeline this module is part of.
14
+ *
15
+ * @module
16
+ */
17
+ import { BlockType } from './types.js';
18
+ /** Deterministic refdes family per component role, matching common schematic convention. */
19
+ export const ROLE_REFDES_PREFIX = {
20
+ 'power-regulator': 'U',
21
+ 'mcu-module': 'U',
22
+ sensor: 'U',
23
+ 'communication-ic': 'U',
24
+ 'analog-ic': 'U',
25
+ connector: 'J',
26
+ 'protection-diode': 'D',
27
+ fuse: 'F',
28
+ 'passive-support': 'C',
29
+ 'generic-ic': 'U',
30
+ };
31
+ /** Conservative package/footprint family hint per role — not a final footprint selection. */
32
+ export const ROLE_PACKAGE_HINT = {
33
+ 'power-regulator': 'SOT-23-5 or TO-220 (select by current/thermal rating)',
34
+ 'mcu-module': 'QFN/LQFP or module footprint (select by MCU family)',
35
+ sensor: 'Manufacturer-specific package (verify against the selected sensor datasheet)',
36
+ 'communication-ic': 'SOIC/QFN (select by the selected transceiver/PHY datasheet)',
37
+ 'analog-ic': 'SOIC/SOT package (select by the selected part datasheet)',
38
+ connector: 'THT or SMD connector footprint (select by mechanical/mating requirements)',
39
+ 'protection-diode': 'SOD-123/SMA (select by clamping voltage and current rating)',
40
+ fuse: '0603/1206 SMD fuse or THT fuse holder (select by current rating)',
41
+ 'passive-support': '0402/0603 SMD passive (select values during schematic entry)',
42
+ 'generic-ic': 'TBD — insufficient design intent to suggest a package family',
43
+ };
44
+ /** Metadata keys the compiler attaches to each planned Device. */
45
+ export const COMPONENT_PLAN_METADATA_KEYS = {
46
+ role: 'role',
47
+ packageHint: 'packageHint',
48
+ planningState: 'planningState',
49
+ };
50
+ /**
51
+ * Determine a component role for a Block from its `type` and free-text
52
+ * `description` (the compiled block's purpose). Keyword matches on the
53
+ * description take priority over the coarse `type` field because the
54
+ * DesignIntent functional-block `type` is intentionally low-resolution
55
+ * (e.g. "power-management" covers both regulators and passive filter
56
+ * stages).
57
+ */
58
+ export function determineComponentRole(block) {
59
+ const text = `${block.type} ${block.description ?? ''}`.toLowerCase();
60
+ if (text.includes('connector') ||
61
+ text.includes('header') ||
62
+ text.includes('usb') ||
63
+ text.includes('jack')) {
64
+ return { role: 'connector', confidence: 'high' };
65
+ }
66
+ if (text.includes('fuse') || text.includes('polyfuse') || text.includes('ptc')) {
67
+ return { role: 'fuse', confidence: 'high' };
68
+ }
69
+ if (text.includes('filter') || text.includes('decoupl') || text.includes('bypass')) {
70
+ return { role: 'passive-support', confidence: 'high' };
71
+ }
72
+ switch (block.type) {
73
+ case BlockType.PowerManagement:
74
+ return { role: 'power-regulator', confidence: 'high' };
75
+ case BlockType.Microcontroller:
76
+ return { role: 'mcu-module', confidence: 'high' };
77
+ case BlockType.Sensor:
78
+ return { role: 'sensor', confidence: 'high' };
79
+ case BlockType.Communication:
80
+ return { role: 'communication-ic', confidence: 'high' };
81
+ case BlockType.Interface:
82
+ return { role: 'connector', confidence: 'high' };
83
+ case BlockType.Protection:
84
+ return { role: 'protection-diode', confidence: 'high' };
85
+ case BlockType.Analog:
86
+ return { role: 'analog-ic', confidence: 'high' };
87
+ default:
88
+ return { role: 'generic-ic', confidence: 'low' };
89
+ }
90
+ }
91
+ /**
92
+ * Plan one candidate Device per Block: a deterministic refdes, a component
93
+ * role, and a package-family hint, recorded as Device metadata alongside
94
+ * a `planningState` of `candidate` (role inferred with high confidence) or
95
+ * `placeholder` (role could not be determined; manual classification
96
+ * required).
97
+ *
98
+ * Refdes numbering is deterministic and stable across repeated compiles of
99
+ * the same DesignIntent, because it is derived solely from block order.
100
+ */
101
+ export function planComponents(blocks) {
102
+ const refdesCounters = {};
103
+ const warnings = [];
104
+ const devices = blocks.map((block) => {
105
+ const plan = determineComponentRole({ type: block.type, description: block.description });
106
+ const prefix = ROLE_REFDES_PREFIX[plan.role];
107
+ refdesCounters[prefix] = (refdesCounters[prefix] ?? 0) + 1;
108
+ const ref = `${prefix}${refdesCounters[prefix]}`;
109
+ const planningState = plan.confidence === 'high' ? 'candidate' : 'placeholder';
110
+ if (planningState === 'placeholder') {
111
+ warnings.push(`Block "${block.name}" (${block.id}): insufficient design intent to determine a ` +
112
+ `component role; using a generic placeholder device (${ref}). Provide a more ` +
113
+ `specific block type or purpose to enable manufacturable candidate planning.`);
114
+ }
115
+ const device = {
116
+ id: `dev-${block.id}`,
117
+ ref,
118
+ mpn: undefined,
119
+ manufacturer: undefined,
120
+ package: undefined,
121
+ datasheet: '',
122
+ lcsc: undefined,
123
+ blockRef: block.id,
124
+ designIntentRef: block.designIntentRef,
125
+ metadata: [
126
+ { key: COMPONENT_PLAN_METADATA_KEYS.role, value: plan.role },
127
+ { key: COMPONENT_PLAN_METADATA_KEYS.packageHint, value: ROLE_PACKAGE_HINT[plan.role] },
128
+ { key: COMPONENT_PLAN_METADATA_KEYS.planningState, value: planningState },
129
+ ],
130
+ };
131
+ return device;
132
+ });
133
+ return { devices, warnings };
134
+ }
135
+ /** Read a Device's planned component role back out of its metadata, if present. */
136
+ export function getDeviceRole(device) {
137
+ const value = device.metadata.find((m) => m.key === COMPONENT_PLAN_METADATA_KEYS.role)?.value;
138
+ return value;
139
+ }
140
+ //# sourceMappingURL=component-planning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-planning.js","sourceRoot":"","sources":["../../src/circuit/component-planning.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAy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EAAE,KAAK,CAAC,EAAE;YAClB,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,QAAQ,EAAE;gBACR,EAAE,GAAG,EAAE,4BAA4B,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE;gBAC5D,EAAE,GAAG,EAAE,4BAA4B,CAAC,WAAW,EAAE,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACtF,EAAE,GAAG,EAAE,4BAA4B,CAAC,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;aAC1E;SACF,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,4BAA4B,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IAC9F,OAAO,KAAkC,CAAC;AAC5C,CAAC"}
@@ -15,3 +15,5 @@ export { CircuitIRSchema, CIRCUIT_IR_SCHEMA_VERSION, BlockSchema, DeviceSchema,
15
15
  export type { CircuitIR, Block, Device, Net, NetNode, PowerRail, Interface, InterfacePin, Constraint, BomIntent, PcbIntent, ManufacturingIntent, } from './circuit-ir.js';
16
16
  export { compile, setValidationStatus, isReadyForEasyEDA } from './compiler.js';
17
17
  export type { CompileOptions, CompileResult } from './compiler.js';
18
+ export { ROLE_REFDES_PREFIX, ROLE_PACKAGE_HINT, COMPONENT_PLAN_METADATA_KEYS, determineComponentRole, planComponents, getDeviceRole, } from './component-planning.js';
19
+ export type { ComponentRole, RoleConfidence, ComponentRolePlan, ComponentPlanResult, } from './component-planning.js';
@@ -15,4 +15,6 @@ export { DesignIntentSchema, DESIGN_INTENT_SCHEMA_VERSION, validateDesignIntent,
15
15
  export { CircuitIRSchema, CIRCUIT_IR_SCHEMA_VERSION, BlockSchema, DeviceSchema, NetSchema, NetNodeSchema, PowerRailSchema, InterfaceSchema, InterfacePinSchema, ConstraintSchema, BomIntentSchema, PcbIntentSchema, ManufacturingIntentSchema, validateCircuitIR, isCircuitIR, } from './circuit-ir.js';
16
16
  // Compiler
17
17
  export { compile, setValidationStatus, isReadyForEasyEDA } from './compiler.js';
18
+ // Component planning
19
+ export { ROLE_REFDES_PREFIX, ROLE_PACKAGE_HINT, COMPONENT_PLAN_METADATA_KEYS, determineComponentRole, planComponents, getDeviceRole, } from './component-planning.js';
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/circuit/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,SAAS;AACT,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG5F,QAAQ;AACR,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,eAAe;AACf,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B,YAAY;AACZ,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAgBzB,WAAW;AACX,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/circuit/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,SAAS;AACT,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG5F,QAAQ;AACR,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,eAAe;AACf,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B,YAAY;AACZ,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAgBzB,WAAW;AACX,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGhF,qBAAqB;AACrB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EACtB,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC"}
@@ -3,35 +3,35 @@ export const PROFILE_DEFINITIONS = {
3
3
  name: 'core',
4
4
  label: 'Core',
5
5
  description: 'High-confidence tools: diagnostics, EasyEDA API inventory, schematic, BOM, DRC/ERC, board layers/stackup, Gerber export',
6
- approxToolCount: '42',
6
+ approxToolCount: '44',
7
7
  isDefault: true,
8
8
  },
9
9
  pro: {
10
10
  name: 'pro',
11
11
  label: 'Pro',
12
12
  description: 'Adds pick-and-place, PDF, netlist export for manufacturing workflows',
13
- approxToolCount: '47',
13
+ approxToolCount: '49',
14
14
  isDefault: false,
15
15
  },
16
16
  full: {
17
17
  name: 'full',
18
18
  label: 'Full',
19
19
  description: 'Adds controlled documented EasyEDA API method calls for full runtime control without raw JavaScript execution',
20
- approxToolCount: '56',
20
+ approxToolCount: '58',
21
21
  isDefault: false,
22
22
  },
23
23
  dev: {
24
24
  name: 'dev',
25
25
  label: 'Dev',
26
26
  description: 'Adds diagnostics probes for bridge methods and live component runtime shape inspection',
27
- approxToolCount: '60',
27
+ approxToolCount: '62',
28
28
  isDefault: false,
29
29
  },
30
30
  experimental: {
31
31
  name: 'experimental',
32
32
  label: 'Experimental',
33
33
  description: 'MCP Apps, Tasks, simulation, autorouter, AI action plans',
34
- approxToolCount: '56',
34
+ approxToolCount: '58',
35
35
  isDefault: false,
36
36
  },
37
37
  };
@@ -1 +1 @@
1
- export declare const SERVER_VERSION = "0.18.0";
1
+ export declare const SERVER_VERSION = "0.20.0";
@@ -1,2 +1,2 @@
1
- export const SERVER_VERSION = '0.18.0'; // x-release-please-version
1
+ export const SERVER_VERSION = '0.20.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,74 @@
1
+ import type { Server as HttpServer } from 'node:http';
2
+ import type { Express, Request, Response } from 'express';
3
+ import { type EnvConfig } from '../config/env.js';
4
+ import { ApprovalStore } from './approval-policy.js';
5
+ import { RemoteAuditLog } from './observability.js';
6
+ import { type RemoteDeploymentMode, type RemoteRiskLevel, type ToolRequestMessage, type ToolResponseMessage } from './protocol.js';
7
+ import { type RemoteIdentity } from './scope.js';
8
+ import { type ExtensionSession, RemoteSessionRouter } from './session-router.js';
9
+ export type RemoteGatewayErrorCode = 'BAD_REQUEST' | 'IDENTITY_MISSING' | 'IDENTITY_EXPIRED' | 'SCOPE_MISSING' | 'SESSION_UNPAIRED' | 'SESSION_DISCONNECTED' | 'SESSION_EXPIRED' | 'SESSION_AMBIGUOUS' | 'PROJECT_INACTIVE' | 'APPROVAL_REQUIRED' | 'APPROVAL_NOT_APPROVED' | 'REMOTE_EXTENSION_ERROR' | 'REMOTE_EXTENSION_TIMEOUT';
10
+ export type RemoteGatewayToolResult = {
11
+ ok: true;
12
+ sessionId: string;
13
+ toolName: string;
14
+ result: unknown;
15
+ durationMs: number;
16
+ } | {
17
+ ok: false;
18
+ status: number;
19
+ code: RemoteGatewayErrorCode;
20
+ message: string;
21
+ };
22
+ export type RemoteToolDispatcher = (request: ToolRequestMessage) => Promise<ToolResponseMessage>;
23
+ export interface RemoteGatewayOptions {
24
+ router?: RemoteSessionRouter;
25
+ approvals?: ApprovalStore;
26
+ audit?: RemoteAuditLog;
27
+ now?: () => Date;
28
+ makeId?: () => string;
29
+ hashInput?: (value: unknown) => string;
30
+ }
31
+ export declare function identityFromRequest(req: Request, res: Response, config: EnvConfig): RemoteIdentity | undefined;
32
+ export declare class RemoteGateway {
33
+ readonly router: RemoteSessionRouter;
34
+ readonly approvals: ApprovalStore;
35
+ readonly audit: RemoteAuditLog;
36
+ private readonly connections;
37
+ private readonly now;
38
+ private readonly makeId;
39
+ private readonly hashInput;
40
+ private wsAttached;
41
+ constructor(options?: RemoteGatewayOptions);
42
+ registerExtension(input: {
43
+ connectionId: string;
44
+ mode: Exclude<RemoteDeploymentMode, 'local'>;
45
+ extensionVersion: string;
46
+ activeProject?: ExtensionSession['activeProject'];
47
+ ttlMs?: number;
48
+ dispatch: RemoteToolDispatcher;
49
+ pairingCode?: string;
50
+ }): ExtensionSession;
51
+ createPairingCode(input: {
52
+ identity: RemoteIdentity;
53
+ sessionId?: string;
54
+ ttlMs?: number;
55
+ }): string;
56
+ completePairing(input: {
57
+ identity: RemoteIdentity;
58
+ code: string;
59
+ sessionId: string;
60
+ }): boolean;
61
+ disconnect(sessionId: string): void;
62
+ routeToolRequest(input: {
63
+ identity?: RemoteIdentity;
64
+ sessionId?: string;
65
+ toolName: string;
66
+ riskLevel: RemoteRiskLevel;
67
+ input?: unknown;
68
+ approvalId?: string;
69
+ deadlineMs?: number;
70
+ }): Promise<RemoteGatewayToolResult>;
71
+ registerHttpRoutes(app: Express, config: EnvConfig): void;
72
+ attachWebSocketServer(server: HttpServer): void;
73
+ private handleRelaySocket;
74
+ }