Files
simplexcalc/docs/TODO.md
T
clawbot f53b666119
check / check (push) Successful in 1m5s
HTTP API: a chat's recent messages, and sending a message (closes #5)
`GET /api/v1/chats/{id}/messages?count=N` returns a chat's recent messages, oldest first (`count` 1 to 100, default 20), and `POST` to the same path sends a text message and returns it once the chat client has taken it. Both answer `404` for any id the chats list does not show, looked up in the same contact list. The message record is defined once, for the webhooks to reuse.

Disclosures: items are read five at a time, because one item can be many times its text and 100 at once could pass the 16 MiB read limit; text too long gets `413`, a contact who deleted the chat `409` (unverified for one still connecting); a query the server cannot read gets its own `400`.

Model: opus-5-5
2026-09-29 07:33:36 +02:00

50 lines
2.0 KiB
Markdown

# Workflow
- branch (from `main`)
- do the work in Next Step
- move Next Step to the top of Completed Steps
- move the top item of Future Steps into Next Step
- commit (`docs/TODO.md` changes in the same commit as the work)
- merge to `main` if the branch is not protected, otherwise open a PR
- push
# Status
pre-1.0. No git tags exist. `main` is a working bot: one container image
holding the bot and the SimpleX Chat command-line client v7.0.2, a bot
profile named `calc` with a long-term address that accepts every contact
request, and exact arithmetic replies (`+ - * /`, parentheses,
decimals). The Gitea issue tracker is the authoritative list of work;
this file mirrors it.
# Next Step
Adopt the canonical `.golangci.yml` from the `prompts` repository once
it replaces `gomodguard` with `gomodguard_v2`. golangci-lint v2.12.2
warns on every run that `gomodguard` is deprecated. The file is
maintained upstream and is not edited here; done when `make lint` runs
with no deprecation warning.
# Completed Steps
- 2026-09-29 `GET` and `POST /api/v1/chats/{id}/messages`: a chat's
latest messages, and sending one
- 2026-09-29 Added the HTTP API in `internal/api`: the server on `PORT`,
the bearer credential from `API_TOKEN_FILE`, security headers and
limits, and `GET /api/v1/chats`
- 2026-09-28 Powers (`^`, also written `**`) and remainders (`%`) in
`internal/calc`, which now reads expressions with a parser of its own
in place of `go/parser`
- 2026-09-28 Moved the command tree and the `run` and `version` commands
from `cmd/simplexcalc/` into `internal/cli`; `cmd/simplexcalc/main.go`
is now a single call to `cli.Main`
- 2026-09-26 Seeded from `go-template-repo` (renamed, its HTTP service
removed) and built the bot: `internal/calc` for the arithmetic,
`internal/simplex` for the chat client process and its WebSocket API,
`internal/bot` for address setup and replies, and a runtime image on
Ubuntu 22.04 carrying the checksum-verified `simplex-chat` binary
# Future Steps
none