Skip to content

bws9000/stateflowx-runtime-host-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StateFlowX Runtime Host Demo

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.

Features

  • 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

Install

npm install

Environment Variables

Create a .env file:

GEMINI_API_KEY=your_google_gemini_api_key

Run

node main.mjs

Runtime will start on:

ws://localhost:3001

Example Runtime Host

import 'dotenv/config';

import {
  bootstrapHttpRuntime,
  RuntimeInitializeApp,
  GeminiProvider,
} from '@stateflowx/runtime';

await bootstrapHttpRuntime({
  apps: [
    new RuntimeInitializeApp(),
  ],

  providers: [
    {
      name: 'gemini',

      provider:
        new GeminiProvider(),
    },
  ],

  services: [],
});

Related Projects

  • StateFlowX Client Demo
  • StateFlowX Runtime
  • StateFlowX Client

Architecture

Client
  ->
WebSocket
  ->
JSON-RPC
  ->
StateFlowX Runtime
  ->
Providers
  ->
Runtime Events
  ->
Artifact Generation

Status

Experimental / Active Development

This project is currently evolving rapidly as the runtime architecture and orchestration model are refined.

About

StateFlowX runtime host example demonstrating external npm package consumption, WebSocket transport, JSON-RPC orchestration, dynamic workflow registration, and Gemini-powered AI execution outside the monorepo.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors