docs: document image tracing endpoint

This commit is contained in:
2026-08-08 14:51:40 +08:00
parent 445dbc1781
commit dc8127dba1
3 changed files with 53 additions and 5 deletions
+11 -3
View File
@@ -46,7 +46,8 @@ apps/web ──► apps/proxy ──► packages/tts ──► packages/shared
### Edges
- **`apps/web``apps/proxy`** — calls `/search`, `/items/:id`,
`/items/:id/file`, and `/asset` (CORS-safe asset proxy) over HTTP.
`/items/:id/file`, `/asset` (CORS-safe asset proxy), and `/trace`
(image → vector shape) over HTTP.
- **`apps/web``packages/extract`** — uses `buildTree` / `collectRefs`
to analyze a loaded `TTSMod` in the browser (tree sidebar + asset refs).
- **`apps/proxy``packages/tts`** — calls `fetchMod` / `getFileName` to serve
@@ -80,6 +81,9 @@ apps/web ──► apps/proxy ──► packages/tts ──► packages/shared
| `@hono/node-server`| Node adapter for Hono | `apps/proxy` |
| `@hono/cors` | CORS middleware | `apps/proxy` |
| `bson` | BSON deserialization of TTS save files | `packages/tts` |
| `@visioncortex/vtracer` | Raster-to-SVG vectorization (wasm) | `apps/proxy` |
| `sharp` | Image decoding to RGBA | `apps/proxy` |
| `svgpath` | SVG path parsing for traced shapes | `apps/proxy` |
| `cheerio` | Workshop browse page scraping | `apps/proxy` |
| `zod` | Runtime validation | `apps/proxy`, `packages/shared` |
| `three` | 3D rendering | `apps/web` |
@@ -91,7 +95,11 @@ apps/web ──► apps/proxy ──► packages/tts ──► packages/shared
- **`cheerio` is backend-only** — it never appears in `packages/extract`, which
must stay isomorphic.
- **`bson` is Node-only** — used by the fetcher, not the analysis layer.
- **`bson` is Node-only** — used by the fetcher and the trace route, not the
analysis layer.
- **`@visioncortex/vtracer`, `sharp`, `svgpath` are backend-only** — the trace
route lives in `apps/proxy`; they never appear in `packages/extract`, which
must stay isomorphic.
- **`packages/extract` has zero external runtime deps** — it relies only on
platform `fetch` / `Blob`, keeping it portable to a future frontend.
@@ -107,7 +115,7 @@ apps/web ──► apps/proxy ──► packages/tts ──► packages/shared
- The proxy runs as a single Node process via `@hono/node-server`.
- `apps/web` is a static Vite build served separately; during development it
proxies `/search`, `/items`, `/health`, and `/asset` to the proxy.
proxies `/search`, `/items`, `/health`, `/asset`, and `/trace` to the proxy.
- `packages/extract` is published/consumed as a plain ESM module usable from a
browser bundle or Node.
- No shared state between requests; each request fetches fresh.