@arisutalk/character-spec 0.0.3 → 0.0.4

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.
@@ -12,15 +12,6 @@ export type AssetsSetting = {
12
12
  /** The name of the asset. Used as the file name. Should be unique. */
13
13
  name: string;
14
14
  }[];
15
- /** The inlays of the character. It is not intended to be exported as public. */
16
- inlays: {
17
- /** The URL of the asset. */
18
- url: string;
19
- /** MIME type of the asset. Usually `image/*` or `video/*`. */
20
- mimeType: string;
21
- /** The name of the asset. Used as the file name. Should be unique. */
22
- name: string;
23
- }[];
24
15
  };
25
16
 
26
17
  export declare const AssetsSettingSchema: z.ZodType<AssetsSetting>;
@@ -1,21 +1,18 @@
1
1
  import { z as e } from "zod";
2
- import { ImageURLSchema as a, unique as t } from "../utils.js";
3
- const s = e.object({
4
- url: a.meta({ description: "The URL of the asset." }),
2
+ import { ImageURLSchema as t, unique as s } from "../utils.js";
3
+ const a = e.object({
4
+ url: t.meta({ description: "The URL of the asset." }),
5
5
  mimeType: e.string().meta({
6
6
  description: "MIME type of the asset. Usually `image/*` or `video/*`."
7
7
  }),
8
8
  name: e.string().meta({
9
9
  description: "The name of the asset. Used as the file name. Should be unique."
10
10
  })
11
- }), o = e.object({
12
- assets: e.array(s).refine(t("name"), { message: "Not unique key: name" }).meta({ description: "The assets of the character." }),
13
- inlays: e.array(s).refine(t("name"), { message: "Not unique key: name" }).meta({
14
- description: "The inlays of the character. It is not intended to be exported as public."
15
- })
11
+ }), m = e.object({
12
+ assets: e.array(a).refine(s("name"), { message: "Not unique key: name" }).meta({ description: "The assets of the character." })
16
13
  }).meta({ description: "Settings for character assets." });
17
14
  export {
18
- s as AssetEntitySchema,
19
- o as AssetsSettingSchema
15
+ a as AssetEntitySchema,
16
+ m as AssetsSettingSchema
20
17
  };
21
18
  //# sourceMappingURL=Assets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Assets.js","sources":["../../../src/types/v0/Character/Assets.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ImageURLSchema, unique } from \"@/types/v0/utils\";\n\nexport const AssetEntitySchema = z.object({\n url: ImageURLSchema.meta({ description: \"The URL of the asset.\" }),\n mimeType: z.string().meta({\n description: \"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});\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 inlays: z\n .array(AssetEntitySchema)\n .refine(unique(\"name\"), { message: \"Not unique key: name\" })\n .meta({\n description:\n \"The inlays of the character. It is not intended to be exported as public.\",\n }),\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","ImageURLSchema","AssetsSettingSchema","unique"],"mappings":";;AAGO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACtC,KAAKC,EAAe,KAAK,EAAE,aAAa,yBAAyB;AAAA,EACjE,UAAUD,EAAE,OAAA,EAAS,KAAK;AAAA,IACtB,aAAa;AAAA,EAAA,CAChB;AAAA,EACD,MAAMA,EAAE,OAAA,EAAS,KAAK;AAAA,IAClB,aACI;AAAA,EAAA,CACP;AACL,CAAC,GAKYE,IAAsBF,EAC9B,OAAO;AAAA,EACJ,QAAQA,EACH,MAAMD,CAAiB,EACvB,OAAOI,EAAO,MAAM,GAAG,EAAE,SAAS,wBAAwB,EAC1D,KAAK,EAAE,aAAa,gCAAgC;AAAA,EACzD,QAAQH,EACH,MAAMD,CAAiB,EACvB,OAAOI,EAAO,MAAM,GAAG,EAAE,SAAS,uBAAA,CAAwB,EAC1D,KAAK;AAAA,IACF,aACI;AAAA,EAAA,CACP;AACT,CAAC,EACA,KAAK,EAAE,aAAa,kCAAkC;"}
1
+ {"version":3,"file":"Assets.js","sources":["../../../src/types/v0/Character/Assets.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { ImageURLSchema, unique } from \"@/types/v0/utils\";\n\nexport const AssetEntitySchema = z.object({\n url: ImageURLSchema.meta({ description: \"The URL of the asset.\" }),\n mimeType: z.string().meta({\n description: \"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});\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","ImageURLSchema","AssetsSettingSchema","unique"],"mappings":";;AAGO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACtC,KAAKC,EAAe,KAAK,EAAE,aAAa,yBAAyB;AAAA,EACjE,UAAUD,EAAE,OAAA,EAAS,KAAK;AAAA,IACtB,aAAa;AAAA,EAAA,CAChB;AAAA,EACD,MAAMA,EAAE,OAAA,EAAS,KAAK;AAAA,IAClB,aACI;AAAA,EAAA,CACP;AACL,CAAC,GAKYE,IAAsBF,EAC9B,OAAO;AAAA,EACJ,QAAQA,EACH,MAAMD,CAAiB,EACvB,OAAOI,EAAO,MAAM,GAAG,EAAE,SAAS,wBAAwB,EAC1D,KAAK,EAAE,aAAa,gCAAgC;AAC7D,CAAC,EACA,KAAK,EAAE,aAAa,kCAAkC;"}
@@ -199,15 +199,6 @@ export type Character = {
199
199
  /** The name of the asset. Used as the file name. Should be unique. */
200
200
  name: string;
201
201
  }[];
202
- /** The inlays of the character. It is not intended to be exported as public. */
203
- inlays: {
204
- /** The URL of the asset. */
205
- url: string;
206
- /** MIME type of the asset. Usually `image/*` or `video/*`. */
207
- mimeType: string;
208
- /** The name of the asset. Used as the file name. Should be unique. */
209
- name: string;
210
- }[];
211
202
  };
212
203
  };
213
204
 
@@ -25,6 +25,15 @@ export type Message = {
25
25
  };
26
26
  /** The timestamp when the message was created. */
27
27
  timestamp?: number | undefined;
28
+ /** The inlays of the message. It is not intended to be exported as public. */
29
+ inlays: {
30
+ /** The URL of the asset. */
31
+ url: string;
32
+ /** MIME type of the asset. Usually `image/*` or `video/*`. */
33
+ mimeType: string;
34
+ /** The name of the asset. Used as the file name. Should be unique. */
35
+ name: string;
36
+ }[];
28
37
  };
29
38
 
30
39
  export declare const MessageSchema: z.ZodType<Message>;
@@ -1,6 +1,7 @@
1
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 = {
2
+ import { AssetEntitySchema as s } from "./Assets.js";
3
+ import { ImageURLSchema 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 = {
4
5
  text: e.object({
5
6
  type: e.literal("string").meta({
6
7
  description: "The message content is a simple string."
@@ -11,15 +12,15 @@ const i = e.enum(["user", "assistant", "system"]).meta({ description: "Represent
11
12
  type: e.literal("file").meta({
12
13
  description: "The file content is stored in the separated storage."
13
14
  }),
14
- data: s.meta({ description: "URL of the file." }),
15
+ data: i.meta({ description: "URL of the file." }),
15
16
  mimeType: e.string().meta({ description: "MIME type of the file." })
16
17
  }).meta({ description: "File message content." })
17
- }, o = e.object({
18
+ }, c = e.object({
18
19
  id: e.string().meta({ description: "Unique identifier for the message." }),
19
20
  chatId: e.string().meta({
20
21
  description: "The ID of the chat associated with this message."
21
22
  }),
22
- role: i.meta({
23
+ role: n.meta({
23
24
  description: "The role of the message sender."
24
25
  }),
25
26
  content: e.discriminatedUnion("type", [
@@ -28,10 +29,13 @@ const i = e.enum(["user", "assistant", "system"]).meta({ description: "Represent
28
29
  ]).meta({ description: "The content of the message." }),
29
30
  timestamp: e.number().optional().meta({
30
31
  description: "The timestamp when the message was created."
32
+ }),
33
+ inlays: e.array(s).refine(a("name"), { message: "Not unique key: name" }).meta({
34
+ description: "The inlays of the message. It is not intended to be exported as public."
31
35
  })
32
36
  }).meta({ description: "Represents a single message in a chat history." });
33
37
  export {
34
- o as MessageSchema,
35
- i as RoleSchema
38
+ c as MessageSchema,
39
+ n as RoleSchema
36
40
  };
37
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 { 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;"}
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 { ImageURLSchema, 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(\"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 inlays: z\n .array(AssetEntitySchema)\n .refine(unique(\"name\"), { message: \"Not unique key: name\" })\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","ImageURLSchema","MessageSchema","AssetEntitySchema","unique"],"mappings":";;;AAOO,MAAMA,IAAaC,EACrB,KAAK,CAAC,QAAQ,aAAa,QAAQ,CAAC,EACpC,KAAK,E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
2
  "name": "@arisutalk/character-spec",
3
3
  "description": "Character specification, schema & migration for ArisuTalk",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
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
+ }