circuit-json 0.0.528 → 0.0.530
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 +2 -0
- package/dist/index.d.mts +943 -33
- package/dist/index.mjs +257 -89
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,20 @@ var length = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v)
|
|
|
14
14
|
var frequency = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "Hz").value);
|
|
15
15
|
var distance = length;
|
|
16
16
|
var current = z.string().or(z.number()).transform((v) => parseAndConvertSiUnit(v, "A").value);
|
|
17
|
-
var duration_ms = z.string().or(z.number()).transform((v) =>
|
|
17
|
+
var duration_ms = z.string().or(z.number()).transform((v, context) => {
|
|
18
|
+
try {
|
|
19
|
+
const { value, unitOfValue } = parseAndConvertSiUnit(v);
|
|
20
|
+
if ((unitOfValue === null || unitOfValue === "ms") && Number.isFinite(value)) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
context.addIssue({
|
|
26
|
+
code: z.ZodIssueCode.custom,
|
|
27
|
+
message: "Expected a finite number of milliseconds or a time unit"
|
|
28
|
+
});
|
|
29
|
+
return z.NEVER;
|
|
30
|
+
});
|
|
18
31
|
var time = duration_ms;
|
|
19
32
|
var ms = duration_ms;
|
|
20
33
|
var timestamp = z.string().datetime();
|
|
@@ -2078,6 +2091,7 @@ var pcb_component = z116.object({
|
|
|
2078
2091
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
2079
2092
|
source_component_id: z116.string(),
|
|
2080
2093
|
center: point,
|
|
2094
|
+
footprint_origin: point.optional(),
|
|
2081
2095
|
layer: layer_ref,
|
|
2082
2096
|
rotation,
|
|
2083
2097
|
display_offset_x: z116.string().optional().describe(
|
|
@@ -4761,6 +4775,8 @@ var simulation_experiment = z206.object({
|
|
|
4761
4775
|
),
|
|
4762
4776
|
name: z206.string(),
|
|
4763
4777
|
experiment_type,
|
|
4778
|
+
subcircuit_id: z206.string().optional(),
|
|
4779
|
+
spice_engine: z206.string().optional(),
|
|
4764
4780
|
time_per_step: duration_ms.optional(),
|
|
4765
4781
|
start_time_ms: ms.optional(),
|
|
4766
4782
|
end_time_ms: ms.optional(),
|
|
@@ -4863,6 +4879,7 @@ var simulation_transient_voltage_graph = z208.object({
|
|
|
4863
4879
|
"simulation_transient_voltage_graph"
|
|
4864
4880
|
),
|
|
4865
4881
|
simulation_experiment_id: z208.string(),
|
|
4882
|
+
simulation_voltage_probe_id: z208.string().optional(),
|
|
4866
4883
|
simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
|
|
4867
4884
|
timestamps_ms: z208.array(z208.number()).optional(),
|
|
4868
4885
|
voltage_levels: z208.array(z208.number()),
|
|
@@ -5288,52 +5305,195 @@ var simulation_oscilloscope_trace = z224.object({
|
|
|
5288
5305
|
});
|
|
5289
5306
|
expectTypesMatch(true);
|
|
5290
5307
|
|
|
5291
|
-
// src/simulation/
|
|
5308
|
+
// src/simulation/simulation_ibis_model.ts
|
|
5292
5309
|
import { z as z225 } from "zod";
|
|
5293
|
-
var
|
|
5294
|
-
|
|
5295
|
-
|
|
5310
|
+
var ibisAssetPath = z225.string().min(1).regex(/^(?!\s|[a-z][a-z\d+.-]*:|[/\\])[^\\\u0000-\u001f\u007f]+$/i);
|
|
5311
|
+
var simulation_ibis_model = z225.object({
|
|
5312
|
+
type: z225.literal("simulation_ibis_model"),
|
|
5313
|
+
simulation_ibis_model_id: getZodPrefixedIdWithDefault(
|
|
5314
|
+
"simulation_ibis_model"
|
|
5315
|
+
),
|
|
5316
|
+
source_component_id: z225.string().min(1),
|
|
5317
|
+
// Consumers must still apply their own fetch policy to prevent SSRF.
|
|
5318
|
+
ibis_model_asset: asset.extend({
|
|
5319
|
+
project_relative_path: ibisAssetPath,
|
|
5320
|
+
url: z225.string().url().regex(/^https?:\/\//i).or(ibisAssetPath)
|
|
5321
|
+
}).describe(
|
|
5322
|
+
"Reference to the .ibs file containing the vendor's IBIS models"
|
|
5323
|
+
),
|
|
5324
|
+
ibis_component_name: z225.string().min(1).describe("Name of the [Component] section in the IBIS file"),
|
|
5325
|
+
ibis_pin_name_to_source_port_id: z225.record(z225.string().min(1), z225.string().min(1)).refine(
|
|
5326
|
+
(pins) => Object.keys(pins).length > 0,
|
|
5327
|
+
"At least one physical IBIS pin is required"
|
|
5328
|
+
).describe(
|
|
5329
|
+
"Maps pin names from the IBIS [Pin] table, such as A1 or 12, to physical source_port_id values"
|
|
5330
|
+
),
|
|
5331
|
+
ibis_pin_name_to_model_name: z225.record(z225.string().min(1), z225.string().min(1)).optional().describe(
|
|
5332
|
+
"Maps an IBIS pin name to the selected [Model] name when its [Model Selector] has multiple buffers"
|
|
5333
|
+
),
|
|
5334
|
+
ibis_pin_name_to_reference_source_port_ids: z225.record(
|
|
5335
|
+
z225.string().min(1),
|
|
5336
|
+
z225.object({
|
|
5337
|
+
pullup_reference_source_port_id: z225.string().min(1).optional(),
|
|
5338
|
+
pulldown_reference_source_port_id: z225.string().min(1).optional(),
|
|
5339
|
+
power_clamp_reference_source_port_id: z225.string().min(1).optional(),
|
|
5340
|
+
ground_clamp_reference_source_port_id: z225.string().min(1).optional(),
|
|
5341
|
+
external_reference_source_port_id: z225.string().min(1).optional()
|
|
5342
|
+
}).strict()
|
|
5343
|
+
).optional().describe(
|
|
5344
|
+
"Maps each IBIS signal pin name to the physical source ports used as its buffer supply/clamp references"
|
|
5345
|
+
),
|
|
5346
|
+
model_value_corner: z225.union([z225.literal("typical"), z225.literal("minimum"), z225.literal("maximum")]).describe(
|
|
5347
|
+
"Selects the typ, min, or max column of numerical data in the IBIS model"
|
|
5348
|
+
),
|
|
5349
|
+
include_package_parasitics: z225.boolean().describe(
|
|
5350
|
+
"Whether the runner includes the IBIS vendor's package resistance, inductance, and capacitance"
|
|
5351
|
+
)
|
|
5352
|
+
}).superRefine((model, context) => {
|
|
5353
|
+
const boundPins = new Set(
|
|
5354
|
+
Object.keys(model.ibis_pin_name_to_source_port_id)
|
|
5355
|
+
);
|
|
5356
|
+
for (const field of [
|
|
5357
|
+
"ibis_pin_name_to_model_name",
|
|
5358
|
+
"ibis_pin_name_to_reference_source_port_ids"
|
|
5359
|
+
]) {
|
|
5360
|
+
for (const pin of Object.keys(model[field] ?? {})) {
|
|
5361
|
+
if (!boundPins.has(pin)) {
|
|
5362
|
+
context.addIssue({
|
|
5363
|
+
code: z225.ZodIssueCode.custom,
|
|
5364
|
+
path: [field, pin],
|
|
5365
|
+
message: `IBIS pin "${pin}" must be bound in ibis_pin_name_to_source_port_id`
|
|
5366
|
+
});
|
|
5367
|
+
}
|
|
5368
|
+
}
|
|
5369
|
+
}
|
|
5370
|
+
}).describe(
|
|
5371
|
+
"Attaches an IBIS component and its physical pin bindings to a source component"
|
|
5372
|
+
);
|
|
5373
|
+
|
|
5374
|
+
// src/simulation/simulation_ibis_pin_state.ts
|
|
5375
|
+
import { z as z226 } from "zod";
|
|
5376
|
+
var simulation_ibis_pin_state = z226.object({
|
|
5377
|
+
type: z226.literal("simulation_ibis_pin_state"),
|
|
5378
|
+
simulation_ibis_pin_state_id: getZodPrefixedIdWithDefault(
|
|
5379
|
+
"simulation_ibis_pin_state"
|
|
5380
|
+
),
|
|
5381
|
+
simulation_experiment_id: z226.string().min(1),
|
|
5382
|
+
source_port_id: z226.string().min(1),
|
|
5383
|
+
is_output: z226.boolean().describe(
|
|
5384
|
+
"True selects output mode; false selects input mode for this experiment"
|
|
5385
|
+
),
|
|
5386
|
+
is_output_enabled: z226.boolean().optional()
|
|
5387
|
+
}).superRefine((pin, context) => {
|
|
5388
|
+
if (pin.is_output && pin.is_output_enabled === void 0 || !pin.is_output && pin.is_output_enabled !== void 0) {
|
|
5389
|
+
context.addIssue({
|
|
5390
|
+
code: z226.ZodIssueCode.custom,
|
|
5391
|
+
path: ["is_output_enabled"],
|
|
5392
|
+
message: "Only output pins require an explicit is_output_enabled boolean"
|
|
5393
|
+
});
|
|
5394
|
+
}
|
|
5395
|
+
}).describe(
|
|
5396
|
+
"Declares an IBIS pin's direction and output-enable state for one experiment"
|
|
5397
|
+
);
|
|
5398
|
+
|
|
5399
|
+
// src/simulation/simulation_digital_stimulus.ts
|
|
5400
|
+
import { z as z227 } from "zod";
|
|
5401
|
+
var MAX_PATTERN_BITS = 65536;
|
|
5402
|
+
var simulation_digital_stimulus = z227.object({
|
|
5403
|
+
type: z227.literal("simulation_digital_stimulus"),
|
|
5404
|
+
simulation_digital_stimulus_id: getZodPrefixedIdWithDefault(
|
|
5405
|
+
"simulation_digital_stimulus"
|
|
5406
|
+
),
|
|
5407
|
+
name: z227.string().min(1),
|
|
5408
|
+
simulation_experiment_id: z227.string().min(1),
|
|
5409
|
+
source_port_id: z227.string().min(1),
|
|
5410
|
+
bit_duration_ms: ms.refine((milliseconds) => milliseconds > 0),
|
|
5411
|
+
start_time_ms: ms.refine((milliseconds) => milliseconds >= 0),
|
|
5412
|
+
initial_state: z227.union([z227.literal(0), z227.literal(1)]),
|
|
5413
|
+
inverted: z227.boolean(),
|
|
5414
|
+
transmission_pattern: z227.object({
|
|
5415
|
+
transmission_type: z227.literal("bits"),
|
|
5416
|
+
bits: z227.string().max(MAX_PATTERN_BITS).regex(/^[01]+$/).or(
|
|
5417
|
+
z227.array(z227.union([z227.literal(0), z227.literal(1)])).min(1).max(MAX_PATTERN_BITS)
|
|
5418
|
+
),
|
|
5419
|
+
repeat: z227.boolean()
|
|
5420
|
+
}).strict()
|
|
5421
|
+
}).describe(
|
|
5422
|
+
"Declares a digital transmission pattern and bit duration in milliseconds for a physical source port"
|
|
5423
|
+
);
|
|
5424
|
+
|
|
5425
|
+
// src/simulation/simulation_eye_diagram.ts
|
|
5426
|
+
import { z as z228 } from "zod";
|
|
5427
|
+
var simulation_eye_diagram = z228.object({
|
|
5428
|
+
type: z228.literal("simulation_eye_diagram"),
|
|
5429
|
+
simulation_eye_diagram_id: getZodPrefixedIdWithDefault(
|
|
5430
|
+
"simulation_eye_diagram"
|
|
5431
|
+
),
|
|
5432
|
+
name: z228.string().min(1),
|
|
5433
|
+
simulation_experiment_id: z228.string().min(1),
|
|
5434
|
+
simulation_voltage_probe_id: z228.string().min(1),
|
|
5435
|
+
unit_interval_ms: ms.refine((milliseconds) => milliseconds > 0),
|
|
5436
|
+
time_origin_ms: ms,
|
|
5437
|
+
start_time_ms: ms.refine((milliseconds) => milliseconds >= 0).optional(),
|
|
5438
|
+
end_time_ms: ms.refine((milliseconds) => milliseconds > 0).optional()
|
|
5439
|
+
}).superRefine((eye, context) => {
|
|
5440
|
+
if (eye.start_time_ms !== void 0 && eye.end_time_ms !== void 0 && eye.start_time_ms >= eye.end_time_ms) {
|
|
5441
|
+
context.addIssue({
|
|
5442
|
+
code: z228.ZodIssueCode.custom,
|
|
5443
|
+
path: ["end_time_ms"],
|
|
5444
|
+
message: "Eye gate end must follow its start"
|
|
5445
|
+
});
|
|
5446
|
+
}
|
|
5447
|
+
}).describe(
|
|
5448
|
+
"Declares probe-bound eye folding, fixed origin and optional measurement gate in milliseconds"
|
|
5449
|
+
);
|
|
5450
|
+
|
|
5451
|
+
// src/simulation/simulation_return_current_contact.ts
|
|
5452
|
+
import { z as z229 } from "zod";
|
|
5453
|
+
var contact_position = z229.object({
|
|
5454
|
+
x: z229.number().finite(),
|
|
5455
|
+
y: z229.number().finite(),
|
|
5296
5456
|
layer: layer_ref
|
|
5297
5457
|
});
|
|
5298
|
-
var simulation_return_current_contact =
|
|
5458
|
+
var simulation_return_current_contact = z229.discriminatedUnion("contact_type", [
|
|
5299
5459
|
contact_position.extend({
|
|
5300
|
-
contact_type:
|
|
5301
|
-
pcb_port_id:
|
|
5460
|
+
contact_type: z229.literal("pcb_port"),
|
|
5461
|
+
pcb_port_id: z229.string().min(1)
|
|
5302
5462
|
}),
|
|
5303
5463
|
contact_position.extend({
|
|
5304
|
-
contact_type:
|
|
5305
|
-
pcb_via_id:
|
|
5464
|
+
contact_type: z229.literal("pcb_via"),
|
|
5465
|
+
pcb_via_id: z229.string().min(1)
|
|
5306
5466
|
}),
|
|
5307
5467
|
contact_position.extend({
|
|
5308
|
-
contact_type:
|
|
5309
|
-
pcb_copper_pour_id:
|
|
5468
|
+
contact_type: z229.literal("pcb_copper_pour"),
|
|
5469
|
+
pcb_copper_pour_id: z229.string().min(1)
|
|
5310
5470
|
})
|
|
5311
5471
|
]).describe("Identifies the reference conductor at a return-current contact");
|
|
5312
5472
|
expectTypesMatch(true);
|
|
5313
5473
|
|
|
5314
5474
|
// src/simulation/simulation_terminal_port.ts
|
|
5315
|
-
import { z as
|
|
5316
|
-
var simulation_terminal_port =
|
|
5317
|
-
signal_pcb_port_id:
|
|
5318
|
-
reference_pcb_port_id:
|
|
5475
|
+
import { z as z230 } from "zod";
|
|
5476
|
+
var simulation_terminal_port = z230.object({
|
|
5477
|
+
signal_pcb_port_id: z230.string().min(1),
|
|
5478
|
+
reference_pcb_port_id: z230.string().min(1).optional(),
|
|
5319
5479
|
reference_layer: layer_ref,
|
|
5320
|
-
resistance:
|
|
5480
|
+
resistance: z230.number().finite().positive()
|
|
5321
5481
|
}).describe(
|
|
5322
5482
|
"A two-terminal return-current excitation port with resistance in ohms"
|
|
5323
5483
|
);
|
|
5324
5484
|
expectTypesMatch(true);
|
|
5325
5485
|
|
|
5326
5486
|
// src/simulation/simulation_return_current_excitation.ts
|
|
5327
|
-
import { z as
|
|
5328
|
-
var simulation_return_current_excitation =
|
|
5329
|
-
type:
|
|
5487
|
+
import { z as z231 } from "zod";
|
|
5488
|
+
var simulation_return_current_excitation = z231.object({
|
|
5489
|
+
type: z231.literal("simulation_return_current_excitation"),
|
|
5330
5490
|
simulation_return_current_excitation_id: getZodPrefixedIdWithDefault(
|
|
5331
5491
|
"simulation_return_current_excitation"
|
|
5332
5492
|
),
|
|
5333
|
-
simulation_experiment_id:
|
|
5334
|
-
pcb_trace_id:
|
|
5335
|
-
ground_source_net_id:
|
|
5336
|
-
current:
|
|
5493
|
+
simulation_experiment_id: z231.string().min(1),
|
|
5494
|
+
pcb_trace_id: z231.string().min(1),
|
|
5495
|
+
ground_source_net_id: z231.string().min(1),
|
|
5496
|
+
current: z231.number().finite(),
|
|
5337
5497
|
return_source: simulation_return_current_contact,
|
|
5338
5498
|
return_sink: simulation_return_current_contact,
|
|
5339
5499
|
source_port: simulation_terminal_port.optional(),
|
|
@@ -5344,34 +5504,34 @@ var simulation_return_current_excitation = z227.object({
|
|
|
5344
5504
|
expectTypesMatch(true);
|
|
5345
5505
|
|
|
5346
5506
|
// src/simulation/simulation_pcb_return_current_result.ts
|
|
5347
|
-
import { z as
|
|
5348
|
-
var simulation_pcb_return_current_result =
|
|
5349
|
-
type:
|
|
5507
|
+
import { z as z232 } from "zod";
|
|
5508
|
+
var simulation_pcb_return_current_result = z232.object({
|
|
5509
|
+
type: z232.literal("simulation_pcb_return_current_result"),
|
|
5350
5510
|
simulation_pcb_return_current_result_id: getZodPrefixedIdWithDefault(
|
|
5351
5511
|
"simulation_pcb_return_current_result"
|
|
5352
5512
|
),
|
|
5353
|
-
simulation_experiment_id:
|
|
5354
|
-
pcb_board_id:
|
|
5355
|
-
simulation_return_current_excitation_ids:
|
|
5513
|
+
simulation_experiment_id: z232.string().min(1),
|
|
5514
|
+
pcb_board_id: z232.string().min(1),
|
|
5515
|
+
simulation_return_current_excitation_ids: z232.array(z232.string().min(1)).min(1).refine(
|
|
5356
5516
|
(ids) => new Set(ids).size === ids.length,
|
|
5357
5517
|
"Excitation IDs must be unique"
|
|
5358
5518
|
),
|
|
5359
|
-
frequency_hz:
|
|
5519
|
+
frequency_hz: z232.number().finite().positive().optional()
|
|
5360
5520
|
}).describe(
|
|
5361
5521
|
"A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent"
|
|
5362
5522
|
);
|
|
5363
5523
|
expectTypesMatch(true);
|
|
5364
5524
|
|
|
5365
5525
|
// src/simulation/simulation_return_current_asset.ts
|
|
5366
|
-
import { z as
|
|
5526
|
+
import { z as z233 } from "zod";
|
|
5367
5527
|
function createSimulationReturnCurrentAssetSchema(mimetypes) {
|
|
5368
5528
|
return asset.extend({
|
|
5369
|
-
project_relative_path:
|
|
5370
|
-
url:
|
|
5529
|
+
project_relative_path: z233.string().min(1),
|
|
5530
|
+
url: z233.string().url()
|
|
5371
5531
|
}).superRefine((value, context) => {
|
|
5372
5532
|
if (!mimetypes.includes(value.mimetype)) {
|
|
5373
5533
|
context.addIssue({
|
|
5374
|
-
code:
|
|
5534
|
+
code: z233.ZodIssueCode.custom,
|
|
5375
5535
|
path: ["mimetype"],
|
|
5376
5536
|
message: `Expected one of: ${mimetypes.join(", ")}`
|
|
5377
5537
|
});
|
|
@@ -5380,7 +5540,7 @@ function createSimulationReturnCurrentAssetSchema(mimetypes) {
|
|
|
5380
5540
|
const mediaType = /^data:([^;,]*)(?:;[^,]*)?,/i.exec(value.url)?.[1];
|
|
5381
5541
|
if (mediaType?.toLowerCase() !== value.mimetype) {
|
|
5382
5542
|
context.addIssue({
|
|
5383
|
-
code:
|
|
5543
|
+
code: z233.ZodIssueCode.custom,
|
|
5384
5544
|
path: ["url"],
|
|
5385
5545
|
message: "Data URL media type must match asset.mimetype"
|
|
5386
5546
|
});
|
|
@@ -5395,29 +5555,29 @@ var simulation_return_current_field_asset = createSimulationReturnCurrentAssetSc
|
|
|
5395
5555
|
var simulation_return_current_image_asset = createSimulationReturnCurrentAssetSchema(["image/png", "image/webp"]);
|
|
5396
5556
|
|
|
5397
5557
|
// src/simulation/simulation_pcb_return_current_field.ts
|
|
5398
|
-
import { z as
|
|
5399
|
-
var simulation_pcb_return_current_field =
|
|
5400
|
-
type:
|
|
5558
|
+
import { z as z234 } from "zod";
|
|
5559
|
+
var simulation_pcb_return_current_field = z234.object({
|
|
5560
|
+
type: z234.literal("simulation_pcb_return_current_field"),
|
|
5401
5561
|
simulation_pcb_return_current_field_id: getZodPrefixedIdWithDefault(
|
|
5402
5562
|
"simulation_pcb_return_current_field"
|
|
5403
5563
|
),
|
|
5404
|
-
simulation_pcb_return_current_result_id:
|
|
5564
|
+
simulation_pcb_return_current_result_id: z234.string().min(1),
|
|
5405
5565
|
layer: layer_ref,
|
|
5406
|
-
source_net_id:
|
|
5407
|
-
field_type:
|
|
5408
|
-
min_x:
|
|
5409
|
-
min_y:
|
|
5410
|
-
columns:
|
|
5411
|
-
rows:
|
|
5412
|
-
cell_width:
|
|
5413
|
-
cell_height:
|
|
5414
|
-
copper_thickness:
|
|
5415
|
-
data_format:
|
|
5566
|
+
source_net_id: z234.string().min(1),
|
|
5567
|
+
field_type: z234.enum(["real", "complex_phasor"]),
|
|
5568
|
+
min_x: z234.number().finite(),
|
|
5569
|
+
min_y: z234.number().finite(),
|
|
5570
|
+
columns: z234.number().int().positive().safe(),
|
|
5571
|
+
rows: z234.number().int().positive().safe(),
|
|
5572
|
+
cell_width: z234.number().finite().positive(),
|
|
5573
|
+
cell_height: z234.number().finite().positive(),
|
|
5574
|
+
copper_thickness: z234.number().finite().positive(),
|
|
5575
|
+
data_format: z234.literal("simulation_return_current_grid_json_v1"),
|
|
5416
5576
|
field_asset: simulation_return_current_field_asset
|
|
5417
5577
|
}).superRefine((field, context) => {
|
|
5418
5578
|
if (!Number.isSafeInteger(field.columns * field.rows)) {
|
|
5419
5579
|
context.addIssue({
|
|
5420
|
-
code:
|
|
5580
|
+
code: z234.ZodIssueCode.custom,
|
|
5421
5581
|
path: ["columns"],
|
|
5422
5582
|
message: "The grid cell count must be a safe integer"
|
|
5423
5583
|
});
|
|
@@ -5428,16 +5588,16 @@ var simulation_pcb_return_current_field = z230.object({
|
|
|
5428
5588
|
expectTypesMatch(true);
|
|
5429
5589
|
|
|
5430
5590
|
// src/simulation/simulation_return_current_grid_json.ts
|
|
5431
|
-
import { z as
|
|
5432
|
-
var channel =
|
|
5433
|
-
var simulation_return_current_grid_json =
|
|
5434
|
-
|
|
5435
|
-
field_type:
|
|
5591
|
+
import { z as z235 } from "zod";
|
|
5592
|
+
var channel = z235.array(z235.number().finite().nullable()).min(1);
|
|
5593
|
+
var simulation_return_current_grid_json = z235.discriminatedUnion("field_type", [
|
|
5594
|
+
z235.object({
|
|
5595
|
+
field_type: z235.literal("real"),
|
|
5436
5596
|
sheet_current_x: channel,
|
|
5437
5597
|
sheet_current_y: channel
|
|
5438
5598
|
}),
|
|
5439
|
-
|
|
5440
|
-
field_type:
|
|
5599
|
+
z235.object({
|
|
5600
|
+
field_type: z235.literal("complex_phasor"),
|
|
5441
5601
|
sheet_current_x_real: channel,
|
|
5442
5602
|
sheet_current_x_imag: channel,
|
|
5443
5603
|
sheet_current_y_real: channel,
|
|
@@ -5453,7 +5613,7 @@ var simulation_return_current_grid_json = z231.discriminatedUnion("field_type",
|
|
|
5453
5613
|
const first = channels[0];
|
|
5454
5614
|
if (channels.some((values) => values.length !== first.length)) {
|
|
5455
5615
|
context.addIssue({
|
|
5456
|
-
code:
|
|
5616
|
+
code: z235.ZodIssueCode.custom,
|
|
5457
5617
|
message: "Current channels must have equal lengths"
|
|
5458
5618
|
});
|
|
5459
5619
|
return;
|
|
@@ -5462,7 +5622,7 @@ var simulation_return_current_grid_json = z231.discriminatedUnion("field_type",
|
|
|
5462
5622
|
const masked = first[index] === null;
|
|
5463
5623
|
if (channels.some((values) => values[index] === null !== masked)) {
|
|
5464
5624
|
context.addIssue({
|
|
5465
|
-
code:
|
|
5625
|
+
code: z235.ZodIssueCode.custom,
|
|
5466
5626
|
message: `Cell ${index} must be null in every channel or finite in every channel`
|
|
5467
5627
|
});
|
|
5468
5628
|
return;
|
|
@@ -5479,7 +5639,7 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
|
|
|
5479
5639
|
return simulation_return_current_grid_json.superRefine((grid, context) => {
|
|
5480
5640
|
if (grid.field_type !== field.field_type) {
|
|
5481
5641
|
context.addIssue({
|
|
5482
|
-
code:
|
|
5642
|
+
code: z235.ZodIssueCode.custom,
|
|
5483
5643
|
path: ["field_type"],
|
|
5484
5644
|
message: "Decoded field_type must match the parent field"
|
|
5485
5645
|
});
|
|
@@ -5487,7 +5647,7 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
|
|
|
5487
5647
|
const first = grid.field_type === "real" ? grid.sheet_current_x : grid.sheet_current_x_real;
|
|
5488
5648
|
if (first.length !== count) {
|
|
5489
5649
|
context.addIssue({
|
|
5490
|
-
code:
|
|
5650
|
+
code: z235.ZodIssueCode.custom,
|
|
5491
5651
|
message: `Each current channel must have ${count} entries (columns * rows)`
|
|
5492
5652
|
});
|
|
5493
5653
|
}
|
|
@@ -5495,25 +5655,25 @@ function getSimulationReturnCurrentGridJsonSchema(field) {
|
|
|
5495
5655
|
}
|
|
5496
5656
|
|
|
5497
5657
|
// src/simulation/simulation_pcb_return_current_heatmap.ts
|
|
5498
|
-
import { z as
|
|
5499
|
-
var simulation_pcb_return_current_heatmap =
|
|
5500
|
-
type:
|
|
5658
|
+
import { z as z236 } from "zod";
|
|
5659
|
+
var simulation_pcb_return_current_heatmap = z236.object({
|
|
5660
|
+
type: z236.literal("simulation_pcb_return_current_heatmap"),
|
|
5501
5661
|
simulation_pcb_return_current_heatmap_id: getZodPrefixedIdWithDefault(
|
|
5502
5662
|
"simulation_pcb_return_current_heatmap"
|
|
5503
5663
|
),
|
|
5504
|
-
simulation_pcb_return_current_result_id:
|
|
5664
|
+
simulation_pcb_return_current_result_id: z236.string().min(1),
|
|
5505
5665
|
layer: layer_ref,
|
|
5506
|
-
source_net_id:
|
|
5507
|
-
min_x:
|
|
5508
|
-
min_y:
|
|
5509
|
-
max_x:
|
|
5510
|
-
max_y:
|
|
5666
|
+
source_net_id: z236.string().min(1),
|
|
5667
|
+
min_x: z236.number().finite(),
|
|
5668
|
+
min_y: z236.number().finite(),
|
|
5669
|
+
max_x: z236.number().finite(),
|
|
5670
|
+
max_y: z236.number().finite(),
|
|
5511
5671
|
image_asset: simulation_return_current_image_asset
|
|
5512
5672
|
}).superRefine((heatmap, context) => {
|
|
5513
5673
|
for (const axis of ["x", "y"]) {
|
|
5514
5674
|
if (heatmap[`max_${axis}`] <= heatmap[`min_${axis}`]) {
|
|
5515
5675
|
context.addIssue({
|
|
5516
|
-
code:
|
|
5676
|
+
code: z236.ZodIssueCode.custom,
|
|
5517
5677
|
path: [`max_${axis}`],
|
|
5518
5678
|
message: "Heatmap bounds must have positive width and height"
|
|
5519
5679
|
});
|
|
@@ -5525,14 +5685,14 @@ var simulation_pcb_return_current_heatmap = z232.object({
|
|
|
5525
5685
|
expectTypesMatch(true);
|
|
5526
5686
|
|
|
5527
5687
|
// src/simulation/simulation_pcb_return_current_marker.ts
|
|
5528
|
-
import { z as
|
|
5529
|
-
var marker_base =
|
|
5530
|
-
type:
|
|
5688
|
+
import { z as z237 } from "zod";
|
|
5689
|
+
var marker_base = z237.object({
|
|
5690
|
+
type: z237.literal("simulation_pcb_return_current_marker"),
|
|
5531
5691
|
simulation_pcb_return_current_marker_id: getZodPrefixedIdWithDefault(
|
|
5532
5692
|
"simulation_pcb_return_current_marker"
|
|
5533
5693
|
),
|
|
5534
|
-
simulation_pcb_return_current_result_id:
|
|
5535
|
-
role:
|
|
5694
|
+
simulation_pcb_return_current_result_id: z237.string().min(1),
|
|
5695
|
+
role: z237.enum([
|
|
5536
5696
|
"signal_source",
|
|
5537
5697
|
"signal_load",
|
|
5538
5698
|
"return_source",
|
|
@@ -5540,33 +5700,33 @@ var marker_base = z233.object({
|
|
|
5540
5700
|
"signal_transition",
|
|
5541
5701
|
"return_transition"
|
|
5542
5702
|
]),
|
|
5543
|
-
label:
|
|
5544
|
-
label_x:
|
|
5545
|
-
label_y:
|
|
5703
|
+
label: z237.string().optional(),
|
|
5704
|
+
label_x: z237.number().finite().optional(),
|
|
5705
|
+
label_y: z237.number().finite().optional()
|
|
5546
5706
|
});
|
|
5547
|
-
var simulation_pcb_return_current_marker =
|
|
5707
|
+
var simulation_pcb_return_current_marker = z237.discriminatedUnion("target_type", [
|
|
5548
5708
|
marker_base.extend({
|
|
5549
|
-
target_type:
|
|
5550
|
-
pcb_port_id:
|
|
5709
|
+
target_type: z237.literal("pcb_port"),
|
|
5710
|
+
pcb_port_id: z237.string().min(1),
|
|
5551
5711
|
layer: layer_ref
|
|
5552
5712
|
}),
|
|
5553
5713
|
marker_base.extend({
|
|
5554
|
-
target_type:
|
|
5555
|
-
pcb_via_id:
|
|
5714
|
+
target_type: z237.literal("pcb_via"),
|
|
5715
|
+
pcb_via_id: z237.string().min(1),
|
|
5556
5716
|
from_layer: layer_ref,
|
|
5557
5717
|
to_layer: layer_ref
|
|
5558
5718
|
})
|
|
5559
5719
|
]).superRefine((marker, context) => {
|
|
5560
5720
|
if (marker.label_x === void 0 !== (marker.label_y === void 0)) {
|
|
5561
5721
|
context.addIssue({
|
|
5562
|
-
code:
|
|
5722
|
+
code: z237.ZodIssueCode.custom,
|
|
5563
5723
|
path: ["label_x"],
|
|
5564
5724
|
message: "label_x and label_y must be provided together"
|
|
5565
5725
|
});
|
|
5566
5726
|
}
|
|
5567
5727
|
if (marker.target_type === "pcb_via" && marker.from_layer === marker.to_layer) {
|
|
5568
5728
|
context.addIssue({
|
|
5569
|
-
code:
|
|
5729
|
+
code: z237.ZodIssueCode.custom,
|
|
5570
5730
|
path: ["to_layer"],
|
|
5571
5731
|
message: "A via transition must connect distinct layers"
|
|
5572
5732
|
});
|
|
@@ -5577,8 +5737,8 @@ var simulation_pcb_return_current_marker = z233.discriminatedUnion("target_type"
|
|
|
5577
5737
|
expectTypesMatch(true);
|
|
5578
5738
|
|
|
5579
5739
|
// src/any_circuit_element.ts
|
|
5580
|
-
import { z as
|
|
5581
|
-
var any_circuit_element =
|
|
5740
|
+
import { z as z238 } from "zod";
|
|
5741
|
+
var any_circuit_element = z238.union([
|
|
5582
5742
|
source_runtime_error,
|
|
5583
5743
|
source_datasheet,
|
|
5584
5744
|
source_trace,
|
|
@@ -5744,6 +5904,10 @@ var any_circuit_element = z234.union([
|
|
|
5744
5904
|
simulation_voltage_source,
|
|
5745
5905
|
simulation_current_source,
|
|
5746
5906
|
simulation_experiment,
|
|
5907
|
+
simulation_ibis_model,
|
|
5908
|
+
simulation_ibis_pin_state,
|
|
5909
|
+
simulation_digital_stimulus,
|
|
5910
|
+
simulation_eye_diagram,
|
|
5747
5911
|
simulation_return_current_excitation,
|
|
5748
5912
|
simulation_pcb_return_current_result,
|
|
5749
5913
|
simulation_pcb_return_current_field,
|
|
@@ -5996,7 +6160,11 @@ export {
|
|
|
5996
6160
|
simulation_dc_sweep_unit,
|
|
5997
6161
|
simulation_dc_sweep_voltage_graph,
|
|
5998
6162
|
simulation_dc_voltage_source,
|
|
6163
|
+
simulation_digital_stimulus,
|
|
5999
6164
|
simulation_experiment,
|
|
6165
|
+
simulation_eye_diagram,
|
|
6166
|
+
simulation_ibis_model,
|
|
6167
|
+
simulation_ibis_pin_state,
|
|
6000
6168
|
simulation_op_amp,
|
|
6001
6169
|
simulation_oscilloscope_trace,
|
|
6002
6170
|
simulation_parameter_sweep,
|