@ag-ui/proto 0.0.44 → 0.0.45
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.
- package/dist/index.d.mts +6 -3
- package/dist/index.d.mts.map +1 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1598 -2150
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1596 -2121
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -12
package/dist/index.js
CHANGED
|
@@ -1,2249 +1,1697 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var index_exports = {};
|
|
22
|
-
__export(index_exports, {
|
|
23
|
-
AGUI_MEDIA_TYPE: () => AGUI_MEDIA_TYPE,
|
|
24
|
-
decode: () => decode,
|
|
25
|
-
encode: () => encode
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(index_exports);
|
|
1
|
+
let _ag_ui_core = require("@ag-ui/core");
|
|
2
|
+
let _bufbuild_protobuf_wire = require("@bufbuild/protobuf/wire");
|
|
28
3
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
4
|
+
//#region src/generated/google/protobuf/struct.ts
|
|
5
|
+
/**
|
|
6
|
+
* `NullValue` is a singleton enumeration to represent the null value for the
|
|
7
|
+
* `Value` type union.
|
|
8
|
+
*
|
|
9
|
+
* The JSON representation for `NullValue` is JSON `null`.
|
|
10
|
+
*/
|
|
11
|
+
let NullValue = /* @__PURE__ */ function(NullValue) {
|
|
12
|
+
/** NULL_VALUE - Null value. */
|
|
13
|
+
NullValue[NullValue["NULL_VALUE"] = 0] = "NULL_VALUE";
|
|
14
|
+
NullValue[NullValue["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
15
|
+
return NullValue;
|
|
16
|
+
}({});
|
|
37
17
|
function createBaseStruct() {
|
|
38
|
-
|
|
18
|
+
return { fields: {} };
|
|
39
19
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
wrap(object) {
|
|
92
|
-
const struct = createBaseStruct();
|
|
93
|
-
if (object !== void 0) {
|
|
94
|
-
for (const key of Object.keys(object)) {
|
|
95
|
-
struct.fields[key] = object[key];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return struct;
|
|
99
|
-
},
|
|
100
|
-
unwrap(message) {
|
|
101
|
-
const object = {};
|
|
102
|
-
if (message.fields) {
|
|
103
|
-
for (const key of Object.keys(message.fields)) {
|
|
104
|
-
object[key] = message.fields[key];
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return object;
|
|
108
|
-
}
|
|
20
|
+
const Struct = {
|
|
21
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
22
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
|
23
|
+
if (value !== void 0) Struct_FieldsEntry.encode({
|
|
24
|
+
key,
|
|
25
|
+
value
|
|
26
|
+
}, writer.uint32(10).fork()).join();
|
|
27
|
+
});
|
|
28
|
+
return writer;
|
|
29
|
+
},
|
|
30
|
+
decode(input, length) {
|
|
31
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
32
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
33
|
+
const message = createBaseStruct();
|
|
34
|
+
while (reader.pos < end) {
|
|
35
|
+
const tag = reader.uint32();
|
|
36
|
+
switch (tag >>> 3) {
|
|
37
|
+
case 1: {
|
|
38
|
+
if (tag !== 10) break;
|
|
39
|
+
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
40
|
+
if (entry1.value !== void 0) message.fields[entry1.key] = entry1.value;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
45
|
+
reader.skip(tag & 7);
|
|
46
|
+
}
|
|
47
|
+
return message;
|
|
48
|
+
},
|
|
49
|
+
create(base) {
|
|
50
|
+
return Struct.fromPartial(base ?? {});
|
|
51
|
+
},
|
|
52
|
+
fromPartial(object) {
|
|
53
|
+
const message = createBaseStruct();
|
|
54
|
+
message.fields = Object.entries(object.fields ?? {}).reduce((acc, [key, value]) => {
|
|
55
|
+
if (value !== void 0) acc[key] = value;
|
|
56
|
+
return acc;
|
|
57
|
+
}, {});
|
|
58
|
+
return message;
|
|
59
|
+
},
|
|
60
|
+
wrap(object) {
|
|
61
|
+
const struct = createBaseStruct();
|
|
62
|
+
if (object !== void 0) for (const key of Object.keys(object)) struct.fields[key] = object[key];
|
|
63
|
+
return struct;
|
|
64
|
+
},
|
|
65
|
+
unwrap(message) {
|
|
66
|
+
const object = {};
|
|
67
|
+
if (message.fields) for (const key of Object.keys(message.fields)) object[key] = message.fields[key];
|
|
68
|
+
return object;
|
|
69
|
+
}
|
|
109
70
|
};
|
|
110
71
|
function createBaseStruct_FieldsEntry() {
|
|
111
|
-
|
|
72
|
+
return {
|
|
73
|
+
key: "",
|
|
74
|
+
value: void 0
|
|
75
|
+
};
|
|
112
76
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
return message;
|
|
151
|
-
},
|
|
152
|
-
create(base) {
|
|
153
|
-
return Struct_FieldsEntry.fromPartial(base != null ? base : {});
|
|
154
|
-
},
|
|
155
|
-
fromPartial(object) {
|
|
156
|
-
var _a, _b;
|
|
157
|
-
const message = createBaseStruct_FieldsEntry();
|
|
158
|
-
message.key = (_a = object.key) != null ? _a : "";
|
|
159
|
-
message.value = (_b = object.value) != null ? _b : void 0;
|
|
160
|
-
return message;
|
|
161
|
-
}
|
|
77
|
+
const Struct_FieldsEntry = {
|
|
78
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
79
|
+
if (message.key !== "") writer.uint32(10).string(message.key);
|
|
80
|
+
if (message.value !== void 0) Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
|
|
81
|
+
return writer;
|
|
82
|
+
},
|
|
83
|
+
decode(input, length) {
|
|
84
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
85
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
86
|
+
const message = createBaseStruct_FieldsEntry();
|
|
87
|
+
while (reader.pos < end) {
|
|
88
|
+
const tag = reader.uint32();
|
|
89
|
+
switch (tag >>> 3) {
|
|
90
|
+
case 1:
|
|
91
|
+
if (tag !== 10) break;
|
|
92
|
+
message.key = reader.string();
|
|
93
|
+
continue;
|
|
94
|
+
case 2:
|
|
95
|
+
if (tag !== 18) break;
|
|
96
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
100
|
+
reader.skip(tag & 7);
|
|
101
|
+
}
|
|
102
|
+
return message;
|
|
103
|
+
},
|
|
104
|
+
create(base) {
|
|
105
|
+
return Struct_FieldsEntry.fromPartial(base ?? {});
|
|
106
|
+
},
|
|
107
|
+
fromPartial(object) {
|
|
108
|
+
const message = createBaseStruct_FieldsEntry();
|
|
109
|
+
message.key = object.key ?? "";
|
|
110
|
+
message.value = object.value ?? void 0;
|
|
111
|
+
return message;
|
|
112
|
+
}
|
|
162
113
|
};
|
|
163
114
|
function createBaseValue() {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
115
|
+
return {
|
|
116
|
+
nullValue: void 0,
|
|
117
|
+
numberValue: void 0,
|
|
118
|
+
stringValue: void 0,
|
|
119
|
+
boolValue: void 0,
|
|
120
|
+
structValue: void 0,
|
|
121
|
+
listValue: void 0
|
|
122
|
+
};
|
|
172
123
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
create(base) {
|
|
253
|
-
return Value.fromPartial(base != null ? base : {});
|
|
254
|
-
},
|
|
255
|
-
fromPartial(object) {
|
|
256
|
-
var _a, _b, _c, _d, _e, _f;
|
|
257
|
-
const message = createBaseValue();
|
|
258
|
-
message.nullValue = (_a = object.nullValue) != null ? _a : void 0;
|
|
259
|
-
message.numberValue = (_b = object.numberValue) != null ? _b : void 0;
|
|
260
|
-
message.stringValue = (_c = object.stringValue) != null ? _c : void 0;
|
|
261
|
-
message.boolValue = (_d = object.boolValue) != null ? _d : void 0;
|
|
262
|
-
message.structValue = (_e = object.structValue) != null ? _e : void 0;
|
|
263
|
-
message.listValue = (_f = object.listValue) != null ? _f : void 0;
|
|
264
|
-
return message;
|
|
265
|
-
},
|
|
266
|
-
wrap(value) {
|
|
267
|
-
const result = createBaseValue();
|
|
268
|
-
if (value === null) {
|
|
269
|
-
result.nullValue = 0 /* NULL_VALUE */;
|
|
270
|
-
} else if (typeof value === "boolean") {
|
|
271
|
-
result.boolValue = value;
|
|
272
|
-
} else if (typeof value === "number") {
|
|
273
|
-
result.numberValue = value;
|
|
274
|
-
} else if (typeof value === "string") {
|
|
275
|
-
result.stringValue = value;
|
|
276
|
-
} else if (globalThis.Array.isArray(value)) {
|
|
277
|
-
result.listValue = value;
|
|
278
|
-
} else if (typeof value === "object") {
|
|
279
|
-
result.structValue = value;
|
|
280
|
-
} else if (typeof value !== "undefined") {
|
|
281
|
-
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
282
|
-
}
|
|
283
|
-
return result;
|
|
284
|
-
},
|
|
285
|
-
unwrap(message) {
|
|
286
|
-
if (message.stringValue !== void 0) {
|
|
287
|
-
return message.stringValue;
|
|
288
|
-
} else if ((message == null ? void 0 : message.numberValue) !== void 0) {
|
|
289
|
-
return message.numberValue;
|
|
290
|
-
} else if ((message == null ? void 0 : message.boolValue) !== void 0) {
|
|
291
|
-
return message.boolValue;
|
|
292
|
-
} else if ((message == null ? void 0 : message.structValue) !== void 0) {
|
|
293
|
-
return message.structValue;
|
|
294
|
-
} else if ((message == null ? void 0 : message.listValue) !== void 0) {
|
|
295
|
-
return message.listValue;
|
|
296
|
-
} else if ((message == null ? void 0 : message.nullValue) !== void 0) {
|
|
297
|
-
return null;
|
|
298
|
-
}
|
|
299
|
-
return void 0;
|
|
300
|
-
}
|
|
124
|
+
const Value = {
|
|
125
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
126
|
+
if (message.nullValue !== void 0) writer.uint32(8).int32(message.nullValue);
|
|
127
|
+
if (message.numberValue !== void 0) writer.uint32(17).double(message.numberValue);
|
|
128
|
+
if (message.stringValue !== void 0) writer.uint32(26).string(message.stringValue);
|
|
129
|
+
if (message.boolValue !== void 0) writer.uint32(32).bool(message.boolValue);
|
|
130
|
+
if (message.structValue !== void 0) Struct.encode(Struct.wrap(message.structValue), writer.uint32(42).fork()).join();
|
|
131
|
+
if (message.listValue !== void 0) ListValue.encode(ListValue.wrap(message.listValue), writer.uint32(50).fork()).join();
|
|
132
|
+
return writer;
|
|
133
|
+
},
|
|
134
|
+
decode(input, length) {
|
|
135
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
136
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
137
|
+
const message = createBaseValue();
|
|
138
|
+
while (reader.pos < end) {
|
|
139
|
+
const tag = reader.uint32();
|
|
140
|
+
switch (tag >>> 3) {
|
|
141
|
+
case 1:
|
|
142
|
+
if (tag !== 8) break;
|
|
143
|
+
message.nullValue = reader.int32();
|
|
144
|
+
continue;
|
|
145
|
+
case 2:
|
|
146
|
+
if (tag !== 17) break;
|
|
147
|
+
message.numberValue = reader.double();
|
|
148
|
+
continue;
|
|
149
|
+
case 3:
|
|
150
|
+
if (tag !== 26) break;
|
|
151
|
+
message.stringValue = reader.string();
|
|
152
|
+
continue;
|
|
153
|
+
case 4:
|
|
154
|
+
if (tag !== 32) break;
|
|
155
|
+
message.boolValue = reader.bool();
|
|
156
|
+
continue;
|
|
157
|
+
case 5:
|
|
158
|
+
if (tag !== 42) break;
|
|
159
|
+
message.structValue = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
160
|
+
continue;
|
|
161
|
+
case 6:
|
|
162
|
+
if (tag !== 50) break;
|
|
163
|
+
message.listValue = ListValue.unwrap(ListValue.decode(reader, reader.uint32()));
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
167
|
+
reader.skip(tag & 7);
|
|
168
|
+
}
|
|
169
|
+
return message;
|
|
170
|
+
},
|
|
171
|
+
create(base) {
|
|
172
|
+
return Value.fromPartial(base ?? {});
|
|
173
|
+
},
|
|
174
|
+
fromPartial(object) {
|
|
175
|
+
const message = createBaseValue();
|
|
176
|
+
message.nullValue = object.nullValue ?? void 0;
|
|
177
|
+
message.numberValue = object.numberValue ?? void 0;
|
|
178
|
+
message.stringValue = object.stringValue ?? void 0;
|
|
179
|
+
message.boolValue = object.boolValue ?? void 0;
|
|
180
|
+
message.structValue = object.structValue ?? void 0;
|
|
181
|
+
message.listValue = object.listValue ?? void 0;
|
|
182
|
+
return message;
|
|
183
|
+
},
|
|
184
|
+
wrap(value) {
|
|
185
|
+
const result = createBaseValue();
|
|
186
|
+
if (value === null) result.nullValue = NullValue.NULL_VALUE;
|
|
187
|
+
else if (typeof value === "boolean") result.boolValue = value;
|
|
188
|
+
else if (typeof value === "number") result.numberValue = value;
|
|
189
|
+
else if (typeof value === "string") result.stringValue = value;
|
|
190
|
+
else if (globalThis.Array.isArray(value)) result.listValue = value;
|
|
191
|
+
else if (typeof value === "object") result.structValue = value;
|
|
192
|
+
else if (typeof value !== "undefined") throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
193
|
+
return result;
|
|
194
|
+
},
|
|
195
|
+
unwrap(message) {
|
|
196
|
+
if (message.stringValue !== void 0) return message.stringValue;
|
|
197
|
+
else if (message?.numberValue !== void 0) return message.numberValue;
|
|
198
|
+
else if (message?.boolValue !== void 0) return message.boolValue;
|
|
199
|
+
else if (message?.structValue !== void 0) return message.structValue;
|
|
200
|
+
else if (message?.listValue !== void 0) return message.listValue;
|
|
201
|
+
else if (message?.nullValue !== void 0) return null;
|
|
202
|
+
}
|
|
301
203
|
};
|
|
302
204
|
function createBaseListValue() {
|
|
303
|
-
|
|
205
|
+
return { values: [] };
|
|
304
206
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const result = createBaseListValue();
|
|
345
|
-
result.values = array != null ? array : [];
|
|
346
|
-
return result;
|
|
347
|
-
},
|
|
348
|
-
unwrap(message) {
|
|
349
|
-
if ((message == null ? void 0 : message.hasOwnProperty("values")) && globalThis.Array.isArray(message.values)) {
|
|
350
|
-
return message.values;
|
|
351
|
-
} else {
|
|
352
|
-
return message;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
207
|
+
const ListValue = {
|
|
208
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
209
|
+
for (const v of message.values) Value.encode(Value.wrap(v), writer.uint32(10).fork()).join();
|
|
210
|
+
return writer;
|
|
211
|
+
},
|
|
212
|
+
decode(input, length) {
|
|
213
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
214
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
215
|
+
const message = createBaseListValue();
|
|
216
|
+
while (reader.pos < end) {
|
|
217
|
+
const tag = reader.uint32();
|
|
218
|
+
switch (tag >>> 3) {
|
|
219
|
+
case 1:
|
|
220
|
+
if (tag !== 10) break;
|
|
221
|
+
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
|
222
|
+
continue;
|
|
223
|
+
}
|
|
224
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
225
|
+
reader.skip(tag & 7);
|
|
226
|
+
}
|
|
227
|
+
return message;
|
|
228
|
+
},
|
|
229
|
+
create(base) {
|
|
230
|
+
return ListValue.fromPartial(base ?? {});
|
|
231
|
+
},
|
|
232
|
+
fromPartial(object) {
|
|
233
|
+
const message = createBaseListValue();
|
|
234
|
+
message.values = object.values?.map((e) => e) || [];
|
|
235
|
+
return message;
|
|
236
|
+
},
|
|
237
|
+
wrap(array) {
|
|
238
|
+
const result = createBaseListValue();
|
|
239
|
+
result.values = array ?? [];
|
|
240
|
+
return result;
|
|
241
|
+
},
|
|
242
|
+
unwrap(message) {
|
|
243
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) return message.values;
|
|
244
|
+
else return message;
|
|
245
|
+
}
|
|
355
246
|
};
|
|
356
247
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/generated/patch.ts
|
|
250
|
+
let JsonPatchOperationType = /* @__PURE__ */ function(JsonPatchOperationType) {
|
|
251
|
+
JsonPatchOperationType[JsonPatchOperationType["ADD"] = 0] = "ADD";
|
|
252
|
+
JsonPatchOperationType[JsonPatchOperationType["REMOVE"] = 1] = "REMOVE";
|
|
253
|
+
JsonPatchOperationType[JsonPatchOperationType["REPLACE"] = 2] = "REPLACE";
|
|
254
|
+
JsonPatchOperationType[JsonPatchOperationType["MOVE"] = 3] = "MOVE";
|
|
255
|
+
JsonPatchOperationType[JsonPatchOperationType["COPY"] = 4] = "COPY";
|
|
256
|
+
JsonPatchOperationType[JsonPatchOperationType["TEST"] = 5] = "TEST";
|
|
257
|
+
JsonPatchOperationType[JsonPatchOperationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
258
|
+
return JsonPatchOperationType;
|
|
259
|
+
}({});
|
|
369
260
|
function createBaseJsonPatchOperation() {
|
|
370
|
-
|
|
261
|
+
return {
|
|
262
|
+
op: 0,
|
|
263
|
+
path: "",
|
|
264
|
+
from: void 0,
|
|
265
|
+
value: void 0
|
|
266
|
+
};
|
|
371
267
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
421
|
-
continue;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
425
|
-
break;
|
|
426
|
-
}
|
|
427
|
-
reader.skip(tag & 7);
|
|
428
|
-
}
|
|
429
|
-
return message;
|
|
430
|
-
},
|
|
431
|
-
create(base) {
|
|
432
|
-
return JsonPatchOperation.fromPartial(base != null ? base : {});
|
|
433
|
-
},
|
|
434
|
-
fromPartial(object) {
|
|
435
|
-
var _a, _b, _c, _d;
|
|
436
|
-
const message = createBaseJsonPatchOperation();
|
|
437
|
-
message.op = (_a = object.op) != null ? _a : 0;
|
|
438
|
-
message.path = (_b = object.path) != null ? _b : "";
|
|
439
|
-
message.from = (_c = object.from) != null ? _c : void 0;
|
|
440
|
-
message.value = (_d = object.value) != null ? _d : void 0;
|
|
441
|
-
return message;
|
|
442
|
-
}
|
|
268
|
+
const JsonPatchOperation = {
|
|
269
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
270
|
+
if (message.op !== 0) writer.uint32(8).int32(message.op);
|
|
271
|
+
if (message.path !== "") writer.uint32(18).string(message.path);
|
|
272
|
+
if (message.from !== void 0) writer.uint32(26).string(message.from);
|
|
273
|
+
if (message.value !== void 0) Value.encode(Value.wrap(message.value), writer.uint32(34).fork()).join();
|
|
274
|
+
return writer;
|
|
275
|
+
},
|
|
276
|
+
decode(input, length) {
|
|
277
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
278
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
279
|
+
const message = createBaseJsonPatchOperation();
|
|
280
|
+
while (reader.pos < end) {
|
|
281
|
+
const tag = reader.uint32();
|
|
282
|
+
switch (tag >>> 3) {
|
|
283
|
+
case 1:
|
|
284
|
+
if (tag !== 8) break;
|
|
285
|
+
message.op = reader.int32();
|
|
286
|
+
continue;
|
|
287
|
+
case 2:
|
|
288
|
+
if (tag !== 18) break;
|
|
289
|
+
message.path = reader.string();
|
|
290
|
+
continue;
|
|
291
|
+
case 3:
|
|
292
|
+
if (tag !== 26) break;
|
|
293
|
+
message.from = reader.string();
|
|
294
|
+
continue;
|
|
295
|
+
case 4:
|
|
296
|
+
if (tag !== 34) break;
|
|
297
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
301
|
+
reader.skip(tag & 7);
|
|
302
|
+
}
|
|
303
|
+
return message;
|
|
304
|
+
},
|
|
305
|
+
create(base) {
|
|
306
|
+
return JsonPatchOperation.fromPartial(base ?? {});
|
|
307
|
+
},
|
|
308
|
+
fromPartial(object) {
|
|
309
|
+
const message = createBaseJsonPatchOperation();
|
|
310
|
+
message.op = object.op ?? 0;
|
|
311
|
+
message.path = object.path ?? "";
|
|
312
|
+
message.from = object.from ?? void 0;
|
|
313
|
+
message.value = object.value ?? void 0;
|
|
314
|
+
return message;
|
|
315
|
+
}
|
|
443
316
|
};
|
|
444
317
|
|
|
445
|
-
|
|
446
|
-
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/generated/types.ts
|
|
447
320
|
function createBaseToolCall() {
|
|
448
|
-
|
|
321
|
+
return {
|
|
322
|
+
id: "",
|
|
323
|
+
type: "",
|
|
324
|
+
function: void 0
|
|
325
|
+
};
|
|
449
326
|
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
493
|
-
break;
|
|
494
|
-
}
|
|
495
|
-
reader.skip(tag & 7);
|
|
496
|
-
}
|
|
497
|
-
return message;
|
|
498
|
-
},
|
|
499
|
-
create(base) {
|
|
500
|
-
return ToolCall.fromPartial(base != null ? base : {});
|
|
501
|
-
},
|
|
502
|
-
fromPartial(object) {
|
|
503
|
-
var _a, _b;
|
|
504
|
-
const message = createBaseToolCall();
|
|
505
|
-
message.id = (_a = object.id) != null ? _a : "";
|
|
506
|
-
message.type = (_b = object.type) != null ? _b : "";
|
|
507
|
-
message.function = object.function !== void 0 && object.function !== null ? ToolCall_Function.fromPartial(object.function) : void 0;
|
|
508
|
-
return message;
|
|
509
|
-
}
|
|
327
|
+
const ToolCall = {
|
|
328
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
329
|
+
if (message.id !== "") writer.uint32(10).string(message.id);
|
|
330
|
+
if (message.type !== "") writer.uint32(18).string(message.type);
|
|
331
|
+
if (message.function !== void 0) ToolCall_Function.encode(message.function, writer.uint32(26).fork()).join();
|
|
332
|
+
return writer;
|
|
333
|
+
},
|
|
334
|
+
decode(input, length) {
|
|
335
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
336
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
337
|
+
const message = createBaseToolCall();
|
|
338
|
+
while (reader.pos < end) {
|
|
339
|
+
const tag = reader.uint32();
|
|
340
|
+
switch (tag >>> 3) {
|
|
341
|
+
case 1:
|
|
342
|
+
if (tag !== 10) break;
|
|
343
|
+
message.id = reader.string();
|
|
344
|
+
continue;
|
|
345
|
+
case 2:
|
|
346
|
+
if (tag !== 18) break;
|
|
347
|
+
message.type = reader.string();
|
|
348
|
+
continue;
|
|
349
|
+
case 3:
|
|
350
|
+
if (tag !== 26) break;
|
|
351
|
+
message.function = ToolCall_Function.decode(reader, reader.uint32());
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
355
|
+
reader.skip(tag & 7);
|
|
356
|
+
}
|
|
357
|
+
return message;
|
|
358
|
+
},
|
|
359
|
+
create(base) {
|
|
360
|
+
return ToolCall.fromPartial(base ?? {});
|
|
361
|
+
},
|
|
362
|
+
fromPartial(object) {
|
|
363
|
+
const message = createBaseToolCall();
|
|
364
|
+
message.id = object.id ?? "";
|
|
365
|
+
message.type = object.type ?? "";
|
|
366
|
+
message.function = object.function !== void 0 && object.function !== null ? ToolCall_Function.fromPartial(object.function) : void 0;
|
|
367
|
+
return message;
|
|
368
|
+
}
|
|
510
369
|
};
|
|
511
370
|
function createBaseToolCall_Function() {
|
|
512
|
-
|
|
371
|
+
return {
|
|
372
|
+
name: "",
|
|
373
|
+
arguments: ""
|
|
374
|
+
};
|
|
513
375
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
return message;
|
|
552
|
-
},
|
|
553
|
-
create(base) {
|
|
554
|
-
return ToolCall_Function.fromPartial(base != null ? base : {});
|
|
555
|
-
},
|
|
556
|
-
fromPartial(object) {
|
|
557
|
-
var _a, _b;
|
|
558
|
-
const message = createBaseToolCall_Function();
|
|
559
|
-
message.name = (_a = object.name) != null ? _a : "";
|
|
560
|
-
message.arguments = (_b = object.arguments) != null ? _b : "";
|
|
561
|
-
return message;
|
|
562
|
-
}
|
|
376
|
+
const ToolCall_Function = {
|
|
377
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
378
|
+
if (message.name !== "") writer.uint32(10).string(message.name);
|
|
379
|
+
if (message.arguments !== "") writer.uint32(18).string(message.arguments);
|
|
380
|
+
return writer;
|
|
381
|
+
},
|
|
382
|
+
decode(input, length) {
|
|
383
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
384
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
385
|
+
const message = createBaseToolCall_Function();
|
|
386
|
+
while (reader.pos < end) {
|
|
387
|
+
const tag = reader.uint32();
|
|
388
|
+
switch (tag >>> 3) {
|
|
389
|
+
case 1:
|
|
390
|
+
if (tag !== 10) break;
|
|
391
|
+
message.name = reader.string();
|
|
392
|
+
continue;
|
|
393
|
+
case 2:
|
|
394
|
+
if (tag !== 18) break;
|
|
395
|
+
message.arguments = reader.string();
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
399
|
+
reader.skip(tag & 7);
|
|
400
|
+
}
|
|
401
|
+
return message;
|
|
402
|
+
},
|
|
403
|
+
create(base) {
|
|
404
|
+
return ToolCall_Function.fromPartial(base ?? {});
|
|
405
|
+
},
|
|
406
|
+
fromPartial(object) {
|
|
407
|
+
const message = createBaseToolCall_Function();
|
|
408
|
+
message.name = object.name ?? "";
|
|
409
|
+
message.arguments = object.arguments ?? "";
|
|
410
|
+
return message;
|
|
411
|
+
}
|
|
563
412
|
};
|
|
564
413
|
function createBaseMessage() {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
414
|
+
return {
|
|
415
|
+
id: "",
|
|
416
|
+
role: "",
|
|
417
|
+
content: void 0,
|
|
418
|
+
name: void 0,
|
|
419
|
+
toolCalls: [],
|
|
420
|
+
toolCallId: void 0,
|
|
421
|
+
error: void 0
|
|
422
|
+
};
|
|
574
423
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
case 6: {
|
|
643
|
-
if (tag !== 50) {
|
|
644
|
-
break;
|
|
645
|
-
}
|
|
646
|
-
message.toolCallId = reader.string();
|
|
647
|
-
continue;
|
|
648
|
-
}
|
|
649
|
-
case 7: {
|
|
650
|
-
if (tag !== 58) {
|
|
651
|
-
break;
|
|
652
|
-
}
|
|
653
|
-
message.error = reader.string();
|
|
654
|
-
continue;
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
658
|
-
break;
|
|
659
|
-
}
|
|
660
|
-
reader.skip(tag & 7);
|
|
661
|
-
}
|
|
662
|
-
return message;
|
|
663
|
-
},
|
|
664
|
-
create(base) {
|
|
665
|
-
return Message.fromPartial(base != null ? base : {});
|
|
666
|
-
},
|
|
667
|
-
fromPartial(object) {
|
|
668
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
669
|
-
const message = createBaseMessage();
|
|
670
|
-
message.id = (_a = object.id) != null ? _a : "";
|
|
671
|
-
message.role = (_b = object.role) != null ? _b : "";
|
|
672
|
-
message.content = (_c = object.content) != null ? _c : void 0;
|
|
673
|
-
message.name = (_d = object.name) != null ? _d : void 0;
|
|
674
|
-
message.toolCalls = ((_e = object.toolCalls) == null ? void 0 : _e.map((e) => ToolCall.fromPartial(e))) || [];
|
|
675
|
-
message.toolCallId = (_f = object.toolCallId) != null ? _f : void 0;
|
|
676
|
-
message.error = (_g = object.error) != null ? _g : void 0;
|
|
677
|
-
return message;
|
|
678
|
-
}
|
|
424
|
+
const Message = {
|
|
425
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
426
|
+
if (message.id !== "") writer.uint32(10).string(message.id);
|
|
427
|
+
if (message.role !== "") writer.uint32(18).string(message.role);
|
|
428
|
+
if (message.content !== void 0) writer.uint32(26).string(message.content);
|
|
429
|
+
if (message.name !== void 0) writer.uint32(34).string(message.name);
|
|
430
|
+
for (const v of message.toolCalls) ToolCall.encode(v, writer.uint32(42).fork()).join();
|
|
431
|
+
if (message.toolCallId !== void 0) writer.uint32(50).string(message.toolCallId);
|
|
432
|
+
if (message.error !== void 0) writer.uint32(58).string(message.error);
|
|
433
|
+
return writer;
|
|
434
|
+
},
|
|
435
|
+
decode(input, length) {
|
|
436
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
437
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
438
|
+
const message = createBaseMessage();
|
|
439
|
+
while (reader.pos < end) {
|
|
440
|
+
const tag = reader.uint32();
|
|
441
|
+
switch (tag >>> 3) {
|
|
442
|
+
case 1:
|
|
443
|
+
if (tag !== 10) break;
|
|
444
|
+
message.id = reader.string();
|
|
445
|
+
continue;
|
|
446
|
+
case 2:
|
|
447
|
+
if (tag !== 18) break;
|
|
448
|
+
message.role = reader.string();
|
|
449
|
+
continue;
|
|
450
|
+
case 3:
|
|
451
|
+
if (tag !== 26) break;
|
|
452
|
+
message.content = reader.string();
|
|
453
|
+
continue;
|
|
454
|
+
case 4:
|
|
455
|
+
if (tag !== 34) break;
|
|
456
|
+
message.name = reader.string();
|
|
457
|
+
continue;
|
|
458
|
+
case 5:
|
|
459
|
+
if (tag !== 42) break;
|
|
460
|
+
message.toolCalls.push(ToolCall.decode(reader, reader.uint32()));
|
|
461
|
+
continue;
|
|
462
|
+
case 6:
|
|
463
|
+
if (tag !== 50) break;
|
|
464
|
+
message.toolCallId = reader.string();
|
|
465
|
+
continue;
|
|
466
|
+
case 7:
|
|
467
|
+
if (tag !== 58) break;
|
|
468
|
+
message.error = reader.string();
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
472
|
+
reader.skip(tag & 7);
|
|
473
|
+
}
|
|
474
|
+
return message;
|
|
475
|
+
},
|
|
476
|
+
create(base) {
|
|
477
|
+
return Message.fromPartial(base ?? {});
|
|
478
|
+
},
|
|
479
|
+
fromPartial(object) {
|
|
480
|
+
const message = createBaseMessage();
|
|
481
|
+
message.id = object.id ?? "";
|
|
482
|
+
message.role = object.role ?? "";
|
|
483
|
+
message.content = object.content ?? void 0;
|
|
484
|
+
message.name = object.name ?? void 0;
|
|
485
|
+
message.toolCalls = object.toolCalls?.map((e) => ToolCall.fromPartial(e)) || [];
|
|
486
|
+
message.toolCallId = object.toolCallId ?? void 0;
|
|
487
|
+
message.error = object.error ?? void 0;
|
|
488
|
+
return message;
|
|
489
|
+
}
|
|
679
490
|
};
|
|
680
491
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/generated/events.ts
|
|
494
|
+
let EventType$1 = /* @__PURE__ */ function(EventType) {
|
|
495
|
+
EventType[EventType["TEXT_MESSAGE_START"] = 0] = "TEXT_MESSAGE_START";
|
|
496
|
+
EventType[EventType["TEXT_MESSAGE_CONTENT"] = 1] = "TEXT_MESSAGE_CONTENT";
|
|
497
|
+
EventType[EventType["TEXT_MESSAGE_END"] = 2] = "TEXT_MESSAGE_END";
|
|
498
|
+
EventType[EventType["TOOL_CALL_START"] = 3] = "TOOL_CALL_START";
|
|
499
|
+
EventType[EventType["TOOL_CALL_ARGS"] = 4] = "TOOL_CALL_ARGS";
|
|
500
|
+
EventType[EventType["TOOL_CALL_END"] = 5] = "TOOL_CALL_END";
|
|
501
|
+
EventType[EventType["STATE_SNAPSHOT"] = 6] = "STATE_SNAPSHOT";
|
|
502
|
+
EventType[EventType["STATE_DELTA"] = 7] = "STATE_DELTA";
|
|
503
|
+
EventType[EventType["MESSAGES_SNAPSHOT"] = 8] = "MESSAGES_SNAPSHOT";
|
|
504
|
+
EventType[EventType["RAW"] = 9] = "RAW";
|
|
505
|
+
EventType[EventType["CUSTOM"] = 10] = "CUSTOM";
|
|
506
|
+
EventType[EventType["RUN_STARTED"] = 11] = "RUN_STARTED";
|
|
507
|
+
EventType[EventType["RUN_FINISHED"] = 12] = "RUN_FINISHED";
|
|
508
|
+
EventType[EventType["RUN_ERROR"] = 13] = "RUN_ERROR";
|
|
509
|
+
EventType[EventType["STEP_STARTED"] = 14] = "STEP_STARTED";
|
|
510
|
+
EventType[EventType["STEP_FINISHED"] = 15] = "STEP_FINISHED";
|
|
511
|
+
EventType[EventType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
512
|
+
return EventType;
|
|
513
|
+
}({});
|
|
702
514
|
function createBaseBaseEvent() {
|
|
703
|
-
|
|
515
|
+
return {
|
|
516
|
+
type: 0,
|
|
517
|
+
timestamp: void 0,
|
|
518
|
+
rawEvent: void 0
|
|
519
|
+
};
|
|
704
520
|
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
748
|
-
break;
|
|
749
|
-
}
|
|
750
|
-
reader.skip(tag & 7);
|
|
751
|
-
}
|
|
752
|
-
return message;
|
|
753
|
-
},
|
|
754
|
-
create(base) {
|
|
755
|
-
return BaseEvent.fromPartial(base != null ? base : {});
|
|
756
|
-
},
|
|
757
|
-
fromPartial(object) {
|
|
758
|
-
var _a, _b, _c;
|
|
759
|
-
const message = createBaseBaseEvent();
|
|
760
|
-
message.type = (_a = object.type) != null ? _a : 0;
|
|
761
|
-
message.timestamp = (_b = object.timestamp) != null ? _b : void 0;
|
|
762
|
-
message.rawEvent = (_c = object.rawEvent) != null ? _c : void 0;
|
|
763
|
-
return message;
|
|
764
|
-
}
|
|
521
|
+
const BaseEvent = {
|
|
522
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
523
|
+
if (message.type !== 0) writer.uint32(8).int32(message.type);
|
|
524
|
+
if (message.timestamp !== void 0) writer.uint32(16).int64(message.timestamp);
|
|
525
|
+
if (message.rawEvent !== void 0) Value.encode(Value.wrap(message.rawEvent), writer.uint32(26).fork()).join();
|
|
526
|
+
return writer;
|
|
527
|
+
},
|
|
528
|
+
decode(input, length) {
|
|
529
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
530
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
531
|
+
const message = createBaseBaseEvent();
|
|
532
|
+
while (reader.pos < end) {
|
|
533
|
+
const tag = reader.uint32();
|
|
534
|
+
switch (tag >>> 3) {
|
|
535
|
+
case 1:
|
|
536
|
+
if (tag !== 8) break;
|
|
537
|
+
message.type = reader.int32();
|
|
538
|
+
continue;
|
|
539
|
+
case 2:
|
|
540
|
+
if (tag !== 16) break;
|
|
541
|
+
message.timestamp = longToNumber(reader.int64());
|
|
542
|
+
continue;
|
|
543
|
+
case 3:
|
|
544
|
+
if (tag !== 26) break;
|
|
545
|
+
message.rawEvent = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
548
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
549
|
+
reader.skip(tag & 7);
|
|
550
|
+
}
|
|
551
|
+
return message;
|
|
552
|
+
},
|
|
553
|
+
create(base) {
|
|
554
|
+
return BaseEvent.fromPartial(base ?? {});
|
|
555
|
+
},
|
|
556
|
+
fromPartial(object) {
|
|
557
|
+
const message = createBaseBaseEvent();
|
|
558
|
+
message.type = object.type ?? 0;
|
|
559
|
+
message.timestamp = object.timestamp ?? void 0;
|
|
560
|
+
message.rawEvent = object.rawEvent ?? void 0;
|
|
561
|
+
return message;
|
|
562
|
+
}
|
|
765
563
|
};
|
|
766
564
|
function createBaseTextMessageStartEvent() {
|
|
767
|
-
|
|
565
|
+
return {
|
|
566
|
+
baseEvent: void 0,
|
|
567
|
+
messageId: "",
|
|
568
|
+
role: void 0
|
|
569
|
+
};
|
|
768
570
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
812
|
-
break;
|
|
813
|
-
}
|
|
814
|
-
reader.skip(tag & 7);
|
|
815
|
-
}
|
|
816
|
-
return message;
|
|
817
|
-
},
|
|
818
|
-
create(base) {
|
|
819
|
-
return TextMessageStartEvent.fromPartial(base != null ? base : {});
|
|
820
|
-
},
|
|
821
|
-
fromPartial(object) {
|
|
822
|
-
var _a, _b;
|
|
823
|
-
const message = createBaseTextMessageStartEvent();
|
|
824
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
825
|
-
message.messageId = (_a = object.messageId) != null ? _a : "";
|
|
826
|
-
message.role = (_b = object.role) != null ? _b : void 0;
|
|
827
|
-
return message;
|
|
828
|
-
}
|
|
571
|
+
const TextMessageStartEvent = {
|
|
572
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
573
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
574
|
+
if (message.messageId !== "") writer.uint32(18).string(message.messageId);
|
|
575
|
+
if (message.role !== void 0) writer.uint32(26).string(message.role);
|
|
576
|
+
return writer;
|
|
577
|
+
},
|
|
578
|
+
decode(input, length) {
|
|
579
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
580
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
581
|
+
const message = createBaseTextMessageStartEvent();
|
|
582
|
+
while (reader.pos < end) {
|
|
583
|
+
const tag = reader.uint32();
|
|
584
|
+
switch (tag >>> 3) {
|
|
585
|
+
case 1:
|
|
586
|
+
if (tag !== 10) break;
|
|
587
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
588
|
+
continue;
|
|
589
|
+
case 2:
|
|
590
|
+
if (tag !== 18) break;
|
|
591
|
+
message.messageId = reader.string();
|
|
592
|
+
continue;
|
|
593
|
+
case 3:
|
|
594
|
+
if (tag !== 26) break;
|
|
595
|
+
message.role = reader.string();
|
|
596
|
+
continue;
|
|
597
|
+
}
|
|
598
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
599
|
+
reader.skip(tag & 7);
|
|
600
|
+
}
|
|
601
|
+
return message;
|
|
602
|
+
},
|
|
603
|
+
create(base) {
|
|
604
|
+
return TextMessageStartEvent.fromPartial(base ?? {});
|
|
605
|
+
},
|
|
606
|
+
fromPartial(object) {
|
|
607
|
+
const message = createBaseTextMessageStartEvent();
|
|
608
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
609
|
+
message.messageId = object.messageId ?? "";
|
|
610
|
+
message.role = object.role ?? void 0;
|
|
611
|
+
return message;
|
|
612
|
+
}
|
|
829
613
|
};
|
|
830
614
|
function createBaseTextMessageContentEvent() {
|
|
831
|
-
|
|
615
|
+
return {
|
|
616
|
+
baseEvent: void 0,
|
|
617
|
+
messageId: "",
|
|
618
|
+
delta: ""
|
|
619
|
+
};
|
|
832
620
|
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
876
|
-
break;
|
|
877
|
-
}
|
|
878
|
-
reader.skip(tag & 7);
|
|
879
|
-
}
|
|
880
|
-
return message;
|
|
881
|
-
},
|
|
882
|
-
create(base) {
|
|
883
|
-
return TextMessageContentEvent.fromPartial(base != null ? base : {});
|
|
884
|
-
},
|
|
885
|
-
fromPartial(object) {
|
|
886
|
-
var _a, _b;
|
|
887
|
-
const message = createBaseTextMessageContentEvent();
|
|
888
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
889
|
-
message.messageId = (_a = object.messageId) != null ? _a : "";
|
|
890
|
-
message.delta = (_b = object.delta) != null ? _b : "";
|
|
891
|
-
return message;
|
|
892
|
-
}
|
|
621
|
+
const TextMessageContentEvent = {
|
|
622
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
623
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
624
|
+
if (message.messageId !== "") writer.uint32(18).string(message.messageId);
|
|
625
|
+
if (message.delta !== "") writer.uint32(26).string(message.delta);
|
|
626
|
+
return writer;
|
|
627
|
+
},
|
|
628
|
+
decode(input, length) {
|
|
629
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
630
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
631
|
+
const message = createBaseTextMessageContentEvent();
|
|
632
|
+
while (reader.pos < end) {
|
|
633
|
+
const tag = reader.uint32();
|
|
634
|
+
switch (tag >>> 3) {
|
|
635
|
+
case 1:
|
|
636
|
+
if (tag !== 10) break;
|
|
637
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
638
|
+
continue;
|
|
639
|
+
case 2:
|
|
640
|
+
if (tag !== 18) break;
|
|
641
|
+
message.messageId = reader.string();
|
|
642
|
+
continue;
|
|
643
|
+
case 3:
|
|
644
|
+
if (tag !== 26) break;
|
|
645
|
+
message.delta = reader.string();
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
649
|
+
reader.skip(tag & 7);
|
|
650
|
+
}
|
|
651
|
+
return message;
|
|
652
|
+
},
|
|
653
|
+
create(base) {
|
|
654
|
+
return TextMessageContentEvent.fromPartial(base ?? {});
|
|
655
|
+
},
|
|
656
|
+
fromPartial(object) {
|
|
657
|
+
const message = createBaseTextMessageContentEvent();
|
|
658
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
659
|
+
message.messageId = object.messageId ?? "";
|
|
660
|
+
message.delta = object.delta ?? "";
|
|
661
|
+
return message;
|
|
662
|
+
}
|
|
893
663
|
};
|
|
894
664
|
function createBaseTextMessageEndEvent() {
|
|
895
|
-
|
|
665
|
+
return {
|
|
666
|
+
baseEvent: void 0,
|
|
667
|
+
messageId: ""
|
|
668
|
+
};
|
|
896
669
|
}
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
}
|
|
934
|
-
return message;
|
|
935
|
-
},
|
|
936
|
-
create(base) {
|
|
937
|
-
return TextMessageEndEvent.fromPartial(base != null ? base : {});
|
|
938
|
-
},
|
|
939
|
-
fromPartial(object) {
|
|
940
|
-
var _a;
|
|
941
|
-
const message = createBaseTextMessageEndEvent();
|
|
942
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
943
|
-
message.messageId = (_a = object.messageId) != null ? _a : "";
|
|
944
|
-
return message;
|
|
945
|
-
}
|
|
670
|
+
const TextMessageEndEvent = {
|
|
671
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
672
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
673
|
+
if (message.messageId !== "") writer.uint32(18).string(message.messageId);
|
|
674
|
+
return writer;
|
|
675
|
+
},
|
|
676
|
+
decode(input, length) {
|
|
677
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
678
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
679
|
+
const message = createBaseTextMessageEndEvent();
|
|
680
|
+
while (reader.pos < end) {
|
|
681
|
+
const tag = reader.uint32();
|
|
682
|
+
switch (tag >>> 3) {
|
|
683
|
+
case 1:
|
|
684
|
+
if (tag !== 10) break;
|
|
685
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
686
|
+
continue;
|
|
687
|
+
case 2:
|
|
688
|
+
if (tag !== 18) break;
|
|
689
|
+
message.messageId = reader.string();
|
|
690
|
+
continue;
|
|
691
|
+
}
|
|
692
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
693
|
+
reader.skip(tag & 7);
|
|
694
|
+
}
|
|
695
|
+
return message;
|
|
696
|
+
},
|
|
697
|
+
create(base) {
|
|
698
|
+
return TextMessageEndEvent.fromPartial(base ?? {});
|
|
699
|
+
},
|
|
700
|
+
fromPartial(object) {
|
|
701
|
+
const message = createBaseTextMessageEndEvent();
|
|
702
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
703
|
+
message.messageId = object.messageId ?? "";
|
|
704
|
+
return message;
|
|
705
|
+
}
|
|
946
706
|
};
|
|
947
707
|
function createBaseToolCallStartEvent() {
|
|
948
|
-
|
|
708
|
+
return {
|
|
709
|
+
baseEvent: void 0,
|
|
710
|
+
toolCallId: "",
|
|
711
|
+
toolCallName: "",
|
|
712
|
+
parentMessageId: void 0
|
|
713
|
+
};
|
|
949
714
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
message.parentMessageId = reader.string();
|
|
999
|
-
continue;
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1003
|
-
break;
|
|
1004
|
-
}
|
|
1005
|
-
reader.skip(tag & 7);
|
|
1006
|
-
}
|
|
1007
|
-
return message;
|
|
1008
|
-
},
|
|
1009
|
-
create(base) {
|
|
1010
|
-
return ToolCallStartEvent.fromPartial(base != null ? base : {});
|
|
1011
|
-
},
|
|
1012
|
-
fromPartial(object) {
|
|
1013
|
-
var _a, _b, _c;
|
|
1014
|
-
const message = createBaseToolCallStartEvent();
|
|
1015
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1016
|
-
message.toolCallId = (_a = object.toolCallId) != null ? _a : "";
|
|
1017
|
-
message.toolCallName = (_b = object.toolCallName) != null ? _b : "";
|
|
1018
|
-
message.parentMessageId = (_c = object.parentMessageId) != null ? _c : void 0;
|
|
1019
|
-
return message;
|
|
1020
|
-
}
|
|
715
|
+
const ToolCallStartEvent = {
|
|
716
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
717
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
718
|
+
if (message.toolCallId !== "") writer.uint32(18).string(message.toolCallId);
|
|
719
|
+
if (message.toolCallName !== "") writer.uint32(26).string(message.toolCallName);
|
|
720
|
+
if (message.parentMessageId !== void 0) writer.uint32(34).string(message.parentMessageId);
|
|
721
|
+
return writer;
|
|
722
|
+
},
|
|
723
|
+
decode(input, length) {
|
|
724
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
725
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
726
|
+
const message = createBaseToolCallStartEvent();
|
|
727
|
+
while (reader.pos < end) {
|
|
728
|
+
const tag = reader.uint32();
|
|
729
|
+
switch (tag >>> 3) {
|
|
730
|
+
case 1:
|
|
731
|
+
if (tag !== 10) break;
|
|
732
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
733
|
+
continue;
|
|
734
|
+
case 2:
|
|
735
|
+
if (tag !== 18) break;
|
|
736
|
+
message.toolCallId = reader.string();
|
|
737
|
+
continue;
|
|
738
|
+
case 3:
|
|
739
|
+
if (tag !== 26) break;
|
|
740
|
+
message.toolCallName = reader.string();
|
|
741
|
+
continue;
|
|
742
|
+
case 4:
|
|
743
|
+
if (tag !== 34) break;
|
|
744
|
+
message.parentMessageId = reader.string();
|
|
745
|
+
continue;
|
|
746
|
+
}
|
|
747
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
748
|
+
reader.skip(tag & 7);
|
|
749
|
+
}
|
|
750
|
+
return message;
|
|
751
|
+
},
|
|
752
|
+
create(base) {
|
|
753
|
+
return ToolCallStartEvent.fromPartial(base ?? {});
|
|
754
|
+
},
|
|
755
|
+
fromPartial(object) {
|
|
756
|
+
const message = createBaseToolCallStartEvent();
|
|
757
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
758
|
+
message.toolCallId = object.toolCallId ?? "";
|
|
759
|
+
message.toolCallName = object.toolCallName ?? "";
|
|
760
|
+
message.parentMessageId = object.parentMessageId ?? void 0;
|
|
761
|
+
return message;
|
|
762
|
+
}
|
|
1021
763
|
};
|
|
1022
764
|
function createBaseToolCallArgsEvent() {
|
|
1023
|
-
|
|
765
|
+
return {
|
|
766
|
+
baseEvent: void 0,
|
|
767
|
+
toolCallId: "",
|
|
768
|
+
delta: ""
|
|
769
|
+
};
|
|
1024
770
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1068
|
-
break;
|
|
1069
|
-
}
|
|
1070
|
-
reader.skip(tag & 7);
|
|
1071
|
-
}
|
|
1072
|
-
return message;
|
|
1073
|
-
},
|
|
1074
|
-
create(base) {
|
|
1075
|
-
return ToolCallArgsEvent.fromPartial(base != null ? base : {});
|
|
1076
|
-
},
|
|
1077
|
-
fromPartial(object) {
|
|
1078
|
-
var _a, _b;
|
|
1079
|
-
const message = createBaseToolCallArgsEvent();
|
|
1080
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1081
|
-
message.toolCallId = (_a = object.toolCallId) != null ? _a : "";
|
|
1082
|
-
message.delta = (_b = object.delta) != null ? _b : "";
|
|
1083
|
-
return message;
|
|
1084
|
-
}
|
|
771
|
+
const ToolCallArgsEvent = {
|
|
772
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
773
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
774
|
+
if (message.toolCallId !== "") writer.uint32(18).string(message.toolCallId);
|
|
775
|
+
if (message.delta !== "") writer.uint32(26).string(message.delta);
|
|
776
|
+
return writer;
|
|
777
|
+
},
|
|
778
|
+
decode(input, length) {
|
|
779
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
780
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
781
|
+
const message = createBaseToolCallArgsEvent();
|
|
782
|
+
while (reader.pos < end) {
|
|
783
|
+
const tag = reader.uint32();
|
|
784
|
+
switch (tag >>> 3) {
|
|
785
|
+
case 1:
|
|
786
|
+
if (tag !== 10) break;
|
|
787
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
788
|
+
continue;
|
|
789
|
+
case 2:
|
|
790
|
+
if (tag !== 18) break;
|
|
791
|
+
message.toolCallId = reader.string();
|
|
792
|
+
continue;
|
|
793
|
+
case 3:
|
|
794
|
+
if (tag !== 26) break;
|
|
795
|
+
message.delta = reader.string();
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
799
|
+
reader.skip(tag & 7);
|
|
800
|
+
}
|
|
801
|
+
return message;
|
|
802
|
+
},
|
|
803
|
+
create(base) {
|
|
804
|
+
return ToolCallArgsEvent.fromPartial(base ?? {});
|
|
805
|
+
},
|
|
806
|
+
fromPartial(object) {
|
|
807
|
+
const message = createBaseToolCallArgsEvent();
|
|
808
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
809
|
+
message.toolCallId = object.toolCallId ?? "";
|
|
810
|
+
message.delta = object.delta ?? "";
|
|
811
|
+
return message;
|
|
812
|
+
}
|
|
1085
813
|
};
|
|
1086
814
|
function createBaseToolCallEndEvent() {
|
|
1087
|
-
|
|
815
|
+
return {
|
|
816
|
+
baseEvent: void 0,
|
|
817
|
+
toolCallId: ""
|
|
818
|
+
};
|
|
1088
819
|
}
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
}
|
|
1126
|
-
return message;
|
|
1127
|
-
},
|
|
1128
|
-
create(base) {
|
|
1129
|
-
return ToolCallEndEvent.fromPartial(base != null ? base : {});
|
|
1130
|
-
},
|
|
1131
|
-
fromPartial(object) {
|
|
1132
|
-
var _a;
|
|
1133
|
-
const message = createBaseToolCallEndEvent();
|
|
1134
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1135
|
-
message.toolCallId = (_a = object.toolCallId) != null ? _a : "";
|
|
1136
|
-
return message;
|
|
1137
|
-
}
|
|
820
|
+
const ToolCallEndEvent = {
|
|
821
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
822
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
823
|
+
if (message.toolCallId !== "") writer.uint32(18).string(message.toolCallId);
|
|
824
|
+
return writer;
|
|
825
|
+
},
|
|
826
|
+
decode(input, length) {
|
|
827
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
828
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
829
|
+
const message = createBaseToolCallEndEvent();
|
|
830
|
+
while (reader.pos < end) {
|
|
831
|
+
const tag = reader.uint32();
|
|
832
|
+
switch (tag >>> 3) {
|
|
833
|
+
case 1:
|
|
834
|
+
if (tag !== 10) break;
|
|
835
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
836
|
+
continue;
|
|
837
|
+
case 2:
|
|
838
|
+
if (tag !== 18) break;
|
|
839
|
+
message.toolCallId = reader.string();
|
|
840
|
+
continue;
|
|
841
|
+
}
|
|
842
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
843
|
+
reader.skip(tag & 7);
|
|
844
|
+
}
|
|
845
|
+
return message;
|
|
846
|
+
},
|
|
847
|
+
create(base) {
|
|
848
|
+
return ToolCallEndEvent.fromPartial(base ?? {});
|
|
849
|
+
},
|
|
850
|
+
fromPartial(object) {
|
|
851
|
+
const message = createBaseToolCallEndEvent();
|
|
852
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
853
|
+
message.toolCallId = object.toolCallId ?? "";
|
|
854
|
+
return message;
|
|
855
|
+
}
|
|
1138
856
|
};
|
|
1139
857
|
function createBaseStateSnapshotEvent() {
|
|
1140
|
-
|
|
858
|
+
return {
|
|
859
|
+
baseEvent: void 0,
|
|
860
|
+
snapshot: void 0
|
|
861
|
+
};
|
|
1141
862
|
}
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
}
|
|
1179
|
-
return message;
|
|
1180
|
-
},
|
|
1181
|
-
create(base) {
|
|
1182
|
-
return StateSnapshotEvent.fromPartial(base != null ? base : {});
|
|
1183
|
-
},
|
|
1184
|
-
fromPartial(object) {
|
|
1185
|
-
var _a;
|
|
1186
|
-
const message = createBaseStateSnapshotEvent();
|
|
1187
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1188
|
-
message.snapshot = (_a = object.snapshot) != null ? _a : void 0;
|
|
1189
|
-
return message;
|
|
1190
|
-
}
|
|
863
|
+
const StateSnapshotEvent = {
|
|
864
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
865
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
866
|
+
if (message.snapshot !== void 0) Value.encode(Value.wrap(message.snapshot), writer.uint32(18).fork()).join();
|
|
867
|
+
return writer;
|
|
868
|
+
},
|
|
869
|
+
decode(input, length) {
|
|
870
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
871
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
872
|
+
const message = createBaseStateSnapshotEvent();
|
|
873
|
+
while (reader.pos < end) {
|
|
874
|
+
const tag = reader.uint32();
|
|
875
|
+
switch (tag >>> 3) {
|
|
876
|
+
case 1:
|
|
877
|
+
if (tag !== 10) break;
|
|
878
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
879
|
+
continue;
|
|
880
|
+
case 2:
|
|
881
|
+
if (tag !== 18) break;
|
|
882
|
+
message.snapshot = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
883
|
+
continue;
|
|
884
|
+
}
|
|
885
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
886
|
+
reader.skip(tag & 7);
|
|
887
|
+
}
|
|
888
|
+
return message;
|
|
889
|
+
},
|
|
890
|
+
create(base) {
|
|
891
|
+
return StateSnapshotEvent.fromPartial(base ?? {});
|
|
892
|
+
},
|
|
893
|
+
fromPartial(object) {
|
|
894
|
+
const message = createBaseStateSnapshotEvent();
|
|
895
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
896
|
+
message.snapshot = object.snapshot ?? void 0;
|
|
897
|
+
return message;
|
|
898
|
+
}
|
|
1191
899
|
};
|
|
1192
900
|
function createBaseStateDeltaEvent() {
|
|
1193
|
-
|
|
901
|
+
return {
|
|
902
|
+
baseEvent: void 0,
|
|
903
|
+
delta: []
|
|
904
|
+
};
|
|
1194
905
|
}
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
}
|
|
1232
|
-
return message;
|
|
1233
|
-
},
|
|
1234
|
-
create(base) {
|
|
1235
|
-
return StateDeltaEvent.fromPartial(base != null ? base : {});
|
|
1236
|
-
},
|
|
1237
|
-
fromPartial(object) {
|
|
1238
|
-
var _a;
|
|
1239
|
-
const message = createBaseStateDeltaEvent();
|
|
1240
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1241
|
-
message.delta = ((_a = object.delta) == null ? void 0 : _a.map((e) => JsonPatchOperation.fromPartial(e))) || [];
|
|
1242
|
-
return message;
|
|
1243
|
-
}
|
|
906
|
+
const StateDeltaEvent = {
|
|
907
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
908
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
909
|
+
for (const v of message.delta) JsonPatchOperation.encode(v, writer.uint32(18).fork()).join();
|
|
910
|
+
return writer;
|
|
911
|
+
},
|
|
912
|
+
decode(input, length) {
|
|
913
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
914
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
915
|
+
const message = createBaseStateDeltaEvent();
|
|
916
|
+
while (reader.pos < end) {
|
|
917
|
+
const tag = reader.uint32();
|
|
918
|
+
switch (tag >>> 3) {
|
|
919
|
+
case 1:
|
|
920
|
+
if (tag !== 10) break;
|
|
921
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
922
|
+
continue;
|
|
923
|
+
case 2:
|
|
924
|
+
if (tag !== 18) break;
|
|
925
|
+
message.delta.push(JsonPatchOperation.decode(reader, reader.uint32()));
|
|
926
|
+
continue;
|
|
927
|
+
}
|
|
928
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
929
|
+
reader.skip(tag & 7);
|
|
930
|
+
}
|
|
931
|
+
return message;
|
|
932
|
+
},
|
|
933
|
+
create(base) {
|
|
934
|
+
return StateDeltaEvent.fromPartial(base ?? {});
|
|
935
|
+
},
|
|
936
|
+
fromPartial(object) {
|
|
937
|
+
const message = createBaseStateDeltaEvent();
|
|
938
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
939
|
+
message.delta = object.delta?.map((e) => JsonPatchOperation.fromPartial(e)) || [];
|
|
940
|
+
return message;
|
|
941
|
+
}
|
|
1244
942
|
};
|
|
1245
943
|
function createBaseMessagesSnapshotEvent() {
|
|
1246
|
-
|
|
944
|
+
return {
|
|
945
|
+
baseEvent: void 0,
|
|
946
|
+
messages: []
|
|
947
|
+
};
|
|
1247
948
|
}
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
}
|
|
1285
|
-
return message;
|
|
1286
|
-
},
|
|
1287
|
-
create(base) {
|
|
1288
|
-
return MessagesSnapshotEvent.fromPartial(base != null ? base : {});
|
|
1289
|
-
},
|
|
1290
|
-
fromPartial(object) {
|
|
1291
|
-
var _a;
|
|
1292
|
-
const message = createBaseMessagesSnapshotEvent();
|
|
1293
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1294
|
-
message.messages = ((_a = object.messages) == null ? void 0 : _a.map((e) => Message.fromPartial(e))) || [];
|
|
1295
|
-
return message;
|
|
1296
|
-
}
|
|
949
|
+
const MessagesSnapshotEvent = {
|
|
950
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
951
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
952
|
+
for (const v of message.messages) Message.encode(v, writer.uint32(18).fork()).join();
|
|
953
|
+
return writer;
|
|
954
|
+
},
|
|
955
|
+
decode(input, length) {
|
|
956
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
957
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
958
|
+
const message = createBaseMessagesSnapshotEvent();
|
|
959
|
+
while (reader.pos < end) {
|
|
960
|
+
const tag = reader.uint32();
|
|
961
|
+
switch (tag >>> 3) {
|
|
962
|
+
case 1:
|
|
963
|
+
if (tag !== 10) break;
|
|
964
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
965
|
+
continue;
|
|
966
|
+
case 2:
|
|
967
|
+
if (tag !== 18) break;
|
|
968
|
+
message.messages.push(Message.decode(reader, reader.uint32()));
|
|
969
|
+
continue;
|
|
970
|
+
}
|
|
971
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
972
|
+
reader.skip(tag & 7);
|
|
973
|
+
}
|
|
974
|
+
return message;
|
|
975
|
+
},
|
|
976
|
+
create(base) {
|
|
977
|
+
return MessagesSnapshotEvent.fromPartial(base ?? {});
|
|
978
|
+
},
|
|
979
|
+
fromPartial(object) {
|
|
980
|
+
const message = createBaseMessagesSnapshotEvent();
|
|
981
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
982
|
+
message.messages = object.messages?.map((e) => Message.fromPartial(e)) || [];
|
|
983
|
+
return message;
|
|
984
|
+
}
|
|
1297
985
|
};
|
|
1298
986
|
function createBaseRawEvent() {
|
|
1299
|
-
|
|
987
|
+
return {
|
|
988
|
+
baseEvent: void 0,
|
|
989
|
+
event: void 0,
|
|
990
|
+
source: void 0
|
|
991
|
+
};
|
|
1300
992
|
}
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1344
|
-
break;
|
|
1345
|
-
}
|
|
1346
|
-
reader.skip(tag & 7);
|
|
1347
|
-
}
|
|
1348
|
-
return message;
|
|
1349
|
-
},
|
|
1350
|
-
create(base) {
|
|
1351
|
-
return RawEvent.fromPartial(base != null ? base : {});
|
|
1352
|
-
},
|
|
1353
|
-
fromPartial(object) {
|
|
1354
|
-
var _a, _b;
|
|
1355
|
-
const message = createBaseRawEvent();
|
|
1356
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1357
|
-
message.event = (_a = object.event) != null ? _a : void 0;
|
|
1358
|
-
message.source = (_b = object.source) != null ? _b : void 0;
|
|
1359
|
-
return message;
|
|
1360
|
-
}
|
|
993
|
+
const RawEvent = {
|
|
994
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
995
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
996
|
+
if (message.event !== void 0) Value.encode(Value.wrap(message.event), writer.uint32(18).fork()).join();
|
|
997
|
+
if (message.source !== void 0) writer.uint32(26).string(message.source);
|
|
998
|
+
return writer;
|
|
999
|
+
},
|
|
1000
|
+
decode(input, length) {
|
|
1001
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1002
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1003
|
+
const message = createBaseRawEvent();
|
|
1004
|
+
while (reader.pos < end) {
|
|
1005
|
+
const tag = reader.uint32();
|
|
1006
|
+
switch (tag >>> 3) {
|
|
1007
|
+
case 1:
|
|
1008
|
+
if (tag !== 10) break;
|
|
1009
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1010
|
+
continue;
|
|
1011
|
+
case 2:
|
|
1012
|
+
if (tag !== 18) break;
|
|
1013
|
+
message.event = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
1014
|
+
continue;
|
|
1015
|
+
case 3:
|
|
1016
|
+
if (tag !== 26) break;
|
|
1017
|
+
message.source = reader.string();
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1021
|
+
reader.skip(tag & 7);
|
|
1022
|
+
}
|
|
1023
|
+
return message;
|
|
1024
|
+
},
|
|
1025
|
+
create(base) {
|
|
1026
|
+
return RawEvent.fromPartial(base ?? {});
|
|
1027
|
+
},
|
|
1028
|
+
fromPartial(object) {
|
|
1029
|
+
const message = createBaseRawEvent();
|
|
1030
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1031
|
+
message.event = object.event ?? void 0;
|
|
1032
|
+
message.source = object.source ?? void 0;
|
|
1033
|
+
return message;
|
|
1034
|
+
}
|
|
1361
1035
|
};
|
|
1362
1036
|
function createBaseCustomEvent() {
|
|
1363
|
-
|
|
1037
|
+
return {
|
|
1038
|
+
baseEvent: void 0,
|
|
1039
|
+
name: "",
|
|
1040
|
+
value: void 0
|
|
1041
|
+
};
|
|
1364
1042
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1408
|
-
break;
|
|
1409
|
-
}
|
|
1410
|
-
reader.skip(tag & 7);
|
|
1411
|
-
}
|
|
1412
|
-
return message;
|
|
1413
|
-
},
|
|
1414
|
-
create(base) {
|
|
1415
|
-
return CustomEvent.fromPartial(base != null ? base : {});
|
|
1416
|
-
},
|
|
1417
|
-
fromPartial(object) {
|
|
1418
|
-
var _a, _b;
|
|
1419
|
-
const message = createBaseCustomEvent();
|
|
1420
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1421
|
-
message.name = (_a = object.name) != null ? _a : "";
|
|
1422
|
-
message.value = (_b = object.value) != null ? _b : void 0;
|
|
1423
|
-
return message;
|
|
1424
|
-
}
|
|
1043
|
+
const CustomEvent = {
|
|
1044
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1045
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1046
|
+
if (message.name !== "") writer.uint32(18).string(message.name);
|
|
1047
|
+
if (message.value !== void 0) Value.encode(Value.wrap(message.value), writer.uint32(26).fork()).join();
|
|
1048
|
+
return writer;
|
|
1049
|
+
},
|
|
1050
|
+
decode(input, length) {
|
|
1051
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1052
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1053
|
+
const message = createBaseCustomEvent();
|
|
1054
|
+
while (reader.pos < end) {
|
|
1055
|
+
const tag = reader.uint32();
|
|
1056
|
+
switch (tag >>> 3) {
|
|
1057
|
+
case 1:
|
|
1058
|
+
if (tag !== 10) break;
|
|
1059
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1060
|
+
continue;
|
|
1061
|
+
case 2:
|
|
1062
|
+
if (tag !== 18) break;
|
|
1063
|
+
message.name = reader.string();
|
|
1064
|
+
continue;
|
|
1065
|
+
case 3:
|
|
1066
|
+
if (tag !== 26) break;
|
|
1067
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
1068
|
+
continue;
|
|
1069
|
+
}
|
|
1070
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1071
|
+
reader.skip(tag & 7);
|
|
1072
|
+
}
|
|
1073
|
+
return message;
|
|
1074
|
+
},
|
|
1075
|
+
create(base) {
|
|
1076
|
+
return CustomEvent.fromPartial(base ?? {});
|
|
1077
|
+
},
|
|
1078
|
+
fromPartial(object) {
|
|
1079
|
+
const message = createBaseCustomEvent();
|
|
1080
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1081
|
+
message.name = object.name ?? "";
|
|
1082
|
+
message.value = object.value ?? void 0;
|
|
1083
|
+
return message;
|
|
1084
|
+
}
|
|
1425
1085
|
};
|
|
1426
1086
|
function createBaseRunStartedEvent() {
|
|
1427
|
-
|
|
1087
|
+
return {
|
|
1088
|
+
baseEvent: void 0,
|
|
1089
|
+
threadId: "",
|
|
1090
|
+
runId: ""
|
|
1091
|
+
};
|
|
1428
1092
|
}
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1472
|
-
break;
|
|
1473
|
-
}
|
|
1474
|
-
reader.skip(tag & 7);
|
|
1475
|
-
}
|
|
1476
|
-
return message;
|
|
1477
|
-
},
|
|
1478
|
-
create(base) {
|
|
1479
|
-
return RunStartedEvent.fromPartial(base != null ? base : {});
|
|
1480
|
-
},
|
|
1481
|
-
fromPartial(object) {
|
|
1482
|
-
var _a, _b;
|
|
1483
|
-
const message = createBaseRunStartedEvent();
|
|
1484
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1485
|
-
message.threadId = (_a = object.threadId) != null ? _a : "";
|
|
1486
|
-
message.runId = (_b = object.runId) != null ? _b : "";
|
|
1487
|
-
return message;
|
|
1488
|
-
}
|
|
1093
|
+
const RunStartedEvent = {
|
|
1094
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1095
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1096
|
+
if (message.threadId !== "") writer.uint32(18).string(message.threadId);
|
|
1097
|
+
if (message.runId !== "") writer.uint32(26).string(message.runId);
|
|
1098
|
+
return writer;
|
|
1099
|
+
},
|
|
1100
|
+
decode(input, length) {
|
|
1101
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1102
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1103
|
+
const message = createBaseRunStartedEvent();
|
|
1104
|
+
while (reader.pos < end) {
|
|
1105
|
+
const tag = reader.uint32();
|
|
1106
|
+
switch (tag >>> 3) {
|
|
1107
|
+
case 1:
|
|
1108
|
+
if (tag !== 10) break;
|
|
1109
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1110
|
+
continue;
|
|
1111
|
+
case 2:
|
|
1112
|
+
if (tag !== 18) break;
|
|
1113
|
+
message.threadId = reader.string();
|
|
1114
|
+
continue;
|
|
1115
|
+
case 3:
|
|
1116
|
+
if (tag !== 26) break;
|
|
1117
|
+
message.runId = reader.string();
|
|
1118
|
+
continue;
|
|
1119
|
+
}
|
|
1120
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1121
|
+
reader.skip(tag & 7);
|
|
1122
|
+
}
|
|
1123
|
+
return message;
|
|
1124
|
+
},
|
|
1125
|
+
create(base) {
|
|
1126
|
+
return RunStartedEvent.fromPartial(base ?? {});
|
|
1127
|
+
},
|
|
1128
|
+
fromPartial(object) {
|
|
1129
|
+
const message = createBaseRunStartedEvent();
|
|
1130
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1131
|
+
message.threadId = object.threadId ?? "";
|
|
1132
|
+
message.runId = object.runId ?? "";
|
|
1133
|
+
return message;
|
|
1134
|
+
}
|
|
1489
1135
|
};
|
|
1490
1136
|
function createBaseRunFinishedEvent() {
|
|
1491
|
-
|
|
1137
|
+
return {
|
|
1138
|
+
baseEvent: void 0,
|
|
1139
|
+
threadId: "",
|
|
1140
|
+
runId: "",
|
|
1141
|
+
result: void 0
|
|
1142
|
+
};
|
|
1492
1143
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
message.result = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
1542
|
-
continue;
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1546
|
-
break;
|
|
1547
|
-
}
|
|
1548
|
-
reader.skip(tag & 7);
|
|
1549
|
-
}
|
|
1550
|
-
return message;
|
|
1551
|
-
},
|
|
1552
|
-
create(base) {
|
|
1553
|
-
return RunFinishedEvent.fromPartial(base != null ? base : {});
|
|
1554
|
-
},
|
|
1555
|
-
fromPartial(object) {
|
|
1556
|
-
var _a, _b, _c;
|
|
1557
|
-
const message = createBaseRunFinishedEvent();
|
|
1558
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1559
|
-
message.threadId = (_a = object.threadId) != null ? _a : "";
|
|
1560
|
-
message.runId = (_b = object.runId) != null ? _b : "";
|
|
1561
|
-
message.result = (_c = object.result) != null ? _c : void 0;
|
|
1562
|
-
return message;
|
|
1563
|
-
}
|
|
1144
|
+
const RunFinishedEvent = {
|
|
1145
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1146
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1147
|
+
if (message.threadId !== "") writer.uint32(18).string(message.threadId);
|
|
1148
|
+
if (message.runId !== "") writer.uint32(26).string(message.runId);
|
|
1149
|
+
if (message.result !== void 0) Value.encode(Value.wrap(message.result), writer.uint32(34).fork()).join();
|
|
1150
|
+
return writer;
|
|
1151
|
+
},
|
|
1152
|
+
decode(input, length) {
|
|
1153
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1154
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1155
|
+
const message = createBaseRunFinishedEvent();
|
|
1156
|
+
while (reader.pos < end) {
|
|
1157
|
+
const tag = reader.uint32();
|
|
1158
|
+
switch (tag >>> 3) {
|
|
1159
|
+
case 1:
|
|
1160
|
+
if (tag !== 10) break;
|
|
1161
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1162
|
+
continue;
|
|
1163
|
+
case 2:
|
|
1164
|
+
if (tag !== 18) break;
|
|
1165
|
+
message.threadId = reader.string();
|
|
1166
|
+
continue;
|
|
1167
|
+
case 3:
|
|
1168
|
+
if (tag !== 26) break;
|
|
1169
|
+
message.runId = reader.string();
|
|
1170
|
+
continue;
|
|
1171
|
+
case 4:
|
|
1172
|
+
if (tag !== 34) break;
|
|
1173
|
+
message.result = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
1174
|
+
continue;
|
|
1175
|
+
}
|
|
1176
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1177
|
+
reader.skip(tag & 7);
|
|
1178
|
+
}
|
|
1179
|
+
return message;
|
|
1180
|
+
},
|
|
1181
|
+
create(base) {
|
|
1182
|
+
return RunFinishedEvent.fromPartial(base ?? {});
|
|
1183
|
+
},
|
|
1184
|
+
fromPartial(object) {
|
|
1185
|
+
const message = createBaseRunFinishedEvent();
|
|
1186
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1187
|
+
message.threadId = object.threadId ?? "";
|
|
1188
|
+
message.runId = object.runId ?? "";
|
|
1189
|
+
message.result = object.result ?? void 0;
|
|
1190
|
+
return message;
|
|
1191
|
+
}
|
|
1564
1192
|
};
|
|
1565
1193
|
function createBaseRunErrorEvent() {
|
|
1566
|
-
|
|
1194
|
+
return {
|
|
1195
|
+
baseEvent: void 0,
|
|
1196
|
+
code: void 0,
|
|
1197
|
+
message: ""
|
|
1198
|
+
};
|
|
1567
1199
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1611
|
-
break;
|
|
1612
|
-
}
|
|
1613
|
-
reader.skip(tag & 7);
|
|
1614
|
-
}
|
|
1615
|
-
return message;
|
|
1616
|
-
},
|
|
1617
|
-
create(base) {
|
|
1618
|
-
return RunErrorEvent.fromPartial(base != null ? base : {});
|
|
1619
|
-
},
|
|
1620
|
-
fromPartial(object) {
|
|
1621
|
-
var _a, _b;
|
|
1622
|
-
const message = createBaseRunErrorEvent();
|
|
1623
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1624
|
-
message.code = (_a = object.code) != null ? _a : void 0;
|
|
1625
|
-
message.message = (_b = object.message) != null ? _b : "";
|
|
1626
|
-
return message;
|
|
1627
|
-
}
|
|
1200
|
+
const RunErrorEvent = {
|
|
1201
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1202
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1203
|
+
if (message.code !== void 0) writer.uint32(18).string(message.code);
|
|
1204
|
+
if (message.message !== "") writer.uint32(26).string(message.message);
|
|
1205
|
+
return writer;
|
|
1206
|
+
},
|
|
1207
|
+
decode(input, length) {
|
|
1208
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1209
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1210
|
+
const message = createBaseRunErrorEvent();
|
|
1211
|
+
while (reader.pos < end) {
|
|
1212
|
+
const tag = reader.uint32();
|
|
1213
|
+
switch (tag >>> 3) {
|
|
1214
|
+
case 1:
|
|
1215
|
+
if (tag !== 10) break;
|
|
1216
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1217
|
+
continue;
|
|
1218
|
+
case 2:
|
|
1219
|
+
if (tag !== 18) break;
|
|
1220
|
+
message.code = reader.string();
|
|
1221
|
+
continue;
|
|
1222
|
+
case 3:
|
|
1223
|
+
if (tag !== 26) break;
|
|
1224
|
+
message.message = reader.string();
|
|
1225
|
+
continue;
|
|
1226
|
+
}
|
|
1227
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1228
|
+
reader.skip(tag & 7);
|
|
1229
|
+
}
|
|
1230
|
+
return message;
|
|
1231
|
+
},
|
|
1232
|
+
create(base) {
|
|
1233
|
+
return RunErrorEvent.fromPartial(base ?? {});
|
|
1234
|
+
},
|
|
1235
|
+
fromPartial(object) {
|
|
1236
|
+
const message = createBaseRunErrorEvent();
|
|
1237
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1238
|
+
message.code = object.code ?? void 0;
|
|
1239
|
+
message.message = object.message ?? "";
|
|
1240
|
+
return message;
|
|
1241
|
+
}
|
|
1628
1242
|
};
|
|
1629
1243
|
function createBaseStepStartedEvent() {
|
|
1630
|
-
|
|
1244
|
+
return {
|
|
1245
|
+
baseEvent: void 0,
|
|
1246
|
+
stepName: ""
|
|
1247
|
+
};
|
|
1631
1248
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
}
|
|
1669
|
-
return message;
|
|
1670
|
-
},
|
|
1671
|
-
create(base) {
|
|
1672
|
-
return StepStartedEvent.fromPartial(base != null ? base : {});
|
|
1673
|
-
},
|
|
1674
|
-
fromPartial(object) {
|
|
1675
|
-
var _a;
|
|
1676
|
-
const message = createBaseStepStartedEvent();
|
|
1677
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1678
|
-
message.stepName = (_a = object.stepName) != null ? _a : "";
|
|
1679
|
-
return message;
|
|
1680
|
-
}
|
|
1249
|
+
const StepStartedEvent = {
|
|
1250
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1251
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1252
|
+
if (message.stepName !== "") writer.uint32(18).string(message.stepName);
|
|
1253
|
+
return writer;
|
|
1254
|
+
},
|
|
1255
|
+
decode(input, length) {
|
|
1256
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1257
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1258
|
+
const message = createBaseStepStartedEvent();
|
|
1259
|
+
while (reader.pos < end) {
|
|
1260
|
+
const tag = reader.uint32();
|
|
1261
|
+
switch (tag >>> 3) {
|
|
1262
|
+
case 1:
|
|
1263
|
+
if (tag !== 10) break;
|
|
1264
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1265
|
+
continue;
|
|
1266
|
+
case 2:
|
|
1267
|
+
if (tag !== 18) break;
|
|
1268
|
+
message.stepName = reader.string();
|
|
1269
|
+
continue;
|
|
1270
|
+
}
|
|
1271
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1272
|
+
reader.skip(tag & 7);
|
|
1273
|
+
}
|
|
1274
|
+
return message;
|
|
1275
|
+
},
|
|
1276
|
+
create(base) {
|
|
1277
|
+
return StepStartedEvent.fromPartial(base ?? {});
|
|
1278
|
+
},
|
|
1279
|
+
fromPartial(object) {
|
|
1280
|
+
const message = createBaseStepStartedEvent();
|
|
1281
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1282
|
+
message.stepName = object.stepName ?? "";
|
|
1283
|
+
return message;
|
|
1284
|
+
}
|
|
1681
1285
|
};
|
|
1682
1286
|
function createBaseStepFinishedEvent() {
|
|
1683
|
-
|
|
1287
|
+
return {
|
|
1288
|
+
baseEvent: void 0,
|
|
1289
|
+
stepName: ""
|
|
1290
|
+
};
|
|
1684
1291
|
}
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
}
|
|
1722
|
-
return message;
|
|
1723
|
-
},
|
|
1724
|
-
create(base) {
|
|
1725
|
-
return StepFinishedEvent.fromPartial(base != null ? base : {});
|
|
1726
|
-
},
|
|
1727
|
-
fromPartial(object) {
|
|
1728
|
-
var _a;
|
|
1729
|
-
const message = createBaseStepFinishedEvent();
|
|
1730
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1731
|
-
message.stepName = (_a = object.stepName) != null ? _a : "";
|
|
1732
|
-
return message;
|
|
1733
|
-
}
|
|
1292
|
+
const StepFinishedEvent = {
|
|
1293
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1294
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1295
|
+
if (message.stepName !== "") writer.uint32(18).string(message.stepName);
|
|
1296
|
+
return writer;
|
|
1297
|
+
},
|
|
1298
|
+
decode(input, length) {
|
|
1299
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1300
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1301
|
+
const message = createBaseStepFinishedEvent();
|
|
1302
|
+
while (reader.pos < end) {
|
|
1303
|
+
const tag = reader.uint32();
|
|
1304
|
+
switch (tag >>> 3) {
|
|
1305
|
+
case 1:
|
|
1306
|
+
if (tag !== 10) break;
|
|
1307
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1308
|
+
continue;
|
|
1309
|
+
case 2:
|
|
1310
|
+
if (tag !== 18) break;
|
|
1311
|
+
message.stepName = reader.string();
|
|
1312
|
+
continue;
|
|
1313
|
+
}
|
|
1314
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1315
|
+
reader.skip(tag & 7);
|
|
1316
|
+
}
|
|
1317
|
+
return message;
|
|
1318
|
+
},
|
|
1319
|
+
create(base) {
|
|
1320
|
+
return StepFinishedEvent.fromPartial(base ?? {});
|
|
1321
|
+
},
|
|
1322
|
+
fromPartial(object) {
|
|
1323
|
+
const message = createBaseStepFinishedEvent();
|
|
1324
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1325
|
+
message.stepName = object.stepName ?? "";
|
|
1326
|
+
return message;
|
|
1327
|
+
}
|
|
1734
1328
|
};
|
|
1735
1329
|
function createBaseTextMessageChunkEvent() {
|
|
1736
|
-
|
|
1330
|
+
return {
|
|
1331
|
+
baseEvent: void 0,
|
|
1332
|
+
messageId: void 0,
|
|
1333
|
+
role: void 0,
|
|
1334
|
+
delta: void 0
|
|
1335
|
+
};
|
|
1737
1336
|
}
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
message.delta = reader.string();
|
|
1787
|
-
continue;
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1791
|
-
break;
|
|
1792
|
-
}
|
|
1793
|
-
reader.skip(tag & 7);
|
|
1794
|
-
}
|
|
1795
|
-
return message;
|
|
1796
|
-
},
|
|
1797
|
-
create(base) {
|
|
1798
|
-
return TextMessageChunkEvent.fromPartial(base != null ? base : {});
|
|
1799
|
-
},
|
|
1800
|
-
fromPartial(object) {
|
|
1801
|
-
var _a, _b, _c;
|
|
1802
|
-
const message = createBaseTextMessageChunkEvent();
|
|
1803
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1804
|
-
message.messageId = (_a = object.messageId) != null ? _a : void 0;
|
|
1805
|
-
message.role = (_b = object.role) != null ? _b : void 0;
|
|
1806
|
-
message.delta = (_c = object.delta) != null ? _c : void 0;
|
|
1807
|
-
return message;
|
|
1808
|
-
}
|
|
1337
|
+
const TextMessageChunkEvent = {
|
|
1338
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1339
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1340
|
+
if (message.messageId !== void 0) writer.uint32(18).string(message.messageId);
|
|
1341
|
+
if (message.role !== void 0) writer.uint32(26).string(message.role);
|
|
1342
|
+
if (message.delta !== void 0) writer.uint32(34).string(message.delta);
|
|
1343
|
+
return writer;
|
|
1344
|
+
},
|
|
1345
|
+
decode(input, length) {
|
|
1346
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1347
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1348
|
+
const message = createBaseTextMessageChunkEvent();
|
|
1349
|
+
while (reader.pos < end) {
|
|
1350
|
+
const tag = reader.uint32();
|
|
1351
|
+
switch (tag >>> 3) {
|
|
1352
|
+
case 1:
|
|
1353
|
+
if (tag !== 10) break;
|
|
1354
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1355
|
+
continue;
|
|
1356
|
+
case 2:
|
|
1357
|
+
if (tag !== 18) break;
|
|
1358
|
+
message.messageId = reader.string();
|
|
1359
|
+
continue;
|
|
1360
|
+
case 3:
|
|
1361
|
+
if (tag !== 26) break;
|
|
1362
|
+
message.role = reader.string();
|
|
1363
|
+
continue;
|
|
1364
|
+
case 4:
|
|
1365
|
+
if (tag !== 34) break;
|
|
1366
|
+
message.delta = reader.string();
|
|
1367
|
+
continue;
|
|
1368
|
+
}
|
|
1369
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1370
|
+
reader.skip(tag & 7);
|
|
1371
|
+
}
|
|
1372
|
+
return message;
|
|
1373
|
+
},
|
|
1374
|
+
create(base) {
|
|
1375
|
+
return TextMessageChunkEvent.fromPartial(base ?? {});
|
|
1376
|
+
},
|
|
1377
|
+
fromPartial(object) {
|
|
1378
|
+
const message = createBaseTextMessageChunkEvent();
|
|
1379
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1380
|
+
message.messageId = object.messageId ?? void 0;
|
|
1381
|
+
message.role = object.role ?? void 0;
|
|
1382
|
+
message.delta = object.delta ?? void 0;
|
|
1383
|
+
return message;
|
|
1384
|
+
}
|
|
1809
1385
|
};
|
|
1810
1386
|
function createBaseToolCallChunkEvent() {
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1387
|
+
return {
|
|
1388
|
+
baseEvent: void 0,
|
|
1389
|
+
toolCallId: void 0,
|
|
1390
|
+
toolCallName: void 0,
|
|
1391
|
+
parentMessageId: void 0,
|
|
1392
|
+
delta: void 0
|
|
1393
|
+
};
|
|
1818
1394
|
}
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
case 5: {
|
|
1874
|
-
if (tag !== 42) {
|
|
1875
|
-
break;
|
|
1876
|
-
}
|
|
1877
|
-
message.delta = reader.string();
|
|
1878
|
-
continue;
|
|
1879
|
-
}
|
|
1880
|
-
}
|
|
1881
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
1882
|
-
break;
|
|
1883
|
-
}
|
|
1884
|
-
reader.skip(tag & 7);
|
|
1885
|
-
}
|
|
1886
|
-
return message;
|
|
1887
|
-
},
|
|
1888
|
-
create(base) {
|
|
1889
|
-
return ToolCallChunkEvent.fromPartial(base != null ? base : {});
|
|
1890
|
-
},
|
|
1891
|
-
fromPartial(object) {
|
|
1892
|
-
var _a, _b, _c, _d;
|
|
1893
|
-
const message = createBaseToolCallChunkEvent();
|
|
1894
|
-
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1895
|
-
message.toolCallId = (_a = object.toolCallId) != null ? _a : void 0;
|
|
1896
|
-
message.toolCallName = (_b = object.toolCallName) != null ? _b : void 0;
|
|
1897
|
-
message.parentMessageId = (_c = object.parentMessageId) != null ? _c : void 0;
|
|
1898
|
-
message.delta = (_d = object.delta) != null ? _d : void 0;
|
|
1899
|
-
return message;
|
|
1900
|
-
}
|
|
1395
|
+
const ToolCallChunkEvent = {
|
|
1396
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1397
|
+
if (message.baseEvent !== void 0) BaseEvent.encode(message.baseEvent, writer.uint32(10).fork()).join();
|
|
1398
|
+
if (message.toolCallId !== void 0) writer.uint32(18).string(message.toolCallId);
|
|
1399
|
+
if (message.toolCallName !== void 0) writer.uint32(26).string(message.toolCallName);
|
|
1400
|
+
if (message.parentMessageId !== void 0) writer.uint32(34).string(message.parentMessageId);
|
|
1401
|
+
if (message.delta !== void 0) writer.uint32(42).string(message.delta);
|
|
1402
|
+
return writer;
|
|
1403
|
+
},
|
|
1404
|
+
decode(input, length) {
|
|
1405
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1406
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1407
|
+
const message = createBaseToolCallChunkEvent();
|
|
1408
|
+
while (reader.pos < end) {
|
|
1409
|
+
const tag = reader.uint32();
|
|
1410
|
+
switch (tag >>> 3) {
|
|
1411
|
+
case 1:
|
|
1412
|
+
if (tag !== 10) break;
|
|
1413
|
+
message.baseEvent = BaseEvent.decode(reader, reader.uint32());
|
|
1414
|
+
continue;
|
|
1415
|
+
case 2:
|
|
1416
|
+
if (tag !== 18) break;
|
|
1417
|
+
message.toolCallId = reader.string();
|
|
1418
|
+
continue;
|
|
1419
|
+
case 3:
|
|
1420
|
+
if (tag !== 26) break;
|
|
1421
|
+
message.toolCallName = reader.string();
|
|
1422
|
+
continue;
|
|
1423
|
+
case 4:
|
|
1424
|
+
if (tag !== 34) break;
|
|
1425
|
+
message.parentMessageId = reader.string();
|
|
1426
|
+
continue;
|
|
1427
|
+
case 5:
|
|
1428
|
+
if (tag !== 42) break;
|
|
1429
|
+
message.delta = reader.string();
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1432
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1433
|
+
reader.skip(tag & 7);
|
|
1434
|
+
}
|
|
1435
|
+
return message;
|
|
1436
|
+
},
|
|
1437
|
+
create(base) {
|
|
1438
|
+
return ToolCallChunkEvent.fromPartial(base ?? {});
|
|
1439
|
+
},
|
|
1440
|
+
fromPartial(object) {
|
|
1441
|
+
const message = createBaseToolCallChunkEvent();
|
|
1442
|
+
message.baseEvent = object.baseEvent !== void 0 && object.baseEvent !== null ? BaseEvent.fromPartial(object.baseEvent) : void 0;
|
|
1443
|
+
message.toolCallId = object.toolCallId ?? void 0;
|
|
1444
|
+
message.toolCallName = object.toolCallName ?? void 0;
|
|
1445
|
+
message.parentMessageId = object.parentMessageId ?? void 0;
|
|
1446
|
+
message.delta = object.delta ?? void 0;
|
|
1447
|
+
return message;
|
|
1448
|
+
}
|
|
1901
1449
|
};
|
|
1902
1450
|
function createBaseEvent() {
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1451
|
+
return {
|
|
1452
|
+
textMessageStart: void 0,
|
|
1453
|
+
textMessageContent: void 0,
|
|
1454
|
+
textMessageEnd: void 0,
|
|
1455
|
+
toolCallStart: void 0,
|
|
1456
|
+
toolCallArgs: void 0,
|
|
1457
|
+
toolCallEnd: void 0,
|
|
1458
|
+
stateSnapshot: void 0,
|
|
1459
|
+
stateDelta: void 0,
|
|
1460
|
+
messagesSnapshot: void 0,
|
|
1461
|
+
raw: void 0,
|
|
1462
|
+
custom: void 0,
|
|
1463
|
+
runStarted: void 0,
|
|
1464
|
+
runFinished: void 0,
|
|
1465
|
+
runError: void 0,
|
|
1466
|
+
stepStarted: void 0,
|
|
1467
|
+
stepFinished: void 0,
|
|
1468
|
+
textMessageChunk: void 0,
|
|
1469
|
+
toolCallChunk: void 0
|
|
1470
|
+
};
|
|
1923
1471
|
}
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
message.raw = RawEvent.decode(reader, reader.uint32());
|
|
2057
|
-
continue;
|
|
2058
|
-
}
|
|
2059
|
-
case 11: {
|
|
2060
|
-
if (tag !== 90) {
|
|
2061
|
-
break;
|
|
2062
|
-
}
|
|
2063
|
-
message.custom = CustomEvent.decode(reader, reader.uint32());
|
|
2064
|
-
continue;
|
|
2065
|
-
}
|
|
2066
|
-
case 12: {
|
|
2067
|
-
if (tag !== 98) {
|
|
2068
|
-
break;
|
|
2069
|
-
}
|
|
2070
|
-
message.runStarted = RunStartedEvent.decode(reader, reader.uint32());
|
|
2071
|
-
continue;
|
|
2072
|
-
}
|
|
2073
|
-
case 13: {
|
|
2074
|
-
if (tag !== 106) {
|
|
2075
|
-
break;
|
|
2076
|
-
}
|
|
2077
|
-
message.runFinished = RunFinishedEvent.decode(reader, reader.uint32());
|
|
2078
|
-
continue;
|
|
2079
|
-
}
|
|
2080
|
-
case 14: {
|
|
2081
|
-
if (tag !== 114) {
|
|
2082
|
-
break;
|
|
2083
|
-
}
|
|
2084
|
-
message.runError = RunErrorEvent.decode(reader, reader.uint32());
|
|
2085
|
-
continue;
|
|
2086
|
-
}
|
|
2087
|
-
case 15: {
|
|
2088
|
-
if (tag !== 122) {
|
|
2089
|
-
break;
|
|
2090
|
-
}
|
|
2091
|
-
message.stepStarted = StepStartedEvent.decode(reader, reader.uint32());
|
|
2092
|
-
continue;
|
|
2093
|
-
}
|
|
2094
|
-
case 16: {
|
|
2095
|
-
if (tag !== 130) {
|
|
2096
|
-
break;
|
|
2097
|
-
}
|
|
2098
|
-
message.stepFinished = StepFinishedEvent.decode(reader, reader.uint32());
|
|
2099
|
-
continue;
|
|
2100
|
-
}
|
|
2101
|
-
case 17: {
|
|
2102
|
-
if (tag !== 138) {
|
|
2103
|
-
break;
|
|
2104
|
-
}
|
|
2105
|
-
message.textMessageChunk = TextMessageChunkEvent.decode(reader, reader.uint32());
|
|
2106
|
-
continue;
|
|
2107
|
-
}
|
|
2108
|
-
case 18: {
|
|
2109
|
-
if (tag !== 146) {
|
|
2110
|
-
break;
|
|
2111
|
-
}
|
|
2112
|
-
message.toolCallChunk = ToolCallChunkEvent.decode(reader, reader.uint32());
|
|
2113
|
-
continue;
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
2117
|
-
break;
|
|
2118
|
-
}
|
|
2119
|
-
reader.skip(tag & 7);
|
|
2120
|
-
}
|
|
2121
|
-
return message;
|
|
2122
|
-
},
|
|
2123
|
-
create(base) {
|
|
2124
|
-
return Event.fromPartial(base != null ? base : {});
|
|
2125
|
-
},
|
|
2126
|
-
fromPartial(object) {
|
|
2127
|
-
const message = createBaseEvent();
|
|
2128
|
-
message.textMessageStart = object.textMessageStart !== void 0 && object.textMessageStart !== null ? TextMessageStartEvent.fromPartial(object.textMessageStart) : void 0;
|
|
2129
|
-
message.textMessageContent = object.textMessageContent !== void 0 && object.textMessageContent !== null ? TextMessageContentEvent.fromPartial(object.textMessageContent) : void 0;
|
|
2130
|
-
message.textMessageEnd = object.textMessageEnd !== void 0 && object.textMessageEnd !== null ? TextMessageEndEvent.fromPartial(object.textMessageEnd) : void 0;
|
|
2131
|
-
message.toolCallStart = object.toolCallStart !== void 0 && object.toolCallStart !== null ? ToolCallStartEvent.fromPartial(object.toolCallStart) : void 0;
|
|
2132
|
-
message.toolCallArgs = object.toolCallArgs !== void 0 && object.toolCallArgs !== null ? ToolCallArgsEvent.fromPartial(object.toolCallArgs) : void 0;
|
|
2133
|
-
message.toolCallEnd = object.toolCallEnd !== void 0 && object.toolCallEnd !== null ? ToolCallEndEvent.fromPartial(object.toolCallEnd) : void 0;
|
|
2134
|
-
message.stateSnapshot = object.stateSnapshot !== void 0 && object.stateSnapshot !== null ? StateSnapshotEvent.fromPartial(object.stateSnapshot) : void 0;
|
|
2135
|
-
message.stateDelta = object.stateDelta !== void 0 && object.stateDelta !== null ? StateDeltaEvent.fromPartial(object.stateDelta) : void 0;
|
|
2136
|
-
message.messagesSnapshot = object.messagesSnapshot !== void 0 && object.messagesSnapshot !== null ? MessagesSnapshotEvent.fromPartial(object.messagesSnapshot) : void 0;
|
|
2137
|
-
message.raw = object.raw !== void 0 && object.raw !== null ? RawEvent.fromPartial(object.raw) : void 0;
|
|
2138
|
-
message.custom = object.custom !== void 0 && object.custom !== null ? CustomEvent.fromPartial(object.custom) : void 0;
|
|
2139
|
-
message.runStarted = object.runStarted !== void 0 && object.runStarted !== null ? RunStartedEvent.fromPartial(object.runStarted) : void 0;
|
|
2140
|
-
message.runFinished = object.runFinished !== void 0 && object.runFinished !== null ? RunFinishedEvent.fromPartial(object.runFinished) : void 0;
|
|
2141
|
-
message.runError = object.runError !== void 0 && object.runError !== null ? RunErrorEvent.fromPartial(object.runError) : void 0;
|
|
2142
|
-
message.stepStarted = object.stepStarted !== void 0 && object.stepStarted !== null ? StepStartedEvent.fromPartial(object.stepStarted) : void 0;
|
|
2143
|
-
message.stepFinished = object.stepFinished !== void 0 && object.stepFinished !== null ? StepFinishedEvent.fromPartial(object.stepFinished) : void 0;
|
|
2144
|
-
message.textMessageChunk = object.textMessageChunk !== void 0 && object.textMessageChunk !== null ? TextMessageChunkEvent.fromPartial(object.textMessageChunk) : void 0;
|
|
2145
|
-
message.toolCallChunk = object.toolCallChunk !== void 0 && object.toolCallChunk !== null ? ToolCallChunkEvent.fromPartial(object.toolCallChunk) : void 0;
|
|
2146
|
-
return message;
|
|
2147
|
-
}
|
|
1472
|
+
const Event = {
|
|
1473
|
+
encode(message, writer = new _bufbuild_protobuf_wire.BinaryWriter()) {
|
|
1474
|
+
if (message.textMessageStart !== void 0) TextMessageStartEvent.encode(message.textMessageStart, writer.uint32(10).fork()).join();
|
|
1475
|
+
if (message.textMessageContent !== void 0) TextMessageContentEvent.encode(message.textMessageContent, writer.uint32(18).fork()).join();
|
|
1476
|
+
if (message.textMessageEnd !== void 0) TextMessageEndEvent.encode(message.textMessageEnd, writer.uint32(26).fork()).join();
|
|
1477
|
+
if (message.toolCallStart !== void 0) ToolCallStartEvent.encode(message.toolCallStart, writer.uint32(34).fork()).join();
|
|
1478
|
+
if (message.toolCallArgs !== void 0) ToolCallArgsEvent.encode(message.toolCallArgs, writer.uint32(42).fork()).join();
|
|
1479
|
+
if (message.toolCallEnd !== void 0) ToolCallEndEvent.encode(message.toolCallEnd, writer.uint32(50).fork()).join();
|
|
1480
|
+
if (message.stateSnapshot !== void 0) StateSnapshotEvent.encode(message.stateSnapshot, writer.uint32(58).fork()).join();
|
|
1481
|
+
if (message.stateDelta !== void 0) StateDeltaEvent.encode(message.stateDelta, writer.uint32(66).fork()).join();
|
|
1482
|
+
if (message.messagesSnapshot !== void 0) MessagesSnapshotEvent.encode(message.messagesSnapshot, writer.uint32(74).fork()).join();
|
|
1483
|
+
if (message.raw !== void 0) RawEvent.encode(message.raw, writer.uint32(82).fork()).join();
|
|
1484
|
+
if (message.custom !== void 0) CustomEvent.encode(message.custom, writer.uint32(90).fork()).join();
|
|
1485
|
+
if (message.runStarted !== void 0) RunStartedEvent.encode(message.runStarted, writer.uint32(98).fork()).join();
|
|
1486
|
+
if (message.runFinished !== void 0) RunFinishedEvent.encode(message.runFinished, writer.uint32(106).fork()).join();
|
|
1487
|
+
if (message.runError !== void 0) RunErrorEvent.encode(message.runError, writer.uint32(114).fork()).join();
|
|
1488
|
+
if (message.stepStarted !== void 0) StepStartedEvent.encode(message.stepStarted, writer.uint32(122).fork()).join();
|
|
1489
|
+
if (message.stepFinished !== void 0) StepFinishedEvent.encode(message.stepFinished, writer.uint32(130).fork()).join();
|
|
1490
|
+
if (message.textMessageChunk !== void 0) TextMessageChunkEvent.encode(message.textMessageChunk, writer.uint32(138).fork()).join();
|
|
1491
|
+
if (message.toolCallChunk !== void 0) ToolCallChunkEvent.encode(message.toolCallChunk, writer.uint32(146).fork()).join();
|
|
1492
|
+
return writer;
|
|
1493
|
+
},
|
|
1494
|
+
decode(input, length) {
|
|
1495
|
+
const reader = input instanceof _bufbuild_protobuf_wire.BinaryReader ? input : new _bufbuild_protobuf_wire.BinaryReader(input);
|
|
1496
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
1497
|
+
const message = createBaseEvent();
|
|
1498
|
+
while (reader.pos < end) {
|
|
1499
|
+
const tag = reader.uint32();
|
|
1500
|
+
switch (tag >>> 3) {
|
|
1501
|
+
case 1:
|
|
1502
|
+
if (tag !== 10) break;
|
|
1503
|
+
message.textMessageStart = TextMessageStartEvent.decode(reader, reader.uint32());
|
|
1504
|
+
continue;
|
|
1505
|
+
case 2:
|
|
1506
|
+
if (tag !== 18) break;
|
|
1507
|
+
message.textMessageContent = TextMessageContentEvent.decode(reader, reader.uint32());
|
|
1508
|
+
continue;
|
|
1509
|
+
case 3:
|
|
1510
|
+
if (tag !== 26) break;
|
|
1511
|
+
message.textMessageEnd = TextMessageEndEvent.decode(reader, reader.uint32());
|
|
1512
|
+
continue;
|
|
1513
|
+
case 4:
|
|
1514
|
+
if (tag !== 34) break;
|
|
1515
|
+
message.toolCallStart = ToolCallStartEvent.decode(reader, reader.uint32());
|
|
1516
|
+
continue;
|
|
1517
|
+
case 5:
|
|
1518
|
+
if (tag !== 42) break;
|
|
1519
|
+
message.toolCallArgs = ToolCallArgsEvent.decode(reader, reader.uint32());
|
|
1520
|
+
continue;
|
|
1521
|
+
case 6:
|
|
1522
|
+
if (tag !== 50) break;
|
|
1523
|
+
message.toolCallEnd = ToolCallEndEvent.decode(reader, reader.uint32());
|
|
1524
|
+
continue;
|
|
1525
|
+
case 7:
|
|
1526
|
+
if (tag !== 58) break;
|
|
1527
|
+
message.stateSnapshot = StateSnapshotEvent.decode(reader, reader.uint32());
|
|
1528
|
+
continue;
|
|
1529
|
+
case 8:
|
|
1530
|
+
if (tag !== 66) break;
|
|
1531
|
+
message.stateDelta = StateDeltaEvent.decode(reader, reader.uint32());
|
|
1532
|
+
continue;
|
|
1533
|
+
case 9:
|
|
1534
|
+
if (tag !== 74) break;
|
|
1535
|
+
message.messagesSnapshot = MessagesSnapshotEvent.decode(reader, reader.uint32());
|
|
1536
|
+
continue;
|
|
1537
|
+
case 10:
|
|
1538
|
+
if (tag !== 82) break;
|
|
1539
|
+
message.raw = RawEvent.decode(reader, reader.uint32());
|
|
1540
|
+
continue;
|
|
1541
|
+
case 11:
|
|
1542
|
+
if (tag !== 90) break;
|
|
1543
|
+
message.custom = CustomEvent.decode(reader, reader.uint32());
|
|
1544
|
+
continue;
|
|
1545
|
+
case 12:
|
|
1546
|
+
if (tag !== 98) break;
|
|
1547
|
+
message.runStarted = RunStartedEvent.decode(reader, reader.uint32());
|
|
1548
|
+
continue;
|
|
1549
|
+
case 13:
|
|
1550
|
+
if (tag !== 106) break;
|
|
1551
|
+
message.runFinished = RunFinishedEvent.decode(reader, reader.uint32());
|
|
1552
|
+
continue;
|
|
1553
|
+
case 14:
|
|
1554
|
+
if (tag !== 114) break;
|
|
1555
|
+
message.runError = RunErrorEvent.decode(reader, reader.uint32());
|
|
1556
|
+
continue;
|
|
1557
|
+
case 15:
|
|
1558
|
+
if (tag !== 122) break;
|
|
1559
|
+
message.stepStarted = StepStartedEvent.decode(reader, reader.uint32());
|
|
1560
|
+
continue;
|
|
1561
|
+
case 16:
|
|
1562
|
+
if (tag !== 130) break;
|
|
1563
|
+
message.stepFinished = StepFinishedEvent.decode(reader, reader.uint32());
|
|
1564
|
+
continue;
|
|
1565
|
+
case 17:
|
|
1566
|
+
if (tag !== 138) break;
|
|
1567
|
+
message.textMessageChunk = TextMessageChunkEvent.decode(reader, reader.uint32());
|
|
1568
|
+
continue;
|
|
1569
|
+
case 18:
|
|
1570
|
+
if (tag !== 146) break;
|
|
1571
|
+
message.toolCallChunk = ToolCallChunkEvent.decode(reader, reader.uint32());
|
|
1572
|
+
continue;
|
|
1573
|
+
}
|
|
1574
|
+
if ((tag & 7) === 4 || tag === 0) break;
|
|
1575
|
+
reader.skip(tag & 7);
|
|
1576
|
+
}
|
|
1577
|
+
return message;
|
|
1578
|
+
},
|
|
1579
|
+
create(base) {
|
|
1580
|
+
return Event.fromPartial(base ?? {});
|
|
1581
|
+
},
|
|
1582
|
+
fromPartial(object) {
|
|
1583
|
+
const message = createBaseEvent();
|
|
1584
|
+
message.textMessageStart = object.textMessageStart !== void 0 && object.textMessageStart !== null ? TextMessageStartEvent.fromPartial(object.textMessageStart) : void 0;
|
|
1585
|
+
message.textMessageContent = object.textMessageContent !== void 0 && object.textMessageContent !== null ? TextMessageContentEvent.fromPartial(object.textMessageContent) : void 0;
|
|
1586
|
+
message.textMessageEnd = object.textMessageEnd !== void 0 && object.textMessageEnd !== null ? TextMessageEndEvent.fromPartial(object.textMessageEnd) : void 0;
|
|
1587
|
+
message.toolCallStart = object.toolCallStart !== void 0 && object.toolCallStart !== null ? ToolCallStartEvent.fromPartial(object.toolCallStart) : void 0;
|
|
1588
|
+
message.toolCallArgs = object.toolCallArgs !== void 0 && object.toolCallArgs !== null ? ToolCallArgsEvent.fromPartial(object.toolCallArgs) : void 0;
|
|
1589
|
+
message.toolCallEnd = object.toolCallEnd !== void 0 && object.toolCallEnd !== null ? ToolCallEndEvent.fromPartial(object.toolCallEnd) : void 0;
|
|
1590
|
+
message.stateSnapshot = object.stateSnapshot !== void 0 && object.stateSnapshot !== null ? StateSnapshotEvent.fromPartial(object.stateSnapshot) : void 0;
|
|
1591
|
+
message.stateDelta = object.stateDelta !== void 0 && object.stateDelta !== null ? StateDeltaEvent.fromPartial(object.stateDelta) : void 0;
|
|
1592
|
+
message.messagesSnapshot = object.messagesSnapshot !== void 0 && object.messagesSnapshot !== null ? MessagesSnapshotEvent.fromPartial(object.messagesSnapshot) : void 0;
|
|
1593
|
+
message.raw = object.raw !== void 0 && object.raw !== null ? RawEvent.fromPartial(object.raw) : void 0;
|
|
1594
|
+
message.custom = object.custom !== void 0 && object.custom !== null ? CustomEvent.fromPartial(object.custom) : void 0;
|
|
1595
|
+
message.runStarted = object.runStarted !== void 0 && object.runStarted !== null ? RunStartedEvent.fromPartial(object.runStarted) : void 0;
|
|
1596
|
+
message.runFinished = object.runFinished !== void 0 && object.runFinished !== null ? RunFinishedEvent.fromPartial(object.runFinished) : void 0;
|
|
1597
|
+
message.runError = object.runError !== void 0 && object.runError !== null ? RunErrorEvent.fromPartial(object.runError) : void 0;
|
|
1598
|
+
message.stepStarted = object.stepStarted !== void 0 && object.stepStarted !== null ? StepStartedEvent.fromPartial(object.stepStarted) : void 0;
|
|
1599
|
+
message.stepFinished = object.stepFinished !== void 0 && object.stepFinished !== null ? StepFinishedEvent.fromPartial(object.stepFinished) : void 0;
|
|
1600
|
+
message.textMessageChunk = object.textMessageChunk !== void 0 && object.textMessageChunk !== null ? TextMessageChunkEvent.fromPartial(object.textMessageChunk) : void 0;
|
|
1601
|
+
message.toolCallChunk = object.toolCallChunk !== void 0 && object.toolCallChunk !== null ? ToolCallChunkEvent.fromPartial(object.toolCallChunk) : void 0;
|
|
1602
|
+
return message;
|
|
1603
|
+
}
|
|
2148
1604
|
};
|
|
2149
1605
|
function longToNumber(int64) {
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
2155
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
2156
|
-
}
|
|
2157
|
-
return num;
|
|
1606
|
+
const num = globalThis.Number(int64.toString());
|
|
1607
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1608
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
1609
|
+
return num;
|
|
2158
1610
|
}
|
|
2159
1611
|
|
|
2160
|
-
|
|
1612
|
+
//#endregion
|
|
1613
|
+
//#region src/proto.ts
|
|
2161
1614
|
function toCamelCase(str) {
|
|
2162
|
-
|
|
1615
|
+
return str.toLowerCase().replace(/_([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2163
1616
|
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Encodes an event message to a protocol buffer binary format.
|
|
1619
|
+
*/
|
|
2164
1620
|
function encode(event) {
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
1621
|
+
/**
|
|
1622
|
+
* In previous versions of AG-UI, we didn't really validate the events
|
|
1623
|
+
* against a schema. With stronger types for events and Zod schemas, we
|
|
1624
|
+
* can now validate.
|
|
1625
|
+
*
|
|
1626
|
+
* However, I don't want to break compatibility with existing clients
|
|
1627
|
+
* even if they are encoding invalid events. This surfaces a warning
|
|
1628
|
+
* to them in those situations.
|
|
1629
|
+
*
|
|
1630
|
+
* @author mikeryandev
|
|
1631
|
+
*/
|
|
1632
|
+
let validatedEvent;
|
|
1633
|
+
try {
|
|
1634
|
+
validatedEvent = _ag_ui_core.EventSchemas.parse(event);
|
|
1635
|
+
} catch (err) {
|
|
1636
|
+
console.warn("[ag-ui][proto.encode] Malformed devent detected, falling back to unvalidated event", err, event);
|
|
1637
|
+
validatedEvent = event;
|
|
1638
|
+
}
|
|
1639
|
+
const oneofField = toCamelCase(validatedEvent.type);
|
|
1640
|
+
const { type, timestamp, rawEvent, ...rest } = validatedEvent;
|
|
1641
|
+
if (type === _ag_ui_core.EventType.MESSAGES_SNAPSHOT && Array.isArray(rest.messages)) rest.messages = rest.messages.map((message) => {
|
|
1642
|
+
if (message.toolCalls === void 0) return {
|
|
1643
|
+
...message,
|
|
1644
|
+
toolCalls: []
|
|
1645
|
+
};
|
|
1646
|
+
return message;
|
|
1647
|
+
});
|
|
1648
|
+
if (type === _ag_ui_core.EventType.STATE_DELTA && Array.isArray(rest.delta)) rest.delta = rest.delta.map((operation) => ({
|
|
1649
|
+
...operation,
|
|
1650
|
+
op: JsonPatchOperationType[operation.op.toUpperCase()]
|
|
1651
|
+
}));
|
|
1652
|
+
const eventMessage = { [oneofField]: {
|
|
1653
|
+
baseEvent: {
|
|
1654
|
+
type: EventType$1[event.type],
|
|
1655
|
+
timestamp,
|
|
1656
|
+
rawEvent
|
|
1657
|
+
},
|
|
1658
|
+
...rest
|
|
1659
|
+
} };
|
|
1660
|
+
return Event.encode(eventMessage).finish();
|
|
2204
1661
|
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Decodes a protocol buffer binary format to an event message.
|
|
1664
|
+
* The format includes a 4-byte length prefix followed by the message.
|
|
1665
|
+
*/
|
|
2205
1666
|
function decode(data) {
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
Object.keys(operation).forEach((key) => {
|
|
2227
|
-
if (operation[key] === void 0) {
|
|
2228
|
-
delete operation[key];
|
|
2229
|
-
}
|
|
2230
|
-
});
|
|
2231
|
-
}
|
|
2232
|
-
}
|
|
2233
|
-
Object.keys(decoded).forEach((key) => {
|
|
2234
|
-
if (decoded[key] === void 0) {
|
|
2235
|
-
delete decoded[key];
|
|
2236
|
-
}
|
|
2237
|
-
});
|
|
2238
|
-
return import_core.EventSchemas.parse(decoded);
|
|
1667
|
+
const event = Event.decode(data);
|
|
1668
|
+
const decoded = Object.values(event).find((value) => value !== void 0);
|
|
1669
|
+
if (!decoded) throw new Error("Invalid event");
|
|
1670
|
+
decoded.type = EventType$1[decoded.baseEvent.type];
|
|
1671
|
+
decoded.timestamp = decoded.baseEvent.timestamp;
|
|
1672
|
+
decoded.rawEvent = decoded.baseEvent.rawEvent;
|
|
1673
|
+
if (decoded.type === _ag_ui_core.EventType.MESSAGES_SNAPSHOT) for (const message of decoded.messages) {
|
|
1674
|
+
const untypedMessage = message;
|
|
1675
|
+
if (untypedMessage.toolCalls?.length === 0) untypedMessage.toolCalls = void 0;
|
|
1676
|
+
}
|
|
1677
|
+
if (decoded.type === _ag_ui_core.EventType.STATE_DELTA) for (const operation of decoded.delta) {
|
|
1678
|
+
operation.op = JsonPatchOperationType[operation.op].toLowerCase();
|
|
1679
|
+
Object.keys(operation).forEach((key) => {
|
|
1680
|
+
if (operation[key] === void 0) delete operation[key];
|
|
1681
|
+
});
|
|
1682
|
+
}
|
|
1683
|
+
Object.keys(decoded).forEach((key) => {
|
|
1684
|
+
if (decoded[key] === void 0) delete decoded[key];
|
|
1685
|
+
});
|
|
1686
|
+
return _ag_ui_core.EventSchemas.parse(decoded);
|
|
2239
1687
|
}
|
|
2240
1688
|
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
1689
|
+
//#endregion
|
|
1690
|
+
//#region src/index.ts
|
|
1691
|
+
const AGUI_MEDIA_TYPE = "application/vnd.ag-ui.event+proto";
|
|
1692
|
+
|
|
1693
|
+
//#endregion
|
|
1694
|
+
exports.AGUI_MEDIA_TYPE = AGUI_MEDIA_TYPE;
|
|
1695
|
+
exports.decode = decode;
|
|
1696
|
+
exports.encode = encode;
|
|
2249
1697
|
//# sourceMappingURL=index.js.map
|