circuit-json 0.0.538 → 0.0.540

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/dist/index.mjs CHANGED
@@ -3553,7 +3553,7 @@ var pcb_silkscreen_text = z153.object({
3553
3553
  subcircuit_id: z153.string().optional(),
3554
3554
  font: z153.literal("tscircuit2024").default("tscircuit2024"),
3555
3555
  font_size: distance.default("0.2mm"),
3556
- pcb_component_id: z153.string(),
3556
+ pcb_component_id: z153.string().optional().describe("Owning component, omitted for board- or group-level text"),
3557
3557
  text: z153.string(),
3558
3558
  is_knockout: z153.boolean().default(false).optional(),
3559
3559
  knockout_padding: z153.object({
@@ -4786,10 +4786,68 @@ expectTypesMatch(
4786
4786
  true
4787
4787
  );
4788
4788
 
4789
- // src/simulation/simulation_voltage_source.ts
4789
+ // src/cad/cad_explosion_stage.ts
4790
4790
  import { z as z206 } from "zod";
4791
- var wave_shape = z206.enum(["sinewave", "square", "triangle", "sawtooth"]);
4792
- var percentage = z206.union([z206.string(), z206.number()]).transform((val) => {
4791
+ var cad_explosion_stage = z206.object({
4792
+ type: z206.literal("cad_explosion_stage"),
4793
+ cad_explosion_stage_id: z206.string().min(1),
4794
+ name: z206.string().min(1).describe("Qualified authored stage name, for display."),
4795
+ order: z206.number().int().nonnegative().describe(
4796
+ "Unique zero-based playback order after resolving authored stage dependencies. Array order is irrelevant."
4797
+ ),
4798
+ cad_reference_surface_ids: z206.array(z206.string().min(1)).optional().describe(
4799
+ "Reference geometry belonging to this stage, including model-less assembly owners."
4800
+ ),
4801
+ cad_component_ids: z206.array(z206.string().min(1)).describe(
4802
+ "Explicit membership of this stage's moving assembly. May include an entire subassembly. A move targeting this stage translates every member once, preserving prior relative displacements; it does not execute the stage's moves."
4803
+ )
4804
+ }).describe(
4805
+ "One ordered step of an assembly explosion, with explicit movable membership. Geometry remains in its assembled pose; movement records describe a separate display view."
4806
+ );
4807
+ expectTypesMatch(true);
4808
+
4809
+ // src/cad/cad_explosion_move.ts
4810
+ import { z as z207 } from "zod";
4811
+ var cad_explosion_move = z207.object({
4812
+ type: z207.literal("cad_explosion_move"),
4813
+ cad_explosion_move_id: z207.string().min(1),
4814
+ cad_explosion_stage_id: z207.string().min(1).describe("Stage executing this move."),
4815
+ order: z207.number().int().nonnegative().describe(
4816
+ "Unique zero-based sequential move order within the executing stage."
4817
+ ),
4818
+ targets: z207.array(
4819
+ z207.discriminatedUnion("type", [
4820
+ z207.object({
4821
+ type: z207.literal("cad_reference_surface"),
4822
+ cad_reference_surface_id: z207.string().min(1)
4823
+ }),
4824
+ z207.object({
4825
+ type: z207.literal("cad_component"),
4826
+ cad_component_id: z207.string().min(1)
4827
+ }),
4828
+ z207.object({
4829
+ type: z207.literal("cad_explosion_stage"),
4830
+ cad_explosion_stage_id: z207.string().min(1)
4831
+ })
4832
+ ])
4833
+ ).min(1).describe(
4834
+ "Components or entire stages to translate simultaneously. Stage targets expand their explicit cad_component_ids. Deduplicate the union per move; separate moves accumulate."
4835
+ ),
4836
+ translation: point3.refine(
4837
+ (p) => [p.x, p.y, p.z].every(Number.isFinite),
4838
+ "Explosion translations must be finite"
4839
+ ).describe(
4840
+ "Resolved displacement in right-handed circuit-world XYZ, millimeters (+Z above). A vector, not an absolute destination. Producers rotate owner-local offsets into world space once. Partial progress scales this vector."
4841
+ )
4842
+ }).describe(
4843
+ "An ordered straight translation. Stage membership, target IDs and order must be validated against the whole document. Stage progress divides equally among sequential moves. No rotation, PCB movement or collision-clearance claim is implied."
4844
+ );
4845
+ expectTypesMatch(true);
4846
+
4847
+ // src/simulation/simulation_voltage_source.ts
4848
+ import { z as z208 } from "zod";
4849
+ var wave_shape = z208.enum(["sinewave", "square", "triangle", "sawtooth"]);
4850
+ var percentage = z208.union([z208.string(), z208.number()]).transform((val) => {
4793
4851
  if (typeof val === "string") {
4794
4852
  if (val.endsWith("%")) {
4795
4853
  return parseFloat(val.slice(0, -1)) / 100;
@@ -4798,32 +4856,32 @@ var percentage = z206.union([z206.string(), z206.number()]).transform((val) => {
4798
4856
  }
4799
4857
  return val;
4800
4858
  }).pipe(
4801
- z206.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
4859
+ z208.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
4802
4860
  );
4803
- var simulation_dc_voltage_source = z206.object({
4804
- type: z206.literal("simulation_voltage_source"),
4861
+ var simulation_dc_voltage_source = z208.object({
4862
+ type: z208.literal("simulation_voltage_source"),
4805
4863
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
4806
4864
  "simulation_voltage_source"
4807
4865
  ),
4808
- is_dc_source: z206.literal(true).optional().default(true),
4809
- positive_source_port_id: z206.string().optional(),
4810
- negative_source_port_id: z206.string().optional(),
4811
- positive_source_net_id: z206.string().optional(),
4812
- negative_source_net_id: z206.string().optional(),
4866
+ is_dc_source: z208.literal(true).optional().default(true),
4867
+ positive_source_port_id: z208.string().optional(),
4868
+ negative_source_port_id: z208.string().optional(),
4869
+ positive_source_net_id: z208.string().optional(),
4870
+ negative_source_net_id: z208.string().optional(),
4813
4871
  voltage,
4814
4872
  ac_magnitude: voltage.optional(),
4815
4873
  ac_phase: rotation.optional()
4816
4874
  }).describe("Defines a DC voltage source for simulation");
4817
- var simulation_ac_voltage_source = z206.object({
4818
- type: z206.literal("simulation_voltage_source"),
4875
+ var simulation_ac_voltage_source = z208.object({
4876
+ type: z208.literal("simulation_voltage_source"),
4819
4877
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
4820
4878
  "simulation_voltage_source"
4821
4879
  ),
4822
- is_dc_source: z206.literal(false),
4823
- terminal1_source_port_id: z206.string().optional(),
4824
- terminal2_source_port_id: z206.string().optional(),
4825
- terminal1_source_net_id: z206.string().optional(),
4826
- terminal2_source_net_id: z206.string().optional(),
4880
+ is_dc_source: z208.literal(false),
4881
+ terminal1_source_port_id: z208.string().optional(),
4882
+ terminal2_source_port_id: z208.string().optional(),
4883
+ terminal1_source_net_id: z208.string().optional(),
4884
+ terminal2_source_net_id: z208.string().optional(),
4827
4885
  voltage: voltage.optional(),
4828
4886
  frequency: frequency.optional(),
4829
4887
  peak_to_peak_voltage: voltage.optional(),
@@ -4838,14 +4896,14 @@ var simulation_ac_voltage_source = z206.object({
4838
4896
  ac_magnitude: voltage.optional(),
4839
4897
  ac_phase: rotation.optional()
4840
4898
  }).describe("Defines an AC voltage source for simulation");
4841
- var simulation_voltage_source = z206.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
4899
+ var simulation_voltage_source = z208.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
4842
4900
  expectTypesMatch(true);
4843
4901
  expectTypesMatch(true);
4844
4902
  expectTypesMatch(true);
4845
4903
 
4846
4904
  // src/simulation/simulation_current_source.ts
4847
- import { z as z207 } from "zod";
4848
- var percentage2 = z207.union([z207.string(), z207.number()]).transform((val) => {
4905
+ import { z as z209 } from "zod";
4906
+ var percentage2 = z209.union([z209.string(), z209.number()]).transform((val) => {
4849
4907
  if (typeof val === "string") {
4850
4908
  if (val.endsWith("%")) {
4851
4909
  return parseFloat(val.slice(0, -1)) / 100;
@@ -4854,32 +4912,32 @@ var percentage2 = z207.union([z207.string(), z207.number()]).transform((val) =>
4854
4912
  }
4855
4913
  return val;
4856
4914
  }).pipe(
4857
- z207.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
4915
+ z209.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
4858
4916
  );
4859
- var simulation_dc_current_source = z207.object({
4860
- type: z207.literal("simulation_current_source"),
4917
+ var simulation_dc_current_source = z209.object({
4918
+ type: z209.literal("simulation_current_source"),
4861
4919
  simulation_current_source_id: getZodPrefixedIdWithDefault(
4862
4920
  "simulation_current_source"
4863
4921
  ),
4864
- is_dc_source: z207.literal(true).optional().default(true),
4865
- positive_source_port_id: z207.string().optional(),
4866
- negative_source_port_id: z207.string().optional(),
4867
- positive_source_net_id: z207.string().optional(),
4868
- negative_source_net_id: z207.string().optional(),
4922
+ is_dc_source: z209.literal(true).optional().default(true),
4923
+ positive_source_port_id: z209.string().optional(),
4924
+ negative_source_port_id: z209.string().optional(),
4925
+ positive_source_net_id: z209.string().optional(),
4926
+ negative_source_net_id: z209.string().optional(),
4869
4927
  current,
4870
4928
  ac_magnitude: current.optional(),
4871
4929
  ac_phase: rotation.optional()
4872
4930
  }).describe("Defines a DC current source for simulation");
4873
- var simulation_ac_current_source = z207.object({
4874
- type: z207.literal("simulation_current_source"),
4931
+ var simulation_ac_current_source = z209.object({
4932
+ type: z209.literal("simulation_current_source"),
4875
4933
  simulation_current_source_id: getZodPrefixedIdWithDefault(
4876
4934
  "simulation_current_source"
4877
4935
  ),
4878
- is_dc_source: z207.literal(false),
4879
- terminal1_source_port_id: z207.string().optional(),
4880
- terminal2_source_port_id: z207.string().optional(),
4881
- terminal1_source_net_id: z207.string().optional(),
4882
- terminal2_source_net_id: z207.string().optional(),
4936
+ is_dc_source: z209.literal(false),
4937
+ terminal1_source_port_id: z209.string().optional(),
4938
+ terminal2_source_port_id: z209.string().optional(),
4939
+ terminal1_source_net_id: z209.string().optional(),
4940
+ terminal2_source_net_id: z209.string().optional(),
4883
4941
  current: current.optional(),
4884
4942
  frequency: frequency.optional(),
4885
4943
  peak_to_peak_current: current.optional(),
@@ -4889,64 +4947,64 @@ var simulation_ac_current_source = z207.object({
4889
4947
  ac_magnitude: current.optional(),
4890
4948
  ac_phase: rotation.optional()
4891
4949
  }).describe("Defines an AC current source for simulation");
4892
- var simulation_current_source = z207.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
4950
+ var simulation_current_source = z209.union([simulation_dc_current_source, simulation_ac_current_source]).describe("Defines a current source for simulation");
4893
4951
  expectTypesMatch(true);
4894
4952
  expectTypesMatch(true);
4895
4953
  expectTypesMatch(true);
4896
4954
 
4897
4955
  // src/simulation/simulation_experiment.ts
4898
- import { z as z209 } from "zod";
4956
+ import { z as z211 } from "zod";
4899
4957
 
4900
4958
  // src/simulation/simulation_units.ts
4901
- import { z as z208 } from "zod";
4902
- var simulation_dc_sweep_unit = z208.custom(
4959
+ import { z as z210 } from "zod";
4960
+ var simulation_dc_sweep_unit = z210.custom(
4903
4961
  (dcSweepUnit) => dcSweepUnit === "V" || dcSweepUnit === "A"
4904
4962
  );
4905
- var simulation_parameter_unit = z208.custom(
4963
+ var simulation_parameter_unit = z210.custom(
4906
4964
  (parameterUnit) => parameterUnit === "\u03A9" || parameterUnit === "F" || parameterUnit === "H" || parameterUnit === "V" || parameterUnit === "A"
4907
4965
  );
4908
4966
 
4909
4967
  // src/simulation/simulation_experiment.ts
4910
- var experiment_type = z209.union([
4911
- z209.literal("spice_dc_sweep"),
4912
- z209.literal("spice_dc_operating_point"),
4913
- z209.literal("spice_transient_analysis"),
4914
- z209.literal("spice_ac_analysis"),
4915
- z209.literal("pcb_return_current")
4968
+ var experiment_type = z211.union([
4969
+ z211.literal("spice_dc_sweep"),
4970
+ z211.literal("spice_dc_operating_point"),
4971
+ z211.literal("spice_transient_analysis"),
4972
+ z211.literal("spice_ac_analysis"),
4973
+ z211.literal("pcb_return_current")
4916
4974
  ]);
4917
- var spice_simulation_options = z209.object({
4918
- method: z209.enum(["trap", "gear"]).optional(),
4919
- reltol: z209.union([z209.number(), z209.string()]).optional(),
4920
- abstol: z209.union([z209.number(), z209.string()]).optional(),
4921
- vntol: z209.union([z209.number(), z209.string()]).optional()
4975
+ var spice_simulation_options = z211.object({
4976
+ method: z211.enum(["trap", "gear"]).optional(),
4977
+ reltol: z211.union([z211.number(), z211.string()]).optional(),
4978
+ abstol: z211.union([z211.number(), z211.string()]).optional(),
4979
+ vntol: z211.union([z211.number(), z211.string()]).optional()
4922
4980
  }).describe("SPICE solver options for a simulation experiment");
4923
- var pcb_spice_channel = z209.object({
4924
- reduction: z209.union([
4925
- z209.literal("routed-copper"),
4926
- z209.literal("straightened-stages")
4981
+ var pcb_spice_channel = z211.object({
4982
+ reduction: z211.union([
4983
+ z211.literal("routed-copper"),
4984
+ z211.literal("straightened-stages")
4927
4985
  ]),
4928
- sections: z209.number().int().min(1).max(128),
4929
- lanes: z209.array(
4930
- z209.object({
4931
- name: z209.string().min(1),
4932
- driver_source_port_id: z209.string().min(1),
4933
- receiver_source_port_id: z209.string().min(1)
4986
+ sections: z211.number().int().min(1).max(128),
4987
+ lanes: z211.array(
4988
+ z211.object({
4989
+ name: z211.string().min(1),
4990
+ driver_source_port_id: z211.string().min(1),
4991
+ receiver_source_port_id: z211.string().min(1)
4934
4992
  })
4935
4993
  ).min(1).max(3),
4936
- reference_source_port_id: z209.string().min(1),
4937
- passive_source_component_ids: z209.array(z209.string().min(1)).optional(),
4938
- extraction: z209.object({
4939
- minimum_frequency_hz: z209.number().finite().positive(),
4940
- maximum_frequency_hz: z209.number().finite().positive(),
4941
- model_frequency_hz: z209.number().finite().positive(),
4942
- filaments: z209.number().int().positive(),
4943
- refinement_filaments: z209.number().int().positive(),
4944
- convergence_tolerance: z209.number().finite().positive(),
4945
- capacitance_tolerance: z209.number().finite().positive(),
4946
- reciprocity_tolerance: z209.number().finite().positive(),
4947
- dc_resistance_tolerance: z209.number().finite().positive(),
4948
- max_panel_length_mm: z209.number().finite().positive(),
4949
- ground_mesh_size_mm: z209.number().finite().positive().optional()
4994
+ reference_source_port_id: z211.string().min(1),
4995
+ passive_source_component_ids: z211.array(z211.string().min(1)).optional(),
4996
+ extraction: z211.object({
4997
+ minimum_frequency_hz: z211.number().finite().positive(),
4998
+ maximum_frequency_hz: z211.number().finite().positive(),
4999
+ model_frequency_hz: z211.number().finite().positive(),
5000
+ filaments: z211.number().int().positive(),
5001
+ refinement_filaments: z211.number().int().positive(),
5002
+ convergence_tolerance: z211.number().finite().positive(),
5003
+ capacitance_tolerance: z211.number().finite().positive(),
5004
+ reciprocity_tolerance: z211.number().finite().positive(),
5005
+ dc_resistance_tolerance: z211.number().finite().positive(),
5006
+ max_panel_length_mm: z211.number().finite().positive(),
5007
+ ground_mesh_size_mm: z211.number().finite().positive().optional()
4950
5008
  }).refine(
4951
5009
  (extraction) => extraction.refinement_filaments > extraction.filaments,
4952
5010
  {
@@ -4954,50 +5012,50 @@ var pcb_spice_channel = z209.object({
4954
5012
  message: "refinement_filaments must be greater than filaments"
4955
5013
  }
4956
5014
  ),
4957
- relative_permittivity: z209.number().finite().positive().optional(),
4958
- via_plating_thickness_mm: z209.number().finite().positive().optional(),
4959
- via_equivalent_width_mm: z209.number().finite().positive().optional(),
4960
- omit_through_via_stubs: z209.boolean().optional(),
4961
- straightened_stage_profiles: z209.record(
4962
- z209.object({
4963
- spacing_mm: z209.number().finite().positive(),
4964
- relative_permittivity: z209.number().finite().positive(),
4965
- return: z209.object({
4966
- width_mm: z209.number().finite().positive(),
4967
- thickness_mm: z209.number().finite().positive(),
4968
- length_factor: z209.number().finite().positive(),
4969
- center_y_mm: z209.number().finite(),
4970
- center_z_mm: z209.number().finite()
5015
+ relative_permittivity: z211.number().finite().positive().optional(),
5016
+ via_plating_thickness_mm: z211.number().finite().positive().optional(),
5017
+ via_equivalent_width_mm: z211.number().finite().positive().optional(),
5018
+ omit_through_via_stubs: z211.boolean().optional(),
5019
+ straightened_stage_profiles: z211.record(
5020
+ z211.object({
5021
+ spacing_mm: z211.number().finite().positive(),
5022
+ relative_permittivity: z211.number().finite().positive(),
5023
+ return: z211.object({
5024
+ width_mm: z211.number().finite().positive(),
5025
+ thickness_mm: z211.number().finite().positive(),
5026
+ length_factor: z211.number().finite().positive(),
5027
+ center_y_mm: z211.number().finite(),
5028
+ center_z_mm: z211.number().finite()
4971
5029
  })
4972
5030
  })
4973
5031
  ).optional()
4974
5032
  });
4975
5033
  expectTypesMatch(true);
4976
- var simulation_experiment = z209.object({
4977
- type: z209.literal("simulation_experiment"),
5034
+ var simulation_experiment = z211.object({
5035
+ type: z211.literal("simulation_experiment"),
4978
5036
  simulation_experiment_id: getZodPrefixedIdWithDefault(
4979
5037
  "simulation_experiment"
4980
5038
  ),
4981
- name: z209.string(),
5039
+ name: z211.string(),
4982
5040
  experiment_type,
4983
- subcircuit_id: z209.string().optional(),
4984
- spice_engine: z209.string().optional(),
5041
+ subcircuit_id: z211.string().optional(),
5042
+ spice_engine: z211.string().optional(),
4985
5043
  time_per_step: duration_ms.optional(),
4986
5044
  start_time_ms: ms.optional(),
4987
5045
  end_time_ms: ms.optional(),
4988
5046
  spice_options: spice_simulation_options.optional(),
4989
5047
  pcb_spice_channel: pcb_spice_channel.optional(),
4990
- dc_sweep_voltage_source_id: z209.string().optional(),
4991
- dc_sweep_current_source_id: z209.string().optional(),
4992
- dc_sweep_start: z209.number().optional(),
4993
- dc_sweep_stop: z209.number().optional(),
4994
- dc_sweep_step: z209.number().refine((dcSweepStep) => dcSweepStep !== 0).optional(),
5048
+ dc_sweep_voltage_source_id: z211.string().optional(),
5049
+ dc_sweep_current_source_id: z211.string().optional(),
5050
+ dc_sweep_start: z211.number().optional(),
5051
+ dc_sweep_stop: z211.number().optional(),
5052
+ dc_sweep_step: z211.number().refine((dcSweepStep) => dcSweepStep !== 0).optional(),
4995
5053
  dc_sweep_unit: simulation_dc_sweep_unit.optional(),
4996
- ac_sweep_type: z209.enum(["linear", "decade", "octave"]).optional(),
4997
- ac_samples_per_interval: z209.number().int().positive().optional(),
4998
- ac_sample_count: z209.number().int().positive().optional(),
4999
- ac_start_frequency_hz: z209.number().positive().optional(),
5000
- ac_stop_frequency_hz: z209.number().positive().optional()
5054
+ ac_sweep_type: z211.enum(["linear", "decade", "octave"]).optional(),
5055
+ ac_samples_per_interval: z211.number().int().positive().optional(),
5056
+ ac_sample_count: z211.number().int().positive().optional(),
5057
+ ac_start_frequency_hz: z211.number().positive().optional(),
5058
+ ac_stop_frequency_hz: z211.number().positive().optional()
5001
5059
  }).superRefine((experiment, context) => {
5002
5060
  if (experiment.experiment_type === "spice_dc_sweep") {
5003
5061
  const requiredFields = [
@@ -5009,7 +5067,7 @@ var simulation_experiment = z209.object({
5009
5067
  for (const field of requiredFields) {
5010
5068
  if (experiment[field] === void 0) {
5011
5069
  context.addIssue({
5012
- code: z209.ZodIssueCode.custom,
5070
+ code: z211.ZodIssueCode.custom,
5013
5071
  path: [field],
5014
5072
  message: `${field} is required for a DC sweep`
5015
5073
  });
@@ -5019,7 +5077,7 @@ var simulation_experiment = z209.object({
5019
5077
  const hasCurrentSource = experiment.dc_sweep_current_source_id !== void 0;
5020
5078
  if (hasVoltageSource === hasCurrentSource) {
5021
5079
  context.addIssue({
5022
- code: z209.ZodIssueCode.custom,
5080
+ code: z211.ZodIssueCode.custom,
5023
5081
  path: ["dc_sweep_voltage_source_id"],
5024
5082
  message: "Exactly one DC sweep voltage or current source ID is required"
5025
5083
  });
@@ -5028,35 +5086,35 @@ var simulation_experiment = z209.object({
5028
5086
  if (experiment.experiment_type === "spice_ac_analysis") {
5029
5087
  if (experiment.ac_sweep_type === void 0) {
5030
5088
  context.addIssue({
5031
- code: z209.ZodIssueCode.custom,
5089
+ code: z211.ZodIssueCode.custom,
5032
5090
  path: ["ac_sweep_type"],
5033
5091
  message: "ac_sweep_type is required for an AC analysis"
5034
5092
  });
5035
5093
  }
5036
5094
  if (experiment.ac_start_frequency_hz === void 0) {
5037
5095
  context.addIssue({
5038
- code: z209.ZodIssueCode.custom,
5096
+ code: z211.ZodIssueCode.custom,
5039
5097
  path: ["ac_start_frequency_hz"],
5040
5098
  message: "ac_start_frequency_hz is required for an AC analysis"
5041
5099
  });
5042
5100
  }
5043
5101
  if (experiment.ac_stop_frequency_hz === void 0) {
5044
5102
  context.addIssue({
5045
- code: z209.ZodIssueCode.custom,
5103
+ code: z211.ZodIssueCode.custom,
5046
5104
  path: ["ac_stop_frequency_hz"],
5047
5105
  message: "ac_stop_frequency_hz is required for an AC analysis"
5048
5106
  });
5049
5107
  }
5050
5108
  if (experiment.ac_sweep_type === "linear" && experiment.ac_sample_count === void 0) {
5051
5109
  context.addIssue({
5052
- code: z209.ZodIssueCode.custom,
5110
+ code: z211.ZodIssueCode.custom,
5053
5111
  path: ["ac_sample_count"],
5054
5112
  message: "ac_sample_count is required for a linear AC analysis"
5055
5113
  });
5056
5114
  }
5057
5115
  if ((experiment.ac_sweep_type === "decade" || experiment.ac_sweep_type === "octave") && experiment.ac_samples_per_interval === void 0) {
5058
5116
  context.addIssue({
5059
- code: z209.ZodIssueCode.custom,
5117
+ code: z211.ZodIssueCode.custom,
5060
5118
  path: ["ac_samples_per_interval"],
5061
5119
  message: "ac_samples_per_interval is required for decade and octave AC analyses"
5062
5120
  });
@@ -5066,88 +5124,88 @@ var simulation_experiment = z209.object({
5066
5124
  expectTypesMatch(true);
5067
5125
 
5068
5126
  // src/simulation/simulation_transient_voltage_graph.ts
5069
- import { z as z211 } from "zod";
5127
+ import { z as z213 } from "zod";
5070
5128
 
5071
5129
  // src/simulation/simulation_parameter_sweep_coordinate.ts
5072
- import { z as z210 } from "zod";
5073
- var simulation_parameter_sweep_coordinate = z210.object({
5074
- simulation_parameter_sweep_id: z210.string(),
5075
- sweep_index: z210.number().int().nonnegative(),
5076
- parameter_value: z210.number(),
5130
+ import { z as z212 } from "zod";
5131
+ var simulation_parameter_sweep_coordinate = z212.object({
5132
+ simulation_parameter_sweep_id: z212.string(),
5133
+ sweep_index: z212.number().int().nonnegative(),
5134
+ parameter_value: z212.number(),
5077
5135
  parameter_unit: simulation_parameter_unit
5078
5136
  });
5079
5137
  expectTypesMatch(true);
5080
5138
 
5081
5139
  // src/simulation/simulation_transient_voltage_graph.ts
5082
- var simulation_transient_voltage_graph = z211.object({
5083
- type: z211.literal("simulation_transient_voltage_graph"),
5140
+ var simulation_transient_voltage_graph = z213.object({
5141
+ type: z213.literal("simulation_transient_voltage_graph"),
5084
5142
  simulation_transient_voltage_graph_id: getZodPrefixedIdWithDefault(
5085
5143
  "simulation_transient_voltage_graph"
5086
5144
  ),
5087
- simulation_experiment_id: z211.string(),
5088
- simulation_voltage_probe_id: z211.string().optional(),
5145
+ simulation_experiment_id: z213.string(),
5146
+ simulation_voltage_probe_id: z213.string().optional(),
5089
5147
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5090
- timestamps_ms: z211.array(z211.number()).optional(),
5091
- voltage_levels: z211.array(z211.number()),
5092
- source_component_id: z211.string().optional(),
5093
- subcircuit_connectivity_map_key: z211.string().optional(),
5148
+ timestamps_ms: z213.array(z213.number()).optional(),
5149
+ voltage_levels: z213.array(z213.number()),
5150
+ source_component_id: z213.string().optional(),
5151
+ subcircuit_connectivity_map_key: z213.string().optional(),
5094
5152
  time_per_step: duration_ms,
5095
5153
  start_time_ms: ms,
5096
5154
  end_time_ms: ms,
5097
- name: z211.string().optional(),
5098
- color: z211.string().optional()
5155
+ name: z213.string().optional(),
5156
+ color: z213.string().optional()
5099
5157
  }).describe("Stores voltage measurements over time for a simulation");
5100
5158
  expectTypesMatch(true);
5101
5159
 
5102
5160
  // src/simulation/simulation_transient_current_graph.ts
5103
- import { z as z212 } from "zod";
5104
- var simulation_transient_current_graph = z212.object({
5105
- type: z212.literal("simulation_transient_current_graph"),
5161
+ import { z as z214 } from "zod";
5162
+ var simulation_transient_current_graph = z214.object({
5163
+ type: z214.literal("simulation_transient_current_graph"),
5106
5164
  simulation_transient_current_graph_id: getZodPrefixedIdWithDefault(
5107
5165
  "simulation_transient_current_graph"
5108
5166
  ),
5109
- simulation_experiment_id: z212.string(),
5167
+ simulation_experiment_id: z214.string(),
5110
5168
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5111
- timestamps_ms: z212.array(z212.number()).optional(),
5112
- current_levels: z212.array(z212.number()),
5113
- source_component_id: z212.string().optional(),
5114
- subcircuit_connectivity_map_key: z212.string().optional(),
5169
+ timestamps_ms: z214.array(z214.number()).optional(),
5170
+ current_levels: z214.array(z214.number()),
5171
+ source_component_id: z214.string().optional(),
5172
+ subcircuit_connectivity_map_key: z214.string().optional(),
5115
5173
  time_per_step: duration_ms,
5116
5174
  start_time_ms: ms,
5117
5175
  end_time_ms: ms,
5118
- name: z212.string().optional(),
5119
- color: z212.string().optional()
5176
+ name: z214.string().optional(),
5177
+ color: z214.string().optional()
5120
5178
  }).describe("Stores current measurements over time for a simulation");
5121
5179
  expectTypesMatch(true);
5122
5180
 
5123
5181
  // src/simulation/simulation_switch.ts
5124
- import { z as z213 } from "zod";
5125
- var simulation_switch = z213.object({
5126
- type: z213.literal("simulation_switch"),
5182
+ import { z as z215 } from "zod";
5183
+ var simulation_switch = z215.object({
5184
+ type: z215.literal("simulation_switch"),
5127
5185
  simulation_switch_id: getZodPrefixedIdWithDefault("simulation_switch"),
5128
- source_component_id: z213.string().optional(),
5186
+ source_component_id: z215.string().optional(),
5129
5187
  closes_at: ms.optional(),
5130
5188
  opens_at: ms.optional(),
5131
- starts_closed: z213.boolean().optional(),
5189
+ starts_closed: z215.boolean().optional(),
5132
5190
  switching_frequency: frequency.optional()
5133
5191
  }).describe("Defines a switch for simulation timing control");
5134
5192
  expectTypesMatch(true);
5135
5193
 
5136
5194
  // src/simulation/simulation_voltage_probe.ts
5137
- import { z as z214 } from "zod";
5138
- var simulation_voltage_probe = z214.object({
5139
- type: z214.literal("simulation_voltage_probe"),
5195
+ import { z as z216 } from "zod";
5196
+ var simulation_voltage_probe = z216.object({
5197
+ type: z216.literal("simulation_voltage_probe"),
5140
5198
  simulation_voltage_probe_id: getZodPrefixedIdWithDefault(
5141
5199
  "simulation_voltage_probe"
5142
5200
  ),
5143
- source_component_id: z214.string().optional(),
5144
- name: z214.string().optional(),
5145
- signal_input_source_port_id: z214.string().optional(),
5146
- signal_input_source_net_id: z214.string().optional(),
5147
- reference_input_source_port_id: z214.string().optional(),
5148
- reference_input_source_net_id: z214.string().optional(),
5149
- subcircuit_id: z214.string().optional(),
5150
- color: z214.string().optional()
5201
+ source_component_id: z216.string().optional(),
5202
+ name: z216.string().optional(),
5203
+ signal_input_source_port_id: z216.string().optional(),
5204
+ signal_input_source_net_id: z216.string().optional(),
5205
+ reference_input_source_port_id: z216.string().optional(),
5206
+ reference_input_source_net_id: z216.string().optional(),
5207
+ subcircuit_id: z216.string().optional(),
5208
+ color: z216.string().optional()
5151
5209
  }).describe(
5152
5210
  "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."
5153
5211
  ).superRefine((data, ctx) => {
@@ -5157,20 +5215,20 @@ var simulation_voltage_probe = z214.object({
5157
5215
  const has_nets = !!data.signal_input_source_net_id || !!data.reference_input_source_net_id;
5158
5216
  if (has_ports && has_nets) {
5159
5217
  ctx.addIssue({
5160
- code: z214.ZodIssueCode.custom,
5218
+ code: z216.ZodIssueCode.custom,
5161
5219
  message: "Cannot mix port and net connections in a differential probe."
5162
5220
  });
5163
5221
  } else if (has_ports) {
5164
5222
  if (!data.signal_input_source_port_id || !data.reference_input_source_port_id) {
5165
5223
  ctx.addIssue({
5166
- code: z214.ZodIssueCode.custom,
5224
+ code: z216.ZodIssueCode.custom,
5167
5225
  message: "Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."
5168
5226
  });
5169
5227
  }
5170
5228
  } else if (has_nets) {
5171
5229
  if (!data.signal_input_source_net_id || !data.reference_input_source_net_id) {
5172
5230
  ctx.addIssue({
5173
- code: z214.ZodIssueCode.custom,
5231
+ code: z216.ZodIssueCode.custom,
5174
5232
  message: "Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."
5175
5233
  });
5176
5234
  }
@@ -5178,7 +5236,7 @@ var simulation_voltage_probe = z214.object({
5178
5236
  } else {
5179
5237
  if (!!data.signal_input_source_port_id === !!data.signal_input_source_net_id) {
5180
5238
  ctx.addIssue({
5181
- code: z214.ZodIssueCode.custom,
5239
+ code: z216.ZodIssueCode.custom,
5182
5240
  message: "A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."
5183
5241
  });
5184
5242
  }
@@ -5187,20 +5245,20 @@ var simulation_voltage_probe = z214.object({
5187
5245
  expectTypesMatch(true);
5188
5246
 
5189
5247
  // src/simulation/simulation_current_probe.ts
5190
- import { z as z215 } from "zod";
5191
- var simulation_current_probe = z215.object({
5192
- type: z215.literal("simulation_current_probe"),
5248
+ import { z as z217 } from "zod";
5249
+ var simulation_current_probe = z217.object({
5250
+ type: z217.literal("simulation_current_probe"),
5193
5251
  simulation_current_probe_id: getZodPrefixedIdWithDefault(
5194
5252
  "simulation_current_probe"
5195
5253
  ),
5196
- source_component_id: z215.string().optional(),
5197
- name: z215.string().optional(),
5198
- positive_source_port_id: z215.string().optional(),
5199
- negative_source_port_id: z215.string().optional(),
5200
- positive_source_net_id: z215.string().optional(),
5201
- negative_source_net_id: z215.string().optional(),
5202
- subcircuit_id: z215.string().optional(),
5203
- color: z215.string().optional()
5254
+ source_component_id: z217.string().optional(),
5255
+ name: z217.string().optional(),
5256
+ positive_source_port_id: z217.string().optional(),
5257
+ negative_source_port_id: z217.string().optional(),
5258
+ positive_source_net_id: z217.string().optional(),
5259
+ negative_source_net_id: z217.string().optional(),
5260
+ subcircuit_id: z217.string().optional(),
5261
+ color: z217.string().optional()
5204
5262
  }).describe(
5205
5263
  "Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint."
5206
5264
  ).superRefine((data, ctx) => {
@@ -5212,7 +5270,7 @@ var simulation_current_probe = z215.object({
5212
5270
  const hasNets = hasPositiveNet || hasNegativeNet;
5213
5271
  if (hasPorts && hasNets) {
5214
5272
  ctx.addIssue({
5215
- code: z215.ZodIssueCode.custom,
5273
+ code: z217.ZodIssueCode.custom,
5216
5274
  message: "Cannot mix port and net connections in a current probe."
5217
5275
  });
5218
5276
  return;
@@ -5220,7 +5278,7 @@ var simulation_current_probe = z215.object({
5220
5278
  if (hasPorts) {
5221
5279
  if (!hasPositivePort || !hasNegativePort) {
5222
5280
  ctx.addIssue({
5223
- code: z215.ZodIssueCode.custom,
5281
+ code: z217.ZodIssueCode.custom,
5224
5282
  message: "Current probe using source ports requires both positive_source_port_id and negative_source_port_id."
5225
5283
  });
5226
5284
  }
@@ -5229,71 +5287,71 @@ var simulation_current_probe = z215.object({
5229
5287
  if (hasNets) {
5230
5288
  if (!hasPositiveNet || !hasNegativeNet) {
5231
5289
  ctx.addIssue({
5232
- code: z215.ZodIssueCode.custom,
5290
+ code: z217.ZodIssueCode.custom,
5233
5291
  message: "Current probe using source nets requires both positive_source_net_id and negative_source_net_id."
5234
5292
  });
5235
5293
  }
5236
5294
  return;
5237
5295
  }
5238
5296
  ctx.addIssue({
5239
- code: z215.ZodIssueCode.custom,
5297
+ code: z217.ZodIssueCode.custom,
5240
5298
  message: "A current probe must have either positive/negative source port ids or positive/negative source net ids."
5241
5299
  });
5242
5300
  });
5243
5301
  expectTypesMatch(true);
5244
5302
 
5245
5303
  // src/simulation/simulation_unknown_experiment_error.ts
5246
- import { z as z216 } from "zod";
5304
+ import { z as z218 } from "zod";
5247
5305
  var simulation_unknown_experiment_error = base_circuit_json_error.extend({
5248
- type: z216.literal("simulation_unknown_experiment_error"),
5306
+ type: z218.literal("simulation_unknown_experiment_error"),
5249
5307
  simulation_unknown_experiment_error_id: getZodPrefixedIdWithDefault(
5250
5308
  "simulation_unknown_experiment_error"
5251
5309
  ),
5252
- error_type: z216.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
5253
- simulation_experiment_id: z216.string().optional(),
5254
- subcircuit_id: z216.string().optional()
5310
+ error_type: z218.literal("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),
5311
+ simulation_experiment_id: z218.string().optional(),
5312
+ subcircuit_id: z218.string().optional()
5255
5313
  }).describe("An unknown error occurred during the simulation experiment.");
5256
5314
  expectTypesMatch(true);
5257
5315
 
5258
5316
  // src/simulation/simulation_parameter_sweep.ts
5259
- import { z as z217 } from "zod";
5260
- var simulation_parameter_type = z217.enum([
5317
+ import { z as z219 } from "zod";
5318
+ var simulation_parameter_type = z219.enum([
5261
5319
  "resistance",
5262
5320
  "capacitance",
5263
5321
  "inductance",
5264
5322
  "voltage",
5265
5323
  "current"
5266
5324
  ]);
5267
- var simulation_parameter_sweep_base = z217.object({
5268
- type: z217.literal("simulation_parameter_sweep"),
5325
+ var simulation_parameter_sweep_base = z219.object({
5326
+ type: z219.literal("simulation_parameter_sweep"),
5269
5327
  simulation_parameter_sweep_id: getZodPrefixedIdWithDefault(
5270
5328
  "simulation_parameter_sweep"
5271
5329
  ),
5272
- simulation_experiment_id: z217.string(),
5273
- name: z217.string().optional(),
5274
- parameter_values: z217.array(z217.number()).min(1),
5330
+ simulation_experiment_id: z219.string(),
5331
+ name: z219.string().optional(),
5332
+ parameter_values: z219.array(z219.number()).min(1),
5275
5333
  parameter_unit: simulation_parameter_unit
5276
5334
  });
5277
- var simulation_parameter_sweep = z217.discriminatedUnion("parameter_type", [
5335
+ var simulation_parameter_sweep = z219.discriminatedUnion("parameter_type", [
5278
5336
  simulation_parameter_sweep_base.extend({
5279
- parameter_type: z217.literal("resistance"),
5280
- resistor_source_component_id: z217.string()
5337
+ parameter_type: z219.literal("resistance"),
5338
+ resistor_source_component_id: z219.string()
5281
5339
  }),
5282
5340
  simulation_parameter_sweep_base.extend({
5283
- parameter_type: z217.literal("capacitance"),
5284
- capacitor_source_component_id: z217.string()
5341
+ parameter_type: z219.literal("capacitance"),
5342
+ capacitor_source_component_id: z219.string()
5285
5343
  }),
5286
5344
  simulation_parameter_sweep_base.extend({
5287
- parameter_type: z217.literal("inductance"),
5288
- inductor_source_component_id: z217.string()
5345
+ parameter_type: z219.literal("inductance"),
5346
+ inductor_source_component_id: z219.string()
5289
5347
  }),
5290
5348
  simulation_parameter_sweep_base.extend({
5291
- parameter_type: z217.literal("voltage"),
5292
- source_net_id: z217.string()
5349
+ parameter_type: z219.literal("voltage"),
5350
+ source_net_id: z219.string()
5293
5351
  }),
5294
5352
  simulation_parameter_sweep_base.extend({
5295
- parameter_type: z217.literal("current"),
5296
- current_source_component_id: z217.string()
5353
+ parameter_type: z219.literal("current"),
5354
+ current_source_component_id: z219.string()
5297
5355
  })
5298
5356
  ]).describe("Repeats a simulation experiment over component parameter values");
5299
5357
  expectTypesMatch(
@@ -5301,52 +5359,52 @@ expectTypesMatch(
5301
5359
  );
5302
5360
 
5303
5361
  // src/simulation/simulation_dc_operating_point_voltage.ts
5304
- import { z as z218 } from "zod";
5305
- var simulation_dc_operating_point_voltage = z218.object({
5306
- type: z218.literal("simulation_dc_operating_point_voltage"),
5362
+ import { z as z220 } from "zod";
5363
+ var simulation_dc_operating_point_voltage = z220.object({
5364
+ type: z220.literal("simulation_dc_operating_point_voltage"),
5307
5365
  simulation_dc_operating_point_voltage_id: getZodPrefixedIdWithDefault(
5308
5366
  "simulation_dc_operating_point_voltage"
5309
5367
  ),
5310
- simulation_experiment_id: z218.string(),
5368
+ simulation_experiment_id: z220.string(),
5311
5369
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5312
- simulation_voltage_probe_id: z218.string(),
5313
- voltage: z218.number(),
5314
- name: z218.string().optional(),
5315
- color: z218.string().optional()
5370
+ simulation_voltage_probe_id: z220.string(),
5371
+ voltage: z220.number(),
5372
+ name: z220.string().optional(),
5373
+ color: z220.string().optional()
5316
5374
  });
5317
5375
  expectTypesMatch(true);
5318
5376
 
5319
5377
  // src/simulation/simulation_dc_operating_point_current.ts
5320
- import { z as z219 } from "zod";
5321
- var simulation_dc_operating_point_current = z219.object({
5322
- type: z219.literal("simulation_dc_operating_point_current"),
5378
+ import { z as z221 } from "zod";
5379
+ var simulation_dc_operating_point_current = z221.object({
5380
+ type: z221.literal("simulation_dc_operating_point_current"),
5323
5381
  simulation_dc_operating_point_current_id: getZodPrefixedIdWithDefault(
5324
5382
  "simulation_dc_operating_point_current"
5325
5383
  ),
5326
- simulation_experiment_id: z219.string(),
5384
+ simulation_experiment_id: z221.string(),
5327
5385
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5328
- simulation_current_probe_id: z219.string(),
5329
- current: z219.number(),
5330
- name: z219.string().optional(),
5331
- color: z219.string().optional()
5386
+ simulation_current_probe_id: z221.string(),
5387
+ current: z221.number(),
5388
+ name: z221.string().optional(),
5389
+ color: z221.string().optional()
5332
5390
  });
5333
5391
  expectTypesMatch(true);
5334
5392
 
5335
5393
  // src/simulation/simulation_dc_sweep_voltage_graph.ts
5336
- import { z as z220 } from "zod";
5337
- var simulation_dc_sweep_voltage_graph = z220.object({
5338
- type: z220.literal("simulation_dc_sweep_voltage_graph"),
5394
+ import { z as z222 } from "zod";
5395
+ var simulation_dc_sweep_voltage_graph = z222.object({
5396
+ type: z222.literal("simulation_dc_sweep_voltage_graph"),
5339
5397
  simulation_dc_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
5340
5398
  "simulation_dc_sweep_voltage_graph"
5341
5399
  ),
5342
- simulation_experiment_id: z220.string(),
5400
+ simulation_experiment_id: z222.string(),
5343
5401
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5344
- simulation_voltage_probe_id: z220.string(),
5345
- sweep_values: z220.array(z220.number()),
5402
+ simulation_voltage_probe_id: z222.string(),
5403
+ sweep_values: z222.array(z222.number()),
5346
5404
  sweep_unit: simulation_dc_sweep_unit,
5347
- voltage_levels: z220.array(z220.number()),
5348
- name: z220.string().optional(),
5349
- color: z220.string().optional()
5405
+ voltage_levels: z222.array(z222.number()),
5406
+ name: z222.string().optional(),
5407
+ color: z222.string().optional()
5350
5408
  }).refine(
5351
5409
  (graph) => graph.sweep_values.length === graph.voltage_levels.length,
5352
5410
  {
@@ -5356,20 +5414,20 @@ var simulation_dc_sweep_voltage_graph = z220.object({
5356
5414
  expectTypesMatch(true);
5357
5415
 
5358
5416
  // src/simulation/simulation_dc_sweep_current_graph.ts
5359
- import { z as z221 } from "zod";
5360
- var simulation_dc_sweep_current_graph = z221.object({
5361
- type: z221.literal("simulation_dc_sweep_current_graph"),
5417
+ import { z as z223 } from "zod";
5418
+ var simulation_dc_sweep_current_graph = z223.object({
5419
+ type: z223.literal("simulation_dc_sweep_current_graph"),
5362
5420
  simulation_dc_sweep_current_graph_id: getZodPrefixedIdWithDefault(
5363
5421
  "simulation_dc_sweep_current_graph"
5364
5422
  ),
5365
- simulation_experiment_id: z221.string(),
5423
+ simulation_experiment_id: z223.string(),
5366
5424
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5367
- simulation_current_probe_id: z221.string(),
5368
- sweep_values: z221.array(z221.number()),
5425
+ simulation_current_probe_id: z223.string(),
5426
+ sweep_values: z223.array(z223.number()),
5369
5427
  sweep_unit: simulation_dc_sweep_unit,
5370
- current_levels: z221.array(z221.number()),
5371
- name: z221.string().optional(),
5372
- color: z221.string().optional()
5428
+ current_levels: z223.array(z223.number()),
5429
+ name: z223.string().optional(),
5430
+ color: z223.string().optional()
5373
5431
  }).refine(
5374
5432
  (graph) => graph.sweep_values.length === graph.current_levels.length,
5375
5433
  {
@@ -5379,29 +5437,29 @@ var simulation_dc_sweep_current_graph = z221.object({
5379
5437
  expectTypesMatch(true);
5380
5438
 
5381
5439
  // src/simulation/simulation_ac_sweep_voltage_graph.ts
5382
- import { z as z223 } from "zod";
5440
+ import { z as z225 } from "zod";
5383
5441
 
5384
5442
  // src/simulation/simulation_complex_sample.ts
5385
- import { z as z222 } from "zod";
5386
- var simulation_complex_sample = z222.object({
5387
- re: z222.number(),
5388
- im: z222.number()
5443
+ import { z as z224 } from "zod";
5444
+ var simulation_complex_sample = z224.object({
5445
+ re: z224.number(),
5446
+ im: z224.number()
5389
5447
  });
5390
5448
  expectTypesMatch(true);
5391
5449
 
5392
5450
  // src/simulation/simulation_ac_sweep_voltage_graph.ts
5393
- var simulation_ac_sweep_voltage_graph = z223.object({
5394
- type: z223.literal("simulation_ac_sweep_voltage_graph"),
5451
+ var simulation_ac_sweep_voltage_graph = z225.object({
5452
+ type: z225.literal("simulation_ac_sweep_voltage_graph"),
5395
5453
  simulation_ac_sweep_voltage_graph_id: getZodPrefixedIdWithDefault(
5396
5454
  "simulation_ac_sweep_voltage_graph"
5397
5455
  ),
5398
- simulation_experiment_id: z223.string(),
5456
+ simulation_experiment_id: z225.string(),
5399
5457
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5400
- simulation_voltage_probe_id: z223.string(),
5401
- frequencies_hz: z223.array(z223.number()),
5402
- complex_voltages: z223.array(simulation_complex_sample),
5403
- name: z223.string().optional(),
5404
- color: z223.string().optional()
5458
+ simulation_voltage_probe_id: z225.string(),
5459
+ frequencies_hz: z225.array(z225.number()),
5460
+ complex_voltages: z225.array(simulation_complex_sample),
5461
+ name: z225.string().optional(),
5462
+ color: z225.string().optional()
5405
5463
  }).refine(
5406
5464
  (graph) => graph.frequencies_hz.length === graph.complex_voltages.length,
5407
5465
  {
@@ -5411,19 +5469,19 @@ var simulation_ac_sweep_voltage_graph = z223.object({
5411
5469
  expectTypesMatch(true);
5412
5470
 
5413
5471
  // src/simulation/simulation_ac_sweep_current_graph.ts
5414
- import { z as z224 } from "zod";
5415
- var simulation_ac_sweep_current_graph = z224.object({
5416
- type: z224.literal("simulation_ac_sweep_current_graph"),
5472
+ import { z as z226 } from "zod";
5473
+ var simulation_ac_sweep_current_graph = z226.object({
5474
+ type: z226.literal("simulation_ac_sweep_current_graph"),
5417
5475
  simulation_ac_sweep_current_graph_id: getZodPrefixedIdWithDefault(
5418
5476
  "simulation_ac_sweep_current_graph"
5419
5477
  ),
5420
- simulation_experiment_id: z224.string(),
5478
+ simulation_experiment_id: z226.string(),
5421
5479
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
5422
- simulation_current_probe_id: z224.string(),
5423
- frequencies_hz: z224.array(z224.number()),
5424
- complex_currents: z224.array(simulation_complex_sample),
5425
- name: z224.string().optional(),
5426
- color: z224.string().optional()
5480
+ simulation_current_probe_id: z226.string(),
5481
+ frequencies_hz: z226.array(z226.number()),
5482
+ complex_currents: z226.array(simulation_complex_sample),
5483
+ name: z226.string().optional(),
5484
+ color: z226.string().optional()
5427
5485
  }).refine(
5428
5486
  (graph) => graph.frequencies_hz.length === graph.complex_currents.length,
5429
5487
  {
@@ -5433,52 +5491,52 @@ var simulation_ac_sweep_current_graph = z224.object({
5433
5491
  expectTypesMatch(true);
5434
5492
 
5435
5493
  // src/simulation/simulation_op_amp.ts
5436
- import { z as z225 } from "zod";
5437
- var simulation_op_amp = z225.object({
5438
- type: z225.literal("simulation_op_amp"),
5494
+ import { z as z227 } from "zod";
5495
+ var simulation_op_amp = z227.object({
5496
+ type: z227.literal("simulation_op_amp"),
5439
5497
  simulation_op_amp_id: getZodPrefixedIdWithDefault("simulation_op_amp"),
5440
- source_component_id: z225.string().optional(),
5441
- inverting_input_source_port_id: z225.string(),
5442
- non_inverting_input_source_port_id: z225.string(),
5443
- output_source_port_id: z225.string(),
5444
- positive_supply_source_port_id: z225.string(),
5445
- negative_supply_source_port_id: z225.string()
5498
+ source_component_id: z227.string().optional(),
5499
+ inverting_input_source_port_id: z227.string(),
5500
+ non_inverting_input_source_port_id: z227.string(),
5501
+ output_source_port_id: z227.string(),
5502
+ positive_supply_source_port_id: z227.string(),
5503
+ negative_supply_source_port_id: z227.string()
5446
5504
  }).describe("Defines a simple ideal operational amplifier for simulation");
5447
5505
  expectTypesMatch(true);
5448
5506
 
5449
5507
  // src/simulation/simulation_spice_subcircuit.ts
5450
- import { z as z226 } from "zod";
5451
- var simulation_spice_subcircuit = z226.object({
5452
- type: z226.literal("simulation_spice_subcircuit"),
5508
+ import { z as z228 } from "zod";
5509
+ var simulation_spice_subcircuit = z228.object({
5510
+ type: z228.literal("simulation_spice_subcircuit"),
5453
5511
  simulation_spice_subcircuit_id: getZodPrefixedIdWithDefault(
5454
5512
  "simulation_spice_subcircuit"
5455
5513
  ),
5456
- source_component_id: z226.string(),
5457
- spice_pin_to_source_port_map: z226.record(z226.string(), z226.string()),
5458
- subcircuit_source: z226.string()
5514
+ source_component_id: z228.string(),
5515
+ spice_pin_to_source_port_map: z228.record(z228.string(), z228.string()),
5516
+ subcircuit_source: z228.string()
5459
5517
  }).describe("Defines a custom SPICE subcircuit model for simulation");
5460
5518
  expectTypesMatch(
5461
5519
  true
5462
5520
  );
5463
5521
 
5464
5522
  // src/simulation/simulation_oscilloscope_trace.ts
5465
- import { z as z227 } from "zod";
5523
+ import { z as z229 } from "zod";
5466
5524
  var hasValue = (value) => value !== void 0;
5467
- var simulation_oscilloscope_trace = z227.object({
5468
- type: z227.literal("simulation_oscilloscope_trace"),
5525
+ var simulation_oscilloscope_trace = z229.object({
5526
+ type: z229.literal("simulation_oscilloscope_trace"),
5469
5527
  simulation_oscilloscope_trace_id: getZodPrefixedIdWithDefault(
5470
5528
  "simulation_oscilloscope_trace"
5471
5529
  ),
5472
- simulation_transient_voltage_graph_id: z227.string().optional(),
5473
- simulation_transient_current_graph_id: z227.string().optional(),
5474
- simulation_voltage_probe_id: z227.string().optional(),
5475
- simulation_current_probe_id: z227.string().optional(),
5476
- display_name: z227.string().optional(),
5477
- color: z227.string().optional(),
5478
- display_center_value: z227.number().optional(),
5479
- display_center_offset_divs: z227.number().optional(),
5480
- volts_per_div: z227.number().positive().optional(),
5481
- amps_per_div: z227.number().positive().optional()
5530
+ simulation_transient_voltage_graph_id: z229.string().optional(),
5531
+ simulation_transient_current_graph_id: z229.string().optional(),
5532
+ simulation_voltage_probe_id: z229.string().optional(),
5533
+ simulation_current_probe_id: z229.string().optional(),
5534
+ display_name: z229.string().optional(),
5535
+ color: z229.string().optional(),
5536
+ display_center_value: z229.number().optional(),
5537
+ display_center_offset_divs: z229.number().optional(),
5538
+ volts_per_div: z229.number().positive().optional(),
5539
+ amps_per_div: z229.number().positive().optional()
5482
5540
  }).describe(
5483
5541
  "Defines how a simulation measurement is rendered as an oscilloscope-style trace."
5484
5542
  ).superRefine((data, ctx) => {
@@ -5492,19 +5550,19 @@ var simulation_oscilloscope_trace = z227.object({
5492
5550
  ].filter(hasValue).length;
5493
5551
  if (voltageReferences + currentReferences !== 1) {
5494
5552
  ctx.addIssue({
5495
- code: z227.ZodIssueCode.custom,
5553
+ code: z229.ZodIssueCode.custom,
5496
5554
  message: "An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."
5497
5555
  });
5498
5556
  }
5499
5557
  if (voltageReferences > 0 && data.amps_per_div !== void 0) {
5500
5558
  ctx.addIssue({
5501
- code: z227.ZodIssueCode.custom,
5559
+ code: z229.ZodIssueCode.custom,
5502
5560
  message: "Voltage oscilloscope traces must use volts_per_div, not amps_per_div."
5503
5561
  });
5504
5562
  }
5505
5563
  if (currentReferences > 0 && data.volts_per_div !== void 0) {
5506
5564
  ctx.addIssue({
5507
- code: z227.ZodIssueCode.custom,
5565
+ code: z229.ZodIssueCode.custom,
5508
5566
  message: "Current oscilloscope traces must use amps_per_div, not volts_per_div."
5509
5567
  });
5510
5568
  }
@@ -5512,47 +5570,47 @@ var simulation_oscilloscope_trace = z227.object({
5512
5570
  expectTypesMatch(true);
5513
5571
 
5514
5572
  // src/simulation/simulation_ibis_model.ts
5515
- import { z as z228 } from "zod";
5516
- var ibisAssetPath = z228.string().min(1).regex(/^(?!\s|[a-z][a-z\d+.-]*:|[/\\])[^\\\u0000-\u001f\u007f]+$/i);
5517
- var simulation_ibis_model = z228.object({
5518
- type: z228.literal("simulation_ibis_model"),
5573
+ import { z as z230 } from "zod";
5574
+ var ibisAssetPath = z230.string().min(1).regex(/^(?!\s|[a-z][a-z\d+.-]*:|[/\\])[^\\\u0000-\u001f\u007f]+$/i);
5575
+ var simulation_ibis_model = z230.object({
5576
+ type: z230.literal("simulation_ibis_model"),
5519
5577
  simulation_ibis_model_id: getZodPrefixedIdWithDefault(
5520
5578
  "simulation_ibis_model"
5521
5579
  ),
5522
- source_component_id: z228.string().min(1),
5580
+ source_component_id: z230.string().min(1),
5523
5581
  // Consumers must still apply their own fetch policy to prevent SSRF.
5524
5582
  ibis_model_asset: asset.extend({
5525
5583
  project_relative_path: ibisAssetPath,
5526
- url: z228.string().url().regex(/^https?:\/\//i).or(ibisAssetPath)
5584
+ url: z230.string().url().regex(/^https?:\/\//i).or(ibisAssetPath)
5527
5585
  }).describe(
5528
5586
  "Reference to the .ibs file containing the vendor's IBIS models"
5529
5587
  ),
5530
- ibis_component_name: z228.string().min(1).describe("Name of the [Component] section in the IBIS file"),
5531
- ibis_pin_name_to_source_port_id: z228.record(z228.string().min(1), z228.string().min(1)).refine(
5588
+ ibis_component_name: z230.string().min(1).describe("Name of the [Component] section in the IBIS file"),
5589
+ ibis_pin_name_to_source_port_id: z230.record(z230.string().min(1), z230.string().min(1)).refine(
5532
5590
  (pins) => Object.keys(pins).length > 0,
5533
5591
  "At least one physical IBIS pin is required"
5534
5592
  ).describe(
5535
5593
  "Maps pin names from the IBIS [Pin] table, such as A1 or 12, to physical source_port_id values"
5536
5594
  ),
5537
- ibis_pin_name_to_model_name: z228.record(z228.string().min(1), z228.string().min(1)).optional().describe(
5595
+ ibis_pin_name_to_model_name: z230.record(z230.string().min(1), z230.string().min(1)).optional().describe(
5538
5596
  "Maps an IBIS pin name to the selected [Model] name when its [Model Selector] has multiple buffers"
5539
5597
  ),
5540
- ibis_pin_name_to_reference_source_port_ids: z228.record(
5541
- z228.string().min(1),
5542
- z228.object({
5543
- pullup_reference_source_port_id: z228.string().min(1).optional(),
5544
- pulldown_reference_source_port_id: z228.string().min(1).optional(),
5545
- power_clamp_reference_source_port_id: z228.string().min(1).optional(),
5546
- ground_clamp_reference_source_port_id: z228.string().min(1).optional(),
5547
- external_reference_source_port_id: z228.string().min(1).optional()
5598
+ ibis_pin_name_to_reference_source_port_ids: z230.record(
5599
+ z230.string().min(1),
5600
+ z230.object({
5601
+ pullup_reference_source_port_id: z230.string().min(1).optional(),
5602
+ pulldown_reference_source_port_id: z230.string().min(1).optional(),
5603
+ power_clamp_reference_source_port_id: z230.string().min(1).optional(),
5604
+ ground_clamp_reference_source_port_id: z230.string().min(1).optional(),
5605
+ external_reference_source_port_id: z230.string().min(1).optional()
5548
5606
  }).strict()
5549
5607
  ).optional().describe(
5550
5608
  "Maps each IBIS signal pin name to the physical source ports used as its buffer supply/clamp references"
5551
5609
  ),
5552
- model_value_corner: z228.union([z228.literal("typical"), z228.literal("minimum"), z228.literal("maximum")]).describe(
5610
+ model_value_corner: z230.union([z230.literal("typical"), z230.literal("minimum"), z230.literal("maximum")]).describe(
5553
5611
  "Selects the typ, min, or max column of numerical data in the IBIS model"
5554
5612
  ),
5555
- include_package_parasitics: z228.boolean().describe(
5613
+ include_package_parasitics: z230.boolean().describe(
5556
5614
  "Whether the runner includes the IBIS vendor's package resistance, inductance, and capacitance"
5557
5615
  )
5558
5616
  }).superRefine((model, context) => {
@@ -5566,7 +5624,7 @@ var simulation_ibis_model = z228.object({
5566
5624
  for (const pin of Object.keys(model[field] ?? {})) {
5567
5625
  if (!boundPins.has(pin)) {
5568
5626
  context.addIssue({
5569
- code: z228.ZodIssueCode.custom,
5627
+ code: z230.ZodIssueCode.custom,
5570
5628
  path: [field, pin],
5571
5629
  message: `IBIS pin "${pin}" must be bound in ibis_pin_name_to_source_port_id`
5572
5630
  });
@@ -5578,22 +5636,22 @@ var simulation_ibis_model = z228.object({
5578
5636
  );
5579
5637
 
5580
5638
  // src/simulation/simulation_ibis_pin_state.ts
5581
- import { z as z229 } from "zod";
5582
- var simulation_ibis_pin_state = z229.object({
5583
- type: z229.literal("simulation_ibis_pin_state"),
5639
+ import { z as z231 } from "zod";
5640
+ var simulation_ibis_pin_state = z231.object({
5641
+ type: z231.literal("simulation_ibis_pin_state"),
5584
5642
  simulation_ibis_pin_state_id: getZodPrefixedIdWithDefault(
5585
5643
  "simulation_ibis_pin_state"
5586
5644
  ),
5587
- simulation_experiment_id: z229.string().min(1),
5588
- source_port_id: z229.string().min(1),
5589
- is_output: z229.boolean().describe(
5645
+ simulation_experiment_id: z231.string().min(1),
5646
+ source_port_id: z231.string().min(1),
5647
+ is_output: z231.boolean().describe(
5590
5648
  "True selects output mode; false selects input mode for this experiment"
5591
5649
  ),
5592
- is_output_enabled: z229.boolean().optional()
5650
+ is_output_enabled: z231.boolean().optional()
5593
5651
  }).superRefine((pin, context) => {
5594
5652
  if (pin.is_output && pin.is_output_enabled === void 0 || !pin.is_output && pin.is_output_enabled !== void 0) {
5595
5653
  context.addIssue({
5596
- code: z229.ZodIssueCode.custom,
5654
+ code: z231.ZodIssueCode.custom,
5597
5655
  path: ["is_output_enabled"],
5598
5656
  message: "Only output pins require an explicit is_output_enabled boolean"
5599
5657
  });
@@ -5603,41 +5661,41 @@ var simulation_ibis_pin_state = z229.object({
5603
5661
  );
5604
5662
 
5605
5663
  // src/simulation/simulation_digital_stimulus.ts
5606
- import { z as z230 } from "zod";
5664
+ import { z as z232 } from "zod";
5607
5665
  var MAX_PATTERN_BITS = 65536;
5608
- var simulation_digital_stimulus = z230.object({
5609
- type: z230.literal("simulation_digital_stimulus"),
5666
+ var simulation_digital_stimulus = z232.object({
5667
+ type: z232.literal("simulation_digital_stimulus"),
5610
5668
  simulation_digital_stimulus_id: getZodPrefixedIdWithDefault(
5611
5669
  "simulation_digital_stimulus"
5612
5670
  ),
5613
- name: z230.string().min(1),
5614
- simulation_experiment_id: z230.string().min(1),
5615
- source_port_id: z230.string().min(1),
5671
+ name: z232.string().min(1),
5672
+ simulation_experiment_id: z232.string().min(1),
5673
+ source_port_id: z232.string().min(1),
5616
5674
  bit_duration_ms: ms.refine((milliseconds) => milliseconds > 0),
5617
5675
  start_time_ms: ms.refine((milliseconds) => milliseconds >= 0),
5618
- initial_state: z230.union([z230.literal(0), z230.literal(1)]),
5619
- inverted: z230.boolean(),
5620
- transmission_pattern: z230.object({
5621
- transmission_type: z230.literal("bits"),
5622
- bits: z230.string().max(MAX_PATTERN_BITS).regex(/^[01]+$/).or(
5623
- z230.array(z230.union([z230.literal(0), z230.literal(1)])).min(1).max(MAX_PATTERN_BITS)
5676
+ initial_state: z232.union([z232.literal(0), z232.literal(1)]),
5677
+ inverted: z232.boolean(),
5678
+ transmission_pattern: z232.object({
5679
+ transmission_type: z232.literal("bits"),
5680
+ bits: z232.string().max(MAX_PATTERN_BITS).regex(/^[01]+$/).or(
5681
+ z232.array(z232.union([z232.literal(0), z232.literal(1)])).min(1).max(MAX_PATTERN_BITS)
5624
5682
  ),
5625
- repeat: z230.boolean()
5683
+ repeat: z232.boolean()
5626
5684
  }).strict()
5627
5685
  }).describe(
5628
5686
  "Declares a digital transmission pattern and bit duration in milliseconds for a physical source port"
5629
5687
  );
5630
5688
 
5631
5689
  // src/simulation/simulation_eye_diagram.ts
5632
- import { z as z231 } from "zod";
5633
- var simulation_eye_diagram = z231.object({
5634
- type: z231.literal("simulation_eye_diagram"),
5690
+ import { z as z233 } from "zod";
5691
+ var simulation_eye_diagram = z233.object({
5692
+ type: z233.literal("simulation_eye_diagram"),
5635
5693
  simulation_eye_diagram_id: getZodPrefixedIdWithDefault(
5636
5694
  "simulation_eye_diagram"
5637
5695
  ),
5638
- name: z231.string().min(1),
5639
- simulation_experiment_id: z231.string().min(1),
5640
- simulation_voltage_probe_id: z231.string().min(1),
5696
+ name: z233.string().min(1),
5697
+ simulation_experiment_id: z233.string().min(1),
5698
+ simulation_voltage_probe_id: z233.string().min(1),
5641
5699
  unit_interval_ms: ms.refine((milliseconds) => milliseconds > 0),
5642
5700
  time_origin_ms: ms,
5643
5701
  start_time_ms: ms.refine((milliseconds) => milliseconds >= 0).optional(),
@@ -5645,7 +5703,7 @@ var simulation_eye_diagram = z231.object({
5645
5703
  }).superRefine((eye, context) => {
5646
5704
  if (eye.start_time_ms !== void 0 && eye.end_time_ms !== void 0 && eye.start_time_ms >= eye.end_time_ms) {
5647
5705
  context.addIssue({
5648
- code: z231.ZodIssueCode.custom,
5706
+ code: z233.ZodIssueCode.custom,
5649
5707
  path: ["end_time_ms"],
5650
5708
  message: "Eye gate end must follow its start"
5651
5709
  });
@@ -5655,51 +5713,51 @@ var simulation_eye_diagram = z231.object({
5655
5713
  );
5656
5714
 
5657
5715
  // src/simulation/simulation_return_current_contact.ts
5658
- import { z as z232 } from "zod";
5659
- var contact_position = z232.object({
5660
- x: z232.number().finite(),
5661
- y: z232.number().finite(),
5716
+ import { z as z234 } from "zod";
5717
+ var contact_position = z234.object({
5718
+ x: z234.number().finite(),
5719
+ y: z234.number().finite(),
5662
5720
  layer: layer_ref
5663
5721
  });
5664
- var simulation_return_current_contact = z232.discriminatedUnion("contact_type", [
5722
+ var simulation_return_current_contact = z234.discriminatedUnion("contact_type", [
5665
5723
  contact_position.extend({
5666
- contact_type: z232.literal("pcb_port"),
5667
- pcb_port_id: z232.string().min(1)
5724
+ contact_type: z234.literal("pcb_port"),
5725
+ pcb_port_id: z234.string().min(1)
5668
5726
  }),
5669
5727
  contact_position.extend({
5670
- contact_type: z232.literal("pcb_via"),
5671
- pcb_via_id: z232.string().min(1)
5728
+ contact_type: z234.literal("pcb_via"),
5729
+ pcb_via_id: z234.string().min(1)
5672
5730
  }),
5673
5731
  contact_position.extend({
5674
- contact_type: z232.literal("pcb_copper_pour"),
5675
- pcb_copper_pour_id: z232.string().min(1)
5732
+ contact_type: z234.literal("pcb_copper_pour"),
5733
+ pcb_copper_pour_id: z234.string().min(1)
5676
5734
  })
5677
5735
  ]).describe("Identifies the reference conductor at a return-current contact");
5678
5736
  expectTypesMatch(true);
5679
5737
 
5680
5738
  // src/simulation/simulation_terminal_port.ts
5681
- import { z as z233 } from "zod";
5682
- var simulation_terminal_port = z233.object({
5683
- signal_pcb_port_id: z233.string().min(1),
5684
- reference_pcb_port_id: z233.string().min(1).optional(),
5739
+ import { z as z235 } from "zod";
5740
+ var simulation_terminal_port = z235.object({
5741
+ signal_pcb_port_id: z235.string().min(1),
5742
+ reference_pcb_port_id: z235.string().min(1).optional(),
5685
5743
  reference_layer: layer_ref,
5686
- resistance: z233.number().finite().positive()
5744
+ resistance: z235.number().finite().positive()
5687
5745
  }).describe(
5688
5746
  "A two-terminal return-current excitation port with resistance in ohms"
5689
5747
  );
5690
5748
  expectTypesMatch(true);
5691
5749
 
5692
5750
  // src/simulation/simulation_return_current_excitation.ts
5693
- import { z as z234 } from "zod";
5694
- var simulation_return_current_excitation = z234.object({
5695
- type: z234.literal("simulation_return_current_excitation"),
5751
+ import { z as z236 } from "zod";
5752
+ var simulation_return_current_excitation = z236.object({
5753
+ type: z236.literal("simulation_return_current_excitation"),
5696
5754
  simulation_return_current_excitation_id: getZodPrefixedIdWithDefault(
5697
5755
  "simulation_return_current_excitation"
5698
5756
  ),
5699
- simulation_experiment_id: z234.string().min(1),
5700
- pcb_trace_id: z234.string().min(1),
5701
- ground_source_net_id: z234.string().min(1),
5702
- current: z234.number().finite(),
5757
+ simulation_experiment_id: z236.string().min(1),
5758
+ pcb_trace_id: z236.string().min(1),
5759
+ ground_source_net_id: z236.string().min(1),
5760
+ current: z236.number().finite(),
5703
5761
  return_source: simulation_return_current_contact,
5704
5762
  return_sink: simulation_return_current_contact,
5705
5763
  source_port: simulation_terminal_port.optional(),
@@ -5710,34 +5768,34 @@ var simulation_return_current_excitation = z234.object({
5710
5768
  expectTypesMatch(true);
5711
5769
 
5712
5770
  // src/simulation/simulation_pcb_return_current_result.ts
5713
- import { z as z235 } from "zod";
5714
- var simulation_pcb_return_current_result = z235.object({
5715
- type: z235.literal("simulation_pcb_return_current_result"),
5771
+ import { z as z237 } from "zod";
5772
+ var simulation_pcb_return_current_result = z237.object({
5773
+ type: z237.literal("simulation_pcb_return_current_result"),
5716
5774
  simulation_pcb_return_current_result_id: getZodPrefixedIdWithDefault(
5717
5775
  "simulation_pcb_return_current_result"
5718
5776
  ),
5719
- simulation_experiment_id: z235.string().min(1),
5720
- pcb_board_id: z235.string().min(1),
5721
- simulation_return_current_excitation_ids: z235.array(z235.string().min(1)).min(1).refine(
5777
+ simulation_experiment_id: z237.string().min(1),
5778
+ pcb_board_id: z237.string().min(1),
5779
+ simulation_return_current_excitation_ids: z237.array(z237.string().min(1)).min(1).refine(
5722
5780
  (ids) => new Set(ids).size === ids.length,
5723
5781
  "Excitation IDs must be unique"
5724
5782
  ),
5725
- frequency_hz: z235.number().finite().positive().optional()
5783
+ frequency_hz: z237.number().finite().positive().optional()
5726
5784
  }).describe(
5727
5785
  "A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent"
5728
5786
  );
5729
5787
  expectTypesMatch(true);
5730
5788
 
5731
5789
  // src/simulation/simulation_return_current_asset.ts
5732
- import { z as z236 } from "zod";
5790
+ import { z as z238 } from "zod";
5733
5791
  function createSimulationReturnCurrentAssetSchema(mimetypes) {
5734
5792
  return asset.extend({
5735
- project_relative_path: z236.string().min(1),
5736
- url: z236.string().url()
5793
+ project_relative_path: z238.string().min(1),
5794
+ url: z238.string().url()
5737
5795
  }).superRefine((value, context) => {
5738
5796
  if (!mimetypes.includes(value.mimetype)) {
5739
5797
  context.addIssue({
5740
- code: z236.ZodIssueCode.custom,
5798
+ code: z238.ZodIssueCode.custom,
5741
5799
  path: ["mimetype"],
5742
5800
  message: `Expected one of: ${mimetypes.join(", ")}`
5743
5801
  });
@@ -5746,7 +5804,7 @@ function createSimulationReturnCurrentAssetSchema(mimetypes) {
5746
5804
  const mediaType = /^data:([^;,]*)(?:;[^,]*)?,/i.exec(value.url)?.[1];
5747
5805
  if (mediaType?.toLowerCase() !== value.mimetype) {
5748
5806
  context.addIssue({
5749
- code: z236.ZodIssueCode.custom,
5807
+ code: z238.ZodIssueCode.custom,
5750
5808
  path: ["url"],
5751
5809
  message: "Data URL media type must match asset.mimetype"
5752
5810
  });
@@ -5761,29 +5819,29 @@ var simulation_return_current_field_asset = createSimulationReturnCurrentAssetSc
5761
5819
  var simulation_return_current_image_asset = createSimulationReturnCurrentAssetSchema(["image/png", "image/webp"]);
5762
5820
 
5763
5821
  // src/simulation/simulation_pcb_return_current_field.ts
5764
- import { z as z237 } from "zod";
5765
- var simulation_pcb_return_current_field = z237.object({
5766
- type: z237.literal("simulation_pcb_return_current_field"),
5822
+ import { z as z239 } from "zod";
5823
+ var simulation_pcb_return_current_field = z239.object({
5824
+ type: z239.literal("simulation_pcb_return_current_field"),
5767
5825
  simulation_pcb_return_current_field_id: getZodPrefixedIdWithDefault(
5768
5826
  "simulation_pcb_return_current_field"
5769
5827
  ),
5770
- simulation_pcb_return_current_result_id: z237.string().min(1),
5828
+ simulation_pcb_return_current_result_id: z239.string().min(1),
5771
5829
  layer: layer_ref,
5772
- source_net_id: z237.string().min(1),
5773
- field_type: z237.enum(["real", "complex_phasor"]),
5774
- min_x: z237.number().finite(),
5775
- min_y: z237.number().finite(),
5776
- columns: z237.number().int().positive().safe(),
5777
- rows: z237.number().int().positive().safe(),
5778
- cell_width: z237.number().finite().positive(),
5779
- cell_height: z237.number().finite().positive(),
5780
- copper_thickness: z237.number().finite().positive(),
5781
- data_format: z237.literal("simulation_return_current_grid_json_v1"),
5830
+ source_net_id: z239.string().min(1),
5831
+ field_type: z239.enum(["real", "complex_phasor"]),
5832
+ min_x: z239.number().finite(),
5833
+ min_y: z239.number().finite(),
5834
+ columns: z239.number().int().positive().safe(),
5835
+ rows: z239.number().int().positive().safe(),
5836
+ cell_width: z239.number().finite().positive(),
5837
+ cell_height: z239.number().finite().positive(),
5838
+ copper_thickness: z239.number().finite().positive(),
5839
+ data_format: z239.literal("simulation_return_current_grid_json_v1"),
5782
5840
  field_asset: simulation_return_current_field_asset
5783
5841
  }).superRefine((field, context) => {
5784
5842
  if (!Number.isSafeInteger(field.columns * field.rows)) {
5785
5843
  context.addIssue({
5786
- code: z237.ZodIssueCode.custom,
5844
+ code: z239.ZodIssueCode.custom,
5787
5845
  path: ["columns"],
5788
5846
  message: "The grid cell count must be a safe integer"
5789
5847
  });
@@ -5794,16 +5852,16 @@ var simulation_pcb_return_current_field = z237.object({
5794
5852
  expectTypesMatch(true);
5795
5853
 
5796
5854
  // src/simulation/simulation_return_current_grid_json.ts
5797
- import { z as z238 } from "zod";
5798
- var channel = z238.array(z238.number().finite().nullable()).min(1);
5799
- var simulation_return_current_grid_json = z238.discriminatedUnion("field_type", [
5800
- z238.object({
5801
- field_type: z238.literal("real"),
5855
+ import { z as z240 } from "zod";
5856
+ var channel = z240.array(z240.number().finite().nullable()).min(1);
5857
+ var simulation_return_current_grid_json = z240.discriminatedUnion("field_type", [
5858
+ z240.object({
5859
+ field_type: z240.literal("real"),
5802
5860
  sheet_current_x: channel,
5803
5861
  sheet_current_y: channel
5804
5862
  }),
5805
- z238.object({
5806
- field_type: z238.literal("complex_phasor"),
5863
+ z240.object({
5864
+ field_type: z240.literal("complex_phasor"),
5807
5865
  sheet_current_x_real: channel,
5808
5866
  sheet_current_x_imag: channel,
5809
5867
  sheet_current_y_real: channel,
@@ -5819,7 +5877,7 @@ var simulation_return_current_grid_json = z238.discriminatedUnion("field_type",
5819
5877
  const first = channels[0];
5820
5878
  if (channels.some((values) => values.length !== first.length)) {
5821
5879
  context.addIssue({
5822
- code: z238.ZodIssueCode.custom,
5880
+ code: z240.ZodIssueCode.custom,
5823
5881
  message: "Current channels must have equal lengths"
5824
5882
  });
5825
5883
  return;
@@ -5828,7 +5886,7 @@ var simulation_return_current_grid_json = z238.discriminatedUnion("field_type",
5828
5886
  const masked = first[index] === null;
5829
5887
  if (channels.some((values) => values[index] === null !== masked)) {
5830
5888
  context.addIssue({
5831
- code: z238.ZodIssueCode.custom,
5889
+ code: z240.ZodIssueCode.custom,
5832
5890
  message: `Cell ${index} must be null in every channel or finite in every channel`
5833
5891
  });
5834
5892
  return;
@@ -5845,7 +5903,7 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
5845
5903
  return simulation_return_current_grid_json.superRefine((grid, context) => {
5846
5904
  if (grid.field_type !== field.field_type) {
5847
5905
  context.addIssue({
5848
- code: z238.ZodIssueCode.custom,
5906
+ code: z240.ZodIssueCode.custom,
5849
5907
  path: ["field_type"],
5850
5908
  message: "Decoded field_type must match the parent field"
5851
5909
  });
@@ -5853,7 +5911,7 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
5853
5911
  const first = grid.field_type === "real" ? grid.sheet_current_x : grid.sheet_current_x_real;
5854
5912
  if (first.length !== count) {
5855
5913
  context.addIssue({
5856
- code: z238.ZodIssueCode.custom,
5914
+ code: z240.ZodIssueCode.custom,
5857
5915
  message: `Each current channel must have ${count} entries (columns * rows)`
5858
5916
  });
5859
5917
  }
@@ -5861,25 +5919,25 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
5861
5919
  }
5862
5920
 
5863
5921
  // src/simulation/simulation_pcb_return_current_heatmap.ts
5864
- import { z as z239 } from "zod";
5865
- var simulation_pcb_return_current_heatmap = z239.object({
5866
- type: z239.literal("simulation_pcb_return_current_heatmap"),
5922
+ import { z as z241 } from "zod";
5923
+ var simulation_pcb_return_current_heatmap = z241.object({
5924
+ type: z241.literal("simulation_pcb_return_current_heatmap"),
5867
5925
  simulation_pcb_return_current_heatmap_id: getZodPrefixedIdWithDefault(
5868
5926
  "simulation_pcb_return_current_heatmap"
5869
5927
  ),
5870
- simulation_pcb_return_current_result_id: z239.string().min(1),
5928
+ simulation_pcb_return_current_result_id: z241.string().min(1),
5871
5929
  layer: layer_ref,
5872
- source_net_id: z239.string().min(1),
5873
- min_x: z239.number().finite(),
5874
- min_y: z239.number().finite(),
5875
- max_x: z239.number().finite(),
5876
- max_y: z239.number().finite(),
5930
+ source_net_id: z241.string().min(1),
5931
+ min_x: z241.number().finite(),
5932
+ min_y: z241.number().finite(),
5933
+ max_x: z241.number().finite(),
5934
+ max_y: z241.number().finite(),
5877
5935
  image_asset: simulation_return_current_image_asset
5878
5936
  }).superRefine((heatmap, context) => {
5879
5937
  for (const axis of ["x", "y"]) {
5880
5938
  if (heatmap[`max_${axis}`] <= heatmap[`min_${axis}`]) {
5881
5939
  context.addIssue({
5882
- code: z239.ZodIssueCode.custom,
5940
+ code: z241.ZodIssueCode.custom,
5883
5941
  path: [`max_${axis}`],
5884
5942
  message: "Heatmap bounds must have positive width and height"
5885
5943
  });
@@ -5891,14 +5949,14 @@ var simulation_pcb_return_current_heatmap = z239.object({
5891
5949
  expectTypesMatch(true);
5892
5950
 
5893
5951
  // src/simulation/simulation_pcb_return_current_marker.ts
5894
- import { z as z240 } from "zod";
5895
- var marker_base = z240.object({
5896
- type: z240.literal("simulation_pcb_return_current_marker"),
5952
+ import { z as z242 } from "zod";
5953
+ var marker_base = z242.object({
5954
+ type: z242.literal("simulation_pcb_return_current_marker"),
5897
5955
  simulation_pcb_return_current_marker_id: getZodPrefixedIdWithDefault(
5898
5956
  "simulation_pcb_return_current_marker"
5899
5957
  ),
5900
- simulation_pcb_return_current_result_id: z240.string().min(1),
5901
- role: z240.enum([
5958
+ simulation_pcb_return_current_result_id: z242.string().min(1),
5959
+ role: z242.enum([
5902
5960
  "signal_source",
5903
5961
  "signal_load",
5904
5962
  "return_source",
@@ -5906,33 +5964,33 @@ var marker_base = z240.object({
5906
5964
  "signal_transition",
5907
5965
  "return_transition"
5908
5966
  ]),
5909
- label: z240.string().optional(),
5910
- label_x: z240.number().finite().optional(),
5911
- label_y: z240.number().finite().optional()
5967
+ label: z242.string().optional(),
5968
+ label_x: z242.number().finite().optional(),
5969
+ label_y: z242.number().finite().optional()
5912
5970
  });
5913
- var simulation_pcb_return_current_marker = z240.discriminatedUnion("target_type", [
5971
+ var simulation_pcb_return_current_marker = z242.discriminatedUnion("target_type", [
5914
5972
  marker_base.extend({
5915
- target_type: z240.literal("pcb_port"),
5916
- pcb_port_id: z240.string().min(1),
5973
+ target_type: z242.literal("pcb_port"),
5974
+ pcb_port_id: z242.string().min(1),
5917
5975
  layer: layer_ref
5918
5976
  }),
5919
5977
  marker_base.extend({
5920
- target_type: z240.literal("pcb_via"),
5921
- pcb_via_id: z240.string().min(1),
5978
+ target_type: z242.literal("pcb_via"),
5979
+ pcb_via_id: z242.string().min(1),
5922
5980
  from_layer: layer_ref,
5923
5981
  to_layer: layer_ref
5924
5982
  })
5925
5983
  ]).superRefine((marker, context) => {
5926
5984
  if (marker.label_x === void 0 !== (marker.label_y === void 0)) {
5927
5985
  context.addIssue({
5928
- code: z240.ZodIssueCode.custom,
5986
+ code: z242.ZodIssueCode.custom,
5929
5987
  path: ["label_x"],
5930
5988
  message: "label_x and label_y must be provided together"
5931
5989
  });
5932
5990
  }
5933
5991
  if (marker.target_type === "pcb_via" && marker.from_layer === marker.to_layer) {
5934
5992
  context.addIssue({
5935
- code: z240.ZodIssueCode.custom,
5993
+ code: z242.ZodIssueCode.custom,
5936
5994
  path: ["to_layer"],
5937
5995
  message: "A via transition must connect distinct layers"
5938
5996
  });
@@ -5943,13 +6001,13 @@ var simulation_pcb_return_current_marker = z240.discriminatedUnion("target_type"
5943
6001
  expectTypesMatch(true);
5944
6002
 
5945
6003
  // src/any_circuit_element.ts
5946
- import { z as z246 } from "zod";
6004
+ import { z as z248 } from "zod";
5947
6005
 
5948
6006
  // src/drawing/drawing_page.ts
5949
- import { z as z242 } from "zod";
6007
+ import { z as z244 } from "zod";
5950
6008
 
5951
6009
  // src/drawing/drawing_page_size.ts
5952
- import { z as z241 } from "zod";
6010
+ import { z as z243 } from "zod";
5953
6011
  var drawingPageSizes = {
5954
6012
  iso_a0: [1189, 841],
5955
6013
  iso_a1: [841, 594],
@@ -5962,7 +6020,7 @@ var drawingPageSizes = {
5962
6020
  ansi_d: [863.6, 558.8],
5963
6021
  ansi_e: [1117.6, 863.6]
5964
6022
  };
5965
- var drawing_page_size = z241.enum([
6023
+ var drawing_page_size = z243.enum([
5966
6024
  "iso_a0",
5967
6025
  "iso_a1",
5968
6026
  "iso_a2",
@@ -5980,15 +6038,15 @@ function getDrawingPageDimensions(size2, orientation = "landscape") {
5980
6038
  }
5981
6039
 
5982
6040
  // src/drawing/drawing_page.ts
5983
- var drawing_page = z242.object({
5984
- type: z242.literal("drawing_page"),
5985
- drawing_page_id: z242.string().min(1),
5986
- name: z242.string().optional(),
5987
- display_name: z242.string().optional(),
6041
+ var drawing_page = z244.object({
6042
+ type: z244.literal("drawing_page"),
6043
+ drawing_page_id: z244.string().min(1),
6044
+ name: z244.string().optional(),
6045
+ display_name: z244.string().optional(),
5988
6046
  page_size: drawing_page_size.optional(),
5989
- orientation: z242.enum(["landscape", "portrait"]).optional(),
5990
- width: z242.number().finite().positive(),
5991
- height: z242.number().finite().positive()
6047
+ orientation: z244.enum(["landscape", "portrait"]).optional(),
6048
+ width: z244.number().finite().positive(),
6049
+ height: z244.number().finite().positive()
5992
6050
  }).superRefine((page, ctx) => {
5993
6051
  if (!page.page_size) {
5994
6052
  if (page.orientation)
@@ -6012,8 +6070,8 @@ var drawing_page = z242.object({
6012
6070
  expectTypesMatch(true);
6013
6071
 
6014
6072
  // src/drawing/drawing_part_view.ts
6015
- import { z as z243 } from "zod";
6016
- var drawing_part_view_direction = z243.enum([
6073
+ import { z as z245 } from "zod";
6074
+ var drawing_part_view_direction = z245.enum([
6017
6075
  "x_positive",
6018
6076
  "x_negative",
6019
6077
  "y_positive",
@@ -6022,26 +6080,26 @@ var drawing_part_view_direction = z243.enum([
6022
6080
  "z_negative",
6023
6081
  "isometric"
6024
6082
  ]);
6025
- var drawing_section_plane = z243.object({
6026
- axis: z243.enum(["x", "y", "z"]),
6027
- offset: z243.number().finite(),
6028
- keep_side: z243.enum(["less", "greater"]),
6029
- hatch_spacing: z243.number().finite().positive().optional()
6030
- });
6031
- var drawing_part_view = z243.object({
6032
- type: z243.literal("drawing_part_view"),
6033
- drawing_part_view_id: z243.string().min(1),
6034
- drawing_page_id: z243.string().min(1),
6035
- source_group_id: z243.string().min(1).optional(),
6036
- source_component_ids: z243.array(z243.string().min(1)).optional(),
6037
- name: z243.string().optional(),
6038
- display_name: z243.string().optional(),
6083
+ var drawing_section_plane = z245.object({
6084
+ axis: z245.enum(["x", "y", "z"]),
6085
+ offset: z245.number().finite(),
6086
+ keep_side: z245.enum(["less", "greater"]),
6087
+ hatch_spacing: z245.number().finite().positive().optional()
6088
+ });
6089
+ var drawing_part_view = z245.object({
6090
+ type: z245.literal("drawing_part_view"),
6091
+ drawing_part_view_id: z245.string().min(1),
6092
+ drawing_page_id: z245.string().min(1),
6093
+ source_group_id: z245.string().min(1).optional(),
6094
+ source_component_ids: z245.array(z245.string().min(1)).optional(),
6095
+ name: z245.string().optional(),
6096
+ display_name: z245.string().optional(),
6039
6097
  direction: drawing_part_view_direction,
6040
- center: z243.object({ x: z243.number().finite(), y: z243.number().finite() }),
6041
- width: z243.number().finite().positive(),
6042
- height: z243.number().finite().positive(),
6043
- scale: z243.number().finite().positive().optional(),
6044
- show_hidden_edges: z243.boolean().optional(),
6098
+ center: z245.object({ x: z245.number().finite(), y: z245.number().finite() }),
6099
+ width: z245.number().finite().positive(),
6100
+ height: z245.number().finite().positive(),
6101
+ scale: z245.number().finite().positive().optional(),
6102
+ show_hidden_edges: z245.boolean().optional(),
6045
6103
  section: drawing_section_plane.optional()
6046
6104
  }).describe(
6047
6105
  "A configured orthographic view of selected assembly geometry. Paper coordinates are mm, origin at sheet center, +X right/+Y up. Directions and section planes use CAD world coordinates in mm with +Z up."
@@ -6052,20 +6110,20 @@ expectTypesMatch(
6052
6110
  expectTypesMatch(true);
6053
6111
 
6054
6112
  // src/drawing/drawing_page_title_block.ts
6055
- import { z as z244 } from "zod";
6056
- var drawing_page_title_block = z244.object({
6057
- type: z244.literal("drawing_page_title_block"),
6058
- drawing_page_title_block_id: z244.string().min(1),
6059
- drawing_page_id: z244.string().min(1),
6060
- title: z244.string().min(1),
6061
- legal_owner: z244.string().optional(),
6062
- identification_number: z244.string().optional(),
6063
- revision_index: z244.string().optional(),
6064
- date_of_issue: z244.string().optional(),
6065
- creator: z244.string().optional(),
6066
- approval_person: z244.string().optional(),
6067
- sheet_number: z244.number().int().positive().optional(),
6068
- number_of_sheets: z244.number().int().positive().optional()
6113
+ import { z as z246 } from "zod";
6114
+ var drawing_page_title_block = z246.object({
6115
+ type: z246.literal("drawing_page_title_block"),
6116
+ drawing_page_title_block_id: z246.string().min(1),
6117
+ drawing_page_id: z246.string().min(1),
6118
+ title: z246.string().min(1),
6119
+ legal_owner: z246.string().optional(),
6120
+ identification_number: z246.string().optional(),
6121
+ revision_index: z246.string().optional(),
6122
+ date_of_issue: z246.string().optional(),
6123
+ creator: z246.string().optional(),
6124
+ approval_person: z246.string().optional(),
6125
+ sheet_number: z246.number().int().positive().optional(),
6126
+ number_of_sheets: z246.number().int().positive().optional()
6069
6127
  }).refine(
6070
6128
  (block) => block.sheet_number == null || block.number_of_sheets == null || block.sheet_number <= block.number_of_sheets,
6071
6129
  {
@@ -6076,28 +6134,28 @@ var drawing_page_title_block = z244.object({
6076
6134
  expectTypesMatch(true);
6077
6135
 
6078
6136
  // src/drawing/drawing_dimension_line.ts
6079
- import { z as z245 } from "zod";
6080
- var paper_point = z245.object({
6081
- x: z245.number().finite(),
6082
- y: z245.number().finite()
6083
- });
6084
- var drawing_dimension_line = z245.object({
6085
- type: z245.literal("drawing_dimension_line"),
6086
- drawing_dimension_line_id: z245.string().trim().min(1),
6087
- drawing_part_view_id: z245.string().trim().min(1),
6137
+ import { z as z247 } from "zod";
6138
+ var paper_point = z247.object({
6139
+ x: z247.number().finite(),
6140
+ y: z247.number().finite()
6141
+ });
6142
+ var drawing_dimension_line = z247.object({
6143
+ type: z247.literal("drawing_dimension_line"),
6144
+ drawing_dimension_line_id: z247.string().trim().min(1),
6145
+ drawing_part_view_id: z247.string().trim().min(1),
6088
6146
  start: paper_point,
6089
6147
  end: paper_point,
6090
- text: z245.string().refine(
6148
+ text: z247.string().refine(
6091
6149
  (text) => text.trim().length > 0,
6092
6150
  "Dimension text must not be blank"
6093
6151
  ),
6094
6152
  edge_ref_start: paper_point.optional(),
6095
6153
  edge_ref_end: paper_point.optional(),
6096
- edge_ref_name: z245.string().refine(
6154
+ edge_ref_name: z247.string().refine(
6097
6155
  (name) => name.trim().length > 0,
6098
6156
  "Edge reference name must not be blank"
6099
6157
  ).optional(),
6100
- name: z245.string().trim().min(1).optional()
6158
+ name: z247.string().trim().min(1).optional()
6101
6159
  }).refine(
6102
6160
  (line) => line.start.x !== line.end.x || line.start.y !== line.end.y,
6103
6161
  { message: "Dimension line endpoints must be distinct", path: ["end"] }
@@ -6109,7 +6167,7 @@ expectTypesMatch(
6109
6167
  );
6110
6168
 
6111
6169
  // src/any_circuit_element.ts
6112
- var any_circuit_element = z246.union([
6170
+ var any_circuit_element = z248.union([
6113
6171
  pcb_quote_estimate,
6114
6172
  drawing_page,
6115
6173
  drawing_page_title_block,
@@ -6276,6 +6334,8 @@ var any_circuit_element = z246.union([
6276
6334
  schematic_table,
6277
6335
  schematic_table_cell,
6278
6336
  cad_component,
6337
+ cad_explosion_stage,
6338
+ cad_explosion_move,
6279
6339
  cad_cable,
6280
6340
  cad_reference_surface,
6281
6341
  cad_collision_error,
@@ -6324,6 +6384,8 @@ export {
6324
6384
  cad_cable,
6325
6385
  cad_collision_error,
6326
6386
  cad_component,
6387
+ cad_explosion_move,
6388
+ cad_explosion_stage,
6327
6389
  cad_model_axis_directions,
6328
6390
  cad_model_formats,
6329
6391
  cad_reference_surface,