@arisutalk/character-spec 0.0.11 → 0.0.13
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/types/v0/Character/Assets.d.ts +21 -0
- package/dist/types/v0/Character/Assets.d.ts.map +1 -0
- package/dist/types/v0/Character/Character.d.ts +161 -0
- package/dist/types/v0/Character/Character.d.ts.map +1 -0
- package/dist/types/v0/Character/Chat.d.ts +37 -0
- package/dist/types/v0/Character/Chat.d.ts.map +1 -0
- package/dist/types/v0/Character/Lorebook.d.ts +101 -0
- package/dist/types/v0/Character/Lorebook.d.ts.map +1 -0
- package/dist/types/v0/Character/Message.d.ts +40 -0
- package/dist/types/v0/Character/Message.d.ts.map +1 -0
- package/dist/types/v0/Character/Meta.d.ts +9 -0
- package/dist/types/v0/Character/Meta.d.ts.map +1 -0
- package/dist/types/v0/Character/index.d.ts +12 -0
- package/dist/types/v0/Character/index.d.ts.map +1 -0
- package/dist/types/v0/Executables/Executable.d.ts +73 -0
- package/dist/types/v0/Executables/Executable.d.ts.map +1 -0
- package/dist/types/v0/Executables/ReplaceHook.d.ts +93 -0
- package/dist/types/v0/Executables/ReplaceHook.d.ts.map +1 -0
- package/dist/types/v0/Executables/index.d.ts +3 -0
- package/dist/types/v0/Executables/index.d.ts.map +1 -0
- package/dist/types/v0/index.d.ts +4 -0
- package/dist/types/v0/index.d.ts.map +1 -0
- package/dist/types/v0/utils.d.ts +38 -0
- package/dist/types/v0/utils.d.ts.map +1 -0
- package/dist/v0/Character/Assets.d.ts +19 -3
- package/dist/v0/Character/Assets.js +2 -2
- package/dist/v0/Character/Assets.js.map +1 -1
- package/dist/v0/Character/Character.d.ts +153 -3
- package/dist/v0/Character/Chat.d.ts +32 -2
- package/dist/v0/Character/Lorebook.d.ts +70 -4
- package/dist/v0/Character/Message.d.ts +35 -3
- package/dist/v0/Character/Meta.d.ts +15 -2
- package/dist/v0/Character/Meta.js +1 -1
- package/dist/v0/Character/Meta.js.map +1 -1
- package/dist/v0/Executables/Executable.d.ts +70 -2
- package/dist/v0/Executables/ReplaceHook.d.ts +93 -4
- package/dist/v0/utils.d.ts +21 -4
- package/package.json +2 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AssetEntitySchema: z.ZodObject<{
|
|
3
|
+
mimeType: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
/**
|
|
8
|
+
* @see {@link AssetsSetting}
|
|
9
|
+
*/
|
|
10
|
+
export declare const AssetsSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
11
|
+
assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
12
|
+
mimeType: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
15
|
+
}, z.core.$strip>>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
/**
|
|
18
|
+
* This is the settings for character assets.
|
|
19
|
+
*/
|
|
20
|
+
export type AssetsSetting = z.infer<typeof AssetsSettingSchema>;
|
|
21
|
+
//# sourceMappingURL=Assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Assets.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Character/Assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;iBAiBxB,CAAC;AAEP;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;kBAS4B,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The prompt data for a character.
|
|
4
|
+
* It is used to generate the character's persona.
|
|
5
|
+
* All of parameters are for AI prompt, and scriptable.
|
|
6
|
+
*/
|
|
7
|
+
export type CharacterPromptData = z.infer<typeof CharacterPromptDataSchema>;
|
|
8
|
+
export declare const CharacterPromptDataSchema: z.ZodObject<{
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
authorsNote: z.ZodOptional<z.ZodString>;
|
|
11
|
+
lorebook: z.ZodPrefault<z.ZodObject<{
|
|
12
|
+
config: z.ZodPrefault<z.ZodObject<{
|
|
13
|
+
tokenLimit: z.ZodOptional<z.ZodInt>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
data: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
condition: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"regex_match">;
|
|
20
|
+
regexPattern: z.ZodString;
|
|
21
|
+
regexFlags: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"plain_text_match">;
|
|
24
|
+
text: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
type: z.ZodLiteral<"always">;
|
|
27
|
+
}, z.core.$strip>], "type">>>;
|
|
28
|
+
multipleConditionResolveStrategy: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
any: "any";
|
|
30
|
+
all: "all";
|
|
31
|
+
}>>;
|
|
32
|
+
content: z.ZodString;
|
|
33
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
}, z.core.$strip>>>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const CharacterSchema: z.ZodObject<{
|
|
39
|
+
specVersion: z.ZodLiteral<0>;
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
description: z.ZodString;
|
|
43
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
44
|
+
prompt: z.ZodObject<{
|
|
45
|
+
description: z.ZodString;
|
|
46
|
+
authorsNote: z.ZodOptional<z.ZodString>;
|
|
47
|
+
lorebook: z.ZodPrefault<z.ZodObject<{
|
|
48
|
+
config: z.ZodPrefault<z.ZodObject<{
|
|
49
|
+
tokenLimit: z.ZodOptional<z.ZodInt>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
data: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
52
|
+
id: z.ZodString;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
condition: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
|
+
type: z.ZodLiteral<"regex_match">;
|
|
56
|
+
regexPattern: z.ZodString;
|
|
57
|
+
regexFlags: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"plain_text_match">;
|
|
60
|
+
text: z.ZodString;
|
|
61
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
+
type: z.ZodLiteral<"always">;
|
|
63
|
+
}, z.core.$strip>], "type">>>;
|
|
64
|
+
multipleConditionResolveStrategy: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
any: "any";
|
|
66
|
+
all: "all";
|
|
67
|
+
}>>;
|
|
68
|
+
content: z.ZodString;
|
|
69
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
}, z.core.$strip>>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
executables: z.ZodPrefault<z.ZodObject<{
|
|
75
|
+
runtimeSetting: z.ZodPrefault<z.ZodObject<{
|
|
76
|
+
mem: z.ZodOptional<z.ZodInt>;
|
|
77
|
+
timeout: z.ZodDefault<z.ZodInt>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
replaceHooks: z.ZodPrefault<z.ZodObject<{
|
|
80
|
+
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
81
|
+
input: z.ZodString;
|
|
82
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"regex">;
|
|
84
|
+
flag: z.ZodString;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
type: z.ZodLiteral<"string">;
|
|
87
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
89
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
90
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
91
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
92
|
+
}, z.core.$strip>>>;
|
|
93
|
+
output: z.ZodString;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
95
|
+
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
96
|
+
input: z.ZodString;
|
|
97
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
98
|
+
type: z.ZodLiteral<"regex">;
|
|
99
|
+
flag: z.ZodString;
|
|
100
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
101
|
+
type: z.ZodLiteral<"string">;
|
|
102
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
103
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
104
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
105
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
106
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
107
|
+
}, z.core.$strip>>>;
|
|
108
|
+
output: z.ZodString;
|
|
109
|
+
}, z.core.$strip>>>;
|
|
110
|
+
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
111
|
+
input: z.ZodString;
|
|
112
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
113
|
+
type: z.ZodLiteral<"regex">;
|
|
114
|
+
flag: z.ZodString;
|
|
115
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
116
|
+
type: z.ZodLiteral<"string">;
|
|
117
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
118
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
119
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
120
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
121
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strip>>>;
|
|
123
|
+
output: z.ZodString;
|
|
124
|
+
}, z.core.$strip>>>;
|
|
125
|
+
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
126
|
+
input: z.ZodString;
|
|
127
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
128
|
+
type: z.ZodLiteral<"regex">;
|
|
129
|
+
flag: z.ZodString;
|
|
130
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"string">;
|
|
132
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
133
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
134
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
135
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
136
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
137
|
+
}, z.core.$strip>>>;
|
|
138
|
+
output: z.ZodString;
|
|
139
|
+
}, z.core.$strip>>>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
}, z.core.$strip>>;
|
|
142
|
+
metadata: z.ZodPrefault<z.ZodObject<{
|
|
143
|
+
author: z.ZodOptional<z.ZodString>;
|
|
144
|
+
license: z.ZodDefault<z.ZodString>;
|
|
145
|
+
version: z.ZodOptional<z.ZodString>;
|
|
146
|
+
distributedOn: z.ZodOptional<z.ZodString>;
|
|
147
|
+
additionalInfo: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
assets: z.ZodPrefault<z.ZodObject<{
|
|
150
|
+
assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
151
|
+
mimeType: z.ZodString;
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
154
|
+
}, z.core.$strip>>>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
/**
|
|
158
|
+
* Represents a specific AI character personality.
|
|
159
|
+
*/
|
|
160
|
+
export type Character = z.infer<typeof CharacterSchema>;
|
|
161
|
+
//# sourceMappingURL=Character.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Character.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Character/Character.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgBhC,CAAC;AAEP,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoCiD,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* @see {@link Chat}
|
|
4
|
+
*/
|
|
5
|
+
export declare const ChatSchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
characterId: z.ZodString;
|
|
8
|
+
title: z.ZodDefault<z.ZodString>;
|
|
9
|
+
createdAt: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
updatedAt: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
lorebook: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
condition: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"regex_match">;
|
|
16
|
+
regexPattern: z.ZodString;
|
|
17
|
+
regexFlags: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"plain_text_match">;
|
|
20
|
+
text: z.ZodString;
|
|
21
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"always">;
|
|
23
|
+
}, z.core.$strip>], "type">>>;
|
|
24
|
+
multipleConditionResolveStrategy: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
any: "any";
|
|
26
|
+
all: "all";
|
|
27
|
+
}>>;
|
|
28
|
+
content: z.ZodString;
|
|
29
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
}, z.core.$strip>>>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
/**
|
|
34
|
+
* Represents a chat session with a character.
|
|
35
|
+
*/
|
|
36
|
+
export type Chat = z.infer<typeof ChatSchema>;
|
|
37
|
+
//# sourceMappingURL=Chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Character/Chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBkD,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Lorebook condition detail schemas organized by type.
|
|
4
|
+
* @see {@link LorebookConditionSchema}
|
|
5
|
+
*/
|
|
6
|
+
export declare const LorebookConditionDetails: {
|
|
7
|
+
readonly regex: z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"regex_match">;
|
|
9
|
+
regexPattern: z.ZodString;
|
|
10
|
+
regexFlags: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
readonly plainText: z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"plain_text_match">;
|
|
14
|
+
text: z.ZodString;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
readonly always: z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"always">;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The condition for the lorebook to be activated.
|
|
22
|
+
*/
|
|
23
|
+
export declare const LorebookConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
24
|
+
type: z.ZodLiteral<"regex_match">;
|
|
25
|
+
regexPattern: z.ZodString;
|
|
26
|
+
regexFlags: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"plain_text_match">;
|
|
29
|
+
text: z.ZodString;
|
|
30
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"always">;
|
|
32
|
+
}, z.core.$strip>], "type">;
|
|
33
|
+
/**
|
|
34
|
+
* The condition for the lorebook to be activated.
|
|
35
|
+
* @see {@link LorebookConditionSchema}
|
|
36
|
+
*/
|
|
37
|
+
export type LorebookCondition = z.infer<typeof LorebookConditionSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* @see {@link LorebookEntry}
|
|
40
|
+
*/
|
|
41
|
+
export declare const LorebookEntrySchema: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
condition: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
type: z.ZodLiteral<"regex_match">;
|
|
46
|
+
regexPattern: z.ZodString;
|
|
47
|
+
regexFlags: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
+
type: z.ZodLiteral<"plain_text_match">;
|
|
50
|
+
text: z.ZodString;
|
|
51
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"always">;
|
|
53
|
+
}, z.core.$strip>], "type">>>;
|
|
54
|
+
multipleConditionResolveStrategy: z.ZodOptional<z.ZodEnum<{
|
|
55
|
+
any: "any";
|
|
56
|
+
all: "all";
|
|
57
|
+
}>>;
|
|
58
|
+
content: z.ZodString;
|
|
59
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* A lorebook is a collection of lorebooks.
|
|
64
|
+
* Lorebook is a small part of prompts which is activated by session's text matching.
|
|
65
|
+
*/
|
|
66
|
+
export type LorebookEntry = z.infer<typeof LorebookEntrySchema>;
|
|
67
|
+
/**
|
|
68
|
+
* @see {@link LorebookData}
|
|
69
|
+
*/
|
|
70
|
+
export declare const LorebookDataSchema: z.ZodPrefault<z.ZodObject<{
|
|
71
|
+
config: z.ZodPrefault<z.ZodObject<{
|
|
72
|
+
tokenLimit: z.ZodOptional<z.ZodInt>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
data: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
condition: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<"regex_match">;
|
|
79
|
+
regexPattern: z.ZodString;
|
|
80
|
+
regexFlags: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
82
|
+
type: z.ZodLiteral<"plain_text_match">;
|
|
83
|
+
text: z.ZodString;
|
|
84
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
+
type: z.ZodLiteral<"always">;
|
|
86
|
+
}, z.core.$strip>], "type">>>;
|
|
87
|
+
multipleConditionResolveStrategy: z.ZodOptional<z.ZodEnum<{
|
|
88
|
+
any: "any";
|
|
89
|
+
all: "all";
|
|
90
|
+
}>>;
|
|
91
|
+
content: z.ZodString;
|
|
92
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
94
|
+
}, z.core.$strip>>>;
|
|
95
|
+
}, z.core.$strip>>;
|
|
96
|
+
/**
|
|
97
|
+
* Object containing all data for the lorebook.
|
|
98
|
+
* It's meant to be stored in the database and many other places.
|
|
99
|
+
*/
|
|
100
|
+
export type LorebookData = z.infer<typeof LorebookDataSchema>;
|
|
101
|
+
//# sourceMappingURL=Lorebook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lorebook.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Character/Lorebook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;CA+B3B,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;2BAIlC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;iBAsC1B,CAAC;AAEP;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;kBA2Bd,CAAC;AAElB;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the role of the message sender.
|
|
4
|
+
*/
|
|
5
|
+
export declare const RoleSchema: z.ZodEnum<{
|
|
6
|
+
user: "user";
|
|
7
|
+
assistant: "assistant";
|
|
8
|
+
system: "system";
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* @see {@link Message}
|
|
12
|
+
*/
|
|
13
|
+
export declare const MessageSchema: z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
chatId: z.ZodString;
|
|
16
|
+
role: z.ZodEnum<{
|
|
17
|
+
user: "user";
|
|
18
|
+
assistant: "assistant";
|
|
19
|
+
system: "system";
|
|
20
|
+
}>;
|
|
21
|
+
content: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
|
+
type: z.ZodLiteral<"text">;
|
|
23
|
+
data: z.ZodString;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"file">;
|
|
26
|
+
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
27
|
+
mimeType: z.ZodString;
|
|
28
|
+
}, z.core.$strip>], "type">;
|
|
29
|
+
timestamp: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
inlays: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
31
|
+
mimeType: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
34
|
+
}, z.core.$strip>>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
/**
|
|
37
|
+
* Represents a single message in a chat history.
|
|
38
|
+
*/
|
|
39
|
+
export type Message = z.infer<typeof MessageSchema>;
|
|
40
|
+
//# sourceMappingURL=Message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Character/Message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,UAAU;;;;EAEiD,CAAC;AAyBzE;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;iBA6BkD,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const MetaSchema: z.ZodPrefault<z.ZodObject<{
|
|
3
|
+
author: z.ZodOptional<z.ZodString>;
|
|
4
|
+
license: z.ZodDefault<z.ZodString>;
|
|
5
|
+
version: z.ZodOptional<z.ZodString>;
|
|
6
|
+
distributedOn: z.ZodOptional<z.ZodString>;
|
|
7
|
+
additionalInfo: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
//# sourceMappingURL=Meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Meta.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Character/Meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,UAAU;;;;;;kBAqC4C,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Represents the character specification for ArisuTalk.
|
|
3
|
+
* Includes all the necessary types for character.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export * from './Assets';
|
|
7
|
+
export * from './Character';
|
|
8
|
+
export * from './Chat';
|
|
9
|
+
export * from './Lorebook';
|
|
10
|
+
export * from './Message';
|
|
11
|
+
export * from './Meta';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Character/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* This is the script for character. It includes hook, script settings, something else.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
6
|
+
runtimeSetting: z.ZodPrefault<z.ZodObject<{
|
|
7
|
+
mem: z.ZodOptional<z.ZodInt>;
|
|
8
|
+
timeout: z.ZodDefault<z.ZodInt>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
replaceHooks: z.ZodPrefault<z.ZodObject<{
|
|
11
|
+
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
12
|
+
input: z.ZodString;
|
|
13
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"regex">;
|
|
15
|
+
flag: z.ZodString;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"string">;
|
|
18
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
20
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strip>>>;
|
|
24
|
+
output: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
26
|
+
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
27
|
+
input: z.ZodString;
|
|
28
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
29
|
+
type: z.ZodLiteral<"regex">;
|
|
30
|
+
flag: z.ZodString;
|
|
31
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"string">;
|
|
33
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
34
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
35
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
37
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
output: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>>;
|
|
41
|
+
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
42
|
+
input: z.ZodString;
|
|
43
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"regex">;
|
|
45
|
+
flag: z.ZodString;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"string">;
|
|
48
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
50
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
52
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
53
|
+
}, z.core.$strip>>>;
|
|
54
|
+
output: z.ZodString;
|
|
55
|
+
}, z.core.$strip>>>;
|
|
56
|
+
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
57
|
+
input: z.ZodString;
|
|
58
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"regex">;
|
|
60
|
+
flag: z.ZodString;
|
|
61
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
+
type: z.ZodLiteral<"string">;
|
|
63
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
65
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
66
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
output: z.ZodString;
|
|
70
|
+
}, z.core.$strip>>>;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
//# sourceMappingURL=Executable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Executable.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Executables/Executable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2B1B,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ReplaceHookMetaSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"regex">;
|
|
4
|
+
flag: z.ZodString;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"string">;
|
|
7
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
9
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strip>>>;
|
|
13
|
+
export declare const ReplaceHookEntitySchema: z.ZodObject<{
|
|
14
|
+
input: z.ZodString;
|
|
15
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"regex">;
|
|
17
|
+
flag: z.ZodString;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"string">;
|
|
20
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
21
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
22
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
}, z.core.$strip>>>;
|
|
26
|
+
output: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
/**
|
|
29
|
+
* Replace hooks. It's technically RegExp for request, display, and response.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
32
|
+
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
|
+
input: z.ZodString;
|
|
34
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"regex">;
|
|
36
|
+
flag: z.ZodString;
|
|
37
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
38
|
+
type: z.ZodLiteral<"string">;
|
|
39
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
40
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
41
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
44
|
+
}, z.core.$strip>>>;
|
|
45
|
+
output: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>>;
|
|
47
|
+
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
48
|
+
input: z.ZodString;
|
|
49
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"regex">;
|
|
51
|
+
flag: z.ZodString;
|
|
52
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
+
type: z.ZodLiteral<"string">;
|
|
54
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
56
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
58
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
59
|
+
}, z.core.$strip>>>;
|
|
60
|
+
output: z.ZodString;
|
|
61
|
+
}, z.core.$strip>>>;
|
|
62
|
+
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
63
|
+
input: z.ZodString;
|
|
64
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"regex">;
|
|
66
|
+
flag: z.ZodString;
|
|
67
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"string">;
|
|
69
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
70
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
71
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
72
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
73
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
74
|
+
}, z.core.$strip>>>;
|
|
75
|
+
output: z.ZodString;
|
|
76
|
+
}, z.core.$strip>>>;
|
|
77
|
+
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
78
|
+
input: z.ZodString;
|
|
79
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<readonly [z.ZodObject<{
|
|
80
|
+
type: z.ZodLiteral<"regex">;
|
|
81
|
+
flag: z.ZodString;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"string">;
|
|
84
|
+
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
85
|
+
}, z.core.$strip>], "type">, z.ZodPrefault<z.ZodObject<{
|
|
86
|
+
isInputPatternScripted: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
+
isOutputScripted: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
89
|
+
}, z.core.$strip>>>;
|
|
90
|
+
output: z.ZodString;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
//# sourceMappingURL=ReplaceHook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReplaceHook.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Executables/ReplaceHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,qBAAqB;;;;;;;;;;mBAsB5B,CAAC;AAEP,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;iBAUlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/v0/Executables/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/v0/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* This type is used to represent the URL of an image.
|
|
4
|
+
* It is used to validate the URL of an image.
|
|
5
|
+
* This should only be used in exported character. When importing the character, it should be converted to `local:`.
|
|
6
|
+
* If its protocol is `local:`, it means the image is stored in the browser, usually OpFS.
|
|
7
|
+
* Otherwise, it should be a valid URL which can be fetched in browser.
|
|
8
|
+
* Don't use `data:` URL for large images, as it can bloat the character spec size.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare const ImageURLSchema: z.ZodURL;
|
|
12
|
+
/**
|
|
13
|
+
* Binary data represented as Uint8Array.
|
|
14
|
+
* Useful for local file assets.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Uint8ArraySchema: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
|
|
17
|
+
/**
|
|
18
|
+
* Represents a file, either as a URL or as binary data (Uint8Array).
|
|
19
|
+
* Used for file assets.
|
|
20
|
+
*/
|
|
21
|
+
export declare const FileSchema: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
22
|
+
/**
|
|
23
|
+
* Custom validator to ensure all objects in the array have unique values for a specific key.
|
|
24
|
+
* @param key The key to check for uniqueness. It should be a string key of the object.
|
|
25
|
+
* @returns A predicate function for `z.refine`.
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const schema = z.array(z.object({ name: z.string() })).refine(unique("name"), { message: "Not unique" });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function unique<const ARR extends {
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}>(key: keyof ARR): (i: ARR[]) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Zod custom schema to ensure the value is a positive integer.
|
|
36
|
+
*/
|
|
37
|
+
export declare const positiveInteger: z.ZodInt;
|
|
38
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/v0/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,UAGzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,+DAG3B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU,gGAUjB,CAAC;AACP;;;;;;;;GAQG;AACH,wBAAgB,MAAM,CAClB,KAAK,CAAC,GAAG,SAAS;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,EACH,GAAG,EAAE,MAAM,GAAG,IACJ,GAAG,GAAG,EAAE,aAGnB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,UAGyB,CAAC"}
|