omnimind-sdk 1.0.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,3083 @@
1
+ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
2
+ "use strict";
3
+
4
+ var $protobuf = require("protobufjs/minimal");
5
+
6
+ // Common aliases
7
+ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
8
+
9
+ // Exported root namespace
10
+ var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
11
+
12
+ $root.omnimind = (function() {
13
+
14
+ /**
15
+ * Namespace omnimind.
16
+ * @exports omnimind
17
+ * @namespace
18
+ */
19
+ var omnimind = {};
20
+
21
+ /**
22
+ * MessageType enum.
23
+ * @name omnimind.MessageType
24
+ * @enum {number}
25
+ * @property {number} AUTH=0 AUTH value
26
+ * @property {number} MCP_REG=1 MCP_REG value
27
+ * @property {number} VOICE_STREAM=2 VOICE_STREAM value
28
+ * @property {number} IMAGE_FRAME=3 IMAGE_FRAME value
29
+ * @property {number} TOOL_CALL=4 TOOL_CALL value
30
+ * @property {number} TOOL_RESP=5 TOOL_RESP value
31
+ * @property {number} TEXT_MSG=6 TEXT_MSG value
32
+ * @property {number} PING=7 PING value
33
+ * @property {number} PONG=8 PONG value
34
+ * @property {number} INTERRUPT=9 INTERRUPT value
35
+ * @property {number} VISION_ANALYSIS=10 VISION_ANALYSIS value
36
+ * @property {number} EVENT_REPORT=11 EVENT_REPORT value
37
+ */
38
+ omnimind.MessageType = (function() {
39
+ var valuesById = {}, values = Object.create(valuesById);
40
+ values[valuesById[0] = "AUTH"] = 0;
41
+ values[valuesById[1] = "MCP_REG"] = 1;
42
+ values[valuesById[2] = "VOICE_STREAM"] = 2;
43
+ values[valuesById[3] = "IMAGE_FRAME"] = 3;
44
+ values[valuesById[4] = "TOOL_CALL"] = 4;
45
+ values[valuesById[5] = "TOOL_RESP"] = 5;
46
+ values[valuesById[6] = "TEXT_MSG"] = 6;
47
+ values[valuesById[7] = "PING"] = 7;
48
+ values[valuesById[8] = "PONG"] = 8;
49
+ values[valuesById[9] = "INTERRUPT"] = 9;
50
+ values[valuesById[10] = "VISION_ANALYSIS"] = 10;
51
+ values[valuesById[11] = "EVENT_REPORT"] = 11;
52
+ return values;
53
+ })();
54
+
55
+ omnimind.EventReport = (function() {
56
+
57
+ /**
58
+ * Properties of an EventReport.
59
+ * @memberof omnimind
60
+ * @interface IEventReport
61
+ * @property {string|null} [eventType] EventReport eventType
62
+ * @property {string|null} [sourceComponent] EventReport sourceComponent
63
+ * @property {string|null} [payloadJson] EventReport payloadJson
64
+ */
65
+
66
+ /**
67
+ * Constructs a new EventReport.
68
+ * @memberof omnimind
69
+ * @classdesc Represents an EventReport.
70
+ * @implements IEventReport
71
+ * @constructor
72
+ * @param {omnimind.IEventReport=} [properties] Properties to set
73
+ */
74
+ function EventReport(properties) {
75
+ if (properties)
76
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
77
+ if (properties[keys[i]] != null)
78
+ this[keys[i]] = properties[keys[i]];
79
+ }
80
+
81
+ /**
82
+ * EventReport eventType.
83
+ * @member {string} eventType
84
+ * @memberof omnimind.EventReport
85
+ * @instance
86
+ */
87
+ EventReport.prototype.eventType = "";
88
+
89
+ /**
90
+ * EventReport sourceComponent.
91
+ * @member {string} sourceComponent
92
+ * @memberof omnimind.EventReport
93
+ * @instance
94
+ */
95
+ EventReport.prototype.sourceComponent = "";
96
+
97
+ /**
98
+ * EventReport payloadJson.
99
+ * @member {string} payloadJson
100
+ * @memberof omnimind.EventReport
101
+ * @instance
102
+ */
103
+ EventReport.prototype.payloadJson = "";
104
+
105
+ /**
106
+ * Creates a new EventReport instance using the specified properties.
107
+ * @function create
108
+ * @memberof omnimind.EventReport
109
+ * @static
110
+ * @param {omnimind.IEventReport=} [properties] Properties to set
111
+ * @returns {omnimind.EventReport} EventReport instance
112
+ */
113
+ EventReport.create = function create(properties) {
114
+ return new EventReport(properties);
115
+ };
116
+
117
+ /**
118
+ * Encodes the specified EventReport message. Does not implicitly {@link omnimind.EventReport.verify|verify} messages.
119
+ * @function encode
120
+ * @memberof omnimind.EventReport
121
+ * @static
122
+ * @param {omnimind.IEventReport} message EventReport message or plain object to encode
123
+ * @param {$protobuf.Writer} [writer] Writer to encode to
124
+ * @returns {$protobuf.Writer} Writer
125
+ */
126
+ EventReport.encode = function encode(message, writer) {
127
+ if (!writer)
128
+ writer = $Writer.create();
129
+ if (message.eventType != null && Object.hasOwnProperty.call(message, "eventType"))
130
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.eventType);
131
+ if (message.sourceComponent != null && Object.hasOwnProperty.call(message, "sourceComponent"))
132
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceComponent);
133
+ if (message.payloadJson != null && Object.hasOwnProperty.call(message, "payloadJson"))
134
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.payloadJson);
135
+ return writer;
136
+ };
137
+
138
+ /**
139
+ * Encodes the specified EventReport message, length delimited. Does not implicitly {@link omnimind.EventReport.verify|verify} messages.
140
+ * @function encodeDelimited
141
+ * @memberof omnimind.EventReport
142
+ * @static
143
+ * @param {omnimind.IEventReport} message EventReport message or plain object to encode
144
+ * @param {$protobuf.Writer} [writer] Writer to encode to
145
+ * @returns {$protobuf.Writer} Writer
146
+ */
147
+ EventReport.encodeDelimited = function encodeDelimited(message, writer) {
148
+ return this.encode(message, writer).ldelim();
149
+ };
150
+
151
+ /**
152
+ * Decodes an EventReport message from the specified reader or buffer.
153
+ * @function decode
154
+ * @memberof omnimind.EventReport
155
+ * @static
156
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
157
+ * @param {number} [length] Message length if known beforehand
158
+ * @returns {omnimind.EventReport} EventReport
159
+ * @throws {Error} If the payload is not a reader or valid buffer
160
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
161
+ */
162
+ EventReport.decode = function decode(reader, length, error) {
163
+ if (!(reader instanceof $Reader))
164
+ reader = $Reader.create(reader);
165
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.EventReport();
166
+ while (reader.pos < end) {
167
+ var tag = reader.uint32();
168
+ if (tag === error)
169
+ break;
170
+ switch (tag >>> 3) {
171
+ case 1: {
172
+ message.eventType = reader.string();
173
+ break;
174
+ }
175
+ case 2: {
176
+ message.sourceComponent = reader.string();
177
+ break;
178
+ }
179
+ case 3: {
180
+ message.payloadJson = reader.string();
181
+ break;
182
+ }
183
+ default:
184
+ reader.skipType(tag & 7);
185
+ break;
186
+ }
187
+ }
188
+ return message;
189
+ };
190
+
191
+ /**
192
+ * Decodes an EventReport message from the specified reader or buffer, length delimited.
193
+ * @function decodeDelimited
194
+ * @memberof omnimind.EventReport
195
+ * @static
196
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
197
+ * @returns {omnimind.EventReport} EventReport
198
+ * @throws {Error} If the payload is not a reader or valid buffer
199
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
200
+ */
201
+ EventReport.decodeDelimited = function decodeDelimited(reader) {
202
+ if (!(reader instanceof $Reader))
203
+ reader = new $Reader(reader);
204
+ return this.decode(reader, reader.uint32());
205
+ };
206
+
207
+ /**
208
+ * Verifies an EventReport message.
209
+ * @function verify
210
+ * @memberof omnimind.EventReport
211
+ * @static
212
+ * @param {Object.<string,*>} message Plain object to verify
213
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
214
+ */
215
+ EventReport.verify = function verify(message) {
216
+ if (typeof message !== "object" || message === null)
217
+ return "object expected";
218
+ if (message.eventType != null && message.hasOwnProperty("eventType"))
219
+ if (!$util.isString(message.eventType))
220
+ return "eventType: string expected";
221
+ if (message.sourceComponent != null && message.hasOwnProperty("sourceComponent"))
222
+ if (!$util.isString(message.sourceComponent))
223
+ return "sourceComponent: string expected";
224
+ if (message.payloadJson != null && message.hasOwnProperty("payloadJson"))
225
+ if (!$util.isString(message.payloadJson))
226
+ return "payloadJson: string expected";
227
+ return null;
228
+ };
229
+
230
+ /**
231
+ * Creates an EventReport message from a plain object. Also converts values to their respective internal types.
232
+ * @function fromObject
233
+ * @memberof omnimind.EventReport
234
+ * @static
235
+ * @param {Object.<string,*>} object Plain object
236
+ * @returns {omnimind.EventReport} EventReport
237
+ */
238
+ EventReport.fromObject = function fromObject(object) {
239
+ if (object instanceof $root.omnimind.EventReport)
240
+ return object;
241
+ var message = new $root.omnimind.EventReport();
242
+ if (object.eventType != null)
243
+ message.eventType = String(object.eventType);
244
+ if (object.sourceComponent != null)
245
+ message.sourceComponent = String(object.sourceComponent);
246
+ if (object.payloadJson != null)
247
+ message.payloadJson = String(object.payloadJson);
248
+ return message;
249
+ };
250
+
251
+ /**
252
+ * Creates a plain object from an EventReport message. Also converts values to other types if specified.
253
+ * @function toObject
254
+ * @memberof omnimind.EventReport
255
+ * @static
256
+ * @param {omnimind.EventReport} message EventReport
257
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
258
+ * @returns {Object.<string,*>} Plain object
259
+ */
260
+ EventReport.toObject = function toObject(message, options) {
261
+ if (!options)
262
+ options = {};
263
+ var object = {};
264
+ if (options.defaults) {
265
+ object.eventType = "";
266
+ object.sourceComponent = "";
267
+ object.payloadJson = "";
268
+ }
269
+ if (message.eventType != null && message.hasOwnProperty("eventType"))
270
+ object.eventType = message.eventType;
271
+ if (message.sourceComponent != null && message.hasOwnProperty("sourceComponent"))
272
+ object.sourceComponent = message.sourceComponent;
273
+ if (message.payloadJson != null && message.hasOwnProperty("payloadJson"))
274
+ object.payloadJson = message.payloadJson;
275
+ return object;
276
+ };
277
+
278
+ /**
279
+ * Converts this EventReport to JSON.
280
+ * @function toJSON
281
+ * @memberof omnimind.EventReport
282
+ * @instance
283
+ * @returns {Object.<string,*>} JSON object
284
+ */
285
+ EventReport.prototype.toJSON = function toJSON() {
286
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
287
+ };
288
+
289
+ /**
290
+ * Gets the default type url for EventReport
291
+ * @function getTypeUrl
292
+ * @memberof omnimind.EventReport
293
+ * @static
294
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
295
+ * @returns {string} The default type url
296
+ */
297
+ EventReport.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
298
+ if (typeUrlPrefix === undefined) {
299
+ typeUrlPrefix = "type.googleapis.com";
300
+ }
301
+ return typeUrlPrefix + "/omnimind.EventReport";
302
+ };
303
+
304
+ return EventReport;
305
+ })();
306
+
307
+ omnimind.VisionRequest = (function() {
308
+
309
+ /**
310
+ * Properties of a VisionRequest.
311
+ * @memberof omnimind
312
+ * @interface IVisionRequest
313
+ * @property {Uint8Array|null} [imageData] VisionRequest imageData
314
+ * @property {string|null} [prompt] VisionRequest prompt
315
+ * @property {boolean|null} [requireJson] VisionRequest requireJson
316
+ */
317
+
318
+ /**
319
+ * Constructs a new VisionRequest.
320
+ * @memberof omnimind
321
+ * @classdesc Represents a VisionRequest.
322
+ * @implements IVisionRequest
323
+ * @constructor
324
+ * @param {omnimind.IVisionRequest=} [properties] Properties to set
325
+ */
326
+ function VisionRequest(properties) {
327
+ if (properties)
328
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
329
+ if (properties[keys[i]] != null)
330
+ this[keys[i]] = properties[keys[i]];
331
+ }
332
+
333
+ /**
334
+ * VisionRequest imageData.
335
+ * @member {Uint8Array} imageData
336
+ * @memberof omnimind.VisionRequest
337
+ * @instance
338
+ */
339
+ VisionRequest.prototype.imageData = $util.newBuffer([]);
340
+
341
+ /**
342
+ * VisionRequest prompt.
343
+ * @member {string} prompt
344
+ * @memberof omnimind.VisionRequest
345
+ * @instance
346
+ */
347
+ VisionRequest.prototype.prompt = "";
348
+
349
+ /**
350
+ * VisionRequest requireJson.
351
+ * @member {boolean} requireJson
352
+ * @memberof omnimind.VisionRequest
353
+ * @instance
354
+ */
355
+ VisionRequest.prototype.requireJson = false;
356
+
357
+ /**
358
+ * Creates a new VisionRequest instance using the specified properties.
359
+ * @function create
360
+ * @memberof omnimind.VisionRequest
361
+ * @static
362
+ * @param {omnimind.IVisionRequest=} [properties] Properties to set
363
+ * @returns {omnimind.VisionRequest} VisionRequest instance
364
+ */
365
+ VisionRequest.create = function create(properties) {
366
+ return new VisionRequest(properties);
367
+ };
368
+
369
+ /**
370
+ * Encodes the specified VisionRequest message. Does not implicitly {@link omnimind.VisionRequest.verify|verify} messages.
371
+ * @function encode
372
+ * @memberof omnimind.VisionRequest
373
+ * @static
374
+ * @param {omnimind.IVisionRequest} message VisionRequest message or plain object to encode
375
+ * @param {$protobuf.Writer} [writer] Writer to encode to
376
+ * @returns {$protobuf.Writer} Writer
377
+ */
378
+ VisionRequest.encode = function encode(message, writer) {
379
+ if (!writer)
380
+ writer = $Writer.create();
381
+ if (message.imageData != null && Object.hasOwnProperty.call(message, "imageData"))
382
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.imageData);
383
+ if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt"))
384
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.prompt);
385
+ if (message.requireJson != null && Object.hasOwnProperty.call(message, "requireJson"))
386
+ writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requireJson);
387
+ return writer;
388
+ };
389
+
390
+ /**
391
+ * Encodes the specified VisionRequest message, length delimited. Does not implicitly {@link omnimind.VisionRequest.verify|verify} messages.
392
+ * @function encodeDelimited
393
+ * @memberof omnimind.VisionRequest
394
+ * @static
395
+ * @param {omnimind.IVisionRequest} message VisionRequest message or plain object to encode
396
+ * @param {$protobuf.Writer} [writer] Writer to encode to
397
+ * @returns {$protobuf.Writer} Writer
398
+ */
399
+ VisionRequest.encodeDelimited = function encodeDelimited(message, writer) {
400
+ return this.encode(message, writer).ldelim();
401
+ };
402
+
403
+ /**
404
+ * Decodes a VisionRequest message from the specified reader or buffer.
405
+ * @function decode
406
+ * @memberof omnimind.VisionRequest
407
+ * @static
408
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
409
+ * @param {number} [length] Message length if known beforehand
410
+ * @returns {omnimind.VisionRequest} VisionRequest
411
+ * @throws {Error} If the payload is not a reader or valid buffer
412
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
413
+ */
414
+ VisionRequest.decode = function decode(reader, length, error) {
415
+ if (!(reader instanceof $Reader))
416
+ reader = $Reader.create(reader);
417
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.VisionRequest();
418
+ while (reader.pos < end) {
419
+ var tag = reader.uint32();
420
+ if (tag === error)
421
+ break;
422
+ switch (tag >>> 3) {
423
+ case 1: {
424
+ message.imageData = reader.bytes();
425
+ break;
426
+ }
427
+ case 2: {
428
+ message.prompt = reader.string();
429
+ break;
430
+ }
431
+ case 3: {
432
+ message.requireJson = reader.bool();
433
+ break;
434
+ }
435
+ default:
436
+ reader.skipType(tag & 7);
437
+ break;
438
+ }
439
+ }
440
+ return message;
441
+ };
442
+
443
+ /**
444
+ * Decodes a VisionRequest message from the specified reader or buffer, length delimited.
445
+ * @function decodeDelimited
446
+ * @memberof omnimind.VisionRequest
447
+ * @static
448
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
449
+ * @returns {omnimind.VisionRequest} VisionRequest
450
+ * @throws {Error} If the payload is not a reader or valid buffer
451
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
452
+ */
453
+ VisionRequest.decodeDelimited = function decodeDelimited(reader) {
454
+ if (!(reader instanceof $Reader))
455
+ reader = new $Reader(reader);
456
+ return this.decode(reader, reader.uint32());
457
+ };
458
+
459
+ /**
460
+ * Verifies a VisionRequest message.
461
+ * @function verify
462
+ * @memberof omnimind.VisionRequest
463
+ * @static
464
+ * @param {Object.<string,*>} message Plain object to verify
465
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
466
+ */
467
+ VisionRequest.verify = function verify(message) {
468
+ if (typeof message !== "object" || message === null)
469
+ return "object expected";
470
+ if (message.imageData != null && message.hasOwnProperty("imageData"))
471
+ if (!(message.imageData && typeof message.imageData.length === "number" || $util.isString(message.imageData)))
472
+ return "imageData: buffer expected";
473
+ if (message.prompt != null && message.hasOwnProperty("prompt"))
474
+ if (!$util.isString(message.prompt))
475
+ return "prompt: string expected";
476
+ if (message.requireJson != null && message.hasOwnProperty("requireJson"))
477
+ if (typeof message.requireJson !== "boolean")
478
+ return "requireJson: boolean expected";
479
+ return null;
480
+ };
481
+
482
+ /**
483
+ * Creates a VisionRequest message from a plain object. Also converts values to their respective internal types.
484
+ * @function fromObject
485
+ * @memberof omnimind.VisionRequest
486
+ * @static
487
+ * @param {Object.<string,*>} object Plain object
488
+ * @returns {omnimind.VisionRequest} VisionRequest
489
+ */
490
+ VisionRequest.fromObject = function fromObject(object) {
491
+ if (object instanceof $root.omnimind.VisionRequest)
492
+ return object;
493
+ var message = new $root.omnimind.VisionRequest();
494
+ if (object.imageData != null)
495
+ if (typeof object.imageData === "string")
496
+ $util.base64.decode(object.imageData, message.imageData = $util.newBuffer($util.base64.length(object.imageData)), 0);
497
+ else if (object.imageData.length >= 0)
498
+ message.imageData = object.imageData;
499
+ if (object.prompt != null)
500
+ message.prompt = String(object.prompt);
501
+ if (object.requireJson != null)
502
+ message.requireJson = Boolean(object.requireJson);
503
+ return message;
504
+ };
505
+
506
+ /**
507
+ * Creates a plain object from a VisionRequest message. Also converts values to other types if specified.
508
+ * @function toObject
509
+ * @memberof omnimind.VisionRequest
510
+ * @static
511
+ * @param {omnimind.VisionRequest} message VisionRequest
512
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
513
+ * @returns {Object.<string,*>} Plain object
514
+ */
515
+ VisionRequest.toObject = function toObject(message, options) {
516
+ if (!options)
517
+ options = {};
518
+ var object = {};
519
+ if (options.defaults) {
520
+ if (options.bytes === String)
521
+ object.imageData = "";
522
+ else {
523
+ object.imageData = [];
524
+ if (options.bytes !== Array)
525
+ object.imageData = $util.newBuffer(object.imageData);
526
+ }
527
+ object.prompt = "";
528
+ object.requireJson = false;
529
+ }
530
+ if (message.imageData != null && message.hasOwnProperty("imageData"))
531
+ object.imageData = options.bytes === String ? $util.base64.encode(message.imageData, 0, message.imageData.length) : options.bytes === Array ? Array.prototype.slice.call(message.imageData) : message.imageData;
532
+ if (message.prompt != null && message.hasOwnProperty("prompt"))
533
+ object.prompt = message.prompt;
534
+ if (message.requireJson != null && message.hasOwnProperty("requireJson"))
535
+ object.requireJson = message.requireJson;
536
+ return object;
537
+ };
538
+
539
+ /**
540
+ * Converts this VisionRequest to JSON.
541
+ * @function toJSON
542
+ * @memberof omnimind.VisionRequest
543
+ * @instance
544
+ * @returns {Object.<string,*>} JSON object
545
+ */
546
+ VisionRequest.prototype.toJSON = function toJSON() {
547
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
548
+ };
549
+
550
+ /**
551
+ * Gets the default type url for VisionRequest
552
+ * @function getTypeUrl
553
+ * @memberof omnimind.VisionRequest
554
+ * @static
555
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
556
+ * @returns {string} The default type url
557
+ */
558
+ VisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
559
+ if (typeUrlPrefix === undefined) {
560
+ typeUrlPrefix = "type.googleapis.com";
561
+ }
562
+ return typeUrlPrefix + "/omnimind.VisionRequest";
563
+ };
564
+
565
+ return VisionRequest;
566
+ })();
567
+
568
+ /**
569
+ * AudioCodec enum.
570
+ * @name omnimind.AudioCodec
571
+ * @enum {number}
572
+ * @property {number} PCM=0 PCM value
573
+ * @property {number} OPUS=1 OPUS value
574
+ * @property {number} AAC=2 AAC value
575
+ * @property {number} MP3=3 MP3 value
576
+ * @property {number} G711=4 G711 value
577
+ */
578
+ omnimind.AudioCodec = (function() {
579
+ var valuesById = {}, values = Object.create(valuesById);
580
+ values[valuesById[0] = "PCM"] = 0;
581
+ values[valuesById[1] = "OPUS"] = 1;
582
+ values[valuesById[2] = "AAC"] = 2;
583
+ values[valuesById[3] = "MP3"] = 3;
584
+ values[valuesById[4] = "G711"] = 4;
585
+ return values;
586
+ })();
587
+
588
+ omnimind.AudioFormat = (function() {
589
+
590
+ /**
591
+ * Properties of an AudioFormat.
592
+ * @memberof omnimind
593
+ * @interface IAudioFormat
594
+ * @property {omnimind.AudioCodec|null} [codec] AudioFormat codec
595
+ * @property {number|null} [sampleRate] AudioFormat sampleRate
596
+ * @property {number|null} [channels] AudioFormat channels
597
+ * @property {number|null} [bitDepth] AudioFormat bitDepth
598
+ */
599
+
600
+ /**
601
+ * Constructs a new AudioFormat.
602
+ * @memberof omnimind
603
+ * @classdesc Represents an AudioFormat.
604
+ * @implements IAudioFormat
605
+ * @constructor
606
+ * @param {omnimind.IAudioFormat=} [properties] Properties to set
607
+ */
608
+ function AudioFormat(properties) {
609
+ if (properties)
610
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
611
+ if (properties[keys[i]] != null)
612
+ this[keys[i]] = properties[keys[i]];
613
+ }
614
+
615
+ /**
616
+ * AudioFormat codec.
617
+ * @member {omnimind.AudioCodec} codec
618
+ * @memberof omnimind.AudioFormat
619
+ * @instance
620
+ */
621
+ AudioFormat.prototype.codec = 0;
622
+
623
+ /**
624
+ * AudioFormat sampleRate.
625
+ * @member {number} sampleRate
626
+ * @memberof omnimind.AudioFormat
627
+ * @instance
628
+ */
629
+ AudioFormat.prototype.sampleRate = 0;
630
+
631
+ /**
632
+ * AudioFormat channels.
633
+ * @member {number} channels
634
+ * @memberof omnimind.AudioFormat
635
+ * @instance
636
+ */
637
+ AudioFormat.prototype.channels = 0;
638
+
639
+ /**
640
+ * AudioFormat bitDepth.
641
+ * @member {number} bitDepth
642
+ * @memberof omnimind.AudioFormat
643
+ * @instance
644
+ */
645
+ AudioFormat.prototype.bitDepth = 0;
646
+
647
+ /**
648
+ * Creates a new AudioFormat instance using the specified properties.
649
+ * @function create
650
+ * @memberof omnimind.AudioFormat
651
+ * @static
652
+ * @param {omnimind.IAudioFormat=} [properties] Properties to set
653
+ * @returns {omnimind.AudioFormat} AudioFormat instance
654
+ */
655
+ AudioFormat.create = function create(properties) {
656
+ return new AudioFormat(properties);
657
+ };
658
+
659
+ /**
660
+ * Encodes the specified AudioFormat message. Does not implicitly {@link omnimind.AudioFormat.verify|verify} messages.
661
+ * @function encode
662
+ * @memberof omnimind.AudioFormat
663
+ * @static
664
+ * @param {omnimind.IAudioFormat} message AudioFormat message or plain object to encode
665
+ * @param {$protobuf.Writer} [writer] Writer to encode to
666
+ * @returns {$protobuf.Writer} Writer
667
+ */
668
+ AudioFormat.encode = function encode(message, writer) {
669
+ if (!writer)
670
+ writer = $Writer.create();
671
+ if (message.codec != null && Object.hasOwnProperty.call(message, "codec"))
672
+ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.codec);
673
+ if (message.sampleRate != null && Object.hasOwnProperty.call(message, "sampleRate"))
674
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.sampleRate);
675
+ if (message.channels != null && Object.hasOwnProperty.call(message, "channels"))
676
+ writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.channels);
677
+ if (message.bitDepth != null && Object.hasOwnProperty.call(message, "bitDepth"))
678
+ writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.bitDepth);
679
+ return writer;
680
+ };
681
+
682
+ /**
683
+ * Encodes the specified AudioFormat message, length delimited. Does not implicitly {@link omnimind.AudioFormat.verify|verify} messages.
684
+ * @function encodeDelimited
685
+ * @memberof omnimind.AudioFormat
686
+ * @static
687
+ * @param {omnimind.IAudioFormat} message AudioFormat message or plain object to encode
688
+ * @param {$protobuf.Writer} [writer] Writer to encode to
689
+ * @returns {$protobuf.Writer} Writer
690
+ */
691
+ AudioFormat.encodeDelimited = function encodeDelimited(message, writer) {
692
+ return this.encode(message, writer).ldelim();
693
+ };
694
+
695
+ /**
696
+ * Decodes an AudioFormat message from the specified reader or buffer.
697
+ * @function decode
698
+ * @memberof omnimind.AudioFormat
699
+ * @static
700
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
701
+ * @param {number} [length] Message length if known beforehand
702
+ * @returns {omnimind.AudioFormat} AudioFormat
703
+ * @throws {Error} If the payload is not a reader or valid buffer
704
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
705
+ */
706
+ AudioFormat.decode = function decode(reader, length, error) {
707
+ if (!(reader instanceof $Reader))
708
+ reader = $Reader.create(reader);
709
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.AudioFormat();
710
+ while (reader.pos < end) {
711
+ var tag = reader.uint32();
712
+ if (tag === error)
713
+ break;
714
+ switch (tag >>> 3) {
715
+ case 1: {
716
+ message.codec = reader.int32();
717
+ break;
718
+ }
719
+ case 2: {
720
+ message.sampleRate = reader.uint32();
721
+ break;
722
+ }
723
+ case 3: {
724
+ message.channels = reader.uint32();
725
+ break;
726
+ }
727
+ case 4: {
728
+ message.bitDepth = reader.uint32();
729
+ break;
730
+ }
731
+ default:
732
+ reader.skipType(tag & 7);
733
+ break;
734
+ }
735
+ }
736
+ return message;
737
+ };
738
+
739
+ /**
740
+ * Decodes an AudioFormat message from the specified reader or buffer, length delimited.
741
+ * @function decodeDelimited
742
+ * @memberof omnimind.AudioFormat
743
+ * @static
744
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
745
+ * @returns {omnimind.AudioFormat} AudioFormat
746
+ * @throws {Error} If the payload is not a reader or valid buffer
747
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
748
+ */
749
+ AudioFormat.decodeDelimited = function decodeDelimited(reader) {
750
+ if (!(reader instanceof $Reader))
751
+ reader = new $Reader(reader);
752
+ return this.decode(reader, reader.uint32());
753
+ };
754
+
755
+ /**
756
+ * Verifies an AudioFormat message.
757
+ * @function verify
758
+ * @memberof omnimind.AudioFormat
759
+ * @static
760
+ * @param {Object.<string,*>} message Plain object to verify
761
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
762
+ */
763
+ AudioFormat.verify = function verify(message) {
764
+ if (typeof message !== "object" || message === null)
765
+ return "object expected";
766
+ if (message.codec != null && message.hasOwnProperty("codec"))
767
+ switch (message.codec) {
768
+ default:
769
+ return "codec: enum value expected";
770
+ case 0:
771
+ case 1:
772
+ case 2:
773
+ case 3:
774
+ case 4:
775
+ break;
776
+ }
777
+ if (message.sampleRate != null && message.hasOwnProperty("sampleRate"))
778
+ if (!$util.isInteger(message.sampleRate))
779
+ return "sampleRate: integer expected";
780
+ if (message.channels != null && message.hasOwnProperty("channels"))
781
+ if (!$util.isInteger(message.channels))
782
+ return "channels: integer expected";
783
+ if (message.bitDepth != null && message.hasOwnProperty("bitDepth"))
784
+ if (!$util.isInteger(message.bitDepth))
785
+ return "bitDepth: integer expected";
786
+ return null;
787
+ };
788
+
789
+ /**
790
+ * Creates an AudioFormat message from a plain object. Also converts values to their respective internal types.
791
+ * @function fromObject
792
+ * @memberof omnimind.AudioFormat
793
+ * @static
794
+ * @param {Object.<string,*>} object Plain object
795
+ * @returns {omnimind.AudioFormat} AudioFormat
796
+ */
797
+ AudioFormat.fromObject = function fromObject(object) {
798
+ if (object instanceof $root.omnimind.AudioFormat)
799
+ return object;
800
+ var message = new $root.omnimind.AudioFormat();
801
+ switch (object.codec) {
802
+ default:
803
+ if (typeof object.codec === "number") {
804
+ message.codec = object.codec;
805
+ break;
806
+ }
807
+ break;
808
+ case "PCM":
809
+ case 0:
810
+ message.codec = 0;
811
+ break;
812
+ case "OPUS":
813
+ case 1:
814
+ message.codec = 1;
815
+ break;
816
+ case "AAC":
817
+ case 2:
818
+ message.codec = 2;
819
+ break;
820
+ case "MP3":
821
+ case 3:
822
+ message.codec = 3;
823
+ break;
824
+ case "G711":
825
+ case 4:
826
+ message.codec = 4;
827
+ break;
828
+ }
829
+ if (object.sampleRate != null)
830
+ message.sampleRate = object.sampleRate >>> 0;
831
+ if (object.channels != null)
832
+ message.channels = object.channels >>> 0;
833
+ if (object.bitDepth != null)
834
+ message.bitDepth = object.bitDepth >>> 0;
835
+ return message;
836
+ };
837
+
838
+ /**
839
+ * Creates a plain object from an AudioFormat message. Also converts values to other types if specified.
840
+ * @function toObject
841
+ * @memberof omnimind.AudioFormat
842
+ * @static
843
+ * @param {omnimind.AudioFormat} message AudioFormat
844
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
845
+ * @returns {Object.<string,*>} Plain object
846
+ */
847
+ AudioFormat.toObject = function toObject(message, options) {
848
+ if (!options)
849
+ options = {};
850
+ var object = {};
851
+ if (options.defaults) {
852
+ object.codec = options.enums === String ? "PCM" : 0;
853
+ object.sampleRate = 0;
854
+ object.channels = 0;
855
+ object.bitDepth = 0;
856
+ }
857
+ if (message.codec != null && message.hasOwnProperty("codec"))
858
+ object.codec = options.enums === String ? $root.omnimind.AudioCodec[message.codec] === undefined ? message.codec : $root.omnimind.AudioCodec[message.codec] : message.codec;
859
+ if (message.sampleRate != null && message.hasOwnProperty("sampleRate"))
860
+ object.sampleRate = message.sampleRate;
861
+ if (message.channels != null && message.hasOwnProperty("channels"))
862
+ object.channels = message.channels;
863
+ if (message.bitDepth != null && message.hasOwnProperty("bitDepth"))
864
+ object.bitDepth = message.bitDepth;
865
+ return object;
866
+ };
867
+
868
+ /**
869
+ * Converts this AudioFormat to JSON.
870
+ * @function toJSON
871
+ * @memberof omnimind.AudioFormat
872
+ * @instance
873
+ * @returns {Object.<string,*>} JSON object
874
+ */
875
+ AudioFormat.prototype.toJSON = function toJSON() {
876
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
877
+ };
878
+
879
+ /**
880
+ * Gets the default type url for AudioFormat
881
+ * @function getTypeUrl
882
+ * @memberof omnimind.AudioFormat
883
+ * @static
884
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
885
+ * @returns {string} The default type url
886
+ */
887
+ AudioFormat.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
888
+ if (typeUrlPrefix === undefined) {
889
+ typeUrlPrefix = "type.googleapis.com";
890
+ }
891
+ return typeUrlPrefix + "/omnimind.AudioFormat";
892
+ };
893
+
894
+ return AudioFormat;
895
+ })();
896
+
897
+ omnimind.OmniMessage = (function() {
898
+
899
+ /**
900
+ * Properties of an OmniMessage.
901
+ * @memberof omnimind
902
+ * @interface IOmniMessage
903
+ * @property {string|null} [sn] OmniMessage sn
904
+ * @property {omnimind.MessageType|null} [type] OmniMessage type
905
+ * @property {Uint8Array|null} [payload] OmniMessage payload
906
+ * @property {number|Long|null} [timestamp] OmniMessage timestamp
907
+ */
908
+
909
+ /**
910
+ * Constructs a new OmniMessage.
911
+ * @memberof omnimind
912
+ * @classdesc Represents an OmniMessage.
913
+ * @implements IOmniMessage
914
+ * @constructor
915
+ * @param {omnimind.IOmniMessage=} [properties] Properties to set
916
+ */
917
+ function OmniMessage(properties) {
918
+ if (properties)
919
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
920
+ if (properties[keys[i]] != null)
921
+ this[keys[i]] = properties[keys[i]];
922
+ }
923
+
924
+ /**
925
+ * OmniMessage sn.
926
+ * @member {string} sn
927
+ * @memberof omnimind.OmniMessage
928
+ * @instance
929
+ */
930
+ OmniMessage.prototype.sn = "";
931
+
932
+ /**
933
+ * OmniMessage type.
934
+ * @member {omnimind.MessageType} type
935
+ * @memberof omnimind.OmniMessage
936
+ * @instance
937
+ */
938
+ OmniMessage.prototype.type = 0;
939
+
940
+ /**
941
+ * OmniMessage payload.
942
+ * @member {Uint8Array} payload
943
+ * @memberof omnimind.OmniMessage
944
+ * @instance
945
+ */
946
+ OmniMessage.prototype.payload = $util.newBuffer([]);
947
+
948
+ /**
949
+ * OmniMessage timestamp.
950
+ * @member {number|Long} timestamp
951
+ * @memberof omnimind.OmniMessage
952
+ * @instance
953
+ */
954
+ OmniMessage.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
955
+
956
+ /**
957
+ * Creates a new OmniMessage instance using the specified properties.
958
+ * @function create
959
+ * @memberof omnimind.OmniMessage
960
+ * @static
961
+ * @param {omnimind.IOmniMessage=} [properties] Properties to set
962
+ * @returns {omnimind.OmniMessage} OmniMessage instance
963
+ */
964
+ OmniMessage.create = function create(properties) {
965
+ return new OmniMessage(properties);
966
+ };
967
+
968
+ /**
969
+ * Encodes the specified OmniMessage message. Does not implicitly {@link omnimind.OmniMessage.verify|verify} messages.
970
+ * @function encode
971
+ * @memberof omnimind.OmniMessage
972
+ * @static
973
+ * @param {omnimind.IOmniMessage} message OmniMessage message or plain object to encode
974
+ * @param {$protobuf.Writer} [writer] Writer to encode to
975
+ * @returns {$protobuf.Writer} Writer
976
+ */
977
+ OmniMessage.encode = function encode(message, writer) {
978
+ if (!writer)
979
+ writer = $Writer.create();
980
+ if (message.sn != null && Object.hasOwnProperty.call(message, "sn"))
981
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.sn);
982
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
983
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type);
984
+ if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
985
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payload);
986
+ if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
987
+ writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.timestamp);
988
+ return writer;
989
+ };
990
+
991
+ /**
992
+ * Encodes the specified OmniMessage message, length delimited. Does not implicitly {@link omnimind.OmniMessage.verify|verify} messages.
993
+ * @function encodeDelimited
994
+ * @memberof omnimind.OmniMessage
995
+ * @static
996
+ * @param {omnimind.IOmniMessage} message OmniMessage message or plain object to encode
997
+ * @param {$protobuf.Writer} [writer] Writer to encode to
998
+ * @returns {$protobuf.Writer} Writer
999
+ */
1000
+ OmniMessage.encodeDelimited = function encodeDelimited(message, writer) {
1001
+ return this.encode(message, writer).ldelim();
1002
+ };
1003
+
1004
+ /**
1005
+ * Decodes an OmniMessage message from the specified reader or buffer.
1006
+ * @function decode
1007
+ * @memberof omnimind.OmniMessage
1008
+ * @static
1009
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1010
+ * @param {number} [length] Message length if known beforehand
1011
+ * @returns {omnimind.OmniMessage} OmniMessage
1012
+ * @throws {Error} If the payload is not a reader or valid buffer
1013
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1014
+ */
1015
+ OmniMessage.decode = function decode(reader, length, error) {
1016
+ if (!(reader instanceof $Reader))
1017
+ reader = $Reader.create(reader);
1018
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.OmniMessage();
1019
+ while (reader.pos < end) {
1020
+ var tag = reader.uint32();
1021
+ if (tag === error)
1022
+ break;
1023
+ switch (tag >>> 3) {
1024
+ case 1: {
1025
+ message.sn = reader.string();
1026
+ break;
1027
+ }
1028
+ case 2: {
1029
+ message.type = reader.int32();
1030
+ break;
1031
+ }
1032
+ case 3: {
1033
+ message.payload = reader.bytes();
1034
+ break;
1035
+ }
1036
+ case 4: {
1037
+ message.timestamp = reader.uint64();
1038
+ break;
1039
+ }
1040
+ default:
1041
+ reader.skipType(tag & 7);
1042
+ break;
1043
+ }
1044
+ }
1045
+ return message;
1046
+ };
1047
+
1048
+ /**
1049
+ * Decodes an OmniMessage message from the specified reader or buffer, length delimited.
1050
+ * @function decodeDelimited
1051
+ * @memberof omnimind.OmniMessage
1052
+ * @static
1053
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1054
+ * @returns {omnimind.OmniMessage} OmniMessage
1055
+ * @throws {Error} If the payload is not a reader or valid buffer
1056
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1057
+ */
1058
+ OmniMessage.decodeDelimited = function decodeDelimited(reader) {
1059
+ if (!(reader instanceof $Reader))
1060
+ reader = new $Reader(reader);
1061
+ return this.decode(reader, reader.uint32());
1062
+ };
1063
+
1064
+ /**
1065
+ * Verifies an OmniMessage message.
1066
+ * @function verify
1067
+ * @memberof omnimind.OmniMessage
1068
+ * @static
1069
+ * @param {Object.<string,*>} message Plain object to verify
1070
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1071
+ */
1072
+ OmniMessage.verify = function verify(message) {
1073
+ if (typeof message !== "object" || message === null)
1074
+ return "object expected";
1075
+ if (message.sn != null && message.hasOwnProperty("sn"))
1076
+ if (!$util.isString(message.sn))
1077
+ return "sn: string expected";
1078
+ if (message.type != null && message.hasOwnProperty("type"))
1079
+ switch (message.type) {
1080
+ default:
1081
+ return "type: enum value expected";
1082
+ case 0:
1083
+ case 1:
1084
+ case 2:
1085
+ case 3:
1086
+ case 4:
1087
+ case 5:
1088
+ case 6:
1089
+ case 7:
1090
+ case 8:
1091
+ case 9:
1092
+ case 10:
1093
+ case 11:
1094
+ break;
1095
+ }
1096
+ if (message.payload != null && message.hasOwnProperty("payload"))
1097
+ if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload)))
1098
+ return "payload: buffer expected";
1099
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1100
+ if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
1101
+ return "timestamp: integer|Long expected";
1102
+ return null;
1103
+ };
1104
+
1105
+ /**
1106
+ * Creates an OmniMessage message from a plain object. Also converts values to their respective internal types.
1107
+ * @function fromObject
1108
+ * @memberof omnimind.OmniMessage
1109
+ * @static
1110
+ * @param {Object.<string,*>} object Plain object
1111
+ * @returns {omnimind.OmniMessage} OmniMessage
1112
+ */
1113
+ OmniMessage.fromObject = function fromObject(object) {
1114
+ if (object instanceof $root.omnimind.OmniMessage)
1115
+ return object;
1116
+ var message = new $root.omnimind.OmniMessage();
1117
+ if (object.sn != null)
1118
+ message.sn = String(object.sn);
1119
+ switch (object.type) {
1120
+ default:
1121
+ if (typeof object.type === "number") {
1122
+ message.type = object.type;
1123
+ break;
1124
+ }
1125
+ break;
1126
+ case "AUTH":
1127
+ case 0:
1128
+ message.type = 0;
1129
+ break;
1130
+ case "MCP_REG":
1131
+ case 1:
1132
+ message.type = 1;
1133
+ break;
1134
+ case "VOICE_STREAM":
1135
+ case 2:
1136
+ message.type = 2;
1137
+ break;
1138
+ case "IMAGE_FRAME":
1139
+ case 3:
1140
+ message.type = 3;
1141
+ break;
1142
+ case "TOOL_CALL":
1143
+ case 4:
1144
+ message.type = 4;
1145
+ break;
1146
+ case "TOOL_RESP":
1147
+ case 5:
1148
+ message.type = 5;
1149
+ break;
1150
+ case "TEXT_MSG":
1151
+ case 6:
1152
+ message.type = 6;
1153
+ break;
1154
+ case "PING":
1155
+ case 7:
1156
+ message.type = 7;
1157
+ break;
1158
+ case "PONG":
1159
+ case 8:
1160
+ message.type = 8;
1161
+ break;
1162
+ case "INTERRUPT":
1163
+ case 9:
1164
+ message.type = 9;
1165
+ break;
1166
+ case "VISION_ANALYSIS":
1167
+ case 10:
1168
+ message.type = 10;
1169
+ break;
1170
+ case "EVENT_REPORT":
1171
+ case 11:
1172
+ message.type = 11;
1173
+ break;
1174
+ }
1175
+ if (object.payload != null)
1176
+ if (typeof object.payload === "string")
1177
+ $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0);
1178
+ else if (object.payload.length >= 0)
1179
+ message.payload = object.payload;
1180
+ if (object.timestamp != null)
1181
+ if ($util.Long)
1182
+ (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
1183
+ else if (typeof object.timestamp === "string")
1184
+ message.timestamp = parseInt(object.timestamp, 10);
1185
+ else if (typeof object.timestamp === "number")
1186
+ message.timestamp = object.timestamp;
1187
+ else if (typeof object.timestamp === "object")
1188
+ message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
1189
+ return message;
1190
+ };
1191
+
1192
+ /**
1193
+ * Creates a plain object from an OmniMessage message. Also converts values to other types if specified.
1194
+ * @function toObject
1195
+ * @memberof omnimind.OmniMessage
1196
+ * @static
1197
+ * @param {omnimind.OmniMessage} message OmniMessage
1198
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1199
+ * @returns {Object.<string,*>} Plain object
1200
+ */
1201
+ OmniMessage.toObject = function toObject(message, options) {
1202
+ if (!options)
1203
+ options = {};
1204
+ var object = {};
1205
+ if (options.defaults) {
1206
+ object.sn = "";
1207
+ object.type = options.enums === String ? "AUTH" : 0;
1208
+ if (options.bytes === String)
1209
+ object.payload = "";
1210
+ else {
1211
+ object.payload = [];
1212
+ if (options.bytes !== Array)
1213
+ object.payload = $util.newBuffer(object.payload);
1214
+ }
1215
+ if ($util.Long) {
1216
+ var long = new $util.Long(0, 0, true);
1217
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
1218
+ } else
1219
+ object.timestamp = options.longs === String ? "0" : 0;
1220
+ }
1221
+ if (message.sn != null && message.hasOwnProperty("sn"))
1222
+ object.sn = message.sn;
1223
+ if (message.type != null && message.hasOwnProperty("type"))
1224
+ object.type = options.enums === String ? $root.omnimind.MessageType[message.type] === undefined ? message.type : $root.omnimind.MessageType[message.type] : message.type;
1225
+ if (message.payload != null && message.hasOwnProperty("payload"))
1226
+ object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload;
1227
+ if (message.timestamp != null && message.hasOwnProperty("timestamp"))
1228
+ if (typeof message.timestamp === "number")
1229
+ object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
1230
+ else
1231
+ object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
1232
+ return object;
1233
+ };
1234
+
1235
+ /**
1236
+ * Converts this OmniMessage to JSON.
1237
+ * @function toJSON
1238
+ * @memberof omnimind.OmniMessage
1239
+ * @instance
1240
+ * @returns {Object.<string,*>} JSON object
1241
+ */
1242
+ OmniMessage.prototype.toJSON = function toJSON() {
1243
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1244
+ };
1245
+
1246
+ /**
1247
+ * Gets the default type url for OmniMessage
1248
+ * @function getTypeUrl
1249
+ * @memberof omnimind.OmniMessage
1250
+ * @static
1251
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1252
+ * @returns {string} The default type url
1253
+ */
1254
+ OmniMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1255
+ if (typeUrlPrefix === undefined) {
1256
+ typeUrlPrefix = "type.googleapis.com";
1257
+ }
1258
+ return typeUrlPrefix + "/omnimind.OmniMessage";
1259
+ };
1260
+
1261
+ return OmniMessage;
1262
+ })();
1263
+
1264
+ omnimind.AuthPayload = (function() {
1265
+
1266
+ /**
1267
+ * Properties of an AuthPayload.
1268
+ * @memberof omnimind
1269
+ * @interface IAuthPayload
1270
+ * @property {string|null} [firmwareVersion] AuthPayload firmwareVersion
1271
+ * @property {string|null} [token] AuthPayload token
1272
+ * @property {omnimind.IAudioFormat|null} [inputAudioFormat] AuthPayload inputAudioFormat
1273
+ * @property {omnimind.IAudioFormat|null} [outputAudioFormat] AuthPayload outputAudioFormat
1274
+ * @property {boolean|null} [enableTts] AuthPayload enableTts
1275
+ */
1276
+
1277
+ /**
1278
+ * Constructs a new AuthPayload.
1279
+ * @memberof omnimind
1280
+ * @classdesc Represents an AuthPayload.
1281
+ * @implements IAuthPayload
1282
+ * @constructor
1283
+ * @param {omnimind.IAuthPayload=} [properties] Properties to set
1284
+ */
1285
+ function AuthPayload(properties) {
1286
+ if (properties)
1287
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1288
+ if (properties[keys[i]] != null)
1289
+ this[keys[i]] = properties[keys[i]];
1290
+ }
1291
+
1292
+ /**
1293
+ * AuthPayload firmwareVersion.
1294
+ * @member {string} firmwareVersion
1295
+ * @memberof omnimind.AuthPayload
1296
+ * @instance
1297
+ */
1298
+ AuthPayload.prototype.firmwareVersion = "";
1299
+
1300
+ /**
1301
+ * AuthPayload token.
1302
+ * @member {string} token
1303
+ * @memberof omnimind.AuthPayload
1304
+ * @instance
1305
+ */
1306
+ AuthPayload.prototype.token = "";
1307
+
1308
+ /**
1309
+ * AuthPayload inputAudioFormat.
1310
+ * @member {omnimind.IAudioFormat|null|undefined} inputAudioFormat
1311
+ * @memberof omnimind.AuthPayload
1312
+ * @instance
1313
+ */
1314
+ AuthPayload.prototype.inputAudioFormat = null;
1315
+
1316
+ /**
1317
+ * AuthPayload outputAudioFormat.
1318
+ * @member {omnimind.IAudioFormat|null|undefined} outputAudioFormat
1319
+ * @memberof omnimind.AuthPayload
1320
+ * @instance
1321
+ */
1322
+ AuthPayload.prototype.outputAudioFormat = null;
1323
+
1324
+ /**
1325
+ * AuthPayload enableTts.
1326
+ * @member {boolean} enableTts
1327
+ * @memberof omnimind.AuthPayload
1328
+ * @instance
1329
+ */
1330
+ AuthPayload.prototype.enableTts = false;
1331
+
1332
+ /**
1333
+ * Creates a new AuthPayload instance using the specified properties.
1334
+ * @function create
1335
+ * @memberof omnimind.AuthPayload
1336
+ * @static
1337
+ * @param {omnimind.IAuthPayload=} [properties] Properties to set
1338
+ * @returns {omnimind.AuthPayload} AuthPayload instance
1339
+ */
1340
+ AuthPayload.create = function create(properties) {
1341
+ return new AuthPayload(properties);
1342
+ };
1343
+
1344
+ /**
1345
+ * Encodes the specified AuthPayload message. Does not implicitly {@link omnimind.AuthPayload.verify|verify} messages.
1346
+ * @function encode
1347
+ * @memberof omnimind.AuthPayload
1348
+ * @static
1349
+ * @param {omnimind.IAuthPayload} message AuthPayload message or plain object to encode
1350
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1351
+ * @returns {$protobuf.Writer} Writer
1352
+ */
1353
+ AuthPayload.encode = function encode(message, writer) {
1354
+ if (!writer)
1355
+ writer = $Writer.create();
1356
+ if (message.firmwareVersion != null && Object.hasOwnProperty.call(message, "firmwareVersion"))
1357
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.firmwareVersion);
1358
+ if (message.token != null && Object.hasOwnProperty.call(message, "token"))
1359
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.token);
1360
+ if (message.inputAudioFormat != null && Object.hasOwnProperty.call(message, "inputAudioFormat"))
1361
+ $root.omnimind.AudioFormat.encode(message.inputAudioFormat, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
1362
+ if (message.outputAudioFormat != null && Object.hasOwnProperty.call(message, "outputAudioFormat"))
1363
+ $root.omnimind.AudioFormat.encode(message.outputAudioFormat, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
1364
+ if (message.enableTts != null && Object.hasOwnProperty.call(message, "enableTts"))
1365
+ writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableTts);
1366
+ return writer;
1367
+ };
1368
+
1369
+ /**
1370
+ * Encodes the specified AuthPayload message, length delimited. Does not implicitly {@link omnimind.AuthPayload.verify|verify} messages.
1371
+ * @function encodeDelimited
1372
+ * @memberof omnimind.AuthPayload
1373
+ * @static
1374
+ * @param {omnimind.IAuthPayload} message AuthPayload message or plain object to encode
1375
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1376
+ * @returns {$protobuf.Writer} Writer
1377
+ */
1378
+ AuthPayload.encodeDelimited = function encodeDelimited(message, writer) {
1379
+ return this.encode(message, writer).ldelim();
1380
+ };
1381
+
1382
+ /**
1383
+ * Decodes an AuthPayload message from the specified reader or buffer.
1384
+ * @function decode
1385
+ * @memberof omnimind.AuthPayload
1386
+ * @static
1387
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1388
+ * @param {number} [length] Message length if known beforehand
1389
+ * @returns {omnimind.AuthPayload} AuthPayload
1390
+ * @throws {Error} If the payload is not a reader or valid buffer
1391
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1392
+ */
1393
+ AuthPayload.decode = function decode(reader, length, error) {
1394
+ if (!(reader instanceof $Reader))
1395
+ reader = $Reader.create(reader);
1396
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.AuthPayload();
1397
+ while (reader.pos < end) {
1398
+ var tag = reader.uint32();
1399
+ if (tag === error)
1400
+ break;
1401
+ switch (tag >>> 3) {
1402
+ case 1: {
1403
+ message.firmwareVersion = reader.string();
1404
+ break;
1405
+ }
1406
+ case 2: {
1407
+ message.token = reader.string();
1408
+ break;
1409
+ }
1410
+ case 3: {
1411
+ message.inputAudioFormat = $root.omnimind.AudioFormat.decode(reader, reader.uint32());
1412
+ break;
1413
+ }
1414
+ case 4: {
1415
+ message.outputAudioFormat = $root.omnimind.AudioFormat.decode(reader, reader.uint32());
1416
+ break;
1417
+ }
1418
+ case 5: {
1419
+ message.enableTts = reader.bool();
1420
+ break;
1421
+ }
1422
+ default:
1423
+ reader.skipType(tag & 7);
1424
+ break;
1425
+ }
1426
+ }
1427
+ return message;
1428
+ };
1429
+
1430
+ /**
1431
+ * Decodes an AuthPayload message from the specified reader or buffer, length delimited.
1432
+ * @function decodeDelimited
1433
+ * @memberof omnimind.AuthPayload
1434
+ * @static
1435
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1436
+ * @returns {omnimind.AuthPayload} AuthPayload
1437
+ * @throws {Error} If the payload is not a reader or valid buffer
1438
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1439
+ */
1440
+ AuthPayload.decodeDelimited = function decodeDelimited(reader) {
1441
+ if (!(reader instanceof $Reader))
1442
+ reader = new $Reader(reader);
1443
+ return this.decode(reader, reader.uint32());
1444
+ };
1445
+
1446
+ /**
1447
+ * Verifies an AuthPayload message.
1448
+ * @function verify
1449
+ * @memberof omnimind.AuthPayload
1450
+ * @static
1451
+ * @param {Object.<string,*>} message Plain object to verify
1452
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1453
+ */
1454
+ AuthPayload.verify = function verify(message) {
1455
+ if (typeof message !== "object" || message === null)
1456
+ return "object expected";
1457
+ if (message.firmwareVersion != null && message.hasOwnProperty("firmwareVersion"))
1458
+ if (!$util.isString(message.firmwareVersion))
1459
+ return "firmwareVersion: string expected";
1460
+ if (message.token != null && message.hasOwnProperty("token"))
1461
+ if (!$util.isString(message.token))
1462
+ return "token: string expected";
1463
+ if (message.inputAudioFormat != null && message.hasOwnProperty("inputAudioFormat")) {
1464
+ var error = $root.omnimind.AudioFormat.verify(message.inputAudioFormat);
1465
+ if (error)
1466
+ return "inputAudioFormat." + error;
1467
+ }
1468
+ if (message.outputAudioFormat != null && message.hasOwnProperty("outputAudioFormat")) {
1469
+ var error = $root.omnimind.AudioFormat.verify(message.outputAudioFormat);
1470
+ if (error)
1471
+ return "outputAudioFormat." + error;
1472
+ }
1473
+ if (message.enableTts != null && message.hasOwnProperty("enableTts"))
1474
+ if (typeof message.enableTts !== "boolean")
1475
+ return "enableTts: boolean expected";
1476
+ return null;
1477
+ };
1478
+
1479
+ /**
1480
+ * Creates an AuthPayload message from a plain object. Also converts values to their respective internal types.
1481
+ * @function fromObject
1482
+ * @memberof omnimind.AuthPayload
1483
+ * @static
1484
+ * @param {Object.<string,*>} object Plain object
1485
+ * @returns {omnimind.AuthPayload} AuthPayload
1486
+ */
1487
+ AuthPayload.fromObject = function fromObject(object) {
1488
+ if (object instanceof $root.omnimind.AuthPayload)
1489
+ return object;
1490
+ var message = new $root.omnimind.AuthPayload();
1491
+ if (object.firmwareVersion != null)
1492
+ message.firmwareVersion = String(object.firmwareVersion);
1493
+ if (object.token != null)
1494
+ message.token = String(object.token);
1495
+ if (object.inputAudioFormat != null) {
1496
+ if (typeof object.inputAudioFormat !== "object")
1497
+ throw TypeError(".omnimind.AuthPayload.inputAudioFormat: object expected");
1498
+ message.inputAudioFormat = $root.omnimind.AudioFormat.fromObject(object.inputAudioFormat);
1499
+ }
1500
+ if (object.outputAudioFormat != null) {
1501
+ if (typeof object.outputAudioFormat !== "object")
1502
+ throw TypeError(".omnimind.AuthPayload.outputAudioFormat: object expected");
1503
+ message.outputAudioFormat = $root.omnimind.AudioFormat.fromObject(object.outputAudioFormat);
1504
+ }
1505
+ if (object.enableTts != null)
1506
+ message.enableTts = Boolean(object.enableTts);
1507
+ return message;
1508
+ };
1509
+
1510
+ /**
1511
+ * Creates a plain object from an AuthPayload message. Also converts values to other types if specified.
1512
+ * @function toObject
1513
+ * @memberof omnimind.AuthPayload
1514
+ * @static
1515
+ * @param {omnimind.AuthPayload} message AuthPayload
1516
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1517
+ * @returns {Object.<string,*>} Plain object
1518
+ */
1519
+ AuthPayload.toObject = function toObject(message, options) {
1520
+ if (!options)
1521
+ options = {};
1522
+ var object = {};
1523
+ if (options.defaults) {
1524
+ object.firmwareVersion = "";
1525
+ object.token = "";
1526
+ object.inputAudioFormat = null;
1527
+ object.outputAudioFormat = null;
1528
+ object.enableTts = false;
1529
+ }
1530
+ if (message.firmwareVersion != null && message.hasOwnProperty("firmwareVersion"))
1531
+ object.firmwareVersion = message.firmwareVersion;
1532
+ if (message.token != null && message.hasOwnProperty("token"))
1533
+ object.token = message.token;
1534
+ if (message.inputAudioFormat != null && message.hasOwnProperty("inputAudioFormat"))
1535
+ object.inputAudioFormat = $root.omnimind.AudioFormat.toObject(message.inputAudioFormat, options);
1536
+ if (message.outputAudioFormat != null && message.hasOwnProperty("outputAudioFormat"))
1537
+ object.outputAudioFormat = $root.omnimind.AudioFormat.toObject(message.outputAudioFormat, options);
1538
+ if (message.enableTts != null && message.hasOwnProperty("enableTts"))
1539
+ object.enableTts = message.enableTts;
1540
+ return object;
1541
+ };
1542
+
1543
+ /**
1544
+ * Converts this AuthPayload to JSON.
1545
+ * @function toJSON
1546
+ * @memberof omnimind.AuthPayload
1547
+ * @instance
1548
+ * @returns {Object.<string,*>} JSON object
1549
+ */
1550
+ AuthPayload.prototype.toJSON = function toJSON() {
1551
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1552
+ };
1553
+
1554
+ /**
1555
+ * Gets the default type url for AuthPayload
1556
+ * @function getTypeUrl
1557
+ * @memberof omnimind.AuthPayload
1558
+ * @static
1559
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1560
+ * @returns {string} The default type url
1561
+ */
1562
+ AuthPayload.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1563
+ if (typeUrlPrefix === undefined) {
1564
+ typeUrlPrefix = "type.googleapis.com";
1565
+ }
1566
+ return typeUrlPrefix + "/omnimind.AuthPayload";
1567
+ };
1568
+
1569
+ return AuthPayload;
1570
+ })();
1571
+
1572
+ omnimind.ToolManifest = (function() {
1573
+
1574
+ /**
1575
+ * Properties of a ToolManifest.
1576
+ * @memberof omnimind
1577
+ * @interface IToolManifest
1578
+ * @property {Array.<omnimind.ITool>|null} [tools] ToolManifest tools
1579
+ * @property {Array.<omnimind.IEventDefinition>|null} [events] ToolManifest events
1580
+ */
1581
+
1582
+ /**
1583
+ * Constructs a new ToolManifest.
1584
+ * @memberof omnimind
1585
+ * @classdesc Represents a ToolManifest.
1586
+ * @implements IToolManifest
1587
+ * @constructor
1588
+ * @param {omnimind.IToolManifest=} [properties] Properties to set
1589
+ */
1590
+ function ToolManifest(properties) {
1591
+ this.tools = [];
1592
+ this.events = [];
1593
+ if (properties)
1594
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1595
+ if (properties[keys[i]] != null)
1596
+ this[keys[i]] = properties[keys[i]];
1597
+ }
1598
+
1599
+ /**
1600
+ * ToolManifest tools.
1601
+ * @member {Array.<omnimind.ITool>} tools
1602
+ * @memberof omnimind.ToolManifest
1603
+ * @instance
1604
+ */
1605
+ ToolManifest.prototype.tools = $util.emptyArray;
1606
+
1607
+ /**
1608
+ * ToolManifest events.
1609
+ * @member {Array.<omnimind.IEventDefinition>} events
1610
+ * @memberof omnimind.ToolManifest
1611
+ * @instance
1612
+ */
1613
+ ToolManifest.prototype.events = $util.emptyArray;
1614
+
1615
+ /**
1616
+ * Creates a new ToolManifest instance using the specified properties.
1617
+ * @function create
1618
+ * @memberof omnimind.ToolManifest
1619
+ * @static
1620
+ * @param {omnimind.IToolManifest=} [properties] Properties to set
1621
+ * @returns {omnimind.ToolManifest} ToolManifest instance
1622
+ */
1623
+ ToolManifest.create = function create(properties) {
1624
+ return new ToolManifest(properties);
1625
+ };
1626
+
1627
+ /**
1628
+ * Encodes the specified ToolManifest message. Does not implicitly {@link omnimind.ToolManifest.verify|verify} messages.
1629
+ * @function encode
1630
+ * @memberof omnimind.ToolManifest
1631
+ * @static
1632
+ * @param {omnimind.IToolManifest} message ToolManifest message or plain object to encode
1633
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1634
+ * @returns {$protobuf.Writer} Writer
1635
+ */
1636
+ ToolManifest.encode = function encode(message, writer) {
1637
+ if (!writer)
1638
+ writer = $Writer.create();
1639
+ if (message.tools != null && message.tools.length)
1640
+ for (var i = 0; i < message.tools.length; ++i)
1641
+ $root.omnimind.Tool.encode(message.tools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
1642
+ if (message.events != null && message.events.length)
1643
+ for (var i = 0; i < message.events.length; ++i)
1644
+ $root.omnimind.EventDefinition.encode(message.events[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1645
+ return writer;
1646
+ };
1647
+
1648
+ /**
1649
+ * Encodes the specified ToolManifest message, length delimited. Does not implicitly {@link omnimind.ToolManifest.verify|verify} messages.
1650
+ * @function encodeDelimited
1651
+ * @memberof omnimind.ToolManifest
1652
+ * @static
1653
+ * @param {omnimind.IToolManifest} message ToolManifest message or plain object to encode
1654
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1655
+ * @returns {$protobuf.Writer} Writer
1656
+ */
1657
+ ToolManifest.encodeDelimited = function encodeDelimited(message, writer) {
1658
+ return this.encode(message, writer).ldelim();
1659
+ };
1660
+
1661
+ /**
1662
+ * Decodes a ToolManifest message from the specified reader or buffer.
1663
+ * @function decode
1664
+ * @memberof omnimind.ToolManifest
1665
+ * @static
1666
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1667
+ * @param {number} [length] Message length if known beforehand
1668
+ * @returns {omnimind.ToolManifest} ToolManifest
1669
+ * @throws {Error} If the payload is not a reader or valid buffer
1670
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1671
+ */
1672
+ ToolManifest.decode = function decode(reader, length, error) {
1673
+ if (!(reader instanceof $Reader))
1674
+ reader = $Reader.create(reader);
1675
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.ToolManifest();
1676
+ while (reader.pos < end) {
1677
+ var tag = reader.uint32();
1678
+ if (tag === error)
1679
+ break;
1680
+ switch (tag >>> 3) {
1681
+ case 1: {
1682
+ if (!(message.tools && message.tools.length))
1683
+ message.tools = [];
1684
+ message.tools.push($root.omnimind.Tool.decode(reader, reader.uint32()));
1685
+ break;
1686
+ }
1687
+ case 2: {
1688
+ if (!(message.events && message.events.length))
1689
+ message.events = [];
1690
+ message.events.push($root.omnimind.EventDefinition.decode(reader, reader.uint32()));
1691
+ break;
1692
+ }
1693
+ default:
1694
+ reader.skipType(tag & 7);
1695
+ break;
1696
+ }
1697
+ }
1698
+ return message;
1699
+ };
1700
+
1701
+ /**
1702
+ * Decodes a ToolManifest message from the specified reader or buffer, length delimited.
1703
+ * @function decodeDelimited
1704
+ * @memberof omnimind.ToolManifest
1705
+ * @static
1706
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1707
+ * @returns {omnimind.ToolManifest} ToolManifest
1708
+ * @throws {Error} If the payload is not a reader or valid buffer
1709
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1710
+ */
1711
+ ToolManifest.decodeDelimited = function decodeDelimited(reader) {
1712
+ if (!(reader instanceof $Reader))
1713
+ reader = new $Reader(reader);
1714
+ return this.decode(reader, reader.uint32());
1715
+ };
1716
+
1717
+ /**
1718
+ * Verifies a ToolManifest message.
1719
+ * @function verify
1720
+ * @memberof omnimind.ToolManifest
1721
+ * @static
1722
+ * @param {Object.<string,*>} message Plain object to verify
1723
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1724
+ */
1725
+ ToolManifest.verify = function verify(message) {
1726
+ if (typeof message !== "object" || message === null)
1727
+ return "object expected";
1728
+ if (message.tools != null && message.hasOwnProperty("tools")) {
1729
+ if (!Array.isArray(message.tools))
1730
+ return "tools: array expected";
1731
+ for (var i = 0; i < message.tools.length; ++i) {
1732
+ var error = $root.omnimind.Tool.verify(message.tools[i]);
1733
+ if (error)
1734
+ return "tools." + error;
1735
+ }
1736
+ }
1737
+ if (message.events != null && message.hasOwnProperty("events")) {
1738
+ if (!Array.isArray(message.events))
1739
+ return "events: array expected";
1740
+ for (var i = 0; i < message.events.length; ++i) {
1741
+ var error = $root.omnimind.EventDefinition.verify(message.events[i]);
1742
+ if (error)
1743
+ return "events." + error;
1744
+ }
1745
+ }
1746
+ return null;
1747
+ };
1748
+
1749
+ /**
1750
+ * Creates a ToolManifest message from a plain object. Also converts values to their respective internal types.
1751
+ * @function fromObject
1752
+ * @memberof omnimind.ToolManifest
1753
+ * @static
1754
+ * @param {Object.<string,*>} object Plain object
1755
+ * @returns {omnimind.ToolManifest} ToolManifest
1756
+ */
1757
+ ToolManifest.fromObject = function fromObject(object) {
1758
+ if (object instanceof $root.omnimind.ToolManifest)
1759
+ return object;
1760
+ var message = new $root.omnimind.ToolManifest();
1761
+ if (object.tools) {
1762
+ if (!Array.isArray(object.tools))
1763
+ throw TypeError(".omnimind.ToolManifest.tools: array expected");
1764
+ message.tools = [];
1765
+ for (var i = 0; i < object.tools.length; ++i) {
1766
+ if (typeof object.tools[i] !== "object")
1767
+ throw TypeError(".omnimind.ToolManifest.tools: object expected");
1768
+ message.tools[i] = $root.omnimind.Tool.fromObject(object.tools[i]);
1769
+ }
1770
+ }
1771
+ if (object.events) {
1772
+ if (!Array.isArray(object.events))
1773
+ throw TypeError(".omnimind.ToolManifest.events: array expected");
1774
+ message.events = [];
1775
+ for (var i = 0; i < object.events.length; ++i) {
1776
+ if (typeof object.events[i] !== "object")
1777
+ throw TypeError(".omnimind.ToolManifest.events: object expected");
1778
+ message.events[i] = $root.omnimind.EventDefinition.fromObject(object.events[i]);
1779
+ }
1780
+ }
1781
+ return message;
1782
+ };
1783
+
1784
+ /**
1785
+ * Creates a plain object from a ToolManifest message. Also converts values to other types if specified.
1786
+ * @function toObject
1787
+ * @memberof omnimind.ToolManifest
1788
+ * @static
1789
+ * @param {omnimind.ToolManifest} message ToolManifest
1790
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1791
+ * @returns {Object.<string,*>} Plain object
1792
+ */
1793
+ ToolManifest.toObject = function toObject(message, options) {
1794
+ if (!options)
1795
+ options = {};
1796
+ var object = {};
1797
+ if (options.arrays || options.defaults) {
1798
+ object.tools = [];
1799
+ object.events = [];
1800
+ }
1801
+ if (message.tools && message.tools.length) {
1802
+ object.tools = [];
1803
+ for (var j = 0; j < message.tools.length; ++j)
1804
+ object.tools[j] = $root.omnimind.Tool.toObject(message.tools[j], options);
1805
+ }
1806
+ if (message.events && message.events.length) {
1807
+ object.events = [];
1808
+ for (var j = 0; j < message.events.length; ++j)
1809
+ object.events[j] = $root.omnimind.EventDefinition.toObject(message.events[j], options);
1810
+ }
1811
+ return object;
1812
+ };
1813
+
1814
+ /**
1815
+ * Converts this ToolManifest to JSON.
1816
+ * @function toJSON
1817
+ * @memberof omnimind.ToolManifest
1818
+ * @instance
1819
+ * @returns {Object.<string,*>} JSON object
1820
+ */
1821
+ ToolManifest.prototype.toJSON = function toJSON() {
1822
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1823
+ };
1824
+
1825
+ /**
1826
+ * Gets the default type url for ToolManifest
1827
+ * @function getTypeUrl
1828
+ * @memberof omnimind.ToolManifest
1829
+ * @static
1830
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
1831
+ * @returns {string} The default type url
1832
+ */
1833
+ ToolManifest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
1834
+ if (typeUrlPrefix === undefined) {
1835
+ typeUrlPrefix = "type.googleapis.com";
1836
+ }
1837
+ return typeUrlPrefix + "/omnimind.ToolManifest";
1838
+ };
1839
+
1840
+ return ToolManifest;
1841
+ })();
1842
+
1843
+ omnimind.Tool = (function() {
1844
+
1845
+ /**
1846
+ * Properties of a Tool.
1847
+ * @memberof omnimind
1848
+ * @interface ITool
1849
+ * @property {string|null} [name] Tool name
1850
+ * @property {string|null} [description] Tool description
1851
+ * @property {string|null} [argsSchema] Tool argsSchema
1852
+ */
1853
+
1854
+ /**
1855
+ * Constructs a new Tool.
1856
+ * @memberof omnimind
1857
+ * @classdesc Represents a Tool.
1858
+ * @implements ITool
1859
+ * @constructor
1860
+ * @param {omnimind.ITool=} [properties] Properties to set
1861
+ */
1862
+ function Tool(properties) {
1863
+ if (properties)
1864
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1865
+ if (properties[keys[i]] != null)
1866
+ this[keys[i]] = properties[keys[i]];
1867
+ }
1868
+
1869
+ /**
1870
+ * Tool name.
1871
+ * @member {string} name
1872
+ * @memberof omnimind.Tool
1873
+ * @instance
1874
+ */
1875
+ Tool.prototype.name = "";
1876
+
1877
+ /**
1878
+ * Tool description.
1879
+ * @member {string} description
1880
+ * @memberof omnimind.Tool
1881
+ * @instance
1882
+ */
1883
+ Tool.prototype.description = "";
1884
+
1885
+ /**
1886
+ * Tool argsSchema.
1887
+ * @member {string} argsSchema
1888
+ * @memberof omnimind.Tool
1889
+ * @instance
1890
+ */
1891
+ Tool.prototype.argsSchema = "";
1892
+
1893
+ /**
1894
+ * Creates a new Tool instance using the specified properties.
1895
+ * @function create
1896
+ * @memberof omnimind.Tool
1897
+ * @static
1898
+ * @param {omnimind.ITool=} [properties] Properties to set
1899
+ * @returns {omnimind.Tool} Tool instance
1900
+ */
1901
+ Tool.create = function create(properties) {
1902
+ return new Tool(properties);
1903
+ };
1904
+
1905
+ /**
1906
+ * Encodes the specified Tool message. Does not implicitly {@link omnimind.Tool.verify|verify} messages.
1907
+ * @function encode
1908
+ * @memberof omnimind.Tool
1909
+ * @static
1910
+ * @param {omnimind.ITool} message Tool message or plain object to encode
1911
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1912
+ * @returns {$protobuf.Writer} Writer
1913
+ */
1914
+ Tool.encode = function encode(message, writer) {
1915
+ if (!writer)
1916
+ writer = $Writer.create();
1917
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
1918
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
1919
+ if (message.description != null && Object.hasOwnProperty.call(message, "description"))
1920
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
1921
+ if (message.argsSchema != null && Object.hasOwnProperty.call(message, "argsSchema"))
1922
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.argsSchema);
1923
+ return writer;
1924
+ };
1925
+
1926
+ /**
1927
+ * Encodes the specified Tool message, length delimited. Does not implicitly {@link omnimind.Tool.verify|verify} messages.
1928
+ * @function encodeDelimited
1929
+ * @memberof omnimind.Tool
1930
+ * @static
1931
+ * @param {omnimind.ITool} message Tool message or plain object to encode
1932
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1933
+ * @returns {$protobuf.Writer} Writer
1934
+ */
1935
+ Tool.encodeDelimited = function encodeDelimited(message, writer) {
1936
+ return this.encode(message, writer).ldelim();
1937
+ };
1938
+
1939
+ /**
1940
+ * Decodes a Tool message from the specified reader or buffer.
1941
+ * @function decode
1942
+ * @memberof omnimind.Tool
1943
+ * @static
1944
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1945
+ * @param {number} [length] Message length if known beforehand
1946
+ * @returns {omnimind.Tool} Tool
1947
+ * @throws {Error} If the payload is not a reader or valid buffer
1948
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1949
+ */
1950
+ Tool.decode = function decode(reader, length, error) {
1951
+ if (!(reader instanceof $Reader))
1952
+ reader = $Reader.create(reader);
1953
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.Tool();
1954
+ while (reader.pos < end) {
1955
+ var tag = reader.uint32();
1956
+ if (tag === error)
1957
+ break;
1958
+ switch (tag >>> 3) {
1959
+ case 1: {
1960
+ message.name = reader.string();
1961
+ break;
1962
+ }
1963
+ case 2: {
1964
+ message.description = reader.string();
1965
+ break;
1966
+ }
1967
+ case 3: {
1968
+ message.argsSchema = reader.string();
1969
+ break;
1970
+ }
1971
+ default:
1972
+ reader.skipType(tag & 7);
1973
+ break;
1974
+ }
1975
+ }
1976
+ return message;
1977
+ };
1978
+
1979
+ /**
1980
+ * Decodes a Tool message from the specified reader or buffer, length delimited.
1981
+ * @function decodeDelimited
1982
+ * @memberof omnimind.Tool
1983
+ * @static
1984
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1985
+ * @returns {omnimind.Tool} Tool
1986
+ * @throws {Error} If the payload is not a reader or valid buffer
1987
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1988
+ */
1989
+ Tool.decodeDelimited = function decodeDelimited(reader) {
1990
+ if (!(reader instanceof $Reader))
1991
+ reader = new $Reader(reader);
1992
+ return this.decode(reader, reader.uint32());
1993
+ };
1994
+
1995
+ /**
1996
+ * Verifies a Tool message.
1997
+ * @function verify
1998
+ * @memberof omnimind.Tool
1999
+ * @static
2000
+ * @param {Object.<string,*>} message Plain object to verify
2001
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2002
+ */
2003
+ Tool.verify = function verify(message) {
2004
+ if (typeof message !== "object" || message === null)
2005
+ return "object expected";
2006
+ if (message.name != null && message.hasOwnProperty("name"))
2007
+ if (!$util.isString(message.name))
2008
+ return "name: string expected";
2009
+ if (message.description != null && message.hasOwnProperty("description"))
2010
+ if (!$util.isString(message.description))
2011
+ return "description: string expected";
2012
+ if (message.argsSchema != null && message.hasOwnProperty("argsSchema"))
2013
+ if (!$util.isString(message.argsSchema))
2014
+ return "argsSchema: string expected";
2015
+ return null;
2016
+ };
2017
+
2018
+ /**
2019
+ * Creates a Tool message from a plain object. Also converts values to their respective internal types.
2020
+ * @function fromObject
2021
+ * @memberof omnimind.Tool
2022
+ * @static
2023
+ * @param {Object.<string,*>} object Plain object
2024
+ * @returns {omnimind.Tool} Tool
2025
+ */
2026
+ Tool.fromObject = function fromObject(object) {
2027
+ if (object instanceof $root.omnimind.Tool)
2028
+ return object;
2029
+ var message = new $root.omnimind.Tool();
2030
+ if (object.name != null)
2031
+ message.name = String(object.name);
2032
+ if (object.description != null)
2033
+ message.description = String(object.description);
2034
+ if (object.argsSchema != null)
2035
+ message.argsSchema = String(object.argsSchema);
2036
+ return message;
2037
+ };
2038
+
2039
+ /**
2040
+ * Creates a plain object from a Tool message. Also converts values to other types if specified.
2041
+ * @function toObject
2042
+ * @memberof omnimind.Tool
2043
+ * @static
2044
+ * @param {omnimind.Tool} message Tool
2045
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2046
+ * @returns {Object.<string,*>} Plain object
2047
+ */
2048
+ Tool.toObject = function toObject(message, options) {
2049
+ if (!options)
2050
+ options = {};
2051
+ var object = {};
2052
+ if (options.defaults) {
2053
+ object.name = "";
2054
+ object.description = "";
2055
+ object.argsSchema = "";
2056
+ }
2057
+ if (message.name != null && message.hasOwnProperty("name"))
2058
+ object.name = message.name;
2059
+ if (message.description != null && message.hasOwnProperty("description"))
2060
+ object.description = message.description;
2061
+ if (message.argsSchema != null && message.hasOwnProperty("argsSchema"))
2062
+ object.argsSchema = message.argsSchema;
2063
+ return object;
2064
+ };
2065
+
2066
+ /**
2067
+ * Converts this Tool to JSON.
2068
+ * @function toJSON
2069
+ * @memberof omnimind.Tool
2070
+ * @instance
2071
+ * @returns {Object.<string,*>} JSON object
2072
+ */
2073
+ Tool.prototype.toJSON = function toJSON() {
2074
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2075
+ };
2076
+
2077
+ /**
2078
+ * Gets the default type url for Tool
2079
+ * @function getTypeUrl
2080
+ * @memberof omnimind.Tool
2081
+ * @static
2082
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2083
+ * @returns {string} The default type url
2084
+ */
2085
+ Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2086
+ if (typeUrlPrefix === undefined) {
2087
+ typeUrlPrefix = "type.googleapis.com";
2088
+ }
2089
+ return typeUrlPrefix + "/omnimind.Tool";
2090
+ };
2091
+
2092
+ return Tool;
2093
+ })();
2094
+
2095
+ omnimind.EventDefinition = (function() {
2096
+
2097
+ /**
2098
+ * Properties of an EventDefinition.
2099
+ * @memberof omnimind
2100
+ * @interface IEventDefinition
2101
+ * @property {string|null} [name] EventDefinition name
2102
+ * @property {string|null} [description] EventDefinition description
2103
+ * @property {string|null} [payloadSchema] EventDefinition payloadSchema
2104
+ */
2105
+
2106
+ /**
2107
+ * Constructs a new EventDefinition.
2108
+ * @memberof omnimind
2109
+ * @classdesc Represents an EventDefinition.
2110
+ * @implements IEventDefinition
2111
+ * @constructor
2112
+ * @param {omnimind.IEventDefinition=} [properties] Properties to set
2113
+ */
2114
+ function EventDefinition(properties) {
2115
+ if (properties)
2116
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2117
+ if (properties[keys[i]] != null)
2118
+ this[keys[i]] = properties[keys[i]];
2119
+ }
2120
+
2121
+ /**
2122
+ * EventDefinition name.
2123
+ * @member {string} name
2124
+ * @memberof omnimind.EventDefinition
2125
+ * @instance
2126
+ */
2127
+ EventDefinition.prototype.name = "";
2128
+
2129
+ /**
2130
+ * EventDefinition description.
2131
+ * @member {string} description
2132
+ * @memberof omnimind.EventDefinition
2133
+ * @instance
2134
+ */
2135
+ EventDefinition.prototype.description = "";
2136
+
2137
+ /**
2138
+ * EventDefinition payloadSchema.
2139
+ * @member {string} payloadSchema
2140
+ * @memberof omnimind.EventDefinition
2141
+ * @instance
2142
+ */
2143
+ EventDefinition.prototype.payloadSchema = "";
2144
+
2145
+ /**
2146
+ * Creates a new EventDefinition instance using the specified properties.
2147
+ * @function create
2148
+ * @memberof omnimind.EventDefinition
2149
+ * @static
2150
+ * @param {omnimind.IEventDefinition=} [properties] Properties to set
2151
+ * @returns {omnimind.EventDefinition} EventDefinition instance
2152
+ */
2153
+ EventDefinition.create = function create(properties) {
2154
+ return new EventDefinition(properties);
2155
+ };
2156
+
2157
+ /**
2158
+ * Encodes the specified EventDefinition message. Does not implicitly {@link omnimind.EventDefinition.verify|verify} messages.
2159
+ * @function encode
2160
+ * @memberof omnimind.EventDefinition
2161
+ * @static
2162
+ * @param {omnimind.IEventDefinition} message EventDefinition message or plain object to encode
2163
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2164
+ * @returns {$protobuf.Writer} Writer
2165
+ */
2166
+ EventDefinition.encode = function encode(message, writer) {
2167
+ if (!writer)
2168
+ writer = $Writer.create();
2169
+ if (message.name != null && Object.hasOwnProperty.call(message, "name"))
2170
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
2171
+ if (message.description != null && Object.hasOwnProperty.call(message, "description"))
2172
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.description);
2173
+ if (message.payloadSchema != null && Object.hasOwnProperty.call(message, "payloadSchema"))
2174
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.payloadSchema);
2175
+ return writer;
2176
+ };
2177
+
2178
+ /**
2179
+ * Encodes the specified EventDefinition message, length delimited. Does not implicitly {@link omnimind.EventDefinition.verify|verify} messages.
2180
+ * @function encodeDelimited
2181
+ * @memberof omnimind.EventDefinition
2182
+ * @static
2183
+ * @param {omnimind.IEventDefinition} message EventDefinition message or plain object to encode
2184
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2185
+ * @returns {$protobuf.Writer} Writer
2186
+ */
2187
+ EventDefinition.encodeDelimited = function encodeDelimited(message, writer) {
2188
+ return this.encode(message, writer).ldelim();
2189
+ };
2190
+
2191
+ /**
2192
+ * Decodes an EventDefinition message from the specified reader or buffer.
2193
+ * @function decode
2194
+ * @memberof omnimind.EventDefinition
2195
+ * @static
2196
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2197
+ * @param {number} [length] Message length if known beforehand
2198
+ * @returns {omnimind.EventDefinition} EventDefinition
2199
+ * @throws {Error} If the payload is not a reader or valid buffer
2200
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2201
+ */
2202
+ EventDefinition.decode = function decode(reader, length, error) {
2203
+ if (!(reader instanceof $Reader))
2204
+ reader = $Reader.create(reader);
2205
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.EventDefinition();
2206
+ while (reader.pos < end) {
2207
+ var tag = reader.uint32();
2208
+ if (tag === error)
2209
+ break;
2210
+ switch (tag >>> 3) {
2211
+ case 1: {
2212
+ message.name = reader.string();
2213
+ break;
2214
+ }
2215
+ case 2: {
2216
+ message.description = reader.string();
2217
+ break;
2218
+ }
2219
+ case 3: {
2220
+ message.payloadSchema = reader.string();
2221
+ break;
2222
+ }
2223
+ default:
2224
+ reader.skipType(tag & 7);
2225
+ break;
2226
+ }
2227
+ }
2228
+ return message;
2229
+ };
2230
+
2231
+ /**
2232
+ * Decodes an EventDefinition message from the specified reader or buffer, length delimited.
2233
+ * @function decodeDelimited
2234
+ * @memberof omnimind.EventDefinition
2235
+ * @static
2236
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2237
+ * @returns {omnimind.EventDefinition} EventDefinition
2238
+ * @throws {Error} If the payload is not a reader or valid buffer
2239
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2240
+ */
2241
+ EventDefinition.decodeDelimited = function decodeDelimited(reader) {
2242
+ if (!(reader instanceof $Reader))
2243
+ reader = new $Reader(reader);
2244
+ return this.decode(reader, reader.uint32());
2245
+ };
2246
+
2247
+ /**
2248
+ * Verifies an EventDefinition message.
2249
+ * @function verify
2250
+ * @memberof omnimind.EventDefinition
2251
+ * @static
2252
+ * @param {Object.<string,*>} message Plain object to verify
2253
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2254
+ */
2255
+ EventDefinition.verify = function verify(message) {
2256
+ if (typeof message !== "object" || message === null)
2257
+ return "object expected";
2258
+ if (message.name != null && message.hasOwnProperty("name"))
2259
+ if (!$util.isString(message.name))
2260
+ return "name: string expected";
2261
+ if (message.description != null && message.hasOwnProperty("description"))
2262
+ if (!$util.isString(message.description))
2263
+ return "description: string expected";
2264
+ if (message.payloadSchema != null && message.hasOwnProperty("payloadSchema"))
2265
+ if (!$util.isString(message.payloadSchema))
2266
+ return "payloadSchema: string expected";
2267
+ return null;
2268
+ };
2269
+
2270
+ /**
2271
+ * Creates an EventDefinition message from a plain object. Also converts values to their respective internal types.
2272
+ * @function fromObject
2273
+ * @memberof omnimind.EventDefinition
2274
+ * @static
2275
+ * @param {Object.<string,*>} object Plain object
2276
+ * @returns {omnimind.EventDefinition} EventDefinition
2277
+ */
2278
+ EventDefinition.fromObject = function fromObject(object) {
2279
+ if (object instanceof $root.omnimind.EventDefinition)
2280
+ return object;
2281
+ var message = new $root.omnimind.EventDefinition();
2282
+ if (object.name != null)
2283
+ message.name = String(object.name);
2284
+ if (object.description != null)
2285
+ message.description = String(object.description);
2286
+ if (object.payloadSchema != null)
2287
+ message.payloadSchema = String(object.payloadSchema);
2288
+ return message;
2289
+ };
2290
+
2291
+ /**
2292
+ * Creates a plain object from an EventDefinition message. Also converts values to other types if specified.
2293
+ * @function toObject
2294
+ * @memberof omnimind.EventDefinition
2295
+ * @static
2296
+ * @param {omnimind.EventDefinition} message EventDefinition
2297
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2298
+ * @returns {Object.<string,*>} Plain object
2299
+ */
2300
+ EventDefinition.toObject = function toObject(message, options) {
2301
+ if (!options)
2302
+ options = {};
2303
+ var object = {};
2304
+ if (options.defaults) {
2305
+ object.name = "";
2306
+ object.description = "";
2307
+ object.payloadSchema = "";
2308
+ }
2309
+ if (message.name != null && message.hasOwnProperty("name"))
2310
+ object.name = message.name;
2311
+ if (message.description != null && message.hasOwnProperty("description"))
2312
+ object.description = message.description;
2313
+ if (message.payloadSchema != null && message.hasOwnProperty("payloadSchema"))
2314
+ object.payloadSchema = message.payloadSchema;
2315
+ return object;
2316
+ };
2317
+
2318
+ /**
2319
+ * Converts this EventDefinition to JSON.
2320
+ * @function toJSON
2321
+ * @memberof omnimind.EventDefinition
2322
+ * @instance
2323
+ * @returns {Object.<string,*>} JSON object
2324
+ */
2325
+ EventDefinition.prototype.toJSON = function toJSON() {
2326
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2327
+ };
2328
+
2329
+ /**
2330
+ * Gets the default type url for EventDefinition
2331
+ * @function getTypeUrl
2332
+ * @memberof omnimind.EventDefinition
2333
+ * @static
2334
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2335
+ * @returns {string} The default type url
2336
+ */
2337
+ EventDefinition.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2338
+ if (typeUrlPrefix === undefined) {
2339
+ typeUrlPrefix = "type.googleapis.com";
2340
+ }
2341
+ return typeUrlPrefix + "/omnimind.EventDefinition";
2342
+ };
2343
+
2344
+ return EventDefinition;
2345
+ })();
2346
+
2347
+ omnimind.ToolCall = (function() {
2348
+
2349
+ /**
2350
+ * Properties of a ToolCall.
2351
+ * @memberof omnimind
2352
+ * @interface IToolCall
2353
+ * @property {string|null} [callId] ToolCall callId
2354
+ * @property {string|null} [functionName] ToolCall functionName
2355
+ * @property {string|null} [argsJson] ToolCall argsJson
2356
+ */
2357
+
2358
+ /**
2359
+ * Constructs a new ToolCall.
2360
+ * @memberof omnimind
2361
+ * @classdesc Represents a ToolCall.
2362
+ * @implements IToolCall
2363
+ * @constructor
2364
+ * @param {omnimind.IToolCall=} [properties] Properties to set
2365
+ */
2366
+ function ToolCall(properties) {
2367
+ if (properties)
2368
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2369
+ if (properties[keys[i]] != null)
2370
+ this[keys[i]] = properties[keys[i]];
2371
+ }
2372
+
2373
+ /**
2374
+ * ToolCall callId.
2375
+ * @member {string} callId
2376
+ * @memberof omnimind.ToolCall
2377
+ * @instance
2378
+ */
2379
+ ToolCall.prototype.callId = "";
2380
+
2381
+ /**
2382
+ * ToolCall functionName.
2383
+ * @member {string} functionName
2384
+ * @memberof omnimind.ToolCall
2385
+ * @instance
2386
+ */
2387
+ ToolCall.prototype.functionName = "";
2388
+
2389
+ /**
2390
+ * ToolCall argsJson.
2391
+ * @member {string} argsJson
2392
+ * @memberof omnimind.ToolCall
2393
+ * @instance
2394
+ */
2395
+ ToolCall.prototype.argsJson = "";
2396
+
2397
+ /**
2398
+ * Creates a new ToolCall instance using the specified properties.
2399
+ * @function create
2400
+ * @memberof omnimind.ToolCall
2401
+ * @static
2402
+ * @param {omnimind.IToolCall=} [properties] Properties to set
2403
+ * @returns {omnimind.ToolCall} ToolCall instance
2404
+ */
2405
+ ToolCall.create = function create(properties) {
2406
+ return new ToolCall(properties);
2407
+ };
2408
+
2409
+ /**
2410
+ * Encodes the specified ToolCall message. Does not implicitly {@link omnimind.ToolCall.verify|verify} messages.
2411
+ * @function encode
2412
+ * @memberof omnimind.ToolCall
2413
+ * @static
2414
+ * @param {omnimind.IToolCall} message ToolCall message or plain object to encode
2415
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2416
+ * @returns {$protobuf.Writer} Writer
2417
+ */
2418
+ ToolCall.encode = function encode(message, writer) {
2419
+ if (!writer)
2420
+ writer = $Writer.create();
2421
+ if (message.callId != null && Object.hasOwnProperty.call(message, "callId"))
2422
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.callId);
2423
+ if (message.functionName != null && Object.hasOwnProperty.call(message, "functionName"))
2424
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.functionName);
2425
+ if (message.argsJson != null && Object.hasOwnProperty.call(message, "argsJson"))
2426
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.argsJson);
2427
+ return writer;
2428
+ };
2429
+
2430
+ /**
2431
+ * Encodes the specified ToolCall message, length delimited. Does not implicitly {@link omnimind.ToolCall.verify|verify} messages.
2432
+ * @function encodeDelimited
2433
+ * @memberof omnimind.ToolCall
2434
+ * @static
2435
+ * @param {omnimind.IToolCall} message ToolCall message or plain object to encode
2436
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2437
+ * @returns {$protobuf.Writer} Writer
2438
+ */
2439
+ ToolCall.encodeDelimited = function encodeDelimited(message, writer) {
2440
+ return this.encode(message, writer).ldelim();
2441
+ };
2442
+
2443
+ /**
2444
+ * Decodes a ToolCall message from the specified reader or buffer.
2445
+ * @function decode
2446
+ * @memberof omnimind.ToolCall
2447
+ * @static
2448
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2449
+ * @param {number} [length] Message length if known beforehand
2450
+ * @returns {omnimind.ToolCall} ToolCall
2451
+ * @throws {Error} If the payload is not a reader or valid buffer
2452
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2453
+ */
2454
+ ToolCall.decode = function decode(reader, length, error) {
2455
+ if (!(reader instanceof $Reader))
2456
+ reader = $Reader.create(reader);
2457
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.ToolCall();
2458
+ while (reader.pos < end) {
2459
+ var tag = reader.uint32();
2460
+ if (tag === error)
2461
+ break;
2462
+ switch (tag >>> 3) {
2463
+ case 1: {
2464
+ message.callId = reader.string();
2465
+ break;
2466
+ }
2467
+ case 2: {
2468
+ message.functionName = reader.string();
2469
+ break;
2470
+ }
2471
+ case 3: {
2472
+ message.argsJson = reader.string();
2473
+ break;
2474
+ }
2475
+ default:
2476
+ reader.skipType(tag & 7);
2477
+ break;
2478
+ }
2479
+ }
2480
+ return message;
2481
+ };
2482
+
2483
+ /**
2484
+ * Decodes a ToolCall message from the specified reader or buffer, length delimited.
2485
+ * @function decodeDelimited
2486
+ * @memberof omnimind.ToolCall
2487
+ * @static
2488
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2489
+ * @returns {omnimind.ToolCall} ToolCall
2490
+ * @throws {Error} If the payload is not a reader or valid buffer
2491
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2492
+ */
2493
+ ToolCall.decodeDelimited = function decodeDelimited(reader) {
2494
+ if (!(reader instanceof $Reader))
2495
+ reader = new $Reader(reader);
2496
+ return this.decode(reader, reader.uint32());
2497
+ };
2498
+
2499
+ /**
2500
+ * Verifies a ToolCall message.
2501
+ * @function verify
2502
+ * @memberof omnimind.ToolCall
2503
+ * @static
2504
+ * @param {Object.<string,*>} message Plain object to verify
2505
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2506
+ */
2507
+ ToolCall.verify = function verify(message) {
2508
+ if (typeof message !== "object" || message === null)
2509
+ return "object expected";
2510
+ if (message.callId != null && message.hasOwnProperty("callId"))
2511
+ if (!$util.isString(message.callId))
2512
+ return "callId: string expected";
2513
+ if (message.functionName != null && message.hasOwnProperty("functionName"))
2514
+ if (!$util.isString(message.functionName))
2515
+ return "functionName: string expected";
2516
+ if (message.argsJson != null && message.hasOwnProperty("argsJson"))
2517
+ if (!$util.isString(message.argsJson))
2518
+ return "argsJson: string expected";
2519
+ return null;
2520
+ };
2521
+
2522
+ /**
2523
+ * Creates a ToolCall message from a plain object. Also converts values to their respective internal types.
2524
+ * @function fromObject
2525
+ * @memberof omnimind.ToolCall
2526
+ * @static
2527
+ * @param {Object.<string,*>} object Plain object
2528
+ * @returns {omnimind.ToolCall} ToolCall
2529
+ */
2530
+ ToolCall.fromObject = function fromObject(object) {
2531
+ if (object instanceof $root.omnimind.ToolCall)
2532
+ return object;
2533
+ var message = new $root.omnimind.ToolCall();
2534
+ if (object.callId != null)
2535
+ message.callId = String(object.callId);
2536
+ if (object.functionName != null)
2537
+ message.functionName = String(object.functionName);
2538
+ if (object.argsJson != null)
2539
+ message.argsJson = String(object.argsJson);
2540
+ return message;
2541
+ };
2542
+
2543
+ /**
2544
+ * Creates a plain object from a ToolCall message. Also converts values to other types if specified.
2545
+ * @function toObject
2546
+ * @memberof omnimind.ToolCall
2547
+ * @static
2548
+ * @param {omnimind.ToolCall} message ToolCall
2549
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2550
+ * @returns {Object.<string,*>} Plain object
2551
+ */
2552
+ ToolCall.toObject = function toObject(message, options) {
2553
+ if (!options)
2554
+ options = {};
2555
+ var object = {};
2556
+ if (options.defaults) {
2557
+ object.callId = "";
2558
+ object.functionName = "";
2559
+ object.argsJson = "";
2560
+ }
2561
+ if (message.callId != null && message.hasOwnProperty("callId"))
2562
+ object.callId = message.callId;
2563
+ if (message.functionName != null && message.hasOwnProperty("functionName"))
2564
+ object.functionName = message.functionName;
2565
+ if (message.argsJson != null && message.hasOwnProperty("argsJson"))
2566
+ object.argsJson = message.argsJson;
2567
+ return object;
2568
+ };
2569
+
2570
+ /**
2571
+ * Converts this ToolCall to JSON.
2572
+ * @function toJSON
2573
+ * @memberof omnimind.ToolCall
2574
+ * @instance
2575
+ * @returns {Object.<string,*>} JSON object
2576
+ */
2577
+ ToolCall.prototype.toJSON = function toJSON() {
2578
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2579
+ };
2580
+
2581
+ /**
2582
+ * Gets the default type url for ToolCall
2583
+ * @function getTypeUrl
2584
+ * @memberof omnimind.ToolCall
2585
+ * @static
2586
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2587
+ * @returns {string} The default type url
2588
+ */
2589
+ ToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2590
+ if (typeUrlPrefix === undefined) {
2591
+ typeUrlPrefix = "type.googleapis.com";
2592
+ }
2593
+ return typeUrlPrefix + "/omnimind.ToolCall";
2594
+ };
2595
+
2596
+ return ToolCall;
2597
+ })();
2598
+
2599
+ omnimind.ToolResponse = (function() {
2600
+
2601
+ /**
2602
+ * Properties of a ToolResponse.
2603
+ * @memberof omnimind
2604
+ * @interface IToolResponse
2605
+ * @property {string|null} [callId] ToolResponse callId
2606
+ * @property {string|null} [resultJson] ToolResponse resultJson
2607
+ * @property {string|null} [error] ToolResponse error
2608
+ */
2609
+
2610
+ /**
2611
+ * Constructs a new ToolResponse.
2612
+ * @memberof omnimind
2613
+ * @classdesc Represents a ToolResponse.
2614
+ * @implements IToolResponse
2615
+ * @constructor
2616
+ * @param {omnimind.IToolResponse=} [properties] Properties to set
2617
+ */
2618
+ function ToolResponse(properties) {
2619
+ if (properties)
2620
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2621
+ if (properties[keys[i]] != null)
2622
+ this[keys[i]] = properties[keys[i]];
2623
+ }
2624
+
2625
+ /**
2626
+ * ToolResponse callId.
2627
+ * @member {string} callId
2628
+ * @memberof omnimind.ToolResponse
2629
+ * @instance
2630
+ */
2631
+ ToolResponse.prototype.callId = "";
2632
+
2633
+ /**
2634
+ * ToolResponse resultJson.
2635
+ * @member {string} resultJson
2636
+ * @memberof omnimind.ToolResponse
2637
+ * @instance
2638
+ */
2639
+ ToolResponse.prototype.resultJson = "";
2640
+
2641
+ /**
2642
+ * ToolResponse error.
2643
+ * @member {string} error
2644
+ * @memberof omnimind.ToolResponse
2645
+ * @instance
2646
+ */
2647
+ ToolResponse.prototype.error = "";
2648
+
2649
+ /**
2650
+ * Creates a new ToolResponse instance using the specified properties.
2651
+ * @function create
2652
+ * @memberof omnimind.ToolResponse
2653
+ * @static
2654
+ * @param {omnimind.IToolResponse=} [properties] Properties to set
2655
+ * @returns {omnimind.ToolResponse} ToolResponse instance
2656
+ */
2657
+ ToolResponse.create = function create(properties) {
2658
+ return new ToolResponse(properties);
2659
+ };
2660
+
2661
+ /**
2662
+ * Encodes the specified ToolResponse message. Does not implicitly {@link omnimind.ToolResponse.verify|verify} messages.
2663
+ * @function encode
2664
+ * @memberof omnimind.ToolResponse
2665
+ * @static
2666
+ * @param {omnimind.IToolResponse} message ToolResponse message or plain object to encode
2667
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2668
+ * @returns {$protobuf.Writer} Writer
2669
+ */
2670
+ ToolResponse.encode = function encode(message, writer) {
2671
+ if (!writer)
2672
+ writer = $Writer.create();
2673
+ if (message.callId != null && Object.hasOwnProperty.call(message, "callId"))
2674
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.callId);
2675
+ if (message.resultJson != null && Object.hasOwnProperty.call(message, "resultJson"))
2676
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.resultJson);
2677
+ if (message.error != null && Object.hasOwnProperty.call(message, "error"))
2678
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.error);
2679
+ return writer;
2680
+ };
2681
+
2682
+ /**
2683
+ * Encodes the specified ToolResponse message, length delimited. Does not implicitly {@link omnimind.ToolResponse.verify|verify} messages.
2684
+ * @function encodeDelimited
2685
+ * @memberof omnimind.ToolResponse
2686
+ * @static
2687
+ * @param {omnimind.IToolResponse} message ToolResponse message or plain object to encode
2688
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2689
+ * @returns {$protobuf.Writer} Writer
2690
+ */
2691
+ ToolResponse.encodeDelimited = function encodeDelimited(message, writer) {
2692
+ return this.encode(message, writer).ldelim();
2693
+ };
2694
+
2695
+ /**
2696
+ * Decodes a ToolResponse message from the specified reader or buffer.
2697
+ * @function decode
2698
+ * @memberof omnimind.ToolResponse
2699
+ * @static
2700
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2701
+ * @param {number} [length] Message length if known beforehand
2702
+ * @returns {omnimind.ToolResponse} ToolResponse
2703
+ * @throws {Error} If the payload is not a reader or valid buffer
2704
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2705
+ */
2706
+ ToolResponse.decode = function decode(reader, length, error) {
2707
+ if (!(reader instanceof $Reader))
2708
+ reader = $Reader.create(reader);
2709
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.ToolResponse();
2710
+ while (reader.pos < end) {
2711
+ var tag = reader.uint32();
2712
+ if (tag === error)
2713
+ break;
2714
+ switch (tag >>> 3) {
2715
+ case 1: {
2716
+ message.callId = reader.string();
2717
+ break;
2718
+ }
2719
+ case 2: {
2720
+ message.resultJson = reader.string();
2721
+ break;
2722
+ }
2723
+ case 3: {
2724
+ message.error = reader.string();
2725
+ break;
2726
+ }
2727
+ default:
2728
+ reader.skipType(tag & 7);
2729
+ break;
2730
+ }
2731
+ }
2732
+ return message;
2733
+ };
2734
+
2735
+ /**
2736
+ * Decodes a ToolResponse message from the specified reader or buffer, length delimited.
2737
+ * @function decodeDelimited
2738
+ * @memberof omnimind.ToolResponse
2739
+ * @static
2740
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2741
+ * @returns {omnimind.ToolResponse} ToolResponse
2742
+ * @throws {Error} If the payload is not a reader or valid buffer
2743
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2744
+ */
2745
+ ToolResponse.decodeDelimited = function decodeDelimited(reader) {
2746
+ if (!(reader instanceof $Reader))
2747
+ reader = new $Reader(reader);
2748
+ return this.decode(reader, reader.uint32());
2749
+ };
2750
+
2751
+ /**
2752
+ * Verifies a ToolResponse message.
2753
+ * @function verify
2754
+ * @memberof omnimind.ToolResponse
2755
+ * @static
2756
+ * @param {Object.<string,*>} message Plain object to verify
2757
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2758
+ */
2759
+ ToolResponse.verify = function verify(message) {
2760
+ if (typeof message !== "object" || message === null)
2761
+ return "object expected";
2762
+ if (message.callId != null && message.hasOwnProperty("callId"))
2763
+ if (!$util.isString(message.callId))
2764
+ return "callId: string expected";
2765
+ if (message.resultJson != null && message.hasOwnProperty("resultJson"))
2766
+ if (!$util.isString(message.resultJson))
2767
+ return "resultJson: string expected";
2768
+ if (message.error != null && message.hasOwnProperty("error"))
2769
+ if (!$util.isString(message.error))
2770
+ return "error: string expected";
2771
+ return null;
2772
+ };
2773
+
2774
+ /**
2775
+ * Creates a ToolResponse message from a plain object. Also converts values to their respective internal types.
2776
+ * @function fromObject
2777
+ * @memberof omnimind.ToolResponse
2778
+ * @static
2779
+ * @param {Object.<string,*>} object Plain object
2780
+ * @returns {omnimind.ToolResponse} ToolResponse
2781
+ */
2782
+ ToolResponse.fromObject = function fromObject(object) {
2783
+ if (object instanceof $root.omnimind.ToolResponse)
2784
+ return object;
2785
+ var message = new $root.omnimind.ToolResponse();
2786
+ if (object.callId != null)
2787
+ message.callId = String(object.callId);
2788
+ if (object.resultJson != null)
2789
+ message.resultJson = String(object.resultJson);
2790
+ if (object.error != null)
2791
+ message.error = String(object.error);
2792
+ return message;
2793
+ };
2794
+
2795
+ /**
2796
+ * Creates a plain object from a ToolResponse message. Also converts values to other types if specified.
2797
+ * @function toObject
2798
+ * @memberof omnimind.ToolResponse
2799
+ * @static
2800
+ * @param {omnimind.ToolResponse} message ToolResponse
2801
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2802
+ * @returns {Object.<string,*>} Plain object
2803
+ */
2804
+ ToolResponse.toObject = function toObject(message, options) {
2805
+ if (!options)
2806
+ options = {};
2807
+ var object = {};
2808
+ if (options.defaults) {
2809
+ object.callId = "";
2810
+ object.resultJson = "";
2811
+ object.error = "";
2812
+ }
2813
+ if (message.callId != null && message.hasOwnProperty("callId"))
2814
+ object.callId = message.callId;
2815
+ if (message.resultJson != null && message.hasOwnProperty("resultJson"))
2816
+ object.resultJson = message.resultJson;
2817
+ if (message.error != null && message.hasOwnProperty("error"))
2818
+ object.error = message.error;
2819
+ return object;
2820
+ };
2821
+
2822
+ /**
2823
+ * Converts this ToolResponse to JSON.
2824
+ * @function toJSON
2825
+ * @memberof omnimind.ToolResponse
2826
+ * @instance
2827
+ * @returns {Object.<string,*>} JSON object
2828
+ */
2829
+ ToolResponse.prototype.toJSON = function toJSON() {
2830
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2831
+ };
2832
+
2833
+ /**
2834
+ * Gets the default type url for ToolResponse
2835
+ * @function getTypeUrl
2836
+ * @memberof omnimind.ToolResponse
2837
+ * @static
2838
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2839
+ * @returns {string} The default type url
2840
+ */
2841
+ ToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
2842
+ if (typeUrlPrefix === undefined) {
2843
+ typeUrlPrefix = "type.googleapis.com";
2844
+ }
2845
+ return typeUrlPrefix + "/omnimind.ToolResponse";
2846
+ };
2847
+
2848
+ return ToolResponse;
2849
+ })();
2850
+
2851
+ omnimind.TextMessage = (function() {
2852
+
2853
+ /**
2854
+ * Properties of a TextMessage.
2855
+ * @memberof omnimind
2856
+ * @interface ITextMessage
2857
+ * @property {string|null} [content] TextMessage content
2858
+ * @property {string|null} [role] TextMessage role
2859
+ */
2860
+
2861
+ /**
2862
+ * Constructs a new TextMessage.
2863
+ * @memberof omnimind
2864
+ * @classdesc Represents a TextMessage.
2865
+ * @implements ITextMessage
2866
+ * @constructor
2867
+ * @param {omnimind.ITextMessage=} [properties] Properties to set
2868
+ */
2869
+ function TextMessage(properties) {
2870
+ if (properties)
2871
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2872
+ if (properties[keys[i]] != null)
2873
+ this[keys[i]] = properties[keys[i]];
2874
+ }
2875
+
2876
+ /**
2877
+ * TextMessage content.
2878
+ * @member {string} content
2879
+ * @memberof omnimind.TextMessage
2880
+ * @instance
2881
+ */
2882
+ TextMessage.prototype.content = "";
2883
+
2884
+ /**
2885
+ * TextMessage role.
2886
+ * @member {string} role
2887
+ * @memberof omnimind.TextMessage
2888
+ * @instance
2889
+ */
2890
+ TextMessage.prototype.role = "";
2891
+
2892
+ /**
2893
+ * Creates a new TextMessage instance using the specified properties.
2894
+ * @function create
2895
+ * @memberof omnimind.TextMessage
2896
+ * @static
2897
+ * @param {omnimind.ITextMessage=} [properties] Properties to set
2898
+ * @returns {omnimind.TextMessage} TextMessage instance
2899
+ */
2900
+ TextMessage.create = function create(properties) {
2901
+ return new TextMessage(properties);
2902
+ };
2903
+
2904
+ /**
2905
+ * Encodes the specified TextMessage message. Does not implicitly {@link omnimind.TextMessage.verify|verify} messages.
2906
+ * @function encode
2907
+ * @memberof omnimind.TextMessage
2908
+ * @static
2909
+ * @param {omnimind.ITextMessage} message TextMessage message or plain object to encode
2910
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2911
+ * @returns {$protobuf.Writer} Writer
2912
+ */
2913
+ TextMessage.encode = function encode(message, writer) {
2914
+ if (!writer)
2915
+ writer = $Writer.create();
2916
+ if (message.content != null && Object.hasOwnProperty.call(message, "content"))
2917
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.content);
2918
+ if (message.role != null && Object.hasOwnProperty.call(message, "role"))
2919
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.role);
2920
+ return writer;
2921
+ };
2922
+
2923
+ /**
2924
+ * Encodes the specified TextMessage message, length delimited. Does not implicitly {@link omnimind.TextMessage.verify|verify} messages.
2925
+ * @function encodeDelimited
2926
+ * @memberof omnimind.TextMessage
2927
+ * @static
2928
+ * @param {omnimind.ITextMessage} message TextMessage message or plain object to encode
2929
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2930
+ * @returns {$protobuf.Writer} Writer
2931
+ */
2932
+ TextMessage.encodeDelimited = function encodeDelimited(message, writer) {
2933
+ return this.encode(message, writer).ldelim();
2934
+ };
2935
+
2936
+ /**
2937
+ * Decodes a TextMessage message from the specified reader or buffer.
2938
+ * @function decode
2939
+ * @memberof omnimind.TextMessage
2940
+ * @static
2941
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2942
+ * @param {number} [length] Message length if known beforehand
2943
+ * @returns {omnimind.TextMessage} TextMessage
2944
+ * @throws {Error} If the payload is not a reader or valid buffer
2945
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2946
+ */
2947
+ TextMessage.decode = function decode(reader, length, error) {
2948
+ if (!(reader instanceof $Reader))
2949
+ reader = $Reader.create(reader);
2950
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.omnimind.TextMessage();
2951
+ while (reader.pos < end) {
2952
+ var tag = reader.uint32();
2953
+ if (tag === error)
2954
+ break;
2955
+ switch (tag >>> 3) {
2956
+ case 1: {
2957
+ message.content = reader.string();
2958
+ break;
2959
+ }
2960
+ case 2: {
2961
+ message.role = reader.string();
2962
+ break;
2963
+ }
2964
+ default:
2965
+ reader.skipType(tag & 7);
2966
+ break;
2967
+ }
2968
+ }
2969
+ return message;
2970
+ };
2971
+
2972
+ /**
2973
+ * Decodes a TextMessage message from the specified reader or buffer, length delimited.
2974
+ * @function decodeDelimited
2975
+ * @memberof omnimind.TextMessage
2976
+ * @static
2977
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2978
+ * @returns {omnimind.TextMessage} TextMessage
2979
+ * @throws {Error} If the payload is not a reader or valid buffer
2980
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2981
+ */
2982
+ TextMessage.decodeDelimited = function decodeDelimited(reader) {
2983
+ if (!(reader instanceof $Reader))
2984
+ reader = new $Reader(reader);
2985
+ return this.decode(reader, reader.uint32());
2986
+ };
2987
+
2988
+ /**
2989
+ * Verifies a TextMessage message.
2990
+ * @function verify
2991
+ * @memberof omnimind.TextMessage
2992
+ * @static
2993
+ * @param {Object.<string,*>} message Plain object to verify
2994
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2995
+ */
2996
+ TextMessage.verify = function verify(message) {
2997
+ if (typeof message !== "object" || message === null)
2998
+ return "object expected";
2999
+ if (message.content != null && message.hasOwnProperty("content"))
3000
+ if (!$util.isString(message.content))
3001
+ return "content: string expected";
3002
+ if (message.role != null && message.hasOwnProperty("role"))
3003
+ if (!$util.isString(message.role))
3004
+ return "role: string expected";
3005
+ return null;
3006
+ };
3007
+
3008
+ /**
3009
+ * Creates a TextMessage message from a plain object. Also converts values to their respective internal types.
3010
+ * @function fromObject
3011
+ * @memberof omnimind.TextMessage
3012
+ * @static
3013
+ * @param {Object.<string,*>} object Plain object
3014
+ * @returns {omnimind.TextMessage} TextMessage
3015
+ */
3016
+ TextMessage.fromObject = function fromObject(object) {
3017
+ if (object instanceof $root.omnimind.TextMessage)
3018
+ return object;
3019
+ var message = new $root.omnimind.TextMessage();
3020
+ if (object.content != null)
3021
+ message.content = String(object.content);
3022
+ if (object.role != null)
3023
+ message.role = String(object.role);
3024
+ return message;
3025
+ };
3026
+
3027
+ /**
3028
+ * Creates a plain object from a TextMessage message. Also converts values to other types if specified.
3029
+ * @function toObject
3030
+ * @memberof omnimind.TextMessage
3031
+ * @static
3032
+ * @param {omnimind.TextMessage} message TextMessage
3033
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3034
+ * @returns {Object.<string,*>} Plain object
3035
+ */
3036
+ TextMessage.toObject = function toObject(message, options) {
3037
+ if (!options)
3038
+ options = {};
3039
+ var object = {};
3040
+ if (options.defaults) {
3041
+ object.content = "";
3042
+ object.role = "";
3043
+ }
3044
+ if (message.content != null && message.hasOwnProperty("content"))
3045
+ object.content = message.content;
3046
+ if (message.role != null && message.hasOwnProperty("role"))
3047
+ object.role = message.role;
3048
+ return object;
3049
+ };
3050
+
3051
+ /**
3052
+ * Converts this TextMessage to JSON.
3053
+ * @function toJSON
3054
+ * @memberof omnimind.TextMessage
3055
+ * @instance
3056
+ * @returns {Object.<string,*>} JSON object
3057
+ */
3058
+ TextMessage.prototype.toJSON = function toJSON() {
3059
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3060
+ };
3061
+
3062
+ /**
3063
+ * Gets the default type url for TextMessage
3064
+ * @function getTypeUrl
3065
+ * @memberof omnimind.TextMessage
3066
+ * @static
3067
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3068
+ * @returns {string} The default type url
3069
+ */
3070
+ TextMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
3071
+ if (typeUrlPrefix === undefined) {
3072
+ typeUrlPrefix = "type.googleapis.com";
3073
+ }
3074
+ return typeUrlPrefix + "/omnimind.TextMessage";
3075
+ };
3076
+
3077
+ return TextMessage;
3078
+ })();
3079
+
3080
+ return omnimind;
3081
+ })();
3082
+
3083
+ module.exports = $root;