by adom
How the Adom Wiki (wiki.adom.inc) works and how to drive it with the adom-wiki CLI: the two storage layers (git page repo vs package registry), hosting source by pushing files (not a tarball), making packages, cutting per-platform releases, and the three-tier skill layout (user skills ship, dev-skills/ and publish-skills/ stay source-only). adom-wiki is the current tool; adompkg is deprecated.
Public POST /api/parts-search: forward parts search to Component Ocean (adom-parts-search goes wiki-only)
What we need
adom-parts-search (app, CLI and skill) should call only wiki.adom.inc. Every distributor search goes user or AI → wiki → Component Ocean → Mouser / DigiKey / JLCPCB. CO is the only caller of the distributor APIs, and it owns caching, freshness, budgets, rate limits and outage fallbacks.
CO's side is live (component-ocean eceb2aa): POST /api/parts-search. The wiki needs a public route that forwards to it, the way the request box forwards to /api/part-request.
The wiki route
POST https://wiki.adom.inc/api/parts-search
Request body (JSON), forwarded to CO unchanged:
| field | type | |
|---|---|---|
q |
string, 2 to 80 chars | a part number or keywords |
limit |
3, 5 or 10 | per vendor, default 5 |
in_stock_only |
bool | optional |
jlcpcb_basic |
bool | optional, JLCPCB Basic parts only |
vendors |
array of mouser, digikey, jlcpcb |
optional, default all three |
Forward to POST https://component-ocean-jk89eeqplwfl.adom.cloud/api/parts-search with the same headers the request box sends to /api/part-request:
X-Adom-Request-KeyX-Adom-User: the signed-in user;email:<hex>for a signed-out visitor who left an email; oranonwithX-Adom-Anon-Ipfor an anonymous visitorX-Adom-Client: the caller's User-Agent, so the demand log can tell the app, the CLI and the wiki apart
Same rules as the request box: the same auth and the same anonymous handling. A rate cap should be a little looser than the request box's, since a search is cheaper than a build, but keep anonymous callers per IP.
Response: CO's JSON, passed through:
{
"query": "LM358DR",
"mouser": {"ok": true, "count": 5, "components": [{"mpn": "...", "mouser_pn": "...", "stock": 0, "price_tiers": [], "image_url": "...", "product_url": "...", "...": "..."}],
"fetched_at": "2026-11-04T17:20:00Z", "age_s": 0, "from_cache": false, "elapsed_ms": 900},
"digikey": {"...": "same shape"},
"jlcpcb": {"...": "same shape"},
"live_calls": 3,
"exact": {"mpn": "LM358DR", "manufacturer": "Texas Instruments", "stock": 55449, "lcsc": "C5423"},
"hits": 9,
"demand": {"recorded": true, "miss": false, "page_url": "https://wiki.adom.inc/adom/lm358dr"}
}
components is each vendor service's own answer, the same shape adom-parts-search shows today, so its grid, photos and price breaks stay as they are. A vendor that fails comes back ok: false with error. If CO has an older answer, it serves that with from_cache: true and the error text instead.
What CO does behind it
- Each vendor answer is cached for 6 h (Mouser, DigiKey) or 24 h (JLCPCB). A search makes at most one live call per vendor, and only when the cache is stale or missing. A repeat inside the window makes none: measured live, LM358DR took 3 calls in 1.3 s, then 0 calls in 0.1 s.
- Live calls spend the distributor budget as the user; anonymous calls count against an app class.
- Every query is logged. An exact part a distributor sells but the wiki has no page for counts toward the inferred build queue, the same as a search miss today. A part number no vendor sells is logged as a miss.
GET /api/parts-search/demand?days=7(CO, request key) lists the top queries, misses and live calls.
Two smaller gaps for the CLI and AIs
POST /api/part-search-missrefuses anything but the wiki's own search page (PART_SEARCH_MISS_CROSS_SITE). Once/api/parts-searchforwards, CO logs those misses itself, so this matters only for a wiki-page-only lookup. A token-authenticated path would still help.GET /api/pages/<ref>/stockserves its cache only, and that cache is empty on most pages, since it fills only when a person opens the stock widget. For a page, the parts-search answer above is the better stock source.
adom-parts-search will use /api/parts-search behind a flag until this ships, and nothing merges before it's live.