Skip to content

feat(fragments): import SillyTavern standalone lorebooks - #53

Open
imb101 wants to merge 1 commit into
tealios:masterfrom
imb101:feat/lorebook-import
Open

imb101 wants to merge 1 commit into
tealios:masterfrom
imb101:feat/lorebook-import

Conversation

@imb101

@imb101 imb101 commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • Adds a dedicated Lorebook Import dialog for uploading SillyTavern standalone world info / lorebook JSON files
  • Handles both array-format entries and SillyTavern's object-with-numeric-keys format ({ "0": {...}, "1": {...} })
  • Per-entry selection with type-override dropdown (knowledge / guideline / character / prose)
  • Preserves lorebook metadata: sticky, placement (system/user), keys as tags, insertion order, priority
  • BookOpen toolbar button appears in the Knowledge section sidebar
  • Drag-dropping a lorebook JSON onto the editor auto-routes to the dialog
  • Zero new TS errors introduced

Test plan

  • Drop a SillyTavern lorebook .json onto the story editor — should open LorebookImportDialog
  • Open via Knowledge section toolbar (BookOpen icon)
  • Verify entries import as knowledge/guideline fragments with correct tags and sticky flags
  • Confirm constant entries land as sticky, before_char entries get system placement
  • Try a lorebook with object-keyed entries (exported directly from SillyTavern)
  • Confirm character card JSON and Errata bundle JSON still route to their own dialogs

🤖 Generated with Claude Code

Adds a dedicated lorebook import dialog and parser so users can upload
SillyTavern world info / lorebook JSON files and convert their entries
directly into Errata knowledge and guideline fragments.

- Extends tavern-card importer with `parseSillyTavernLorebook()`,
  handling both array-entries and SillyTavern's object-with-numeric-keys
  format, plus `buildLorebookItems()` and `isSillyTavernLorebook()`
- New `LorebookImportDialog` with per-entry selection, type-override
  dropdown (knowledge/guideline/character/prose), and sticky/placement
  metadata preserved from lorebook entry flags
- Lorebook button (BookOpen icon) added to the knowledge section toolbar
  in `FragmentList`; drag-dropping a lorebook JSON onto the story editor
  auto-routes to the dialog

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant