-
Notifications
You must be signed in to change notification settings - Fork 4
Plugins
aidamir edited this page May 13, 2026
·
1 revision
Cultiva can load community plugins from a public registry (HTTPS). Plugin code runs in a strict sandbox; the desktop app bridges selected UI into the main window starting with 0.4.0.
- Open Settings → Plugins (enable plugins if there is a master toggle).
- Pick a plugin from the list (data comes from the registry URL configured in the app).
-
Install downloads
manifest.json, the entry script, and anymanifest.stylesCSS into your user profile (userData/cultiva-plugins— not your git clone).
Official store layout: CultivaPlugins on GitHub.
| Layer | What runs where |
|---|---|
| Main process | File I/O, optional pluginHttpGet, install paths |
Renderer (plugin-manager) |
Registry fetch, sandbox host, CSS injection, main-window UI bridge |
| Sandbox iframe | Your index.js as new Function('context', 'hooks', …) — no window.electron, no direct DOM to Cultiva’s window |
Plugins cannot read arbitrary files on disk beyond what the host exposes.
Sandboxed code cannot call document.querySelector on the real app. These APIs forward UI to the host:
| API | Purpose |
|---|---|
context.ui.openMainSheet(html) |
Modal “sheet” in the main window |
context.ui.closeMainSheet() |
Close it |
context.ui.updateMainHeader({ label, icon, labelColor? }) |
Live header chip text / color |
context.ui.registerGardenWidget({ …, onTapMethod? }) |
Garden HTML + optional click → instance method |
context.ui.updateGardenHtml(html) |
Refresh garden markup |
onModalAction(action, payload) |
Handle data-cultiva-* delegated actions from the sheet |
Authoritative spec: Cultiva Plugins Guide in the Cultiva repository (tracked in git).
Set "minAppVersion": "0.4.0" in your manifest.json if you depend on the bridge.
-
hooks.on('onAppStart', …)and other documented hooks notify your sandbox when events occur. -
context.storage.get/set— async, namespaced key/value persisted by the app.
| Problem | Check |
|---|---|
| Install fails | Desktop build only? Network / GitHub reachable? DevTools console for sandbox errors |
| Plugin “does nothing” | Are you calling main-window APIs on 0.4.0+? Older builds cannot show sandbox-only document.body modals |
| Styles missing | List every CSS file in manifest.styles
|
- Desktop Build — packaging the app
- Privacy and Security — data boundaries