Commit Graph
6 Commits
Author SHA1 Message Date
clawbot 407eaf847a Stop the chat client only after the API has stopped (closes #4)
check / check (push) Successful in 1m14s
The chat client's context no longer follows the bot's, so a stop no
longer sends it SIGTERM while the API is still finishing its requests.
The deferred stop in Run, which runs after the API's, stops it instead,
so a request in progress at a stop gets its answer rather than a 500.
The README says so.

The new test runs the whole bot with the test binary itself standing in
for simplex-chat on PATH. The stand-in holds its answer to the contacts
request until the test has told the bot to stop.

Model: opus-5-5
2026-09-29 01:36:44 +00:00
clawbot b965e45454 Send Permissions-Policy on every API response (closes #4)
check / check (push) Successful in 1m8s
docs/REPO_POLICIES.md requires a Permissions-Policy header restricting
the browser features an application does not use. The API now denies
the camera, microphone and location on every response, TestHeaders
checks it, and the README's Design section names it.

Model: opus-5-5
2026-09-29 00:59:42 +00:00
clawbot 17d6be9fe1 HTTP API: server, credential and the list of chats (closes #4)
check / check (push) Successful in 1m1s
The bot now serves an HTTP API on PORT (default 8080) beside the chat
client. Every request needs the credential read at startup from the
file named by API_TOKEN_FILE, sent as a bearer token; without one,
every request is refused. Responses carry the security headers, bodies
are capped at 64 KiB and each request's work at 10 seconds.

GET /api/v1/chats lists the bot's contacts from the chat client's
/_contacts command, ordered by id, and marks the contacts who deleted
their chat with the bot, which the chat client keeps listing. bot.Run
starts the API after set-up and stops it within 5 seconds; a listener
failure ends the bot as a chat client failure does.

Model: opus-5-5
2026-09-29 00:37:57 +00:00
clawbot 09a5caa8ab Move the command tree into internal/cli (closes #8)
check / check (push) Successful in 1m40s
`cmd/simplexcalc/` now holds only `main.go`, whose body is one call, `os.Exit(cli.Main(version))`, as the Go style guide requires. The command tree and the `run` and `version` commands moved unchanged into `internal/cli`, with tests for `version` and for an unknown command. Output streams, exit statuses and the `-X main.version` build flag are as before.

Disclosure: the comment in `execute` saying cobra has already printed the error is false, since the root command silences cobra's errors; it moved unchanged and is left for a follow-up.

Model: opus-5-5
2026-09-29 01:51:34 +02:00
clawbot 16649e0f2f A SimpleX Chat bot that answers arithmetic (closes #1)
check / check (push) Successful in 54s
Remove the template's HTTP service, database and fx wiring. Add exact
arithmetic on go/parser and go/constant, a client that runs simplex-chat
as a child process and drives its WebSocket API, and the bot, which keeps
an auto-accepting address and replies to each message. The image adds the
checksum-pinned simplex-chat v7.0.2 on Ubuntu 22.04.

Model: opus-5-5
2026-09-26 22:01:51 +00:00
clawbot f8ce8cef83 Seed from go-template-repo, renamed to simplexcalc
The template's files at a77fd30, without its history or LICENSE, after
script/rename simplexcalc.

Model: opus-5-5
2026-09-26 21:38:57 +00:00