Change DataBase inside svelte to DBState for performance
This commit is contained in:
@@ -3,7 +3,7 @@ import { sleep } from "./util"
|
||||
import { language } from "../lang"
|
||||
import { isNodeServer, isTauri } from "./storage/globalApi"
|
||||
import { Capacitor } from "@capacitor/core"
|
||||
import { DataBase, type MessageGenerationInfo } from "./storage/database"
|
||||
import { DataBase, type MessageGenerationInfo } from "./storage/database.svelte"
|
||||
|
||||
interface alertData{
|
||||
type: 'error'|'normal'|'none'|'ask'|'wait'|'selectChar'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get, writable, type Writable } from "svelte/store"
|
||||
import { alertCardExport, alertConfirm, alertError, alertInput, alertMd, alertNormal, alertSelect, alertStore, alertTOS, alertWait } from "./alert"
|
||||
import { DataBase, defaultSdDataFunc, type character, setDatabase, type customscript, type loreSettings, type loreBook, type triggerscript, importPreset, type groupChat, setCurrentCharacter, getCurrentCharacter } from "./storage/database"
|
||||
import { DataBase, defaultSdDataFunc, type character, setDatabase, type customscript, type loreSettings, type loreBook, type triggerscript, importPreset, type groupChat, setCurrentCharacter, getCurrentCharacter } from "./storage/database.svelte"
|
||||
import { checkNullish, decryptBuffer, encryptBuffer, isKnownUri, selectFileByDom, selectMultipleFile, sleep } from "./util"
|
||||
import { language } from "src/lang"
|
||||
import { v4 as uuidv4, v4 } from 'uuid';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, writable } from "svelte/store";
|
||||
import { DataBase, saveImage, setDatabase, type character, type Chat, defaultSdDataFunc, type loreBook } from "./storage/database";
|
||||
import { DataBase, saveImage, setDatabase, type character, type Chat, defaultSdDataFunc, type loreBook } from "./storage/database.svelte";
|
||||
import { alertAddCharacter, alertConfirm, alertError, alertNormal, alertSelect, alertStore, alertWait } from "./alert";
|
||||
import { language } from "../lang";
|
||||
import { decode as decodeMsgpack } from "msgpackr";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { requestChatData } from "../process/request";
|
||||
import { checkCharOrder, globalFetch, isNodeServer, isTauri, saveAsset } from "../storage/globalApi";
|
||||
import { tokenize } from "../tokenizer";
|
||||
import { createBlankChar } from "../characters";
|
||||
import { DataBase, setDatabase, type character } from "../storage/database";
|
||||
import { DataBase, setDatabase, type character } from "../storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import { sleep } from "../util";
|
||||
import { Capacitor } from "@capacitor/core";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store"
|
||||
import { hubURL } from "../characterCards"
|
||||
import { DataBase } from "../storage/database"
|
||||
import { DataBase } from "../storage/database.svelte"
|
||||
import { alertError, alertSelect } from "../alert"
|
||||
|
||||
export async function risuLogin() {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { alertError, alertNormal, alertStore, alertWait } from "../alert";
|
||||
import { LocalWriter, forageStorage, isTauri } from "../storage/globalApi";
|
||||
import { decodeRisuSave, encodeRisuSave } from "../storage/risuSave";
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "../storage/database";
|
||||
import { DataBase } from "../storage/database.svelte";
|
||||
import { save } from "@tauri-apps/plugin-dialog";
|
||||
import { relaunch } from "@tauri-apps/plugin-process";
|
||||
import { sleep } from "../util";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { alertError, alertInput, alertNormal, alertSelect, alertStore } from "../alert";
|
||||
import { DataBase, type Database } from "../storage/database";
|
||||
import { DataBase, type Database } from "../storage/database.svelte";
|
||||
import { forageStorage, getUnpargeables, isTauri, openURL } from "../storage/globalApi";
|
||||
import { BaseDirectory, exists, readFile, readDir, writeFile } from "@tauri-apps/plugin-fs";
|
||||
import { language } from "../../lang";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "../storage/database";
|
||||
import { DataBase } from "../storage/database.svelte";
|
||||
|
||||
export function updateAnimationSpeed(){
|
||||
const db = get(DataBase);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, writable } from "svelte/store";
|
||||
import { DataBase, setDatabase } from "../storage/database";
|
||||
import { DataBase, setDatabase } from "../storage/database.svelte";
|
||||
import { downloadFile } from "../storage/globalApi";
|
||||
import { BufferToText, selectSingleFile } from "../util";
|
||||
import { alertError } from "../alert";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, writable } from "svelte/store";
|
||||
import { DataBase } from "../storage/database";
|
||||
import { DataBase } from "../storage/database.svelte";
|
||||
|
||||
export let textAreaSize = writable(0)
|
||||
export let sideBarSize = writable(0)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store"
|
||||
import { alertSelect, alertToast, doingAlert } from "./alert"
|
||||
import { DataBase, changeToPreset as changeToPreset2 } from "./storage/database"
|
||||
import { DataBase, changeToPreset as changeToPreset2 } from "./storage/database.svelte"
|
||||
import { MobileGUIStack, MobileSideBar, openPersonaList, openPresetList, SafeModeStore, selectedCharID, settingsOpen } from "./stores"
|
||||
import { language } from "src/lang"
|
||||
import { updateTextThemeAndCSS } from "./gui/colorscheme"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { get } from "svelte/store"
|
||||
import { alertNormal, alertSelect } from "../alert"
|
||||
import { keiServerURL } from "./kei"
|
||||
import { DataBase, setDatabase } from "../storage/database"
|
||||
import { DataBase, setDatabase } from "../storage/database.svelte"
|
||||
|
||||
export async function autoServerBackup(){
|
||||
const db = get(DataBase)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { hubURL } from "../characterCards";
|
||||
import { DataBase } from "../storage/database";
|
||||
import { DataBase } from "../storage/database.svelte";
|
||||
|
||||
export function keiServerURL(){
|
||||
const db = get(DataBase)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store"
|
||||
import { DataBase } from "../storage/database"
|
||||
import { DataBase } from "../storage/database.svelte"
|
||||
|
||||
export async function openRouterModels() {
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { runTrigger } from "./process/triggers";
|
||||
import { runCharacterJS } from "./plugins/embedscript";
|
||||
import { sleep } from "./util";
|
||||
import { getCurrentCharacter, getCurrentChat, setCurrentChat } from "./storage/database";
|
||||
import { getCurrentCharacter, getCurrentChat, setCurrentChat } from "./storage/database.svelte";
|
||||
|
||||
|
||||
function nodeObserve(node:HTMLElement){
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import DOMPurify from 'isomorphic-dompurify';
|
||||
import markdownit from 'markdown-it'
|
||||
import { DataBase, getCurrentCharacter, setDatabase, type Database, type Message, type character, type customscript, type groupChat, type triggerscript } from './storage/database';
|
||||
import { DataBase, getCurrentCharacter, setDatabase, type Database, type Message, type character, type customscript, type groupChat, type triggerscript } from './storage/database.svelte';
|
||||
import { getFileSrc } from './storage/globalApi';
|
||||
import { processScriptFull } from './process/scripts';
|
||||
import { get } from 'svelte/store';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store"
|
||||
import { DataBase, saveImage, setDatabase } from "./storage/database"
|
||||
import { DataBase, saveImage, setDatabase } from "./storage/database.svelte"
|
||||
import { getUserName, selectSingleFile, sleep } from "./util"
|
||||
import { alertError, alertNormal, alertStore } from "./alert"
|
||||
import { downloadFile, readImage } from "./storage/globalApi"
|
||||
|
||||
@@ -2,9 +2,9 @@ import { get } from 'svelte/store'
|
||||
import type { ScriptMode } from '../process/scripts'
|
||||
//@ts-ignore
|
||||
import WorkerUrl from './embedworker?worker&url'
|
||||
import { DataBase, type Message } from '../storage/database'
|
||||
import { DataBase, type Message } from '../storage/database.svelte'
|
||||
import { selectedCharID } from '../stores'
|
||||
import { setDatabase } from '../storage/database'
|
||||
import { setDatabase } from '../storage/database.svelte'
|
||||
|
||||
let worker = new Worker(WorkerUrl, {type: 'module'})
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { get, writable } from "svelte/store";
|
||||
import { language } from "../../lang";
|
||||
import { alertError } from "../alert";
|
||||
import { DataBase } from "../storage/database";
|
||||
import { DataBase } from "../storage/database.svelte";
|
||||
import { checkNullish, selectSingleFile, sleep } from "../util";
|
||||
import type { OpenAIChat } from "../process";
|
||||
import { globalFetch } from "../storage/globalApi";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase } from "../storage/database.svelte";
|
||||
import { selectedCharID } from "../stores";
|
||||
import { alertInput, alertMd, alertNormal, alertSelect, alertToast } from "../alert";
|
||||
import { sayTTS } from "./tts";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, type Chat, type character } from "src/ts/storage/database";
|
||||
import { DataBase, type Chat, type character } from "src/ts/storage/database.svelte";
|
||||
import { HypaProcesser } from '../memory/hypamemory'
|
||||
import type { OpenAIChat } from "..";
|
||||
import { stringlizeChat } from "../stringlize";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { OpenAIChat } from ".";
|
||||
import type { character } from "../storage/database";
|
||||
import type { character } from "../storage/database.svelte";
|
||||
import { risuChatParser } from "./scripts";
|
||||
|
||||
export function exampleMessage(char:character, userName:string):OpenAIChat[]{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import localforage from "localforage";
|
||||
import { selectSingleFile } from "../../util";
|
||||
import { v4 } from "uuid";
|
||||
import { DataBase } from "../../storage/database";
|
||||
import { DataBase } from "../../storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import { checkImageType } from "../../parser";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, setDatabase } from 'src/ts/storage/database';
|
||||
import { DataBase, setDatabase } from 'src/ts/storage/database.svelte';
|
||||
import { selectedCharID } from 'src/ts/stores';
|
||||
import { get } from 'svelte/store';
|
||||
import { doingChat, sendChat } from '..';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { findCharacterbyId } from "../util";
|
||||
import { alertConfirm, alertError, alertSelectChar } from "../alert";
|
||||
import { language } from "src/lang";
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase, setDatabase } from "../storage/database";
|
||||
import { DataBase, setDatabase } from "../storage/database.svelte";
|
||||
import { selectedCharID } from "../stores";
|
||||
|
||||
export async function addGroupChar(){
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, writable } from "svelte/store";
|
||||
import { DataBase, setDatabase, type character, type MessageGenerationInfo, type Chat } from "../storage/database";
|
||||
import { DataBase, setDatabase, type character, type MessageGenerationInfo, type Chat } from "../storage/database.svelte";
|
||||
import { CharEmotion, selectedCharID } from "../stores";
|
||||
import { ChatTokenizer, tokenize, tokenizeNum } from "../tokenizer";
|
||||
import { language } from "../../lang";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { writeInlayImage } from "./files/image";
|
||||
import type { character } from "../storage/database";
|
||||
import type { character } from "../storage/database.svelte";
|
||||
import { generateAIImage } from "./stableDiff";
|
||||
|
||||
const imggenRegex = [/<ImgGen="(.+?)">/gi, /{{ImgGen="(.+?)"}}/gi] as const
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import {selectedCharID} from '../stores'
|
||||
import { DataBase, setDatabase, type Message, type loreBook } from "../storage/database";
|
||||
import { DataBase, setDatabase, type Message, type loreBook } from "../storage/database.svelte";
|
||||
import { tokenize } from "../tokenizer";
|
||||
import { checkNullish, selectSingleFile } from "../util";
|
||||
import { alertError, alertNormal } from "../alert";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getChatVar, hasher, risuChatParser, setChatVar, type simpleCharacterArgument } from "../parser";
|
||||
import { LuaEngine, LuaFactory } from "wasmoon";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase, type Chat, type character, type groupChat } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentChat, setDatabase, type Chat, type character, type groupChat } from "../storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import { ReloadGUIPointer, selectedCharID } from "../stores";
|
||||
import { alertError, alertInput, alertNormal } from "../alert";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { HypaProcesser } from "./hypamemory";
|
||||
import { language } from "src/lang";
|
||||
import type { ChatTokenizer } from "src/ts/tokenizer";
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DataBase } from "src/ts/storage/database.svelte";
|
||||
|
||||
const maxRecentChatQuery = 4;
|
||||
export async function hanuraiMemory(chats:OpenAIChat[],arg:{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, type Chat, type character, type groupChat } from "src/ts/storage/database";
|
||||
import { DataBase, type Chat, type character, type groupChat } from "src/ts/storage/database.svelte";
|
||||
import type { OpenAIChat } from "..";
|
||||
import type { ChatTokenizer } from "src/ts/tokenizer";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import type { OpenAIChat } from "..";
|
||||
import { DataBase, type Chat, type character, type groupChat } from "../../storage/database";
|
||||
import { DataBase, type Chat, type character, type groupChat } from "../../storage/database.svelte";
|
||||
import { tokenize, type ChatTokenizer } from "../../tokenizer";
|
||||
import { requestChatData } from "../request";
|
||||
import { HypaProcesser } from "./hypamemory";
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as path from "@tauri-apps/api/path";
|
||||
import { exists, readTextFile } from "@tauri-apps/plugin-fs";
|
||||
import { alertClear, alertError, alertMd, alertWait } from "src/ts/alert";
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DataBase } from "src/ts/storage/database.svelte";
|
||||
let serverRunning = false;
|
||||
|
||||
export function checkLocalModel():Promise<string>{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase } from "src/ts/storage/database";
|
||||
import { DataBase } from "src/ts/storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
export function getGenerationModelString(){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, setDatabase } from "src/ts/storage/database"
|
||||
import { DataBase, setDatabase } from "src/ts/storage/database.svelte"
|
||||
import type { OpenAIChat } from ".."
|
||||
import { get } from "svelte/store"
|
||||
import { globalFetch } from "src/ts/storage/globalApi"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { language } from "src/lang"
|
||||
import { alertConfirm, alertError, alertModuleSelect, alertNormal, alertStore } from "../alert"
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentCharacter, setDatabase, type customscript, type loreBook, type triggerscript } from "../storage/database"
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, setCurrentCharacter, setDatabase, type customscript, type loreBook, type triggerscript } from "../storage/database.svelte"
|
||||
import { AppendableBuffer, downloadFile, isNodeServer, isTauri, readImage, saveAsset } from "../storage/globalApi"
|
||||
import { get } from "svelte/store"
|
||||
import { selectSingleFile, sleep } from "../util"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { tokenizeAccurate } from "../tokenizer";
|
||||
import { DataBase, presetTemplate, setDatabase, type Database } from "../storage/database";
|
||||
import { DataBase, presetTemplate, setDatabase, type Database } from "../storage/database.svelte";
|
||||
import { alertError, alertNormal } from "../alert";
|
||||
import type { OobaChatCompletionRequestParams } from "../model/ooba";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import type { MultiModal, OpenAIChat, OpenAIChatFull } from ".";
|
||||
import { DataBase, type character } from "../storage/database";
|
||||
import { DataBase, type character } from "../storage/database.svelte";
|
||||
import { pluginProcess } from "../plugins/plugins";
|
||||
import { language } from "../../lang";
|
||||
import { stringlizeAINChat, stringlizeChat, getStopStrings, unstringlizeAIN, unstringlizeChat } from "./stringlize";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { CharEmotion, selectedCharID } from "../stores";
|
||||
import { DataBase, setDatabase, type character, type customscript, type groupChat, type Database } from "../storage/database";
|
||||
import { DataBase, setDatabase, type character, type customscript, type groupChat, type Database } from "../storage/database.svelte";
|
||||
import { downloadFile } from "../storage/globalApi";
|
||||
import { alertError, alertNormal } from "../alert";
|
||||
import { language } from "src/lang";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store"
|
||||
import { DataBase, type character } from "../storage/database"
|
||||
import { DataBase, type character } from "../storage/database.svelte"
|
||||
import { requestChatData } from "./request"
|
||||
import { alertError } from "../alert"
|
||||
import { globalFetch, readImage } from "../storage/globalApi"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import type { OpenAIChat } from ".";
|
||||
import { DataBase } from "../storage/database";
|
||||
import { DataBase } from "../storage/database.svelte";
|
||||
import { getUserName } from "../util";
|
||||
|
||||
export function multiChatReplacer(){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Template } from '@huggingface/jinja';
|
||||
import type { OpenAIChat } from '..';
|
||||
import { get } from 'svelte/store';
|
||||
import { DataBase, getCurrentCharacter } from 'src/ts/storage/database';
|
||||
import { DataBase, getCurrentCharacter } from 'src/ts/storage/database.svelte';
|
||||
import { getUserName } from 'src/ts/util';
|
||||
|
||||
export const chatTemplates = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DataBase, setPreset, type botPreset, setDatabase } from "src/ts/storage/database";
|
||||
import { DataBase, setPreset, type botPreset, setDatabase } from "src/ts/storage/database.svelte";
|
||||
import { defaultAutoSuggestPrefixOoba, defaultAutoSuggestPrompt, defaultAutoSuggestPromptOoba } from "src/ts/storage/defaultPrompts";
|
||||
import { get } from "svelte/store";
|
||||
import { prebuiltNAIpresets, prebuiltPresets } from "./templates";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { risuChatParser } from "src/ts/parser"
|
||||
import { DataBase } from "src/ts/storage/database"
|
||||
import { DataBase } from "src/ts/storage/database.svelte"
|
||||
import { get } from "svelte/store"
|
||||
|
||||
export function convertInterfaceToSchema(int:string){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Database } from 'src/ts/storage/database'
|
||||
import type { Database } from 'src/ts/storage/database.svelte'
|
||||
|
||||
export function templateCheck(db:Database){
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { botPreset } from "../../storage/database";
|
||||
import type { botPreset } from "../../storage/database.svelte";
|
||||
import type { NAISettings } from "../models/nai";
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { parseChatML, risuChatParser } from "../parser";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, type Chat, type character } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, getCurrentChat, type Chat, type character } from "../storage/database.svelte";
|
||||
import { tokenize } from "../tokenizer";
|
||||
import { getModuleTriggers } from "./modules";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { alertError } from "../alert";
|
||||
import { DataBase, getCurrentCharacter, type character } from "../storage/database";
|
||||
import { DataBase, getCurrentCharacter, type character } from "../storage/database.svelte";
|
||||
import { runTranslator, translateVox } from "../translator/translator";
|
||||
import { globalFetch, loadAsset } from "../storage/globalApi";
|
||||
import { language } from "src/lang";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { get } from "svelte/store";
|
||||
import { exportCharacterCard } from "./characterCards";
|
||||
import { VirtualWriter, isTauri, openURL } from "./storage/globalApi";
|
||||
import { DataBase, getCurrentCharacter, type character } from "./storage/database";
|
||||
import { DataBase, getCurrentCharacter, type character } from "./storage/database.svelte";
|
||||
import { alertStore } from "./alert";
|
||||
|
||||
let pong = false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, writable } from "svelte/store"
|
||||
import { DataBase } from "./database"
|
||||
import { DataBase } from "./database.svelte"
|
||||
import { hubURL } from "../characterCards"
|
||||
import localforage from "localforage"
|
||||
import { alertError, alertLogin, alertStore, alertWait } from "../alert"
|
||||
|
||||
@@ -4,7 +4,7 @@ import { NodeStorage } from "./nodeStorage"
|
||||
import { OpfsStorage } from "./opfsStorage"
|
||||
import { alertInput, alertSelect, alertStore } from "../alert"
|
||||
import { get } from "svelte/store"
|
||||
import { DataBase, type Database } from "./database"
|
||||
import { DataBase, type Database } from "./database.svelte"
|
||||
import { AccountStorage } from "./accountStorage"
|
||||
import { decodeRisuSave, encodeRisuSave } from "./risuSave";
|
||||
import { language } from "src/lang"
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
export const DataBase = writable({} as any as Database)
|
||||
export const loadedStore = writable(false)
|
||||
export let appVer = "137.1.0"
|
||||
export let webAppSubVer = ''
|
||||
|
||||
import { get, writable } from 'svelte/store';
|
||||
import { checkNullish, decryptBuffer, encryptBuffer, selectSingleFile } from '../util';
|
||||
import { changeLanguage, language } from '../../lang';
|
||||
@@ -17,6 +12,18 @@ import { defaultColorScheme, type ColorScheme } from '../gui/colorscheme';
|
||||
import type { PromptItem, PromptSettings } from '../process/prompt';
|
||||
import type { OobaChatCompletionRequestParams } from '../model/ooba';
|
||||
|
||||
export const DataBase = writable({} as any as Database)
|
||||
export const DBState = $state({
|
||||
db: get(DataBase)
|
||||
})
|
||||
export const loadedStore = writable(false)
|
||||
export let appVer = "137.1.0"
|
||||
export let webAppSubVer = ''
|
||||
|
||||
DataBase.subscribe(data => {
|
||||
DBState.db = data
|
||||
})
|
||||
|
||||
export function setDatabase(data:Database){
|
||||
if(checkNullish(data.characters)){
|
||||
data.characters = []
|
||||
@@ -954,7 +961,7 @@ export interface loreSettings{
|
||||
}
|
||||
|
||||
|
||||
export interface groupChat{
|
||||
export interface groupChat{
|
||||
type: 'group'
|
||||
image?:string
|
||||
firstMessage:string
|
||||
@@ -992,6 +999,30 @@ export interface groupChat{
|
||||
lowLevelAccess?:boolean
|
||||
hideChatIcon?:boolean
|
||||
lastInteraction?:number
|
||||
|
||||
//lazy hack for typechecking
|
||||
voicevoxConfig?:any
|
||||
ttsSpeech?:string
|
||||
naittsConfig?:any
|
||||
oaiVoice?:string
|
||||
hfTTS?: any
|
||||
vits?: OnnxModelFiles
|
||||
gptSoVitsConfig?:any
|
||||
fishSpeechConfig?:any
|
||||
ttsReadOnlyQuoted?:boolean
|
||||
exampleMessage?:string
|
||||
systemPrompt?:string
|
||||
replaceGlobalNote?:string
|
||||
additionalText?:string
|
||||
personality?:string
|
||||
scenario?:string
|
||||
translatorNote?:string
|
||||
additionalData?: any
|
||||
depth_prompt?: { depth: number, prompt: string }
|
||||
additionalAssets?:[string, string, string][]
|
||||
utilityBot?:boolean
|
||||
license?:string
|
||||
realmId:string
|
||||
}
|
||||
|
||||
export interface botPreset{
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "./database";
|
||||
import { DataBase } from "./database.svelte";
|
||||
import { downloadFile } from "./globalApi";
|
||||
import { alertNormal } from "../alert";
|
||||
import { language } from "src/lang";
|
||||
|
||||
@@ -13,7 +13,7 @@ import { v4 as uuidv4, v4 } from 'uuid';
|
||||
import { appDataDir, join } from "@tauri-apps/api/path";
|
||||
import { get } from "svelte/store";
|
||||
import {open} from '@tauri-apps/plugin-shell'
|
||||
import { DataBase, loadedStore, setDatabase, type Database, defaultSdDataFunc } from "./database";
|
||||
import { DataBase, loadedStore, setDatabase, type Database, defaultSdDataFunc } from "./database.svelte";
|
||||
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
|
||||
import { checkRisuUpdate } from "../update";
|
||||
import { MobileGUI, botMakerMode, selectedCharID } from "../stores";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get } from "svelte/store";
|
||||
import { DataBase } from "./database";
|
||||
import { DataBase } from "./database.svelte";
|
||||
import { alertNormal } from "../alert";
|
||||
import { language } from "src/lang";
|
||||
import { isNodeServer, isTauri } from "./globalApi";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, writable, type Writable } from "svelte/store";
|
||||
import { DataBase, getCurrentCharacter, type Chat, type character, type groupChat } from "./storage/database";
|
||||
import { DataBase, getCurrentCharacter, type Chat, type character, type groupChat } from "./storage/database.svelte";
|
||||
import { isEqual } from "lodash";
|
||||
import type { simpleCharacterArgument } from "./parser";
|
||||
import { getUserIcon, getUserIconProtrait, getUserName, sleep } from "./util";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { v4 } from 'uuid';
|
||||
import { alertError, alertInput, alertNormal, alertStore, alertWait } from '../alert';
|
||||
import { get, writable } from 'svelte/store';
|
||||
import { DataBase, setDatabase, type character, saveImage, type Chat, getCurrentChat, setCurrentChat } from '../storage/database';
|
||||
import { DataBase, setDatabase, type character, saveImage, type Chat, getCurrentChat, setCurrentChat } from '../storage/database.svelte';
|
||||
import { selectedCharID } from '../stores';
|
||||
import { findCharacterIndexbyId, sleep } from '../util';
|
||||
import type { DataConnection, Peer } from 'peerjs';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Tiktoken } from "@dqbd/tiktoken";
|
||||
import type { Tokenizer } from "@mlc-ai/web-tokenizers";
|
||||
import { DataBase, type groupChat, type character, type Chat, getCurrentCharacter } from "./storage/database";
|
||||
import { DataBase, type groupChat, type character, type Chat, getCurrentCharacter } from "./storage/database.svelte";
|
||||
import { get } from "svelte/store";
|
||||
import type { MultiModal, OpenAIChat } from "./process";
|
||||
import { supportsInlayImage } from "./process/files/image";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store"
|
||||
import { translatorPlugin } from "../plugins/plugins"
|
||||
import { DataBase, type character, type customscript, type groupChat } from "../storage/database"
|
||||
import { DataBase, type character, type customscript, type groupChat } from "../storage/database.svelte"
|
||||
import { globalFetch, isTauri } from "../storage/globalApi"
|
||||
import { alertError } from "../alert"
|
||||
import { requestChatData } from "../process/request"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { get, writable, type Writable } from "svelte/store"
|
||||
import type { Database, Message } from "./storage/database"
|
||||
import { DataBase } from "./storage/database"
|
||||
import type { Database, Message } from "./storage/database.svelte"
|
||||
import { DataBase } from "./storage/database.svelte"
|
||||
import { selectedCharID } from "./stores"
|
||||
import {open} from '@tauri-apps/plugin-dialog'
|
||||
import { readFile } from "@tauri-apps/plugin-fs"
|
||||
|
||||
Reference in New Issue
Block a user