TauriBridge provides integration with Tauri framework. Tauri uses a local HTTP server for IPC because the Rust backend communicates with the webview via HTTP/WebSocket. Communication flow: 1. Tauri frontend makes HTTP requests to localhost:PORT 2. TauriBridge handles requests and returns JSON respo
| 38 | // body: JSON.stringify({ agent_id: 'xxx', message: 'hello' }) |
| 39 | // }); |
| 40 | type TauriBridge struct { |
| 41 | app *App |
| 42 | handler MessageHandler |
| 43 | agents map[string]*agent.Agent |
| 44 | agentsMu sync.RWMutex |
| 45 | server *http.Server |
| 46 | port int |
| 47 | sseClients map[string]chan *FrontendEvent |
| 48 | sseMu sync.RWMutex |
| 49 | ctx context.Context |
| 50 | cancel context.CancelFunc |
| 51 | } |
| 52 | |
| 53 | // NewTauriBridge creates a new Tauri bridge |
| 54 | func NewTauriBridge(app *App, port int) (*TauriBridge, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected