Minimal multi-agent rewrite pipeline (Critic → Author → Editor) using the DeepSeek API, with a Cursor-like document UI and SSE stage updates so the right rail reflects real backend progress.
- Client: Vite, React 19, TypeScript, Tailwind CSS v3
- Server: Hono (
@hono/node-server), OpenAI SDK pointed at DeepSeek, Zod
No Next.js, no login, no database in this MVP.
-
Copy
.env.exampletoserver/.env(or repo root.envand load from server — here the server readsprocess.env, so use root.envwhen running from repo root). -
Set
DEEPSEEK_API_KEYin that file. -
Install and run:
npm install
npm run dev- UI: http://localhost:5173 (proxies
/apito the API) - API: http://127.0.0.1:8787
- Set
API_SECRETon the server andVITE_API_SECRETinclient/.env.localfor local testing. Do not ship secrets in the client for public production; use same-origin cookies or a proper backend session instead.
POST /api/rewrite/stream— body{ "text": string, "tone"?: …, "register"?: "neutral_analytic" | "explainer" | "reader_forward", "user_context"?: string }(defaults:tone=academic,register=neutral_analytic;user_contextoptional, max 8000 chars). Register controls stance (e.g. second-person / hype underneutral_analytic). Responsetext/event-streamwith events:stage_start,critic_done,author_done, optionalauthor_lint_fix_done(machine-lint repair pass),line_edit_done(line polish micro-pass;stage_startwithstage: "line_edit"when it begins),editor_done, optionalauthor_revision_done/ secondline_edit_done/editor_recheck_done,pipeline_complete,pipeline_error.- Rewritten prose is normalized server-side to remove Unicode em dash (U+2014) and en dash (U+2013) used as sentence punctuation.
- Tone is persisted in
localStorageunderhumanizer-tone. - User context (sidebar notes) is persisted under
humanizer-user-context. - Register (stance) is persisted under
humanizer-register. - Theme (dark / light) uses
data-themeon<html>, persisted ashumanizer-theme, and updatestheme-colorfor the browser chrome.
npm run build