geniebox-shared-lib 2.5.8 → 2.5.10

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.
@@ -25,20 +25,83 @@ export interface SubmitToolResultRequest {
25
25
  export interface CancelRunRequest {
26
26
  runId: string;
27
27
  }
28
+ /** Workflow LLM Node Execution */
29
+ export interface WorkflowLLMNodeRequest {
30
+ userId: string;
31
+ modelProvider: string;
32
+ modelName: string;
33
+ /** JSON array of UIMessage */
34
+ messagesJson: string;
35
+ /** Optional JSONSchema */
36
+ outputSchemaJson: string;
37
+ /** "text" or "object" */
38
+ responseFormat: string;
39
+ }
40
+ export interface WorkflowLLMNodeResponse {
41
+ /** For text format */
42
+ text: string;
43
+ /** For object format */
44
+ objectJson: string;
45
+ totalTokens: number;
46
+ error: string;
47
+ }
48
+ /** Agent Generation */
49
+ export interface AgentGenerateRequest {
50
+ userId: string;
51
+ modelProvider: string;
52
+ modelName: string;
53
+ system: string;
54
+ prompt: string;
55
+ /** JSONSchema */
56
+ schemaJson: string;
57
+ }
58
+ export interface AgentGenerateResponse {
59
+ /** For streaming via SSE */
60
+ requestId: string;
61
+ status: string;
62
+ }
63
+ /** MCP Tool Schema Example */
64
+ export interface MCPToolSchemaRequest {
65
+ userId: string;
66
+ modelProvider: string;
67
+ modelName: string;
68
+ /** MCPToolInfo */
69
+ toolInfoJson: string;
70
+ /** Optional */
71
+ prompt: string;
72
+ }
73
+ export interface MCPToolSchemaResponse {
74
+ objectJson: string;
75
+ error: string;
76
+ }
28
77
  export declare const GENERATION_PACKAGE_NAME = "generation";
29
78
  export declare const StartChatRunRequest: MessageFns<StartChatRunRequest>;
30
79
  export declare const StartChatRunResponse: MessageFns<StartChatRunResponse>;
31
80
  export declare const SubmitToolResultRequest: MessageFns<SubmitToolResultRequest>;
32
81
  export declare const CancelRunRequest: MessageFns<CancelRunRequest>;
82
+ export declare const WorkflowLLMNodeRequest: MessageFns<WorkflowLLMNodeRequest>;
83
+ export declare const WorkflowLLMNodeResponse: MessageFns<WorkflowLLMNodeResponse>;
84
+ export declare const AgentGenerateRequest: MessageFns<AgentGenerateRequest>;
85
+ export declare const AgentGenerateResponse: MessageFns<AgentGenerateResponse>;
86
+ export declare const MCPToolSchemaRequest: MessageFns<MCPToolSchemaRequest>;
87
+ export declare const MCPToolSchemaResponse: MessageFns<MCPToolSchemaResponse>;
33
88
  export interface GenerationServiceClient {
34
89
  startChatRun(request: StartChatRunRequest, metadata?: Metadata): Observable<StartChatRunResponse>;
35
90
  submitToolResult(request: SubmitToolResultRequest, metadata?: Metadata): Observable<Empty>;
36
91
  cancelRun(request: CancelRunRequest, metadata?: Metadata): Observable<Empty>;
92
+ /** New methods for workflow, agent, and MCP */
93
+ executeWorkflowLlmNode(request: WorkflowLLMNodeRequest, metadata?: Metadata): Observable<WorkflowLLMNodeResponse>;
94
+ generateAgent(request: AgentGenerateRequest, metadata?: Metadata): Observable<AgentGenerateResponse>;
95
+ generateMcpToolSchema(request: MCPToolSchemaRequest, metadata?: Metadata): Observable<MCPToolSchemaResponse>;
37
96
  }
38
97
  export interface GenerationServiceController {
39
98
  startChatRun(request: StartChatRunRequest, metadata?: Metadata): Promise<StartChatRunResponse> | Observable<StartChatRunResponse> | StartChatRunResponse;
40
99
  submitToolResult(request: SubmitToolResultRequest, metadata?: Metadata): void;
41
100
  cancelRun(request: CancelRunRequest, metadata?: Metadata): void;
101
+ /** New methods for workflow, agent, and MCP */
102
+ executeWorkflowLlmNode(request: WorkflowLLMNodeRequest, metadata?: Metadata): Promise<WorkflowLLMNodeResponse> | Observable<WorkflowLLMNodeResponse> | WorkflowLLMNodeResponse;
103
+ generateAgent(request: AgentGenerateRequest, metadata?: Metadata): Promise<AgentGenerateResponse> | Observable<AgentGenerateResponse> | AgentGenerateResponse;
104
+ generateMcpToolSchema(request: MCPToolSchemaRequest, metadata?: Metadata): Promise<MCPToolSchemaResponse> | Observable<MCPToolSchemaResponse> | MCPToolSchemaResponse;
42
105
  }
43
106
  export declare function GenerationServiceControllerMethods(): (constructor: Function) => void;
44
107
  export declare const GENERATION_SERVICE_NAME = "GenerationService";
@@ -71,11 +134,43 @@ export declare const GenerationServiceService: {
71
134
  readonly responseSerialize: (value: Empty) => Buffer;
72
135
  readonly responseDeserialize: (value: Buffer) => Empty;
73
136
  };
137
+ /** New methods for workflow, agent, and MCP */
138
+ readonly executeWorkflowLlmNode: {
139
+ readonly path: "/generation.GenerationService/ExecuteWorkflowLLMNode";
140
+ readonly requestStream: false;
141
+ readonly responseStream: false;
142
+ readonly requestSerialize: (value: WorkflowLLMNodeRequest) => Buffer;
143
+ readonly requestDeserialize: (value: Buffer) => WorkflowLLMNodeRequest;
144
+ readonly responseSerialize: (value: WorkflowLLMNodeResponse) => Buffer;
145
+ readonly responseDeserialize: (value: Buffer) => WorkflowLLMNodeResponse;
146
+ };
147
+ readonly generateAgent: {
148
+ readonly path: "/generation.GenerationService/GenerateAgent";
149
+ readonly requestStream: false;
150
+ readonly responseStream: false;
151
+ readonly requestSerialize: (value: AgentGenerateRequest) => Buffer;
152
+ readonly requestDeserialize: (value: Buffer) => AgentGenerateRequest;
153
+ readonly responseSerialize: (value: AgentGenerateResponse) => Buffer;
154
+ readonly responseDeserialize: (value: Buffer) => AgentGenerateResponse;
155
+ };
156
+ readonly generateMcpToolSchema: {
157
+ readonly path: "/generation.GenerationService/GenerateMCPToolSchema";
158
+ readonly requestStream: false;
159
+ readonly responseStream: false;
160
+ readonly requestSerialize: (value: MCPToolSchemaRequest) => Buffer;
161
+ readonly requestDeserialize: (value: Buffer) => MCPToolSchemaRequest;
162
+ readonly responseSerialize: (value: MCPToolSchemaResponse) => Buffer;
163
+ readonly responseDeserialize: (value: Buffer) => MCPToolSchemaResponse;
164
+ };
74
165
  };
75
166
  export interface GenerationServiceServer extends UntypedServiceImplementation {
76
167
  startChatRun: handleUnaryCall<StartChatRunRequest, StartChatRunResponse>;
77
168
  submitToolResult: handleUnaryCall<SubmitToolResultRequest, Empty>;
78
169
  cancelRun: handleUnaryCall<CancelRunRequest, Empty>;
170
+ /** New methods for workflow, agent, and MCP */
171
+ executeWorkflowLlmNode: handleUnaryCall<WorkflowLLMNodeRequest, WorkflowLLMNodeResponse>;
172
+ generateAgent: handleUnaryCall<AgentGenerateRequest, AgentGenerateResponse>;
173
+ generateMcpToolSchema: handleUnaryCall<MCPToolSchemaRequest, MCPToolSchemaResponse>;
79
174
  }
80
175
  export interface MessageFns<T> {
81
176
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
@@ -5,7 +5,7 @@
5
5
  // protoc v5.28.2
6
6
  // source: generation.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.GenerationServiceService = exports.GENERATION_SERVICE_NAME = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GENERATION_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.GenerationServiceService = exports.GENERATION_SERVICE_NAME = exports.MCPToolSchemaResponse = exports.MCPToolSchemaRequest = exports.AgentGenerateResponse = exports.AgentGenerateRequest = exports.WorkflowLLMNodeResponse = exports.WorkflowLLMNodeRequest = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GENERATION_PACKAGE_NAME = exports.protobufPackage = void 0;
9
9
  exports.GenerationServiceControllerMethods = GenerationServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const wire_1 = require("@bufbuild/protobuf/wire");
@@ -207,10 +207,405 @@ exports.CancelRunRequest = {
207
207
  return message;
208
208
  },
209
209
  };
210
+ function createBaseWorkflowLLMNodeRequest() {
211
+ return { userId: "", modelProvider: "", modelName: "", messagesJson: "", outputSchemaJson: "", responseFormat: "" };
212
+ }
213
+ exports.WorkflowLLMNodeRequest = {
214
+ encode(message, writer = new wire_1.BinaryWriter()) {
215
+ if (message.userId !== "") {
216
+ writer.uint32(10).string(message.userId);
217
+ }
218
+ if (message.modelProvider !== "") {
219
+ writer.uint32(18).string(message.modelProvider);
220
+ }
221
+ if (message.modelName !== "") {
222
+ writer.uint32(26).string(message.modelName);
223
+ }
224
+ if (message.messagesJson !== "") {
225
+ writer.uint32(34).string(message.messagesJson);
226
+ }
227
+ if (message.outputSchemaJson !== "") {
228
+ writer.uint32(42).string(message.outputSchemaJson);
229
+ }
230
+ if (message.responseFormat !== "") {
231
+ writer.uint32(50).string(message.responseFormat);
232
+ }
233
+ return writer;
234
+ },
235
+ decode(input, length) {
236
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
237
+ const end = length === undefined ? reader.len : reader.pos + length;
238
+ const message = createBaseWorkflowLLMNodeRequest();
239
+ while (reader.pos < end) {
240
+ const tag = reader.uint32();
241
+ switch (tag >>> 3) {
242
+ case 1: {
243
+ if (tag !== 10) {
244
+ break;
245
+ }
246
+ message.userId = reader.string();
247
+ continue;
248
+ }
249
+ case 2: {
250
+ if (tag !== 18) {
251
+ break;
252
+ }
253
+ message.modelProvider = reader.string();
254
+ continue;
255
+ }
256
+ case 3: {
257
+ if (tag !== 26) {
258
+ break;
259
+ }
260
+ message.modelName = reader.string();
261
+ continue;
262
+ }
263
+ case 4: {
264
+ if (tag !== 34) {
265
+ break;
266
+ }
267
+ message.messagesJson = reader.string();
268
+ continue;
269
+ }
270
+ case 5: {
271
+ if (tag !== 42) {
272
+ break;
273
+ }
274
+ message.outputSchemaJson = reader.string();
275
+ continue;
276
+ }
277
+ case 6: {
278
+ if (tag !== 50) {
279
+ break;
280
+ }
281
+ message.responseFormat = reader.string();
282
+ continue;
283
+ }
284
+ }
285
+ if ((tag & 7) === 4 || tag === 0) {
286
+ break;
287
+ }
288
+ reader.skip(tag & 7);
289
+ }
290
+ return message;
291
+ },
292
+ };
293
+ function createBaseWorkflowLLMNodeResponse() {
294
+ return { text: "", objectJson: "", totalTokens: 0, error: "" };
295
+ }
296
+ exports.WorkflowLLMNodeResponse = {
297
+ encode(message, writer = new wire_1.BinaryWriter()) {
298
+ if (message.text !== "") {
299
+ writer.uint32(10).string(message.text);
300
+ }
301
+ if (message.objectJson !== "") {
302
+ writer.uint32(18).string(message.objectJson);
303
+ }
304
+ if (message.totalTokens !== 0) {
305
+ writer.uint32(24).int32(message.totalTokens);
306
+ }
307
+ if (message.error !== "") {
308
+ writer.uint32(34).string(message.error);
309
+ }
310
+ return writer;
311
+ },
312
+ decode(input, length) {
313
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
314
+ const end = length === undefined ? reader.len : reader.pos + length;
315
+ const message = createBaseWorkflowLLMNodeResponse();
316
+ while (reader.pos < end) {
317
+ const tag = reader.uint32();
318
+ switch (tag >>> 3) {
319
+ case 1: {
320
+ if (tag !== 10) {
321
+ break;
322
+ }
323
+ message.text = reader.string();
324
+ continue;
325
+ }
326
+ case 2: {
327
+ if (tag !== 18) {
328
+ break;
329
+ }
330
+ message.objectJson = reader.string();
331
+ continue;
332
+ }
333
+ case 3: {
334
+ if (tag !== 24) {
335
+ break;
336
+ }
337
+ message.totalTokens = reader.int32();
338
+ continue;
339
+ }
340
+ case 4: {
341
+ if (tag !== 34) {
342
+ break;
343
+ }
344
+ message.error = reader.string();
345
+ continue;
346
+ }
347
+ }
348
+ if ((tag & 7) === 4 || tag === 0) {
349
+ break;
350
+ }
351
+ reader.skip(tag & 7);
352
+ }
353
+ return message;
354
+ },
355
+ };
356
+ function createBaseAgentGenerateRequest() {
357
+ return { userId: "", modelProvider: "", modelName: "", system: "", prompt: "", schemaJson: "" };
358
+ }
359
+ exports.AgentGenerateRequest = {
360
+ encode(message, writer = new wire_1.BinaryWriter()) {
361
+ if (message.userId !== "") {
362
+ writer.uint32(10).string(message.userId);
363
+ }
364
+ if (message.modelProvider !== "") {
365
+ writer.uint32(18).string(message.modelProvider);
366
+ }
367
+ if (message.modelName !== "") {
368
+ writer.uint32(26).string(message.modelName);
369
+ }
370
+ if (message.system !== "") {
371
+ writer.uint32(34).string(message.system);
372
+ }
373
+ if (message.prompt !== "") {
374
+ writer.uint32(42).string(message.prompt);
375
+ }
376
+ if (message.schemaJson !== "") {
377
+ writer.uint32(50).string(message.schemaJson);
378
+ }
379
+ return writer;
380
+ },
381
+ decode(input, length) {
382
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
383
+ const end = length === undefined ? reader.len : reader.pos + length;
384
+ const message = createBaseAgentGenerateRequest();
385
+ while (reader.pos < end) {
386
+ const tag = reader.uint32();
387
+ switch (tag >>> 3) {
388
+ case 1: {
389
+ if (tag !== 10) {
390
+ break;
391
+ }
392
+ message.userId = reader.string();
393
+ continue;
394
+ }
395
+ case 2: {
396
+ if (tag !== 18) {
397
+ break;
398
+ }
399
+ message.modelProvider = reader.string();
400
+ continue;
401
+ }
402
+ case 3: {
403
+ if (tag !== 26) {
404
+ break;
405
+ }
406
+ message.modelName = reader.string();
407
+ continue;
408
+ }
409
+ case 4: {
410
+ if (tag !== 34) {
411
+ break;
412
+ }
413
+ message.system = reader.string();
414
+ continue;
415
+ }
416
+ case 5: {
417
+ if (tag !== 42) {
418
+ break;
419
+ }
420
+ message.prompt = reader.string();
421
+ continue;
422
+ }
423
+ case 6: {
424
+ if (tag !== 50) {
425
+ break;
426
+ }
427
+ message.schemaJson = reader.string();
428
+ continue;
429
+ }
430
+ }
431
+ if ((tag & 7) === 4 || tag === 0) {
432
+ break;
433
+ }
434
+ reader.skip(tag & 7);
435
+ }
436
+ return message;
437
+ },
438
+ };
439
+ function createBaseAgentGenerateResponse() {
440
+ return { requestId: "", status: "" };
441
+ }
442
+ exports.AgentGenerateResponse = {
443
+ encode(message, writer = new wire_1.BinaryWriter()) {
444
+ if (message.requestId !== "") {
445
+ writer.uint32(10).string(message.requestId);
446
+ }
447
+ if (message.status !== "") {
448
+ writer.uint32(18).string(message.status);
449
+ }
450
+ return writer;
451
+ },
452
+ decode(input, length) {
453
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
454
+ const end = length === undefined ? reader.len : reader.pos + length;
455
+ const message = createBaseAgentGenerateResponse();
456
+ while (reader.pos < end) {
457
+ const tag = reader.uint32();
458
+ switch (tag >>> 3) {
459
+ case 1: {
460
+ if (tag !== 10) {
461
+ break;
462
+ }
463
+ message.requestId = reader.string();
464
+ continue;
465
+ }
466
+ case 2: {
467
+ if (tag !== 18) {
468
+ break;
469
+ }
470
+ message.status = reader.string();
471
+ continue;
472
+ }
473
+ }
474
+ if ((tag & 7) === 4 || tag === 0) {
475
+ break;
476
+ }
477
+ reader.skip(tag & 7);
478
+ }
479
+ return message;
480
+ },
481
+ };
482
+ function createBaseMCPToolSchemaRequest() {
483
+ return { userId: "", modelProvider: "", modelName: "", toolInfoJson: "", prompt: "" };
484
+ }
485
+ exports.MCPToolSchemaRequest = {
486
+ encode(message, writer = new wire_1.BinaryWriter()) {
487
+ if (message.userId !== "") {
488
+ writer.uint32(10).string(message.userId);
489
+ }
490
+ if (message.modelProvider !== "") {
491
+ writer.uint32(18).string(message.modelProvider);
492
+ }
493
+ if (message.modelName !== "") {
494
+ writer.uint32(26).string(message.modelName);
495
+ }
496
+ if (message.toolInfoJson !== "") {
497
+ writer.uint32(34).string(message.toolInfoJson);
498
+ }
499
+ if (message.prompt !== "") {
500
+ writer.uint32(42).string(message.prompt);
501
+ }
502
+ return writer;
503
+ },
504
+ decode(input, length) {
505
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
506
+ const end = length === undefined ? reader.len : reader.pos + length;
507
+ const message = createBaseMCPToolSchemaRequest();
508
+ while (reader.pos < end) {
509
+ const tag = reader.uint32();
510
+ switch (tag >>> 3) {
511
+ case 1: {
512
+ if (tag !== 10) {
513
+ break;
514
+ }
515
+ message.userId = reader.string();
516
+ continue;
517
+ }
518
+ case 2: {
519
+ if (tag !== 18) {
520
+ break;
521
+ }
522
+ message.modelProvider = reader.string();
523
+ continue;
524
+ }
525
+ case 3: {
526
+ if (tag !== 26) {
527
+ break;
528
+ }
529
+ message.modelName = reader.string();
530
+ continue;
531
+ }
532
+ case 4: {
533
+ if (tag !== 34) {
534
+ break;
535
+ }
536
+ message.toolInfoJson = reader.string();
537
+ continue;
538
+ }
539
+ case 5: {
540
+ if (tag !== 42) {
541
+ break;
542
+ }
543
+ message.prompt = reader.string();
544
+ continue;
545
+ }
546
+ }
547
+ if ((tag & 7) === 4 || tag === 0) {
548
+ break;
549
+ }
550
+ reader.skip(tag & 7);
551
+ }
552
+ return message;
553
+ },
554
+ };
555
+ function createBaseMCPToolSchemaResponse() {
556
+ return { objectJson: "", error: "" };
557
+ }
558
+ exports.MCPToolSchemaResponse = {
559
+ encode(message, writer = new wire_1.BinaryWriter()) {
560
+ if (message.objectJson !== "") {
561
+ writer.uint32(10).string(message.objectJson);
562
+ }
563
+ if (message.error !== "") {
564
+ writer.uint32(18).string(message.error);
565
+ }
566
+ return writer;
567
+ },
568
+ decode(input, length) {
569
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
570
+ const end = length === undefined ? reader.len : reader.pos + length;
571
+ const message = createBaseMCPToolSchemaResponse();
572
+ while (reader.pos < end) {
573
+ const tag = reader.uint32();
574
+ switch (tag >>> 3) {
575
+ case 1: {
576
+ if (tag !== 10) {
577
+ break;
578
+ }
579
+ message.objectJson = reader.string();
580
+ continue;
581
+ }
582
+ case 2: {
583
+ if (tag !== 18) {
584
+ break;
585
+ }
586
+ message.error = reader.string();
587
+ continue;
588
+ }
589
+ }
590
+ if ((tag & 7) === 4 || tag === 0) {
591
+ break;
592
+ }
593
+ reader.skip(tag & 7);
594
+ }
595
+ return message;
596
+ },
597
+ };
210
598
  protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_interface_1.Struct.wrap, toObject: struct_interface_1.Struct.unwrap };
211
599
  function GenerationServiceControllerMethods() {
212
600
  return function (constructor) {
213
- const grpcMethods = ["startChatRun", "submitToolResult", "cancelRun"];
601
+ const grpcMethods = [
602
+ "startChatRun",
603
+ "submitToolResult",
604
+ "cancelRun",
605
+ "executeWorkflowLlmNode",
606
+ "generateAgent",
607
+ "generateMcpToolSchema",
608
+ ];
214
609
  for (const method of grpcMethods) {
215
610
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
216
611
  (0, microservices_1.GrpcMethod)("GenerationService", method)(constructor.prototype[method], method, descriptor);
@@ -251,4 +646,32 @@ exports.GenerationServiceService = {
251
646
  responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
252
647
  responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
253
648
  },
649
+ /** New methods for workflow, agent, and MCP */
650
+ executeWorkflowLlmNode: {
651
+ path: "/generation.GenerationService/ExecuteWorkflowLLMNode",
652
+ requestStream: false,
653
+ responseStream: false,
654
+ requestSerialize: (value) => Buffer.from(exports.WorkflowLLMNodeRequest.encode(value).finish()),
655
+ requestDeserialize: (value) => exports.WorkflowLLMNodeRequest.decode(value),
656
+ responseSerialize: (value) => Buffer.from(exports.WorkflowLLMNodeResponse.encode(value).finish()),
657
+ responseDeserialize: (value) => exports.WorkflowLLMNodeResponse.decode(value),
658
+ },
659
+ generateAgent: {
660
+ path: "/generation.GenerationService/GenerateAgent",
661
+ requestStream: false,
662
+ responseStream: false,
663
+ requestSerialize: (value) => Buffer.from(exports.AgentGenerateRequest.encode(value).finish()),
664
+ requestDeserialize: (value) => exports.AgentGenerateRequest.decode(value),
665
+ responseSerialize: (value) => Buffer.from(exports.AgentGenerateResponse.encode(value).finish()),
666
+ responseDeserialize: (value) => exports.AgentGenerateResponse.decode(value),
667
+ },
668
+ generateMcpToolSchema: {
669
+ path: "/generation.GenerationService/GenerateMCPToolSchema",
670
+ requestStream: false,
671
+ responseStream: false,
672
+ requestSerialize: (value) => Buffer.from(exports.MCPToolSchemaRequest.encode(value).finish()),
673
+ requestDeserialize: (value) => exports.MCPToolSchemaRequest.decode(value),
674
+ responseSerialize: (value) => Buffer.from(exports.MCPToolSchemaResponse.encode(value).finish()),
675
+ responseDeserialize: (value) => exports.MCPToolSchemaResponse.decode(value),
676
+ },
254
677
  };
package/dist/index.d.ts CHANGED
@@ -23,11 +23,11 @@ export { UploadRequest, UploadResponse, DownloadRequest, DownloadResponse, Delet
23
23
  export { MessageFns as EventMessageFns, protobufPackage as EventProtobufPackage, SubscribeRequest, EventMessage, EmitToUserRequest, BroadcastRequest, EmitResponse, EventServiceService as EventService, } from "./event.interface";
24
24
  export { MessageFns as KeysMessageFns, protobufPackage as KeysProtobufPackage, Key, CreateKeyRequest, UpdateKeyRequest, RemoveKeyRequest, GetKeyByIdRequest, KeyResponse, KeysResponse, GetKeysByUserRequest, ValidateKeyRequest, ValidateKeyResponse, GetSystemKeyRequest, KeyServiceService as KeyService, } from "./key.interface";
25
25
  export { MessageFns as RequestMessageFns, protobufPackage as RequestProtobufPackage, CreateRequestRequest, CreateRequestResponse, GetRequestStatusRequest, RequestStatusResponse, GetRequestResultRequest, RequestResultResponse, CancelRequestRequest, CancelRequestResponse, StreamRequestRequest, RequestLog, StreamChunk, RequestServiceService as RequestService, } from "./request.interface";
26
- export { MessageFns as ResponseMessageFns, protobufPackage as ResponseProtobufPackage, ProcessResponseRequest, ProcessResponseResponse, StreamUpdatesRequest, StreamUpdate, ResponseServiceService as ResponseService, } from "./response.interface";
26
+ export { MessageFns as ResponseMessageFns, protobufPackage as ResponseProtobufPackage, ProcessResponseRequest, ProcessResponseResponse, StreamUpdatesRequest, StreamUpdate, ProviderUsage, ProviderChunk, ProviderError, ProviderResponse, ResponseServiceService as ResponseService, } from "./response.interface";
27
27
  export { MessageFns as BillingMessageFns, protobufPackage as BillingProtobufPackage, Balance, Transaction, Usage, UsageStats, Payment, GetBalanceRequest, GetBalanceResponse, ChargeRequest, ChargeResponse, DepositRequest, DepositResponse, CreateTransactionRequest, CreateTransactionResponse, GetTransactionsRequest, GetTransactionsResponse, GetTransactionRequest, GetTransactionResponse, RecordUsageRequest, RecordUsageResponse, GetUsageStatsRequest, GetUsageStatsResponse, GetUsageByKeyRequest, GetUsageByKeyResponse, GetUsageByUserRequest, GetUsageByUserResponse, CreatePaymentRequest, CreatePaymentResponse, GetPaymentRequest, GetPaymentResponse, GetPaymentsByUserRequest, GetPaymentsByUserResponse, ProcessWebhookRequest, ProcessWebhookResponse, BillingServiceService as BillingService, } from "./billing.interface";
28
28
  export { MessageFns as AgentMessageFns, protobufPackage as AgentProtobufPackage, Agent, CreateAgentRequest, UpdateAgentRequest, GetAgentRequest, ListAgentsRequest, DeleteAgentRequest, AgentsResponse, AgentServiceClient, AgentServiceController, AgentServiceService as AgentService, } from "./agent.interface";
29
29
  export { MessageFns as WorkflowMessageFns, protobufPackage as WorkflowProtobufPackage, Workflow, WorkflowNode, WorkflowEdge, FullWorkflow, CreateWorkflowRequest, UpdateWorkflowRequest, GetWorkflowRequest, ListWorkflowsRequest, DeleteWorkflowRequest, CreateNodeRequest, UpdateNodeRequest, DeleteNodeRequest, CreateEdgeRequest, DeleteEdgeRequest, WorkflowsResponse, WorkflowServiceClient, WorkflowServiceController, WorkflowServiceService as WorkflowService, } from "./workflow.interface";
30
30
  export { MessageFns as McpMessageFns, protobufPackage as McpProtobufPackage, McpServer, McpServerCustomization, McpToolCustomization, McpOAuthSession, CreateMcpServerRequest, UpdateMcpServerRequest, GetMcpServerRequest, ListMcpServersRequest, DeleteMcpServerRequest, SetServerCustomizationRequest, SetToolCustomizationRequest, ListServerCustomizationsRequest, ListToolCustomizationsRequest, McpServerCustomizationsResponse, McpToolCustomizationsResponse, McpServersResponse, McpServiceClient, McpServiceController, McpServiceService as McpService, } from "./mcp.interface";
31
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";
32
32
  export { MessageFns as ChatMessageFns, protobufPackage as ChatProtobufPackage, Chat, ChatMessage, CreateChatRequest, UpdateChatRequest, GetChatRequest, ListChatsRequest, DeleteChatRequest, AddMessageRequest, GetMessagesRequest, ChatsResponse, MessagesResponse, ChatServiceClient, ChatExportMessage, ChatExport, ChatExportSummary, ChatExportComment, ExportChatRequest, ExportChatResponse, GetChatExportRequest, GetChatExportCommentsRequest, DeleteChatExportRequest, ListChatExportsRequest, ChatExportsResponse, ChatExportCommentsResponse, AddChatExportCommentRequest, DeleteChatExportCommentRequest, ChatServiceController, ChatServiceService as ChatService, } from "./chat.interface";
33
- export { MessageFns as GenerationMessageFns, protobufPackage as GenerationProtobufPackage, StartChatRunRequest, StartChatRunResponse, SubmitToolResultRequest, CancelRunRequest, GenerationServiceClient, GenerationServiceController, GenerationServiceService as GenerationService, } from "./generation.interface";
33
+ export { MessageFns as GenerationMessageFns, protobufPackage as GenerationProtobufPackage, StartChatRunRequest, StartChatRunResponse, SubmitToolResultRequest, CancelRunRequest, WorkflowLLMNodeRequest, WorkflowLLMNodeResponse, AgentGenerateRequest, AgentGenerateResponse, MCPToolSchemaRequest, MCPToolSchemaResponse, GenerationServiceClient, GenerationServiceController, GenerationServiceService as GenerationService, } from "./generation.interface";
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AuthProtobufPackage = exports.UserService = exports.CreateOAuthIdentityRequest = exports.FindOAuthIdentityRequest = exports.UserOAuthIdentity = exports.UserSettingsResponse = exports.CreateUserSettingsRequest = exports.UpdateUserSettingsRequest = exports.GetUserSettingsRequest = 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.CreateUserAuthentication = exports.CreateUserPersonal = exports.CreateUserRequest = exports.UserAuthentication = exports.UserInAppNotifications = exports.UserPushNotifications = exports.UserEmailNotifications = exports.UserNotificationSettings = exports.UserSettings = exports.UserPersonal = exports.User = exports.UserProtobufPackage = exports.GenerationClient = 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
4
  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 = exports.LoginWithOAuthRequest = 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 = void 0;
5
- 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 = exports.KeyResponse = exports.GetKeyByIdRequest = exports.RemoveKeyRequest = exports.UpdateKeyRequest = exports.CreateKeyRequest = exports.Key = exports.KeysProtobufPackage = exports.EventService = exports.EmitResponse = exports.BroadcastRequest = exports.EmitToUserRequest = exports.EventMessage = exports.SubscribeRequest = exports.EventProtobufPackage = exports.FileProtobufPackage = exports.StorageService = exports.DeleteResponse = exports.DeleteRequest = exports.DownloadResponse = void 0;
6
- 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 = 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 = void 0;
7
- exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = exports.UpdateChatRequest = 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 = exports.McpService = exports.McpServersResponse = exports.McpToolCustomizationsResponse = exports.McpServerCustomizationsResponse = exports.ListToolCustomizationsRequest = exports.ListServerCustomizationsRequest = 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 = void 0;
8
- exports.GenerationService = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GenerationProtobufPackage = exports.ChatService = exports.DeleteChatExportCommentRequest = exports.AddChatExportCommentRequest = exports.ChatExportCommentsResponse = exports.ChatExportsResponse = exports.ListChatExportsRequest = exports.DeleteChatExportRequest = exports.GetChatExportCommentsRequest = exports.GetChatExportRequest = exports.ExportChatResponse = exports.ExportChatRequest = exports.ChatExportComment = exports.ChatExportSummary = exports.ChatExport = exports.ChatExportMessage = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = void 0;
5
+ exports.Balance = exports.BillingProtobufPackage = exports.ResponseService = exports.ProviderResponse = exports.ProviderError = exports.ProviderChunk = exports.ProviderUsage = 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 = exports.KeyResponse = exports.GetKeyByIdRequest = exports.RemoveKeyRequest = exports.UpdateKeyRequest = exports.CreateKeyRequest = exports.Key = exports.KeysProtobufPackage = exports.EventService = exports.EmitResponse = exports.BroadcastRequest = exports.EmitToUserRequest = exports.EventMessage = exports.SubscribeRequest = exports.EventProtobufPackage = exports.FileProtobufPackage = exports.StorageService = exports.DeleteResponse = exports.DeleteRequest = exports.DownloadResponse = void 0;
6
+ 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 = 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 = void 0;
7
+ exports.UpdateChatRequest = 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 = exports.McpService = exports.McpServersResponse = exports.McpToolCustomizationsResponse = exports.McpServerCustomizationsResponse = exports.ListToolCustomizationsRequest = exports.ListServerCustomizationsRequest = 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 = void 0;
8
+ exports.GenerationService = exports.MCPToolSchemaResponse = exports.MCPToolSchemaRequest = exports.AgentGenerateResponse = exports.AgentGenerateRequest = exports.WorkflowLLMNodeResponse = exports.WorkflowLLMNodeRequest = exports.CancelRunRequest = exports.SubmitToolResultRequest = exports.StartChatRunResponse = exports.StartChatRunRequest = exports.GenerationProtobufPackage = exports.ChatService = exports.DeleteChatExportCommentRequest = exports.AddChatExportCommentRequest = exports.ChatExportCommentsResponse = exports.ChatExportsResponse = exports.ListChatExportsRequest = exports.DeleteChatExportRequest = exports.GetChatExportCommentsRequest = exports.GetChatExportRequest = exports.ExportChatResponse = exports.ExportChatRequest = exports.ChatExportComment = exports.ChatExportSummary = exports.ChatExport = exports.ChatExportMessage = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = void 0;
9
9
  var shared_module_1 = require("./shared.module");
10
10
  Object.defineProperty(exports, "SharedModule", { enumerable: true, get: function () { return shared_module_1.SharedModule; } });
11
11
  var user_client_1 = require("./user.client");
@@ -203,6 +203,10 @@ Object.defineProperty(exports, "ProcessResponseRequest", { enumerable: true, get
203
203
  Object.defineProperty(exports, "ProcessResponseResponse", { enumerable: true, get: function () { return response_interface_1.ProcessResponseResponse; } });
204
204
  Object.defineProperty(exports, "StreamUpdatesRequest", { enumerable: true, get: function () { return response_interface_1.StreamUpdatesRequest; } });
205
205
  Object.defineProperty(exports, "StreamUpdate", { enumerable: true, get: function () { return response_interface_1.StreamUpdate; } });
206
+ Object.defineProperty(exports, "ProviderUsage", { enumerable: true, get: function () { return response_interface_1.ProviderUsage; } });
207
+ Object.defineProperty(exports, "ProviderChunk", { enumerable: true, get: function () { return response_interface_1.ProviderChunk; } });
208
+ Object.defineProperty(exports, "ProviderError", { enumerable: true, get: function () { return response_interface_1.ProviderError; } });
209
+ Object.defineProperty(exports, "ProviderResponse", { enumerable: true, get: function () { return response_interface_1.ProviderResponse; } });
206
210
  Object.defineProperty(exports, "ResponseService", { enumerable: true, get: function () { return response_interface_1.ResponseServiceService; } });
207
211
  // ============================
208
212
  // Billing exports
@@ -361,4 +365,10 @@ Object.defineProperty(exports, "StartChatRunRequest", { enumerable: true, get: f
361
365
  Object.defineProperty(exports, "StartChatRunResponse", { enumerable: true, get: function () { return generation_interface_1.StartChatRunResponse; } });
362
366
  Object.defineProperty(exports, "SubmitToolResultRequest", { enumerable: true, get: function () { return generation_interface_1.SubmitToolResultRequest; } });
363
367
  Object.defineProperty(exports, "CancelRunRequest", { enumerable: true, get: function () { return generation_interface_1.CancelRunRequest; } });
368
+ Object.defineProperty(exports, "WorkflowLLMNodeRequest", { enumerable: true, get: function () { return generation_interface_1.WorkflowLLMNodeRequest; } });
369
+ Object.defineProperty(exports, "WorkflowLLMNodeResponse", { enumerable: true, get: function () { return generation_interface_1.WorkflowLLMNodeResponse; } });
370
+ Object.defineProperty(exports, "AgentGenerateRequest", { enumerable: true, get: function () { return generation_interface_1.AgentGenerateRequest; } });
371
+ Object.defineProperty(exports, "AgentGenerateResponse", { enumerable: true, get: function () { return generation_interface_1.AgentGenerateResponse; } });
372
+ Object.defineProperty(exports, "MCPToolSchemaRequest", { enumerable: true, get: function () { return generation_interface_1.MCPToolSchemaRequest; } });
373
+ Object.defineProperty(exports, "MCPToolSchemaResponse", { enumerable: true, get: function () { return generation_interface_1.MCPToolSchemaResponse; } });
364
374
  Object.defineProperty(exports, "GenerationService", { enumerable: true, get: function () { return generation_interface_1.GenerationServiceService; } });
@@ -2,6 +2,49 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
2
  import type { handleServerStreamingCall, handleUnaryCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
3
3
  import { Observable } from "rxjs";
4
4
  export declare const protobufPackage = "response";
5
+ export interface ProviderUsage {
6
+ inputTokens: number;
7
+ outputTokens: number;
8
+ totalTokens: number;
9
+ /** original provider usage payload */
10
+ raw?: {
11
+ [key: string]: any;
12
+ } | undefined;
13
+ }
14
+ export interface ProviderChunk {
15
+ /** start, delta, completion, tool, etc. */
16
+ type: string;
17
+ /** user, assistant, system, tool */
18
+ role: string;
19
+ text: string;
20
+ data?: {
21
+ [key: string]: any;
22
+ } | undefined;
23
+ /** indicates final chunk in a stream */
24
+ final: boolean;
25
+ timestamp: string;
26
+ }
27
+ export interface ProviderError {
28
+ code: string;
29
+ message: string;
30
+ details?: {
31
+ [key: string]: any;
32
+ } | undefined;
33
+ }
34
+ export interface ProviderResponse {
35
+ schemaVersion: string;
36
+ requestId: string;
37
+ provider: string;
38
+ model: string;
39
+ /** pending, streaming, completed, failed */
40
+ status: string;
41
+ usage?: ProviderUsage | undefined;
42
+ chunks: ProviderChunk[];
43
+ error?: ProviderError | undefined;
44
+ metadata?: {
45
+ [key: string]: any;
46
+ } | undefined;
47
+ }
5
48
  export interface StreamUpdate {
6
49
  requestId: string;
7
50
  /** start, data, done, error */
@@ -13,23 +56,28 @@ export interface StreamUpdate {
13
56
  timestamp: string;
14
57
  }
15
58
  export interface ProcessResponseRequest {
16
- /** ID from RabbitMQ */
59
+ /** ID from transport (Kafka/RabbitMQ/etc.) */
17
60
  correlationId: string;
18
- /** JSON response data */
19
- data: string;
20
- /** error, if any */
21
- error: string;
22
- /** this is a stream chunk */
61
+ /** canonical provider payload */
62
+ payload?: ProviderResponse | undefined;
63
+ /** backwards compatibility flag while rolling out canonical payloads */
23
64
  isStreamChunk: boolean;
24
65
  }
25
66
  export interface StreamUpdatesRequest {
26
67
  requestId: string;
27
68
  }
28
69
  export interface ProcessResponseResponse {
29
- success: boolean;
30
- error: string;
70
+ processed: boolean;
71
+ requestId: string;
72
+ status: string;
73
+ usage?: ProviderUsage | undefined;
74
+ error?: ProviderError | undefined;
31
75
  }
32
76
  export declare const RESPONSE_PACKAGE_NAME = "response";
77
+ export declare const ProviderUsage: MessageFns<ProviderUsage>;
78
+ export declare const ProviderChunk: MessageFns<ProviderChunk>;
79
+ export declare const ProviderError: MessageFns<ProviderError>;
80
+ export declare const ProviderResponse: MessageFns<ProviderResponse>;
33
81
  export declare const StreamUpdate: MessageFns<StreamUpdate>;
34
82
  export declare const ProcessResponseRequest: MessageFns<ProcessResponseRequest>;
35
83
  export declare const StreamUpdatesRequest: MessageFns<StreamUpdatesRequest>;
@@ -5,13 +5,327 @@
5
5
  // protoc v5.28.2
6
6
  // source: response.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ResponseServiceService = exports.RESPONSE_SERVICE_NAME = exports.ProcessResponseResponse = exports.StreamUpdatesRequest = exports.ProcessResponseRequest = exports.StreamUpdate = exports.RESPONSE_PACKAGE_NAME = exports.protobufPackage = void 0;
8
+ exports.ResponseServiceService = exports.RESPONSE_SERVICE_NAME = exports.ProcessResponseResponse = exports.StreamUpdatesRequest = exports.ProcessResponseRequest = exports.StreamUpdate = exports.ProviderResponse = exports.ProviderError = exports.ProviderChunk = exports.ProviderUsage = exports.RESPONSE_PACKAGE_NAME = exports.protobufPackage = void 0;
9
9
  exports.ResponseServiceControllerMethods = ResponseServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const wire_1 = require("@bufbuild/protobuf/wire");
12
12
  const microservices_1 = require("@nestjs/microservices");
13
+ const protobufjs_1 = require("protobufjs");
14
+ const struct_interface_1 = require("./google/protobuf/struct.interface");
13
15
  exports.protobufPackage = "response";
14
16
  exports.RESPONSE_PACKAGE_NAME = "response";
17
+ function createBaseProviderUsage() {
18
+ return { inputTokens: 0, outputTokens: 0, totalTokens: 0 };
19
+ }
20
+ exports.ProviderUsage = {
21
+ encode(message, writer = new wire_1.BinaryWriter()) {
22
+ if (message.inputTokens !== 0) {
23
+ writer.uint32(8).int64(message.inputTokens);
24
+ }
25
+ if (message.outputTokens !== 0) {
26
+ writer.uint32(16).int64(message.outputTokens);
27
+ }
28
+ if (message.totalTokens !== 0) {
29
+ writer.uint32(24).int64(message.totalTokens);
30
+ }
31
+ if (message.raw !== undefined) {
32
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.raw), writer.uint32(34).fork()).join();
33
+ }
34
+ return writer;
35
+ },
36
+ decode(input, length) {
37
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
38
+ const end = length === undefined ? reader.len : reader.pos + length;
39
+ const message = createBaseProviderUsage();
40
+ while (reader.pos < end) {
41
+ const tag = reader.uint32();
42
+ switch (tag >>> 3) {
43
+ case 1: {
44
+ if (tag !== 8) {
45
+ break;
46
+ }
47
+ message.inputTokens = longToNumber(reader.int64());
48
+ continue;
49
+ }
50
+ case 2: {
51
+ if (tag !== 16) {
52
+ break;
53
+ }
54
+ message.outputTokens = longToNumber(reader.int64());
55
+ continue;
56
+ }
57
+ case 3: {
58
+ if (tag !== 24) {
59
+ break;
60
+ }
61
+ message.totalTokens = longToNumber(reader.int64());
62
+ continue;
63
+ }
64
+ case 4: {
65
+ if (tag !== 34) {
66
+ break;
67
+ }
68
+ message.raw = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
69
+ continue;
70
+ }
71
+ }
72
+ if ((tag & 7) === 4 || tag === 0) {
73
+ break;
74
+ }
75
+ reader.skip(tag & 7);
76
+ }
77
+ return message;
78
+ },
79
+ };
80
+ function createBaseProviderChunk() {
81
+ return { type: "", role: "", text: "", final: false, timestamp: "" };
82
+ }
83
+ exports.ProviderChunk = {
84
+ encode(message, writer = new wire_1.BinaryWriter()) {
85
+ if (message.type !== "") {
86
+ writer.uint32(10).string(message.type);
87
+ }
88
+ if (message.role !== "") {
89
+ writer.uint32(18).string(message.role);
90
+ }
91
+ if (message.text !== "") {
92
+ writer.uint32(26).string(message.text);
93
+ }
94
+ if (message.data !== undefined) {
95
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.data), writer.uint32(34).fork()).join();
96
+ }
97
+ if (message.final !== false) {
98
+ writer.uint32(40).bool(message.final);
99
+ }
100
+ if (message.timestamp !== "") {
101
+ writer.uint32(50).string(message.timestamp);
102
+ }
103
+ return writer;
104
+ },
105
+ decode(input, length) {
106
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
107
+ const end = length === undefined ? reader.len : reader.pos + length;
108
+ const message = createBaseProviderChunk();
109
+ while (reader.pos < end) {
110
+ const tag = reader.uint32();
111
+ switch (tag >>> 3) {
112
+ case 1: {
113
+ if (tag !== 10) {
114
+ break;
115
+ }
116
+ message.type = reader.string();
117
+ continue;
118
+ }
119
+ case 2: {
120
+ if (tag !== 18) {
121
+ break;
122
+ }
123
+ message.role = reader.string();
124
+ continue;
125
+ }
126
+ case 3: {
127
+ if (tag !== 26) {
128
+ break;
129
+ }
130
+ message.text = reader.string();
131
+ continue;
132
+ }
133
+ case 4: {
134
+ if (tag !== 34) {
135
+ break;
136
+ }
137
+ message.data = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
138
+ continue;
139
+ }
140
+ case 5: {
141
+ if (tag !== 40) {
142
+ break;
143
+ }
144
+ message.final = reader.bool();
145
+ continue;
146
+ }
147
+ case 6: {
148
+ if (tag !== 50) {
149
+ break;
150
+ }
151
+ message.timestamp = reader.string();
152
+ continue;
153
+ }
154
+ }
155
+ if ((tag & 7) === 4 || tag === 0) {
156
+ break;
157
+ }
158
+ reader.skip(tag & 7);
159
+ }
160
+ return message;
161
+ },
162
+ };
163
+ function createBaseProviderError() {
164
+ return { code: "", message: "" };
165
+ }
166
+ exports.ProviderError = {
167
+ encode(message, writer = new wire_1.BinaryWriter()) {
168
+ if (message.code !== "") {
169
+ writer.uint32(10).string(message.code);
170
+ }
171
+ if (message.message !== "") {
172
+ writer.uint32(18).string(message.message);
173
+ }
174
+ if (message.details !== undefined) {
175
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.details), writer.uint32(26).fork()).join();
176
+ }
177
+ return writer;
178
+ },
179
+ decode(input, length) {
180
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
181
+ const end = length === undefined ? reader.len : reader.pos + length;
182
+ const message = createBaseProviderError();
183
+ while (reader.pos < end) {
184
+ const tag = reader.uint32();
185
+ switch (tag >>> 3) {
186
+ case 1: {
187
+ if (tag !== 10) {
188
+ break;
189
+ }
190
+ message.code = reader.string();
191
+ continue;
192
+ }
193
+ case 2: {
194
+ if (tag !== 18) {
195
+ break;
196
+ }
197
+ message.message = reader.string();
198
+ continue;
199
+ }
200
+ case 3: {
201
+ if (tag !== 26) {
202
+ break;
203
+ }
204
+ message.details = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
205
+ continue;
206
+ }
207
+ }
208
+ if ((tag & 7) === 4 || tag === 0) {
209
+ break;
210
+ }
211
+ reader.skip(tag & 7);
212
+ }
213
+ return message;
214
+ },
215
+ };
216
+ function createBaseProviderResponse() {
217
+ return { schemaVersion: "", requestId: "", provider: "", model: "", status: "", chunks: [] };
218
+ }
219
+ exports.ProviderResponse = {
220
+ encode(message, writer = new wire_1.BinaryWriter()) {
221
+ if (message.schemaVersion !== "") {
222
+ writer.uint32(10).string(message.schemaVersion);
223
+ }
224
+ if (message.requestId !== "") {
225
+ writer.uint32(18).string(message.requestId);
226
+ }
227
+ if (message.provider !== "") {
228
+ writer.uint32(26).string(message.provider);
229
+ }
230
+ if (message.model !== "") {
231
+ writer.uint32(34).string(message.model);
232
+ }
233
+ if (message.status !== "") {
234
+ writer.uint32(42).string(message.status);
235
+ }
236
+ if (message.usage !== undefined) {
237
+ exports.ProviderUsage.encode(message.usage, writer.uint32(50).fork()).join();
238
+ }
239
+ for (const v of message.chunks) {
240
+ exports.ProviderChunk.encode(v, writer.uint32(58).fork()).join();
241
+ }
242
+ if (message.error !== undefined) {
243
+ exports.ProviderError.encode(message.error, writer.uint32(66).fork()).join();
244
+ }
245
+ if (message.metadata !== undefined) {
246
+ struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.metadata), writer.uint32(74).fork()).join();
247
+ }
248
+ return writer;
249
+ },
250
+ decode(input, length) {
251
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
252
+ const end = length === undefined ? reader.len : reader.pos + length;
253
+ const message = createBaseProviderResponse();
254
+ while (reader.pos < end) {
255
+ const tag = reader.uint32();
256
+ switch (tag >>> 3) {
257
+ case 1: {
258
+ if (tag !== 10) {
259
+ break;
260
+ }
261
+ message.schemaVersion = reader.string();
262
+ continue;
263
+ }
264
+ case 2: {
265
+ if (tag !== 18) {
266
+ break;
267
+ }
268
+ message.requestId = reader.string();
269
+ continue;
270
+ }
271
+ case 3: {
272
+ if (tag !== 26) {
273
+ break;
274
+ }
275
+ message.provider = reader.string();
276
+ continue;
277
+ }
278
+ case 4: {
279
+ if (tag !== 34) {
280
+ break;
281
+ }
282
+ message.model = reader.string();
283
+ continue;
284
+ }
285
+ case 5: {
286
+ if (tag !== 42) {
287
+ break;
288
+ }
289
+ message.status = reader.string();
290
+ continue;
291
+ }
292
+ case 6: {
293
+ if (tag !== 50) {
294
+ break;
295
+ }
296
+ message.usage = exports.ProviderUsage.decode(reader, reader.uint32());
297
+ continue;
298
+ }
299
+ case 7: {
300
+ if (tag !== 58) {
301
+ break;
302
+ }
303
+ message.chunks.push(exports.ProviderChunk.decode(reader, reader.uint32()));
304
+ continue;
305
+ }
306
+ case 8: {
307
+ if (tag !== 66) {
308
+ break;
309
+ }
310
+ message.error = exports.ProviderError.decode(reader, reader.uint32());
311
+ continue;
312
+ }
313
+ case 9: {
314
+ if (tag !== 74) {
315
+ break;
316
+ }
317
+ message.metadata = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
318
+ continue;
319
+ }
320
+ }
321
+ if ((tag & 7) === 4 || tag === 0) {
322
+ break;
323
+ }
324
+ reader.skip(tag & 7);
325
+ }
326
+ return message;
327
+ },
328
+ };
15
329
  function createBaseStreamUpdate() {
16
330
  return { requestId: "", type: "", data: "", chunk: 0, timestamp: "" };
17
331
  }
@@ -86,21 +400,18 @@ exports.StreamUpdate = {
86
400
  },
87
401
  };
88
402
  function createBaseProcessResponseRequest() {
89
- return { correlationId: "", data: "", error: "", isStreamChunk: false };
403
+ return { correlationId: "", isStreamChunk: false };
90
404
  }
91
405
  exports.ProcessResponseRequest = {
92
406
  encode(message, writer = new wire_1.BinaryWriter()) {
93
407
  if (message.correlationId !== "") {
94
408
  writer.uint32(10).string(message.correlationId);
95
409
  }
96
- if (message.data !== "") {
97
- writer.uint32(18).string(message.data);
98
- }
99
- if (message.error !== "") {
100
- writer.uint32(26).string(message.error);
410
+ if (message.payload !== undefined) {
411
+ exports.ProviderResponse.encode(message.payload, writer.uint32(18).fork()).join();
101
412
  }
102
413
  if (message.isStreamChunk !== false) {
103
- writer.uint32(32).bool(message.isStreamChunk);
414
+ writer.uint32(24).bool(message.isStreamChunk);
104
415
  }
105
416
  return writer;
106
417
  },
@@ -122,18 +433,11 @@ exports.ProcessResponseRequest = {
122
433
  if (tag !== 18) {
123
434
  break;
124
435
  }
125
- message.data = reader.string();
436
+ message.payload = exports.ProviderResponse.decode(reader, reader.uint32());
126
437
  continue;
127
438
  }
128
439
  case 3: {
129
- if (tag !== 26) {
130
- break;
131
- }
132
- message.error = reader.string();
133
- continue;
134
- }
135
- case 4: {
136
- if (tag !== 32) {
440
+ if (tag !== 24) {
137
441
  break;
138
442
  }
139
443
  message.isStreamChunk = reader.bool();
@@ -182,15 +486,24 @@ exports.StreamUpdatesRequest = {
182
486
  },
183
487
  };
184
488
  function createBaseProcessResponseResponse() {
185
- return { success: false, error: "" };
489
+ return { processed: false, requestId: "", status: "" };
186
490
  }
187
491
  exports.ProcessResponseResponse = {
188
492
  encode(message, writer = new wire_1.BinaryWriter()) {
189
- if (message.success !== false) {
190
- writer.uint32(8).bool(message.success);
493
+ if (message.processed !== false) {
494
+ writer.uint32(8).bool(message.processed);
191
495
  }
192
- if (message.error !== "") {
193
- writer.uint32(18).string(message.error);
496
+ if (message.requestId !== "") {
497
+ writer.uint32(18).string(message.requestId);
498
+ }
499
+ if (message.status !== "") {
500
+ writer.uint32(26).string(message.status);
501
+ }
502
+ if (message.usage !== undefined) {
503
+ exports.ProviderUsage.encode(message.usage, writer.uint32(34).fork()).join();
504
+ }
505
+ if (message.error !== undefined) {
506
+ exports.ProviderError.encode(message.error, writer.uint32(42).fork()).join();
194
507
  }
195
508
  return writer;
196
509
  },
@@ -205,14 +518,35 @@ exports.ProcessResponseResponse = {
205
518
  if (tag !== 8) {
206
519
  break;
207
520
  }
208
- message.success = reader.bool();
521
+ message.processed = reader.bool();
209
522
  continue;
210
523
  }
211
524
  case 2: {
212
525
  if (tag !== 18) {
213
526
  break;
214
527
  }
215
- message.error = reader.string();
528
+ message.requestId = reader.string();
529
+ continue;
530
+ }
531
+ case 3: {
532
+ if (tag !== 26) {
533
+ break;
534
+ }
535
+ message.status = reader.string();
536
+ continue;
537
+ }
538
+ case 4: {
539
+ if (tag !== 34) {
540
+ break;
541
+ }
542
+ message.usage = exports.ProviderUsage.decode(reader, reader.uint32());
543
+ continue;
544
+ }
545
+ case 5: {
546
+ if (tag !== 42) {
547
+ break;
548
+ }
549
+ message.error = exports.ProviderError.decode(reader, reader.uint32());
216
550
  continue;
217
551
  }
218
552
  }
@@ -224,6 +558,7 @@ exports.ProcessResponseResponse = {
224
558
  return message;
225
559
  },
226
560
  };
561
+ protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_interface_1.Struct.wrap, toObject: struct_interface_1.Struct.unwrap };
227
562
  function ResponseServiceControllerMethods() {
228
563
  return function (constructor) {
229
564
  const grpcMethods = ["processResponse", "getStreamUpdates"];
@@ -259,3 +594,13 @@ exports.ResponseServiceService = {
259
594
  responseDeserialize: (value) => exports.StreamUpdate.decode(value),
260
595
  },
261
596
  };
597
+ function longToNumber(int64) {
598
+ const num = globalThis.Number(int64.toString());
599
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
600
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
601
+ }
602
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
603
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
604
+ }
605
+ return num;
606
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geniebox-shared-lib",
3
- "version": "2.5.8",
3
+ "version": "2.5.10",
4
4
  "description": "Shared NestJS library with gRPC clients",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",