-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
55 lines (49 loc) · 1.21 KB
/
types.ts
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
import { Stream } from "ssh2";
export interface Message {
role: "user" | "assistant";
content: string;
}
export interface ClientSession {
id: string;
buffer: string;
lastRequest: number;
requestCount: number;
conversation: Message[];
startTime: number;
model: string;
systemPrompt: string;
temperature: number;
userId: string | null;
username: string | null;
credits: number;
stream: Stream;
currentCharacter: Character | null;
isInAdventure: boolean;
adventureConversation: Message[];
clientIP: string;
inputHandler: ((data: Buffer) => void) | null;
cursorPos: number;
gameEndChoice?: boolean;
writeToStream(message: string, addPrompt?: boolean): void;
writeCommandOutput(message: string, addPrompt?: boolean): void;
handleCommand(cmd: string): Promise<boolean>;
handleMessage(message: string): Promise<void>;
streamResponse(userMessage: string): Promise<void>;
}
export interface Character {
id: string;
name: string;
system_prompt: string;
}
export interface AutoLoginInfo {
username: string;
userId: string;
credits: number;
selected_model: string;
}
export interface Account {
id: string;
username: string;
credits: number;
password_hash: string;
}