@veruna/api-contracts 1.0.52 → 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.
@@ -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;
@@ -97,6 +97,18 @@ export declare namespace CreateMessageCommand {
97
97
  type: z.ZodLiteral<import("../schemas").StreamEventType.IMAGE_UPLOADED>;
98
98
  imageUrl: z.ZodString;
99
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>>;
100
112
  }, z.core.$strip>, z.ZodObject<{
101
113
  id: z.ZodNumber;
102
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
+ });
@@ -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.52",
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",