Repository navigation
Expand file tree
/
Copy pathsettings-popup.html
More file actions
1559 lines (1440 loc) · 135 KB
/
Copy pathsettings-popup.html
File metadata and controls
1559 lines (1440 loc) · 135 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!-- DeepLore — Settings Popup (header strip + grouped sidebar nav) -->
<div class="dle-settings-popup">
<!-- Header strip: brand + master enable + help -->
<header class="dle-settings-header">
<div class="dle-brand">
<span class="dle-brand-logo" id="dle-sp-brand-logo" aria-hidden="true"></span>
<span class="dle-brand-name" data-i18n="dle_about_title">DeepLore</span>
<span class="dle-version-chip" id="dle-sp-version" data-i18n="dle_about_version_text">v2.6.2</span>
</div>
<div class="dle-header-spacer"></div>
<label class="dle-master-toggle" for="dle-sp-enabled" title="Master on/off switch. When disabled, no entries are matched, no AI calls are made, and no prompts are injected." data-i18n="[title]dle_about_master_enable_tooltip">
<span data-i18n="dle_settings_master_enabled_label">Enabled</span>
<span class="dle-switch"><input id="dle-sp-enabled" type="checkbox"><span class="track"></span></span>
</label>
<a href="https://github.com/pixelnull/sillytavern-DeepLore/wiki" target="_blank" rel="noopener noreferrer" class="dle-header-icon" title="Open the DeepLore wiki" data-i18n="[title]dle_settings_header_help_title;[aria-label]dle_settings_header_help_title" aria-label="Open the DeepLore wiki">
<i class="fa-solid fa-circle-question" aria-hidden="true"></i>
</a>
</header>
<!-- Sidebar: search → pinned About → accordion groups.
Plain nav + aria-current (accordion headers are invalid inside a tablist). -->
<nav class="dle-settings-sidebar" aria-label="Settings sections" data-i18n="[aria-label]dle_settings_sidebar_aria">
<div class="dle-nav-search">
<i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i>
<input type="search" id="dle-sp-nav-search" class="text_pole" placeholder="Search settings…" aria-label="Search settings" data-i18n="[placeholder]dle_settings_nav_search_placeholder;[aria-label]dle_settings_nav_search_placeholder">
</div>
<div class="dle-nav-noresults" id="dle-sp-nav-noresults" data-i18n-html="dle_settings_nav_noresults_html">No settings match.<br>Commands live in <b>Reference</b>.</div>
<div class="dle-nav-pinned">
<button type="button" class="dle-settings-tab active" id="dle-sp-tab-about" data-settings-tab="about" aria-current="page">
<i class="fa-solid fa-circle-info" aria-hidden="true"></i>
<span data-i18n="dle_tab_about">About</span>
</button>
</div>
<div class="dle-nav-group" data-nav-group="setup">
<button type="button" class="dle-nav-group-header" aria-expanded="true">
<span data-i18n="dle_settings_group_setup">Setup</span>
<i class="fa-solid fa-circle-chevron-down chev" aria-hidden="true"></i>
</button>
<div class="dle-nav-group-items">
<button type="button" class="dle-settings-tab" id="dle-sp-tab-obsidian" data-settings-tab="obsidian">
<i class="fa-solid fa-vault" aria-hidden="true"></i><span data-i18n="dle_subtab_obsidian">Obsidian</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-ai-connections" data-settings-tab="ai-connections">
<i class="fa-solid fa-brain" aria-hidden="true"></i><span data-i18n="dle_ai_connections_heading">AI Connections</span>
</button>
</div>
</div>
<div class="dle-nav-group" data-nav-group="pipeline">
<button type="button" class="dle-nav-group-header" aria-expanded="true">
<span data-i18n="dle_settings_group_pipeline">Lore pipeline</span>
<i class="fa-solid fa-circle-chevron-down chev" aria-hidden="true"></i>
</button>
<div class="dle-nav-group-items">
<button type="button" class="dle-settings-tab" id="dle-sp-tab-search" data-settings-tab="search">
<i class="fa-solid fa-magnifying-glass" aria-hidden="true"></i><span data-i18n="dle_tab_search">Search</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-injection" data-settings-tab="injection">
<i class="fa-solid fa-layer-group" aria-hidden="true"></i><span data-i18n="dle_tab_injection">Injection</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-prompts" data-settings-tab="prompts">
<i class="fa-solid fa-comment-dots" aria-hidden="true"></i><span data-i18n="dle_tab_prompts">Prompts</span>
</button>
</div>
</div>
<div class="dle-nav-group" data-nav-group="assistants">
<button type="button" class="dle-nav-group-header" aria-expanded="true">
<span data-i18n="dle_settings_group_assistants">Assistants</span>
<i class="fa-solid fa-circle-chevron-down chev" aria-hidden="true"></i>
</button>
<div class="dle-nav-group-items">
<button type="button" class="dle-settings-tab" id="dle-sp-tab-author-notebook" data-settings-tab="author-notebook">
<i class="fa-solid fa-book" aria-hidden="true"></i><span data-i18n="dle_feature_author_notebook_h4">Author Notebook</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-ai-notebook" data-settings-tab="ai-notebook">
<i class="fa-solid fa-robot" aria-hidden="true"></i><span data-i18n="dle_feature_ai_notepad_h4">AI Notepad</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-session-scribe" data-settings-tab="session-scribe">
<i class="fa-solid fa-feather-pointed" aria-hidden="true"></i><span data-i18n="dle_feature_session_scribe_h4">Session Scribe</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-auto-lorebook" data-settings-tab="auto-lorebook">
<i class="fa-solid fa-wand-magic-sparkles" aria-hidden="true"></i><span data-i18n="dle_feature_auto_lorebook_h4">Auto Lorebook</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-graph" data-settings-tab="graph">
<i class="fa-solid fa-diagram-project" aria-hidden="true"></i><span data-i18n="dle_feature_graph_h4">Graph</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-librarian" data-settings-tab="librarian">
<i class="fa-solid fa-book-bookmark" aria-hidden="true"></i><span data-i18n="dle_analytics_section_librarian">Librarian</span>
</button>
</div>
</div>
<div class="dle-nav-group" data-nav-group="tools">
<button type="button" class="dle-nav-group-header" aria-expanded="true">
<span data-i18n="dle_settings_group_tools">Tools</span>
<i class="fa-solid fa-circle-chevron-down chev" aria-hidden="true"></i>
</button>
<div class="dle-nav-group-items">
<button type="button" class="dle-settings-tab" id="dle-sp-tab-system" data-settings-tab="system">
<i class="fa-solid fa-sliders" aria-hidden="true"></i><span data-i18n="dle_role_system">System</span>
</button>
<button type="button" class="dle-settings-tab" id="dle-sp-tab-reference" data-settings-tab="reference">
<i class="fa-solid fa-terminal" aria-hidden="true"></i><span data-i18n="dle_tab_reference">Reference</span>
</button>
</div>
</div>
</nav>
<!-- Content area -->
<div class="dle-settings-content">
<!-- ═══════════════════════════════════════════════════════════════════
TAB: Obsidian (Setup)
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-panel-obsidian" data-settings-panel="obsidian"
aria-labelledby="dle-sp-tab-obsidian" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_subtab_obsidian">Obsidian</h3>
<p class="dle-panel-subtitle" data-i18n="dle_settings_panel_sub_obsidian">Connect your Obsidian vaults and control which notes get indexed.</p>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_vault_connections_heading">Vault Connections</h4>
<p class="dle-section-desc" data-i18n="dle_vault_connections_desc">Connect to your Obsidian vaults. Each vault needs the Local REST API plugin running.</p>
<div class="flex-container flexFlowColumn">
<div id="dle-sp-vault-list" style="margin-bottom: 6px;">
<!-- Vault rows rendered dynamically -->
</div>
<div class="flex-container" style="gap: 6px;">
<div id="dle-sp-add-vault" class="menu_button menu_button_icon" role="button" title="Add another Obsidian vault connection." tabindex="0" data-i18n="[title]dle_add_vault_tooltip">
<i class="fa-solid fa-plus" aria-hidden="true"></i>
<span data-i18n="dle_add_vault_button">Add Vault</span>
</div>
<div id="dle-sp-test-connection" class="menu_button menu_button_icon" role="button" title="Test all enabled vault connections." tabindex="0" data-i18n="[title]dle_test_connections_tooltip">
<i class="fa-solid fa-plug" aria-hidden="true"></i>
<span data-i18n="dle_test_connections_button">Test All</span>
</div>
<div id="dle-sp-scan-vaults" class="menu_button menu_button_icon" role="button" title="Scan a port range for responding Obsidian Local REST API instances." tabindex="0" data-i18n="[title]dle_settings_scan_for_vaults_tooltip">
<i class="fa-solid fa-radar" aria-hidden="true"></i>
<span data-i18n="dle_settings_scan_for_vaults_label">Scan for Vaults</span>
</div>
<span id="dle-sp-connection-status" class="dle-status"></span>
</div>
</div>
<div class="flex-container dle-sp-margin-top">
<div class="flex1" title="When two vaults have entries with the same title: All keeps both, First/Last vault wins, Merge combines their keywords." data-i18n="[title]dle_conflict_resolution_tooltip">
<label for="dle-sp-multi-vault-conflict"><small data-i18n="dle_conflict_resolution_label">Multi-Vault Conflict Resolution</small></label>
<select id="dle-sp-multi-vault-conflict" class="text_pole">
<option value="all" data-i18n="dle_settings_multi_vault_conflict_all">All (keep duplicates)</option>
<option value="first" data-i18n="dle_settings_multi_vault_conflict_first">First vault wins</option>
<option value="last" data-i18n="dle_settings_multi_vault_conflict_last">Last vault wins</option>
<option value="merge" data-i18n="dle_settings_multi_vault_conflict_merge">Merge (combine keywords)</option>
</select>
</div>
</div>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_vault_tags_heading">Vault Tags</h4>
<p class="dle-section-desc" data-i18n="dle_vault_tags_desc">Tags control which Obsidian notes are indexed and how they behave.</p>
<div class="flex-container flexFlowColumn">
<div class="flex-container">
<div class="flex1" title="Tag (without #) that marks an Obsidian note as a lorebook entry." data-i18n="[title]dle_lorebook_tag_tooltip">
<label for="dle-sp-tag"><small data-i18n="dle_lorebook_tag_label">Lorebook Tag</small></label>
<input id="dle-sp-tag" type="text" class="text_pole" placeholder="lorebook" data-i18n="[placeholder]dle_lorebook_tag_placeholder">
</div>
<div class="flex1" title="Tag (without #) that forces a note to always be included, regardless of keyword matches." data-i18n="[title]dle_always_send_tag_tooltip">
<label for="dle-sp-constant-tag"><small data-i18n="dle_always_send_tag_label">Always-Send Tag</small></label>
<input id="dle-sp-constant-tag" type="text" class="text_pole" placeholder="lorebook-always" data-i18n="[placeholder]dle_always_send_tag_placeholder">
</div>
</div>
<div class="flex-container">
<div class="flex1" title="Tag (without #) that prevents a note from ever being included." data-i18n="[title]dle_never_insert_tag_tooltip">
<label for="dle-sp-never-insert-tag"><small data-i18n="dle_never_insert_tag_label">Never-Insert Tag</small></label>
<input id="dle-sp-never-insert-tag" type="text" class="text_pole" placeholder="lorebook-never" data-i18n="[placeholder]dle_never_insert_tag_placeholder">
</div>
</div>
<div class="dle-advanced-toggle" data-section="sp_vault_tags" tabindex="0" role="button" aria-expanded="false">
<i class="fa-solid fa-chevron-right dle-advanced-icon" aria-hidden="true"></i> <span data-i18n="dle_settings_show_advanced_label">Show Advanced</span>
</div>
<div class="dle-advanced-section" data-section="sp_vault_tags" style="display: none;">
<div class="flex-container">
<div class="flex1" title="Tag for entries whose content is sent to the AI as background context on new chats." data-i18n="[title]dle_seed_tag_tooltip">
<label for="dle-sp-seed-tag"><small data-i18n="dle_seed_tag_label">Seed Tag</small></label>
<input id="dle-sp-seed-tag" type="text" class="text_pole" placeholder="lorebook-seed" data-i18n="[placeholder]dle_seed_tag_placeholder">
</div>
<div class="flex1" title="Tag for starter entries — always included when the chat is short (below the New Chat Threshold)." data-i18n="[title]dle_bootstrap_tag_tooltip">
<label for="dle-sp-bootstrap-tag"><small data-i18n="dle_bootstrap_tag_label">Starter Entry Tag</small></label>
<input id="dle-sp-bootstrap-tag" type="text" class="text_pole" placeholder="lorebook-bootstrap" data-i18n="[placeholder]dle_bootstrap_tag_placeholder">
</div>
</div>
<div class="flex-container">
<div class="flex1" title="Tag for Librarian-only writing/style guides. These entries never reach the writing AI — only the Librarian can fetch them via its chat tool." data-i18n="[title]dle_guide_tag_tooltip">
<label for="dle-sp-librarian-guide-tag"><small data-i18n="dle_guide_tag_label">Librarian Guide Tag</small></label>
<input id="dle-sp-librarian-guide-tag" type="text" class="text_pole" placeholder="lorebook-guide" data-i18n="[placeholder]dle_guide_tag_placeholder">
</div>
<div class="flex1" title="Message count threshold for new chat features. Default: 3." data-i18n="[title]dle_new_chat_threshold_tooltip">
<label for="dle-sp-new-chat-threshold"><small data-i18n="dle_new_chat_threshold_label">New Chat Threshold</small></label>
<input id="dle-sp-new-chat-threshold" type="number" class="text_pole" min="1" max="20" placeholder="3" />
</div>
</div>
</div>
</div>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_field_defs_heading">Field Definitions</h4>
<p class="dle-section-desc" data-i18n="dle_field_defs_desc">Custom gating fields (era, location, mood, etc.) defined in a YAML file inside your vault.</p>
<div class="flex-container" style="align-items: flex-end;">
<div class="flex1" title="Path to the YAML file in Obsidian that defines custom gating fields. Relative to vault root." data-i18n="[title]dle_field_defs_path_tooltip">
<label for="dle-sp-field-definitions-path"><small data-i18n="dle_field_defs_path_label">Field Definitions Path</small></label>
<input id="dle-sp-field-definitions-path" type="text" class="text_pole" placeholder="DeepLore/field-definitions.yaml" data-i18n="[placeholder]dle_default_field_definitions_path">
</div>
<div id="dle-sp-edit-fields-btn" class="menu_button" title="Open the field definition editor" style="height: fit-content; margin-left: 8px; white-space: nowrap;" data-i18n="[title]dle_edit_fields_tooltip">
<i class="fa-solid fa-gear" aria-hidden="true"></i> <span data-i18n="dle_edit_fields_button">Edit Fields</span>
</div>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════════
TAB: AI Connections (Setup)
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-panel-ai-connections" data-settings-panel="ai-connections"
aria-labelledby="dle-sp-tab-ai-connections" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_ai_connections_heading">AI Connections</h3>
<p class="dle-panel-subtitle" data-i18n="dle_settings_panel_sub_ai_connections">Which AI connection each DeepLore tool uses — profiles, models, and per-tool overrides.</p>
</div>
<div class="dle-settings-section" id="dle-sp-ai-connections">
<p class="dle-section-desc" data-i18n="dle_ai_connections_desc">Configure AI connections for each tool. Tools set to "Inherit" use the AI Search connection.</p>
<!-- Claude adaptive-thinking misconfiguration banner (populated by settings-ui.js) -->
<div id="dle-claude-effort-banner" class="dle-warning-banner" style="display:none; padding: var(--dle-space-2) var(--dle-space-3); background: color-mix(in srgb, var(--dle-warning, #d97706) 15%, transparent); border-left: 3px solid var(--dle-warning, #d97706); border-radius: 4px; margin: var(--dle-space-2) 0; font-size: var(--dle-text-sm);" role="alert">
<i class="fa-solid fa-triangle-exclamation" style="color: var(--dle-warning, #d97706); margin-right: 6px;" aria-hidden="true"></i>
<span class="dle-claude-effort-banner-text"></span>
</div>
<!-- Accordion items generated dynamically by settings-ui.js -->
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════════
TAB: Search (Lore pipeline) — merged Matching + AI Search
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-search" data-settings-panel="search"
aria-labelledby="dle-sp-tab-search" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_tab_search">Search</h3>
<p class="dle-panel-subtitle"><span data-i18n="dle_settings_panel_sub_search">How DeepLore finds and ranks entries — keyword matching and AI selection, unified.</span>
<span class="dle-merge-note"><i class="fa-solid fa-code-merge" aria-hidden="true"></i><span data-i18n="dle_settings_search_merge_note">was Matching + AI Search</span></span></p>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_ai_search_mode_label">Search Mode</h4>
<p class="dle-section-desc" data-i18n="dle_search_mode_desc">Choose how entries are selected: keywords (free), two-stage (keywords + AI), or AI-only.</p>
<div class="flex-container flexFlowColumn">
<div class="flex-container">
<div class="flex1" title="How DeepLore matches entries to inject." data-i18n="[title]dle_search_mode_tooltip">
<label for="dle-sp-search-mode"><small data-i18n="dle_search_mode_label">Mode</small></label>
<select id="dle-sp-search-mode" class="text_pole">
<option value="keywords-only" data-i18n="dle_search_mode_keywords">Keyword Only</option>
<option value="two-stage" data-i18n="dle_search_mode_two_stage">Two-Stage (Keywords → AI)</option>
<option value="ai-only" data-i18n="dle_search_mode_ai_only">AI Only</option>
</select>
</div>
</div>
</div>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_matching_budget_heading">Matching & Budget</h4>
<p class="dle-section-desc" data-i18n="dle_matching_budget_desc">Control how entries are matched and how much context they can use.</p>
<div class="flex-container flexFlowColumn">
<div class="flex-container">
<div class="flex1" title="Number of recent chat messages to scan for keyword matches. Default: 4." data-i18n="[title]dle_scan_depth_tooltip">
<label for="dle-sp-scan-depth"><small data-i18n="dle_scan_depth_label">Messages to Search</small></label>
<input id="dle-sp-scan-depth" type="number" class="text_pole" min="0" max="100" />
</div>
</div>
</div>
<label class="checkbox_label" for="dle-sp-char-context-scan" title="Automatically include the active character's vault entry based on their name, without needing a keyword match." data-i18n="[title]dle_auto_match_char_tooltip">
<input id="dle-sp-char-context-scan" type="checkbox" class="checkbox">
<span data-i18n="dle_auto_match_char_label">Auto-match active character</span>
</label>
<label class="checkbox_label" for="dle-sp-fuzzy-search" title="Enable flexible text matching alongside keywords — finds entries even when the exact keyword isn't used." data-i18n="[title]dle_fuzzy_search_tooltip">
<input id="dle-sp-fuzzy-search" type="checkbox" class="checkbox">
<span data-i18n="dle_fuzzy_search_label">Flexible Matching</span>
</label>
<div id="dle-sp-fuzzy-min-score-row" class="dle-sp-indent">
<div title="How strict fuzzy matching should be. Lower finds more entries (including weaker matches), higher is stricter. Default: 0.5." data-i18n="[title]dle_fuzzy_sensitivity_tooltip">
<label for="dle-sp-fuzzy-min-score"><small data-i18n="dle_fuzzy_sensitivity_label">Match Sensitivity</small></label>
<input id="dle-sp-fuzzy-min-score" type="range" min="0.1" max="2.0" step="0.1" class="dle-w-full" />
<div class="flex-container" style="justify-content: space-between;">
<span class="dle-text-xs dle-muted" data-i18n="dle_fuzzy_loose">Loose (more matches)</span>
<span class="dle-text-xs dle-muted" id="dle-sp-fuzzy-min-score-value">0.5</span>
<span class="dle-text-xs dle-muted" data-i18n="dle_fuzzy_strict">Strict (fewer)</span>
</div>
</div>
<div id="dle-sp-fuzzy-preview-results" style="margin-top: 6px; max-height: 200px; overflow-y: auto; font-size: 0.85em;"></div>
</div>
<div class="flex-container dle-toggle-value-row">
<div class="flex1">
<label class="checkbox_label" for="dle-sp-unlimited-entries" title="Remove the cap on how many entries can be injected per generation." data-i18n="[title]dle_unlimited_entries_tooltip">
<input id="dle-sp-unlimited-entries" type="checkbox" class="checkbox">
<span data-i18n="dle_unlimited_entries_label">Unlimited Entries</span>
</label>
<small class="dle-text-xs dle-muted dle-unlimited-warning" id="dle-sp-unlimited-entries-warn" style="display:none;" title="Larger vaults take longer to inject every entry every generation." data-i18n="[title]dle_unlimited_budget_warning_tooltip">Larger vaults may feel slower.</small>
</div>
<div class="flex1" title="Maximum number of lorebook entries to inject per generation." data-i18n="[title]dle_max_entries_tooltip">
<label for="dle-sp-max-entries"><small data-i18n="dle_max_entries_label">Max Entries</small></label>
<input id="dle-sp-max-entries" type="number" class="text_pole" min="1" max="100" />
</div>
</div>
<div class="flex-container dle-toggle-value-row">
<div class="flex1">
<label class="checkbox_label" for="dle-sp-unlimited-budget" title="Remove the token budget cap." data-i18n="[title]dle_unlimited_budget_tooltip">
<input id="dle-sp-unlimited-budget" type="checkbox" class="checkbox">
<span data-i18n="dle_unlimited_budget_label">Unlimited Token Budget</span>
</label>
<small class="dle-text-xs dle-muted dle-unlimited-warning" id="dle-sp-unlimited-budget-warn" style="display:none;" title="Larger vaults take longer to inject every entry every generation." data-i18n="[title]dle_unlimited_budget_warning_tooltip">Larger vaults may feel slower.</small>
</div>
<div class="flex1" title="Maximum total tokens to inject from lorebook entries per generation." data-i18n="[title]dle_token_budget_tooltip">
<label for="dle-sp-token-budget"><small data-i18n="dle_token_budget_label">Token Budget</small></label>
<input id="dle-sp-token-budget" type="number" class="text_pole" min="100" max="100000" />
</div>
</div>
<h4 data-i18n="dle_settings_repetition_control_h4">Repetition Control</h4>
<label class="checkbox_label" for="dle-sp-decay-enabled" title="Entries that haven't appeared recently become more likely to be picked. Entries appearing too often become less likely. Adds variety to lore injection." data-i18n="[title]dle_decay_tooltip">
<input id="dle-sp-decay-enabled" type="checkbox" class="checkbox">
<span data-i18n="dle_decay_label">Enable Repetition Control</span>
</label>
<div class="flex-container" id="dle-sp-decay-controls">
<div class="flex1" title="How many turns an entry can be skipped before it's boosted to reappear. Default: 5." data-i18n="[title]dle_decay_boost_tooltip">
<label for="dle-sp-decay-boost-threshold"><small data-i18n="dle_decay_boost_label">Boost After N Skips</small></label>
<input id="dle-sp-decay-boost-threshold" type="number" class="text_pole" min="2" max="20" placeholder="5" />
</div>
<div class="flex1" title="How many times in a row an entry can be injected before it becomes less likely to appear. Default: 2." data-i18n="[title]dle_decay_penalty_tooltip">
<label for="dle-sp-decay-penalty-threshold"><small data-i18n="dle_decay_penalty_label">Penalize After N in a Row</small></label>
<input id="dle-sp-decay-penalty-threshold" type="number" class="text_pole" min="2" max="10" placeholder="2" />
</div>
</div>
<div class="dle-advanced-toggle" data-section="sp_matching" tabindex="0" role="button" aria-expanded="false">
<i class="fa-solid fa-chevron-right dle-advanced-icon" aria-hidden="true"></i> <span data-i18n="dle_settings_show_advanced_label">Show Advanced</span>
</div>
<div class="dle-advanced-section" data-section="sp_matching" style="display: none;">
<label class="dle-advanced-subheader"><small data-i18n="dle_settings_keyword_matching_subheader">Keyword Matching</small></label>
<label class="checkbox_label" for="dle-sp-case-sensitive" title="When checked, keyword matching is case-sensitive." data-i18n="[title]dle_case_sensitive_tooltip">
<input id="dle-sp-case-sensitive" type="checkbox" class="checkbox">
<span data-i18n="dle_case_sensitive_label">Case Sensitive</span>
</label>
<label class="checkbox_label" for="dle-sp-match-whole-words" title="Keywords must match as whole words." data-i18n="[title]dle_whole_words_tooltip">
<input id="dle-sp-match-whole-words" type="checkbox" class="checkbox">
<span data-i18n="dle_whole_words_label">Match Whole Words</span>
</label>
<label class="checkbox_label" for="dle-sp-keyword-occurrence-weighting" title="When enabled, entries with more keyword occurrences in the chat sort higher within the same priority tier. May increase processing time on large vaults." data-i18n="[title]dle_occurrence_weighting_tooltip">
<input id="dle-sp-keyword-occurrence-weighting" type="checkbox" class="checkbox">
<span data-i18n="dle_occurrence_weighting_label">Keyword Occurrence Weighting</span>
</label>
<span class="dle-text-xs dle-muted dle-sp-indent"><i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i> May increase processing time on large vaults — counts occurrences for every matched entry.</span>
<label class="dle-advanced-subheader"><small data-i18n="dle_settings_priority_order_subheader">Priority Order</small></label>
<label class="checkbox_label" for="dle-sp-priority-reversed" title="By default, LOWER priority numbers win (Obsidian/WI convention: 0 = most important). When checked, HIGHER numbers win instead. Affects pipeline budget allocation, Librarian view, Cartographer, and the default Browse sort. Explicit priority_asc/priority_desc dropdown choices in Browse still sort literally." data-i18n="[title]dle_priority_reversed_tooltip">
<input id="dle-sp-priority-reversed" type="checkbox" class="checkbox">
<span data-i18n="dle_priority_reversed_label">Reverse Priority (higher number wins)</span>
</label>
<label class="dle-advanced-subheader"><small data-i18n="dle_wizard_step_8_import">Import</small></label>
<label class="checkbox_label" for="dle-sp-import-compress-default" title="When checked, World Info imports run each entry's body through the caveman compressor before writing. Drops articles / fillers / pleasantries to shrink token count ~15-30% without changing meaning. Stored frontmatter is annotated with `compress: caveman`. Code blocks, inline code, and URLs are preserved." data-i18n="[title]dle_compress_import_tooltip">
<input id="dle-sp-import-compress-default" type="checkbox" class="checkbox">
<span data-i18n="dle_compress_import_label">Shrink imported entries to save tokens (caveman mode)</span>
</label>
<div class="flex-container dle-sp-indent" title="How WI 'Example Messages' positions (before_example_messages / after_example_messages) are converted. DLE has no EM slot, so 'Append' makes them regular vault entries with a '## Example Dialogue' subheader; 'Skip' drops them entirely. Per-import override available from the post-import popup." data-i18n="[title]dle_wi_em_handling_tooltip">
<div class="flex1">
<label for="dle-sp-wi-import-em-handling"><small data-i18n="dle_wi_em_handling_label">WI Example Messages on import</small></label>
<select id="dle-sp-wi-import-em-handling" class="text_pole">
<option value="append" data-i18n="dle_wi_em_handling_append">Append as subheader (default)</option>
<option value="skip" data-i18n="dle_wi_em_handling_skip">Skip</option>
</select>
</div>
</div>
<label class="dle-advanced-subheader"><small data-i18n="dle_recursive_scan_label">Chain Matching</small></label>
<label class="checkbox_label" for="dle-sp-recursive-scan" title="Scan matched entries' content for keywords that might trigger additional entries." data-i18n="[title]dle_recursive_scan_tooltip">
<input id="dle-sp-recursive-scan" type="checkbox" class="checkbox">
<span data-i18n="dle_recursive_scan_label">Chain Matching</span>
</label>
<div class="flex-container dle-sp-indent">
<div class="flex1" title="Maximum number of recursive scan passes. Default: 3." data-i18n="[title]dle_max_recursion_tooltip">
<label for="dle-sp-max-recursion"><small data-i18n="dle_max_recursion_label">Max Recursion Steps</small></label>
<input id="dle-sp-max-recursion" type="number" class="text_pole" min="1" max="10" />
</div>
</div>
<label class="dle-advanced-subheader"><small data-i18n="dle_settings_reinjection_control_subheader">Re-injection Control</small></label>
<div class="flex-container">
<div class="flex1" title="After an entry is injected, skip it for the next N generations. 0 = always include when matched." data-i18n="[title]dle_reinjection_cooldown_tooltip">
<label for="dle-sp-reinjection-cooldown"><small data-i18n="dle_reinjection_cooldown_label">Repeat Cooldown (0 = off)</small></label>
<input id="dle-sp-reinjection-cooldown" type="number" class="text_pole" min="0" max="50" />
</div>
</div>
<div class="flex-container dle-toggle-value-row">
<div class="flex1">
<label class="checkbox_label" for="dle-sp-strip-dedup" title="Skip entries that were already injected in recent messages, preventing repeats." data-i18n="[title]dle_strip_dedup_tooltip">
<input id="dle-sp-strip-dedup" type="checkbox" class="checkbox">
<span data-i18n="dle_strip_dedup_label">Skip Recently Injected</span>
</label>
</div>
<div class="flex1" title="How many prior messages to check for recently injected entries." data-i18n="[title]dle_strip_lookback_tooltip">
<label for="dle-sp-strip-lookback"><small data-i18n="dle_strip_lookback_label">Messages to check</small></label>
<input id="dle-sp-strip-lookback" type="number" class="text_pole" min="1" max="10" />
</div>
</div>
<label class="dle-advanced-subheader"><small data-i18n="dle_settings_scene_filters_subheader">Scene Filters</small></label>
<div class="flex-container">
<div class="flex1" title="How to handle entries with era/location/scene requirements when no context is set. Strict: block if any dimension is missing. Moderate: block only when entry's dimension is set but doesn't match. Lenient: allow all entries when no context dimensions are set." data-i18n="[title]dle_gating_tolerance_tooltip">
<label for="dle-sp-contextual-gating-tolerance"><small data-i18n="dle_gating_tolerance_label">Filter Strictness</small></label>
<select id="dle-sp-contextual-gating-tolerance" class="text_pole">
<option value="strict" data-i18n="dle_settings_gating_tolerance_strict">Strict (block when context missing)</option>
<option value="moderate" data-i18n="dle_settings_gating_tolerance_moderate">Moderate (block only on mismatch)</option>
<option value="lenient" data-i18n="dle_settings_gating_tolerance_lenient">Lenient (allow when no context set)</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════════
TAB: Injection
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-injection" data-settings-panel="injection"
aria-labelledby="dle-sp-tab-injection" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_tab_injection">Injection</h3>
<p class="dle-panel-subtitle" data-i18n="dle_settings_panel_sub_injection">Where selected lore lands in the prompt — position, depth, role, and formatting.</p>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_injection_mode_heading">Injection Mode</h4>
<p class="dle-section-desc" data-i18n="dle_injection_mode_desc">Control how DeepLore places entries into the prompt.</p>
<div class="radio_group">
<label title="Use the standard SillyTavern injection method with fixed position, depth, and role." data-i18n="[title]dle_injection_extension_tooltip">
<input type="radio" name="dle-sp-injection-mode" value="extension" />
<span data-i18n="dle_injection_extension_label">Extension Prompt</span>
</label>
<label title="Create named prompts that appear in the prompt list. Drag them to any position." data-i18n="[title]dle_injection_prompt_list_tooltip">
<input type="radio" name="dle-sp-injection-mode" value="prompt_list" />
<span data-i18n="dle_settings_prompt_list_drag_drop">Prompt List (drag & drop)</span>
</label>
</div>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_settings_injection_overview_h4">Injection Overview</h4>
<p class="dle-section-desc" data-i18n="dle_settings_injection_overview_desc">Default position, depth, and role for each injection type.</p>
<div class="dle-injection-table">
<!-- Constants -->
<div class="dle-injection-row">
<div class="dle-injection-type">
<i class="fa-solid fa-thumbtack" aria-hidden="true"></i>
<span data-i18n="dle_browse_filter_constants">Constants</span>
</div>
<div class="dle-injection-controls">
<div class="dle-injection-ext-controls">
<span class="dle-text-xs dle-muted" data-i18n="dle_injection_constants_same">Same position as Lore Entries</span>
</div>
<span class="dle-injection-pm-name" style="display:none"><code data-i18n="dle_injection_pm_constants">DLE Constants</code></span>
</div>
<div class="dle-injection-status">
<span id="dle-sp-inj-constants-status" class="dle-text-xs dle-muted"></span>
</div>
</div>
<!-- Lore Entries -->
<div class="dle-injection-row">
<div class="dle-injection-type">
<i class="fa-solid fa-book" aria-hidden="true"></i>
<span data-i18n="dle_injection_type_lore">Lore Entries</span>
</div>
<div class="dle-injection-controls">
<div class="dle-injection-ext-controls">
<select id="dle-sp-position" class="text_pole widthNatural" title="Where to inject matched lore entries in the prompt." data-i18n="[title]dle_position_tooltip">
<option value="2" data-i18n="dle_position_before">Before Main Prompt</option>
<option value="0" data-i18n="dle_position_after">After Main Prompt</option>
<option value="1" data-i18n="dle_cart_pos_inchat">In-chat</option>
</select>
<span class="dle-injection-inchat-controls" style="display:none">
<label class="dle-text-xs" for="dle-sp-depth" data-i18n="dle_depth_label">depth</label>
<input id="dle-sp-depth" class="text_pole widthUnset dle-sp-narrow-input" type="number" min="0" max="9999" />
<label class="dle-text-xs" for="dle-sp-role" data-i18n="dle_role_as_label">as</label>
<select id="dle-sp-role" class="text_pole widthNatural">
<option value="0" data-i18n="dle_role_system">System</option>
<option value="1" data-i18n="dle_role_user">User</option>
<option value="2" data-i18n="dle_role_assistant">Assistant</option>
</select>
</span>
</div>
<span class="dle-injection-pm-name" style="display:none"><code data-i18n="dle_injection_pm_lore">DLE Lore Entries</code></span>
</div>
<div class="dle-injection-status">
<span id="dle-sp-inj-lore-status" class="dle-text-xs dle-muted"></span>
</div>
</div>
<!-- Author's Notebook -->
<div class="dle-injection-row">
<div class="dle-injection-type">
<i class="fa-solid fa-pen-fancy" aria-hidden="true"></i>
<span data-i18n="dle_injection_type_notebook">Author's Notebook</span>
</div>
<div class="dle-injection-controls">
<div class="dle-injection-ext-controls">
<select id="dle-sp-notebook-position" class="text_pole widthNatural" title="Where to inject the Author's Notebook content." data-i18n="[title]dle_notebook_position_tooltip">
<option value="2" data-i18n="dle_position_before">Before Main Prompt</option>
<option value="0" data-i18n="dle_position_after">After Main Prompt</option>
<option value="1" data-i18n="dle_cart_pos_inchat">In-chat</option>
</select>
<span class="dle-injection-inchat-controls" style="display:none">
<label class="dle-text-xs" for="dle-sp-notebook-depth" data-i18n="dle_depth_label">depth</label>
<input id="dle-sp-notebook-depth" class="text_pole widthUnset dle-sp-narrow-input" type="number" min="0" max="9999" />
<label class="dle-text-xs" for="dle-sp-notebook-role" data-i18n="dle_role_as_label">as</label>
<select id="dle-sp-notebook-role" class="text_pole widthNatural">
<option value="0" data-i18n="dle_role_system">System</option>
<option value="1" data-i18n="dle_role_user">User</option>
<option value="2" data-i18n="dle_role_assistant">Assistant</option>
</select>
</span>
</div>
<span class="dle-injection-pm-name" style="display:none"><code data-i18n="dle_injection_pm_notebook">DLE Author's Notebook</code></span>
</div>
<div class="dle-injection-status">
<span id="dle-sp-inj-notebook-status" class="dle-text-xs dle-muted"></span>
</div>
</div>
<!-- AI Notepad -->
<div class="dle-injection-row">
<div class="dle-injection-type">
<i class="fa-solid fa-robot" aria-hidden="true"></i>
<span data-i18n="dle_feature_ai_notepad_h4">AI Notepad</span>
</div>
<div class="dle-injection-controls">
<div class="dle-injection-ext-controls">
<select id="dle-sp-ai-notepad-position" class="text_pole widthNatural" title="Where to inject the AI Notepad content." data-i18n="[title]dle_ai_notepad_position_tooltip">
<option value="2" data-i18n="dle_position_before">Before Main Prompt</option>
<option value="0" data-i18n="dle_position_after">After Main Prompt</option>
<option value="1" data-i18n="dle_cart_pos_inchat">In-chat</option>
</select>
<span class="dle-injection-inchat-controls" style="display:none">
<label class="dle-text-xs" for="dle-sp-ai-notepad-depth" data-i18n="dle_depth_label">depth</label>
<input id="dle-sp-ai-notepad-depth" class="text_pole widthUnset dle-sp-narrow-input" type="number" min="0" max="9999" />
<label class="dle-text-xs" for="dle-sp-ai-notepad-role" data-i18n="dle_role_as_label">as</label>
<select id="dle-sp-ai-notepad-role" class="text_pole widthNatural">
<option value="0" data-i18n="dle_role_system">System</option>
<option value="1" data-i18n="dle_role_user">User</option>
<option value="2" data-i18n="dle_role_assistant">Assistant</option>
</select>
</span>
</div>
<span class="dle-injection-pm-name" style="display:none"><code data-i18n="dle_pm_ai_notepad">DLE AI Notepad</code></span>
</div>
<div class="dle-injection-status">
<span id="dle-sp-inj-notepad-status" class="dle-text-xs dle-muted"></span>
</div>
</div>
</div>
<span class="dle-text-xs dle-muted"><i class="fa-solid fa-circle-info" aria-hidden="true"></i> <span data-i18n="dle_settings_injection_overrides_note">Individual entries can override these defaults in their frontmatter (position, depth, role).</span></span>
<div id="dle-sp-injection-pm-info" style="display: none;">
<span class="dle-text-xs dle-muted"><i class="fa-solid fa-circle-info" aria-hidden="true"></i> <span data-i18n="dle_settings_injection_pm_drag_note">Drag these entries in SillyTavern's Prompt Manager to control injection order.</span></span>
</div>
</div>
<div class="dle-settings-section">
<h4 data-i18n="dle_settings_source_tracking_h4">Source Tracking</h4>
<div class="flex-container flexFlowColumn">
<label class="checkbox_label" for="dle-sp-show-sources" title="Add a book icon to AI messages showing which vault entries were injected and why." data-i18n="[title]dle_show_sources_tooltip">
<input id="dle-sp-show-sources" type="checkbox" class="checkbox">
<span data-i18n="dle_show_sources_label">Show Sources Button</span>
</label>
<span class="dle-text-xs dle-muted" data-i18n="dle_sources_deeplink_note">Deep links require vault connection names to match your Obsidian vault names.</span>
</div>
</div>
<div class="dle-settings-section">
<div class="dle-advanced-toggle" data-section="sp_injection" tabindex="0" role="button" aria-expanded="false">
<i class="fa-solid fa-chevron-right dle-advanced-icon" aria-hidden="true"></i> <span data-i18n="dle_settings_show_advanced_label">Show Advanced</span>
</div>
<div class="dle-advanced-section" data-section="sp_injection" style="display: none;">
<div title="Template for formatting each injected entry. Use {{title}} and {{content}} macros." data-i18n="[title]dle_template_tooltip">
<label for="dle-sp-template"><small data-i18n="dle_template_label">Entry Format</small></label>
<textarea id="dle-sp-template" class="text_pole textarea_compact" rows="3" placeholder="Use {{title}} and {{content}} macros." data-i18n="[placeholder]dle_template_placeholder"></textarea>
</div>
<label class="checkbox_label" for="dle-sp-allow-wi-scan" title="When enabled, SillyTavern's built-in World Info can trigger on text inside your DeepLore entries. Useful if you use both systems. May cause duplicate injections." data-i18n="[title]dle_allow_wi_scan_tooltip">
<input id="dle-sp-allow-wi-scan" type="checkbox" class="checkbox">
<span data-i18n="dle_allow_wi_scan_label">Allow World Info Scan</span>
</label>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════════
Search panel continuation — AI-selection half of the merged Search
tab. Shares data-settings-panel="search" with the block above:
switchSettingsTab toggles BOTH via the attribute selector. Do NOT
give this block its own tab token or nav entry.
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-ai" data-settings-panel="search"
aria-labelledby="dle-sp-tab-search" hidden>
<div id="dle-sp-ai-disabled-notice" class="dle-overlay-notice" style="display: none;">
<div class="dle-overlay-notice-card">
<i class="fa-solid fa-brain" aria-hidden="true" style="font-size: 1.4em; opacity: 0.6;"></i>
<p data-i18n="dle_ai_disabled_notice">AI search is currently disabled.</p>
<p data-i18n-html="dle_ai_disabled_help">Set Search Mode to <strong>Two-Stage</strong> or <strong>AI Only</strong> in the
<a href="#" id="dle-sp-goto-matching" class="dle-notice-link">Search Mode section above</a>
to configure these settings.</p>
</div>
</div>
<div class="dle-ai-content-wrap">
<h4 data-i18n="dle_ai_settings_heading">AI Search Settings</h4>
<p class="dle-section-desc" data-i18n="dle_ai_settings_desc">Configure the AI model that selects which entries to inject.</p>
<div class="flex-container flexFlowColumn">
<span class="dle-text-xs dle-muted" data-i18n-html="dle_settings_connection_settings_note">Connection settings: <a href="#" class="dle-goto-ai-connections">AI Connections</a> under Setup.</span>
<div class="flex-container" style="gap: 6px;">
<div id="dle-sp-test-ai" class="menu_button menu_button_icon" role="button" tabindex="0" title="Test AI search connection." data-i18n="[title]dle_test_ai_tooltip">
<i class="fa-solid fa-brain" aria-hidden="true"></i>
<span data-i18n="dle_test_ai_button">Test AI Search</span>
</div>
<div id="dle-sp-preview-ai" class="menu_button menu_button_icon" role="button" tabindex="0" title="Preview the AI search prompt." data-i18n="[title]dle_preview_ai_tooltip">
<i class="fa-solid fa-eye" aria-hidden="true"></i>
<span data-i18n="dle_preview_ai_button">Preview Prompt</span>
</div>
<span id="dle-sp-ai-status" class="dle-status"></span>
</div>
<!-- Always visible: Confidence + Fallback -->
<div class="flex-container">
<div class="flex1" title="Filter AI results by confidence tier. Low includes all, Medium drops low-confidence, High keeps only high-confidence entries." data-i18n="[title]dle_ai_confidence_tooltip">
<label for="dle-sp-ai-confidence-threshold"><small data-i18n="dle_ai_confidence_label">AI Confidence Threshold</small></label>
<select id="dle-sp-ai-confidence-threshold" class="text_pole">
<option value="low" data-i18n="dle_ai_confidence_low">Low (include all tiers)</option>
<option value="medium" data-i18n="dle_ai_confidence_medium">Medium (medium + high only)</option>
<option value="high" data-i18n="dle_ai_confidence_high">High (high confidence only)</option>
</select>
</div>
</div>
<div class="flex-container">
<div class="flex1" title="What to inject when AI search encounters an error (network failure, timeout, etc)." data-i18n="[title]dle_ai_error_fallback_tooltip">
<label for="dle-sp-ai-error-fallback"><small data-i18n="dle_ai_error_fallback_label">AI Error Fallback</small></label>
<select id="dle-sp-ai-error-fallback" class="text_pole">
<option value="keyword" data-i18n="dle_ai_fallback_keyword">Keyword matching</option>
<option value="constants_only" data-i18n="dle_ai_fallback_constants">Constants only</option>
<option value="bootstrap_only" data-i18n="dle_ai_fallback_bootstrap">Bootstrap entries only</option>
<option value="none" data-i18n="dle_ai_fallback_none">Nothing (skip injection)</option>
</select>
</div>
<div class="flex1" title="What to inject when AI search returns no results (AI decided nothing is relevant)." data-i18n="[title]dle_ai_empty_fallback_tooltip">
<label for="dle-sp-ai-empty-fallback"><small data-i18n="dle_ai_empty_fallback_label">AI Empty Result Fallback</small></label>
<select id="dle-sp-ai-empty-fallback" class="text_pole">
<option value="constants" data-i18n="dle_ai_fallback_constants">Constants only</option>
<option value="constants_bootstrap" data-i18n="dle_ai_fallback_constants_bootstrap">Constants + Bootstrap</option>
<option value="keyword" data-i18n="dle_ai_fallback_keyword">Keyword matching</option>
<option value="none" data-i18n="dle_ai_fallback_none">Nothing (skip injection)</option>
</select>
</div>
</div>
<!-- Toggle: Show Prompt & Context -->
<div class="dle-advanced-toggle" data-section="sp_ai_prompt" tabindex="0" role="button" aria-expanded="false">
<i class="fa-solid fa-chevron-right dle-advanced-icon" aria-hidden="true"></i> <span data-i18n="dle_settings_show_prompt_context_label">Show Prompt & Context</span>
</div>
<div class="dle-advanced-section" data-section="sp_ai_prompt" style="display: none;">
<div class="flex-container">
<div class="flex1" title="Number of recent chat messages sent to the AI for context when selecting entries. Default: 4." data-i18n="[title]dle_ai_scan_depth_tooltip">
<label for="dle-sp-ai-scan-depth"><small data-i18n="dle_ai_scan_depth_label">Messages Sent to AI</small></label>
<input id="dle-sp-ai-scan-depth" type="number" class="text_pole" min="1" max="100" />
</div>
<div class="flex1" title="Max characters for each entry's summary shown to the AI when deciding which entries to include. Default: 600." data-i18n="[title]dle_ai_summary_length_tooltip">
<label for="dle-sp-ai-summary-length"><small data-i18n="dle_ai_summary_length_label">Max Summary Length (chars)</small></label>
<input id="dle-sp-ai-summary-length" type="number" class="text_pole" min="100" max="1000" />
</div>
</div>
<div title="Override the default system prompt for AI entry selection." data-i18n="[title]dle_ai_system_prompt_tooltip">
<div class="flex-container" style="align-items: center; gap: 6px;">
<label for="dle-sp-ai-system-prompt"><small data-i18n="dle_ai_system_prompt_label">System Prompt Override (empty = default)</small></label>
<select class="dle-prompt-preset-select text_pole" data-tool="aiSearch" style="flex: 0 0 auto; width: auto; font-size: 0.85em;" title="Load a saved prompt preset" data-i18n="[title]dle_autosuggest_preset_tooltip"></select>
</div>
<textarea id="dle-sp-ai-system-prompt" class="text_pole textarea_compact" rows="3" placeholder="Leave empty for default prompt." data-prompt-tool="aiSearch" data-i18n="[placeholder]dle_ai_system_prompt_placeholder"></textarea>
</div>
<!-- v2.5: Claude prefix toggle only applied to Custom Proxy, hidden -->
<label class="checkbox_label" for="dle-sp-ai-claude-prefix" title="Adds a system identity prefix that improves Claude model performance when using the proxy connection. Proxy mode only." data-i18n="[title]dle_claude_prefix_tooltip" style="display: none;">
<input id="dle-sp-ai-claude-prefix" type="checkbox" class="checkbox">
<span data-i18n="dle_claude_prefix_label">Claude system prefix (proxy only)</span>
</label>
<label class="checkbox_label" for="dle-sp-ai-force-user-role" title="Merge system prompt into user message. Use this if your AI provider rejects the system role (e.g. some Z.AI GLM versions). Try setting Prompt Post-Processing to Semi/Strict first." data-i18n="[title]dle_force_user_role_tooltip">
<input id="dle-sp-ai-force-user-role" type="checkbox" class="checkbox">
<span data-i18n="dle_force_user_role_label">Force merge system prompt into user message</span>
</label>
<label class="checkbox_label" for="dle-sp-scribe-informed-retrieval" title="Feed the Session Scribe's latest summary into AI search context." data-i18n="[title]dle_scribe_informed_tooltip">
<input id="dle-sp-scribe-informed-retrieval" type="checkbox" class="checkbox">
<span data-i18n="dle_scribe_informed_label">Use Session Notes as AI Context</span>
</label>
<div title="Comma-separated list of custom field names (era, faction, mood, etc.) to send to the AI in each candidate's manifest line. Leave empty to include ALL custom fields with values. Populate to prune the manifest for token control." data-i18n="[title]dle_ai_manifest_fields_tooltip">
<label for="dle-sp-ai-manifest-fields"><small data-i18n="dle_ai_manifest_fields_label">Custom Fields in Manifest (empty = all)</small></label>
<input id="dle-sp-ai-manifest-fields" type="text" class="text_pole" placeholder="era, faction, mood" data-i18n="[placeholder]dle_ai_manifest_fields_placeholder">
</div>
<h5 class="dle-settings-subsection-label" style="margin-top: var(--dle-space-3);" data-i18n="dle_response_prefill_heading">Response Prefill</h5>
<span class="dle-text-xs dle-muted" data-i18n="dle_response_prefill_desc">Inject seed text as the last assistant message so the writing AI continues from it instead of starting with "Certainly, here's…".</span>
<div class="flex-container">
<div class="flex1" title="Mode: off (no injection), anthropic-only (only when underlying model is Claude — uses Anthropic's native prefill behavior), all-providers (every chat-completion source — some treat it as continuation, others may ignore)." data-i18n="[title]dle_response_prefill_mode_tooltip">
<label for="dle-sp-response-prefill-mode"><small data-i18n="dle_response_prefill_mode_label">Prefill Mode</small></label>
<select id="dle-sp-response-prefill-mode" class="text_pole">
<option value="off" data-i18n="dle_response_prefill_mode_off">Off</option>
<option value="anthropic-only" data-i18n="dle_response_prefill_mode_anthropic_only">Anthropic-only (Claude / OR-Claude)</option>
<option value="all-providers" data-i18n="dle_response_prefill_mode_all_providers">All providers</option>
</select>
</div>
</div>
<div title="Seed text injected as the assistant's response opener. Common uses: a story prefix, a forbidden-phrase blocker like 'Without preamble, here we go:', or roleplay continuation glue." data-i18n="[title]dle_response_prefill_seed_tooltip">
<label for="dle-sp-response-prefill-seed"><small data-i18n="dle_response_prefill_seed_label">Prefill Seed (empty = no injection)</small></label>
<textarea id="dle-sp-response-prefill-seed" class="text_pole textarea_compact" rows="2" placeholder="e.g. *continuing from where we left off*" data-i18n="[placeholder]dle_response_prefill_seed_placeholder"></textarea>
</div>
</div>
<!-- Toggle: Show Filtering -->
<div class="dle-advanced-toggle" data-section="sp_ai_filtering" tabindex="0" role="button" aria-expanded="false">
<i class="fa-solid fa-chevron-right dle-advanced-icon" aria-hidden="true"></i> <span data-i18n="dle_settings_show_filtering_label">Show Filtering</span>
</div>
<div class="dle-advanced-section" data-section="sp_ai_filtering" style="display: none;">
<div class="flex-container">
<div class="flex1" title="When enabled, large candidate sets (40+ keyword matches) are narrowed by category before AI selection. This uses an extra AI call. When disabled (default), all keyword-matched entries go directly to the AI for selection." data-i18n="[title]dle_hierarchical_prefilter_desc_tooltip">
<label class="checkbox_label" for="dle-sp-hierarchical-prefilter">
<input id="dle-sp-hierarchical-prefilter" type="checkbox" />
<small data-i18n="dle_hierarchical_prefilter_label">Category Pre-filter</small>
</label>
<span class="dle-text-xs dle-muted" data-i18n="dle_hierarchical_prefilter_desc">Narrow candidates by category before AI selection (extra AI call)</span>
</div>
</div>
<div class="flex-container" id="dle-sp-hierarchical-options">
<div class="flex1" title="Controls how aggressively categories are pruned for large vaults (40+ entries). Higher = more categories can be cut before AI selection. 0 = keep all categories." data-i18n="[title]dle_hierarchical_aggressiveness_tooltip">
<label for="dle-sp-hierarchical-aggressiveness"><small data-i18n="dle_hierarchical_aggressiveness_label">Category Filtering Strength</small></label>
<input id="dle-sp-hierarchical-aggressiveness" type="range" min="0" max="0.8" step="0.1" class="dle-w-full" />
<div class="flex-container" style="justify-content: space-between;">
<span class="dle-text-xs dle-muted" data-i18n="dle_hierarchical_conservative">Conservative (keep all)</span>
<span class="dle-text-xs dle-muted" id="dle-sp-hierarchical-value">0.8</span>
<span class="dle-text-xs dle-muted" data-i18n="dle_hierarchical_aggressive">Aggressive (trim 80%)</span>
</div>
</div>
</div>
<div class="flex-container">
<div class="flex1" title="Controls how entry descriptions are built for AI selection. Prefer Summary uses the summary field if it exists, otherwise truncates content. Summary Only skips entries without summaries. Content Only always truncates the full content." data-i18n="[title]dle_manifest_summary_mode_tooltip">
<label for="dle-sp-manifest-summary-mode"><small data-i18n="dle_manifest_summary_mode_label">AI Entry Description Mode</small></label>
<select id="dle-sp-manifest-summary-mode" class="text_pole">
<option value="prefer_summary" data-i18n="dle_manifest_summary_mode_prefer_summary">Prefer Summary (use summary, fall back to content)</option>
<option value="summary_only" data-i18n="dle_manifest_summary_mode_summary_only">Summary Only (skip entries without summaries)</option>
<option value="content_only" data-i18n="dle_manifest_summary_mode_content_only">Content Only (always truncate content)</option>
</select>
</div>
</div>
</div>
<!-- Toggle: Show AI Utilities -->
<div class="dle-advanced-toggle" data-section="sp_ai_search" tabindex="0" role="button" aria-expanded="false">
<i class="fa-solid fa-chevron-right dle-advanced-icon" aria-hidden="true"></i> <span data-i18n="dle_settings_show_ai_utilities_label">Show AI Utilities</span>
</div>
<div class="dle-advanced-section" data-section="sp_ai_search" style="display: none;">
<label class="dle-advanced-subheader"><small data-i18n="dle_ai_utilities_label">AI Utilities</small></label>
<div class="flex-container">
<div class="flex1" title="When running /dle-optimize-keys, use keyword-only analysis or two-stage (keyword + AI) analysis." data-i18n="[title]dle_optimize_keys_mode_tooltip">
<label for="dle-sp-optimize-keys-mode"><small data-i18n="dle_optimize_keys_mode_label">Optimize Keys Mode</small></label>
<select id="dle-sp-optimize-keys-mode" class="text_pole">
<option value="keyword" data-i18n="dle_search_mode_keywords">Keyword Only</option>
<option value="two-stage" data-i18n="dle_settings_optimize_keys_two_stage">Two-Stage (Keyword + AI)</option>
</select>
</div>
</div>
<div title="Custom prompt for keyword optimization. Leave empty for default." data-i18n="[title]dle_optimize_keys_prompt_tooltip">
<div class="flex-container" style="align-items: center; gap: 6px;">
<label for="dle-sp-optimize-keys-prompt"><small data-i18n="dle_optimize_keys_prompt_label">Optimize Keys Prompt (empty = default)</small></label>
<select class="dle-prompt-preset-select text_pole" data-tool="optimizeKeys" style="flex: 0 0 auto; width: auto; font-size: 0.85em;" title="Load a saved prompt preset" data-i18n="[title]dle_autosuggest_preset_tooltip"></select>
</div>
<textarea id="dle-sp-optimize-keys-prompt" class="text_pole textarea_compact" rows="3" placeholder="Leave empty for default." data-prompt-tool="optimizeKeys" data-i18n="[placeholder]dle_autosuggest_prompt_placeholder"></textarea>
</div>
</div>
</div>
</div><!-- /.dle-ai-content-wrap -->
</div>
<!-- ═══════════════════════════════════════════════════════════════════
TAB: Author Notebook (Assistants)
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-feat-author-notebook" data-settings-panel="author-notebook"
aria-labelledby="dle-sp-tab-author-notebook" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_feature_author_notebook_h4">Author Notebook</h3>
<p class="dle-panel-subtitle" data-i18n="dle_feature_author_notebook_desc">A per-chat scratchpad for notes, scene direction, or writing instructions.</p>
</div>
<div class="dle-settings-section">
<div class="flex-container flexFlowColumn">
<label class="checkbox_label" for="dle-sp-notebook-enabled" title="Include Author Notebook content in every message to the AI for this chat." data-i18n="[title]dle_notebook_enabled_tooltip">
<input id="dle-sp-notebook-enabled" type="checkbox" class="checkbox">
<span data-i18n="dle_notebook_enabled_label">Enable Author Notebook</span>
</label>
<div class="flex-container">
<div id="dle-sp-open-notebook" class="menu_button menu_button_icon" role="button" tabindex="0" title="Open the Author Notebook editor." data-i18n="[title]dle_open_notebook_tooltip">
<i class="fa-solid fa-book" aria-hidden="true"></i>
<span data-i18n="dle_open_notebook_button">Open Author Notebook</span>
</div>
</div>
<span class="dle-text-xs dle-muted" data-i18n-html="dle_settings_injection_pos_configured_note">Injection position: configured in the <a href="#" class="dle-goto-tab-link" data-goto-tab="injection">Injection tab</a>.</span>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════════
TAB: AI Notepad (Assistants)
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-feat-ai-notebook" data-settings-panel="ai-notebook"
aria-labelledby="dle-sp-tab-ai-notebook" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_feature_ai_notepad_h4">AI Notepad</h3>
<p class="dle-panel-subtitle" data-i18n="dle_feature_ai_notepad_desc">Automatically capture session notes from AI responses. Notes are stored per-chat and reinjected into future messages so the AI remembers what happened.</p>
</div>
<div class="dle-settings-section">
<div class="flex-container flexFlowColumn">
<label class="checkbox_label" for="dle-sp-ai-notepad-enabled" title="Enable AI Notepad — session notes are captured and reinjected into future messages." data-i18n="[title]dle_ai_notepad_enabled_tooltip">
<input id="dle-sp-ai-notepad-enabled" type="checkbox" class="checkbox">
<span data-i18n="dle_ai_notepad_enabled_label">Enable AI Notepad</span>
</label>
<div id="dle-sp-ai-notepad-mode-controls">
<label><small data-i18n="dle_ai_notepad_capture_mode_label_full">Capture Mode</small></label>
<div class="radio_group">
<label title="The writing AI appends notes in <dle-notes> tags. Free — no extra API calls. Requires a model that reliably follows formatting instructions." data-i18n="[title]dle_notepad_tag_mode_tooltip_full">
<input type="radio" name="dle-sp-ai-notepad-mode" value="tag" />
<span data-i18n="dle_notepad_tag_mode_label_full">Tag Mode</span>
</label>
<label title="After each AI response, a separate API call extracts noteworthy information. Works with any model. Uses your AI Search connection." data-i18n="[title]dle_notepad_extract_mode_tooltip_full">
<input type="radio" name="dle-sp-ai-notepad-mode" value="extract" />
<span data-i18n="dle_notepad_extract_mode_label_full">Extract Mode</span>
</label>
</div>
<div id="dle-sp-ai-notepad-mode-tag-desc" class="dle-text-xs dle-muted" style="margin-top: var(--dle-space-1);">
<i class="fa-solid fa-tag" aria-hidden="true"></i>
The writing AI includes <code><dle-notes></code> tags in its response. No extra API calls — notes are extracted from the response text. Best with flagship models (Claude Opus/Sonnet, GPT-4o). Smaller models may not follow the format.
</div>
<div id="dle-sp-ai-notepad-mode-extract-desc" class="dle-text-xs dle-muted" style="display: none; margin-top: var(--dle-space-1);">
<i class="fa-solid fa-bolt" aria-hidden="true"></i>
After each response, DLE sends the text to your <b>AI Search connection</b> to extract session notes. Works with any writing model — the extraction uses a separate, reliable call. Visible "Note to self:" prose is automatically stripped. Costs one extra API call per message.
</div>
</div>
<div class="flex-container">
<div id="dle-sp-open-ai-notepad" class="menu_button menu_button_icon" role="button" tabindex="0" title="View accumulated AI notes for this chat." data-i18n="[title]dle_open_ai_notepad_tooltip">
<i class="fa-solid fa-robot" aria-hidden="true"></i>
<span data-i18n="dle_open_ai_notepad_button_full">View AI Notepad</span>
</div>
</div>
<div class="flex-container">
<div class="flex1" title="Maximum number of note lines retained per chat. New notes bump the oldest non-pinned line when the cap is reached. 0 = no limit (the 64KB char backstop still applies)." data-i18n="[title]dle_ai_notepad_max_entries_tooltip_full">
<label for="dle-sp-ai-notepad-max-entries"><small data-i18n="dle_ai_notepad_max_entries_label_full">Max Entries (oldest notes drop first)</small></label>
<input id="dle-sp-ai-notepad-max-entries" type="number" class="text_pole" min="0" max="1000" placeholder="50" />
</div>
<div class="flex1" title="How similar two notes must be for the 'Deduplicate' button to treat them as the same (higher = stricter). Lower values catch more near-duplicates but may merge distinct notes. Default: 0.85." data-i18n="[title]dle_ai_notepad_fuzzy_threshold_tooltip_full">
<label for="dle-sp-ai-notepad-fuzzy-threshold"><small data-i18n="dle_ai_notepad_fuzzy_threshold_label_full">Fuzzy Dedup Threshold</small></label>
<input id="dle-sp-ai-notepad-fuzzy-threshold" type="number" class="text_pole" min="0.1" max="1" step="0.05" placeholder="0.85" />
</div>
</div>
<span class="dle-text-xs dle-muted" data-i18n-html="dle_settings_injection_pos_configured_note">Injection position: configured in the <a href="#" class="dle-goto-tab-link" data-goto-tab="injection">Injection tab</a>.</span>
<div id="dle-sp-ai-notepad-tag-options">
<label for="dle-sp-ai-notepad-prompt"><small data-i18n="dle_ai_notepad_custom_tag_label_full">Custom Tag Instruction (leave empty for default)</small></label>
<textarea id="dle-sp-ai-notepad-prompt" class="text_pole" rows="3" placeholder="Leave empty for default. Instructs the AI to append <dle-notes> after its response."></textarea>
</div>
<div id="dle-sp-ai-notepad-extract-options" style="display: none;">
<span class="dle-text-xs dle-muted" data-i18n-html="dle_settings_connection_settings_note">Connection settings: <a href="#" class="dle-goto-ai-connections">AI Connections</a> under Setup.</span>
<label for="dle-sp-ai-notepad-extract-prompt"><small data-i18n="dle_ai_notepad_custom_extract_label_full">Custom Extraction Prompt (leave empty for default)</small></label>
<textarea id="dle-sp-ai-notepad-extract-prompt" class="text_pole" rows="3" placeholder="Leave empty for default. The extraction model receives the AI response and returns bullet-point notes." data-i18n="[placeholder]dle_ai_notepad_custom_extract_placeholder_full"></textarea>
</div>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════════
TAB: Session Scribe (Assistants)
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-feat-session-scribe" data-settings-panel="session-scribe"
aria-labelledby="dle-sp-tab-session-scribe" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_feature_session_scribe_h4">Session Scribe</h3>
<p class="dle-panel-subtitle" data-i18n="dle_feature_session_scribe_desc">Automatically summarize the roleplay session and write notes to your Obsidian vault.</p>
</div>
<div class="dle-settings-section">
<label class="checkbox_label" for="dle-sp-scribe-enabled" title="Generate session summaries using your chosen AI connection." data-i18n="[title]dle_scribe_enabled_tooltip">
<input id="dle-sp-scribe-enabled" type="checkbox" class="checkbox">
<span data-i18n="dle_scribe_enabled_label">Enable Session Scribe</span>
</label>
<div class="flex-container flexFlowColumn" id="dle-sp-scribe-controls">
<div class="flex-container">
<div class="flex1" title="Write a session note every N AI messages. Default: 5." data-i18n="[title]dle_scribe_interval_tooltip">
<label for="dle-sp-scribe-interval"><small data-i18n="dle_scribe_interval_label">Auto-scribe Every N Messages</small></label>
<input id="dle-sp-scribe-interval" type="number" class="text_pole" min="1" max="50" />
</div>
<div class="flex1" title="Folder in your Obsidian vault where session notes are saved." data-i18n="[title]dle_scribe_folder_tooltip">
<label for="dle-sp-scribe-folder"><small data-i18n="dle_scribe_folder_label">Session Folder</small></label>
<input id="dle-sp-scribe-folder" type="text" class="text_pole" placeholder="Sessions" data-i18n="[placeholder]dle_scribe_folder_placeholder">
</div>
</div>
<div class="flex-container">
<div class="flex1" title="Which vault to write Scribe session notes to. Defaults to the primary (first enabled) vault." data-i18n="[title]dle_scribe_write_vault_tooltip">
<label for="dle-sp-scribe-write-vault"><small data-i18n="dle_autosuggest_write_vault_label">Write to Vault</small></label>
<select id="dle-sp-scribe-write-vault" class="text_pole"></select>
</div>
</div>
<span class="dle-text-xs dle-muted" data-i18n-html="dle_settings_connection_settings_note">Connection settings: <a href="#" class="dle-goto-ai-connections">AI Connections</a> under Setup.</span>
<div class="flex-container">
<div class="flex1" title="Messages to include as context. Default: 20." data-i18n="[title]dle_scribe_scan_depth_tooltip">
<label for="dle-sp-scribe-scan-depth"><small data-i18n="dle_scribe_scan_depth_label">Messages to Include</small></label>
<input id="dle-sp-scribe-scan-depth" type="number" class="text_pole" min="5" max="100" />
</div>
</div>
<div title="Custom prompt for session summaries." data-i18n="[title]dle_scribe_prompt_tooltip">
<div class="flex-container" style="align-items: center; gap: 6px;">
<label for="dle-sp-scribe-prompt"><small data-i18n="dle_scribe_prompt_label">Custom Summary Prompt (empty = default)</small></label>
<select class="dle-prompt-preset-select text_pole" data-tool="scribe" style="flex: 0 0 auto; width: auto; font-size: 0.85em;" title="Load a saved prompt preset" data-i18n="[title]dle_autosuggest_preset_tooltip"></select>
</div>
<textarea id="dle-sp-scribe-prompt" class="text_pole textarea_compact" rows="3" placeholder="Leave empty for default." data-prompt-tool="scribe" data-i18n="[placeholder]dle_autosuggest_prompt_placeholder"></textarea>
</div>
</div>
</div>
</div>
<!-- ═══════════════════════════════════════════════════════════════════
TAB: Auto Lorebook (Assistants)
═══════════════════════════════════════════════════════════════════ -->
<div class="dle-settings-panel" id="dle-sp-feat-auto-lorebook" data-settings-panel="auto-lorebook"
aria-labelledby="dle-sp-tab-auto-lorebook" hidden>
<div class="dle-panel-header">
<h3 class="dle-panel-title" data-i18n="dle_feature_auto_lorebook_h4">Auto Lorebook</h3>
<p class="dle-panel-subtitle" data-i18n="dle_feature_auto_lorebook_p">AI analyzes chat for entities not in the lorebook and suggests new entries.</p>
</div>
<div class="dle-settings-section">
<label class="checkbox_label" for="dle-sp-autosuggest-enabled" title="Suggestions appear in a popup for review before being written to Obsidian." data-i18n="[title]dle_autosuggest_enabled_tooltip">
<input id="dle-sp-autosuggest-enabled" type="checkbox" class="checkbox">
<span data-i18n="dle_autosuggest_enabled_label">Enable Auto Lorebook</span>
</label>
<div class="flex-container flexFlowColumn" id="dle-sp-autosuggest-controls">
<div class="flex-container">
<div class="flex1" title="Trigger auto-suggest every N AI messages. Default: 10." data-i18n="[title]dle_autosuggest_interval_tooltip">
<label for="dle-sp-autosuggest-interval"><small data-i18n="dle_autosuggest_interval_label">Interval (messages)</small></label>
<input id="dle-sp-autosuggest-interval" type="number" class="text_pole" min="3" max="50" />
</div>
<div class="flex1" title="Obsidian folder where new entries are saved." data-i18n="[title]dle_autosuggest_folder_tooltip">
<label for="dle-sp-autosuggest-folder"><small data-i18n="dle_autosuggest_folder_label">Target Folder</small></label>
<input id="dle-sp-autosuggest-folder" type="text" class="text_pole" placeholder="Lorebook" data-i18n="[placeholder]dle_autosuggest_folder_placeholder">
</div>
</div>
<div class="flex-container">
<div class="flex1" title="Which vault Auto Lorebook writes new entries to. Defaults to the primary vault." data-i18n="[title]dle_autosuggest_write_vault_tooltip">
<label for="dle-sp-autosuggest-write-vault"><small data-i18n="dle_autosuggest_write_vault_label">Write to Vault</small></label>
<select id="dle-sp-autosuggest-write-vault" class="text_pole"></select>
</div>
</div>
<label class="checkbox_label" for="dle-sp-autosuggest-skip-review" title="Write entries directly to Obsidian without showing review popup." data-i18n="[title]dle_autosuggest_skip_review_tooltip">
<input id="dle-sp-autosuggest-skip-review" type="checkbox" class="checkbox">