Commit Graph
75 Commits
Author SHA1 Message Date
Jazz Turner-Baggs 56f48c6a38 remove type alias for ProtocolParams 2026-04-29 08:11:25 -07:00
Jazz Turner-Baggs fbb64408d1 Hashlen update 2026-04-29 07:18:14 -07:00
Jazz Turner-Baggs ea06cf5186 Doc Integration tests 2026-04-28 16:40:18 -07:00
Jazz Turner-Baggs 7ceb15b763 reduce visibility 2026-04-28 16:39:51 -07:00
Jazz Turner-Baggs 78b085895c Update doc comments 2026-04-28 15:52:09 -07:00
Jazz Turner-Baggs 4675e121ae Add comments to GroupV1Convo 2026-04-28 15:05:57 -07:00
Jazz Turner-Baggs ef360ae130 Add InboxV2 comment 2026-04-28 14:22:40 -07:00
Jazz Turner-Baggs 0efbdeae6a Fix libchat import in chat-cli 2026-04-28 14:03:13 -07:00
Jazz Turner-Baggs e20b7983ed Avoid panic 2026-04-28 13:27:04 -07:00
Jazz Turner-Baggs 61129d30c0 Clean up warnings 2026-04-28 12:52:26 -07:00
Jazz Turner-Baggs 3fdddfb233 Update todo 2026-04-28 10:02:45 -07:00
Jazz Turner-Baggs 06690ac2a6 Update comments 2026-04-28 10:00:25 -07:00
Jazz Turner-Baggs 4737ae0f06 Appease clippy 2026-04-28 09:50:23 -07:00
Jazz Turner-Baggs 94a2904c0e Warning fixups 2026-04-28 08:30:41 -07:00
Jazz Turner-Baggs da7e06e495 Wrap constructor in result 2026-04-28 08:30:41 -07:00
Jazz Turner-Baggs 60e728576a Remove duplicate test_utils 2026-04-28 08:30:41 -07:00
Jazz Turner-Baggs d8e15dc8d6 Remove ClientCtx 2026-04-28 08:21:31 -07:00
Jazz Turner-Baggs 3bf8ecb904 Update Accounts + service_traits 2026-04-28 08:17:05 -07:00
Jazz Turner-Baggs def297f132 tidy 2026-04-28 08:13:13 -07:00
Jazz Turner-Baggs 246ab8dcf9 undo import fixes 2026-04-28 08:13:13 -07:00
Jazz Turner-Baggs d988ecad55 Remove deadcode 2026-04-28 08:13:13 -07:00
Jazz Turner-Baggs aa380adb37 Re-use components in integration tests 2026-04-28 08:13:13 -07:00
Jazz Turner-Baggs d9904ad3b0 Remove dead test 2026-04-28 08:13:13 -07:00
Jazz Turner-Baggs 1d1a3a170e Clean warnings 2026-04-28 08:13:13 -07:00
Jazz Turner-Baggs af3ff3c6a2 Add GroupV1 2026-04-28 08:13:12 -07:00
Jazz Turner-Baggsandosmaczko 39bf267564 Add Account Struct (#94)
* Add Account Struct

* Quell Warnings

* Update core/conversations/src/account.rs

Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>

* Add clarity to todo

* Update test account constructor docs

* Add removal todo

* Resolve cargo.lock conflict

* remove warnings

---------

Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>
2026-04-28 07:47:57 -07:00
Jazz Turner-Baggs 25debdc051 Add Signature + Verifying key types (#93) 2026-04-27 13:35:20 -07:00
osmaczko eaeffcd21f feat(chat-cli): wire up logos-delivery transport and switch to client API (#91)
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.
2026-04-27 13:22:16 +02:00
Pablo Lopez df84fc87cf feat: add flake (#85)
* feat: add flake

* fix: pr feedback

* fix: removing dylib for libchat

not used and it was causing the error with panic abort
2026-04-17 16:27:15 +03:00
kaichao 6c7b3a4252 feat: chat cli demo app (#87)
* 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
2026-04-17 14:43:04 +08:00
kaichao 94935c28fe refactor: remove FFI interfaces from double ratchets (#84)
* chore: remove ffi from double ratchet

* chore: update doc

* chore: format
2026-04-16 23:26:19 +08:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> c0e07c765e Build(deps): bump rand from 0.8.5 to 0.9.3 (#86)
Bumps [rand](https://github.com/rust-random/rand) from 0.8.5 to 0.9.3.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/0.9.3/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.9.3)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.9.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-16 07:50:16 -07:00
kaichao 9cc73622ed Move double ratchet storage operations to PrivateV1 (#82)
* 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
2026-04-10 08:33:58 +08:00
osmaczko d68c0cb275 feat: implement Client crate and C FFI bindings (#73)
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
2026-04-08 23:15:48 +02:00
kaichao 8e8b0c0dd7 Use inbox to handle save and load ephemeral key from store (#81)
* feat: move inbox store out from context

* chore: clear boundary between context and inbox to store dependencies
2026-04-08 11:07:23 +08:00
kaichao c44c52b127 feat: storage implementation and trait abstraction (#79)
* feat: storage for conversations

* fix: db types conversion

* feat: run migrations from sql files

* feat: persist identity

* fix: revert double ratchet storage refactor

* fix: clean

* refactor: use result wrapper for ffi

* refactor: uniform storage error into chat error

* fix: zeroize identity record

* fix: zeroize for secret keys in db operations

* fix: transactional sql migration

* fix: remove destroy_string

* feat: db storage for inbox ephermeral keys

* chore: remove in memory hashmap for ephemeral keys

* feat: persist conversation store

* feat: wire with the double ratchet storage

* feat: remove conversation store

* chore: fix conversation type not used

* feat: mock chat store implementation

* chore: sqlite module

* feat: sqlite crate

* chore: sqlite rename

* chore: more refactor

* extract ratchet store trait

* chore: clear error conversion

* chore: remove customized db conn

* chore: fix clippy

* chore: refactor to use generics and enum

* chore: further clean for review comments
2026-04-03 08:25:26 +08:00
Jazz Turner-Baggs d905de3592 Remove Legacy FFI from LibChat (#80)
* Remove libchat legacy FFI

* Remove legacy nim bindings

* Remove stray headerfile

* Remove deprecated CI jobs
2026-04-01 12:54:27 -07:00
kaichao 8cddd9ddcf refactor: use new styling for conversations crate without mod.rs (#72)
* refactor: use new styling for conversations crate without mod.rs

* refactor: remove put crate for identity types
2026-03-27 10:23:33 +08:00
Jazz Turner-Baggs 9a94f9a6d6 Flatten Repos (#70)
* move to “crates” style folder

* Update workspace

* clear crate names

* Rename crate folders based on feedback

* Use workspace dependencies instead of paths

* Move updated files from core
2026-03-24 18:21:00 -07:00
kaichao daeecbd679 Persist identity (#67)
* feat: storage for conversations

* fix: db types conversion

* feat: run migrations from sql files

* feat: persist identity

* fix: revert double ratchet storage refactor

* fix: clean

* refactor: use result wrapper for ffi

* refactor: uniform storage error into chat error

* fix: zeroize identity record

* fix: zeroize for secret keys in db operations

* fix: transactional sql migration

* fix: remove destroy_string

* refactor: inline identity record name clone
2026-03-25 08:45:22 +08:00
osmaczko d006f20bce fix(nim-bindings): add all-endpoints test and fix installation_name ABI (#66)
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.
2026-02-28 21:03:55 +01:00
Jazz Turner-Baggs 1158865bf2 feat: ListConversations (#60)
* Add function to get available conversations_ids

* Update bindings

* linter fix

* remove dynlib reference

* destructor fix
2026-02-28 03:16:10 -08:00
osmaczkoandJazz Turner-Baggs fa79b1c79c chore(nim-bindings): replace dynlib dlopen with plain importc (#61)
* 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>
2026-02-25 20:09:55 +01:00
Jazz Turner-Baggs 960bb195a1 Update crate name (#59) 2026-02-22 08:24:10 +02:00
Jazz Turner-Baggs eb941387df Add Installation name (#58)
* 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
2026-02-19 17:25:42 -08:00
osmaczko a9ca4ffb7d chore: expose isNewConvo property (#57) 2026-02-18 20:01:47 +01:00
Jazz Turner-Baggs 95ddce9161 Key types (#56)
* Add generic SymmetricKey container

* Rename SecretKey to SymmetricKey32

* Update SymmetricKey usage

* Add PublicKey

* Update PublicKey uses

* Add PrivateKey

* Replace StaticSecret with PrivateKey

* Fix imports

* Remove InstallKey from constructors

* Final integration

* lint fixes

* Fixups
2026-02-18 09:29:33 -08:00
Jazz Turner-Baggsandosmaczko 3b69f946fd PrivateV1 Convo Ids (#54)
* Add conversation_ids for privateV1

* Skip handling of unknown payloads

* Tag initial ContentData as new

* Add Integration test

* truncate convo_id to size

* Clippy fixes

* cleanup

* Apply suggestion from @osmaczko

Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>

* Apply suggestion from @osmaczko

Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>

* Linter fixes

---------

Co-authored-by: osmaczko <33099791+osmaczko@users.noreply.github.com>
2026-02-11 14:10:21 -08:00
osmaczko 57fe656728 feat: update introduction bundle encoding (#43)
closes: #27
2026-02-11 19:51:22 +01:00
Patryk Osmaczko cd737ea058 fix: make ci checks pass 2026-02-10 19:45:00 +01:00