@tscircuit/cli 0.1.2274 → 0.1.2275

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/cli/main.js CHANGED
@@ -171749,7 +171749,7 @@ var import_perfect_cli = __toESM3(require_dist3(), 1);
171749
171749
  // lib/getVersion.ts
171750
171750
  import { createRequire as createRequire2 } from "node:module";
171751
171751
  // package.json
171752
- var version = "0.1.2273";
171752
+ var version = "0.1.2274";
171753
171753
  var package_default = {
171754
171754
  name: "@tscircuit/cli",
171755
171755
  version,
@@ -171768,7 +171768,7 @@ var package_default = {
171768
171768
  "@tscircuit/check-shorts": "https://jscdn.tscircuit.com/@tscircuit/check-shorts/0.0.26.tgz",
171769
171769
  "@tscircuit/circuit-json-placement-analysis": "^0.0.15",
171770
171770
  "@tscircuit/circuit-json-routing-analysis": "^0.0.8",
171771
- "@tscircuit/circuit-json-schematic-placement-analysis": "https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.46.tgz",
171771
+ "@tscircuit/circuit-json-schematic-placement-analysis": "https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.50.tgz",
171772
171772
  "@tscircuit/circuit-json-util": "^0.0.120",
171773
171773
  "@tscircuit/eval": "0.0.1569",
171774
171774
  "@tscircuit/fake-snippets": "^0.0.182",
@@ -338870,7 +338870,7 @@ var registerCheckRoutingDifficulty = (program) => {
338870
338870
  });
338871
338871
  };
338872
338872
 
338873
- // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ParallelDiodeResistorPlacementSolver/ParallelDiodeResistorPlacementSolver.ts
338873
+ // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/DiodeCapacitorStagePlacementSolver/DiodeCapacitorStagePlacementSolver.ts
338874
338874
  import { BaseSolver as BaseSolver5 } from "@tscircuit/solver-utils";
338875
338875
 
338876
338876
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/utils/format.ts
@@ -339035,8 +339035,237 @@ function append2(map, key, value) {
339035
339035
  map.set(key, [value]);
339036
339036
  }
339037
339037
 
339038
+ // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/DiodeCapacitorStagePlacementSolver/DiodeCapacitorStagePlacementSolver.ts
339039
+ class DiodeCapacitorStagePlacementSolver extends BaseSolver5 {
339040
+ params;
339041
+ index;
339042
+ nets;
339043
+ unpopulated = new Set;
339044
+ currentIndex = 0;
339045
+ constructor(params2) {
339046
+ super();
339047
+ this.params = params2;
339048
+ this.index = new PlacementNetworkIndex(params2.ctx);
339049
+ for (const e of params2.ctx.circuitJson) {
339050
+ if (e.type === "pcb_component" && e.do_not_place)
339051
+ this.unpopulated.add(e.source_component_id);
339052
+ if (e.type === "source_port") {
339053
+ const net = this.index.connected(e.source_port_id);
339054
+ if (e.requires_ground || e.provides_ground)
339055
+ this.index.groundNets.add(net);
339056
+ if (e.requires_power || e.provides_power)
339057
+ this.index.powerNets.add(net);
339058
+ }
339059
+ }
339060
+ this.nets = [...this.index.portsByNet.keys()];
339061
+ this.solved = this.nets.length === 0;
339062
+ }
339063
+ _step() {
339064
+ const net = this.nets[this.currentIndex++];
339065
+ this.solved = this.currentIndex >= this.nets.length;
339066
+ if (!net || this.index.isRail(net))
339067
+ return;
339068
+ const index = this.index;
339069
+ const junction = index.portsByNet.get(net);
339070
+ if (junction.length !== 3 || new Set(junction.map((p) => p.source_component_id)).size !== 3)
339071
+ return;
339072
+ const parts = junction.map((p) => this.localPart(p.source_component_id));
339073
+ if (parts.some((p) => !p))
339074
+ return;
339075
+ const diodes = parts.filter((p) => p.component.ftype === "simple_diode");
339076
+ const capacitors = parts.filter((p) => p.component.ftype === "simple_capacitor");
339077
+ if (diodes.length !== 2 || capacitors.length !== 1)
339078
+ return;
339079
+ const capacitor = capacitors[0];
339080
+ const first = diodes[0];
339081
+ const second = diodes[1];
339082
+ if (![first, second].every((p) => index.sameLocalScope(capacitor.placement, p.placement)))
339083
+ return;
339084
+ const otherNet = (part) => part.nets.find((n) => n !== net);
339085
+ const diodeNets = [otherNet(first), otherNet(second)];
339086
+ const grounds = diodeNets.filter((n) => index.groundNets.has(n));
339087
+ if (grounds.length !== 1)
339088
+ return;
339089
+ const ground = grounds[0];
339090
+ const branchNet = diodeNets.find((n) => n !== ground);
339091
+ const capacitorNet = otherNet(capacitor);
339092
+ if (capacitorNet === branchNet || capacitorNet === ground || index.isRail(capacitorNet))
339093
+ return;
339094
+ const bankIds = new Set((index.portsByNet.get(branchNet) ?? []).filter((p) => index.components.get(p.source_component_id)?.ftype === "simple_capacitor").map((p) => p.source_component_id));
339095
+ const groundedBank = [...bankIds].filter((id) => index.twoTerminalNets(id)?.includes(ground));
339096
+ if (!groundedBank.length || groundedBank.some((id) => {
339097
+ const part = this.localPart(id);
339098
+ return !part || !index.sameLocalScope(capacitor.placement, part.placement);
339099
+ }))
339100
+ return;
339101
+ const placements = [capacitor.placement, first.placement, second.placement];
339102
+ const pins = junction.map((p) => index.port(p));
339103
+ const maxJunctionPinDistance = Math.max(...pins.flatMap((a, i) => pins.slice(i + 1).map((b) => Math.hypot(a.center.x - b.center.x, a.center.y - b.center.y))));
339104
+ const maxRecommendedJunctionPinDistance = Math.max(4, ...placements.map((p) => 3 * Math.max(p.width, p.height)));
339105
+ if (maxJunctionPinDistance <= maxRecommendedJunctionPinDistance)
339106
+ return;
339107
+ const names = placements.map((p) => p.sourceComponentName || "component");
339108
+ this.params.issues.push({
339109
+ lineItemType: "DiodeCapacitorJunctionTooSpreadOut",
339110
+ capacitorSchematicBox: capacitor.placement,
339111
+ diodeSchematicBoxes: [first.placement, second.placement],
339112
+ maxJunctionPinDistance,
339113
+ maxRecommendedJunctionPinDistance,
339114
+ message: `Bring ${names.join(", ")} closer together so their shared junction can be read as one local diode-capacitor stage. Preserve pin connections, leave room for labels, and reroute affected traces.`
339115
+ });
339116
+ }
339117
+ localPart(id) {
339118
+ const component = this.index.components.get(id);
339119
+ const placement = this.index.placement(id);
339120
+ const ports = this.index.portsByComponent.get(id);
339121
+ const nets = this.index.twoTerminalNets(id);
339122
+ if (!component || !placement || !nets || this.unpopulated.has(id) || ports?.length !== 2 || ![placement.width, placement.height].every((n) => Number.isFinite(n) && n > 0) || component.ftype === "simple_capacitor" && (!Number.isFinite(component.capacitance) || component.capacitance <= 0) || ports.some((p) => {
339123
+ const pin = this.index.port(p);
339124
+ return p.do_not_connect || !pin || pin.schematic_sheet_id !== placement.schematicSheetId || !Number.isFinite(pin.center.x) || !Number.isFinite(pin.center.y);
339125
+ }))
339126
+ return;
339127
+ return { component, placement, ports, nets };
339128
+ }
339129
+ static issueToString(issue) {
339130
+ const attrs = [];
339131
+ addAttr(attrs, "capacitorName", issue.capacitorSchematicBox.sourceComponentName);
339132
+ addAttr(attrs, "diodeNames", issue.diodeSchematicBoxes.map((p) => p.sourceComponentName).join(","));
339133
+ addAttr(attrs, "maxJunctionPinDistance", issue.maxJunctionPinDistance);
339134
+ addAttr(attrs, "maxRecommendedJunctionPinDistance", issue.maxRecommendedJunctionPinDistance);
339135
+ addAttr(attrs, "message", issue.message);
339136
+ return `<DiodeCapacitorJunctionTooSpreadOut ${attrs.join(" ")} />`;
339137
+ }
339138
+ }
339139
+ // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ParallelRcPlacementSolver/ParallelRcPlacementSolver.ts
339140
+ import { BaseSolver as BaseSolver6 } from "@tscircuit/solver-utils";
339141
+ class ParallelRcPlacementSolver extends BaseSolver6 {
339142
+ params;
339143
+ index;
339144
+ resistorIds;
339145
+ unpopulated = new Set;
339146
+ currentIndex = 0;
339147
+ constructor(params2) {
339148
+ super();
339149
+ this.params = params2;
339150
+ this.index = new PlacementNetworkIndex(params2.ctx);
339151
+ for (const element of params2.ctx.circuitJson) {
339152
+ if (element.type === "pcb_component" && element.do_not_place)
339153
+ this.unpopulated.add(element.source_component_id);
339154
+ if (element.type === "source_port") {
339155
+ const net = this.index.connected(element.source_port_id);
339156
+ if (element.requires_ground || element.provides_ground)
339157
+ this.index.groundNets.add(net);
339158
+ if (element.requires_power || element.provides_power || element.requires_voltage !== undefined || element.provides_voltage !== undefined)
339159
+ this.index.powerNets.add(net);
339160
+ }
339161
+ }
339162
+ this.resistorIds = [...this.index.components.values()].filter((c) => c.ftype === "simple_resistor").map((c) => c.source_component_id);
339163
+ this.solved = this.resistorIds.length === 0;
339164
+ }
339165
+ _step() {
339166
+ const resistorId = this.resistorIds[this.currentIndex++];
339167
+ this.solved = this.currentIndex >= this.resistorIds.length;
339168
+ const index = this.index;
339169
+ const resistor = index.components.get(resistorId);
339170
+ const nets = index.twoTerminalNets(resistorId);
339171
+ if (resistor?.ftype !== "simple_resistor" || !Number.isFinite(resistor.resistance) || resistor.resistance <= 0 || !nets)
339172
+ return;
339173
+ const grounds = nets.filter((net) => index.groundNets.has(net) && !index.powerNets.has(net));
339174
+ if (grounds.length !== 1)
339175
+ return;
339176
+ const ground = grounds[0];
339177
+ const signal = nets.find((net) => net !== ground);
339178
+ if (index.isRail(signal))
339179
+ return;
339180
+ const members = index.portsByNet.get(signal) ?? [];
339181
+ if (members.length !== 3 || members.some((p) => p.do_not_connect))
339182
+ return;
339183
+ const capPort = members.find((p) => index.components.get(p.source_component_id)?.ftype === "simple_capacitor");
339184
+ const chipPort = members.find((p) => index.components.get(p.source_component_id)?.ftype === "simple_chip");
339185
+ if (!capPort || !chipPort)
339186
+ return;
339187
+ const capacitorId = capPort.source_component_id;
339188
+ const capacitor = index.components.get(capacitorId);
339189
+ if (capacitor?.ftype !== "simple_capacitor" || !Number.isFinite(capacitor.capacitance) || capacitor.capacitance <= 0 || !index.twoTerminalNets(capacitorId)?.includes(ground))
339190
+ return;
339191
+ const hostId = chipPort.source_component_id;
339192
+ if ((index.portsByComponent.get(hostId)?.length ?? 0) < 3)
339193
+ return;
339194
+ const r = index.placement(resistorId), c = index.placement(capacitorId), host = index.placement(hostId);
339195
+ if (!r || !c || !host || [resistorId, capacitorId, hostId].some((id) => this.unpopulated.has(id)))
339196
+ return;
339197
+ if ([r, c].some((box) => box.schematicSheetId !== host.schematicSheetId || box.subcircuitId !== host.subcircuitId))
339198
+ return;
339199
+ if ([r, c, host].some((box) => ![box.schX, box.schY, box.width, box.height].every(Number.isFinite) || box.width <= 0 || box.height <= 0))
339200
+ return;
339201
+ const chipPin = index.port(chipPort);
339202
+ if (!chipPin || chipPin.schematic_sheet_id !== host.schematicSheetId)
339203
+ return;
339204
+ const resistorPins = this.pins(resistorId, signal, ground, r);
339205
+ const capacitorPins = this.pins(capacitorId, signal, ground, c);
339206
+ if (!resistorPins || !capacitorPins)
339207
+ return;
339208
+ const rAxis = pinAxis(...resistorPins), cAxis = pinAxis(...capacitorPins);
339209
+ if (!rAxis || !cAxis)
339210
+ return;
339211
+ if (Math.abs(r.schX - c.schX) < (r.width + c.width) / 2 && Math.abs(r.schY - c.schY) < (r.height + c.height) / 2)
339212
+ return;
339213
+ let reason;
339214
+ if (rAxis !== cAxis)
339215
+ reason = "different_axes";
339216
+ else {
339217
+ const axis = rAxis === "horizontal" ? "x" : "y";
339218
+ const a = resistorPins.map((p) => p.center[axis]), b = capacitorPins.map((p) => p.center[axis]);
339219
+ if ((a[1] - a[0]) * (b[1] - b[0]) < 0)
339220
+ reason = "crossed_connections";
339221
+ else {
339222
+ const overlap = Math.min(Math.max(...a), Math.max(...b)) - Math.max(Math.min(...a), Math.min(...b));
339223
+ if (overlap > 0.01)
339224
+ return;
339225
+ reason = "staggered";
339226
+ }
339227
+ }
339228
+ this.params.issues.push({
339229
+ lineItemType: "ParallelRcNotAligned",
339230
+ resistorSchematicBox: r,
339231
+ capacitorSchematicBox: c,
339232
+ chipSourcePortId: chipPort.source_port_id,
339233
+ reason,
339234
+ message: `Draw ${r.sourceComponentName || "the resistor"} and ${c.sourceComponentName || "the capacitor"} as adjacent parallel branches with their shared nets at matching ends. Preserve all pin connections and capacitor polarity, leave room for labels, and reroute affected wires.`
339235
+ });
339236
+ }
339237
+ pins(id, signal, ground, box) {
339238
+ const ports = this.index.portsByComponent.get(id) ?? [];
339239
+ if (ports.length !== 2 || ports.some((p) => p.do_not_connect))
339240
+ return;
339241
+ const pins = [signal, ground].map((net) => {
339242
+ const source = ports.find((p) => this.index.connected(p.source_port_id) === net);
339243
+ return source && this.index.port(source);
339244
+ });
339245
+ const [first, second] = pins;
339246
+ if (!first || !second || pins.some((p) => p.schematic_sheet_id !== box.schematicSheetId || !Number.isFinite(p.center.x) || !Number.isFinite(p.center.y)))
339247
+ return;
339248
+ return [first, second];
339249
+ }
339250
+ static issueToString(issue) {
339251
+ const attrs = [];
339252
+ addAttr(attrs, "resistorComponentName", issue.resistorSchematicBox.sourceComponentName);
339253
+ addAttr(attrs, "capacitorComponentName", issue.capacitorSchematicBox.sourceComponentName);
339254
+ addAttr(attrs, "reason", issue.reason);
339255
+ addAttr(attrs, "message", issue.message);
339256
+ return `<ParallelRcNotAligned ${attrs.join(" ")} />`;
339257
+ }
339258
+ }
339259
+ function pinAxis(a, b) {
339260
+ const directions = new Set([a.facing_direction, b.facing_direction]);
339261
+ if (directions.has("left") && directions.has("right") && Math.abs(a.center.y - b.center.y) < 0.01 && Math.abs(a.center.x - b.center.x) > 0.01)
339262
+ return "horizontal";
339263
+ if (directions.has("up") && directions.has("down") && Math.abs(a.center.x - b.center.x) < 0.01 && Math.abs(a.center.y - b.center.y) > 0.01)
339264
+ return "vertical";
339265
+ }
339038
339266
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ParallelDiodeResistorPlacementSolver/ParallelDiodeResistorPlacementSolver.ts
339039
- class ParallelDiodeResistorPlacementSolver extends BaseSolver5 {
339267
+ import { BaseSolver as BaseSolver7 } from "@tscircuit/solver-utils";
339268
+ class ParallelDiodeResistorPlacementSolver extends BaseSolver7 {
339040
339269
  params;
339041
339270
  banks = [];
339042
339271
  bankIndex = 0;
@@ -339063,7 +339292,7 @@ class ParallelDiodeResistorPlacementSolver extends BaseSolver5 {
339063
339292
  const member = { diode, box };
339064
339293
  if (first && second && !ports.some((port) => port.do_not_connect) && pins.every((pin) => pin?.schematic_sheet_id === box.schematicSheetId)) {
339065
339294
  member.pins = [first, second];
339066
- member.axis = pinAxis(first, second);
339295
+ member.axis = pinAxis2(first, second);
339067
339296
  }
339068
339297
  const key = JSON.stringify(nets);
339069
339298
  const scopes = byNets.get(key) ?? [];
@@ -339125,19 +339354,242 @@ class ParallelDiodeResistorPlacementSolver extends BaseSolver5 {
339125
339354
  return `<ParallelDiodeResistorNotAligned ${attrs.join(" ")} />`;
339126
339355
  }
339127
339356
  }
339128
- function pinAxis(first, second) {
339357
+ function pinAxis2(first, second) {
339129
339358
  const directions = new Set([first.facing_direction, second.facing_direction]);
339130
339359
  if (directions.has("left") && directions.has("right") && Math.abs(first.center.y - second.center.y) < 0.01 && Math.abs(first.center.x - second.center.x) > 0.01)
339131
339360
  return "horizontal";
339132
339361
  if (directions.has("up") && directions.has("down") && Math.abs(first.center.x - second.center.x) < 0.01 && Math.abs(first.center.y - second.center.y) > 0.01)
339133
339362
  return "vertical";
339134
339363
  }
339364
+ // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SeriesLedChainPlacementSolver/SeriesLedChainPlacementSolver.ts
339365
+ import { BaseSolver as BaseSolver8 } from "@tscircuit/solver-utils";
339366
+ class SeriesLedChainPlacementSolver extends BaseSolver8 {
339367
+ params;
339368
+ index;
339369
+ ledIds;
339370
+ visited = new Set;
339371
+ unpopulated = new Set;
339372
+ constructor(params2) {
339373
+ super();
339374
+ this.params = params2;
339375
+ this.index = new PlacementNetworkIndex(params2.ctx);
339376
+ this.ledIds = new Set([...this.index.components.values()].filter((c) => c.ftype === "simple_led").map((c) => c.source_component_id));
339377
+ for (const e of params2.ctx.circuitJson)
339378
+ if (e.type === "pcb_component" && e.do_not_place)
339379
+ this.unpopulated.add(e.source_component_id);
339380
+ this.solved = this.ledIds.size === 0;
339381
+ }
339382
+ _step() {
339383
+ const start = [...this.ledIds].find((id) => !this.visited.has(id));
339384
+ if (!start) {
339385
+ this.solved = true;
339386
+ return;
339387
+ }
339388
+ const group = [start];
339389
+ this.visited.add(start);
339390
+ const neighbors = new Map;
339391
+ for (let i = 0;i < group.length; i++) {
339392
+ const id = group[i];
339393
+ const adjacent = new Set;
339394
+ for (const port of this.index.portsByComponent.get(id) ?? []) {
339395
+ for (const other of this.index.portsByNet.get(this.index.connected(port.source_port_id)) ?? []) {
339396
+ const otherId = other.source_component_id;
339397
+ if (otherId === id || !this.ledIds.has(otherId))
339398
+ continue;
339399
+ adjacent.add(otherId);
339400
+ if (!this.visited.has(otherId)) {
339401
+ this.visited.add(otherId);
339402
+ group.push(otherId);
339403
+ }
339404
+ }
339405
+ }
339406
+ neighbors.set(id, adjacent);
339407
+ }
339408
+ this.solved = this.visited.size === this.ledIds.size;
339409
+ if (group.length < 3)
339410
+ return;
339411
+ const ends = group.filter((id) => neighbors.get(id).size === 1);
339412
+ if (ends.length !== 2 || group.some((id) => neighbors.get(id).size > 2))
339413
+ return;
339414
+ const ordered = [ends.sort()[0]];
339415
+ while (ordered.length < group.length) {
339416
+ const last = ordered.at(-1);
339417
+ const previous = ordered.at(-2);
339418
+ const next = [...neighbors.get(last)].find((id) => id !== previous);
339419
+ if (!next || ordered.includes(next))
339420
+ return;
339421
+ ordered.push(next);
339422
+ }
339423
+ const boxes = ordered.map((id) => this.index.placement(id));
339424
+ if (boxes.some((box) => !box))
339425
+ return;
339426
+ const placements = boxes.filter((box) => box !== undefined);
339427
+ if (placements.some((box) => !this.index.sameLocalScope(placements[0], box) || ![box.schX, box.schY, box.width, box.height].every(Number.isFinite) || box.width <= 0 || box.height <= 0))
339428
+ return;
339429
+ for (const id of ordered) {
339430
+ const ports = this.index.portsByComponent.get(id) ?? [];
339431
+ if (this.unpopulated.has(id) || !this.index.twoTerminalNets(id) || ports.some((p) => p.do_not_connect))
339432
+ return;
339433
+ const placement = this.index.placement(id);
339434
+ for (const port of ports) {
339435
+ const pin = this.index.port(port);
339436
+ if (!pin || pin.schematic_sheet_id !== placement.schematicSheetId || !Number.isFinite(pin.center.x) || !Number.isFinite(pin.center.y) || !pin.facing_direction)
339437
+ return;
339438
+ }
339439
+ }
339440
+ const backtrackingConnections = [];
339441
+ for (let i = 1;i < ordered.length; i++) {
339442
+ const aId = ordered[i - 1], bId = ordered[i];
339443
+ const aNets = this.index.twoTerminalNets(aId);
339444
+ const common = this.index.twoTerminalNets(bId).filter((net) => aNets.includes(net));
339445
+ if (common.length !== 1 || this.index.isRail(common[0]))
339446
+ return;
339447
+ const ports = this.index.portsByNet.get(common[0]) ?? [];
339448
+ if (ports.length !== 2)
339449
+ return;
339450
+ const aSource = ports.find((p) => p.source_component_id === aId);
339451
+ const bSource = ports.find((p) => p.source_component_id === bId);
339452
+ const a = this.index.port(aSource), b = this.index.port(bSource);
339453
+ const dx = b.center.x - a.center.x, dy = b.center.y - a.center.y;
339454
+ const pinDistance = Math.hypot(dx, dy);
339455
+ const span = Math.max(placements[i - 1].width, placements[i - 1].height, placements[i].width, placements[i].height);
339456
+ if (pinDistance > Math.max(4, 3 * span) && (outwardDistance(a, dx, dy) < -span || outwardDistance(b, -dx, -dy) < -span)) {
339457
+ backtrackingConnections.push({
339458
+ firstSourcePortId: aSource.source_port_id,
339459
+ secondSourcePortId: bSource.source_port_id,
339460
+ pinDistance
339461
+ });
339462
+ }
339463
+ }
339464
+ if (!backtrackingConnections.length)
339465
+ return;
339466
+ const names = placements.map((box) => box.sourceComponentName || "LED").join(", ");
339467
+ this.params.issues.push({
339468
+ lineItemType: "SeriesLedChainNotOrdered",
339469
+ ledSchematicBoxes: placements,
339470
+ backtrackingConnections,
339471
+ message: `Arrange ${names} in their connected series order so adjacent LEDs do not require long connections behind their pins. Move or rotate the symbols while preserving anode/cathode connections; allow space for labels and reroute affected traces. A horizontal, vertical, or clearly connected folded chain is acceptable.`
339472
+ });
339473
+ }
339474
+ static issueToString(issue) {
339475
+ const attrs = [];
339476
+ addAttr(attrs, "ledComponents", issue.ledSchematicBoxes.map((box) => box.sourceComponentName).join(","));
339477
+ addAttr(attrs, "backtrackingConnections", issue.backtrackingConnections.length);
339478
+ addAttr(attrs, "maxPinDistance", Math.max(...issue.backtrackingConnections.map((link) => link.pinDistance)));
339479
+ addAttr(attrs, "message", issue.message);
339480
+ return `<SeriesLedChainNotOrdered ${attrs.join(" ")} />`;
339481
+ }
339482
+ }
339483
+ function outwardDistance(pin, dx, dy) {
339484
+ switch (pin.facing_direction) {
339485
+ case "left":
339486
+ return -dx;
339487
+ case "right":
339488
+ return dx;
339489
+ case "up":
339490
+ return dy;
339491
+ case "down":
339492
+ return -dy;
339493
+ default:
339494
+ return 0;
339495
+ }
339496
+ }
339497
+
339498
+ // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ChipPinResistorPlacementSolver/ChipPinResistorPlacementSolver.ts
339499
+ import { BaseSolver as BaseSolver9 } from "@tscircuit/solver-utils";
339500
+ class ChipPinResistorPlacementSolver extends BaseSolver9 {
339501
+ params;
339502
+ index;
339503
+ resistorIds;
339504
+ unpopulated = new Set;
339505
+ currentIndex = 0;
339506
+ constructor(params2) {
339507
+ super();
339508
+ this.params = params2;
339509
+ this.index = new PlacementNetworkIndex(params2.ctx);
339510
+ for (const element of params2.ctx.circuitJson)
339511
+ if (element.type === "pcb_component" && element.do_not_place)
339512
+ this.unpopulated.add(element.source_component_id);
339513
+ this.resistorIds = [...this.index.components.values()].filter((component) => component.ftype === "simple_resistor").map((component) => component.source_component_id);
339514
+ this.solved = this.resistorIds.length === 0;
339515
+ }
339516
+ _step() {
339517
+ const resistorId = this.resistorIds[this.currentIndex++];
339518
+ this.solved = this.currentIndex >= this.resistorIds.length;
339519
+ if (!resistorId || this.unpopulated.has(resistorId))
339520
+ return;
339521
+ const index = this.index;
339522
+ const component = index.components.get(resistorId);
339523
+ const resistor = index.placement(resistorId);
339524
+ const nets = index.twoTerminalNets(resistorId);
339525
+ const resistorPorts = index.portsByComponent.get(resistorId) ?? [];
339526
+ if (component?.ftype !== "simple_resistor" || !Number.isFinite(component.resistance) || component.resistance <= 0 || !resistor || !nets || resistorPorts.some((p) => p.do_not_connect))
339527
+ return;
339528
+ const grounds = nets.filter((net) => index.groundNets.has(net) && !index.powerNets.has(net));
339529
+ if (grounds.length !== 1)
339530
+ return;
339531
+ const signal = nets.find((net) => net !== grounds[0]);
339532
+ if (index.isRail(signal))
339533
+ return;
339534
+ const members = index.portsByNet.get(signal) ?? [];
339535
+ if (members.length !== 2)
339536
+ return;
339537
+ const chipPort = members.find((p) => p.source_component_id !== resistorId);
339538
+ const resistorPort = members.find((p) => p.source_component_id === resistorId);
339539
+ if (!chipPort || !resistorPort || chipPort.do_not_connect || hasSupplyRole(chipPort))
339540
+ return;
339541
+ const hostId = chipPort.source_component_id;
339542
+ const host = index.placement(hostId);
339543
+ if (index.components.get(hostId)?.ftype !== "simple_chip" || (index.portsByComponent.get(hostId)?.length ?? 0) < 3 || this.unpopulated.has(hostId) || !host || !index.sameLocalScope(host, resistor))
339544
+ return;
339545
+ const chipPin = index.port(chipPort);
339546
+ const resistorPin = index.port(resistorPort);
339547
+ if (!chipPin || !resistorPin || [chipPin, resistorPin].some((pin) => pin.schematic_sheet_id !== host.schematicSheetId || !Number.isFinite(pin.center.x) || !Number.isFinite(pin.center.y)) || [host, resistor].some((box) => ![box.schX, box.schY, box.width, box.height].every(Number.isFinite) || box.width <= 0 || box.height <= 0))
339548
+ return;
339549
+ const side = chipPin.facing_direction;
339550
+ if (!side)
339551
+ return;
339552
+ const horizontal = side === "left" || side === "right";
339553
+ const sign = side === "left" || side === "down" ? -1 : 1;
339554
+ const oppositeDistance = -sign * (horizontal ? resistor.schX - host.schX : resistor.schY - host.schY);
339555
+ const halfBodies = horizontal ? (host.width + resistor.width) / 2 : (host.height + resistor.height) / 2;
339556
+ if (oppositeDistance <= halfBodies + 0.2)
339557
+ return;
339558
+ const pinDistance = Math.hypot(chipPin.center.x - resistorPin.center.x, chipPin.center.y - resistorPin.center.y);
339559
+ const maxRecommendedPinDistance = Math.max(4, 3 * Math.max(resistor.width, resistor.height));
339560
+ if (pinDistance <= maxRecommendedPinDistance)
339561
+ return;
339562
+ this.params.issues.push({
339563
+ lineItemType: "ResistorSeparatedFromChipPin",
339564
+ hostSchematicBox: host,
339565
+ resistorSchematicBox: resistor,
339566
+ chipSourcePortId: chipPort.source_port_id,
339567
+ resistorSourcePortId: resistorPort.source_port_id,
339568
+ pinDistance,
339569
+ maxRecommendedPinDistance,
339570
+ message: `Place ${resistor.sourceComponentName || "resistor"} beside its connected pin on the ${side} side of ${host.sourceComponentName || "chip"} so the resistor-to-ground branch can be read together. Preserve pin connections, leave room for labels, and reroute affected traces; exact alignment is not required.`
339571
+ });
339572
+ }
339573
+ static issueToString(issue) {
339574
+ const attrs = [];
339575
+ addAttr(attrs, "hostComponentName", issue.hostSchematicBox.sourceComponentName);
339576
+ addAttr(attrs, "resistorName", issue.resistorSchematicBox.sourceComponentName);
339577
+ addAttr(attrs, "pinDistance", issue.pinDistance);
339578
+ addAttr(attrs, "maxRecommendedPinDistance", issue.maxRecommendedPinDistance);
339579
+ addAttr(attrs, "message", issue.message);
339580
+ return `<ResistorSeparatedFromChipPin ${attrs.join(" ")} />`;
339581
+ }
339582
+ }
339583
+ function hasSupplyRole(port) {
339584
+ return Boolean(port.requires_power || port.provides_power || port.requires_ground || port.provides_ground || port.requires_voltage !== undefined || port.provides_voltage !== undefined);
339585
+ }
339586
+
339135
339587
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/RailPathVisibilitySolver/RailPathVisibilitySolver.ts
339136
- import { BaseSolver as BaseSolver6 } from "@tscircuit/solver-utils";
339588
+ import { BaseSolver as BaseSolver10 } from "@tscircuit/solver-utils";
339137
339589
  var distance49 = (a, b) => Math.hypot(a.x - b.x, a.y - b.y);
339138
339590
  var EPS6 = 0.001;
339139
339591
 
339140
- class RailPathVisibilitySolver extends BaseSolver6 {
339592
+ class RailPathVisibilitySolver extends BaseSolver10 {
339141
339593
  index;
339142
339594
  nodes = new Map;
339143
339595
  starts = [];
@@ -339356,8 +339808,8 @@ function pointOnSegment(p, a, b) {
339356
339808
  }
339357
339809
 
339358
339810
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ChipPinPairCapacitorPlacementSolver/ChipPinPairCapacitorPlacementSolver.ts
339359
- import { BaseSolver as BaseSolver7 } from "@tscircuit/solver-utils";
339360
- class ChipPinPairCapacitorPlacementSolver extends BaseSolver7 {
339811
+ import { BaseSolver as BaseSolver11 } from "@tscircuit/solver-utils";
339812
+ class ChipPinPairCapacitorPlacementSolver extends BaseSolver11 {
339361
339813
  params;
339362
339814
  index;
339363
339815
  capacitorIds;
@@ -339383,7 +339835,7 @@ class ChipPinPairCapacitorPlacementSolver extends BaseSolver7 {
339383
339835
  const capacitor = index.placement(capacitorId);
339384
339836
  const capacitorPorts = index.portsByComponent.get(capacitorId) ?? [];
339385
339837
  const nets = index.twoTerminalNets(capacitorId);
339386
- if (component?.ftype !== "simple_capacitor" || !Number.isFinite(component.capacitance) || component.capacitance <= 0 || !capacitor || !nets || nets.some((net) => index.isRail(net)) || capacitorPorts.some((port) => port.do_not_connect || hasSupplyRole(port)))
339838
+ if (component?.ftype !== "simple_capacitor" || !Number.isFinite(component.capacitance) || component.capacitance <= 0 || !capacitor || !nets || nets.some((net) => index.isRail(net)) || capacitorPorts.some((port) => port.do_not_connect || hasSupplyRole2(port)))
339387
339839
  return;
339388
339840
  const peers = nets.map((net) => {
339389
339841
  const members = index.portsByNet.get(net) ?? [];
@@ -339392,7 +339844,7 @@ class ChipPinPairCapacitorPlacementSolver extends BaseSolver7 {
339392
339844
  return members.find((port) => port.source_component_id !== capacitorId);
339393
339845
  });
339394
339846
  const [first, second] = peers;
339395
- if (!first || !second || first.source_component_id !== second.source_component_id || first.do_not_connect || second.do_not_connect || hasSupplyRole(first) || hasSupplyRole(second))
339847
+ if (!first || !second || first.source_component_id !== second.source_component_id || first.do_not_connect || second.do_not_connect || hasSupplyRole2(first) || hasSupplyRole2(second))
339396
339848
  return;
339397
339849
  const hostId = first.source_component_id;
339398
339850
  const host = index.placement(hostId);
@@ -339443,13 +339895,13 @@ class ChipPinPairCapacitorPlacementSolver extends BaseSolver7 {
339443
339895
  return `<CapacitorSeparatedFromChipPins ${attrs.join(" ")} />`;
339444
339896
  }
339445
339897
  }
339446
- function hasSupplyRole(port) {
339898
+ function hasSupplyRole2(port) {
339447
339899
  return Boolean(port.requires_power || port.provides_power || port.requires_ground || port.provides_ground || port.requires_voltage !== undefined || port.provides_voltage !== undefined);
339448
339900
  }
339449
339901
 
339450
339902
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/PiFilterPlacementSolver/PiFilterPlacementSolver.ts
339451
- import { BaseSolver as BaseSolver8 } from "@tscircuit/solver-utils";
339452
- class PiFilterPlacementSolver extends BaseSolver8 {
339903
+ import { BaseSolver as BaseSolver12 } from "@tscircuit/solver-utils";
339904
+ class PiFilterPlacementSolver extends BaseSolver12 {
339453
339905
  params;
339454
339906
  index;
339455
339907
  inductorIds;
@@ -339546,8 +339998,8 @@ class PiFilterPlacementSolver extends BaseSolver8 {
339546
339998
  }
339547
339999
 
339548
340000
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/MosfetGateNetworkPlacementSolver/MosfetGateNetworkPlacementSolver.ts
339549
- import { BaseSolver as BaseSolver9 } from "@tscircuit/solver-utils";
339550
- class MosfetGateNetworkPlacementSolver extends BaseSolver9 {
340001
+ import { BaseSolver as BaseSolver13 } from "@tscircuit/solver-utils";
340002
+ class MosfetGateNetworkPlacementSolver extends BaseSolver13 {
339551
340003
  params;
339552
340004
  index;
339553
340005
  mosfetIds;
@@ -339652,8 +340104,8 @@ function bodyGap(a, b) {
339652
340104
  }
339653
340105
 
339654
340106
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/RelayFlybackDiodePlacementSolver/RelayFlybackDiodePlacementSolver.ts
339655
- import { BaseSolver as BaseSolver10 } from "@tscircuit/solver-utils";
339656
- class RelayFlybackDiodePlacementSolver extends BaseSolver10 {
340107
+ import { BaseSolver as BaseSolver14 } from "@tscircuit/solver-utils";
340108
+ class RelayFlybackDiodePlacementSolver extends BaseSolver14 {
339657
340109
  params;
339658
340110
  index;
339659
340111
  relayIds;
@@ -339782,10 +340234,10 @@ function hasHint(port, pattern) {
339782
340234
  }
339783
340235
 
339784
340236
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/CurrentSenseShuntPlacementSolver/CurrentSenseShuntPlacementSolver.ts
339785
- import { BaseSolver as BaseSolver11 } from "@tscircuit/solver-utils";
340237
+ import { BaseSolver as BaseSolver15 } from "@tscircuit/solver-utils";
339786
340238
  var EPSILON3 = 0.01;
339787
340239
 
339788
- class CurrentSenseShuntPlacementSolver extends BaseSolver11 {
340240
+ class CurrentSenseShuntPlacementSolver extends BaseSolver15 {
339789
340241
  params;
339790
340242
  index;
339791
340243
  hostIds;
@@ -339935,8 +340387,8 @@ function onSegment4(point, from, to) {
339935
340387
  }
339936
340388
 
339937
340389
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/VoltageDividerPlacementSolver/VoltageDividerPlacementSolver.ts
339938
- import { BaseSolver as BaseSolver12 } from "@tscircuit/solver-utils";
339939
- class VoltageDividerPlacementSolver extends BaseSolver12 {
340390
+ import { BaseSolver as BaseSolver16 } from "@tscircuit/solver-utils";
340391
+ class VoltageDividerPlacementSolver extends BaseSolver16 {
339940
340392
  params;
339941
340393
  index;
339942
340394
  positiveNets = new Set;
@@ -340032,8 +340484,8 @@ class VoltageDividerPlacementSolver extends BaseSolver12 {
340032
340484
  }
340033
340485
 
340034
340486
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/RegulatorInputOutputCapacitorPlacementSolver/RegulatorInputOutputCapacitorPlacementSolver.ts
340035
- import { BaseSolver as BaseSolver13 } from "@tscircuit/solver-utils";
340036
- class RegulatorInputOutputCapacitorPlacementSolver extends BaseSolver13 {
340487
+ import { BaseSolver as BaseSolver17 } from "@tscircuit/solver-utils";
340488
+ class RegulatorInputOutputCapacitorPlacementSolver extends BaseSolver17 {
340037
340489
  params;
340038
340490
  index;
340039
340491
  hostIds;
@@ -340153,7 +340605,7 @@ function portRole(port) {
340153
340605
  }
340154
340606
 
340155
340607
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ConnectorPlacementSolver/ConnectorPlacementSolver.ts
340156
- import { BaseSolver as BaseSolver14 } from "@tscircuit/solver-utils";
340608
+ import { BaseSolver as BaseSolver18 } from "@tscircuit/solver-utils";
340157
340609
 
340158
340610
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/utils/geometry.ts
340159
340611
  function centeredRect(cx, cy, w, h) {
@@ -340183,7 +340635,7 @@ var distance50 = (a, b) => Math.abs(a.x - b.x) + Math.abs(a.y - b.y);
340183
340635
  var near = (a, b) => distance50(a, b) <= EPSILON4;
340184
340636
  var round = (value) => Math.round(value * 100) / 100;
340185
340637
 
340186
- class ConnectorPlacementSolver extends BaseSolver14 {
340638
+ class ConnectorPlacementSolver extends BaseSolver18 {
340187
340639
  params;
340188
340640
  constructor(params2) {
340189
340641
  super();
@@ -340369,8 +340821,8 @@ function segmentCrossesBox(a, b, box) {
340369
340821
  }
340370
340822
 
340371
340823
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/LowSideTransistorPlacementSolver/LowSideTransistorPlacementSolver.ts
340372
- import { BaseSolver as BaseSolver15 } from "@tscircuit/solver-utils";
340373
- class LowSideTransistorPlacementSolver extends BaseSolver15 {
340824
+ import { BaseSolver as BaseSolver19 } from "@tscircuit/solver-utils";
340825
+ class LowSideTransistorPlacementSolver extends BaseSolver19 {
340374
340826
  index;
340375
340827
  positiveNets = new Set;
340376
340828
  transistorIds;
@@ -340490,8 +340942,8 @@ class LowSideTransistorPlacementSolver extends BaseSolver15 {
340490
340942
  }
340491
340943
 
340492
340944
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/UsbSeriesResistorPlacementSolver/UsbSeriesResistorPlacementSolver.ts
340493
- import { BaseSolver as BaseSolver16 } from "@tscircuit/solver-utils";
340494
- class UsbSeriesResistorPlacementSolver extends BaseSolver16 {
340945
+ import { BaseSolver as BaseSolver20 } from "@tscircuit/solver-utils";
340946
+ class UsbSeriesResistorPlacementSolver extends BaseSolver20 {
340495
340947
  params;
340496
340948
  index;
340497
340949
  hostIds;
@@ -340611,7 +341063,7 @@ function usbRole(port) {
340611
341063
  }
340612
341064
 
340613
341065
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/CapacitorOrientationSolver/CapacitorOrientationSolver.ts
340614
- import { BaseSolver as BaseSolver17 } from "@tscircuit/solver-utils";
341066
+ import { BaseSolver as BaseSolver21 } from "@tscircuit/solver-utils";
340615
341067
 
340616
341068
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/utils/graphics.ts
340617
341069
  import { mergeGraphics as mergeGraphics2 } from "graphics-debug";
@@ -340646,7 +341098,7 @@ function visualizeCircuitJson(circuitJson) {
340646
341098
  }
340647
341099
 
340648
341100
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/CapacitorOrientationSolver/CapacitorOrientationSolver.ts
340649
- class CapacitorOrientationSolver extends BaseSolver17 {
341101
+ class CapacitorOrientationSolver extends BaseSolver21 {
340650
341102
  static EPSILON = 0.01;
340651
341103
  static ORIENTATION_MESSAGE = 'Use schOrientation="vertical" on this capacitor to fix the symbol orientation';
340652
341104
  ctx;
@@ -340791,8 +341243,8 @@ class CapacitorOrientationSolver extends BaseSolver17 {
340791
341243
  }
340792
341244
 
340793
341245
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/DecouplingCapacitorGroupingSolver/DecouplingCapacitorGroupingSolver.ts
340794
- import { BaseSolver as BaseSolver18 } from "@tscircuit/solver-utils";
340795
- class DecouplingCapacitorGroupingSolver extends BaseSolver18 {
341246
+ import { BaseSolver as BaseSolver22 } from "@tscircuit/solver-utils";
341247
+ class DecouplingCapacitorGroupingSolver extends BaseSolver22 {
340796
341248
  params;
340797
341249
  static MIN_BODY_GAP = 1;
340798
341250
  banks = [];
@@ -340936,8 +341388,8 @@ function getNetLabelBounds(label) {
340936
341388
  }
340937
341389
 
340938
341390
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ComponentNetLabelCollisionSolver/ComponentNetLabelCollisionSolver.ts
340939
- import { BaseSolver as BaseSolver19 } from "@tscircuit/solver-utils";
340940
- class ComponentNetLabelCollisionSolver extends BaseSolver19 {
341391
+ import { BaseSolver as BaseSolver23 } from "@tscircuit/solver-utils";
341392
+ class ComponentNetLabelCollisionSolver extends BaseSolver23 {
340941
341393
  params;
340942
341394
  placements;
340943
341395
  netLabelsByComponentId;
@@ -341261,8 +341713,8 @@ class ComponentNetLabelCollisionSolver extends BaseSolver19 {
341261
341713
  }
341262
341714
 
341263
341715
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ComponentPinAlignmentSolver/ComponentPinAlignmentSolver.ts
341264
- import { BaseSolver as BaseSolver20 } from "@tscircuit/solver-utils";
341265
- class ComponentPinAlignmentSolver extends BaseSolver20 {
341716
+ import { BaseSolver as BaseSolver24 } from "@tscircuit/solver-utils";
341717
+ class ComponentPinAlignmentSolver extends BaseSolver24 {
341266
341718
  static ALIGNMENT_EPSILON = 0.01;
341267
341719
  ctx;
341268
341720
  out;
@@ -341396,8 +341848,8 @@ class ComponentPinAlignmentSolver extends BaseSolver20 {
341396
341848
  }
341397
341849
 
341398
341850
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/CrystalLoadCapacitorPlacementSolver/CrystalLoadCapacitorPlacementSolver.ts
341399
- import { BaseSolver as BaseSolver21 } from "@tscircuit/solver-utils";
341400
- class CrystalLoadCapacitorPlacementSolver extends BaseSolver21 {
341851
+ import { BaseSolver as BaseSolver25 } from "@tscircuit/solver-utils";
341852
+ class CrystalLoadCapacitorPlacementSolver extends BaseSolver25 {
341401
341853
  static ALIGNMENT_TOLERANCE = 0.1;
341402
341854
  issues;
341403
341855
  networks;
@@ -341557,9 +342009,9 @@ var distance51 = (first, second) => Math.hypot(first.schX - second.schX, first.s
341557
342009
  var round2 = (value) => Math.round(value * 100) / 100;
341558
342010
 
341559
342011
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/DiodeResistorAlignmentSolver/DiodeResistorAlignmentSolver.ts
341560
- import { BaseSolver as BaseSolver22 } from "@tscircuit/solver-utils";
342012
+ import { BaseSolver as BaseSolver26 } from "@tscircuit/solver-utils";
341561
342013
  import { getSourcePortConnectivityMapFromCircuitJson as getSourcePortConnectivityMapFromCircuitJson2 } from "circuit-json-to-connectivity-map";
341562
- class DiodeResistorAlignmentSolver extends BaseSolver22 {
342014
+ class DiodeResistorAlignmentSolver extends BaseSolver26 {
341563
342015
  static DIODE_FTYPES = new Set(["simple_led", "simple_diode"]);
341564
342016
  ctx;
341565
342017
  out;
@@ -341725,8 +342177,8 @@ class DiodeResistorAlignmentSolver extends BaseSolver22 {
341725
342177
  }
341726
342178
 
341727
342179
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/FeedbackNetworkPlacementSolver/FeedbackNetworkPlacementSolver.ts
341728
- import { BaseSolver as BaseSolver23 } from "@tscircuit/solver-utils";
341729
- class FeedbackNetworkPlacementSolver extends BaseSolver23 {
342180
+ import { BaseSolver as BaseSolver27 } from "@tscircuit/solver-utils";
342181
+ class FeedbackNetworkPlacementSolver extends BaseSolver27 {
341730
342182
  static MIN_BODY_GAP = 4;
341731
342183
  index;
341732
342184
  amplifierIds;
@@ -341811,7 +342263,7 @@ function distanceBetweenBoxes(a, b) {
341811
342263
  }
341812
342264
 
341813
342265
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/PullResistorPlacementSolver/PullResistorPlacementSolver.ts
341814
- import { BaseSolver as BaseSolver24 } from "@tscircuit/solver-utils";
342266
+ import { BaseSolver as BaseSolver28 } from "@tscircuit/solver-utils";
341815
342267
 
341816
342268
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/utils/switch-pull-resistor-pairs.ts
341817
342269
  function getSwitchPullResistorPairs(index) {
@@ -341875,7 +342327,7 @@ function getHorizontalPushbuttonComponentIds(index) {
341875
342327
  }
341876
342328
 
341877
342329
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/PullResistorPlacementSolver/PullResistorPlacementSolver.ts
341878
- class PullResistorPlacementSolver extends BaseSolver24 {
342330
+ class PullResistorPlacementSolver extends BaseSolver28 {
341879
342331
  static MIN_WRONG_SIDE_GAP = 1.5;
341880
342332
  index;
341881
342333
  resistorIds;
@@ -341975,8 +342427,8 @@ class PullResistorPlacementSolver extends BaseSolver24 {
341975
342427
  }
341976
342428
 
341977
342429
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/TwoPinComponentRailOrientationSolver/TwoPinComponentRailOrientationSolver.ts
341978
- import { BaseSolver as BaseSolver25 } from "@tscircuit/solver-utils";
341979
- class TwoPinComponentRailOrientationSolver extends BaseSolver25 {
342430
+ import { BaseSolver as BaseSolver29 } from "@tscircuit/solver-utils";
342431
+ class TwoPinComponentRailOrientationSolver extends BaseSolver29 {
341980
342432
  static EPSILON = 0.01;
341981
342433
  index;
341982
342434
  powerNets;
@@ -342291,8 +342743,8 @@ var polygonBounds = (polygons) => {
342291
342743
  };
342292
342744
 
342293
342745
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SchematicBoxInnerLabelCollisionSolver/SchematicBoxInnerLabelCollisionSolver.ts
342294
- import { BaseSolver as BaseSolver26 } from "@tscircuit/solver-utils";
342295
- class SchematicBoxInnerLabelCollisionSolver extends BaseSolver26 {
342746
+ import { BaseSolver as BaseSolver30 } from "@tscircuit/solver-utils";
342747
+ class SchematicBoxInnerLabelCollisionSolver extends BaseSolver30 {
342296
342748
  params;
342297
342749
  entries;
342298
342750
  placementById;
@@ -342397,8 +342849,8 @@ class SchematicBoxInnerLabelCollisionSolver extends BaseSolver26 {
342397
342849
  }
342398
342850
 
342399
342851
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SchematicBoxOverlapSolver/SchematicBoxOverlapSolver.ts
342400
- import { BaseSolver as BaseSolver27 } from "@tscircuit/solver-utils";
342401
- class SchematicBoxOverlapSolver extends BaseSolver27 {
342852
+ import { BaseSolver as BaseSolver31 } from "@tscircuit/solver-utils";
342853
+ class SchematicBoxOverlapSolver extends BaseSolver31 {
342402
342854
  params;
342403
342855
  placements;
342404
342856
  firstIndex = 0;
@@ -342657,8 +343109,8 @@ function contentsFit(resized, ports, labelBankGap = INNER_LABEL_COLLISION_PADDIN
342657
343109
  }
342658
343110
 
342659
343111
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SchematicBoxTooWideSolver/SchematicBoxTooWideSolver.ts
342660
- import { BaseSolver as BaseSolver28 } from "@tscircuit/solver-utils";
342661
- class SchematicBoxTooWideSolver extends BaseSolver28 {
343112
+ import { BaseSolver as BaseSolver32 } from "@tscircuit/solver-utils";
343113
+ class SchematicBoxTooWideSolver extends BaseSolver32 {
342662
343114
  params;
342663
343115
  SCHEMATIC_BOX_TOO_WIDE_MESSAGE = "Shrink schematic box width";
342664
343116
  PIN_HEADER_MAX_ALLOWED_GAP = 0.1;
@@ -342818,8 +343270,8 @@ class SchematicBoxTooWideSolver extends BaseSolver28 {
342818
343270
  }
342819
343271
 
342820
343272
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SchematicPinPaddingToEdgeSolver/SchematicPinPaddingToEdgeSolver.ts
342821
- import { BaseSolver as BaseSolver29 } from "@tscircuit/solver-utils";
342822
- class SchematicPinPaddingToEdgeSolver extends BaseSolver29 {
343273
+ import { BaseSolver as BaseSolver33 } from "@tscircuit/solver-utils";
343274
+ class SchematicPinPaddingToEdgeSolver extends BaseSolver33 {
342823
343275
  params;
342824
343276
  MESSAGE = "Move schematic pins closer to the box edge or change the schematic box";
342825
343277
  GAP_COMPARISON_EPSILON = 0.000000001;
@@ -343190,8 +343642,8 @@ var buildSolverContext = (circuitJson) => {
343190
343642
  };
343191
343643
 
343192
343644
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SwitchPullResistorPlacementSolver/SwitchPullResistorPlacementSolver.ts
343193
- import { BaseSolver as BaseSolver30 } from "@tscircuit/solver-utils";
343194
- class SwitchPullResistorPlacementSolver extends BaseSolver30 {
343645
+ import { BaseSolver as BaseSolver34 } from "@tscircuit/solver-utils";
343646
+ class SwitchPullResistorPlacementSolver extends BaseSolver34 {
343195
343647
  params;
343196
343648
  constructor(params2) {
343197
343649
  super();
@@ -343260,8 +343712,8 @@ function getTraceName(circuitJson, trace) {
343260
343712
 
343261
343713
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/TraceSimplificationSolver/TraceSimplificationSolver.ts
343262
343714
  import { calculateElbow as calculateElbow2 } from "calculate-elbow/lib";
343263
- import { BaseSolver as BaseSolver31 } from "@tscircuit/solver-utils";
343264
- class TraceSimplificationSolver extends BaseSolver31 {
343715
+ import { BaseSolver as BaseSolver35 } from "@tscircuit/solver-utils";
343716
+ class TraceSimplificationSolver extends BaseSolver35 {
343265
343717
  static EPSILON = 0.01;
343266
343718
  ctx;
343267
343719
  out;
@@ -343619,7 +344071,7 @@ class TraceSimplificationSolver extends BaseSolver31 {
343619
344071
  }
343620
344072
 
343621
344073
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/TwoPinComponentOrientationSolver/TwoPinComponentOrientationSolver.ts
343622
- import { BaseSolver as BaseSolver32 } from "@tscircuit/solver-utils";
344074
+ import { BaseSolver as BaseSolver36 } from "@tscircuit/solver-utils";
343623
344075
 
343624
344076
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/TwoPinComponentOrientationSolver/getPowerOrGroundConnectionIds.ts
343625
344077
  import {
@@ -343658,7 +344110,7 @@ function getPowerOrGroundConnectionIds(circuitJson) {
343658
344110
  }
343659
344111
 
343660
344112
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/TwoPinComponentOrientationSolver/TwoPinComponentOrientationSolver.ts
343661
- class TwoPinComponentOrientationSolver extends BaseSolver32 {
344113
+ class TwoPinComponentOrientationSolver extends BaseSolver36 {
343662
344114
  static EPSILON = 0.01;
343663
344115
  ctx;
343664
344116
  out;
@@ -343904,8 +344356,8 @@ class TwoPinComponentOrientationSolver extends BaseSolver32 {
343904
344356
  }
343905
344357
 
343906
344358
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/VerboseNetLabelSolver/VerboseNetLabelSolver.ts
343907
- import { BaseSolver as BaseSolver33 } from "@tscircuit/solver-utils";
343908
- class VerboseNetLabelSolver extends BaseSolver33 {
344359
+ import { BaseSolver as BaseSolver37 } from "@tscircuit/solver-utils";
344360
+ class VerboseNetLabelSolver extends BaseSolver37 {
343909
344361
  params;
343910
344362
  VERBOSE_NET_LABEL_MESSAGE = "Create trace with schDisplayLabel";
343911
344363
  netLabels;
@@ -344014,8 +344466,8 @@ class VerboseNetLabelSolver extends BaseSolver33 {
344014
344466
  }
344015
344467
 
344016
344468
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SchematicTextClearanceSolver/SchematicTextClearanceSolver.ts
344017
- import { BaseSolver as BaseSolver34 } from "@tscircuit/solver-utils";
344018
- class SchematicTextClearanceSolver extends BaseSolver34 {
344469
+ import { BaseSolver as BaseSolver38 } from "@tscircuit/solver-utils";
344470
+ class SchematicTextClearanceSolver extends BaseSolver38 {
344019
344471
  params;
344020
344472
  texts;
344021
344473
  obstacles;
@@ -344167,8 +344619,8 @@ class SchematicTextClearanceSolver extends BaseSolver34 {
344167
344619
  }
344168
344620
 
344169
344621
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/ResetNetworkGroupingSolver/ResetNetworkGroupingSolver.ts
344170
- import { BaseSolver as BaseSolver35 } from "@tscircuit/solver-utils";
344171
- class ResetNetworkGroupingSolver extends BaseSolver35 {
344622
+ import { BaseSolver as BaseSolver39 } from "@tscircuit/solver-utils";
344623
+ class ResetNetworkGroupingSolver extends BaseSolver39 {
344172
344624
  params;
344173
344625
  static MIN_DISTANCE = 6;
344174
344626
  networks;
@@ -344323,8 +344775,11 @@ var resetPinName = (port) => [port.name, ...port.port_hints ?? []].find((name) =
344323
344775
 
344324
344776
  // node_modules/@tscircuit/circuit-json-schematic-placement-analysis/lib/solvers/SchematicPlacementPipeline/SchematicPlacementPipeline.ts
344325
344777
  var solversByIssueType = {
344778
+ SeriesLedChainNotOrdered: [SeriesLedChainPlacementSolver],
344326
344779
  RailPathTooSpreadOut: [RailPathVisibilitySolver],
344780
+ ResistorSeparatedFromChipPin: [ChipPinResistorPlacementSolver],
344327
344781
  CapacitorSeparatedFromChipPins: [ChipPinPairCapacitorPlacementSolver],
344782
+ DiodeCapacitorJunctionTooSpreadOut: [DiodeCapacitorStagePlacementSolver],
344328
344783
  PiFilterComponentsNotGrouped: [PiFilterPlacementSolver],
344329
344784
  MosfetGateNetworkNotGrouped: [MosfetGateNetworkPlacementSolver],
344330
344785
  FlybackDiodeSeparatedFromRelayCoil: [RelayFlybackDiodePlacementSolver],
@@ -344340,6 +344795,7 @@ var solversByIssueType = {
344340
344795
  SchematicBoxInnerLabelCollision: [SchematicBoxInnerLabelCollisionSolver],
344341
344796
  SchematicPinPaddingToEdgeTooLarge: [SchematicPinPaddingToEdgeSolver],
344342
344797
  DiodeResistorNotAligned: [DiodeResistorAlignmentSolver],
344798
+ ParallelRcNotAligned: [ParallelRcPlacementSolver],
344343
344799
  ParallelDiodeResistorNotAligned: [ParallelDiodeResistorPlacementSolver],
344344
344800
  ComponentPinsWouldAlignWithVerticalShift: [ComponentPinAlignmentSolver],
344345
344801
  TraceCanBeSimplifiedByMovingComponent: [TraceSimplificationSolver],
@@ -344374,6 +344830,12 @@ class SchematicPlacementPipeline extends BasePipelineSolver2 {
344374
344830
  ctx;
344375
344831
  issues = [];
344376
344832
  pipelineDef = [
344833
+ definePipelineStep3("SeriesLedChainPlacementSolver", SeriesLedChainPlacementSolver, (p) => [
344834
+ { ctx: p.ctx, issues: p.issues }
344835
+ ]),
344836
+ definePipelineStep3("ParallelRcPlacementSolver", ParallelRcPlacementSolver, (p) => [
344837
+ { ctx: p.ctx, issues: p.issues }
344838
+ ]),
344377
344839
  definePipelineStep3("ParallelDiodeResistorPlacementSolver", ParallelDiodeResistorPlacementSolver, (p) => [
344378
344840
  { ctx: p.ctx, issues: p.issues }
344379
344841
  ]),
@@ -344455,12 +344917,18 @@ class SchematicPlacementPipeline extends BasePipelineSolver2 {
344455
344917
  definePipelineStep3("RelayFlybackDiodePlacementSolver", RelayFlybackDiodePlacementSolver, (p) => [
344456
344918
  { ctx: p.ctx, issues: p.issues }
344457
344919
  ]),
344920
+ definePipelineStep3("DiodeCapacitorStagePlacementSolver", DiodeCapacitorStagePlacementSolver, (p) => [
344921
+ { ctx: p.ctx, issues: p.issues }
344922
+ ]),
344458
344923
  definePipelineStep3("PiFilterPlacementSolver", PiFilterPlacementSolver, (p) => [
344459
344924
  { ctx: p.ctx, issues: p.issues }
344460
344925
  ]),
344461
344926
  definePipelineStep3("MosfetGateNetworkPlacementSolver", MosfetGateNetworkPlacementSolver, (p) => [
344462
344927
  { ctx: p.ctx, issues: p.issues }
344463
344928
  ]),
344929
+ definePipelineStep3("ChipPinResistorPlacementSolver", ChipPinResistorPlacementSolver, (p) => [
344930
+ { ctx: p.ctx, issues: p.issues }
344931
+ ]),
344464
344932
  definePipelineStep3("ChipPinPairCapacitorPlacementSolver", ChipPinPairCapacitorPlacementSolver, (p) => [
344465
344933
  { ctx: p.ctx, issues: p.issues }
344466
344934
  ]),
@@ -344533,10 +345001,23 @@ var getRelevantPlacementsForIssues = ({
344533
345001
  };
344534
345002
  for (const issue of issues) {
344535
345003
  switch (issue.lineItemType) {
345004
+ case "SeriesLedChainNotOrdered":
345005
+ for (const placement of issue.ledSchematicBoxes)
345006
+ addPlacement(placement);
345007
+ break;
345008
+ case "ResistorSeparatedFromChipPin":
345009
+ addPlacement(issue.hostSchematicBox);
345010
+ addPlacement(issue.resistorSchematicBox);
345011
+ break;
344536
345012
  case "CapacitorSeparatedFromChipPins":
344537
345013
  addPlacement(issue.hostSchematicBox);
344538
345014
  addPlacement(issue.capacitorSchematicBox);
344539
345015
  break;
345016
+ case "DiodeCapacitorJunctionTooSpreadOut":
345017
+ addPlacement(issue.capacitorSchematicBox);
345018
+ for (const diode of issue.diodeSchematicBoxes)
345019
+ addPlacement(diode);
345020
+ break;
344540
345021
  case "PiFilterComponentsNotGrouped":
344541
345022
  addPlacement(issue.inductorSchematicBox);
344542
345023
  addPlacement(issue.firstCapacitorSchematicBox);
@@ -344617,6 +345098,10 @@ var getRelevantPlacementsForIssues = ({
344617
345098
  addComponentName(getComponentNameFromPin(pin), issue.schematicSheetId);
344618
345099
  }
344619
345100
  break;
345101
+ case "ParallelRcNotAligned":
345102
+ addPlacement(issue.resistorSchematicBox);
345103
+ addPlacement(issue.capacitorSchematicBox);
345104
+ break;
344620
345105
  case "ParallelDiodeResistorNotAligned":
344621
345106
  case "DiodeResistorNotAligned":
344622
345107
  addPlacement(issue.diodeSchematicBox);
@@ -344757,6 +345242,7 @@ class SchematicPlacementAnalysis {
344757
345242
  SchematicBoxInnerLabelCollision: 0,
344758
345243
  SchematicPinPaddingToEdgeTooLarge: 0,
344759
345244
  DiodeResistorNotAligned: 0,
345245
+ ParallelRcNotAligned: 0,
344760
345246
  ParallelDiodeResistorNotAligned: 0,
344761
345247
  ComponentPinsWouldAlignWithVerticalShift: 0,
344762
345248
  TraceCanBeSimplifiedByMovingComponent: 0,
@@ -344778,10 +345264,13 @@ class SchematicPlacementAnalysis {
344778
345264
  RegulatorCapacitorsOnWrongSides: 0,
344779
345265
  VoltageDividerSupplyResistorBelowGroundResistor: 0,
344780
345266
  CurrentSenseShuntSeparatedFromInputs: 0,
345267
+ DiodeCapacitorJunctionTooSpreadOut: 0,
344781
345268
  PiFilterComponentsNotGrouped: 0,
344782
345269
  MosfetGateNetworkNotGrouped: 0,
344783
345270
  CapacitorSeparatedFromChipPins: 0,
344784
- RailPathTooSpreadOut: 0
345271
+ ResistorSeparatedFromChipPin: 0,
345272
+ RailPathTooSpreadOut: 0,
345273
+ SeriesLedChainNotOrdered: 0
344785
345274
  };
344786
345275
  for (const issue of this.getIssues(filter))
344787
345276
  counts[issue.lineItemType]++;
@@ -344802,8 +345291,14 @@ class SchematicPlacementAnalysis {
344802
345291
  }
344803
345292
  schematicIssuesToString(issue) {
344804
345293
  switch (issue.lineItemType) {
345294
+ case "SeriesLedChainNotOrdered":
345295
+ return SeriesLedChainPlacementSolver.issueToString(issue);
345296
+ case "ResistorSeparatedFromChipPin":
345297
+ return ChipPinResistorPlacementSolver.issueToString(issue);
344805
345298
  case "CapacitorSeparatedFromChipPins":
344806
345299
  return ChipPinPairCapacitorPlacementSolver.issueToString(issue);
345300
+ case "DiodeCapacitorJunctionTooSpreadOut":
345301
+ return DiodeCapacitorStagePlacementSolver.issueToString(issue);
344807
345302
  case "PiFilterComponentsNotGrouped":
344808
345303
  return PiFilterPlacementSolver.issueToString(issue);
344809
345304
  case "MosfetGateNetworkNotGrouped":
@@ -344825,6 +345320,8 @@ class SchematicPlacementAnalysis {
344825
345320
  return SchematicBoxInnerLabelCollisionSolver.issueToString(issue);
344826
345321
  case "SchematicPinPaddingToEdgeTooLarge":
344827
345322
  return SchematicPinPaddingToEdgeSolver.issueToString(issue);
345323
+ case "ParallelRcNotAligned":
345324
+ return ParallelRcPlacementSolver.issueToString(issue);
344828
345325
  case "ParallelDiodeResistorNotAligned":
344829
345326
  return ParallelDiodeResistorPlacementSolver.issueToString(issue);
344830
345327
  case "DiodeResistorNotAligned":
package/dist/lib/index.js CHANGED
@@ -69109,7 +69109,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
69109
69109
  }));
69110
69110
  };
69111
69111
  // package.json
69112
- var version = "0.1.2273";
69112
+ var version = "0.1.2274";
69113
69113
  var package_default = {
69114
69114
  name: "@tscircuit/cli",
69115
69115
  version,
@@ -69128,7 +69128,7 @@ var package_default = {
69128
69128
  "@tscircuit/check-shorts": "https://jscdn.tscircuit.com/@tscircuit/check-shorts/0.0.26.tgz",
69129
69129
  "@tscircuit/circuit-json-placement-analysis": "^0.0.15",
69130
69130
  "@tscircuit/circuit-json-routing-analysis": "^0.0.8",
69131
- "@tscircuit/circuit-json-schematic-placement-analysis": "https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.46.tgz",
69131
+ "@tscircuit/circuit-json-schematic-placement-analysis": "https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.50.tgz",
69132
69132
  "@tscircuit/circuit-json-util": "^0.0.120",
69133
69133
  "@tscircuit/eval": "0.0.1569",
69134
69134
  "@tscircuit/fake-snippets": "^0.0.182",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.2274",
3
+ "version": "0.1.2275",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/tscircuit/cli"
@@ -16,7 +16,7 @@
16
16
  "@tscircuit/check-shorts": "https://jscdn.tscircuit.com/@tscircuit/check-shorts/0.0.26.tgz",
17
17
  "@tscircuit/circuit-json-placement-analysis": "^0.0.15",
18
18
  "@tscircuit/circuit-json-routing-analysis": "^0.0.8",
19
- "@tscircuit/circuit-json-schematic-placement-analysis": "https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.46.tgz",
19
+ "@tscircuit/circuit-json-schematic-placement-analysis": "https://jscdn.tscircuit.com/@tscircuit/circuit-json-schematic-placement-analysis/0.0.50.tgz",
20
20
  "@tscircuit/circuit-json-util": "^0.0.120",
21
21
  "@tscircuit/eval": "0.0.1569",
22
22
  "@tscircuit/fake-snippets": "^0.0.182",