From 74110fbe7a31bc71e0ebe00e50bed3e3d8016461 Mon Sep 17 00:00:00 2001 From: "2570050763@qq.com" <2570050763@qq.com> Date: Fri, 18 Sep 2026 14:55:16 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=8F=90=E4=BA=A4=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=20mock=20TTS=20=E4=BB=A3=E7=90=86=E9=85=8D=E7=BD=AE=E4=B8=8E?= =?UTF-8?q?=20Next.js=2016=20=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?=20AGENTS/CLAUDE=20=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 9 +++++++++ CLAUDE.md | 1 + next.config.ts | 7 +++++++ 3 files changed, 17 insertions(+) create mode 100644 AGENTS.md create mode 100644 CLAUDE.md 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;