weave-typescript 0.12.0 → 0.13.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.
Files changed (94) hide show
  1. package/dist/google/api/annotations.pb.js +1 -1
  2. package/dist/google/api/http.pb.js +1 -1
  3. package/dist/google/protobuf/descriptor.pb.d.ts +8 -1
  4. package/dist/google/protobuf/descriptor.pb.js +8 -1
  5. package/dist/google/protobuf/struct.pb.js +1 -1
  6. package/dist/google/protobuf/timestamp.pb.d.ts +7 -6
  7. package/dist/google/protobuf/timestamp.pb.js +1 -1
  8. package/dist/weaveapi/atc/v1/event.pb.d.ts +33 -0
  9. package/dist/weaveapi/atc/v1/event.pb.js +263 -0
  10. package/dist/weaveapi/atc/v1/message.pb.d.ts +44 -0
  11. package/dist/weaveapi/atc/v1/message.pb.js +287 -0
  12. package/dist/weaveapi/atc/v1/process.pb.d.ts +91 -0
  13. package/dist/weaveapi/atc/v1/process.pb.js +658 -0
  14. package/dist/weaveapi/atc/v1/run.pb.d.ts +71 -0
  15. package/dist/weaveapi/atc/v1/run.pb.js +525 -0
  16. package/dist/weaveapi/atc/v1/service.pb.d.ts +339 -0
  17. package/dist/weaveapi/atc/v1/service.pb.js +1922 -0
  18. package/dist/weaveapi/auth/v1/service.pb.d.ts +66 -66
  19. package/dist/weaveapi/auth/v1/service.pb.js +86 -5
  20. package/dist/weaveapi/auth/v1/session.pb.js +1 -1
  21. package/dist/weaveapi/auth/v1/usage.pb.js +1 -1
  22. package/dist/weaveapi/auth/v1/user.pb.js +1 -1
  23. package/dist/weaveapi/data/v1/data.pb.js +1 -1
  24. package/dist/weaveapi/data/v1/service.pb.d.ts +27 -27
  25. package/dist/weaveapi/data/v1/service.pb.js +1 -1
  26. package/dist/weaveapi/generate/v1/configuration.pb.js +1 -1
  27. package/dist/weaveapi/generate/v1/generate.pb.js +1 -1
  28. package/dist/weaveapi/generate/v1/service.pb.d.ts +15 -15
  29. package/dist/weaveapi/generate/v1/service.pb.js +1 -1
  30. package/dist/weaveapi/input/v1/input.pb.js +1 -1
  31. package/dist/weaveapi/input/v1/service.pb.d.ts +39 -39
  32. package/dist/weaveapi/input/v1/service.pb.js +1 -1
  33. package/dist/weaveapi/integration/v1/integration.pb.js +1 -1
  34. package/dist/weaveapi/integration/v1/service.pb.d.ts +30 -30
  35. package/dist/weaveapi/integration/v1/service.pb.js +1 -1
  36. package/dist/weaveapi/llmx/v1/architecture.pb.js +1 -1
  37. package/dist/weaveapi/llmx/v1/capabilities.pb.js +1 -1
  38. package/dist/weaveapi/llmx/v1/model.pb.js +1 -1
  39. package/dist/weaveapi/llmx/v1/pricing.pb.js +1 -1
  40. package/dist/weaveapi/llmx/v1/provider.pb.js +1 -1
  41. package/dist/weaveapi/llmx/v1/service.pb.d.ts +36 -36
  42. package/dist/weaveapi/llmx/v1/service.pb.js +51 -6
  43. package/dist/weaveapi/mcpregistry/v1/server.pb.js +1 -1
  44. package/dist/weaveapi/mcpregistry/v1/service.pb.d.ts +18 -18
  45. package/dist/weaveapi/mcpregistry/v1/service.pb.js +1 -1
  46. package/dist/weaveapi/payment/v1/invoice.pb.js +1 -1
  47. package/dist/weaveapi/payment/v1/service.pb.d.ts +57 -57
  48. package/dist/weaveapi/payment/v1/service.pb.js +1 -1
  49. package/dist/weaveapi/payment/v1/subscription.pb.js +1 -1
  50. package/dist/weaveapi/project/v1/project.pb.js +1 -1
  51. package/dist/weaveapi/project/v1/service.pb.d.ts +21 -21
  52. package/dist/weaveapi/project/v1/service.pb.js +26 -3
  53. package/dist/weaveapi/report/v1/report.pb.js +1 -1
  54. package/dist/weaveapi/report/v1/service.pb.d.ts +18 -18
  55. package/dist/weaveapi/report/v1/service.pb.js +1 -1
  56. package/dist/weaveapi/requirement/v1/requirement.pb.js +1 -1
  57. package/dist/weaveapi/requirement/v1/service.pb.d.ts +39 -39
  58. package/dist/weaveapi/requirement/v1/service.pb.js +1 -1
  59. package/dist/weaveapi/run/v1/run.pb.js +1 -1
  60. package/dist/weaveapi/run/v1/service.pb.d.ts +21 -21
  61. package/dist/weaveapi/run/v1/service.pb.js +1 -1
  62. package/dist/weaveapi/script/v1/script.pb.js +1 -1
  63. package/dist/weaveapi/script/v1/service.pb.d.ts +51 -51
  64. package/dist/weaveapi/script/v1/service.pb.js +1 -1
  65. package/dist/weaveapi/storage/v1/auth.pb.js +1 -1
  66. package/dist/weaveapi/storage/v1/nosql_database.pb.js +1 -1
  67. package/dist/weaveapi/storage/v1/object_store.pb.js +1 -1
  68. package/dist/weaveapi/storage/v1/service.pb.d.ts +12 -12
  69. package/dist/weaveapi/storage/v1/service.pb.js +1 -1
  70. package/dist/weaveapi/storage/v1/sql_database.pb.js +1 -1
  71. package/dist/weaveapi/storage/v1/storage.pb.js +1 -1
  72. package/dist/weaveapi/storage/v1/vcs.pb.js +1 -1
  73. package/dist/weaveapi/suite/v1/service.pb.d.ts +54 -54
  74. package/dist/weaveapi/suite/v1/service.pb.js +1 -1
  75. package/dist/weaveapi/suite/v1/suite.pb.js +1 -1
  76. package/dist/weaveapi/synthesize/v1/dataset.pb.js +1 -1
  77. package/dist/weaveapi/synthesize/v1/inline_data.pb.js +1 -1
  78. package/dist/weaveapi/synthesize/v1/relationship.pb.js +1 -1
  79. package/dist/weaveapi/synthesize/v1/service.pb.d.ts +12 -12
  80. package/dist/weaveapi/synthesize/v1/service.pb.js +22 -2
  81. package/dist/weaveapi/synthesize/v1/training.pb.js +1 -1
  82. package/dist/weaveapi/testcase/v1/service.pb.d.ts +51 -51
  83. package/dist/weaveapi/testcase/v1/service.pb.js +1 -1
  84. package/dist/weaveapi/testcase/v1/testcase.pb.js +1 -1
  85. package/dist/weaveapi/workflow/v1/service.pb.d.ts +27 -27
  86. package/dist/weaveapi/workflow/v1/service.pb.js +1 -1
  87. package/dist/weaveapi/workflow/v1/workflow.pb.js +1 -1
  88. package/dist/weaveapi/workflowdata/v1/service.pb.d.ts +27 -27
  89. package/dist/weaveapi/workflowdata/v1/service.pb.js +1 -1
  90. package/dist/weavesql/atcdb/event_sql.d.ts +91 -0
  91. package/dist/weavesql/atcdb/event_sql.js +181 -0
  92. package/dist/weavesql/atcdb/mailbox_sql.d.ts +43 -0
  93. package/dist/weavesql/atcdb/mailbox_sql.js +85 -0
  94. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "weaveapi.atc.v1";
3
+ /** RunStatus represents the lifecycle state of a run. */
4
+ export declare enum RunStatus {
5
+ RUN_STATUS_UNSPECIFIED = 0,
6
+ RUN_STATUS_PENDING = 1,
7
+ RUN_STATUS_RUNNING = 2,
8
+ RUN_STATUS_COMPLETED = 3,
9
+ RUN_STATUS_FAILED = 4,
10
+ RUN_STATUS_CANCELED = 5,
11
+ UNRECOGNIZED = -1
12
+ }
13
+ export declare function runStatusFromJSON(object: any): RunStatus;
14
+ export declare function runStatusToJSON(object: RunStatus): string;
15
+ /**
16
+ * Run is the top-level orchestration unit in ATC. A run owns a tree of
17
+ * processes coordinated by a supervisor.
18
+ */
19
+ export interface Run {
20
+ runId: string;
21
+ status: RunStatus;
22
+ taskName: string;
23
+ processTypeName: string;
24
+ rootProcessId: string;
25
+ config: {
26
+ [key: string]: any;
27
+ } | undefined;
28
+ createdAt: Date | undefined;
29
+ updatedAt: Date | undefined;
30
+ finishedAt: Date | undefined;
31
+ }
32
+ /** RunConfig holds optional configuration for creating a new run. */
33
+ export interface RunConfig {
34
+ /** The process type name to use for the root process. */
35
+ processTypeName: string;
36
+ /** Arbitrary key-value configuration forwarded to the root process. */
37
+ parameters: {
38
+ [key: string]: any;
39
+ } | undefined;
40
+ /** Budget constraints for the run. */
41
+ budget: BudgetConfig | undefined;
42
+ }
43
+ /** BudgetConfig holds cost ceilings for a run or process. */
44
+ export interface BudgetConfig {
45
+ maxComputeUnits: number;
46
+ maxCostCents: number;
47
+ maxToolCalls: number;
48
+ maxParallelism: number;
49
+ }
50
+ export declare const Run: MessageFns<Run>;
51
+ export declare const RunConfig: MessageFns<RunConfig>;
52
+ export declare const BudgetConfig: MessageFns<BudgetConfig>;
53
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
54
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
55
+ [K in keyof T]?: DeepPartial<T[K]>;
56
+ } : Partial<T>;
57
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
58
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
59
+ [K in keyof P]: Exact<P[K], I[K]>;
60
+ } & {
61
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
62
+ };
63
+ export interface MessageFns<T> {
64
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
65
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
66
+ fromJSON(object: any): T;
67
+ toJSON(message: T): unknown;
68
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
69
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
70
+ }
71
+ export {};
@@ -0,0 +1,525 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.6
5
+ // protoc unknown
6
+ // source: weaveapi/atc/v1/run.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BudgetConfig = exports.RunConfig = exports.Run = exports.RunStatus = exports.protobufPackage = void 0;
9
+ exports.runStatusFromJSON = runStatusFromJSON;
10
+ exports.runStatusToJSON = runStatusToJSON;
11
+ /* eslint-disable */
12
+ const wire_1 = require("@bufbuild/protobuf/wire");
13
+ const struct_pb_1 = require("../../../google/protobuf/struct.pb");
14
+ const timestamp_pb_1 = require("../../../google/protobuf/timestamp.pb");
15
+ exports.protobufPackage = "weaveapi.atc.v1";
16
+ /** RunStatus represents the lifecycle state of a run. */
17
+ var RunStatus;
18
+ (function (RunStatus) {
19
+ RunStatus[RunStatus["RUN_STATUS_UNSPECIFIED"] = 0] = "RUN_STATUS_UNSPECIFIED";
20
+ RunStatus[RunStatus["RUN_STATUS_PENDING"] = 1] = "RUN_STATUS_PENDING";
21
+ RunStatus[RunStatus["RUN_STATUS_RUNNING"] = 2] = "RUN_STATUS_RUNNING";
22
+ RunStatus[RunStatus["RUN_STATUS_COMPLETED"] = 3] = "RUN_STATUS_COMPLETED";
23
+ RunStatus[RunStatus["RUN_STATUS_FAILED"] = 4] = "RUN_STATUS_FAILED";
24
+ RunStatus[RunStatus["RUN_STATUS_CANCELED"] = 5] = "RUN_STATUS_CANCELED";
25
+ RunStatus[RunStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(RunStatus || (exports.RunStatus = RunStatus = {}));
27
+ function runStatusFromJSON(object) {
28
+ switch (object) {
29
+ case 0:
30
+ case "RUN_STATUS_UNSPECIFIED":
31
+ return RunStatus.RUN_STATUS_UNSPECIFIED;
32
+ case 1:
33
+ case "RUN_STATUS_PENDING":
34
+ return RunStatus.RUN_STATUS_PENDING;
35
+ case 2:
36
+ case "RUN_STATUS_RUNNING":
37
+ return RunStatus.RUN_STATUS_RUNNING;
38
+ case 3:
39
+ case "RUN_STATUS_COMPLETED":
40
+ return RunStatus.RUN_STATUS_COMPLETED;
41
+ case 4:
42
+ case "RUN_STATUS_FAILED":
43
+ return RunStatus.RUN_STATUS_FAILED;
44
+ case 5:
45
+ case "RUN_STATUS_CANCELED":
46
+ return RunStatus.RUN_STATUS_CANCELED;
47
+ case -1:
48
+ case "UNRECOGNIZED":
49
+ default:
50
+ return RunStatus.UNRECOGNIZED;
51
+ }
52
+ }
53
+ function runStatusToJSON(object) {
54
+ switch (object) {
55
+ case RunStatus.RUN_STATUS_UNSPECIFIED:
56
+ return "RUN_STATUS_UNSPECIFIED";
57
+ case RunStatus.RUN_STATUS_PENDING:
58
+ return "RUN_STATUS_PENDING";
59
+ case RunStatus.RUN_STATUS_RUNNING:
60
+ return "RUN_STATUS_RUNNING";
61
+ case RunStatus.RUN_STATUS_COMPLETED:
62
+ return "RUN_STATUS_COMPLETED";
63
+ case RunStatus.RUN_STATUS_FAILED:
64
+ return "RUN_STATUS_FAILED";
65
+ case RunStatus.RUN_STATUS_CANCELED:
66
+ return "RUN_STATUS_CANCELED";
67
+ case RunStatus.UNRECOGNIZED:
68
+ default:
69
+ return "UNRECOGNIZED";
70
+ }
71
+ }
72
+ function createBaseRun() {
73
+ return {
74
+ runId: "",
75
+ status: 0,
76
+ taskName: "",
77
+ processTypeName: "",
78
+ rootProcessId: "",
79
+ config: undefined,
80
+ createdAt: undefined,
81
+ updatedAt: undefined,
82
+ finishedAt: undefined,
83
+ };
84
+ }
85
+ exports.Run = {
86
+ encode(message, writer = new wire_1.BinaryWriter()) {
87
+ if (message.runId !== "") {
88
+ writer.uint32(10).string(message.runId);
89
+ }
90
+ if (message.status !== 0) {
91
+ writer.uint32(16).int32(message.status);
92
+ }
93
+ if (message.taskName !== "") {
94
+ writer.uint32(26).string(message.taskName);
95
+ }
96
+ if (message.processTypeName !== "") {
97
+ writer.uint32(34).string(message.processTypeName);
98
+ }
99
+ if (message.rootProcessId !== "") {
100
+ writer.uint32(42).string(message.rootProcessId);
101
+ }
102
+ if (message.config !== undefined) {
103
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.config), writer.uint32(50).fork()).join();
104
+ }
105
+ if (message.createdAt !== undefined) {
106
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
107
+ }
108
+ if (message.updatedAt !== undefined) {
109
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(66).fork()).join();
110
+ }
111
+ if (message.finishedAt !== undefined) {
112
+ timestamp_pb_1.Timestamp.encode(toTimestamp(message.finishedAt), writer.uint32(74).fork()).join();
113
+ }
114
+ return writer;
115
+ },
116
+ decode(input, length) {
117
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
118
+ const end = length === undefined ? reader.len : reader.pos + length;
119
+ const message = createBaseRun();
120
+ while (reader.pos < end) {
121
+ const tag = reader.uint32();
122
+ switch (tag >>> 3) {
123
+ case 1: {
124
+ if (tag !== 10) {
125
+ break;
126
+ }
127
+ message.runId = reader.string();
128
+ continue;
129
+ }
130
+ case 2: {
131
+ if (tag !== 16) {
132
+ break;
133
+ }
134
+ message.status = reader.int32();
135
+ continue;
136
+ }
137
+ case 3: {
138
+ if (tag !== 26) {
139
+ break;
140
+ }
141
+ message.taskName = reader.string();
142
+ continue;
143
+ }
144
+ case 4: {
145
+ if (tag !== 34) {
146
+ break;
147
+ }
148
+ message.processTypeName = reader.string();
149
+ continue;
150
+ }
151
+ case 5: {
152
+ if (tag !== 42) {
153
+ break;
154
+ }
155
+ message.rootProcessId = reader.string();
156
+ continue;
157
+ }
158
+ case 6: {
159
+ if (tag !== 50) {
160
+ break;
161
+ }
162
+ message.config = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
163
+ continue;
164
+ }
165
+ case 7: {
166
+ if (tag !== 58) {
167
+ break;
168
+ }
169
+ message.createdAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
170
+ continue;
171
+ }
172
+ case 8: {
173
+ if (tag !== 66) {
174
+ break;
175
+ }
176
+ message.updatedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
177
+ continue;
178
+ }
179
+ case 9: {
180
+ if (tag !== 74) {
181
+ break;
182
+ }
183
+ message.finishedAt = fromTimestamp(timestamp_pb_1.Timestamp.decode(reader, reader.uint32()));
184
+ continue;
185
+ }
186
+ }
187
+ if ((tag & 7) === 4 || tag === 0) {
188
+ break;
189
+ }
190
+ reader.skip(tag & 7);
191
+ }
192
+ return message;
193
+ },
194
+ fromJSON(object) {
195
+ return {
196
+ runId: isSet(object.runId)
197
+ ? globalThis.String(object.runId)
198
+ : isSet(object.run_id)
199
+ ? globalThis.String(object.run_id)
200
+ : "",
201
+ status: isSet(object.status) ? runStatusFromJSON(object.status) : 0,
202
+ taskName: isSet(object.taskName)
203
+ ? globalThis.String(object.taskName)
204
+ : isSet(object.task_name)
205
+ ? globalThis.String(object.task_name)
206
+ : "",
207
+ processTypeName: isSet(object.processTypeName)
208
+ ? globalThis.String(object.processTypeName)
209
+ : isSet(object.process_type_name)
210
+ ? globalThis.String(object.process_type_name)
211
+ : "",
212
+ rootProcessId: isSet(object.rootProcessId)
213
+ ? globalThis.String(object.rootProcessId)
214
+ : isSet(object.root_process_id)
215
+ ? globalThis.String(object.root_process_id)
216
+ : "",
217
+ config: isObject(object.config) ? object.config : undefined,
218
+ createdAt: isSet(object.createdAt)
219
+ ? fromJsonTimestamp(object.createdAt)
220
+ : isSet(object.created_at)
221
+ ? fromJsonTimestamp(object.created_at)
222
+ : undefined,
223
+ updatedAt: isSet(object.updatedAt)
224
+ ? fromJsonTimestamp(object.updatedAt)
225
+ : isSet(object.updated_at)
226
+ ? fromJsonTimestamp(object.updated_at)
227
+ : undefined,
228
+ finishedAt: isSet(object.finishedAt)
229
+ ? fromJsonTimestamp(object.finishedAt)
230
+ : isSet(object.finished_at)
231
+ ? fromJsonTimestamp(object.finished_at)
232
+ : undefined,
233
+ };
234
+ },
235
+ toJSON(message) {
236
+ const obj = {};
237
+ if (message.runId !== "") {
238
+ obj.runId = message.runId;
239
+ }
240
+ if (message.status !== 0) {
241
+ obj.status = runStatusToJSON(message.status);
242
+ }
243
+ if (message.taskName !== "") {
244
+ obj.taskName = message.taskName;
245
+ }
246
+ if (message.processTypeName !== "") {
247
+ obj.processTypeName = message.processTypeName;
248
+ }
249
+ if (message.rootProcessId !== "") {
250
+ obj.rootProcessId = message.rootProcessId;
251
+ }
252
+ if (message.config !== undefined) {
253
+ obj.config = message.config;
254
+ }
255
+ if (message.createdAt !== undefined) {
256
+ obj.createdAt = message.createdAt.toISOString();
257
+ }
258
+ if (message.updatedAt !== undefined) {
259
+ obj.updatedAt = message.updatedAt.toISOString();
260
+ }
261
+ if (message.finishedAt !== undefined) {
262
+ obj.finishedAt = message.finishedAt.toISOString();
263
+ }
264
+ return obj;
265
+ },
266
+ create(base) {
267
+ return exports.Run.fromPartial(base !== null && base !== void 0 ? base : {});
268
+ },
269
+ fromPartial(object) {
270
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
271
+ const message = createBaseRun();
272
+ message.runId = (_a = object.runId) !== null && _a !== void 0 ? _a : "";
273
+ message.status = (_b = object.status) !== null && _b !== void 0 ? _b : 0;
274
+ message.taskName = (_c = object.taskName) !== null && _c !== void 0 ? _c : "";
275
+ message.processTypeName = (_d = object.processTypeName) !== null && _d !== void 0 ? _d : "";
276
+ message.rootProcessId = (_e = object.rootProcessId) !== null && _e !== void 0 ? _e : "";
277
+ message.config = (_f = object.config) !== null && _f !== void 0 ? _f : undefined;
278
+ message.createdAt = (_g = object.createdAt) !== null && _g !== void 0 ? _g : undefined;
279
+ message.updatedAt = (_h = object.updatedAt) !== null && _h !== void 0 ? _h : undefined;
280
+ message.finishedAt = (_j = object.finishedAt) !== null && _j !== void 0 ? _j : undefined;
281
+ return message;
282
+ },
283
+ };
284
+ function createBaseRunConfig() {
285
+ return { processTypeName: "", parameters: undefined, budget: undefined };
286
+ }
287
+ exports.RunConfig = {
288
+ encode(message, writer = new wire_1.BinaryWriter()) {
289
+ if (message.processTypeName !== "") {
290
+ writer.uint32(10).string(message.processTypeName);
291
+ }
292
+ if (message.parameters !== undefined) {
293
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.parameters), writer.uint32(18).fork()).join();
294
+ }
295
+ if (message.budget !== undefined) {
296
+ exports.BudgetConfig.encode(message.budget, writer.uint32(26).fork()).join();
297
+ }
298
+ return writer;
299
+ },
300
+ decode(input, length) {
301
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
302
+ const end = length === undefined ? reader.len : reader.pos + length;
303
+ const message = createBaseRunConfig();
304
+ while (reader.pos < end) {
305
+ const tag = reader.uint32();
306
+ switch (tag >>> 3) {
307
+ case 1: {
308
+ if (tag !== 10) {
309
+ break;
310
+ }
311
+ message.processTypeName = reader.string();
312
+ continue;
313
+ }
314
+ case 2: {
315
+ if (tag !== 18) {
316
+ break;
317
+ }
318
+ message.parameters = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
319
+ continue;
320
+ }
321
+ case 3: {
322
+ if (tag !== 26) {
323
+ break;
324
+ }
325
+ message.budget = exports.BudgetConfig.decode(reader, reader.uint32());
326
+ continue;
327
+ }
328
+ }
329
+ if ((tag & 7) === 4 || tag === 0) {
330
+ break;
331
+ }
332
+ reader.skip(tag & 7);
333
+ }
334
+ return message;
335
+ },
336
+ fromJSON(object) {
337
+ return {
338
+ processTypeName: isSet(object.processTypeName)
339
+ ? globalThis.String(object.processTypeName)
340
+ : isSet(object.process_type_name)
341
+ ? globalThis.String(object.process_type_name)
342
+ : "",
343
+ parameters: isObject(object.parameters) ? object.parameters : undefined,
344
+ budget: isSet(object.budget) ? exports.BudgetConfig.fromJSON(object.budget) : undefined,
345
+ };
346
+ },
347
+ toJSON(message) {
348
+ const obj = {};
349
+ if (message.processTypeName !== "") {
350
+ obj.processTypeName = message.processTypeName;
351
+ }
352
+ if (message.parameters !== undefined) {
353
+ obj.parameters = message.parameters;
354
+ }
355
+ if (message.budget !== undefined) {
356
+ obj.budget = exports.BudgetConfig.toJSON(message.budget);
357
+ }
358
+ return obj;
359
+ },
360
+ create(base) {
361
+ return exports.RunConfig.fromPartial(base !== null && base !== void 0 ? base : {});
362
+ },
363
+ fromPartial(object) {
364
+ var _a, _b;
365
+ const message = createBaseRunConfig();
366
+ message.processTypeName = (_a = object.processTypeName) !== null && _a !== void 0 ? _a : "";
367
+ message.parameters = (_b = object.parameters) !== null && _b !== void 0 ? _b : undefined;
368
+ message.budget = (object.budget !== undefined && object.budget !== null)
369
+ ? exports.BudgetConfig.fromPartial(object.budget)
370
+ : undefined;
371
+ return message;
372
+ },
373
+ };
374
+ function createBaseBudgetConfig() {
375
+ return { maxComputeUnits: 0, maxCostCents: 0, maxToolCalls: 0, maxParallelism: 0 };
376
+ }
377
+ exports.BudgetConfig = {
378
+ encode(message, writer = new wire_1.BinaryWriter()) {
379
+ if (message.maxComputeUnits !== 0) {
380
+ writer.uint32(8).int64(message.maxComputeUnits);
381
+ }
382
+ if (message.maxCostCents !== 0) {
383
+ writer.uint32(16).int64(message.maxCostCents);
384
+ }
385
+ if (message.maxToolCalls !== 0) {
386
+ writer.uint32(24).int64(message.maxToolCalls);
387
+ }
388
+ if (message.maxParallelism !== 0) {
389
+ writer.uint32(32).int32(message.maxParallelism);
390
+ }
391
+ return writer;
392
+ },
393
+ decode(input, length) {
394
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
395
+ const end = length === undefined ? reader.len : reader.pos + length;
396
+ const message = createBaseBudgetConfig();
397
+ while (reader.pos < end) {
398
+ const tag = reader.uint32();
399
+ switch (tag >>> 3) {
400
+ case 1: {
401
+ if (tag !== 8) {
402
+ break;
403
+ }
404
+ message.maxComputeUnits = longToNumber(reader.int64());
405
+ continue;
406
+ }
407
+ case 2: {
408
+ if (tag !== 16) {
409
+ break;
410
+ }
411
+ message.maxCostCents = longToNumber(reader.int64());
412
+ continue;
413
+ }
414
+ case 3: {
415
+ if (tag !== 24) {
416
+ break;
417
+ }
418
+ message.maxToolCalls = longToNumber(reader.int64());
419
+ continue;
420
+ }
421
+ case 4: {
422
+ if (tag !== 32) {
423
+ break;
424
+ }
425
+ message.maxParallelism = reader.int32();
426
+ continue;
427
+ }
428
+ }
429
+ if ((tag & 7) === 4 || tag === 0) {
430
+ break;
431
+ }
432
+ reader.skip(tag & 7);
433
+ }
434
+ return message;
435
+ },
436
+ fromJSON(object) {
437
+ return {
438
+ maxComputeUnits: isSet(object.maxComputeUnits)
439
+ ? globalThis.Number(object.maxComputeUnits)
440
+ : isSet(object.max_compute_units)
441
+ ? globalThis.Number(object.max_compute_units)
442
+ : 0,
443
+ maxCostCents: isSet(object.maxCostCents)
444
+ ? globalThis.Number(object.maxCostCents)
445
+ : isSet(object.max_cost_cents)
446
+ ? globalThis.Number(object.max_cost_cents)
447
+ : 0,
448
+ maxToolCalls: isSet(object.maxToolCalls)
449
+ ? globalThis.Number(object.maxToolCalls)
450
+ : isSet(object.max_tool_calls)
451
+ ? globalThis.Number(object.max_tool_calls)
452
+ : 0,
453
+ maxParallelism: isSet(object.maxParallelism)
454
+ ? globalThis.Number(object.maxParallelism)
455
+ : isSet(object.max_parallelism)
456
+ ? globalThis.Number(object.max_parallelism)
457
+ : 0,
458
+ };
459
+ },
460
+ toJSON(message) {
461
+ const obj = {};
462
+ if (message.maxComputeUnits !== 0) {
463
+ obj.maxComputeUnits = Math.round(message.maxComputeUnits);
464
+ }
465
+ if (message.maxCostCents !== 0) {
466
+ obj.maxCostCents = Math.round(message.maxCostCents);
467
+ }
468
+ if (message.maxToolCalls !== 0) {
469
+ obj.maxToolCalls = Math.round(message.maxToolCalls);
470
+ }
471
+ if (message.maxParallelism !== 0) {
472
+ obj.maxParallelism = Math.round(message.maxParallelism);
473
+ }
474
+ return obj;
475
+ },
476
+ create(base) {
477
+ return exports.BudgetConfig.fromPartial(base !== null && base !== void 0 ? base : {});
478
+ },
479
+ fromPartial(object) {
480
+ var _a, _b, _c, _d;
481
+ const message = createBaseBudgetConfig();
482
+ message.maxComputeUnits = (_a = object.maxComputeUnits) !== null && _a !== void 0 ? _a : 0;
483
+ message.maxCostCents = (_b = object.maxCostCents) !== null && _b !== void 0 ? _b : 0;
484
+ message.maxToolCalls = (_c = object.maxToolCalls) !== null && _c !== void 0 ? _c : 0;
485
+ message.maxParallelism = (_d = object.maxParallelism) !== null && _d !== void 0 ? _d : 0;
486
+ return message;
487
+ },
488
+ };
489
+ function toTimestamp(date) {
490
+ const seconds = Math.trunc(date.getTime() / 1000);
491
+ const nanos = (date.getTime() % 1000) * 1000000;
492
+ return { seconds, nanos };
493
+ }
494
+ function fromTimestamp(t) {
495
+ let millis = (t.seconds || 0) * 1000;
496
+ millis += (t.nanos || 0) / 1000000;
497
+ return new globalThis.Date(millis);
498
+ }
499
+ function fromJsonTimestamp(o) {
500
+ if (o instanceof globalThis.Date) {
501
+ return o;
502
+ }
503
+ else if (typeof o === "string") {
504
+ return new globalThis.Date(o);
505
+ }
506
+ else {
507
+ return fromTimestamp(timestamp_pb_1.Timestamp.fromJSON(o));
508
+ }
509
+ }
510
+ function longToNumber(int64) {
511
+ const num = globalThis.Number(int64.toString());
512
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
513
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
514
+ }
515
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
516
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
517
+ }
518
+ return num;
519
+ }
520
+ function isObject(value) {
521
+ return typeof value === "object" && value !== null;
522
+ }
523
+ function isSet(value) {
524
+ return value !== null && value !== undefined;
525
+ }