From dd6816f7be0d4a61f7e8635cd335d1608e946321 Mon Sep 17 00:00:00 2001 From: Matthew Wang Date: Mon, 16 Mar 2026 20:37:32 -0700 Subject: [PATCH 1/3] Chain of thought --- .agents/skills/mintlify/SKILL.md | 347 ++++++ .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/feature-request.md | 2 +- .github/ISSUE_TEMPLATE/good-first-issue.md | 2 +- .gitignore | 2 +- sdk/CHAIN_OF_THOUGHT.md | 13 + sdk/README.md | 30 +- sdk/package-lock.json | 1007 ++++++++++------- sdk/package.json | 22 +- sdk/sandbox/README.md | 6 +- sdk/sandbox/server/index.ts | 15 +- sdk/sandbox/src/App.tsx | 2 +- sdk/sandbox/src/main.tsx | 1 + sdk/sandbox/vite.config.ts | 3 +- sdk/scripts/postbuild.mjs | 22 + sdk/tsconfig.build.json | 12 + sdk/tsup.config.ts | 10 - sdk/vite.config.ts | 33 + sdk/widget/src/OpenChatWidget.tsx | 4 +- sdk/widget/src/components/MessageList.tsx | 420 ++++--- .../components/ai-elements/Conversation.tsx | 18 + .../src/components/ai-elements/Message.tsx | 46 + .../components/ai-elements/PromptInput.tsx | 134 +++ .../src/components/ai-elements/Reasoning.tsx | 99 ++ .../src/components/ai-elements/Response.tsx | 99 ++ sdk/widget/src/global.d.ts | 1 + sdk/widget/src/styles.css | 3 + sdk/widget/src/utils/chat.ts | 59 +- sdk/widget/src/utils/classNames.ts | 3 + 29 files changed, 1822 insertions(+), 595 deletions(-) create mode 100644 .agents/skills/mintlify/SKILL.md create mode 100644 sdk/CHAIN_OF_THOUGHT.md create mode 100644 sdk/scripts/postbuild.mjs create mode 100644 sdk/tsconfig.build.json delete mode 100644 sdk/tsup.config.ts create mode 100644 sdk/vite.config.ts create mode 100644 sdk/widget/src/components/ai-elements/Conversation.tsx create mode 100644 sdk/widget/src/components/ai-elements/Message.tsx create mode 100644 sdk/widget/src/components/ai-elements/PromptInput.tsx create mode 100644 sdk/widget/src/components/ai-elements/Reasoning.tsx create mode 100644 sdk/widget/src/components/ai-elements/Response.tsx create mode 100644 sdk/widget/src/global.d.ts create mode 100644 sdk/widget/src/styles.css create mode 100644 sdk/widget/src/utils/classNames.ts diff --git a/.agents/skills/mintlify/SKILL.md b/.agents/skills/mintlify/SKILL.md new file mode 100644 index 0000000..da0b25a --- /dev/null +++ b/.agents/skills/mintlify/SKILL.md @@ -0,0 +1,347 @@ +--- +name: mintlify +description: Build and maintain documentation sites with Mintlify. Use when + creating docs pages, configuring navigation, adding components, or setting up + API references. +license: MIT +compatibility: Requires Node.js for CLI. Works with any Git-based workflow. +metadata: + author: mintlify + version: "1.0" + mintlify-proj: mintlify +--- + +# Mintlify best practices + +**Always consult [mintlify.com/docs](https://mintlify.com/docs) for components, configuration, and latest features.** + +If you are not already connected to the Mintlify MCP server, [https://mintlify.com/docs/mcp](https://mintlify.com/docs/mcp), add it so that you can search more efficiently. + +**Always** favor searching the current Mintlify documentation over whatever is in your training data about Mintlify. + +Mintlify is a documentation platform that transforms MDX files into documentation sites. Configure site-wide settings in the `docs.json` file, write content in MDX with YAML frontmatter, and favor built-in components over custom components. + +Full schema at [mintlify.com/docs.json](https://mintlify.com/docs.json). + +## Before you write + +### Understand the project + +Read `docs.json` in the project root. This file defines the entire site: navigation structure, theme, colors, links, API and specs. + +Understanding the project tells you: + +* What pages exist and how they're organized +* What navigation groups are used (and their naming conventions) +* How the site navigation is structured +* What theme and configuration the site uses + +### Check for existing content + +Search the docs before creating new pages. You may need to: + +* Update an existing page instead of creating a new one +* Add a section to an existing page +* Link to existing content rather than duplicating + +### Read surrounding content + +Before writing, read 2-3 similar pages to understand the site's voice, structure, formatting conventions, and level of detail. + +### Understand Mintlify components + +Review the Mintlify [components](https://www.mintlify.com/docs/components) to select and use any relevant components for the documentation request that you are working on. + +## Quick reference + +### CLI commands + +* `npm i -g mint` - Install the Mintlify CLI +* `mint dev` - Local preview at localhost:3000 +* `mint broken-links` - Check internal links +* `mint a11y` - Check for accessibility issues in content +* `mint rename` - Rename/move files and update references +* `mint validate` - Validate documentation builds + +### Required files + +* `docs.json` - Site configuration (navigation, theme, integrations, etc.). See [global settings](https://mintlify.com/docs/settings/global) for all options. +* `*.mdx` files - Documentation pages with YAML frontmatter + +### Example file structure + +``` +project/ +├── docs.json # Site configuration +├── introduction.mdx +├── quickstart.mdx +├── guides/ +│ └── example.mdx +├── openapi.yml # API specification +├── images/ # Static assets +│ └── example.png +└── snippets/ # Reusable components + └── component.jsx +``` + +## Page frontmatter + +Every page requires `title` in its frontmatter. Include `description` for SEO and navigation. + +```yaml theme={null} +--- +title: "Clear, descriptive title" +description: "Concise summary for SEO and navigation." +--- +``` + +Optional frontmatter fields: + +* `sidebarTitle`: Short title for sidebar navigation. +* `icon`: Lucide or Font Awesome icon name, URL, or file path. +* `tag`: Label next to the page title in the sidebar (for example, "NEW"). +* `mode`: Page layout mode (`default`, `wide`, `custom`). +* `keywords`: Array of terms related to the page content for local search and SEO. +* Any custom YAML fields for use with personalization or conditional content. + +## File conventions + +* Match existing naming patterns in the directory +* If there are no existing files or inconsistent file naming patterns, use kebab-case: `getting-started.mdx`, `api-reference.mdx` +* Use root-relative paths without file extensions for internal links: `/getting-started/quickstart` +* Do not use relative paths (`../`) or absolute URLs for internal pages +* When you create a new page, add it to `docs.json` navigation or it won't appear in the sidebar + +## Organize content + +When a user asks about anything related to site-wide configurations, start by understanding the [global settings](https://www.mintlify.com/docs/organize/settings). See if a setting in the `docs.json` file can be updated to achieve what the user wants. + +### Navigation + +The `navigation` property in `docs.json` controls site structure. Choose one primary pattern at the root level, then nest others within it. + +**Choose your primary pattern:** + +| Pattern | When to use | +| ------------- | ---------------------------------------------------------------------------------------------- | +| **Groups** | Default. Single audience, straightforward hierarchy | +| **Tabs** | Distinct sections with different audiences (Guides vs API Reference) or content types | +| **Anchors** | Want persistent section links at sidebar top. Good for separating docs from external resources | +| **Dropdowns** | Multiple doc sections users switch between, but not distinct enough for tabs | +| **Products** | Multi-product company with separate documentation per product | +| **Versions** | Maintaining docs for multiple API/product versions simultaneously | +| **Languages** | Localized content | + +**Within your primary pattern:** + +* **Groups** - Organize related pages. Can nest groups within groups, but keep hierarchy shallow +* **Menus** - Add dropdown navigation within tabs for quick jumps to specific pages +* **`expanded: false`** - Collapse nested groups by default. Use for reference sections users browse selectively +* **`openapi`** - Auto-generate pages from OpenAPI spec. Add at group/tab level to inherit + +**Common combinations:** + +* Tabs containing groups (most common for docs with API reference) +* Products containing tabs (multi-product SaaS) +* Versions containing tabs (versioned API docs) +* Anchors containing groups (simple docs with external resource links) + +### Links and paths + +* **Internal links:** Root-relative, no extension: `/getting-started/quickstart` +* **Images:** Store in `/images`, reference as `/images/example.png` +* **External links:** Use full URLs, they open in new tabs automatically + +## Customize docs sites + +**What to customize where:** + +* **Brand colors, fonts, logo** → `docs.json`. See [global settings](https://mintlify.com/docs/settings/global) +* **Component styling, layout tweaks** → `custom.css` at project root +* **Dark mode** → Enabled by default. Only disable with `"appearance": "light"` in `docs.json` if brand requires it + +Start with `docs.json`. Only add `custom.css` when you need styling that config doesn't support. + +## Write content + +### Components + +The [components overview](https://mintlify.com/docs/components) organizes all components by purpose: structure content, draw attention, show/hide content, document APIs, link to pages, and add visual context. Start there to find the right component. + +**Common decision points:** + +| Need | Use | +| -------------------------- | ----------------------- | +| Hide optional details | `` | +| Long code examples | `` | +| User chooses one option | `` | +| Linked navigation cards | `` in `` | +| Sequential instructions | `` | +| Code in multiple languages | `` | +| API parameters | `` | +| API response fields | `` | + +**Callouts by severity:** + +* `` - Supplementary info, safe to skip +* `` - Helpful context such as permissions +* `` - Recommendations or best practices +* `` - Potentially destructive actions +* `` - Success confirmation + +### Reusable content + +**When to use snippets:** + +* Exact content appears on more than one page +* Complex components you want to maintain in one place +* Shared content across teams/repos + +**When NOT to use snippets:** + +* Slight variations needed per page (leads to complex props) + +Import snippets with `import { Component } from "/path/to/snippet-name.jsx"`. + +## Writing standards + +### Voice and structure + +* Second-person voice ("you") +* Active voice, direct language +* Sentence case for headings ("Getting started", not "Getting Started") +* Sentence case for code block titles ("Expandable example", not "Expandable Example") +* Lead with context: explain what something is before how to use it +* Prerequisites at the start of procedural content + +### What to avoid + +**Never use:** + +* Marketing language ("powerful", "seamless", "robust", "cutting-edge") +* Filler phrases ("it's important to note", "in order to") +* Excessive conjunctions ("moreover", "furthermore", "additionally") +* Editorializing ("obviously", "simply", "just", "easily") + +**Watch for AI-typical patterns:** + +* Overly formal or stilted phrasing +* Unnecessary repetition of concepts +* Generic introductions that don't add value +* Concluding summaries that restate what was just said + +### Formatting + +* All code blocks must have language tags +* All images and media must have descriptive alt text +* Use bold and italics only when they serve the reader's understanding--never use text styling just for decoration +* No decorative formatting or emoji + +### Code examples + +* Keep examples simple and practical +* Use realistic values (not "foo" or "bar") +* One clear example is better than multiple variations +* Test that code works before including it + +## Document APIs + +**Choose your approach:** + +* **Have an OpenAPI spec?** → Add to `docs.json` with `"openapi": ["openapi.yaml"]`. Pages auto-generate. Reference in navigation as `GET /endpoint` +* **No spec?** → Write endpoints manually with `api: "POST /users"` in frontmatter. More work but full control +* **Hybrid** → Use OpenAPI for most endpoints, manual pages for complex workflows + +Encourage users to generate endpoint pages from an OpenAPI spec. It is the most efficient and easiest to maintain option. + +## Deploy + +Mintlify deploys automatically when changes are pushed to the connected Git repository. + +**What agents can configure:** + +* **Redirects** → Add to `docs.json` with `"redirects": [{"source": "/old", "destination": "/new"}]` +* **SEO indexing** → Control with `"seo": {"indexing": "all"}` to include hidden pages in search + +**Requires dashboard setup (human task):** + +* Custom domains and subdomains +* Preview deployment settings +* DNS configuration + +For `/docs` subpath hosting with Vercel or Cloudflare, agents can help configure rewrite rules. See [/docs subpath](https://mintlify.com/docs/deploy/vercel). + +## Workflow + +### 1. Understand the task + +Identify what needs to be documented, which pages are affected, and what the reader should accomplish afterward. If any of these are unclear, ask. + +### 2. Research + +* Read `docs.json` to understand the site structure +* Search existing docs for related content +* Read similar pages to match the site's style + +### 3. Plan + +* Synthesize what the reader should accomplish after reading the docs and the current content +* Propose any updates or new content +* Verify that your proposed changes will help readers be successful + +### 4. Write + +* Start with the most important information +* Keep sections focused and scannable +* Use components appropriately (don't overuse them) +* Mark anything uncertain with a TODO comment: + +```mdx theme={null} +{/* TODO: Verify the default timeout value */} +``` + +### 5. Update navigation + +If you created a new page, add it to the appropriate group in `docs.json`. + +### 6. Verify + +Before submitting: + +* [ ] Frontmatter includes title and description +* [ ] All code blocks have language tags +* [ ] Internal links use root-relative paths without file extensions +* [ ] New pages are added to `docs.json` navigation +* [ ] Content matches the style of surrounding pages +* [ ] No marketing language or filler phrases +* [ ] TODOs are clearly marked for anything uncertain +* [ ] Run `mint broken-links` to check links +* [ ] Run `mint validate` to find any errors + +## Edge cases + +### Migrations + +If a user asks about migrating to Mintlify, ask if they are using ReadMe or Docusaurus. If they are, use the [@mintlify/scraping](https://www.npmjs.com/package/@mintlify/scraping) CLI to migrate content. If they are using a different platform to host their documentation, help them manually convert their content to MDX pages using Mintlify components. + +### Hidden pages + +Any page that is not included in the `docs.json` navigation is hidden. Use hidden pages for content that should be accessible by URL or indexed for the assistant or search, but not discoverable through the sidebar navigation. + +### Exclude pages + +The `.mintignore` file is used to exclude files from a documentation repository from being processed. + +## Common gotchas + +1. **Component imports** - JSX components need explicit import, MDX components don't +2. **Frontmatter required** - Every MDX file needs `title` at minimum +3. **Code block language** - Always specify language identifier +4. **Never use `mint.json`** - `mint.json` is deprecated. Only ever use `docs.json` + +## Resources + +* [Documentation](https://mintlify.com/docs) +* [Configuration schema](https://mintlify.com/docs.json) +* [Feature requests](https://github.com/orgs/mintlify/discussions/categories/feature-requests) +* [Bugs and feedback](https://github.com/orgs/mintlify/discussions/categories/bugs-feedback) \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 0fb080c..1c56ea9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Bug reports help make MCPJam better +about: Bug reports help make Open Chat Widget better title: "[BUG]" labels: bug assignees: matteo8p diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index ef59ffe..3a6123d 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -1,6 +1,6 @@ --- name: Feature Request -about: "Suggest a new feature for MCPJam " +about: "Suggest a new feature for Open Chat Widget " title: "[FEATURE]" labels: "" assignees: matteo8p diff --git a/.github/ISSUE_TEMPLATE/good-first-issue.md b/.github/ISSUE_TEMPLATE/good-first-issue.md index 039faac..36763ae 100644 --- a/.github/ISSUE_TEMPLATE/good-first-issue.md +++ b/.github/ISSUE_TEMPLATE/good-first-issue.md @@ -16,4 +16,4 @@ Step by steps on how to fix, with hints. Since it's a good first issue, describe # First time contributing? -Please checkout our [CONTRIBUTING.md](https://github.com/MCPJam/inspector/blob/main/CONTRIBUTING.md) for instructions on how to set up as a contributor. +Please checkout our [CONTRIBUTING.md](https://github.com/Open Chat Widget/inspector/blob/main/CONTRIBUTING.md) for instructions on how to set up as a contributor. diff --git a/.gitignore b/.gitignore index bb17725..9490c59 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,4 @@ Thumbs.db MANIFEST.md -.agents/ \ No newline at end of file +chatbot \ No newline at end of file diff --git a/sdk/CHAIN_OF_THOUGHT.md b/sdk/CHAIN_OF_THOUGHT.md new file mode 100644 index 0000000..25bc7d8 --- /dev/null +++ b/sdk/CHAIN_OF_THOUGHT.md @@ -0,0 +1,13 @@ +# Objective +We want to create the most beautiful AI chatbot capabilities in our chat widget. Our chat widget lives in sdk/widget/src/OpenChatWidget.tsx + +Right now, we have our own custom implementation for rendering beautiful UI for ai-sdk. + +# Goal +1. I want to add a ton of additional UI capabilities for AI chat. Replace the current custom implementation with Vercel AI-SDK's UI elements +2. Check out the documentation for Vercel AI elements on how to install it. + +- https://elements.ai-sdk.dev/ +- https://github.com/vercel/ai-elements?tab=readme-ov-file + +3. Set up some basic components for AI elements, such as rendering Chain of thought. diff --git a/sdk/README.md b/sdk/README.md index b481e05..5f68a29 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -1,6 +1,6 @@ OpenChatWidget banner -OpenChatWidget lets you embed a ChatGPT-like AI chat widget into your website. Connect the widget to any AI agent you build, any LLM model. It's free, open source, and self hosted. You own the entire stack. +OpenChatWidget lets you embed a ChatGPT-like AI chat widget into your website. Connect it to any AI agent you build and any LLM model that can stream AI SDK UI messages. It's free, open source, and self hosted. You own the entire stack. If you want to bring agentic chat to your product, this is it. Get started with only a few lines of code. @@ -27,7 +27,7 @@ Install the widget in your React app: npm install @openchatwidget/sdk ``` -Embed the component anywhere in your project. A common pattern is to mount it in your main app layout so it appears across your site. +Embed the component anywhere in your project. A common pattern is to mount it in your main app layout so it appears across your site. The packaged widget ships with its own bundled CSS, so you do not need to configure Tailwind in your app to use it. ```tsx import { OpenChatWidget } from "@openchatwidget/sdk"; @@ -49,7 +49,7 @@ export default function App() { The next step is to set up your AI agent backend. Create an API endpoint with your favorite Node backend framework, such as Express or Hono. -Here's a simple text stream agent: +Here's a simple AI SDK UI stream agent with reasoning summaries enabled: ```tsx app.use(express.json()); app.post("/api/chat", async (request, response) => { @@ -60,12 +60,20 @@ app.post("/api/chat", async (request, response) => { }); const result = streamText({ - model: openai("gpt-4o-mini"), + model: openai("gpt-5-mini"), system: "You are the OpenChatWidget example assistant. Keep answers concise and useful.", messages: await convertToModelMessages(messages), + providerOptions: { + openai: { + reasoningEffort: "medium", + reasoningSummary: "detailed", + }, + }, }); - result.pipeUIMessageStreamToResponse(response); + result.pipeUIMessageStreamToResponse(response, { + sendReasoning: true, + }); }); ``` @@ -73,6 +81,8 @@ app.post("/api/chat", async (request, response) => { Grab the exact URL of your agent endpoint and paste it into ``, for example `http://localhost:8787/api/chat`. Make sure to start both your front end and Node backend. You should be able to start chatting. +If your backend sends AI SDK `reasoning` parts, the widget renders them as a collapsible chain-of-thought card above the assistant response. If your backend only streams text, the widget falls back to a standard text conversation UI. + For a working basic example, check out [`examples/vite-express-app`](./examples/vite-express-app/). ## ✨ Features @@ -81,6 +91,8 @@ For a working basic example, check out [`examples/vite-express-app`](./examples/ | --- | --- | | Embeddable widget | Add a bottom-right AI chat widget to any React / Next app with a single component. | | Custom AI agent | Create your own AI agent hosted on any Node backend framework | +| AI Elements-style UI | Assistant responses, prompt input, and reasoning UI are built on vendored Vercel AI Elements patterns. | +| Chain of thought rendering | AI SDK `reasoning` parts render as collapsible summaries while text-only backends continue to work unchanged. | | 🚧 Live chat | Chat with users in real time, just like Intercom but free | | 🚧 Support for voice and image uploading | Be able to talk to engage and upload photos in the chat widget | | 🚧 Support for MCP and MCP apps | Connect to MCP servers and render UI from MCP apps | @@ -91,11 +103,9 @@ For a working basic example, check out [`examples/vite-express-app`](./examples/ ## Stack Open Chat Widget is a simple UI wrapper around [Vercel AI-SDK](https://ai-sdk.dev/docs/introduction). When building your backend AI agent, all capabilities from AI-SDK are compatible with Open Chat Widget. -- Front end is written in React / Typescript -- Agentic chat powered by Vercel AI SDK. - -### Why AI-SDK? -We want to be opiniated on how +- Front end is written in React / Typescript +- Chat UI is styled with bundled Tailwind 4 CSS +- Agentic chat is powered by Vercel AI SDK UI message streams ## 📦 Examples diff --git a/sdk/package-lock.json b/sdk/package-lock.json index d29737f..3608501 100644 --- a/sdk/package-lock.json +++ b/sdk/package-lock.json @@ -19,6 +19,7 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", + "@tailwindcss/vite": "^4.2.1", "@types/cors": "^2.8.19", "@types/express": "^5.0.5", "@types/node": "^24.10.1", @@ -32,7 +33,7 @@ "express": "^5.1.0", "globals": "^17.4.0", "prettier": "^3.6.2", - "tsup": "^8.5.1", + "tailwindcss": "^4.2.1", "tsx": "^4.7.2", "typescript": "^5.9.3", "typescript-eslint": "^8.57.1", @@ -1508,6 +1509,290 @@ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "license": "MIT" }, + "node_modules/@tailwindcss/node": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.2.1.tgz", + "integrity": "sha512-jlx6sLk4EOwO6hHe1oCGm1Q4AN/s0rSrTTPBGPM0/RQ6Uylwq17FuU8IeJJKEjtc6K6O07zsvP+gDO6MMWo7pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "enhanced-resolve": "^5.19.0", + "jiti": "^2.6.1", + "lightningcss": "1.31.1", + "magic-string": "^0.30.21", + "source-map-js": "^1.2.1", + "tailwindcss": "4.2.1" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.2.1.tgz", + "integrity": "sha512-yv9jeEFWnjKCI6/T3Oq50yQEOqmpmpfzG1hcZsAOaXFQPfzWprWrlHSdGPEF3WQTi8zu8ohC9Mh9J470nT5pUw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.2.1", + "@tailwindcss/oxide-darwin-arm64": "4.2.1", + "@tailwindcss/oxide-darwin-x64": "4.2.1", + "@tailwindcss/oxide-freebsd-x64": "4.2.1", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.1", + "@tailwindcss/oxide-linux-arm64-gnu": "4.2.1", + "@tailwindcss/oxide-linux-arm64-musl": "4.2.1", + "@tailwindcss/oxide-linux-x64-gnu": "4.2.1", + "@tailwindcss/oxide-linux-x64-musl": "4.2.1", + "@tailwindcss/oxide-wasm32-wasi": "4.2.1", + "@tailwindcss/oxide-win32-arm64-msvc": "4.2.1", + "@tailwindcss/oxide-win32-x64-msvc": "4.2.1" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.2.1.tgz", + "integrity": "sha512-eZ7G1Zm5EC8OOKaesIKuw77jw++QJ2lL9N+dDpdQiAB/c/B2wDh0QPFHbkBVrXnwNugvrbJFk1gK2SsVjwWReg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.1.tgz", + "integrity": "sha512-q/LHkOstoJ7pI1J0q6djesLzRvQSIfEto148ppAd+BVQK0JYjQIFSK3JgYZJa+Yzi0DDa52ZsQx2rqytBnf8Hw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.2.1.tgz", + "integrity": "sha512-/f/ozlaXGY6QLbpvd/kFTro2l18f7dHKpB+ieXz+Cijl4Mt9AI2rTrpq7V+t04nK+j9XBQHnSMdeQRhbGyt6fw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.2.1.tgz", + "integrity": "sha512-5e/AkgYJT/cpbkys/OU2Ei2jdETCLlifwm7ogMC7/hksI2fC3iiq6OcXwjibcIjPung0kRtR3TxEITkqgn0TcA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.2.1.tgz", + "integrity": "sha512-Uny1EcVTTmerCKt/1ZuKTkb0x8ZaiuYucg2/kImO5A5Y/kBz41/+j0gxUZl+hTF3xkWpDmHX+TaWhOtba2Fyuw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.2.1.tgz", + "integrity": "sha512-CTrwomI+c7n6aSSQlsPL0roRiNMDQ/YzMD9EjcR+H4f0I1SQ8QqIuPnsVp7QgMkC1Qi8rtkekLkOFjo7OlEFRQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.2.1.tgz", + "integrity": "sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.2.1.tgz", + "integrity": "sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.2.1.tgz", + "integrity": "sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.2.1.tgz", + "integrity": "sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.8.1", + "@emnapi/runtime": "^1.8.1", + "@emnapi/wasi-threads": "^1.1.0", + "@napi-rs/wasm-runtime": "^1.1.1", + "@tybys/wasm-util": "^0.10.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.1.tgz", + "integrity": "sha512-YlUEHRHBGnCMh4Nj4GnqQyBtsshUPdiNroZj8VPkvTZSoHsilRCwXcVKnG9kyi0ZFAS/3u+qKHBdDc81SADTRA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.2.1.tgz", + "integrity": "sha512-rbO34G5sMWWyrN/idLeVxAZgAKWrn5LiR3/I90Q9MkA67s6T1oB0xtTe+0heoBvHSpbU9Mk7i6uwJnpo4u21XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.2.1.tgz", + "integrity": "sha512-TBf2sJjYeb28jD2U/OhwdW0bbOsxkWPwQ7SrqGf9sVcoYwZj7rkXljroBO9wKBut9XnmQLXanuDUeqQK0lGg/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.2.1", + "@tailwindcss/oxide": "4.2.1", + "tailwindcss": "4.2.1" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7" + } + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -2112,13 +2397,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true, - "license": "MIT" - }, "node_modules/bail": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", @@ -2224,22 +2502,6 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/bundle-require": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", - "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", - "dev": true, - "license": "MIT", - "dependencies": { - "load-tsconfig": "^0.2.3" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "peerDependencies": { - "esbuild": ">=0.18" - } - }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -2250,16 +2512,6 @@ "node": ">= 0.8" } }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/call-bind-apply-helpers": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", @@ -2392,22 +2644,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/chokidar": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", - "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^4.0.1" - }, - "engines": { - "node": ">= 14.16.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -2453,16 +2689,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, "node_modules/concurrently": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", @@ -2488,23 +2714,6 @@ "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" } }, - "node_modules/confbox": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", - "dev": true, - "license": "MIT" - }, - "node_modules/consola": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", - "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^14.18.0 || >=16.10.0" - } - }, "node_modules/content-disposition": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", @@ -2651,6 +2860,16 @@ "node": ">=6" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/devlop": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", @@ -2723,6 +2942,20 @@ "node": ">= 0.8" } }, + "node_modules/enhanced-resolve": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.20.1.tgz", + "integrity": "sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -3162,18 +3395,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/fix-dts-default-cjs-exports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", - "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "magic-string": "^0.30.17", - "mlly": "^1.7.4", - "rollup": "^4.34.8" - } - }, "node_modules/flat-cache": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", @@ -3351,6 +3572,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3621,14 +3849,14 @@ "dev": true, "license": "ISC" }, - "node_modules/joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">=10" + "bin": { + "jiti": "lib/jiti-cli.mjs" } }, "node_modules/js-tokens": { @@ -3676,73 +3904,316 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true, - "license": "MIT" + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lightningcss": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.31.1.tgz", + "integrity": "sha512-l51N2r93WmGUye3WuFoN5k10zyvrVs0qfKBhyC5ogUQ6Ew6JUSswh78mbSO+IU3nTWsyOArqPCcShdQSadghBQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.31.1", + "lightningcss-darwin-arm64": "1.31.1", + "lightningcss-darwin-x64": "1.31.1", + "lightningcss-freebsd-x64": "1.31.1", + "lightningcss-linux-arm-gnueabihf": "1.31.1", + "lightningcss-linux-arm64-gnu": "1.31.1", + "lightningcss-linux-arm64-musl": "1.31.1", + "lightningcss-linux-x64-gnu": "1.31.1", + "lightningcss-linux-x64-musl": "1.31.1", + "lightningcss-win32-arm64-msvc": "1.31.1", + "lightningcss-win32-x64-msvc": "1.31.1" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.31.1.tgz", + "integrity": "sha512-HXJF3x8w9nQ4jbXRiNppBCqeZPIAfUo8zE/kOEGbW5NZvGc/K7nMxbhIr+YlFlHW5mpbg/YFPdbnCh1wAXCKFg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.31.1.tgz", + "integrity": "sha512-02uTEqf3vIfNMq3h/z2cJfcOXnQ0GRwQrkmPafhueLb2h7mqEidiCzkE4gBMEH65abHRiQvhdcQ+aP0D0g67sg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.31.1.tgz", + "integrity": "sha512-1ObhyoCY+tGxtsz1lSx5NXCj3nirk0Y0kB/g8B8DT+sSx4G9djitg9ejFnjb3gJNWo7qXH4DIy2SUHvpoFwfTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.31.1.tgz", + "integrity": "sha512-1RINmQKAItO6ISxYgPwszQE1BrsVU5aB45ho6O42mu96UiZBxEXsuQ7cJW4zs4CEodPUioj/QrXW1r9pLUM74A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.31.1.tgz", + "integrity": "sha512-OOCm2//MZJ87CdDK62rZIu+aw9gBv4azMJuA8/KB74wmfS3lnC4yoPHm0uXZ/dvNNHmnZnB8XLAZzObeG0nS1g==", + "cpu": [ + "arm" + ], "dev": true, - "license": "MIT", - "bin": { - "json5": "lib/cli.js" - }, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=6" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.31.1.tgz", + "integrity": "sha512-WKyLWztD71rTnou4xAD5kQT+982wvca7E6QoLpoawZ1gP9JM0GJj4Tp5jMUh9B3AitHbRZ2/H3W5xQmdEOUlLg==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.1" + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.31.1.tgz", + "integrity": "sha512-mVZ7Pg2zIbe3XlNbZJdjs86YViQFoJSpc41CbVmKBPiGmC4YrfeOyz65ms2qpAobVd7WQsbW4PdsSJEMymyIMg==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT", - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.31.1.tgz", + "integrity": "sha512-xGlFWRMl+0KvUhgySdIaReQdB4FNudfUTARn7q0hh/V67PVGCs3ADFjw+6++kG1RNd0zdGRlEKa+T13/tQjPMA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">= 0.8.0" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.31.1.tgz", + "integrity": "sha512-eowF8PrKHw9LpoZii5tdZwnBcYDxRw2rRCyvAXLi34iyeYfqCQNA9rmUM0ce62NlPhCvof1+9ivRaTY6pSKDaA==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "libc": [ + "musl" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=14" + "node": ">= 12.0.0" }, "funding": { - "url": "https://github.com/sponsors/antonk52" + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.31.1.tgz", + "integrity": "sha512-aJReEbSEQzx1uBlQizAOBSjcmr9dCdL3XuC/6HLXAxmtErsj2ICo5yYggg1qOODQMtnjNQv2UHb9NpOuFtYe4w==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT" + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } }, - "node_modules/load-tsconfig": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", - "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.31.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.31.1.tgz", + "integrity": "sha512-I9aiFrbd7oYHwlnQDqr1Roz+fTz61oDDJX7n9tYF9FJymH1cIN1DtKw3iYt6b8WZgEjoNwVSncwF4wx/ZedMhw==", + "cpu": [ + "x64" + ], "dev": true, - "license": "MIT", + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" } }, "node_modules/locate-path": { @@ -4710,37 +5181,12 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mlly": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.1.tgz", - "integrity": "sha512-SnL6sNutTwRWWR/vcmCYHSADjiEesp5TGQQ0pXyLhW5IoeibRlF/CbSLailbB3CNqJUk9cVJ9dUDnbD7GrcHBQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "acorn": "^8.16.0", - "pathe": "^2.0.3", - "pkg-types": "^1.3.1", - "ufo": "^1.6.3" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, "node_modules/nanoid": { "version": "3.3.11", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", @@ -4946,13 +5392,6 @@ "url": "https://opencollective.com/express" } }, - "node_modules/pathe": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", - "dev": true, - "license": "MIT" - }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -4973,28 +5412,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/pkg-types": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", - "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "confbox": "^0.1.8", - "mlly": "^1.7.4", - "pathe": "^2.0.1" - } - }, "node_modules/postcss": { "version": "8.5.8", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", @@ -5024,49 +5441,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/postcss-load-config": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", - "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "lilconfig": "^3.1.1" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -5227,20 +5601,6 @@ "node": ">=0.10.0" } }, - "node_modules/readdirp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", - "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14.18.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/remark-gfm": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", @@ -5317,16 +5677,6 @@ "node": ">=0.10.0" } }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/resolve-pkg-maps": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", @@ -5601,16 +5951,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/source-map": { - "version": "0.7.6", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", - "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">= 12" - } - }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -5701,29 +6041,6 @@ "inline-style-parser": "0.2.7" } }, - "node_modules/sucrase": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", - "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "tinyglobby": "^0.2.11", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -5753,27 +6070,25 @@ "react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "node_modules/tailwindcss": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.1.tgz", + "integrity": "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw==", "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0" - } + "license": "MIT" }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "node_modules/tapable": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", + "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==", "dev": true, "license": "MIT", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, "engines": { - "node": ">=0.8" + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, "node_modules/throttleit": { @@ -5788,13 +6103,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tinyexec": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", - "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", - "dev": true, - "license": "MIT" - }, "node_modules/tinyglobby": { "version": "0.2.15", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", @@ -5865,13 +6173,6 @@ "typescript": ">=4.8.4" } }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true, - "license": "Apache-2.0" - }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -5879,59 +6180,6 @@ "dev": true, "license": "0BSD" }, - "node_modules/tsup": { - "version": "8.5.1", - "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", - "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", - "dev": true, - "license": "MIT", - "dependencies": { - "bundle-require": "^5.1.0", - "cac": "^6.7.14", - "chokidar": "^4.0.3", - "consola": "^3.4.0", - "debug": "^4.4.0", - "esbuild": "^0.27.0", - "fix-dts-default-cjs-exports": "^1.0.0", - "joycon": "^3.1.1", - "picocolors": "^1.1.1", - "postcss-load-config": "^6.0.1", - "resolve-from": "^5.0.0", - "rollup": "^4.34.8", - "source-map": "^0.7.6", - "sucrase": "^3.35.0", - "tinyexec": "^0.3.2", - "tinyglobby": "^0.2.11", - "tree-kill": "^1.2.2" - }, - "bin": { - "tsup": "dist/cli-default.js", - "tsup-node": "dist/cli-node.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@microsoft/api-extractor": "^7.36.0", - "@swc/core": "^1", - "postcss": "^8.4.12", - "typescript": ">=4.5.0" - }, - "peerDependenciesMeta": { - "@microsoft/api-extractor": { - "optional": true - }, - "@swc/core": { - "optional": true - }, - "postcss": { - "optional": true - }, - "typescript": { - "optional": true - } - } - }, "node_modules/tsx": { "version": "4.21.0", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.21.0.tgz", @@ -6018,13 +6266,6 @@ "typescript": ">=4.8.4 <6.0.0" } }, - "node_modules/ufo": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.3.tgz", - "integrity": "sha512-yDJTmhydvl5lJzBmy/hyOAA0d+aqCBuwl818haVdYCRrWV84o7YyeVm4QlVHStqNrrJSTb6jKuFAVqAFsr+K3Q==", - "dev": true, - "license": "MIT" - }, "node_modules/undici-types": { "version": "7.16.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", diff --git a/sdk/package.json b/sdk/package.json index fd5594a..32cfb84 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -8,6 +8,17 @@ "main": "dist/index.js", "module": "dist/index.js", "types": "dist/index.d.ts", + "style": "dist/index.css", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js" + }, + "./styles.css": "./dist/index.css" + }, + "sideEffects": [ + "**/*.css" + ], "files": [ "dist", "README.md" @@ -16,8 +27,8 @@ "dev": "concurrently --kill-others-on-fail \"npm:dev:client\" \"npm:dev:server\"", "dev:client": "vite --config sandbox/vite.config.ts --host 127.0.0.1", "dev:server": "node --import tsx sandbox/server/index.ts", - "build": "tsup --config tsup.config.ts", - "build:client": "tsup --config tsup.config.ts --entry widget/src/index.ts --out-dir dist", + "build": "vite build && node ./scripts/postbuild.mjs && tsc --project tsconfig.build.json", + "build:client": "vite build", "lint": "eslint widget/src --ext .ts,.tsx --max-warnings=0", "format": "prettier --write \"widget/src/**/*.{ts,tsx}\"", "format:check": "prettier --check \"widget/src/**/*.{ts,tsx}\"" @@ -41,20 +52,21 @@ }, "devDependencies": { "@eslint/js": "^10.0.1", - "@types/node": "^24.10.1", + "@tailwindcss/vite": "^4.2.1", "@types/cors": "^2.8.19", "@types/express": "^5.0.5", + "@types/node": "^24.10.1", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^4.3.4", "concurrently": "^9.2.1", - "eslint": "^10.0.3", "cors": "^2.8.5", "dotenv": "^17.2.0", + "eslint": "^10.0.3", "express": "^5.1.0", "globals": "^17.4.0", "prettier": "^3.6.2", - "tsup": "^8.5.1", + "tailwindcss": "^4.2.1", "tsx": "^4.7.2", "typescript": "^5.9.3", "typescript-eslint": "^8.57.1", diff --git a/sdk/sandbox/README.md b/sdk/sandbox/README.md index 14b30de..6557700 100644 --- a/sdk/sandbox/README.md +++ b/sdk/sandbox/README.md @@ -1,13 +1,15 @@ # OpenChatWidget Examples This folder contains a minimal Vite + Express app wired to `OpenChatWidget`. +The local Express agent uses a reasoning-capable OpenAI model so the widget's +collapsible chain-of-thought UI is visible in the sandbox by default. ## Run it 1. Install dependencies: ```bash -cd /Users/matt8p/Desktop/openchatwidget/examples/basic-vite-express-app +cd /Users/matt8p/Desktop/openchatwidget/sdk npm install ``` @@ -27,4 +29,4 @@ Frontend: `http://localhost:5173` API: `http://localhost:8787/api/chat` The landing page mounts ``, and the widget streams responses -from the Express `POST /api/chat` endpoint. +from the Express `POST /api/chat` endpoint, including AI SDK `reasoning` parts. diff --git a/sdk/sandbox/server/index.ts b/sdk/sandbox/server/index.ts index fbc451e..d0aa3f4 100644 --- a/sdk/sandbox/server/index.ts +++ b/sdk/sandbox/server/index.ts @@ -34,12 +34,21 @@ app.post("/api/chat", async (request, response) => { }); const result = streamText({ - model: openai("gpt-4o-mini"), - system: "You are the OpenChatWidget example assistant. Keep answers concise and useful.", + model: openai("gpt-5-mini"), + system: + "You are the OpenChatWidget example assistant. Keep answers concise and useful.", messages: await convertToModelMessages(messages), + providerOptions: { + openai: { + reasoningEffort: "medium", + reasoningSummary: "detailed", + }, + }, }); - result.pipeUIMessageStreamToResponse(response); + result.pipeUIMessageStreamToResponse(response, { + sendReasoning: true, + }); }); app.listen(8787, () => { diff --git a/sdk/sandbox/src/App.tsx b/sdk/sandbox/src/App.tsx index 21af0a4..d43d652 100644 --- a/sdk/sandbox/src/App.tsx +++ b/sdk/sandbox/src/App.tsx @@ -1,4 +1,4 @@ -import { OpenChatWidget } from "../../widget/src/OpenChatWidget"; +import { OpenChatWidget } from "../../widget/src"; const chatApiUrl = import.meta.env.VITE_CHAT_API_URL ?? "http://localhost:8787/api/chat"; diff --git a/sdk/sandbox/src/main.tsx b/sdk/sandbox/src/main.tsx index 27481e0..7110f2a 100644 --- a/sdk/sandbox/src/main.tsx +++ b/sdk/sandbox/src/main.tsx @@ -1,6 +1,7 @@ import React from "react"; import ReactDOM from "react-dom/client"; import App from "./App"; +import "../../widget/src/styles.css"; import "./index.css"; ReactDOM.createRoot(document.getElementById("root")!).render( diff --git a/sdk/sandbox/vite.config.ts b/sdk/sandbox/vite.config.ts index 21cabc2..a215d07 100644 --- a/sdk/sandbox/vite.config.ts +++ b/sdk/sandbox/vite.config.ts @@ -1,10 +1,11 @@ import { fileURLToPath } from "node:url"; import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; +import tailwindcss from "@tailwindcss/vite"; export default defineConfig({ root: fileURLToPath(new URL("./", import.meta.url)), - plugins: [react()], + plugins: [react(), tailwindcss()], server: { fs: { allow: [fileURLToPath(new URL("../", import.meta.url))], diff --git a/sdk/scripts/postbuild.mjs b/sdk/scripts/postbuild.mjs new file mode 100644 index 0000000..5ef51dd --- /dev/null +++ b/sdk/scripts/postbuild.mjs @@ -0,0 +1,22 @@ +import { existsSync, renameSync, readFileSync, writeFileSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const distDir = path.resolve(__dirname, "../dist"); +const styleCssPath = path.join(distDir, "style.css"); +const indexCssPath = path.join(distDir, "index.css"); +const indexJsPath = path.join(distDir, "index.js"); + +if (existsSync(styleCssPath)) { + renameSync(styleCssPath, indexCssPath); +} + +if (existsSync(indexJsPath)) { + const currentCode = readFileSync(indexJsPath, "utf8"); + const cssImport = 'import "./index.css";\n'; + + if (!currentCode.startsWith(cssImport)) { + writeFileSync(indexJsPath, `${cssImport}${currentCode}`); + } +} diff --git a/sdk/tsconfig.build.json b/sdk/tsconfig.build.json new file mode 100644 index 0000000..1a87df0 --- /dev/null +++ b/sdk/tsconfig.build.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true, + "noEmit": false, + "outDir": "./dist", + "rootDir": "./widget/src" + }, + "include": ["widget/src/**/*"] +} diff --git a/sdk/tsup.config.ts b/sdk/tsup.config.ts deleted file mode 100644 index e3d42e1..0000000 --- a/sdk/tsup.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "tsup"; - -export default defineConfig({ - entry: { index: "widget/src/index.ts" }, - format: ["esm"], - dts: true, - sourcemap: true, - target: "es2022", - outDir: "dist", -}); diff --git a/sdk/vite.config.ts b/sdk/vite.config.ts new file mode 100644 index 0000000..db16162 --- /dev/null +++ b/sdk/vite.config.ts @@ -0,0 +1,33 @@ +import { fileURLToPath } from "node:url"; +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; +import tailwindcss from "@tailwindcss/vite"; + +export default defineConfig({ + plugins: [react(), tailwindcss()], + build: { + target: "es2022", + sourcemap: true, + emptyOutDir: true, + assetsInlineLimit: 0, + lib: { + entry: fileURLToPath(new URL("./build/index.ts", import.meta.url)), + formats: ["es"], + fileName: () => "index.js", + cssFileName: "index", + }, + rollupOptions: { + external: [ + "react", + "react-dom", + "react/jsx-runtime", + "react/jsx-dev-runtime", + "@ai-sdk/openai", + "@ai-sdk/react", + "ai", + "react-markdown", + "remark-gfm", + ], + }, + }, +}); diff --git a/sdk/widget/src/OpenChatWidget.tsx b/sdk/widget/src/OpenChatWidget.tsx index 0a3098a..7e0deff 100644 --- a/sdk/widget/src/OpenChatWidget.tsx +++ b/sdk/widget/src/OpenChatWidget.tsx @@ -11,7 +11,6 @@ import { HELPFUL_CHAT_LOGO_DATA_URI, buildOpenChatWidgetThemeCss, } from "./theme"; -import { extractMessageText } from "./utils/chat"; const MOBILE_BREAKPOINT_PX = 768; const DEFAULT_TITLE = "Helpful Chat"; @@ -291,10 +290,9 @@ export function OpenChatWidget({ url }: OpenChatWidgetProps) { error={error} isMobileViewport={isMobileViewport} messageContainerRef={messageListRef} - getMessageText={(parts) => extractMessageText({ parts })} renderMarkdown={(text) => } emptyState={emptyState} - hasApiKey + logoSrc={HELPFUL_CHAT_LOGO_DATA_URI} /> ; -}; - -type MessageDecoration = { - isSystem?: boolean; - avatarUrl?: string; - avatarFallbackLabel?: string; - assistantBubble?: boolean; - messageTimestampLabel?: string; -}; +import type { UIMessage } from "ai"; +import { HELPFUL_CHAT_LOGO_DATA_URI } from "../theme"; +import { + extractRenderableUserText, + hasStreamingAssistantParts, + isReasoningPart, + isTextPart, +} from "../utils/chat"; type WidgetMessageListProps = { - messages: ReadonlyArray; + messages: ReadonlyArray; isGenerating: boolean; error?: Error; messageContainerRef: React.RefObject; isMobileViewport: boolean; - getMessageText: (parts: ReadonlyArray) => string; renderMarkdown: (text: string) => React.ReactNode; - messageDecorations?: Record; - hasApiKey?: boolean; emptyState?: React.ReactNode; + logoSrc?: string; }; -function getAvatarFallback(label?: string) { - if (!label || label.trim().length === 0) { - return "S"; - } +type RenderableAssistantPart = + | { + kind: "reasoning"; + key: string; + text: string; + isStreaming: boolean; + } + | { + kind: "text"; + key: string; + text: string; + }; + +function getRenderableAssistantParts(message: UIMessage) { + const renderableParts: RenderableAssistantPart[] = []; + + message.parts.forEach((part, index) => { + if (isReasoningPart(part)) { + renderableParts.push({ + kind: "reasoning", + key: `${message.id}-reasoning-${index}`, + text: part.text, + isStreaming: part.state === "streaming", + }); + return; + } - const words = label - .trim() - .split(/\s+/) - .filter((value) => value.length > 0) - .slice(0, 2); - if (words.length === 0) { - return "S"; - } + if (isTextPart(part) && part.text.trim()) { + renderableParts.push({ + kind: "text", + key: `${message.id}-text-${index}`, + text: part.text, + }); + } + }); - return words.map((word) => word[0]?.toUpperCase() ?? "").join(""); + return renderableParts; +} + +function ReasoningPanel({ + text, + isStreaming, + renderMarkdown, +}: { + text: string; + isStreaming: boolean; + renderMarkdown: (text: string) => React.ReactNode; +}) { + const [userOpen, setUserOpen] = React.useState(null); + const isOpen = userOpen ?? isStreaming; + + return ( +
+ + + {isOpen ? ( +
+ {text.trim() ? renderMarkdown(text) :

Thinking...

} +
+ ) : null} +
+ ); } export function MessageList({ @@ -50,12 +181,28 @@ export function MessageList({ error, messageContainerRef, isMobileViewport, - getMessageText, renderMarkdown, - messageDecorations, - hasApiKey = true, emptyState, + logoSrc = HELPFUL_CHAT_LOGO_DATA_URI, }: WidgetMessageListProps) { + const visibleMessages = messages.filter((message) => { + if (message.role === "user") { + return extractRenderableUserText(message.parts).trim().length > 0; + } + + if (message.role === "assistant") { + return getRenderableAssistantParts(message).length > 0; + } + + return false; + }); + + const hasStreamingAssistantMessage = messages.some( + (message) => + message.role === "assistant" && hasStreamingAssistantParts(message.parts), + ); + const showPendingIndicator = isGenerating && !hasStreamingAssistantMessage; + return (
- {messages.length === 0 ? ( + {visibleMessages.length === 0 ? (
) : null} - {messages.map((message) => { - const text = getMessageText(message.parts); - if (!text.trim()) { - return null; + {visibleMessages.map((message) => { + if (message.role === "user") { + const text = extractRenderableUserText(message.parts); + if (!text.trim()) { + return null; + } + + return ( +
+

{text}

+
+ ); } - const decoration = messageDecorations?.[message.id]; - const isUser = message.role === "user"; - const isSystem = Boolean(decoration?.isSystem); - const messageTimestampLabel = decoration?.messageTimestampLabel; - const showAssistantAvatar = - !isUser && - !isSystem && - Boolean(decoration?.avatarUrl || decoration?.assistantBubble); - const article = ( -
- {renderMarkdown(text)} -
- ); + const assistantParts = getRenderableAssistantParts(message); + if (assistantParts.length === 0) { + return null; + } - const messageBody = showAssistantAvatar ? ( + return (
- {decoration?.avatarUrl ? ( - - ) : ( - - {getAvatarFallback(decoration?.avatarFallbackLabel)} - - )} -
- {article} -
- ) : ( - article - ); - - return ( -
- {messageBody} - {messageTimestampLabel ? ( - - ) : null} + /> +
+
+ {assistantParts.map((part) => { + if (part.kind === "reasoning") { + return ( + + ); + } + + return ( +
+ {renderMarkdown(part.text)} +
+ ); + })} +
); })} - {isGenerating ? ( + {showPendingIndicator ? (
) : null} - - {!hasApiKey ? ( -

- Missing apiKey prop. -

- ) : null}
); } diff --git a/sdk/widget/src/components/ai-elements/Conversation.tsx b/sdk/widget/src/components/ai-elements/Conversation.tsx new file mode 100644 index 0000000..fd3f42a --- /dev/null +++ b/sdk/widget/src/components/ai-elements/Conversation.tsx @@ -0,0 +1,18 @@ +import * as React from "react"; +import { cn } from "../../utils/classNames"; + +export const Conversation = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(function Conversation({ className, ...props }, ref) { + return ( +
+ ); +}); diff --git a/sdk/widget/src/components/ai-elements/Message.tsx b/sdk/widget/src/components/ai-elements/Message.tsx new file mode 100644 index 0000000..824f41b --- /dev/null +++ b/sdk/widget/src/components/ai-elements/Message.tsx @@ -0,0 +1,46 @@ +import * as React from "react"; +import { cn } from "../../utils/classNames"; + +type MessageProps = { + from: "assistant" | "user"; + avatar?: React.ReactNode; + children: React.ReactNode; + className?: string; +}; + +export function Message({ from, avatar, children, className }: MessageProps) { + const isUser = from === "user"; + + return ( +
+
+ {!isUser && avatar ? ( +
+ {avatar} +
+ ) : null} +
+ {children} +
+
+
+ ); +} diff --git a/sdk/widget/src/components/ai-elements/PromptInput.tsx b/sdk/widget/src/components/ai-elements/PromptInput.tsx new file mode 100644 index 0000000..eb1d556 --- /dev/null +++ b/sdk/widget/src/components/ai-elements/PromptInput.tsx @@ -0,0 +1,134 @@ +import * as React from "react"; +import { HELPFUL_CHAT_LOGO_DATA_URI } from "../../theme"; +import { cn } from "../../utils/classNames"; + +type PromptInputProps = { + input: string; + setInput: (nextInput: string) => void; + placeholder: string; + isGenerating: boolean; + canSend: boolean; + isMobileViewport: boolean; + textareaRef: React.RefObject; + onSubmit: (event: React.FormEvent) => void; + onStop: () => void; + onInputKeyDown: (event: React.KeyboardEvent) => void; + logoSrc?: string; +}; + +const POWERED_BY_LOGO_SRC = HELPFUL_CHAT_LOGO_DATA_URI; + +function SendIcon() { + return ( + + ); +} + +function StopIcon() { + return ( +