Offline Container Modules
Explore the Offline Container codebase to see how modules are structured, registered, and executed.
Reference implementation
The Offline Container repository contains the integration code for local AI tools such as image generators, text generation LLMs, and audio synthesis tools.Core structure
- Entry point: The
src/main.tsfile acts as the main entry point. It registers all available modules with LynxHub. - Renderer script: The
src/renderer.tsfile handles the frontend module scripts. - Module configuration: The
package.jsonfile configures dependencies and build configurations using Rollup.
Module registration
Each module registers an identifier and its lifecycle methods. The following code snippet shows how modules are registered insrc/main.ts:
Key utilities
Theutils parameter provides helpers to interact with the host application:
utils.logger: Logs messages to the central console.utils.processManager: Manages the lifecycle of child processes.utils.settings: Accesses user-defined module configurations.