@tscircuit/capacity-autorouter 0.0.244 → 0.0.246

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2038,13 +2038,13 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
2038
2038
  visualize(): GraphicsObject;
2039
2039
  }
2040
2040
 
2041
- interface CapacityMeshSolverOptions$3 {
2041
+ interface CapacityMeshSolverOptions$4 {
2042
2042
  capacityDepth?: number;
2043
2043
  targetMinCapacity?: number;
2044
2044
  cacheProvider?: CacheProvider | null;
2045
2045
  effort?: number;
2046
2046
  }
2047
- type PipelineStep$3<T extends new (...args: any[]) => BaseSolver> = {
2047
+ type PipelineStep$4<T extends new (...args: any[]) => BaseSolver> = {
2048
2048
  solverName: string;
2049
2049
  solverClass: T;
2050
2050
  getConstructorParams: (instance: AutoroutingPipelineSolver2_PortPointPathing) => ConstructorParameters<T>;
@@ -2052,7 +2052,7 @@ type PipelineStep$3<T extends new (...args: any[]) => BaseSolver> = {
2052
2052
  };
2053
2053
  declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
2054
2054
  srj: SimpleRouteJson;
2055
- opts: CapacityMeshSolverOptions$3;
2055
+ opts: CapacityMeshSolverOptions$4;
2056
2056
  netToPointPairsSolver?: NetToPointPairsSolver;
2057
2057
  nodeSolver?: RectDiffPipeline;
2058
2058
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -2079,9 +2079,9 @@ declare class AutoroutingPipelineSolver2_PortPointPathing extends BaseSolver {
2079
2079
  capacityNodes: CapacityMeshNode[] | null;
2080
2080
  capacityEdges: CapacityMeshEdge[] | null;
2081
2081
  cacheProvider: CacheProvider | null;
2082
- pipelineDef: (PipelineStep$3<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$3<typeof RectDiffPipeline> | PipelineStep$3<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$3<typeof AvailableSegmentPointSolver> | PipelineStep$3<typeof HyperPortPointPathingSolver> | PipelineStep$3<typeof MultiSectionPortPointOptimizer> | PipelineStep$3<typeof HighDensitySolver> | PipelineStep$3<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$3<typeof TraceSimplificationSolver>)[];
2083
- constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$3);
2084
- getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$3];
2082
+ pipelineDef: (PipelineStep$4<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$4<typeof RectDiffPipeline> | PipelineStep$4<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$4<typeof AvailableSegmentPointSolver> | PipelineStep$4<typeof HyperPortPointPathingSolver> | PipelineStep$4<typeof MultiSectionPortPointOptimizer> | PipelineStep$4<typeof HighDensitySolver> | PipelineStep$4<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$4<typeof TraceSimplificationSolver>)[];
2083
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$4);
2084
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$4];
2085
2085
  currentPipelineStepIndex: number;
2086
2086
  _step(): void;
2087
2087
  solveUntilPhase(phase: string): void;
@@ -2897,12 +2897,12 @@ declare class CapacityPathingMultiSectionSolver extends BaseSolver {
2897
2897
  visualize(): graphics_debug.GraphicsObject;
2898
2898
  }
2899
2899
 
2900
- interface CapacityMeshSolverOptions$2 {
2900
+ interface CapacityMeshSolverOptions$3 {
2901
2901
  capacityDepth?: number;
2902
2902
  targetMinCapacity?: number;
2903
2903
  cacheProvider?: CacheProvider | null;
2904
2904
  }
2905
- type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
2905
+ type PipelineStep$3<T extends new (...args: any[]) => BaseSolver> = {
2906
2906
  solverName: string;
2907
2907
  solverClass: T;
2908
2908
  getConstructorParams: (instance: AutoroutingPipeline1_OriginalUnravel) => ConstructorParameters<T>;
@@ -2910,7 +2910,7 @@ type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
2910
2910
  };
2911
2911
  declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
2912
2912
  srj: SimpleRouteJson;
2913
- opts: CapacityMeshSolverOptions$2;
2913
+ opts: CapacityMeshSolverOptions$3;
2914
2914
  netToPointPairsSolver?: NetToPointPairsSolver;
2915
2915
  nodeSolver?: RectDiffPipeline;
2916
2916
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -2939,9 +2939,9 @@ declare class AutoroutingPipeline1_OriginalUnravel extends BaseSolver {
2939
2939
  capacityNodes: CapacityMeshNode[] | null;
2940
2940
  capacityEdges: CapacityMeshEdge[] | null;
2941
2941
  cacheProvider: CacheProvider | null;
2942
- pipelineDef: (PipelineStep$2<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$2<typeof RectDiffPipeline> | PipelineStep$2<typeof StrawSolver> | PipelineStep$2<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$2<typeof DeadEndSolver> | PipelineStep$2<typeof CapacityPathingGreedySolver> | PipelineStep$2<typeof CapacityPathingMultiSectionSolver> | PipelineStep$2<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$2<typeof CapacitySegmentToPointSolver> | PipelineStep$2<typeof UnravelMultiSectionSolver> | PipelineStep$2<typeof HighDensitySolver> | PipelineStep$2<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$2<typeof TraceSimplificationSolver>)[];
2943
- constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$2);
2944
- getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$2];
2942
+ pipelineDef: (PipelineStep$3<typeof NetToPointPairsSolver2_OffBoardConnection> | PipelineStep$3<typeof RectDiffPipeline> | PipelineStep$3<typeof StrawSolver> | PipelineStep$3<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$3<typeof DeadEndSolver> | PipelineStep$3<typeof CapacityPathingGreedySolver> | PipelineStep$3<typeof CapacityPathingMultiSectionSolver> | PipelineStep$3<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep$3<typeof CapacitySegmentToPointSolver> | PipelineStep$3<typeof UnravelMultiSectionSolver> | PipelineStep$3<typeof HighDensitySolver> | PipelineStep$3<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$3<typeof TraceSimplificationSolver>)[];
2943
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$3);
2944
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$3];
2945
2945
  currentPipelineStepIndex: number;
2946
2946
  _step(): void;
2947
2947
  solveUntilPhase(phase: string): void;
@@ -3039,7 +3039,7 @@ declare class SimpleHighDensitySolver extends BaseSolver {
3039
3039
  visualize(): GraphicsObject;
3040
3040
  }
3041
3041
 
3042
- type HyperGraphPatternType = "single_1206x4" | "1x2_1206x4" | "2x2_1206x4" | "3x1_1206x4" | "3x2_1206x4" | "3x3_1206x4" | "4x4_1206x4" | "6x4_1206x4";
3042
+ type HyperGraphPatternType = "single_1206x4" | "1x2_1206x4" | "2x2_1206x4" | "3x1_1206x4" | "3x2_1206x4" | "3x3_1206x4" | "4x4_1206x4" | "6x4_1206x4" | "8x4_1206x4";
3043
3043
  interface JumperPrepatternSolver2HyperParameters {
3044
3044
  /** Pattern type for jumper placement - "single_1206x4" (~8x8mm) or "2x2_1206x4" (~14x14mm) */
3045
3045
  PATTERN_TYPE?: HyperGraphPatternType;
@@ -3652,13 +3652,13 @@ declare class RelateNodesToOffBoardConnectionsSolver extends BaseSolver {
3652
3652
  visualize(): GraphicsObject;
3653
3653
  }
3654
3654
 
3655
- interface CapacityMeshSolverOptions$1 {
3655
+ interface CapacityMeshSolverOptions$2 {
3656
3656
  capacityDepth?: number;
3657
3657
  targetMinCapacity?: number;
3658
3658
  cacheProvider?: CacheProvider | null;
3659
3659
  effort?: number;
3660
3660
  }
3661
- type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
3661
+ type PipelineStep$2<T extends new (...args: any[]) => BaseSolver> = {
3662
3662
  solverName: string;
3663
3663
  solverClass: T;
3664
3664
  getConstructorParams: (instance: AssignableAutoroutingPipeline2) => ConstructorParameters<T>;
@@ -3666,7 +3666,7 @@ type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
3666
3666
  };
3667
3667
  declare class AssignableAutoroutingPipeline2 extends BaseSolver {
3668
3668
  srj: SimpleRouteJson;
3669
- opts: CapacityMeshSolverOptions$1;
3669
+ opts: CapacityMeshSolverOptions$2;
3670
3670
  netToPointPairsSolver?: NetToPointPairsSolver;
3671
3671
  nodeSolver?: RectDiffPipeline;
3672
3672
  nodeTargetMerger?: CapacityNodeTargetMerger;
@@ -3700,7 +3700,144 @@ declare class AssignableAutoroutingPipeline2 extends BaseSolver {
3700
3700
  capacityNodes: CapacityMeshNode[] | null;
3701
3701
  capacityEdges: CapacityMeshEdge[] | null;
3702
3702
  cacheProvider: CacheProvider | null;
3703
- pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof RelateNodesToOffBoardConnectionsSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof AvailableSegmentPointSolver> | PipelineStep$1<typeof HyperPortPointPathingSolver> | PipelineStep$1<typeof MultiSectionPortPointOptimizer> | PipelineStep$1<typeof SimpleHighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$1<typeof TraceSimplificationSolver> | PipelineStep$1<typeof TraceKeepoutSolver> | PipelineStep$1<typeof TraceWidthSolver>)[];
3703
+ pipelineDef: (PipelineStep$2<typeof NetToPointPairsSolver> | PipelineStep$2<typeof RectDiffPipeline> | PipelineStep$2<typeof RelateNodesToOffBoardConnectionsSolver> | PipelineStep$2<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$2<typeof AvailableSegmentPointSolver> | PipelineStep$2<typeof HyperPortPointPathingSolver> | PipelineStep$2<typeof MultiSectionPortPointOptimizer> | PipelineStep$2<typeof SimpleHighDensitySolver> | PipelineStep$2<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep$2<typeof TraceSimplificationSolver> | PipelineStep$2<typeof TraceKeepoutSolver> | PipelineStep$2<typeof TraceWidthSolver>)[];
3704
+ constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$2);
3705
+ getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$2];
3706
+ currentPipelineStepIndex: number;
3707
+ _step(): void;
3708
+ solveUntilPhase(phase: string): void;
3709
+ getCurrentPhase(): string;
3710
+ visualize(): GraphicsObject;
3711
+ /**
3712
+ * A lightweight version of the visualize method that can be used to stream
3713
+ * progress
3714
+ *
3715
+ * We return the most relevant graphic for the stage:
3716
+ * 1. netToPointPairs output
3717
+ * 2. Capacity Planning Output
3718
+ * 3. High Density Route Solver Output, max 200 lines
3719
+ */
3720
+ preview(): GraphicsObject;
3721
+ _getOutputHdRoutes(): HighDensityRoute$1[];
3722
+ getConnectedOffboardObstacles(): Record<ObstacleId, RootConnectionName>;
3723
+ /**
3724
+ * Returns the SimpleRouteJson with routes converted to SimplifiedPcbTraces
3725
+ */
3726
+ getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces;
3727
+ getOutputSimpleRouteJson(): SimpleRouteJson;
3728
+ }
3729
+
3730
+ type UnsolvedRouteWithOrder = {
3731
+ connectionName: string;
3732
+ hdRoutes: HighDensityIntraNodeRoute$1[];
3733
+ /** Node IDs in order from start to end */
3734
+ nodeOrder: string[];
3735
+ start: {
3736
+ x: number;
3737
+ y: number;
3738
+ z: number;
3739
+ };
3740
+ end: {
3741
+ x: number;
3742
+ y: number;
3743
+ z: number;
3744
+ };
3745
+ };
3746
+ /**
3747
+ * MultipleHighDensityRouteStitchSolver2 uses path ordering information from
3748
+ * the port point pathing solver to correctly stitch routes that may reuse
3749
+ * the same node multiple times.
3750
+ *
3751
+ * Unlike the original solver that uses connectivity maps to find endpoints,
3752
+ * this version uses the node traversal order from the pathing solver.
3753
+ */
3754
+ declare class MultipleHighDensityRouteStitchSolver2 extends BaseSolver {
3755
+ unsolvedRoutes: UnsolvedRouteWithOrder[];
3756
+ mergedHdRoutes: HighDensityIntraNodeRoute$1[];
3757
+ colorMap: Record<string, string>;
3758
+ defaultTraceThickness: number;
3759
+ defaultViaDiameter: number;
3760
+ constructor(params: {
3761
+ connections: SimpleRouteConnection[];
3762
+ hdRoutes: HighDensityIntraNodeRoute$1[];
3763
+ /** Connection path results from port point pathing solver */
3764
+ connectionPathResults: ConnectionPathResult[];
3765
+ colorMap?: Record<string, string>;
3766
+ layerCount: number;
3767
+ defaultViaDiameter?: number;
3768
+ });
3769
+ _step(): void;
3770
+ /**
3771
+ * Stitch routes together using the node order from pathing results.
3772
+ *
3773
+ * The key insight is that each HD route corresponds to a segment within a
3774
+ * capacity node. The nodeOrder tells us which nodes we visit in sequence.
3775
+ * We use this to order the routes correctly, even when a node is visited
3776
+ * multiple times.
3777
+ */
3778
+ private stitchOrderedRoutes;
3779
+ /**
3780
+ * Order routes based on the node traversal path.
3781
+ * Each node in nodeOrder may have one or more routes.
3782
+ * Returns routes in the order they should be stitched.
3783
+ */
3784
+ private orderRoutesByNodePath;
3785
+ /**
3786
+ * Fallback: order routes by proximity, starting from the start point.
3787
+ */
3788
+ private orderRoutesByProximity;
3789
+ visualize(): GraphicsObject;
3790
+ }
3791
+
3792
+ interface CapacityMeshSolverOptions$1 {
3793
+ capacityDepth?: number;
3794
+ targetMinCapacity?: number;
3795
+ cacheProvider?: CacheProvider | null;
3796
+ effort?: number;
3797
+ }
3798
+ type PipelineStep$1<T extends new (...args: any[]) => BaseSolver> = {
3799
+ solverName: string;
3800
+ solverClass: T;
3801
+ getConstructorParams: (instance: AssignableAutoroutingPipeline3) => ConstructorParameters<T>;
3802
+ onSolved?: (instance: AssignableAutoroutingPipeline3) => void;
3803
+ };
3804
+ declare class AssignableAutoroutingPipeline3 extends BaseSolver {
3805
+ srj: SimpleRouteJson;
3806
+ opts: CapacityMeshSolverOptions$1;
3807
+ netToPointPairsSolver?: NetToPointPairsSolver;
3808
+ nodeSolver?: RectDiffPipeline;
3809
+ nodeTargetMerger?: CapacityNodeTargetMerger;
3810
+ edgeSolver?: CapacityMeshEdgeSolver;
3811
+ relateNodesToOffBoardConnections?: RelateNodesToOffBoardConnectionsSolver;
3812
+ colorMap: Record<string, string>;
3813
+ highDensityRouteSolver?: HighDensitySolver;
3814
+ /** @deprecated Use highDensitySolver instead */
3815
+ simpleHighDensityRouteSolver?: SimpleHighDensitySolver;
3816
+ highDensitySolver?: JumperHighDensitySolver;
3817
+ highDensityStitchSolver?: MultipleHighDensityRouteStitchSolver2;
3818
+ singleLayerNodeMerger?: SingleLayerNodeMergerSolver;
3819
+ offboardPathFragmentSolver?: PortPointOffboardPathFragmentSolver;
3820
+ strawSolver?: StrawSolver;
3821
+ deadEndSolver?: DeadEndSolver;
3822
+ traceSimplificationSolver?: TraceSimplificationSolver;
3823
+ traceKeepoutSolver?: TraceKeepoutSolver;
3824
+ traceWidthSolver?: TraceWidthSolver;
3825
+ availableSegmentPointSolver?: AvailableSegmentPointSolver;
3826
+ portPointPathingSolver?: PortPointPathingSolver;
3827
+ multiSectionPortPointOptimizer?: MultiSectionPortPointOptimizer;
3828
+ viaDiameter: number;
3829
+ minTraceWidth: number;
3830
+ effort: number;
3831
+ startTimeOfPhase: Record<string, number>;
3832
+ endTimeOfPhase: Record<string, number>;
3833
+ timeSpentOnPhase: Record<string, number>;
3834
+ activeSubSolver?: BaseSolver | null;
3835
+ connMap: ConnectivityMap;
3836
+ srjWithPointPairs?: SimpleRouteJson;
3837
+ capacityNodes: CapacityMeshNode[] | null;
3838
+ capacityEdges: CapacityMeshEdge[] | null;
3839
+ cacheProvider: CacheProvider | null;
3840
+ pipelineDef: (PipelineStep$1<typeof NetToPointPairsSolver> | PipelineStep$1<typeof RectDiffPipeline> | PipelineStep$1<typeof RelateNodesToOffBoardConnectionsSolver> | PipelineStep$1<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep$1<typeof AvailableSegmentPointSolver> | PipelineStep$1<typeof HyperPortPointPathingSolver> | PipelineStep$1<typeof MultiSectionPortPointOptimizer> | PipelineStep$1<typeof JumperHighDensitySolver> | PipelineStep$1<typeof MultipleHighDensityRouteStitchSolver2> | PipelineStep$1<typeof TraceKeepoutSolver> | PipelineStep$1<typeof TraceWidthSolver>)[];
3704
3841
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions$1);
3705
3842
  getConstructorParams(): readonly [SimpleRouteJson, CapacityMeshSolverOptions$1];
3706
3843
  currentPipelineStepIndex: number;
@@ -3724,6 +3861,13 @@ declare class AssignableAutoroutingPipeline2 extends BaseSolver {
3724
3861
  * Returns the SimpleRouteJson with routes converted to SimplifiedPcbTraces
3725
3862
  */
3726
3863
  getOutputSimplifiedPcbTraces(): SimplifiedPcbTraces;
3864
+ /**
3865
+ * Collects ALL jumpers from the highDensitySolver and converts them to SRJ Jumper format.
3866
+ * This returns all jumpers placed in the jumper grid (from baseGraph.jumperLocations),
3867
+ * not just the ones used by routes. These will be used as obstacles for the keepout
3868
+ * solver and added to the final SRJ output.
3869
+ */
3870
+ getOutputJumpers(): Jumper$1[];
3727
3871
  getOutputSimpleRouteJson(): SimpleRouteJson;
3728
3872
  }
3729
3873
 
@@ -4896,4 +5040,4 @@ declare class IntraNodeSolverWithJumpers extends BaseSolver {
4896
5040
  visualize(): GraphicsObject;
4897
5041
  }
4898
5042
 
4899
- export { AssignableAutoroutingPipeline1Solver, AssignableAutoroutingPipeline2, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver2_PortPointPathing as AutoroutingPipelineSolver, type AutoroutingPipelineSolverOptions, type CachableSolver, type CacheProvider, CapacityMeshSolver, type HighDensityIntraNodeRouteWithJumpers, JumperHighDensitySolver as HighDensitySolver, InMemoryCache, IntraNodeSolverWithJumpers, type Jumper, LocalStorageCache, SingleHighDensityRouteWithJumpersSolver, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };
5043
+ export { AssignableAutoroutingPipeline1Solver, AssignableAutoroutingPipeline2, AssignableAutoroutingPipeline3, AutoroutingPipeline1_OriginalUnravel, AutoroutingPipelineSolver2_PortPointPathing as AutoroutingPipelineSolver, type AutoroutingPipelineSolverOptions, type CachableSolver, type CacheProvider, CapacityMeshSolver, type HighDensityIntraNodeRouteWithJumpers, JumperHighDensitySolver as HighDensitySolver, InMemoryCache, IntraNodeSolverWithJumpers, type Jumper, LocalStorageCache, SingleHighDensityRouteWithJumpersSolver, calculateOptimalCapacityDepth, convertSrjToGraphicsObject, getGlobalInMemoryCache, getGlobalLocalStorageCache, getTunedTotalCapacity1, setupGlobalCaches };