feat: add missing functions

This commit is contained in:
Mauricio Siu
2025-01-18 22:58:27 -06:00
parent 87546b4558
commit 5e7d344110
5 changed files with 284 additions and 287 deletions

View File

@@ -2,7 +2,6 @@
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label"; import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { import {
Select, Select,
SelectContent, SelectContent,
@@ -12,8 +11,9 @@ import {
SelectTrigger, SelectTrigger,
SelectValue, SelectValue,
} from "@/components/ui/select"; } from "@/components/ui/select";
import { useState } from "react"; import { Textarea } from "@/components/ui/textarea";
import { api } from "@/utils/api"; import { api } from "@/utils/api";
import { useState } from "react";
const examples = [ const examples = [
"Make a personal blog", "Make a personal blog",

View File

@@ -136,10 +136,7 @@ export const StepTwo = ({
setSelectedVariant({ setSelectedVariant({
...selectedVariant, ...selectedVariant,
envVariables: [ envVariables: [...selectedVariant.envVariables, { name: "", value: "" }],
...selectedVariant.envVariables,
{ name: "", value: "" },
],
}); });
}; };

View File

@@ -87,7 +87,7 @@ export const aiRouter = createTRPCRouter({
aiId: z.string(), aiId: z.string(),
input: z.string(), input: z.string(),
serverId: z.string().optional(), serverId: z.string().optional(),
}) }),
) )
.mutation(async ({ ctx, input }) => { .mutation(async ({ ctx, input }) => {
return await suggestVariants({ return await suggestVariants({

View File

@@ -69,7 +69,7 @@ export const deploySuggestionSchema = z.object({
host: z.string().min(1), host: z.string().min(1),
port: z.number().min(1), port: z.number().min(1),
serviceName: z.string().min(1), serviceName: z.string().min(1),
}) }),
) )
.optional(), .optional(),
}); });

View File

@@ -121,14 +121,14 @@ export const suggestVariants = async ({
z.object({ z.object({
name: z.string(), name: z.string(),
value: z.string(), value: z.string(),
}) }),
), ),
domains: z.array( domains: z.array(
z.object({ z.object({
host: z.string(), host: z.string(),
port: z.number(), port: z.number(),
serviceName: z.string(), serviceName: z.string(),
}) }),
), ),
}), }),
prompt: ` prompt: `