@character-foundry/character-foundry 0.1.9-dev.1765913722 → 0.1.9-dev.1765933047
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-framework.cjs +1 -1
- package/dist/app-framework.cjs.map +1 -1
- package/dist/app-framework.js +1 -1
- package/dist/app-framework.js.map +1 -1
- package/dist/charx.cjs +27 -22
- package/dist/charx.cjs.map +1 -1
- package/dist/charx.d.cts +368 -207
- package/dist/charx.d.ts +368 -207
- package/dist/charx.js +27 -22
- package/dist/charx.js.map +1 -1
- package/dist/exporter.cjs +27 -22
- package/dist/exporter.cjs.map +1 -1
- package/dist/exporter.d.cts +368 -207
- package/dist/exporter.d.ts +368 -207
- package/dist/exporter.js +27 -22
- package/dist/exporter.js.map +1 -1
- package/dist/federation.d.cts +368 -207
- package/dist/federation.d.ts +368 -207
- package/dist/index.cjs +33 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +708 -423
- package/dist/index.d.ts +708 -423
- package/dist/index.js +33 -23
- package/dist/index.js.map +1 -1
- package/dist/loader.cjs +33 -23
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.cts +564 -318
- package/dist/loader.d.ts +564 -318
- package/dist/loader.js +33 -23
- package/dist/loader.js.map +1 -1
- package/dist/lorebook.cjs +5 -5
- package/dist/lorebook.cjs.map +1 -1
- package/dist/lorebook.d.cts +674 -381
- package/dist/lorebook.d.ts +674 -381
- package/dist/lorebook.js +5 -5
- package/dist/lorebook.js.map +1 -1
- package/dist/normalizer.cjs +33 -23
- package/dist/normalizer.cjs.map +1 -1
- package/dist/normalizer.d.cts +896 -560
- package/dist/normalizer.d.ts +896 -560
- package/dist/normalizer.js +33 -23
- package/dist/normalizer.js.map +1 -1
- package/dist/png.cjs +27 -22
- package/dist/png.cjs.map +1 -1
- package/dist/png.d.cts +512 -312
- package/dist/png.d.ts +512 -312
- package/dist/png.js +27 -22
- package/dist/png.js.map +1 -1
- package/dist/schemas.cjs +27 -22
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +1444 -896
- package/dist/schemas.d.ts +1444 -896
- package/dist/schemas.js +27 -22
- package/dist/schemas.js.map +1 -1
- package/dist/voxta.cjs +27 -22
- package/dist/voxta.cjs.map +1 -1
- package/dist/voxta.d.cts +564 -318
- package/dist/voxta.d.ts +564 -318
- package/dist/voxta.js +27 -22
- package/dist/voxta.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -580,22 +580,24 @@ var ExtractedAssetSchema = z.object({
|
|
|
580
580
|
mimeType: z.string()
|
|
581
581
|
});
|
|
582
582
|
var CCv2LorebookEntrySchema = z2.object({
|
|
583
|
-
keys: z2.array(z2.string()),
|
|
583
|
+
keys: z2.array(z2.string()).optional(),
|
|
584
|
+
// Some tools use 'key' instead
|
|
584
585
|
content: z2.string(),
|
|
585
|
-
enabled: z2.boolean(),
|
|
586
|
-
|
|
587
|
-
|
|
586
|
+
enabled: z2.boolean().default(true),
|
|
587
|
+
// Default to enabled if missing
|
|
588
|
+
insertion_order: z2.number().int().default(0),
|
|
589
|
+
// Optional fields - be lenient with nulls since wild data has them
|
|
588
590
|
extensions: z2.record(z2.unknown()).optional(),
|
|
589
|
-
case_sensitive: z2.boolean().optional(),
|
|
591
|
+
case_sensitive: z2.boolean().nullable().optional(),
|
|
590
592
|
name: z2.string().optional(),
|
|
591
593
|
priority: z2.number().int().optional(),
|
|
592
594
|
id: z2.number().int().optional(),
|
|
593
595
|
comment: z2.string().optional(),
|
|
594
|
-
selective: z2.boolean().optional(),
|
|
596
|
+
selective: z2.boolean().nullable().optional(),
|
|
595
597
|
secondary_keys: z2.array(z2.string()).optional(),
|
|
596
|
-
constant: z2.boolean().optional(),
|
|
597
|
-
position: z2.enum(["before_char", "after_char"]).optional()
|
|
598
|
-
});
|
|
598
|
+
constant: z2.boolean().nullable().optional(),
|
|
599
|
+
position: z2.union([z2.enum(["before_char", "after_char"]), z2.number().int()]).nullable().optional()
|
|
600
|
+
}).passthrough();
|
|
599
601
|
var CCv2CharacterBookSchema = z2.object({
|
|
600
602
|
name: z2.string().optional(),
|
|
601
603
|
description: z2.string().optional(),
|
|
@@ -643,31 +645,34 @@ function getV2Data(card) {
|
|
|
643
645
|
return card;
|
|
644
646
|
}
|
|
645
647
|
var CCv3LorebookEntrySchema = z3.object({
|
|
646
|
-
keys: z3.array(z3.string()),
|
|
648
|
+
keys: z3.array(z3.string()).optional(),
|
|
649
|
+
// Some tools use 'key' instead
|
|
647
650
|
content: z3.string(),
|
|
648
|
-
enabled: z3.boolean(),
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
651
|
+
enabled: z3.boolean().default(true),
|
|
652
|
+
// Default to enabled if missing
|
|
653
|
+
insertion_order: z3.number().int().default(0),
|
|
654
|
+
// Optional fields - be lenient with nulls since wild data has them
|
|
655
|
+
case_sensitive: z3.boolean().nullable().optional(),
|
|
652
656
|
name: z3.string().optional(),
|
|
653
657
|
priority: z3.number().int().optional(),
|
|
654
658
|
id: z3.number().int().optional(),
|
|
655
659
|
comment: z3.string().optional(),
|
|
656
|
-
selective: z3.boolean().optional(),
|
|
660
|
+
selective: z3.boolean().nullable().optional(),
|
|
657
661
|
secondary_keys: z3.array(z3.string()).optional(),
|
|
658
|
-
constant: z3.boolean().optional(),
|
|
659
|
-
position: z3.enum(["before_char", "after_char"]).optional(),
|
|
662
|
+
constant: z3.boolean().nullable().optional(),
|
|
663
|
+
position: z3.union([z3.enum(["before_char", "after_char"]), z3.number().int()]).nullable().optional(),
|
|
660
664
|
extensions: z3.record(z3.unknown()).optional(),
|
|
661
|
-
// v3 specific
|
|
665
|
+
// v3 specific - also lenient with types since SillyTavern uses numbers for enums
|
|
662
666
|
automation_id: z3.string().optional(),
|
|
663
|
-
role: z3.enum(["system", "user", "assistant"]).optional(),
|
|
667
|
+
role: z3.union([z3.enum(["system", "user", "assistant"]), z3.number().int()]).nullable().optional(),
|
|
664
668
|
group: z3.string().optional(),
|
|
665
669
|
scan_frequency: z3.number().int().nonnegative().optional(),
|
|
666
|
-
probability: z3.number().min(0).max(
|
|
670
|
+
probability: z3.number().min(0).max(100).optional(),
|
|
671
|
+
// Some tools use 0-100 instead of 0-1
|
|
667
672
|
use_regex: z3.boolean().optional(),
|
|
668
673
|
depth: z3.number().int().nonnegative().optional(),
|
|
669
|
-
selective_logic: z3.enum(["AND", "NOT"]).optional()
|
|
670
|
-
});
|
|
674
|
+
selective_logic: z3.union([z3.enum(["AND", "NOT"]), z3.number().int()]).optional()
|
|
675
|
+
}).passthrough();
|
|
671
676
|
var CCv3CharacterBookSchema = z3.object({
|
|
672
677
|
name: z3.string().optional(),
|
|
673
678
|
description: z3.string().optional(),
|
|
@@ -8345,6 +8350,11 @@ var DELTA_MAX_TOTAL_SIZE = 500 * 1024 * 1024;
|
|
|
8345
8350
|
var DELTA_MAX_FILE_SIZE = 50 * 1024 * 1024;
|
|
8346
8351
|
|
|
8347
8352
|
// ../normalizer/dist/index.js
|
|
8353
|
+
function normalizePosition(position) {
|
|
8354
|
+
if (position === void 0 || position === null) return "before_char";
|
|
8355
|
+
if (typeof position === "string") return position;
|
|
8356
|
+
return position;
|
|
8357
|
+
}
|
|
8348
8358
|
function convertLorebookEntry(entry, index) {
|
|
8349
8359
|
return {
|
|
8350
8360
|
keys: entry.keys || [],
|
|
@@ -8360,7 +8370,7 @@ function convertLorebookEntry(entry, index) {
|
|
|
8360
8370
|
selective: entry.selective ?? false,
|
|
8361
8371
|
secondary_keys: entry.secondary_keys || [],
|
|
8362
8372
|
constant: entry.constant ?? false,
|
|
8363
|
-
position: entry.position
|
|
8373
|
+
position: normalizePosition(entry.position)
|
|
8364
8374
|
};
|
|
8365
8375
|
}
|
|
8366
8376
|
function convertCharacterBook(book) {
|