@inline-openclaw/inline 0.0.46 → 0.0.47

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.
Files changed (35) hide show
  1. package/README.md +41 -9
  2. package/dist/account-inspect-api.js +4 -1
  3. package/dist/account-inspect-api.js.map +3 -3
  4. package/dist/approval-handler.runtime.js +3914 -305
  5. package/dist/approval-handler.runtime.js.map +13 -12
  6. package/dist/channel-plugin-api.js +4669 -571
  7. package/dist/channel-plugin-api.js.map +18 -17
  8. package/dist/inline/actions.d.ts +7 -3
  9. package/dist/inline/actions.d.ts.map +1 -1
  10. package/dist/inline/bot-avatar-tool.d.ts.map +1 -1
  11. package/dist/inline/bot-commands-sync.d.ts.map +1 -1
  12. package/dist/inline/channel.d.ts.map +1 -1
  13. package/dist/inline/config-schema.d.ts +21 -0
  14. package/dist/inline/config-schema.d.ts.map +1 -1
  15. package/dist/inline/media.d.ts +17 -0
  16. package/dist/inline/media.d.ts.map +1 -1
  17. package/dist/inline/members-tool.d.ts +2 -0
  18. package/dist/inline/members-tool.d.ts.map +1 -1
  19. package/dist/inline/message-content.d.ts +2 -0
  20. package/dist/inline/message-content.d.ts.map +1 -1
  21. package/dist/inline/message-tools.d.ts.map +1 -1
  22. package/dist/inline/monitor.d.ts.map +1 -1
  23. package/dist/inline/outbound-sanitize.d.ts +2 -0
  24. package/dist/inline/outbound-sanitize.d.ts.map +1 -1
  25. package/dist/inline/parent-context-tool.d.ts.map +1 -1
  26. package/dist/inline/thread-freshness.d.ts +24 -0
  27. package/dist/inline/thread-freshness.d.ts.map +1 -0
  28. package/dist/inline/thread-routes.d.ts +4 -0
  29. package/dist/inline/thread-routes.d.ts.map +1 -1
  30. package/dist/runtime-register-api.js +1722 -243
  31. package/dist/runtime-register-api.js.map +13 -13
  32. package/dist/setup-plugin-api.js +4 -1
  33. package/dist/setup-plugin-api.js.map +3 -3
  34. package/openclaw.plugin.json +24 -1
  35. package/package.json +1 -1
@@ -5623,6 +5623,7 @@ var MessageEntity_Type;
5623
5623
  MessageEntity_Type2[MessageEntity_Type2["PHONE_NUMBER"] = 10] = "PHONE_NUMBER";
5624
5624
  MessageEntity_Type2[MessageEntity_Type2["THREAD"] = 11] = "THREAD";
5625
5625
  MessageEntity_Type2[MessageEntity_Type2["THREAD_TITLE"] = 12] = "THREAD_TITLE";
5626
+ MessageEntity_Type2[MessageEntity_Type2["BOT_COMMAND"] = 13] = "BOT_COMMAND";
5626
5627
  })(MessageEntity_Type || (MessageEntity_Type = {}));
5627
5628
  var Member_Role;
5628
5629
  (function(Member_Role2) {
@@ -5671,6 +5672,9 @@ var RpcError_Code;
5671
5672
  RpcError_Code2[RpcError_Code2["PHONE_NUMBER_INVALID"] = 12] = "PHONE_NUMBER_INVALID";
5672
5673
  RpcError_Code2[RpcError_Code2["SPACE_ADMIN_REQUIRED"] = 13] = "SPACE_ADMIN_REQUIRED";
5673
5674
  RpcError_Code2[RpcError_Code2["SPACE_OWNER_REQUIRED"] = 14] = "SPACE_OWNER_REQUIRED";
5675
+ RpcError_Code2[RpcError_Code2["USERNAME_INVALID"] = 15] = "USERNAME_INVALID";
5676
+ RpcError_Code2[RpcError_Code2["USERNAME_TAKEN"] = 16] = "USERNAME_TAKEN";
5677
+ RpcError_Code2[RpcError_Code2["FIRST_NAME_INVALID"] = 17] = "FIRST_NAME_INVALID";
5674
5678
  })(RpcError_Code || (RpcError_Code = {}));
5675
5679
  var GetUpdatesResult_ResultType;
5676
5680
  (function(GetUpdatesResult_ResultType2) {
@@ -5794,7 +5798,23 @@ var Method;
5794
5798
  Method2[Method2["GET_BOT_PRESENCE"] = 58] = "GET_BOT_PRESENCE";
5795
5799
  Method2[Method2["SET_BOT_PRESENCE_STATE"] = 59] = "SET_BOT_PRESENCE_STATE";
5796
5800
  Method2[Method2["UPDATE_DIALOG_FOLLOW_MODE"] = 60] = "UPDATE_DIALOG_FOLLOW_MODE";
5801
+ Method2[Method2["GET_SESSIONS"] = 61] = "GET_SESSIONS";
5802
+ Method2[Method2["CHECK_USERNAME"] = 62] = "CHECK_USERNAME";
5803
+ Method2[Method2["CHANGE_USERNAME"] = 63] = "CHANGE_USERNAME";
5804
+ Method2[Method2["UPDATE_PROFILE"] = 64] = "UPDATE_PROFILE";
5805
+ Method2[Method2["GET_SPACE_URL_PREVIEW_EXCLUSIONS"] = 65] = "GET_SPACE_URL_PREVIEW_EXCLUSIONS";
5806
+ Method2[Method2["ADD_SPACE_URL_PREVIEW_EXCLUSION"] = 66] = "ADD_SPACE_URL_PREVIEW_EXCLUSION";
5807
+ Method2[Method2["REMOVE_SPACE_URL_PREVIEW_EXCLUSION"] = 67] = "REMOVE_SPACE_URL_PREVIEW_EXCLUSION";
5797
5808
  })(Method || (Method = {}));
5809
+ var UsernameAvailability;
5810
+ (function(UsernameAvailability2) {
5811
+ UsernameAvailability2[UsernameAvailability2["USERNAME_AVAILABILITY_UNSPECIFIED"] = 0] = "USERNAME_AVAILABILITY_UNSPECIFIED";
5812
+ UsernameAvailability2[UsernameAvailability2["USERNAME_AVAILABLE"] = 1] = "USERNAME_AVAILABLE";
5813
+ UsernameAvailability2[UsernameAvailability2["USERNAME_CURRENT"] = 2] = "USERNAME_CURRENT";
5814
+ UsernameAvailability2[UsernameAvailability2["USERNAME_TAKEN"] = 3] = "USERNAME_TAKEN";
5815
+ UsernameAvailability2[UsernameAvailability2["USERNAME_RESERVED"] = 4] = "USERNAME_RESERVED";
5816
+ UsernameAvailability2[UsernameAvailability2["USERNAME_INVALID"] = 5] = "USERNAME_INVALID";
5817
+ })(UsernameAvailability || (UsernameAvailability = {}));
5798
5818
  var PushNotificationProvider;
5799
5819
  (function(PushNotificationProvider2) {
5800
5820
  PushNotificationProvider2[PushNotificationProvider2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
@@ -6808,7 +6828,8 @@ class User$Type extends import_runtime4.MessageType {
6808
6828
  { no: 11, name: "pending_setup", kind: "scalar", opt: true, T: 8 },
6809
6829
  { no: 12, name: "time_zone", kind: "scalar", opt: true, T: 9 },
6810
6830
  { no: 13, name: "bot", kind: "scalar", opt: true, T: 8 },
6811
- { no: 14, name: "bot_avatar", kind: "message", T: () => BotAvatar }
6831
+ { no: 14, name: "bot_avatar", kind: "message", T: () => BotAvatar },
6832
+ { no: 15, name: "bio", kind: "scalar", opt: true, T: 9 }
6812
6833
  ]);
6813
6834
  }
6814
6835
  create(value) {
@@ -6862,6 +6883,9 @@ class User$Type extends import_runtime4.MessageType {
6862
6883
  case 14:
6863
6884
  message.botAvatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.botAvatar);
6864
6885
  break;
6886
+ case 15:
6887
+ message.bio = reader.string();
6888
+ break;
6865
6889
  default:
6866
6890
  let u = options.readUnknownField;
6867
6891
  if (u === "throw")
@@ -6900,6 +6924,8 @@ class User$Type extends import_runtime4.MessageType {
6900
6924
  writer.tag(13, import_runtime.WireType.Varint).bool(message.bot);
6901
6925
  if (message.botAvatar)
6902
6926
  BotAvatar.internalBinaryWrite(message.botAvatar, writer.tag(14, import_runtime.WireType.LengthDelimited).fork(), options).join();
6927
+ if (message.bio !== undefined)
6928
+ writer.tag(15, import_runtime.WireType.LengthDelimited).string(message.bio);
6903
6929
  let u = options.writeUnknownFields;
6904
6930
  if (u !== false)
6905
6931
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -10067,7 +10093,14 @@ class RpcCall$Type extends import_runtime4.MessageType {
10067
10093
  { no: 58, name: "clearBotAvatar", kind: "message", oneof: "input", T: () => ClearBotAvatarInput },
10068
10094
  { no: 59, name: "getBotPresence", kind: "message", oneof: "input", T: () => GetBotPresenceInput },
10069
10095
  { no: 60, name: "setBotPresenceState", kind: "message", oneof: "input", T: () => SetBotPresenceStateInput },
10070
- { no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "input", T: () => UpdateDialogFollowModeInput }
10096
+ { no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "input", T: () => UpdateDialogFollowModeInput },
10097
+ { no: 62, name: "getSessions", kind: "message", oneof: "input", T: () => GetSessionsInput },
10098
+ { no: 63, name: "checkUsername", kind: "message", oneof: "input", T: () => CheckUsernameInput },
10099
+ { no: 64, name: "changeUsername", kind: "message", oneof: "input", T: () => ChangeUsernameInput },
10100
+ { no: 65, name: "updateProfile", kind: "message", oneof: "input", T: () => UpdateProfileInput },
10101
+ { no: 66, name: "getSpaceUrlPreviewExclusions", kind: "message", oneof: "input", T: () => GetSpaceUrlPreviewExclusionsInput },
10102
+ { no: 67, name: "addSpaceUrlPreviewExclusion", kind: "message", oneof: "input", T: () => AddSpaceUrlPreviewExclusionInput },
10103
+ { no: 68, name: "removeSpaceUrlPreviewExclusion", kind: "message", oneof: "input", T: () => RemoveSpaceUrlPreviewExclusionInput }
10071
10104
  ]);
10072
10105
  }
10073
10106
  create(value) {
@@ -10446,6 +10479,48 @@ class RpcCall$Type extends import_runtime4.MessageType {
10446
10479
  updateDialogFollowMode: UpdateDialogFollowModeInput.internalBinaryRead(reader, reader.uint32(), options, message.input.updateDialogFollowMode)
10447
10480
  };
10448
10481
  break;
10482
+ case 62:
10483
+ message.input = {
10484
+ oneofKind: "getSessions",
10485
+ getSessions: GetSessionsInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getSessions)
10486
+ };
10487
+ break;
10488
+ case 63:
10489
+ message.input = {
10490
+ oneofKind: "checkUsername",
10491
+ checkUsername: CheckUsernameInput.internalBinaryRead(reader, reader.uint32(), options, message.input.checkUsername)
10492
+ };
10493
+ break;
10494
+ case 64:
10495
+ message.input = {
10496
+ oneofKind: "changeUsername",
10497
+ changeUsername: ChangeUsernameInput.internalBinaryRead(reader, reader.uint32(), options, message.input.changeUsername)
10498
+ };
10499
+ break;
10500
+ case 65:
10501
+ message.input = {
10502
+ oneofKind: "updateProfile",
10503
+ updateProfile: UpdateProfileInput.internalBinaryRead(reader, reader.uint32(), options, message.input.updateProfile)
10504
+ };
10505
+ break;
10506
+ case 66:
10507
+ message.input = {
10508
+ oneofKind: "getSpaceUrlPreviewExclusions",
10509
+ getSpaceUrlPreviewExclusions: GetSpaceUrlPreviewExclusionsInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getSpaceUrlPreviewExclusions)
10510
+ };
10511
+ break;
10512
+ case 67:
10513
+ message.input = {
10514
+ oneofKind: "addSpaceUrlPreviewExclusion",
10515
+ addSpaceUrlPreviewExclusion: AddSpaceUrlPreviewExclusionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.addSpaceUrlPreviewExclusion)
10516
+ };
10517
+ break;
10518
+ case 68:
10519
+ message.input = {
10520
+ oneofKind: "removeSpaceUrlPreviewExclusion",
10521
+ removeSpaceUrlPreviewExclusion: RemoveSpaceUrlPreviewExclusionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.removeSpaceUrlPreviewExclusion)
10522
+ };
10523
+ break;
10449
10524
  default:
10450
10525
  let u = options.readUnknownField;
10451
10526
  if (u === "throw")
@@ -10580,6 +10655,20 @@ class RpcCall$Type extends import_runtime4.MessageType {
10580
10655
  SetBotPresenceStateInput.internalBinaryWrite(message.input.setBotPresenceState, writer.tag(60, import_runtime.WireType.LengthDelimited).fork(), options).join();
10581
10656
  if (message.input.oneofKind === "updateDialogFollowMode")
10582
10657
  UpdateDialogFollowModeInput.internalBinaryWrite(message.input.updateDialogFollowMode, writer.tag(61, import_runtime.WireType.LengthDelimited).fork(), options).join();
10658
+ if (message.input.oneofKind === "getSessions")
10659
+ GetSessionsInput.internalBinaryWrite(message.input.getSessions, writer.tag(62, import_runtime.WireType.LengthDelimited).fork(), options).join();
10660
+ if (message.input.oneofKind === "checkUsername")
10661
+ CheckUsernameInput.internalBinaryWrite(message.input.checkUsername, writer.tag(63, import_runtime.WireType.LengthDelimited).fork(), options).join();
10662
+ if (message.input.oneofKind === "changeUsername")
10663
+ ChangeUsernameInput.internalBinaryWrite(message.input.changeUsername, writer.tag(64, import_runtime.WireType.LengthDelimited).fork(), options).join();
10664
+ if (message.input.oneofKind === "updateProfile")
10665
+ UpdateProfileInput.internalBinaryWrite(message.input.updateProfile, writer.tag(65, import_runtime.WireType.LengthDelimited).fork(), options).join();
10666
+ if (message.input.oneofKind === "getSpaceUrlPreviewExclusions")
10667
+ GetSpaceUrlPreviewExclusionsInput.internalBinaryWrite(message.input.getSpaceUrlPreviewExclusions, writer.tag(66, import_runtime.WireType.LengthDelimited).fork(), options).join();
10668
+ if (message.input.oneofKind === "addSpaceUrlPreviewExclusion")
10669
+ AddSpaceUrlPreviewExclusionInput.internalBinaryWrite(message.input.addSpaceUrlPreviewExclusion, writer.tag(67, import_runtime.WireType.LengthDelimited).fork(), options).join();
10670
+ if (message.input.oneofKind === "removeSpaceUrlPreviewExclusion")
10671
+ RemoveSpaceUrlPreviewExclusionInput.internalBinaryWrite(message.input.removeSpaceUrlPreviewExclusion, writer.tag(68, import_runtime.WireType.LengthDelimited).fork(), options).join();
10583
10672
  let u = options.writeUnknownFields;
10584
10673
  if (u !== false)
10585
10674
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -10651,7 +10740,14 @@ class RpcResult$Type extends import_runtime4.MessageType {
10651
10740
  { no: 58, name: "clearBotAvatar", kind: "message", oneof: "result", T: () => ClearBotAvatarResult },
10652
10741
  { no: 59, name: "getBotPresence", kind: "message", oneof: "result", T: () => GetBotPresenceResult },
10653
10742
  { no: 60, name: "setBotPresenceState", kind: "message", oneof: "result", T: () => SetBotPresenceStateResult },
10654
- { no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "result", T: () => UpdateDialogFollowModeResult }
10743
+ { no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "result", T: () => UpdateDialogFollowModeResult },
10744
+ { no: 62, name: "getSessions", kind: "message", oneof: "result", T: () => GetSessionsResult },
10745
+ { no: 63, name: "checkUsername", kind: "message", oneof: "result", T: () => CheckUsernameResult },
10746
+ { no: 64, name: "changeUsername", kind: "message", oneof: "result", T: () => ChangeUsernameResult },
10747
+ { no: 65, name: "updateProfile", kind: "message", oneof: "result", T: () => UpdateProfileResult },
10748
+ { no: 66, name: "getSpaceUrlPreviewExclusions", kind: "message", oneof: "result", T: () => GetSpaceUrlPreviewExclusionsResult },
10749
+ { no: 67, name: "addSpaceUrlPreviewExclusion", kind: "message", oneof: "result", T: () => AddSpaceUrlPreviewExclusionResult },
10750
+ { no: 68, name: "removeSpaceUrlPreviewExclusion", kind: "message", oneof: "result", T: () => RemoveSpaceUrlPreviewExclusionResult }
10655
10751
  ]);
10656
10752
  }
10657
10753
  create(value) {
@@ -11030,6 +11126,48 @@ class RpcResult$Type extends import_runtime4.MessageType {
11030
11126
  updateDialogFollowMode: UpdateDialogFollowModeResult.internalBinaryRead(reader, reader.uint32(), options, message.result.updateDialogFollowMode)
11031
11127
  };
11032
11128
  break;
11129
+ case 62:
11130
+ message.result = {
11131
+ oneofKind: "getSessions",
11132
+ getSessions: GetSessionsResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getSessions)
11133
+ };
11134
+ break;
11135
+ case 63:
11136
+ message.result = {
11137
+ oneofKind: "checkUsername",
11138
+ checkUsername: CheckUsernameResult.internalBinaryRead(reader, reader.uint32(), options, message.result.checkUsername)
11139
+ };
11140
+ break;
11141
+ case 64:
11142
+ message.result = {
11143
+ oneofKind: "changeUsername",
11144
+ changeUsername: ChangeUsernameResult.internalBinaryRead(reader, reader.uint32(), options, message.result.changeUsername)
11145
+ };
11146
+ break;
11147
+ case 65:
11148
+ message.result = {
11149
+ oneofKind: "updateProfile",
11150
+ updateProfile: UpdateProfileResult.internalBinaryRead(reader, reader.uint32(), options, message.result.updateProfile)
11151
+ };
11152
+ break;
11153
+ case 66:
11154
+ message.result = {
11155
+ oneofKind: "getSpaceUrlPreviewExclusions",
11156
+ getSpaceUrlPreviewExclusions: GetSpaceUrlPreviewExclusionsResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getSpaceUrlPreviewExclusions)
11157
+ };
11158
+ break;
11159
+ case 67:
11160
+ message.result = {
11161
+ oneofKind: "addSpaceUrlPreviewExclusion",
11162
+ addSpaceUrlPreviewExclusion: AddSpaceUrlPreviewExclusionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.addSpaceUrlPreviewExclusion)
11163
+ };
11164
+ break;
11165
+ case 68:
11166
+ message.result = {
11167
+ oneofKind: "removeSpaceUrlPreviewExclusion",
11168
+ removeSpaceUrlPreviewExclusion: RemoveSpaceUrlPreviewExclusionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.removeSpaceUrlPreviewExclusion)
11169
+ };
11170
+ break;
11033
11171
  default:
11034
11172
  let u = options.readUnknownField;
11035
11173
  if (u === "throw")
@@ -11164,6 +11302,20 @@ class RpcResult$Type extends import_runtime4.MessageType {
11164
11302
  SetBotPresenceStateResult.internalBinaryWrite(message.result.setBotPresenceState, writer.tag(60, import_runtime.WireType.LengthDelimited).fork(), options).join();
11165
11303
  if (message.result.oneofKind === "updateDialogFollowMode")
11166
11304
  UpdateDialogFollowModeResult.internalBinaryWrite(message.result.updateDialogFollowMode, writer.tag(61, import_runtime.WireType.LengthDelimited).fork(), options).join();
11305
+ if (message.result.oneofKind === "getSessions")
11306
+ GetSessionsResult.internalBinaryWrite(message.result.getSessions, writer.tag(62, import_runtime.WireType.LengthDelimited).fork(), options).join();
11307
+ if (message.result.oneofKind === "checkUsername")
11308
+ CheckUsernameResult.internalBinaryWrite(message.result.checkUsername, writer.tag(63, import_runtime.WireType.LengthDelimited).fork(), options).join();
11309
+ if (message.result.oneofKind === "changeUsername")
11310
+ ChangeUsernameResult.internalBinaryWrite(message.result.changeUsername, writer.tag(64, import_runtime.WireType.LengthDelimited).fork(), options).join();
11311
+ if (message.result.oneofKind === "updateProfile")
11312
+ UpdateProfileResult.internalBinaryWrite(message.result.updateProfile, writer.tag(65, import_runtime.WireType.LengthDelimited).fork(), options).join();
11313
+ if (message.result.oneofKind === "getSpaceUrlPreviewExclusions")
11314
+ GetSpaceUrlPreviewExclusionsResult.internalBinaryWrite(message.result.getSpaceUrlPreviewExclusions, writer.tag(66, import_runtime.WireType.LengthDelimited).fork(), options).join();
11315
+ if (message.result.oneofKind === "addSpaceUrlPreviewExclusion")
11316
+ AddSpaceUrlPreviewExclusionResult.internalBinaryWrite(message.result.addSpaceUrlPreviewExclusion, writer.tag(67, import_runtime.WireType.LengthDelimited).fork(), options).join();
11317
+ if (message.result.oneofKind === "removeSpaceUrlPreviewExclusion")
11318
+ RemoveSpaceUrlPreviewExclusionResult.internalBinaryWrite(message.result.removeSpaceUrlPreviewExclusion, writer.tag(68, import_runtime.WireType.LengthDelimited).fork(), options).join();
11167
11319
  let u = options.writeUnknownFields;
11168
11320
  if (u !== false)
11169
11321
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -11745,14 +11897,23 @@ class UpdateMemberAccessResult$Type extends import_runtime4.MessageType {
11745
11897
  }
11746
11898
  var UpdateMemberAccessResult = new UpdateMemberAccessResult$Type;
11747
11899
 
11748
- class GetUpdatesStateInput$Type extends import_runtime4.MessageType {
11900
+ class SpaceUrlPreviewExclusion$Type extends import_runtime4.MessageType {
11749
11901
  constructor() {
11750
- super("GetUpdatesStateInput", [
11751
- { no: 2, name: "date", kind: "scalar", T: 3, L: 0 }
11902
+ super("SpaceUrlPreviewExclusion", [
11903
+ { no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
11904
+ { no: 2, name: "space_id", kind: "scalar", T: 3, L: 0 },
11905
+ { no: 3, name: "host", kind: "scalar", T: 9 },
11906
+ { no: 4, name: "path_prefix", kind: "scalar", opt: true, T: 9 },
11907
+ { no: 5, name: "created_by", kind: "scalar", T: 3, L: 0 },
11908
+ { no: 6, name: "date", kind: "scalar", T: 3, L: 0 }
11752
11909
  ]);
11753
11910
  }
11754
11911
  create(value) {
11755
11912
  const message = globalThis.Object.create(this.messagePrototype);
11913
+ message.id = 0n;
11914
+ message.spaceId = 0n;
11915
+ message.host = "";
11916
+ message.createdBy = 0n;
11756
11917
  message.date = 0n;
11757
11918
  if (value !== undefined)
11758
11919
  import_runtime3.reflectionMergePartial(this, message, value);
@@ -11763,7 +11924,22 @@ class GetUpdatesStateInput$Type extends import_runtime4.MessageType {
11763
11924
  while (reader.pos < end) {
11764
11925
  let [fieldNo, wireType] = reader.tag();
11765
11926
  switch (fieldNo) {
11927
+ case 1:
11928
+ message.id = reader.int64().toBigInt();
11929
+ break;
11766
11930
  case 2:
11931
+ message.spaceId = reader.int64().toBigInt();
11932
+ break;
11933
+ case 3:
11934
+ message.host = reader.string();
11935
+ break;
11936
+ case 4:
11937
+ message.pathPrefix = reader.string();
11938
+ break;
11939
+ case 5:
11940
+ message.createdBy = reader.int64().toBigInt();
11941
+ break;
11942
+ case 6:
11767
11943
  message.date = reader.int64().toBigInt();
11768
11944
  break;
11769
11945
  default:
@@ -11778,25 +11954,35 @@ class GetUpdatesStateInput$Type extends import_runtime4.MessageType {
11778
11954
  return message;
11779
11955
  }
11780
11956
  internalBinaryWrite(message, writer, options) {
11957
+ if (message.id !== 0n)
11958
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.id);
11959
+ if (message.spaceId !== 0n)
11960
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.spaceId);
11961
+ if (message.host !== "")
11962
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.host);
11963
+ if (message.pathPrefix !== undefined)
11964
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.pathPrefix);
11965
+ if (message.createdBy !== 0n)
11966
+ writer.tag(5, import_runtime.WireType.Varint).int64(message.createdBy);
11781
11967
  if (message.date !== 0n)
11782
- writer.tag(2, import_runtime.WireType.Varint).int64(message.date);
11968
+ writer.tag(6, import_runtime.WireType.Varint).int64(message.date);
11783
11969
  let u = options.writeUnknownFields;
11784
11970
  if (u !== false)
11785
11971
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11786
11972
  return writer;
11787
11973
  }
11788
11974
  }
11789
- var GetUpdatesStateInput = new GetUpdatesStateInput$Type;
11975
+ var SpaceUrlPreviewExclusion = new SpaceUrlPreviewExclusion$Type;
11790
11976
 
11791
- class GetUpdatesStateResult$Type extends import_runtime4.MessageType {
11977
+ class GetSpaceUrlPreviewExclusionsInput$Type extends import_runtime4.MessageType {
11792
11978
  constructor() {
11793
- super("GetUpdatesStateResult", [
11794
- { no: 1, name: "date", kind: "scalar", T: 3, L: 0 }
11979
+ super("GetSpaceUrlPreviewExclusionsInput", [
11980
+ { no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 }
11795
11981
  ]);
11796
11982
  }
11797
11983
  create(value) {
11798
11984
  const message = globalThis.Object.create(this.messagePrototype);
11799
- message.date = 0n;
11985
+ message.spaceId = 0n;
11800
11986
  if (value !== undefined)
11801
11987
  import_runtime3.reflectionMergePartial(this, message, value);
11802
11988
  return message;
@@ -11807,7 +11993,7 @@ class GetUpdatesStateResult$Type extends import_runtime4.MessageType {
11807
11993
  let [fieldNo, wireType] = reader.tag();
11808
11994
  switch (fieldNo) {
11809
11995
  case 1:
11810
- message.date = reader.int64().toBigInt();
11996
+ message.spaceId = reader.int64().toBigInt();
11811
11997
  break;
11812
11998
  default:
11813
11999
  let u = options.readUnknownField;
@@ -11821,24 +12007,25 @@ class GetUpdatesStateResult$Type extends import_runtime4.MessageType {
11821
12007
  return message;
11822
12008
  }
11823
12009
  internalBinaryWrite(message, writer, options) {
11824
- if (message.date !== 0n)
11825
- writer.tag(1, import_runtime.WireType.Varint).int64(message.date);
12010
+ if (message.spaceId !== 0n)
12011
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
11826
12012
  let u = options.writeUnknownFields;
11827
12013
  if (u !== false)
11828
12014
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11829
12015
  return writer;
11830
12016
  }
11831
12017
  }
11832
- var GetUpdatesStateResult = new GetUpdatesStateResult$Type;
12018
+ var GetSpaceUrlPreviewExclusionsInput = new GetSpaceUrlPreviewExclusionsInput$Type;
11833
12019
 
11834
- class GetChatInput$Type extends import_runtime4.MessageType {
12020
+ class GetSpaceUrlPreviewExclusionsResult$Type extends import_runtime4.MessageType {
11835
12021
  constructor() {
11836
- super("GetChatInput", [
11837
- { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
12022
+ super("GetSpaceUrlPreviewExclusionsResult", [
12023
+ { no: 1, name: "exclusions", kind: "message", repeat: 1, T: () => SpaceUrlPreviewExclusion }
11838
12024
  ]);
11839
12025
  }
11840
12026
  create(value) {
11841
12027
  const message = globalThis.Object.create(this.messagePrototype);
12028
+ message.exclusions = [];
11842
12029
  if (value !== undefined)
11843
12030
  import_runtime3.reflectionMergePartial(this, message, value);
11844
12031
  return message;
@@ -11849,7 +12036,7 @@ class GetChatInput$Type extends import_runtime4.MessageType {
11849
12036
  let [fieldNo, wireType] = reader.tag();
11850
12037
  switch (fieldNo) {
11851
12038
  case 1:
11852
- message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
12039
+ message.exclusions.push(SpaceUrlPreviewExclusion.internalBinaryRead(reader, reader.uint32(), options));
11853
12040
  break;
11854
12041
  default:
11855
12042
  let u = options.readUnknownField;
@@ -11863,28 +12050,30 @@ class GetChatInput$Type extends import_runtime4.MessageType {
11863
12050
  return message;
11864
12051
  }
11865
12052
  internalBinaryWrite(message, writer, options) {
11866
- if (message.peerId)
11867
- InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
12053
+ for (let i = 0;i < message.exclusions.length; i++)
12054
+ SpaceUrlPreviewExclusion.internalBinaryWrite(message.exclusions[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
11868
12055
  let u = options.writeUnknownFields;
11869
12056
  if (u !== false)
11870
12057
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11871
12058
  return writer;
11872
12059
  }
11873
12060
  }
11874
- var GetChatInput = new GetChatInput$Type;
12061
+ var GetSpaceUrlPreviewExclusionsResult = new GetSpaceUrlPreviewExclusionsResult$Type;
11875
12062
 
11876
- class GetChatResult$Type extends import_runtime4.MessageType {
12063
+ class AddSpaceUrlPreviewExclusionInput$Type extends import_runtime4.MessageType {
11877
12064
  constructor() {
11878
- super("GetChatResult", [
11879
- { no: 1, name: "chat", kind: "message", T: () => Chat },
11880
- { no: 2, name: "dialog", kind: "message", T: () => Dialog },
11881
- { no: 3, name: "pinned_message_ids", kind: "scalar", repeat: 1, T: 3, L: 0 },
11882
- { no: 4, name: "anchor_message", kind: "message", T: () => Message }
12065
+ super("AddSpaceUrlPreviewExclusionInput", [
12066
+ { no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 },
12067
+ { no: 2, name: "host", kind: "scalar", T: 9 },
12068
+ { no: 3, name: "path_prefix", kind: "scalar", opt: true, T: 9 },
12069
+ { no: 4, name: "peer_id", kind: "message", T: () => InputPeer },
12070
+ { no: 5, name: "message_id", kind: "scalar", opt: true, T: 3, L: 0 }
11883
12071
  ]);
11884
12072
  }
11885
12073
  create(value) {
11886
12074
  const message = globalThis.Object.create(this.messagePrototype);
11887
- message.pinnedMessageIds = [];
12075
+ message.spaceId = 0n;
12076
+ message.host = "";
11888
12077
  if (value !== undefined)
11889
12078
  import_runtime3.reflectionMergePartial(this, message, value);
11890
12079
  return message;
@@ -11895,20 +12084,19 @@ class GetChatResult$Type extends import_runtime4.MessageType {
11895
12084
  let [fieldNo, wireType] = reader.tag();
11896
12085
  switch (fieldNo) {
11897
12086
  case 1:
11898
- message.chat = Chat.internalBinaryRead(reader, reader.uint32(), options, message.chat);
12087
+ message.spaceId = reader.int64().toBigInt();
11899
12088
  break;
11900
12089
  case 2:
11901
- message.dialog = Dialog.internalBinaryRead(reader, reader.uint32(), options, message.dialog);
12090
+ message.host = reader.string();
11902
12091
  break;
11903
12092
  case 3:
11904
- if (wireType === import_runtime.WireType.LengthDelimited)
11905
- for (let e = reader.int32() + reader.pos;reader.pos < e; )
11906
- message.pinnedMessageIds.push(reader.int64().toBigInt());
11907
- else
11908
- message.pinnedMessageIds.push(reader.int64().toBigInt());
12093
+ message.pathPrefix = reader.string();
11909
12094
  break;
11910
12095
  case 4:
11911
- message.anchorMessage = Message.internalBinaryRead(reader, reader.uint32(), options, message.anchorMessage);
12096
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
12097
+ break;
12098
+ case 5:
12099
+ message.messageId = reader.int64().toBigInt();
11912
12100
  break;
11913
12101
  default:
11914
12102
  let u = options.readUnknownField;
@@ -11922,29 +12110,351 @@ class GetChatResult$Type extends import_runtime4.MessageType {
11922
12110
  return message;
11923
12111
  }
11924
12112
  internalBinaryWrite(message, writer, options) {
11925
- if (message.chat)
11926
- Chat.internalBinaryWrite(message.chat, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
11927
- if (message.dialog)
11928
- Dialog.internalBinaryWrite(message.dialog, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
11929
- if (message.pinnedMessageIds.length) {
11930
- writer.tag(3, import_runtime.WireType.LengthDelimited).fork();
11931
- for (let i = 0;i < message.pinnedMessageIds.length; i++)
11932
- writer.int64(message.pinnedMessageIds[i]);
11933
- writer.join();
12113
+ if (message.spaceId !== 0n)
12114
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
12115
+ if (message.host !== "")
12116
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.host);
12117
+ if (message.pathPrefix !== undefined)
12118
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.pathPrefix);
12119
+ if (message.peerId)
12120
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
12121
+ if (message.messageId !== undefined)
12122
+ writer.tag(5, import_runtime.WireType.Varint).int64(message.messageId);
12123
+ let u = options.writeUnknownFields;
12124
+ if (u !== false)
12125
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12126
+ return writer;
12127
+ }
12128
+ }
12129
+ var AddSpaceUrlPreviewExclusionInput = new AddSpaceUrlPreviewExclusionInput$Type;
12130
+
12131
+ class AddSpaceUrlPreviewExclusionResult$Type extends import_runtime4.MessageType {
12132
+ constructor() {
12133
+ super("AddSpaceUrlPreviewExclusionResult", [
12134
+ { no: 1, name: "exclusion", kind: "message", T: () => SpaceUrlPreviewExclusion },
12135
+ { no: 2, name: "updates", kind: "message", repeat: 1, T: () => Update }
12136
+ ]);
12137
+ }
12138
+ create(value) {
12139
+ const message = globalThis.Object.create(this.messagePrototype);
12140
+ message.updates = [];
12141
+ if (value !== undefined)
12142
+ import_runtime3.reflectionMergePartial(this, message, value);
12143
+ return message;
12144
+ }
12145
+ internalBinaryRead(reader, length, options, target) {
12146
+ let message = target ?? this.create(), end = reader.pos + length;
12147
+ while (reader.pos < end) {
12148
+ let [fieldNo, wireType] = reader.tag();
12149
+ switch (fieldNo) {
12150
+ case 1:
12151
+ message.exclusion = SpaceUrlPreviewExclusion.internalBinaryRead(reader, reader.uint32(), options, message.exclusion);
12152
+ break;
12153
+ case 2:
12154
+ message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
12155
+ break;
12156
+ default:
12157
+ let u = options.readUnknownField;
12158
+ if (u === "throw")
12159
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12160
+ let d = reader.skip(wireType);
12161
+ if (u !== false)
12162
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12163
+ }
11934
12164
  }
11935
- if (message.anchorMessage)
11936
- Message.internalBinaryWrite(message.anchorMessage, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
12165
+ return message;
12166
+ }
12167
+ internalBinaryWrite(message, writer, options) {
12168
+ if (message.exclusion)
12169
+ SpaceUrlPreviewExclusion.internalBinaryWrite(message.exclusion, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
12170
+ for (let i = 0;i < message.updates.length; i++)
12171
+ Update.internalBinaryWrite(message.updates[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
11937
12172
  let u = options.writeUnknownFields;
11938
12173
  if (u !== false)
11939
12174
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11940
12175
  return writer;
11941
12176
  }
11942
12177
  }
11943
- var GetChatResult = new GetChatResult$Type;
12178
+ var AddSpaceUrlPreviewExclusionResult = new AddSpaceUrlPreviewExclusionResult$Type;
11944
12179
 
11945
- class ShowInChatListInput$Type extends import_runtime4.MessageType {
12180
+ class RemoveSpaceUrlPreviewExclusionInput$Type extends import_runtime4.MessageType {
11946
12181
  constructor() {
11947
- super("ShowInChatListInput", [
12182
+ super("RemoveSpaceUrlPreviewExclusionInput", [
12183
+ { no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 },
12184
+ { no: 2, name: "exclusion_id", kind: "scalar", T: 3, L: 0 }
12185
+ ]);
12186
+ }
12187
+ create(value) {
12188
+ const message = globalThis.Object.create(this.messagePrototype);
12189
+ message.spaceId = 0n;
12190
+ message.exclusionId = 0n;
12191
+ if (value !== undefined)
12192
+ import_runtime3.reflectionMergePartial(this, message, value);
12193
+ return message;
12194
+ }
12195
+ internalBinaryRead(reader, length, options, target) {
12196
+ let message = target ?? this.create(), end = reader.pos + length;
12197
+ while (reader.pos < end) {
12198
+ let [fieldNo, wireType] = reader.tag();
12199
+ switch (fieldNo) {
12200
+ case 1:
12201
+ message.spaceId = reader.int64().toBigInt();
12202
+ break;
12203
+ case 2:
12204
+ message.exclusionId = reader.int64().toBigInt();
12205
+ break;
12206
+ default:
12207
+ let u = options.readUnknownField;
12208
+ if (u === "throw")
12209
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12210
+ let d = reader.skip(wireType);
12211
+ if (u !== false)
12212
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12213
+ }
12214
+ }
12215
+ return message;
12216
+ }
12217
+ internalBinaryWrite(message, writer, options) {
12218
+ if (message.spaceId !== 0n)
12219
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
12220
+ if (message.exclusionId !== 0n)
12221
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.exclusionId);
12222
+ let u = options.writeUnknownFields;
12223
+ if (u !== false)
12224
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12225
+ return writer;
12226
+ }
12227
+ }
12228
+ var RemoveSpaceUrlPreviewExclusionInput = new RemoveSpaceUrlPreviewExclusionInput$Type;
12229
+
12230
+ class RemoveSpaceUrlPreviewExclusionResult$Type extends import_runtime4.MessageType {
12231
+ constructor() {
12232
+ super("RemoveSpaceUrlPreviewExclusionResult", []);
12233
+ }
12234
+ create(value) {
12235
+ const message = globalThis.Object.create(this.messagePrototype);
12236
+ if (value !== undefined)
12237
+ import_runtime3.reflectionMergePartial(this, message, value);
12238
+ return message;
12239
+ }
12240
+ internalBinaryRead(reader, length, options, target) {
12241
+ return target ?? this.create();
12242
+ }
12243
+ internalBinaryWrite(message, writer, options) {
12244
+ let u = options.writeUnknownFields;
12245
+ if (u !== false)
12246
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12247
+ return writer;
12248
+ }
12249
+ }
12250
+ var RemoveSpaceUrlPreviewExclusionResult = new RemoveSpaceUrlPreviewExclusionResult$Type;
12251
+
12252
+ class GetUpdatesStateInput$Type extends import_runtime4.MessageType {
12253
+ constructor() {
12254
+ super("GetUpdatesStateInput", [
12255
+ { no: 2, name: "date", kind: "scalar", T: 3, L: 0 }
12256
+ ]);
12257
+ }
12258
+ create(value) {
12259
+ const message = globalThis.Object.create(this.messagePrototype);
12260
+ message.date = 0n;
12261
+ if (value !== undefined)
12262
+ import_runtime3.reflectionMergePartial(this, message, value);
12263
+ return message;
12264
+ }
12265
+ internalBinaryRead(reader, length, options, target) {
12266
+ let message = target ?? this.create(), end = reader.pos + length;
12267
+ while (reader.pos < end) {
12268
+ let [fieldNo, wireType] = reader.tag();
12269
+ switch (fieldNo) {
12270
+ case 2:
12271
+ message.date = reader.int64().toBigInt();
12272
+ break;
12273
+ default:
12274
+ let u = options.readUnknownField;
12275
+ if (u === "throw")
12276
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12277
+ let d = reader.skip(wireType);
12278
+ if (u !== false)
12279
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12280
+ }
12281
+ }
12282
+ return message;
12283
+ }
12284
+ internalBinaryWrite(message, writer, options) {
12285
+ if (message.date !== 0n)
12286
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.date);
12287
+ let u = options.writeUnknownFields;
12288
+ if (u !== false)
12289
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12290
+ return writer;
12291
+ }
12292
+ }
12293
+ var GetUpdatesStateInput = new GetUpdatesStateInput$Type;
12294
+
12295
+ class GetUpdatesStateResult$Type extends import_runtime4.MessageType {
12296
+ constructor() {
12297
+ super("GetUpdatesStateResult", [
12298
+ { no: 1, name: "date", kind: "scalar", T: 3, L: 0 },
12299
+ { no: 2, name: "updates_found", kind: "scalar", opt: true, T: 8 }
12300
+ ]);
12301
+ }
12302
+ create(value) {
12303
+ const message = globalThis.Object.create(this.messagePrototype);
12304
+ message.date = 0n;
12305
+ if (value !== undefined)
12306
+ import_runtime3.reflectionMergePartial(this, message, value);
12307
+ return message;
12308
+ }
12309
+ internalBinaryRead(reader, length, options, target) {
12310
+ let message = target ?? this.create(), end = reader.pos + length;
12311
+ while (reader.pos < end) {
12312
+ let [fieldNo, wireType] = reader.tag();
12313
+ switch (fieldNo) {
12314
+ case 1:
12315
+ message.date = reader.int64().toBigInt();
12316
+ break;
12317
+ case 2:
12318
+ message.updatesFound = reader.bool();
12319
+ break;
12320
+ default:
12321
+ let u = options.readUnknownField;
12322
+ if (u === "throw")
12323
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12324
+ let d = reader.skip(wireType);
12325
+ if (u !== false)
12326
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12327
+ }
12328
+ }
12329
+ return message;
12330
+ }
12331
+ internalBinaryWrite(message, writer, options) {
12332
+ if (message.date !== 0n)
12333
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.date);
12334
+ if (message.updatesFound !== undefined)
12335
+ writer.tag(2, import_runtime.WireType.Varint).bool(message.updatesFound);
12336
+ let u = options.writeUnknownFields;
12337
+ if (u !== false)
12338
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12339
+ return writer;
12340
+ }
12341
+ }
12342
+ var GetUpdatesStateResult = new GetUpdatesStateResult$Type;
12343
+
12344
+ class GetChatInput$Type extends import_runtime4.MessageType {
12345
+ constructor() {
12346
+ super("GetChatInput", [
12347
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
12348
+ ]);
12349
+ }
12350
+ create(value) {
12351
+ const message = globalThis.Object.create(this.messagePrototype);
12352
+ if (value !== undefined)
12353
+ import_runtime3.reflectionMergePartial(this, message, value);
12354
+ return message;
12355
+ }
12356
+ internalBinaryRead(reader, length, options, target) {
12357
+ let message = target ?? this.create(), end = reader.pos + length;
12358
+ while (reader.pos < end) {
12359
+ let [fieldNo, wireType] = reader.tag();
12360
+ switch (fieldNo) {
12361
+ case 1:
12362
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
12363
+ break;
12364
+ default:
12365
+ let u = options.readUnknownField;
12366
+ if (u === "throw")
12367
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12368
+ let d = reader.skip(wireType);
12369
+ if (u !== false)
12370
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12371
+ }
12372
+ }
12373
+ return message;
12374
+ }
12375
+ internalBinaryWrite(message, writer, options) {
12376
+ if (message.peerId)
12377
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
12378
+ let u = options.writeUnknownFields;
12379
+ if (u !== false)
12380
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12381
+ return writer;
12382
+ }
12383
+ }
12384
+ var GetChatInput = new GetChatInput$Type;
12385
+
12386
+ class GetChatResult$Type extends import_runtime4.MessageType {
12387
+ constructor() {
12388
+ super("GetChatResult", [
12389
+ { no: 1, name: "chat", kind: "message", T: () => Chat },
12390
+ { no: 2, name: "dialog", kind: "message", T: () => Dialog },
12391
+ { no: 3, name: "pinned_message_ids", kind: "scalar", repeat: 1, T: 3, L: 0 },
12392
+ { no: 4, name: "anchor_message", kind: "message", T: () => Message }
12393
+ ]);
12394
+ }
12395
+ create(value) {
12396
+ const message = globalThis.Object.create(this.messagePrototype);
12397
+ message.pinnedMessageIds = [];
12398
+ if (value !== undefined)
12399
+ import_runtime3.reflectionMergePartial(this, message, value);
12400
+ return message;
12401
+ }
12402
+ internalBinaryRead(reader, length, options, target) {
12403
+ let message = target ?? this.create(), end = reader.pos + length;
12404
+ while (reader.pos < end) {
12405
+ let [fieldNo, wireType] = reader.tag();
12406
+ switch (fieldNo) {
12407
+ case 1:
12408
+ message.chat = Chat.internalBinaryRead(reader, reader.uint32(), options, message.chat);
12409
+ break;
12410
+ case 2:
12411
+ message.dialog = Dialog.internalBinaryRead(reader, reader.uint32(), options, message.dialog);
12412
+ break;
12413
+ case 3:
12414
+ if (wireType === import_runtime.WireType.LengthDelimited)
12415
+ for (let e = reader.int32() + reader.pos;reader.pos < e; )
12416
+ message.pinnedMessageIds.push(reader.int64().toBigInt());
12417
+ else
12418
+ message.pinnedMessageIds.push(reader.int64().toBigInt());
12419
+ break;
12420
+ case 4:
12421
+ message.anchorMessage = Message.internalBinaryRead(reader, reader.uint32(), options, message.anchorMessage);
12422
+ break;
12423
+ default:
12424
+ let u = options.readUnknownField;
12425
+ if (u === "throw")
12426
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
12427
+ let d = reader.skip(wireType);
12428
+ if (u !== false)
12429
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
12430
+ }
12431
+ }
12432
+ return message;
12433
+ }
12434
+ internalBinaryWrite(message, writer, options) {
12435
+ if (message.chat)
12436
+ Chat.internalBinaryWrite(message.chat, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
12437
+ if (message.dialog)
12438
+ Dialog.internalBinaryWrite(message.dialog, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
12439
+ if (message.pinnedMessageIds.length) {
12440
+ writer.tag(3, import_runtime.WireType.LengthDelimited).fork();
12441
+ for (let i = 0;i < message.pinnedMessageIds.length; i++)
12442
+ writer.int64(message.pinnedMessageIds[i]);
12443
+ writer.join();
12444
+ }
12445
+ if (message.anchorMessage)
12446
+ Message.internalBinaryWrite(message.anchorMessage, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
12447
+ let u = options.writeUnknownFields;
12448
+ if (u !== false)
12449
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
12450
+ return writer;
12451
+ }
12452
+ }
12453
+ var GetChatResult = new GetChatResult$Type;
12454
+
12455
+ class ShowInChatListInput$Type extends import_runtime4.MessageType {
12456
+ constructor() {
12457
+ super("ShowInChatListInput", [
11948
12458
  { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
11949
12459
  ]);
11950
12460
  }
@@ -12970,18 +13480,53 @@ class RevokeSessionResult$Type extends import_runtime4.MessageType {
12970
13480
  }
12971
13481
  var RevokeSessionResult = new RevokeSessionResult$Type;
12972
13482
 
12973
- class BotCommand$Type extends import_runtime4.MessageType {
13483
+ class GetSessionsInput$Type extends import_runtime4.MessageType {
12974
13484
  constructor() {
12975
- super("BotCommand", [
12976
- { no: 1, name: "command", kind: "scalar", T: 9 },
12977
- { no: 2, name: "description", kind: "scalar", T: 9 },
12978
- { no: 3, name: "sort_order", kind: "scalar", opt: true, T: 5 }
13485
+ super("GetSessionsInput", []);
13486
+ }
13487
+ create(value) {
13488
+ const message = globalThis.Object.create(this.messagePrototype);
13489
+ if (value !== undefined)
13490
+ import_runtime3.reflectionMergePartial(this, message, value);
13491
+ return message;
13492
+ }
13493
+ internalBinaryRead(reader, length, options, target) {
13494
+ return target ?? this.create();
13495
+ }
13496
+ internalBinaryWrite(message, writer, options) {
13497
+ let u = options.writeUnknownFields;
13498
+ if (u !== false)
13499
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13500
+ return writer;
13501
+ }
13502
+ }
13503
+ var GetSessionsInput = new GetSessionsInput$Type;
13504
+
13505
+ class AccountSession$Type extends import_runtime4.MessageType {
13506
+ constructor() {
13507
+ super("AccountSession", [
13508
+ { no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
13509
+ { no: 2, name: "client_type", kind: "scalar", T: 9 },
13510
+ { no: 3, name: "client_version", kind: "scalar", opt: true, T: 9 },
13511
+ { no: 4, name: "os_version", kind: "scalar", opt: true, T: 9 },
13512
+ { no: 5, name: "device_name", kind: "scalar", opt: true, T: 9 },
13513
+ { no: 6, name: "city", kind: "scalar", opt: true, T: 9 },
13514
+ { no: 7, name: "country", kind: "scalar", opt: true, T: 9 },
13515
+ { no: 8, name: "timezone", kind: "scalar", opt: true, T: 9 },
13516
+ { no: 9, name: "created_at", kind: "scalar", T: 3, L: 0 },
13517
+ { no: 10, name: "last_active_at", kind: "scalar", T: 3, L: 0 },
13518
+ { no: 11, name: "active", kind: "scalar", T: 8 },
13519
+ { no: 12, name: "current", kind: "scalar", T: 8 }
12979
13520
  ]);
12980
13521
  }
12981
13522
  create(value) {
12982
13523
  const message = globalThis.Object.create(this.messagePrototype);
12983
- message.command = "";
12984
- message.description = "";
13524
+ message.id = 0n;
13525
+ message.clientType = "";
13526
+ message.createdAt = 0n;
13527
+ message.lastActiveAt = 0n;
13528
+ message.active = false;
13529
+ message.current = false;
12985
13530
  if (value !== undefined)
12986
13531
  import_runtime3.reflectionMergePartial(this, message, value);
12987
13532
  return message;
@@ -12992,13 +13537,40 @@ class BotCommand$Type extends import_runtime4.MessageType {
12992
13537
  let [fieldNo, wireType] = reader.tag();
12993
13538
  switch (fieldNo) {
12994
13539
  case 1:
12995
- message.command = reader.string();
13540
+ message.id = reader.int64().toBigInt();
12996
13541
  break;
12997
13542
  case 2:
12998
- message.description = reader.string();
13543
+ message.clientType = reader.string();
12999
13544
  break;
13000
13545
  case 3:
13001
- message.sortOrder = reader.int32();
13546
+ message.clientVersion = reader.string();
13547
+ break;
13548
+ case 4:
13549
+ message.osVersion = reader.string();
13550
+ break;
13551
+ case 5:
13552
+ message.deviceName = reader.string();
13553
+ break;
13554
+ case 6:
13555
+ message.city = reader.string();
13556
+ break;
13557
+ case 7:
13558
+ message.country = reader.string();
13559
+ break;
13560
+ case 8:
13561
+ message.timezone = reader.string();
13562
+ break;
13563
+ case 9:
13564
+ message.createdAt = reader.int64().toBigInt();
13565
+ break;
13566
+ case 10:
13567
+ message.lastActiveAt = reader.int64().toBigInt();
13568
+ break;
13569
+ case 11:
13570
+ message.active = reader.bool();
13571
+ break;
13572
+ case 12:
13573
+ message.current = reader.bool();
13002
13574
  break;
13003
13575
  default:
13004
13576
  let u = options.readUnknownField;
@@ -13012,30 +13584,47 @@ class BotCommand$Type extends import_runtime4.MessageType {
13012
13584
  return message;
13013
13585
  }
13014
13586
  internalBinaryWrite(message, writer, options) {
13015
- if (message.command !== "")
13016
- writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.command);
13017
- if (message.description !== "")
13018
- writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.description);
13019
- if (message.sortOrder !== undefined)
13020
- writer.tag(3, import_runtime.WireType.Varint).int32(message.sortOrder);
13587
+ if (message.id !== 0n)
13588
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.id);
13589
+ if (message.clientType !== "")
13590
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.clientType);
13591
+ if (message.clientVersion !== undefined)
13592
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.clientVersion);
13593
+ if (message.osVersion !== undefined)
13594
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.osVersion);
13595
+ if (message.deviceName !== undefined)
13596
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.deviceName);
13597
+ if (message.city !== undefined)
13598
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.city);
13599
+ if (message.country !== undefined)
13600
+ writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.country);
13601
+ if (message.timezone !== undefined)
13602
+ writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.timezone);
13603
+ if (message.createdAt !== 0n)
13604
+ writer.tag(9, import_runtime.WireType.Varint).int64(message.createdAt);
13605
+ if (message.lastActiveAt !== 0n)
13606
+ writer.tag(10, import_runtime.WireType.Varint).int64(message.lastActiveAt);
13607
+ if (message.active !== false)
13608
+ writer.tag(11, import_runtime.WireType.Varint).bool(message.active);
13609
+ if (message.current !== false)
13610
+ writer.tag(12, import_runtime.WireType.Varint).bool(message.current);
13021
13611
  let u = options.writeUnknownFields;
13022
13612
  if (u !== false)
13023
13613
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13024
13614
  return writer;
13025
13615
  }
13026
13616
  }
13027
- var BotCommand = new BotCommand$Type;
13617
+ var AccountSession = new AccountSession$Type;
13028
13618
 
13029
- class PeerBotCommands$Type extends import_runtime4.MessageType {
13619
+ class GetSessionsResult$Type extends import_runtime4.MessageType {
13030
13620
  constructor() {
13031
- super("PeerBotCommands", [
13032
- { no: 1, name: "bot", kind: "message", T: () => User },
13033
- { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13621
+ super("GetSessionsResult", [
13622
+ { no: 1, name: "sessions", kind: "message", repeat: 1, T: () => AccountSession }
13034
13623
  ]);
13035
13624
  }
13036
13625
  create(value) {
13037
13626
  const message = globalThis.Object.create(this.messagePrototype);
13038
- message.commands = [];
13627
+ message.sessions = [];
13039
13628
  if (value !== undefined)
13040
13629
  import_runtime3.reflectionMergePartial(this, message, value);
13041
13630
  return message;
@@ -13046,10 +13635,7 @@ class PeerBotCommands$Type extends import_runtime4.MessageType {
13046
13635
  let [fieldNo, wireType] = reader.tag();
13047
13636
  switch (fieldNo) {
13048
13637
  case 1:
13049
- message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
13050
- break;
13051
- case 2:
13052
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13638
+ message.sessions.push(AccountSession.internalBinaryRead(reader, reader.uint32(), options));
13053
13639
  break;
13054
13640
  default:
13055
13641
  let u = options.readUnknownField;
@@ -13063,27 +13649,25 @@ class PeerBotCommands$Type extends import_runtime4.MessageType {
13063
13649
  return message;
13064
13650
  }
13065
13651
  internalBinaryWrite(message, writer, options) {
13066
- if (message.bot)
13067
- User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13068
- for (let i = 0;i < message.commands.length; i++)
13069
- BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13652
+ for (let i = 0;i < message.sessions.length; i++)
13653
+ AccountSession.internalBinaryWrite(message.sessions[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13070
13654
  let u = options.writeUnknownFields;
13071
13655
  if (u !== false)
13072
13656
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13073
13657
  return writer;
13074
13658
  }
13075
13659
  }
13076
- var PeerBotCommands = new PeerBotCommands$Type;
13660
+ var GetSessionsResult = new GetSessionsResult$Type;
13077
13661
 
13078
- class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13662
+ class CheckUsernameInput$Type extends import_runtime4.MessageType {
13079
13663
  constructor() {
13080
- super("GetBotCommandsInput", [
13081
- { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13664
+ super("CheckUsernameInput", [
13665
+ { no: 1, name: "username", kind: "scalar", T: 9 }
13082
13666
  ]);
13083
13667
  }
13084
13668
  create(value) {
13085
13669
  const message = globalThis.Object.create(this.messagePrototype);
13086
- message.botUserId = 0n;
13670
+ message.username = "";
13087
13671
  if (value !== undefined)
13088
13672
  import_runtime3.reflectionMergePartial(this, message, value);
13089
13673
  return message;
@@ -13094,7 +13678,7 @@ class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13094
13678
  let [fieldNo, wireType] = reader.tag();
13095
13679
  switch (fieldNo) {
13096
13680
  case 1:
13097
- message.botUserId = reader.int64().toBigInt();
13681
+ message.username = reader.string();
13098
13682
  break;
13099
13683
  default:
13100
13684
  let u = options.readUnknownField;
@@ -13108,25 +13692,27 @@ class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13108
13692
  return message;
13109
13693
  }
13110
13694
  internalBinaryWrite(message, writer, options) {
13111
- if (message.botUserId !== 0n)
13112
- writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13695
+ if (message.username !== "")
13696
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.username);
13113
13697
  let u = options.writeUnknownFields;
13114
13698
  if (u !== false)
13115
13699
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13116
13700
  return writer;
13117
13701
  }
13118
13702
  }
13119
- var GetBotCommandsInput = new GetBotCommandsInput$Type;
13703
+ var CheckUsernameInput = new CheckUsernameInput$Type;
13120
13704
 
13121
- class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13705
+ class CheckUsernameResult$Type extends import_runtime4.MessageType {
13122
13706
  constructor() {
13123
- super("GetBotCommandsResult", [
13124
- { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13707
+ super("CheckUsernameResult", [
13708
+ { no: 1, name: "username", kind: "scalar", T: 9 },
13709
+ { no: 2, name: "availability", kind: "enum", T: () => ["UsernameAvailability", UsernameAvailability] }
13125
13710
  ]);
13126
13711
  }
13127
13712
  create(value) {
13128
13713
  const message = globalThis.Object.create(this.messagePrototype);
13129
- message.commands = [];
13714
+ message.username = "";
13715
+ message.availability = 0;
13130
13716
  if (value !== undefined)
13131
13717
  import_runtime3.reflectionMergePartial(this, message, value);
13132
13718
  return message;
@@ -13137,7 +13723,10 @@ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13137
13723
  let [fieldNo, wireType] = reader.tag();
13138
13724
  switch (fieldNo) {
13139
13725
  case 1:
13140
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13726
+ message.username = reader.string();
13727
+ break;
13728
+ case 2:
13729
+ message.availability = reader.int32();
13141
13730
  break;
13142
13731
  default:
13143
13732
  let u = options.readUnknownField;
@@ -13151,27 +13740,27 @@ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13151
13740
  return message;
13152
13741
  }
13153
13742
  internalBinaryWrite(message, writer, options) {
13154
- for (let i = 0;i < message.commands.length; i++)
13155
- BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13743
+ if (message.username !== "")
13744
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.username);
13745
+ if (message.availability !== 0)
13746
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.availability);
13156
13747
  let u = options.writeUnknownFields;
13157
13748
  if (u !== false)
13158
13749
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13159
13750
  return writer;
13160
13751
  }
13161
13752
  }
13162
- var GetBotCommandsResult = new GetBotCommandsResult$Type;
13753
+ var CheckUsernameResult = new CheckUsernameResult$Type;
13163
13754
 
13164
- class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13755
+ class ChangeUsernameInput$Type extends import_runtime4.MessageType {
13165
13756
  constructor() {
13166
- super("SetBotCommandsInput", [
13167
- { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
13168
- { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13757
+ super("ChangeUsernameInput", [
13758
+ { no: 1, name: "username", kind: "scalar", T: 9 }
13169
13759
  ]);
13170
13760
  }
13171
13761
  create(value) {
13172
13762
  const message = globalThis.Object.create(this.messagePrototype);
13173
- message.botUserId = 0n;
13174
- message.commands = [];
13763
+ message.username = "";
13175
13764
  if (value !== undefined)
13176
13765
  import_runtime3.reflectionMergePartial(this, message, value);
13177
13766
  return message;
@@ -13182,10 +13771,7 @@ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13182
13771
  let [fieldNo, wireType] = reader.tag();
13183
13772
  switch (fieldNo) {
13184
13773
  case 1:
13185
- message.botUserId = reader.int64().toBigInt();
13186
- break;
13187
- case 2:
13188
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13774
+ message.username = reader.string();
13189
13775
  break;
13190
13776
  default:
13191
13777
  let u = options.readUnknownField;
@@ -13199,27 +13785,26 @@ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13199
13785
  return message;
13200
13786
  }
13201
13787
  internalBinaryWrite(message, writer, options) {
13202
- if (message.botUserId !== 0n)
13203
- writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13204
- for (let i = 0;i < message.commands.length; i++)
13205
- BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13788
+ if (message.username !== "")
13789
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.username);
13206
13790
  let u = options.writeUnknownFields;
13207
13791
  if (u !== false)
13208
13792
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13209
13793
  return writer;
13210
13794
  }
13211
13795
  }
13212
- var SetBotCommandsInput = new SetBotCommandsInput$Type;
13796
+ var ChangeUsernameInput = new ChangeUsernameInput$Type;
13213
13797
 
13214
- class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13798
+ class ChangeUsernameResult$Type extends import_runtime4.MessageType {
13215
13799
  constructor() {
13216
- super("SetBotCommandsResult", [
13217
- { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13800
+ super("ChangeUsernameResult", [
13801
+ { no: 1, name: "user", kind: "message", T: () => User },
13802
+ { no: 2, name: "updates", kind: "message", repeat: 1, T: () => Update }
13218
13803
  ]);
13219
13804
  }
13220
13805
  create(value) {
13221
13806
  const message = globalThis.Object.create(this.messagePrototype);
13222
- message.commands = [];
13807
+ message.updates = [];
13223
13808
  if (value !== undefined)
13224
13809
  import_runtime3.reflectionMergePartial(this, message, value);
13225
13810
  return message;
@@ -13230,7 +13815,10 @@ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13230
13815
  let [fieldNo, wireType] = reader.tag();
13231
13816
  switch (fieldNo) {
13232
13817
  case 1:
13233
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13818
+ message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
13819
+ break;
13820
+ case 2:
13821
+ message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
13234
13822
  break;
13235
13823
  default:
13236
13824
  let u = options.readUnknownField;
@@ -13244,20 +13832,24 @@ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13244
13832
  return message;
13245
13833
  }
13246
13834
  internalBinaryWrite(message, writer, options) {
13247
- for (let i = 0;i < message.commands.length; i++)
13248
- BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13835
+ if (message.user)
13836
+ User.internalBinaryWrite(message.user, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13837
+ for (let i = 0;i < message.updates.length; i++)
13838
+ Update.internalBinaryWrite(message.updates[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13249
13839
  let u = options.writeUnknownFields;
13250
13840
  if (u !== false)
13251
13841
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13252
13842
  return writer;
13253
13843
  }
13254
13844
  }
13255
- var SetBotCommandsResult = new SetBotCommandsResult$Type;
13845
+ var ChangeUsernameResult = new ChangeUsernameResult$Type;
13256
13846
 
13257
- class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13847
+ class UpdateProfileInput$Type extends import_runtime4.MessageType {
13258
13848
  constructor() {
13259
- super("GetPeerBotCommandsInput", [
13260
- { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
13849
+ super("UpdateProfileInput", [
13850
+ { no: 1, name: "first_name", kind: "scalar", opt: true, T: 9 },
13851
+ { no: 2, name: "last_name", kind: "scalar", opt: true, T: 9 },
13852
+ { no: 3, name: "bio", kind: "scalar", opt: true, T: 9 }
13261
13853
  ]);
13262
13854
  }
13263
13855
  create(value) {
@@ -13272,7 +13864,13 @@ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13272
13864
  let [fieldNo, wireType] = reader.tag();
13273
13865
  switch (fieldNo) {
13274
13866
  case 1:
13275
- message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
13867
+ message.firstName = reader.string();
13868
+ break;
13869
+ case 2:
13870
+ message.lastName = reader.string();
13871
+ break;
13872
+ case 3:
13873
+ message.bio = reader.string();
13276
13874
  break;
13277
13875
  default:
13278
13876
  let u = options.readUnknownField;
@@ -13286,25 +13884,30 @@ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13286
13884
  return message;
13287
13885
  }
13288
13886
  internalBinaryWrite(message, writer, options) {
13289
- if (message.peerId)
13290
- InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13887
+ if (message.firstName !== undefined)
13888
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.firstName);
13889
+ if (message.lastName !== undefined)
13890
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.lastName);
13891
+ if (message.bio !== undefined)
13892
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.bio);
13291
13893
  let u = options.writeUnknownFields;
13292
13894
  if (u !== false)
13293
13895
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13294
13896
  return writer;
13295
13897
  }
13296
13898
  }
13297
- var GetPeerBotCommandsInput = new GetPeerBotCommandsInput$Type;
13899
+ var UpdateProfileInput = new UpdateProfileInput$Type;
13298
13900
 
13299
- class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13901
+ class UpdateProfileResult$Type extends import_runtime4.MessageType {
13300
13902
  constructor() {
13301
- super("GetPeerBotCommandsResult", [
13302
- { no: 1, name: "bots", kind: "message", repeat: 1, T: () => PeerBotCommands }
13903
+ super("UpdateProfileResult", [
13904
+ { no: 1, name: "user", kind: "message", T: () => User },
13905
+ { no: 2, name: "updates", kind: "message", repeat: 1, T: () => Update }
13303
13906
  ]);
13304
13907
  }
13305
13908
  create(value) {
13306
13909
  const message = globalThis.Object.create(this.messagePrototype);
13307
- message.bots = [];
13910
+ message.updates = [];
13308
13911
  if (value !== undefined)
13309
13912
  import_runtime3.reflectionMergePartial(this, message, value);
13310
13913
  return message;
@@ -13315,7 +13918,10 @@ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13315
13918
  let [fieldNo, wireType] = reader.tag();
13316
13919
  switch (fieldNo) {
13317
13920
  case 1:
13318
- message.bots.push(PeerBotCommands.internalBinaryRead(reader, reader.uint32(), options));
13921
+ message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
13922
+ break;
13923
+ case 2:
13924
+ message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
13319
13925
  break;
13320
13926
  default:
13321
13927
  let u = options.readUnknownField;
@@ -13329,25 +13935,30 @@ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13329
13935
  return message;
13330
13936
  }
13331
13937
  internalBinaryWrite(message, writer, options) {
13332
- for (let i = 0;i < message.bots.length; i++)
13333
- PeerBotCommands.internalBinaryWrite(message.bots[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13938
+ if (message.user)
13939
+ User.internalBinaryWrite(message.user, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13940
+ for (let i = 0;i < message.updates.length; i++)
13941
+ Update.internalBinaryWrite(message.updates[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13334
13942
  let u = options.writeUnknownFields;
13335
13943
  if (u !== false)
13336
13944
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13337
13945
  return writer;
13338
13946
  }
13339
13947
  }
13340
- var GetPeerBotCommandsResult = new GetPeerBotCommandsResult$Type;
13948
+ var UpdateProfileResult = new UpdateProfileResult$Type;
13341
13949
 
13342
- class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13950
+ class BotCommand$Type extends import_runtime4.MessageType {
13343
13951
  constructor() {
13344
- super("RevealBotTokenInput", [
13345
- { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13952
+ super("BotCommand", [
13953
+ { no: 1, name: "command", kind: "scalar", T: 9 },
13954
+ { no: 2, name: "description", kind: "scalar", T: 9 },
13955
+ { no: 3, name: "sort_order", kind: "scalar", opt: true, T: 5 }
13346
13956
  ]);
13347
13957
  }
13348
13958
  create(value) {
13349
13959
  const message = globalThis.Object.create(this.messagePrototype);
13350
- message.botUserId = 0n;
13960
+ message.command = "";
13961
+ message.description = "";
13351
13962
  if (value !== undefined)
13352
13963
  import_runtime3.reflectionMergePartial(this, message, value);
13353
13964
  return message;
@@ -13358,7 +13969,13 @@ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13358
13969
  let [fieldNo, wireType] = reader.tag();
13359
13970
  switch (fieldNo) {
13360
13971
  case 1:
13361
- message.botUserId = reader.int64().toBigInt();
13972
+ message.command = reader.string();
13973
+ break;
13974
+ case 2:
13975
+ message.description = reader.string();
13976
+ break;
13977
+ case 3:
13978
+ message.sortOrder = reader.int32();
13362
13979
  break;
13363
13980
  default:
13364
13981
  let u = options.readUnknownField;
@@ -13372,25 +13989,30 @@ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13372
13989
  return message;
13373
13990
  }
13374
13991
  internalBinaryWrite(message, writer, options) {
13375
- if (message.botUserId !== 0n)
13376
- writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13992
+ if (message.command !== "")
13993
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.command);
13994
+ if (message.description !== "")
13995
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.description);
13996
+ if (message.sortOrder !== undefined)
13997
+ writer.tag(3, import_runtime.WireType.Varint).int32(message.sortOrder);
13377
13998
  let u = options.writeUnknownFields;
13378
13999
  if (u !== false)
13379
14000
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13380
14001
  return writer;
13381
14002
  }
13382
14003
  }
13383
- var RevealBotTokenInput = new RevealBotTokenInput$Type;
14004
+ var BotCommand = new BotCommand$Type;
13384
14005
 
13385
- class RevealBotTokenResult$Type extends import_runtime4.MessageType {
14006
+ class PeerBotCommands$Type extends import_runtime4.MessageType {
13386
14007
  constructor() {
13387
- super("RevealBotTokenResult", [
13388
- { no: 1, name: "token", kind: "scalar", T: 9 }
14008
+ super("PeerBotCommands", [
14009
+ { no: 1, name: "bot", kind: "message", T: () => User },
14010
+ { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13389
14011
  ]);
13390
14012
  }
13391
14013
  create(value) {
13392
14014
  const message = globalThis.Object.create(this.messagePrototype);
13393
- message.token = "";
14015
+ message.commands = [];
13394
14016
  if (value !== undefined)
13395
14017
  import_runtime3.reflectionMergePartial(this, message, value);
13396
14018
  return message;
@@ -13401,7 +14023,10 @@ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13401
14023
  let [fieldNo, wireType] = reader.tag();
13402
14024
  switch (fieldNo) {
13403
14025
  case 1:
13404
- message.token = reader.string();
14026
+ message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
14027
+ break;
14028
+ case 2:
14029
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13405
14030
  break;
13406
14031
  default:
13407
14032
  let u = options.readUnknownField;
@@ -13415,19 +14040,371 @@ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13415
14040
  return message;
13416
14041
  }
13417
14042
  internalBinaryWrite(message, writer, options) {
13418
- if (message.token !== "")
13419
- writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
14043
+ if (message.bot)
14044
+ User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14045
+ for (let i = 0;i < message.commands.length; i++)
14046
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13420
14047
  let u = options.writeUnknownFields;
13421
14048
  if (u !== false)
13422
14049
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13423
14050
  return writer;
13424
14051
  }
13425
14052
  }
13426
- var RevealBotTokenResult = new RevealBotTokenResult$Type;
14053
+ var PeerBotCommands = new PeerBotCommands$Type;
13427
14054
 
13428
- class RotateBotTokenInput$Type extends import_runtime4.MessageType {
14055
+ class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13429
14056
  constructor() {
13430
- super("RotateBotTokenInput", [
14057
+ super("GetBotCommandsInput", [
14058
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
14059
+ ]);
14060
+ }
14061
+ create(value) {
14062
+ const message = globalThis.Object.create(this.messagePrototype);
14063
+ message.botUserId = 0n;
14064
+ if (value !== undefined)
14065
+ import_runtime3.reflectionMergePartial(this, message, value);
14066
+ return message;
14067
+ }
14068
+ internalBinaryRead(reader, length, options, target) {
14069
+ let message = target ?? this.create(), end = reader.pos + length;
14070
+ while (reader.pos < end) {
14071
+ let [fieldNo, wireType] = reader.tag();
14072
+ switch (fieldNo) {
14073
+ case 1:
14074
+ message.botUserId = reader.int64().toBigInt();
14075
+ break;
14076
+ default:
14077
+ let u = options.readUnknownField;
14078
+ if (u === "throw")
14079
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14080
+ let d = reader.skip(wireType);
14081
+ if (u !== false)
14082
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14083
+ }
14084
+ }
14085
+ return message;
14086
+ }
14087
+ internalBinaryWrite(message, writer, options) {
14088
+ if (message.botUserId !== 0n)
14089
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
14090
+ let u = options.writeUnknownFields;
14091
+ if (u !== false)
14092
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14093
+ return writer;
14094
+ }
14095
+ }
14096
+ var GetBotCommandsInput = new GetBotCommandsInput$Type;
14097
+
14098
+ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
14099
+ constructor() {
14100
+ super("GetBotCommandsResult", [
14101
+ { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
14102
+ ]);
14103
+ }
14104
+ create(value) {
14105
+ const message = globalThis.Object.create(this.messagePrototype);
14106
+ message.commands = [];
14107
+ if (value !== undefined)
14108
+ import_runtime3.reflectionMergePartial(this, message, value);
14109
+ return message;
14110
+ }
14111
+ internalBinaryRead(reader, length, options, target) {
14112
+ let message = target ?? this.create(), end = reader.pos + length;
14113
+ while (reader.pos < end) {
14114
+ let [fieldNo, wireType] = reader.tag();
14115
+ switch (fieldNo) {
14116
+ case 1:
14117
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
14118
+ break;
14119
+ default:
14120
+ let u = options.readUnknownField;
14121
+ if (u === "throw")
14122
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14123
+ let d = reader.skip(wireType);
14124
+ if (u !== false)
14125
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14126
+ }
14127
+ }
14128
+ return message;
14129
+ }
14130
+ internalBinaryWrite(message, writer, options) {
14131
+ for (let i = 0;i < message.commands.length; i++)
14132
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14133
+ let u = options.writeUnknownFields;
14134
+ if (u !== false)
14135
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14136
+ return writer;
14137
+ }
14138
+ }
14139
+ var GetBotCommandsResult = new GetBotCommandsResult$Type;
14140
+
14141
+ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
14142
+ constructor() {
14143
+ super("SetBotCommandsInput", [
14144
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
14145
+ { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
14146
+ ]);
14147
+ }
14148
+ create(value) {
14149
+ const message = globalThis.Object.create(this.messagePrototype);
14150
+ message.botUserId = 0n;
14151
+ message.commands = [];
14152
+ if (value !== undefined)
14153
+ import_runtime3.reflectionMergePartial(this, message, value);
14154
+ return message;
14155
+ }
14156
+ internalBinaryRead(reader, length, options, target) {
14157
+ let message = target ?? this.create(), end = reader.pos + length;
14158
+ while (reader.pos < end) {
14159
+ let [fieldNo, wireType] = reader.tag();
14160
+ switch (fieldNo) {
14161
+ case 1:
14162
+ message.botUserId = reader.int64().toBigInt();
14163
+ break;
14164
+ case 2:
14165
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
14166
+ break;
14167
+ default:
14168
+ let u = options.readUnknownField;
14169
+ if (u === "throw")
14170
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14171
+ let d = reader.skip(wireType);
14172
+ if (u !== false)
14173
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14174
+ }
14175
+ }
14176
+ return message;
14177
+ }
14178
+ internalBinaryWrite(message, writer, options) {
14179
+ if (message.botUserId !== 0n)
14180
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
14181
+ for (let i = 0;i < message.commands.length; i++)
14182
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
14183
+ let u = options.writeUnknownFields;
14184
+ if (u !== false)
14185
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14186
+ return writer;
14187
+ }
14188
+ }
14189
+ var SetBotCommandsInput = new SetBotCommandsInput$Type;
14190
+
14191
+ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
14192
+ constructor() {
14193
+ super("SetBotCommandsResult", [
14194
+ { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
14195
+ ]);
14196
+ }
14197
+ create(value) {
14198
+ const message = globalThis.Object.create(this.messagePrototype);
14199
+ message.commands = [];
14200
+ if (value !== undefined)
14201
+ import_runtime3.reflectionMergePartial(this, message, value);
14202
+ return message;
14203
+ }
14204
+ internalBinaryRead(reader, length, options, target) {
14205
+ let message = target ?? this.create(), end = reader.pos + length;
14206
+ while (reader.pos < end) {
14207
+ let [fieldNo, wireType] = reader.tag();
14208
+ switch (fieldNo) {
14209
+ case 1:
14210
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
14211
+ break;
14212
+ default:
14213
+ let u = options.readUnknownField;
14214
+ if (u === "throw")
14215
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14216
+ let d = reader.skip(wireType);
14217
+ if (u !== false)
14218
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14219
+ }
14220
+ }
14221
+ return message;
14222
+ }
14223
+ internalBinaryWrite(message, writer, options) {
14224
+ for (let i = 0;i < message.commands.length; i++)
14225
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14226
+ let u = options.writeUnknownFields;
14227
+ if (u !== false)
14228
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14229
+ return writer;
14230
+ }
14231
+ }
14232
+ var SetBotCommandsResult = new SetBotCommandsResult$Type;
14233
+
14234
+ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
14235
+ constructor() {
14236
+ super("GetPeerBotCommandsInput", [
14237
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
14238
+ ]);
14239
+ }
14240
+ create(value) {
14241
+ const message = globalThis.Object.create(this.messagePrototype);
14242
+ if (value !== undefined)
14243
+ import_runtime3.reflectionMergePartial(this, message, value);
14244
+ return message;
14245
+ }
14246
+ internalBinaryRead(reader, length, options, target) {
14247
+ let message = target ?? this.create(), end = reader.pos + length;
14248
+ while (reader.pos < end) {
14249
+ let [fieldNo, wireType] = reader.tag();
14250
+ switch (fieldNo) {
14251
+ case 1:
14252
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
14253
+ break;
14254
+ default:
14255
+ let u = options.readUnknownField;
14256
+ if (u === "throw")
14257
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14258
+ let d = reader.skip(wireType);
14259
+ if (u !== false)
14260
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14261
+ }
14262
+ }
14263
+ return message;
14264
+ }
14265
+ internalBinaryWrite(message, writer, options) {
14266
+ if (message.peerId)
14267
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14268
+ let u = options.writeUnknownFields;
14269
+ if (u !== false)
14270
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14271
+ return writer;
14272
+ }
14273
+ }
14274
+ var GetPeerBotCommandsInput = new GetPeerBotCommandsInput$Type;
14275
+
14276
+ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
14277
+ constructor() {
14278
+ super("GetPeerBotCommandsResult", [
14279
+ { no: 1, name: "bots", kind: "message", repeat: 1, T: () => PeerBotCommands }
14280
+ ]);
14281
+ }
14282
+ create(value) {
14283
+ const message = globalThis.Object.create(this.messagePrototype);
14284
+ message.bots = [];
14285
+ if (value !== undefined)
14286
+ import_runtime3.reflectionMergePartial(this, message, value);
14287
+ return message;
14288
+ }
14289
+ internalBinaryRead(reader, length, options, target) {
14290
+ let message = target ?? this.create(), end = reader.pos + length;
14291
+ while (reader.pos < end) {
14292
+ let [fieldNo, wireType] = reader.tag();
14293
+ switch (fieldNo) {
14294
+ case 1:
14295
+ message.bots.push(PeerBotCommands.internalBinaryRead(reader, reader.uint32(), options));
14296
+ break;
14297
+ default:
14298
+ let u = options.readUnknownField;
14299
+ if (u === "throw")
14300
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14301
+ let d = reader.skip(wireType);
14302
+ if (u !== false)
14303
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14304
+ }
14305
+ }
14306
+ return message;
14307
+ }
14308
+ internalBinaryWrite(message, writer, options) {
14309
+ for (let i = 0;i < message.bots.length; i++)
14310
+ PeerBotCommands.internalBinaryWrite(message.bots[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14311
+ let u = options.writeUnknownFields;
14312
+ if (u !== false)
14313
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14314
+ return writer;
14315
+ }
14316
+ }
14317
+ var GetPeerBotCommandsResult = new GetPeerBotCommandsResult$Type;
14318
+
14319
+ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
14320
+ constructor() {
14321
+ super("RevealBotTokenInput", [
14322
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
14323
+ ]);
14324
+ }
14325
+ create(value) {
14326
+ const message = globalThis.Object.create(this.messagePrototype);
14327
+ message.botUserId = 0n;
14328
+ if (value !== undefined)
14329
+ import_runtime3.reflectionMergePartial(this, message, value);
14330
+ return message;
14331
+ }
14332
+ internalBinaryRead(reader, length, options, target) {
14333
+ let message = target ?? this.create(), end = reader.pos + length;
14334
+ while (reader.pos < end) {
14335
+ let [fieldNo, wireType] = reader.tag();
14336
+ switch (fieldNo) {
14337
+ case 1:
14338
+ message.botUserId = reader.int64().toBigInt();
14339
+ break;
14340
+ default:
14341
+ let u = options.readUnknownField;
14342
+ if (u === "throw")
14343
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14344
+ let d = reader.skip(wireType);
14345
+ if (u !== false)
14346
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14347
+ }
14348
+ }
14349
+ return message;
14350
+ }
14351
+ internalBinaryWrite(message, writer, options) {
14352
+ if (message.botUserId !== 0n)
14353
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
14354
+ let u = options.writeUnknownFields;
14355
+ if (u !== false)
14356
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14357
+ return writer;
14358
+ }
14359
+ }
14360
+ var RevealBotTokenInput = new RevealBotTokenInput$Type;
14361
+
14362
+ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
14363
+ constructor() {
14364
+ super("RevealBotTokenResult", [
14365
+ { no: 1, name: "token", kind: "scalar", T: 9 }
14366
+ ]);
14367
+ }
14368
+ create(value) {
14369
+ const message = globalThis.Object.create(this.messagePrototype);
14370
+ message.token = "";
14371
+ if (value !== undefined)
14372
+ import_runtime3.reflectionMergePartial(this, message, value);
14373
+ return message;
14374
+ }
14375
+ internalBinaryRead(reader, length, options, target) {
14376
+ let message = target ?? this.create(), end = reader.pos + length;
14377
+ while (reader.pos < end) {
14378
+ let [fieldNo, wireType] = reader.tag();
14379
+ switch (fieldNo) {
14380
+ case 1:
14381
+ message.token = reader.string();
14382
+ break;
14383
+ default:
14384
+ let u = options.readUnknownField;
14385
+ if (u === "throw")
14386
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14387
+ let d = reader.skip(wireType);
14388
+ if (u !== false)
14389
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14390
+ }
14391
+ }
14392
+ return message;
14393
+ }
14394
+ internalBinaryWrite(message, writer, options) {
14395
+ if (message.token !== "")
14396
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
14397
+ let u = options.writeUnknownFields;
14398
+ if (u !== false)
14399
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14400
+ return writer;
14401
+ }
14402
+ }
14403
+ var RevealBotTokenResult = new RevealBotTokenResult$Type;
14404
+
14405
+ class RotateBotTokenInput$Type extends import_runtime4.MessageType {
14406
+ constructor() {
14407
+ super("RotateBotTokenInput", [
13431
14408
  { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13432
14409
  ]);
13433
14410
  }
@@ -17117,7 +18094,8 @@ class Update$Type extends import_runtime4.MessageType {
17117
18094
  { no: 36, name: "message_action_answered", kind: "message", oneof: "update", T: () => UpdateMessageActionAnswered },
17118
18095
  { no: 37, name: "clear_chat_history", kind: "message", oneof: "update", T: () => UpdateClearChatHistory },
17119
18096
  { no: 38, name: "bot_presence", kind: "message", oneof: "update", T: () => UpdateBotPresence },
17120
- { no: 39, name: "dialog_follow_mode", kind: "message", oneof: "update", T: () => UpdateDialogFollowMode }
18097
+ { no: 39, name: "dialog_follow_mode", kind: "message", oneof: "update", T: () => UpdateDialogFollowMode },
18098
+ { no: 40, name: "updated_user", kind: "message", oneof: "update", T: () => UpdateUpdatedUser }
17121
18099
  ]);
17122
18100
  }
17123
18101
  create(value) {
@@ -17354,6 +18332,12 @@ class Update$Type extends import_runtime4.MessageType {
17354
18332
  dialogFollowMode: UpdateDialogFollowMode.internalBinaryRead(reader, reader.uint32(), options, message.update.dialogFollowMode)
17355
18333
  };
17356
18334
  break;
18335
+ case 40:
18336
+ message.update = {
18337
+ oneofKind: "updatedUser",
18338
+ updatedUser: UpdateUpdatedUser.internalBinaryRead(reader, reader.uint32(), options, message.update.updatedUser)
18339
+ };
18340
+ break;
17357
18341
  default:
17358
18342
  let u = options.readUnknownField;
17359
18343
  if (u === "throw")
@@ -17442,6 +18426,8 @@ class Update$Type extends import_runtime4.MessageType {
17442
18426
  UpdateBotPresence.internalBinaryWrite(message.update.botPresence, writer.tag(38, import_runtime.WireType.LengthDelimited).fork(), options).join();
17443
18427
  if (message.update.oneofKind === "dialogFollowMode")
17444
18428
  UpdateDialogFollowMode.internalBinaryWrite(message.update.dialogFollowMode, writer.tag(39, import_runtime.WireType.LengthDelimited).fork(), options).join();
18429
+ if (message.update.oneofKind === "updatedUser")
18430
+ UpdateUpdatedUser.internalBinaryWrite(message.update.updatedUser, writer.tag(40, import_runtime.WireType.LengthDelimited).fork(), options).join();
17445
18431
  let u = options.writeUnknownFields;
17446
18432
  if (u !== false)
17447
18433
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -17912,6 +18898,48 @@ class UpdateUserSettings$Type extends import_runtime4.MessageType {
17912
18898
  }
17913
18899
  var UpdateUserSettings = new UpdateUserSettings$Type;
17914
18900
 
18901
+ class UpdateUpdatedUser$Type extends import_runtime4.MessageType {
18902
+ constructor() {
18903
+ super("UpdateUpdatedUser", [
18904
+ { no: 1, name: "user", kind: "message", T: () => User }
18905
+ ]);
18906
+ }
18907
+ create(value) {
18908
+ const message = globalThis.Object.create(this.messagePrototype);
18909
+ if (value !== undefined)
18910
+ import_runtime3.reflectionMergePartial(this, message, value);
18911
+ return message;
18912
+ }
18913
+ internalBinaryRead(reader, length, options, target) {
18914
+ let message = target ?? this.create(), end = reader.pos + length;
18915
+ while (reader.pos < end) {
18916
+ let [fieldNo, wireType] = reader.tag();
18917
+ switch (fieldNo) {
18918
+ case 1:
18919
+ message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
18920
+ break;
18921
+ default:
18922
+ let u = options.readUnknownField;
18923
+ if (u === "throw")
18924
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
18925
+ let d = reader.skip(wireType);
18926
+ if (u !== false)
18927
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
18928
+ }
18929
+ }
18930
+ return message;
18931
+ }
18932
+ internalBinaryWrite(message, writer, options) {
18933
+ if (message.user)
18934
+ User.internalBinaryWrite(message.user, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
18935
+ let u = options.writeUnknownFields;
18936
+ if (u !== false)
18937
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
18938
+ return writer;
18939
+ }
18940
+ }
18941
+ var UpdateUpdatedUser = new UpdateUpdatedUser$Type;
18942
+
17915
18943
  class UpdateSpaceMemberAdd$Type extends import_runtime4.MessageType {
17916
18944
  constructor() {
17917
18945
  super("UpdateSpaceMemberAdd", [
@@ -21376,9 +22404,17 @@ var rpcInputKindByMethod = {
21376
22404
  36: "rotateBotToken",
21377
22405
  37: "updateBotProfile",
21378
22406
  38: "getMessages",
22407
+ 56: "setBotAvatar",
22408
+ 57: "clearBotAvatar",
22409
+ 58: "getBotPresence",
22410
+ 59: "setBotPresenceState",
21379
22411
  48: "invokeMessageAction",
21380
22412
  49: "answerMessageAction",
21381
- 53: "clearChatHistory"
22413
+ 53: "clearChatHistory",
22414
+ 61: "getSessions",
22415
+ 62: "checkUsername",
22416
+ 63: "changeUsername",
22417
+ 64: "updateProfile"
21382
22418
  };
21383
22419
  var rpcResultKindByMethod = {
21384
22420
  0: undefined,
@@ -21420,9 +22456,17 @@ var rpcResultKindByMethod = {
21420
22456
  36: "rotateBotToken",
21421
22457
  37: "updateBotProfile",
21422
22458
  38: "getMessages",
22459
+ 56: "setBotAvatar",
22460
+ 57: "clearBotAvatar",
22461
+ 58: "getBotPresence",
22462
+ 59: "setBotPresenceState",
21423
22463
  48: "invokeMessageAction",
21424
22464
  49: "answerMessageAction",
21425
- 53: "clearChatHistory"
22465
+ 53: "clearChatHistory",
22466
+ 61: "getSessions",
22467
+ 62: "checkUsername",
22468
+ 63: "changeUsername",
22469
+ 64: "updateProfile"
21426
22470
  };
21427
22471
 
21428
22472
  // ../sdk/dist/sdk/logger.js
@@ -21472,6 +22516,26 @@ function extractFirstMessageId(updates) {
21472
22516
  }
21473
22517
  return null;
21474
22518
  }
22519
+ function botPresenceStateKind(kind) {
22520
+ switch (kind) {
22521
+ case "idle":
22522
+ return BotPresenceState_Kind.IDLE;
22523
+ case "happy":
22524
+ return BotPresenceState_Kind.HAPPY;
22525
+ case "waving":
22526
+ return BotPresenceState_Kind.WAVING;
22527
+ case "jumping":
22528
+ return BotPresenceState_Kind.JUMPING;
22529
+ case "failed":
22530
+ return BotPresenceState_Kind.FAILED;
22531
+ case "waiting":
22532
+ return BotPresenceState_Kind.WAITING;
22533
+ case "running":
22534
+ return BotPresenceState_Kind.RUNNING;
22535
+ case "review":
22536
+ return BotPresenceState_Kind.REVIEW;
22537
+ }
22538
+ }
21475
22539
 
21476
22540
  class InlineSdkClient {
21477
22541
  options;
@@ -21766,6 +22830,19 @@ class InlineSdkClient {
21766
22830
  }
21767
22831
  });
21768
22832
  }
22833
+ async setBotPresenceState(params) {
22834
+ const peerId = this.inputPeerFromTarget(params, "setBotPresenceState");
22835
+ await this.invoke(Method.SET_BOT_PRESENCE_STATE, {
22836
+ oneofKind: "setBotPresenceState",
22837
+ setBotPresenceState: {
22838
+ peerId,
22839
+ state: {
22840
+ kind: botPresenceStateKind(params.kind),
22841
+ ...params.comment ? { comment: params.comment } : {}
22842
+ }
22843
+ }
22844
+ });
22845
+ }
21769
22846
  async invokeMessageAction(params) {
21770
22847
  const peerId = this.inputPeerFromTarget(params, "invokeMessageAction");
21771
22848
  const actionId = params.actionId.trim();
@@ -21872,8 +22949,11 @@ class InlineSdkClient {
21872
22949
  oneofKind: "getUpdatesState",
21873
22950
  getUpdatesState: GetUpdatesStateInput.create({ date })
21874
22951
  }, { timeoutMs: 1500 });
21875
- this.state.dateCursor = result.getUpdatesState.date;
21876
- this.scheduleStateSave();
22952
+ const state = result.getUpdatesState;
22953
+ if (state.updatesFound === false) {
22954
+ this.state.dateCursor = state.date;
22955
+ this.scheduleStateSave();
22956
+ }
21877
22957
  } catch (error) {
21878
22958
  this.log.warn?.("GET_UPDATES_STATE failed (continuing without date cursor)", error);
21879
22959
  }
@@ -37289,6 +38369,7 @@ var InlineActionsSchema = exports_external.object({
37289
38369
  reactions: exports_external.boolean().optional(),
37290
38370
  read: exports_external.boolean().optional(),
37291
38371
  search: exports_external.boolean().optional(),
38372
+ translate: exports_external.boolean().optional(),
37292
38373
  edit: exports_external.boolean().optional(),
37293
38374
  channels: exports_external.boolean().optional(),
37294
38375
  participants: exports_external.boolean().optional(),
@@ -37412,6 +38493,8 @@ var InlineAccountSchemaBase = exports_external.object({
37412
38493
  dmHistoryLimit: exports_external.number().int().min(0).optional(),
37413
38494
  parseMarkdown: exports_external.boolean().optional(),
37414
38495
  mediaMaxMb: exports_external.number().positive().optional(),
38496
+ debounceMs: exports_external.number().int().min(0).optional(),
38497
+ voiceTranscriptWaitMs: exports_external.number().int().min(0).max(60000).optional(),
37415
38498
  actions: InlineActionsSchema.optional(),
37416
38499
  reactionNotifications: InlineReactionNotificationsSchema.optional(),
37417
38500
  reactionAllowlist: exports_external.array(InlineAllowEntrySchema).optional(),
@@ -37785,6 +38868,7 @@ var OPENCLAW_LEGACY_UNTRUSTED_RESULT_BEGIN = "<<<BEGIN_UNTRUSTED_CHILD_RESULT>>>
37785
38868
  var OPENCLAW_LEGACY_UNTRUSTED_RESULT_END = "<<<END_UNTRUSTED_CHILD_RESULT>>>";
37786
38869
  var INLINE_ACTION_LABEL_MAX_LENGTH = 64;
37787
38870
  var INLINE_ACTION_CALLBACK_DATA_MAX_BYTES = 1024;
38871
+ var INLINE_ACTION_COPY_TEXT_MAX_LENGTH = 4096;
37788
38872
  var utf8Encoder = new TextEncoder;
37789
38873
  function escapeRegExp(value) {
37790
38874
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -38003,6 +39087,14 @@ function sanitizeInlineActionCallbackData(raw) {
38003
39087
  return null;
38004
39088
  return text;
38005
39089
  }
39090
+ function sanitizeInlineActionCopyText(raw) {
39091
+ const text = raw?.trim();
39092
+ if (!text)
39093
+ return null;
39094
+ if (text.length > INLINE_ACTION_COPY_TEXT_MAX_LENGTH)
39095
+ return null;
39096
+ return text;
39097
+ }
38006
39098
 
38007
39099
  // src/inline/normalize.ts
38008
39100
  function normalizeInlineTarget(raw) {
@@ -38249,6 +39341,11 @@ var InlineBotPresenceToolParameters = {
38249
39341
  type: "object",
38250
39342
  additionalProperties: false,
38251
39343
  properties: {
39344
+ action: {
39345
+ type: "string",
39346
+ enum: ["set", "get"],
39347
+ description: "Presence operation. Defaults to `set`; use `get` to read the current bot avatar/state for a peer."
39348
+ },
38252
39349
  kind: {
38253
39350
  type: "string",
38254
39351
  enum: INLINE_BOT_PRESENCE_KINDS,
@@ -38279,9 +39376,10 @@ var InlineBotPresenceToolParameters = {
38279
39376
  type: "string",
38280
39377
  description: "Optional Inline account id override."
38281
39378
  }
38282
- },
38283
- required: ["kind"]
39379
+ }
38284
39380
  };
39381
+ var GET_BOT_PRESENCE_METHOD = typeof Method.GET_BOT_PRESENCE === "number" && Number.isInteger(Method.GET_BOT_PRESENCE) && Method.GET_BOT_PRESENCE > 0 ? Method.GET_BOT_PRESENCE : 58;
39382
+ var SET_BOT_PRESENCE_STATE_METHOD = typeof Method.SET_BOT_PRESENCE_STATE === "number" && Number.isInteger(Method.SET_BOT_PRESENCE_STATE) && Method.SET_BOT_PRESENCE_STATE > 0 ? Method.SET_BOT_PRESENCE_STATE : 59;
38285
39383
  function resolvePeerTarget(params) {
38286
39384
  if (params.direct) {
38287
39385
  return {
@@ -38373,7 +39471,15 @@ function normalizeInlineBotPresenceKind(value) {
38373
39471
  }
38374
39472
  throw new Error(`inline_bot_presence: invalid kind "${value}"`);
38375
39473
  }
38376
- function botPresenceStateKind(kind) {
39474
+ function resolveInlineBotPresenceAction(args) {
39475
+ const action = typeof args.action === "string" ? args.action.trim().toLowerCase() : "";
39476
+ if (!action || action === "set" || action === "update")
39477
+ return "set";
39478
+ if (action === "get" || action === "read" || action === "status")
39479
+ return "get";
39480
+ throw new Error(`inline_bot_presence: invalid action "${args.action}"`);
39481
+ }
39482
+ function botPresenceStateKind2(kind) {
38377
39483
  switch (kind) {
38378
39484
  case "idle":
38379
39485
  return BotPresenceState_Kind.IDLE;
@@ -38393,6 +39499,28 @@ function botPresenceStateKind(kind) {
38393
39499
  return BotPresenceState_Kind.REVIEW;
38394
39500
  }
38395
39501
  }
39502
+ function botPresenceKindFromState(kind) {
39503
+ switch (kind) {
39504
+ case BotPresenceState_Kind.IDLE:
39505
+ return "idle";
39506
+ case BotPresenceState_Kind.HAPPY:
39507
+ return "happy";
39508
+ case BotPresenceState_Kind.WAVING:
39509
+ return "waving";
39510
+ case BotPresenceState_Kind.JUMPING:
39511
+ return "jumping";
39512
+ case BotPresenceState_Kind.FAILED:
39513
+ return "failed";
39514
+ case BotPresenceState_Kind.WAITING:
39515
+ return "waiting";
39516
+ case BotPresenceState_Kind.RUNNING:
39517
+ return "running";
39518
+ case BotPresenceState_Kind.REVIEW:
39519
+ return "review";
39520
+ default:
39521
+ return null;
39522
+ }
39523
+ }
38396
39524
  function normalizeInlineBotPresenceComment(value) {
38397
39525
  if (typeof value !== "string")
38398
39526
  return;
@@ -38485,6 +39613,7 @@ function createInlineBotPresenceTool(ctx) {
38485
39613
  throw new Error("inline_bot_presence: missing OpenClaw config");
38486
39614
  }
38487
39615
  const args = rawArgs;
39616
+ const action = resolveInlineBotPresenceAction(args);
38488
39617
  const fallbackTarget = parseCurrentInlineTarget(ctx);
38489
39618
  const { target, usedFallback } = resolvePeerTarget({
38490
39619
  label: "target",
@@ -38493,24 +39622,56 @@ function createInlineBotPresenceTool(ctx) {
38493
39622
  userId: args.userId,
38494
39623
  fallback: fallbackTarget
38495
39624
  });
39625
+ if (action === "get") {
39626
+ return await withInlineClient({
39627
+ cfg: ctx.config,
39628
+ accountId: args.accountId ?? ctx.agentAccountId ?? null,
39629
+ fn: async (client, resolvedAccountId) => {
39630
+ const result = await client.invokeRaw(GET_BOT_PRESENCE_METHOD, {
39631
+ oneofKind: "getBotPresence",
39632
+ getBotPresence: {
39633
+ peerId: target.peerId
39634
+ }
39635
+ });
39636
+ if (result.oneofKind !== "getBotPresence") {
39637
+ throw new Error(`inline_bot_presence: expected getBotPresence result, got ${String(result.oneofKind)}`);
39638
+ }
39639
+ const state = result.getBotPresence.state ?? null;
39640
+ return jsonResult({
39641
+ ok: true,
39642
+ action,
39643
+ accountId: resolvedAccountId,
39644
+ target: target.normalized,
39645
+ usedCurrentChatDefault: usedFallback,
39646
+ botUserId: result.getBotPresence.botUserId != null ? String(result.getBotPresence.botUserId) : null,
39647
+ avatar: result.getBotPresence.avatar ?? null,
39648
+ state,
39649
+ kind: state ? botPresenceKindFromState(state.kind) : null,
39650
+ comment: typeof state?.comment === "string" ? state.comment : null,
39651
+ peerId: result.getBotPresence.peerId ?? null
39652
+ });
39653
+ }
39654
+ });
39655
+ }
38496
39656
  const kind = normalizeInlineBotPresenceKind(args.kind);
38497
39657
  const comment = normalizeInlineBotPresenceComment(args.comment);
38498
39658
  return await withInlineClient({
38499
39659
  cfg: ctx.config,
38500
39660
  accountId: args.accountId ?? ctx.agentAccountId ?? null,
38501
39661
  fn: async (client, resolvedAccountId) => {
38502
- await client.invokeRaw(Method.SET_BOT_PRESENCE_STATE, {
39662
+ await client.invokeRaw(SET_BOT_PRESENCE_STATE_METHOD, {
38503
39663
  oneofKind: "setBotPresenceState",
38504
39664
  setBotPresenceState: {
38505
39665
  peerId: target.peerId,
38506
39666
  state: {
38507
- kind: botPresenceStateKind(kind),
39667
+ kind: botPresenceStateKind2(kind),
38508
39668
  ...comment ? { comment } : {}
38509
39669
  }
38510
39670
  }
38511
39671
  });
38512
39672
  return jsonResult({
38513
39673
  ok: true,
39674
+ action,
38514
39675
  accountId: resolvedAccountId,
38515
39676
  target: target.normalized,
38516
39677
  usedCurrentChatDefault: usedFallback,
@@ -38645,7 +39806,11 @@ var InlineMembersToolParameters = {
38645
39806
  properties: {
38646
39807
  spaceId: {
38647
39808
  type: "string",
38648
- description: "Inline space id whose members should be listed."
39809
+ description: "Inline space id whose members should be listed. Optional inside an Inline space chat/reply thread."
39810
+ },
39811
+ space: {
39812
+ type: "string",
39813
+ description: "Alias for spaceId."
38649
39814
  },
38650
39815
  query: {
38651
39816
  type: "string",
@@ -38663,9 +39828,9 @@ var InlineMembersToolParameters = {
38663
39828
  type: "string",
38664
39829
  description: "Optional Inline account id override."
38665
39830
  }
38666
- },
38667
- required: ["spaceId"]
39831
+ }
38668
39832
  };
39833
+ var GET_CHAT_METHOD = typeof Method.GET_CHAT === "number" && Number.isInteger(Method.GET_CHAT) && Method.GET_CHAT > 0 ? Method.GET_CHAT : 25;
38669
39834
  function parseRequiredId(raw, label) {
38670
39835
  const trimmed = raw.trim();
38671
39836
  if (!trimmed) {
@@ -38676,6 +39841,11 @@ function parseRequiredId(raw, label) {
38676
39841
  }
38677
39842
  return BigInt(trimmed);
38678
39843
  }
39844
+ function parseOptionalId(raw, label) {
39845
+ if (raw == null || !raw.trim())
39846
+ return;
39847
+ return parseRequiredId(raw, label);
39848
+ }
38679
39849
  function resolveLimit(raw) {
38680
39850
  const parsed = typeof raw === "number" && Number.isFinite(raw) ? Math.trunc(raw) : 100;
38681
39851
  return Math.max(1, Math.min(200, parsed));
@@ -38726,6 +39896,70 @@ async function withInlineClient2(params) {
38726
39896
  await client.close().catch(() => {});
38727
39897
  }
38728
39898
  }
39899
+ function buildChatPeer(chatId) {
39900
+ return {
39901
+ type: {
39902
+ oneofKind: "chat",
39903
+ chat: { chatId }
39904
+ }
39905
+ };
39906
+ }
39907
+ async function loadChatSpaceId(params) {
39908
+ const result = await params.client.invokeRaw(GET_CHAT_METHOD, {
39909
+ oneofKind: "getChat",
39910
+ getChat: {
39911
+ peerId: buildChatPeer(params.chatId)
39912
+ }
39913
+ });
39914
+ if (result.oneofKind !== "getChat") {
39915
+ throw new Error(`inline_members: expected getChat result, got ${String(result.oneofKind)}`);
39916
+ }
39917
+ return result.getChat.chat?.spaceId ?? result.getChat.dialog?.spaceId;
39918
+ }
39919
+ async function resolveMembersSpaceId(params) {
39920
+ const explicitSpaceId = parseOptionalId(params.args.spaceId?.trim() ? params.args.spaceId : params.args.space, "spaceId");
39921
+ if (explicitSpaceId != null) {
39922
+ return {
39923
+ spaceId: explicitSpaceId,
39924
+ inferred: false,
39925
+ source: "explicit",
39926
+ chatId: null
39927
+ };
39928
+ }
39929
+ const session = parseCurrentInlineSession(params.ctx);
39930
+ const peer = session?.target.peerId.type;
39931
+ if (peer?.oneofKind !== "chat") {
39932
+ throw new Error("inline_members: spaceId is required outside an Inline space chat or reply thread");
39933
+ }
39934
+ const currentChatId = peer.chat.chatId;
39935
+ const currentSpaceId = await loadChatSpaceId({
39936
+ client: params.client,
39937
+ chatId: currentChatId
39938
+ });
39939
+ if (currentSpaceId != null) {
39940
+ return {
39941
+ spaceId: currentSpaceId,
39942
+ inferred: true,
39943
+ source: "current-chat",
39944
+ chatId: String(currentChatId)
39945
+ };
39946
+ }
39947
+ if (session?.parentChatId != null && session.parentChatId !== currentChatId) {
39948
+ const parentSpaceId = await loadChatSpaceId({
39949
+ client: params.client,
39950
+ chatId: session.parentChatId
39951
+ });
39952
+ if (parentSpaceId != null) {
39953
+ return {
39954
+ spaceId: parentSpaceId,
39955
+ inferred: true,
39956
+ source: "parent-chat",
39957
+ chatId: String(session.parentChatId)
39958
+ };
39959
+ }
39960
+ }
39961
+ throw new Error("inline_members: current Inline chat is not part of a space; pass spaceId explicitly");
39962
+ }
38729
39963
  function createInlineMembersTool(ctx) {
38730
39964
  if (!ctx.config) {
38731
39965
  return null;
@@ -38733,20 +39967,24 @@ function createInlineMembersTool(ctx) {
38733
39967
  return {
38734
39968
  name: "inline_members",
38735
39969
  label: "Inline Members",
38736
- description: "List or search Inline space members by space id so the agent can identify who to DM or manage.",
39970
+ description: "List or search Inline space members by space id, or infer the current space when invoked from an Inline space chat/reply thread.",
38737
39971
  parameters: InlineMembersToolParameters,
38738
39972
  execute: async (_toolCallId, rawArgs) => {
38739
39973
  const args = rawArgs;
38740
- const spaceId = parseRequiredId(args.spaceId, "spaceId");
38741
39974
  const userId = args.userId ? parseRequiredId(args.userId, "userId") : undefined;
38742
39975
  const limit = resolveLimit(args.limit);
38743
39976
  return await withInlineClient2({
38744
39977
  cfg: ctx.config,
38745
39978
  accountId: args.accountId ?? ctx.agentAccountId ?? null,
38746
39979
  fn: async (client, resolvedAccountId) => {
39980
+ const resolvedSpace = await resolveMembersSpaceId({
39981
+ args,
39982
+ client,
39983
+ ctx
39984
+ });
38747
39985
  const members = await getSpaceMembersWithUsers({
38748
39986
  client,
38749
- spaceId
39987
+ spaceId: resolvedSpace.spaceId
38750
39988
  });
38751
39989
  const filteredMembers = filterSpaceMembers({
38752
39990
  members,
@@ -38757,7 +39995,10 @@ function createInlineMembersTool(ctx) {
38757
39995
  return jsonResult2({
38758
39996
  ok: true,
38759
39997
  accountId: resolvedAccountId,
38760
- spaceId: String(spaceId),
39998
+ spaceId: String(resolvedSpace.spaceId),
39999
+ inferredSpaceId: resolvedSpace.inferred,
40000
+ spaceIdSource: resolvedSpace.source,
40001
+ sourceChatId: resolvedSpace.chatId,
38761
40002
  query: args.query ?? null,
38762
40003
  userId: userId != null ? String(userId) : null,
38763
40004
  count: filteredMembers.length,
@@ -38950,7 +40191,8 @@ function messageAttachmentSummaries(message) {
38950
40191
  const previewPhoto = preview.photo ? bestPhotoSize(preview.photo).cdnUrl : null;
38951
40192
  attachments.push({
38952
40193
  kind: "urlPreview",
38953
- id: preview.id?.toString() ?? null,
40194
+ id: item.id?.toString() ?? null,
40195
+ urlPreviewId: preview.id?.toString() ?? null,
38954
40196
  url: preview.url ?? null,
38955
40197
  siteName: preview.siteName ?? null,
38956
40198
  title: preview.title ?? null,
@@ -38963,7 +40205,8 @@ function messageAttachmentSummaries(message) {
38963
40205
  const task = item.attachment.externalTask;
38964
40206
  attachments.push({
38965
40207
  kind: "externalTask",
38966
- id: task.id?.toString() ?? null,
40208
+ id: item.id?.toString() ?? null,
40209
+ externalTaskId: task.id?.toString() ?? null,
38967
40210
  url: task.url ?? null,
38968
40211
  application: task.application ?? null,
38969
40212
  title: task.title ?? null,
@@ -39193,11 +40436,11 @@ function summarizeInlineMessageContent(message) {
39193
40436
  }
39194
40437
 
39195
40438
  // src/inline/reply-threads.ts
39196
- var GET_CHAT_METHOD = typeof Method.GET_CHAT === "number" && Number.isInteger(Method.GET_CHAT) && Method.GET_CHAT > 0 ? Method.GET_CHAT : 25;
40439
+ var GET_CHAT_METHOD2 = typeof Method.GET_CHAT === "number" && Number.isInteger(Method.GET_CHAT) && Method.GET_CHAT > 0 ? Method.GET_CHAT : 25;
39197
40440
  var GET_CHAT_HISTORY_METHOD = typeof Method.GET_CHAT_HISTORY === "number" && Number.isInteger(Method.GET_CHAT_HISTORY) && Method.GET_CHAT_HISTORY > 0 ? Method.GET_CHAT_HISTORY : 5;
39198
40441
  var GET_MESSAGES_METHOD = typeof Method.GET_MESSAGES === "number" && Number.isInteger(Method.GET_MESSAGES) && Method.GET_MESSAGES > 0 ? Method.GET_MESSAGES : 38;
39199
40442
  var CREATE_SUBTHREAD_METHOD = typeof Method.CREATE_SUBTHREAD === "number" && Number.isInteger(Method.CREATE_SUBTHREAD) && Method.CREATE_SUBTHREAD > 0 ? Method.CREATE_SUBTHREAD : 42;
39200
- function buildChatPeer(chatId) {
40443
+ function buildChatPeer2(chatId) {
39201
40444
  return {
39202
40445
  type: {
39203
40446
  oneofKind: "chat",
@@ -39230,9 +40473,9 @@ function resolveInlineReplyThreadChatId(params) {
39230
40473
  return normalized ?? params.parentChatId;
39231
40474
  }
39232
40475
  async function loadInlineReplyThreadMetadata(params) {
39233
- const result = await params.client.invokeRaw(GET_CHAT_METHOD, {
40476
+ const result = await params.client.invokeRaw(GET_CHAT_METHOD2, {
39234
40477
  oneofKind: "getChat",
39235
- getChat: { peerId: buildChatPeer(params.chatId) }
40478
+ getChat: { peerId: buildChatPeer2(params.chatId) }
39236
40479
  }).catch(() => null);
39237
40480
  if (result?.oneofKind !== "getChat") {
39238
40481
  return null;
@@ -39253,7 +40496,7 @@ async function loadInlineReplyThreadAnchorMessage(params) {
39253
40496
  const directResult = await params.client.invokeRaw(GET_MESSAGES_METHOD, {
39254
40497
  oneofKind: "getMessages",
39255
40498
  getMessages: {
39256
- peerId: buildChatPeer(params.parentChatId),
40499
+ peerId: buildChatPeer2(params.parentChatId),
39257
40500
  messageIds: [params.parentMessageId]
39258
40501
  }
39259
40502
  }).catch(() => null);
@@ -39266,7 +40509,7 @@ async function loadInlineReplyThreadAnchorMessage(params) {
39266
40509
  const historyResult = await params.client.invokeRaw(GET_CHAT_HISTORY_METHOD, {
39267
40510
  oneofKind: "getChatHistory",
39268
40511
  getChatHistory: {
39269
- peerId: buildChatPeer(params.parentChatId),
40512
+ peerId: buildChatPeer2(params.parentChatId),
39270
40513
  offsetId: params.parentMessageId + 1n,
39271
40514
  limit: 8
39272
40515
  }
@@ -39303,6 +40546,10 @@ async function createInlineReplyThreadForMessage(params) {
39303
40546
 
39304
40547
  // src/inline/parent-context-tool.ts
39305
40548
  var GET_CHAT_HISTORY_METHOD2 = typeof Method.GET_CHAT_HISTORY === "number" && Number.isInteger(Method.GET_CHAT_HISTORY) && Method.GET_CHAT_HISTORY > 0 ? Method.GET_CHAT_HISTORY : 5;
40549
+ var HISTORY_MODE_LATEST = 1;
40550
+ var HISTORY_MODE_OLDER = 2;
40551
+ var HISTORY_MODE_NEWER = 3;
40552
+ var HISTORY_MODE_AROUND = 4;
39306
40553
  var InlineParentContextToolParameters = {
39307
40554
  type: "object",
39308
40555
  additionalProperties: false,
@@ -39331,10 +40578,39 @@ var InlineParentContextToolParameters = {
39331
40578
  type: "string",
39332
40579
  description: "Optional message id to page older parent-chat context before. Defaults to the reply-thread anchor when known."
39333
40580
  },
40581
+ afterMessageId: {
40582
+ type: "string",
40583
+ description: "Optional message id to page newer parent-chat context after."
40584
+ },
40585
+ messageId: {
40586
+ type: "string",
40587
+ description: "Optional parent-chat message id to fetch context around."
40588
+ },
40589
+ aroundMessageId: {
40590
+ type: "string",
40591
+ description: "Alias for `messageId` when fetching context around a parent-chat message."
40592
+ },
40593
+ aroundId: {
40594
+ type: "string",
40595
+ description: "Alias for `messageId`."
40596
+ },
40597
+ mode: {
40598
+ type: "string",
40599
+ enum: ["latest", "older", "newer", "around"],
40600
+ description: "Optional history mode. Defaults to around the reply-thread anchor when known, otherwise latest; explicit ids infer older/newer/around."
40601
+ },
39334
40602
  limit: {
39335
40603
  type: "number",
39336
40604
  description: "Number of parent-chat messages to return, clamped to 1..100. Defaults to 50."
39337
40605
  },
40606
+ beforeLimit: {
40607
+ type: "number",
40608
+ description: "Around mode count for messages before the anchor, clamped to 0..100."
40609
+ },
40610
+ afterLimit: {
40611
+ type: "number",
40612
+ description: "Around mode count for messages after the anchor, clamped to 0..100."
40613
+ },
39338
40614
  includeAnchor: {
39339
40615
  type: "boolean",
39340
40616
  description: "Whether to include the reply-thread anchor/root message when parentMessageId is known. Defaults to true."
@@ -39345,7 +40621,7 @@ var InlineParentContextToolParameters = {
39345
40621
  }
39346
40622
  }
39347
40623
  };
39348
- function buildChatPeer2(chatId) {
40624
+ function buildChatPeer3(chatId) {
39349
40625
  return {
39350
40626
  type: {
39351
40627
  oneofKind: "chat",
@@ -39362,6 +40638,38 @@ function readLimit(raw, fallback) {
39362
40638
  }
39363
40639
  return Math.max(1, Math.min(100, value));
39364
40640
  }
40641
+ function readWindowLimit(raw, label) {
40642
+ if (raw == null)
40643
+ return;
40644
+ const value = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw.trim()) : Number.NaN;
40645
+ if (!Number.isFinite(value) || !Number.isInteger(value)) {
40646
+ throw new Error(`inline_parent_context: ${label} must be an integer`);
40647
+ }
40648
+ return Math.max(0, Math.min(100, value));
40649
+ }
40650
+ function readMode(raw) {
40651
+ if (raw == null)
40652
+ return null;
40653
+ if (typeof raw !== "string") {
40654
+ throw new Error("inline_parent_context: mode must be latest, older, newer, or around");
40655
+ }
40656
+ switch (raw.trim().toLowerCase()) {
40657
+ case "":
40658
+ return null;
40659
+ case "latest":
40660
+ return "latest";
40661
+ case "older":
40662
+ case "before":
40663
+ return "older";
40664
+ case "newer":
40665
+ case "after":
40666
+ return "newer";
40667
+ case "around":
40668
+ return "around";
40669
+ default:
40670
+ throw new Error("inline_parent_context: mode must be latest, older, newer, or around");
40671
+ }
40672
+ }
39365
40673
  function readIdCandidate(...values) {
39366
40674
  for (const value of values) {
39367
40675
  if (value == null)
@@ -39391,7 +40699,7 @@ function parseOptionalChatId(raw, label) {
39391
40699
  }
39392
40700
  return parseOptionalInlineId(raw, label);
39393
40701
  }
39394
- function mapContextMessage(message, parentMessageId) {
40702
+ function mapContextMessage(message, anchorMessageId) {
39395
40703
  const content = summarizeInlineMessageContent(message);
39396
40704
  return {
39397
40705
  id: String(message.id),
@@ -39403,7 +40711,7 @@ function mapContextMessage(message, parentMessageId) {
39403
40711
  entityText: content.entityText,
39404
40712
  out: Boolean(message.out),
39405
40713
  replyToId: message.replyToMsgId != null ? String(message.replyToMsgId) : undefined,
39406
- isAnchor: parentMessageId != null && message.id === parentMessageId,
40714
+ isAnchor: anchorMessageId != null && message.id === anchorMessageId,
39407
40715
  attachmentUrls: content.attachmentUrls,
39408
40716
  links: content.links,
39409
40717
  media: content.media,
@@ -39421,21 +40729,6 @@ function sortMessages(messages) {
39421
40729
  return a.id < b.id ? -1 : 1;
39422
40730
  });
39423
40731
  }
39424
- function messageDedupeKey(message) {
39425
- return `${String(message.id)}:${String(message.date)}`;
39426
- }
39427
- function dedupeMessages(messages) {
39428
- const seen = new Set;
39429
- const out = [];
39430
- for (const message of messages) {
39431
- const key = messageDedupeKey(message);
39432
- if (seen.has(key))
39433
- continue;
39434
- seen.add(key);
39435
- out.push(message);
39436
- }
39437
- return out;
39438
- }
39439
40732
  async function withInlineClient3(params) {
39440
40733
  const account = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId ?? null });
39441
40734
  if (!account.configured || !account.baseUrl) {
@@ -39454,14 +40747,13 @@ async function withInlineClient3(params) {
39454
40747
  }
39455
40748
  }
39456
40749
  async function loadParentHistory(params) {
39457
- if (params.limit <= 0)
40750
+ if (params.input.limit <= 0)
39458
40751
  return [];
39459
40752
  const result = await params.client.invokeRaw(GET_CHAT_HISTORY_METHOD2, {
39460
40753
  oneofKind: "getChatHistory",
39461
40754
  getChatHistory: {
39462
- peerId: buildChatPeer2(params.parentChatId),
39463
- ...params.offsetId != null ? { offsetId: params.offsetId } : {},
39464
- limit: params.limit
40755
+ peerId: buildChatPeer3(params.parentChatId),
40756
+ ...params.input
39465
40757
  }
39466
40758
  });
39467
40759
  if (result.oneofKind !== "getChatHistory") {
@@ -39469,36 +40761,96 @@ async function loadParentHistory(params) {
39469
40761
  }
39470
40762
  return result.getChatHistory.messages ?? [];
39471
40763
  }
39472
- async function loadParentContextMessages(params) {
39473
- if (params.beforeMessageId != null) {
39474
- return sortMessages(await loadParentHistory({
39475
- client: params.client,
39476
- parentChatId: params.parentChatId,
39477
- offsetId: params.beforeMessageId,
39478
- limit: params.limit
39479
- }));
40764
+ function resolveParentContextHistoryRequest(params) {
40765
+ if (params.aroundMessageId != null && (params.beforeMessageId != null || params.afterMessageId != null)) {
40766
+ throw new Error("inline_parent_context: messageId/aroundMessageId cannot be combined with before or after");
39480
40767
  }
39481
- if (params.parentMessageId == null) {
39482
- return sortMessages(await loadParentHistory({
39483
- client: params.client,
39484
- parentChatId: params.parentChatId,
39485
- offsetId: null,
39486
- limit: params.limit
39487
- }));
40768
+ if (params.beforeMessageId != null && params.afterMessageId != null) {
40769
+ throw new Error("inline_parent_context: pass only one of beforeMessageId or afterMessageId");
39488
40770
  }
39489
- const anchor = params.includeAnchor ? await loadInlineReplyThreadAnchorMessage({
39490
- client: params.client,
39491
- parentChatId: params.parentChatId,
39492
- parentMessageId: params.parentMessageId
39493
- }) : null;
39494
- const historyLimit = Math.max(0, params.limit - (anchor ? 1 : 0));
39495
- const history = await loadParentHistory({
39496
- client: params.client,
39497
- parentChatId: params.parentChatId,
39498
- offsetId: params.parentMessageId,
39499
- limit: historyLimit
39500
- });
39501
- return sortMessages(dedupeMessages([...history, ...anchor ? [anchor] : []]));
40771
+ const mode = params.explicitMode ?? (params.aroundMessageId != null ? "around" : params.afterMessageId != null ? "newer" : params.beforeMessageId != null ? "older" : params.parentMessageId != null ? "around" : "latest");
40772
+ if (mode !== "around" && (params.beforeLimit !== undefined || params.afterLimit !== undefined)) {
40773
+ throw new Error("inline_parent_context: beforeLimit and afterLimit are only valid with around mode");
40774
+ }
40775
+ if (mode === "latest") {
40776
+ if (params.aroundMessageId != null || params.beforeMessageId != null || params.afterMessageId != null) {
40777
+ throw new Error("inline_parent_context: latest mode cannot be combined with message cursors");
40778
+ }
40779
+ return {
40780
+ mode,
40781
+ input: {
40782
+ mode: HISTORY_MODE_LATEST,
40783
+ limit: params.limit
40784
+ },
40785
+ anchorMessageId: null,
40786
+ beforeMessageId: null,
40787
+ afterMessageId: null,
40788
+ beforeLimit: null,
40789
+ afterLimit: null
40790
+ };
40791
+ }
40792
+ if (mode === "newer") {
40793
+ if (params.afterMessageId == null) {
40794
+ throw new Error("inline_parent_context: newer mode requires afterMessageId");
40795
+ }
40796
+ return {
40797
+ mode,
40798
+ input: {
40799
+ mode: HISTORY_MODE_NEWER,
40800
+ afterId: params.afterMessageId,
40801
+ limit: params.limit
40802
+ },
40803
+ anchorMessageId: null,
40804
+ beforeMessageId: null,
40805
+ afterMessageId: params.afterMessageId,
40806
+ beforeLimit: null,
40807
+ afterLimit: null
40808
+ };
40809
+ }
40810
+ if (mode === "older") {
40811
+ const beforeMessageId = params.beforeMessageId ?? params.parentMessageId;
40812
+ if (beforeMessageId == null) {
40813
+ throw new Error("inline_parent_context: older mode requires beforeMessageId outside a known reply thread");
40814
+ }
40815
+ return {
40816
+ mode,
40817
+ input: {
40818
+ mode: HISTORY_MODE_OLDER,
40819
+ beforeId: beforeMessageId,
40820
+ offsetId: beforeMessageId,
40821
+ limit: params.limit
40822
+ },
40823
+ anchorMessageId: null,
40824
+ beforeMessageId,
40825
+ afterMessageId: null,
40826
+ beforeLimit: null,
40827
+ afterLimit: null
40828
+ };
40829
+ }
40830
+ const anchorMessageId = params.aroundMessageId ?? params.parentMessageId;
40831
+ if (anchorMessageId == null) {
40832
+ throw new Error("inline_parent_context: around mode requires messageId outside a known reply thread");
40833
+ }
40834
+ const defaultBeforeLimit = params.aroundMessageId == null && params.parentMessageId != null ? Math.max(0, params.limit - (params.includeAnchor ? 1 : 0)) : undefined;
40835
+ const defaultAfterLimit = params.aroundMessageId == null && params.parentMessageId != null ? 0 : undefined;
40836
+ const beforeLimit = params.beforeLimit ?? defaultBeforeLimit;
40837
+ const afterLimit = params.afterLimit ?? defaultAfterLimit;
40838
+ return {
40839
+ mode,
40840
+ input: {
40841
+ mode: HISTORY_MODE_AROUND,
40842
+ anchorId: anchorMessageId,
40843
+ limit: params.limit,
40844
+ ...beforeLimit !== undefined ? { beforeLimit } : {},
40845
+ ...afterLimit !== undefined ? { afterLimit } : {},
40846
+ includeAnchor: params.includeAnchor
40847
+ },
40848
+ anchorMessageId,
40849
+ beforeMessageId: null,
40850
+ afterMessageId: null,
40851
+ beforeLimit: beforeLimit ?? null,
40852
+ afterLimit: afterLimit ?? null
40853
+ };
39502
40854
  }
39503
40855
  function createInlineParentContextTool(ctx) {
39504
40856
  if (!ctx.config)
@@ -39516,7 +40868,12 @@ function createInlineParentContextTool(ctx) {
39516
40868
  let parentChatId = parseOptionalChatId(readIdCandidate(args.parentChatId, args.chatId), "parentChatId") ?? currentSession?.parentChatId ?? null;
39517
40869
  let parentMessageId = parseOptionalInlineId(readIdCandidate(args.parentMessageId, args.anchorMessageId), "parentMessageId");
39518
40870
  const beforeMessageId = parseOptionalInlineId(readIdCandidate(args.beforeMessageId), "beforeMessageId");
40871
+ const afterMessageId = parseOptionalInlineId(readIdCandidate(args.afterMessageId), "afterMessageId");
40872
+ const aroundMessageId = parseOptionalInlineId(readIdCandidate(args.messageId, args.aroundMessageId, args.aroundId), "messageId");
40873
+ const explicitMode = readMode(args.mode);
39519
40874
  const limit = readLimit(args.limit, 50);
40875
+ const beforeLimit = readWindowLimit(args.beforeLimit, "beforeLimit");
40876
+ const afterLimit = readWindowLimit(args.afterLimit, "afterLimit");
39520
40877
  const includeAnchor = args.includeAnchor !== false;
39521
40878
  return await withInlineClient3({
39522
40879
  cfg: ctx.config,
@@ -39532,15 +40889,24 @@ function createInlineParentContextTool(ctx) {
39532
40889
  if (parentChatId == null) {
39533
40890
  throw new Error("inline_parent_context: parentChatId is required outside an Inline reply-thread session");
39534
40891
  }
39535
- const messages = (await loadParentContextMessages({
39536
- client,
39537
- parentChatId,
40892
+ const history = resolveParentContextHistoryRequest({
39538
40893
  parentMessageId,
39539
40894
  beforeMessageId,
40895
+ afterMessageId,
40896
+ aroundMessageId,
40897
+ explicitMode,
39540
40898
  includeAnchor,
39541
- limit
39542
- })).map((message) => mapContextMessage(message, parentMessageId));
40899
+ limit,
40900
+ ...beforeLimit !== undefined ? { beforeLimit } : {},
40901
+ ...afterLimit !== undefined ? { afterLimit } : {}
40902
+ });
40903
+ const messages = sortMessages(await loadParentHistory({
40904
+ client,
40905
+ parentChatId,
40906
+ input: history.input
40907
+ })).map((message) => mapContextMessage(message, history.anchorMessageId));
39543
40908
  const oldest = messages[0];
40909
+ const newest = messages[messages.length - 1];
39544
40910
  return jsonResult({
39545
40911
  ok: true,
39546
40912
  accountId: resolvedAccountId,
@@ -39548,10 +40914,17 @@ function createInlineParentContextTool(ctx) {
39548
40914
  threadId: threadId != null ? String(threadId) : null,
39549
40915
  threadTitle,
39550
40916
  parentMessageId: parentMessageId != null ? String(parentMessageId) : null,
40917
+ mode: history.mode,
40918
+ beforeMessageId: history.beforeMessageId != null ? String(history.beforeMessageId) : null,
40919
+ afterMessageId: history.afterMessageId != null ? String(history.afterMessageId) : null,
40920
+ aroundMessageId: history.anchorMessageId != null ? String(history.anchorMessageId) : null,
40921
+ beforeLimit: history.beforeLimit,
40922
+ afterLimit: history.afterLimit,
39551
40923
  limit,
39552
40924
  includeAnchor,
39553
40925
  usedCurrentThreadDefault: explicitThreadId == null && currentSession?.threadId != null,
39554
40926
  nextBeforeMessageId: oldest?.id ?? null,
40927
+ nextAfterMessageId: newest?.id ?? null,
39555
40928
  messages
39556
40929
  });
39557
40930
  }
@@ -39588,10 +40961,21 @@ var ZIP_METHOD_STORE = 0;
39588
40961
  var ZIP_METHOD_DEFLATE = 8;
39589
40962
  var ZIP_FLAG_ENCRYPTED = 1;
39590
40963
  var CODEX_ATLAS_KIND = "codex_atlas";
40964
+ var SET_BOT_AVATAR_METHOD = typeof Method.SET_BOT_AVATAR === "number" && Number.isInteger(Method.SET_BOT_AVATAR) && Method.SET_BOT_AVATAR > 0 ? Method.SET_BOT_AVATAR : 56;
40965
+ var CLEAR_BOT_AVATAR_METHOD = typeof Method.CLEAR_BOT_AVATAR === "number" && Number.isInteger(Method.CLEAR_BOT_AVATAR) && Method.CLEAR_BOT_AVATAR > 0 ? Method.CLEAR_BOT_AVATAR : 57;
39591
40966
  var InlineBotAvatarToolParameters = {
39592
40967
  type: "object",
39593
40968
  additionalProperties: false,
39594
40969
  properties: {
40970
+ action: {
40971
+ type: "string",
40972
+ enum: ["set", "clear"],
40973
+ description: "Avatar operation. Defaults to `set`; use `clear` to remove the current bot avatar."
40974
+ },
40975
+ clear: {
40976
+ type: "boolean",
40977
+ description: "Boolean alias for action: clear."
40978
+ },
39595
40979
  zipPath: {
39596
40980
  type: "string",
39597
40981
  description: "Local path to a .zip avatar package. The archive should contain a Codex atlas manifest and a PNG/WebP spritesheet."
@@ -39649,6 +41033,21 @@ function resolvePackageSource(args) {
39649
41033
  }
39650
41034
  return source;
39651
41035
  }
41036
+ function resolveAvatarAction(args) {
41037
+ if (args.clear === true)
41038
+ return "clear";
41039
+ const action = readTrimmedString(args.action)?.toLowerCase();
41040
+ if (!action || action === "set" || action === "install" || action === "replace")
41041
+ return "set";
41042
+ if (action === "clear" || action === "remove" || action === "delete")
41043
+ return "clear";
41044
+ throw new Error(`inline_bot_avatar: invalid action "${args.action}"`);
41045
+ }
41046
+ function assertClearArgs(args) {
41047
+ if (readTrimmedString(args.zipPath) || readTrimmedString(args.archivePath) || readTrimmedString(args.zipUrl) || readTrimmedString(args.source) || readTrimmedString(args.displayName) || readTrimmedString(args.description)) {
41048
+ throw new Error("inline_bot_avatar: clear action must not include avatar package or display metadata");
41049
+ }
41050
+ }
39652
41051
  function sourceWithoutQuery(raw) {
39653
41052
  return raw.split(/[?#]/, 1)[0] ?? raw;
39654
41053
  }
@@ -39877,10 +41276,39 @@ function createInlineBotAvatarTool(ctx) {
39877
41276
  return {
39878
41277
  name: "inline_bot_avatar",
39879
41278
  label: "Bot Avatar",
39880
- description: "Upload or replace the authenticated Inline bot's on-screen avatar from a user-provided Codex atlas zip package. Use only when the user explicitly asks to install or change your avatar.",
41279
+ description: "Install, replace, or clear the authenticated Inline bot's on-screen avatar. Zip package installs require a user-provided Codex atlas package. Use only when the user explicitly asks to manage your avatar.",
39881
41280
  parameters: InlineBotAvatarToolParameters,
39882
41281
  execute: async (_toolCallId, rawArgs) => {
39883
41282
  const args = rawArgs;
41283
+ const action = resolveAvatarAction(args);
41284
+ if (action === "clear") {
41285
+ assertClearArgs(args);
41286
+ return await withInlineClient4({
41287
+ cfg: ctx.config,
41288
+ accountId: args.accountId ?? ctx.agentAccountId ?? null,
41289
+ fn: async (client, resolvedAccountId) => {
41290
+ const me = await client.getMe();
41291
+ const result = await client.invokeRaw(CLEAR_BOT_AVATAR_METHOD, {
41292
+ oneofKind: "clearBotAvatar",
41293
+ clearBotAvatar: {
41294
+ botUserId: me.userId
41295
+ }
41296
+ });
41297
+ if (result.oneofKind !== "clearBotAvatar") {
41298
+ throw new Error(`inline_bot_avatar: expected clearBotAvatar result, got ${String(result.oneofKind)}`);
41299
+ }
41300
+ return jsonResult({
41301
+ ok: true,
41302
+ action,
41303
+ accountId: resolvedAccountId,
41304
+ botUserId: String(me.userId),
41305
+ cleared: true,
41306
+ avatar: null,
41307
+ bot: result.clearBotAvatar.bot ?? null
41308
+ });
41309
+ }
41310
+ });
41311
+ }
39884
41312
  const source = resolvePackageSource(args);
39885
41313
  const displayName = readVisibleString(args.displayName, "displayName");
39886
41314
  const description = readVisibleString(args.description, "description");
@@ -39905,7 +41333,7 @@ function createInlineBotAvatarTool(ctx) {
39905
41333
  if (!uploaded.fileUniqueId) {
39906
41334
  throw new Error("inline_bot_avatar: upload did not return fileUniqueId");
39907
41335
  }
39908
- const result = await client.invokeRaw(Method.SET_BOT_AVATAR, {
41336
+ const result = await client.invokeRaw(SET_BOT_AVATAR_METHOD, {
39909
41337
  oneofKind: "setBotAvatar",
39910
41338
  setBotAvatar: {
39911
41339
  botUserId: me.userId,
@@ -39920,6 +41348,7 @@ function createInlineBotAvatarTool(ctx) {
39920
41348
  }
39921
41349
  return jsonResult({
39922
41350
  ok: true,
41351
+ action,
39923
41352
  accountId: resolvedAccountId,
39924
41353
  botUserId: String(me.userId),
39925
41354
  avatar: {
@@ -40815,6 +42244,7 @@ function createInlineThreadReplyCommand(api2) {
40815
42244
  var INLINE_COMMAND_NAME_RE = /^[a-z0-9_]{1,32}$/;
40816
42245
  var INLINE_COMMAND_LIMIT = 100;
40817
42246
  var INLINE_COMMAND_DESCRIPTION_LIMIT = 256;
42247
+ var INLINE_COMMAND_RETRY_RATIO = 0.8;
40818
42248
  var INLINE_NATIVE_COMMAND_PROVIDER = "inline";
40819
42249
  function resolveInlineChannelCommands(cfg) {
40820
42250
  const inline = cfg.channels?.inline;
@@ -40828,6 +42258,55 @@ function normalizeDynamicCommandName(raw) {
40828
42258
  const withoutSlash = trimmed.startsWith("/") ? trimmed.slice(1) : trimmed;
40829
42259
  return withoutSlash.trim();
40830
42260
  }
42261
+ function readErrorTextField(value, key) {
42262
+ if (!value || typeof value !== "object" || !(key in value))
42263
+ return;
42264
+ const raw = value[key];
42265
+ return typeof raw === "string" ? raw : undefined;
42266
+ }
42267
+ function isInlineBotCommandsTooMuchError(err) {
42268
+ const pattern = /\bBOT_COMMANDS_TOO_MUCH\b/i;
42269
+ if (typeof err === "string")
42270
+ return pattern.test(err);
42271
+ if (err instanceof Error && pattern.test(err.message))
42272
+ return true;
42273
+ const description = readErrorTextField(err, "description");
42274
+ if (description && pattern.test(description))
42275
+ return true;
42276
+ const message = readErrorTextField(err, "message");
42277
+ return Boolean(message && pattern.test(message));
42278
+ }
42279
+ async function setInlineBotCommandsWithRetry(params) {
42280
+ try {
42281
+ await callInlineBotApi({
42282
+ baseUrl: params.baseUrl,
42283
+ token: params.token,
42284
+ methodName: "setMyCommands",
42285
+ method: "POST",
42286
+ body: { commands: params.commands }
42287
+ });
42288
+ return params.commands;
42289
+ } catch (err) {
42290
+ if (!isInlineBotCommandsTooMuchError(err) || params.commands.length <= 1) {
42291
+ throw err;
42292
+ }
42293
+ const retryCount = Math.max(1, Math.floor(params.commands.length * INLINE_COMMAND_RETRY_RATIO));
42294
+ if (retryCount >= params.commands.length) {
42295
+ throw err;
42296
+ }
42297
+ const retryCommands = params.commands.slice(0, retryCount);
42298
+ params.logger?.warn?.(`[inline] bot command sync rejected ${params.commands.length} commands for account "${params.accountId}" (BOT_COMMANDS_TOO_MUCH); retrying with ${retryCommands.length}`);
42299
+ await callInlineBotApi({
42300
+ baseUrl: params.baseUrl,
42301
+ token: params.token,
42302
+ methodName: "setMyCommands",
42303
+ method: "POST",
42304
+ body: { commands: retryCommands }
42305
+ });
42306
+ params.logger?.warn?.(`[inline] bot command sync accepted ${retryCommands.length} commands for account "${params.accountId}" after BOT_COMMANDS_TOO_MUCH (started with ${params.commands.length}; omitted ${params.commands.length - retryCommands.length}). Reduce plugin/skill/custom commands to expose more menu entries.`);
42307
+ return retryCommands;
42308
+ }
42309
+ }
40831
42310
  function appendUniqueCommand(out, seen, command, description, logger) {
40832
42311
  const normalized = normalizeDynamicCommandName(command);
40833
42312
  if (!INLINE_COMMAND_NAME_RE.test(normalized) || seen.has(normalized))
@@ -40944,15 +42423,15 @@ async function syncInlineNativeCommands(params) {
40944
42423
  continue;
40945
42424
  }
40946
42425
  try {
40947
- await callInlineBotApi({
42426
+ const syncedCommands = await setInlineBotCommandsWithRetry({
40948
42427
  baseUrl: account.baseUrl,
40949
42428
  token,
40950
- methodName: "setMyCommands",
40951
- method: "POST",
40952
- body: { commands }
42429
+ accountId: account.accountId,
42430
+ commands,
42431
+ ...params.logger ? { logger: params.logger } : {}
40953
42432
  });
40954
42433
  synced += 1;
40955
- params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${commands.length} command${commands.length === 1 ? "" : "s"})`);
42434
+ params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${syncedCommands.length} command${syncedCommands.length === 1 ? "" : "s"})`);
40956
42435
  } catch (err) {
40957
42436
  failed += 1;
40958
42437
  params.logger?.warn?.(`[inline] bot command sync failed for account "${account.accountId}": ${String(err)}`);
@@ -41016,5 +42495,5 @@ export {
41016
42495
  registerInlinePluginFull
41017
42496
  };
41018
42497
 
41019
- //# debugId=D10D8C4C3B879C9364756E2164756E21
42498
+ //# debugId=D4479BF9BA38C09864756E2164756E21
41020
42499
  //# sourceMappingURL=runtime-register-api.js.map