Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add deploy agent button; improve styling

Vasek Mlejnskyd20354f58ac0
diff --git a/components/AgentDeploymentsList.tsx b/components/AgentDeploymentsList.tsx
index 0161a7e41..0404ac2a0 100644
--- a/components/AgentDeploymentsList.tsx
+++ b/components/AgentDeploymentsList.tsx
@@ -2,8 +2,10 @@ import {
useMemo,
useState,
} from 'react'
+import Link from 'next/link'
import {
ChevronRight,
+ Plus,
} from 'lucide-react'
import clsx from 'clsx'
import { usePostHog } from 'posthog-js/react'
@@ -12,7 +14,7 @@ import {
LiteDeployment,
} from 'utils/agentLogs'
-import DeploymentTree from './DeploymentTree'
+import DeploymentTree from 'components/DeploymentTree'
export interface Props {
deployments: LiteDeployment[]
@@ -55,6 +57,14 @@ function AgentDeploymentsList({
<main className="overflow-hidden flex flex-col max-h-full flex-1 rounded-md">
<header className="flex items-center justify-between px-4 py-3 border-b border-b-white/5">
<h1 className="text-xl font-semibold text-white">Agent Deployments</h1>
+ <Link href="//agent/smol-developer">
+ <button
+ className="py-1 px-2 rounded bg-green-400/10 hover:bg-green-400/20 border border-green-400/20 transition-all flex items-center space-x-2 text-green-400 text-sm font-semibold"
+ >
+ <Plus size={16} />
+ <span>Deploy New Agent</span>
+ </button>
+ </Link>
</header>
{sortedDeployments.length === 0 && (
<div className="flex items-center justify-center flex-1">
diff --git a/components/AgentInstructions.tsx b/components/AgentInstructions.tsx
index e404b0849..00cf2c264 100644
--- a/components/AgentInstructions.tsx
+++ b/components/AgentInstructions.tsx
@@ -42,7 +42,7 @@ function AgentInstructions({
setError({
title: 'No instructions provided',
infoItems: [
- 'Please provide instructions for the AI developer to follow',
+ 'Please provide instructions for the AI agent',
],
})
return
@@ -64,7 +64,12 @@ function AgentInstructions({
return (
<div className="flex-1 flex flex-col items-start justify-start space-y-2">
- <h3 className="text-white font-bold">What do you want the AI developer to build?</h3>
+ <h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
+ Deploy <a className="text-indigo-400 hover:text-indigo-500 transition-all" href="https://github.com/smol-ai/developer" target="_blank" rel="noreferrer noopener">Smol Developer</a>
+ </h2>
+ <p className="mt-2 mb-6 text-lg leading-8 text-gray-400">
+ What do you want the AI agent to build?
+ </p>
{error && (
<AlertError
title={error.title}
diff --git a/components/SelectRepository/RepoSwitch.tsx b/components/SelectRepository/RepoSwitch.tsx
index 73d083bb0..9a343877f 100644
--- a/components/SelectRepository/RepoSwitch.tsx
+++ b/components/SelectRepository/RepoSwitch.tsx
@@ -5,9 +5,9 @@ export interface Props {
onChange: (value: 'existing' | 'new') => void
}
-const baseClasses = 'text-xs font-semibold p-2 rounded-md transition-all cursor-pointer'
-const unselectedClasses = 'text-gray-500 hover:bg-indigo-400/10 hover:text-indigo-400'
-const selectedClasses = 'bg-indigo-400/10 text-indigo-400'
+const baseClasses = 'text-xs font-semibold py-1 px-2 rounded-md transition-all cursor-pointer'
+const unselectedClasses = 'text-gray-500 hover:bg-indigo-400/10 hover:text-indigo-400 border border-transparent hover:border-indigo-400/20'
+const selectedClasses = 'bg-indigo-400/10 text-indigo-400 border border-indigo-400/20'
function RepoSwitch({
value,
diff --git a/components/SelectRepository/index.tsx b/components/SelectRepository/index.tsx
index 80bb59913..dd9cdc4a8 100644
--- a/components/SelectRepository/index.tsx
+++ b/components/SelectRepository/index.tsx
@@ -58,11 +58,11 @@ function SelectRepository({
return (
<>
- <h2 className="text-3xl font-bold tracking-tight text-white sm:text-4xl">
- Select Git Repository
+ <h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
+ Deploy <a className="text-indigo-400 hover:text-indigo-500 transition-all" href="https://github.com/smol-ai/developer" target="_blank" rel="noreferrer noopener">Smol Developer</a>
</h2>
<p className="mt-2 mb-6 text-lg leading-8 text-gray-400">
- Select a git repository to which you want to give the AI developer access.
+ Select a git repository to which you want to give the AI agent access.
</p>
{!user && (
diff --git a/pages/agent/smol-developer/index.tsx b/pages/agent/smol-developer/index.tsx
index 3735500a0..4269a8dcd 100644
--- a/pages/agent/smol-developer/index.tsx
+++ b/pages/agent/smol-developer/index.tsx
@@ -1,6 +1,7 @@
import { Github } from 'lucide-react'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
+import Link from 'next/link'
import type { InferGetServerSidePropsType, GetServerSideProps } from 'next'
import Image from 'next/image'
import { createServerSupabaseClient } from '@supabase/auth-helpers-nextjs'
@@ -85,14 +86,14 @@ function SmolDeveloper({
</svg>
<div className="m-auto max-w-xl text-center lg:mx-0 lg:flex-auto lg:py-32 lg:text-left">
<div className="flex flex-col space-y-4 items-center lg:items-start">
- <a
+ <Link
href="/" className="inline-flex space-x-6"
onMouseDown={() => posthog?.capture('clicked link to e2b homepage')}
>
- <span className="rounded-full bg-indigo-500/10 px-3 py-1 text-sm font-semibold leading-6 text-indigo-400 ring-1 ring-inset ring-indigo-500/20">
+ <span className="rounded-full bg-indigo-400/10 px-3 py-1 text-sm font-semibold leading-6 text-indigo-400 ring-1 ring-inset ring-indigo-400/20">
Runs on <b>e2b</b>
</span>
- </a>
+ </Link>
<h2 className="text-3xl font-bold tracking-tight text-white sm:text-4xl">
Your personal AI developer.
<br />
@@ -102,7 +103,7 @@ function SmolDeveloper({
<p className="mt-6 text-lg leading-8 text-gray-300">
Get your own AI developer that&apos;s powered by the
{' '}<a
- className="text-indigo-500 cursor-pointer font-bold"
+ className="text-indigo-400 cursor-pointer font-bold"
href="https://github.com/smol-ai/developer"
rel="noreferer noopener"
target="_blank"
@@ -126,17 +127,7 @@ function SmolDeveloper({
<span>Stars {repo.stargazers_count.toLocaleString()}</span>
</a>
</div>
- <div className="flex items-center justify-between gap-x-6">
- {sessionCtx.isLoading && (
- <div
- className="
- flex
- justify-center
- "
- >
- <SpinnerIcon className="text-slate-400" />
- </div>
- )}
+ <div className="w-full flex items-center justify-between gap-x-6">
{/* Also show the spinner when session is loaded and the user is also loaded because we're just waiting for the redirect to /setup */}
{!sessionCtx.isLoading && user && (
<div
@@ -149,6 +140,16 @@ function SmolDeveloper({
</div>
)}
<div className="w-full flex flex-col md:flex-row items-center md:items-center justify-center md:justify-between space-y-2 md:space-y-0">
+ {sessionCtx.isLoading && (
+ <div
+ className="
+ flex
+ justify-center
+ "
+ >
+ <SpinnerIcon className="text-slate-400" />
+ </div>
+ )}
{!sessionCtx.isLoading && !user &&
<button
className="flex items-center space-x-2 rounded-md bg-white px-3.5 py-2.5 text-sm font-semibold text-gray-900 shadow-sm hover:bg-gray-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"