← TRON examples

Agent-facing export

GET /api/notes/exportreturns the whole table. Ask for it withAccept: application/tronand the payload becomes self-describing TRON — declarations first, then positional rows — which an LLM tool or any third party can read cold at a fraction of the tokens. The route also caches the encoded body per Accept variant for 60 s.

From the terminal

curl -s https://norns-demo.humansynthesis.ai/api/notes/export | head -c 300
curl -s -H 'Accept: application/tron' https://norns-demo.humansynthesis.ai/api/notes/export | head -20
curl -sI -H 'Accept: application/tron' https://norns-demo.humansynthesis.ai/api/notes/export | grep -iE 'etag|cache'
  • The TRON body starts withclass C0: id,title,body,created_at,updated_atandtable C0: $— enough for a reader that has never seen the contract.
  • JSON and TRON are separate cache entries (Vary: accept); a second fetch within a minute answersx-norns-cache: hiton a deployed Worker (locally the proxy's Cache API is a no-op), andIf-None-Matchgets a 304 anywhere.
  • Token counts here are a chars ÷ 4 estimate; the measured range on tabular data is 26–61% fewer.
norns-ui v0.0.17 · early access