5ea9f0a120
前端创作表单泥点预校验改为读取入口契约配置 拼图和抓大鹅初始生成后端扣费改为解析后台配置 汪汪声浪初始三图生成按入口总成本拆分扣费 创作工作台按钮和确认弹窗展示后台配置泥点成本 补充泥点扣费回归测试并同步文档与共享记忆
311 lines
7.8 KiB
TypeScript
311 lines
7.8 KiB
TypeScript
export const BARK_BATTLE_DIFFICULTY_PRESETS = [
|
|
'easy',
|
|
'normal',
|
|
'hard',
|
|
] as const;
|
|
|
|
export type BarkBattleDifficultyPreset =
|
|
(typeof BARK_BATTLE_DIFFICULTY_PRESETS)[number];
|
|
|
|
export type BarkBattleServerResult = 'player_win' | 'opponent_win' | 'draw';
|
|
|
|
export type BarkBattleFinishStatus =
|
|
| 'accepted'
|
|
| 'accepted_with_flags'
|
|
| 'rejected';
|
|
|
|
export type BarkBattlePlayTypeId = 'bark-battle';
|
|
|
|
export const BARK_BATTLE_ASSET_SLOTS = [
|
|
'player-character',
|
|
'opponent-character',
|
|
'ui-background',
|
|
] as const;
|
|
|
|
export type BarkBattleAssetSlot = (typeof BARK_BATTLE_ASSET_SLOTS)[number];
|
|
|
|
export interface BarkBattleReplacementConfig {
|
|
playerCharacterImageSrc?: string;
|
|
opponentCharacterImageSrc?: string;
|
|
uiBackgroundImageSrc?: string;
|
|
}
|
|
|
|
export type BarkBattleOnomatopoeia = string[];
|
|
|
|
export interface BarkBattleConfigEditorPayload extends BarkBattleReplacementConfig {
|
|
title: string;
|
|
description?: string;
|
|
themeDescription: string;
|
|
playerImageDescription: string;
|
|
opponentImageDescription: string;
|
|
onomatopoeia?: BarkBattleOnomatopoeia;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
}
|
|
|
|
export interface BarkBattleDraftCreateRequest extends BarkBattleConfigEditorPayload {}
|
|
|
|
export interface BarkBattleDraftConfigUpdateRequest
|
|
extends BarkBattleConfigEditorPayload {
|
|
draftId: string;
|
|
workId?: string | null;
|
|
configVersion?: number;
|
|
rulesetVersion?: string;
|
|
}
|
|
|
|
export interface BarkBattleWorkPublishRequest {
|
|
draftId: string;
|
|
workId: string;
|
|
publishedSnapshot?: BarkBattleConfigEditorPayload;
|
|
}
|
|
|
|
export interface BarkBattleImageAssetGenerateRequest {
|
|
slot: BarkBattleAssetSlot;
|
|
draftId?: string | null;
|
|
billingPurpose?: 'initial_draft_generation' | null;
|
|
config: BarkBattleConfigEditorPayload;
|
|
}
|
|
|
|
export interface BarkBattleGeneratedImageAsset {
|
|
imageSrc: string;
|
|
assetId: string;
|
|
sourceType?: 'generated' | string;
|
|
model: string;
|
|
size: string;
|
|
taskId: string;
|
|
prompt: string;
|
|
actualPrompt?: string;
|
|
}
|
|
|
|
export interface BarkBattleDraftConfig extends BarkBattleConfigEditorPayload {
|
|
draftId: string;
|
|
workId?: string;
|
|
configVersion?: number;
|
|
rulesetVersion?: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattlePublishedConfig {
|
|
workId: string;
|
|
draftId?: string | null;
|
|
configVersion: number;
|
|
rulesetVersion: string;
|
|
playTypeId: BarkBattlePlayTypeId;
|
|
title: string;
|
|
description?: string;
|
|
themeDescription: string;
|
|
playerImageDescription: string;
|
|
opponentImageDescription: string;
|
|
onomatopoeia?: BarkBattleOnomatopoeia;
|
|
playerCharacterImageSrc?: string;
|
|
opponentCharacterImageSrc?: string;
|
|
uiBackgroundImageSrc?: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
updatedAt: string;
|
|
publishedAt: string;
|
|
}
|
|
|
|
export type BarkBattleWorkStatus = 'draft' | 'published';
|
|
|
|
export type BarkBattleGenerationStatus =
|
|
| 'pending_assets'
|
|
| 'ready'
|
|
| 'partial_failed'
|
|
| string;
|
|
|
|
export interface BarkBattleWorkSummary {
|
|
workId: string;
|
|
draftId?: string | null;
|
|
ownerUserId: string;
|
|
authorDisplayName: string;
|
|
title: string;
|
|
summary: string;
|
|
themeDescription: string;
|
|
playerImageDescription: string;
|
|
opponentImageDescription: string;
|
|
onomatopoeia?: BarkBattleOnomatopoeia;
|
|
playerCharacterImageSrc?: string | null;
|
|
opponentCharacterImageSrc?: string | null;
|
|
uiBackgroundImageSrc?: string | null;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
status: BarkBattleWorkStatus;
|
|
generationStatus?: BarkBattleGenerationStatus | null;
|
|
publishReady: boolean;
|
|
playCount: number;
|
|
finishCount?: number;
|
|
winCount?: number;
|
|
drawCount?: number;
|
|
lossCount?: number;
|
|
recentPlayCount7d?: number;
|
|
updatedAt: string;
|
|
publishedAt?: string | null;
|
|
}
|
|
|
|
export interface BarkBattleWorksResponse {
|
|
items: BarkBattleWorkSummary[];
|
|
}
|
|
|
|
export interface BarkBattleWorkDetailResponse {
|
|
item: BarkBattleWorkSummary;
|
|
}
|
|
|
|
export interface BarkBattleRuntimeConfig {
|
|
workId: string;
|
|
configVersion: number;
|
|
rulesetVersion: string;
|
|
playTypeId: BarkBattlePlayTypeId;
|
|
durationMs: number;
|
|
energyMin: number;
|
|
energyMax: number;
|
|
drawThreshold: number;
|
|
minBarkGapMs: number;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
themeDescription: string;
|
|
playerImageDescription: string;
|
|
opponentImageDescription: string;
|
|
onomatopoeia?: BarkBattleOnomatopoeia;
|
|
playerCharacterImageSrc?: string;
|
|
opponentCharacterImageSrc?: string;
|
|
uiBackgroundImageSrc?: string;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattleRunStartRequest {
|
|
workId: string;
|
|
configVersion?: number;
|
|
sourceRoute?: string;
|
|
clientRuntimeVersion?: string;
|
|
}
|
|
|
|
export interface BarkBattleRunStartResponse {
|
|
runId: string;
|
|
runToken: string;
|
|
workId: string;
|
|
configVersion: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
runtimeConfig: BarkBattleRuntimeConfig;
|
|
serverStartedAt: string;
|
|
expiresAt: string;
|
|
}
|
|
|
|
export interface BarkBattleDerivedMetrics {
|
|
triggerCount: number;
|
|
maxVolume: number;
|
|
averageVolume: number;
|
|
finalEnergy: number;
|
|
comboMax: number;
|
|
}
|
|
|
|
export interface BarkBattleRunFinishRequest {
|
|
runId: string;
|
|
runToken: string;
|
|
workId: string;
|
|
configVersion: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
clientStartedAt: string;
|
|
clientFinishedAt: string;
|
|
durationMs: number;
|
|
derivedMetrics: BarkBattleDerivedMetrics;
|
|
clientResult?: BarkBattleServerResult;
|
|
sampleDigest?: string;
|
|
clientRuntimeVersion?: string;
|
|
}
|
|
|
|
export interface BarkBattleScoreSummary extends BarkBattleDerivedMetrics {
|
|
durationMs: number;
|
|
}
|
|
|
|
export interface BarkBattleFinishResponse {
|
|
status: BarkBattleFinishStatus;
|
|
runId: string;
|
|
workId: string;
|
|
configVersion: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
serverResult: BarkBattleServerResult;
|
|
scoreSummary: BarkBattleScoreSummary;
|
|
leaderboardScore?: number;
|
|
antiCheatFlags: string[];
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattleLeaderboardEntry {
|
|
rank: number;
|
|
runId: string;
|
|
workId: string;
|
|
configVersion: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
displayName: string;
|
|
serverResult: BarkBattleServerResult;
|
|
scoreSummary: BarkBattleScoreSummary;
|
|
leaderboardScore: number;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattleLeaderboardResponse {
|
|
workId: string;
|
|
configVersion?: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
entries: BarkBattleLeaderboardEntry[];
|
|
viewerBest?: BarkBattleLeaderboardEntry | null;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattlePersonalHistoryItem {
|
|
runId: string;
|
|
workId: string;
|
|
configVersion: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
serverResult: BarkBattleServerResult;
|
|
scoreSummary: BarkBattleScoreSummary;
|
|
leaderboardScore?: number;
|
|
antiCheatFlags: string[];
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattlePersonalBestSummary {
|
|
workId: string;
|
|
configVersion?: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
bestLeaderboardScore?: number;
|
|
bestFinalEnergy?: number;
|
|
bestTriggerCount?: number;
|
|
bestMaxVolume?: number;
|
|
winCount: number;
|
|
drawCount: number;
|
|
lossCount: number;
|
|
finishCount: number;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattlePersonalHistoryResponse {
|
|
workId?: string;
|
|
difficultyPreset?: BarkBattleDifficultyPreset;
|
|
items: BarkBattlePersonalHistoryItem[];
|
|
bestSummary?: BarkBattlePersonalBestSummary | null;
|
|
updatedAt: string;
|
|
}
|
|
|
|
export interface BarkBattleWorkStats {
|
|
workId: string;
|
|
configVersion?: number;
|
|
rulesetVersion: string;
|
|
difficultyPreset: BarkBattleDifficultyPreset;
|
|
playStartCount: number;
|
|
finishCount: number;
|
|
winCount: number;
|
|
drawCount: number;
|
|
lossCount: number;
|
|
flaggedCount: number;
|
|
leaderboardEntryCount: number;
|
|
bestLeaderboardScore?: number;
|
|
bestFinalEnergy?: number;
|
|
averageFinalEnergy?: number;
|
|
updatedAt: string;
|
|
}
|