Runtime Extensions
Runtime Extensions
Runtime extensions allow third-party developers to extend apps built with the Foresight Development Kit, without access to source code.
WASM Sandboxing
Extensions are bundled as a WebAssembly (WASM) module and a manifest that defines its metadata and requirements. By using a secure sandbox, third-party code can execute without direct access to the host environment, ensuring the stability and security of the client application. Interoperability is handled through a WIT (Wasm Interface Type) interface, which allows the SDK to provide type-safe bindings for many languages, including Rust, C#, Python, and JavaScript.
Capabilities
Runtime extensions can:
- Execute Statements: Interact with the project by running any statement from the client’s standard library.
- Manage Objects: Store versioned JSON state on the server or locally.
- Automate with Scripts: Run sequences of statements to automate workflows.
- Define Tools: Create async WASM-based tools that drive form-based UI panels.
Limitations
For security and stability, runtime extensions cannot:
- Define new Statements (they must use the existing library).
- Add arbitrary Bevy plugins.
- Define custom viewport overlays or low-level interaction systems.