-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
126 lines (115 loc) · 2.55 KB
/
types.ts
File metadata and controls
126 lines (115 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import type { ReactNode } from 'react';
// Player now has a description that can be used to generate its avatar
export interface Player {
name: string;
description: string;
imageUrl: string | null;
imageIsLoading: boolean;
level: number;
resonance: number;
maxResonance: number;
realityStrain: number;
}
export interface Ability {
id: string; // e.g., 'ability1', 'ability2'
name: string;
iconType: 'flora' | 'materia' | 'aether' | 'unformed';
isGlitched: boolean;
description: string;
}
export interface ChatMessage {
author: string; // Changed from 'Player' | 'AI' to support multiple speakers
text: string;
isThinking?: boolean;
}
export interface Choice {
text: string;
}
export interface Quest {
title: string;
description: string;
imagePrompt: string;
imageUrl: string | null;
imageIsLoading: boolean;
}
export interface InventoryItem {
name: string;
description: string;
imagePrompt: string;
imageUrl: string | null;
imageIsLoading: boolean;
}
export interface Character {
name: string;
description: string;
imagePrompt: string;
imageUrl: string | null;
imageIsLoading: boolean;
}
export interface CodexEntry {
name: string;
description: string;
imagePrompt: string;
imageUrl: string | null;
imageIsLoading: boolean;
}
// The background is now a full object, to be dynamically generated
export interface Background {
seed: string;
description: string;
imageUrl: string | null;
imageIsLoading: boolean;
}
export interface AIResponsePayload {
chat: {
author: string;
text: string;
};
choices?: Choice[];
quest?: {
title: string;
description: string;
imagePrompt: string;
};
storySummaryUpdate?: string;
background?: {
seed: string;
description: string;
};
newCharacter?: {
name: string;
description: string;
imagePrompt: string;
};
newInventoryItem?: {
name: string;
description: string;
imagePrompt: string;
};
newCodexEntry?: {
name: string;
description: string;
imagePrompt: string;
};
playerUpdate?: {
description: string;
};
grantResonance?: number;
generatedAbilities?: {
name: string;
description: string;
iconType: 'flora' | 'materia' | 'aether';
}[];
}
export interface WorldState {
player: Player;
abilities: Ability[];
chatHistory: ChatMessage[];
currentQuest: Quest;
interactionHistory: string[];
background: Background; // Changed from backgroundSeed
inventory: InventoryItem[];
characters: Character[];
codex: CodexEntry[];
storySummary: string;
}