-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added menu dropdown * sign in btn reset * updates to the layout * refinissimo * sizes * chatbox changes * updated file handing * design changes * design tokens, added back spinner * visual nicities * improved chat ux * api key input password * added url bar, make it more round * tooltips everywhere * fixes vercel build * added artifact history * added undo * share sheet * improves reactivity around recent changes * css grid * auto grid * mobile responsiveness * mobile-friendly sidebar * new chat reset chatinput * error handling + retry * grammar * improved imput ux, minor changes * updated design tokens * form overflow fix * refreshed sign in screen * moved sign in design around * google auth sign-in * updated logo, wording * logo component * added dark theme * tooltip theming * added light theme switch * removed unnecessary files/dependencies, added prettierrc * removed unused deps, code import sort * prettify * publish, url shortener * format select.tsx * publish sandbox extended timeout * publish button changes * fixes vercel build * pass e2b api key to publish * posthog capture on url publish * undo rebrand (for now) * next neutral logo * file conventions * renamed files * sandbox endpoint server action * renamed file structure * work on types * work on types and files * renamed side to preview * improved chat input error ui * fixes invalid property in svg * changed tooltip duration * flipped dark/light switch * new chat > clear chat * added tooltip for profile menu * added disclaimer * undo favicon * improved contrast ratio * added multi-file picker changed artifact view * changed display of loading states * duplicated loading state to the chat input * added toast * copy button and fixes preview streaming * fixes tooltip on copybutton * copy-button moved props order * changed share link > copy url * added display name to copy button * improved reactive data structures in preview * moved loader to more prominent place * chat input e2b star * moved llm settings to chat input * llm settings picker * moved toggle to navbar * sandbox api endpoint * updated preview.png * publish > deploy * lint, o1 rate limit env var --------- Co-authored-by: Mish Ushakov <[email protected]>
- Loading branch information
1 parent
88ad984
commit 816e16d
Showing
63 changed files
with
3,008 additions
and
2,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"semi": false, | ||
"plugins": ["@trivago/prettier-plugin-sort-imports"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use server' | ||
|
||
import { Sandbox } from '@e2b/code-interpreter' | ||
import { kv } from '@vercel/kv' | ||
import { customAlphabet } from 'nanoid' | ||
|
||
const nanoid = customAlphabet('1234567890abcdef', 7) | ||
const sandboxTimeout = 3 * 60 * 60 * 1000 // 3 hours | ||
|
||
export async function publish( | ||
url: string, | ||
sbxId: string, | ||
apiKey: string | undefined, | ||
) { | ||
if (process.env.KV_REST_API_URL && process.env.KV_REST_API_TOKEN) { | ||
const id = nanoid() | ||
await kv.set(`fragment:${id}`, url) | ||
await Sandbox.setTimeout(sbxId, sandboxTimeout, { apiKey }) | ||
|
||
return { | ||
url: process.env.VERCEL_URL | ||
? `https://${process.env.VERCEL_URL}/s/${id}` | ||
: `/s/${id}`, | ||
} | ||
} | ||
|
||
return { | ||
url, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.