Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
06ac57a
feat: port Rust core runtime from truapi_next prototype
pgherveou May 17, 2026
3d3cc16
fix: address review follow-ups #98, #99, #100, #102
pgherveou May 17, 2026
368db4c
fix(truapi-server): inject Spawner instead of std::thread::spawn per …
pgherveou May 17, 2026
98d08f2
test(truapi-server,truapi-codegen): expand coverage (#101)
pgherveou May 17, 2026
4814d9f
feat(truapi-server): chain runtime + smoldot provider (Phase 4d, #103)
pgherveou May 17, 2026
f70b432
feat(host-libs): @parity/host-{shared,web,electron} packages (Phase 6…
pgherveou May 17, 2026
32daaa1
feat(host-libs): android + ios native shells (Phase 6 native, #103)
pgherveou May 17, 2026
b958a00
test(truapi-server): fix wire_table_ts_parity parser
pgherveou May 17, 2026
c9381a9
chore: Makefile, CI, and design docs for the new core (Phase 7, #103)
pgherveou May 17, 2026
7763025
fix(ci): silence clippy::result_large_err on WS handshake callback + …
pgherveou May 17, 2026
5bbeea3
refactor: flatten host-libs into top-level dirs + rename JS packages
pgherveou May 17, 2026
30eccf0
docs: correct architecture diagram — truapi-server runs in a SharedWo…
pgherveou May 17, 2026
0b532f8
refactor(truapi-platform): trim to capability traits, drop async_trai…
pgherveou May 17, 2026
ba55c25
feat: WebSocket transport — replace base64 bridge for native (#17)
pgherveou May 17, 2026
1a62857
feat(truapi-codegen): emit TS HostCallbacks interface from truapi-pla…
pgherveou May 17, 2026
c004d95
refactor(truapi-codegen): use writedoc!/formatdoc! in host_callbacks …
pgherveou May 17, 2026
fcf6abd
docs(claude.md): describe resulting state, not commit-level transitio…
pgherveou May 17, 2026
8285468
fix: address review-round-2 findings on PR #104
pgherveou May 18, 2026
5899bce
feat(android): ship truapi-host-android as a JitPack-distributed Mave…
pgherveou May 18, 2026
57d88e1
derive display
pgherveou May 18, 2026
7d94c4e
refactor(android,ios): nest native packages under `<platform>/truapi-…
pgherveou May 18, 2026
3fdaa65
Merge branch 'main' into worktree-issue-96-rust-core-port
pgherveou May 29, 2026
dcf222a
build(js): use TypeScript project references across the workspace pac…
pgherveou May 29, 2026
0fe1044
Merge branch 'main' into worktree-issue-96-rust-core-port
pgherveou May 29, 2026
35f415d
fix: address PR #104 review findings
pgherveou May 30, 2026
12f2f71
refactor(host): drop the native alternative-transport path
pgherveou May 30, 2026
4484518
refactor(js): consolidate host runtime into @parity/truapi-host-wasm
pgherveou May 30, 2026
d78ff61
Merge branch 'main' into worktree-issue-96-rust-core-port
pgherveou Jun 1, 2026
c43f803
docs: add host core implementation plan
pgherveou Jun 7, 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
95 changes: 95 additions & 0 deletions .github/workflows/host-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: host-packages
on:
push:
branches: [main]
paths:
- 'js/packages/truapi-host-wasm/**'
- 'android/**'
- 'ios/**'
- 'rust/crates/truapi-server/**'
- 'rust/crates/truapi-platform/**'
- 'rust/crates/truapi-codegen/**'
- 'rust/crates/truapi-macros/**'
- 'rust/crates/truapi/**'
pull_request:
paths:
- 'js/packages/truapi-host-wasm/**'
- 'android/**'
- 'ios/**'
- 'rust/crates/truapi-server/**'
- 'rust/crates/truapi-platform/**'
- 'rust/crates/truapi-codegen/**'
- 'rust/crates/truapi-macros/**'
- 'rust/crates/truapi/**'

jobs:
wasm-bundle-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: actions/setup-node@v4
with: { node-version: 22 }
- name: Install wasm-pack
run: cargo install wasm-pack
# Rebuilds the bundle from the current truapi-server source and runs the
# truapi-host-wasm node smoke test against those freshly-built artifacts, so a
# stale committed bundle cannot pass green. Byte-equality against the
# committed bundle is intentionally not asserted: wasm-pack output varies
# with the Rust toolchain and wasm-bindgen version, so cross-machine
# reproducibility is not achievable. The committed artifacts under
# js/packages/truapi-host-wasm/dist/wasm/ serve as a convenience for
# consumers that don't run Rust; regenerate locally with `make wasm`
# before changing truapi-server source.
- name: Rebuild WASM
run: make wasm
- name: Sanity-check artifact presence
run: |
test -s js/packages/truapi-host-wasm/dist/wasm/web/truapi_server_bg.wasm
test -s js/packages/truapi-host-wasm/dist/wasm/web/truapi_server.js
test -s js/packages/truapi-host-wasm/dist/wasm/node/truapi_server_bg.wasm
test -s js/packages/truapi-host-wasm/dist/wasm/node/truapi_server.js
- name: Build @parity/truapi-host (dep)
run: cd js/packages/truapi-host && npm install --no-fund --no-audit && npm run build
- name: Build @parity/truapi client (dep)
run: cd js/packages/truapi && npm install --no-fund --no-audit && npm run build
- name: Test @parity/truapi-host-wasm against the rebuilt bundle
run: cd js/packages/truapi-host-wasm && npm install --no-fund --no-audit && npm test
host-packages-js-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 22 }
- name: Build @parity/truapi-host (dep)
run: cd js/packages/truapi-host && npm install --no-fund --no-audit && npm run build
- name: Build @parity/truapi client (dep)
run: cd js/packages/truapi && npm install --no-fund --no-audit && npm run build
- name: Test @parity/truapi-host-wasm
run: cd js/packages/truapi-host-wasm && npm install --no-fund --no-audit && npm test
android-assemble:
# Smoke-builds the Android library + verifies the Maven publication
# can be assembled (writes to maven-local). No release happens here;
# distribution is via JitPack, which builds tagged commits per
# jitpack.yml and serves the io.parity:truapi-host-android artifact.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- uses: gradle/actions/setup-gradle@v4
- name: Assemble truapi-host-android (release)
run: gradle :truapi-host:assembleRelease --no-daemon --stacktrace
- name: Build Maven publication into local repo
run: gradle :truapi-host:publishReleasePublicationToMavenLocal --no-daemon --stacktrace
- name: Sanity-check published artifacts
run: |
set -eux
base="$HOME/.m2/repository/io/parity/truapi-host-android/0.1.0"
test -s "$base/truapi-host-android-0.1.0.aar"
test -s "$base/truapi-host-android-0.1.0.pom"
test -s "$base/truapi-host-android-0.1.0-sources.jar"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ lerna-debug.log*
node_modules
target

# Gradle (Android workspace at repo root)
/.gradle/
/build/
/android/*/build/
local.properties

# Editor / OS
.vscode/*
!.vscode/extensions.json
Expand Down
43 changes: 37 additions & 6 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,48 @@ This repo is the single source of truth for the TrUAPI protocol. It vendors `dot

```
rust/crates/
truapi/ Rust trait + type definitions for protocol versions v0.1 and v0.2
truapi/ Rust trait + type definitions for protocol versions v0.1 and v0.2 (canonical)
truapi-codegen/ rustdoc JSON → TypeScript client + Rust dispatcher
truapi-macros/ #[wire(id = N)] proc-macro
truapi-platform/ Host syscall traits (storage, navigation, consent, ...)
truapi-server/ Rust runtime hosts implement; ships as WASM (browser/node) and via UniFFI (iOS/Android)
uniffi-bindgen-cli/ Thin CLI wrapper around uniffi::uniffi_bindgen_main()
js/packages/
truapi/ @parity/truapi TS package; generated TS lives under ignored paths
playground/ Next.js interactive playground; deploys to truapi-playground.dot
hosts/dotli/ dotli submodule
docs/ design docs, RFCs, feature proposals
scripts/codegen.sh regenerate the TS client from the Rust crate
truapi/ @parity/truapi TS package; generated TS lives under ignored paths
truapi-host/ @parity/truapi-host host-side codegen + dispatcher (no shared core)
truapi-host-wasm/ @parity/truapi-host-wasm: WASM-backed host runtime. Subpath entries:
`.` (core Provider + dispatcher + node runtime), `/web` (iframe + Web
Worker), `/electron` (MessagePortMain), `/worker-runtime` (Worker entry).
Pre-built WASM under dist/wasm/{web,node}/
android/
truapi-host/ io.parity:truapi-host-android Maven library (AAR + UniFFI Kotlin bindings)
ios/
truapi-host/ TrUAPIHost Swift Package (sources + UniFFI Swift bindings)
playground/ Next.js interactive playground; deploys to truapi-playground.dot
hosts/dotli/ dotli submodule
docs/ design docs, RFCs, feature proposals
scripts/codegen.sh regenerate the TS client from the Rust crate
```

### Crate + binding invariants

- `truapi` is canonical; runtime crates re-export rather than redefine. New
syscall traits and host-side runtime types live in `truapi-platform` and
`truapi-server`, not in `truapi`. Any additions to `truapi` itself are limited
to additive `Display` impls.
- All types exposed by `truapi-platform` and `truapi-server` come from
`truapi::versioned::*` and `truapi::v01::*`. The runtime crates re-export
rather than redefine.
- Pre-built `truapi-server` WASM artifacts are committed under
`js/packages/truapi-host-wasm/dist/wasm/{web,node}/`. Regenerate via
`make wasm` whenever `rust/crates/truapi-server/` changes. CI rebuilds the
bundle as a smoke check; exact byte-identity isn't enforced because
wasm-pack output depends on Rust/wasm-bindgen versions.
- UniFFI bindings under `android/truapi-host/` and `ios/truapi-host/` are generated from the
`truapi-server` cdylib via `make uniffi`. The generated Swift modulemap may
need a one-time relocation into `Sources/truapi_serverFFI/include/`, the
`make uniffi` target prints a reminder.

## Code style

- Every `pub` Rust item (functions, methods, types, traits, modules, constants) carries a doc comment (`///` or `//!`).
Expand Down
Loading