Replace the direct use of `conversations::Context` with `client::ChatClient`,
which is the intended public API for library consumers.
Remove `MessageEnvelope` and the username-keyed session model. The envelope
was never part of the wire protocol — sender identity was only tracked in the
CLI's local state. Chats are now keyed by conversation ID; add `/nickname` as
the user-facing replacement for named sessions.
Add a logos-delivery (Waku) transport alongside the existing file transport.
The active transport is selected at compile time: set `LOGOS_DELIVERY_LIB_DIR`
to link liblogosdelivery, otherwise the file transport is used.
Add logos-delivery as a Nix flake input and expose `.#logos-delivery` so the
library can be built with `nix build` and referenced by `LOGOS_DELIVERY_LIB_DIR`.
CI: rename `c-ffi-smoketest` to `smoketest`; add logos-delivery build step
and a `--smoketest` invocation of chat-cli to verify startup.
* chore: remove ffi from double ratchet
* chore: format
* feat: chat cli demo app via file transport
* chore: fix the compile issues
* chore: fix long intro copy to clipboard
* chore: move chat cli to bin folder
* chore: use tmp data folder
* chore: update doc
* chore: use encrypted db with default db pass
* chore: fmt and clippy
* chore: fix clippy and refactor
* chore: utils for helper funcs
* chore: rename sessions to chats
* feat: move private store out of context
* feat: move convo store to private v1
* feat: clean context
* chore: params postion
* chore: use git exclue for justfile
Implement a `client` crate that wraps the `libchat` context behind a
simple `ChatClient<D>` API. The delivery strategy is pluggable via a
`DeliveryService` trait, with two implementations provided:
- `InProcessDelivery` — shared `MessageBus` for single-process tests
- `CDelivery` — C function-pointer callback for the FFI layer
Add a `client-ffi` crate that exposes the client as a C API via
`safer-ffi`. A `generate-headers` binary produces the companion C
header.
Include two runnable examples:
- `examples/in-process` — Alice/Bob exchange using in-process delivery
- `examples/c-ffi` — same exchange written entirely in C; smoketested
under valgrind (to catch memory leaks) in CI
iterates: #71
Add nim-bindings/tests/test_all_endpoints.nim which imports bindings
directly and calls every FFI proc, forcing the linker to include all
symbols. This catches link-time and runtime issues that the pingpong
example missed because unused symbols were optimised out.
Running the new test revealed an ABI mismatch in installation_name:
the Rust function used an explicit out-parameter but ReprCString has
only flat fields, so Nim emits it as a C return value.
CI now runs nimble test next to nimble pingpong.
* chore(nim-bindings): replace dynlib dlopen with plain importc
The dynlib pragma hard-coded a library path and resolved it via dlopen() at
runtime, preventing static linking and forcing a specific load-time path.
Using bare {.importc.} lets consumers choose: link liblibchat dynamically
at link time (--passL:-llibchat) or link it statically into their binary.
* Rust -> Nim ABI (#62)
* Use correct build hook
* force sret like return from rust code for nim compatibility
* Fix target mismatch
* Update usages
* ci: add nim-bindings-test
* fix(nim-bindings): fix ABI mismatch in destroy_* FFI functions and add defer-based cleanup
Nim's C backend silently transforms large struct parameters (>16 bytes) into
pointer parameters when calling importc functions. The destroy_* functions were
declared taking T by value in Rust, but Nim always passed &T — causing Rust to
read garbage from the stack on x86-64 (SIGILL on CI) while accidentally working
on ARM64 macOS due to that ABI coincidentally also using pointers for large structs.
Fix by changing all destroy_* functions to take &mut T and using drop_in_place,
which is the correct idiom for dropping a value through a pointer.
On the Nim side, replace scattered manual destroy calls with defer, which
guarantees cleanup on all exit paths and prevents use-after-destroy bugs.
---------
Co-authored-by: Jazz Turner-Baggs <473256+jazzz@users.noreply.github.com>
* Add Identity name
* Update Context to accept a name
* Change constructor in bindings
* Add name retrieval to bindings
* Update constructor string type
* Remove uneeded files
* rename functions for symmetry
* base ci add
* Remove .DS_Store files
* Add .DS_Store to gitignore
* remove master & develop, kept only stable in matrix
Restrict CI workflow to only the main branch for pushes and pull requests.
* Update .github/workflows/ci.yml
Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>
* Update .github/workflows/ci.yml
Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>
---------
Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>