-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.ts
68 lines (64 loc) · 1.6 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
56
57
58
59
60
61
62
63
64
65
66
67
68
export interface ChatMessage {
//message?: string;
messages: string[];
activeIdx: number;
date: number;
persona: 'user' | 'char' | 'narrator' | 'system';
state?: 'pinned' | 'pruned' | 'none';
affinity?: number;
direction?: string;
}
export enum SocketEventEnum {
ADD_MESSAGE_AND_REPLY = 'addMessage',
ADD_MESSAGE_NO_REPLY = 'addMessageNoPrompt',
ADD_MESSAGE_AND_CONTINUE = 'triggerChar',
CONTINUE = 'continue',
RETRY = 'retry',
STOP = 'stop',
CUT = 'cut',
PRUNE = 'prune',
EDIT_MESSAGE = 'editMessage',
DELETE_MESSAGE = 'deleteMessage',
TOGGLE_PIN_MESSAGE = 'togglePinMessage',
BRANCH_AT_MESSAGE = 'branchAtMessage',
CHATS_LIST = 'chatsList',
LOAD_CHAT = 'loadChat',
DELETE_CHAT = 'deleteChat',
TOGGLE_SPECIAL = 'toggleSpecial',
TOGGLE_AWAY = 'toggleAway',
}
export enum SocketServerEventEnum {
MESSAGE_RECEIVED = 'messageReceived',
MESSAGE_CHUNK_RECEIVED = 'messageChunkReceived',
MESSAGE_DELETED = 'messageDeleted',
MESSAGE_CHAT_RECEIVED = 'chatReceived',
STREAM_END = 'streamEnd',
CUTOFF_POSITION = 'cutoffPosition',
CHATS_LIST = 'chatsList',
}
export enum CommandEnum {
PLAY_MUSIC = 'playMusic',
PAUSE_MUSIC = 'pauseMusic',
ENABLE_SPECIAL = 'enableSpecial',
DISABLE_SPECIAL = 'disableSpecial',
STATUS = 'updateStatus',
}
export interface ChatListEntry {
lastMessage: ChatMessage;
id: number; // is also date
active: boolean;
system: string;
personas: {
role: ChatMessage['persona'];
name: string;
avatars: {
default: string;
affinity_1?: string;
affinity_2?: string;
affinity_3?: string;
affinity_4?: string;
affinity_5?: string;
special?: string;
};
}[];
}