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