Skip to content

feat(host): native-backend chat adapter over the legacy container pro… - #283

Draft
eugypalu wants to merge 1 commit into
eugenio/product-sdk-react-rendererfrom
eugenio/product-sdk-native-chat
Draft

feat(host): native-backend chat adapter over the legacy container pro…#283
eugypalu wants to merge 1 commit into
eugenio/product-sdk-react-rendererfrom
eugenio/product-sdk-native-chat

Conversation

@eugypalu

@eugypalu eugypalu commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Makes chat products work on the legacy "native" backend, not just truapi/SCALE, the same way non-chat SPA products already do. getChatManager() falls back to a native ChatManager when there's no truapi host but the native container is present; it wraps @novasamatech/host-api-wrapper's createProductChatManager()

…tocol

getChatManager() falls back to a native ChatManager when no truapi host is
present (isNativeChatHost() detects the container global), wrapping
@novasamatech/host-api-wrapper's createProductChatManager — which speaks the
legacy container __container__ protocol — behind the unified ChatManager
interface. The wrapper is loaded via dynamic import() so truapi-only products
never bundle the novasama tree.

The truapi and novasama TS shapes for the same wire data diverge and are each
translated explicitly (never a blind cast):
- custom-renderer node (toNovasamaNode): PascalCase->dotted enums,
  struct->tuple Dimensions, {text}->bare String, unwrapped modifier values,
  the exact inverse of the renderer's serializer; throws on an unmapped enum;
- ChatMessageContent: Text {text}<->bare string, Custom payload hex<->Uint8Array;
- ActionTriggered.payload: hex<->Uint8Array.

The host-initiated render handler is bridged to the novasama (params, render)
callback. Validated end to end on the iOS simulator against the native runtime.

Adds a transitional dependency on @novasamatech/host-api-wrapper; blocked on the
same truapi release as the rest of #279.
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​novasamatech/​host-api-wrapper@​0.9.2761009999100

View full report

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.

1 participant