@inline-openclaw/inline 0.0.67 → 0.0.69
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 +27 -11
- package/dist/approval-handler.runtime.js +1147 -70
- package/dist/approval-handler.runtime.js.map +12 -11
- package/dist/channel-plugin-api.js +1857 -517
- package/dist/channel-plugin-api.js.map +15 -14
- package/dist/runtime-register-api.js +1118 -65
- package/dist/runtime-register-api.js.map +7 -7
- package/docs/openclaw-setup.md +8 -5
- package/package.json +8 -7
|
@@ -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);
|
|
@@ -35037,7 +35298,8 @@ class BotChatSettingsFolder$Type extends import_runtime4.MessageType {
|
|
|
35037
35298
|
{ no: 4, name: "host_label", kind: "scalar", T: 9 },
|
|
35038
35299
|
{ no: 5, name: "allows_local_picker", kind: "scalar", T: 8 },
|
|
35039
35300
|
{ no: 6, name: "local_picker_port", kind: "scalar", opt: true, T: 13 },
|
|
35040
|
-
{ 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 }
|
|
35041
35303
|
]);
|
|
35042
35304
|
}
|
|
35043
35305
|
create(value) {
|
|
@@ -35077,6 +35339,9 @@ class BotChatSettingsFolder$Type extends import_runtime4.MessageType {
|
|
|
35077
35339
|
case 7:
|
|
35078
35340
|
message.localPickerCapability = reader.string();
|
|
35079
35341
|
break;
|
|
35342
|
+
case 8:
|
|
35343
|
+
message.remoteBrowserVersion = reader.uint32();
|
|
35344
|
+
break;
|
|
35080
35345
|
default:
|
|
35081
35346
|
let u = options.readUnknownField;
|
|
35082
35347
|
if (u === "throw")
|
|
@@ -35103,6 +35368,8 @@ class BotChatSettingsFolder$Type extends import_runtime4.MessageType {
|
|
|
35103
35368
|
writer.tag(6, import_runtime.WireType.Varint).uint32(message.localPickerPort);
|
|
35104
35369
|
if (message.localPickerCapability !== undefined)
|
|
35105
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);
|
|
35106
35373
|
let u = options.writeUnknownFields;
|
|
35107
35374
|
if (u !== false)
|
|
35108
35375
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -38347,6 +38614,542 @@ class ChatAcknowledgements$Type extends import_runtime4.MessageType {
|
|
|
38347
38614
|
}
|
|
38348
38615
|
var ChatAcknowledgements = new ChatAcknowledgements$Type;
|
|
38349
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
|
+
|
|
38350
39153
|
// ../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js
|
|
38351
39154
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
38352
39155
|
function isBytes(a) {
|
|
@@ -39125,6 +39928,13 @@ var asInlineId = (value, fieldName = "id") => {
|
|
|
39125
39928
|
};
|
|
39126
39929
|
|
|
39127
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
|
+
|
|
39128
39938
|
class AsyncChannelOverflowError extends Error {
|
|
39129
39939
|
capacity;
|
|
39130
39940
|
constructor(capacity) {
|
|
@@ -39234,6 +40044,7 @@ class AcknowledgedAsyncChannel {
|
|
|
39234
40044
|
closed = false;
|
|
39235
40045
|
failure = null;
|
|
39236
40046
|
iteratorClaimed = false;
|
|
40047
|
+
consumption = null;
|
|
39237
40048
|
constructor(capacity, byteLimit) {
|
|
39238
40049
|
this.capacity = capacity;
|
|
39239
40050
|
this.byteLimit = byteLimit;
|
|
@@ -39247,7 +40058,7 @@ class AcknowledgedAsyncChannel {
|
|
|
39247
40058
|
send(value) {
|
|
39248
40059
|
if (this.closed)
|
|
39249
40060
|
return Promise.resolve(false);
|
|
39250
|
-
if (!this.waiter && this.queue.length >= this.capacity) {
|
|
40061
|
+
if (!this.waiter && this.queue.length + (this.consumption?.active.size ?? 0) >= this.capacity) {
|
|
39251
40062
|
throw new AsyncChannelOverflowError(this.capacity);
|
|
39252
40063
|
}
|
|
39253
40064
|
const bytes = this.byteLimit?.byteLength(value) ?? 0;
|
|
@@ -39267,6 +40078,7 @@ class AcknowledgedAsyncChannel {
|
|
|
39267
40078
|
waiter.resolve({ value, done: false });
|
|
39268
40079
|
} else {
|
|
39269
40080
|
this.queue.push(item);
|
|
40081
|
+
this.pumpConsumption();
|
|
39270
40082
|
}
|
|
39271
40083
|
});
|
|
39272
40084
|
}
|
|
@@ -39281,6 +40093,16 @@ class AcknowledgedAsyncChannel {
|
|
|
39281
40093
|
return;
|
|
39282
40094
|
this.closed = true;
|
|
39283
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
|
+
}
|
|
39284
40106
|
this.active?.acknowledge(false);
|
|
39285
40107
|
this.active = null;
|
|
39286
40108
|
for (const item of this.queue)
|
|
@@ -39296,6 +40118,65 @@ class AcknowledgedAsyncChannel {
|
|
|
39296
40118
|
else
|
|
39297
40119
|
waiter.resolve({ value: undefined, done: true });
|
|
39298
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
|
+
}
|
|
39299
40180
|
[Symbol.asyncIterator]() {
|
|
39300
40181
|
if (this.iteratorClaimed) {
|
|
39301
40182
|
return {
|
|
@@ -39303,8 +40184,11 @@ class AcknowledgedAsyncChannel {
|
|
|
39303
40184
|
};
|
|
39304
40185
|
}
|
|
39305
40186
|
this.iteratorClaimed = true;
|
|
40187
|
+
let returned = false;
|
|
39306
40188
|
return {
|
|
39307
40189
|
next: () => {
|
|
40190
|
+
if (returned)
|
|
40191
|
+
return Promise.resolve({ value: undefined, done: true });
|
|
39308
40192
|
if (this.active) {
|
|
39309
40193
|
this.bufferedBytes -= this.active.bytes;
|
|
39310
40194
|
this.active.acknowledge(true);
|
|
@@ -39328,6 +40212,11 @@ class AcknowledgedAsyncChannel {
|
|
|
39328
40212
|
});
|
|
39329
40213
|
},
|
|
39330
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;
|
|
39331
40220
|
if (this.active) {
|
|
39332
40221
|
this.bufferedBytes -= this.active.bytes;
|
|
39333
40222
|
this.active.acknowledge(false);
|
|
@@ -40006,10 +40895,12 @@ var normalizeRpcTimeoutMs = (timeoutMs, fallback) => {
|
|
|
40006
40895
|
|
|
40007
40896
|
class ProtocolClientError extends Error {
|
|
40008
40897
|
code;
|
|
40898
|
+
rpcCode;
|
|
40009
40899
|
constructor(code, details) {
|
|
40010
40900
|
super(details?.message ?? code);
|
|
40011
40901
|
this.code = code;
|
|
40012
40902
|
this.name = `ProtocolClientError:${code}`;
|
|
40903
|
+
this.rpcCode = details?.code;
|
|
40013
40904
|
}
|
|
40014
40905
|
}
|
|
40015
40906
|
var commitOutcomeUnknownError = (message) => new ProtocolClientError("commit-outcome-unknown", { message });
|
|
@@ -44832,8 +45723,11 @@ class InlineSdkClient {
|
|
|
44832
45723
|
peerResolutionRequestedByChatId = new Map;
|
|
44833
45724
|
recoveryReconnectInFlight = null;
|
|
44834
45725
|
degradedUpdateBuckets = new Map;
|
|
45726
|
+
discoveryRetry = null;
|
|
45727
|
+
recoveryRetries = new Map;
|
|
44835
45728
|
liveCursorFences = new Set;
|
|
44836
45729
|
liveAdmittedSeqByBucket = new Map;
|
|
45730
|
+
liveDeliveriesByBucket = new Map;
|
|
44837
45731
|
discoveryRound = null;
|
|
44838
45732
|
discoveryInFlight = null;
|
|
44839
45733
|
discoveryCommitInFlight = null;
|
|
@@ -44926,12 +45820,14 @@ class InlineSdkClient {
|
|
|
44926
45820
|
}
|
|
44927
45821
|
}
|
|
44928
45822
|
async close() {
|
|
44929
|
-
|
|
44930
|
-
return;
|
|
45823
|
+
const wasStarted = this.started;
|
|
44931
45824
|
this.closed = true;
|
|
44932
45825
|
this.started = false;
|
|
45826
|
+
this.cancelRecoveryRetries();
|
|
44933
45827
|
this.rejectOpen(new Error("closed"));
|
|
44934
45828
|
this.eventStream.close();
|
|
45829
|
+
if (!wasStarted)
|
|
45830
|
+
return;
|
|
44935
45831
|
await settleWithin(this.protocol.stopTransport(), closeJoinTimeoutMs, () => this.log.warn?.("Timed out stopping SDK transport during close"));
|
|
44936
45832
|
await settleWithin(Promise.allSettled([
|
|
44937
45833
|
...this.catchUpInFlightByChatId.values(),
|
|
@@ -44993,6 +45889,20 @@ class InlineSdkClient {
|
|
|
44993
45889
|
events() {
|
|
44994
45890
|
return this.eventStream;
|
|
44995
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
|
+
}
|
|
44996
45906
|
exportState() {
|
|
44997
45907
|
return {
|
|
44998
45908
|
version: 1,
|
|
@@ -45402,6 +46312,7 @@ class InlineSdkClient {
|
|
|
45402
46312
|
this.log.error?.("SDK listener crashed", failure);
|
|
45403
46313
|
this.started = false;
|
|
45404
46314
|
this.closed = true;
|
|
46315
|
+
this.cancelRecoveryRetries();
|
|
45405
46316
|
this.rejectOpen(failure);
|
|
45406
46317
|
this.eventStream.fail(failure);
|
|
45407
46318
|
this.protocol.stopTransport().catch((stopError) => {
|
|
@@ -45414,6 +46325,7 @@ class InlineSdkClient {
|
|
|
45414
46325
|
return;
|
|
45415
46326
|
this.authenticationError = error;
|
|
45416
46327
|
this.started = false;
|
|
46328
|
+
this.cancelRecoveryRetries();
|
|
45417
46329
|
this.rejectOpen(error);
|
|
45418
46330
|
this.eventStream.close();
|
|
45419
46331
|
try {
|
|
@@ -45423,6 +46335,7 @@ class InlineSdkClient {
|
|
|
45423
46335
|
}
|
|
45424
46336
|
}
|
|
45425
46337
|
async onOpen() {
|
|
46338
|
+
this.cancelRecoveryRetries();
|
|
45426
46339
|
this.requestCatchUpUser();
|
|
45427
46340
|
for (const bucket of this.degradedUpdateBuckets.values()) {
|
|
45428
46341
|
this.requestCatchUpForDegradedBucket(bucket);
|
|
@@ -45473,6 +46386,8 @@ class InlineSdkClient {
|
|
|
45473
46386
|
return this.discoveryInFlight;
|
|
45474
46387
|
if (this.discoveryCommitInFlight)
|
|
45475
46388
|
return this.discoveryCommitInFlight;
|
|
46389
|
+
if (this.discoveryRetry?.timer)
|
|
46390
|
+
return;
|
|
45476
46391
|
const round = {
|
|
45477
46392
|
resultReceived: false,
|
|
45478
46393
|
collectingHints: true,
|
|
@@ -45505,6 +46420,11 @@ class InlineSdkClient {
|
|
|
45505
46420
|
this.log.warn?.("GET_UPDATES_STATE failed (continuing without date cursor)", error);
|
|
45506
46421
|
if (this.discoveryRound === round)
|
|
45507
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
|
+
}
|
|
45508
46428
|
}
|
|
45509
46429
|
}
|
|
45510
46430
|
tryCommitDiscoveryRound(round) {
|
|
@@ -45529,12 +46449,15 @@ class InlineSdkClient {
|
|
|
45529
46449
|
return;
|
|
45530
46450
|
if (saved) {
|
|
45531
46451
|
this.discoveryRound = null;
|
|
46452
|
+
clearTimeout(this.discoveryRetry?.timer);
|
|
46453
|
+
this.discoveryRetry = null;
|
|
45532
46454
|
return;
|
|
45533
46455
|
}
|
|
45534
46456
|
this.state.dateCursor = previousDateCursor;
|
|
45535
46457
|
this.scheduleStateSave();
|
|
45536
46458
|
this.discoveryRound = null;
|
|
45537
46459
|
this.log.warn?.("Failed to persist discovery checkpoint; preserving previous date cursor");
|
|
46460
|
+
this.scheduleDiscoveryRetry("checkpoint_write_failed");
|
|
45538
46461
|
}).finally(() => {
|
|
45539
46462
|
if (this.discoveryCommitInFlight === commit)
|
|
45540
46463
|
this.discoveryCommitInFlight = null;
|
|
@@ -45869,20 +46792,23 @@ class InlineSdkClient {
|
|
|
45869
46792
|
try {
|
|
45870
46793
|
acknowledged = this.eventStream.send(event);
|
|
45871
46794
|
} catch (error) {
|
|
45872
|
-
const
|
|
45873
|
-
if (
|
|
45874
|
-
this.fenceLiveCursor(
|
|
45875
|
-
this.markUpdateBucketDegraded(
|
|
45876
|
-
this.requestCatchUpAfterEventOverflow(
|
|
46795
|
+
const bucket2 = this.bucketForEvent(event);
|
|
46796
|
+
if (bucket2) {
|
|
46797
|
+
this.fenceLiveCursor(bucket2);
|
|
46798
|
+
this.markUpdateBucketDegraded(bucket2);
|
|
46799
|
+
this.requestCatchUpAfterEventOverflow(bucket2, event);
|
|
45877
46800
|
}
|
|
45878
46801
|
this.log.warn?.("Inbound event buffer overflow; durable cursor remains unchanged and transport will recover", {
|
|
45879
|
-
bucket:
|
|
46802
|
+
bucket: bucket2 ? this.updateBucketKey(bucket2) : "none",
|
|
45880
46803
|
error: extractErrorMessage(error)
|
|
45881
46804
|
});
|
|
45882
46805
|
this.requestRecoveryReconnect("inbound-event-buffer-overflow");
|
|
45883
46806
|
return Promise.resolve(false);
|
|
45884
46807
|
}
|
|
45885
|
-
|
|
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) => {
|
|
45886
46812
|
if (applied) {
|
|
45887
46813
|
onApplied?.();
|
|
45888
46814
|
if (source === "live")
|
|
@@ -45890,8 +46816,16 @@ class InlineSdkClient {
|
|
|
45890
46816
|
} else if (source === "live" && this.started) {
|
|
45891
46817
|
this.recoverLiveEvent(event, "consumer-did-not-apply");
|
|
45892
46818
|
}
|
|
46819
|
+
deliveries?.delete(delivery);
|
|
46820
|
+
if (key && deliveries?.size === 0)
|
|
46821
|
+
this.liveDeliveriesByBucket.delete(key);
|
|
45893
46822
|
return applied;
|
|
45894
46823
|
});
|
|
46824
|
+
if (key && deliveries) {
|
|
46825
|
+
deliveries.add(delivery);
|
|
46826
|
+
this.liveDeliveriesByBucket.set(key, deliveries);
|
|
46827
|
+
}
|
|
46828
|
+
return delivery;
|
|
45895
46829
|
}
|
|
45896
46830
|
bucketForEvent(event) {
|
|
45897
46831
|
switch (event.kind) {
|
|
@@ -46069,20 +47003,25 @@ class InlineSdkClient {
|
|
|
46069
47003
|
}
|
|
46070
47004
|
requestCatchUpForDegradedBucket(bucket) {
|
|
46071
47005
|
switch (bucket.kind) {
|
|
46072
|
-
case "chat":
|
|
46073
|
-
|
|
46074
|
-
|
|
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 });
|
|
46075
47012
|
} else {
|
|
46076
|
-
|
|
46077
|
-
if (persistedPeer)
|
|
46078
|
-
this.requestCatchUpChat({ chatId: bucket.chatId, peer: persistedPeer });
|
|
46079
|
-
else
|
|
46080
|
-
this.resolvePersistedChatPeer(bucket.chatId);
|
|
47013
|
+
this.resolvePersistedChatPeer(bucket.chatId, updateSeq);
|
|
46081
47014
|
}
|
|
46082
47015
|
return;
|
|
46083
|
-
|
|
46084
|
-
|
|
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
|
+
});
|
|
46085
47023
|
return;
|
|
47024
|
+
}
|
|
46086
47025
|
case "user":
|
|
46087
47026
|
this.requestCatchUpUser(true);
|
|
46088
47027
|
return;
|
|
@@ -46267,7 +47206,7 @@ class InlineSdkClient {
|
|
|
46267
47206
|
bumpChatSeq(chatId, seq, source) {
|
|
46268
47207
|
if (source === "user" || source === "space" || source === "chat")
|
|
46269
47208
|
return;
|
|
46270
|
-
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)
|
|
46271
47210
|
return;
|
|
46272
47211
|
if (!Number.isFinite(seq))
|
|
46273
47212
|
return;
|
|
@@ -46276,6 +47215,7 @@ class InlineSdkClient {
|
|
|
46276
47215
|
const key = chatId.toString();
|
|
46277
47216
|
const prev = this.state.lastSeqByChatId[key] ?? 0;
|
|
46278
47217
|
if (seq > prev) {
|
|
47218
|
+
this.resetRecoveryBackoff({ kind: "chat", chatId });
|
|
46279
47219
|
this.state.lastSeqByChatId[key] = seq;
|
|
46280
47220
|
this.scheduleStateSave();
|
|
46281
47221
|
}
|
|
@@ -46284,7 +47224,7 @@ class InlineSdkClient {
|
|
|
46284
47224
|
bumpSpaceSeq(spaceId, seq, source) {
|
|
46285
47225
|
if (source === "user" || source === "space" || source === "chat")
|
|
46286
47226
|
return;
|
|
46287
|
-
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)
|
|
46288
47228
|
return;
|
|
46289
47229
|
if (!Number.isFinite(seq))
|
|
46290
47230
|
return;
|
|
@@ -46293,6 +47233,7 @@ class InlineSdkClient {
|
|
|
46293
47233
|
const key = spaceId.toString();
|
|
46294
47234
|
const prev = this.state.lastSeqBySpaceId[key] ?? 0;
|
|
46295
47235
|
if (seq > prev) {
|
|
47236
|
+
this.resetRecoveryBackoff({ kind: "space", spaceId });
|
|
46296
47237
|
this.state.lastSeqBySpaceId[key] = seq;
|
|
46297
47238
|
this.scheduleStateSave();
|
|
46298
47239
|
}
|
|
@@ -46307,12 +47248,13 @@ class InlineSdkClient {
|
|
|
46307
47248
|
bumpUserSeq(seq, source) {
|
|
46308
47249
|
if (source === "user" || source === "space" || source === "chat")
|
|
46309
47250
|
return;
|
|
46310
|
-
if (source === "live" && this.liveCursorFences.has("user"))
|
|
47251
|
+
if (source === "live" && this.liveCursorFences.has("user") && seq !== (this.state.lastUserSeq ?? 0) + 1)
|
|
46311
47252
|
return;
|
|
46312
47253
|
if (!Number.isFinite(seq) || seq <= 0)
|
|
46313
47254
|
return;
|
|
46314
47255
|
const prev = this.state.lastUserSeq ?? 0;
|
|
46315
47256
|
if (seq > prev) {
|
|
47257
|
+
this.resetRecoveryBackoff({ kind: "user" });
|
|
46316
47258
|
this.state.lastUserSeq = seq;
|
|
46317
47259
|
this.scheduleStateSave();
|
|
46318
47260
|
}
|
|
@@ -46326,14 +47268,17 @@ class InlineSdkClient {
|
|
|
46326
47268
|
if (this.userCatchUpInFlight) {
|
|
46327
47269
|
return this.userCatchUpInFlight;
|
|
46328
47270
|
}
|
|
47271
|
+
if (this.recoveryRetries.get("user")?.timer)
|
|
47272
|
+
return null;
|
|
46329
47273
|
this.fenceLiveCursor({ kind: "user" });
|
|
46330
47274
|
this.userCatchUpInFlight = this.doCatchUpUser(lastUserSeq ?? 0).catch((error) => {
|
|
46331
|
-
this.
|
|
47275
|
+
this.recordCatchUpFailure({ kind: "user" }, error);
|
|
46332
47276
|
this.log.warn?.("GET_UPDATES user catch-up failed; bucket remains degraded", {
|
|
46333
47277
|
error: extractErrorMessage(error)
|
|
46334
47278
|
});
|
|
46335
47279
|
}).finally(() => {
|
|
46336
47280
|
this.userCatchUpInFlight = null;
|
|
47281
|
+
this.scheduleRecoveryRetry({ kind: "user" });
|
|
46337
47282
|
});
|
|
46338
47283
|
return this.userCatchUpInFlight;
|
|
46339
47284
|
}
|
|
@@ -46386,7 +47331,7 @@ class InlineSdkClient {
|
|
|
46386
47331
|
});
|
|
46387
47332
|
}
|
|
46388
47333
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
46389
|
-
this.markUpdateBucketDegraded({ kind: "user" });
|
|
47334
|
+
this.markUpdateBucketDegraded({ kind: "user" }, "non_progress");
|
|
46390
47335
|
this.log.warn?.("GET_UPDATES user catch-up made no progress; bucket remains degraded", {
|
|
46391
47336
|
cursor,
|
|
46392
47337
|
deliveredSeq
|
|
@@ -46422,15 +47367,18 @@ class InlineSdkClient {
|
|
|
46422
47367
|
const existing = this.catchUpInFlightByChatId.get(params.chatId);
|
|
46423
47368
|
if (existing)
|
|
46424
47369
|
return existing;
|
|
47370
|
+
if (this.recoveryRetries.get(`chat:${params.chatId}`)?.timer)
|
|
47371
|
+
return Promise.resolve();
|
|
47372
|
+
const initialDemand = this.catchUpRequestedByChatId.get(params.chatId);
|
|
46425
47373
|
const task = this.drainCatchUpChat(params.chatId).catch((error) => {
|
|
46426
|
-
this.catchUpRequestedByChatId.
|
|
46427
|
-
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);
|
|
46428
47375
|
this.log.warn?.("GET_UPDATES chat catch-up failed; bucket remains degraded", {
|
|
46429
47376
|
chatId: params.chatId.toString(),
|
|
46430
47377
|
error: extractErrorMessage(error)
|
|
46431
47378
|
});
|
|
46432
47379
|
}).finally(() => {
|
|
46433
47380
|
this.catchUpInFlightByChatId.delete(params.chatId);
|
|
47381
|
+
this.scheduleRecoveryRetry({ kind: "chat", chatId: params.chatId });
|
|
46434
47382
|
});
|
|
46435
47383
|
this.catchUpInFlightByChatId.set(params.chatId, task);
|
|
46436
47384
|
return task;
|
|
@@ -46454,12 +47402,8 @@ class InlineSdkClient {
|
|
|
46454
47402
|
if (stop) {
|
|
46455
47403
|
if (this.catchUpRequestedByChatId.get(chatId) !== request)
|
|
46456
47404
|
continue;
|
|
46457
|
-
this.
|
|
46458
|
-
|
|
46459
|
-
}
|
|
46460
|
-
const latest = this.catchUpRequestedByChatId.get(chatId);
|
|
46461
|
-
const syncedSeq = this.state.lastSeqByChatId?.[key] ?? 0;
|
|
46462
|
-
if (!latest || latest.endSeq != null && latest.endSeq <= syncedSeq) {
|
|
47405
|
+
if (this.degradedUpdateBuckets.has(`chat:${chatId}`))
|
|
47406
|
+
return;
|
|
46463
47407
|
this.catchUpRequestedByChatId.delete(chatId);
|
|
46464
47408
|
return;
|
|
46465
47409
|
}
|
|
@@ -46526,7 +47470,7 @@ class InlineSdkClient {
|
|
|
46526
47470
|
});
|
|
46527
47471
|
}
|
|
46528
47472
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
46529
|
-
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
47473
|
+
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer }, "non_progress");
|
|
46530
47474
|
this.log.warn?.("GET_UPDATES made no progress; bucket remains degraded", {
|
|
46531
47475
|
chatId: chatId.toString(),
|
|
46532
47476
|
cursor,
|
|
@@ -46544,7 +47488,7 @@ class InlineSdkClient {
|
|
|
46544
47488
|
continue;
|
|
46545
47489
|
}
|
|
46546
47490
|
if (endSeq != null && deliveredSeq < endSeq) {
|
|
46547
|
-
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer });
|
|
47491
|
+
this.markUpdateBucketDegraded({ kind: "chat", chatId, peer }, "target_not_reached");
|
|
46548
47492
|
this.log.warn?.("GET_UPDATES final chat page remained behind the requested target", {
|
|
46549
47493
|
chatId: chatId.toString(),
|
|
46550
47494
|
requestedEndSeq: endSeq,
|
|
@@ -46570,15 +47514,18 @@ class InlineSdkClient {
|
|
|
46570
47514
|
const existing = this.catchUpInFlightBySpaceId.get(params.spaceId);
|
|
46571
47515
|
if (existing)
|
|
46572
47516
|
return existing;
|
|
47517
|
+
if (this.recoveryRetries.get(`space:${params.spaceId}`)?.timer)
|
|
47518
|
+
return Promise.resolve();
|
|
47519
|
+
const initialDemand = this.catchUpRequestedBySpaceId.get(params.spaceId);
|
|
46573
47520
|
const task = this.drainCatchUpSpace(params.spaceId).catch((error) => {
|
|
46574
|
-
this.catchUpRequestedBySpaceId.
|
|
46575
|
-
this.markUpdateBucketDegraded({ kind: "space", spaceId: params.spaceId });
|
|
47521
|
+
this.recordCatchUpFailure({ kind: "space", spaceId: params.spaceId }, error, this.catchUpRequestedBySpaceId.get(params.spaceId) !== initialDemand);
|
|
46576
47522
|
this.log.warn?.("GET_UPDATES space catch-up failed; bucket remains degraded", {
|
|
46577
47523
|
spaceId: params.spaceId.toString(),
|
|
46578
47524
|
error: extractErrorMessage(error)
|
|
46579
47525
|
});
|
|
46580
47526
|
}).finally(() => {
|
|
46581
47527
|
this.catchUpInFlightBySpaceId.delete(params.spaceId);
|
|
47528
|
+
this.scheduleRecoveryRetry({ kind: "space", spaceId: params.spaceId });
|
|
46582
47529
|
});
|
|
46583
47530
|
this.catchUpInFlightBySpaceId.set(params.spaceId, task);
|
|
46584
47531
|
return task;
|
|
@@ -46602,12 +47549,8 @@ class InlineSdkClient {
|
|
|
46602
47549
|
if (stop) {
|
|
46603
47550
|
if (this.catchUpRequestedBySpaceId.get(spaceId) !== request)
|
|
46604
47551
|
continue;
|
|
46605
|
-
this.
|
|
46606
|
-
|
|
46607
|
-
}
|
|
46608
|
-
const latest = this.catchUpRequestedBySpaceId.get(spaceId);
|
|
46609
|
-
const syncedSeq = this.state.lastSeqBySpaceId?.[key] ?? 0;
|
|
46610
|
-
if (!latest || latest.endSeq != null && latest.endSeq <= syncedSeq) {
|
|
47552
|
+
if (this.degradedUpdateBuckets.has(`space:${spaceId}`))
|
|
47553
|
+
return;
|
|
46611
47554
|
this.catchUpRequestedBySpaceId.delete(spaceId);
|
|
46612
47555
|
return;
|
|
46613
47556
|
}
|
|
@@ -46676,7 +47619,7 @@ class InlineSdkClient {
|
|
|
46676
47619
|
});
|
|
46677
47620
|
}
|
|
46678
47621
|
if (deliveredSeq <= cursor && !payload.final) {
|
|
46679
|
-
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
47622
|
+
this.markUpdateBucketDegraded({ kind: "space", spaceId }, "non_progress");
|
|
46680
47623
|
this.log.warn?.("GET_UPDATES space made no progress; bucket remains degraded", {
|
|
46681
47624
|
spaceId: spaceId.toString(),
|
|
46682
47625
|
cursor,
|
|
@@ -46694,7 +47637,7 @@ class InlineSdkClient {
|
|
|
46694
47637
|
continue;
|
|
46695
47638
|
}
|
|
46696
47639
|
if (endSeq != null && deliveredSeq < endSeq) {
|
|
46697
|
-
this.markUpdateBucketDegraded({ kind: "space", spaceId });
|
|
47640
|
+
this.markUpdateBucketDegraded({ kind: "space", spaceId }, "target_not_reached");
|
|
46698
47641
|
this.log.warn?.("GET_UPDATES final space page remained behind the requested target", {
|
|
46699
47642
|
spaceId: spaceId.toString(),
|
|
46700
47643
|
requestedEndSeq: endSeq,
|
|
@@ -46719,6 +47662,9 @@ class InlineSdkClient {
|
|
|
46719
47662
|
const existing = this.peerResolutionInFlightByChatId.get(chatId);
|
|
46720
47663
|
if (existing)
|
|
46721
47664
|
return existing;
|
|
47665
|
+
if (this.recoveryRetries.get(`chat:${chatId}`)?.timer)
|
|
47666
|
+
return Promise.resolve();
|
|
47667
|
+
const initialDemand = this.peerResolutionRequestedByChatId.get(chatId);
|
|
46722
47668
|
const task = this.getChat({ chatId }).then(async (chat) => {
|
|
46723
47669
|
const peer = chat.peer;
|
|
46724
47670
|
if (!peer || !this.isReliableChatPeer(peer)) {
|
|
@@ -46732,14 +47678,16 @@ class InlineSdkClient {
|
|
|
46732
47678
|
...requested && !requested.toLatest && requested.endSeq != null ? { updateSeq: requested.endSeq } : {}
|
|
46733
47679
|
});
|
|
46734
47680
|
}).catch((error) => {
|
|
46735
|
-
this.
|
|
47681
|
+
this.recordCatchUpFailure({ kind: "chat", chatId }, error, this.peerResolutionRequestedByChatId.get(chatId) !== initialDemand);
|
|
46736
47682
|
this.log.warn?.("Unable to resolve legacy chat peer; bucket remains degraded", {
|
|
46737
47683
|
chatId: chatId.toString(),
|
|
46738
47684
|
error: extractErrorMessage(error)
|
|
46739
47685
|
});
|
|
46740
47686
|
}).finally(() => {
|
|
46741
47687
|
this.peerResolutionInFlightByChatId.delete(chatId);
|
|
46742
|
-
this.
|
|
47688
|
+
if (!this.degradedUpdateBuckets.has(`chat:${chatId}`))
|
|
47689
|
+
this.peerResolutionRequestedByChatId.delete(chatId);
|
|
47690
|
+
this.scheduleRecoveryRetry({ kind: "chat", chatId });
|
|
46743
47691
|
});
|
|
46744
47692
|
this.peerResolutionInFlightByChatId.set(chatId, task);
|
|
46745
47693
|
return task;
|
|
@@ -46792,7 +47740,7 @@ class InlineSdkClient {
|
|
|
46792
47740
|
}
|
|
46793
47741
|
validateCatchUpPage(payload, startSeq, bucket) {
|
|
46794
47742
|
if (payload.resultType !== GetUpdatesResult_ResultType.SLICE && payload.resultType !== GetUpdatesResult_ResultType.EMPTY) {
|
|
46795
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47743
|
+
this.markUpdateBucketDegraded(bucket, "invalid_page_type");
|
|
46796
47744
|
this.log.warn?.("GET_UPDATES returned an invalid page result type; bucket remains degraded", {
|
|
46797
47745
|
bucket: this.updateBucketKey(bucket),
|
|
46798
47746
|
resultType: payload.resultType
|
|
@@ -46801,7 +47749,7 @@ class InlineSdkClient {
|
|
|
46801
47749
|
}
|
|
46802
47750
|
const deliveredSeq = Number(payload.seq);
|
|
46803
47751
|
if (!Number.isSafeInteger(deliveredSeq) || deliveredSeq < startSeq) {
|
|
46804
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47752
|
+
this.markUpdateBucketDegraded(bucket, "invalid_page_cursor");
|
|
46805
47753
|
this.log.warn?.("GET_UPDATES page moved backwards or returned an invalid seq; bucket remains degraded", {
|
|
46806
47754
|
bucket: this.updateBucketKey(bucket),
|
|
46807
47755
|
startSeq,
|
|
@@ -46813,7 +47761,7 @@ class InlineSdkClient {
|
|
|
46813
47761
|
for (const update of payload.updates) {
|
|
46814
47762
|
const seq = update.seq;
|
|
46815
47763
|
if (!Number.isSafeInteger(seq) || seq == null || seq <= startSeq || seq > deliveredSeq || accounted.has(seq)) {
|
|
46816
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47764
|
+
this.markUpdateBucketDegraded(bucket, "invalid_update_sequence");
|
|
46817
47765
|
this.log.warn?.("GET_UPDATES page included an invalid or duplicate update seq; bucket remains degraded", {
|
|
46818
47766
|
bucket: this.updateBucketKey(bucket),
|
|
46819
47767
|
seq
|
|
@@ -46826,7 +47774,7 @@ class InlineSdkClient {
|
|
|
46826
47774
|
for (const skipped of payload.skippedSequences) {
|
|
46827
47775
|
const seq = Number(skipped.seq);
|
|
46828
47776
|
if (!Number.isSafeInteger(seq) || seq <= startSeq || seq > deliveredSeq || accounted.has(seq)) {
|
|
46829
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47777
|
+
this.markUpdateBucketDegraded(bucket, "invalid_skipped_sequence");
|
|
46830
47778
|
this.log.warn?.("GET_UPDATES page included an invalid or duplicate skipped seq; bucket remains degraded", {
|
|
46831
47779
|
bucket: this.updateBucketKey(bucket),
|
|
46832
47780
|
seq
|
|
@@ -46842,7 +47790,7 @@ class InlineSdkClient {
|
|
|
46842
47790
|
break;
|
|
46843
47791
|
case SyncSkippedSequence_Reason.REASON_UNSPECIFIED:
|
|
46844
47792
|
default:
|
|
46845
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47793
|
+
this.markUpdateBucketDegraded(bucket, "unknown_skip_reason");
|
|
46846
47794
|
this.log.warn?.("GET_UPDATES page included an unsupported skipped-sequence reason; bucket remains degraded", {
|
|
46847
47795
|
bucket: this.updateBucketKey(bucket),
|
|
46848
47796
|
reason: skipped.reason
|
|
@@ -46851,7 +47799,7 @@ class InlineSdkClient {
|
|
|
46851
47799
|
}
|
|
46852
47800
|
}
|
|
46853
47801
|
if (accounted.size !== deliveredSeq - startSeq) {
|
|
46854
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47802
|
+
this.markUpdateBucketDegraded(bucket, "unaccounted_gap");
|
|
46855
47803
|
this.log.warn?.("GET_UPDATES page did not account for every advanced sequence; bucket remains degraded", {
|
|
46856
47804
|
bucket: this.updateBucketKey(bucket),
|
|
46857
47805
|
startSeq,
|
|
@@ -46933,7 +47881,7 @@ class InlineSdkClient {
|
|
|
46933
47881
|
this.clearUpdateBucketDegraded(bucket);
|
|
46934
47882
|
return true;
|
|
46935
47883
|
} catch (error) {
|
|
46936
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47884
|
+
this.markUpdateBucketDegraded(bucket, "repair_failed");
|
|
46937
47885
|
this.log.warn?.("Authoritative update repair failed; bucket remains degraded", {
|
|
46938
47886
|
bucket: this.updateBucketKey(bucket),
|
|
46939
47887
|
error: extractErrorMessage(error)
|
|
@@ -46942,7 +47890,17 @@ class InlineSdkClient {
|
|
|
46942
47890
|
}
|
|
46943
47891
|
}
|
|
46944
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);
|
|
46945
47901
|
for (const update of updates) {
|
|
47902
|
+
if (update.seq != null && update.seq > 0 && update.seq <= appliedThrough)
|
|
47903
|
+
continue;
|
|
46946
47904
|
if (update.update.oneofKind === "chatSkipPts" && source === "chat") {
|
|
46947
47905
|
continue;
|
|
46948
47906
|
}
|
|
@@ -46953,7 +47911,7 @@ class InlineSdkClient {
|
|
|
46953
47911
|
if (accepted === true)
|
|
46954
47912
|
continue;
|
|
46955
47913
|
if (accepted === false) {
|
|
46956
|
-
this.markUpdateBucketDegraded(bucket);
|
|
47914
|
+
this.markUpdateBucketDegraded(bucket, "host_unacknowledged");
|
|
46957
47915
|
this.log.warn?.("GET_UPDATES event was not acknowledged by the SDK host; cursor remains unchanged", {
|
|
46958
47916
|
bucket: this.updateBucketKey(bucket),
|
|
46959
47917
|
updateKind: update.update.oneofKind
|
|
@@ -46974,8 +47932,95 @@ class InlineSdkClient {
|
|
|
46974
47932
|
}
|
|
46975
47933
|
return true;
|
|
46976
47934
|
}
|
|
46977
|
-
|
|
46978
|
-
|
|
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);
|
|
46979
48024
|
}
|
|
46980
48025
|
fenceLiveCursor(bucket) {
|
|
46981
48026
|
this.liveCursorFences.add(this.updateBucketKey(bucket));
|
|
@@ -46983,6 +48028,8 @@ class InlineSdkClient {
|
|
|
46983
48028
|
clearUpdateBucketDegraded(bucket) {
|
|
46984
48029
|
const key = this.updateBucketKey(bucket);
|
|
46985
48030
|
this.degradedUpdateBuckets.delete(key);
|
|
48031
|
+
clearTimeout(this.recoveryRetries.get(key)?.timer);
|
|
48032
|
+
this.recoveryRetries.delete(key);
|
|
46986
48033
|
this.liveCursorFences.delete(key);
|
|
46987
48034
|
this.liveAdmittedSeqByBucket.delete(key);
|
|
46988
48035
|
}
|
|
@@ -62938,15 +63985,17 @@ function buildInlineMediaLoadOptions(params) {
|
|
|
62938
63985
|
const explicitLocalRoots = params.mediaAccess?.localRoots ?? params.mediaLocalRoots;
|
|
62939
63986
|
const readFile2 = params.mediaAccess?.readFile ?? params.mediaReadFile;
|
|
62940
63987
|
const workspaceDir = params.mediaAccess?.workspaceDir;
|
|
63988
|
+
const signal = params.signal;
|
|
62941
63989
|
const localRoots = explicitLocalRoots === "any" || explicitLocalRoots?.length ? explicitLocalRoots : readFile2 ? "any" : undefined;
|
|
62942
|
-
if (!localRoots && !readFile2 && !workspaceDir) {
|
|
63990
|
+
if (!localRoots && !readFile2 && !workspaceDir && !signal) {
|
|
62943
63991
|
return params.maxBytes;
|
|
62944
63992
|
}
|
|
62945
63993
|
return {
|
|
62946
63994
|
maxBytes: params.maxBytes,
|
|
62947
63995
|
...localRoots ? { localRoots } : {},
|
|
62948
63996
|
...readFile2 ? { readFile: readFile2, hostReadCapability: true } : {},
|
|
62949
|
-
...workspaceDir ? { workspaceDir } : {}
|
|
63997
|
+
...workspaceDir ? { workspaceDir } : {},
|
|
63998
|
+
...signal ? { signal } : {}
|
|
62950
63999
|
};
|
|
62951
64000
|
}
|
|
62952
64001
|
function mediaFromUploadResult(params) {
|
|
@@ -62973,12 +64022,15 @@ async function uploadInlineMediaFromUrl(params) {
|
|
|
62973
64022
|
let uploadType;
|
|
62974
64023
|
let fileName;
|
|
62975
64024
|
try {
|
|
64025
|
+
params.signal?.throwIfAborted();
|
|
62976
64026
|
loaded = await loadWebMediaCompat(params.mediaUrl, buildInlineMediaLoadOptions({
|
|
62977
64027
|
maxBytes,
|
|
62978
64028
|
...params.mediaAccess ? { mediaAccess: params.mediaAccess } : {},
|
|
62979
64029
|
...params.mediaLocalRoots ? { mediaLocalRoots: params.mediaLocalRoots } : {},
|
|
62980
|
-
...params.mediaReadFile ? { mediaReadFile: params.mediaReadFile } : {}
|
|
64030
|
+
...params.mediaReadFile ? { mediaReadFile: params.mediaReadFile } : {},
|
|
64031
|
+
...params.signal ? { signal: params.signal } : {}
|
|
62981
64032
|
}));
|
|
64033
|
+
params.signal?.throwIfAborted();
|
|
62982
64034
|
if (!loaded) {
|
|
62983
64035
|
throw new Error("inline media upload: media load returned no data");
|
|
62984
64036
|
}
|
|
@@ -63003,6 +64055,7 @@ async function uploadInlineMediaFromUrl(params) {
|
|
|
63003
64055
|
file: loaded.buffer,
|
|
63004
64056
|
fileName,
|
|
63005
64057
|
...detectedMime ? { contentType: detectedMime } : {},
|
|
64058
|
+
...params.signal ? { signal: params.signal } : {},
|
|
63006
64059
|
...uploadType === "video" ? {
|
|
63007
64060
|
width: DEFAULT_VIDEO_WIDTH,
|
|
63008
64061
|
height: DEFAULT_VIDEO_HEIGHT,
|
|
@@ -63183,6 +64236,12 @@ var INLINE_MESSAGE_ENTITY_TYPE = {
|
|
|
63183
64236
|
function compactWhitespace(raw) {
|
|
63184
64237
|
return (raw ?? "").replace(/\s+/g, " ").trim();
|
|
63185
64238
|
}
|
|
64239
|
+
function normalizeRawMessageText(raw) {
|
|
64240
|
+
return (raw ?? "").replaceAll(`\r
|
|
64241
|
+
`, `
|
|
64242
|
+
`).replaceAll("\r", `
|
|
64243
|
+
`).trim();
|
|
64244
|
+
}
|
|
63186
64245
|
function bestPhotoSize(photo) {
|
|
63187
64246
|
let best = {
|
|
63188
64247
|
cdnUrl: null,
|
|
@@ -63487,7 +64546,7 @@ function formatEntitySummary(entity) {
|
|
|
63487
64546
|
}
|
|
63488
64547
|
}
|
|
63489
64548
|
function summarizeInlineMessageContent(message) {
|
|
63490
|
-
const rawText =
|
|
64549
|
+
const rawText = normalizeRawMessageText(message.message);
|
|
63491
64550
|
const media = messageMediaSummary(message);
|
|
63492
64551
|
const attachments = messageAttachmentSummaries(message);
|
|
63493
64552
|
const entities = messageEntitySummaries(message);
|
|
@@ -68727,6 +69786,9 @@ var inlineMessageActions = {
|
|
|
68727
69786
|
};
|
|
68728
69787
|
var inlineSupportedActions = listAllActions();
|
|
68729
69788
|
|
|
69789
|
+
// src/inline/approval-contract.ts
|
|
69790
|
+
var INLINE_APPROVAL_EVENT_KINDS = ["exec", "plugin", "system-agent"];
|
|
69791
|
+
|
|
68730
69792
|
// src/inline/exec-approvals.ts
|
|
68731
69793
|
import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
68732
69794
|
import {
|
|
@@ -68806,7 +69868,7 @@ function countInlineExecApprovalEligibleAccounts(params) {
|
|
|
68806
69868
|
}).length;
|
|
68807
69869
|
}
|
|
68808
69870
|
function isExecApprovalRequest(request) {
|
|
68809
|
-
return "command" in request.request;
|
|
69871
|
+
return request.approvalKind != null ? request.approvalKind === "exec" : ("command" in request.request) && !("proposalHash" in request.request);
|
|
68810
69872
|
}
|
|
68811
69873
|
function isTargetForwardingMode(mode) {
|
|
68812
69874
|
return mode === "targets" || mode === "both";
|
|
@@ -69092,6 +70154,21 @@ function buildInlineApprovalActions(view) {
|
|
|
69092
70154
|
return resolveInlineMessageActionsParam({ buttons }, { owner: "system" });
|
|
69093
70155
|
}
|
|
69094
70156
|
function buildPendingPayload(params) {
|
|
70157
|
+
if (String(params.approvalKind) === "system-agent") {
|
|
70158
|
+
const view = params.view;
|
|
70159
|
+
if (String(view.approvalKind) !== "system-agent" || !("operationSummary" in view) || typeof view.operationSummary !== "string") {
|
|
70160
|
+
throw new Error("system-agent approval request and view kinds do not match");
|
|
70161
|
+
}
|
|
70162
|
+
const text2 = sanitizeInlineOutgoingText([
|
|
70163
|
+
"\uD83D\uDD12 OpenClaw change requires approval",
|
|
70164
|
+
`Change: ${view.operationSummary}`,
|
|
70165
|
+
`Agent: ${"agentId" in view ? view.agentId ?? "unknown" : "unknown"}`,
|
|
70166
|
+
`Expires in: ${Math.max(0, Math.ceil((params.request.expiresAtMs - params.nowMs) / 1000))}s`
|
|
70167
|
+
].join(`
|
|
70168
|
+
`));
|
|
70169
|
+
const actions2 = buildInlineApprovalActions(view);
|
|
70170
|
+
return { text: text2, ...actions2 ? { actions: actions2 } : {} };
|
|
70171
|
+
}
|
|
69095
70172
|
const execView = params.view.approvalKind === "exec" ? params.view : null;
|
|
69096
70173
|
const payload = params.approvalKind === "plugin" ? buildPluginApprovalPendingReplyPayload({
|
|
69097
70174
|
request: params.request,
|
|
@@ -69120,7 +70197,7 @@ function buildPendingPayload(params) {
|
|
|
69120
70197
|
};
|
|
69121
70198
|
}
|
|
69122
70199
|
var inlineApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
69123
|
-
eventKinds:
|
|
70200
|
+
eventKinds: INLINE_APPROVAL_EVENT_KINDS,
|
|
69124
70201
|
availability: {
|
|
69125
70202
|
isConfigured: (params) => {
|
|
69126
70203
|
const resolved = resolveHandlerContext(params);
|
|
@@ -69251,5 +70328,5 @@ export {
|
|
|
69251
70328
|
inlineApprovalNativeRuntime
|
|
69252
70329
|
};
|
|
69253
70330
|
|
|
69254
|
-
//# debugId=
|
|
70331
|
+
//# debugId=5E1234798083973564756E2164756E21
|
|
69255
70332
|
//# sourceMappingURL=approval-handler.runtime.js.map
|