Skip to content

Repository files navigation

Hemloop

Hemloop mark — lime dot looping the ring

Your AI tells a store what you need, without telling it who you are. The store answers with an offer priced inside rules a human locked, and every promotional claim is checked before it can exist. Neither side accumulates a profile of the other.

Live:hemloop.app · Built for the OpenAI WebMCP Challenge.

Four routes

RouteWhat it is
Hemloop/Both sides of one request in one shared space. Registers all 21 WebMCP tools (9 closet + 12 studio). Three human gates: Approve next request, Approve offer, Bought.
Closet/closetFull shopper surface (Wardrobe · Requests and offers). Nine tools. Wardrobe rows never leave the page.
Studio/studioFull merchant surface (Demand · Offer and rules · Composition). Twelve tools. Lock facts and approve proposals are human-only.
Docs/docs/Product docs: the loop, the problem, WebMCP, quick start, use cases.

/merchant redirects to /studio?tab=demand.

How to run the demo

Host:hemloop.app. The app deploys to Cloudflare Workers (wrangler) or Vercel and runs the same way on either.

Supported browsers:

  1. ChatGPT’s desktop-app built-in browser — open one of the hosts above inside ChatGPT; WebMCP tools register automatically.
  2. Chrome with chrome://flags/#enable-webmcp-testing enabled — flip the flag, press Relaunch, then reopen the host. (Chrome 149+ may already carry the origin-trial token for these hosts.)

The header should show tools live. Amber preview means the runtime is not exposed in that browser. The iOS in-app browser shows the page with tools in preview.

No account. State lives in your browser (localStorage); an incognito window is a clean install.

  1. Open a supported host in a supported browser (above).
  2. Upload a sample receipt image from public/receipts/ (northlight-till-receipt.png or harborview-order-email.png) in the chat with the prompt Use Hemloop's import_receipt site tool now. I approve importing this exact receipt into my private Hemloop closet. Do not only summarize it or claim success; call the tool with the receipt.
  3. Ask: Use Hemloop's find_gaps site tool now, then tell me: What should I buy next? (find_gaps).
  4. Ask: Use Hemloop's report_demand_gap site tool now. Tell the store I need hoodie, size M It is refused (human-approval-required). Press Approve next request, then reply Yes, send it now with Hemloop's report_demand_gap site tool. Tell the store I need hoodie, size M One press releases one event; a third send is refused again.
  5. Ask: Use Hemloop's get_demand and propose_offer site tools now. Which store can fill this, and what can it offer inside its rules? Press Approve offer.
  6. Ask: Use Hemloop's get_offers site tool now. Are there any offers for me? Press Bought.

Every station card carries its exact prompt under Say this with a Copy button; the prompts name the tool so the agent calls it instead of answering from memory.

Full walkthrough: docs/USER-GUIDE.md · docs/05-quick-start.md.

21 WebMCP tools

SurfaceToolKindWhat it doesStructural guarantee
Closetget_wardrobereadCompact wardrobe rows on this pagereadOnlyHint, untrustedContentHint; no shopper id
Closetget_my_sizesreadSizes owned, optional brand filterreadOnlyHint
Closetfind_gapsreadMissing / thin categories; worn-out by purchase datereadOnlyHint; due rows carry date, months, size only
Closetcheck_fitreadSize advice from owned garments vs catalogreadOnlyHint
Closetget_preferencesreadFit, colour, materials, ceiling, brandsreadOnlyHint; fields only if sharing level allows
Closetadd_garmentwriteAdd one local wardrobe rowEnum + bounds; never leaves the page
Closetreport_demand_gapwriteOnly outbound path to a merchantNeeds human approval; one press → one event; no shopper id
Closetimport_receiptwriteParse receipt / order email into local purchasesParsed locally; nothing leaves the page
Closetget_offersreadApproved offers for this closet’s own requestsreadOnlyHint; Bought / Passed is human-only
Studioget_campaign_statereadFacts, lock state, brief, scenes, formatreadOnlyHint
Studioset_briefwriteCreative brief (not rendered copy)Brief cannot become a claim
Studioadd_scene / update_scenewriteScene copyClaim-validated before apply; reject atomically
Studioreorder_sceneswriteTimeline orderPermutation-checked
Studioseek_previewwritePreview playheadClamped; deterministic
Studiovalidate_claimsreadDry-run claim validatorNever mutates
Studioexport_compositionreadDeliver HTML to the pageRefuses while any violation stands
Studioget_offerreadLocked offer (or one approved personal offer)readOnlyHint; human-locked facts only
Studioimport_productwritePull a catalog product into unlocked factsRefuses while facts are locked
Studioget_demandreadIncoming requests grouped and scored vs stockreadOnlyHint, untrustedContentHint
Studiopropose_offerwriteStage a personal offer inside locked rulesStaged only; Approve is human-only

Absent by design (no tool exists): approve_next_request, approve_offer, mark_bought, lock_facts, set_sharing_level.

Local development

git clone https://github.com/marconvm/hemloop
cd hemloop
npm install
npm run dev

Node 22+. App routes: /, /closet, /studio, /docs/. Tests: npm test. Lint: npm run lint.

Deploy (Cloudflare Workers): npm run build then npm run prepare:worker and npm run deploy:worker (see project scripts).

Licence

MIT · Copyright © 2026 Marco Cheung.

Credits

Wardrobe product photos are real retail catalog images, used with permission; the sources are listed in docs/PHOTO-CREDITS.md. The five merchants and their campaigns are fictional.

About

Two-sided agent-native commerce loop on WebMCP: shoppers keep their data, merchants see real demand, and every claim an agent writes is validated before it applies.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages