@inline-openclaw/inline 0.0.66 → 0.0.68
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 +15 -7
- package/dist/approval-handler.runtime.js +1148 -71
- package/dist/approval-handler.runtime.js.map +8 -8
- package/dist/channel-plugin-api.js +1845 -510
- package/dist/channel-plugin-api.js.map +14 -13
- package/dist/runtime-register-api.js +1333 -74
- package/dist/runtime-register-api.js.map +13 -10
- package/docs/openclaw-setup.md +1 -1
- package/openclaw.plugin.json +0 -1
- package/package.json +2 -2
|
@@ -5844,6 +5844,20 @@ var UploadFailure_Code;
|
|
|
5844
5844
|
UploadFailure_Code2[UploadFailure_Code2["UPLOAD_FAILURE_PROCESSING"] = 3] = "UPLOAD_FAILURE_PROCESSING";
|
|
5845
5845
|
UploadFailure_Code2[UploadFailure_Code2["UPLOAD_FAILURE_STORAGE"] = 4] = "UPLOAD_FAILURE_STORAGE";
|
|
5846
5846
|
})(UploadFailure_Code || (UploadFailure_Code = {}));
|
|
5847
|
+
var RequestBotFilesystemInput_Operation;
|
|
5848
|
+
(function(RequestBotFilesystemInput_Operation2) {
|
|
5849
|
+
RequestBotFilesystemInput_Operation2[RequestBotFilesystemInput_Operation2["OPERATION_UNSPECIFIED"] = 0] = "OPERATION_UNSPECIFIED";
|
|
5850
|
+
RequestBotFilesystemInput_Operation2[RequestBotFilesystemInput_Operation2["LIST"] = 1] = "LIST";
|
|
5851
|
+
RequestBotFilesystemInput_Operation2[RequestBotFilesystemInput_Operation2["REGISTER_FOLDER"] = 2] = "REGISTER_FOLDER";
|
|
5852
|
+
})(RequestBotFilesystemInput_Operation || (RequestBotFilesystemInput_Operation = {}));
|
|
5853
|
+
var BotFilesystemEntry_Kind;
|
|
5854
|
+
(function(BotFilesystemEntry_Kind2) {
|
|
5855
|
+
BotFilesystemEntry_Kind2[BotFilesystemEntry_Kind2["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
5856
|
+
BotFilesystemEntry_Kind2[BotFilesystemEntry_Kind2["FILE"] = 1] = "FILE";
|
|
5857
|
+
BotFilesystemEntry_Kind2[BotFilesystemEntry_Kind2["DIRECTORY"] = 2] = "DIRECTORY";
|
|
5858
|
+
BotFilesystemEntry_Kind2[BotFilesystemEntry_Kind2["SYMLINK"] = 3] = "SYMLINK";
|
|
5859
|
+
BotFilesystemEntry_Kind2[BotFilesystemEntry_Kind2["OTHER"] = 4] = "OTHER";
|
|
5860
|
+
})(BotFilesystemEntry_Kind || (BotFilesystemEntry_Kind = {}));
|
|
5847
5861
|
var DialogFollowMode;
|
|
5848
5862
|
(function(DialogFollowMode2) {
|
|
5849
5863
|
DialogFollowMode2[DialogFollowMode2["DIALOG_FOLLOW_MODE_UNSPECIFIED"] = 0] = "DIALOG_FOLLOW_MODE_UNSPECIFIED";
|
|
@@ -6042,6 +6056,10 @@ var Method;
|
|
|
6042
6056
|
Method2[Method2["GET_USERS"] = 138] = "GET_USERS";
|
|
6043
6057
|
Method2[Method2["GET_BOT_SKILLS"] = 139] = "GET_BOT_SKILLS";
|
|
6044
6058
|
Method2[Method2["GET_BOT_CONFIGURATION_CATALOG"] = 140] = "GET_BOT_CONFIGURATION_CATALOG";
|
|
6059
|
+
Method2[Method2["UPDATE_DIALOG_TRANSLATION"] = 141] = "UPDATE_DIALOG_TRANSLATION";
|
|
6060
|
+
Method2[Method2["TRANSCRIBE_VOICE_DRAFT"] = 142] = "TRANSCRIBE_VOICE_DRAFT";
|
|
6061
|
+
Method2[Method2["REQUEST_BOT_FILESYSTEM"] = 143] = "REQUEST_BOT_FILESYSTEM";
|
|
6062
|
+
Method2[Method2["ANSWER_BOT_FILESYSTEM"] = 144] = "ANSWER_BOT_FILESYSTEM";
|
|
6045
6063
|
})(Method || (Method = {}));
|
|
6046
6064
|
var GridConnectionUnavailableReason;
|
|
6047
6065
|
(function(GridConnectionUnavailableReason2) {
|
|
@@ -6510,7 +6528,8 @@ class BotEvent$Type extends import_runtime4.MessageType {
|
|
|
6510
6528
|
constructor() {
|
|
6511
6529
|
super("BotEvent", [
|
|
6512
6530
|
{ no: 1, name: "chat_settings_requested", kind: "message", oneof: "event", T: () => BotChatSettingsRequested },
|
|
6513
|
-
{ no: 2, name: "chat_settings_item_invoked", kind: "message", oneof: "event", T: () => BotChatSettingsItemInvoked }
|
|
6531
|
+
{ no: 2, name: "chat_settings_item_invoked", kind: "message", oneof: "event", T: () => BotChatSettingsItemInvoked },
|
|
6532
|
+
{ no: 3, name: "filesystem_requested", kind: "message", oneof: "event", T: () => BotFilesystemRequested }
|
|
6514
6533
|
]);
|
|
6515
6534
|
}
|
|
6516
6535
|
create(value) {
|
|
@@ -6537,6 +6556,12 @@ class BotEvent$Type extends import_runtime4.MessageType {
|
|
|
6537
6556
|
chatSettingsItemInvoked: BotChatSettingsItemInvoked.internalBinaryRead(reader, reader.uint32(), options, message.event.chatSettingsItemInvoked)
|
|
6538
6557
|
};
|
|
6539
6558
|
break;
|
|
6559
|
+
case 3:
|
|
6560
|
+
message.event = {
|
|
6561
|
+
oneofKind: "filesystemRequested",
|
|
6562
|
+
filesystemRequested: BotFilesystemRequested.internalBinaryRead(reader, reader.uint32(), options, message.event.filesystemRequested)
|
|
6563
|
+
};
|
|
6564
|
+
break;
|
|
6540
6565
|
default:
|
|
6541
6566
|
let u = options.readUnknownField;
|
|
6542
6567
|
if (u === "throw")
|
|
@@ -6553,6 +6578,8 @@ class BotEvent$Type extends import_runtime4.MessageType {
|
|
|
6553
6578
|
BotChatSettingsRequested.internalBinaryWrite(message.event.chatSettingsRequested, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
6554
6579
|
if (message.event.oneofKind === "chatSettingsItemInvoked")
|
|
6555
6580
|
BotChatSettingsItemInvoked.internalBinaryWrite(message.event.chatSettingsItemInvoked, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
6581
|
+
if (message.event.oneofKind === "filesystemRequested")
|
|
6582
|
+
BotFilesystemRequested.internalBinaryWrite(message.event.filesystemRequested, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
6556
6583
|
let u = options.writeUnknownFields;
|
|
6557
6584
|
if (u !== false)
|
|
6558
6585
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -7709,7 +7736,8 @@ class Dialog$Type extends import_runtime4.MessageType {
|
|
|
7709
7736
|
{ no: 15, name: "pinned_order", kind: "scalar", opt: true, T: 9 },
|
|
7710
7737
|
{ no: 16, name: "follow_mode", kind: "enum", opt: true, T: () => ["DialogFollowMode", DialogFollowMode] },
|
|
7711
7738
|
{ no: 17, name: "collapsed_max_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
7712
|
-
{ no: 18, name: "folder_id", kind: "scalar", opt: true, T: 3, L: 0 }
|
|
7739
|
+
{ no: 18, name: "folder_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
7740
|
+
{ no: 19, name: "translation_enabled", kind: "scalar", opt: true, T: 8 }
|
|
7713
7741
|
]);
|
|
7714
7742
|
}
|
|
7715
7743
|
create(value) {
|
|
@@ -7777,6 +7805,9 @@ class Dialog$Type extends import_runtime4.MessageType {
|
|
|
7777
7805
|
case 18:
|
|
7778
7806
|
message.folderId = reader.int64().toBigInt();
|
|
7779
7807
|
break;
|
|
7808
|
+
case 19:
|
|
7809
|
+
message.translationEnabled = reader.bool();
|
|
7810
|
+
break;
|
|
7780
7811
|
default:
|
|
7781
7812
|
let u = options.readUnknownField;
|
|
7782
7813
|
if (u === "throw")
|
|
@@ -7825,6 +7856,8 @@ class Dialog$Type extends import_runtime4.MessageType {
|
|
|
7825
7856
|
writer.tag(17, import_runtime.WireType.Varint).int64(message.collapsedMaxId);
|
|
7826
7857
|
if (message.folderId !== undefined)
|
|
7827
7858
|
writer.tag(18, import_runtime.WireType.Varint).int64(message.folderId);
|
|
7859
|
+
if (message.translationEnabled !== undefined)
|
|
7860
|
+
writer.tag(19, import_runtime.WireType.Varint).bool(message.translationEnabled);
|
|
7828
7861
|
let u = options.writeUnknownFields;
|
|
7829
7862
|
if (u !== false)
|
|
7830
7863
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -13957,7 +13990,11 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
13957
13990
|
{ no: 138, name: "acknowledgeMessages", kind: "message", oneof: "input", T: () => AcknowledgeMessagesInput },
|
|
13958
13991
|
{ no: 139, name: "getUsers", kind: "message", oneof: "input", T: () => GetUsersInput },
|
|
13959
13992
|
{ no: 140, name: "getBotSkills", kind: "message", oneof: "input", T: () => GetBotSkillsInput },
|
|
13960
|
-
{ no: 141, name: "getBotConfigurationCatalog", kind: "message", oneof: "input", T: () => GetBotConfigurationCatalogInput }
|
|
13993
|
+
{ no: 141, name: "getBotConfigurationCatalog", kind: "message", oneof: "input", T: () => GetBotConfigurationCatalogInput },
|
|
13994
|
+
{ no: 142, name: "updateDialogTranslation", kind: "message", oneof: "input", T: () => UpdateDialogTranslationInput },
|
|
13995
|
+
{ no: 143, name: "transcribeVoiceDraft", kind: "message", oneof: "input", T: () => TranscribeVoiceDraftInput },
|
|
13996
|
+
{ no: 144, name: "requestBotFilesystem", kind: "message", oneof: "input", T: () => RequestBotFilesystemInput },
|
|
13997
|
+
{ no: 145, name: "answerBotFilesystem", kind: "message", oneof: "input", T: () => AnswerBotFilesystemInput }
|
|
13961
13998
|
]);
|
|
13962
13999
|
}
|
|
13963
14000
|
create(value) {
|
|
@@ -14810,6 +14847,30 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
14810
14847
|
getBotConfigurationCatalog: GetBotConfigurationCatalogInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getBotConfigurationCatalog)
|
|
14811
14848
|
};
|
|
14812
14849
|
break;
|
|
14850
|
+
case 142:
|
|
14851
|
+
message.input = {
|
|
14852
|
+
oneofKind: "updateDialogTranslation",
|
|
14853
|
+
updateDialogTranslation: UpdateDialogTranslationInput.internalBinaryRead(reader, reader.uint32(), options, message.input.updateDialogTranslation)
|
|
14854
|
+
};
|
|
14855
|
+
break;
|
|
14856
|
+
case 143:
|
|
14857
|
+
message.input = {
|
|
14858
|
+
oneofKind: "transcribeVoiceDraft",
|
|
14859
|
+
transcribeVoiceDraft: TranscribeVoiceDraftInput.internalBinaryRead(reader, reader.uint32(), options, message.input.transcribeVoiceDraft)
|
|
14860
|
+
};
|
|
14861
|
+
break;
|
|
14862
|
+
case 144:
|
|
14863
|
+
message.input = {
|
|
14864
|
+
oneofKind: "requestBotFilesystem",
|
|
14865
|
+
requestBotFilesystem: RequestBotFilesystemInput.internalBinaryRead(reader, reader.uint32(), options, message.input.requestBotFilesystem)
|
|
14866
|
+
};
|
|
14867
|
+
break;
|
|
14868
|
+
case 145:
|
|
14869
|
+
message.input = {
|
|
14870
|
+
oneofKind: "answerBotFilesystem",
|
|
14871
|
+
answerBotFilesystem: AnswerBotFilesystemInput.internalBinaryRead(reader, reader.uint32(), options, message.input.answerBotFilesystem)
|
|
14872
|
+
};
|
|
14873
|
+
break;
|
|
14813
14874
|
default:
|
|
14814
14875
|
let u = options.readUnknownField;
|
|
14815
14876
|
if (u === "throw")
|
|
@@ -15102,6 +15163,14 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
15102
15163
|
GetBotSkillsInput.internalBinaryWrite(message.input.getBotSkills, writer.tag(140, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15103
15164
|
if (message.input.oneofKind === "getBotConfigurationCatalog")
|
|
15104
15165
|
GetBotConfigurationCatalogInput.internalBinaryWrite(message.input.getBotConfigurationCatalog, writer.tag(141, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15166
|
+
if (message.input.oneofKind === "updateDialogTranslation")
|
|
15167
|
+
UpdateDialogTranslationInput.internalBinaryWrite(message.input.updateDialogTranslation, writer.tag(142, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15168
|
+
if (message.input.oneofKind === "transcribeVoiceDraft")
|
|
15169
|
+
TranscribeVoiceDraftInput.internalBinaryWrite(message.input.transcribeVoiceDraft, writer.tag(143, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15170
|
+
if (message.input.oneofKind === "requestBotFilesystem")
|
|
15171
|
+
RequestBotFilesystemInput.internalBinaryWrite(message.input.requestBotFilesystem, writer.tag(144, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15172
|
+
if (message.input.oneofKind === "answerBotFilesystem")
|
|
15173
|
+
AnswerBotFilesystemInput.internalBinaryWrite(message.input.answerBotFilesystem, writer.tag(145, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
15105
15174
|
let u = options.writeUnknownFields;
|
|
15106
15175
|
if (u !== false)
|
|
15107
15176
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -15252,7 +15321,11 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
15252
15321
|
{ no: 138, name: "acknowledgeMessages", kind: "message", oneof: "result", T: () => AcknowledgeMessagesResult },
|
|
15253
15322
|
{ no: 139, name: "getUsers", kind: "message", oneof: "result", T: () => GetUsersResult },
|
|
15254
15323
|
{ no: 140, name: "getBotSkills", kind: "message", oneof: "result", T: () => GetBotSkillsResult },
|
|
15255
|
-
{ no: 141, name: "getBotConfigurationCatalog", kind: "message", oneof: "result", T: () => GetBotConfigurationCatalogResult }
|
|
15324
|
+
{ no: 141, name: "getBotConfigurationCatalog", kind: "message", oneof: "result", T: () => GetBotConfigurationCatalogResult },
|
|
15325
|
+
{ no: 142, name: "updateDialogTranslation", kind: "message", oneof: "result", T: () => UpdateDialogTranslationResult },
|
|
15326
|
+
{ no: 143, name: "transcribeVoiceDraft", kind: "message", oneof: "result", T: () => TranscribeVoiceDraftResult },
|
|
15327
|
+
{ no: 144, name: "requestBotFilesystem", kind: "message", oneof: "result", T: () => RequestBotFilesystemResult },
|
|
15328
|
+
{ no: 145, name: "answerBotFilesystem", kind: "message", oneof: "result", T: () => AnswerBotFilesystemResult }
|
|
15256
15329
|
]);
|
|
15257
15330
|
}
|
|
15258
15331
|
create(value) {
|
|
@@ -16105,6 +16178,30 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
16105
16178
|
getBotConfigurationCatalog: GetBotConfigurationCatalogResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getBotConfigurationCatalog)
|
|
16106
16179
|
};
|
|
16107
16180
|
break;
|
|
16181
|
+
case 142:
|
|
16182
|
+
message.result = {
|
|
16183
|
+
oneofKind: "updateDialogTranslation",
|
|
16184
|
+
updateDialogTranslation: UpdateDialogTranslationResult.internalBinaryRead(reader, reader.uint32(), options, message.result.updateDialogTranslation)
|
|
16185
|
+
};
|
|
16186
|
+
break;
|
|
16187
|
+
case 143:
|
|
16188
|
+
message.result = {
|
|
16189
|
+
oneofKind: "transcribeVoiceDraft",
|
|
16190
|
+
transcribeVoiceDraft: TranscribeVoiceDraftResult.internalBinaryRead(reader, reader.uint32(), options, message.result.transcribeVoiceDraft)
|
|
16191
|
+
};
|
|
16192
|
+
break;
|
|
16193
|
+
case 144:
|
|
16194
|
+
message.result = {
|
|
16195
|
+
oneofKind: "requestBotFilesystem",
|
|
16196
|
+
requestBotFilesystem: RequestBotFilesystemResult.internalBinaryRead(reader, reader.uint32(), options, message.result.requestBotFilesystem)
|
|
16197
|
+
};
|
|
16198
|
+
break;
|
|
16199
|
+
case 145:
|
|
16200
|
+
message.result = {
|
|
16201
|
+
oneofKind: "answerBotFilesystem",
|
|
16202
|
+
answerBotFilesystem: AnswerBotFilesystemResult.internalBinaryRead(reader, reader.uint32(), options, message.result.answerBotFilesystem)
|
|
16203
|
+
};
|
|
16204
|
+
break;
|
|
16108
16205
|
default:
|
|
16109
16206
|
let u = options.readUnknownField;
|
|
16110
16207
|
if (u === "throw")
|
|
@@ -16397,6 +16494,14 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
16397
16494
|
GetBotSkillsResult.internalBinaryWrite(message.result.getBotSkills, writer.tag(140, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16398
16495
|
if (message.result.oneofKind === "getBotConfigurationCatalog")
|
|
16399
16496
|
GetBotConfigurationCatalogResult.internalBinaryWrite(message.result.getBotConfigurationCatalog, writer.tag(141, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16497
|
+
if (message.result.oneofKind === "updateDialogTranslation")
|
|
16498
|
+
UpdateDialogTranslationResult.internalBinaryWrite(message.result.updateDialogTranslation, writer.tag(142, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16499
|
+
if (message.result.oneofKind === "transcribeVoiceDraft")
|
|
16500
|
+
TranscribeVoiceDraftResult.internalBinaryWrite(message.result.transcribeVoiceDraft, writer.tag(143, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16501
|
+
if (message.result.oneofKind === "requestBotFilesystem")
|
|
16502
|
+
RequestBotFilesystemResult.internalBinaryWrite(message.result.requestBotFilesystem, writer.tag(144, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16503
|
+
if (message.result.oneofKind === "answerBotFilesystem")
|
|
16504
|
+
AnswerBotFilesystemResult.internalBinaryWrite(message.result.answerBotFilesystem, writer.tag(145, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16400
16505
|
let u = options.writeUnknownFields;
|
|
16401
16506
|
if (u !== false)
|
|
16402
16507
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -19961,6 +20066,153 @@ class UpdateDialogFollowModeResult$Type extends import_runtime4.MessageType {
|
|
|
19961
20066
|
}
|
|
19962
20067
|
var UpdateDialogFollowModeResult = new UpdateDialogFollowModeResult$Type;
|
|
19963
20068
|
|
|
20069
|
+
class UpdateDialogTranslationInput$Type extends import_runtime4.MessageType {
|
|
20070
|
+
constructor() {
|
|
20071
|
+
super("UpdateDialogTranslationInput", [
|
|
20072
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
20073
|
+
{ no: 2, name: "enabled", kind: "scalar", opt: true, T: 8 },
|
|
20074
|
+
{ no: 3, name: "import_legacy_enabled", kind: "scalar", T: 8 }
|
|
20075
|
+
]);
|
|
20076
|
+
}
|
|
20077
|
+
create(value) {
|
|
20078
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
20079
|
+
message.importLegacyEnabled = false;
|
|
20080
|
+
if (value !== undefined)
|
|
20081
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
20082
|
+
return message;
|
|
20083
|
+
}
|
|
20084
|
+
internalBinaryRead(reader, length, options, target) {
|
|
20085
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
20086
|
+
while (reader.pos < end) {
|
|
20087
|
+
let [fieldNo, wireType] = reader.tag();
|
|
20088
|
+
switch (fieldNo) {
|
|
20089
|
+
case 1:
|
|
20090
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
20091
|
+
break;
|
|
20092
|
+
case 2:
|
|
20093
|
+
message.enabled = reader.bool();
|
|
20094
|
+
break;
|
|
20095
|
+
case 3:
|
|
20096
|
+
message.importLegacyEnabled = reader.bool();
|
|
20097
|
+
break;
|
|
20098
|
+
default:
|
|
20099
|
+
let u = options.readUnknownField;
|
|
20100
|
+
if (u === "throw")
|
|
20101
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
20102
|
+
let d = reader.skip(wireType);
|
|
20103
|
+
if (u !== false)
|
|
20104
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
20105
|
+
}
|
|
20106
|
+
}
|
|
20107
|
+
return message;
|
|
20108
|
+
}
|
|
20109
|
+
internalBinaryWrite(message, writer, options) {
|
|
20110
|
+
if (message.peerId)
|
|
20111
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
20112
|
+
if (message.enabled !== undefined)
|
|
20113
|
+
writer.tag(2, import_runtime.WireType.Varint).bool(message.enabled);
|
|
20114
|
+
if (message.importLegacyEnabled !== false)
|
|
20115
|
+
writer.tag(3, import_runtime.WireType.Varint).bool(message.importLegacyEnabled);
|
|
20116
|
+
let u = options.writeUnknownFields;
|
|
20117
|
+
if (u !== false)
|
|
20118
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
20119
|
+
return writer;
|
|
20120
|
+
}
|
|
20121
|
+
}
|
|
20122
|
+
var UpdateDialogTranslationInput = new UpdateDialogTranslationInput$Type;
|
|
20123
|
+
|
|
20124
|
+
class UpdateDialogTranslationResult$Type extends import_runtime4.MessageType {
|
|
20125
|
+
constructor() {
|
|
20126
|
+
super("UpdateDialogTranslationResult", [
|
|
20127
|
+
{ no: 1, name: "updates", kind: "message", repeat: 1, T: () => Update }
|
|
20128
|
+
]);
|
|
20129
|
+
}
|
|
20130
|
+
create(value) {
|
|
20131
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
20132
|
+
message.updates = [];
|
|
20133
|
+
if (value !== undefined)
|
|
20134
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
20135
|
+
return message;
|
|
20136
|
+
}
|
|
20137
|
+
internalBinaryRead(reader, length, options, target) {
|
|
20138
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
20139
|
+
while (reader.pos < end) {
|
|
20140
|
+
let [fieldNo, wireType] = reader.tag();
|
|
20141
|
+
switch (fieldNo) {
|
|
20142
|
+
case 1:
|
|
20143
|
+
message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
|
|
20144
|
+
break;
|
|
20145
|
+
default:
|
|
20146
|
+
let u = options.readUnknownField;
|
|
20147
|
+
if (u === "throw")
|
|
20148
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
20149
|
+
let d = reader.skip(wireType);
|
|
20150
|
+
if (u !== false)
|
|
20151
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
20152
|
+
}
|
|
20153
|
+
}
|
|
20154
|
+
return message;
|
|
20155
|
+
}
|
|
20156
|
+
internalBinaryWrite(message, writer, options) {
|
|
20157
|
+
for (let i = 0;i < message.updates.length; i++)
|
|
20158
|
+
Update.internalBinaryWrite(message.updates[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
20159
|
+
let u = options.writeUnknownFields;
|
|
20160
|
+
if (u !== false)
|
|
20161
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
20162
|
+
return writer;
|
|
20163
|
+
}
|
|
20164
|
+
}
|
|
20165
|
+
var UpdateDialogTranslationResult = new UpdateDialogTranslationResult$Type;
|
|
20166
|
+
|
|
20167
|
+
class UpdateDialogTranslation$Type extends import_runtime4.MessageType {
|
|
20168
|
+
constructor() {
|
|
20169
|
+
super("UpdateDialogTranslation", [
|
|
20170
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => Peer },
|
|
20171
|
+
{ no: 2, name: "enabled", kind: "scalar", T: 8 }
|
|
20172
|
+
]);
|
|
20173
|
+
}
|
|
20174
|
+
create(value) {
|
|
20175
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
20176
|
+
message.enabled = false;
|
|
20177
|
+
if (value !== undefined)
|
|
20178
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
20179
|
+
return message;
|
|
20180
|
+
}
|
|
20181
|
+
internalBinaryRead(reader, length, options, target) {
|
|
20182
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
20183
|
+
while (reader.pos < end) {
|
|
20184
|
+
let [fieldNo, wireType] = reader.tag();
|
|
20185
|
+
switch (fieldNo) {
|
|
20186
|
+
case 1:
|
|
20187
|
+
message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
20188
|
+
break;
|
|
20189
|
+
case 2:
|
|
20190
|
+
message.enabled = reader.bool();
|
|
20191
|
+
break;
|
|
20192
|
+
default:
|
|
20193
|
+
let u = options.readUnknownField;
|
|
20194
|
+
if (u === "throw")
|
|
20195
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
20196
|
+
let d = reader.skip(wireType);
|
|
20197
|
+
if (u !== false)
|
|
20198
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
20199
|
+
}
|
|
20200
|
+
}
|
|
20201
|
+
return message;
|
|
20202
|
+
}
|
|
20203
|
+
internalBinaryWrite(message, writer, options) {
|
|
20204
|
+
if (message.peerId)
|
|
20205
|
+
Peer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
20206
|
+
if (message.enabled !== false)
|
|
20207
|
+
writer.tag(2, import_runtime.WireType.Varint).bool(message.enabled);
|
|
20208
|
+
let u = options.writeUnknownFields;
|
|
20209
|
+
if (u !== false)
|
|
20210
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
20211
|
+
return writer;
|
|
20212
|
+
}
|
|
20213
|
+
}
|
|
20214
|
+
var UpdateDialogTranslation = new UpdateDialogTranslation$Type;
|
|
20215
|
+
|
|
19964
20216
|
class CollapseHistoryInput$Type extends import_runtime4.MessageType {
|
|
19965
20217
|
constructor() {
|
|
19966
20218
|
super("CollapseHistoryInput", [
|
|
@@ -29487,7 +29739,8 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
29487
29739
|
{ no: 46, name: "dialog_folder", kind: "message", oneof: "update", T: () => UpdateDialogFolder },
|
|
29488
29740
|
{ no: 47, name: "user_added_to_chat", kind: "message", oneof: "update", T: () => UpdateUserAddedToChat },
|
|
29489
29741
|
{ no: 48, name: "user_removed_from_chat", kind: "message", oneof: "update", T: () => UpdateUserRemovedFromChat },
|
|
29490
|
-
{ no: 49, name: "acknowledgement", kind: "message", oneof: "update", T: () => ChatAcknowledgement }
|
|
29742
|
+
{ no: 49, name: "acknowledgement", kind: "message", oneof: "update", T: () => ChatAcknowledgement },
|
|
29743
|
+
{ no: 50, name: "dialog_translation", kind: "message", oneof: "update", T: () => UpdateDialogTranslation }
|
|
29491
29744
|
]);
|
|
29492
29745
|
}
|
|
29493
29746
|
create(value) {
|
|
@@ -29784,6 +30037,12 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
29784
30037
|
acknowledgement: ChatAcknowledgement.internalBinaryRead(reader, reader.uint32(), options, message.update.acknowledgement)
|
|
29785
30038
|
};
|
|
29786
30039
|
break;
|
|
30040
|
+
case 50:
|
|
30041
|
+
message.update = {
|
|
30042
|
+
oneofKind: "dialogTranslation",
|
|
30043
|
+
dialogTranslation: UpdateDialogTranslation.internalBinaryRead(reader, reader.uint32(), options, message.update.dialogTranslation)
|
|
30044
|
+
};
|
|
30045
|
+
break;
|
|
29787
30046
|
default:
|
|
29788
30047
|
let u = options.readUnknownField;
|
|
29789
30048
|
if (u === "throw")
|
|
@@ -29892,6 +30151,8 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
29892
30151
|
UpdateUserRemovedFromChat.internalBinaryWrite(message.update.userRemovedFromChat, writer.tag(48, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
29893
30152
|
if (message.update.oneofKind === "acknowledgement")
|
|
29894
30153
|
ChatAcknowledgement.internalBinaryWrite(message.update.acknowledgement, writer.tag(49, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
30154
|
+
if (message.update.oneofKind === "dialogTranslation")
|
|
30155
|
+
UpdateDialogTranslation.internalBinaryWrite(message.update.dialogTranslation, writer.tag(50, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
29895
30156
|
let u = options.writeUnknownFields;
|
|
29896
30157
|
if (u !== false)
|
|
29897
30158
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -33891,7 +34152,8 @@ class AgentProjectCatalog$Type extends import_runtime4.MessageType {
|
|
|
33891
34152
|
constructor() {
|
|
33892
34153
|
super("AgentProjectCatalog", [
|
|
33893
34154
|
{ no: 1, name: "options", kind: "message", repeat: 1, T: () => AgentProjectOption },
|
|
33894
|
-
{ no: 2, name: "can_select_folder", kind: "scalar", opt: true, T: 8 }
|
|
34155
|
+
{ no: 2, name: "can_select_folder", kind: "scalar", opt: true, T: 8 },
|
|
34156
|
+
{ no: 3, name: "default_project_id", kind: "scalar", opt: true, T: 9 }
|
|
33895
34157
|
]);
|
|
33896
34158
|
}
|
|
33897
34159
|
create(value) {
|
|
@@ -33912,6 +34174,9 @@ class AgentProjectCatalog$Type extends import_runtime4.MessageType {
|
|
|
33912
34174
|
case 2:
|
|
33913
34175
|
message.canSelectFolder = reader.bool();
|
|
33914
34176
|
break;
|
|
34177
|
+
case 3:
|
|
34178
|
+
message.defaultProjectId = reader.string();
|
|
34179
|
+
break;
|
|
33915
34180
|
default:
|
|
33916
34181
|
let u = options.readUnknownField;
|
|
33917
34182
|
if (u === "throw")
|
|
@@ -33928,6 +34193,8 @@ class AgentProjectCatalog$Type extends import_runtime4.MessageType {
|
|
|
33928
34193
|
AgentProjectOption.internalBinaryWrite(message.options[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
33929
34194
|
if (message.canSelectFolder !== undefined)
|
|
33930
34195
|
writer.tag(2, import_runtime.WireType.Varint).bool(message.canSelectFolder);
|
|
34196
|
+
if (message.defaultProjectId !== undefined)
|
|
34197
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.defaultProjectId);
|
|
33931
34198
|
let u = options.writeUnknownFields;
|
|
33932
34199
|
if (u !== false)
|
|
33933
34200
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -34041,7 +34308,8 @@ class AgentModelOption$Type extends import_runtime4.MessageType {
|
|
|
34041
34308
|
{ no: 1, name: "id", kind: "scalar", T: 9 },
|
|
34042
34309
|
{ no: 2, name: "label", kind: "scalar", T: 9 },
|
|
34043
34310
|
{ no: 3, name: "description", kind: "scalar", opt: true, T: 9 },
|
|
34044
|
-
{ no: 4, name: "reasoning_effort_ids", kind: "scalar", repeat: 2, T: 9 }
|
|
34311
|
+
{ no: 4, name: "reasoning_effort_ids", kind: "scalar", repeat: 2, T: 9 },
|
|
34312
|
+
{ no: 5, name: "default_reasoning_effort_id", kind: "scalar", opt: true, T: 9 }
|
|
34045
34313
|
]);
|
|
34046
34314
|
}
|
|
34047
34315
|
create(value) {
|
|
@@ -34070,6 +34338,9 @@ class AgentModelOption$Type extends import_runtime4.MessageType {
|
|
|
34070
34338
|
case 4:
|
|
34071
34339
|
message.reasoningEffortIds.push(reader.string());
|
|
34072
34340
|
break;
|
|
34341
|
+
case 5:
|
|
34342
|
+
message.defaultReasoningEffortId = reader.string();
|
|
34343
|
+
break;
|
|
34073
34344
|
default:
|
|
34074
34345
|
let u = options.readUnknownField;
|
|
34075
34346
|
if (u === "throw")
|
|
@@ -34090,6 +34361,8 @@ class AgentModelOption$Type extends import_runtime4.MessageType {
|
|
|
34090
34361
|
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
|
|
34091
34362
|
for (let i = 0;i < message.reasoningEffortIds.length; i++)
|
|
34092
34363
|
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.reasoningEffortIds[i]);
|
|
34364
|
+
if (message.defaultReasoningEffortId !== undefined)
|
|
34365
|
+
writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.defaultReasoningEffortId);
|
|
34093
34366
|
let u = options.writeUnknownFields;
|
|
34094
34367
|
if (u !== false)
|
|
34095
34368
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -34101,7 +34374,8 @@ var AgentModelOption = new AgentModelOption$Type;
|
|
|
34101
34374
|
class AgentModelCatalog$Type extends import_runtime4.MessageType {
|
|
34102
34375
|
constructor() {
|
|
34103
34376
|
super("AgentModelCatalog", [
|
|
34104
|
-
{ no: 1, name: "options", kind: "message", repeat: 1, T: () => AgentModelOption }
|
|
34377
|
+
{ no: 1, name: "options", kind: "message", repeat: 1, T: () => AgentModelOption },
|
|
34378
|
+
{ no: 2, name: "default_model_id", kind: "scalar", opt: true, T: 9 }
|
|
34105
34379
|
]);
|
|
34106
34380
|
}
|
|
34107
34381
|
create(value) {
|
|
@@ -34119,6 +34393,9 @@ class AgentModelCatalog$Type extends import_runtime4.MessageType {
|
|
|
34119
34393
|
case 1:
|
|
34120
34394
|
message.options.push(AgentModelOption.internalBinaryRead(reader, reader.uint32(), options));
|
|
34121
34395
|
break;
|
|
34396
|
+
case 2:
|
|
34397
|
+
message.defaultModelId = reader.string();
|
|
34398
|
+
break;
|
|
34122
34399
|
default:
|
|
34123
34400
|
let u = options.readUnknownField;
|
|
34124
34401
|
if (u === "throw")
|
|
@@ -34133,6 +34410,8 @@ class AgentModelCatalog$Type extends import_runtime4.MessageType {
|
|
|
34133
34410
|
internalBinaryWrite(message, writer, options) {
|
|
34134
34411
|
for (let i = 0;i < message.options.length; i++)
|
|
34135
34412
|
AgentModelOption.internalBinaryWrite(message.options[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
34413
|
+
if (message.defaultModelId !== undefined)
|
|
34414
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.defaultModelId);
|
|
34136
34415
|
let u = options.writeUnknownFields;
|
|
34137
34416
|
if (u !== false)
|
|
34138
34417
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -35019,7 +35298,8 @@ class BotChatSettingsFolder$Type extends import_runtime4.MessageType {
|
|
|
35019
35298
|
{ no: 4, name: "host_label", kind: "scalar", T: 9 },
|
|
35020
35299
|
{ no: 5, name: "allows_local_picker", kind: "scalar", T: 8 },
|
|
35021
35300
|
{ no: 6, name: "local_picker_port", kind: "scalar", opt: true, T: 13 },
|
|
35022
|
-
{ no: 7, name: "local_picker_capability", kind: "scalar", opt: true, T: 9 }
|
|
35301
|
+
{ no: 7, name: "local_picker_capability", kind: "scalar", opt: true, T: 9 },
|
|
35302
|
+
{ no: 8, name: "remote_browser_version", kind: "scalar", opt: true, T: 13 }
|
|
35023
35303
|
]);
|
|
35024
35304
|
}
|
|
35025
35305
|
create(value) {
|
|
@@ -35059,6 +35339,9 @@ class BotChatSettingsFolder$Type extends import_runtime4.MessageType {
|
|
|
35059
35339
|
case 7:
|
|
35060
35340
|
message.localPickerCapability = reader.string();
|
|
35061
35341
|
break;
|
|
35342
|
+
case 8:
|
|
35343
|
+
message.remoteBrowserVersion = reader.uint32();
|
|
35344
|
+
break;
|
|
35062
35345
|
default:
|
|
35063
35346
|
let u = options.readUnknownField;
|
|
35064
35347
|
if (u === "throw")
|
|
@@ -35085,6 +35368,8 @@ class BotChatSettingsFolder$Type extends import_runtime4.MessageType {
|
|
|
35085
35368
|
writer.tag(6, import_runtime.WireType.Varint).uint32(message.localPickerPort);
|
|
35086
35369
|
if (message.localPickerCapability !== undefined)
|
|
35087
35370
|
writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.localPickerCapability);
|
|
35371
|
+
if (message.remoteBrowserVersion !== undefined)
|
|
35372
|
+
writer.tag(8, import_runtime.WireType.Varint).uint32(message.remoteBrowserVersion);
|
|
35088
35373
|
let u = options.writeUnknownFields;
|
|
35089
35374
|
if (u !== false)
|
|
35090
35375
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -38329,6 +38614,542 @@ class ChatAcknowledgements$Type extends import_runtime4.MessageType {
|
|
|
38329
38614
|
}
|
|
38330
38615
|
var ChatAcknowledgements = new ChatAcknowledgements$Type;
|
|
38331
38616
|
|
|
38617
|
+
class TranscribeVoiceDraftInput$Type extends import_runtime4.MessageType {
|
|
38618
|
+
constructor() {
|
|
38619
|
+
super("TranscribeVoiceDraftInput", [
|
|
38620
|
+
{ no: 1, name: "audio", kind: "scalar", T: 12 },
|
|
38621
|
+
{ no: 2, name: "mime_type", kind: "scalar", T: 9 },
|
|
38622
|
+
{ no: 3, name: "duration", kind: "scalar", T: 13 }
|
|
38623
|
+
]);
|
|
38624
|
+
}
|
|
38625
|
+
create(value) {
|
|
38626
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38627
|
+
message.audio = new Uint8Array(0);
|
|
38628
|
+
message.mimeType = "";
|
|
38629
|
+
message.duration = 0;
|
|
38630
|
+
if (value !== undefined)
|
|
38631
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38632
|
+
return message;
|
|
38633
|
+
}
|
|
38634
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38635
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38636
|
+
while (reader.pos < end) {
|
|
38637
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38638
|
+
switch (fieldNo) {
|
|
38639
|
+
case 1:
|
|
38640
|
+
message.audio = reader.bytes();
|
|
38641
|
+
break;
|
|
38642
|
+
case 2:
|
|
38643
|
+
message.mimeType = reader.string();
|
|
38644
|
+
break;
|
|
38645
|
+
case 3:
|
|
38646
|
+
message.duration = reader.uint32();
|
|
38647
|
+
break;
|
|
38648
|
+
default:
|
|
38649
|
+
let u = options.readUnknownField;
|
|
38650
|
+
if (u === "throw")
|
|
38651
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38652
|
+
let d = reader.skip(wireType);
|
|
38653
|
+
if (u !== false)
|
|
38654
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38655
|
+
}
|
|
38656
|
+
}
|
|
38657
|
+
return message;
|
|
38658
|
+
}
|
|
38659
|
+
internalBinaryWrite(message, writer, options) {
|
|
38660
|
+
if (message.audio.length)
|
|
38661
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).bytes(message.audio);
|
|
38662
|
+
if (message.mimeType !== "")
|
|
38663
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.mimeType);
|
|
38664
|
+
if (message.duration !== 0)
|
|
38665
|
+
writer.tag(3, import_runtime.WireType.Varint).uint32(message.duration);
|
|
38666
|
+
let u = options.writeUnknownFields;
|
|
38667
|
+
if (u !== false)
|
|
38668
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38669
|
+
return writer;
|
|
38670
|
+
}
|
|
38671
|
+
}
|
|
38672
|
+
var TranscribeVoiceDraftInput = new TranscribeVoiceDraftInput$Type;
|
|
38673
|
+
|
|
38674
|
+
class TranscribeVoiceDraftResult$Type extends import_runtime4.MessageType {
|
|
38675
|
+
constructor() {
|
|
38676
|
+
super("TranscribeVoiceDraftResult", [
|
|
38677
|
+
{ no: 1, name: "text", kind: "scalar", T: 9 }
|
|
38678
|
+
]);
|
|
38679
|
+
}
|
|
38680
|
+
create(value) {
|
|
38681
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38682
|
+
message.text = "";
|
|
38683
|
+
if (value !== undefined)
|
|
38684
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38685
|
+
return message;
|
|
38686
|
+
}
|
|
38687
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38688
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38689
|
+
while (reader.pos < end) {
|
|
38690
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38691
|
+
switch (fieldNo) {
|
|
38692
|
+
case 1:
|
|
38693
|
+
message.text = reader.string();
|
|
38694
|
+
break;
|
|
38695
|
+
default:
|
|
38696
|
+
let u = options.readUnknownField;
|
|
38697
|
+
if (u === "throw")
|
|
38698
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38699
|
+
let d = reader.skip(wireType);
|
|
38700
|
+
if (u !== false)
|
|
38701
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38702
|
+
}
|
|
38703
|
+
}
|
|
38704
|
+
return message;
|
|
38705
|
+
}
|
|
38706
|
+
internalBinaryWrite(message, writer, options) {
|
|
38707
|
+
if (message.text !== "")
|
|
38708
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.text);
|
|
38709
|
+
let u = options.writeUnknownFields;
|
|
38710
|
+
if (u !== false)
|
|
38711
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38712
|
+
return writer;
|
|
38713
|
+
}
|
|
38714
|
+
}
|
|
38715
|
+
var TranscribeVoiceDraftResult = new TranscribeVoiceDraftResult$Type;
|
|
38716
|
+
|
|
38717
|
+
class RequestBotFilesystemInput$Type extends import_runtime4.MessageType {
|
|
38718
|
+
constructor() {
|
|
38719
|
+
super("RequestBotFilesystemInput", [
|
|
38720
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
38721
|
+
{ no: 2, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
|
|
38722
|
+
{ no: 3, name: "host_installation_id", kind: "scalar", T: 9 },
|
|
38723
|
+
{ no: 4, name: "operation", kind: "enum", T: () => ["RequestBotFilesystemInput.Operation", RequestBotFilesystemInput_Operation] },
|
|
38724
|
+
{ no: 5, name: "path", kind: "scalar", T: 9 },
|
|
38725
|
+
{ no: 6, name: "after", kind: "scalar", T: 9 }
|
|
38726
|
+
]);
|
|
38727
|
+
}
|
|
38728
|
+
create(value) {
|
|
38729
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38730
|
+
message.botUserId = 0n;
|
|
38731
|
+
message.hostInstallationId = "";
|
|
38732
|
+
message.operation = 0;
|
|
38733
|
+
message.path = "";
|
|
38734
|
+
message.after = "";
|
|
38735
|
+
if (value !== undefined)
|
|
38736
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38737
|
+
return message;
|
|
38738
|
+
}
|
|
38739
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38740
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38741
|
+
while (reader.pos < end) {
|
|
38742
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38743
|
+
switch (fieldNo) {
|
|
38744
|
+
case 1:
|
|
38745
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
38746
|
+
break;
|
|
38747
|
+
case 2:
|
|
38748
|
+
message.botUserId = reader.int64().toBigInt();
|
|
38749
|
+
break;
|
|
38750
|
+
case 3:
|
|
38751
|
+
message.hostInstallationId = reader.string();
|
|
38752
|
+
break;
|
|
38753
|
+
case 4:
|
|
38754
|
+
message.operation = reader.int32();
|
|
38755
|
+
break;
|
|
38756
|
+
case 5:
|
|
38757
|
+
message.path = reader.string();
|
|
38758
|
+
break;
|
|
38759
|
+
case 6:
|
|
38760
|
+
message.after = reader.string();
|
|
38761
|
+
break;
|
|
38762
|
+
default:
|
|
38763
|
+
let u = options.readUnknownField;
|
|
38764
|
+
if (u === "throw")
|
|
38765
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38766
|
+
let d = reader.skip(wireType);
|
|
38767
|
+
if (u !== false)
|
|
38768
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38769
|
+
}
|
|
38770
|
+
}
|
|
38771
|
+
return message;
|
|
38772
|
+
}
|
|
38773
|
+
internalBinaryWrite(message, writer, options) {
|
|
38774
|
+
if (message.peerId)
|
|
38775
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38776
|
+
if (message.botUserId !== 0n)
|
|
38777
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
38778
|
+
if (message.hostInstallationId !== "")
|
|
38779
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.hostInstallationId);
|
|
38780
|
+
if (message.operation !== 0)
|
|
38781
|
+
writer.tag(4, import_runtime.WireType.Varint).int32(message.operation);
|
|
38782
|
+
if (message.path !== "")
|
|
38783
|
+
writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.path);
|
|
38784
|
+
if (message.after !== "")
|
|
38785
|
+
writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.after);
|
|
38786
|
+
let u = options.writeUnknownFields;
|
|
38787
|
+
if (u !== false)
|
|
38788
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38789
|
+
return writer;
|
|
38790
|
+
}
|
|
38791
|
+
}
|
|
38792
|
+
var RequestBotFilesystemInput = new RequestBotFilesystemInput$Type;
|
|
38793
|
+
|
|
38794
|
+
class BotFilesystemEntry$Type extends import_runtime4.MessageType {
|
|
38795
|
+
constructor() {
|
|
38796
|
+
super("BotFilesystemEntry", [
|
|
38797
|
+
{ no: 1, name: "name", kind: "scalar", T: 9 },
|
|
38798
|
+
{ no: 2, name: "kind", kind: "enum", T: () => ["BotFilesystemEntry.Kind", BotFilesystemEntry_Kind] },
|
|
38799
|
+
{ no: 3, name: "size", kind: "scalar", T: 4, L: 0 }
|
|
38800
|
+
]);
|
|
38801
|
+
}
|
|
38802
|
+
create(value) {
|
|
38803
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38804
|
+
message.name = "";
|
|
38805
|
+
message.kind = 0;
|
|
38806
|
+
message.size = 0n;
|
|
38807
|
+
if (value !== undefined)
|
|
38808
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38809
|
+
return message;
|
|
38810
|
+
}
|
|
38811
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38812
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38813
|
+
while (reader.pos < end) {
|
|
38814
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38815
|
+
switch (fieldNo) {
|
|
38816
|
+
case 1:
|
|
38817
|
+
message.name = reader.string();
|
|
38818
|
+
break;
|
|
38819
|
+
case 2:
|
|
38820
|
+
message.kind = reader.int32();
|
|
38821
|
+
break;
|
|
38822
|
+
case 3:
|
|
38823
|
+
message.size = reader.uint64().toBigInt();
|
|
38824
|
+
break;
|
|
38825
|
+
default:
|
|
38826
|
+
let u = options.readUnknownField;
|
|
38827
|
+
if (u === "throw")
|
|
38828
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38829
|
+
let d = reader.skip(wireType);
|
|
38830
|
+
if (u !== false)
|
|
38831
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38832
|
+
}
|
|
38833
|
+
}
|
|
38834
|
+
return message;
|
|
38835
|
+
}
|
|
38836
|
+
internalBinaryWrite(message, writer, options) {
|
|
38837
|
+
if (message.name !== "")
|
|
38838
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.name);
|
|
38839
|
+
if (message.kind !== 0)
|
|
38840
|
+
writer.tag(2, import_runtime.WireType.Varint).int32(message.kind);
|
|
38841
|
+
if (message.size !== 0n)
|
|
38842
|
+
writer.tag(3, import_runtime.WireType.Varint).uint64(message.size);
|
|
38843
|
+
let u = options.writeUnknownFields;
|
|
38844
|
+
if (u !== false)
|
|
38845
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38846
|
+
return writer;
|
|
38847
|
+
}
|
|
38848
|
+
}
|
|
38849
|
+
var BotFilesystemEntry = new BotFilesystemEntry$Type;
|
|
38850
|
+
|
|
38851
|
+
class BotFilesystemListing$Type extends import_runtime4.MessageType {
|
|
38852
|
+
constructor() {
|
|
38853
|
+
super("BotFilesystemListing", [
|
|
38854
|
+
{ no: 1, name: "path", kind: "scalar", T: 9 },
|
|
38855
|
+
{ no: 2, name: "parent_path", kind: "scalar", opt: true, T: 9 },
|
|
38856
|
+
{ no: 3, name: "entries", kind: "message", repeat: 1, T: () => BotFilesystemEntry },
|
|
38857
|
+
{ no: 4, name: "next_after", kind: "scalar", opt: true, T: 9 }
|
|
38858
|
+
]);
|
|
38859
|
+
}
|
|
38860
|
+
create(value) {
|
|
38861
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38862
|
+
message.path = "";
|
|
38863
|
+
message.entries = [];
|
|
38864
|
+
if (value !== undefined)
|
|
38865
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38866
|
+
return message;
|
|
38867
|
+
}
|
|
38868
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38869
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38870
|
+
while (reader.pos < end) {
|
|
38871
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38872
|
+
switch (fieldNo) {
|
|
38873
|
+
case 1:
|
|
38874
|
+
message.path = reader.string();
|
|
38875
|
+
break;
|
|
38876
|
+
case 2:
|
|
38877
|
+
message.parentPath = reader.string();
|
|
38878
|
+
break;
|
|
38879
|
+
case 3:
|
|
38880
|
+
message.entries.push(BotFilesystemEntry.internalBinaryRead(reader, reader.uint32(), options));
|
|
38881
|
+
break;
|
|
38882
|
+
case 4:
|
|
38883
|
+
message.nextAfter = reader.string();
|
|
38884
|
+
break;
|
|
38885
|
+
default:
|
|
38886
|
+
let u = options.readUnknownField;
|
|
38887
|
+
if (u === "throw")
|
|
38888
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38889
|
+
let d = reader.skip(wireType);
|
|
38890
|
+
if (u !== false)
|
|
38891
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38892
|
+
}
|
|
38893
|
+
}
|
|
38894
|
+
return message;
|
|
38895
|
+
}
|
|
38896
|
+
internalBinaryWrite(message, writer, options) {
|
|
38897
|
+
if (message.path !== "")
|
|
38898
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.path);
|
|
38899
|
+
if (message.parentPath !== undefined)
|
|
38900
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.parentPath);
|
|
38901
|
+
for (let i = 0;i < message.entries.length; i++)
|
|
38902
|
+
BotFilesystemEntry.internalBinaryWrite(message.entries[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38903
|
+
if (message.nextAfter !== undefined)
|
|
38904
|
+
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.nextAfter);
|
|
38905
|
+
let u = options.writeUnknownFields;
|
|
38906
|
+
if (u !== false)
|
|
38907
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38908
|
+
return writer;
|
|
38909
|
+
}
|
|
38910
|
+
}
|
|
38911
|
+
var BotFilesystemListing = new BotFilesystemListing$Type;
|
|
38912
|
+
|
|
38913
|
+
class BotFilesystemResponse$Type extends import_runtime4.MessageType {
|
|
38914
|
+
constructor() {
|
|
38915
|
+
super("BotFilesystemResponse", [
|
|
38916
|
+
{ no: 1, name: "listing", kind: "message", oneof: "result", T: () => BotFilesystemListing },
|
|
38917
|
+
{ no: 2, name: "workspace_id", kind: "scalar", oneof: "result", T: 9 },
|
|
38918
|
+
{ no: 3, name: "problem", kind: "scalar", oneof: "result", T: 9 }
|
|
38919
|
+
]);
|
|
38920
|
+
}
|
|
38921
|
+
create(value) {
|
|
38922
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38923
|
+
message.result = { oneofKind: undefined };
|
|
38924
|
+
if (value !== undefined)
|
|
38925
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38926
|
+
return message;
|
|
38927
|
+
}
|
|
38928
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38929
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38930
|
+
while (reader.pos < end) {
|
|
38931
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38932
|
+
switch (fieldNo) {
|
|
38933
|
+
case 1:
|
|
38934
|
+
message.result = {
|
|
38935
|
+
oneofKind: "listing",
|
|
38936
|
+
listing: BotFilesystemListing.internalBinaryRead(reader, reader.uint32(), options, message.result.listing)
|
|
38937
|
+
};
|
|
38938
|
+
break;
|
|
38939
|
+
case 2:
|
|
38940
|
+
message.result = {
|
|
38941
|
+
oneofKind: "workspaceId",
|
|
38942
|
+
workspaceId: reader.string()
|
|
38943
|
+
};
|
|
38944
|
+
break;
|
|
38945
|
+
case 3:
|
|
38946
|
+
message.result = {
|
|
38947
|
+
oneofKind: "problem",
|
|
38948
|
+
problem: reader.string()
|
|
38949
|
+
};
|
|
38950
|
+
break;
|
|
38951
|
+
default:
|
|
38952
|
+
let u = options.readUnknownField;
|
|
38953
|
+
if (u === "throw")
|
|
38954
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
38955
|
+
let d = reader.skip(wireType);
|
|
38956
|
+
if (u !== false)
|
|
38957
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
38958
|
+
}
|
|
38959
|
+
}
|
|
38960
|
+
return message;
|
|
38961
|
+
}
|
|
38962
|
+
internalBinaryWrite(message, writer, options) {
|
|
38963
|
+
if (message.result.oneofKind === "listing")
|
|
38964
|
+
BotFilesystemListing.internalBinaryWrite(message.result.listing, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
38965
|
+
if (message.result.oneofKind === "workspaceId")
|
|
38966
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.result.workspaceId);
|
|
38967
|
+
if (message.result.oneofKind === "problem")
|
|
38968
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.result.problem);
|
|
38969
|
+
let u = options.writeUnknownFields;
|
|
38970
|
+
if (u !== false)
|
|
38971
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
38972
|
+
return writer;
|
|
38973
|
+
}
|
|
38974
|
+
}
|
|
38975
|
+
var BotFilesystemResponse = new BotFilesystemResponse$Type;
|
|
38976
|
+
|
|
38977
|
+
class RequestBotFilesystemResult$Type extends import_runtime4.MessageType {
|
|
38978
|
+
constructor() {
|
|
38979
|
+
super("RequestBotFilesystemResult", [
|
|
38980
|
+
{ no: 1, name: "response", kind: "message", T: () => BotFilesystemResponse }
|
|
38981
|
+
]);
|
|
38982
|
+
}
|
|
38983
|
+
create(value) {
|
|
38984
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
38985
|
+
if (value !== undefined)
|
|
38986
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
38987
|
+
return message;
|
|
38988
|
+
}
|
|
38989
|
+
internalBinaryRead(reader, length, options, target) {
|
|
38990
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
38991
|
+
while (reader.pos < end) {
|
|
38992
|
+
let [fieldNo, wireType] = reader.tag();
|
|
38993
|
+
switch (fieldNo) {
|
|
38994
|
+
case 1:
|
|
38995
|
+
message.response = BotFilesystemResponse.internalBinaryRead(reader, reader.uint32(), options, message.response);
|
|
38996
|
+
break;
|
|
38997
|
+
default:
|
|
38998
|
+
let u = options.readUnknownField;
|
|
38999
|
+
if (u === "throw")
|
|
39000
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
39001
|
+
let d = reader.skip(wireType);
|
|
39002
|
+
if (u !== false)
|
|
39003
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
39004
|
+
}
|
|
39005
|
+
}
|
|
39006
|
+
return message;
|
|
39007
|
+
}
|
|
39008
|
+
internalBinaryWrite(message, writer, options) {
|
|
39009
|
+
if (message.response)
|
|
39010
|
+
BotFilesystemResponse.internalBinaryWrite(message.response, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
39011
|
+
let u = options.writeUnknownFields;
|
|
39012
|
+
if (u !== false)
|
|
39013
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
39014
|
+
return writer;
|
|
39015
|
+
}
|
|
39016
|
+
}
|
|
39017
|
+
var RequestBotFilesystemResult = new RequestBotFilesystemResult$Type;
|
|
39018
|
+
|
|
39019
|
+
class BotFilesystemRequested$Type extends import_runtime4.MessageType {
|
|
39020
|
+
constructor() {
|
|
39021
|
+
super("BotFilesystemRequested", [
|
|
39022
|
+
{ no: 1, name: "request_id", kind: "scalar", T: 4, L: 0 },
|
|
39023
|
+
{ no: 2, name: "actor_user_id", kind: "scalar", T: 3, L: 0 },
|
|
39024
|
+
{ no: 3, name: "chat_id", kind: "scalar", T: 3, L: 0 },
|
|
39025
|
+
{ no: 4, name: "input", kind: "message", T: () => RequestBotFilesystemInput }
|
|
39026
|
+
]);
|
|
39027
|
+
}
|
|
39028
|
+
create(value) {
|
|
39029
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
39030
|
+
message.requestId = 0n;
|
|
39031
|
+
message.actorUserId = 0n;
|
|
39032
|
+
message.chatId = 0n;
|
|
39033
|
+
if (value !== undefined)
|
|
39034
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
39035
|
+
return message;
|
|
39036
|
+
}
|
|
39037
|
+
internalBinaryRead(reader, length, options, target) {
|
|
39038
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
39039
|
+
while (reader.pos < end) {
|
|
39040
|
+
let [fieldNo, wireType] = reader.tag();
|
|
39041
|
+
switch (fieldNo) {
|
|
39042
|
+
case 1:
|
|
39043
|
+
message.requestId = reader.uint64().toBigInt();
|
|
39044
|
+
break;
|
|
39045
|
+
case 2:
|
|
39046
|
+
message.actorUserId = reader.int64().toBigInt();
|
|
39047
|
+
break;
|
|
39048
|
+
case 3:
|
|
39049
|
+
message.chatId = reader.int64().toBigInt();
|
|
39050
|
+
break;
|
|
39051
|
+
case 4:
|
|
39052
|
+
message.input = RequestBotFilesystemInput.internalBinaryRead(reader, reader.uint32(), options, message.input);
|
|
39053
|
+
break;
|
|
39054
|
+
default:
|
|
39055
|
+
let u = options.readUnknownField;
|
|
39056
|
+
if (u === "throw")
|
|
39057
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
39058
|
+
let d = reader.skip(wireType);
|
|
39059
|
+
if (u !== false)
|
|
39060
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
39061
|
+
}
|
|
39062
|
+
}
|
|
39063
|
+
return message;
|
|
39064
|
+
}
|
|
39065
|
+
internalBinaryWrite(message, writer, options) {
|
|
39066
|
+
if (message.requestId !== 0n)
|
|
39067
|
+
writer.tag(1, import_runtime.WireType.Varint).uint64(message.requestId);
|
|
39068
|
+
if (message.actorUserId !== 0n)
|
|
39069
|
+
writer.tag(2, import_runtime.WireType.Varint).int64(message.actorUserId);
|
|
39070
|
+
if (message.chatId !== 0n)
|
|
39071
|
+
writer.tag(3, import_runtime.WireType.Varint).int64(message.chatId);
|
|
39072
|
+
if (message.input)
|
|
39073
|
+
RequestBotFilesystemInput.internalBinaryWrite(message.input, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
39074
|
+
let u = options.writeUnknownFields;
|
|
39075
|
+
if (u !== false)
|
|
39076
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
39077
|
+
return writer;
|
|
39078
|
+
}
|
|
39079
|
+
}
|
|
39080
|
+
var BotFilesystemRequested = new BotFilesystemRequested$Type;
|
|
39081
|
+
|
|
39082
|
+
class AnswerBotFilesystemInput$Type extends import_runtime4.MessageType {
|
|
39083
|
+
constructor() {
|
|
39084
|
+
super("AnswerBotFilesystemInput", [
|
|
39085
|
+
{ no: 1, name: "request_id", kind: "scalar", T: 4, L: 0 },
|
|
39086
|
+
{ no: 2, name: "response", kind: "message", T: () => BotFilesystemResponse }
|
|
39087
|
+
]);
|
|
39088
|
+
}
|
|
39089
|
+
create(value) {
|
|
39090
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
39091
|
+
message.requestId = 0n;
|
|
39092
|
+
if (value !== undefined)
|
|
39093
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
39094
|
+
return message;
|
|
39095
|
+
}
|
|
39096
|
+
internalBinaryRead(reader, length, options, target) {
|
|
39097
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
39098
|
+
while (reader.pos < end) {
|
|
39099
|
+
let [fieldNo, wireType] = reader.tag();
|
|
39100
|
+
switch (fieldNo) {
|
|
39101
|
+
case 1:
|
|
39102
|
+
message.requestId = reader.uint64().toBigInt();
|
|
39103
|
+
break;
|
|
39104
|
+
case 2:
|
|
39105
|
+
message.response = BotFilesystemResponse.internalBinaryRead(reader, reader.uint32(), options, message.response);
|
|
39106
|
+
break;
|
|
39107
|
+
default:
|
|
39108
|
+
let u = options.readUnknownField;
|
|
39109
|
+
if (u === "throw")
|
|
39110
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
39111
|
+
let d = reader.skip(wireType);
|
|
39112
|
+
if (u !== false)
|
|
39113
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
39114
|
+
}
|
|
39115
|
+
}
|
|
39116
|
+
return message;
|
|
39117
|
+
}
|
|
39118
|
+
internalBinaryWrite(message, writer, options) {
|
|
39119
|
+
if (message.requestId !== 0n)
|
|
39120
|
+
writer.tag(1, import_runtime.WireType.Varint).uint64(message.requestId);
|
|
39121
|
+
if (message.response)
|
|
39122
|
+
BotFilesystemResponse.internalBinaryWrite(message.response, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
39123
|
+
let u = options.writeUnknownFields;
|
|
39124
|
+
if (u !== false)
|
|
39125
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
39126
|
+
return writer;
|
|
39127
|
+
}
|
|
39128
|
+
}
|
|
39129
|
+
var AnswerBotFilesystemInput = new AnswerBotFilesystemInput$Type;
|
|
39130
|
+
|
|
39131
|
+
class AnswerBotFilesystemResult$Type extends import_runtime4.MessageType {
|
|
39132
|
+
constructor() {
|
|
39133
|
+
super("AnswerBotFilesystemResult", []);
|
|
39134
|
+
}
|
|
39135
|
+
create(value) {
|
|
39136
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
39137
|
+
if (value !== undefined)
|
|
39138
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
39139
|
+
return message;
|
|
39140
|
+
}
|
|
39141
|
+
internalBinaryRead(reader, length, options, target) {
|
|
39142
|
+
return target ?? this.create();
|
|
39143
|
+
}
|
|
39144
|
+
internalBinaryWrite(message, writer, options) {
|
|
39145
|
+
let u = options.writeUnknownFields;
|
|
39146
|
+
if (u !== false)
|
|
39147
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
39148
|
+
return writer;
|
|
39149
|
+
}
|
|
39150
|
+
}
|
|
39151
|
+
var AnswerBotFilesystemResult = new AnswerBotFilesystemResult$Type;
|
|
39152
|
+
|
|
38332
39153
|
// ../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
38333
39154
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
38334
39155
|
function isBytes(a) {
|
|
@@ -39107,6 +39928,13 @@ var asInlineId = (value, fieldName = "id") => {
|
|
|
39107
39928
|
};
|
|
39108
39929
|
|
|
39109
39930
|
// ../sdk/dist/utils/async-channel.js
|
|
39931
|
+
class ChannelConsumerError extends Error {
|
|
39932
|
+
constructor(message) {
|
|
39933
|
+
super(message);
|
|
39934
|
+
this.name = "ChannelConsumerError";
|
|
39935
|
+
}
|
|
39936
|
+
}
|
|
39937
|
+
|
|
39110
39938
|
class AsyncChannelOverflowError extends Error {
|
|
39111
39939
|
capacity;
|
|
39112
39940
|
constructor(capacity) {
|
|
@@ -39216,6 +40044,7 @@ class AcknowledgedAsyncChannel {
|
|
|
39216
40044
|
closed = false;
|
|
39217
40045
|
failure = null;
|
|
39218
40046
|
iteratorClaimed = false;
|
|
40047
|
+
consumption = null;
|
|
39219
40048
|
constructor(capacity, byteLimit) {
|
|
39220
40049
|
this.capacity = capacity;
|
|
39221
40050
|
this.byteLimit = byteLimit;
|
|
@@ -39229,7 +40058,7 @@ class AcknowledgedAsyncChannel {
|
|
|
39229
40058
|
send(value) {
|
|
39230
40059
|
if (this.closed)
|
|
39231
40060
|
return Promise.resolve(false);
|
|
39232
|
-
if (!this.waiter && this.queue.length >= this.capacity) {
|
|
40061
|
+
if (!this.waiter && this.queue.length + (this.consumption?.active.size ?? 0) >= this.capacity) {
|
|
39233
40062
|
throw new AsyncChannelOverflowError(this.capacity);
|
|
39234
40063
|
}
|
|
39235
40064
|
const bytes = this.byteLimit?.byteLength(value) ?? 0;
|
|
@@ -39249,6 +40078,7 @@ class AcknowledgedAsyncChannel {
|
|
|
39249
40078
|
waiter.resolve({ value, done: false });
|
|
39250
40079
|
} else {
|
|
39251
40080
|
this.queue.push(item);
|
|
40081
|
+
this.pumpConsumption();
|
|
39252
40082
|
}
|
|
39253
40083
|
});
|
|
39254
40084
|
}
|
|
@@ -39263,6 +40093,16 @@ class AcknowledgedAsyncChannel {
|
|
|
39263
40093
|
return;
|
|
39264
40094
|
this.closed = true;
|
|
39265
40095
|
this.failure = error;
|
|
40096
|
+
const consumption = this.consumption;
|
|
40097
|
+
this.consumption = null;
|
|
40098
|
+
if (consumption) {
|
|
40099
|
+
for (const item of consumption.active.keys())
|
|
40100
|
+
item.acknowledge(false);
|
|
40101
|
+
if (error)
|
|
40102
|
+
consumption.reject(error);
|
|
40103
|
+
else
|
|
40104
|
+
consumption.resolve();
|
|
40105
|
+
}
|
|
39266
40106
|
this.active?.acknowledge(false);
|
|
39267
40107
|
this.active = null;
|
|
39268
40108
|
for (const item of this.queue)
|
|
@@ -39278,6 +40118,65 @@ class AcknowledgedAsyncChannel {
|
|
|
39278
40118
|
else
|
|
39279
40119
|
waiter.resolve({ value: undefined, done: true });
|
|
39280
40120
|
}
|
|
40121
|
+
consume(handler, key, concurrency = 8) {
|
|
40122
|
+
if (this.iteratorClaimed)
|
|
40123
|
+
return Promise.reject(new ChannelConsumerError("AcknowledgedAsyncChannel supports one consumer"));
|
|
40124
|
+
if (!Number.isSafeInteger(concurrency) || concurrency < 1) {
|
|
40125
|
+
return Promise.reject(new ChannelConsumerError("Consumer concurrency must be a positive safe integer"));
|
|
40126
|
+
}
|
|
40127
|
+
if (this.closed)
|
|
40128
|
+
return this.failure ? Promise.reject(this.failure) : Promise.resolve();
|
|
40129
|
+
this.iteratorClaimed = true;
|
|
40130
|
+
return new Promise((resolve, reject) => {
|
|
40131
|
+
this.consumption = { handler, key, concurrency, active: new Map, resolve, reject };
|
|
40132
|
+
this.pumpConsumption();
|
|
40133
|
+
});
|
|
40134
|
+
}
|
|
40135
|
+
pumpConsumption() {
|
|
40136
|
+
const owner = this.consumption;
|
|
40137
|
+
if (!owner || this.closed)
|
|
40138
|
+
return;
|
|
40139
|
+
try {
|
|
40140
|
+
while (owner.active.size < owner.concurrency && this.queue.length > 0) {
|
|
40141
|
+
if ([...owner.active.values()].includes(null))
|
|
40142
|
+
return;
|
|
40143
|
+
const keys = new Set(owner.active.values());
|
|
40144
|
+
let index = -1;
|
|
40145
|
+
let key = null;
|
|
40146
|
+
for (let i = 0;i < this.queue.length; i++) {
|
|
40147
|
+
const candidate = this.queue[i];
|
|
40148
|
+
const candidateKey = owner.key(candidate.value);
|
|
40149
|
+
if (candidateKey === null) {
|
|
40150
|
+
if (i === 0 && owner.active.size === 0)
|
|
40151
|
+
index = i;
|
|
40152
|
+
break;
|
|
40153
|
+
}
|
|
40154
|
+
if (!keys.has(candidateKey)) {
|
|
40155
|
+
index = i;
|
|
40156
|
+
key = candidateKey;
|
|
40157
|
+
break;
|
|
40158
|
+
}
|
|
40159
|
+
}
|
|
40160
|
+
if (index < 0)
|
|
40161
|
+
return;
|
|
40162
|
+
const item = this.queue.splice(index, 1)[0];
|
|
40163
|
+
owner.active.set(item, key);
|
|
40164
|
+
Promise.resolve().then(() => owner.handler(item.value)).then(() => {
|
|
40165
|
+
if (this.consumption !== owner)
|
|
40166
|
+
return;
|
|
40167
|
+
owner.active.delete(item);
|
|
40168
|
+
this.bufferedBytes -= item.bytes;
|
|
40169
|
+
item.acknowledge(true);
|
|
40170
|
+
this.pumpConsumption();
|
|
40171
|
+
}, (error) => {
|
|
40172
|
+
if (this.consumption === owner)
|
|
40173
|
+
this.fail(error instanceof Error ? error : new Error("Inbound handler failed"));
|
|
40174
|
+
});
|
|
40175
|
+
}
|
|
40176
|
+
} catch (error) {
|
|
40177
|
+
this.fail(error instanceof Error ? error : new Error("Inbound routing failed"));
|
|
40178
|
+
}
|
|
40179
|
+
}
|
|
39281
40180
|
[Symbol.asyncIterator]() {
|
|
39282
40181
|
if (this.iteratorClaimed) {
|
|
39283
40182
|
return {
|
|
@@ -39285,8 +40184,11 @@ class AcknowledgedAsyncChannel {
|
|
|
39285
40184
|
};
|
|
39286
40185
|
}
|
|
39287
40186
|
this.iteratorClaimed = true;
|
|
40187
|
+
let returned = false;
|
|
39288
40188
|
return {
|
|
39289
40189
|
next: () => {
|
|
40190
|
+
if (returned)
|
|
40191
|
+
return Promise.resolve({ value: undefined, done: true });
|
|
39290
40192
|
if (this.active) {
|
|
39291
40193
|
this.bufferedBytes -= this.active.bytes;
|
|
39292
40194
|
this.active.acknowledge(true);
|
|
@@ -39310,6 +40212,11 @@ class AcknowledgedAsyncChannel {
|
|
|
39310
40212
|
});
|
|
39311
40213
|
},
|
|
39312
40214
|
return: () => {
|
|
40215
|
+
if (returned)
|
|
40216
|
+
return Promise.resolve({ value: undefined, done: true });
|
|
40217
|
+
returned = true;
|
|
40218
|
+
this.waiter?.resolve({ value: undefined, done: true });
|
|
40219
|
+
this.waiter = null;
|
|
39313
40220
|
if (this.active) {
|
|
39314
40221
|
this.bufferedBytes -= this.active.bytes;
|
|
39315
40222
|
this.active.acknowledge(false);
|
|
@@ -39988,10 +40895,12 @@ var normalizeRpcTimeoutMs = (timeoutMs, fallback) => {
|
|
|
39988
40895
|
|
|
39989
40896
|
class ProtocolClientError extends Error {
|
|
39990
40897
|
code;
|
|
40898
|
+
rpcCode;
|
|
39991
40899
|
constructor(code, details) {
|
|
39992
40900
|
super(details?.message ?? code);
|
|
39993
40901
|
this.code = code;
|
|
39994
40902
|
this.name = `ProtocolClientError:${code}`;
|
|
40903
|
+
this.rpcCode = details?.code;
|
|
39995
40904
|
}
|
|
39996
40905
|
}
|
|
39997
40906
|
var commitOutcomeUnknownError = (message) => new ProtocolClientError("commit-outcome-unknown", { message });
|
|
@@ -44814,8 +45723,11 @@ class InlineSdkClient {
|
|
|
44814
45723
|
peerResolutionRequestedByChatId = new Map;
|
|
44815
45724
|
recoveryReconnectInFlight = null;
|
|
44816
45725
|
degradedUpdateBuckets = new Map;
|
|
45726
|
+
discoveryRetry = null;
|
|
45727
|
+
recoveryRetries = new Map;
|
|
44817
45728
|
liveCursorFences = new Set;
|
|
44818
45729
|
liveAdmittedSeqByBucket = new Map;
|
|
45730
|
+
liveDeliveriesByBucket = new Map;
|
|
44819
45731
|
discoveryRound = null;
|
|
44820
45732
|
discoveryInFlight = null;
|
|
44821
45733
|
discoveryCommitInFlight = null;
|
|
@@ -44908,12 +45820,14 @@ class InlineSdkClient {
|
|
|
44908
45820
|
}
|
|
44909
45821
|
}
|
|
44910
45822
|
async close() {
|
|
44911
|
-
|
|
44912
|
-
return;
|
|
45823
|
+
const wasStarted = this.started;
|
|
44913
45824
|
this.closed = true;
|
|
44914
45825
|
this.started = false;
|
|
45826
|
+
this.cancelRecoveryRetries();
|
|
44915
45827
|
this.rejectOpen(new Error("closed"));
|
|
44916
45828
|
this.eventStream.close();
|
|
45829
|
+
if (!wasStarted)
|
|
45830
|
+
return;
|
|
44917
45831
|
await settleWithin(this.protocol.stopTransport(), closeJoinTimeoutMs, () => this.log.warn?.("Timed out stopping SDK transport during close"));
|
|
44918
45832
|
await settleWithin(Promise.allSettled([
|
|
44919
45833
|
...this.catchUpInFlightByChatId.values(),
|
|
@@ -44975,6 +45889,20 @@ class InlineSdkClient {
|
|
|
44975
45889
|
events() {
|
|
44976
45890
|
return this.eventStream;
|
|
44977
45891
|
}
|
|
45892
|
+
consumeEvents(handler, options) {
|
|
45893
|
+
return this.eventStream.consume(handler, (event) => {
|
|
45894
|
+
const bucket = this.bucketForEvent(event);
|
|
45895
|
+
if (bucket?.kind === "user")
|
|
45896
|
+
return null;
|
|
45897
|
+
if (bucket)
|
|
45898
|
+
return this.updateBucketKey(bucket);
|
|
45899
|
+
return "chatId" in event && typeof event.chatId === "bigint" ? `chat:${event.chatId}` : null;
|
|
45900
|
+
}, options?.concurrency).catch(async (error) => {
|
|
45901
|
+
if (!(error instanceof ChannelConsumerError))
|
|
45902
|
+
await this.close();
|
|
45903
|
+
throw error;
|
|
45904
|
+
});
|
|
45905
|
+
}
|
|
44978
45906
|
exportState() {
|
|
44979
45907
|
return {
|
|
44980
45908
|
version: 1,
|
|
@@ -45384,6 +46312,7 @@ class InlineSdkClient {
|
|
|
45384
46312
|
this.log.error?.("SDK listener crashed", failure);
|
|
45385
46313
|
this.started = false;
|
|
45386
46314
|
this.closed = true;
|
|
46315
|
+
this.cancelRecoveryRetries();
|
|
45387
46316
|
this.rejectOpen(failure);
|
|
45388
46317
|
this.eventStream.fail(failure);
|
|
45389
46318
|
this.protocol.stopTransport().catch((stopError) => {
|
|
@@ -45396,6 +46325,7 @@ class InlineSdkClient {
|
|
|
45396
46325
|
return;
|
|
45397
46326
|
this.authenticationError = error;
|
|
45398
46327
|
this.started = false;
|
|
46328
|
+
this.cancelRecoveryRetries();
|
|
45399
46329
|
this.rejectOpen(error);
|
|
45400
46330
|
this.eventStream.close();
|
|
45401
46331
|
try {
|
|
@@ -45405,6 +46335,7 @@ class InlineSdkClient {
|
|
|
45405
46335
|
}
|
|
45406
46336
|
}
|
|
45407
46337
|
async onOpen() {
|
|
46338
|
+
this.cancelRecoveryRetries();
|
|
45408
46339
|
this.requestCatchUpUser();
|
|
45409
46340
|
for (const bucket of this.degradedUpdateBuckets.values()) {
|
|
45410
46341
|
this.requestCatchUpForDegradedBucket(bucket);
|
|
@@ -45455,6 +46386,8 @@ class InlineSdkClient {
|
|
|
45455
46386
|
return this.discoveryInFlight;
|
|
45456
46387
|
if (this.discoveryCommitInFlight)
|
|
45457
46388
|
return this.discoveryCommitInFlight;
|
|
46389
|
+
if (this.discoveryRetry?.timer)
|
|
46390
|
+
return;
|
|
45458
46391
|
const round = {
|
|
45459
46392
|
resultReceived: false,
|
|
45460
46393
|
collectingHints: true,
|
|
@@ -45487,6 +46420,11 @@ class InlineSdkClient {
|
|
|
45487
46420
|
this.log.warn?.("GET_UPDATES_STATE failed (continuing without date cursor)", error);
|
|
45488
46421
|
if (this.discoveryRound === round)
|
|
45489
46422
|
this.discoveryRound = null;
|
|
46423
|
+
if (error instanceof ProtocolClientError && (error.code === "timeout" || error.code === "not-connected" || error.code === "capacity-exceeded" || error.rpcCode === RpcError_Code.INTERNAL_ERROR || error.rpcCode === 500 || error.rpcCode === RpcError_Code.RATE_LIMIT || error.rpcCode === 429)) {
|
|
46424
|
+
this.scheduleDiscoveryRetry(error.rpcCode === RpcError_Code.RATE_LIMIT || error.rpcCode === 429 ? "rate_limited" : "discovery_failed");
|
|
46425
|
+
} else {
|
|
46426
|
+
this.log.error?.("Sync discovery unavailable", { reason: "request_rejected" });
|
|
46427
|
+
}
|
|
45490
46428
|
}
|
|
45491
46429
|
}
|
|
45492
46430
|
tryCommitDiscoveryRound(round) {
|
|
@@ -45511,12 +46449,15 @@ class InlineSdkClient {
|
|
|
45511
46449
|
return;
|
|
45512
46450
|
if (saved) {
|
|
45513
46451
|
this.discoveryRound = null;
|
|
46452
|
+
clearTimeout(this.discoveryRetry?.timer);
|
|
46453
|
+
this.discoveryRetry = null;
|
|
45514
46454
|
return;
|
|
45515
46455
|
}
|
|
45516
46456
|
this.state.dateCursor = previousDateCursor;
|
|
45517
46457
|
this.scheduleStateSave();
|
|
45518
46458
|
this.discoveryRound = null;
|
|
45519
46459
|
this.log.warn?.("Failed to persist discovery checkpoint; preserving previous date cursor");
|
|
46460
|
+
this.scheduleDiscoveryRetry("checkpoint_write_failed");
|
|
45520
46461
|
}).finally(() => {
|
|
45521
46462
|
if (this.discoveryCommitInFlight === commit)
|
|
45522
46463
|
this.discoveryCommitInFlight = null;
|
|
@@ -45851,20 +46792,23 @@ class InlineSdkClient {
|
|
|
45851
46792
|
try {
|
|
45852
46793
|
acknowledged = this.eventStream.send(event);
|
|
45853
46794
|
} catch (error) {
|
|
45854
|
-
const
|
|
45855
|
-
if (
|
|
45856
|
-
this.fenceLiveCursor(
|
|
45857
|
-
this.markUpdateBucketDegraded(
|
|
45858
|
-
this.requestCatchUpAfterEventOverflow(
|
|
46795
|
+
const bucket2 = this.bucketForEvent(event);
|
|
46796
|
+
if (bucket2) {
|
|
46797
|
+
this.fenceLiveCursor(bucket2);
|
|
46798
|
+
this.markUpdateBucketDegraded(bucket2);
|
|
46799
|
+
this.requestCatchUpAfterEventOverflow(bucket2, event);
|
|
45859
46800
|
}
|
|
45860
46801
|
this.log.warn?.("Inbound event buffer overflow; durable cursor remains unchanged and transport will recover", {
|
|
45861
|
-
bucket:
|
|
46802
|
+
bucket: bucket2 ? this.updateBucketKey(bucket2) : "none",
|
|
45862
46803
|
error: extractErrorMessage(error)
|
|
45863
46804
|
});
|
|
45864
46805
|
this.requestRecoveryReconnect("inbound-event-buffer-overflow");
|
|
45865
46806
|
return Promise.resolve(false);
|
|
45866
46807
|
}
|
|
45867
|
-
|
|
46808
|
+
const bucket = source === "live" ? this.sequencedBucketForEvent(event) : undefined;
|
|
46809
|
+
const key = bucket ? this.updateBucketKey(bucket) : undefined;
|
|
46810
|
+
const deliveries = key ? this.liveDeliveriesByBucket.get(key) ?? new Set : undefined;
|
|
46811
|
+
const delivery = acknowledged.then((applied) => {
|
|
45868
46812
|
if (applied) {
|
|
45869
46813
|
onApplied?.();
|
|
45870
46814
|
if (source === "live")
|
|
@@ -45872,8 +46816,16 @@ class InlineSdkClient {
|
|
|
45872
46816
|
} else if (source === "live" && this.started) {
|
|
45873
46817
|
this.recoverLiveEvent(event, "consumer-did-not-apply");
|
|
45874
46818
|
}
|
|
46819
|
+
deliveries?.delete(delivery);
|
|
46820
|
+
if (key && deliveries?.size === 0)
|
|
46821
|
+
this.liveDeliveriesByBucket.delete(key);
|
|
45875
46822
|
return applied;
|
|
45876
46823
|
});
|
|
46824
|
+
if (key && deliveries) {
|
|
46825
|
+
deliveries.add(delivery);
|
|
46826
|
+
this.liveDeliveriesByBucket.set(key, deliveries);
|
|
46827
|
+
}
|
|
46828
|
+
return delivery;
|
|
45877
46829
|
}
|
|
45878
46830
|
bucketForEvent(event) {
|
|
45879
46831
|
switch (event.kind) {
|
|
@@ -46051,20 +47003,25 @@ class InlineSdkClient {
|
|
|
46051
47003
|
}
|
|
46052
47004
|
requestCatchUpForDegradedBucket(bucket) {
|
|
46053
47005
|
switch (bucket.kind) {
|
|
46054
|
-
case "chat":
|
|
46055
|
-
|
|
46056
|
-
|
|
47006
|
+
case "chat": {
|
|
47007
|
+
const request = this.catchUpRequestedByChatId.get(bucket.chatId) ?? this.peerResolutionRequestedByChatId.get(bucket.chatId);
|
|
47008
|
+
const updateSeq = request && !request.toLatest ? request.endSeq : undefined;
|
|
47009
|
+
const peer = bucket.peer ?? this.persistedChatPeer(bucket.chatId);
|
|
47010
|
+
if (peer && this.isReliableChatPeer(peer)) {
|
|
47011
|
+
this.requestCatchUpChat({ chatId: bucket.chatId, peer, updateSeq });
|
|
46057
47012
|
} else {
|
|
46058
|
-
|
|
46059
|
-
if (persistedPeer)
|
|
46060
|
-
this.requestCatchUpChat({ chatId: bucket.chatId, peer: persistedPeer });
|
|
46061
|
-
else
|
|
46062
|
-
this.resolvePersistedChatPeer(bucket.chatId);
|
|
47013
|
+
this.resolvePersistedChatPeer(bucket.chatId, updateSeq);
|
|
46063
47014
|
}
|
|
46064
47015
|
return;
|
|
46065
|
-
|
|
46066
|
-
|
|
47016
|
+
}
|
|
47017
|
+
case "space": {
|
|
47018
|
+
const request = this.catchUpRequestedBySpaceId.get(bucket.spaceId);
|
|
47019
|
+
this.requestCatchUpSpace({
|
|
47020
|
+
spaceId: bucket.spaceId,
|
|
47021
|
+
updateSeq: request && !request.toLatest ? request.endSeq : undefined
|
|
47022
|
+
});
|
|
46067
47023
|
return;
|
|
47024
|
+
}
|
|
46068
47025
|
case "user":
|
|
46069
47026
|
this.requestCatchUpUser(true);
|
|
46070
47027
|
return;
|
|
@@ -46249,7 +47206,7 @@ class InlineSdkClient {
|
|
|
46249
47206
|
bumpChatSeq(chatId, seq, source) {
|
|
46250
47207
|
if (source === "user" || source === "space" || source === "chat")
|
|
46251
47208
|
return;
|
|
46252
|
-
if (source === "live" && this.liveCursorFences.has(`chat:${chatId}`))
|
|
47209
|
+
if (source === "live" && this.liveCursorFences.has(`chat:${chatId}`) && seq !== (this.state.lastSeqByChatId?.[chatId.toString()] ?? 0) + 1)
|
|
46253
47210
|
return;
|
|
46254
47211
|
if (!Number.isFinite(seq))
|
|
46255
47212
|
return;
|
|
@@ -46258,6 +47215,7 @@ class InlineSdkClient {
|
|
|
46258
47215
|
const key = chatId.toString();
|
|
46259
47216
|
const prev = this.state.lastSeqByChatId[key] ?? 0;
|
|
46260
47217
|
if (seq > prev) {
|
|
47218
|
+
this.resetRecoveryBackoff({ kind: "chat", chatId });
|
|
46261
47219
|
this.state.lastSeqByChatId[key] = seq;
|
|
46262
47220
|
this.scheduleStateSave();
|
|
46263
47221
|
}
|
|
@@ -46266,7 +47224,7 @@ class InlineSdkClient {
|
|
|
46266
47224
|
bumpSpaceSeq(spaceId, seq, source) {
|
|
46267
47225
|
if (source === "user" || source === "space" || source === "chat")
|
|
46268
47226
|
return;
|
|
46269
|
-
if (source === "live" && this.liveCursorFences.has(`space:${spaceId}`))
|
|
47227
|
+
if (source === "live" && this.liveCursorFences.has(`space:${spaceId}`) && seq !== (this.state.lastSeqBySpaceId?.[spaceId.toString()] ?? 0) + 1)
|
|
46270
47228
|
return;
|
|
46271
47229
|
if (!Number.isFinite(seq))
|
|
46272
47230
|
return;
|
|
@@ -46275,6 +47233,7 @@ class InlineSdkClient {
|
|
|
46275
47233
|
const key = spaceId.toString();
|
|
46276
47234
|
const prev = this.state.lastSeqBySpaceId[key] ?? 0;
|
|
46277
47235
|
if (seq > prev) {
|
|
47236
|
+
this.resetRecoveryBackoff({ kind: "space", spaceId });
|
|
46278
47237
|
this.state.lastSeqBySpaceId[key] = seq;
|
|
46279
47238
|
this.scheduleStateSave();
|
|
46280
47239
|
}
|
|
@@ -46289,12 +47248,13 @@ class InlineSdkClient {
|
|
|
46289
47248
|
bumpUserSeq(seq, source) {
|
|
46290
47249
|
if (source === "user" || source === "space" || source === "chat")
|
|
46291
47250
|
return;
|
|
46292
|
-
if (source === "live" && this.liveCursorFences.has("user"))
|
|
47251
|
+
if (source === "live" && this.liveCursorFences.has("user") && seq !== (this.state.lastUserSeq ?? 0) + 1)
|
|
46293
47252
|
return;
|
|
46294
47253
|
if (!Number.isFinite(seq) || seq <= 0)
|
|
46295
47254
|
return;
|
|
46296
47255
|
const prev = this.state.lastUserSeq ?? 0;
|
|
46297
47256
|
if (seq > prev) {
|
|
47257
|
+
this.resetRecoveryBackoff({ kind: "user" });
|
|
46298
47258
|
this.state.lastUserSeq = seq;
|
|
46299
47259
|
this.scheduleStateSave();
|
|
46300
47260
|
}
|
|
@@ -46308,14 +47268,17 @@ class InlineSdkClient {
|
|
|
46308
47268
|
if (this.userCatchUpInFlight) {
|
|
46309
47269
|
return this.userCatchUpInFlight;
|
|
46310
47270
|
}
|
|
47271
|
+
if (this.recoveryRetries.get("user")?.timer)
|
|
47272
|
+
return null;
|
|
46311
47273
|
this.fenceLiveCursor({ kind: "user" });
|
|
46312
47274
|
this.userCatchUpInFlight = this.doCatchUpUser(lastUserSeq ?? 0).catch((error) => {
|
|
46313
|
-
this.
|
|
47275
|
+
this.recordCatchUpFailure({ kind: "user" }, error);
|
|
46314
47276
|
this.log.warn?.("GET_UPDATES user catch-up failed; bucket remains degraded", {
|
|
46315
47277
|
error: extractErrorMessage(error)
|
|
46316
47278
|
});
|
|
46317
47279
|
}).finally(() => {
|
|
46318
47280
|
this.userCatchUpInFlight = null;
|
|
47281
|
+
this.scheduleRecoveryRetry({ kind: "user" });
|
|
46319
47282
|
});
|
|
46320
47283
|
return this.userCatchUpInFlight;
|
|
46321
47284
|
}
|
|
@@ -46368,7 +47331,7 @@ class InlineSdkClient {
|
|
|
46368
47331
|
});
|
|
46369
47332
|
}
|
|
46370
47333
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
46371
|
-
this.markUpdateBucketDegraded({ kind: "user" });
|
|
47334
|
+
this.markUpdateBucketDegraded({ kind: "user" }, "non_progress");
|
|
46372
47335
|
this.log.warn?.("GET_UPDATES user catch-up made no progress; bucket remains degraded", {
|
|
46373
47336
|
cursor,
|
|
46374
47337
|
deliveredSeq
|
|
@@ -46404,15 +47367,18 @@ class InlineSdkClient {
|
|
|
46404
47367
|
const existing = this.catchUpInFlightByChatId.get(params.chatId);
|
|
46405
47368
|
if (existing)
|
|
46406
47369
|
return existing;
|
|
47370
|
+
if (this.recoveryRetries.get(`chat:${params.chatId}`)?.timer)
|
|
47371
|
+
return Promise.resolve();
|
|
47372
|
+
const initialDemand = this.catchUpRequestedByChatId.get(params.chatId);
|
|
46407
47373
|
const task = this.drainCatchUpChat(params.chatId).catch((error) => {
|
|
46408
|
-
this.catchUpRequestedByChatId.
|
|
46409
|
-
this.markUpdateBucketDegraded({ kind: "chat", chatId: params.chatId, peer: params.peer });
|
|
47374
|
+
this.recordCatchUpFailure({ kind: "chat", chatId: params.chatId, peer: params.peer }, error, this.catchUpRequestedByChatId.get(params.chatId) !== initialDemand);
|
|
46410
47375
|
this.log.warn?.("GET_UPDATES chat catch-up failed; bucket remains degraded", {
|
|
46411
47376
|
chatId: params.chatId.toString(),
|
|
46412
47377
|
error: extractErrorMessage(error)
|
|
46413
47378
|
});
|
|
46414
47379
|
}).finally(() => {
|
|
46415
47380
|
this.catchUpInFlightByChatId.delete(params.chatId);
|
|
47381
|
+
this.scheduleRecoveryRetry({ kind: "chat", chatId: params.chatId });
|
|
46416
47382
|
});
|
|
46417
47383
|
this.catchUpInFlightByChatId.set(params.chatId, task);
|
|
46418
47384
|
return task;
|
|
@@ -46436,12 +47402,8 @@ class InlineSdkClient {
|
|
|
46436
47402
|
if (stop) {
|
|
46437
47403
|
if (this.catchUpRequestedByChatId.get(chatId) !== request)
|
|
46438
47404
|
continue;
|
|
46439
|
-
this.
|
|
46440
|
-
|
|
46441
|
-
}
|
|
46442
|
-
const latest = this.catchUpRequestedByChatId.get(chatId);
|
|
46443
|
-
const syncedSeq = this.state.lastSeqByChatId?.[key] ?? 0;
|
|
46444
|
-
if (!latest || latest.endSeq != null && latest.endSeq <= syncedSeq) {
|
|
47405
|
+
if (this.degradedUpdateBuckets.has(`chat:${chatId}`))
|
|
47406
|
+
return;
|
|
46445
47407
|
this.catchUpRequestedByChatId.delete(chatId);
|
|
46446
47408
|
return;
|
|
46447
47409
|
}
|
|
@@ -46508,7 +47470,7 @@ class InlineSdkClient {
|
|
|
46508
47470
|
});
|
|
46509
47471
|
}
|
|
46510
47472
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
46511
|
-
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
47473
|
+
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer }, "non_progress");
|
|
46512
47474
|
this.log.warn?.("GET_UPDATES made no progress; bucket remains degraded", {
|
|
46513
47475
|
chatId: chatId.toString(),
|
|
46514
47476
|
cursor,
|
|
@@ -46526,7 +47488,7 @@ class InlineSdkClient {
|
|
|
46526
47488
|
continue;
|
|
46527
47489
|
}
|
|
46528
47490
|
if (endSeq != null && deliveredSeq < endSeq) {
|
|
46529
|
-
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
47491
|
+
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer }, "target_not_reached");
|
|
46530
47492
|
this.log.warn?.("GET_UPDATES final chat page remained behind the requested target", {
|
|
46531
47493
|
chatId: chatId.toString(),
|
|
46532
47494
|
requestedEndSeq: endSeq,
|
|
@@ -46552,15 +47514,18 @@ class InlineSdkClient {
|
|
|
46552
47514
|
const existing = this.catchUpInFlightBySpaceId.get(params.spaceId);
|
|
46553
47515
|
if (existing)
|
|
46554
47516
|
return existing;
|
|
47517
|
+
if (this.recoveryRetries.get(`space:${params.spaceId}`)?.timer)
|
|
47518
|
+
return Promise.resolve();
|
|
47519
|
+
const initialDemand = this.catchUpRequestedBySpaceId.get(params.spaceId);
|
|
46555
47520
|
const task = this.drainCatchUpSpace(params.spaceId).catch((error) => {
|
|
46556
|
-
this.catchUpRequestedBySpaceId.
|
|
46557
|
-
this.markUpdateBucketDegraded({ kind: "space", spaceId: params.spaceId });
|
|
47521
|
+
this.recordCatchUpFailure({ kind: "space", spaceId: params.spaceId }, error, this.catchUpRequestedBySpaceId.get(params.spaceId) !== initialDemand);
|
|
46558
47522
|
this.log.warn?.("GET_UPDATES space catch-up failed; bucket remains degraded", {
|
|
46559
47523
|
spaceId: params.spaceId.toString(),
|
|
46560
47524
|
error: extractErrorMessage(error)
|
|
46561
47525
|
});
|
|
46562
47526
|
}).finally(() => {
|
|
46563
47527
|
this.catchUpInFlightBySpaceId.delete(params.spaceId);
|
|
47528
|
+
this.scheduleRecoveryRetry({ kind: "space", spaceId: params.spaceId });
|
|
46564
47529
|
});
|
|
46565
47530
|
this.catchUpInFlightBySpaceId.set(params.spaceId, task);
|
|
46566
47531
|
return task;
|
|
@@ -46584,12 +47549,8 @@ class InlineSdkClient {
|
|
|
46584
47549
|
if (stop) {
|
|
46585
47550
|
if (this.catchUpRequestedBySpaceId.get(spaceId) !== request)
|
|
46586
47551
|
continue;
|
|
46587
|
-
this.
|
|
46588
|
-
|
|
46589
|
-
}
|
|
46590
|
-
const latest = this.catchUpRequestedBySpaceId.get(spaceId);
|
|
46591
|
-
const syncedSeq = this.state.lastSeqBySpaceId?.[key] ?? 0;
|
|
46592
|
-
if (!latest || latest.endSeq != null && latest.endSeq <= syncedSeq) {
|
|
47552
|
+
if (this.degradedUpdateBuckets.has(`space:${spaceId}`))
|
|
47553
|
+
return;
|
|
46593
47554
|
this.catchUpRequestedBySpaceId.delete(spaceId);
|
|
46594
47555
|
return;
|
|
46595
47556
|
}
|
|
@@ -46658,7 +47619,7 @@ class InlineSdkClient {
|
|
|
46658
47619
|
});
|
|
46659
47620
|
}
|
|
46660
47621
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
46661
|
-
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
47622
|
+
this.markUpdateBucketDegraded({ kind: "space", spaceId }, "non_progress");
|
|
46662
47623
|
this.log.warn?.("GET_UPDATES space made no progress; bucket remains degraded", {
|
|
46663
47624
|
spaceId: spaceId.toString(),
|
|
46664
47625
|
cursor,
|
|
@@ -46676,7 +47637,7 @@ class InlineSdkClient {
|
|
|
46676
47637
|
continue;
|
|
46677
47638
|
}
|
|
46678
47639
|
if (endSeq != null && deliveredSeq < endSeq) {
|
|
46679
|
-
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
47640
|
+
this.markUpdateBucketDegraded({ kind: "space", spaceId }, "target_not_reached");
|
|
46680
47641
|
this.log.warn?.("GET_UPDATES final space page remained behind the requested target", {
|
|
46681
47642
|
spaceId: spaceId.toString(),
|
|
46682
47643
|
requestedEndSeq: endSeq,
|
|
@@ -46701,6 +47662,9 @@ class InlineSdkClient {
|
|
|
46701
47662
|
const existing = this.peerResolutionInFlightByChatId.get(chatId);
|
|
46702
47663
|
if (existing)
|
|
46703
47664
|
return existing;
|
|
47665
|
+
if (this.recoveryRetries.get(`chat:${chatId}`)?.timer)
|
|
47666
|
+
return Promise.resolve();
|
|
47667
|
+
const initialDemand = this.peerResolutionRequestedByChatId.get(chatId);
|
|
46704
47668
|
const task = this.getChat({ chatId }).then(async (chat) => {
|
|
46705
47669
|
const peer = chat.peer;
|
|
46706
47670
|
if (!peer || !this.isReliableChatPeer(peer)) {
|
|
@@ -46714,14 +47678,16 @@ class InlineSdkClient {
|
|
|
46714
47678
|
...requested && !requested.toLatest && requested.endSeq != null ? { updateSeq: requested.endSeq } : {}
|
|
46715
47679
|
});
|
|
46716
47680
|
}).catch((error) => {
|
|
46717
|
-
this.
|
|
47681
|
+
this.recordCatchUpFailure({ kind: "chat", chatId }, error, this.peerResolutionRequestedByChatId.get(chatId) !== initialDemand);
|
|
46718
47682
|
this.log.warn?.("Unable to resolve legacy chat peer; bucket remains degraded", {
|
|
46719
47683
|
chatId: chatId.toString(),
|
|
46720
47684
|
error: extractErrorMessage(error)
|
|
46721
47685
|
});
|
|
46722
47686
|
}).finally(() => {
|
|
46723
47687
|
this.peerResolutionInFlightByChatId.delete(chatId);
|
|
46724
|
-
this.
|
|
47688
|
+
if (!this.degradedUpdateBuckets.has(`chat:${chatId}`))
|
|
47689
|
+
this.peerResolutionRequestedByChatId.delete(chatId);
|
|
47690
|
+
this.scheduleRecoveryRetry({ kind: "chat", chatId });
|
|
46725
47691
|
});
|
|
46726
47692
|
this.peerResolutionInFlightByChatId.set(chatId, task);
|
|
46727
47693
|
return task;
|
|
@@ -46774,7 +47740,7 @@ class InlineSdkClient {
|
|
|
46774
47740
|
}
|
|
46775
47741
|
validateCatchUpPage(payload, startSeq, bucket) {
|
|
46776
47742
|
if (payload.resultType !== GetUpdatesResult_ResultType.SLICE && payload.resultType !== GetUpdatesResult_ResultType.EMPTY) {
|
|
46777
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47743
|
+
this.markUpdateBucketDegraded(bucket, "invalid_page_type");
|
|
46778
47744
|
this.log.warn?.("GET_UPDATES returned an invalid page result type; bucket remains degraded", {
|
|
46779
47745
|
bucket: this.updateBucketKey(bucket),
|
|
46780
47746
|
resultType: payload.resultType
|
|
@@ -46783,7 +47749,7 @@ class InlineSdkClient {
|
|
|
46783
47749
|
}
|
|
46784
47750
|
const deliveredSeq = Number(payload.seq);
|
|
46785
47751
|
if (!Number.isSafeInteger(deliveredSeq) || deliveredSeq < startSeq) {
|
|
46786
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47752
|
+
this.markUpdateBucketDegraded(bucket, "invalid_page_cursor");
|
|
46787
47753
|
this.log.warn?.("GET_UPDATES page moved backwards or returned an invalid seq; bucket remains degraded", {
|
|
46788
47754
|
bucket: this.updateBucketKey(bucket),
|
|
46789
47755
|
startSeq,
|
|
@@ -46795,7 +47761,7 @@ class InlineSdkClient {
|
|
|
46795
47761
|
for (const update of payload.updates) {
|
|
46796
47762
|
const seq = update.seq;
|
|
46797
47763
|
if (!Number.isSafeInteger(seq) || seq == null || seq <= startSeq || seq > deliveredSeq || accounted.has(seq)) {
|
|
46798
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47764
|
+
this.markUpdateBucketDegraded(bucket, "invalid_update_sequence");
|
|
46799
47765
|
this.log.warn?.("GET_UPDATES page included an invalid or duplicate update seq; bucket remains degraded", {
|
|
46800
47766
|
bucket: this.updateBucketKey(bucket),
|
|
46801
47767
|
seq
|
|
@@ -46808,7 +47774,7 @@ class InlineSdkClient {
|
|
|
46808
47774
|
for (const skipped of payload.skippedSequences) {
|
|
46809
47775
|
const seq = Number(skipped.seq);
|
|
46810
47776
|
if (!Number.isSafeInteger(seq) || seq <= startSeq || seq > deliveredSeq || accounted.has(seq)) {
|
|
46811
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47777
|
+
this.markUpdateBucketDegraded(bucket, "invalid_skipped_sequence");
|
|
46812
47778
|
this.log.warn?.("GET_UPDATES page included an invalid or duplicate skipped seq; bucket remains degraded", {
|
|
46813
47779
|
bucket: this.updateBucketKey(bucket),
|
|
46814
47780
|
seq
|
|
@@ -46824,7 +47790,7 @@ class InlineSdkClient {
|
|
|
46824
47790
|
break;
|
|
46825
47791
|
case SyncSkippedSequence_Reason.REASON_UNSPECIFIED:
|
|
46826
47792
|
default:
|
|
46827
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47793
|
+
this.markUpdateBucketDegraded(bucket, "unknown_skip_reason");
|
|
46828
47794
|
this.log.warn?.("GET_UPDATES page included an unsupported skipped-sequence reason; bucket remains degraded", {
|
|
46829
47795
|
bucket: this.updateBucketKey(bucket),
|
|
46830
47796
|
reason: skipped.reason
|
|
@@ -46833,7 +47799,7 @@ class InlineSdkClient {
|
|
|
46833
47799
|
}
|
|
46834
47800
|
}
|
|
46835
47801
|
if (accounted.size !== deliveredSeq - startSeq) {
|
|
46836
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47802
|
+
this.markUpdateBucketDegraded(bucket, "unaccounted_gap");
|
|
46837
47803
|
this.log.warn?.("GET_UPDATES page did not account for every advanced sequence; bucket remains degraded", {
|
|
46838
47804
|
bucket: this.updateBucketKey(bucket),
|
|
46839
47805
|
startSeq,
|
|
@@ -46915,7 +47881,7 @@ class InlineSdkClient {
|
|
|
46915
47881
|
this.clearUpdateBucketDegraded(bucket);
|
|
46916
47882
|
return true;
|
|
46917
47883
|
} catch (error) {
|
|
46918
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47884
|
+
this.markUpdateBucketDegraded(bucket, "repair_failed");
|
|
46919
47885
|
this.log.warn?.("Authoritative update repair failed; bucket remains degraded", {
|
|
46920
47886
|
bucket: this.updateBucketKey(bucket),
|
|
46921
47887
|
error: extractErrorMessage(error)
|
|
@@ -46924,7 +47890,17 @@ class InlineSdkClient {
|
|
|
46924
47890
|
}
|
|
46925
47891
|
}
|
|
46926
47892
|
async acceptCatchUpUpdates(updates, source, bucket) {
|
|
47893
|
+
const liveDeliveries = this.liveDeliveriesByBucket.get(this.updateBucketKey(bucket));
|
|
47894
|
+
if (liveDeliveries && (await Promise.all(liveDeliveries)).some((applied) => !applied)) {
|
|
47895
|
+
this.markUpdateBucketDegraded(bucket, "host_unacknowledged");
|
|
47896
|
+
return false;
|
|
47897
|
+
}
|
|
47898
|
+
if (this.closed)
|
|
47899
|
+
return false;
|
|
47900
|
+
const appliedThrough = this.bucketCursor(bucket);
|
|
46927
47901
|
for (const update of updates) {
|
|
47902
|
+
if (update.seq != null && update.seq > 0 && update.seq <= appliedThrough)
|
|
47903
|
+
continue;
|
|
46928
47904
|
if (update.update.oneofKind === "chatSkipPts" && source === "chat") {
|
|
46929
47905
|
continue;
|
|
46930
47906
|
}
|
|
@@ -46935,7 +47911,7 @@ class InlineSdkClient {
|
|
|
46935
47911
|
if (accepted === true)
|
|
46936
47912
|
continue;
|
|
46937
47913
|
if (accepted === false) {
|
|
46938
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47914
|
+
this.markUpdateBucketDegraded(bucket, "host_unacknowledged");
|
|
46939
47915
|
this.log.warn?.("GET_UPDATES event was not acknowledged by the SDK host; cursor remains unchanged", {
|
|
46940
47916
|
bucket: this.updateBucketKey(bucket),
|
|
46941
47917
|
updateKind: update.update.oneofKind
|
|
@@ -46956,8 +47932,95 @@ class InlineSdkClient {
|
|
|
46956
47932
|
}
|
|
46957
47933
|
return true;
|
|
46958
47934
|
}
|
|
46959
|
-
|
|
46960
|
-
|
|
47935
|
+
recordCatchUpFailure(bucket, error, hasNewerDemand = false) {
|
|
47936
|
+
const rpcCode = error instanceof ProtocolClientError ? error.rpcCode : undefined;
|
|
47937
|
+
if (!hasNewerDemand && bucket.kind !== "user" && (rpcCode === RpcError_Code.PEER_ID_INVALID || rpcCode === RpcError_Code.CHAT_ID_INVALID || rpcCode === RpcError_Code.SPACE_ID_INVALID)) {
|
|
47938
|
+
this.clearUpdateBucketDegraded(bucket);
|
|
47939
|
+
if (bucket.kind === "chat") {
|
|
47940
|
+
this.catchUpRequestedByChatId.delete(bucket.chatId);
|
|
47941
|
+
this.peerResolutionRequestedByChatId.delete(bucket.chatId);
|
|
47942
|
+
} else
|
|
47943
|
+
this.catchUpRequestedBySpaceId.delete(bucket.spaceId);
|
|
47944
|
+
const round = this.discoveryRound;
|
|
47945
|
+
if (round) {
|
|
47946
|
+
round.targets.delete(this.updateBucketKey(bucket));
|
|
47947
|
+
this.tryCommitDiscoveryRound(round);
|
|
47948
|
+
}
|
|
47949
|
+
this.log.error?.("Sync bucket unavailable", { bucketKind: bucket.kind, reason: "access_rejected" });
|
|
47950
|
+
return;
|
|
47951
|
+
}
|
|
47952
|
+
this.markUpdateBucketDegraded(bucket, rpcCode === RpcError_Code.RATE_LIMIT || rpcCode === 429 ? "rate_limited" : error instanceof ProtocolClientError ? error.code : "request_failed");
|
|
47953
|
+
}
|
|
47954
|
+
markUpdateBucketDegraded(bucket, failure = "incomplete") {
|
|
47955
|
+
const key = this.updateBucketKey(bucket);
|
|
47956
|
+
this.degradedUpdateBuckets.set(key, bucket);
|
|
47957
|
+
const retry = this.recoveryRetries.get(key) ?? { attempt: 0, failure, reported: new Set };
|
|
47958
|
+
retry.failure = failure;
|
|
47959
|
+
this.recoveryRetries.set(key, retry);
|
|
47960
|
+
queueMicrotask(() => this.scheduleRecoveryRetry(bucket));
|
|
47961
|
+
}
|
|
47962
|
+
resetRecoveryBackoff(bucket) {
|
|
47963
|
+
const retry = this.recoveryRetries.get(this.updateBucketKey(bucket));
|
|
47964
|
+
if (retry)
|
|
47965
|
+
retry.attempt = 0;
|
|
47966
|
+
}
|
|
47967
|
+
cancelRecoveryRetries() {
|
|
47968
|
+
clearTimeout(this.discoveryRetry?.timer);
|
|
47969
|
+
this.discoveryRetry = null;
|
|
47970
|
+
for (const retry of this.recoveryRetries.values())
|
|
47971
|
+
clearTimeout(retry.timer);
|
|
47972
|
+
this.recoveryRetries.clear();
|
|
47973
|
+
}
|
|
47974
|
+
scheduleDiscoveryRetry(reason) {
|
|
47975
|
+
if (!this.started || this.closed || this.protocol.getDiagnostics().state !== "open")
|
|
47976
|
+
return;
|
|
47977
|
+
const retry = this.discoveryRetry ?? { attempt: 0, reported: new Set };
|
|
47978
|
+
if (retry.timer)
|
|
47979
|
+
return;
|
|
47980
|
+
if (!retry.reported.has(reason)) {
|
|
47981
|
+
retry.reported.add(reason);
|
|
47982
|
+
this.log.error?.("Sync recovery scheduled", { bucketKind: "discovery", reason });
|
|
47983
|
+
}
|
|
47984
|
+
const delayMs = reason === "rate_limited" ? 60000 : Math.min(30000, 1000 * 2 ** Math.min(retry.attempt, 5));
|
|
47985
|
+
retry.attempt++;
|
|
47986
|
+
retry.timer = setTimeout(() => {
|
|
47987
|
+
retry.timer = undefined;
|
|
47988
|
+
if (this.started && !this.closed && this.protocol.getDiagnostics().state === "open") {
|
|
47989
|
+
this.initializeDateCursor();
|
|
47990
|
+
}
|
|
47991
|
+
}, delayMs);
|
|
47992
|
+
retry.timer.unref?.();
|
|
47993
|
+
this.discoveryRetry = retry;
|
|
47994
|
+
}
|
|
47995
|
+
scheduleRecoveryRetry(bucket) {
|
|
47996
|
+
const key = this.updateBucketKey(bucket);
|
|
47997
|
+
if (!this.started || this.closed || !this.degradedUpdateBuckets.has(key))
|
|
47998
|
+
return;
|
|
47999
|
+
if (bucket.kind === "chat" && (this.catchUpInFlightByChatId.has(bucket.chatId) || this.peerResolutionInFlightByChatId.has(bucket.chatId)))
|
|
48000
|
+
return;
|
|
48001
|
+
if (bucket.kind === "space" && this.catchUpInFlightBySpaceId.has(bucket.spaceId))
|
|
48002
|
+
return;
|
|
48003
|
+
if (bucket.kind === "user" && this.userCatchUpInFlight)
|
|
48004
|
+
return;
|
|
48005
|
+
const retry = this.recoveryRetries.get(key) ?? { attempt: 0, failure: "incomplete", reported: new Set };
|
|
48006
|
+
if (retry.timer || this.protocol.getDiagnostics().state !== "open")
|
|
48007
|
+
return;
|
|
48008
|
+
const delayMs = retry.failure === "rate_limited" ? 60000 : Math.min(5000, 1000 * 2 ** Math.min(retry.attempt, 3));
|
|
48009
|
+
if (!retry.reported.has(retry.failure)) {
|
|
48010
|
+
retry.reported.add(retry.failure);
|
|
48011
|
+
this.log.error?.("Sync recovery scheduled", { bucketKind: bucket.kind, reason: retry.failure });
|
|
48012
|
+
}
|
|
48013
|
+
retry.attempt++;
|
|
48014
|
+
retry.timer = setTimeout(() => {
|
|
48015
|
+
retry.timer = undefined;
|
|
48016
|
+
if (!this.started || this.closed || this.protocol.getDiagnostics().state !== "open")
|
|
48017
|
+
return;
|
|
48018
|
+
const pending = this.degradedUpdateBuckets.get(key);
|
|
48019
|
+
if (pending)
|
|
48020
|
+
this.requestCatchUpForDegradedBucket(pending);
|
|
48021
|
+
}, delayMs);
|
|
48022
|
+
retry.timer.unref?.();
|
|
48023
|
+
this.recoveryRetries.set(key, retry);
|
|
46961
48024
|
}
|
|
46962
48025
|
fenceLiveCursor(bucket) {
|
|
46963
48026
|
this.liveCursorFences.add(this.updateBucketKey(bucket));
|
|
@@ -46965,6 +48028,8 @@ class InlineSdkClient {
|
|
|
46965
48028
|
clearUpdateBucketDegraded(bucket) {
|
|
46966
48029
|
const key = this.updateBucketKey(bucket);
|
|
46967
48030
|
this.degradedUpdateBuckets.delete(key);
|
|
48031
|
+
clearTimeout(this.recoveryRetries.get(key)?.timer);
|
|
48032
|
+
this.recoveryRetries.delete(key);
|
|
46968
48033
|
this.liveCursorFences.delete(key);
|
|
46969
48034
|
this.liveAdmittedSeqByBucket.delete(key);
|
|
46970
48035
|
}
|
|
@@ -62920,15 +63985,17 @@ function buildInlineMediaLoadOptions(params) {
|
|
|
62920
63985
|
const explicitLocalRoots = params.mediaAccess?.localRoots ?? params.mediaLocalRoots;
|
|
62921
63986
|
const readFile2 = params.mediaAccess?.readFile ?? params.mediaReadFile;
|
|
62922
63987
|
const workspaceDir = params.mediaAccess?.workspaceDir;
|
|
63988
|
+
const signal = params.signal;
|
|
62923
63989
|
const localRoots = explicitLocalRoots === "any" || explicitLocalRoots?.length ? explicitLocalRoots : readFile2 ? "any" : undefined;
|
|
62924
|
-
if (!localRoots && !readFile2 && !workspaceDir) {
|
|
63990
|
+
if (!localRoots && !readFile2 && !workspaceDir && !signal) {
|
|
62925
63991
|
return params.maxBytes;
|
|
62926
63992
|
}
|
|
62927
63993
|
return {
|
|
62928
63994
|
maxBytes: params.maxBytes,
|
|
62929
63995
|
...localRoots ? { localRoots } : {},
|
|
62930
63996
|
...readFile2 ? { readFile: readFile2, hostReadCapability: true } : {},
|
|
62931
|
-
...workspaceDir ? { workspaceDir } : {}
|
|
63997
|
+
...workspaceDir ? { workspaceDir } : {},
|
|
63998
|
+
...signal ? { signal } : {}
|
|
62932
63999
|
};
|
|
62933
64000
|
}
|
|
62934
64001
|
function mediaFromUploadResult(params) {
|
|
@@ -62955,12 +64022,15 @@ async function uploadInlineMediaFromUrl(params) {
|
|
|
62955
64022
|
let uploadType;
|
|
62956
64023
|
let fileName;
|
|
62957
64024
|
try {
|
|
64025
|
+
params.signal?.throwIfAborted();
|
|
62958
64026
|
loaded = await loadWebMediaCompat(params.mediaUrl, buildInlineMediaLoadOptions({
|
|
62959
64027
|
maxBytes,
|
|
62960
64028
|
...params.mediaAccess ? { mediaAccess: params.mediaAccess } : {},
|
|
62961
64029
|
...params.mediaLocalRoots ? { mediaLocalRoots: params.mediaLocalRoots } : {},
|
|
62962
|
-
...params.mediaReadFile ? { mediaReadFile: params.mediaReadFile } : {}
|
|
64030
|
+
...params.mediaReadFile ? { mediaReadFile: params.mediaReadFile } : {},
|
|
64031
|
+
...params.signal ? { signal: params.signal } : {}
|
|
62963
64032
|
}));
|
|
64033
|
+
params.signal?.throwIfAborted();
|
|
62964
64034
|
if (!loaded) {
|
|
62965
64035
|
throw new Error("inline media upload: media load returned no data");
|
|
62966
64036
|
}
|
|
@@ -62985,6 +64055,7 @@ async function uploadInlineMediaFromUrl(params) {
|
|
|
62985
64055
|
file: loaded.buffer,
|
|
62986
64056
|
fileName,
|
|
62987
64057
|
...detectedMime ? { contentType: detectedMime } : {},
|
|
64058
|
+
...params.signal ? { signal: params.signal } : {},
|
|
62988
64059
|
...uploadType === "video" ? {
|
|
62989
64060
|
width: DEFAULT_VIDEO_WIDTH,
|
|
62990
64061
|
height: DEFAULT_VIDEO_HEIGHT,
|
|
@@ -63165,6 +64236,12 @@ var INLINE_MESSAGE_ENTITY_TYPE = {
|
|
|
63165
64236
|
function compactWhitespace(raw) {
|
|
63166
64237
|
return (raw ?? "").replace(/\s+/g, " ").trim();
|
|
63167
64238
|
}
|
|
64239
|
+
function normalizeRawMessageText(raw) {
|
|
64240
|
+
return (raw ?? "").replaceAll(`\r
|
|
64241
|
+
`, `
|
|
64242
|
+
`).replaceAll("\r", `
|
|
64243
|
+
`).trim();
|
|
64244
|
+
}
|
|
63168
64245
|
function bestPhotoSize(photo) {
|
|
63169
64246
|
let best = {
|
|
63170
64247
|
cdnUrl: null,
|
|
@@ -63469,7 +64546,7 @@ function formatEntitySummary(entity) {
|
|
|
63469
64546
|
}
|
|
63470
64547
|
}
|
|
63471
64548
|
function summarizeInlineMessageContent(message) {
|
|
63472
|
-
const rawText =
|
|
64549
|
+
const rawText = normalizeRawMessageText(message.message);
|
|
63473
64550
|
const media = messageMediaSummary(message);
|
|
63474
64551
|
const attachments = messageAttachmentSummaries(message);
|
|
63475
64552
|
const entities = messageEntitySummaries(message);
|
|
@@ -69233,5 +70310,5 @@ export {
|
|
|
69233
70310
|
inlineApprovalNativeRuntime
|
|
69234
70311
|
};
|
|
69235
70312
|
|
|
69236
|
-
//# debugId=
|
|
70313
|
+
//# debugId=93963BB832359CF064756E2164756E21
|
|
69237
70314
|
//# sourceMappingURL=approval-handler.runtime.js.map
|