electrobun-rpc

Solid

Use when working with Electrobun's RPC system — defineElectrobunRPC, Electroview.defineRPC, ElectrobunRPCSchema types, bun-to-renderer and renderer-to-bun communication. Activates automatically when RPC code is present.

AI & Automation 368 stars 68 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
85
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Electrobun RPC System Type-safe bidirectional communication between the Bun process and webview renderers. Uses WebSockets for transport with AES-GCM encryption. Two call types: `requests` (expects a response) and `messages` (fire-and-forget). ## Schema Definition (shared type) Define the schema in a shared file both sides import: ```typescript // src/shared/rpc-schema.ts import type { ElectrobunRPCSchema, RPCSchema } from "electrobun/view"; // bun: what the BUN process handles (requests from renderer, messages from renderer) // webview: what the WEBVIEW handles (requests from bun, messages from bun) export type AppRPC = { bun: RPCSchema<{ requests: { getNotes: { args: {}; response: Note[] }; saveNote: { args: { id: string; title: string; content: string }; response: { success: boolean } }; deleteNote: { args: { id: string }; response: void }; }; messages: { userIdleDetected: {}; }; }>; webview: RPCSchema<{ requests: { getSelectedText: { args: {}; response: string }; }; messages: { menuAction: { action: string; role?: string }; noteUpdatedExternally: { id: string }; }; }>; } & ElectrobunRPCSchema; ``` ## Bun Side — BrowserView.defineRPC ```typescript import { BrowserView } from "electrobun/bun"; import type { AppRPC } from "../shared/rpc-schema"; const appRPC = BrowserView.defineRPC<AppRPC>({ maxRequestTime: 10000, // ms — set higher for file dialogs, heavy DB ops handlers: { r...

Details

Author
milady-ai
Repository
milady-ai/milady
Created
4 months ago
Last Updated
yesterday
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category