扩展外部生成Worker队列
新增外部生成队列概览和单任务状态契约 将跳一跳、拼消消、敲木鱼图片生成动作接入worker队列 前端生成等待页展示当前任务和队列数量 更新外部生成worker运维文档和团队决策记录
This commit is contained in:
29
packages/shared/src/contracts/externalGeneration.ts
Normal file
29
packages/shared/src/contracts/externalGeneration.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
export type ExternalGenerationJobStatus =
|
||||
| 'queued'
|
||||
| 'running'
|
||||
| 'completed'
|
||||
| 'failed';
|
||||
|
||||
export interface ExternalGenerationQueueOverview {
|
||||
pendingCount: number;
|
||||
runningCount: number;
|
||||
updatedAtMicros: number;
|
||||
}
|
||||
|
||||
export interface ExternalGenerationQueueOverviewResponse {
|
||||
overview: ExternalGenerationQueueOverview;
|
||||
}
|
||||
|
||||
export interface ExternalGenerationJobStatusRecord {
|
||||
operationId: string;
|
||||
status: ExternalGenerationJobStatus;
|
||||
phaseLabel: string;
|
||||
phaseDetail: string;
|
||||
progress: number;
|
||||
error?: string | null;
|
||||
updatedAtMicros: number;
|
||||
}
|
||||
|
||||
export interface ExternalGenerationJobStatusResponse {
|
||||
job: ExternalGenerationJobStatusRecord;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { ExternalGenerationJobStatusRecord } from './externalGeneration';
|
||||
|
||||
export type JumpHopDifficulty = 'easy' | 'standard' | 'advanced' | 'challenge';
|
||||
|
||||
export type JumpHopStylePreset =
|
||||
@@ -206,6 +208,7 @@ export interface JumpHopActionResponse {
|
||||
actionType: JumpHopActionType;
|
||||
session: JumpHopSessionSnapshotResponse;
|
||||
work: JumpHopWorkProfileResponse | null;
|
||||
queueState?: ExternalGenerationJobStatusRecord | null;
|
||||
}
|
||||
|
||||
export interface JumpHopWorkSummaryResponse {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { PuzzleAgentSessionSnapshot } from './puzzleAgentSession';
|
||||
import type { ExternalGenerationJobStatusRecord } from './externalGeneration';
|
||||
|
||||
export type PuzzleAgentSuggestedActionType =
|
||||
| 'request_summary'
|
||||
@@ -41,6 +42,7 @@ export interface PuzzleAgentOperationRecord {
|
||||
phaseDetail: string;
|
||||
progress: number;
|
||||
error?: string | null;
|
||||
queueState?: ExternalGenerationJobStatusRecord | null;
|
||||
}
|
||||
|
||||
export type PuzzleAgentActionRequest =
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { ExternalGenerationJobStatusRecord } from './externalGeneration';
|
||||
|
||||
export type PuzzleClearGenerationStatus = 'draft' | 'generating' | 'ready' | 'failed';
|
||||
|
||||
export type PuzzleClearShapeKind = '1x2' | '1x3' | '2x2' | '2x3';
|
||||
@@ -109,6 +111,7 @@ export interface PuzzleClearActionResponse {
|
||||
actionType: PuzzleClearActionType;
|
||||
session: PuzzleClearSessionSnapshotResponse;
|
||||
work: PuzzleClearWorkProfileResponse | null;
|
||||
queueState?: ExternalGenerationJobStatusRecord | null;
|
||||
}
|
||||
|
||||
export interface PuzzleClearWorkSummaryResponse {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { ExternalGenerationJobStatusRecord } from './externalGeneration';
|
||||
|
||||
export type WoodenFishGenerationStatus =
|
||||
| 'draft'
|
||||
| 'generating'
|
||||
@@ -104,6 +106,7 @@ export interface WoodenFishActionResponse {
|
||||
actionType: WoodenFishActionType;
|
||||
session: WoodenFishSessionSnapshotResponse;
|
||||
work: WoodenFishWorkProfileResponse | null;
|
||||
queueState?: ExternalGenerationJobStatusRecord | null;
|
||||
}
|
||||
|
||||
export interface WoodenFishWorkSummaryResponse {
|
||||
|
||||
@@ -8,6 +8,7 @@ export type * from './contracts/creativeAgent';
|
||||
export type * from './contracts/customWorldAgent';
|
||||
export * from './contracts/edutainmentBabyDrawing';
|
||||
export * from './contracts/edutainmentBabyObject';
|
||||
export * from './contracts/externalGeneration';
|
||||
export type * from './contracts/hyper3d';
|
||||
export * from './contracts/match3dAgent';
|
||||
export * from './contracts/match3dRuntime';
|
||||
|
||||
Reference in New Issue
Block a user