Skip to content

Commit 6126695

Browse files
authored
1.104.0 (#433)
# PR Checklist - [ ] Did you check if it works normally in all models? *ignore this when it dosen't uses models* - [ ] Did you check if it works normally in all of web, local and node hosted versions? if it dosen't, did you blocked it in those versions? - [ ] Did you added a type def? # Description
2 parents 523ceb0 + 663fcb9 commit 6126695

File tree

13 files changed

+243
-79
lines changed

13 files changed

+243
-79
lines changed

src-tauri/tauri.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "RisuAI",
11-
"version": "1.103.4"
11+
"version": "1.104.0"
1212
},
1313
"tauri": {
1414
"allowlist": {

src/etc/patchNote.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
export const patchNote = {
2-
version: "1.103",
2+
version: "1.104",
33
content:
44
`
5-
# Update 1.103
6-
- Made logit_bias work for all gpt-based multimodal models (#418)
7-
- Added supports of gpt-4o tokenizer for reverse_proxy (#418)
8-
- Added GPT-4o in Custom (OpenAI-compatible) (#419)
9-
- Added Tag autocomplete in RisuRealm upload
10-
- Fixed GPT-4o image multimodal feature not working properly
5+
# Update 1.104
6+
- Added experimental Hypamemory V2
7+
- Added catalog list menu
8+
- Added catalog trash menu
9+
- Added trash
10+
- Now if you delete a character, it will be moved to the trash instead of being deleted permanently
11+
- You can restore the character from the trash
12+
- Characters in the trash will be deleted permanently after 3 days
1113
`
1214
}
1315

src/lang/en.ts

+5
Original file line numberDiff line numberDiff line change
@@ -594,4 +594,9 @@ export const languageEnglish = {
594594
combineTranslation : "Combine Translation",
595595
dynamicAssets: "Dynamic Assets",
596596
dynamicAssetsEditDisplay: "Use Dynamic Assets in Display",
597+
longTermMemory: "Long Term Memory",
598+
grid: "Grid",
599+
list: "List",
600+
trash: "Trash",
601+
trashDesc: "Deleted characters are moved to trash. you can restore or delete them permanently. deleted characters are automatically purged after 3 days.",
597602
}

src/lib/Others/AlertComp.svelte

+43-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import { getFetchData } from 'src/ts/storage/globalApi';
1818
import { CurrentChat } from "src/ts/stores";
1919
import { tokenize } from "src/ts/tokenizer";
20+
import TextAreaInput from "../UI/GUI/TextAreaInput.svelte";
2021
let btn
2122
let input = ''
2223
let cardExportType = ''
@@ -77,7 +78,7 @@
7778
<div class="text-textcolor">You should accept RisuRealm's <a class="text-green-600 hover:text-green-500 transition-colors duration-200 cursor-pointer" on:click={() => {
7879
openURL('https://sv.risuai.xyz/hub/tos')
7980
}}>Terms of Service</a> to continue</div>
80-
{:else if $alertStore.type !== 'select' && $alertStore.type !== 'requestdata' && $alertStore.type !== 'addchar'}
81+
{:else if $alertStore.type !== 'select' && $alertStore.type !== 'requestdata' && $alertStore.type !== 'addchar' && $alertStore.type !== 'hypaV2'}
8182
<span class="text-gray-300">{$alertStore.msg}</span>
8283
{#if $alertStore.submsg}
8384
<span class="text-gray-500 text-sm">{$alertStore.submsg}</span>
@@ -254,6 +255,47 @@
254255
{/if}
255256
{/await}
256257
{/if}
258+
{:else if $alertStore.type === 'hypaV2'}
259+
<div class="flex flex-wrap gap-2 mb-4 max-w-full w-124">
260+
<Button selected={generationInfoMenuIndex === 0} size="sm" on:click={() => {generationInfoMenuIndex = 0}}>
261+
Chunks
262+
</Button>
263+
<Button selected={generationInfoMenuIndex === 1} size="sm" on:click={() => {generationInfoMenuIndex = 1}}>
264+
Summarized
265+
</Button>
266+
<button class="ml-auto" on:click={() => {
267+
alertStore.set({
268+
type: 'none',
269+
msg: ''
270+
})
271+
}}>✖</button>
272+
</div>
273+
{#if generationInfoMenuIndex === 0}
274+
<div class="flex flex-col gap-2 w-full">
275+
{#each $CurrentChat.hypaV2Data.chunks as chunk}
276+
<TextAreaInput bind:value={chunk.text} />
277+
{/each}
278+
279+
<Button on:click={() => {
280+
$CurrentChat.hypaV2Data.chunks.push({
281+
text: '',
282+
targetId: 'all'
283+
})
284+
$CurrentChat.hypaV2Data.chunks = $CurrentChat.hypaV2Data.chunks
285+
}}>+</Button>
286+
</div>
287+
{:else}
288+
{#each $CurrentChat.hypaV2Data.chunks as chunk, i}
289+
<div class="flex flex-col p-2 rounded-md border-darkborderc border">
290+
{#if i === 0}
291+
<span class="text-green-500">Active</span>
292+
{:else}
293+
<span>Inactive</span>
294+
{/if}
295+
<TextAreaInput bind:value={chunk.text} />
296+
</div>
297+
{/each}
298+
{/if}
257299
{:else if $alertStore.type === 'addchar'}
258300
<div class="w-2xl flex flex-col max-w-full">
259301

src/lib/Others/GridCatalog.svelte

+110-39
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,143 @@
11
<script lang="ts">
2-
import { characterFormatUpdate, getCharImage } from "../../ts/characters";
3-
import { DataBase } from "../../ts/storage/database";
2+
import { characterFormatUpdate, getCharImage, removeChar } from "../../ts/characters";
3+
import { DataBase, type Database } from "../../ts/storage/database";
44
import BarIcon from "../SideBars/BarIcon.svelte";
5-
import { User, Users } from "lucide-svelte";
5+
import { ArrowLeft, User, Users, Inspect, TrashIcon, Undo2Icon } from "lucide-svelte";
66
import { selectedCharID } from "../../ts/stores";
77
import TextInput from "../UI/GUI/TextInput.svelte";
8+
import Button from "../UI/GUI/Button.svelte";
9+
import { language } from "src/lang";
10+
import { parseMultilangString } from "src/ts/util";
11+
import { checkCharOrder } from "src/ts/storage/globalApi";
812
export let endGrid = () => {}
913
let search = ''
14+
let selected = 0
1015
1116
function changeChar(index = -1){
1217
characterFormatUpdate(index)
1318
selectedCharID.set(index)
1419
endGrid()
1520
}
1621
17-
function formatChars(search:string){
22+
function formatChars(search:string, db:Database, trash = false){
1823
let charas:{
1924
image:string
2025
index:number
21-
type:string
26+
type:string,
27+
name:string
28+
desc:string
2229
}[] = []
2330
24-
for(let i=0;i<$DataBase.characters.length;i++){
25-
const c = $DataBase.characters[i]
31+
for(let i=0;i<db.characters.length;i++){
32+
const c = db.characters[i]
33+
if(c.trashTime && !trash){
34+
continue
35+
}
36+
if(!c.trashTime && trash){
37+
continue
38+
}
2639
if(c.name.replace(/ /g,"").toLocaleLowerCase().includes(search.toLocaleLowerCase().replace(/ /g,""))){
2740
charas.push({
2841
image: c.image,
2942
index: i,
30-
type: c.type
43+
type: c.type,
44+
name: c.name,
45+
desc: c.creatorNotes ?? 'No description'
3146
})
3247
}
3348
}
3449
return charas
35-
3650
}
3751
</script>
3852

3953
<div class="h-full w-full flex justify-center">
40-
<div class="h-full p-2 bg-darkbg max-w-full w-2xl flex items-center flex-col ">
41-
<h1 class="text-textcolor text-2xl font-bold mt-2">Catalog</h1>
42-
<TextInput placeholder="Search" bind:value={search} size="lg" autocomplete="off" marginBottom={true}/>
43-
<div class="w-full flex justify-center">
44-
<div class="flex flex-wrap gap-2 mx-auto container">
45-
{#each formatChars(search) as char}
46-
<div class="flex items-center text-textcolor">
47-
{#if char.image}
48-
<BarIcon onClick={() => {changeChar(char.index)}} additionalStyle={getCharImage(char.image, 'css')}></BarIcon>
49-
{:else}
50-
<BarIcon onClick={() => {changeChar(char.index)}} additionalStyle={char.index === $selectedCharID ? 'background:var(--risu-theme-selected)' : ''}>
51-
{#if char.type === 'group'}
52-
<Users />
53-
{:else}
54-
<User/>
55-
{/if}
56-
</BarIcon>
57-
{/if}
58-
</div>
59-
{/each}
54+
<div class="h-full p-6 bg-darkbg max-w-full w-2xl flex flex-col overflow-y-auto">
55+
<h1 class="text-textcolor text-2xl font-bold mt-2 flex items-center mx-4 mb-2">
56+
<button class="mr-2 hover:text-textcolor text-textcolor2" on:click={() => {
57+
endGrid()
58+
}}><ArrowLeft /></button>
59+
<span>Catalog</span>
60+
</h1>
61+
<div class="mx-4 mb-6 flex flex-col">
62+
<TextInput placeholder="Search" bind:value={search} size="lg" autocomplete="off"/>
63+
<div class="flex flex-wrap gap-2 mt-2">
64+
<Button selected={selected === 0} size="sm" on:click={() => {selected = 0}}>
65+
{language.grid}
66+
</Button>
67+
<Button selected={selected === 1} size="sm" on:click={() => {selected = 1}}>
68+
{language.list}
69+
</Button>
70+
<Button selected={selected === 2} size="sm" on:click={() => {selected = 2}}>
71+
{language.trash}
72+
</Button>
6073
</div>
6174
</div>
75+
{#if selected === 0}
76+
<div class="w-full flex justify-center">
77+
<div class="flex flex-wrap gap-2 w-full justify-center">
78+
{#each formatChars(search, $DataBase) as char}
79+
<div class="flex items-center text-textcolor">
80+
{#if char.image}
81+
<BarIcon onClick={() => {changeChar(char.index)}} additionalStyle={getCharImage(char.image, 'css')}></BarIcon>
82+
{:else}
83+
<BarIcon onClick={() => {changeChar(char.index)}} additionalStyle={char.index === $selectedCharID ? 'background:var(--risu-theme-selected)' : ''}>
84+
{#if char.type === 'group'}
85+
<Users />
86+
{:else}
87+
<User/>
88+
{/if}
89+
</BarIcon>
90+
{/if}
91+
</div>
92+
{/each}
93+
</div>
94+
</div>
95+
{:else if selected === 1}
96+
{#each formatChars(search, $DataBase) as char}
97+
<div class="flex p-2 border border-darkborderc rounded-md mb-2">
98+
<BarIcon onClick={() => {changeChar(char.index)}} additionalStyle={getCharImage(char.image, 'css')}></BarIcon>
99+
<div class="flex-1 flex flex-col ml-2">
100+
<h4 class="text-textcolor font-bold text-lg mb-1">{char.name || "Unnamed"}</h4>
101+
<span class="text-textcolor2">{parseMultilangString(char.desc)['en'] || parseMultilangString(char.desc)['xx'] || 'No description'}</span>
102+
<div class="flex gap-2 justify-end">
103+
<button class="hover:text-textcolor text-textcolor2" on:click={() => {
104+
changeChar(char.index)
105+
}}>
106+
<Inspect />
107+
</button>
108+
<button class="hover:text-textcolor text-textcolor2" on:click={() => {
109+
removeChar(char.index, char.name)
110+
}}>
111+
<TrashIcon />
112+
</button>
113+
</div>
114+
</div>
115+
</div>
116+
{/each}
117+
{:else if selected === 2}
118+
<span class="text-textcolor2 text-sm mb-2">{language.trashDesc}</span>
119+
{#each formatChars(search, $DataBase, true) as char}
120+
<div class="flex p-2 border border-darkborderc rounded-md mb-2">
121+
<BarIcon onClick={() => {changeChar(char.index)}} additionalStyle={getCharImage(char.image, 'css')}></BarIcon>
122+
<div class="flex-1 flex flex-col ml-2">
123+
<h4 class="text-textcolor font-bold text-lg mb-1">{char.name || "Unnamed"}</h4>
124+
<span class="text-textcolor2">{parseMultilangString(char.desc)['en'] || parseMultilangString(char.desc)['xx'] || 'No description'}</span>
125+
<div class="flex gap-2 justify-end">
126+
<button class="hover:text-textcolor text-textcolor2" on:click={() => {
127+
$DataBase.characters[char.index].trashTime = undefined
128+
checkCharOrder()
129+
}}>
130+
<Undo2Icon />
131+
</button>
132+
<button class="hover:text-textcolor text-textcolor2" on:click={() => {
133+
removeChar(char.index, char.name, 'permanent')
134+
}}>
135+
<TrashIcon />
136+
</button>
137+
</div>
138+
</div>
139+
</div>
140+
{/each}
141+
{/if}
62142
</div>
63-
</div>
64-
65-
<style>
66-
@media (max-width: 640px) {
67-
.container {
68-
justify-content: center;
69-
width: fit-content;
70-
}
71-
}
72-
</style>
143+
</div>

src/lib/Setting/Pages/OtherBotSettings.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
</SelectInput>
208208
</Arcodion>
209209

210-
<Arcodion name={language.SuperMemory}/{language.hanuraiMemory} styled>
210+
<Arcodion name={language.longTermMemory} styled>
211211
<span class="text-textcolor mt-4">{language.type}</span>
212212

213213
<SelectInput value={

src/lib/SideBars/CharConfig.svelte

+18-21
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import { selectedCharID } from "../../ts/stores";
66
import { PlusIcon, SmileIcon, TrashIcon, UserIcon, ActivityIcon, BookIcon, User, CurlyBraces, Volume2Icon } from 'lucide-svelte'
77
import Check from "../UI/GUI/CheckInput.svelte";
8-
import { addCharEmotion, addingEmotion, getCharImage, rmCharEmotion, selectCharImg, makeGroupImage } from "../../ts/characters";
8+
import { addCharEmotion, addingEmotion, getCharImage, rmCharEmotion, selectCharImg, makeGroupImage, removeChar } from "../../ts/characters";
99
import LoreBook from "./LoreBook/LoreBookSetting.svelte";
10-
import { alertConfirm, alertNormal, alertSelectChar, alertTOS } from "../../ts/alert";
10+
import { alertConfirm, alertNormal, alertSelectChar, alertTOS, showHypaV2Alert } from "../../ts/alert";
1111
import BarIcon from "./BarIcon.svelte";
1212
import { findCharacterbyId, getAuthorNoteDefaultText, selectMultipleFile } from "../../ts/util";
1313
import { onDestroy } from "svelte";
@@ -672,11 +672,6 @@
672672
<span class="text-textcolor mt-2">{language.additionalText} <Help key="additionalText" /></span>
673673
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.additionalText}></TextAreaInput>
674674

675-
676-
{#if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4 || currentChar.data.supaMemory}
677-
<span class="text-textcolor">{language.SuperMemory}</span>
678-
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.chats[currentChar.data.chatPage].supaMemoryData}></TextAreaInput>
679-
{/if}
680675
{#if $DataBase.showUnrecommended || currentChar.data.personality.length > 3}
681676
<span class="text-textcolor">{language.personality} <Help key="personality" unrecommended/></span>
682677
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.personality}></TextAreaInput>
@@ -816,6 +811,21 @@
816811
<span> <Help key="utilityBot" name={language.utilityBot}/></span>
817812
</div>
818813

814+
{#if $DataBase.supaMemoryType === 'hypaV2'}
815+
<Button on:click={() => {
816+
currentChar.data.chats[currentChar.data.chatPage].hypaV2Data ??= {
817+
chunks: [],
818+
mainChunks: []
819+
}
820+
showHypaV2Alert()
821+
}}>
822+
{language.HypaMemory} V2 Data
823+
</Button>
824+
{:else if currentChar.data.chats[currentChar.data.chatPage].supaMemoryData && currentChar.data.chats[currentChar.data.chatPage].supaMemoryData.length > 4 || currentChar.data.supaMemory}
825+
<span class="text-textcolor">{language.SuperMemory}</span>
826+
<TextAreaInput margin="both" autocomplete="off" bind:value={currentChar.data.chats[currentChar.data.chatPage].supaMemoryData}></TextAreaInput>
827+
{/if}
828+
819829
{#if currentChar.data.license !== 'CC BY-NC-SA 4.0'
820830
&& currentChar.data.license !== 'CC BY-SA 4.0'
821831
&& currentChar.data.license !== 'CC BY-ND 4.0'
@@ -864,20 +874,7 @@
864874
{/if}
865875
{/if}
866876
<Button on:click={async () => {
867-
const conf = await alertConfirm(language.removeConfirm + currentChar.data.name)
868-
if(!conf){
869-
return
870-
}
871-
const conf2 = await alertConfirm(language.removeConfirm2 + currentChar.data.name)
872-
if(!conf2){
873-
return
874-
}
875-
let chars = $DataBase.characters
876-
chars.splice($selectedCharID, 1)
877-
checkCharOrder()
878-
$selectedCharID = -1
879-
$DataBase.characters = chars
880-
877+
removeChar($selectedCharID, currentChar.data.name)
881878
}} className="mt-2" size="sm">{ currentChar.type === 'group' ? language.removeGroup : language.removeCharacter}</Button>
882879
{/if}
883880

src/ts/alert.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Capacitor } from "@capacitor/core"
66
import { DataBase, type MessageGenerationInfo } from "./storage/database"
77

88
interface alertData{
9-
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'|'cardexport'|'requestdata'|'addchar'
9+
type: 'error'| 'normal'|'none'|'ask'|'wait'|'selectChar'|'input'|'toast'|'wait2'|'markdown'|'select'|'login'|'tos'|'cardexport'|'requestdata'|'addchar'|'hypaV2',
1010
msg: string,
1111
submsg?: string
1212
}
@@ -275,4 +275,11 @@ export function alertRequestData(info:AlertGenerationInfoStoreData){
275275
'type': 'requestdata',
276276
'msg': info.genInfo.generationId ?? 'none'
277277
})
278+
}
279+
280+
export function showHypaV2Alert(){
281+
alertStore.set({
282+
'type': 'hypaV2',
283+
'msg': ""
284+
})
278285
}

0 commit comments

Comments
 (0)