@character-foundry/character-foundry 0.1.3 → 0.1.5
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/README.md +70 -0
- package/dist/app-framework.cjs +1742 -0
- package/dist/app-framework.cjs.map +1 -0
- package/dist/app-framework.d.cts +881 -0
- package/dist/app-framework.d.ts +881 -2
- package/dist/app-framework.js +1718 -1
- package/dist/app-framework.js.map +1 -1
- package/dist/charx.cjs +917 -0
- package/dist/charx.cjs.map +1 -0
- package/dist/charx.d.cts +640 -0
- package/dist/charx.d.ts +640 -2
- package/dist/charx.js +893 -1
- package/dist/charx.js.map +1 -1
- package/dist/core.cjs +668 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +363 -0
- package/dist/core.d.ts +363 -2
- package/dist/core.js +644 -1
- package/dist/core.js.map +1 -1
- package/dist/exporter.cjs +7539 -0
- package/dist/exporter.cjs.map +1 -0
- package/dist/exporter.d.cts +681 -0
- package/dist/exporter.d.ts +681 -2
- package/dist/exporter.js +7522 -1
- package/dist/exporter.js.map +1 -1
- package/dist/federation.cjs +3915 -0
- package/dist/federation.cjs.map +1 -0
- package/dist/federation.d.cts +2951 -0
- package/dist/federation.d.ts +2951 -2
- package/dist/federation.js +3891 -1
- package/dist/federation.js.map +1 -1
- package/dist/index.cjs +9109 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1119 -0
- package/dist/index.d.ts +1113 -20
- package/dist/index.js +9092 -26
- package/dist/index.js.map +1 -1
- package/dist/loader.cjs +8923 -0
- package/dist/loader.cjs.map +1 -0
- package/dist/loader.d.cts +1037 -0
- package/dist/loader.d.ts +1037 -2
- package/dist/loader.js +8906 -1
- package/dist/loader.js.map +1 -1
- package/dist/lorebook.cjs +865 -0
- package/dist/lorebook.cjs.map +1 -0
- package/dist/lorebook.d.cts +1008 -0
- package/dist/lorebook.d.ts +1008 -2
- package/dist/lorebook.js +841 -1
- package/dist/lorebook.js.map +1 -1
- package/dist/media.cjs +6660 -0
- package/dist/media.cjs.map +1 -0
- package/dist/media.d.cts +87 -0
- package/dist/media.d.ts +87 -2
- package/dist/media.js +6643 -1
- package/dist/media.js.map +1 -1
- package/dist/normalizer.cjs +502 -0
- package/dist/normalizer.cjs.map +1 -0
- package/dist/normalizer.d.cts +1216 -0
- package/dist/normalizer.d.ts +1216 -2
- package/dist/normalizer.js +478 -1
- package/dist/normalizer.js.map +1 -1
- package/dist/png.cjs +778 -0
- package/dist/png.cjs.map +1 -0
- package/dist/png.d.cts +786 -0
- package/dist/png.d.ts +786 -2
- package/dist/png.js +754 -1
- package/dist/png.js.map +1 -1
- package/dist/schemas.cjs +799 -0
- package/dist/schemas.cjs.map +1 -0
- package/dist/schemas.d.cts +2178 -0
- package/dist/schemas.d.ts +2178 -2
- package/dist/schemas.js +775 -1
- package/dist/schemas.js.map +1 -1
- package/dist/tokenizers.cjs +153 -0
- package/dist/tokenizers.cjs.map +1 -0
- package/dist/tokenizers.d.cts +155 -0
- package/dist/tokenizers.d.ts +155 -2
- package/dist/tokenizers.js +129 -1
- package/dist/tokenizers.js.map +1 -1
- package/dist/voxta.cjs +7995 -0
- package/dist/voxta.cjs.map +1 -0
- package/dist/voxta.d.cts +1349 -0
- package/dist/voxta.d.ts +1349 -2
- package/dist/voxta.js +7978 -1
- package/dist/voxta.js.map +1 -1
- package/package.json +177 -45
- package/dist/app-framework.d.ts.map +0 -1
- package/dist/charx.d.ts.map +0 -1
- package/dist/core.d.ts.map +0 -1
- package/dist/exporter.d.ts.map +0 -1
- package/dist/federation.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/loader.d.ts.map +0 -1
- package/dist/lorebook.d.ts.map +0 -1
- package/dist/media.d.ts.map +0 -1
- package/dist/normalizer.d.ts.map +0 -1
- package/dist/png.d.ts.map +0 -1
- package/dist/schemas.d.ts.map +0 -1
- package/dist/tokenizers.d.ts.map +0 -1
- package/dist/voxta.d.ts.map +0 -1
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1119 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Binary Data Utilities
|
|
5
|
+
*
|
|
6
|
+
* Universal binary data operations using Uint8Array.
|
|
7
|
+
* Works in both Node.js and browser environments.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Universal binary data type (works in both environments)
|
|
11
|
+
*/
|
|
12
|
+
export type BinaryData = Uint8Array;
|
|
13
|
+
declare const CCv3CharacterBookSchema: z.ZodObject<{
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
20
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
21
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
22
|
+
content: z.ZodString;
|
|
23
|
+
enabled: z.ZodBoolean;
|
|
24
|
+
insertion_order: z.ZodNumber;
|
|
25
|
+
case_sensitive: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
name: z.ZodOptional<z.ZodString>;
|
|
27
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
30
|
+
selective: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
secondary_keys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
+
constant: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
position: z.ZodOptional<z.ZodEnum<[
|
|
34
|
+
"before_char",
|
|
35
|
+
"after_char"
|
|
36
|
+
]>>;
|
|
37
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
automation_id: z.ZodOptional<z.ZodString>;
|
|
39
|
+
role: z.ZodOptional<z.ZodEnum<[
|
|
40
|
+
"system",
|
|
41
|
+
"user",
|
|
42
|
+
"assistant"
|
|
43
|
+
]>>;
|
|
44
|
+
group: z.ZodOptional<z.ZodString>;
|
|
45
|
+
scan_frequency: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
probability: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
use_regex: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
selective_logic: z.ZodOptional<z.ZodEnum<[
|
|
50
|
+
"AND",
|
|
51
|
+
"NOT"
|
|
52
|
+
]>>;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
keys: string[];
|
|
55
|
+
content: string;
|
|
56
|
+
enabled: boolean;
|
|
57
|
+
insertion_order: number;
|
|
58
|
+
name?: string | undefined;
|
|
59
|
+
extensions?: Record<string, unknown> | undefined;
|
|
60
|
+
case_sensitive?: boolean | undefined;
|
|
61
|
+
priority?: number | undefined;
|
|
62
|
+
id?: number | undefined;
|
|
63
|
+
comment?: string | undefined;
|
|
64
|
+
selective?: boolean | undefined;
|
|
65
|
+
secondary_keys?: string[] | undefined;
|
|
66
|
+
constant?: boolean | undefined;
|
|
67
|
+
position?: "before_char" | "after_char" | undefined;
|
|
68
|
+
automation_id?: string | undefined;
|
|
69
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
70
|
+
group?: string | undefined;
|
|
71
|
+
scan_frequency?: number | undefined;
|
|
72
|
+
probability?: number | undefined;
|
|
73
|
+
use_regex?: boolean | undefined;
|
|
74
|
+
depth?: number | undefined;
|
|
75
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
keys: string[];
|
|
78
|
+
content: string;
|
|
79
|
+
enabled: boolean;
|
|
80
|
+
insertion_order: number;
|
|
81
|
+
name?: string | undefined;
|
|
82
|
+
extensions?: Record<string, unknown> | undefined;
|
|
83
|
+
case_sensitive?: boolean | undefined;
|
|
84
|
+
priority?: number | undefined;
|
|
85
|
+
id?: number | undefined;
|
|
86
|
+
comment?: string | undefined;
|
|
87
|
+
selective?: boolean | undefined;
|
|
88
|
+
secondary_keys?: string[] | undefined;
|
|
89
|
+
constant?: boolean | undefined;
|
|
90
|
+
position?: "before_char" | "after_char" | undefined;
|
|
91
|
+
automation_id?: string | undefined;
|
|
92
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
93
|
+
group?: string | undefined;
|
|
94
|
+
scan_frequency?: number | undefined;
|
|
95
|
+
probability?: number | undefined;
|
|
96
|
+
use_regex?: boolean | undefined;
|
|
97
|
+
depth?: number | undefined;
|
|
98
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
99
|
+
}>, "many">;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
entries: {
|
|
102
|
+
keys: string[];
|
|
103
|
+
content: string;
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
insertion_order: number;
|
|
106
|
+
name?: string | undefined;
|
|
107
|
+
extensions?: Record<string, unknown> | undefined;
|
|
108
|
+
case_sensitive?: boolean | undefined;
|
|
109
|
+
priority?: number | undefined;
|
|
110
|
+
id?: number | undefined;
|
|
111
|
+
comment?: string | undefined;
|
|
112
|
+
selective?: boolean | undefined;
|
|
113
|
+
secondary_keys?: string[] | undefined;
|
|
114
|
+
constant?: boolean | undefined;
|
|
115
|
+
position?: "before_char" | "after_char" | undefined;
|
|
116
|
+
automation_id?: string | undefined;
|
|
117
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
118
|
+
group?: string | undefined;
|
|
119
|
+
scan_frequency?: number | undefined;
|
|
120
|
+
probability?: number | undefined;
|
|
121
|
+
use_regex?: boolean | undefined;
|
|
122
|
+
depth?: number | undefined;
|
|
123
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
124
|
+
}[];
|
|
125
|
+
name?: string | undefined;
|
|
126
|
+
description?: string | undefined;
|
|
127
|
+
scan_depth?: number | undefined;
|
|
128
|
+
token_budget?: number | undefined;
|
|
129
|
+
recursive_scanning?: boolean | undefined;
|
|
130
|
+
extensions?: Record<string, unknown> | undefined;
|
|
131
|
+
}, {
|
|
132
|
+
entries: {
|
|
133
|
+
keys: string[];
|
|
134
|
+
content: string;
|
|
135
|
+
enabled: boolean;
|
|
136
|
+
insertion_order: number;
|
|
137
|
+
name?: string | undefined;
|
|
138
|
+
extensions?: Record<string, unknown> | undefined;
|
|
139
|
+
case_sensitive?: boolean | undefined;
|
|
140
|
+
priority?: number | undefined;
|
|
141
|
+
id?: number | undefined;
|
|
142
|
+
comment?: string | undefined;
|
|
143
|
+
selective?: boolean | undefined;
|
|
144
|
+
secondary_keys?: string[] | undefined;
|
|
145
|
+
constant?: boolean | undefined;
|
|
146
|
+
position?: "before_char" | "after_char" | undefined;
|
|
147
|
+
automation_id?: string | undefined;
|
|
148
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
149
|
+
group?: string | undefined;
|
|
150
|
+
scan_frequency?: number | undefined;
|
|
151
|
+
probability?: number | undefined;
|
|
152
|
+
use_regex?: boolean | undefined;
|
|
153
|
+
depth?: number | undefined;
|
|
154
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
155
|
+
}[];
|
|
156
|
+
name?: string | undefined;
|
|
157
|
+
description?: string | undefined;
|
|
158
|
+
scan_depth?: number | undefined;
|
|
159
|
+
token_budget?: number | undefined;
|
|
160
|
+
recursive_scanning?: boolean | undefined;
|
|
161
|
+
extensions?: Record<string, unknown> | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
declare const CCv3DataSchema: z.ZodObject<{
|
|
164
|
+
spec: z.ZodLiteral<"chara_card_v3">;
|
|
165
|
+
spec_version: z.ZodLiteral<"3.0">;
|
|
166
|
+
data: z.ZodObject<{
|
|
167
|
+
name: z.ZodDefault<z.ZodString>;
|
|
168
|
+
description: z.ZodDefault<z.ZodString>;
|
|
169
|
+
personality: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
scenario: z.ZodDefault<z.ZodString>;
|
|
171
|
+
first_mes: z.ZodDefault<z.ZodString>;
|
|
172
|
+
mes_example: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
173
|
+
creator: z.ZodDefault<z.ZodString>;
|
|
174
|
+
character_version: z.ZodDefault<z.ZodString>;
|
|
175
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
176
|
+
group_only_greetings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
177
|
+
creator_notes: z.ZodOptional<z.ZodString>;
|
|
178
|
+
system_prompt: z.ZodOptional<z.ZodString>;
|
|
179
|
+
post_history_instructions: z.ZodOptional<z.ZodString>;
|
|
180
|
+
alternate_greetings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
181
|
+
character_book: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
182
|
+
name: z.ZodOptional<z.ZodString>;
|
|
183
|
+
description: z.ZodOptional<z.ZodString>;
|
|
184
|
+
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
188
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
189
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
190
|
+
content: z.ZodString;
|
|
191
|
+
enabled: z.ZodBoolean;
|
|
192
|
+
insertion_order: z.ZodNumber;
|
|
193
|
+
case_sensitive: z.ZodOptional<z.ZodBoolean>;
|
|
194
|
+
name: z.ZodOptional<z.ZodString>;
|
|
195
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
198
|
+
selective: z.ZodOptional<z.ZodBoolean>;
|
|
199
|
+
secondary_keys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
200
|
+
constant: z.ZodOptional<z.ZodBoolean>;
|
|
201
|
+
position: z.ZodOptional<z.ZodEnum<[
|
|
202
|
+
"before_char",
|
|
203
|
+
"after_char"
|
|
204
|
+
]>>;
|
|
205
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
206
|
+
automation_id: z.ZodOptional<z.ZodString>;
|
|
207
|
+
role: z.ZodOptional<z.ZodEnum<[
|
|
208
|
+
"system",
|
|
209
|
+
"user",
|
|
210
|
+
"assistant"
|
|
211
|
+
]>>;
|
|
212
|
+
group: z.ZodOptional<z.ZodString>;
|
|
213
|
+
scan_frequency: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
probability: z.ZodOptional<z.ZodNumber>;
|
|
215
|
+
use_regex: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
selective_logic: z.ZodOptional<z.ZodEnum<[
|
|
218
|
+
"AND",
|
|
219
|
+
"NOT"
|
|
220
|
+
]>>;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
keys: string[];
|
|
223
|
+
content: string;
|
|
224
|
+
enabled: boolean;
|
|
225
|
+
insertion_order: number;
|
|
226
|
+
name?: string | undefined;
|
|
227
|
+
extensions?: Record<string, unknown> | undefined;
|
|
228
|
+
case_sensitive?: boolean | undefined;
|
|
229
|
+
priority?: number | undefined;
|
|
230
|
+
id?: number | undefined;
|
|
231
|
+
comment?: string | undefined;
|
|
232
|
+
selective?: boolean | undefined;
|
|
233
|
+
secondary_keys?: string[] | undefined;
|
|
234
|
+
constant?: boolean | undefined;
|
|
235
|
+
position?: "before_char" | "after_char" | undefined;
|
|
236
|
+
automation_id?: string | undefined;
|
|
237
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
238
|
+
group?: string | undefined;
|
|
239
|
+
scan_frequency?: number | undefined;
|
|
240
|
+
probability?: number | undefined;
|
|
241
|
+
use_regex?: boolean | undefined;
|
|
242
|
+
depth?: number | undefined;
|
|
243
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
keys: string[];
|
|
246
|
+
content: string;
|
|
247
|
+
enabled: boolean;
|
|
248
|
+
insertion_order: number;
|
|
249
|
+
name?: string | undefined;
|
|
250
|
+
extensions?: Record<string, unknown> | undefined;
|
|
251
|
+
case_sensitive?: boolean | undefined;
|
|
252
|
+
priority?: number | undefined;
|
|
253
|
+
id?: number | undefined;
|
|
254
|
+
comment?: string | undefined;
|
|
255
|
+
selective?: boolean | undefined;
|
|
256
|
+
secondary_keys?: string[] | undefined;
|
|
257
|
+
constant?: boolean | undefined;
|
|
258
|
+
position?: "before_char" | "after_char" | undefined;
|
|
259
|
+
automation_id?: string | undefined;
|
|
260
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
261
|
+
group?: string | undefined;
|
|
262
|
+
scan_frequency?: number | undefined;
|
|
263
|
+
probability?: number | undefined;
|
|
264
|
+
use_regex?: boolean | undefined;
|
|
265
|
+
depth?: number | undefined;
|
|
266
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
267
|
+
}>, "many">;
|
|
268
|
+
}, "strip", z.ZodTypeAny, {
|
|
269
|
+
entries: {
|
|
270
|
+
keys: string[];
|
|
271
|
+
content: string;
|
|
272
|
+
enabled: boolean;
|
|
273
|
+
insertion_order: number;
|
|
274
|
+
name?: string | undefined;
|
|
275
|
+
extensions?: Record<string, unknown> | undefined;
|
|
276
|
+
case_sensitive?: boolean | undefined;
|
|
277
|
+
priority?: number | undefined;
|
|
278
|
+
id?: number | undefined;
|
|
279
|
+
comment?: string | undefined;
|
|
280
|
+
selective?: boolean | undefined;
|
|
281
|
+
secondary_keys?: string[] | undefined;
|
|
282
|
+
constant?: boolean | undefined;
|
|
283
|
+
position?: "before_char" | "after_char" | undefined;
|
|
284
|
+
automation_id?: string | undefined;
|
|
285
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
286
|
+
group?: string | undefined;
|
|
287
|
+
scan_frequency?: number | undefined;
|
|
288
|
+
probability?: number | undefined;
|
|
289
|
+
use_regex?: boolean | undefined;
|
|
290
|
+
depth?: number | undefined;
|
|
291
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
292
|
+
}[];
|
|
293
|
+
name?: string | undefined;
|
|
294
|
+
description?: string | undefined;
|
|
295
|
+
scan_depth?: number | undefined;
|
|
296
|
+
token_budget?: number | undefined;
|
|
297
|
+
recursive_scanning?: boolean | undefined;
|
|
298
|
+
extensions?: Record<string, unknown> | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
entries: {
|
|
301
|
+
keys: string[];
|
|
302
|
+
content: string;
|
|
303
|
+
enabled: boolean;
|
|
304
|
+
insertion_order: number;
|
|
305
|
+
name?: string | undefined;
|
|
306
|
+
extensions?: Record<string, unknown> | undefined;
|
|
307
|
+
case_sensitive?: boolean | undefined;
|
|
308
|
+
priority?: number | undefined;
|
|
309
|
+
id?: number | undefined;
|
|
310
|
+
comment?: string | undefined;
|
|
311
|
+
selective?: boolean | undefined;
|
|
312
|
+
secondary_keys?: string[] | undefined;
|
|
313
|
+
constant?: boolean | undefined;
|
|
314
|
+
position?: "before_char" | "after_char" | undefined;
|
|
315
|
+
automation_id?: string | undefined;
|
|
316
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
317
|
+
group?: string | undefined;
|
|
318
|
+
scan_frequency?: number | undefined;
|
|
319
|
+
probability?: number | undefined;
|
|
320
|
+
use_regex?: boolean | undefined;
|
|
321
|
+
depth?: number | undefined;
|
|
322
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
323
|
+
}[];
|
|
324
|
+
name?: string | undefined;
|
|
325
|
+
description?: string | undefined;
|
|
326
|
+
scan_depth?: number | undefined;
|
|
327
|
+
token_budget?: number | undefined;
|
|
328
|
+
recursive_scanning?: boolean | undefined;
|
|
329
|
+
extensions?: Record<string, unknown> | undefined;
|
|
330
|
+
}>>>;
|
|
331
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
332
|
+
assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
333
|
+
type: z.ZodEnum<[
|
|
334
|
+
"icon",
|
|
335
|
+
"background",
|
|
336
|
+
"emotion",
|
|
337
|
+
"user_icon",
|
|
338
|
+
"sound",
|
|
339
|
+
"video",
|
|
340
|
+
"custom",
|
|
341
|
+
"x-risu-asset"
|
|
342
|
+
]>;
|
|
343
|
+
uri: z.ZodString;
|
|
344
|
+
name: z.ZodString;
|
|
345
|
+
ext: z.ZodString;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
name: string;
|
|
348
|
+
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
349
|
+
uri: string;
|
|
350
|
+
ext: string;
|
|
351
|
+
}, {
|
|
352
|
+
name: string;
|
|
353
|
+
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
354
|
+
uri: string;
|
|
355
|
+
ext: string;
|
|
356
|
+
}>, "many">>;
|
|
357
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
358
|
+
creator_notes_multilingual: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
359
|
+
source: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
360
|
+
creation_date: z.ZodOptional<z.ZodNumber>;
|
|
361
|
+
modification_date: z.ZodOptional<z.ZodNumber>;
|
|
362
|
+
}, "strip", z.ZodTypeAny, {
|
|
363
|
+
name: string;
|
|
364
|
+
description: string;
|
|
365
|
+
personality: string | null;
|
|
366
|
+
scenario: string;
|
|
367
|
+
first_mes: string;
|
|
368
|
+
mes_example: string | null;
|
|
369
|
+
tags: string[];
|
|
370
|
+
creator: string;
|
|
371
|
+
character_version: string;
|
|
372
|
+
group_only_greetings: string[];
|
|
373
|
+
extensions?: Record<string, unknown> | undefined;
|
|
374
|
+
creator_notes?: string | undefined;
|
|
375
|
+
system_prompt?: string | undefined;
|
|
376
|
+
post_history_instructions?: string | undefined;
|
|
377
|
+
alternate_greetings?: string[] | undefined;
|
|
378
|
+
character_book?: {
|
|
379
|
+
entries: {
|
|
380
|
+
keys: string[];
|
|
381
|
+
content: string;
|
|
382
|
+
enabled: boolean;
|
|
383
|
+
insertion_order: number;
|
|
384
|
+
name?: string | undefined;
|
|
385
|
+
extensions?: Record<string, unknown> | undefined;
|
|
386
|
+
case_sensitive?: boolean | undefined;
|
|
387
|
+
priority?: number | undefined;
|
|
388
|
+
id?: number | undefined;
|
|
389
|
+
comment?: string | undefined;
|
|
390
|
+
selective?: boolean | undefined;
|
|
391
|
+
secondary_keys?: string[] | undefined;
|
|
392
|
+
constant?: boolean | undefined;
|
|
393
|
+
position?: "before_char" | "after_char" | undefined;
|
|
394
|
+
automation_id?: string | undefined;
|
|
395
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
396
|
+
group?: string | undefined;
|
|
397
|
+
scan_frequency?: number | undefined;
|
|
398
|
+
probability?: number | undefined;
|
|
399
|
+
use_regex?: boolean | undefined;
|
|
400
|
+
depth?: number | undefined;
|
|
401
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
402
|
+
}[];
|
|
403
|
+
name?: string | undefined;
|
|
404
|
+
description?: string | undefined;
|
|
405
|
+
scan_depth?: number | undefined;
|
|
406
|
+
token_budget?: number | undefined;
|
|
407
|
+
recursive_scanning?: boolean | undefined;
|
|
408
|
+
extensions?: Record<string, unknown> | undefined;
|
|
409
|
+
} | null | undefined;
|
|
410
|
+
assets?: {
|
|
411
|
+
name: string;
|
|
412
|
+
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
413
|
+
uri: string;
|
|
414
|
+
ext: string;
|
|
415
|
+
}[] | undefined;
|
|
416
|
+
nickname?: string | undefined;
|
|
417
|
+
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
418
|
+
source?: string[] | undefined;
|
|
419
|
+
creation_date?: number | undefined;
|
|
420
|
+
modification_date?: number | undefined;
|
|
421
|
+
}, {
|
|
422
|
+
name?: string | undefined;
|
|
423
|
+
description?: string | undefined;
|
|
424
|
+
extensions?: Record<string, unknown> | undefined;
|
|
425
|
+
personality?: string | null | undefined;
|
|
426
|
+
scenario?: string | undefined;
|
|
427
|
+
first_mes?: string | undefined;
|
|
428
|
+
mes_example?: string | null | undefined;
|
|
429
|
+
creator_notes?: string | undefined;
|
|
430
|
+
system_prompt?: string | undefined;
|
|
431
|
+
post_history_instructions?: string | undefined;
|
|
432
|
+
alternate_greetings?: string[] | undefined;
|
|
433
|
+
character_book?: {
|
|
434
|
+
entries: {
|
|
435
|
+
keys: string[];
|
|
436
|
+
content: string;
|
|
437
|
+
enabled: boolean;
|
|
438
|
+
insertion_order: number;
|
|
439
|
+
name?: string | undefined;
|
|
440
|
+
extensions?: Record<string, unknown> | undefined;
|
|
441
|
+
case_sensitive?: boolean | undefined;
|
|
442
|
+
priority?: number | undefined;
|
|
443
|
+
id?: number | undefined;
|
|
444
|
+
comment?: string | undefined;
|
|
445
|
+
selective?: boolean | undefined;
|
|
446
|
+
secondary_keys?: string[] | undefined;
|
|
447
|
+
constant?: boolean | undefined;
|
|
448
|
+
position?: "before_char" | "after_char" | undefined;
|
|
449
|
+
automation_id?: string | undefined;
|
|
450
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
451
|
+
group?: string | undefined;
|
|
452
|
+
scan_frequency?: number | undefined;
|
|
453
|
+
probability?: number | undefined;
|
|
454
|
+
use_regex?: boolean | undefined;
|
|
455
|
+
depth?: number | undefined;
|
|
456
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
457
|
+
}[];
|
|
458
|
+
name?: string | undefined;
|
|
459
|
+
description?: string | undefined;
|
|
460
|
+
scan_depth?: number | undefined;
|
|
461
|
+
token_budget?: number | undefined;
|
|
462
|
+
recursive_scanning?: boolean | undefined;
|
|
463
|
+
extensions?: Record<string, unknown> | undefined;
|
|
464
|
+
} | null | undefined;
|
|
465
|
+
tags?: string[] | undefined;
|
|
466
|
+
creator?: string | undefined;
|
|
467
|
+
character_version?: string | undefined;
|
|
468
|
+
group_only_greetings?: string[] | undefined;
|
|
469
|
+
assets?: {
|
|
470
|
+
name: string;
|
|
471
|
+
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
472
|
+
uri: string;
|
|
473
|
+
ext: string;
|
|
474
|
+
}[] | undefined;
|
|
475
|
+
nickname?: string | undefined;
|
|
476
|
+
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
477
|
+
source?: string[] | undefined;
|
|
478
|
+
creation_date?: number | undefined;
|
|
479
|
+
modification_date?: number | undefined;
|
|
480
|
+
}>;
|
|
481
|
+
}, "strip", z.ZodTypeAny, {
|
|
482
|
+
data: {
|
|
483
|
+
name: string;
|
|
484
|
+
description: string;
|
|
485
|
+
personality: string | null;
|
|
486
|
+
scenario: string;
|
|
487
|
+
first_mes: string;
|
|
488
|
+
mes_example: string | null;
|
|
489
|
+
tags: string[];
|
|
490
|
+
creator: string;
|
|
491
|
+
character_version: string;
|
|
492
|
+
group_only_greetings: string[];
|
|
493
|
+
extensions?: Record<string, unknown> | undefined;
|
|
494
|
+
creator_notes?: string | undefined;
|
|
495
|
+
system_prompt?: string | undefined;
|
|
496
|
+
post_history_instructions?: string | undefined;
|
|
497
|
+
alternate_greetings?: string[] | undefined;
|
|
498
|
+
character_book?: {
|
|
499
|
+
entries: {
|
|
500
|
+
keys: string[];
|
|
501
|
+
content: string;
|
|
502
|
+
enabled: boolean;
|
|
503
|
+
insertion_order: number;
|
|
504
|
+
name?: string | undefined;
|
|
505
|
+
extensions?: Record<string, unknown> | undefined;
|
|
506
|
+
case_sensitive?: boolean | undefined;
|
|
507
|
+
priority?: number | undefined;
|
|
508
|
+
id?: number | undefined;
|
|
509
|
+
comment?: string | undefined;
|
|
510
|
+
selective?: boolean | undefined;
|
|
511
|
+
secondary_keys?: string[] | undefined;
|
|
512
|
+
constant?: boolean | undefined;
|
|
513
|
+
position?: "before_char" | "after_char" | undefined;
|
|
514
|
+
automation_id?: string | undefined;
|
|
515
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
516
|
+
group?: string | undefined;
|
|
517
|
+
scan_frequency?: number | undefined;
|
|
518
|
+
probability?: number | undefined;
|
|
519
|
+
use_regex?: boolean | undefined;
|
|
520
|
+
depth?: number | undefined;
|
|
521
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
522
|
+
}[];
|
|
523
|
+
name?: string | undefined;
|
|
524
|
+
description?: string | undefined;
|
|
525
|
+
scan_depth?: number | undefined;
|
|
526
|
+
token_budget?: number | undefined;
|
|
527
|
+
recursive_scanning?: boolean | undefined;
|
|
528
|
+
extensions?: Record<string, unknown> | undefined;
|
|
529
|
+
} | null | undefined;
|
|
530
|
+
assets?: {
|
|
531
|
+
name: string;
|
|
532
|
+
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
533
|
+
uri: string;
|
|
534
|
+
ext: string;
|
|
535
|
+
}[] | undefined;
|
|
536
|
+
nickname?: string | undefined;
|
|
537
|
+
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
538
|
+
source?: string[] | undefined;
|
|
539
|
+
creation_date?: number | undefined;
|
|
540
|
+
modification_date?: number | undefined;
|
|
541
|
+
};
|
|
542
|
+
spec: "chara_card_v3";
|
|
543
|
+
spec_version: "3.0";
|
|
544
|
+
}, {
|
|
545
|
+
data: {
|
|
546
|
+
name?: string | undefined;
|
|
547
|
+
description?: string | undefined;
|
|
548
|
+
extensions?: Record<string, unknown> | undefined;
|
|
549
|
+
personality?: string | null | undefined;
|
|
550
|
+
scenario?: string | undefined;
|
|
551
|
+
first_mes?: string | undefined;
|
|
552
|
+
mes_example?: string | null | undefined;
|
|
553
|
+
creator_notes?: string | undefined;
|
|
554
|
+
system_prompt?: string | undefined;
|
|
555
|
+
post_history_instructions?: string | undefined;
|
|
556
|
+
alternate_greetings?: string[] | undefined;
|
|
557
|
+
character_book?: {
|
|
558
|
+
entries: {
|
|
559
|
+
keys: string[];
|
|
560
|
+
content: string;
|
|
561
|
+
enabled: boolean;
|
|
562
|
+
insertion_order: number;
|
|
563
|
+
name?: string | undefined;
|
|
564
|
+
extensions?: Record<string, unknown> | undefined;
|
|
565
|
+
case_sensitive?: boolean | undefined;
|
|
566
|
+
priority?: number | undefined;
|
|
567
|
+
id?: number | undefined;
|
|
568
|
+
comment?: string | undefined;
|
|
569
|
+
selective?: boolean | undefined;
|
|
570
|
+
secondary_keys?: string[] | undefined;
|
|
571
|
+
constant?: boolean | undefined;
|
|
572
|
+
position?: "before_char" | "after_char" | undefined;
|
|
573
|
+
automation_id?: string | undefined;
|
|
574
|
+
role?: "system" | "user" | "assistant" | undefined;
|
|
575
|
+
group?: string | undefined;
|
|
576
|
+
scan_frequency?: number | undefined;
|
|
577
|
+
probability?: number | undefined;
|
|
578
|
+
use_regex?: boolean | undefined;
|
|
579
|
+
depth?: number | undefined;
|
|
580
|
+
selective_logic?: "AND" | "NOT" | undefined;
|
|
581
|
+
}[];
|
|
582
|
+
name?: string | undefined;
|
|
583
|
+
description?: string | undefined;
|
|
584
|
+
scan_depth?: number | undefined;
|
|
585
|
+
token_budget?: number | undefined;
|
|
586
|
+
recursive_scanning?: boolean | undefined;
|
|
587
|
+
extensions?: Record<string, unknown> | undefined;
|
|
588
|
+
} | null | undefined;
|
|
589
|
+
tags?: string[] | undefined;
|
|
590
|
+
creator?: string | undefined;
|
|
591
|
+
character_version?: string | undefined;
|
|
592
|
+
group_only_greetings?: string[] | undefined;
|
|
593
|
+
assets?: {
|
|
594
|
+
name: string;
|
|
595
|
+
type: "custom" | "icon" | "background" | "emotion" | "user_icon" | "sound" | "video" | "x-risu-asset";
|
|
596
|
+
uri: string;
|
|
597
|
+
ext: string;
|
|
598
|
+
}[] | undefined;
|
|
599
|
+
nickname?: string | undefined;
|
|
600
|
+
creator_notes_multilingual?: Record<string, string> | undefined;
|
|
601
|
+
source?: string[] | undefined;
|
|
602
|
+
creation_date?: number | undefined;
|
|
603
|
+
modification_date?: number | undefined;
|
|
604
|
+
};
|
|
605
|
+
spec: "chara_card_v3";
|
|
606
|
+
spec_version: "3.0";
|
|
607
|
+
}>;
|
|
608
|
+
/**
|
|
609
|
+
* Character book (lorebook) for v3 cards
|
|
610
|
+
*/
|
|
611
|
+
export type CCv3CharacterBook = z.infer<typeof CCv3CharacterBookSchema>;
|
|
612
|
+
/**
|
|
613
|
+
* Character Card v3 full structure
|
|
614
|
+
*/
|
|
615
|
+
export type CCv3Data = z.infer<typeof CCv3DataSchema>;
|
|
616
|
+
declare const SpecSchema: z.ZodEnum<[
|
|
617
|
+
"v2",
|
|
618
|
+
"v3"
|
|
619
|
+
]>;
|
|
620
|
+
declare const SourceFormatSchema: z.ZodEnum<[
|
|
621
|
+
"png_v2",
|
|
622
|
+
"png_v3",
|
|
623
|
+
"json_v2",
|
|
624
|
+
"json_v3",
|
|
625
|
+
"charx",
|
|
626
|
+
"charx_risu",
|
|
627
|
+
"charx_jpeg",
|
|
628
|
+
"voxta"
|
|
629
|
+
]>;
|
|
630
|
+
/**
|
|
631
|
+
* Card specification version
|
|
632
|
+
*/
|
|
633
|
+
export type Spec = z.infer<typeof SpecSchema>;
|
|
634
|
+
/**
|
|
635
|
+
* Source format identifier
|
|
636
|
+
*/
|
|
637
|
+
export type SourceFormat = z.infer<typeof SourceFormatSchema>;
|
|
638
|
+
declare const CCv2DataSchema: z.ZodObject<{
|
|
639
|
+
name: z.ZodDefault<z.ZodString>;
|
|
640
|
+
description: z.ZodDefault<z.ZodString>;
|
|
641
|
+
personality: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
642
|
+
scenario: z.ZodDefault<z.ZodString>;
|
|
643
|
+
first_mes: z.ZodDefault<z.ZodString>;
|
|
644
|
+
mes_example: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
645
|
+
creator_notes: z.ZodOptional<z.ZodString>;
|
|
646
|
+
system_prompt: z.ZodOptional<z.ZodString>;
|
|
647
|
+
post_history_instructions: z.ZodOptional<z.ZodString>;
|
|
648
|
+
alternate_greetings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
649
|
+
character_book: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
650
|
+
name: z.ZodOptional<z.ZodString>;
|
|
651
|
+
description: z.ZodOptional<z.ZodString>;
|
|
652
|
+
scan_depth: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
token_budget: z.ZodOptional<z.ZodNumber>;
|
|
654
|
+
recursive_scanning: z.ZodOptional<z.ZodBoolean>;
|
|
655
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
656
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
657
|
+
keys: z.ZodArray<z.ZodString, "many">;
|
|
658
|
+
content: z.ZodString;
|
|
659
|
+
enabled: z.ZodBoolean;
|
|
660
|
+
insertion_order: z.ZodNumber;
|
|
661
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
662
|
+
case_sensitive: z.ZodOptional<z.ZodBoolean>;
|
|
663
|
+
name: z.ZodOptional<z.ZodString>;
|
|
664
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
665
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
666
|
+
comment: z.ZodOptional<z.ZodString>;
|
|
667
|
+
selective: z.ZodOptional<z.ZodBoolean>;
|
|
668
|
+
secondary_keys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
669
|
+
constant: z.ZodOptional<z.ZodBoolean>;
|
|
670
|
+
position: z.ZodOptional<z.ZodEnum<[
|
|
671
|
+
"before_char",
|
|
672
|
+
"after_char"
|
|
673
|
+
]>>;
|
|
674
|
+
}, "strip", z.ZodTypeAny, {
|
|
675
|
+
keys: string[];
|
|
676
|
+
content: string;
|
|
677
|
+
enabled: boolean;
|
|
678
|
+
insertion_order: number;
|
|
679
|
+
name?: string | undefined;
|
|
680
|
+
extensions?: Record<string, unknown> | undefined;
|
|
681
|
+
case_sensitive?: boolean | undefined;
|
|
682
|
+
priority?: number | undefined;
|
|
683
|
+
id?: number | undefined;
|
|
684
|
+
comment?: string | undefined;
|
|
685
|
+
selective?: boolean | undefined;
|
|
686
|
+
secondary_keys?: string[] | undefined;
|
|
687
|
+
constant?: boolean | undefined;
|
|
688
|
+
position?: "before_char" | "after_char" | undefined;
|
|
689
|
+
}, {
|
|
690
|
+
keys: string[];
|
|
691
|
+
content: string;
|
|
692
|
+
enabled: boolean;
|
|
693
|
+
insertion_order: number;
|
|
694
|
+
name?: string | undefined;
|
|
695
|
+
extensions?: Record<string, unknown> | undefined;
|
|
696
|
+
case_sensitive?: boolean | undefined;
|
|
697
|
+
priority?: number | undefined;
|
|
698
|
+
id?: number | undefined;
|
|
699
|
+
comment?: string | undefined;
|
|
700
|
+
selective?: boolean | undefined;
|
|
701
|
+
secondary_keys?: string[] | undefined;
|
|
702
|
+
constant?: boolean | undefined;
|
|
703
|
+
position?: "before_char" | "after_char" | undefined;
|
|
704
|
+
}>, "many">;
|
|
705
|
+
}, "strip", z.ZodTypeAny, {
|
|
706
|
+
entries: {
|
|
707
|
+
keys: string[];
|
|
708
|
+
content: string;
|
|
709
|
+
enabled: boolean;
|
|
710
|
+
insertion_order: number;
|
|
711
|
+
name?: string | undefined;
|
|
712
|
+
extensions?: Record<string, unknown> | undefined;
|
|
713
|
+
case_sensitive?: boolean | undefined;
|
|
714
|
+
priority?: number | undefined;
|
|
715
|
+
id?: number | undefined;
|
|
716
|
+
comment?: string | undefined;
|
|
717
|
+
selective?: boolean | undefined;
|
|
718
|
+
secondary_keys?: string[] | undefined;
|
|
719
|
+
constant?: boolean | undefined;
|
|
720
|
+
position?: "before_char" | "after_char" | undefined;
|
|
721
|
+
}[];
|
|
722
|
+
name?: string | undefined;
|
|
723
|
+
description?: string | undefined;
|
|
724
|
+
scan_depth?: number | undefined;
|
|
725
|
+
token_budget?: number | undefined;
|
|
726
|
+
recursive_scanning?: boolean | undefined;
|
|
727
|
+
extensions?: Record<string, unknown> | undefined;
|
|
728
|
+
}, {
|
|
729
|
+
entries: {
|
|
730
|
+
keys: string[];
|
|
731
|
+
content: string;
|
|
732
|
+
enabled: boolean;
|
|
733
|
+
insertion_order: number;
|
|
734
|
+
name?: string | undefined;
|
|
735
|
+
extensions?: Record<string, unknown> | undefined;
|
|
736
|
+
case_sensitive?: boolean | undefined;
|
|
737
|
+
priority?: number | undefined;
|
|
738
|
+
id?: number | undefined;
|
|
739
|
+
comment?: string | undefined;
|
|
740
|
+
selective?: boolean | undefined;
|
|
741
|
+
secondary_keys?: string[] | undefined;
|
|
742
|
+
constant?: boolean | undefined;
|
|
743
|
+
position?: "before_char" | "after_char" | undefined;
|
|
744
|
+
}[];
|
|
745
|
+
name?: string | undefined;
|
|
746
|
+
description?: string | undefined;
|
|
747
|
+
scan_depth?: number | undefined;
|
|
748
|
+
token_budget?: number | undefined;
|
|
749
|
+
recursive_scanning?: boolean | undefined;
|
|
750
|
+
extensions?: Record<string, unknown> | undefined;
|
|
751
|
+
}>>>;
|
|
752
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
753
|
+
creator: z.ZodOptional<z.ZodString>;
|
|
754
|
+
character_version: z.ZodOptional<z.ZodString>;
|
|
755
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
756
|
+
}, "strip", z.ZodTypeAny, {
|
|
757
|
+
name: string;
|
|
758
|
+
description: string;
|
|
759
|
+
personality: string | null;
|
|
760
|
+
scenario: string;
|
|
761
|
+
first_mes: string;
|
|
762
|
+
mes_example: string | null;
|
|
763
|
+
extensions?: Record<string, unknown> | undefined;
|
|
764
|
+
creator_notes?: string | undefined;
|
|
765
|
+
system_prompt?: string | undefined;
|
|
766
|
+
post_history_instructions?: string | undefined;
|
|
767
|
+
alternate_greetings?: string[] | undefined;
|
|
768
|
+
character_book?: {
|
|
769
|
+
entries: {
|
|
770
|
+
keys: string[];
|
|
771
|
+
content: string;
|
|
772
|
+
enabled: boolean;
|
|
773
|
+
insertion_order: number;
|
|
774
|
+
name?: string | undefined;
|
|
775
|
+
extensions?: Record<string, unknown> | undefined;
|
|
776
|
+
case_sensitive?: boolean | undefined;
|
|
777
|
+
priority?: number | undefined;
|
|
778
|
+
id?: number | undefined;
|
|
779
|
+
comment?: string | undefined;
|
|
780
|
+
selective?: boolean | undefined;
|
|
781
|
+
secondary_keys?: string[] | undefined;
|
|
782
|
+
constant?: boolean | undefined;
|
|
783
|
+
position?: "before_char" | "after_char" | undefined;
|
|
784
|
+
}[];
|
|
785
|
+
name?: string | undefined;
|
|
786
|
+
description?: string | undefined;
|
|
787
|
+
scan_depth?: number | undefined;
|
|
788
|
+
token_budget?: number | undefined;
|
|
789
|
+
recursive_scanning?: boolean | undefined;
|
|
790
|
+
extensions?: Record<string, unknown> | undefined;
|
|
791
|
+
} | null | undefined;
|
|
792
|
+
tags?: string[] | undefined;
|
|
793
|
+
creator?: string | undefined;
|
|
794
|
+
character_version?: string | undefined;
|
|
795
|
+
}, {
|
|
796
|
+
name?: string | undefined;
|
|
797
|
+
description?: string | undefined;
|
|
798
|
+
extensions?: Record<string, unknown> | undefined;
|
|
799
|
+
personality?: string | null | undefined;
|
|
800
|
+
scenario?: string | undefined;
|
|
801
|
+
first_mes?: string | undefined;
|
|
802
|
+
mes_example?: string | null | undefined;
|
|
803
|
+
creator_notes?: string | undefined;
|
|
804
|
+
system_prompt?: string | undefined;
|
|
805
|
+
post_history_instructions?: string | undefined;
|
|
806
|
+
alternate_greetings?: string[] | undefined;
|
|
807
|
+
character_book?: {
|
|
808
|
+
entries: {
|
|
809
|
+
keys: string[];
|
|
810
|
+
content: string;
|
|
811
|
+
enabled: boolean;
|
|
812
|
+
insertion_order: number;
|
|
813
|
+
name?: string | undefined;
|
|
814
|
+
extensions?: Record<string, unknown> | undefined;
|
|
815
|
+
case_sensitive?: boolean | undefined;
|
|
816
|
+
priority?: number | undefined;
|
|
817
|
+
id?: number | undefined;
|
|
818
|
+
comment?: string | undefined;
|
|
819
|
+
selective?: boolean | undefined;
|
|
820
|
+
secondary_keys?: string[] | undefined;
|
|
821
|
+
constant?: boolean | undefined;
|
|
822
|
+
position?: "before_char" | "after_char" | undefined;
|
|
823
|
+
}[];
|
|
824
|
+
name?: string | undefined;
|
|
825
|
+
description?: string | undefined;
|
|
826
|
+
scan_depth?: number | undefined;
|
|
827
|
+
token_budget?: number | undefined;
|
|
828
|
+
recursive_scanning?: boolean | undefined;
|
|
829
|
+
extensions?: Record<string, unknown> | undefined;
|
|
830
|
+
} | null | undefined;
|
|
831
|
+
tags?: string[] | undefined;
|
|
832
|
+
creator?: string | undefined;
|
|
833
|
+
character_version?: string | undefined;
|
|
834
|
+
}>;
|
|
835
|
+
/**
|
|
836
|
+
* Character Card v2 data structure
|
|
837
|
+
*/
|
|
838
|
+
export type CCv2Data = z.infer<typeof CCv2DataSchema>;
|
|
839
|
+
/**
|
|
840
|
+
* Format Detection
|
|
841
|
+
*
|
|
842
|
+
* Detect card specification version from JSON data.
|
|
843
|
+
*/
|
|
844
|
+
/**
|
|
845
|
+
* Result from detailed spec detection
|
|
846
|
+
*/
|
|
847
|
+
export interface SpecDetectionResult {
|
|
848
|
+
/** Detected spec version */
|
|
849
|
+
spec: Spec | null;
|
|
850
|
+
/** Confidence level of detection */
|
|
851
|
+
confidence: "high" | "medium" | "low";
|
|
852
|
+
/** What fields/values indicated this spec */
|
|
853
|
+
indicators: string[];
|
|
854
|
+
/** Anomalies or inconsistencies detected */
|
|
855
|
+
warnings: string[];
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Detect card spec version from parsed JSON
|
|
859
|
+
* Returns 'v2', 'v3', or null if not recognized
|
|
860
|
+
*/
|
|
861
|
+
export declare function detectSpec(data: unknown): Spec | null;
|
|
862
|
+
/**
|
|
863
|
+
* Loader Types
|
|
864
|
+
*
|
|
865
|
+
* Types for the universal card loader API.
|
|
866
|
+
*/
|
|
867
|
+
/**
|
|
868
|
+
* Detected container format (the file type)
|
|
869
|
+
*/
|
|
870
|
+
export type ContainerFormat = "png" | "charx" | "voxta" | "json" | "lorebook" | "unknown";
|
|
871
|
+
/**
|
|
872
|
+
* Asset extracted from a card
|
|
873
|
+
*/
|
|
874
|
+
export interface ExtractedAsset {
|
|
875
|
+
/** Asset name/identifier */
|
|
876
|
+
name: string;
|
|
877
|
+
/** Asset type */
|
|
878
|
+
type: "icon" | "emotion" | "background" | "sound" | "data" | "unknown";
|
|
879
|
+
/** File extension */
|
|
880
|
+
ext: string;
|
|
881
|
+
/** Binary data */
|
|
882
|
+
data: BinaryData;
|
|
883
|
+
/** Asset path within archive (if applicable) */
|
|
884
|
+
path?: string;
|
|
885
|
+
/** Whether this is the main/primary asset */
|
|
886
|
+
isMain?: boolean;
|
|
887
|
+
/** Associated character ID (for multi-character packages) */
|
|
888
|
+
characterId?: string;
|
|
889
|
+
/** Additional tags */
|
|
890
|
+
tags?: string[];
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Result of parsing a character card
|
|
894
|
+
*/
|
|
895
|
+
export interface ParseResult {
|
|
896
|
+
/** Normalized card data in CCv3 format */
|
|
897
|
+
card: CCv3Data;
|
|
898
|
+
/** Extracted assets */
|
|
899
|
+
assets: ExtractedAsset[];
|
|
900
|
+
/** Original container format */
|
|
901
|
+
containerFormat: ContainerFormat;
|
|
902
|
+
/** Detected spec version */
|
|
903
|
+
spec: Spec;
|
|
904
|
+
/** Original source format indicator */
|
|
905
|
+
sourceFormat: SourceFormat;
|
|
906
|
+
/** The raw JSON object before normalization */
|
|
907
|
+
originalShape: unknown;
|
|
908
|
+
/** Raw JSON string (if available) */
|
|
909
|
+
rawJson?: string;
|
|
910
|
+
/** Original file buffer */
|
|
911
|
+
rawBuffer: BinaryData;
|
|
912
|
+
/** Additional metadata from container */
|
|
913
|
+
metadata?: {
|
|
914
|
+
/** Character ID (for Voxta/CharX) */
|
|
915
|
+
characterId?: string;
|
|
916
|
+
/** Package ID (for Voxta) */
|
|
917
|
+
packageId?: string;
|
|
918
|
+
/** Creation date */
|
|
919
|
+
dateCreated?: string;
|
|
920
|
+
/** Modification date */
|
|
921
|
+
dateModified?: string;
|
|
922
|
+
/** Risu module.risum binary (opaque, preserved for round-trip) */
|
|
923
|
+
moduleRisum?: BinaryData;
|
|
924
|
+
};
|
|
925
|
+
/** Non-fatal warnings encountered during parsing */
|
|
926
|
+
warnings?: string[];
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Options for the parseCard function
|
|
930
|
+
*/
|
|
931
|
+
export interface ParseOptions {
|
|
932
|
+
/** Maximum file size to process (default: 50MB) */
|
|
933
|
+
maxFileSize?: number;
|
|
934
|
+
/** Maximum individual asset size (default: 50MB) */
|
|
935
|
+
maxAssetSize?: number;
|
|
936
|
+
/** Maximum total size for archives (default: 500MB) */
|
|
937
|
+
maxTotalSize?: number;
|
|
938
|
+
/** Whether to extract assets (default: true) */
|
|
939
|
+
extractAssets?: boolean;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Detection result
|
|
943
|
+
*/
|
|
944
|
+
export interface DetectionResult {
|
|
945
|
+
/** Detected container format */
|
|
946
|
+
format: ContainerFormat;
|
|
947
|
+
/** Confidence level */
|
|
948
|
+
confidence: "high" | "medium" | "low";
|
|
949
|
+
/** Reason for detection */
|
|
950
|
+
reason: string;
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Format Detector
|
|
954
|
+
*
|
|
955
|
+
* Detects the container format of character card data.
|
|
956
|
+
*/
|
|
957
|
+
/**
|
|
958
|
+
* Detect the container format of data
|
|
959
|
+
*/
|
|
960
|
+
export declare function detectFormat(data: BinaryData): DetectionResult;
|
|
961
|
+
/**
|
|
962
|
+
* Universal Card Loader
|
|
963
|
+
*
|
|
964
|
+
* Loads character cards from any supported format.
|
|
965
|
+
*/
|
|
966
|
+
/**
|
|
967
|
+
* Parse a character card from any supported format
|
|
968
|
+
*
|
|
969
|
+
* @param data - Binary data of the card file
|
|
970
|
+
* @param options - Parsing options
|
|
971
|
+
* @returns ParseResult with normalized card and extracted assets
|
|
972
|
+
*/
|
|
973
|
+
export declare function parseCard(data: BinaryData, options?: ParseOptions): ParseResult;
|
|
974
|
+
/**
|
|
975
|
+
* Async version of parseCard
|
|
976
|
+
*/
|
|
977
|
+
export declare function parseCardAsync(data: BinaryData, options?: ParseOptions): Promise<ParseResult>;
|
|
978
|
+
/**
|
|
979
|
+
* Exporter Types
|
|
980
|
+
*
|
|
981
|
+
* Types for the universal card exporter API.
|
|
982
|
+
*/
|
|
983
|
+
/**
|
|
984
|
+
* Target export format
|
|
985
|
+
*/
|
|
986
|
+
export type ExportFormat = "png" | "charx" | "voxta";
|
|
987
|
+
/**
|
|
988
|
+
* Asset to include in export
|
|
989
|
+
*/
|
|
990
|
+
export interface ExportAsset {
|
|
991
|
+
/** Asset name/identifier */
|
|
992
|
+
name: string;
|
|
993
|
+
/** Asset type */
|
|
994
|
+
type: "icon" | "emotion" | "background" | "sound" | "data" | "custom";
|
|
995
|
+
/** File extension */
|
|
996
|
+
ext: string;
|
|
997
|
+
/** Binary data */
|
|
998
|
+
data: BinaryData;
|
|
999
|
+
/** Whether this is the main/primary asset (used for PNG embedding) */
|
|
1000
|
+
isMain?: boolean;
|
|
1001
|
+
/** Original path or source identifier (e.g., pngchunk:0) */
|
|
1002
|
+
path?: string;
|
|
1003
|
+
/** Additional tags for categorization */
|
|
1004
|
+
tags?: string[];
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Loss report for export
|
|
1008
|
+
*/
|
|
1009
|
+
export interface ExportLossReport {
|
|
1010
|
+
/** Fields that will be lost */
|
|
1011
|
+
lostFields: string[];
|
|
1012
|
+
/** Assets that cannot be exported */
|
|
1013
|
+
lostAssets: string[];
|
|
1014
|
+
/** Warnings about potential issues */
|
|
1015
|
+
warnings: string[];
|
|
1016
|
+
/** Target format */
|
|
1017
|
+
targetFormat: ExportFormat;
|
|
1018
|
+
/** Whether export is lossless */
|
|
1019
|
+
isLossless: boolean;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Common export options
|
|
1023
|
+
*/
|
|
1024
|
+
export interface ExportOptionsBase {
|
|
1025
|
+
/** Whether to check for loss before export (default: true) */
|
|
1026
|
+
checkLoss?: boolean;
|
|
1027
|
+
/** Compression level for ZIP-based formats (0-9, default: 6) */
|
|
1028
|
+
compressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* PNG export options
|
|
1032
|
+
*/
|
|
1033
|
+
export interface PngExportOptions extends ExportOptionsBase {
|
|
1034
|
+
/** Chunk key to use (default: 'chara' for v2 compat, 'ccv3' for v3) */
|
|
1035
|
+
chunkKey?: "chara" | "ccv3" | "chara_card_v3";
|
|
1036
|
+
/** Whether to use zTXt (compressed) chunk (default: true for large cards) */
|
|
1037
|
+
useCompression?: boolean;
|
|
1038
|
+
/** Export as v2 format for maximum compatibility (default: false) */
|
|
1039
|
+
exportAsV2?: boolean;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* CharX export options
|
|
1043
|
+
*/
|
|
1044
|
+
export interface CharxExportOptions extends ExportOptionsBase {
|
|
1045
|
+
/** Target spec: 'v3' = standard, 'risu' = include x_meta */
|
|
1046
|
+
spec?: "v3" | "risu";
|
|
1047
|
+
/** Include readme.txt (default: false) */
|
|
1048
|
+
includeReadme?: boolean;
|
|
1049
|
+
/** Emit x_meta for image assets (default: false, auto-enabled for risu spec) */
|
|
1050
|
+
emitXMeta?: boolean;
|
|
1051
|
+
/** Risu module.risum binary to include (opaque, preserved from read) */
|
|
1052
|
+
moduleRisum?: BinaryData;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Voxta export options
|
|
1056
|
+
*/
|
|
1057
|
+
export interface VoxtaExportOptions extends ExportOptionsBase {
|
|
1058
|
+
/** Character ID to use (auto-generated if not provided) */
|
|
1059
|
+
characterId?: string;
|
|
1060
|
+
/** Package ID to use (auto-generated if not provided) */
|
|
1061
|
+
packageId?: string;
|
|
1062
|
+
/** Include package.json metadata (default: false) */
|
|
1063
|
+
includePackageJson?: boolean;
|
|
1064
|
+
}
|
|
1065
|
+
/**
|
|
1066
|
+
* Result of exporting a card
|
|
1067
|
+
*/
|
|
1068
|
+
export interface ExportResult {
|
|
1069
|
+
/** The exported binary data */
|
|
1070
|
+
buffer: BinaryData;
|
|
1071
|
+
/** Target format that was used */
|
|
1072
|
+
format: ExportFormat;
|
|
1073
|
+
/** Suggested filename */
|
|
1074
|
+
filename: string;
|
|
1075
|
+
/** MIME type for the export */
|
|
1076
|
+
mimeType: string;
|
|
1077
|
+
/** Number of assets included */
|
|
1078
|
+
assetCount: number;
|
|
1079
|
+
/** Total size in bytes */
|
|
1080
|
+
totalSize: number;
|
|
1081
|
+
/** Loss report (if checkLoss was enabled) */
|
|
1082
|
+
lossReport?: ExportLossReport;
|
|
1083
|
+
}
|
|
1084
|
+
/**
|
|
1085
|
+
* Universal Card Exporter
|
|
1086
|
+
*
|
|
1087
|
+
* Exports character cards to any supported format.
|
|
1088
|
+
*/
|
|
1089
|
+
/**
|
|
1090
|
+
* Options for exportCard function
|
|
1091
|
+
*/
|
|
1092
|
+
export interface ExportCardOptions {
|
|
1093
|
+
/** Target format */
|
|
1094
|
+
format: ExportFormat;
|
|
1095
|
+
/** Format-specific options */
|
|
1096
|
+
png?: PngExportOptions;
|
|
1097
|
+
charx?: CharxExportOptions;
|
|
1098
|
+
voxta?: VoxtaExportOptions;
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Export a character card to any supported format
|
|
1102
|
+
*
|
|
1103
|
+
* @param card - CCv3 card data to export
|
|
1104
|
+
* @param assets - Assets to include in export
|
|
1105
|
+
* @param options - Export options including target format
|
|
1106
|
+
* @returns ExportResult with buffer and metadata
|
|
1107
|
+
*/
|
|
1108
|
+
export declare function exportCard(card: CCv3Data, assets: ExportAsset[], options: ExportCardOptions): ExportResult;
|
|
1109
|
+
/**
|
|
1110
|
+
* Export Loss Checker
|
|
1111
|
+
*
|
|
1112
|
+
* Analyzes what data would be lost when exporting to different formats.
|
|
1113
|
+
*/
|
|
1114
|
+
/**
|
|
1115
|
+
* Check what would be lost when exporting to a specific format
|
|
1116
|
+
*/
|
|
1117
|
+
export declare function checkExportLoss(card: CCv3Data, assets: ExportAsset[], targetFormat: ExportFormat): ExportLossReport;
|
|
1118
|
+
|
|
1119
|
+
export {};
|