An assistant writing expenses through the MCP was told "e.g. Accommodation, Food, Transport" and stored exactly that, so "Food" and "food" sat side by side in the MCP totals while the Costs tab already read both as one. A typed category in any case, or a common name like Hotel or Flight, is now stored as its fixed key on every path (REST, MCP, linked booking costs), the totals the MCP reads group by that key, and the tools name the real keys. The client reads categories through the same shared mapping. Any other text is still kept as given. The journal tools said that a private entry stays off the share link. It never did: the share link shows every entry that is not a draft, whatever its visibility, and the web editor has no visibility at all. The tools now say so and point to is_draft, which is what keeps an entry to the contributors. The wiki explains why the location button needs HTTPS and how to run TREK behind an HTTPS tunnel while still using it over plain HTTP at home, and that Android's photo picker drops a photo's location while Immich and Synology keep it.
@trek/shared
Single source of truth for TREK's API contracts, expressed as Zod schemas and consumed by both the server (request validation + inferred DTO types) and the client (typed requests/responses).
This package is part of the incremental NestJS + React 19 migration (see the "Brownfield Rewrite" board). It is intentionally dormant until modules start importing it — adding it changes nothing for users.
Rules
- One folder per domain:
src/<domain>/<domain>.schema.ts(+.spec.ts). - Domain-agnostic building blocks live in
src/common/. - A route is only considered migrated once its contract lives here.
- Schemas are the source of truth; server DTOs and client types are inferred from them
(
z.infer<typeof schema>), never hand-duplicated.
Consumption (dev)
Both apps resolve @trek/shared to this package's TypeScript source:
- Server (
tsx): viapathsinserver/tsconfig.json. - Client (
vite): viaresolve.aliasinclient/vite.config.ts(+pathsfor the type-checker).
Production packaging (Docker / workspace wiring) is introduced in card F2, when the server first depends on this package at runtime. Until then prod builds are untouched.
Not yet here
The canonical error envelope is finalised in card F5 (it must match TREK's current Express error responses byte-for-byte), so it is deliberately not invented in F1.