@inline-openclaw/inline 0.0.46 → 0.0.48

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 (40) hide show
  1. package/README.md +49 -10
  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 +3941 -310
  5. package/dist/approval-handler.runtime.js.map +14 -13
  6. package/dist/channel-plugin-api.js +4600 -484
  7. package/dist/channel-plugin-api.js.map +20 -19
  8. package/dist/index.d.ts +1 -1
  9. package/dist/inline/actions.d.ts +9 -4
  10. package/dist/inline/actions.d.ts.map +1 -1
  11. package/dist/inline/approval-native.d.ts.map +1 -1
  12. package/dist/inline/bot-avatar-tool.d.ts.map +1 -1
  13. package/dist/inline/bot-commands-sync.d.ts.map +1 -1
  14. package/dist/inline/channel.d.ts.map +1 -1
  15. package/dist/inline/config-schema.d.ts +21 -0
  16. package/dist/inline/config-schema.d.ts.map +1 -1
  17. package/dist/inline/exec-approvals.d.ts.map +1 -1
  18. package/dist/inline/media.d.ts +17 -0
  19. package/dist/inline/media.d.ts.map +1 -1
  20. package/dist/inline/members-tool.d.ts +2 -0
  21. package/dist/inline/members-tool.d.ts.map +1 -1
  22. package/dist/inline/message-content.d.ts +2 -0
  23. package/dist/inline/message-content.d.ts.map +1 -1
  24. package/dist/inline/message-tools.d.ts.map +1 -1
  25. package/dist/inline/monitor.d.ts.map +1 -1
  26. package/dist/inline/outbound-sanitize.d.ts +2 -0
  27. package/dist/inline/outbound-sanitize.d.ts.map +1 -1
  28. package/dist/inline/parent-context-tool.d.ts.map +1 -1
  29. package/dist/inline/shared.d.ts +1 -1
  30. package/dist/inline/thread-freshness.d.ts +24 -0
  31. package/dist/inline/thread-freshness.d.ts.map +1 -0
  32. package/dist/inline/thread-routes.d.ts +4 -0
  33. package/dist/inline/thread-routes.d.ts.map +1 -1
  34. package/dist/runtime-register-api.js +1745 -247
  35. package/dist/runtime-register-api.js.map +14 -14
  36. package/dist/setup-entry.d.ts +1 -1
  37. package/dist/setup-plugin-api.js +5 -2
  38. package/dist/setup-plugin-api.js.map +4 -4
  39. package/openclaw.plugin.json +24 -1
  40. package/package.json +8 -8
@@ -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
  }
@@ -12092,7 +12602,8 @@ class UpdateDialogOpenResult$Type extends import_runtime4.MessageType {
12092
12602
  super("UpdateDialogOpenResult", [
12093
12603
  { no: 1, name: "chat", kind: "message", T: () => Chat },
12094
12604
  { no: 2, name: "dialog", kind: "message", T: () => Dialog },
12095
- { no: 3, name: "user", kind: "message", T: () => User }
12605
+ { no: 3, name: "user", kind: "message", T: () => User },
12606
+ { no: 4, name: "deleted_chat", kind: "scalar", opt: true, T: 8 }
12096
12607
  ]);
12097
12608
  }
12098
12609
  create(value) {
@@ -12115,6 +12626,9 @@ class UpdateDialogOpenResult$Type extends import_runtime4.MessageType {
12115
12626
  case 3:
12116
12627
  message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
12117
12628
  break;
12629
+ case 4:
12630
+ message.deletedChat = reader.bool();
12631
+ break;
12118
12632
  default:
12119
12633
  let u = options.readUnknownField;
12120
12634
  if (u === "throw")
@@ -12133,6 +12647,8 @@ class UpdateDialogOpenResult$Type extends import_runtime4.MessageType {
12133
12647
  Dialog.internalBinaryWrite(message.dialog, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
12134
12648
  if (message.user)
12135
12649
  User.internalBinaryWrite(message.user, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
12650
+ if (message.deletedChat !== undefined)
12651
+ writer.tag(4, import_runtime.WireType.Varint).bool(message.deletedChat);
12136
12652
  let u = options.writeUnknownFields;
12137
12653
  if (u !== false)
12138
12654
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -12970,18 +13486,53 @@ class RevokeSessionResult$Type extends import_runtime4.MessageType {
12970
13486
  }
12971
13487
  var RevokeSessionResult = new RevokeSessionResult$Type;
12972
13488
 
12973
- class BotCommand$Type extends import_runtime4.MessageType {
13489
+ class GetSessionsInput$Type extends import_runtime4.MessageType {
12974
13490
  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 }
13491
+ super("GetSessionsInput", []);
13492
+ }
13493
+ create(value) {
13494
+ const message = globalThis.Object.create(this.messagePrototype);
13495
+ if (value !== undefined)
13496
+ import_runtime3.reflectionMergePartial(this, message, value);
13497
+ return message;
13498
+ }
13499
+ internalBinaryRead(reader, length, options, target) {
13500
+ return target ?? this.create();
13501
+ }
13502
+ internalBinaryWrite(message, writer, options) {
13503
+ let u = options.writeUnknownFields;
13504
+ if (u !== false)
13505
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13506
+ return writer;
13507
+ }
13508
+ }
13509
+ var GetSessionsInput = new GetSessionsInput$Type;
13510
+
13511
+ class AccountSession$Type extends import_runtime4.MessageType {
13512
+ constructor() {
13513
+ super("AccountSession", [
13514
+ { no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
13515
+ { no: 2, name: "client_type", kind: "scalar", T: 9 },
13516
+ { no: 3, name: "client_version", kind: "scalar", opt: true, T: 9 },
13517
+ { no: 4, name: "os_version", kind: "scalar", opt: true, T: 9 },
13518
+ { no: 5, name: "device_name", kind: "scalar", opt: true, T: 9 },
13519
+ { no: 6, name: "city", kind: "scalar", opt: true, T: 9 },
13520
+ { no: 7, name: "country", kind: "scalar", opt: true, T: 9 },
13521
+ { no: 8, name: "timezone", kind: "scalar", opt: true, T: 9 },
13522
+ { no: 9, name: "created_at", kind: "scalar", T: 3, L: 0 },
13523
+ { no: 10, name: "last_active_at", kind: "scalar", T: 3, L: 0 },
13524
+ { no: 11, name: "active", kind: "scalar", T: 8 },
13525
+ { no: 12, name: "current", kind: "scalar", T: 8 }
12979
13526
  ]);
12980
13527
  }
12981
13528
  create(value) {
12982
13529
  const message = globalThis.Object.create(this.messagePrototype);
12983
- message.command = "";
12984
- message.description = "";
13530
+ message.id = 0n;
13531
+ message.clientType = "";
13532
+ message.createdAt = 0n;
13533
+ message.lastActiveAt = 0n;
13534
+ message.active = false;
13535
+ message.current = false;
12985
13536
  if (value !== undefined)
12986
13537
  import_runtime3.reflectionMergePartial(this, message, value);
12987
13538
  return message;
@@ -12992,13 +13543,40 @@ class BotCommand$Type extends import_runtime4.MessageType {
12992
13543
  let [fieldNo, wireType] = reader.tag();
12993
13544
  switch (fieldNo) {
12994
13545
  case 1:
12995
- message.command = reader.string();
13546
+ message.id = reader.int64().toBigInt();
12996
13547
  break;
12997
13548
  case 2:
12998
- message.description = reader.string();
13549
+ message.clientType = reader.string();
12999
13550
  break;
13000
13551
  case 3:
13001
- message.sortOrder = reader.int32();
13552
+ message.clientVersion = reader.string();
13553
+ break;
13554
+ case 4:
13555
+ message.osVersion = reader.string();
13556
+ break;
13557
+ case 5:
13558
+ message.deviceName = reader.string();
13559
+ break;
13560
+ case 6:
13561
+ message.city = reader.string();
13562
+ break;
13563
+ case 7:
13564
+ message.country = reader.string();
13565
+ break;
13566
+ case 8:
13567
+ message.timezone = reader.string();
13568
+ break;
13569
+ case 9:
13570
+ message.createdAt = reader.int64().toBigInt();
13571
+ break;
13572
+ case 10:
13573
+ message.lastActiveAt = reader.int64().toBigInt();
13574
+ break;
13575
+ case 11:
13576
+ message.active = reader.bool();
13577
+ break;
13578
+ case 12:
13579
+ message.current = reader.bool();
13002
13580
  break;
13003
13581
  default:
13004
13582
  let u = options.readUnknownField;
@@ -13012,30 +13590,47 @@ class BotCommand$Type extends import_runtime4.MessageType {
13012
13590
  return message;
13013
13591
  }
13014
13592
  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);
13593
+ if (message.id !== 0n)
13594
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.id);
13595
+ if (message.clientType !== "")
13596
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.clientType);
13597
+ if (message.clientVersion !== undefined)
13598
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.clientVersion);
13599
+ if (message.osVersion !== undefined)
13600
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.osVersion);
13601
+ if (message.deviceName !== undefined)
13602
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.deviceName);
13603
+ if (message.city !== undefined)
13604
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.city);
13605
+ if (message.country !== undefined)
13606
+ writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.country);
13607
+ if (message.timezone !== undefined)
13608
+ writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.timezone);
13609
+ if (message.createdAt !== 0n)
13610
+ writer.tag(9, import_runtime.WireType.Varint).int64(message.createdAt);
13611
+ if (message.lastActiveAt !== 0n)
13612
+ writer.tag(10, import_runtime.WireType.Varint).int64(message.lastActiveAt);
13613
+ if (message.active !== false)
13614
+ writer.tag(11, import_runtime.WireType.Varint).bool(message.active);
13615
+ if (message.current !== false)
13616
+ writer.tag(12, import_runtime.WireType.Varint).bool(message.current);
13021
13617
  let u = options.writeUnknownFields;
13022
13618
  if (u !== false)
13023
13619
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13024
13620
  return writer;
13025
13621
  }
13026
13622
  }
13027
- var BotCommand = new BotCommand$Type;
13623
+ var AccountSession = new AccountSession$Type;
13028
13624
 
13029
- class PeerBotCommands$Type extends import_runtime4.MessageType {
13625
+ class GetSessionsResult$Type extends import_runtime4.MessageType {
13030
13626
  constructor() {
13031
- super("PeerBotCommands", [
13032
- { no: 1, name: "bot", kind: "message", T: () => User },
13033
- { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13627
+ super("GetSessionsResult", [
13628
+ { no: 1, name: "sessions", kind: "message", repeat: 1, T: () => AccountSession }
13034
13629
  ]);
13035
13630
  }
13036
13631
  create(value) {
13037
13632
  const message = globalThis.Object.create(this.messagePrototype);
13038
- message.commands = [];
13633
+ message.sessions = [];
13039
13634
  if (value !== undefined)
13040
13635
  import_runtime3.reflectionMergePartial(this, message, value);
13041
13636
  return message;
@@ -13046,10 +13641,7 @@ class PeerBotCommands$Type extends import_runtime4.MessageType {
13046
13641
  let [fieldNo, wireType] = reader.tag();
13047
13642
  switch (fieldNo) {
13048
13643
  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));
13644
+ message.sessions.push(AccountSession.internalBinaryRead(reader, reader.uint32(), options));
13053
13645
  break;
13054
13646
  default:
13055
13647
  let u = options.readUnknownField;
@@ -13063,27 +13655,25 @@ class PeerBotCommands$Type extends import_runtime4.MessageType {
13063
13655
  return message;
13064
13656
  }
13065
13657
  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();
13658
+ for (let i = 0;i < message.sessions.length; i++)
13659
+ AccountSession.internalBinaryWrite(message.sessions[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13070
13660
  let u = options.writeUnknownFields;
13071
13661
  if (u !== false)
13072
13662
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13073
13663
  return writer;
13074
13664
  }
13075
13665
  }
13076
- var PeerBotCommands = new PeerBotCommands$Type;
13666
+ var GetSessionsResult = new GetSessionsResult$Type;
13077
13667
 
13078
- class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13668
+ class CheckUsernameInput$Type extends import_runtime4.MessageType {
13079
13669
  constructor() {
13080
- super("GetBotCommandsInput", [
13081
- { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13670
+ super("CheckUsernameInput", [
13671
+ { no: 1, name: "username", kind: "scalar", T: 9 }
13082
13672
  ]);
13083
13673
  }
13084
13674
  create(value) {
13085
13675
  const message = globalThis.Object.create(this.messagePrototype);
13086
- message.botUserId = 0n;
13676
+ message.username = "";
13087
13677
  if (value !== undefined)
13088
13678
  import_runtime3.reflectionMergePartial(this, message, value);
13089
13679
  return message;
@@ -13094,7 +13684,7 @@ class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13094
13684
  let [fieldNo, wireType] = reader.tag();
13095
13685
  switch (fieldNo) {
13096
13686
  case 1:
13097
- message.botUserId = reader.int64().toBigInt();
13687
+ message.username = reader.string();
13098
13688
  break;
13099
13689
  default:
13100
13690
  let u = options.readUnknownField;
@@ -13108,25 +13698,27 @@ class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13108
13698
  return message;
13109
13699
  }
13110
13700
  internalBinaryWrite(message, writer, options) {
13111
- if (message.botUserId !== 0n)
13112
- writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13701
+ if (message.username !== "")
13702
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.username);
13113
13703
  let u = options.writeUnknownFields;
13114
13704
  if (u !== false)
13115
13705
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13116
13706
  return writer;
13117
13707
  }
13118
13708
  }
13119
- var GetBotCommandsInput = new GetBotCommandsInput$Type;
13709
+ var CheckUsernameInput = new CheckUsernameInput$Type;
13120
13710
 
13121
- class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13711
+ class CheckUsernameResult$Type extends import_runtime4.MessageType {
13122
13712
  constructor() {
13123
- super("GetBotCommandsResult", [
13124
- { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13713
+ super("CheckUsernameResult", [
13714
+ { no: 1, name: "username", kind: "scalar", T: 9 },
13715
+ { no: 2, name: "availability", kind: "enum", T: () => ["UsernameAvailability", UsernameAvailability] }
13125
13716
  ]);
13126
13717
  }
13127
13718
  create(value) {
13128
13719
  const message = globalThis.Object.create(this.messagePrototype);
13129
- message.commands = [];
13720
+ message.username = "";
13721
+ message.availability = 0;
13130
13722
  if (value !== undefined)
13131
13723
  import_runtime3.reflectionMergePartial(this, message, value);
13132
13724
  return message;
@@ -13137,7 +13729,10 @@ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13137
13729
  let [fieldNo, wireType] = reader.tag();
13138
13730
  switch (fieldNo) {
13139
13731
  case 1:
13140
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13732
+ message.username = reader.string();
13733
+ break;
13734
+ case 2:
13735
+ message.availability = reader.int32();
13141
13736
  break;
13142
13737
  default:
13143
13738
  let u = options.readUnknownField;
@@ -13151,27 +13746,27 @@ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
13151
13746
  return message;
13152
13747
  }
13153
13748
  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();
13749
+ if (message.username !== "")
13750
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.username);
13751
+ if (message.availability !== 0)
13752
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.availability);
13156
13753
  let u = options.writeUnknownFields;
13157
13754
  if (u !== false)
13158
13755
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13159
13756
  return writer;
13160
13757
  }
13161
13758
  }
13162
- var GetBotCommandsResult = new GetBotCommandsResult$Type;
13759
+ var CheckUsernameResult = new CheckUsernameResult$Type;
13163
13760
 
13164
- class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13761
+ class ChangeUsernameInput$Type extends import_runtime4.MessageType {
13165
13762
  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 }
13763
+ super("ChangeUsernameInput", [
13764
+ { no: 1, name: "username", kind: "scalar", T: 9 }
13169
13765
  ]);
13170
13766
  }
13171
13767
  create(value) {
13172
13768
  const message = globalThis.Object.create(this.messagePrototype);
13173
- message.botUserId = 0n;
13174
- message.commands = [];
13769
+ message.username = "";
13175
13770
  if (value !== undefined)
13176
13771
  import_runtime3.reflectionMergePartial(this, message, value);
13177
13772
  return message;
@@ -13182,10 +13777,7 @@ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13182
13777
  let [fieldNo, wireType] = reader.tag();
13183
13778
  switch (fieldNo) {
13184
13779
  case 1:
13185
- message.botUserId = reader.int64().toBigInt();
13186
- break;
13187
- case 2:
13188
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13780
+ message.username = reader.string();
13189
13781
  break;
13190
13782
  default:
13191
13783
  let u = options.readUnknownField;
@@ -13199,27 +13791,26 @@ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
13199
13791
  return message;
13200
13792
  }
13201
13793
  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();
13794
+ if (message.username !== "")
13795
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.username);
13206
13796
  let u = options.writeUnknownFields;
13207
13797
  if (u !== false)
13208
13798
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13209
13799
  return writer;
13210
13800
  }
13211
13801
  }
13212
- var SetBotCommandsInput = new SetBotCommandsInput$Type;
13802
+ var ChangeUsernameInput = new ChangeUsernameInput$Type;
13213
13803
 
13214
- class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13804
+ class ChangeUsernameResult$Type extends import_runtime4.MessageType {
13215
13805
  constructor() {
13216
- super("SetBotCommandsResult", [
13217
- { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13806
+ super("ChangeUsernameResult", [
13807
+ { no: 1, name: "user", kind: "message", T: () => User },
13808
+ { no: 2, name: "updates", kind: "message", repeat: 1, T: () => Update }
13218
13809
  ]);
13219
13810
  }
13220
13811
  create(value) {
13221
13812
  const message = globalThis.Object.create(this.messagePrototype);
13222
- message.commands = [];
13813
+ message.updates = [];
13223
13814
  if (value !== undefined)
13224
13815
  import_runtime3.reflectionMergePartial(this, message, value);
13225
13816
  return message;
@@ -13230,7 +13821,10 @@ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13230
13821
  let [fieldNo, wireType] = reader.tag();
13231
13822
  switch (fieldNo) {
13232
13823
  case 1:
13233
- message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13824
+ message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
13825
+ break;
13826
+ case 2:
13827
+ message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
13234
13828
  break;
13235
13829
  default:
13236
13830
  let u = options.readUnknownField;
@@ -13244,20 +13838,24 @@ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
13244
13838
  return message;
13245
13839
  }
13246
13840
  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();
13841
+ if (message.user)
13842
+ User.internalBinaryWrite(message.user, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13843
+ for (let i = 0;i < message.updates.length; i++)
13844
+ Update.internalBinaryWrite(message.updates[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13249
13845
  let u = options.writeUnknownFields;
13250
13846
  if (u !== false)
13251
13847
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13252
13848
  return writer;
13253
13849
  }
13254
13850
  }
13255
- var SetBotCommandsResult = new SetBotCommandsResult$Type;
13851
+ var ChangeUsernameResult = new ChangeUsernameResult$Type;
13256
13852
 
13257
- class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13853
+ class UpdateProfileInput$Type extends import_runtime4.MessageType {
13258
13854
  constructor() {
13259
- super("GetPeerBotCommandsInput", [
13260
- { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
13855
+ super("UpdateProfileInput", [
13856
+ { no: 1, name: "first_name", kind: "scalar", opt: true, T: 9 },
13857
+ { no: 2, name: "last_name", kind: "scalar", opt: true, T: 9 },
13858
+ { no: 3, name: "bio", kind: "scalar", opt: true, T: 9 }
13261
13859
  ]);
13262
13860
  }
13263
13861
  create(value) {
@@ -13272,7 +13870,13 @@ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13272
13870
  let [fieldNo, wireType] = reader.tag();
13273
13871
  switch (fieldNo) {
13274
13872
  case 1:
13275
- message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
13873
+ message.firstName = reader.string();
13874
+ break;
13875
+ case 2:
13876
+ message.lastName = reader.string();
13877
+ break;
13878
+ case 3:
13879
+ message.bio = reader.string();
13276
13880
  break;
13277
13881
  default:
13278
13882
  let u = options.readUnknownField;
@@ -13286,25 +13890,30 @@ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
13286
13890
  return message;
13287
13891
  }
13288
13892
  internalBinaryWrite(message, writer, options) {
13289
- if (message.peerId)
13290
- InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13893
+ if (message.firstName !== undefined)
13894
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.firstName);
13895
+ if (message.lastName !== undefined)
13896
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.lastName);
13897
+ if (message.bio !== undefined)
13898
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.bio);
13291
13899
  let u = options.writeUnknownFields;
13292
13900
  if (u !== false)
13293
13901
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13294
13902
  return writer;
13295
13903
  }
13296
13904
  }
13297
- var GetPeerBotCommandsInput = new GetPeerBotCommandsInput$Type;
13905
+ var UpdateProfileInput = new UpdateProfileInput$Type;
13298
13906
 
13299
- class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13907
+ class UpdateProfileResult$Type extends import_runtime4.MessageType {
13300
13908
  constructor() {
13301
- super("GetPeerBotCommandsResult", [
13302
- { no: 1, name: "bots", kind: "message", repeat: 1, T: () => PeerBotCommands }
13909
+ super("UpdateProfileResult", [
13910
+ { no: 1, name: "user", kind: "message", T: () => User },
13911
+ { no: 2, name: "updates", kind: "message", repeat: 1, T: () => Update }
13303
13912
  ]);
13304
13913
  }
13305
13914
  create(value) {
13306
13915
  const message = globalThis.Object.create(this.messagePrototype);
13307
- message.bots = [];
13916
+ message.updates = [];
13308
13917
  if (value !== undefined)
13309
13918
  import_runtime3.reflectionMergePartial(this, message, value);
13310
13919
  return message;
@@ -13315,7 +13924,10 @@ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13315
13924
  let [fieldNo, wireType] = reader.tag();
13316
13925
  switch (fieldNo) {
13317
13926
  case 1:
13318
- message.bots.push(PeerBotCommands.internalBinaryRead(reader, reader.uint32(), options));
13927
+ message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
13928
+ break;
13929
+ case 2:
13930
+ message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
13319
13931
  break;
13320
13932
  default:
13321
13933
  let u = options.readUnknownField;
@@ -13329,25 +13941,30 @@ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
13329
13941
  return message;
13330
13942
  }
13331
13943
  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();
13944
+ if (message.user)
13945
+ User.internalBinaryWrite(message.user, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
13946
+ for (let i = 0;i < message.updates.length; i++)
13947
+ Update.internalBinaryWrite(message.updates[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13334
13948
  let u = options.writeUnknownFields;
13335
13949
  if (u !== false)
13336
13950
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13337
13951
  return writer;
13338
13952
  }
13339
13953
  }
13340
- var GetPeerBotCommandsResult = new GetPeerBotCommandsResult$Type;
13954
+ var UpdateProfileResult = new UpdateProfileResult$Type;
13341
13955
 
13342
- class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13956
+ class BotCommand$Type extends import_runtime4.MessageType {
13343
13957
  constructor() {
13344
- super("RevealBotTokenInput", [
13345
- { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13958
+ super("BotCommand", [
13959
+ { no: 1, name: "command", kind: "scalar", T: 9 },
13960
+ { no: 2, name: "description", kind: "scalar", T: 9 },
13961
+ { no: 3, name: "sort_order", kind: "scalar", opt: true, T: 5 }
13346
13962
  ]);
13347
13963
  }
13348
13964
  create(value) {
13349
13965
  const message = globalThis.Object.create(this.messagePrototype);
13350
- message.botUserId = 0n;
13966
+ message.command = "";
13967
+ message.description = "";
13351
13968
  if (value !== undefined)
13352
13969
  import_runtime3.reflectionMergePartial(this, message, value);
13353
13970
  return message;
@@ -13358,7 +13975,13 @@ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13358
13975
  let [fieldNo, wireType] = reader.tag();
13359
13976
  switch (fieldNo) {
13360
13977
  case 1:
13361
- message.botUserId = reader.int64().toBigInt();
13978
+ message.command = reader.string();
13979
+ break;
13980
+ case 2:
13981
+ message.description = reader.string();
13982
+ break;
13983
+ case 3:
13984
+ message.sortOrder = reader.int32();
13362
13985
  break;
13363
13986
  default:
13364
13987
  let u = options.readUnknownField;
@@ -13372,25 +13995,30 @@ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
13372
13995
  return message;
13373
13996
  }
13374
13997
  internalBinaryWrite(message, writer, options) {
13375
- if (message.botUserId !== 0n)
13376
- writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
13998
+ if (message.command !== "")
13999
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.command);
14000
+ if (message.description !== "")
14001
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.description);
14002
+ if (message.sortOrder !== undefined)
14003
+ writer.tag(3, import_runtime.WireType.Varint).int32(message.sortOrder);
13377
14004
  let u = options.writeUnknownFields;
13378
14005
  if (u !== false)
13379
14006
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13380
14007
  return writer;
13381
14008
  }
13382
14009
  }
13383
- var RevealBotTokenInput = new RevealBotTokenInput$Type;
14010
+ var BotCommand = new BotCommand$Type;
13384
14011
 
13385
- class RevealBotTokenResult$Type extends import_runtime4.MessageType {
14012
+ class PeerBotCommands$Type extends import_runtime4.MessageType {
13386
14013
  constructor() {
13387
- super("RevealBotTokenResult", [
13388
- { no: 1, name: "token", kind: "scalar", T: 9 }
14014
+ super("PeerBotCommands", [
14015
+ { no: 1, name: "bot", kind: "message", T: () => User },
14016
+ { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
13389
14017
  ]);
13390
14018
  }
13391
14019
  create(value) {
13392
14020
  const message = globalThis.Object.create(this.messagePrototype);
13393
- message.token = "";
14021
+ message.commands = [];
13394
14022
  if (value !== undefined)
13395
14023
  import_runtime3.reflectionMergePartial(this, message, value);
13396
14024
  return message;
@@ -13401,7 +14029,10 @@ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13401
14029
  let [fieldNo, wireType] = reader.tag();
13402
14030
  switch (fieldNo) {
13403
14031
  case 1:
13404
- message.token = reader.string();
14032
+ message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
14033
+ break;
14034
+ case 2:
14035
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
13405
14036
  break;
13406
14037
  default:
13407
14038
  let u = options.readUnknownField;
@@ -13415,19 +14046,371 @@ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
13415
14046
  return message;
13416
14047
  }
13417
14048
  internalBinaryWrite(message, writer, options) {
13418
- if (message.token !== "")
13419
- writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
14049
+ if (message.bot)
14050
+ User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14051
+ for (let i = 0;i < message.commands.length; i++)
14052
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
13420
14053
  let u = options.writeUnknownFields;
13421
14054
  if (u !== false)
13422
14055
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
13423
14056
  return writer;
13424
14057
  }
13425
14058
  }
13426
- var RevealBotTokenResult = new RevealBotTokenResult$Type;
14059
+ var PeerBotCommands = new PeerBotCommands$Type;
13427
14060
 
13428
- class RotateBotTokenInput$Type extends import_runtime4.MessageType {
14061
+ class GetBotCommandsInput$Type extends import_runtime4.MessageType {
13429
14062
  constructor() {
13430
- super("RotateBotTokenInput", [
14063
+ super("GetBotCommandsInput", [
14064
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
14065
+ ]);
14066
+ }
14067
+ create(value) {
14068
+ const message = globalThis.Object.create(this.messagePrototype);
14069
+ message.botUserId = 0n;
14070
+ if (value !== undefined)
14071
+ import_runtime3.reflectionMergePartial(this, message, value);
14072
+ return message;
14073
+ }
14074
+ internalBinaryRead(reader, length, options, target) {
14075
+ let message = target ?? this.create(), end = reader.pos + length;
14076
+ while (reader.pos < end) {
14077
+ let [fieldNo, wireType] = reader.tag();
14078
+ switch (fieldNo) {
14079
+ case 1:
14080
+ message.botUserId = reader.int64().toBigInt();
14081
+ break;
14082
+ default:
14083
+ let u = options.readUnknownField;
14084
+ if (u === "throw")
14085
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14086
+ let d = reader.skip(wireType);
14087
+ if (u !== false)
14088
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14089
+ }
14090
+ }
14091
+ return message;
14092
+ }
14093
+ internalBinaryWrite(message, writer, options) {
14094
+ if (message.botUserId !== 0n)
14095
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
14096
+ let u = options.writeUnknownFields;
14097
+ if (u !== false)
14098
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14099
+ return writer;
14100
+ }
14101
+ }
14102
+ var GetBotCommandsInput = new GetBotCommandsInput$Type;
14103
+
14104
+ class GetBotCommandsResult$Type extends import_runtime4.MessageType {
14105
+ constructor() {
14106
+ super("GetBotCommandsResult", [
14107
+ { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
14108
+ ]);
14109
+ }
14110
+ create(value) {
14111
+ const message = globalThis.Object.create(this.messagePrototype);
14112
+ message.commands = [];
14113
+ if (value !== undefined)
14114
+ import_runtime3.reflectionMergePartial(this, message, value);
14115
+ return message;
14116
+ }
14117
+ internalBinaryRead(reader, length, options, target) {
14118
+ let message = target ?? this.create(), end = reader.pos + length;
14119
+ while (reader.pos < end) {
14120
+ let [fieldNo, wireType] = reader.tag();
14121
+ switch (fieldNo) {
14122
+ case 1:
14123
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
14124
+ break;
14125
+ default:
14126
+ let u = options.readUnknownField;
14127
+ if (u === "throw")
14128
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14129
+ let d = reader.skip(wireType);
14130
+ if (u !== false)
14131
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14132
+ }
14133
+ }
14134
+ return message;
14135
+ }
14136
+ internalBinaryWrite(message, writer, options) {
14137
+ for (let i = 0;i < message.commands.length; i++)
14138
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14139
+ let u = options.writeUnknownFields;
14140
+ if (u !== false)
14141
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14142
+ return writer;
14143
+ }
14144
+ }
14145
+ var GetBotCommandsResult = new GetBotCommandsResult$Type;
14146
+
14147
+ class SetBotCommandsInput$Type extends import_runtime4.MessageType {
14148
+ constructor() {
14149
+ super("SetBotCommandsInput", [
14150
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
14151
+ { no: 2, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
14152
+ ]);
14153
+ }
14154
+ create(value) {
14155
+ const message = globalThis.Object.create(this.messagePrototype);
14156
+ message.botUserId = 0n;
14157
+ message.commands = [];
14158
+ if (value !== undefined)
14159
+ import_runtime3.reflectionMergePartial(this, message, value);
14160
+ return message;
14161
+ }
14162
+ internalBinaryRead(reader, length, options, target) {
14163
+ let message = target ?? this.create(), end = reader.pos + length;
14164
+ while (reader.pos < end) {
14165
+ let [fieldNo, wireType] = reader.tag();
14166
+ switch (fieldNo) {
14167
+ case 1:
14168
+ message.botUserId = reader.int64().toBigInt();
14169
+ break;
14170
+ case 2:
14171
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
14172
+ break;
14173
+ default:
14174
+ let u = options.readUnknownField;
14175
+ if (u === "throw")
14176
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14177
+ let d = reader.skip(wireType);
14178
+ if (u !== false)
14179
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14180
+ }
14181
+ }
14182
+ return message;
14183
+ }
14184
+ internalBinaryWrite(message, writer, options) {
14185
+ if (message.botUserId !== 0n)
14186
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
14187
+ for (let i = 0;i < message.commands.length; i++)
14188
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
14189
+ let u = options.writeUnknownFields;
14190
+ if (u !== false)
14191
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14192
+ return writer;
14193
+ }
14194
+ }
14195
+ var SetBotCommandsInput = new SetBotCommandsInput$Type;
14196
+
14197
+ class SetBotCommandsResult$Type extends import_runtime4.MessageType {
14198
+ constructor() {
14199
+ super("SetBotCommandsResult", [
14200
+ { no: 1, name: "commands", kind: "message", repeat: 1, T: () => BotCommand }
14201
+ ]);
14202
+ }
14203
+ create(value) {
14204
+ const message = globalThis.Object.create(this.messagePrototype);
14205
+ message.commands = [];
14206
+ if (value !== undefined)
14207
+ import_runtime3.reflectionMergePartial(this, message, value);
14208
+ return message;
14209
+ }
14210
+ internalBinaryRead(reader, length, options, target) {
14211
+ let message = target ?? this.create(), end = reader.pos + length;
14212
+ while (reader.pos < end) {
14213
+ let [fieldNo, wireType] = reader.tag();
14214
+ switch (fieldNo) {
14215
+ case 1:
14216
+ message.commands.push(BotCommand.internalBinaryRead(reader, reader.uint32(), options));
14217
+ break;
14218
+ default:
14219
+ let u = options.readUnknownField;
14220
+ if (u === "throw")
14221
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14222
+ let d = reader.skip(wireType);
14223
+ if (u !== false)
14224
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14225
+ }
14226
+ }
14227
+ return message;
14228
+ }
14229
+ internalBinaryWrite(message, writer, options) {
14230
+ for (let i = 0;i < message.commands.length; i++)
14231
+ BotCommand.internalBinaryWrite(message.commands[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14232
+ let u = options.writeUnknownFields;
14233
+ if (u !== false)
14234
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14235
+ return writer;
14236
+ }
14237
+ }
14238
+ var SetBotCommandsResult = new SetBotCommandsResult$Type;
14239
+
14240
+ class GetPeerBotCommandsInput$Type extends import_runtime4.MessageType {
14241
+ constructor() {
14242
+ super("GetPeerBotCommandsInput", [
14243
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
14244
+ ]);
14245
+ }
14246
+ create(value) {
14247
+ const message = globalThis.Object.create(this.messagePrototype);
14248
+ if (value !== undefined)
14249
+ import_runtime3.reflectionMergePartial(this, message, value);
14250
+ return message;
14251
+ }
14252
+ internalBinaryRead(reader, length, options, target) {
14253
+ let message = target ?? this.create(), end = reader.pos + length;
14254
+ while (reader.pos < end) {
14255
+ let [fieldNo, wireType] = reader.tag();
14256
+ switch (fieldNo) {
14257
+ case 1:
14258
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
14259
+ break;
14260
+ default:
14261
+ let u = options.readUnknownField;
14262
+ if (u === "throw")
14263
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14264
+ let d = reader.skip(wireType);
14265
+ if (u !== false)
14266
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14267
+ }
14268
+ }
14269
+ return message;
14270
+ }
14271
+ internalBinaryWrite(message, writer, options) {
14272
+ if (message.peerId)
14273
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14274
+ let u = options.writeUnknownFields;
14275
+ if (u !== false)
14276
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14277
+ return writer;
14278
+ }
14279
+ }
14280
+ var GetPeerBotCommandsInput = new GetPeerBotCommandsInput$Type;
14281
+
14282
+ class GetPeerBotCommandsResult$Type extends import_runtime4.MessageType {
14283
+ constructor() {
14284
+ super("GetPeerBotCommandsResult", [
14285
+ { no: 1, name: "bots", kind: "message", repeat: 1, T: () => PeerBotCommands }
14286
+ ]);
14287
+ }
14288
+ create(value) {
14289
+ const message = globalThis.Object.create(this.messagePrototype);
14290
+ message.bots = [];
14291
+ if (value !== undefined)
14292
+ import_runtime3.reflectionMergePartial(this, message, value);
14293
+ return message;
14294
+ }
14295
+ internalBinaryRead(reader, length, options, target) {
14296
+ let message = target ?? this.create(), end = reader.pos + length;
14297
+ while (reader.pos < end) {
14298
+ let [fieldNo, wireType] = reader.tag();
14299
+ switch (fieldNo) {
14300
+ case 1:
14301
+ message.bots.push(PeerBotCommands.internalBinaryRead(reader, reader.uint32(), options));
14302
+ break;
14303
+ default:
14304
+ let u = options.readUnknownField;
14305
+ if (u === "throw")
14306
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14307
+ let d = reader.skip(wireType);
14308
+ if (u !== false)
14309
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14310
+ }
14311
+ }
14312
+ return message;
14313
+ }
14314
+ internalBinaryWrite(message, writer, options) {
14315
+ for (let i = 0;i < message.bots.length; i++)
14316
+ PeerBotCommands.internalBinaryWrite(message.bots[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
14317
+ let u = options.writeUnknownFields;
14318
+ if (u !== false)
14319
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14320
+ return writer;
14321
+ }
14322
+ }
14323
+ var GetPeerBotCommandsResult = new GetPeerBotCommandsResult$Type;
14324
+
14325
+ class RevealBotTokenInput$Type extends import_runtime4.MessageType {
14326
+ constructor() {
14327
+ super("RevealBotTokenInput", [
14328
+ { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
14329
+ ]);
14330
+ }
14331
+ create(value) {
14332
+ const message = globalThis.Object.create(this.messagePrototype);
14333
+ message.botUserId = 0n;
14334
+ if (value !== undefined)
14335
+ import_runtime3.reflectionMergePartial(this, message, value);
14336
+ return message;
14337
+ }
14338
+ internalBinaryRead(reader, length, options, target) {
14339
+ let message = target ?? this.create(), end = reader.pos + length;
14340
+ while (reader.pos < end) {
14341
+ let [fieldNo, wireType] = reader.tag();
14342
+ switch (fieldNo) {
14343
+ case 1:
14344
+ message.botUserId = reader.int64().toBigInt();
14345
+ break;
14346
+ default:
14347
+ let u = options.readUnknownField;
14348
+ if (u === "throw")
14349
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14350
+ let d = reader.skip(wireType);
14351
+ if (u !== false)
14352
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14353
+ }
14354
+ }
14355
+ return message;
14356
+ }
14357
+ internalBinaryWrite(message, writer, options) {
14358
+ if (message.botUserId !== 0n)
14359
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
14360
+ let u = options.writeUnknownFields;
14361
+ if (u !== false)
14362
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14363
+ return writer;
14364
+ }
14365
+ }
14366
+ var RevealBotTokenInput = new RevealBotTokenInput$Type;
14367
+
14368
+ class RevealBotTokenResult$Type extends import_runtime4.MessageType {
14369
+ constructor() {
14370
+ super("RevealBotTokenResult", [
14371
+ { no: 1, name: "token", kind: "scalar", T: 9 }
14372
+ ]);
14373
+ }
14374
+ create(value) {
14375
+ const message = globalThis.Object.create(this.messagePrototype);
14376
+ message.token = "";
14377
+ if (value !== undefined)
14378
+ import_runtime3.reflectionMergePartial(this, message, value);
14379
+ return message;
14380
+ }
14381
+ internalBinaryRead(reader, length, options, target) {
14382
+ let message = target ?? this.create(), end = reader.pos + length;
14383
+ while (reader.pos < end) {
14384
+ let [fieldNo, wireType] = reader.tag();
14385
+ switch (fieldNo) {
14386
+ case 1:
14387
+ message.token = reader.string();
14388
+ break;
14389
+ default:
14390
+ let u = options.readUnknownField;
14391
+ if (u === "throw")
14392
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
14393
+ let d = reader.skip(wireType);
14394
+ if (u !== false)
14395
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
14396
+ }
14397
+ }
14398
+ return message;
14399
+ }
14400
+ internalBinaryWrite(message, writer, options) {
14401
+ if (message.token !== "")
14402
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
14403
+ let u = options.writeUnknownFields;
14404
+ if (u !== false)
14405
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
14406
+ return writer;
14407
+ }
14408
+ }
14409
+ var RevealBotTokenResult = new RevealBotTokenResult$Type;
14410
+
14411
+ class RotateBotTokenInput$Type extends import_runtime4.MessageType {
14412
+ constructor() {
14413
+ super("RotateBotTokenInput", [
13431
14414
  { no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
13432
14415
  ]);
13433
14416
  }
@@ -17117,7 +18100,8 @@ class Update$Type extends import_runtime4.MessageType {
17117
18100
  { no: 36, name: "message_action_answered", kind: "message", oneof: "update", T: () => UpdateMessageActionAnswered },
17118
18101
  { no: 37, name: "clear_chat_history", kind: "message", oneof: "update", T: () => UpdateClearChatHistory },
17119
18102
  { no: 38, name: "bot_presence", kind: "message", oneof: "update", T: () => UpdateBotPresence },
17120
- { no: 39, name: "dialog_follow_mode", kind: "message", oneof: "update", T: () => UpdateDialogFollowMode }
18103
+ { no: 39, name: "dialog_follow_mode", kind: "message", oneof: "update", T: () => UpdateDialogFollowMode },
18104
+ { no: 40, name: "updated_user", kind: "message", oneof: "update", T: () => UpdateUpdatedUser }
17121
18105
  ]);
17122
18106
  }
17123
18107
  create(value) {
@@ -17354,6 +18338,12 @@ class Update$Type extends import_runtime4.MessageType {
17354
18338
  dialogFollowMode: UpdateDialogFollowMode.internalBinaryRead(reader, reader.uint32(), options, message.update.dialogFollowMode)
17355
18339
  };
17356
18340
  break;
18341
+ case 40:
18342
+ message.update = {
18343
+ oneofKind: "updatedUser",
18344
+ updatedUser: UpdateUpdatedUser.internalBinaryRead(reader, reader.uint32(), options, message.update.updatedUser)
18345
+ };
18346
+ break;
17357
18347
  default:
17358
18348
  let u = options.readUnknownField;
17359
18349
  if (u === "throw")
@@ -17442,6 +18432,8 @@ class Update$Type extends import_runtime4.MessageType {
17442
18432
  UpdateBotPresence.internalBinaryWrite(message.update.botPresence, writer.tag(38, import_runtime.WireType.LengthDelimited).fork(), options).join();
17443
18433
  if (message.update.oneofKind === "dialogFollowMode")
17444
18434
  UpdateDialogFollowMode.internalBinaryWrite(message.update.dialogFollowMode, writer.tag(39, import_runtime.WireType.LengthDelimited).fork(), options).join();
18435
+ if (message.update.oneofKind === "updatedUser")
18436
+ UpdateUpdatedUser.internalBinaryWrite(message.update.updatedUser, writer.tag(40, import_runtime.WireType.LengthDelimited).fork(), options).join();
17445
18437
  let u = options.writeUnknownFields;
17446
18438
  if (u !== false)
17447
18439
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -17912,6 +18904,48 @@ class UpdateUserSettings$Type extends import_runtime4.MessageType {
17912
18904
  }
17913
18905
  var UpdateUserSettings = new UpdateUserSettings$Type;
17914
18906
 
18907
+ class UpdateUpdatedUser$Type extends import_runtime4.MessageType {
18908
+ constructor() {
18909
+ super("UpdateUpdatedUser", [
18910
+ { no: 1, name: "user", kind: "message", T: () => User }
18911
+ ]);
18912
+ }
18913
+ create(value) {
18914
+ const message = globalThis.Object.create(this.messagePrototype);
18915
+ if (value !== undefined)
18916
+ import_runtime3.reflectionMergePartial(this, message, value);
18917
+ return message;
18918
+ }
18919
+ internalBinaryRead(reader, length, options, target) {
18920
+ let message = target ?? this.create(), end = reader.pos + length;
18921
+ while (reader.pos < end) {
18922
+ let [fieldNo, wireType] = reader.tag();
18923
+ switch (fieldNo) {
18924
+ case 1:
18925
+ message.user = User.internalBinaryRead(reader, reader.uint32(), options, message.user);
18926
+ break;
18927
+ default:
18928
+ let u = options.readUnknownField;
18929
+ if (u === "throw")
18930
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
18931
+ let d = reader.skip(wireType);
18932
+ if (u !== false)
18933
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
18934
+ }
18935
+ }
18936
+ return message;
18937
+ }
18938
+ internalBinaryWrite(message, writer, options) {
18939
+ if (message.user)
18940
+ User.internalBinaryWrite(message.user, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
18941
+ let u = options.writeUnknownFields;
18942
+ if (u !== false)
18943
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
18944
+ return writer;
18945
+ }
18946
+ }
18947
+ var UpdateUpdatedUser = new UpdateUpdatedUser$Type;
18948
+
17915
18949
  class UpdateSpaceMemberAdd$Type extends import_runtime4.MessageType {
17916
18950
  constructor() {
17917
18951
  super("UpdateSpaceMemberAdd", [
@@ -21078,9 +22112,12 @@ function summarizeError(error) {
21078
22112
  }
21079
22113
  function describeConnectionError(error) {
21080
22114
  const value = typeof error === "object" && error !== null ? error : null;
22115
+ const reason = typeof value?.reason === "number" ? value.reason : null;
22116
+ const reasonName = reason == null ? null : ConnectionError_Reason[reason] ?? `UNKNOWN_REASON_${reason}`;
21081
22117
  const code = typeof value?.code === "number" ? value.code : null;
21082
- const message = typeof value?.message === "string" && value.message.trim() ? value.message.trim() : "unknown";
21083
- return `server connection error${code != null ? ` (code=${code})` : ""}: ${message}`;
22118
+ const message = typeof value?.message === "string" && value.message.trim() ? value.message.trim() : reasonName ?? "unknown";
22119
+ const suffix = reasonName != null ? ` (${reasonName})` : code != null ? ` (code=${code})` : "";
22120
+ return `server connection error${suffix}: ${message}`;
21084
22121
  }
21085
22122
 
21086
22123
  // ../../node_modules/.bun/ws@8.21.0/node_modules/ws/wrapper.mjs
@@ -21376,9 +22413,17 @@ var rpcInputKindByMethod = {
21376
22413
  36: "rotateBotToken",
21377
22414
  37: "updateBotProfile",
21378
22415
  38: "getMessages",
22416
+ 56: "setBotAvatar",
22417
+ 57: "clearBotAvatar",
22418
+ 58: "getBotPresence",
22419
+ 59: "setBotPresenceState",
21379
22420
  48: "invokeMessageAction",
21380
22421
  49: "answerMessageAction",
21381
- 53: "clearChatHistory"
22422
+ 53: "clearChatHistory",
22423
+ 61: "getSessions",
22424
+ 62: "checkUsername",
22425
+ 63: "changeUsername",
22426
+ 64: "updateProfile"
21382
22427
  };
21383
22428
  var rpcResultKindByMethod = {
21384
22429
  0: undefined,
@@ -21420,9 +22465,17 @@ var rpcResultKindByMethod = {
21420
22465
  36: "rotateBotToken",
21421
22466
  37: "updateBotProfile",
21422
22467
  38: "getMessages",
22468
+ 56: "setBotAvatar",
22469
+ 57: "clearBotAvatar",
22470
+ 58: "getBotPresence",
22471
+ 59: "setBotPresenceState",
21423
22472
  48: "invokeMessageAction",
21424
22473
  49: "answerMessageAction",
21425
- 53: "clearChatHistory"
22474
+ 53: "clearChatHistory",
22475
+ 61: "getSessions",
22476
+ 62: "checkUsername",
22477
+ 63: "changeUsername",
22478
+ 64: "updateProfile"
21426
22479
  };
21427
22480
 
21428
22481
  // ../sdk/dist/sdk/logger.js
@@ -21472,6 +22525,26 @@ function extractFirstMessageId(updates) {
21472
22525
  }
21473
22526
  return null;
21474
22527
  }
22528
+ function botPresenceStateKind(kind) {
22529
+ switch (kind) {
22530
+ case "idle":
22531
+ return BotPresenceState_Kind.IDLE;
22532
+ case "happy":
22533
+ return BotPresenceState_Kind.HAPPY;
22534
+ case "waving":
22535
+ return BotPresenceState_Kind.WAVING;
22536
+ case "jumping":
22537
+ return BotPresenceState_Kind.JUMPING;
22538
+ case "failed":
22539
+ return BotPresenceState_Kind.FAILED;
22540
+ case "waiting":
22541
+ return BotPresenceState_Kind.WAITING;
22542
+ case "running":
22543
+ return BotPresenceState_Kind.RUNNING;
22544
+ case "review":
22545
+ return BotPresenceState_Kind.REVIEW;
22546
+ }
22547
+ }
21475
22548
 
21476
22549
  class InlineSdkClient {
21477
22550
  options;
@@ -21605,7 +22678,17 @@ class InlineSdkClient {
21605
22678
  const chat = result.getChat.chat;
21606
22679
  if (!chat)
21607
22680
  throw new Error("getChat: missing chat");
21608
- return { chatId: chat.id, peer: chat.peerId, title: chat.title };
22681
+ return {
22682
+ chatId: chat.id,
22683
+ title: chat.title,
22684
+ ...chat.peerId != null ? { peer: chat.peerId } : {},
22685
+ ...chat.spaceId != null ? { spaceId: chat.spaceId } : {},
22686
+ ...chat.parentChatId != null ? { parentChatId: chat.parentChatId } : {},
22687
+ ...chat.parentMessageId != null ? { parentMessageId: chat.parentMessageId } : {},
22688
+ ...chat.isPublic != null ? { isPublic: chat.isPublic } : {},
22689
+ ...chat.untitled != null ? { untitled: chat.untitled } : {},
22690
+ ...chat.number != null ? { number: chat.number } : {}
22691
+ };
21609
22692
  }
21610
22693
  async getMessages(params) {
21611
22694
  const peerId = this.inputPeerFromTarget(params, "getMessages");
@@ -21766,6 +22849,19 @@ class InlineSdkClient {
21766
22849
  }
21767
22850
  });
21768
22851
  }
22852
+ async setBotPresenceState(params) {
22853
+ const peerId = this.inputPeerFromTarget(params, "setBotPresenceState");
22854
+ await this.invoke(Method.SET_BOT_PRESENCE_STATE, {
22855
+ oneofKind: "setBotPresenceState",
22856
+ setBotPresenceState: {
22857
+ peerId,
22858
+ state: {
22859
+ kind: botPresenceStateKind(params.kind),
22860
+ ...params.comment ? { comment: params.comment } : {}
22861
+ }
22862
+ }
22863
+ });
22864
+ }
21769
22865
  async invokeMessageAction(params) {
21770
22866
  const peerId = this.inputPeerFromTarget(params, "invokeMessageAction");
21771
22867
  const actionId = params.actionId.trim();
@@ -21872,8 +22968,11 @@ class InlineSdkClient {
21872
22968
  oneofKind: "getUpdatesState",
21873
22969
  getUpdatesState: GetUpdatesStateInput.create({ date })
21874
22970
  }, { timeoutMs: 1500 });
21875
- this.state.dateCursor = result.getUpdatesState.date;
21876
- this.scheduleStateSave();
22971
+ const state = result.getUpdatesState;
22972
+ if (state.updatesFound === false) {
22973
+ this.state.dateCursor = state.date;
22974
+ this.scheduleStateSave();
22975
+ }
21877
22976
  } catch (error) {
21878
22977
  this.log.warn?.("GET_UPDATES_STATE failed (continuing without date cursor)", error);
21879
22978
  }
@@ -37289,6 +38388,7 @@ var InlineActionsSchema = exports_external.object({
37289
38388
  reactions: exports_external.boolean().optional(),
37290
38389
  read: exports_external.boolean().optional(),
37291
38390
  search: exports_external.boolean().optional(),
38391
+ translate: exports_external.boolean().optional(),
37292
38392
  edit: exports_external.boolean().optional(),
37293
38393
  channels: exports_external.boolean().optional(),
37294
38394
  participants: exports_external.boolean().optional(),
@@ -37412,6 +38512,8 @@ var InlineAccountSchemaBase = exports_external.object({
37412
38512
  dmHistoryLimit: exports_external.number().int().min(0).optional(),
37413
38513
  parseMarkdown: exports_external.boolean().optional(),
37414
38514
  mediaMaxMb: exports_external.number().positive().optional(),
38515
+ debounceMs: exports_external.number().int().min(0).optional(),
38516
+ voiceTranscriptWaitMs: exports_external.number().int().min(0).max(60000).optional(),
37415
38517
  actions: InlineActionsSchema.optional(),
37416
38518
  reactionNotifications: InlineReactionNotificationsSchema.optional(),
37417
38519
  reactionAllowlist: exports_external.array(InlineAllowEntrySchema).optional(),
@@ -37785,6 +38887,7 @@ var OPENCLAW_LEGACY_UNTRUSTED_RESULT_BEGIN = "<<<BEGIN_UNTRUSTED_CHILD_RESULT>>>
37785
38887
  var OPENCLAW_LEGACY_UNTRUSTED_RESULT_END = "<<<END_UNTRUSTED_CHILD_RESULT>>>";
37786
38888
  var INLINE_ACTION_LABEL_MAX_LENGTH = 64;
37787
38889
  var INLINE_ACTION_CALLBACK_DATA_MAX_BYTES = 1024;
38890
+ var INLINE_ACTION_COPY_TEXT_MAX_LENGTH = 4096;
37788
38891
  var utf8Encoder = new TextEncoder;
37789
38892
  function escapeRegExp(value) {
37790
38893
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -38003,6 +39106,14 @@ function sanitizeInlineActionCallbackData(raw) {
38003
39106
  return null;
38004
39107
  return text;
38005
39108
  }
39109
+ function sanitizeInlineActionCopyText(raw) {
39110
+ const text = raw?.trim();
39111
+ if (!text)
39112
+ return null;
39113
+ if (text.length > INLINE_ACTION_COPY_TEXT_MAX_LENGTH)
39114
+ return null;
39115
+ return text;
39116
+ }
38006
39117
 
38007
39118
  // src/inline/normalize.ts
38008
39119
  function normalizeInlineTarget(raw) {
@@ -38249,6 +39360,11 @@ var InlineBotPresenceToolParameters = {
38249
39360
  type: "object",
38250
39361
  additionalProperties: false,
38251
39362
  properties: {
39363
+ action: {
39364
+ type: "string",
39365
+ enum: ["set", "get"],
39366
+ description: "Presence operation. Defaults to `set`; use `get` to read the current bot avatar/state for a peer."
39367
+ },
38252
39368
  kind: {
38253
39369
  type: "string",
38254
39370
  enum: INLINE_BOT_PRESENCE_KINDS,
@@ -38279,9 +39395,10 @@ var InlineBotPresenceToolParameters = {
38279
39395
  type: "string",
38280
39396
  description: "Optional Inline account id override."
38281
39397
  }
38282
- },
38283
- required: ["kind"]
39398
+ }
38284
39399
  };
39400
+ 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;
39401
+ 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
39402
  function resolvePeerTarget(params) {
38286
39403
  if (params.direct) {
38287
39404
  return {
@@ -38373,7 +39490,15 @@ function normalizeInlineBotPresenceKind(value) {
38373
39490
  }
38374
39491
  throw new Error(`inline_bot_presence: invalid kind "${value}"`);
38375
39492
  }
38376
- function botPresenceStateKind(kind) {
39493
+ function resolveInlineBotPresenceAction(args) {
39494
+ const action = typeof args.action === "string" ? args.action.trim().toLowerCase() : "";
39495
+ if (!action || action === "set" || action === "update")
39496
+ return "set";
39497
+ if (action === "get" || action === "read" || action === "status")
39498
+ return "get";
39499
+ throw new Error(`inline_bot_presence: invalid action "${args.action}"`);
39500
+ }
39501
+ function botPresenceStateKind2(kind) {
38377
39502
  switch (kind) {
38378
39503
  case "idle":
38379
39504
  return BotPresenceState_Kind.IDLE;
@@ -38393,6 +39518,28 @@ function botPresenceStateKind(kind) {
38393
39518
  return BotPresenceState_Kind.REVIEW;
38394
39519
  }
38395
39520
  }
39521
+ function botPresenceKindFromState(kind) {
39522
+ switch (kind) {
39523
+ case BotPresenceState_Kind.IDLE:
39524
+ return "idle";
39525
+ case BotPresenceState_Kind.HAPPY:
39526
+ return "happy";
39527
+ case BotPresenceState_Kind.WAVING:
39528
+ return "waving";
39529
+ case BotPresenceState_Kind.JUMPING:
39530
+ return "jumping";
39531
+ case BotPresenceState_Kind.FAILED:
39532
+ return "failed";
39533
+ case BotPresenceState_Kind.WAITING:
39534
+ return "waiting";
39535
+ case BotPresenceState_Kind.RUNNING:
39536
+ return "running";
39537
+ case BotPresenceState_Kind.REVIEW:
39538
+ return "review";
39539
+ default:
39540
+ return null;
39541
+ }
39542
+ }
38396
39543
  function normalizeInlineBotPresenceComment(value) {
38397
39544
  if (typeof value !== "string")
38398
39545
  return;
@@ -38485,6 +39632,7 @@ function createInlineBotPresenceTool(ctx) {
38485
39632
  throw new Error("inline_bot_presence: missing OpenClaw config");
38486
39633
  }
38487
39634
  const args = rawArgs;
39635
+ const action = resolveInlineBotPresenceAction(args);
38488
39636
  const fallbackTarget = parseCurrentInlineTarget(ctx);
38489
39637
  const { target, usedFallback } = resolvePeerTarget({
38490
39638
  label: "target",
@@ -38493,24 +39641,56 @@ function createInlineBotPresenceTool(ctx) {
38493
39641
  userId: args.userId,
38494
39642
  fallback: fallbackTarget
38495
39643
  });
39644
+ if (action === "get") {
39645
+ return await withInlineClient({
39646
+ cfg: ctx.config,
39647
+ accountId: args.accountId ?? ctx.agentAccountId ?? null,
39648
+ fn: async (client, resolvedAccountId) => {
39649
+ const result = await client.invokeRaw(GET_BOT_PRESENCE_METHOD, {
39650
+ oneofKind: "getBotPresence",
39651
+ getBotPresence: {
39652
+ peerId: target.peerId
39653
+ }
39654
+ });
39655
+ if (result.oneofKind !== "getBotPresence") {
39656
+ throw new Error(`inline_bot_presence: expected getBotPresence result, got ${String(result.oneofKind)}`);
39657
+ }
39658
+ const state = result.getBotPresence.state ?? null;
39659
+ return jsonResult({
39660
+ ok: true,
39661
+ action,
39662
+ accountId: resolvedAccountId,
39663
+ target: target.normalized,
39664
+ usedCurrentChatDefault: usedFallback,
39665
+ botUserId: result.getBotPresence.botUserId != null ? String(result.getBotPresence.botUserId) : null,
39666
+ avatar: result.getBotPresence.avatar ?? null,
39667
+ state,
39668
+ kind: state ? botPresenceKindFromState(state.kind) : null,
39669
+ comment: typeof state?.comment === "string" ? state.comment : null,
39670
+ peerId: result.getBotPresence.peerId ?? null
39671
+ });
39672
+ }
39673
+ });
39674
+ }
38496
39675
  const kind = normalizeInlineBotPresenceKind(args.kind);
38497
39676
  const comment = normalizeInlineBotPresenceComment(args.comment);
38498
39677
  return await withInlineClient({
38499
39678
  cfg: ctx.config,
38500
39679
  accountId: args.accountId ?? ctx.agentAccountId ?? null,
38501
39680
  fn: async (client, resolvedAccountId) => {
38502
- await client.invokeRaw(Method.SET_BOT_PRESENCE_STATE, {
39681
+ await client.invokeRaw(SET_BOT_PRESENCE_STATE_METHOD, {
38503
39682
  oneofKind: "setBotPresenceState",
38504
39683
  setBotPresenceState: {
38505
39684
  peerId: target.peerId,
38506
39685
  state: {
38507
- kind: botPresenceStateKind(kind),
39686
+ kind: botPresenceStateKind2(kind),
38508
39687
  ...comment ? { comment } : {}
38509
39688
  }
38510
39689
  }
38511
39690
  });
38512
39691
  return jsonResult({
38513
39692
  ok: true,
39693
+ action,
38514
39694
  accountId: resolvedAccountId,
38515
39695
  target: target.normalized,
38516
39696
  usedCurrentChatDefault: usedFallback,
@@ -38645,7 +39825,11 @@ var InlineMembersToolParameters = {
38645
39825
  properties: {
38646
39826
  spaceId: {
38647
39827
  type: "string",
38648
- description: "Inline space id whose members should be listed."
39828
+ description: "Inline space id whose members should be listed. Optional inside an Inline space chat/reply thread."
39829
+ },
39830
+ space: {
39831
+ type: "string",
39832
+ description: "Alias for spaceId."
38649
39833
  },
38650
39834
  query: {
38651
39835
  type: "string",
@@ -38663,9 +39847,9 @@ var InlineMembersToolParameters = {
38663
39847
  type: "string",
38664
39848
  description: "Optional Inline account id override."
38665
39849
  }
38666
- },
38667
- required: ["spaceId"]
39850
+ }
38668
39851
  };
39852
+ var GET_CHAT_METHOD = typeof Method.GET_CHAT === "number" && Number.isInteger(Method.GET_CHAT) && Method.GET_CHAT > 0 ? Method.GET_CHAT : 25;
38669
39853
  function parseRequiredId(raw, label) {
38670
39854
  const trimmed = raw.trim();
38671
39855
  if (!trimmed) {
@@ -38676,6 +39860,11 @@ function parseRequiredId(raw, label) {
38676
39860
  }
38677
39861
  return BigInt(trimmed);
38678
39862
  }
39863
+ function parseOptionalId(raw, label) {
39864
+ if (raw == null || !raw.trim())
39865
+ return;
39866
+ return parseRequiredId(raw, label);
39867
+ }
38679
39868
  function resolveLimit(raw) {
38680
39869
  const parsed = typeof raw === "number" && Number.isFinite(raw) ? Math.trunc(raw) : 100;
38681
39870
  return Math.max(1, Math.min(200, parsed));
@@ -38726,6 +39915,70 @@ async function withInlineClient2(params) {
38726
39915
  await client.close().catch(() => {});
38727
39916
  }
38728
39917
  }
39918
+ function buildChatPeer(chatId) {
39919
+ return {
39920
+ type: {
39921
+ oneofKind: "chat",
39922
+ chat: { chatId }
39923
+ }
39924
+ };
39925
+ }
39926
+ async function loadChatSpaceId(params) {
39927
+ const result = await params.client.invokeRaw(GET_CHAT_METHOD, {
39928
+ oneofKind: "getChat",
39929
+ getChat: {
39930
+ peerId: buildChatPeer(params.chatId)
39931
+ }
39932
+ });
39933
+ if (result.oneofKind !== "getChat") {
39934
+ throw new Error(`inline_members: expected getChat result, got ${String(result.oneofKind)}`);
39935
+ }
39936
+ return result.getChat.chat?.spaceId ?? result.getChat.dialog?.spaceId;
39937
+ }
39938
+ async function resolveMembersSpaceId(params) {
39939
+ const explicitSpaceId = parseOptionalId(params.args.spaceId?.trim() ? params.args.spaceId : params.args.space, "spaceId");
39940
+ if (explicitSpaceId != null) {
39941
+ return {
39942
+ spaceId: explicitSpaceId,
39943
+ inferred: false,
39944
+ source: "explicit",
39945
+ chatId: null
39946
+ };
39947
+ }
39948
+ const session = parseCurrentInlineSession(params.ctx);
39949
+ const peer = session?.target.peerId.type;
39950
+ if (peer?.oneofKind !== "chat") {
39951
+ throw new Error("inline_members: spaceId is required outside an Inline space chat or reply thread");
39952
+ }
39953
+ const currentChatId = peer.chat.chatId;
39954
+ const currentSpaceId = await loadChatSpaceId({
39955
+ client: params.client,
39956
+ chatId: currentChatId
39957
+ });
39958
+ if (currentSpaceId != null) {
39959
+ return {
39960
+ spaceId: currentSpaceId,
39961
+ inferred: true,
39962
+ source: "current-chat",
39963
+ chatId: String(currentChatId)
39964
+ };
39965
+ }
39966
+ if (session?.parentChatId != null && session.parentChatId !== currentChatId) {
39967
+ const parentSpaceId = await loadChatSpaceId({
39968
+ client: params.client,
39969
+ chatId: session.parentChatId
39970
+ });
39971
+ if (parentSpaceId != null) {
39972
+ return {
39973
+ spaceId: parentSpaceId,
39974
+ inferred: true,
39975
+ source: "parent-chat",
39976
+ chatId: String(session.parentChatId)
39977
+ };
39978
+ }
39979
+ }
39980
+ throw new Error("inline_members: current Inline chat is not part of a space; pass spaceId explicitly");
39981
+ }
38729
39982
  function createInlineMembersTool(ctx) {
38730
39983
  if (!ctx.config) {
38731
39984
  return null;
@@ -38733,20 +39986,24 @@ function createInlineMembersTool(ctx) {
38733
39986
  return {
38734
39987
  name: "inline_members",
38735
39988
  label: "Inline Members",
38736
- description: "List or search Inline space members by space id so the agent can identify who to DM or manage.",
39989
+ 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
39990
  parameters: InlineMembersToolParameters,
38738
39991
  execute: async (_toolCallId, rawArgs) => {
38739
39992
  const args = rawArgs;
38740
- const spaceId = parseRequiredId(args.spaceId, "spaceId");
38741
39993
  const userId = args.userId ? parseRequiredId(args.userId, "userId") : undefined;
38742
39994
  const limit = resolveLimit(args.limit);
38743
39995
  return await withInlineClient2({
38744
39996
  cfg: ctx.config,
38745
39997
  accountId: args.accountId ?? ctx.agentAccountId ?? null,
38746
39998
  fn: async (client, resolvedAccountId) => {
39999
+ const resolvedSpace = await resolveMembersSpaceId({
40000
+ args,
40001
+ client,
40002
+ ctx
40003
+ });
38747
40004
  const members = await getSpaceMembersWithUsers({
38748
40005
  client,
38749
- spaceId
40006
+ spaceId: resolvedSpace.spaceId
38750
40007
  });
38751
40008
  const filteredMembers = filterSpaceMembers({
38752
40009
  members,
@@ -38757,7 +40014,10 @@ function createInlineMembersTool(ctx) {
38757
40014
  return jsonResult2({
38758
40015
  ok: true,
38759
40016
  accountId: resolvedAccountId,
38760
- spaceId: String(spaceId),
40017
+ spaceId: String(resolvedSpace.spaceId),
40018
+ inferredSpaceId: resolvedSpace.inferred,
40019
+ spaceIdSource: resolvedSpace.source,
40020
+ sourceChatId: resolvedSpace.chatId,
38761
40021
  query: args.query ?? null,
38762
40022
  userId: userId != null ? String(userId) : null,
38763
40023
  count: filteredMembers.length,
@@ -38950,7 +40210,8 @@ function messageAttachmentSummaries(message) {
38950
40210
  const previewPhoto = preview.photo ? bestPhotoSize(preview.photo).cdnUrl : null;
38951
40211
  attachments.push({
38952
40212
  kind: "urlPreview",
38953
- id: preview.id?.toString() ?? null,
40213
+ id: item.id?.toString() ?? null,
40214
+ urlPreviewId: preview.id?.toString() ?? null,
38954
40215
  url: preview.url ?? null,
38955
40216
  siteName: preview.siteName ?? null,
38956
40217
  title: preview.title ?? null,
@@ -38963,7 +40224,8 @@ function messageAttachmentSummaries(message) {
38963
40224
  const task = item.attachment.externalTask;
38964
40225
  attachments.push({
38965
40226
  kind: "externalTask",
38966
- id: task.id?.toString() ?? null,
40227
+ id: item.id?.toString() ?? null,
40228
+ externalTaskId: task.id?.toString() ?? null,
38967
40229
  url: task.url ?? null,
38968
40230
  application: task.application ?? null,
38969
40231
  title: task.title ?? null,
@@ -39193,11 +40455,11 @@ function summarizeInlineMessageContent(message) {
39193
40455
  }
39194
40456
 
39195
40457
  // 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;
40458
+ var GET_CHAT_METHOD2 = typeof Method.GET_CHAT === "number" && Number.isInteger(Method.GET_CHAT) && Method.GET_CHAT > 0 ? Method.GET_CHAT : 25;
39197
40459
  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
40460
  var GET_MESSAGES_METHOD = typeof Method.GET_MESSAGES === "number" && Number.isInteger(Method.GET_MESSAGES) && Method.GET_MESSAGES > 0 ? Method.GET_MESSAGES : 38;
39199
40461
  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) {
40462
+ function buildChatPeer2(chatId) {
39201
40463
  return {
39202
40464
  type: {
39203
40465
  oneofKind: "chat",
@@ -39230,9 +40492,9 @@ function resolveInlineReplyThreadChatId(params) {
39230
40492
  return normalized ?? params.parentChatId;
39231
40493
  }
39232
40494
  async function loadInlineReplyThreadMetadata(params) {
39233
- const result = await params.client.invokeRaw(GET_CHAT_METHOD, {
40495
+ const result = await params.client.invokeRaw(GET_CHAT_METHOD2, {
39234
40496
  oneofKind: "getChat",
39235
- getChat: { peerId: buildChatPeer(params.chatId) }
40497
+ getChat: { peerId: buildChatPeer2(params.chatId) }
39236
40498
  }).catch(() => null);
39237
40499
  if (result?.oneofKind !== "getChat") {
39238
40500
  return null;
@@ -39253,7 +40515,7 @@ async function loadInlineReplyThreadAnchorMessage(params) {
39253
40515
  const directResult = await params.client.invokeRaw(GET_MESSAGES_METHOD, {
39254
40516
  oneofKind: "getMessages",
39255
40517
  getMessages: {
39256
- peerId: buildChatPeer(params.parentChatId),
40518
+ peerId: buildChatPeer2(params.parentChatId),
39257
40519
  messageIds: [params.parentMessageId]
39258
40520
  }
39259
40521
  }).catch(() => null);
@@ -39266,7 +40528,7 @@ async function loadInlineReplyThreadAnchorMessage(params) {
39266
40528
  const historyResult = await params.client.invokeRaw(GET_CHAT_HISTORY_METHOD, {
39267
40529
  oneofKind: "getChatHistory",
39268
40530
  getChatHistory: {
39269
- peerId: buildChatPeer(params.parentChatId),
40531
+ peerId: buildChatPeer2(params.parentChatId),
39270
40532
  offsetId: params.parentMessageId + 1n,
39271
40533
  limit: 8
39272
40534
  }
@@ -39303,6 +40565,10 @@ async function createInlineReplyThreadForMessage(params) {
39303
40565
 
39304
40566
  // src/inline/parent-context-tool.ts
39305
40567
  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;
40568
+ var HISTORY_MODE_LATEST = 1;
40569
+ var HISTORY_MODE_OLDER = 2;
40570
+ var HISTORY_MODE_NEWER = 3;
40571
+ var HISTORY_MODE_AROUND = 4;
39306
40572
  var InlineParentContextToolParameters = {
39307
40573
  type: "object",
39308
40574
  additionalProperties: false,
@@ -39331,10 +40597,39 @@ var InlineParentContextToolParameters = {
39331
40597
  type: "string",
39332
40598
  description: "Optional message id to page older parent-chat context before. Defaults to the reply-thread anchor when known."
39333
40599
  },
40600
+ afterMessageId: {
40601
+ type: "string",
40602
+ description: "Optional message id to page newer parent-chat context after."
40603
+ },
40604
+ messageId: {
40605
+ type: "string",
40606
+ description: "Optional parent-chat message id to fetch context around."
40607
+ },
40608
+ aroundMessageId: {
40609
+ type: "string",
40610
+ description: "Alias for `messageId` when fetching context around a parent-chat message."
40611
+ },
40612
+ aroundId: {
40613
+ type: "string",
40614
+ description: "Alias for `messageId`."
40615
+ },
40616
+ mode: {
40617
+ type: "string",
40618
+ enum: ["latest", "older", "newer", "around"],
40619
+ description: "Optional history mode. Defaults to around the reply-thread anchor when known, otherwise latest; explicit ids infer older/newer/around."
40620
+ },
39334
40621
  limit: {
39335
40622
  type: "number",
39336
40623
  description: "Number of parent-chat messages to return, clamped to 1..100. Defaults to 50."
39337
40624
  },
40625
+ beforeLimit: {
40626
+ type: "number",
40627
+ description: "Around mode count for messages before the anchor, clamped to 0..100."
40628
+ },
40629
+ afterLimit: {
40630
+ type: "number",
40631
+ description: "Around mode count for messages after the anchor, clamped to 0..100."
40632
+ },
39338
40633
  includeAnchor: {
39339
40634
  type: "boolean",
39340
40635
  description: "Whether to include the reply-thread anchor/root message when parentMessageId is known. Defaults to true."
@@ -39345,7 +40640,7 @@ var InlineParentContextToolParameters = {
39345
40640
  }
39346
40641
  }
39347
40642
  };
39348
- function buildChatPeer2(chatId) {
40643
+ function buildChatPeer3(chatId) {
39349
40644
  return {
39350
40645
  type: {
39351
40646
  oneofKind: "chat",
@@ -39362,6 +40657,38 @@ function readLimit(raw, fallback) {
39362
40657
  }
39363
40658
  return Math.max(1, Math.min(100, value));
39364
40659
  }
40660
+ function readWindowLimit(raw, label) {
40661
+ if (raw == null)
40662
+ return;
40663
+ const value = typeof raw === "number" ? raw : typeof raw === "string" ? Number(raw.trim()) : Number.NaN;
40664
+ if (!Number.isFinite(value) || !Number.isInteger(value)) {
40665
+ throw new Error(`inline_parent_context: ${label} must be an integer`);
40666
+ }
40667
+ return Math.max(0, Math.min(100, value));
40668
+ }
40669
+ function readMode(raw) {
40670
+ if (raw == null)
40671
+ return null;
40672
+ if (typeof raw !== "string") {
40673
+ throw new Error("inline_parent_context: mode must be latest, older, newer, or around");
40674
+ }
40675
+ switch (raw.trim().toLowerCase()) {
40676
+ case "":
40677
+ return null;
40678
+ case "latest":
40679
+ return "latest";
40680
+ case "older":
40681
+ case "before":
40682
+ return "older";
40683
+ case "newer":
40684
+ case "after":
40685
+ return "newer";
40686
+ case "around":
40687
+ return "around";
40688
+ default:
40689
+ throw new Error("inline_parent_context: mode must be latest, older, newer, or around");
40690
+ }
40691
+ }
39365
40692
  function readIdCandidate(...values) {
39366
40693
  for (const value of values) {
39367
40694
  if (value == null)
@@ -39391,7 +40718,7 @@ function parseOptionalChatId(raw, label) {
39391
40718
  }
39392
40719
  return parseOptionalInlineId(raw, label);
39393
40720
  }
39394
- function mapContextMessage(message, parentMessageId) {
40721
+ function mapContextMessage(message, anchorMessageId) {
39395
40722
  const content = summarizeInlineMessageContent(message);
39396
40723
  return {
39397
40724
  id: String(message.id),
@@ -39403,7 +40730,7 @@ function mapContextMessage(message, parentMessageId) {
39403
40730
  entityText: content.entityText,
39404
40731
  out: Boolean(message.out),
39405
40732
  replyToId: message.replyToMsgId != null ? String(message.replyToMsgId) : undefined,
39406
- isAnchor: parentMessageId != null && message.id === parentMessageId,
40733
+ isAnchor: anchorMessageId != null && message.id === anchorMessageId,
39407
40734
  attachmentUrls: content.attachmentUrls,
39408
40735
  links: content.links,
39409
40736
  media: content.media,
@@ -39421,21 +40748,6 @@ function sortMessages(messages) {
39421
40748
  return a.id < b.id ? -1 : 1;
39422
40749
  });
39423
40750
  }
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
40751
  async function withInlineClient3(params) {
39440
40752
  const account = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId ?? null });
39441
40753
  if (!account.configured || !account.baseUrl) {
@@ -39454,14 +40766,13 @@ async function withInlineClient3(params) {
39454
40766
  }
39455
40767
  }
39456
40768
  async function loadParentHistory(params) {
39457
- if (params.limit <= 0)
40769
+ if (params.input.limit <= 0)
39458
40770
  return [];
39459
40771
  const result = await params.client.invokeRaw(GET_CHAT_HISTORY_METHOD2, {
39460
40772
  oneofKind: "getChatHistory",
39461
40773
  getChatHistory: {
39462
- peerId: buildChatPeer2(params.parentChatId),
39463
- ...params.offsetId != null ? { offsetId: params.offsetId } : {},
39464
- limit: params.limit
40774
+ peerId: buildChatPeer3(params.parentChatId),
40775
+ ...params.input
39465
40776
  }
39466
40777
  });
39467
40778
  if (result.oneofKind !== "getChatHistory") {
@@ -39469,36 +40780,96 @@ async function loadParentHistory(params) {
39469
40780
  }
39470
40781
  return result.getChatHistory.messages ?? [];
39471
40782
  }
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
- }));
40783
+ function resolveParentContextHistoryRequest(params) {
40784
+ if (params.aroundMessageId != null && (params.beforeMessageId != null || params.afterMessageId != null)) {
40785
+ throw new Error("inline_parent_context: messageId/aroundMessageId cannot be combined with before or after");
39480
40786
  }
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
- }));
40787
+ if (params.beforeMessageId != null && params.afterMessageId != null) {
40788
+ throw new Error("inline_parent_context: pass only one of beforeMessageId or afterMessageId");
39488
40789
  }
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] : []]));
40790
+ const mode = params.explicitMode ?? (params.aroundMessageId != null ? "around" : params.afterMessageId != null ? "newer" : params.beforeMessageId != null ? "older" : params.parentMessageId != null ? "around" : "latest");
40791
+ if (mode !== "around" && (params.beforeLimit !== undefined || params.afterLimit !== undefined)) {
40792
+ throw new Error("inline_parent_context: beforeLimit and afterLimit are only valid with around mode");
40793
+ }
40794
+ if (mode === "latest") {
40795
+ if (params.aroundMessageId != null || params.beforeMessageId != null || params.afterMessageId != null) {
40796
+ throw new Error("inline_parent_context: latest mode cannot be combined with message cursors");
40797
+ }
40798
+ return {
40799
+ mode,
40800
+ input: {
40801
+ mode: HISTORY_MODE_LATEST,
40802
+ limit: params.limit
40803
+ },
40804
+ anchorMessageId: null,
40805
+ beforeMessageId: null,
40806
+ afterMessageId: null,
40807
+ beforeLimit: null,
40808
+ afterLimit: null
40809
+ };
40810
+ }
40811
+ if (mode === "newer") {
40812
+ if (params.afterMessageId == null) {
40813
+ throw new Error("inline_parent_context: newer mode requires afterMessageId");
40814
+ }
40815
+ return {
40816
+ mode,
40817
+ input: {
40818
+ mode: HISTORY_MODE_NEWER,
40819
+ afterId: params.afterMessageId,
40820
+ limit: params.limit
40821
+ },
40822
+ anchorMessageId: null,
40823
+ beforeMessageId: null,
40824
+ afterMessageId: params.afterMessageId,
40825
+ beforeLimit: null,
40826
+ afterLimit: null
40827
+ };
40828
+ }
40829
+ if (mode === "older") {
40830
+ const beforeMessageId = params.beforeMessageId ?? params.parentMessageId;
40831
+ if (beforeMessageId == null) {
40832
+ throw new Error("inline_parent_context: older mode requires beforeMessageId outside a known reply thread");
40833
+ }
40834
+ return {
40835
+ mode,
40836
+ input: {
40837
+ mode: HISTORY_MODE_OLDER,
40838
+ beforeId: beforeMessageId,
40839
+ offsetId: beforeMessageId,
40840
+ limit: params.limit
40841
+ },
40842
+ anchorMessageId: null,
40843
+ beforeMessageId,
40844
+ afterMessageId: null,
40845
+ beforeLimit: null,
40846
+ afterLimit: null
40847
+ };
40848
+ }
40849
+ const anchorMessageId = params.aroundMessageId ?? params.parentMessageId;
40850
+ if (anchorMessageId == null) {
40851
+ throw new Error("inline_parent_context: around mode requires messageId outside a known reply thread");
40852
+ }
40853
+ const defaultBeforeLimit = params.aroundMessageId == null && params.parentMessageId != null ? Math.max(0, params.limit - (params.includeAnchor ? 1 : 0)) : undefined;
40854
+ const defaultAfterLimit = params.aroundMessageId == null && params.parentMessageId != null ? 0 : undefined;
40855
+ const beforeLimit = params.beforeLimit ?? defaultBeforeLimit;
40856
+ const afterLimit = params.afterLimit ?? defaultAfterLimit;
40857
+ return {
40858
+ mode,
40859
+ input: {
40860
+ mode: HISTORY_MODE_AROUND,
40861
+ anchorId: anchorMessageId,
40862
+ limit: params.limit,
40863
+ ...beforeLimit !== undefined ? { beforeLimit } : {},
40864
+ ...afterLimit !== undefined ? { afterLimit } : {},
40865
+ includeAnchor: params.includeAnchor
40866
+ },
40867
+ anchorMessageId,
40868
+ beforeMessageId: null,
40869
+ afterMessageId: null,
40870
+ beforeLimit: beforeLimit ?? null,
40871
+ afterLimit: afterLimit ?? null
40872
+ };
39502
40873
  }
39503
40874
  function createInlineParentContextTool(ctx) {
39504
40875
  if (!ctx.config)
@@ -39516,7 +40887,12 @@ function createInlineParentContextTool(ctx) {
39516
40887
  let parentChatId = parseOptionalChatId(readIdCandidate(args.parentChatId, args.chatId), "parentChatId") ?? currentSession?.parentChatId ?? null;
39517
40888
  let parentMessageId = parseOptionalInlineId(readIdCandidate(args.parentMessageId, args.anchorMessageId), "parentMessageId");
39518
40889
  const beforeMessageId = parseOptionalInlineId(readIdCandidate(args.beforeMessageId), "beforeMessageId");
40890
+ const afterMessageId = parseOptionalInlineId(readIdCandidate(args.afterMessageId), "afterMessageId");
40891
+ const aroundMessageId = parseOptionalInlineId(readIdCandidate(args.messageId, args.aroundMessageId, args.aroundId), "messageId");
40892
+ const explicitMode = readMode(args.mode);
39519
40893
  const limit = readLimit(args.limit, 50);
40894
+ const beforeLimit = readWindowLimit(args.beforeLimit, "beforeLimit");
40895
+ const afterLimit = readWindowLimit(args.afterLimit, "afterLimit");
39520
40896
  const includeAnchor = args.includeAnchor !== false;
39521
40897
  return await withInlineClient3({
39522
40898
  cfg: ctx.config,
@@ -39532,15 +40908,24 @@ function createInlineParentContextTool(ctx) {
39532
40908
  if (parentChatId == null) {
39533
40909
  throw new Error("inline_parent_context: parentChatId is required outside an Inline reply-thread session");
39534
40910
  }
39535
- const messages = (await loadParentContextMessages({
39536
- client,
39537
- parentChatId,
40911
+ const history = resolveParentContextHistoryRequest({
39538
40912
  parentMessageId,
39539
40913
  beforeMessageId,
40914
+ afterMessageId,
40915
+ aroundMessageId,
40916
+ explicitMode,
39540
40917
  includeAnchor,
39541
- limit
39542
- })).map((message) => mapContextMessage(message, parentMessageId));
40918
+ limit,
40919
+ ...beforeLimit !== undefined ? { beforeLimit } : {},
40920
+ ...afterLimit !== undefined ? { afterLimit } : {}
40921
+ });
40922
+ const messages = sortMessages(await loadParentHistory({
40923
+ client,
40924
+ parentChatId,
40925
+ input: history.input
40926
+ })).map((message) => mapContextMessage(message, history.anchorMessageId));
39543
40927
  const oldest = messages[0];
40928
+ const newest = messages[messages.length - 1];
39544
40929
  return jsonResult({
39545
40930
  ok: true,
39546
40931
  accountId: resolvedAccountId,
@@ -39548,10 +40933,17 @@ function createInlineParentContextTool(ctx) {
39548
40933
  threadId: threadId != null ? String(threadId) : null,
39549
40934
  threadTitle,
39550
40935
  parentMessageId: parentMessageId != null ? String(parentMessageId) : null,
40936
+ mode: history.mode,
40937
+ beforeMessageId: history.beforeMessageId != null ? String(history.beforeMessageId) : null,
40938
+ afterMessageId: history.afterMessageId != null ? String(history.afterMessageId) : null,
40939
+ aroundMessageId: history.anchorMessageId != null ? String(history.anchorMessageId) : null,
40940
+ beforeLimit: history.beforeLimit,
40941
+ afterLimit: history.afterLimit,
39551
40942
  limit,
39552
40943
  includeAnchor,
39553
40944
  usedCurrentThreadDefault: explicitThreadId == null && currentSession?.threadId != null,
39554
40945
  nextBeforeMessageId: oldest?.id ?? null,
40946
+ nextAfterMessageId: newest?.id ?? null,
39555
40947
  messages
39556
40948
  });
39557
40949
  }
@@ -39588,10 +40980,21 @@ var ZIP_METHOD_STORE = 0;
39588
40980
  var ZIP_METHOD_DEFLATE = 8;
39589
40981
  var ZIP_FLAG_ENCRYPTED = 1;
39590
40982
  var CODEX_ATLAS_KIND = "codex_atlas";
40983
+ 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;
40984
+ 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
40985
  var InlineBotAvatarToolParameters = {
39592
40986
  type: "object",
39593
40987
  additionalProperties: false,
39594
40988
  properties: {
40989
+ action: {
40990
+ type: "string",
40991
+ enum: ["set", "clear"],
40992
+ description: "Avatar operation. Defaults to `set`; use `clear` to remove the current bot avatar."
40993
+ },
40994
+ clear: {
40995
+ type: "boolean",
40996
+ description: "Boolean alias for action: clear."
40997
+ },
39595
40998
  zipPath: {
39596
40999
  type: "string",
39597
41000
  description: "Local path to a .zip avatar package. The archive should contain a Codex atlas manifest and a PNG/WebP spritesheet."
@@ -39649,6 +41052,21 @@ function resolvePackageSource(args) {
39649
41052
  }
39650
41053
  return source;
39651
41054
  }
41055
+ function resolveAvatarAction(args) {
41056
+ if (args.clear === true)
41057
+ return "clear";
41058
+ const action = readTrimmedString(args.action)?.toLowerCase();
41059
+ if (!action || action === "set" || action === "install" || action === "replace")
41060
+ return "set";
41061
+ if (action === "clear" || action === "remove" || action === "delete")
41062
+ return "clear";
41063
+ throw new Error(`inline_bot_avatar: invalid action "${args.action}"`);
41064
+ }
41065
+ function assertClearArgs(args) {
41066
+ if (readTrimmedString(args.zipPath) || readTrimmedString(args.archivePath) || readTrimmedString(args.zipUrl) || readTrimmedString(args.source) || readTrimmedString(args.displayName) || readTrimmedString(args.description)) {
41067
+ throw new Error("inline_bot_avatar: clear action must not include avatar package or display metadata");
41068
+ }
41069
+ }
39652
41070
  function sourceWithoutQuery(raw) {
39653
41071
  return raw.split(/[?#]/, 1)[0] ?? raw;
39654
41072
  }
@@ -39877,10 +41295,39 @@ function createInlineBotAvatarTool(ctx) {
39877
41295
  return {
39878
41296
  name: "inline_bot_avatar",
39879
41297
  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.",
41298
+ 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
41299
  parameters: InlineBotAvatarToolParameters,
39882
41300
  execute: async (_toolCallId, rawArgs) => {
39883
41301
  const args = rawArgs;
41302
+ const action = resolveAvatarAction(args);
41303
+ if (action === "clear") {
41304
+ assertClearArgs(args);
41305
+ return await withInlineClient4({
41306
+ cfg: ctx.config,
41307
+ accountId: args.accountId ?? ctx.agentAccountId ?? null,
41308
+ fn: async (client, resolvedAccountId) => {
41309
+ const me = await client.getMe();
41310
+ const result = await client.invokeRaw(CLEAR_BOT_AVATAR_METHOD, {
41311
+ oneofKind: "clearBotAvatar",
41312
+ clearBotAvatar: {
41313
+ botUserId: me.userId
41314
+ }
41315
+ });
41316
+ if (result.oneofKind !== "clearBotAvatar") {
41317
+ throw new Error(`inline_bot_avatar: expected clearBotAvatar result, got ${String(result.oneofKind)}`);
41318
+ }
41319
+ return jsonResult({
41320
+ ok: true,
41321
+ action,
41322
+ accountId: resolvedAccountId,
41323
+ botUserId: String(me.userId),
41324
+ cleared: true,
41325
+ avatar: null,
41326
+ bot: result.clearBotAvatar.bot ?? null
41327
+ });
41328
+ }
41329
+ });
41330
+ }
39884
41331
  const source = resolvePackageSource(args);
39885
41332
  const displayName = readVisibleString(args.displayName, "displayName");
39886
41333
  const description = readVisibleString(args.description, "description");
@@ -39905,7 +41352,7 @@ function createInlineBotAvatarTool(ctx) {
39905
41352
  if (!uploaded.fileUniqueId) {
39906
41353
  throw new Error("inline_bot_avatar: upload did not return fileUniqueId");
39907
41354
  }
39908
- const result = await client.invokeRaw(Method.SET_BOT_AVATAR, {
41355
+ const result = await client.invokeRaw(SET_BOT_AVATAR_METHOD, {
39909
41356
  oneofKind: "setBotAvatar",
39910
41357
  setBotAvatar: {
39911
41358
  botUserId: me.userId,
@@ -39920,6 +41367,7 @@ function createInlineBotAvatarTool(ctx) {
39920
41367
  }
39921
41368
  return jsonResult({
39922
41369
  ok: true,
41370
+ action,
39923
41371
  accountId: resolvedAccountId,
39924
41372
  botUserId: String(me.userId),
39925
41373
  avatar: {
@@ -40815,6 +42263,7 @@ function createInlineThreadReplyCommand(api2) {
40815
42263
  var INLINE_COMMAND_NAME_RE = /^[a-z0-9_]{1,32}$/;
40816
42264
  var INLINE_COMMAND_LIMIT = 100;
40817
42265
  var INLINE_COMMAND_DESCRIPTION_LIMIT = 256;
42266
+ var INLINE_COMMAND_RETRY_RATIO = 0.8;
40818
42267
  var INLINE_NATIVE_COMMAND_PROVIDER = "inline";
40819
42268
  function resolveInlineChannelCommands(cfg) {
40820
42269
  const inline = cfg.channels?.inline;
@@ -40828,6 +42277,55 @@ function normalizeDynamicCommandName(raw) {
40828
42277
  const withoutSlash = trimmed.startsWith("/") ? trimmed.slice(1) : trimmed;
40829
42278
  return withoutSlash.trim();
40830
42279
  }
42280
+ function readErrorTextField(value, key) {
42281
+ if (!value || typeof value !== "object" || !(key in value))
42282
+ return;
42283
+ const raw = value[key];
42284
+ return typeof raw === "string" ? raw : undefined;
42285
+ }
42286
+ function isInlineBotCommandsTooMuchError(err) {
42287
+ const pattern = /\bBOT_COMMANDS_TOO_MUCH\b/i;
42288
+ if (typeof err === "string")
42289
+ return pattern.test(err);
42290
+ if (err instanceof Error && pattern.test(err.message))
42291
+ return true;
42292
+ const description = readErrorTextField(err, "description");
42293
+ if (description && pattern.test(description))
42294
+ return true;
42295
+ const message = readErrorTextField(err, "message");
42296
+ return Boolean(message && pattern.test(message));
42297
+ }
42298
+ async function setInlineBotCommandsWithRetry(params) {
42299
+ try {
42300
+ await callInlineBotApi({
42301
+ baseUrl: params.baseUrl,
42302
+ token: params.token,
42303
+ methodName: "setMyCommands",
42304
+ method: "POST",
42305
+ body: { commands: params.commands }
42306
+ });
42307
+ return params.commands;
42308
+ } catch (err) {
42309
+ if (!isInlineBotCommandsTooMuchError(err) || params.commands.length <= 1) {
42310
+ throw err;
42311
+ }
42312
+ const retryCount = Math.max(1, Math.floor(params.commands.length * INLINE_COMMAND_RETRY_RATIO));
42313
+ if (retryCount >= params.commands.length) {
42314
+ throw err;
42315
+ }
42316
+ const retryCommands = params.commands.slice(0, retryCount);
42317
+ params.logger?.warn?.(`[inline] bot command sync rejected ${params.commands.length} commands for account "${params.accountId}" (BOT_COMMANDS_TOO_MUCH); retrying with ${retryCommands.length}`);
42318
+ await callInlineBotApi({
42319
+ baseUrl: params.baseUrl,
42320
+ token: params.token,
42321
+ methodName: "setMyCommands",
42322
+ method: "POST",
42323
+ body: { commands: retryCommands }
42324
+ });
42325
+ 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.`);
42326
+ return retryCommands;
42327
+ }
42328
+ }
40831
42329
  function appendUniqueCommand(out, seen, command, description, logger) {
40832
42330
  const normalized = normalizeDynamicCommandName(command);
40833
42331
  if (!INLINE_COMMAND_NAME_RE.test(normalized) || seen.has(normalized))
@@ -40944,15 +42442,15 @@ async function syncInlineNativeCommands(params) {
40944
42442
  continue;
40945
42443
  }
40946
42444
  try {
40947
- await callInlineBotApi({
42445
+ const syncedCommands = await setInlineBotCommandsWithRetry({
40948
42446
  baseUrl: account.baseUrl,
40949
42447
  token,
40950
- methodName: "setMyCommands",
40951
- method: "POST",
40952
- body: { commands }
42448
+ accountId: account.accountId,
42449
+ commands,
42450
+ ...params.logger ? { logger: params.logger } : {}
40953
42451
  });
40954
42452
  synced += 1;
40955
- params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${commands.length} command${commands.length === 1 ? "" : "s"})`);
42453
+ params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${syncedCommands.length} command${syncedCommands.length === 1 ? "" : "s"})`);
40956
42454
  } catch (err) {
40957
42455
  failed += 1;
40958
42456
  params.logger?.warn?.(`[inline] bot command sync failed for account "${account.accountId}": ${String(err)}`);
@@ -41016,5 +42514,5 @@ export {
41016
42514
  registerInlinePluginFull
41017
42515
  };
41018
42516
 
41019
- //# debugId=D10D8C4C3B879C9364756E2164756E21
42517
+ //# debugId=D3E95E00A369903064756E2164756E21
41020
42518
  //# sourceMappingURL=runtime-register-api.js.map