@character-foundry/character-foundry 0.1.9 → 0.4.0-dev.1765938243
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 +291 -95
- package/dist/app-framework.cjs.map +1 -1
- package/dist/app-framework.d.cts +1 -1
- package/dist/app-framework.d.ts +1 -1
- package/dist/app-framework.js +292 -96
- package/dist/app-framework.js.map +1 -1
- package/dist/charx.cjs +44 -23
- package/dist/charx.cjs.map +1 -1
- package/dist/charx.d.cts +377 -207
- package/dist/charx.d.ts +377 -207
- package/dist/charx.js +44 -23
- 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 +377 -207
- package/dist/exporter.d.ts +377 -207
- package/dist/exporter.js +27 -22
- package/dist/exporter.js.map +1 -1
- package/dist/federation.cjs +16 -4
- package/dist/federation.cjs.map +1 -1
- package/dist/federation.d.cts +377 -207
- package/dist/federation.d.ts +377 -207
- package/dist/federation.js +16 -4
- package/dist/federation.js.map +1 -1
- package/dist/image-utils.cjs.map +1 -1
- package/dist/image-utils.d.cts +12 -0
- package/dist/image-utils.d.ts +12 -0
- package/dist/image-utils.js.map +1 -1
- package/dist/index.cjs +106 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +729 -423
- package/dist/index.d.ts +729 -423
- package/dist/index.js +106 -56
- package/dist/index.js.map +1 -1
- package/dist/loader.cjs +106 -56
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.cts +578 -318
- package/dist/loader.d.ts +578 -318
- package/dist/loader.js +106 -56
- 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 +691 -381
- package/dist/lorebook.d.ts +691 -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 +926 -560
- package/dist/normalizer.d.ts +926 -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 +528 -312
- package/dist/png.d.ts +528 -312
- package/dist/png.js +27 -22
- package/dist/png.js.map +1 -1
- package/dist/schemas.cjs +41 -26
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +1492 -896
- package/dist/schemas.d.ts +1492 -896
- package/dist/schemas.js +41 -26
- package/dist/schemas.js.map +1 -1
- package/dist/voxta.cjs +48 -25
- package/dist/voxta.cjs.map +1 -1
- package/dist/voxta.d.cts +578 -318
- package/dist/voxta.d.ts +578 -318
- package/dist/voxta.js +48 -25
- package/dist/voxta.js.map +1 -1
- package/package.json +6 -6
package/dist/charx.cjs
CHANGED
|
@@ -356,7 +356,23 @@ function streamingUnzipSync(data, limits = DEFAULT_ZIP_LIMITS) {
|
|
|
356
356
|
if (unsafePathHandling === "warn" && limits.onUnsafePath) {
|
|
357
357
|
limits.onUnsafePath(file.name, reason);
|
|
358
358
|
}
|
|
359
|
-
file.ondata = () => {
|
|
359
|
+
file.ondata = (err, chunk, _final) => {
|
|
360
|
+
if (error) return;
|
|
361
|
+
if (err) {
|
|
362
|
+
error = err;
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (chunk && chunk.length > 0) {
|
|
366
|
+
totalBytes += chunk.length;
|
|
367
|
+
if (totalBytes > limits.maxTotalSize) {
|
|
368
|
+
error = new ZipPreflightError(
|
|
369
|
+
`Total actual size ${totalBytes} exceeds limit ${limits.maxTotalSize}`,
|
|
370
|
+
totalBytes,
|
|
371
|
+
limits.maxTotalSize
|
|
372
|
+
);
|
|
373
|
+
file.terminate();
|
|
374
|
+
}
|
|
375
|
+
}
|
|
360
376
|
};
|
|
361
377
|
file.start();
|
|
362
378
|
return;
|
|
@@ -468,22 +484,24 @@ var ExtractedAssetSchema = import_zod.z.object({
|
|
|
468
484
|
mimeType: import_zod.z.string()
|
|
469
485
|
});
|
|
470
486
|
var CCv2LorebookEntrySchema = import_zod2.z.object({
|
|
471
|
-
keys: import_zod2.z.array(import_zod2.z.string()),
|
|
487
|
+
keys: import_zod2.z.array(import_zod2.z.string()).optional(),
|
|
488
|
+
// Some tools use 'key' instead
|
|
472
489
|
content: import_zod2.z.string(),
|
|
473
|
-
enabled: import_zod2.z.boolean(),
|
|
474
|
-
|
|
475
|
-
|
|
490
|
+
enabled: import_zod2.z.boolean().default(true),
|
|
491
|
+
// Default to enabled if missing
|
|
492
|
+
insertion_order: import_zod2.z.number().int().default(0),
|
|
493
|
+
// Optional fields - be lenient with nulls since wild data has them
|
|
476
494
|
extensions: import_zod2.z.record(import_zod2.z.unknown()).optional(),
|
|
477
|
-
case_sensitive: import_zod2.z.boolean().optional(),
|
|
495
|
+
case_sensitive: import_zod2.z.boolean().nullable().optional(),
|
|
478
496
|
name: import_zod2.z.string().optional(),
|
|
479
497
|
priority: import_zod2.z.number().int().optional(),
|
|
480
498
|
id: import_zod2.z.number().int().optional(),
|
|
481
499
|
comment: import_zod2.z.string().optional(),
|
|
482
|
-
selective: import_zod2.z.boolean().optional(),
|
|
500
|
+
selective: import_zod2.z.boolean().nullable().optional(),
|
|
483
501
|
secondary_keys: import_zod2.z.array(import_zod2.z.string()).optional(),
|
|
484
|
-
constant: import_zod2.z.boolean().optional(),
|
|
485
|
-
position: import_zod2.z.enum(["before_char", "after_char"]).optional()
|
|
486
|
-
});
|
|
502
|
+
constant: import_zod2.z.boolean().nullable().optional(),
|
|
503
|
+
position: import_zod2.z.union([import_zod2.z.enum(["before_char", "after_char"]), import_zod2.z.number().int(), import_zod2.z.literal("")]).nullable().optional()
|
|
504
|
+
}).passthrough();
|
|
487
505
|
var CCv2CharacterBookSchema = import_zod2.z.object({
|
|
488
506
|
name: import_zod2.z.string().optional(),
|
|
489
507
|
description: import_zod2.z.string().optional(),
|
|
@@ -520,31 +538,34 @@ var CCv2WrappedSchema = import_zod2.z.object({
|
|
|
520
538
|
data: CCv2DataSchema
|
|
521
539
|
});
|
|
522
540
|
var CCv3LorebookEntrySchema = import_zod3.z.object({
|
|
523
|
-
keys: import_zod3.z.array(import_zod3.z.string()),
|
|
541
|
+
keys: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
542
|
+
// Some tools use 'key' instead
|
|
524
543
|
content: import_zod3.z.string(),
|
|
525
|
-
enabled: import_zod3.z.boolean(),
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
544
|
+
enabled: import_zod3.z.boolean().default(true),
|
|
545
|
+
// Default to enabled if missing
|
|
546
|
+
insertion_order: import_zod3.z.number().int().default(0),
|
|
547
|
+
// Optional fields - be lenient with nulls since wild data has them
|
|
548
|
+
case_sensitive: import_zod3.z.boolean().nullable().optional(),
|
|
529
549
|
name: import_zod3.z.string().optional(),
|
|
530
550
|
priority: import_zod3.z.number().int().optional(),
|
|
531
551
|
id: import_zod3.z.number().int().optional(),
|
|
532
552
|
comment: import_zod3.z.string().optional(),
|
|
533
|
-
selective: import_zod3.z.boolean().optional(),
|
|
553
|
+
selective: import_zod3.z.boolean().nullable().optional(),
|
|
534
554
|
secondary_keys: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
535
|
-
constant: import_zod3.z.boolean().optional(),
|
|
536
|
-
position: import_zod3.z.enum(["before_char", "after_char"]).optional(),
|
|
555
|
+
constant: import_zod3.z.boolean().nullable().optional(),
|
|
556
|
+
position: import_zod3.z.union([import_zod3.z.enum(["before_char", "after_char"]), import_zod3.z.number().int(), import_zod3.z.literal("")]).nullable().optional(),
|
|
537
557
|
extensions: import_zod3.z.record(import_zod3.z.unknown()).optional(),
|
|
538
|
-
// v3 specific
|
|
558
|
+
// v3 specific - also lenient with types since SillyTavern uses numbers for enums
|
|
539
559
|
automation_id: import_zod3.z.string().optional(),
|
|
540
|
-
role: import_zod3.z.enum(["system", "user", "assistant"]).optional(),
|
|
560
|
+
role: import_zod3.z.union([import_zod3.z.enum(["system", "user", "assistant"]), import_zod3.z.number().int()]).nullable().optional(),
|
|
541
561
|
group: import_zod3.z.string().optional(),
|
|
542
562
|
scan_frequency: import_zod3.z.number().int().nonnegative().optional(),
|
|
543
|
-
probability: import_zod3.z.number().min(0).max(
|
|
563
|
+
probability: import_zod3.z.number().min(0).max(100).optional(),
|
|
564
|
+
// Some tools use 0-100 instead of 0-1
|
|
544
565
|
use_regex: import_zod3.z.boolean().optional(),
|
|
545
566
|
depth: import_zod3.z.number().int().nonnegative().optional(),
|
|
546
|
-
selective_logic: import_zod3.z.enum(["AND", "NOT"]).optional()
|
|
547
|
-
});
|
|
567
|
+
selective_logic: import_zod3.z.union([import_zod3.z.enum(["AND", "NOT"]), import_zod3.z.number().int()]).optional()
|
|
568
|
+
}).passthrough();
|
|
548
569
|
var CCv3CharacterBookSchema = import_zod3.z.object({
|
|
549
570
|
name: import_zod3.z.string().optional(),
|
|
550
571
|
description: import_zod3.z.string().optional(),
|