@arisutalk/character-spec 0.0.0 → 0.0.1
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/LICENSE +202 -202
- package/README.md +152 -64
- package/dist/index.d.ts +15 -166
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/v0/Character/Assets.d.ts +30 -0
- package/dist/v0/Character/Assets.js +21 -0
- package/dist/v0/Character/Assets.js.map +1 -0
- package/dist/v0/Character/Character.d.ts +242 -0
- package/dist/v0/Character/Character.js +42 -0
- package/dist/v0/Character/Character.js.map +1 -0
- package/dist/v0/Character/Chat.d.ts +73 -0
- package/dist/v0/Character/Chat.js +19 -0
- package/dist/v0/Character/Chat.js.map +1 -0
- package/dist/v0/Character/Lorebook.d.ts +98 -0
- package/dist/v0/Character/Lorebook.js +68 -0
- package/dist/v0/Character/Lorebook.js.map +1 -0
- package/dist/v0/Character/Message.d.ts +32 -0
- package/dist/v0/Character/Message.js +34 -0
- package/dist/v0/Character/Message.js.map +1 -0
- package/dist/v0/Character/Meta.js +22 -0
- package/dist/v0/Character/Meta.js.map +1 -0
- package/dist/v0/Character/index.d.ts +6 -0
- package/dist/v0/Character.d.ts +6 -0
- package/dist/v0/Character.js +19 -0
- package/dist/v0/Character.js.map +1 -0
- package/dist/v0/Executables/Executable.d.ts +120 -0
- package/dist/v0/Executables/Executable.js +21 -0
- package/dist/v0/Executables/Executable.js.map +1 -0
- package/dist/v0/Executables/ReplaceHook.d.ts +161 -0
- package/dist/v0/Executables/ReplaceHook.js +57 -0
- package/dist/v0/Executables/ReplaceHook.js.map +1 -0
- package/dist/v0/Executables/index.d.ts +3 -0
- package/dist/v0/Executables.d.ts +3 -0
- package/dist/v0/Executables.js +9 -0
- package/dist/v0/Executables.js.map +1 -0
- package/dist/v0/index.d.ts +2 -0
- package/dist/v0/utils.d.ts +11 -0
- package/dist/v0/utils.js +14 -0
- package/dist/v0/utils.js.map +1 -0
- package/dist/v0.d.ts +2 -507
- package/dist/v0.js +4 -96
- package/dist/v0.js.map +1 -1
- package/package.json +13 -11
- package/dist/Character-Didq99iq.js +0 -157
- package/dist/Character-Didq99iq.js.map +0 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// Auto-generated TypeScript types from Zod schemas
|
|
2
|
+
// JSDoc comments are extracted from schema .meta({ description }) values
|
|
3
|
+
import type { z } from "zod";
|
|
4
|
+
|
|
5
|
+
export type LorebookData = {
|
|
6
|
+
/** The configuration for the lorebook. Not scriptable. */
|
|
7
|
+
config: {
|
|
8
|
+
/** The token limit for the lorebook. When exceeded, low-priority lorebooks will be deactivated. Positive integer. */
|
|
9
|
+
tokenLimit: number;
|
|
10
|
+
};
|
|
11
|
+
/** Contains the actual lorebooks. Duplicated id is not allowed. */
|
|
12
|
+
data: {
|
|
13
|
+
/** Internally generated ID. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Human readable name for the lorebook. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** The condition for the lorebook to be activated. If empty, it will not be activated. Use 'always' to activate without any condition. */
|
|
18
|
+
condition: ({
|
|
19
|
+
/** This condition matches the regex pattern. */
|
|
20
|
+
type: "regex_match";
|
|
21
|
+
/** The regex pattern to match. Scriptable. */
|
|
22
|
+
regexPattern: string;
|
|
23
|
+
/** The regex flags to use. Not scriptable. */
|
|
24
|
+
regexFlags?: string | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
/** This condition simply matches the text. */
|
|
27
|
+
type: "plain_text_match";
|
|
28
|
+
/** The text to match. Scriptable. Case insensitive. */
|
|
29
|
+
text: string;
|
|
30
|
+
} | {
|
|
31
|
+
/** This condition is always true. */
|
|
32
|
+
type: "always";
|
|
33
|
+
})[];
|
|
34
|
+
/** The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one. */
|
|
35
|
+
multipleConditionResolveStrategy?: ("all" | "any") | undefined;
|
|
36
|
+
/** The lorebook content to be added on AI prompt. Not for human reading. Scriptable. */
|
|
37
|
+
content: string;
|
|
38
|
+
/** The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0. */
|
|
39
|
+
priority?: number | undefined;
|
|
40
|
+
/** Whether the lorebook is enabled. */
|
|
41
|
+
enabled?: boolean | undefined;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export declare const LorebookDataSchema: z.ZodType<LorebookData>;
|
|
46
|
+
|
|
47
|
+
export type LorebookEntry = {
|
|
48
|
+
/** Internally generated ID. */
|
|
49
|
+
id: string;
|
|
50
|
+
/** Human readable name for the lorebook. */
|
|
51
|
+
name: string;
|
|
52
|
+
/** The condition for the lorebook to be activated. If empty, it will not be activated. Use 'always' to activate without any condition. */
|
|
53
|
+
condition: ({
|
|
54
|
+
/** This condition matches the regex pattern. */
|
|
55
|
+
type: "regex_match";
|
|
56
|
+
/** The regex pattern to match. Scriptable. */
|
|
57
|
+
regexPattern: string;
|
|
58
|
+
/** The regex flags to use. Not scriptable. */
|
|
59
|
+
regexFlags?: string | undefined;
|
|
60
|
+
} | {
|
|
61
|
+
/** This condition simply matches the text. */
|
|
62
|
+
type: "plain_text_match";
|
|
63
|
+
/** The text to match. Scriptable. Case insensitive. */
|
|
64
|
+
text: string;
|
|
65
|
+
} | {
|
|
66
|
+
/** This condition is always true. */
|
|
67
|
+
type: "always";
|
|
68
|
+
})[];
|
|
69
|
+
/** The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one. */
|
|
70
|
+
multipleConditionResolveStrategy?: ("all" | "any") | undefined;
|
|
71
|
+
/** The lorebook content to be added on AI prompt. Not for human reading. Scriptable. */
|
|
72
|
+
content: string;
|
|
73
|
+
/** The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0. */
|
|
74
|
+
priority?: number | undefined;
|
|
75
|
+
/** Whether the lorebook is enabled. */
|
|
76
|
+
enabled?: boolean | undefined;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export declare const LorebookEntrySchema: z.ZodType<LorebookEntry>;
|
|
80
|
+
|
|
81
|
+
export type LorebookCondition = {
|
|
82
|
+
/** This condition matches the regex pattern. */
|
|
83
|
+
type: "regex_match";
|
|
84
|
+
/** The regex pattern to match. Scriptable. */
|
|
85
|
+
regexPattern: string;
|
|
86
|
+
/** The regex flags to use. Not scriptable. */
|
|
87
|
+
regexFlags?: string | undefined;
|
|
88
|
+
} | {
|
|
89
|
+
/** This condition simply matches the text. */
|
|
90
|
+
type: "plain_text_match";
|
|
91
|
+
/** The text to match. Scriptable. Case insensitive. */
|
|
92
|
+
text: string;
|
|
93
|
+
} | {
|
|
94
|
+
/** This condition is always true. */
|
|
95
|
+
type: "always";
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export declare const LorebookConditionSchema: z.ZodType<LorebookCondition>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { unique as o } from "../utils.js";
|
|
3
|
+
const t = {
|
|
4
|
+
regex: e.object({
|
|
5
|
+
type: e.literal("regex_match").meta({
|
|
6
|
+
description: "This condition matches the regex pattern."
|
|
7
|
+
}),
|
|
8
|
+
regexPattern: e.string().meta({
|
|
9
|
+
description: "The regex pattern to match. Scriptable."
|
|
10
|
+
}),
|
|
11
|
+
regexFlags: e.string().optional().meta({
|
|
12
|
+
description: "The regex flags to use. Not scriptable."
|
|
13
|
+
})
|
|
14
|
+
}).meta({ description: "Regex match condition." }),
|
|
15
|
+
plainText: e.object({
|
|
16
|
+
type: e.literal("plain_text_match").meta({
|
|
17
|
+
description: "This condition simply matches the text."
|
|
18
|
+
}),
|
|
19
|
+
text: e.string().meta({
|
|
20
|
+
description: "The text to match. Scriptable. Case insensitive."
|
|
21
|
+
})
|
|
22
|
+
}).meta({ description: "Plain text match condition." }),
|
|
23
|
+
always: e.object({
|
|
24
|
+
type: e.literal("always").meta({ description: "This condition is always true." })
|
|
25
|
+
}).meta({ description: "Always active condition." })
|
|
26
|
+
}, i = e.discriminatedUnion("type", [
|
|
27
|
+
t.regex,
|
|
28
|
+
t.plainText,
|
|
29
|
+
t.always
|
|
30
|
+
]), a = e.object({
|
|
31
|
+
id: e.string().meta({ description: "Internally generated ID." }),
|
|
32
|
+
name: e.string().meta({ description: "Human readable name for the lorebook." }),
|
|
33
|
+
condition: e.array(i).default([]).meta({
|
|
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
|
+
}),
|
|
36
|
+
multipleConditionResolveStrategy: e.enum(["all", "any"]).optional().meta({
|
|
37
|
+
description: "The strategy for resolving multiple conditions. 'all' means all must be met, 'any' means at least one."
|
|
38
|
+
}),
|
|
39
|
+
content: e.string().meta({
|
|
40
|
+
description: "The lorebook content to be added on AI prompt. Not for human reading. Scriptable."
|
|
41
|
+
}),
|
|
42
|
+
priority: e.number().optional().meta({
|
|
43
|
+
description: "The priority of the lorebook. Higher priority means it will be activated first. May be negative or decimal. Base is 0."
|
|
44
|
+
}),
|
|
45
|
+
enabled: e.boolean().optional().meta({ description: "Whether the lorebook is enabled." })
|
|
46
|
+
}).meta({
|
|
47
|
+
description: "A lorebook entry. Small part of prompts activated by session's text matching."
|
|
48
|
+
}), s = e.object({
|
|
49
|
+
config: e.object({
|
|
50
|
+
tokenLimit: e.number().int().min(1).meta({
|
|
51
|
+
description: "The token limit for the lorebook. When exceeded, low-priority lorebooks will be deactivated. Positive integer."
|
|
52
|
+
})
|
|
53
|
+
}).meta({
|
|
54
|
+
description: "The configuration for the lorebook. Not scriptable."
|
|
55
|
+
}),
|
|
56
|
+
data: e.array(a).refine(o("id"), { message: "Not unique key: id" }).default([]).meta({
|
|
57
|
+
description: "Contains the actual lorebooks. Duplicated id is not allowed."
|
|
58
|
+
})
|
|
59
|
+
}).meta({
|
|
60
|
+
description: "Object containing all data for the lorebook. Meant to be stored in the database."
|
|
61
|
+
});
|
|
62
|
+
export {
|
|
63
|
+
t as LorebookConditionDetailSchema,
|
|
64
|
+
i as LorebookConditionSchema,
|
|
65
|
+
s as LorebookDataSchema,
|
|
66
|
+
a as LorebookEntrySchema
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=Lorebook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lorebook.js","sources":["../../../src/types/v0/Character/Lorebook.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { unique } from \"@/types/v0/utils\";\n\n/**\n * @see {@link LorebookConditionSchema}\n */\nexport const LorebookConditionDetailSchema = {\n regex: z\n .object({\n type: z\n .literal(\"regex_match\")\n .meta({\n description: \"This condition matches the regex pattern.\",\n }),\n regexPattern: z\n .string()\n .meta({\n description: \"The regex pattern to match. Scriptable.\",\n }),\n regexFlags: z\n .string()\n .optional()\n .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\n .literal(\"plain_text_match\")\n .meta({\n description: \"This condition simply matches the text.\",\n }),\n text: z\n .string()\n .meta({\n description:\n \"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 LorebookConditionDetailSchema.regex,\n LorebookConditionDetailSchema.plainText,\n LorebookConditionDetailSchema.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.array(LorebookConditionSchema).default([]).meta({\n description:\n \"The condition for the lorebook to be activated. If empty, it will not be activated. Use 'always' to activate without any condition.\",\n }),\n multipleConditionResolveStrategy: z\n .enum([\"all\", \"any\"])\n .optional()\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\n .string()\n .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 .optional()\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: z.number().int().min(1).meta({\n description:\n \"The token limit for the lorebook. When exceeded, low-priority lorebooks will be deactivated. Positive integer.\",\n }),\n })\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 .meta({\n description:\n \"Object containing all 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":["LorebookConditionDetailSchema","z","LorebookConditionSchema","LorebookEntrySchema","LorebookDataSchema","unique"],"mappings":";;AAMO,MAAMA,IAAgC;AAAA,EACzC,OAAOC,EACF,OAAO;AAAA,IACJ,MAAMA,EACD,QAAQ,aAAa,EACrB,KAAK;AAAA,MACF,aAAa;AAAA,IAAA,CAChB;AAAA,IACL,cAAcA,EACT,OAAA,EACA,KAAK;AAAA,MACF,aAAa;AAAA,IAAA,CAChB;AAAA,IACL,YAAYA,EACP,OAAA,EACA,SAAA,EACA,KAAK;AAAA,MACF,aAAa;AAAA,IAAA,CAChB;AAAA,EAAA,CACR,EACA,KAAK,EAAE,aAAa,0BAA0B;AAAA,EACnD,WAAWA,EACN,OAAO;AAAA,IACJ,MAAMA,EACD,QAAQ,kBAAkB,EAC1B,KAAK;AAAA,MACF,aAAa;AAAA,IAAA,CAChB;AAAA,IACL,MAAMA,EACD,OAAA,EACA,KAAK;AAAA,MACF,aACI;AAAA,IAAA,CACP;AAAA,EAAA,CACR,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,EAA8B;AAAA,EAC9BA,EAA8B;AAAA,EAC9BA,EAA8B;AAClC,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,EAAE,MAAMC,CAAuB,EAAE,QAAQ,CAAA,CAAE,EAAE,KAAK;AAAA,IACzD,aACI;AAAA,EAAA,CACP;AAAA,EACD,kCAAkCD,EAC7B,KAAK,CAAC,OAAO,KAAK,CAAC,EACnB,SAAA,EACA,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AAAA,EACL,SAASA,EACJ,OAAA,EACA,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AAAA,EACL,UAAUA,EAAE,OAAA,EAAS,SAAA,EAAW,KAAK;AAAA,IACjC,aACI;AAAA,EAAA,CACP;AAAA,EACD,SAASA,EACJ,UACA,SAAA,EACA,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,YAAYA,EAAE,SAAS,MAAM,IAAI,CAAC,EAAE,KAAK;AAAA,MACrC,aACI;AAAA,IAAA,CACP;AAAA,EAAA,CACJ,EACA,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AAAA,EACL,MAAMA,EACD,MAAME,CAAmB,EACzB,OAAOE,EAAO,IAAI,GAAG,EAAE,SAAS,sBAAsB,EACtD,QAAQ,CAAA,CAAE,EACV,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AACT,CAAC,EACA,KAAK;AAAA,EACF,aACI;AACR,CAAC;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Auto-generated TypeScript types from Zod schemas
|
|
2
|
+
// JSDoc comments are extracted from schema .meta({ description }) values
|
|
3
|
+
import type { z } from "zod";
|
|
4
|
+
|
|
5
|
+
export type Message = {
|
|
6
|
+
/** Unique identifier for the message. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** The role of the message sender. */
|
|
9
|
+
role: "user" | "assistant" | "system";
|
|
10
|
+
/** The content of the message. */
|
|
11
|
+
content: {
|
|
12
|
+
/** The message content is a simple string. */
|
|
13
|
+
type: "string";
|
|
14
|
+
/** The message content. */
|
|
15
|
+
data: string;
|
|
16
|
+
} | {
|
|
17
|
+
/** The file content is stored in the separated storage. */
|
|
18
|
+
type: "file";
|
|
19
|
+
/** URL of the file. */
|
|
20
|
+
data: string;
|
|
21
|
+
/** MIME type of the file. */
|
|
22
|
+
mimeType: string;
|
|
23
|
+
};
|
|
24
|
+
/** The timestamp when the message was created. */
|
|
25
|
+
timestamp?: number | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export declare const MessageSchema: z.ZodType<Message>;
|
|
29
|
+
|
|
30
|
+
export type Role = "user" | "assistant" | "system";
|
|
31
|
+
|
|
32
|
+
export declare const RoleSchema: z.ZodType<Role>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { ImageURLSchema as s } from "../utils.js";
|
|
3
|
+
const i = e.enum(["user", "assistant", "system"]).meta({ description: "Represents the role of the message sender." }), t = {
|
|
4
|
+
text: e.object({
|
|
5
|
+
type: e.literal("string").meta({
|
|
6
|
+
description: "The message content is a simple string."
|
|
7
|
+
}),
|
|
8
|
+
data: e.string().meta({ description: "The message content." })
|
|
9
|
+
}).meta({ description: "Text message content." }),
|
|
10
|
+
file: e.object({
|
|
11
|
+
type: e.literal("file").meta({
|
|
12
|
+
description: "The file content is stored in the separated storage."
|
|
13
|
+
}),
|
|
14
|
+
data: s.meta({ description: "URL of the file." }),
|
|
15
|
+
mimeType: e.string().meta({ description: "MIME type of the file." })
|
|
16
|
+
}).meta({ description: "File message content." })
|
|
17
|
+
}, o = e.object({
|
|
18
|
+
id: e.string().meta({ description: "Unique identifier for the message." }),
|
|
19
|
+
role: i.meta({
|
|
20
|
+
description: "The role of the message sender."
|
|
21
|
+
}),
|
|
22
|
+
content: e.discriminatedUnion("type", [
|
|
23
|
+
t.text,
|
|
24
|
+
t.file
|
|
25
|
+
]).meta({ description: "The content of the message." }),
|
|
26
|
+
timestamp: e.number().optional().meta({
|
|
27
|
+
description: "The timestamp when the message was created."
|
|
28
|
+
})
|
|
29
|
+
}).meta({ description: "Represents a single message in a chat history." });
|
|
30
|
+
export {
|
|
31
|
+
o as MessageSchema,
|
|
32
|
+
i as RoleSchema
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.js","sources":["../../../src/types/v0/Character/Message.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ImageURLSchema } 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\n .literal(\"string\")\n .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\n .literal(\"file\")\n .meta({\n description:\n \"The file content is stored in the separated storage.\",\n }),\n data: ImageURLSchema.meta({ description: \"URL of the file.\" }),\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 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\n .number()\n .optional()\n .meta({\n description: \"The timestamp when the message was created.\",\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","ImageURLSchema","MessageSchema"],"mappings":";;AAMO,MAAMA,IAAaC,EACrB,KAAK,CAAC,QAAQ,aAAa,QAAQ,CAAC,EACpC,KAAK,EAAE,aAAa,8CAA8C,GAEjEC,IAAuB;AAAA,EACzB,MAAMD,EACD,OAAO;AAAA,IACJ,MAAMA,EACD,QAAQ,QAAQ,EAChB,KAAK;AAAA,MACF,aAAa;AAAA,IAAA,CAChB;AAAA,IACL,MAAMA,EAAE,OAAA,EAAS,KAAK,EAAE,aAAa,wBAAwB;AAAA,EAAA,CAChE,EACA,KAAK,EAAE,aAAa,yBAAyB;AAAA,EAClD,MAAMA,EACD,OAAO;AAAA,IACJ,MAAMA,EACD,QAAQ,MAAM,EACd,KAAK;AAAA,MACF,aACI;AAAA,IAAA,CACP;AAAA,IACL,MAAME,EAAe,KAAK,EAAE,aAAa,oBAAoB;AAAA,IAC7D,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,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,EACN,OAAA,EACA,SAAA,EACA,KAAK;AAAA,IACF,aAAa;AAAA,EAAA,CAChB;AACT,CAAC,EACA,KAAK,EAAE,aAAa,kDAAkD;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as e from "zod";
|
|
2
|
+
const t = e.object({
|
|
3
|
+
author: e.string().optional().meta({
|
|
4
|
+
description: "The author of the character. Optional."
|
|
5
|
+
}),
|
|
6
|
+
license: e.string().default("ARR").meta({
|
|
7
|
+
description: "The license of the character. Optional. Using SPDX license identifier or URL is recommended. Default: ARR, which means the character is all rights reserved by the author."
|
|
8
|
+
}),
|
|
9
|
+
version: e.string().optional().meta({
|
|
10
|
+
description: "The version of the character. Optional."
|
|
11
|
+
}),
|
|
12
|
+
distributedOn: e.string().optional().meta({
|
|
13
|
+
description: "The distributed page of the character.URL is recommended. Optional."
|
|
14
|
+
}),
|
|
15
|
+
additionalInfo: e.string().optional().meta({
|
|
16
|
+
description: "Additional information about the character, which can't be represented by other fields. Optional."
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
t as MetaSchema
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Meta.js.map
|
|
@@ -0,0 +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 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"],"names":["MetaSchema","z"],"mappings":";AAEO,MAAMA,IAAaC,EAAE,OAAO;AAAA,EAC/B,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;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AssetEntitySchema as a, AssetsSettingSchema as t } from "./Character/Assets.js";
|
|
2
|
+
import { CharacterPromptDataSchema as m, CharacterSchema as h } from "./Character/Character.js";
|
|
3
|
+
import { ChatSchema as S } from "./Character/Chat.js";
|
|
4
|
+
import { LorebookConditionDetailSchema as n, LorebookConditionSchema as s, LorebookDataSchema as p, LorebookEntrySchema as f } from "./Character/Lorebook.js";
|
|
5
|
+
import { MessageSchema as C, RoleSchema as b } from "./Character/Message.js";
|
|
6
|
+
export {
|
|
7
|
+
a as AssetEntitySchema,
|
|
8
|
+
t as AssetsSettingSchema,
|
|
9
|
+
m as CharacterPromptDataSchema,
|
|
10
|
+
h as CharacterSchema,
|
|
11
|
+
S as ChatSchema,
|
|
12
|
+
n as LorebookConditionDetailSchema,
|
|
13
|
+
s as LorebookConditionSchema,
|
|
14
|
+
p as LorebookDataSchema,
|
|
15
|
+
f as LorebookEntrySchema,
|
|
16
|
+
C as MessageSchema,
|
|
17
|
+
b as RoleSchema
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=Character.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Character.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Auto-generated TypeScript types from Zod schemas
|
|
2
|
+
// JSDoc comments are extracted from schema .meta({ description }) values
|
|
3
|
+
import type { z } from "zod";
|
|
4
|
+
|
|
5
|
+
export type ScriptSetting = {
|
|
6
|
+
/** Runtime settings for the script. Controls runtime environment. All values capped at user's configuration. */
|
|
7
|
+
runtimeSetting: {
|
|
8
|
+
/** The maximum memory usage of the script, in MB. Not an exact limit. May be exceeded or ignored. */
|
|
9
|
+
mem?: number | undefined;
|
|
10
|
+
};
|
|
11
|
+
/** Replace hooks for the script. */
|
|
12
|
+
replaceHooks: {
|
|
13
|
+
/** Replace hooks for display. Doesn't edit the data, only changes the display. */
|
|
14
|
+
display: {
|
|
15
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
16
|
+
input: string;
|
|
17
|
+
/** The meta data for the replace hook. */
|
|
18
|
+
meta: ({
|
|
19
|
+
/** The input pattern is a RegExp. */
|
|
20
|
+
type: "regex";
|
|
21
|
+
/** The flag for RegExp. */
|
|
22
|
+
flag: string;
|
|
23
|
+
} | {
|
|
24
|
+
/** The input pattern is a simple string. */
|
|
25
|
+
type: "string";
|
|
26
|
+
/** If true, the input pattern is case sensitive. */
|
|
27
|
+
caseSensitive: boolean;
|
|
28
|
+
}) & {
|
|
29
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
30
|
+
isInputPatternScripted: boolean;
|
|
31
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
32
|
+
isOutputScripted: boolean;
|
|
33
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
34
|
+
priority: number;
|
|
35
|
+
};
|
|
36
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
37
|
+
output: string;
|
|
38
|
+
}[];
|
|
39
|
+
/** Replace hooks for input. User chat input will be edited by this. */
|
|
40
|
+
input: {
|
|
41
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
42
|
+
input: string;
|
|
43
|
+
/** The meta data for the replace hook. */
|
|
44
|
+
meta: ({
|
|
45
|
+
/** The input pattern is a RegExp. */
|
|
46
|
+
type: "regex";
|
|
47
|
+
/** The flag for RegExp. */
|
|
48
|
+
flag: string;
|
|
49
|
+
} | {
|
|
50
|
+
/** The input pattern is a simple string. */
|
|
51
|
+
type: "string";
|
|
52
|
+
/** If true, the input pattern is case sensitive. */
|
|
53
|
+
caseSensitive: boolean;
|
|
54
|
+
}) & {
|
|
55
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
56
|
+
isInputPatternScripted: boolean;
|
|
57
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
58
|
+
isOutputScripted: boolean;
|
|
59
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
60
|
+
priority: number;
|
|
61
|
+
};
|
|
62
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
63
|
+
output: string;
|
|
64
|
+
}[];
|
|
65
|
+
/** Replace hooks for output. Character response will be edited by this. */
|
|
66
|
+
output: {
|
|
67
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
68
|
+
input: string;
|
|
69
|
+
/** The meta data for the replace hook. */
|
|
70
|
+
meta: ({
|
|
71
|
+
/** The input pattern is a RegExp. */
|
|
72
|
+
type: "regex";
|
|
73
|
+
/** The flag for RegExp. */
|
|
74
|
+
flag: string;
|
|
75
|
+
} | {
|
|
76
|
+
/** The input pattern is a simple string. */
|
|
77
|
+
type: "string";
|
|
78
|
+
/** If true, the input pattern is case sensitive. */
|
|
79
|
+
caseSensitive: boolean;
|
|
80
|
+
}) & {
|
|
81
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
82
|
+
isInputPatternScripted: boolean;
|
|
83
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
84
|
+
isOutputScripted: boolean;
|
|
85
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
86
|
+
priority: number;
|
|
87
|
+
};
|
|
88
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
89
|
+
output: string;
|
|
90
|
+
}[];
|
|
91
|
+
/** 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. */
|
|
92
|
+
request: {
|
|
93
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
94
|
+
input: string;
|
|
95
|
+
/** The meta data for the replace hook. */
|
|
96
|
+
meta: ({
|
|
97
|
+
/** The input pattern is a RegExp. */
|
|
98
|
+
type: "regex";
|
|
99
|
+
/** The flag for RegExp. */
|
|
100
|
+
flag: string;
|
|
101
|
+
} | {
|
|
102
|
+
/** The input pattern is a simple string. */
|
|
103
|
+
type: "string";
|
|
104
|
+
/** If true, the input pattern is case sensitive. */
|
|
105
|
+
caseSensitive: boolean;
|
|
106
|
+
}) & {
|
|
107
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
108
|
+
isInputPatternScripted: boolean;
|
|
109
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
110
|
+
isOutputScripted: boolean;
|
|
111
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
112
|
+
priority: number;
|
|
113
|
+
};
|
|
114
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
115
|
+
output: string;
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export declare const ScriptSettingSchema: z.ZodType<ScriptSetting>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { ReplaceHookSchema as t } from "./ReplaceHook.js";
|
|
3
|
+
import { positiveInteger as o } from "../utils.js";
|
|
4
|
+
const c = e.object({
|
|
5
|
+
runtimeSetting: e.object({
|
|
6
|
+
mem: o.optional().meta({
|
|
7
|
+
description: "The maximum memory usage of the script, in MB. Not an exact limit. May be exceeded or ignored."
|
|
8
|
+
})
|
|
9
|
+
}).meta({
|
|
10
|
+
description: "Runtime settings for the script. Controls runtime environment. All values capped at user's configuration."
|
|
11
|
+
}),
|
|
12
|
+
replaceHooks: t.meta({
|
|
13
|
+
description: "Replace hooks for the script."
|
|
14
|
+
})
|
|
15
|
+
}).meta({
|
|
16
|
+
description: "Script settings for character. Includes hooks and script settings."
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
c as ScriptSettingSchema
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=Executable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Executable.js","sources":["../../../src/types/v0/Executables/Executable.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ReplaceHookSchema } from \"@/types/v0/Executables/ReplaceHook\";\nimport { positiveInteger } from \"@/types/v0/utils\";\n\n/**\n * This is the script for character. It includes hook, script settings, something else.\n */\nexport const ScriptSettingSchema = z\n .object({\n runtimeSetting: z\n .object({\n mem: positiveInteger.optional().meta({\n description:\n \"The maximum memory usage of the script, in MB. Not an exact limit. May be exceeded or ignored.\",\n }),\n })\n .meta({\n description:\n \"Runtime settings for the script. Controls runtime environment. All values capped at user's configuration.\",\n }),\n replaceHooks: ReplaceHookSchema.meta({\n description: \"Replace hooks for the script.\",\n }),\n })\n .meta({\n description:\n \"Script settings for character. Includes hooks and script settings.\",\n });\n"],"names":["ScriptSettingSchema","z","positiveInteger","ReplaceHookSchema"],"mappings":";;;AAOO,MAAMA,IAAsBC,EAC9B,OAAO;AAAA,EACJ,gBAAgBA,EACX,OAAO;AAAA,IACJ,KAAKC,EAAgB,SAAA,EAAW,KAAK;AAAA,MACjC,aACI;AAAA,IAAA,CACP;AAAA,EAAA,CACJ,EACA,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AAAA,EACL,cAAcC,EAAkB,KAAK;AAAA,IACjC,aAAa;AAAA,EAAA,CAChB;AACL,CAAC,EACA,KAAK;AAAA,EACF,aACI;AACR,CAAC;"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Auto-generated TypeScript types from Zod schemas
|
|
2
|
+
// JSDoc comments are extracted from schema .meta({ description }) values
|
|
3
|
+
import type { z } from "zod";
|
|
4
|
+
|
|
5
|
+
export type ReplaceHook = {
|
|
6
|
+
/** Replace hooks for display. Doesn't edit the data, only changes the display. */
|
|
7
|
+
display: {
|
|
8
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
9
|
+
input: string;
|
|
10
|
+
/** The meta data for the replace hook. */
|
|
11
|
+
meta: ({
|
|
12
|
+
/** The input pattern is a RegExp. */
|
|
13
|
+
type: "regex";
|
|
14
|
+
/** The flag for RegExp. */
|
|
15
|
+
flag: string;
|
|
16
|
+
} | {
|
|
17
|
+
/** The input pattern is a simple string. */
|
|
18
|
+
type: "string";
|
|
19
|
+
/** If true, the input pattern is case sensitive. */
|
|
20
|
+
caseSensitive: boolean;
|
|
21
|
+
}) & {
|
|
22
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
23
|
+
isInputPatternScripted: boolean;
|
|
24
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
25
|
+
isOutputScripted: boolean;
|
|
26
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
27
|
+
priority: number;
|
|
28
|
+
};
|
|
29
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
30
|
+
output: string;
|
|
31
|
+
}[];
|
|
32
|
+
/** Replace hooks for input. User chat input will be edited by this. */
|
|
33
|
+
input: {
|
|
34
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
35
|
+
input: string;
|
|
36
|
+
/** The meta data for the replace hook. */
|
|
37
|
+
meta: ({
|
|
38
|
+
/** The input pattern is a RegExp. */
|
|
39
|
+
type: "regex";
|
|
40
|
+
/** The flag for RegExp. */
|
|
41
|
+
flag: string;
|
|
42
|
+
} | {
|
|
43
|
+
/** The input pattern is a simple string. */
|
|
44
|
+
type: "string";
|
|
45
|
+
/** If true, the input pattern is case sensitive. */
|
|
46
|
+
caseSensitive: boolean;
|
|
47
|
+
}) & {
|
|
48
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
49
|
+
isInputPatternScripted: boolean;
|
|
50
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
51
|
+
isOutputScripted: boolean;
|
|
52
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
53
|
+
priority: number;
|
|
54
|
+
};
|
|
55
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
56
|
+
output: string;
|
|
57
|
+
}[];
|
|
58
|
+
/** Replace hooks for output. Character response will be edited by this. */
|
|
59
|
+
output: {
|
|
60
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
61
|
+
input: string;
|
|
62
|
+
/** The meta data for the replace hook. */
|
|
63
|
+
meta: ({
|
|
64
|
+
/** The input pattern is a RegExp. */
|
|
65
|
+
type: "regex";
|
|
66
|
+
/** The flag for RegExp. */
|
|
67
|
+
flag: string;
|
|
68
|
+
} | {
|
|
69
|
+
/** The input pattern is a simple string. */
|
|
70
|
+
type: "string";
|
|
71
|
+
/** If true, the input pattern is case sensitive. */
|
|
72
|
+
caseSensitive: boolean;
|
|
73
|
+
}) & {
|
|
74
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
75
|
+
isInputPatternScripted: boolean;
|
|
76
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
77
|
+
isOutputScripted: boolean;
|
|
78
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
79
|
+
priority: number;
|
|
80
|
+
};
|
|
81
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
82
|
+
output: string;
|
|
83
|
+
}[];
|
|
84
|
+
/** 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. */
|
|
85
|
+
request: {
|
|
86
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
87
|
+
input: string;
|
|
88
|
+
/** The meta data for the replace hook. */
|
|
89
|
+
meta: ({
|
|
90
|
+
/** The input pattern is a RegExp. */
|
|
91
|
+
type: "regex";
|
|
92
|
+
/** The flag for RegExp. */
|
|
93
|
+
flag: string;
|
|
94
|
+
} | {
|
|
95
|
+
/** The input pattern is a simple string. */
|
|
96
|
+
type: "string";
|
|
97
|
+
/** If true, the input pattern is case sensitive. */
|
|
98
|
+
caseSensitive: boolean;
|
|
99
|
+
}) & {
|
|
100
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
101
|
+
isInputPatternScripted: boolean;
|
|
102
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
103
|
+
isOutputScripted: boolean;
|
|
104
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
105
|
+
priority: number;
|
|
106
|
+
};
|
|
107
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
108
|
+
output: string;
|
|
109
|
+
}[];
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export declare const ReplaceHookSchema: z.ZodType<ReplaceHook>;
|
|
113
|
+
|
|
114
|
+
export type ReplaceHookEntity = {
|
|
115
|
+
/** The input pattern. May contain additional javascript expression if `isInputPatternScripted` is true. */
|
|
116
|
+
input: string;
|
|
117
|
+
/** The meta data for the replace hook. */
|
|
118
|
+
meta: ({
|
|
119
|
+
/** The input pattern is a RegExp. */
|
|
120
|
+
type: "regex";
|
|
121
|
+
/** The flag for RegExp. */
|
|
122
|
+
flag: string;
|
|
123
|
+
} | {
|
|
124
|
+
/** The input pattern is a simple string. */
|
|
125
|
+
type: "string";
|
|
126
|
+
/** If true, the input pattern is case sensitive. */
|
|
127
|
+
caseSensitive: boolean;
|
|
128
|
+
}) & {
|
|
129
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
130
|
+
isInputPatternScripted: boolean;
|
|
131
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
132
|
+
isOutputScripted: boolean;
|
|
133
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
134
|
+
priority: number;
|
|
135
|
+
};
|
|
136
|
+
/** The output. May contain additional javascript expression if `isOutputScripted` is true. */
|
|
137
|
+
output: string;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export declare const ReplaceHookEntitySchema: z.ZodType<ReplaceHookEntity>;
|
|
141
|
+
|
|
142
|
+
export type ReplaceHookMeta = ({
|
|
143
|
+
/** The input pattern is a RegExp. */
|
|
144
|
+
type: "regex";
|
|
145
|
+
/** The flag for RegExp. */
|
|
146
|
+
flag: string;
|
|
147
|
+
} | {
|
|
148
|
+
/** The input pattern is a simple string. */
|
|
149
|
+
type: "string";
|
|
150
|
+
/** If true, the input pattern is case sensitive. */
|
|
151
|
+
caseSensitive: boolean;
|
|
152
|
+
}) & {
|
|
153
|
+
/** If true, input pattern might contain additional javascript expression. Resolved before matching. */
|
|
154
|
+
isInputPatternScripted: boolean;
|
|
155
|
+
/** If true, output might contain additional javascript expression. Resolved after matching. */
|
|
156
|
+
isOutputScripted: boolean;
|
|
157
|
+
/** The priority of the replace hook. Higher number means higher priority. Can be positive, negative, or fractional. */
|
|
158
|
+
priority: number;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export declare const ReplaceHookMetaSchema: z.ZodType<ReplaceHookMeta>;
|