diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..643577d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,9 @@ + + +# This is NOT the Next.js you know + +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. + + diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/next.config.ts b/next.config.ts index 2f6491c..bc9d826 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,6 +2,13 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { reactStrictMode: true, + async rewrites() { + // 设置 TTS_MOCK_UPSTREAM(见 .env.local)时,把 AI Lab 页面的 /tts/v1/* 请求代理到本地 mock TTS 服务。 + // 生产环境不设置该变量,走 NEXT_PUBLIC_TTS_BASE_URL 指向真实引擎,行为不变。 + const target = process.env.TTS_MOCK_UPSTREAM; + if (!target) return []; + return [{ source: "/tts/v1/:path*", destination: `${target}/v1/:path*` }]; + }, }; export default nextConfig;