Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: shared @mastra/playground ui lib #1836

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

adeleke5140
Copy link
Contributor

@adeleke5140 adeleke5140 commented Feb 11, 2025

Playground UI

Bootstrap @mastra/playground with initial files and packages.

There is an assistant-ui bug with the assistant-ui primitives.

  1. new lines are not formatted properly and show up as \n\n in the resulting output.
  2. code block aren't properly formatted and the docs aren't really explicit as to whether to configure a syntax highlighter. Custom syntax highlighters added to the components object with syntax highlighting setup don't show up either.

Docs on Markdown primitive

This means there is an issue with the AssistantUI Primitive or there is a part of the setup we aren't getting right.

Steps to reproduce:

Build core, deployer and cli

cd packages/core && pnpm build
cd packages/cli && pnpm build
cd packages/deployer && pnpm build

Launch the mastra server for an example

cd examples/quick-start && pnpm i
node ../../packages/cli/dist/index.js dev

server should be running on port localhost:4111

Run the preview vite page in playground-ui

cd packages/playground-ui && pnpm i 
pnpm vite dev

frontend should be running on port localhost:5174

Test out the json by asking these two questions:

  1. give me some cat details in json, showing, name, species, location and general popularity rate over 10
  2. print hello world

First question should return below
image

Custom component

Inside of the defaultComponent object, replace the code element with MarkdownCodeBlock from markdown. Try out question again.

from this:

code: function Code({ className, ...props }) {
    const isCodeBlock = useIsMarkdownCodeBlock();
    return <code className={cn(!isCodeBlock && 'bg-muted rounded border font-semibold', className)} {...props} />;
 },
 CodeHeader,

to this:

code: props => <MarkdownCodeBlock {...props} />,
CodeHeader,

Copy link

vercel bot commented Feb 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
assistant-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 4:00pm
mastra ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 4:00pm
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
bird-checker ⬜️ Skipped (Inspect) Feb 24, 2025 4:00pm
crypto-chatbot ⬜️ Skipped (Inspect) Feb 24, 2025 4:00pm
mastra-docs ⬜️ Skipped (Inspect) Feb 24, 2025 4:00pm
openapi-spec-writer ⬜️ Skipped (Inspect) Feb 24, 2025 4:00pm
travel-ai ⬜️ Skipped (Inspect) Feb 24, 2025 4:00pm

Copy link

socket-security bot commented Feb 11, 2025

Copy link

promptless bot commented Feb 11, 2025

📝 Documentation updates detected! You can review documentation updates here

@adeleke5140
Copy link
Contributor Author

will take a look in the morning

Copy link

changeset-bot bot commented Feb 12, 2025

⚠️ No Changeset found

Latest commit: 599c034

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel vercel bot temporarily deployed to Preview – bird-checker February 21, 2025 17:21 Inactive
@vercel vercel bot temporarily deployed to Preview – travel-ai February 21, 2025 17:21 Inactive
@vercel vercel bot temporarily deployed to Preview – mastra-docs February 21, 2025 17:21 Inactive
@vercel vercel bot temporarily deployed to Preview – openapi-spec-writer February 21, 2025 17:21 Inactive
@vercel vercel bot temporarily deployed to Preview – crypto-chatbot February 21, 2025 17:21 Inactive
Copy link

socket-security bot commented Feb 24, 2025

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

Copy link
Contributor

github-actions bot commented Feb 24, 2025

Braintrust eval report

No experiments to report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants