Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
31e4bd1
fix: resolve clippy warnings and align naming with TS SDK
aphrodoe Apr 3, 2026
f2f7eb9
feat: add CEP-17/CEP-19 constants and bootstrap relay URLs
aphrodoe Apr 3, 2026
924bc3d
feat: support ephemeral gift wraps (kind 21059) per CEP-19
aphrodoe Apr 3, 2026
79c62fa
fix: return signed event id for encrypted message correlation
piyush-1337 Apr 3, 2026
be67b6d
fix: return signed event id for encrypted message correlation (#2)
ContextVM-org Apr 3, 2026
d7d1ee5
chore: align with CEP-4 and official rmcp SDK
aphrodoe Apr 3, 2026
422ef77
Feat/cep19 alignment (#1)
ContextVM-org Apr 3, 2026
e569fa9
feat: implemented basic rmcp support helpers and functions
kushagra0902 Apr 3, 2026
6c2d732
Merge branch 'main' of https://github.com/kushagra0902/contextVM_sdk_rs
kushagra0902 Apr 3, 2026
78edc9c
feat: wired logic in gateway
kushagra0902 Apr 3, 2026
5505e37
fix: fixed duplicate dependency warning
kushagra0902 Apr 3, 2026
d3d9a2f
feat(rmcp): add typed discovery and client service integration
aphrodoe Apr 3, 2026
84911d7
feat: add rmcp integration test example
aphrodoe Apr 3, 2026
61da016
chore: cargo formatting fixes
aphrodoe Apr 4, 2026
f4e2fd9
fix: removed hard coded values and redundant KIND types
kushagra0902 Apr 4, 2026
136248d
Integrating RMCP to existing rust sdk (#3)
ContextVM-org Apr 4, 2026
905b16a
fix: add missing util::logger module for rmcp build
harsh04044 Apr 5, 2026
ae57431
test: add comprehensive tests for core types
harsh04044 Apr 6, 2026
0f64824
fix: add missing util::logger module for rmcp build (#6)
ContextVM-org Apr 6, 2026
9cc19b1
test: add comprehensive tests for core types (#7)
ContextVM-org Apr 6, 2026
024ee46
feat: implemented tracing setup for subscriptions and custom log form…
kushagra0902 Apr 6, 2026
c84036d
enhancement: improved error logging in encryption module
kushagra0902 Apr 6, 2026
bc10f03
enhancement: improved error logging in gateway and proxy modules
kushagra0902 Apr 6, 2026
3cb5eb0
enhancement: improved error logging in rmcp and transport modules
kushagra0902 Apr 6, 2026
bbe369d
feat: added exmaples with log files
kushagra0902 Apr 6, 2026
7f47857
setup basic github workflow
kushagra0902 Apr 6, 2026
75bb1ab
fix: verify inner event signatures after gift-wrap decryption
Anshumancanrock Apr 7, 2026
8608340
test: add conformance tests for initialization flow wire format
harsh04044 Apr 7, 2026
c3a9073
fix: resolve all clippy warnings, remove orphaned doc comment and dup…
Anshumancanrock Apr 7, 2026
d2ff04d
Setup basic github workflow (#10)
ContextVM-org Apr 7, 2026
03fb6c7
fix: verify inner event signatures after gift-wrap decryption (#11)
ContextVM-org Apr 7, 2026
8697822
test: add conformance tests for initialization flow wire format (#12)
ContextVM-org Apr 7, 2026
2de8652
fix: all Clippy warnings, orphaned doc comment & duplicate constant (…
ContextVM-org Apr 7, 2026
3f00ece
fix: route event loops through validated message parsing
Anshumancanrock Apr 7, 2026
5fe046f
fix: route event loops through validated message parsing (#15)
ContextVM-org Apr 7, 2026
68b4711
test: add wire format conformance tests for tools/list, tools/call, a…
harsh04044 Apr 7, 2026
dbd4484
fix: made the log format across all the files consistent
kushagra0902 Apr 7, 2026
4f5f919
fix: fixed validation logic and improved consistency
kushagra0902 Apr 7, 2026
15cbd5f
Merge branch 'main' into loggerUpdate
kushagra0902 Apr 7, 2026
23eaa58
Add integration test CI harness with local nostr relay
Anshumancanrock Apr 7, 2026
3cb8f50
Fix CI: drop local relay, run integration example in local mode only
Anshumancanrock Apr 7, 2026
02c0bdf
Add stateless conformance tests
Anshumancanrock Apr 8, 2026
963467e
Polish stateless test wording
Anshumancanrock Apr 8, 2026
cbd7999
test: add wire format conformance tests for tools/list, tools/call, a…
ContextVM-org Apr 8, 2026
a74f2db
Enhancement: Improved error logging using Tracer framework (#9)
ContextVM-org Apr 8, 2026
6e18131
Add integration test CI harness with local nostr relay (#18)
ContextVM-org Apr 8, 2026
e48e85c
Add Stateless conformance tests (#20)
ContextVM-org Apr 8, 2026
1bc6b0f
style: apply cargo fmt formatting
harsh04044 Apr 8, 2026
be45cf6
resolve ci
harsh04044 Apr 8, 2026
bc80b8a
test: add conformance tests for signer behavior
harsh04044 Apr 8, 2026
3bdd690
ci: add fmt, clippy, and doc checks (#22)
ContextVM-org Apr 9, 2026
f07bcd9
Merge branch 'main' into test/conformance-signer
harsh04044 Apr 9, 2026
53bb7ed
fix: enforce inbound encryption policy in client event loop The clie…
Anshumancanrock Apr 9, 2026
d6f2107
fix: Client Accepts Plaintext Responses in Required Mode (#24)
ContextVM-org Apr 13, 2026
392538b
fix(transport): fix comment saying we should not use a since filter o…
theAnuragMishra Apr 12, 2026
d6fdb3d
fix: implement gift-wrap deduplication using LRU cache
harsh04044 Apr 9, 2026
f4da9ac
test: add conformance tests for signer behavior (#23)
ContextVM-org Apr 21, 2026
33af83b
fix: implement gift-wrap deduplication using LRU cache (#26)
ContextVM-org Apr 21, 2026
e0f996e
fix(transport): fix comment saying we should not use a since filter o…
ContextVM-org Apr 21, 2026
b7fe8ef
refactor: extract RelayPoolTrait and implement MockRelayPool for testing
harsh04044 Apr 11, 2026
26dfe13
test: add conformance tests for gift-wrap deduplication
harsh04044 Apr 22, 2026
412c664
refactor: extract RelayPoolTrait and add MockRelayPool for integratio…
ContextVM-org Apr 22, 2026
65a0ba7
test: add conformance tests for gift-wrap deduplication (#35)
ContextVM-org Apr 22, 2026
ce94af1
refactor: extract ClientCorrelationStore and ServerEventRouteStore in…
harsh04044 Apr 22, 2026
6bdc586
feat(cep-19): add GiftWrapMode type and ephemeral gift-wrap encryption
kushagra0902 Apr 23, 2026
6f67439
refactor: extract ClientCorrelationStore and ServerEventRouteStore i…
ContextVM-org Apr 23, 2026
eeb4e36
test: add Phase 3 integration tests using MockRelayPool
harsh04044 Apr 22, 2026
e0f3aec
CEP-19: Part 1 (#39)
ContextVM-org Apr 23, 2026
9196a95
test: add Phase 3 integration tests using MockRelayPool (#38)
ContextVM-org Apr 23, 2026
3dfc682
refactor: enrich correlation stores, add SessionStore, and port Phase…
harsh04044 Apr 24, 2026
c2e9c48
feat(cep-19): Added ephemeral package handling logic in client transport
kushagra0902 Apr 23, 2026
e5fe6d6
test: add LRU eviction and registerRequest initialize flag conformanc…
harsh04044 Apr 24, 2026
04a0662
refactor: enrich correlation stores, add SessionStore and port Phase …
ContextVM-org Apr 24, 2026
e5ccd48
test: port remaining integration and stateless mode tests, closing al…
harsh04044 Apr 26, 2026
96963db
fix(lru): unbounded LRU cache initialisation
kushagra0902 Apr 26, 2026
6c82a8c
CEP1-19 Part2: Client side integration (#42)
ContextVM-org Apr 28, 2026
e61d5a0
Merge branch 'main' into test/remaining-integration-tests
ContextVM-org Apr 28, 2026
350d569
test: add GiftWrapMode import to stateless mode conformance test
ContextVM-org Apr 28, 2026
fa0030b
test: port remaining integration and stateless mode tests (#44)
ContextVM-org Apr 28, 2026
98d9fd4
style: reorder import statements alphabetically
ContextVM-org Apr 28, 2026
123471c
fix(lru): unbounded LRU cache initialisation (#50)
ContextVM-org Apr 28, 2026
060b701
fix(lru): unbounded LRU cache initialisation (#50)
ContextVM-org Apr 28, 2026
996980f
bug(transport): non atomic send_response behaviour (#48)
ContextVM-org Apr 29, 2026
7413e10
format
ContextVM-org Apr 29, 2026
be992f0
fix: send JSON-RPC -32000 Unauthorized error on announced servers wit…
harsh04044 Apr 29, 2026
8838ca3
fix (bug): send JSON-RPC -32000 Unauthorized error on announced serve…
ContextVM-org Apr 29, 2026
4280b1e
feat: add discovery tags module, PeerCapabilities, and server config …
harsh04044 Apr 26, 2026
1e49572
refactor: remove merge_discovery_tags per CEP-35 spec update
harsh04044 Apr 30, 2026
f0ea097
fix: register client request before publish and drop uncorrelated res…
harsh04044 Apr 30, 2026
31e454d
fix (bug): register client request before publish and drop uncorrelat…
ContextVM-org May 1, 2026
5501d11
feat: add discovery tags module and server config foundation for CEP-…
ContextVM-org May 1, 2026
676ca49
feat: add discovery tags module and server config foundation for CEP-…
ContextVM-org May 1, 2026
c499b8d
feat(cep19): added missing test cases
kushagra0902 May 2, 2026
9817860
feat(cep19): server side CEP 19 transport logic (#56)
ContextVM-org May 2, 2026
14d5328
feat: enrich ClientSession, add tag composition, server discovery tag…
harsh04044 May 1, 2026
062d377
feat: add tag composition, server discovery tag emission and capabili…
ContextVM-org May 2, 2026
378ae4d
feat: client discovery tag emission and capability learning for CEP-35
harsh04044 May 2, 2026
9fb4179
test: add integration tests for CEP-35 OR-assign, baseline freeze, an…
harsh04044 May 4, 2026
a7abfb6
feat: client discovery tag emission and capability learning for CEP-3…
ContextVM-org May 5, 2026
ae9c851
fix: add TTL sweep to client and server correlation stores to prevent…
harsh04044 May 5, 2026
5d4d5b7
fix: remove single-peer barrier in RMCP worker and add LRU-bounded Se…
harsh04044 May 4, 2026
4eafd78
docs: clarify timeout and request_timeout as correlation-retention TTLs
harsh04044 May 5, 2026
0b6a9f8
fix: remove single-peer barrier in RMCP worker and add LRU-bounded Se…
ContextVM-org May 5, 2026
b78e699
fix: wire client timeout config and add TTL sweep to prevent pending-…
ContextVM-org May 5, 2026
bd381be
fix: cancel spawned event loop tasks on close() using CancellationToken
harsh04044 May 5, 2026
6368c71
fix: stop event loop tasks on close() (#63)
ContextVM-org May 6, 2026
4d705aa
refactor(rmcp): add direct transport adapters for native ContextVM se…
ContextVM-org May 6, 2026
b585505
docs: add SDK documentation links to README
ContextVM-org May 6, 2026
6469c92
fix: pre-release blockers - non_exhaustive, Lagged handling, zero-cap…
harsh04044 May 6, 2026
ad37229
refactor(rmcp): simplify transport API by removing wrapper adapters
ContextVM-org May 6, 2026
675d272
fix: pre-release blockers for 0.1.0 (#68)
ContextVM-org May 6, 2026
6230b4e
refactor(rmcp): add direct transport adapters for native ContextVM se…
ContextVM-org May 7, 2026
53c2a9e
refactor(examples): use builder pattern for transport configuration
ContextVM-org May 7, 2026
4a25d1a
Merge remote-tracking branch 'origin/main' into docs
ContextVM-org May 7, 2026
5b6670e
docs: add from_sk() signer documentation across guides
ContextVM-org May 7, 2026
938a5be
chore: add crates.io publishing metadata, CHANGELOG, remove tracing-s…
harsh04044 May 7, 2026
235685c
chore: publishing config, CHANGELOG, and pre-release cleanup (#69)
ContextVM-org May 7, 2026
f33ef68
fix(rmcp): bridge stateless CEP-35 requests into rmcp lifecycle
ContextVM-org May 7, 2026
efe52ea
refactor(rmcp): move stateless client bootstrap logic from transport …
ContextVM-org May 7, 2026
ea17427
chore: add missing derives and gate MockRelayPool behind test-utils f…
harsh04044 May 7, 2026
12262da
test: add E2E happy path integration tests through full SDK stack
harsh04044 May 8, 2026
e533250
fix(rmcp): bridge stateless CEP-35 requests into rmcp lifecycle (#70)
ContextVM-org May 8, 2026
f8fcf48
chore: bump to 0.1.1, publishing config and quality improvements (#71)
ContextVM-org May 8, 2026
04c1100
test: add E2E happy path integration tests through full SDK stack (#72)
ContextVM-org May 8, 2026
5a567f2
docs: update transport configuration examples to use builder pattern
ContextVM-org May 8, 2026
c7fe3ac
chore(changelog): document 0.1.1 release
ContextVM-org May 8, 2026
f53ccfe
build(config): remove hyphens from package keywords
ContextVM-org May 8, 2026
d22702c
docs: update configuration examples to use constructor pattern
ContextVM-org May 8, 2026
aad068a
docs: add SDK documentation links to README (#67)
ContextVM-org May 8, 2026
ecdf6ed
docs: add missing_docs lint and close all rustdoc coverage gaps
harsh04044 May 8, 2026
1613472
docs: add missing_docs lint and close all rustdoc coverage gaps (#73)
ContextVM-org May 9, 2026
a2c6965
refactor: extract AnnouncementManager from NostrServerTransport (CEP-35)
harsh04044 May 13, 2026
e3ecb7d
ci: add MSRV and feature matrix checks, fix rust-version to 1.88
harsh04044 May 13, 2026
4ea6ce4
ci: consolidate feature matrix into main ci job
harsh04044 May 13, 2026
24797af
refactor: extract AnnouncementManager from NostrServerTransport (CEP-…
ContextVM-org May 14, 2026
4dde95d
ci: add MSRV and feature matrix checks (#75)
ContextVM-org May 14, 2026
e43889f
feat: add ProfileMetadata type and update ServerAnnouncement to parse…
harsh04044 May 14, 2026
7fb7679
feat: add ProfileMetadata type and update ServerAnnouncement parsing …
ContextVM-org May 15, 2026
fda3e87
feat: auto-publish server announcements on start (CEP-6 PR 2)
harsh04044 May 19, 2026
ef96759
feat: auto-publish server announcements on start (CEP-6) (#78)
ContextVM-org May 19, 2026
01aee12
feat: relay list and profile metadata publishing (CEP-6)
harsh04044 May 19, 2026
f6e8f92
med
harsh04044 May 19, 2026
9ce91bc
fix: wire get_discoverability_publish_relay_urls() into actual public…
harsh04044 May 20, 2026
10ab9d5
feat: relay list and profile metadata publishing (CEP-6) (#79)
ContextVM-org May 20, 2026
628c6ca
feat: CEP-6 PR 4 - schema mapping table, delete fix, integration test…
harsh04044 May 21, 2026
e579c78
fix: address review - NIP-09 helper, real failure test, rename delete…
harsh04044 May 21, 2026
48fe6c6
feat: schema mapping, delete fix, and gap closures CEP-6 (#81)
ContextVM-org May 21, 2026
de726a4
feat: server identity parsing, relay list fetching, and fetch_events …
harsh04044 May 21, 2026
64e88ed
feat: server identity parsing, relay list fetching, and fetch_events …
ContextVM-org May 25, 2026
444197c
feat: multi-stage relay resolution and transport integration (CEP-17)
harsh04044 May 26, 2026
16462b7
docs: update doc
harsh04044 May 26, 2026
c27240d
feat: multi-stage relay resolution and transport integration (CEP-17)…
ContextVM-org May 26, 2026
337ac31
chore: upgrade rmcp 0.16.0 → 1.7.0 and switch to ContextVM-org fork
harsh04044 May 28, 2026
f503b3a
Add ContextVM FFI bindings
aljazceru May 27, 2026
2c47b09
chore: upgrade rmcp 0.16.0 → 1.7.0 and switch to ContextVM-org fork (…
ContextVM-org May 29, 2026
e6e7625
fixing minor issues, features
aljazceru May 29, 2026
bf02709
feat: CEP-22 - transport-agnostic oversized transfer framing engine
harsh04044 Jun 2, 2026
6fef2e9
feat: CEP-22 - transport-agnostic oversized transfer framing engine (…
ContextVM-org Jun 4, 2026
49e08b4
feat: CEP-22 - config, capability advertisement, and server gate
harsh04044 Jun 6, 2026
4e6e50b
fix: MockRelayPool live broadcast now respects subscription filters
harsh04044 Jun 8, 2026
a0f9413
fix: MockRelayPool live broadcast now respects subscription filters (…
ContextVM-org Jun 8, 2026
00e2f85
fix: address review - SessionSnapshot capabilities, real gate tests, …
harsh04044 Jun 8, 2026
fbedaa9
feat: CEP-22 - config, capability advertisement, and server gate (#89)
ContextVM-org Jun 8, 2026
decd754
feat: CEP-22 - transport integration, outbound split, inbound reassem…
harsh04044 Jun 10, 2026
69a9079
feat: CEP-22 - transport integration, outbound split, inbound reassem…
ContextVM-org Jun 10, 2026
896313f
feat: CEP-22 - progress-aware timeouts, transfer watchdog, default fl…
harsh04044 Jun 14, 2026
ab06d03
feat: CEP-22 - progress-aware timeouts, transfer watchdog, and defau…
ContextVM-org Jun 15, 2026
3038a04
fix: make oversized e2e test deterministic and hermetic relay config
harsh04044 Jun 16, 2026
bbca576
fix: make oversized e2e test deterministic and hermetic relay config …
ContextVM-org Jun 16, 2026
a1c8489
addressing comments from #84
aljazceru Jun 17, 2026
92ed52a
fix: deterministic e2e timing test, hermetic relay config, encrypted …
harsh04044 Jun 19, 2026
9629709
fix: add missing encrypted oversized response test (TS commit c71d556…
ContextVM-org Jun 19, 2026
c4bc8d0
Add ContextVM FFI bindings
aljazceru May 27, 2026
30c6aa2
fixing minor issues, features
aljazceru May 29, 2026
a0f998b
addressing comments from #84
aljazceru Jun 17, 2026
1f9bdb7
fix(ffi): cover SDK OversizedTransfer error variant
ContextVM-org Jun 19, 2026
63fd4eb
fix(ffi): address review — gate nak tests, drop committed binary, har…
ContextVM-org Jun 19, 2026
46402fc
Merge branch 'pr-1' into contextvm-ffi
aljazceru Jun 22, 2026
b01f183
feat: CEP-41 - open-stream engine (frame, session, writer, registry, …
harsh04044 Jun 23, 2026
2d7ef59
last but not least
aljazceru Jun 23, 2026
ae4f329
feat: CEP-41 - open-stream engine (pure, inert) (#97)
ContextVM-org Jun 23, 2026
21555ce
chore(ffi): untrack compiled c-tests/test_ffi binary
aljazceru Jun 23, 2026
12a8e98
Add ContextVM FFI bindings (#84)
ContextVM-org Jun 23, 2026
e04437e
fix(ffi): cover SDK OpenStream error variant
ContextVM-org Jun 23, 2026
bc2e188
ci: add CI and FFI workflows for rs-sdk workspace
ContextVM-org Jun 23, 2026
9066afe
chore(deps): adopt official rmcp 1.8 from crates.io, retire fork
ContextVM-org Jun 23, 2026
ab696ae
ci(ffi): install uniffi-bindgen from git at v0.29.5
ContextVM-org Jun 23, 2026
890565c
feat: add python examples, upgrade nostr-sdk to 0.44 and uniffi to 0.31
ContextVM-org Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

# Quality gates for the Rust SDK + FFI workspace.
# Runs on every push/PR to main and on version tags. FFI artifact/release
# packaging lives in ffi.yml.

on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
lint:
name: fmt + clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: cargo fmt --all -- --check
- name: clippy (all features)
run: cargo clippy --all --all-features --all-targets -- -D warnings

test:
name: check + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: check (all features)
run: cargo check --all --all-features
- name: test (all features)
# Includes the FFI crate. `nak-tests` no-ops when the `nak` CLI is
# absent from PATH (see contextvm-ffi/Cargo.toml).
run: cargo test --all --all-features
- name: test (no default features)
run: cargo test --no-default-features
- name: doc
run: cargo doc --no-deps --all-features
- name: rmcp integration example
run: cargo run --example rmcp_integration_test --features rmcp -- local

msrv:
name: MSRV 1.88
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88
- uses: Swatinem/rust-cache@v2
# Regenerate the lockfile so dependencies resolve to versions that still
# support the declared MSRV (1.88).
- name: Remove lockfile
run: rm -f Cargo.lock
- name: check
run: cargo check --all-features
- name: test
run: cargo test --all-features
192 changes: 192 additions & 0 deletions .github/workflows/ffi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
name: FFI

# Cross-platform build, C-test, and release packaging for the ContextVM FFI
# bindings (C header + UniFFI Python/Swift/Kotlin surfaces).
#
# On push/PR to main: builds every target, runs the C test suite, and
# generates UniFFI bindings as a verification step.
# On version tags (v*): additionally assembles per-platform release archives
# and uploads them to the GitHub Release.

on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
libs: 'libcontextvm_ffi.so libcontextvm_ffi.a'
archive: tar.gz
- os: macos-latest
target: aarch64-apple-darwin
libs: 'libcontextvm_ffi.dylib libcontextvm_ffi.a'
archive: tar.gz
- os: macos-13
target: x86_64-apple-darwin
libs: 'libcontextvm_ffi.dylib libcontextvm_ffi.a'
archive: tar.gz
- os: windows-latest
target: x86_64-pc-windows-msvc
libs: 'contextvm_ffi.dll contextvm_ffi.dll.lib contextvm_ffi.lib'
archive: zip
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
key: ffi-${{ matrix.target }}
- name: Build FFI (release)
run: cargo build --release -p contextvm-ffi --target ${{ matrix.target }}
- name: Stage artifacts
shell: bash
run: |
set -euo pipefail
STAGE="stage/contextvm-ffi"
mkdir -p "$STAGE/lib" "$STAGE/include"
for f in ${{ matrix.libs }}; do
cp "target/${{ matrix.target }}/release/$f" "$STAGE/lib/"
done
cp contextvm-ffi/headers/contextvm.h "$STAGE/include/"
cp contextvm-ffi/README.md "$STAGE/"
- name: Archive (tar.gz)
if: matrix.archive == 'tar.gz'
run: tar -czf contextvm-ffi-${{ matrix.target }}.tar.gz -C stage contextvm-ffi
- name: Archive (zip)
if: matrix.archive == 'zip'
shell: pwsh
run: Compress-Archive -Path stage/contextvm-ffi -DestinationPath contextvm-ffi-${{ matrix.target }}.zip
- uses: actions/upload-artifact@v4
with:
name: contextvm-ffi-${{ matrix.target }}
path: contextvm-ffi-${{ matrix.target }}.*
retention-days: 14

build-macos-universal:
name: build macOS universal
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
key: ffi-macos-universal
- name: Build arm64
run: cargo build --release -p contextvm-ffi --target aarch64-apple-darwin
- name: Build x86_64
run: cargo build --release -p contextvm-ffi --target x86_64-apple-darwin
- name: Create universal libraries
shell: bash
run: |
set -euo pipefail
STAGE="stage/contextvm-ffi"
mkdir -p "$STAGE/lib" "$STAGE/include"
lipo -create \
target/aarch64-apple-darwin/release/libcontextvm_ffi.dylib \
target/x86_64-apple-darwin/release/libcontextvm_ffi.dylib \
-output "$STAGE/lib/libcontextvm_ffi.dylib"
lipo -create \
target/aarch64-apple-darwin/release/libcontextvm_ffi.a \
target/x86_64-apple-darwin/release/libcontextvm_ffi.a \
-output "$STAGE/lib/libcontextvm_ffi.a"
cp contextvm-ffi/headers/contextvm.h "$STAGE/include/"
cp contextvm-ffi/README.md "$STAGE/"
tar -czf contextvm-ffi-universal-apple-darwin.tar.gz -C stage contextvm-ffi
- uses: actions/upload-artifact@v4
with:
name: contextvm-ffi-universal-apple-darwin
path: contextvm-ffi-universal-apple-darwin.tar.gz
retention-days: 14

c-tests:
name: C tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ffi-c-tests
# The C test suite is the only check that the hand-written contextvm.h
# header matches the Rust extern "C" signatures. It links against the
# built FFI library and exercises keys, errors, memory frees, and config
# structs directly from C. Linux-only because the c-tests/Makefile links
# with -ldl/-lm; signature consistency is platform-independent, and the
# macOS build jobs already confirm the dylib links on Darwin.
- name: Build and run C tests
run: make -C contextvm-ffi/c-tests test

bindings:
name: UniFFI bindings (python/swift/kotlin)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: ffi-bindings
- name: Build FFI library (for embedded metadata)
run: cargo build -p contextvm-ffi
# The bindgen CLI is `publish = false` in Mozilla's repo, so it is not
# on crates.io for any 0.2x/0.3x release. Install from git, pinned to the
# tag that matches the runtime `uniffi` dependency in
# contextvm-ffi/Cargo.toml. The two MUST stay in lockstep: UniFFI embeds a
# contract version + per-function checksums into both the compiled library
# and the generated language file, and a mismatch aborts at import time
# (`InternalError("UniFFI ... mismatch")`). As of 0.30 the example app
# installs a binary named `uniffi-bindgen-cli` (it was `uniffi-bindgen`
# in 0.29).
- name: Install uniffi-bindgen-cli
run: cargo install --git https://github.com/mozilla/uniffi-rs --tag v0.31.2 uniffi-bindgen-cli --locked
- name: Generate bindings
run: |
set -euo pipefail
LIB=target/debug/libcontextvm_ffi.so
for lang in python swift kotlin; do
uniffi-bindgen-cli generate "$LIB" --library \
--language "$lang" --out-dir "bindings/$lang"
done
- uses: actions/upload-artifact@v4
with:
name: contextvm-ffi-bindings
path: bindings/
retention-days: 14

release:
name: release
if: startsWith(github.ref, 'refs/tags/v')
needs: [build, build-macos-universal, c-tests, bindings]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Package bindings
run: tar -czf contextvm-ffi-bindings.tar.gz -C artifacts/contextvm-ffi-bindings .
- name: Publish to GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
artifacts/contextvm-ffi-*/*.tar.gz
artifacts/contextvm-ffi-*/*.zip
contextvm-ffi-bindings.tar.gz
Loading