easyeda-mcp-pro 0.3.2 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +369 -52
  2. package/dist/bom-quality/adapter.d.ts +90 -0
  3. package/dist/bom-quality/adapter.js +295 -0
  4. package/dist/bom-quality/adapter.js.map +1 -0
  5. package/dist/bom-quality/index.d.ts +10 -0
  6. package/dist/bom-quality/index.js +9 -0
  7. package/dist/bom-quality/index.js.map +1 -0
  8. package/dist/bom-quality/quality.d.ts +28 -0
  9. package/dist/bom-quality/quality.js +179 -0
  10. package/dist/bom-quality/quality.js.map +1 -0
  11. package/dist/bom-quality/types.d.ts +94 -0
  12. package/dist/bom-quality/types.js +12 -0
  13. package/dist/bom-quality/types.js.map +1 -0
  14. package/dist/bridge/manager.d.ts +41 -0
  15. package/dist/bridge/manager.js +334 -47
  16. package/dist/bridge/manager.js.map +1 -1
  17. package/dist/bridge/protocol.d.ts +48 -1
  18. package/dist/bridge/protocol.js +43 -1
  19. package/dist/bridge/protocol.js.map +1 -1
  20. package/dist/bridge/types.d.ts +6 -0
  21. package/dist/bridge/types.js +6 -0
  22. package/dist/bridge/types.js.map +1 -1
  23. package/dist/catalog/errors.d.ts +49 -0
  24. package/dist/catalog/errors.js +60 -0
  25. package/dist/catalog/errors.js.map +1 -0
  26. package/dist/catalog/index.d.ts +15 -0
  27. package/dist/catalog/index.js +17 -0
  28. package/dist/catalog/index.js.map +1 -0
  29. package/dist/catalog/schema.d.ts +268 -0
  30. package/dist/catalog/schema.js +245 -0
  31. package/dist/catalog/schema.js.map +1 -0
  32. package/dist/catalog/starter.d.ts +159 -0
  33. package/dist/catalog/starter.js +579 -0
  34. package/dist/catalog/starter.js.map +1 -0
  35. package/dist/catalog/validation.d.ts +48 -0
  36. package/dist/catalog/validation.js +263 -0
  37. package/dist/catalog/validation.js.map +1 -0
  38. package/dist/circuit/circuit-ir.d.ts +460 -0
  39. package/dist/circuit/circuit-ir.js +292 -0
  40. package/dist/circuit/circuit-ir.js.map +1 -0
  41. package/dist/circuit/compiler.d.ts +55 -0
  42. package/dist/circuit/compiler.js +197 -0
  43. package/dist/circuit/compiler.js.map +1 -0
  44. package/dist/circuit/design-intent.d.ts +94 -0
  45. package/dist/circuit/design-intent.js +118 -0
  46. package/dist/circuit/design-intent.js.map +1 -0
  47. package/dist/circuit/errors.d.ts +50 -0
  48. package/dist/circuit/errors.js +61 -0
  49. package/dist/circuit/errors.js.map +1 -0
  50. package/dist/circuit/index.d.ts +17 -0
  51. package/dist/circuit/index.js +18 -0
  52. package/dist/circuit/index.js.map +1 -0
  53. package/dist/circuit/types.d.ts +186 -0
  54. package/dist/circuit/types.js +123 -0
  55. package/dist/circuit/types.js.map +1 -0
  56. package/dist/cli/auto-setup.d.ts +5 -0
  57. package/dist/cli/auto-setup.js +355 -0
  58. package/dist/cli/auto-setup.js.map +1 -0
  59. package/dist/cli/client-definitions.d.ts +34 -0
  60. package/dist/cli/client-definitions.js +194 -0
  61. package/dist/cli/client-definitions.js.map +1 -0
  62. package/dist/cli/local-setup.d.ts +5 -1
  63. package/dist/cli/local-setup.js +40 -6
  64. package/dist/cli/local-setup.js.map +1 -1
  65. package/dist/config/env.d.ts +6 -1
  66. package/dist/config/env.js +93 -5
  67. package/dist/config/env.js.map +1 -1
  68. package/dist/config/profiles.js +4 -4
  69. package/dist/config/version.d.ts +1 -1
  70. package/dist/config/version.js +1 -1
  71. package/dist/export-manifest/errors.d.ts +55 -0
  72. package/dist/export-manifest/errors.js +69 -0
  73. package/dist/export-manifest/errors.js.map +1 -0
  74. package/dist/export-manifest/index.d.ts +10 -0
  75. package/dist/export-manifest/index.js +9 -0
  76. package/dist/export-manifest/index.js.map +1 -0
  77. package/dist/export-manifest/types.d.ts +170 -0
  78. package/dist/export-manifest/types.js +36 -0
  79. package/dist/export-manifest/types.js.map +1 -0
  80. package/dist/export-manifest/validation.d.ts +39 -0
  81. package/dist/export-manifest/validation.js +298 -0
  82. package/dist/export-manifest/validation.js.map +1 -0
  83. package/dist/index.js +20 -0
  84. package/dist/index.js.map +1 -1
  85. package/dist/net-validation/errors.d.ts +89 -0
  86. package/dist/net-validation/errors.js +69 -0
  87. package/dist/net-validation/errors.js.map +1 -0
  88. package/dist/net-validation/fixtures.d.ts +38 -0
  89. package/dist/net-validation/fixtures.js +215 -0
  90. package/dist/net-validation/fixtures.js.map +1 -0
  91. package/dist/net-validation/index.d.ts +10 -0
  92. package/dist/net-validation/index.js +9 -0
  93. package/dist/net-validation/index.js.map +1 -0
  94. package/dist/net-validation/schema.d.ts +118 -0
  95. package/dist/net-validation/schema.js +140 -0
  96. package/dist/net-validation/schema.js.map +1 -0
  97. package/dist/net-validation/validation.d.ts +45 -0
  98. package/dist/net-validation/validation.js +369 -0
  99. package/dist/net-validation/validation.js.map +1 -0
  100. package/dist/pcb-constraints/errors.d.ts +39 -0
  101. package/dist/pcb-constraints/errors.js +133 -0
  102. package/dist/pcb-constraints/errors.js.map +1 -0
  103. package/dist/pcb-constraints/index.d.ts +9 -0
  104. package/dist/pcb-constraints/index.js +9 -0
  105. package/dist/pcb-constraints/index.js.map +1 -0
  106. package/dist/pcb-constraints/types.d.ts +102 -0
  107. package/dist/pcb-constraints/types.js +7 -0
  108. package/dist/pcb-constraints/types.js.map +1 -0
  109. package/dist/pcb-constraints/validation.d.ts +70 -0
  110. package/dist/pcb-constraints/validation.js +309 -0
  111. package/dist/pcb-constraints/validation.js.map +1 -0
  112. package/dist/server/factory.js +2 -0
  113. package/dist/server/factory.js.map +1 -1
  114. package/dist/server/transports/http.d.ts +20 -1
  115. package/dist/server/transports/http.js +156 -34
  116. package/dist/server/transports/http.js.map +1 -1
  117. package/dist/storage/database.d.ts +25 -0
  118. package/dist/storage/database.js +126 -51
  119. package/dist/storage/database.js.map +1 -1
  120. package/dist/tools/{L0_diagnostics.d.ts → L0_diagnostics_api.d.ts} +2 -2
  121. package/dist/tools/L0_diagnostics_api.js +152 -0
  122. package/dist/tools/L0_diagnostics_api.js.map +1 -0
  123. package/dist/tools/L0_diagnostics_core.d.ts +6 -0
  124. package/dist/tools/{L0_diagnostics.js → L0_diagnostics_core.js} +50 -124
  125. package/dist/tools/L0_diagnostics_core.js.map +1 -0
  126. package/dist/tools/L1_board.js +20 -4
  127. package/dist/tools/L1_board.js.map +1 -1
  128. package/dist/tools/{L1_bom.d.ts → L1_bom_core.d.ts} +2 -2
  129. package/dist/tools/{L1_bom.js → L1_bom_core.js} +21 -101
  130. package/dist/tools/L1_bom_core.js.map +1 -0
  131. package/dist/tools/{L1_schematic.d.ts → L1_bom_sourcing.d.ts} +2 -2
  132. package/dist/tools/L1_bom_sourcing.js +265 -0
  133. package/dist/tools/L1_bom_sourcing.js.map +1 -0
  134. package/dist/tools/L1_drc_erc.js +15 -3
  135. package/dist/tools/L1_drc_erc.js.map +1 -1
  136. package/dist/tools/L1_export.js +20 -4
  137. package/dist/tools/L1_export.js.map +1 -1
  138. package/dist/tools/L1_pcb_constraints.d.ts +6 -0
  139. package/dist/tools/L1_pcb_constraints.js +234 -0
  140. package/dist/tools/L1_pcb_constraints.js.map +1 -0
  141. package/dist/tools/L1_pcb_write.js +26 -12
  142. package/dist/tools/L1_pcb_write.js.map +1 -1
  143. package/dist/tools/L1_schematic_read.d.ts +6 -0
  144. package/dist/tools/{L1_schematic.js → L1_schematic_read.js} +125 -190
  145. package/dist/tools/L1_schematic_read.js.map +1 -0
  146. package/dist/tools/L1_schematic_write.d.ts +6 -0
  147. package/dist/tools/L1_schematic_write.js +516 -0
  148. package/dist/tools/L1_schematic_write.js.map +1 -0
  149. package/dist/tools/register.js +15 -7
  150. package/dist/tools/register.js.map +1 -1
  151. package/dist/tools/registry.d.ts +41 -7
  152. package/dist/tools/registry.js +111 -12
  153. package/dist/tools/registry.js.map +1 -1
  154. package/dist/tools/types.d.ts +16 -0
  155. package/dist/utils/logger.d.ts +1 -1
  156. package/dist/utils/logger.js +1 -1
  157. package/dist/utils/logger.js.map +1 -1
  158. package/dist/vendors/base-http-client.d.ts +48 -0
  159. package/dist/vendors/base-http-client.js +75 -0
  160. package/dist/vendors/base-http-client.js.map +1 -0
  161. package/dist/vendors/digikey/client.js +10 -19
  162. package/dist/vendors/digikey/client.js.map +1 -1
  163. package/dist/vendors/jlcpcb/client.js +41 -70
  164. package/dist/vendors/jlcpcb/client.js.map +1 -1
  165. package/dist/vendors/lcsc/client.js +5 -18
  166. package/dist/vendors/lcsc/client.js.map +1 -1
  167. package/dist/vendors/mouser/client.js +4 -12
  168. package/dist/vendors/mouser/client.js.map +1 -1
  169. package/easyeda-bridge-extension.eext +0 -0
  170. package/package.json +41 -26
  171. package/dist/tools/L0_diagnostics.js.map +0 -1
  172. package/dist/tools/L1_bom.js.map +0 -1
  173. package/dist/tools/L1_schematic.js.map +0 -1
@@ -0,0 +1,94 @@
1
+ /**
2
+ * DesignIntent — versioned, validated user requirements model.
3
+ *
4
+ * A DesignIntent captures what the user wants to build at a high level:
5
+ * project goal, functional blocks, electrical requirements, power rails,
6
+ * mechanical constraints, manufacturing intent, and safety/regulatory notes.
7
+ *
8
+ * DesignIntent is the **input** to the compile pipeline. It is compiled
9
+ * into a CircuitIR (the validated, machine-readable source of truth) which
10
+ * downstream EasyEDA tools consume.
11
+ *
12
+ * @schema design-intent/v1
13
+ */
14
+ import { z } from 'zod';
15
+ import { BoardType } from './types.js';
16
+ export declare const DESIGN_INTENT_SCHEMA_VERSION = "design-intent/v1";
17
+ export declare const DesignIntentSchema: z.ZodObject<{
18
+ $schema: z.ZodDefault<z.ZodLiteral<"design-intent/v1">>;
19
+ project: z.ZodObject<{
20
+ name: z.ZodString;
21
+ goal: z.ZodString;
22
+ boardType: z.ZodEnum<typeof BoardType>;
23
+ }, z.core.$strip>;
24
+ requirements: z.ZodObject<{
25
+ functionalBlocks: z.ZodArray<z.ZodObject<{
26
+ id: z.ZodString;
27
+ name: z.ZodString;
28
+ type: z.ZodString;
29
+ purpose: z.ZodString;
30
+ required: z.ZodDefault<z.ZodBoolean>;
31
+ }, z.core.$strip>>;
32
+ electrical: z.ZodDefault<z.ZodObject<{
33
+ vinMin: z.ZodOptional<z.ZodNumber>;
34
+ vinMax: z.ZodOptional<z.ZodNumber>;
35
+ currentMaxAmps: z.ZodOptional<z.ZodNumber>;
36
+ frequencyMaxHz: z.ZodOptional<z.ZodNumber>;
37
+ notes: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strip>>;
39
+ power: z.ZodObject<{
40
+ rails: z.ZodArray<z.ZodObject<{
41
+ id: z.ZodString;
42
+ voltage: z.ZodNumber;
43
+ tolerance: z.ZodDefault<z.ZodNumber>;
44
+ maxCurrentAmps: z.ZodOptional<z.ZodNumber>;
45
+ description: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>>;
47
+ }, z.core.$strip>;
48
+ mechanical: z.ZodDefault<z.ZodObject<{
49
+ widthMm: z.ZodOptional<z.ZodNumber>;
50
+ heightMm: z.ZodOptional<z.ZodNumber>;
51
+ layers: z.ZodOptional<z.ZodNumber>;
52
+ mountingHoles: z.ZodOptional<z.ZodBoolean>;
53
+ notes: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>>;
55
+ manufacturing: z.ZodDefault<z.ZodObject<{
56
+ volume: z.ZodOptional<z.ZodEnum<{
57
+ prototype: "prototype";
58
+ "small-series": "small-series";
59
+ "medium-series": "medium-series";
60
+ "mass-production": "mass-production";
61
+ }>>;
62
+ process: z.ZodOptional<z.ZodEnum<{
63
+ "lead-free": "lead-free";
64
+ "lead-based": "lead-based";
65
+ mixed: "mixed";
66
+ }>>;
67
+ timelineWeeks: z.ZodOptional<z.ZodNumber>;
68
+ notes: z.ZodOptional<z.ZodString>;
69
+ }, z.core.$strip>>;
70
+ safety: z.ZodDefault<z.ZodObject<{
71
+ isolation: z.ZodOptional<z.ZodBoolean>;
72
+ certifications: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
+ regulatory: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strip>>;
75
+ }, z.core.$strip>;
76
+ assumptions: z.ZodDefault<z.ZodArray<z.ZodString>>;
77
+ unknowns: z.ZodDefault<z.ZodArray<z.ZodString>>;
78
+ metadata: z.ZodOptional<z.ZodObject<{
79
+ version: z.ZodDefault<z.ZodLiteral<"1.0.0">>;
80
+ createdAt: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>>;
82
+ }, z.core.$strict>;
83
+ export type DesignIntent = z.infer<typeof DesignIntentSchema>;
84
+ /**
85
+ * Parse and validate an unknown input as a DesignIntent.
86
+ *
87
+ * Returns the validated DesignIntent on success.
88
+ * Throws `CircuitError` with structured errors on failure.
89
+ */
90
+ export declare function validateDesignIntent(input: unknown): DesignIntent;
91
+ /**
92
+ * Type guard: check whether an unknown value is a valid DesignIntent.
93
+ */
94
+ export declare function isDesignIntent(value: unknown): value is DesignIntent;
@@ -0,0 +1,118 @@
1
+ /**
2
+ * DesignIntent — versioned, validated user requirements model.
3
+ *
4
+ * A DesignIntent captures what the user wants to build at a high level:
5
+ * project goal, functional blocks, electrical requirements, power rails,
6
+ * mechanical constraints, manufacturing intent, and safety/regulatory notes.
7
+ *
8
+ * DesignIntent is the **input** to the compile pipeline. It is compiled
9
+ * into a CircuitIR (the validated, machine-readable source of truth) which
10
+ * downstream EasyEDA tools consume.
11
+ *
12
+ * @schema design-intent/v1
13
+ */
14
+ import { z } from 'zod';
15
+ import { BoardType } from './types.js';
16
+ import { CircuitError, CircuitErrorCode, fromZodError } from './errors.js';
17
+ // ── Schema version ────────────────────────────────────────────────────────
18
+ export const DESIGN_INTENT_SCHEMA_VERSION = 'design-intent/v1';
19
+ // ── Sub-schemas ───────────────────────────────────────────────────────────
20
+ const boardTypeSchema = z.nativeEnum(BoardType);
21
+ const functionalBlockReqSchema = z.object({
22
+ id: z.string().min(1).max(64),
23
+ name: z.string().min(1).max(128),
24
+ type: z.string().min(1).max(64),
25
+ purpose: z.string().min(1).max(1024),
26
+ required: z.boolean().default(true),
27
+ });
28
+ const powerRailReqSchema = z.object({
29
+ id: z.string().min(1).max(64),
30
+ voltage: z.number().positive(),
31
+ tolerance: z.number().min(0).max(100).default(5),
32
+ maxCurrentAmps: z.number().nonnegative().optional(),
33
+ description: z.string().max(256).optional(),
34
+ });
35
+ const electricalReqSchema = z.object({
36
+ vinMin: z.number().nonnegative().optional(),
37
+ vinMax: z.number().nonnegative().optional(),
38
+ currentMaxAmps: z.number().nonnegative().optional(),
39
+ frequencyMaxHz: z.number().nonnegative().optional(),
40
+ notes: z.string().max(1024).optional(),
41
+ });
42
+ const mechanicalConstraintsSchema = z.object({
43
+ widthMm: z.number().positive().optional(),
44
+ heightMm: z.number().positive().optional(),
45
+ layers: z.number().int().positive().max(64).optional(),
46
+ mountingHoles: z.boolean().optional(),
47
+ notes: z.string().max(1024).optional(),
48
+ });
49
+ const manufacturingIntentSchema = z.object({
50
+ volume: z.enum(['prototype', 'small-series', 'medium-series', 'mass-production']).optional(),
51
+ process: z.enum(['lead-free', 'lead-based', 'mixed']).optional(),
52
+ timelineWeeks: z.number().int().positive().optional(),
53
+ notes: z.string().max(1024).optional(),
54
+ });
55
+ const safetyNotesSchema = z.object({
56
+ isolation: z.boolean().optional(),
57
+ certifications: z.array(z.string()).optional(),
58
+ regulatory: z.string().max(2048).optional(),
59
+ });
60
+ // ── Full DesignIntent schema ──────────────────────────────────────────────
61
+ export const DesignIntentSchema = z
62
+ .object({
63
+ $schema: z.literal(DESIGN_INTENT_SCHEMA_VERSION).default(DESIGN_INTENT_SCHEMA_VERSION),
64
+ project: z.object({
65
+ name: z.string().min(1).max(128),
66
+ goal: z.string().min(1).max(4096),
67
+ boardType: boardTypeSchema,
68
+ }),
69
+ requirements: z.object({
70
+ functionalBlocks: z.array(functionalBlockReqSchema).min(1, {
71
+ message: 'At least one functional block is required',
72
+ }),
73
+ electrical: electricalReqSchema.default({}),
74
+ power: z.object({
75
+ rails: z.array(powerRailReqSchema).min(1, {
76
+ message: 'At least one power rail is required',
77
+ }),
78
+ }),
79
+ mechanical: mechanicalConstraintsSchema.default({}),
80
+ manufacturing: manufacturingIntentSchema.default({}),
81
+ safety: safetyNotesSchema.default({}),
82
+ }),
83
+ assumptions: z.array(z.string()).default([]),
84
+ unknowns: z.array(z.string()).default([]),
85
+ metadata: z
86
+ .object({
87
+ version: z.literal('1.0.0').default('1.0.0'),
88
+ createdAt: z.string().datetime().optional(),
89
+ })
90
+ .optional(),
91
+ })
92
+ .strict();
93
+ // ── Validation helper ─────────────────────────────────────────────────────
94
+ /**
95
+ * Parse and validate an unknown input as a DesignIntent.
96
+ *
97
+ * Returns the validated DesignIntent on success.
98
+ * Throws `CircuitError` with structured errors on failure.
99
+ */
100
+ export function validateDesignIntent(input) {
101
+ const result = DesignIntentSchema.safeParse(input);
102
+ if (!result.success) {
103
+ const errors = fromZodError(result.error, 'designIntent');
104
+ throw new CircuitError({
105
+ code: CircuitErrorCode.DESIGN_INTENT_INVALID,
106
+ message: 'DesignIntent validation failed',
107
+ errors,
108
+ });
109
+ }
110
+ return result.data;
111
+ }
112
+ /**
113
+ * Type guard: check whether an unknown value is a valid DesignIntent.
114
+ */
115
+ export function isDesignIntent(value) {
116
+ return DesignIntentSchema.safeParse(value).success;
117
+ }
118
+ //# sourceMappingURL=design-intent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-intent.js","sourceRoot":"","sources":["../../src/circuit/design-intent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3E,6EAA6E;AAE7E,MAAM,CAAC,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D,6EAA6E;AAE7E,MAAM,eAAe,GAAG,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAE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kB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AACrD,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Circuit-specific validation and compilation errors.
3
+ *
4
+ * These extend the project's existing error pattern (see src/schemas/common.ts)
5
+ * and provide structured, actionable error messages for DesignIntent and CircuitIR
6
+ * validation failures.
7
+ */
8
+ import { ZodError } from 'zod';
9
+ export declare const CircuitErrorCode: {
10
+ readonly DESIGN_INTENT_INVALID: "DESIGN_INTENT_INVALID";
11
+ readonly DESIGN_INTENT_MISSING_BLOCKS: "DESIGN_INTENT_MISSING_BLOCKS";
12
+ readonly DESIGN_INTENT_RAIL_CONFLICT: "DESIGN_INTENT_RAIL_CONFLICT";
13
+ readonly CIRCUIT_IR_INVALID: "CIRCUIT_IR_INVALID";
14
+ readonly CIRCUIT_IR_BLOCK_DEVICE_MISMATCH: "CIRCUIT_IR_BLOCK_DEVICE_MISMATCH";
15
+ readonly CIRCUIT_IR_NET_ORPHAN: "CIRCUIT_IR_NET_ORPHAN";
16
+ readonly CIRCUIT_IR_RAIL_VOLTAGE_MISMATCH: "CIRCUIT_IR_RAIL_VOLTAGE_MISMATCH";
17
+ readonly CIRCUIT_IR_DUPLICATE_ID: "CIRCUIT_IR_DUPLICATE_ID";
18
+ readonly CIRCUIT_IR_REFERENCE_MISSING: "CIRCUIT_IR_REFERENCE_MISSING";
19
+ readonly COMPILE_FAILED: "COMPILE_FAILED";
20
+ readonly COMPILE_UNSUPPORTED_BOARD_TYPE: "COMPILE_UNSUPPORTED_BOARD_TYPE";
21
+ readonly INTERNAL_ERROR: "INTERNAL_ERROR";
22
+ };
23
+ export type CircuitErrorCode = (typeof CircuitErrorCode)[keyof typeof CircuitErrorCode];
24
+ export interface CircuitValidationError {
25
+ code: CircuitErrorCode;
26
+ message: string;
27
+ /** Path to the field that caused the error (dot-notation) */
28
+ path?: string;
29
+ /** Specific details for programmatic handling */
30
+ details?: Record<string, unknown>;
31
+ }
32
+ export declare class CircuitError extends Error {
33
+ readonly code: CircuitErrorCode;
34
+ readonly errors: CircuitValidationError[];
35
+ readonly retryable: boolean;
36
+ constructor(opts: {
37
+ code: CircuitErrorCode;
38
+ message: string;
39
+ errors?: CircuitValidationError[];
40
+ retryable?: boolean;
41
+ });
42
+ }
43
+ /**
44
+ * Wrap a ZodError into a list of CircuitValidationErrors.
45
+ */
46
+ export declare function fromZodError(zodError: ZodError, prefix?: string): CircuitValidationError[];
47
+ /**
48
+ * Create a single validation error.
49
+ */
50
+ export declare function validationError(code: CircuitErrorCode, message: string, details?: Record<string, unknown>): CircuitValidationError;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Circuit-specific validation and compilation errors.
3
+ *
4
+ * These extend the project's existing error pattern (see src/schemas/common.ts)
5
+ * and provide structured, actionable error messages for DesignIntent and CircuitIR
6
+ * validation failures.
7
+ */
8
+ // ── Error codes ───────────────────────────────────────────────────────────
9
+ export const CircuitErrorCode = {
10
+ // DesignIntent validation
11
+ DESIGN_INTENT_INVALID: 'DESIGN_INTENT_INVALID',
12
+ DESIGN_INTENT_MISSING_BLOCKS: 'DESIGN_INTENT_MISSING_BLOCKS',
13
+ DESIGN_INTENT_RAIL_CONFLICT: 'DESIGN_INTENT_RAIL_CONFLICT',
14
+ // CircuitIR validation
15
+ CIRCUIT_IR_INVALID: 'CIRCUIT_IR_INVALID',
16
+ CIRCUIT_IR_BLOCK_DEVICE_MISMATCH: 'CIRCUIT_IR_BLOCK_DEVICE_MISMATCH',
17
+ CIRCUIT_IR_NET_ORPHAN: 'CIRCUIT_IR_NET_ORPHAN',
18
+ CIRCUIT_IR_RAIL_VOLTAGE_MISMATCH: 'CIRCUIT_IR_RAIL_VOLTAGE_MISMATCH',
19
+ CIRCUIT_IR_DUPLICATE_ID: 'CIRCUIT_IR_DUPLICATE_ID',
20
+ CIRCUIT_IR_REFERENCE_MISSING: 'CIRCUIT_IR_REFERENCE_MISSING',
21
+ // Compilation
22
+ COMPILE_FAILED: 'COMPILE_FAILED',
23
+ COMPILE_UNSUPPORTED_BOARD_TYPE: 'COMPILE_UNSUPPORTED_BOARD_TYPE',
24
+ // Internal
25
+ INTERNAL_ERROR: 'INTERNAL_ERROR',
26
+ };
27
+ export class CircuitError extends Error {
28
+ code;
29
+ errors;
30
+ retryable;
31
+ constructor(opts) {
32
+ super(opts.message);
33
+ this.name = 'CircuitError';
34
+ this.code = opts.code;
35
+ this.errors = opts.errors ?? [];
36
+ this.retryable = opts.retryable ?? false;
37
+ }
38
+ }
39
+ // ── Helpers ───────────────────────────────────────────────────────────────
40
+ /**
41
+ * Wrap a ZodError into a list of CircuitValidationErrors.
42
+ */
43
+ export function fromZodError(zodError, prefix) {
44
+ return zodError.issues.map((issue) => ({
45
+ code: 'CIRCUIT_IR_INVALID',
46
+ message: issue.message,
47
+ path: prefix ? `${prefix}.${issue.path.join('.')}` : issue.path.join('.'),
48
+ details: {
49
+ code: issue.code,
50
+ expected: issue.message,
51
+ received: issue.received,
52
+ },
53
+ }));
54
+ }
55
+ /**
56
+ * Create a single validation error.
57
+ */
58
+ export function validationError(code, message, details) {
59
+ return { code, message, details };
60
+ }
61
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/circuit/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,6EAA6E;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,0BAA0B;IAC1B,qBAAqB,EAAE,uBAAuB;IAC9C,4BAA4B,EAAE,8BAA8B;IAC5D,2BAA2B,EAAE,6BAA6B;IAE1D,uBAAuB;IACvB,kBAAkB,EAAE,oBAAoB;IACxC,gCAAgC,EAAE,kCAAkC;IACpE,qBAAqB,EAAE,uBAAuB;IAC9C,gCAAgC,EAAE,kCAAkC;IACpE,uBAAuB,EAAE,yBAAyB;IAClD,4BAA4B,EAAE,8BAA8B;IAE5D,cAAc;IACd,cAAc,EAAE,gBAAgB;IAChC,8BA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
+ * Circuit module — DesignIntent and CircuitIR schemas, compiler, and types.
3
+ *
4
+ * Public API surface for the circuit modeling subsystem.
5
+ *
6
+ * @module
7
+ */
8
+ export { CircuitError, CircuitErrorCode, fromZodError, validationError } from './errors.js';
9
+ export type { CircuitErrorCode as CircuitErrorCodeType, CircuitValidationError } from './errors.js';
10
+ export { BoardType, ValidationStatus, NetType, BlockType, ConstraintSeverity, ConstraintType, isValidBoardType, isValidBlockType, } from './types.js';
11
+ export type { DesignIntentRef, MetadataEntry } from './types.js';
12
+ export { DesignIntentSchema, DESIGN_INTENT_SCHEMA_VERSION, validateDesignIntent, isDesignIntent, } from './design-intent.js';
13
+ export type { DesignIntent } from './design-intent.js';
14
+ export { CircuitIRSchema, CIRCUIT_IR_SCHEMA_VERSION, BlockSchema, DeviceSchema, NetSchema, NetNodeSchema, PowerRailSchema, InterfaceSchema, InterfacePinSchema, ConstraintSchema, BomIntentSchema, PcbIntentSchema, ManufacturingIntentSchema, validateCircuitIR, isCircuitIR, } from './circuit-ir.js';
15
+ export type { CircuitIR, Block, Device, Net, NetNode, PowerRail, Interface, InterfacePin, Constraint, BomIntent, PcbIntent, ManufacturingIntent, } from './circuit-ir.js';
16
+ export { compile, setValidationStatus, isReadyForEasyEDA } from './compiler.js';
17
+ export type { CompileOptions, CompileResult } from './compiler.js';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Circuit module — DesignIntent and CircuitIR schemas, compiler, and types.
3
+ *
4
+ * Public API surface for the circuit modeling subsystem.
5
+ *
6
+ * @module
7
+ */
8
+ // Errors
9
+ export { CircuitError, CircuitErrorCode, fromZodError, validationError } from './errors.js';
10
+ // Types
11
+ export { BoardType, ValidationStatus, NetType, BlockType, ConstraintSeverity, ConstraintType, isValidBoardType, isValidBlockType, } from './types.js';
12
+ // DesignIntent
13
+ export { DesignIntentSchema, DESIGN_INTENT_SCHEMA_VERSION, validateDesignIntent, isDesignIntent, } from './design-intent.js';
14
+ // CircuitIR
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
+ // Compiler
17
+ export { compile, setValidationStatus, isReadyForEasyEDA } from './compiler.js';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Shared enums and primitive types for DesignIntent and CircuitIR.
3
+ *
4
+ * These types are schema-agnostic — they define the vocabulary used by
5
+ * both DesignIntent (user-facing requirements) and CircuitIR (machine-readable
6
+ * resolved model).
7
+ */
8
+ /** High-level board / application category. */
9
+ export declare enum BoardType {
10
+ PowerSupply = "power-supply",
11
+ McuBoard = "mcu-board",
12
+ SensorBoard = "sensor-board",
13
+ AcDcIot = "ac-dc-iot",
14
+ Hierarchical = "hierarchical",
15
+ Custom = "custom"
16
+ }
17
+ /** Validation lifecycle state of a CircuitIR model. */
18
+ export declare enum ValidationStatus {
19
+ Draft = "draft",
20
+ Validated = "validated",
21
+ Rejected = "rejected"
22
+ }
23
+ /** Classification of an electrical net. */
24
+ export declare enum NetType {
25
+ Power = "power",
26
+ Signal = "signal",
27
+ Ground = "ground"
28
+ }
29
+ /** Classification of a functional block. */
30
+ export declare enum BlockType {
31
+ PowerManagement = "power-management",
32
+ Microcontroller = "microcontroller",
33
+ Sensor = "sensor",
34
+ Communication = "communication",
35
+ Interface = "interface",
36
+ Protection = "protection",
37
+ Analog = "analog",
38
+ Custom = "custom"
39
+ }
40
+ /** Severity of a circuit constraint. */
41
+ export declare enum ConstraintSeverity {
42
+ Required = "required",
43
+ Recommended = "recommended",
44
+ Informational = "informational"
45
+ }
46
+ /** Kind of constraint. */
47
+ export declare enum ConstraintType {
48
+ Electrical = "electrical",
49
+ Mechanical = "mechanical",
50
+ Thermal = "thermal",
51
+ Regulatory = "regulatory",
52
+ Cost = "cost",
53
+ PcbLayout = "pcb-layout",
54
+ Manufacturing = "manufacturing"
55
+ }
56
+ /** PCB layer function / type. */
57
+ export declare enum BoardLayerType {
58
+ Signal = "signal",
59
+ Power = "power",
60
+ Ground = "ground",
61
+ Plane = "plane",
62
+ Mechanical = "mechanical",
63
+ SolderMask = "solder-mask",
64
+ Paste = "paste",
65
+ Silkscreen = "silkscreen",
66
+ Drill = "drill",
67
+ Keepout = "keepout"
68
+ }
69
+ /** Side of the board for component placement. */
70
+ export declare enum PlacementSide {
71
+ Top = "top",
72
+ Bottom = "bottom",
73
+ Both = "both"
74
+ }
75
+ /** Restriction applied to a keepout area. */
76
+ export declare enum KeepoutRestriction {
77
+ All = "all",
78
+ Tracks = "tracks",
79
+ Vias = "vias",
80
+ Components = "components",
81
+ Copper = "copper",
82
+ Routing = "routing"
83
+ }
84
+ /** Type of mounting hole. */
85
+ export declare enum MountingHoleType {
86
+ Unplated = "unplated",
87
+ Plated = "plated",
88
+ Tooling = "tooling"
89
+ }
90
+ /** Purpose for a placement zone. */
91
+ export declare enum PlacementZoneType {
92
+ Power = "power",
93
+ Analog = "analog",
94
+ Digital = "digital",
95
+ Usb = "usb",
96
+ Sensor = "sensor",
97
+ AcDc = "ac-dc",
98
+ HighVoltage = "high-voltage",
99
+ Rf = "rf",
100
+ Thermal = "thermal",
101
+ General = "general"
102
+ }
103
+ /** A 2D point on the board (mm). */
104
+ export interface Point2D {
105
+ x: number;
106
+ y: number;
107
+ }
108
+ /** A board outline defined as an extruded polygon. */
109
+ export interface BoardOutline {
110
+ shape: Point2D[];
111
+ cutouts?: Point2D[][];
112
+ }
113
+ /** One layer in the PCB stackup. */
114
+ export interface LayerStackEntry {
115
+ name: string;
116
+ type: BoardLayerType;
117
+ thicknessMm: number;
118
+ material: string;
119
+ copperWeightOz?: number;
120
+ dielectricConstant?: number;
121
+ order: number;
122
+ }
123
+ /** A net class with routing rules. */
124
+ export interface NetClassRule {
125
+ name: string;
126
+ traceWidthMm: number;
127
+ clearanceMm: number;
128
+ viaDiameterMm?: number;
129
+ viaHoleMm?: number;
130
+ priority?: number;
131
+ netNames?: string[];
132
+ }
133
+ /** Clearance rule between two net classes. */
134
+ export interface ClearanceRule {
135
+ netClassA: string;
136
+ netClassB: string;
137
+ clearanceMm: number;
138
+ layer?: string;
139
+ }
140
+ /** A restricted area on the board. */
141
+ export interface KeepoutArea {
142
+ outline: Point2D[];
143
+ layer: string;
144
+ restriction: KeepoutRestriction;
145
+ description?: string;
146
+ }
147
+ /** A placement zone for grouping components. */
148
+ export interface PlacementZone {
149
+ outline: Point2D[];
150
+ layer: PlacementSide;
151
+ zoneType: PlacementZoneType;
152
+ name: string;
153
+ allowedRefs?: string[];
154
+ description?: string;
155
+ }
156
+ /** A fiducial mark. */
157
+ export interface Fiducial {
158
+ x: number;
159
+ y: number;
160
+ type: 'global' | 'local';
161
+ top: boolean;
162
+ bottom?: boolean;
163
+ }
164
+ /** A test pad specification. */
165
+ export interface TestPad {
166
+ x: number;
167
+ y: number;
168
+ netName: string;
169
+ diameterMm: number;
170
+ layer: PlacementSide;
171
+ label?: string;
172
+ }
173
+ /** A traceability reference pointing back to a DesignIntent requirement. */
174
+ export interface DesignIntentRef {
175
+ /** ID of the requirement within the DesignIntent (e.g. "req-power-001"). */
176
+ requirementId: string;
177
+ /** Optional free-text note explaining how this node satisfies the requirement. */
178
+ note?: string;
179
+ }
180
+ /** A generic key-value metadata entry. */
181
+ export interface MetadataEntry {
182
+ key: string;
183
+ value: string;
184
+ }
185
+ export declare function isValidBoardType(value: string): value is BoardType;
186
+ export declare function isValidBlockType(value: string): value is BlockType;