circuit-json 0.0.321 → 0.0.323

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1625,7 +1625,6 @@ interface PcbPlatedHoleCircle {
1625
1625
  pcb_port_id?: string
1626
1626
  pcb_plated_hole_id: string
1627
1627
  soldermask_margin?: number
1628
- is_covered_with_solder_mask?: boolean
1629
1628
  }
1630
1629
 
1631
1630
  interface PcbHolePillWithRectPad {
@@ -2713,17 +2712,19 @@ interface SimulationUnknownExperimentError {
2713
2712
 
2714
2713
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_voltage_probe.ts)
2715
2714
 
2716
- Defines a voltage probe for simulation, connected to a port or a net.
2717
-
2718
2715
  ```typescript
2719
- /** Defines a voltage probe for simulation, connected to a port or a net. */
2716
+ /** Defines a voltage probe for simulation. If a reference input is not provided,
2717
+ * it measures against ground. If a reference input is provided, it measures
2718
+ * the differential voltage between two points. */
2720
2719
  interface SimulationVoltageProbe {
2721
2720
  type: "simulation_voltage_probe"
2722
2721
  simulation_voltage_probe_id: string
2723
2722
  source_component_id?: string
2724
2723
  name?: string
2725
- source_port_id?: string
2726
- source_net_id?: string
2724
+ signal_input_source_port_id?: string
2725
+ signal_input_source_net_id?: string
2726
+ reference_input_source_port_id?: string
2727
+ reference_input_source_net_id?: string
2727
2728
  subcircuit_id?: string
2728
2729
  color?: string
2729
2730
  }
package/dist/index.d.mts CHANGED
@@ -1257,7 +1257,6 @@ interface PcbPlatedHoleCircle {
1257
1257
  pcb_port_id?: string;
1258
1258
  pcb_plated_hole_id: string;
1259
1259
  soldermask_margin?: number;
1260
- is_covered_with_solder_mask?: boolean;
1261
1260
  }
1262
1261
  /**
1263
1262
  * Defines an oval or pill-shaped plated hole on the PCB
@@ -1406,7 +1405,6 @@ declare const pcb_plated_hole: z.ZodUnion<[z.ZodObject<{
1406
1405
  pcb_port_id: z.ZodOptional<z.ZodString>;
1407
1406
  pcb_plated_hole_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1408
1407
  soldermask_margin: z.ZodOptional<z.ZodNumber>;
1409
- is_covered_with_solder_mask: z.ZodOptional<z.ZodBoolean>;
1410
1408
  }, "strip", z.ZodTypeAny, {
1411
1409
  x: number;
1412
1410
  y: number;
@@ -1419,7 +1417,6 @@ declare const pcb_plated_hole: z.ZodUnion<[z.ZodObject<{
1419
1417
  pcb_component_id?: string | undefined;
1420
1418
  subcircuit_id?: string | undefined;
1421
1419
  pcb_group_id?: string | undefined;
1422
- is_covered_with_solder_mask?: boolean | undefined;
1423
1420
  soldermask_margin?: number | undefined;
1424
1421
  port_hints?: string[] | undefined;
1425
1422
  pcb_port_id?: string | undefined;
@@ -1436,7 +1433,6 @@ declare const pcb_plated_hole: z.ZodUnion<[z.ZodObject<{
1436
1433
  pcb_component_id?: string | undefined;
1437
1434
  subcircuit_id?: string | undefined;
1438
1435
  pcb_group_id?: string | undefined;
1439
- is_covered_with_solder_mask?: boolean | undefined;
1440
1436
  soldermask_margin?: number | undefined;
1441
1437
  port_hints?: string[] | undefined;
1442
1438
  pcb_port_id?: string | undefined;
@@ -9713,8 +9709,10 @@ declare const simulation_voltage_probe: z.ZodEffects<z.ZodObject<{
9713
9709
  simulation_voltage_probe_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
9714
9710
  source_component_id: z.ZodOptional<z.ZodString>;
9715
9711
  name: z.ZodOptional<z.ZodString>;
9716
- source_port_id: z.ZodOptional<z.ZodString>;
9717
- source_net_id: z.ZodOptional<z.ZodString>;
9712
+ signal_input_source_port_id: z.ZodOptional<z.ZodString>;
9713
+ signal_input_source_net_id: z.ZodOptional<z.ZodString>;
9714
+ reference_input_source_port_id: z.ZodOptional<z.ZodString>;
9715
+ reference_input_source_net_id: z.ZodOptional<z.ZodString>;
9718
9716
  subcircuit_id: z.ZodOptional<z.ZodString>;
9719
9717
  color: z.ZodOptional<z.ZodString>;
9720
9718
  }, "strip", z.ZodTypeAny, {
@@ -9723,48 +9721,60 @@ declare const simulation_voltage_probe: z.ZodEffects<z.ZodObject<{
9723
9721
  name?: string | undefined;
9724
9722
  source_component_id?: string | undefined;
9725
9723
  subcircuit_id?: string | undefined;
9726
- source_port_id?: string | undefined;
9727
- source_net_id?: string | undefined;
9728
9724
  color?: string | undefined;
9725
+ signal_input_source_port_id?: string | undefined;
9726
+ signal_input_source_net_id?: string | undefined;
9727
+ reference_input_source_port_id?: string | undefined;
9728
+ reference_input_source_net_id?: string | undefined;
9729
9729
  }, {
9730
9730
  type: "simulation_voltage_probe";
9731
9731
  name?: string | undefined;
9732
9732
  source_component_id?: string | undefined;
9733
9733
  subcircuit_id?: string | undefined;
9734
- source_port_id?: string | undefined;
9735
- source_net_id?: string | undefined;
9736
9734
  color?: string | undefined;
9737
9735
  simulation_voltage_probe_id?: string | undefined;
9736
+ signal_input_source_port_id?: string | undefined;
9737
+ signal_input_source_net_id?: string | undefined;
9738
+ reference_input_source_port_id?: string | undefined;
9739
+ reference_input_source_net_id?: string | undefined;
9738
9740
  }>, {
9739
9741
  type: "simulation_voltage_probe";
9740
9742
  simulation_voltage_probe_id: string;
9741
9743
  name?: string | undefined;
9742
9744
  source_component_id?: string | undefined;
9743
9745
  subcircuit_id?: string | undefined;
9744
- source_port_id?: string | undefined;
9745
- source_net_id?: string | undefined;
9746
9746
  color?: string | undefined;
9747
+ signal_input_source_port_id?: string | undefined;
9748
+ signal_input_source_net_id?: string | undefined;
9749
+ reference_input_source_port_id?: string | undefined;
9750
+ reference_input_source_net_id?: string | undefined;
9747
9751
  }, {
9748
9752
  type: "simulation_voltage_probe";
9749
9753
  name?: string | undefined;
9750
9754
  source_component_id?: string | undefined;
9751
9755
  subcircuit_id?: string | undefined;
9752
- source_port_id?: string | undefined;
9753
- source_net_id?: string | undefined;
9754
9756
  color?: string | undefined;
9755
9757
  simulation_voltage_probe_id?: string | undefined;
9758
+ signal_input_source_port_id?: string | undefined;
9759
+ signal_input_source_net_id?: string | undefined;
9760
+ reference_input_source_port_id?: string | undefined;
9761
+ reference_input_source_net_id?: string | undefined;
9756
9762
  }>;
9757
9763
  type SimulationVoltageProbeInput = z.input<typeof simulation_voltage_probe>;
9758
9764
  /**
9759
- * Defines a voltage probe for simulation, connected to a port or a net.
9765
+ * Defines a voltage probe for simulation. If a reference input is not provided,
9766
+ * it measures against ground. If a reference input is provided, it measures
9767
+ * the differential voltage between two points.
9760
9768
  */
9761
9769
  interface SimulationVoltageProbe {
9762
9770
  type: "simulation_voltage_probe";
9763
9771
  simulation_voltage_probe_id: string;
9764
9772
  source_component_id?: string;
9765
9773
  name?: string;
9766
- source_port_id?: string;
9767
- source_net_id?: string;
9774
+ signal_input_source_port_id?: string;
9775
+ signal_input_source_net_id?: string;
9776
+ reference_input_source_port_id?: string;
9777
+ reference_input_source_net_id?: string;
9768
9778
  subcircuit_id?: string;
9769
9779
  color?: string;
9770
9780
  }
@@ -15229,7 +15239,6 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
15229
15239
  pcb_port_id: z.ZodOptional<z.ZodString>;
15230
15240
  pcb_plated_hole_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
15231
15241
  soldermask_margin: z.ZodOptional<z.ZodNumber>;
15232
- is_covered_with_solder_mask: z.ZodOptional<z.ZodBoolean>;
15233
15242
  }, "strip", z.ZodTypeAny, {
15234
15243
  x: number;
15235
15244
  y: number;
@@ -15242,7 +15251,6 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
15242
15251
  pcb_component_id?: string | undefined;
15243
15252
  subcircuit_id?: string | undefined;
15244
15253
  pcb_group_id?: string | undefined;
15245
- is_covered_with_solder_mask?: boolean | undefined;
15246
15254
  soldermask_margin?: number | undefined;
15247
15255
  port_hints?: string[] | undefined;
15248
15256
  pcb_port_id?: string | undefined;
@@ -15259,7 +15267,6 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
15259
15267
  pcb_component_id?: string | undefined;
15260
15268
  subcircuit_id?: string | undefined;
15261
15269
  pcb_group_id?: string | undefined;
15262
- is_covered_with_solder_mask?: boolean | undefined;
15263
15270
  soldermask_margin?: number | undefined;
15264
15271
  port_hints?: string[] | undefined;
15265
15272
  pcb_port_id?: string | undefined;
@@ -20621,8 +20628,10 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
20621
20628
  simulation_voltage_probe_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
20622
20629
  source_component_id: z.ZodOptional<z.ZodString>;
20623
20630
  name: z.ZodOptional<z.ZodString>;
20624
- source_port_id: z.ZodOptional<z.ZodString>;
20625
- source_net_id: z.ZodOptional<z.ZodString>;
20631
+ signal_input_source_port_id: z.ZodOptional<z.ZodString>;
20632
+ signal_input_source_net_id: z.ZodOptional<z.ZodString>;
20633
+ reference_input_source_port_id: z.ZodOptional<z.ZodString>;
20634
+ reference_input_source_net_id: z.ZodOptional<z.ZodString>;
20626
20635
  subcircuit_id: z.ZodOptional<z.ZodString>;
20627
20636
  color: z.ZodOptional<z.ZodString>;
20628
20637
  }, "strip", z.ZodTypeAny, {
@@ -20631,36 +20640,44 @@ declare const any_circuit_element: z.ZodUnion<[z.ZodObject<{
20631
20640
  name?: string | undefined;
20632
20641
  source_component_id?: string | undefined;
20633
20642
  subcircuit_id?: string | undefined;
20634
- source_port_id?: string | undefined;
20635
- source_net_id?: string | undefined;
20636
20643
  color?: string | undefined;
20644
+ signal_input_source_port_id?: string | undefined;
20645
+ signal_input_source_net_id?: string | undefined;
20646
+ reference_input_source_port_id?: string | undefined;
20647
+ reference_input_source_net_id?: string | undefined;
20637
20648
  }, {
20638
20649
  type: "simulation_voltage_probe";
20639
20650
  name?: string | undefined;
20640
20651
  source_component_id?: string | undefined;
20641
20652
  subcircuit_id?: string | undefined;
20642
- source_port_id?: string | undefined;
20643
- source_net_id?: string | undefined;
20644
20653
  color?: string | undefined;
20645
20654
  simulation_voltage_probe_id?: string | undefined;
20655
+ signal_input_source_port_id?: string | undefined;
20656
+ signal_input_source_net_id?: string | undefined;
20657
+ reference_input_source_port_id?: string | undefined;
20658
+ reference_input_source_net_id?: string | undefined;
20646
20659
  }>, {
20647
20660
  type: "simulation_voltage_probe";
20648
20661
  simulation_voltage_probe_id: string;
20649
20662
  name?: string | undefined;
20650
20663
  source_component_id?: string | undefined;
20651
20664
  subcircuit_id?: string | undefined;
20652
- source_port_id?: string | undefined;
20653
- source_net_id?: string | undefined;
20654
20665
  color?: string | undefined;
20666
+ signal_input_source_port_id?: string | undefined;
20667
+ signal_input_source_net_id?: string | undefined;
20668
+ reference_input_source_port_id?: string | undefined;
20669
+ reference_input_source_net_id?: string | undefined;
20655
20670
  }, {
20656
20671
  type: "simulation_voltage_probe";
20657
20672
  name?: string | undefined;
20658
20673
  source_component_id?: string | undefined;
20659
20674
  subcircuit_id?: string | undefined;
20660
- source_port_id?: string | undefined;
20661
- source_net_id?: string | undefined;
20662
20675
  color?: string | undefined;
20663
20676
  simulation_voltage_probe_id?: string | undefined;
20677
+ signal_input_source_port_id?: string | undefined;
20678
+ signal_input_source_net_id?: string | undefined;
20679
+ reference_input_source_port_id?: string | undefined;
20680
+ reference_input_source_net_id?: string | undefined;
20664
20681
  }>, z.ZodObject<{
20665
20682
  type: z.ZodLiteral<"simulation_unknown_experiment_error">;
20666
20683
  simulation_unknown_experiment_error_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
@@ -23166,7 +23183,6 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
23166
23183
  pcb_port_id: z.ZodOptional<z.ZodString>;
23167
23184
  pcb_plated_hole_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
23168
23185
  soldermask_margin: z.ZodOptional<z.ZodNumber>;
23169
- is_covered_with_solder_mask: z.ZodOptional<z.ZodBoolean>;
23170
23186
  }, "strip", z.ZodTypeAny, {
23171
23187
  x: number;
23172
23188
  y: number;
@@ -23179,7 +23195,6 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
23179
23195
  pcb_component_id?: string | undefined;
23180
23196
  subcircuit_id?: string | undefined;
23181
23197
  pcb_group_id?: string | undefined;
23182
- is_covered_with_solder_mask?: boolean | undefined;
23183
23198
  soldermask_margin?: number | undefined;
23184
23199
  port_hints?: string[] | undefined;
23185
23200
  pcb_port_id?: string | undefined;
@@ -23196,7 +23211,6 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
23196
23211
  pcb_component_id?: string | undefined;
23197
23212
  subcircuit_id?: string | undefined;
23198
23213
  pcb_group_id?: string | undefined;
23199
- is_covered_with_solder_mask?: boolean | undefined;
23200
23214
  soldermask_margin?: number | undefined;
23201
23215
  port_hints?: string[] | undefined;
23202
23216
  pcb_port_id?: string | undefined;
@@ -28558,8 +28572,10 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
28558
28572
  simulation_voltage_probe_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
28559
28573
  source_component_id: z.ZodOptional<z.ZodString>;
28560
28574
  name: z.ZodOptional<z.ZodString>;
28561
- source_port_id: z.ZodOptional<z.ZodString>;
28562
- source_net_id: z.ZodOptional<z.ZodString>;
28575
+ signal_input_source_port_id: z.ZodOptional<z.ZodString>;
28576
+ signal_input_source_net_id: z.ZodOptional<z.ZodString>;
28577
+ reference_input_source_port_id: z.ZodOptional<z.ZodString>;
28578
+ reference_input_source_net_id: z.ZodOptional<z.ZodString>;
28563
28579
  subcircuit_id: z.ZodOptional<z.ZodString>;
28564
28580
  color: z.ZodOptional<z.ZodString>;
28565
28581
  }, "strip", z.ZodTypeAny, {
@@ -28568,36 +28584,44 @@ declare const any_soup_element: z.ZodUnion<[z.ZodObject<{
28568
28584
  name?: string | undefined;
28569
28585
  source_component_id?: string | undefined;
28570
28586
  subcircuit_id?: string | undefined;
28571
- source_port_id?: string | undefined;
28572
- source_net_id?: string | undefined;
28573
28587
  color?: string | undefined;
28588
+ signal_input_source_port_id?: string | undefined;
28589
+ signal_input_source_net_id?: string | undefined;
28590
+ reference_input_source_port_id?: string | undefined;
28591
+ reference_input_source_net_id?: string | undefined;
28574
28592
  }, {
28575
28593
  type: "simulation_voltage_probe";
28576
28594
  name?: string | undefined;
28577
28595
  source_component_id?: string | undefined;
28578
28596
  subcircuit_id?: string | undefined;
28579
- source_port_id?: string | undefined;
28580
- source_net_id?: string | undefined;
28581
28597
  color?: string | undefined;
28582
28598
  simulation_voltage_probe_id?: string | undefined;
28599
+ signal_input_source_port_id?: string | undefined;
28600
+ signal_input_source_net_id?: string | undefined;
28601
+ reference_input_source_port_id?: string | undefined;
28602
+ reference_input_source_net_id?: string | undefined;
28583
28603
  }>, {
28584
28604
  type: "simulation_voltage_probe";
28585
28605
  simulation_voltage_probe_id: string;
28586
28606
  name?: string | undefined;
28587
28607
  source_component_id?: string | undefined;
28588
28608
  subcircuit_id?: string | undefined;
28589
- source_port_id?: string | undefined;
28590
- source_net_id?: string | undefined;
28591
28609
  color?: string | undefined;
28610
+ signal_input_source_port_id?: string | undefined;
28611
+ signal_input_source_net_id?: string | undefined;
28612
+ reference_input_source_port_id?: string | undefined;
28613
+ reference_input_source_net_id?: string | undefined;
28592
28614
  }, {
28593
28615
  type: "simulation_voltage_probe";
28594
28616
  name?: string | undefined;
28595
28617
  source_component_id?: string | undefined;
28596
28618
  subcircuit_id?: string | undefined;
28597
- source_port_id?: string | undefined;
28598
- source_net_id?: string | undefined;
28599
28619
  color?: string | undefined;
28600
28620
  simulation_voltage_probe_id?: string | undefined;
28621
+ signal_input_source_port_id?: string | undefined;
28622
+ signal_input_source_net_id?: string | undefined;
28623
+ reference_input_source_port_id?: string | undefined;
28624
+ reference_input_source_net_id?: string | undefined;
28601
28625
  }>, z.ZodObject<{
28602
28626
  type: z.ZodLiteral<"simulation_unknown_experiment_error">;
28603
28627
  simulation_unknown_experiment_error_id: z.ZodDefault<z.ZodOptional<z.ZodString>>;
package/dist/index.mjs CHANGED
@@ -1431,8 +1431,7 @@ var pcb_plated_hole_circle = z73.object({
1431
1431
  pcb_component_id: z73.string().optional(),
1432
1432
  pcb_port_id: z73.string().optional(),
1433
1433
  pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole"),
1434
- soldermask_margin: z73.number().optional(),
1435
- is_covered_with_solder_mask: z73.boolean().optional()
1434
+ soldermask_margin: z73.number().optional()
1436
1435
  });
1437
1436
  var pcb_plated_hole_oval = z73.object({
1438
1437
  type: z73.literal("pcb_plated_hole"),
@@ -2891,18 +2890,48 @@ var simulation_voltage_probe = z130.object({
2891
2890
  ),
2892
2891
  source_component_id: z130.string().optional(),
2893
2892
  name: z130.string().optional(),
2894
- source_port_id: z130.string().optional(),
2895
- source_net_id: z130.string().optional(),
2893
+ signal_input_source_port_id: z130.string().optional(),
2894
+ signal_input_source_net_id: z130.string().optional(),
2895
+ reference_input_source_port_id: z130.string().optional(),
2896
+ reference_input_source_net_id: z130.string().optional(),
2896
2897
  subcircuit_id: z130.string().optional(),
2897
2898
  color: z130.string().optional()
2898
2899
  }).describe(
2899
- "Defines a voltage probe for simulation, connected to a port or a net"
2900
- ).refine(
2901
- (data) => Boolean(data.source_port_id) !== Boolean(data.source_net_id),
2902
- {
2903
- message: "Exactly one of source_port_id or source_net_id must be provided to simulation_voltage_probe"
2900
+ "Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points."
2901
+ ).superRefine((data, ctx) => {
2902
+ const is_differential = data.reference_input_source_port_id || data.reference_input_source_net_id;
2903
+ if (is_differential) {
2904
+ const has_ports = !!data.signal_input_source_port_id || !!data.reference_input_source_port_id;
2905
+ const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
2906
+ if (has_ports && has_nets) {
2907
+ ctx.addIssue({
2908
+ code: z130.ZodIssueCode.custom,
2909
+ message: "Cannot mix port and net connections in a differential probe."
2910
+ });
2911
+ } else if (has_ports) {
2912
+ if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
2913
+ ctx.addIssue({
2914
+ code: z130.ZodIssueCode.custom,
2915
+ message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
2916
+ });
2917
+ }
2918
+ } else if (has_nets) {
2919
+ if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
2920
+ ctx.addIssue({
2921
+ code: z130.ZodIssueCode.custom,
2922
+ message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
2923
+ });
2924
+ }
2925
+ }
2926
+ } else {
2927
+ if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
2928
+ ctx.addIssue({
2929
+ code: z130.ZodIssueCode.custom,
2930
+ message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
2931
+ });
2932
+ }
2904
2933
  }
2905
- );
2934
+ });
2906
2935
  expectTypesMatch(true);
2907
2936
 
2908
2937
  // src/simulation/simulation_unknown_experiment_error.ts