Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
let user specify instructions
Vasek Mlejnsky54ecebe77865
diff --git a/components/AgentInstructions.tsx b/components/AgentInstructions.tsxindex bedaf48a7..369181b8b 100644--- a/components/AgentInstructions.tsx+++ b/components/AgentInstructions.tsx@@ -1,20 +1,47 @@import { useState } from 'react'+import {+ ArrowLeft,+} from 'lucide-react'import InstructionsEditor from 'components/Editor/Template/NodeJSExpressTemplate/InstructionsEditor'-function AgentInstructions() {+export interface Props {+ onBack: () => void+ onNext: () => void+}++function AgentInstructions({+ onBack,+ onNext,+}: Props) {const [content, setContent] = useState('')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><div className="relative bg-gray-950 flex flex-col p-2 w-full flex-1 overflow-auto border border-gray-700 rounded-md"><InstructionsEditor- className='absolute inset-0 bg-gray-950 p-4 text-gray-100'- placeholder="Create a website using Nextjs"+ className="absolute inset-0 bg-gray-950 p-4 text-gray-100"+ placeholder="Create a website using Nextjs..."content={content}onChange={setContent}/></div>++ <div className="w-full flex items-center justify-between">+ <button+ className="flex items-center justify-start space-x-1 text-gray-400 hover:text-gray-100 transition-all"+ onClick={onBack}+ >+ <ArrowLeft size={14} />+ <span className="text-sm">Back</span>+ </button>+ <button+ className="px-2 py-1 font-medium rounded-md text-sm border border-transparent bg-indigo-600/30 text-indigo-500 hover:bg-transparent hover:border-indigo-600 transition-all"+ onClick={onNext}+ >+ Continue+ </button>+ </div></div>)}diff --git a/components/Steps.tsx b/components/Steps.tsxindex aba4cd8c2..acd314388 100644--- a/components/Steps.tsx+++ b/components/Steps.tsx@@ -8,7 +8,7 @@ function Steps({const currentName = steps.find(s => s.status === 'current')?.namereturn (<div className="px-px w-full flex items-center justify-center">- <ol role="list" className="w-full flex items-center space-x-5">+ <ol role="list" className="w-full flex items-center space-x-5 mr-1 mt-0.5"><div className="w-full flex items-center justify-between"><span className="text-xs font-medium text-white">{currentName}</span><p className="text-gray-400 text-xs font-medium">diff --git a/pages/agent/smol-developer/setup.tsx b/pages/agent/smol-developer/setup.tsxindex 3446d46ff..bae61d4ec 100644--- a/pages/agent/smol-developer/setup.tsx+++ b/pages/agent/smol-developer/setup.tsx@@ -111,9 +111,9 @@ function Setup() {const [currentStep, setCurrentStep] = useState(0)const [selectedRepository, setSelectedRepository] = useState<RepoSetup>()const { repos, refetch } = useRepositories(github)+ const [instructions, setInstructions] = useState('')- const initialPrompt = 'Create chrome extension'- const openAIAPIKey = ''+ const openAIAPIKey = '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'const handleMessageEvent = useCallback((event: MessageEvent) => {if (event.data.accessToken) {@@ -129,10 +129,10 @@ function Setup() {} = useSWRMutation('/api/agent', handlePostAgent)async function deployAgent() {- console.log('DEPLOY AGENT', selectedRepository, initialPrompt, openAIAPIKey)+ console.log('DEPLOY AGENT', selectedRepository, instructions, openAIAPIKey)if (!selectedRepository) return- if (!initialPrompt) return+ if (!instructions) returnif (!openAIAPIKey) returnconst modelConfig = getSmolDevModelConfig({@@ -151,15 +151,13 @@ function Setup() {repositoryID: selectedRepository.repositoryID,title: 'Smol PR',branch: `pr/smol-dev/${nanoid(6).toLowerCase()}`,- body: initialPrompt,+ body: instructions,commitMessage: 'Smol dev initial commit',modelConfig,})}- function handleRepoSelection(repo: any) {- console.log('SELECTED REPO', repo)- setSelectedRepository(repo)+ function nextStep() {setCurrentStep(val => {const newVal = val + 1steps[val].status = 'complete'@@ -168,6 +166,21 @@ function Setup() {})}+ function previousStep() {+ setCurrentStep(val => {+ const newVal = val - 1+ steps[val].status = 'upcoming'+ steps[newVal].status = 'current'+ return newVal+ })++ }++ function handleRepoSelection(repo: any) {+ setSelectedRepository(repo)+ nextStep()+ }+async function signOut() {await supabaseClient.auth.signOut()location.reload()@@ -216,7 +229,12 @@ function Setup() {/>)}{currentStep === 1 && (- <AgentInstructions />+ <AgentInstructions+ value={instructions}+ onChange={setInstructions}+ onBack={() => previousStep()}+ onNext={() => nextStep()}+ />)}{currentStep === 2 && (<div>diff --git a/styles/prosemirror.css b/styles/prosemirror.cssindex 204c34f38..249bc6e5f 100644--- a/styles/prosemirror.css+++ b/styles/prosemirror.css@@ -55,7 +55,7 @@/* Placeholder (on the first empty line) */.ProseMirror p.is-empty:first-of-type::before {- @apply float-left h-0 select-none text-gray-400;+ @apply float-left h-0 select-none text-gray-500;content: attr(data-placeholder);}diff --git a/tailwind.config.js b/tailwind.config.jsindex 7cbc947b5..f33ecf550 100644--- a/tailwind.config.js+++ b/tailwind.config.js@@ -14,11 +14,11 @@ module.exports = {},height: { inherit: 'inherit' },colors: {- green: {- 400: '#E9F5E6',- 500: '#d0f7e2',- 800: '#20BC69',- },+ // green: {+ // 400: '#E9F5E6',+ // 500: '#d0f7e2',+ // 800: '#20BC69',+ // },},},},