Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Reorganize docs
Vasek Mlejnskyf26ed9770596
diff --git a/apps/docs/src/app/playgrounds/debugging/page.mdx b/apps/docs/src/app/playgrounds/debugging/page.mdxnew file mode 100644index 000000000..06a20527e--- /dev/null+++ b/apps/docs/src/app/playgrounds/debugging/page.mdx@@ -0,0 +1,19 @@+export const metadata = {+ title: 'E2B Documentation - Cloud for AI Agents Apps',+ description: 'AI Playgrounds Debugging',+}++export const sections = [+ { title: 'Logging', id: 'logging' },+]++# Logging++<LanguageSpecificText>+ ```js {{ language: 'js', text: "E2B package logs only warnings & errors to the console by default. Below is an example of how to fully customize the logging levels.\n\nFeel free to override the logger with your own implementation with debug, info, warn, and error methods." }}+ ```+ ```python {{ language: 'python', text: "E2B package uses the standard Python logging module You can configure the logging level, handlers and format as you would with any other Python application. \n\nBelow is an example of how to configure the logging module to log to the console." }}+ ```+</LanguageSpecificText>++<CodeGroupAutoload path="logging/e2b_logging" isRunnable={false} />diff --git a/apps/docs/src/app/playgrounds/filesystem/page.mdx b/apps/docs/src/app/playgrounds/filesystem/page.mdxnew file mode 100644index 000000000..b00df9d11--- /dev/null+++ b/apps/docs/src/app/playgrounds/filesystem/page.mdx@@ -0,0 +1,39 @@+export const metadata = {+ title: 'E2B Documentation - Cloud for AI Agents Apps',+ description: 'AI Playgrounds Filesystem',+}++export const sections = [+ { title: 'List directory', id: 'list-directory' },+ { title: 'Create directory', id: 'create-directory' },+ { title: 'Write to file', id: 'write-to-file' },+ { title: 'Read from file', id: 'read-file' },+ { title: 'Write bytes', id: 'write-bytes' },+ { title: 'Read bytes', id: 'read-bytes' },+ { title: 'Watch directory for changes', id: 'watch-directory-for-changes' },+]++## List directory+<CodeGroupAutoload path="basics/fs_ls" isRunnable={true} />++## Create directory++A creation of a directory will fail if any directory on the path doesn't exist yet.+For example, if you want to create a directory `/home/user/new_dir` and `/home/user` doesn't exist yet, you will get an error.++<CodeGroupAutoload path="basics/fs_mkdir" isRunnable={false} />++## Write to file+When writing to a file that doesn't exist, it will get created.++When writing to a file that already exists, it will get overwritten.++When writing to a file that's in a directory that doesn't exist, you'll get an error.++<CodeGroupAutoload path="basics/fs_write" isRunnable={false} />++## Read file+<CodeGroupAutoload path="basics/fs_read" isRunnable={true} />++## Watch directory for changes+<CodeGroupAutoload path="basics/fs_watch" isRunnable={false} />diff --git a/apps/docs/src/app/playgrounds/limitations/page.mdx b/apps/docs/src/app/playgrounds/limitations/page.mdxindex c5000a225..2f21d1c19 100644--- a/apps/docs/src/app/playgrounds/limitations/page.mdx+++ b/apps/docs/src/app/playgrounds/limitations/page.mdx@@ -1,6 +1,6 @@export const metadata = {title: 'E2B Documentation - Cloud for AI Agents Apps',- description: 'AI PLaygrounds Limiations',+ description: 'AI Playgrounds Limiations',}diff --git a/apps/docs/src/app/playgrounds/process/page.mdx b/apps/docs/src/app/playgrounds/process/page.mdxnew file mode 100644index 000000000..e4d79a80b--- /dev/null+++ b/apps/docs/src/app/playgrounds/process/page.mdx@@ -0,0 +1,35 @@+export const metadata = {+ title: 'E2B Documentation - Cloud for AI Agents Apps',+ description: 'AI Playgrounds Running Processes',+}++export const sections = [+ { title: 'Start process', id: 'start-process' },+ { title: 'Stop process', id: 'stop-process' },+ { title: 'Stream stdout', id: 'stream-stdout' },+ { title: 'Stream stderr', id: 'stream-stderr' },+ { title: 'Send stdin', id: 'send-stdin' },+]++## Process+Here are the basic operations you can do with the process inside a cloud playground:+- [Start process](/getting-started/basics#start-process)+- [Stop process](/getting-started/basics#stop-process)+- [Stdout](/getting-started/basics#stream-stdout)+- [Stdin](/getting-started/basics#send-stdin)+- [Stderr](/getting-started/basics#stream-stderr)++## Start process+<CodeGroupAutoload path="basics/process_start" isRunnable={true} />++## Stop process+<CodeGroupAutoload path="basics/process_stop" isRunnable={false} />++## Stream stdout+<CodeGroupAutoload path="basics/process_stream_stdout" isRunnable={false} />++## Stream stderr+<CodeGroupAutoload path="basics/process_stream_stderr" isRunnable={false} />++## Send stdin+<CodeGroupAutoload path="basics/process_write_stdin" isRunnable={true} />\ No newline at end of filediff --git a/apps/docs/src/app/playgrounds/timeouts/page.mdx b/apps/docs/src/app/playgrounds/timeouts/page.mdxnew file mode 100644index 000000000..41eef1673--- /dev/null+++ b/apps/docs/src/app/playgrounds/timeouts/page.mdx@@ -0,0 +1,24 @@+export const metadata = {+ title: 'E2B Documentation - Cloud for AI Agents Apps',+ description: 'AI Playgrounds Timeouts',+}++export const sections = [+ { title: 'Timeouts', id: 'timeouts' },+]++# Timeouts++The SDK has a number of timeouts that can be configured to control how long the SDK will wait for a response from the E2B API. **The default is 60 seconds.**++### Timeout creating session++<CodeGroupAutoload path="timeout/timeout_session" />+++### Timeout process+<CodeGroupAutoload path="timeout/timeout_process" />++### Timeout filesystem operations++<CodeGroupAutoload path="timeout/timeout_filesystem" />\ No newline at end of filediff --git a/apps/docs/src/components/Navigation.tsx b/apps/docs/src/components/Navigation.tsxindex 7116704d9..d92ac52bf 100644--- a/apps/docs/src/components/Navigation.tsx+++ b/apps/docs/src/components/Navigation.tsx@@ -12,6 +12,17 @@ import { Tag } from '@/components/Tag'import { remToPx } from '@/lib/remToPx'import { Auth } from '@/components/Auth'import { Feedback } from '@/components/Feedback'+import {+ Bug,+ Timer,+ FileUp,+ FileDown,+ ChevronRightSquare,+ FolderTree,+ ShieldAlert,+ KeyRound,+ Settings,+} from 'lucide-react'interface NavGroup {title: string@@ -47,17 +58,21 @@ function TopLevelNavItem({}function NavLink({+ className,href,children,tag,+ icon,active = false,isAnchorLink = false,isFontMono = false,}: {+ className?: stringhref: stringchildren: React.ReactNodetag?: stringactive?: boolean+ icon?: React.ReactNodeisAnchorLink?: booleanisFontMono?: boolean}) {@@ -72,17 +87,21 @@ function NavLink({? 'text-zinc-900 dark:text-white': 'text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-white',isFontMono ? 'font-mono text-xs' : '',+ className,)}>- <span className="truncate">{children}</span>- {tag && (- <Tag- variant="small"- color="zinc"- >- {tag}- </Tag>- )}+ <div className="flex items-center justify-start gap-1">+ {icon}+ <span className="truncate">{children}</span>+ {tag && (+ <Tag+ variant="small"+ color="zinc"+ >+ {tag}+ </Tag>+ )}+ </div></Link>)}@@ -150,8 +169,6 @@ function NavigationGroup({ group, className }) {const isActiveGroup = activeGroupIndex(group, pathname) !== -1- console.log({ pathname, group, sections })-return (<li className={clsx('relative mt-6', className)}><motion.h2@@ -193,9 +210,12 @@ function NavigationGroup({ group, className }) {>{/* @ts-ignore */}<NavLink+ className="font-medium"href={link.href}active={`/docs${link.href}` === pathname}isFontMono={link.isFontMono}+ icon={link.icon}+ tag={link.tag}>{link.title}</NavLink>@@ -203,22 +223,8 @@ function NavigationGroup({ group, className }) {mode="popLayout"initial={false}>- <ul>- {sections.map(section => (- <li key={section.id}>- {/* @ts-ignore */}- <NavLink- href={`${link.href}#${section.id}`}- tag={section.tag}- isAnchorLink- >- {section.title}- </NavLink>- </li>- ))}- </ul>- {/* {`/docs${link.href}` === pathname && sections.length > 0 && ( */}- {/* <motion.ul+ {`/docs${link.href}` === pathname && sections.length > 0 && (+ <motion.ulrole="list"initial={{ opacity: 0 }}animate={{@@ -229,8 +235,21 @@ function NavigationGroup({ group, className }) {opacity: 0,transition: { duration: 0.15 },}}- > */}- {/* </motion.ul> */}+ >+ {sections.map(section => (+ <li key={section.id}>+ {/* @ts-ignore */}+ <NavLink+ href={`${link.href}#${section.id}`}+ tag={section.tag}+ isAnchorLink+ >+ {section.title}+ </NavLink>+ </li>+ ))}+ </motion.ul>+ )}</AnimatePresence></motion.li>))}@@ -244,27 +263,42 @@ export const navigation = [{title: 'Introduction',links: [- { title: 'What is E2B?', href: '/' },+ { title: 'What is E2B & AI Playgrounds?', href: '/' },{ title: 'Pricing', href: '/pricing' },+ { title: 'Open Source', href: '/oss' },],},{title: 'Getting Started',links: [- { title: 'Installation', href: '/getting-started/installation' },- { title: 'API Key', href: '/getting-started/api-key' },- { title: 'SDK Basics', href: '/getting-started/basics' },- { title: 'SDK Timeouts', href: '/getting-started/sdk-timeouts' },- { title: 'SDK Logging', href: '/getting-started/sdk-logging' },- {- title: 'SDK Multiple Processes',- href: '/getting-started/sdk-multiple-processes',- },+ { icon: <Settings strokeWidth={1} size={20}/>, title: 'Installation', href: '/getting-started/installation' },+ { icon: <KeyRound strokeWidth={1} size={20}/>, title: 'API Key', href: '/getting-started/api-key' },+ // { title: 'SDK Basics', href: '/getting-started/basics' },+ // { title: 'SDK Timeouts', href: '/getting-started/sdk-timeouts' },+ // { title: 'SDK Logging', href: '/getting-started/sdk-logging' },+ // {+ // title: 'SDK Multiple Processes',+ // href: '/getting-started/sdk-multiple-processes',+ // },+ ],+ },+ {+ title: 'AI Playgrounds',+ links: [+ { title: 'Overview', href: '/playgrounds/overview' },+ { icon: <ShieldAlert strokeWidth={1} size={20}/>, title: 'Limitations', href: '/playgrounds/limitations' },+ { icon: <FolderTree strokeWidth={1} size={20}/>, title: 'Filesystem', href: '/playgrounds/filesystem' },+ { icon: <ChevronRightSquare strokeWidth={1} size={20}/>,title: 'Running Processes', href: '/playgrounds/process' },+ // { icon: <FileUp strokeWidth={1} size={20}/>, title: 'Upload Files', href: '/playgrounds/upload' },+ // { icon: <FileDown strokeWidth={1} size={20}/>, title: 'Download Files', href: '/playgrounds/download' },+ { icon: <Bug strokeWidth={1} size={20}/>, title: 'Debugging', href: '/playgrounds/debugging' },+ { icon: <Timer strokeWidth={1} size={20}/>, title: 'Timeouts', href: '/playgrounds/timeouts' },],},{title: 'AI Agents Use Case',links: [+ { title: 'Overview', href: '/agents/overview' },{ title: 'Execute Code', href: '/agents/exec' },// { title: 'Install Packages', href: '/agents/pkg' },{ title: 'Clone GitHub Repository', href: '/agents/clone-repo' },@@ -274,14 +308,7 @@ export const navigation = [// TODO: Guide for building ffmpeg agent],},- {- title: 'AI Playgrounds',- links: [- { title: 'Overview', href: '/playgrounds/overview' },- { title: 'Limitations', href: '/playgrounds/limitations' },- // { title: 'Use with AI Agents & Copilots', href: '/getting-started/how-to' },- ],- },+// {// title: 'AI Environments',// links: [