@tripley-kit/rpc-runtime
v1.0.0
Published
Tripley RPC TypeScript runtime for generated clients
Maintainers
Readme
@tripley-kit/rpc-runtime
Runtime helpers for TypeScript clients generated by Tripley.Rpc.Tools.TypeScriptGen.
WebSocket
import { createWebSocketRpcConnection } from '@tripley-kit/rpc-runtime';
const connection = createWebSocketRpcConnection('ws://127.0.0.1:5088/rpc');WebView2 HostObject contract
WebView2RpcTransport expects a frame bridge. The native host object forwards complete RPC MessagePack envelope frames; it does not implement RPC invoke/notify/subscribe semantics.
Default host object name: tripleyRpc.
Required JavaScript-visible shape:
chrome.webview.hostObjects.tripleyRpc.SendFrameAsync(frameBase64: string): Promise<void> | voidOptional methods:
chrome.webview.hostObjects.tripleyRpc.ConnectAsync(): Promise<void> | void
chrome.webview.hostObjects.tripleyRpc.DisconnectAsync(): Promise<void> | voidNative-to-JavaScript messages are sent with chrome.webview.postMessage:
{ type: 'tripley.rpc.frame', frame: '<base64>' }
{ type: 'tripley.rpc.close', reason?: string }
{ type: 'tripley.rpc.error', code?: string, message: string }frame is a base64-encoded complete RPC envelope frame. The host must preserve send order within one connection and reject SendFrameAsync when the native pipe cannot accept the frame.
