feat(host): native-backend chat adapter over the legacy container pro… - #283
Draft
eugypalu wants to merge 1 commit into
Draft
feat(host): native-backend chat adapter over the legacy container pro…#283eugypalu wants to merge 1 commit into
eugypalu wants to merge 1 commit into
Conversation
…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.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 nativeChatManagerwhen there's no truapi host but the native container is present; it wraps@novasamatech/host-api-wrapper'screateProductChatManager()