Repository navigation
feat(client-ffi): uniffi 0.31 annotation pass — the one native binding source - #1675
Merged
Merged
Conversation
…-B fix) uniffi can't export ContinuumClient::new(Arc<airc_lib::Airc>, Uuid) — foreign callers can't construct an Arc<airc_lib::Airc>. connect(home, agent_name, socket, target_peer: String) -> Result<Arc<ContinuumClient>, FfiError> builds the airc handle internally (Airc::attach_as) + targets the peer; identity defaults to SessionIdentity::unknown() via new -> Connection::connect (handshake populates, never fabricated). In-process new() stays for Rust consumers (CLI/persona); connect() is the FFI entry. Both coexist (appropriate-entry-per-context). Validated: target_peer parsed first (cheap bad-id reject before touching the daemon) — connect_rejects_a_bad_target_peer_uuid. Next slice: the uniffi annotation pass over this surface. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…g source Annotate the 4-verb JSON-boundary facade (execute/subscribe/emit/provide + session/scoped/connect) with uniffi 0.31 proc-macros so it emits the single native binding the Swift/Kotlin SDKs wrap. This is outlier-B for the SDK interface: it proves uniffi binds the async + callback-interface + opaque-object + Self-returning facade cleanly, with no shape forced on the facade. What landed: - Uuid custom_type! (↔ String at the boundary; `Uuid = String` in Swift/Kotlin) - SessionIdentity #[uniffi::Record] + From<client::SessionIdentity> - FfiError #[uniffi::Error] (Connect/Closed/Refused/Codec/Transport) - EventCallback + CommandHandler #[uniffi::export(with_foreign)] callback ifaces - Subscription/Registration/ContinuumClient #[uniffi::Object]; the async verbs under #[uniffi::export(async_runtime = "tokio")]; connect() as #[constructor] - src/bin/uniffi-bindgen.rs + uniffi `cli` feature so the generator version is pinned to the runtime version by Cargo (single source of truth), invoked as `cargo run --bin uniffi-bindgen -- generate --library <cdylib> --language …` - bindings/ gitignored — regenerated from the cdylib at SDK build time, never the source of truth (the annotated Rust is) Validated: cargo fmt --check clean, clippy --all-targets -D warnings clean, 9 boundary tests pass, swift + kotlin bindings generate cleanly from the dll. Unblocks M5's native emitter: gives it the REAL facade symbol names to target. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The doc claimed a `.udl` file in decision #2 and the toolchain table; the landed binding (PR #1675) is uniffi 0.31 PROC-MACRO mode — the facade is annotated in-place and bindgen reads the compiled cdylib. Correct both spots and add a "Proven" subsection capturing the in-crate bindgen invocation, the generated native symbol surface (what M5's emitter targets), and the "generated source is a build artifact, never committed" rule. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
Ready to merge (posting on GitHub since airc fan-out is unreliable — see below).
@m5 this is in your review lane whenever you surface — Note: airc room fan-out is currently dropping cross-peer delivery (loopback masks it as healthy), so GitHub is the reliable coordination channel right now. I'm taking the airc bug; you've got the #1674 handle-model fix. |
joelteply
added a commit
that referenced
this pull request
Jun 18, 2026
…tity (#1676) Capture the onboarding/share UX so the mobile SDK (in flight) implements it directly, and tie it to the airc directory work (#1247). - A node/grid is a vCard-shaped shareable card (identity + endpoints + rooms + capability offers — the airc directory's metadata-only JSON). Sharing a mesh node is the share-a-contact gesture: QR scan-to-join, deep/universal links, native share sheet, NFC tap. - Durability rule: encode the STABLE pointer (gist URL + pin), not the volatile endpoint — so a QR/link survives router port changes (the #1243 stale-port bug). The gist refreshes live endpoints behind a stable front door. - Public vs private = the card's audience (which gist), one mechanism. - Identity = passkeys: hardware-backed, biometric-gated, platform-synced. No raw key management; identity follows the human across devices; still pins an Ed25519 public key (mesh trust unchanged). Open point: passkey IS the signing key vs guards a sealed Ed25519 key — same user-facing contract either way. - Slots cleanly: uniffi facade (#1675, landed) + airc directory cards are the substrate; the native affordances (camera/QR, NFC, WebAuthn, universal links, share sheet) live in the platform SDKs + apps/mobile, not the headless core. Co-authored-by: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Annotates the 4-verb JSON-boundary facade in
continuum-client-ffi(
execute/subscribe/emit/provide+session/scoped/connect) withuniffi 0.31 proc-macros so it emits the single native binding the
Swift/Kotlin SDKs wrap.
This is outlier-B for the SDK interface (per the parallel-outlier-validation
discipline): it proves uniffi binds the async + callback-interface + opaque-object
Self-returning facade cleanly, with no shape forced on the facade. The CLIskin (Rust-direct) and the web skin (wasm-bindgen) are the other outliers over the
same facade — if the most divergent skins fit, the middle is guaranteed.
What landed
Uuidcustom_type!(↔Stringat the boundary;Uuid = Stringin Swift/Kotlin)SessionIdentity#[uniffi::Record]+From<client::SessionIdentity>FfiError#[uniffi::Error](Connect/Closed/Refused/Codec/Transport)EventCallback+CommandHandler#[uniffi::export(with_foreign)]callback interfacesSubscription/Registration/ContinuumClient#[uniffi::Object]; the async verbsunder
#[uniffi::export(async_runtime = "tokio")];connect()as#[constructor]src/bin/uniffi-bindgen.rs+ unifficlifeature so the generator version ispinned to the runtime version by Cargo (single source of truth), invoked as
cargo run --bin uniffi-bindgen -- generate --library <cdylib> --language <swift|kotlin>bindings/gitignored — regenerated from the cdylib at SDK build time, never thesource of truth (the annotated Rust is)
Generated Swift surface (what M5's native emitter targets)
Kotlin mirrors this (suspend funs,
Uuid = String, sealedFfiError).Validation
cargo fmt --checkcleancargo clippy --all-targets -- -D warningsclean🤖 Generated with Claude Code