@inline-chat/hermes-agent-adapter 0.0.13 → 0.0.15
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 +31 -5
- package/package.json +6 -5
- package/plugin/inline/adapter.py +92 -11
- package/plugin/inline/cli.py +5 -3
- package/plugin/inline/plugin.yaml +1 -1
- package/plugin/inline/sidecar/index.mjs +2751 -273
- package/plugin/inline/telemetry.py +222 -0
|
@@ -5570,7 +5570,7 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
5570
5570
|
import http from "node:http";
|
|
5571
5571
|
import { once } from "node:events";
|
|
5572
5572
|
import { timingSafeEqual } from "node:crypto";
|
|
5573
|
-
import { mkdir, readFile as
|
|
5573
|
+
import { mkdir, readFile as readFile3, stat } from "node:fs/promises";
|
|
5574
5574
|
import path from "node:path";
|
|
5575
5575
|
|
|
5576
5576
|
// node_modules/@inline-chat/protocol/dist/core.js
|
|
@@ -5603,6 +5603,12 @@ var BotPresenceState_Kind;
|
|
|
5603
5603
|
BotPresenceState_Kind2[BotPresenceState_Kind2["RUNNING"] = 8] = "RUNNING";
|
|
5604
5604
|
BotPresenceState_Kind2[BotPresenceState_Kind2["REVIEW"] = 9] = "REVIEW";
|
|
5605
5605
|
})(BotPresenceState_Kind || (BotPresenceState_Kind = {}));
|
|
5606
|
+
var MessageSubthread_Kind;
|
|
5607
|
+
(function(MessageSubthread_Kind2) {
|
|
5608
|
+
MessageSubthread_Kind2[MessageSubthread_Kind2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
5609
|
+
MessageSubthread_Kind2[MessageSubthread_Kind2["REPLY"] = 1] = "REPLY";
|
|
5610
|
+
MessageSubthread_Kind2[MessageSubthread_Kind2["SUBTHREAD"] = 2] = "SUBTHREAD";
|
|
5611
|
+
})(MessageSubthread_Kind || (MessageSubthread_Kind = {}));
|
|
5606
5612
|
var BlockList_Kind;
|
|
5607
5613
|
(function(BlockList_Kind2) {
|
|
5608
5614
|
BlockList_Kind2[BlockList_Kind2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
@@ -5638,6 +5644,10 @@ var MessageEntity_Type;
|
|
|
5638
5644
|
MessageEntity_Type2[MessageEntity_Type2["THREAD_TITLE"] = 12] = "THREAD_TITLE";
|
|
5639
5645
|
MessageEntity_Type2[MessageEntity_Type2["BOT_COMMAND"] = 13] = "BOT_COMMAND";
|
|
5640
5646
|
MessageEntity_Type2[MessageEntity_Type2["GROUP_MENTION"] = 14] = "GROUP_MENTION";
|
|
5647
|
+
MessageEntity_Type2[MessageEntity_Type2["UNDERLINE"] = 15] = "UNDERLINE";
|
|
5648
|
+
MessageEntity_Type2[MessageEntity_Type2["STRIKETHROUGH"] = 16] = "STRIKETHROUGH";
|
|
5649
|
+
MessageEntity_Type2[MessageEntity_Type2["HIGHLIGHT"] = 17] = "HIGHLIGHT";
|
|
5650
|
+
MessageEntity_Type2[MessageEntity_Type2["MATH"] = 18] = "MATH";
|
|
5641
5651
|
})(MessageEntity_Type || (MessageEntity_Type = {}));
|
|
5642
5652
|
var Member_Role;
|
|
5643
5653
|
(function(Member_Role2) {
|
|
@@ -5691,6 +5701,7 @@ var RpcError_Code;
|
|
|
5691
5701
|
RpcError_Code2[RpcError_Code2["FIRST_NAME_INVALID"] = 17] = "FIRST_NAME_INVALID";
|
|
5692
5702
|
RpcError_Code2[RpcError_Code2["URL_PREVIEW_UNAVAILABLE"] = 18] = "URL_PREVIEW_UNAVAILABLE";
|
|
5693
5703
|
RpcError_Code2[RpcError_Code2["AGENT_SESSION_MESSAGE_IMMUTABLE"] = 19] = "AGENT_SESSION_MESSAGE_IMMUTABLE";
|
|
5704
|
+
RpcError_Code2[RpcError_Code2["SPACE_INVITE_INVALID"] = 20] = "SPACE_INVITE_INVALID";
|
|
5694
5705
|
})(RpcError_Code || (RpcError_Code = {}));
|
|
5695
5706
|
var SyncSkippedSequence_Reason;
|
|
5696
5707
|
(function(SyncSkippedSequence_Reason2) {
|
|
@@ -5774,6 +5785,7 @@ var BotCapability_Kind;
|
|
|
5774
5785
|
(function(BotCapability_Kind2) {
|
|
5775
5786
|
BotCapability_Kind2[BotCapability_Kind2["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
5776
5787
|
BotCapability_Kind2[BotCapability_Kind2["CHAT_SETTINGS"] = 1] = "CHAT_SETTINGS";
|
|
5788
|
+
BotCapability_Kind2[BotCapability_Kind2["AGENT_CONFIGURATION"] = 2] = "AGENT_CONFIGURATION";
|
|
5777
5789
|
})(BotCapability_Kind || (BotCapability_Kind = {}));
|
|
5778
5790
|
var BotChatSettingsInfo_Tone;
|
|
5779
5791
|
(function(BotChatSettingsInfo_Tone2) {
|
|
@@ -5996,6 +6008,14 @@ var Method;
|
|
|
5996
6008
|
Method2[Method2["GET_AGENT_SESSION"] = 130] = "GET_AGENT_SESSION";
|
|
5997
6009
|
Method2[Method2["UPDATE_BOT_AGENT"] = 131] = "UPDATE_BOT_AGENT";
|
|
5998
6010
|
Method2[Method2["DELETE_BOT_AGENT"] = 132] = "DELETE_BOT_AGENT";
|
|
6011
|
+
Method2[Method2["JOIN_SPACE_BY_INVITE_TOKEN"] = 133] = "JOIN_SPACE_BY_INVITE_TOKEN";
|
|
6012
|
+
Method2[Method2["GET_SPACE_INVITE_LINK"] = 134] = "GET_SPACE_INVITE_LINK";
|
|
6013
|
+
Method2[Method2["SET_SPACE_INVITE_LINK_ENABLED"] = 135] = "SET_SPACE_INVITE_LINK_ENABLED";
|
|
6014
|
+
Method2[Method2["GET_FILE_PART"] = 136] = "GET_FILE_PART";
|
|
6015
|
+
Method2[Method2["ACKNOWLEDGE_MESSAGES"] = 137] = "ACKNOWLEDGE_MESSAGES";
|
|
6016
|
+
Method2[Method2["GET_USERS"] = 138] = "GET_USERS";
|
|
6017
|
+
Method2[Method2["GET_BOT_SKILLS"] = 139] = "GET_BOT_SKILLS";
|
|
6018
|
+
Method2[Method2["GET_BOT_CONFIGURATION_CATALOG"] = 140] = "GET_BOT_CONFIGURATION_CATALOG";
|
|
5999
6019
|
})(Method || (Method = {}));
|
|
6000
6020
|
var GridConnectionUnavailableReason;
|
|
6001
6021
|
(function(GridConnectionUnavailableReason2) {
|
|
@@ -7898,6 +7918,115 @@ class ChatPermissions$Type extends import_runtime4.MessageType {
|
|
|
7898
7918
|
}
|
|
7899
7919
|
var ChatPermissions = new ChatPermissions$Type;
|
|
7900
7920
|
|
|
7921
|
+
class AgentThreadContext$Type extends import_runtime4.MessageType {
|
|
7922
|
+
constructor() {
|
|
7923
|
+
super("AgentThreadContext", [
|
|
7924
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
|
|
7925
|
+
{ no: 2, name: "agent_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
7926
|
+
{ no: 3, name: "configuration", kind: "message", T: () => AgentThreadConfiguration }
|
|
7927
|
+
]);
|
|
7928
|
+
}
|
|
7929
|
+
create(value) {
|
|
7930
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
7931
|
+
message.botUserId = 0n;
|
|
7932
|
+
if (value !== undefined)
|
|
7933
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
7934
|
+
return message;
|
|
7935
|
+
}
|
|
7936
|
+
internalBinaryRead(reader, length, options, target) {
|
|
7937
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
7938
|
+
while (reader.pos < end) {
|
|
7939
|
+
let [fieldNo, wireType] = reader.tag();
|
|
7940
|
+
switch (fieldNo) {
|
|
7941
|
+
case 1:
|
|
7942
|
+
message.botUserId = reader.int64().toBigInt();
|
|
7943
|
+
break;
|
|
7944
|
+
case 2:
|
|
7945
|
+
message.agentId = reader.int64().toBigInt();
|
|
7946
|
+
break;
|
|
7947
|
+
case 3:
|
|
7948
|
+
message.configuration = AgentThreadConfiguration.internalBinaryRead(reader, reader.uint32(), options, message.configuration);
|
|
7949
|
+
break;
|
|
7950
|
+
default:
|
|
7951
|
+
let u = options.readUnknownField;
|
|
7952
|
+
if (u === "throw")
|
|
7953
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
7954
|
+
let d = reader.skip(wireType);
|
|
7955
|
+
if (u !== false)
|
|
7956
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
7957
|
+
}
|
|
7958
|
+
}
|
|
7959
|
+
return message;
|
|
7960
|
+
}
|
|
7961
|
+
internalBinaryWrite(message, writer, options) {
|
|
7962
|
+
if (message.botUserId !== 0n)
|
|
7963
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
7964
|
+
if (message.agentId !== undefined)
|
|
7965
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.agentId);
|
|
7966
|
+
if (message.configuration)
|
|
7967
|
+
AgentThreadConfiguration.internalBinaryWrite(message.configuration, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
7968
|
+
let u = options.writeUnknownFields;
|
|
7969
|
+
if (u !== false)
|
|
7970
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
7971
|
+
return writer;
|
|
7972
|
+
}
|
|
7973
|
+
}
|
|
7974
|
+
var AgentThreadContext = new AgentThreadContext$Type;
|
|
7975
|
+
|
|
7976
|
+
class AgentThreadConfiguration$Type extends import_runtime4.MessageType {
|
|
7977
|
+
constructor() {
|
|
7978
|
+
super("AgentThreadConfiguration", [
|
|
7979
|
+
{ no: 1, name: "project_id", kind: "scalar", opt: true, T: 9 },
|
|
7980
|
+
{ no: 2, name: "model_id", kind: "scalar", opt: true, T: 9 },
|
|
7981
|
+
{ no: 3, name: "reasoning_effort_id", kind: "scalar", opt: true, T: 9 }
|
|
7982
|
+
]);
|
|
7983
|
+
}
|
|
7984
|
+
create(value) {
|
|
7985
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
7986
|
+
if (value !== undefined)
|
|
7987
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
7988
|
+
return message;
|
|
7989
|
+
}
|
|
7990
|
+
internalBinaryRead(reader, length, options, target) {
|
|
7991
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
7992
|
+
while (reader.pos < end) {
|
|
7993
|
+
let [fieldNo, wireType] = reader.tag();
|
|
7994
|
+
switch (fieldNo) {
|
|
7995
|
+
case 1:
|
|
7996
|
+
message.projectId = reader.string();
|
|
7997
|
+
break;
|
|
7998
|
+
case 2:
|
|
7999
|
+
message.modelId = reader.string();
|
|
8000
|
+
break;
|
|
8001
|
+
case 3:
|
|
8002
|
+
message.reasoningEffortId = reader.string();
|
|
8003
|
+
break;
|
|
8004
|
+
default:
|
|
8005
|
+
let u = options.readUnknownField;
|
|
8006
|
+
if (u === "throw")
|
|
8007
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
8008
|
+
let d = reader.skip(wireType);
|
|
8009
|
+
if (u !== false)
|
|
8010
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
8011
|
+
}
|
|
8012
|
+
}
|
|
8013
|
+
return message;
|
|
8014
|
+
}
|
|
8015
|
+
internalBinaryWrite(message, writer, options) {
|
|
8016
|
+
if (message.projectId !== undefined)
|
|
8017
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.projectId);
|
|
8018
|
+
if (message.modelId !== undefined)
|
|
8019
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.modelId);
|
|
8020
|
+
if (message.reasoningEffortId !== undefined)
|
|
8021
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.reasoningEffortId);
|
|
8022
|
+
let u = options.writeUnknownFields;
|
|
8023
|
+
if (u !== false)
|
|
8024
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
8025
|
+
return writer;
|
|
8026
|
+
}
|
|
8027
|
+
}
|
|
8028
|
+
var AgentThreadConfiguration = new AgentThreadConfiguration$Type;
|
|
8029
|
+
|
|
7901
8030
|
class Chat$Type extends import_runtime4.MessageType {
|
|
7902
8031
|
constructor() {
|
|
7903
8032
|
super("Chat", [
|
|
@@ -7916,7 +8045,9 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
7916
8045
|
{ no: 13, name: "untitled", kind: "scalar", opt: true, T: 8 },
|
|
7917
8046
|
{ no: 14, name: "number", kind: "scalar", opt: true, T: 5 },
|
|
7918
8047
|
{ no: 15, name: "permissions", kind: "message", T: () => ChatPermissions },
|
|
7919
|
-
{ no: 16, name: "seq", kind: "scalar", opt: true, T: 5 }
|
|
8048
|
+
{ no: 16, name: "seq", kind: "scalar", opt: true, T: 5 },
|
|
8049
|
+
{ no: 17, name: "acknowledgements", kind: "message", T: () => ChatAcknowledgements },
|
|
8050
|
+
{ no: 18, name: "agent_context", kind: "message", T: () => AgentThreadContext }
|
|
7920
8051
|
]);
|
|
7921
8052
|
}
|
|
7922
8053
|
create(value) {
|
|
@@ -7980,6 +8111,12 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
7980
8111
|
case 16:
|
|
7981
8112
|
message.seq = reader.int32();
|
|
7982
8113
|
break;
|
|
8114
|
+
case 17:
|
|
8115
|
+
message.acknowledgements = ChatAcknowledgements.internalBinaryRead(reader, reader.uint32(), options, message.acknowledgements);
|
|
8116
|
+
break;
|
|
8117
|
+
case 18:
|
|
8118
|
+
message.agentContext = AgentThreadContext.internalBinaryRead(reader, reader.uint32(), options, message.agentContext);
|
|
8119
|
+
break;
|
|
7983
8120
|
default:
|
|
7984
8121
|
let u = options.readUnknownField;
|
|
7985
8122
|
if (u === "throw")
|
|
@@ -8024,6 +8161,10 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
8024
8161
|
ChatPermissions.internalBinaryWrite(message.permissions, writer.tag(15, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
8025
8162
|
if (message.seq !== undefined)
|
|
8026
8163
|
writer.tag(16, import_runtime.WireType.Varint).int32(message.seq);
|
|
8164
|
+
if (message.acknowledgements)
|
|
8165
|
+
ChatAcknowledgements.internalBinaryWrite(message.acknowledgements, writer.tag(17, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
8166
|
+
if (message.agentContext)
|
|
8167
|
+
AgentThreadContext.internalBinaryWrite(message.agentContext, writer.tag(18, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
8027
8168
|
let u = options.writeUnknownFields;
|
|
8028
8169
|
if (u !== false)
|
|
8029
8170
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -8104,6 +8245,91 @@ class MessageReplies$Type extends import_runtime4.MessageType {
|
|
|
8104
8245
|
}
|
|
8105
8246
|
var MessageReplies = new MessageReplies$Type;
|
|
8106
8247
|
|
|
8248
|
+
class MessageSubthread$Type extends import_runtime4.MessageType {
|
|
8249
|
+
constructor() {
|
|
8250
|
+
super("MessageSubthread", [
|
|
8251
|
+
{ no: 1, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
8252
|
+
{ no: 2, name: "kind", kind: "enum", T: () => ["MessageSubthread.Kind", MessageSubthread_Kind, "KIND_"] },
|
|
8253
|
+
{ no: 3, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
8254
|
+
{ no: 4, name: "message_count", kind: "scalar", T: 5 },
|
|
8255
|
+
{ no: 5, name: "has_unread", kind: "scalar", T: 8 },
|
|
8256
|
+
{ no: 6, name: "recent_author_user_ids", kind: "scalar", repeat: 1, T: 3, L: 0 }
|
|
8257
|
+
]);
|
|
8258
|
+
}
|
|
8259
|
+
create(value) {
|
|
8260
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
8261
|
+
message.chatId = 0n;
|
|
8262
|
+
message.kind = 0;
|
|
8263
|
+
message.messageCount = 0;
|
|
8264
|
+
message.hasUnread = false;
|
|
8265
|
+
message.recentAuthorUserIds = [];
|
|
8266
|
+
if (value !== undefined)
|
|
8267
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
8268
|
+
return message;
|
|
8269
|
+
}
|
|
8270
|
+
internalBinaryRead(reader, length, options, target) {
|
|
8271
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
8272
|
+
while (reader.pos < end) {
|
|
8273
|
+
let [fieldNo, wireType] = reader.tag();
|
|
8274
|
+
switch (fieldNo) {
|
|
8275
|
+
case 1:
|
|
8276
|
+
message.chatId = reader.int64().toBigInt();
|
|
8277
|
+
break;
|
|
8278
|
+
case 2:
|
|
8279
|
+
message.kind = reader.int32();
|
|
8280
|
+
break;
|
|
8281
|
+
case 3:
|
|
8282
|
+
message.title = reader.string();
|
|
8283
|
+
break;
|
|
8284
|
+
case 4:
|
|
8285
|
+
message.messageCount = reader.int32();
|
|
8286
|
+
break;
|
|
8287
|
+
case 5:
|
|
8288
|
+
message.hasUnread = reader.bool();
|
|
8289
|
+
break;
|
|
8290
|
+
case 6:
|
|
8291
|
+
if (wireType === import_runtime.WireType.LengthDelimited)
|
|
8292
|
+
for (let e = reader.int32() + reader.pos;reader.pos < e; )
|
|
8293
|
+
message.recentAuthorUserIds.push(reader.int64().toBigInt());
|
|
8294
|
+
else
|
|
8295
|
+
message.recentAuthorUserIds.push(reader.int64().toBigInt());
|
|
8296
|
+
break;
|
|
8297
|
+
default:
|
|
8298
|
+
let u = options.readUnknownField;
|
|
8299
|
+
if (u === "throw")
|
|
8300
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
8301
|
+
let d = reader.skip(wireType);
|
|
8302
|
+
if (u !== false)
|
|
8303
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
8304
|
+
}
|
|
8305
|
+
}
|
|
8306
|
+
return message;
|
|
8307
|
+
}
|
|
8308
|
+
internalBinaryWrite(message, writer, options) {
|
|
8309
|
+
if (message.chatId !== 0n)
|
|
8310
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.chatId);
|
|
8311
|
+
if (message.kind !== 0)
|
|
8312
|
+
writer.tag(2, import_runtime.WireType.Varint).int32(message.kind);
|
|
8313
|
+
if (message.title !== undefined)
|
|
8314
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.title);
|
|
8315
|
+
if (message.messageCount !== 0)
|
|
8316
|
+
writer.tag(4, import_runtime.WireType.Varint).int32(message.messageCount);
|
|
8317
|
+
if (message.hasUnread !== false)
|
|
8318
|
+
writer.tag(5, import_runtime.WireType.Varint).bool(message.hasUnread);
|
|
8319
|
+
if (message.recentAuthorUserIds.length) {
|
|
8320
|
+
writer.tag(6, import_runtime.WireType.LengthDelimited).fork();
|
|
8321
|
+
for (let i = 0;i < message.recentAuthorUserIds.length; i++)
|
|
8322
|
+
writer.int64(message.recentAuthorUserIds[i]);
|
|
8323
|
+
writer.join();
|
|
8324
|
+
}
|
|
8325
|
+
let u = options.writeUnknownFields;
|
|
8326
|
+
if (u !== false)
|
|
8327
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
8328
|
+
return writer;
|
|
8329
|
+
}
|
|
8330
|
+
}
|
|
8331
|
+
var MessageSubthread = new MessageSubthread$Type;
|
|
8332
|
+
|
|
8107
8333
|
class MessageActions$Type extends import_runtime4.MessageType {
|
|
8108
8334
|
constructor() {
|
|
8109
8335
|
super("MessageActions", [
|
|
@@ -8691,7 +8917,8 @@ class Block$Type extends import_runtime4.MessageType {
|
|
|
8691
8917
|
{ no: 8, name: "disclosure", kind: "message", oneof: "kind", T: () => BlockDisclosure },
|
|
8692
8918
|
{ no: 9, name: "footer", kind: "message", oneof: "kind", T: () => BlockText },
|
|
8693
8919
|
{ no: 10, name: "quote", kind: "message", oneof: "kind", T: () => BlockQuote },
|
|
8694
|
-
{ no: 11, name: "table", kind: "message", oneof: "kind", T: () => BlockTable }
|
|
8920
|
+
{ no: 11, name: "table", kind: "message", oneof: "kind", T: () => BlockTable },
|
|
8921
|
+
{ no: 12, name: "math", kind: "message", oneof: "kind", T: () => BlockText }
|
|
8695
8922
|
]);
|
|
8696
8923
|
}
|
|
8697
8924
|
create(value) {
|
|
@@ -8772,6 +8999,12 @@ class Block$Type extends import_runtime4.MessageType {
|
|
|
8772
8999
|
table: BlockTable.internalBinaryRead(reader, reader.uint32(), options, message.kind.table)
|
|
8773
9000
|
};
|
|
8774
9001
|
break;
|
|
9002
|
+
case 12:
|
|
9003
|
+
message.kind = {
|
|
9004
|
+
oneofKind: "math",
|
|
9005
|
+
math: BlockText.internalBinaryRead(reader, reader.uint32(), options, message.kind.math)
|
|
9006
|
+
};
|
|
9007
|
+
break;
|
|
8775
9008
|
default:
|
|
8776
9009
|
let u = options.readUnknownField;
|
|
8777
9010
|
if (u === "throw")
|
|
@@ -8806,6 +9039,8 @@ class Block$Type extends import_runtime4.MessageType {
|
|
|
8806
9039
|
BlockQuote.internalBinaryWrite(message.kind.quote, writer.tag(10, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
8807
9040
|
if (message.kind.oneofKind === "table")
|
|
8808
9041
|
BlockTable.internalBinaryWrite(message.kind.table, writer.tag(11, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
9042
|
+
if (message.kind.oneofKind === "math")
|
|
9043
|
+
BlockText.internalBinaryWrite(message.kind.math, writer.tag(12, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
8809
9044
|
let u = options.writeUnknownFields;
|
|
8810
9045
|
if (u !== false)
|
|
8811
9046
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -9548,7 +9783,8 @@ class Message$Type extends import_runtime4.MessageType {
|
|
|
9548
9783
|
{ no: 21, name: "rev", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
9549
9784
|
{ no: 22, name: "service_message", kind: "message", T: () => MessageService },
|
|
9550
9785
|
{ no: 23, name: "block_content", kind: "message", T: () => BlockContent },
|
|
9551
|
-
{ no: 24, name: "agent_session", kind: "message", T: () => AgentSessionMessageInfo }
|
|
9786
|
+
{ no: 24, name: "agent_session", kind: "message", T: () => AgentSessionMessageInfo },
|
|
9787
|
+
{ no: 25, name: "subthread", kind: "message", T: () => MessageSubthread }
|
|
9552
9788
|
]);
|
|
9553
9789
|
}
|
|
9554
9790
|
create(value) {
|
|
@@ -9642,6 +9878,9 @@ class Message$Type extends import_runtime4.MessageType {
|
|
|
9642
9878
|
case 24:
|
|
9643
9879
|
message.agentSession = AgentSessionMessageInfo.internalBinaryRead(reader, reader.uint32(), options, message.agentSession);
|
|
9644
9880
|
break;
|
|
9881
|
+
case 25:
|
|
9882
|
+
message.subthread = MessageSubthread.internalBinaryRead(reader, reader.uint32(), options, message.subthread);
|
|
9883
|
+
break;
|
|
9645
9884
|
default:
|
|
9646
9885
|
let u = options.readUnknownField;
|
|
9647
9886
|
if (u === "throw")
|
|
@@ -9704,6 +9943,8 @@ class Message$Type extends import_runtime4.MessageType {
|
|
|
9704
9943
|
BlockContent.internalBinaryWrite(message.blockContent, writer.tag(23, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
9705
9944
|
if (message.agentSession)
|
|
9706
9945
|
AgentSessionMessageInfo.internalBinaryWrite(message.agentSession, writer.tag(24, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
9946
|
+
if (message.subthread)
|
|
9947
|
+
MessageSubthread.internalBinaryWrite(message.subthread, writer.tag(25, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
9707
9948
|
let u = options.writeUnknownFields;
|
|
9708
9949
|
if (u !== false)
|
|
9709
9950
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -9887,7 +10128,8 @@ class MessageEntity$Type extends import_runtime4.MessageType {
|
|
|
9887
10128
|
{ no: 7, name: "thread", kind: "message", oneof: "entity", T: () => MessageEntity_MessageEntityThread },
|
|
9888
10129
|
{ no: 8, name: "thread_title", kind: "message", oneof: "entity", T: () => MessageEntity_MessageEntityThreadTitle },
|
|
9889
10130
|
{ no: 9, name: "group_mention", kind: "message", oneof: "entity", T: () => MessageEntity_MessageEntityGroupMention },
|
|
9890
|
-
{ no: 10, name: "bot_command", kind: "message", oneof: "entity", T: () => MessageEntity_MessageEntityBotCommand }
|
|
10131
|
+
{ no: 10, name: "bot_command", kind: "message", oneof: "entity", T: () => MessageEntity_MessageEntityBotCommand },
|
|
10132
|
+
{ no: 11, name: "math", kind: "message", oneof: "entity", T: () => MessageEntity_MessageEntityMath }
|
|
9891
10133
|
]);
|
|
9892
10134
|
}
|
|
9893
10135
|
create(value) {
|
|
@@ -9956,6 +10198,12 @@ class MessageEntity$Type extends import_runtime4.MessageType {
|
|
|
9956
10198
|
botCommand: MessageEntity_MessageEntityBotCommand.internalBinaryRead(reader, reader.uint32(), options, message.entity.botCommand)
|
|
9957
10199
|
};
|
|
9958
10200
|
break;
|
|
10201
|
+
case 11:
|
|
10202
|
+
message.entity = {
|
|
10203
|
+
oneofKind: "math",
|
|
10204
|
+
math: MessageEntity_MessageEntityMath.internalBinaryRead(reader, reader.uint32(), options, message.entity.math)
|
|
10205
|
+
};
|
|
10206
|
+
break;
|
|
9959
10207
|
default:
|
|
9960
10208
|
let u = options.readUnknownField;
|
|
9961
10209
|
if (u === "throw")
|
|
@@ -9988,6 +10236,8 @@ class MessageEntity$Type extends import_runtime4.MessageType {
|
|
|
9988
10236
|
MessageEntity_MessageEntityGroupMention.internalBinaryWrite(message.entity.groupMention, writer.tag(9, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
9989
10237
|
if (message.entity.oneofKind === "botCommand")
|
|
9990
10238
|
MessageEntity_MessageEntityBotCommand.internalBinaryWrite(message.entity.botCommand, writer.tag(10, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10239
|
+
if (message.entity.oneofKind === "math")
|
|
10240
|
+
MessageEntity_MessageEntityMath.internalBinaryWrite(message.entity.math, writer.tag(11, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
9991
10241
|
let u = options.writeUnknownFields;
|
|
9992
10242
|
if (u !== false)
|
|
9993
10243
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -10310,6 +10560,49 @@ class MessageEntity_MessageEntityBotCommand$Type extends import_runtime4.Message
|
|
|
10310
10560
|
}
|
|
10311
10561
|
var MessageEntity_MessageEntityBotCommand = new MessageEntity_MessageEntityBotCommand$Type;
|
|
10312
10562
|
|
|
10563
|
+
class MessageEntity_MessageEntityMath$Type extends import_runtime4.MessageType {
|
|
10564
|
+
constructor() {
|
|
10565
|
+
super("MessageEntity.MessageEntityMath", [
|
|
10566
|
+
{ no: 1, name: "display", kind: "scalar", T: 8 }
|
|
10567
|
+
]);
|
|
10568
|
+
}
|
|
10569
|
+
create(value) {
|
|
10570
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
10571
|
+
message.display = false;
|
|
10572
|
+
if (value !== undefined)
|
|
10573
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
10574
|
+
return message;
|
|
10575
|
+
}
|
|
10576
|
+
internalBinaryRead(reader, length, options, target) {
|
|
10577
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
10578
|
+
while (reader.pos < end) {
|
|
10579
|
+
let [fieldNo, wireType] = reader.tag();
|
|
10580
|
+
switch (fieldNo) {
|
|
10581
|
+
case 1:
|
|
10582
|
+
message.display = reader.bool();
|
|
10583
|
+
break;
|
|
10584
|
+
default:
|
|
10585
|
+
let u = options.readUnknownField;
|
|
10586
|
+
if (u === "throw")
|
|
10587
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
10588
|
+
let d = reader.skip(wireType);
|
|
10589
|
+
if (u !== false)
|
|
10590
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
10591
|
+
}
|
|
10592
|
+
}
|
|
10593
|
+
return message;
|
|
10594
|
+
}
|
|
10595
|
+
internalBinaryWrite(message, writer, options) {
|
|
10596
|
+
if (message.display !== false)
|
|
10597
|
+
writer.tag(1, import_runtime.WireType.Varint).bool(message.display);
|
|
10598
|
+
let u = options.writeUnknownFields;
|
|
10599
|
+
if (u !== false)
|
|
10600
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
10601
|
+
return writer;
|
|
10602
|
+
}
|
|
10603
|
+
}
|
|
10604
|
+
var MessageEntity_MessageEntityMath = new MessageEntity_MessageEntityMath$Type;
|
|
10605
|
+
|
|
10313
10606
|
class MessageReactions$Type extends import_runtime4.MessageType {
|
|
10314
10607
|
constructor() {
|
|
10315
10608
|
super("MessageReactions", [
|
|
@@ -10687,7 +10980,8 @@ class AgentSession$Type extends import_runtime4.MessageType {
|
|
|
10687
10980
|
{ no: 2, name: "peer_id", kind: "message", T: () => Peer },
|
|
10688
10981
|
{ no: 3, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
|
|
10689
10982
|
{ no: 4, name: "provider", kind: "enum", T: () => ["AgentSessionProvider", AgentSessionProvider, "AGENT_SESSION_PROVIDER_"] },
|
|
10690
|
-
{ no: 5, name: "status_message_id", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
10983
|
+
{ no: 5, name: "status_message_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
10984
|
+
{ no: 6, name: "parent_chat_id", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
10691
10985
|
]);
|
|
10692
10986
|
}
|
|
10693
10987
|
create(value) {
|
|
@@ -10719,6 +11013,9 @@ class AgentSession$Type extends import_runtime4.MessageType {
|
|
|
10719
11013
|
case 5:
|
|
10720
11014
|
message.statusMessageId = reader.int64().toBigInt();
|
|
10721
11015
|
break;
|
|
11016
|
+
case 6:
|
|
11017
|
+
message.parentChatId = reader.int64().toBigInt();
|
|
11018
|
+
break;
|
|
10722
11019
|
default:
|
|
10723
11020
|
let u = options.readUnknownField;
|
|
10724
11021
|
if (u === "throw")
|
|
@@ -10741,6 +11038,8 @@ class AgentSession$Type extends import_runtime4.MessageType {
|
|
|
10741
11038
|
writer.tag(4, import_runtime.WireType.Varint).int32(message.provider);
|
|
10742
11039
|
if (message.statusMessageId !== undefined)
|
|
10743
11040
|
writer.tag(5, import_runtime.WireType.Varint).int64(message.statusMessageId);
|
|
11041
|
+
if (message.parentChatId !== undefined)
|
|
11042
|
+
writer.tag(6, import_runtime.WireType.Varint).int64(message.parentChatId);
|
|
10744
11043
|
let u = options.writeUnknownFields;
|
|
10745
11044
|
if (u !== false)
|
|
10746
11045
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -11490,6 +11789,330 @@ class JoinPublicSpaceResult$Type extends import_runtime4.MessageType {
|
|
|
11490
11789
|
}
|
|
11491
11790
|
var JoinPublicSpaceResult = new JoinPublicSpaceResult$Type;
|
|
11492
11791
|
|
|
11792
|
+
class SpaceInviteLink$Type extends import_runtime4.MessageType {
|
|
11793
|
+
constructor() {
|
|
11794
|
+
super("SpaceInviteLink", [
|
|
11795
|
+
{ no: 1, name: "url", kind: "scalar", T: 9 },
|
|
11796
|
+
{ no: 2, name: "expires_at", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
11797
|
+
]);
|
|
11798
|
+
}
|
|
11799
|
+
create(value) {
|
|
11800
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
11801
|
+
message.url = "";
|
|
11802
|
+
if (value !== undefined)
|
|
11803
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11804
|
+
return message;
|
|
11805
|
+
}
|
|
11806
|
+
internalBinaryRead(reader, length, options, target) {
|
|
11807
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
11808
|
+
while (reader.pos < end) {
|
|
11809
|
+
let [fieldNo, wireType] = reader.tag();
|
|
11810
|
+
switch (fieldNo) {
|
|
11811
|
+
case 1:
|
|
11812
|
+
message.url = reader.string();
|
|
11813
|
+
break;
|
|
11814
|
+
case 2:
|
|
11815
|
+
message.expiresAt = reader.int64().toBigInt();
|
|
11816
|
+
break;
|
|
11817
|
+
default:
|
|
11818
|
+
let u = options.readUnknownField;
|
|
11819
|
+
if (u === "throw")
|
|
11820
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
11821
|
+
let d = reader.skip(wireType);
|
|
11822
|
+
if (u !== false)
|
|
11823
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
11824
|
+
}
|
|
11825
|
+
}
|
|
11826
|
+
return message;
|
|
11827
|
+
}
|
|
11828
|
+
internalBinaryWrite(message, writer, options) {
|
|
11829
|
+
if (message.url !== "")
|
|
11830
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.url);
|
|
11831
|
+
if (message.expiresAt !== undefined)
|
|
11832
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.expiresAt);
|
|
11833
|
+
let u = options.writeUnknownFields;
|
|
11834
|
+
if (u !== false)
|
|
11835
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
11836
|
+
return writer;
|
|
11837
|
+
}
|
|
11838
|
+
}
|
|
11839
|
+
var SpaceInviteLink = new SpaceInviteLink$Type;
|
|
11840
|
+
|
|
11841
|
+
class JoinSpaceByInviteTokenInput$Type extends import_runtime4.MessageType {
|
|
11842
|
+
constructor() {
|
|
11843
|
+
super("JoinSpaceByInviteTokenInput", [
|
|
11844
|
+
{ no: 1, name: "token", kind: "scalar", T: 9 }
|
|
11845
|
+
]);
|
|
11846
|
+
}
|
|
11847
|
+
create(value) {
|
|
11848
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
11849
|
+
message.token = "";
|
|
11850
|
+
if (value !== undefined)
|
|
11851
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11852
|
+
return message;
|
|
11853
|
+
}
|
|
11854
|
+
internalBinaryRead(reader, length, options, target) {
|
|
11855
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
11856
|
+
while (reader.pos < end) {
|
|
11857
|
+
let [fieldNo, wireType] = reader.tag();
|
|
11858
|
+
switch (fieldNo) {
|
|
11859
|
+
case 1:
|
|
11860
|
+
message.token = reader.string();
|
|
11861
|
+
break;
|
|
11862
|
+
default:
|
|
11863
|
+
let u = options.readUnknownField;
|
|
11864
|
+
if (u === "throw")
|
|
11865
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
11866
|
+
let d = reader.skip(wireType);
|
|
11867
|
+
if (u !== false)
|
|
11868
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
11869
|
+
}
|
|
11870
|
+
}
|
|
11871
|
+
return message;
|
|
11872
|
+
}
|
|
11873
|
+
internalBinaryWrite(message, writer, options) {
|
|
11874
|
+
if (message.token !== "")
|
|
11875
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
|
|
11876
|
+
let u = options.writeUnknownFields;
|
|
11877
|
+
if (u !== false)
|
|
11878
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
11879
|
+
return writer;
|
|
11880
|
+
}
|
|
11881
|
+
}
|
|
11882
|
+
var JoinSpaceByInviteTokenInput = new JoinSpaceByInviteTokenInput$Type;
|
|
11883
|
+
|
|
11884
|
+
class JoinSpaceByInviteTokenResult$Type extends import_runtime4.MessageType {
|
|
11885
|
+
constructor() {
|
|
11886
|
+
super("JoinSpaceByInviteTokenResult", [
|
|
11887
|
+
{ no: 1, name: "space", kind: "message", T: () => Space },
|
|
11888
|
+
{ no: 2, name: "member", kind: "message", T: () => Member },
|
|
11889
|
+
{ no: 3, name: "already_member", kind: "scalar", T: 8 }
|
|
11890
|
+
]);
|
|
11891
|
+
}
|
|
11892
|
+
create(value) {
|
|
11893
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
11894
|
+
message.alreadyMember = false;
|
|
11895
|
+
if (value !== undefined)
|
|
11896
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11897
|
+
return message;
|
|
11898
|
+
}
|
|
11899
|
+
internalBinaryRead(reader, length, options, target) {
|
|
11900
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
11901
|
+
while (reader.pos < end) {
|
|
11902
|
+
let [fieldNo, wireType] = reader.tag();
|
|
11903
|
+
switch (fieldNo) {
|
|
11904
|
+
case 1:
|
|
11905
|
+
message.space = Space.internalBinaryRead(reader, reader.uint32(), options, message.space);
|
|
11906
|
+
break;
|
|
11907
|
+
case 2:
|
|
11908
|
+
message.member = Member.internalBinaryRead(reader, reader.uint32(), options, message.member);
|
|
11909
|
+
break;
|
|
11910
|
+
case 3:
|
|
11911
|
+
message.alreadyMember = reader.bool();
|
|
11912
|
+
break;
|
|
11913
|
+
default:
|
|
11914
|
+
let u = options.readUnknownField;
|
|
11915
|
+
if (u === "throw")
|
|
11916
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
11917
|
+
let d = reader.skip(wireType);
|
|
11918
|
+
if (u !== false)
|
|
11919
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
11920
|
+
}
|
|
11921
|
+
}
|
|
11922
|
+
return message;
|
|
11923
|
+
}
|
|
11924
|
+
internalBinaryWrite(message, writer, options) {
|
|
11925
|
+
if (message.space)
|
|
11926
|
+
Space.internalBinaryWrite(message.space, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11927
|
+
if (message.member)
|
|
11928
|
+
Member.internalBinaryWrite(message.member, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11929
|
+
if (message.alreadyMember !== false)
|
|
11930
|
+
writer.tag(3, import_runtime.WireType.Varint).bool(message.alreadyMember);
|
|
11931
|
+
let u = options.writeUnknownFields;
|
|
11932
|
+
if (u !== false)
|
|
11933
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
11934
|
+
return writer;
|
|
11935
|
+
}
|
|
11936
|
+
}
|
|
11937
|
+
var JoinSpaceByInviteTokenResult = new JoinSpaceByInviteTokenResult$Type;
|
|
11938
|
+
|
|
11939
|
+
class GetSpaceInviteLinkInput$Type extends import_runtime4.MessageType {
|
|
11940
|
+
constructor() {
|
|
11941
|
+
super("GetSpaceInviteLinkInput", [
|
|
11942
|
+
{ no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 }
|
|
11943
|
+
]);
|
|
11944
|
+
}
|
|
11945
|
+
create(value) {
|
|
11946
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
11947
|
+
message.spaceId = 0n;
|
|
11948
|
+
if (value !== undefined)
|
|
11949
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11950
|
+
return message;
|
|
11951
|
+
}
|
|
11952
|
+
internalBinaryRead(reader, length, options, target) {
|
|
11953
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
11954
|
+
while (reader.pos < end) {
|
|
11955
|
+
let [fieldNo, wireType] = reader.tag();
|
|
11956
|
+
switch (fieldNo) {
|
|
11957
|
+
case 1:
|
|
11958
|
+
message.spaceId = reader.int64().toBigInt();
|
|
11959
|
+
break;
|
|
11960
|
+
default:
|
|
11961
|
+
let u = options.readUnknownField;
|
|
11962
|
+
if (u === "throw")
|
|
11963
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
11964
|
+
let d = reader.skip(wireType);
|
|
11965
|
+
if (u !== false)
|
|
11966
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
11967
|
+
}
|
|
11968
|
+
}
|
|
11969
|
+
return message;
|
|
11970
|
+
}
|
|
11971
|
+
internalBinaryWrite(message, writer, options) {
|
|
11972
|
+
if (message.spaceId !== 0n)
|
|
11973
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
|
|
11974
|
+
let u = options.writeUnknownFields;
|
|
11975
|
+
if (u !== false)
|
|
11976
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
11977
|
+
return writer;
|
|
11978
|
+
}
|
|
11979
|
+
}
|
|
11980
|
+
var GetSpaceInviteLinkInput = new GetSpaceInviteLinkInput$Type;
|
|
11981
|
+
|
|
11982
|
+
class GetSpaceInviteLinkResult$Type extends import_runtime4.MessageType {
|
|
11983
|
+
constructor() {
|
|
11984
|
+
super("GetSpaceInviteLinkResult", [
|
|
11985
|
+
{ no: 1, name: "link", kind: "message", T: () => SpaceInviteLink }
|
|
11986
|
+
]);
|
|
11987
|
+
}
|
|
11988
|
+
create(value) {
|
|
11989
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
11990
|
+
if (value !== undefined)
|
|
11991
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11992
|
+
return message;
|
|
11993
|
+
}
|
|
11994
|
+
internalBinaryRead(reader, length, options, target) {
|
|
11995
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
11996
|
+
while (reader.pos < end) {
|
|
11997
|
+
let [fieldNo, wireType] = reader.tag();
|
|
11998
|
+
switch (fieldNo) {
|
|
11999
|
+
case 1:
|
|
12000
|
+
message.link = SpaceInviteLink.internalBinaryRead(reader, reader.uint32(), options, message.link);
|
|
12001
|
+
break;
|
|
12002
|
+
default:
|
|
12003
|
+
let u = options.readUnknownField;
|
|
12004
|
+
if (u === "throw")
|
|
12005
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
12006
|
+
let d = reader.skip(wireType);
|
|
12007
|
+
if (u !== false)
|
|
12008
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
12009
|
+
}
|
|
12010
|
+
}
|
|
12011
|
+
return message;
|
|
12012
|
+
}
|
|
12013
|
+
internalBinaryWrite(message, writer, options) {
|
|
12014
|
+
if (message.link)
|
|
12015
|
+
SpaceInviteLink.internalBinaryWrite(message.link, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
12016
|
+
let u = options.writeUnknownFields;
|
|
12017
|
+
if (u !== false)
|
|
12018
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
12019
|
+
return writer;
|
|
12020
|
+
}
|
|
12021
|
+
}
|
|
12022
|
+
var GetSpaceInviteLinkResult = new GetSpaceInviteLinkResult$Type;
|
|
12023
|
+
|
|
12024
|
+
class SetSpaceInviteLinkEnabledInput$Type extends import_runtime4.MessageType {
|
|
12025
|
+
constructor() {
|
|
12026
|
+
super("SetSpaceInviteLinkEnabledInput", [
|
|
12027
|
+
{ no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 },
|
|
12028
|
+
{ no: 2, name: "enabled", kind: "scalar", T: 8 }
|
|
12029
|
+
]);
|
|
12030
|
+
}
|
|
12031
|
+
create(value) {
|
|
12032
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
12033
|
+
message.spaceId = 0n;
|
|
12034
|
+
message.enabled = false;
|
|
12035
|
+
if (value !== undefined)
|
|
12036
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
12037
|
+
return message;
|
|
12038
|
+
}
|
|
12039
|
+
internalBinaryRead(reader, length, options, target) {
|
|
12040
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
12041
|
+
while (reader.pos < end) {
|
|
12042
|
+
let [fieldNo, wireType] = reader.tag();
|
|
12043
|
+
switch (fieldNo) {
|
|
12044
|
+
case 1:
|
|
12045
|
+
message.spaceId = reader.int64().toBigInt();
|
|
12046
|
+
break;
|
|
12047
|
+
case 2:
|
|
12048
|
+
message.enabled = reader.bool();
|
|
12049
|
+
break;
|
|
12050
|
+
default:
|
|
12051
|
+
let u = options.readUnknownField;
|
|
12052
|
+
if (u === "throw")
|
|
12053
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
12054
|
+
let d = reader.skip(wireType);
|
|
12055
|
+
if (u !== false)
|
|
12056
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
12057
|
+
}
|
|
12058
|
+
}
|
|
12059
|
+
return message;
|
|
12060
|
+
}
|
|
12061
|
+
internalBinaryWrite(message, writer, options) {
|
|
12062
|
+
if (message.spaceId !== 0n)
|
|
12063
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
|
|
12064
|
+
if (message.enabled !== false)
|
|
12065
|
+
writer.tag(2, import_runtime.WireType.Varint).bool(message.enabled);
|
|
12066
|
+
let u = options.writeUnknownFields;
|
|
12067
|
+
if (u !== false)
|
|
12068
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
12069
|
+
return writer;
|
|
12070
|
+
}
|
|
12071
|
+
}
|
|
12072
|
+
var SetSpaceInviteLinkEnabledInput = new SetSpaceInviteLinkEnabledInput$Type;
|
|
12073
|
+
|
|
12074
|
+
class SetSpaceInviteLinkEnabledResult$Type extends import_runtime4.MessageType {
|
|
12075
|
+
constructor() {
|
|
12076
|
+
super("SetSpaceInviteLinkEnabledResult", [
|
|
12077
|
+
{ no: 1, name: "link", kind: "message", T: () => SpaceInviteLink }
|
|
12078
|
+
]);
|
|
12079
|
+
}
|
|
12080
|
+
create(value) {
|
|
12081
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
12082
|
+
if (value !== undefined)
|
|
12083
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
12084
|
+
return message;
|
|
12085
|
+
}
|
|
12086
|
+
internalBinaryRead(reader, length, options, target) {
|
|
12087
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
12088
|
+
while (reader.pos < end) {
|
|
12089
|
+
let [fieldNo, wireType] = reader.tag();
|
|
12090
|
+
switch (fieldNo) {
|
|
12091
|
+
case 1:
|
|
12092
|
+
message.link = SpaceInviteLink.internalBinaryRead(reader, reader.uint32(), options, message.link);
|
|
12093
|
+
break;
|
|
12094
|
+
default:
|
|
12095
|
+
let u = options.readUnknownField;
|
|
12096
|
+
if (u === "throw")
|
|
12097
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
12098
|
+
let d = reader.skip(wireType);
|
|
12099
|
+
if (u !== false)
|
|
12100
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
12101
|
+
}
|
|
12102
|
+
}
|
|
12103
|
+
return message;
|
|
12104
|
+
}
|
|
12105
|
+
internalBinaryWrite(message, writer, options) {
|
|
12106
|
+
if (message.link)
|
|
12107
|
+
SpaceInviteLink.internalBinaryWrite(message.link, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
12108
|
+
let u = options.writeUnknownFields;
|
|
12109
|
+
if (u !== false)
|
|
12110
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
12111
|
+
return writer;
|
|
12112
|
+
}
|
|
12113
|
+
}
|
|
12114
|
+
var SetSpaceInviteLinkEnabledResult = new SetSpaceInviteLinkEnabledResult$Type;
|
|
12115
|
+
|
|
11493
12116
|
class UserGroup$Type extends import_runtime4.MessageType {
|
|
11494
12117
|
constructor() {
|
|
11495
12118
|
super("UserGroup", [
|
|
@@ -12668,7 +13291,8 @@ class Video$Type extends import_runtime4.MessageType {
|
|
|
12668
13291
|
{ no: 7, name: "photo", kind: "message", T: () => Photo },
|
|
12669
13292
|
{ no: 8, name: "cdn_url", kind: "scalar", opt: true, T: 9 },
|
|
12670
13293
|
{ no: 9, name: "is_animated", kind: "scalar", opt: true, T: 8 },
|
|
12671
|
-
{ no: 10, name: "has_audio", kind: "scalar", opt: true, T: 8 }
|
|
13294
|
+
{ no: 10, name: "has_audio", kind: "scalar", opt: true, T: 8 },
|
|
13295
|
+
{ no: 100, name: "file_unique_id", kind: "scalar", opt: true, T: 9 }
|
|
12672
13296
|
]);
|
|
12673
13297
|
}
|
|
12674
13298
|
create(value) {
|
|
@@ -12718,6 +13342,9 @@ class Video$Type extends import_runtime4.MessageType {
|
|
|
12718
13342
|
case 10:
|
|
12719
13343
|
message.hasAudio = reader.bool();
|
|
12720
13344
|
break;
|
|
13345
|
+
case 100:
|
|
13346
|
+
message.fileUniqueId = reader.string();
|
|
13347
|
+
break;
|
|
12721
13348
|
default:
|
|
12722
13349
|
let u = options.readUnknownField;
|
|
12723
13350
|
if (u === "throw")
|
|
@@ -12750,6 +13377,8 @@ class Video$Type extends import_runtime4.MessageType {
|
|
|
12750
13377
|
writer.tag(9, import_runtime.WireType.Varint).bool(message.isAnimated);
|
|
12751
13378
|
if (message.hasAudio !== undefined)
|
|
12752
13379
|
writer.tag(10, import_runtime.WireType.Varint).bool(message.hasAudio);
|
|
13380
|
+
if (message.fileUniqueId !== undefined)
|
|
13381
|
+
writer.tag(100, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
|
|
12753
13382
|
let u = options.writeUnknownFields;
|
|
12754
13383
|
if (u !== false)
|
|
12755
13384
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -12767,7 +13396,8 @@ class Document$Type extends import_runtime4.MessageType {
|
|
|
12767
13396
|
{ no: 4, name: "size", kind: "scalar", T: 5 },
|
|
12768
13397
|
{ no: 5, name: "cdn_url", kind: "scalar", opt: true, T: 9 },
|
|
12769
13398
|
{ no: 6, name: "date", kind: "scalar", T: 3, L: 0 },
|
|
12770
|
-
{ no: 7, name: "photo", kind: "message", T: () => Photo }
|
|
13399
|
+
{ no: 7, name: "photo", kind: "message", T: () => Photo },
|
|
13400
|
+
{ no: 100, name: "file_unique_id", kind: "scalar", opt: true, T: 9 }
|
|
12771
13401
|
]);
|
|
12772
13402
|
}
|
|
12773
13403
|
create(value) {
|
|
@@ -12807,6 +13437,9 @@ class Document$Type extends import_runtime4.MessageType {
|
|
|
12807
13437
|
case 7:
|
|
12808
13438
|
message.photo = Photo.internalBinaryRead(reader, reader.uint32(), options, message.photo);
|
|
12809
13439
|
break;
|
|
13440
|
+
case 100:
|
|
13441
|
+
message.fileUniqueId = reader.string();
|
|
13442
|
+
break;
|
|
12810
13443
|
default:
|
|
12811
13444
|
let u = options.readUnknownField;
|
|
12812
13445
|
if (u === "throw")
|
|
@@ -12833,6 +13466,8 @@ class Document$Type extends import_runtime4.MessageType {
|
|
|
12833
13466
|
writer.tag(6, import_runtime.WireType.Varint).int64(message.date);
|
|
12834
13467
|
if (message.photo)
|
|
12835
13468
|
Photo.internalBinaryWrite(message.photo, writer.tag(7, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13469
|
+
if (message.fileUniqueId !== undefined)
|
|
13470
|
+
writer.tag(100, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
|
|
12836
13471
|
let u = options.writeUnknownFields;
|
|
12837
13472
|
if (u !== false)
|
|
12838
13473
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -12850,7 +13485,8 @@ class Voice$Type extends import_runtime4.MessageType {
|
|
|
12850
13485
|
{ no: 4, name: "size", kind: "scalar", T: 5 },
|
|
12851
13486
|
{ no: 5, name: "mime_type", kind: "scalar", T: 9 },
|
|
12852
13487
|
{ no: 6, name: "cdn_url", kind: "scalar", opt: true, T: 9 },
|
|
12853
|
-
{ no: 7, name: "waveform", kind: "scalar", T: 12 }
|
|
13488
|
+
{ no: 7, name: "waveform", kind: "scalar", T: 12 },
|
|
13489
|
+
{ no: 100, name: "file_unique_id", kind: "scalar", opt: true, T: 9 }
|
|
12854
13490
|
]);
|
|
12855
13491
|
}
|
|
12856
13492
|
create(value) {
|
|
@@ -12891,6 +13527,9 @@ class Voice$Type extends import_runtime4.MessageType {
|
|
|
12891
13527
|
case 7:
|
|
12892
13528
|
message.waveform = reader.bytes();
|
|
12893
13529
|
break;
|
|
13530
|
+
case 100:
|
|
13531
|
+
message.fileUniqueId = reader.string();
|
|
13532
|
+
break;
|
|
12894
13533
|
default:
|
|
12895
13534
|
let u = options.readUnknownField;
|
|
12896
13535
|
if (u === "throw")
|
|
@@ -12917,6 +13556,8 @@ class Voice$Type extends import_runtime4.MessageType {
|
|
|
12917
13556
|
writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.cdnUrl);
|
|
12918
13557
|
if (message.waveform.length)
|
|
12919
13558
|
writer.tag(7, import_runtime.WireType.LengthDelimited).bytes(message.waveform);
|
|
13559
|
+
if (message.fileUniqueId !== undefined)
|
|
13560
|
+
writer.tag(100, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
|
|
12920
13561
|
let u = options.writeUnknownFields;
|
|
12921
13562
|
if (u !== false)
|
|
12922
13563
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -12998,6 +13639,7 @@ var Photo = new Photo$Type;
|
|
|
12998
13639
|
class PhotoSize$Type extends import_runtime4.MessageType {
|
|
12999
13640
|
constructor() {
|
|
13000
13641
|
super("PhotoSize", [
|
|
13642
|
+
{ no: 100, name: "file_unique_id", kind: "scalar", opt: true, T: 9 },
|
|
13001
13643
|
{ no: 1, name: "type", kind: "scalar", T: 9 },
|
|
13002
13644
|
{ no: 2, name: "w", kind: "scalar", T: 5 },
|
|
13003
13645
|
{ no: 3, name: "h", kind: "scalar", T: 5 },
|
|
@@ -13021,6 +13663,9 @@ class PhotoSize$Type extends import_runtime4.MessageType {
|
|
|
13021
13663
|
while (reader.pos < end) {
|
|
13022
13664
|
let [fieldNo, wireType] = reader.tag();
|
|
13023
13665
|
switch (fieldNo) {
|
|
13666
|
+
case 100:
|
|
13667
|
+
message.fileUniqueId = reader.string();
|
|
13668
|
+
break;
|
|
13024
13669
|
case 1:
|
|
13025
13670
|
message.type = reader.string();
|
|
13026
13671
|
break;
|
|
@@ -13051,6 +13696,8 @@ class PhotoSize$Type extends import_runtime4.MessageType {
|
|
|
13051
13696
|
return message;
|
|
13052
13697
|
}
|
|
13053
13698
|
internalBinaryWrite(message, writer, options) {
|
|
13699
|
+
if (message.fileUniqueId !== undefined)
|
|
13700
|
+
writer.tag(100, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
|
|
13054
13701
|
if (message.type !== "")
|
|
13055
13702
|
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.type);
|
|
13056
13703
|
if (message.w !== 0)
|
|
@@ -13269,7 +13916,15 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
13269
13916
|
{ no: 130, name: "syncAgentSessionMessages", kind: "message", oneof: "input", T: () => SyncAgentSessionMessagesInput },
|
|
13270
13917
|
{ no: 131, name: "getAgentSession", kind: "message", oneof: "input", T: () => GetAgentSessionInput },
|
|
13271
13918
|
{ no: 132, name: "updateBotAgent", kind: "message", oneof: "input", T: () => UpdateBotAgentInput },
|
|
13272
|
-
{ no: 133, name: "deleteBotAgent", kind: "message", oneof: "input", T: () => DeleteBotAgentInput }
|
|
13919
|
+
{ no: 133, name: "deleteBotAgent", kind: "message", oneof: "input", T: () => DeleteBotAgentInput },
|
|
13920
|
+
{ no: 134, name: "joinSpaceByInviteToken", kind: "message", oneof: "input", T: () => JoinSpaceByInviteTokenInput },
|
|
13921
|
+
{ no: 135, name: "getSpaceInviteLink", kind: "message", oneof: "input", T: () => GetSpaceInviteLinkInput },
|
|
13922
|
+
{ no: 136, name: "setSpaceInviteLinkEnabled", kind: "message", oneof: "input", T: () => SetSpaceInviteLinkEnabledInput },
|
|
13923
|
+
{ no: 137, name: "getFilePart", kind: "message", oneof: "input", T: () => GetFilePartInput },
|
|
13924
|
+
{ no: 138, name: "acknowledgeMessages", kind: "message", oneof: "input", T: () => AcknowledgeMessagesInput },
|
|
13925
|
+
{ no: 139, name: "getUsers", kind: "message", oneof: "input", T: () => GetUsersInput },
|
|
13926
|
+
{ no: 140, name: "getBotSkills", kind: "message", oneof: "input", T: () => GetBotSkillsInput },
|
|
13927
|
+
{ no: 141, name: "getBotConfigurationCatalog", kind: "message", oneof: "input", T: () => GetBotConfigurationCatalogInput }
|
|
13273
13928
|
]);
|
|
13274
13929
|
}
|
|
13275
13930
|
create(value) {
|
|
@@ -14074,6 +14729,54 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
14074
14729
|
deleteBotAgent: DeleteBotAgentInput.internalBinaryRead(reader, reader.uint32(), options, message.input.deleteBotAgent)
|
|
14075
14730
|
};
|
|
14076
14731
|
break;
|
|
14732
|
+
case 134:
|
|
14733
|
+
message.input = {
|
|
14734
|
+
oneofKind: "joinSpaceByInviteToken",
|
|
14735
|
+
joinSpaceByInviteToken: JoinSpaceByInviteTokenInput.internalBinaryRead(reader, reader.uint32(), options, message.input.joinSpaceByInviteToken)
|
|
14736
|
+
};
|
|
14737
|
+
break;
|
|
14738
|
+
case 135:
|
|
14739
|
+
message.input = {
|
|
14740
|
+
oneofKind: "getSpaceInviteLink",
|
|
14741
|
+
getSpaceInviteLink: GetSpaceInviteLinkInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getSpaceInviteLink)
|
|
14742
|
+
};
|
|
14743
|
+
break;
|
|
14744
|
+
case 136:
|
|
14745
|
+
message.input = {
|
|
14746
|
+
oneofKind: "setSpaceInviteLinkEnabled",
|
|
14747
|
+
setSpaceInviteLinkEnabled: SetSpaceInviteLinkEnabledInput.internalBinaryRead(reader, reader.uint32(), options, message.input.setSpaceInviteLinkEnabled)
|
|
14748
|
+
};
|
|
14749
|
+
break;
|
|
14750
|
+
case 137:
|
|
14751
|
+
message.input = {
|
|
14752
|
+
oneofKind: "getFilePart",
|
|
14753
|
+
getFilePart: GetFilePartInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getFilePart)
|
|
14754
|
+
};
|
|
14755
|
+
break;
|
|
14756
|
+
case 138:
|
|
14757
|
+
message.input = {
|
|
14758
|
+
oneofKind: "acknowledgeMessages",
|
|
14759
|
+
acknowledgeMessages: AcknowledgeMessagesInput.internalBinaryRead(reader, reader.uint32(), options, message.input.acknowledgeMessages)
|
|
14760
|
+
};
|
|
14761
|
+
break;
|
|
14762
|
+
case 139:
|
|
14763
|
+
message.input = {
|
|
14764
|
+
oneofKind: "getUsers",
|
|
14765
|
+
getUsers: GetUsersInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getUsers)
|
|
14766
|
+
};
|
|
14767
|
+
break;
|
|
14768
|
+
case 140:
|
|
14769
|
+
message.input = {
|
|
14770
|
+
oneofKind: "getBotSkills",
|
|
14771
|
+
getBotSkills: GetBotSkillsInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getBotSkills)
|
|
14772
|
+
};
|
|
14773
|
+
break;
|
|
14774
|
+
case 141:
|
|
14775
|
+
message.input = {
|
|
14776
|
+
oneofKind: "getBotConfigurationCatalog",
|
|
14777
|
+
getBotConfigurationCatalog: GetBotConfigurationCatalogInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getBotConfigurationCatalog)
|
|
14778
|
+
};
|
|
14779
|
+
break;
|
|
14077
14780
|
default:
|
|
14078
14781
|
let u = options.readUnknownField;
|
|
14079
14782
|
if (u === "throw")
|
|
@@ -14350,6 +15053,22 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
14350
15053
|
UpdateBotAgentInput.internalBinaryWrite(message.input.updateBotAgent, writer.tag(132, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
14351
15054
|
if (message.input.oneofKind === "deleteBotAgent")
|
|
14352
15055
|
DeleteBotAgentInput.internalBinaryWrite(message.input.deleteBotAgent, writer.tag(133, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15056
|
+
if (message.input.oneofKind === "joinSpaceByInviteToken")
|
|
15057
|
+
JoinSpaceByInviteTokenInput.internalBinaryWrite(message.input.joinSpaceByInviteToken, writer.tag(134, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15058
|
+
if (message.input.oneofKind === "getSpaceInviteLink")
|
|
15059
|
+
GetSpaceInviteLinkInput.internalBinaryWrite(message.input.getSpaceInviteLink, writer.tag(135, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15060
|
+
if (message.input.oneofKind === "setSpaceInviteLinkEnabled")
|
|
15061
|
+
SetSpaceInviteLinkEnabledInput.internalBinaryWrite(message.input.setSpaceInviteLinkEnabled, writer.tag(136, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15062
|
+
if (message.input.oneofKind === "getFilePart")
|
|
15063
|
+
GetFilePartInput.internalBinaryWrite(message.input.getFilePart, writer.tag(137, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15064
|
+
if (message.input.oneofKind === "acknowledgeMessages")
|
|
15065
|
+
AcknowledgeMessagesInput.internalBinaryWrite(message.input.acknowledgeMessages, writer.tag(138, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15066
|
+
if (message.input.oneofKind === "getUsers")
|
|
15067
|
+
GetUsersInput.internalBinaryWrite(message.input.getUsers, writer.tag(139, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15068
|
+
if (message.input.oneofKind === "getBotSkills")
|
|
15069
|
+
GetBotSkillsInput.internalBinaryWrite(message.input.getBotSkills, writer.tag(140, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15070
|
+
if (message.input.oneofKind === "getBotConfigurationCatalog")
|
|
15071
|
+
GetBotConfigurationCatalogInput.internalBinaryWrite(message.input.getBotConfigurationCatalog, writer.tag(141, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
14353
15072
|
let u = options.writeUnknownFields;
|
|
14354
15073
|
if (u !== false)
|
|
14355
15074
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -14492,7 +15211,15 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
14492
15211
|
{ no: 130, name: "syncAgentSessionMessages", kind: "message", oneof: "result", T: () => SyncAgentSessionMessagesResult },
|
|
14493
15212
|
{ no: 131, name: "getAgentSession", kind: "message", oneof: "result", T: () => GetAgentSessionResult },
|
|
14494
15213
|
{ no: 132, name: "updateBotAgent", kind: "message", oneof: "result", T: () => UpdateBotAgentResult },
|
|
14495
|
-
{ no: 133, name: "deleteBotAgent", kind: "message", oneof: "result", T: () => DeleteBotAgentResult }
|
|
15214
|
+
{ no: 133, name: "deleteBotAgent", kind: "message", oneof: "result", T: () => DeleteBotAgentResult },
|
|
15215
|
+
{ no: 134, name: "joinSpaceByInviteToken", kind: "message", oneof: "result", T: () => JoinSpaceByInviteTokenResult },
|
|
15216
|
+
{ no: 135, name: "getSpaceInviteLink", kind: "message", oneof: "result", T: () => GetSpaceInviteLinkResult },
|
|
15217
|
+
{ no: 136, name: "setSpaceInviteLinkEnabled", kind: "message", oneof: "result", T: () => SetSpaceInviteLinkEnabledResult },
|
|
15218
|
+
{ no: 137, name: "getFilePart", kind: "message", oneof: "result", T: () => GetFilePartResult },
|
|
15219
|
+
{ no: 138, name: "acknowledgeMessages", kind: "message", oneof: "result", T: () => AcknowledgeMessagesResult },
|
|
15220
|
+
{ no: 139, name: "getUsers", kind: "message", oneof: "result", T: () => GetUsersResult },
|
|
15221
|
+
{ no: 140, name: "getBotSkills", kind: "message", oneof: "result", T: () => GetBotSkillsResult },
|
|
15222
|
+
{ no: 141, name: "getBotConfigurationCatalog", kind: "message", oneof: "result", T: () => GetBotConfigurationCatalogResult }
|
|
14496
15223
|
]);
|
|
14497
15224
|
}
|
|
14498
15225
|
create(value) {
|
|
@@ -15297,6 +16024,54 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
15297
16024
|
deleteBotAgent: DeleteBotAgentResult.internalBinaryRead(reader, reader.uint32(), options, message.result.deleteBotAgent)
|
|
15298
16025
|
};
|
|
15299
16026
|
break;
|
|
16027
|
+
case 134:
|
|
16028
|
+
message.result = {
|
|
16029
|
+
oneofKind: "joinSpaceByInviteToken",
|
|
16030
|
+
joinSpaceByInviteToken: JoinSpaceByInviteTokenResult.internalBinaryRead(reader, reader.uint32(), options, message.result.joinSpaceByInviteToken)
|
|
16031
|
+
};
|
|
16032
|
+
break;
|
|
16033
|
+
case 135:
|
|
16034
|
+
message.result = {
|
|
16035
|
+
oneofKind: "getSpaceInviteLink",
|
|
16036
|
+
getSpaceInviteLink: GetSpaceInviteLinkResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getSpaceInviteLink)
|
|
16037
|
+
};
|
|
16038
|
+
break;
|
|
16039
|
+
case 136:
|
|
16040
|
+
message.result = {
|
|
16041
|
+
oneofKind: "setSpaceInviteLinkEnabled",
|
|
16042
|
+
setSpaceInviteLinkEnabled: SetSpaceInviteLinkEnabledResult.internalBinaryRead(reader, reader.uint32(), options, message.result.setSpaceInviteLinkEnabled)
|
|
16043
|
+
};
|
|
16044
|
+
break;
|
|
16045
|
+
case 137:
|
|
16046
|
+
message.result = {
|
|
16047
|
+
oneofKind: "getFilePart",
|
|
16048
|
+
getFilePart: GetFilePartResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getFilePart)
|
|
16049
|
+
};
|
|
16050
|
+
break;
|
|
16051
|
+
case 138:
|
|
16052
|
+
message.result = {
|
|
16053
|
+
oneofKind: "acknowledgeMessages",
|
|
16054
|
+
acknowledgeMessages: AcknowledgeMessagesResult.internalBinaryRead(reader, reader.uint32(), options, message.result.acknowledgeMessages)
|
|
16055
|
+
};
|
|
16056
|
+
break;
|
|
16057
|
+
case 139:
|
|
16058
|
+
message.result = {
|
|
16059
|
+
oneofKind: "getUsers",
|
|
16060
|
+
getUsers: GetUsersResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getUsers)
|
|
16061
|
+
};
|
|
16062
|
+
break;
|
|
16063
|
+
case 140:
|
|
16064
|
+
message.result = {
|
|
16065
|
+
oneofKind: "getBotSkills",
|
|
16066
|
+
getBotSkills: GetBotSkillsResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getBotSkills)
|
|
16067
|
+
};
|
|
16068
|
+
break;
|
|
16069
|
+
case 141:
|
|
16070
|
+
message.result = {
|
|
16071
|
+
oneofKind: "getBotConfigurationCatalog",
|
|
16072
|
+
getBotConfigurationCatalog: GetBotConfigurationCatalogResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getBotConfigurationCatalog)
|
|
16073
|
+
};
|
|
16074
|
+
break;
|
|
15300
16075
|
default:
|
|
15301
16076
|
let u = options.readUnknownField;
|
|
15302
16077
|
if (u === "throw")
|
|
@@ -15573,6 +16348,22 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
15573
16348
|
UpdateBotAgentResult.internalBinaryWrite(message.result.updateBotAgent, writer.tag(132, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15574
16349
|
if (message.result.oneofKind === "deleteBotAgent")
|
|
15575
16350
|
DeleteBotAgentResult.internalBinaryWrite(message.result.deleteBotAgent, writer.tag(133, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16351
|
+
if (message.result.oneofKind === "joinSpaceByInviteToken")
|
|
16352
|
+
JoinSpaceByInviteTokenResult.internalBinaryWrite(message.result.joinSpaceByInviteToken, writer.tag(134, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16353
|
+
if (message.result.oneofKind === "getSpaceInviteLink")
|
|
16354
|
+
GetSpaceInviteLinkResult.internalBinaryWrite(message.result.getSpaceInviteLink, writer.tag(135, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16355
|
+
if (message.result.oneofKind === "setSpaceInviteLinkEnabled")
|
|
16356
|
+
SetSpaceInviteLinkEnabledResult.internalBinaryWrite(message.result.setSpaceInviteLinkEnabled, writer.tag(136, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16357
|
+
if (message.result.oneofKind === "getFilePart")
|
|
16358
|
+
GetFilePartResult.internalBinaryWrite(message.result.getFilePart, writer.tag(137, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16359
|
+
if (message.result.oneofKind === "acknowledgeMessages")
|
|
16360
|
+
AcknowledgeMessagesResult.internalBinaryWrite(message.result.acknowledgeMessages, writer.tag(138, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16361
|
+
if (message.result.oneofKind === "getUsers")
|
|
16362
|
+
GetUsersResult.internalBinaryWrite(message.result.getUsers, writer.tag(139, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16363
|
+
if (message.result.oneofKind === "getBotSkills")
|
|
16364
|
+
GetBotSkillsResult.internalBinaryWrite(message.result.getBotSkills, writer.tag(140, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16365
|
+
if (message.result.oneofKind === "getBotConfigurationCatalog")
|
|
16366
|
+
GetBotConfigurationCatalogResult.internalBinaryWrite(message.result.getBotConfigurationCatalog, writer.tag(141, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15576
16367
|
let u = options.writeUnknownFields;
|
|
15577
16368
|
if (u !== false)
|
|
15578
16369
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -16030,13 +16821,15 @@ class DeleteMemberInput$Type extends import_runtime4.MessageType {
|
|
|
16030
16821
|
constructor() {
|
|
16031
16822
|
super("DeleteMemberInput", [
|
|
16032
16823
|
{ no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 },
|
|
16033
|
-
{ no: 2, name: "user_id", kind: "scalar", T: 3, L: 0 }
|
|
16824
|
+
{ no: 2, name: "user_id", kind: "scalar", T: 3, L: 0 },
|
|
16825
|
+
{ no: 3, name: "block_join", kind: "scalar", T: 8 }
|
|
16034
16826
|
]);
|
|
16035
16827
|
}
|
|
16036
16828
|
create(value) {
|
|
16037
16829
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
16038
16830
|
message.spaceId = 0n;
|
|
16039
16831
|
message.userId = 0n;
|
|
16832
|
+
message.blockJoin = false;
|
|
16040
16833
|
if (value !== undefined)
|
|
16041
16834
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
16042
16835
|
return message;
|
|
@@ -16052,6 +16845,9 @@ class DeleteMemberInput$Type extends import_runtime4.MessageType {
|
|
|
16052
16845
|
case 2:
|
|
16053
16846
|
message.userId = reader.int64().toBigInt();
|
|
16054
16847
|
break;
|
|
16848
|
+
case 3:
|
|
16849
|
+
message.blockJoin = reader.bool();
|
|
16850
|
+
break;
|
|
16055
16851
|
default:
|
|
16056
16852
|
let u = options.readUnknownField;
|
|
16057
16853
|
if (u === "throw")
|
|
@@ -16068,6 +16864,8 @@ class DeleteMemberInput$Type extends import_runtime4.MessageType {
|
|
|
16068
16864
|
writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
|
|
16069
16865
|
if (message.userId !== 0n)
|
|
16070
16866
|
writer.tag(2, import_runtime.WireType.Varint).int64(message.userId);
|
|
16867
|
+
if (message.blockJoin !== false)
|
|
16868
|
+
writer.tag(3, import_runtime.WireType.Varint).bool(message.blockJoin);
|
|
16071
16869
|
let u = options.writeUnknownFields;
|
|
16072
16870
|
if (u !== false)
|
|
16073
16871
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -18525,11 +19323,13 @@ var GetUpdatesStateResult = new GetUpdatesStateResult$Type;
|
|
|
18525
19323
|
class GetChatInput$Type extends import_runtime4.MessageType {
|
|
18526
19324
|
constructor() {
|
|
18527
19325
|
super("GetChatInput", [
|
|
18528
|
-
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
|
|
19326
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
19327
|
+
{ no: 2, name: "include_recent_messages", kind: "scalar", T: 8 }
|
|
18529
19328
|
]);
|
|
18530
19329
|
}
|
|
18531
19330
|
create(value) {
|
|
18532
19331
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
19332
|
+
message.includeRecentMessages = false;
|
|
18533
19333
|
if (value !== undefined)
|
|
18534
19334
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
18535
19335
|
return message;
|
|
@@ -18542,6 +19342,9 @@ class GetChatInput$Type extends import_runtime4.MessageType {
|
|
|
18542
19342
|
case 1:
|
|
18543
19343
|
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
18544
19344
|
break;
|
|
19345
|
+
case 2:
|
|
19346
|
+
message.includeRecentMessages = reader.bool();
|
|
19347
|
+
break;
|
|
18545
19348
|
default:
|
|
18546
19349
|
let u = options.readUnknownField;
|
|
18547
19350
|
if (u === "throw")
|
|
@@ -18556,6 +19359,8 @@ class GetChatInput$Type extends import_runtime4.MessageType {
|
|
|
18556
19359
|
internalBinaryWrite(message, writer, options) {
|
|
18557
19360
|
if (message.peerId)
|
|
18558
19361
|
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
19362
|
+
if (message.includeRecentMessages !== false)
|
|
19363
|
+
writer.tag(2, import_runtime.WireType.Varint).bool(message.includeRecentMessages);
|
|
18559
19364
|
let u = options.writeUnknownFields;
|
|
18560
19365
|
if (u !== false)
|
|
18561
19366
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -18571,12 +19376,14 @@ class GetChatResult$Type extends import_runtime4.MessageType {
|
|
|
18571
19376
|
{ no: 2, name: "dialog", kind: "message", T: () => Dialog },
|
|
18572
19377
|
{ no: 3, name: "pinned_message_ids", kind: "scalar", repeat: 1, T: 3, L: 0 },
|
|
18573
19378
|
{ no: 4, name: "anchor_message", kind: "message", T: () => Message },
|
|
18574
|
-
{ no: 5, name: "user", kind: "message", T: () => User }
|
|
19379
|
+
{ no: 5, name: "user", kind: "message", T: () => User },
|
|
19380
|
+
{ no: 6, name: "messages", kind: "message", repeat: 1, T: () => Message }
|
|
18575
19381
|
]);
|
|
18576
19382
|
}
|
|
18577
19383
|
create(value) {
|
|
18578
19384
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
18579
19385
|
message.pinnedMessageIds = [];
|
|
19386
|
+
message.messages = [];
|
|
18580
19387
|
if (value !== undefined)
|
|
18581
19388
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
18582
19389
|
return message;
|
|
@@ -18605,6 +19412,9 @@ class GetChatResult$Type extends import_runtime4.MessageType {
|
|
|
18605
19412
|
case 5:
|
|
18606
19413
|
message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
|
|
18607
19414
|
break;
|
|
19415
|
+
case 6:
|
|
19416
|
+
message.messages.push(Message.internalBinaryRead(reader, reader.uint32(), options));
|
|
19417
|
+
break;
|
|
18608
19418
|
default:
|
|
18609
19419
|
let u = options.readUnknownField;
|
|
18610
19420
|
if (u === "throw")
|
|
@@ -18631,6 +19441,8 @@ class GetChatResult$Type extends import_runtime4.MessageType {
|
|
|
18631
19441
|
Message.internalBinaryWrite(message.anchorMessage, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
18632
19442
|
if (message.user)
|
|
18633
19443
|
User.internalBinaryWrite(message.user, writer.tag(5, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
19444
|
+
for (let i = 0;i < message.messages.length; i++)
|
|
19445
|
+
Message.internalBinaryWrite(message.messages[i], writer.tag(6, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
18634
19446
|
let u = options.writeUnknownFields;
|
|
18635
19447
|
if (u !== false)
|
|
18636
19448
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -18734,7 +19546,8 @@ class UpdateDialogOpenInput$Type extends import_runtime4.MessageType {
|
|
|
18734
19546
|
super("UpdateDialogOpenInput", [
|
|
18735
19547
|
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
18736
19548
|
{ no: 2, name: "open", kind: "scalar", T: 8 },
|
|
18737
|
-
{ no: 3, name: "order", kind: "scalar", opt: true, T: 9 }
|
|
19549
|
+
{ no: 3, name: "order", kind: "scalar", opt: true, T: 9 },
|
|
19550
|
+
{ no: 4, name: "folder_id", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
18738
19551
|
]);
|
|
18739
19552
|
}
|
|
18740
19553
|
create(value) {
|
|
@@ -18758,6 +19571,9 @@ class UpdateDialogOpenInput$Type extends import_runtime4.MessageType {
|
|
|
18758
19571
|
case 3:
|
|
18759
19572
|
message.order = reader.string();
|
|
18760
19573
|
break;
|
|
19574
|
+
case 4:
|
|
19575
|
+
message.folderId = reader.int64().toBigInt();
|
|
19576
|
+
break;
|
|
18761
19577
|
default:
|
|
18762
19578
|
let u = options.readUnknownField;
|
|
18763
19579
|
if (u === "throw")
|
|
@@ -18776,6 +19592,8 @@ class UpdateDialogOpenInput$Type extends import_runtime4.MessageType {
|
|
|
18776
19592
|
writer.tag(2, import_runtime.WireType.Varint).bool(message.open);
|
|
18777
19593
|
if (message.order !== undefined)
|
|
18778
19594
|
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.order);
|
|
19595
|
+
if (message.folderId !== undefined)
|
|
19596
|
+
writer.tag(4, import_runtime.WireType.Varint).int64(message.folderId);
|
|
18779
19597
|
let u = options.writeUnknownFields;
|
|
18780
19598
|
if (u !== false)
|
|
18781
19599
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -21334,6 +22152,68 @@ class BotCommand$Type extends import_runtime4.MessageType {
|
|
|
21334
22152
|
}
|
|
21335
22153
|
var BotCommand = new BotCommand$Type;
|
|
21336
22154
|
|
|
22155
|
+
class BotSkill$Type extends import_runtime4.MessageType {
|
|
22156
|
+
constructor() {
|
|
22157
|
+
super("BotSkill", [
|
|
22158
|
+
{ no: 1, name: "key", kind: "scalar", T: 9 },
|
|
22159
|
+
{ no: 2, name: "name", kind: "scalar", T: 9 },
|
|
22160
|
+
{ no: 3, name: "description", kind: "scalar", opt: true, T: 9 },
|
|
22161
|
+
{ no: 4, name: "sort_order", kind: "scalar", opt: true, T: 5 }
|
|
22162
|
+
]);
|
|
22163
|
+
}
|
|
22164
|
+
create(value) {
|
|
22165
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
22166
|
+
message.key = "";
|
|
22167
|
+
message.name = "";
|
|
22168
|
+
if (value !== undefined)
|
|
22169
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
22170
|
+
return message;
|
|
22171
|
+
}
|
|
22172
|
+
internalBinaryRead(reader, length, options, target) {
|
|
22173
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
22174
|
+
while (reader.pos < end) {
|
|
22175
|
+
let [fieldNo, wireType] = reader.tag();
|
|
22176
|
+
switch (fieldNo) {
|
|
22177
|
+
case 1:
|
|
22178
|
+
message.key = reader.string();
|
|
22179
|
+
break;
|
|
22180
|
+
case 2:
|
|
22181
|
+
message.name = reader.string();
|
|
22182
|
+
break;
|
|
22183
|
+
case 3:
|
|
22184
|
+
message.description = reader.string();
|
|
22185
|
+
break;
|
|
22186
|
+
case 4:
|
|
22187
|
+
message.sortOrder = reader.int32();
|
|
22188
|
+
break;
|
|
22189
|
+
default:
|
|
22190
|
+
let u = options.readUnknownField;
|
|
22191
|
+
if (u === "throw")
|
|
22192
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
22193
|
+
let d = reader.skip(wireType);
|
|
22194
|
+
if (u !== false)
|
|
22195
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
22196
|
+
}
|
|
22197
|
+
}
|
|
22198
|
+
return message;
|
|
22199
|
+
}
|
|
22200
|
+
internalBinaryWrite(message, writer, options) {
|
|
22201
|
+
if (message.key !== "")
|
|
22202
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.key);
|
|
22203
|
+
if (message.name !== "")
|
|
22204
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.name);
|
|
22205
|
+
if (message.description !== undefined)
|
|
22206
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
|
|
22207
|
+
if (message.sortOrder !== undefined)
|
|
22208
|
+
writer.tag(4, import_runtime.WireType.Varint).int32(message.sortOrder);
|
|
22209
|
+
let u = options.writeUnknownFields;
|
|
22210
|
+
if (u !== false)
|
|
22211
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
22212
|
+
return writer;
|
|
22213
|
+
}
|
|
22214
|
+
}
|
|
22215
|
+
var BotSkill = new BotSkill$Type;
|
|
22216
|
+
|
|
21337
22217
|
class PeerBotCommands$Type extends import_runtime4.MessageType {
|
|
21338
22218
|
constructor() {
|
|
21339
22219
|
super("PeerBotCommands", [
|
|
@@ -21562,6 +22442,183 @@ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
|
|
|
21562
22442
|
}
|
|
21563
22443
|
var SetBotCommandsResult = new SetBotCommandsResult$Type;
|
|
21564
22444
|
|
|
22445
|
+
class GetBotSkillsInput$Type extends import_runtime4.MessageType {
|
|
22446
|
+
constructor() {
|
|
22447
|
+
super("GetBotSkillsInput", [
|
|
22448
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
|
|
22449
|
+
]);
|
|
22450
|
+
}
|
|
22451
|
+
create(value) {
|
|
22452
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
22453
|
+
message.botUserId = 0n;
|
|
22454
|
+
if (value !== undefined)
|
|
22455
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
22456
|
+
return message;
|
|
22457
|
+
}
|
|
22458
|
+
internalBinaryRead(reader, length, options, target) {
|
|
22459
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
22460
|
+
while (reader.pos < end) {
|
|
22461
|
+
let [fieldNo, wireType] = reader.tag();
|
|
22462
|
+
switch (fieldNo) {
|
|
22463
|
+
case 1:
|
|
22464
|
+
message.botUserId = reader.int64().toBigInt();
|
|
22465
|
+
break;
|
|
22466
|
+
default:
|
|
22467
|
+
let u = options.readUnknownField;
|
|
22468
|
+
if (u === "throw")
|
|
22469
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
22470
|
+
let d = reader.skip(wireType);
|
|
22471
|
+
if (u !== false)
|
|
22472
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
22473
|
+
}
|
|
22474
|
+
}
|
|
22475
|
+
return message;
|
|
22476
|
+
}
|
|
22477
|
+
internalBinaryWrite(message, writer, options) {
|
|
22478
|
+
if (message.botUserId !== 0n)
|
|
22479
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
22480
|
+
let u = options.writeUnknownFields;
|
|
22481
|
+
if (u !== false)
|
|
22482
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
22483
|
+
return writer;
|
|
22484
|
+
}
|
|
22485
|
+
}
|
|
22486
|
+
var GetBotSkillsInput = new GetBotSkillsInput$Type;
|
|
22487
|
+
|
|
22488
|
+
class GetBotSkillsResult$Type extends import_runtime4.MessageType {
|
|
22489
|
+
constructor() {
|
|
22490
|
+
super("GetBotSkillsResult", [
|
|
22491
|
+
{ no: 1, name: "skills", kind: "message", repeat: 1, T: () => BotSkill }
|
|
22492
|
+
]);
|
|
22493
|
+
}
|
|
22494
|
+
create(value) {
|
|
22495
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
22496
|
+
message.skills = [];
|
|
22497
|
+
if (value !== undefined)
|
|
22498
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
22499
|
+
return message;
|
|
22500
|
+
}
|
|
22501
|
+
internalBinaryRead(reader, length, options, target) {
|
|
22502
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
22503
|
+
while (reader.pos < end) {
|
|
22504
|
+
let [fieldNo, wireType] = reader.tag();
|
|
22505
|
+
switch (fieldNo) {
|
|
22506
|
+
case 1:
|
|
22507
|
+
message.skills.push(BotSkill.internalBinaryRead(reader, reader.uint32(), options));
|
|
22508
|
+
break;
|
|
22509
|
+
default:
|
|
22510
|
+
let u = options.readUnknownField;
|
|
22511
|
+
if (u === "throw")
|
|
22512
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
22513
|
+
let d = reader.skip(wireType);
|
|
22514
|
+
if (u !== false)
|
|
22515
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
22516
|
+
}
|
|
22517
|
+
}
|
|
22518
|
+
return message;
|
|
22519
|
+
}
|
|
22520
|
+
internalBinaryWrite(message, writer, options) {
|
|
22521
|
+
for (let i = 0;i < message.skills.length; i++)
|
|
22522
|
+
BotSkill.internalBinaryWrite(message.skills[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
22523
|
+
let u = options.writeUnknownFields;
|
|
22524
|
+
if (u !== false)
|
|
22525
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
22526
|
+
return writer;
|
|
22527
|
+
}
|
|
22528
|
+
}
|
|
22529
|
+
var GetBotSkillsResult = new GetBotSkillsResult$Type;
|
|
22530
|
+
|
|
22531
|
+
class GetBotConfigurationCatalogInput$Type extends import_runtime4.MessageType {
|
|
22532
|
+
constructor() {
|
|
22533
|
+
super("GetBotConfigurationCatalogInput", [
|
|
22534
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
|
|
22535
|
+
{ no: 2, name: "peer_id", kind: "message", T: () => InputPeer }
|
|
22536
|
+
]);
|
|
22537
|
+
}
|
|
22538
|
+
create(value) {
|
|
22539
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
22540
|
+
message.botUserId = 0n;
|
|
22541
|
+
if (value !== undefined)
|
|
22542
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
22543
|
+
return message;
|
|
22544
|
+
}
|
|
22545
|
+
internalBinaryRead(reader, length, options, target) {
|
|
22546
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
22547
|
+
while (reader.pos < end) {
|
|
22548
|
+
let [fieldNo, wireType] = reader.tag();
|
|
22549
|
+
switch (fieldNo) {
|
|
22550
|
+
case 1:
|
|
22551
|
+
message.botUserId = reader.int64().toBigInt();
|
|
22552
|
+
break;
|
|
22553
|
+
case 2:
|
|
22554
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
22555
|
+
break;
|
|
22556
|
+
default:
|
|
22557
|
+
let u = options.readUnknownField;
|
|
22558
|
+
if (u === "throw")
|
|
22559
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
22560
|
+
let d = reader.skip(wireType);
|
|
22561
|
+
if (u !== false)
|
|
22562
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
22563
|
+
}
|
|
22564
|
+
}
|
|
22565
|
+
return message;
|
|
22566
|
+
}
|
|
22567
|
+
internalBinaryWrite(message, writer, options) {
|
|
22568
|
+
if (message.botUserId !== 0n)
|
|
22569
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
22570
|
+
if (message.peerId)
|
|
22571
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
22572
|
+
let u = options.writeUnknownFields;
|
|
22573
|
+
if (u !== false)
|
|
22574
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
22575
|
+
return writer;
|
|
22576
|
+
}
|
|
22577
|
+
}
|
|
22578
|
+
var GetBotConfigurationCatalogInput = new GetBotConfigurationCatalogInput$Type;
|
|
22579
|
+
|
|
22580
|
+
class GetBotConfigurationCatalogResult$Type extends import_runtime4.MessageType {
|
|
22581
|
+
constructor() {
|
|
22582
|
+
super("GetBotConfigurationCatalogResult", [
|
|
22583
|
+
{ no: 1, name: "catalog", kind: "message", T: () => AgentConfigurationCatalog }
|
|
22584
|
+
]);
|
|
22585
|
+
}
|
|
22586
|
+
create(value) {
|
|
22587
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
22588
|
+
if (value !== undefined)
|
|
22589
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
22590
|
+
return message;
|
|
22591
|
+
}
|
|
22592
|
+
internalBinaryRead(reader, length, options, target) {
|
|
22593
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
22594
|
+
while (reader.pos < end) {
|
|
22595
|
+
let [fieldNo, wireType] = reader.tag();
|
|
22596
|
+
switch (fieldNo) {
|
|
22597
|
+
case 1:
|
|
22598
|
+
message.catalog = AgentConfigurationCatalog.internalBinaryRead(reader, reader.uint32(), options, message.catalog);
|
|
22599
|
+
break;
|
|
22600
|
+
default:
|
|
22601
|
+
let u = options.readUnknownField;
|
|
22602
|
+
if (u === "throw")
|
|
22603
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
22604
|
+
let d = reader.skip(wireType);
|
|
22605
|
+
if (u !== false)
|
|
22606
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
22607
|
+
}
|
|
22608
|
+
}
|
|
22609
|
+
return message;
|
|
22610
|
+
}
|
|
22611
|
+
internalBinaryWrite(message, writer, options) {
|
|
22612
|
+
if (message.catalog)
|
|
22613
|
+
AgentConfigurationCatalog.internalBinaryWrite(message.catalog, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
22614
|
+
let u = options.writeUnknownFields;
|
|
22615
|
+
if (u !== false)
|
|
22616
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
22617
|
+
return writer;
|
|
22618
|
+
}
|
|
22619
|
+
}
|
|
22620
|
+
var GetBotConfigurationCatalogResult = new GetBotConfigurationCatalogResult$Type;
|
|
22621
|
+
|
|
21565
22622
|
class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
|
|
21566
22623
|
constructor() {
|
|
21567
22624
|
super("GetPeerBotCommandsInput", [
|
|
@@ -24964,7 +26021,9 @@ class SendMessageInput$Type extends import_runtime4.MessageType {
|
|
|
24964
26021
|
{ no: 7, name: "entities", kind: "message", T: () => MessageEntities },
|
|
24965
26022
|
{ no: 8, name: "parse_markdown", kind: "scalar", opt: true, T: 8 },
|
|
24966
26023
|
{ no: 9, name: "send_mode", kind: "enum", opt: true, T: () => ["MessageSendMode", MessageSendMode] },
|
|
24967
|
-
{ no: 10, name: "actions", kind: "message", T: () => MessageActions }
|
|
26024
|
+
{ no: 10, name: "actions", kind: "message", T: () => MessageActions },
|
|
26025
|
+
{ no: 11, name: "initial_agent_context", kind: "message", T: () => AgentThreadContext },
|
|
26026
|
+
{ no: 12, name: "source_chat_id", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
24968
26027
|
]);
|
|
24969
26028
|
}
|
|
24970
26029
|
create(value) {
|
|
@@ -25014,6 +26073,12 @@ class SendMessageInput$Type extends import_runtime4.MessageType {
|
|
|
25014
26073
|
case 10:
|
|
25015
26074
|
message.actions = MessageActions.internalBinaryRead(reader, reader.uint32(), options, message.actions);
|
|
25016
26075
|
break;
|
|
26076
|
+
case 11:
|
|
26077
|
+
message.initialAgentContext = AgentThreadContext.internalBinaryRead(reader, reader.uint32(), options, message.initialAgentContext);
|
|
26078
|
+
break;
|
|
26079
|
+
case 12:
|
|
26080
|
+
message.sourceChatId = reader.int64().toBigInt();
|
|
26081
|
+
break;
|
|
25017
26082
|
default:
|
|
25018
26083
|
let u = options.readUnknownField;
|
|
25019
26084
|
if (u === "throw")
|
|
@@ -25050,6 +26115,10 @@ class SendMessageInput$Type extends import_runtime4.MessageType {
|
|
|
25050
26115
|
writer.tag(9, import_runtime.WireType.Varint).int32(message.sendMode);
|
|
25051
26116
|
if (message.actions)
|
|
25052
26117
|
MessageActions.internalBinaryWrite(message.actions, writer.tag(10, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
26118
|
+
if (message.initialAgentContext)
|
|
26119
|
+
AgentThreadContext.internalBinaryWrite(message.initialAgentContext, writer.tag(11, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
26120
|
+
if (message.sourceChatId !== undefined)
|
|
26121
|
+
writer.tag(12, import_runtime.WireType.Varint).int64(message.sourceChatId);
|
|
25053
26122
|
let u = options.writeUnknownFields;
|
|
25054
26123
|
if (u !== false)
|
|
25055
26124
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -25482,7 +26551,8 @@ var GetChatHistoryInput = new GetChatHistoryInput$Type;
|
|
|
25482
26551
|
class GetChatHistoryResult$Type extends import_runtime4.MessageType {
|
|
25483
26552
|
constructor() {
|
|
25484
26553
|
super("GetChatHistoryResult", [
|
|
25485
|
-
{ no: 1, name: "messages", kind: "message", repeat: 1, T: () => Message }
|
|
26554
|
+
{ no: 1, name: "messages", kind: "message", repeat: 1, T: () => Message },
|
|
26555
|
+
{ no: 2, name: "acknowledgements", kind: "message", T: () => ChatAcknowledgements }
|
|
25486
26556
|
]);
|
|
25487
26557
|
}
|
|
25488
26558
|
create(value) {
|
|
@@ -25500,6 +26570,9 @@ class GetChatHistoryResult$Type extends import_runtime4.MessageType {
|
|
|
25500
26570
|
case 1:
|
|
25501
26571
|
message.messages.push(Message.internalBinaryRead(reader, reader.uint32(), options));
|
|
25502
26572
|
break;
|
|
26573
|
+
case 2:
|
|
26574
|
+
message.acknowledgements = ChatAcknowledgements.internalBinaryRead(reader, reader.uint32(), options, message.acknowledgements);
|
|
26575
|
+
break;
|
|
25503
26576
|
default:
|
|
25504
26577
|
let u = options.readUnknownField;
|
|
25505
26578
|
if (u === "throw")
|
|
@@ -25514,6 +26587,8 @@ class GetChatHistoryResult$Type extends import_runtime4.MessageType {
|
|
|
25514
26587
|
internalBinaryWrite(message, writer, options) {
|
|
25515
26588
|
for (let i = 0;i < message.messages.length; i++)
|
|
25516
26589
|
Message.internalBinaryWrite(message.messages[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
26590
|
+
if (message.acknowledgements)
|
|
26591
|
+
ChatAcknowledgements.internalBinaryWrite(message.acknowledgements, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
25517
26592
|
let u = options.writeUnknownFields;
|
|
25518
26593
|
if (u !== false)
|
|
25519
26594
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -27574,7 +28649,8 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
|
|
|
27574
28649
|
{ no: 5, name: "is_public", kind: "scalar", T: 8 },
|
|
27575
28650
|
{ no: 6, name: "participants", kind: "message", repeat: 1, T: () => InputChatParticipant },
|
|
27576
28651
|
{ no: 7, name: "reserved_chat_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
27577
|
-
{ no: 8, name: "placeholder_title", kind: "scalar", opt: true, T: 9 }
|
|
28652
|
+
{ no: 8, name: "placeholder_title", kind: "scalar", opt: true, T: 9 },
|
|
28653
|
+
{ no: 9, name: "agent_context", kind: "message", T: () => AgentThreadContext }
|
|
27578
28654
|
]);
|
|
27579
28655
|
}
|
|
27580
28656
|
create(value) {
|
|
@@ -27614,6 +28690,9 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
|
|
|
27614
28690
|
case 8:
|
|
27615
28691
|
message.placeholderTitle = reader.string();
|
|
27616
28692
|
break;
|
|
28693
|
+
case 9:
|
|
28694
|
+
message.agentContext = AgentThreadContext.internalBinaryRead(reader, reader.uint32(), options, message.agentContext);
|
|
28695
|
+
break;
|
|
27617
28696
|
default:
|
|
27618
28697
|
let u = options.readUnknownField;
|
|
27619
28698
|
if (u === "throw")
|
|
@@ -27642,6 +28721,8 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
|
|
|
27642
28721
|
writer.tag(7, import_runtime.WireType.Varint).int64(message.reservedChatId);
|
|
27643
28722
|
if (message.placeholderTitle !== undefined)
|
|
27644
28723
|
writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.placeholderTitle);
|
|
28724
|
+
if (message.agentContext)
|
|
28725
|
+
AgentThreadContext.internalBinaryWrite(message.agentContext, writer.tag(9, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
27645
28726
|
let u = options.writeUnknownFields;
|
|
27646
28727
|
if (u !== false)
|
|
27647
28728
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -27706,7 +28787,8 @@ class CreateSubthreadInput$Type extends import_runtime4.MessageType {
|
|
|
27706
28787
|
{ no: 3, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
27707
28788
|
{ no: 4, name: "description", kind: "scalar", opt: true, T: 9 },
|
|
27708
28789
|
{ no: 5, name: "emoji", kind: "scalar", opt: true, T: 9 },
|
|
27709
|
-
{ no: 6, name: "participants", kind: "message", repeat: 1, T: () => InputChatParticipant }
|
|
28790
|
+
{ no: 6, name: "participants", kind: "message", repeat: 1, T: () => InputChatParticipant },
|
|
28791
|
+
{ no: 7, name: "agent_context", kind: "message", T: () => AgentThreadContext }
|
|
27710
28792
|
]);
|
|
27711
28793
|
}
|
|
27712
28794
|
create(value) {
|
|
@@ -27740,6 +28822,9 @@ class CreateSubthreadInput$Type extends import_runtime4.MessageType {
|
|
|
27740
28822
|
case 6:
|
|
27741
28823
|
message.participants.push(InputChatParticipant.internalBinaryRead(reader, reader.uint32(), options));
|
|
27742
28824
|
break;
|
|
28825
|
+
case 7:
|
|
28826
|
+
message.agentContext = AgentThreadContext.internalBinaryRead(reader, reader.uint32(), options, message.agentContext);
|
|
28827
|
+
break;
|
|
27743
28828
|
default:
|
|
27744
28829
|
let u = options.readUnknownField;
|
|
27745
28830
|
if (u === "throw")
|
|
@@ -27764,6 +28849,8 @@ class CreateSubthreadInput$Type extends import_runtime4.MessageType {
|
|
|
27764
28849
|
writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.emoji);
|
|
27765
28850
|
for (let i = 0;i < message.participants.length; i++)
|
|
27766
28851
|
InputChatParticipant.internalBinaryWrite(message.participants[i], writer.tag(6, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
28852
|
+
if (message.agentContext)
|
|
28853
|
+
AgentThreadContext.internalBinaryWrite(message.agentContext, writer.tag(7, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
27767
28854
|
let u = options.writeUnknownFields;
|
|
27768
28855
|
if (u !== false)
|
|
27769
28856
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -28366,7 +29453,8 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
28366
29453
|
{ no: 45, name: "dialog_collapsed_max_id", kind: "message", oneof: "update", T: () => UpdateDialogCollapsedMaxId },
|
|
28367
29454
|
{ no: 46, name: "dialog_folder", kind: "message", oneof: "update", T: () => UpdateDialogFolder },
|
|
28368
29455
|
{ no: 47, name: "user_added_to_chat", kind: "message", oneof: "update", T: () => UpdateUserAddedToChat },
|
|
28369
|
-
{ no: 48, name: "user_removed_from_chat", kind: "message", oneof: "update", T: () => UpdateUserRemovedFromChat }
|
|
29456
|
+
{ no: 48, name: "user_removed_from_chat", kind: "message", oneof: "update", T: () => UpdateUserRemovedFromChat },
|
|
29457
|
+
{ no: 49, name: "acknowledgement", kind: "message", oneof: "update", T: () => ChatAcknowledgement }
|
|
28370
29458
|
]);
|
|
28371
29459
|
}
|
|
28372
29460
|
create(value) {
|
|
@@ -28657,6 +29745,12 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
28657
29745
|
userRemovedFromChat: UpdateUserRemovedFromChat.internalBinaryRead(reader, reader.uint32(), options, message.update.userRemovedFromChat)
|
|
28658
29746
|
};
|
|
28659
29747
|
break;
|
|
29748
|
+
case 49:
|
|
29749
|
+
message.update = {
|
|
29750
|
+
oneofKind: "acknowledgement",
|
|
29751
|
+
acknowledgement: ChatAcknowledgement.internalBinaryRead(reader, reader.uint32(), options, message.update.acknowledgement)
|
|
29752
|
+
};
|
|
29753
|
+
break;
|
|
28660
29754
|
default:
|
|
28661
29755
|
let u = options.readUnknownField;
|
|
28662
29756
|
if (u === "throw")
|
|
@@ -28763,6 +29857,8 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
28763
29857
|
UpdateUserAddedToChat.internalBinaryWrite(message.update.userAddedToChat, writer.tag(47, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
28764
29858
|
if (message.update.oneofKind === "userRemovedFromChat")
|
|
28765
29859
|
UpdateUserRemovedFromChat.internalBinaryWrite(message.update.userRemovedFromChat, writer.tag(48, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
29860
|
+
if (message.update.oneofKind === "acknowledgement")
|
|
29861
|
+
ChatAcknowledgement.internalBinaryWrite(message.update.acknowledgement, writer.tag(49, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
28766
29862
|
let u = options.writeUnknownFields;
|
|
28767
29863
|
if (u !== false)
|
|
28768
29864
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -29038,7 +30134,8 @@ class UpdateChatInfo$Type extends import_runtime4.MessageType {
|
|
|
29038
30134
|
{ no: 1, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
29039
30135
|
{ no: 2, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
29040
30136
|
{ no: 3, name: "emoji", kind: "scalar", opt: true, T: 9 },
|
|
29041
|
-
{ no: 4, name: "untitled", kind: "scalar", opt: true, T: 8 }
|
|
30137
|
+
{ no: 4, name: "untitled", kind: "scalar", opt: true, T: 8 },
|
|
30138
|
+
{ no: 5, name: "agent_context", kind: "message", T: () => AgentThreadContext }
|
|
29042
30139
|
]);
|
|
29043
30140
|
}
|
|
29044
30141
|
create(value) {
|
|
@@ -29065,6 +30162,9 @@ class UpdateChatInfo$Type extends import_runtime4.MessageType {
|
|
|
29065
30162
|
case 4:
|
|
29066
30163
|
message.untitled = reader.bool();
|
|
29067
30164
|
break;
|
|
30165
|
+
case 5:
|
|
30166
|
+
message.agentContext = AgentThreadContext.internalBinaryRead(reader, reader.uint32(), options, message.agentContext);
|
|
30167
|
+
break;
|
|
29068
30168
|
default:
|
|
29069
30169
|
let u = options.readUnknownField;
|
|
29070
30170
|
if (u === "throw")
|
|
@@ -29085,6 +30185,8 @@ class UpdateChatInfo$Type extends import_runtime4.MessageType {
|
|
|
29085
30185
|
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.emoji);
|
|
29086
30186
|
if (message.untitled !== undefined)
|
|
29087
30187
|
writer.tag(4, import_runtime.WireType.Varint).bool(message.untitled);
|
|
30188
|
+
if (message.agentContext)
|
|
30189
|
+
AgentThreadContext.internalBinaryWrite(message.agentContext, writer.tag(5, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
29088
30190
|
let u = options.writeUnknownFields;
|
|
29089
30191
|
if (u !== false)
|
|
29090
30192
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -31743,6 +32845,100 @@ class SearchUsersResult$Type extends import_runtime4.MessageType {
|
|
|
31743
32845
|
}
|
|
31744
32846
|
var SearchUsersResult = new SearchUsersResult$Type;
|
|
31745
32847
|
|
|
32848
|
+
class GetUsersInput$Type extends import_runtime4.MessageType {
|
|
32849
|
+
constructor() {
|
|
32850
|
+
super("GetUsersInput", [
|
|
32851
|
+
{ no: 1, name: "user_ids", kind: "scalar", repeat: 1, T: 3, L: 0 }
|
|
32852
|
+
]);
|
|
32853
|
+
}
|
|
32854
|
+
create(value) {
|
|
32855
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
32856
|
+
message.userIds = [];
|
|
32857
|
+
if (value !== undefined)
|
|
32858
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32859
|
+
return message;
|
|
32860
|
+
}
|
|
32861
|
+
internalBinaryRead(reader, length, options, target) {
|
|
32862
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
32863
|
+
while (reader.pos < end) {
|
|
32864
|
+
let [fieldNo, wireType] = reader.tag();
|
|
32865
|
+
switch (fieldNo) {
|
|
32866
|
+
case 1:
|
|
32867
|
+
if (wireType === import_runtime.WireType.LengthDelimited)
|
|
32868
|
+
for (let e = reader.int32() + reader.pos;reader.pos < e; )
|
|
32869
|
+
message.userIds.push(reader.int64().toBigInt());
|
|
32870
|
+
else
|
|
32871
|
+
message.userIds.push(reader.int64().toBigInt());
|
|
32872
|
+
break;
|
|
32873
|
+
default:
|
|
32874
|
+
let u = options.readUnknownField;
|
|
32875
|
+
if (u === "throw")
|
|
32876
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
32877
|
+
let d = reader.skip(wireType);
|
|
32878
|
+
if (u !== false)
|
|
32879
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
32880
|
+
}
|
|
32881
|
+
}
|
|
32882
|
+
return message;
|
|
32883
|
+
}
|
|
32884
|
+
internalBinaryWrite(message, writer, options) {
|
|
32885
|
+
if (message.userIds.length) {
|
|
32886
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).fork();
|
|
32887
|
+
for (let i = 0;i < message.userIds.length; i++)
|
|
32888
|
+
writer.int64(message.userIds[i]);
|
|
32889
|
+
writer.join();
|
|
32890
|
+
}
|
|
32891
|
+
let u = options.writeUnknownFields;
|
|
32892
|
+
if (u !== false)
|
|
32893
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32894
|
+
return writer;
|
|
32895
|
+
}
|
|
32896
|
+
}
|
|
32897
|
+
var GetUsersInput = new GetUsersInput$Type;
|
|
32898
|
+
|
|
32899
|
+
class GetUsersResult$Type extends import_runtime4.MessageType {
|
|
32900
|
+
constructor() {
|
|
32901
|
+
super("GetUsersResult", [
|
|
32902
|
+
{ no: 1, name: "users", kind: "message", repeat: 1, T: () => User }
|
|
32903
|
+
]);
|
|
32904
|
+
}
|
|
32905
|
+
create(value) {
|
|
32906
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
32907
|
+
message.users = [];
|
|
32908
|
+
if (value !== undefined)
|
|
32909
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32910
|
+
return message;
|
|
32911
|
+
}
|
|
32912
|
+
internalBinaryRead(reader, length, options, target) {
|
|
32913
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
32914
|
+
while (reader.pos < end) {
|
|
32915
|
+
let [fieldNo, wireType] = reader.tag();
|
|
32916
|
+
switch (fieldNo) {
|
|
32917
|
+
case 1:
|
|
32918
|
+
message.users.push(User.internalBinaryRead(reader, reader.uint32(), options));
|
|
32919
|
+
break;
|
|
32920
|
+
default:
|
|
32921
|
+
let u = options.readUnknownField;
|
|
32922
|
+
if (u === "throw")
|
|
32923
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
32924
|
+
let d = reader.skip(wireType);
|
|
32925
|
+
if (u !== false)
|
|
32926
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
32927
|
+
}
|
|
32928
|
+
}
|
|
32929
|
+
return message;
|
|
32930
|
+
}
|
|
32931
|
+
internalBinaryWrite(message, writer, options) {
|
|
32932
|
+
for (let i = 0;i < message.users.length; i++)
|
|
32933
|
+
User.internalBinaryWrite(message.users[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
32934
|
+
let u = options.writeUnknownFields;
|
|
32935
|
+
if (u !== false)
|
|
32936
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32937
|
+
return writer;
|
|
32938
|
+
}
|
|
32939
|
+
}
|
|
32940
|
+
var GetUsersResult = new GetUsersResult$Type;
|
|
32941
|
+
|
|
31746
32942
|
class InviteToInlineInput$Type extends import_runtime4.MessageType {
|
|
31747
32943
|
constructor() {
|
|
31748
32944
|
super("InviteToInlineInput", [
|
|
@@ -32258,19 +33454,214 @@ class UpdateChatVisibilityResult$Type extends import_runtime4.MessageType {
|
|
|
32258
33454
|
return writer;
|
|
32259
33455
|
}
|
|
32260
33456
|
}
|
|
32261
|
-
var UpdateChatVisibilityResult = new UpdateChatVisibilityResult$Type;
|
|
33457
|
+
var UpdateChatVisibilityResult = new UpdateChatVisibilityResult$Type;
|
|
33458
|
+
|
|
33459
|
+
class UpdateChatInfoInput$Type extends import_runtime4.MessageType {
|
|
33460
|
+
constructor() {
|
|
33461
|
+
super("UpdateChatInfoInput", [
|
|
33462
|
+
{ no: 1, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
33463
|
+
{ no: 2, name: "title", kind: "scalar", opt: true, T: 9 },
|
|
33464
|
+
{ no: 3, name: "emoji", kind: "scalar", opt: true, T: 9 },
|
|
33465
|
+
{ no: 4, name: "agent_context", kind: "message", T: () => AgentThreadContext }
|
|
33466
|
+
]);
|
|
33467
|
+
}
|
|
33468
|
+
create(value) {
|
|
33469
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
33470
|
+
message.chatId = 0n;
|
|
33471
|
+
if (value !== undefined)
|
|
33472
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
33473
|
+
return message;
|
|
33474
|
+
}
|
|
33475
|
+
internalBinaryRead(reader, length, options, target) {
|
|
33476
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
33477
|
+
while (reader.pos < end) {
|
|
33478
|
+
let [fieldNo, wireType] = reader.tag();
|
|
33479
|
+
switch (fieldNo) {
|
|
33480
|
+
case 1:
|
|
33481
|
+
message.chatId = reader.int64().toBigInt();
|
|
33482
|
+
break;
|
|
33483
|
+
case 2:
|
|
33484
|
+
message.title = reader.string();
|
|
33485
|
+
break;
|
|
33486
|
+
case 3:
|
|
33487
|
+
message.emoji = reader.string();
|
|
33488
|
+
break;
|
|
33489
|
+
case 4:
|
|
33490
|
+
message.agentContext = AgentThreadContext.internalBinaryRead(reader, reader.uint32(), options, message.agentContext);
|
|
33491
|
+
break;
|
|
33492
|
+
default:
|
|
33493
|
+
let u = options.readUnknownField;
|
|
33494
|
+
if (u === "throw")
|
|
33495
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
33496
|
+
let d = reader.skip(wireType);
|
|
33497
|
+
if (u !== false)
|
|
33498
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
33499
|
+
}
|
|
33500
|
+
}
|
|
33501
|
+
return message;
|
|
33502
|
+
}
|
|
33503
|
+
internalBinaryWrite(message, writer, options) {
|
|
33504
|
+
if (message.chatId !== 0n)
|
|
33505
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.chatId);
|
|
33506
|
+
if (message.title !== undefined)
|
|
33507
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.title);
|
|
33508
|
+
if (message.emoji !== undefined)
|
|
33509
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.emoji);
|
|
33510
|
+
if (message.agentContext)
|
|
33511
|
+
AgentThreadContext.internalBinaryWrite(message.agentContext, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
33512
|
+
let u = options.writeUnknownFields;
|
|
33513
|
+
if (u !== false)
|
|
33514
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
33515
|
+
return writer;
|
|
33516
|
+
}
|
|
33517
|
+
}
|
|
33518
|
+
var UpdateChatInfoInput = new UpdateChatInfoInput$Type;
|
|
33519
|
+
|
|
33520
|
+
class UpdateChatInfoResult$Type extends import_runtime4.MessageType {
|
|
33521
|
+
constructor() {
|
|
33522
|
+
super("UpdateChatInfoResult", [
|
|
33523
|
+
{ no: 1, name: "chat", kind: "message", T: () => Chat }
|
|
33524
|
+
]);
|
|
33525
|
+
}
|
|
33526
|
+
create(value) {
|
|
33527
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
33528
|
+
if (value !== undefined)
|
|
33529
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
33530
|
+
return message;
|
|
33531
|
+
}
|
|
33532
|
+
internalBinaryRead(reader, length, options, target) {
|
|
33533
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
33534
|
+
while (reader.pos < end) {
|
|
33535
|
+
let [fieldNo, wireType] = reader.tag();
|
|
33536
|
+
switch (fieldNo) {
|
|
33537
|
+
case 1:
|
|
33538
|
+
message.chat = Chat.internalBinaryRead(reader, reader.uint32(), options, message.chat);
|
|
33539
|
+
break;
|
|
33540
|
+
default:
|
|
33541
|
+
let u = options.readUnknownField;
|
|
33542
|
+
if (u === "throw")
|
|
33543
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
33544
|
+
let d = reader.skip(wireType);
|
|
33545
|
+
if (u !== false)
|
|
33546
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
33547
|
+
}
|
|
33548
|
+
}
|
|
33549
|
+
return message;
|
|
33550
|
+
}
|
|
33551
|
+
internalBinaryWrite(message, writer, options) {
|
|
33552
|
+
if (message.chat)
|
|
33553
|
+
Chat.internalBinaryWrite(message.chat, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
33554
|
+
let u = options.writeUnknownFields;
|
|
33555
|
+
if (u !== false)
|
|
33556
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
33557
|
+
return writer;
|
|
33558
|
+
}
|
|
33559
|
+
}
|
|
33560
|
+
var UpdateChatInfoResult = new UpdateChatInfoResult$Type;
|
|
33561
|
+
|
|
33562
|
+
class MoveThreadInput$Type extends import_runtime4.MessageType {
|
|
33563
|
+
constructor() {
|
|
33564
|
+
super("MoveThreadInput", [
|
|
33565
|
+
{ no: 1, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
33566
|
+
{ no: 2, name: "space_id", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
33567
|
+
]);
|
|
33568
|
+
}
|
|
33569
|
+
create(value) {
|
|
33570
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
33571
|
+
message.chatId = 0n;
|
|
33572
|
+
if (value !== undefined)
|
|
33573
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
33574
|
+
return message;
|
|
33575
|
+
}
|
|
33576
|
+
internalBinaryRead(reader, length, options, target) {
|
|
33577
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
33578
|
+
while (reader.pos < end) {
|
|
33579
|
+
let [fieldNo, wireType] = reader.tag();
|
|
33580
|
+
switch (fieldNo) {
|
|
33581
|
+
case 1:
|
|
33582
|
+
message.chatId = reader.int64().toBigInt();
|
|
33583
|
+
break;
|
|
33584
|
+
case 2:
|
|
33585
|
+
message.spaceId = reader.int64().toBigInt();
|
|
33586
|
+
break;
|
|
33587
|
+
default:
|
|
33588
|
+
let u = options.readUnknownField;
|
|
33589
|
+
if (u === "throw")
|
|
33590
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
33591
|
+
let d = reader.skip(wireType);
|
|
33592
|
+
if (u !== false)
|
|
33593
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
33594
|
+
}
|
|
33595
|
+
}
|
|
33596
|
+
return message;
|
|
33597
|
+
}
|
|
33598
|
+
internalBinaryWrite(message, writer, options) {
|
|
33599
|
+
if (message.chatId !== 0n)
|
|
33600
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.chatId);
|
|
33601
|
+
if (message.spaceId !== undefined)
|
|
33602
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.spaceId);
|
|
33603
|
+
let u = options.writeUnknownFields;
|
|
33604
|
+
if (u !== false)
|
|
33605
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
33606
|
+
return writer;
|
|
33607
|
+
}
|
|
33608
|
+
}
|
|
33609
|
+
var MoveThreadInput = new MoveThreadInput$Type;
|
|
33610
|
+
|
|
33611
|
+
class MoveThreadResult$Type extends import_runtime4.MessageType {
|
|
33612
|
+
constructor() {
|
|
33613
|
+
super("MoveThreadResult", [
|
|
33614
|
+
{ no: 1, name: "chat", kind: "message", T: () => Chat }
|
|
33615
|
+
]);
|
|
33616
|
+
}
|
|
33617
|
+
create(value) {
|
|
33618
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
33619
|
+
if (value !== undefined)
|
|
33620
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
33621
|
+
return message;
|
|
33622
|
+
}
|
|
33623
|
+
internalBinaryRead(reader, length, options, target) {
|
|
33624
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
33625
|
+
while (reader.pos < end) {
|
|
33626
|
+
let [fieldNo, wireType] = reader.tag();
|
|
33627
|
+
switch (fieldNo) {
|
|
33628
|
+
case 1:
|
|
33629
|
+
message.chat = Chat.internalBinaryRead(reader, reader.uint32(), options, message.chat);
|
|
33630
|
+
break;
|
|
33631
|
+
default:
|
|
33632
|
+
let u = options.readUnknownField;
|
|
33633
|
+
if (u === "throw")
|
|
33634
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
33635
|
+
let d = reader.skip(wireType);
|
|
33636
|
+
if (u !== false)
|
|
33637
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
33638
|
+
}
|
|
33639
|
+
}
|
|
33640
|
+
return message;
|
|
33641
|
+
}
|
|
33642
|
+
internalBinaryWrite(message, writer, options) {
|
|
33643
|
+
if (message.chat)
|
|
33644
|
+
Chat.internalBinaryWrite(message.chat, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
33645
|
+
let u = options.writeUnknownFields;
|
|
33646
|
+
if (u !== false)
|
|
33647
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
33648
|
+
return writer;
|
|
33649
|
+
}
|
|
33650
|
+
}
|
|
33651
|
+
var MoveThreadResult = new MoveThreadResult$Type;
|
|
32262
33652
|
|
|
32263
|
-
class
|
|
33653
|
+
class PinMessageInput$Type extends import_runtime4.MessageType {
|
|
32264
33654
|
constructor() {
|
|
32265
|
-
super("
|
|
32266
|
-
{ no: 1, name: "
|
|
32267
|
-
{ no: 2, name: "
|
|
32268
|
-
{ no: 3, name: "
|
|
33655
|
+
super("PinMessageInput", [
|
|
33656
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
33657
|
+
{ no: 2, name: "message_id", kind: "scalar", T: 3, L: 0 },
|
|
33658
|
+
{ no: 3, name: "unpin", kind: "scalar", T: 8 }
|
|
32269
33659
|
]);
|
|
32270
33660
|
}
|
|
32271
33661
|
create(value) {
|
|
32272
33662
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
32273
|
-
message.
|
|
33663
|
+
message.messageId = 0n;
|
|
33664
|
+
message.unpin = false;
|
|
32274
33665
|
if (value !== undefined)
|
|
32275
33666
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32276
33667
|
return message;
|
|
@@ -32281,13 +33672,13 @@ class UpdateChatInfoInput$Type extends import_runtime4.MessageType {
|
|
|
32281
33672
|
let [fieldNo, wireType] = reader.tag();
|
|
32282
33673
|
switch (fieldNo) {
|
|
32283
33674
|
case 1:
|
|
32284
|
-
message.
|
|
33675
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
32285
33676
|
break;
|
|
32286
33677
|
case 2:
|
|
32287
|
-
message.
|
|
33678
|
+
message.messageId = reader.int64().toBigInt();
|
|
32288
33679
|
break;
|
|
32289
33680
|
case 3:
|
|
32290
|
-
message.
|
|
33681
|
+
message.unpin = reader.bool();
|
|
32291
33682
|
break;
|
|
32292
33683
|
default:
|
|
32293
33684
|
let u = options.readUnknownField;
|
|
@@ -32301,28 +33692,29 @@ class UpdateChatInfoInput$Type extends import_runtime4.MessageType {
|
|
|
32301
33692
|
return message;
|
|
32302
33693
|
}
|
|
32303
33694
|
internalBinaryWrite(message, writer, options) {
|
|
32304
|
-
if (message.
|
|
32305
|
-
writer.tag(1, import_runtime.WireType.
|
|
32306
|
-
if (message.
|
|
32307
|
-
writer.tag(2, import_runtime.WireType.
|
|
32308
|
-
if (message.
|
|
32309
|
-
writer.tag(3, import_runtime.WireType.
|
|
33695
|
+
if (message.peerId)
|
|
33696
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
33697
|
+
if (message.messageId !== 0n)
|
|
33698
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.messageId);
|
|
33699
|
+
if (message.unpin !== false)
|
|
33700
|
+
writer.tag(3, import_runtime.WireType.Varint).bool(message.unpin);
|
|
32310
33701
|
let u = options.writeUnknownFields;
|
|
32311
33702
|
if (u !== false)
|
|
32312
33703
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32313
33704
|
return writer;
|
|
32314
33705
|
}
|
|
32315
33706
|
}
|
|
32316
|
-
var
|
|
33707
|
+
var PinMessageInput = new PinMessageInput$Type;
|
|
32317
33708
|
|
|
32318
|
-
class
|
|
33709
|
+
class PinMessageResult$Type extends import_runtime4.MessageType {
|
|
32319
33710
|
constructor() {
|
|
32320
|
-
super("
|
|
32321
|
-
{ no: 1, name: "
|
|
33711
|
+
super("PinMessageResult", [
|
|
33712
|
+
{ no: 1, name: "updates", kind: "message", repeat: 1, T: () => Update }
|
|
32322
33713
|
]);
|
|
32323
33714
|
}
|
|
32324
33715
|
create(value) {
|
|
32325
33716
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
33717
|
+
message.updates = [];
|
|
32326
33718
|
if (value !== undefined)
|
|
32327
33719
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32328
33720
|
return message;
|
|
@@ -32333,7 +33725,7 @@ class UpdateChatInfoResult$Type extends import_runtime4.MessageType {
|
|
|
32333
33725
|
let [fieldNo, wireType] = reader.tag();
|
|
32334
33726
|
switch (fieldNo) {
|
|
32335
33727
|
case 1:
|
|
32336
|
-
message.
|
|
33728
|
+
message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
|
|
32337
33729
|
break;
|
|
32338
33730
|
default:
|
|
32339
33731
|
let u = options.readUnknownField;
|
|
@@ -32347,26 +33739,26 @@ class UpdateChatInfoResult$Type extends import_runtime4.MessageType {
|
|
|
32347
33739
|
return message;
|
|
32348
33740
|
}
|
|
32349
33741
|
internalBinaryWrite(message, writer, options) {
|
|
32350
|
-
|
|
32351
|
-
|
|
33742
|
+
for (let i = 0;i < message.updates.length; i++)
|
|
33743
|
+
Update.internalBinaryWrite(message.updates[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
32352
33744
|
let u = options.writeUnknownFields;
|
|
32353
33745
|
if (u !== false)
|
|
32354
33746
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32355
33747
|
return writer;
|
|
32356
33748
|
}
|
|
32357
33749
|
}
|
|
32358
|
-
var
|
|
33750
|
+
var PinMessageResult = new PinMessageResult$Type;
|
|
32359
33751
|
|
|
32360
|
-
class
|
|
33752
|
+
class DraftMessage$Type extends import_runtime4.MessageType {
|
|
32361
33753
|
constructor() {
|
|
32362
|
-
super("
|
|
32363
|
-
{ no: 1, name: "
|
|
32364
|
-
{ no: 2, name: "
|
|
33754
|
+
super("DraftMessage", [
|
|
33755
|
+
{ no: 1, name: "text", kind: "scalar", T: 9 },
|
|
33756
|
+
{ no: 2, name: "entities", kind: "message", T: () => MessageEntities }
|
|
32365
33757
|
]);
|
|
32366
33758
|
}
|
|
32367
33759
|
create(value) {
|
|
32368
33760
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
32369
|
-
message.
|
|
33761
|
+
message.text = "";
|
|
32370
33762
|
if (value !== undefined)
|
|
32371
33763
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32372
33764
|
return message;
|
|
@@ -32377,10 +33769,10 @@ class MoveThreadInput$Type extends import_runtime4.MessageType {
|
|
|
32377
33769
|
let [fieldNo, wireType] = reader.tag();
|
|
32378
33770
|
switch (fieldNo) {
|
|
32379
33771
|
case 1:
|
|
32380
|
-
message.
|
|
33772
|
+
message.text = reader.string();
|
|
32381
33773
|
break;
|
|
32382
33774
|
case 2:
|
|
32383
|
-
message.
|
|
33775
|
+
message.entities = MessageEntities.internalBinaryRead(reader, reader.uint32(), options, message.entities);
|
|
32384
33776
|
break;
|
|
32385
33777
|
default:
|
|
32386
33778
|
let u = options.readUnknownField;
|
|
@@ -32394,26 +33786,30 @@ class MoveThreadInput$Type extends import_runtime4.MessageType {
|
|
|
32394
33786
|
return message;
|
|
32395
33787
|
}
|
|
32396
33788
|
internalBinaryWrite(message, writer, options) {
|
|
32397
|
-
if (message.
|
|
32398
|
-
writer.tag(1, import_runtime.WireType.
|
|
32399
|
-
if (message.
|
|
32400
|
-
writer.tag(2, import_runtime.WireType.
|
|
33789
|
+
if (message.text !== "")
|
|
33790
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.text);
|
|
33791
|
+
if (message.entities)
|
|
33792
|
+
MessageEntities.internalBinaryWrite(message.entities, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
32401
33793
|
let u = options.writeUnknownFields;
|
|
32402
33794
|
if (u !== false)
|
|
32403
33795
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32404
33796
|
return writer;
|
|
32405
33797
|
}
|
|
32406
33798
|
}
|
|
32407
|
-
var
|
|
33799
|
+
var DraftMessage = new DraftMessage$Type;
|
|
32408
33800
|
|
|
32409
|
-
class
|
|
33801
|
+
class AgentProjectOption$Type extends import_runtime4.MessageType {
|
|
32410
33802
|
constructor() {
|
|
32411
|
-
super("
|
|
32412
|
-
{ no: 1, name: "
|
|
33803
|
+
super("AgentProjectOption", [
|
|
33804
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 },
|
|
33805
|
+
{ no: 2, name: "label", kind: "scalar", T: 9 },
|
|
33806
|
+
{ no: 3, name: "description", kind: "scalar", opt: true, T: 9 }
|
|
32413
33807
|
]);
|
|
32414
33808
|
}
|
|
32415
33809
|
create(value) {
|
|
32416
33810
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
33811
|
+
message.id = "";
|
|
33812
|
+
message.label = "";
|
|
32417
33813
|
if (value !== undefined)
|
|
32418
33814
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32419
33815
|
return message;
|
|
@@ -32424,7 +33820,13 @@ class MoveThreadResult$Type extends import_runtime4.MessageType {
|
|
|
32424
33820
|
let [fieldNo, wireType] = reader.tag();
|
|
32425
33821
|
switch (fieldNo) {
|
|
32426
33822
|
case 1:
|
|
32427
|
-
message.
|
|
33823
|
+
message.id = reader.string();
|
|
33824
|
+
break;
|
|
33825
|
+
case 2:
|
|
33826
|
+
message.label = reader.string();
|
|
33827
|
+
break;
|
|
33828
|
+
case 3:
|
|
33829
|
+
message.description = reader.string();
|
|
32428
33830
|
break;
|
|
32429
33831
|
default:
|
|
32430
33832
|
let u = options.readUnknownField;
|
|
@@ -32438,28 +33840,30 @@ class MoveThreadResult$Type extends import_runtime4.MessageType {
|
|
|
32438
33840
|
return message;
|
|
32439
33841
|
}
|
|
32440
33842
|
internalBinaryWrite(message, writer, options) {
|
|
32441
|
-
if (message.
|
|
32442
|
-
|
|
33843
|
+
if (message.id !== "")
|
|
33844
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.id);
|
|
33845
|
+
if (message.label !== "")
|
|
33846
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.label);
|
|
33847
|
+
if (message.description !== undefined)
|
|
33848
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
|
|
32443
33849
|
let u = options.writeUnknownFields;
|
|
32444
33850
|
if (u !== false)
|
|
32445
33851
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32446
33852
|
return writer;
|
|
32447
33853
|
}
|
|
32448
33854
|
}
|
|
32449
|
-
var
|
|
33855
|
+
var AgentProjectOption = new AgentProjectOption$Type;
|
|
32450
33856
|
|
|
32451
|
-
class
|
|
33857
|
+
class AgentProjectCatalog$Type extends import_runtime4.MessageType {
|
|
32452
33858
|
constructor() {
|
|
32453
|
-
super("
|
|
32454
|
-
{ no: 1, name: "
|
|
32455
|
-
{ no: 2, name: "
|
|
32456
|
-
{ no: 3, name: "unpin", kind: "scalar", T: 8 }
|
|
33859
|
+
super("AgentProjectCatalog", [
|
|
33860
|
+
{ no: 1, name: "options", kind: "message", repeat: 1, T: () => AgentProjectOption },
|
|
33861
|
+
{ no: 2, name: "can_select_folder", kind: "scalar", opt: true, T: 8 }
|
|
32457
33862
|
]);
|
|
32458
33863
|
}
|
|
32459
33864
|
create(value) {
|
|
32460
33865
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
32461
|
-
message.
|
|
32462
|
-
message.unpin = false;
|
|
33866
|
+
message.options = [];
|
|
32463
33867
|
if (value !== undefined)
|
|
32464
33868
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32465
33869
|
return message;
|
|
@@ -32470,13 +33874,64 @@ class PinMessageInput$Type extends import_runtime4.MessageType {
|
|
|
32470
33874
|
let [fieldNo, wireType] = reader.tag();
|
|
32471
33875
|
switch (fieldNo) {
|
|
32472
33876
|
case 1:
|
|
32473
|
-
message.
|
|
33877
|
+
message.options.push(AgentProjectOption.internalBinaryRead(reader, reader.uint32(), options));
|
|
32474
33878
|
break;
|
|
32475
33879
|
case 2:
|
|
32476
|
-
message.
|
|
33880
|
+
message.canSelectFolder = reader.bool();
|
|
33881
|
+
break;
|
|
33882
|
+
default:
|
|
33883
|
+
let u = options.readUnknownField;
|
|
33884
|
+
if (u === "throw")
|
|
33885
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
33886
|
+
let d = reader.skip(wireType);
|
|
33887
|
+
if (u !== false)
|
|
33888
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
33889
|
+
}
|
|
33890
|
+
}
|
|
33891
|
+
return message;
|
|
33892
|
+
}
|
|
33893
|
+
internalBinaryWrite(message, writer, options) {
|
|
33894
|
+
for (let i = 0;i < message.options.length; i++)
|
|
33895
|
+
AgentProjectOption.internalBinaryWrite(message.options[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
33896
|
+
if (message.canSelectFolder !== undefined)
|
|
33897
|
+
writer.tag(2, import_runtime.WireType.Varint).bool(message.canSelectFolder);
|
|
33898
|
+
let u = options.writeUnknownFields;
|
|
33899
|
+
if (u !== false)
|
|
33900
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
33901
|
+
return writer;
|
|
33902
|
+
}
|
|
33903
|
+
}
|
|
33904
|
+
var AgentProjectCatalog = new AgentProjectCatalog$Type;
|
|
33905
|
+
|
|
33906
|
+
class AgentReasoningEffortOption$Type extends import_runtime4.MessageType {
|
|
33907
|
+
constructor() {
|
|
33908
|
+
super("AgentReasoningEffortOption", [
|
|
33909
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 },
|
|
33910
|
+
{ no: 2, name: "label", kind: "scalar", T: 9 },
|
|
33911
|
+
{ no: 3, name: "description", kind: "scalar", opt: true, T: 9 }
|
|
33912
|
+
]);
|
|
33913
|
+
}
|
|
33914
|
+
create(value) {
|
|
33915
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
33916
|
+
message.id = "";
|
|
33917
|
+
message.label = "";
|
|
33918
|
+
if (value !== undefined)
|
|
33919
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
33920
|
+
return message;
|
|
33921
|
+
}
|
|
33922
|
+
internalBinaryRead(reader, length, options, target) {
|
|
33923
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
33924
|
+
while (reader.pos < end) {
|
|
33925
|
+
let [fieldNo, wireType] = reader.tag();
|
|
33926
|
+
switch (fieldNo) {
|
|
33927
|
+
case 1:
|
|
33928
|
+
message.id = reader.string();
|
|
33929
|
+
break;
|
|
33930
|
+
case 2:
|
|
33931
|
+
message.label = reader.string();
|
|
32477
33932
|
break;
|
|
32478
33933
|
case 3:
|
|
32479
|
-
message.
|
|
33934
|
+
message.description = reader.string();
|
|
32480
33935
|
break;
|
|
32481
33936
|
default:
|
|
32482
33937
|
let u = options.readUnknownField;
|
|
@@ -32490,29 +33945,29 @@ class PinMessageInput$Type extends import_runtime4.MessageType {
|
|
|
32490
33945
|
return message;
|
|
32491
33946
|
}
|
|
32492
33947
|
internalBinaryWrite(message, writer, options) {
|
|
32493
|
-
if (message.
|
|
32494
|
-
|
|
32495
|
-
if (message.
|
|
32496
|
-
writer.tag(2, import_runtime.WireType.
|
|
32497
|
-
if (message.
|
|
32498
|
-
writer.tag(3, import_runtime.WireType.
|
|
33948
|
+
if (message.id !== "")
|
|
33949
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.id);
|
|
33950
|
+
if (message.label !== "")
|
|
33951
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.label);
|
|
33952
|
+
if (message.description !== undefined)
|
|
33953
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
|
|
32499
33954
|
let u = options.writeUnknownFields;
|
|
32500
33955
|
if (u !== false)
|
|
32501
33956
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32502
33957
|
return writer;
|
|
32503
33958
|
}
|
|
32504
33959
|
}
|
|
32505
|
-
var
|
|
33960
|
+
var AgentReasoningEffortOption = new AgentReasoningEffortOption$Type;
|
|
32506
33961
|
|
|
32507
|
-
class
|
|
33962
|
+
class AgentReasoningCatalog$Type extends import_runtime4.MessageType {
|
|
32508
33963
|
constructor() {
|
|
32509
|
-
super("
|
|
32510
|
-
{ no: 1, name: "
|
|
33964
|
+
super("AgentReasoningCatalog", [
|
|
33965
|
+
{ no: 1, name: "options", kind: "message", repeat: 1, T: () => AgentReasoningEffortOption }
|
|
32511
33966
|
]);
|
|
32512
33967
|
}
|
|
32513
33968
|
create(value) {
|
|
32514
33969
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
32515
|
-
message.
|
|
33970
|
+
message.options = [];
|
|
32516
33971
|
if (value !== undefined)
|
|
32517
33972
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32518
33973
|
return message;
|
|
@@ -32523,7 +33978,7 @@ class PinMessageResult$Type extends import_runtime4.MessageType {
|
|
|
32523
33978
|
let [fieldNo, wireType] = reader.tag();
|
|
32524
33979
|
switch (fieldNo) {
|
|
32525
33980
|
case 1:
|
|
32526
|
-
message.
|
|
33981
|
+
message.options.push(AgentReasoningEffortOption.internalBinaryRead(reader, reader.uint32(), options));
|
|
32527
33982
|
break;
|
|
32528
33983
|
default:
|
|
32529
33984
|
let u = options.readUnknownField;
|
|
@@ -32537,26 +33992,30 @@ class PinMessageResult$Type extends import_runtime4.MessageType {
|
|
|
32537
33992
|
return message;
|
|
32538
33993
|
}
|
|
32539
33994
|
internalBinaryWrite(message, writer, options) {
|
|
32540
|
-
for (let i = 0;i < message.
|
|
32541
|
-
|
|
33995
|
+
for (let i = 0;i < message.options.length; i++)
|
|
33996
|
+
AgentReasoningEffortOption.internalBinaryWrite(message.options[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
32542
33997
|
let u = options.writeUnknownFields;
|
|
32543
33998
|
if (u !== false)
|
|
32544
33999
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32545
34000
|
return writer;
|
|
32546
34001
|
}
|
|
32547
34002
|
}
|
|
32548
|
-
var
|
|
34003
|
+
var AgentReasoningCatalog = new AgentReasoningCatalog$Type;
|
|
32549
34004
|
|
|
32550
|
-
class
|
|
34005
|
+
class AgentModelOption$Type extends import_runtime4.MessageType {
|
|
32551
34006
|
constructor() {
|
|
32552
|
-
super("
|
|
32553
|
-
{ no: 1, name: "
|
|
32554
|
-
{ no: 2, name: "
|
|
34007
|
+
super("AgentModelOption", [
|
|
34008
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 },
|
|
34009
|
+
{ no: 2, name: "label", kind: "scalar", T: 9 },
|
|
34010
|
+
{ no: 3, name: "description", kind: "scalar", opt: true, T: 9 },
|
|
34011
|
+
{ no: 4, name: "reasoning_effort_ids", kind: "scalar", repeat: 2, T: 9 }
|
|
32555
34012
|
]);
|
|
32556
34013
|
}
|
|
32557
34014
|
create(value) {
|
|
32558
34015
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
32559
|
-
message.
|
|
34016
|
+
message.id = "";
|
|
34017
|
+
message.label = "";
|
|
34018
|
+
message.reasoningEffortIds = [];
|
|
32560
34019
|
if (value !== undefined)
|
|
32561
34020
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
32562
34021
|
return message;
|
|
@@ -32567,10 +34026,16 @@ class DraftMessage$Type extends import_runtime4.MessageType {
|
|
|
32567
34026
|
let [fieldNo, wireType] = reader.tag();
|
|
32568
34027
|
switch (fieldNo) {
|
|
32569
34028
|
case 1:
|
|
32570
|
-
message.
|
|
34029
|
+
message.id = reader.string();
|
|
32571
34030
|
break;
|
|
32572
34031
|
case 2:
|
|
32573
|
-
message.
|
|
34032
|
+
message.label = reader.string();
|
|
34033
|
+
break;
|
|
34034
|
+
case 3:
|
|
34035
|
+
message.description = reader.string();
|
|
34036
|
+
break;
|
|
34037
|
+
case 4:
|
|
34038
|
+
message.reasoningEffortIds.push(reader.string());
|
|
32574
34039
|
break;
|
|
32575
34040
|
default:
|
|
32576
34041
|
let u = options.readUnknownField;
|
|
@@ -32584,23 +34049,125 @@ class DraftMessage$Type extends import_runtime4.MessageType {
|
|
|
32584
34049
|
return message;
|
|
32585
34050
|
}
|
|
32586
34051
|
internalBinaryWrite(message, writer, options) {
|
|
32587
|
-
if (message.
|
|
32588
|
-
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.
|
|
32589
|
-
if (message.
|
|
32590
|
-
|
|
34052
|
+
if (message.id !== "")
|
|
34053
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.id);
|
|
34054
|
+
if (message.label !== "")
|
|
34055
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.label);
|
|
34056
|
+
if (message.description !== undefined)
|
|
34057
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
|
|
34058
|
+
for (let i = 0;i < message.reasoningEffortIds.length; i++)
|
|
34059
|
+
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.reasoningEffortIds[i]);
|
|
32591
34060
|
let u = options.writeUnknownFields;
|
|
32592
34061
|
if (u !== false)
|
|
32593
34062
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
32594
34063
|
return writer;
|
|
32595
34064
|
}
|
|
32596
34065
|
}
|
|
32597
|
-
var
|
|
34066
|
+
var AgentModelOption = new AgentModelOption$Type;
|
|
34067
|
+
|
|
34068
|
+
class AgentModelCatalog$Type extends import_runtime4.MessageType {
|
|
34069
|
+
constructor() {
|
|
34070
|
+
super("AgentModelCatalog", [
|
|
34071
|
+
{ no: 1, name: "options", kind: "message", repeat: 1, T: () => AgentModelOption }
|
|
34072
|
+
]);
|
|
34073
|
+
}
|
|
34074
|
+
create(value) {
|
|
34075
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
34076
|
+
message.options = [];
|
|
34077
|
+
if (value !== undefined)
|
|
34078
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
34079
|
+
return message;
|
|
34080
|
+
}
|
|
34081
|
+
internalBinaryRead(reader, length, options, target) {
|
|
34082
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
34083
|
+
while (reader.pos < end) {
|
|
34084
|
+
let [fieldNo, wireType] = reader.tag();
|
|
34085
|
+
switch (fieldNo) {
|
|
34086
|
+
case 1:
|
|
34087
|
+
message.options.push(AgentModelOption.internalBinaryRead(reader, reader.uint32(), options));
|
|
34088
|
+
break;
|
|
34089
|
+
default:
|
|
34090
|
+
let u = options.readUnknownField;
|
|
34091
|
+
if (u === "throw")
|
|
34092
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
34093
|
+
let d = reader.skip(wireType);
|
|
34094
|
+
if (u !== false)
|
|
34095
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
34096
|
+
}
|
|
34097
|
+
}
|
|
34098
|
+
return message;
|
|
34099
|
+
}
|
|
34100
|
+
internalBinaryWrite(message, writer, options) {
|
|
34101
|
+
for (let i = 0;i < message.options.length; i++)
|
|
34102
|
+
AgentModelOption.internalBinaryWrite(message.options[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
34103
|
+
let u = options.writeUnknownFields;
|
|
34104
|
+
if (u !== false)
|
|
34105
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
34106
|
+
return writer;
|
|
34107
|
+
}
|
|
34108
|
+
}
|
|
34109
|
+
var AgentModelCatalog = new AgentModelCatalog$Type;
|
|
34110
|
+
|
|
34111
|
+
class AgentConfigurationCatalog$Type extends import_runtime4.MessageType {
|
|
34112
|
+
constructor() {
|
|
34113
|
+
super("AgentConfigurationCatalog", [
|
|
34114
|
+
{ no: 1, name: "projects", kind: "message", T: () => AgentProjectCatalog },
|
|
34115
|
+
{ no: 2, name: "models", kind: "message", T: () => AgentModelCatalog },
|
|
34116
|
+
{ no: 3, name: "reasoning", kind: "message", T: () => AgentReasoningCatalog }
|
|
34117
|
+
]);
|
|
34118
|
+
}
|
|
34119
|
+
create(value) {
|
|
34120
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
34121
|
+
if (value !== undefined)
|
|
34122
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
34123
|
+
return message;
|
|
34124
|
+
}
|
|
34125
|
+
internalBinaryRead(reader, length, options, target) {
|
|
34126
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
34127
|
+
while (reader.pos < end) {
|
|
34128
|
+
let [fieldNo, wireType] = reader.tag();
|
|
34129
|
+
switch (fieldNo) {
|
|
34130
|
+
case 1:
|
|
34131
|
+
message.projects = AgentProjectCatalog.internalBinaryRead(reader, reader.uint32(), options, message.projects);
|
|
34132
|
+
break;
|
|
34133
|
+
case 2:
|
|
34134
|
+
message.models = AgentModelCatalog.internalBinaryRead(reader, reader.uint32(), options, message.models);
|
|
34135
|
+
break;
|
|
34136
|
+
case 3:
|
|
34137
|
+
message.reasoning = AgentReasoningCatalog.internalBinaryRead(reader, reader.uint32(), options, message.reasoning);
|
|
34138
|
+
break;
|
|
34139
|
+
default:
|
|
34140
|
+
let u = options.readUnknownField;
|
|
34141
|
+
if (u === "throw")
|
|
34142
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
34143
|
+
let d = reader.skip(wireType);
|
|
34144
|
+
if (u !== false)
|
|
34145
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
34146
|
+
}
|
|
34147
|
+
}
|
|
34148
|
+
return message;
|
|
34149
|
+
}
|
|
34150
|
+
internalBinaryWrite(message, writer, options) {
|
|
34151
|
+
if (message.projects)
|
|
34152
|
+
AgentProjectCatalog.internalBinaryWrite(message.projects, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
34153
|
+
if (message.models)
|
|
34154
|
+
AgentModelCatalog.internalBinaryWrite(message.models, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
34155
|
+
if (message.reasoning)
|
|
34156
|
+
AgentReasoningCatalog.internalBinaryWrite(message.reasoning, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
34157
|
+
let u = options.writeUnknownFields;
|
|
34158
|
+
if (u !== false)
|
|
34159
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
34160
|
+
return writer;
|
|
34161
|
+
}
|
|
34162
|
+
}
|
|
34163
|
+
var AgentConfigurationCatalog = new AgentConfigurationCatalog$Type;
|
|
32598
34164
|
|
|
32599
34165
|
class BotCapability$Type extends import_runtime4.MessageType {
|
|
32600
34166
|
constructor() {
|
|
32601
34167
|
super("BotCapability", [
|
|
32602
34168
|
{ no: 1, name: "kind", kind: "enum", T: () => ["BotCapability.Kind", BotCapability_Kind] },
|
|
32603
|
-
{ no: 2, name: "version", kind: "scalar", T: 13 }
|
|
34169
|
+
{ no: 2, name: "version", kind: "scalar", T: 13 },
|
|
34170
|
+
{ no: 3, name: "agent_configuration", kind: "message", T: () => AgentConfigurationCatalog }
|
|
32604
34171
|
]);
|
|
32605
34172
|
}
|
|
32606
34173
|
create(value) {
|
|
@@ -32622,6 +34189,9 @@ class BotCapability$Type extends import_runtime4.MessageType {
|
|
|
32622
34189
|
case 2:
|
|
32623
34190
|
message.version = reader.uint32();
|
|
32624
34191
|
break;
|
|
34192
|
+
case 3:
|
|
34193
|
+
message.agentConfiguration = AgentConfigurationCatalog.internalBinaryRead(reader, reader.uint32(), options, message.agentConfiguration);
|
|
34194
|
+
break;
|
|
32625
34195
|
default:
|
|
32626
34196
|
let u = options.readUnknownField;
|
|
32627
34197
|
if (u === "throw")
|
|
@@ -32638,6 +34208,8 @@ class BotCapability$Type extends import_runtime4.MessageType {
|
|
|
32638
34208
|
writer.tag(1, import_runtime.WireType.Varint).int32(message.kind);
|
|
32639
34209
|
if (message.version !== 0)
|
|
32640
34210
|
writer.tag(2, import_runtime.WireType.Varint).uint32(message.version);
|
|
34211
|
+
if (message.agentConfiguration)
|
|
34212
|
+
AgentConfigurationCatalog.internalBinaryWrite(message.agentConfiguration, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
32641
34213
|
let u = options.writeUnknownFields;
|
|
32642
34214
|
if (u !== false)
|
|
32643
34215
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -36053,17 +37625,229 @@ class FinishUploadInput$Type extends import_runtime4.MessageType {
|
|
|
36053
37625
|
return writer;
|
|
36054
37626
|
}
|
|
36055
37627
|
}
|
|
36056
|
-
var FinishUploadInput = new FinishUploadInput$Type;
|
|
37628
|
+
var FinishUploadInput = new FinishUploadInput$Type;
|
|
37629
|
+
|
|
37630
|
+
class UploadMissingParts$Type extends import_runtime4.MessageType {
|
|
37631
|
+
constructor() {
|
|
37632
|
+
super("UploadMissingParts", [
|
|
37633
|
+
{ no: 1, name: "part_indices", kind: "scalar", repeat: 1, T: 13 }
|
|
37634
|
+
]);
|
|
37635
|
+
}
|
|
37636
|
+
create(value) {
|
|
37637
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
37638
|
+
message.partIndices = [];
|
|
37639
|
+
if (value !== undefined)
|
|
37640
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
37641
|
+
return message;
|
|
37642
|
+
}
|
|
37643
|
+
internalBinaryRead(reader, length, options, target) {
|
|
37644
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
37645
|
+
while (reader.pos < end) {
|
|
37646
|
+
let [fieldNo, wireType] = reader.tag();
|
|
37647
|
+
switch (fieldNo) {
|
|
37648
|
+
case 1:
|
|
37649
|
+
if (wireType === import_runtime.WireType.LengthDelimited)
|
|
37650
|
+
for (let e = reader.int32() + reader.pos;reader.pos < e; )
|
|
37651
|
+
message.partIndices.push(reader.uint32());
|
|
37652
|
+
else
|
|
37653
|
+
message.partIndices.push(reader.uint32());
|
|
37654
|
+
break;
|
|
37655
|
+
default:
|
|
37656
|
+
let u = options.readUnknownField;
|
|
37657
|
+
if (u === "throw")
|
|
37658
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
37659
|
+
let d = reader.skip(wireType);
|
|
37660
|
+
if (u !== false)
|
|
37661
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
37662
|
+
}
|
|
37663
|
+
}
|
|
37664
|
+
return message;
|
|
37665
|
+
}
|
|
37666
|
+
internalBinaryWrite(message, writer, options) {
|
|
37667
|
+
if (message.partIndices.length) {
|
|
37668
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).fork();
|
|
37669
|
+
for (let i = 0;i < message.partIndices.length; i++)
|
|
37670
|
+
writer.uint32(message.partIndices[i]);
|
|
37671
|
+
writer.join();
|
|
37672
|
+
}
|
|
37673
|
+
let u = options.writeUnknownFields;
|
|
37674
|
+
if (u !== false)
|
|
37675
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
37676
|
+
return writer;
|
|
37677
|
+
}
|
|
37678
|
+
}
|
|
37679
|
+
var UploadMissingParts = new UploadMissingParts$Type;
|
|
37680
|
+
|
|
37681
|
+
class UploadProcessing$Type extends import_runtime4.MessageType {
|
|
37682
|
+
constructor() {
|
|
37683
|
+
super("UploadProcessing", [
|
|
37684
|
+
{ no: 1, name: "retry_after_seconds", kind: "scalar", T: 13 }
|
|
37685
|
+
]);
|
|
37686
|
+
}
|
|
37687
|
+
create(value) {
|
|
37688
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
37689
|
+
message.retryAfterSeconds = 0;
|
|
37690
|
+
if (value !== undefined)
|
|
37691
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
37692
|
+
return message;
|
|
37693
|
+
}
|
|
37694
|
+
internalBinaryRead(reader, length, options, target) {
|
|
37695
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
37696
|
+
while (reader.pos < end) {
|
|
37697
|
+
let [fieldNo, wireType] = reader.tag();
|
|
37698
|
+
switch (fieldNo) {
|
|
37699
|
+
case 1:
|
|
37700
|
+
message.retryAfterSeconds = reader.uint32();
|
|
37701
|
+
break;
|
|
37702
|
+
default:
|
|
37703
|
+
let u = options.readUnknownField;
|
|
37704
|
+
if (u === "throw")
|
|
37705
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
37706
|
+
let d = reader.skip(wireType);
|
|
37707
|
+
if (u !== false)
|
|
37708
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
37709
|
+
}
|
|
37710
|
+
}
|
|
37711
|
+
return message;
|
|
37712
|
+
}
|
|
37713
|
+
internalBinaryWrite(message, writer, options) {
|
|
37714
|
+
if (message.retryAfterSeconds !== 0)
|
|
37715
|
+
writer.tag(1, import_runtime.WireType.Varint).uint32(message.retryAfterSeconds);
|
|
37716
|
+
let u = options.writeUnknownFields;
|
|
37717
|
+
if (u !== false)
|
|
37718
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
37719
|
+
return writer;
|
|
37720
|
+
}
|
|
37721
|
+
}
|
|
37722
|
+
var UploadProcessing = new UploadProcessing$Type;
|
|
37723
|
+
|
|
37724
|
+
class FinishUploadResult$Type extends import_runtime4.MessageType {
|
|
37725
|
+
constructor() {
|
|
37726
|
+
super("FinishUploadResult", [
|
|
37727
|
+
{ no: 1, name: "missing", kind: "message", oneof: "state", T: () => UploadMissingParts },
|
|
37728
|
+
{ no: 2, name: "processing", kind: "message", oneof: "state", T: () => UploadProcessing },
|
|
37729
|
+
{ no: 3, name: "complete", kind: "message", oneof: "state", T: () => UploadComplete },
|
|
37730
|
+
{ no: 4, name: "failed", kind: "message", oneof: "state", T: () => UploadFailure }
|
|
37731
|
+
]);
|
|
37732
|
+
}
|
|
37733
|
+
create(value) {
|
|
37734
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
37735
|
+
message.state = { oneofKind: undefined };
|
|
37736
|
+
if (value !== undefined)
|
|
37737
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
37738
|
+
return message;
|
|
37739
|
+
}
|
|
37740
|
+
internalBinaryRead(reader, length, options, target) {
|
|
37741
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
37742
|
+
while (reader.pos < end) {
|
|
37743
|
+
let [fieldNo, wireType] = reader.tag();
|
|
37744
|
+
switch (fieldNo) {
|
|
37745
|
+
case 1:
|
|
37746
|
+
message.state = {
|
|
37747
|
+
oneofKind: "missing",
|
|
37748
|
+
missing: UploadMissingParts.internalBinaryRead(reader, reader.uint32(), options, message.state.missing)
|
|
37749
|
+
};
|
|
37750
|
+
break;
|
|
37751
|
+
case 2:
|
|
37752
|
+
message.state = {
|
|
37753
|
+
oneofKind: "processing",
|
|
37754
|
+
processing: UploadProcessing.internalBinaryRead(reader, reader.uint32(), options, message.state.processing)
|
|
37755
|
+
};
|
|
37756
|
+
break;
|
|
37757
|
+
case 3:
|
|
37758
|
+
message.state = {
|
|
37759
|
+
oneofKind: "complete",
|
|
37760
|
+
complete: UploadComplete.internalBinaryRead(reader, reader.uint32(), options, message.state.complete)
|
|
37761
|
+
};
|
|
37762
|
+
break;
|
|
37763
|
+
case 4:
|
|
37764
|
+
message.state = {
|
|
37765
|
+
oneofKind: "failed",
|
|
37766
|
+
failed: UploadFailure.internalBinaryRead(reader, reader.uint32(), options, message.state.failed)
|
|
37767
|
+
};
|
|
37768
|
+
break;
|
|
37769
|
+
default:
|
|
37770
|
+
let u = options.readUnknownField;
|
|
37771
|
+
if (u === "throw")
|
|
37772
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
37773
|
+
let d = reader.skip(wireType);
|
|
37774
|
+
if (u !== false)
|
|
37775
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
37776
|
+
}
|
|
37777
|
+
}
|
|
37778
|
+
return message;
|
|
37779
|
+
}
|
|
37780
|
+
internalBinaryWrite(message, writer, options) {
|
|
37781
|
+
if (message.state.oneofKind === "missing")
|
|
37782
|
+
UploadMissingParts.internalBinaryWrite(message.state.missing, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
37783
|
+
if (message.state.oneofKind === "processing")
|
|
37784
|
+
UploadProcessing.internalBinaryWrite(message.state.processing, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
37785
|
+
if (message.state.oneofKind === "complete")
|
|
37786
|
+
UploadComplete.internalBinaryWrite(message.state.complete, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
37787
|
+
if (message.state.oneofKind === "failed")
|
|
37788
|
+
UploadFailure.internalBinaryWrite(message.state.failed, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
37789
|
+
let u = options.writeUnknownFields;
|
|
37790
|
+
if (u !== false)
|
|
37791
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
37792
|
+
return writer;
|
|
37793
|
+
}
|
|
37794
|
+
}
|
|
37795
|
+
var FinishUploadResult = new FinishUploadResult$Type;
|
|
37796
|
+
|
|
37797
|
+
class CancelUploadInput$Type extends import_runtime4.MessageType {
|
|
37798
|
+
constructor() {
|
|
37799
|
+
super("CancelUploadInput", [
|
|
37800
|
+
{ no: 1, name: "upload_id", kind: "scalar", T: 12 }
|
|
37801
|
+
]);
|
|
37802
|
+
}
|
|
37803
|
+
create(value) {
|
|
37804
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
37805
|
+
message.uploadId = new Uint8Array(0);
|
|
37806
|
+
if (value !== undefined)
|
|
37807
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
37808
|
+
return message;
|
|
37809
|
+
}
|
|
37810
|
+
internalBinaryRead(reader, length, options, target) {
|
|
37811
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
37812
|
+
while (reader.pos < end) {
|
|
37813
|
+
let [fieldNo, wireType] = reader.tag();
|
|
37814
|
+
switch (fieldNo) {
|
|
37815
|
+
case 1:
|
|
37816
|
+
message.uploadId = reader.bytes();
|
|
37817
|
+
break;
|
|
37818
|
+
default:
|
|
37819
|
+
let u = options.readUnknownField;
|
|
37820
|
+
if (u === "throw")
|
|
37821
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
37822
|
+
let d = reader.skip(wireType);
|
|
37823
|
+
if (u !== false)
|
|
37824
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
37825
|
+
}
|
|
37826
|
+
}
|
|
37827
|
+
return message;
|
|
37828
|
+
}
|
|
37829
|
+
internalBinaryWrite(message, writer, options) {
|
|
37830
|
+
if (message.uploadId.length)
|
|
37831
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).bytes(message.uploadId);
|
|
37832
|
+
let u = options.writeUnknownFields;
|
|
37833
|
+
if (u !== false)
|
|
37834
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
37835
|
+
return writer;
|
|
37836
|
+
}
|
|
37837
|
+
}
|
|
37838
|
+
var CancelUploadInput = new CancelUploadInput$Type;
|
|
36057
37839
|
|
|
36058
|
-
class
|
|
37840
|
+
class CancelUploadResult$Type extends import_runtime4.MessageType {
|
|
36059
37841
|
constructor() {
|
|
36060
|
-
super("
|
|
36061
|
-
{ no: 1, name: "
|
|
37842
|
+
super("CancelUploadResult", [
|
|
37843
|
+
{ no: 1, name: "canceled", kind: "scalar", T: 8 },
|
|
37844
|
+
{ no: 2, name: "already_terminal", kind: "scalar", T: 8 }
|
|
36062
37845
|
]);
|
|
36063
37846
|
}
|
|
36064
37847
|
create(value) {
|
|
36065
37848
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
36066
|
-
message.
|
|
37849
|
+
message.canceled = false;
|
|
37850
|
+
message.alreadyTerminal = false;
|
|
36067
37851
|
if (value !== undefined)
|
|
36068
37852
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
36069
37853
|
return message;
|
|
@@ -36074,11 +37858,10 @@ class UploadMissingParts$Type extends import_runtime4.MessageType {
|
|
|
36074
37858
|
let [fieldNo, wireType] = reader.tag();
|
|
36075
37859
|
switch (fieldNo) {
|
|
36076
37860
|
case 1:
|
|
36077
|
-
|
|
36078
|
-
|
|
36079
|
-
|
|
36080
|
-
|
|
36081
|
-
message.partIndices.push(reader.uint32());
|
|
37861
|
+
message.canceled = reader.bool();
|
|
37862
|
+
break;
|
|
37863
|
+
case 2:
|
|
37864
|
+
message.alreadyTerminal = reader.bool();
|
|
36082
37865
|
break;
|
|
36083
37866
|
default:
|
|
36084
37867
|
let u = options.readUnknownField;
|
|
@@ -36092,29 +37875,82 @@ class UploadMissingParts$Type extends import_runtime4.MessageType {
|
|
|
36092
37875
|
return message;
|
|
36093
37876
|
}
|
|
36094
37877
|
internalBinaryWrite(message, writer, options) {
|
|
36095
|
-
if (message.
|
|
36096
|
-
writer.tag(1, import_runtime.WireType.
|
|
36097
|
-
|
|
36098
|
-
|
|
36099
|
-
|
|
37878
|
+
if (message.canceled !== false)
|
|
37879
|
+
writer.tag(1, import_runtime.WireType.Varint).bool(message.canceled);
|
|
37880
|
+
if (message.alreadyTerminal !== false)
|
|
37881
|
+
writer.tag(2, import_runtime.WireType.Varint).bool(message.alreadyTerminal);
|
|
37882
|
+
let u = options.writeUnknownFields;
|
|
37883
|
+
if (u !== false)
|
|
37884
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
37885
|
+
return writer;
|
|
37886
|
+
}
|
|
37887
|
+
}
|
|
37888
|
+
var CancelUploadResult = new CancelUploadResult$Type;
|
|
37889
|
+
|
|
37890
|
+
class FileMessageLocation$Type extends import_runtime4.MessageType {
|
|
37891
|
+
constructor() {
|
|
37892
|
+
super("FileMessageLocation", [
|
|
37893
|
+
{ no: 1, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
37894
|
+
{ no: 2, name: "message_id", kind: "scalar", T: 3, L: 0 }
|
|
37895
|
+
]);
|
|
37896
|
+
}
|
|
37897
|
+
create(value) {
|
|
37898
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
37899
|
+
message.chatId = 0n;
|
|
37900
|
+
message.messageId = 0n;
|
|
37901
|
+
if (value !== undefined)
|
|
37902
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
37903
|
+
return message;
|
|
37904
|
+
}
|
|
37905
|
+
internalBinaryRead(reader, length, options, target) {
|
|
37906
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
37907
|
+
while (reader.pos < end) {
|
|
37908
|
+
let [fieldNo, wireType] = reader.tag();
|
|
37909
|
+
switch (fieldNo) {
|
|
37910
|
+
case 1:
|
|
37911
|
+
message.chatId = reader.int64().toBigInt();
|
|
37912
|
+
break;
|
|
37913
|
+
case 2:
|
|
37914
|
+
message.messageId = reader.int64().toBigInt();
|
|
37915
|
+
break;
|
|
37916
|
+
default:
|
|
37917
|
+
let u = options.readUnknownField;
|
|
37918
|
+
if (u === "throw")
|
|
37919
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
37920
|
+
let d = reader.skip(wireType);
|
|
37921
|
+
if (u !== false)
|
|
37922
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
37923
|
+
}
|
|
36100
37924
|
}
|
|
37925
|
+
return message;
|
|
37926
|
+
}
|
|
37927
|
+
internalBinaryWrite(message, writer, options) {
|
|
37928
|
+
if (message.chatId !== 0n)
|
|
37929
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.chatId);
|
|
37930
|
+
if (message.messageId !== 0n)
|
|
37931
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.messageId);
|
|
36101
37932
|
let u = options.writeUnknownFields;
|
|
36102
37933
|
if (u !== false)
|
|
36103
37934
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
36104
37935
|
return writer;
|
|
36105
37936
|
}
|
|
36106
37937
|
}
|
|
36107
|
-
var
|
|
37938
|
+
var FileMessageLocation = new FileMessageLocation$Type;
|
|
36108
37939
|
|
|
36109
|
-
class
|
|
37940
|
+
class GetFilePartInput$Type extends import_runtime4.MessageType {
|
|
36110
37941
|
constructor() {
|
|
36111
|
-
super("
|
|
36112
|
-
{ no: 1, name: "
|
|
37942
|
+
super("GetFilePartInput", [
|
|
37943
|
+
{ no: 1, name: "file_unique_id", kind: "scalar", T: 9 },
|
|
37944
|
+
{ no: 2, name: "offset", kind: "scalar", T: 4, L: 0 },
|
|
37945
|
+
{ no: 3, name: "limit", kind: "scalar", T: 13 },
|
|
37946
|
+
{ no: 4, name: "message", kind: "message", T: () => FileMessageLocation }
|
|
36113
37947
|
]);
|
|
36114
37948
|
}
|
|
36115
37949
|
create(value) {
|
|
36116
37950
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
36117
|
-
message.
|
|
37951
|
+
message.fileUniqueId = "";
|
|
37952
|
+
message.offset = 0n;
|
|
37953
|
+
message.limit = 0;
|
|
36118
37954
|
if (value !== undefined)
|
|
36119
37955
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
36120
37956
|
return message;
|
|
@@ -36125,7 +37961,16 @@ class UploadProcessing$Type extends import_runtime4.MessageType {
|
|
|
36125
37961
|
let [fieldNo, wireType] = reader.tag();
|
|
36126
37962
|
switch (fieldNo) {
|
|
36127
37963
|
case 1:
|
|
36128
|
-
message.
|
|
37964
|
+
message.fileUniqueId = reader.string();
|
|
37965
|
+
break;
|
|
37966
|
+
case 2:
|
|
37967
|
+
message.offset = reader.uint64().toBigInt();
|
|
37968
|
+
break;
|
|
37969
|
+
case 3:
|
|
37970
|
+
message.limit = reader.uint32();
|
|
37971
|
+
break;
|
|
37972
|
+
case 4:
|
|
37973
|
+
message.message = FileMessageLocation.internalBinaryRead(reader, reader.uint32(), options, message.message);
|
|
36129
37974
|
break;
|
|
36130
37975
|
default:
|
|
36131
37976
|
let u = options.readUnknownField;
|
|
@@ -36139,28 +37984,37 @@ class UploadProcessing$Type extends import_runtime4.MessageType {
|
|
|
36139
37984
|
return message;
|
|
36140
37985
|
}
|
|
36141
37986
|
internalBinaryWrite(message, writer, options) {
|
|
36142
|
-
if (message.
|
|
36143
|
-
writer.tag(1, import_runtime.WireType.
|
|
37987
|
+
if (message.fileUniqueId !== "")
|
|
37988
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
|
|
37989
|
+
if (message.offset !== 0n)
|
|
37990
|
+
writer.tag(2, import_runtime.WireType.Varint).uint64(message.offset);
|
|
37991
|
+
if (message.limit !== 0)
|
|
37992
|
+
writer.tag(3, import_runtime.WireType.Varint).uint32(message.limit);
|
|
37993
|
+
if (message.message)
|
|
37994
|
+
FileMessageLocation.internalBinaryWrite(message.message, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
36144
37995
|
let u = options.writeUnknownFields;
|
|
36145
37996
|
if (u !== false)
|
|
36146
37997
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
36147
37998
|
return writer;
|
|
36148
37999
|
}
|
|
36149
38000
|
}
|
|
36150
|
-
var
|
|
38001
|
+
var GetFilePartInput = new GetFilePartInput$Type;
|
|
36151
38002
|
|
|
36152
|
-
class
|
|
38003
|
+
class GetFilePartResult$Type extends import_runtime4.MessageType {
|
|
36153
38004
|
constructor() {
|
|
36154
|
-
super("
|
|
36155
|
-
{ no: 1, name: "
|
|
36156
|
-
{ no: 2, name: "
|
|
36157
|
-
{ no: 3, name: "
|
|
36158
|
-
{ no: 4, name: "
|
|
38005
|
+
super("GetFilePartResult", [
|
|
38006
|
+
{ no: 1, name: "offset", kind: "scalar", T: 4, L: 0 },
|
|
38007
|
+
{ no: 2, name: "total_size", kind: "scalar", T: 4, L: 0 },
|
|
38008
|
+
{ no: 3, name: "data", kind: "scalar", T: 12 },
|
|
38009
|
+
{ no: 4, name: "sha256", kind: "scalar", T: 12 }
|
|
36159
38010
|
]);
|
|
36160
38011
|
}
|
|
36161
38012
|
create(value) {
|
|
36162
38013
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
36163
|
-
message.
|
|
38014
|
+
message.offset = 0n;
|
|
38015
|
+
message.totalSize = 0n;
|
|
38016
|
+
message.data = new Uint8Array(0);
|
|
38017
|
+
message.sha256 = new Uint8Array(0);
|
|
36164
38018
|
if (value !== undefined)
|
|
36165
38019
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
36166
38020
|
return message;
|
|
@@ -36171,28 +38025,16 @@ class FinishUploadResult$Type extends import_runtime4.MessageType {
|
|
|
36171
38025
|
let [fieldNo, wireType] = reader.tag();
|
|
36172
38026
|
switch (fieldNo) {
|
|
36173
38027
|
case 1:
|
|
36174
|
-
message.
|
|
36175
|
-
oneofKind: "missing",
|
|
36176
|
-
missing: UploadMissingParts.internalBinaryRead(reader, reader.uint32(), options, message.state.missing)
|
|
36177
|
-
};
|
|
38028
|
+
message.offset = reader.uint64().toBigInt();
|
|
36178
38029
|
break;
|
|
36179
38030
|
case 2:
|
|
36180
|
-
message.
|
|
36181
|
-
oneofKind: "processing",
|
|
36182
|
-
processing: UploadProcessing.internalBinaryRead(reader, reader.uint32(), options, message.state.processing)
|
|
36183
|
-
};
|
|
38031
|
+
message.totalSize = reader.uint64().toBigInt();
|
|
36184
38032
|
break;
|
|
36185
38033
|
case 3:
|
|
36186
|
-
message.
|
|
36187
|
-
oneofKind: "complete",
|
|
36188
|
-
complete: UploadComplete.internalBinaryRead(reader, reader.uint32(), options, message.state.complete)
|
|
36189
|
-
};
|
|
38034
|
+
message.data = reader.bytes();
|
|
36190
38035
|
break;
|
|
36191
38036
|
case 4:
|
|
36192
|
-
message.
|
|
36193
|
-
oneofKind: "failed",
|
|
36194
|
-
failed: UploadFailure.internalBinaryRead(reader, reader.uint32(), options, message.state.failed)
|
|
36195
|
-
};
|
|
38037
|
+
message.sha256 = reader.bytes();
|
|
36196
38038
|
break;
|
|
36197
38039
|
default:
|
|
36198
38040
|
let u = options.readUnknownField;
|
|
@@ -36206,31 +38048,41 @@ class FinishUploadResult$Type extends import_runtime4.MessageType {
|
|
|
36206
38048
|
return message;
|
|
36207
38049
|
}
|
|
36208
38050
|
internalBinaryWrite(message, writer, options) {
|
|
36209
|
-
if (message.
|
|
36210
|
-
|
|
36211
|
-
if (message.
|
|
36212
|
-
|
|
36213
|
-
if (message.
|
|
36214
|
-
|
|
36215
|
-
if (message.
|
|
36216
|
-
|
|
38051
|
+
if (message.offset !== 0n)
|
|
38052
|
+
writer.tag(1, import_runtime.WireType.Varint).uint64(message.offset);
|
|
38053
|
+
if (message.totalSize !== 0n)
|
|
38054
|
+
writer.tag(2, import_runtime.WireType.Varint).uint64(message.totalSize);
|
|
38055
|
+
if (message.data.length)
|
|
38056
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).bytes(message.data);
|
|
38057
|
+
if (message.sha256.length)
|
|
38058
|
+
writer.tag(4, import_runtime.WireType.LengthDelimited).bytes(message.sha256);
|
|
36217
38059
|
let u = options.writeUnknownFields;
|
|
36218
38060
|
if (u !== false)
|
|
36219
38061
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
36220
38062
|
return writer;
|
|
36221
38063
|
}
|
|
36222
38064
|
}
|
|
36223
|
-
var
|
|
38065
|
+
var GetFilePartResult = new GetFilePartResult$Type;
|
|
36224
38066
|
|
|
36225
|
-
class
|
|
38067
|
+
class ChatAcknowledgement$Type extends import_runtime4.MessageType {
|
|
36226
38068
|
constructor() {
|
|
36227
|
-
super("
|
|
36228
|
-
{ no: 1, name: "
|
|
38069
|
+
super("ChatAcknowledgement", [
|
|
38070
|
+
{ no: 1, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
38071
|
+
{ no: 2, name: "user_id", kind: "scalar", T: 3, L: 0 },
|
|
38072
|
+
{ no: 3, name: "max_id", kind: "scalar", T: 3, L: 0 },
|
|
38073
|
+
{ no: 4, name: "user", kind: "message", T: () => User },
|
|
38074
|
+
{ no: 5, name: "peer_id", kind: "message", T: () => Peer },
|
|
38075
|
+
{ no: 6, name: "revision", kind: "scalar", T: 3, L: 0 },
|
|
38076
|
+
{ no: 7, name: "cleared", kind: "scalar", T: 8 }
|
|
36229
38077
|
]);
|
|
36230
38078
|
}
|
|
36231
38079
|
create(value) {
|
|
36232
38080
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
36233
|
-
message.
|
|
38081
|
+
message.chatId = 0n;
|
|
38082
|
+
message.userId = 0n;
|
|
38083
|
+
message.maxId = 0n;
|
|
38084
|
+
message.revision = 0n;
|
|
38085
|
+
message.cleared = false;
|
|
36234
38086
|
if (value !== undefined)
|
|
36235
38087
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
36236
38088
|
return message;
|
|
@@ -36241,7 +38093,25 @@ class CancelUploadInput$Type extends import_runtime4.MessageType {
|
|
|
36241
38093
|
let [fieldNo, wireType] = reader.tag();
|
|
36242
38094
|
switch (fieldNo) {
|
|
36243
38095
|
case 1:
|
|
36244
|
-
message.
|
|
38096
|
+
message.chatId = reader.int64().toBigInt();
|
|
38097
|
+
break;
|
|
38098
|
+
case 2:
|
|
38099
|
+
message.userId = reader.int64().toBigInt();
|
|
38100
|
+
break;
|
|
38101
|
+
case 3:
|
|
38102
|
+
message.maxId = reader.int64().toBigInt();
|
|
38103
|
+
break;
|
|
38104
|
+
case 4:
|
|
38105
|
+
message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
|
|
38106
|
+
break;
|
|
38107
|
+
case 5:
|
|
38108
|
+
message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
38109
|
+
break;
|
|
38110
|
+
case 6:
|
|
38111
|
+
message.revision = reader.int64().toBigInt();
|
|
38112
|
+
break;
|
|
38113
|
+
case 7:
|
|
38114
|
+
message.cleared = reader.bool();
|
|
36245
38115
|
break;
|
|
36246
38116
|
default:
|
|
36247
38117
|
let u = options.readUnknownField;
|
|
@@ -36255,27 +38125,42 @@ class CancelUploadInput$Type extends import_runtime4.MessageType {
|
|
|
36255
38125
|
return message;
|
|
36256
38126
|
}
|
|
36257
38127
|
internalBinaryWrite(message, writer, options) {
|
|
36258
|
-
if (message.
|
|
36259
|
-
writer.tag(1, import_runtime.WireType.
|
|
38128
|
+
if (message.chatId !== 0n)
|
|
38129
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.chatId);
|
|
38130
|
+
if (message.userId !== 0n)
|
|
38131
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.userId);
|
|
38132
|
+
if (message.maxId !== 0n)
|
|
38133
|
+
writer.tag(3, import_runtime.WireType.Varint).int64(message.maxId);
|
|
38134
|
+
if (message.user)
|
|
38135
|
+
User.internalBinaryWrite(message.user, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38136
|
+
if (message.peerId)
|
|
38137
|
+
Peer.internalBinaryWrite(message.peerId, writer.tag(5, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38138
|
+
if (message.revision !== 0n)
|
|
38139
|
+
writer.tag(6, import_runtime.WireType.Varint).int64(message.revision);
|
|
38140
|
+
if (message.cleared !== false)
|
|
38141
|
+
writer.tag(7, import_runtime.WireType.Varint).bool(message.cleared);
|
|
36260
38142
|
let u = options.writeUnknownFields;
|
|
36261
38143
|
if (u !== false)
|
|
36262
38144
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
36263
38145
|
return writer;
|
|
36264
38146
|
}
|
|
36265
38147
|
}
|
|
36266
|
-
var
|
|
38148
|
+
var ChatAcknowledgement = new ChatAcknowledgement$Type;
|
|
36267
38149
|
|
|
36268
|
-
class
|
|
38150
|
+
class AcknowledgeMessagesInput$Type extends import_runtime4.MessageType {
|
|
36269
38151
|
constructor() {
|
|
36270
|
-
super("
|
|
36271
|
-
{ no: 1, name: "
|
|
36272
|
-
{ no: 2, name: "
|
|
38152
|
+
super("AcknowledgeMessagesInput", [
|
|
38153
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
38154
|
+
{ no: 2, name: "max_id", kind: "scalar", T: 3, L: 0 },
|
|
38155
|
+
{ no: 3, name: "clear", kind: "scalar", T: 8 },
|
|
38156
|
+
{ no: 4, name: "expected_revision", kind: "scalar", T: 3, L: 0 }
|
|
36273
38157
|
]);
|
|
36274
38158
|
}
|
|
36275
38159
|
create(value) {
|
|
36276
38160
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
36277
|
-
message.
|
|
36278
|
-
message.
|
|
38161
|
+
message.maxId = 0n;
|
|
38162
|
+
message.clear = false;
|
|
38163
|
+
message.expectedRevision = 0n;
|
|
36279
38164
|
if (value !== undefined)
|
|
36280
38165
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
36281
38166
|
return message;
|
|
@@ -36286,10 +38171,16 @@ class CancelUploadResult$Type extends import_runtime4.MessageType {
|
|
|
36286
38171
|
let [fieldNo, wireType] = reader.tag();
|
|
36287
38172
|
switch (fieldNo) {
|
|
36288
38173
|
case 1:
|
|
36289
|
-
message.
|
|
38174
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
36290
38175
|
break;
|
|
36291
38176
|
case 2:
|
|
36292
|
-
message.
|
|
38177
|
+
message.maxId = reader.int64().toBigInt();
|
|
38178
|
+
break;
|
|
38179
|
+
case 3:
|
|
38180
|
+
message.clear = reader.bool();
|
|
38181
|
+
break;
|
|
38182
|
+
case 4:
|
|
38183
|
+
message.expectedRevision = reader.int64().toBigInt();
|
|
36293
38184
|
break;
|
|
36294
38185
|
default:
|
|
36295
38186
|
let u = options.readUnknownField;
|
|
@@ -36303,17 +38194,107 @@ class CancelUploadResult$Type extends import_runtime4.MessageType {
|
|
|
36303
38194
|
return message;
|
|
36304
38195
|
}
|
|
36305
38196
|
internalBinaryWrite(message, writer, options) {
|
|
36306
|
-
if (message.
|
|
36307
|
-
writer.tag(1, import_runtime.WireType.
|
|
36308
|
-
if (message.
|
|
36309
|
-
writer.tag(2, import_runtime.WireType.Varint).
|
|
38197
|
+
if (message.peerId)
|
|
38198
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38199
|
+
if (message.maxId !== 0n)
|
|
38200
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.maxId);
|
|
38201
|
+
if (message.clear !== false)
|
|
38202
|
+
writer.tag(3, import_runtime.WireType.Varint).bool(message.clear);
|
|
38203
|
+
if (message.expectedRevision !== 0n)
|
|
38204
|
+
writer.tag(4, import_runtime.WireType.Varint).int64(message.expectedRevision);
|
|
36310
38205
|
let u = options.writeUnknownFields;
|
|
36311
38206
|
if (u !== false)
|
|
36312
38207
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
36313
38208
|
return writer;
|
|
36314
38209
|
}
|
|
36315
38210
|
}
|
|
36316
|
-
var
|
|
38211
|
+
var AcknowledgeMessagesInput = new AcknowledgeMessagesInput$Type;
|
|
38212
|
+
|
|
38213
|
+
class AcknowledgeMessagesResult$Type extends import_runtime4.MessageType {
|
|
38214
|
+
constructor() {
|
|
38215
|
+
super("AcknowledgeMessagesResult", [
|
|
38216
|
+
{ no: 1, name: "updates", kind: "message", repeat: 1, T: () => Update }
|
|
38217
|
+
]);
|
|
38218
|
+
}
|
|
38219
|
+
create(value) {
|
|
38220
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38221
|
+
message.updates = [];
|
|
38222
|
+
if (value !== undefined)
|
|
38223
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38224
|
+
return message;
|
|
38225
|
+
}
|
|
38226
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38227
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38228
|
+
while (reader.pos < end) {
|
|
38229
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38230
|
+
switch (fieldNo) {
|
|
38231
|
+
case 1:
|
|
38232
|
+
message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
|
|
38233
|
+
break;
|
|
38234
|
+
default:
|
|
38235
|
+
let u = options.readUnknownField;
|
|
38236
|
+
if (u === "throw")
|
|
38237
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38238
|
+
let d = reader.skip(wireType);
|
|
38239
|
+
if (u !== false)
|
|
38240
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38241
|
+
}
|
|
38242
|
+
}
|
|
38243
|
+
return message;
|
|
38244
|
+
}
|
|
38245
|
+
internalBinaryWrite(message, writer, options) {
|
|
38246
|
+
for (let i = 0;i < message.updates.length; i++)
|
|
38247
|
+
Update.internalBinaryWrite(message.updates[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38248
|
+
let u = options.writeUnknownFields;
|
|
38249
|
+
if (u !== false)
|
|
38250
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38251
|
+
return writer;
|
|
38252
|
+
}
|
|
38253
|
+
}
|
|
38254
|
+
var AcknowledgeMessagesResult = new AcknowledgeMessagesResult$Type;
|
|
38255
|
+
|
|
38256
|
+
class ChatAcknowledgements$Type extends import_runtime4.MessageType {
|
|
38257
|
+
constructor() {
|
|
38258
|
+
super("ChatAcknowledgements", [
|
|
38259
|
+
{ no: 1, name: "cursors", kind: "message", repeat: 1, T: () => ChatAcknowledgement }
|
|
38260
|
+
]);
|
|
38261
|
+
}
|
|
38262
|
+
create(value) {
|
|
38263
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38264
|
+
message.cursors = [];
|
|
38265
|
+
if (value !== undefined)
|
|
38266
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38267
|
+
return message;
|
|
38268
|
+
}
|
|
38269
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38270
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38271
|
+
while (reader.pos < end) {
|
|
38272
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38273
|
+
switch (fieldNo) {
|
|
38274
|
+
case 1:
|
|
38275
|
+
message.cursors.push(ChatAcknowledgement.internalBinaryRead(reader, reader.uint32(), options));
|
|
38276
|
+
break;
|
|
38277
|
+
default:
|
|
38278
|
+
let u = options.readUnknownField;
|
|
38279
|
+
if (u === "throw")
|
|
38280
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38281
|
+
let d = reader.skip(wireType);
|
|
38282
|
+
if (u !== false)
|
|
38283
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38284
|
+
}
|
|
38285
|
+
}
|
|
38286
|
+
return message;
|
|
38287
|
+
}
|
|
38288
|
+
internalBinaryWrite(message, writer, options) {
|
|
38289
|
+
for (let i = 0;i < message.cursors.length; i++)
|
|
38290
|
+
ChatAcknowledgement.internalBinaryWrite(message.cursors[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38291
|
+
let u = options.writeUnknownFields;
|
|
38292
|
+
if (u !== false)
|
|
38293
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38294
|
+
return writer;
|
|
38295
|
+
}
|
|
38296
|
+
}
|
|
38297
|
+
var ChatAcknowledgements = new ChatAcknowledgements$Type;
|
|
36317
38298
|
|
|
36318
38299
|
// node_modules/@noble/hashes/esm/utils.js
|
|
36319
38300
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
@@ -36636,23 +38617,37 @@ class SHA256 extends HashMD {
|
|
|
36636
38617
|
}
|
|
36637
38618
|
var sha256 = /* @__PURE__ */ createHasher(() => new SHA256);
|
|
36638
38619
|
|
|
38620
|
+
// node_modules/@inline-chat/protocol/dist/transfers.js
|
|
38621
|
+
var INLINE_TRANSFER_PART_SIZE = 512 * 1024;
|
|
38622
|
+
var INLINE_UPLOAD_MAX_PARTS = 1000;
|
|
38623
|
+
|
|
36639
38624
|
// node_modules/@inline-chat/protocol/dist/uploads.js
|
|
36640
38625
|
var HASH_READ_SIZE = 1024 * 1024;
|
|
36641
|
-
var MAX_NEGOTIATED_PART_SIZE = 16 * 1024 * 1024;
|
|
36642
38626
|
var DEFAULT_GLOBAL_CONCURRENCY = 3;
|
|
36643
38627
|
var DEFAULT_UPLOAD_CONCURRENCY = 2;
|
|
36644
38628
|
var MAX_PART_ATTEMPTS = 2;
|
|
36645
38629
|
var MAX_FINISH_RECONCILIATION_ATTEMPTS = 3;
|
|
36646
38630
|
var FINISH_RECONCILIATION_DELAY_SECONDS = 1;
|
|
36647
38631
|
var MAX_PROCESSING_RETRY_SECONDS = 30;
|
|
38632
|
+
var CANCEL_RPC_TIMEOUT_MS = 5000;
|
|
38633
|
+
var MAX_UPLOAD_BYTES_BY_KIND = {
|
|
38634
|
+
[UploadKind.PHOTO]: 40000000,
|
|
38635
|
+
[UploadKind.VIDEO]: 200000000,
|
|
38636
|
+
[UploadKind.DOCUMENT]: 200000000,
|
|
38637
|
+
[UploadKind.VOICE]: 20000000
|
|
38638
|
+
};
|
|
36648
38639
|
var boundedUploadProcessingRetrySeconds = (seconds) => Number.isNaN(seconds) ? 1 : Math.min(MAX_PROCESSING_RETRY_SECONDS, Math.max(1, Math.floor(seconds)));
|
|
36649
38640
|
var randomUploadId = () => {
|
|
36650
38641
|
const bytes = new Uint8Array(16);
|
|
36651
38642
|
globalThis.crypto.getRandomValues(bytes);
|
|
36652
38643
|
return bytes;
|
|
36653
38644
|
};
|
|
36654
|
-
var exactRead = async (source, offset, length) => {
|
|
36655
|
-
|
|
38645
|
+
var exactRead = async (source, offset, length, signal) => {
|
|
38646
|
+
if (signal?.aborted)
|
|
38647
|
+
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
38648
|
+
const bytes = await source.read(offset, length, signal);
|
|
38649
|
+
if (signal?.aborted)
|
|
38650
|
+
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36656
38651
|
if (bytes.length !== length)
|
|
36657
38652
|
throw new NativeUploadError("source_changed", "Upload source changed while it was being read");
|
|
36658
38653
|
return bytes;
|
|
@@ -36663,7 +38658,7 @@ var sourceHash = async (source, signal) => {
|
|
|
36663
38658
|
if (signal?.aborted)
|
|
36664
38659
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36665
38660
|
const length = Math.min(HASH_READ_SIZE, source.byteCount - offset);
|
|
36666
|
-
const bytes = await exactRead(source, offset, length);
|
|
38661
|
+
const bytes = await exactRead(source, offset, length, signal);
|
|
36667
38662
|
if (signal?.aborted)
|
|
36668
38663
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36669
38664
|
hash.update(bytes);
|
|
@@ -36683,12 +38678,18 @@ var validatePartIndices = (indices, partCount) => {
|
|
|
36683
38678
|
throw new NativeUploadError("protocol", "Server returned an invalid upload-part index");
|
|
36684
38679
|
}
|
|
36685
38680
|
};
|
|
38681
|
+
var reportProgress = (job) => {
|
|
38682
|
+
try {
|
|
38683
|
+
job.input.onProgress?.({ acceptedBytes: acceptedBytes(job), totalBytes: job.input.source.byteCount });
|
|
38684
|
+
} catch {}
|
|
38685
|
+
};
|
|
36686
38686
|
var delay = async (seconds, signal) => {
|
|
36687
38687
|
if (signal?.aborted)
|
|
36688
38688
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36689
38689
|
await new Promise((resolve, reject) => {
|
|
36690
38690
|
const onAbort = () => {
|
|
36691
38691
|
clearTimeout(timeout);
|
|
38692
|
+
signal?.removeEventListener("abort", onAbort);
|
|
36692
38693
|
reject(new NativeUploadError("canceled", "Upload was canceled"));
|
|
36693
38694
|
};
|
|
36694
38695
|
const timeout = setTimeout(() => {
|
|
@@ -36696,6 +38697,8 @@ var delay = async (seconds, signal) => {
|
|
|
36696
38697
|
resolve();
|
|
36697
38698
|
}, Math.max(1, seconds) * 1000);
|
|
36698
38699
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
38700
|
+
if (signal?.aborted)
|
|
38701
|
+
onAbort();
|
|
36699
38702
|
});
|
|
36700
38703
|
};
|
|
36701
38704
|
|
|
@@ -36705,6 +38708,7 @@ class NativeUploadClient {
|
|
|
36705
38708
|
uploadConcurrency;
|
|
36706
38709
|
#jobs = [];
|
|
36707
38710
|
#active = 0;
|
|
38711
|
+
#finishing = 0;
|
|
36708
38712
|
#cursor = 0;
|
|
36709
38713
|
constructor(rpc, globalConcurrency = DEFAULT_GLOBAL_CONCURRENCY, uploadConcurrency = DEFAULT_UPLOAD_CONCURRENCY) {
|
|
36710
38714
|
this.rpc = rpc;
|
|
@@ -36718,13 +38722,17 @@ class NativeUploadClient {
|
|
|
36718
38722
|
if (!Number.isSafeInteger(input.source.byteCount) || input.source.byteCount <= 0) {
|
|
36719
38723
|
throw new NativeUploadError("invalid_source", "Upload source must have a positive safe byte count");
|
|
36720
38724
|
}
|
|
38725
|
+
const maximumByteCount = MAX_UPLOAD_BYTES_BY_KIND[input.kind];
|
|
38726
|
+
if (maximumByteCount === undefined || input.source.byteCount > maximumByteCount) {
|
|
38727
|
+
throw new NativeUploadError("invalid_source", "Upload source exceeds the media size limit");
|
|
38728
|
+
}
|
|
36721
38729
|
if (input.signal?.aborted)
|
|
36722
38730
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36723
38731
|
const clientUploadId = input.clientUploadId?.slice() ?? randomUploadId();
|
|
36724
38732
|
if (clientUploadId.length !== 16)
|
|
36725
38733
|
throw new NativeUploadError("invalid_source", "Client upload ID must be 16 bytes");
|
|
36726
38734
|
const digest = await sourceHash(input.source, input.signal);
|
|
36727
|
-
const
|
|
38735
|
+
const createInput = {
|
|
36728
38736
|
clientUploadId,
|
|
36729
38737
|
fileName: input.fileName,
|
|
36730
38738
|
mimeType: input.mimeType,
|
|
@@ -36733,8 +38741,24 @@ class NativeUploadClient {
|
|
|
36733
38741
|
kind: input.kind,
|
|
36734
38742
|
thumbnailFileUniqueId: input.thumbnailFileUniqueId,
|
|
36735
38743
|
metadata: input.metadata?.kind === "video" ? { oneofKind: "video", video: input.metadata.value } : input.metadata?.kind === "voice" ? { oneofKind: "voice", voice: input.metadata.value } : { oneofKind: undefined }
|
|
36736
|
-
}
|
|
36737
|
-
|
|
38744
|
+
};
|
|
38745
|
+
let created;
|
|
38746
|
+
try {
|
|
38747
|
+
created = await this.rpc.create(createInput, input.signal);
|
|
38748
|
+
} catch (error) {
|
|
38749
|
+
if (input.signal?.aborted)
|
|
38750
|
+
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
38751
|
+
if (this.rpc.shouldReplayCreate?.(error) === false)
|
|
38752
|
+
throw error;
|
|
38753
|
+
try {
|
|
38754
|
+
created = await this.rpc.create(createInput, input.signal);
|
|
38755
|
+
} catch (replayError) {
|
|
38756
|
+
if (input.signal?.aborted)
|
|
38757
|
+
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
38758
|
+
throw replayError;
|
|
38759
|
+
}
|
|
38760
|
+
}
|
|
38761
|
+
if (created.uploadId.length !== 16 || created.partSize !== INLINE_TRANSFER_PART_SIZE || !Number.isSafeInteger(created.partCount) || created.partCount < 1 || created.partCount > INLINE_UPLOAD_MAX_PARTS || created.partCount !== Math.ceil(input.source.byteCount / created.partSize) || created.acceptedParts.some((index) => !Number.isInteger(index) || index < 0 || index >= created.partCount)) {
|
|
36738
38762
|
throw new NativeUploadError("protocol", "Server returned invalid upload geometry");
|
|
36739
38763
|
}
|
|
36740
38764
|
return await new Promise((resolve, reject) => {
|
|
@@ -36759,13 +38783,13 @@ class NativeUploadClient {
|
|
|
36759
38783
|
this.#abort(job);
|
|
36760
38784
|
return;
|
|
36761
38785
|
}
|
|
36762
|
-
|
|
38786
|
+
reportProgress(job);
|
|
36763
38787
|
if (!job.settled)
|
|
36764
38788
|
this.#pump();
|
|
36765
38789
|
});
|
|
36766
38790
|
}
|
|
36767
38791
|
#pump() {
|
|
36768
|
-
while (this.#active < this.globalConcurrency) {
|
|
38792
|
+
while (this.#active + this.#finishing < this.globalConcurrency) {
|
|
36769
38793
|
const selected = this.#nextJob();
|
|
36770
38794
|
if (!selected)
|
|
36771
38795
|
break;
|
|
@@ -36780,6 +38804,10 @@ class NativeUploadClient {
|
|
|
36780
38804
|
this.#active += 1;
|
|
36781
38805
|
this.#sendPart(selected, partIndex);
|
|
36782
38806
|
}
|
|
38807
|
+
for (const job of this.#jobs) {
|
|
38808
|
+
if (!job.settled && job.active === 0 && this.#nextPart(job) === undefined)
|
|
38809
|
+
this.#finish(job);
|
|
38810
|
+
}
|
|
36783
38811
|
}
|
|
36784
38812
|
#nextJob() {
|
|
36785
38813
|
for (let offset = 0;offset < this.#jobs.length; offset += 1) {
|
|
@@ -36805,14 +38833,14 @@ class NativeUploadClient {
|
|
|
36805
38833
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36806
38834
|
const offset = partIndex * job.upload.partSize;
|
|
36807
38835
|
const length = Math.min(job.upload.partSize, job.input.source.byteCount - offset);
|
|
36808
|
-
const data = await exactRead(job.input.source, offset, length);
|
|
38836
|
+
const data = await exactRead(job.input.source, offset, length, job.input.signal);
|
|
36809
38837
|
if (job.settled)
|
|
36810
38838
|
return;
|
|
36811
38839
|
await this.#savePart(job, partIndex, data);
|
|
36812
38840
|
if (job.settled)
|
|
36813
38841
|
return;
|
|
36814
38842
|
job.accepted.add(partIndex);
|
|
36815
|
-
|
|
38843
|
+
reportProgress(job);
|
|
36816
38844
|
} catch (error) {
|
|
36817
38845
|
if (!job.settled && !job.input.signal?.aborted) {
|
|
36818
38846
|
this.#reject(job, error);
|
|
@@ -36832,7 +38860,7 @@ class NativeUploadClient {
|
|
|
36832
38860
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36833
38861
|
}
|
|
36834
38862
|
try {
|
|
36835
|
-
await this.rpc.savePart({ uploadId: job.upload.uploadId, partIndex, data });
|
|
38863
|
+
await this.rpc.savePart({ uploadId: job.upload.uploadId, partIndex, data }, job.input.signal);
|
|
36836
38864
|
return;
|
|
36837
38865
|
} catch (error) {
|
|
36838
38866
|
if (job.settled || job.input.signal?.aborted) {
|
|
@@ -36840,7 +38868,7 @@ class NativeUploadClient {
|
|
|
36840
38868
|
}
|
|
36841
38869
|
let state;
|
|
36842
38870
|
try {
|
|
36843
|
-
state = await this.rpc.state({ uploadId: job.upload.uploadId });
|
|
38871
|
+
state = await this.rpc.state({ uploadId: job.upload.uploadId }, job.input.signal);
|
|
36844
38872
|
} catch {
|
|
36845
38873
|
throw error;
|
|
36846
38874
|
}
|
|
@@ -36853,8 +38881,9 @@ class NativeUploadClient {
|
|
|
36853
38881
|
}
|
|
36854
38882
|
}
|
|
36855
38883
|
async#finish(job) {
|
|
36856
|
-
if (job.settled || job.active
|
|
38884
|
+
if (job.settled || job.active !== 0 || this.#active + this.#finishing >= this.globalConcurrency)
|
|
36857
38885
|
return;
|
|
38886
|
+
this.#finishing += 1;
|
|
36858
38887
|
job.active = -1;
|
|
36859
38888
|
let reconciliationAttempts = 0;
|
|
36860
38889
|
try {
|
|
@@ -36863,7 +38892,7 @@ class NativeUploadClient {
|
|
|
36863
38892
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
36864
38893
|
let result;
|
|
36865
38894
|
try {
|
|
36866
|
-
result = await this.rpc.finish({ uploadId: job.upload.uploadId });
|
|
38895
|
+
result = await this.rpc.finish({ uploadId: job.upload.uploadId }, job.input.signal);
|
|
36867
38896
|
} catch (error) {
|
|
36868
38897
|
if (job.input.signal?.aborted)
|
|
36869
38898
|
throw new NativeUploadError("canceled", "Upload was canceled");
|
|
@@ -36871,7 +38900,7 @@ class NativeUploadClient {
|
|
|
36871
38900
|
throw error;
|
|
36872
38901
|
let state;
|
|
36873
38902
|
try {
|
|
36874
|
-
state = await this.rpc.state({ uploadId: job.upload.uploadId });
|
|
38903
|
+
state = await this.rpc.state({ uploadId: job.upload.uploadId }, job.input.signal);
|
|
36875
38904
|
} catch {
|
|
36876
38905
|
throw error;
|
|
36877
38906
|
}
|
|
@@ -36885,8 +38914,8 @@ class NativeUploadClient {
|
|
|
36885
38914
|
job.resolve(state.complete);
|
|
36886
38915
|
return;
|
|
36887
38916
|
case UploadStatus.PROCESSING:
|
|
36888
|
-
|
|
36889
|
-
|
|
38917
|
+
this.#resumeFinishAfter(job, FINISH_RECONCILIATION_DELAY_SECONDS);
|
|
38918
|
+
return;
|
|
36890
38919
|
case UploadStatus.UPLOADING:
|
|
36891
38920
|
job.accepted = new Set(state.acceptedParts);
|
|
36892
38921
|
if (this.#nextPart(job) === undefined)
|
|
@@ -36913,6 +38942,9 @@ class NativeUploadClient {
|
|
|
36913
38942
|
case "failed":
|
|
36914
38943
|
throw new NativeUploadError(result.state.failed.retryable ? "retryable" : "rejected", `Upload finalization failed with code ${result.state.failed.code}`);
|
|
36915
38944
|
case "missing":
|
|
38945
|
+
if (result.state.missing.partIndices.length === 0) {
|
|
38946
|
+
throw new NativeUploadError("protocol", "Server returned an empty missing-parts result");
|
|
38947
|
+
}
|
|
36916
38948
|
validatePartIndices(result.state.missing.partIndices, job.upload.partCount);
|
|
36917
38949
|
for (const index of result.state.missing.partIndices)
|
|
36918
38950
|
job.accepted.delete(index);
|
|
@@ -36920,21 +38952,35 @@ class NativeUploadClient {
|
|
|
36920
38952
|
this.#pump();
|
|
36921
38953
|
return;
|
|
36922
38954
|
case "processing":
|
|
36923
|
-
|
|
36924
|
-
|
|
38955
|
+
this.#resumeFinishAfter(job, boundedUploadProcessingRetrySeconds(result.state.processing.retryAfterSeconds));
|
|
38956
|
+
return;
|
|
36925
38957
|
default:
|
|
36926
38958
|
throw new NativeUploadError("protocol", "Server returned an empty finish result");
|
|
36927
38959
|
}
|
|
36928
38960
|
}
|
|
36929
38961
|
} catch (error) {
|
|
36930
38962
|
this.#reject(job, error);
|
|
38963
|
+
} finally {
|
|
38964
|
+
this.#finishing -= 1;
|
|
38965
|
+
this.#pump();
|
|
36931
38966
|
}
|
|
36932
38967
|
}
|
|
38968
|
+
#resumeFinishAfter(job, seconds) {
|
|
38969
|
+
delay(seconds, job.input.signal).then(() => {
|
|
38970
|
+
if (job.settled)
|
|
38971
|
+
return;
|
|
38972
|
+
job.active = 0;
|
|
38973
|
+
this.#finish(job);
|
|
38974
|
+
}, (error) => {
|
|
38975
|
+
if (!job.settled)
|
|
38976
|
+
this.#reject(job, error);
|
|
38977
|
+
});
|
|
38978
|
+
}
|
|
36933
38979
|
#abort(job) {
|
|
36934
38980
|
if (job.settled)
|
|
36935
38981
|
return;
|
|
36936
38982
|
this.#reject(job, new NativeUploadError("canceled", "Upload was canceled"));
|
|
36937
|
-
this.rpc.cancel({ uploadId: job.upload.uploadId }).catch(() => {});
|
|
38983
|
+
this.rpc.cancel({ uploadId: job.upload.uploadId }, AbortSignal.timeout(CANCEL_RPC_TIMEOUT_MS)).catch(() => {});
|
|
36938
38984
|
}
|
|
36939
38985
|
#reject(job, error) {
|
|
36940
38986
|
if (job.settled)
|
|
@@ -36965,33 +39011,34 @@ var uploadByteSource = (value) => {
|
|
|
36965
39011
|
read: async (offset, length) => bytes.slice(offset, offset + length)
|
|
36966
39012
|
};
|
|
36967
39013
|
};
|
|
36968
|
-
var rpcUploadTransport = (call) => ({
|
|
36969
|
-
|
|
36970
|
-
|
|
39014
|
+
var rpcUploadTransport = (call, shouldReplayCreate) => ({
|
|
39015
|
+
shouldReplayCreate,
|
|
39016
|
+
create: async (input, signal) => {
|
|
39017
|
+
const result = await call(Method.CREATE_UPLOAD, { oneofKind: "createUpload", createUpload: input }, signal);
|
|
36971
39018
|
if (result.oneofKind !== "createUpload")
|
|
36972
39019
|
throw new NativeUploadError("protocol", "Unexpected createUpload result");
|
|
36973
39020
|
return result.createUpload;
|
|
36974
39021
|
},
|
|
36975
|
-
savePart: async (input) => {
|
|
36976
|
-
const result = await call(Method.SAVE_UPLOAD_PART, { oneofKind: "saveUploadPart", saveUploadPart: input });
|
|
39022
|
+
savePart: async (input, signal) => {
|
|
39023
|
+
const result = await call(Method.SAVE_UPLOAD_PART, { oneofKind: "saveUploadPart", saveUploadPart: input }, signal);
|
|
36977
39024
|
if (result.oneofKind !== "saveUploadPart")
|
|
36978
39025
|
throw new NativeUploadError("protocol", "Unexpected saveUploadPart result");
|
|
36979
39026
|
return result.saveUploadPart;
|
|
36980
39027
|
},
|
|
36981
|
-
state: async (input) => {
|
|
36982
|
-
const result = await call(Method.GET_UPLOAD_STATE, { oneofKind: "getUploadState", getUploadState: input });
|
|
39028
|
+
state: async (input, signal) => {
|
|
39029
|
+
const result = await call(Method.GET_UPLOAD_STATE, { oneofKind: "getUploadState", getUploadState: input }, signal);
|
|
36983
39030
|
if (result.oneofKind !== "getUploadState")
|
|
36984
39031
|
throw new NativeUploadError("protocol", "Unexpected getUploadState result");
|
|
36985
39032
|
return result.getUploadState;
|
|
36986
39033
|
},
|
|
36987
|
-
finish: async (input) => {
|
|
36988
|
-
const result = await call(Method.FINISH_UPLOAD, { oneofKind: "finishUpload", finishUpload: input });
|
|
39034
|
+
finish: async (input, signal) => {
|
|
39035
|
+
const result = await call(Method.FINISH_UPLOAD, { oneofKind: "finishUpload", finishUpload: input }, signal);
|
|
36989
39036
|
if (result.oneofKind !== "finishUpload")
|
|
36990
39037
|
throw new NativeUploadError("protocol", "Unexpected finishUpload result");
|
|
36991
39038
|
return result.finishUpload;
|
|
36992
39039
|
},
|
|
36993
|
-
cancel: async (input) => {
|
|
36994
|
-
const result = await call(Method.CANCEL_UPLOAD, { oneofKind: "cancelUpload", cancelUpload: input });
|
|
39040
|
+
cancel: async (input, signal) => {
|
|
39041
|
+
const result = await call(Method.CANCEL_UPLOAD, { oneofKind: "cancelUpload", cancelUpload: input }, signal);
|
|
36995
39042
|
if (result.oneofKind !== "cancelUpload")
|
|
36996
39043
|
throw new NativeUploadError("protocol", "Unexpected cancelUpload result");
|
|
36997
39044
|
return result.cancelUpload;
|
|
@@ -37527,6 +39574,7 @@ class ProtocolClient {
|
|
|
37527
39574
|
async callRpc(method, input = emptyRpcInput, options) {
|
|
37528
39575
|
if (this.terminalAuthenticationError)
|
|
37529
39576
|
throw this.terminalAuthenticationError;
|
|
39577
|
+
options?.signal?.throwIfAborted();
|
|
37530
39578
|
assertValidRpcMethod(method);
|
|
37531
39579
|
if (this.pendingRpcRequests.size >= this.maxPendingRpcRequests) {
|
|
37532
39580
|
throw new ProtocolClientError("capacity-exceeded", {
|
|
@@ -37548,6 +39596,14 @@ class ProtocolClient {
|
|
|
37548
39596
|
sending: false
|
|
37549
39597
|
};
|
|
37550
39598
|
this.pendingRpcRequests.set(message.id, pending);
|
|
39599
|
+
const onAbort = () => {
|
|
39600
|
+
const reason = options?.signal?.reason;
|
|
39601
|
+
this.failPendingRpcRequest(message.id, reason instanceof Error ? reason : new DOMException("The operation was aborted", "AbortError"));
|
|
39602
|
+
};
|
|
39603
|
+
options?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
39604
|
+
pending.removeAbortListener = () => options?.signal?.removeEventListener("abort", onAbort);
|
|
39605
|
+
if (options?.signal?.aborted)
|
|
39606
|
+
onAbort();
|
|
37551
39607
|
if (pending.timeoutMs !== null) {
|
|
37552
39608
|
pending.timeout = setTimeout(() => {
|
|
37553
39609
|
this.failPendingRpcRequest(message.id, pending.attempted && pending.reconnectPolicy === "never-replay" ? commitOutcomeUnknownError("RPC timed out after dispatch") : new ProtocolClientError("timeout"));
|
|
@@ -37796,6 +39852,7 @@ class ProtocolClient {
|
|
|
37796
39852
|
return null;
|
|
37797
39853
|
if (pending.timeout)
|
|
37798
39854
|
clearTimeout(pending.timeout);
|
|
39855
|
+
pending.removeAbortListener?.();
|
|
37799
39856
|
this.pendingRpcRequests.delete(msgId);
|
|
37800
39857
|
return pending;
|
|
37801
39858
|
}
|
|
@@ -37804,6 +39861,7 @@ class ProtocolClient {
|
|
|
37804
39861
|
pending.reject(error);
|
|
37805
39862
|
if (pending.timeout)
|
|
37806
39863
|
clearTimeout(pending.timeout);
|
|
39864
|
+
pending.removeAbortListener?.();
|
|
37807
39865
|
}
|
|
37808
39866
|
this.pendingRpcRequests.clear();
|
|
37809
39867
|
}
|
|
@@ -39929,21 +41987,40 @@ class AcknowledgementQueue {
|
|
|
39929
41987
|
|
|
39930
41988
|
class PendingMessageCache {
|
|
39931
41989
|
capacity;
|
|
41990
|
+
byteCapacity;
|
|
39932
41991
|
#messages = new Map;
|
|
39933
|
-
|
|
41992
|
+
#retainedBytes = 0;
|
|
41993
|
+
constructor(capacity = 8192, byteCapacity = 32 * 1024 * 1024) {
|
|
39934
41994
|
this.capacity = capacity;
|
|
41995
|
+
this.byteCapacity = byteCapacity;
|
|
39935
41996
|
if (!Number.isSafeInteger(capacity) || capacity < 1 || capacity > 8192)
|
|
39936
41997
|
throw new RangeError("Invalid pending-message capacity");
|
|
41998
|
+
if (!Number.isSafeInteger(byteCapacity) || byteCapacity < 1)
|
|
41999
|
+
throw new RangeError("Invalid pending-message byte capacity");
|
|
42000
|
+
}
|
|
42001
|
+
get retainedBytes() {
|
|
42002
|
+
return this.#retainedBytes;
|
|
39937
42003
|
}
|
|
39938
42004
|
retain(message) {
|
|
39939
42005
|
if (this.#messages.size >= this.capacity && !this.#messages.has(message.messageId)) {
|
|
39940
42006
|
throw new RangeError("Pending-message cache is full");
|
|
39941
42007
|
}
|
|
39942
|
-
this.#messages.
|
|
42008
|
+
const previous = this.#messages.get(message.messageId);
|
|
42009
|
+
const nextBytes = this.#retainedBytes - (previous?.body.length ?? 0) + message.body.length;
|
|
42010
|
+
if (nextBytes > this.byteCapacity)
|
|
42011
|
+
throw new RangeError("Pending-message byte capacity exceeded");
|
|
42012
|
+
const body = message.body.slice();
|
|
42013
|
+
this.#messages.set(message.messageId, { ...message, body });
|
|
42014
|
+
this.#retainedBytes = nextBytes;
|
|
39943
42015
|
}
|
|
39944
42016
|
acknowledge(messageIds) {
|
|
39945
|
-
for (const messageId of messageIds)
|
|
42017
|
+
for (const messageId of messageIds) {
|
|
42018
|
+
const message = this.#messages.get(messageId);
|
|
42019
|
+
if (!message)
|
|
42020
|
+
continue;
|
|
39946
42021
|
this.#messages.delete(messageId);
|
|
42022
|
+
this.#retainedBytes -= message.body.length;
|
|
42023
|
+
}
|
|
39947
42024
|
}
|
|
39948
42025
|
resend(messageIds) {
|
|
39949
42026
|
return messageIds.flatMap((messageId) => {
|
|
@@ -39962,6 +42039,7 @@ class PendingMessageCache {
|
|
|
39962
42039
|
if (view.getUint32(0, true) !== 4082920705 || view.getBigInt64(4, true) !== requestMessageId)
|
|
39963
42040
|
continue;
|
|
39964
42041
|
this.#messages.delete(messageId);
|
|
42042
|
+
this.#retainedBytes -= message.body.length;
|
|
39965
42043
|
return { ...message, body: message.body.slice() };
|
|
39966
42044
|
}
|
|
39967
42045
|
return;
|
|
@@ -40996,11 +43074,12 @@ class InlineProtocolServerSession {
|
|
|
40996
43074
|
try {
|
|
40997
43075
|
const resultObject = input.dispatched.kind === "result" ? encodeInlineResult(input.dispatched.payload) : encodeRpcError(input.dispatched.code, input.dispatched.message);
|
|
40998
43076
|
const resultBody = encodeRpcResult(input.messageId, resultObject);
|
|
43077
|
+
const replayResultBody = input.dispatched.kind === "result" && input.dispatched.replayPayload ? encodeRpcResult(input.messageId, encodeInlineResult(input.dispatched.replayPayload)) : resultBody;
|
|
40999
43078
|
const completion = await this.options.replay.complete({
|
|
41000
43079
|
authKeyId: input.authKeyId,
|
|
41001
43080
|
sessionId: input.sessionId,
|
|
41002
43081
|
messageId: input.messageId,
|
|
41003
|
-
resultBody
|
|
43082
|
+
resultBody: replayResultBody
|
|
41004
43083
|
});
|
|
41005
43084
|
const terminateAuthorization = input.dispatched.terminateAuthorization === true;
|
|
41006
43085
|
if (terminateAuthorization) {
|
|
@@ -41344,7 +43423,7 @@ class InlineProtocolV3Connection {
|
|
|
41344
43423
|
this.#sessionId = randomInt64(this.#random);
|
|
41345
43424
|
this.#authorization = options.authorization ? cloneAuthorization(options.authorization) : undefined;
|
|
41346
43425
|
this.#rsaKeys = options.authorization ? [] : decodePublicKeys(options.rsaPublicKeys);
|
|
41347
|
-
this.#uploads = new NativeUploadClient(rpcUploadTransport((method, input) => this.callRpc({ method, input })));
|
|
43426
|
+
this.#uploads = new NativeUploadClient(rpcUploadTransport((method, input, signal) => this.callRpc({ method, input }, signal), (error) => error instanceof InlineProtocolV3Error && error.code === "commit-outcome-unknown"));
|
|
41348
43427
|
}
|
|
41349
43428
|
static async connect(options) {
|
|
41350
43429
|
const connection = new InlineProtocolV3Connection(options);
|
|
@@ -41395,9 +43474,9 @@ class InlineProtocolV3Connection {
|
|
|
41395
43474
|
async invoke(request) {
|
|
41396
43475
|
return await this.#invoke(request);
|
|
41397
43476
|
}
|
|
41398
|
-
async#invoke(request, onDispatched) {
|
|
43477
|
+
async#invoke(request, onDispatched, signal) {
|
|
41399
43478
|
const payload = RealtimeV3Request.toBinary(request);
|
|
41400
|
-
const result = await this.#sendContent(encodeInlineInvoke(payload), onDispatched);
|
|
43479
|
+
const result = await this.#sendContent(encodeInlineInvoke(payload), onDispatched, signal);
|
|
41401
43480
|
let application2;
|
|
41402
43481
|
try {
|
|
41403
43482
|
application2 = decodeInlineApplicationObject(result);
|
|
@@ -41434,9 +43513,9 @@ class InlineProtocolV3Connection {
|
|
|
41434
43513
|
throw new InlineProtocolV3Error("protocol", "Unexpected auth.complete response");
|
|
41435
43514
|
return response.body.authComplete;
|
|
41436
43515
|
}
|
|
41437
|
-
async callRpc(rpc) {
|
|
43516
|
+
async callRpc(rpc, signal) {
|
|
41438
43517
|
const request = { body: { oneofKind: "rpc", rpc } };
|
|
41439
|
-
const response = readOnlyRpcMethods.has(rpc.method) ? await this.#invoke(request) : await this.#invokeMutation(request);
|
|
43518
|
+
const response = readOnlyRpcMethods.has(rpc.method) ? await this.#invoke(request, undefined, signal) : await this.#invokeMutation(request, signal);
|
|
41440
43519
|
if (response.body.oneofKind === "rpcError")
|
|
41441
43520
|
throw new InlineProtocolV3Error("protocol", response.body.rpcError.message);
|
|
41442
43521
|
if (response.body.oneofKind !== "rpcResult")
|
|
@@ -41539,12 +43618,12 @@ class InlineProtocolV3Connection {
|
|
|
41539
43618
|
throw new InlineProtocolV3Error("protocol", "Unexpected upload response");
|
|
41540
43619
|
return response.body.finishHttpUpload;
|
|
41541
43620
|
}
|
|
41542
|
-
async#invokeMutation(request) {
|
|
43621
|
+
async#invokeMutation(request, signal) {
|
|
41543
43622
|
let dispatched = false;
|
|
41544
43623
|
try {
|
|
41545
43624
|
return await this.#invoke(request, () => {
|
|
41546
43625
|
dispatched = true;
|
|
41547
|
-
});
|
|
43626
|
+
}, signal);
|
|
41548
43627
|
} catch (error) {
|
|
41549
43628
|
if (dispatched && error instanceof InlineProtocolV3Error && ["closed", "protocol", "timeout", "unauthorized"].includes(error.code)) {
|
|
41550
43629
|
throw new InlineProtocolV3Error("commit-outcome-unknown", "Mutation lost its authoritative result after Inline Protocol dispatch; the outcome is unknown", { cause: error });
|
|
@@ -41634,12 +43713,13 @@ class InlineProtocolV3Connection {
|
|
|
41634
43713
|
return;
|
|
41635
43714
|
}
|
|
41636
43715
|
}
|
|
41637
|
-
async#sendContent(body, onDispatched) {
|
|
43716
|
+
async#sendContent(body, onDispatched, signal) {
|
|
41638
43717
|
const messageId = this.#nextClientMessageId();
|
|
41639
43718
|
const sequenceNumber = this.#sequenceNumbers.next(true);
|
|
41640
|
-
return (await this.#sendPreparedContent(messageId, sequenceNumber, body, onDispatched)).result;
|
|
43719
|
+
return (await this.#sendPreparedContent(messageId, sequenceNumber, body, onDispatched, signal)).result;
|
|
41641
43720
|
}
|
|
41642
|
-
async#sendPreparedContent(initialMessageId, sequenceNumber, body, onDispatched) {
|
|
43721
|
+
async#sendPreparedContent(initialMessageId, sequenceNumber, body, onDispatched, signal) {
|
|
43722
|
+
signal?.throwIfAborted();
|
|
41643
43723
|
this.#admitPending(body);
|
|
41644
43724
|
return await new Promise((resolve, reject) => {
|
|
41645
43725
|
let pending;
|
|
@@ -41648,6 +43728,7 @@ class InlineProtocolV3Connection {
|
|
|
41648
43728
|
return;
|
|
41649
43729
|
this.#pendingContent.delete(pending.messageId);
|
|
41650
43730
|
this.#releasePending(body);
|
|
43731
|
+
pending.removeAbortListener?.();
|
|
41651
43732
|
reject(new InlineProtocolV3Error("timeout", `Inline Protocol response timed out after ${this.#options.requestTimeoutMs ?? REQUEST_TIMEOUT_MS}ms`));
|
|
41652
43733
|
}, this.#options.requestTimeoutMs ?? REQUEST_TIMEOUT_MS);
|
|
41653
43734
|
pending = {
|
|
@@ -41659,6 +43740,22 @@ class InlineProtocolV3Connection {
|
|
|
41659
43740
|
timeout
|
|
41660
43741
|
};
|
|
41661
43742
|
this.#pendingContent.set(initialMessageId, pending);
|
|
43743
|
+
const onAbort = () => {
|
|
43744
|
+
if (this.#pendingContent.get(pending.messageId) !== pending)
|
|
43745
|
+
return;
|
|
43746
|
+
this.#pendingContent.delete(pending.messageId);
|
|
43747
|
+
this.#releasePending(body);
|
|
43748
|
+
clearTimeout(pending.timeout);
|
|
43749
|
+
pending.removeAbortListener?.();
|
|
43750
|
+
const reason = signal?.reason;
|
|
43751
|
+
reject(reason instanceof Error ? reason : new DOMException("The operation was aborted", "AbortError"));
|
|
43752
|
+
};
|
|
43753
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
43754
|
+
pending.removeAbortListener = () => signal?.removeEventListener("abort", onAbort);
|
|
43755
|
+
if (signal?.aborted)
|
|
43756
|
+
onAbort();
|
|
43757
|
+
if (this.#pendingContent.get(initialMessageId) !== pending)
|
|
43758
|
+
return;
|
|
41662
43759
|
try {
|
|
41663
43760
|
this.#sendEncrypted(initialMessageId, sequenceNumber, body, true);
|
|
41664
43761
|
onDispatched?.();
|
|
@@ -41666,6 +43763,7 @@ class InlineProtocolV3Connection {
|
|
|
41666
43763
|
this.#pendingContent.delete(initialMessageId);
|
|
41667
43764
|
this.#releasePending(body);
|
|
41668
43765
|
clearTimeout(pending.timeout);
|
|
43766
|
+
pending.removeAbortListener?.();
|
|
41669
43767
|
reject(error instanceof Error ? error : new Error(String(error)));
|
|
41670
43768
|
}
|
|
41671
43769
|
});
|
|
@@ -41710,6 +43808,7 @@ class InlineProtocolV3Connection {
|
|
|
41710
43808
|
this.#pendingContent.delete(result.requestMessageId);
|
|
41711
43809
|
this.#releasePending(pending.body);
|
|
41712
43810
|
clearTimeout(pending.timeout);
|
|
43811
|
+
pending.removeAbortListener?.();
|
|
41713
43812
|
pending.resolve({ messageId: result.requestMessageId, result: result.result });
|
|
41714
43813
|
continue;
|
|
41715
43814
|
}
|
|
@@ -41758,6 +43857,8 @@ class InlineProtocolV3Connection {
|
|
|
41758
43857
|
const rejected = pending ?? probeEntry[1];
|
|
41759
43858
|
this.#releasePending(rejected.body);
|
|
41760
43859
|
clearTimeout(rejected.timeout);
|
|
43860
|
+
if ("removeAbortListener" in rejected)
|
|
43861
|
+
rejected.removeAbortListener?.();
|
|
41761
43862
|
rejected.reject(new InlineProtocolV3Error("protocol", `Server rejected the outgoing message (${bad.errorCode})`));
|
|
41762
43863
|
return;
|
|
41763
43864
|
}
|
|
@@ -41774,6 +43875,7 @@ class InlineProtocolV3Connection {
|
|
|
41774
43875
|
this.#pendingContent.clear();
|
|
41775
43876
|
for (const item of pending) {
|
|
41776
43877
|
clearTimeout(item.timeout);
|
|
43878
|
+
item.removeAbortListener?.();
|
|
41777
43879
|
item.reject(error);
|
|
41778
43880
|
}
|
|
41779
43881
|
const probes = [...this.#pendingProbes.values()];
|
|
@@ -42111,6 +44213,7 @@ class InlineProtocolV3Transport {
|
|
|
42111
44213
|
throw new Error("Inline Protocol connection attempt was superseded");
|
|
42112
44214
|
}
|
|
42113
44215
|
let connection;
|
|
44216
|
+
let openingCloseError;
|
|
42114
44217
|
const temporary = this.#credentials.temporary;
|
|
42115
44218
|
if (temporary?.expiresAt !== undefined) {
|
|
42116
44219
|
try {
|
|
@@ -42125,7 +44228,13 @@ class InlineProtocolV3Transport {
|
|
|
42125
44228
|
this.#connectionFailed(generation, error instanceof Error ? error : new Error(String(error)));
|
|
42126
44229
|
});
|
|
42127
44230
|
},
|
|
42128
|
-
onClose: (error) =>
|
|
44231
|
+
onClose: (error) => {
|
|
44232
|
+
if (cachedSource && this.#connection === cachedSource) {
|
|
44233
|
+
this.#connectionFailed(generation, error);
|
|
44234
|
+
} else {
|
|
44235
|
+
openingCloseError ??= error;
|
|
44236
|
+
}
|
|
44237
|
+
},
|
|
42129
44238
|
onRotationDue: () => {
|
|
42130
44239
|
setTimeout(() => {
|
|
42131
44240
|
if (cachedSource)
|
|
@@ -42135,11 +44244,14 @@ class InlineProtocolV3Transport {
|
|
|
42135
44244
|
});
|
|
42136
44245
|
cachedSource = connection;
|
|
42137
44246
|
await connection.probeTemporaryAuthorization();
|
|
44247
|
+
if (openingCloseError)
|
|
44248
|
+
throw openingCloseError;
|
|
42138
44249
|
this.#requireCurrent(generation);
|
|
42139
44250
|
if (connection.temporaryAuthorizationNeedsRotation()) {
|
|
42140
44251
|
this.#log.info?.("Stored Inline Protocol temporary authorization reached its rotation boundary");
|
|
42141
44252
|
await connection.close();
|
|
42142
44253
|
connection = undefined;
|
|
44254
|
+
openingCloseError = undefined;
|
|
42143
44255
|
}
|
|
42144
44256
|
} catch (error) {
|
|
42145
44257
|
await connection?.close();
|
|
@@ -42147,6 +44259,7 @@ class InlineProtocolV3Transport {
|
|
|
42147
44259
|
if (!isAuthenticationInvalidated(error))
|
|
42148
44260
|
throw error;
|
|
42149
44261
|
this.#log.warn?.("Stored Inline Protocol temporary authorization was rejected; regenerating once", error);
|
|
44262
|
+
openingCloseError = undefined;
|
|
42150
44263
|
}
|
|
42151
44264
|
}
|
|
42152
44265
|
if (!connection) {
|
|
@@ -42167,7 +44280,13 @@ class InlineProtocolV3Transport {
|
|
|
42167
44280
|
this.#connectionFailed(generation, error instanceof Error ? error : new Error(String(error)));
|
|
42168
44281
|
});
|
|
42169
44282
|
},
|
|
42170
|
-
onClose: (error) =>
|
|
44283
|
+
onClose: (error) => {
|
|
44284
|
+
if (replacementSource && this.#connection === replacementSource) {
|
|
44285
|
+
this.#connectionFailed(generation, error);
|
|
44286
|
+
} else {
|
|
44287
|
+
openingCloseError ??= error;
|
|
44288
|
+
}
|
|
44289
|
+
},
|
|
42171
44290
|
onRotationDue: () => {
|
|
42172
44291
|
setTimeout(() => {
|
|
42173
44292
|
if (replacementSource)
|
|
@@ -42179,6 +44298,8 @@ class InlineProtocolV3Transport {
|
|
|
42179
44298
|
try {
|
|
42180
44299
|
await replacement.bindTemporary(this.#credentials.permanent);
|
|
42181
44300
|
await replacement.ping();
|
|
44301
|
+
if (openingCloseError)
|
|
44302
|
+
throw openingCloseError;
|
|
42182
44303
|
this.#requireCurrent(generation);
|
|
42183
44304
|
connection = replacement;
|
|
42184
44305
|
} catch (error) {
|
|
@@ -42190,6 +44311,8 @@ class InlineProtocolV3Transport {
|
|
|
42190
44311
|
nextCredentials.temporary = connection.authorization;
|
|
42191
44312
|
try {
|
|
42192
44313
|
await this.#options.onCredentials?.(cloneCredentials(nextCredentials));
|
|
44314
|
+
if (openingCloseError)
|
|
44315
|
+
throw openingCloseError;
|
|
42193
44316
|
this.#requireCurrent(generation);
|
|
42194
44317
|
} catch (error) {
|
|
42195
44318
|
await connection.close();
|
|
@@ -42493,6 +44616,7 @@ var defaultVideoHeight = 720;
|
|
|
42493
44616
|
var defaultVideoDuration = 1;
|
|
42494
44617
|
var defaultCatchUpPageLimit = 100;
|
|
42495
44618
|
var defaultCatchUpTotalLimit = 1e4;
|
|
44619
|
+
var maxDatabaseUpdateSequence = 2147483647;
|
|
42496
44620
|
var inboundEventCapacity = 256;
|
|
42497
44621
|
var inboundEventCapacityBytes = 8 * 1024 * 1024;
|
|
42498
44622
|
var closeJoinTimeoutMs = 2000;
|
|
@@ -42637,6 +44761,7 @@ class InlineSdkClient {
|
|
|
42637
44761
|
byteLength: inboundEventByteLength
|
|
42638
44762
|
});
|
|
42639
44763
|
started = false;
|
|
44764
|
+
closed = false;
|
|
42640
44765
|
openPromise = null;
|
|
42641
44766
|
openResolver = null;
|
|
42642
44767
|
openRejecter = null;
|
|
@@ -42700,12 +44825,16 @@ class InlineSdkClient {
|
|
|
42700
44825
|
logger: options.logger,
|
|
42701
44826
|
defaultRpcTimeoutMs: options.rpcTimeoutMs
|
|
42702
44827
|
});
|
|
42703
|
-
this.uploads = new NativeUploadClient(rpcUploadTransport((method, input) => this.invokeUncheckedRaw(method, input)));
|
|
44828
|
+
this.uploads = new NativeUploadClient(rpcUploadTransport((method, input, signal) => this.invokeUncheckedRaw(method, input, { signal }), (error) => error instanceof ProtocolClientError && (error.code === "commit-outcome-unknown" || error.code === "timeout")));
|
|
42704
44829
|
this.startListeners();
|
|
42705
44830
|
}
|
|
42706
44831
|
async connect(signal) {
|
|
42707
44832
|
if (this.authenticationError)
|
|
42708
44833
|
throw this.authenticationError;
|
|
44834
|
+
if (this.logoutInProgress)
|
|
44835
|
+
throw new Error("logout in progress");
|
|
44836
|
+
if (this.closed)
|
|
44837
|
+
throw new Error("SDK client is closed; create a new InlineSdkClient to reconnect");
|
|
42709
44838
|
if (signal?.aborted)
|
|
42710
44839
|
throw new Error("aborted");
|
|
42711
44840
|
if (this.started) {
|
|
@@ -42722,11 +44851,14 @@ class InlineSdkClient {
|
|
|
42722
44851
|
openPromise.catch(() => {});
|
|
42723
44852
|
const abortConnect = () => {
|
|
42724
44853
|
this.rejectOpen(new Error("aborted"));
|
|
42725
|
-
this.
|
|
44854
|
+
this.protocol.stopTransport().catch(() => {});
|
|
42726
44855
|
};
|
|
42727
44856
|
signal?.addEventListener("abort", abortConnect, { once: true });
|
|
42728
44857
|
try {
|
|
42729
44858
|
await this.loadState();
|
|
44859
|
+
if (this.closed || this.logoutInProgress || signal?.aborted) {
|
|
44860
|
+
throw new Error(this.closed ? "closed" : this.logoutInProgress ? "logout in progress" : "aborted");
|
|
44861
|
+
}
|
|
42730
44862
|
await this.protocol.startTransport();
|
|
42731
44863
|
await openPromise;
|
|
42732
44864
|
} catch (error) {
|
|
@@ -42745,6 +44877,7 @@ class InlineSdkClient {
|
|
|
42745
44877
|
async close() {
|
|
42746
44878
|
if (!this.started)
|
|
42747
44879
|
return;
|
|
44880
|
+
this.closed = true;
|
|
42748
44881
|
this.started = false;
|
|
42749
44882
|
this.rejectOpen(new Error("closed"));
|
|
42750
44883
|
this.eventStream.close();
|
|
@@ -42766,6 +44899,7 @@ class InlineSdkClient {
|
|
|
42766
44899
|
this.logoutInProgress = true;
|
|
42767
44900
|
try {
|
|
42768
44901
|
await owner.beginLogout();
|
|
44902
|
+
this.closed = true;
|
|
42769
44903
|
let remoteOutcome = "notSent";
|
|
42770
44904
|
if (this.started) {
|
|
42771
44905
|
try {
|
|
@@ -42783,6 +44917,7 @@ class InlineSdkClient {
|
|
|
42783
44917
|
}
|
|
42784
44918
|
}
|
|
42785
44919
|
await this.close();
|
|
44920
|
+
this.eventStream.close();
|
|
42786
44921
|
await owner.clearCredentials();
|
|
42787
44922
|
await owner.finishLogout();
|
|
42788
44923
|
return { remoteOutcome };
|
|
@@ -42840,6 +44975,9 @@ class InlineSdkClient {
|
|
|
42840
44975
|
const chat = result.getChat.chat;
|
|
42841
44976
|
if (!chat)
|
|
42842
44977
|
throw new Error("getChat: missing chat");
|
|
44978
|
+
if (chat.peerId != null && this.isReliableChatPeer(chat.peerId)) {
|
|
44979
|
+
this.rememberChatPeer(chat.id, chat.peerId);
|
|
44980
|
+
}
|
|
42843
44981
|
const dialogFollowMode = result.getChat.dialog?.followMode;
|
|
42844
44982
|
return {
|
|
42845
44983
|
chatId: chat.id,
|
|
@@ -43152,6 +45290,8 @@ class InlineSdkClient {
|
|
|
43152
45290
|
return result;
|
|
43153
45291
|
}
|
|
43154
45292
|
async callRpcWithSemanticPolicy(method, input, options) {
|
|
45293
|
+
if (this.closed)
|
|
45294
|
+
throw new Error("SDK client is closed; create a new InlineSdkClient to reconnect");
|
|
43155
45295
|
if (this.logoutInProgress && method !== Method.LOG_OUT) {
|
|
43156
45296
|
throw new Error("logout in progress");
|
|
43157
45297
|
}
|
|
@@ -43210,6 +45350,7 @@ class InlineSdkClient {
|
|
|
43210
45350
|
const failure = error instanceof Error ? error : new Error("listener-crashed");
|
|
43211
45351
|
this.log.error?.("SDK listener crashed", failure);
|
|
43212
45352
|
this.started = false;
|
|
45353
|
+
this.closed = true;
|
|
43213
45354
|
this.rejectOpen(failure);
|
|
43214
45355
|
this.eventStream.fail(failure);
|
|
43215
45356
|
this.protocol.stopTransport().catch((stopError) => {
|
|
@@ -43439,6 +45580,9 @@ class InlineSdkClient {
|
|
|
43439
45580
|
const message = update.update.newMessage.message;
|
|
43440
45581
|
if (!message)
|
|
43441
45582
|
return null;
|
|
45583
|
+
if (message.peerId != null && this.isReliableChatPeer(message.peerId)) {
|
|
45584
|
+
this.rememberChatPeer(message.chatId, message.peerId);
|
|
45585
|
+
}
|
|
43442
45586
|
return deliver({
|
|
43443
45587
|
kind: "message.new",
|
|
43444
45588
|
chatId: message.chatId,
|
|
@@ -43451,6 +45595,9 @@ class InlineSdkClient {
|
|
|
43451
45595
|
const message = update.update.editMessage.message;
|
|
43452
45596
|
if (!message)
|
|
43453
45597
|
return null;
|
|
45598
|
+
if (message.peerId != null && this.isReliableChatPeer(message.peerId)) {
|
|
45599
|
+
this.rememberChatPeer(message.chatId, message.peerId);
|
|
45600
|
+
}
|
|
43454
45601
|
return deliver({
|
|
43455
45602
|
kind: "message.edit",
|
|
43456
45603
|
chatId: message.chatId,
|
|
@@ -43461,9 +45608,12 @@ class InlineSdkClient {
|
|
|
43461
45608
|
}
|
|
43462
45609
|
case "deleteMessages": {
|
|
43463
45610
|
const payload = update.update.deleteMessages;
|
|
43464
|
-
const chatId =
|
|
45611
|
+
const chatId = this.chatIdForPeerScopedUpdate(payload.peerId, options?.bucket);
|
|
43465
45612
|
if (!chatId) {
|
|
43466
|
-
this.log.warn?.("
|
|
45613
|
+
this.log.warn?.("Unable to resolve deleteMessages update to one chat bucket", {
|
|
45614
|
+
source: options?.source ?? "live",
|
|
45615
|
+
peerKind: payload.peerId?.type.oneofKind ?? "missing"
|
|
45616
|
+
});
|
|
43467
45617
|
return null;
|
|
43468
45618
|
}
|
|
43469
45619
|
return deliver({
|
|
@@ -43495,8 +45645,15 @@ class InlineSdkClient {
|
|
|
43495
45645
|
}, () => this.bumpSpaceSeq(spaceId, seq, options?.source));
|
|
43496
45646
|
}
|
|
43497
45647
|
const peerId = payload.target.oneofKind === "peerId" ? payload.target.peerId : undefined;
|
|
43498
|
-
if (peerId
|
|
43499
|
-
const chatId = peerId
|
|
45648
|
+
if (peerId) {
|
|
45649
|
+
const chatId = this.chatIdForPeerScopedUpdate(peerId, options?.bucket);
|
|
45650
|
+
if (!chatId) {
|
|
45651
|
+
this.log.warn?.("Unable to resolve clearChatHistory update to one chat bucket", {
|
|
45652
|
+
source: options?.source ?? "live",
|
|
45653
|
+
peerKind: peerId.type.oneofKind ?? "missing"
|
|
45654
|
+
});
|
|
45655
|
+
return null;
|
|
45656
|
+
}
|
|
43500
45657
|
return deliver({
|
|
43501
45658
|
kind: "message.history.clear",
|
|
43502
45659
|
chatId,
|
|
@@ -43509,19 +45666,6 @@ class InlineSdkClient {
|
|
|
43509
45666
|
date
|
|
43510
45667
|
}, () => this.bumpChatSeq(chatId, seq, options?.source));
|
|
43511
45668
|
}
|
|
43512
|
-
if (peerId?.type.oneofKind === "user") {
|
|
43513
|
-
return deliver({
|
|
43514
|
-
kind: "message.history.clear",
|
|
43515
|
-
userId: peerId.type.user.userId,
|
|
43516
|
-
...payload.beforeDate != null ? { beforeDate: payload.beforeDate } : {},
|
|
43517
|
-
deleteReplyThreads: payload.deleteReplyThreads,
|
|
43518
|
-
deletedChatIds: payload.deletedChatIds,
|
|
43519
|
-
orphanedChatIds: payload.orphanedChatIds,
|
|
43520
|
-
detachedChatIds: payload.detachedChatIds,
|
|
43521
|
-
seq,
|
|
43522
|
-
date
|
|
43523
|
-
}, () => this.bumpUserSeq(seq, options?.source));
|
|
43524
|
-
}
|
|
43525
45669
|
this.log.warn?.("Skipping clearChatHistory update without peer target", peerId);
|
|
43526
45670
|
return null;
|
|
43527
45671
|
}
|
|
@@ -43980,6 +46124,16 @@ class InlineSdkClient {
|
|
|
43980
46124
|
}
|
|
43981
46125
|
case "deleteChat":
|
|
43982
46126
|
return this.chatBucketsForPeer(update.update.deleteChat.peerId);
|
|
46127
|
+
case "deleteMessages":
|
|
46128
|
+
return this.chatBucketsForPeer(update.update.deleteMessages.peerId);
|
|
46129
|
+
case "clearChatHistory": {
|
|
46130
|
+
const target = update.update.clearChatHistory.target;
|
|
46131
|
+
if (target?.oneofKind === "peerId")
|
|
46132
|
+
return this.chatBucketsForPeer(target.peerId);
|
|
46133
|
+
if (target?.oneofKind === "spaceId")
|
|
46134
|
+
return [{ kind: "space", spaceId: target.spaceId }];
|
|
46135
|
+
return [];
|
|
46136
|
+
}
|
|
43983
46137
|
case "pinnedMessages":
|
|
43984
46138
|
return this.chatBucketsForPeer(update.update.pinnedMessages.peerId);
|
|
43985
46139
|
case "chatSkipPts":
|
|
@@ -44033,12 +46187,23 @@ class InlineSdkClient {
|
|
|
44033
46187
|
matches.push({ kind: "chat", chatId, peer });
|
|
44034
46188
|
} catch {}
|
|
44035
46189
|
}
|
|
44036
|
-
return matches;
|
|
46190
|
+
return matches.length === 1 ? matches : [];
|
|
44037
46191
|
}
|
|
44038
46192
|
default:
|
|
44039
46193
|
return [];
|
|
44040
46194
|
}
|
|
44041
46195
|
}
|
|
46196
|
+
chatIdForPeerScopedUpdate(peer, catchUpBucket) {
|
|
46197
|
+
if (catchUpBucket) {
|
|
46198
|
+
if (catchUpBucket.kind !== "chat")
|
|
46199
|
+
return null;
|
|
46200
|
+
return catchUpBucket.chatId;
|
|
46201
|
+
}
|
|
46202
|
+
if (peer?.type.oneofKind === "chat")
|
|
46203
|
+
return peer.type.chat.chatId;
|
|
46204
|
+
const matches = this.chatBucketsForPeer(peer);
|
|
46205
|
+
return matches.length === 1 && matches[0]?.kind === "chat" ? matches[0].chatId : null;
|
|
46206
|
+
}
|
|
44042
46207
|
peerFromEvent(event) {
|
|
44043
46208
|
switch (event.kind) {
|
|
44044
46209
|
case "message.new":
|
|
@@ -44124,6 +46289,7 @@ class InlineSdkClient {
|
|
|
44124
46289
|
async doCatchUpUser(startSeq) {
|
|
44125
46290
|
let cursor = startSeq;
|
|
44126
46291
|
while (true) {
|
|
46292
|
+
const requestEndSeq = this.catchUpRequestEndSeq(cursor);
|
|
44127
46293
|
const result = await this.invoke(Method.GET_UPDATES, {
|
|
44128
46294
|
oneofKind: "getUpdates",
|
|
44129
46295
|
getUpdates: GetUpdatesInput.create({
|
|
@@ -44134,6 +46300,7 @@ class InlineSdkClient {
|
|
|
44134
46300
|
}
|
|
44135
46301
|
}),
|
|
44136
46302
|
startSeq: BigInt(cursor),
|
|
46303
|
+
...requestEndSeq != null ? { seqEnd: BigInt(requestEndSeq) } : {},
|
|
44137
46304
|
totalLimit: defaultCatchUpTotalLimit,
|
|
44138
46305
|
limit: defaultCatchUpPageLimit
|
|
44139
46306
|
})
|
|
@@ -44146,15 +46313,26 @@ class InlineSdkClient {
|
|
|
44146
46313
|
return;
|
|
44147
46314
|
}
|
|
44148
46315
|
if (payload.resultType === GetUpdatesResult_ResultType.TOO_LONG) {
|
|
44149
|
-
|
|
46316
|
+
const shouldContinue = this.shouldContinueBoundedCatchUp(cursor, deliveredSeq, requestEndSeq);
|
|
46317
|
+
const repaired = await this.repairUpdateBucketAuthoritatively({ kind: "user" }, deliveredSeq, payload.date, !shouldContinue);
|
|
46318
|
+
if (repaired && shouldContinue) {
|
|
46319
|
+
cursor = deliveredSeq;
|
|
46320
|
+
continue;
|
|
46321
|
+
}
|
|
44150
46322
|
return;
|
|
44151
46323
|
}
|
|
44152
46324
|
const requiresSnapshotRepair = this.validateCatchUpPage(payload, cursor, { kind: "user" });
|
|
44153
46325
|
if (requiresSnapshotRepair == null)
|
|
44154
46326
|
return;
|
|
44155
46327
|
if (requiresSnapshotRepair) {
|
|
44156
|
-
|
|
44157
|
-
|
|
46328
|
+
if (this.options.repairUpdatesBucket) {
|
|
46329
|
+
await this.repairUpdateBucketAuthoritatively({ kind: "user" }, deliveredSeq, payload.date);
|
|
46330
|
+
return;
|
|
46331
|
+
}
|
|
46332
|
+
this.log.warn?.("GET_UPDATES advanced past a snapshot-repair marker without a host snapshot owner", {
|
|
46333
|
+
bucket: "user",
|
|
46334
|
+
deliveredSeq
|
|
46335
|
+
});
|
|
44158
46336
|
}
|
|
44159
46337
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
44160
46338
|
this.markUpdateBucketDegraded({ kind: "user" });
|
|
@@ -44169,6 +46347,10 @@ class InlineSdkClient {
|
|
|
44169
46347
|
this.bumpUserSeq(deliveredSeq);
|
|
44170
46348
|
this.scheduleStateSave();
|
|
44171
46349
|
if (payload.final) {
|
|
46350
|
+
if (this.shouldContinueBoundedCatchUp(cursor, deliveredSeq, requestEndSeq)) {
|
|
46351
|
+
cursor = deliveredSeq;
|
|
46352
|
+
continue;
|
|
46353
|
+
}
|
|
44172
46354
|
this.satisfyDiscoveryBucket({ kind: "user" }, deliveredSeq);
|
|
44173
46355
|
this.clearUpdateBucketDegraded({ kind: "user" });
|
|
44174
46356
|
return;
|
|
@@ -44234,8 +46416,8 @@ class InlineSdkClient {
|
|
|
44234
46416
|
}
|
|
44235
46417
|
async doCatchUpChat(chatId, peer, startSeq, endSeq) {
|
|
44236
46418
|
let cursor = startSeq;
|
|
44237
|
-
|
|
44238
|
-
|
|
46419
|
+
while (endSeq == null || cursor < endSeq) {
|
|
46420
|
+
const requestEndSeq = this.catchUpRequestEndSeq(cursor, endSeq);
|
|
44239
46421
|
const result = await this.invoke(Method.GET_UPDATES, {
|
|
44240
46422
|
oneofKind: "getUpdates",
|
|
44241
46423
|
getUpdates: GetUpdatesInput.create({
|
|
@@ -44256,7 +46438,21 @@ class InlineSdkClient {
|
|
|
44256
46438
|
const payload = result.getUpdates;
|
|
44257
46439
|
if (payload.resultType === GetUpdatesResult_ResultType.TOO_LONG) {
|
|
44258
46440
|
const deliveredSeq2 = Number(payload.seq ?? 0n);
|
|
44259
|
-
|
|
46441
|
+
if (endSeq != null && requestEndSeq != null && deliveredSeq2 !== requestEndSeq) {
|
|
46442
|
+
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
46443
|
+
this.log.warn?.("GET_UPDATES TOO_LONG pointer did not cover the requested chat target", {
|
|
46444
|
+
chatId: chatId.toString(),
|
|
46445
|
+
requestedEndSeq: requestEndSeq,
|
|
46446
|
+
deliveredSeq: deliveredSeq2
|
|
46447
|
+
});
|
|
46448
|
+
return true;
|
|
46449
|
+
}
|
|
46450
|
+
const shouldContinue = this.shouldContinueBoundedCatchUp(cursor, deliveredSeq2, requestEndSeq, endSeq);
|
|
46451
|
+
const repaired = await this.repairUpdateBucketAuthoritatively({ kind: "chat", chatId, peer }, deliveredSeq2, payload.date, !shouldContinue);
|
|
46452
|
+
if (repaired && shouldContinue) {
|
|
46453
|
+
cursor = deliveredSeq2;
|
|
46454
|
+
continue;
|
|
46455
|
+
}
|
|
44260
46456
|
return true;
|
|
44261
46457
|
}
|
|
44262
46458
|
const deliveredSeq = Number(payload.seq ?? 0n);
|
|
@@ -44269,8 +46465,14 @@ class InlineSdkClient {
|
|
|
44269
46465
|
if (requiresSnapshotRepair == null)
|
|
44270
46466
|
return true;
|
|
44271
46467
|
if (requiresSnapshotRepair) {
|
|
44272
|
-
|
|
44273
|
-
|
|
46468
|
+
if (this.options.repairUpdatesBucket) {
|
|
46469
|
+
await this.repairUpdateBucketAuthoritatively({ kind: "chat", chatId, peer }, deliveredSeq, payload.date);
|
|
46470
|
+
return true;
|
|
46471
|
+
}
|
|
46472
|
+
this.log.warn?.("GET_UPDATES advanced past a snapshot-repair marker without a host snapshot owner", {
|
|
46473
|
+
bucket: this.updateBucketKey({ kind: "chat", chatId }),
|
|
46474
|
+
deliveredSeq
|
|
46475
|
+
});
|
|
44274
46476
|
}
|
|
44275
46477
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
44276
46478
|
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
@@ -44286,6 +46488,19 @@ class InlineSdkClient {
|
|
|
44286
46488
|
this.bumpChatSeq(chatId, deliveredSeq);
|
|
44287
46489
|
this.scheduleStateSave();
|
|
44288
46490
|
if (payload.final) {
|
|
46491
|
+
if (this.shouldContinueBoundedCatchUp(cursor, deliveredSeq, requestEndSeq, endSeq)) {
|
|
46492
|
+
cursor = deliveredSeq;
|
|
46493
|
+
continue;
|
|
46494
|
+
}
|
|
46495
|
+
if (endSeq != null && deliveredSeq < endSeq) {
|
|
46496
|
+
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
46497
|
+
this.log.warn?.("GET_UPDATES final chat page remained behind the requested target", {
|
|
46498
|
+
chatId: chatId.toString(),
|
|
46499
|
+
requestedEndSeq: endSeq,
|
|
46500
|
+
deliveredSeq
|
|
46501
|
+
});
|
|
46502
|
+
return true;
|
|
46503
|
+
}
|
|
44289
46504
|
this.satisfyDiscoveryBucket({ kind: "chat", chatId, peer }, deliveredSeq);
|
|
44290
46505
|
this.clearUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
44291
46506
|
return true;
|
|
@@ -44349,8 +46564,8 @@ class InlineSdkClient {
|
|
|
44349
46564
|
}
|
|
44350
46565
|
async doCatchUpSpace(spaceId, startSeq, endSeq) {
|
|
44351
46566
|
let cursor = startSeq;
|
|
44352
|
-
|
|
44353
|
-
|
|
46567
|
+
while (endSeq == null || cursor < endSeq) {
|
|
46568
|
+
const requestEndSeq = this.catchUpRequestEndSeq(cursor, endSeq);
|
|
44354
46569
|
const result = await this.invoke(Method.GET_UPDATES, {
|
|
44355
46570
|
oneofKind: "getUpdates",
|
|
44356
46571
|
getUpdates: GetUpdatesInput.create({
|
|
@@ -44371,7 +46586,21 @@ class InlineSdkClient {
|
|
|
44371
46586
|
const payload = result.getUpdates;
|
|
44372
46587
|
if (payload.resultType === GetUpdatesResult_ResultType.TOO_LONG) {
|
|
44373
46588
|
const deliveredSeq2 = Number(payload.seq ?? 0n);
|
|
44374
|
-
|
|
46589
|
+
if (endSeq != null && requestEndSeq != null && deliveredSeq2 !== requestEndSeq) {
|
|
46590
|
+
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
46591
|
+
this.log.warn?.("GET_UPDATES TOO_LONG pointer did not cover the requested space target", {
|
|
46592
|
+
spaceId: spaceId.toString(),
|
|
46593
|
+
requestedEndSeq: requestEndSeq,
|
|
46594
|
+
deliveredSeq: deliveredSeq2
|
|
46595
|
+
});
|
|
46596
|
+
return true;
|
|
46597
|
+
}
|
|
46598
|
+
const shouldContinue = this.shouldContinueBoundedCatchUp(cursor, deliveredSeq2, requestEndSeq, endSeq);
|
|
46599
|
+
const repaired = await this.repairUpdateBucketAuthoritatively({ kind: "space", spaceId }, deliveredSeq2, payload.date, !shouldContinue);
|
|
46600
|
+
if (repaired && shouldContinue) {
|
|
46601
|
+
cursor = deliveredSeq2;
|
|
46602
|
+
continue;
|
|
46603
|
+
}
|
|
44375
46604
|
return true;
|
|
44376
46605
|
}
|
|
44377
46606
|
const deliveredSeq = Number(payload.seq ?? 0n);
|
|
@@ -44386,8 +46615,14 @@ class InlineSdkClient {
|
|
|
44386
46615
|
if (requiresSnapshotRepair == null)
|
|
44387
46616
|
return true;
|
|
44388
46617
|
if (requiresSnapshotRepair) {
|
|
44389
|
-
|
|
44390
|
-
|
|
46618
|
+
if (this.options.repairUpdatesBucket) {
|
|
46619
|
+
await this.repairUpdateBucketAuthoritatively({ kind: "space", spaceId }, deliveredSeq, payload.date);
|
|
46620
|
+
return true;
|
|
46621
|
+
}
|
|
46622
|
+
this.log.warn?.("GET_UPDATES advanced past a snapshot-repair marker without a host snapshot owner", {
|
|
46623
|
+
bucket: this.updateBucketKey({ kind: "space", spaceId }),
|
|
46624
|
+
deliveredSeq
|
|
46625
|
+
});
|
|
44391
46626
|
}
|
|
44392
46627
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
44393
46628
|
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
@@ -44403,6 +46638,19 @@ class InlineSdkClient {
|
|
|
44403
46638
|
this.bumpSpaceSeq(spaceId, deliveredSeq);
|
|
44404
46639
|
this.scheduleStateSave();
|
|
44405
46640
|
if (payload.final) {
|
|
46641
|
+
if (this.shouldContinueBoundedCatchUp(cursor, deliveredSeq, requestEndSeq, endSeq)) {
|
|
46642
|
+
cursor = deliveredSeq;
|
|
46643
|
+
continue;
|
|
46644
|
+
}
|
|
46645
|
+
if (endSeq != null && deliveredSeq < endSeq) {
|
|
46646
|
+
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
46647
|
+
this.log.warn?.("GET_UPDATES final space page remained behind the requested target", {
|
|
46648
|
+
spaceId: spaceId.toString(),
|
|
46649
|
+
requestedEndSeq: endSeq,
|
|
46650
|
+
deliveredSeq
|
|
46651
|
+
});
|
|
46652
|
+
return true;
|
|
46653
|
+
}
|
|
44406
46654
|
this.satisfyDiscoveryBucket({ kind: "space", spaceId }, deliveredSeq);
|
|
44407
46655
|
this.clearUpdateBucketDegraded({ kind: "space", spaceId });
|
|
44408
46656
|
return true;
|
|
@@ -44563,19 +46811,54 @@ class InlineSdkClient {
|
|
|
44563
46811
|
}
|
|
44564
46812
|
return requiresSnapshotRepair;
|
|
44565
46813
|
}
|
|
44566
|
-
|
|
46814
|
+
catchUpRequestEndSeq(cursor, requestedEndSeq) {
|
|
46815
|
+
if (this.options.repairUpdatesBucket)
|
|
46816
|
+
return requestedEndSeq;
|
|
46817
|
+
return Math.min(requestedEndSeq ?? maxDatabaseUpdateSequence, cursor + defaultCatchUpTotalLimit);
|
|
46818
|
+
}
|
|
46819
|
+
shouldContinueBoundedCatchUp(previousCursor, deliveredSeq, requestEndSeq, requestedEndSeq) {
|
|
46820
|
+
if (this.options.repairUpdatesBucket || requestEndSeq == null)
|
|
46821
|
+
return false;
|
|
46822
|
+
if (deliveredSeq <= previousCursor || deliveredSeq !== requestEndSeq)
|
|
46823
|
+
return false;
|
|
46824
|
+
return requestedEndSeq == null ? requestEndSeq < maxDatabaseUpdateSequence : deliveredSeq < requestedEndSeq;
|
|
46825
|
+
}
|
|
46826
|
+
async repairUpdateBucketAuthoritatively(bucket, serverSeq, serverDate, finalize = true) {
|
|
44567
46827
|
if (!Number.isSafeInteger(serverSeq) || serverSeq < 0) {
|
|
44568
46828
|
this.markUpdateBucketDegraded(bucket);
|
|
44569
46829
|
return false;
|
|
44570
46830
|
}
|
|
44571
46831
|
const repair = this.options.repairUpdatesBucket;
|
|
44572
46832
|
if (!repair) {
|
|
44573
|
-
this.
|
|
44574
|
-
|
|
46833
|
+
if (serverSeq <= this.bucketCursor(bucket)) {
|
|
46834
|
+
this.markUpdateBucketDegraded(bucket);
|
|
46835
|
+
this.log.warn?.("GET_UPDATES repair did not advance its bucket; bucket remains degraded", {
|
|
46836
|
+
bucket: this.updateBucketKey(bucket),
|
|
46837
|
+
serverSeq
|
|
46838
|
+
});
|
|
46839
|
+
return false;
|
|
46840
|
+
}
|
|
46841
|
+
switch (bucket.kind) {
|
|
46842
|
+
case "user":
|
|
46843
|
+
this.bumpUserSeq(serverSeq);
|
|
46844
|
+
break;
|
|
46845
|
+
case "chat":
|
|
46846
|
+
this.bumpChatSeq(bucket.chatId, serverSeq);
|
|
46847
|
+
break;
|
|
46848
|
+
case "space":
|
|
46849
|
+
this.bumpSpaceSeq(bucket.spaceId, serverSeq);
|
|
46850
|
+
break;
|
|
46851
|
+
}
|
|
46852
|
+
this.scheduleStateSave();
|
|
46853
|
+
if (finalize) {
|
|
46854
|
+
this.satisfyDiscoveryBucket(bucket, serverSeq);
|
|
46855
|
+
this.clearUpdateBucketDegraded(bucket);
|
|
46856
|
+
}
|
|
46857
|
+
this.log.warn?.("GET_UPDATES could not replay a bounded range; advanced to its server-authoritative cursor", {
|
|
44575
46858
|
bucket: this.updateBucketKey(bucket),
|
|
44576
46859
|
serverSeq
|
|
44577
46860
|
});
|
|
44578
|
-
return
|
|
46861
|
+
return true;
|
|
44579
46862
|
}
|
|
44580
46863
|
try {
|
|
44581
46864
|
const request = { bucket, serverSeq, serverDate };
|
|
@@ -44615,9 +46898,17 @@ class InlineSdkClient {
|
|
|
44615
46898
|
if (update.update.oneofKind === undefined) {
|
|
44616
46899
|
continue;
|
|
44617
46900
|
}
|
|
44618
|
-
const accepted = await this.handleUpdate(update, { source });
|
|
46901
|
+
const accepted = await this.handleUpdate(update, { source, bucket });
|
|
44619
46902
|
if (accepted === true)
|
|
44620
46903
|
continue;
|
|
46904
|
+
if (accepted === false) {
|
|
46905
|
+
this.markUpdateBucketDegraded(bucket);
|
|
46906
|
+
this.log.warn?.("GET_UPDATES event was not acknowledged by the SDK host; cursor remains unchanged", {
|
|
46907
|
+
bucket: this.updateBucketKey(bucket),
|
|
46908
|
+
updateKind: update.update.oneofKind
|
|
46909
|
+
});
|
|
46910
|
+
return false;
|
|
46911
|
+
}
|
|
44621
46912
|
if (!this.isProjectedUpdateKind(update)) {
|
|
44622
46913
|
this.log.debug?.("GET_UPDATES advanced past an update this SDK does not project", {
|
|
44623
46914
|
bucket: this.updateBucketKey(bucket),
|
|
@@ -44625,12 +46916,10 @@ class InlineSdkClient {
|
|
|
44625
46916
|
});
|
|
44626
46917
|
continue;
|
|
44627
46918
|
}
|
|
44628
|
-
this.
|
|
44629
|
-
this.log.warn?.("GET_UPDATES returned an update the SDK could not durably accept; cursor remains unchanged", {
|
|
46919
|
+
this.log.warn?.("GET_UPDATES authoritatively advanced past an update the SDK could not project", {
|
|
44630
46920
|
bucket: this.updateBucketKey(bucket),
|
|
44631
46921
|
updateKind: update.update.oneofKind
|
|
44632
46922
|
});
|
|
44633
|
-
return false;
|
|
44634
46923
|
}
|
|
44635
46924
|
return true;
|
|
44636
46925
|
}
|
|
@@ -45757,6 +48046,179 @@ function readUsers(result, kind) {
|
|
|
45757
48046
|
return Array.isArray(users) ? users : [];
|
|
45758
48047
|
}
|
|
45759
48048
|
|
|
48049
|
+
// src/sidecar/telemetry.ts
|
|
48050
|
+
import { randomUUID } from "node:crypto";
|
|
48051
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
48052
|
+
var TELEMETRY_TIMEOUT_MS = 2000;
|
|
48053
|
+
var TELEMETRY_DEDUP_MS = 5 * 60000;
|
|
48054
|
+
var MAX_ERROR_MESSAGE_LENGTH = 8000;
|
|
48055
|
+
var MAX_STACK_FRAMES = 80;
|
|
48056
|
+
var SENSITIVE_ENV_NAME = /(?:token|secret|password|api[_-]?key|authorization)/i;
|
|
48057
|
+
var lastReports = new Map;
|
|
48058
|
+
var releasePromise;
|
|
48059
|
+
var HERMES_TELEMETRY_EXIT_TIMEOUT_MS = TELEMETRY_TIMEOUT_MS + 250;
|
|
48060
|
+
function telemetryDisabled(env = process.env) {
|
|
48061
|
+
const disabled = (value) => value != null && ["1", "true", "yes", "on"].includes(value.trim().toLowerCase());
|
|
48062
|
+
const optedOut = (value) => value != null && ["0", "false", "off"].includes(value.trim().toLowerCase());
|
|
48063
|
+
return disabled(env.DO_NOT_TRACK) || optedOut(env.INLINE_PLUGIN_TELEMETRY);
|
|
48064
|
+
}
|
|
48065
|
+
function resolveDsn(env = process.env) {
|
|
48066
|
+
if (telemetryDisabled(env))
|
|
48067
|
+
return "";
|
|
48068
|
+
return env.INLINE_HERMES_SENTRY_DSN?.trim() ?? "";
|
|
48069
|
+
}
|
|
48070
|
+
function sensitiveValues(env = process.env) {
|
|
48071
|
+
return Object.entries(env).filter(([name, value]) => SENSITIVE_ENV_NAME.test(name) && (value?.length ?? 0) >= 8).map(([, value]) => value);
|
|
48072
|
+
}
|
|
48073
|
+
function redactHermesTelemetryText(value, env = process.env) {
|
|
48074
|
+
let text = String(value ?? "").replace(/\b(Authorization\s*[:=]\s*)(?:Basic|Bearer)\s+\S+/gi, "$1[REDACTED]").replace(/\b((?:Basic|Bearer)\s+)\S+/gi, "$1[REDACTED]").replace(/(https?:\/\/)[^/\s:@]+:[^@\s/]+@/gi, "$1[REDACTED]@").replace(/([?&](?:access_token|auth|authorization|key|password|secret|token)[^=\s&]*)=([^&\s]+)/gi, "$1=[REDACTED]").replace(/\b([A-Za-z0-9_-]*(?:token|secret|password|api[_-]?key|authorization)[A-Za-z0-9_-]*)\s*([=:])\s*\S+/gi, "$1$2[REDACTED]");
|
|
48075
|
+
for (const secret of sensitiveValues(env)) {
|
|
48076
|
+
text = text.replaceAll(secret, "[REDACTED]");
|
|
48077
|
+
}
|
|
48078
|
+
return text.slice(0, MAX_ERROR_MESSAGE_LENGTH);
|
|
48079
|
+
}
|
|
48080
|
+
function safeTag(value) {
|
|
48081
|
+
const normalized = value.trim().toLowerCase();
|
|
48082
|
+
return normalized.length > 0 && normalized.length <= 80 && /^[a-z0-9._-]+$/.test(normalized) ? normalized : "unknown";
|
|
48083
|
+
}
|
|
48084
|
+
function parseStack(error, env) {
|
|
48085
|
+
const frames = [];
|
|
48086
|
+
for (const rawLine of (error.stack ?? "").split(`
|
|
48087
|
+
`).slice(1)) {
|
|
48088
|
+
const line = redactHermesTelemetryText(rawLine.trim(), env);
|
|
48089
|
+
const match = /^at\s+(?:(.*?)\s+\()?(.+?):(\d+):(\d+)\)?$/.exec(line);
|
|
48090
|
+
if (!match)
|
|
48091
|
+
continue;
|
|
48092
|
+
const filename = match[2];
|
|
48093
|
+
frames.push({
|
|
48094
|
+
filename,
|
|
48095
|
+
abs_path: filename,
|
|
48096
|
+
function: match[1] || "<anonymous>",
|
|
48097
|
+
lineno: Number(match[3]),
|
|
48098
|
+
colno: Number(match[4]),
|
|
48099
|
+
in_app: filename.includes("@inline-chat/hermes-agent-adapter") || filename.includes("/hermes-agent/") || filename.endsWith("/plugin/inline/sidecar/index.mjs")
|
|
48100
|
+
});
|
|
48101
|
+
if (frames.length >= MAX_STACK_FRAMES)
|
|
48102
|
+
break;
|
|
48103
|
+
}
|
|
48104
|
+
return frames.reverse();
|
|
48105
|
+
}
|
|
48106
|
+
function buildHermesTelemetryEvent(operation, error, options = {}) {
|
|
48107
|
+
const env = options.env ?? process.env;
|
|
48108
|
+
const exception = error instanceof Error ? error : new Error(String(error ?? "Unknown error"));
|
|
48109
|
+
const frames = parseStack(exception, env);
|
|
48110
|
+
return {
|
|
48111
|
+
event_id: randomUUID().replaceAll("-", ""),
|
|
48112
|
+
timestamp: new Date().toISOString(),
|
|
48113
|
+
platform: "javascript",
|
|
48114
|
+
level: "error",
|
|
48115
|
+
logger: "inline.hermes.sidecar",
|
|
48116
|
+
exception: {
|
|
48117
|
+
values: [{
|
|
48118
|
+
type: redactHermesTelemetryText(exception.name || "Error", env),
|
|
48119
|
+
value: redactHermesTelemetryText(exception.message || String(error), env),
|
|
48120
|
+
mechanism: {
|
|
48121
|
+
type: "inline_plugin_boundary",
|
|
48122
|
+
handled: options.handled ?? true
|
|
48123
|
+
},
|
|
48124
|
+
...frames.length > 0 ? { stacktrace: { frames } } : {}
|
|
48125
|
+
}]
|
|
48126
|
+
},
|
|
48127
|
+
tags: {
|
|
48128
|
+
operation: safeTag(operation),
|
|
48129
|
+
component: "sidecar",
|
|
48130
|
+
runtime: "node",
|
|
48131
|
+
os: process.platform,
|
|
48132
|
+
arch: process.arch
|
|
48133
|
+
},
|
|
48134
|
+
sdk: { name: "inline.plugin.telemetry", version: "1" }
|
|
48135
|
+
};
|
|
48136
|
+
}
|
|
48137
|
+
async function resolveRelease() {
|
|
48138
|
+
releasePromise ??= (async () => {
|
|
48139
|
+
for (const candidate of [
|
|
48140
|
+
new URL("../../../package.json", import.meta.url),
|
|
48141
|
+
new URL("../../package.json", import.meta.url)
|
|
48142
|
+
]) {
|
|
48143
|
+
try {
|
|
48144
|
+
const parsed = JSON.parse(await readFile2(candidate, "utf8"));
|
|
48145
|
+
if (typeof parsed.version === "string" && parsed.version.trim()) {
|
|
48146
|
+
return `inline-hermes-plugin@${parsed.version.trim()}`;
|
|
48147
|
+
}
|
|
48148
|
+
} catch {
|
|
48149
|
+
continue;
|
|
48150
|
+
}
|
|
48151
|
+
}
|
|
48152
|
+
return;
|
|
48153
|
+
})();
|
|
48154
|
+
return releasePromise;
|
|
48155
|
+
}
|
|
48156
|
+
function parseSentryDsn(dsn) {
|
|
48157
|
+
try {
|
|
48158
|
+
const parsed = new URL(dsn);
|
|
48159
|
+
if (!/^https?:$/.test(parsed.protocol) || !parsed.username)
|
|
48160
|
+
return null;
|
|
48161
|
+
const parts = parsed.pathname.split("/").filter(Boolean);
|
|
48162
|
+
const projectId = parts.pop();
|
|
48163
|
+
if (!projectId || !/^\d+$/.test(projectId))
|
|
48164
|
+
return null;
|
|
48165
|
+
const prefix = parts.length > 0 ? `/${parts.join("/")}` : "";
|
|
48166
|
+
return {
|
|
48167
|
+
endpoint: `${parsed.origin}${prefix}/api/${projectId}/envelope/`,
|
|
48168
|
+
publicKey: parsed.username
|
|
48169
|
+
};
|
|
48170
|
+
} catch {
|
|
48171
|
+
return null;
|
|
48172
|
+
}
|
|
48173
|
+
}
|
|
48174
|
+
async function sendHermesPluginError(operation, error, options = {}) {
|
|
48175
|
+
const env = options.env ?? process.env;
|
|
48176
|
+
const dsn = resolveDsn(env);
|
|
48177
|
+
const target = parseSentryDsn(dsn);
|
|
48178
|
+
if (!target)
|
|
48179
|
+
return false;
|
|
48180
|
+
const event = buildHermesTelemetryEvent(operation, error, options);
|
|
48181
|
+
const release = await resolveRelease();
|
|
48182
|
+
if (release)
|
|
48183
|
+
event.release = release;
|
|
48184
|
+
const envelope = [
|
|
48185
|
+
JSON.stringify({ event_id: event.event_id, dsn, sent_at: event.timestamp }),
|
|
48186
|
+
JSON.stringify({ type: "event", content_type: "application/json" }),
|
|
48187
|
+
JSON.stringify(event)
|
|
48188
|
+
].join(`
|
|
48189
|
+
`);
|
|
48190
|
+
const controller = new AbortController;
|
|
48191
|
+
const timeout = setTimeout(() => controller.abort(), TELEMETRY_TIMEOUT_MS);
|
|
48192
|
+
timeout.unref?.();
|
|
48193
|
+
try {
|
|
48194
|
+
const response = await fetch(target.endpoint, {
|
|
48195
|
+
method: "POST",
|
|
48196
|
+
headers: {
|
|
48197
|
+
"content-type": "application/x-sentry-envelope",
|
|
48198
|
+
"x-sentry-auth": `Sentry sentry_version=7, sentry_key=${target.publicKey}, sentry_client=inline.plugin.telemetry/1`
|
|
48199
|
+
},
|
|
48200
|
+
body: envelope,
|
|
48201
|
+
signal: controller.signal
|
|
48202
|
+
});
|
|
48203
|
+
return response.ok;
|
|
48204
|
+
} catch {
|
|
48205
|
+
return false;
|
|
48206
|
+
} finally {
|
|
48207
|
+
clearTimeout(timeout);
|
|
48208
|
+
}
|
|
48209
|
+
}
|
|
48210
|
+
function reportHermesPluginError(operation, error, options = {}) {
|
|
48211
|
+
try {
|
|
48212
|
+
const exception = error instanceof Error ? error : new Error(String(error ?? "Unknown error"));
|
|
48213
|
+
const key = `${safeTag(operation)}\x00${exception.name}\x00${redactHermesTelemetryText(exception.message)}`;
|
|
48214
|
+
const now = Date.now();
|
|
48215
|
+
if (now - (lastReports.get(key) ?? 0) < TELEMETRY_DEDUP_MS)
|
|
48216
|
+
return;
|
|
48217
|
+
lastReports.set(key, now);
|
|
48218
|
+
sendHermesPluginError(operation, exception, options).catch(() => {});
|
|
48219
|
+
} catch {}
|
|
48220
|
+
}
|
|
48221
|
+
|
|
45760
48222
|
// src/sidecar/index.ts
|
|
45761
48223
|
var DIALOG_FOLLOW_MODE_UNFOLLOWED = 2;
|
|
45762
48224
|
var token = process.env.INLINE_TOKEN || process.env.INLINE_BOT_TOKEN || "";
|
|
@@ -45789,6 +48251,7 @@ var clientOptions = {
|
|
|
45789
48251
|
baseUrl,
|
|
45790
48252
|
state: new JsonFileStateStore(statePath),
|
|
45791
48253
|
onAuthenticationError: (error) => {
|
|
48254
|
+
reportHermesPluginError("sdk.authentication", error);
|
|
45792
48255
|
connected = false;
|
|
45793
48256
|
connecting = false;
|
|
45794
48257
|
connectError = redactError(error);
|
|
@@ -45826,7 +48289,10 @@ async function connectClientLoop() {
|
|
|
45826
48289
|
capabilities: [{ kind: BotCapability_Kind.CHAT_SETTINGS, version: 1 }]
|
|
45827
48290
|
}),
|
|
45828
48291
|
isCancelled: () => stopping,
|
|
45829
|
-
onFailure: (error, willRetry) =>
|
|
48292
|
+
onFailure: (error, willRetry) => {
|
|
48293
|
+
reportHermesPluginError("sdk.capability_registration", error);
|
|
48294
|
+
console.error(`inline-sidecar: capability registration failed: ${redactError(error)}${willRetry ? "; retrying" : ""}`);
|
|
48295
|
+
}
|
|
45830
48296
|
});
|
|
45831
48297
|
connected = true;
|
|
45832
48298
|
connecting = false;
|
|
@@ -45835,6 +48301,7 @@ async function connectClientLoop() {
|
|
|
45835
48301
|
console.error(`inline-sidecar: connected as ${meId}`);
|
|
45836
48302
|
return;
|
|
45837
48303
|
} catch (error) {
|
|
48304
|
+
reportHermesPluginError("sdk.connect", error);
|
|
45838
48305
|
connected = false;
|
|
45839
48306
|
connecting = false;
|
|
45840
48307
|
connectError = redactError(error);
|
|
@@ -45861,6 +48328,7 @@ async function consumeEvents() {
|
|
|
45861
48328
|
}
|
|
45862
48329
|
} catch (error) {
|
|
45863
48330
|
if (!stopping) {
|
|
48331
|
+
reportHermesPluginError("inbound.loop", error, { handled: false });
|
|
45864
48332
|
connected = false;
|
|
45865
48333
|
connecting = false;
|
|
45866
48334
|
connectError = redactError(error);
|
|
@@ -46091,7 +48559,7 @@ async function endpointSendAttachment(res, body) {
|
|
|
46091
48559
|
}
|
|
46092
48560
|
const upload = await client.uploadFile({
|
|
46093
48561
|
type: kind,
|
|
46094
|
-
file: await
|
|
48562
|
+
file: await readFile3(filePath),
|
|
46095
48563
|
fileName,
|
|
46096
48564
|
...contentType ? { contentType } : {}
|
|
46097
48565
|
});
|
|
@@ -46966,6 +49434,7 @@ function methodName(method) {
|
|
|
46966
49434
|
var client = createClient(clientOptions);
|
|
46967
49435
|
var userDirectory = new InlineUserDirectory(client, {
|
|
46968
49436
|
onError: (operation, error) => {
|
|
49437
|
+
reportHermesPluginError(`sender_directory.${operation}`, error);
|
|
46969
49438
|
console.error(`inline-sidecar: ${operation} sender hydration failed: ${redactError(error)}`);
|
|
46970
49439
|
}
|
|
46971
49440
|
});
|
|
@@ -46974,6 +49443,9 @@ consumeEvents();
|
|
|
46974
49443
|
var server = http.createServer((req, res) => {
|
|
46975
49444
|
handleRequest(req, res).catch((error) => {
|
|
46976
49445
|
const err = normalizeError(error, redactError);
|
|
49446
|
+
if (err.status >= 500) {
|
|
49447
|
+
reportHermesPluginError("endpoint.request", error);
|
|
49448
|
+
}
|
|
46977
49449
|
writeJson(res, err.status, {
|
|
46978
49450
|
ok: false,
|
|
46979
49451
|
error: err.message,
|
|
@@ -47138,7 +49610,7 @@ async function packageVersion() {
|
|
|
47138
49610
|
];
|
|
47139
49611
|
for (const pkgUrl of candidates) {
|
|
47140
49612
|
try {
|
|
47141
|
-
const raw = await
|
|
49613
|
+
const raw = await readFile3(pkgUrl, "utf8");
|
|
47142
49614
|
const parsed = JSON.parse(raw);
|
|
47143
49615
|
if (parsed.version)
|
|
47144
49616
|
return parsed.version;
|
|
@@ -47147,7 +49619,7 @@ async function packageVersion() {
|
|
|
47147
49619
|
}
|
|
47148
49620
|
}
|
|
47149
49621
|
try {
|
|
47150
|
-
const raw = await
|
|
49622
|
+
const raw = await readFile3(new URL("../plugin.yaml", import.meta.url), "utf8");
|
|
47151
49623
|
const match = /^version:\s*['"]?([^'"\n#]+)['"]?/m.exec(raw);
|
|
47152
49624
|
return match?.[1]?.trim() || "0.0.0";
|
|
47153
49625
|
} catch {
|
|
@@ -47176,6 +49648,7 @@ async function shutdown(code) {
|
|
|
47176
49648
|
server.close();
|
|
47177
49649
|
await client.close();
|
|
47178
49650
|
} catch (error) {
|
|
49651
|
+
reportHermesPluginError("sidecar.shutdown", error);
|
|
47179
49652
|
console.error(`inline-sidecar: shutdown error: ${redactError(error)}`);
|
|
47180
49653
|
} finally {
|
|
47181
49654
|
process.exitCode = code;
|
|
@@ -47184,8 +49657,13 @@ async function shutdown(code) {
|
|
|
47184
49657
|
}
|
|
47185
49658
|
process.on("uncaughtException", (error) => {
|
|
47186
49659
|
console.error(`inline-sidecar: uncaught exception: ${redactError(error)}`);
|
|
47187
|
-
process.exit(1);
|
|
49660
|
+
const forcedExit = setTimeout(() => process.exit(1), HERMES_TELEMETRY_EXIT_TIMEOUT_MS);
|
|
49661
|
+
sendHermesPluginError("process.uncaught_exception", error, { handled: false }).catch(() => false).finally(() => {
|
|
49662
|
+
clearTimeout(forcedExit);
|
|
49663
|
+
process.exit(1);
|
|
49664
|
+
});
|
|
47188
49665
|
});
|
|
47189
49666
|
process.on("unhandledRejection", (error) => {
|
|
49667
|
+
reportHermesPluginError("process.unhandled_rejection", error, { handled: false });
|
|
47190
49668
|
console.error(`inline-sidecar: unhandled rejection: ${redactError(error)}`);
|
|
47191
49669
|
});
|