fix: project-local library resolution + copy_routing_pattern geometric fallback + TypeScript tool

- fix: DynamicSymbolLoader reads project sym-lib-table before global dirs
  add_schematic_component now finds symbols from project-local .kicad_sym files
  project_path derived automatically from schematic file path

- fix: place_component reloads FootprintLibraryManager with project_path
  new boardPath parameter passed to place_component tool (TypeScript + Python)
  _handle_place_component wrapper recreates LibraryManager per project

- fix: copy_routing_pattern geometric fallback when pads have no nets
  primary filter: net-based (when pads are assigned to nets)
  fallback: bounding box of source footprint pads +5mm tolerance
  filterMethod field in response indicates which mode was used

- feat: register copy_routing_pattern as MCP tool in routing.ts
  sourceRefs, targetRefs, includeVias, traceWidth parameters

Live tested: ESP32 + 2x TMC2209 in Test3 project
  13 traces U2 routed, copy_routing_pattern copied all 13 to U3
  offset Y+30mm correct, 26 total traces verified
This commit is contained in:
Tom
2026-03-01 14:42:22 +01:00
parent 2b38796409
commit b33d6e22fd
6 changed files with 186 additions and 9 deletions

View File

@@ -57,6 +57,10 @@ export function registerComponentTools(
.string()
.optional()
.describe("Optional layer (e.g., 'F.Cu', 'B.SilkS')"),
boardPath: z
.string()
.optional()
.describe("Path to the .kicad_pcb file required when using project-local footprint libraries"),
},
async ({
componentId,
@@ -66,6 +70,7 @@ export function registerComponentTools(
footprint,
rotation,
layer,
boardPath,
}) => {
logger.debug(
`Placing component: ${componentId} at ${position.x},${position.y} ${position.unit}`,
@@ -78,6 +83,7 @@ export function registerComponentTools(
footprint,
rotation,
layer,
boardPath,
});
return {