Wiring Desk — AI Web

Wire the village farm office's AI helper: key on the server, streaming, Stop, zod, tools, Ollama. 16 levels, right in the browser.

What the levels ask

  1. Sukamaju's farm office has been given one AI model, and Ms. Ayu builds Tanya Tandur: a chat that answers farmers. Mr. Tono tries it from his phone at the front desk. Fill the hole in hp/app.js with the function from hp/tanya.js that takes the question to the model without the API key reaching the phone.
  2. Mr. Karim introduces himself first, then asks when he should spray. Tandur has to remember who is asking and where his field is. Fill the two holes in hp/app.js: the messages sent to the server, and the role Tandur's answer is saved under in the history.
  3. Grandpa Sastro asks why his rice leaves are turning yellow. If nothing shows within a second and a half, he decides the phone is broken and goes home, and Tandur's answer is long. Fill the hole in the route kantor/tanya.js and the way the phone reads it in hp/app.js, so the words appear as they are written.
  4. Grandma Marni asks about soaking seed, and Tandur greets her in Javanese: Sugeng énjing. This time the phone reads the body itself with getReader(). The network cuts a chunk right in the middle of the letter é. Fill the hole in hp/app.js that turns each chunk of bytes into text.
  5. The farm office's server now sends the AI SDK's UI message stream: lines of data: {...} in SSE format. Mrs. Lastri's phone reads it itself. The network cuts the body in the middle of a line. Fill the two holes in hp/app.js: how the text is cut into lines, and which part is added to the bubble.
  6. Bagas asks for a long explanation of how to make compost, reads for a moment, then taps Stop. Tandur has to stop, on the phone and at Awan: tokens generated after Stop are still billed to the farm office's budget. Fill the hole in hp/app.js and the one in kantor/tanya.js.
  7. Mrs. Yanti taps Send, no answer yet, so she taps it again. When the answer comes she asks a second thing. One question must make one request, and the second question must still be sendable. Fill the two holes in hp/app.js.
  8. Ms. Ayu makes a pest report form that Tandur fills in from a farmer's own words. Mr. Tono writes: planthoppers, about half a hectare, since Tuesday. The form on the phone needs the area as a number. Fill the luasHa hole in the schema in kantor/laporan.js.
  9. Tandur now has a tool: cekStok reads the farm shop's stock book that Ms. Ayu updates every morning. Mr. Harun asks whether there is still urea. The tool gets called, but Mr. Harun must get his answer in a sentence. Fill the hole in streamText in kantor/tanya.js.
  10. Mrs. Ijah asks whether it will rain next week. The district weather station's data has not come in since morning, and the model keeps calling cekCuaca for another date. Every round is a paid request. Fill the stopWhen hole in kantor/tanya.js so the loop stops and Mrs. Ijah still gets a reply.
  11. At seven every village asks at once, and a busy Awan answers 429 with a retry-after header that the farm office's server passes on. Mrs. Sari must still get the price of grain; Rara's whole leaflet is refused with 400. Fill the two holes in hp/app.js: which statuses are tried again, and how long to wait.
  12. The agriculture service wants the farm office to record every villager's token use so the monthly bill can be checked. The farm office's meter must match Awan's bill exactly. The neighbourhood head asks about jajar legowo planting. Fill the hole in kantor/model.js and the one in kantor/tanya.js.

And more, 16 levels in all.