chore(dependencies): update ai-sdk packages and other dependencies

- Upgraded @ai-sdk dependencies to versions 3.0.44, 3.0.30, 3.0.21, 2.0.34, 3.0.20, and 3.0.29 in package.json files for both server and dokploy.
- Updated ai package to version 6.0.86 and ai-sdk-ollama to version 3.7.0.
- Updated swagger-ui-react to version 5.31.1.
- Added a new DEBUG-BUILD.md file for debugging build issues in the server package.
- Introduced tsconfig.server.no-decl.json to manage TypeScript compilation options without declaration files.
- Modified tsconfig.json to include .next directory for TypeScript compilation.
This commit is contained in:
Mauricio Siu
2026-02-16 12:50:34 -06:00
parent 4fd06b00a0
commit c04dd63db8
7 changed files with 2517 additions and 2285 deletions

View File

@@ -41,13 +41,13 @@
"dependencies": { "dependencies": {
"resend": "^6.0.2", "resend": "^6.0.2",
"@better-auth/sso": "1.4.18", "@better-auth/sso": "1.4.18",
"@ai-sdk/anthropic": "^2.0.5", "@ai-sdk/anthropic": "^3.0.44",
"@ai-sdk/azure": "^2.0.16", "@ai-sdk/azure": "^3.0.30",
"@ai-sdk/cohere": "^2.0.4", "@ai-sdk/cohere": "^3.0.21",
"@ai-sdk/deepinfra": "^1.0.10", "@ai-sdk/deepinfra": "^2.0.34",
"@ai-sdk/mistral": "^2.0.7", "@ai-sdk/mistral": "^3.0.20",
"@ai-sdk/openai": "^2.0.16", "@ai-sdk/openai": "^3.0.29",
"@ai-sdk/openai-compatible": "^1.0.10", "@ai-sdk/openai-compatible": "^2.0.30",
"@codemirror/autocomplete": "^6.18.6", "@codemirror/autocomplete": "^6.18.6",
"@codemirror/lang-json": "^6.0.1", "@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-yaml": "^6.1.2", "@codemirror/lang-yaml": "^6.1.2",
@@ -95,8 +95,8 @@
"@xterm/addon-clipboard": "0.1.0", "@xterm/addon-clipboard": "0.1.0",
"@xterm/xterm": "^5.5.0", "@xterm/xterm": "^5.5.0",
"adm-zip": "^0.5.16", "adm-zip": "^0.5.16",
"ai": "^5.0.17", "ai": "^6.0.86",
"ai-sdk-ollama": "^0.5.1", "ai-sdk-ollama": "^3.7.0",
"bcrypt": "5.1.1", "bcrypt": "5.1.1",
"better-auth": "1.4.18", "better-auth": "1.4.18",
"bl": "6.0.11", "bl": "6.0.11",
@@ -144,7 +144,7 @@
"ssh2": "1.15.0", "ssh2": "1.15.0",
"stripe": "17.2.0", "stripe": "17.2.0",
"superjson": "^2.2.2", "superjson": "^2.2.2",
"swagger-ui-react": "^5.22.0", "swagger-ui-react": "^5.31.1",
"tailwind-merge": "^2.6.0", "tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"toml": "3.0.0", "toml": "3.0.0",

View File

@@ -0,0 +1,27 @@
# Debug build OOM orden para probar
Ejecuta desde `packages/server` (o `pnpm --filter=@dokploy/server run <script>` desde la raíz).
1. **`pnpm run build:debug:noEmit`**
Solo typecheck, no escribe archivos.
- Si hace **OOM** → el problema es el análisis de tipos (ej. zod u otras libs).
- Si **pasa** → el problema está en emit (JS o `.d.ts`).
2. **`pnpm run build:debug:noEmit:8gb`**
Mismo que el anterior pero con 8GB de heap.
- Si con 8GB **pasa** y sin 8GB **no** → el typecheck necesita más memoria.
3. **`pnpm run build:debug:noDecl`**
Compila solo JS (sin `declaration`).
- Si hace **OOM** → el problema es emitir JS.
- Si **pasa** → el problema es generar `.d.ts`.
4. **`pnpm run build:debug:declOnly`**
Solo genera declaraciones (`.d.ts`).
- Si hace **OOM** → el cuello de botella son las declaraciones.
5. **`pnpm run build:debug:full`**
Build completo con `--extendedDiagnostics` (imprime estadísticas al final).
- Para ver en qué paso se va la memoria si no has localizado antes.
Con eso sabes si el OOM viene de: typecheck, emit JS o emit declarations, y puedes elegir fix (más memoria, esbuild para JS, o no emitir declarations).

View File

@@ -30,13 +30,13 @@
"generate:drizzle": "pnpm dlx @better-auth/cli generate --output auth-schema2.ts --config src/lib/auth.ts" "generate:drizzle": "pnpm dlx @better-auth/cli generate --output auth-schema2.ts --config src/lib/auth.ts"
}, },
"dependencies": { "dependencies": {
"@ai-sdk/anthropic": "^2.0.5", "@ai-sdk/anthropic": "^3.0.44",
"@ai-sdk/azure": "^2.0.16", "@ai-sdk/azure": "^3.0.30",
"@ai-sdk/cohere": "^2.0.4", "@ai-sdk/cohere": "^3.0.21",
"@ai-sdk/deepinfra": "^1.0.10", "@ai-sdk/deepinfra": "^2.0.34",
"@ai-sdk/mistral": "^2.0.7", "@ai-sdk/mistral": "^3.0.20",
"@ai-sdk/openai": "^2.0.16", "@ai-sdk/openai": "^3.0.29",
"@ai-sdk/openai-compatible": "^1.0.10", "@ai-sdk/openai-compatible": "^2.0.30",
"@better-auth/utils": "0.3.0", "@better-auth/utils": "0.3.0",
"@faker-js/faker": "^8.4.1", "@faker-js/faker": "^8.4.1",
"@octokit/auth-app": "^6.1.3", "@octokit/auth-app": "^6.1.3",
@@ -47,8 +47,8 @@
"@better-auth/sso": "1.4.18", "@better-auth/sso": "1.4.18",
"@trpc/server": "^10.45.2", "@trpc/server": "^10.45.2",
"adm-zip": "^0.5.16", "adm-zip": "^0.5.16",
"ai": "^5.0.17", "ai": "^6.0.86",
"ai-sdk-ollama": "^0.5.1", "ai-sdk-ollama": "^3.7.0",
"bcrypt": "5.1.1", "bcrypt": "5.1.1",
"better-auth": "1.4.18", "better-auth": "1.4.18",
"bl": "6.0.11", "bl": "6.0.11",

View File

@@ -2,13 +2,31 @@ import { db } from "@dokploy/server/db";
import { ai } from "@dokploy/server/db/schema"; import { ai } from "@dokploy/server/db/schema";
import { selectAIProvider } from "@dokploy/server/utils/ai/select-ai-provider"; import { selectAIProvider } from "@dokploy/server/utils/ai/select-ai-provider";
import { TRPCError } from "@trpc/server"; import { TRPCError } from "@trpc/server";
import { generateObject } from "ai"; import { generateText, Output } from "ai";
import { desc, eq } from "drizzle-orm"; import { desc, eq } from "drizzle-orm";
import { z } from "zod"; import { z } from "zod";
import { IS_CLOUD } from "../constants"; import { IS_CLOUD } from "../constants";
import { findServerById } from "./server"; import { findServerById } from "./server";
import { getWebServerSettings } from "./web-server-settings"; import { getWebServerSettings } from "./web-server-settings";
interface SuggestionItem {
id: string;
name: string;
shortDescription: string;
description: string;
}
interface SuggestionsOutput {
suggestions: SuggestionItem[];
}
interface DockerOutput {
dockerCompose: string;
envVariables: Array<{ name: string; value: string }>;
domains: Array<{ host: string; port: number; serviceName: string }>;
configFiles?: Array<{ content: string; filePath: string }>;
}
export const getAiSettingsByOrganizationId = async (organizationId: string) => { export const getAiSettingsByOrganizationId = async (organizationId: string) => {
const aiSettings = await db.query.ai.findMany({ const aiSettings = await db.query.ai.findMany({
where: eq(ai.organizationId, organizationId), where: eq(ai.organizationId, organizationId),
@@ -60,7 +78,7 @@ interface Props {
} }
export const suggestVariants = async ({ export const suggestVariants = async ({
organizationId, organizationId: _organizationId,
aiId, aiId,
input, input,
serverId, serverId,
@@ -90,10 +108,7 @@ export const suggestVariants = async ({
ip = "127.0.0.1"; ip = "127.0.0.1";
} }
const { object } = await generateObject({ const suggestionsSchema = z.object({
model,
output: "object",
schema: z.object({
suggestions: z.array( suggestions: z.array(
z.object({ z.object({
id: z.string(), id: z.string(),
@@ -102,7 +117,11 @@ export const suggestVariants = async ({
description: z.string(), description: z.string(),
}), }),
), ),
}), });
const suggestionsResult = await generateText({
model,
// @ts-expect-error TS2589 - Zod + AI SDK Output.object() causes excessively deep instantiation
output: Output.object({ schema: suggestionsSchema }),
prompt: ` prompt: `
Act as advanced DevOps engineer and analyze the user's request to determine the appropriate suggestions (up to 3 items). Act as advanced DevOps engineer and analyze the user's request to determine the appropriate suggestions (up to 3 items).
@@ -148,15 +167,10 @@ export const suggestVariants = async ({
${input} ${input}
`, `,
}); });
const object = suggestionsResult.output as SuggestionsOutput | undefined;
if (object?.suggestions?.length) { if (object?.suggestions?.length) {
const result = []; const dockerSchema = z.object({
for (const suggestion of object.suggestions) {
try {
const { object: docker } = await generateObject({
model,
output: "object",
schema: z.object({
dockerCompose: z.string(), dockerCompose: z.string(),
envVariables: z.array( envVariables: z.array(
z.object({ z.object({
@@ -179,7 +193,14 @@ export const suggestVariants = async ({
}), }),
) )
.optional(), .optional(),
}), });
const result = [];
for (const suggestion of object.suggestions) {
try {
const dockerResult = await generateText({
model,
// @ts-expect-error TS2589 - Zod + AI SDK Output.object() causes excessively deep instantiation
output: Output.object({ schema: dockerSchema }),
prompt: ` prompt: `
Act as advanced DevOps engineer and generate docker compose with environment variables and domain configurations needed to install the following project. Act as advanced DevOps engineer and generate docker compose with environment variables and domain configurations needed to install the following project.
@@ -256,7 +277,8 @@ export const suggestVariants = async ({
${suggestion?.description} ${suggestion?.description}
`, `,
}); });
if (!!docker && !!docker.dockerCompose) { const docker = dockerResult.output as DockerOutput | undefined;
if (docker?.dockerCompose) {
result.push({ result.push({
...suggestion, ...suggestion,
...docker, ...docker,

View File

@@ -34,6 +34,7 @@
"dokploy", "dokploy",
"config", "config",
"dist", "dist",
".next",
"webpack.config.server.js", "webpack.config.server.js",
"migration.ts", "migration.ts",
"setup.ts" "setup.ts"

View File

@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.server.json",
"compilerOptions": {
"declaration": false,
"declarationMap": false
}
}

4389
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff