Commit Graph
5 Commits
Author SHA1 Message Date
claude bfb10b9ab2 feat: token-authenticated approval API + structured webhook payload
Adds POST /api/actions/:id/approve and /reject so a notifier (desktop
popup, chat bot, phone) can resolve an action without driving the web UI
or holding a login session.

Auth is the per-action approve_token already minted at submit time: a
UUIDv4 scoped to exactly one action and delivered only in the approval
notification. The agent API key is deliberately NOT accepted on these
routes -- the agent submits actions, so letting it approve them would
defeat the human-in-the-loop guarantee. The token may be supplied in the
JSON body or as ?token=, matching the existing approve link.

Both endpoints return 401 for an unknown id/token and 409 (with the
current status) if the action is no longer pending, so a notifier can
tell "someone else already handled this" from "this failed".

The notification webhook gains a structured "action" object alongside the
existing "text" field, which is unchanged so current consumers keep
working. Previously the id, command and approve URL were only available
by regexing the human-readable blob.

Also collapses three copies of the actions SELECT and its row mapping
onto ACTION_COLUMNS/row_to_action, and extracts the execute and
reject-chain logic into helpers now shared by the web and API handlers.
Those helpers no longer .unwrap() DB errors while holding the connection
mutex, which would poison it for the life of the process.
2026-08-13 03:03:19 -07:00
pi-bot-01 a0a9a1024d feat: add /health endpoint for monitoring and reverse proxy checks
Returns {"ok":true,"status":"live"} with HTTP 200 when the service
is running and the database is accessible. Returns HTTP 503 if the
database check fails. No authentication required.
2026-03-21 14:04:22 -07:00
clawbot ab52ede69a style: apply cargo fmt to all source files 2026-03-09 20:42:18 -07:00
clawbot 06ae7c0a66 fix: remove unused Response import in routes.rs
Action Gateway CI/CD / Build & Test (push) Has been cancelled
Action Gateway CI/CD / Publish Release (push) Has been cancelled
2026-03-09 02:44:30 -07:00
clawbot ffddbc2e5e feat: initial source commit 2026-03-08 23:33:41 -07:00