@veruna/api-contracts 1.0.48 → 1.0.49

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.
@@ -11,6 +11,8 @@ export declare enum AIErrorCode {
11
11
  COST_LIMIT_EXCEEDED = "COST_LIMIT_EXCEEDED",
12
12
  PROVIDER_ERROR = "PROVIDER_ERROR",
13
13
  PROVIDER_RATE_LIMIT = "PROVIDER_RATE_LIMIT",
14
- PROVIDER_TIMEOUT = "PROVIDER_TIMEOUT"
14
+ PROVIDER_TIMEOUT = "PROVIDER_TIMEOUT",
15
+ PROMPT_GENERATION_FAILED = "PROMPT_GENERATION_FAILED",
16
+ PROMPT_GENERATOR_MODEL_NOT_FOUND = "PROMPT_GENERATOR_MODEL_NOT_FOUND"
15
17
  }
16
18
  export declare const AI_ERRORS: Record<AIErrorCode, ErrorMetadata>;
@@ -19,6 +19,9 @@ var AIErrorCode;
19
19
  AIErrorCode["PROVIDER_ERROR"] = "PROVIDER_ERROR";
20
20
  AIErrorCode["PROVIDER_RATE_LIMIT"] = "PROVIDER_RATE_LIMIT";
21
21
  AIErrorCode["PROVIDER_TIMEOUT"] = "PROVIDER_TIMEOUT";
22
+ // Prompt Generation
23
+ AIErrorCode["PROMPT_GENERATION_FAILED"] = "PROMPT_GENERATION_FAILED";
24
+ AIErrorCode["PROMPT_GENERATOR_MODEL_NOT_FOUND"] = "PROMPT_GENERATOR_MODEL_NOT_FOUND";
22
25
  })(AIErrorCode || (exports.AIErrorCode = AIErrorCode = {}));
23
26
  exports.AI_ERRORS = {
24
27
  [AIErrorCode.GENERATION_FAILED]: {
@@ -69,4 +72,12 @@ exports.AI_ERRORS = {
69
72
  code: AIErrorCode.PROVIDER_TIMEOUT,
70
73
  statusCode: 504,
71
74
  },
75
+ [AIErrorCode.PROMPT_GENERATION_FAILED]: {
76
+ code: AIErrorCode.PROMPT_GENERATION_FAILED,
77
+ statusCode: 500,
78
+ },
79
+ [AIErrorCode.PROMPT_GENERATOR_MODEL_NOT_FOUND]: {
80
+ code: AIErrorCode.PROMPT_GENERATOR_MODEL_NOT_FOUND,
81
+ statusCode: 404,
82
+ },
72
83
  };
@@ -36,6 +36,15 @@ export declare namespace CreateRegChatCommand {
36
36
  summary: z.ZodOptional<z.ZodString>;
37
37
  }, z.core.$strip>>>;
38
38
  }, z.core.$strip>>;
39
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
41
+ content: z.ZodString;
42
+ modelId: z.ZodOptional<z.ZodString>;
43
+ modelTitle: z.ZodOptional<z.ZodString>;
44
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
45
+ startedAt: z.ZodOptional<z.ZodString>;
46
+ completedAt: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>>>;
39
48
  }, z.core.$strip>>;
40
49
  createdAt: z.ZodString;
41
50
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace CreateUnregChatCommand {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -36,6 +36,15 @@ export declare namespace UpdateChatTitleCommand {
36
36
  summary: z.ZodOptional<z.ZodString>;
37
37
  }, z.core.$strip>>>;
38
38
  }, z.core.$strip>>;
39
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
40
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
41
+ content: z.ZodString;
42
+ modelId: z.ZodOptional<z.ZodString>;
43
+ modelTitle: z.ZodOptional<z.ZodString>;
44
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
45
+ startedAt: z.ZodOptional<z.ZodString>;
46
+ completedAt: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>>>;
39
48
  }, z.core.$strip>>;
40
49
  createdAt: z.ZodString;
41
50
  updatedAt: z.ZodString;
@@ -37,6 +37,15 @@ export declare namespace UpdateChatCommand {
37
37
  summary: z.ZodOptional<z.ZodString>;
38
38
  }, z.core.$strip>>>;
39
39
  }, z.core.$strip>>;
40
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
41
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
42
+ content: z.ZodString;
43
+ modelId: z.ZodOptional<z.ZodString>;
44
+ modelTitle: z.ZodOptional<z.ZodString>;
45
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
46
+ startedAt: z.ZodOptional<z.ZodString>;
47
+ completedAt: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strip>>>;
40
49
  }, z.core.$strip>>;
41
50
  createdAt: z.ZodString;
42
51
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace GetLastActiveChatQuery {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace GetRegChatQuery {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -34,6 +34,15 @@ export declare namespace GetUnregChatQuery {
34
34
  summary: z.ZodOptional<z.ZodString>;
35
35
  }, z.core.$strip>>>;
36
36
  }, z.core.$strip>>;
37
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
39
+ content: z.ZodString;
40
+ modelId: z.ZodOptional<z.ZodString>;
41
+ modelTitle: z.ZodOptional<z.ZodString>;
42
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
43
+ startedAt: z.ZodOptional<z.ZodString>;
44
+ completedAt: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>>>;
37
46
  }, z.core.$strip>>;
38
47
  createdAt: z.ZodString;
39
48
  updatedAt: z.ZodString;
@@ -28,6 +28,15 @@ export declare const ChatWithMessagesResponseSchema: z.ZodObject<{
28
28
  summary: z.ZodOptional<z.ZodString>;
29
29
  }, z.core.$strip>>>;
30
30
  }, z.core.$strip>>;
31
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
32
+ type: z.ZodEnum<typeof import("../..").GenerationStepType>;
33
+ content: z.ZodString;
34
+ modelId: z.ZodOptional<z.ZodString>;
35
+ modelTitle: z.ZodOptional<z.ZodString>;
36
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
37
+ startedAt: z.ZodOptional<z.ZodString>;
38
+ completedAt: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>>>;
31
40
  }, z.core.$strip>>;
32
41
  createdAt: z.ZodString;
33
42
  updatedAt: z.ZodString;
@@ -71,6 +71,24 @@ export declare namespace CreateMessageCommand {
71
71
  imageBase64: z.ZodString;
72
72
  imageMimeType: z.ZodString;
73
73
  imageIndex: z.ZodNumber;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ id: z.ZodNumber;
76
+ chatId: z.ZodString;
77
+ messageId: z.ZodString;
78
+ type: z.ZodLiteral<import("../schemas").StreamEventType.PROMPT_GENERATION>;
79
+ promptChunk: z.ZodString;
80
+ }, z.core.$strip>, z.ZodObject<{
81
+ id: z.ZodNumber;
82
+ chatId: z.ZodString;
83
+ messageId: z.ZodString;
84
+ type: z.ZodLiteral<import("../schemas").StreamEventType.STEP_DONE>;
85
+ stepType: z.ZodEnum<typeof import("../schemas").GenerationStepType>;
86
+ fullContent: z.ZodOptional<z.ZodString>;
87
+ }, z.core.$strip>, z.ZodObject<{
88
+ id: z.ZodNumber;
89
+ chatId: z.ZodString;
90
+ messageId: z.ZodString;
91
+ type: z.ZodLiteral<import("../schemas").StreamEventType.IMAGE_GENERATION_START>;
74
92
  }, z.core.$strip>, z.ZodObject<{
75
93
  id: z.ZodNumber;
76
94
  chatId: z.ZodString;
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Generation step types for multi-stage generation
4
+ */
5
+ export declare enum GenerationStepType {
6
+ /** Prompt generation step (AI generates image prompt) */
7
+ PROMPT_GENERATION = "prompt_generation",
8
+ /** Image generation step */
9
+ IMAGE_GENERATION = "image_generation"
10
+ }
11
+ /**
12
+ * Single generation step in multi-stage process
13
+ */
14
+ export declare const GenerationStepSchema: z.ZodObject<{
15
+ type: z.ZodEnum<typeof GenerationStepType>;
16
+ content: z.ZodString;
17
+ modelId: z.ZodOptional<z.ZodString>;
18
+ modelTitle: z.ZodOptional<z.ZodString>;
19
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
20
+ startedAt: z.ZodOptional<z.ZodString>;
21
+ completedAt: z.ZodOptional<z.ZodString>;
22
+ }, z.core.$strip>;
23
+ export type GenerationStep = z.infer<typeof GenerationStepSchema>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GenerationStepSchema = exports.GenerationStepType = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Generation step types for multi-stage generation
7
+ */
8
+ var GenerationStepType;
9
+ (function (GenerationStepType) {
10
+ /** Prompt generation step (AI generates image prompt) */
11
+ GenerationStepType["PROMPT_GENERATION"] = "prompt_generation";
12
+ /** Image generation step */
13
+ GenerationStepType["IMAGE_GENERATION"] = "image_generation";
14
+ })(GenerationStepType || (exports.GenerationStepType = GenerationStepType = {}));
15
+ /**
16
+ * Single generation step in multi-stage process
17
+ */
18
+ exports.GenerationStepSchema = zod_1.z.object({
19
+ /** Step type identifier */
20
+ type: zod_1.z.nativeEnum(GenerationStepType),
21
+ /** Step content (e.g., generated prompt text) */
22
+ content: zod_1.z.string(),
23
+ /** Model UUID used for this step */
24
+ modelId: zod_1.z.string().uuid().optional(),
25
+ /** Model display name for UI */
26
+ modelTitle: zod_1.z.string().optional(),
27
+ /** Whether to include this step in context for future generations */
28
+ includeInContext: zod_1.z.boolean().default(false),
29
+ /** Timestamp when step started */
30
+ startedAt: zod_1.z.string().optional(),
31
+ /** Timestamp when step completed */
32
+ completedAt: zod_1.z.string().optional(),
33
+ });
@@ -4,10 +4,13 @@ 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, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
7
+ export { StreamEventType, StreamEventSchema, StreamChunkEventSchema, StreamReasoningEventSchema, StreamImageEventSchema, StreamPromptGenerationEventSchema, StreamStepDoneEventSchema, StreamImageGenerationStartEventSchema, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
8
8
  export { AttachmentType, AttachmentSchema, AttachmentsSchema } from './message-attachment.schema';
9
9
  export type { Attachment, Attachments } from './message-attachment.schema';
10
10
  export { MessageMetaSchema, ReasoningMetaSchema, ReasoningDetailSchema, } from './message-meta.schema';
11
+ export type { MessageMetaData } from './message-meta.schema';
12
+ export { GenerationStepSchema, GenerationStepType } from './generation-step.schema';
13
+ export type { GenerationStep } from './generation-step.schema';
11
14
  export { RateMessageRequestSchema, RateMessageResponseSchema, RateMessageParamsSchema, } from './rate-message.schema';
12
15
  export type { RateMessageRequestDto, RateMessageResponseDto, RateMessageParamsDto, } from './rate-message.schema';
13
16
  export { DeleteMessageParamsSchema, DeleteMessageResponseSchema } from './delete-message.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.ReasoningDetailSchema = exports.ReasoningMetaSchema = exports.MessageMetaSchema = exports.AttachmentsSchema = exports.AttachmentSchema = exports.AttachmentType = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = 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.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;
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");
@@ -19,6 +19,9 @@ Object.defineProperty(exports, "StreamEventSchema", { enumerable: true, get: fun
19
19
  Object.defineProperty(exports, "StreamChunkEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamChunkEventSchema; } });
20
20
  Object.defineProperty(exports, "StreamReasoningEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamReasoningEventSchema; } });
21
21
  Object.defineProperty(exports, "StreamImageEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamImageEventSchema; } });
22
+ Object.defineProperty(exports, "StreamPromptGenerationEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamPromptGenerationEventSchema; } });
23
+ Object.defineProperty(exports, "StreamStepDoneEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamStepDoneEventSchema; } });
24
+ Object.defineProperty(exports, "StreamImageGenerationStartEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamImageGenerationStartEventSchema; } });
22
25
  Object.defineProperty(exports, "StreamDoneEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamDoneEventSchema; } });
23
26
  Object.defineProperty(exports, "StreamErrorEventSchema", { enumerable: true, get: function () { return stream_events_schema_1.StreamErrorEventSchema; } });
24
27
  var message_attachment_schema_1 = require("./message-attachment.schema");
@@ -29,6 +32,9 @@ var message_meta_schema_1 = require("./message-meta.schema");
29
32
  Object.defineProperty(exports, "MessageMetaSchema", { enumerable: true, get: function () { return message_meta_schema_1.MessageMetaSchema; } });
30
33
  Object.defineProperty(exports, "ReasoningMetaSchema", { enumerable: true, get: function () { return message_meta_schema_1.ReasoningMetaSchema; } });
31
34
  Object.defineProperty(exports, "ReasoningDetailSchema", { enumerable: true, get: function () { return message_meta_schema_1.ReasoningDetailSchema; } });
35
+ var generation_step_schema_1 = require("./generation-step.schema");
36
+ Object.defineProperty(exports, "GenerationStepSchema", { enumerable: true, get: function () { return generation_step_schema_1.GenerationStepSchema; } });
37
+ Object.defineProperty(exports, "GenerationStepType", { enumerable: true, get: function () { return generation_step_schema_1.GenerationStepType; } });
32
38
  var rate_message_schema_1 = require("./rate-message.schema");
33
39
  Object.defineProperty(exports, "RateMessageRequestSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageRequestSchema; } });
34
40
  Object.defineProperty(exports, "RateMessageResponseSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageResponseSchema; } });
@@ -43,4 +43,14 @@ export declare const MessageMetaSchema: z.ZodObject<{
43
43
  summary: z.ZodOptional<z.ZodString>;
44
44
  }, z.core.$strip>>>;
45
45
  }, z.core.$strip>>;
46
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
+ type: z.ZodEnum<typeof import("./generation-step.schema").GenerationStepType>;
48
+ content: z.ZodString;
49
+ modelId: z.ZodOptional<z.ZodString>;
50
+ modelTitle: z.ZodOptional<z.ZodString>;
51
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
52
+ startedAt: z.ZodOptional<z.ZodString>;
53
+ completedAt: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>>>;
46
55
  }, z.core.$strip>;
56
+ export type MessageMetaData = z.infer<typeof MessageMetaSchema>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MessageMetaSchema = exports.ReasoningMetaSchema = exports.ReasoningDetailSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const generation_step_schema_1 = require("./generation-step.schema");
5
6
  /**
6
7
  * Reasoning detail from AI model (e.g., Claude extended thinking)
7
8
  * Supports both plain text and encrypted reasoning formats
@@ -32,4 +33,6 @@ exports.ReasoningMetaSchema = zod_1.z.object({
32
33
  exports.MessageMetaSchema = zod_1.z.object({
33
34
  /** AI model reasoning/thinking (for models that support extended thinking) */
34
35
  reasoning: exports.ReasoningMetaSchema.optional(),
36
+ /** Generation steps for multi-stage processes (e.g., prompt → image) */
37
+ steps: zod_1.z.array(generation_step_schema_1.GenerationStepSchema).optional(),
35
38
  });
@@ -22,6 +22,15 @@ export declare const MessageResponseSchema: z.ZodObject<{
22
22
  summary: z.ZodOptional<z.ZodString>;
23
23
  }, z.core.$strip>>>;
24
24
  }, z.core.$strip>>;
25
+ steps: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
+ type: z.ZodEnum<typeof import("./generation-step.schema").GenerationStepType>;
27
+ content: z.ZodString;
28
+ modelId: z.ZodOptional<z.ZodString>;
29
+ modelTitle: z.ZodOptional<z.ZodString>;
30
+ includeInContext: z.ZodDefault<z.ZodBoolean>;
31
+ startedAt: z.ZodOptional<z.ZodString>;
32
+ completedAt: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>>>;
25
34
  }, z.core.$strip>>;
26
35
  createdAt: z.ZodString;
27
36
  updatedAt: z.ZodString;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { GenerationStepType } from './generation-step.schema';
2
3
  /**
3
4
  * Stream Event Types for message streaming (NDJSON format)
4
5
  */
@@ -9,6 +10,12 @@ export declare enum StreamEventType {
9
10
  REASONING = "reasoning",
10
11
  /** Image generated by AI */
11
12
  IMAGE = "image",
13
+ /** Prompt generation chunk - AI generating image prompt */
14
+ PROMPT_GENERATION = "prompt_generation",
15
+ /** Generation step completed (NOT the whole stream) */
16
+ STEP_DONE = "step_done",
17
+ /** Image generation started */
18
+ IMAGE_GENERATION_START = "image_generation_start",
12
19
  /** Stream completed successfully */
13
20
  DONE = "done",
14
21
  /** Error occurred during streaming */
@@ -77,6 +84,36 @@ export declare const StreamImageEventSchema: z.ZodObject<{
77
84
  imageMimeType: z.ZodString;
78
85
  imageIndex: z.ZodNumber;
79
86
  }, z.core.$strip>;
87
+ /**
88
+ * Prompt generation chunk event - AI generating image prompt
89
+ */
90
+ export declare const StreamPromptGenerationEventSchema: z.ZodObject<{
91
+ id: z.ZodNumber;
92
+ chatId: z.ZodString;
93
+ messageId: z.ZodString;
94
+ type: z.ZodLiteral<StreamEventType.PROMPT_GENERATION>;
95
+ promptChunk: z.ZodString;
96
+ }, z.core.$strip>;
97
+ /**
98
+ * Step done event - a generation step completed (NOT the whole stream)
99
+ */
100
+ export declare const StreamStepDoneEventSchema: z.ZodObject<{
101
+ id: z.ZodNumber;
102
+ chatId: z.ZodString;
103
+ messageId: z.ZodString;
104
+ type: z.ZodLiteral<StreamEventType.STEP_DONE>;
105
+ stepType: z.ZodEnum<typeof GenerationStepType>;
106
+ fullContent: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strip>;
108
+ /**
109
+ * Image generation start event - signals start of image generation
110
+ */
111
+ export declare const StreamImageGenerationStartEventSchema: z.ZodObject<{
112
+ id: z.ZodNumber;
113
+ chatId: z.ZodString;
114
+ messageId: z.ZodString;
115
+ type: z.ZodLiteral<StreamEventType.IMAGE_GENERATION_START>;
116
+ }, z.core.$strip>;
80
117
  /**
81
118
  * Discriminated union of all stream events
82
119
  * Use `type` field to narrow the type
@@ -112,6 +149,24 @@ export declare const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
112
149
  imageBase64: z.ZodString;
113
150
  imageMimeType: z.ZodString;
114
151
  imageIndex: z.ZodNumber;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ id: z.ZodNumber;
154
+ chatId: z.ZodString;
155
+ messageId: z.ZodString;
156
+ type: z.ZodLiteral<StreamEventType.PROMPT_GENERATION>;
157
+ promptChunk: z.ZodString;
158
+ }, z.core.$strip>, z.ZodObject<{
159
+ id: z.ZodNumber;
160
+ chatId: z.ZodString;
161
+ messageId: z.ZodString;
162
+ type: z.ZodLiteral<StreamEventType.STEP_DONE>;
163
+ stepType: z.ZodEnum<typeof GenerationStepType>;
164
+ fullContent: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ id: z.ZodNumber;
167
+ chatId: z.ZodString;
168
+ messageId: z.ZodString;
169
+ type: z.ZodLiteral<StreamEventType.IMAGE_GENERATION_START>;
115
170
  }, z.core.$strip>, z.ZodObject<{
116
171
  id: z.ZodNumber;
117
172
  chatId: z.ZodString;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StreamEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
3
+ exports.StreamEventSchema = 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
+ const generation_step_schema_1 = require("./generation-step.schema");
6
7
  /**
7
8
  * Stream Event Types for message streaming (NDJSON format)
8
9
  */
@@ -14,6 +15,12 @@ var StreamEventType;
14
15
  StreamEventType["REASONING"] = "reasoning";
15
16
  /** Image generated by AI */
16
17
  StreamEventType["IMAGE"] = "image";
18
+ /** Prompt generation chunk - AI generating image prompt */
19
+ StreamEventType["PROMPT_GENERATION"] = "prompt_generation";
20
+ /** Generation step completed (NOT the whole stream) */
21
+ StreamEventType["STEP_DONE"] = "step_done";
22
+ /** Image generation started */
23
+ StreamEventType["IMAGE_GENERATION_START"] = "image_generation_start";
17
24
  /** Stream completed successfully */
18
25
  StreamEventType["DONE"] = "done";
19
26
  /** Error occurred during streaming */
@@ -83,6 +90,30 @@ exports.StreamImageEventSchema = BaseStreamEventSchema.extend({
83
90
  /** Image index (for multiple images in one message) */
84
91
  imageIndex: zod_1.z.number().int().nonnegative(),
85
92
  });
93
+ /**
94
+ * Prompt generation chunk event - AI generating image prompt
95
+ */
96
+ exports.StreamPromptGenerationEventSchema = BaseStreamEventSchema.extend({
97
+ type: zod_1.z.literal(StreamEventType.PROMPT_GENERATION),
98
+ /** Partial prompt text being generated */
99
+ promptChunk: zod_1.z.string(),
100
+ });
101
+ /**
102
+ * Step done event - a generation step completed (NOT the whole stream)
103
+ */
104
+ exports.StreamStepDoneEventSchema = BaseStreamEventSchema.extend({
105
+ type: zod_1.z.literal(StreamEventType.STEP_DONE),
106
+ /** Which step type completed */
107
+ stepType: zod_1.z.nativeEnum(generation_step_schema_1.GenerationStepType),
108
+ /** Full content of the completed step (in Russian for prompt_generation) */
109
+ fullContent: zod_1.z.string().optional(),
110
+ });
111
+ /**
112
+ * Image generation start event - signals start of image generation
113
+ */
114
+ exports.StreamImageGenerationStartEventSchema = BaseStreamEventSchema.extend({
115
+ type: zod_1.z.literal(StreamEventType.IMAGE_GENERATION_START),
116
+ });
86
117
  // ============================================================================
87
118
  // Union Schema
88
119
  // ============================================================================
@@ -94,6 +125,9 @@ exports.StreamEventSchema = zod_1.z.discriminatedUnion('type', [
94
125
  exports.StreamChunkEventSchema,
95
126
  exports.StreamReasoningEventSchema,
96
127
  exports.StreamImageEventSchema,
128
+ exports.StreamPromptGenerationEventSchema,
129
+ exports.StreamStepDoneEventSchema,
130
+ exports.StreamImageGenerationStartEventSchema,
97
131
  exports.StreamDoneEventSchema,
98
132
  exports.StreamErrorEventSchema,
99
133
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
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",