@chat-js/cli 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,6 @@ const isProd = process.env.NODE_ENV === "production";
9
9
  * @see https://chatjs.dev/docs/reference/config
10
10
  */
11
11
  const config = {
12
- githubUrl: "https://github.com/franciscomoretti/chatjs",
13
12
  appPrefix: "chatjs",
14
13
  appName: "ChatJS",
15
14
  appTitle: "ChatJS - The prod ready AI chat app",
@@ -3,14 +3,12 @@
3
3
  import { LogIn } from "lucide-react";
4
4
  import { useRouter } from "next/navigation";
5
5
  import { memo } from "react";
6
- import { GitIcon } from "@/components/icons";
7
6
  import { Button } from "@/components/ui/button";
8
7
  import {
9
8
  Tooltip,
10
9
  TooltipContent,
11
10
  TooltipTrigger,
12
11
  } from "@/components/ui/tooltip";
13
- import { config } from "@/lib/config";
14
12
  import { useSession } from "@/providers/session-provider";
15
13
 
16
14
  function PureHeaderActions() {
@@ -39,16 +37,6 @@ function PureHeaderActions() {
39
37
  <TooltipContent>Sign in to your account</TooltipContent>
40
38
  </Tooltip>
41
39
  )}
42
- <Button asChild size="icon" type="button" variant="ghost">
43
- <a
44
- className="flex items-center justify-center"
45
- href={config.githubUrl}
46
- rel="noopener noreferrer"
47
- target="_blank"
48
- >
49
- <GitIcon size={20} />
50
- </a>
51
- </Button>
52
40
  </div>
53
41
  );
54
42
  }
@@ -263,7 +263,6 @@ export const authenticationConfigSchema = z
263
263
  });
264
264
 
265
265
  export const configSchema = z.object({
266
- githubUrl: z.url().default("https://github.com/your-username/your-repo"),
267
266
  appPrefix: z.string().default("chatjs"),
268
267
  appName: z.string().default("My AI Chat"),
269
268
  appTitle: z
@@ -0,0 +1,140 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * Server environment variable schemas with descriptions.
5
+ *
6
+ * Descriptions are the single source of truth used by:
7
+ * - The CLI env checklist (derived at build time)
8
+ * - The .env.example comments
9
+ *
10
+ * Exported separately from `env.ts` so the CLI can import
11
+ * without triggering `createEnv` runtime validation.
12
+ */
13
+ export const serverEnvSchema = {
14
+ // Required core
15
+ DATABASE_URL: z
16
+ .string()
17
+ .min(1)
18
+ .describe("Postgres connection string"),
19
+ AUTH_SECRET: z
20
+ .string()
21
+ .min(1)
22
+ .describe("NextAuth.js secret for signing session tokens"),
23
+
24
+ // Optional blob storage (enable in chat.config.ts)
25
+ BLOB_READ_WRITE_TOKEN: z
26
+ .string()
27
+ .optional()
28
+ .describe("Vercel Blob storage token for file uploads"),
29
+
30
+ // Authentication providers (enable in chat.config.ts)
31
+ AUTH_GOOGLE_ID: z
32
+ .string()
33
+ .optional()
34
+ .describe("Google OAuth client ID"),
35
+ AUTH_GOOGLE_SECRET: z
36
+ .string()
37
+ .optional()
38
+ .describe("Google OAuth client secret"),
39
+ AUTH_GITHUB_ID: z
40
+ .string()
41
+ .optional()
42
+ .describe("GitHub OAuth app client ID"),
43
+ AUTH_GITHUB_SECRET: z
44
+ .string()
45
+ .optional()
46
+ .describe("GitHub OAuth app client secret"),
47
+ VERCEL_APP_CLIENT_ID: z
48
+ .string()
49
+ .optional()
50
+ .describe("Vercel OAuth integration client ID"),
51
+ VERCEL_APP_CLIENT_SECRET: z
52
+ .string()
53
+ .optional()
54
+ .describe("Vercel OAuth integration client secret"),
55
+
56
+ // AI Gateway keys (one required depending on config.models.gateway)
57
+ AI_GATEWAY_API_KEY: z
58
+ .string()
59
+ .optional()
60
+ .describe("Vercel AI Gateway API key"),
61
+ VERCEL_OIDC_TOKEN: z
62
+ .string()
63
+ .optional()
64
+ .describe("Vercel OIDC token (auto-set on Vercel deployments)"),
65
+ OPENROUTER_API_KEY: z
66
+ .string()
67
+ .optional()
68
+ .describe("OpenRouter API key"),
69
+ OPENAI_COMPATIBLE_BASE_URL: z
70
+ .string()
71
+ .url()
72
+ .optional()
73
+ .describe("Base URL for OpenAI-compatible provider"),
74
+ OPENAI_COMPATIBLE_API_KEY: z
75
+ .string()
76
+ .optional()
77
+ .describe("API key for OpenAI-compatible provider"),
78
+ OPENAI_API_KEY: z
79
+ .string()
80
+ .optional()
81
+ .describe("OpenAI API key"),
82
+
83
+ // Optional cleanup cron job secret
84
+ CRON_SECRET: z
85
+ .string()
86
+ .optional()
87
+ .describe("Secret for cleanup cron job endpoint"),
88
+
89
+ // Optional features (enable in chat.config.ts)
90
+ REDIS_URL: z
91
+ .string()
92
+ .optional()
93
+ .describe("Redis URL for resumable streams"),
94
+ TAVILY_API_KEY: z
95
+ .string()
96
+ .optional()
97
+ .describe("Tavily API key for web search"),
98
+ EXA_API_KEY: z
99
+ .string()
100
+ .optional()
101
+ .describe("Exa API key for web search"),
102
+ FIRECRAWL_API_KEY: z
103
+ .string()
104
+ .optional()
105
+ .describe("Firecrawl API key for web search and URL retrieval"),
106
+ MCP_ENCRYPTION_KEY: z
107
+ .union([z.string().length(44), z.literal("")])
108
+ .optional()
109
+ .describe("Encryption key for MCP server credentials (base64, 44 chars)"),
110
+
111
+ // Sandbox (for non-Vercel deployments)
112
+ VERCEL_TEAM_ID: z
113
+ .string()
114
+ .optional()
115
+ .describe("Vercel team ID for sandbox (non-Vercel deployments)"),
116
+ VERCEL_PROJECT_ID: z
117
+ .string()
118
+ .optional()
119
+ .describe("Vercel project ID for sandbox (non-Vercel deployments)"),
120
+ VERCEL_TOKEN: z
121
+ .string()
122
+ .optional()
123
+ .describe("Vercel API token for sandbox (non-Vercel deployments)"),
124
+ VERCEL_SANDBOX_RUNTIME: z
125
+ .string()
126
+ .optional()
127
+ .describe("Vercel sandbox runtime identifier"),
128
+
129
+ // App URL (for non-Vercel deployments) - full URL including https://
130
+ APP_URL: z
131
+ .url()
132
+ .optional()
133
+ .describe("App URL for non-Vercel deployments (full URL including https://)"),
134
+
135
+ // Vercel platform (auto-set by Vercel)
136
+ VERCEL_URL: z
137
+ .string()
138
+ .optional()
139
+ .describe("Auto-set by Vercel platform"),
140
+ };
@@ -1,55 +1,8 @@
1
1
  import { createEnv } from "@t3-oss/env-nextjs";
2
- import { z } from "zod";
2
+ import { serverEnvSchema } from "./env-schema";
3
3
 
4
4
  export const env = createEnv({
5
- server: {
6
- // Required core
7
- DATABASE_URL: z.string().min(1),
8
- AUTH_SECRET: z.string().min(1),
9
-
10
- // Optional blob storage (enable in chat.config.ts)
11
- BLOB_READ_WRITE_TOKEN: z.string().optional(),
12
-
13
- // Authentication providers (enable in chat.config.ts)
14
- AUTH_GOOGLE_ID: z.string().optional(),
15
- AUTH_GOOGLE_SECRET: z.string().optional(),
16
- AUTH_GITHUB_ID: z.string().optional(),
17
- AUTH_GITHUB_SECRET: z.string().optional(),
18
- VERCEL_APP_CLIENT_ID: z.string().optional(),
19
- VERCEL_APP_CLIENT_SECRET: z.string().optional(),
20
-
21
- // AI Gateway keys (one required depending on config.models.gateway)
22
- AI_GATEWAY_API_KEY: z.string().optional(),
23
- VERCEL_OIDC_TOKEN: z.string().optional(),
24
- OPENROUTER_API_KEY: z.string().optional(),
25
- OPENAI_COMPATIBLE_BASE_URL: z.string().url().optional(),
26
- OPENAI_COMPATIBLE_API_KEY: z.string().optional(),
27
- OPENAI_API_KEY: z.string().optional(),
28
-
29
- // Optional cleanup cron job secret
30
- CRON_SECRET: z.string().optional(),
31
-
32
- // Optional features (enable in chat.config.ts)
33
- REDIS_URL: z.string().optional(),
34
- TAVILY_API_KEY: z.string().optional(),
35
- EXA_API_KEY: z.string().optional(),
36
- FIRECRAWL_API_KEY: z.string().optional(),
37
- MCP_ENCRYPTION_KEY: z
38
- .union([z.string().length(44), z.literal("")])
39
- .optional(),
40
-
41
- // Sandbox (for non-Vercel deployments)
42
- VERCEL_TEAM_ID: z.string().optional(),
43
- VERCEL_PROJECT_ID: z.string().optional(),
44
- VERCEL_TOKEN: z.string().optional(),
45
- VERCEL_SANDBOX_RUNTIME: z.string().optional(),
46
-
47
- // App URL (for non-Vercel deployments) - full URL including https://
48
- APP_URL: z.string().url().optional(),
49
-
50
- // Vercel platform (auto-set by Vercel)
51
- VERCEL_URL: z.string().optional(),
52
- },
5
+ server: serverEnvSchema,
53
6
  client: {},
54
7
  experimental__runtimeEnv: {},
55
8
  });
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/types/routes.d.ts";
3
+ import "./.next/dev/types/routes.d.ts";
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -114,7 +114,7 @@
114
114
  "date-fns": "^4.1.0",
115
115
  "diff": "^8.0.2",
116
116
  "dotenv": "^17.2.3",
117
- "drizzle-orm": "^0.34.0",
117
+ "drizzle-orm": "^0.45.1",
118
118
  "echarts-for-react": "^3.0.2",
119
119
  "fast-deep-equal": "^3.1.3",
120
120
  "js-tiktoken": "^1.0.19",
@@ -155,7 +155,11 @@
155
155
  "zustand": "^5.0.6"
156
156
  },
157
157
  "overrides": {
158
- "commander": "^14.0.0"
158
+ "commander": "^14.0.0",
159
+ "evalite": {
160
+ "ai": "$ai",
161
+ "better-sqlite3": "$better-sqlite3"
162
+ }
159
163
  },
160
164
  "devDependencies": {
161
165
  "@playwright/test": "^1.50.1",
@@ -166,7 +170,7 @@
166
170
  "@types/react": "19.2.7",
167
171
  "@types/react-dom": "19.2.3",
168
172
  "better-sqlite3": "^12.4.1",
169
- "drizzle-kit": "^0.25.0",
173
+ "drizzle-kit": "^0.31.9",
170
174
  "evalite": "1.0.0-beta.8",
171
175
  "pino-pretty": "^13.1.1",
172
176
  "postcss": "^8",