IPC API Reference¶
All renderer-to-main communication is exposed through src/preload.cts via
contextBridge.exposeInMainWorld.
Contract notes¶
invokemethods are request/response RPC.send/event methods are stream-style for incremental output.Types are declared in
src/global.d.tsandsrc/node-apis/types/*.d.ts.
window.ollama¶
Model and chat operations:
Method |
IPC channel |
Description |
|---|---|---|
|
|
List installed models for local or selected remote host. |
|
|
Validate/select model runtime before chat. |
|
|
Remove installed model. |
|
|
Clear in-memory chat history in main process. |
|
|
Pull model image, emits progress events. |
|
|
Check service health/availability. |
|
|
Start streamed chat generation. |
|
|
Abort active generation process. |
|
|
Load saved sessions from disk. |
|
|
Persist sessions to disk. |
|
|
Return chat session storage directory. |
|
|
Return cached tool-capable model list. |
|
|
Refresh tool-capable model list from source. |
|
|
Generate suggested session title. |
|
|
Import GGUF/model file content. |
|
|
Import paired Modelfile + GGUF. |
|
|
Start local authenticated proxy host. |
|
|
Stop local proxy host. |
|
|
Read proxy server logs. |
Event subscriptions:
Method |
Event channel |
Description |
|---|---|---|
|
|
Pull progress updates. |
|
|
Tool call payload events. |
|
|
Asset generation event payloads. |
|
|
Token stream for assistant response. |
|
|
Stream-time failure. |
|
|
Stream completed normally. |
|
|
Stream aborted by user/system. |
|
|
Incremental proxy log updates. |
Utility methods:
removeAllListeners()clears active chat stream listeners.
window.utils¶
Method |
IPC channel |
Description |
|---|---|---|
|
|
Read blob asset by UUID. |
|
|
Delete blob asset by UUID. |
|
|
List available local blob assets. |
|
|
Open URL externally with system browser. |
|
|
Render markdown and sanitize output. |
|
|
Sanitize provided HTML. |
|
|
Save text content to local path (guarded). |
|
|
Return user data directory path. |
|
|
Return CPU/RAM compatibility warning data. |
|
|
Check first-launch marker. |
|
|
Remove first-launch marker. |
window.hfspaces¶
Method |
IPC channel |
Description |
|---|---|---|
|
|
Return rendered/imported Space cards. |
|
|
Remove stored Space import. |
|
|
Export Space import to file. |
|
|
Return rendered/imported website cards. |
|
|
Remove stored website import. |
|
|
Export website import to file. |
window.auth¶
Method |
IPC channel |
Description |
|---|---|---|
|
|
Start GitHub OAuth flow. |
|
|
Start Google OAuth flow. |
|
|
Password-based sign in. |
|
|
Email/password registration. |
|
|
End local Supabase session. |
|
|
Read active session and profile. |
|
|
Subscribe renderer callback to auth changes. |
|
|
Send password reset email. |
|
|
Verify password before destructive account actions. |
|
|
Delete account and related records. |
|
|
Create/update profile username. |
|
|
List the authenticated user’s Lightning API keys. |
|
|
Create a hashed Lightning API key row and return the raw secret once. |
|
|
Revoke an existing Lightning API key. |
window.sync¶
Method |
IPC channel |
Description |
|---|---|---|
|
|
Fetch remote sessions/messages for authenticated user. |
|
|
Upsert local sessions and prune remote deletions. |