It definitely should be in the anytype-heart, exposing new APIs for clients and providing the ability for the same cross-platform experiences.
It only works when the client is running, not as a headless client for automation. Because the anytype-heart already provides this capability, see this.
I think Extism looks great. It implements a kernel in Rust and builds it to kernel.wasm, then loads the kernel.wasm in the Wasm runtime. It provides official Go SDK (non-CGO), JavaScript SDK, and Java SDK.
Performance is not an issue for such GUI apps; see https://dylibso.com/blog/how-does-extism-work/
However, it might be an issue for iOS because there is no JIT allowed by default.
Inspired by the Chromium extension manifest, Android Manifest and AWS permissions boundaries.
- Plugins should never read the key.
- Limited memory usage. Provided by Extism.
- Limited scope: space/set/object.
- Jailed networking (host, IP, port, total size and speed of read and write, time limit).
- Filesystem access controls. Provided by Extism.
- Group the gRPC ClientCommands (Per command or per group, see systemd-analyze syscall-filter).
- Limit the content size of gRPC requests.
- Pure text or complex content (consider this as potentially more vulnerable).
- Storage for each extension.
- Listening API.
- GUI widgets.
- Dynamically approve or reject some permissions at runtime.
- Clipboard.
- Customize domains for different providers' endpoints, for example: plugins based on LLM services.
- Minimal anytype-heart version.
- Target platforms.
- Background thread.
Inspired by Windows Safe Mode and
--disable-extensionsin Chromium.
If one of the extensions is buggy or vulnerable (e.g., consuming all CPU resources and preventing uninstallation), we need a mechanism to start the application with all extensions disabled.
Desktop apps can implement this easily. iOS can use the context menu. Android can use app shortcuts. These could serve as entry points for Anytype's safe mode.
- Users can add official or third-party repositories via URLs, and can easily remove them, similar to how it's done with winget source, scoop bucket, or equivalent tools.
- Implement upgrade interval checks on the client side.
Similar to the methods used by Mozilla, Chrome, VSCode marketplace, Android APKs, or comparable platforms.
The developer mode is inspired by Chromium's developer mode.
The developer mode will ignore the signing, allowing developers to load any extensions, including unpacked extensions.
Anytype clients should repeatedly display a prominent warning when users try to enable developer mode.
To limit the developer mode (or not?):
- Automatically disable or uninstall the extension after 3 restarts of Anytype.
- Automatically disable or uninstall the extension after 12 hours.
Extend the AccountLocalLinkNewChallenge?
- Open-sourced.
- Reproducible.
- No obfuscated code, self-documenting.
- Principle of least privilege.
- Formal verification.
All languages that support compilation to Wasm are acceptable.
I'm not sure. But check this, it prepares an eval plug-in and evaluates the input JavaScript.
In the other side, is this really necessary? Consider Obsidian, which has a successful extension ecosystem and only supports developing extensions with Node.js.
- Publish to a URL or website.
- Search pinyin.
- LLMs autocomplete.
- Image OCR to text.
-
iOS:
-
https://developer.apple.com/support/terms/apple-developer-program-license-agreement/#b331
-
https://extism.org/docs/questions/#can-i-use-extism-with-my-own-webassembly-runtime
-
https://github.com/tetratelabs/wazero/blob/main/README.md#runtime
-
https://github.com/bytecodealliance/wasm-micro-runtime/wiki/Performance
-
https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/embed_wamr.md
-
https://github.com/wasm3/wasm3/blob/main/README.md#motivation
-
-
Android:
-
macOS:
-
Windows:
-
AppImage:
- Store
- Search
- Install
- Uninstall
- Per extension settings
| anytype-heart | anytype-ts | anytype-kotlin | anytype-swift | |
|---|---|---|---|---|
| SetEndpoint | API | Input | Input | Input |
| SetMode | API | CheckBox | CheckBox | CheckBox |
| InstallByID | API | Input | Input | Input |
| add GUI elements | - | Dynamic | Dynamic | Dynamic |
| Safe mode | - | Entry | Entry | Entry |
- https://dylibso.com/blog/how-does-extism-work/
- https://dylibso.com/blog/plug-in-system-in-hiding/
- https://github.com/MAIF/wasmo
- https://github.com/obsidianmd/obsidian-help/blob/ce06db8fd3ae0f90e6e5c56d4a8f82d8ab37f0a8/en/Extending%20Obsidian/Plugin%20security.md#plugin-capabilities
- extism/extism#684
- https://github.com/1Password/onepassword-sdk-go
- https://wazero.io/languages/tinygo/
- https://go.dev/blog/wasi