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
@@ -1,13 +1,42 @@
1
1
  import { z } from 'zod';
2
+ /** Supported protocol versions for the bridge pairing/handshake. */
3
+ export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly ["1.0.0"];
4
+ /**
5
+ * Zod schema for the initial handshake message.
6
+ * Client → Server: identifies the client and its protocol version.
7
+ */
2
8
  export declare const BridgeHandshakeSchema: z.ZodObject<{
3
9
  type: z.ZodLiteral<"handshake">;
4
10
  protocol: z.ZodLiteral<"easyeda-mcp-pro.bridge">;
5
- protocolVersion: z.ZodLiteral<"1.0.0">;
11
+ protocolVersion: z.ZodString;
6
12
  clientName: z.ZodLiteral<"easyeda-mcp-pro">;
13
+ extensionVersion: z.ZodOptional<z.ZodString>;
7
14
  easyedaVersion: z.ZodOptional<z.ZodString>;
8
15
  devMode: z.ZodOptional<z.ZodBoolean>;
9
16
  sessionToken: z.ZodOptional<z.ZodString>;
10
17
  }, z.core.$strip>;
18
+ /**
19
+ * Server → Client: issued before handshake when the bridge requires
20
+ * a pairing proof-of-possession (non-loopback + BRIDGE_TOKEN set).
21
+ */
22
+ export declare const BridgePairingChallengeSchema: z.ZodObject<{
23
+ type: z.ZodLiteral<"pairing_challenge">;
24
+ challenge: z.ZodString;
25
+ }, z.core.$strip>;
26
+ /**
27
+ * Client → Server: response to a pairing challenge.
28
+ * The client echoes the challenge and supplies the session token.
29
+ */
30
+ export declare const BridgePairingResponseSchema: z.ZodObject<{
31
+ type: z.ZodLiteral<"pairing_response">;
32
+ challenge: z.ZodString;
33
+ sessionToken: z.ZodString;
34
+ }, z.core.$strip>;
35
+ /**
36
+ * Zod schema for the hello message.
37
+ * Server → Client: sent after successful handshake/pairing to announce
38
+ * bridge capabilities, version info, and the method registry hash.
39
+ */
11
40
  export declare const BridgeHelloSchema: z.ZodObject<{
12
41
  type: z.ZodLiteral<"hello">;
13
42
  bridgeVersion: z.ZodString;
@@ -17,6 +46,10 @@ export declare const BridgeHelloSchema: z.ZodObject<{
17
46
  methodRegistryHash: z.ZodString;
18
47
  devMode: z.ZodBoolean;
19
48
  }, z.core.$strip>;
49
+ /**
50
+ * Zod schema for an RPC request message.
51
+ * Client → Server: invokes a named method with optional parameters.
52
+ */
20
53
  export declare const BridgeRequestSchema: z.ZodObject<{
21
54
  id: z.ZodString;
22
55
  type: z.ZodLiteral<"request">;
@@ -25,6 +58,10 @@ export declare const BridgeRequestSchema: z.ZodObject<{
25
58
  timeoutMs: z.ZodOptional<z.ZodNumber>;
26
59
  traceparent: z.ZodOptional<z.ZodString>;
27
60
  }, z.core.$strip>;
61
+ /**
62
+ * Zod schema for an RPC response message.
63
+ * Server → Client: carries the result or a structured error.
64
+ */
28
65
  export declare const BridgeResponseSchema: z.ZodObject<{
29
66
  id: z.ZodString;
30
67
  type: z.ZodLiteral<"response">;
@@ -35,6 +72,7 @@ export declare const BridgeResponseSchema: z.ZodObject<{
35
72
  BRIDGE_NOT_READY: "BRIDGE_NOT_READY";
36
73
  METHOD_NOT_ALLOWED: "METHOD_NOT_ALLOWED";
37
74
  METHOD_NOT_FOUND: "METHOD_NOT_FOUND";
75
+ NET_NOT_FOUND: "NET_NOT_FOUND";
38
76
  EASYEDA_API_ERROR: "EASYEDA_API_ERROR";
39
77
  TIMEOUT: "TIMEOUT";
40
78
  INVALID_PARAMS: "INVALID_PARAMS";
@@ -49,11 +87,20 @@ export declare const BridgeResponseSchema: z.ZodObject<{
49
87
  }, z.core.$strip>>;
50
88
  durationMs: z.ZodNumber;
51
89
  }, z.core.$strip>;
90
+ /**
91
+ * Zod schema for a heartbeat keep-alive message.
92
+ * Both directions: ensures the WebSocket connection is still alive.
93
+ */
52
94
  export declare const BridgeHeartbeatSchema: z.ZodObject<{
53
95
  type: z.ZodLiteral<"heartbeat">;
54
96
  timestamp: z.ZodNumber;
55
97
  }, z.core.$strip>;
98
+ /** Inferred TypeScript type for a hello message. */
56
99
  export type BridgeHello = z.infer<typeof BridgeHelloSchema>;
100
+ /**
101
+ * Inferred TypeScript type for a response message with typed result.
102
+ * @template TResult - The shape of the successful result payload.
103
+ */
57
104
  export type BridgeResponse<TResult = unknown> = Omit<z.infer<typeof BridgeResponseSchema>, 'result' | 'error'> & {
58
105
  result?: TResult;
59
106
  error?: {
@@ -1,13 +1,42 @@
1
1
  import { z } from 'zod';
2
+ /** Supported protocol versions for the bridge pairing/handshake. */
3
+ export const SUPPORTED_PROTOCOL_VERSIONS = ['1.0.0'];
4
+ /**
5
+ * Zod schema for the initial handshake message.
6
+ * Client → Server: identifies the client and its protocol version.
7
+ */
2
8
  export const BridgeHandshakeSchema = z.object({
3
9
  type: z.literal('handshake'),
4
10
  protocol: z.literal('easyeda-mcp-pro.bridge'),
5
- protocolVersion: z.literal('1.0.0'),
11
+ protocolVersion: z.string(),
6
12
  clientName: z.literal('easyeda-mcp-pro'),
13
+ extensionVersion: z.string().optional(),
7
14
  easyedaVersion: z.string().optional(),
8
15
  devMode: z.boolean().optional(),
9
16
  sessionToken: z.string().optional(),
10
17
  });
18
+ /**
19
+ * Server → Client: issued before handshake when the bridge requires
20
+ * a pairing proof-of-possession (non-loopback + BRIDGE_TOKEN set).
21
+ */
22
+ export const BridgePairingChallengeSchema = z.object({
23
+ type: z.literal('pairing_challenge'),
24
+ challenge: z.string(),
25
+ });
26
+ /**
27
+ * Client → Server: response to a pairing challenge.
28
+ * The client echoes the challenge and supplies the session token.
29
+ */
30
+ export const BridgePairingResponseSchema = z.object({
31
+ type: z.literal('pairing_response'),
32
+ challenge: z.string(),
33
+ sessionToken: z.string(),
34
+ });
35
+ /**
36
+ * Zod schema for the hello message.
37
+ * Server → Client: sent after successful handshake/pairing to announce
38
+ * bridge capabilities, version info, and the method registry hash.
39
+ */
11
40
  export const BridgeHelloSchema = z.object({
12
41
  type: z.literal('hello'),
13
42
  bridgeVersion: z.string(),
@@ -17,6 +46,10 @@ export const BridgeHelloSchema = z.object({
17
46
  methodRegistryHash: z.string(),
18
47
  devMode: z.boolean(),
19
48
  });
49
+ /**
50
+ * Zod schema for an RPC request message.
51
+ * Client → Server: invokes a named method with optional parameters.
52
+ */
20
53
  export const BridgeRequestSchema = z.object({
21
54
  id: z.string(),
22
55
  type: z.literal('request'),
@@ -25,6 +58,10 @@ export const BridgeRequestSchema = z.object({
25
58
  timeoutMs: z.number().int().optional(),
26
59
  traceparent: z.string().optional(),
27
60
  });
61
+ /**
62
+ * Zod schema for an RPC response message.
63
+ * Server → Client: carries the result or a structured error.
64
+ */
28
65
  export const BridgeResponseSchema = z.object({
29
66
  id: z.string(),
30
67
  type: z.literal('response'),
@@ -36,6 +73,7 @@ export const BridgeResponseSchema = z.object({
36
73
  'BRIDGE_NOT_READY',
37
74
  'METHOD_NOT_ALLOWED',
38
75
  'METHOD_NOT_FOUND',
76
+ 'NET_NOT_FOUND',
39
77
  'EASYEDA_API_ERROR',
40
78
  'TIMEOUT',
41
79
  'INVALID_PARAMS',
@@ -51,6 +89,10 @@ export const BridgeResponseSchema = z.object({
51
89
  .optional(),
52
90
  durationMs: z.number(),
53
91
  });
92
+ /**
93
+ * Zod schema for a heartbeat keep-alive message.
94
+ * Both directions: ensures the WebSocket connection is still alive.
95
+ */
54
96
  export const BridgeHeartbeatSchema = z.object({
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EAAE,CAAC,CAAC,IAAI,CAAC;YACX,kBAAkB;YAClB,oBAAoB;YACpB,kBAAkB;YAClB,eAAe;YACf,mBAAmB;YACnB,SAAS;YACT,gBAAgB;YAChB,cAAc;YACd,mBAAmB;YACnB,SAAS;SACV,CAAC;QACF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC5B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACtC,CAAC;SACD,QAAQ,EAAE;IACb,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
@@ -11,6 +11,11 @@ export declare const EasyedaApiMethodSchema: z.ZodEnum<{
11
11
  "schematic.addWire": "schematic.addWire";
12
12
  "schematic.deletePrimitive": "schematic.deletePrimitive";
13
13
  "schematic.modifyPrimitive": "schematic.modifyPrimitive";
14
+ "schematic.createNetFlag": "schematic.createNetFlag";
15
+ "schematic.createNetPort": "schematic.createNetPort";
16
+ "schematic.connectPinToNet": "schematic.connectPinToNet";
17
+ "schematic.connectPinsByNet": "schematic.connectPinsByNet";
18
+ "schematic.validateNetlist": "schematic.validateNetlist";
14
19
  "system.apiInventory": "system.apiInventory";
15
20
  "system.inspectComponents": "system.inspectComponents";
16
21
  "api.call": "api.call";
@@ -36,4 +41,5 @@ export declare const EasyedaApiMethodSchema: z.ZodEnum<{
36
41
  "pcb.addZone": "pcb.addZone";
37
42
  "pcb.deleteComponent": "pcb.deleteComponent";
38
43
  "pcb.modifyComponent": "pcb.modifyComponent";
44
+ "api.execute": "api.execute";
39
45
  }>;
@@ -11,6 +11,11 @@ export const EasyedaApiMethodSchema = z.enum([
11
11
  'schematic.addWire',
12
12
  'schematic.deletePrimitive',
13
13
  'schematic.modifyPrimitive',
14
+ 'schematic.createNetFlag',
15
+ 'schematic.createNetPort',
16
+ 'schematic.connectPinToNet',
17
+ 'schematic.connectPinsByNet',
18
+ 'schematic.validateNetlist',
14
19
  'system.apiInventory',
15
20
  'system.inspectComponents',
16
21
  'api.call',
@@ -36,5 +41,6 @@ export const EasyedaApiMethodSchema = z.enum([
36
41
  'pcb.addZone',
37
42
  'pcb.deleteComponent',
38
43
  'pcb.modifyComponent',
44
+ 'api.execute',
39
45
  ]);
40
46
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/bridge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,wBAAwB;IACxB,0BAA0B;IAC1B,wBAAwB;IACxB,0BAA0B;IAC1B,mBAAmB;IACnB,2BAA2B;IAC3B,2BAA2B;IAC3B,qBAAqB;IACrB,0BAA0B;IAC1B,UAAU;IACV,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,mBAAmB;IACnB,qBAAqB;IACrB,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,YAAY;IACZ,YAAY;IACZ,kBAAkB;IAClB,kBAAkB;IAClB,YAAY;IACZ,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,qBAAqB;CACtB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/bridge/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,wBAAwB;IACxB,0BAA0B;IAC1B,wBAAwB;IACxB,0BAA0B;IAC1B,mBAAmB;IACnB,2BAA2B;IAC3B,2BAA2B;IAC3B,yBAAyB;IACzB,yBAAyB;IACzB,2BAA2B;IAC3B,4BAA4B;IAC5B,2BAA2B;IAC3B,qBAAqB;IACrB,0BAA0B;IAC1B,UAAU;IACV,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,mBAAmB;IACnB,qBAAqB;IACrB,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,oBAAoB;IACpB,kBAAkB;IAClB,YAAY;IACZ,YAAY;IACZ,kBAAkB;IAClB,kBAAkB;IAClB,YAAY;IACZ,gBAAgB;IAChB,oBAAoB;IACpB,cAAc;IACd,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,qBAAqB;IACrB,aAAa;CACd,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Catalog-specific validation and lookup errors.
3
+ *
4
+ * Follows the same pattern as src/circuit/errors.ts and src/schemas/common.ts.
5
+ *
6
+ * @module
7
+ */
8
+ export declare const CatalogErrorCode: {
9
+ readonly CATALOG_INVALID: "CATALOG_INVALID";
10
+ readonly CATALOG_SCHEMA_VERSION_MISMATCH: "CATALOG_SCHEMA_VERSION_MISMATCH";
11
+ readonly DEVICE_DUPLICATE_ID: "DEVICE_DUPLICATE_ID";
12
+ readonly DEVICE_MISSING_SYMBOL: "DEVICE_MISSING_SYMBOL";
13
+ readonly DEVICE_MISSING_FOOTPRINT: "DEVICE_MISSING_FOOTPRINT";
14
+ readonly DEVICE_MISSING_PIN_MAP: "DEVICE_MISSING_PIN_MAP";
15
+ readonly DEVICE_INCOMPATIBLE_PACKAGE: "DEVICE_INCOMPATIBLE_PACKAGE";
16
+ readonly DEVICE_MISSING_MPN: "DEVICE_MISSING_MPN";
17
+ readonly DEVICE_MISSING_ASSEMBLY_DATA: "DEVICE_MISSING_ASSEMBLY_DATA";
18
+ readonly DEVICE_DUPLICATE_SUPPLIER_ID: "DEVICE_DUPLICATE_SUPPLIER_ID";
19
+ readonly DEVICE_NOT_FOUND: "DEVICE_NOT_FOUND";
20
+ readonly DEVICE_RESOLUTION_FAILED: "DEVICE_RESOLUTION_FAILED";
21
+ };
22
+ export type CatalogErrorCode = (typeof CatalogErrorCode)[keyof typeof CatalogErrorCode];
23
+ export interface CatalogValidationError {
24
+ code: CatalogErrorCode;
25
+ message: string;
26
+ /** Path to the field that caused the error (dot-notation) */
27
+ path?: string;
28
+ /** Specific details for programmatic handling */
29
+ details?: Record<string, unknown>;
30
+ }
31
+ export declare class CatalogError extends Error {
32
+ readonly code: CatalogErrorCode;
33
+ readonly errors: CatalogValidationError[];
34
+ readonly retryable: boolean;
35
+ constructor(opts: {
36
+ code: CatalogErrorCode;
37
+ message: string;
38
+ errors?: CatalogValidationError[];
39
+ retryable?: boolean;
40
+ });
41
+ }
42
+ /**
43
+ * Create a single validation error.
44
+ */
45
+ export declare function catalogValidationError(code: CatalogErrorCode, message: string, details?: Record<string, unknown>): CatalogValidationError;
46
+ /**
47
+ * Build a list of CatalogValidationErrors from a Zod error.
48
+ */
49
+ export declare function fromZodError(zodError: import('zod').ZodError, prefix?: string): CatalogValidationError[];
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Catalog-specific validation and lookup errors.
3
+ *
4
+ * Follows the same pattern as src/circuit/errors.ts and src/schemas/common.ts.
5
+ *
6
+ * @module
7
+ */
8
+ // ── Error codes ───────────────────────────────────────────────────────────
9
+ export const CatalogErrorCode = {
10
+ // Schema validation
11
+ CATALOG_INVALID: 'CATALOG_INVALID',
12
+ CATALOG_SCHEMA_VERSION_MISMATCH: 'CATALOG_SCHEMA_VERSION_MISMATCH',
13
+ // Device validation
14
+ DEVICE_DUPLICATE_ID: 'DEVICE_DUPLICATE_ID',
15
+ DEVICE_MISSING_SYMBOL: 'DEVICE_MISSING_SYMBOL',
16
+ DEVICE_MISSING_FOOTPRINT: 'DEVICE_MISSING_FOOTPRINT',
17
+ DEVICE_MISSING_PIN_MAP: 'DEVICE_MISSING_PIN_MAP',
18
+ DEVICE_INCOMPATIBLE_PACKAGE: 'DEVICE_INCOMPATIBLE_PACKAGE',
19
+ DEVICE_MISSING_MPN: 'DEVICE_MISSING_MPN',
20
+ DEVICE_MISSING_ASSEMBLY_DATA: 'DEVICE_MISSING_ASSEMBLY_DATA',
21
+ DEVICE_DUPLICATE_SUPPLIER_ID: 'DEVICE_DUPLICATE_SUPPLIER_ID',
22
+ // Lookup
23
+ DEVICE_NOT_FOUND: 'DEVICE_NOT_FOUND',
24
+ DEVICE_RESOLUTION_FAILED: 'DEVICE_RESOLUTION_FAILED',
25
+ };
26
+ export class CatalogError extends Error {
27
+ code;
28
+ errors;
29
+ retryable;
30
+ constructor(opts) {
31
+ super(opts.message);
32
+ this.name = 'CatalogError';
33
+ this.code = opts.code;
34
+ this.errors = opts.errors ?? [];
35
+ this.retryable = opts.retryable ?? false;
36
+ }
37
+ }
38
+ // ── Helpers ───────────────────────────────────────────────────────────────
39
+ /**
40
+ * Create a single validation error.
41
+ */
42
+ export function catalogValidationError(code, message, details) {
43
+ return { code, message, details };
44
+ }
45
+ /**
46
+ * Build a list of CatalogValidationErrors from a Zod error.
47
+ */
48
+ export function fromZodError(zodError, prefix) {
49
+ return zodError.issues.map((issue) => ({
50
+ code: 'CATALOG_INVALID',
51
+ message: issue.message,
52
+ path: prefix ? `${prefix}.${issue.path.join('.')}` : issue.path.join('.'),
53
+ details: {
54
+ code: issue.code,
55
+ expected: issue.message,
56
+ received: issue.received,
57
+ },
58
+ }));
59
+ }
60
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot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C;QACrC,IAAI,EAAE,iBAAqC;QAC3C,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QACzE,OAAO,EAAE;YACP,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,OAAO;YACvB,QAAQ,EAAG,KAAgC,CAAC,QAAQ;SACrD;KACF,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Device Catalog module — verified device library with schema, validation,
3
+ * and starter entries for EasyEDA Pro project design.
4
+ *
5
+ * Public API surface for the device catalog subsystem.
6
+ *
7
+ * @module
8
+ */
9
+ export { CatalogError, CatalogErrorCode, catalogValidationError, fromZodError } from './errors.js';
10
+ export type { CatalogErrorCode as CatalogErrorCodeType, CatalogValidationError } from './errors.js';
11
+ export { DEVICE_CATALOG_SCHEMA_VERSION, DeviceCatalogSchema, DeviceEntrySchema, LifecycleStatusSchema, AssemblyHintSchema, ElectricalParamSchema, PinMappingSchema, SupplierIdSchema, Model3DRefSchema, validateDeviceCatalog, validateDeviceEntry, isDeviceCatalog, isDeviceEntry, } from './schema.js';
12
+ export type { DeviceCatalog, DeviceEntry, LifecycleStatus, AssemblyHint, ElectricalParam, PinMapping, SupplierId, Model3DRef, } from './schema.js';
13
+ export { validateCatalog, validateCatalogOrThrow, validateDeviceEntry as validateSingleEntry, } from './validation.js';
14
+ export type { CatalogValidationResult } from './validation.js';
15
+ export { STARTER_DEVICE_CATALOG } from './starter.js';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Device Catalog module — verified device library with schema, validation,
3
+ * and starter entries for EasyEDA Pro project design.
4
+ *
5
+ * Public API surface for the device catalog subsystem.
6
+ *
7
+ * @module
8
+ */
9
+ // Errors
10
+ export { CatalogError, CatalogErrorCode, catalogValidationError, fromZodError } from './errors.js';
11
+ // Schema
12
+ export { DEVICE_CATALOG_SCHEMA_VERSION, DeviceCatalogSchema, DeviceEntrySchema, LifecycleStatusSchema, AssemblyHintSchema, ElectricalParamSchema, PinMappingSchema, SupplierIdSchema, Model3DRefSchema, validateDeviceCatalog, validateDeviceEntry, isDeviceCatalog, isDeviceEntry, } from './schema.js';
13
+ // Validation
14
+ export { validateCatalog, validateCatalogOrThrow, validateDeviceEntry as validateSingleEntry, } from './validation.js';
15
+ // Starter catalog
16
+ export { STARTER_DEVICE_CATALOG } from './starter.js';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/catalog/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,SAAS;AACT,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGnG,SAAS;AACT,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,aAAa,GACd,MAAM,aAAa,CAAC;AAYrB,aAAa;AACb,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,mBAAmB,IAAI,mBAAmB,GAC3C,MAAM,iBAAiB,CAAC;AAGzB,kBAAkB;AAClB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,268 @@
1
+ /**
2
+ * DeviceCatalog — versioned, validated device catalog schema.
3
+ *
4
+ * A DeviceCatalog is a curated library of verified device definitions used
5
+ * in EasyEDA Pro projects. Each entry is a "known-good" device with stable
6
+ * catalog IDs, pre-validated symbol/footprint/3D-model references, pin
7
+ * mapping, electrical parameters, lifecycle and assembly hints, and cross-
8
+ * references to supplier databases (LCSC, JLCPCB, Mouser, DigiKey).
9
+ *
10
+ * The catalog is designed to be:
11
+ * 1. **Versioned** — schema version string for forward compatibility.
12
+ * 2. **Validated** — cross-field refs are checked at parse time.
13
+ * 3. **Extensible** — new device classes and suppliers can be added.
14
+ * 4. **Reusable** — CircuitIR devices can be resolved from the catalog.
15
+ *
16
+ * @schema device-catalog/v1
17
+ */
18
+ import { z } from 'zod';
19
+ export declare const DEVICE_CATALOG_SCHEMA_VERSION = "device-catalog/v1";
20
+ /**
21
+ * Lifecycle status of a device.
22
+ */
23
+ export declare const LifecycleStatusSchema: z.ZodEnum<{
24
+ deprecated: "deprecated";
25
+ obsolete: "obsolete";
26
+ active: "active";
27
+ new: "new";
28
+ "not-recommended": "not-recommended";
29
+ }>;
30
+ export type LifecycleStatus = z.infer<typeof LifecycleStatusSchema>;
31
+ /**
32
+ * Assembly availability hint.
33
+ */
34
+ export declare const AssemblyHintSchema: z.ZodObject<{
35
+ status: z.ZodEnum<{
36
+ unknown: "unknown";
37
+ "in-production": "in-production";
38
+ limited: "limited";
39
+ "end-of-life": "end-of-life";
40
+ "contact-factory": "contact-factory";
41
+ }>;
42
+ moq: z.ZodOptional<z.ZodNumber>;
43
+ leadTimeWeeks: z.ZodOptional<z.ZodNumber>;
44
+ notes: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>;
46
+ export type AssemblyHint = z.infer<typeof AssemblyHintSchema>;
47
+ /**
48
+ * Electrical parameter entry (key-value with optional unit).
49
+ */
50
+ export declare const ElectricalParamSchema: z.ZodObject<{
51
+ name: z.ZodString;
52
+ value: z.ZodString;
53
+ unit: z.ZodOptional<z.ZodString>;
54
+ min: z.ZodOptional<z.ZodString>;
55
+ max: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strip>;
57
+ export type ElectricalParam = z.infer<typeof ElectricalParamSchema>;
58
+ /**
59
+ * Pin mapping entry.
60
+ */
61
+ export declare const PinMappingSchema: z.ZodObject<{
62
+ pin: z.ZodString;
63
+ name: z.ZodString;
64
+ type: z.ZodOptional<z.ZodEnum<{
65
+ output: "output";
66
+ input: "input";
67
+ power: "power";
68
+ ground: "ground";
69
+ analog: "analog";
70
+ bidirectional: "bidirectional";
71
+ "open-drain": "open-drain";
72
+ "pass-through": "pass-through";
73
+ "no-connect": "no-connect";
74
+ }>>;
75
+ description: z.ZodOptional<z.ZodString>;
76
+ }, z.core.$strip>;
77
+ export type PinMapping = z.infer<typeof PinMappingSchema>;
78
+ /**
79
+ * Supplier ID cross-reference.
80
+ */
81
+ export declare const SupplierIdSchema: z.ZodObject<{
82
+ supplier: z.ZodString;
83
+ partId: z.ZodString;
84
+ url: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>;
86
+ export type SupplierId = z.infer<typeof SupplierIdSchema>;
87
+ /**
88
+ * 3D model reference — either a URL/path or an explicit missing marker.
89
+ */
90
+ export declare const Model3DRefSchema: z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"__missing__">, z.ZodLiteral<"">]>;
91
+ export type Model3DRef = z.infer<typeof Model3DRefSchema>;
92
+ /**
93
+ * Single device entry in the catalog.
94
+ */
95
+ export declare const DeviceEntrySchema: z.ZodObject<{
96
+ id: z.ZodString;
97
+ displayName: z.ZodString;
98
+ category: z.ZodString;
99
+ description: z.ZodOptional<z.ZodString>;
100
+ subCategory: z.ZodOptional<z.ZodString>;
101
+ symbolRef: z.ZodString;
102
+ footprintRef: z.ZodString;
103
+ model3dRef: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"__missing__">, z.ZodLiteral<"">]>>;
104
+ manufacturer: z.ZodString;
105
+ mpn: z.ZodString;
106
+ lcsc: z.ZodOptional<z.ZodString>;
107
+ jlcpcb: z.ZodOptional<z.ZodString>;
108
+ supplierIds: z.ZodDefault<z.ZodArray<z.ZodObject<{
109
+ supplier: z.ZodString;
110
+ partId: z.ZodString;
111
+ url: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>>>;
113
+ package: z.ZodString;
114
+ standardPackage: z.ZodOptional<z.ZodString>;
115
+ pinMapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
116
+ pin: z.ZodString;
117
+ name: z.ZodString;
118
+ type: z.ZodOptional<z.ZodEnum<{
119
+ output: "output";
120
+ input: "input";
121
+ power: "power";
122
+ ground: "ground";
123
+ analog: "analog";
124
+ bidirectional: "bidirectional";
125
+ "open-drain": "open-drain";
126
+ "pass-through": "pass-through";
127
+ "no-connect": "no-connect";
128
+ }>>;
129
+ description: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strip>>>;
131
+ electricalParams: z.ZodDefault<z.ZodArray<z.ZodObject<{
132
+ name: z.ZodString;
133
+ value: z.ZodString;
134
+ unit: z.ZodOptional<z.ZodString>;
135
+ min: z.ZodOptional<z.ZodString>;
136
+ max: z.ZodOptional<z.ZodString>;
137
+ }, z.core.$strip>>>;
138
+ lifecycleStatus: z.ZodDefault<z.ZodEnum<{
139
+ deprecated: "deprecated";
140
+ obsolete: "obsolete";
141
+ active: "active";
142
+ new: "new";
143
+ "not-recommended": "not-recommended";
144
+ }>>;
145
+ assemblyHint: z.ZodOptional<z.ZodObject<{
146
+ status: z.ZodEnum<{
147
+ unknown: "unknown";
148
+ "in-production": "in-production";
149
+ limited: "limited";
150
+ "end-of-life": "end-of-life";
151
+ "contact-factory": "contact-factory";
152
+ }>;
153
+ moq: z.ZodOptional<z.ZodNumber>;
154
+ leadTimeWeeks: z.ZodOptional<z.ZodNumber>;
155
+ notes: z.ZodOptional<z.ZodString>;
156
+ }, z.core.$strip>>;
157
+ datasheetUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
158
+ productPageUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
159
+ metadata: z.ZodDefault<z.ZodArray<z.ZodObject<{
160
+ key: z.ZodString;
161
+ value: z.ZodString;
162
+ }, z.core.$strip>>>;
163
+ notes: z.ZodOptional<z.ZodString>;
164
+ }, z.core.$strict>;
165
+ export type DeviceEntry = z.infer<typeof DeviceEntrySchema>;
166
+ export declare const DeviceCatalogSchema: z.ZodObject<{
167
+ $schema: z.ZodDefault<z.ZodLiteral<"device-catalog/v1">>;
168
+ devices: z.ZodDefault<z.ZodArray<z.ZodObject<{
169
+ id: z.ZodString;
170
+ displayName: z.ZodString;
171
+ category: z.ZodString;
172
+ description: z.ZodOptional<z.ZodString>;
173
+ subCategory: z.ZodOptional<z.ZodString>;
174
+ symbolRef: z.ZodString;
175
+ footprintRef: z.ZodString;
176
+ model3dRef: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"__missing__">, z.ZodLiteral<"">]>>;
177
+ manufacturer: z.ZodString;
178
+ mpn: z.ZodString;
179
+ lcsc: z.ZodOptional<z.ZodString>;
180
+ jlcpcb: z.ZodOptional<z.ZodString>;
181
+ supplierIds: z.ZodDefault<z.ZodArray<z.ZodObject<{
182
+ supplier: z.ZodString;
183
+ partId: z.ZodString;
184
+ url: z.ZodOptional<z.ZodString>;
185
+ }, z.core.$strip>>>;
186
+ package: z.ZodString;
187
+ standardPackage: z.ZodOptional<z.ZodString>;
188
+ pinMapping: z.ZodDefault<z.ZodArray<z.ZodObject<{
189
+ pin: z.ZodString;
190
+ name: z.ZodString;
191
+ type: z.ZodOptional<z.ZodEnum<{
192
+ output: "output";
193
+ input: "input";
194
+ power: "power";
195
+ ground: "ground";
196
+ analog: "analog";
197
+ bidirectional: "bidirectional";
198
+ "open-drain": "open-drain";
199
+ "pass-through": "pass-through";
200
+ "no-connect": "no-connect";
201
+ }>>;
202
+ description: z.ZodOptional<z.ZodString>;
203
+ }, z.core.$strip>>>;
204
+ electricalParams: z.ZodDefault<z.ZodArray<z.ZodObject<{
205
+ name: z.ZodString;
206
+ value: z.ZodString;
207
+ unit: z.ZodOptional<z.ZodString>;
208
+ min: z.ZodOptional<z.ZodString>;
209
+ max: z.ZodOptional<z.ZodString>;
210
+ }, z.core.$strip>>>;
211
+ lifecycleStatus: z.ZodDefault<z.ZodEnum<{
212
+ deprecated: "deprecated";
213
+ obsolete: "obsolete";
214
+ active: "active";
215
+ new: "new";
216
+ "not-recommended": "not-recommended";
217
+ }>>;
218
+ assemblyHint: z.ZodOptional<z.ZodObject<{
219
+ status: z.ZodEnum<{
220
+ unknown: "unknown";
221
+ "in-production": "in-production";
222
+ limited: "limited";
223
+ "end-of-life": "end-of-life";
224
+ "contact-factory": "contact-factory";
225
+ }>;
226
+ moq: z.ZodOptional<z.ZodNumber>;
227
+ leadTimeWeeks: z.ZodOptional<z.ZodNumber>;
228
+ notes: z.ZodOptional<z.ZodString>;
229
+ }, z.core.$strip>>;
230
+ datasheetUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
231
+ productPageUrl: z.ZodUnion<[z.ZodOptional<z.ZodString>, z.ZodLiteral<"">]>;
232
+ metadata: z.ZodDefault<z.ZodArray<z.ZodObject<{
233
+ key: z.ZodString;
234
+ value: z.ZodString;
235
+ }, z.core.$strip>>>;
236
+ notes: z.ZodOptional<z.ZodString>;
237
+ }, z.core.$strict>>>;
238
+ metadata: z.ZodOptional<z.ZodObject<{
239
+ version: z.ZodDefault<z.ZodLiteral<"1.0.0">>;
240
+ name: z.ZodOptional<z.ZodString>;
241
+ description: z.ZodOptional<z.ZodString>;
242
+ updatedAt: z.ZodOptional<z.ZodString>;
243
+ deviceCount: z.ZodOptional<z.ZodNumber>;
244
+ }, z.core.$strip>>;
245
+ }, z.core.$strict>;
246
+ export type DeviceCatalog = z.infer<typeof DeviceCatalogSchema>;
247
+ /**
248
+ * Parse and validate an unknown input as a DeviceCatalog.
249
+ *
250
+ * Returns the validated DeviceCatalog on success.
251
+ * Throws `CatalogError` with structured errors on failure.
252
+ */
253
+ export declare function validateDeviceCatalog(input: unknown): DeviceCatalog;
254
+ /**
255
+ * Parse and validate an unknown input as a single DeviceEntry.
256
+ *
257
+ * Returns the validated DeviceEntry on success.
258
+ * Throws `CatalogError` with structured errors on failure.
259
+ */
260
+ export declare function validateDeviceEntry(input: unknown): DeviceEntry;
261
+ /**
262
+ * Type guard: check whether an unknown value is a valid DeviceCatalog.
263
+ */
264
+ export declare function isDeviceCatalog(value: unknown): value is DeviceCatalog;
265
+ /**
266
+ * Type guard: check whether an unknown value is a valid DeviceEntry.
267
+ */
268
+ export declare function isDeviceEntry(value: unknown): value is DeviceEntry;