Expand description
OpenUI component library and prompt generator for Everruns.
Rust reimplementation of the OpenUI component definitions and prompt generator. Produces system prompts that instruct LLMs to generate OpenUI Lang code.
The generated prompt is compatible with @openuidev/react-lang and @openuidev/react-ui
— the React runtime parses the LLM output and renders it into interactive components.
This crate is part of the Everruns ecosystem.
§Example
use everruns_openui::{PromptOptions, default_library, generate_prompt};
let prompt = generate_prompt(default_library(), &PromptOptions::default());
assert!(prompt.contains("```openui"));Ref: https://github.com/thesysdev/openui
- Component definitions: packages/react-ui/src/genui-lib/
- Prompt generator: packages/react-lang/src/parser/prompt.ts
- Library/types: packages/react-lang/src/library.ts
Structs§
- Component
Def - A component definition.
Equivalent to TS
DefinedComponentfromdefineComponent(). - Component
Group - A logical group of components for prompt organization.
- Library
- The full component library definition.
- Prompt
Options - Options for customizing the generated prompt.
- PropDef
- A single prop/argument definition for a component.
Maps to a key in the TypeScript Zod schema’s
.shape.
Functions§
- default_
library - The default OpenUI library matching
@openuidev/react-uiopenuiChatLibrary. Ref: packages/react-ui/src/genui-lib/openuiChatLibrary.tsx - default_
prompt - Generate the default OpenUI system prompt with standard options.
- generate_
prompt - Generate the complete OpenUI system prompt.