diff --git a/apps/rowboat/app/actions/project_actions.ts b/apps/rowboat/app/actions/project_actions.ts index 2cb425e4..3f54db97 100644 --- a/apps/rowboat/app/actions/project_actions.ts +++ b/apps/rowboat/app/actions/project_actions.ts @@ -20,6 +20,17 @@ const KLAVIS_API_KEY = process.env.KLAVIS_API_KEY || ''; const projectActionAuthorizationPolicy = container.resolve('projectActionAuthorizationPolicy'); +export async function listTemplates() { + const templatesArray = Object.entries(templates) + .filter(([key]) => key !== 'default') // Exclude the default template + .map(([key, template]) => ({ + id: key, + ...template + })); + + return templatesArray; +} + export async function projectAuthCheck(projectId: string) { if (!USE_AUTH) { return; @@ -115,11 +126,12 @@ export async function createProjectFromWorkflowJson(formData: FormData): Promise const name = formData.get('name') as string | null; const workflowJson = formData.get('workflowJson') as string; - const { agents, prompts, tools, startAgent } = Workflow.parse(workflowJson); + const { agents, prompts, tools, pipelines, startAgent } = Workflow.parse(JSON.parse(workflowJson)); const response = await createBaseProject(name || 'Imported project', user, { agents, prompts, tools, + pipelines, startAgent, lastUpdatedAt: (new Date()).toISOString(), }); diff --git a/apps/rowboat/app/components/ui/textarea-with-send.tsx b/apps/rowboat/app/components/ui/textarea-with-send.tsx new file mode 100644 index 00000000..96531554 --- /dev/null +++ b/apps/rowboat/app/components/ui/textarea-with-send.tsx @@ -0,0 +1,78 @@ +'use client'; + +import { forwardRef, TextareaHTMLAttributes } from 'react'; +import { Textarea } from '@/components/ui/textarea'; +import { Send } from 'lucide-react'; +import clsx from 'clsx'; + +interface TextareaWithSendProps extends Omit, 'onChange'> { + value: string; + onChange: (value: string) => void; + onSubmit: () => void; + isSubmitting?: boolean; + submitDisabled?: boolean; + placeholder?: string; + className?: string; + rows?: number; + autoFocus?: boolean; + autoResize?: boolean; +} + +export const TextareaWithSend = forwardRef( + ({ + value, + onChange, + onSubmit, + isSubmitting = false, + submitDisabled = false, + placeholder, + className, + rows = 3, + autoFocus = false, + autoResize = false, + ...props + }, ref) => { + return ( +
+