Files
Genarrative/packages/shared/src/contracts/puzzleAgentActions.ts
高物 74fd9a33ac Increase VectorEngine timeouts and add image UI
Add VectorEngine image generation config and raise request timeouts (env + scripts) from 180000 to 1000000ms. Introduce a reusable CreativeImageInputPanel component with tests and wire up mobile keyboard-focus helpers; update generation views and related tests (CustomWorldGenerationView, BarkBattle editor, Match3D, Puzzle flows). Improve API error handling / VectorEngine request guidance (packages/shared http.ts and docs), and apply multiple backend/frontend fixes for puzzle/match3d/prompt handling. Also include extensive docs and decision-log updates describing UI/UX decisions and verification steps.
2026-05-15 02:40:59 +08:00

126 lines
3.2 KiB
TypeScript

import type { PuzzleAgentSessionSnapshot } from './puzzleAgentSession';
export type PuzzleAgentSuggestedActionType =
| 'request_summary'
| 'compile_puzzle_draft'
| 'generate_puzzle_images'
| 'generate_puzzle_ui_background'
| 'generate_puzzle_tags'
| 'publish_puzzle_work';
export interface PuzzleAgentSuggestedAction {
id: string;
actionType: PuzzleAgentSuggestedActionType;
label: string;
}
export type PuzzleAgentActionType =
| 'save_puzzle_form_draft'
| 'compile_puzzle_draft'
| 'generate_puzzle_images'
| 'generate_puzzle_ui_background'
| 'generate_puzzle_tags'
| 'select_puzzle_image'
| 'publish_puzzle_work';
export type PuzzleAgentOperationType =
| 'process_message'
| PuzzleAgentActionType;
export type PuzzleAgentOperationStatus =
| 'queued'
| 'running'
| 'completed'
| 'failed';
export interface PuzzleAgentOperationRecord {
operationId: string;
type: PuzzleAgentOperationType;
status: PuzzleAgentOperationStatus;
phaseLabel: string;
phaseDetail: string;
progress: number;
error?: string | null;
}
export type PuzzleAgentActionRequest =
| {
action: 'save_puzzle_form_draft';
promptText?: string | null;
workTitle?: string;
workDescription?: string;
pictureDescription?: string;
referenceImageSrc?: string | null;
referenceImageSrcs?: string[];
imageModel?: string | null;
aiRedraw?: boolean;
}
| {
action: 'compile_puzzle_draft';
promptText?: string | null;
workTitle?: string;
workDescription?: string;
pictureDescription?: string;
referenceImageSrc?: string | null;
referenceImageSrcs?: string[];
imageModel?: string | null;
aiRedraw?: boolean;
candidateCount?: number;
}
| {
action: 'generate_puzzle_images';
levelId?: string | null;
promptText?: string | null;
referenceImageSrc?: string | null;
referenceImageSrcs?: string[];
imageModel?: string | null;
aiRedraw?: boolean;
candidateCount?: number;
workTitle?: string;
workDescription?: string;
summary?: string;
themeTags?: string[];
levelsJson?: string;
}
| {
action: 'generate_puzzle_ui_background';
levelId?: string | null;
promptText: string;
workTitle?: string;
workDescription?: string;
summary?: string;
themeTags?: string[];
levelsJson?: string;
}
| {
action: 'generate_puzzle_tags';
workTitle: string;
workDescription: string;
levelName?: string;
summary?: string;
themeTags?: string[];
levelsJson?: string;
}
| {
action: 'select_puzzle_image';
levelId?: string | null;
candidateId: string;
}
| {
action: 'publish_puzzle_work';
workTitle?: string;
workDescription?: string;
levelName?: string;
summary?: string;
themeTags?: string[];
levelsJson?: string;
};
/**
* 拼图操作接口直接返回最新会话,避免前端在选图等轻操作后再额外 GET 大体积快照。
*/
export interface PuzzleAgentActionResponse {
operation: PuzzleAgentOperationRecord;
session: PuzzleAgentSessionSnapshot;
}