@tscircuit/core 0.0.1839 → 0.0.1841

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
@@ -246,7 +246,25 @@ type SimpleRouteJson = Omit<SimpleRouteJson$1, "connections" | "traces" | "obsta
246
246
  };
247
247
 
248
248
  type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | `board:renderPhaseStarted` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:error" | "autorouting:progress" | "packing:start" | "packing:end" | "packing:error" | "solver:started" | "solver:ended" | "renderComplete" | "debug:logOutput";
249
- interface AutoroutingStartEvent {
249
+ type AutoroutingCacheStatus = "disabled" | "hit" | "miss";
250
+ type AutoroutingCacheDisabledReason = "custom_algorithm" | "strategy_not_cacheable" | "no_cache_engine";
251
+ interface AutoroutingExecutionMetadata {
252
+ routingPhaseIndex?: number | null;
253
+ phaseOrdinal?: number;
254
+ phaseCount?: number;
255
+ connectionCount?: number;
256
+ obstacleCount?: number;
257
+ previousTraceCount?: number;
258
+ isReroutePhase?: boolean;
259
+ autorouterName?: string;
260
+ autorouterVersion?: string;
261
+ solverName?: string;
262
+ effort?: number;
263
+ cacheStatus?: AutoroutingCacheStatus;
264
+ cacheKey?: string;
265
+ cacheDisabledReason?: AutoroutingCacheDisabledReason;
266
+ }
267
+ interface AutoroutingStartEvent extends AutoroutingExecutionMetadata {
250
268
  type: "autorouting:start";
251
269
  subcircuit_id: string;
252
270
  componentDisplayName: string;
@@ -255,7 +273,7 @@ interface AutoroutingStartEvent {
255
273
  phaseStageCount?: number;
256
274
  simpleRouteJson: SimpleRouteJson;
257
275
  }
258
- interface AutoroutingErrorEvent {
276
+ interface AutoroutingErrorEvent extends AutoroutingExecutionMetadata {
259
277
  type: "autorouting:error";
260
278
  subcircuit_id: string;
261
279
  componentDisplayName: string;
@@ -269,7 +287,7 @@ interface AutoroutingErrorEvent {
269
287
  simpleRouteJson?: SimpleRouteJson;
270
288
  debugGraphics?: any;
271
289
  }
272
- interface AutoroutingProgressEvent {
290
+ interface AutoroutingProgressEvent extends AutoroutingExecutionMetadata {
273
291
  type: "autorouting:progress";
274
292
  subcircuit_id: string;
275
293
  componentDisplayName: string;
@@ -280,7 +298,7 @@ interface AutoroutingProgressEvent {
280
298
  iterationsPerSecond?: number;
281
299
  debugGraphics?: any;
282
300
  }
283
- interface AutoroutingEndEvent {
301
+ interface AutoroutingEndEvent extends AutoroutingExecutionMetadata {
284
302
  type: "autorouting:end";
285
303
  subcircuit_id: string;
286
304
  componentDisplayName: string;
@@ -191597,4 +191615,4 @@ declare module "react/jsx-runtime" {
191597
191615
  }
191598
191616
  }
191599
191617
 
191600
- export { Ammeter, AnalogAcSweepSimulation, AnalogAnalysisSimulation, AnalogDcOperatingPointSimulation, AnalogDcSweepSimulation, AnalogSimulation, AnalogSweepParameter, AnalogTransientSimulation, Antenna, AssemblyDevice, type AssemblyDeviceJsxProps, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, AutoroutingPhase, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Bus, CadAssembly, CadModel, Capacitor, Chip, Circuit, type CircuitJsonMetadata, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, DifferentialPair, Diode, DrcCheck, EnclosureCutoutAperture, EnclosureFdmBox, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Breakout as Fanout, BreakoutPoint as FanoutPoint, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, type PcbGroupId, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PcbVia, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicGraphic, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicSheet, SchematicSymbol, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenGraphic, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteBounds, type SimpleRouteBus, type SimpleRouteBusTermination, type SimpleRouteConnection, type SimpleRouteDifferentialPair, type SimpleRouteJson, type SimpleRoutePoint, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverEndedEvent, type SolverName, type SolverStartedEvent, SpiceModel, type SrjConnectionName, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, analog, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, assembly, createUseComponent, enclosure, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, unrouteCircuitJson, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
191618
+ export { Ammeter, AnalogAcSweepSimulation, AnalogAnalysisSimulation, AnalogDcOperatingPointSimulation, AnalogDcSweepSimulation, AnalogSimulation, AnalogSweepParameter, AnalogTransientSimulation, Antenna, AssemblyDevice, type AssemblyDeviceJsxProps, type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingCacheDisabledReason, type AutoroutingCacheStatus, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingExecutionMetadata, AutoroutingPhase, type AutoroutingProgressEvent, type AutoroutingStartEvent, Battery, Board, Breakout, BreakoutPoint, Bus, CadAssembly, CadModel, Capacitor, Chip, Circuit, type CircuitJsonMetadata, type ComponentWithPins, Connector, Constraint, CopperPour, CopperText, CourtyardCircle, CourtyardOutline, CourtyardRect, Crystal, CurrentSource, Cutout, type DebugLogOutputEvent, DifferentialPair, Diode, DrcCheck, EnclosureCutoutAperture, EnclosureFdmBox, FabricationNoteDimension, FabricationNotePath, FabricationNoteRect, FabricationNoteText, Breakout as Fanout, BreakoutPoint as FanoutPoint, Fiducial, Footprint, Fuse, type GenericConnectionsAndSelectorsSel, type GenericLocalAutorouter, Group, Hole, type IIsolatedCircuit, type IRenderable, type IRootCircuit, Inductor, Interconnect, IsolatedCircuit, Jumper, Keepout, Led, type LocalCacheEngine, Mosfet, MountedBoard, Net, NetLabel, NormalComponent, type Obstacle, OpAmp, type PackingEndEvent, type PackingErrorEvent, type PackingStartEvent, Panel, type PcbGroupId, PcbNoteDimension, PcbNoteLine, PcbNotePath, PcbNoteRect, PcbNoteText, PcbTrace, PcbVia, PinHeader, type PinLabelSpec, Pinout, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, SOLVERS, SchematicArc, SchematicBox, SchematicCell, SchematicCircle, SchematicGraphic, SchematicLine, SchematicPath, SchematicRect, SchematicRow, SchematicSection, SchematicSheet, SchematicSymbol, SchematicTable, SchematicText, type Sel, SilkscreenCircle, SilkscreenGraphic, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, type SimpleRouteBounds, type SimpleRouteBus, type SimpleRouteBusTermination, type SimpleRouteConnection, type SimpleRouteDifferentialPair, type SimpleRouteJson, type SimpleRoutePoint, type SimplifiedPcbTrace, SmtPad, SolderJumper, type SolverEndedEvent, type SolverName, type SolverStartedEvent, SpiceModel, type SrjConnectionName, Subcircuit, Subpanel, Switch, SymbolComponent as Symbol, TestPoint, Trace, TraceHint, Transistor, Via, VoltageProbe, VoltageSource, analog, applyEditEvents, applyEditEventsToManualEditsFile, applyPcbEditEventsToManualEditsFile, applySchematicEditEventsToManualEditsFile, assembly, createUseComponent, enclosure, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, normalizePinLabels, orderedRenderPhases, renderPhaseIndexMap, resolveStaticFileImport, sel, unrouteCircuitJson, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
package/dist/index.js CHANGED
@@ -36270,6 +36270,39 @@ function getCacheProviderForLocalCacheEngine(localCacheEngine) {
36270
36270
  }
36271
36271
 
36272
36272
  // lib/utils/autorouting/CapacityMeshAutorouter.ts
36273
+ var getAutorouterSolverName = ({
36274
+ useAssignableSolver = false,
36275
+ useAutoJumperSolver = false,
36276
+ autorouterVersion: autorouterVersion2,
36277
+ useLaserPrefabSolver = false,
36278
+ useTraceSimplificationSolver = false
36279
+ }) => {
36280
+ if (useTraceSimplificationSolver) {
36281
+ return "AutoroutingPipelineSolver11_Simplification";
36282
+ }
36283
+ if (autorouterVersion2 === "beta_pipeline1") {
36284
+ return "AutoroutingPipeline1_OriginalUnravel";
36285
+ }
36286
+ if (autorouterVersion2 === "beta_pipeline3") {
36287
+ return "AutoroutingPipelineSolver3_HgPortPointPathing";
36288
+ }
36289
+ if (autorouterVersion2 === "beta_pipeline4") {
36290
+ return "AutoroutingPipelineSolver4";
36291
+ }
36292
+ if (autorouterVersion2 === "beta_pipeline5") {
36293
+ return "AutoroutingPipelineSolver5";
36294
+ }
36295
+ if (autorouterVersion2 === "beta_pipeline7" || autorouterVersion2 === "latest") {
36296
+ return "AutoroutingPipelineSolver7_MultiGraph";
36297
+ }
36298
+ if (autorouterVersion2 === "beta_pipeline9") {
36299
+ return "AutoroutingPipelineSolver9_PreloadedTraceGraph";
36300
+ }
36301
+ if (useLaserPrefabSolver) return "AutoroutingPipelineSolver8";
36302
+ if (useAutoJumperSolver) return "AssignableAutoroutingPipeline3";
36303
+ if (useAssignableSolver) return "AssignableAutoroutingPipeline2";
36304
+ return "AutoroutingPipelineSolver7_MultiGraph";
36305
+ };
36273
36306
  function getCapacityAutorouterCacheProvider(platformConfig) {
36274
36307
  if (!platformConfig?.localCacheEngine) return null;
36275
36308
  return getCacheProviderForLocalCacheEngine(platformConfig.localCacheEngine);
@@ -36301,30 +36334,13 @@ var TscircuitAutorouter = class {
36301
36334
  platformConfig,
36302
36335
  onSolverStarted
36303
36336
  } = options;
36304
- let solverName;
36305
- if (useTraceSimplificationSolver) {
36306
- solverName = "AutoroutingPipelineSolver11_Simplification";
36307
- } else if (autorouterVersion2 === "beta_pipeline1") {
36308
- solverName = "AutoroutingPipeline1_OriginalUnravel";
36309
- } else if (autorouterVersion2 === "beta_pipeline3") {
36310
- solverName = "AutoroutingPipelineSolver3_HgPortPointPathing";
36311
- } else if (autorouterVersion2 === "beta_pipeline4") {
36312
- solverName = "AutoroutingPipelineSolver4";
36313
- } else if (autorouterVersion2 === "beta_pipeline5") {
36314
- solverName = "AutoroutingPipelineSolver5";
36315
- } else if (autorouterVersion2 === "beta_pipeline7" || autorouterVersion2 === "latest") {
36316
- solverName = "AutoroutingPipelineSolver7_MultiGraph";
36317
- } else if (autorouterVersion2 === "beta_pipeline9") {
36318
- solverName = "AutoroutingPipelineSolver9_PreloadedTraceGraph";
36319
- } else if (useLaserPrefabSolver) {
36320
- solverName = "AutoroutingPipelineSolver8";
36321
- } else if (useAutoJumperSolver) {
36322
- solverName = "AssignableAutoroutingPipeline3";
36323
- } else if (useAssignableSolver) {
36324
- solverName = "AssignableAutoroutingPipeline2";
36325
- } else {
36326
- solverName = "AutoroutingPipelineSolver7_MultiGraph";
36327
- }
36337
+ const solverName = getAutorouterSolverName({
36338
+ useAssignableSolver,
36339
+ useAutoJumperSolver,
36340
+ autorouterVersion: autorouterVersion2,
36341
+ useLaserPrefabSolver,
36342
+ useTraceSimplificationSolver
36343
+ });
36328
36344
  const SolverClass = SOLVERS[solverName];
36329
36345
  const solverCacheProvider = getCapacityAutorouterCacheProvider(platformConfig);
36330
36346
  this.solver = new SolverClass(input, {
@@ -36490,8 +36506,10 @@ var TscircuitAutorouter = class {
36490
36506
  };
36491
36507
 
36492
36508
  // lib/utils/autorouting/local-autorouter-strategies.ts
36493
- var createTscircuitAutorouterStrategy = (strategyOptions) => ({
36509
+ var createTscircuitAutorouterStrategy = (name, strategyOptions) => ({
36510
+ name,
36494
36511
  cacheable: true,
36512
+ getSolverName: (options) => getAutorouterSolverName({ ...options, ...strategyOptions }),
36495
36513
  create: ({ simpleRouteJson, commonAutorouterOptions, onSolverStarted }) => new TscircuitAutorouter(simpleRouteJson, {
36496
36514
  ...commonAutorouterOptions,
36497
36515
  ...strategyOptions,
@@ -36501,13 +36519,19 @@ var createTscircuitAutorouterStrategy = (strategyOptions) => ({
36501
36519
  })
36502
36520
  })
36503
36521
  });
36504
- var defaultLocalAutorouterStrategy = createTscircuitAutorouterStrategy({});
36522
+ var defaultLocalAutorouterStrategy = createTscircuitAutorouterStrategy(
36523
+ "tscircuit",
36524
+ {}
36525
+ );
36505
36526
  var simplificationLocalAutorouterStrategy = createTscircuitAutorouterStrategy(
36527
+ "tscircuit_simplify",
36506
36528
  { useTraceSimplificationSolver: true }
36507
36529
  );
36508
36530
  var createFanoutAutorouterStrategy = (mode) => ({
36531
+ name: mode,
36509
36532
  cacheable: false,
36510
36533
  followUpAutorouter: "default",
36534
+ getSolverName: () => "FanoutSolver",
36511
36535
  create: ({
36512
36536
  simpleRouteJson,
36513
36537
  busFanoutDirections,
@@ -46179,7 +46203,7 @@ function Group_getRoutingPhasePlans(group) {
46179
46203
  var package_default = {
46180
46204
  name: "@tscircuit/core",
46181
46205
  type: "module",
46182
- version: "0.0.1838",
46206
+ version: "0.0.1840",
46183
46207
  types: "dist/index.d.ts",
46184
46208
  main: "dist/index.js",
46185
46209
  module: "dist/index.js",
@@ -46213,7 +46237,7 @@ var package_default = {
46213
46237
  "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
46214
46238
  "@tscircuit/alphabet": "0.0.25",
46215
46239
  "@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
46216
- "@tscircuit/capacity-autorouter": "^0.0.866",
46240
+ "@tscircuit/capacity-autorouter": "^0.0.874",
46217
46241
  "@tscircuit/checks": "^0.0.182",
46218
46242
  "@tscircuit/circuit-json-util": "^0.0.106",
46219
46243
  "@tscircuit/common": "^0.0.20",
@@ -46324,13 +46348,13 @@ var getFnv1aHash = (value) => {
46324
46348
  }
46325
46349
  return hash >>> 0;
46326
46350
  };
46327
- var getSrjHash = (simpleRouteJson) => {
46328
- const serializedSrj = JSON.stringify(simpleRouteJson);
46329
- const hash1 = getFnv1aHash(serializedSrj);
46330
- const hash2 = getFnv1aHash(`${serializedSrj}${hash1}`);
46351
+ var getJsonHash = (value) => {
46352
+ const serializedValue = JSON.stringify(value);
46353
+ const hash1 = getFnv1aHash(serializedValue);
46354
+ const hash2 = getFnv1aHash(`${serializedValue}${hash1}`);
46331
46355
  return `${hash1.toString(16).padStart(8, "0")}${hash2.toString(16).padStart(8, "0")}`;
46332
46356
  };
46333
- var getLocalAutoroutingCacheKey = (simpleRouteJson) => `routes:core@${package_default.version}:srj:${getSrjHash(simpleRouteJson)}`;
46357
+ var getLocalAutoroutingCacheKey = (simpleRouteJson, solverOptions) => `routes:core@${package_default.version}:solver:${getJsonHash(solverOptions)}:srj:${getJsonHash(simpleRouteJson)}`;
46334
46358
  var getCachedLocalAutoroutingPhaseResult = async ({
46335
46359
  cacheEngine,
46336
46360
  cacheKey
@@ -48191,14 +48215,17 @@ var Group5 = class extends NormalComponent3 {
48191
48215
  });
48192
48216
  };
48193
48217
  let previousStageOutputSimpleRouteJson;
48194
- for (const {
48195
- routingPhasePlan,
48196
- autorouterConfig: phaseAutorouterConfig,
48197
- strategy: localAutorouterStrategy,
48198
- usesPreviousStageOutput,
48199
- phaseStageIndex,
48200
- phaseStageCount
48201
- } of routingStages) {
48218
+ for (const [
48219
+ routingStageIndex,
48220
+ {
48221
+ routingPhasePlan,
48222
+ autorouterConfig: phaseAutorouterConfig,
48223
+ strategy: localAutorouterStrategy,
48224
+ usesPreviousStageOutput,
48225
+ phaseStageIndex,
48226
+ phaseStageCount
48227
+ }
48228
+ ] of routingStages.entries()) {
48202
48229
  if (!usesPreviousStageOutput) {
48203
48230
  previousStageOutputSimpleRouteJson = void 0;
48204
48231
  }
@@ -48344,7 +48371,58 @@ var Group5 = class extends NormalComponent3 {
48344
48371
  graphicsObject.title = `autorouting-${this.props.name}`;
48345
48372
  global.debugGraphics?.push(graphicsObject);
48346
48373
  }
48374
+ const autorouterVersion2 = phaseAutorouterConfig.autorouterVersion ?? this.props.autorouterVersion;
48375
+ const effortLevel = this.props.autorouterEffortLevel;
48376
+ const effort = effortLevel ? Number.parseInt(effortLevel.replace("x", ""), 10) : void 0;
48377
+ const commonAutorouterOptions = {
48378
+ capacityDepth: phaseAutorouterConfig.capacityDepth,
48379
+ targetMinCapacity: phaseAutorouterConfig.targetMinCapacity,
48380
+ platformConfig: this.root?.platform,
48381
+ useAssignableSolver: phaseIsLaserPrefabPreset || isSingleLayerBoard,
48382
+ useAutoJumperSolver: phaseIsAutoJumperPreset,
48383
+ useLaserPrefabSolver: phaseIsLaserPrefabPreset,
48384
+ autorouterVersion: autorouterVersion2,
48385
+ effort
48386
+ };
48387
+ const autorouterName = phaseAutorouterConfig.algorithmFn ? "custom" : localAutorouterStrategy.name;
48388
+ const solverName = phaseAutorouterConfig.algorithmFn ? void 0 : localAutorouterStrategy.getSolverName(commonAutorouterOptions);
48389
+ const localAutoroutingCacheSolverOptions = {
48390
+ autorouterName,
48391
+ solverName,
48392
+ capacityDepth: commonAutorouterOptions.capacityDepth,
48393
+ targetMinCapacity: commonAutorouterOptions.targetMinCapacity,
48394
+ useAssignableSolver: commonAutorouterOptions.useAssignableSolver,
48395
+ useAutoJumperSolver: commonAutorouterOptions.useAutoJumperSolver,
48396
+ useLaserPrefabSolver: commonAutorouterOptions.useLaserPrefabSolver,
48397
+ useTraceSimplificationSolver: phaseAutorouterConfig.preset === "simplify",
48398
+ autorouterVersion: commonAutorouterOptions.autorouterVersion,
48399
+ effort: commonAutorouterOptions.effort
48400
+ };
48401
+ const cacheEngine = phaseAutorouterConfig.algorithmFn || !localAutorouterStrategy.cacheable ? void 0 : this.root?.platform?.localCacheEngine;
48402
+ const cacheKey = cacheEngine ? getLocalAutoroutingCacheKey(
48403
+ simpleRouteJson,
48404
+ localAutoroutingCacheSolverOptions
48405
+ ) : void 0;
48406
+ const cachedResult = cacheKey ? await getCachedLocalAutoroutingPhaseResult({ cacheEngine, cacheKey }) : null;
48407
+ const cacheDisabledReason = phaseAutorouterConfig.algorithmFn ? "custom_algorithm" : !localAutorouterStrategy.cacheable ? "strategy_not_cacheable" : !cacheEngine ? "no_cache_engine" : void 0;
48408
+ const autoroutingMetadata = {
48409
+ routingPhaseIndex: routingStageIndex,
48410
+ phaseOrdinal: routingStageIndex + 1,
48411
+ phaseCount: routingStages.length,
48412
+ connectionCount: simpleRouteJson.connections.length,
48413
+ obstacleCount: simpleRouteJson.obstacles.length,
48414
+ previousTraceCount: simpleRouteJson.traces?.length ?? 0,
48415
+ isReroutePhase,
48416
+ autorouterName,
48417
+ autorouterVersion: autorouterVersion2,
48418
+ solverName,
48419
+ effort,
48420
+ cacheStatus: cacheEngine ? cachedResult ? "hit" : "miss" : "disabled",
48421
+ cacheKey,
48422
+ cacheDisabledReason
48423
+ };
48347
48424
  this.root?.emit("autorouting:start", {
48425
+ type: "autorouting:start",
48348
48426
  subcircuit_id: this.subcircuit_id,
48349
48427
  componentDisplayName: this.getString(),
48350
48428
  ...routingPhasePlan.phaseName !== void 0 ? {
@@ -48352,11 +48430,9 @@ var Group5 = class extends NormalComponent3 {
48352
48430
  phaseStageIndex,
48353
48431
  phaseStageCount
48354
48432
  } : {},
48433
+ ...autoroutingMetadata,
48355
48434
  simpleRouteJson
48356
48435
  });
48357
- const cacheEngine = phaseAutorouterConfig.algorithmFn || !localAutorouterStrategy.cacheable ? void 0 : this.root?.platform?.localCacheEngine;
48358
- const cacheKey = cacheEngine ? getLocalAutoroutingCacheKey(simpleRouteJson) : void 0;
48359
- const cachedResult = cacheKey ? await getCachedLocalAutoroutingPhaseResult({ cacheEngine, cacheKey }) : null;
48360
48436
  let autorouter;
48361
48437
  try {
48362
48438
  let traces;
@@ -48367,19 +48443,6 @@ var Group5 = class extends NormalComponent3 {
48367
48443
  if (phaseAutorouterConfig.algorithmFn) {
48368
48444
  autorouter = await phaseAutorouterConfig.algorithmFn(simpleRouteJson);
48369
48445
  } else {
48370
- const autorouterVersion2 = phaseAutorouterConfig.autorouterVersion ?? this.props.autorouterVersion;
48371
- const effortLevel = this.props.autorouterEffortLevel;
48372
- const effort = effortLevel ? Number.parseInt(effortLevel.replace("x", ""), 10) : void 0;
48373
- const commonAutorouterOptions = {
48374
- capacityDepth: phaseAutorouterConfig.capacityDepth,
48375
- targetMinCapacity: phaseAutorouterConfig.targetMinCapacity,
48376
- platformConfig: this.root?.platform,
48377
- useAssignableSolver: phaseIsLaserPrefabPreset || isSingleLayerBoard,
48378
- useAutoJumperSolver: phaseIsAutoJumperPreset,
48379
- useLaserPrefabSolver: phaseIsLaserPrefabPreset,
48380
- autorouterVersion: autorouterVersion2,
48381
- effort
48382
- };
48383
48446
  autorouter = localAutorouterStrategy.create({
48384
48447
  simpleRouteJson,
48385
48448
  commonAutorouterOptions,
@@ -48389,12 +48452,12 @@ var Group5 = class extends NormalComponent3 {
48389
48452
  allowBlindAndBuriedVias: simpleRouteJson.allowBlindAndBuriedVias,
48390
48453
  componentNamesById: getPcbComponentNamesById(db),
48391
48454
  onSolverStarted: ({
48392
- solverName,
48455
+ solverName: solverName2,
48393
48456
  solverParams,
48394
48457
  solverConstructorArgs
48395
48458
  }) => this.root?.emit("solver:started", {
48396
48459
  type: "solver:started",
48397
- solverName,
48460
+ solverName: solverName2,
48398
48461
  solverParams,
48399
48462
  solverConstructorArgs,
48400
48463
  componentName: this.getString()
@@ -48428,7 +48491,9 @@ var Group5 = class extends NormalComponent3 {
48428
48491
  phaseStageIndex,
48429
48492
  phaseStageCount
48430
48493
  } : {},
48431
- ...event
48494
+ ...autoroutingMetadata,
48495
+ ...event,
48496
+ type: "autorouting:progress"
48432
48497
  });
48433
48498
  });
48434
48499
  activeAutorouter.start();
@@ -48499,6 +48564,7 @@ var Group5 = class extends NormalComponent3 {
48499
48564
  phaseStageIndex,
48500
48565
  phaseStageCount
48501
48566
  } : {},
48567
+ ...autoroutingMetadata,
48502
48568
  simpleRouteJson: outputSimpleRouteJson
48503
48569
  });
48504
48570
  if (autorouter?.getConnectedOffboardObstacles) {
@@ -48567,6 +48633,7 @@ var Group5 = class extends NormalComponent3 {
48567
48633
  message: error instanceof Error ? error.message : String(error)
48568
48634
  });
48569
48635
  this.root?.emit("autorouting:error", {
48636
+ type: "autorouting:error",
48570
48637
  subcircuit_id: this.subcircuit_id,
48571
48638
  componentDisplayName: this.getString(),
48572
48639
  ...routingPhasePlan.phaseName !== void 0 ? {
@@ -48574,6 +48641,7 @@ var Group5 = class extends NormalComponent3 {
48574
48641
  phaseStageIndex,
48575
48642
  phaseStageCount
48576
48643
  } : {},
48644
+ ...autoroutingMetadata,
48577
48645
  error: {
48578
48646
  message: error instanceof Error ? error.message : String(error)
48579
48647
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1839",
4
+ "version": "0.0.1841",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "@tsci/tscircuit.ti": "github:tscircuit/ti#57e314be4b2b06bc546d4def7453e619604d1157",
36
36
  "@tscircuit/alphabet": "0.0.25",
37
37
  "@tscircuit/bga-fanout-solver": "github:tscircuit/bga-fanout-solver#247c835cb8d69b65e53891dcf869731079415b39",
38
- "@tscircuit/capacity-autorouter": "^0.0.866",
38
+ "@tscircuit/capacity-autorouter": "^0.0.874",
39
39
  "@tscircuit/checks": "^0.0.182",
40
40
  "@tscircuit/circuit-json-util": "^0.0.106",
41
41
  "@tscircuit/common": "^0.0.20",