@tscircuit/capacity-autorouter 0.0.156 → 0.0.157

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
@@ -93,12 +93,16 @@ interface CapacityMeshNode {
93
93
  _targetConnectionName?: string;
94
94
  _strawNode?: boolean;
95
95
  _strawParentCapacityMeshNodeId?: CapacityMeshNodeId;
96
+ _isVirtualOffboard?: boolean;
97
+ _offboardNetName?: string;
96
98
  _adjacentNodeIds?: CapacityMeshNodeId[];
97
99
  _parent?: CapacityMeshNode;
98
100
  }
99
101
  interface CapacityMeshEdge {
100
102
  capacityMeshEdgeId: string;
101
103
  nodeIds: [CapacityMeshNodeId, CapacityMeshNodeId];
104
+ isOffboardEdge?: boolean;
105
+ offboardNetName?: string;
102
106
  }
103
107
 
104
108
  type CapacityPathId = string;
@@ -106,6 +110,10 @@ interface CapacityPath {
106
110
  capacityPathId: CapacityPathId;
107
111
  connectionName: string;
108
112
  nodeIds: CapacityMeshNodeId[];
113
+ /** True if this path was created by splitting at an offboard edge */
114
+ isFragmentedPath?: boolean;
115
+ /** MST pair connection name before fragmentation */
116
+ mstPairConnectionName?: string;
109
117
  }
110
118
 
111
119
  declare class BaseSolver {
@@ -2488,6 +2496,83 @@ declare class HyperAssignableViaCapacityPathingSolver extends HyperParameterSupe
2488
2496
  generateSolver(hyperParameters: HyperParameterOverrides): AssignableViaCapacityPathingSolver_DirectiveSubOptimal;
2489
2497
  }
2490
2498
 
2499
+ /**
2500
+ * Creates offboard edges between assignable via obstacles that share
2501
+ * the same `offBoardConnectsTo` net name. These obstacles represent off-board
2502
+ * connection points (like edge connectors) that are logically connected
2503
+ * through external wiring.
2504
+ *
2505
+ * The solver finds all capacity nodes with `_assignedViaObstacle.offBoardConnectsTo`,
2506
+ * groups them by net name, and creates zero-cost offboard edges between
2507
+ * matching nodes. This allows the pathing solver to route through these virtual
2508
+ * connections as if the obstacles were directly connected.
2509
+ */
2510
+ declare class OffboardCapacityNodeSolver extends BaseSolver {
2511
+ capacityNodes: CapacityMeshNode[];
2512
+ capacityEdges: CapacityMeshEdge[];
2513
+ enhancedEdges: CapacityMeshEdge[];
2514
+ private animationState;
2515
+ private assignableNodes;
2516
+ private shownNodes;
2517
+ private pendingEdges;
2518
+ private createdEdges;
2519
+ private nextEdgeId;
2520
+ private nodeMap;
2521
+ constructor(solverParams: {
2522
+ capacityNodes: CapacityMeshNode[];
2523
+ capacityEdges: CapacityMeshEdge[];
2524
+ });
2525
+ private initializeAssignableNodes;
2526
+ private initializePendingEdges;
2527
+ _step(): void;
2528
+ private createOffboardEdge;
2529
+ visualize(): GraphicsObject;
2530
+ getVirtualOffboardNodes(): CapacityMeshNode[];
2531
+ getOffboardEdges(): CapacityMeshEdge[];
2532
+ }
2533
+
2534
+ /**
2535
+ * Splits capacity paths at offboard edges into separate fragments.
2536
+ * When a path crosses an offboard edge (created by OffboardCapacityNodeSolver),
2537
+ * this solver breaks it into independent path segments.
2538
+ *
2539
+ * Each fragment becomes a separate connection with its own `connectionName`
2540
+ * (e.g., `AD_NET_frag_0`, `AD_NET_frag_1`). The solver also creates new
2541
+ * `SimpleRouteConnection` entries with appropriate `pointsToConnect` - the
2542
+ * original pad location plus a synthetic point at the offboard node.
2543
+ *
2544
+ * This enables downstream solvers to route each fragment independently,
2545
+ * treating them as separate traces that terminate at off-board connection points.
2546
+ */
2547
+ declare class OffboardPathFragmentSolver extends BaseSolver {
2548
+ private inputPaths;
2549
+ private capacityEdges;
2550
+ private originalConnections;
2551
+ fragmentedPaths: CapacityPath[];
2552
+ fragmentedConnections: SimpleRouteConnection[];
2553
+ fragmentedOriginalConnectionNames: Set<string>;
2554
+ private nextFragmentId;
2555
+ private animationState;
2556
+ private currentPath;
2557
+ private currentFragments;
2558
+ private currentFragmentIndex;
2559
+ private nodeMap;
2560
+ constructor({ capacityPaths, capacityEdges, capacityNodes, connections, }: {
2561
+ capacityPaths: CapacityPath[];
2562
+ capacityEdges: CapacityMeshEdge[];
2563
+ capacityNodes: CapacityMeshNode[];
2564
+ connections: SimpleRouteConnection[];
2565
+ });
2566
+ _step(): void;
2567
+ private createFragmentConnections;
2568
+ private splitPath;
2569
+ getFragmentedPaths(): CapacityPath[];
2570
+ getFragmentedConnections(): SimpleRouteConnection[];
2571
+ getFragmentedOriginalConnectionNames(): Set<string>;
2572
+ visualize(): GraphicsObject;
2573
+ private drawPath;
2574
+ }
2575
+
2491
2576
  interface CapacityMeshSolverOptions {
2492
2577
  capacityDepth?: number;
2493
2578
  targetMinCapacity?: number;
@@ -2519,6 +2604,8 @@ declare class AssignableViaAutoroutingPipelineSolver extends BaseSolver {
2519
2604
  highDensityStitchSolver?: MultipleHighDensityRouteStitchSolver;
2520
2605
  singleLayerNodeMerger?: SingleLayerNodeMergerSolver_OnlyMergeTargets;
2521
2606
  mergeAssignableViaNodes?: AssignableViaNodeMergerSolver;
2607
+ offboardCapacityNodeSolver?: OffboardCapacityNodeSolver;
2608
+ offboardPathFragmentSolver?: OffboardPathFragmentSolver;
2522
2609
  strawSolver?: StrawSolver;
2523
2610
  deadEndSolver?: DeadEndSolver;
2524
2611
  uselessViaRemovalSolver1?: UselessViaRemovalSolver;
@@ -2534,7 +2621,7 @@ declare class AssignableViaAutoroutingPipelineSolver extends BaseSolver {
2534
2621
  capacityNodes: CapacityMeshNode[] | null;
2535
2622
  capacityEdges: CapacityMeshEdge[] | null;
2536
2623
  cacheProvider: CacheProvider | null;
2537
- pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles> | PipelineStep<typeof AssignableViaNodeMergerSolver> | PipelineStep<typeof SingleLayerNodeMergerSolver_OnlyMergeTargets> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof DeadEndSolver> | PipelineStep<typeof HyperAssignableViaCapacityPathingSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
2624
+ pipelineDef: (PipelineStep<typeof NetToPointPairsSolver> | PipelineStep<typeof CapacityMeshNodeSolver_OnlyTraverseLayersInAssignableObstacles> | PipelineStep<typeof AssignableViaNodeMergerSolver> | PipelineStep<typeof SingleLayerNodeMergerSolver_OnlyMergeTargets> | PipelineStep<typeof CapacityMeshEdgeSolver2_NodeTreeOptimization> | PipelineStep<typeof OffboardCapacityNodeSolver> | PipelineStep<typeof DeadEndSolver> | PipelineStep<typeof HyperAssignableViaCapacityPathingSolver> | PipelineStep<typeof OffboardPathFragmentSolver> | PipelineStep<typeof CapacityEdgeToPortSegmentSolver> | PipelineStep<typeof CapacitySegmentToPointSolver> | PipelineStep<typeof UnravelMultiSectionSolver> | PipelineStep<typeof HighDensitySolver> | PipelineStep<typeof MultipleHighDensityRouteStitchSolver> | PipelineStep<typeof UselessViaRemovalSolver> | PipelineStep<typeof MultiSimplifiedPathSolver>)[];
2538
2625
  constructor(srj: SimpleRouteJson, opts?: CapacityMeshSolverOptions);
2539
2626
  currentPipelineStepIndex: number;
2540
2627
  _step(): void;