weave-typescript 0.43.0 → 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,2389 @@
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/agent.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.AgentRunEvent = exports.AgentRun = exports.AgentPublishPlanIssue = exports.AgentPublishPlan = exports.AgentToolDescriptor = exports.AgentVersion = exports.AgentDraftPatch = exports.AgentDraft = exports.AgentTemplate = exports.AgentRunEventKind = exports.AgentRunStatus = exports.AgentToolApprovalMode = exports.AgentToolDescriptorKind = exports.AgentTemplateStatus = exports.protobufPackage = void 0;
9
+ exports.agentTemplateStatusFromJSON = agentTemplateStatusFromJSON;
10
+ exports.agentTemplateStatusToJSON = agentTemplateStatusToJSON;
11
+ exports.agentToolDescriptorKindFromJSON = agentToolDescriptorKindFromJSON;
12
+ exports.agentToolDescriptorKindToJSON = agentToolDescriptorKindToJSON;
13
+ exports.agentToolApprovalModeFromJSON = agentToolApprovalModeFromJSON;
14
+ exports.agentToolApprovalModeToJSON = agentToolApprovalModeToJSON;
15
+ exports.agentRunStatusFromJSON = agentRunStatusFromJSON;
16
+ exports.agentRunStatusToJSON = agentRunStatusToJSON;
17
+ exports.agentRunEventKindFromJSON = agentRunEventKindFromJSON;
18
+ exports.agentRunEventKindToJSON = agentRunEventKindToJSON;
19
+ /* eslint-disable */
20
+ const wire_1 = require("@bufbuild/protobuf/wire");
21
+ const struct_pb_1 = require("../../../google/protobuf/struct.pb");
22
+ const timestamp_pb_1 = require("../../../google/protobuf/timestamp.pb");
23
+ exports.protobufPackage = "weaveapi.agent.v1";
24
+ var AgentTemplateStatus;
25
+ (function (AgentTemplateStatus) {
26
+ AgentTemplateStatus[AgentTemplateStatus["AGENT_TEMPLATE_STATUS_UNSPECIFIED"] = 0] = "AGENT_TEMPLATE_STATUS_UNSPECIFIED";
27
+ AgentTemplateStatus[AgentTemplateStatus["AGENT_TEMPLATE_STATUS_ACTIVE"] = 1] = "AGENT_TEMPLATE_STATUS_ACTIVE";
28
+ AgentTemplateStatus[AgentTemplateStatus["AGENT_TEMPLATE_STATUS_ARCHIVED"] = 2] = "AGENT_TEMPLATE_STATUS_ARCHIVED";
29
+ AgentTemplateStatus[AgentTemplateStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
30
+ })(AgentTemplateStatus || (exports.AgentTemplateStatus = AgentTemplateStatus = {}));
31
+ function agentTemplateStatusFromJSON(object) {
32
+ switch (object) {
33
+ case 0:
34
+ case "AGENT_TEMPLATE_STATUS_UNSPECIFIED":
35
+ return AgentTemplateStatus.AGENT_TEMPLATE_STATUS_UNSPECIFIED;
36
+ case 1:
37
+ case "AGENT_TEMPLATE_STATUS_ACTIVE":
38
+ return AgentTemplateStatus.AGENT_TEMPLATE_STATUS_ACTIVE;
39
+ case 2:
40
+ case "AGENT_TEMPLATE_STATUS_ARCHIVED":
41
+ return AgentTemplateStatus.AGENT_TEMPLATE_STATUS_ARCHIVED;
42
+ case -1:
43
+ case "UNRECOGNIZED":
44
+ default:
45
+ return AgentTemplateStatus.UNRECOGNIZED;
46
+ }
47
+ }
48
+ function agentTemplateStatusToJSON(object) {
49
+ switch (object) {
50
+ case AgentTemplateStatus.AGENT_TEMPLATE_STATUS_UNSPECIFIED:
51
+ return "AGENT_TEMPLATE_STATUS_UNSPECIFIED";
52
+ case AgentTemplateStatus.AGENT_TEMPLATE_STATUS_ACTIVE:
53
+ return "AGENT_TEMPLATE_STATUS_ACTIVE";
54
+ case AgentTemplateStatus.AGENT_TEMPLATE_STATUS_ARCHIVED:
55
+ return "AGENT_TEMPLATE_STATUS_ARCHIVED";
56
+ case AgentTemplateStatus.UNRECOGNIZED:
57
+ default:
58
+ return "UNRECOGNIZED";
59
+ }
60
+ }
61
+ var AgentToolDescriptorKind;
62
+ (function (AgentToolDescriptorKind) {
63
+ AgentToolDescriptorKind[AgentToolDescriptorKind["AGENT_TOOL_DESCRIPTOR_KIND_UNSPECIFIED"] = 0] = "AGENT_TOOL_DESCRIPTOR_KIND_UNSPECIFIED";
64
+ AgentToolDescriptorKind[AgentToolDescriptorKind["AGENT_TOOL_DESCRIPTOR_KIND_WEAVE_SERVICE"] = 1] = "AGENT_TOOL_DESCRIPTOR_KIND_WEAVE_SERVICE";
65
+ AgentToolDescriptorKind[AgentToolDescriptorKind["AGENT_TOOL_DESCRIPTOR_KIND_AGENT"] = 2] = "AGENT_TOOL_DESCRIPTOR_KIND_AGENT";
66
+ AgentToolDescriptorKind[AgentToolDescriptorKind["AGENT_TOOL_DESCRIPTOR_KIND_WORKFLOW"] = 3] = "AGENT_TOOL_DESCRIPTOR_KIND_WORKFLOW";
67
+ AgentToolDescriptorKind[AgentToolDescriptorKind["AGENT_TOOL_DESCRIPTOR_KIND_EXTERNAL"] = 4] = "AGENT_TOOL_DESCRIPTOR_KIND_EXTERNAL";
68
+ AgentToolDescriptorKind[AgentToolDescriptorKind["AGENT_TOOL_DESCRIPTOR_KIND_MCP"] = 5] = "AGENT_TOOL_DESCRIPTOR_KIND_MCP";
69
+ AgentToolDescriptorKind[AgentToolDescriptorKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
70
+ })(AgentToolDescriptorKind || (exports.AgentToolDescriptorKind = AgentToolDescriptorKind = {}));
71
+ function agentToolDescriptorKindFromJSON(object) {
72
+ switch (object) {
73
+ case 0:
74
+ case "AGENT_TOOL_DESCRIPTOR_KIND_UNSPECIFIED":
75
+ return AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_UNSPECIFIED;
76
+ case 1:
77
+ case "AGENT_TOOL_DESCRIPTOR_KIND_WEAVE_SERVICE":
78
+ return AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_WEAVE_SERVICE;
79
+ case 2:
80
+ case "AGENT_TOOL_DESCRIPTOR_KIND_AGENT":
81
+ return AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_AGENT;
82
+ case 3:
83
+ case "AGENT_TOOL_DESCRIPTOR_KIND_WORKFLOW":
84
+ return AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_WORKFLOW;
85
+ case 4:
86
+ case "AGENT_TOOL_DESCRIPTOR_KIND_EXTERNAL":
87
+ return AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_EXTERNAL;
88
+ case 5:
89
+ case "AGENT_TOOL_DESCRIPTOR_KIND_MCP":
90
+ return AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_MCP;
91
+ case -1:
92
+ case "UNRECOGNIZED":
93
+ default:
94
+ return AgentToolDescriptorKind.UNRECOGNIZED;
95
+ }
96
+ }
97
+ function agentToolDescriptorKindToJSON(object) {
98
+ switch (object) {
99
+ case AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_UNSPECIFIED:
100
+ return "AGENT_TOOL_DESCRIPTOR_KIND_UNSPECIFIED";
101
+ case AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_WEAVE_SERVICE:
102
+ return "AGENT_TOOL_DESCRIPTOR_KIND_WEAVE_SERVICE";
103
+ case AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_AGENT:
104
+ return "AGENT_TOOL_DESCRIPTOR_KIND_AGENT";
105
+ case AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_WORKFLOW:
106
+ return "AGENT_TOOL_DESCRIPTOR_KIND_WORKFLOW";
107
+ case AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_EXTERNAL:
108
+ return "AGENT_TOOL_DESCRIPTOR_KIND_EXTERNAL";
109
+ case AgentToolDescriptorKind.AGENT_TOOL_DESCRIPTOR_KIND_MCP:
110
+ return "AGENT_TOOL_DESCRIPTOR_KIND_MCP";
111
+ case AgentToolDescriptorKind.UNRECOGNIZED:
112
+ default:
113
+ return "UNRECOGNIZED";
114
+ }
115
+ }
116
+ var AgentToolApprovalMode;
117
+ (function (AgentToolApprovalMode) {
118
+ AgentToolApprovalMode[AgentToolApprovalMode["AGENT_TOOL_APPROVAL_MODE_UNSPECIFIED"] = 0] = "AGENT_TOOL_APPROVAL_MODE_UNSPECIFIED";
119
+ AgentToolApprovalMode[AgentToolApprovalMode["AGENT_TOOL_APPROVAL_MODE_NEVER"] = 1] = "AGENT_TOOL_APPROVAL_MODE_NEVER";
120
+ AgentToolApprovalMode[AgentToolApprovalMode["AGENT_TOOL_APPROVAL_MODE_MUTATION"] = 2] = "AGENT_TOOL_APPROVAL_MODE_MUTATION";
121
+ AgentToolApprovalMode[AgentToolApprovalMode["AGENT_TOOL_APPROVAL_MODE_ALWAYS"] = 3] = "AGENT_TOOL_APPROVAL_MODE_ALWAYS";
122
+ AgentToolApprovalMode[AgentToolApprovalMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
123
+ })(AgentToolApprovalMode || (exports.AgentToolApprovalMode = AgentToolApprovalMode = {}));
124
+ function agentToolApprovalModeFromJSON(object) {
125
+ switch (object) {
126
+ case 0:
127
+ case "AGENT_TOOL_APPROVAL_MODE_UNSPECIFIED":
128
+ return AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_UNSPECIFIED;
129
+ case 1:
130
+ case "AGENT_TOOL_APPROVAL_MODE_NEVER":
131
+ return AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_NEVER;
132
+ case 2:
133
+ case "AGENT_TOOL_APPROVAL_MODE_MUTATION":
134
+ return AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_MUTATION;
135
+ case 3:
136
+ case "AGENT_TOOL_APPROVAL_MODE_ALWAYS":
137
+ return AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_ALWAYS;
138
+ case -1:
139
+ case "UNRECOGNIZED":
140
+ default:
141
+ return AgentToolApprovalMode.UNRECOGNIZED;
142
+ }
143
+ }
144
+ function agentToolApprovalModeToJSON(object) {
145
+ switch (object) {
146
+ case AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_UNSPECIFIED:
147
+ return "AGENT_TOOL_APPROVAL_MODE_UNSPECIFIED";
148
+ case AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_NEVER:
149
+ return "AGENT_TOOL_APPROVAL_MODE_NEVER";
150
+ case AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_MUTATION:
151
+ return "AGENT_TOOL_APPROVAL_MODE_MUTATION";
152
+ case AgentToolApprovalMode.AGENT_TOOL_APPROVAL_MODE_ALWAYS:
153
+ return "AGENT_TOOL_APPROVAL_MODE_ALWAYS";
154
+ case AgentToolApprovalMode.UNRECOGNIZED:
155
+ default:
156
+ return "UNRECOGNIZED";
157
+ }
158
+ }
159
+ var AgentRunStatus;
160
+ (function (AgentRunStatus) {
161
+ AgentRunStatus[AgentRunStatus["AGENT_RUN_STATUS_UNSPECIFIED"] = 0] = "AGENT_RUN_STATUS_UNSPECIFIED";
162
+ AgentRunStatus[AgentRunStatus["AGENT_RUN_STATUS_PENDING"] = 1] = "AGENT_RUN_STATUS_PENDING";
163
+ AgentRunStatus[AgentRunStatus["AGENT_RUN_STATUS_RUNNING"] = 2] = "AGENT_RUN_STATUS_RUNNING";
164
+ AgentRunStatus[AgentRunStatus["AGENT_RUN_STATUS_WAITING"] = 3] = "AGENT_RUN_STATUS_WAITING";
165
+ AgentRunStatus[AgentRunStatus["AGENT_RUN_STATUS_COMPLETED"] = 4] = "AGENT_RUN_STATUS_COMPLETED";
166
+ AgentRunStatus[AgentRunStatus["AGENT_RUN_STATUS_FAILED"] = 5] = "AGENT_RUN_STATUS_FAILED";
167
+ AgentRunStatus[AgentRunStatus["AGENT_RUN_STATUS_CANCELED"] = 6] = "AGENT_RUN_STATUS_CANCELED";
168
+ AgentRunStatus[AgentRunStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
169
+ })(AgentRunStatus || (exports.AgentRunStatus = AgentRunStatus = {}));
170
+ function agentRunStatusFromJSON(object) {
171
+ switch (object) {
172
+ case 0:
173
+ case "AGENT_RUN_STATUS_UNSPECIFIED":
174
+ return AgentRunStatus.AGENT_RUN_STATUS_UNSPECIFIED;
175
+ case 1:
176
+ case "AGENT_RUN_STATUS_PENDING":
177
+ return AgentRunStatus.AGENT_RUN_STATUS_PENDING;
178
+ case 2:
179
+ case "AGENT_RUN_STATUS_RUNNING":
180
+ return AgentRunStatus.AGENT_RUN_STATUS_RUNNING;
181
+ case 3:
182
+ case "AGENT_RUN_STATUS_WAITING":
183
+ return AgentRunStatus.AGENT_RUN_STATUS_WAITING;
184
+ case 4:
185
+ case "AGENT_RUN_STATUS_COMPLETED":
186
+ return AgentRunStatus.AGENT_RUN_STATUS_COMPLETED;
187
+ case 5:
188
+ case "AGENT_RUN_STATUS_FAILED":
189
+ return AgentRunStatus.AGENT_RUN_STATUS_FAILED;
190
+ case 6:
191
+ case "AGENT_RUN_STATUS_CANCELED":
192
+ return AgentRunStatus.AGENT_RUN_STATUS_CANCELED;
193
+ case -1:
194
+ case "UNRECOGNIZED":
195
+ default:
196
+ return AgentRunStatus.UNRECOGNIZED;
197
+ }
198
+ }
199
+ function agentRunStatusToJSON(object) {
200
+ switch (object) {
201
+ case AgentRunStatus.AGENT_RUN_STATUS_UNSPECIFIED:
202
+ return "AGENT_RUN_STATUS_UNSPECIFIED";
203
+ case AgentRunStatus.AGENT_RUN_STATUS_PENDING:
204
+ return "AGENT_RUN_STATUS_PENDING";
205
+ case AgentRunStatus.AGENT_RUN_STATUS_RUNNING:
206
+ return "AGENT_RUN_STATUS_RUNNING";
207
+ case AgentRunStatus.AGENT_RUN_STATUS_WAITING:
208
+ return "AGENT_RUN_STATUS_WAITING";
209
+ case AgentRunStatus.AGENT_RUN_STATUS_COMPLETED:
210
+ return "AGENT_RUN_STATUS_COMPLETED";
211
+ case AgentRunStatus.AGENT_RUN_STATUS_FAILED:
212
+ return "AGENT_RUN_STATUS_FAILED";
213
+ case AgentRunStatus.AGENT_RUN_STATUS_CANCELED:
214
+ return "AGENT_RUN_STATUS_CANCELED";
215
+ case AgentRunStatus.UNRECOGNIZED:
216
+ default:
217
+ return "UNRECOGNIZED";
218
+ }
219
+ }
220
+ var AgentRunEventKind;
221
+ (function (AgentRunEventKind) {
222
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_UNSPECIFIED"] = 0] = "AGENT_RUN_EVENT_KIND_UNSPECIFIED";
223
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_STARTED"] = 1] = "AGENT_RUN_EVENT_KIND_STARTED";
224
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_MODEL_REQUESTED"] = 2] = "AGENT_RUN_EVENT_KIND_MODEL_REQUESTED";
225
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_MODEL_RESPONDED"] = 3] = "AGENT_RUN_EVENT_KIND_MODEL_RESPONDED";
226
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_TOOL_CALL_PROPOSED"] = 4] = "AGENT_RUN_EVENT_KIND_TOOL_CALL_PROPOSED";
227
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_TOOL_CALL_STARTED"] = 5] = "AGENT_RUN_EVENT_KIND_TOOL_CALL_STARTED";
228
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_TOOL_CALL_COMPLETED"] = 6] = "AGENT_RUN_EVENT_KIND_TOOL_CALL_COMPLETED";
229
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_TOOL_CALL_FAILED"] = 7] = "AGENT_RUN_EVENT_KIND_TOOL_CALL_FAILED";
230
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_WAITING"] = 8] = "AGENT_RUN_EVENT_KIND_WAITING";
231
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_COMPLETED"] = 9] = "AGENT_RUN_EVENT_KIND_COMPLETED";
232
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_FAILED"] = 10] = "AGENT_RUN_EVENT_KIND_FAILED";
233
+ AgentRunEventKind[AgentRunEventKind["AGENT_RUN_EVENT_KIND_CANCELED"] = 11] = "AGENT_RUN_EVENT_KIND_CANCELED";
234
+ AgentRunEventKind[AgentRunEventKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
235
+ })(AgentRunEventKind || (exports.AgentRunEventKind = AgentRunEventKind = {}));
236
+ function agentRunEventKindFromJSON(object) {
237
+ switch (object) {
238
+ case 0:
239
+ case "AGENT_RUN_EVENT_KIND_UNSPECIFIED":
240
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_UNSPECIFIED;
241
+ case 1:
242
+ case "AGENT_RUN_EVENT_KIND_STARTED":
243
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_STARTED;
244
+ case 2:
245
+ case "AGENT_RUN_EVENT_KIND_MODEL_REQUESTED":
246
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_MODEL_REQUESTED;
247
+ case 3:
248
+ case "AGENT_RUN_EVENT_KIND_MODEL_RESPONDED":
249
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_MODEL_RESPONDED;
250
+ case 4:
251
+ case "AGENT_RUN_EVENT_KIND_TOOL_CALL_PROPOSED":
252
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_PROPOSED;
253
+ case 5:
254
+ case "AGENT_RUN_EVENT_KIND_TOOL_CALL_STARTED":
255
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_STARTED;
256
+ case 6:
257
+ case "AGENT_RUN_EVENT_KIND_TOOL_CALL_COMPLETED":
258
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_COMPLETED;
259
+ case 7:
260
+ case "AGENT_RUN_EVENT_KIND_TOOL_CALL_FAILED":
261
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_FAILED;
262
+ case 8:
263
+ case "AGENT_RUN_EVENT_KIND_WAITING":
264
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_WAITING;
265
+ case 9:
266
+ case "AGENT_RUN_EVENT_KIND_COMPLETED":
267
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_COMPLETED;
268
+ case 10:
269
+ case "AGENT_RUN_EVENT_KIND_FAILED":
270
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_FAILED;
271
+ case 11:
272
+ case "AGENT_RUN_EVENT_KIND_CANCELED":
273
+ return AgentRunEventKind.AGENT_RUN_EVENT_KIND_CANCELED;
274
+ case -1:
275
+ case "UNRECOGNIZED":
276
+ default:
277
+ return AgentRunEventKind.UNRECOGNIZED;
278
+ }
279
+ }
280
+ function agentRunEventKindToJSON(object) {
281
+ switch (object) {
282
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_UNSPECIFIED:
283
+ return "AGENT_RUN_EVENT_KIND_UNSPECIFIED";
284
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_STARTED:
285
+ return "AGENT_RUN_EVENT_KIND_STARTED";
286
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_MODEL_REQUESTED:
287
+ return "AGENT_RUN_EVENT_KIND_MODEL_REQUESTED";
288
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_MODEL_RESPONDED:
289
+ return "AGENT_RUN_EVENT_KIND_MODEL_RESPONDED";
290
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_PROPOSED:
291
+ return "AGENT_RUN_EVENT_KIND_TOOL_CALL_PROPOSED";
292
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_STARTED:
293
+ return "AGENT_RUN_EVENT_KIND_TOOL_CALL_STARTED";
294
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_COMPLETED:
295
+ return "AGENT_RUN_EVENT_KIND_TOOL_CALL_COMPLETED";
296
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_TOOL_CALL_FAILED:
297
+ return "AGENT_RUN_EVENT_KIND_TOOL_CALL_FAILED";
298
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_WAITING:
299
+ return "AGENT_RUN_EVENT_KIND_WAITING";
300
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_COMPLETED:
301
+ return "AGENT_RUN_EVENT_KIND_COMPLETED";
302
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_FAILED:
303
+ return "AGENT_RUN_EVENT_KIND_FAILED";
304
+ case AgentRunEventKind.AGENT_RUN_EVENT_KIND_CANCELED:
305
+ return "AGENT_RUN_EVENT_KIND_CANCELED";
306
+ case AgentRunEventKind.UNRECOGNIZED:
307
+ default:
308
+ return "UNRECOGNIZED";
309
+ }
310
+ }
311
+ function createBaseAgentTemplate() {
312
+ return {
313
+ id: "",
314
+ organizationId: "",
315
+ slug: "",
316
+ name: "",
317
+ description: "",
318
+ status: 0,
319
+ createdByUserId: "",
320
+ draftRevision: 0,
321
+ latestVersionId: "",
322
+ latestVersion: 0,
323
+ createdAt: undefined,
324
+ updatedAt: undefined,
325
+ };
326
+ }
327
+ exports.AgentTemplate = {
328
+ encode(message, writer = new wire_1.BinaryWriter()) {
329
+ if (message.id !== "") {
330
+ writer.uint32(10).string(message.id);
331
+ }
332
+ if (message.organizationId !== "") {
333
+ writer.uint32(18).string(message.organizationId);
334
+ }
335
+ if (message.slug !== "") {
336
+ writer.uint32(26).string(message.slug);
337
+ }
338
+ if (message.name !== "") {
339
+ writer.uint32(34).string(message.name);
340
+ }
341
+ if (message.description !== "") {
342
+ writer.uint32(42).string(message.description);
343
+ }
344
+ if (message.status !== 0) {
345
+ writer.uint32(48).int32(message.status);
346
+ }
347
+ if (message.createdByUserId !== "") {
348
+ writer.uint32(58).string(message.createdByUserId);
349
+ }
350
+ if (message.draftRevision !== 0) {
351
+ writer.uint32(64).int32(message.draftRevision);
352
+ }
353
+ if (message.latestVersionId !== "") {
354
+ writer.uint32(74).string(message.latestVersionId);
355
+ }
356
+ if (message.latestVersion !== 0) {
357
+ writer.uint32(80).int32(message.latestVersion);
358
+ }
359
+ if (message.createdAt !== undefined) {
360
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(90).fork()).join();
361
+ }
362
+ if (message.updatedAt !== undefined) {
363
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(98).fork()).join();
364
+ }
365
+ return writer;
366
+ },
367
+ decode(input, length) {
368
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
369
+ const end = length === undefined ? reader.len : reader.pos + length;
370
+ const message = createBaseAgentTemplate();
371
+ while (reader.pos < end) {
372
+ const tag = reader.uint32();
373
+ switch (tag >>> 3) {
374
+ case 1: {
375
+ if (tag !== 10) {
376
+ break;
377
+ }
378
+ message.id = reader.string();
379
+ continue;
380
+ }
381
+ case 2: {
382
+ if (tag !== 18) {
383
+ break;
384
+ }
385
+ message.organizationId = reader.string();
386
+ continue;
387
+ }
388
+ case 3: {
389
+ if (tag !== 26) {
390
+ break;
391
+ }
392
+ message.slug = reader.string();
393
+ continue;
394
+ }
395
+ case 4: {
396
+ if (tag !== 34) {
397
+ break;
398
+ }
399
+ message.name = reader.string();
400
+ continue;
401
+ }
402
+ case 5: {
403
+ if (tag !== 42) {
404
+ break;
405
+ }
406
+ message.description = reader.string();
407
+ continue;
408
+ }
409
+ case 6: {
410
+ if (tag !== 48) {
411
+ break;
412
+ }
413
+ message.status = reader.int32();
414
+ continue;
415
+ }
416
+ case 7: {
417
+ if (tag !== 58) {
418
+ break;
419
+ }
420
+ message.createdByUserId = reader.string();
421
+ continue;
422
+ }
423
+ case 8: {
424
+ if (tag !== 64) {
425
+ break;
426
+ }
427
+ message.draftRevision = reader.int32();
428
+ continue;
429
+ }
430
+ case 9: {
431
+ if (tag !== 74) {
432
+ break;
433
+ }
434
+ message.latestVersionId = reader.string();
435
+ continue;
436
+ }
437
+ case 10: {
438
+ if (tag !== 80) {
439
+ break;
440
+ }
441
+ message.latestVersion = reader.int32();
442
+ continue;
443
+ }
444
+ case 11: {
445
+ if (tag !== 90) {
446
+ break;
447
+ }
448
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
449
+ continue;
450
+ }
451
+ case 12: {
452
+ if (tag !== 98) {
453
+ break;
454
+ }
455
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
456
+ continue;
457
+ }
458
+ }
459
+ if ((tag & 7) === 4 || tag === 0) {
460
+ break;
461
+ }
462
+ reader.skip(tag & 7);
463
+ }
464
+ return message;
465
+ },
466
+ fromJSON(object) {
467
+ return {
468
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
469
+ organizationId: isSet(object.organizationId)
470
+ ? globalThis.String(object.organizationId)
471
+ : isSet(object.organization_id)
472
+ ? globalThis.String(object.organization_id)
473
+ : "",
474
+ slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
475
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
476
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
477
+ status: isSet(object.status) ? agentTemplateStatusFromJSON(object.status) : 0,
478
+ createdByUserId: isSet(object.createdByUserId)
479
+ ? globalThis.String(object.createdByUserId)
480
+ : isSet(object.created_by_user_id)
481
+ ? globalThis.String(object.created_by_user_id)
482
+ : "",
483
+ draftRevision: isSet(object.draftRevision)
484
+ ? globalThis.Number(object.draftRevision)
485
+ : isSet(object.draft_revision)
486
+ ? globalThis.Number(object.draft_revision)
487
+ : 0,
488
+ latestVersionId: isSet(object.latestVersionId)
489
+ ? globalThis.String(object.latestVersionId)
490
+ : isSet(object.latest_version_id)
491
+ ? globalThis.String(object.latest_version_id)
492
+ : "",
493
+ latestVersion: isSet(object.latestVersion)
494
+ ? globalThis.Number(object.latestVersion)
495
+ : isSet(object.latest_version)
496
+ ? globalThis.Number(object.latest_version)
497
+ : 0,
498
+ createdAt: isSet(object.createdAt)
499
+ ? fromJsonTimestamp(object.createdAt)
500
+ : isSet(object.created_at)
501
+ ? fromJsonTimestamp(object.created_at)
502
+ : undefined,
503
+ updatedAt: isSet(object.updatedAt)
504
+ ? fromJsonTimestamp(object.updatedAt)
505
+ : isSet(object.updated_at)
506
+ ? fromJsonTimestamp(object.updated_at)
507
+ : undefined,
508
+ };
509
+ },
510
+ toJSON(message) {
511
+ const obj = {};
512
+ if (message.id !== "") {
513
+ obj.id = message.id;
514
+ }
515
+ if (message.organizationId !== "") {
516
+ obj.organizationId = message.organizationId;
517
+ }
518
+ if (message.slug !== "") {
519
+ obj.slug = message.slug;
520
+ }
521
+ if (message.name !== "") {
522
+ obj.name = message.name;
523
+ }
524
+ if (message.description !== "") {
525
+ obj.description = message.description;
526
+ }
527
+ if (message.status !== 0) {
528
+ obj.status = agentTemplateStatusToJSON(message.status);
529
+ }
530
+ if (message.createdByUserId !== "") {
531
+ obj.createdByUserId = message.createdByUserId;
532
+ }
533
+ if (message.draftRevision !== 0) {
534
+ obj.draftRevision = Math.round(message.draftRevision);
535
+ }
536
+ if (message.latestVersionId !== "") {
537
+ obj.latestVersionId = message.latestVersionId;
538
+ }
539
+ if (message.latestVersion !== 0) {
540
+ obj.latestVersion = Math.round(message.latestVersion);
541
+ }
542
+ if (message.createdAt !== undefined) {
543
+ obj.createdAt = message.createdAt.toISOString();
544
+ }
545
+ if (message.updatedAt !== undefined) {
546
+ obj.updatedAt = message.updatedAt.toISOString();
547
+ }
548
+ return obj;
549
+ },
550
+ create(base) {
551
+ return exports.AgentTemplate.fromPartial(base !== null && base !== void 0 ? base : {});
552
+ },
553
+ fromPartial(object) {
554
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
555
+ const message = createBaseAgentTemplate();
556
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
557
+ message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : "";
558
+ message.slug = (_c = object.slug) !== null && _c !== void 0 ? _c : "";
559
+ message.name = (_d = object.name) !== null && _d !== void 0 ? _d : "";
560
+ message.description = (_e = object.description) !== null && _e !== void 0 ? _e : "";
561
+ message.status = (_f = object.status) !== null && _f !== void 0 ? _f : 0;
562
+ message.createdByUserId = (_g = object.createdByUserId) !== null && _g !== void 0 ? _g : "";
563
+ message.draftRevision = (_h = object.draftRevision) !== null && _h !== void 0 ? _h : 0;
564
+ message.latestVersionId = (_j = object.latestVersionId) !== null && _j !== void 0 ? _j : "";
565
+ message.latestVersion = (_k = object.latestVersion) !== null && _k !== void 0 ? _k : 0;
566
+ message.createdAt = (_l = object.createdAt) !== null && _l !== void 0 ? _l : undefined;
567
+ message.updatedAt = (_m = object.updatedAt) !== null && _m !== void 0 ? _m : undefined;
568
+ return message;
569
+ },
570
+ };
571
+ function createBaseAgentDraft() {
572
+ return {
573
+ id: "",
574
+ templateId: "",
575
+ organizationId: "",
576
+ baseVersionId: "",
577
+ revision: 0,
578
+ name: "",
579
+ description: "",
580
+ instructions: "",
581
+ modelId: "",
582
+ providerConfigurationId: "",
583
+ tools: [],
584
+ inputSchema: undefined,
585
+ outputSchema: undefined,
586
+ metadata: undefined,
587
+ updatedByUserId: "",
588
+ createdAt: undefined,
589
+ updatedAt: undefined,
590
+ };
591
+ }
592
+ exports.AgentDraft = {
593
+ encode(message, writer = new wire_1.BinaryWriter()) {
594
+ if (message.id !== "") {
595
+ writer.uint32(10).string(message.id);
596
+ }
597
+ if (message.templateId !== "") {
598
+ writer.uint32(18).string(message.templateId);
599
+ }
600
+ if (message.organizationId !== "") {
601
+ writer.uint32(26).string(message.organizationId);
602
+ }
603
+ if (message.baseVersionId !== "") {
604
+ writer.uint32(34).string(message.baseVersionId);
605
+ }
606
+ if (message.revision !== 0) {
607
+ writer.uint32(40).int32(message.revision);
608
+ }
609
+ if (message.name !== "") {
610
+ writer.uint32(50).string(message.name);
611
+ }
612
+ if (message.description !== "") {
613
+ writer.uint32(58).string(message.description);
614
+ }
615
+ if (message.instructions !== "") {
616
+ writer.uint32(66).string(message.instructions);
617
+ }
618
+ if (message.modelId !== "") {
619
+ writer.uint32(74).string(message.modelId);
620
+ }
621
+ if (message.providerConfigurationId !== "") {
622
+ writer.uint32(82).string(message.providerConfigurationId);
623
+ }
624
+ for (const v of message.tools) {
625
+ exports.AgentToolDescriptor.encode(v, writer.uint32(90).fork()).join();
626
+ }
627
+ if (message.inputSchema !== undefined) {
628
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.inputSchema), writer.uint32(98).fork()).join();
629
+ }
630
+ if (message.outputSchema !== undefined) {
631
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.outputSchema), writer.uint32(106).fork()).join();
632
+ }
633
+ if (message.metadata !== undefined) {
634
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.metadata), writer.uint32(114).fork()).join();
635
+ }
636
+ if (message.updatedByUserId !== "") {
637
+ writer.uint32(122).string(message.updatedByUserId);
638
+ }
639
+ if (message.createdAt !== undefined) {
640
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(130).fork()).join();
641
+ }
642
+ if (message.updatedAt !== undefined) {
643
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(138).fork()).join();
644
+ }
645
+ return writer;
646
+ },
647
+ decode(input, length) {
648
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
649
+ const end = length === undefined ? reader.len : reader.pos + length;
650
+ const message = createBaseAgentDraft();
651
+ while (reader.pos < end) {
652
+ const tag = reader.uint32();
653
+ switch (tag >>> 3) {
654
+ case 1: {
655
+ if (tag !== 10) {
656
+ break;
657
+ }
658
+ message.id = reader.string();
659
+ continue;
660
+ }
661
+ case 2: {
662
+ if (tag !== 18) {
663
+ break;
664
+ }
665
+ message.templateId = reader.string();
666
+ continue;
667
+ }
668
+ case 3: {
669
+ if (tag !== 26) {
670
+ break;
671
+ }
672
+ message.organizationId = reader.string();
673
+ continue;
674
+ }
675
+ case 4: {
676
+ if (tag !== 34) {
677
+ break;
678
+ }
679
+ message.baseVersionId = reader.string();
680
+ continue;
681
+ }
682
+ case 5: {
683
+ if (tag !== 40) {
684
+ break;
685
+ }
686
+ message.revision = reader.int32();
687
+ continue;
688
+ }
689
+ case 6: {
690
+ if (tag !== 50) {
691
+ break;
692
+ }
693
+ message.name = reader.string();
694
+ continue;
695
+ }
696
+ case 7: {
697
+ if (tag !== 58) {
698
+ break;
699
+ }
700
+ message.description = reader.string();
701
+ continue;
702
+ }
703
+ case 8: {
704
+ if (tag !== 66) {
705
+ break;
706
+ }
707
+ message.instructions = reader.string();
708
+ continue;
709
+ }
710
+ case 9: {
711
+ if (tag !== 74) {
712
+ break;
713
+ }
714
+ message.modelId = reader.string();
715
+ continue;
716
+ }
717
+ case 10: {
718
+ if (tag !== 82) {
719
+ break;
720
+ }
721
+ message.providerConfigurationId = reader.string();
722
+ continue;
723
+ }
724
+ case 11: {
725
+ if (tag !== 90) {
726
+ break;
727
+ }
728
+ message.tools.push(exports.AgentToolDescriptor.decode(reader, reader.uint32()));
729
+ continue;
730
+ }
731
+ case 12: {
732
+ if (tag !== 98) {
733
+ break;
734
+ }
735
+ message.inputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
736
+ continue;
737
+ }
738
+ case 13: {
739
+ if (tag !== 106) {
740
+ break;
741
+ }
742
+ message.outputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
743
+ continue;
744
+ }
745
+ case 14: {
746
+ if (tag !== 114) {
747
+ break;
748
+ }
749
+ message.metadata = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
750
+ continue;
751
+ }
752
+ case 15: {
753
+ if (tag !== 122) {
754
+ break;
755
+ }
756
+ message.updatedByUserId = reader.string();
757
+ continue;
758
+ }
759
+ case 16: {
760
+ if (tag !== 130) {
761
+ break;
762
+ }
763
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
764
+ continue;
765
+ }
766
+ case 17: {
767
+ if (tag !== 138) {
768
+ break;
769
+ }
770
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
771
+ continue;
772
+ }
773
+ }
774
+ if ((tag & 7) === 4 || tag === 0) {
775
+ break;
776
+ }
777
+ reader.skip(tag & 7);
778
+ }
779
+ return message;
780
+ },
781
+ fromJSON(object) {
782
+ return {
783
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
784
+ templateId: isSet(object.templateId)
785
+ ? globalThis.String(object.templateId)
786
+ : isSet(object.template_id)
787
+ ? globalThis.String(object.template_id)
788
+ : "",
789
+ organizationId: isSet(object.organizationId)
790
+ ? globalThis.String(object.organizationId)
791
+ : isSet(object.organization_id)
792
+ ? globalThis.String(object.organization_id)
793
+ : "",
794
+ baseVersionId: isSet(object.baseVersionId)
795
+ ? globalThis.String(object.baseVersionId)
796
+ : isSet(object.base_version_id)
797
+ ? globalThis.String(object.base_version_id)
798
+ : "",
799
+ revision: isSet(object.revision) ? globalThis.Number(object.revision) : 0,
800
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
801
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
802
+ instructions: isSet(object.instructions) ? globalThis.String(object.instructions) : "",
803
+ modelId: isSet(object.modelId)
804
+ ? globalThis.String(object.modelId)
805
+ : isSet(object.model_id)
806
+ ? globalThis.String(object.model_id)
807
+ : "",
808
+ providerConfigurationId: isSet(object.providerConfigurationId)
809
+ ? globalThis.String(object.providerConfigurationId)
810
+ : isSet(object.provider_configuration_id)
811
+ ? globalThis.String(object.provider_configuration_id)
812
+ : "",
813
+ tools: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.tools)
814
+ ? object.tools.map((e) => exports.AgentToolDescriptor.fromJSON(e))
815
+ : [],
816
+ inputSchema: isObject(object.inputSchema)
817
+ ? object.inputSchema
818
+ : isObject(object.input_schema)
819
+ ? object.input_schema
820
+ : undefined,
821
+ outputSchema: isObject(object.outputSchema)
822
+ ? object.outputSchema
823
+ : isObject(object.output_schema)
824
+ ? object.output_schema
825
+ : undefined,
826
+ metadata: isObject(object.metadata) ? object.metadata : undefined,
827
+ updatedByUserId: isSet(object.updatedByUserId)
828
+ ? globalThis.String(object.updatedByUserId)
829
+ : isSet(object.updated_by_user_id)
830
+ ? globalThis.String(object.updated_by_user_id)
831
+ : "",
832
+ createdAt: isSet(object.createdAt)
833
+ ? fromJsonTimestamp(object.createdAt)
834
+ : isSet(object.created_at)
835
+ ? fromJsonTimestamp(object.created_at)
836
+ : undefined,
837
+ updatedAt: isSet(object.updatedAt)
838
+ ? fromJsonTimestamp(object.updatedAt)
839
+ : isSet(object.updated_at)
840
+ ? fromJsonTimestamp(object.updated_at)
841
+ : undefined,
842
+ };
843
+ },
844
+ toJSON(message) {
845
+ var _a;
846
+ const obj = {};
847
+ if (message.id !== "") {
848
+ obj.id = message.id;
849
+ }
850
+ if (message.templateId !== "") {
851
+ obj.templateId = message.templateId;
852
+ }
853
+ if (message.organizationId !== "") {
854
+ obj.organizationId = message.organizationId;
855
+ }
856
+ if (message.baseVersionId !== "") {
857
+ obj.baseVersionId = message.baseVersionId;
858
+ }
859
+ if (message.revision !== 0) {
860
+ obj.revision = Math.round(message.revision);
861
+ }
862
+ if (message.name !== "") {
863
+ obj.name = message.name;
864
+ }
865
+ if (message.description !== "") {
866
+ obj.description = message.description;
867
+ }
868
+ if (message.instructions !== "") {
869
+ obj.instructions = message.instructions;
870
+ }
871
+ if (message.modelId !== "") {
872
+ obj.modelId = message.modelId;
873
+ }
874
+ if (message.providerConfigurationId !== "") {
875
+ obj.providerConfigurationId = message.providerConfigurationId;
876
+ }
877
+ if ((_a = message.tools) === null || _a === void 0 ? void 0 : _a.length) {
878
+ obj.tools = message.tools.map((e) => exports.AgentToolDescriptor.toJSON(e));
879
+ }
880
+ if (message.inputSchema !== undefined) {
881
+ obj.inputSchema = message.inputSchema;
882
+ }
883
+ if (message.outputSchema !== undefined) {
884
+ obj.outputSchema = message.outputSchema;
885
+ }
886
+ if (message.metadata !== undefined) {
887
+ obj.metadata = message.metadata;
888
+ }
889
+ if (message.updatedByUserId !== "") {
890
+ obj.updatedByUserId = message.updatedByUserId;
891
+ }
892
+ if (message.createdAt !== undefined) {
893
+ obj.createdAt = message.createdAt.toISOString();
894
+ }
895
+ if (message.updatedAt !== undefined) {
896
+ obj.updatedAt = message.updatedAt.toISOString();
897
+ }
898
+ return obj;
899
+ },
900
+ create(base) {
901
+ return exports.AgentDraft.fromPartial(base !== null && base !== void 0 ? base : {});
902
+ },
903
+ fromPartial(object) {
904
+ var _a;
905
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
906
+ const message = createBaseAgentDraft();
907
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
908
+ message.templateId = (_c = object.templateId) !== null && _c !== void 0 ? _c : "";
909
+ message.organizationId = (_d = object.organizationId) !== null && _d !== void 0 ? _d : "";
910
+ message.baseVersionId = (_e = object.baseVersionId) !== null && _e !== void 0 ? _e : "";
911
+ message.revision = (_f = object.revision) !== null && _f !== void 0 ? _f : 0;
912
+ message.name = (_g = object.name) !== null && _g !== void 0 ? _g : "";
913
+ message.description = (_h = object.description) !== null && _h !== void 0 ? _h : "";
914
+ message.instructions = (_j = object.instructions) !== null && _j !== void 0 ? _j : "";
915
+ message.modelId = (_k = object.modelId) !== null && _k !== void 0 ? _k : "";
916
+ message.providerConfigurationId = (_l = object.providerConfigurationId) !== null && _l !== void 0 ? _l : "";
917
+ message.tools = ((_a = object.tools) === null || _a === void 0 ? void 0 : _a.map((e) => exports.AgentToolDescriptor.fromPartial(e))) || [];
918
+ message.inputSchema = (_m = object.inputSchema) !== null && _m !== void 0 ? _m : undefined;
919
+ message.outputSchema = (_o = object.outputSchema) !== null && _o !== void 0 ? _o : undefined;
920
+ message.metadata = (_p = object.metadata) !== null && _p !== void 0 ? _p : undefined;
921
+ message.updatedByUserId = (_q = object.updatedByUserId) !== null && _q !== void 0 ? _q : "";
922
+ message.createdAt = (_r = object.createdAt) !== null && _r !== void 0 ? _r : undefined;
923
+ message.updatedAt = (_s = object.updatedAt) !== null && _s !== void 0 ? _s : undefined;
924
+ return message;
925
+ },
926
+ };
927
+ function createBaseAgentDraftPatch() {
928
+ return {
929
+ id: "",
930
+ templateId: "",
931
+ organizationId: "",
932
+ revision: 0,
933
+ patch: undefined,
934
+ createdByUserId: "",
935
+ createdAt: undefined,
936
+ };
937
+ }
938
+ exports.AgentDraftPatch = {
939
+ encode(message, writer = new wire_1.BinaryWriter()) {
940
+ if (message.id !== "") {
941
+ writer.uint32(10).string(message.id);
942
+ }
943
+ if (message.templateId !== "") {
944
+ writer.uint32(18).string(message.templateId);
945
+ }
946
+ if (message.organizationId !== "") {
947
+ writer.uint32(26).string(message.organizationId);
948
+ }
949
+ if (message.revision !== 0) {
950
+ writer.uint32(32).int32(message.revision);
951
+ }
952
+ if (message.patch !== undefined) {
953
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.patch), writer.uint32(42).fork()).join();
954
+ }
955
+ if (message.createdByUserId !== "") {
956
+ writer.uint32(50).string(message.createdByUserId);
957
+ }
958
+ if (message.createdAt !== undefined) {
959
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
960
+ }
961
+ return writer;
962
+ },
963
+ decode(input, length) {
964
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
965
+ const end = length === undefined ? reader.len : reader.pos + length;
966
+ const message = createBaseAgentDraftPatch();
967
+ while (reader.pos < end) {
968
+ const tag = reader.uint32();
969
+ switch (tag >>> 3) {
970
+ case 1: {
971
+ if (tag !== 10) {
972
+ break;
973
+ }
974
+ message.id = reader.string();
975
+ continue;
976
+ }
977
+ case 2: {
978
+ if (tag !== 18) {
979
+ break;
980
+ }
981
+ message.templateId = reader.string();
982
+ continue;
983
+ }
984
+ case 3: {
985
+ if (tag !== 26) {
986
+ break;
987
+ }
988
+ message.organizationId = reader.string();
989
+ continue;
990
+ }
991
+ case 4: {
992
+ if (tag !== 32) {
993
+ break;
994
+ }
995
+ message.revision = reader.int32();
996
+ continue;
997
+ }
998
+ case 5: {
999
+ if (tag !== 42) {
1000
+ break;
1001
+ }
1002
+ message.patch = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1003
+ continue;
1004
+ }
1005
+ case 6: {
1006
+ if (tag !== 50) {
1007
+ break;
1008
+ }
1009
+ message.createdByUserId = reader.string();
1010
+ continue;
1011
+ }
1012
+ case 7: {
1013
+ if (tag !== 58) {
1014
+ break;
1015
+ }
1016
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1017
+ continue;
1018
+ }
1019
+ }
1020
+ if ((tag & 7) === 4 || tag === 0) {
1021
+ break;
1022
+ }
1023
+ reader.skip(tag & 7);
1024
+ }
1025
+ return message;
1026
+ },
1027
+ fromJSON(object) {
1028
+ return {
1029
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1030
+ templateId: isSet(object.templateId)
1031
+ ? globalThis.String(object.templateId)
1032
+ : isSet(object.template_id)
1033
+ ? globalThis.String(object.template_id)
1034
+ : "",
1035
+ organizationId: isSet(object.organizationId)
1036
+ ? globalThis.String(object.organizationId)
1037
+ : isSet(object.organization_id)
1038
+ ? globalThis.String(object.organization_id)
1039
+ : "",
1040
+ revision: isSet(object.revision) ? globalThis.Number(object.revision) : 0,
1041
+ patch: isObject(object.patch) ? object.patch : undefined,
1042
+ createdByUserId: isSet(object.createdByUserId)
1043
+ ? globalThis.String(object.createdByUserId)
1044
+ : isSet(object.created_by_user_id)
1045
+ ? globalThis.String(object.created_by_user_id)
1046
+ : "",
1047
+ createdAt: isSet(object.createdAt)
1048
+ ? fromJsonTimestamp(object.createdAt)
1049
+ : isSet(object.created_at)
1050
+ ? fromJsonTimestamp(object.created_at)
1051
+ : undefined,
1052
+ };
1053
+ },
1054
+ toJSON(message) {
1055
+ const obj = {};
1056
+ if (message.id !== "") {
1057
+ obj.id = message.id;
1058
+ }
1059
+ if (message.templateId !== "") {
1060
+ obj.templateId = message.templateId;
1061
+ }
1062
+ if (message.organizationId !== "") {
1063
+ obj.organizationId = message.organizationId;
1064
+ }
1065
+ if (message.revision !== 0) {
1066
+ obj.revision = Math.round(message.revision);
1067
+ }
1068
+ if (message.patch !== undefined) {
1069
+ obj.patch = message.patch;
1070
+ }
1071
+ if (message.createdByUserId !== "") {
1072
+ obj.createdByUserId = message.createdByUserId;
1073
+ }
1074
+ if (message.createdAt !== undefined) {
1075
+ obj.createdAt = message.createdAt.toISOString();
1076
+ }
1077
+ return obj;
1078
+ },
1079
+ create(base) {
1080
+ return exports.AgentDraftPatch.fromPartial(base !== null && base !== void 0 ? base : {});
1081
+ },
1082
+ fromPartial(object) {
1083
+ var _a, _b, _c, _d, _e, _f, _g;
1084
+ const message = createBaseAgentDraftPatch();
1085
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
1086
+ message.templateId = (_b = object.templateId) !== null && _b !== void 0 ? _b : "";
1087
+ message.organizationId = (_c = object.organizationId) !== null && _c !== void 0 ? _c : "";
1088
+ message.revision = (_d = object.revision) !== null && _d !== void 0 ? _d : 0;
1089
+ message.patch = (_e = object.patch) !== null && _e !== void 0 ? _e : undefined;
1090
+ message.createdByUserId = (_f = object.createdByUserId) !== null && _f !== void 0 ? _f : "";
1091
+ message.createdAt = (_g = object.createdAt) !== null && _g !== void 0 ? _g : undefined;
1092
+ return message;
1093
+ },
1094
+ };
1095
+ function createBaseAgentVersion() {
1096
+ return {
1097
+ id: "",
1098
+ templateId: "",
1099
+ organizationId: "",
1100
+ version: 0,
1101
+ sourceDraftRevision: 0,
1102
+ name: "",
1103
+ description: "",
1104
+ instructions: "",
1105
+ modelId: "",
1106
+ providerConfigurationId: "",
1107
+ tools: [],
1108
+ inputSchema: undefined,
1109
+ outputSchema: undefined,
1110
+ metadata: undefined,
1111
+ publishedByUserId: "",
1112
+ publishedAt: undefined,
1113
+ };
1114
+ }
1115
+ exports.AgentVersion = {
1116
+ encode(message, writer = new wire_1.BinaryWriter()) {
1117
+ if (message.id !== "") {
1118
+ writer.uint32(10).string(message.id);
1119
+ }
1120
+ if (message.templateId !== "") {
1121
+ writer.uint32(18).string(message.templateId);
1122
+ }
1123
+ if (message.organizationId !== "") {
1124
+ writer.uint32(26).string(message.organizationId);
1125
+ }
1126
+ if (message.version !== 0) {
1127
+ writer.uint32(32).int32(message.version);
1128
+ }
1129
+ if (message.sourceDraftRevision !== 0) {
1130
+ writer.uint32(40).int32(message.sourceDraftRevision);
1131
+ }
1132
+ if (message.name !== "") {
1133
+ writer.uint32(50).string(message.name);
1134
+ }
1135
+ if (message.description !== "") {
1136
+ writer.uint32(58).string(message.description);
1137
+ }
1138
+ if (message.instructions !== "") {
1139
+ writer.uint32(66).string(message.instructions);
1140
+ }
1141
+ if (message.modelId !== "") {
1142
+ writer.uint32(74).string(message.modelId);
1143
+ }
1144
+ if (message.providerConfigurationId !== "") {
1145
+ writer.uint32(82).string(message.providerConfigurationId);
1146
+ }
1147
+ for (const v of message.tools) {
1148
+ exports.AgentToolDescriptor.encode(v, writer.uint32(90).fork()).join();
1149
+ }
1150
+ if (message.inputSchema !== undefined) {
1151
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.inputSchema), writer.uint32(98).fork()).join();
1152
+ }
1153
+ if (message.outputSchema !== undefined) {
1154
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.outputSchema), writer.uint32(106).fork()).join();
1155
+ }
1156
+ if (message.metadata !== undefined) {
1157
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.metadata), writer.uint32(114).fork()).join();
1158
+ }
1159
+ if (message.publishedByUserId !== "") {
1160
+ writer.uint32(122).string(message.publishedByUserId);
1161
+ }
1162
+ if (message.publishedAt !== undefined) {
1163
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.publishedAt), writer.uint32(130).fork()).join();
1164
+ }
1165
+ return writer;
1166
+ },
1167
+ decode(input, length) {
1168
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1169
+ const end = length === undefined ? reader.len : reader.pos + length;
1170
+ const message = createBaseAgentVersion();
1171
+ while (reader.pos < end) {
1172
+ const tag = reader.uint32();
1173
+ switch (tag >>> 3) {
1174
+ case 1: {
1175
+ if (tag !== 10) {
1176
+ break;
1177
+ }
1178
+ message.id = reader.string();
1179
+ continue;
1180
+ }
1181
+ case 2: {
1182
+ if (tag !== 18) {
1183
+ break;
1184
+ }
1185
+ message.templateId = reader.string();
1186
+ continue;
1187
+ }
1188
+ case 3: {
1189
+ if (tag !== 26) {
1190
+ break;
1191
+ }
1192
+ message.organizationId = reader.string();
1193
+ continue;
1194
+ }
1195
+ case 4: {
1196
+ if (tag !== 32) {
1197
+ break;
1198
+ }
1199
+ message.version = reader.int32();
1200
+ continue;
1201
+ }
1202
+ case 5: {
1203
+ if (tag !== 40) {
1204
+ break;
1205
+ }
1206
+ message.sourceDraftRevision = reader.int32();
1207
+ continue;
1208
+ }
1209
+ case 6: {
1210
+ if (tag !== 50) {
1211
+ break;
1212
+ }
1213
+ message.name = reader.string();
1214
+ continue;
1215
+ }
1216
+ case 7: {
1217
+ if (tag !== 58) {
1218
+ break;
1219
+ }
1220
+ message.description = reader.string();
1221
+ continue;
1222
+ }
1223
+ case 8: {
1224
+ if (tag !== 66) {
1225
+ break;
1226
+ }
1227
+ message.instructions = reader.string();
1228
+ continue;
1229
+ }
1230
+ case 9: {
1231
+ if (tag !== 74) {
1232
+ break;
1233
+ }
1234
+ message.modelId = reader.string();
1235
+ continue;
1236
+ }
1237
+ case 10: {
1238
+ if (tag !== 82) {
1239
+ break;
1240
+ }
1241
+ message.providerConfigurationId = reader.string();
1242
+ continue;
1243
+ }
1244
+ case 11: {
1245
+ if (tag !== 90) {
1246
+ break;
1247
+ }
1248
+ message.tools.push(exports.AgentToolDescriptor.decode(reader, reader.uint32()));
1249
+ continue;
1250
+ }
1251
+ case 12: {
1252
+ if (tag !== 98) {
1253
+ break;
1254
+ }
1255
+ message.inputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1256
+ continue;
1257
+ }
1258
+ case 13: {
1259
+ if (tag !== 106) {
1260
+ break;
1261
+ }
1262
+ message.outputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1263
+ continue;
1264
+ }
1265
+ case 14: {
1266
+ if (tag !== 114) {
1267
+ break;
1268
+ }
1269
+ message.metadata = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1270
+ continue;
1271
+ }
1272
+ case 15: {
1273
+ if (tag !== 122) {
1274
+ break;
1275
+ }
1276
+ message.publishedByUserId = reader.string();
1277
+ continue;
1278
+ }
1279
+ case 16: {
1280
+ if (tag !== 130) {
1281
+ break;
1282
+ }
1283
+ message.publishedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
1284
+ continue;
1285
+ }
1286
+ }
1287
+ if ((tag & 7) === 4 || tag === 0) {
1288
+ break;
1289
+ }
1290
+ reader.skip(tag & 7);
1291
+ }
1292
+ return message;
1293
+ },
1294
+ fromJSON(object) {
1295
+ return {
1296
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1297
+ templateId: isSet(object.templateId)
1298
+ ? globalThis.String(object.templateId)
1299
+ : isSet(object.template_id)
1300
+ ? globalThis.String(object.template_id)
1301
+ : "",
1302
+ organizationId: isSet(object.organizationId)
1303
+ ? globalThis.String(object.organizationId)
1304
+ : isSet(object.organization_id)
1305
+ ? globalThis.String(object.organization_id)
1306
+ : "",
1307
+ version: isSet(object.version) ? globalThis.Number(object.version) : 0,
1308
+ sourceDraftRevision: isSet(object.sourceDraftRevision)
1309
+ ? globalThis.Number(object.sourceDraftRevision)
1310
+ : isSet(object.source_draft_revision)
1311
+ ? globalThis.Number(object.source_draft_revision)
1312
+ : 0,
1313
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1314
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
1315
+ instructions: isSet(object.instructions) ? globalThis.String(object.instructions) : "",
1316
+ modelId: isSet(object.modelId)
1317
+ ? globalThis.String(object.modelId)
1318
+ : isSet(object.model_id)
1319
+ ? globalThis.String(object.model_id)
1320
+ : "",
1321
+ providerConfigurationId: isSet(object.providerConfigurationId)
1322
+ ? globalThis.String(object.providerConfigurationId)
1323
+ : isSet(object.provider_configuration_id)
1324
+ ? globalThis.String(object.provider_configuration_id)
1325
+ : "",
1326
+ tools: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.tools)
1327
+ ? object.tools.map((e) => exports.AgentToolDescriptor.fromJSON(e))
1328
+ : [],
1329
+ inputSchema: isObject(object.inputSchema)
1330
+ ? object.inputSchema
1331
+ : isObject(object.input_schema)
1332
+ ? object.input_schema
1333
+ : undefined,
1334
+ outputSchema: isObject(object.outputSchema)
1335
+ ? object.outputSchema
1336
+ : isObject(object.output_schema)
1337
+ ? object.output_schema
1338
+ : undefined,
1339
+ metadata: isObject(object.metadata) ? object.metadata : undefined,
1340
+ publishedByUserId: isSet(object.publishedByUserId)
1341
+ ? globalThis.String(object.publishedByUserId)
1342
+ : isSet(object.published_by_user_id)
1343
+ ? globalThis.String(object.published_by_user_id)
1344
+ : "",
1345
+ publishedAt: isSet(object.publishedAt)
1346
+ ? fromJsonTimestamp(object.publishedAt)
1347
+ : isSet(object.published_at)
1348
+ ? fromJsonTimestamp(object.published_at)
1349
+ : undefined,
1350
+ };
1351
+ },
1352
+ toJSON(message) {
1353
+ var _a;
1354
+ const obj = {};
1355
+ if (message.id !== "") {
1356
+ obj.id = message.id;
1357
+ }
1358
+ if (message.templateId !== "") {
1359
+ obj.templateId = message.templateId;
1360
+ }
1361
+ if (message.organizationId !== "") {
1362
+ obj.organizationId = message.organizationId;
1363
+ }
1364
+ if (message.version !== 0) {
1365
+ obj.version = Math.round(message.version);
1366
+ }
1367
+ if (message.sourceDraftRevision !== 0) {
1368
+ obj.sourceDraftRevision = Math.round(message.sourceDraftRevision);
1369
+ }
1370
+ if (message.name !== "") {
1371
+ obj.name = message.name;
1372
+ }
1373
+ if (message.description !== "") {
1374
+ obj.description = message.description;
1375
+ }
1376
+ if (message.instructions !== "") {
1377
+ obj.instructions = message.instructions;
1378
+ }
1379
+ if (message.modelId !== "") {
1380
+ obj.modelId = message.modelId;
1381
+ }
1382
+ if (message.providerConfigurationId !== "") {
1383
+ obj.providerConfigurationId = message.providerConfigurationId;
1384
+ }
1385
+ if ((_a = message.tools) === null || _a === void 0 ? void 0 : _a.length) {
1386
+ obj.tools = message.tools.map((e) => exports.AgentToolDescriptor.toJSON(e));
1387
+ }
1388
+ if (message.inputSchema !== undefined) {
1389
+ obj.inputSchema = message.inputSchema;
1390
+ }
1391
+ if (message.outputSchema !== undefined) {
1392
+ obj.outputSchema = message.outputSchema;
1393
+ }
1394
+ if (message.metadata !== undefined) {
1395
+ obj.metadata = message.metadata;
1396
+ }
1397
+ if (message.publishedByUserId !== "") {
1398
+ obj.publishedByUserId = message.publishedByUserId;
1399
+ }
1400
+ if (message.publishedAt !== undefined) {
1401
+ obj.publishedAt = message.publishedAt.toISOString();
1402
+ }
1403
+ return obj;
1404
+ },
1405
+ create(base) {
1406
+ return exports.AgentVersion.fromPartial(base !== null && base !== void 0 ? base : {});
1407
+ },
1408
+ fromPartial(object) {
1409
+ var _a;
1410
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
1411
+ const message = createBaseAgentVersion();
1412
+ message.id = (_b = object.id) !== null && _b !== void 0 ? _b : "";
1413
+ message.templateId = (_c = object.templateId) !== null && _c !== void 0 ? _c : "";
1414
+ message.organizationId = (_d = object.organizationId) !== null && _d !== void 0 ? _d : "";
1415
+ message.version = (_e = object.version) !== null && _e !== void 0 ? _e : 0;
1416
+ message.sourceDraftRevision = (_f = object.sourceDraftRevision) !== null && _f !== void 0 ? _f : 0;
1417
+ message.name = (_g = object.name) !== null && _g !== void 0 ? _g : "";
1418
+ message.description = (_h = object.description) !== null && _h !== void 0 ? _h : "";
1419
+ message.instructions = (_j = object.instructions) !== null && _j !== void 0 ? _j : "";
1420
+ message.modelId = (_k = object.modelId) !== null && _k !== void 0 ? _k : "";
1421
+ message.providerConfigurationId = (_l = object.providerConfigurationId) !== null && _l !== void 0 ? _l : "";
1422
+ message.tools = ((_a = object.tools) === null || _a === void 0 ? void 0 : _a.map((e) => exports.AgentToolDescriptor.fromPartial(e))) || [];
1423
+ message.inputSchema = (_m = object.inputSchema) !== null && _m !== void 0 ? _m : undefined;
1424
+ message.outputSchema = (_o = object.outputSchema) !== null && _o !== void 0 ? _o : undefined;
1425
+ message.metadata = (_p = object.metadata) !== null && _p !== void 0 ? _p : undefined;
1426
+ message.publishedByUserId = (_q = object.publishedByUserId) !== null && _q !== void 0 ? _q : "";
1427
+ message.publishedAt = (_r = object.publishedAt) !== null && _r !== void 0 ? _r : undefined;
1428
+ return message;
1429
+ },
1430
+ };
1431
+ function createBaseAgentToolDescriptor() {
1432
+ return {
1433
+ name: "",
1434
+ displayName: "",
1435
+ description: "",
1436
+ kind: 0,
1437
+ approvalMode: 0,
1438
+ inputSchema: undefined,
1439
+ outputSchema: undefined,
1440
+ config: undefined,
1441
+ };
1442
+ }
1443
+ exports.AgentToolDescriptor = {
1444
+ encode(message, writer = new wire_1.BinaryWriter()) {
1445
+ if (message.name !== "") {
1446
+ writer.uint32(10).string(message.name);
1447
+ }
1448
+ if (message.displayName !== "") {
1449
+ writer.uint32(18).string(message.displayName);
1450
+ }
1451
+ if (message.description !== "") {
1452
+ writer.uint32(26).string(message.description);
1453
+ }
1454
+ if (message.kind !== 0) {
1455
+ writer.uint32(32).int32(message.kind);
1456
+ }
1457
+ if (message.approvalMode !== 0) {
1458
+ writer.uint32(40).int32(message.approvalMode);
1459
+ }
1460
+ if (message.inputSchema !== undefined) {
1461
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.inputSchema), writer.uint32(50).fork()).join();
1462
+ }
1463
+ if (message.outputSchema !== undefined) {
1464
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.outputSchema), writer.uint32(58).fork()).join();
1465
+ }
1466
+ if (message.config !== undefined) {
1467
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.config), writer.uint32(66).fork()).join();
1468
+ }
1469
+ return writer;
1470
+ },
1471
+ decode(input, length) {
1472
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1473
+ const end = length === undefined ? reader.len : reader.pos + length;
1474
+ const message = createBaseAgentToolDescriptor();
1475
+ while (reader.pos < end) {
1476
+ const tag = reader.uint32();
1477
+ switch (tag >>> 3) {
1478
+ case 1: {
1479
+ if (tag !== 10) {
1480
+ break;
1481
+ }
1482
+ message.name = reader.string();
1483
+ continue;
1484
+ }
1485
+ case 2: {
1486
+ if (tag !== 18) {
1487
+ break;
1488
+ }
1489
+ message.displayName = reader.string();
1490
+ continue;
1491
+ }
1492
+ case 3: {
1493
+ if (tag !== 26) {
1494
+ break;
1495
+ }
1496
+ message.description = reader.string();
1497
+ continue;
1498
+ }
1499
+ case 4: {
1500
+ if (tag !== 32) {
1501
+ break;
1502
+ }
1503
+ message.kind = reader.int32();
1504
+ continue;
1505
+ }
1506
+ case 5: {
1507
+ if (tag !== 40) {
1508
+ break;
1509
+ }
1510
+ message.approvalMode = reader.int32();
1511
+ continue;
1512
+ }
1513
+ case 6: {
1514
+ if (tag !== 50) {
1515
+ break;
1516
+ }
1517
+ message.inputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1518
+ continue;
1519
+ }
1520
+ case 7: {
1521
+ if (tag !== 58) {
1522
+ break;
1523
+ }
1524
+ message.outputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1525
+ continue;
1526
+ }
1527
+ case 8: {
1528
+ if (tag !== 66) {
1529
+ break;
1530
+ }
1531
+ message.config = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1532
+ continue;
1533
+ }
1534
+ }
1535
+ if ((tag & 7) === 4 || tag === 0) {
1536
+ break;
1537
+ }
1538
+ reader.skip(tag & 7);
1539
+ }
1540
+ return message;
1541
+ },
1542
+ fromJSON(object) {
1543
+ return {
1544
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1545
+ displayName: isSet(object.displayName)
1546
+ ? globalThis.String(object.displayName)
1547
+ : isSet(object.display_name)
1548
+ ? globalThis.String(object.display_name)
1549
+ : "",
1550
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
1551
+ kind: isSet(object.kind) ? agentToolDescriptorKindFromJSON(object.kind) : 0,
1552
+ approvalMode: isSet(object.approvalMode)
1553
+ ? agentToolApprovalModeFromJSON(object.approvalMode)
1554
+ : isSet(object.approval_mode)
1555
+ ? agentToolApprovalModeFromJSON(object.approval_mode)
1556
+ : 0,
1557
+ inputSchema: isObject(object.inputSchema)
1558
+ ? object.inputSchema
1559
+ : isObject(object.input_schema)
1560
+ ? object.input_schema
1561
+ : undefined,
1562
+ outputSchema: isObject(object.outputSchema)
1563
+ ? object.outputSchema
1564
+ : isObject(object.output_schema)
1565
+ ? object.output_schema
1566
+ : undefined,
1567
+ config: isObject(object.config) ? object.config : undefined,
1568
+ };
1569
+ },
1570
+ toJSON(message) {
1571
+ const obj = {};
1572
+ if (message.name !== "") {
1573
+ obj.name = message.name;
1574
+ }
1575
+ if (message.displayName !== "") {
1576
+ obj.displayName = message.displayName;
1577
+ }
1578
+ if (message.description !== "") {
1579
+ obj.description = message.description;
1580
+ }
1581
+ if (message.kind !== 0) {
1582
+ obj.kind = agentToolDescriptorKindToJSON(message.kind);
1583
+ }
1584
+ if (message.approvalMode !== 0) {
1585
+ obj.approvalMode = agentToolApprovalModeToJSON(message.approvalMode);
1586
+ }
1587
+ if (message.inputSchema !== undefined) {
1588
+ obj.inputSchema = message.inputSchema;
1589
+ }
1590
+ if (message.outputSchema !== undefined) {
1591
+ obj.outputSchema = message.outputSchema;
1592
+ }
1593
+ if (message.config !== undefined) {
1594
+ obj.config = message.config;
1595
+ }
1596
+ return obj;
1597
+ },
1598
+ create(base) {
1599
+ return exports.AgentToolDescriptor.fromPartial(base !== null && base !== void 0 ? base : {});
1600
+ },
1601
+ fromPartial(object) {
1602
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1603
+ const message = createBaseAgentToolDescriptor();
1604
+ message.name = (_a = object.name) !== null && _a !== void 0 ? _a : "";
1605
+ message.displayName = (_b = object.displayName) !== null && _b !== void 0 ? _b : "";
1606
+ message.description = (_c = object.description) !== null && _c !== void 0 ? _c : "";
1607
+ message.kind = (_d = object.kind) !== null && _d !== void 0 ? _d : 0;
1608
+ message.approvalMode = (_e = object.approvalMode) !== null && _e !== void 0 ? _e : 0;
1609
+ message.inputSchema = (_f = object.inputSchema) !== null && _f !== void 0 ? _f : undefined;
1610
+ message.outputSchema = (_g = object.outputSchema) !== null && _g !== void 0 ? _g : undefined;
1611
+ message.config = (_h = object.config) !== null && _h !== void 0 ? _h : undefined;
1612
+ return message;
1613
+ },
1614
+ };
1615
+ function createBaseAgentPublishPlan() {
1616
+ return { templateId: "", draftRevision: 0, publishable: false, issues: [], compiledPreview: undefined };
1617
+ }
1618
+ exports.AgentPublishPlan = {
1619
+ encode(message, writer = new wire_1.BinaryWriter()) {
1620
+ if (message.templateId !== "") {
1621
+ writer.uint32(10).string(message.templateId);
1622
+ }
1623
+ if (message.draftRevision !== 0) {
1624
+ writer.uint32(16).int32(message.draftRevision);
1625
+ }
1626
+ if (message.publishable !== false) {
1627
+ writer.uint32(24).bool(message.publishable);
1628
+ }
1629
+ for (const v of message.issues) {
1630
+ exports.AgentPublishPlanIssue.encode(v, writer.uint32(34).fork()).join();
1631
+ }
1632
+ if (message.compiledPreview !== undefined) {
1633
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.compiledPreview), writer.uint32(42).fork()).join();
1634
+ }
1635
+ return writer;
1636
+ },
1637
+ decode(input, length) {
1638
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1639
+ const end = length === undefined ? reader.len : reader.pos + length;
1640
+ const message = createBaseAgentPublishPlan();
1641
+ while (reader.pos < end) {
1642
+ const tag = reader.uint32();
1643
+ switch (tag >>> 3) {
1644
+ case 1: {
1645
+ if (tag !== 10) {
1646
+ break;
1647
+ }
1648
+ message.templateId = reader.string();
1649
+ continue;
1650
+ }
1651
+ case 2: {
1652
+ if (tag !== 16) {
1653
+ break;
1654
+ }
1655
+ message.draftRevision = reader.int32();
1656
+ continue;
1657
+ }
1658
+ case 3: {
1659
+ if (tag !== 24) {
1660
+ break;
1661
+ }
1662
+ message.publishable = reader.bool();
1663
+ continue;
1664
+ }
1665
+ case 4: {
1666
+ if (tag !== 34) {
1667
+ break;
1668
+ }
1669
+ message.issues.push(exports.AgentPublishPlanIssue.decode(reader, reader.uint32()));
1670
+ continue;
1671
+ }
1672
+ case 5: {
1673
+ if (tag !== 42) {
1674
+ break;
1675
+ }
1676
+ message.compiledPreview = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1677
+ continue;
1678
+ }
1679
+ }
1680
+ if ((tag & 7) === 4 || tag === 0) {
1681
+ break;
1682
+ }
1683
+ reader.skip(tag & 7);
1684
+ }
1685
+ return message;
1686
+ },
1687
+ fromJSON(object) {
1688
+ return {
1689
+ templateId: isSet(object.templateId)
1690
+ ? globalThis.String(object.templateId)
1691
+ : isSet(object.template_id)
1692
+ ? globalThis.String(object.template_id)
1693
+ : "",
1694
+ draftRevision: isSet(object.draftRevision)
1695
+ ? globalThis.Number(object.draftRevision)
1696
+ : isSet(object.draft_revision)
1697
+ ? globalThis.Number(object.draft_revision)
1698
+ : 0,
1699
+ publishable: isSet(object.publishable) ? globalThis.Boolean(object.publishable) : false,
1700
+ issues: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.issues)
1701
+ ? object.issues.map((e) => exports.AgentPublishPlanIssue.fromJSON(e))
1702
+ : [],
1703
+ compiledPreview: isObject(object.compiledPreview)
1704
+ ? object.compiledPreview
1705
+ : isObject(object.compiled_preview)
1706
+ ? object.compiled_preview
1707
+ : undefined,
1708
+ };
1709
+ },
1710
+ toJSON(message) {
1711
+ var _a;
1712
+ const obj = {};
1713
+ if (message.templateId !== "") {
1714
+ obj.templateId = message.templateId;
1715
+ }
1716
+ if (message.draftRevision !== 0) {
1717
+ obj.draftRevision = Math.round(message.draftRevision);
1718
+ }
1719
+ if (message.publishable !== false) {
1720
+ obj.publishable = message.publishable;
1721
+ }
1722
+ if ((_a = message.issues) === null || _a === void 0 ? void 0 : _a.length) {
1723
+ obj.issues = message.issues.map((e) => exports.AgentPublishPlanIssue.toJSON(e));
1724
+ }
1725
+ if (message.compiledPreview !== undefined) {
1726
+ obj.compiledPreview = message.compiledPreview;
1727
+ }
1728
+ return obj;
1729
+ },
1730
+ create(base) {
1731
+ return exports.AgentPublishPlan.fromPartial(base !== null && base !== void 0 ? base : {});
1732
+ },
1733
+ fromPartial(object) {
1734
+ var _a;
1735
+ var _b, _c, _d, _e;
1736
+ const message = createBaseAgentPublishPlan();
1737
+ message.templateId = (_b = object.templateId) !== null && _b !== void 0 ? _b : "";
1738
+ message.draftRevision = (_c = object.draftRevision) !== null && _c !== void 0 ? _c : 0;
1739
+ message.publishable = (_d = object.publishable) !== null && _d !== void 0 ? _d : false;
1740
+ message.issues = ((_a = object.issues) === null || _a === void 0 ? void 0 : _a.map((e) => exports.AgentPublishPlanIssue.fromPartial(e))) || [];
1741
+ message.compiledPreview = (_e = object.compiledPreview) !== null && _e !== void 0 ? _e : undefined;
1742
+ return message;
1743
+ },
1744
+ };
1745
+ function createBaseAgentPublishPlanIssue() {
1746
+ return { code: "", message: "", path: "" };
1747
+ }
1748
+ exports.AgentPublishPlanIssue = {
1749
+ encode(message, writer = new wire_1.BinaryWriter()) {
1750
+ if (message.code !== "") {
1751
+ writer.uint32(10).string(message.code);
1752
+ }
1753
+ if (message.message !== "") {
1754
+ writer.uint32(18).string(message.message);
1755
+ }
1756
+ if (message.path !== "") {
1757
+ writer.uint32(26).string(message.path);
1758
+ }
1759
+ return writer;
1760
+ },
1761
+ decode(input, length) {
1762
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1763
+ const end = length === undefined ? reader.len : reader.pos + length;
1764
+ const message = createBaseAgentPublishPlanIssue();
1765
+ while (reader.pos < end) {
1766
+ const tag = reader.uint32();
1767
+ switch (tag >>> 3) {
1768
+ case 1: {
1769
+ if (tag !== 10) {
1770
+ break;
1771
+ }
1772
+ message.code = reader.string();
1773
+ continue;
1774
+ }
1775
+ case 2: {
1776
+ if (tag !== 18) {
1777
+ break;
1778
+ }
1779
+ message.message = reader.string();
1780
+ continue;
1781
+ }
1782
+ case 3: {
1783
+ if (tag !== 26) {
1784
+ break;
1785
+ }
1786
+ message.path = reader.string();
1787
+ continue;
1788
+ }
1789
+ }
1790
+ if ((tag & 7) === 4 || tag === 0) {
1791
+ break;
1792
+ }
1793
+ reader.skip(tag & 7);
1794
+ }
1795
+ return message;
1796
+ },
1797
+ fromJSON(object) {
1798
+ return {
1799
+ code: isSet(object.code) ? globalThis.String(object.code) : "",
1800
+ message: isSet(object.message) ? globalThis.String(object.message) : "",
1801
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
1802
+ };
1803
+ },
1804
+ toJSON(message) {
1805
+ const obj = {};
1806
+ if (message.code !== "") {
1807
+ obj.code = message.code;
1808
+ }
1809
+ if (message.message !== "") {
1810
+ obj.message = message.message;
1811
+ }
1812
+ if (message.path !== "") {
1813
+ obj.path = message.path;
1814
+ }
1815
+ return obj;
1816
+ },
1817
+ create(base) {
1818
+ return exports.AgentPublishPlanIssue.fromPartial(base !== null && base !== void 0 ? base : {});
1819
+ },
1820
+ fromPartial(object) {
1821
+ var _a, _b, _c;
1822
+ const message = createBaseAgentPublishPlanIssue();
1823
+ message.code = (_a = object.code) !== null && _a !== void 0 ? _a : "";
1824
+ message.message = (_b = object.message) !== null && _b !== void 0 ? _b : "";
1825
+ message.path = (_c = object.path) !== null && _c !== void 0 ? _c : "";
1826
+ return message;
1827
+ },
1828
+ };
1829
+ function createBaseAgentRun() {
1830
+ return {
1831
+ id: "",
1832
+ organizationId: "",
1833
+ agentTemplateId: "",
1834
+ agentVersionId: "",
1835
+ status: 0,
1836
+ createdByUserId: "",
1837
+ chatSessionId: "",
1838
+ workflowRunId: "",
1839
+ workflowStepRunId: "",
1840
+ input: undefined,
1841
+ output: undefined,
1842
+ errorCode: "",
1843
+ safeErrorMessage: "",
1844
+ createdAt: undefined,
1845
+ startedAt: undefined,
1846
+ finishedAt: undefined,
1847
+ };
1848
+ }
1849
+ exports.AgentRun = {
1850
+ encode(message, writer = new wire_1.BinaryWriter()) {
1851
+ if (message.id !== "") {
1852
+ writer.uint32(10).string(message.id);
1853
+ }
1854
+ if (message.organizationId !== "") {
1855
+ writer.uint32(18).string(message.organizationId);
1856
+ }
1857
+ if (message.agentTemplateId !== "") {
1858
+ writer.uint32(26).string(message.agentTemplateId);
1859
+ }
1860
+ if (message.agentVersionId !== "") {
1861
+ writer.uint32(34).string(message.agentVersionId);
1862
+ }
1863
+ if (message.status !== 0) {
1864
+ writer.uint32(40).int32(message.status);
1865
+ }
1866
+ if (message.createdByUserId !== "") {
1867
+ writer.uint32(50).string(message.createdByUserId);
1868
+ }
1869
+ if (message.chatSessionId !== "") {
1870
+ writer.uint32(58).string(message.chatSessionId);
1871
+ }
1872
+ if (message.workflowRunId !== "") {
1873
+ writer.uint32(66).string(message.workflowRunId);
1874
+ }
1875
+ if (message.workflowStepRunId !== "") {
1876
+ writer.uint32(74).string(message.workflowStepRunId);
1877
+ }
1878
+ if (message.input !== undefined) {
1879
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.input), writer.uint32(82).fork()).join();
1880
+ }
1881
+ if (message.output !== undefined) {
1882
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.output), writer.uint32(90).fork()).join();
1883
+ }
1884
+ if (message.errorCode !== "") {
1885
+ writer.uint32(98).string(message.errorCode);
1886
+ }
1887
+ if (message.safeErrorMessage !== "") {
1888
+ writer.uint32(106).string(message.safeErrorMessage);
1889
+ }
1890
+ if (message.createdAt !== undefined) {
1891
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(114).fork()).join();
1892
+ }
1893
+ if (message.startedAt !== undefined) {
1894
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(122).fork()).join();
1895
+ }
1896
+ if (message.finishedAt !== undefined) {
1897
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(130).fork()).join();
1898
+ }
1899
+ return writer;
1900
+ },
1901
+ decode(input, length) {
1902
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1903
+ const end = length === undefined ? reader.len : reader.pos + length;
1904
+ const message = createBaseAgentRun();
1905
+ while (reader.pos < end) {
1906
+ const tag = reader.uint32();
1907
+ switch (tag >>> 3) {
1908
+ case 1: {
1909
+ if (tag !== 10) {
1910
+ break;
1911
+ }
1912
+ message.id = reader.string();
1913
+ continue;
1914
+ }
1915
+ case 2: {
1916
+ if (tag !== 18) {
1917
+ break;
1918
+ }
1919
+ message.organizationId = reader.string();
1920
+ continue;
1921
+ }
1922
+ case 3: {
1923
+ if (tag !== 26) {
1924
+ break;
1925
+ }
1926
+ message.agentTemplateId = reader.string();
1927
+ continue;
1928
+ }
1929
+ case 4: {
1930
+ if (tag !== 34) {
1931
+ break;
1932
+ }
1933
+ message.agentVersionId = reader.string();
1934
+ continue;
1935
+ }
1936
+ case 5: {
1937
+ if (tag !== 40) {
1938
+ break;
1939
+ }
1940
+ message.status = reader.int32();
1941
+ continue;
1942
+ }
1943
+ case 6: {
1944
+ if (tag !== 50) {
1945
+ break;
1946
+ }
1947
+ message.createdByUserId = reader.string();
1948
+ continue;
1949
+ }
1950
+ case 7: {
1951
+ if (tag !== 58) {
1952
+ break;
1953
+ }
1954
+ message.chatSessionId = reader.string();
1955
+ continue;
1956
+ }
1957
+ case 8: {
1958
+ if (tag !== 66) {
1959
+ break;
1960
+ }
1961
+ message.workflowRunId = reader.string();
1962
+ continue;
1963
+ }
1964
+ case 9: {
1965
+ if (tag !== 74) {
1966
+ break;
1967
+ }
1968
+ message.workflowStepRunId = reader.string();
1969
+ continue;
1970
+ }
1971
+ case 10: {
1972
+ if (tag !== 82) {
1973
+ break;
1974
+ }
1975
+ message.input = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1976
+ continue;
1977
+ }
1978
+ case 11: {
1979
+ if (tag !== 90) {
1980
+ break;
1981
+ }
1982
+ message.output = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1983
+ continue;
1984
+ }
1985
+ case 12: {
1986
+ if (tag !== 98) {
1987
+ break;
1988
+ }
1989
+ message.errorCode = reader.string();
1990
+ continue;
1991
+ }
1992
+ case 13: {
1993
+ if (tag !== 106) {
1994
+ break;
1995
+ }
1996
+ message.safeErrorMessage = reader.string();
1997
+ continue;
1998
+ }
1999
+ case 14: {
2000
+ if (tag !== 114) {
2001
+ break;
2002
+ }
2003
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2004
+ continue;
2005
+ }
2006
+ case 15: {
2007
+ if (tag !== 122) {
2008
+ break;
2009
+ }
2010
+ message.startedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2011
+ continue;
2012
+ }
2013
+ case 16: {
2014
+ if (tag !== 130) {
2015
+ break;
2016
+ }
2017
+ message.finishedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2018
+ continue;
2019
+ }
2020
+ }
2021
+ if ((tag & 7) === 4 || tag === 0) {
2022
+ break;
2023
+ }
2024
+ reader.skip(tag & 7);
2025
+ }
2026
+ return message;
2027
+ },
2028
+ fromJSON(object) {
2029
+ return {
2030
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2031
+ organizationId: isSet(object.organizationId)
2032
+ ? globalThis.String(object.organizationId)
2033
+ : isSet(object.organization_id)
2034
+ ? globalThis.String(object.organization_id)
2035
+ : "",
2036
+ agentTemplateId: isSet(object.agentTemplateId)
2037
+ ? globalThis.String(object.agentTemplateId)
2038
+ : isSet(object.agent_template_id)
2039
+ ? globalThis.String(object.agent_template_id)
2040
+ : "",
2041
+ agentVersionId: isSet(object.agentVersionId)
2042
+ ? globalThis.String(object.agentVersionId)
2043
+ : isSet(object.agent_version_id)
2044
+ ? globalThis.String(object.agent_version_id)
2045
+ : "",
2046
+ status: isSet(object.status) ? agentRunStatusFromJSON(object.status) : 0,
2047
+ createdByUserId: isSet(object.createdByUserId)
2048
+ ? globalThis.String(object.createdByUserId)
2049
+ : isSet(object.created_by_user_id)
2050
+ ? globalThis.String(object.created_by_user_id)
2051
+ : "",
2052
+ chatSessionId: isSet(object.chatSessionId)
2053
+ ? globalThis.String(object.chatSessionId)
2054
+ : isSet(object.chat_session_id)
2055
+ ? globalThis.String(object.chat_session_id)
2056
+ : "",
2057
+ workflowRunId: isSet(object.workflowRunId)
2058
+ ? globalThis.String(object.workflowRunId)
2059
+ : isSet(object.workflow_run_id)
2060
+ ? globalThis.String(object.workflow_run_id)
2061
+ : "",
2062
+ workflowStepRunId: isSet(object.workflowStepRunId)
2063
+ ? globalThis.String(object.workflowStepRunId)
2064
+ : isSet(object.workflow_step_run_id)
2065
+ ? globalThis.String(object.workflow_step_run_id)
2066
+ : "",
2067
+ input: isObject(object.input) ? object.input : undefined,
2068
+ output: isObject(object.output) ? object.output : undefined,
2069
+ errorCode: isSet(object.errorCode)
2070
+ ? globalThis.String(object.errorCode)
2071
+ : isSet(object.error_code)
2072
+ ? globalThis.String(object.error_code)
2073
+ : "",
2074
+ safeErrorMessage: isSet(object.safeErrorMessage)
2075
+ ? globalThis.String(object.safeErrorMessage)
2076
+ : isSet(object.safe_error_message)
2077
+ ? globalThis.String(object.safe_error_message)
2078
+ : "",
2079
+ createdAt: isSet(object.createdAt)
2080
+ ? fromJsonTimestamp(object.createdAt)
2081
+ : isSet(object.created_at)
2082
+ ? fromJsonTimestamp(object.created_at)
2083
+ : undefined,
2084
+ startedAt: isSet(object.startedAt)
2085
+ ? fromJsonTimestamp(object.startedAt)
2086
+ : isSet(object.started_at)
2087
+ ? fromJsonTimestamp(object.started_at)
2088
+ : undefined,
2089
+ finishedAt: isSet(object.finishedAt)
2090
+ ? fromJsonTimestamp(object.finishedAt)
2091
+ : isSet(object.finished_at)
2092
+ ? fromJsonTimestamp(object.finished_at)
2093
+ : undefined,
2094
+ };
2095
+ },
2096
+ toJSON(message) {
2097
+ const obj = {};
2098
+ if (message.id !== "") {
2099
+ obj.id = message.id;
2100
+ }
2101
+ if (message.organizationId !== "") {
2102
+ obj.organizationId = message.organizationId;
2103
+ }
2104
+ if (message.agentTemplateId !== "") {
2105
+ obj.agentTemplateId = message.agentTemplateId;
2106
+ }
2107
+ if (message.agentVersionId !== "") {
2108
+ obj.agentVersionId = message.agentVersionId;
2109
+ }
2110
+ if (message.status !== 0) {
2111
+ obj.status = agentRunStatusToJSON(message.status);
2112
+ }
2113
+ if (message.createdByUserId !== "") {
2114
+ obj.createdByUserId = message.createdByUserId;
2115
+ }
2116
+ if (message.chatSessionId !== "") {
2117
+ obj.chatSessionId = message.chatSessionId;
2118
+ }
2119
+ if (message.workflowRunId !== "") {
2120
+ obj.workflowRunId = message.workflowRunId;
2121
+ }
2122
+ if (message.workflowStepRunId !== "") {
2123
+ obj.workflowStepRunId = message.workflowStepRunId;
2124
+ }
2125
+ if (message.input !== undefined) {
2126
+ obj.input = message.input;
2127
+ }
2128
+ if (message.output !== undefined) {
2129
+ obj.output = message.output;
2130
+ }
2131
+ if (message.errorCode !== "") {
2132
+ obj.errorCode = message.errorCode;
2133
+ }
2134
+ if (message.safeErrorMessage !== "") {
2135
+ obj.safeErrorMessage = message.safeErrorMessage;
2136
+ }
2137
+ if (message.createdAt !== undefined) {
2138
+ obj.createdAt = message.createdAt.toISOString();
2139
+ }
2140
+ if (message.startedAt !== undefined) {
2141
+ obj.startedAt = message.startedAt.toISOString();
2142
+ }
2143
+ if (message.finishedAt !== undefined) {
2144
+ obj.finishedAt = message.finishedAt.toISOString();
2145
+ }
2146
+ return obj;
2147
+ },
2148
+ create(base) {
2149
+ return exports.AgentRun.fromPartial(base !== null && base !== void 0 ? base : {});
2150
+ },
2151
+ fromPartial(object) {
2152
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
2153
+ const message = createBaseAgentRun();
2154
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
2155
+ message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : "";
2156
+ message.agentTemplateId = (_c = object.agentTemplateId) !== null && _c !== void 0 ? _c : "";
2157
+ message.agentVersionId = (_d = object.agentVersionId) !== null && _d !== void 0 ? _d : "";
2158
+ message.status = (_e = object.status) !== null && _e !== void 0 ? _e : 0;
2159
+ message.createdByUserId = (_f = object.createdByUserId) !== null && _f !== void 0 ? _f : "";
2160
+ message.chatSessionId = (_g = object.chatSessionId) !== null && _g !== void 0 ? _g : "";
2161
+ message.workflowRunId = (_h = object.workflowRunId) !== null && _h !== void 0 ? _h : "";
2162
+ message.workflowStepRunId = (_j = object.workflowStepRunId) !== null && _j !== void 0 ? _j : "";
2163
+ message.input = (_k = object.input) !== null && _k !== void 0 ? _k : undefined;
2164
+ message.output = (_l = object.output) !== null && _l !== void 0 ? _l : undefined;
2165
+ message.errorCode = (_m = object.errorCode) !== null && _m !== void 0 ? _m : "";
2166
+ message.safeErrorMessage = (_o = object.safeErrorMessage) !== null && _o !== void 0 ? _o : "";
2167
+ message.createdAt = (_p = object.createdAt) !== null && _p !== void 0 ? _p : undefined;
2168
+ message.startedAt = (_q = object.startedAt) !== null && _q !== void 0 ? _q : undefined;
2169
+ message.finishedAt = (_r = object.finishedAt) !== null && _r !== void 0 ? _r : undefined;
2170
+ return message;
2171
+ },
2172
+ };
2173
+ function createBaseAgentRunEvent() {
2174
+ return {
2175
+ id: "",
2176
+ organizationId: "",
2177
+ agentRunId: "",
2178
+ sequence: 0,
2179
+ kind: 0,
2180
+ message: "",
2181
+ payload: undefined,
2182
+ createdAt: undefined,
2183
+ };
2184
+ }
2185
+ exports.AgentRunEvent = {
2186
+ encode(message, writer = new wire_1.BinaryWriter()) {
2187
+ if (message.id !== "") {
2188
+ writer.uint32(10).string(message.id);
2189
+ }
2190
+ if (message.organizationId !== "") {
2191
+ writer.uint32(18).string(message.organizationId);
2192
+ }
2193
+ if (message.agentRunId !== "") {
2194
+ writer.uint32(26).string(message.agentRunId);
2195
+ }
2196
+ if (message.sequence !== 0) {
2197
+ writer.uint32(32).uint64(message.sequence);
2198
+ }
2199
+ if (message.kind !== 0) {
2200
+ writer.uint32(40).int32(message.kind);
2201
+ }
2202
+ if (message.message !== "") {
2203
+ writer.uint32(50).string(message.message);
2204
+ }
2205
+ if (message.payload !== undefined) {
2206
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.payload), writer.uint32(58).fork()).join();
2207
+ }
2208
+ if (message.createdAt !== undefined) {
2209
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(66).fork()).join();
2210
+ }
2211
+ return writer;
2212
+ },
2213
+ decode(input, length) {
2214
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
2215
+ const end = length === undefined ? reader.len : reader.pos + length;
2216
+ const message = createBaseAgentRunEvent();
2217
+ while (reader.pos < end) {
2218
+ const tag = reader.uint32();
2219
+ switch (tag >>> 3) {
2220
+ case 1: {
2221
+ if (tag !== 10) {
2222
+ break;
2223
+ }
2224
+ message.id = reader.string();
2225
+ continue;
2226
+ }
2227
+ case 2: {
2228
+ if (tag !== 18) {
2229
+ break;
2230
+ }
2231
+ message.organizationId = reader.string();
2232
+ continue;
2233
+ }
2234
+ case 3: {
2235
+ if (tag !== 26) {
2236
+ break;
2237
+ }
2238
+ message.agentRunId = reader.string();
2239
+ continue;
2240
+ }
2241
+ case 4: {
2242
+ if (tag !== 32) {
2243
+ break;
2244
+ }
2245
+ message.sequence = longToNumber(reader.uint64());
2246
+ continue;
2247
+ }
2248
+ case 5: {
2249
+ if (tag !== 40) {
2250
+ break;
2251
+ }
2252
+ message.kind = reader.int32();
2253
+ continue;
2254
+ }
2255
+ case 6: {
2256
+ if (tag !== 50) {
2257
+ break;
2258
+ }
2259
+ message.message = reader.string();
2260
+ continue;
2261
+ }
2262
+ case 7: {
2263
+ if (tag !== 58) {
2264
+ break;
2265
+ }
2266
+ message.payload = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
2267
+ continue;
2268
+ }
2269
+ case 8: {
2270
+ if (tag !== 66) {
2271
+ break;
2272
+ }
2273
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
2274
+ continue;
2275
+ }
2276
+ }
2277
+ if ((tag & 7) === 4 || tag === 0) {
2278
+ break;
2279
+ }
2280
+ reader.skip(tag & 7);
2281
+ }
2282
+ return message;
2283
+ },
2284
+ fromJSON(object) {
2285
+ return {
2286
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
2287
+ organizationId: isSet(object.organizationId)
2288
+ ? globalThis.String(object.organizationId)
2289
+ : isSet(object.organization_id)
2290
+ ? globalThis.String(object.organization_id)
2291
+ : "",
2292
+ agentRunId: isSet(object.agentRunId)
2293
+ ? globalThis.String(object.agentRunId)
2294
+ : isSet(object.agent_run_id)
2295
+ ? globalThis.String(object.agent_run_id)
2296
+ : "",
2297
+ sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0,
2298
+ kind: isSet(object.kind) ? agentRunEventKindFromJSON(object.kind) : 0,
2299
+ message: isSet(object.message) ? globalThis.String(object.message) : "",
2300
+ payload: isObject(object.payload) ? object.payload : undefined,
2301
+ createdAt: isSet(object.createdAt)
2302
+ ? fromJsonTimestamp(object.createdAt)
2303
+ : isSet(object.created_at)
2304
+ ? fromJsonTimestamp(object.created_at)
2305
+ : undefined,
2306
+ };
2307
+ },
2308
+ toJSON(message) {
2309
+ const obj = {};
2310
+ if (message.id !== "") {
2311
+ obj.id = message.id;
2312
+ }
2313
+ if (message.organizationId !== "") {
2314
+ obj.organizationId = message.organizationId;
2315
+ }
2316
+ if (message.agentRunId !== "") {
2317
+ obj.agentRunId = message.agentRunId;
2318
+ }
2319
+ if (message.sequence !== 0) {
2320
+ obj.sequence = Math.round(message.sequence);
2321
+ }
2322
+ if (message.kind !== 0) {
2323
+ obj.kind = agentRunEventKindToJSON(message.kind);
2324
+ }
2325
+ if (message.message !== "") {
2326
+ obj.message = message.message;
2327
+ }
2328
+ if (message.payload !== undefined) {
2329
+ obj.payload = message.payload;
2330
+ }
2331
+ if (message.createdAt !== undefined) {
2332
+ obj.createdAt = message.createdAt.toISOString();
2333
+ }
2334
+ return obj;
2335
+ },
2336
+ create(base) {
2337
+ return exports.AgentRunEvent.fromPartial(base !== null && base !== void 0 ? base : {});
2338
+ },
2339
+ fromPartial(object) {
2340
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2341
+ const message = createBaseAgentRunEvent();
2342
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
2343
+ message.organizationId = (_b = object.organizationId) !== null && _b !== void 0 ? _b : "";
2344
+ message.agentRunId = (_c = object.agentRunId) !== null && _c !== void 0 ? _c : "";
2345
+ message.sequence = (_d = object.sequence) !== null && _d !== void 0 ? _d : 0;
2346
+ message.kind = (_e = object.kind) !== null && _e !== void 0 ? _e : 0;
2347
+ message.message = (_f = object.message) !== null && _f !== void 0 ? _f : "";
2348
+ message.payload = (_g = object.payload) !== null && _g !== void 0 ? _g : undefined;
2349
+ message.createdAt = (_h = object.createdAt) !== null && _h !== void 0 ? _h : undefined;
2350
+ return message;
2351
+ },
2352
+ };
2353
+ function toTimestamp(date) {
2354
+ const seconds = Math.trunc(date.getTime() / 1000);
2355
+ const nanos = (date.getTime() % 1000) * 1000000;
2356
+ return { seconds, nanos };
2357
+ }
2358
+ function fromTimestamp(t) {
2359
+ let millis = (t.seconds || 0) * 1000;
2360
+ millis += (t.nanos || 0) / 1000000;
2361
+ return new globalThis.Date(millis);
2362
+ }
2363
+ function fromJsonTimestamp(o) {
2364
+ if (o instanceof globalThis.Date) {
2365
+ return o;
2366
+ }
2367
+ else if (typeof o === "string") {
2368
+ return new globalThis.Date(o);
2369
+ }
2370
+ else {
2371
+ return fromTimestamp(timestamp_pb_1.Timestamp.fromJSON(o));
2372
+ }
2373
+ }
2374
+ function longToNumber(int64) {
2375
+ const num = globalThis.Number(int64.toString());
2376
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
2377
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
2378
+ }
2379
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
2380
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
2381
+ }
2382
+ return num;
2383
+ }
2384
+ function isObject(value) {
2385
+ return typeof value === "object" && value !== null;
2386
+ }
2387
+ function isSet(value) {
2388
+ return value !== null && value !== undefined;
2389
+ }