@a2a-js/sdk 0.3.7 → 0.3.9
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/README.md +70 -0
- package/dist/{chunk-SJNAG4AL.js → chunk-EGOOH5HP.js} +1 -55
- package/dist/chunk-F6ACNKFR.js +41 -0
- package/dist/chunk-QQCCX2KH.js +3338 -0
- package/dist/{chunk-LTPINR5K.js → chunk-S53FFHPM.js} +3 -98
- package/dist/chunk-TS5RMC7F.js +56 -0
- package/dist/chunk-U3QAVT4H.js +1986 -0
- package/dist/chunk-UHZEIZLS.js +62 -0
- package/dist/client/index.cjs +2118 -26
- package/dist/client/index.d.cts +4 -415
- package/dist/client/index.d.ts +4 -415
- package/dist/client/index.js +111 -35
- package/dist/client/transports/grpc/index.cjs +4601 -0
- package/dist/client/transports/grpc/index.d.cts +42 -0
- package/dist/client/transports/grpc/index.d.ts +42 -0
- package/dist/client/transports/grpc/index.js +262 -0
- package/dist/core-BAzQJfA2.d.ts +416 -0
- package/dist/core-Ci-lR0jz.d.cts +416 -0
- package/dist/server/express/index.cjs +2134 -120
- package/dist/server/express/index.js +80 -20
- package/dist/server/grpc/index.cjs +4560 -0
- package/dist/server/grpc/index.d.cts +1053 -0
- package/dist/server/grpc/index.d.ts +1053 -0
- package/dist/server/grpc/index.js +186 -0
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.js +8 -4
- package/package.json +41 -3
|
@@ -0,0 +1,4560 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/server/grpc/index.ts
|
|
30
|
+
var grpc_exports = {};
|
|
31
|
+
__export(grpc_exports, {
|
|
32
|
+
A2AService: () => A2AServiceService,
|
|
33
|
+
UserBuilder: () => UserBuilder,
|
|
34
|
+
grpcService: () => grpcService
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(grpc_exports);
|
|
37
|
+
|
|
38
|
+
// src/server/grpc/grpc_service.ts
|
|
39
|
+
var grpc = __toESM(require("@grpc/grpc-js"), 1);
|
|
40
|
+
|
|
41
|
+
// src/server/error.ts
|
|
42
|
+
var A2AError = class _A2AError extends Error {
|
|
43
|
+
code;
|
|
44
|
+
data;
|
|
45
|
+
taskId;
|
|
46
|
+
// Optional task ID context
|
|
47
|
+
constructor(code, message, data, taskId) {
|
|
48
|
+
super(message);
|
|
49
|
+
this.name = "A2AError";
|
|
50
|
+
this.code = code;
|
|
51
|
+
this.data = data;
|
|
52
|
+
this.taskId = taskId;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Formats the error into a standard JSON-RPC error object structure.
|
|
56
|
+
*/
|
|
57
|
+
toJSONRPCError() {
|
|
58
|
+
const errorObject = {
|
|
59
|
+
code: this.code,
|
|
60
|
+
message: this.message
|
|
61
|
+
};
|
|
62
|
+
if (this.data !== void 0) {
|
|
63
|
+
errorObject.data = this.data;
|
|
64
|
+
}
|
|
65
|
+
return errorObject;
|
|
66
|
+
}
|
|
67
|
+
// Static factory methods for common errors
|
|
68
|
+
static parseError(message, data) {
|
|
69
|
+
return new _A2AError(-32700, message, data);
|
|
70
|
+
}
|
|
71
|
+
static invalidRequest(message, data) {
|
|
72
|
+
return new _A2AError(-32600, message, data);
|
|
73
|
+
}
|
|
74
|
+
static methodNotFound(method) {
|
|
75
|
+
return new _A2AError(-32601, `Method not found: ${method}`);
|
|
76
|
+
}
|
|
77
|
+
static invalidParams(message, data) {
|
|
78
|
+
return new _A2AError(-32602, message, data);
|
|
79
|
+
}
|
|
80
|
+
static internalError(message, data) {
|
|
81
|
+
return new _A2AError(-32603, message, data);
|
|
82
|
+
}
|
|
83
|
+
static taskNotFound(taskId) {
|
|
84
|
+
return new _A2AError(-32001, `Task not found: ${taskId}`, void 0, taskId);
|
|
85
|
+
}
|
|
86
|
+
static taskNotCancelable(taskId) {
|
|
87
|
+
return new _A2AError(-32002, `Task not cancelable: ${taskId}`, void 0, taskId);
|
|
88
|
+
}
|
|
89
|
+
static pushNotificationNotSupported() {
|
|
90
|
+
return new _A2AError(-32003, "Push Notification is not supported");
|
|
91
|
+
}
|
|
92
|
+
static unsupportedOperation(operation) {
|
|
93
|
+
return new _A2AError(-32004, `Unsupported operation: ${operation}`);
|
|
94
|
+
}
|
|
95
|
+
static authenticatedExtendedCardNotConfigured() {
|
|
96
|
+
return new _A2AError(-32007, `Extended card not configured.`);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// src/types/converters/id_decoding.ts
|
|
101
|
+
var CONFIG_REGEX = /^tasks\/([^/]+)\/pushNotificationConfigs\/([^/]+)$/;
|
|
102
|
+
var TASK_ONLY_REGEX = /^tasks\/([^/]+)(?:\/|$)/;
|
|
103
|
+
var extractTaskId = (name) => {
|
|
104
|
+
const match = name.match(TASK_ONLY_REGEX);
|
|
105
|
+
if (!match) {
|
|
106
|
+
throw A2AError.invalidParams(`Invalid or missing task ID in: "${name}"`);
|
|
107
|
+
}
|
|
108
|
+
return match[1];
|
|
109
|
+
};
|
|
110
|
+
var generateTaskName = (taskId) => {
|
|
111
|
+
return `tasks/${taskId}`;
|
|
112
|
+
};
|
|
113
|
+
var extractTaskAndPushNotificationConfigId = (name) => {
|
|
114
|
+
const match = name.match(CONFIG_REGEX);
|
|
115
|
+
if (!match) {
|
|
116
|
+
throw A2AError.invalidParams(`Invalid or missing config ID in: "${name}"`);
|
|
117
|
+
}
|
|
118
|
+
return { taskId: match[1], configId: match[2] };
|
|
119
|
+
};
|
|
120
|
+
var generatePushNotificationConfigName = (taskId, configId) => {
|
|
121
|
+
return `tasks/${taskId}/pushNotificationConfigs/${configId}`;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// src/types/converters/from_proto.ts
|
|
125
|
+
var FromProto = class _FromProto {
|
|
126
|
+
static taskQueryParams(request) {
|
|
127
|
+
return {
|
|
128
|
+
id: extractTaskId(request.name),
|
|
129
|
+
historyLength: request.historyLength
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
static taskIdParams(request) {
|
|
133
|
+
return {
|
|
134
|
+
id: extractTaskId(request.name)
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
static getTaskPushNotificationConfigParams(request) {
|
|
138
|
+
const { taskId, configId } = extractTaskAndPushNotificationConfigId(request.name);
|
|
139
|
+
return {
|
|
140
|
+
id: taskId,
|
|
141
|
+
pushNotificationConfigId: configId
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
static listTaskPushNotificationConfigParams(request) {
|
|
145
|
+
return {
|
|
146
|
+
id: extractTaskId(request.parent)
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
static createTaskPushNotificationConfig(request) {
|
|
150
|
+
if (!request.config?.pushNotificationConfig) {
|
|
151
|
+
throw A2AError.invalidParams(
|
|
152
|
+
"Request must include a `config` object with a `pushNotificationConfig`"
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
taskId: extractTaskId(request.parent),
|
|
157
|
+
pushNotificationConfig: _FromProto.pushNotificationConfig(
|
|
158
|
+
request.config.pushNotificationConfig
|
|
159
|
+
)
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
static deleteTaskPushNotificationConfigParams(request) {
|
|
163
|
+
const { taskId, configId } = extractTaskAndPushNotificationConfigId(request.name);
|
|
164
|
+
return {
|
|
165
|
+
id: taskId,
|
|
166
|
+
pushNotificationConfigId: configId
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
static message(message) {
|
|
170
|
+
if (!message) {
|
|
171
|
+
return void 0;
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
kind: "message",
|
|
175
|
+
messageId: message.messageId,
|
|
176
|
+
parts: message.content.map((p) => _FromProto.part(p)),
|
|
177
|
+
contextId: message.contextId || void 0,
|
|
178
|
+
taskId: message.taskId || void 0,
|
|
179
|
+
role: _FromProto.role(message.role),
|
|
180
|
+
metadata: message.metadata,
|
|
181
|
+
extensions: message.extensions
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
static role(role) {
|
|
185
|
+
switch (role) {
|
|
186
|
+
case 2 /* ROLE_AGENT */:
|
|
187
|
+
return "agent";
|
|
188
|
+
case 1 /* ROLE_USER */:
|
|
189
|
+
return "user";
|
|
190
|
+
default:
|
|
191
|
+
throw A2AError.invalidParams(`Invalid role: ${role}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
static messageSendConfiguration(configuration) {
|
|
195
|
+
if (!configuration) {
|
|
196
|
+
return void 0;
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
blocking: configuration.blocking,
|
|
200
|
+
acceptedOutputModes: configuration.acceptedOutputModes,
|
|
201
|
+
pushNotificationConfig: _FromProto.pushNotificationConfig(configuration.pushNotification)
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
static pushNotificationConfig(config) {
|
|
205
|
+
if (!config) {
|
|
206
|
+
return void 0;
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
id: config.id,
|
|
210
|
+
url: config.url,
|
|
211
|
+
token: config.token || void 0,
|
|
212
|
+
authentication: _FromProto.pushNotificationAuthenticationInfo(config.authentication)
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
static pushNotificationAuthenticationInfo(authInfo) {
|
|
216
|
+
if (!authInfo) {
|
|
217
|
+
return void 0;
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
schemes: authInfo.schemes,
|
|
221
|
+
credentials: authInfo.credentials
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
static part(part) {
|
|
225
|
+
if (part.part?.$case === "text") {
|
|
226
|
+
return {
|
|
227
|
+
kind: "text",
|
|
228
|
+
text: part.part.value
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
if (part.part?.$case === "file") {
|
|
232
|
+
const filePart = part.part.value;
|
|
233
|
+
if (filePart.file?.$case === "fileWithUri") {
|
|
234
|
+
return {
|
|
235
|
+
kind: "file",
|
|
236
|
+
file: {
|
|
237
|
+
uri: filePart.file.value,
|
|
238
|
+
mimeType: filePart.mimeType
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
} else if (filePart.file?.$case === "fileWithBytes") {
|
|
242
|
+
return {
|
|
243
|
+
kind: "file",
|
|
244
|
+
file: {
|
|
245
|
+
bytes: filePart.file.value.toString("base64"),
|
|
246
|
+
mimeType: filePart.mimeType
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
throw A2AError.invalidParams("Invalid file part type");
|
|
251
|
+
}
|
|
252
|
+
if (part.part?.$case === "data") {
|
|
253
|
+
return {
|
|
254
|
+
kind: "data",
|
|
255
|
+
data: part.part.value.data
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
throw A2AError.invalidParams("Invalid part type");
|
|
259
|
+
}
|
|
260
|
+
static messageSendParams(request) {
|
|
261
|
+
return {
|
|
262
|
+
message: _FromProto.message(request.request),
|
|
263
|
+
configuration: _FromProto.messageSendConfiguration(request.configuration),
|
|
264
|
+
metadata: request.metadata
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
static sendMessageResult(response) {
|
|
268
|
+
if (response.payload?.$case === "task") {
|
|
269
|
+
return _FromProto.task(response.payload.value);
|
|
270
|
+
} else if (response.payload?.$case === "msg") {
|
|
271
|
+
return _FromProto.message(response.payload.value);
|
|
272
|
+
}
|
|
273
|
+
throw A2AError.invalidParams("Invalid SendMessageResponse: missing result");
|
|
274
|
+
}
|
|
275
|
+
static task(task) {
|
|
276
|
+
return {
|
|
277
|
+
kind: "task",
|
|
278
|
+
id: task.id,
|
|
279
|
+
status: _FromProto.taskStatus(task.status),
|
|
280
|
+
contextId: task.contextId,
|
|
281
|
+
artifacts: task.artifacts?.map((a) => _FromProto.artifact(a)),
|
|
282
|
+
history: task.history?.map((h) => _FromProto.message(h)),
|
|
283
|
+
metadata: task.metadata
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
static taskStatus(status2) {
|
|
287
|
+
return {
|
|
288
|
+
message: _FromProto.message(status2.update),
|
|
289
|
+
state: _FromProto.taskState(status2.state),
|
|
290
|
+
timestamp: status2.timestamp
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
static taskState(state) {
|
|
294
|
+
switch (state) {
|
|
295
|
+
case 1 /* TASK_STATE_SUBMITTED */:
|
|
296
|
+
return "submitted";
|
|
297
|
+
case 2 /* TASK_STATE_WORKING */:
|
|
298
|
+
return "working";
|
|
299
|
+
case 6 /* TASK_STATE_INPUT_REQUIRED */:
|
|
300
|
+
return "input-required";
|
|
301
|
+
case 3 /* TASK_STATE_COMPLETED */:
|
|
302
|
+
return "completed";
|
|
303
|
+
case 5 /* TASK_STATE_CANCELLED */:
|
|
304
|
+
return "canceled";
|
|
305
|
+
case 4 /* TASK_STATE_FAILED */:
|
|
306
|
+
return "failed";
|
|
307
|
+
case 7 /* TASK_STATE_REJECTED */:
|
|
308
|
+
return "rejected";
|
|
309
|
+
case 8 /* TASK_STATE_AUTH_REQUIRED */:
|
|
310
|
+
return "auth-required";
|
|
311
|
+
case 0 /* TASK_STATE_UNSPECIFIED */:
|
|
312
|
+
return "unknown";
|
|
313
|
+
default:
|
|
314
|
+
throw A2AError.invalidParams(`Invalid task state: ${state}`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
static artifact(artifact) {
|
|
318
|
+
return {
|
|
319
|
+
artifactId: artifact.artifactId,
|
|
320
|
+
name: artifact.name || void 0,
|
|
321
|
+
description: artifact.description || void 0,
|
|
322
|
+
parts: artifact.parts.map((p) => _FromProto.part(p)),
|
|
323
|
+
metadata: artifact.metadata
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
static taskPushNotificationConfig(request) {
|
|
327
|
+
return {
|
|
328
|
+
taskId: extractTaskId(request.name),
|
|
329
|
+
pushNotificationConfig: _FromProto.pushNotificationConfig(request.pushNotificationConfig)
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
static listTaskPushNotificationConfig(request) {
|
|
333
|
+
return request.configs.map((c) => _FromProto.taskPushNotificationConfig(c));
|
|
334
|
+
}
|
|
335
|
+
static agentCard(agentCard) {
|
|
336
|
+
return {
|
|
337
|
+
additionalInterfaces: agentCard.additionalInterfaces?.map((i) => _FromProto.agentInterface(i)),
|
|
338
|
+
capabilities: agentCard.capabilities ? _FromProto.agentCapabilities(agentCard.capabilities) : {},
|
|
339
|
+
defaultInputModes: agentCard.defaultInputModes,
|
|
340
|
+
defaultOutputModes: agentCard.defaultOutputModes,
|
|
341
|
+
description: agentCard.description,
|
|
342
|
+
documentationUrl: agentCard.documentationUrl || void 0,
|
|
343
|
+
name: agentCard.name,
|
|
344
|
+
preferredTransport: agentCard.preferredTransport,
|
|
345
|
+
provider: agentCard.provider ? _FromProto.agentProvider(agentCard.provider) : void 0,
|
|
346
|
+
protocolVersion: agentCard.protocolVersion,
|
|
347
|
+
security: agentCard.security?.map((s) => _FromProto.security(s)),
|
|
348
|
+
securitySchemes: agentCard.securitySchemes ? Object.fromEntries(
|
|
349
|
+
Object.entries(agentCard.securitySchemes).map(([key, value]) => [
|
|
350
|
+
key,
|
|
351
|
+
_FromProto.securityScheme(value)
|
|
352
|
+
])
|
|
353
|
+
) : {},
|
|
354
|
+
skills: agentCard.skills.map((s) => _FromProto.skills(s)),
|
|
355
|
+
signatures: agentCard.signatures?.map((s) => _FromProto.agentCardSignature(s)),
|
|
356
|
+
supportsAuthenticatedExtendedCard: agentCard.supportsAuthenticatedExtendedCard,
|
|
357
|
+
url: agentCard.url,
|
|
358
|
+
version: agentCard.version
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
static agentCapabilities(capabilities) {
|
|
362
|
+
return {
|
|
363
|
+
extensions: capabilities.extensions?.map((e) => _FromProto.agentExtension(e)),
|
|
364
|
+
pushNotifications: capabilities.pushNotifications,
|
|
365
|
+
streaming: capabilities.streaming
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
static agentExtension(extension) {
|
|
369
|
+
return {
|
|
370
|
+
uri: extension.uri,
|
|
371
|
+
description: extension.description || void 0,
|
|
372
|
+
required: extension.required,
|
|
373
|
+
params: extension.params
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
static agentInterface(intf) {
|
|
377
|
+
return {
|
|
378
|
+
transport: intf.transport,
|
|
379
|
+
url: intf.url
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
static agentProvider(provider) {
|
|
383
|
+
return {
|
|
384
|
+
organization: provider.organization,
|
|
385
|
+
url: provider.url
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
static security(security) {
|
|
389
|
+
return Object.fromEntries(
|
|
390
|
+
Object.entries(security.schemes)?.map(([key, value]) => [key, value.list])
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
static securityScheme(securitySchemes) {
|
|
394
|
+
switch (securitySchemes.scheme?.$case) {
|
|
395
|
+
case "apiKeySecurityScheme":
|
|
396
|
+
return {
|
|
397
|
+
type: "apiKey",
|
|
398
|
+
name: securitySchemes.scheme.value.name,
|
|
399
|
+
in: securitySchemes.scheme.value.location,
|
|
400
|
+
description: securitySchemes.scheme.value.description || void 0
|
|
401
|
+
};
|
|
402
|
+
case "httpAuthSecurityScheme":
|
|
403
|
+
return {
|
|
404
|
+
type: "http",
|
|
405
|
+
scheme: securitySchemes.scheme.value.scheme,
|
|
406
|
+
bearerFormat: securitySchemes.scheme.value.bearerFormat || void 0,
|
|
407
|
+
description: securitySchemes.scheme.value.description || void 0
|
|
408
|
+
};
|
|
409
|
+
case "mtlsSecurityScheme":
|
|
410
|
+
return {
|
|
411
|
+
type: "mutualTLS",
|
|
412
|
+
description: securitySchemes.scheme.value.description || void 0
|
|
413
|
+
};
|
|
414
|
+
case "oauth2SecurityScheme":
|
|
415
|
+
return {
|
|
416
|
+
type: "oauth2",
|
|
417
|
+
description: securitySchemes.scheme.value.description || void 0,
|
|
418
|
+
flows: _FromProto.oauthFlows(securitySchemes.scheme.value.flows),
|
|
419
|
+
oauth2MetadataUrl: securitySchemes.scheme.value.oauth2MetadataUrl || void 0
|
|
420
|
+
};
|
|
421
|
+
case "openIdConnectSecurityScheme":
|
|
422
|
+
return {
|
|
423
|
+
type: "openIdConnect",
|
|
424
|
+
description: securitySchemes.scheme.value.description || void 0,
|
|
425
|
+
openIdConnectUrl: securitySchemes.scheme.value.openIdConnectUrl
|
|
426
|
+
};
|
|
427
|
+
default:
|
|
428
|
+
throw A2AError.internalError(`Unsupported security scheme type`);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
static oauthFlows(flows) {
|
|
432
|
+
switch (flows.flow?.$case) {
|
|
433
|
+
case "implicit":
|
|
434
|
+
return {
|
|
435
|
+
implicit: {
|
|
436
|
+
authorizationUrl: flows.flow.value.authorizationUrl,
|
|
437
|
+
scopes: flows.flow.value.scopes,
|
|
438
|
+
refreshUrl: flows.flow.value.refreshUrl || void 0
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
case "password":
|
|
442
|
+
return {
|
|
443
|
+
password: {
|
|
444
|
+
refreshUrl: flows.flow.value.refreshUrl || void 0,
|
|
445
|
+
scopes: flows.flow.value.scopes,
|
|
446
|
+
tokenUrl: flows.flow.value.tokenUrl
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
case "authorizationCode":
|
|
450
|
+
return {
|
|
451
|
+
authorizationCode: {
|
|
452
|
+
refreshUrl: flows.flow.value.refreshUrl || void 0,
|
|
453
|
+
authorizationUrl: flows.flow.value.authorizationUrl,
|
|
454
|
+
scopes: flows.flow.value.scopes,
|
|
455
|
+
tokenUrl: flows.flow.value.tokenUrl
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
case "clientCredentials":
|
|
459
|
+
return {
|
|
460
|
+
clientCredentials: {
|
|
461
|
+
refreshUrl: flows.flow.value.refreshUrl || void 0,
|
|
462
|
+
scopes: flows.flow.value.scopes,
|
|
463
|
+
tokenUrl: flows.flow.value.tokenUrl
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
default:
|
|
467
|
+
throw A2AError.internalError(`Unsupported OAuth flows`);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
static skills(skill) {
|
|
471
|
+
return {
|
|
472
|
+
id: skill.id,
|
|
473
|
+
name: skill.name,
|
|
474
|
+
description: skill.description,
|
|
475
|
+
tags: skill.tags,
|
|
476
|
+
examples: skill.examples,
|
|
477
|
+
inputModes: skill.inputModes,
|
|
478
|
+
outputModes: skill.outputModes,
|
|
479
|
+
security: skill.security?.map((s) => _FromProto.security(s))
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
static agentCardSignature(signatures) {
|
|
483
|
+
return {
|
|
484
|
+
protected: signatures.protected,
|
|
485
|
+
signature: signatures.signature,
|
|
486
|
+
header: signatures.header
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
static taskStatusUpdateEvent(event) {
|
|
490
|
+
return {
|
|
491
|
+
kind: "status-update",
|
|
492
|
+
taskId: event.taskId,
|
|
493
|
+
status: _FromProto.taskStatus(event.status),
|
|
494
|
+
contextId: event.contextId,
|
|
495
|
+
metadata: event.metadata,
|
|
496
|
+
final: event.final
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
static taskArtifactUpdateEvent(event) {
|
|
500
|
+
return {
|
|
501
|
+
kind: "artifact-update",
|
|
502
|
+
taskId: event.taskId,
|
|
503
|
+
artifact: _FromProto.artifact(event.artifact),
|
|
504
|
+
contextId: event.contextId,
|
|
505
|
+
metadata: event.metadata,
|
|
506
|
+
lastChunk: event.lastChunk
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
static messageStreamResult(event) {
|
|
510
|
+
switch (event.payload?.$case) {
|
|
511
|
+
case "msg":
|
|
512
|
+
return _FromProto.message(event.payload.value);
|
|
513
|
+
case "task":
|
|
514
|
+
return _FromProto.task(event.payload.value);
|
|
515
|
+
case "statusUpdate":
|
|
516
|
+
return _FromProto.taskStatusUpdateEvent(event.payload.value);
|
|
517
|
+
case "artifactUpdate":
|
|
518
|
+
return _FromProto.taskArtifactUpdateEvent(event.payload.value);
|
|
519
|
+
default:
|
|
520
|
+
throw A2AError.internalError("Invalid event type in StreamResponse");
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
// src/types/converters/to_proto.ts
|
|
526
|
+
var ToProto = class _ToProto {
|
|
527
|
+
static agentCard(agentCard) {
|
|
528
|
+
return {
|
|
529
|
+
protocolVersion: agentCard.protocolVersion,
|
|
530
|
+
name: agentCard.name,
|
|
531
|
+
description: agentCard.description,
|
|
532
|
+
url: agentCard.url,
|
|
533
|
+
preferredTransport: agentCard.preferredTransport ?? "",
|
|
534
|
+
additionalInterfaces: agentCard.additionalInterfaces?.map((i) => _ToProto.agentInterface(i)) ?? [],
|
|
535
|
+
provider: _ToProto.agentProvider(agentCard.provider),
|
|
536
|
+
version: agentCard.version,
|
|
537
|
+
documentationUrl: agentCard.documentationUrl ?? "",
|
|
538
|
+
capabilities: _ToProto.agentCapabilities(agentCard.capabilities),
|
|
539
|
+
securitySchemes: agentCard.securitySchemes ? Object.fromEntries(
|
|
540
|
+
Object.entries(agentCard.securitySchemes).map(([key, value]) => [
|
|
541
|
+
key,
|
|
542
|
+
_ToProto.securityScheme(value)
|
|
543
|
+
])
|
|
544
|
+
) : {},
|
|
545
|
+
security: agentCard.security?.map((s) => _ToProto.security(s)) ?? [],
|
|
546
|
+
defaultInputModes: agentCard.defaultInputModes,
|
|
547
|
+
defaultOutputModes: agentCard.defaultOutputModes,
|
|
548
|
+
skills: agentCard.skills.map((s) => _ToProto.agentSkill(s)),
|
|
549
|
+
supportsAuthenticatedExtendedCard: agentCard.supportsAuthenticatedExtendedCard,
|
|
550
|
+
signatures: agentCard.signatures?.map((s) => _ToProto.agentCardSignature(s)) ?? []
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
static agentCardSignature(signatures) {
|
|
554
|
+
return {
|
|
555
|
+
protected: signatures.protected,
|
|
556
|
+
signature: signatures.signature,
|
|
557
|
+
header: signatures.header
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
static agentSkill(skill) {
|
|
561
|
+
return {
|
|
562
|
+
id: skill.id,
|
|
563
|
+
name: skill.name,
|
|
564
|
+
description: skill.description,
|
|
565
|
+
tags: skill.tags ?? [],
|
|
566
|
+
examples: skill.examples ?? [],
|
|
567
|
+
inputModes: skill.inputModes ?? [],
|
|
568
|
+
outputModes: skill.outputModes ?? [],
|
|
569
|
+
security: skill.security ? skill.security.map((s) => _ToProto.security(s)) : []
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
static security(security) {
|
|
573
|
+
return {
|
|
574
|
+
schemes: Object.fromEntries(
|
|
575
|
+
Object.entries(security).map(([key, value]) => {
|
|
576
|
+
return [key, { list: value }];
|
|
577
|
+
})
|
|
578
|
+
)
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
static securityScheme(scheme) {
|
|
582
|
+
switch (scheme.type) {
|
|
583
|
+
case "apiKey":
|
|
584
|
+
return {
|
|
585
|
+
scheme: {
|
|
586
|
+
$case: "apiKeySecurityScheme",
|
|
587
|
+
value: {
|
|
588
|
+
name: scheme.name,
|
|
589
|
+
location: scheme.in,
|
|
590
|
+
description: scheme.description ?? ""
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
};
|
|
594
|
+
case "http":
|
|
595
|
+
return {
|
|
596
|
+
scheme: {
|
|
597
|
+
$case: "httpAuthSecurityScheme",
|
|
598
|
+
value: {
|
|
599
|
+
description: scheme.description ?? "",
|
|
600
|
+
scheme: scheme.scheme,
|
|
601
|
+
bearerFormat: scheme.bearerFormat ?? ""
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
case "mutualTLS":
|
|
606
|
+
return {
|
|
607
|
+
scheme: {
|
|
608
|
+
$case: "mtlsSecurityScheme",
|
|
609
|
+
value: {
|
|
610
|
+
description: scheme.description ?? ""
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
case "oauth2":
|
|
615
|
+
return {
|
|
616
|
+
scheme: {
|
|
617
|
+
$case: "oauth2SecurityScheme",
|
|
618
|
+
value: {
|
|
619
|
+
description: scheme.description ?? "",
|
|
620
|
+
flows: _ToProto.oauthFlows(scheme.flows),
|
|
621
|
+
oauth2MetadataUrl: scheme.oauth2MetadataUrl ?? ""
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
case "openIdConnect":
|
|
626
|
+
return {
|
|
627
|
+
scheme: {
|
|
628
|
+
$case: "openIdConnectSecurityScheme",
|
|
629
|
+
value: {
|
|
630
|
+
description: scheme.description ?? "",
|
|
631
|
+
openIdConnectUrl: scheme.openIdConnectUrl
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
default:
|
|
636
|
+
throw A2AError.internalError(`Unsupported security scheme type`);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
static oauthFlows(flows) {
|
|
640
|
+
if (flows.implicit) {
|
|
641
|
+
return {
|
|
642
|
+
flow: {
|
|
643
|
+
$case: "implicit",
|
|
644
|
+
value: {
|
|
645
|
+
authorizationUrl: flows.implicit.authorizationUrl,
|
|
646
|
+
scopes: flows.implicit.scopes,
|
|
647
|
+
refreshUrl: flows.implicit.refreshUrl ?? ""
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
} else if (flows.password) {
|
|
652
|
+
return {
|
|
653
|
+
flow: {
|
|
654
|
+
$case: "password",
|
|
655
|
+
value: {
|
|
656
|
+
tokenUrl: flows.password.tokenUrl,
|
|
657
|
+
scopes: flows.password.scopes,
|
|
658
|
+
refreshUrl: flows.password.refreshUrl ?? ""
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
} else if (flows.clientCredentials) {
|
|
663
|
+
return {
|
|
664
|
+
flow: {
|
|
665
|
+
$case: "clientCredentials",
|
|
666
|
+
value: {
|
|
667
|
+
tokenUrl: flows.clientCredentials.tokenUrl,
|
|
668
|
+
scopes: flows.clientCredentials.scopes,
|
|
669
|
+
refreshUrl: flows.clientCredentials.refreshUrl ?? ""
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
};
|
|
673
|
+
} else if (flows.authorizationCode) {
|
|
674
|
+
return {
|
|
675
|
+
flow: {
|
|
676
|
+
$case: "authorizationCode",
|
|
677
|
+
value: {
|
|
678
|
+
authorizationUrl: flows.authorizationCode.authorizationUrl,
|
|
679
|
+
tokenUrl: flows.authorizationCode.tokenUrl,
|
|
680
|
+
scopes: flows.authorizationCode.scopes,
|
|
681
|
+
refreshUrl: flows.authorizationCode.refreshUrl ?? ""
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
} else {
|
|
686
|
+
throw A2AError.internalError(`Unsupported OAuth flows`);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
static agentInterface(agentInterface) {
|
|
690
|
+
return {
|
|
691
|
+
transport: agentInterface.transport,
|
|
692
|
+
url: agentInterface.url
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
static agentProvider(agentProvider) {
|
|
696
|
+
if (!agentProvider) {
|
|
697
|
+
return void 0;
|
|
698
|
+
}
|
|
699
|
+
return {
|
|
700
|
+
url: agentProvider.url,
|
|
701
|
+
organization: agentProvider.organization
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
static agentCapabilities(capabilities) {
|
|
705
|
+
return {
|
|
706
|
+
streaming: capabilities.streaming,
|
|
707
|
+
pushNotifications: capabilities.pushNotifications,
|
|
708
|
+
extensions: capabilities.extensions ? capabilities.extensions.map((e) => _ToProto.agentExtension(e)) : []
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
static agentExtension(extension) {
|
|
712
|
+
return {
|
|
713
|
+
uri: extension.uri,
|
|
714
|
+
description: extension.description ?? "",
|
|
715
|
+
required: extension.required ?? false,
|
|
716
|
+
params: extension.params
|
|
717
|
+
};
|
|
718
|
+
}
|
|
719
|
+
static listTaskPushNotificationConfig(config) {
|
|
720
|
+
return {
|
|
721
|
+
configs: config.map((c) => _ToProto.taskPushNotificationConfig(c)),
|
|
722
|
+
nextPageToken: ""
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
static getTaskPushNotificationConfigParams(config) {
|
|
726
|
+
return {
|
|
727
|
+
name: generatePushNotificationConfigName(config.id, config.pushNotificationConfigId)
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
static listTaskPushNotificationConfigParams(config) {
|
|
731
|
+
return {
|
|
732
|
+
parent: generateTaskName(config.id),
|
|
733
|
+
pageToken: "",
|
|
734
|
+
pageSize: 0
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
static deleteTaskPushNotificationConfigParams(config) {
|
|
738
|
+
return {
|
|
739
|
+
name: generatePushNotificationConfigName(config.id, config.pushNotificationConfigId)
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
static taskPushNotificationConfig(config) {
|
|
743
|
+
return {
|
|
744
|
+
name: generatePushNotificationConfigName(
|
|
745
|
+
config.taskId,
|
|
746
|
+
config.pushNotificationConfig.id ?? ""
|
|
747
|
+
),
|
|
748
|
+
pushNotificationConfig: _ToProto.pushNotificationConfig(config.pushNotificationConfig)
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
static taskPushNotificationConfigCreate(config) {
|
|
752
|
+
return {
|
|
753
|
+
parent: generateTaskName(config.taskId),
|
|
754
|
+
config: _ToProto.taskPushNotificationConfig(config),
|
|
755
|
+
configId: config.pushNotificationConfig.id
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
static pushNotificationConfig(config) {
|
|
759
|
+
if (!config) {
|
|
760
|
+
return void 0;
|
|
761
|
+
}
|
|
762
|
+
return {
|
|
763
|
+
id: config.id ?? "",
|
|
764
|
+
url: config.url,
|
|
765
|
+
token: config.token ?? "",
|
|
766
|
+
authentication: _ToProto.pushNotificationAuthenticationInfo(config.authentication)
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
static pushNotificationAuthenticationInfo(authInfo) {
|
|
770
|
+
if (!authInfo) {
|
|
771
|
+
return void 0;
|
|
772
|
+
}
|
|
773
|
+
return {
|
|
774
|
+
schemes: authInfo.schemes,
|
|
775
|
+
credentials: authInfo.credentials ?? ""
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
static messageStreamResult(event) {
|
|
779
|
+
if (event.kind === "message") {
|
|
780
|
+
return {
|
|
781
|
+
payload: {
|
|
782
|
+
$case: "msg",
|
|
783
|
+
value: _ToProto.message(event)
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
} else if (event.kind === "task") {
|
|
787
|
+
return {
|
|
788
|
+
payload: {
|
|
789
|
+
$case: "task",
|
|
790
|
+
value: _ToProto.task(event)
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
} else if (event.kind === "status-update") {
|
|
794
|
+
return {
|
|
795
|
+
payload: {
|
|
796
|
+
$case: "statusUpdate",
|
|
797
|
+
value: _ToProto.taskStatusUpdateEvent(event)
|
|
798
|
+
}
|
|
799
|
+
};
|
|
800
|
+
} else if (event.kind === "artifact-update") {
|
|
801
|
+
return {
|
|
802
|
+
payload: {
|
|
803
|
+
$case: "artifactUpdate",
|
|
804
|
+
value: _ToProto.taskArtifactUpdateEvent(event)
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
} else {
|
|
808
|
+
throw A2AError.internalError("Invalid event type");
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
static taskStatusUpdateEvent(event) {
|
|
812
|
+
return {
|
|
813
|
+
taskId: event.taskId,
|
|
814
|
+
status: _ToProto.taskStatus(event.status),
|
|
815
|
+
contextId: event.contextId,
|
|
816
|
+
metadata: event.metadata,
|
|
817
|
+
final: event.final
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
static taskArtifactUpdateEvent(event) {
|
|
821
|
+
return {
|
|
822
|
+
taskId: event.taskId,
|
|
823
|
+
artifact: _ToProto.artifact(event.artifact),
|
|
824
|
+
contextId: event.contextId,
|
|
825
|
+
metadata: event.metadata,
|
|
826
|
+
append: event.append,
|
|
827
|
+
lastChunk: event.lastChunk
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
static messageSendResult(params) {
|
|
831
|
+
if (params.kind === "message") {
|
|
832
|
+
return {
|
|
833
|
+
payload: {
|
|
834
|
+
$case: "msg",
|
|
835
|
+
value: _ToProto.message(params)
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
} else if (params.kind === "task") {
|
|
839
|
+
return {
|
|
840
|
+
payload: {
|
|
841
|
+
$case: "task",
|
|
842
|
+
value: _ToProto.task(params)
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
static message(message) {
|
|
848
|
+
if (!message) {
|
|
849
|
+
return void 0;
|
|
850
|
+
}
|
|
851
|
+
return {
|
|
852
|
+
messageId: message.messageId,
|
|
853
|
+
content: message.parts.map((p) => _ToProto.part(p)),
|
|
854
|
+
contextId: message.contextId ?? "",
|
|
855
|
+
taskId: message.taskId ?? "",
|
|
856
|
+
role: _ToProto.role(message.role),
|
|
857
|
+
metadata: message.metadata,
|
|
858
|
+
extensions: message.extensions ?? []
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
static role(role) {
|
|
862
|
+
switch (role) {
|
|
863
|
+
case "agent":
|
|
864
|
+
return 2 /* ROLE_AGENT */;
|
|
865
|
+
case "user":
|
|
866
|
+
return 1 /* ROLE_USER */;
|
|
867
|
+
default:
|
|
868
|
+
throw A2AError.internalError(`Invalid role`);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
static task(task) {
|
|
872
|
+
return {
|
|
873
|
+
id: task.id,
|
|
874
|
+
contextId: task.contextId,
|
|
875
|
+
status: _ToProto.taskStatus(task.status),
|
|
876
|
+
artifacts: task.artifacts?.map((a) => _ToProto.artifact(a)) ?? [],
|
|
877
|
+
history: task.history?.map((m) => _ToProto.message(m)) ?? [],
|
|
878
|
+
metadata: task.metadata
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
static taskStatus(status2) {
|
|
882
|
+
return {
|
|
883
|
+
state: _ToProto.taskState(status2.state),
|
|
884
|
+
update: _ToProto.message(status2.message),
|
|
885
|
+
timestamp: status2.timestamp
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
static artifact(artifact) {
|
|
889
|
+
return {
|
|
890
|
+
artifactId: artifact.artifactId,
|
|
891
|
+
name: artifact.name ?? "",
|
|
892
|
+
description: artifact.description ?? "",
|
|
893
|
+
parts: artifact.parts.map((p) => _ToProto.part(p)),
|
|
894
|
+
metadata: artifact.metadata,
|
|
895
|
+
extensions: artifact.extensions ? artifact.extensions : []
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
static taskState(state) {
|
|
899
|
+
switch (state) {
|
|
900
|
+
case "submitted":
|
|
901
|
+
return 1 /* TASK_STATE_SUBMITTED */;
|
|
902
|
+
case "working":
|
|
903
|
+
return 2 /* TASK_STATE_WORKING */;
|
|
904
|
+
case "input-required":
|
|
905
|
+
return 6 /* TASK_STATE_INPUT_REQUIRED */;
|
|
906
|
+
case "rejected":
|
|
907
|
+
return 7 /* TASK_STATE_REJECTED */;
|
|
908
|
+
case "auth-required":
|
|
909
|
+
return 8 /* TASK_STATE_AUTH_REQUIRED */;
|
|
910
|
+
case "completed":
|
|
911
|
+
return 3 /* TASK_STATE_COMPLETED */;
|
|
912
|
+
case "failed":
|
|
913
|
+
return 4 /* TASK_STATE_FAILED */;
|
|
914
|
+
case "canceled":
|
|
915
|
+
return 5 /* TASK_STATE_CANCELLED */;
|
|
916
|
+
case "unknown":
|
|
917
|
+
return 0 /* TASK_STATE_UNSPECIFIED */;
|
|
918
|
+
default:
|
|
919
|
+
return -1 /* UNRECOGNIZED */;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
static part(part) {
|
|
923
|
+
if (part.kind === "text") {
|
|
924
|
+
return {
|
|
925
|
+
part: { $case: "text", value: part.text }
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
if (part.kind === "file") {
|
|
929
|
+
let filePart;
|
|
930
|
+
if ("uri" in part.file) {
|
|
931
|
+
filePart = {
|
|
932
|
+
file: { $case: "fileWithUri", value: part.file.uri },
|
|
933
|
+
mimeType: part.file.mimeType
|
|
934
|
+
};
|
|
935
|
+
} else if ("bytes" in part.file) {
|
|
936
|
+
filePart = {
|
|
937
|
+
file: { $case: "fileWithBytes", value: Buffer.from(part.file.bytes, "base64") },
|
|
938
|
+
mimeType: part.file.mimeType
|
|
939
|
+
};
|
|
940
|
+
} else {
|
|
941
|
+
throw A2AError.internalError("Invalid file part");
|
|
942
|
+
}
|
|
943
|
+
return {
|
|
944
|
+
part: { $case: "file", value: filePart }
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
if (part.kind === "data") {
|
|
948
|
+
return {
|
|
949
|
+
part: { $case: "data", value: { data: part.data } }
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
throw A2AError.internalError("Invalid part type");
|
|
953
|
+
}
|
|
954
|
+
static messageSendParams(params) {
|
|
955
|
+
return {
|
|
956
|
+
request: _ToProto.message(params.message),
|
|
957
|
+
configuration: _ToProto.configuration(params.configuration),
|
|
958
|
+
metadata: params.metadata
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
static configuration(configuration) {
|
|
962
|
+
if (!configuration) {
|
|
963
|
+
return void 0;
|
|
964
|
+
}
|
|
965
|
+
return {
|
|
966
|
+
blocking: configuration.blocking,
|
|
967
|
+
acceptedOutputModes: configuration.acceptedOutputModes ?? [],
|
|
968
|
+
pushNotification: _ToProto.pushNotificationConfig(configuration.pushNotificationConfig),
|
|
969
|
+
historyLength: configuration.historyLength ?? 0
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
static taskQueryParams(params) {
|
|
973
|
+
return {
|
|
974
|
+
name: generateTaskName(params.id),
|
|
975
|
+
historyLength: params.historyLength ?? 0
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
static cancelTaskRequest(params) {
|
|
979
|
+
return {
|
|
980
|
+
name: generateTaskName(params.id)
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
static taskIdParams(params) {
|
|
984
|
+
return {
|
|
985
|
+
name: generateTaskName(params.id)
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
static getAgentCardRequest() {
|
|
989
|
+
return {};
|
|
990
|
+
}
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
// src/extensions.ts
|
|
994
|
+
var Extensions = {
|
|
995
|
+
/**
|
|
996
|
+
* Creates new {@link Extensions} from `current` and `additional`.
|
|
997
|
+
* If `current` already contains `additional` it is returned unmodified.
|
|
998
|
+
*/
|
|
999
|
+
createFrom: (current, additional) => {
|
|
1000
|
+
if (current?.includes(additional)) {
|
|
1001
|
+
return current;
|
|
1002
|
+
}
|
|
1003
|
+
return [...current ?? [], additional];
|
|
1004
|
+
},
|
|
1005
|
+
/**
|
|
1006
|
+
* Creates {@link Extensions} from comma separated extensions identifiers as per
|
|
1007
|
+
* https://a2a-protocol.org/latest/specification/#326-service-parameters.
|
|
1008
|
+
* Parses the output of `toServiceParameter`.
|
|
1009
|
+
*/
|
|
1010
|
+
parseServiceParameter: (value) => {
|
|
1011
|
+
if (!value) {
|
|
1012
|
+
return [];
|
|
1013
|
+
}
|
|
1014
|
+
const unique = new Set(
|
|
1015
|
+
value.split(",").map((ext) => ext.trim()).filter((ext) => ext.length > 0)
|
|
1016
|
+
);
|
|
1017
|
+
return Array.from(unique);
|
|
1018
|
+
},
|
|
1019
|
+
/**
|
|
1020
|
+
* Converts {@link Extensions} to comma separated extensions identifiers as per
|
|
1021
|
+
* https://a2a-protocol.org/latest/specification/#326-service-parameters.
|
|
1022
|
+
*/
|
|
1023
|
+
toServiceParameter: (value) => {
|
|
1024
|
+
return value.join(",");
|
|
1025
|
+
}
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1028
|
+
// src/server/context.ts
|
|
1029
|
+
var ServerCallContext = class {
|
|
1030
|
+
_requestedExtensions;
|
|
1031
|
+
_user;
|
|
1032
|
+
_activatedExtensions;
|
|
1033
|
+
constructor(requestedExtensions, user) {
|
|
1034
|
+
this._requestedExtensions = requestedExtensions;
|
|
1035
|
+
this._user = user;
|
|
1036
|
+
}
|
|
1037
|
+
get user() {
|
|
1038
|
+
return this._user;
|
|
1039
|
+
}
|
|
1040
|
+
get activatedExtensions() {
|
|
1041
|
+
return this._activatedExtensions;
|
|
1042
|
+
}
|
|
1043
|
+
get requestedExtensions() {
|
|
1044
|
+
return this._requestedExtensions;
|
|
1045
|
+
}
|
|
1046
|
+
addActivatedExtension(uri) {
|
|
1047
|
+
this._activatedExtensions = Extensions.createFrom(this._activatedExtensions, uri);
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
|
|
1051
|
+
// src/constants.ts
|
|
1052
|
+
var HTTP_EXTENSION_HEADER = "X-A2A-Extensions";
|
|
1053
|
+
|
|
1054
|
+
// src/server/grpc/grpc_service.ts
|
|
1055
|
+
function grpcService(options) {
|
|
1056
|
+
const requestHandler = options.requestHandler;
|
|
1057
|
+
const wrapUnary = async (call, callback, parser, handler, converter) => {
|
|
1058
|
+
try {
|
|
1059
|
+
const context = await buildContext(call, options.userBuilder);
|
|
1060
|
+
const params = parser(call.request);
|
|
1061
|
+
const result = await handler(params, context);
|
|
1062
|
+
call.sendMetadata(buildMetadata(context));
|
|
1063
|
+
callback(null, converter(result));
|
|
1064
|
+
} catch (error) {
|
|
1065
|
+
callback(mapToError(error), null);
|
|
1066
|
+
}
|
|
1067
|
+
};
|
|
1068
|
+
const wrapStreaming = async (call, parser, handler, converter) => {
|
|
1069
|
+
try {
|
|
1070
|
+
const context = await buildContext(call, options.userBuilder);
|
|
1071
|
+
const params = parser(call.request);
|
|
1072
|
+
const stream = await handler(params, context);
|
|
1073
|
+
const metadata = buildMetadata(context);
|
|
1074
|
+
call.sendMetadata(metadata);
|
|
1075
|
+
for await (const responsePart of stream) {
|
|
1076
|
+
const response = converter(responsePart);
|
|
1077
|
+
call.write(response);
|
|
1078
|
+
}
|
|
1079
|
+
} catch (error) {
|
|
1080
|
+
call.emit("error", mapToError(error));
|
|
1081
|
+
} finally {
|
|
1082
|
+
call.end();
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
return {
|
|
1086
|
+
sendMessage(call, callback) {
|
|
1087
|
+
return wrapUnary(
|
|
1088
|
+
call,
|
|
1089
|
+
callback,
|
|
1090
|
+
FromProto.messageSendParams,
|
|
1091
|
+
requestHandler.sendMessage.bind(requestHandler),
|
|
1092
|
+
ToProto.messageSendResult
|
|
1093
|
+
);
|
|
1094
|
+
},
|
|
1095
|
+
sendStreamingMessage(call) {
|
|
1096
|
+
return wrapStreaming(
|
|
1097
|
+
call,
|
|
1098
|
+
FromProto.messageSendParams,
|
|
1099
|
+
requestHandler.sendMessageStream.bind(requestHandler),
|
|
1100
|
+
ToProto.messageStreamResult
|
|
1101
|
+
);
|
|
1102
|
+
},
|
|
1103
|
+
taskSubscription(call) {
|
|
1104
|
+
return wrapStreaming(
|
|
1105
|
+
call,
|
|
1106
|
+
FromProto.taskIdParams,
|
|
1107
|
+
requestHandler.resubscribe.bind(requestHandler),
|
|
1108
|
+
ToProto.messageStreamResult
|
|
1109
|
+
);
|
|
1110
|
+
},
|
|
1111
|
+
deleteTaskPushNotificationConfig(call, callback) {
|
|
1112
|
+
return wrapUnary(
|
|
1113
|
+
call,
|
|
1114
|
+
callback,
|
|
1115
|
+
FromProto.deleteTaskPushNotificationConfigParams,
|
|
1116
|
+
requestHandler.deleteTaskPushNotificationConfig.bind(requestHandler),
|
|
1117
|
+
() => ({})
|
|
1118
|
+
);
|
|
1119
|
+
},
|
|
1120
|
+
listTaskPushNotificationConfig(call, callback) {
|
|
1121
|
+
return wrapUnary(
|
|
1122
|
+
call,
|
|
1123
|
+
callback,
|
|
1124
|
+
FromProto.listTaskPushNotificationConfigParams,
|
|
1125
|
+
requestHandler.listTaskPushNotificationConfigs.bind(requestHandler),
|
|
1126
|
+
ToProto.listTaskPushNotificationConfig
|
|
1127
|
+
);
|
|
1128
|
+
},
|
|
1129
|
+
createTaskPushNotificationConfig(call, callback) {
|
|
1130
|
+
return wrapUnary(
|
|
1131
|
+
call,
|
|
1132
|
+
callback,
|
|
1133
|
+
FromProto.createTaskPushNotificationConfig,
|
|
1134
|
+
requestHandler.setTaskPushNotificationConfig.bind(requestHandler),
|
|
1135
|
+
ToProto.taskPushNotificationConfig
|
|
1136
|
+
);
|
|
1137
|
+
},
|
|
1138
|
+
getTaskPushNotificationConfig(call, callback) {
|
|
1139
|
+
return wrapUnary(
|
|
1140
|
+
call,
|
|
1141
|
+
callback,
|
|
1142
|
+
FromProto.getTaskPushNotificationConfigParams,
|
|
1143
|
+
requestHandler.getTaskPushNotificationConfig.bind(requestHandler),
|
|
1144
|
+
ToProto.taskPushNotificationConfig
|
|
1145
|
+
);
|
|
1146
|
+
},
|
|
1147
|
+
getTask(call, callback) {
|
|
1148
|
+
return wrapUnary(
|
|
1149
|
+
call,
|
|
1150
|
+
callback,
|
|
1151
|
+
FromProto.taskQueryParams,
|
|
1152
|
+
requestHandler.getTask.bind(requestHandler),
|
|
1153
|
+
ToProto.task
|
|
1154
|
+
);
|
|
1155
|
+
},
|
|
1156
|
+
cancelTask(call, callback) {
|
|
1157
|
+
return wrapUnary(
|
|
1158
|
+
call,
|
|
1159
|
+
callback,
|
|
1160
|
+
FromProto.taskIdParams,
|
|
1161
|
+
requestHandler.cancelTask.bind(requestHandler),
|
|
1162
|
+
ToProto.task
|
|
1163
|
+
);
|
|
1164
|
+
},
|
|
1165
|
+
getAgentCard(call, callback) {
|
|
1166
|
+
return wrapUnary(
|
|
1167
|
+
call,
|
|
1168
|
+
callback,
|
|
1169
|
+
() => ({}),
|
|
1170
|
+
(_params, context) => requestHandler.getAuthenticatedExtendedAgentCard(context),
|
|
1171
|
+
ToProto.agentCard
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
var mapping = {
|
|
1177
|
+
[-32001]: grpc.status.NOT_FOUND,
|
|
1178
|
+
[-32002]: grpc.status.FAILED_PRECONDITION,
|
|
1179
|
+
[-32003]: grpc.status.UNIMPLEMENTED,
|
|
1180
|
+
[-32004]: grpc.status.UNIMPLEMENTED,
|
|
1181
|
+
[-32005]: grpc.status.INVALID_ARGUMENT,
|
|
1182
|
+
[-32006]: grpc.status.INTERNAL,
|
|
1183
|
+
[-32007]: grpc.status.FAILED_PRECONDITION,
|
|
1184
|
+
[-32600]: grpc.status.INVALID_ARGUMENT,
|
|
1185
|
+
[-32602]: grpc.status.INVALID_ARGUMENT,
|
|
1186
|
+
[-32603]: grpc.status.INTERNAL
|
|
1187
|
+
};
|
|
1188
|
+
var mapToError = (error) => {
|
|
1189
|
+
const a2aError = error instanceof A2AError ? error : A2AError.internalError(error instanceof Error ? error.message : "Internal server error");
|
|
1190
|
+
return {
|
|
1191
|
+
code: mapping[a2aError.code] ?? grpc.status.UNKNOWN,
|
|
1192
|
+
details: a2aError.message
|
|
1193
|
+
};
|
|
1194
|
+
};
|
|
1195
|
+
var buildContext = async (call, userBuilder) => {
|
|
1196
|
+
const user = await userBuilder(call);
|
|
1197
|
+
const extensionHeaders = call.metadata.get(HTTP_EXTENSION_HEADER);
|
|
1198
|
+
const extensionString = extensionHeaders.map((v) => v.toString()).join(",");
|
|
1199
|
+
return new ServerCallContext(Extensions.parseServiceParameter(extensionString), user);
|
|
1200
|
+
};
|
|
1201
|
+
var buildMetadata = (context) => {
|
|
1202
|
+
const metadata = new grpc.Metadata();
|
|
1203
|
+
if (context.activatedExtensions?.length) {
|
|
1204
|
+
metadata.set(HTTP_EXTENSION_HEADER, context.activatedExtensions.join(","));
|
|
1205
|
+
}
|
|
1206
|
+
return metadata;
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
// src/grpc/pb/a2a_services.ts
|
|
1210
|
+
var import_wire4 = require("@bufbuild/protobuf/wire");
|
|
1211
|
+
var import_grpc_js = require("@grpc/grpc-js");
|
|
1212
|
+
|
|
1213
|
+
// src/grpc/pb/google/protobuf/empty.ts
|
|
1214
|
+
var import_wire = require("@bufbuild/protobuf/wire");
|
|
1215
|
+
function createBaseEmpty() {
|
|
1216
|
+
return {};
|
|
1217
|
+
}
|
|
1218
|
+
var Empty = {
|
|
1219
|
+
encode(_, writer = new import_wire.BinaryWriter()) {
|
|
1220
|
+
return writer;
|
|
1221
|
+
},
|
|
1222
|
+
decode(input, length) {
|
|
1223
|
+
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
|
|
1224
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1225
|
+
const message = createBaseEmpty();
|
|
1226
|
+
while (reader.pos < end) {
|
|
1227
|
+
const tag = reader.uint32();
|
|
1228
|
+
switch (tag >>> 3) {
|
|
1229
|
+
}
|
|
1230
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1231
|
+
break;
|
|
1232
|
+
}
|
|
1233
|
+
reader.skip(tag & 7);
|
|
1234
|
+
}
|
|
1235
|
+
return message;
|
|
1236
|
+
}
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
// src/grpc/pb/google/protobuf/struct.ts
|
|
1240
|
+
var import_wire2 = require("@bufbuild/protobuf/wire");
|
|
1241
|
+
function createBaseStruct() {
|
|
1242
|
+
return { fields: {} };
|
|
1243
|
+
}
|
|
1244
|
+
var Struct = {
|
|
1245
|
+
encode(message, writer = new import_wire2.BinaryWriter()) {
|
|
1246
|
+
Object.entries(message.fields).forEach(([key, value]) => {
|
|
1247
|
+
if (value !== void 0) {
|
|
1248
|
+
Struct_FieldsEntry.encode({ key, value }, writer.uint32(10).fork()).join();
|
|
1249
|
+
}
|
|
1250
|
+
});
|
|
1251
|
+
return writer;
|
|
1252
|
+
},
|
|
1253
|
+
decode(input, length) {
|
|
1254
|
+
const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
|
|
1255
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1256
|
+
const message = createBaseStruct();
|
|
1257
|
+
while (reader.pos < end) {
|
|
1258
|
+
const tag = reader.uint32();
|
|
1259
|
+
switch (tag >>> 3) {
|
|
1260
|
+
case 1: {
|
|
1261
|
+
if (tag !== 10) {
|
|
1262
|
+
break;
|
|
1263
|
+
}
|
|
1264
|
+
const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32());
|
|
1265
|
+
if (entry1.value !== void 0) {
|
|
1266
|
+
message.fields[entry1.key] = entry1.value;
|
|
1267
|
+
}
|
|
1268
|
+
continue;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1272
|
+
break;
|
|
1273
|
+
}
|
|
1274
|
+
reader.skip(tag & 7);
|
|
1275
|
+
}
|
|
1276
|
+
return message;
|
|
1277
|
+
},
|
|
1278
|
+
wrap(object) {
|
|
1279
|
+
const struct = createBaseStruct();
|
|
1280
|
+
if (object !== void 0) {
|
|
1281
|
+
for (const key of Object.keys(object)) {
|
|
1282
|
+
struct.fields[key] = object[key];
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
return struct;
|
|
1286
|
+
},
|
|
1287
|
+
unwrap(message) {
|
|
1288
|
+
const object = {};
|
|
1289
|
+
if (message.fields) {
|
|
1290
|
+
for (const key of Object.keys(message.fields)) {
|
|
1291
|
+
object[key] = message.fields[key];
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
return object;
|
|
1295
|
+
}
|
|
1296
|
+
};
|
|
1297
|
+
function createBaseStruct_FieldsEntry() {
|
|
1298
|
+
return { key: "", value: void 0 };
|
|
1299
|
+
}
|
|
1300
|
+
var Struct_FieldsEntry = {
|
|
1301
|
+
encode(message, writer = new import_wire2.BinaryWriter()) {
|
|
1302
|
+
if (message.key !== "") {
|
|
1303
|
+
writer.uint32(10).string(message.key);
|
|
1304
|
+
}
|
|
1305
|
+
if (message.value !== void 0) {
|
|
1306
|
+
Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join();
|
|
1307
|
+
}
|
|
1308
|
+
return writer;
|
|
1309
|
+
},
|
|
1310
|
+
decode(input, length) {
|
|
1311
|
+
const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
|
|
1312
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1313
|
+
const message = createBaseStruct_FieldsEntry();
|
|
1314
|
+
while (reader.pos < end) {
|
|
1315
|
+
const tag = reader.uint32();
|
|
1316
|
+
switch (tag >>> 3) {
|
|
1317
|
+
case 1: {
|
|
1318
|
+
if (tag !== 10) {
|
|
1319
|
+
break;
|
|
1320
|
+
}
|
|
1321
|
+
message.key = reader.string();
|
|
1322
|
+
continue;
|
|
1323
|
+
}
|
|
1324
|
+
case 2: {
|
|
1325
|
+
if (tag !== 18) {
|
|
1326
|
+
break;
|
|
1327
|
+
}
|
|
1328
|
+
message.value = Value.unwrap(Value.decode(reader, reader.uint32()));
|
|
1329
|
+
continue;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
reader.skip(tag & 7);
|
|
1336
|
+
}
|
|
1337
|
+
return message;
|
|
1338
|
+
}
|
|
1339
|
+
};
|
|
1340
|
+
function createBaseValue() {
|
|
1341
|
+
return { kind: void 0 };
|
|
1342
|
+
}
|
|
1343
|
+
var Value = {
|
|
1344
|
+
encode(message, writer = new import_wire2.BinaryWriter()) {
|
|
1345
|
+
switch (message.kind?.$case) {
|
|
1346
|
+
case "nullValue":
|
|
1347
|
+
writer.uint32(8).int32(message.kind.value);
|
|
1348
|
+
break;
|
|
1349
|
+
case "numberValue":
|
|
1350
|
+
writer.uint32(17).double(message.kind.value);
|
|
1351
|
+
break;
|
|
1352
|
+
case "stringValue":
|
|
1353
|
+
writer.uint32(26).string(message.kind.value);
|
|
1354
|
+
break;
|
|
1355
|
+
case "boolValue":
|
|
1356
|
+
writer.uint32(32).bool(message.kind.value);
|
|
1357
|
+
break;
|
|
1358
|
+
case "structValue":
|
|
1359
|
+
Struct.encode(Struct.wrap(message.kind.value), writer.uint32(42).fork()).join();
|
|
1360
|
+
break;
|
|
1361
|
+
case "listValue":
|
|
1362
|
+
ListValue.encode(ListValue.wrap(message.kind.value), writer.uint32(50).fork()).join();
|
|
1363
|
+
break;
|
|
1364
|
+
}
|
|
1365
|
+
return writer;
|
|
1366
|
+
},
|
|
1367
|
+
decode(input, length) {
|
|
1368
|
+
const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
|
|
1369
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1370
|
+
const message = createBaseValue();
|
|
1371
|
+
while (reader.pos < end) {
|
|
1372
|
+
const tag = reader.uint32();
|
|
1373
|
+
switch (tag >>> 3) {
|
|
1374
|
+
case 1: {
|
|
1375
|
+
if (tag !== 8) {
|
|
1376
|
+
break;
|
|
1377
|
+
}
|
|
1378
|
+
message.kind = { $case: "nullValue", value: reader.int32() };
|
|
1379
|
+
continue;
|
|
1380
|
+
}
|
|
1381
|
+
case 2: {
|
|
1382
|
+
if (tag !== 17) {
|
|
1383
|
+
break;
|
|
1384
|
+
}
|
|
1385
|
+
message.kind = { $case: "numberValue", value: reader.double() };
|
|
1386
|
+
continue;
|
|
1387
|
+
}
|
|
1388
|
+
case 3: {
|
|
1389
|
+
if (tag !== 26) {
|
|
1390
|
+
break;
|
|
1391
|
+
}
|
|
1392
|
+
message.kind = { $case: "stringValue", value: reader.string() };
|
|
1393
|
+
continue;
|
|
1394
|
+
}
|
|
1395
|
+
case 4: {
|
|
1396
|
+
if (tag !== 32) {
|
|
1397
|
+
break;
|
|
1398
|
+
}
|
|
1399
|
+
message.kind = { $case: "boolValue", value: reader.bool() };
|
|
1400
|
+
continue;
|
|
1401
|
+
}
|
|
1402
|
+
case 5: {
|
|
1403
|
+
if (tag !== 42) {
|
|
1404
|
+
break;
|
|
1405
|
+
}
|
|
1406
|
+
message.kind = { $case: "structValue", value: Struct.unwrap(Struct.decode(reader, reader.uint32())) };
|
|
1407
|
+
continue;
|
|
1408
|
+
}
|
|
1409
|
+
case 6: {
|
|
1410
|
+
if (tag !== 50) {
|
|
1411
|
+
break;
|
|
1412
|
+
}
|
|
1413
|
+
message.kind = { $case: "listValue", value: ListValue.unwrap(ListValue.decode(reader, reader.uint32())) };
|
|
1414
|
+
continue;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1418
|
+
break;
|
|
1419
|
+
}
|
|
1420
|
+
reader.skip(tag & 7);
|
|
1421
|
+
}
|
|
1422
|
+
return message;
|
|
1423
|
+
},
|
|
1424
|
+
wrap(value) {
|
|
1425
|
+
const result = createBaseValue();
|
|
1426
|
+
if (value === null) {
|
|
1427
|
+
result.kind = { $case: "nullValue", value };
|
|
1428
|
+
} else if (typeof value === "boolean") {
|
|
1429
|
+
result.kind = { $case: "boolValue", value };
|
|
1430
|
+
} else if (typeof value === "number") {
|
|
1431
|
+
result.kind = { $case: "numberValue", value };
|
|
1432
|
+
} else if (typeof value === "string") {
|
|
1433
|
+
result.kind = { $case: "stringValue", value };
|
|
1434
|
+
} else if (globalThis.Array.isArray(value)) {
|
|
1435
|
+
result.kind = { $case: "listValue", value };
|
|
1436
|
+
} else if (typeof value === "object") {
|
|
1437
|
+
result.kind = { $case: "structValue", value };
|
|
1438
|
+
} else if (typeof value !== "undefined") {
|
|
1439
|
+
throw new globalThis.Error("Unsupported any value type: " + typeof value);
|
|
1440
|
+
}
|
|
1441
|
+
return result;
|
|
1442
|
+
},
|
|
1443
|
+
unwrap(message) {
|
|
1444
|
+
return message.kind?.value;
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
function createBaseListValue() {
|
|
1448
|
+
return { values: [] };
|
|
1449
|
+
}
|
|
1450
|
+
var ListValue = {
|
|
1451
|
+
encode(message, writer = new import_wire2.BinaryWriter()) {
|
|
1452
|
+
for (const v of message.values) {
|
|
1453
|
+
Value.encode(Value.wrap(v), writer.uint32(10).fork()).join();
|
|
1454
|
+
}
|
|
1455
|
+
return writer;
|
|
1456
|
+
},
|
|
1457
|
+
decode(input, length) {
|
|
1458
|
+
const reader = input instanceof import_wire2.BinaryReader ? input : new import_wire2.BinaryReader(input);
|
|
1459
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1460
|
+
const message = createBaseListValue();
|
|
1461
|
+
while (reader.pos < end) {
|
|
1462
|
+
const tag = reader.uint32();
|
|
1463
|
+
switch (tag >>> 3) {
|
|
1464
|
+
case 1: {
|
|
1465
|
+
if (tag !== 10) {
|
|
1466
|
+
break;
|
|
1467
|
+
}
|
|
1468
|
+
message.values.push(Value.unwrap(Value.decode(reader, reader.uint32())));
|
|
1469
|
+
continue;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1473
|
+
break;
|
|
1474
|
+
}
|
|
1475
|
+
reader.skip(tag & 7);
|
|
1476
|
+
}
|
|
1477
|
+
return message;
|
|
1478
|
+
},
|
|
1479
|
+
wrap(array) {
|
|
1480
|
+
const result = createBaseListValue();
|
|
1481
|
+
result.values = array ?? [];
|
|
1482
|
+
return result;
|
|
1483
|
+
},
|
|
1484
|
+
unwrap(message) {
|
|
1485
|
+
if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) {
|
|
1486
|
+
return message.values;
|
|
1487
|
+
} else {
|
|
1488
|
+
return message;
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
};
|
|
1492
|
+
|
|
1493
|
+
// src/grpc/pb/google/protobuf/timestamp.ts
|
|
1494
|
+
var import_wire3 = require("@bufbuild/protobuf/wire");
|
|
1495
|
+
function createBaseTimestamp() {
|
|
1496
|
+
return { seconds: 0, nanos: 0 };
|
|
1497
|
+
}
|
|
1498
|
+
var Timestamp = {
|
|
1499
|
+
encode(message, writer = new import_wire3.BinaryWriter()) {
|
|
1500
|
+
if (message.seconds !== 0) {
|
|
1501
|
+
writer.uint32(8).int64(message.seconds);
|
|
1502
|
+
}
|
|
1503
|
+
if (message.nanos !== 0) {
|
|
1504
|
+
writer.uint32(16).int32(message.nanos);
|
|
1505
|
+
}
|
|
1506
|
+
return writer;
|
|
1507
|
+
},
|
|
1508
|
+
decode(input, length) {
|
|
1509
|
+
const reader = input instanceof import_wire3.BinaryReader ? input : new import_wire3.BinaryReader(input);
|
|
1510
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1511
|
+
const message = createBaseTimestamp();
|
|
1512
|
+
while (reader.pos < end) {
|
|
1513
|
+
const tag = reader.uint32();
|
|
1514
|
+
switch (tag >>> 3) {
|
|
1515
|
+
case 1: {
|
|
1516
|
+
if (tag !== 8) {
|
|
1517
|
+
break;
|
|
1518
|
+
}
|
|
1519
|
+
message.seconds = longToNumber(reader.int64());
|
|
1520
|
+
continue;
|
|
1521
|
+
}
|
|
1522
|
+
case 2: {
|
|
1523
|
+
if (tag !== 16) {
|
|
1524
|
+
break;
|
|
1525
|
+
}
|
|
1526
|
+
message.nanos = reader.int32();
|
|
1527
|
+
continue;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1531
|
+
break;
|
|
1532
|
+
}
|
|
1533
|
+
reader.skip(tag & 7);
|
|
1534
|
+
}
|
|
1535
|
+
return message;
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1538
|
+
function longToNumber(int64) {
|
|
1539
|
+
const num = globalThis.Number(int64.toString());
|
|
1540
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
1541
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
1542
|
+
}
|
|
1543
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
1544
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
1545
|
+
}
|
|
1546
|
+
return num;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
// src/grpc/pb/a2a_services.ts
|
|
1550
|
+
function createBaseSendMessageConfiguration() {
|
|
1551
|
+
return { acceptedOutputModes: [], pushNotification: void 0, historyLength: 0, blocking: false };
|
|
1552
|
+
}
|
|
1553
|
+
var SendMessageConfiguration3 = {
|
|
1554
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1555
|
+
for (const v of message.acceptedOutputModes) {
|
|
1556
|
+
writer.uint32(10).string(v);
|
|
1557
|
+
}
|
|
1558
|
+
if (message.pushNotification !== void 0) {
|
|
1559
|
+
PushNotificationConfig3.encode(message.pushNotification, writer.uint32(18).fork()).join();
|
|
1560
|
+
}
|
|
1561
|
+
if (message.historyLength !== 0) {
|
|
1562
|
+
writer.uint32(24).int32(message.historyLength);
|
|
1563
|
+
}
|
|
1564
|
+
if (message.blocking !== false) {
|
|
1565
|
+
writer.uint32(32).bool(message.blocking);
|
|
1566
|
+
}
|
|
1567
|
+
return writer;
|
|
1568
|
+
},
|
|
1569
|
+
decode(input, length) {
|
|
1570
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
1571
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1572
|
+
const message = createBaseSendMessageConfiguration();
|
|
1573
|
+
while (reader.pos < end) {
|
|
1574
|
+
const tag = reader.uint32();
|
|
1575
|
+
switch (tag >>> 3) {
|
|
1576
|
+
case 1: {
|
|
1577
|
+
if (tag !== 10) {
|
|
1578
|
+
break;
|
|
1579
|
+
}
|
|
1580
|
+
message.acceptedOutputModes.push(reader.string());
|
|
1581
|
+
continue;
|
|
1582
|
+
}
|
|
1583
|
+
case 2: {
|
|
1584
|
+
if (tag !== 18) {
|
|
1585
|
+
break;
|
|
1586
|
+
}
|
|
1587
|
+
message.pushNotification = PushNotificationConfig3.decode(reader, reader.uint32());
|
|
1588
|
+
continue;
|
|
1589
|
+
}
|
|
1590
|
+
case 3: {
|
|
1591
|
+
if (tag !== 24) {
|
|
1592
|
+
break;
|
|
1593
|
+
}
|
|
1594
|
+
message.historyLength = reader.int32();
|
|
1595
|
+
continue;
|
|
1596
|
+
}
|
|
1597
|
+
case 4: {
|
|
1598
|
+
if (tag !== 32) {
|
|
1599
|
+
break;
|
|
1600
|
+
}
|
|
1601
|
+
message.blocking = reader.bool();
|
|
1602
|
+
continue;
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1606
|
+
break;
|
|
1607
|
+
}
|
|
1608
|
+
reader.skip(tag & 7);
|
|
1609
|
+
}
|
|
1610
|
+
return message;
|
|
1611
|
+
}
|
|
1612
|
+
};
|
|
1613
|
+
function createBaseTask() {
|
|
1614
|
+
return { id: "", contextId: "", status: void 0, artifacts: [], history: [], metadata: void 0 };
|
|
1615
|
+
}
|
|
1616
|
+
var Task3 = {
|
|
1617
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1618
|
+
if (message.id !== "") {
|
|
1619
|
+
writer.uint32(10).string(message.id);
|
|
1620
|
+
}
|
|
1621
|
+
if (message.contextId !== "") {
|
|
1622
|
+
writer.uint32(18).string(message.contextId);
|
|
1623
|
+
}
|
|
1624
|
+
if (message.status !== void 0) {
|
|
1625
|
+
TaskStatus3.encode(message.status, writer.uint32(26).fork()).join();
|
|
1626
|
+
}
|
|
1627
|
+
for (const v of message.artifacts) {
|
|
1628
|
+
Artifact3.encode(v, writer.uint32(34).fork()).join();
|
|
1629
|
+
}
|
|
1630
|
+
for (const v of message.history) {
|
|
1631
|
+
Message3.encode(v, writer.uint32(42).fork()).join();
|
|
1632
|
+
}
|
|
1633
|
+
if (message.metadata !== void 0) {
|
|
1634
|
+
Struct.encode(Struct.wrap(message.metadata), writer.uint32(50).fork()).join();
|
|
1635
|
+
}
|
|
1636
|
+
return writer;
|
|
1637
|
+
},
|
|
1638
|
+
decode(input, length) {
|
|
1639
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
1640
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1641
|
+
const message = createBaseTask();
|
|
1642
|
+
while (reader.pos < end) {
|
|
1643
|
+
const tag = reader.uint32();
|
|
1644
|
+
switch (tag >>> 3) {
|
|
1645
|
+
case 1: {
|
|
1646
|
+
if (tag !== 10) {
|
|
1647
|
+
break;
|
|
1648
|
+
}
|
|
1649
|
+
message.id = reader.string();
|
|
1650
|
+
continue;
|
|
1651
|
+
}
|
|
1652
|
+
case 2: {
|
|
1653
|
+
if (tag !== 18) {
|
|
1654
|
+
break;
|
|
1655
|
+
}
|
|
1656
|
+
message.contextId = reader.string();
|
|
1657
|
+
continue;
|
|
1658
|
+
}
|
|
1659
|
+
case 3: {
|
|
1660
|
+
if (tag !== 26) {
|
|
1661
|
+
break;
|
|
1662
|
+
}
|
|
1663
|
+
message.status = TaskStatus3.decode(reader, reader.uint32());
|
|
1664
|
+
continue;
|
|
1665
|
+
}
|
|
1666
|
+
case 4: {
|
|
1667
|
+
if (tag !== 34) {
|
|
1668
|
+
break;
|
|
1669
|
+
}
|
|
1670
|
+
message.artifacts.push(Artifact3.decode(reader, reader.uint32()));
|
|
1671
|
+
continue;
|
|
1672
|
+
}
|
|
1673
|
+
case 5: {
|
|
1674
|
+
if (tag !== 42) {
|
|
1675
|
+
break;
|
|
1676
|
+
}
|
|
1677
|
+
message.history.push(Message3.decode(reader, reader.uint32()));
|
|
1678
|
+
continue;
|
|
1679
|
+
}
|
|
1680
|
+
case 6: {
|
|
1681
|
+
if (tag !== 50) {
|
|
1682
|
+
break;
|
|
1683
|
+
}
|
|
1684
|
+
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
1685
|
+
continue;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1689
|
+
break;
|
|
1690
|
+
}
|
|
1691
|
+
reader.skip(tag & 7);
|
|
1692
|
+
}
|
|
1693
|
+
return message;
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
function createBaseTaskStatus() {
|
|
1697
|
+
return { state: 0, update: void 0, timestamp: void 0 };
|
|
1698
|
+
}
|
|
1699
|
+
var TaskStatus3 = {
|
|
1700
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1701
|
+
if (message.state !== 0) {
|
|
1702
|
+
writer.uint32(8).int32(message.state);
|
|
1703
|
+
}
|
|
1704
|
+
if (message.update !== void 0) {
|
|
1705
|
+
Message3.encode(message.update, writer.uint32(18).fork()).join();
|
|
1706
|
+
}
|
|
1707
|
+
if (message.timestamp !== void 0) {
|
|
1708
|
+
Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(26).fork()).join();
|
|
1709
|
+
}
|
|
1710
|
+
return writer;
|
|
1711
|
+
},
|
|
1712
|
+
decode(input, length) {
|
|
1713
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
1714
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1715
|
+
const message = createBaseTaskStatus();
|
|
1716
|
+
while (reader.pos < end) {
|
|
1717
|
+
const tag = reader.uint32();
|
|
1718
|
+
switch (tag >>> 3) {
|
|
1719
|
+
case 1: {
|
|
1720
|
+
if (tag !== 8) {
|
|
1721
|
+
break;
|
|
1722
|
+
}
|
|
1723
|
+
message.state = reader.int32();
|
|
1724
|
+
continue;
|
|
1725
|
+
}
|
|
1726
|
+
case 2: {
|
|
1727
|
+
if (tag !== 18) {
|
|
1728
|
+
break;
|
|
1729
|
+
}
|
|
1730
|
+
message.update = Message3.decode(reader, reader.uint32());
|
|
1731
|
+
continue;
|
|
1732
|
+
}
|
|
1733
|
+
case 3: {
|
|
1734
|
+
if (tag !== 26) {
|
|
1735
|
+
break;
|
|
1736
|
+
}
|
|
1737
|
+
message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1738
|
+
continue;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1742
|
+
break;
|
|
1743
|
+
}
|
|
1744
|
+
reader.skip(tag & 7);
|
|
1745
|
+
}
|
|
1746
|
+
return message;
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
function createBasePart() {
|
|
1750
|
+
return { part: void 0 };
|
|
1751
|
+
}
|
|
1752
|
+
var Part3 = {
|
|
1753
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1754
|
+
switch (message.part?.$case) {
|
|
1755
|
+
case "text":
|
|
1756
|
+
writer.uint32(10).string(message.part.value);
|
|
1757
|
+
break;
|
|
1758
|
+
case "file":
|
|
1759
|
+
FilePart.encode(message.part.value, writer.uint32(18).fork()).join();
|
|
1760
|
+
break;
|
|
1761
|
+
case "data":
|
|
1762
|
+
DataPart.encode(message.part.value, writer.uint32(26).fork()).join();
|
|
1763
|
+
break;
|
|
1764
|
+
}
|
|
1765
|
+
return writer;
|
|
1766
|
+
},
|
|
1767
|
+
decode(input, length) {
|
|
1768
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
1769
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1770
|
+
const message = createBasePart();
|
|
1771
|
+
while (reader.pos < end) {
|
|
1772
|
+
const tag = reader.uint32();
|
|
1773
|
+
switch (tag >>> 3) {
|
|
1774
|
+
case 1: {
|
|
1775
|
+
if (tag !== 10) {
|
|
1776
|
+
break;
|
|
1777
|
+
}
|
|
1778
|
+
message.part = { $case: "text", value: reader.string() };
|
|
1779
|
+
continue;
|
|
1780
|
+
}
|
|
1781
|
+
case 2: {
|
|
1782
|
+
if (tag !== 18) {
|
|
1783
|
+
break;
|
|
1784
|
+
}
|
|
1785
|
+
message.part = { $case: "file", value: FilePart.decode(reader, reader.uint32()) };
|
|
1786
|
+
continue;
|
|
1787
|
+
}
|
|
1788
|
+
case 3: {
|
|
1789
|
+
if (tag !== 26) {
|
|
1790
|
+
break;
|
|
1791
|
+
}
|
|
1792
|
+
message.part = { $case: "data", value: DataPart.decode(reader, reader.uint32()) };
|
|
1793
|
+
continue;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1797
|
+
break;
|
|
1798
|
+
}
|
|
1799
|
+
reader.skip(tag & 7);
|
|
1800
|
+
}
|
|
1801
|
+
return message;
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1804
|
+
function createBaseFilePart() {
|
|
1805
|
+
return { file: void 0, mimeType: "" };
|
|
1806
|
+
}
|
|
1807
|
+
var FilePart = {
|
|
1808
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1809
|
+
switch (message.file?.$case) {
|
|
1810
|
+
case "fileWithUri":
|
|
1811
|
+
writer.uint32(10).string(message.file.value);
|
|
1812
|
+
break;
|
|
1813
|
+
case "fileWithBytes":
|
|
1814
|
+
writer.uint32(18).bytes(message.file.value);
|
|
1815
|
+
break;
|
|
1816
|
+
}
|
|
1817
|
+
if (message.mimeType !== "") {
|
|
1818
|
+
writer.uint32(26).string(message.mimeType);
|
|
1819
|
+
}
|
|
1820
|
+
return writer;
|
|
1821
|
+
},
|
|
1822
|
+
decode(input, length) {
|
|
1823
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
1824
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1825
|
+
const message = createBaseFilePart();
|
|
1826
|
+
while (reader.pos < end) {
|
|
1827
|
+
const tag = reader.uint32();
|
|
1828
|
+
switch (tag >>> 3) {
|
|
1829
|
+
case 1: {
|
|
1830
|
+
if (tag !== 10) {
|
|
1831
|
+
break;
|
|
1832
|
+
}
|
|
1833
|
+
message.file = { $case: "fileWithUri", value: reader.string() };
|
|
1834
|
+
continue;
|
|
1835
|
+
}
|
|
1836
|
+
case 2: {
|
|
1837
|
+
if (tag !== 18) {
|
|
1838
|
+
break;
|
|
1839
|
+
}
|
|
1840
|
+
message.file = { $case: "fileWithBytes", value: Buffer.from(reader.bytes()) };
|
|
1841
|
+
continue;
|
|
1842
|
+
}
|
|
1843
|
+
case 3: {
|
|
1844
|
+
if (tag !== 26) {
|
|
1845
|
+
break;
|
|
1846
|
+
}
|
|
1847
|
+
message.mimeType = reader.string();
|
|
1848
|
+
continue;
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1852
|
+
break;
|
|
1853
|
+
}
|
|
1854
|
+
reader.skip(tag & 7);
|
|
1855
|
+
}
|
|
1856
|
+
return message;
|
|
1857
|
+
}
|
|
1858
|
+
};
|
|
1859
|
+
function createBaseDataPart() {
|
|
1860
|
+
return { data: void 0 };
|
|
1861
|
+
}
|
|
1862
|
+
var DataPart = {
|
|
1863
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1864
|
+
if (message.data !== void 0) {
|
|
1865
|
+
Struct.encode(Struct.wrap(message.data), writer.uint32(10).fork()).join();
|
|
1866
|
+
}
|
|
1867
|
+
return writer;
|
|
1868
|
+
},
|
|
1869
|
+
decode(input, length) {
|
|
1870
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
1871
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1872
|
+
const message = createBaseDataPart();
|
|
1873
|
+
while (reader.pos < end) {
|
|
1874
|
+
const tag = reader.uint32();
|
|
1875
|
+
switch (tag >>> 3) {
|
|
1876
|
+
case 1: {
|
|
1877
|
+
if (tag !== 10) {
|
|
1878
|
+
break;
|
|
1879
|
+
}
|
|
1880
|
+
message.data = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
1881
|
+
continue;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1885
|
+
break;
|
|
1886
|
+
}
|
|
1887
|
+
reader.skip(tag & 7);
|
|
1888
|
+
}
|
|
1889
|
+
return message;
|
|
1890
|
+
}
|
|
1891
|
+
};
|
|
1892
|
+
function createBaseMessage() {
|
|
1893
|
+
return { messageId: "", contextId: "", taskId: "", role: 0, content: [], metadata: void 0, extensions: [] };
|
|
1894
|
+
}
|
|
1895
|
+
var Message3 = {
|
|
1896
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1897
|
+
if (message.messageId !== "") {
|
|
1898
|
+
writer.uint32(10).string(message.messageId);
|
|
1899
|
+
}
|
|
1900
|
+
if (message.contextId !== "") {
|
|
1901
|
+
writer.uint32(18).string(message.contextId);
|
|
1902
|
+
}
|
|
1903
|
+
if (message.taskId !== "") {
|
|
1904
|
+
writer.uint32(26).string(message.taskId);
|
|
1905
|
+
}
|
|
1906
|
+
if (message.role !== 0) {
|
|
1907
|
+
writer.uint32(32).int32(message.role);
|
|
1908
|
+
}
|
|
1909
|
+
for (const v of message.content) {
|
|
1910
|
+
Part3.encode(v, writer.uint32(42).fork()).join();
|
|
1911
|
+
}
|
|
1912
|
+
if (message.metadata !== void 0) {
|
|
1913
|
+
Struct.encode(Struct.wrap(message.metadata), writer.uint32(50).fork()).join();
|
|
1914
|
+
}
|
|
1915
|
+
for (const v of message.extensions) {
|
|
1916
|
+
writer.uint32(58).string(v);
|
|
1917
|
+
}
|
|
1918
|
+
return writer;
|
|
1919
|
+
},
|
|
1920
|
+
decode(input, length) {
|
|
1921
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
1922
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1923
|
+
const message = createBaseMessage();
|
|
1924
|
+
while (reader.pos < end) {
|
|
1925
|
+
const tag = reader.uint32();
|
|
1926
|
+
switch (tag >>> 3) {
|
|
1927
|
+
case 1: {
|
|
1928
|
+
if (tag !== 10) {
|
|
1929
|
+
break;
|
|
1930
|
+
}
|
|
1931
|
+
message.messageId = reader.string();
|
|
1932
|
+
continue;
|
|
1933
|
+
}
|
|
1934
|
+
case 2: {
|
|
1935
|
+
if (tag !== 18) {
|
|
1936
|
+
break;
|
|
1937
|
+
}
|
|
1938
|
+
message.contextId = reader.string();
|
|
1939
|
+
continue;
|
|
1940
|
+
}
|
|
1941
|
+
case 3: {
|
|
1942
|
+
if (tag !== 26) {
|
|
1943
|
+
break;
|
|
1944
|
+
}
|
|
1945
|
+
message.taskId = reader.string();
|
|
1946
|
+
continue;
|
|
1947
|
+
}
|
|
1948
|
+
case 4: {
|
|
1949
|
+
if (tag !== 32) {
|
|
1950
|
+
break;
|
|
1951
|
+
}
|
|
1952
|
+
message.role = reader.int32();
|
|
1953
|
+
continue;
|
|
1954
|
+
}
|
|
1955
|
+
case 5: {
|
|
1956
|
+
if (tag !== 42) {
|
|
1957
|
+
break;
|
|
1958
|
+
}
|
|
1959
|
+
message.content.push(Part3.decode(reader, reader.uint32()));
|
|
1960
|
+
continue;
|
|
1961
|
+
}
|
|
1962
|
+
case 6: {
|
|
1963
|
+
if (tag !== 50) {
|
|
1964
|
+
break;
|
|
1965
|
+
}
|
|
1966
|
+
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
1967
|
+
continue;
|
|
1968
|
+
}
|
|
1969
|
+
case 7: {
|
|
1970
|
+
if (tag !== 58) {
|
|
1971
|
+
break;
|
|
1972
|
+
}
|
|
1973
|
+
message.extensions.push(reader.string());
|
|
1974
|
+
continue;
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1978
|
+
break;
|
|
1979
|
+
}
|
|
1980
|
+
reader.skip(tag & 7);
|
|
1981
|
+
}
|
|
1982
|
+
return message;
|
|
1983
|
+
}
|
|
1984
|
+
};
|
|
1985
|
+
function createBaseArtifact() {
|
|
1986
|
+
return { artifactId: "", name: "", description: "", parts: [], metadata: void 0, extensions: [] };
|
|
1987
|
+
}
|
|
1988
|
+
var Artifact3 = {
|
|
1989
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
1990
|
+
if (message.artifactId !== "") {
|
|
1991
|
+
writer.uint32(10).string(message.artifactId);
|
|
1992
|
+
}
|
|
1993
|
+
if (message.name !== "") {
|
|
1994
|
+
writer.uint32(26).string(message.name);
|
|
1995
|
+
}
|
|
1996
|
+
if (message.description !== "") {
|
|
1997
|
+
writer.uint32(34).string(message.description);
|
|
1998
|
+
}
|
|
1999
|
+
for (const v of message.parts) {
|
|
2000
|
+
Part3.encode(v, writer.uint32(42).fork()).join();
|
|
2001
|
+
}
|
|
2002
|
+
if (message.metadata !== void 0) {
|
|
2003
|
+
Struct.encode(Struct.wrap(message.metadata), writer.uint32(50).fork()).join();
|
|
2004
|
+
}
|
|
2005
|
+
for (const v of message.extensions) {
|
|
2006
|
+
writer.uint32(58).string(v);
|
|
2007
|
+
}
|
|
2008
|
+
return writer;
|
|
2009
|
+
},
|
|
2010
|
+
decode(input, length) {
|
|
2011
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2012
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2013
|
+
const message = createBaseArtifact();
|
|
2014
|
+
while (reader.pos < end) {
|
|
2015
|
+
const tag = reader.uint32();
|
|
2016
|
+
switch (tag >>> 3) {
|
|
2017
|
+
case 1: {
|
|
2018
|
+
if (tag !== 10) {
|
|
2019
|
+
break;
|
|
2020
|
+
}
|
|
2021
|
+
message.artifactId = reader.string();
|
|
2022
|
+
continue;
|
|
2023
|
+
}
|
|
2024
|
+
case 3: {
|
|
2025
|
+
if (tag !== 26) {
|
|
2026
|
+
break;
|
|
2027
|
+
}
|
|
2028
|
+
message.name = reader.string();
|
|
2029
|
+
continue;
|
|
2030
|
+
}
|
|
2031
|
+
case 4: {
|
|
2032
|
+
if (tag !== 34) {
|
|
2033
|
+
break;
|
|
2034
|
+
}
|
|
2035
|
+
message.description = reader.string();
|
|
2036
|
+
continue;
|
|
2037
|
+
}
|
|
2038
|
+
case 5: {
|
|
2039
|
+
if (tag !== 42) {
|
|
2040
|
+
break;
|
|
2041
|
+
}
|
|
2042
|
+
message.parts.push(Part3.decode(reader, reader.uint32()));
|
|
2043
|
+
continue;
|
|
2044
|
+
}
|
|
2045
|
+
case 6: {
|
|
2046
|
+
if (tag !== 50) {
|
|
2047
|
+
break;
|
|
2048
|
+
}
|
|
2049
|
+
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2050
|
+
continue;
|
|
2051
|
+
}
|
|
2052
|
+
case 7: {
|
|
2053
|
+
if (tag !== 58) {
|
|
2054
|
+
break;
|
|
2055
|
+
}
|
|
2056
|
+
message.extensions.push(reader.string());
|
|
2057
|
+
continue;
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2061
|
+
break;
|
|
2062
|
+
}
|
|
2063
|
+
reader.skip(tag & 7);
|
|
2064
|
+
}
|
|
2065
|
+
return message;
|
|
2066
|
+
}
|
|
2067
|
+
};
|
|
2068
|
+
function createBaseTaskStatusUpdateEvent() {
|
|
2069
|
+
return { taskId: "", contextId: "", status: void 0, final: false, metadata: void 0 };
|
|
2070
|
+
}
|
|
2071
|
+
var TaskStatusUpdateEvent3 = {
|
|
2072
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2073
|
+
if (message.taskId !== "") {
|
|
2074
|
+
writer.uint32(10).string(message.taskId);
|
|
2075
|
+
}
|
|
2076
|
+
if (message.contextId !== "") {
|
|
2077
|
+
writer.uint32(18).string(message.contextId);
|
|
2078
|
+
}
|
|
2079
|
+
if (message.status !== void 0) {
|
|
2080
|
+
TaskStatus3.encode(message.status, writer.uint32(26).fork()).join();
|
|
2081
|
+
}
|
|
2082
|
+
if (message.final !== false) {
|
|
2083
|
+
writer.uint32(32).bool(message.final);
|
|
2084
|
+
}
|
|
2085
|
+
if (message.metadata !== void 0) {
|
|
2086
|
+
Struct.encode(Struct.wrap(message.metadata), writer.uint32(42).fork()).join();
|
|
2087
|
+
}
|
|
2088
|
+
return writer;
|
|
2089
|
+
},
|
|
2090
|
+
decode(input, length) {
|
|
2091
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2092
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2093
|
+
const message = createBaseTaskStatusUpdateEvent();
|
|
2094
|
+
while (reader.pos < end) {
|
|
2095
|
+
const tag = reader.uint32();
|
|
2096
|
+
switch (tag >>> 3) {
|
|
2097
|
+
case 1: {
|
|
2098
|
+
if (tag !== 10) {
|
|
2099
|
+
break;
|
|
2100
|
+
}
|
|
2101
|
+
message.taskId = reader.string();
|
|
2102
|
+
continue;
|
|
2103
|
+
}
|
|
2104
|
+
case 2: {
|
|
2105
|
+
if (tag !== 18) {
|
|
2106
|
+
break;
|
|
2107
|
+
}
|
|
2108
|
+
message.contextId = reader.string();
|
|
2109
|
+
continue;
|
|
2110
|
+
}
|
|
2111
|
+
case 3: {
|
|
2112
|
+
if (tag !== 26) {
|
|
2113
|
+
break;
|
|
2114
|
+
}
|
|
2115
|
+
message.status = TaskStatus3.decode(reader, reader.uint32());
|
|
2116
|
+
continue;
|
|
2117
|
+
}
|
|
2118
|
+
case 4: {
|
|
2119
|
+
if (tag !== 32) {
|
|
2120
|
+
break;
|
|
2121
|
+
}
|
|
2122
|
+
message.final = reader.bool();
|
|
2123
|
+
continue;
|
|
2124
|
+
}
|
|
2125
|
+
case 5: {
|
|
2126
|
+
if (tag !== 42) {
|
|
2127
|
+
break;
|
|
2128
|
+
}
|
|
2129
|
+
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2130
|
+
continue;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2134
|
+
break;
|
|
2135
|
+
}
|
|
2136
|
+
reader.skip(tag & 7);
|
|
2137
|
+
}
|
|
2138
|
+
return message;
|
|
2139
|
+
}
|
|
2140
|
+
};
|
|
2141
|
+
function createBaseTaskArtifactUpdateEvent() {
|
|
2142
|
+
return { taskId: "", contextId: "", artifact: void 0, append: false, lastChunk: false, metadata: void 0 };
|
|
2143
|
+
}
|
|
2144
|
+
var TaskArtifactUpdateEvent3 = {
|
|
2145
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2146
|
+
if (message.taskId !== "") {
|
|
2147
|
+
writer.uint32(10).string(message.taskId);
|
|
2148
|
+
}
|
|
2149
|
+
if (message.contextId !== "") {
|
|
2150
|
+
writer.uint32(18).string(message.contextId);
|
|
2151
|
+
}
|
|
2152
|
+
if (message.artifact !== void 0) {
|
|
2153
|
+
Artifact3.encode(message.artifact, writer.uint32(26).fork()).join();
|
|
2154
|
+
}
|
|
2155
|
+
if (message.append !== false) {
|
|
2156
|
+
writer.uint32(32).bool(message.append);
|
|
2157
|
+
}
|
|
2158
|
+
if (message.lastChunk !== false) {
|
|
2159
|
+
writer.uint32(40).bool(message.lastChunk);
|
|
2160
|
+
}
|
|
2161
|
+
if (message.metadata !== void 0) {
|
|
2162
|
+
Struct.encode(Struct.wrap(message.metadata), writer.uint32(50).fork()).join();
|
|
2163
|
+
}
|
|
2164
|
+
return writer;
|
|
2165
|
+
},
|
|
2166
|
+
decode(input, length) {
|
|
2167
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2168
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2169
|
+
const message = createBaseTaskArtifactUpdateEvent();
|
|
2170
|
+
while (reader.pos < end) {
|
|
2171
|
+
const tag = reader.uint32();
|
|
2172
|
+
switch (tag >>> 3) {
|
|
2173
|
+
case 1: {
|
|
2174
|
+
if (tag !== 10) {
|
|
2175
|
+
break;
|
|
2176
|
+
}
|
|
2177
|
+
message.taskId = reader.string();
|
|
2178
|
+
continue;
|
|
2179
|
+
}
|
|
2180
|
+
case 2: {
|
|
2181
|
+
if (tag !== 18) {
|
|
2182
|
+
break;
|
|
2183
|
+
}
|
|
2184
|
+
message.contextId = reader.string();
|
|
2185
|
+
continue;
|
|
2186
|
+
}
|
|
2187
|
+
case 3: {
|
|
2188
|
+
if (tag !== 26) {
|
|
2189
|
+
break;
|
|
2190
|
+
}
|
|
2191
|
+
message.artifact = Artifact3.decode(reader, reader.uint32());
|
|
2192
|
+
continue;
|
|
2193
|
+
}
|
|
2194
|
+
case 4: {
|
|
2195
|
+
if (tag !== 32) {
|
|
2196
|
+
break;
|
|
2197
|
+
}
|
|
2198
|
+
message.append = reader.bool();
|
|
2199
|
+
continue;
|
|
2200
|
+
}
|
|
2201
|
+
case 5: {
|
|
2202
|
+
if (tag !== 40) {
|
|
2203
|
+
break;
|
|
2204
|
+
}
|
|
2205
|
+
message.lastChunk = reader.bool();
|
|
2206
|
+
continue;
|
|
2207
|
+
}
|
|
2208
|
+
case 6: {
|
|
2209
|
+
if (tag !== 50) {
|
|
2210
|
+
break;
|
|
2211
|
+
}
|
|
2212
|
+
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2213
|
+
continue;
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2217
|
+
break;
|
|
2218
|
+
}
|
|
2219
|
+
reader.skip(tag & 7);
|
|
2220
|
+
}
|
|
2221
|
+
return message;
|
|
2222
|
+
}
|
|
2223
|
+
};
|
|
2224
|
+
function createBasePushNotificationConfig() {
|
|
2225
|
+
return { id: "", url: "", token: "", authentication: void 0 };
|
|
2226
|
+
}
|
|
2227
|
+
var PushNotificationConfig3 = {
|
|
2228
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2229
|
+
if (message.id !== "") {
|
|
2230
|
+
writer.uint32(10).string(message.id);
|
|
2231
|
+
}
|
|
2232
|
+
if (message.url !== "") {
|
|
2233
|
+
writer.uint32(18).string(message.url);
|
|
2234
|
+
}
|
|
2235
|
+
if (message.token !== "") {
|
|
2236
|
+
writer.uint32(26).string(message.token);
|
|
2237
|
+
}
|
|
2238
|
+
if (message.authentication !== void 0) {
|
|
2239
|
+
AuthenticationInfo3.encode(message.authentication, writer.uint32(34).fork()).join();
|
|
2240
|
+
}
|
|
2241
|
+
return writer;
|
|
2242
|
+
},
|
|
2243
|
+
decode(input, length) {
|
|
2244
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2245
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2246
|
+
const message = createBasePushNotificationConfig();
|
|
2247
|
+
while (reader.pos < end) {
|
|
2248
|
+
const tag = reader.uint32();
|
|
2249
|
+
switch (tag >>> 3) {
|
|
2250
|
+
case 1: {
|
|
2251
|
+
if (tag !== 10) {
|
|
2252
|
+
break;
|
|
2253
|
+
}
|
|
2254
|
+
message.id = reader.string();
|
|
2255
|
+
continue;
|
|
2256
|
+
}
|
|
2257
|
+
case 2: {
|
|
2258
|
+
if (tag !== 18) {
|
|
2259
|
+
break;
|
|
2260
|
+
}
|
|
2261
|
+
message.url = reader.string();
|
|
2262
|
+
continue;
|
|
2263
|
+
}
|
|
2264
|
+
case 3: {
|
|
2265
|
+
if (tag !== 26) {
|
|
2266
|
+
break;
|
|
2267
|
+
}
|
|
2268
|
+
message.token = reader.string();
|
|
2269
|
+
continue;
|
|
2270
|
+
}
|
|
2271
|
+
case 4: {
|
|
2272
|
+
if (tag !== 34) {
|
|
2273
|
+
break;
|
|
2274
|
+
}
|
|
2275
|
+
message.authentication = AuthenticationInfo3.decode(reader, reader.uint32());
|
|
2276
|
+
continue;
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2280
|
+
break;
|
|
2281
|
+
}
|
|
2282
|
+
reader.skip(tag & 7);
|
|
2283
|
+
}
|
|
2284
|
+
return message;
|
|
2285
|
+
}
|
|
2286
|
+
};
|
|
2287
|
+
function createBaseAuthenticationInfo() {
|
|
2288
|
+
return { schemes: [], credentials: "" };
|
|
2289
|
+
}
|
|
2290
|
+
var AuthenticationInfo3 = {
|
|
2291
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2292
|
+
for (const v of message.schemes) {
|
|
2293
|
+
writer.uint32(10).string(v);
|
|
2294
|
+
}
|
|
2295
|
+
if (message.credentials !== "") {
|
|
2296
|
+
writer.uint32(18).string(message.credentials);
|
|
2297
|
+
}
|
|
2298
|
+
return writer;
|
|
2299
|
+
},
|
|
2300
|
+
decode(input, length) {
|
|
2301
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2302
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2303
|
+
const message = createBaseAuthenticationInfo();
|
|
2304
|
+
while (reader.pos < end) {
|
|
2305
|
+
const tag = reader.uint32();
|
|
2306
|
+
switch (tag >>> 3) {
|
|
2307
|
+
case 1: {
|
|
2308
|
+
if (tag !== 10) {
|
|
2309
|
+
break;
|
|
2310
|
+
}
|
|
2311
|
+
message.schemes.push(reader.string());
|
|
2312
|
+
continue;
|
|
2313
|
+
}
|
|
2314
|
+
case 2: {
|
|
2315
|
+
if (tag !== 18) {
|
|
2316
|
+
break;
|
|
2317
|
+
}
|
|
2318
|
+
message.credentials = reader.string();
|
|
2319
|
+
continue;
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2323
|
+
break;
|
|
2324
|
+
}
|
|
2325
|
+
reader.skip(tag & 7);
|
|
2326
|
+
}
|
|
2327
|
+
return message;
|
|
2328
|
+
}
|
|
2329
|
+
};
|
|
2330
|
+
function createBaseAgentInterface() {
|
|
2331
|
+
return { url: "", transport: "" };
|
|
2332
|
+
}
|
|
2333
|
+
var AgentInterface3 = {
|
|
2334
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2335
|
+
if (message.url !== "") {
|
|
2336
|
+
writer.uint32(10).string(message.url);
|
|
2337
|
+
}
|
|
2338
|
+
if (message.transport !== "") {
|
|
2339
|
+
writer.uint32(18).string(message.transport);
|
|
2340
|
+
}
|
|
2341
|
+
return writer;
|
|
2342
|
+
},
|
|
2343
|
+
decode(input, length) {
|
|
2344
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2345
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2346
|
+
const message = createBaseAgentInterface();
|
|
2347
|
+
while (reader.pos < end) {
|
|
2348
|
+
const tag = reader.uint32();
|
|
2349
|
+
switch (tag >>> 3) {
|
|
2350
|
+
case 1: {
|
|
2351
|
+
if (tag !== 10) {
|
|
2352
|
+
break;
|
|
2353
|
+
}
|
|
2354
|
+
message.url = reader.string();
|
|
2355
|
+
continue;
|
|
2356
|
+
}
|
|
2357
|
+
case 2: {
|
|
2358
|
+
if (tag !== 18) {
|
|
2359
|
+
break;
|
|
2360
|
+
}
|
|
2361
|
+
message.transport = reader.string();
|
|
2362
|
+
continue;
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2366
|
+
break;
|
|
2367
|
+
}
|
|
2368
|
+
reader.skip(tag & 7);
|
|
2369
|
+
}
|
|
2370
|
+
return message;
|
|
2371
|
+
}
|
|
2372
|
+
};
|
|
2373
|
+
function createBaseAgentCard() {
|
|
2374
|
+
return {
|
|
2375
|
+
protocolVersion: "",
|
|
2376
|
+
name: "",
|
|
2377
|
+
description: "",
|
|
2378
|
+
url: "",
|
|
2379
|
+
preferredTransport: "",
|
|
2380
|
+
additionalInterfaces: [],
|
|
2381
|
+
provider: void 0,
|
|
2382
|
+
version: "",
|
|
2383
|
+
documentationUrl: "",
|
|
2384
|
+
capabilities: void 0,
|
|
2385
|
+
securitySchemes: {},
|
|
2386
|
+
security: [],
|
|
2387
|
+
defaultInputModes: [],
|
|
2388
|
+
defaultOutputModes: [],
|
|
2389
|
+
skills: [],
|
|
2390
|
+
supportsAuthenticatedExtendedCard: false,
|
|
2391
|
+
signatures: []
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
var AgentCard3 = {
|
|
2395
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2396
|
+
if (message.protocolVersion !== "") {
|
|
2397
|
+
writer.uint32(130).string(message.protocolVersion);
|
|
2398
|
+
}
|
|
2399
|
+
if (message.name !== "") {
|
|
2400
|
+
writer.uint32(10).string(message.name);
|
|
2401
|
+
}
|
|
2402
|
+
if (message.description !== "") {
|
|
2403
|
+
writer.uint32(18).string(message.description);
|
|
2404
|
+
}
|
|
2405
|
+
if (message.url !== "") {
|
|
2406
|
+
writer.uint32(26).string(message.url);
|
|
2407
|
+
}
|
|
2408
|
+
if (message.preferredTransport !== "") {
|
|
2409
|
+
writer.uint32(114).string(message.preferredTransport);
|
|
2410
|
+
}
|
|
2411
|
+
for (const v of message.additionalInterfaces) {
|
|
2412
|
+
AgentInterface3.encode(v, writer.uint32(122).fork()).join();
|
|
2413
|
+
}
|
|
2414
|
+
if (message.provider !== void 0) {
|
|
2415
|
+
AgentProvider3.encode(message.provider, writer.uint32(34).fork()).join();
|
|
2416
|
+
}
|
|
2417
|
+
if (message.version !== "") {
|
|
2418
|
+
writer.uint32(42).string(message.version);
|
|
2419
|
+
}
|
|
2420
|
+
if (message.documentationUrl !== "") {
|
|
2421
|
+
writer.uint32(50).string(message.documentationUrl);
|
|
2422
|
+
}
|
|
2423
|
+
if (message.capabilities !== void 0) {
|
|
2424
|
+
AgentCapabilities3.encode(message.capabilities, writer.uint32(58).fork()).join();
|
|
2425
|
+
}
|
|
2426
|
+
Object.entries(message.securitySchemes).forEach(([key, value]) => {
|
|
2427
|
+
AgentCard_SecuritySchemesEntry.encode({ key, value }, writer.uint32(66).fork()).join();
|
|
2428
|
+
});
|
|
2429
|
+
for (const v of message.security) {
|
|
2430
|
+
Security3.encode(v, writer.uint32(74).fork()).join();
|
|
2431
|
+
}
|
|
2432
|
+
for (const v of message.defaultInputModes) {
|
|
2433
|
+
writer.uint32(82).string(v);
|
|
2434
|
+
}
|
|
2435
|
+
for (const v of message.defaultOutputModes) {
|
|
2436
|
+
writer.uint32(90).string(v);
|
|
2437
|
+
}
|
|
2438
|
+
for (const v of message.skills) {
|
|
2439
|
+
AgentSkill3.encode(v, writer.uint32(98).fork()).join();
|
|
2440
|
+
}
|
|
2441
|
+
if (message.supportsAuthenticatedExtendedCard !== false) {
|
|
2442
|
+
writer.uint32(104).bool(message.supportsAuthenticatedExtendedCard);
|
|
2443
|
+
}
|
|
2444
|
+
for (const v of message.signatures) {
|
|
2445
|
+
AgentCardSignature3.encode(v, writer.uint32(138).fork()).join();
|
|
2446
|
+
}
|
|
2447
|
+
return writer;
|
|
2448
|
+
},
|
|
2449
|
+
decode(input, length) {
|
|
2450
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2451
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2452
|
+
const message = createBaseAgentCard();
|
|
2453
|
+
while (reader.pos < end) {
|
|
2454
|
+
const tag = reader.uint32();
|
|
2455
|
+
switch (tag >>> 3) {
|
|
2456
|
+
case 16: {
|
|
2457
|
+
if (tag !== 130) {
|
|
2458
|
+
break;
|
|
2459
|
+
}
|
|
2460
|
+
message.protocolVersion = reader.string();
|
|
2461
|
+
continue;
|
|
2462
|
+
}
|
|
2463
|
+
case 1: {
|
|
2464
|
+
if (tag !== 10) {
|
|
2465
|
+
break;
|
|
2466
|
+
}
|
|
2467
|
+
message.name = reader.string();
|
|
2468
|
+
continue;
|
|
2469
|
+
}
|
|
2470
|
+
case 2: {
|
|
2471
|
+
if (tag !== 18) {
|
|
2472
|
+
break;
|
|
2473
|
+
}
|
|
2474
|
+
message.description = reader.string();
|
|
2475
|
+
continue;
|
|
2476
|
+
}
|
|
2477
|
+
case 3: {
|
|
2478
|
+
if (tag !== 26) {
|
|
2479
|
+
break;
|
|
2480
|
+
}
|
|
2481
|
+
message.url = reader.string();
|
|
2482
|
+
continue;
|
|
2483
|
+
}
|
|
2484
|
+
case 14: {
|
|
2485
|
+
if (tag !== 114) {
|
|
2486
|
+
break;
|
|
2487
|
+
}
|
|
2488
|
+
message.preferredTransport = reader.string();
|
|
2489
|
+
continue;
|
|
2490
|
+
}
|
|
2491
|
+
case 15: {
|
|
2492
|
+
if (tag !== 122) {
|
|
2493
|
+
break;
|
|
2494
|
+
}
|
|
2495
|
+
message.additionalInterfaces.push(AgentInterface3.decode(reader, reader.uint32()));
|
|
2496
|
+
continue;
|
|
2497
|
+
}
|
|
2498
|
+
case 4: {
|
|
2499
|
+
if (tag !== 34) {
|
|
2500
|
+
break;
|
|
2501
|
+
}
|
|
2502
|
+
message.provider = AgentProvider3.decode(reader, reader.uint32());
|
|
2503
|
+
continue;
|
|
2504
|
+
}
|
|
2505
|
+
case 5: {
|
|
2506
|
+
if (tag !== 42) {
|
|
2507
|
+
break;
|
|
2508
|
+
}
|
|
2509
|
+
message.version = reader.string();
|
|
2510
|
+
continue;
|
|
2511
|
+
}
|
|
2512
|
+
case 6: {
|
|
2513
|
+
if (tag !== 50) {
|
|
2514
|
+
break;
|
|
2515
|
+
}
|
|
2516
|
+
message.documentationUrl = reader.string();
|
|
2517
|
+
continue;
|
|
2518
|
+
}
|
|
2519
|
+
case 7: {
|
|
2520
|
+
if (tag !== 58) {
|
|
2521
|
+
break;
|
|
2522
|
+
}
|
|
2523
|
+
message.capabilities = AgentCapabilities3.decode(reader, reader.uint32());
|
|
2524
|
+
continue;
|
|
2525
|
+
}
|
|
2526
|
+
case 8: {
|
|
2527
|
+
if (tag !== 66) {
|
|
2528
|
+
break;
|
|
2529
|
+
}
|
|
2530
|
+
const entry8 = AgentCard_SecuritySchemesEntry.decode(reader, reader.uint32());
|
|
2531
|
+
if (entry8.value !== void 0) {
|
|
2532
|
+
message.securitySchemes[entry8.key] = entry8.value;
|
|
2533
|
+
}
|
|
2534
|
+
continue;
|
|
2535
|
+
}
|
|
2536
|
+
case 9: {
|
|
2537
|
+
if (tag !== 74) {
|
|
2538
|
+
break;
|
|
2539
|
+
}
|
|
2540
|
+
message.security.push(Security3.decode(reader, reader.uint32()));
|
|
2541
|
+
continue;
|
|
2542
|
+
}
|
|
2543
|
+
case 10: {
|
|
2544
|
+
if (tag !== 82) {
|
|
2545
|
+
break;
|
|
2546
|
+
}
|
|
2547
|
+
message.defaultInputModes.push(reader.string());
|
|
2548
|
+
continue;
|
|
2549
|
+
}
|
|
2550
|
+
case 11: {
|
|
2551
|
+
if (tag !== 90) {
|
|
2552
|
+
break;
|
|
2553
|
+
}
|
|
2554
|
+
message.defaultOutputModes.push(reader.string());
|
|
2555
|
+
continue;
|
|
2556
|
+
}
|
|
2557
|
+
case 12: {
|
|
2558
|
+
if (tag !== 98) {
|
|
2559
|
+
break;
|
|
2560
|
+
}
|
|
2561
|
+
message.skills.push(AgentSkill3.decode(reader, reader.uint32()));
|
|
2562
|
+
continue;
|
|
2563
|
+
}
|
|
2564
|
+
case 13: {
|
|
2565
|
+
if (tag !== 104) {
|
|
2566
|
+
break;
|
|
2567
|
+
}
|
|
2568
|
+
message.supportsAuthenticatedExtendedCard = reader.bool();
|
|
2569
|
+
continue;
|
|
2570
|
+
}
|
|
2571
|
+
case 17: {
|
|
2572
|
+
if (tag !== 138) {
|
|
2573
|
+
break;
|
|
2574
|
+
}
|
|
2575
|
+
message.signatures.push(AgentCardSignature3.decode(reader, reader.uint32()));
|
|
2576
|
+
continue;
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2579
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2580
|
+
break;
|
|
2581
|
+
}
|
|
2582
|
+
reader.skip(tag & 7);
|
|
2583
|
+
}
|
|
2584
|
+
return message;
|
|
2585
|
+
}
|
|
2586
|
+
};
|
|
2587
|
+
function createBaseAgentCard_SecuritySchemesEntry() {
|
|
2588
|
+
return { key: "", value: void 0 };
|
|
2589
|
+
}
|
|
2590
|
+
var AgentCard_SecuritySchemesEntry = {
|
|
2591
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2592
|
+
if (message.key !== "") {
|
|
2593
|
+
writer.uint32(10).string(message.key);
|
|
2594
|
+
}
|
|
2595
|
+
if (message.value !== void 0) {
|
|
2596
|
+
SecurityScheme3.encode(message.value, writer.uint32(18).fork()).join();
|
|
2597
|
+
}
|
|
2598
|
+
return writer;
|
|
2599
|
+
},
|
|
2600
|
+
decode(input, length) {
|
|
2601
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2602
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2603
|
+
const message = createBaseAgentCard_SecuritySchemesEntry();
|
|
2604
|
+
while (reader.pos < end) {
|
|
2605
|
+
const tag = reader.uint32();
|
|
2606
|
+
switch (tag >>> 3) {
|
|
2607
|
+
case 1: {
|
|
2608
|
+
if (tag !== 10) {
|
|
2609
|
+
break;
|
|
2610
|
+
}
|
|
2611
|
+
message.key = reader.string();
|
|
2612
|
+
continue;
|
|
2613
|
+
}
|
|
2614
|
+
case 2: {
|
|
2615
|
+
if (tag !== 18) {
|
|
2616
|
+
break;
|
|
2617
|
+
}
|
|
2618
|
+
message.value = SecurityScheme3.decode(reader, reader.uint32());
|
|
2619
|
+
continue;
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2623
|
+
break;
|
|
2624
|
+
}
|
|
2625
|
+
reader.skip(tag & 7);
|
|
2626
|
+
}
|
|
2627
|
+
return message;
|
|
2628
|
+
}
|
|
2629
|
+
};
|
|
2630
|
+
function createBaseAgentProvider() {
|
|
2631
|
+
return { url: "", organization: "" };
|
|
2632
|
+
}
|
|
2633
|
+
var AgentProvider3 = {
|
|
2634
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2635
|
+
if (message.url !== "") {
|
|
2636
|
+
writer.uint32(10).string(message.url);
|
|
2637
|
+
}
|
|
2638
|
+
if (message.organization !== "") {
|
|
2639
|
+
writer.uint32(18).string(message.organization);
|
|
2640
|
+
}
|
|
2641
|
+
return writer;
|
|
2642
|
+
},
|
|
2643
|
+
decode(input, length) {
|
|
2644
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2645
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2646
|
+
const message = createBaseAgentProvider();
|
|
2647
|
+
while (reader.pos < end) {
|
|
2648
|
+
const tag = reader.uint32();
|
|
2649
|
+
switch (tag >>> 3) {
|
|
2650
|
+
case 1: {
|
|
2651
|
+
if (tag !== 10) {
|
|
2652
|
+
break;
|
|
2653
|
+
}
|
|
2654
|
+
message.url = reader.string();
|
|
2655
|
+
continue;
|
|
2656
|
+
}
|
|
2657
|
+
case 2: {
|
|
2658
|
+
if (tag !== 18) {
|
|
2659
|
+
break;
|
|
2660
|
+
}
|
|
2661
|
+
message.organization = reader.string();
|
|
2662
|
+
continue;
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2666
|
+
break;
|
|
2667
|
+
}
|
|
2668
|
+
reader.skip(tag & 7);
|
|
2669
|
+
}
|
|
2670
|
+
return message;
|
|
2671
|
+
}
|
|
2672
|
+
};
|
|
2673
|
+
function createBaseAgentCapabilities() {
|
|
2674
|
+
return { streaming: false, pushNotifications: false, extensions: [] };
|
|
2675
|
+
}
|
|
2676
|
+
var AgentCapabilities3 = {
|
|
2677
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2678
|
+
if (message.streaming !== false) {
|
|
2679
|
+
writer.uint32(8).bool(message.streaming);
|
|
2680
|
+
}
|
|
2681
|
+
if (message.pushNotifications !== false) {
|
|
2682
|
+
writer.uint32(16).bool(message.pushNotifications);
|
|
2683
|
+
}
|
|
2684
|
+
for (const v of message.extensions) {
|
|
2685
|
+
AgentExtension3.encode(v, writer.uint32(26).fork()).join();
|
|
2686
|
+
}
|
|
2687
|
+
return writer;
|
|
2688
|
+
},
|
|
2689
|
+
decode(input, length) {
|
|
2690
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2691
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2692
|
+
const message = createBaseAgentCapabilities();
|
|
2693
|
+
while (reader.pos < end) {
|
|
2694
|
+
const tag = reader.uint32();
|
|
2695
|
+
switch (tag >>> 3) {
|
|
2696
|
+
case 1: {
|
|
2697
|
+
if (tag !== 8) {
|
|
2698
|
+
break;
|
|
2699
|
+
}
|
|
2700
|
+
message.streaming = reader.bool();
|
|
2701
|
+
continue;
|
|
2702
|
+
}
|
|
2703
|
+
case 2: {
|
|
2704
|
+
if (tag !== 16) {
|
|
2705
|
+
break;
|
|
2706
|
+
}
|
|
2707
|
+
message.pushNotifications = reader.bool();
|
|
2708
|
+
continue;
|
|
2709
|
+
}
|
|
2710
|
+
case 3: {
|
|
2711
|
+
if (tag !== 26) {
|
|
2712
|
+
break;
|
|
2713
|
+
}
|
|
2714
|
+
message.extensions.push(AgentExtension3.decode(reader, reader.uint32()));
|
|
2715
|
+
continue;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2719
|
+
break;
|
|
2720
|
+
}
|
|
2721
|
+
reader.skip(tag & 7);
|
|
2722
|
+
}
|
|
2723
|
+
return message;
|
|
2724
|
+
}
|
|
2725
|
+
};
|
|
2726
|
+
function createBaseAgentExtension() {
|
|
2727
|
+
return { uri: "", description: "", required: false, params: void 0 };
|
|
2728
|
+
}
|
|
2729
|
+
var AgentExtension3 = {
|
|
2730
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2731
|
+
if (message.uri !== "") {
|
|
2732
|
+
writer.uint32(10).string(message.uri);
|
|
2733
|
+
}
|
|
2734
|
+
if (message.description !== "") {
|
|
2735
|
+
writer.uint32(18).string(message.description);
|
|
2736
|
+
}
|
|
2737
|
+
if (message.required !== false) {
|
|
2738
|
+
writer.uint32(24).bool(message.required);
|
|
2739
|
+
}
|
|
2740
|
+
if (message.params !== void 0) {
|
|
2741
|
+
Struct.encode(Struct.wrap(message.params), writer.uint32(34).fork()).join();
|
|
2742
|
+
}
|
|
2743
|
+
return writer;
|
|
2744
|
+
},
|
|
2745
|
+
decode(input, length) {
|
|
2746
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2747
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2748
|
+
const message = createBaseAgentExtension();
|
|
2749
|
+
while (reader.pos < end) {
|
|
2750
|
+
const tag = reader.uint32();
|
|
2751
|
+
switch (tag >>> 3) {
|
|
2752
|
+
case 1: {
|
|
2753
|
+
if (tag !== 10) {
|
|
2754
|
+
break;
|
|
2755
|
+
}
|
|
2756
|
+
message.uri = reader.string();
|
|
2757
|
+
continue;
|
|
2758
|
+
}
|
|
2759
|
+
case 2: {
|
|
2760
|
+
if (tag !== 18) {
|
|
2761
|
+
break;
|
|
2762
|
+
}
|
|
2763
|
+
message.description = reader.string();
|
|
2764
|
+
continue;
|
|
2765
|
+
}
|
|
2766
|
+
case 3: {
|
|
2767
|
+
if (tag !== 24) {
|
|
2768
|
+
break;
|
|
2769
|
+
}
|
|
2770
|
+
message.required = reader.bool();
|
|
2771
|
+
continue;
|
|
2772
|
+
}
|
|
2773
|
+
case 4: {
|
|
2774
|
+
if (tag !== 34) {
|
|
2775
|
+
break;
|
|
2776
|
+
}
|
|
2777
|
+
message.params = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2778
|
+
continue;
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2782
|
+
break;
|
|
2783
|
+
}
|
|
2784
|
+
reader.skip(tag & 7);
|
|
2785
|
+
}
|
|
2786
|
+
return message;
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
function createBaseAgentSkill() {
|
|
2790
|
+
return { id: "", name: "", description: "", tags: [], examples: [], inputModes: [], outputModes: [], security: [] };
|
|
2791
|
+
}
|
|
2792
|
+
var AgentSkill3 = {
|
|
2793
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2794
|
+
if (message.id !== "") {
|
|
2795
|
+
writer.uint32(10).string(message.id);
|
|
2796
|
+
}
|
|
2797
|
+
if (message.name !== "") {
|
|
2798
|
+
writer.uint32(18).string(message.name);
|
|
2799
|
+
}
|
|
2800
|
+
if (message.description !== "") {
|
|
2801
|
+
writer.uint32(26).string(message.description);
|
|
2802
|
+
}
|
|
2803
|
+
for (const v of message.tags) {
|
|
2804
|
+
writer.uint32(34).string(v);
|
|
2805
|
+
}
|
|
2806
|
+
for (const v of message.examples) {
|
|
2807
|
+
writer.uint32(42).string(v);
|
|
2808
|
+
}
|
|
2809
|
+
for (const v of message.inputModes) {
|
|
2810
|
+
writer.uint32(50).string(v);
|
|
2811
|
+
}
|
|
2812
|
+
for (const v of message.outputModes) {
|
|
2813
|
+
writer.uint32(58).string(v);
|
|
2814
|
+
}
|
|
2815
|
+
for (const v of message.security) {
|
|
2816
|
+
Security3.encode(v, writer.uint32(66).fork()).join();
|
|
2817
|
+
}
|
|
2818
|
+
return writer;
|
|
2819
|
+
},
|
|
2820
|
+
decode(input, length) {
|
|
2821
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2822
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2823
|
+
const message = createBaseAgentSkill();
|
|
2824
|
+
while (reader.pos < end) {
|
|
2825
|
+
const tag = reader.uint32();
|
|
2826
|
+
switch (tag >>> 3) {
|
|
2827
|
+
case 1: {
|
|
2828
|
+
if (tag !== 10) {
|
|
2829
|
+
break;
|
|
2830
|
+
}
|
|
2831
|
+
message.id = reader.string();
|
|
2832
|
+
continue;
|
|
2833
|
+
}
|
|
2834
|
+
case 2: {
|
|
2835
|
+
if (tag !== 18) {
|
|
2836
|
+
break;
|
|
2837
|
+
}
|
|
2838
|
+
message.name = reader.string();
|
|
2839
|
+
continue;
|
|
2840
|
+
}
|
|
2841
|
+
case 3: {
|
|
2842
|
+
if (tag !== 26) {
|
|
2843
|
+
break;
|
|
2844
|
+
}
|
|
2845
|
+
message.description = reader.string();
|
|
2846
|
+
continue;
|
|
2847
|
+
}
|
|
2848
|
+
case 4: {
|
|
2849
|
+
if (tag !== 34) {
|
|
2850
|
+
break;
|
|
2851
|
+
}
|
|
2852
|
+
message.tags.push(reader.string());
|
|
2853
|
+
continue;
|
|
2854
|
+
}
|
|
2855
|
+
case 5: {
|
|
2856
|
+
if (tag !== 42) {
|
|
2857
|
+
break;
|
|
2858
|
+
}
|
|
2859
|
+
message.examples.push(reader.string());
|
|
2860
|
+
continue;
|
|
2861
|
+
}
|
|
2862
|
+
case 6: {
|
|
2863
|
+
if (tag !== 50) {
|
|
2864
|
+
break;
|
|
2865
|
+
}
|
|
2866
|
+
message.inputModes.push(reader.string());
|
|
2867
|
+
continue;
|
|
2868
|
+
}
|
|
2869
|
+
case 7: {
|
|
2870
|
+
if (tag !== 58) {
|
|
2871
|
+
break;
|
|
2872
|
+
}
|
|
2873
|
+
message.outputModes.push(reader.string());
|
|
2874
|
+
continue;
|
|
2875
|
+
}
|
|
2876
|
+
case 8: {
|
|
2877
|
+
if (tag !== 66) {
|
|
2878
|
+
break;
|
|
2879
|
+
}
|
|
2880
|
+
message.security.push(Security3.decode(reader, reader.uint32()));
|
|
2881
|
+
continue;
|
|
2882
|
+
}
|
|
2883
|
+
}
|
|
2884
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2885
|
+
break;
|
|
2886
|
+
}
|
|
2887
|
+
reader.skip(tag & 7);
|
|
2888
|
+
}
|
|
2889
|
+
return message;
|
|
2890
|
+
}
|
|
2891
|
+
};
|
|
2892
|
+
function createBaseAgentCardSignature() {
|
|
2893
|
+
return { protected: "", signature: "", header: void 0 };
|
|
2894
|
+
}
|
|
2895
|
+
var AgentCardSignature3 = {
|
|
2896
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2897
|
+
if (message.protected !== "") {
|
|
2898
|
+
writer.uint32(10).string(message.protected);
|
|
2899
|
+
}
|
|
2900
|
+
if (message.signature !== "") {
|
|
2901
|
+
writer.uint32(18).string(message.signature);
|
|
2902
|
+
}
|
|
2903
|
+
if (message.header !== void 0) {
|
|
2904
|
+
Struct.encode(Struct.wrap(message.header), writer.uint32(26).fork()).join();
|
|
2905
|
+
}
|
|
2906
|
+
return writer;
|
|
2907
|
+
},
|
|
2908
|
+
decode(input, length) {
|
|
2909
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2910
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2911
|
+
const message = createBaseAgentCardSignature();
|
|
2912
|
+
while (reader.pos < end) {
|
|
2913
|
+
const tag = reader.uint32();
|
|
2914
|
+
switch (tag >>> 3) {
|
|
2915
|
+
case 1: {
|
|
2916
|
+
if (tag !== 10) {
|
|
2917
|
+
break;
|
|
2918
|
+
}
|
|
2919
|
+
message.protected = reader.string();
|
|
2920
|
+
continue;
|
|
2921
|
+
}
|
|
2922
|
+
case 2: {
|
|
2923
|
+
if (tag !== 18) {
|
|
2924
|
+
break;
|
|
2925
|
+
}
|
|
2926
|
+
message.signature = reader.string();
|
|
2927
|
+
continue;
|
|
2928
|
+
}
|
|
2929
|
+
case 3: {
|
|
2930
|
+
if (tag !== 26) {
|
|
2931
|
+
break;
|
|
2932
|
+
}
|
|
2933
|
+
message.header = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2934
|
+
continue;
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2938
|
+
break;
|
|
2939
|
+
}
|
|
2940
|
+
reader.skip(tag & 7);
|
|
2941
|
+
}
|
|
2942
|
+
return message;
|
|
2943
|
+
}
|
|
2944
|
+
};
|
|
2945
|
+
function createBaseTaskPushNotificationConfig() {
|
|
2946
|
+
return { name: "", pushNotificationConfig: void 0 };
|
|
2947
|
+
}
|
|
2948
|
+
var TaskPushNotificationConfig3 = {
|
|
2949
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2950
|
+
if (message.name !== "") {
|
|
2951
|
+
writer.uint32(10).string(message.name);
|
|
2952
|
+
}
|
|
2953
|
+
if (message.pushNotificationConfig !== void 0) {
|
|
2954
|
+
PushNotificationConfig3.encode(message.pushNotificationConfig, writer.uint32(18).fork()).join();
|
|
2955
|
+
}
|
|
2956
|
+
return writer;
|
|
2957
|
+
},
|
|
2958
|
+
decode(input, length) {
|
|
2959
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
2960
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2961
|
+
const message = createBaseTaskPushNotificationConfig();
|
|
2962
|
+
while (reader.pos < end) {
|
|
2963
|
+
const tag = reader.uint32();
|
|
2964
|
+
switch (tag >>> 3) {
|
|
2965
|
+
case 1: {
|
|
2966
|
+
if (tag !== 10) {
|
|
2967
|
+
break;
|
|
2968
|
+
}
|
|
2969
|
+
message.name = reader.string();
|
|
2970
|
+
continue;
|
|
2971
|
+
}
|
|
2972
|
+
case 2: {
|
|
2973
|
+
if (tag !== 18) {
|
|
2974
|
+
break;
|
|
2975
|
+
}
|
|
2976
|
+
message.pushNotificationConfig = PushNotificationConfig3.decode(reader, reader.uint32());
|
|
2977
|
+
continue;
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2981
|
+
break;
|
|
2982
|
+
}
|
|
2983
|
+
reader.skip(tag & 7);
|
|
2984
|
+
}
|
|
2985
|
+
return message;
|
|
2986
|
+
}
|
|
2987
|
+
};
|
|
2988
|
+
function createBaseStringList() {
|
|
2989
|
+
return { list: [] };
|
|
2990
|
+
}
|
|
2991
|
+
var StringList = {
|
|
2992
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
2993
|
+
for (const v of message.list) {
|
|
2994
|
+
writer.uint32(10).string(v);
|
|
2995
|
+
}
|
|
2996
|
+
return writer;
|
|
2997
|
+
},
|
|
2998
|
+
decode(input, length) {
|
|
2999
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3000
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3001
|
+
const message = createBaseStringList();
|
|
3002
|
+
while (reader.pos < end) {
|
|
3003
|
+
const tag = reader.uint32();
|
|
3004
|
+
switch (tag >>> 3) {
|
|
3005
|
+
case 1: {
|
|
3006
|
+
if (tag !== 10) {
|
|
3007
|
+
break;
|
|
3008
|
+
}
|
|
3009
|
+
message.list.push(reader.string());
|
|
3010
|
+
continue;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3014
|
+
break;
|
|
3015
|
+
}
|
|
3016
|
+
reader.skip(tag & 7);
|
|
3017
|
+
}
|
|
3018
|
+
return message;
|
|
3019
|
+
}
|
|
3020
|
+
};
|
|
3021
|
+
function createBaseSecurity() {
|
|
3022
|
+
return { schemes: {} };
|
|
3023
|
+
}
|
|
3024
|
+
var Security3 = {
|
|
3025
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3026
|
+
Object.entries(message.schemes).forEach(([key, value]) => {
|
|
3027
|
+
Security_SchemesEntry.encode({ key, value }, writer.uint32(10).fork()).join();
|
|
3028
|
+
});
|
|
3029
|
+
return writer;
|
|
3030
|
+
},
|
|
3031
|
+
decode(input, length) {
|
|
3032
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3033
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3034
|
+
const message = createBaseSecurity();
|
|
3035
|
+
while (reader.pos < end) {
|
|
3036
|
+
const tag = reader.uint32();
|
|
3037
|
+
switch (tag >>> 3) {
|
|
3038
|
+
case 1: {
|
|
3039
|
+
if (tag !== 10) {
|
|
3040
|
+
break;
|
|
3041
|
+
}
|
|
3042
|
+
const entry1 = Security_SchemesEntry.decode(reader, reader.uint32());
|
|
3043
|
+
if (entry1.value !== void 0) {
|
|
3044
|
+
message.schemes[entry1.key] = entry1.value;
|
|
3045
|
+
}
|
|
3046
|
+
continue;
|
|
3047
|
+
}
|
|
3048
|
+
}
|
|
3049
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3050
|
+
break;
|
|
3051
|
+
}
|
|
3052
|
+
reader.skip(tag & 7);
|
|
3053
|
+
}
|
|
3054
|
+
return message;
|
|
3055
|
+
}
|
|
3056
|
+
};
|
|
3057
|
+
function createBaseSecurity_SchemesEntry() {
|
|
3058
|
+
return { key: "", value: void 0 };
|
|
3059
|
+
}
|
|
3060
|
+
var Security_SchemesEntry = {
|
|
3061
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3062
|
+
if (message.key !== "") {
|
|
3063
|
+
writer.uint32(10).string(message.key);
|
|
3064
|
+
}
|
|
3065
|
+
if (message.value !== void 0) {
|
|
3066
|
+
StringList.encode(message.value, writer.uint32(18).fork()).join();
|
|
3067
|
+
}
|
|
3068
|
+
return writer;
|
|
3069
|
+
},
|
|
3070
|
+
decode(input, length) {
|
|
3071
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3072
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3073
|
+
const message = createBaseSecurity_SchemesEntry();
|
|
3074
|
+
while (reader.pos < end) {
|
|
3075
|
+
const tag = reader.uint32();
|
|
3076
|
+
switch (tag >>> 3) {
|
|
3077
|
+
case 1: {
|
|
3078
|
+
if (tag !== 10) {
|
|
3079
|
+
break;
|
|
3080
|
+
}
|
|
3081
|
+
message.key = reader.string();
|
|
3082
|
+
continue;
|
|
3083
|
+
}
|
|
3084
|
+
case 2: {
|
|
3085
|
+
if (tag !== 18) {
|
|
3086
|
+
break;
|
|
3087
|
+
}
|
|
3088
|
+
message.value = StringList.decode(reader, reader.uint32());
|
|
3089
|
+
continue;
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3093
|
+
break;
|
|
3094
|
+
}
|
|
3095
|
+
reader.skip(tag & 7);
|
|
3096
|
+
}
|
|
3097
|
+
return message;
|
|
3098
|
+
}
|
|
3099
|
+
};
|
|
3100
|
+
function createBaseSecurityScheme() {
|
|
3101
|
+
return { scheme: void 0 };
|
|
3102
|
+
}
|
|
3103
|
+
var SecurityScheme3 = {
|
|
3104
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3105
|
+
switch (message.scheme?.$case) {
|
|
3106
|
+
case "apiKeySecurityScheme":
|
|
3107
|
+
APIKeySecurityScheme.encode(message.scheme.value, writer.uint32(10).fork()).join();
|
|
3108
|
+
break;
|
|
3109
|
+
case "httpAuthSecurityScheme":
|
|
3110
|
+
HTTPAuthSecurityScheme.encode(message.scheme.value, writer.uint32(18).fork()).join();
|
|
3111
|
+
break;
|
|
3112
|
+
case "oauth2SecurityScheme":
|
|
3113
|
+
OAuth2SecurityScheme.encode(message.scheme.value, writer.uint32(26).fork()).join();
|
|
3114
|
+
break;
|
|
3115
|
+
case "openIdConnectSecurityScheme":
|
|
3116
|
+
OpenIdConnectSecurityScheme.encode(message.scheme.value, writer.uint32(34).fork()).join();
|
|
3117
|
+
break;
|
|
3118
|
+
case "mtlsSecurityScheme":
|
|
3119
|
+
MutualTlsSecurityScheme.encode(message.scheme.value, writer.uint32(42).fork()).join();
|
|
3120
|
+
break;
|
|
3121
|
+
}
|
|
3122
|
+
return writer;
|
|
3123
|
+
},
|
|
3124
|
+
decode(input, length) {
|
|
3125
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3126
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3127
|
+
const message = createBaseSecurityScheme();
|
|
3128
|
+
while (reader.pos < end) {
|
|
3129
|
+
const tag = reader.uint32();
|
|
3130
|
+
switch (tag >>> 3) {
|
|
3131
|
+
case 1: {
|
|
3132
|
+
if (tag !== 10) {
|
|
3133
|
+
break;
|
|
3134
|
+
}
|
|
3135
|
+
message.scheme = {
|
|
3136
|
+
$case: "apiKeySecurityScheme",
|
|
3137
|
+
value: APIKeySecurityScheme.decode(reader, reader.uint32())
|
|
3138
|
+
};
|
|
3139
|
+
continue;
|
|
3140
|
+
}
|
|
3141
|
+
case 2: {
|
|
3142
|
+
if (tag !== 18) {
|
|
3143
|
+
break;
|
|
3144
|
+
}
|
|
3145
|
+
message.scheme = {
|
|
3146
|
+
$case: "httpAuthSecurityScheme",
|
|
3147
|
+
value: HTTPAuthSecurityScheme.decode(reader, reader.uint32())
|
|
3148
|
+
};
|
|
3149
|
+
continue;
|
|
3150
|
+
}
|
|
3151
|
+
case 3: {
|
|
3152
|
+
if (tag !== 26) {
|
|
3153
|
+
break;
|
|
3154
|
+
}
|
|
3155
|
+
message.scheme = {
|
|
3156
|
+
$case: "oauth2SecurityScheme",
|
|
3157
|
+
value: OAuth2SecurityScheme.decode(reader, reader.uint32())
|
|
3158
|
+
};
|
|
3159
|
+
continue;
|
|
3160
|
+
}
|
|
3161
|
+
case 4: {
|
|
3162
|
+
if (tag !== 34) {
|
|
3163
|
+
break;
|
|
3164
|
+
}
|
|
3165
|
+
message.scheme = {
|
|
3166
|
+
$case: "openIdConnectSecurityScheme",
|
|
3167
|
+
value: OpenIdConnectSecurityScheme.decode(reader, reader.uint32())
|
|
3168
|
+
};
|
|
3169
|
+
continue;
|
|
3170
|
+
}
|
|
3171
|
+
case 5: {
|
|
3172
|
+
if (tag !== 42) {
|
|
3173
|
+
break;
|
|
3174
|
+
}
|
|
3175
|
+
message.scheme = {
|
|
3176
|
+
$case: "mtlsSecurityScheme",
|
|
3177
|
+
value: MutualTlsSecurityScheme.decode(reader, reader.uint32())
|
|
3178
|
+
};
|
|
3179
|
+
continue;
|
|
3180
|
+
}
|
|
3181
|
+
}
|
|
3182
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3183
|
+
break;
|
|
3184
|
+
}
|
|
3185
|
+
reader.skip(tag & 7);
|
|
3186
|
+
}
|
|
3187
|
+
return message;
|
|
3188
|
+
}
|
|
3189
|
+
};
|
|
3190
|
+
function createBaseAPIKeySecurityScheme() {
|
|
3191
|
+
return { description: "", location: "", name: "" };
|
|
3192
|
+
}
|
|
3193
|
+
var APIKeySecurityScheme = {
|
|
3194
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3195
|
+
if (message.description !== "") {
|
|
3196
|
+
writer.uint32(10).string(message.description);
|
|
3197
|
+
}
|
|
3198
|
+
if (message.location !== "") {
|
|
3199
|
+
writer.uint32(18).string(message.location);
|
|
3200
|
+
}
|
|
3201
|
+
if (message.name !== "") {
|
|
3202
|
+
writer.uint32(26).string(message.name);
|
|
3203
|
+
}
|
|
3204
|
+
return writer;
|
|
3205
|
+
},
|
|
3206
|
+
decode(input, length) {
|
|
3207
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3208
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3209
|
+
const message = createBaseAPIKeySecurityScheme();
|
|
3210
|
+
while (reader.pos < end) {
|
|
3211
|
+
const tag = reader.uint32();
|
|
3212
|
+
switch (tag >>> 3) {
|
|
3213
|
+
case 1: {
|
|
3214
|
+
if (tag !== 10) {
|
|
3215
|
+
break;
|
|
3216
|
+
}
|
|
3217
|
+
message.description = reader.string();
|
|
3218
|
+
continue;
|
|
3219
|
+
}
|
|
3220
|
+
case 2: {
|
|
3221
|
+
if (tag !== 18) {
|
|
3222
|
+
break;
|
|
3223
|
+
}
|
|
3224
|
+
message.location = reader.string();
|
|
3225
|
+
continue;
|
|
3226
|
+
}
|
|
3227
|
+
case 3: {
|
|
3228
|
+
if (tag !== 26) {
|
|
3229
|
+
break;
|
|
3230
|
+
}
|
|
3231
|
+
message.name = reader.string();
|
|
3232
|
+
continue;
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3236
|
+
break;
|
|
3237
|
+
}
|
|
3238
|
+
reader.skip(tag & 7);
|
|
3239
|
+
}
|
|
3240
|
+
return message;
|
|
3241
|
+
}
|
|
3242
|
+
};
|
|
3243
|
+
function createBaseHTTPAuthSecurityScheme() {
|
|
3244
|
+
return { description: "", scheme: "", bearerFormat: "" };
|
|
3245
|
+
}
|
|
3246
|
+
var HTTPAuthSecurityScheme = {
|
|
3247
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3248
|
+
if (message.description !== "") {
|
|
3249
|
+
writer.uint32(10).string(message.description);
|
|
3250
|
+
}
|
|
3251
|
+
if (message.scheme !== "") {
|
|
3252
|
+
writer.uint32(18).string(message.scheme);
|
|
3253
|
+
}
|
|
3254
|
+
if (message.bearerFormat !== "") {
|
|
3255
|
+
writer.uint32(26).string(message.bearerFormat);
|
|
3256
|
+
}
|
|
3257
|
+
return writer;
|
|
3258
|
+
},
|
|
3259
|
+
decode(input, length) {
|
|
3260
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3261
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3262
|
+
const message = createBaseHTTPAuthSecurityScheme();
|
|
3263
|
+
while (reader.pos < end) {
|
|
3264
|
+
const tag = reader.uint32();
|
|
3265
|
+
switch (tag >>> 3) {
|
|
3266
|
+
case 1: {
|
|
3267
|
+
if (tag !== 10) {
|
|
3268
|
+
break;
|
|
3269
|
+
}
|
|
3270
|
+
message.description = reader.string();
|
|
3271
|
+
continue;
|
|
3272
|
+
}
|
|
3273
|
+
case 2: {
|
|
3274
|
+
if (tag !== 18) {
|
|
3275
|
+
break;
|
|
3276
|
+
}
|
|
3277
|
+
message.scheme = reader.string();
|
|
3278
|
+
continue;
|
|
3279
|
+
}
|
|
3280
|
+
case 3: {
|
|
3281
|
+
if (tag !== 26) {
|
|
3282
|
+
break;
|
|
3283
|
+
}
|
|
3284
|
+
message.bearerFormat = reader.string();
|
|
3285
|
+
continue;
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3289
|
+
break;
|
|
3290
|
+
}
|
|
3291
|
+
reader.skip(tag & 7);
|
|
3292
|
+
}
|
|
3293
|
+
return message;
|
|
3294
|
+
}
|
|
3295
|
+
};
|
|
3296
|
+
function createBaseOAuth2SecurityScheme() {
|
|
3297
|
+
return { description: "", flows: void 0, oauth2MetadataUrl: "" };
|
|
3298
|
+
}
|
|
3299
|
+
var OAuth2SecurityScheme = {
|
|
3300
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3301
|
+
if (message.description !== "") {
|
|
3302
|
+
writer.uint32(10).string(message.description);
|
|
3303
|
+
}
|
|
3304
|
+
if (message.flows !== void 0) {
|
|
3305
|
+
OAuthFlows3.encode(message.flows, writer.uint32(18).fork()).join();
|
|
3306
|
+
}
|
|
3307
|
+
if (message.oauth2MetadataUrl !== "") {
|
|
3308
|
+
writer.uint32(26).string(message.oauth2MetadataUrl);
|
|
3309
|
+
}
|
|
3310
|
+
return writer;
|
|
3311
|
+
},
|
|
3312
|
+
decode(input, length) {
|
|
3313
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3314
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3315
|
+
const message = createBaseOAuth2SecurityScheme();
|
|
3316
|
+
while (reader.pos < end) {
|
|
3317
|
+
const tag = reader.uint32();
|
|
3318
|
+
switch (tag >>> 3) {
|
|
3319
|
+
case 1: {
|
|
3320
|
+
if (tag !== 10) {
|
|
3321
|
+
break;
|
|
3322
|
+
}
|
|
3323
|
+
message.description = reader.string();
|
|
3324
|
+
continue;
|
|
3325
|
+
}
|
|
3326
|
+
case 2: {
|
|
3327
|
+
if (tag !== 18) {
|
|
3328
|
+
break;
|
|
3329
|
+
}
|
|
3330
|
+
message.flows = OAuthFlows3.decode(reader, reader.uint32());
|
|
3331
|
+
continue;
|
|
3332
|
+
}
|
|
3333
|
+
case 3: {
|
|
3334
|
+
if (tag !== 26) {
|
|
3335
|
+
break;
|
|
3336
|
+
}
|
|
3337
|
+
message.oauth2MetadataUrl = reader.string();
|
|
3338
|
+
continue;
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3342
|
+
break;
|
|
3343
|
+
}
|
|
3344
|
+
reader.skip(tag & 7);
|
|
3345
|
+
}
|
|
3346
|
+
return message;
|
|
3347
|
+
}
|
|
3348
|
+
};
|
|
3349
|
+
function createBaseOpenIdConnectSecurityScheme() {
|
|
3350
|
+
return { description: "", openIdConnectUrl: "" };
|
|
3351
|
+
}
|
|
3352
|
+
var OpenIdConnectSecurityScheme = {
|
|
3353
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3354
|
+
if (message.description !== "") {
|
|
3355
|
+
writer.uint32(10).string(message.description);
|
|
3356
|
+
}
|
|
3357
|
+
if (message.openIdConnectUrl !== "") {
|
|
3358
|
+
writer.uint32(18).string(message.openIdConnectUrl);
|
|
3359
|
+
}
|
|
3360
|
+
return writer;
|
|
3361
|
+
},
|
|
3362
|
+
decode(input, length) {
|
|
3363
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3364
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3365
|
+
const message = createBaseOpenIdConnectSecurityScheme();
|
|
3366
|
+
while (reader.pos < end) {
|
|
3367
|
+
const tag = reader.uint32();
|
|
3368
|
+
switch (tag >>> 3) {
|
|
3369
|
+
case 1: {
|
|
3370
|
+
if (tag !== 10) {
|
|
3371
|
+
break;
|
|
3372
|
+
}
|
|
3373
|
+
message.description = reader.string();
|
|
3374
|
+
continue;
|
|
3375
|
+
}
|
|
3376
|
+
case 2: {
|
|
3377
|
+
if (tag !== 18) {
|
|
3378
|
+
break;
|
|
3379
|
+
}
|
|
3380
|
+
message.openIdConnectUrl = reader.string();
|
|
3381
|
+
continue;
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3385
|
+
break;
|
|
3386
|
+
}
|
|
3387
|
+
reader.skip(tag & 7);
|
|
3388
|
+
}
|
|
3389
|
+
return message;
|
|
3390
|
+
}
|
|
3391
|
+
};
|
|
3392
|
+
function createBaseMutualTlsSecurityScheme() {
|
|
3393
|
+
return { description: "" };
|
|
3394
|
+
}
|
|
3395
|
+
var MutualTlsSecurityScheme = {
|
|
3396
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3397
|
+
if (message.description !== "") {
|
|
3398
|
+
writer.uint32(10).string(message.description);
|
|
3399
|
+
}
|
|
3400
|
+
return writer;
|
|
3401
|
+
},
|
|
3402
|
+
decode(input, length) {
|
|
3403
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3404
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3405
|
+
const message = createBaseMutualTlsSecurityScheme();
|
|
3406
|
+
while (reader.pos < end) {
|
|
3407
|
+
const tag = reader.uint32();
|
|
3408
|
+
switch (tag >>> 3) {
|
|
3409
|
+
case 1: {
|
|
3410
|
+
if (tag !== 10) {
|
|
3411
|
+
break;
|
|
3412
|
+
}
|
|
3413
|
+
message.description = reader.string();
|
|
3414
|
+
continue;
|
|
3415
|
+
}
|
|
3416
|
+
}
|
|
3417
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3418
|
+
break;
|
|
3419
|
+
}
|
|
3420
|
+
reader.skip(tag & 7);
|
|
3421
|
+
}
|
|
3422
|
+
return message;
|
|
3423
|
+
}
|
|
3424
|
+
};
|
|
3425
|
+
function createBaseOAuthFlows() {
|
|
3426
|
+
return { flow: void 0 };
|
|
3427
|
+
}
|
|
3428
|
+
var OAuthFlows3 = {
|
|
3429
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3430
|
+
switch (message.flow?.$case) {
|
|
3431
|
+
case "authorizationCode":
|
|
3432
|
+
AuthorizationCodeOAuthFlow.encode(message.flow.value, writer.uint32(10).fork()).join();
|
|
3433
|
+
break;
|
|
3434
|
+
case "clientCredentials":
|
|
3435
|
+
ClientCredentialsOAuthFlow.encode(message.flow.value, writer.uint32(18).fork()).join();
|
|
3436
|
+
break;
|
|
3437
|
+
case "implicit":
|
|
3438
|
+
ImplicitOAuthFlow.encode(message.flow.value, writer.uint32(26).fork()).join();
|
|
3439
|
+
break;
|
|
3440
|
+
case "password":
|
|
3441
|
+
PasswordOAuthFlow.encode(message.flow.value, writer.uint32(34).fork()).join();
|
|
3442
|
+
break;
|
|
3443
|
+
}
|
|
3444
|
+
return writer;
|
|
3445
|
+
},
|
|
3446
|
+
decode(input, length) {
|
|
3447
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3448
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3449
|
+
const message = createBaseOAuthFlows();
|
|
3450
|
+
while (reader.pos < end) {
|
|
3451
|
+
const tag = reader.uint32();
|
|
3452
|
+
switch (tag >>> 3) {
|
|
3453
|
+
case 1: {
|
|
3454
|
+
if (tag !== 10) {
|
|
3455
|
+
break;
|
|
3456
|
+
}
|
|
3457
|
+
message.flow = {
|
|
3458
|
+
$case: "authorizationCode",
|
|
3459
|
+
value: AuthorizationCodeOAuthFlow.decode(reader, reader.uint32())
|
|
3460
|
+
};
|
|
3461
|
+
continue;
|
|
3462
|
+
}
|
|
3463
|
+
case 2: {
|
|
3464
|
+
if (tag !== 18) {
|
|
3465
|
+
break;
|
|
3466
|
+
}
|
|
3467
|
+
message.flow = {
|
|
3468
|
+
$case: "clientCredentials",
|
|
3469
|
+
value: ClientCredentialsOAuthFlow.decode(reader, reader.uint32())
|
|
3470
|
+
};
|
|
3471
|
+
continue;
|
|
3472
|
+
}
|
|
3473
|
+
case 3: {
|
|
3474
|
+
if (tag !== 26) {
|
|
3475
|
+
break;
|
|
3476
|
+
}
|
|
3477
|
+
message.flow = { $case: "implicit", value: ImplicitOAuthFlow.decode(reader, reader.uint32()) };
|
|
3478
|
+
continue;
|
|
3479
|
+
}
|
|
3480
|
+
case 4: {
|
|
3481
|
+
if (tag !== 34) {
|
|
3482
|
+
break;
|
|
3483
|
+
}
|
|
3484
|
+
message.flow = { $case: "password", value: PasswordOAuthFlow.decode(reader, reader.uint32()) };
|
|
3485
|
+
continue;
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3489
|
+
break;
|
|
3490
|
+
}
|
|
3491
|
+
reader.skip(tag & 7);
|
|
3492
|
+
}
|
|
3493
|
+
return message;
|
|
3494
|
+
}
|
|
3495
|
+
};
|
|
3496
|
+
function createBaseAuthorizationCodeOAuthFlow() {
|
|
3497
|
+
return { authorizationUrl: "", tokenUrl: "", refreshUrl: "", scopes: {} };
|
|
3498
|
+
}
|
|
3499
|
+
var AuthorizationCodeOAuthFlow = {
|
|
3500
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3501
|
+
if (message.authorizationUrl !== "") {
|
|
3502
|
+
writer.uint32(10).string(message.authorizationUrl);
|
|
3503
|
+
}
|
|
3504
|
+
if (message.tokenUrl !== "") {
|
|
3505
|
+
writer.uint32(18).string(message.tokenUrl);
|
|
3506
|
+
}
|
|
3507
|
+
if (message.refreshUrl !== "") {
|
|
3508
|
+
writer.uint32(26).string(message.refreshUrl);
|
|
3509
|
+
}
|
|
3510
|
+
Object.entries(message.scopes).forEach(([key, value]) => {
|
|
3511
|
+
AuthorizationCodeOAuthFlow_ScopesEntry.encode({ key, value }, writer.uint32(34).fork()).join();
|
|
3512
|
+
});
|
|
3513
|
+
return writer;
|
|
3514
|
+
},
|
|
3515
|
+
decode(input, length) {
|
|
3516
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3517
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3518
|
+
const message = createBaseAuthorizationCodeOAuthFlow();
|
|
3519
|
+
while (reader.pos < end) {
|
|
3520
|
+
const tag = reader.uint32();
|
|
3521
|
+
switch (tag >>> 3) {
|
|
3522
|
+
case 1: {
|
|
3523
|
+
if (tag !== 10) {
|
|
3524
|
+
break;
|
|
3525
|
+
}
|
|
3526
|
+
message.authorizationUrl = reader.string();
|
|
3527
|
+
continue;
|
|
3528
|
+
}
|
|
3529
|
+
case 2: {
|
|
3530
|
+
if (tag !== 18) {
|
|
3531
|
+
break;
|
|
3532
|
+
}
|
|
3533
|
+
message.tokenUrl = reader.string();
|
|
3534
|
+
continue;
|
|
3535
|
+
}
|
|
3536
|
+
case 3: {
|
|
3537
|
+
if (tag !== 26) {
|
|
3538
|
+
break;
|
|
3539
|
+
}
|
|
3540
|
+
message.refreshUrl = reader.string();
|
|
3541
|
+
continue;
|
|
3542
|
+
}
|
|
3543
|
+
case 4: {
|
|
3544
|
+
if (tag !== 34) {
|
|
3545
|
+
break;
|
|
3546
|
+
}
|
|
3547
|
+
const entry4 = AuthorizationCodeOAuthFlow_ScopesEntry.decode(reader, reader.uint32());
|
|
3548
|
+
if (entry4.value !== void 0) {
|
|
3549
|
+
message.scopes[entry4.key] = entry4.value;
|
|
3550
|
+
}
|
|
3551
|
+
continue;
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3555
|
+
break;
|
|
3556
|
+
}
|
|
3557
|
+
reader.skip(tag & 7);
|
|
3558
|
+
}
|
|
3559
|
+
return message;
|
|
3560
|
+
}
|
|
3561
|
+
};
|
|
3562
|
+
function createBaseAuthorizationCodeOAuthFlow_ScopesEntry() {
|
|
3563
|
+
return { key: "", value: "" };
|
|
3564
|
+
}
|
|
3565
|
+
var AuthorizationCodeOAuthFlow_ScopesEntry = {
|
|
3566
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3567
|
+
if (message.key !== "") {
|
|
3568
|
+
writer.uint32(10).string(message.key);
|
|
3569
|
+
}
|
|
3570
|
+
if (message.value !== "") {
|
|
3571
|
+
writer.uint32(18).string(message.value);
|
|
3572
|
+
}
|
|
3573
|
+
return writer;
|
|
3574
|
+
},
|
|
3575
|
+
decode(input, length) {
|
|
3576
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3577
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3578
|
+
const message = createBaseAuthorizationCodeOAuthFlow_ScopesEntry();
|
|
3579
|
+
while (reader.pos < end) {
|
|
3580
|
+
const tag = reader.uint32();
|
|
3581
|
+
switch (tag >>> 3) {
|
|
3582
|
+
case 1: {
|
|
3583
|
+
if (tag !== 10) {
|
|
3584
|
+
break;
|
|
3585
|
+
}
|
|
3586
|
+
message.key = reader.string();
|
|
3587
|
+
continue;
|
|
3588
|
+
}
|
|
3589
|
+
case 2: {
|
|
3590
|
+
if (tag !== 18) {
|
|
3591
|
+
break;
|
|
3592
|
+
}
|
|
3593
|
+
message.value = reader.string();
|
|
3594
|
+
continue;
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3598
|
+
break;
|
|
3599
|
+
}
|
|
3600
|
+
reader.skip(tag & 7);
|
|
3601
|
+
}
|
|
3602
|
+
return message;
|
|
3603
|
+
}
|
|
3604
|
+
};
|
|
3605
|
+
function createBaseClientCredentialsOAuthFlow() {
|
|
3606
|
+
return { tokenUrl: "", refreshUrl: "", scopes: {} };
|
|
3607
|
+
}
|
|
3608
|
+
var ClientCredentialsOAuthFlow = {
|
|
3609
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3610
|
+
if (message.tokenUrl !== "") {
|
|
3611
|
+
writer.uint32(10).string(message.tokenUrl);
|
|
3612
|
+
}
|
|
3613
|
+
if (message.refreshUrl !== "") {
|
|
3614
|
+
writer.uint32(18).string(message.refreshUrl);
|
|
3615
|
+
}
|
|
3616
|
+
Object.entries(message.scopes).forEach(([key, value]) => {
|
|
3617
|
+
ClientCredentialsOAuthFlow_ScopesEntry.encode({ key, value }, writer.uint32(26).fork()).join();
|
|
3618
|
+
});
|
|
3619
|
+
return writer;
|
|
3620
|
+
},
|
|
3621
|
+
decode(input, length) {
|
|
3622
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3623
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3624
|
+
const message = createBaseClientCredentialsOAuthFlow();
|
|
3625
|
+
while (reader.pos < end) {
|
|
3626
|
+
const tag = reader.uint32();
|
|
3627
|
+
switch (tag >>> 3) {
|
|
3628
|
+
case 1: {
|
|
3629
|
+
if (tag !== 10) {
|
|
3630
|
+
break;
|
|
3631
|
+
}
|
|
3632
|
+
message.tokenUrl = reader.string();
|
|
3633
|
+
continue;
|
|
3634
|
+
}
|
|
3635
|
+
case 2: {
|
|
3636
|
+
if (tag !== 18) {
|
|
3637
|
+
break;
|
|
3638
|
+
}
|
|
3639
|
+
message.refreshUrl = reader.string();
|
|
3640
|
+
continue;
|
|
3641
|
+
}
|
|
3642
|
+
case 3: {
|
|
3643
|
+
if (tag !== 26) {
|
|
3644
|
+
break;
|
|
3645
|
+
}
|
|
3646
|
+
const entry3 = ClientCredentialsOAuthFlow_ScopesEntry.decode(reader, reader.uint32());
|
|
3647
|
+
if (entry3.value !== void 0) {
|
|
3648
|
+
message.scopes[entry3.key] = entry3.value;
|
|
3649
|
+
}
|
|
3650
|
+
continue;
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3654
|
+
break;
|
|
3655
|
+
}
|
|
3656
|
+
reader.skip(tag & 7);
|
|
3657
|
+
}
|
|
3658
|
+
return message;
|
|
3659
|
+
}
|
|
3660
|
+
};
|
|
3661
|
+
function createBaseClientCredentialsOAuthFlow_ScopesEntry() {
|
|
3662
|
+
return { key: "", value: "" };
|
|
3663
|
+
}
|
|
3664
|
+
var ClientCredentialsOAuthFlow_ScopesEntry = {
|
|
3665
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3666
|
+
if (message.key !== "") {
|
|
3667
|
+
writer.uint32(10).string(message.key);
|
|
3668
|
+
}
|
|
3669
|
+
if (message.value !== "") {
|
|
3670
|
+
writer.uint32(18).string(message.value);
|
|
3671
|
+
}
|
|
3672
|
+
return writer;
|
|
3673
|
+
},
|
|
3674
|
+
decode(input, length) {
|
|
3675
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3676
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3677
|
+
const message = createBaseClientCredentialsOAuthFlow_ScopesEntry();
|
|
3678
|
+
while (reader.pos < end) {
|
|
3679
|
+
const tag = reader.uint32();
|
|
3680
|
+
switch (tag >>> 3) {
|
|
3681
|
+
case 1: {
|
|
3682
|
+
if (tag !== 10) {
|
|
3683
|
+
break;
|
|
3684
|
+
}
|
|
3685
|
+
message.key = reader.string();
|
|
3686
|
+
continue;
|
|
3687
|
+
}
|
|
3688
|
+
case 2: {
|
|
3689
|
+
if (tag !== 18) {
|
|
3690
|
+
break;
|
|
3691
|
+
}
|
|
3692
|
+
message.value = reader.string();
|
|
3693
|
+
continue;
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3697
|
+
break;
|
|
3698
|
+
}
|
|
3699
|
+
reader.skip(tag & 7);
|
|
3700
|
+
}
|
|
3701
|
+
return message;
|
|
3702
|
+
}
|
|
3703
|
+
};
|
|
3704
|
+
function createBaseImplicitOAuthFlow() {
|
|
3705
|
+
return { authorizationUrl: "", refreshUrl: "", scopes: {} };
|
|
3706
|
+
}
|
|
3707
|
+
var ImplicitOAuthFlow = {
|
|
3708
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3709
|
+
if (message.authorizationUrl !== "") {
|
|
3710
|
+
writer.uint32(10).string(message.authorizationUrl);
|
|
3711
|
+
}
|
|
3712
|
+
if (message.refreshUrl !== "") {
|
|
3713
|
+
writer.uint32(18).string(message.refreshUrl);
|
|
3714
|
+
}
|
|
3715
|
+
Object.entries(message.scopes).forEach(([key, value]) => {
|
|
3716
|
+
ImplicitOAuthFlow_ScopesEntry.encode({ key, value }, writer.uint32(26).fork()).join();
|
|
3717
|
+
});
|
|
3718
|
+
return writer;
|
|
3719
|
+
},
|
|
3720
|
+
decode(input, length) {
|
|
3721
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3722
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3723
|
+
const message = createBaseImplicitOAuthFlow();
|
|
3724
|
+
while (reader.pos < end) {
|
|
3725
|
+
const tag = reader.uint32();
|
|
3726
|
+
switch (tag >>> 3) {
|
|
3727
|
+
case 1: {
|
|
3728
|
+
if (tag !== 10) {
|
|
3729
|
+
break;
|
|
3730
|
+
}
|
|
3731
|
+
message.authorizationUrl = reader.string();
|
|
3732
|
+
continue;
|
|
3733
|
+
}
|
|
3734
|
+
case 2: {
|
|
3735
|
+
if (tag !== 18) {
|
|
3736
|
+
break;
|
|
3737
|
+
}
|
|
3738
|
+
message.refreshUrl = reader.string();
|
|
3739
|
+
continue;
|
|
3740
|
+
}
|
|
3741
|
+
case 3: {
|
|
3742
|
+
if (tag !== 26) {
|
|
3743
|
+
break;
|
|
3744
|
+
}
|
|
3745
|
+
const entry3 = ImplicitOAuthFlow_ScopesEntry.decode(reader, reader.uint32());
|
|
3746
|
+
if (entry3.value !== void 0) {
|
|
3747
|
+
message.scopes[entry3.key] = entry3.value;
|
|
3748
|
+
}
|
|
3749
|
+
continue;
|
|
3750
|
+
}
|
|
3751
|
+
}
|
|
3752
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3753
|
+
break;
|
|
3754
|
+
}
|
|
3755
|
+
reader.skip(tag & 7);
|
|
3756
|
+
}
|
|
3757
|
+
return message;
|
|
3758
|
+
}
|
|
3759
|
+
};
|
|
3760
|
+
function createBaseImplicitOAuthFlow_ScopesEntry() {
|
|
3761
|
+
return { key: "", value: "" };
|
|
3762
|
+
}
|
|
3763
|
+
var ImplicitOAuthFlow_ScopesEntry = {
|
|
3764
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3765
|
+
if (message.key !== "") {
|
|
3766
|
+
writer.uint32(10).string(message.key);
|
|
3767
|
+
}
|
|
3768
|
+
if (message.value !== "") {
|
|
3769
|
+
writer.uint32(18).string(message.value);
|
|
3770
|
+
}
|
|
3771
|
+
return writer;
|
|
3772
|
+
},
|
|
3773
|
+
decode(input, length) {
|
|
3774
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3775
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3776
|
+
const message = createBaseImplicitOAuthFlow_ScopesEntry();
|
|
3777
|
+
while (reader.pos < end) {
|
|
3778
|
+
const tag = reader.uint32();
|
|
3779
|
+
switch (tag >>> 3) {
|
|
3780
|
+
case 1: {
|
|
3781
|
+
if (tag !== 10) {
|
|
3782
|
+
break;
|
|
3783
|
+
}
|
|
3784
|
+
message.key = reader.string();
|
|
3785
|
+
continue;
|
|
3786
|
+
}
|
|
3787
|
+
case 2: {
|
|
3788
|
+
if (tag !== 18) {
|
|
3789
|
+
break;
|
|
3790
|
+
}
|
|
3791
|
+
message.value = reader.string();
|
|
3792
|
+
continue;
|
|
3793
|
+
}
|
|
3794
|
+
}
|
|
3795
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3796
|
+
break;
|
|
3797
|
+
}
|
|
3798
|
+
reader.skip(tag & 7);
|
|
3799
|
+
}
|
|
3800
|
+
return message;
|
|
3801
|
+
}
|
|
3802
|
+
};
|
|
3803
|
+
function createBasePasswordOAuthFlow() {
|
|
3804
|
+
return { tokenUrl: "", refreshUrl: "", scopes: {} };
|
|
3805
|
+
}
|
|
3806
|
+
var PasswordOAuthFlow = {
|
|
3807
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3808
|
+
if (message.tokenUrl !== "") {
|
|
3809
|
+
writer.uint32(10).string(message.tokenUrl);
|
|
3810
|
+
}
|
|
3811
|
+
if (message.refreshUrl !== "") {
|
|
3812
|
+
writer.uint32(18).string(message.refreshUrl);
|
|
3813
|
+
}
|
|
3814
|
+
Object.entries(message.scopes).forEach(([key, value]) => {
|
|
3815
|
+
PasswordOAuthFlow_ScopesEntry.encode({ key, value }, writer.uint32(26).fork()).join();
|
|
3816
|
+
});
|
|
3817
|
+
return writer;
|
|
3818
|
+
},
|
|
3819
|
+
decode(input, length) {
|
|
3820
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3821
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3822
|
+
const message = createBasePasswordOAuthFlow();
|
|
3823
|
+
while (reader.pos < end) {
|
|
3824
|
+
const tag = reader.uint32();
|
|
3825
|
+
switch (tag >>> 3) {
|
|
3826
|
+
case 1: {
|
|
3827
|
+
if (tag !== 10) {
|
|
3828
|
+
break;
|
|
3829
|
+
}
|
|
3830
|
+
message.tokenUrl = reader.string();
|
|
3831
|
+
continue;
|
|
3832
|
+
}
|
|
3833
|
+
case 2: {
|
|
3834
|
+
if (tag !== 18) {
|
|
3835
|
+
break;
|
|
3836
|
+
}
|
|
3837
|
+
message.refreshUrl = reader.string();
|
|
3838
|
+
continue;
|
|
3839
|
+
}
|
|
3840
|
+
case 3: {
|
|
3841
|
+
if (tag !== 26) {
|
|
3842
|
+
break;
|
|
3843
|
+
}
|
|
3844
|
+
const entry3 = PasswordOAuthFlow_ScopesEntry.decode(reader, reader.uint32());
|
|
3845
|
+
if (entry3.value !== void 0) {
|
|
3846
|
+
message.scopes[entry3.key] = entry3.value;
|
|
3847
|
+
}
|
|
3848
|
+
continue;
|
|
3849
|
+
}
|
|
3850
|
+
}
|
|
3851
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3852
|
+
break;
|
|
3853
|
+
}
|
|
3854
|
+
reader.skip(tag & 7);
|
|
3855
|
+
}
|
|
3856
|
+
return message;
|
|
3857
|
+
}
|
|
3858
|
+
};
|
|
3859
|
+
function createBasePasswordOAuthFlow_ScopesEntry() {
|
|
3860
|
+
return { key: "", value: "" };
|
|
3861
|
+
}
|
|
3862
|
+
var PasswordOAuthFlow_ScopesEntry = {
|
|
3863
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3864
|
+
if (message.key !== "") {
|
|
3865
|
+
writer.uint32(10).string(message.key);
|
|
3866
|
+
}
|
|
3867
|
+
if (message.value !== "") {
|
|
3868
|
+
writer.uint32(18).string(message.value);
|
|
3869
|
+
}
|
|
3870
|
+
return writer;
|
|
3871
|
+
},
|
|
3872
|
+
decode(input, length) {
|
|
3873
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3874
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3875
|
+
const message = createBasePasswordOAuthFlow_ScopesEntry();
|
|
3876
|
+
while (reader.pos < end) {
|
|
3877
|
+
const tag = reader.uint32();
|
|
3878
|
+
switch (tag >>> 3) {
|
|
3879
|
+
case 1: {
|
|
3880
|
+
if (tag !== 10) {
|
|
3881
|
+
break;
|
|
3882
|
+
}
|
|
3883
|
+
message.key = reader.string();
|
|
3884
|
+
continue;
|
|
3885
|
+
}
|
|
3886
|
+
case 2: {
|
|
3887
|
+
if (tag !== 18) {
|
|
3888
|
+
break;
|
|
3889
|
+
}
|
|
3890
|
+
message.value = reader.string();
|
|
3891
|
+
continue;
|
|
3892
|
+
}
|
|
3893
|
+
}
|
|
3894
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3895
|
+
break;
|
|
3896
|
+
}
|
|
3897
|
+
reader.skip(tag & 7);
|
|
3898
|
+
}
|
|
3899
|
+
return message;
|
|
3900
|
+
}
|
|
3901
|
+
};
|
|
3902
|
+
function createBaseSendMessageRequest() {
|
|
3903
|
+
return { request: void 0, configuration: void 0, metadata: void 0 };
|
|
3904
|
+
}
|
|
3905
|
+
var SendMessageRequest3 = {
|
|
3906
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3907
|
+
if (message.request !== void 0) {
|
|
3908
|
+
Message3.encode(message.request, writer.uint32(10).fork()).join();
|
|
3909
|
+
}
|
|
3910
|
+
if (message.configuration !== void 0) {
|
|
3911
|
+
SendMessageConfiguration3.encode(message.configuration, writer.uint32(18).fork()).join();
|
|
3912
|
+
}
|
|
3913
|
+
if (message.metadata !== void 0) {
|
|
3914
|
+
Struct.encode(Struct.wrap(message.metadata), writer.uint32(26).fork()).join();
|
|
3915
|
+
}
|
|
3916
|
+
return writer;
|
|
3917
|
+
},
|
|
3918
|
+
decode(input, length) {
|
|
3919
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3920
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3921
|
+
const message = createBaseSendMessageRequest();
|
|
3922
|
+
while (reader.pos < end) {
|
|
3923
|
+
const tag = reader.uint32();
|
|
3924
|
+
switch (tag >>> 3) {
|
|
3925
|
+
case 1: {
|
|
3926
|
+
if (tag !== 10) {
|
|
3927
|
+
break;
|
|
3928
|
+
}
|
|
3929
|
+
message.request = Message3.decode(reader, reader.uint32());
|
|
3930
|
+
continue;
|
|
3931
|
+
}
|
|
3932
|
+
case 2: {
|
|
3933
|
+
if (tag !== 18) {
|
|
3934
|
+
break;
|
|
3935
|
+
}
|
|
3936
|
+
message.configuration = SendMessageConfiguration3.decode(reader, reader.uint32());
|
|
3937
|
+
continue;
|
|
3938
|
+
}
|
|
3939
|
+
case 3: {
|
|
3940
|
+
if (tag !== 26) {
|
|
3941
|
+
break;
|
|
3942
|
+
}
|
|
3943
|
+
message.metadata = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
3944
|
+
continue;
|
|
3945
|
+
}
|
|
3946
|
+
}
|
|
3947
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3948
|
+
break;
|
|
3949
|
+
}
|
|
3950
|
+
reader.skip(tag & 7);
|
|
3951
|
+
}
|
|
3952
|
+
return message;
|
|
3953
|
+
}
|
|
3954
|
+
};
|
|
3955
|
+
function createBaseGetTaskRequest() {
|
|
3956
|
+
return { name: "", historyLength: 0 };
|
|
3957
|
+
}
|
|
3958
|
+
var GetTaskRequest3 = {
|
|
3959
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
3960
|
+
if (message.name !== "") {
|
|
3961
|
+
writer.uint32(10).string(message.name);
|
|
3962
|
+
}
|
|
3963
|
+
if (message.historyLength !== 0) {
|
|
3964
|
+
writer.uint32(16).int32(message.historyLength);
|
|
3965
|
+
}
|
|
3966
|
+
return writer;
|
|
3967
|
+
},
|
|
3968
|
+
decode(input, length) {
|
|
3969
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
3970
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
3971
|
+
const message = createBaseGetTaskRequest();
|
|
3972
|
+
while (reader.pos < end) {
|
|
3973
|
+
const tag = reader.uint32();
|
|
3974
|
+
switch (tag >>> 3) {
|
|
3975
|
+
case 1: {
|
|
3976
|
+
if (tag !== 10) {
|
|
3977
|
+
break;
|
|
3978
|
+
}
|
|
3979
|
+
message.name = reader.string();
|
|
3980
|
+
continue;
|
|
3981
|
+
}
|
|
3982
|
+
case 2: {
|
|
3983
|
+
if (tag !== 16) {
|
|
3984
|
+
break;
|
|
3985
|
+
}
|
|
3986
|
+
message.historyLength = reader.int32();
|
|
3987
|
+
continue;
|
|
3988
|
+
}
|
|
3989
|
+
}
|
|
3990
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3991
|
+
break;
|
|
3992
|
+
}
|
|
3993
|
+
reader.skip(tag & 7);
|
|
3994
|
+
}
|
|
3995
|
+
return message;
|
|
3996
|
+
}
|
|
3997
|
+
};
|
|
3998
|
+
function createBaseCancelTaskRequest() {
|
|
3999
|
+
return { name: "" };
|
|
4000
|
+
}
|
|
4001
|
+
var CancelTaskRequest3 = {
|
|
4002
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4003
|
+
if (message.name !== "") {
|
|
4004
|
+
writer.uint32(10).string(message.name);
|
|
4005
|
+
}
|
|
4006
|
+
return writer;
|
|
4007
|
+
},
|
|
4008
|
+
decode(input, length) {
|
|
4009
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4010
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4011
|
+
const message = createBaseCancelTaskRequest();
|
|
4012
|
+
while (reader.pos < end) {
|
|
4013
|
+
const tag = reader.uint32();
|
|
4014
|
+
switch (tag >>> 3) {
|
|
4015
|
+
case 1: {
|
|
4016
|
+
if (tag !== 10) {
|
|
4017
|
+
break;
|
|
4018
|
+
}
|
|
4019
|
+
message.name = reader.string();
|
|
4020
|
+
continue;
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4024
|
+
break;
|
|
4025
|
+
}
|
|
4026
|
+
reader.skip(tag & 7);
|
|
4027
|
+
}
|
|
4028
|
+
return message;
|
|
4029
|
+
}
|
|
4030
|
+
};
|
|
4031
|
+
function createBaseGetTaskPushNotificationConfigRequest() {
|
|
4032
|
+
return { name: "" };
|
|
4033
|
+
}
|
|
4034
|
+
var GetTaskPushNotificationConfigRequest3 = {
|
|
4035
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4036
|
+
if (message.name !== "") {
|
|
4037
|
+
writer.uint32(10).string(message.name);
|
|
4038
|
+
}
|
|
4039
|
+
return writer;
|
|
4040
|
+
},
|
|
4041
|
+
decode(input, length) {
|
|
4042
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4043
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4044
|
+
const message = createBaseGetTaskPushNotificationConfigRequest();
|
|
4045
|
+
while (reader.pos < end) {
|
|
4046
|
+
const tag = reader.uint32();
|
|
4047
|
+
switch (tag >>> 3) {
|
|
4048
|
+
case 1: {
|
|
4049
|
+
if (tag !== 10) {
|
|
4050
|
+
break;
|
|
4051
|
+
}
|
|
4052
|
+
message.name = reader.string();
|
|
4053
|
+
continue;
|
|
4054
|
+
}
|
|
4055
|
+
}
|
|
4056
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4057
|
+
break;
|
|
4058
|
+
}
|
|
4059
|
+
reader.skip(tag & 7);
|
|
4060
|
+
}
|
|
4061
|
+
return message;
|
|
4062
|
+
}
|
|
4063
|
+
};
|
|
4064
|
+
function createBaseDeleteTaskPushNotificationConfigRequest() {
|
|
4065
|
+
return { name: "" };
|
|
4066
|
+
}
|
|
4067
|
+
var DeleteTaskPushNotificationConfigRequest3 = {
|
|
4068
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4069
|
+
if (message.name !== "") {
|
|
4070
|
+
writer.uint32(10).string(message.name);
|
|
4071
|
+
}
|
|
4072
|
+
return writer;
|
|
4073
|
+
},
|
|
4074
|
+
decode(input, length) {
|
|
4075
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4076
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4077
|
+
const message = createBaseDeleteTaskPushNotificationConfigRequest();
|
|
4078
|
+
while (reader.pos < end) {
|
|
4079
|
+
const tag = reader.uint32();
|
|
4080
|
+
switch (tag >>> 3) {
|
|
4081
|
+
case 1: {
|
|
4082
|
+
if (tag !== 10) {
|
|
4083
|
+
break;
|
|
4084
|
+
}
|
|
4085
|
+
message.name = reader.string();
|
|
4086
|
+
continue;
|
|
4087
|
+
}
|
|
4088
|
+
}
|
|
4089
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4090
|
+
break;
|
|
4091
|
+
}
|
|
4092
|
+
reader.skip(tag & 7);
|
|
4093
|
+
}
|
|
4094
|
+
return message;
|
|
4095
|
+
}
|
|
4096
|
+
};
|
|
4097
|
+
function createBaseCreateTaskPushNotificationConfigRequest() {
|
|
4098
|
+
return { parent: "", configId: "", config: void 0 };
|
|
4099
|
+
}
|
|
4100
|
+
var CreateTaskPushNotificationConfigRequest3 = {
|
|
4101
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4102
|
+
if (message.parent !== "") {
|
|
4103
|
+
writer.uint32(10).string(message.parent);
|
|
4104
|
+
}
|
|
4105
|
+
if (message.configId !== "") {
|
|
4106
|
+
writer.uint32(18).string(message.configId);
|
|
4107
|
+
}
|
|
4108
|
+
if (message.config !== void 0) {
|
|
4109
|
+
TaskPushNotificationConfig3.encode(message.config, writer.uint32(26).fork()).join();
|
|
4110
|
+
}
|
|
4111
|
+
return writer;
|
|
4112
|
+
},
|
|
4113
|
+
decode(input, length) {
|
|
4114
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4115
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4116
|
+
const message = createBaseCreateTaskPushNotificationConfigRequest();
|
|
4117
|
+
while (reader.pos < end) {
|
|
4118
|
+
const tag = reader.uint32();
|
|
4119
|
+
switch (tag >>> 3) {
|
|
4120
|
+
case 1: {
|
|
4121
|
+
if (tag !== 10) {
|
|
4122
|
+
break;
|
|
4123
|
+
}
|
|
4124
|
+
message.parent = reader.string();
|
|
4125
|
+
continue;
|
|
4126
|
+
}
|
|
4127
|
+
case 2: {
|
|
4128
|
+
if (tag !== 18) {
|
|
4129
|
+
break;
|
|
4130
|
+
}
|
|
4131
|
+
message.configId = reader.string();
|
|
4132
|
+
continue;
|
|
4133
|
+
}
|
|
4134
|
+
case 3: {
|
|
4135
|
+
if (tag !== 26) {
|
|
4136
|
+
break;
|
|
4137
|
+
}
|
|
4138
|
+
message.config = TaskPushNotificationConfig3.decode(reader, reader.uint32());
|
|
4139
|
+
continue;
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4143
|
+
break;
|
|
4144
|
+
}
|
|
4145
|
+
reader.skip(tag & 7);
|
|
4146
|
+
}
|
|
4147
|
+
return message;
|
|
4148
|
+
}
|
|
4149
|
+
};
|
|
4150
|
+
function createBaseTaskSubscriptionRequest() {
|
|
4151
|
+
return { name: "" };
|
|
4152
|
+
}
|
|
4153
|
+
var TaskSubscriptionRequest2 = {
|
|
4154
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4155
|
+
if (message.name !== "") {
|
|
4156
|
+
writer.uint32(10).string(message.name);
|
|
4157
|
+
}
|
|
4158
|
+
return writer;
|
|
4159
|
+
},
|
|
4160
|
+
decode(input, length) {
|
|
4161
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4162
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4163
|
+
const message = createBaseTaskSubscriptionRequest();
|
|
4164
|
+
while (reader.pos < end) {
|
|
4165
|
+
const tag = reader.uint32();
|
|
4166
|
+
switch (tag >>> 3) {
|
|
4167
|
+
case 1: {
|
|
4168
|
+
if (tag !== 10) {
|
|
4169
|
+
break;
|
|
4170
|
+
}
|
|
4171
|
+
message.name = reader.string();
|
|
4172
|
+
continue;
|
|
4173
|
+
}
|
|
4174
|
+
}
|
|
4175
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4176
|
+
break;
|
|
4177
|
+
}
|
|
4178
|
+
reader.skip(tag & 7);
|
|
4179
|
+
}
|
|
4180
|
+
return message;
|
|
4181
|
+
}
|
|
4182
|
+
};
|
|
4183
|
+
function createBaseListTaskPushNotificationConfigRequest() {
|
|
4184
|
+
return { parent: "", pageSize: 0, pageToken: "" };
|
|
4185
|
+
}
|
|
4186
|
+
var ListTaskPushNotificationConfigRequest3 = {
|
|
4187
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4188
|
+
if (message.parent !== "") {
|
|
4189
|
+
writer.uint32(10).string(message.parent);
|
|
4190
|
+
}
|
|
4191
|
+
if (message.pageSize !== 0) {
|
|
4192
|
+
writer.uint32(16).int32(message.pageSize);
|
|
4193
|
+
}
|
|
4194
|
+
if (message.pageToken !== "") {
|
|
4195
|
+
writer.uint32(26).string(message.pageToken);
|
|
4196
|
+
}
|
|
4197
|
+
return writer;
|
|
4198
|
+
},
|
|
4199
|
+
decode(input, length) {
|
|
4200
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4201
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4202
|
+
const message = createBaseListTaskPushNotificationConfigRequest();
|
|
4203
|
+
while (reader.pos < end) {
|
|
4204
|
+
const tag = reader.uint32();
|
|
4205
|
+
switch (tag >>> 3) {
|
|
4206
|
+
case 1: {
|
|
4207
|
+
if (tag !== 10) {
|
|
4208
|
+
break;
|
|
4209
|
+
}
|
|
4210
|
+
message.parent = reader.string();
|
|
4211
|
+
continue;
|
|
4212
|
+
}
|
|
4213
|
+
case 2: {
|
|
4214
|
+
if (tag !== 16) {
|
|
4215
|
+
break;
|
|
4216
|
+
}
|
|
4217
|
+
message.pageSize = reader.int32();
|
|
4218
|
+
continue;
|
|
4219
|
+
}
|
|
4220
|
+
case 3: {
|
|
4221
|
+
if (tag !== 26) {
|
|
4222
|
+
break;
|
|
4223
|
+
}
|
|
4224
|
+
message.pageToken = reader.string();
|
|
4225
|
+
continue;
|
|
4226
|
+
}
|
|
4227
|
+
}
|
|
4228
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4229
|
+
break;
|
|
4230
|
+
}
|
|
4231
|
+
reader.skip(tag & 7);
|
|
4232
|
+
}
|
|
4233
|
+
return message;
|
|
4234
|
+
}
|
|
4235
|
+
};
|
|
4236
|
+
function createBaseGetAgentCardRequest() {
|
|
4237
|
+
return {};
|
|
4238
|
+
}
|
|
4239
|
+
var GetAgentCardRequest2 = {
|
|
4240
|
+
encode(_, writer = new import_wire4.BinaryWriter()) {
|
|
4241
|
+
return writer;
|
|
4242
|
+
},
|
|
4243
|
+
decode(input, length) {
|
|
4244
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4245
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4246
|
+
const message = createBaseGetAgentCardRequest();
|
|
4247
|
+
while (reader.pos < end) {
|
|
4248
|
+
const tag = reader.uint32();
|
|
4249
|
+
switch (tag >>> 3) {
|
|
4250
|
+
}
|
|
4251
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4252
|
+
break;
|
|
4253
|
+
}
|
|
4254
|
+
reader.skip(tag & 7);
|
|
4255
|
+
}
|
|
4256
|
+
return message;
|
|
4257
|
+
}
|
|
4258
|
+
};
|
|
4259
|
+
function createBaseSendMessageResponse() {
|
|
4260
|
+
return { payload: void 0 };
|
|
4261
|
+
}
|
|
4262
|
+
var SendMessageResponse3 = {
|
|
4263
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4264
|
+
switch (message.payload?.$case) {
|
|
4265
|
+
case "task":
|
|
4266
|
+
Task3.encode(message.payload.value, writer.uint32(10).fork()).join();
|
|
4267
|
+
break;
|
|
4268
|
+
case "msg":
|
|
4269
|
+
Message3.encode(message.payload.value, writer.uint32(18).fork()).join();
|
|
4270
|
+
break;
|
|
4271
|
+
}
|
|
4272
|
+
return writer;
|
|
4273
|
+
},
|
|
4274
|
+
decode(input, length) {
|
|
4275
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4276
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4277
|
+
const message = createBaseSendMessageResponse();
|
|
4278
|
+
while (reader.pos < end) {
|
|
4279
|
+
const tag = reader.uint32();
|
|
4280
|
+
switch (tag >>> 3) {
|
|
4281
|
+
case 1: {
|
|
4282
|
+
if (tag !== 10) {
|
|
4283
|
+
break;
|
|
4284
|
+
}
|
|
4285
|
+
message.payload = { $case: "task", value: Task3.decode(reader, reader.uint32()) };
|
|
4286
|
+
continue;
|
|
4287
|
+
}
|
|
4288
|
+
case 2: {
|
|
4289
|
+
if (tag !== 18) {
|
|
4290
|
+
break;
|
|
4291
|
+
}
|
|
4292
|
+
message.payload = { $case: "msg", value: Message3.decode(reader, reader.uint32()) };
|
|
4293
|
+
continue;
|
|
4294
|
+
}
|
|
4295
|
+
}
|
|
4296
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4297
|
+
break;
|
|
4298
|
+
}
|
|
4299
|
+
reader.skip(tag & 7);
|
|
4300
|
+
}
|
|
4301
|
+
return message;
|
|
4302
|
+
}
|
|
4303
|
+
};
|
|
4304
|
+
function createBaseStreamResponse() {
|
|
4305
|
+
return { payload: void 0 };
|
|
4306
|
+
}
|
|
4307
|
+
var StreamResponse3 = {
|
|
4308
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4309
|
+
switch (message.payload?.$case) {
|
|
4310
|
+
case "task":
|
|
4311
|
+
Task3.encode(message.payload.value, writer.uint32(10).fork()).join();
|
|
4312
|
+
break;
|
|
4313
|
+
case "msg":
|
|
4314
|
+
Message3.encode(message.payload.value, writer.uint32(18).fork()).join();
|
|
4315
|
+
break;
|
|
4316
|
+
case "statusUpdate":
|
|
4317
|
+
TaskStatusUpdateEvent3.encode(message.payload.value, writer.uint32(26).fork()).join();
|
|
4318
|
+
break;
|
|
4319
|
+
case "artifactUpdate":
|
|
4320
|
+
TaskArtifactUpdateEvent3.encode(message.payload.value, writer.uint32(34).fork()).join();
|
|
4321
|
+
break;
|
|
4322
|
+
}
|
|
4323
|
+
return writer;
|
|
4324
|
+
},
|
|
4325
|
+
decode(input, length) {
|
|
4326
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4327
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4328
|
+
const message = createBaseStreamResponse();
|
|
4329
|
+
while (reader.pos < end) {
|
|
4330
|
+
const tag = reader.uint32();
|
|
4331
|
+
switch (tag >>> 3) {
|
|
4332
|
+
case 1: {
|
|
4333
|
+
if (tag !== 10) {
|
|
4334
|
+
break;
|
|
4335
|
+
}
|
|
4336
|
+
message.payload = { $case: "task", value: Task3.decode(reader, reader.uint32()) };
|
|
4337
|
+
continue;
|
|
4338
|
+
}
|
|
4339
|
+
case 2: {
|
|
4340
|
+
if (tag !== 18) {
|
|
4341
|
+
break;
|
|
4342
|
+
}
|
|
4343
|
+
message.payload = { $case: "msg", value: Message3.decode(reader, reader.uint32()) };
|
|
4344
|
+
continue;
|
|
4345
|
+
}
|
|
4346
|
+
case 3: {
|
|
4347
|
+
if (tag !== 26) {
|
|
4348
|
+
break;
|
|
4349
|
+
}
|
|
4350
|
+
message.payload = { $case: "statusUpdate", value: TaskStatusUpdateEvent3.decode(reader, reader.uint32()) };
|
|
4351
|
+
continue;
|
|
4352
|
+
}
|
|
4353
|
+
case 4: {
|
|
4354
|
+
if (tag !== 34) {
|
|
4355
|
+
break;
|
|
4356
|
+
}
|
|
4357
|
+
message.payload = { $case: "artifactUpdate", value: TaskArtifactUpdateEvent3.decode(reader, reader.uint32()) };
|
|
4358
|
+
continue;
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4362
|
+
break;
|
|
4363
|
+
}
|
|
4364
|
+
reader.skip(tag & 7);
|
|
4365
|
+
}
|
|
4366
|
+
return message;
|
|
4367
|
+
}
|
|
4368
|
+
};
|
|
4369
|
+
function createBaseListTaskPushNotificationConfigResponse() {
|
|
4370
|
+
return { configs: [], nextPageToken: "" };
|
|
4371
|
+
}
|
|
4372
|
+
var ListTaskPushNotificationConfigResponse3 = {
|
|
4373
|
+
encode(message, writer = new import_wire4.BinaryWriter()) {
|
|
4374
|
+
for (const v of message.configs) {
|
|
4375
|
+
TaskPushNotificationConfig3.encode(v, writer.uint32(10).fork()).join();
|
|
4376
|
+
}
|
|
4377
|
+
if (message.nextPageToken !== "") {
|
|
4378
|
+
writer.uint32(18).string(message.nextPageToken);
|
|
4379
|
+
}
|
|
4380
|
+
return writer;
|
|
4381
|
+
},
|
|
4382
|
+
decode(input, length) {
|
|
4383
|
+
const reader = input instanceof import_wire4.BinaryReader ? input : new import_wire4.BinaryReader(input);
|
|
4384
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
4385
|
+
const message = createBaseListTaskPushNotificationConfigResponse();
|
|
4386
|
+
while (reader.pos < end) {
|
|
4387
|
+
const tag = reader.uint32();
|
|
4388
|
+
switch (tag >>> 3) {
|
|
4389
|
+
case 1: {
|
|
4390
|
+
if (tag !== 10) {
|
|
4391
|
+
break;
|
|
4392
|
+
}
|
|
4393
|
+
message.configs.push(TaskPushNotificationConfig3.decode(reader, reader.uint32()));
|
|
4394
|
+
continue;
|
|
4395
|
+
}
|
|
4396
|
+
case 2: {
|
|
4397
|
+
if (tag !== 18) {
|
|
4398
|
+
break;
|
|
4399
|
+
}
|
|
4400
|
+
message.nextPageToken = reader.string();
|
|
4401
|
+
continue;
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
4405
|
+
break;
|
|
4406
|
+
}
|
|
4407
|
+
reader.skip(tag & 7);
|
|
4408
|
+
}
|
|
4409
|
+
return message;
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
var A2AServiceService = {
|
|
4413
|
+
/**
|
|
4414
|
+
* Send a message to the agent. This is a blocking call that will return the
|
|
4415
|
+
* task once it is completed, or a LRO if requested.
|
|
4416
|
+
*/
|
|
4417
|
+
sendMessage: {
|
|
4418
|
+
path: "/a2a.v1.A2AService/SendMessage",
|
|
4419
|
+
requestStream: false,
|
|
4420
|
+
responseStream: false,
|
|
4421
|
+
requestSerialize: (value) => Buffer.from(SendMessageRequest3.encode(value).finish()),
|
|
4422
|
+
requestDeserialize: (value) => SendMessageRequest3.decode(value),
|
|
4423
|
+
responseSerialize: (value) => Buffer.from(SendMessageResponse3.encode(value).finish()),
|
|
4424
|
+
responseDeserialize: (value) => SendMessageResponse3.decode(value)
|
|
4425
|
+
},
|
|
4426
|
+
/**
|
|
4427
|
+
* SendStreamingMessage is a streaming call that will return a stream of
|
|
4428
|
+
* task update events until the Task is in an interrupted or terminal state.
|
|
4429
|
+
*/
|
|
4430
|
+
sendStreamingMessage: {
|
|
4431
|
+
path: "/a2a.v1.A2AService/SendStreamingMessage",
|
|
4432
|
+
requestStream: false,
|
|
4433
|
+
responseStream: true,
|
|
4434
|
+
requestSerialize: (value) => Buffer.from(SendMessageRequest3.encode(value).finish()),
|
|
4435
|
+
requestDeserialize: (value) => SendMessageRequest3.decode(value),
|
|
4436
|
+
responseSerialize: (value) => Buffer.from(StreamResponse3.encode(value).finish()),
|
|
4437
|
+
responseDeserialize: (value) => StreamResponse3.decode(value)
|
|
4438
|
+
},
|
|
4439
|
+
/** Get the current state of a task from the agent. */
|
|
4440
|
+
getTask: {
|
|
4441
|
+
path: "/a2a.v1.A2AService/GetTask",
|
|
4442
|
+
requestStream: false,
|
|
4443
|
+
responseStream: false,
|
|
4444
|
+
requestSerialize: (value) => Buffer.from(GetTaskRequest3.encode(value).finish()),
|
|
4445
|
+
requestDeserialize: (value) => GetTaskRequest3.decode(value),
|
|
4446
|
+
responseSerialize: (value) => Buffer.from(Task3.encode(value).finish()),
|
|
4447
|
+
responseDeserialize: (value) => Task3.decode(value)
|
|
4448
|
+
},
|
|
4449
|
+
/**
|
|
4450
|
+
* Cancel a task from the agent. If supported one should expect no
|
|
4451
|
+
* more task updates for the task.
|
|
4452
|
+
*/
|
|
4453
|
+
cancelTask: {
|
|
4454
|
+
path: "/a2a.v1.A2AService/CancelTask",
|
|
4455
|
+
requestStream: false,
|
|
4456
|
+
responseStream: false,
|
|
4457
|
+
requestSerialize: (value) => Buffer.from(CancelTaskRequest3.encode(value).finish()),
|
|
4458
|
+
requestDeserialize: (value) => CancelTaskRequest3.decode(value),
|
|
4459
|
+
responseSerialize: (value) => Buffer.from(Task3.encode(value).finish()),
|
|
4460
|
+
responseDeserialize: (value) => Task3.decode(value)
|
|
4461
|
+
},
|
|
4462
|
+
/**
|
|
4463
|
+
* TaskSubscription is a streaming call that will return a stream of task
|
|
4464
|
+
* update events. This attaches the stream to an existing in process task.
|
|
4465
|
+
* If the task is complete the stream will return the completed task (like
|
|
4466
|
+
* GetTask) and close the stream.
|
|
4467
|
+
*/
|
|
4468
|
+
taskSubscription: {
|
|
4469
|
+
path: "/a2a.v1.A2AService/TaskSubscription",
|
|
4470
|
+
requestStream: false,
|
|
4471
|
+
responseStream: true,
|
|
4472
|
+
requestSerialize: (value) => Buffer.from(TaskSubscriptionRequest2.encode(value).finish()),
|
|
4473
|
+
requestDeserialize: (value) => TaskSubscriptionRequest2.decode(value),
|
|
4474
|
+
responseSerialize: (value) => Buffer.from(StreamResponse3.encode(value).finish()),
|
|
4475
|
+
responseDeserialize: (value) => StreamResponse3.decode(value)
|
|
4476
|
+
},
|
|
4477
|
+
/** Set a push notification config for a task. */
|
|
4478
|
+
createTaskPushNotificationConfig: {
|
|
4479
|
+
path: "/a2a.v1.A2AService/CreateTaskPushNotificationConfig",
|
|
4480
|
+
requestStream: false,
|
|
4481
|
+
responseStream: false,
|
|
4482
|
+
requestSerialize: (value) => Buffer.from(CreateTaskPushNotificationConfigRequest3.encode(value).finish()),
|
|
4483
|
+
requestDeserialize: (value) => CreateTaskPushNotificationConfigRequest3.decode(value),
|
|
4484
|
+
responseSerialize: (value) => Buffer.from(TaskPushNotificationConfig3.encode(value).finish()),
|
|
4485
|
+
responseDeserialize: (value) => TaskPushNotificationConfig3.decode(value)
|
|
4486
|
+
},
|
|
4487
|
+
/** Get a push notification config for a task. */
|
|
4488
|
+
getTaskPushNotificationConfig: {
|
|
4489
|
+
path: "/a2a.v1.A2AService/GetTaskPushNotificationConfig",
|
|
4490
|
+
requestStream: false,
|
|
4491
|
+
responseStream: false,
|
|
4492
|
+
requestSerialize: (value) => Buffer.from(GetTaskPushNotificationConfigRequest3.encode(value).finish()),
|
|
4493
|
+
requestDeserialize: (value) => GetTaskPushNotificationConfigRequest3.decode(value),
|
|
4494
|
+
responseSerialize: (value) => Buffer.from(TaskPushNotificationConfig3.encode(value).finish()),
|
|
4495
|
+
responseDeserialize: (value) => TaskPushNotificationConfig3.decode(value)
|
|
4496
|
+
},
|
|
4497
|
+
/** Get a list of push notifications configured for a task. */
|
|
4498
|
+
listTaskPushNotificationConfig: {
|
|
4499
|
+
path: "/a2a.v1.A2AService/ListTaskPushNotificationConfig",
|
|
4500
|
+
requestStream: false,
|
|
4501
|
+
responseStream: false,
|
|
4502
|
+
requestSerialize: (value) => Buffer.from(ListTaskPushNotificationConfigRequest3.encode(value).finish()),
|
|
4503
|
+
requestDeserialize: (value) => ListTaskPushNotificationConfigRequest3.decode(value),
|
|
4504
|
+
responseSerialize: (value) => Buffer.from(ListTaskPushNotificationConfigResponse3.encode(value).finish()),
|
|
4505
|
+
responseDeserialize: (value) => ListTaskPushNotificationConfigResponse3.decode(value)
|
|
4506
|
+
},
|
|
4507
|
+
/** GetAgentCard returns the agent card for the agent. */
|
|
4508
|
+
getAgentCard: {
|
|
4509
|
+
path: "/a2a.v1.A2AService/GetAgentCard",
|
|
4510
|
+
requestStream: false,
|
|
4511
|
+
responseStream: false,
|
|
4512
|
+
requestSerialize: (value) => Buffer.from(GetAgentCardRequest2.encode(value).finish()),
|
|
4513
|
+
requestDeserialize: (value) => GetAgentCardRequest2.decode(value),
|
|
4514
|
+
responseSerialize: (value) => Buffer.from(AgentCard3.encode(value).finish()),
|
|
4515
|
+
responseDeserialize: (value) => AgentCard3.decode(value)
|
|
4516
|
+
},
|
|
4517
|
+
/** Delete a push notification config for a task. */
|
|
4518
|
+
deleteTaskPushNotificationConfig: {
|
|
4519
|
+
path: "/a2a.v1.A2AService/DeleteTaskPushNotificationConfig",
|
|
4520
|
+
requestStream: false,
|
|
4521
|
+
responseStream: false,
|
|
4522
|
+
requestSerialize: (value) => Buffer.from(DeleteTaskPushNotificationConfigRequest3.encode(value).finish()),
|
|
4523
|
+
requestDeserialize: (value) => DeleteTaskPushNotificationConfigRequest3.decode(value),
|
|
4524
|
+
responseSerialize: (value) => Buffer.from(Empty.encode(value).finish()),
|
|
4525
|
+
responseDeserialize: (value) => Empty.decode(value)
|
|
4526
|
+
}
|
|
4527
|
+
};
|
|
4528
|
+
var A2AServiceClient = (0, import_grpc_js.makeGenericClientConstructor)(A2AServiceService, "a2a.v1.A2AService");
|
|
4529
|
+
function toTimestamp(dateStr) {
|
|
4530
|
+
const date = new globalThis.Date(dateStr);
|
|
4531
|
+
const seconds = Math.trunc(date.getTime() / 1e3);
|
|
4532
|
+
const nanos = date.getTime() % 1e3 * 1e6;
|
|
4533
|
+
return { seconds, nanos };
|
|
4534
|
+
}
|
|
4535
|
+
function fromTimestamp(t) {
|
|
4536
|
+
let millis = (t.seconds || 0) * 1e3;
|
|
4537
|
+
millis += (t.nanos || 0) / 1e6;
|
|
4538
|
+
return new globalThis.Date(millis).toISOString();
|
|
4539
|
+
}
|
|
4540
|
+
|
|
4541
|
+
// src/server/authentication/user.ts
|
|
4542
|
+
var UnauthenticatedUser = class {
|
|
4543
|
+
get isAuthenticated() {
|
|
4544
|
+
return false;
|
|
4545
|
+
}
|
|
4546
|
+
get userName() {
|
|
4547
|
+
return "";
|
|
4548
|
+
}
|
|
4549
|
+
};
|
|
4550
|
+
|
|
4551
|
+
// src/server/grpc/common.ts
|
|
4552
|
+
var UserBuilder = {
|
|
4553
|
+
noAuthentication: () => Promise.resolve(new UnauthenticatedUser())
|
|
4554
|
+
};
|
|
4555
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4556
|
+
0 && (module.exports = {
|
|
4557
|
+
A2AService,
|
|
4558
|
+
UserBuilder,
|
|
4559
|
+
grpcService
|
|
4560
|
+
});
|