app
Parts Search
Public Made by Adomby adom
One search box across Mouser, DigiKey and JLCPCB: parallel queries, side-by-side product photos, and a Mouser-preferred recommendation that reasons around stock and lead time.
← Commit history
v2.0.17: Module 2.4.0: the panel gutter check now measures against the containing block
10 files changed
+27−97
Cargo.lock+1−1@@ -10,7 +10,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "adom-parts-search"-version = "2.0.16"+version = "2.0.17" dependencies = [ "base64", "clap",
Cargo.toml+1−1@@ -1,6 +1,6 @@ [package] name = "adom-parts-search"-version = "2.0.16"+version = "2.0.17" edition = "2021" description = "Parts Search Electronics component search — CLI, backend HTTP service, and Hydrogen webview app" license = "MIT"
VERSION+1−1@@ -1 +1 @@-2.0.16+2.0.17
install.shpackage.json+2−41@@ -1,6 +1,6 @@ { "slug": "adom-parts-search",- "version": "2.0.17",+ "version": "2.0.4", "type": "app", "description": "One search box across Mouser, DigiKey and JLCPCB. Parallel queries, side-by-side product photos, and a Mouser-preferred recommendation that reasons around stock and lead time. Dock Bar ready: serve, health, settings, Say it.", "dependencies": {@@ -38,44 +38,5 @@ "SKILL.md", "BUILD-SKILL.md", "CHANGELOG.md"- ],- "changelog": "Module 2.4.0: the panel gutter check now measures against the containing block",- "discovery_triggers": [- "parts search",- "find part",- "source component",- "source part",- "compare distributors",- "compare vendors",- "Mouser or DigiKey",- "BOM sourcing",- "price this part",- "where can I get",- "check stock",- "parts availability",- "fastest delivery",- "cheapest part",- "component search",- "part lookup",- "price breaks"- ],- "discovery_pitch": "Search Mouser, DigiKey and JLCPCB in parallel with product photos; Mouser-preferred best-source pick. Say 'with parts search' to your AI.",- "sample_prompts": [- {- "label": "source an STM32F103RBT6",- "prompt": "source an STM32F103RBT6"- },- {- "label": "where can I get an ESP32-S3-WROOM cheape",- "prompt": "where can I get an ESP32-S3-WROOM cheapest and fastest"- },- {- "label": "compare Mouser, DigiKey and JLCPCB for a",- "prompt": "compare Mouser, DigiKey and JLCPCB for an LM555"- },- {- "label": "price this BOM across distributors",- "prompt": "price this BOM across distributors"- } ]-}+}
page.json+9−50@@ -4,7 +4,7 @@ "slug": "adom-parts-search", "title": "Parts Search", "brief": "One search box across Mouser, DigiKey and JLCPCB: parallel queries, side-by-side product photos, and a Mouser-preferred recommendation that reasons around stock and lead time.",- "version": "2.0.17",+ "version": "2.0.4", "install": { "binary_name": "adom-parts-search", "install_dir": "",@@ -33,25 +33,13 @@ }, "hero": { "type": "image",- "path": "screenshots/hero.png"+ "path": "docs/hero.png" }, "sample_prompts": [- {- "label": "source an STM32F103RBT6",- "prompt": "source an STM32F103RBT6"- },- {- "label": "where can I get an ESP32-S3-WROOM cheape",- "prompt": "where can I get an ESP32-S3-WROOM cheapest and fastest"- },- {- "label": "compare Mouser, DigiKey and JLCPCB for a",- "prompt": "compare Mouser, DigiKey and JLCPCB for an LM555"- },- {- "label": "price this BOM across distributors",- "prompt": "price this BOM across distributors"- }+ "source an STM32F103RBT6",+ "where can I get an ESP32-S3-WROOM cheapest and fastest",+ "compare Mouser, DigiKey and JLCPCB for an LM555",+ "price this BOM across distributors" ], "discovery_triggers": [ "parts search",@@ -66,41 +54,12 @@ "where can I get", "check stock", "parts availability",- "fastest delivery",- "cheapest part",- "component search",- "part lookup",- "price breaks"+ "fastest delivery" ],- "discovery_pitch": "Search Mouser, DigiKey and JLCPCB in parallel with product photos; Mouser-preferred best-source pick. Say 'with parts search' to your AI.",+ "discovery_pitch": "Search Mouser + DigiKey + JLCPCB in parallel from one interface, with product photos and a Mouser-preferred best-source pick.", "metadata": { "platform": "linux" }, "category": "tools",- "org": "adom",- "description": "One search box across Mouser, DigiKey and JLCPCB. Parallel queries, side-by-side product photos, and a Mouser-preferred recommendation that reasons around stock and lead time. Dock Bar ready: serve, health, settings, Say it.",- "dependencies": {- "adom/adom-mouser": "*",- "adom/adom-digikey": "*",- "adom/adom-jlcpcb": "*"- },- "needs_sudo": false,- "scripts": {- "install": "./install.sh",- "uninstall": "./uninstall.sh"- },- "files": [- "bin/**",- "skills/**",- "docs/icon.svg",- "dockbar.json",- "install.sh",- "uninstall.sh",- "package.json",- "README.md",- "SKILL.md",- "BUILD-SKILL.md",- "CHANGELOG.md"- ],- "changelog": "Module 2.4.0: the panel gutter check now measures against the containing block"+ "org": "adom" }
src/cli.rs+2−1@@ -7,7 +7,8 @@ use crate::{settings, ShowArgs, SearchArgs, SettingsCmd, UiCmd}; pub fn run_search(args: SearchArgs) -> Result<(), String> { let s = settings::load();- let opts = vendors::SearchOpts::from_settings(&s);+ let mut opts = vendors::SearchOpts::from_settings(&s);+ opts.jlcpcb_basic = args.basic; let agg = vendors::search_all( &args.keyword, args.limit.unwrap_or(s.default_limit),
src/main.rs+3@@ -161,6 +161,9 @@ pub struct SearchArgs { /// Hits per vendor (defaults to the Settings value, 5 out of the box). #[arg(long)] pub limit: Option<u32>, #[arg(long)] pub in_stock_only: bool,+ /// JLCPCB Basic parts only (JLCPCB charges a per-type fee for Extended+ /// parts). Mouser and DigiKey have no equivalent and are unaffected.+ #[arg(long)] pub basic: bool, #[arg(long, env = "MOUSER_API")] pub mouser_api: Option<String>, #[arg(long, env = "DIGIKEY_API")] pub digikey_api: Option<String>, #[arg(long, env = "JLCPCB_API")] pub jlcpcb_api: Option<String>,
src/vendors.rs+8−2@@ -505,17 +505,21 @@ pub struct SearchOpts { pub mouser: bool, pub digikey: bool, pub jlcpcb: bool,+ /// JLCPCB Basic parts only. JLCPCB charges a per-type fee for Extended+ /// parts at assembly, so "is it Basic" decides the bill. Mouser and DigiKey+ /// have no equivalent, so this narrows the JLCPCB column alone.+ pub jlcpcb_basic: bool, /// "mouser" or "cheapest". pub policy: String, } impl Default for SearchOpts {- fn default() -> Self { SearchOpts { mouser: true, digikey: true, jlcpcb: true, policy: "mouser".into() } }+ fn default() -> Self { SearchOpts { mouser: true, digikey: true, jlcpcb: true, jlcpcb_basic: false, policy: "mouser".into() } } } impl SearchOpts { pub fn from_settings(s: &crate::settings::Settings) -> Self {- SearchOpts { mouser: s.vendor_mouser, digikey: s.vendor_digikey, jlcpcb: s.vendor_jlcpcb, policy: s.policy.clone() }+ SearchOpts { mouser: s.vendor_mouser, digikey: s.vendor_digikey, jlcpcb: s.vendor_jlcpcb, jlcpcb_basic: false, policy: s.policy.clone() } } } @@ -550,11 +554,13 @@ pub fn search_all( let enabled: Vec<(Vendor, String)> = [(Vendor::Mouser, m_url.clone(), opts.mouser), (Vendor::DigiKey, d_url.clone(), opts.digikey), (Vendor::JLCPCB, j_url.clone(), opts.jlcpcb)] .into_iter().filter(|(_, _, on)| *on).map(|(v, u, _)| (v, u)).collect(); let n_enabled = enabled.len();+ let jlc_basic = opts.jlcpcb_basic; for (vendor, url) in enabled { let tx = tx.clone(); let body = { let mut b = body_common.clone(); b["action"] = Value::String("search".into());+ if jlc_basic && vendor == Vendor::JLCPCB { b["is_basic"] = Value::Bool(true); } b }; let url_for_block = url.clone();
uninstall.sh