@arisutalk/character-spec 0.0.12 → 0.0.14
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 +4 -4
- package/dist/types/v0/Character/Assets.d.ts.map +1 -1
- package/dist/types/v0/Character/Character.d.ts +14 -14
- package/dist/types/v0/Character/Chat.d.ts +2 -2
- package/dist/types/v0/Character/Lorebook.d.ts +4 -4
- package/dist/types/v0/Character/Lorebook.d.ts.map +1 -1
- package/dist/types/v0/Character/Message.d.ts +1 -1
- package/dist/types/v0/Character/Meta.d.ts +2 -2
- package/dist/types/v0/Character/Meta.d.ts.map +1 -1
- package/dist/types/v0/Executables/Executable.d.ts +4 -4
- package/dist/types/v0/Executables/ReplaceHook.d.ts +6 -6
- package/dist/v0/Character/Assets.d.ts +4 -4
- package/dist/v0/Character/Assets.js +2 -2
- package/dist/v0/Character/Assets.js.map +1 -1
- package/dist/v0/Character/Character.d.ts +18 -18
- package/dist/v0/Character/Chat.d.ts +4 -4
- package/dist/v0/Character/Lorebook.d.ts +14 -8
- package/dist/v0/Character/Lorebook.js +4 -4
- package/dist/v0/Character/Lorebook.js.map +1 -1
- package/dist/v0/Character/Message.d.ts +3 -2
- package/dist/v0/Character/Message.js +7 -7
- package/dist/v0/Character/Message.js.map +1 -1
- package/dist/v0/Character/Meta.d.ts +8 -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 +4 -4
- package/dist/v0/Executables/ReplaceHook.d.ts +6 -6
- package/dist/v0/Executables/ReplaceHook.js.map +1 -1
- package/package.json +2 -3
|
@@ -7,13 +7,13 @@ export declare const AssetEntitySchema: z.ZodObject<{
|
|
|
7
7
|
/**
|
|
8
8
|
* @see {@link AssetsSetting}
|
|
9
9
|
*/
|
|
10
|
-
export declare const AssetsSettingSchema: z.ZodObject<{
|
|
11
|
-
assets: z.ZodArray<z.ZodObject<{
|
|
10
|
+
export declare const AssetsSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
11
|
+
assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
12
12
|
mimeType: z.ZodString;
|
|
13
13
|
name: z.ZodString;
|
|
14
14
|
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
15
|
-
}, z.core.$strip
|
|
16
|
-
}, z.core.$strip
|
|
15
|
+
}, z.core.$strip>>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
17
|
/**
|
|
18
18
|
* This is the settings for character assets.
|
|
19
19
|
*/
|
|
@@ -1 +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;;;;;;
|
|
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"}
|
|
@@ -25,13 +25,13 @@ export declare const CharacterPromptDataSchema: z.ZodObject<{
|
|
|
25
25
|
}, z.core.$strip>, z.ZodObject<{
|
|
26
26
|
type: z.ZodLiteral<"always">;
|
|
27
27
|
}, z.core.$strip>], "type">>>;
|
|
28
|
-
multipleConditionResolveStrategy: z.
|
|
28
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
29
29
|
any: "any";
|
|
30
30
|
all: "all";
|
|
31
31
|
}>>;
|
|
32
32
|
content: z.ZodString;
|
|
33
33
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
34
|
-
enabled: z.
|
|
34
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
35
35
|
}, z.core.$strip>>>;
|
|
36
36
|
}, z.core.$strip>>;
|
|
37
37
|
}, z.core.$strip>;
|
|
@@ -61,13 +61,13 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
61
61
|
}, z.core.$strip>, z.ZodObject<{
|
|
62
62
|
type: z.ZodLiteral<"always">;
|
|
63
63
|
}, z.core.$strip>], "type">>>;
|
|
64
|
-
multipleConditionResolveStrategy: z.
|
|
64
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
65
65
|
any: "any";
|
|
66
66
|
all: "all";
|
|
67
67
|
}>>;
|
|
68
68
|
content: z.ZodString;
|
|
69
69
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
70
|
-
enabled: z.
|
|
70
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
71
71
|
}, z.core.$strip>>>;
|
|
72
72
|
}, z.core.$strip>>;
|
|
73
73
|
}, z.core.$strip>;
|
|
@@ -79,7 +79,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
79
79
|
replaceHooks: z.ZodPrefault<z.ZodObject<{
|
|
80
80
|
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
81
81
|
input: z.ZodString;
|
|
82
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
82
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
83
83
|
type: z.ZodLiteral<"regex">;
|
|
84
84
|
flag: z.ZodString;
|
|
85
85
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -94,7 +94,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
94
94
|
}, z.core.$strip>>>;
|
|
95
95
|
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
96
96
|
input: z.ZodString;
|
|
97
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
97
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
98
98
|
type: z.ZodLiteral<"regex">;
|
|
99
99
|
flag: z.ZodString;
|
|
100
100
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -109,7 +109,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
109
109
|
}, z.core.$strip>>>;
|
|
110
110
|
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
111
111
|
input: z.ZodString;
|
|
112
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
112
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
113
113
|
type: z.ZodLiteral<"regex">;
|
|
114
114
|
flag: z.ZodString;
|
|
115
115
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -124,7 +124,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
124
124
|
}, z.core.$strip>>>;
|
|
125
125
|
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
126
126
|
input: z.ZodString;
|
|
127
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
127
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
128
128
|
type: z.ZodLiteral<"regex">;
|
|
129
129
|
flag: z.ZodString;
|
|
130
130
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -139,20 +139,20 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
139
139
|
}, z.core.$strip>>>;
|
|
140
140
|
}, z.core.$strip>>;
|
|
141
141
|
}, z.core.$strip>>;
|
|
142
|
-
metadata: z.ZodObject<{
|
|
142
|
+
metadata: z.ZodPrefault<z.ZodObject<{
|
|
143
143
|
author: z.ZodOptional<z.ZodString>;
|
|
144
144
|
license: z.ZodDefault<z.ZodString>;
|
|
145
145
|
version: z.ZodOptional<z.ZodString>;
|
|
146
146
|
distributedOn: z.ZodOptional<z.ZodString>;
|
|
147
147
|
additionalInfo: z.ZodOptional<z.ZodString>;
|
|
148
|
-
}, z.core.$strip
|
|
149
|
-
assets: z.ZodObject<{
|
|
150
|
-
assets: z.ZodArray<z.ZodObject<{
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
assets: z.ZodPrefault<z.ZodObject<{
|
|
150
|
+
assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
151
151
|
mimeType: z.ZodString;
|
|
152
152
|
name: z.ZodString;
|
|
153
153
|
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
154
|
-
}, z.core.$strip
|
|
155
|
-
}, z.core.$strip
|
|
154
|
+
}, z.core.$strip>>>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
156
|
}, z.core.$strip>;
|
|
157
157
|
/**
|
|
158
158
|
* Represents a specific AI character personality.
|
|
@@ -21,13 +21,13 @@ export declare const ChatSchema: z.ZodObject<{
|
|
|
21
21
|
}, z.core.$strip>, z.ZodObject<{
|
|
22
22
|
type: z.ZodLiteral<"always">;
|
|
23
23
|
}, z.core.$strip>], "type">>>;
|
|
24
|
-
multipleConditionResolveStrategy: z.
|
|
24
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
25
25
|
any: "any";
|
|
26
26
|
all: "all";
|
|
27
27
|
}>>;
|
|
28
28
|
content: z.ZodString;
|
|
29
29
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
enabled: z.
|
|
30
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
31
31
|
}, z.core.$strip>>>>;
|
|
32
32
|
}, z.core.$strip>;
|
|
33
33
|
/**
|
|
@@ -51,13 +51,13 @@ export declare const LorebookEntrySchema: z.ZodObject<{
|
|
|
51
51
|
}, z.core.$strip>, z.ZodObject<{
|
|
52
52
|
type: z.ZodLiteral<"always">;
|
|
53
53
|
}, z.core.$strip>], "type">>>;
|
|
54
|
-
multipleConditionResolveStrategy: z.
|
|
54
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
55
55
|
any: "any";
|
|
56
56
|
all: "all";
|
|
57
57
|
}>>;
|
|
58
58
|
content: z.ZodString;
|
|
59
59
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
60
|
-
enabled: z.
|
|
60
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
61
61
|
}, z.core.$strip>;
|
|
62
62
|
/**
|
|
63
63
|
* A lorebook is a collection of lorebooks.
|
|
@@ -84,13 +84,13 @@ export declare const LorebookDataSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
84
84
|
}, z.core.$strip>, z.ZodObject<{
|
|
85
85
|
type: z.ZodLiteral<"always">;
|
|
86
86
|
}, z.core.$strip>], "type">>>;
|
|
87
|
-
multipleConditionResolveStrategy: z.
|
|
87
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
88
88
|
any: "any";
|
|
89
89
|
all: "all";
|
|
90
90
|
}>>;
|
|
91
91
|
content: z.ZodString;
|
|
92
92
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
93
|
-
enabled: z.
|
|
93
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
94
94
|
}, z.core.$strip>>>;
|
|
95
95
|
}, z.core.$strip>>;
|
|
96
96
|
/**
|
|
@@ -1 +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;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;kBA2BzB,CAAC;AAEP;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -26,7 +26,7 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
26
26
|
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
27
27
|
mimeType: z.ZodString;
|
|
28
28
|
}, z.core.$strip>], "type">;
|
|
29
|
-
timestamp: z.
|
|
29
|
+
timestamp: z.ZodDefault<z.ZodNumber>;
|
|
30
30
|
inlays: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
31
31
|
mimeType: z.ZodString;
|
|
32
32
|
name: z.ZodString;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
export declare const MetaSchema: z.ZodObject<{
|
|
2
|
+
export declare const MetaSchema: z.ZodPrefault<z.ZodObject<{
|
|
3
3
|
author: z.ZodOptional<z.ZodString>;
|
|
4
4
|
license: z.ZodDefault<z.ZodString>;
|
|
5
5
|
version: z.ZodOptional<z.ZodString>;
|
|
6
6
|
distributedOn: z.ZodOptional<z.ZodString>;
|
|
7
7
|
additionalInfo: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.core.$strip
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
9
|
//# sourceMappingURL=Meta.d.ts.map
|
|
@@ -1 +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;;;;;;
|
|
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"}
|
|
@@ -10,7 +10,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
10
10
|
replaceHooks: z.ZodPrefault<z.ZodObject<{
|
|
11
11
|
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
12
12
|
input: z.ZodString;
|
|
13
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
13
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
14
|
type: z.ZodLiteral<"regex">;
|
|
15
15
|
flag: z.ZodString;
|
|
16
16
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -25,7 +25,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
25
25
|
}, z.core.$strip>>>;
|
|
26
26
|
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
27
27
|
input: z.ZodString;
|
|
28
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
28
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
29
29
|
type: z.ZodLiteral<"regex">;
|
|
30
30
|
flag: z.ZodString;
|
|
31
31
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -40,7 +40,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
40
40
|
}, z.core.$strip>>>;
|
|
41
41
|
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
42
42
|
input: z.ZodString;
|
|
43
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
43
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
44
|
type: z.ZodLiteral<"regex">;
|
|
45
45
|
flag: z.ZodString;
|
|
46
46
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -55,7 +55,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
55
55
|
}, z.core.$strip>>>;
|
|
56
56
|
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
57
57
|
input: z.ZodString;
|
|
58
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
58
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
59
59
|
type: z.ZodLiteral<"regex">;
|
|
60
60
|
flag: z.ZodString;
|
|
61
61
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const ReplaceHookMetaSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
2
|
+
export declare const ReplaceHookMetaSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
3
|
type: z.ZodLiteral<"regex">;
|
|
4
4
|
flag: z.ZodString;
|
|
5
5
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -12,7 +12,7 @@ export declare const ReplaceHookMetaSchema: z.ZodIntersection<z.ZodDiscriminated
|
|
|
12
12
|
}, z.core.$strip>>>;
|
|
13
13
|
export declare const ReplaceHookEntitySchema: z.ZodObject<{
|
|
14
14
|
input: z.ZodString;
|
|
15
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
15
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
16
16
|
type: z.ZodLiteral<"regex">;
|
|
17
17
|
flag: z.ZodString;
|
|
18
18
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -31,7 +31,7 @@ export declare const ReplaceHookEntitySchema: z.ZodObject<{
|
|
|
31
31
|
export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
32
32
|
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
33
|
input: z.ZodString;
|
|
34
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
34
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
35
|
type: z.ZodLiteral<"regex">;
|
|
36
36
|
flag: z.ZodString;
|
|
37
37
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -46,7 +46,7 @@ export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
46
46
|
}, z.core.$strip>>>;
|
|
47
47
|
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
48
48
|
input: z.ZodString;
|
|
49
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
49
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
50
|
type: z.ZodLiteral<"regex">;
|
|
51
51
|
flag: z.ZodString;
|
|
52
52
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -61,7 +61,7 @@ export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
61
61
|
}, z.core.$strip>>>;
|
|
62
62
|
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
63
63
|
input: z.ZodString;
|
|
64
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
64
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
65
65
|
type: z.ZodLiteral<"regex">;
|
|
66
66
|
flag: z.ZodString;
|
|
67
67
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -76,7 +76,7 @@ export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
76
76
|
}, z.core.$strip>>>;
|
|
77
77
|
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
78
78
|
input: z.ZodString;
|
|
79
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
79
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
80
80
|
type: z.ZodLiteral<"regex">;
|
|
81
81
|
flag: z.ZodString;
|
|
82
82
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -45,13 +45,13 @@ export type AssetsSetting = {
|
|
|
45
45
|
/**
|
|
46
46
|
* Settings for character assets.
|
|
47
47
|
*/
|
|
48
|
-
export declare const AssetsSettingSchema: z.ZodObject<{
|
|
49
|
-
assets: z.ZodArray<z.ZodObject<{
|
|
48
|
+
export declare const AssetsSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
49
|
+
assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
50
50
|
mimeType: z.ZodString;
|
|
51
51
|
name: z.ZodString;
|
|
52
52
|
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
53
|
-
}, z.core.$strip
|
|
54
|
-
}, z.core.$strip
|
|
53
|
+
}, z.core.$strip>>>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
55
|
/**
|
|
56
56
|
* This is the settings for character assets.
|
|
57
57
|
*/;
|
|
@@ -13,8 +13,8 @@ const a = e.object({
|
|
|
13
13
|
}).meta({
|
|
14
14
|
description: "An asset entity. Represents single asset, via either URL or binary data."
|
|
15
15
|
}), r = e.object({
|
|
16
|
-
assets: e.array(a).refine(s("name"), { message: "Not unique key: name" }).meta({ description: "The assets of the character." })
|
|
17
|
-
}).meta({ description: "Settings for character assets." });
|
|
16
|
+
assets: e.array(a).default([]).refine(s("name"), { message: "Not unique key: name" }).meta({ description: "The assets of the character." })
|
|
17
|
+
}).prefault({}).meta({ description: "Settings for character assets." });
|
|
18
18
|
export {
|
|
19
19
|
a as AssetEntitySchema,
|
|
20
20
|
r as AssetsSettingSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Assets.js","sources":["../../../src/types/v0/Character/Assets.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { FileSchema, unique } from \"@/types/v0/utils\";\n\nexport const AssetEntitySchema = z\n .object({\n mimeType: z.string().meta({\n description:\n \"MIME type of the asset. Usually `image/*` or `video/*`.\",\n }),\n name: z.string().meta({\n description:\n \"The name of the asset. Used as the file name. Should be unique.\",\n }),\n data: FileSchema.meta({\n description: \"The data of the asset.\",\n }),\n })\n .meta({\n description:\n \"An asset entity. Represents single asset, via either URL or binary data.\",\n });\n\n/**\n * @see {@link AssetsSetting}\n */\nexport const AssetsSettingSchema = z\n .object({\n assets: z\n .array(AssetEntitySchema)\n .refine(unique(\"name\"), { message: \"Not unique key: name\" })\n .meta({ description: \"The assets of the character.\" }),\n })\n .meta({ description: \"Settings for character assets.\" });\n\n/**\n * This is the settings for character assets.\n */\nexport type AssetsSetting = z.infer<typeof AssetsSettingSchema>;\n"],"names":["AssetEntitySchema","z","FileSchema","AssetsSettingSchema","unique"],"mappings":";;AAGO,MAAMA,IAAoBC,EAC5B,OAAO;AAAA,EACJ,UAAUA,EAAE,OAAA,EAAS,KAAK;AAAA,IACtB,aACI;AAAA,EAAA,CACP;AAAA,EACD,MAAMA,EAAE,OAAA,EAAS,KAAK;AAAA,IAClB,aACI;AAAA,EAAA,CACP;AAAA,EACD,MAAMC,EAAW,KAAK;AAAA,IAClB,aAAa;AAAA,EAAA,CAChB;AACL,CAAC,EACA,KAAK;AAAA,EACF,aACI;AACR,CAAC,GAKQC,IAAsBF,EAC9B,OAAO;AAAA,EACJ,QAAQA,EACH,MAAMD,CAAiB,EACvB,OAAOI,EAAO,MAAM,GAAG,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"Assets.js","sources":["../../../src/types/v0/Character/Assets.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { FileSchema, unique } from \"@/types/v0/utils\";\n\nexport const AssetEntitySchema = z\n .object({\n mimeType: z.string().meta({\n description:\n \"MIME type of the asset. Usually `image/*` or `video/*`.\",\n }),\n name: z.string().meta({\n description:\n \"The name of the asset. Used as the file name. Should be unique.\",\n }),\n data: FileSchema.meta({\n description: \"The data of the asset.\",\n }),\n })\n .meta({\n description:\n \"An asset entity. Represents single asset, via either URL or binary data.\",\n });\n\n/**\n * @see {@link AssetsSetting}\n */\nexport const AssetsSettingSchema = z\n .object({\n assets: z\n .array(AssetEntitySchema)\n .default([])\n .refine(unique(\"name\"), { message: \"Not unique key: name\" })\n .meta({ description: \"The assets of the character.\" }),\n })\n .prefault({})\n .meta({ description: \"Settings for character assets.\" });\n\n/**\n * This is the settings for character assets.\n */\nexport type AssetsSetting = z.infer<typeof AssetsSettingSchema>;\n"],"names":["AssetEntitySchema","z","FileSchema","AssetsSettingSchema","unique"],"mappings":";;AAGO,MAAMA,IAAoBC,EAC5B,OAAO;AAAA,EACJ,UAAUA,EAAE,OAAA,EAAS,KAAK;AAAA,IACtB,aACI;AAAA,EAAA,CACP;AAAA,EACD,MAAMA,EAAE,OAAA,EAAS,KAAK;AAAA,IAClB,aACI;AAAA,EAAA,CACP;AAAA,EACD,MAAMC,EAAW,KAAK;AAAA,IAClB,aAAa;AAAA,EAAA,CAChB;AACL,CAAC,EACA,KAAK;AAAA,EACF,aACI;AACR,CAAC,GAKQC,IAAsBF,EAC9B,OAAO;AAAA,EACJ,QAAQA,EACH,MAAMD,CAAiB,EACvB,QAAQ,CAAA,CAAE,EACV,OAAOI,EAAO,MAAM,GAAG,EAAE,SAAS,uBAAA,CAAwB,EAC1D,KAAK,EAAE,aAAa,+BAAA,CAAgC;AAC7D,CAAC,EACA,SAAS,CAAA,CAAE,EACX,KAAK,EAAE,aAAa,iCAAA,CAAkC;"}
|
|
@@ -42,13 +42,13 @@ export type CharacterPromptData = {
|
|
|
42
42
|
type: "always";
|
|
43
43
|
})[];
|
|
44
44
|
/** The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one. */
|
|
45
|
-
multipleConditionResolveStrategy
|
|
45
|
+
multipleConditionResolveStrategy: "all" | "any";
|
|
46
46
|
/** The lorebook content to be added on AI prompt. Not for human reading. Scriptable. */
|
|
47
47
|
content: string;
|
|
48
48
|
/** The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0. */
|
|
49
49
|
priority?: number | undefined;
|
|
50
50
|
/** Whether the lorebook is enabled. */
|
|
51
|
-
enabled
|
|
51
|
+
enabled: boolean;
|
|
52
52
|
}[];
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -76,13 +76,13 @@ export declare const CharacterPromptDataSchema: z.ZodObject<{
|
|
|
76
76
|
}, z.core.$strip>, z.ZodObject<{
|
|
77
77
|
type: z.ZodLiteral<"always">;
|
|
78
78
|
}, z.core.$strip>], "type">>>;
|
|
79
|
-
multipleConditionResolveStrategy: z.
|
|
79
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
80
80
|
any: "any";
|
|
81
81
|
all: "all";
|
|
82
82
|
}>>;
|
|
83
83
|
content: z.ZodString;
|
|
84
84
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
85
|
-
enabled: z.
|
|
85
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
86
86
|
}, z.core.$strip>>>;
|
|
87
87
|
}, z.core.$strip>>;
|
|
88
88
|
}, z.core.$strip>;
|
|
@@ -138,13 +138,13 @@ export type Character = {
|
|
|
138
138
|
type: "always";
|
|
139
139
|
})[];
|
|
140
140
|
/** The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one. */
|
|
141
|
-
multipleConditionResolveStrategy
|
|
141
|
+
multipleConditionResolveStrategy: "all" | "any";
|
|
142
142
|
/** The lorebook content to be added on AI prompt. Not for human reading. Scriptable. */
|
|
143
143
|
content: string;
|
|
144
144
|
/** The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0. */
|
|
145
145
|
priority?: number | undefined;
|
|
146
146
|
/** Whether the lorebook is enabled. */
|
|
147
|
-
enabled
|
|
147
|
+
enabled: boolean;
|
|
148
148
|
}[];
|
|
149
149
|
};
|
|
150
150
|
};
|
|
@@ -317,13 +317,13 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
317
317
|
}, z.core.$strip>, z.ZodObject<{
|
|
318
318
|
type: z.ZodLiteral<"always">;
|
|
319
319
|
}, z.core.$strip>], "type">>>;
|
|
320
|
-
multipleConditionResolveStrategy: z.
|
|
320
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
321
321
|
any: "any";
|
|
322
322
|
all: "all";
|
|
323
323
|
}>>;
|
|
324
324
|
content: z.ZodString;
|
|
325
325
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
326
|
-
enabled: z.
|
|
326
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
327
327
|
}, z.core.$strip>>>;
|
|
328
328
|
}, z.core.$strip>>;
|
|
329
329
|
}, z.core.$strip>;
|
|
@@ -335,7 +335,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
335
335
|
replaceHooks: z.ZodPrefault<z.ZodObject<{
|
|
336
336
|
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
337
337
|
input: z.ZodString;
|
|
338
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
338
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
339
339
|
type: z.ZodLiteral<"regex">;
|
|
340
340
|
flag: z.ZodString;
|
|
341
341
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -350,7 +350,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
350
350
|
}, z.core.$strip>>>;
|
|
351
351
|
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
352
352
|
input: z.ZodString;
|
|
353
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
353
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
354
354
|
type: z.ZodLiteral<"regex">;
|
|
355
355
|
flag: z.ZodString;
|
|
356
356
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -365,7 +365,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
365
365
|
}, z.core.$strip>>>;
|
|
366
366
|
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
367
367
|
input: z.ZodString;
|
|
368
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
368
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
369
369
|
type: z.ZodLiteral<"regex">;
|
|
370
370
|
flag: z.ZodString;
|
|
371
371
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -380,7 +380,7 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
380
380
|
}, z.core.$strip>>>;
|
|
381
381
|
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
382
382
|
input: z.ZodString;
|
|
383
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
383
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
384
384
|
type: z.ZodLiteral<"regex">;
|
|
385
385
|
flag: z.ZodString;
|
|
386
386
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -395,20 +395,20 @@ export declare const CharacterSchema: z.ZodObject<{
|
|
|
395
395
|
}, z.core.$strip>>>;
|
|
396
396
|
}, z.core.$strip>>;
|
|
397
397
|
}, z.core.$strip>>;
|
|
398
|
-
metadata: z.ZodObject<{
|
|
398
|
+
metadata: z.ZodPrefault<z.ZodObject<{
|
|
399
399
|
author: z.ZodOptional<z.ZodString>;
|
|
400
400
|
license: z.ZodDefault<z.ZodString>;
|
|
401
401
|
version: z.ZodOptional<z.ZodString>;
|
|
402
402
|
distributedOn: z.ZodOptional<z.ZodString>;
|
|
403
403
|
additionalInfo: z.ZodOptional<z.ZodString>;
|
|
404
|
-
}, z.core.$strip
|
|
405
|
-
assets: z.ZodObject<{
|
|
406
|
-
assets: z.ZodArray<z.ZodObject<{
|
|
404
|
+
}, z.core.$strip>>;
|
|
405
|
+
assets: z.ZodPrefault<z.ZodObject<{
|
|
406
|
+
assets: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
407
407
|
mimeType: z.ZodString;
|
|
408
408
|
name: z.ZodString;
|
|
409
409
|
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
410
|
-
}, z.core.$strip
|
|
411
|
-
}, z.core.$strip
|
|
410
|
+
}, z.core.$strip>>>;
|
|
411
|
+
}, z.core.$strip>>;
|
|
412
412
|
}, z.core.$strip>;
|
|
413
413
|
/**
|
|
414
414
|
* Represents a specific AI character personality.
|
|
@@ -41,13 +41,13 @@ export type Chat = {
|
|
|
41
41
|
type: "always";
|
|
42
42
|
})[];
|
|
43
43
|
/** The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one. */
|
|
44
|
-
multipleConditionResolveStrategy
|
|
44
|
+
multipleConditionResolveStrategy: "all" | "any";
|
|
45
45
|
/** The lorebook content to be added on AI prompt. Not for human reading. Scriptable. */
|
|
46
46
|
content: string;
|
|
47
47
|
/** The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0. */
|
|
48
48
|
priority?: number | undefined;
|
|
49
49
|
/** Whether the lorebook is enabled. */
|
|
50
|
-
enabled
|
|
50
|
+
enabled: boolean;
|
|
51
51
|
}[] | undefined;
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -73,13 +73,13 @@ export declare const ChatSchema: z.ZodObject<{
|
|
|
73
73
|
}, z.core.$strip>, z.ZodObject<{
|
|
74
74
|
type: z.ZodLiteral<"always">;
|
|
75
75
|
}, z.core.$strip>], "type">>>;
|
|
76
|
-
multipleConditionResolveStrategy: z.
|
|
76
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
77
77
|
any: "any";
|
|
78
78
|
all: "all";
|
|
79
79
|
}>>;
|
|
80
80
|
content: z.ZodString;
|
|
81
81
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
enabled: z.
|
|
82
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
83
83
|
}, z.core.$strip>>>>;
|
|
84
84
|
}, z.core.$strip>;
|
|
85
85
|
/**
|
|
@@ -35,6 +35,9 @@ export declare const LorebookConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
35
35
|
* @see {@link LorebookConditionSchema}
|
|
36
36
|
*/;
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Object containing data for the lorebook. Meant to be stored in the database.
|
|
40
|
+
*/
|
|
38
41
|
export type LorebookData = {
|
|
39
42
|
/** The configuration for the lorebook. Not scriptable. */
|
|
40
43
|
config: {
|
|
@@ -65,16 +68,19 @@ export type LorebookData = {
|
|
|
65
68
|
type: "always";
|
|
66
69
|
})[];
|
|
67
70
|
/** The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one. */
|
|
68
|
-
multipleConditionResolveStrategy
|
|
71
|
+
multipleConditionResolveStrategy: "all" | "any";
|
|
69
72
|
/** The lorebook content to be added on AI prompt. Not for human reading. Scriptable. */
|
|
70
73
|
content: string;
|
|
71
74
|
/** The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0. */
|
|
72
75
|
priority?: number | undefined;
|
|
73
76
|
/** Whether the lorebook is enabled. */
|
|
74
|
-
enabled
|
|
77
|
+
enabled: boolean;
|
|
75
78
|
}[];
|
|
76
79
|
};
|
|
77
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Object containing data for the lorebook. Meant to be stored in the database.
|
|
83
|
+
*/
|
|
78
84
|
export declare const LorebookDataSchema: z.ZodPrefault<z.ZodObject<{
|
|
79
85
|
config: z.ZodPrefault<z.ZodObject<{
|
|
80
86
|
tokenLimit: z.ZodOptional<z.ZodInt>;
|
|
@@ -92,13 +98,13 @@ export declare const LorebookDataSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
92
98
|
}, z.core.$strip>, z.ZodObject<{
|
|
93
99
|
type: z.ZodLiteral<"always">;
|
|
94
100
|
}, z.core.$strip>], "type">>>;
|
|
95
|
-
multipleConditionResolveStrategy: z.
|
|
101
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
96
102
|
any: "any";
|
|
97
103
|
all: "all";
|
|
98
104
|
}>>;
|
|
99
105
|
content: z.ZodString;
|
|
100
106
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
101
|
-
enabled: z.
|
|
107
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
102
108
|
}, z.core.$strip>>>;
|
|
103
109
|
}, z.core.$strip>>;
|
|
104
110
|
/**
|
|
@@ -132,13 +138,13 @@ export type LorebookEntry = {
|
|
|
132
138
|
type: "always";
|
|
133
139
|
})[];
|
|
134
140
|
/** The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one. */
|
|
135
|
-
multipleConditionResolveStrategy
|
|
141
|
+
multipleConditionResolveStrategy: "all" | "any";
|
|
136
142
|
/** The lorebook content to be added on AI prompt. Not for human reading. Scriptable. */
|
|
137
143
|
content: string;
|
|
138
144
|
/** The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0. */
|
|
139
145
|
priority?: number | undefined;
|
|
140
146
|
/** Whether the lorebook is enabled. */
|
|
141
|
-
enabled
|
|
147
|
+
enabled: boolean;
|
|
142
148
|
};
|
|
143
149
|
|
|
144
150
|
/**
|
|
@@ -157,13 +163,13 @@ export declare const LorebookEntrySchema: z.ZodObject<{
|
|
|
157
163
|
}, z.core.$strip>, z.ZodObject<{
|
|
158
164
|
type: z.ZodLiteral<"always">;
|
|
159
165
|
}, z.core.$strip>], "type">>>;
|
|
160
|
-
multipleConditionResolveStrategy: z.
|
|
166
|
+
multipleConditionResolveStrategy: z.ZodDefault<z.ZodEnum<{
|
|
161
167
|
any: "any";
|
|
162
168
|
all: "all";
|
|
163
169
|
}>>;
|
|
164
170
|
content: z.ZodString;
|
|
165
171
|
priority: z.ZodOptional<z.ZodNumber>;
|
|
166
|
-
enabled: z.
|
|
172
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
167
173
|
}, z.core.$strip>;
|
|
168
174
|
/**
|
|
169
175
|
* A lorebook is a collection of lorebooks.
|
|
@@ -33,7 +33,7 @@ const t = {
|
|
|
33
33
|
condition: e.array(a).default([]).meta({
|
|
34
34
|
description: "The condition for the lorebook to be activated. If empty, it will not be activated. Use 'always' to activate without any condition."
|
|
35
35
|
}),
|
|
36
|
-
multipleConditionResolveStrategy: e.enum(["all", "any"]).
|
|
36
|
+
multipleConditionResolveStrategy: e.enum(["all", "any"]).default("any").meta({
|
|
37
37
|
description: "The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one."
|
|
38
38
|
}),
|
|
39
39
|
content: e.string().meta({
|
|
@@ -42,7 +42,7 @@ const t = {
|
|
|
42
42
|
priority: e.number().optional().meta({
|
|
43
43
|
description: "The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0."
|
|
44
44
|
}),
|
|
45
|
-
enabled: e.boolean().
|
|
45
|
+
enabled: e.boolean().default(!0).meta({ description: "Whether the lorebook is enabled." })
|
|
46
46
|
}).meta({
|
|
47
47
|
description: "A lorebook entry. Small part of prompts activated by session's text matching."
|
|
48
48
|
}), l = e.object({
|
|
@@ -56,9 +56,9 @@ const t = {
|
|
|
56
56
|
data: e.array(n).refine(o("id"), { message: "Not unique key: id" }).default([]).meta({
|
|
57
57
|
description: "Contains the actual lorebooks. Duplicated id is not allowed."
|
|
58
58
|
})
|
|
59
|
-
}).meta({
|
|
59
|
+
}).prefault({}).meta({
|
|
60
60
|
description: "Object containing data for the lorebook. Meant to be stored in the database."
|
|
61
|
-
})
|
|
61
|
+
});
|
|
62
62
|
export {
|
|
63
63
|
t as LorebookConditionDetails,
|
|
64
64
|
a as LorebookConditionSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lorebook.js","sources":["../../../src/types/v0/Character/Lorebook.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { positiveInteger, unique } from \"@/types/v0/utils\";\n\n/**\n * Lorebook condition detail schemas organized by type.\n * @see {@link LorebookConditionSchema}\n */\nexport const LorebookConditionDetails = {\n regex: z\n .object({\n type: z.literal(\"regex_match\").meta({\n description: \"This condition matches the regex pattern.\",\n }),\n regexPattern: z.string().meta({\n description: \"The regex pattern to match. Scriptable.\",\n }),\n regexFlags: z.string().optional().meta({\n description: \"The regex flags to use. Not scriptable.\",\n }),\n })\n .meta({ description: \"Regex match condition.\" }),\n plainText: z\n .object({\n type: z.literal(\"plain_text_match\").meta({\n description: \"This condition simply matches the text.\",\n }),\n text: z.string().meta({\n description: \"The text to match. Scriptable. Case insensitive.\",\n }),\n })\n .meta({ description: \"Plain text match condition.\" }),\n always: z\n .object({\n type: z\n .literal(\"always\")\n .meta({ description: \"This condition is always true.\" }),\n })\n .meta({ description: \"Always active condition.\" }),\n} as const;\n\n/**\n * The condition for the lorebook to be activated.\n */\nexport const LorebookConditionSchema = z.discriminatedUnion(\"type\", [\n LorebookConditionDetails.regex,\n LorebookConditionDetails.plainText,\n LorebookConditionDetails.always,\n]);\n\n/**\n * The condition for the lorebook to be activated.\n * @see {@link LorebookConditionSchema}\n */\nexport type LorebookCondition = z.infer<typeof LorebookConditionSchema>;\n\n/**\n * @see {@link LorebookEntry}\n */\nexport const LorebookEntrySchema = z\n .object({\n id: z.string().meta({ description: \"Internally generated ID.\" }),\n name: z\n .string()\n .meta({ description: \"Human readable name for the lorebook.\" }),\n condition: z\n .array(LorebookConditionSchema)\n .default([])\n .meta({\n description:\n \"The condition for the lorebook to be activated. \" +\n \"If empty, it will not be activated. \" +\n \"Use 'always' to activate without any condition.\",\n }),\n multipleConditionResolveStrategy: z\n .enum([\"all\", \"any\"])\n .
|
|
1
|
+
{"version":3,"file":"Lorebook.js","sources":["../../../src/types/v0/Character/Lorebook.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { positiveInteger, unique } from \"@/types/v0/utils\";\n\n/**\n * Lorebook condition detail schemas organized by type.\n * @see {@link LorebookConditionSchema}\n */\nexport const LorebookConditionDetails = {\n regex: z\n .object({\n type: z.literal(\"regex_match\").meta({\n description: \"This condition matches the regex pattern.\",\n }),\n regexPattern: z.string().meta({\n description: \"The regex pattern to match. Scriptable.\",\n }),\n regexFlags: z.string().optional().meta({\n description: \"The regex flags to use. Not scriptable.\",\n }),\n })\n .meta({ description: \"Regex match condition.\" }),\n plainText: z\n .object({\n type: z.literal(\"plain_text_match\").meta({\n description: \"This condition simply matches the text.\",\n }),\n text: z.string().meta({\n description: \"The text to match. Scriptable. Case insensitive.\",\n }),\n })\n .meta({ description: \"Plain text match condition.\" }),\n always: z\n .object({\n type: z\n .literal(\"always\")\n .meta({ description: \"This condition is always true.\" }),\n })\n .meta({ description: \"Always active condition.\" }),\n} as const;\n\n/**\n * The condition for the lorebook to be activated.\n */\nexport const LorebookConditionSchema = z.discriminatedUnion(\"type\", [\n LorebookConditionDetails.regex,\n LorebookConditionDetails.plainText,\n LorebookConditionDetails.always,\n]);\n\n/**\n * The condition for the lorebook to be activated.\n * @see {@link LorebookConditionSchema}\n */\nexport type LorebookCondition = z.infer<typeof LorebookConditionSchema>;\n\n/**\n * @see {@link LorebookEntry}\n */\nexport const LorebookEntrySchema = z\n .object({\n id: z.string().meta({ description: \"Internally generated ID.\" }),\n name: z\n .string()\n .meta({ description: \"Human readable name for the lorebook.\" }),\n condition: z\n .array(LorebookConditionSchema)\n .default([])\n .meta({\n description:\n \"The condition for the lorebook to be activated. \" +\n \"If empty, it will not be activated. \" +\n \"Use 'always' to activate without any condition.\",\n }),\n multipleConditionResolveStrategy: z\n .enum([\"all\", \"any\"])\n .default(\"any\")\n .meta({\n description:\n \"The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one.\",\n }),\n content: z.string().meta({\n description:\n \"The lorebook content to be added on AI prompt. Not for human reading. Scriptable.\",\n }),\n priority: z.number().optional().meta({\n description:\n \"The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0.\",\n }),\n enabled: z\n .boolean()\n .default(true)\n .meta({ description: \"Whether the lorebook is enabled.\" }),\n })\n .meta({\n description:\n \"A lorebook entry. Small part of prompts activated by session's text matching.\",\n });\n\n/**\n * A lorebook is a collection of lorebooks.\n * Lorebook is a small part of prompts which is activated by session's text matching.\n */\nexport type LorebookEntry = z.infer<typeof LorebookEntrySchema>;\n\n/**\n * @see {@link LorebookData}\n */\nexport const LorebookDataSchema = z\n .object({\n config: z\n .object({\n tokenLimit: positiveInteger.optional().meta({\n description:\n \"The token limit for the lorebook. When exceeded, low-priority lorebooks will be deactivated. Positive integer.\",\n }),\n })\n .prefault({})\n .meta({\n description:\n \"The configuration for the lorebook. Not scriptable.\",\n }),\n data: z\n .array(LorebookEntrySchema)\n .refine(unique(\"id\"), { message: \"Not unique key: id\" })\n .default([])\n .meta({\n description:\n \"Contains the actual lorebooks. Duplicated id is not allowed.\",\n }),\n })\n .prefault({})\n .meta({\n description:\n \"Object containing data for the lorebook. Meant to be stored in the database.\",\n });\n\n/**\n * Object containing all data for the lorebook.\n * It's meant to be stored in the database and many other places.\n */\nexport type LorebookData = z.infer<typeof LorebookDataSchema>;\n"],"names":["LorebookConditionDetails","z","LorebookConditionSchema","LorebookEntrySchema","LorebookDataSchema","positiveInteger","unique"],"mappings":";;AAOO,MAAMA,IAA2B;AAAA,EACpC,OAAOC,EACF,OAAO;AAAA,IACJ,MAAMA,EAAE,QAAQ,aAAa,EAAE,KAAK;AAAA,MAChC,aAAa;AAAA,IAAA,CAChB;AAAA,IACD,cAAcA,EAAE,OAAA,EAAS,KAAK;AAAA,MAC1B,aAAa;AAAA,IAAA,CAChB;AAAA,IACD,YAAYA,EAAE,OAAA,EAAS,SAAA,EAAW,KAAK;AAAA,MACnC,aAAa;AAAA,IAAA,CAChB;AAAA,EAAA,CACJ,EACA,KAAK,EAAE,aAAa,0BAA0B;AAAA,EACnD,WAAWA,EACN,OAAO;AAAA,IACJ,MAAMA,EAAE,QAAQ,kBAAkB,EAAE,KAAK;AAAA,MACrC,aAAa;AAAA,IAAA,CAChB;AAAA,IACD,MAAMA,EAAE,OAAA,EAAS,KAAK;AAAA,MAClB,aAAa;AAAA,IAAA,CAChB;AAAA,EAAA,CACJ,EACA,KAAK,EAAE,aAAa,+BAA+B;AAAA,EACxD,QAAQA,EACH,OAAO;AAAA,IACJ,MAAMA,EACD,QAAQ,QAAQ,EAChB,KAAK,EAAE,aAAa,iCAAA,CAAkC;AAAA,EAAA,CAC9D,EACA,KAAK,EAAE,aAAa,4BAA4B;AACzD,GAKaC,IAA0BD,EAAE,mBAAmB,QAAQ;AAAA,EAChED,EAAyB;AAAA,EACzBA,EAAyB;AAAA,EACzBA,EAAyB;AAC7B,CAAC,GAWYG,IAAsBF,EAC9B,OAAO;AAAA,EACJ,IAAIA,EAAE,OAAA,EAAS,KAAK,EAAE,aAAa,4BAA4B;AAAA,EAC/D,MAAMA,EACD,OAAA,EACA,KAAK,EAAE,aAAa,yCAAyC;AAAA,EAClE,WAAWA,EACN,MAAMC,CAAuB,EAC7B,QAAQ,CAAA,CAAE,EACV,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CAGP;AAAA,EACL,kCAAkCD,EAC7B,KAAK,CAAC,OAAO,KAAK,CAAC,EACnB,QAAQ,KAAK,EACb,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AAAA,EACL,SAASA,EAAE,OAAA,EAAS,KAAK;AAAA,IACrB,aACI;AAAA,EAAA,CACP;AAAA,EACD,UAAUA,EAAE,OAAA,EAAS,SAAA,EAAW,KAAK;AAAA,IACjC,aACI;AAAA,EAAA,CACP;AAAA,EACD,SAASA,EACJ,QAAA,EACA,QAAQ,EAAI,EACZ,KAAK,EAAE,aAAa,mCAAA,CAAoC;AACjE,CAAC,EACA,KAAK;AAAA,EACF,aACI;AACR,CAAC,GAWQG,IAAqBH,EAC7B,OAAO;AAAA,EACJ,QAAQA,EACH,OAAO;AAAA,IACJ,YAAYI,EAAgB,SAAA,EAAW,KAAK;AAAA,MACxC,aACI;AAAA,IAAA,CACP;AAAA,EAAA,CACJ,EACA,SAAS,EAAE,EACX,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AAAA,EACL,MAAMJ,EACD,MAAME,CAAmB,EACzB,OAAOG,EAAO,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACtD,QAAQ,CAAA,CAAE,EACV,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AACT,CAAC,EACA,SAAS,EAAE,EACX,KAAK;AAAA,EACF,aACI;AACR,CAAC;"}
|
|
@@ -28,7 +28,8 @@ export type Message = {
|
|
|
28
28
|
mimeType: string;
|
|
29
29
|
};
|
|
30
30
|
/** The timestamp when the message was created. */
|
|
31
|
-
timestamp
|
|
31
|
+
timestamp: number;
|
|
32
|
+
/** The inlays of the message. It is not intended to be exported as public. */
|
|
32
33
|
inlays: {
|
|
33
34
|
/** MIME type of the asset. Usually `image/*` or `video/*`. */
|
|
34
35
|
mimeType: string;
|
|
@@ -58,7 +59,7 @@ export declare const MessageSchema: z.ZodObject<{
|
|
|
58
59
|
data: z.ZodUnion<readonly [z.ZodURL, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>]>;
|
|
59
60
|
mimeType: z.ZodString;
|
|
60
61
|
}, z.core.$strip>], "type">;
|
|
61
|
-
timestamp: z.
|
|
62
|
+
timestamp: z.ZodDefault<z.ZodNumber>;
|
|
62
63
|
inlays: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
63
64
|
mimeType: z.ZodString;
|
|
64
65
|
name: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
2
|
import { AssetEntitySchema as s } from "./Assets.js";
|
|
3
|
-
import { FileSchema as i, unique as
|
|
4
|
-
const
|
|
3
|
+
import { FileSchema as i, unique as a } from "../utils.js";
|
|
4
|
+
const n = e.enum(["user", "assistant", "system"]).meta({ description: "Represents the role of the message sender." }), t = {
|
|
5
5
|
text: e.object({
|
|
6
6
|
type: e.literal("text").meta({
|
|
7
7
|
description: "The message content is a simple string."
|
|
@@ -20,22 +20,22 @@ const a = e.enum(["user", "assistant", "system"]).meta({ description: "Represent
|
|
|
20
20
|
chatId: e.string().meta({
|
|
21
21
|
description: "The ID of the chat associated with this message."
|
|
22
22
|
}),
|
|
23
|
-
role:
|
|
23
|
+
role: n.meta({
|
|
24
24
|
description: "The role of the message sender."
|
|
25
25
|
}),
|
|
26
26
|
content: e.discriminatedUnion("type", [
|
|
27
27
|
t.text,
|
|
28
28
|
t.file
|
|
29
29
|
]).meta({ description: "The content of the message." }),
|
|
30
|
-
timestamp: e.number().
|
|
30
|
+
timestamp: e.number().default(Date.now).meta({
|
|
31
31
|
description: "The timestamp when the message was created."
|
|
32
32
|
}),
|
|
33
|
-
inlays: e.array(s).refine(
|
|
33
|
+
inlays: e.array(s).refine(a("name"), { message: "Not unique key: name" }).default([]).meta({
|
|
34
34
|
description: "The inlays of the message. It is not intended to be exported as public."
|
|
35
|
-
})
|
|
35
|
+
})
|
|
36
36
|
}).meta({ description: "Represents a single message in a chat history." });
|
|
37
37
|
export {
|
|
38
38
|
c as MessageSchema,
|
|
39
|
-
|
|
39
|
+
n as RoleSchema
|
|
40
40
|
};
|
|
41
41
|
//# sourceMappingURL=Message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sources":["../../../src/types/v0/Character/Message.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AssetEntitySchema } from \"@/types/v0/Character/Assets\";\nimport { FileSchema, unique } from \"@/types/v0/utils\";\n\n/**\n * Represents the role of the message sender.\n */\nexport const RoleSchema = z\n .enum([\"user\", \"assistant\", \"system\"])\n .meta({ description: \"Represents the role of the message sender.\" });\n\nconst MessageContentSchema = {\n text: z\n .object({\n type: z.literal(\"text\").meta({\n description: \"The message content is a simple string.\",\n }),\n data: z.string().meta({ description: \"The message content.\" }),\n })\n .meta({ description: \"Text message content.\" }),\n file: z\n .object({\n type: z.literal(\"file\").meta({\n description:\n \"The file content is stored in the separated storage.\",\n }),\n data: FileSchema.meta({ description: \"The file content.\" }),\n mimeType: z\n .string()\n .meta({ description: \"MIME type of the file.\" }),\n })\n .meta({ description: \"File message content.\" }),\n};\n\n/**\n * @see {@link Message}\n */\nexport const MessageSchema = z\n .object({\n id: z\n .string()\n .meta({ description: \"Unique identifier for the message.\" }),\n chatId: z.string().meta({\n description: \"The ID of the chat associated with this message.\",\n }),\n role: RoleSchema.meta({\n description: \"The role of the message sender.\",\n }),\n content: z\n .discriminatedUnion(\"type\", [\n MessageContentSchema.text,\n MessageContentSchema.file,\n ])\n .meta({ description: \"The content of the message.\" }),\n timestamp: z.number().
|
|
1
|
+
{"version":3,"file":"Message.js","sources":["../../../src/types/v0/Character/Message.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { AssetEntitySchema } from \"@/types/v0/Character/Assets\";\nimport { FileSchema, unique } from \"@/types/v0/utils\";\n\n/**\n * Represents the role of the message sender.\n */\nexport const RoleSchema = z\n .enum([\"user\", \"assistant\", \"system\"])\n .meta({ description: \"Represents the role of the message sender.\" });\n\nconst MessageContentSchema = {\n text: z\n .object({\n type: z.literal(\"text\").meta({\n description: \"The message content is a simple string.\",\n }),\n data: z.string().meta({ description: \"The message content.\" }),\n })\n .meta({ description: \"Text message content.\" }),\n file: z\n .object({\n type: z.literal(\"file\").meta({\n description:\n \"The file content is stored in the separated storage.\",\n }),\n data: FileSchema.meta({ description: \"The file content.\" }),\n mimeType: z\n .string()\n .meta({ description: \"MIME type of the file.\" }),\n })\n .meta({ description: \"File message content.\" }),\n};\n\n/**\n * @see {@link Message}\n */\nexport const MessageSchema = z\n .object({\n id: z\n .string()\n .meta({ description: \"Unique identifier for the message.\" }),\n chatId: z.string().meta({\n description: \"The ID of the chat associated with this message.\",\n }),\n role: RoleSchema.meta({\n description: \"The role of the message sender.\",\n }),\n content: z\n .discriminatedUnion(\"type\", [\n MessageContentSchema.text,\n MessageContentSchema.file,\n ])\n .meta({ description: \"The content of the message.\" }),\n timestamp: z.number().default(Date.now).meta({\n description: \"The timestamp when the message was created.\",\n }),\n inlays: z\n .array(AssetEntitySchema)\n .refine(unique(\"name\"), { message: \"Not unique key: name\" })\n .default([])\n .meta({\n description:\n \"The inlays of the message. It is not intended to be exported as public.\",\n }),\n })\n .meta({ description: \"Represents a single message in a chat history.\" });\n\n/**\n * Represents a single message in a chat history.\n */\nexport type Message = z.infer<typeof MessageSchema>;\n"],"names":["RoleSchema","z","MessageContentSchema","FileSchema","MessageSchema","AssetEntitySchema","unique"],"mappings":";;;AAOO,MAAMA,IAAaC,EACrB,KAAK,CAAC,QAAQ,aAAa,QAAQ,CAAC,EACpC,KAAK,EAAE,aAAa,8CAA8C,GAEjEC,IAAuB;AAAA,EACzB,MAAMD,EACD,OAAO;AAAA,IACJ,MAAMA,EAAE,QAAQ,MAAM,EAAE,KAAK;AAAA,MACzB,aAAa;AAAA,IAAA,CAChB;AAAA,IACD,MAAMA,EAAE,OAAA,EAAS,KAAK,EAAE,aAAa,wBAAwB;AAAA,EAAA,CAChE,EACA,KAAK,EAAE,aAAa,yBAAyB;AAAA,EAClD,MAAMA,EACD,OAAO;AAAA,IACJ,MAAMA,EAAE,QAAQ,MAAM,EAAE,KAAK;AAAA,MACzB,aACI;AAAA,IAAA,CACP;AAAA,IACD,MAAME,EAAW,KAAK,EAAE,aAAa,qBAAqB;AAAA,IAC1D,UAAUF,EACL,OAAA,EACA,KAAK,EAAE,aAAa,0BAA0B;AAAA,EAAA,CACtD,EACA,KAAK,EAAE,aAAa,yBAAyB;AACtD,GAKaG,IAAgBH,EACxB,OAAO;AAAA,EACJ,IAAIA,EACC,OAAA,EACA,KAAK,EAAE,aAAa,sCAAsC;AAAA,EAC/D,QAAQA,EAAE,OAAA,EAAS,KAAK;AAAA,IACpB,aAAa;AAAA,EAAA,CAChB;AAAA,EACD,MAAMD,EAAW,KAAK;AAAA,IAClB,aAAa;AAAA,EAAA,CAChB;AAAA,EACD,SAASC,EACJ,mBAAmB,QAAQ;AAAA,IACxBC,EAAqB;AAAA,IACrBA,EAAqB;AAAA,EAAA,CACxB,EACA,KAAK,EAAE,aAAa,+BAA+B;AAAA,EACxD,WAAWD,EAAE,OAAA,EAAS,QAAQ,KAAK,GAAG,EAAE,KAAK;AAAA,IACzC,aAAa;AAAA,EAAA,CAChB;AAAA,EACD,QAAQA,EACH,MAAMI,CAAiB,EACvB,OAAOC,EAAO,MAAM,GAAG,EAAE,SAAS,wBAAwB,EAC1D,QAAQ,CAAA,CAAE,EACV,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AACT,CAAC,EACA,KAAK,EAAE,aAAa,kDAAkD;"}
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
import { z, type ZodType } from "zod";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Meta information about the character.
|
|
8
|
+
*/
|
|
6
9
|
export type Meta = {
|
|
7
10
|
/** The author of the character. Optional. */
|
|
8
11
|
author?: string | undefined;
|
|
@@ -16,11 +19,14 @@ export type Meta = {
|
|
|
16
19
|
additionalInfo?: string | undefined;
|
|
17
20
|
};
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Meta information about the character.
|
|
24
|
+
*/
|
|
25
|
+
export declare const MetaSchema: z.ZodPrefault<z.ZodObject<{
|
|
20
26
|
author: z.ZodOptional<z.ZodString>;
|
|
21
27
|
license: z.ZodDefault<z.ZodString>;
|
|
22
28
|
version: z.ZodOptional<z.ZodString>;
|
|
23
29
|
distributedOn: z.ZodOptional<z.ZodString>;
|
|
24
30
|
additionalInfo: z.ZodOptional<z.ZodString>;
|
|
25
|
-
}, z.core.$strip
|
|
31
|
+
}, z.core.$strip>>;
|
|
26
32
|
//# sourceMappingURL=Meta.d.ts.map;
|
|
@@ -15,7 +15,7 @@ const t = e.object({
|
|
|
15
15
|
additionalInfo: e.string().optional().meta({
|
|
16
16
|
description: "Additional information about the character, which can't be represented by other fields. Optional."
|
|
17
17
|
})
|
|
18
|
-
});
|
|
18
|
+
}).prefault({}).meta({ description: "Meta information about the character." });
|
|
19
19
|
export {
|
|
20
20
|
t as MetaSchema
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Meta.js","sources":["../../../src/types/v0/Character/Meta.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport const MetaSchema = z.object({\n
|
|
1
|
+
{"version":3,"file":"Meta.js","sources":["../../../src/types/v0/Character/Meta.ts"],"sourcesContent":["import * as z from \"zod\";\n\nexport const MetaSchema = z\n .object({\n author: z.string().optional().meta({\n description: \"The author of the character. Optional.\",\n }),\n\n license: z\n .string()\n .default(\"ARR\")\n .meta({\n description:\n \"The license of the character. Optional. \" +\n \"Using SPDX license identifier or URL is recommended. \" +\n \"Default: ARR, which means the character is all rights reserved by the author.\",\n }),\n version: z.string().optional().meta({\n description: \"The version of the character. Optional.\",\n }),\n\n distributedOn: z\n .string()\n .optional()\n .meta({\n description:\n \"The distributed page of the character.\" +\n \"URL is recommended. Optional.\",\n }),\n additionalInfo: z\n .string()\n .optional()\n .meta({\n description:\n \"Additional information about the character, \" +\n \"which can't be represented by other fields. Optional.\",\n }),\n })\n .prefault({})\n .meta({ description: \"Meta information about the character.\" });\n"],"names":["MetaSchema","z"],"mappings":";AAEO,MAAMA,IAAaC,EACrB,OAAO;AAAA,EACJ,QAAQA,EAAE,OAAA,EAAS,SAAA,EAAW,KAAK;AAAA,IAC/B,aAAa;AAAA,EAAA,CAChB;AAAA,EAED,SAASA,EACJ,OAAA,EACA,QAAQ,KAAK,EACb,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CAGP;AAAA,EACL,SAASA,EAAE,OAAA,EAAS,SAAA,EAAW,KAAK;AAAA,IAChC,aAAa;AAAA,EAAA,CAChB;AAAA,EAED,eAAeA,EACV,OAAA,EACA,SAAA,EACA,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CAEP;AAAA,EACL,gBAAgBA,EACX,OAAA,EACA,SAAA,EACA,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CAEP;AACT,CAAC,EACA,SAAS,CAAA,CAAE,EACX,KAAK,EAAE,aAAa,wCAAA,CAAyC;"}
|
|
@@ -130,7 +130,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
130
130
|
replaceHooks: z.ZodPrefault<z.ZodObject<{
|
|
131
131
|
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
132
132
|
input: z.ZodString;
|
|
133
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
133
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
134
134
|
type: z.ZodLiteral<"regex">;
|
|
135
135
|
flag: z.ZodString;
|
|
136
136
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -145,7 +145,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
145
145
|
}, z.core.$strip>>>;
|
|
146
146
|
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
147
147
|
input: z.ZodString;
|
|
148
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
148
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
149
149
|
type: z.ZodLiteral<"regex">;
|
|
150
150
|
flag: z.ZodString;
|
|
151
151
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -160,7 +160,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
160
160
|
}, z.core.$strip>>>;
|
|
161
161
|
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
162
162
|
input: z.ZodString;
|
|
163
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
163
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
164
164
|
type: z.ZodLiteral<"regex">;
|
|
165
165
|
flag: z.ZodString;
|
|
166
166
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -175,7 +175,7 @@ export declare const ScriptSettingSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
175
175
|
}, z.core.$strip>>>;
|
|
176
176
|
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
177
177
|
input: z.ZodString;
|
|
178
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
178
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
179
179
|
type: z.ZodLiteral<"regex">;
|
|
180
180
|
flag: z.ZodString;
|
|
181
181
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -31,7 +31,7 @@ export type ReplaceHookEntity = {
|
|
|
31
31
|
|
|
32
32
|
export declare const ReplaceHookEntitySchema: z.ZodObject<{
|
|
33
33
|
input: z.ZodString;
|
|
34
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
34
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
35
|
type: z.ZodLiteral<"regex">;
|
|
36
36
|
flag: z.ZodString;
|
|
37
37
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -73,7 +73,7 @@ export type ReplaceHookMeta = ({
|
|
|
73
73
|
/**
|
|
74
74
|
* The meta data for the replace hook.
|
|
75
75
|
*/
|
|
76
|
-
export declare const ReplaceHookMetaSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
76
|
+
export declare const ReplaceHookMetaSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
77
77
|
type: z.ZodLiteral<"regex">;
|
|
78
78
|
flag: z.ZodString;
|
|
79
79
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -197,7 +197,7 @@ export type ReplaceHook = {
|
|
|
197
197
|
export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
198
198
|
display: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
199
199
|
input: z.ZodString;
|
|
200
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
200
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
201
201
|
type: z.ZodLiteral<"regex">;
|
|
202
202
|
flag: z.ZodString;
|
|
203
203
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -212,7 +212,7 @@ export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
212
212
|
}, z.core.$strip>>>;
|
|
213
213
|
input: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
214
214
|
input: z.ZodString;
|
|
215
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
215
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
216
216
|
type: z.ZodLiteral<"regex">;
|
|
217
217
|
flag: z.ZodString;
|
|
218
218
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -227,7 +227,7 @@ export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
227
227
|
}, z.core.$strip>>>;
|
|
228
228
|
output: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
229
229
|
input: z.ZodString;
|
|
230
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
230
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
231
231
|
type: z.ZodLiteral<"regex">;
|
|
232
232
|
flag: z.ZodString;
|
|
233
233
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -242,7 +242,7 @@ export declare const ReplaceHookSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
242
242
|
}, z.core.$strip>>>;
|
|
243
243
|
request: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
244
244
|
input: z.ZodString;
|
|
245
|
-
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
245
|
+
meta: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
246
246
|
type: z.ZodLiteral<"regex">;
|
|
247
247
|
flag: z.ZodString;
|
|
248
248
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplaceHook.js","sources":["../../../src/types/v0/Executables/ReplaceHook.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst ReplaceHookMetaType = [\n z\n .object({\n type: z\n .literal(\"regex\")\n .meta({ description: \"The input pattern is a RegExp.\" }),\n flag: z.string().meta({ description: \"The flag for RegExp.\" }),\n })\n .meta({ description: \"Regex pattern type.\" }),\n z\n .object({\n type: z\n .literal(\"string\")\n .meta({ description: \"The input pattern is a simple string.\" }),\n caseSensitive: z.boolean().default(true).meta({\n description: \"If true, the input pattern is case sensitive.\",\n }),\n })\n .meta({ description: \"String pattern type.\" }),\n] as const
|
|
1
|
+
{"version":3,"file":"ReplaceHook.js","sources":["../../../src/types/v0/Executables/ReplaceHook.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst ReplaceHookMetaType = [\n z\n .object({\n type: z\n .literal(\"regex\")\n .meta({ description: \"The input pattern is a RegExp.\" }),\n flag: z.string().meta({ description: \"The flag for RegExp.\" }),\n })\n .meta({ description: \"Regex pattern type.\" }),\n z\n .object({\n type: z\n .literal(\"string\")\n .meta({ description: \"The input pattern is a simple string.\" }),\n caseSensitive: z.boolean().default(true).meta({\n description: \"If true, the input pattern is case sensitive.\",\n }),\n })\n .meta({ description: \"String pattern type.\" }),\n] as const satisfies Array<z.ZodObject<{ type: z.ZodLiteral<string> }>>;\n\nexport const ReplaceHookMetaSchema = z\n .intersection(\n z.discriminatedUnion(\"type\", ReplaceHookMetaType),\n z\n .object({\n isInputPatternScripted: z.boolean().default(false).meta({\n description:\n \"If true, input pattern might contain additional javascript expression. Resolved before matching.\",\n }),\n isOutputScripted: z.boolean().default(false).meta({\n description:\n \"If true, output might contain additional javascript expression. Resolved after matching.\",\n }),\n priority: z.number().default(0).meta({\n description:\n \"The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional.\",\n }),\n })\n .prefault({}),\n )\n .meta({\n description: \"The meta data for the replace hook.\",\n });\n\nexport const ReplaceHookEntitySchema = z.object({\n input: z.string().meta({\n description:\n \"The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true.\",\n }),\n meta: ReplaceHookMetaSchema,\n output: z.string().meta({\n description:\n \"The output. May contain additional javascript expression if `isOutputScripted` is true.\",\n }),\n});\n\n/**\n * Replace hooks. It's technically RegExp for request, display, and response.\n */\nexport const ReplaceHookSchema = z\n .object({\n display: z\n .array(ReplaceHookEntitySchema)\n .meta({\n description:\n \"Replace hooks for display. Doesn't edit the data, only changes the display.\",\n })\n .default([]),\n input: z\n .array(ReplaceHookEntitySchema)\n .meta({\n description:\n \"Replace hooks for input. User chat input will be edited by this.\",\n })\n .default([]),\n output: z\n .array(ReplaceHookEntitySchema)\n .meta({\n description:\n \"Replace hooks for output. Character response will be edited by this.\",\n })\n .default([]),\n request: z\n .array(ReplaceHookEntitySchema)\n .meta({\n description:\n \"Replace hooks for request. AI request will be edited by this. Differs from `input` in that it's for AI request. Does not edit the data, only changes the fetching request.\",\n })\n .default([]),\n })\n .prefault({})\n .meta({\n description:\n \"Replace hooks. RegExp for request, display, and response.\",\n });\n"],"names":["ReplaceHookMetaType","z","ReplaceHookMetaSchema","ReplaceHookEntitySchema","ReplaceHookSchema"],"mappings":";AAEA,MAAMA,IAAsB;AAAA,EACxBC,EACK,OAAO;AAAA,IACJ,MAAMA,EACD,QAAQ,OAAO,EACf,KAAK,EAAE,aAAa,kCAAkC;AAAA,IAC3D,MAAMA,EAAE,OAAA,EAAS,KAAK,EAAE,aAAa,wBAAwB;AAAA,EAAA,CAChE,EACA,KAAK,EAAE,aAAa,uBAAuB;AAAA,EAChDA,EACK,OAAO;AAAA,IACJ,MAAMA,EACD,QAAQ,QAAQ,EAChB,KAAK,EAAE,aAAa,yCAAyC;AAAA,IAClE,eAAeA,EAAE,QAAA,EAAU,QAAQ,EAAI,EAAE,KAAK;AAAA,MAC1C,aAAa;AAAA,IAAA,CAChB;AAAA,EAAA,CACJ,EACA,KAAK,EAAE,aAAa,wBAAwB;AACrD,GAEaC,IAAwBD,EAChC;AAAA,EACGA,EAAE,mBAAmB,QAAQD,CAAmB;AAAA,EAChDC,EACK,OAAO;AAAA,IACJ,wBAAwBA,EAAE,QAAA,EAAU,QAAQ,EAAK,EAAE,KAAK;AAAA,MACpD,aACI;AAAA,IAAA,CACP;AAAA,IACD,kBAAkBA,EAAE,QAAA,EAAU,QAAQ,EAAK,EAAE,KAAK;AAAA,MAC9C,aACI;AAAA,IAAA,CACP;AAAA,IACD,UAAUA,EAAE,OAAA,EAAS,QAAQ,CAAC,EAAE,KAAK;AAAA,MACjC,aACI;AAAA,IAAA,CACP;AAAA,EAAA,CACJ,EACA,SAAS,CAAA,CAAE;AACpB,EACC,KAAK;AAAA,EACF,aAAa;AACjB,CAAC,GAEQE,IAA0BF,EAAE,OAAO;AAAA,EAC5C,OAAOA,EAAE,OAAA,EAAS,KAAK;AAAA,IACnB,aACI;AAAA,EAAA,CACP;AAAA,EACD,MAAMC;AAAA,EACN,QAAQD,EAAE,OAAA,EAAS,KAAK;AAAA,IACpB,aACI;AAAA,EAAA,CACP;AACL,CAAC,GAKYG,IAAoBH,EAC5B,OAAO;AAAA,EACJ,SAASA,EACJ,MAAME,CAAuB,EAC7B,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP,EACA,QAAQ,EAAE;AAAA,EACf,OAAOF,EACF,MAAME,CAAuB,EAC7B,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP,EACA,QAAQ,EAAE;AAAA,EACf,QAAQF,EACH,MAAME,CAAuB,EAC7B,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP,EACA,QAAQ,EAAE;AAAA,EACf,SAASF,EACJ,MAAME,CAAuB,EAC7B,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP,EACA,QAAQ,CAAA,CAAE;AACnB,CAAC,EACA,SAAS,EAAE,EACX,KAAK;AAAA,EACF,aACI;AACR,CAAC;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arisutalk/character-spec",
|
|
3
3
|
"description": "Character specification, schema & migration for ArisuTalk",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.14",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "concertypin",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@biomejs/biome": "^2.3.5",
|
|
39
|
-
"lint-staged": "^16.2.6",
|
|
40
39
|
"simple-git-hooks": "^2.13.1",
|
|
41
40
|
"tinyglobby": "^0.2.15",
|
|
42
41
|
"tsx": "^4.19.2",
|
|
@@ -59,4 +58,4 @@
|
|
|
59
58
|
}
|
|
60
59
|
},
|
|
61
60
|
"packageManager": "pnpm@10.16.1+sha512.0e155aa2629db8672b49e8475da6226aa4bdea85fdcdfdc15350874946d4f3c91faaf64cbdc4a5d1ab8002f473d5c3fcedcd197989cf0390f9badd3c04678706"
|
|
62
|
-
}
|
|
61
|
+
}
|