Assistant — discovery

Store Builder as a WhatsApp-style chat: the owner's voice note of 5 Oct 2026. The step-wise Store Builder flow (store-builder-v5), asked one question at a time by the FoodBridge Assistant, plus products read from any file, the store summed up, and what to do next. A module of its own (modules/assistant), independent of store-builder and customer-success. assistant-v5 — published for feedback

The assistant ↗Its own page, opens on “hi”. On a computer: WhatsApp Web: chats, the conversation, your store setup. As on a phone ↗The contacts card is the address book. Best in a phone-sized window. In the Control Tower ↗The same chat as the tower's panel, over the Vasu Foods board. What reached FoodBridge ↗The builds from Create my store, and the campaign outbox.

Serve over HTTP (a service worker stands in for the bridge and for Claude; it does not run from file://): python3 -m http.server 8790 --directory modules/assistant/discovery. Nothing leaves the browser. ?vasu=<url> points the next actions and the tower at another copy of mock-platform v7 (default: the published one). Start fresh: the chat's ⋯ → Start again.

The question tree (screens/chat/onboard.js)

Every Store Builder v5 question, in its order, one at a time; the owner's additions marked ★. Every answer lands in Store Builder's own state (screens/sb/model.js), so the Excel the team receives is Store Builder's.

#NodeAsksAnswered byWrites
0(welcome)He says hi → Namaste, I'm your FoodBridge Assistantreply buttons: Onboarding: set up my store · How it works—
1name ★What's your name?typingstore.owner
2mobileYour mobile number? (login)typing (tel keypad); 10 digits, 6–9store.mobile → GET /api/draft
2asyncA store is saved for this number — carry on from it? (only if one is)buttonsthe whole saved state (v5 Sync)
3contactsYour people — no typingphone: Choose from contacts (the address book); computer: QR → the phone page; any: 📎 a Tally/Busy/Excel list or .vcf, or pasted rowspeople, order
4sortWho is who? (guessed from names)buttons Looks right / Check the list → a sheet with a radio per person (Customer · Supplier · Staff · Not needed)people[].type
5type (+ typeOther)What is your business?radio list (WhatsApp list), or typed / a numberstore.type
6warehousesHow many warehouses (godowns)?dropdown, or typedstore.warehouses
7gstGST number? (optional)typing (checked), or I'll add it laterstore.gst
8–10routes, selfOrder, partPayFixed route days? Customers order on the phone? Pay a bill in parts?Yes / No buttons, or haan / nahirules.*
11payMethods (+ payOther)How do customers pay you?ticks + Done, or typed “cash, UPI”rules.payMethods
12–13returns, morning (+ Other)Damaged goods come back… / First thing each morningradio listsrules.returns, rules.morning
14noteAnything else about your day?typing, or Nothing morerules.note
15products ★Send anything — rate list, photo, Tally export📎 → POST /api/extract (Claude; stand-in here) → the rows shown back → Add all / Check them (an editable form)items, customItems, companies; the file kept as raw/
16filesAnything on paper — khata, route chart, bills?📎, or photos from the phone (QR on a computer)papers (to the team as they came)
17summary ★Here's your store (a card + the facts worded)Create my store / Change something (a list of sections → back here)—
18done ★✅ Your store is created — sent to the FoodBridge teamif ≥ 1 customer and ≥ 1 product: what next (below); else Add customers / Add productsthe build (POST /api/stores)

What next (decision 1: over the Vasu Foods demo, while the team finishes his store)

ActionOpens
Create an ordermock-platform v7 · Sales orders · Create (new tab)
Order for tomorrowthe same, told to set tomorrow's date
Collection request (WhatsApp)v7 Control Tower · Collections (its prepared reminders; nothing goes out until confirmed). In the tower panel: the board behind the chat
Send a campaignin the chat (decision 4): who (all / big ⭐ / pick) → what (new products · this week's rates · festival · own words) → the message shown back → Queue it → held in the outbox; no WhatsApp sender is connected

Transition map (proto-FSM → SSOT-1, SSOT-5)

idle ──hi──▶ welcome ──Onboarding──▶ name ─▶ mobile ─[draftLookup]─▶ (sync)? ─▶ contacts ⟲ (more) ─▶ sort ⟲ (sheet)
  ─▶ type ─▶ (typeOther)? ─▶ warehouses ─▶ gst ─▶ routes ─▶ selfOrder ─▶ partPay ─▶ payMethods ─▶ (payOther)?
  ─▶ returns ─▶ (returnsOther)? ─▶ morning ─▶ (morningOther)? ─▶ note ─▶ products ⟲ (extract | sample | check) ─▶ files ⟲
  ─▶ summary ──Change something──▶ any section's first node ─(section done)─▶ summary
  summary ──Create my store─[build: POST /api/stores]─▶ done
  done ──next:order | next:tomorrow | next:collect──▶ v7 demo (new tab / the board)        done ──next:campaign──▶ cmp.who ─▶ cmp.what ─▶ (cmp.own)? ─▶ cmp.check ─[queueCampaign]─▶ done
  any node ──"back"──▶ the previous node          any ──"menu"──▶ the menu (Carry on · Start again · How it works)
  tower panel: idle ──tower intents (needs, deliveries … production, news)──▶ answers from the Vasu snapshot ── "Set up a new store" ──▶ name

Decisions

#Decision (owner, 5 Oct 2026)HereFeeds
D1Create my store still sends the build to the customer success team; the next actions open over the Vasu demobuild = Store Builder's (sb/outbox.js); next actions → mock-platform v7SSOT-5, SSOT-7
D2A page of its own that opens on hi; the Control Tower's assistant is the same chat in a panelchat.html, tower.html — one engine, one conversationSSOT-3, SSOT-4
D3The Claude API key is tech debtTD-1 below; the contract is claude/extract-products.mdSSOT-7
D4A simple campaign now: pick customers, a WhatsApp message, held in the outboxcmp.* nodes; sent.html outboxSSOT-1, SSOT-5
D5A new module in the module repo, not part of store-builder; discovery first, development after the freezemodules/assistant; Store Builder code is copied, never linkedparent addendum-009

Tech debt and open questions

#WhatNow
v2The desktop as WhatsApp Web (owner, 5 Oct 2026: “enterprise grade”)at 900 px and wider: the chat list (the Assistant; FoodBridge Team = his store as FoodBridge received it, and Outbox = his held campaigns — only once his mobile has one), a light header, the conversation edge to edge, a flat message bar, centred dialogs, the store-setup drawer (ⓘ). v3: nothing without a job — no rail, search, filters or decorations. Narrower: the phone layout, unchanged
TD-1Claude is not called (no API key)spreadsheets are read by the stand-in for real; photos/PDFs come back “can't read yet — kept for the team” + a labelled sample read; the summary is a template
TD-2No WhatsApp sendercampaigns are held in this browser's outbox (as the Control Tower's reminders are)
Q-1HindiStore Builder is bilingual; the chat is English in v1 (it understands typed Hinglish: haan, nahi, paisa, udhaar…). Ask the owner before adding हिंदी
Q-2Products and Warehouse stock are hidden in Store Builder (1 Oct 2026)the owner asked for products again, so they are asked here; warehouse stock stays out

Where things come from

FilesCopied fromChanged
screens/sb/ (model, catalogue, export, import, outbox, icons, gcontacts, send/, vendor/qrcode)store-builder-v5 prototype (frozen)only outbox.js's IndexedDB names (fb-assistant-sb*), so the two modules never share data
discovery-bridge.jsstore-builder-v5's stand-in bridgeown cache; the picker serves sb/send/; + /api/extract
screens/chat/shell.css, mascot/mock-platform v7 Control Tower assistant @ 2a7ead3none (widgets.css adds to it)
screens/chat/tower-brain.jsmock-platform v7 assets/ct/chat.js @ 2a7ead3+ Production; local rupees(); hands unknown words back (marked in the file)
seed-data/tower-snapshot.jsonthe live v7 Control Tower (Vasu Foods), 5 Oct 20266 rows a tile, 8 events a day

New here: screens/chat/onboard.js (the tree), app.js (drawing and hooks), extract-standin.js, widgets.css, the screens. Tests: node --test tests/*.test.js from discovery/. Inputs: the voice note, the decisions. Log: addendum-002, addendum-003, addendum-004, addendum-005, addendum-006.