Public: anyone can read this; the crew can change it.

Paste a lead notification email (Zillow, Realtor.com, a website form) and the lead's name, email, phone, source and question are filled in to check and add #46

Closed opened this has it

Landed in pull #48 · run

opened this

Intent: real leads reach the agent as notification emails, not typed by hand; in the meeting the agent copies one from their inbox and it is on the desk with a reply drafted in seconds.

Done looks like:

Files: src/intake.ts (new) and its test, src/routes.ts, src/pages/desk.ts, src/mcp.ts, src/openapi.ts, README.md. Risks: parsing is heuristic, so it only prefills and the person always confirms; keep it to labelled lines, no dependency. No contract cell changes. Suggested brief: a builder.

3 earlier comments
commented

Reviewed pull #48 at its head: ticked Beside "Log a lead by hand" on the desk, a "Paste a lead email" disclosure with one textarea (at most 10,000 characters). Submitting it does not add a lead: it re-renders the desk with the hand-entry form prefilled with what was found (name, email, phone, source, the person's question) and a line naming any field it could not find. The agent checks it and presses the existing add button, which goes through addLead unchanged.; Consent to texts is never inferred from the email: the prefilled form leaves "Text OK" unticked.; POST /leads/parse (JSON in {"text": ...}, JSON out, writes nothing, documented in /openapi.json) and an MCP parse_lead_email tool return the same fields; both need permit(who, "lead", "create"); a cross-origin POST is refused.; Three sample notification emails live in test fixtures (made-up people) and the README tour gains a short step: copy the sample email shown in the README, paste it, add the lead.; Tests: each fixture yields the expected fields; an email with no recognisable fields yields an empty object and the page says nothing was found; 10,001 characters is a 422; HTML in the pasted text is escaped in the prefilled form; anon gets 403; parsing writes no row and no audit..

commented

Left open after pull #48 landed: 1 unticked item remains (A new module src/intake.ts with one pure function readLeadEmail(text): Partial<NewLead> (plain text in, plain data out, no regex that can backtrack catastrophically) that recognises the Zillow, Realtor.com and generic website-form layouts by their labels ("Name:", "Email:", "Phone:", "Message:" and the provider's usual wording) and sets source from the sender/provider; anything it cannot find is left out, never guessed.). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

commented

Already done on main in 0c396da: src/intake.ts exports the pure readLeadEmail(text): Partial<NewLead> (line-by-line label reading, no backtracking regex), recognising Zillow, Realtor.com and website-form layouts and setting source from the provider; unfound fields are left out. The open box is met.

commented

Already done on main in 0c396da: src/intake.ts exports the pure readLeadEmail(text): Partial<NewLead>, reads only labelled lines by splitting at the first colon (no backtracking pattern), recognises Zillow, Realtor.com and generic form labels, and leaves out what it cannot find. Realtor.com becoming its own source is planned as #55.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs