feat: add puzzle clear template runtime

This commit is contained in:
2026-06-03 22:11:46 +08:00
parent 6e74cf5add
commit 1b5e098225
148 changed files with 19588 additions and 241 deletions

View File

@@ -5,6 +5,7 @@ import {
buildJumpHopGenerationAnchorEntries,
buildMatch3DGenerationAnchorEntries,
buildMiniGameDraftGenerationProgress,
buildPuzzleClearGenerationAnchorEntries,
buildPuzzleGenerationAnchorEntries,
buildWoodenFishGenerationAnchorEntries,
createMiniGameDraftGenerationState,
@@ -599,11 +600,11 @@ describe('miniGameDraftGenerationProgress', () => {
floatingWords: ['幸运+1', '功德+1'],
});
expect(entries).toEqual([
{
id: 'wooden-fish-hit-object',
label: '敲击物',
value: '金色小木鱼',
expect(entries).toEqual([
{
id: 'wooden-fish-hit-object',
label: '敲击物',
value: '金色小木鱼',
},
{
id: 'wooden-fish-hit-sound',
@@ -614,11 +615,61 @@ describe('miniGameDraftGenerationProgress', () => {
id: 'wooden-fish-words',
label: '飘字',
value: '幸运+1、功德+1',
},
]);
});
test('puzzle clear draft generation exposes atlas and slice pipeline', () => {
const state = createMiniGameDraftGenerationState('puzzle-clear');
const progress = buildMiniGameDraftGenerationProgress(
state,
state.startedAtMs + 190_000,
);
expect(progress?.steps.map((step) => step.id)).toEqual([
'puzzle-clear-draft',
'puzzle-clear-background',
'puzzle-clear-atlas',
'puzzle-clear-slices',
'puzzle-clear-write-draft',
]);
expect(progress?.phaseId).toBe('puzzle-clear-atlas');
expect(progress?.phaseLabel).toBe('生成复合图集');
expect(progress?.estimatedRemainingMs).toBe(430_000);
});
test('puzzle clear generation anchors expose title, theme and background mode', () => {
const entries = buildPuzzleClearGenerationAnchorEntries(null, {
templateId: 'puzzle-clear',
workTitle: '星港拼消消',
workDescription: '星港主题连续消除。',
themePrompt: '霓虹星港',
boardBackgroundPrompt: '美少女',
generateBoardBackground: true,
boardBackgroundAsset: null,
});
expect(entries).toEqual([
{
id: 'puzzle-clear-title',
label: '作品',
value: '星港拼消消',
},
{
id: 'puzzle-clear-theme',
label: '主题',
value: '霓虹星港',
},
{
id: 'puzzle-clear-background',
label: '底图',
value: '美少女',
},
]);
});
test('puzzle generation anchors expose form payload as the display source', () => {
test('puzzle generation anchors expose form payload as the display source', () => {
const entries = buildPuzzleGenerationAnchorEntries({
sessionId: 'puzzle-session-1',
currentTurn: 1,