AI agent
monsa
A budget agent in the terminal. Ask whether a purchase fits the month and it answers with the real numbers, judges what you are buying, and records it only after you say yes. The arithmetic runs in code; the model gives the opinion.
How it runs
Trigger
Ask in plain words
Ink terminal UI
You type something like “can I buy headphones for 120?”. On the first run monsa asks for your name, monthly budget and currency once, and keeps them in a local config file.
Tool
Compute the numbers in code
TypeScript briefing
Before the model sees the question, code works out what is spent, what is left, the days remaining, and two daily rates: how fast you are spending and how fast you still can. A model never has to divide money itself.
AI model
Judge the purchase
Claude Haiku + AI SDK
The agent weighs what the thing is against those numbers. There is no fixed reserve: medicine is judged differently from shoes, and when a word like “laptop” could go either way, it asks what it is for.
Tool
Propose, never save
recordPurchase tool
The tool the model calls only raises a proposal. Its description tells the model that nothing is stored yet, so the agent gives its view first and then hands the decision back.
Tool
You decide
y/n prompt
monsa asks “Save shoes, 800 MAD? (y/n)”. Only y saves it; anything else, including an unclear answer, counts as no, and the agent does not argue once you have answered.
Data store
Write it to the month's ledger
Local JSON, one file a month
Confirmed purchases are saved with the date and a short label, and you can ask to remove one. monsa never converts currencies; it refuses to record into a month kept in another currency.
The whole run
Six steps, from Ink terminal UI to Local JSON, one file a month, drawn end to end.