Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Required for a successful lint/build:
# - DATABASE_URL
# - NEXTAUTH_URL
# - AUTH_SECRET
# Provide OPENROUTER_API_KEY or other model keys if you want inference/image features.

# ----------
# DATABASE
# ----------
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: pnpm run format:check

- name: Run linting and type check
run: SKIP_ENV_VALIDATION=1 pnpm run check
run: pnpm run check

- name: Build project
run: SKIP_ENV_VALIDATION=1 pnpm run build-pure
run: pnpm run build-pure
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules
/.pnp
.pnp.js
.pnpm-store/

# testing
/coverage
Expand Down Expand Up @@ -32,6 +33,9 @@ yarn-error.log*
.pnpm-debug.log*
pnpm-workspace.yaml

# pnpm store (cache) - don't commit
.pnpm-store/

# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
.env
Expand All @@ -45,4 +49,4 @@ pnpm-workspace.yaml
*.tsbuildinfo

# idea files
.idea
.idea
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

## 2025-08-16

- Build and type fixes following ai v5/@ai-sdk/react v2 migration:
- Correctly type `UseChatHelpers<UIMessage>` in chat input/components.
- Guard undefined `toolName` and fix `append` signature in MessageTool.
- Safe reasoning text extraction and switch to `??` to satisfy ESLint.
- API: Fix file-part type narrowing in `/api/chat` to match zod schema (resolves type predicate error in build).
- Prisma: Add `binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x"]` to resolve query engine mismatch; regenerated client.
- Build: Verified `next build` passes lint and type checks.
- Action item: After pulling, run `pnpm prisma generate` to refresh the Prisma Client for your platform.

## 2025-08-15

- Migrate to ai v5 and @ai-sdk/react v2.
- Switch to parts-based UIMessage (text, file, reasoning, tool-invocation).
- Server streaming refactor using result.toUIMessageStream.
- Removed experimental_attachments in favor of file parts.
- Preserved DB persistence and resumable streaming.
- Improved setup resiliency (Docker/DB optional in dev).
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ The setup script will:
- Run database migrations
- Run the app

#### Remote Database Override

By default, local migrations are only executed for a localhost / 127.0.0.1 `DATABASE_URL`.
If you intentionally point `DATABASE_URL` to a remote managed database during development and want to skip local migrations, set:

```
REMOTE_DB=1
```

This makes the skip explicit; otherwise the setup will fail fast to prevent accidentally targeting production.

### Manual Setup

If you prefer to set up manually:
Expand Down Expand Up @@ -136,6 +147,10 @@ LUMA_API_KEY=

## Development

### AI SDK v5 Upgrade

This project uses ai v5 and @ai-sdk/react v2. Messages are parts-based (text, file, reasoning, tool-invocation) and server streaming uses result.toUIMessageStream. Client submits files as file parts; experimental_attachments is no longer used.

### Project Structure

```
Expand Down
6 changes: 1 addition & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ export default tseslint.config(
},
},
{
files: ["src/components/ui/**/*.ts", "src/components/ui/**/*.tsx"],
rules: {
"@typescript-eslint/no-unused-vars": "off",
"react/no-unescaped-entities": "off",
},
// Strict configuration: no per-folder relaxations (UI components included).
},
{
linterOptions: {
Expand Down
33 changes: 18 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
"shiki:generate": "pnpm dlx tsx src/components/ui/code/codegen.ts && pnpm format:write"
},
"dependencies": {
"@ai-sdk/anthropic": "^1.2.12",
"@ai-sdk/fal": "^0.1.12",
"@ai-sdk/fireworks": "^0.2.16",
"@ai-sdk/google": "^1.2.19",
"@ai-sdk/groq": "^1.2.9",
"@ai-sdk/luma": "^0.1.8",
"@ai-sdk/openai": "^1.3.22",
"@ai-sdk/perplexity": "^1.1.9",
"@ai-sdk/react": "^1.2.12",
"@ai-sdk/xai": "^1.2.16",
"@ai-sdk/anthropic": "^2.0.0",
"@ai-sdk/fal": "^1.0.6",
"@ai-sdk/fireworks": "^1.0.7",
"@ai-sdk/google": "^2.0.0",
"@ai-sdk/groq": "^2.0.0",
"@ai-sdk/luma": "^1.0.3",
"@ai-sdk/openai": "^2.0.0",
"@ai-sdk/perplexity": "^2.0.0",
"@ai-sdk/react": "^2.0.0",
"@ai-sdk/xai": "^2.0.0",
"@auth/prisma-adapter": "^2.7.2",
"@discordjs/rest": "^2.5.1",
"@e2b/code-interpreter": "^1.5.1",
Expand All @@ -45,7 +45,9 @@
"@llm-ui/react": "^0.13.3",
"@modelcontextprotocol/sdk": "^1.12.0",
"@notionhq/client": "^3.1.3",
"@openrouter/ai-sdk-provider": "^0.7.2",
"@openrouter/ai-sdk-provider": "^1.1.2",
"@ai-sdk/provider": "^2.0.0",
"@ai-sdk/provider-utils": "^3.0.0",
"@prisma/client": "^6.13.0",
"@radix-ui/react-accordion": "^1.2.11",
"@radix-ui/react-alert-dialog": "^1.1.14",
Expand Down Expand Up @@ -76,13 +78,13 @@
"@vercel/mcp-adapter": "^0.11.1",
"@vercel/speed-insights": "^1.2.0",
"@xyflow/react": "^12.8.2",
"ai": "^4.3.16",
"ai": "^5.0.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.1.1",
"cookies-next": "^6.0.0",
"date-fns": "^4.1.0",
"etsy-ts": "^4.2.0",
"etsy-ts": "^4.2.0",
"discord-api-types": "^0.38.17",
"exa-js": "^1.8.8",
"fast-deep-equal": "^3.1.3",
Expand Down Expand Up @@ -118,7 +120,7 @@
"usehooks-ts": "^3.1.1",
"uuid": "^11.1.0",
"vaul": "^1.1.2",
"zod": "^3.25.56"
"zod": "^3.25.76"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.1",
Expand All @@ -132,7 +134,7 @@
"postcss": "^8.5.3",
"prettier": "^3.5.3",
"prettier-plugin-tailwindcss": "^0.6.11",
"prisma": "^6.5.0",
"prisma": "^6.13.0",
"shiki-codegen": "^3.9.2",
"tailwindcss": "^4.0.15",
"tsx": "^4.7.1",
Expand All @@ -143,6 +145,7 @@
"ct3aMetadata": {
"initVersion": "7.39.3"
},
"packageManager": "[email protected]",
"devEngines": {
"runtime": {
"name": "node",
Expand Down
Loading