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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions client/src/api/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import type { BaseCharacter } from "@ai-novel/shared/types/novel";
import { apiClient } from "./client";

export interface CharacterGenerateConstraints {
storyFunction?: "主角" | "反派" | "导师" | "对照组" | "配角";
storyFunction?: "main character" | "Villain" | "tutor" | "control group" | "supporting role";
externalGoal?: string;
internalNeed?: string;
coreFear?: string;
moralBottomLine?: string;
secret?: string;
coreFlaw?: string;
relationshipHooks?: string;
growthStage?: "起点" | "受挫" | "转折" | "觉醒" | "收束";
growthStage?: "starting point" | "frustrated" | "turning point" | "Error 500 (Server Error)!!1500.That’s an error.There was an error. Please try again later.That’s all we know." | "Error 500 (Server Error)!!1500.That’s an error.There was an error. Please try again later.That’s all we know.";
toneStyle?: string;
}

Expand Down
8 changes: 4 additions & 4 deletions client/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ apiClient.interceptors.response.use(
const backendError = error.response?.data?.error;
const backendMessage = error.response?.data?.message;
const silentErrorStatuses = error.config?.silentErrorStatuses ?? [];
let title = backendError ?? error.message ?? "请求失败。";
let title = backendError ?? error.message ?? "The request failed.";
let description = backendMessage && backendMessage !== backendError ? backendMessage : undefined;

if (!status) {
title = "网络连接失败,请检查网络后重试。";
title = "Network connection failed, please check the network and try again.";
description = undefined;
} else if (status >= 500) {
title = backendError ?? "服务器错误,请稍后重试。";
title = backendError ?? "Server error, please try again later.";
description = backendMessage && backendMessage !== title ? backendMessage : undefined;
}

if (!status || !silentErrorStatuses.includes(status)) {
const isGenericServerErrorToast = title === "服务器错误,请稍后重试。";
const isGenericServerErrorToast = title === "Server error, please try again later.";

if (description) {
toast.error(
Expand Down
2 changes: 1 addition & 1 deletion client/src/api/creativeHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { apiClient } from "./client";
function ensureThreadId(threadId: string): string {
const normalized = threadId.trim();
if (!normalized) {
throw new Error("创作中枢线程不存在,请先创建线程。");
throw new Error("The creation hub thread does not exist, please create a thread first.");
}
return normalized;
}
Expand Down
13 changes: 1 addition & 12 deletions client/src/api/drama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,18 +570,7 @@ export async function downloadDramaEpisodeExport(id: string, order: number, form
// ─────────────────────────────────────────────────────────────────────────────

export async function getDramaCharacterImageStatus(id: string, characterId: string) {
const { data } = await apiClient.get<ApiResponse<{ portrait: DramaCharacterPortraitData; threeView: DramaCharacterThreeViewItem[] }>>(
`/drama/projects/${id}/characters/${characterId}/image-status`,
);
return data;
}

/** 生成角色设计稿(面部特写 + 三视图合图,推荐使用) */
export async function prepareDramaCharacterSheet(
id: string,
characterId: string,
provider?: string,
): Promise<ApiResponse<ImageGenerationPreview>> {
const { data } = await apiClient.get<ApiResponse<{ portrait: DramaCharacterPortraitData; threeView: DramaCharacterThreeViewItem[] }>>( `/drama/projects/${id}/characters/${characterId}/image-status`, ); return data; } /** Generate character design drafts (facial close-up + three-view composite image, recommended) */ export async function prepareDramaCharacterSheet( id: string, characterId: string, provider?: string, ): Promise<ApiResponse<ImageGenerationPreview>> {
const { data } = await apiClient.post<ApiResponse<ImageGenerationPreview>>(
`/drama/projects/${id}/characters/${characterId}/prepare-character-sheet`,
provider ? { provider } : {},
Expand Down
13 changes: 1 addition & 12 deletions client/src/api/novel/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,7 @@ export async function deleteCreativeDecision(id: string, decisionId: string) {
}

export async function batchInvalidateCreativeDecisions(id: string, decisionIds: string[]) {
const { data } = await apiClient.post<ApiResponse<{ count: number; expiresAt: number }>>(
`/novels/${id}/creative-decisions/batch-invalidate`,
{ decisionIds },
);
return data;
}

/**
* [开发工具] 重置指定小说的所有章节正文及相关生成数据,供测试重跑使用。
* 清除范围:章节正文、生成状态、事实账本、章节摘要、质量报告等。
*/
export async function devResetNovelChapters(id: string): Promise<{ resetCount: number }> {
const { data } = await apiClient.post<ApiResponse<{ count: number; expiresAt: number }>>( `/novels/${id}/creative-decisions/batch-invalidate`, { decisionIds }, ); return data; } /** * [Development Tools] Resets all chapter text and related generated data for the specified novel for testing reruns. * Scope of clearing: chapter text, generation status, fact ledger, chapter summary, quality report, etc. */ export async function devResetNovelChapters(id: string): Promise<{ resetCount: number }> {
const { data } = await apiClient.post<ApiResponse<{ resetCount: number }>>(
`/novels/${id}/dev/reset-chapters`,
{},
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/assetLibrary/AssetLibrarySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function AssetLibraryRecommendation(props: {
const Icon = props.icon;
return (
<section
aria-label="推荐下一步"
aria-label="Error 500 (Server Error)!!1500.That’s an error.There was an error. Please try again later.That’s all we know."
className={cn(
"flex flex-col gap-4 rounded-md border px-4 py-3 sm:flex-row sm:items-center sm:justify-between",
recommendationToneClass[props.tone ?? "info"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const toneClass: Record<AssetLibraryTone, string> = {

export default function AssetLibraryStatusGrid(props: { items: AssetLibraryStatusItem[] }) {
return (
<section aria-label="资产状态" className="grid gap-3 sm:grid-cols-2 xl:grid-cols-4">
<section aria-label="Asset status" className="grid gap-3 sm:grid-cols-2 xl:grid-cols-4">
{props.items.map((item) => {
const Icon = item.icon;
return (
Expand Down
Loading