@simten/ui 0.1.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 (307) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +41 -0
  3. package/dist/canvas/CircuitCanvas.d.ts +45 -0
  4. package/dist/canvas/CircuitCanvas.d.ts.map +1 -0
  5. package/dist/canvas/CircuitCanvas.js +293 -0
  6. package/dist/canvas/CircuitCanvas.js.map +1 -0
  7. package/dist/canvas/ClockControls.d.ts +31 -0
  8. package/dist/canvas/ClockControls.d.ts.map +1 -0
  9. package/dist/canvas/ClockControls.js +33 -0
  10. package/dist/canvas/ClockControls.js.map +1 -0
  11. package/dist/canvas/CompositeInspectorDialog.d.ts +24 -0
  12. package/dist/canvas/CompositeInspectorDialog.d.ts.map +1 -0
  13. package/dist/canvas/CompositeInspectorDialog.js +290 -0
  14. package/dist/canvas/CompositeInspectorDialog.js.map +1 -0
  15. package/dist/canvas/dagre-layout.d.ts +40 -0
  16. package/dist/canvas/dagre-layout.d.ts.map +1 -0
  17. package/dist/canvas/dagre-layout.js +86 -0
  18. package/dist/canvas/dagre-layout.js.map +1 -0
  19. package/dist/canvas/drill-down-view.d.ts +35 -0
  20. package/dist/canvas/drill-down-view.d.ts.map +1 -0
  21. package/dist/canvas/drill-down-view.js +134 -0
  22. package/dist/canvas/drill-down-view.js.map +1 -0
  23. package/dist/canvas/hooks/useDetectTheme.d.ts +6 -0
  24. package/dist/canvas/hooks/useDetectTheme.d.ts.map +1 -0
  25. package/dist/canvas/hooks/useDetectTheme.js +20 -0
  26. package/dist/canvas/hooks/useDetectTheme.js.map +1 -0
  27. package/dist/canvas/hooks/useIsMobile.d.ts +2 -0
  28. package/dist/canvas/hooks/useIsMobile.d.ts.map +1 -0
  29. package/dist/canvas/hooks/useIsMobile.js +20 -0
  30. package/dist/canvas/hooks/useIsMobile.js.map +1 -0
  31. package/dist/canvas/hooks/useSimulationSession.d.ts +23 -0
  32. package/dist/canvas/hooks/useSimulationSession.d.ts.map +1 -0
  33. package/dist/canvas/hooks/useSimulationSession.js +41 -0
  34. package/dist/canvas/hooks/useSimulationSession.js.map +1 -0
  35. package/dist/canvas/index.d.ts +22 -0
  36. package/dist/canvas/index.d.ts.map +1 -0
  37. package/dist/canvas/index.js +17 -0
  38. package/dist/canvas/index.js.map +1 -0
  39. package/dist/canvas/label-utils.d.ts +10 -0
  40. package/dist/canvas/label-utils.d.ts.map +1 -0
  41. package/dist/canvas/label-utils.js +32 -0
  42. package/dist/canvas/label-utils.js.map +1 -0
  43. package/dist/canvas/node-types.d.ts +10 -0
  44. package/dist/canvas/node-types.d.ts.map +1 -0
  45. package/dist/canvas/node-types.js +29 -0
  46. package/dist/canvas/node-types.js.map +1 -0
  47. package/dist/canvas/projection.d.ts +19 -0
  48. package/dist/canvas/projection.d.ts.map +1 -0
  49. package/dist/canvas/projection.js +317 -0
  50. package/dist/canvas/projection.js.map +1 -0
  51. package/dist/canvas/types.d.ts +56 -0
  52. package/dist/canvas/types.d.ts.map +1 -0
  53. package/dist/canvas/types.js +6 -0
  54. package/dist/canvas/types.js.map +1 -0
  55. package/dist/canvas/useLayout.d.ts +21 -0
  56. package/dist/canvas/useLayout.d.ts.map +1 -0
  57. package/dist/canvas/useLayout.js +26 -0
  58. package/dist/canvas/useLayout.js.map +1 -0
  59. package/dist/editor/components/CircuitSelector.d.ts +9 -0
  60. package/dist/editor/components/CircuitSelector.d.ts.map +1 -0
  61. package/dist/editor/components/CircuitSelector.js +20 -0
  62. package/dist/editor/components/CircuitSelector.js.map +1 -0
  63. package/dist/editor/components/CircuitTabBar.d.ts +8 -0
  64. package/dist/editor/components/CircuitTabBar.d.ts.map +1 -0
  65. package/dist/editor/components/CircuitTabBar.js +23 -0
  66. package/dist/editor/components/CircuitTabBar.js.map +1 -0
  67. package/dist/editor/components/ClockControls.d.ts +6 -0
  68. package/dist/editor/components/ClockControls.d.ts.map +1 -0
  69. package/dist/editor/components/ClockControls.js +7 -0
  70. package/dist/editor/components/ClockControls.js.map +1 -0
  71. package/dist/editor/components/ComponentTooltip.d.ts +25 -0
  72. package/dist/editor/components/ComponentTooltip.d.ts.map +1 -0
  73. package/dist/editor/components/ComponentTooltip.js +82 -0
  74. package/dist/editor/components/ComponentTooltip.js.map +1 -0
  75. package/dist/editor/components/ConflictResolutionModal.d.ts +19 -0
  76. package/dist/editor/components/ConflictResolutionModal.d.ts.map +1 -0
  77. package/dist/editor/components/ConflictResolutionModal.js +20 -0
  78. package/dist/editor/components/ConflictResolutionModal.js.map +1 -0
  79. package/dist/editor/components/HierarchyBreadcrumb.d.ts +9 -0
  80. package/dist/editor/components/HierarchyBreadcrumb.d.ts.map +1 -0
  81. package/dist/editor/components/HierarchyBreadcrumb.js +32 -0
  82. package/dist/editor/components/HierarchyBreadcrumb.js.map +1 -0
  83. package/dist/editor/components/LabelEditor.d.ts +17 -0
  84. package/dist/editor/components/LabelEditor.d.ts.map +1 -0
  85. package/dist/editor/components/LabelEditor.js +40 -0
  86. package/dist/editor/components/LabelEditor.js.map +1 -0
  87. package/dist/editor/components/SignalOutputPanel.d.ts +11 -0
  88. package/dist/editor/components/SignalOutputPanel.d.ts.map +1 -0
  89. package/dist/editor/components/SignalOutputPanel.js +34 -0
  90. package/dist/editor/components/SignalOutputPanel.js.map +1 -0
  91. package/dist/editor/components/index.d.ts +9 -0
  92. package/dist/editor/components/index.d.ts.map +1 -0
  93. package/dist/editor/components/index.js +9 -0
  94. package/dist/editor/components/index.js.map +1 -0
  95. package/dist/editor/hooks/index.d.ts +1 -0
  96. package/dist/editor/hooks/index.d.ts.map +1 -0
  97. package/dist/editor/hooks/index.js +2 -0
  98. package/dist/editor/hooks/index.js.map +1 -0
  99. package/dist/editor/index.d.ts +5 -0
  100. package/dist/editor/index.d.ts.map +1 -0
  101. package/dist/editor/index.js +5 -0
  102. package/dist/editor/index.js.map +1 -0
  103. package/dist/editor/lib/simulation/index.d.ts +7 -0
  104. package/dist/editor/lib/simulation/index.d.ts.map +1 -0
  105. package/dist/editor/lib/simulation/index.js +8 -0
  106. package/dist/editor/lib/simulation/index.js.map +1 -0
  107. package/dist/editor/lib/utils/circuit-flattener.d.ts +29 -0
  108. package/dist/editor/lib/utils/circuit-flattener.d.ts.map +1 -0
  109. package/dist/editor/lib/utils/circuit-flattener.js +230 -0
  110. package/dist/editor/lib/utils/circuit-flattener.js.map +1 -0
  111. package/dist/editor/lib/utils/component-utils.d.ts +28 -0
  112. package/dist/editor/lib/utils/component-utils.d.ts.map +1 -0
  113. package/dist/editor/lib/utils/component-utils.js +72 -0
  114. package/dist/editor/lib/utils/component-utils.js.map +1 -0
  115. package/dist/editor/lib/utils/index.d.ts +3 -0
  116. package/dist/editor/lib/utils/index.d.ts.map +1 -0
  117. package/dist/editor/lib/utils/index.js +3 -0
  118. package/dist/editor/lib/utils/index.js.map +1 -0
  119. package/dist/editor/lib/visualization/index.d.ts +2 -0
  120. package/dist/editor/lib/visualization/index.d.ts.map +1 -0
  121. package/dist/editor/lib/visualization/index.js +2 -0
  122. package/dist/editor/lib/visualization/index.js.map +1 -0
  123. package/dist/editor/lib/visualization/vcd-generator.d.ts +63 -0
  124. package/dist/editor/lib/visualization/vcd-generator.d.ts.map +1 -0
  125. package/dist/editor/lib/visualization/vcd-generator.js +269 -0
  126. package/dist/editor/lib/visualization/vcd-generator.js.map +1 -0
  127. package/dist/editor/stores/circuit-library-store.d.ts +25 -0
  128. package/dist/editor/stores/circuit-library-store.d.ts.map +1 -0
  129. package/dist/editor/stores/circuit-library-store.js +51 -0
  130. package/dist/editor/stores/circuit-library-store.js.map +1 -0
  131. package/dist/editor/stores/circuit-preview-store.d.ts +687 -0
  132. package/dist/editor/stores/circuit-preview-store.d.ts.map +1 -0
  133. package/dist/editor/stores/circuit-preview-store.js +226 -0
  134. package/dist/editor/stores/circuit-preview-store.js.map +1 -0
  135. package/dist/editor/stores/circuit-store.d.ts +354 -0
  136. package/dist/editor/stores/circuit-store.d.ts.map +1 -0
  137. package/dist/editor/stores/circuit-store.js +227 -0
  138. package/dist/editor/stores/circuit-store.js.map +1 -0
  139. package/dist/editor/stores/index.d.ts +11 -0
  140. package/dist/editor/stores/index.d.ts.map +1 -0
  141. package/dist/editor/stores/index.js +8 -0
  142. package/dist/editor/stores/index.js.map +1 -0
  143. package/dist/editor/stores/ui-store.d.ts +96 -0
  144. package/dist/editor/stores/ui-store.d.ts.map +1 -0
  145. package/dist/editor/stores/ui-store.js +101 -0
  146. package/dist/editor/stores/ui-store.js.map +1 -0
  147. package/dist/editor/types/circuit.d.ts +207 -0
  148. package/dist/editor/types/circuit.d.ts.map +1 -0
  149. package/dist/editor/types/circuit.js +62 -0
  150. package/dist/editor/types/circuit.js.map +1 -0
  151. package/dist/editor/types/index.d.ts +12 -0
  152. package/dist/editor/types/index.d.ts.map +1 -0
  153. package/dist/editor/types/index.js +11 -0
  154. package/dist/editor/types/index.js.map +1 -0
  155. package/dist/editor/types/testbench.d.ts +150 -0
  156. package/dist/editor/types/testbench.d.ts.map +1 -0
  157. package/dist/editor/types/testbench.js +85 -0
  158. package/dist/editor/types/testbench.js.map +1 -0
  159. package/dist/editor/types/testing.d.ts +88 -0
  160. package/dist/editor/types/testing.d.ts.map +1 -0
  161. package/dist/editor/types/testing.js +6 -0
  162. package/dist/editor/types/testing.js.map +1 -0
  163. package/dist/editor/types/ui-model.d.ts +68 -0
  164. package/dist/editor/types/ui-model.d.ts.map +1 -0
  165. package/dist/editor/types/ui-model.js +66 -0
  166. package/dist/editor/types/ui-model.js.map +1 -0
  167. package/dist/editor/types/ui.d.ts +33 -0
  168. package/dist/editor/types/ui.d.ts.map +1 -0
  169. package/dist/editor/types/ui.js +8 -0
  170. package/dist/editor/types/ui.js.map +1 -0
  171. package/dist/editor/types/visual.d.ts +45 -0
  172. package/dist/editor/types/visual.d.ts.map +1 -0
  173. package/dist/editor/types/visual.js +23 -0
  174. package/dist/editor/types/visual.js.map +1 -0
  175. package/dist/editor/utils/index.d.ts +5 -0
  176. package/dist/editor/utils/index.d.ts.map +1 -0
  177. package/dist/editor/utils/index.js +6 -0
  178. package/dist/editor/utils/index.js.map +1 -0
  179. package/dist/index.d.ts +11 -0
  180. package/dist/index.d.ts.map +1 -0
  181. package/dist/index.js +12 -0
  182. package/dist/index.js.map +1 -0
  183. package/dist/lib/utils.d.ts +3 -0
  184. package/dist/lib/utils.d.ts.map +1 -0
  185. package/dist/lib/utils.js +6 -0
  186. package/dist/lib/utils.js.map +1 -0
  187. package/dist/nodes/BaseNode.d.ts +20 -0
  188. package/dist/nodes/BaseNode.d.ts.map +1 -0
  189. package/dist/nodes/BaseNode.js +26 -0
  190. package/dist/nodes/BaseNode.js.map +1 -0
  191. package/dist/nodes/CompositeBadge.d.ts +6 -0
  192. package/dist/nodes/CompositeBadge.d.ts.map +1 -0
  193. package/dist/nodes/CompositeBadge.js +10 -0
  194. package/dist/nodes/CompositeBadge.js.map +1 -0
  195. package/dist/nodes/ConsoleNode.d.ts +8 -0
  196. package/dist/nodes/ConsoleNode.d.ts.map +1 -0
  197. package/dist/nodes/ConsoleNode.js +16 -0
  198. package/dist/nodes/ConsoleNode.js.map +1 -0
  199. package/dist/nodes/EmbedConsoleNode.d.ts +8 -0
  200. package/dist/nodes/EmbedConsoleNode.d.ts.map +1 -0
  201. package/dist/nodes/EmbedConsoleNode.js +24 -0
  202. package/dist/nodes/EmbedConsoleNode.js.map +1 -0
  203. package/dist/nodes/EmbedScreenNode.d.ts +8 -0
  204. package/dist/nodes/EmbedScreenNode.d.ts.map +1 -0
  205. package/dist/nodes/EmbedScreenNode.js +24 -0
  206. package/dist/nodes/EmbedScreenNode.js.map +1 -0
  207. package/dist/nodes/EthFrameInputNode.d.ts +8 -0
  208. package/dist/nodes/EthFrameInputNode.d.ts.map +1 -0
  209. package/dist/nodes/EthFrameInputNode.js +14 -0
  210. package/dist/nodes/EthFrameInputNode.js.map +1 -0
  211. package/dist/nodes/InputNode.d.ts +8 -0
  212. package/dist/nodes/InputNode.d.ts.map +1 -0
  213. package/dist/nodes/InputNode.js +57 -0
  214. package/dist/nodes/InputNode.js.map +1 -0
  215. package/dist/nodes/LogicGateNode.d.ts +8 -0
  216. package/dist/nodes/LogicGateNode.d.ts.map +1 -0
  217. package/dist/nodes/LogicGateNode.js +51 -0
  218. package/dist/nodes/LogicGateNode.js.map +1 -0
  219. package/dist/nodes/NicFifoNode.d.ts +8 -0
  220. package/dist/nodes/NicFifoNode.d.ts.map +1 -0
  221. package/dist/nodes/NicFifoNode.js +10 -0
  222. package/dist/nodes/NicFifoNode.js.map +1 -0
  223. package/dist/nodes/NodeData.d.ts +34 -0
  224. package/dist/nodes/NodeData.d.ts.map +1 -0
  225. package/dist/nodes/NodeData.js +2 -0
  226. package/dist/nodes/NodeData.js.map +1 -0
  227. package/dist/nodes/NumericInputNode.d.ts +8 -0
  228. package/dist/nodes/NumericInputNode.d.ts.map +1 -0
  229. package/dist/nodes/NumericInputNode.js +47 -0
  230. package/dist/nodes/NumericInputNode.js.map +1 -0
  231. package/dist/nodes/OutputNode.d.ts +8 -0
  232. package/dist/nodes/OutputNode.d.ts.map +1 -0
  233. package/dist/nodes/OutputNode.js +32 -0
  234. package/dist/nodes/OutputNode.js.map +1 -0
  235. package/dist/nodes/RAMNode.d.ts +8 -0
  236. package/dist/nodes/RAMNode.d.ts.map +1 -0
  237. package/dist/nodes/RAMNode.js +23 -0
  238. package/dist/nodes/RAMNode.js.map +1 -0
  239. package/dist/nodes/ROMNode.d.ts +8 -0
  240. package/dist/nodes/ROMNode.d.ts.map +1 -0
  241. package/dist/nodes/ROMNode.js +23 -0
  242. package/dist/nodes/ROMNode.js.map +1 -0
  243. package/dist/nodes/RV32IInstrMemNode.d.ts +16 -0
  244. package/dist/nodes/RV32IInstrMemNode.d.ts.map +1 -0
  245. package/dist/nodes/RV32IInstrMemNode.js +183 -0
  246. package/dist/nodes/RV32IInstrMemNode.js.map +1 -0
  247. package/dist/nodes/RasterDisplayNode.d.ts +8 -0
  248. package/dist/nodes/RasterDisplayNode.d.ts.map +1 -0
  249. package/dist/nodes/RasterDisplayNode.js +14 -0
  250. package/dist/nodes/RasterDisplayNode.js.map +1 -0
  251. package/dist/nodes/RegisterNode.d.ts +8 -0
  252. package/dist/nodes/RegisterNode.d.ts.map +1 -0
  253. package/dist/nodes/RegisterNode.js +14 -0
  254. package/dist/nodes/RegisterNode.js.map +1 -0
  255. package/dist/nodes/ScreenNode.d.ts +8 -0
  256. package/dist/nodes/ScreenNode.d.ts.map +1 -0
  257. package/dist/nodes/ScreenNode.js +16 -0
  258. package/dist/nodes/ScreenNode.js.map +1 -0
  259. package/dist/nodes/UartTxNode.d.ts +8 -0
  260. package/dist/nodes/UartTxNode.d.ts.map +1 -0
  261. package/dist/nodes/UartTxNode.js +16 -0
  262. package/dist/nodes/UartTxNode.js.map +1 -0
  263. package/dist/nodes/index.d.ts +27 -0
  264. package/dist/nodes/index.d.ts.map +1 -0
  265. package/dist/nodes/index.js +30 -0
  266. package/dist/nodes/index.js.map +1 -0
  267. package/dist/primitives/button.d.ts +12 -0
  268. package/dist/primitives/button.d.ts.map +1 -0
  269. package/dist/primitives/button.js +32 -0
  270. package/dist/primitives/button.js.map +1 -0
  271. package/dist/primitives/index.d.ts +4 -0
  272. package/dist/primitives/index.d.ts.map +1 -0
  273. package/dist/primitives/index.js +4 -0
  274. package/dist/primitives/index.js.map +1 -0
  275. package/dist/primitives/sheet.d.ts +15 -0
  276. package/dist/primitives/sheet.d.ts.map +1 -0
  277. package/dist/primitives/sheet.js +40 -0
  278. package/dist/primitives/sheet.js.map +1 -0
  279. package/dist/primitives/tooltip.d.ts +8 -0
  280. package/dist/primitives/tooltip.d.ts.map +1 -0
  281. package/dist/primitives/tooltip.js +17 -0
  282. package/dist/primitives/tooltip.js.map +1 -0
  283. package/dist/sandbox/SandboxProvider.d.ts +13 -0
  284. package/dist/sandbox/SandboxProvider.d.ts.map +1 -0
  285. package/dist/sandbox/SandboxProvider.js +34 -0
  286. package/dist/sandbox/SandboxProvider.js.map +1 -0
  287. package/dist/sandbox/index.d.ts +4 -0
  288. package/dist/sandbox/index.d.ts.map +1 -0
  289. package/dist/sandbox/index.js +3 -0
  290. package/dist/sandbox/index.js.map +1 -0
  291. package/dist/sandbox/useSandbox.d.ts +197 -0
  292. package/dist/sandbox/useSandbox.d.ts.map +1 -0
  293. package/dist/sandbox/useSandbox.js +250 -0
  294. package/dist/sandbox/useSandbox.js.map +1 -0
  295. package/dist/share/encode-source.d.ts +13 -0
  296. package/dist/share/encode-source.d.ts.map +1 -0
  297. package/dist/share/encode-source.js +31 -0
  298. package/dist/share/encode-source.js.map +1 -0
  299. package/dist/share/index.d.ts +2 -0
  300. package/dist/share/index.d.ts.map +1 -0
  301. package/dist/share/index.js +2 -0
  302. package/dist/share/index.js.map +1 -0
  303. package/dist/waveform/WaveformViewer.d.ts +30 -0
  304. package/dist/waveform/WaveformViewer.d.ts.map +1 -0
  305. package/dist/waveform/WaveformViewer.js +356 -0
  306. package/dist/waveform/WaveformViewer.js.map +1 -0
  307. package/package.json +110 -0
@@ -0,0 +1,207 @@
1
+ /**
2
+ * Intermediate Representation (IR) v0.1 - TypeScript Type Definitions
3
+ *
4
+ * This is the formal IR specification in TypeScript.
5
+ * See /docs/circuit-spec.md for detailed documentation.
6
+ */
7
+ export interface BitType {
8
+ kind: 'bit';
9
+ }
10
+ export interface BusType {
11
+ kind: 'bus';
12
+ width: number;
13
+ }
14
+ export type PortType = BitType | BusType;
15
+ export interface PortDescriptor {
16
+ name: string;
17
+ portType: PortType;
18
+ description?: string;
19
+ /** Default value for unconnected inputs. If specified, port is optional. */
20
+ defaultValue?: BitValue | BusValue;
21
+ widthParam?: string;
22
+ widthMultiplier?: number;
23
+ }
24
+ export type BitValue = boolean;
25
+ export type BusValue = number;
26
+ export interface PortInstance {
27
+ id: string;
28
+ name: string;
29
+ portType: PortType;
30
+ value?: BitValue | BusValue;
31
+ }
32
+ export interface ClockDescriptor {
33
+ name: string;
34
+ description?: string;
35
+ }
36
+ export interface ClockState {
37
+ value: boolean;
38
+ edge: 'rising' | 'falling' | 'none';
39
+ }
40
+ export interface ClockInstance {
41
+ id: string;
42
+ name: string;
43
+ state?: ClockState;
44
+ }
45
+ export interface MemoryType {
46
+ kind: 'memory';
47
+ addressWidth: number;
48
+ dataWidth: number;
49
+ }
50
+ export type StateType = BitType | BusType | MemoryType;
51
+ export interface MemoryValue {
52
+ data: Map<number, number>;
53
+ addressWidth: number;
54
+ dataWidth: number;
55
+ }
56
+ export type StateValue = BitValue | BusValue | MemoryValue | string;
57
+ export interface StateBlock {
58
+ id: string;
59
+ name: string;
60
+ stateType: StateType;
61
+ initialValue: StateValue;
62
+ currentValue?: StateValue;
63
+ clockRef?: string;
64
+ edge?: 'rising' | 'falling';
65
+ }
66
+ export interface PortPath {
67
+ nodeId: string;
68
+ portName: string;
69
+ }
70
+ export interface Connection {
71
+ id: string;
72
+ source: PortPath;
73
+ target: PortPath;
74
+ portType: PortType;
75
+ }
76
+ export type ArgumentValue = number | string | boolean | number[] | Record<number, number>;
77
+ export interface Node {
78
+ id: string;
79
+ label?: string;
80
+ componentRef: string;
81
+ arguments: Record<string, ArgumentValue>;
82
+ inputs: PortInstance[];
83
+ outputs: PortInstance[];
84
+ clocks: ClockInstance[];
85
+ }
86
+ export interface PrimitiveImpl {
87
+ kind: 'primitive';
88
+ }
89
+ export interface CompositeImpl {
90
+ kind: 'composite';
91
+ }
92
+ export interface IntrinsicImpl {
93
+ kind: 'intrinsic';
94
+ intrinsicType: string;
95
+ }
96
+ export type Implementation = PrimitiveImpl | CompositeImpl | IntrinsicImpl;
97
+ export type ParameterType = 'int' | 'string' | 'bool';
98
+ export interface Parameter {
99
+ name: string;
100
+ paramType: ParameterType;
101
+ defaultValue?: number | string | boolean;
102
+ options?: (number | string | boolean)[];
103
+ }
104
+ export interface TestCase {
105
+ name: string;
106
+ inputs: Record<string, BitValue | BusValue>;
107
+ expectedOutputs: Record<string, BitValue | BusValue>;
108
+ }
109
+ /**
110
+ * Component Kind - determines evaluation order and cycle detection
111
+ *
112
+ * - combinational: Pure logic, no state, must be acyclic
113
+ * - sequential: Has state (registers, RAM), updates on clock edges
114
+ * - sink: Consumes signals but outputs don't feed back (Screen, audio, UART)
115
+ */
116
+ export type ComponentKind = 'combinational' | 'sequential' | 'sink';
117
+ export interface CircuitMetadata {
118
+ source?: {
119
+ filename?: string;
120
+ lineNumber?: number;
121
+ };
122
+ description?: string;
123
+ author?: string;
124
+ version?: string;
125
+ testCases?: TestCase[];
126
+ tags?: string[];
127
+ /** Timing classification: combinational, sequential, or sink. */
128
+ timing?: ComponentKind;
129
+ /**
130
+ * For sequential components: how outputs are computed
131
+ * - 'state-only': Outputs come purely from state (DFlipFlop, Register)
132
+ * - 'state+inputs': Outputs depend on state AND combinational inputs (RAM/ROM - address-based read)
133
+ * - 'input-dependent': Outputs depend only on current inputs (pure combinational)
134
+ *
135
+ * Used for topological sorting. Evaluation order:
136
+ * 1. state-only nodes (registers output .q)
137
+ * 2. combinational logic (address calc, muxes, ALU)
138
+ * 3. state+inputs nodes (RAM/ROM read using computed address)
139
+ * 4. sinks
140
+ */
141
+ outputDependency?: 'state-only' | 'state+inputs' | 'input-dependent';
142
+ }
143
+ export interface Circuit {
144
+ /** Schema version for the Circuit IR. */
145
+ version: 1;
146
+ name: string;
147
+ inputs: PortDescriptor[];
148
+ outputs: PortDescriptor[];
149
+ clocks: ClockDescriptor[];
150
+ state: StateBlock[];
151
+ nodes: Node[];
152
+ connections: Connection[];
153
+ implementation: Implementation;
154
+ metadata?: CircuitMetadata;
155
+ }
156
+ export interface CircuitFile {
157
+ version: string;
158
+ circuit: Circuit;
159
+ }
160
+ export type ValidationErrorType = 'type_mismatch' | 'multiple_drivers' | 'combinational_loop' | 'undefined_component' | 'undefined_port' | 'invalid_clock_ref' | 'parameter_mismatch' | 'missing_required_connection';
161
+ export interface ValidationError {
162
+ type: ValidationErrorType;
163
+ location: {
164
+ circuitId: string;
165
+ nodeId?: string;
166
+ connectionId?: string;
167
+ portPath?: PortPath;
168
+ };
169
+ message: string;
170
+ suggestions?: string[];
171
+ }
172
+ export interface SimulationState {
173
+ portValues: Map<string, BitValue | BusValue>;
174
+ stateValues: Map<string, StateValue>;
175
+ clockStates: Map<string, ClockState>;
176
+ cycle: number;
177
+ evaluationOrder: string[];
178
+ }
179
+ /**
180
+ * Create a port path from components
181
+ */
182
+ export declare function createPortPath(nodeId: string, portName: string): PortPath;
183
+ /**
184
+ * Create a port path key for Map lookups
185
+ */
186
+ export declare function portPathKey(path: PortPath): string;
187
+ /**
188
+ * Check if two port types are compatible
189
+ */
190
+ export declare function isPortTypeCompatible(a: PortType, b: PortType): boolean;
191
+ /**
192
+ * Get default value for a port type
193
+ */
194
+ export declare function getDefaultValue(portType: PortType): BitValue | BusValue;
195
+ /**
196
+ * Create a bit type
197
+ */
198
+ export declare function bitType(): BitType;
199
+ /**
200
+ * Create a bus type
201
+ */
202
+ export declare function busType(width: number): BusType;
203
+ /**
204
+ * Create a memory type
205
+ */
206
+ export declare function memoryType(addressWidth: number, dataWidth: number): MemoryType;
207
+ //# sourceMappingURL=circuit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circuit.d.ts","sourceRoot":"","sources":["../../../src/editor/types/circuit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,KAAK,CAAC;CACb;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,KAAK,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AAMzC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,C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AQ,CAMvE;AAED;;GAEG;AACH,wBAAgB,OAAO,IAAI,OAAO,CAEjC;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAE9E"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Intermediate Representation (IR) v0.1 - TypeScript Type Definitions
3
+ *
4
+ * This is the formal IR specification in TypeScript.
5
+ * See /docs/circuit-spec.md for detailed documentation.
6
+ */
7
+ // ============================================================================
8
+ // Helper Functions
9
+ // ============================================================================
10
+ /**
11
+ * Create a port path from components
12
+ */
13
+ export function createPortPath(nodeId, portName) {
14
+ return { nodeId, portName };
15
+ }
16
+ /**
17
+ * Create a port path key for Map lookups
18
+ */
19
+ export function portPathKey(path) {
20
+ return path.nodeId === '' ? `circuit.${path.portName}` : `${path.nodeId}.${path.portName}`;
21
+ }
22
+ /**
23
+ * Check if two port types are compatible
24
+ */
25
+ export function isPortTypeCompatible(a, b) {
26
+ if (a.kind !== b.kind)
27
+ return false;
28
+ if (a.kind === 'bus' && b.kind === 'bus') {
29
+ return a.width === b.width;
30
+ }
31
+ return true;
32
+ }
33
+ /**
34
+ * Get default value for a port type
35
+ */
36
+ export function getDefaultValue(portType) {
37
+ if (portType.kind === 'bit') {
38
+ return false;
39
+ }
40
+ else {
41
+ return 0;
42
+ }
43
+ }
44
+ /**
45
+ * Create a bit type
46
+ */
47
+ export function bitType() {
48
+ return { kind: 'bit' };
49
+ }
50
+ /**
51
+ * Create a bus type
52
+ */
53
+ export function busType(width) {
54
+ return { kind: 'bus', width };
55
+ }
56
+ /**
57
+ * Create a memory type
58
+ */
59
+ export function memoryType(addressWidth, dataWidth) {
60
+ return { kind: 'memory', addressWidth, dataWidth };
61
+ }
62
+ //# sourceMappingURL=circuit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,YAAoB,EAAE,SAAiB;IAChE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AACrD,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type Exports
3
+ *
4
+ * Central export point for all type definitions.
5
+ */
6
+ export type { BitType, BusType, PortType, PortDescriptor, BitValue, BusValue, ClockDescriptor, ClockState, ClockInstance, StateBlock, StateValue, PortPath, Node, Parameter, Implementation, CircuitMetadata, Circuit, ValidationError, } from './circuit';
7
+ export { createPortPath, portPathKey, isPortTypeCompatible, getDefaultValue, bitType, busType, memoryType, } from './circuit';
8
+ export * from './ui-model';
9
+ export * from './visual';
10
+ export * from './ui';
11
+ export * from './testing';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAC1C,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,UAAU,EAAE,aAAa,EAC1C,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EACzC,eAAe,EAAE,OAAO,EACxB,eAAe,GAChB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,cAAc,EAAE,WAAW,EAC3B,oBAAoB,EAAE,eAAe,EACrC,OAAO,EAAE,OAAO,EAAE,UAAU,GAC7B,MAAM,WAAW,CAAC;AACnB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Type Exports
3
+ *
4
+ * Central export point for all type definitions.
5
+ */
6
+ export { createPortPath, portPathKey, isPortTypeCompatible, getDefaultValue, bitType, busType, memoryType, } from './circuit';
7
+ export * from './ui-model';
8
+ export * from './visual';
9
+ export * from './ui';
10
+ export * from './testing';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/editor/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EACL,cAAc,EAAE,WAAW,EAC3B,oBAAoB,EAAE,eAAe,EACrC,OAAO,EAAE,OAAO,EAAE,UAAU,GAC7B,MAAM,WAAW,CAAC;AACnB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Testbench Intermediate Representation (IR)
3
+ *
4
+ * This is the compiled, executable representation of testbenches.
5
+ * The testbench IR is generated from testbench AST by the testbench compiler.
6
+ *
7
+ * Design:
8
+ * - Bit-level stimulus core (cycle-by-cycle value assignments)
9
+ * - VCD waveform capture configuration
10
+ * - Future-proof for multi-clock and assertions
11
+ */
12
+ import { BitValue, BusValue, Circuit } from './circuit';
13
+ /**
14
+ * Compiled testbench ready for execution
15
+ */
16
+ export interface Testbench {
17
+ name: string;
18
+ circuitRef: string;
19
+ dutInstanceId: string;
20
+ circuit: Circuit;
21
+ stimulus: StimulusSchedule;
22
+ capture?: CaptureConfig;
23
+ assertions?: AssertionSchedule;
24
+ maxCycles: number;
25
+ }
26
+ /**
27
+ * Compiled stimulus schedule
28
+ *
29
+ * Maps cycle number -> signal assignments for that cycle
30
+ * Signals hold their previous value unless explicitly changed
31
+ */
32
+ export interface StimulusSchedule {
33
+ clockRef: string;
34
+ events: Map<number, StimulusAction[]>;
35
+ }
36
+ /**
37
+ * Single stimulus action (apply value to signal)
38
+ */
39
+ export interface StimulusAction {
40
+ nodeId: string;
41
+ portName: string;
42
+ value: BitValue | BusValue;
43
+ }
44
+ /**
45
+ * Configuration for waveform capture
46
+ */
47
+ export interface CaptureConfig {
48
+ signals: SignalRef[];
49
+ format: 'vcd';
50
+ filename: string;
51
+ }
52
+ /**
53
+ * Reference to a signal to capture
54
+ */
55
+ export interface SignalRef {
56
+ nodeId: string;
57
+ portName: string;
58
+ displayName: string;
59
+ width: number;
60
+ }
61
+ /**
62
+ * Compiled assertion schedule
63
+ */
64
+ export interface AssertionSchedule {
65
+ clockRef: string;
66
+ assertions: Map<number, CompiledAssertion[]>;
67
+ }
68
+ /**
69
+ * Single assertion to check at a cycle
70
+ */
71
+ export interface CompiledAssertion {
72
+ id: string;
73
+ condition: (state: TestbenchState) => boolean;
74
+ message: string;
75
+ }
76
+ /**
77
+ * Testbench execution state
78
+ */
79
+ export interface TestbenchState {
80
+ cycle: number;
81
+ portValues: Map<string, BitValue | BusValue>;
82
+ assertionResults: AssertionResult[];
83
+ captureData?: CaptureData;
84
+ status: 'running' | 'passed' | 'failed' | 'timeout';
85
+ failureReason?: string;
86
+ }
87
+ /**
88
+ * Result of an assertion check
89
+ */
90
+ export interface AssertionResult {
91
+ assertionId: string;
92
+ cycle: number;
93
+ passed: boolean;
94
+ message: string;
95
+ }
96
+ /**
97
+ * Captured waveform data
98
+ */
99
+ export interface CaptureData {
100
+ config: CaptureConfig;
101
+ traces: Map<string, TraceData>;
102
+ }
103
+ /**
104
+ * Trace data for a single signal
105
+ */
106
+ export interface TraceData {
107
+ signal: SignalRef;
108
+ values: (BitValue | BusValue)[];
109
+ changes: Array<{
110
+ cycle: number;
111
+ value: BitValue | BusValue;
112
+ }>;
113
+ }
114
+ /**
115
+ * Create a stimulus schedule
116
+ */
117
+ export declare function createStimulusSchedule(clockRef: string): StimulusSchedule;
118
+ /**
119
+ * Add stimulus action to schedule
120
+ */
121
+ export declare function addStimulusAction(schedule: StimulusSchedule, cycle: number, action: StimulusAction): void;
122
+ /**
123
+ * Get stimulus actions for a cycle
124
+ */
125
+ export declare function getStimulusActions(schedule: StimulusSchedule, cycle: number): StimulusAction[];
126
+ /**
127
+ * Create signal reference key for maps
128
+ */
129
+ export declare function signalKey(signal: SignalRef): string;
130
+ /**
131
+ * Create a testbench state
132
+ */
133
+ export declare function createTestbenchState(): TestbenchState;
134
+ /**
135
+ * Check if testbench has passed all assertions
136
+ */
137
+ export declare function hasPassed(state: TestbenchState): boolean;
138
+ /**
139
+ * Check if testbench has failed any assertions
140
+ */
141
+ export declare function hasFailed(state: TestbenchState): boolean;
142
+ /**
143
+ * Get all failed assertions
144
+ */
145
+ export declare function getFailedAssertions(state: TestbenchState): AssertionResult[];
146
+ /**
147
+ * Get the maximum cycle number in the stimulus schedule
148
+ */
149
+ export declare function getMaxStimulusCycle(schedule: StimulusSchedule): number;
150
+ //# sourceMappingURL=testbench.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testbench.d.ts","sourceRoot":"","sources":["../../../src/editor/types/testbench.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMxD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC5B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AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAC;IAChC,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAA;KAAE,CAAC,CAAC;CAC/D;AAMD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAKzE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,GACrB,IAAI,CAKN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,MAAM,GACZ,cAAc,EAAE,CAElB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,cAAc,CAOrD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAIxD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAGxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,EAAE,CAE5E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAGtE"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Testbench Intermediate Representation (IR)
3
+ *
4
+ * This is the compiled, executable representation of testbenches.
5
+ * The testbench IR is generated from testbench AST by the testbench compiler.
6
+ *
7
+ * Design:
8
+ * - Bit-level stimulus core (cycle-by-cycle value assignments)
9
+ * - VCD waveform capture configuration
10
+ * - Future-proof for multi-clock and assertions
11
+ */
12
+ // ============================================================================
13
+ // Helper Functions
14
+ // ============================================================================
15
+ /**
16
+ * Create a stimulus schedule
17
+ */
18
+ export function createStimulusSchedule(clockRef) {
19
+ return {
20
+ clockRef,
21
+ events: new Map(),
22
+ };
23
+ }
24
+ /**
25
+ * Add stimulus action to schedule
26
+ */
27
+ export function addStimulusAction(schedule, cycle, action) {
28
+ if (!schedule.events.has(cycle)) {
29
+ schedule.events.set(cycle, []);
30
+ }
31
+ schedule.events.get(cycle).push(action);
32
+ }
33
+ /**
34
+ * Get stimulus actions for a cycle
35
+ */
36
+ export function getStimulusActions(schedule, cycle) {
37
+ return schedule.events.get(cycle) || [];
38
+ }
39
+ /**
40
+ * Create signal reference key for maps
41
+ */
42
+ export function signalKey(signal) {
43
+ return signal.nodeId === '' ? signal.portName : `${signal.nodeId}.${signal.portName}`;
44
+ }
45
+ /**
46
+ * Create a testbench state
47
+ */
48
+ export function createTestbenchState() {
49
+ return {
50
+ cycle: 0,
51
+ portValues: new Map(),
52
+ assertionResults: [],
53
+ status: 'running',
54
+ };
55
+ }
56
+ /**
57
+ * Check if testbench has passed all assertions
58
+ */
59
+ export function hasPassed(state) {
60
+ return state.status === 'passed' ||
61
+ (state.assertionResults.length > 0 &&
62
+ state.assertionResults.every(r => r.passed));
63
+ }
64
+ /**
65
+ * Check if testbench has failed any assertions
66
+ */
67
+ export function hasFailed(state) {
68
+ return state.status === 'failed' ||
69
+ state.assertionResults.some(r => !r.passed);
70
+ }
71
+ /**
72
+ * Get all failed assertions
73
+ */
74
+ export function getFailedAssertions(state) {
75
+ return state.assertionResults.filter(r => !r.passed);
76
+ }
77
+ /**
78
+ * Get the maximum cycle number in the stimulus schedule
79
+ */
80
+ export function getMaxStimulusCycle(schedule) {
81
+ if (schedule.events.size === 0)
82
+ return 0;
83
+ return Math.max(...Array.from(schedule.events.keys()));
84
+ }
85
+ //# sourceMappingURL=testbench.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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KAAK,CAAC,MAAM,KAAK,QAAQ;QAC9B,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC;YACjC,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAC9B,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAqB;IACvD,OAAO,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAA0B;IAC5D,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACzC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Testing system types for the visual circuit editor
3
+ * Enables users to define test cases with expected inputs/outputs
4
+ */
5
+ export type TestStatus = 'pending' | 'running' | 'passed' | 'failed' | 'error';
6
+ /**
7
+ * Represents a single input or output value in a test case
8
+ */
9
+ export interface TestValue {
10
+ /** Component label (e.g., "A", "B", "Sum") */
11
+ label: string;
12
+ /** Expected boolean value */
13
+ value: boolean;
14
+ }
15
+ /**
16
+ * Comparison result for a single output
17
+ */
18
+ export interface OutputComparison {
19
+ label: string;
20
+ expected: boolean;
21
+ actual: boolean;
22
+ passed: boolean;
23
+ }
24
+ /**
25
+ * Test case definition
26
+ */
27
+ export interface TestCase {
28
+ id: string;
29
+ name: string;
30
+ description?: string;
31
+ enabled: boolean;
32
+ inputs: TestValue[];
33
+ outputs: TestValue[];
34
+ createdAt: number;
35
+ updatedAt: number;
36
+ }
37
+ /**
38
+ * Result from executing a test case
39
+ */
40
+ export interface TestResult {
41
+ testCaseId: string;
42
+ status: TestStatus;
43
+ /** Detailed comparison for each output */
44
+ comparisons?: OutputComparison[];
45
+ /** Error message if status is 'error' */
46
+ errorMessage?: string;
47
+ /** Timestamp of test execution */
48
+ executedAt: number;
49
+ /** Execution time in milliseconds */
50
+ duration: number;
51
+ }
52
+ /**
53
+ * State for the test store
54
+ */
55
+ export interface TestState {
56
+ /** All test cases, keyed by ID */
57
+ testCases: Record<string, TestCase>;
58
+ /** Test results, keyed by test case ID */
59
+ results: Record<string, TestResult>;
60
+ /** Whether tests are currently running */
61
+ isRunning: boolean;
62
+ /** ID of currently editing test case (for modal) */
63
+ editingTestId: string | null;
64
+ }
65
+ /**
66
+ * Actions for the test store
67
+ */
68
+ export interface TestActions {
69
+ /** Add a new test case */
70
+ addTestCase: (testCase: Omit<TestCase, 'id' | 'createdAt' | 'updatedAt'>) => string;
71
+ /** Update an existing test case */
72
+ updateTestCase: (id: string, updates: Partial<Omit<TestCase, 'id' | 'createdAt'>>) => void;
73
+ /** Remove a test case */
74
+ removeTestCase: (id: string) => void;
75
+ /** Toggle test case enabled/disabled */
76
+ toggleTestCase: (id: string) => void;
77
+ /** Duplicate a test case */
78
+ duplicateTestCase: (id: string) => string;
79
+ /** Set test result */
80
+ setTestResult: (testCaseId: string, result: TestResult) => void;
81
+ /** Clear all test results */
82
+ clearResults: () => void;
83
+ /** Set running state */
84
+ setIsRunning: (isRunning: boolean) => void;
85
+ /** Set editing test ID */
86
+ setEditingTestId: (id: string | null) => void;
87
+ }
88
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.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AU,CAAC,CAAC;IACpC,0CAA0C;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,oDAAoD;IACpD,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,KAAK,MAAM,CAAC;IACpF,mCAAmC;IACnC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;IAC3F,yBAAyB;IACzB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,wCAAwC;IACxC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,4BAA4B;IAC5B,iBAAiB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,sBAAsB;IACtB,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAChE,6BAA6B;IAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,wBAAwB;IACxB,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,0BAA0B;IAC1B,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/C"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Testing system types for the visual circuit editor
3
+ * Enables users to define test cases with expected inputs/outputs
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=testing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/editor/types/testing.ts"],"names":[],"mappings":"AAAA;;;GAGG"}