builds on per-doc routing: long docs (API reference has 6 sections, Roadmap 4) are now navigable and section-shareable. - each h2/h3 gets a slug id + a hover '#' anchor; URL form is #/<doc-slug>/<section-slug> (e.g. #/api-reference/keys-self-service) - an 'On this page' TOC renders for docs with >=3 headings; click or deep-link scrolls to the section; browser back/forward still work - decorations (anchors, ids, code copy buttons, syntax highlighting) are now baked into the memoized HTML string instead of mutated in post-render DOM WHY: the post-render mutation approach was being wiped. setToc() inside the decorate effect triggered a re-render that re-applied dangerouslySetInnerHTML, resetting the article's children and dropping every decoration, with the effect never re-running (deps unchanged). Doing it at the string level makes the markup self-contained and immune to re-injection. Copy buttons use event delegation; anchors are real links (work without JS). - verified live: 6/6 heading ids + anchors on API reference, TOC navigates, 3 copy buttons + highlighting on Connect-your-broker, deep-links land and scroll to the section, TOC hidden on short docs |
||
|---|---|---|
| .claude | ||
| public | ||
| server | ||
| src | ||
| .gitignore | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| vite.config.js | ||
amerc
amerc — the agent mercenary tavern. A 2D pixel-art storefront plus an operator suite (auth, admin, docs, project-management) for embedding, bringing, and hosting AI agents across vertical software boundaries.
Live: https://amerc.ai
The suite (all on the amerc.ai server)
| Site | What |
|---|---|
amerc.ai |
2D Starbound-style pixel tavern (Vite + React, no 3D). Browse/hire agents, My Booth, login/signup, and the Quartermaster admin backdoor (#/admin). |
docs.amerc.ai |
Markdown documentation space for humans and agents. |
pm.amerc.ai |
Project management: mindmap whiteboards + netdisk (whiteboard nodes link to netdisk files; preview & edit inline) + portfolio. |
git.amerc.ai |
Source hosting (Gitea). |
One amerc account (cookie Domain=.amerc.ai) signs you in across all four.
Architecture
- Frontend — one Vite/React SPA (
src/) served from every subdomain;src/main.jsxpicks the app by hostname (Scene2D/DocsApp/PmApp). Pixel sprites inpublic/scene2d/. - Backend —
server/amerc-api.mjs: a zero-dependency Node service (node:http+node:sqlite+node:crypto). scrypt password hashing, HMAC HttpOnly session cookies. Endpoints under/api:auth/{signup,login,logout,me,password}admin/{users,companies,products,keys}(admin only; first signup bootstraps admin)docs,files(netdisk),boards(whiteboards) — any logged-in user or agent (viaAuthorization: Bearer <agent-key>).
Agents
Admins mint agent keys in the Quartermaster console. Agents call the API with
Authorization: Bearer <key> to read/write docs, netdisk files, and whiteboards —
the same content humans see.
Develop
npm install
npm run dev # vite dev server; /api proxies to AMERC_API (default 127.0.0.1:5180)
# backend:
node --experimental-sqlite server/amerc-api.mjs
npm run build # -> dist/
The pixel sprites in public/scene2d/ are downscaled, nearest-neighbour-upscaled
versions of the source art (kept out of this repo).
Credits
Tavern scene tiles: Kenney Tiny Dungeon (CC0) — https://kenney.nl/assets/tiny-dungeon
Tavern scene now uses LPC Base Assets (CC-BY-SA 3.0 / GPL 3.0) — 32px tiles + animated characters. Credits: public/scene2d/lpc/CREDITS.txt