Download this file
| 1 | // Package bot is the Go bot sidecar (docs/bots.md § Direction: a Go sidecar) — |
| 2 | // a headless lchat member, being ported from agent/ so bots need no Node |
| 3 | // runtime. It runs as its own process, never inside the server: the session |
| 4 | // file below holds a private key that decrypts the bot's threads, and the |
| 5 | // server must never be able to read it (CLAUDE.md, the one rule). |
| 6 | package bot |
| 7 | |
| 8 | import "lchat/internal/client" |
| 9 | |
| 10 | // Session is the bot's identity: its device token and ECDH keypair. It now |
| 11 | // lives in internal/client (the shared E2EE member client layer — the eleven |
| 12 | // CLI reads and writes the same file shape); the alias keeps every bot call |
| 13 | // site and the Node-compat contract (agent/config.mjs's session.json) intact. |
| 14 | type Session = client.Session |
| 15 | |
| 16 | // LoadSession reads a session file. A missing file returns (nil, nil) — "not |
| 17 | // provisioned yet" is a normal state, not an error. |
| 18 | func LoadSession(path string) (*Session, error) { return client.LoadSession(path) } |
| 19 | |