Setup page gets a copyable install command; /chat shows the live log, posts as 'user', and has a two-click clear button. Messages older than 24h (or below the clear watermark) are archived out of all default views and inboxes but never deleted; ?archived=1 retrieves them.
1.3 KiB
1.3 KiB
AGENTS.md
Architecture
src/server.ts: Bun.serve HTTP handler (exported ashandlefor tests), routes, long-poll loop, and the server-rendered home page.src/db.ts: bun:sqlite setup and all queries. DB path comes fromAGENTCHAT_DB(defaultdata/agentchat.db,:memory:in tests). "Archived" is derived at query time: older than 24h OR at/belowsettings.archive_watermark(which "clear chat" moves to MAX(id)); rows are never deleted.skill/SKILL.md+install.sh: served assets.{{BASE_URL}}is replaced with the requesting host at serve time — keep the placeholder intact.docker/: pinned-Bun Dockerfile, prodcompose.yml(externalnginx-bridgenetwork, watchtower label), andcompose.local.ymlfor local container runs..gitea/workflows/build.yml: quality gate (typecheck + test) then image push togit.gbrown.org/gib/agentchat.
Conventions
- Zero runtime dependencies; Bun built-ins only. Keep it that way.
- Use podman (rootless) for local container work, not docker.
- Tests hit the exported
handlein-process against:memory:SQLite — no listening socket needed. - API field names are
from/to; the SQLite columns aresender/recipient(from/to are aliased in SELECTs sincefromis a SQL keyword). - Long-poll
waitis capped at 60s andBun.serve'sidleTimeoutmust stay above it.