@veruna/api-contracts 1.0.51 → 1.0.53

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.
Files changed (44) hide show
  1. package/build/locales/validation.d.ts +26 -0
  2. package/build/locales/validation.js +28 -0
  3. package/build/v1/ai/index.d.ts +1 -0
  4. package/build/v1/ai/index.js +1 -0
  5. package/build/v1/ai/plugins.types.d.ts +24 -0
  6. package/build/v1/ai/plugins.types.js +28 -0
  7. package/build/v1/ai-model/admin/commands/create-model.command.d.ts +8 -0
  8. package/build/v1/ai-model/admin/commands/update-model.command.d.ts +8 -0
  9. package/build/v1/ai-model/admin/queries/get-model.query.d.ts +4 -0
  10. package/build/v1/ai-model/admin/queries/get-models.query.d.ts +4 -0
  11. package/build/v1/ai-model/ai-model.errors.d.ts +2 -1
  12. package/build/v1/ai-model/ai-model.errors.js +5 -0
  13. package/build/v1/ai-model/public/queries/get-active-models.query.d.ts +4 -0
  14. package/build/v1/ai-model/public/queries/get-models-list.query.d.ts +4 -0
  15. package/build/v1/ai-model/schemas/create-model-request.schema.d.ts +4 -0
  16. package/build/v1/ai-model/schemas/create-model-request.schema.js +2 -0
  17. package/build/v1/ai-model/schemas/model-response.schema.d.ts +12 -0
  18. package/build/v1/ai-model/schemas/model-response.schema.js +2 -0
  19. package/build/v1/ai-model/schemas/models-list-response.schema.d.ts +12 -0
  20. package/build/v1/ai-model/schemas/unreg-models-list-response.schema.d.ts +12 -0
  21. package/build/v1/ai-model/schemas/update-model-request.schema.d.ts +4 -0
  22. package/build/v1/ai-model/schemas/update-model-request.schema.js +2 -0
  23. package/build/v1/ai-model/unreg/queries/get-models-list.query.d.ts +4 -0
  24. package/build/v1/chat/commands/create-reg-chat.command.d.ts +7 -0
  25. package/build/v1/chat/commands/create-unreg-chat.command.d.ts +7 -0
  26. package/build/v1/chat/commands/update-chat-title.command.d.ts +7 -0
  27. package/build/v1/chat/commands/update-chat.command.d.ts +7 -0
  28. package/build/v1/chat/queries/get-last-active-chat.query.d.ts +7 -0
  29. package/build/v1/chat/queries/get-reg-chat.query.d.ts +7 -0
  30. package/build/v1/chat/queries/get-unreg-chat.query.d.ts +7 -0
  31. package/build/v1/chat/schemas/chat-with-messages-response.schema.d.ts +7 -0
  32. package/build/v1/message/commands/create-message.command.d.ts +13 -0
  33. package/build/v1/message/schemas/citation.schema.d.ts +12 -0
  34. package/build/v1/message/schemas/citation.schema.js +19 -0
  35. package/build/v1/message/schemas/create-message-request.schema.d.ts +1 -0
  36. package/build/v1/message/schemas/create-message-request.schema.js +2 -0
  37. package/build/v1/message/schemas/index.d.ts +2 -1
  38. package/build/v1/message/schemas/index.js +4 -1
  39. package/build/v1/message/schemas/message-meta.schema.d.ts +7 -0
  40. package/build/v1/message/schemas/message-meta.schema.js +3 -0
  41. package/build/v1/message/schemas/message-response.schema.d.ts +7 -0
  42. package/build/v1/message/schemas/stream-events.schema.d.ts +30 -0
  43. package/build/v1/message/schemas/stream-events.schema.js +13 -1
  44. package/package.json +1 -1
@@ -288,6 +288,9 @@ export declare const validationMessages: {
288
288
  readonly min: "Message text is required";
289
289
  readonly max: "Message text is too long";
290
290
  };
291
+ readonly plugins: {
292
+ readonly invalid: "Invalid plugin ID";
293
+ };
291
294
  };
292
295
  readonly RateMessageRequest: {
293
296
  readonly rating: {
@@ -668,6 +671,16 @@ export declare const validationMessages: {
668
671
  readonly invalid: "Invalid UTM campaign";
669
672
  };
670
673
  };
674
+ readonly PluginConfig: {
675
+ readonly id: {
676
+ readonly invalid: "Invalid plugin ID";
677
+ };
678
+ readonly price: {
679
+ readonly required: "Plugin price is required";
680
+ readonly invalid: "Plugin price must be an integer";
681
+ readonly min: "Plugin price must be non-negative";
682
+ };
683
+ };
671
684
  readonly PaginationQuery: {
672
685
  readonly page: {
673
686
  readonly invalid: "Page must be a positive integer";
@@ -963,6 +976,9 @@ export declare const validationMessages: {
963
976
  readonly min: "Введите сообщение";
964
977
  readonly max: "Сообщение слишком длинное";
965
978
  };
979
+ readonly plugins: {
980
+ readonly invalid: "Некорректный ID плагина";
981
+ };
966
982
  };
967
983
  readonly RateMessageRequest: {
968
984
  readonly rating: {
@@ -1343,6 +1359,16 @@ export declare const validationMessages: {
1343
1359
  readonly invalid: "Некорректный UTM campaign";
1344
1360
  };
1345
1361
  };
1362
+ readonly PluginConfig: {
1363
+ readonly id: {
1364
+ readonly invalid: "Некорректный ID плагина";
1365
+ };
1366
+ readonly price: {
1367
+ readonly required: "Укажите цену плагина";
1368
+ readonly invalid: "Цена плагина должна быть целым числом";
1369
+ readonly min: "Цена плагина должна быть неотрицательной";
1370
+ };
1371
+ };
1346
1372
  readonly PaginationQuery: {
1347
1373
  readonly page: {
1348
1374
  readonly invalid: "Страница должна быть положительным целым числом";
@@ -297,6 +297,9 @@ exports.validationMessages = {
297
297
  min: 'Message text is required',
298
298
  max: 'Message text is too long',
299
299
  },
300
+ plugins: {
301
+ invalid: 'Invalid plugin ID',
302
+ },
300
303
  },
301
304
  RateMessageRequest: {
302
305
  rating: {
@@ -685,6 +688,17 @@ exports.validationMessages = {
685
688
  invalid: 'Invalid UTM campaign',
686
689
  },
687
690
  },
691
+ // ==================== PLUGINS ====================
692
+ PluginConfig: {
693
+ id: {
694
+ invalid: 'Invalid plugin ID',
695
+ },
696
+ price: {
697
+ required: 'Plugin price is required',
698
+ invalid: 'Plugin price must be an integer',
699
+ min: 'Plugin price must be non-negative',
700
+ },
701
+ },
688
702
  // ==================== SHARED ====================
689
703
  PaginationQuery: {
690
704
  page: {
@@ -986,6 +1000,9 @@ exports.validationMessages = {
986
1000
  min: 'Введите сообщение',
987
1001
  max: 'Сообщение слишком длинное',
988
1002
  },
1003
+ plugins: {
1004
+ invalid: 'Некорректный ID плагина',
1005
+ },
989
1006
  },
990
1007
  RateMessageRequest: {
991
1008
  rating: {
@@ -1374,6 +1391,17 @@ exports.validationMessages = {
1374
1391
  invalid: 'Некорректный UTM campaign',
1375
1392
  },
1376
1393
  },
1394
+ // ==================== PLUGINS ====================
1395
+ PluginConfig: {
1396
+ id: {
1397
+ invalid: 'Некорректный ID плагина',
1398
+ },
1399
+ price: {
1400
+ required: 'Укажите цену плагина',
1401
+ invalid: 'Цена плагина должна быть целым числом',
1402
+ min: 'Цена плагина должна быть неотрицательной',
1403
+ },
1404
+ },
1377
1405
  // ==================== SHARED ====================
1378
1406
  PaginationQuery: {
1379
1407
  page: {
@@ -1 +1,2 @@
1
1
  export * from './ai.errors';
2
+ export * from './plugins.types';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ai.errors"), exports);
18
+ __exportStar(require("./plugins.types"), exports);
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Available plugin IDs
4
+ */
5
+ export declare enum PluginId {
6
+ WEB = "web"
7
+ }
8
+ /**
9
+ * Plugin ID Schema with i18n errors
10
+ */
11
+ export declare const PluginIdSchema: z.ZodEnum<typeof PluginId>;
12
+ /**
13
+ * Plugin config stored in DB (model's available plugins)
14
+ */
15
+ export declare const PluginConfigSchema: z.ZodObject<{
16
+ id: z.ZodEnum<typeof PluginId>;
17
+ price: z.ZodNumber;
18
+ }, z.core.$strip>;
19
+ export type PluginConfig = z.infer<typeof PluginConfigSchema>;
20
+ export declare const PluginsConfigArraySchema: z.ZodArray<z.ZodObject<{
21
+ id: z.ZodEnum<typeof PluginId>;
22
+ price: z.ZodNumber;
23
+ }, z.core.$strip>>;
24
+ export type PluginsConfigArray = z.infer<typeof PluginsConfigArraySchema>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PluginsConfigArraySchema = exports.PluginConfigSchema = exports.PluginIdSchema = exports.PluginId = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Available plugin IDs
7
+ */
8
+ var PluginId;
9
+ (function (PluginId) {
10
+ PluginId["WEB"] = "web";
11
+ })(PluginId || (exports.PluginId = PluginId = {}));
12
+ /**
13
+ * Plugin ID Schema with i18n errors
14
+ */
15
+ exports.PluginIdSchema = zod_1.z.nativeEnum(PluginId, {
16
+ error: 'PluginConfig.id.invalid',
17
+ });
18
+ /**
19
+ * Plugin config stored in DB (model's available plugins)
20
+ */
21
+ exports.PluginConfigSchema = zod_1.z.object({
22
+ id: exports.PluginIdSchema,
23
+ price: zod_1.z
24
+ .number({ error: 'PluginConfig.price.required' })
25
+ .int({ message: 'PluginConfig.price.invalid' })
26
+ .min(0, { message: 'PluginConfig.price.min' }),
27
+ });
28
+ exports.PluginsConfigArraySchema = zod_1.z.array(exports.PluginConfigSchema);
@@ -21,6 +21,10 @@ export declare namespace AdminAiModelCreateCommand {
21
21
  modelType: z.ZodDefault<z.ZodEnum<typeof import("../../schemas").ModelType>>;
22
22
  systemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
23
  isAvailableForUnreg: z.ZodDefault<z.ZodBoolean>;
24
+ plugins: z.ZodDefault<z.ZodArray<z.ZodObject<{
25
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
26
+ price: z.ZodNumber;
27
+ }, z.core.$strip>>>;
24
28
  }, z.core.$strip>;
25
29
  const Response: z.ZodObject<{
26
30
  uuid: z.ZodString;
@@ -43,6 +47,10 @@ export declare namespace AdminAiModelCreateCommand {
43
47
  modelType: z.ZodEnum<typeof import("../../schemas").ModelType>;
44
48
  systemPrompt: z.ZodNullable<z.ZodString>;
45
49
  isAvailableForUnreg: z.ZodBoolean;
50
+ plugins: z.ZodArray<z.ZodObject<{
51
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
52
+ price: z.ZodNumber;
53
+ }, z.core.$strip>>;
46
54
  createdAt: z.ZodString;
47
55
  updatedAt: z.ZodString;
48
56
  }, z.core.$strip>;
@@ -21,6 +21,10 @@ export declare namespace AdminAiModelUpdateCommand {
21
21
  modelType: z.ZodOptional<z.ZodEnum<typeof import("../../schemas").ModelType>>;
22
22
  systemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
23
  isAvailableForUnreg: z.ZodOptional<z.ZodBoolean>;
24
+ plugins: z.ZodOptional<z.ZodArray<z.ZodObject<{
25
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
26
+ price: z.ZodNumber;
27
+ }, z.core.$strip>>>;
24
28
  }, z.core.$strip>;
25
29
  const Response: z.ZodObject<{
26
30
  uuid: z.ZodString;
@@ -43,6 +47,10 @@ export declare namespace AdminAiModelUpdateCommand {
43
47
  modelType: z.ZodEnum<typeof import("../../schemas").ModelType>;
44
48
  systemPrompt: z.ZodNullable<z.ZodString>;
45
49
  isAvailableForUnreg: z.ZodBoolean;
50
+ plugins: z.ZodArray<z.ZodObject<{
51
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
52
+ price: z.ZodNumber;
53
+ }, z.core.$strip>>;
46
54
  createdAt: z.ZodString;
47
55
  updatedAt: z.ZodString;
48
56
  }, z.core.$strip>;
@@ -23,6 +23,10 @@ export declare namespace AdminAiModelGetModelQuery {
23
23
  modelType: z.ZodEnum<typeof import("../../schemas").ModelType>;
24
24
  systemPrompt: z.ZodNullable<z.ZodString>;
25
25
  isAvailableForUnreg: z.ZodBoolean;
26
+ plugins: z.ZodArray<z.ZodObject<{
27
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
28
+ price: z.ZodNumber;
29
+ }, z.core.$strip>>;
26
30
  createdAt: z.ZodString;
27
31
  updatedAt: z.ZodString;
28
32
  }, z.core.$strip>;
@@ -30,6 +30,10 @@ export declare namespace AdminAiModelGetModelsQuery {
30
30
  modelType: z.ZodEnum<typeof import("../../schemas").ModelType>;
31
31
  systemPrompt: z.ZodNullable<z.ZodString>;
32
32
  isAvailableForUnreg: z.ZodBoolean;
33
+ plugins: z.ZodArray<z.ZodObject<{
34
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
35
+ price: z.ZodNumber;
36
+ }, z.core.$strip>>;
33
37
  createdAt: z.ZodString;
34
38
  updatedAt: z.ZodString;
35
39
  }, z.core.$strip>>;
@@ -8,6 +8,7 @@ export declare enum AiModelErrorCode {
8
8
  INVALID_MODEL_TYPE = "INVALID_MODEL_TYPE",
9
9
  INVALID_API_PROVIDER = "INVALID_API_PROVIDER",
10
10
  INVALID_MODALITY = "INVALID_MODALITY",
11
- INVALID_SPEED = "INVALID_SPEED"
11
+ INVALID_SPEED = "INVALID_SPEED",
12
+ PLUGIN_NOT_AVAILABLE = "PLUGIN_NOT_AVAILABLE"
12
13
  }
13
14
  export declare const AI_MODEL_ERRORS: Record<AiModelErrorCode, ErrorMetadata>;
@@ -12,6 +12,7 @@ var AiModelErrorCode;
12
12
  AiModelErrorCode["INVALID_API_PROVIDER"] = "INVALID_API_PROVIDER";
13
13
  AiModelErrorCode["INVALID_MODALITY"] = "INVALID_MODALITY";
14
14
  AiModelErrorCode["INVALID_SPEED"] = "INVALID_SPEED";
15
+ AiModelErrorCode["PLUGIN_NOT_AVAILABLE"] = "PLUGIN_NOT_AVAILABLE";
15
16
  })(AiModelErrorCode || (exports.AiModelErrorCode = AiModelErrorCode = {}));
16
17
  exports.AI_MODEL_ERRORS = {
17
18
  [AiModelErrorCode.MODEL_NOT_FOUND]: {
@@ -50,4 +51,8 @@ exports.AI_MODEL_ERRORS = {
50
51
  code: AiModelErrorCode.INVALID_SPEED,
51
52
  statusCode: 400,
52
53
  },
54
+ [AiModelErrorCode.PLUGIN_NOT_AVAILABLE]: {
55
+ code: AiModelErrorCode.PLUGIN_NOT_AVAILABLE,
56
+ statusCode: 400,
57
+ },
53
58
  };
@@ -16,6 +16,10 @@ export declare namespace PublicAiModelGetActiveModelsQuery {
16
16
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("../../schemas").Modality>>;
17
17
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("../../schemas").Modality>>;
18
18
  modelType: z.ZodEnum<typeof import("../../schemas").ModelType>;
19
+ plugins: z.ZodArray<z.ZodObject<{
20
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
21
+ price: z.ZodNumber;
22
+ }, z.core.$strip>>;
19
23
  }, z.core.$strip>>;
20
24
  const URL: "/api/v1/ai-models/";
21
25
  const METHOD = HttpMethod.GET;
@@ -22,6 +22,10 @@ export declare namespace PublicAiModelGetModelsListQuery {
22
22
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("../../schemas").Modality>>;
23
23
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("../../schemas").Modality>>;
24
24
  modelType: z.ZodEnum<typeof import("../../schemas").ModelType>;
25
+ plugins: z.ZodArray<z.ZodObject<{
26
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
27
+ price: z.ZodNumber;
28
+ }, z.core.$strip>>;
25
29
  }, z.core.$strip>>;
26
30
  }, z.core.$strip>>;
27
31
  }, z.core.$strip>;
@@ -28,4 +28,8 @@ export declare const CreateModelRequestSchema: z.ZodObject<{
28
28
  modelType: z.ZodDefault<z.ZodEnum<typeof ModelType>>;
29
29
  systemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
30
  isAvailableForUnreg: z.ZodDefault<z.ZodBoolean>;
31
+ plugins: z.ZodDefault<z.ZodArray<z.ZodObject<{
32
+ id: z.ZodEnum<typeof import("../../ai/plugins.types").PluginId>;
33
+ price: z.ZodNumber;
34
+ }, z.core.$strip>>>;
31
35
  }, z.core.$strip>;
@@ -7,6 +7,7 @@ const model_mark_enum_1 = require("./model-mark.enum");
7
7
  const model_type_enum_1 = require("./model-type.enum");
8
8
  const api_provider_enum_1 = require("./api-provider.enum");
9
9
  const modality_enum_1 = require("./modality.enum");
10
+ const plugins_types_1 = require("../../ai/plugins.types");
10
11
  /**
11
12
  * Create Model Request Schema
12
13
  * Error messages: CreateModelRequest.{field}.{rule}
@@ -62,4 +63,5 @@ exports.CreateModelRequestSchema = zod_1.z.object({
62
63
  modelType: zod_1.z.nativeEnum(model_type_enum_1.ModelType).default(model_type_enum_1.ModelType.TEXT),
63
64
  systemPrompt: zod_1.z.string().nullable().optional(),
64
65
  isAvailableForUnreg: zod_1.z.boolean().default(false),
66
+ plugins: plugins_types_1.PluginsConfigArraySchema.default([]),
65
67
  });
@@ -28,6 +28,10 @@ export declare const ModelResponseSchema: z.ZodObject<{
28
28
  modelType: z.ZodEnum<typeof ModelType>;
29
29
  systemPrompt: z.ZodNullable<z.ZodString>;
30
30
  isAvailableForUnreg: z.ZodBoolean;
31
+ plugins: z.ZodArray<z.ZodObject<{
32
+ id: z.ZodEnum<typeof import("../../ai/plugins.types").PluginId>;
33
+ price: z.ZodNumber;
34
+ }, z.core.$strip>>;
31
35
  createdAt: z.ZodString;
32
36
  updatedAt: z.ZodString;
33
37
  }, z.core.$strip>;
@@ -48,6 +52,10 @@ export declare const PublicModelResponseSchema: z.ZodObject<{
48
52
  inputModalities: z.ZodArray<z.ZodEnum<typeof Modality>>;
49
53
  outputModalities: z.ZodArray<z.ZodEnum<typeof Modality>>;
50
54
  modelType: z.ZodEnum<typeof ModelType>;
55
+ plugins: z.ZodArray<z.ZodObject<{
56
+ id: z.ZodEnum<typeof import("../../ai/plugins.types").PluginId>;
57
+ price: z.ZodNumber;
58
+ }, z.core.$strip>>;
51
59
  }, z.core.$strip>;
52
60
  /**
53
61
  * Unreg User AI Model Response Schema
@@ -67,5 +75,9 @@ export declare const UnregModelResponseSchema: z.ZodObject<{
67
75
  inputModalities: z.ZodArray<z.ZodEnum<typeof Modality>>;
68
76
  outputModalities: z.ZodArray<z.ZodEnum<typeof Modality>>;
69
77
  modelType: z.ZodEnum<typeof ModelType>;
78
+ plugins: z.ZodArray<z.ZodObject<{
79
+ id: z.ZodEnum<typeof import("../../ai/plugins.types").PluginId>;
80
+ price: z.ZodNumber;
81
+ }, z.core.$strip>>;
70
82
  access: z.ZodBoolean;
71
83
  }, z.core.$strip>;
@@ -8,6 +8,7 @@ const model_mark_enum_1 = require("./model-mark.enum");
8
8
  const model_type_enum_1 = require("./model-type.enum");
9
9
  const api_provider_enum_1 = require("./api-provider.enum");
10
10
  const modality_enum_1 = require("./modality.enum");
11
+ const plugins_types_1 = require("../../ai/plugins.types");
11
12
  /**
12
13
  * AI Model Response Schema (Admin - full data)
13
14
  */
@@ -32,6 +33,7 @@ exports.ModelResponseSchema = zod_1.z.object({
32
33
  modelType: zod_1.z.nativeEnum(model_type_enum_1.ModelType),
33
34
  systemPrompt: zod_1.z.string().nullable(),
34
35
  isAvailableForUnreg: zod_1.z.boolean(),
36
+ plugins: zod_1.z.array(plugins_types_1.PluginConfigSchema),
35
37
  createdAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
36
38
  updatedAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
37
39
  });
@@ -17,6 +17,10 @@ export declare const PublicModelInListSchema: z.ZodObject<{
17
17
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
18
18
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
19
19
  modelType: z.ZodEnum<typeof import("./model-type.enum").ModelType>;
20
+ plugins: z.ZodArray<z.ZodObject<{
21
+ id: z.ZodEnum<typeof import("../..").PluginId>;
22
+ price: z.ZodNumber;
23
+ }, z.core.$strip>>;
20
24
  }, z.core.$strip>;
21
25
  /**
22
26
  * Public Provider with Models (picked from ProviderResponseSchema + models)
@@ -41,6 +45,10 @@ export declare const PublicProviderWithModelsSchema: z.ZodObject<{
41
45
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
42
46
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
43
47
  modelType: z.ZodEnum<typeof import("./model-type.enum").ModelType>;
48
+ plugins: z.ZodArray<z.ZodObject<{
49
+ id: z.ZodEnum<typeof import("../..").PluginId>;
50
+ price: z.ZodNumber;
51
+ }, z.core.$strip>>;
44
52
  }, z.core.$strip>>;
45
53
  }, z.core.$strip>;
46
54
  /**
@@ -66,6 +74,10 @@ export declare const ModelsListResponseSchema: z.ZodObject<{
66
74
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
67
75
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
68
76
  modelType: z.ZodEnum<typeof import("./model-type.enum").ModelType>;
77
+ plugins: z.ZodArray<z.ZodObject<{
78
+ id: z.ZodEnum<typeof import("../..").PluginId>;
79
+ price: z.ZodNumber;
80
+ }, z.core.$strip>>;
69
81
  }, z.core.$strip>>;
70
82
  }, z.core.$strip>>;
71
83
  }, z.core.$strip>;
@@ -17,6 +17,10 @@ export declare const UnregModelInListSchema: z.ZodObject<{
17
17
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
18
18
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
19
19
  modelType: z.ZodEnum<typeof import("./model-type.enum").ModelType>;
20
+ plugins: z.ZodArray<z.ZodObject<{
21
+ id: z.ZodEnum<typeof import("../..").PluginId>;
22
+ price: z.ZodNumber;
23
+ }, z.core.$strip>>;
20
24
  access: z.ZodBoolean;
21
25
  }, z.core.$strip>;
22
26
  /**
@@ -41,6 +45,10 @@ export declare const UnregProviderWithModelsSchema: z.ZodObject<{
41
45
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
42
46
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
43
47
  modelType: z.ZodEnum<typeof import("./model-type.enum").ModelType>;
48
+ plugins: z.ZodArray<z.ZodObject<{
49
+ id: z.ZodEnum<typeof import("../..").PluginId>;
50
+ price: z.ZodNumber;
51
+ }, z.core.$strip>>;
44
52
  access: z.ZodBoolean;
45
53
  }, z.core.$strip>>;
46
54
  }, z.core.$strip>;
@@ -67,6 +75,10 @@ export declare const UnregModelsListResponseSchema: z.ZodObject<{
67
75
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
68
76
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("./modality.enum").Modality>>;
69
77
  modelType: z.ZodEnum<typeof import("./model-type.enum").ModelType>;
78
+ plugins: z.ZodArray<z.ZodObject<{
79
+ id: z.ZodEnum<typeof import("../..").PluginId>;
80
+ price: z.ZodNumber;
81
+ }, z.core.$strip>>;
70
82
  access: z.ZodBoolean;
71
83
  }, z.core.$strip>>;
72
84
  }, z.core.$strip>>;
@@ -28,4 +28,8 @@ export declare const UpdateModelRequestSchema: z.ZodObject<{
28
28
  modelType: z.ZodOptional<z.ZodEnum<typeof ModelType>>;
29
29
  systemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
30
  isAvailableForUnreg: z.ZodOptional<z.ZodBoolean>;
31
+ plugins: z.ZodOptional<z.ZodArray<z.ZodObject<{
32
+ id: z.ZodEnum<typeof import("../../ai/plugins.types").PluginId>;
33
+ price: z.ZodNumber;
34
+ }, z.core.$strip>>>;
31
35
  }, z.core.$strip>;
@@ -7,6 +7,7 @@ const model_mark_enum_1 = require("./model-mark.enum");
7
7
  const model_type_enum_1 = require("./model-type.enum");
8
8
  const api_provider_enum_1 = require("./api-provider.enum");
9
9
  const modality_enum_1 = require("./modality.enum");
10
+ const plugins_types_1 = require("../../ai/plugins.types");
10
11
  /**
11
12
  * Update Model Request Schema
12
13
  * Error messages: UpdateModelRequest.{field}.{rule}
@@ -66,4 +67,5 @@ exports.UpdateModelRequestSchema = zod_1.z.object({
66
67
  modelType: zod_1.z.nativeEnum(model_type_enum_1.ModelType).optional(),
67
68
  systemPrompt: zod_1.z.string().nullable().optional(),
68
69
  isAvailableForUnreg: zod_1.z.boolean().optional(),
70
+ plugins: plugins_types_1.PluginsConfigArraySchema.optional(),
69
71
  });
@@ -22,6 +22,10 @@ export declare namespace UnregAiModelGetModelsListQuery {
22
22
  inputModalities: z.ZodArray<z.ZodEnum<typeof import("../../schemas").Modality>>;
23
23
  outputModalities: z.ZodArray<z.ZodEnum<typeof import("../../schemas").Modality>>;
24
24
  modelType: z.ZodEnum<typeof import("../../schemas").ModelType>;
25
+ plugins: z.ZodArray<z.ZodObject<{
26
+ id: z.ZodEnum<typeof import("../../..").PluginId>;
27
+ price: z.ZodNumber;
28
+ }, z.core.$strip>>;
25
29
  access: z.ZodBoolean;
26
30
  }, z.core.$strip>>;
27
31
  }, z.core.$strip>>;
@@ -45,6 +45,13 @@ export declare namespace CreateRegChatCommand {
45
45
  startedAt: z.ZodOptional<z.ZodString>;
46
46
  completedAt: z.ZodOptional<z.ZodString>;
47
47
  }, z.core.$strip>>>;
48
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ url: z.ZodString;
50
+ title: z.ZodString;
51
+ content: z.ZodOptional<z.ZodString>;
52
+ startIndex: z.ZodNumber;
53
+ endIndex: z.ZodNumber;
54
+ }, z.core.$strip>>>;
48
55
  }, z.core.$strip>>;
49
56
  createdAt: z.ZodString;
50
57
  updatedAt: z.ZodString;
@@ -43,6 +43,13 @@ export declare namespace CreateUnregChatCommand {
43
43
  startedAt: z.ZodOptional<z.ZodString>;
44
44
  completedAt: z.ZodOptional<z.ZodString>;
45
45
  }, z.core.$strip>>>;
46
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ url: z.ZodString;
48
+ title: z.ZodString;
49
+ content: z.ZodOptional<z.ZodString>;
50
+ startIndex: z.ZodNumber;
51
+ endIndex: z.ZodNumber;
52
+ }, z.core.$strip>>>;
46
53
  }, z.core.$strip>>;
47
54
  createdAt: z.ZodString;
48
55
  updatedAt: z.ZodString;
@@ -45,6 +45,13 @@ export declare namespace UpdateChatTitleCommand {
45
45
  startedAt: z.ZodOptional<z.ZodString>;
46
46
  completedAt: z.ZodOptional<z.ZodString>;
47
47
  }, z.core.$strip>>>;
48
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ url: z.ZodString;
50
+ title: z.ZodString;
51
+ content: z.ZodOptional<z.ZodString>;
52
+ startIndex: z.ZodNumber;
53
+ endIndex: z.ZodNumber;
54
+ }, z.core.$strip>>>;
48
55
  }, z.core.$strip>>;
49
56
  createdAt: z.ZodString;
50
57
  updatedAt: z.ZodString;
@@ -46,6 +46,13 @@ export declare namespace UpdateChatCommand {
46
46
  startedAt: z.ZodOptional<z.ZodString>;
47
47
  completedAt: z.ZodOptional<z.ZodString>;
48
48
  }, z.core.$strip>>>;
49
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
50
+ url: z.ZodString;
51
+ title: z.ZodString;
52
+ content: z.ZodOptional<z.ZodString>;
53
+ startIndex: z.ZodNumber;
54
+ endIndex: z.ZodNumber;
55
+ }, z.core.$strip>>>;
49
56
  }, z.core.$strip>>;
50
57
  createdAt: z.ZodString;
51
58
  updatedAt: z.ZodString;
@@ -43,6 +43,13 @@ export declare namespace GetLastActiveChatQuery {
43
43
  startedAt: z.ZodOptional<z.ZodString>;
44
44
  completedAt: z.ZodOptional<z.ZodString>;
45
45
  }, z.core.$strip>>>;
46
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ url: z.ZodString;
48
+ title: z.ZodString;
49
+ content: z.ZodOptional<z.ZodString>;
50
+ startIndex: z.ZodNumber;
51
+ endIndex: z.ZodNumber;
52
+ }, z.core.$strip>>>;
46
53
  }, z.core.$strip>>;
47
54
  createdAt: z.ZodString;
48
55
  updatedAt: z.ZodString;
@@ -43,6 +43,13 @@ export declare namespace GetRegChatQuery {
43
43
  startedAt: z.ZodOptional<z.ZodString>;
44
44
  completedAt: z.ZodOptional<z.ZodString>;
45
45
  }, z.core.$strip>>>;
46
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ url: z.ZodString;
48
+ title: z.ZodString;
49
+ content: z.ZodOptional<z.ZodString>;
50
+ startIndex: z.ZodNumber;
51
+ endIndex: z.ZodNumber;
52
+ }, z.core.$strip>>>;
46
53
  }, z.core.$strip>>;
47
54
  createdAt: z.ZodString;
48
55
  updatedAt: z.ZodString;
@@ -43,6 +43,13 @@ export declare namespace GetUnregChatQuery {
43
43
  startedAt: z.ZodOptional<z.ZodString>;
44
44
  completedAt: z.ZodOptional<z.ZodString>;
45
45
  }, z.core.$strip>>>;
46
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ url: z.ZodString;
48
+ title: z.ZodString;
49
+ content: z.ZodOptional<z.ZodString>;
50
+ startIndex: z.ZodNumber;
51
+ endIndex: z.ZodNumber;
52
+ }, z.core.$strip>>>;
46
53
  }, z.core.$strip>>;
47
54
  createdAt: z.ZodString;
48
55
  updatedAt: z.ZodString;
@@ -37,6 +37,13 @@ export declare const ChatWithMessagesResponseSchema: z.ZodObject<{
37
37
  startedAt: z.ZodOptional<z.ZodString>;
38
38
  completedAt: z.ZodOptional<z.ZodString>;
39
39
  }, z.core.$strip>>>;
40
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ url: z.ZodString;
42
+ title: z.ZodString;
43
+ content: z.ZodOptional<z.ZodString>;
44
+ startIndex: z.ZodNumber;
45
+ endIndex: z.ZodNumber;
46
+ }, z.core.$strip>>>;
40
47
  }, z.core.$strip>>;
41
48
  createdAt: z.ZodString;
42
49
  updatedAt: z.ZodString;
@@ -38,6 +38,7 @@ export declare namespace CreateMessageCommand {
38
38
  const Request: z.ZodObject<{
39
39
  aiModelId: z.ZodString;
40
40
  text: z.ZodString;
41
+ plugins: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../..").PluginId>>>;
41
42
  }, z.core.$strip>;
42
43
  /** Discriminated union of all stream events */
43
44
  const StreamEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -96,6 +97,18 @@ export declare namespace CreateMessageCommand {
96
97
  type: z.ZodLiteral<import("../schemas").StreamEventType.IMAGE_UPLOADED>;
97
98
  imageUrl: z.ZodString;
98
99
  imageIndex: z.ZodNumber;
100
+ }, z.core.$strip>, z.ZodObject<{
101
+ id: z.ZodNumber;
102
+ chatId: z.ZodString;
103
+ messageId: z.ZodString;
104
+ type: z.ZodLiteral<import("../schemas").StreamEventType.CITATIONS>;
105
+ citations: z.ZodArray<z.ZodObject<{
106
+ url: z.ZodString;
107
+ title: z.ZodString;
108
+ content: z.ZodOptional<z.ZodString>;
109
+ startIndex: z.ZodNumber;
110
+ endIndex: z.ZodNumber;
111
+ }, z.core.$strip>>;
99
112
  }, z.core.$strip>, z.ZodObject<{
100
113
  id: z.ZodNumber;
101
114
  chatId: z.ZodString;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Citation from web search
4
+ */
5
+ export declare const CitationSchema: z.ZodObject<{
6
+ url: z.ZodString;
7
+ title: z.ZodString;
8
+ content: z.ZodOptional<z.ZodString>;
9
+ startIndex: z.ZodNumber;
10
+ endIndex: z.ZodNumber;
11
+ }, z.core.$strip>;
12
+ export type Citation = z.infer<typeof CitationSchema>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CitationSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Citation from web search
7
+ */
8
+ exports.CitationSchema = zod_1.z.object({
9
+ /** Source URL */
10
+ url: zod_1.z.string().url(),
11
+ /** Page title */
12
+ title: zod_1.z.string(),
13
+ /** Content snippet */
14
+ content: zod_1.z.string().optional(),
15
+ /** Start index in message content */
16
+ startIndex: zod_1.z.number().int().nonnegative(),
17
+ /** End index in message content */
18
+ endIndex: zod_1.z.number().int().nonnegative(),
19
+ });
@@ -6,4 +6,5 @@ import { z } from 'zod';
6
6
  export declare const CreateMessageRequestSchema: z.ZodObject<{
7
7
  aiModelId: z.ZodString;
8
8
  text: z.ZodString;
9
+ plugins: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("../../ai/plugins.types").PluginId>>>;
9
10
  }, z.core.$strip>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateMessageRequestSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const shared_1 = require("../../../shared");
6
+ const plugins_types_1 = require("../../ai/plugins.types");
6
7
  /**
7
8
  * Create Message Request Schema
8
9
  * Error messages: CreateMessageRequest.{field}.{rule}
@@ -15,4 +16,5 @@ exports.CreateMessageRequestSchema = zod_1.z.object({
15
16
  .string({ error: 'CreateMessageRequest.text.required' })
16
17
  .min(1, { message: 'CreateMessageRequest.text.min' })
17
18
  .max(shared_1.MESSAGE_TEXT_MAX_LENGTH, { message: 'CreateMessageRequest.text.max' }),
19
+ plugins: zod_1.z.array(plugins_types_1.PluginIdSchema, { error: 'CreateMessageRequest.plugins.invalid' }).optional(),
18
20
  });
@@ -4,7 +4,8 @@ export { UserRating } from './user-rating.enum';
4
4
  export { CreateMessageRequestSchema } from './create-message-request.schema';
5
5
  export { CreateMessageResponseSchema } from './create-message-response.schema';
6
6
  export { MessageResponseSchema } from './message-response.schema';
7
- export { StreamEventType, StreamEventSchema, StreamChunkEventSchema, StreamReasoningEventSchema, StreamImageEventSchema, StreamPromptGenerationEventSchema, StreamStepDoneEventSchema, StreamImageGenerationStartEventSchema, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
7
+ export { StreamEventType, StreamEventSchema, StreamChunkEventSchema, StreamReasoningEventSchema, StreamImageEventSchema, StreamPromptGenerationEventSchema, StreamStepDoneEventSchema, StreamImageGenerationStartEventSchema, StreamCitationsEventSchema, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
8
+ export { CitationSchema, type Citation } from './citation.schema';
8
9
  export { AttachmentType, AttachmentSchema, AttachmentsSchema } from './message-attachment.schema';
9
10
  export type { Attachment, Attachments } from './message-attachment.schema';
10
11
  export { MessageMetaSchema, ReasoningMetaSchema, ReasoningDetailSchema, } from './message-meta.schema';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteMessageResponseSchema = exports.DeleteMessageParamsSchema = exports.RateMessageParamsSchema = exports.RateMessageResponseSchema = exports.RateMessageRequestSchema = exports.GenerationStepType = exports.GenerationStepSchema = exports.ReasoningDetailSchema = exports.ReasoningMetaSchema = exports.MessageMetaSchema = exports.AttachmentsSchema = exports.AttachmentSchema = exports.AttachmentType = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventSchema = exports.StreamEventType = exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
3
+ exports.DeleteMessageResponseSchema = exports.DeleteMessageParamsSchema = exports.RateMessageParamsSchema = exports.RateMessageResponseSchema = exports.RateMessageRequestSchema = exports.GenerationStepType = exports.GenerationStepSchema = exports.ReasoningDetailSchema = exports.ReasoningMetaSchema = exports.MessageMetaSchema = exports.AttachmentsSchema = exports.AttachmentSchema = exports.AttachmentType = exports.CitationSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamCitationsEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventSchema = exports.StreamEventType = exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
4
4
  var message_role_enum_1 = require("./message-role.enum");
5
5
  Object.defineProperty(exports, "MessageRole", { enumerable: true, get: function () { return message_role_enum_1.MessageRole; } });
6
6
  var message_status_enum_1 = require("./message-status.enum");
@@ -22,8 +22,11 @@ Object.defineProperty(exports, "StreamImageEventSchema", { enumerable: true, get
22
22
  Object.defineProperty(exports, "StreamPromptGenerationEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamPromptGenerationEventSchema; } });
23
23
  Object.defineProperty(exports, "StreamStepDoneEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamStepDoneEventSchema; } });
24
24
  Object.defineProperty(exports, "StreamImageGenerationStartEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamImageGenerationStartEventSchema; } });
25
+ Object.defineProperty(exports, "StreamCitationsEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamCitationsEventSchema; } });
25
26
  Object.defineProperty(exports, "StreamDoneEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamDoneEventSchema; } });
26
27
  Object.defineProperty(exports, "StreamErrorEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamErrorEventSchema; } });
28
+ var citation_schema_1 = require("./citation.schema");
29
+ Object.defineProperty(exports, "CitationSchema", { enumerable: true, get: function () { return citation_schema_1.CitationSchema; } });
27
30
  var message_attachment_schema_1 = require("./message-attachment.schema");
28
31
  Object.defineProperty(exports, "AttachmentType", { enumerable: true, get: function () { return message_attachment_schema_1.AttachmentType; } });
29
32
  Object.defineProperty(exports, "AttachmentSchema", { enumerable: true, get: function () { return message_attachment_schema_1.AttachmentSchema; } });
@@ -52,5 +52,12 @@ export declare const MessageMetaSchema: z.ZodObject<{
52
52
  startedAt: z.ZodOptional<z.ZodString>;
53
53
  completedAt: z.ZodOptional<z.ZodString>;
54
54
  }, z.core.$strip>>>;
55
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
56
+ url: z.ZodString;
57
+ title: z.ZodString;
58
+ content: z.ZodOptional<z.ZodString>;
59
+ startIndex: z.ZodNumber;
60
+ endIndex: z.ZodNumber;
61
+ }, z.core.$strip>>>;
55
62
  }, z.core.$strip>;
56
63
  export type MessageMetaData = z.infer<typeof MessageMetaSchema>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MessageMetaSchema = exports.ReasoningMetaSchema = exports.ReasoningDetailSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const generation_step_schema_1 = require("./generation-step.schema");
6
+ const citation_schema_1 = require("./citation.schema");
6
7
  /**
7
8
  * Reasoning detail from AI model (e.g., Claude extended thinking)
8
9
  * Supports both plain text and encrypted reasoning formats
@@ -35,4 +36,6 @@ exports.MessageMetaSchema = zod_1.z.object({
35
36
  reasoning: exports.ReasoningMetaSchema.optional(),
36
37
  /** Generation steps for multi-stage processes (e.g., prompt → image) */
37
38
  steps: zod_1.z.array(generation_step_schema_1.GenerationStepSchema).optional(),
39
+ /** Web search citations/sources */
40
+ citations: zod_1.z.array(citation_schema_1.CitationSchema).optional(),
38
41
  });
@@ -31,6 +31,13 @@ export declare const MessageResponseSchema: z.ZodObject<{
31
31
  startedAt: z.ZodOptional<z.ZodString>;
32
32
  completedAt: z.ZodOptional<z.ZodString>;
33
33
  }, z.core.$strip>>>;
34
+ citations: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ url: z.ZodString;
36
+ title: z.ZodString;
37
+ content: z.ZodOptional<z.ZodString>;
38
+ startIndex: z.ZodNumber;
39
+ endIndex: z.ZodNumber;
40
+ }, z.core.$strip>>>;
34
41
  }, z.core.$strip>>;
35
42
  createdAt: z.ZodString;
36
43
  updatedAt: z.ZodString;
@@ -18,6 +18,8 @@ export declare enum StreamEventType {
18
18
  IMAGE_GENERATION_START = "image_generation_start",
19
19
  /** Image uploaded to S3 */
20
20
  IMAGE_UPLOADED = "image_uploaded",
21
+ /** Web search citations/sources */
22
+ CITATIONS = "citations",
21
23
  /** Stream completed successfully */
22
24
  DONE = "done",
23
25
  /** Error occurred during streaming */
@@ -127,6 +129,22 @@ export declare const StreamImageUploadedEventSchema: z.ZodObject<{
127
129
  imageUrl: z.ZodString;
128
130
  imageIndex: z.ZodNumber;
129
131
  }, z.core.$strip>;
132
+ /**
133
+ * Citations event - web search sources
134
+ */
135
+ export declare const StreamCitationsEventSchema: z.ZodObject<{
136
+ id: z.ZodNumber;
137
+ chatId: z.ZodString;
138
+ messageId: z.ZodString;
139
+ type: z.ZodLiteral<StreamEventType.CITATIONS>;
140
+ citations: z.ZodArray<z.ZodObject<{
141
+ url: z.ZodString;
142
+ title: z.ZodString;
143
+ content: z.ZodOptional<z.ZodString>;
144
+ startIndex: z.ZodNumber;
145
+ endIndex: z.ZodNumber;
146
+ }, z.core.$strip>>;
147
+ }, z.core.$strip>;
130
148
  /**
131
149
  * Discriminated union of all stream events
132
150
  * Use `type` field to narrow the type
@@ -187,6 +205,18 @@ export declare const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
187
205
  type: z.ZodLiteral<StreamEventType.IMAGE_UPLOADED>;
188
206
  imageUrl: z.ZodString;
189
207
  imageIndex: z.ZodNumber;
208
+ }, z.core.$strip>, z.ZodObject<{
209
+ id: z.ZodNumber;
210
+ chatId: z.ZodString;
211
+ messageId: z.ZodString;
212
+ type: z.ZodLiteral<StreamEventType.CITATIONS>;
213
+ citations: z.ZodArray<z.ZodObject<{
214
+ url: z.ZodString;
215
+ title: z.ZodString;
216
+ content: z.ZodOptional<z.ZodString>;
217
+ startIndex: z.ZodNumber;
218
+ endIndex: z.ZodNumber;
219
+ }, z.core.$strip>>;
190
220
  }, z.core.$strip>, z.ZodObject<{
191
221
  id: z.ZodNumber;
192
222
  chatId: z.ZodString;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamEventSchema = exports.StreamImageUploadedEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
3
+ exports.StreamEventSchema = exports.StreamCitationsEventSchema = exports.StreamImageUploadedEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const message_meta_schema_1 = require("./message-meta.schema");
6
6
  const generation_step_schema_1 = require("./generation-step.schema");
7
+ const citation_schema_1 = require("./citation.schema");
7
8
  /**
8
9
  * Stream Event Types for message streaming (NDJSON format)
9
10
  */
@@ -23,6 +24,8 @@ var StreamEventType;
23
24
  StreamEventType["IMAGE_GENERATION_START"] = "image_generation_start";
24
25
  /** Image uploaded to S3 */
25
26
  StreamEventType["IMAGE_UPLOADED"] = "image_uploaded";
27
+ /** Web search citations/sources */
28
+ StreamEventType["CITATIONS"] = "citations";
26
29
  /** Stream completed successfully */
27
30
  StreamEventType["DONE"] = "done";
28
31
  /** Error occurred during streaming */
@@ -126,6 +129,14 @@ exports.StreamImageUploadedEventSchema = BaseStreamEventSchema.extend({
126
129
  /** Image index (for multiple images in one message) */
127
130
  imageIndex: zod_1.z.number().int().nonnegative(),
128
131
  });
132
+ /**
133
+ * Citations event - web search sources
134
+ */
135
+ exports.StreamCitationsEventSchema = BaseStreamEventSchema.extend({
136
+ type: zod_1.z.literal(StreamEventType.CITATIONS),
137
+ /** Array of citations from web search */
138
+ citations: zod_1.z.array(citation_schema_1.CitationSchema),
139
+ });
129
140
  // ============================================================================
130
141
  // Union Schema
131
142
  // ============================================================================
@@ -141,6 +152,7 @@ exports.StreamEventSchema = zod_1.z.discriminatedUnion('type', [
141
152
  exports.StreamStepDoneEventSchema,
142
153
  exports.StreamImageGenerationStartEventSchema,
143
154
  exports.StreamImageUploadedEventSchema,
155
+ exports.StreamCitationsEventSchema,
144
156
  exports.StreamDoneEventSchema,
145
157
  exports.StreamErrorEventSchema,
146
158
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "API contracts for Veruna project - Zod schemas, types, and paths",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",