← Commit history

Publish 1.0.1

barrett-land ·e3488b89ed · ·parent 5d04ed8
3 files changed +51−17
package.json+39−11
@@ -1,13 +1,26 @@ {   "slug": "altium-part-importer",-  "version": "1.0.0",+  "version": "1.0.1",   "type": "skill",   "description": "Add any catalog component (resistor, capacitor, inductor, IC, connector, diode) to a user's Altium Designer library with its LCSC/JLCPCB part number attached, so JLCPCB BOM + pick-and-place exports carry it automatically. Drives Altium headlessly via the altium Adom Desktop bridge. Three paths: CREATE a library from a downloaded Altium .IntLib, APPEND a part into an existing library, or REUSE an existing symbol for a new value (clone + parametric footprint, no internet fetch). For Adom's own machine pins/contacts use adom-altium-library-importer instead.",-  "tags": ["skill","altium","lcsc","jlcpcb","library","footprint","symbol","component","bom"],+  "tags": [+    "skill",+    "altium",+    "lcsc",+    "jlcpcb",+    "library",+    "footprint",+    "symbol",+    "component",+    "bom"+  ],   "dependencies": {},-  "scripts": { "install": "./install.sh", "uninstall": "./uninstall.sh" },+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  },   "needs_sudo": false,-  "discovery_pitch": "Add any catalog component to Altium Designer with its JLCPCB/LCSC part number attached — create a library, append to an existing one, or reuse a symbol for a new value. Headless via the altium bridge.",+  "discovery_pitch": "Add any catalog component to Altium Designer with its JLCPCB/LCSC part number attached \u2014 create a library, append to an existing one, or reuse a symbol for a new value. Headless via the altium bridge.",   "discovery_triggers": [     "add a part to Altium",     "add a component to Altium",@@ -27,14 +40,29 @@   ],   "hero": {     "headline": "Altium Part Importer",-    "subhead": "Add any component to Altium with its JLC/LCSC part number — create, append, or reuse. Headless.",+    "subhead": "Add any component to Altium with its JLC/LCSC part number \u2014 create, append, or reuse. Headless.",     "screenshot": "docs/hero.png"   },   "sample_prompts": [-    {"label": "Add a cap", "prompt": "add a 100nF 0402 capacitor to my Altium library with the JLC part number"},-    {"label": "Add an IC", "prompt": "add the STM32G031 to my Altium ICs library with its LCSC number"},-    {"label": "New value", "prompt": "add a 4.7k 0402 resistor by reusing my existing resistor symbol"},-    {"label": "Append", "prompt": "append this part into my existing Capacitors library"},-    {"label": "Survey", "prompt": "what Altium libraries do I already have?"}+    {+      "label": "Add a cap",+      "prompt": "add a 100nF 0402 capacitor to my Altium library with the JLC part number"+    },+    {+      "label": "Add an IC",+      "prompt": "add the STM32G031 to my Altium ICs library with its LCSC number"+    },+    {+      "label": "New value",+      "prompt": "add a 4.7k 0402 resistor by reusing my existing resistor symbol"+    },+    {+      "label": "Append",+      "prompt": "append this part into my existing Capacitors library"+    },+    {+      "label": "Survey",+      "prompt": "what Altium libraries do I already have?"+    }   ]-}+}\ No newline at end of file
page.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "altium-part-importer",-  "version": "1.0.0",+  "version": "1.0.1",   "type": "skill",   "description": "Add any catalog component (resistor, capacitor, inductor, IC, connector, diode) to a user's Altium Designer library with its LCSC/JLCPCB part number attached, so JLCPCB BOM + pick-and-place exports carry it automatically. Drives Altium headlessly via the altium Adom Desktop bridge. Three paths: CREATE a library from a downloaded Altium .IntLib, APPEND a part into an existing library, or REUSE an existing symbol for a new value (clone + parametric footprint, no internet fetch). For Adom's own machine pins/contacts use adom-altium-library-importer instead.",   "tags": [
skills/altium-part-importer/import_part.py+11−5
@@ -57,20 +57,24 @@ def ad(verb, args=None): def win_userprofile():     r = ad("shell_execute", {"command": "echo %USERPROFILE%"})     for line in (r.get("stdout") or r.get("output") or "").splitlines():-        line = line.strip()+        line = line.strip().replace("/", "\\")   # normalize: adom-desktop may report forward slashes         if len(line) > 3 and line[1] == ":":             return line     return r"C:\Users\Public"  +# NOTE: paths are passed to cmd WITHOUT quotes — quoting breaks through the relay's+# cmd /c wrapping (quote-nesting). Library paths are space-free by design. def desk_listdir(folder, ext):-    r = ad("shell_execute", {"command": 'dir /b "%s\\*%s"' % (folder, ext)})+    r = ad("shell_execute", {"command": "dir /b " + folder})     out = (r.get("stdout") or r.get("output") or "")+    if "syntax is incorrect" in out or "Not Found" in out or "cannot find" in out.lower():+        return []     return [l.strip() for l in out.splitlines() if l.strip().lower().endswith(ext.lower())]   def desk_exists(path):-    r = ad("shell_execute", {"command": 'if exist "%s" (echo YES) else (echo NO)' % path})+    r = ad("shell_execute", {"command": "if exist " + path + " (echo YES) else (echo NO)"})     return "YES" in (r.get("stdout") or r.get("output") or "")  @@ -83,9 +87,11 @@ def settle(label):     """The bridge is single-threaded; a slow save can report a timeout while the work     persisted. Wait for the bridge to drain so we don't stack calls."""     print("   %s: timed out at relay (save usually persisted) — letting the bridge drain…" % label)-    for _ in range(10):+    for _ in range(12):         time.sleep(6)-        if ad("altium_ping", {}).get("version"):+        # addin_ping forwards a script to Altium; it only returns ok when the script+        # engine is actually free (process-level altium_ping answers too early).+        if ad("altium_addin_ping", {"timeout": 20}).get("ok"):             return