@character-foundry/character-foundry 0.4.2 → 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 +87 -54
- package/dist/charx.cjs.map +1 -1
- package/dist/charx.d.cts +40 -31
- package/dist/charx.d.ts +40 -31
- package/dist/charx.js +87 -54
- package/dist/charx.js.map +1 -1
- package/dist/exporter.cjs +106 -56
- package/dist/exporter.cjs.map +1 -1
- package/dist/exporter.d.cts +37 -28
- package/dist/exporter.d.ts +37 -28
- package/dist/exporter.js +106 -56
- package/dist/exporter.js.map +1 -1
- package/dist/federation.cjs +104 -36
- package/dist/federation.cjs.map +1 -1
- package/dist/federation.d.cts +72 -28
- package/dist/federation.d.ts +72 -28
- package/dist/federation.js +104 -36
- package/dist/federation.js.map +1 -1
- package/dist/index.cjs +106 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +71 -50
- package/dist/index.d.ts +71 -50
- package/dist/index.js +106 -56
- package/dist/index.js.map +1 -1
- package/dist/loader.cjs +173 -33
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.cts +65 -37
- package/dist/loader.d.ts +65 -37
- package/dist/loader.js +173 -33
- package/dist/loader.js.map +1 -1
- package/dist/lorebook.d.cts +57 -40
- package/dist/lorebook.d.ts +57 -40
- package/dist/normalizer.cjs +74 -20
- package/dist/normalizer.cjs.map +1 -1
- package/dist/normalizer.d.cts +97 -67
- package/dist/normalizer.d.ts +97 -67
- package/dist/normalizer.js +74 -20
- package/dist/normalizer.js.map +1 -1
- package/dist/png.cjs +74 -20
- package/dist/png.cjs.map +1 -1
- package/dist/png.d.cts +57 -41
- package/dist/png.d.ts +57 -41
- package/dist/png.js +74 -20
- package/dist/png.js.map +1 -1
- package/dist/schemas.cjs +82 -25
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +181 -115
- package/dist/schemas.d.ts +181 -115
- package/dist/schemas.js +82 -25
- package/dist/schemas.js.map +1 -1
- package/dist/voxta.cjs +93 -22
- package/dist/voxta.cjs.map +1 -1
- package/dist/voxta.d.cts +51 -37
- package/dist/voxta.d.ts +51 -37
- package/dist/voxta.js +93 -22
- package/dist/voxta.js.map +1 -1
- package/package.json +5 -5
package/dist/loader.d.cts
CHANGED
|
@@ -13,8 +13,8 @@ export type BinaryData = Uint8Array;
|
|
|
13
13
|
declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
14
14
|
name: z.ZodOptional<z.ZodString>;
|
|
15
15
|
description: z.ZodOptional<z.ZodString>;
|
|
16
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
17
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
17
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
18
18
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
19
19
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
20
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -33,7 +33,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
33
33
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
34
34
|
z.ZodEnum<[
|
|
35
35
|
"before_char",
|
|
36
|
-
"after_char"
|
|
36
|
+
"after_char",
|
|
37
|
+
"in_chat"
|
|
37
38
|
]>,
|
|
38
39
|
z.ZodNumber,
|
|
39
40
|
z.ZodLiteral<"">
|
|
@@ -76,7 +77,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
76
77
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
77
78
|
z.ZodEnum<[
|
|
78
79
|
"before_char",
|
|
79
|
-
"after_char"
|
|
80
|
+
"after_char",
|
|
81
|
+
"in_chat"
|
|
80
82
|
]>,
|
|
81
83
|
z.ZodNumber,
|
|
82
84
|
z.ZodLiteral<"">
|
|
@@ -119,7 +121,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
119
121
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
120
122
|
z.ZodEnum<[
|
|
121
123
|
"before_char",
|
|
122
|
-
"after_char"
|
|
124
|
+
"after_char",
|
|
125
|
+
"in_chat"
|
|
123
126
|
]>,
|
|
124
127
|
z.ZodNumber,
|
|
125
128
|
z.ZodLiteral<"">
|
|
@@ -164,7 +167,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
164
167
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
165
168
|
z.ZodEnum<[
|
|
166
169
|
"before_char",
|
|
167
|
-
"after_char"
|
|
170
|
+
"after_char",
|
|
171
|
+
"in_chat"
|
|
168
172
|
]>,
|
|
169
173
|
z.ZodNumber,
|
|
170
174
|
z.ZodLiteral<"">
|
|
@@ -215,7 +219,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
215
219
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
216
220
|
z.ZodEnum<[
|
|
217
221
|
"before_char",
|
|
218
|
-
"after_char"
|
|
222
|
+
"after_char",
|
|
223
|
+
"in_chat"
|
|
219
224
|
]>,
|
|
220
225
|
z.ZodNumber,
|
|
221
226
|
z.ZodLiteral<"">
|
|
@@ -245,8 +250,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
245
250
|
}, z.ZodTypeAny, "passthrough">[];
|
|
246
251
|
name?: string | undefined;
|
|
247
252
|
description?: string | undefined;
|
|
248
|
-
scan_depth?:
|
|
249
|
-
token_budget?:
|
|
253
|
+
scan_depth?: unknown;
|
|
254
|
+
token_budget?: unknown;
|
|
250
255
|
recursive_scanning?: boolean | undefined;
|
|
251
256
|
extensions?: Record<string, unknown> | undefined;
|
|
252
257
|
}>;
|
|
@@ -271,8 +276,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
271
276
|
character_book: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
272
277
|
name: z.ZodOptional<z.ZodString>;
|
|
273
278
|
description: z.ZodOptional<z.ZodString>;
|
|
274
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
275
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
280
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
276
281
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
277
282
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
278
283
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -291,7 +296,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
291
296
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
292
297
|
z.ZodEnum<[
|
|
293
298
|
"before_char",
|
|
294
|
-
"after_char"
|
|
299
|
+
"after_char",
|
|
300
|
+
"in_chat"
|
|
295
301
|
]>,
|
|
296
302
|
z.ZodNumber,
|
|
297
303
|
z.ZodLiteral<"">
|
|
@@ -334,7 +340,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
334
340
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
335
341
|
z.ZodEnum<[
|
|
336
342
|
"before_char",
|
|
337
|
-
"after_char"
|
|
343
|
+
"after_char",
|
|
344
|
+
"in_chat"
|
|
338
345
|
]>,
|
|
339
346
|
z.ZodNumber,
|
|
340
347
|
z.ZodLiteral<"">
|
|
@@ -377,7 +384,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
377
384
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
378
385
|
z.ZodEnum<[
|
|
379
386
|
"before_char",
|
|
380
|
-
"after_char"
|
|
387
|
+
"after_char",
|
|
388
|
+
"in_chat"
|
|
381
389
|
]>,
|
|
382
390
|
z.ZodNumber,
|
|
383
391
|
z.ZodLiteral<"">
|
|
@@ -422,7 +430,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
422
430
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
423
431
|
z.ZodEnum<[
|
|
424
432
|
"before_char",
|
|
425
|
-
"after_char"
|
|
433
|
+
"after_char",
|
|
434
|
+
"in_chat"
|
|
426
435
|
]>,
|
|
427
436
|
z.ZodNumber,
|
|
428
437
|
z.ZodLiteral<"">
|
|
@@ -473,7 +482,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
473
482
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
474
483
|
z.ZodEnum<[
|
|
475
484
|
"before_char",
|
|
476
|
-
"after_char"
|
|
485
|
+
"after_char",
|
|
486
|
+
"in_chat"
|
|
477
487
|
]>,
|
|
478
488
|
z.ZodNumber,
|
|
479
489
|
z.ZodLiteral<"">
|
|
@@ -503,14 +513,14 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
503
513
|
}, z.ZodTypeAny, "passthrough">[];
|
|
504
514
|
name?: string | undefined;
|
|
505
515
|
description?: string | undefined;
|
|
506
|
-
scan_depth?:
|
|
507
|
-
token_budget?:
|
|
516
|
+
scan_depth?: unknown;
|
|
517
|
+
token_budget?: unknown;
|
|
508
518
|
recursive_scanning?: boolean | undefined;
|
|
509
519
|
extensions?: Record<string, unknown> | undefined;
|
|
510
520
|
}>>>;
|
|
511
521
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
512
522
|
assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
513
|
-
type: z.ZodEnum<[
|
|
523
|
+
type: z.ZodEffects<z.ZodEnum<[
|
|
514
524
|
"icon",
|
|
515
525
|
"background",
|
|
516
526
|
"emotion",
|
|
@@ -519,7 +529,7 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
519
529
|
"video",
|
|
520
530
|
"custom",
|
|
521
531
|
"x-risu-asset"
|
|
522
|
-
]>;
|
|
532
|
+
]>, "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset", unknown>;
|
|
523
533
|
uri: z.ZodString;
|
|
524
534
|
name: z.ZodString;
|
|
525
535
|
ext: z.ZodString;
|
|
@@ -530,15 +540,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
530
540
|
ext: string;
|
|
531
541
|
}, {
|
|
532
542
|
name: string;
|
|
533
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
534
543
|
uri: string;
|
|
535
544
|
ext: string;
|
|
545
|
+
type?: unknown;
|
|
536
546
|
}>, "many">>;
|
|
537
547
|
nickname: z.ZodOptional<z.ZodString>;
|
|
538
548
|
creator_notes_multilingual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
539
549
|
source: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
540
|
-
creation_date: z.ZodOptional<z.ZodNumber>;
|
|
541
|
-
modification_date: z.ZodOptional<z.ZodNumber>;
|
|
550
|
+
creation_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
551
|
+
modification_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
542
552
|
}, "strip", z.ZodTypeAny, {
|
|
543
553
|
name: string;
|
|
544
554
|
description: string;
|
|
@@ -572,7 +582,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
572
582
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
573
583
|
z.ZodEnum<[
|
|
574
584
|
"before_char",
|
|
575
|
-
"after_char"
|
|
585
|
+
"after_char",
|
|
586
|
+
"in_chat"
|
|
576
587
|
]>,
|
|
577
588
|
z.ZodNumber,
|
|
578
589
|
z.ZodLiteral<"">
|
|
@@ -647,7 +658,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
647
658
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
648
659
|
z.ZodEnum<[
|
|
649
660
|
"before_char",
|
|
650
|
-
"after_char"
|
|
661
|
+
"after_char",
|
|
662
|
+
"in_chat"
|
|
651
663
|
]>,
|
|
652
664
|
z.ZodNumber,
|
|
653
665
|
z.ZodLiteral<"">
|
|
@@ -677,8 +689,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
677
689
|
}, z.ZodTypeAny, "passthrough">[];
|
|
678
690
|
name?: string | undefined;
|
|
679
691
|
description?: string | undefined;
|
|
680
|
-
scan_depth?:
|
|
681
|
-
token_budget?:
|
|
692
|
+
scan_depth?: unknown;
|
|
693
|
+
token_budget?: unknown;
|
|
682
694
|
recursive_scanning?: boolean | undefined;
|
|
683
695
|
extensions?: Record<string, unknown> | undefined;
|
|
684
696
|
} | null | undefined;
|
|
@@ -688,15 +700,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
688
700
|
group_only_greetings?: string[] | undefined;
|
|
689
701
|
assets?: {
|
|
690
702
|
name: string;
|
|
691
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
692
703
|
uri: string;
|
|
693
704
|
ext: string;
|
|
705
|
+
type?: unknown;
|
|
694
706
|
}[] | undefined;
|
|
695
707
|
nickname?: string | undefined;
|
|
696
708
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
697
709
|
source?: string[] | undefined;
|
|
698
|
-
creation_date?:
|
|
699
|
-
modification_date?:
|
|
710
|
+
creation_date?: unknown;
|
|
711
|
+
modification_date?: unknown;
|
|
700
712
|
}>;
|
|
701
713
|
}, "strip", z.ZodTypeAny, {
|
|
702
714
|
data: {
|
|
@@ -732,7 +744,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
732
744
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
733
745
|
z.ZodEnum<[
|
|
734
746
|
"before_char",
|
|
735
|
-
"after_char"
|
|
747
|
+
"after_char",
|
|
748
|
+
"in_chat"
|
|
736
749
|
]>,
|
|
737
750
|
z.ZodNumber,
|
|
738
751
|
z.ZodLiteral<"">
|
|
@@ -811,7 +824,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
811
824
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
812
825
|
z.ZodEnum<[
|
|
813
826
|
"before_char",
|
|
814
|
-
"after_char"
|
|
827
|
+
"after_char",
|
|
828
|
+
"in_chat"
|
|
815
829
|
]>,
|
|
816
830
|
z.ZodNumber,
|
|
817
831
|
z.ZodLiteral<"">
|
|
@@ -841,8 +855,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
841
855
|
}, z.ZodTypeAny, "passthrough">[];
|
|
842
856
|
name?: string | undefined;
|
|
843
857
|
description?: string | undefined;
|
|
844
|
-
scan_depth?:
|
|
845
|
-
token_budget?:
|
|
858
|
+
scan_depth?: unknown;
|
|
859
|
+
token_budget?: unknown;
|
|
846
860
|
recursive_scanning?: boolean | undefined;
|
|
847
861
|
extensions?: Record<string, unknown> | undefined;
|
|
848
862
|
} | null | undefined;
|
|
@@ -852,15 +866,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
852
866
|
group_only_greetings?: string[] | undefined;
|
|
853
867
|
assets?: {
|
|
854
868
|
name: string;
|
|
855
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
856
869
|
uri: string;
|
|
857
870
|
ext: string;
|
|
871
|
+
type?: unknown;
|
|
858
872
|
}[] | undefined;
|
|
859
873
|
nickname?: string | undefined;
|
|
860
874
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
861
875
|
source?: string[] | undefined;
|
|
862
|
-
creation_date?:
|
|
863
|
-
modification_date?:
|
|
876
|
+
creation_date?: unknown;
|
|
877
|
+
modification_date?: unknown;
|
|
864
878
|
};
|
|
865
879
|
spec: "chara_card_v3";
|
|
866
880
|
spec_version: "3.0";
|
|
@@ -1180,6 +1194,13 @@ export interface AuthoritativeMetadata {
|
|
|
1180
1194
|
tokens: TokenCounts;
|
|
1181
1195
|
/** Content hash computed server-side */
|
|
1182
1196
|
contentHash: string;
|
|
1197
|
+
/**
|
|
1198
|
+
* Content hash v2 computed server-side.
|
|
1199
|
+
*
|
|
1200
|
+
* @remarks
|
|
1201
|
+
* v1 is preserved for backwards compatibility. Prefer v2 for new storage/deduplication.
|
|
1202
|
+
*/
|
|
1203
|
+
contentHashV2?: string;
|
|
1183
1204
|
/** Whether the card has a lorebook */
|
|
1184
1205
|
hasLorebook: boolean;
|
|
1185
1206
|
/** Number of lorebook entries */
|
|
@@ -1279,6 +1300,13 @@ export declare function validateClientMetadata(clientMetadata: ClientMetadata, p
|
|
|
1279
1300
|
* @returns SHA-256 hash of canonical content
|
|
1280
1301
|
*/
|
|
1281
1302
|
export declare function computeContentHash(card: CCv3Data): Promise<string>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Compute content hash v2 for a card (standalone utility)
|
|
1305
|
+
*
|
|
1306
|
+
* @param card - CCv3 card data
|
|
1307
|
+
* @returns SHA-256 hash of canonical content v2
|
|
1308
|
+
*/
|
|
1309
|
+
export declare function computeContentHashV2(card: CCv3Data): Promise<string>;
|
|
1282
1310
|
/**
|
|
1283
1311
|
* Options for synchronous metadata validation
|
|
1284
1312
|
*/
|
package/dist/loader.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export type BinaryData = Uint8Array;
|
|
|
13
13
|
declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
14
14
|
name: z.ZodOptional<z.ZodString>;
|
|
15
15
|
description: z.ZodOptional<z.ZodString>;
|
|
16
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
17
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
17
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
18
18
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
19
19
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
20
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -33,7 +33,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
33
33
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
34
34
|
z.ZodEnum<[
|
|
35
35
|
"before_char",
|
|
36
|
-
"after_char"
|
|
36
|
+
"after_char",
|
|
37
|
+
"in_chat"
|
|
37
38
|
]>,
|
|
38
39
|
z.ZodNumber,
|
|
39
40
|
z.ZodLiteral<"">
|
|
@@ -76,7 +77,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
76
77
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
77
78
|
z.ZodEnum<[
|
|
78
79
|
"before_char",
|
|
79
|
-
"after_char"
|
|
80
|
+
"after_char",
|
|
81
|
+
"in_chat"
|
|
80
82
|
]>,
|
|
81
83
|
z.ZodNumber,
|
|
82
84
|
z.ZodLiteral<"">
|
|
@@ -119,7 +121,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
119
121
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
120
122
|
z.ZodEnum<[
|
|
121
123
|
"before_char",
|
|
122
|
-
"after_char"
|
|
124
|
+
"after_char",
|
|
125
|
+
"in_chat"
|
|
123
126
|
]>,
|
|
124
127
|
z.ZodNumber,
|
|
125
128
|
z.ZodLiteral<"">
|
|
@@ -164,7 +167,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
164
167
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
165
168
|
z.ZodEnum<[
|
|
166
169
|
"before_char",
|
|
167
|
-
"after_char"
|
|
170
|
+
"after_char",
|
|
171
|
+
"in_chat"
|
|
168
172
|
]>,
|
|
169
173
|
z.ZodNumber,
|
|
170
174
|
z.ZodLiteral<"">
|
|
@@ -215,7 +219,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
215
219
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
216
220
|
z.ZodEnum<[
|
|
217
221
|
"before_char",
|
|
218
|
-
"after_char"
|
|
222
|
+
"after_char",
|
|
223
|
+
"in_chat"
|
|
219
224
|
]>,
|
|
220
225
|
z.ZodNumber,
|
|
221
226
|
z.ZodLiteral<"">
|
|
@@ -245,8 +250,8 @@ declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
|
245
250
|
}, z.ZodTypeAny, "passthrough">[];
|
|
246
251
|
name?: string | undefined;
|
|
247
252
|
description?: string | undefined;
|
|
248
|
-
scan_depth?:
|
|
249
|
-
token_budget?:
|
|
253
|
+
scan_depth?: unknown;
|
|
254
|
+
token_budget?: unknown;
|
|
250
255
|
recursive_scanning?: boolean | undefined;
|
|
251
256
|
extensions?: Record<string, unknown> | undefined;
|
|
252
257
|
}>;
|
|
@@ -271,8 +276,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
271
276
|
character_book: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
272
277
|
name: z.ZodOptional<z.ZodString>;
|
|
273
278
|
description: z.ZodOptional<z.ZodString>;
|
|
274
|
-
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
275
|
-
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
scan_depth: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
280
|
+
token_budget: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
276
281
|
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
277
282
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
278
283
|
entries: z.ZodArray<z.ZodObject<{
|
|
@@ -291,7 +296,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
291
296
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
292
297
|
z.ZodEnum<[
|
|
293
298
|
"before_char",
|
|
294
|
-
"after_char"
|
|
299
|
+
"after_char",
|
|
300
|
+
"in_chat"
|
|
295
301
|
]>,
|
|
296
302
|
z.ZodNumber,
|
|
297
303
|
z.ZodLiteral<"">
|
|
@@ -334,7 +340,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
334
340
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
335
341
|
z.ZodEnum<[
|
|
336
342
|
"before_char",
|
|
337
|
-
"after_char"
|
|
343
|
+
"after_char",
|
|
344
|
+
"in_chat"
|
|
338
345
|
]>,
|
|
339
346
|
z.ZodNumber,
|
|
340
347
|
z.ZodLiteral<"">
|
|
@@ -377,7 +384,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
377
384
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
378
385
|
z.ZodEnum<[
|
|
379
386
|
"before_char",
|
|
380
|
-
"after_char"
|
|
387
|
+
"after_char",
|
|
388
|
+
"in_chat"
|
|
381
389
|
]>,
|
|
382
390
|
z.ZodNumber,
|
|
383
391
|
z.ZodLiteral<"">
|
|
@@ -422,7 +430,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
422
430
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
423
431
|
z.ZodEnum<[
|
|
424
432
|
"before_char",
|
|
425
|
-
"after_char"
|
|
433
|
+
"after_char",
|
|
434
|
+
"in_chat"
|
|
426
435
|
]>,
|
|
427
436
|
z.ZodNumber,
|
|
428
437
|
z.ZodLiteral<"">
|
|
@@ -473,7 +482,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
473
482
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
474
483
|
z.ZodEnum<[
|
|
475
484
|
"before_char",
|
|
476
|
-
"after_char"
|
|
485
|
+
"after_char",
|
|
486
|
+
"in_chat"
|
|
477
487
|
]>,
|
|
478
488
|
z.ZodNumber,
|
|
479
489
|
z.ZodLiteral<"">
|
|
@@ -503,14 +513,14 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
503
513
|
}, z.ZodTypeAny, "passthrough">[];
|
|
504
514
|
name?: string | undefined;
|
|
505
515
|
description?: string | undefined;
|
|
506
|
-
scan_depth?:
|
|
507
|
-
token_budget?:
|
|
516
|
+
scan_depth?: unknown;
|
|
517
|
+
token_budget?: unknown;
|
|
508
518
|
recursive_scanning?: boolean | undefined;
|
|
509
519
|
extensions?: Record<string, unknown> | undefined;
|
|
510
520
|
}>>>;
|
|
511
521
|
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
512
522
|
assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
513
|
-
type: z.ZodEnum<[
|
|
523
|
+
type: z.ZodEffects<z.ZodEnum<[
|
|
514
524
|
"icon",
|
|
515
525
|
"background",
|
|
516
526
|
"emotion",
|
|
@@ -519,7 +529,7 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
519
529
|
"video",
|
|
520
530
|
"custom",
|
|
521
531
|
"x-risu-asset"
|
|
522
|
-
]>;
|
|
532
|
+
]>, "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset", unknown>;
|
|
523
533
|
uri: z.ZodString;
|
|
524
534
|
name: z.ZodString;
|
|
525
535
|
ext: z.ZodString;
|
|
@@ -530,15 +540,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
530
540
|
ext: string;
|
|
531
541
|
}, {
|
|
532
542
|
name: string;
|
|
533
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
534
543
|
uri: string;
|
|
535
544
|
ext: string;
|
|
545
|
+
type?: unknown;
|
|
536
546
|
}>, "many">>;
|
|
537
547
|
nickname: z.ZodOptional<z.ZodString>;
|
|
538
548
|
creator_notes_multilingual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
539
549
|
source: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
540
|
-
creation_date: z.ZodOptional<z.ZodNumber>;
|
|
541
|
-
modification_date: z.ZodOptional<z.ZodNumber>;
|
|
550
|
+
creation_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
551
|
+
modification_date: z.ZodEffects<z.ZodOptional<z.ZodNumber>, number | undefined, unknown>;
|
|
542
552
|
}, "strip", z.ZodTypeAny, {
|
|
543
553
|
name: string;
|
|
544
554
|
description: string;
|
|
@@ -572,7 +582,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
572
582
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
573
583
|
z.ZodEnum<[
|
|
574
584
|
"before_char",
|
|
575
|
-
"after_char"
|
|
585
|
+
"after_char",
|
|
586
|
+
"in_chat"
|
|
576
587
|
]>,
|
|
577
588
|
z.ZodNumber,
|
|
578
589
|
z.ZodLiteral<"">
|
|
@@ -647,7 +658,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
647
658
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
648
659
|
z.ZodEnum<[
|
|
649
660
|
"before_char",
|
|
650
|
-
"after_char"
|
|
661
|
+
"after_char",
|
|
662
|
+
"in_chat"
|
|
651
663
|
]>,
|
|
652
664
|
z.ZodNumber,
|
|
653
665
|
z.ZodLiteral<"">
|
|
@@ -677,8 +689,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
677
689
|
}, z.ZodTypeAny, "passthrough">[];
|
|
678
690
|
name?: string | undefined;
|
|
679
691
|
description?: string | undefined;
|
|
680
|
-
scan_depth?:
|
|
681
|
-
token_budget?:
|
|
692
|
+
scan_depth?: unknown;
|
|
693
|
+
token_budget?: unknown;
|
|
682
694
|
recursive_scanning?: boolean | undefined;
|
|
683
695
|
extensions?: Record<string, unknown> | undefined;
|
|
684
696
|
} | null | undefined;
|
|
@@ -688,15 +700,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
688
700
|
group_only_greetings?: string[] | undefined;
|
|
689
701
|
assets?: {
|
|
690
702
|
name: string;
|
|
691
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
692
703
|
uri: string;
|
|
693
704
|
ext: string;
|
|
705
|
+
type?: unknown;
|
|
694
706
|
}[] | undefined;
|
|
695
707
|
nickname?: string | undefined;
|
|
696
708
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
697
709
|
source?: string[] | undefined;
|
|
698
|
-
creation_date?:
|
|
699
|
-
modification_date?:
|
|
710
|
+
creation_date?: unknown;
|
|
711
|
+
modification_date?: unknown;
|
|
700
712
|
}>;
|
|
701
713
|
}, "strip", z.ZodTypeAny, {
|
|
702
714
|
data: {
|
|
@@ -732,7 +744,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
732
744
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
733
745
|
z.ZodEnum<[
|
|
734
746
|
"before_char",
|
|
735
|
-
"after_char"
|
|
747
|
+
"after_char",
|
|
748
|
+
"in_chat"
|
|
736
749
|
]>,
|
|
737
750
|
z.ZodNumber,
|
|
738
751
|
z.ZodLiteral<"">
|
|
@@ -811,7 +824,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
811
824
|
position: z.ZodOptional<z.ZodNullable<z.ZodUnion<[
|
|
812
825
|
z.ZodEnum<[
|
|
813
826
|
"before_char",
|
|
814
|
-
"after_char"
|
|
827
|
+
"after_char",
|
|
828
|
+
"in_chat"
|
|
815
829
|
]>,
|
|
816
830
|
z.ZodNumber,
|
|
817
831
|
z.ZodLiteral<"">
|
|
@@ -841,8 +855,8 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
841
855
|
}, z.ZodTypeAny, "passthrough">[];
|
|
842
856
|
name?: string | undefined;
|
|
843
857
|
description?: string | undefined;
|
|
844
|
-
scan_depth?:
|
|
845
|
-
token_budget?:
|
|
858
|
+
scan_depth?: unknown;
|
|
859
|
+
token_budget?: unknown;
|
|
846
860
|
recursive_scanning?: boolean | undefined;
|
|
847
861
|
extensions?: Record<string, unknown> | undefined;
|
|
848
862
|
} | null | undefined;
|
|
@@ -852,15 +866,15 @@ declare const CCv3DataSchema: z.ZodObject<{
|
|
|
852
866
|
group_only_greetings?: string[] | undefined;
|
|
853
867
|
assets?: {
|
|
854
868
|
name: string;
|
|
855
|
-
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
856
869
|
uri: string;
|
|
857
870
|
ext: string;
|
|
871
|
+
type?: unknown;
|
|
858
872
|
}[] | undefined;
|
|
859
873
|
nickname?: string | undefined;
|
|
860
874
|
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
861
875
|
source?: string[] | undefined;
|
|
862
|
-
creation_date?:
|
|
863
|
-
modification_date?:
|
|
876
|
+
creation_date?: unknown;
|
|
877
|
+
modification_date?: unknown;
|
|
864
878
|
};
|
|
865
879
|
spec: "chara_card_v3";
|
|
866
880
|
spec_version: "3.0";
|
|
@@ -1180,6 +1194,13 @@ export interface AuthoritativeMetadata {
|
|
|
1180
1194
|
tokens: TokenCounts;
|
|
1181
1195
|
/** Content hash computed server-side */
|
|
1182
1196
|
contentHash: string;
|
|
1197
|
+
/**
|
|
1198
|
+
* Content hash v2 computed server-side.
|
|
1199
|
+
*
|
|
1200
|
+
* @remarks
|
|
1201
|
+
* v1 is preserved for backwards compatibility. Prefer v2 for new storage/deduplication.
|
|
1202
|
+
*/
|
|
1203
|
+
contentHashV2?: string;
|
|
1183
1204
|
/** Whether the card has a lorebook */
|
|
1184
1205
|
hasLorebook: boolean;
|
|
1185
1206
|
/** Number of lorebook entries */
|
|
@@ -1279,6 +1300,13 @@ export declare function validateClientMetadata(clientMetadata: ClientMetadata, p
|
|
|
1279
1300
|
* @returns SHA-256 hash of canonical content
|
|
1280
1301
|
*/
|
|
1281
1302
|
export declare function computeContentHash(card: CCv3Data): Promise<string>;
|
|
1303
|
+
/**
|
|
1304
|
+
* Compute content hash v2 for a card (standalone utility)
|
|
1305
|
+
*
|
|
1306
|
+
* @param card - CCv3 card data
|
|
1307
|
+
* @returns SHA-256 hash of canonical content v2
|
|
1308
|
+
*/
|
|
1309
|
+
export declare function computeContentHashV2(card: CCv3Data): Promise<string>;
|
|
1282
1310
|
/**
|
|
1283
1311
|
* Options for synchronous metadata validation
|
|
1284
1312
|
*/
|