atagen

macltok

public
Star0
Watch0
96fdf90aacd6dc2b8bd3d63773234245b389d28c
3
ssh://brewery@pls.lobotomise.me:33/atagen/macltok.git

Blame: README.md

96fdf90aacd6atagen2026-09-08 08:24 UTC1
# macltok
96fdf90aacd6atagen2026-09-08 08:24 UTC2
96fdf90aacd6atagen2026-09-08 08:24 UTC3
`macltok` is a compact Rust application backend built above `matrix-sdk` and
96fdf90aacd6atagen2026-09-08 08:24 UTC4
`matrix-sdk-ui`. It aims to provide the stateful behavior needed by a useful
96fdf90aacd6atagen2026-09-08 08:24 UTC5
Matrix client without depending on a GUI toolkit or inventing another protocol
96fdf90aacd6atagen2026-09-08 08:24 UTC6
SDK.
96fdf90aacd6atagen2026-09-08 08:24 UTC7
96fdf90aacd6atagen2026-09-08 08:24 UTC8
The crate currently provides
96fdf90aacd6atagen2026-09-08 08:24 UTC9
96fdf90aacd6atagen2026-09-08 08:24 UTC10
- typed commands, owned UI-safe events and bounded per-client transport
96fdf90aacd6atagen2026-09-08 08:24 UTC11
- Sliding Sync with normalized connection and room-list state
96fdf90aacd6atagen2026-09-08 08:24 UTC12
- independently retained live room timelines and backwards pagination
96fdf90aacd6atagen2026-09-08 08:24 UTC13
- text, emote, reply, edit, redaction, reaction, receipt and typing operations
96fdf90aacd6atagen2026-09-08 08:24 UTC14
- raw encrypted or unencrypted media acquisition with configurable byte limits
96fdf90aacd6atagen2026-09-08 08:24 UTC15
- encryption state, recovery-key import and SAS verification
96fdf90aacd6atagen2026-09-08 08:24 UTC16
- password login and session restoration with caller-owned encrypted SQLite stores
96fdf90aacd6atagen2026-09-08 08:24 UTC17
96fdf90aacd6atagen2026-09-08 08:24 UTC18
Matrix room, event, user, device and transaction identifiers remain strongly
96fdf90aacd6atagen2026-09-08 08:24 UTC19
typed. A toolkit timeline identity covers local echoes without pretending they
96fdf90aacd6atagen2026-09-08 08:24 UTC20
already have remote event IDs.
96fdf90aacd6atagen2026-09-08 08:24 UTC21
96fdf90aacd6atagen2026-09-08 08:24 UTC22
## Consuming the engine
96fdf90aacd6atagen2026-09-08 08:24 UTC23
96fdf90aacd6atagen2026-09-08 08:24 UTC24
Run `Engine::run` and drain its single `EventStream` independently of command
96fdf90aacd6atagen2026-09-08 08:24 UTC25
submission. `ClientHandle::send` returns an enqueue ID; match that ID against
96fdf90aacd6atagen2026-09-08 08:24 UTC26
`CommandSucceeded`, `CommandSucceededWithRoom`, or `CommandFailed` before
96fdf90aacd6atagen2026-09-08 08:24 UTC27
reporting completion. A successful message command only enters the SDK send
96fdf90aacd6atagen2026-09-08 08:24 UTC28
queue; the timeline item's send state reports subsequent network delivery.
96fdf90aacd6atagen2026-09-08 08:24 UTC29
96fdf90aacd6atagen2026-09-08 08:24 UTC30
Start a timeline from `TimelineReset`, then apply `TimelineChanged` diffs with
96fdf90aacd6atagen2026-09-08 08:24 UTC31
`TimelineDiff::try_apply`. If a diff does not match the current snapshot, stop
96fdf90aacd6atagen2026-09-08 08:24 UTC32
applying diffs for that timeline and send `TimelineCommand::Resync`. Resume only
96fdf90aacd6atagen2026-09-08 08:24 UTC33
after its fresh `TimelineReset`; the reset precedes the command completion.
96fdf90aacd6atagen2026-09-08 08:24 UTC34
96fdf90aacd6atagen2026-09-08 08:24 UTC35
With `sqlite`, persist the initial `Session::record()` separately from its
96fdf90aacd6atagen2026-09-08 08:24 UTC36
encrypted SQLite store. On `SessionTokensChanged`, obtain a new record from
96fdf90aacd6atagen2026-09-08 08:24 UTC37
`ClientHandle::session_record()` and replace the saved record atomically in
96fdf90aacd6atagen2026-09-08 08:24 UTC38
protected storage. Restore with the same store path and passphrase. Delete the
96fdf90aacd6atagen2026-09-08 08:24 UTC39
saved credentials after `LoggedOut` or `SessionAccessRejected`, but keep them
96fdf90aacd6atagen2026-09-08 08:24 UTC40
after `Stopped` so a restart can restore the session. The headless example is
96fdf90aacd6atagen2026-09-08 08:24 UTC41
login-only; it does not persist sessions across runs.
96fdf90aacd6atagen2026-09-08 08:24 UTC42
96fdf90aacd6atagen2026-09-08 08:24 UTC43
## Dependency policy
96fdf90aacd6atagen2026-09-08 08:24 UTC44
96fdf90aacd6atagen2026-09-08 08:24 UTC45
UI frameworks, image decoders, application-directory discovery and logging
96fdf90aacd6atagen2026-09-08 08:24 UTC46
subscribers do not belong in this crate. SQLite remains optional through the
96fdf90aacd6atagen2026-09-08 08:24 UTC47
`sqlite` and `bundled-sqlite` features. Media decoding belongs to the consumer.
96fdf90aacd6atagen2026-09-08 08:24 UTC48
96fdf90aacd6atagen2026-09-08 08:24 UTC49
## Verification
96fdf90aacd6atagen2026-09-08 08:24 UTC50
96fdf90aacd6atagen2026-09-08 08:24 UTC51
```sh
96fdf90aacd6atagen2026-09-08 08:24 UTC52
nix develop --command cargo fmt -- --check
96fdf90aacd6atagen2026-09-08 08:24 UTC53
nix develop --command cargo test --all-targets
96fdf90aacd6atagen2026-09-08 08:24 UTC54
nix develop --command cargo test --all-targets --features sqlite
96fdf90aacd6atagen2026-09-08 08:24 UTC55
nix develop --command cargo clippy --all-targets -- -D warnings
96fdf90aacd6atagen2026-09-08 08:24 UTC56
nix develop --command cargo clippy --all-targets --features sqlite -- -D warnings
96fdf90aacd6atagen2026-09-08 08:24 UTC57
nix flake check
96fdf90aacd6atagen2026-09-08 08:24 UTC58
```