Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
workflow_dispatch:
inputs:
package:
description: "Package to publish (react-ui, react-headless, openui-cli, or lang-react)"
description: "Package to publish (react-ui, react-headless, openui-cli or react-lang)"
required: true
type: choice
options:
- react-ui
- react-headless
- lang-react
- react-lang
- openui-cli

jobs:
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/generate-samples.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAI } from "openai";
import { createParser } from "../packages/lang-react/src/parser/parser.js";
import { createParser } from "../packages/react-lang/src/parser/parser.js";
import { writeFileSync, mkdirSync, readFileSync } from "fs";
import { join } from "path";
import { astToVercelJsonl } from "./vercel-jsonl-converter.js";
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"bench": "tsx run-benchmark.ts"
},
"dependencies": {
"@openuidev/lang-react": "workspace:*",
"@openuidev/react-lang": "workspace:*",
"@openuidev/react-ui": "workspace:*",
"openai": "^6.22.0",
"tiktoken": "^1.0.14"
Expand Down
2 changes: 1 addition & 1 deletion docs/app/(home)/components/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const mobileFadeUp = (delay: number) => ({
});

// CTAs
const primaryCTA = "npm install @openuidev/lang-react @openuidev/react-ui";
const primaryCTA = "npm install @openuidev/react-lang @openuidev/react-ui";
const secondaryCTA = "Try Playground";
const COPIED_FEEDBACK_MS = 3000;
// ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/app/docs/openui-lang/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const steps = [
{
title: "Define Library",
description: "Create your component library with Zod schemas and generate the system prompt",
code: `import { defineComponent, createLibrary } from '@openuidev/lang-react';
code: `import { defineComponent, createLibrary } from '@openuidev/react-lang';
import { z } from 'zod';

const Card = defineComponent({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import type { ComponentGroup } from "@openuidev/lang-react";
import type { ComponentGroup } from "@openuidev/react-lang";
import { openuiLibrary } from "@openuidev/react-ui";
import { ChevronLeft, ChevronRight, LayoutList } from "lucide-react";
import { useState } from "react";
Expand Down
4 changes: 2 additions & 2 deletions docs/app/playground/components/PreviewPanel/PreviewPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ParseResult } from "@openuidev/lang-react";
import { Renderer } from "@openuidev/lang-react";
import type { ParseResult } from "@openuidev/react-lang";
import { Renderer } from "@openuidev/react-lang";
import { openuiLibrary, ThemeProvider } from "@openuidev/react-ui";
import { Loader2, Maximize2, Monitor } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
Expand Down
6 changes: 3 additions & 3 deletions docs/components/overview-components/overview-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export function OverviewPage() {
<CodeBlock
className="h-full"
title="Component Library Definition"
code={`import { defineComponent, createLibrary } from '@openuidev/lang-react';
code={`import { defineComponent, createLibrary } from '@openuidev/react-lang';
import { z } from 'zod';

const MyCard = defineComponent({
Expand All @@ -140,7 +140,7 @@ export const myLibrary = createLibrary({
<TabsContent value="render-code" className="mt-3 flex-1">
<CodeBlock
title="Rendering Code"
code={`import { Renderer } from '@openuidev/lang-react';
code={`import { Renderer } from '@openuidev/react-lang';
import { myLibrary } from './library';

// Inside your Chat Message component
Expand Down Expand Up @@ -290,7 +290,7 @@ import { FullScreen, openuiLibrary } from "@openuidev/react-ui";
<TabsContent value="quick-example" className="mt-4">
<CodeBlock
title="Quick example"
code={`import { createLibrary, defineComponent } from '@openuidev/lang-react';
code={`import { createLibrary, defineComponent } from '@openuidev/react-lang';
import { openuiLibrary, openuiPromptOptions } from '@openuidev/react-ui';
import { z } from 'zod';

Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/api-reference/index.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: OpenUI SDK
description: API reference for the documented surfaces of @openuidev/lang-react, @openuidev/react-headless, and @openuidev/react-ui.
description: API reference for the documented surfaces of @openuidev/react-lang, @openuidev/react-headless, and @openuidev/react-ui.
---

## Packages

<Cards>
<Card title="@openuidev/lang-react" href="/docs/api-reference/lang-react">
<Card title="@openuidev/react-lang" href="/docs/api-reference/react-lang">
createLibrary, Renderer, parser APIs, action types, and renderer/form hooks.
</Card>
<Card title="@openuidev/react-headless" href="/docs/api-reference/react-headless">
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/api-reference/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "API Reference",
"root": true,
"pages": ["index", "lang-react", "react-headless", "react-ui"]
"pages": ["index", "react-lang", "react-headless", "react-ui"]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "@openuidev/lang-react"
title: "@openuidev/react-lang"
description: API reference for the OpenUI Lang runtime, library, parser, and renderer.
---

Expand All @@ -15,7 +15,7 @@ import {
BuiltinActionType,
createParser,
createStreamingParser,
} from "@openuidev/lang-react";
} from "@openuidev/react-lang";
```

## `defineComponent(config)`
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/api-reference/react-ui.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ All three layouts accept:
- `assistantMessage?: AssistantMessageComponent`
- `userMessage?: UserMessageComponent`
- `composer?: ComposerComponent`
- `componentLibrary?: Library` (from `@openuidev/lang-react`)
- `componentLibrary?: Library` (from `@openuidev/react-lang`)
- Theme wrapper props:
- `theme?: ThemeProps`
- `disableThemeProvider?: boolean`
Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/openui-lang/defining-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Use `defineComponent(...)` to register each component and `createLibrary(...)` t
## Core API

```tsx
import { defineComponent, createLibrary } from "@openuidev/lang-react";
import { defineComponent, createLibrary } from "@openuidev/react-lang";
import { z } from "zod";

const StatCard = defineComponent({
Expand Down Expand Up @@ -42,7 +42,7 @@ export const myLibrary = createLibrary({
## Nesting pattern with `.ref`

```tsx
import { defineComponent } from "@openuidev/lang-react";
import { defineComponent } from "@openuidev/react-lang";
import { z } from "zod";

const Item = defineComponent({
Expand All @@ -67,7 +67,7 @@ const List = defineComponent({
To define container components that accepts multiple child components, you can use the `z.union` function to define the child components.

```tsx
import { defineComponent } from "@openuidev/lang-react";
import { defineComponent } from "@openuidev/react-lang";
import { z } from "zod";

const TextBlock = defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/openui-lang/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ It is designed for:

```tsx
import "@openuidev/react-ui/components.css";
import { Renderer } from "@openuidev/lang-react";
import { Renderer } from "@openuidev/react-lang";
import { openuiLibrary, openuiPromptOptions } from "@openuidev/react-ui";

const systemPrompt = openuiLibrary.prompt(openuiPromptOptions);
Expand Down
4 changes: 2 additions & 2 deletions docs/content/docs/openui-lang/interactivity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Built-in validators include `required`, `minLength`, `maxLength`, `min`, `max`,
<Card title="Renderer" href="/docs/openui-lang/renderer">
Full Renderer props reference.
</Card>
<Card title="API Reference" href="/docs/api-reference/lang-react">
Complete lang-react API.
<Card title="API Reference" href="/docs/api-reference/react-lang">
Complete react-lang API.
</Card>
</Cards>
6 changes: 3 additions & 3 deletions docs/content/docs/openui-lang/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ title: Quick Start
description: Use the OpenUI library to render OpenUI Lang immediately.
---

This is the fastest path: use `openuiLibrary` from `@openuidev/react-ui` and render LLM output with `@openuidev/lang-react`.
This is the fastest path: use `openuiLibrary` from `@openuidev/react-ui` and render LLM output with `@openuidev/react-lang`.

## Installation

```bash
npm install @openuidev/lang-react @openuidev/react-ui
npm install @openuidev/react-lang @openuidev/react-ui
```

## Render output

```tsx
import "@openuidev/react-ui/components.css";
import { Renderer } from "@openuidev/lang-react";
import { Renderer } from "@openuidev/react-lang";
import { openuiLibrary } from "@openuidev/react-ui";

<Renderer library={openuiLibrary} response={streamedText} isStreaming={isStreaming} />;
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/openui-lang/renderer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Parse and render OpenUI Lang streams in React.
## Basic usage

```tsx
import { Renderer } from "@openuidev/lang-react";
import { Renderer } from "@openuidev/react-lang";
import { openuiLibrary } from "@openuidev/react-ui";

export function AssistantMessage({
Expand Down
6 changes: 3 additions & 3 deletions docs/content/docs/openui-lang/standard-library.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ OpenUI ships with a prebuilt `openuiLibrary` for common layouts, forms, content,
## Install

```bash
npm install @openuidev/lang-react @openuidev/react-ui
npm install @openuidev/react-lang @openuidev/react-ui
```

## Render with OpenUI library

```tsx
import "@openuidev/react-ui/components.css";
import { Renderer } from "@openuidev/lang-react";
import { Renderer } from "@openuidev/react-lang";
import { openuiLibrary } from "@openuidev/react-ui";

<Renderer library={openuiLibrary} response={streamedText} isStreaming={isStreaming} />;
Expand All @@ -32,7 +32,7 @@ const systemPrompt = openuiLibrary.prompt(openuiPromptOptions);
## Extend it

```ts
import { createLibrary, defineComponent } from "@openuidev/lang-react";
import { createLibrary, defineComponent } from "@openuidev/react-lang";
import { openuiLibrary } from "@openuidev/react-ui";
import { z } from "zod";

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/openui-lang/system-prompts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const systemPrompt = openuiLibrary.prompt(openuiPromptOptions);
## Prompt options

```ts
import type { PromptOptions } from "@openuidev/lang-react";
import type { PromptOptions } from "@openuidev/react-lang";

const options: PromptOptions = {
preamble: "You are an assistant that outputs only OpenUI Lang.",
Expand Down
2 changes: 1 addition & 1 deletion docs/imports/YouRegisterComponents-43-365.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default function YouRegisterComponents() {
<p className="absolute font-['Andale_Mono:Regular',sans-serif] h-[262px] leading-none left-[73px] not-italic text-[10px] text-white top-[71px] w-[254px] whitespace-pre-wrap">{`
import { z } from "zod"
import { Carousel, CarouselCard } from "components/Carousel"
import { defineComponent, createLibrary } from "@openuidev/lang-react"
import { defineComponent, createLibrary } from "@openuidev/react-lang"

const CarouselCard = defineComponent({
name: "CarouselCard",
Expand Down
2 changes: 1 addition & 1 deletion docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const withMDX = createMDX();
/** @type {import('next').NextConfig} */
const config = {
serverExternalPackages: ["@takumi-rs/image-response"],
transpilePackages: ["@openuidev/react-ui", "@openuidev/lang-react"],
transpilePackages: ["@openuidev/react-ui", "@openuidev/react-lang"],
turbopack: {
root: dirname(dirname(__dirname)),
},
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"format:check": "prettier --check ."
},
"dependencies": {
"@openuidev/lang-react": "workspace:^",
"@openuidev/react-lang": "workspace:^",
"@openuidev/react-headless": "workspace:^",
"@openuidev/react-ui": "workspace:^",
"@takumi-rs/image-response": "^0.68.17",
Expand Down
2 changes: 1 addition & 1 deletion examples/openui-chat/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { NextConfig } from "next";

const nextConfig: NextConfig = {
turbopack: {},
transpilePackages: ["@openuidev/react-ui", "@openuidev/react-headless", "@openuidev/lang-react"],
transpilePackages: ["@openuidev/react-ui", "@openuidev/react-headless", "@openuidev/react-lang"],
};

export default nextConfig;
2 changes: 1 addition & 1 deletion examples/openui-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@openuidev/react-ui": "workspace:*",
"@openuidev/react-headless": "workspace:*",
"@openuidev/lang-react": "workspace:*",
"@openuidev/react-lang": "workspace:*",
"lucide-react": "^0.575.0",
"next": "16.1.6",
"openai": "^6.22.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/openui-cli/src/templates/openui-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@openuidev/react-ui": "latest",
"@openuidev/react-headless": "latest",
"@openuidev/lang-react": "latest",
"@openuidev/react-lang": "latest",
"next": "16.1.6",
"openai": "^6.22.0",
"react": "19.2.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-headless/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pnpm --filter @openuidev/react-headless run ci # lint:check + format:check
pnpm build && pnpm test
```

Build order: **`react-headless`** → `lang-react` → `react-ui`. This package has no upstream workspace deps (only `@ag-ui/core` from npm), so it can always build independently.
Build order: **`react-headless`** → `react-lang` → `react-ui`. This package has no upstream workspace deps (only `@ag-ui/core` from npm), so it can always build independently.

## File Map

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# @openuidev/lang-react
# @openuidev/react-lang

React renderer for OpenUI Lang.

## Install

```bash
pnpm add @openuidev/lang-react
pnpm add @openuidev/react-lang
```

## Docs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openuidev/lang-react",
"version": "0.1.1",
"name": "@openuidev/react-lang",
"version": "0.1.2",
"description": "OpenUI-lang renderer and standard library for React",
"license": "MIT",
"type": "module",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"ci": "pnpm run lint:check && pnpm run format:check"
},
"peerDependencies": {
"@openuidev/lang-react": "workspace:^",
"@openuidev/react-lang": "workspace:^",
"@openuidev/react-headless": "workspace:^",
"react": ">=19.0.0",
"react-dom": ">=19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";

import type { ActionEvent, Library } from "@openuidev/lang-react";
import { BuiltinActionType, Renderer } from "@openuidev/lang-react";
import type { AssistantMessage, ToolMessage } from "@openuidev/react-headless";
import { useThread } from "@openuidev/react-headless";
import type { ActionEvent, Library } from "@openuidev/react-lang";
import { BuiltinActionType, Renderer } from "@openuidev/react-lang";
import { useCallback, useMemo } from "react";
import { separateContentAndContext, wrapContent, wrapContext } from "../../utils/contentParser";
import { AssistantMessageContainer } from "../Shell";
Expand Down
4 changes: 2 additions & 2 deletions packages/react-ui/src/components/OpenUIChat/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Library } from "@openuidev/lang-react";
import type { AssistantMessage, UserMessage } from "@openuidev/react-headless";
import type { Library } from "@openuidev/react-lang";
import { ReactNode } from "react";
import { ScrollVariant } from "../../hooks/useScrollToBottom";
import { ConversationStarterProps } from "../../types/ConversationStarter";
Expand Down Expand Up @@ -132,7 +132,7 @@ export interface SharedChatUIProps {
userMessage?: UserMessageComponent;
composer?: ComposerComponent;
/**
* Component library created via `createLibrary()` from `@openuidev/lang-react`.
* Component library created via `createLibrary()` from `@openuidev/react-lang`.
* When provided, assistant messages are rendered using the GenUI `Renderer`
* instead of the default markdown renderer. If `assistantMessage` is also
* provided, `assistantMessage` takes priority.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Library } from "@openuidev/lang-react";
import type { AssistantMessage, ChatProviderProps, UserMessage } from "@openuidev/react-headless";
import { ChatProvider } from "@openuidev/react-headless";
import type { Library } from "@openuidev/react-lang";
import { useMemo } from "react";
import { ThemeProps, ThemeProvider } from "../ThemeProvider";
import { GenUIAssistantMessage } from "./GenUIAssistantMessage";
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/src/genui-lib/Accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import { defineComponent } from "@openuidev/lang-react";
import { defineComponent } from "@openuidev/react-lang";
import React from "react";
import { z } from "zod";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/src/genui-lib/Action/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BuiltinActionType } from "@openuidev/lang-react";
import { BuiltinActionType } from "@openuidev/react-lang";
import { z } from "zod";

const continueConversationAction = z.object({
Expand Down
Loading