2026-04-03 14:44:46 +08:00
|
|
|
|
import react from "@vitejs/plugin-react";
|
2026-04-08 15:37:09 +08:00
|
|
|
|
import { loadEnv } from "vite";
|
2026-04-07 17:15:01 +08:00
|
|
|
|
import { defineConfig } from "vitest/config";
|
2026-04-03 14:44:46 +08:00
|
|
|
|
|
2026-04-06 13:45:04 +08:00
|
|
|
|
/**
|
2026-04-08 15:37:09 +08:00
|
|
|
|
* 开发时可将 VITE_EVAL_API_BASE 留空,前端请求 /internal/... 由 Vite 代理转发。
|
|
|
|
|
|
* 默认与 api/development.sh 中 INTERNAL_EVAL_PORT(默认 7999)一致。
|
|
|
|
|
|
* 覆盖:VITE_EVAL_PROXY_TARGET=http://127.0.0.1:8001 npm run dev
|
2026-04-06 13:45:04 +08:00
|
|
|
|
*/
|
2026-04-08 15:37:09 +08:00
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
|
|
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
|
|
|
|
const proxyTarget =
|
|
|
|
|
|
(env.VITE_EVAL_PROXY_TARGET || "").trim() ||
|
|
|
|
|
|
"http://127.0.0.1:7999";
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
plugins: [react()],
|
|
|
|
|
|
server: {
|
|
|
|
|
|
port: 5174,
|
|
|
|
|
|
proxy: {
|
|
|
|
|
|
"/internal": {
|
|
|
|
|
|
target: proxyTarget,
|
|
|
|
|
|
changeOrigin: true,
|
feat(eval): memoir A/B chapter judging and eval-web parity with dialogue
- Judge baseline excerpt and library chapter separately; build_memoir_compare_summary for gate, nine-dim and leaf deltas.
- Memoir SSE chapter payload: baseline_judge, compare_summary, baseline_judge_error.
- MemoirJudgeOutput: loose score coercion and post-validate clamp; memoir judge prompt caps from settings.
- app-eval-web: two-column MemoirScoreCard layout, MemoirCompareSummary, chapter blocks and CSS.
- Add memoir_compare_summary, log_events, celery_log_context, memoir_pipeline_progress; tests and migration 0014.
- Misc: memory/evidence and enrichment paths, task/orchestrator updates, internal-eval docs, env examples.
2026-04-10 10:23:43 +08:00
|
|
|
|
/** 后端未启动时默认 Vite 控制台几乎无输出;这里打出直连目标便于对照 API 终端。 */
|
|
|
|
|
|
configure: (proxy) => {
|
|
|
|
|
|
proxy.on("error", (err) => {
|
|
|
|
|
|
console.error(
|
|
|
|
|
|
`[vite proxy] /internal → ${proxyTarget} failed:`,
|
|
|
|
|
|
(err as Error).message,
|
|
|
|
|
|
"(请在该地址启动 Internal Eval API,默认 api 目录下 :7999)",
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2026-04-08 15:37:09 +08:00
|
|
|
|
},
|
2026-04-06 13:45:04 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2026-04-08 15:37:09 +08:00
|
|
|
|
test: {
|
|
|
|
|
|
environment: "node",
|
|
|
|
|
|
include: ["src/**/*.test.ts"],
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|
2026-04-03 14:44:46 +08:00
|
|
|
|
});
|