@vessel-dsp/core 0.5.0 → 0.6.1

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 (241) hide show
  1. package/README.md +10 -0
  2. package/dist/editor/commands.d.ts +48 -0
  3. package/dist/editor/commands.d.ts.map +1 -0
  4. package/{src/editor/commands.ts → dist/editor/commands.js} +44 -91
  5. package/dist/editor/commands.js.map +1 -0
  6. package/dist/editor/factory.d.ts +10 -0
  7. package/dist/editor/factory.d.ts.map +1 -0
  8. package/{src/editor/factory.ts → dist/editor/factory.js} +11 -27
  9. package/dist/editor/factory.js.map +1 -0
  10. package/dist/editor/history.d.ts +29 -0
  11. package/dist/editor/history.d.ts.map +1 -0
  12. package/{src/editor/history.ts → dist/editor/history.js} +12 -42
  13. package/dist/editor/history.js.map +1 -0
  14. package/{src/editor/index.ts → dist/editor/index.d.ts} +1 -3
  15. package/dist/editor/index.d.ts.map +1 -0
  16. package/dist/editor/index.js +5 -0
  17. package/dist/editor/index.js.map +1 -0
  18. package/dist/editor/layout.d.ts +8 -0
  19. package/dist/editor/layout.d.ts.map +1 -0
  20. package/{src/editor/layout.ts → dist/editor/layout.js} +36 -90
  21. package/dist/editor/layout.js.map +1 -0
  22. package/dist/formats/circuit-json/serializer.d.ts +86 -0
  23. package/dist/formats/circuit-json/serializer.d.ts.map +1 -0
  24. package/{src/formats/circuit-json/serializer.ts → dist/formats/circuit-json/serializer.js} +114 -414
  25. package/dist/formats/circuit-json/serializer.js.map +1 -0
  26. package/dist/formats/document.d.ts +64 -0
  27. package/dist/formats/document.d.ts.map +1 -0
  28. package/dist/formats/document.js +300 -0
  29. package/dist/formats/document.js.map +1 -0
  30. package/dist/formats/interchange/parser.d.ts +3 -0
  31. package/dist/formats/interchange/parser.d.ts.map +1 -0
  32. package/{src/formats/interchange/parser.ts → dist/formats/interchange/parser.js} +651 -299
  33. package/dist/formats/interchange/parser.js.map +1 -0
  34. package/dist/formats/interchange/serializer.d.ts +9 -0
  35. package/dist/formats/interchange/serializer.d.ts.map +1 -0
  36. package/{src/formats/interchange/serializer.ts → dist/formats/interchange/serializer.js} +151 -158
  37. package/dist/formats/interchange/serializer.js.map +1 -0
  38. package/dist/formats/ltspice/catalog.d.ts +19 -0
  39. package/dist/formats/ltspice/catalog.d.ts.map +1 -0
  40. package/{src/formats/ltspice/catalog.ts → dist/formats/ltspice/catalog.js} +18 -52
  41. package/dist/formats/ltspice/catalog.js.map +1 -0
  42. package/dist/formats/ltspice/encoding.d.ts +2 -0
  43. package/dist/formats/ltspice/encoding.d.ts.map +1 -0
  44. package/{src/formats/ltspice/encoding.ts → dist/formats/ltspice/encoding.js} +17 -41
  45. package/dist/formats/ltspice/encoding.js.map +1 -0
  46. package/dist/formats/ltspice/parser.d.ts +3 -0
  47. package/dist/formats/ltspice/parser.d.ts.map +1 -0
  48. package/{src/formats/ltspice/parser.ts → dist/formats/ltspice/parser.js} +39 -141
  49. package/dist/formats/ltspice/parser.js.map +1 -0
  50. package/dist/formats/ltspice/serializer.d.ts +7 -0
  51. package/dist/formats/ltspice/serializer.d.ts.map +1 -0
  52. package/{src/formats/ltspice/serializer.ts → dist/formats/ltspice/serializer.js} +18 -45
  53. package/dist/formats/ltspice/serializer.js.map +1 -0
  54. package/dist/formats/schx/catalog.d.ts +19 -0
  55. package/dist/formats/schx/catalog.d.ts.map +1 -0
  56. package/{src/formats/schx/catalog.ts → dist/formats/schx/catalog.js} +48 -101
  57. package/dist/formats/schx/catalog.js.map +1 -0
  58. package/dist/formats/schx/parser.d.ts +3 -0
  59. package/dist/formats/schx/parser.d.ts.map +1 -0
  60. package/{src/formats/schx/parser.ts → dist/formats/schx/parser.js} +31 -86
  61. package/dist/formats/schx/parser.js.map +1 -0
  62. package/dist/formats/schx/runtime-descriptors.d.ts +3 -0
  63. package/dist/formats/schx/runtime-descriptors.d.ts.map +1 -0
  64. package/{src/formats/schx/runtime-descriptors.ts → dist/formats/schx/runtime-descriptors.js} +36 -123
  65. package/dist/formats/schx/runtime-descriptors.js.map +1 -0
  66. package/dist/formats/schx/serializer.d.ts +5 -0
  67. package/dist/formats/schx/serializer.d.ts.map +1 -0
  68. package/{src/formats/schx/serializer.ts → dist/formats/schx/serializer.js} +17 -42
  69. package/dist/formats/schx/serializer.js.map +1 -0
  70. package/dist/formats/schx/transforms.d.ts +4 -0
  71. package/dist/formats/schx/transforms.d.ts.map +1 -0
  72. package/{src/formats/schx/transforms.ts → dist/formats/schx/transforms.js} +6 -10
  73. package/dist/formats/schx/transforms.js.map +1 -0
  74. package/dist/formats/spice/parser.d.ts +3 -0
  75. package/dist/formats/spice/parser.d.ts.map +1 -0
  76. package/{src/formats/spice/parser.ts → dist/formats/spice/parser.js} +50 -96
  77. package/dist/formats/spice/parser.js.map +1 -0
  78. package/dist/formats/spice/serializer.d.ts +3 -0
  79. package/dist/formats/spice/serializer.d.ts.map +1 -0
  80. package/{src/formats/spice/serializer.ts → dist/formats/spice/serializer.js} +8 -13
  81. package/dist/formats/spice/serializer.js.map +1 -0
  82. package/dist/index.d.ts +47 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/index.js +32 -0
  85. package/dist/index.js.map +1 -0
  86. package/dist/model/connectivity.d.ts +16 -0
  87. package/dist/model/connectivity.d.ts.map +1 -0
  88. package/{src/model/connectivity.ts → dist/model/connectivity.js} +28 -63
  89. package/dist/model/connectivity.js.map +1 -0
  90. package/dist/model/netlist.d.ts +24 -0
  91. package/dist/model/netlist.d.ts.map +1 -0
  92. package/{src/model/netlist.ts → dist/model/netlist.js} +42 -110
  93. package/dist/model/netlist.js.map +1 -0
  94. package/dist/model/properties.d.ts +9 -0
  95. package/dist/model/properties.d.ts.map +1 -0
  96. package/{src/model/properties.ts → dist/model/properties.js} +10 -18
  97. package/dist/model/properties.js.map +1 -0
  98. package/dist/model/quantity.d.ts +3 -0
  99. package/dist/model/quantity.d.ts.map +1 -0
  100. package/{src/model/quantity.ts → dist/model/quantity.js} +7 -30
  101. package/dist/model/quantity.js.map +1 -0
  102. package/dist/model/types.d.ts +431 -0
  103. package/dist/model/types.d.ts.map +1 -0
  104. package/dist/model/types.js +10 -0
  105. package/dist/model/types.js.map +1 -0
  106. package/dist/model/validation.d.ts +32 -0
  107. package/dist/model/validation.d.ts.map +1 -0
  108. package/{src/model/validation.ts → dist/model/validation.js} +420 -323
  109. package/dist/model/validation.js.map +1 -0
  110. package/dist/model/wires.d.ts +3 -0
  111. package/dist/model/wires.d.ts.map +1 -0
  112. package/{src/model/wires.ts → dist/model/wires.js} +10 -16
  113. package/dist/model/wires.js.map +1 -0
  114. package/dist/panel/extract.d.ts +5 -0
  115. package/dist/panel/extract.d.ts.map +1 -0
  116. package/{src/panel/extract.ts → dist/panel/extract.js} +146 -235
  117. package/dist/panel/extract.js.map +1 -0
  118. package/dist/panel/index.d.ts +6 -0
  119. package/dist/panel/index.d.ts.map +1 -0
  120. package/dist/panel/index.js +5 -0
  121. package/dist/panel/index.js.map +1 -0
  122. package/dist/panel/knobs.d.ts +7 -0
  123. package/dist/panel/knobs.d.ts.map +1 -0
  124. package/{src/panel/knobs.ts → dist/panel/knobs.js} +7 -18
  125. package/dist/panel/knobs.js.map +1 -0
  126. package/dist/panel/protocol.d.ts +9 -0
  127. package/dist/panel/protocol.d.ts.map +1 -0
  128. package/{src/panel/protocol.ts → dist/panel/protocol.js} +10 -26
  129. package/dist/panel/protocol.js.map +1 -0
  130. package/{src/panel/types.ts → dist/panel/types.d.ts} +50 -89
  131. package/dist/panel/types.d.ts.map +1 -0
  132. package/dist/panel/types.js +2 -0
  133. package/dist/panel/types.js.map +1 -0
  134. package/dist/preview/bounds.d.ts +12 -0
  135. package/dist/preview/bounds.d.ts.map +1 -0
  136. package/{src/preview/bounds.ts → dist/preview/bounds.js} +15 -29
  137. package/dist/preview/bounds.js.map +1 -0
  138. package/dist/preview/box-layout.d.ts +4 -0
  139. package/dist/preview/box-layout.d.ts.map +1 -0
  140. package/{src/preview/box-layout.ts → dist/preview/box-layout.js} +2 -6
  141. package/dist/preview/box-layout.js.map +1 -0
  142. package/dist/preview/colors.d.ts +3 -0
  143. package/dist/preview/colors.d.ts.map +1 -0
  144. package/{src/preview/colors.ts → dist/preview/colors.js} +3 -5
  145. package/dist/preview/colors.js.map +1 -0
  146. package/dist/preview/hanging.d.ts +8 -0
  147. package/dist/preview/hanging.d.ts.map +1 -0
  148. package/{src/preview/hanging.ts → dist/preview/hanging.js} +9 -28
  149. package/dist/preview/hanging.js.map +1 -0
  150. package/dist/preview/junctions.d.ts +3 -0
  151. package/dist/preview/junctions.d.ts.map +1 -0
  152. package/{src/preview/junctions.ts → dist/preview/junctions.js} +9 -24
  153. package/dist/preview/junctions.js.map +1 -0
  154. package/dist/preview/label-layout.d.ts +12 -0
  155. package/dist/preview/label-layout.d.ts.map +1 -0
  156. package/{src/preview/label-layout.ts → dist/preview/label-layout.js} +15 -36
  157. package/dist/preview/label-layout.js.map +1 -0
  158. package/dist/preview/ports.d.ts +17 -0
  159. package/dist/preview/ports.d.ts.map +1 -0
  160. package/{src/preview/ports.ts → dist/preview/ports.js} +10 -37
  161. package/dist/preview/ports.js.map +1 -0
  162. package/dist/preview/renderable-wires.d.ts +3 -0
  163. package/dist/preview/renderable-wires.d.ts.map +1 -0
  164. package/{src/preview/renderable-wires.ts → dist/preview/renderable-wires.js} +12 -29
  165. package/dist/preview/renderable-wires.js.map +1 -0
  166. package/dist/preview/routing.d.ts +4 -0
  167. package/dist/preview/routing.d.ts.map +1 -0
  168. package/dist/preview/routing.js +13 -0
  169. package/dist/preview/routing.js.map +1 -0
  170. package/dist/preview/snap.d.ts +9 -0
  171. package/dist/preview/snap.d.ts.map +1 -0
  172. package/{src/preview/snap.ts → dist/preview/snap.js} +9 -31
  173. package/dist/preview/snap.js.map +1 -0
  174. package/dist/preview/symbols/svg-content.d.ts +7 -0
  175. package/dist/preview/symbols/svg-content.d.ts.map +1 -0
  176. package/{src/preview/symbols/svg-content.ts → dist/preview/symbols/svg-content.js} +3 -6
  177. package/dist/preview/symbols/svg-content.js.map +1 -0
  178. package/dist/preview/symbols.d.ts +7 -0
  179. package/dist/preview/symbols.d.ts.map +1 -0
  180. package/{src/preview/symbols.ts → dist/preview/symbols.js} +18 -43
  181. package/dist/preview/symbols.js.map +1 -0
  182. package/dist/preview/wire-chains.d.ts +4 -0
  183. package/dist/preview/wire-chains.d.ts.map +1 -0
  184. package/{src/preview/wire-chains.ts → dist/preview/wire-chains.js} +37 -37
  185. package/dist/preview/wire-chains.js.map +1 -0
  186. package/package.json +3 -3
  187. package/src/formats/document.ts +0 -274
  188. package/src/index.ts +0 -205
  189. package/src/model/types.ts +0 -309
  190. package/src/panel/index.ts +0 -39
  191. package/src/preview/routing.ts +0 -15
  192. package/src/preview/symbols/analog-switch.svg +0 -17
  193. package/src/preview/symbols/battery.svg +0 -16
  194. package/src/preview/symbols/bbd.svg +0 -21
  195. package/src/preview/symbols/bjt-npn.svg +0 -16
  196. package/src/preview/symbols/bjt-pnp.svg +0 -17
  197. package/src/preview/symbols/capacitor-electrolytic.svg +0 -13
  198. package/src/preview/symbols/capacitor.svg +0 -12
  199. package/src/preview/symbols/current-source.svg +0 -14
  200. package/src/preview/symbols/delay-ic.svg +0 -22
  201. package/src/preview/symbols/diode-schottky.svg +0 -12
  202. package/src/preview/symbols/diode-zener.svg +0 -12
  203. package/src/preview/symbols/diode.svg +0 -13
  204. package/src/preview/symbols/flipflop.svg +0 -20
  205. package/src/preview/symbols/ground.svg +0 -12
  206. package/src/preview/symbols/ic-block.svg +0 -20
  207. package/src/preview/symbols/ic.svg +0 -19
  208. package/src/preview/symbols/inductor.svg +0 -11
  209. package/src/preview/symbols/jack-input.svg +0 -16
  210. package/src/preview/symbols/jack-output.svg +0 -16
  211. package/src/preview/symbols/jfet-junction-n.svg +0 -17
  212. package/src/preview/symbols/jfet-n.svg +0 -17
  213. package/src/preview/symbols/jfet-p.svg +0 -17
  214. package/src/preview/symbols/label.svg +0 -8
  215. package/src/preview/symbols/led.svg +0 -18
  216. package/src/preview/symbols/mosfet-n.svg +0 -21
  217. package/src/preview/symbols/mosfet-p.svg +0 -21
  218. package/src/preview/symbols/named-wire.svg +0 -11
  219. package/src/preview/symbols/opamp.svg +0 -21
  220. package/src/preview/symbols/optocoupler.svg +0 -30
  221. package/src/preview/symbols/ota.svg +0 -20
  222. package/src/preview/symbols/pentode.svg +0 -25
  223. package/src/preview/symbols/photoresistor.svg +0 -19
  224. package/src/preview/symbols/port.svg +0 -8
  225. package/src/preview/symbols/potentiometer.svg +0 -15
  226. package/src/preview/symbols/power-amp.svg +0 -20
  227. package/src/preview/symbols/rail.svg +0 -11
  228. package/src/preview/symbols/regulator.svg +0 -13
  229. package/src/preview/symbols/relay.svg +0 -20
  230. package/src/preview/symbols/resistor.svg +0 -11
  231. package/src/preview/symbols/switch-3pdt.svg +0 -32
  232. package/src/preview/symbols/switch-rotary.svg +0 -23
  233. package/src/preview/symbols/switch-spdt.svg +0 -16
  234. package/src/preview/symbols/switch-spst.svg +0 -14
  235. package/src/preview/symbols/switch-toggle.svg +0 -14
  236. package/src/preview/symbols/transformer.svg +0 -17
  237. package/src/preview/symbols/triode.svg +0 -17
  238. package/src/preview/symbols/tube-diode.svg +0 -13
  239. package/src/preview/symbols/unsupported.svg +0 -8
  240. package/src/preview/symbols/variable-resistor.svg +0 -13
  241. package/src/preview/symbols/voltage-source.svg +0 -15
@@ -1,309 +0,0 @@
1
- export type Point = Readonly<{ x: number; y: number }>;
2
-
3
- export type Rotation = 0 | 1 | 2 | 3;
4
-
5
- export type ParsedQuantity = Readonly<{
6
- raw: string;
7
- value: number;
8
- unit: string;
9
- }>;
10
-
11
- export type ComponentKind =
12
- | 'resistor'
13
- | 'capacitor'
14
- | 'inductor'
15
- | 'diode'
16
- | 'led'
17
- | 'bjt'
18
- | 'jfet'
19
- | 'mosfet'
20
- | 'opamp'
21
- | 'ota'
22
- | 'triode'
23
- | 'pentode'
24
- | 'tube-diode'
25
- | 'transformer'
26
- | 'potentiometer'
27
- | 'variable-resistor'
28
- | 'switch'
29
- | 'optocoupler'
30
- | 'voltage-source'
31
- | 'current-source'
32
- | 'battery'
33
- | 'ground'
34
- | 'rail'
35
- | 'jack'
36
- | 'bbd'
37
- | 'delay-ic'
38
- | 'power-amp'
39
- | 'regulator'
40
- | 'analog-switch'
41
- | 'flipflop'
42
- | 'ic'
43
- | 'label'
44
- | 'named-wire'
45
- | 'port'
46
- | 'unsupported';
47
-
48
- export type Terminal = Readonly<{
49
- name: string;
50
- position: Point;
51
- }>;
52
-
53
- export type PropertyObject = Readonly<{
54
- readonly [key: string]: PropertyValue;
55
- }>;
56
-
57
- export type PropertyValue =
58
- | ParsedQuantity
59
- | string
60
- | number
61
- | boolean
62
- | null
63
- | readonly PropertyValue[]
64
- | PropertyObject;
65
-
66
- export type Component = Readonly<{
67
- id: string;
68
- kind: ComponentKind;
69
- name: string;
70
- origin: Point;
71
- rotation: Rotation;
72
- flipped: boolean;
73
- terminals: readonly Terminal[];
74
- properties: Readonly<Record<string, PropertyValue>>;
75
- sourceTypeName: string | null;
76
- }>;
77
-
78
- export type Wire = Readonly<{
79
- id: string;
80
- endpoints: readonly [Point, Point];
81
- }>;
82
-
83
- export type DocumentMetadata = Readonly<{
84
- name: string;
85
- description: string;
86
- partNumber: string;
87
- }>;
88
-
89
- export type DocumentSource = Readonly<Record<string, string>>;
90
-
91
- export type ControlInterfaceRole =
92
- | 'external-control'
93
- | 'tempo-tap'
94
- | 'trigger'
95
- | 'reset'
96
- | 'sampler-trigger'
97
- | 'expression'
98
- | 'unknown';
99
-
100
- export type ControlInterfaceConnector =
101
- | '1/4-inch-mono-ts'
102
- | '1/4-inch-trs'
103
- | '3.5mm-mono-ts'
104
- | '3.5mm-trs'
105
- | 'proprietary'
106
- | 'unknown';
107
-
108
- export type ControlInterfaceAssignmentHint =
109
- | 'momentary'
110
- | 'latching'
111
- | 'momentary-or-latching'
112
- | 'continuous';
113
-
114
- export type ControlInterfacePolarity =
115
- | 'normally-open'
116
- | 'normally-closed'
117
- | 'expression'
118
- | 'unknown';
119
-
120
- export type ControlInterfaceBinding = Readonly<{
121
- sourceComponentId?: string;
122
- controlId?: string;
123
- controlName?: string;
124
- property?: string;
125
- }>;
126
-
127
- export type ControlInterface = Readonly<{
128
- id: string;
129
- name: string;
130
- role: ControlInterfaceRole;
131
- componentId?: string;
132
- controlRole?: string;
133
- interface?: string;
134
- connector?: ControlInterfaceConnector;
135
- assignmentHint?: ControlInterfaceAssignmentHint;
136
- polarity?: ControlInterfacePolarity;
137
- binding?: ControlInterfaceBinding;
138
- description?: string;
139
- }>;
140
-
141
- export type CircuitDocumentDeviceKind =
142
- | 'audio-pedal'
143
- | 'control-accessory'
144
- | 'utility'
145
- | 'unknown';
146
-
147
- export type CircuitDocumentDevice = Readonly<{
148
- id?: string;
149
- version?: number;
150
- kind: CircuitDocumentDeviceKind;
151
- family?: string;
152
- model?: string;
153
- audioProcessing?: boolean;
154
- }>;
155
-
156
- export type ControlOutputSwitchMode = 'momentary' | 'latching';
157
-
158
- export type ControlOutput = Readonly<{
159
- id: string;
160
- name: string;
161
- role: ControlInterfaceRole;
162
- connector?: ControlInterfaceConnector;
163
- switchMode?: ControlOutputSwitchMode;
164
- polarity?: ControlInterfacePolarity;
165
- inactiveValue?: number;
166
- activeValue?: number;
167
- componentId?: string;
168
- description?: string;
169
- }>;
170
-
171
- export type ControlContext = Readonly<{
172
- id: string;
173
- name: string;
174
- role: string;
175
- description?: string;
176
- }>;
177
-
178
- export type ControlGroup = Readonly<{
179
- id: string;
180
- name: string;
181
- role: string;
182
- contextIds?: readonly string[];
183
- description?: string;
184
- }>;
185
-
186
- export type DeviceInterfaceControlKind =
187
- | 'knob'
188
- | 'slider'
189
- | 'switch'
190
- | 'selector'
191
- | 'footswitch'
192
- | 'led'
193
- | 'jack';
194
-
195
- export type DeviceInterfaceBinding = Readonly<{
196
- componentId: string;
197
- controlId?: string;
198
- controlName?: string;
199
- property?: string;
200
- externalInterfaceId?: string;
201
- }>;
202
-
203
- export type ControlApplicabilityPredicate = Readonly<{
204
- allOf?: readonly string[];
205
- anyOf?: readonly string[];
206
- }>;
207
-
208
- export type DeviceInterfaceControl = Readonly<{
209
- id: string;
210
- label: string;
211
- kind: DeviceInterfaceControlKind;
212
- role: string;
213
- groupId?: string;
214
- order?: number;
215
- binding?: DeviceInterfaceBinding;
216
- appliesWhen?: ControlApplicabilityPredicate;
217
- description?: string;
218
- }>;
219
-
220
- export type DeviceInterface = Readonly<{
221
- controls: readonly DeviceInterfaceControl[];
222
- }>;
223
-
224
- export type PanelGridIndexing = 'one-based' | 'zero-based';
225
-
226
- export type PanelRowOrder = 'top-to-bottom' | 'bottom-to-top';
227
-
228
- export type PanelColumnOrder = 'left-to-right' | 'right-to-left';
229
-
230
- export type PanelGridLayout = Readonly<{
231
- kind: 'stompbox-grid';
232
- rows: number;
233
- columns: number;
234
- indexing: PanelGridIndexing;
235
- rowOrder?: PanelRowOrder;
236
- columnOrder?: PanelColumnOrder;
237
- }>;
238
-
239
- export type PanelControlKind = 'knob' | 'slider' | 'switch' | 'led' | 'jack';
240
-
241
- export type PanelGridPosition = Readonly<{
242
- row: number;
243
- column: number;
244
- rowSpan?: number;
245
- columnSpan?: number;
246
- }>;
247
-
248
- export type PanelElementBinding = Readonly<{
249
- componentId: string;
250
- controlId?: string;
251
- controlName?: string;
252
- property?: string;
253
- }>;
254
-
255
- export type PanelElementPlacement = Readonly<{
256
- bind: PanelElementBinding;
257
- kind: PanelControlKind;
258
- grid: PanelGridPosition;
259
- label?: string;
260
- interfaceControlId?: string;
261
- }>;
262
-
263
- /** @deprecated Use PanelElementPlacement. */
264
- export type PanelControlPlacement = PanelElementPlacement;
265
-
266
- export type PanelFace = Readonly<{
267
- id: string;
268
- label?: string;
269
- layout: PanelGridLayout;
270
- elements: readonly PanelElementPlacement[];
271
- }>;
272
-
273
- export type PanelPlacementMetadata = Readonly<{
274
- faces: readonly PanelFace[];
275
- }>;
276
-
277
- export type Warning = Readonly<{
278
- code: string;
279
- message: string;
280
- componentId?: string;
281
- wireId?: string;
282
- }>;
283
-
284
- export type CircuitDocument = Readonly<{
285
- metadata: DocumentMetadata;
286
- source?: DocumentSource;
287
- device?: CircuitDocumentDevice;
288
- controlGroups?: readonly ControlGroup[];
289
- controlContexts?: readonly ControlContext[];
290
- deviceInterface?: DeviceInterface;
291
- panel?: PanelPlacementMetadata;
292
- controlInterfaces?: readonly ControlInterface[];
293
- controlOutputs?: readonly ControlOutput[];
294
- components: readonly Component[];
295
- wires: readonly Wire[];
296
- directives: readonly string[];
297
- warnings: readonly Warning[];
298
- rawAttributes: Readonly<Record<string, string>>;
299
- }>;
300
-
301
- export const EMPTY_DOCUMENT: CircuitDocument = {
302
- metadata: { name: '', description: '', partNumber: '' },
303
- source: {},
304
- components: [],
305
- wires: [],
306
- directives: [],
307
- warnings: [],
308
- rawAttributes: {},
309
- };
@@ -1,39 +0,0 @@
1
- export type {
2
- ControlState,
3
- ControlValue,
4
- DeviceInterfaceProvenance,
5
- ExternalControlAssignmentHint,
6
- ExtractedDeviceInterface,
7
- ExtractedDeviceInterfaceControl,
8
- JackAudioRole,
9
- JackPort,
10
- JackRole,
11
- Knob,
12
- KnobControlMode,
13
- KnobStep,
14
- KnobTaper,
15
- KnobValue,
16
- LedIndicator,
17
- LedValue,
18
- Panel,
19
- PanelMessage,
20
- SliderControl,
21
- SliderOrientation,
22
- SliderRange,
23
- SliderValue,
24
- SwitchControl,
25
- SwitchKind,
26
- SwitchValue,
27
- } from './types';
28
- export { PANEL_PROTOCOL_VERSION } from './types';
29
- export { extractDeviceInterface, extractPanel } from './extract';
30
- export { isKnobPositionOnStep, knobStepSize, nearestKnobStep, snapKnobPosition } from './knobs';
31
- export {
32
- applyControlMessage,
33
- defaultControlState,
34
- isKnob,
35
- isLed,
36
- isSlider,
37
- isSwitch,
38
- validateMessage,
39
- } from './protocol';
@@ -1,15 +0,0 @@
1
- import type { Point } from '../model/types';
2
-
3
- export function orthogonalPath(a: Point, b: Point): readonly Point[] {
4
- if (a.x === b.x || a.y === b.y) {
5
- return [a, b];
6
- }
7
- const dx = Math.abs(b.x - a.x);
8
- const dy = Math.abs(b.y - a.y);
9
- const corner: Point = dx >= dy ? { x: b.x, y: a.y } : { x: a.x, y: b.y };
10
- return [a, corner, b];
11
- }
12
-
13
- export function pointsToSvg(points: readonly Point[]): string {
14
- return points.map((p) => `${p.x},${p.y}`).join(' ');
15
- }
@@ -1,17 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: analog-switch (one element of a CD4066-style bilateral switch)
4
- terminals: a (SVG -20,-10), b (SVG 20,-10), ctrl (SVG 0,20)
5
- Two contacts with a control input on the bottom — like an SPST but with electronic control.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="-20" y1="-10" x2="-7" y2="-10"/>
9
- <line x1="7" y1="-10" x2="20" y2="-10"/>
10
- <line x1="0" y1="6" x2="0" y2="20"/>
11
- </g>
12
- <circle cx="-5" cy="-10" r="1.5"/>
13
- <circle cx="5" cy="-10" r="1.5"/>
14
- <line x1="-5" y1="-10" x2="5" y2="-10" stroke-dasharray="2 2"/>
15
- <rect x="-6" y="0" width="12" height="6" rx="1"/>
16
- <text x="0" y="-13" font-size="3.5" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="middle">SW</text>
17
- </svg>
@@ -1,16 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: battery / DC supply
4
- terminals: + (SVG 0,-20), - (SVG 0,20)
5
- Long plate = +, short plate = -. Top lead is the + terminal.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="0" y1="-20" x2="0" y2="-5"/>
9
- <line x1="0" y1="5" x2="0" y2="20"/>
10
- </g>
11
- <line x1="-7" y1="-5" x2="7" y2="-5"/>
12
- <line x1="-3" y1="-2" x2="3" y2="-2"/>
13
- <line x1="-7" y1="2" x2="7" y2="2"/>
14
- <line x1="-3" y1="5" x2="3" y2="5"/>
15
- <text x="-12" y="-4" font-size="6" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none">+</text>
16
- </svg>
@@ -1,21 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-35 -25 70 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: bbd (bucket-brigade delay — MN3007 / MN3008 / MN3205 family)
4
- terminals: vdd (-30,-20), vgg (-30,0), vss (-30,20), cp1 (0,-20), cp2 (0,20), in (-30,10), out1 (30,-10), out2 (30,10)
5
- DIP-8 style rectangle, "BBD" label and small bucket icon on the face.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="-30" y1="-20" x2="-20" y2="-20"/>
9
- <line x1="-30" y1="0" x2="-20" y2="0"/>
10
- <line x1="-30" y1="20" x2="-20" y2="20"/>
11
- <line x1="-30" y1="10" x2="-20" y2="10"/>
12
- <line x1="0" y1="-20" x2="0" y2="-15"/>
13
- <line x1="0" y1="15" x2="0" y2="20"/>
14
- <line x1="20" y1="-10" x2="30" y2="-10"/>
15
- <line x1="20" y1="10" x2="30" y2="10"/>
16
- </g>
17
- <rect x="-20" y="-15" width="40" height="30" rx="2"/>
18
- <circle cx="-17" cy="-12" r="1.2" fill="currentColor" stroke="none"/>
19
- <text x="0" y="-3" font-size="6" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="middle">BBD</text>
20
- <text x="0" y="8" font-size="3.5" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="middle">MN3007</text>
21
- </svg>
@@ -1,16 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: bjt (NPN variant)
4
- terminals: collector (SVG 0,-20), base (SVG -20,0), emitter (SVG 10,20)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="-20" y1="0" x2="-6" y2="0"/>
8
- <line x1="4" y1="-7" x2="0" y2="-20"/>
9
- <line x1="4" y1="7" x2="10" y2="20"/>
10
- </g>
11
- <circle cx="0" cy="0" r="11"/>
12
- <line x1="-6" y1="-5" x2="-6" y2="5"/>
13
- <line x1="-6" y1="-3" x2="4" y2="-7"/>
14
- <line x1="-6" y1="3" x2="4" y2="7"/>
15
- <path d="M 4 7 L -0.3 6.9 L 1.2 4.1 Z" fill="currentColor" stroke="none"/>
16
- </svg>
@@ -1,17 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: bjt (PNP variant)
4
- terminals: collector (SVG 0,-20), base (SVG -20,0), emitter (SVG 10,20)
5
- Arrow points INWARD (emitter -> base) to distinguish PNP from NPN.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="-20" y1="0" x2="-6" y2="0"/>
9
- <line x1="4" y1="-7" x2="0" y2="-20"/>
10
- <line x1="4" y1="7" x2="10" y2="20"/>
11
- </g>
12
- <circle cx="0" cy="0" r="11"/>
13
- <line x1="-6" y1="-5" x2="-6" y2="5"/>
14
- <line x1="-6" y1="-3" x2="4" y2="-7"/>
15
- <line x1="-6" y1="3" x2="4" y2="7"/>
16
- <path d="M -6 3 L -1.7 3.1 L -3.2 5.9 Z" fill="currentColor" stroke="none"/>
17
- </svg>
@@ -1,13 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: capacitor (electrolytic variant)
4
- terminals: a/+ (SVG 0,-20), b/- (SVG 0,20)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="0" y1="-20" x2="0" y2="-3"/>
8
- <line x1="0" y1="5" x2="0" y2="20"/>
9
- </g>
10
- <line x1="-8" y1="-3" x2="8" y2="-3"/>
11
- <path d="M -8 3 Q 0 7 8 3"/>
12
- <text x="-9" y="-6" font-size="7" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none">+</text>
13
- </svg>
@@ -1,12 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: capacitor
4
- terminals: a (SVG 0,-20), b (SVG 0,20)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="0" y1="-20" x2="0" y2="-3"/>
8
- <line x1="0" y1="3" x2="0" y2="20"/>
9
- </g>
10
- <line x1="-8" y1="-3" x2="8" y2="-3"/>
11
- <line x1="-8" y1="3" x2="8" y2="3"/>
12
- </svg>
@@ -1,14 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: current-source
4
- terminals: + (SVG 0,-20), - (SVG 0,20)
5
- Arrow points toward + terminal (top) — direction of conventional current flow.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="0" y1="-20" x2="0" y2="-9"/>
9
- <line x1="0" y1="9" x2="0" y2="20"/>
10
- </g>
11
- <circle cx="0" cy="0" r="9"/>
12
- <line x1="0" y1="5" x2="0" y2="-2"/>
13
- <path d="M 0 -5 L -3 0 L 3 0 Z" fill="currentColor" stroke="none"/>
14
- </svg>
@@ -1,22 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-35 -25 70 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: delay-ic (PT2399 digital echo IC)
4
- terminals: vcc (-30,-20), gnd (-30,20), vref (-30,-10), vco (-30,0), in (-30,10), out (30,-10), fb (30,0), da1 (30,5), da2 (30,10)
5
- DIP-16 footprint, "PT2399" label centered.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="-30" y1="-20" x2="-20" y2="-20"/>
9
- <line x1="-30" y1="-10" x2="-20" y2="-10"/>
10
- <line x1="-30" y1="0" x2="-20" y2="0"/>
11
- <line x1="-30" y1="10" x2="-20" y2="10"/>
12
- <line x1="-30" y1="20" x2="-20" y2="20"/>
13
- <line x1="20" y1="-10" x2="30" y2="-10"/>
14
- <line x1="20" y1="0" x2="30" y2="0"/>
15
- <line x1="20" y1="5" x2="30" y2="5"/>
16
- <line x1="20" y1="10" x2="30" y2="10"/>
17
- </g>
18
- <rect x="-20" y="-22" width="40" height="44" rx="2"/>
19
- <circle cx="-17" cy="-19" r="1.2" fill="currentColor" stroke="none"/>
20
- <text x="0" y="-2" font-size="6" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="middle">PT2399</text>
21
- <text x="0" y="8" font-size="3.5" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="middle">echo</text>
22
- </svg>
@@ -1,12 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: diode (Schottky variant)
4
- terminals: anode (SVG 0,-20), cathode (SVG 0,20)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="0" y1="-20" x2="0" y2="-5"/>
8
- <line x1="0" y1="4" x2="0" y2="20"/>
9
- </g>
10
- <path d="M -6 -5 L 6 -5 L 0 4 Z" fill="currentColor" stroke="none"/>
11
- <polyline points="-9,1 -7,1 -7,4 7,4 7,7 9,7"/>
12
- </svg>
@@ -1,12 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: diode (Zener variant)
4
- terminals: anode (SVG 0,-20), cathode (SVG 0,20)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="0" y1="-20" x2="0" y2="-5"/>
8
- <line x1="0" y1="4" x2="0" y2="20"/>
9
- </g>
10
- <path d="M -6 -5 L 6 -5 L 0 4 Z" fill="currentColor" stroke="none"/>
11
- <polyline points="-9,2 -7,4 7,4 9,6"/>
12
- </svg>
@@ -1,13 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: diode
4
- terminals: anode (SVG 0,-20), cathode (SVG 0,20)
5
- Arrow points anode (top) -> cathode (bottom).
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="0" y1="-20" x2="0" y2="-5"/>
9
- <line x1="0" y1="4" x2="0" y2="20"/>
10
- </g>
11
- <path d="M -6 -5 L 6 -5 L 0 4 Z" fill="currentColor" stroke="none"/>
12
- <line x1="-7" y1="4" x2="7" y2="4"/>
13
- </svg>
@@ -1,20 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: flipflop (one half of a CD4013 dual D flip-flop)
4
- terminals: d (-20,-10), clk (-20,10), s (0,-20), r (0,20), q (20,-10), qbar (20,10)
5
- Rectangular gate body with D/CK on left, Q/Q̄ on right, set/reset on top/bottom.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="-20" y1="-10" x2="-12" y2="-10"/>
9
- <line x1="-20" y1="10" x2="-12" y2="10"/>
10
- <line x1="12" y1="-10" x2="20" y2="-10"/>
11
- <line x1="12" y1="10" x2="20" y2="10"/>
12
- <line x1="0" y1="-20" x2="0" y2="-15"/>
13
- <line x1="0" y1="15" x2="0" y2="20"/>
14
- </g>
15
- <rect x="-12" y="-15" width="24" height="30" rx="2"/>
16
- <text x="-7" y="-7" font-size="4" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none">D</text>
17
- <text x="-9" y="13" font-size="4" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none">CK</text>
18
- <text x="7" y="-7" font-size="4" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="end">Q</text>
19
- <text x="9" y="13" font-size="4" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="end">Q̄</text>
20
- </svg>
@@ -1,12 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: ground
4
- terminals: t (SVG 0,0)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="0" y1="0" x2="0" y2="4"/>
8
- </g>
9
- <line x1="-8" y1="4" x2="8" y2="4"/>
10
- <line x1="-5" y1="8" x2="5" y2="8"/>
11
- <line x1="-2" y1="12" x2="2" y2="12"/>
12
- </svg>
@@ -1,20 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: ic (opaque block — BBD, PT2399, regulator, OTA, codec/DSP)
4
- terminals: generic DIP-8 layout (4 left, 4 right)
5
- NOTE: catalog has no terminal map yet for opaque ICs; this is a layout placeholder.
6
- -->
7
- <g stroke-width="0.95">
8
- <line x1="-20" y1="-9" x2="-13" y2="-9"/>
9
- <line x1="-20" y1="-3" x2="-13" y2="-3"/>
10
- <line x1="-20" y1="3" x2="-13" y2="3"/>
11
- <line x1="-20" y1="9" x2="-13" y2="9"/>
12
- <line x1="13" y1="-9" x2="20" y2="-9"/>
13
- <line x1="13" y1="-3" x2="20" y2="-3"/>
14
- <line x1="13" y1="3" x2="20" y2="3"/>
15
- <line x1="13" y1="9" x2="20" y2="9"/>
16
- </g>
17
- <rect x="-13" y="-13" width="26" height="26" rx="2"/>
18
- <!-- Pin-1 indicator -->
19
- <circle cx="-9" cy="-9" r="1.2" fill="currentColor" stroke="none"/>
20
- </svg>
@@ -1,19 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: ic (generic opaque IC — DIP-8 layout)
4
- terminals: p1..p4 left side (top→bottom), p5..p8 right side (bottom→top)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="-20" y1="-15" x2="-13" y2="-15"/>
8
- <line x1="-20" y1="-5" x2="-13" y2="-5"/>
9
- <line x1="-20" y1="5" x2="-13" y2="5"/>
10
- <line x1="-20" y1="15" x2="-13" y2="15"/>
11
- <line x1="13" y1="-15" x2="20" y2="-15"/>
12
- <line x1="13" y1="-5" x2="20" y2="-5"/>
13
- <line x1="13" y1="5" x2="20" y2="5"/>
14
- <line x1="13" y1="15" x2="20" y2="15"/>
15
- </g>
16
- <rect x="-13" y="-18" width="26" height="36" rx="2"/>
17
- <circle cx="-9" cy="-15" r="1.2" fill="currentColor" stroke="none"/>
18
- <text x="0" y="2" font-size="5" font-family="ui-sans-serif, system-ui, sans-serif" fill="currentColor" stroke="none" text-anchor="middle">IC</text>
19
- </svg>
@@ -1,11 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="-25 -25 50 50" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2
- <!--
3
- kind: inductor
4
- terminals: a (SVG 0,-20), b (SVG 0,20)
5
- -->
6
- <g stroke-width="0.95">
7
- <line x1="0" y1="-20" x2="0" y2="-10"/>
8
- <line x1="0" y1="10" x2="0" y2="20"/>
9
- </g>
10
- <path d="M 0 -10 A 3 2.5 0 0 1 0 -5 A 3 2.5 0 0 1 0 0 A 3 2.5 0 0 1 0 5 A 3 2.5 0 0 1 0 10"/>
11
- </svg>