Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
a302550
feat(truapi): add testing API and versioned wiring
pgherveou Jun 30, 2026
4b83619
feat(truapi-platform): add host capability traits
pgherveou Jun 30, 2026
b25162f
feat(truapi-server): add Rust host runtime
pgherveou Jun 30, 2026
1c8334a
feat(truapi-codegen): emit Rust dispatcher, wire table, and host call…
pgherveou Jun 30, 2026
b137a87
feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jun 30, 2026
4c04a81
chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jun 30, 2026
8e0e71f
feat(truapi): add testing API and versioned wiring
pgherveou Jun 30, 2026
f898de6
fixup! feat: port Rust core runtime
pgherveou Jul 1, 2026
3faed7e
fixup! feat: port Rust core runtime
pgherveou Jul 1, 2026
dea080a
fixup! feat(truapi): add testing API and versioned wiring
pgherveou Jul 1, 2026
3409152
fixup! feat(truapi): add testing API and versioned wiring
pgherveou Jul 1, 2026
6b1a0fc
fixup! feat: port Rust core runtime
pgherveou Jul 2, 2026
0569aaf
fixup! feat(truapi): add testing API and versioned wiring
pgherveou Jul 2, 2026
8c93e99
feat(truapi-platform): add host capability traits
pgherveou Jun 30, 2026
f3f37e9
fixup! feat: port Rust core runtime
pgherveou Jul 2, 2026
97d0b79
fixup! feat(truapi-platform): add host capability traits
pgherveou Jul 2, 2026
52e64b8
fixup! feat: port Rust core runtime
pgherveou Jul 2, 2026
3e6c0a0
fixup! feat: port Rust core runtime
pgherveou Jul 3, 2026
d2e3674
fixup! feat(truapi-platform): add host capability traits
pgherveou Jul 3, 2026
c6f888c
feat(truapi-codegen): emit Rust dispatcher, wire table, and host call…
pgherveou Jun 30, 2026
a37abae
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 2, 2026
99d1b7e
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 2, 2026
1c46353
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 2, 2026
16f10e9
fixup! feat: port Rust core runtime
pgherveou Jul 3, 2026
2c52262
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 3, 2026
8a4bab1
fixup! feat: port Rust core runtime
pgherveou Jul 3, 2026
f1a10bc
fixup! feat: port Rust core runtime
pgherveou Jul 3, 2026
7bd57b8
fixup! feat(truapi-codegen): emit Rust dispatcher, wire table, and ho…
pgherveou Jul 3, 2026
6964df3
feat(truapi-server): add host logic primitives
pgherveou Jul 1, 2026
c8c4595
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 1, 2026
88cf1a9
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 2, 2026
2d88bdf
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 3, 2026
5e938f1
fixup! feat: port Rust core runtime
pgherveou Jul 3, 2026
e1f6790
feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 1, 2026
d959726
fixup! feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 3, 2026
fa642c1
fixup! feat(truapi-server): add host logic primitives
pgherveou Jul 3, 2026
176c6b1
feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 1, 2026
6aa9887
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 1, 2026
0f6e16c
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 2, 2026
80ff2c7
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 2, 2026
c6091f0
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 3, 2026
e4d9a0d
fixup! feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 3, 2026
302e84c
feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jun 30, 2026
63f59f9
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 1, 2026
cda98b6
chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jun 30, 2026
232458b
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 2, 2026
375c395
fixup! chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jul 1, 2026
7ac562a
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 3, 2026
e33df7c
fixup! feat(host-wasm): add @parity/truapi-host-wasm runtime
pgherveou Jul 3, 2026
518d270
fixup! chore: docs, CI, tooling, and dotli integration for the Rust core
pgherveou Jul 2, 2026
124b5b7
fixup! feat: port Rust core runtime
pgherveou Jul 3, 2026
cc4c5e5
Merge origin/main into rust core umbrella
pgherveou Jul 3, 2026
dab5395
Merge origin/main into rust-core/04-codegen
pgherveou Jul 3, 2026
15e1594
Merge branch 'rust-core/04-codegen' into rust-core/04a-server-host-logic
pgherveou Jul 3, 2026
54f0b20
docs(host-logic): link host-spec sections
pgherveou Jul 3, 2026
2da3da5
Merge branch 'rust-core/04a-server-host-logic' into rust-core/04b-ser…
pgherveou Jul 3, 2026
f7b2424
Merge branch 'rust-core/04b-server-wire-chain' into rust-core/03-serv…
pgherveou Jul 3, 2026
ac7992f
docs(runtime): link host-spec sections
pgherveou Jul 3, 2026
cd15f9c
Merge branch 'rust-core/03-server-runtime' into rust-core/05-host-wasm
pgherveou Jul 3, 2026
67d763b
docs(server): fix wasm rustdoc reference
pgherveou Jul 3, 2026
351f6e7
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 3, 2026
e058ba3
chore(dotli): update truapi integration sha
pgherveou Jul 3, 2026
d0eab2a
fixup! feat: port Rust core runtime
pgherveou Jul 3, 2026
cda27e1
fixup! feat(truapi-server): add wire and chain infrastructure
pgherveou Jul 3, 2026
227f47c
Merge branch 'rust-core/04b-server-wire-chain' into rust-core/03-serv…
pgherveou Jul 3, 2026
8bd9085
fixup! feat(truapi-server): add platform runtime and host bridge
pgherveou Jul 3, 2026
51f1e1c
Merge branch 'rust-core/03-server-runtime' into rust-core/05-host-wasm
pgherveou Jul 3, 2026
312be68
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 3, 2026
ba2571a
Merge branch 'main' into rust-core/03-server-runtime
pgherveou Jul 3, 2026
0c2b0f7
firs batch
pgherveou Jul 4, 2026
7e8eb40
refactor(codegen): derive wasm host callbacks
pgherveou Jul 5, 2026
b804d04
fix(server): enforce runtime permissions
pgherveou Jul 6, 2026
f22b4b5
feat(codegen): generate wasm bridge callbacks
pgherveou Jul 6, 2026
2cb1e97
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
4c04dd3
refactor(host-wasm): use namespaced callbacks
pgherveou Jul 6, 2026
fa859e3
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
23bb0b8
chore(dotli): update host integration
pgherveou Jul 6, 2026
5de806e
fix(server): include runtime crate in workspace
pgherveou Jul 6, 2026
460dc77
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
e9888aa
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
d820bb0
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
0d304f8
docs(server): describe permission flow
pgherveou Jul 6, 2026
cddce3e
Merge branch 'rust-core/03-server-runtime' into rust-core/04-wasm-bri…
pgherveou Jul 6, 2026
b4ac06f
Merge branch 'rust-core/04-wasm-bridge-codegen' into rust-core/05-hos…
pgherveou Jul 6, 2026
307e08f
Merge branch 'rust-core/05-host-wasm' into rust-core/06-docs-ci-tooling
pgherveou Jul 6, 2026
a253874
fix(codegen): satisfy wasm bridge clippy
pgherveou Jul 6, 2026
a46e8fe
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
23ebade
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
9f62ed0
Merge remote-tracking branch 'origin/rust-core/06-docs-ci-tooling' in…
pgherveou Jul 6, 2026
1735b8a
test(server): wait for auth sync callback
pgherveou Jul 6, 2026
01ddadc
Merge remote-tracking branch 'origin/rust-core/03-server-runtime' int…
pgherveou Jul 6, 2026
487b2d7
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
a5113fe
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
008c375
Merge remote-tracking branch 'origin/rust-core/06-docs-ci-tooling' in…
pgherveou Jul 6, 2026
f421258
test(server): make pairing snapshot test deterministic
pgherveou Jul 6, 2026
2fc5be9
Merge remote-tracking branch 'origin/rust-core/03-server-runtime' int…
pgherveou Jul 6, 2026
c137fef
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
980d597
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
b89869b
Merge remote-tracking branch 'origin/rust-core/06-docs-ci-tooling' in…
pgherveou Jul 6, 2026
7190552
chore(stack): move wasm bridge out of runtime layer
pgherveou Jul 6, 2026
c3c243b
Merge remote-tracking branch 'origin/rust-core/03-server-runtime' int…
pgherveou Jul 6, 2026
71c910f
Merge remote-tracking branch 'origin/rust-core/04-wasm-bridge-codegen…
pgherveou Jul 6, 2026
2b766bb
Merge remote-tracking branch 'origin/rust-core/05-host-wasm' into rus…
pgherveou Jul 6, 2026
60e0491
Merge remote-tracking branch 'origin/rust-core/06-docs-ci-tooling' in…
pgherveou Jul 6, 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
2 changes: 1 addition & 1 deletion .changeset/rename-provider-to-wireprovider.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@parity/truapi": patch
"@parity/truapi": minor
---

Rename the exported `Provider` transport type to `WireProvider` to make its role explicit. It is the low-level SCALE-wire-frame pipe (a `MessagePort` or iframe `postMessage` channel) that `createTransport` runs on. The `createIframeProvider` / `createMessagePortProvider` factories are unchanged; only the type name moves. Consumers importing `Provider` should import `WireProvider` instead.
2 changes: 1 addition & 1 deletion .changeset/truapi-sandbox-bootstrap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@parity/truapi": patch
"@parity/truapi": minor
---

Add the `@parity/truapi/sandbox` entry point: host-environment detection (`isCorrectEnvironment`), a lazily-built cached client (`getClientSync`, `null` outside a host container), and a `subscribeConnectionStatus` connected/disconnected listener. Browser-embedded hosts can bootstrap a client without assembling the transport by hand.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rust/crates/truapi-codegen/tests/golden/* linguist-generated=true
rust/crates/truapi-server/src/generated/* linguist-generated=true
2 changes: 1 addition & 1 deletion .github/workflows/check-rfc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.event.pull_request.user.login != 'github-actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
persist-credentials: false
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
pull_request:
push:
branches: [main, release/v0.3.2]
branches: [main, release/v0.3.0]
merge_group:
workflow_dispatch:

Expand All @@ -21,7 +21,7 @@ jobs:
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
name: Dependency licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand All @@ -65,7 +65,7 @@ jobs:
name: Codegen
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down Expand Up @@ -100,6 +100,7 @@ jobs:
js/packages/truapi/src/playground/codegen
js/packages/truapi/src/explorer/codegen
js/packages/truapi/src/explorer/versions.ts
js/packages/truapi-host-wasm/src/generated
playground/test/generated

ts-client:
Expand All @@ -109,7 +110,7 @@ jobs:
env:
TRUAPI_REQUIRE_GENERATED: 1
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down Expand Up @@ -142,7 +143,7 @@ jobs:
env:
TRUAPI_REQUIRE_GENERATED: 1
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down Expand Up @@ -187,7 +188,7 @@ jobs:
env:
TRUAPI_REQUIRE_GENERATED: 1
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down Expand Up @@ -227,7 +228,7 @@ jobs:
env:
TRUAPI_REQUIRE_GENERATED: 1
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
submodules: recursive
persist-credentials: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
pages: write
id-token: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
deploy-playground:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/diagnosis-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
if: github.event.label.name == 'diagnosis-report'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/number-rfc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
number-rfc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
persist-credentials: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: startsWith(github.event.pull_request.title, 'release:')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on: # zizmor: ignore[dangerous-triggers]
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main, release/v0.3.2]
branches: [main, release/v0.3.0]

permissions:
contents: read
Expand All @@ -30,7 +30,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_sha }}
Expand Down Expand Up @@ -80,13 +80,11 @@ jobs:

- name: Tag release
if: steps.version.outputs.proceed == 'true'
run: |
git tag "${STEPS_VERSION_OUTPUTS_TAG}"
git push origin "${STEPS_VERSION_OUTPUTS_TAG}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STEPS_VERSION_OUTPUTS_TAG: ${{ steps.version.outputs.tag }}
run: |
gh api repos/${{ github.repository }}/git/refs \
-f ref="refs/tags/${STEPS_VERSION_OUTPUTS_TAG}" \
-f sha="${{ github.event.workflow_run.head_sha }}"

- name: Pack package
if: steps.version.outputs.proceed == 'true'
Expand Down
19 changes: 19 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

# Environment / secrets (never commit real env files; keep example templates)
.env
.env.*
Expand Down Expand Up @@ -39,3 +45,16 @@ playground/public/static.files

# Auto-generated by truapi-codegen (typecheck fixtures for rustdoc ts blocks)
playground/test/generated/

# Auto-generated FFI / WASM binding outputs
android/truapi-host/src/main/kotlin/generated/
ios/truapi-host/Sources/TrUAPIHost/truapi_server.swift
ios/truapi-host/Sources/truapi_serverFFI/
rust/crates/truapi-server/pkg/
js/packages/truapi/src/generated/
js/packages/truapi/dist/generated/
js/packages/truapi-host/src/generated/
js/packages/truapi-host/dist/generated/
js/packages/truapi-host-wasm/src/generated/
js/packages/truapi-host-wasm/dist/generated/
js/packages/truapi-host-wasm/dist/wasm/
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"endOfLine": "lf",
"overrides": [
{
"files": "js/packages/truapi/src/**/*.test.ts",
"files": [
"js/packages/truapi/src/**/*.test.ts",
"js/packages/truapi-host-wasm/src/**/*.test.ts"
],
"options": {
"tabWidth": 4,
"printWidth": 100
Expand Down
135 changes: 128 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,67 @@ 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)
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-wasm/ @parity/truapi-host-wasm: WASM-backed host runtime. Subpath entries:
`.` (shared host types), `/web` (iframe + Web
Worker), `/worker-runtime` (Worker entry).
WASM bundle (gitignored) under dist/wasm/web/, built via `make wasm`
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.
- `truapi-server` WASM artifacts live under
`js/packages/truapi-host-wasm/dist/wasm/web/` and are gitignored.
Build them locally with `make wasm` (rerun whenever
`rust/crates/truapi-server/` changes); CI builds the bundle fresh from the
Rust source on every run.

## Code style

- Every `pub` Rust item (functions, methods, types, traits, modules, constants) carries a doc comment (`///` or `//!`).
Keep it short and focused on intent or invariants, not on what the signature already says.
- Do not add code comments or doc comments that narrate migrations, compatibility shims, or historical changes. Comments should describe only the current code.
- Remove legacy compatibility code by default. Keep or add it only when explicitly requested.
- In Rust format strings, prefer inlined variables: `"log value: {value:?}"` over `"log value: {:?}", value`.
- For Rust modules, prefer `foo.rs` plus an optional `foo/` directory for
child modules. Do not introduce new `foo/mod.rs` files unless preserving
generated output or an existing external convention.
- In runtime Rust code, prefer `core::` over `std::` for types that are
available in `core` (`core::pin::Pin`, `core::task::Poll`, `core::fmt`, and
similar). Keep `std::` for std-only APIs, tests, and std-only programs such
as `truapi-codegen`.
- **No `any` in TypeScript types**: If a type can't be expressed cleanly, stop and ask the user whether to (a) refactor or import the right type or (b) add a scoped `// eslint-disable-next-line @typescript-eslint/no-explicit-any` exception. Never silently leave `any`.
- Don't introduce typealias chains that just rename a public type from another crate (e.g. `pub type StorageError = crate::v01::HostLocalStorageReadError`). Use the canonical name directly. A typealias is only worth its indirection when it captures a real abstraction.
- After any code change, update `README.md` (and CLAUDE.md if the layout changed) so the top-level docs reflect what the repo actually contains. Stale docs are a regression.
- After any code change, update `README.md` (and CLAUDE.md if the layout changed) so the top-level docs reflect what the repo actually contains. Stale docs are a regression. When moving or removing docs, `rg` for the old path and update or remove stale links in README files, agent notes, skills, comments, and design docs.
- In codegen emitters, prefer `indoc::writedoc!` / `formatdoc!` over chains of `writeln!`. A single `writedoc!` with a multi-line raw string keeps the emitted shape visible in source instead of fragmenting it across one-line `writeln!` calls. Reserve `writeln!` for the genuinely-one-line case (a single import, a single statement inside a loop).
- In PR descriptions, issue comments, and other artifacts that outlive the conversation: describe the resulting state, not the transition between commits. Avoid "previously X, now Y", "we removed", "the old shim is gone", "this PR replaces", those read as ephemeral history once the PR is squash-merged. Write what the system _does_ after the change, not what each commit _changed_ on the way there. (Commit messages are the place for transition narrative; they survive in `git log` even after the squash.)

## Explanation style

- For architecture, event-flow, and debugging explanations, start with a short
direct summary of the model before diving into long details. Prefer simple
statements like "the host sends a dirty signal; the core re-reads and derives
auth state" before listing each hop.
- Use diagrams only when they clarify ownership or message flow. Keep them
layered and label what is per-tab, shared, host-owned, and core-owned.

## First-time setup

```bash
Expand Down Expand Up @@ -116,6 +153,90 @@ submodule init + `bun install` and the per-pane `cd` discipline).
Alternatively, with a deployed Polkadot Desktop Host installed, navigate to
`https://dot.li/localhost:3000` from within it.

#### Local dotli + playground E2E notes

Use `make dev DEBUG=1` from the repo root for the local host stack. It prepares
the ignored WASM/build artifacts, verifies dotli can resolve
`@parity/truapi-host-wasm`, then starts dotli on `:5173` and the playground on
`:3000`. Open `http://localhost:5173/localhost:3000`.

When automating with Playwright, block service workers for smoke tests unless
the test is explicitly about SW behavior. Stale host/product bundles can mask
runtime fixes. Use a fresh cache-busting query string on
`http://localhost:5173/localhost:3000?...`, collect `pageerror` and
`console` messages, and fail on unexpected page errors.

For interactive SSO checks, prefer a persistent headed Chrome profile and reuse
the same browser context across checks. SSO pairing needs a real phone QR scan,
and signing/resource-allocation flows may need web or mobile confirmation; if
the human or companion app is unavailable, skip those methods and record the
skip instead of treating it as a protocol failure. Non-interactive checks should
still verify that the playground renders, the TrUAPI debug panel receives
host/product events, generated examples can call non-confirmation methods, and
logout/relogin does not restore a stale session.

The dotli Playwright e2e suite under `hosts/dotli/apps/host/tests/e2e/`
pairs through the signer-bot service. It requires `SIGNER_BOT_SVC_TOKEN`;
`SIGNER_BOT_BASE_URL` and `SIGNER_BOT_NETWORK` default to dotli CI's
`https://signing-bot-dev.novasama-tech.org/` and `paseo-next-v2`. Without the
token, do not treat the full suite as locally runnable. Use
`E2E_DOTLI_SMOKE=1 make e2e-dotli` for the no-phone QR smoke path.
If those signer-bot variables are not available in a worktree, check for a
repo-root `.env` and load or copy the values from there before falling back to
smoke mode. Prefer the current worktree's `.env` when it exists.

For a fully automated local playground diagnosis run, use:

```bash
SIGNER_BOT_SVC_TOKEN=... \
make e2e-dotli
```

`make e2e-dotli` starts dotli preview and the playground, signs out any
restored host session, signs in through signer-bot by extracting the QR payload,
runs the playground Diagnosis screen, auto-accepts host-side Allow/Sign modals,
and writes `hosts/dotli/test-results/e2e-dotli/diagnosis-report.md`.

Root CI runs the same target when it can read the private dotli submodule. It
needs `DOTLI_CHECKOUT_TOKEN` for submodule checkout; without that token, the
job warns and skips dotli e2e rather than failing unrelated PR checks. With
dotli access but without `SIGNER_BOT_SVC_TOKEN`, CI runs the no-phone smoke
path only.

A useful no-phone smoke assertion is:

```bash
E2E_DOTLI_SMOKE=1 make e2e-dotli
```

For manual debugging of that smoke path:

1. Start `make dev DEBUG=1`.
2. Open `http://localhost:5173/localhost:3000?debug=truapi&cachebust=<ts>` with
service workers blocked.
3. Wait for `globalThis.__truapi?.setLogLevel`, call
`__truapi.setLogLevel("debug")`, and confirm the console logs
`[truapi worker] logLevel=debug providers=0`.
4. Click `#auth-button`, wait for `#auth-modal-backdrop.open`, and confirm:
the modal shows `Login with Polkadot Mobile`, `__truapi.getProviderCount()`
is greater than zero, worker frame/callback logs appear, and there are no
page errors.

If `make dev` reports `EADDRINUSE` on `:5173` or the playground moves from
`:3000` to `:3001`, kill stale `preview-server.ts` / `next dev` processes and
restart the tmux session. Port drift causes false-negative local e2e results.

Useful debug signals:

```js
__truapi.setLogLevel("debug");
sessionStorage.setItem("dotli:truapi-debug", "1");
```

Reload after setting the debug-panel flag. Watch for `Unknown wire discriminant`, missing
`@parity/truapi-host-wasm` imports, worker WASM instantiation failures, and
debug-panel traffic disappearing when the login popup opens.

## Deployment

Pushes to `main` trigger `.github/workflows/deploy-playground.yml`, which builds `playground/` and publishes the static export to `truapi-playground.dot` via `bulletin-deploy`.
Expand Down
Loading