@inline-openclaw/inline 0.0.45 → 0.0.46

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.
@@ -5617,6 +5617,24 @@ var ConnectionError_Reason;
5617
5617
  ConnectionError_Reason2[ConnectionError_Reason2["INVALID_AUTH"] = 2] = "INVALID_AUTH";
5618
5618
  ConnectionError_Reason2[ConnectionError_Reason2["SESSION_REVOKED"] = 3] = "SESSION_REVOKED";
5619
5619
  })(ConnectionError_Reason || (ConnectionError_Reason = {}));
5620
+ var BotAvatar_Kind;
5621
+ (function(BotAvatar_Kind2) {
5622
+ BotAvatar_Kind2[BotAvatar_Kind2["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
5623
+ BotAvatar_Kind2[BotAvatar_Kind2["CODEX_ATLAS"] = 1] = "CODEX_ATLAS";
5624
+ })(BotAvatar_Kind || (BotAvatar_Kind = {}));
5625
+ var BotPresenceState_Kind;
5626
+ (function(BotPresenceState_Kind2) {
5627
+ BotPresenceState_Kind2[BotPresenceState_Kind2["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
5628
+ BotPresenceState_Kind2[BotPresenceState_Kind2["HIDDEN"] = 1] = "HIDDEN";
5629
+ BotPresenceState_Kind2[BotPresenceState_Kind2["IDLE"] = 2] = "IDLE";
5630
+ BotPresenceState_Kind2[BotPresenceState_Kind2["HAPPY"] = 3] = "HAPPY";
5631
+ BotPresenceState_Kind2[BotPresenceState_Kind2["WAVING"] = 4] = "WAVING";
5632
+ BotPresenceState_Kind2[BotPresenceState_Kind2["JUMPING"] = 5] = "JUMPING";
5633
+ BotPresenceState_Kind2[BotPresenceState_Kind2["FAILED"] = 6] = "FAILED";
5634
+ BotPresenceState_Kind2[BotPresenceState_Kind2["WAITING"] = 7] = "WAITING";
5635
+ BotPresenceState_Kind2[BotPresenceState_Kind2["RUNNING"] = 8] = "RUNNING";
5636
+ BotPresenceState_Kind2[BotPresenceState_Kind2["REVIEW"] = 9] = "REVIEW";
5637
+ })(BotPresenceState_Kind || (BotPresenceState_Kind = {}));
5620
5638
  var MessageEntity_Type;
5621
5639
  (function(MessageEntity_Type2) {
5622
5640
  MessageEntity_Type2[MessageEntity_Type2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
@@ -5730,6 +5748,11 @@ var UserStatus_Status;
5730
5748
  UserStatus_Status2[UserStatus_Status2["ONLINE"] = 1] = "ONLINE";
5731
5749
  UserStatus_Status2[UserStatus_Status2["OFFLINE"] = 2] = "OFFLINE";
5732
5750
  })(UserStatus_Status || (UserStatus_Status = {}));
5751
+ var DialogFollowMode;
5752
+ (function(DialogFollowMode2) {
5753
+ DialogFollowMode2[DialogFollowMode2["DIALOG_FOLLOW_MODE_UNSPECIFIED"] = 0] = "DIALOG_FOLLOW_MODE_UNSPECIFIED";
5754
+ DialogFollowMode2[DialogFollowMode2["FOLLOWING"] = 1] = "FOLLOWING";
5755
+ })(DialogFollowMode || (DialogFollowMode = {}));
5733
5756
  var MessageSendMode;
5734
5757
  (function(MessageSendMode2) {
5735
5758
  MessageSendMode2[MessageSendMode2["MODE_UNSPECIFIED"] = 0] = "MODE_UNSPECIFIED";
@@ -5793,6 +5816,11 @@ var Method;
5793
5816
  Method2[Method2["CLEAR_CHAT_HISTORY"] = 53] = "CLEAR_CHAT_HISTORY";
5794
5817
  Method2[Method2["DELETE_BOT"] = 54] = "DELETE_BOT";
5795
5818
  Method2[Method2["DELETE_MESSAGE_ATTACHMENT"] = 55] = "DELETE_MESSAGE_ATTACHMENT";
5819
+ Method2[Method2["SET_BOT_AVATAR"] = 56] = "SET_BOT_AVATAR";
5820
+ Method2[Method2["CLEAR_BOT_AVATAR"] = 57] = "CLEAR_BOT_AVATAR";
5821
+ Method2[Method2["GET_BOT_PRESENCE"] = 58] = "GET_BOT_PRESENCE";
5822
+ Method2[Method2["SET_BOT_PRESENCE_STATE"] = 59] = "SET_BOT_PRESENCE_STATE";
5823
+ Method2[Method2["UPDATE_DIALOG_FOLLOW_MODE"] = 60] = "UPDATE_DIALOG_FOLLOW_MODE";
5796
5824
  })(Method || (Method = {}));
5797
5825
  var PushNotificationProvider;
5798
5826
  (function(PushNotificationProvider2) {
@@ -6675,6 +6703,123 @@ class PeerUser$Type extends import_runtime4.MessageType {
6675
6703
  }
6676
6704
  var PeerUser = new PeerUser$Type;
6677
6705
 
6706
+ class BotAvatar$Type extends import_runtime4.MessageType {
6707
+ constructor() {
6708
+ super("BotAvatar", [
6709
+ { no: 1, name: "kind", kind: "enum", T: () => ["BotAvatar.Kind", BotAvatar_Kind] },
6710
+ { no: 2, name: "display_name", kind: "scalar", T: 9 },
6711
+ { no: 3, name: "description", kind: "scalar", opt: true, T: 9 },
6712
+ { no: 4, name: "cdn_url", kind: "scalar", opt: true, T: 9 },
6713
+ { no: 5, name: "file_unique_id", kind: "scalar", opt: true, T: 9 }
6714
+ ]);
6715
+ }
6716
+ create(value) {
6717
+ const message = globalThis.Object.create(this.messagePrototype);
6718
+ message.kind = 0;
6719
+ message.displayName = "";
6720
+ if (value !== undefined)
6721
+ import_runtime3.reflectionMergePartial(this, message, value);
6722
+ return message;
6723
+ }
6724
+ internalBinaryRead(reader, length, options, target) {
6725
+ let message = target ?? this.create(), end = reader.pos + length;
6726
+ while (reader.pos < end) {
6727
+ let [fieldNo, wireType] = reader.tag();
6728
+ switch (fieldNo) {
6729
+ case 1:
6730
+ message.kind = reader.int32();
6731
+ break;
6732
+ case 2:
6733
+ message.displayName = reader.string();
6734
+ break;
6735
+ case 3:
6736
+ message.description = reader.string();
6737
+ break;
6738
+ case 4:
6739
+ message.cdnUrl = reader.string();
6740
+ break;
6741
+ case 5:
6742
+ message.fileUniqueId = reader.string();
6743
+ break;
6744
+ default:
6745
+ let u = options.readUnknownField;
6746
+ if (u === "throw")
6747
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
6748
+ let d = reader.skip(wireType);
6749
+ if (u !== false)
6750
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
6751
+ }
6752
+ }
6753
+ return message;
6754
+ }
6755
+ internalBinaryWrite(message, writer, options) {
6756
+ if (message.kind !== 0)
6757
+ writer.tag(1, import_runtime.WireType.Varint).int32(message.kind);
6758
+ if (message.displayName !== "")
6759
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.displayName);
6760
+ if (message.description !== undefined)
6761
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
6762
+ if (message.cdnUrl !== undefined)
6763
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.cdnUrl);
6764
+ if (message.fileUniqueId !== undefined)
6765
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
6766
+ let u = options.writeUnknownFields;
6767
+ if (u !== false)
6768
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
6769
+ return writer;
6770
+ }
6771
+ }
6772
+ var BotAvatar = new BotAvatar$Type;
6773
+
6774
+ class BotPresenceState$Type extends import_runtime4.MessageType {
6775
+ constructor() {
6776
+ super("BotPresenceState", [
6777
+ { no: 1, name: "kind", kind: "enum", T: () => ["BotPresenceState.Kind", BotPresenceState_Kind] },
6778
+ { no: 2, name: "comment", kind: "scalar", opt: true, T: 9 }
6779
+ ]);
6780
+ }
6781
+ create(value) {
6782
+ const message = globalThis.Object.create(this.messagePrototype);
6783
+ message.kind = 0;
6784
+ if (value !== undefined)
6785
+ import_runtime3.reflectionMergePartial(this, message, value);
6786
+ return message;
6787
+ }
6788
+ internalBinaryRead(reader, length, options, target) {
6789
+ let message = target ?? this.create(), end = reader.pos + length;
6790
+ while (reader.pos < end) {
6791
+ let [fieldNo, wireType] = reader.tag();
6792
+ switch (fieldNo) {
6793
+ case 1:
6794
+ message.kind = reader.int32();
6795
+ break;
6796
+ case 2:
6797
+ message.comment = reader.string();
6798
+ break;
6799
+ default:
6800
+ let u = options.readUnknownField;
6801
+ if (u === "throw")
6802
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
6803
+ let d = reader.skip(wireType);
6804
+ if (u !== false)
6805
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
6806
+ }
6807
+ }
6808
+ return message;
6809
+ }
6810
+ internalBinaryWrite(message, writer, options) {
6811
+ if (message.kind !== 0)
6812
+ writer.tag(1, import_runtime.WireType.Varint).int32(message.kind);
6813
+ if (message.comment !== undefined)
6814
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.comment);
6815
+ let u = options.writeUnknownFields;
6816
+ if (u !== false)
6817
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
6818
+ return writer;
6819
+ }
6820
+ }
6821
+ var BotPresenceState = new BotPresenceState$Type;
6822
+
6678
6823
  class User$Type extends import_runtime4.MessageType {
6679
6824
  constructor() {
6680
6825
  super("User", [
@@ -6689,7 +6834,8 @@ class User$Type extends import_runtime4.MessageType {
6689
6834
  { no: 9, name: "profile_photo", kind: "message", T: () => UserProfilePhoto },
6690
6835
  { no: 11, name: "pending_setup", kind: "scalar", opt: true, T: 8 },
6691
6836
  { no: 12, name: "time_zone", kind: "scalar", opt: true, T: 9 },
6692
- { no: 13, name: "bot", kind: "scalar", opt: true, T: 8 }
6837
+ { no: 13, name: "bot", kind: "scalar", opt: true, T: 8 },
6838
+ { no: 14, name: "bot_avatar", kind: "message", T: () => BotAvatar }
6693
6839
  ]);
6694
6840
  }
6695
6841
  create(value) {
@@ -6740,6 +6886,9 @@ class User$Type extends import_runtime4.MessageType {
6740
6886
  case 13:
6741
6887
  message.bot = reader.bool();
6742
6888
  break;
6889
+ case 14:
6890
+ message.botAvatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.botAvatar);
6891
+ break;
6743
6892
  default:
6744
6893
  let u = options.readUnknownField;
6745
6894
  if (u === "throw")
@@ -6776,6 +6925,8 @@ class User$Type extends import_runtime4.MessageType {
6776
6925
  writer.tag(12, import_runtime.WireType.LengthDelimited).string(message.timeZone);
6777
6926
  if (message.bot !== undefined)
6778
6927
  writer.tag(13, import_runtime.WireType.Varint).bool(message.bot);
6928
+ if (message.botAvatar)
6929
+ BotAvatar.internalBinaryWrite(message.botAvatar, writer.tag(14, import_runtime.WireType.LengthDelimited).fork(), options).join();
6779
6930
  let u = options.writeUnknownFields;
6780
6931
  if (u !== false)
6781
6932
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -6861,7 +7012,8 @@ class Dialog$Type extends import_runtime4.MessageType {
6861
7012
  { no: 11, name: "open", kind: "scalar", opt: true, T: 8 },
6862
7013
  { no: 12, name: "opened_date", kind: "scalar", opt: true, T: 3, L: 0 },
6863
7014
  { no: 14, name: "order", kind: "scalar", opt: true, T: 9 },
6864
- { no: 15, name: "pinned_order", kind: "scalar", opt: true, T: 9 }
7015
+ { no: 15, name: "pinned_order", kind: "scalar", opt: true, T: 9 },
7016
+ { no: 16, name: "follow_mode", kind: "enum", opt: true, T: () => ["DialogFollowMode", DialogFollowMode] }
6865
7017
  ]);
6866
7018
  }
6867
7019
  create(value) {
@@ -6920,6 +7072,9 @@ class Dialog$Type extends import_runtime4.MessageType {
6920
7072
  case 15:
6921
7073
  message.pinnedOrder = reader.string();
6922
7074
  break;
7075
+ case 16:
7076
+ message.followMode = reader.int32();
7077
+ break;
6923
7078
  default:
6924
7079
  let u = options.readUnknownField;
6925
7080
  if (u === "throw")
@@ -6962,6 +7117,8 @@ class Dialog$Type extends import_runtime4.MessageType {
6962
7117
  writer.tag(14, import_runtime.WireType.LengthDelimited).string(message.order);
6963
7118
  if (message.pinnedOrder !== undefined)
6964
7119
  writer.tag(15, import_runtime.WireType.LengthDelimited).string(message.pinnedOrder);
7120
+ if (message.followMode !== undefined)
7121
+ writer.tag(16, import_runtime.WireType.Varint).int32(message.followMode);
6965
7122
  let u = options.writeUnknownFields;
6966
7123
  if (u !== false)
6967
7124
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -6985,7 +7142,8 @@ class Chat$Type extends import_runtime4.MessageType {
6985
7142
  { no: 10, name: "created_by", kind: "scalar", opt: true, T: 3, L: 0 },
6986
7143
  { no: 11, name: "parent_chat_id", kind: "scalar", opt: true, T: 3, L: 0 },
6987
7144
  { no: 12, name: "parent_message_id", kind: "scalar", opt: true, T: 3, L: 0 },
6988
- { no: 13, name: "untitled", kind: "scalar", opt: true, T: 8 }
7145
+ { no: 13, name: "untitled", kind: "scalar", opt: true, T: 8 },
7146
+ { no: 14, name: "number", kind: "scalar", opt: true, T: 5 }
6989
7147
  ]);
6990
7148
  }
6991
7149
  create(value) {
@@ -7040,6 +7198,9 @@ class Chat$Type extends import_runtime4.MessageType {
7040
7198
  case 13:
7041
7199
  message.untitled = reader.bool();
7042
7200
  break;
7201
+ case 14:
7202
+ message.number = reader.int32();
7203
+ break;
7043
7204
  default:
7044
7205
  let u = options.readUnknownField;
7045
7206
  if (u === "throw")
@@ -7078,6 +7239,8 @@ class Chat$Type extends import_runtime4.MessageType {
7078
7239
  writer.tag(12, import_runtime.WireType.Varint).int64(message.parentMessageId);
7079
7240
  if (message.untitled !== undefined)
7080
7241
  writer.tag(13, import_runtime.WireType.Varint).bool(message.untitled);
7242
+ if (message.number !== undefined)
7243
+ writer.tag(14, import_runtime.WireType.Varint).int32(message.number);
7081
7244
  let u = options.writeUnknownFields;
7082
7245
  if (u !== false)
7083
7246
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -9926,7 +10089,12 @@ class RpcCall$Type extends import_runtime4.MessageType {
9926
10089
  { no: 53, name: "updateDialogOrder", kind: "message", oneof: "input", T: () => UpdateDialogOrderInput },
9927
10090
  { no: 54, name: "clearChatHistory", kind: "message", oneof: "input", T: () => ClearChatHistoryInput },
9928
10091
  { no: 55, name: "deleteBot", kind: "message", oneof: "input", T: () => DeleteBotInput },
9929
- { no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "input", T: () => DeleteMessageAttachmentInput }
10092
+ { no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "input", T: () => DeleteMessageAttachmentInput },
10093
+ { no: 57, name: "setBotAvatar", kind: "message", oneof: "input", T: () => SetBotAvatarInput },
10094
+ { no: 58, name: "clearBotAvatar", kind: "message", oneof: "input", T: () => ClearBotAvatarInput },
10095
+ { no: 59, name: "getBotPresence", kind: "message", oneof: "input", T: () => GetBotPresenceInput },
10096
+ { no: 60, name: "setBotPresenceState", kind: "message", oneof: "input", T: () => SetBotPresenceStateInput },
10097
+ { no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "input", T: () => UpdateDialogFollowModeInput }
9930
10098
  ]);
9931
10099
  }
9932
10100
  create(value) {
@@ -10275,6 +10443,36 @@ class RpcCall$Type extends import_runtime4.MessageType {
10275
10443
  deleteMessageAttachment: DeleteMessageAttachmentInput.internalBinaryRead(reader, reader.uint32(), options, message.input.deleteMessageAttachment)
10276
10444
  };
10277
10445
  break;
10446
+ case 57:
10447
+ message.input = {
10448
+ oneofKind: "setBotAvatar",
10449
+ setBotAvatar: SetBotAvatarInput.internalBinaryRead(reader, reader.uint32(), options, message.input.setBotAvatar)
10450
+ };
10451
+ break;
10452
+ case 58:
10453
+ message.input = {
10454
+ oneofKind: "clearBotAvatar",
10455
+ clearBotAvatar: ClearBotAvatarInput.internalBinaryRead(reader, reader.uint32(), options, message.input.clearBotAvatar)
10456
+ };
10457
+ break;
10458
+ case 59:
10459
+ message.input = {
10460
+ oneofKind: "getBotPresence",
10461
+ getBotPresence: GetBotPresenceInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getBotPresence)
10462
+ };
10463
+ break;
10464
+ case 60:
10465
+ message.input = {
10466
+ oneofKind: "setBotPresenceState",
10467
+ setBotPresenceState: SetBotPresenceStateInput.internalBinaryRead(reader, reader.uint32(), options, message.input.setBotPresenceState)
10468
+ };
10469
+ break;
10470
+ case 61:
10471
+ message.input = {
10472
+ oneofKind: "updateDialogFollowMode",
10473
+ updateDialogFollowMode: UpdateDialogFollowModeInput.internalBinaryRead(reader, reader.uint32(), options, message.input.updateDialogFollowMode)
10474
+ };
10475
+ break;
10278
10476
  default:
10279
10477
  let u = options.readUnknownField;
10280
10478
  if (u === "throw")
@@ -10399,6 +10597,16 @@ class RpcCall$Type extends import_runtime4.MessageType {
10399
10597
  DeleteBotInput.internalBinaryWrite(message.input.deleteBot, writer.tag(55, import_runtime.WireType.LengthDelimited).fork(), options).join();
10400
10598
  if (message.input.oneofKind === "deleteMessageAttachment")
10401
10599
  DeleteMessageAttachmentInput.internalBinaryWrite(message.input.deleteMessageAttachment, writer.tag(56, import_runtime.WireType.LengthDelimited).fork(), options).join();
10600
+ if (message.input.oneofKind === "setBotAvatar")
10601
+ SetBotAvatarInput.internalBinaryWrite(message.input.setBotAvatar, writer.tag(57, import_runtime.WireType.LengthDelimited).fork(), options).join();
10602
+ if (message.input.oneofKind === "clearBotAvatar")
10603
+ ClearBotAvatarInput.internalBinaryWrite(message.input.clearBotAvatar, writer.tag(58, import_runtime.WireType.LengthDelimited).fork(), options).join();
10604
+ if (message.input.oneofKind === "getBotPresence")
10605
+ GetBotPresenceInput.internalBinaryWrite(message.input.getBotPresence, writer.tag(59, import_runtime.WireType.LengthDelimited).fork(), options).join();
10606
+ if (message.input.oneofKind === "setBotPresenceState")
10607
+ SetBotPresenceStateInput.internalBinaryWrite(message.input.setBotPresenceState, writer.tag(60, import_runtime.WireType.LengthDelimited).fork(), options).join();
10608
+ if (message.input.oneofKind === "updateDialogFollowMode")
10609
+ UpdateDialogFollowModeInput.internalBinaryWrite(message.input.updateDialogFollowMode, writer.tag(61, import_runtime.WireType.LengthDelimited).fork(), options).join();
10402
10610
  let u = options.writeUnknownFields;
10403
10611
  if (u !== false)
10404
10612
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -10465,7 +10673,12 @@ class RpcResult$Type extends import_runtime4.MessageType {
10465
10673
  { no: 53, name: "updateDialogOrder", kind: "message", oneof: "result", T: () => UpdateDialogOrderResult },
10466
10674
  { no: 54, name: "clearChatHistory", kind: "message", oneof: "result", T: () => ClearChatHistoryResult },
10467
10675
  { no: 55, name: "deleteBot", kind: "message", oneof: "result", T: () => DeleteBotResult },
10468
- { no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "result", T: () => DeleteMessageAttachmentResult }
10676
+ { no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "result", T: () => DeleteMessageAttachmentResult },
10677
+ { no: 57, name: "setBotAvatar", kind: "message", oneof: "result", T: () => SetBotAvatarResult },
10678
+ { no: 58, name: "clearBotAvatar", kind: "message", oneof: "result", T: () => ClearBotAvatarResult },
10679
+ { no: 59, name: "getBotPresence", kind: "message", oneof: "result", T: () => GetBotPresenceResult },
10680
+ { no: 60, name: "setBotPresenceState", kind: "message", oneof: "result", T: () => SetBotPresenceStateResult },
10681
+ { no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "result", T: () => UpdateDialogFollowModeResult }
10469
10682
  ]);
10470
10683
  }
10471
10684
  create(value) {
@@ -10814,6 +11027,36 @@ class RpcResult$Type extends import_runtime4.MessageType {
10814
11027
  deleteMessageAttachment: DeleteMessageAttachmentResult.internalBinaryRead(reader, reader.uint32(), options, message.result.deleteMessageAttachment)
10815
11028
  };
10816
11029
  break;
11030
+ case 57:
11031
+ message.result = {
11032
+ oneofKind: "setBotAvatar",
11033
+ setBotAvatar: SetBotAvatarResult.internalBinaryRead(reader, reader.uint32(), options, message.result.setBotAvatar)
11034
+ };
11035
+ break;
11036
+ case 58:
11037
+ message.result = {
11038
+ oneofKind: "clearBotAvatar",
11039
+ clearBotAvatar: ClearBotAvatarResult.internalBinaryRead(reader, reader.uint32(), options, message.result.clearBotAvatar)
11040
+ };
11041
+ break;
11042
+ case 59:
11043
+ message.result = {
11044
+ oneofKind: "getBotPresence",
11045
+ getBotPresence: GetBotPresenceResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getBotPresence)
11046
+ };
11047
+ break;
11048
+ case 60:
11049
+ message.result = {
11050
+ oneofKind: "setBotPresenceState",
11051
+ setBotPresenceState: SetBotPresenceStateResult.internalBinaryRead(reader, reader.uint32(), options, message.result.setBotPresenceState)
11052
+ };
11053
+ break;
11054
+ case 61:
11055
+ message.result = {
11056
+ oneofKind: "updateDialogFollowMode",
11057
+ updateDialogFollowMode: UpdateDialogFollowModeResult.internalBinaryRead(reader, reader.uint32(), options, message.result.updateDialogFollowMode)
11058
+ };
11059
+ break;
10817
11060
  default:
10818
11061
  let u = options.readUnknownField;
10819
11062
  if (u === "throw")
@@ -10938,6 +11181,16 @@ class RpcResult$Type extends import_runtime4.MessageType {
10938
11181
  DeleteBotResult.internalBinaryWrite(message.result.deleteBot, writer.tag(55, import_runtime.WireType.LengthDelimited).fork(), options).join();
10939
11182
  if (message.result.oneofKind === "deleteMessageAttachment")
10940
11183
  DeleteMessageAttachmentResult.internalBinaryWrite(message.result.deleteMessageAttachment, writer.tag(56, import_runtime.WireType.LengthDelimited).fork(), options).join();
11184
+ if (message.result.oneofKind === "setBotAvatar")
11185
+ SetBotAvatarResult.internalBinaryWrite(message.result.setBotAvatar, writer.tag(57, import_runtime.WireType.LengthDelimited).fork(), options).join();
11186
+ if (message.result.oneofKind === "clearBotAvatar")
11187
+ ClearBotAvatarResult.internalBinaryWrite(message.result.clearBotAvatar, writer.tag(58, import_runtime.WireType.LengthDelimited).fork(), options).join();
11188
+ if (message.result.oneofKind === "getBotPresence")
11189
+ GetBotPresenceResult.internalBinaryWrite(message.result.getBotPresence, writer.tag(59, import_runtime.WireType.LengthDelimited).fork(), options).join();
11190
+ if (message.result.oneofKind === "setBotPresenceState")
11191
+ SetBotPresenceStateResult.internalBinaryWrite(message.result.setBotPresenceState, writer.tag(60, import_runtime.WireType.LengthDelimited).fork(), options).join();
11192
+ if (message.result.oneofKind === "updateDialogFollowMode")
11193
+ UpdateDialogFollowModeResult.internalBinaryWrite(message.result.updateDialogFollowMode, writer.tag(61, import_runtime.WireType.LengthDelimited).fork(), options).join();
10941
11194
  let u = options.writeUnknownFields;
10942
11195
  if (u !== false)
10943
11196
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -12029,6 +12282,97 @@ class UpdateDialogOrderResult$Type extends import_runtime4.MessageType {
12029
12282
  }
12030
12283
  var UpdateDialogOrderResult = new UpdateDialogOrderResult$Type;
12031
12284
 
12285
+ class UpdateDialogFollowModeInput$Type extends import_runtime4.MessageType {
12286
+ constructor() {
12287
+ super("UpdateDialogFollowModeInput", [
12288
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
12289
+ { no: 2, name: "follow_mode", kind: "enum", opt: true, T: () => ["DialogFollowMode", DialogFollowMode] }
12290
+ ]);
12291
+ }
12292
+ create(value) {
12293
+ const message = globalThis.Object.create(this.messagePrototype);
12294
+ if (value !== undefined)
12295
+ import_runtime3.reflectionMergePartial(this, message, value);
12296
+ return message;
12297
+ }
12298
+ internalBinaryRead(reader, length, options, target) {
12299
+ let message = target ?? this.create(), end = reader.pos + length;
12300
+ while (reader.pos < end) {
12301
+ let [fieldNo, wireType] = reader.tag();
12302
+ switch (fieldNo) {
12303
+ case 1:
12304
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
12305
+ break;
12306
+ case 2:
12307
+ message.followMode = reader.int32();
12308
+ break;
12309
+ default:
12310
+ let u = options.readUnknownField;
12311
+ if (u === "throw")
12312
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12313
+ let d = reader.skip(wireType);
12314
+ if (u !== false)
12315
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12316
+ }
12317
+ }
12318
+ return message;
12319
+ }
12320
+ internalBinaryWrite(message, writer, options) {
12321
+ if (message.peerId)
12322
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
12323
+ if (message.followMode !== undefined)
12324
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.followMode);
12325
+ let u = options.writeUnknownFields;
12326
+ if (u !== false)
12327
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12328
+ return writer;
12329
+ }
12330
+ }
12331
+ var UpdateDialogFollowModeInput = new UpdateDialogFollowModeInput$Type;
12332
+
12333
+ class UpdateDialogFollowModeResult$Type extends import_runtime4.MessageType {
12334
+ constructor() {
12335
+ super("UpdateDialogFollowModeResult", [
12336
+ { no: 1, name: "updates", kind: "message", repeat: 1, T: () => Update }
12337
+ ]);
12338
+ }
12339
+ create(value) {
12340
+ const message = globalThis.Object.create(this.messagePrototype);
12341
+ message.updates = [];
12342
+ if (value !== undefined)
12343
+ import_runtime3.reflectionMergePartial(this, message, value);
12344
+ return message;
12345
+ }
12346
+ internalBinaryRead(reader, length, options, target) {
12347
+ let message = target ?? this.create(), end = reader.pos + length;
12348
+ while (reader.pos < end) {
12349
+ let [fieldNo, wireType] = reader.tag();
12350
+ switch (fieldNo) {
12351
+ case 1:
12352
+ message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
12353
+ break;
12354
+ default:
12355
+ let u = options.readUnknownField;
12356
+ if (u === "throw")
12357
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12358
+ let d = reader.skip(wireType);
12359
+ if (u !== false)
12360
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12361
+ }
12362
+ }
12363
+ return message;
12364
+ }
12365
+ internalBinaryWrite(message, writer, options) {
12366
+ for (let i = 0;i < message.updates.length; i++)
12367
+ Update.internalBinaryWrite(message.updates[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
12368
+ let u = options.writeUnknownFields;
12369
+ if (u !== false)
12370
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12371
+ return writer;
12372
+ }
12373
+ }
12374
+ var UpdateDialogFollowModeResult = new UpdateDialogFollowModeResult$Type;
12375
+
12032
12376
  class MarkAsUnreadInput$Type extends import_runtime4.MessageType {
12033
12377
  constructor() {
12034
12378
  super("MarkAsUnreadInput", [
@@ -12799,17 +13143,367 @@ class GetBotCommandsInput$Type extends import_runtime4.MessageType {
12799
13143
  return writer;
12800
13144
  }
12801
13145
  }
12802
- var GetBotCommandsInput = new GetBotCommandsInput$Type;
13146
+ var GetBotCommandsInput = new GetBotCommandsInput$Type;
13147
+
13148
+ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13149
+ constructor() {
13150
+ super("GetBotCommandsResult", [
13151
+ { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13152
+ ]);
13153
+ }
13154
+ create(value) {
13155
+ const message = globalThis.Object.create(this.messagePrototype);
13156
+ message.commands = [];
13157
+ if (value !== undefined)
13158
+ import_runtime3.reflectionMergePartial(this, message, value);
13159
+ return message;
13160
+ }
13161
+ internalBinaryRead(reader, length, options, target) {
13162
+ let message = target ?? this.create(), end = reader.pos + length;
13163
+ while (reader.pos < end) {
13164
+ let [fieldNo, wireType] = reader.tag();
13165
+ switch (fieldNo) {
13166
+ case 1:
13167
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13168
+ break;
13169
+ default:
13170
+ let u = options.readUnknownField;
13171
+ if (u === "throw")
13172
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13173
+ let d = reader.skip(wireType);
13174
+ if (u !== false)
13175
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13176
+ }
13177
+ }
13178
+ return message;
13179
+ }
13180
+ internalBinaryWrite(message, writer, options) {
13181
+ for (let i = 0;i < message.commands.length; i++)
13182
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13183
+ let u = options.writeUnknownFields;
13184
+ if (u !== false)
13185
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13186
+ return writer;
13187
+ }
13188
+ }
13189
+ var GetBotCommandsResult = new GetBotCommandsResult$Type;
13190
+
13191
+ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13192
+ constructor() {
13193
+ super("SetBotCommandsInput", [
13194
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
13195
+ { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13196
+ ]);
13197
+ }
13198
+ create(value) {
13199
+ const message = globalThis.Object.create(this.messagePrototype);
13200
+ message.botUserId = 0n;
13201
+ message.commands = [];
13202
+ if (value !== undefined)
13203
+ import_runtime3.reflectionMergePartial(this, message, value);
13204
+ return message;
13205
+ }
13206
+ internalBinaryRead(reader, length, options, target) {
13207
+ let message = target ?? this.create(), end = reader.pos + length;
13208
+ while (reader.pos < end) {
13209
+ let [fieldNo, wireType] = reader.tag();
13210
+ switch (fieldNo) {
13211
+ case 1:
13212
+ message.botUserId = reader.int64().toBigInt();
13213
+ break;
13214
+ case 2:
13215
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13216
+ break;
13217
+ default:
13218
+ let u = options.readUnknownField;
13219
+ if (u === "throw")
13220
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13221
+ let d = reader.skip(wireType);
13222
+ if (u !== false)
13223
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13224
+ }
13225
+ }
13226
+ return message;
13227
+ }
13228
+ internalBinaryWrite(message, writer, options) {
13229
+ if (message.botUserId !== 0n)
13230
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13231
+ for (let i = 0;i < message.commands.length; i++)
13232
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13233
+ let u = options.writeUnknownFields;
13234
+ if (u !== false)
13235
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13236
+ return writer;
13237
+ }
13238
+ }
13239
+ var SetBotCommandsInput = new SetBotCommandsInput$Type;
13240
+
13241
+ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13242
+ constructor() {
13243
+ super("SetBotCommandsResult", [
13244
+ { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13245
+ ]);
13246
+ }
13247
+ create(value) {
13248
+ const message = globalThis.Object.create(this.messagePrototype);
13249
+ message.commands = [];
13250
+ if (value !== undefined)
13251
+ import_runtime3.reflectionMergePartial(this, message, value);
13252
+ return message;
13253
+ }
13254
+ internalBinaryRead(reader, length, options, target) {
13255
+ let message = target ?? this.create(), end = reader.pos + length;
13256
+ while (reader.pos < end) {
13257
+ let [fieldNo, wireType] = reader.tag();
13258
+ switch (fieldNo) {
13259
+ case 1:
13260
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13261
+ break;
13262
+ default:
13263
+ let u = options.readUnknownField;
13264
+ if (u === "throw")
13265
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13266
+ let d = reader.skip(wireType);
13267
+ if (u !== false)
13268
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13269
+ }
13270
+ }
13271
+ return message;
13272
+ }
13273
+ internalBinaryWrite(message, writer, options) {
13274
+ for (let i = 0;i < message.commands.length; i++)
13275
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13276
+ let u = options.writeUnknownFields;
13277
+ if (u !== false)
13278
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13279
+ return writer;
13280
+ }
13281
+ }
13282
+ var SetBotCommandsResult = new SetBotCommandsResult$Type;
13283
+
13284
+ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13285
+ constructor() {
13286
+ super("GetPeerBotCommandsInput", [
13287
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
13288
+ ]);
13289
+ }
13290
+ create(value) {
13291
+ const message = globalThis.Object.create(this.messagePrototype);
13292
+ if (value !== undefined)
13293
+ import_runtime3.reflectionMergePartial(this, message, value);
13294
+ return message;
13295
+ }
13296
+ internalBinaryRead(reader, length, options, target) {
13297
+ let message = target ?? this.create(), end = reader.pos + length;
13298
+ while (reader.pos < end) {
13299
+ let [fieldNo, wireType] = reader.tag();
13300
+ switch (fieldNo) {
13301
+ case 1:
13302
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
13303
+ break;
13304
+ default:
13305
+ let u = options.readUnknownField;
13306
+ if (u === "throw")
13307
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13308
+ let d = reader.skip(wireType);
13309
+ if (u !== false)
13310
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13311
+ }
13312
+ }
13313
+ return message;
13314
+ }
13315
+ internalBinaryWrite(message, writer, options) {
13316
+ if (message.peerId)
13317
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13318
+ let u = options.writeUnknownFields;
13319
+ if (u !== false)
13320
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13321
+ return writer;
13322
+ }
13323
+ }
13324
+ var GetPeerBotCommandsInput = new GetPeerBotCommandsInput$Type;
13325
+
13326
+ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13327
+ constructor() {
13328
+ super("GetPeerBotCommandsResult", [
13329
+ { no: 1, name: "bots", kind: "message", repeat: 1, T: () => PeerBotCommands }
13330
+ ]);
13331
+ }
13332
+ create(value) {
13333
+ const message = globalThis.Object.create(this.messagePrototype);
13334
+ message.bots = [];
13335
+ if (value !== undefined)
13336
+ import_runtime3.reflectionMergePartial(this, message, value);
13337
+ return message;
13338
+ }
13339
+ internalBinaryRead(reader, length, options, target) {
13340
+ let message = target ?? this.create(), end = reader.pos + length;
13341
+ while (reader.pos < end) {
13342
+ let [fieldNo, wireType] = reader.tag();
13343
+ switch (fieldNo) {
13344
+ case 1:
13345
+ message.bots.push(PeerBotCommands.internalBinaryRead(reader, reader.uint32(), options));
13346
+ break;
13347
+ default:
13348
+ let u = options.readUnknownField;
13349
+ if (u === "throw")
13350
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13351
+ let d = reader.skip(wireType);
13352
+ if (u !== false)
13353
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13354
+ }
13355
+ }
13356
+ return message;
13357
+ }
13358
+ internalBinaryWrite(message, writer, options) {
13359
+ for (let i = 0;i < message.bots.length; i++)
13360
+ PeerBotCommands.internalBinaryWrite(message.bots[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13361
+ let u = options.writeUnknownFields;
13362
+ if (u !== false)
13363
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13364
+ return writer;
13365
+ }
13366
+ }
13367
+ var GetPeerBotCommandsResult = new GetPeerBotCommandsResult$Type;
13368
+
13369
+ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13370
+ constructor() {
13371
+ super("RevealBotTokenInput", [
13372
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13373
+ ]);
13374
+ }
13375
+ create(value) {
13376
+ const message = globalThis.Object.create(this.messagePrototype);
13377
+ message.botUserId = 0n;
13378
+ if (value !== undefined)
13379
+ import_runtime3.reflectionMergePartial(this, message, value);
13380
+ return message;
13381
+ }
13382
+ internalBinaryRead(reader, length, options, target) {
13383
+ let message = target ?? this.create(), end = reader.pos + length;
13384
+ while (reader.pos < end) {
13385
+ let [fieldNo, wireType] = reader.tag();
13386
+ switch (fieldNo) {
13387
+ case 1:
13388
+ message.botUserId = reader.int64().toBigInt();
13389
+ break;
13390
+ default:
13391
+ let u = options.readUnknownField;
13392
+ if (u === "throw")
13393
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13394
+ let d = reader.skip(wireType);
13395
+ if (u !== false)
13396
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13397
+ }
13398
+ }
13399
+ return message;
13400
+ }
13401
+ internalBinaryWrite(message, writer, options) {
13402
+ if (message.botUserId !== 0n)
13403
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13404
+ let u = options.writeUnknownFields;
13405
+ if (u !== false)
13406
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13407
+ return writer;
13408
+ }
13409
+ }
13410
+ var RevealBotTokenInput = new RevealBotTokenInput$Type;
13411
+
13412
+ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13413
+ constructor() {
13414
+ super("RevealBotTokenResult", [
13415
+ { no: 1, name: "token", kind: "scalar", T: 9 }
13416
+ ]);
13417
+ }
13418
+ create(value) {
13419
+ const message = globalThis.Object.create(this.messagePrototype);
13420
+ message.token = "";
13421
+ if (value !== undefined)
13422
+ import_runtime3.reflectionMergePartial(this, message, value);
13423
+ return message;
13424
+ }
13425
+ internalBinaryRead(reader, length, options, target) {
13426
+ let message = target ?? this.create(), end = reader.pos + length;
13427
+ while (reader.pos < end) {
13428
+ let [fieldNo, wireType] = reader.tag();
13429
+ switch (fieldNo) {
13430
+ case 1:
13431
+ message.token = reader.string();
13432
+ break;
13433
+ default:
13434
+ let u = options.readUnknownField;
13435
+ if (u === "throw")
13436
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13437
+ let d = reader.skip(wireType);
13438
+ if (u !== false)
13439
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13440
+ }
13441
+ }
13442
+ return message;
13443
+ }
13444
+ internalBinaryWrite(message, writer, options) {
13445
+ if (message.token !== "")
13446
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
13447
+ let u = options.writeUnknownFields;
13448
+ if (u !== false)
13449
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13450
+ return writer;
13451
+ }
13452
+ }
13453
+ var RevealBotTokenResult = new RevealBotTokenResult$Type;
13454
+
13455
+ class RotateBotTokenInput$Type extends import_runtime4.MessageType {
13456
+ constructor() {
13457
+ super("RotateBotTokenInput", [
13458
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13459
+ ]);
13460
+ }
13461
+ create(value) {
13462
+ const message = globalThis.Object.create(this.messagePrototype);
13463
+ message.botUserId = 0n;
13464
+ if (value !== undefined)
13465
+ import_runtime3.reflectionMergePartial(this, message, value);
13466
+ return message;
13467
+ }
13468
+ internalBinaryRead(reader, length, options, target) {
13469
+ let message = target ?? this.create(), end = reader.pos + length;
13470
+ while (reader.pos < end) {
13471
+ let [fieldNo, wireType] = reader.tag();
13472
+ switch (fieldNo) {
13473
+ case 1:
13474
+ message.botUserId = reader.int64().toBigInt();
13475
+ break;
13476
+ default:
13477
+ let u = options.readUnknownField;
13478
+ if (u === "throw")
13479
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13480
+ let d = reader.skip(wireType);
13481
+ if (u !== false)
13482
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13483
+ }
13484
+ }
13485
+ return message;
13486
+ }
13487
+ internalBinaryWrite(message, writer, options) {
13488
+ if (message.botUserId !== 0n)
13489
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13490
+ let u = options.writeUnknownFields;
13491
+ if (u !== false)
13492
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13493
+ return writer;
13494
+ }
13495
+ }
13496
+ var RotateBotTokenInput = new RotateBotTokenInput$Type;
12803
13497
 
12804
- class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13498
+ class RotateBotTokenResult$Type extends import_runtime4.MessageType {
12805
13499
  constructor() {
12806
- super("GetBotCommandsResult", [
12807
- { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13500
+ super("RotateBotTokenResult", [
13501
+ { no: 1, name: "token", kind: "scalar", T: 9 }
12808
13502
  ]);
12809
13503
  }
12810
13504
  create(value) {
12811
13505
  const message = globalThis.Object.create(this.messagePrototype);
12812
- message.commands = [];
13506
+ message.token = "";
12813
13507
  if (value !== undefined)
12814
13508
  import_runtime3.reflectionMergePartial(this, message, value);
12815
13509
  return message;
@@ -12820,7 +13514,7 @@ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
12820
13514
  let [fieldNo, wireType] = reader.tag();
12821
13515
  switch (fieldNo) {
12822
13516
  case 1:
12823
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13517
+ message.token = reader.string();
12824
13518
  break;
12825
13519
  default:
12826
13520
  let u = options.readUnknownField;
@@ -12834,27 +13528,27 @@ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
12834
13528
  return message;
12835
13529
  }
12836
13530
  internalBinaryWrite(message, writer, options) {
12837
- for (let i = 0;i < message.commands.length; i++)
12838
- BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13531
+ if (message.token !== "")
13532
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
12839
13533
  let u = options.writeUnknownFields;
12840
13534
  if (u !== false)
12841
13535
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12842
13536
  return writer;
12843
13537
  }
12844
13538
  }
12845
- var GetBotCommandsResult = new GetBotCommandsResult$Type;
13539
+ var RotateBotTokenResult = new RotateBotTokenResult$Type;
12846
13540
 
12847
- class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13541
+ class UpdateBotProfileInput$Type extends import_runtime4.MessageType {
12848
13542
  constructor() {
12849
- super("SetBotCommandsInput", [
13543
+ super("UpdateBotProfileInput", [
12850
13544
  { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
12851
- { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13545
+ { no: 2, name: "name", kind: "scalar", opt: true, T: 9 },
13546
+ { no: 3, name: "photo_file_unique_id", kind: "scalar", opt: true, T: 9 }
12852
13547
  ]);
12853
13548
  }
12854
13549
  create(value) {
12855
13550
  const message = globalThis.Object.create(this.messagePrototype);
12856
13551
  message.botUserId = 0n;
12857
- message.commands = [];
12858
13552
  if (value !== undefined)
12859
13553
  import_runtime3.reflectionMergePartial(this, message, value);
12860
13554
  return message;
@@ -12868,7 +13562,10 @@ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
12868
13562
  message.botUserId = reader.int64().toBigInt();
12869
13563
  break;
12870
13564
  case 2:
12871
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13565
+ message.name = reader.string();
13566
+ break;
13567
+ case 3:
13568
+ message.photoFileUniqueId = reader.string();
12872
13569
  break;
12873
13570
  default:
12874
13571
  let u = options.readUnknownField;
@@ -12884,25 +13581,26 @@ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
12884
13581
  internalBinaryWrite(message, writer, options) {
12885
13582
  if (message.botUserId !== 0n)
12886
13583
  writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
12887
- for (let i = 0;i < message.commands.length; i++)
12888
- BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13584
+ if (message.name !== undefined)
13585
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.name);
13586
+ if (message.photoFileUniqueId !== undefined)
13587
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.photoFileUniqueId);
12889
13588
  let u = options.writeUnknownFields;
12890
13589
  if (u !== false)
12891
13590
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12892
13591
  return writer;
12893
13592
  }
12894
13593
  }
12895
- var SetBotCommandsInput = new SetBotCommandsInput$Type;
13594
+ var UpdateBotProfileInput = new UpdateBotProfileInput$Type;
12896
13595
 
12897
- class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13596
+ class UpdateBotProfileResult$Type extends import_runtime4.MessageType {
12898
13597
  constructor() {
12899
- super("SetBotCommandsResult", [
12900
- { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13598
+ super("UpdateBotProfileResult", [
13599
+ { no: 1, name: "bot", kind: "message", T: () => User }
12901
13600
  ]);
12902
13601
  }
12903
13602
  create(value) {
12904
13603
  const message = globalThis.Object.create(this.messagePrototype);
12905
- message.commands = [];
12906
13604
  if (value !== undefined)
12907
13605
  import_runtime3.reflectionMergePartial(this, message, value);
12908
13606
  return message;
@@ -12913,7 +13611,7 @@ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
12913
13611
  let [fieldNo, wireType] = reader.tag();
12914
13612
  switch (fieldNo) {
12915
13613
  case 1:
12916
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13614
+ message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
12917
13615
  break;
12918
13616
  default:
12919
13617
  let u = options.readUnknownField;
@@ -12927,24 +13625,32 @@ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
12927
13625
  return message;
12928
13626
  }
12929
13627
  internalBinaryWrite(message, writer, options) {
12930
- for (let i = 0;i < message.commands.length; i++)
12931
- BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13628
+ if (message.bot)
13629
+ User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
12932
13630
  let u = options.writeUnknownFields;
12933
13631
  if (u !== false)
12934
13632
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12935
13633
  return writer;
12936
13634
  }
12937
13635
  }
12938
- var SetBotCommandsResult = new SetBotCommandsResult$Type;
13636
+ var UpdateBotProfileResult = new UpdateBotProfileResult$Type;
12939
13637
 
12940
- class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13638
+ class SetBotAvatarInput$Type extends import_runtime4.MessageType {
12941
13639
  constructor() {
12942
- super("GetPeerBotCommandsInput", [
12943
- { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
13640
+ super("SetBotAvatarInput", [
13641
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
13642
+ { no: 2, name: "kind", kind: "enum", T: () => ["BotAvatar.Kind", BotAvatar_Kind] },
13643
+ { no: 3, name: "display_name", kind: "scalar", T: 9 },
13644
+ { no: 4, name: "description", kind: "scalar", opt: true, T: 9 },
13645
+ { no: 5, name: "file_unique_id", kind: "scalar", T: 9 }
12944
13646
  ]);
12945
13647
  }
12946
13648
  create(value) {
12947
13649
  const message = globalThis.Object.create(this.messagePrototype);
13650
+ message.botUserId = 0n;
13651
+ message.kind = 0;
13652
+ message.displayName = "";
13653
+ message.fileUniqueId = "";
12948
13654
  if (value !== undefined)
12949
13655
  import_runtime3.reflectionMergePartial(this, message, value);
12950
13656
  return message;
@@ -12955,7 +13661,19 @@ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
12955
13661
  let [fieldNo, wireType] = reader.tag();
12956
13662
  switch (fieldNo) {
12957
13663
  case 1:
12958
- message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
13664
+ message.botUserId = reader.int64().toBigInt();
13665
+ break;
13666
+ case 2:
13667
+ message.kind = reader.int32();
13668
+ break;
13669
+ case 3:
13670
+ message.displayName = reader.string();
13671
+ break;
13672
+ case 4:
13673
+ message.description = reader.string();
13674
+ break;
13675
+ case 5:
13676
+ message.fileUniqueId = reader.string();
12959
13677
  break;
12960
13678
  default:
12961
13679
  let u = options.readUnknownField;
@@ -12969,25 +13687,32 @@ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
12969
13687
  return message;
12970
13688
  }
12971
13689
  internalBinaryWrite(message, writer, options) {
12972
- if (message.peerId)
12973
- InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13690
+ if (message.botUserId !== 0n)
13691
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13692
+ if (message.kind !== 0)
13693
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.kind);
13694
+ if (message.displayName !== "")
13695
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.displayName);
13696
+ if (message.description !== undefined)
13697
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.description);
13698
+ if (message.fileUniqueId !== "")
13699
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
12974
13700
  let u = options.writeUnknownFields;
12975
13701
  if (u !== false)
12976
13702
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12977
13703
  return writer;
12978
13704
  }
12979
13705
  }
12980
- var GetPeerBotCommandsInput = new GetPeerBotCommandsInput$Type;
13706
+ var SetBotAvatarInput = new SetBotAvatarInput$Type;
12981
13707
 
12982
- class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13708
+ class SetBotAvatarResult$Type extends import_runtime4.MessageType {
12983
13709
  constructor() {
12984
- super("GetPeerBotCommandsResult", [
12985
- { no: 1, name: "bots", kind: "message", repeat: 1, T: () => PeerBotCommands }
13710
+ super("SetBotAvatarResult", [
13711
+ { no: 1, name: "bot", kind: "message", T: () => User }
12986
13712
  ]);
12987
13713
  }
12988
13714
  create(value) {
12989
13715
  const message = globalThis.Object.create(this.messagePrototype);
12990
- message.bots = [];
12991
13716
  if (value !== undefined)
12992
13717
  import_runtime3.reflectionMergePartial(this, message, value);
12993
13718
  return message;
@@ -12998,7 +13723,7 @@ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
12998
13723
  let [fieldNo, wireType] = reader.tag();
12999
13724
  switch (fieldNo) {
13000
13725
  case 1:
13001
- message.bots.push(PeerBotCommands.internalBinaryRead(reader, reader.uint32(), options));
13726
+ message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
13002
13727
  break;
13003
13728
  default:
13004
13729
  let u = options.readUnknownField;
@@ -13012,19 +13737,19 @@ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13012
13737
  return message;
13013
13738
  }
13014
13739
  internalBinaryWrite(message, writer, options) {
13015
- for (let i = 0;i < message.bots.length; i++)
13016
- PeerBotCommands.internalBinaryWrite(message.bots[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13740
+ if (message.bot)
13741
+ User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13017
13742
  let u = options.writeUnknownFields;
13018
13743
  if (u !== false)
13019
13744
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13020
13745
  return writer;
13021
13746
  }
13022
13747
  }
13023
- var GetPeerBotCommandsResult = new GetPeerBotCommandsResult$Type;
13748
+ var SetBotAvatarResult = new SetBotAvatarResult$Type;
13024
13749
 
13025
- class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13750
+ class ClearBotAvatarInput$Type extends import_runtime4.MessageType {
13026
13751
  constructor() {
13027
- super("RevealBotTokenInput", [
13752
+ super("ClearBotAvatarInput", [
13028
13753
  { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13029
13754
  ]);
13030
13755
  }
@@ -13063,17 +13788,16 @@ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13063
13788
  return writer;
13064
13789
  }
13065
13790
  }
13066
- var RevealBotTokenInput = new RevealBotTokenInput$Type;
13791
+ var ClearBotAvatarInput = new ClearBotAvatarInput$Type;
13067
13792
 
13068
- class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13793
+ class ClearBotAvatarResult$Type extends import_runtime4.MessageType {
13069
13794
  constructor() {
13070
- super("RevealBotTokenResult", [
13071
- { no: 1, name: "token", kind: "scalar", T: 9 }
13795
+ super("ClearBotAvatarResult", [
13796
+ { no: 1, name: "bot", kind: "message", T: () => User }
13072
13797
  ]);
13073
13798
  }
13074
13799
  create(value) {
13075
13800
  const message = globalThis.Object.create(this.messagePrototype);
13076
- message.token = "";
13077
13801
  if (value !== undefined)
13078
13802
  import_runtime3.reflectionMergePartial(this, message, value);
13079
13803
  return message;
@@ -13084,7 +13808,7 @@ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13084
13808
  let [fieldNo, wireType] = reader.tag();
13085
13809
  switch (fieldNo) {
13086
13810
  case 1:
13087
- message.token = reader.string();
13811
+ message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
13088
13812
  break;
13089
13813
  default:
13090
13814
  let u = options.readUnknownField;
@@ -13098,25 +13822,24 @@ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13098
13822
  return message;
13099
13823
  }
13100
13824
  internalBinaryWrite(message, writer, options) {
13101
- if (message.token !== "")
13102
- writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
13825
+ if (message.bot)
13826
+ User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13103
13827
  let u = options.writeUnknownFields;
13104
13828
  if (u !== false)
13105
13829
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13106
13830
  return writer;
13107
13831
  }
13108
13832
  }
13109
- var RevealBotTokenResult = new RevealBotTokenResult$Type;
13833
+ var ClearBotAvatarResult = new ClearBotAvatarResult$Type;
13110
13834
 
13111
- class RotateBotTokenInput$Type extends import_runtime4.MessageType {
13835
+ class GetBotPresenceInput$Type extends import_runtime4.MessageType {
13112
13836
  constructor() {
13113
- super("RotateBotTokenInput", [
13114
- { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13837
+ super("GetBotPresenceInput", [
13838
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
13115
13839
  ]);
13116
13840
  }
13117
13841
  create(value) {
13118
13842
  const message = globalThis.Object.create(this.messagePrototype);
13119
- message.botUserId = 0n;
13120
13843
  if (value !== undefined)
13121
13844
  import_runtime3.reflectionMergePartial(this, message, value);
13122
13845
  return message;
@@ -13127,7 +13850,7 @@ class RotateBotTokenInput$Type extends import_runtime4.MessageType {
13127
13850
  let [fieldNo, wireType] = reader.tag();
13128
13851
  switch (fieldNo) {
13129
13852
  case 1:
13130
- message.botUserId = reader.int64().toBigInt();
13853
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
13131
13854
  break;
13132
13855
  default:
13133
13856
  let u = options.readUnknownField;
@@ -13141,25 +13864,27 @@ class RotateBotTokenInput$Type extends import_runtime4.MessageType {
13141
13864
  return message;
13142
13865
  }
13143
13866
  internalBinaryWrite(message, writer, options) {
13144
- if (message.botUserId !== 0n)
13145
- writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13867
+ if (message.peerId)
13868
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13146
13869
  let u = options.writeUnknownFields;
13147
13870
  if (u !== false)
13148
13871
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13149
13872
  return writer;
13150
13873
  }
13151
13874
  }
13152
- var RotateBotTokenInput = new RotateBotTokenInput$Type;
13875
+ var GetBotPresenceInput = new GetBotPresenceInput$Type;
13153
13876
 
13154
- class RotateBotTokenResult$Type extends import_runtime4.MessageType {
13877
+ class GetBotPresenceResult$Type extends import_runtime4.MessageType {
13155
13878
  constructor() {
13156
- super("RotateBotTokenResult", [
13157
- { no: 1, name: "token", kind: "scalar", T: 9 }
13879
+ super("GetBotPresenceResult", [
13880
+ { no: 1, name: "bot_user_id", kind: "scalar", opt: true, T: 3, L: 0 },
13881
+ { no: 2, name: "avatar", kind: "message", T: () => BotAvatar },
13882
+ { no: 3, name: "state", kind: "message", T: () => BotPresenceState },
13883
+ { no: 4, name: "peer_id", kind: "message", T: () => Peer }
13158
13884
  ]);
13159
13885
  }
13160
13886
  create(value) {
13161
13887
  const message = globalThis.Object.create(this.messagePrototype);
13162
- message.token = "";
13163
13888
  if (value !== undefined)
13164
13889
  import_runtime3.reflectionMergePartial(this, message, value);
13165
13890
  return message;
@@ -13170,7 +13895,16 @@ class RotateBotTokenResult$Type extends import_runtime4.MessageType {
13170
13895
  let [fieldNo, wireType] = reader.tag();
13171
13896
  switch (fieldNo) {
13172
13897
  case 1:
13173
- message.token = reader.string();
13898
+ message.botUserId = reader.int64().toBigInt();
13899
+ break;
13900
+ case 2:
13901
+ message.avatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.avatar);
13902
+ break;
13903
+ case 3:
13904
+ message.state = BotPresenceState.internalBinaryRead(reader, reader.uint32(), options, message.state);
13905
+ break;
13906
+ case 4:
13907
+ message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
13174
13908
  break;
13175
13909
  default:
13176
13910
  let u = options.readUnknownField;
@@ -13184,27 +13918,31 @@ class RotateBotTokenResult$Type extends import_runtime4.MessageType {
13184
13918
  return message;
13185
13919
  }
13186
13920
  internalBinaryWrite(message, writer, options) {
13187
- if (message.token !== "")
13188
- writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
13921
+ if (message.botUserId !== undefined)
13922
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13923
+ if (message.avatar)
13924
+ BotAvatar.internalBinaryWrite(message.avatar, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13925
+ if (message.state)
13926
+ BotPresenceState.internalBinaryWrite(message.state, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
13927
+ if (message.peerId)
13928
+ Peer.internalBinaryWrite(message.peerId, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
13189
13929
  let u = options.writeUnknownFields;
13190
13930
  if (u !== false)
13191
13931
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13192
13932
  return writer;
13193
13933
  }
13194
13934
  }
13195
- var RotateBotTokenResult = new RotateBotTokenResult$Type;
13935
+ var GetBotPresenceResult = new GetBotPresenceResult$Type;
13196
13936
 
13197
- class UpdateBotProfileInput$Type extends import_runtime4.MessageType {
13937
+ class SetBotPresenceStateInput$Type extends import_runtime4.MessageType {
13198
13938
  constructor() {
13199
- super("UpdateBotProfileInput", [
13200
- { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
13201
- { no: 2, name: "name", kind: "scalar", opt: true, T: 9 },
13202
- { no: 3, name: "photo_file_unique_id", kind: "scalar", opt: true, T: 9 }
13939
+ super("SetBotPresenceStateInput", [
13940
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
13941
+ { no: 2, name: "state", kind: "message", T: () => BotPresenceState }
13203
13942
  ]);
13204
13943
  }
13205
13944
  create(value) {
13206
13945
  const message = globalThis.Object.create(this.messagePrototype);
13207
- message.botUserId = 0n;
13208
13946
  if (value !== undefined)
13209
13947
  import_runtime3.reflectionMergePartial(this, message, value);
13210
13948
  return message;
@@ -13215,13 +13953,10 @@ class UpdateBotProfileInput$Type extends import_runtime4.MessageType {
13215
13953
  let [fieldNo, wireType] = reader.tag();
13216
13954
  switch (fieldNo) {
13217
13955
  case 1:
13218
- message.botUserId = reader.int64().toBigInt();
13956
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
13219
13957
  break;
13220
13958
  case 2:
13221
- message.name = reader.string();
13222
- break;
13223
- case 3:
13224
- message.photoFileUniqueId = reader.string();
13959
+ message.state = BotPresenceState.internalBinaryRead(reader, reader.uint32(), options, message.state);
13225
13960
  break;
13226
13961
  default:
13227
13962
  let u = options.readUnknownField;
@@ -13235,25 +13970,21 @@ class UpdateBotProfileInput$Type extends import_runtime4.MessageType {
13235
13970
  return message;
13236
13971
  }
13237
13972
  internalBinaryWrite(message, writer, options) {
13238
- if (message.botUserId !== 0n)
13239
- writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13240
- if (message.name !== undefined)
13241
- writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.name);
13242
- if (message.photoFileUniqueId !== undefined)
13243
- writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.photoFileUniqueId);
13973
+ if (message.peerId)
13974
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13975
+ if (message.state)
13976
+ BotPresenceState.internalBinaryWrite(message.state, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13244
13977
  let u = options.writeUnknownFields;
13245
13978
  if (u !== false)
13246
13979
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13247
13980
  return writer;
13248
13981
  }
13249
13982
  }
13250
- var UpdateBotProfileInput = new UpdateBotProfileInput$Type;
13983
+ var SetBotPresenceStateInput = new SetBotPresenceStateInput$Type;
13251
13984
 
13252
- class UpdateBotProfileResult$Type extends import_runtime4.MessageType {
13985
+ class SetBotPresenceStateResult$Type extends import_runtime4.MessageType {
13253
13986
  constructor() {
13254
- super("UpdateBotProfileResult", [
13255
- { no: 1, name: "bot", kind: "message", T: () => User }
13256
- ]);
13987
+ super("SetBotPresenceStateResult", []);
13257
13988
  }
13258
13989
  create(value) {
13259
13990
  const message = globalThis.Object.create(this.messagePrototype);
@@ -13262,34 +13993,16 @@ class UpdateBotProfileResult$Type extends import_runtime4.MessageType {
13262
13993
  return message;
13263
13994
  }
13264
13995
  internalBinaryRead(reader, length, options, target) {
13265
- let message = target ?? this.create(), end = reader.pos + length;
13266
- while (reader.pos < end) {
13267
- let [fieldNo, wireType] = reader.tag();
13268
- switch (fieldNo) {
13269
- case 1:
13270
- message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
13271
- break;
13272
- default:
13273
- let u = options.readUnknownField;
13274
- if (u === "throw")
13275
- throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
13276
- let d = reader.skip(wireType);
13277
- if (u !== false)
13278
- (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
13279
- }
13280
- }
13281
- return message;
13996
+ return target ?? this.create();
13282
13997
  }
13283
13998
  internalBinaryWrite(message, writer, options) {
13284
- if (message.bot)
13285
- User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13286
13999
  let u = options.writeUnknownFields;
13287
14000
  if (u !== false)
13288
14001
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13289
14002
  return writer;
13290
14003
  }
13291
14004
  }
13292
- var UpdateBotProfileResult = new UpdateBotProfileResult$Type;
14005
+ var SetBotPresenceStateResult = new SetBotPresenceStateResult$Type;
13293
14006
 
13294
14007
  class GetUserSettingsInput$Type extends import_runtime4.MessageType {
13295
14008
  constructor() {
@@ -16429,7 +17142,9 @@ class Update$Type extends import_runtime4.MessageType {
16429
17142
  { no: 34, name: "chat_open", kind: "message", oneof: "update", T: () => UpdateChatOpen },
16430
17143
  { no: 35, name: "message_action_invoked", kind: "message", oneof: "update", T: () => UpdateMessageActionInvoked },
16431
17144
  { no: 36, name: "message_action_answered", kind: "message", oneof: "update", T: () => UpdateMessageActionAnswered },
16432
- { no: 37, name: "clear_chat_history", kind: "message", oneof: "update", T: () => UpdateClearChatHistory }
17145
+ { no: 37, name: "clear_chat_history", kind: "message", oneof: "update", T: () => UpdateClearChatHistory },
17146
+ { no: 38, name: "bot_presence", kind: "message", oneof: "update", T: () => UpdateBotPresence },
17147
+ { no: 39, name: "dialog_follow_mode", kind: "message", oneof: "update", T: () => UpdateDialogFollowMode }
16433
17148
  ]);
16434
17149
  }
16435
17150
  create(value) {
@@ -16654,6 +17369,18 @@ class Update$Type extends import_runtime4.MessageType {
16654
17369
  clearChatHistory: UpdateClearChatHistory.internalBinaryRead(reader, reader.uint32(), options, message.update.clearChatHistory)
16655
17370
  };
16656
17371
  break;
17372
+ case 38:
17373
+ message.update = {
17374
+ oneofKind: "botPresence",
17375
+ botPresence: UpdateBotPresence.internalBinaryRead(reader, reader.uint32(), options, message.update.botPresence)
17376
+ };
17377
+ break;
17378
+ case 39:
17379
+ message.update = {
17380
+ oneofKind: "dialogFollowMode",
17381
+ dialogFollowMode: UpdateDialogFollowMode.internalBinaryRead(reader, reader.uint32(), options, message.update.dialogFollowMode)
17382
+ };
17383
+ break;
16657
17384
  default:
16658
17385
  let u = options.readUnknownField;
16659
17386
  if (u === "throw")
@@ -16738,6 +17465,10 @@ class Update$Type extends import_runtime4.MessageType {
16738
17465
  UpdateMessageActionAnswered.internalBinaryWrite(message.update.messageActionAnswered, writer.tag(36, import_runtime.WireType.LengthDelimited).fork(), options).join();
16739
17466
  if (message.update.oneofKind === "clearChatHistory")
16740
17467
  UpdateClearChatHistory.internalBinaryWrite(message.update.clearChatHistory, writer.tag(37, import_runtime.WireType.LengthDelimited).fork(), options).join();
17468
+ if (message.update.oneofKind === "botPresence")
17469
+ UpdateBotPresence.internalBinaryWrite(message.update.botPresence, writer.tag(38, import_runtime.WireType.LengthDelimited).fork(), options).join();
17470
+ if (message.update.oneofKind === "dialogFollowMode")
17471
+ UpdateDialogFollowMode.internalBinaryWrite(message.update.dialogFollowMode, writer.tag(39, import_runtime.WireType.LengthDelimited).fork(), options).join();
16741
17472
  let u = options.writeUnknownFields;
16742
17473
  if (u !== false)
16743
17474
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -17598,6 +18329,54 @@ class UpdateDialogNotificationSettings$Type extends import_runtime4.MessageType
17598
18329
  }
17599
18330
  var UpdateDialogNotificationSettings = new UpdateDialogNotificationSettings$Type;
17600
18331
 
18332
+ class UpdateDialogFollowMode$Type extends import_runtime4.MessageType {
18333
+ constructor() {
18334
+ super("UpdateDialogFollowMode", [
18335
+ { no: 1, name: "peer_id", kind: "message", T: () => Peer },
18336
+ { no: 2, name: "follow_mode", kind: "enum", opt: true, T: () => ["DialogFollowMode", DialogFollowMode] }
18337
+ ]);
18338
+ }
18339
+ create(value) {
18340
+ const message = globalThis.Object.create(this.messagePrototype);
18341
+ if (value !== undefined)
18342
+ import_runtime3.reflectionMergePartial(this, message, value);
18343
+ return message;
18344
+ }
18345
+ internalBinaryRead(reader, length, options, target) {
18346
+ let message = target ?? this.create(), end = reader.pos + length;
18347
+ while (reader.pos < end) {
18348
+ let [fieldNo, wireType] = reader.tag();
18349
+ switch (fieldNo) {
18350
+ case 1:
18351
+ message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
18352
+ break;
18353
+ case 2:
18354
+ message.followMode = reader.int32();
18355
+ break;
18356
+ default:
18357
+ let u = options.readUnknownField;
18358
+ if (u === "throw")
18359
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
18360
+ let d = reader.skip(wireType);
18361
+ if (u !== false)
18362
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
18363
+ }
18364
+ }
18365
+ return message;
18366
+ }
18367
+ internalBinaryWrite(message, writer, options) {
18368
+ if (message.peerId)
18369
+ Peer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
18370
+ if (message.followMode !== undefined)
18371
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.followMode);
18372
+ let u = options.writeUnknownFields;
18373
+ if (u !== false)
18374
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
18375
+ return writer;
18376
+ }
18377
+ }
18378
+ var UpdateDialogFollowMode = new UpdateDialogFollowMode$Type;
18379
+
17601
18380
  class UpdateNewChat$Type extends import_runtime4.MessageType {
17602
18381
  constructor() {
17603
18382
  super("UpdateNewChat", [
@@ -18123,6 +18902,74 @@ class UpdateClearChatHistory$Type extends import_runtime4.MessageType {
18123
18902
  }
18124
18903
  var UpdateClearChatHistory = new UpdateClearChatHistory$Type;
18125
18904
 
18905
+ class UpdateBotPresence$Type extends import_runtime4.MessageType {
18906
+ constructor() {
18907
+ super("UpdateBotPresence", [
18908
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
18909
+ { no: 2, name: "peer_id", kind: "message", T: () => Peer },
18910
+ { no: 3, name: "state", kind: "message", T: () => BotPresenceState },
18911
+ { no: 4, name: "avatar", kind: "message", T: () => BotAvatar },
18912
+ { no: 5, name: "avatar_changed", kind: "scalar", T: 8 }
18913
+ ]);
18914
+ }
18915
+ create(value) {
18916
+ const message = globalThis.Object.create(this.messagePrototype);
18917
+ message.botUserId = 0n;
18918
+ message.avatarChanged = false;
18919
+ if (value !== undefined)
18920
+ import_runtime3.reflectionMergePartial(this, message, value);
18921
+ return message;
18922
+ }
18923
+ internalBinaryRead(reader, length, options, target) {
18924
+ let message = target ?? this.create(), end = reader.pos + length;
18925
+ while (reader.pos < end) {
18926
+ let [fieldNo, wireType] = reader.tag();
18927
+ switch (fieldNo) {
18928
+ case 1:
18929
+ message.botUserId = reader.int64().toBigInt();
18930
+ break;
18931
+ case 2:
18932
+ message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
18933
+ break;
18934
+ case 3:
18935
+ message.state = BotPresenceState.internalBinaryRead(reader, reader.uint32(), options, message.state);
18936
+ break;
18937
+ case 4:
18938
+ message.avatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.avatar);
18939
+ break;
18940
+ case 5:
18941
+ message.avatarChanged = reader.bool();
18942
+ break;
18943
+ default:
18944
+ let u = options.readUnknownField;
18945
+ if (u === "throw")
18946
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
18947
+ let d = reader.skip(wireType);
18948
+ if (u !== false)
18949
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
18950
+ }
18951
+ }
18952
+ return message;
18953
+ }
18954
+ internalBinaryWrite(message, writer, options) {
18955
+ if (message.botUserId !== 0n)
18956
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
18957
+ if (message.peerId)
18958
+ Peer.internalBinaryWrite(message.peerId, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
18959
+ if (message.state)
18960
+ BotPresenceState.internalBinaryWrite(message.state, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
18961
+ if (message.avatar)
18962
+ BotAvatar.internalBinaryWrite(message.avatar, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
18963
+ if (message.avatarChanged !== false)
18964
+ writer.tag(5, import_runtime.WireType.Varint).bool(message.avatarChanged);
18965
+ let u = options.writeUnknownFields;
18966
+ if (u !== false)
18967
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
18968
+ return writer;
18969
+ }
18970
+ }
18971
+ var UpdateBotPresence = new UpdateBotPresence$Type;
18972
+
18126
18973
  class UpdateMessageId$Type extends import_runtime4.MessageType {
18127
18974
  constructor() {
18128
18975
  super("UpdateMessageId", [
@@ -37517,6 +38364,80 @@ async function uploadInlineMediaFromUrl(params) {
37517
38364
  }
37518
38365
  }
37519
38366
 
38367
+ // src/inline/message-formatting.ts
38368
+ var INLINE_FORMATTING_RULES = [
38369
+ "Use Inline markdown.",
38370
+ "Prefer bullet lists over markdown tables.",
38371
+ "If a table is necessary, render it inside a fenced code block.",
38372
+ "Use plain URLs or markdown links; do not wrap bare URLs in inline code or backticks.",
38373
+ "Mention Inline users with markdown links like [@FirstName](inline://user?id=123); use inline://user?username=username only when the user id is unavailable.",
38374
+ "Link Inline chats/threads with markdown links like [Planning](inline://chat?id=123) or [Planning](inline://thread?id=123); use inline://thread?space_id=7 when only the title and space are known.",
38375
+ "Use inline code only for actual code, commands, file paths, env vars, or identifiers."
38376
+ ];
38377
+ var INLINE_COPY_REPLACEMENTS = [
38378
+ [
38379
+ /Bind this (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) to a session target\.?/gi,
38380
+ "Bind this Inline conversation to a session target."
38381
+ ],
38382
+ [
38383
+ /Remove the current (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) binding\.?/gi,
38384
+ "Remove the current Inline conversation binding."
38385
+ ]
38386
+ ];
38387
+ function normalizeInlineMarkdownLabel(raw, fallback) {
38388
+ return (raw ?? "").replace(/\s+/g, " ").trim() || fallback;
38389
+ }
38390
+ function escapeInlineMarkdownLabel(raw) {
38391
+ return raw.replace(/\\/g, "\\\\").replace(/\[/g, "\\[").replace(/\]/g, "\\]");
38392
+ }
38393
+ function encodeInlineMarkdownValue(raw) {
38394
+ return encodeURIComponent(String(raw).trim());
38395
+ }
38396
+ function isBareHttpUrl(text) {
38397
+ if (!/^https?:\/\/\S+$/i.test(text))
38398
+ return false;
38399
+ try {
38400
+ const url2 = new URL(text);
38401
+ return url2.protocol === "http:" || url2.protocol === "https:";
38402
+ } catch {
38403
+ return false;
38404
+ }
38405
+ }
38406
+ function adaptInlineVisibleCopy(text) {
38407
+ let result = text;
38408
+ for (const [from, to] of INLINE_COPY_REPLACEMENTS) {
38409
+ result = result.replace(from, to);
38410
+ }
38411
+ return result;
38412
+ }
38413
+ function buildInlineSystemPrompt(extraPrompt) {
38414
+ return extraPrompt?.trim() || "";
38415
+ }
38416
+ function buildInlineInboundFormattingHints() {
38417
+ return {
38418
+ text_markup: "inline_markdown",
38419
+ rules: [...INLINE_FORMATTING_RULES]
38420
+ };
38421
+ }
38422
+ function buildInlineThreadMarkdownLink(params) {
38423
+ const title = normalizeInlineMarkdownLabel(params.title, `thread:${String(params.threadId)}`);
38424
+ return `[${escapeInlineMarkdownLabel(title)}](inline://thread?id=${encodeInlineMarkdownValue(params.threadId)})`;
38425
+ }
38426
+ function buildInlineThreadTitleMarkdownLink(params) {
38427
+ const title = normalizeInlineMarkdownLabel(params.title, `space:${String(params.spaceId)}`);
38428
+ const label = normalizeInlineMarkdownLabel(params.label, title);
38429
+ const query = [`space_id=${encodeInlineMarkdownValue(params.spaceId)}`];
38430
+ if (label !== title) {
38431
+ query.push(`title=${encodeInlineMarkdownValue(title)}`);
38432
+ }
38433
+ return `[${escapeInlineMarkdownLabel(label)}](inline://thread?${query.join("&")})`;
38434
+ }
38435
+ function sanitizeInlineOutgoingText(text) {
38436
+ return adaptInlineVisibleCopy(text).replace(/`([^`\n]+)`/g, (full, content) => {
38437
+ return isBareHttpUrl(content) ? content : full;
38438
+ });
38439
+ }
38440
+
37520
38441
  // src/inline/message-content.ts
37521
38442
  var INLINE_MESSAGE_ENTITY_TYPE = {
37522
38443
  MENTION: 1,
@@ -37528,7 +38449,9 @@ var INLINE_MESSAGE_ENTITY_TYPE = {
37528
38449
  USERNAME_MENTION: 7,
37529
38450
  CODE: 8,
37530
38451
  PRE: 9,
37531
- PHONE_NUMBER: 10
38452
+ PHONE_NUMBER: 10,
38453
+ THREAD: 11,
38454
+ THREAD_TITLE: 12
37532
38455
  };
37533
38456
  function compactWhitespace(raw) {
37534
38457
  return (raw ?? "").replace(/\s+/g, " ").trim();
@@ -37696,6 +38619,10 @@ function mapEntityType(type) {
37696
38619
  return "pre";
37697
38620
  case INLINE_MESSAGE_ENTITY_TYPE.PHONE_NUMBER:
37698
38621
  return "phone_number";
38622
+ case INLINE_MESSAGE_ENTITY_TYPE.THREAD:
38623
+ return "thread";
38624
+ case INLINE_MESSAGE_ENTITY_TYPE.THREAD_TITLE:
38625
+ return "thread_title";
37699
38626
  default:
37700
38627
  return "unknown";
37701
38628
  }
@@ -37737,6 +38664,26 @@ function messageEntitySummaries(message) {
37737
38664
  const language = compactWhitespace(entity.entity.pre.language);
37738
38665
  if (language)
37739
38666
  summary.language = language;
38667
+ } else if (entity.entity.oneofKind === "thread") {
38668
+ const chatId = entity.entity.thread.chatId.toString();
38669
+ summary.chatId = chatId;
38670
+ summary.markdownLink = buildInlineThreadMarkdownLink({
38671
+ threadId: chatId,
38672
+ ...summary.text ? { title: summary.text } : {}
38673
+ });
38674
+ } else if (entity.entity.oneofKind === "threadTitle") {
38675
+ const spaceId = entity.entity.threadTitle.spaceId.toString();
38676
+ const title = compactWhitespace(entity.entity.threadTitle.title);
38677
+ summary.spaceId = spaceId;
38678
+ if (title)
38679
+ summary.title = title;
38680
+ if (title || summary.text) {
38681
+ summary.markdownLink = buildInlineThreadTitleMarkdownLink({
38682
+ spaceId,
38683
+ title: title || summary.text || `space:${spaceId}`,
38684
+ label: summary.text || title
38685
+ });
38686
+ }
37740
38687
  }
37741
38688
  entities.push(summary);
37742
38689
  }
@@ -37789,6 +38736,13 @@ function formatEntitySummary(entity) {
37789
38736
  return entity.userId ? `mention${quotedText} -> user:${entity.userId}` : `mention${quotedText}`;
37790
38737
  case "text_link":
37791
38738
  return entity.url ? `text link${quotedText} -> ${entity.url}` : `text link${quotedText}`;
38739
+ case "thread":
38740
+ return entity.chatId ? `thread link${quotedText} -> thread:${entity.chatId}` : `thread link${quotedText}`;
38741
+ case "thread_title":
38742
+ if (entity.spaceId && entity.title) {
38743
+ return `thread title link${quotedText} -> space:${entity.spaceId} title:"${entity.title}"`;
38744
+ }
38745
+ return entity.spaceId ? `thread title link${quotedText} -> space:${entity.spaceId}` : `thread title link${quotedText}`;
37792
38746
  case "pre":
37793
38747
  return entity.language ? `preformatted block${quotedText} (language: ${entity.language})` : `preformatted block${quotedText}`;
37794
38748
  case "username_mention":
@@ -37833,57 +38787,6 @@ function summarizeInlineMessageContent(message) {
37833
38787
  };
37834
38788
  }
37835
38789
 
37836
- // src/inline/message-formatting.ts
37837
- var INLINE_FORMATTING_RULES = [
37838
- "Use Inline markdown.",
37839
- "Prefer bullet lists over markdown tables.",
37840
- "If a table is necessary, render it inside a fenced code block.",
37841
- "Use plain URLs or markdown links; do not wrap bare URLs in inline code or backticks.",
37842
- "Mention Inline users with markdown links like [@FirstName](inline://user?id=123); use inline://user?username=username only when the user id is unavailable.",
37843
- "Use inline code only for actual code, commands, file paths, env vars, or identifiers."
37844
- ];
37845
- var INLINE_COPY_REPLACEMENTS = [
37846
- [
37847
- /Bind this (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) to a session target\.?/gi,
37848
- "Bind this Inline conversation to a session target."
37849
- ],
37850
- [
37851
- /Remove the current (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) binding\.?/gi,
37852
- "Remove the current Inline conversation binding."
37853
- ]
37854
- ];
37855
- function isBareHttpUrl(text) {
37856
- if (!/^https?:\/\/\S+$/i.test(text))
37857
- return false;
37858
- try {
37859
- const url2 = new URL(text);
37860
- return url2.protocol === "http:" || url2.protocol === "https:";
37861
- } catch {
37862
- return false;
37863
- }
37864
- }
37865
- function adaptInlineVisibleCopy(text) {
37866
- let result = text;
37867
- for (const [from, to] of INLINE_COPY_REPLACEMENTS) {
37868
- result = result.replace(from, to);
37869
- }
37870
- return result;
37871
- }
37872
- function buildInlineSystemPrompt(extraPrompt) {
37873
- return extraPrompt?.trim() || "";
37874
- }
37875
- function buildInlineInboundFormattingHints() {
37876
- return {
37877
- text_markup: "inline_markdown",
37878
- rules: [...INLINE_FORMATTING_RULES]
37879
- };
37880
- }
37881
- function sanitizeInlineOutgoingText(text) {
37882
- return adaptInlineVisibleCopy(text).replace(/`([^`\n]+)`/g, (full, content) => {
37883
- return isBareHttpUrl(content) ? content : full;
37884
- });
37885
- }
37886
-
37887
38790
  // src/inline/thread-routes.ts
37888
38791
  import path2 from "node:path";
37889
38792
  import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
@@ -38570,6 +39473,46 @@ var GET_MESSAGES_METHOD2 = typeof Method.GET_MESSAGES === "number" && Number.isI
38570
39473
  var CREATE_SUBTHREAD_METHOD2 = typeof Method.CREATE_SUBTHREAD === "number" && Number.isInteger(Method.CREATE_SUBTHREAD) && Method.CREATE_SUBTHREAD > 0 ? Method.CREATE_SUBTHREAD : 42;
38571
39474
  var INLINE_ACTION_MAX_ROWS = 8;
38572
39475
  var INLINE_ACTION_MAX_PER_ROW = 8;
39476
+ var INLINE_BOT_PRESENCE_KINDS = [
39477
+ "idle",
39478
+ "happy",
39479
+ "waving",
39480
+ "jumping",
39481
+ "failed",
39482
+ "waiting",
39483
+ "running",
39484
+ "review"
39485
+ ];
39486
+ var inlineBotPresenceChannelDataSchema = {
39487
+ type: "object",
39488
+ description: "Inline-specific metadata for a send. Use inline.botPresence for the bot's on-screen body.",
39489
+ additionalProperties: true,
39490
+ properties: {
39491
+ inline: {
39492
+ type: "object",
39493
+ additionalProperties: true,
39494
+ properties: {
39495
+ botPresence: {
39496
+ type: "object",
39497
+ description: "Optional Inline bot presence state generated from your current mood or process.",
39498
+ additionalProperties: true,
39499
+ properties: {
39500
+ kind: {
39501
+ type: "string",
39502
+ enum: INLINE_BOT_PRESENCE_KINDS,
39503
+ description: "Emotion/state for the on-screen bot presence."
39504
+ },
39505
+ comment: {
39506
+ type: "string",
39507
+ maxLength: 30,
39508
+ description: "Optional short expression from your actual current thought, status, mood, request, or aside. Text or one/two emoji."
39509
+ }
39510
+ }
39511
+ }
39512
+ }
39513
+ }
39514
+ }
39515
+ };
38573
39516
  function suppressedInternalTextResult() {
38574
39517
  return jsonResult({
38575
39518
  ok: false,
@@ -39326,14 +40269,24 @@ function describeInlineMessageTool({
39326
40269
  };
39327
40270
  }
39328
40271
  const buttonsEnabled = supportsInlineMessageButtons(actions);
40272
+ const sendEnabled = actions.includes("send");
39329
40273
  const capabilities = buttonsEnabled ? ["presentation"] : [];
39330
- const schema = buttonsEnabled ? [
39331
- {
40274
+ const schema = [];
40275
+ if (buttonsEnabled) {
40276
+ schema.push({
39332
40277
  properties: {
39333
40278
  buttons: createMessageToolButtonsSchema()
39334
40279
  }
39335
- }
39336
- ] : [];
40280
+ });
40281
+ }
40282
+ if (sendEnabled) {
40283
+ schema.push({
40284
+ actions: ["send"],
40285
+ properties: {
40286
+ channelData: inlineBotPresenceChannelDataSchema
40287
+ }
40288
+ });
40289
+ }
39337
40290
  return {
39338
40291
  actions,
39339
40292
  capabilities,
@@ -41418,7 +42371,14 @@ var INLINE_DEBOUNCE_ERROR_FALLBACK = "OpenClaw could not process those messages.
41418
42371
  var DEFAULT_REPLY_THREAD_AUTO_CREATE_MIN_MESSAGES2 = 50;
41419
42372
  var DEFAULT_REPLY_THREAD_PARENT_HISTORY_LIMIT = 10;
41420
42373
  var INLINE_PARTICIPANT_ADD_READY_MAX_EVENT_AGE_MS = 10 * 60 * 1000;
42374
+ var INLINE_BOT_PRESENCE_IDLE_DELAY_MS = 8000;
42375
+ var INLINE_BOT_PRESENCE_FINISH_IDLE_DELAY_MS = 8000;
42376
+ var INLINE_BOT_PRESENCE_GESTURE_MS = 1400;
42377
+ var INLINE_BOT_PRESENCE_FAILED_MS = 8000;
42378
+ var INLINE_BOT_PRESENCE_COMMENT_MAX_LENGTH = 30;
41421
42379
  var INLINE_REPLY_THREAD_SYSTEM_PROMPT = "Inline reply threads are scoped conversations: answer only the current reply-thread message and this thread's own history; use parent-chat context only as background, and do not answer unrelated questions from the parent chat or other reply threads.";
42380
+ var INLINE_REPLY_THREAD_NEGATION_RE = /\b(?:do\s+not|don't|dont|please\s+don't|please\s+dont|no\s+need\s+to)\s+(?:create|start|open|make|use|move|take|reply|respond|answer|send|thread)\b[^.!?\n]*\bthread\b|\b(?:reply|respond|answer|keep)\s+(?:here|in\s+the\s+main\s+chat|in\s+main\s+chat|in\s+the\s+parent\s+chat|in\s+parent\s+chat)\b/u;
42381
+ var INLINE_REPLY_THREAD_INTENT_RE = /\b(?:reply|respond|answer|send)\s+(?:in|inside|into|to)\s+(?:a\s+)?(?:(?:new|child|reply)\s+)?thread\b|\b(?:create|start|open|make|use)\s+(?:a\s+)?(?:(?:new|child|reply)\s+)?thread\b|\b(?:move|take)\s+(?:(?:this|it|the\s+answer|the\s+reply|the\s+response)\s+)?(?:to|into)\s+(?:a\s+)?(?:(?:new|child|reply)\s+)?thread\b|\bthread\s+(?:this|the\s+answer|the\s+reply|the\s+response)\b|\b(?:threaded\s+(?:reply|response)|(?:reply|respond|answer)\s+threaded)\b/u;
41422
42382
  function buildInlineTypingDispatcherOptions(typingCallbacks) {
41423
42383
  if (!typingCallbacks) {
41424
42384
  return {};
@@ -41464,6 +42424,266 @@ async function sendInlineTypingToChats(params) {
41464
42424
  params.onPartialError?.(failure.chatId, failure.error);
41465
42425
  }
41466
42426
  }
42427
+ function inlineBotPresenceStateKind(kind) {
42428
+ switch (kind) {
42429
+ case "idle":
42430
+ return BotPresenceState_Kind.IDLE;
42431
+ case "happy":
42432
+ return BotPresenceState_Kind.HAPPY;
42433
+ case "waving":
42434
+ return BotPresenceState_Kind.WAVING;
42435
+ case "jumping":
42436
+ return BotPresenceState_Kind.JUMPING;
42437
+ case "failed":
42438
+ return BotPresenceState_Kind.FAILED;
42439
+ case "waiting":
42440
+ return BotPresenceState_Kind.WAITING;
42441
+ case "running":
42442
+ return BotPresenceState_Kind.RUNNING;
42443
+ case "review":
42444
+ return BotPresenceState_Kind.REVIEW;
42445
+ }
42446
+ }
42447
+ function normalizeInlineBotPresenceKind(value) {
42448
+ if (typeof value !== "string")
42449
+ return;
42450
+ switch (value.trim().toLowerCase()) {
42451
+ case "idle":
42452
+ case "happy":
42453
+ case "waving":
42454
+ case "jumping":
42455
+ case "failed":
42456
+ case "waiting":
42457
+ case "running":
42458
+ case "review":
42459
+ return value.trim().toLowerCase();
42460
+ default:
42461
+ return;
42462
+ }
42463
+ }
42464
+ function normalizeInlineBotPresenceComment(value) {
42465
+ if (typeof value !== "string")
42466
+ return;
42467
+ const text = value.replace(/\s+/g, " ").trim();
42468
+ if (!text)
42469
+ return;
42470
+ return Array.from(text).slice(0, INLINE_BOT_PRESENCE_COMMENT_MAX_LENGTH).join("");
42471
+ }
42472
+ function resolveInlineBotPresenceSignal(payload) {
42473
+ const channelData = isRecord6(payload.channelData) ? payload.channelData : undefined;
42474
+ const inlineData = channelData && isRecord6(channelData.inline) ? channelData.inline : undefined;
42475
+ const rawPresence = inlineData && isRecord6(inlineData.botPresence) ? inlineData.botPresence : undefined;
42476
+ if (!rawPresence)
42477
+ return null;
42478
+ const kind = normalizeInlineBotPresenceKind(rawPresence.kind) ?? "happy";
42479
+ const comment = normalizeInlineBotPresenceComment(rawPresence.comment);
42480
+ return comment ? { kind, comment } : { kind };
42481
+ }
42482
+ async function sendInlineBotPresenceToChats(params) {
42483
+ if (params.chatIds.length === 0)
42484
+ return;
42485
+ const failures = [];
42486
+ await Promise.all(params.chatIds.map(async (chatId) => {
42487
+ try {
42488
+ await params.client.invokeRaw(Method.SET_BOT_PRESENCE_STATE, {
42489
+ oneofKind: "setBotPresenceState",
42490
+ setBotPresenceState: {
42491
+ peerId: {
42492
+ type: {
42493
+ oneofKind: "chat",
42494
+ chat: { chatId }
42495
+ }
42496
+ },
42497
+ state: {
42498
+ kind: inlineBotPresenceStateKind(params.kind),
42499
+ ...params.comment ? { comment: params.comment } : {}
42500
+ }
42501
+ }
42502
+ });
42503
+ } catch (error51) {
42504
+ failures.push({ chatId, error: error51 });
42505
+ }
42506
+ }));
42507
+ if (failures.length === 0)
42508
+ return;
42509
+ if (failures.length === params.chatIds.length) {
42510
+ throw failures[0]?.error ?? new Error("inline bot presence failed");
42511
+ }
42512
+ for (const failure of failures) {
42513
+ params.onPartialError?.(failure.chatId, failure.error);
42514
+ }
42515
+ }
42516
+ async function sendInlineTypingAndBotPresenceToChats(params) {
42517
+ let typingError = null;
42518
+ await Promise.all([
42519
+ sendInlineTypingToChats({
42520
+ client: params.client,
42521
+ chatIds: params.chatIds,
42522
+ typing: params.typing,
42523
+ ...params.onTypingPartialError ? { onPartialError: params.onTypingPartialError } : {}
42524
+ }).catch((error51) => {
42525
+ typingError = error51;
42526
+ }),
42527
+ sendInlineBotPresenceToChats({
42528
+ client: params.client,
42529
+ chatIds: params.chatIds,
42530
+ kind: params.presenceKind,
42531
+ ...params.onPresencePartialError ? { onPartialError: params.onPresencePartialError } : {}
42532
+ }).catch((error51) => {
42533
+ params.onPresenceError?.(error51);
42534
+ })
42535
+ ]);
42536
+ if (typingError != null) {
42537
+ throw typingError;
42538
+ }
42539
+ }
42540
+ function createInlineBotPresenceLifecycle(params) {
42541
+ let active = false;
42542
+ let finishing = false;
42543
+ let idleTimer;
42544
+ let gestureTimer;
42545
+ let currentKind;
42546
+ let currentComment;
42547
+ let busyKind = "running";
42548
+ let busyComment;
42549
+ let sendChain = Promise.resolve();
42550
+ const clearIdleTimer = () => {
42551
+ if (!idleTimer)
42552
+ return;
42553
+ clearTimeout(idleTimer);
42554
+ idleTimer = undefined;
42555
+ };
42556
+ const clearGestureTimer = () => {
42557
+ if (!gestureTimer)
42558
+ return;
42559
+ clearTimeout(gestureTimer);
42560
+ gestureTimer = undefined;
42561
+ };
42562
+ const send = (kind, comment) => {
42563
+ if (currentKind === kind && currentComment === comment)
42564
+ return Promise.resolve();
42565
+ currentKind = kind;
42566
+ currentComment = comment;
42567
+ sendChain = sendChain.catch(() => {}).then(() => sendInlineBotPresenceToChats({
42568
+ client: params.client,
42569
+ chatIds: params.chatIds,
42570
+ kind,
42571
+ ...comment ? { comment } : {},
42572
+ onPartialError: params.onPartialError
42573
+ }).catch(params.onError));
42574
+ return sendChain;
42575
+ };
42576
+ const scheduleIdle = (delayMs = INLINE_BOT_PRESENCE_IDLE_DELAY_MS) => {
42577
+ clearIdleTimer();
42578
+ idleTimer = setTimeout(() => {
42579
+ idleTimer = undefined;
42580
+ active = false;
42581
+ finishing = false;
42582
+ busyKind = "running";
42583
+ busyComment = undefined;
42584
+ send("idle");
42585
+ }, delayMs);
42586
+ idleTimer.unref?.();
42587
+ };
42588
+ const showBusy = async (kind, comment) => {
42589
+ if (!active || finishing)
42590
+ return;
42591
+ clearIdleTimer();
42592
+ clearGestureTimer();
42593
+ busyKind = kind;
42594
+ busyComment = comment;
42595
+ await send(kind, comment);
42596
+ };
42597
+ const gesture = (kind, resumeKind = busyKind, comment, resumeComment = busyComment) => {
42598
+ if (params.chatIds.length === 0)
42599
+ return;
42600
+ clearIdleTimer();
42601
+ clearGestureTimer();
42602
+ active = true;
42603
+ send(kind, comment);
42604
+ gestureTimer = setTimeout(() => {
42605
+ gestureTimer = undefined;
42606
+ if (!active || finishing)
42607
+ return;
42608
+ send(resumeKind, resumeComment);
42609
+ }, INLINE_BOT_PRESENCE_GESTURE_MS);
42610
+ gestureTimer.unref?.();
42611
+ };
42612
+ return {
42613
+ start: async (cue) => {
42614
+ if (params.chatIds.length === 0)
42615
+ return;
42616
+ clearIdleTimer();
42617
+ if (active && !finishing)
42618
+ return;
42619
+ active = true;
42620
+ finishing = false;
42621
+ const cueKind = cue?.kind;
42622
+ busyKind = cueKind === "review" ? "review" : "running";
42623
+ busyComment = undefined;
42624
+ if (cueKind === "waving") {
42625
+ gesture("waving", busyKind);
42626
+ return;
42627
+ }
42628
+ await send(busyKind, busyComment);
42629
+ },
42630
+ busy: (kind, comment) => {
42631
+ showBusy(kind, comment);
42632
+ },
42633
+ gesture: (kind, comment) => {
42634
+ gesture(kind, busyKind, comment);
42635
+ },
42636
+ express: (signal) => {
42637
+ if (signal.kind === "failed") {
42638
+ if (params.chatIds.length === 0)
42639
+ return;
42640
+ clearIdleTimer();
42641
+ clearGestureTimer();
42642
+ active = true;
42643
+ finishing = true;
42644
+ send("failed", signal.comment).finally(() => scheduleIdle(INLINE_BOT_PRESENCE_FAILED_MS));
42645
+ return;
42646
+ }
42647
+ if (params.chatIds.length === 0)
42648
+ return;
42649
+ clearIdleTimer();
42650
+ clearGestureTimer();
42651
+ active = true;
42652
+ finishing = true;
42653
+ send(signal.kind, signal.comment).finally(() => scheduleIdle());
42654
+ },
42655
+ finish: () => {
42656
+ if (!active || finishing)
42657
+ return;
42658
+ finishing = true;
42659
+ clearGestureTimer();
42660
+ scheduleIdle(INLINE_BOT_PRESENCE_FINISH_IDLE_DELAY_MS);
42661
+ },
42662
+ fail: (comment) => {
42663
+ if (params.chatIds.length === 0)
42664
+ return;
42665
+ clearIdleTimer();
42666
+ clearGestureTimer();
42667
+ active = true;
42668
+ finishing = true;
42669
+ send("failed", comment).finally(() => scheduleIdle(INLINE_BOT_PRESENCE_FAILED_MS));
42670
+ },
42671
+ cleanup: () => {
42672
+ if (!active)
42673
+ return;
42674
+ if (finishing)
42675
+ return;
42676
+ clearIdleTimer();
42677
+ clearGestureTimer();
42678
+ active = false;
42679
+ send("idle").finally(() => {
42680
+ finishing = false;
42681
+ busyKind = "running";
42682
+ busyComment = undefined;
42683
+ });
42684
+ }
42685
+ };
42686
+ }
41467
42687
  function buildInlineReplyThreadSessionKey(parentSessionKey, threadChatId) {
41468
42688
  const suffix = `:thread:${String(threadChatId)}`;
41469
42689
  return parentSessionKey.endsWith(suffix) ? parentSessionKey : `${parentSessionKey}${suffix}`;
@@ -42283,6 +43503,24 @@ function resolveInlineSystemPrompt(params) {
42283
43503
 
42284
43504
  `);
42285
43505
  }
43506
+ function hasExplicitInlineReplyThreadIntent(raw) {
43507
+ const text = normalizeLowercaseStringOrEmpty2(raw).replace(/\s+/g, " ").trim();
43508
+ if (!text)
43509
+ return false;
43510
+ if (INLINE_REPLY_THREAD_NEGATION_RE.test(text))
43511
+ return false;
43512
+ return INLINE_REPLY_THREAD_INTENT_RE.test(text);
43513
+ }
43514
+ function shouldCreateInlineReplyThreadDelivery(params) {
43515
+ if (params.mode === "main")
43516
+ return false;
43517
+ if (params.explicitThreadIntent)
43518
+ return true;
43519
+ return params.mode === "thread" && shouldAutoCreateInlineReplyThread({
43520
+ messageId: params.messageId,
43521
+ minMessages: params.minMessages
43522
+ });
43523
+ }
42286
43524
  function rewriteNumericMentionsToUsernames(text, senderProfilesById) {
42287
43525
  if (!text.includes("@"))
42288
43526
  return text;
@@ -42500,7 +43738,7 @@ function resolveHistoryLimit(params) {
42500
43738
  }
42501
43739
  function historyEntryDedupeKey(entry) {
42502
43740
  if (entry.messageId)
42503
- return `id:${entry.messageId}`;
43741
+ return `id:${entry.messageId}:ts:${entry.timestamp ?? "unknown"}`;
42504
43742
  return `ts:${entry.timestamp ?? "unknown"}:${entry.sender}:${entry.body}`;
42505
43743
  }
42506
43744
  function mergeInboundHistoryEntries(params) {
@@ -44025,7 +45263,10 @@ This model will be used for your next message.`, []);
44025
45263
  return;
44026
45264
  }
44027
45265
  let deliveryReplyThreadContext = replyThreadContext;
44028
- const shouldCreateDeliveryThread = isGroup && replyThreadsEnabled && replyThreadMode === "thread" && !deliveryReplyThreadContext && shouldAutoCreateInlineReplyThread({
45266
+ const explicitReplyThreadIntent = isGroup && replyThreadsEnabled && !deliveryReplyThreadContext && hasExplicitInlineReplyThreadIntent(rawBody);
45267
+ const shouldCreateDeliveryThread = isGroup && replyThreadsEnabled && !deliveryReplyThreadContext && shouldCreateInlineReplyThreadDelivery({
45268
+ mode: replyThreadMode,
45269
+ explicitThreadIntent: explicitReplyThreadIntent,
44029
45270
  messageId: msg.id,
44030
45271
  minMessages: replyThreadAutoCreateMinMessages
44031
45272
  }) && !shouldEditCallbackTargetInPlace;
@@ -44034,7 +45275,15 @@ This model will be used for your next message.`, []);
44034
45275
  if (!shouldCreateDeliveryThread || parentThreadCreationTyping === typing)
44035
45276
  return;
44036
45277
  parentThreadCreationTyping = typing;
44037
- await client.sendTyping({ chatId: effectiveChatId, typing }).catch((error51) => runtime.error?.(`inline parent reply-thread typing failed: ${String(error51)}`));
45278
+ await sendInlineTypingAndBotPresenceToChats({
45279
+ client,
45280
+ chatIds: [effectiveChatId],
45281
+ typing,
45282
+ presenceKind: typing ? "running" : "idle",
45283
+ onTypingPartialError: (chatId2, error51) => runtime.error?.(`inline parent reply-thread typing failed for chat ${String(chatId2)}: ${String(error51)}`),
45284
+ onPresencePartialError: (chatId2, error51) => runtime.error?.(`inline parent reply-thread bot presence failed for chat ${String(chatId2)}: ${String(error51)}`),
45285
+ onPresenceError: (error51) => runtime.error?.(`inline parent reply-thread bot presence failed: ${String(error51)}`)
45286
+ }).catch((error51) => runtime.error?.(`inline parent reply-thread typing failed: ${String(error51)}`));
44038
45287
  };
44039
45288
  if (shouldCreateDeliveryThread) {
44040
45289
  await setParentThreadCreationTyping(true);
@@ -44303,7 +45552,33 @@ This model will be used for your next message.`, []);
44303
45552
  }
44304
45553
  });
44305
45554
  const onModelSelected = replyPipeline.onModelSelected;
44306
- const typingCallbacks = replyPipeline.typingCallbacks;
45555
+ const rawTypingCallbacks = replyPipeline.typingCallbacks;
45556
+ const botPresenceLifecycle = createInlineBotPresenceLifecycle({
45557
+ client,
45558
+ chatIds: typingChatIds,
45559
+ onPartialError: (chatId2, error51) => runtime.error?.(`inline bot presence failed for chat ${String(chatId2)}: ${String(error51)}`),
45560
+ onError: (error51) => runtime.error?.(`inline bot presence failed: ${String(error51)}`)
45561
+ });
45562
+ const typingCallbacks = rawTypingCallbacks ? {
45563
+ onReplyStart: async () => {
45564
+ await Promise.all([
45565
+ rawTypingCallbacks.onReplyStart(),
45566
+ botPresenceLifecycle.start()
45567
+ ]);
45568
+ },
45569
+ ...rawTypingCallbacks.onIdle ? {
45570
+ onIdle: () => {
45571
+ rawTypingCallbacks.onIdle?.();
45572
+ botPresenceLifecycle.finish();
45573
+ }
45574
+ } : {},
45575
+ ...rawTypingCallbacks.onCleanup ? {
45576
+ onCleanup: () => {
45577
+ rawTypingCallbacks.onCleanup?.();
45578
+ botPresenceLifecycle.cleanup();
45579
+ }
45580
+ } : {}
45581
+ } : undefined;
44307
45582
  const dispatcherPipelineOptions = {
44308
45583
  ...replyPipeline.responsePrefix !== undefined ? { responsePrefix: replyPipeline.responsePrefix } : {},
44309
45584
  ...replyPipeline.responsePrefixContextProvider ? {
@@ -44541,24 +45816,44 @@ This model will be used for your next message.`, []);
44541
45816
  } : {},
44542
45817
  ...progressPlaceholderEnabled ? {
44543
45818
  onReasoningStream: async () => {
45819
+ botPresenceLifecycle.busy("review");
44544
45820
  await pushInlineProgressPlaceholder();
44545
45821
  }
44546
45822
  } : {},
44547
- ...streamViaEditMessage || progressPlaceholderEnabled ? {
44548
- onToolStart: async (payload) => {
44549
- await resetEditStreamOnBoundary();
44550
- const toolName = payload.name?.trim();
44551
- await pushInlineProgressPlaceholder(buildInlineProgressLineForEntry({
44552
- event: "tool",
44553
- ...toolName ? { name: toolName } : {},
44554
- ...payload.phase !== undefined ? { phase: payload.phase } : {},
44555
- ...payload.args !== undefined ? { args: payload.args } : {}
44556
- }, payload.detailMode ? { detailMode: payload.detailMode } : undefined), {
44557
- ...toolName ? { toolName } : {},
44558
- startImmediately: true
44559
- });
45823
+ onToolStart: async (payload) => {
45824
+ const toolName = payload.name?.trim();
45825
+ if (toolName === "inline_bot_presence") {
45826
+ return;
44560
45827
  }
44561
- } : {},
45828
+ botPresenceLifecycle.busy("running");
45829
+ if (!(streamViaEditMessage || progressPlaceholderEnabled))
45830
+ return;
45831
+ await resetEditStreamOnBoundary();
45832
+ await pushInlineProgressPlaceholder(buildInlineProgressLineForEntry({
45833
+ event: "tool",
45834
+ ...toolName ? { name: toolName } : {},
45835
+ ...payload.phase !== undefined ? { phase: payload.phase } : {},
45836
+ ...payload.args !== undefined ? { args: payload.args } : {}
45837
+ }, payload.detailMode ? { detailMode: payload.detailMode } : undefined), {
45838
+ ...toolName ? { toolName } : {},
45839
+ startImmediately: true
45840
+ });
45841
+ },
45842
+ onApprovalEvent: async (payload) => {
45843
+ if (payload.phase !== "requested")
45844
+ return;
45845
+ botPresenceLifecycle.busy("waiting");
45846
+ if (!progressPlaceholderEnabled)
45847
+ return;
45848
+ await pushInlineProgressPlaceholder(buildChannelProgressDraftLine({
45849
+ event: "approval",
45850
+ ...payload.phase !== undefined ? { phase: payload.phase } : {},
45851
+ ...payload.title !== undefined ? { title: payload.title } : {},
45852
+ ...payload.command !== undefined ? { command: payload.command } : {},
45853
+ ...payload.reason !== undefined ? { reason: payload.reason } : {},
45854
+ ...payload.message !== undefined ? { message: payload.message } : {}
45855
+ }), { startImmediately: true });
45856
+ },
44562
45857
  ...progressPlaceholderEnabled ? {
44563
45858
  onItemEvent: async (payload) => {
44564
45859
  await pushInlineProgressPlaceholder(buildInlineProgressLineForEntry({
@@ -44585,18 +45880,6 @@ This model will be used for your next message.`, []);
44585
45880
  ...payload.steps !== undefined ? { steps: payload.steps } : {}
44586
45881
  }));
44587
45882
  },
44588
- onApprovalEvent: async (payload) => {
44589
- if (payload.phase !== "requested")
44590
- return;
44591
- await pushInlineProgressPlaceholder(buildChannelProgressDraftLine({
44592
- event: "approval",
44593
- ...payload.phase !== undefined ? { phase: payload.phase } : {},
44594
- ...payload.title !== undefined ? { title: payload.title } : {},
44595
- ...payload.command !== undefined ? { command: payload.command } : {},
44596
- ...payload.reason !== undefined ? { reason: payload.reason } : {},
44597
- ...payload.message !== undefined ? { message: payload.message } : {}
44598
- }), { startImmediately: true });
44599
- },
44600
45883
  onCommandOutput: async (payload) => {
44601
45884
  if (payload.phase !== "end")
44602
45885
  return;
@@ -44624,22 +45907,24 @@ This model will be used for your next message.`, []);
44624
45907
  }));
44625
45908
  }
44626
45909
  } : {},
44627
- ...streamViaEditMessage || progressPlaceholderEnabled ? {
44628
- onCompactionStart: async () => {
44629
- await resetEditStreamOnBoundary();
44630
- await pushInlineProgressPlaceholder("Compacting context", {
44631
- startImmediately: true
44632
- });
44633
- }
44634
- } : {},
44635
- ...streamViaEditMessage || progressPlaceholderEnabled ? {
44636
- onCompactionEnd: async () => {
44637
- await resetEditStreamOnBoundary();
44638
- await pushInlineProgressPlaceholder("Resuming", {
44639
- startImmediately: true
44640
- });
44641
- }
44642
- } : {},
45910
+ onCompactionStart: async () => {
45911
+ botPresenceLifecycle.busy("review");
45912
+ if (!(streamViaEditMessage || progressPlaceholderEnabled))
45913
+ return;
45914
+ await resetEditStreamOnBoundary();
45915
+ await pushInlineProgressPlaceholder("Compacting context", {
45916
+ startImmediately: true
45917
+ });
45918
+ },
45919
+ onCompactionEnd: async () => {
45920
+ botPresenceLifecycle.busy("running");
45921
+ if (!(streamViaEditMessage || progressPlaceholderEnabled))
45922
+ return;
45923
+ await resetEditStreamOnBoundary();
45924
+ await pushInlineProgressPlaceholder("Resuming", {
45925
+ startImmediately: true
45926
+ });
45927
+ },
44643
45928
  ...suppressDefaultToolProgressMessages ? { suppressDefaultToolProgressMessages: true } : {},
44644
45929
  ...progressPlaceholderEnabled ? { allowProgressCallbacksWhenSourceDeliverySuppressed: true } : {},
44645
45930
  ...typeof disableBlockStreaming === "boolean" ? { disableBlockStreaming } : {}
@@ -44657,6 +45942,10 @@ This model will be used for your next message.`, []);
44657
45942
  ...dispatcherPipelineOptions,
44658
45943
  ...buildInlineTypingDispatcherOptions(typingCallbacks),
44659
45944
  deliver: async (payload, info) => {
45945
+ const presenceSignal = resolveInlineBotPresenceSignal(payload);
45946
+ if (presenceSignal) {
45947
+ botPresenceLifecycle.express(presenceSignal);
45948
+ }
44660
45949
  const visiblePayload = resolveInlineChatVisibleReplyPayload(payload);
44661
45950
  if (!visiblePayload)
44662
45951
  return;
@@ -44811,6 +46100,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
44811
46100
  },
44812
46101
  onError: (err, info) => {
44813
46102
  failedNonSilent = true;
46103
+ botPresenceLifecycle.fail();
44814
46104
  runtime.error?.(`inline ${info?.kind ?? "final"} reply failed: ${String(err)}`);
44815
46105
  }
44816
46106
  },
@@ -44818,6 +46108,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
44818
46108
  });
44819
46109
  } catch (error51) {
44820
46110
  dispatchError = error51;
46111
+ botPresenceLifecycle.fail();
44821
46112
  runtime.error?.(`inline dispatch failed: ${String(error51)}`);
44822
46113
  }
44823
46114
  await cleanupInlineProgressPlaceholder();
@@ -44825,6 +46116,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
44825
46116
  delivered = true;
44826
46117
  }
44827
46118
  if (!delivered && (dispatchError != null || skippedNonSilent || failedNonSilent)) {
46119
+ botPresenceLifecycle.fail();
44828
46120
  const fallbackText = dispatchError != null ? INLINE_REQUEST_ERROR_FALLBACK : EMPTY_RESPONSE_FALLBACK;
44829
46121
  const sent = await client.sendMessage({
44830
46122
  chatId: deliveryChatId,
@@ -47358,6 +48650,7 @@ var inlineChannelPlugin = {
47358
48650
  "- Inline targeting: omit `target` to reply in the current chat.",
47359
48651
  "- Inline explicit targets: `chat:<chatId>` for chats and `user:<userId>` for direct users. Prefer `user:` for DM user targets.",
47360
48652
  "- Inline discovery: use `channel-list` to discover available chats and users. Use `scope: groups|peers|all` when helpful, and reuse returned `target` values.",
48653
+ "- Inline markdown links: in visible replies, link returned users as `[@name](inline://user?id=<userId>)` and returned chats/threads as `[title](inline://chat?id=<chatId>)` or `[title](inline://thread?id=<chatId>)`. Use `target` values only for tool calls.",
47361
48654
  ...supportsInlineMessageButtonsForConfig(cfg, accountId ?? null) ? [
47362
48655
  "- Prefer Inline buttons/selects for 2-5 discrete choices or parameter picks instead of asking the user to type one. Use `presentation` blocks for shared buttons/selects, or `buttons` rows for simple callback buttons."
47363
48656
  ] : [],
@@ -47365,7 +48658,14 @@ var inlineChannelPlugin = {
47365
48658
  "- Inline reactions: pass `messageId` for `react` when you have it; on inbound turns, the current inbound message id can be used as fallback."
47366
48659
  ] : [],
47367
48660
  "- Inline history tools: `read` and `search` return media-aware message payloads (`media`, `attachments`, `attachmentUrls`) so image-only history remains discoverable. `search` is chat-scoped; run it per chat.",
47368
- "- Inline special tools: use `inline_nudge` to send a nudge, and `inline_forward` to forward message ids between chats or users.",
48661
+ "- Inline special tools: use `inline_nudge` to send a nudge, `inline_forward` to forward message ids between chats or users, and `inline_bot_presence` to move or emote through your on-screen body without sending a chat message.",
48662
+ "- Inline bot avatar setup: use `inline_bot_avatar` only when the user explicitly asks you to install or replace your on-screen avatar from a provided local/remote zip package. Do not call it during ordinary chat, do not invent file paths, and do not use it for mood/state changes.",
48663
+ "- Inline botPresence is your literal on-screen character/body in Inline, not another answer channel. Treat `kind` as your body pose/mood and `comment` as a tiny thought bubble or body-language caption.",
48664
+ "- Inline botPresence states: use `waving` for greetings/attention, `jumping` for delight or completion, `review` for inspecting/thinking, `waiting` when asking the human, `failed` when blocked or disappointed, `running` for active focused work, `happy` for positive/settled moments, and `idle` only when neutral is intentionally useful. Do not use it to hide yourself.",
48665
+ "- Inline botPresence comments: include a generated `comment` when it helps the human understand your current mood, thought, status, request, nudge, or small aside. Keep it casual, short, characterful, and true to what you are doing or feeling; under 30 characters. Text or one/two emoji characters are both fine. It should supplement the full chat answer, not replace substantive answers.",
48666
+ "- Inline botPresence is cheap to call during active work. Use it when your thought/body state changes or when a tiny status would make you easier to read; avoid repeated identical updates, fixed-timer filler, or static comments.",
48667
+ "- Inline botPresence final beat: before your final chat message in active Inline chats, make one last `inline_bot_presence` call whenever there is a real final expression to show. Do this for greetings (`waving`, `hey \uD83D\uDC4B` or `\uD83D\uDC4B`), weather/status answers (`happy`, `☀️ 72°` or `rainy ☔️`), completed longer work (`jumping`, `phew, done!`), blockers (`failed`, short reason), or requests for user input (`waiting`, short ask). Then send the normal full chat answer. Do not send `idle` just to clean up; the client quiets the presence later.",
48668
+ "- Inline botPresence in messages: when you are already sending a message, you may also set `channelData.inline.botPresence` with the same `kind` and `comment` fields.",
47369
48669
  "- Inline reply threads: use normal `reply` for short or newly started parent-chat conversations unless the user asks for a thread.",
47370
48670
  "- Inline reply threads: use `thread-create` to create or reuse a real reply thread under the current/target chat. On parent-chat inbound turns, omit `messageId` to anchor it to the current message, or pass `messageId`/`parentMessageId` explicitly.",
47371
48671
  "- Inline reply threads: use `thread-reply` to send into a real reply thread, with `threadId` set to the reply-thread chat id returned by `thread-create`. Reuse that `threadId` only for the same reply-thread session; unrelated parent-chat messages need separate parent-message anchors.",
@@ -47733,5 +49033,5 @@ export {
47733
49033
  inlineChannelPlugin
47734
49034
  };
47735
49035
 
47736
- //# debugId=93A450B5B900350964756E2164756E21
49036
+ //# debugId=3B872041BDFC897564756E2164756E21
47737
49037
  //# sourceMappingURL=channel-plugin-api.js.map