Merge teacher composer and compact prompt UI into main

This commit is contained in:
鲨鱼辣椒
2026-09-29 20:40:09 +08:00
62 changed files with 2327 additions and 158 deletions

View File

@@ -33,10 +33,11 @@ export async function handleCodingTeacherRoutes(
const config = url.pathname === '/api/coding/teacher/config' || url.pathname === '/api/coding/friend/config';
const catalog = url.pathname === '/api/coding/teacher/teachers';
const catalogRevision = url.pathname === '/api/coding/teacher/teachers/revision';
const models = url.pathname === '/api/coding/teacher/models';
const draft = url.pathname === '/api/coding/teacher-preview';
const pending = url.pathname === '/api/coding/teacher-preview/pending-link';
if (!legacy && !conversation && !source && !preview && !projectTopics && !checkIn && !config && !catalog && !catalogRevision && !draft && !pending) return false;
if ((config || catalog || catalogRevision || draft || pending) && req.method !== 'GET') {
if (!legacy && !conversation && !source && !preview && !projectTopics && !checkIn && !config && !catalog && !catalogRevision && !models && !draft && !pending) return false;
if ((config || catalog || catalogRevision || models || draft || pending) && req.method !== 'GET') {
sendJson(res, 405, { error: '不支持此操作。' });
return true;
}
@@ -87,6 +88,12 @@ export async function handleCodingTeacherRoutes(
sendJson(res, 200, await service.catalogRevision());
return true;
}
if (models) {
const runtime = url.searchParams.get('runtime');
if (runtime !== 'local' && runtime !== 'yuxi') throw new TeacherError(422, 'teacher_runtime_invalid', '模型来源无效。');
sendJson(res, 200, await service.models(runtime));
return true;
}
if (catalog) {
sendJson(res, 200, await service.catalog());
return true;