Compare commits

...

2 commits

2 changed files with 17 additions and 17 deletions

View file

@ -2,7 +2,7 @@
> *Part of the Circuit Forge LLC "AI for the tasks you hate most" suite.*
**Status:** Active — eBay listing search + seller trust scoring MVP complete. Auction sniping engine and multi-platform support are next.
**Status:** Active — eBay listing intelligence MVP complete (search, trust scoring, affiliate links, feedback FAB, vision task scheduling). Auction sniping engine and multi-platform support are next.
## What it does
@ -68,6 +68,20 @@ Scans listing titles for signals the item may have undisclosed damage or problem
- **On-demand**: ↻ button on any listing card triggers `POST /api/enrich` — runs enrichment and re-scores without waiting for a second search
- **Category history**: derived from the seller's accumulated listing data (Browse API `categories` field); improves with every search, no extra API calls
### Affiliate link builder
Listing cards surface eBay affiliate-wrapped URLs. Uses `circuitforge_core.affiliates.wrap_url` — resolution order: user opted out → plain URL; user has BYOK affiliate ID → their ID; CF env var set (`EBAY_AFFILIATE_ID`) → CF's ID; otherwise plain URL. Users can configure their own eBay Partner Network ID or opt out entirely in Settings.
Disclosure tooltip appears on first encounter per-session and on each wrapped link (per-retailer copy from `get_disclosure_text`).
### Feedback FAB
In-app feedback button (bottom-right FAB) opens a modal: title, description, optional screenshot. Posts to the CF feedback endpoint. Status probed on load; FAB hidden if endpoint unreachable.
### Vision task scheduling
Photo condition assessment tasks queued through `circuitforge_core.tasks.TaskScheduler` — VRAM-aware slot management shared with any other LLM workloads on the same host. Runs moondream2 locally (free tier) or Claude vision (paid/cloud). Results stored per-listing and update the trust score card.
### Market price comparison
Completed sales fetched via eBay Marketplace Insights API (with Browse API fallback for app tiers that don't have Insights access). Median stored per query hash, used to score `price_vs_market` across all listings in a search.

View file

@ -23,6 +23,7 @@ from pydantic import BaseModel
from fastapi.middleware.cors import CORSMiddleware
from circuitforge_core.config import load_env
from circuitforge_core.affiliates import wrap_url as _wrap_affiliate_url
from app.db.store import Store
from app.db.models import SavedSearch as SavedSearchModel, ScammerEntry
from app.platforms import SearchFilters
@ -69,21 +70,6 @@ def _ebay_creds() -> tuple[str, str, str]:
client_secret = (os.environ.get("EBAY_CERT_ID") or os.environ.get("EBAY_CLIENT_SECRET", "")).strip()
return client_id, client_secret, env
def _affiliate_url(url: str) -> str:
"""Append EPN affiliate params when EBAY_AFFILIATE_CAMPAIGN_ID is configured.
If the env var is absent or blank, the original URL is returned unchanged.
Params follow the standard EPN deep-link format; siteid=0 = US.
"""
campaign_id = os.environ.get("EBAY_AFFILIATE_CAMPAIGN_ID", "").strip()
if not campaign_id:
return url
sep = "&" if "?" in url else "?"
return (
f"{url}{sep}mkcid=1&mkrid=711-53200-19255-0"
f"&siteid=0&campid={campaign_id}&toolid=10001&mkevt=1"
)
app = FastAPI(title="Snipe API", version="0.1.0", lifespan=_lifespan)
app.include_router(ebay_webhook_router)
@ -413,7 +399,7 @@ def search(
def _serialize_listing(l: object) -> dict:
d = dataclasses.asdict(l)
d["url"] = _affiliate_url(d["url"])
d["url"] = _wrap_affiliate_url(d["url"], retailer="ebay")
return d
return {