Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Merge branch 'agent' into production

Tomas Valenta336576ebb569
diff --cc components/Repos.tsx
index 5e534f849,ed515d283..2d7b03841
--- a/components/Repos.tsx
+++ b/components/Repos.tsx
@@@ -14,12 -14,19 +14,12 @@@ import TitleButton from 'components/Tit
import Input from 'components/Input'
import SpinnerIcon from 'components/Spinner'
import { useLocalStorage } from 'hooks/useLocalStorage'
- import { parseRepoName } from 'github/repo'
+ import { createRepo, parseRepoName } from 'github/repo'
-export interface PostProjectBody {
+export interface RepoSetup {
+ fullName: string
repositoryID: number
installationID: number
- accessToken: string
- branch: string
- path: string
- id: string
-}
-
-export interface RepoSetup extends Pick<PostProjectBody, 'installationID' | 'repositoryID'> {
- fullName: string
defaultBranch: string
branches?: string[]
url: string
diff --cc pages/agent/smol-developer/setup.tsx
index 6408c890d,ce038cb7b..c541e2230
--- a/pages/agent/smol-developer/setup.tsx
+++ b/pages/agent/smol-developer/setup.tsx
@@@ -53,9 -35,27 +35,27 @@@ export interface PostAgentBody
branch: string
// Commit message for the PR first empty commit
commitMessage: string
- modelConfig: ModelConfig
+ modelConfig: ModelConfig & { templateID: TemplateID }
}
+ export const getServerSideProps: GetServerSideProps = async (ctx) => {
+ const supabase = createServerSupabaseClient(ctx, serverCreds)
+ const {
+ data: { session },
+ } = await supabase.auth.getSession()
+
+ if (!session) {
+ return {
+ redirect: {
+ destination: '/agent/smol-developer',
+ permanent: false,
+ },
+ }
+ }
+
+ return { props: {} }
+ }
+
async function handlePostAgent(url: string, { arg }: { arg: PostAgentBody }) {
return await fetch(url, {
method: 'POST',