2025-09-06 19:52:37 -07:00
|
|
|
|
# Kordophone Core (Rust Workspace)
|
|
|
|
|
|
|
|
|
|
|
|
This directory contains the shared Rust code and tools used by Kordophone clients.
|
|
|
|
|
|
|
|
|
|
|
|
Workspace members:
|
|
|
|
|
|
|
|
|
|
|
|
- `kordophone/` — Rust client library for the Kordophone HTTP/WebSocket API. Cross‑platform.
|
|
|
|
|
|
- `kordophone-db/` — Lightweight cache/database and models built with Diesel (SQLite).
|
|
|
|
|
|
- `kordophoned/` — Client daemon providing local caching and IPC
|
|
|
|
|
|
- Linux: D‑Bus
|
|
|
|
|
|
- macOS: XPC (see notes below)
|
|
|
|
|
|
- `kpcli/` — Command‑line interface for interacting with the API, DB, and daemon.
|
2025-12-14 17:50:37 -08:00
|
|
|
|
- `kptui/` — Terminal UI client (Ratatui) for reading and replying to chats via the daemon.
|
2025-09-06 19:52:37 -07:00
|
|
|
|
- `utilities/` — Small helper tools (e.g., testing utilities).
|
|
|
|
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cd core
|
|
|
|
|
|
cargo build # build all workspace members
|
|
|
|
|
|
cargo test -p kordophone
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Build a specific crate:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cargo build -p kordophone
|
|
|
|
|
|
cargo build -p kordophoned --release
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## `kordophoned` (Client Daemon)
|
|
|
|
|
|
|
|
|
|
|
|
The daemon maintains a local cache, handles update cycles, and exposes IPC for GUI apps.
|
|
|
|
|
|
|
|
|
|
|
|
- Linux: exposes a D‑Bus service (see service file in `kordophoned/include`).
|
|
|
|
|
|
- macOS: exposes an XPC service named `net.buzzert.kordophonecd`.
|
|
|
|
|
|
|
|
|
|
|
|
macOS XPC registration (manual during development):
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cd core/kordophoned
|
|
|
|
|
|
launchctl load include/net.buzzert.kordophonecd.plist
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
The macOS GUI app (`osx/`) can programmatically register this during launch; see `osx/README.md`.
|
|
|
|
|
|
|
|
|
|
|
|
### Packaging (RPM example)
|
|
|
|
|
|
|
|
|
|
|
|
`kordophoned` is configured for RPM packaging via `cargo-generate-rpm`.
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cargo build --release
|
|
|
|
|
|
strip -s target/release/kordophoned
|
|
|
|
|
|
cargo generate-rpm
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## `kpcli` (CLI)
|
|
|
|
|
|
|
|
|
|
|
|
Useful for quick testing and interacting with the daemon/cache.
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cargo run -p kpcli -- --help
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
|
|
|
|
|
|
- TLS/WebSocket: the `kordophone` crate includes `rustls` and installs a crypto provider at process start.
|
|
|
|
|
|
- DB: `kordophone-db` includes Diesel migrations under `kordophone-db/migrations/`.
|