@@ -299,7 +308,7 @@ export const AddNode = () => {
className="h-full flex flex-col space-y-2 justify-between"
onSubmit={form.handleSubmit(connect)}
>
-
+
{
)}
/>
-
-
+
diff --git a/apps/shinkai-visor/src/components/create-inbox/create-inbox.tsx b/apps/shinkai-visor/src/components/create-inbox/create-inbox.tsx
index f5a843f54..19149d9a8 100644
--- a/apps/shinkai-visor/src/components/create-inbox/create-inbox.tsx
+++ b/apps/shinkai-visor/src/components/create-inbox/create-inbox.tsx
@@ -105,7 +105,7 @@ export const CreateInbox = () => {
type="submit"
>
{isLoading &&
}
-
+
diff --git a/apps/shinkai-visor/src/components/create-job/create-job.tsx b/apps/shinkai-visor/src/components/create-job/create-job.tsx
index b4fab4c23..6a012fa67 100644
--- a/apps/shinkai-visor/src/components/create-job/create-job.tsx
+++ b/apps/shinkai-visor/src/components/create-job/create-job.tsx
@@ -3,6 +3,7 @@ import { buildInboxIdFromJobId } from '@shinkai_network/shinkai-message-ts/utils
import { useCreateJob } from '@shinkai_network/shinkai-node-state/lib/mutations/createJob/useCreateJob';
import { useAgents } from '@shinkai_network/shinkai-node-state/lib/queries/getAgents/useGetAgents';
import { Loader2 } from 'lucide-react';
+import { useEffect } from 'react';
import { useForm } from 'react-hook-form';
import { FormattedMessage } from 'react-intl';
import { useHistory, useLocation } from 'react-router-dom';
@@ -21,7 +22,6 @@ import {
FormLabel,
FormMessage,
} from '../ui/form';
-import { Input } from '../ui/input';
import {
Select,
SelectContent,
@@ -30,6 +30,7 @@ import {
SelectTrigger,
SelectValue,
} from '../ui/select';
+import { Textarea } from '../ui/textarea';
const formSchema = z.object({
agent: z.string().nonempty(),
@@ -63,10 +64,19 @@ export const CreateJob = () => {
});
const { isLoading, mutateAsync: createJob } = useCreateJob({
onSuccess: (data) => {
+ console.log('job created');
const jobId = encodeURIComponent(buildInboxIdFromJobId(data.jobId));
history.replace(`/inboxes/${jobId}`);
},
});
+
+ //TODO: Replace this assigment with a configured default agent
+ useEffect(() => {
+ if (agents?.length) {
+ const defaultAgentId = agents[0].id;
+ form.setValue('agent', defaultAgentId);
+ }
+ }, [agents, form]);
const submit = (values: FormSchemaType) => {
if (!auth) return;
let content = values.content;
@@ -94,7 +104,7 @@ export const CreateJob = () => {
className="p-1 h-full flex flex-col space-y-2 justify-between"
onSubmit={form.handleSubmit(submit)}
>
-
+
{
-