@character-foundry/character-foundry 0.4.3-dev.1766019473 → 0.4.3-dev.1766103111
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/charx.cjs +72 -18
- package/dist/charx.cjs.map +1 -1
- package/dist/charx.d.cts +22 -22
- package/dist/charx.d.ts +22 -22
- package/dist/charx.js +72 -18
- package/dist/charx.js.map +1 -1
- package/dist/exporter.cjs +72 -18
- package/dist/exporter.cjs.map +1 -1
- package/dist/exporter.d.cts +19 -19
- package/dist/exporter.d.ts +19 -19
- package/dist/exporter.js +72 -18
- package/dist/exporter.js.map +1 -1
- package/dist/federation.d.cts +19 -19
- package/dist/federation.d.ts +19 -19
- package/dist/index.cjs +72 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -29
- package/dist/index.d.ts +29 -29
- package/dist/index.js +72 -18
- package/dist/index.js.map +1 -1
- package/dist/loader.cjs +72 -18
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.cts +23 -23
- package/dist/loader.d.ts +23 -23
- package/dist/loader.js +72 -18
- package/dist/loader.js.map +1 -1
- package/dist/lorebook.d.cts +23 -23
- package/dist/lorebook.d.ts +23 -23
- package/dist/normalizer.cjs +72 -18
- package/dist/normalizer.cjs.map +1 -1
- package/dist/normalizer.d.cts +37 -37
- package/dist/normalizer.d.ts +37 -37
- package/dist/normalizer.js +72 -18
- package/dist/normalizer.js.map +1 -1
- package/dist/png.cjs +72 -18
- package/dist/png.cjs.map +1 -1
- package/dist/png.d.cts +25 -25
- package/dist/png.d.ts +25 -25
- package/dist/png.js +72 -18
- package/dist/png.js.map +1 -1
- package/dist/schemas.cjs +75 -18
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +85 -67
- package/dist/schemas.d.ts +85 -67
- package/dist/schemas.js +75 -18
- package/dist/schemas.js.map +1 -1
- package/dist/voxta.cjs +72 -18
- package/dist/voxta.cjs.map +1 -1
- package/dist/voxta.d.cts +23 -23
- package/dist/voxta.d.ts +23 -23
- package/dist/voxta.js +72 -18
- package/dist/voxta.js.map +1 -1
- package/package.json +5 -5
package/dist/lorebook.d.cts
CHANGED
|
@@ -136,8 +136,8 @@ declare const CCv3LorebookEntrySchema: z.ZodObject<{
|
|
|
136
136
|
declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
137
137
|
name: z.ZodOptional<z.ZodString>;
|
|
138
138
|
description: z.ZodOptional<z.ZodString>;
|
|
139
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
140
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
140
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
141
141
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
142
142
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
143
143
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -373,8 +373,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
373
373
|
}, z.ZodTypeAny, "passthrough">[];
|
|
374
374
|
name?: string | undefined;
|
|
375
375
|
description?: string | undefined;
|
|
376
|
-
scan_depth?:
|
|
377
|
-
token_budget?:
|
|
376
|
+
scan_depth?: unknown;
|
|
377
|
+
token_budget?: unknown;
|
|
378
378
|
recursive_scanning?: boolean | undefined;
|
|
379
379
|
extensions?: Record<string, unknown> | undefined;
|
|
380
380
|
}>;
|
|
@@ -399,8 +399,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
399
399
|
character_book: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
400
400
|
name: z.ZodOptional<z.ZodString>;
|
|
401
401
|
description: z.ZodOptional<z.ZodString>;
|
|
402
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
403
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
402
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
403
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
404
404
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
405
405
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
406
406
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -636,14 +636,14 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
636
636
|
}, z.ZodTypeAny, "passthrough">[];
|
|
637
637
|
name?: string | undefined;
|
|
638
638
|
description?: string | undefined;
|
|
639
|
-
scan_depth?:
|
|
640
|
-
token_budget?:
|
|
639
|
+
scan_depth?: unknown;
|
|
640
|
+
token_budget?: unknown;
|
|
641
641
|
recursive_scanning?: boolean | undefined;
|
|
642
642
|
extensions?: Record<string, unknown> | undefined;
|
|
643
643
|
}>>>;
|
|
644
644
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
645
645
|
assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
646
|
-
type: z.ZodEnum<[
|
|
646
|
+
type: z.ZodEffects<z.ZodEnum<[
|
|
647
647
|
"icon",
|
|
648
648
|
"background",
|
|
649
649
|
"emotion",
|
|
@@ -652,7 +652,7 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
652
652
|
"video",
|
|
653
653
|
"custom",
|
|
654
654
|
"x-risu-asset"
|
|
655
|
-
]>;
|
|
655
|
+
]>, "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset", unknown>;
|
|
656
656
|
uri: z.ZodString;
|
|
657
657
|
name: z.ZodString;
|
|
658
658
|
ext: z.ZodString;
|
|
@@ -663,15 +663,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
663
663
|
ext: string;
|
|
664
664
|
}, {
|
|
665
665
|
name: string;
|
|
666
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
667
666
|
uri: string;
|
|
668
667
|
ext: string;
|
|
668
|
+
type?: unknown;
|
|
669
669
|
}>, "many">>;
|
|
670
670
|
nickname: z.ZodOptional<z.ZodString>;
|
|
671
671
|
creator_notes_multilingual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
672
672
|
source: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
673
|
-
creation_date: z.ZodOptional<z.ZodNumber>;
|
|
674
|
-
modification_date: z.ZodOptional<z.ZodNumber>;
|
|
673
|
+
creation_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
674
|
+
modification_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
675
675
|
}, "strip", z.ZodTypeAny, {
|
|
676
676
|
name: string;
|
|
677
677
|
description: string;
|
|
@@ -812,8 +812,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
812
812
|
}, z.ZodTypeAny, "passthrough">[];
|
|
813
813
|
name?: string | undefined;
|
|
814
814
|
description?: string | undefined;
|
|
815
|
-
scan_depth?:
|
|
816
|
-
token_budget?:
|
|
815
|
+
scan_depth?: unknown;
|
|
816
|
+
token_budget?: unknown;
|
|
817
817
|
recursive_scanning?: boolean | undefined;
|
|
818
818
|
extensions?: Record<string, unknown> | undefined;
|
|
819
819
|
} | null | undefined;
|
|
@@ -823,15 +823,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
823
823
|
group_only_greetings?: string[] | undefined;
|
|
824
824
|
assets?: {
|
|
825
825
|
name: string;
|
|
826
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
827
826
|
uri: string;
|
|
828
827
|
ext: string;
|
|
828
|
+
type?: unknown;
|
|
829
829
|
}[] | undefined;
|
|
830
830
|
nickname?: string | undefined;
|
|
831
831
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
832
832
|
source?: string[] | undefined;
|
|
833
|
-
creation_date?:
|
|
834
|
-
modification_date?:
|
|
833
|
+
creation_date?: unknown;
|
|
834
|
+
modification_date?: unknown;
|
|
835
835
|
}>;
|
|
836
836
|
}, "strip", z.ZodTypeAny, {
|
|
837
837
|
data: {
|
|
@@ -978,8 +978,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
978
978
|
}, z.ZodTypeAny, "passthrough">[];
|
|
979
979
|
name?: string | undefined;
|
|
980
980
|
description?: string | undefined;
|
|
981
|
-
scan_depth?:
|
|
982
|
-
token_budget?:
|
|
981
|
+
scan_depth?: unknown;
|
|
982
|
+
token_budget?: unknown;
|
|
983
983
|
recursive_scanning?: boolean | undefined;
|
|
984
984
|
extensions?: Record<string, unknown> | undefined;
|
|
985
985
|
} | null | undefined;
|
|
@@ -989,15 +989,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
989
989
|
group_only_greetings?: string[] | undefined;
|
|
990
990
|
assets?: {
|
|
991
991
|
name: string;
|
|
992
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
993
992
|
uri: string;
|
|
994
993
|
ext: string;
|
|
994
|
+
type?: unknown;
|
|
995
995
|
}[] | undefined;
|
|
996
996
|
nickname?: string | undefined;
|
|
997
997
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
998
998
|
source?: string[] | undefined;
|
|
999
|
-
creation_date?:
|
|
1000
|
-
modification_date?:
|
|
999
|
+
creation_date?: unknown;
|
|
1000
|
+
modification_date?: unknown;
|
|
1001
1001
|
};
|
|
1002
1002
|
spec: "chara_card_v3";
|
|
1003
1003
|
spec_version: "3.0";
|
package/dist/lorebook.d.ts
CHANGED
|
@@ -136,8 +136,8 @@ declare const CCv3LorebookEntrySchema: z.ZodObject<{
|
|
|
136
136
|
declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
137
137
|
name: z.ZodOptional<z.ZodString>;
|
|
138
138
|
description: z.ZodOptional<z.ZodString>;
|
|
139
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
140
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
140
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
141
141
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
142
142
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
143
143
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -373,8 +373,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
373
373
|
}, z.ZodTypeAny, "passthrough">[];
|
|
374
374
|
name?: string | undefined;
|
|
375
375
|
description?: string | undefined;
|
|
376
|
-
scan_depth?:
|
|
377
|
-
token_budget?:
|
|
376
|
+
scan_depth?: unknown;
|
|
377
|
+
token_budget?: unknown;
|
|
378
378
|
recursive_scanning?: boolean | undefined;
|
|
379
379
|
extensions?: Record<string, unknown> | undefined;
|
|
380
380
|
}>;
|
|
@@ -399,8 +399,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
399
399
|
character_book: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
400
400
|
name: z.ZodOptional<z.ZodString>;
|
|
401
401
|
description: z.ZodOptional<z.ZodString>;
|
|
402
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
403
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
402
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
403
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
404
404
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
405
405
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
406
406
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -636,14 +636,14 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
636
636
|
}, z.ZodTypeAny, "passthrough">[];
|
|
637
637
|
name?: string | undefined;
|
|
638
638
|
description?: string | undefined;
|
|
639
|
-
scan_depth?:
|
|
640
|
-
token_budget?:
|
|
639
|
+
scan_depth?: unknown;
|
|
640
|
+
token_budget?: unknown;
|
|
641
641
|
recursive_scanning?: boolean | undefined;
|
|
642
642
|
extensions?: Record<string, unknown> | undefined;
|
|
643
643
|
}>>>;
|
|
644
644
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
645
645
|
assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
646
|
-
type: z.ZodEnum<[
|
|
646
|
+
type: z.ZodEffects<z.ZodEnum<[
|
|
647
647
|
"icon",
|
|
648
648
|
"background",
|
|
649
649
|
"emotion",
|
|
@@ -652,7 +652,7 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
652
652
|
"video",
|
|
653
653
|
"custom",
|
|
654
654
|
"x-risu-asset"
|
|
655
|
-
]>;
|
|
655
|
+
]>, "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset", unknown>;
|
|
656
656
|
uri: z.ZodString;
|
|
657
657
|
name: z.ZodString;
|
|
658
658
|
ext: z.ZodString;
|
|
@@ -663,15 +663,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
663
663
|
ext: string;
|
|
664
664
|
}, {
|
|
665
665
|
name: string;
|
|
666
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
667
666
|
uri: string;
|
|
668
667
|
ext: string;
|
|
668
|
+
type?: unknown;
|
|
669
669
|
}>, "many">>;
|
|
670
670
|
nickname: z.ZodOptional<z.ZodString>;
|
|
671
671
|
creator_notes_multilingual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
672
672
|
source: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
673
|
-
creation_date: z.ZodOptional<z.ZodNumber>;
|
|
674
|
-
modification_date: z.ZodOptional<z.ZodNumber>;
|
|
673
|
+
creation_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
674
|
+
modification_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
675
675
|
}, "strip", z.ZodTypeAny, {
|
|
676
676
|
name: string;
|
|
677
677
|
description: string;
|
|
@@ -812,8 +812,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
812
812
|
}, z.ZodTypeAny, "passthrough">[];
|
|
813
813
|
name?: string | undefined;
|
|
814
814
|
description?: string | undefined;
|
|
815
|
-
scan_depth?:
|
|
816
|
-
token_budget?:
|
|
815
|
+
scan_depth?: unknown;
|
|
816
|
+
token_budget?: unknown;
|
|
817
817
|
recursive_scanning?: boolean | undefined;
|
|
818
818
|
extensions?: Record<string, unknown> | undefined;
|
|
819
819
|
} | null | undefined;
|
|
@@ -823,15 +823,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
823
823
|
group_only_greetings?: string[] | undefined;
|
|
824
824
|
assets?: {
|
|
825
825
|
name: string;
|
|
826
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
827
826
|
uri: string;
|
|
828
827
|
ext: string;
|
|
828
|
+
type?: unknown;
|
|
829
829
|
}[] | undefined;
|
|
830
830
|
nickname?: string | undefined;
|
|
831
831
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
832
832
|
source?: string[] | undefined;
|
|
833
|
-
creation_date?:
|
|
834
|
-
modification_date?:
|
|
833
|
+
creation_date?: unknown;
|
|
834
|
+
modification_date?: unknown;
|
|
835
835
|
}>;
|
|
836
836
|
}, "strip", z.ZodTypeAny, {
|
|
837
837
|
data: {
|
|
@@ -978,8 +978,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
978
978
|
}, z.ZodTypeAny, "passthrough">[];
|
|
979
979
|
name?: string | undefined;
|
|
980
980
|
description?: string | undefined;
|
|
981
|
-
scan_depth?:
|
|
982
|
-
token_budget?:
|
|
981
|
+
scan_depth?: unknown;
|
|
982
|
+
token_budget?: unknown;
|
|
983
983
|
recursive_scanning?: boolean | undefined;
|
|
984
984
|
extensions?: Record<string, unknown> | undefined;
|
|
985
985
|
} | null | undefined;
|
|
@@ -989,15 +989,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
989
989
|
group_only_greetings?: string[] | undefined;
|
|
990
990
|
assets?: {
|
|
991
991
|
name: string;
|
|
992
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
993
992
|
uri: string;
|
|
994
993
|
ext: string;
|
|
994
|
+
type?: unknown;
|
|
995
995
|
}[] | undefined;
|
|
996
996
|
nickname?: string | undefined;
|
|
997
997
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
998
998
|
source?: string[] | undefined;
|
|
999
|
-
creation_date?:
|
|
1000
|
-
modification_date?:
|
|
999
|
+
creation_date?: unknown;
|
|
1000
|
+
modification_date?: unknown;
|
|
1001
1001
|
};
|
|
1002
1002
|
spec: "chara_card_v3";
|
|
1003
1003
|
spec_version: "3.0";
|
package/dist/normalizer.cjs
CHANGED
|
@@ -40,6 +40,58 @@ var import_zod = require("zod");
|
|
|
40
40
|
var import_zod2 = require("zod");
|
|
41
41
|
var import_zod3 = require("zod");
|
|
42
42
|
var import_zod4 = require("zod");
|
|
43
|
+
function preprocessTimestamp(val) {
|
|
44
|
+
if (val === null || val === void 0) return void 0;
|
|
45
|
+
let num;
|
|
46
|
+
if (typeof val === "number") {
|
|
47
|
+
num = val;
|
|
48
|
+
} else if (typeof val === "string") {
|
|
49
|
+
const trimmed = val.trim();
|
|
50
|
+
if (!trimmed) return void 0;
|
|
51
|
+
const parsed = Number(trimmed);
|
|
52
|
+
if (!isNaN(parsed)) {
|
|
53
|
+
num = parsed;
|
|
54
|
+
} else {
|
|
55
|
+
const date = new Date(trimmed);
|
|
56
|
+
if (isNaN(date.getTime())) return void 0;
|
|
57
|
+
num = Math.floor(date.getTime() / 1e3);
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
if (num > 1e10) {
|
|
63
|
+
num = Math.floor(num / 1e3);
|
|
64
|
+
}
|
|
65
|
+
if (num < 0) return void 0;
|
|
66
|
+
return num;
|
|
67
|
+
}
|
|
68
|
+
function preprocessNumeric(val) {
|
|
69
|
+
if (val === null || val === void 0) return void 0;
|
|
70
|
+
if (typeof val === "number") {
|
|
71
|
+
return isNaN(val) ? void 0 : val;
|
|
72
|
+
}
|
|
73
|
+
if (typeof val === "string") {
|
|
74
|
+
const trimmed = val.trim();
|
|
75
|
+
if (!trimmed) return void 0;
|
|
76
|
+
const parsed = Number(trimmed);
|
|
77
|
+
return isNaN(parsed) ? void 0 : parsed;
|
|
78
|
+
}
|
|
79
|
+
return void 0;
|
|
80
|
+
}
|
|
81
|
+
var KNOWN_ASSET_TYPES = /* @__PURE__ */ new Set([
|
|
82
|
+
"icon",
|
|
83
|
+
"background",
|
|
84
|
+
"emotion",
|
|
85
|
+
"user_icon",
|
|
86
|
+
"sound",
|
|
87
|
+
"video",
|
|
88
|
+
"custom",
|
|
89
|
+
"x-risu-asset"
|
|
90
|
+
]);
|
|
91
|
+
function preprocessAssetType(val) {
|
|
92
|
+
if (typeof val !== "string") return "custom";
|
|
93
|
+
return KNOWN_ASSET_TYPES.has(val) ? val : "custom";
|
|
94
|
+
}
|
|
43
95
|
var ISO8601Schema = import_zod.z.string().datetime();
|
|
44
96
|
var UUIDSchema = import_zod.z.string().uuid();
|
|
45
97
|
var SpecSchema = import_zod.z.enum(["v2", "v3"]);
|
|
@@ -62,16 +114,19 @@ var SourceFormatSchema = import_zod.z.enum([
|
|
|
62
114
|
// VoxPkg format
|
|
63
115
|
]);
|
|
64
116
|
var OriginalShapeSchema = import_zod.z.enum(["wrapped", "unwrapped", "legacy"]);
|
|
65
|
-
var AssetTypeSchema = import_zod.z.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
117
|
+
var AssetTypeSchema = import_zod.z.preprocess(
|
|
118
|
+
preprocessAssetType,
|
|
119
|
+
import_zod.z.enum([
|
|
120
|
+
"icon",
|
|
121
|
+
"background",
|
|
122
|
+
"emotion",
|
|
123
|
+
"user_icon",
|
|
124
|
+
"sound",
|
|
125
|
+
"video",
|
|
126
|
+
"custom",
|
|
127
|
+
"x-risu-asset"
|
|
128
|
+
])
|
|
129
|
+
);
|
|
75
130
|
var AssetDescriptorSchema = import_zod.z.object({
|
|
76
131
|
type: AssetTypeSchema,
|
|
77
132
|
uri: import_zod.z.string(),
|
|
@@ -105,8 +160,8 @@ var CCv2LorebookEntrySchema = import_zod2.z.object({
|
|
|
105
160
|
var CCv2CharacterBookSchema = import_zod2.z.object({
|
|
106
161
|
name: import_zod2.z.string().optional(),
|
|
107
162
|
description: import_zod2.z.string().optional(),
|
|
108
|
-
scan_depth: import_zod2.z.number().int().nonnegative().optional(),
|
|
109
|
-
token_budget: import_zod2.z.number().int().nonnegative().optional(),
|
|
163
|
+
scan_depth: import_zod2.z.preprocess(preprocessNumeric, import_zod2.z.number().int().nonnegative().optional()),
|
|
164
|
+
token_budget: import_zod2.z.preprocess(preprocessNumeric, import_zod2.z.number().int().nonnegative().optional()),
|
|
110
165
|
recursive_scanning: import_zod2.z.boolean().optional(),
|
|
111
166
|
extensions: import_zod2.z.record(import_zod2.z.unknown()).optional(),
|
|
112
167
|
entries: import_zod2.z.array(CCv2LorebookEntrySchema)
|
|
@@ -183,8 +238,8 @@ var CCv3LorebookEntrySchema = import_zod3.z.object({
|
|
|
183
238
|
var CCv3CharacterBookSchema = import_zod3.z.object({
|
|
184
239
|
name: import_zod3.z.string().optional(),
|
|
185
240
|
description: import_zod3.z.string().optional(),
|
|
186
|
-
scan_depth: import_zod3.z.number().int().nonnegative().optional(),
|
|
187
|
-
token_budget: import_zod3.z.number().int().nonnegative().optional(),
|
|
241
|
+
scan_depth: import_zod3.z.preprocess(preprocessNumeric, import_zod3.z.number().int().nonnegative().optional()),
|
|
242
|
+
token_budget: import_zod3.z.preprocess(preprocessNumeric, import_zod3.z.number().int().nonnegative().optional()),
|
|
188
243
|
recursive_scanning: import_zod3.z.boolean().optional(),
|
|
189
244
|
extensions: import_zod3.z.record(import_zod3.z.unknown()).optional(),
|
|
190
245
|
entries: import_zod3.z.array(CCv3LorebookEntrySchema)
|
|
@@ -216,10 +271,9 @@ var CCv3DataInnerSchema = import_zod3.z.object({
|
|
|
216
271
|
nickname: import_zod3.z.string().optional(),
|
|
217
272
|
creator_notes_multilingual: import_zod3.z.record(import_zod3.z.string()).optional(),
|
|
218
273
|
source: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
modification_date: import_zod3.z.number().int().nonnegative().optional()
|
|
222
|
-
// Unix timestamp in seconds
|
|
274
|
+
// Unix timestamps - preprocess to handle ISO strings, numeric strings, milliseconds
|
|
275
|
+
creation_date: import_zod3.z.preprocess(preprocessTimestamp, import_zod3.z.number().int().nonnegative().optional()),
|
|
276
|
+
modification_date: import_zod3.z.preprocess(preprocessTimestamp, import_zod3.z.number().int().nonnegative().optional())
|
|
223
277
|
});
|
|
224
278
|
var CCv3DataSchema = import_zod3.z.object({
|
|
225
279
|
spec: import_zod3.z.literal("chara_card_v3"),
|