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