@veruna/api-contracts 1.0.27 → 1.0.29
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/build/v1/message/commands/create-message.command.d.ts +12 -0
- package/build/v1/message/schemas/index.d.ts +1 -1
- package/build/v1/message/schemas/index.js +2 -1
- package/build/v1/message/schemas/stream-events.schema.d.ts +30 -0
- package/build/v1/message/schemas/stream-events.schema.js +20 -1
- package/package.json +1 -1
|
@@ -46,6 +46,18 @@ export declare namespace CreateMessageCommand {
|
|
|
46
46
|
messageId: z.ZodString;
|
|
47
47
|
type: z.ZodLiteral<import("../schemas").StreamEventType.CHUNK>;
|
|
48
48
|
content: z.ZodString;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
id: z.ZodNumber;
|
|
51
|
+
chatId: z.ZodString;
|
|
52
|
+
messageId: z.ZodString;
|
|
53
|
+
type: z.ZodLiteral<import("../schemas").StreamEventType.REASONING>;
|
|
54
|
+
reasoning: z.ZodString;
|
|
55
|
+
reasoningDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
|
+
type: z.ZodString;
|
|
57
|
+
summary: z.ZodString;
|
|
58
|
+
format: z.ZodOptional<z.ZodString>;
|
|
59
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.core.$strip>>>;
|
|
49
61
|
}, z.core.$strip>, z.ZodObject<{
|
|
50
62
|
id: z.ZodNumber;
|
|
51
63
|
chatId: z.ZodString;
|
|
@@ -4,4 +4,4 @@ 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, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
|
|
7
|
+
export { StreamEventType, StreamEventSchema, StreamChunkEventSchema, StreamReasoningEventSchema, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamChunkEventSchema = exports.StreamEventSchema = exports.StreamEventType = exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
|
|
3
|
+
exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = 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");
|
|
@@ -17,5 +17,6 @@ var stream_events_schema_1 = require("./stream-events.schema");
|
|
|
17
17
|
Object.defineProperty(exports, "StreamEventType", { enumerable: true, get: function () { return stream_events_schema_1.StreamEventType; } });
|
|
18
18
|
Object.defineProperty(exports, "StreamEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamEventSchema; } });
|
|
19
19
|
Object.defineProperty(exports, "StreamChunkEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamChunkEventSchema; } });
|
|
20
|
+
Object.defineProperty(exports, "StreamReasoningEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamReasoningEventSchema; } });
|
|
20
21
|
Object.defineProperty(exports, "StreamDoneEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamDoneEventSchema; } });
|
|
21
22
|
Object.defineProperty(exports, "StreamErrorEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamErrorEventSchema; } });
|
|
@@ -5,6 +5,8 @@ import { z } from 'zod';
|
|
|
5
5
|
export declare enum StreamEventType {
|
|
6
6
|
/** Content chunk from AI */
|
|
7
7
|
CHUNK = "chunk",
|
|
8
|
+
/** Reasoning chunk from AI */
|
|
9
|
+
REASONING = "reasoning",
|
|
8
10
|
/** Stream completed successfully */
|
|
9
11
|
DONE = "done",
|
|
10
12
|
/** Error occurred during streaming */
|
|
@@ -20,6 +22,22 @@ export declare const StreamChunkEventSchema: z.ZodObject<{
|
|
|
20
22
|
type: z.ZodLiteral<StreamEventType.CHUNK>;
|
|
21
23
|
content: z.ZodString;
|
|
22
24
|
}, z.core.$strip>;
|
|
25
|
+
/**
|
|
26
|
+
* Reasoning chunk event - contains model reasoning text
|
|
27
|
+
*/
|
|
28
|
+
export declare const StreamReasoningEventSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodNumber;
|
|
30
|
+
chatId: z.ZodString;
|
|
31
|
+
messageId: z.ZodString;
|
|
32
|
+
type: z.ZodLiteral<StreamEventType.REASONING>;
|
|
33
|
+
reasoning: z.ZodString;
|
|
34
|
+
reasoningDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
35
|
+
type: z.ZodString;
|
|
36
|
+
summary: z.ZodString;
|
|
37
|
+
format: z.ZodOptional<z.ZodString>;
|
|
38
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
23
41
|
/**
|
|
24
42
|
* Done event - stream completed successfully
|
|
25
43
|
*/
|
|
@@ -50,6 +68,18 @@ export declare const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
50
68
|
messageId: z.ZodString;
|
|
51
69
|
type: z.ZodLiteral<StreamEventType.CHUNK>;
|
|
52
70
|
content: z.ZodString;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
id: z.ZodNumber;
|
|
73
|
+
chatId: z.ZodString;
|
|
74
|
+
messageId: z.ZodString;
|
|
75
|
+
type: z.ZodLiteral<StreamEventType.REASONING>;
|
|
76
|
+
reasoning: z.ZodString;
|
|
77
|
+
reasoningDetails: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
+
type: z.ZodString;
|
|
79
|
+
summary: z.ZodString;
|
|
80
|
+
format: z.ZodOptional<z.ZodString>;
|
|
81
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
}, z.core.$strip>>>;
|
|
53
83
|
}, z.core.$strip>, z.ZodObject<{
|
|
54
84
|
id: z.ZodNumber;
|
|
55
85
|
chatId: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StreamEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
|
|
3
|
+
exports.StreamEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
6
|
* Stream Event Types for message streaming (NDJSON format)
|
|
@@ -9,6 +9,8 @@ var StreamEventType;
|
|
|
9
9
|
(function (StreamEventType) {
|
|
10
10
|
/** Content chunk from AI */
|
|
11
11
|
StreamEventType["CHUNK"] = "chunk";
|
|
12
|
+
/** Reasoning chunk from AI */
|
|
13
|
+
StreamEventType["REASONING"] = "reasoning";
|
|
12
14
|
/** Stream completed successfully */
|
|
13
15
|
StreamEventType["DONE"] = "done";
|
|
14
16
|
/** Error occurred during streaming */
|
|
@@ -36,6 +38,22 @@ exports.StreamChunkEventSchema = BaseStreamEventSchema.extend({
|
|
|
36
38
|
/** Partial content from AI */
|
|
37
39
|
content: zod_1.z.string().min(1),
|
|
38
40
|
});
|
|
41
|
+
/**
|
|
42
|
+
* Reasoning chunk event - contains model reasoning text
|
|
43
|
+
*/
|
|
44
|
+
exports.StreamReasoningEventSchema = BaseStreamEventSchema.extend({
|
|
45
|
+
type: zod_1.z.literal(StreamEventType.REASONING),
|
|
46
|
+
/** Partial reasoning text */
|
|
47
|
+
reasoning: zod_1.z.string().min(1),
|
|
48
|
+
reasoningDetails: zod_1.z
|
|
49
|
+
.array(zod_1.z.object({
|
|
50
|
+
type: zod_1.z.string(),
|
|
51
|
+
summary: zod_1.z.string(),
|
|
52
|
+
format: zod_1.z.string().optional(),
|
|
53
|
+
index: zod_1.z.number().int().nonnegative().optional(),
|
|
54
|
+
}))
|
|
55
|
+
.optional(),
|
|
56
|
+
});
|
|
39
57
|
/**
|
|
40
58
|
* Done event - stream completed successfully
|
|
41
59
|
*/
|
|
@@ -61,6 +79,7 @@ exports.StreamErrorEventSchema = BaseStreamEventSchema.extend({
|
|
|
61
79
|
*/
|
|
62
80
|
exports.StreamEventSchema = zod_1.z.discriminatedUnion('type', [
|
|
63
81
|
exports.StreamChunkEventSchema,
|
|
82
|
+
exports.StreamReasoningEventSchema,
|
|
64
83
|
exports.StreamDoneEventSchema,
|
|
65
84
|
exports.StreamErrorEventSchema,
|
|
66
85
|
]);
|