@arisutalk/character-spec 0.0.2 → 0.0.3
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.
|
@@ -7,29 +7,6 @@ export type Chat = {
|
|
|
7
7
|
id: string;
|
|
8
8
|
/** The ID of the character associated with this chat. */
|
|
9
9
|
characterId: string;
|
|
10
|
-
/** The list of messages in this chat. */
|
|
11
|
-
messages: {
|
|
12
|
-
/** Unique identifier for the message. */
|
|
13
|
-
id: string;
|
|
14
|
-
/** The role of the message sender. */
|
|
15
|
-
role: "user" | "assistant" | "system";
|
|
16
|
-
/** The content of the message. */
|
|
17
|
-
content: {
|
|
18
|
-
/** The message content is a simple string. */
|
|
19
|
-
type: "string";
|
|
20
|
-
/** The message content. */
|
|
21
|
-
data: string;
|
|
22
|
-
} | {
|
|
23
|
-
/** The file content is stored in the separated storage. */
|
|
24
|
-
type: "file";
|
|
25
|
-
/** URL of the file. */
|
|
26
|
-
data: string;
|
|
27
|
-
/** MIME type of the file. */
|
|
28
|
-
mimeType: string;
|
|
29
|
-
};
|
|
30
|
-
/** The timestamp when the message was created. */
|
|
31
|
-
timestamp?: number | undefined;
|
|
32
|
-
}[];
|
|
33
10
|
/** Optional title for the chat. */
|
|
34
11
|
title: string;
|
|
35
12
|
/** creation timestamp (unix epoch) */
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
import { LorebookDataSchema as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
id: e.string().meta({ description: "Unique identifier for the chat session." }),
|
|
7
|
-
characterId: e.string().meta({
|
|
1
|
+
import { z as t } from "zod";
|
|
2
|
+
import { LorebookDataSchema as e } from "./Lorebook.js";
|
|
3
|
+
const o = t.object({
|
|
4
|
+
id: t.string().meta({ description: "Unique identifier for the chat session." }),
|
|
5
|
+
characterId: t.string().meta({
|
|
8
6
|
description: "The ID of the character associated with this chat."
|
|
9
7
|
}),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
lorebook: t.shape.data.optional().meta({ description: "Chat specific lorebook data." })
|
|
8
|
+
title: t.string().default("Chat").meta({ description: "Optional title for the chat." }),
|
|
9
|
+
createdAt: t.number().default(Date.now).meta({ description: "creation timestamp (unix epoch)" }),
|
|
10
|
+
updatedAt: t.number().default(Date.now).meta({ description: "Last updated timestamp (unix epoch)" }),
|
|
11
|
+
lorebook: e.shape.data.optional().meta({ description: "Chat specific lorebook data." })
|
|
15
12
|
}).meta({ description: "Represents a chat session with a character." });
|
|
16
13
|
export {
|
|
17
|
-
|
|
14
|
+
o as ChatSchema
|
|
18
15
|
};
|
|
19
16
|
//# sourceMappingURL=Chat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.js","sources":["../../../src/types/v0/Character/Chat.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { LorebookDataSchema } from \"@/types/v0/Character/Lorebook\";\
|
|
1
|
+
{"version":3,"file":"Chat.js","sources":["../../../src/types/v0/Character/Chat.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { LorebookDataSchema } from \"@/types/v0/Character/Lorebook\";\n\n/**\n * @see {@link Chat}\n */\nexport const ChatSchema = z\n .object({\n id: z\n .string()\n .meta({ description: \"Unique identifier for the chat session.\" }),\n characterId: z.string().meta({\n description: \"The ID of the character associated with this chat.\",\n }),\n title: z\n .string()\n .default(\"Chat\")\n .meta({ description: \"Optional title for the chat.\" }),\n createdAt: z\n .number()\n .default(Date.now)\n .meta({ description: \"creation timestamp (unix epoch)\" }),\n updatedAt: z\n .number()\n .default(Date.now)\n .meta({ description: \"Last updated timestamp (unix epoch)\" }),\n lorebook: LorebookDataSchema.shape.data\n .optional()\n .meta({ description: \"Chat specific lorebook data.\" }),\n })\n .meta({ description: \"Represents a chat session with a character.\" });\n\n/**\n * Represents a chat session with a character.\n */\nexport type Chat = z.infer<typeof ChatSchema>;\n"],"names":["ChatSchema","z","LorebookDataSchema"],"mappings":";;AAMO,MAAMA,IAAaC,EACrB,OAAO;AAAA,EACJ,IAAIA,EACC,OAAA,EACA,KAAK,EAAE,aAAa,2CAA2C;AAAA,EACpE,aAAaA,EAAE,OAAA,EAAS,KAAK;AAAA,IACzB,aAAa;AAAA,EAAA,CAChB;AAAA,EACD,OAAOA,EACF,OAAA,EACA,QAAQ,MAAM,EACd,KAAK,EAAE,aAAa,gCAAgC;AAAA,EACzD,WAAWA,EACN,OAAA,EACA,QAAQ,KAAK,GAAG,EAChB,KAAK,EAAE,aAAa,kCAAA,CAAmC;AAAA,EAC5D,WAAWA,EACN,OAAA,EACA,QAAQ,KAAK,GAAG,EAChB,KAAK,EAAE,aAAa,sCAAA,CAAuC;AAAA,EAChE,UAAUC,EAAmB,MAAM,KAC9B,SAAA,EACA,KAAK,EAAE,aAAa,+BAAA,CAAgC;AAC7D,CAAC,EACA,KAAK,EAAE,aAAa,+CAA+C;"}
|
|
@@ -5,6 +5,8 @@ import type { z } from "zod";
|
|
|
5
5
|
export type Message = {
|
|
6
6
|
/** Unique identifier for the message. */
|
|
7
7
|
id: string;
|
|
8
|
+
/** The ID of the chat associated with this message. */
|
|
9
|
+
chatId: string;
|
|
8
10
|
/** The role of the message sender. */
|
|
9
11
|
role: "user" | "assistant" | "system";
|
|
10
12
|
/** The content of the message. */
|
|
@@ -16,6 +16,9 @@ const i = e.enum(["user", "assistant", "system"]).meta({ description: "Represent
|
|
|
16
16
|
}).meta({ description: "File message content." })
|
|
17
17
|
}, o = e.object({
|
|
18
18
|
id: e.string().meta({ description: "Unique identifier for the message." }),
|
|
19
|
+
chatId: e.string().meta({
|
|
20
|
+
description: "The ID of the chat associated with this message."
|
|
21
|
+
}),
|
|
19
22
|
role: i.meta({
|
|
20
23
|
description: "The role of the message sender."
|
|
21
24
|
}),
|
|
@@ -1 +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.literal(\"string\").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: 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.number().optional().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,EAAE,QAAQ,QAAQ,EAAE,KAAK;AAAA,MAC3B,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,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,EAAE,OAAA,EAAS,SAAA,EAAW,KAAK;AAAA,IAClC,aAAa;AAAA,EAAA,CAChB;AACL,CAAC,EACA,KAAK,EAAE,aAAa,kDAAkD;"}
|
|
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.literal(\"string\").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: 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 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().optional().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,EAAE,QAAQ,QAAQ,EAAE,KAAK;AAAA,MAC3B,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,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,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,SAAA,EAAW,KAAK;AAAA,IAClC,aAAa;AAAA,EAAA,CAChB;AACL,CAAC,EACA,KAAK,EAAE,aAAa,kDAAkD;"}
|
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.3",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
7
7
|
"name": "concertypin",
|
|
@@ -54,4 +54,4 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"packageManager": "pnpm@10.16.1+sha512.0e155aa2629db8672b49e8475da6226aa4bdea85fdcdfdc15350874946d4f3c91faaf64cbdc4a5d1ab8002f473d5c3fcedcd197989cf0390f9badd3c04678706"
|
|
57
|
-
}
|
|
57
|
+
}
|