geniebox-shared-lib 2.4.7 → 2.5.0

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.
@@ -0,0 +1,12 @@
1
+ import { OnModuleInit } from "@nestjs/common";
2
+ import { ClientGrpc } from "@nestjs/microservices";
3
+ import { GenerationRuntimeServiceClient } from "./generation_runtime.interface";
4
+ export declare class GenerationRuntimeClient implements OnModuleInit {
5
+ private readonly client;
6
+ private readonly logger;
7
+ private generationRuntimeClient?;
8
+ constructor(client: ClientGrpc);
9
+ onModuleInit(): void;
10
+ get service(): GenerationRuntimeServiceClient;
11
+ isReady(): boolean;
12
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var GenerationRuntimeClient_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.GenerationRuntimeClient = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ let GenerationRuntimeClient = GenerationRuntimeClient_1 = class GenerationRuntimeClient {
19
+ constructor(client) {
20
+ this.client = client;
21
+ this.logger = new common_1.Logger(GenerationRuntimeClient_1.name);
22
+ }
23
+ onModuleInit() {
24
+ this.generationRuntimeClient =
25
+ this.client.getService("GenerationRuntimeService");
26
+ this.logger.log("GenerationRuntimeServiceClient initialized");
27
+ }
28
+ get service() {
29
+ if (!this.generationRuntimeClient) {
30
+ throw new common_1.InternalServerErrorException("GenerationRuntimeService is not initialized yet");
31
+ }
32
+ return this.generationRuntimeClient;
33
+ }
34
+ isReady() {
35
+ return !!this.generationRuntimeClient;
36
+ }
37
+ };
38
+ exports.GenerationRuntimeClient = GenerationRuntimeClient;
39
+ exports.GenerationRuntimeClient = GenerationRuntimeClient = GenerationRuntimeClient_1 = __decorate([
40
+ (0, common_1.Injectable)(),
41
+ __param(0, (0, common_1.Inject)("GENERATION_RUNTIME_PACKAGE")),
42
+ __metadata("design:paramtypes", [Object])
43
+ ], GenerationRuntimeClient);
@@ -0,0 +1,83 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import type { handleUnaryCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
3
+ import { Observable } from "rxjs";
4
+ import { Empty } from "./google/protobuf/empty.interface";
5
+ export declare const protobufPackage = "generation_runtime";
6
+ export interface StartChatRunRequest {
7
+ chatId: string;
8
+ userId: string;
9
+ payload?: {
10
+ [key: string]: any;
11
+ } | undefined;
12
+ idempotencyKey: string;
13
+ }
14
+ export interface StartChatRunResponse {
15
+ runId: string;
16
+ status: string;
17
+ }
18
+ export interface SubmitToolResultRequest {
19
+ runId: string;
20
+ toolCallId: string;
21
+ payload?: {
22
+ [key: string]: any;
23
+ } | undefined;
24
+ }
25
+ export interface CancelRunRequest {
26
+ runId: string;
27
+ }
28
+ export declare const GENERATION_RUNTIME_PACKAGE_NAME = "generation_runtime";
29
+ export declare const StartChatRunRequest: MessageFns<StartChatRunRequest>;
30
+ export declare const StartChatRunResponse: MessageFns<StartChatRunResponse>;
31
+ export declare const SubmitToolResultRequest: MessageFns<SubmitToolResultRequest>;
32
+ export declare const CancelRunRequest: MessageFns<CancelRunRequest>;
33
+ export interface GenerationRuntimeServiceClient {
34
+ startChatRun(request: StartChatRunRequest, metadata?: Metadata): Observable<StartChatRunResponse>;
35
+ submitToolResult(request: SubmitToolResultRequest, metadata?: Metadata): Observable<Empty>;
36
+ cancelRun(request: CancelRunRequest, metadata?: Metadata): Observable<Empty>;
37
+ }
38
+ export interface GenerationRuntimeServiceController {
39
+ startChatRun(request: StartChatRunRequest, metadata?: Metadata): Promise<StartChatRunResponse> | Observable<StartChatRunResponse> | StartChatRunResponse;
40
+ submitToolResult(request: SubmitToolResultRequest, metadata?: Metadata): void;
41
+ cancelRun(request: CancelRunRequest, metadata?: Metadata): void;
42
+ }
43
+ export declare function GenerationRuntimeServiceControllerMethods(): (constructor: Function) => void;
44
+ export declare const GENERATION_RUNTIME_SERVICE_NAME = "GenerationRuntimeService";
45
+ export type GenerationRuntimeServiceService = typeof GenerationRuntimeServiceService;
46
+ export declare const GenerationRuntimeServiceService: {
47
+ readonly startChatRun: {
48
+ readonly path: "/generation_runtime.GenerationRuntimeService/StartChatRun";
49
+ readonly requestStream: false;
50
+ readonly responseStream: false;
51
+ readonly requestSerialize: (value: StartChatRunRequest) => Buffer;
52
+ readonly requestDeserialize: (value: Buffer) => StartChatRunRequest;
53
+ readonly responseSerialize: (value: StartChatRunResponse) => Buffer;
54
+ readonly responseDeserialize: (value: Buffer) => StartChatRunResponse;
55
+ };
56
+ readonly submitToolResult: {
57
+ readonly path: "/generation_runtime.GenerationRuntimeService/SubmitToolResult";
58
+ readonly requestStream: false;
59
+ readonly responseStream: false;
60
+ readonly requestSerialize: (value: SubmitToolResultRequest) => Buffer;
61
+ readonly requestDeserialize: (value: Buffer) => SubmitToolResultRequest;
62
+ readonly responseSerialize: (value: Empty) => Buffer;
63
+ readonly responseDeserialize: (value: Buffer) => Empty;
64
+ };
65
+ readonly cancelRun: {
66
+ readonly path: "/generation_runtime.GenerationRuntimeService/CancelRun";
67
+ readonly requestStream: false;
68
+ readonly responseStream: false;
69
+ readonly requestSerialize: (value: CancelRunRequest) => Buffer;
70
+ readonly requestDeserialize: (value: Buffer) => CancelRunRequest;
71
+ readonly responseSerialize: (value: Empty) => Buffer;
72
+ readonly responseDeserialize: (value: Buffer) => Empty;
73
+ };
74
+ };
75
+ export interface GenerationRuntimeServiceServer extends UntypedServiceImplementation {
76
+ startChatRun: handleUnaryCall<StartChatRunRequest, StartChatRunResponse>;
77
+ submitToolResult: handleUnaryCall<SubmitToolResultRequest, Empty>;
78
+ cancelRun: handleUnaryCall<CancelRunRequest, Empty>;
79
+ }
80
+ export interface MessageFns<T> {
81
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
82
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
83
+ }
@@ -0,0 +1,254 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.7.7
5
+ // protoc v5.28.2
6
+ // source: generation_runtime.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.GenerationRuntimeServiceService = exports.GENERATION_RUNTIME_SERVICE_NAME = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GENERATION_RUNTIME_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.GenerationRuntimeServiceControllerMethods = GenerationRuntimeServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const wire_1 = require("@bufbuild/protobuf/wire");
12
+ const microservices_1 = require("@nestjs/microservices");
13
+ const protobufjs_1 = require("protobufjs");
14
+ const empty_interface_1 = require("./google/protobuf/empty.interface");
15
+ const struct_interface_1 = require("./google/protobuf/struct.interface");
16
+ exports.protobufPackage = "generation_runtime";
17
+ exports.GENERATION_RUNTIME_PACKAGE_NAME = "generation_runtime";
18
+ function createBaseStartChatRunRequest() {
19
+ return { chatId: "", userId: "", idempotencyKey: "" };
20
+ }
21
+ exports.StartChatRunRequest = {
22
+ encode(message, writer = new wire_1.BinaryWriter()) {
23
+ if (message.chatId !== "") {
24
+ writer.uint32(10).string(message.chatId);
25
+ }
26
+ if (message.userId !== "") {
27
+ writer.uint32(18).string(message.userId);
28
+ }
29
+ if (message.payload !== undefined) {
30
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.payload), writer.uint32(26).fork()).join();
31
+ }
32
+ if (message.idempotencyKey !== "") {
33
+ writer.uint32(34).string(message.idempotencyKey);
34
+ }
35
+ return writer;
36
+ },
37
+ decode(input, length) {
38
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
39
+ const end = length === undefined ? reader.len : reader.pos + length;
40
+ const message = createBaseStartChatRunRequest();
41
+ while (reader.pos < end) {
42
+ const tag = reader.uint32();
43
+ switch (tag >>> 3) {
44
+ case 1: {
45
+ if (tag !== 10) {
46
+ break;
47
+ }
48
+ message.chatId = reader.string();
49
+ continue;
50
+ }
51
+ case 2: {
52
+ if (tag !== 18) {
53
+ break;
54
+ }
55
+ message.userId = reader.string();
56
+ continue;
57
+ }
58
+ case 3: {
59
+ if (tag !== 26) {
60
+ break;
61
+ }
62
+ message.payload = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
63
+ continue;
64
+ }
65
+ case 4: {
66
+ if (tag !== 34) {
67
+ break;
68
+ }
69
+ message.idempotencyKey = reader.string();
70
+ continue;
71
+ }
72
+ }
73
+ if ((tag & 7) === 4 || tag === 0) {
74
+ break;
75
+ }
76
+ reader.skip(tag & 7);
77
+ }
78
+ return message;
79
+ },
80
+ };
81
+ function createBaseStartChatRunResponse() {
82
+ return { runId: "", status: "" };
83
+ }
84
+ exports.StartChatRunResponse = {
85
+ encode(message, writer = new wire_1.BinaryWriter()) {
86
+ if (message.runId !== "") {
87
+ writer.uint32(10).string(message.runId);
88
+ }
89
+ if (message.status !== "") {
90
+ writer.uint32(18).string(message.status);
91
+ }
92
+ return writer;
93
+ },
94
+ decode(input, length) {
95
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
96
+ const end = length === undefined ? reader.len : reader.pos + length;
97
+ const message = createBaseStartChatRunResponse();
98
+ while (reader.pos < end) {
99
+ const tag = reader.uint32();
100
+ switch (tag >>> 3) {
101
+ case 1: {
102
+ if (tag !== 10) {
103
+ break;
104
+ }
105
+ message.runId = reader.string();
106
+ continue;
107
+ }
108
+ case 2: {
109
+ if (tag !== 18) {
110
+ break;
111
+ }
112
+ message.status = reader.string();
113
+ continue;
114
+ }
115
+ }
116
+ if ((tag & 7) === 4 || tag === 0) {
117
+ break;
118
+ }
119
+ reader.skip(tag & 7);
120
+ }
121
+ return message;
122
+ },
123
+ };
124
+ function createBaseSubmitToolResultRequest() {
125
+ return { runId: "", toolCallId: "" };
126
+ }
127
+ exports.SubmitToolResultRequest = {
128
+ encode(message, writer = new wire_1.BinaryWriter()) {
129
+ if (message.runId !== "") {
130
+ writer.uint32(10).string(message.runId);
131
+ }
132
+ if (message.toolCallId !== "") {
133
+ writer.uint32(18).string(message.toolCallId);
134
+ }
135
+ if (message.payload !== undefined) {
136
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.payload), writer.uint32(26).fork()).join();
137
+ }
138
+ return writer;
139
+ },
140
+ decode(input, length) {
141
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
142
+ const end = length === undefined ? reader.len : reader.pos + length;
143
+ const message = createBaseSubmitToolResultRequest();
144
+ while (reader.pos < end) {
145
+ const tag = reader.uint32();
146
+ switch (tag >>> 3) {
147
+ case 1: {
148
+ if (tag !== 10) {
149
+ break;
150
+ }
151
+ message.runId = reader.string();
152
+ continue;
153
+ }
154
+ case 2: {
155
+ if (tag !== 18) {
156
+ break;
157
+ }
158
+ message.toolCallId = reader.string();
159
+ continue;
160
+ }
161
+ case 3: {
162
+ if (tag !== 26) {
163
+ break;
164
+ }
165
+ message.payload = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
166
+ continue;
167
+ }
168
+ }
169
+ if ((tag & 7) === 4 || tag === 0) {
170
+ break;
171
+ }
172
+ reader.skip(tag & 7);
173
+ }
174
+ return message;
175
+ },
176
+ };
177
+ function createBaseCancelRunRequest() {
178
+ return { runId: "" };
179
+ }
180
+ exports.CancelRunRequest = {
181
+ encode(message, writer = new wire_1.BinaryWriter()) {
182
+ if (message.runId !== "") {
183
+ writer.uint32(10).string(message.runId);
184
+ }
185
+ return writer;
186
+ },
187
+ decode(input, length) {
188
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
189
+ const end = length === undefined ? reader.len : reader.pos + length;
190
+ const message = createBaseCancelRunRequest();
191
+ while (reader.pos < end) {
192
+ const tag = reader.uint32();
193
+ switch (tag >>> 3) {
194
+ case 1: {
195
+ if (tag !== 10) {
196
+ break;
197
+ }
198
+ message.runId = reader.string();
199
+ continue;
200
+ }
201
+ }
202
+ if ((tag & 7) === 4 || tag === 0) {
203
+ break;
204
+ }
205
+ reader.skip(tag & 7);
206
+ }
207
+ return message;
208
+ },
209
+ };
210
+ protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_interface_1.Struct.wrap, toObject: struct_interface_1.Struct.unwrap };
211
+ function GenerationRuntimeServiceControllerMethods() {
212
+ return function (constructor) {
213
+ const grpcMethods = ["startChatRun", "submitToolResult", "cancelRun"];
214
+ for (const method of grpcMethods) {
215
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
216
+ (0, microservices_1.GrpcMethod)("GenerationRuntimeService", method)(constructor.prototype[method], method, descriptor);
217
+ }
218
+ const grpcStreamMethods = [];
219
+ for (const method of grpcStreamMethods) {
220
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
221
+ (0, microservices_1.GrpcStreamMethod)("GenerationRuntimeService", method)(constructor.prototype[method], method, descriptor);
222
+ }
223
+ };
224
+ }
225
+ exports.GENERATION_RUNTIME_SERVICE_NAME = "GenerationRuntimeService";
226
+ exports.GenerationRuntimeServiceService = {
227
+ startChatRun: {
228
+ path: "/generation_runtime.GenerationRuntimeService/StartChatRun",
229
+ requestStream: false,
230
+ responseStream: false,
231
+ requestSerialize: (value) => Buffer.from(exports.StartChatRunRequest.encode(value).finish()),
232
+ requestDeserialize: (value) => exports.StartChatRunRequest.decode(value),
233
+ responseSerialize: (value) => Buffer.from(exports.StartChatRunResponse.encode(value).finish()),
234
+ responseDeserialize: (value) => exports.StartChatRunResponse.decode(value),
235
+ },
236
+ submitToolResult: {
237
+ path: "/generation_runtime.GenerationRuntimeService/SubmitToolResult",
238
+ requestStream: false,
239
+ responseStream: false,
240
+ requestSerialize: (value) => Buffer.from(exports.SubmitToolResultRequest.encode(value).finish()),
241
+ requestDeserialize: (value) => exports.SubmitToolResultRequest.decode(value),
242
+ responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
243
+ responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
244
+ },
245
+ cancelRun: {
246
+ path: "/generation_runtime.GenerationRuntimeService/CancelRun",
247
+ requestStream: false,
248
+ responseStream: false,
249
+ requestSerialize: (value) => Buffer.from(exports.CancelRunRequest.encode(value).finish()),
250
+ requestDeserialize: (value) => exports.CancelRunRequest.decode(value),
251
+ responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
252
+ responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
253
+ },
254
+ };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export { MCPClient } from "./mcp.client";
14
14
  export { WorkflowClient } from "./workflow.client";
15
15
  export { LibraryClient } from "./library.client";
16
16
  export { ChatClient } from "./chat.client";
17
+ export { GenerationRuntimeClient } from "./generation_runtime.client";
17
18
  export { MessageFns as UserMessageFns, protobufPackage as UserProtobufPackage, User, CreateUserRequest, CreateUserPersonal, UpdateUserRequest, FindOneRequest, UserResponse, UsersResponse, FindByEmailRequest, FindByPhoneRequest, UpdateUserPersonal, UpdatePasswordRequest, UpdateEmailVerificationRequest, ResetPasswordData, GetEmailVerificationStatusRequest, EmailVerificationStatusResponse, UserServiceService as UserService, } from "./user.interface";
18
19
  export { MessageFns as AuthMessageFns, protobufPackage as AuthProtobufPackage, LoginCredentials, RegisterCredentials, LogoutRequest, RefreshRequest, AuthResponse, RefreshTokenResponse, RecoverRequest, ResetPasswordRequest, ConfirmEmailRequest, ConfirmEmailByCodeRequest, ConfirmEmailResponse, CheckEmailVerifiedRequest, CheckEmailVerifiedResponse, ResendConfirmationCodeRequest, VerifyResetCodeRequest, } from "./auth.interface";
19
20
  export { MessageFns as EndpointMessageFns, protobufPackage as EndpointProtobufPackage, ENDPOINT_PACKAGE_NAME, ENDPOINT_SERVICE_NAME, Provider as EndpointProvider, Model as EndpointModel, Pricing as EndpointPricing, EndpointConfig, EndpointRequest, ProvidersRequest, ProvidersResponse, ModelsRequest, ModelsResponse, PricingRequest, PricingResponse, ValidateEndpointRequest, ValidateEndpointResponse, CreateEndpointRequest, UpdateEndpointRequest, GetEndpointByIdRequest, ListEndpointsRequest, DeleteEndpointRequest, CreateEndpointResponse, UpdateEndpointResponse, GetEndpointByIdResponse, ListEndpointsResponse, DeleteEndpointResponse, EndpointServiceClient, EndpointServiceController, EndpointServiceService as EndpointService, } from "./endpoint.interface";
@@ -29,3 +30,4 @@ export { MessageFns as WorkflowMessageFns, protobufPackage as WorkflowProtobufPa
29
30
  export { MessageFns as McpMessageFns, protobufPackage as McpProtobufPackage, McpServer, McpServerCustomization, McpToolCustomization, McpOAuthSession, CreateMcpServerRequest, UpdateMcpServerRequest, GetMcpServerRequest, ListMcpServersRequest, DeleteMcpServerRequest, SetServerCustomizationRequest, SetToolCustomizationRequest, McpServersResponse, McpServiceClient, McpServiceController, McpServiceService as McpService, } from "./mcp.interface";
30
31
  export { MessageFns as LibraryMessageFns, protobufPackage as LibraryProtobufPackage, Bookmark, Archive, ArchiveItem, CreateBookmarkRequest, DeleteBookmarkRequest, ListBookmarksRequest, CreateArchiveRequest, UpdateArchiveRequest, DeleteArchiveRequest, ListArchivesRequest, AddItemToArchiveRequest, RemoveItemFromArchiveRequest, BookmarksResponse, ArchivesResponse, ListArchiveItemsRequest, ArchiveItemsResponse, LibraryServiceClient, LibraryServiceController, LibraryServiceService as LibraryService, } from "./library.interface";
31
32
  export { MessageFns as ChatMessageFns, protobufPackage as ChatProtobufPackage, Chat, ChatMessage, CreateChatRequest, GetChatRequest, ListChatsRequest, DeleteChatRequest, AddMessageRequest, GetMessagesRequest, ChatsResponse, MessagesResponse, ChatServiceClient, ChatServiceController, ChatServiceService as ChatService, } from "./chat.interface";
33
+ export { MessageFns as GenerationRuntimeMessageFns, protobufPackage as GenerationRuntimeProtobufPackage, StartChatRunRequest, StartChatRunResponse, SubmitToolResultRequest, CancelRunRequest, GenerationRuntimeServiceClient, GenerationRuntimeServiceController, GenerationRuntimeServiceService as GenerationRuntimeService, } from "./generation_runtime.interface";
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EndpointProtobufPackage = exports.VerifyResetCodeRequest = exports.ResendConfirmationCodeRequest = exports.CheckEmailVerifiedResponse = exports.CheckEmailVerifiedRequest = exports.ConfirmEmailResponse = exports.ConfirmEmailByCodeRequest = exports.ConfirmEmailRequest = exports.ResetPasswordRequest = exports.RecoverRequest = exports.RefreshTokenResponse = exports.AuthResponse = exports.RefreshRequest = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.EmailVerificationStatusResponse = exports.GetEmailVerificationStatusRequest = exports.ResetPasswordData = exports.UpdateEmailVerificationRequest = exports.UpdatePasswordRequest = exports.UpdateUserPersonal = exports.FindByPhoneRequest = exports.FindByEmailRequest = exports.UsersResponse = exports.UserResponse = exports.FindOneRequest = exports.UpdateUserRequest = exports.CreateUserPersonal = exports.CreateUserRequest = exports.User = exports.UserProtobufPackage = exports.ChatClient = exports.LibraryClient = exports.WorkflowClient = exports.MCPClient = exports.AgentClient = exports.BillingClient = exports.ResponseClient = exports.RequestClient = exports.KeyClient = exports.EventClient = exports.StorageClient = exports.OpenAIClient = exports.EndpointClient = exports.AuthClient = exports.UsersClient = exports.SharedModule = void 0;
4
- exports.KeysResponse = exports.KeyResponse = exports.GetKeyByIdRequest = exports.RemoveKeyRequest = exports.UpdateKeyRequest = exports.CreateKeyRequest = exports.Key = exports.KeysProtobufPackage = exports.EventService = exports.EventMessage = exports.SubscribeRequest = exports.EventProtobufPackage = exports.FileProtobufPackage = exports.StorageService = exports.DeleteResponse = exports.DeleteRequest = exports.DownloadResponse = exports.DownloadRequest = exports.UploadResponse = exports.UploadRequest = exports.OpenAIService = exports.OpenAICreateResponse = exports.OpenAICreateRequest = exports.OpenAIProtobufPackage = exports.EndpointService = exports.DeleteEndpointResponse = exports.ListEndpointsResponse = exports.GetEndpointByIdResponse = exports.UpdateEndpointResponse = exports.CreateEndpointResponse = exports.DeleteEndpointRequest = exports.ListEndpointsRequest = exports.GetEndpointByIdRequest = exports.UpdateEndpointRequest = exports.CreateEndpointRequest = exports.ValidateEndpointResponse = exports.ValidateEndpointRequest = exports.PricingResponse = exports.PricingRequest = exports.ModelsResponse = exports.ModelsRequest = exports.ProvidersResponse = exports.ProvidersRequest = exports.EndpointRequest = exports.EndpointConfig = exports.EndpointPricing = exports.EndpointModel = exports.EndpointProvider = exports.ENDPOINT_SERVICE_NAME = exports.ENDPOINT_PACKAGE_NAME = void 0;
5
- exports.GetUsageByUserResponse = exports.GetUsageByUserRequest = exports.GetUsageByKeyResponse = exports.GetUsageByKeyRequest = exports.GetUsageStatsResponse = exports.GetUsageStatsRequest = exports.RecordUsageResponse = exports.RecordUsageRequest = exports.GetTransactionResponse = exports.GetTransactionRequest = exports.GetTransactionsResponse = exports.GetTransactionsRequest = exports.CreateTransactionResponse = exports.CreateTransactionRequest = exports.DepositResponse = exports.DepositRequest = exports.ChargeResponse = exports.ChargeRequest = exports.GetBalanceResponse = exports.GetBalanceRequest = exports.Payment = exports.UsageStats = exports.Usage = exports.Transaction = exports.Balance = exports.BillingProtobufPackage = exports.ResponseService = exports.StreamUpdate = exports.StreamUpdatesRequest = exports.ProcessResponseResponse = exports.ProcessResponseRequest = exports.ResponseProtobufPackage = exports.RequestService = exports.StreamChunk = exports.RequestLog = exports.StreamRequestRequest = exports.CancelRequestResponse = exports.CancelRequestRequest = exports.RequestResultResponse = exports.GetRequestResultRequest = exports.RequestStatusResponse = exports.GetRequestStatusRequest = exports.CreateRequestResponse = exports.CreateRequestRequest = exports.RequestProtobufPackage = exports.KeyService = exports.GetSystemKeyRequest = exports.ValidateKeyResponse = exports.ValidateKeyRequest = exports.GetKeysByUserRequest = void 0;
6
- exports.LibraryProtobufPackage = exports.McpService = exports.McpServersResponse = exports.SetToolCustomizationRequest = exports.SetServerCustomizationRequest = exports.DeleteMcpServerRequest = exports.ListMcpServersRequest = exports.GetMcpServerRequest = exports.UpdateMcpServerRequest = exports.CreateMcpServerRequest = exports.McpOAuthSession = exports.McpToolCustomization = exports.McpServerCustomization = exports.McpServer = exports.McpProtobufPackage = exports.WorkflowService = exports.WorkflowsResponse = exports.DeleteEdgeRequest = exports.CreateEdgeRequest = exports.DeleteNodeRequest = exports.UpdateNodeRequest = exports.CreateNodeRequest = exports.DeleteWorkflowRequest = exports.ListWorkflowsRequest = exports.GetWorkflowRequest = exports.UpdateWorkflowRequest = exports.CreateWorkflowRequest = exports.FullWorkflow = exports.WorkflowEdge = exports.WorkflowNode = exports.Workflow = exports.WorkflowProtobufPackage = exports.AgentService = exports.AgentsResponse = exports.DeleteAgentRequest = exports.ListAgentsRequest = exports.GetAgentRequest = exports.UpdateAgentRequest = exports.CreateAgentRequest = exports.Agent = exports.AgentProtobufPackage = exports.BillingService = exports.ProcessWebhookResponse = exports.ProcessWebhookRequest = exports.GetPaymentsByUserResponse = exports.GetPaymentsByUserRequest = exports.GetPaymentResponse = exports.GetPaymentRequest = exports.CreatePaymentResponse = exports.CreatePaymentRequest = void 0;
7
- exports.ChatService = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = exports.CreateChatRequest = exports.ChatMessage = exports.Chat = exports.ChatProtobufPackage = exports.LibraryService = exports.ArchiveItemsResponse = exports.ListArchiveItemsRequest = exports.ArchivesResponse = exports.BookmarksResponse = exports.RemoveItemFromArchiveRequest = exports.AddItemToArchiveRequest = exports.ListArchivesRequest = exports.DeleteArchiveRequest = exports.UpdateArchiveRequest = exports.CreateArchiveRequest = exports.ListBookmarksRequest = exports.DeleteBookmarkRequest = exports.CreateBookmarkRequest = exports.ArchiveItem = exports.Archive = exports.Bookmark = void 0;
3
+ exports.VerifyResetCodeRequest = exports.ResendConfirmationCodeRequest = exports.CheckEmailVerifiedResponse = exports.CheckEmailVerifiedRequest = exports.ConfirmEmailResponse = exports.ConfirmEmailByCodeRequest = exports.ConfirmEmailRequest = exports.ResetPasswordRequest = exports.RecoverRequest = exports.RefreshTokenResponse = exports.AuthResponse = exports.RefreshRequest = exports.LogoutRequest = exports.RegisterCredentials = exports.LoginCredentials = exports.AuthProtobufPackage = exports.UserService = exports.EmailVerificationStatusResponse = exports.GetEmailVerificationStatusRequest = exports.ResetPasswordData = exports.UpdateEmailVerificationRequest = exports.UpdatePasswordRequest = exports.UpdateUserPersonal = exports.FindByPhoneRequest = exports.FindByEmailRequest = exports.UsersResponse = exports.UserResponse = exports.FindOneRequest = exports.UpdateUserRequest = exports.CreateUserPersonal = exports.CreateUserRequest = exports.User = exports.UserProtobufPackage = exports.GenerationRuntimeClient = exports.ChatClient = exports.LibraryClient = exports.WorkflowClient = exports.MCPClient = exports.AgentClient = exports.BillingClient = exports.ResponseClient = exports.RequestClient = exports.KeyClient = exports.EventClient = exports.StorageClient = exports.OpenAIClient = exports.EndpointClient = exports.AuthClient = exports.UsersClient = exports.SharedModule = void 0;
4
+ exports.KeyResponse = exports.GetKeyByIdRequest = exports.RemoveKeyRequest = exports.UpdateKeyRequest = exports.CreateKeyRequest = exports.Key = exports.KeysProtobufPackage = exports.EventService = exports.EventMessage = exports.SubscribeRequest = exports.EventProtobufPackage = exports.FileProtobufPackage = exports.StorageService = exports.DeleteResponse = exports.DeleteRequest = exports.DownloadResponse = exports.DownloadRequest = exports.UploadResponse = exports.UploadRequest = exports.OpenAIService = exports.OpenAICreateResponse = exports.OpenAICreateRequest = exports.OpenAIProtobufPackage = exports.EndpointService = exports.DeleteEndpointResponse = exports.ListEndpointsResponse = exports.GetEndpointByIdResponse = exports.UpdateEndpointResponse = exports.CreateEndpointResponse = exports.DeleteEndpointRequest = exports.ListEndpointsRequest = exports.GetEndpointByIdRequest = exports.UpdateEndpointRequest = exports.CreateEndpointRequest = exports.ValidateEndpointResponse = exports.ValidateEndpointRequest = exports.PricingResponse = exports.PricingRequest = exports.ModelsResponse = exports.ModelsRequest = exports.ProvidersResponse = exports.ProvidersRequest = exports.EndpointRequest = exports.EndpointConfig = exports.EndpointPricing = exports.EndpointModel = exports.EndpointProvider = exports.ENDPOINT_SERVICE_NAME = exports.ENDPOINT_PACKAGE_NAME = exports.EndpointProtobufPackage = void 0;
5
+ exports.GetUsageByUserRequest = exports.GetUsageByKeyResponse = exports.GetUsageByKeyRequest = exports.GetUsageStatsResponse = exports.GetUsageStatsRequest = exports.RecordUsageResponse = exports.RecordUsageRequest = exports.GetTransactionResponse = exports.GetTransactionRequest = exports.GetTransactionsResponse = exports.GetTransactionsRequest = exports.CreateTransactionResponse = exports.CreateTransactionRequest = exports.DepositResponse = exports.DepositRequest = exports.ChargeResponse = exports.ChargeRequest = exports.GetBalanceResponse = exports.GetBalanceRequest = exports.Payment = exports.UsageStats = exports.Usage = exports.Transaction = exports.Balance = exports.BillingProtobufPackage = exports.ResponseService = exports.StreamUpdate = exports.StreamUpdatesRequest = exports.ProcessResponseResponse = exports.ProcessResponseRequest = exports.ResponseProtobufPackage = exports.RequestService = exports.StreamChunk = exports.RequestLog = exports.StreamRequestRequest = exports.CancelRequestResponse = exports.CancelRequestRequest = exports.RequestResultResponse = exports.GetRequestResultRequest = exports.RequestStatusResponse = exports.GetRequestStatusRequest = exports.CreateRequestResponse = exports.CreateRequestRequest = exports.RequestProtobufPackage = exports.KeyService = exports.GetSystemKeyRequest = exports.ValidateKeyResponse = exports.ValidateKeyRequest = exports.GetKeysByUserRequest = exports.KeysResponse = void 0;
6
+ exports.McpService = exports.McpServersResponse = exports.SetToolCustomizationRequest = exports.SetServerCustomizationRequest = exports.DeleteMcpServerRequest = exports.ListMcpServersRequest = exports.GetMcpServerRequest = exports.UpdateMcpServerRequest = exports.CreateMcpServerRequest = exports.McpOAuthSession = exports.McpToolCustomization = exports.McpServerCustomization = exports.McpServer = exports.McpProtobufPackage = exports.WorkflowService = exports.WorkflowsResponse = exports.DeleteEdgeRequest = exports.CreateEdgeRequest = exports.DeleteNodeRequest = exports.UpdateNodeRequest = exports.CreateNodeRequest = exports.DeleteWorkflowRequest = exports.ListWorkflowsRequest = exports.GetWorkflowRequest = exports.UpdateWorkflowRequest = exports.CreateWorkflowRequest = exports.FullWorkflow = exports.WorkflowEdge = exports.WorkflowNode = exports.Workflow = exports.WorkflowProtobufPackage = exports.AgentService = exports.AgentsResponse = exports.DeleteAgentRequest = exports.ListAgentsRequest = exports.GetAgentRequest = exports.UpdateAgentRequest = exports.CreateAgentRequest = exports.Agent = exports.AgentProtobufPackage = exports.BillingService = exports.ProcessWebhookResponse = exports.ProcessWebhookRequest = exports.GetPaymentsByUserResponse = exports.GetPaymentsByUserRequest = exports.GetPaymentResponse = exports.GetPaymentRequest = exports.CreatePaymentResponse = exports.CreatePaymentRequest = exports.GetUsageByUserResponse = void 0;
7
+ exports.GenerationRuntimeService = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GenerationRuntimeProtobufPackage = exports.ChatService = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = exports.CreateChatRequest = exports.ChatMessage = exports.Chat = exports.ChatProtobufPackage = exports.LibraryService = exports.ArchiveItemsResponse = exports.ListArchiveItemsRequest = exports.ArchivesResponse = exports.BookmarksResponse = exports.RemoveItemFromArchiveRequest = exports.AddItemToArchiveRequest = exports.ListArchivesRequest = exports.DeleteArchiveRequest = exports.UpdateArchiveRequest = exports.CreateArchiveRequest = exports.ListBookmarksRequest = exports.DeleteBookmarkRequest = exports.CreateBookmarkRequest = exports.ArchiveItem = exports.Archive = exports.Bookmark = exports.LibraryProtobufPackage = void 0;
8
8
  var shared_module_1 = require("./shared.module");
9
9
  Object.defineProperty(exports, "SharedModule", { enumerable: true, get: function () { return shared_module_1.SharedModule; } });
10
10
  var user_client_1 = require("./user.client");
@@ -37,6 +37,8 @@ var library_client_1 = require("./library.client");
37
37
  Object.defineProperty(exports, "LibraryClient", { enumerable: true, get: function () { return library_client_1.LibraryClient; } });
38
38
  var chat_client_1 = require("./chat.client");
39
39
  Object.defineProperty(exports, "ChatClient", { enumerable: true, get: function () { return chat_client_1.ChatClient; } });
40
+ var generation_runtime_client_1 = require("./generation_runtime.client");
41
+ Object.defineProperty(exports, "GenerationRuntimeClient", { enumerable: true, get: function () { return generation_runtime_client_1.GenerationRuntimeClient; } });
40
42
  // ============================
41
43
  // User exports
42
44
  // ============================
@@ -311,3 +313,13 @@ Object.defineProperty(exports, "GetMessagesRequest", { enumerable: true, get: fu
311
313
  Object.defineProperty(exports, "ChatsResponse", { enumerable: true, get: function () { return chat_interface_1.ChatsResponse; } });
312
314
  Object.defineProperty(exports, "MessagesResponse", { enumerable: true, get: function () { return chat_interface_1.MessagesResponse; } });
313
315
  Object.defineProperty(exports, "ChatService", { enumerable: true, get: function () { return chat_interface_1.ChatServiceService; } });
316
+ // ============================
317
+ // Generation Runtime exports
318
+ // ============================
319
+ var generation_runtime_interface_1 = require("./generation_runtime.interface");
320
+ Object.defineProperty(exports, "GenerationRuntimeProtobufPackage", { enumerable: true, get: function () { return generation_runtime_interface_1.protobufPackage; } });
321
+ Object.defineProperty(exports, "StartChatRunRequest", { enumerable: true, get: function () { return generation_runtime_interface_1.StartChatRunRequest; } });
322
+ Object.defineProperty(exports, "StartChatRunResponse", { enumerable: true, get: function () { return generation_runtime_interface_1.StartChatRunResponse; } });
323
+ Object.defineProperty(exports, "SubmitToolResultRequest", { enumerable: true, get: function () { return generation_runtime_interface_1.SubmitToolResultRequest; } });
324
+ Object.defineProperty(exports, "CancelRunRequest", { enumerable: true, get: function () { return generation_runtime_interface_1.CancelRunRequest; } });
325
+ Object.defineProperty(exports, "GenerationRuntimeService", { enumerable: true, get: function () { return generation_runtime_interface_1.GenerationRuntimeServiceService; } });
@@ -64,6 +64,10 @@ export interface SharedModuleOptions {
64
64
  protoPath: string;
65
65
  url: string;
66
66
  };
67
+ generationRuntime?: {
68
+ protoPath: string;
69
+ url: string;
70
+ };
67
71
  }
68
72
  export declare class SharedModule {
69
73
  private static readonly logger;
@@ -26,6 +26,7 @@ const mcp_client_1 = require("./mcp.client");
26
26
  const library_client_1 = require("./library.client");
27
27
  const workflow_client_1 = require("./workflow.client");
28
28
  const chat_client_1 = require("./chat.client");
29
+ const generation_runtime_client_1 = require("./generation_runtime.client");
29
30
  let SharedModule = SharedModule_1 = class SharedModule {
30
31
  static forRoot(options = {}) {
31
32
  const clients = [];
@@ -480,6 +481,36 @@ let SharedModule = SharedModule_1 = class SharedModule {
480
481
  else {
481
482
  providers.push({ provide: chat_client_1.ChatClient, useValue: null });
482
483
  }
484
+ // GENERATION_RUNTIME
485
+ if (options.generationRuntime) {
486
+ clients.push({
487
+ name: "GENERATION_RUNTIME_PACKAGE",
488
+ transport: microservices_1.Transport.GRPC,
489
+ options: {
490
+ package: "chat",
491
+ protoPath: (0, path_1.resolve)(process.cwd(), options.generationRuntime.protoPath),
492
+ url: options.generationRuntime.url,
493
+ },
494
+ });
495
+ providers.push({
496
+ provide: generation_runtime_client_1.GenerationRuntimeClient,
497
+ useFactory: (client) => {
498
+ const svc = new generation_runtime_client_1.GenerationRuntimeClient(client);
499
+ try {
500
+ svc.onModuleInit();
501
+ SharedModule_1.logger.log("GenerationRuntimeClient initialized successfully");
502
+ }
503
+ catch (err) {
504
+ SharedModule_1.logger.error("GenerationRuntimeClient initialization failed", err);
505
+ }
506
+ return svc;
507
+ },
508
+ inject: ["GENERATION_RUNTIME_PACKAGE"],
509
+ });
510
+ }
511
+ else {
512
+ providers.push({ provide: generation_runtime_client_1.GenerationRuntimeClient, useValue: null });
513
+ }
483
514
  return {
484
515
  module: SharedModule_1,
485
516
  imports: clients.length ? [microservices_1.ClientsModule.register(clients)] : [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geniebox-shared-lib",
3
- "version": "2.4.7",
3
+ "version": "2.5.0",
4
4
  "description": "Shared NestJS library with gRPC clients",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",