扩展外部生成Worker队列

新增外部生成队列概览和单任务状态契约

将跳一跳、拼消消、敲木鱼图片生成动作接入worker队列

前端生成等待页展示当前任务和队列数量

更新外部生成worker运维文档和团队决策记录
This commit is contained in:
2026-06-12 23:15:55 +08:00
parent 3bccfd1a83
commit 951caac32d
43 changed files with 1913 additions and 67 deletions
@@ -70,4 +70,28 @@ describe('UnifiedGenerationPage', () => {
expect(screen.queryByText('当前跳一跳信息')).toBeNull();
expect(screen.queryByText('云端糖果塔')).toBeNull();
});
test('显示外部生成队列状态', () => {
render(
<UnifiedGenerationPage
playId="puzzle"
settingText="一只发光的纸船"
progress={createProgress()}
isGenerating
queueStatus={{
currentStatus: 'queued',
currentProgress: 18,
pendingCount: 6,
runningCount: 2,
}}
onBack={() => {}}
onEditSetting={() => {}}
onRetry={() => {}}
/>,
);
expect(screen.getByText('排队中 18%')).toBeTruthy();
expect(screen.getByText('排队 6')).toBeTruthy();
expect(screen.getByText('生成 2')).toBeTruthy();
});
});
@@ -1,6 +1,9 @@
import type { CustomWorldGenerationProgress } from '../../../packages/shared/src/contracts/runtime';
import type { CustomWorldStructuredAnchorEntry } from '../../services/customWorldAgentGenerationProgress';
import { CustomWorldGenerationView } from '../CustomWorldGenerationView';
import {
CustomWorldGenerationView,
type ExternalGenerationQueueStatus,
} from '../CustomWorldGenerationView';
import type { UnifiedGenerationPlayId } from './unifiedGenerationCopy';
import { getUnifiedGenerationCopy } from './unifiedGenerationCopy';
@@ -15,6 +18,7 @@ type UnifiedGenerationPageProps = {
onEditSetting: () => void;
onRetry: () => void;
hideBatchModule?: boolean;
queueStatus?: ExternalGenerationQueueStatus | null;
};
export function UnifiedGenerationPage({
@@ -28,6 +32,7 @@ export function UnifiedGenerationPage({
onEditSetting,
onRetry,
hideBatchModule = false,
queueStatus = null,
}: UnifiedGenerationPageProps) {
const copy = getUnifiedGenerationCopy(playId);
@@ -51,6 +56,7 @@ export function UnifiedGenerationPage({
pausedBadgeLabel="素材生成已暂停"
idleBadgeLabel="等待返回工作区"
hideBatchModule={hideBatchModule}
queueStatus={queueStatus}
/>
);
}