@tscircuit/core 0.0.1935 → 0.0.1936

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +23 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -53693,11 +53693,29 @@ var getBusSrjConnectionNamesOrThrow = ({
53693
53693
  srjConnections,
53694
53694
  bus,
53695
53695
  sourceTraceId,
53696
- traceNameOrPortSelector
53696
+ traceNameOrPortSelector,
53697
+ busSourceTraces
53697
53698
  }) => {
53698
- const matchingSrjConnections = srjConnections.filter(
53699
+ const directSrjConnections = srjConnections.filter(
53699
53700
  (srjConnection) => srjConnection.source_trace_id === sourceTraceId
53700
53701
  );
53702
+ if (directSrjConnections.length > 0) {
53703
+ return directSrjConnections.map((srjConnection) => srjConnection.name);
53704
+ }
53705
+ const sourceTrace = busSourceTraces.find(
53706
+ (trace) => trace.source_trace_id === sourceTraceId
53707
+ );
53708
+ const connectedSourceTraces = busSourceTraces.filter(
53709
+ (trace) => trace.source_trace_id === sourceTraceId || sourceTrace.subcircuit_connectivity_map_key !== void 0 && trace.subcircuit_connectivity_map_key === sourceTrace.subcircuit_connectivity_map_key
53710
+ );
53711
+ const connectedSourceNetIds = new Set(
53712
+ connectedSourceTraces.flatMap(
53713
+ (trace) => trace.connected_source_net_ids ?? []
53714
+ )
53715
+ );
53716
+ const matchingSrjConnections = srjConnections.filter(
53717
+ (srjConnection) => connectedSourceNetIds.has(srjConnection.name)
53718
+ );
53701
53719
  if (matchingSrjConnections.length === 0) {
53702
53720
  throw new Error(
53703
53721
  `Could not find an SRJ connection for "${traceNameOrPortSelector}" in bus "${bus.name}"`
@@ -53776,7 +53794,8 @@ var getBusesForSimpleRouteJson = ({
53776
53794
  srjConnections,
53777
53795
  bus,
53778
53796
  sourceTraceId,
53779
- traceNameOrPortSelector
53797
+ traceNameOrPortSelector,
53798
+ busSourceTraces
53780
53799
  });
53781
53800
  }
53782
53801
  );
@@ -63360,7 +63379,7 @@ function Group_getRoutingPhasePlans(group) {
63360
63379
  var package_default = {
63361
63380
  name: "@tscircuit/core",
63362
63381
  type: "module",
63363
- version: "0.0.1934",
63382
+ version: "0.0.1935",
63364
63383
  types: "dist/index.d.ts",
63365
63384
  main: "dist/index.js",
63366
63385
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1935",
4
+ "version": "0.0.1936",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",