Commit Graph

3651 Commits

Author SHA1 Message Date
Bo26fhmC5M
a41ac074db fix: pass message index when processing regex script 2025-05-18 13:01:32 +09:00
Kwaroran
0a792db7c2 Fix tauri build again 2025-05-17 03:28:12 +09:00
Kwaroran
18bc8d7c6a Fix tauri build step 2025-05-17 03:21:09 +09:00
Kwaroran
f9634af12b Bump version to 160.0.1 in configuration and source files 2025-05-17 03:13:19 +09:00
Kwaroran
579e4ab55d Fix reroll 2025-05-17 03:13:01 +09:00
Kwaroran
14a0166327 Fix dupicated keys 2025-05-17 02:51:16 +09:00
Kwaroran
dcffc9e323 Bump version to 160.0.0 across configuration files 2025-05-17 02:50:10 +09:00
Kwaroran
fcaf056049 Add new LLMs 2025-05-17 02:49:53 +09:00
Kwaroran
52d2c626d0 Fix lazy portal 2025-05-17 02:46:14 +09:00
Kwaroran
665253e404 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2025-05-17 01:42:59 +09:00
Kwaroran
0733554e4d Add styles 2025-05-17 01:42:08 +09:00
kwaroran
e1a3f5e7a6 Support numeric values in inputs and enhance image generation configs (#837)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
Novel AI V4 Vibe 기능 추가
SelectInput에 number도 입력되도록 추가(Svelte의 select가 알아서 number string 변환해준다길래
타입만 추가함)
2025-05-17 01:11:10 +09:00
kwaroran
60755b907c Merge branch 'main' into main 2025-05-17 01:11:02 +09:00
kwaroran
33debaf27d feat: Open read-only access to lore books from Lua (#846)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Description

This PR adds read-only lore books access from Lua.

- `getLoreBooks(triggerId, search)`: Gets all lore books of the name
(comment). No additional sorting is done - API user will need to sort
themselves. All lores are parsed before returning.
- `loadLoreBooks(triggerId, reserve)`: Retrieves all active lore books
in current context. This function takes account of max context length
and cut low priority lores, similar to a user submitting their message.
All lores are parsed before returning.
- Specifying `reserve` higher than `0` would reserve that much tokens
for other prompts.

With `loadLoreBooks()`, character and module creators would be able to
separate token- and context-heavy data generations into Lua and separate
LLM workflow for improved accuracy.
2025-05-17 01:09:44 +09:00
kwaroran
e5fededc69 Merge branch 'main' into lualore 2025-05-17 01:09:37 +09:00
kwaroran
1a071a7be5 feat: implement preset and parallel requests for HypaV3 (#845)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Preview

![preview](https://github.com/user-attachments/assets/603c249d-6a97-44ee-a0d4-767c0a0cfcca)

# Description
This PR adds preset support for the HypaV3 memory system.
Users can now create different presets as needed and switch between
presets.
It also supports parallel requests in an experimental implementation.
As it's still in the experimental stage, feedback is requested.
2025-05-17 01:09:10 +09:00
kwaroran
3390e7b11c Merge branch 'main' into patch-2 2025-05-17 01:09:01 +09:00
kwaroran
f9f0b5dd31 feat: Open read-only access to persona name/desc from Lua (#847)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Description

This PR adds read-only persona name and description access from Lua by
adding `getPersonaName(triggerId)` and
`getPersonaDescription(triggerId)`. The description is parsed before
returning.
2025-05-17 01:08:21 +09:00
kwaroran
19d50d1ef1 feat: add optional prompt metadata saving to chat messages (#848)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Description
## What does this PR do?

This PR adds an optional feature to store prompt preset metadata in each
chat message.

<img width="311" alt="prompt"
src="https://github.com/user-attachments/assets/2591ac25-6cb2-41fc-85b2-e12c35b79370"
/>

---

## Why is this useful?

When writing prompts, it's common to test **dozens of prompt presets**
across many messages. After just a day or two, it's hard to remember
which message used which prompt.
This is especially important for sensitive models, where even small
changes to prompt wording or toggle combinations can greatly affect
output.

---

## What is stored when enabled?

To support this, an option has been added to **Advanced Settings** that
stores:

- Prompt preset name (*Add Prompt Info to Chat*)
- Active custom toggles (*Add Prompt Info to Chat*)
- Prompt text (*Add Prompt *Text* To Chat*):
Only the **Prompt Template** portion of the final prompt (**as sent**)
is stored — character description, persona, lorebook, and long-term
memory are excluded to avoid excessive size.
    This option is separated due to its potential impact on storage.

This information is stored per message, if the feature is enabled.

<img width="319" alt="setting"
src="https://github.com/user-attachments/assets/00600d0c-d38d-46cf-890f-3f08d78ccb0a"
/>

---

## Implementation Summary

### `src/ts/storage/database.svelte.ts`

- Added `interface MessagePresetInfo` (includes `promptName`,
`promptToggles`, `promptText`)
- Updated `interface Message` with optional `promptInfo`

### `src/ts/process/index.svelte.ts`

- In `sendChat()`, prompt metadata is collected and stored
- `promptText` is taken from the existing `formated` array, but only
after filtering out types like `'persona'`, `'description'`,
`'authornote'`, `'memory'`
- Since `formated` is reused, this had to be placed in the **later**
part of the `sendChat` function.
- However, `promptName` and `promptToggles` are collected **early** to
avoid mismatches caused by user changes during message sending. *(A
short comment has been added to explain the code separation. See
screenshot below.)*
<img width="494" alt="comment"
src="https://github.com/user-attachments/assets/b43da333-d529-4b3c-b659-579b847135a5"
/>

- Used this condition when storing partial prompt data (As you can see,
these are the types that support Custom Inner Format.):

```ts
// only for types supporting Custom Inner Format
if (DBState.db.promptInfoInsideChat && DBState.db.promptTextInfoInsideChat) {
    pushPromptInfoBody('supaMemory', card.innerFormat)
}
```

- The final `promptInfo` is added to the message object during
`message.push`

---

## Additional Notes

- The prompt preset name and active toggles take up very little space,
so they are unlikely to be an issue.
- The prompt text may increase the message size slightly, but:
- Modern models already generate outputs of several thousand tokens, so
adding \~2,000 tokens of metadata is relatively minor in comparison.
  - The `{{slot}}` contents are not included in the saved text.
- The prompt text is filtered through `risuChatParser`, which reduces
unnecessary parts before saving.
- Most importantly, this feature is optional and can be enabled only by
those who need it — for example, prompt creators or advanced users.

---

## Final Thoughts

This feature is designed to help prompt creators **track, debug, and
revisit** messages more easily.
If this feature doesn't fit the project goals or introduces any
concerns, feel free to let me know or suggest changes.
It might also be interesting to allow users to write a note for each
message!

Thanks for reading.
2025-05-17 01:08:11 +09:00
Bo26fhmC5M
85753a76ef feat: implement preset and parallel requests for HypaV3 2025-05-16 22:18:13 +09:00
enzi221
a758b574f5 fix: Pluralize name 2025-05-16 03:37:54 +09:00
enzi221
40e91e59a7 feat: Return all lore books of same name without sort 2025-05-16 03:36:50 +09:00
poroyo
2cb92c0e5f fix: correct promptTextInfoInsideChat label to "Add Prompt Text to Chat" 2025-05-16 02:53:44 +09:00
poroyo
4fca6f26b4 feat: store prompt preset name, toggles, and text in chat metadata when enabled 2025-05-16 02:20:48 +09:00
enzi221
e44ac16b00 feat: Open persona name/desc access from Lua 2025-05-14 20:36:36 +09:00
enzi221
1b8a0762b1 fix: Return stringified false instead of literal false 2025-05-13 23:12:57 +09:00
enzi221
5a70dd1566 refactor: Get current character from db.characters like other functions 2025-05-13 16:16:27 +09:00
enzi221
953fc383f5 feat: Open read-only access to lorebooks from Lua 2025-05-13 14:58:16 +09:00
Kwaroran
634de807ad Remove googli 2025-05-13 13:54:08 +09:00
kwaroran
d9565b4450 feat: Allow deleting an orphaned summary from HypaV3 (#831)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Description

Currently, you can:

- Manually rewrite summaries
- Delete orphaned summaries (all or none, in the settings)
- Delete all summaries after one

But you can't:

- Manually add summaries
- Delete a summary

This PR aims to add a feature for the second one - you can pick and
delete a specific summary.

As I'm not yet familiar with the implementation of HypaV3, this PR only
allows deleting orphaned summaries to minimize any unforeseen
side-effects.

cn, de, es, vi, zh-Hant strings were made with Gemini. Reviews welcome.
2025-05-10 20:17:29 +09:00
kwaroran
1db6d549b7 Fix ERR_PNPM_OUTDATED_LOCKFILE (#829)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
2025-05-10 20:17:10 +09:00
kwaroran
856af41da9 fix: prevent missing data field for recursive lorebook (#839)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description

Filled data field when creating a recursive lorebook.
2025-05-10 20:16:51 +09:00
kwaroran
146691dd0c fix: prevent blocks lazy loading when no chat selected (#840)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description

Prevented lazy loading of blocks when no chat is selected.
2025-05-10 20:15:44 +09:00
kwaroran
d7c8c17353 feat: alertSelect for triggerlua (#844)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Description
This PR aims to make the alertSelect trigger usable in Lua as well.

Here is the Lua code used for testing:
```Lua
testSelect = async(function(id)
  -- declare string table
  local strTable = {
    "test1",
    "test2",
    "test3",
    "test4",
    "test5",
  }
  local testVar = alertSelect(id, strTable):await()
  print('testVar')
  print(testVar)
end)
```
2025-05-10 20:14:59 +09:00
bangonicdd
0bd947fcde feat: alertSelect for triggerlua 2025-05-07 22:47:35 +09:00
niceandneat
a148e07ad1 fix: prevent blocks lazy loading when no chat selected 2025-05-04 21:24:56 +09:00
niceandneat
306aa5f894 fix: prevent missing data field for recursive lorebook 2025-05-04 21:12:15 +09:00
YH_KIM
77ab3f79ce fix 2025-05-03 16:43:50 +09:00
YH_KIM
133156d7d4 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	src/ts/process/stableDiff.ts
2025-05-03 16:41:56 +09:00
YH_KIM
5b0ca460a5 Support numeric values in inputs and enhance image generation configs
Updated `SelectInput` and `OptionInput` to allow `value` as `string | number`. Extended image generation configurations with new features, including `cfg_rescale`, `noise_schedule`, and vibe data handling. Improved the setup for reference images and added support for mnemonist dependency in the package manager.
2025-05-03 16:38:04 +09:00
alattalatta
7a5daf0995 Merge branch 'main' into dev 2025-05-02 01:34:45 +09:00
kwaroran
6db9bd08f1 Add more restrictions 2025-04-28 16:45:06 +09:00
kwaroran
f2839e66bb fix: update request limit to 5 and use fetchNative for API calls 2025-04-28 16:41:30 +09:00
kwaroran
165e6741bd feat: add request api with rate limiting and URL validation in Lua engine 2025-04-28 16:40:28 +09:00
kwaroran
bf55f77e0d Upgrade dep 2025-04-28 16:09:29 +09:00
kwaroran
468450c254 Merge branch 'main' of https://github.com/kwaroran/RisuAI 2025-04-28 15:47:11 +09:00
kwaroran
780cbce164 Remove sleep 2025-04-28 15:47:06 +09:00
kwaroran
aef8a75f76 Add nai cfg_rescale, noise_schedule options settings (#835)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions? -
I've checked web version only.
- [x] Have you added type definitions?

# Description

Added the ability to configure the `cfg_rescale` and `noise_schedule`
properties in the NovelAI settings.

# Example


![image](https://github.com/user-attachments/assets/437984aa-7612-4a38-9d34-311faf20ced4)
2025-04-28 15:43:41 +09:00
kwaroran
02b9050666 feat: add option to show Hypa modal button in chat menu (#823)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Preview

![preview1](https://github.com/user-attachments/assets/daaafcb2-a533-4bf1-b38f-e9b9b54f6769)


![preview2](https://github.com/user-attachments/assets/a632a66d-fc74-4d92-909a-88d450cd41fb)

# Description
This PR introduces following:
- feat: add accessibility setting to control visibility of Hypa V2/V3
modal button in chat menu
- feat: add summarization condition tip to HypaV3 modal
2025-04-28 15:43:06 +09:00
kwaroran
9fc92e50ae Fix: Avoid flatMap crash when output.images is undefined (#827)
# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
In some ComfyUI workflows, output.images is often undefined when
intermediate outputs from text-based nodes are included and cannot be
suppressed in the response.
2025-04-28 15:42:54 +09:00