easyeda-mcp-pro 0.17.1 → 0.19.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.
- package/README.md +5 -0
- package/dist/circuit/compiler.d.ts +7 -4
- package/dist/circuit/compiler.js +95 -29
- package/dist/circuit/compiler.js.map +1 -1
- package/dist/circuit/component-planning.d.ts +63 -0
- package/dist/circuit/component-planning.js +140 -0
- package/dist/circuit/component-planning.js.map +1 -0
- package/dist/circuit/index.d.ts +2 -0
- package/dist/circuit/index.js +2 -0
- package/dist/circuit/index.js.map +1 -1
- package/dist/config/version.d.ts +1 -1
- package/dist/config/version.js +1 -1
- package/dist/remote/approval-policy.d.ts +33 -0
- package/dist/remote/approval-policy.js +41 -0
- package/dist/remote/approval-policy.js.map +1 -0
- package/dist/remote/gateway.d.ts +74 -0
- package/dist/remote/gateway.js +484 -0
- package/dist/remote/gateway.js.map +1 -0
- package/dist/remote/index.d.ts +6 -0
- package/dist/remote/index.js +7 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/observability.d.ts +27 -0
- package/dist/remote/observability.js +37 -0
- package/dist/remote/observability.js.map +1 -0
- package/dist/remote/protocol.d.ts +322 -0
- package/dist/remote/protocol.js +104 -0
- package/dist/remote/protocol.js.map +1 -0
- package/dist/remote/scope.d.ts +16 -0
- package/dist/remote/scope.js +25 -0
- package/dist/remote/scope.js.map +1 -0
- package/dist/remote/session-router.d.ts +56 -0
- package/dist/remote/session-router.js +147 -0
- package/dist/remote/session-router.js.map +1 -0
- package/dist/server/transports/http.d.ts +7 -1
- package/dist/server/transports/http.js +68 -12
- package/dist/server/transports/http.js.map +1 -1
- package/dist/server/transports/oauth-resource-metadata.d.ts +12 -0
- package/dist/server/transports/oauth-resource-metadata.js +52 -0
- package/dist/server/transports/oauth-resource-metadata.js.map +1 -0
- package/easyeda-bridge-extension.eext +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,9 @@
|
|
|
25
25
|
<a href="https://www.bestpractices.dev/projects/13406">
|
|
26
26
|
<img src="https://www.bestpractices.dev/projects/13406/badge" alt="OpenSSF Best Practices" />
|
|
27
27
|
</a>
|
|
28
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/oaslananka/easyeda-mcp-pro">
|
|
29
|
+
<img src="https://api.scorecard.dev/projects/github.com/oaslananka/easyeda-mcp-pro/badge" alt="OpenSSF Scorecard" />
|
|
30
|
+
</a>
|
|
28
31
|
<a href="https://github.com/oaslananka/easyeda-mcp-pro/security/policy">
|
|
29
32
|
<img src="https://img.shields.io/badge/security-policy-blue" alt="Security policy" />
|
|
30
33
|
</a>
|
|
@@ -40,6 +43,8 @@
|
|
|
40
43
|
<a href="docs/vendor-terms.md">Vendor Terms and Unsupported Workflows</a>
|
|
41
44
|
·
|
|
42
45
|
<a href="docs/OPENSSF_BEST_PRACTICES.md">OpenSSF Best Practices</a>
|
|
46
|
+
·
|
|
47
|
+
<a href="docs/REMOTE_MCP_MODES.md">Remote MCP Modes</a>
|
|
43
48
|
</p>
|
|
44
49
|
|
|
45
50
|
</div>
|
|
@@ -10,10 +10,13 @@
|
|
|
10
10
|
* 1. Validates the input DesignIntent.
|
|
11
11
|
* 2. Transforms functional block requirements into Blocks.
|
|
12
12
|
* 3. Creates power Rails from the DesignIntent's rail requirements.
|
|
13
|
-
* 4.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* 4. Plans one candidate Device per Block: a deterministic refdes, a
|
|
14
|
+
* component role, and a package-family hint (see component-planning.ts).
|
|
15
|
+
* 5. Generates power Nets for each rail plus a synthesized common-ground Net.
|
|
16
|
+
* 6. Wires device/power-domain load relationships when unambiguous, and
|
|
17
|
+
* synthesizes candidate connector Interfaces.
|
|
18
|
+
* 7. Copies manufacturing, mechanical, and safety intent into CircuitIR fields.
|
|
19
|
+
* 8. Preserves all traceability IDs.
|
|
17
20
|
*
|
|
18
21
|
* @module
|
|
19
22
|
*/
|
package/dist/circuit/compiler.js
CHANGED
|
@@ -10,10 +10,13 @@
|
|
|
10
10
|
* 1. Validates the input DesignIntent.
|
|
11
11
|
* 2. Transforms functional block requirements into Blocks.
|
|
12
12
|
* 3. Creates power Rails from the DesignIntent's rail requirements.
|
|
13
|
-
* 4.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* 4. Plans one candidate Device per Block: a deterministic refdes, a
|
|
14
|
+
* component role, and a package-family hint (see component-planning.ts).
|
|
15
|
+
* 5. Generates power Nets for each rail plus a synthesized common-ground Net.
|
|
16
|
+
* 6. Wires device/power-domain load relationships when unambiguous, and
|
|
17
|
+
* synthesizes candidate connector Interfaces.
|
|
18
|
+
* 7. Copies manufacturing, mechanical, and safety intent into CircuitIR fields.
|
|
19
|
+
* 8. Preserves all traceability IDs.
|
|
17
20
|
*
|
|
18
21
|
* @module
|
|
19
22
|
*/
|
|
@@ -21,6 +24,7 @@ import { DesignIntentSchema } from './design-intent.js';
|
|
|
21
24
|
import { CircuitIRSchema, CIRCUIT_IR_SCHEMA_VERSION, } from './circuit-ir.js';
|
|
22
25
|
import { ValidationStatus, NetType, ConstraintSeverity } from './types.js';
|
|
23
26
|
import { CircuitError, CircuitErrorCode, fromZodError } from './errors.js';
|
|
27
|
+
import { planComponents, getDeviceRole } from './component-planning.js';
|
|
24
28
|
// ── Defaults ──────────────────────────────────────────────────────────────
|
|
25
29
|
const DEFAULT_OPTIONS = {
|
|
26
30
|
skipValidation: false,
|
|
@@ -54,22 +58,6 @@ function compilePowerRails(designIntent, blocks) {
|
|
|
54
58
|
};
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
|
-
function compileDeviceStubs(blocks) {
|
|
58
|
-
// We create one stub Device per block as a placeholder. The user fills
|
|
59
|
-
// in actual MPNs during the planning step.
|
|
60
|
-
return blocks.map((block) => ({
|
|
61
|
-
id: `dev-${block.id}`,
|
|
62
|
-
ref: `U?`,
|
|
63
|
-
mpn: undefined,
|
|
64
|
-
manufacturer: undefined,
|
|
65
|
-
package: undefined,
|
|
66
|
-
datasheet: '',
|
|
67
|
-
lcsc: undefined,
|
|
68
|
-
blockRef: block.id,
|
|
69
|
-
designIntentRef: block.designIntentRef,
|
|
70
|
-
metadata: [],
|
|
71
|
-
}));
|
|
72
|
-
}
|
|
73
61
|
function compilePowerDomainId(rail) {
|
|
74
62
|
return `pd-${rail.id}`;
|
|
75
63
|
}
|
|
@@ -102,6 +90,77 @@ function compilePowerDomains(rails) {
|
|
|
102
90
|
metadata: [],
|
|
103
91
|
}));
|
|
104
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Synthesize a single common-ground net. Every board with at least one power
|
|
95
|
+
* rail needs a ground reference; this net is intentionally board-wide (not
|
|
96
|
+
* tied to a specific rail or power domain) since DesignIntent does not model
|
|
97
|
+
* multiple isolated ground planes.
|
|
98
|
+
*/
|
|
99
|
+
function compileGroundNet(rails) {
|
|
100
|
+
if (rails.length === 0)
|
|
101
|
+
return [];
|
|
102
|
+
return [
|
|
103
|
+
{
|
|
104
|
+
id: 'net-gnd',
|
|
105
|
+
name: 'GND',
|
|
106
|
+
type: NetType.Ground,
|
|
107
|
+
nodes: [],
|
|
108
|
+
designIntentRef: [],
|
|
109
|
+
metadata: [{ key: 'source', value: 'synthesized-common-ground' }],
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Synthesize a candidate Interface entry for each block whose planned
|
|
115
|
+
* component role is `connector`. Pinout is intentionally empty — DesignIntent
|
|
116
|
+
* does not specify pin-level connector detail — but the Interface node makes
|
|
117
|
+
* the connector's existence and traceability explicit before schematic entry.
|
|
118
|
+
*/
|
|
119
|
+
function compileInterfaceStubs(blocks, devices) {
|
|
120
|
+
const deviceByBlockRef = new Map(devices.map((d) => [d.blockRef, d]));
|
|
121
|
+
return blocks
|
|
122
|
+
.filter((block) => {
|
|
123
|
+
const device = deviceByBlockRef.get(block.id);
|
|
124
|
+
return device ? getDeviceRole(device) === 'connector' : false;
|
|
125
|
+
})
|
|
126
|
+
.map((block) => ({
|
|
127
|
+
id: `iface-${block.id}`,
|
|
128
|
+
name: block.name,
|
|
129
|
+
type: 'connector',
|
|
130
|
+
pinout: [],
|
|
131
|
+
blockRef: block.id,
|
|
132
|
+
designIntentRef: block.designIntentRef,
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Attach each device to the power domain it most plausibly draws from or
|
|
137
|
+
* supplies, and back-fill each power domain's `loadDeviceRefs`.
|
|
138
|
+
*
|
|
139
|
+
* This is intentionally conservative: DesignIntent does not specify which
|
|
140
|
+
* rail a given functional block operates on, so device-level power-domain
|
|
141
|
+
* assignment is only attempted when the design has exactly one rail overall
|
|
142
|
+
* (an unambiguous case). For multi-rail designs the compiler emits a warning
|
|
143
|
+
* instead of guessing a wrong rail assignment.
|
|
144
|
+
*/
|
|
145
|
+
function wirePowerDomainLoads(devices, rails, powerDomains) {
|
|
146
|
+
const warnings = [];
|
|
147
|
+
if (rails.length !== 1 || powerDomains.length !== 1) {
|
|
148
|
+
if (rails.length > 1) {
|
|
149
|
+
warnings.push(`Design declares ${rails.length} power rails; automatic device-to-rail power-domain ` +
|
|
150
|
+
`assignment was skipped because DesignIntent does not specify which rail each block ` +
|
|
151
|
+
`operates on. Assign each Device.powerDomainRef manually during CircuitIR review.`);
|
|
152
|
+
}
|
|
153
|
+
return { devices, powerDomains, warnings };
|
|
154
|
+
}
|
|
155
|
+
const domain = powerDomains[0];
|
|
156
|
+
if (!domain) {
|
|
157
|
+
return { devices, powerDomains, warnings };
|
|
158
|
+
}
|
|
159
|
+
const loadDeviceRefs = devices.map((device) => device.id);
|
|
160
|
+
const updatedDevices = devices.map((device) => ({ ...device, powerDomainRef: domain.id }));
|
|
161
|
+
const updatedDomains = powerDomains.map((pd) => pd.id === domain.id ? { ...pd, loadDeviceRefs } : pd);
|
|
162
|
+
return { devices: updatedDevices, powerDomains: updatedDomains, warnings };
|
|
163
|
+
}
|
|
105
164
|
function compileSignalClasses(designIntent, powerNets) {
|
|
106
165
|
const classes = [
|
|
107
166
|
{
|
|
@@ -175,7 +234,7 @@ function compilePhysicalConstraints(designIntent) {
|
|
|
175
234
|
}
|
|
176
235
|
return constraints;
|
|
177
236
|
}
|
|
178
|
-
function buildCircuitIR(designIntent, blocks, rails, devices, nets, powerDomains, signalClasses, physicalConstraints, opts) {
|
|
237
|
+
function buildCircuitIR(designIntent, blocks, rails, devices, nets, powerDomains, signalClasses, physicalConstraints, interfaces, opts) {
|
|
179
238
|
return {
|
|
180
239
|
$schema: CIRCUIT_IR_SCHEMA_VERSION,
|
|
181
240
|
metadata: {
|
|
@@ -191,7 +250,7 @@ function buildCircuitIR(designIntent, blocks, rails, devices, nets, powerDomains
|
|
|
191
250
|
powerDomains,
|
|
192
251
|
signalClasses,
|
|
193
252
|
physicalConstraints,
|
|
194
|
-
interfaces
|
|
253
|
+
interfaces,
|
|
195
254
|
constraints: [],
|
|
196
255
|
bom: { excludeRefs: [], preferredVendors: [] },
|
|
197
256
|
pcb: {
|
|
@@ -247,16 +306,23 @@ export function compile(input, options) {
|
|
|
247
306
|
const blocks = compileBlocks(designIntent);
|
|
248
307
|
// ── 3. Compile Power Rails ──────────────────────────────────────────────
|
|
249
308
|
const rails = compilePowerRails(designIntent, blocks);
|
|
250
|
-
// ── 4.
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
309
|
+
// ── 4. Plan candidate component roles, refdes, and package hints ───────
|
|
310
|
+
const componentPlan = planComponents(blocks);
|
|
311
|
+
warnings.push(...componentPlan.warnings);
|
|
312
|
+
// ── 5. Create power + ground nets ───────────────────────────────────────
|
|
313
|
+
const powerNets = compilePowerNets(rails);
|
|
314
|
+
const groundNet = compileGroundNet(rails);
|
|
315
|
+
const nets = [...powerNets, ...groundNet];
|
|
254
316
|
// ── 6. Compile professional planning context ───────────────────────────
|
|
255
|
-
const
|
|
256
|
-
|
|
317
|
+
const powerDomainWiring = wirePowerDomainLoads(componentPlan.devices, rails, compilePowerDomains(rails));
|
|
318
|
+
warnings.push(...powerDomainWiring.warnings);
|
|
319
|
+
const devices = powerDomainWiring.devices;
|
|
320
|
+
const powerDomains = powerDomainWiring.powerDomains;
|
|
321
|
+
const signalClasses = compileSignalClasses(designIntent, powerNets);
|
|
257
322
|
const physicalConstraints = compilePhysicalConstraints(designIntent);
|
|
323
|
+
const interfaces = compileInterfaceStubs(blocks, devices);
|
|
258
324
|
// ── 7. Build CircuitIR ──────────────────────────────────────────────────
|
|
259
|
-
const circuitIR = buildCircuitIR(designIntent, blocks, rails, devices, nets, powerDomains, signalClasses, physicalConstraints, opts);
|
|
325
|
+
const circuitIR = buildCircuitIR(designIntent, blocks, rails, devices, nets, powerDomains, signalClasses, physicalConstraints, interfaces, opts);
|
|
260
326
|
// ── 8. Validate output CircuitIR ────────────────────────────────────────
|
|
261
327
|
const parsed = CircuitIRSchema.safeParse(circuitIR);
|
|
262
328
|
if (!parsed.success) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/circuit/compiler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/circuit/compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAgB,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAEL,eAAe,EACf,yBAAyB,GAS1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAWxE,6EAA6E;AAE7E,MAAM,eAAe,GAAmB;IACtC,cAA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AAC,SAAoB;IACpD,OAAO,SAAS,CAAC,QAAQ,CAAC,gBAAgB,KAAK,gBAAgB,CAAC,SAAS,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 type { Block, Device } from './circuit-ir.js';
|
|
18
|
+
export type ComponentRole = 'power-regulator' | 'mcu-module' | 'sensor' | 'communication-ic' | 'analog-ic' | 'connector' | 'protection-diode' | 'fuse' | 'passive-support' | 'generic-ic';
|
|
19
|
+
/** Confidence that the role was inferred correctly from the DesignIntent block. */
|
|
20
|
+
export type RoleConfidence = 'high' | 'low';
|
|
21
|
+
export interface ComponentRolePlan {
|
|
22
|
+
role: ComponentRole;
|
|
23
|
+
confidence: RoleConfidence;
|
|
24
|
+
}
|
|
25
|
+
/** Deterministic refdes family per component role, matching common schematic convention. */
|
|
26
|
+
export declare const ROLE_REFDES_PREFIX: Record<ComponentRole, string>;
|
|
27
|
+
/** Conservative package/footprint family hint per role — not a final footprint selection. */
|
|
28
|
+
export declare const ROLE_PACKAGE_HINT: Record<ComponentRole, string>;
|
|
29
|
+
/** Metadata keys the compiler attaches to each planned Device. */
|
|
30
|
+
export declare const COMPONENT_PLAN_METADATA_KEYS: {
|
|
31
|
+
readonly role: "role";
|
|
32
|
+
readonly packageHint: "packageHint";
|
|
33
|
+
readonly planningState: "planningState";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Determine a component role for a Block from its `type` and free-text
|
|
37
|
+
* `description` (the compiled block's purpose). Keyword matches on the
|
|
38
|
+
* description take priority over the coarse `type` field because the
|
|
39
|
+
* DesignIntent functional-block `type` is intentionally low-resolution
|
|
40
|
+
* (e.g. "power-management" covers both regulators and passive filter
|
|
41
|
+
* stages).
|
|
42
|
+
*/
|
|
43
|
+
export declare function determineComponentRole(block: {
|
|
44
|
+
type: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
}): ComponentRolePlan;
|
|
47
|
+
export interface ComponentPlanResult {
|
|
48
|
+
devices: Device[];
|
|
49
|
+
warnings: string[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Plan one candidate Device per Block: a deterministic refdes, a component
|
|
53
|
+
* role, and a package-family hint, recorded as Device metadata alongside
|
|
54
|
+
* a `planningState` of `candidate` (role inferred with high confidence) or
|
|
55
|
+
* `placeholder` (role could not be determined; manual classification
|
|
56
|
+
* required).
|
|
57
|
+
*
|
|
58
|
+
* Refdes numbering is deterministic and stable across repeated compiles of
|
|
59
|
+
* the same DesignIntent, because it is derived solely from block order.
|
|
60
|
+
*/
|
|
61
|
+
export declare function planComponents(blocks: Block[]): ComponentPlanResult;
|
|
62
|
+
/** Read a Device's planned component role back out of its metadata, if present. */
|
|
63
|
+
export declare function getDeviceRole(device: Device): ComponentRole | undefined;
|
|
@@ -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;AAyBvC,4FAA4F;AAC5F,MAAM,CAAC,MAAM,kBAAkB,GAAkC;IAC/D,iBAAiB,EAAE,GAAG;IACtB,YAAY,EAAE,GAAG;IACjB,MAAM,EAAE,GAAG;IACX,kBAAkB,EAAE,GAAG;IACvB,WAAW,EAAE,GAAG;IAChB,SAAS,EAAE,GAAG;IACd,kBAAkB,EAAE,GAAG;IACvB,IAAI,EAAE,GAAG;IACT,iBAAiB,EAAE,GAAG;IACtB,YAAY,EAAE,GAAG;CAClB,CAAC;AAEF,6FAA6F;AAC7F,MAAM,CAAC,MAAM,iBAAiB,GAAkC;IAC9D,iBAAiB,EAAE,uDAAuD;IAC1E,YAAY,EAAE,qDAAqD;IACnE,MAAM,EAAE,8EAA8E;IACtF,kBAAkB,EAAE,6DAA6D;IACjF,WAAW,EAAE,0DAA0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AU,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"}
|
package/dist/circuit/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/circuit/index.js
CHANGED
|
@@ -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"}
|
package/dist/config/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SERVER_VERSION = "0.
|
|
1
|
+
export declare const SERVER_VERSION = "0.19.0";
|
package/dist/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const SERVER_VERSION = '0.
|
|
1
|
+
export const SERVER_VERSION = '0.19.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ActiveProject, RemoteRiskLevel } from './protocol.js';
|
|
2
|
+
export interface ApprovalRequestInput {
|
|
3
|
+
approvalId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
toolName: string;
|
|
7
|
+
riskLevel: RemoteRiskLevel;
|
|
8
|
+
inputHash: string;
|
|
9
|
+
actionSummary: string;
|
|
10
|
+
activeProject?: ActiveProject;
|
|
11
|
+
expiresAt: Date;
|
|
12
|
+
}
|
|
13
|
+
export type ApprovalDecision = 'approved' | 'rejected' | 'timeout';
|
|
14
|
+
export interface ApprovalRecord extends ApprovalRequestInput {
|
|
15
|
+
decision?: ApprovalDecision;
|
|
16
|
+
decidedAt?: Date;
|
|
17
|
+
}
|
|
18
|
+
export declare function requiresApproval(riskLevel: RemoteRiskLevel): boolean;
|
|
19
|
+
export declare function isDestructiveRisk(riskLevel: RemoteRiskLevel): boolean;
|
|
20
|
+
export declare class ApprovalStore {
|
|
21
|
+
private readonly approvals;
|
|
22
|
+
request(input: ApprovalRequestInput): ApprovalRecord;
|
|
23
|
+
resolve(approvalId: string, decision: ApprovalDecision, now?: Date): ApprovalRecord | undefined;
|
|
24
|
+
consumeApproved(input: {
|
|
25
|
+
approvalId: string;
|
|
26
|
+
userId: string;
|
|
27
|
+
sessionId: string;
|
|
28
|
+
toolName: string;
|
|
29
|
+
inputHash: string;
|
|
30
|
+
now?: Date;
|
|
31
|
+
}): boolean;
|
|
32
|
+
get(approvalId: string): ApprovalRecord | undefined;
|
|
33
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export function requiresApproval(riskLevel) {
|
|
2
|
+
return riskLevel !== 'read';
|
|
3
|
+
}
|
|
4
|
+
export function isDestructiveRisk(riskLevel) {
|
|
5
|
+
return riskLevel === 'destructive';
|
|
6
|
+
}
|
|
7
|
+
export class ApprovalStore {
|
|
8
|
+
approvals = new Map();
|
|
9
|
+
request(input) {
|
|
10
|
+
const record = { ...input };
|
|
11
|
+
this.approvals.set(input.approvalId, record);
|
|
12
|
+
return record;
|
|
13
|
+
}
|
|
14
|
+
resolve(approvalId, decision, now = new Date()) {
|
|
15
|
+
const record = this.approvals.get(approvalId);
|
|
16
|
+
if (!record)
|
|
17
|
+
return undefined;
|
|
18
|
+
record.decision = now.getTime() > record.expiresAt.getTime() ? 'timeout' : decision;
|
|
19
|
+
record.decidedAt = now;
|
|
20
|
+
return record;
|
|
21
|
+
}
|
|
22
|
+
consumeApproved(input) {
|
|
23
|
+
const record = this.approvals.get(input.approvalId);
|
|
24
|
+
if (!record)
|
|
25
|
+
return false;
|
|
26
|
+
const now = input.now ?? new Date();
|
|
27
|
+
const matches = record.userId === input.userId &&
|
|
28
|
+
record.sessionId === input.sessionId &&
|
|
29
|
+
record.toolName === input.toolName &&
|
|
30
|
+
record.inputHash === input.inputHash &&
|
|
31
|
+
record.decision === 'approved' &&
|
|
32
|
+
record.expiresAt.getTime() > now.getTime();
|
|
33
|
+
if (matches)
|
|
34
|
+
this.approvals.delete(input.approvalId);
|
|
35
|
+
return matches;
|
|
36
|
+
}
|
|
37
|
+
get(approvalId) {
|
|
38
|
+
return this.approvals.get(approvalId);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=approval-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-policy.js","sourceRoot":"","sources":["../../src/remote/approval-policy.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,gBAAgB,CAAC,SAA0B;IACzD,OAAO,SAAS,KAAK,MAAM,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAA0B;IAC1D,OAAO,SAAS,KAAK,aAAa,CAAC;AACrC,CAAC;AAED,MAAM,OAAO,aAAa;IACP,SAAS,GAAG,IAAI,GAAG,EAA0B,CAAC;IAE/D,OAAO,CAAC,KAA2B;QACjC,MAAM,MAAM,GAAmB,EAAE,GAAG,KAAK,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,CACL,UAAkB,EAClB,QAA0B,EAC1B,GAAG,GAAG,IAAI,IAAI,EAAE;QAEhB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC9C,IAAI,CAAC,MAAM;YAAE,OAAO,SAAS,CAAC;QAC9B,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,OAA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