Minimal external runtime host example for StateFlowX.
This project demonstrates how to host the StateFlowX runtime outside of the main monorepo using the published npm packages.
- External npm package consumption
- WebSocket runtime hosting
- JSON-RPC protocol transport
- Realtime runtime event streaming
- Gemini AI provider integration
- Dynamic runtime initialization
- Runtime bootstrap API
- Event-driven orchestration
npm installCreate a .env file:
GEMINI_API_KEY=your_google_gemini_api_keynode main.mjsRuntime will start on:
ws://localhost:3001
import 'dotenv/config';
import {
bootstrapHttpRuntime,
RuntimeInitializeApp,
GeminiProvider,
} from '@stateflowx/runtime';
await bootstrapHttpRuntime({
apps: [
new RuntimeInitializeApp(),
],
providers: [
{
name: 'gemini',
provider:
new GeminiProvider(),
},
],
services: [],
});- StateFlowX Client Demo
- StateFlowX Runtime
- StateFlowX Client
Client
->
WebSocket
->
JSON-RPC
->
StateFlowX Runtime
->
Providers
->
Runtime Events
->
Artifact Generation
Experimental / Active Development
This project is currently evolving rapidly as the runtime architecture and orchestration model are refined.