This commit is contained in:
65
packages/shared/src/contracts/puzzleAgentActions.ts
Normal file
65
packages/shared/src/contracts/puzzleAgentActions.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { PuzzleAgentSessionSnapshot } from './puzzleAgentSession';
|
||||
|
||||
export type PuzzleAgentSuggestedActionType =
|
||||
| 'request_summary'
|
||||
| 'compile_puzzle_draft'
|
||||
| 'generate_puzzle_images'
|
||||
| 'publish_puzzle_work';
|
||||
|
||||
export interface PuzzleAgentSuggestedAction {
|
||||
id: string;
|
||||
actionType: PuzzleAgentSuggestedActionType;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export type PuzzleAgentActionType =
|
||||
| 'compile_puzzle_draft'
|
||||
| 'generate_puzzle_images'
|
||||
| '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: 'compile_puzzle_draft' }
|
||||
| {
|
||||
action: 'generate_puzzle_images';
|
||||
promptText?: string | null;
|
||||
candidateCount?: number;
|
||||
}
|
||||
| {
|
||||
action: 'select_puzzle_image';
|
||||
candidateId: string;
|
||||
}
|
||||
| {
|
||||
action: 'publish_puzzle_work';
|
||||
levelName?: string;
|
||||
summary?: string;
|
||||
themeTags?: string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* 拼图操作接口直接返回最新会话,避免前端在选图等轻操作后再额外 GET 大体积快照。
|
||||
*/
|
||||
export interface PuzzleAgentActionResponse {
|
||||
operation: PuzzleAgentOperationRecord;
|
||||
session: PuzzleAgentSessionSnapshot;
|
||||
}
|
||||
Reference in New Issue
Block a user