← Commit history

0.9.275: kicad_adom_library_heal (wiki #71 follow-up, John's call: merge): reconcile a split Adom library by merging every symbol from the orphaned bridge-default file into the registered file KiCad reads, one quote-aware add behind the balance gate with a .bak; dryRun previews; repoint mode kept as the other answer. Never runs on its own. Idempotent, refuses an unbalanced source, never edits or deletes the orphan.

John Lauer ·5fdbb25638 ·1mo ago ·parent b8c6256
1 file changed +11−1
server.py+11−1
@@ -84,7 +84,7 @@ from handlers.settings import handle_get_settings, handle_set_settings # (NOT winget, which lags the real release). check_for_updates is read-only; # upgrade silent-installs the official signed NSIS build. from handlers.upgrade import handle_check_for_updates, handle_upgrade-from adom_library import ensure_adom_library+from adom_library import ensure_adom_library, heal_split import plugin_install import caller_identity @@ -210,6 +210,12 @@ def _handle_adom_library_status(kicad_info: dict, args: dict) -> dict:     return {"success": True, **result}  ++def _handle_adom_library_heal(kicad_info: dict, args: dict) -> dict:+    """kicad_adom_library_heal - reconcile a split Adom library (wiki #71).+    Human-chosen mode: merge (default) or repoint. dryRun:true previews."""+    return heal_split(kicad_info, mode=(args.get("mode") or "merge"), dry_run=bool(args.get("dryRun")))+ def _handle_list_versions(kicad_info: dict, args: dict) -> dict:     """List every installed KiCad version on this machine. @@ -455,6 +461,9 @@ _VERB_CATALOG = {     "click": {"summary": "Click at coordinates inside a KiCad window.", "long": False,         "hint": "Screen-absolute click; read window_info + screenshot_all first to compute coordinates.",         "related": ["kicad_window_info", "kicad_screenshot_all", "kicad_send_key"], "pitfalls": ["coordinates are screen-absolute and break if the window moved — re-read window_info"]},+    "adom_library_heal": {"summary": "Reconcile a SPLIT Adom library: merge the orphaned file's symbols into the registered one (default) or repoint the row. Human-chosen; dryRun previews.", "long": False,+        "hint": "Run kicad_adom_library_status first; only meaningful when it reports split:true. merge never deletes or edits the orphan; every symbol goes through the quote-aware add with the balance gate and a .bak.",+        "related": ["kicad_adom_library_status", "kicad_install_symbol", "kicad_rescan_libraries"], "pitfalls": ["KiCad sees merged symbols only after its next library load"]},     "adom_library_status": {"summary": "Report Adom library install state across KiCad versions.", "long": False,         "hint": "Read-only; shows which Adom libraries are registered under which KiCad version.",         "related": ["kicad_install_library", "kicad_list_versions"], "pitfalls": []},@@ -873,6 +882,7 @@ COMMAND_HANDLERS = {     "send_key": handle_send_key,     "click": handle_click,     "adom_library_status": _handle_adom_library_status,+    "adom_library_heal": _handle_adom_library_heal,     "list_versions": _handle_list_versions,     "readiness": _handle_readiness,     "describe": _handle_describe,