Skip to content

feat: integrate the Chat modality with the shared Rust core - #326

Merged
pgherveou merged 104 commits into
mainfrom
feat/chat-modality-shared-core
Aug 9, 2026
Merged

feat: integrate the Chat modality with the shared Rust core#326
pgherveou merged 104 commits into
mainfrom
feat/chat-modality-shared-core

Conversation

@pgherveou

@pgherveou pgherveou commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add immutable SPA and Chat execution contexts with generated execution filtering
  • make custom-message rendering a typed request/response stream while keeping existing Chat subscriptions one-way
  • add connection-scoped Chat state, native ProductRuntime controls, and the optional ChatPlatform adapter
  • expose typed native renderer trees through Swift, Kotlin, and generated TrUAPI bindings
  • add a Chat-only playground worker, diagnosis reporting, explorer results, and local iOS launch workflows
  • document the shared-core Chat protocol and product integration

Design

Host drafts

Validation

  • cargo test -p truapi-server --all-features
  • cargo test -p truapi-codegen
  • cargo clippy for truapi-server and truapi-codegen with warnings denied
  • full code generation with nightly-2026-01-10
  • @parity/truapi: 208 tests and TypeScript build
  • playground lint, typecheck, and unit tests
  • TrUAPIHost Swift package build
  • Chat diagnosis report and iOS launcher script checks

Notes

The protocol and iOS host integration should be reviewed together.

pgherveou and others added 30 commits July 17, 2026 19:07
Use codec-derived runtime payloads and metadata-aware storage projections so field ordering and variant encoding stay aligned with chain types. Derive SSO message labels once and keep normal transcript events at debug.
Native executors need dispatch futures that can move across Tokio worker
threads. Keep concise async signatures while teaching rustdoc codegen to
unwrap async-trait futures.
pgherveou and others added 22 commits August 7, 2026 16:26
…shared-core

# Conflicts:
#	android/truapi-host/build.gradle.kts
#	android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt
#	ios/truapi-host/Sources/TrUAPIHost/truapi_server.swift
#	ios/truapi-host/Sources/truapi_serverFFI/include/truapi_serverFFI.h
#	js/packages/truapi/src/client.test.ts
#	rust/crates/truapi-server/src/native.rs
…ared-core

# Conflicts:
#	android/truapi-host/build.gradle.kts
#	android/truapi-host/src/main/kotlin/io/parity/truapi/TrUAPIHost.kt
#	ios/truapi-host/Sources/TrUAPIHost/truapi_server.swift
#	ios/truapi-host/Sources/truapiFFI/include/truapiFFI.h
#	ios/truapi-host/Sources/truapi_platformFFI/include/truapi_platformFFI.h
#	ios/truapi-host/Sources/truapi_serverFFI/include/truapi_serverFFI.h
#	ios/truapi-host/scripts/rebuild.sh
#	js/packages/truapi/src/client.test.ts
#	rust/crates/truapi-server/src/native.rs
- Use canonical types over the native FFI: derive uniffi on the v01 chat
  and custom-renderer types plus ProductExecutionKind, and delete the
  Native* mirror enums/records and their From conversions.
- Move chat off HostCallbacks onto an optional NativeChatCallbacks trait
  passed to open_product_execution; freeze the legacy NativeTrUApiCore at
  its pre-chat surface; drop the inert session-store/cancel-login hooks
  and the Swift LiveSessionStoreForwarder machinery.
- Share one ChatConnection per execution via ConnectionAdapters, replacing
  the doubled pre-connection action buffer and the paired *_with_platform
  constructor variants; runtime dispose now detaches the subscriber while
  keeping buffered actions for the next connection.
- Avoid per-frame ProtocolMessage clones, build the native renderer child
  tree once per update so children() returns Arc clones, and resolve
  chain-head follow aliases once per request.
- Name the host-initiated codegen constants, hoist shared launch-script
  helpers into scripts/lib/ios-simulator.mjs, overlap dev-server/product
  builds with simulator boot, and validate chat diagnosis reports from
  their rendered counts instead of a hardcoded method total.

Swift bindings are not regenerated here; run
ios/truapi-host/scripts/rebuild.sh to refresh them and the XCFramework.

Co-Authored-By: Claude <noreply@anthropic.com>
@pgherveou
pgherveou added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 9b708fb Aug 9, 2026
13 checks passed
@pgherveou
pgherveou deleted the feat/chat-modality-shared-core branch August 9, 2026 04:18
/// starting a subscription, while the dispatcher keys that subscription
/// by its transport request id. The first follow-bound request claims the
/// sole unaliased follow for this chain; later requests reuse that alias.
fn resolve_local_follow_id(&self, requested_id: &str) -> Option<String> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is not really needed we should probably verify and get rid of that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants