| … | … | @@ -0,0 +1,64 @@ |
| 1 | # keet-tui |
| 2 | |
| 3 | A terminal UI for Keet P2P chat. MVU architecture on `bare-tty`. |
| 4 | |
| 5 | It holds no P2P state of its own — [`keet-daemon`](../keet-daemon) does the chat, and this |
| 6 | renders it and sends keystrokes back. |
| 7 | |
| 8 | ## Requires a running keet-daemon |
| 9 | |
| 10 | ```sh |
| 11 | keet-tui # connects to 127.0.0.1:3117 |
| 12 | keet-tui --port 3200 # or --port=3200 |
| 13 | ``` |
| 14 | |
| 15 | Nothing works without the daemon: the splash screen stays up and the status bar reports the |
| 16 | connection error. |
| 17 | |
| 18 | ## Layout |
| 19 | |
| 20 | ``` |
| 21 | ┌─ rooms ──┬─ chat ─────────────────────┬─ members ─┐ |
| 22 | │ │ │ │ |
| 23 | │ │ │ │ |
| 24 | ├──────────┴────────────────────────────┴───────────┤ |
| 25 | │ input │ |
| 26 | ├───────────────────────────────────────────────────┤ |
| 27 | │ status │ |
| 28 | └───────────────────────────────────────────────────┘ |
| 29 | ``` |
| 30 | |
| 31 | `?` opens help, which lists the current keys — that view is the authority, not this file. |
| 32 | Navigation is arrows or `j`/`k`, with `home`/`end`/`pageup`/`pagedown` in the scrollback. |
| 33 | |
| 34 | ## Architecture |
| 35 | |
| 36 | Model–View–Update. One `model` object holds all state; events (`connected`, `key`, `resize`, |
| 37 | `rooms-updated`, `messages-updated`, `members-updated`, `connection-error`) produce a new model, |
| 38 | and the views are pure functions of it. |
| 39 | |
| 40 | ``` |
| 41 | lib/program.js the MVU loop, on bare-tty |
| 42 | lib/client.js the keet-daemon connection |
| 43 | lib/screen.js framebuffer + diffing |
| 44 | lib/style.js colours |
| 45 | lib/views/ splash, main, help |
| 46 | lib/components/ room-list, chat-view, member-list, input-box, status-bar |
| 47 | ``` |
| 48 | |
| 49 | Zero runtime dependencies. |
| 50 | |
| 51 | ## Scripts |
| 52 | |
| 53 | - `keet-bot.sh [roomId]` — poll for new messages and write an alert file, so an agent can read |
| 54 | the inbox and reply |
| 55 | - `keet-watch.sh` |
| 56 | |
| 57 | ## Note |
| 58 | |
| 59 | Argument parsing reads `Pear.config.args`, which is on its way out — the app will need a plain |
| 60 | `argv` read when `pear run` goes. |
| 61 | |
| 62 | ## License |
| 63 | |
| 64 | Not yet declared. |