Change additional assets to arcordion
This commit is contained in:
@@ -683,4 +683,5 @@ export const languageEnglish = {
|
|||||||
sizeAndSpeed: "Size and Speed",
|
sizeAndSpeed: "Size and Speed",
|
||||||
useLegacyGUI: "Use Legacy GUI",
|
useLegacyGUI: "Use Legacy GUI",
|
||||||
claudeCachingExperimental: "Claude Caching",
|
claudeCachingExperimental: "Claude Caching",
|
||||||
|
openClose: "Open/Close",
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
import TextInput from "src/lib/UI/GUI/TextInput.svelte";
|
import TextInput from "src/lib/UI/GUI/TextInput.svelte";
|
||||||
import LoreBookData from "src/lib/SideBars/LoreBook/LoreBookData.svelte";
|
import LoreBookData from "src/lib/SideBars/LoreBook/LoreBookData.svelte";
|
||||||
import type { RisuModule } from "src/ts/process/modules";
|
import type { RisuModule } from "src/ts/process/modules";
|
||||||
import { PlusIcon } from "lucide-svelte";
|
import { DownloadIcon, FolderUpIcon, PlusIcon } from "lucide-svelte";
|
||||||
import { alertConfirm } from "src/ts/alert";
|
import { alertConfirm } from "src/ts/alert";
|
||||||
import RegexList from "src/lib/SideBars/Scripts/RegexList.svelte";
|
import RegexList from "src/lib/SideBars/Scripts/RegexList.svelte";
|
||||||
import TriggerList from "src/lib/SideBars/Scripts/TriggerList.svelte";
|
import TriggerList from "src/lib/SideBars/Scripts/TriggerList.svelte";
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
import Button from "src/lib/UI/GUI/Button.svelte";
|
import Button from "src/lib/UI/GUI/Button.svelte";
|
||||||
import { openURL } from "src/ts/storage/globalApi";
|
import { openURL } from "src/ts/storage/globalApi";
|
||||||
import { hubURL } from "src/ts/characterCards";
|
import { hubURL } from "src/ts/characterCards";
|
||||||
|
import { exportRegex, importRegex } from "src/ts/process/scripts";
|
||||||
|
|
||||||
|
|
||||||
export let currentModule:RisuModule
|
export let currentModule:RisuModule
|
||||||
@@ -153,9 +154,17 @@
|
|||||||
{#if (Array.isArray(currentModule.regex))}
|
{#if (Array.isArray(currentModule.regex))}
|
||||||
<span class="mt-8 text-xl">{language.regexScript}</span>
|
<span class="mt-8 text-xl">{language.regexScript}</span>
|
||||||
<RegexList bind:value={currentModule.regex}/>
|
<RegexList bind:value={currentModule.regex}/>
|
||||||
<button on:click={() => {addRegex()}} class="hover:text-textcolor cursor-pointer">
|
<div class="text-textcolor2 mt-2 flex gap-2">
|
||||||
<PlusIcon />
|
<button class="font-medium cursor-pointer hover:text-green-500" on:click={() => {
|
||||||
</button>
|
addRegex()
|
||||||
|
}}><PlusIcon /></button>
|
||||||
|
<button class="font-medium cursor-pointer hover:text-green-500" on:click={() => {
|
||||||
|
exportRegex(currentModule.regex)
|
||||||
|
}}><DownloadIcon /></button>
|
||||||
|
<button class="font-medium cursor-pointer hover:text-green-500" on:click={async () => {
|
||||||
|
currentModule.regex = await importRegex(currentModule.regex)
|
||||||
|
}}><FolderUpIcon /></button>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if typeof(currentModule.backgroundEmbedding) === 'string'}
|
{#if typeof(currentModule.backgroundEmbedding) === 'string'}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { tokenizeAccurate } from "../../ts/tokenizer";
|
import { tokenizeAccurate } from "../../ts/tokenizer";
|
||||||
import { DataBase, saveImage as saveAsset, type Database, type character, type groupChat } from "../../ts/storage/database";
|
import { DataBase, saveImage as saveAsset, type Database, type character, type groupChat } from "../../ts/storage/database";
|
||||||
import { ShowRealmFrameStore, selectedCharID } from "../../ts/stores";
|
import { ShowRealmFrameStore, selectedCharID } from "../../ts/stores";
|
||||||
import { PlusIcon, SmileIcon, TrashIcon, UserIcon, ActivityIcon, BookIcon, User, CurlyBraces, Volume2Icon } from 'lucide-svelte'
|
import { PlusIcon, SmileIcon, TrashIcon, UserIcon, ActivityIcon, BookIcon, User, CurlyBraces, Volume2Icon, DownloadIcon, FolderUpIcon } from 'lucide-svelte'
|
||||||
import Check from "../UI/GUI/CheckInput.svelte";
|
import Check from "../UI/GUI/CheckInput.svelte";
|
||||||
import { addCharEmotion, addingEmotion, getCharImage, rmCharEmotion, selectCharImg, makeGroupImage, removeChar, changeCharImage } from "../../ts/characters";
|
import { addCharEmotion, addingEmotion, getCharImage, rmCharEmotion, selectCharImg, makeGroupImage, removeChar, changeCharImage } from "../../ts/characters";
|
||||||
import LoreBook from "./LoreBook/LoreBookSetting.svelte";
|
import LoreBook from "./LoreBook/LoreBookSetting.svelte";
|
||||||
@@ -30,6 +30,8 @@
|
|||||||
import { registerOnnxModel } from "src/ts/process/transformers";
|
import { registerOnnxModel } from "src/ts/process/transformers";
|
||||||
import MultiLangInput from "../UI/GUI/MultiLangInput.svelte";
|
import MultiLangInput from "../UI/GUI/MultiLangInput.svelte";
|
||||||
import { applyModule } from "src/ts/process/modules";
|
import { applyModule } from "src/ts/process/modules";
|
||||||
|
import { exportRegex, importRegex } from "src/ts/process/scripts";
|
||||||
|
import Arcodion from "../UI/Arcodion.svelte";
|
||||||
|
|
||||||
|
|
||||||
let subMenu = 0
|
let subMenu = 0
|
||||||
@@ -564,7 +566,8 @@
|
|||||||
|
|
||||||
<span class="text-textcolor mt-4">{language.regexScript} <Help key="regexScript"/></span>
|
<span class="text-textcolor mt-4">{language.regexScript} <Help key="regexScript"/></span>
|
||||||
<RegexList bind:value={currentChar.data.customscript} />
|
<RegexList bind:value={currentChar.data.customscript} />
|
||||||
<button class="font-medium cursor-pointer hover:text-green-500 mb-2" on:click={() => {
|
<div class="text-textcolor2 mt-2 flex gap-2">
|
||||||
|
<button class="font-medium cursor-pointer hover:text-green-500" on:click={() => {
|
||||||
if(currentChar.type === 'character'){
|
if(currentChar.type === 'character'){
|
||||||
let script = currentChar.data.customscript
|
let script = currentChar.data.customscript
|
||||||
script.push({
|
script.push({
|
||||||
@@ -576,6 +579,13 @@
|
|||||||
currentChar.data.customscript = script
|
currentChar.data.customscript = script
|
||||||
}
|
}
|
||||||
}}><PlusIcon /></button>
|
}}><PlusIcon /></button>
|
||||||
|
<button class="font-medium cursor-pointer hover:text-green-500" on:click={() => {
|
||||||
|
exportRegex(currentChar.data.customscript)
|
||||||
|
}}><DownloadIcon /></button>
|
||||||
|
<button class="font-medium cursor-pointer hover:text-green-500" on:click={async () => {
|
||||||
|
currentChar.data.customscript = await importRegex(currentChar.data.customscript)
|
||||||
|
}}><FolderUpIcon /></button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<span class="text-textcolor mt-4">{language.triggerScript} <Help key="triggerScript"/></span>
|
<span class="text-textcolor mt-4">{language.triggerScript} <Help key="triggerScript"/></span>
|
||||||
<div class="flex items-start mt-2 gap-2">
|
<div class="flex items-start mt-2 gap-2">
|
||||||
@@ -893,7 +903,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<span class="text-textcolor mt-2">{language.additionalAssets} <Help key="additionalAssets" /></span>
|
<Arcodion styled name={language.additionalAssets} help="additionalAssets">
|
||||||
<div class="w-full max-w-full border border-selected rounded-md p-2">
|
<div class="w-full max-w-full border border-selected rounded-md p-2">
|
||||||
<table class="contain w-full max-w-full tabler mt-2">
|
<table class="contain w-full max-w-full tabler mt-2">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -958,6 +968,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</Arcodion>
|
||||||
|
|
||||||
<div class="flex items-center mt-4">
|
<div class="flex items-center mt-4">
|
||||||
<Check bind:check={currentChar.data.lowLevelAccess} name={language.lowLevelAccess}/>
|
<Check bind:check={currentChar.data.lowLevelAccess} name={language.lowLevelAccess}/>
|
||||||
|
|||||||
@@ -18,7 +18,9 @@
|
|||||||
on:click={() => {
|
on:click={() => {
|
||||||
open = !open
|
open = !open
|
||||||
}}
|
}}
|
||||||
>{name}{#if help}
|
>
|
||||||
|
<span class="mr-2">{name}</span>
|
||||||
|
{#if help}
|
||||||
<Help key={help} />
|
<Help key={help} />
|
||||||
{/if}</button>
|
{/if}</button>
|
||||||
{#if open}
|
{#if open}
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ export async function processScript(char:character|groupChat, data:string, mode:
|
|||||||
return (await processScriptFull(char, data, mode)).data
|
return (await processScriptFull(char, data, mode)).data
|
||||||
}
|
}
|
||||||
|
|
||||||
export function exportRegex(){
|
export function exportRegex(s?:customscript[]){
|
||||||
let db = get(DataBase)
|
let db = get(DataBase)
|
||||||
const script = db.globalscript
|
const script = s ?? db.globalscript
|
||||||
const data = Buffer.from(JSON.stringify({
|
const data = Buffer.from(JSON.stringify({
|
||||||
type: 'regex',
|
type: 'regex',
|
||||||
data: script
|
data: script
|
||||||
@@ -31,22 +31,22 @@ export function exportRegex(){
|
|||||||
alertNormal(language.successExport)
|
alertNormal(language.successExport)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function importRegex(){
|
export async function importRegex(o?:customscript[]):Promise<customscript[]>{
|
||||||
|
o = o ?? []
|
||||||
const filedata = (await selectSingleFile(['json'])).data
|
const filedata = (await selectSingleFile(['json'])).data
|
||||||
if(!filedata){
|
if(!filedata){
|
||||||
return
|
return o
|
||||||
}
|
}
|
||||||
let db = get(DataBase)
|
let db = get(DataBase)
|
||||||
try {
|
try {
|
||||||
const imported= JSON.parse(Buffer.from(filedata).toString('utf-8'))
|
const imported= JSON.parse(Buffer.from(filedata).toString('utf-8'))
|
||||||
if(imported.type === 'regex' && imported.data){
|
if(imported.type === 'regex' && imported.data){
|
||||||
const datas:customscript[] = imported.data
|
const datas:customscript[] = imported.data
|
||||||
const script = db.globalscript
|
const script = o
|
||||||
for(const data of datas){
|
for(const data of datas){
|
||||||
script.push(data)
|
script.push(data)
|
||||||
}
|
}
|
||||||
db.globalscript = script
|
return o
|
||||||
setDatabase(db)
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
alertError("File invaid or corrupted")
|
alertError("File invaid or corrupted")
|
||||||
@@ -55,6 +55,7 @@ export async function importRegex(){
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
alertError(`${error}`)
|
alertError(`${error}`)
|
||||||
}
|
}
|
||||||
|
return o
|
||||||
}
|
}
|
||||||
|
|
||||||
let bestMatchCache = new Map<string, string>()
|
let bestMatchCache = new Map<string, string>()
|
||||||
|
|||||||
Reference in New Issue
Block a user