@@ -2,9 +2,9 @@ import type {
|
||||
CreateMatch3DSessionRequest,
|
||||
ExecuteMatch3DActionRequest,
|
||||
Match3DActionResponse,
|
||||
Match3DAnchorItemResponse,
|
||||
Match3DAgentMessageResponse,
|
||||
Match3DAgentSessionSnapshot,
|
||||
Match3DAnchorItemResponse,
|
||||
Match3DCreatorConfig,
|
||||
Match3DSessionResponse,
|
||||
SendMatch3DMessageRequest,
|
||||
@@ -24,7 +24,7 @@ let match3dSessionCounter = 0;
|
||||
const mockSessions = new Map<string, Match3DAgentSessionSnapshot>();
|
||||
|
||||
function delay(ms = MOCK_RESPONSE_DELAY_MS) {
|
||||
return new Promise<void>((resolve) => window.setTimeout(resolve, ms));
|
||||
return new Promise<void>((resolve) => globalThis.setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
function nowIso() {
|
||||
@@ -189,7 +189,7 @@ function updateSessionConfig(
|
||||
return {
|
||||
...session,
|
||||
progressPercent,
|
||||
stage: progressPercent >= 100 ? 'ready_to_compile' : 'collecting',
|
||||
stage: 'collecting_config',
|
||||
anchorPack: buildAnchorPack(partialConfig),
|
||||
config,
|
||||
updatedAt: nowIso(),
|
||||
@@ -237,7 +237,7 @@ export async function createMatch3DCreationSession(
|
||||
sessionId,
|
||||
currentTurn: 0,
|
||||
progressPercent: 0,
|
||||
stage: 'collecting',
|
||||
stage: 'collecting_config',
|
||||
anchorPack: buildAnchorPack(partialConfig),
|
||||
config: null,
|
||||
draft: null,
|
||||
@@ -271,7 +271,7 @@ export async function streamMatch3DCreationMessage(
|
||||
await delay(120);
|
||||
const session = ensureMockSession(sessionId);
|
||||
const text = payload.text.trim();
|
||||
const currentConfig = session.config ?? {
|
||||
const currentConfig: Partial<Match3DCreatorConfig> = session.config ?? {
|
||||
themeText: session.anchorPack.theme.value,
|
||||
clearCount: Number(session.anchorPack.clearCount.value) || undefined,
|
||||
difficulty: Number(session.anchorPack.difficulty.value) || undefined,
|
||||
@@ -337,7 +337,7 @@ export async function executeMatch3DCreationAction(
|
||||
|
||||
const nextSession = {
|
||||
...session,
|
||||
stage: 'draft_compiled',
|
||||
stage: 'draft_ready',
|
||||
progressPercent: 100,
|
||||
config,
|
||||
draft: buildDraft(config),
|
||||
|
||||
Reference in New Issue
Block a user