Move DBState to stores

This commit is contained in:
kwaroran
2024-10-26 21:17:46 +09:00
parent 92f1ed0528
commit da907f4fc2
84 changed files with 183 additions and 156 deletions

View File

@@ -1,6 +1,6 @@
import { get } from "svelte/store";
import { getCurrentCharacter, getCurrentChat, getDatabase, setCurrentChat, setDatabase } from "../storage/database.svelte";
import { selectedCharID } from "../stores";
import { selectedCharID } from "../stores.svelte";
import { alertInput, alertMd, alertNormal, alertSelect, alertToast } from "../alert";
import { sayTTS } from "./tts";
import { risuChatParser } from "../parser.svelte";

View File

@@ -1,5 +1,5 @@
import { getDatabase, setDatabase } from 'src/ts/storage/database.svelte';
import { selectedCharID } from 'src/ts/stores';
import { selectedCharID } from 'src/ts/stores.svelte';
import { get } from 'svelte/store';
import { doingChat, sendChat } from '../index.svelte';
import { downloadFile, isTauri } from 'src/ts/globalApi';

View File

@@ -4,7 +4,7 @@ import { alertConfirm, alertError, alertSelectChar } from "../alert";
import { language } from "src/lang";
import { get } from "svelte/store";
import { getDatabase, setDatabase } from "../storage/database.svelte";
import { selectedCharID } from "../stores";
import { selectedCharID } from "../stores.svelte";
export async function addGroupChar(){
let db = getDatabase()

View File

@@ -1,6 +1,7 @@
import { get, writable } from "svelte/store";
import { type character, type MessageGenerationInfo, type Chat, DBState } from "../storage/database.svelte";
import { CharEmotion, selectedCharID } from "../stores";
import { type character, type MessageGenerationInfo, type Chat } from "../storage/database.svelte";
import { DBState } from '../stores.svelte';
import { CharEmotion, selectedCharID } from "../stores.svelte";
import { ChatTokenizer, tokenize, tokenizeNum } from "../tokenizer";
import { language } from "../../lang";
import { alertError } from "../alert";

View File

@@ -1,6 +1,7 @@
import { get } from "svelte/store";
import {selectedCharID} from '../stores'
import { DBState, type Message, type loreBook } from "../storage/database.svelte";
import {selectedCharID} from '../stores.svelte'
import { type Message, type loreBook } from "../storage/database.svelte";
import { DBState } from '../stores.svelte';
import { tokenize } from "../tokenizer";
import { checkNullish, selectSingleFile } from "../util";
import { alertError, alertNormal } from "../alert";

View File

@@ -2,7 +2,7 @@ import { getChatVar, hasher, setChatVar, type simpleCharacterArgument } from "..
import { LuaEngine, LuaFactory } from "wasmoon";
import { getCurrentCharacter, getCurrentChat, getDatabase, setCurrentChat, setDatabase, type Chat, type character, type groupChat } from "../storage/database.svelte";
import { get } from "svelte/store";
import { ReloadGUIPointer, selectedCharID } from "../stores";
import { ReloadGUIPointer, selectedCharID } from "../stores.svelte";
import { alertError, alertInput, alertNormal } from "../alert";
import { HypaProcesser } from "./memory/hypamemory";
import { generateAIImage } from "./stableDiff";

View File

@@ -8,7 +8,7 @@ import { convertExternalLorebook } from "./lorebook.svelte"
import { decodeRPack, encodeRPack } from "../rpack/rpack_bg"
import { convertImage } from "../parser.svelte"
import { Capacitor } from "@capacitor/core"
import { HideIconStore, moduleBackgroundEmbedding } from "../stores"
import { HideIconStore, moduleBackgroundEmbedding } from "../stores.svelte"
export interface RisuModule{
name: string

View File

@@ -1,5 +1,5 @@
import { get } from "svelte/store";
import { CharEmotion, selectedCharID } from "../stores";
import { CharEmotion, selectedCharID } from "../stores.svelte";
import { type character, type customscript, type groupChat, type Database, getDatabase } from "../storage/database.svelte";
import { downloadFile } from "../globalApi";
import { alertError, alertNormal } from "../alert";

View File

@@ -3,7 +3,7 @@ import { getDatabase, type character } from "../storage/database.svelte"
import { requestChatData } from "./request"
import { alertError } from "../alert"
import { globalFetch, readImage } from "../globalApi"
import { CharEmotion } from "../stores"
import { CharEmotion } from "../stores.svelte"
import type { OpenAIChat } from "./index.svelte"
import { processZip } from "./processzip"
import { keiServerURL } from "../kei/kei"

View File

@@ -3,7 +3,7 @@ import { getCurrentCharacter, getCurrentChat, getDatabase, type Chat, type chara
import { tokenize } from "../tokenizer";
import { getModuleTriggers } from "./modules";
import { get } from "svelte/store";
import { ReloadGUIPointer, selectedCharID } from "../stores";
import { ReloadGUIPointer, selectedCharID } from "../stores.svelte";
import { processMultiCommand } from "./command";
import { parseKeyValue } from "../util";
import { alertError, alertInput, alertNormal, alertSelect } from "../alert";