@inline-openclaw/inline 0.0.44 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/account-inspect-api.js +4 -2
- package/dist/account-inspect-api.js.map +3 -3
- package/dist/approval-handler.runtime.js +1093 -74
- package/dist/approval-handler.runtime.js.map +10 -10
- package/dist/channel-plugin-api.js +2262 -364
- package/dist/channel-plugin-api.js.map +16 -15
- package/dist/inline/actions.d.ts.map +1 -1
- package/dist/inline/approval-handler.runtime.d.ts +1 -0
- package/dist/inline/approval-handler.runtime.d.ts.map +1 -1
- package/dist/inline/bot-avatar-tool.d.ts +12 -0
- package/dist/inline/bot-avatar-tool.d.ts.map +1 -0
- package/dist/inline/bot-commands-sync.d.ts.map +1 -1
- package/dist/inline/channel.d.ts.map +1 -1
- package/dist/inline/config-schema.d.ts +2 -0
- package/dist/inline/config-schema.d.ts.map +1 -1
- package/dist/inline/doctor.d.ts.map +1 -1
- package/dist/inline/message-content.d.ts +5 -1
- package/dist/inline/message-content.d.ts.map +1 -1
- package/dist/inline/message-formatting.d.ts +18 -0
- package/dist/inline/message-formatting.d.ts.map +1 -1
- package/dist/inline/message-tools.d.ts.map +1 -1
- package/dist/inline/monitor.d.ts.map +1 -1
- package/dist/inline/parent-context-tool.d.ts.map +1 -1
- package/dist/inline/security.d.ts.map +1 -1
- package/dist/inline/setup-surface.d.ts.map +1 -1
- package/dist/inline/threadreply-command.d.ts +31 -0
- package/dist/inline/threadreply-command.d.ts.map +1 -1
- package/dist/runtime-register-api.d.ts.map +1 -1
- package/dist/runtime-register-api.js +1741 -259
- package/dist/runtime-register-api.js.map +14 -13
- package/dist/setup-plugin-api.js +23 -13
- package/dist/setup-plugin-api.js.map +6 -6
- package/openclaw.plugin.json +5 -3
- package/package.json +1 -1
|
@@ -5590,6 +5590,24 @@ var ConnectionError_Reason;
|
|
|
5590
5590
|
ConnectionError_Reason2[ConnectionError_Reason2["INVALID_AUTH"] = 2] = "INVALID_AUTH";
|
|
5591
5591
|
ConnectionError_Reason2[ConnectionError_Reason2["SESSION_REVOKED"] = 3] = "SESSION_REVOKED";
|
|
5592
5592
|
})(ConnectionError_Reason || (ConnectionError_Reason = {}));
|
|
5593
|
+
var BotAvatar_Kind;
|
|
5594
|
+
(function(BotAvatar_Kind2) {
|
|
5595
|
+
BotAvatar_Kind2[BotAvatar_Kind2["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
5596
|
+
BotAvatar_Kind2[BotAvatar_Kind2["CODEX_ATLAS"] = 1] = "CODEX_ATLAS";
|
|
5597
|
+
})(BotAvatar_Kind || (BotAvatar_Kind = {}));
|
|
5598
|
+
var BotPresenceState_Kind;
|
|
5599
|
+
(function(BotPresenceState_Kind2) {
|
|
5600
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
5601
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["HIDDEN"] = 1] = "HIDDEN";
|
|
5602
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["IDLE"] = 2] = "IDLE";
|
|
5603
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["HAPPY"] = 3] = "HAPPY";
|
|
5604
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["WAVING"] = 4] = "WAVING";
|
|
5605
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["JUMPING"] = 5] = "JUMPING";
|
|
5606
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["FAILED"] = 6] = "FAILED";
|
|
5607
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["WAITING"] = 7] = "WAITING";
|
|
5608
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["RUNNING"] = 8] = "RUNNING";
|
|
5609
|
+
BotPresenceState_Kind2[BotPresenceState_Kind2["REVIEW"] = 9] = "REVIEW";
|
|
5610
|
+
})(BotPresenceState_Kind || (BotPresenceState_Kind = {}));
|
|
5593
5611
|
var MessageEntity_Type;
|
|
5594
5612
|
(function(MessageEntity_Type2) {
|
|
5595
5613
|
MessageEntity_Type2[MessageEntity_Type2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
@@ -5703,6 +5721,11 @@ var UserStatus_Status;
|
|
|
5703
5721
|
UserStatus_Status2[UserStatus_Status2["ONLINE"] = 1] = "ONLINE";
|
|
5704
5722
|
UserStatus_Status2[UserStatus_Status2["OFFLINE"] = 2] = "OFFLINE";
|
|
5705
5723
|
})(UserStatus_Status || (UserStatus_Status = {}));
|
|
5724
|
+
var DialogFollowMode;
|
|
5725
|
+
(function(DialogFollowMode2) {
|
|
5726
|
+
DialogFollowMode2[DialogFollowMode2["DIALOG_FOLLOW_MODE_UNSPECIFIED"] = 0] = "DIALOG_FOLLOW_MODE_UNSPECIFIED";
|
|
5727
|
+
DialogFollowMode2[DialogFollowMode2["FOLLOWING"] = 1] = "FOLLOWING";
|
|
5728
|
+
})(DialogFollowMode || (DialogFollowMode = {}));
|
|
5706
5729
|
var MessageSendMode;
|
|
5707
5730
|
(function(MessageSendMode2) {
|
|
5708
5731
|
MessageSendMode2[MessageSendMode2["MODE_UNSPECIFIED"] = 0] = "MODE_UNSPECIFIED";
|
|
@@ -5766,6 +5789,11 @@ var Method;
|
|
|
5766
5789
|
Method2[Method2["CLEAR_CHAT_HISTORY"] = 53] = "CLEAR_CHAT_HISTORY";
|
|
5767
5790
|
Method2[Method2["DELETE_BOT"] = 54] = "DELETE_BOT";
|
|
5768
5791
|
Method2[Method2["DELETE_MESSAGE_ATTACHMENT"] = 55] = "DELETE_MESSAGE_ATTACHMENT";
|
|
5792
|
+
Method2[Method2["SET_BOT_AVATAR"] = 56] = "SET_BOT_AVATAR";
|
|
5793
|
+
Method2[Method2["CLEAR_BOT_AVATAR"] = 57] = "CLEAR_BOT_AVATAR";
|
|
5794
|
+
Method2[Method2["GET_BOT_PRESENCE"] = 58] = "GET_BOT_PRESENCE";
|
|
5795
|
+
Method2[Method2["SET_BOT_PRESENCE_STATE"] = 59] = "SET_BOT_PRESENCE_STATE";
|
|
5796
|
+
Method2[Method2["UPDATE_DIALOG_FOLLOW_MODE"] = 60] = "UPDATE_DIALOG_FOLLOW_MODE";
|
|
5769
5797
|
})(Method || (Method = {}));
|
|
5770
5798
|
var PushNotificationProvider;
|
|
5771
5799
|
(function(PushNotificationProvider2) {
|
|
@@ -6648,6 +6676,123 @@ class PeerUser$Type extends import_runtime4.MessageType {
|
|
|
6648
6676
|
}
|
|
6649
6677
|
var PeerUser = new PeerUser$Type;
|
|
6650
6678
|
|
|
6679
|
+
class BotAvatar$Type extends import_runtime4.MessageType {
|
|
6680
|
+
constructor() {
|
|
6681
|
+
super("BotAvatar", [
|
|
6682
|
+
{ no: 1, name: "kind", kind: "enum", T: () => ["BotAvatar.Kind", BotAvatar_Kind] },
|
|
6683
|
+
{ no: 2, name: "display_name", kind: "scalar", T: 9 },
|
|
6684
|
+
{ no: 3, name: "description", kind: "scalar", opt: true, T: 9 },
|
|
6685
|
+
{ no: 4, name: "cdn_url", kind: "scalar", opt: true, T: 9 },
|
|
6686
|
+
{ no: 5, name: "file_unique_id", kind: "scalar", opt: true, T: 9 }
|
|
6687
|
+
]);
|
|
6688
|
+
}
|
|
6689
|
+
create(value) {
|
|
6690
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
6691
|
+
message.kind = 0;
|
|
6692
|
+
message.displayName = "";
|
|
6693
|
+
if (value !== undefined)
|
|
6694
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
6695
|
+
return message;
|
|
6696
|
+
}
|
|
6697
|
+
internalBinaryRead(reader, length, options, target) {
|
|
6698
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
6699
|
+
while (reader.pos < end) {
|
|
6700
|
+
let [fieldNo, wireType] = reader.tag();
|
|
6701
|
+
switch (fieldNo) {
|
|
6702
|
+
case 1:
|
|
6703
|
+
message.kind = reader.int32();
|
|
6704
|
+
break;
|
|
6705
|
+
case 2:
|
|
6706
|
+
message.displayName = reader.string();
|
|
6707
|
+
break;
|
|
6708
|
+
case 3:
|
|
6709
|
+
message.description = reader.string();
|
|
6710
|
+
break;
|
|
6711
|
+
case 4:
|
|
6712
|
+
message.cdnUrl = reader.string();
|
|
6713
|
+
break;
|
|
6714
|
+
case 5:
|
|
6715
|
+
message.fileUniqueId = reader.string();
|
|
6716
|
+
break;
|
|
6717
|
+
default:
|
|
6718
|
+
let u = options.readUnknownField;
|
|
6719
|
+
if (u === "throw")
|
|
6720
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
6721
|
+
let d = reader.skip(wireType);
|
|
6722
|
+
if (u !== false)
|
|
6723
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
6724
|
+
}
|
|
6725
|
+
}
|
|
6726
|
+
return message;
|
|
6727
|
+
}
|
|
6728
|
+
internalBinaryWrite(message, writer, options) {
|
|
6729
|
+
if (message.kind !== 0)
|
|
6730
|
+
writer.tag(1, import_runtime.WireType.Varint).int32(message.kind);
|
|
6731
|
+
if (message.displayName !== "")
|
|
6732
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.displayName);
|
|
6733
|
+
if (message.description !== undefined)
|
|
6734
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
|
|
6735
|
+
if (message.cdnUrl !== undefined)
|
|
6736
|
+
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.cdnUrl);
|
|
6737
|
+
if (message.fileUniqueId !== undefined)
|
|
6738
|
+
writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
|
|
6739
|
+
let u = options.writeUnknownFields;
|
|
6740
|
+
if (u !== false)
|
|
6741
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
6742
|
+
return writer;
|
|
6743
|
+
}
|
|
6744
|
+
}
|
|
6745
|
+
var BotAvatar = new BotAvatar$Type;
|
|
6746
|
+
|
|
6747
|
+
class BotPresenceState$Type extends import_runtime4.MessageType {
|
|
6748
|
+
constructor() {
|
|
6749
|
+
super("BotPresenceState", [
|
|
6750
|
+
{ no: 1, name: "kind", kind: "enum", T: () => ["BotPresenceState.Kind", BotPresenceState_Kind] },
|
|
6751
|
+
{ no: 2, name: "comment", kind: "scalar", opt: true, T: 9 }
|
|
6752
|
+
]);
|
|
6753
|
+
}
|
|
6754
|
+
create(value) {
|
|
6755
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
6756
|
+
message.kind = 0;
|
|
6757
|
+
if (value !== undefined)
|
|
6758
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
6759
|
+
return message;
|
|
6760
|
+
}
|
|
6761
|
+
internalBinaryRead(reader, length, options, target) {
|
|
6762
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
6763
|
+
while (reader.pos < end) {
|
|
6764
|
+
let [fieldNo, wireType] = reader.tag();
|
|
6765
|
+
switch (fieldNo) {
|
|
6766
|
+
case 1:
|
|
6767
|
+
message.kind = reader.int32();
|
|
6768
|
+
break;
|
|
6769
|
+
case 2:
|
|
6770
|
+
message.comment = reader.string();
|
|
6771
|
+
break;
|
|
6772
|
+
default:
|
|
6773
|
+
let u = options.readUnknownField;
|
|
6774
|
+
if (u === "throw")
|
|
6775
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
6776
|
+
let d = reader.skip(wireType);
|
|
6777
|
+
if (u !== false)
|
|
6778
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
6779
|
+
}
|
|
6780
|
+
}
|
|
6781
|
+
return message;
|
|
6782
|
+
}
|
|
6783
|
+
internalBinaryWrite(message, writer, options) {
|
|
6784
|
+
if (message.kind !== 0)
|
|
6785
|
+
writer.tag(1, import_runtime.WireType.Varint).int32(message.kind);
|
|
6786
|
+
if (message.comment !== undefined)
|
|
6787
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.comment);
|
|
6788
|
+
let u = options.writeUnknownFields;
|
|
6789
|
+
if (u !== false)
|
|
6790
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
6791
|
+
return writer;
|
|
6792
|
+
}
|
|
6793
|
+
}
|
|
6794
|
+
var BotPresenceState = new BotPresenceState$Type;
|
|
6795
|
+
|
|
6651
6796
|
class User$Type extends import_runtime4.MessageType {
|
|
6652
6797
|
constructor() {
|
|
6653
6798
|
super("User", [
|
|
@@ -6662,7 +6807,8 @@ class User$Type extends import_runtime4.MessageType {
|
|
|
6662
6807
|
{ no: 9, name: "profile_photo", kind: "message", T: () => UserProfilePhoto },
|
|
6663
6808
|
{ no: 11, name: "pending_setup", kind: "scalar", opt: true, T: 8 },
|
|
6664
6809
|
{ no: 12, name: "time_zone", kind: "scalar", opt: true, T: 9 },
|
|
6665
|
-
{ no: 13, name: "bot", kind: "scalar", opt: true, T: 8 }
|
|
6810
|
+
{ no: 13, name: "bot", kind: "scalar", opt: true, T: 8 },
|
|
6811
|
+
{ no: 14, name: "bot_avatar", kind: "message", T: () => BotAvatar }
|
|
6666
6812
|
]);
|
|
6667
6813
|
}
|
|
6668
6814
|
create(value) {
|
|
@@ -6713,6 +6859,9 @@ class User$Type extends import_runtime4.MessageType {
|
|
|
6713
6859
|
case 13:
|
|
6714
6860
|
message.bot = reader.bool();
|
|
6715
6861
|
break;
|
|
6862
|
+
case 14:
|
|
6863
|
+
message.botAvatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.botAvatar);
|
|
6864
|
+
break;
|
|
6716
6865
|
default:
|
|
6717
6866
|
let u = options.readUnknownField;
|
|
6718
6867
|
if (u === "throw")
|
|
@@ -6749,6 +6898,8 @@ class User$Type extends import_runtime4.MessageType {
|
|
|
6749
6898
|
writer.tag(12, import_runtime.WireType.LengthDelimited).string(message.timeZone);
|
|
6750
6899
|
if (message.bot !== undefined)
|
|
6751
6900
|
writer.tag(13, import_runtime.WireType.Varint).bool(message.bot);
|
|
6901
|
+
if (message.botAvatar)
|
|
6902
|
+
BotAvatar.internalBinaryWrite(message.botAvatar, writer.tag(14, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
6752
6903
|
let u = options.writeUnknownFields;
|
|
6753
6904
|
if (u !== false)
|
|
6754
6905
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -6834,7 +6985,8 @@ class Dialog$Type extends import_runtime4.MessageType {
|
|
|
6834
6985
|
{ no: 11, name: "open", kind: "scalar", opt: true, T: 8 },
|
|
6835
6986
|
{ no: 12, name: "opened_date", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6836
6987
|
{ no: 14, name: "order", kind: "scalar", opt: true, T: 9 },
|
|
6837
|
-
{ no: 15, name: "pinned_order", kind: "scalar", opt: true, T: 9 }
|
|
6988
|
+
{ no: 15, name: "pinned_order", kind: "scalar", opt: true, T: 9 },
|
|
6989
|
+
{ no: 16, name: "follow_mode", kind: "enum", opt: true, T: () => ["DialogFollowMode", DialogFollowMode] }
|
|
6838
6990
|
]);
|
|
6839
6991
|
}
|
|
6840
6992
|
create(value) {
|
|
@@ -6893,6 +7045,9 @@ class Dialog$Type extends import_runtime4.MessageType {
|
|
|
6893
7045
|
case 15:
|
|
6894
7046
|
message.pinnedOrder = reader.string();
|
|
6895
7047
|
break;
|
|
7048
|
+
case 16:
|
|
7049
|
+
message.followMode = reader.int32();
|
|
7050
|
+
break;
|
|
6896
7051
|
default:
|
|
6897
7052
|
let u = options.readUnknownField;
|
|
6898
7053
|
if (u === "throw")
|
|
@@ -6935,6 +7090,8 @@ class Dialog$Type extends import_runtime4.MessageType {
|
|
|
6935
7090
|
writer.tag(14, import_runtime.WireType.LengthDelimited).string(message.order);
|
|
6936
7091
|
if (message.pinnedOrder !== undefined)
|
|
6937
7092
|
writer.tag(15, import_runtime.WireType.LengthDelimited).string(message.pinnedOrder);
|
|
7093
|
+
if (message.followMode !== undefined)
|
|
7094
|
+
writer.tag(16, import_runtime.WireType.Varint).int32(message.followMode);
|
|
6938
7095
|
let u = options.writeUnknownFields;
|
|
6939
7096
|
if (u !== false)
|
|
6940
7097
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -6958,7 +7115,8 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
6958
7115
|
{ no: 10, name: "created_by", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6959
7116
|
{ no: 11, name: "parent_chat_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6960
7117
|
{ no: 12, name: "parent_message_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
6961
|
-
{ no: 13, name: "untitled", kind: "scalar", opt: true, T: 8 }
|
|
7118
|
+
{ no: 13, name: "untitled", kind: "scalar", opt: true, T: 8 },
|
|
7119
|
+
{ no: 14, name: "number", kind: "scalar", opt: true, T: 5 }
|
|
6962
7120
|
]);
|
|
6963
7121
|
}
|
|
6964
7122
|
create(value) {
|
|
@@ -7013,6 +7171,9 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
7013
7171
|
case 13:
|
|
7014
7172
|
message.untitled = reader.bool();
|
|
7015
7173
|
break;
|
|
7174
|
+
case 14:
|
|
7175
|
+
message.number = reader.int32();
|
|
7176
|
+
break;
|
|
7016
7177
|
default:
|
|
7017
7178
|
let u = options.readUnknownField;
|
|
7018
7179
|
if (u === "throw")
|
|
@@ -7051,6 +7212,8 @@ class Chat$Type extends import_runtime4.MessageType {
|
|
|
7051
7212
|
writer.tag(12, import_runtime.WireType.Varint).int64(message.parentMessageId);
|
|
7052
7213
|
if (message.untitled !== undefined)
|
|
7053
7214
|
writer.tag(13, import_runtime.WireType.Varint).bool(message.untitled);
|
|
7215
|
+
if (message.number !== undefined)
|
|
7216
|
+
writer.tag(14, import_runtime.WireType.Varint).int32(message.number);
|
|
7054
7217
|
let u = options.writeUnknownFields;
|
|
7055
7218
|
if (u !== false)
|
|
7056
7219
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -9899,7 +10062,12 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
9899
10062
|
{ no: 53, name: "updateDialogOrder", kind: "message", oneof: "input", T: () => UpdateDialogOrderInput },
|
|
9900
10063
|
{ no: 54, name: "clearChatHistory", kind: "message", oneof: "input", T: () => ClearChatHistoryInput },
|
|
9901
10064
|
{ no: 55, name: "deleteBot", kind: "message", oneof: "input", T: () => DeleteBotInput },
|
|
9902
|
-
{ no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "input", T: () => DeleteMessageAttachmentInput }
|
|
10065
|
+
{ no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "input", T: () => DeleteMessageAttachmentInput },
|
|
10066
|
+
{ no: 57, name: "setBotAvatar", kind: "message", oneof: "input", T: () => SetBotAvatarInput },
|
|
10067
|
+
{ no: 58, name: "clearBotAvatar", kind: "message", oneof: "input", T: () => ClearBotAvatarInput },
|
|
10068
|
+
{ no: 59, name: "getBotPresence", kind: "message", oneof: "input", T: () => GetBotPresenceInput },
|
|
10069
|
+
{ no: 60, name: "setBotPresenceState", kind: "message", oneof: "input", T: () => SetBotPresenceStateInput },
|
|
10070
|
+
{ no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "input", T: () => UpdateDialogFollowModeInput }
|
|
9903
10071
|
]);
|
|
9904
10072
|
}
|
|
9905
10073
|
create(value) {
|
|
@@ -10248,6 +10416,36 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
10248
10416
|
deleteMessageAttachment: DeleteMessageAttachmentInput.internalBinaryRead(reader, reader.uint32(), options, message.input.deleteMessageAttachment)
|
|
10249
10417
|
};
|
|
10250
10418
|
break;
|
|
10419
|
+
case 57:
|
|
10420
|
+
message.input = {
|
|
10421
|
+
oneofKind: "setBotAvatar",
|
|
10422
|
+
setBotAvatar: SetBotAvatarInput.internalBinaryRead(reader, reader.uint32(), options, message.input.setBotAvatar)
|
|
10423
|
+
};
|
|
10424
|
+
break;
|
|
10425
|
+
case 58:
|
|
10426
|
+
message.input = {
|
|
10427
|
+
oneofKind: "clearBotAvatar",
|
|
10428
|
+
clearBotAvatar: ClearBotAvatarInput.internalBinaryRead(reader, reader.uint32(), options, message.input.clearBotAvatar)
|
|
10429
|
+
};
|
|
10430
|
+
break;
|
|
10431
|
+
case 59:
|
|
10432
|
+
message.input = {
|
|
10433
|
+
oneofKind: "getBotPresence",
|
|
10434
|
+
getBotPresence: GetBotPresenceInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getBotPresence)
|
|
10435
|
+
};
|
|
10436
|
+
break;
|
|
10437
|
+
case 60:
|
|
10438
|
+
message.input = {
|
|
10439
|
+
oneofKind: "setBotPresenceState",
|
|
10440
|
+
setBotPresenceState: SetBotPresenceStateInput.internalBinaryRead(reader, reader.uint32(), options, message.input.setBotPresenceState)
|
|
10441
|
+
};
|
|
10442
|
+
break;
|
|
10443
|
+
case 61:
|
|
10444
|
+
message.input = {
|
|
10445
|
+
oneofKind: "updateDialogFollowMode",
|
|
10446
|
+
updateDialogFollowMode: UpdateDialogFollowModeInput.internalBinaryRead(reader, reader.uint32(), options, message.input.updateDialogFollowMode)
|
|
10447
|
+
};
|
|
10448
|
+
break;
|
|
10251
10449
|
default:
|
|
10252
10450
|
let u = options.readUnknownField;
|
|
10253
10451
|
if (u === "throw")
|
|
@@ -10372,6 +10570,16 @@ class RpcCall$Type extends import_runtime4.MessageType {
|
|
|
10372
10570
|
DeleteBotInput.internalBinaryWrite(message.input.deleteBot, writer.tag(55, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10373
10571
|
if (message.input.oneofKind === "deleteMessageAttachment")
|
|
10374
10572
|
DeleteMessageAttachmentInput.internalBinaryWrite(message.input.deleteMessageAttachment, writer.tag(56, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10573
|
+
if (message.input.oneofKind === "setBotAvatar")
|
|
10574
|
+
SetBotAvatarInput.internalBinaryWrite(message.input.setBotAvatar, writer.tag(57, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10575
|
+
if (message.input.oneofKind === "clearBotAvatar")
|
|
10576
|
+
ClearBotAvatarInput.internalBinaryWrite(message.input.clearBotAvatar, writer.tag(58, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10577
|
+
if (message.input.oneofKind === "getBotPresence")
|
|
10578
|
+
GetBotPresenceInput.internalBinaryWrite(message.input.getBotPresence, writer.tag(59, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10579
|
+
if (message.input.oneofKind === "setBotPresenceState")
|
|
10580
|
+
SetBotPresenceStateInput.internalBinaryWrite(message.input.setBotPresenceState, writer.tag(60, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10581
|
+
if (message.input.oneofKind === "updateDialogFollowMode")
|
|
10582
|
+
UpdateDialogFollowModeInput.internalBinaryWrite(message.input.updateDialogFollowMode, writer.tag(61, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10375
10583
|
let u = options.writeUnknownFields;
|
|
10376
10584
|
if (u !== false)
|
|
10377
10585
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -10438,7 +10646,12 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
10438
10646
|
{ no: 53, name: "updateDialogOrder", kind: "message", oneof: "result", T: () => UpdateDialogOrderResult },
|
|
10439
10647
|
{ no: 54, name: "clearChatHistory", kind: "message", oneof: "result", T: () => ClearChatHistoryResult },
|
|
10440
10648
|
{ no: 55, name: "deleteBot", kind: "message", oneof: "result", T: () => DeleteBotResult },
|
|
10441
|
-
{ no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "result", T: () => DeleteMessageAttachmentResult }
|
|
10649
|
+
{ no: 56, name: "deleteMessageAttachment", kind: "message", oneof: "result", T: () => DeleteMessageAttachmentResult },
|
|
10650
|
+
{ no: 57, name: "setBotAvatar", kind: "message", oneof: "result", T: () => SetBotAvatarResult },
|
|
10651
|
+
{ no: 58, name: "clearBotAvatar", kind: "message", oneof: "result", T: () => ClearBotAvatarResult },
|
|
10652
|
+
{ no: 59, name: "getBotPresence", kind: "message", oneof: "result", T: () => GetBotPresenceResult },
|
|
10653
|
+
{ no: 60, name: "setBotPresenceState", kind: "message", oneof: "result", T: () => SetBotPresenceStateResult },
|
|
10654
|
+
{ no: 61, name: "updateDialogFollowMode", kind: "message", oneof: "result", T: () => UpdateDialogFollowModeResult }
|
|
10442
10655
|
]);
|
|
10443
10656
|
}
|
|
10444
10657
|
create(value) {
|
|
@@ -10787,6 +11000,36 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
10787
11000
|
deleteMessageAttachment: DeleteMessageAttachmentResult.internalBinaryRead(reader, reader.uint32(), options, message.result.deleteMessageAttachment)
|
|
10788
11001
|
};
|
|
10789
11002
|
break;
|
|
11003
|
+
case 57:
|
|
11004
|
+
message.result = {
|
|
11005
|
+
oneofKind: "setBotAvatar",
|
|
11006
|
+
setBotAvatar: SetBotAvatarResult.internalBinaryRead(reader, reader.uint32(), options, message.result.setBotAvatar)
|
|
11007
|
+
};
|
|
11008
|
+
break;
|
|
11009
|
+
case 58:
|
|
11010
|
+
message.result = {
|
|
11011
|
+
oneofKind: "clearBotAvatar",
|
|
11012
|
+
clearBotAvatar: ClearBotAvatarResult.internalBinaryRead(reader, reader.uint32(), options, message.result.clearBotAvatar)
|
|
11013
|
+
};
|
|
11014
|
+
break;
|
|
11015
|
+
case 59:
|
|
11016
|
+
message.result = {
|
|
11017
|
+
oneofKind: "getBotPresence",
|
|
11018
|
+
getBotPresence: GetBotPresenceResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getBotPresence)
|
|
11019
|
+
};
|
|
11020
|
+
break;
|
|
11021
|
+
case 60:
|
|
11022
|
+
message.result = {
|
|
11023
|
+
oneofKind: "setBotPresenceState",
|
|
11024
|
+
setBotPresenceState: SetBotPresenceStateResult.internalBinaryRead(reader, reader.uint32(), options, message.result.setBotPresenceState)
|
|
11025
|
+
};
|
|
11026
|
+
break;
|
|
11027
|
+
case 61:
|
|
11028
|
+
message.result = {
|
|
11029
|
+
oneofKind: "updateDialogFollowMode",
|
|
11030
|
+
updateDialogFollowMode: UpdateDialogFollowModeResult.internalBinaryRead(reader, reader.uint32(), options, message.result.updateDialogFollowMode)
|
|
11031
|
+
};
|
|
11032
|
+
break;
|
|
10790
11033
|
default:
|
|
10791
11034
|
let u = options.readUnknownField;
|
|
10792
11035
|
if (u === "throw")
|
|
@@ -10911,6 +11154,16 @@ class RpcResult$Type extends import_runtime4.MessageType {
|
|
|
10911
11154
|
DeleteBotResult.internalBinaryWrite(message.result.deleteBot, writer.tag(55, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10912
11155
|
if (message.result.oneofKind === "deleteMessageAttachment")
|
|
10913
11156
|
DeleteMessageAttachmentResult.internalBinaryWrite(message.result.deleteMessageAttachment, writer.tag(56, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11157
|
+
if (message.result.oneofKind === "setBotAvatar")
|
|
11158
|
+
SetBotAvatarResult.internalBinaryWrite(message.result.setBotAvatar, writer.tag(57, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11159
|
+
if (message.result.oneofKind === "clearBotAvatar")
|
|
11160
|
+
ClearBotAvatarResult.internalBinaryWrite(message.result.clearBotAvatar, writer.tag(58, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11161
|
+
if (message.result.oneofKind === "getBotPresence")
|
|
11162
|
+
GetBotPresenceResult.internalBinaryWrite(message.result.getBotPresence, writer.tag(59, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11163
|
+
if (message.result.oneofKind === "setBotPresenceState")
|
|
11164
|
+
SetBotPresenceStateResult.internalBinaryWrite(message.result.setBotPresenceState, writer.tag(60, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11165
|
+
if (message.result.oneofKind === "updateDialogFollowMode")
|
|
11166
|
+
UpdateDialogFollowModeResult.internalBinaryWrite(message.result.updateDialogFollowMode, writer.tag(61, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
10914
11167
|
let u = options.writeUnknownFields;
|
|
10915
11168
|
if (u !== false)
|
|
10916
11169
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -11165,7 +11418,8 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11165
11418
|
super("UpdateSidecars", [
|
|
11166
11419
|
{ no: 1, name: "users", kind: "message", repeat: 1, T: () => User },
|
|
11167
11420
|
{ no: 2, name: "chats", kind: "message", repeat: 1, T: () => Chat },
|
|
11168
|
-
{ no: 3, name: "dialogs", kind: "message", repeat: 1, T: () => Dialog }
|
|
11421
|
+
{ no: 3, name: "dialogs", kind: "message", repeat: 1, T: () => Dialog },
|
|
11422
|
+
{ no: 4, name: "spaces", kind: "message", repeat: 1, T: () => Space }
|
|
11169
11423
|
]);
|
|
11170
11424
|
}
|
|
11171
11425
|
create(value) {
|
|
@@ -11173,6 +11427,7 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11173
11427
|
message.users = [];
|
|
11174
11428
|
message.chats = [];
|
|
11175
11429
|
message.dialogs = [];
|
|
11430
|
+
message.spaces = [];
|
|
11176
11431
|
if (value !== undefined)
|
|
11177
11432
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
11178
11433
|
return message;
|
|
@@ -11191,6 +11446,9 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11191
11446
|
case 3:
|
|
11192
11447
|
message.dialogs.push(Dialog.internalBinaryRead(reader, reader.uint32(), options));
|
|
11193
11448
|
break;
|
|
11449
|
+
case 4:
|
|
11450
|
+
message.spaces.push(Space.internalBinaryRead(reader, reader.uint32(), options));
|
|
11451
|
+
break;
|
|
11194
11452
|
default:
|
|
11195
11453
|
let u = options.readUnknownField;
|
|
11196
11454
|
if (u === "throw")
|
|
@@ -11209,6 +11467,8 @@ class UpdateSidecars$Type extends import_runtime4.MessageType {
|
|
|
11209
11467
|
Chat.internalBinaryWrite(message.chats[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11210
11468
|
for (let i = 0;i < message.dialogs.length; i++)
|
|
11211
11469
|
Dialog.internalBinaryWrite(message.dialogs[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11470
|
+
for (let i = 0;i < message.spaces.length; i++)
|
|
11471
|
+
Space.internalBinaryWrite(message.spaces[i], writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
11212
11472
|
let u = options.writeUnknownFields;
|
|
11213
11473
|
if (u !== false)
|
|
11214
11474
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -11995,6 +12255,97 @@ class UpdateDialogOrderResult$Type extends import_runtime4.MessageType {
|
|
|
11995
12255
|
}
|
|
11996
12256
|
var UpdateDialogOrderResult = new UpdateDialogOrderResult$Type;
|
|
11997
12257
|
|
|
12258
|
+
class UpdateDialogFollowModeInput$Type extends import_runtime4.MessageType {
|
|
12259
|
+
constructor() {
|
|
12260
|
+
super("UpdateDialogFollowModeInput", [
|
|
12261
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
12262
|
+
{ no: 2, name: "follow_mode", kind: "enum", opt: true, T: () => ["DialogFollowMode", DialogFollowMode] }
|
|
12263
|
+
]);
|
|
12264
|
+
}
|
|
12265
|
+
create(value) {
|
|
12266
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
12267
|
+
if (value !== undefined)
|
|
12268
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
12269
|
+
return message;
|
|
12270
|
+
}
|
|
12271
|
+
internalBinaryRead(reader, length, options, target) {
|
|
12272
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
12273
|
+
while (reader.pos < end) {
|
|
12274
|
+
let [fieldNo, wireType] = reader.tag();
|
|
12275
|
+
switch (fieldNo) {
|
|
12276
|
+
case 1:
|
|
12277
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
12278
|
+
break;
|
|
12279
|
+
case 2:
|
|
12280
|
+
message.followMode = reader.int32();
|
|
12281
|
+
break;
|
|
12282
|
+
default:
|
|
12283
|
+
let u = options.readUnknownField;
|
|
12284
|
+
if (u === "throw")
|
|
12285
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
12286
|
+
let d = reader.skip(wireType);
|
|
12287
|
+
if (u !== false)
|
|
12288
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
12289
|
+
}
|
|
12290
|
+
}
|
|
12291
|
+
return message;
|
|
12292
|
+
}
|
|
12293
|
+
internalBinaryWrite(message, writer, options) {
|
|
12294
|
+
if (message.peerId)
|
|
12295
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
12296
|
+
if (message.followMode !== undefined)
|
|
12297
|
+
writer.tag(2, import_runtime.WireType.Varint).int32(message.followMode);
|
|
12298
|
+
let u = options.writeUnknownFields;
|
|
12299
|
+
if (u !== false)
|
|
12300
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
12301
|
+
return writer;
|
|
12302
|
+
}
|
|
12303
|
+
}
|
|
12304
|
+
var UpdateDialogFollowModeInput = new UpdateDialogFollowModeInput$Type;
|
|
12305
|
+
|
|
12306
|
+
class UpdateDialogFollowModeResult$Type extends import_runtime4.MessageType {
|
|
12307
|
+
constructor() {
|
|
12308
|
+
super("UpdateDialogFollowModeResult", [
|
|
12309
|
+
{ no: 1, name: "updates", kind: "message", repeat: 1, T: () => Update }
|
|
12310
|
+
]);
|
|
12311
|
+
}
|
|
12312
|
+
create(value) {
|
|
12313
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
12314
|
+
message.updates = [];
|
|
12315
|
+
if (value !== undefined)
|
|
12316
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
12317
|
+
return message;
|
|
12318
|
+
}
|
|
12319
|
+
internalBinaryRead(reader, length, options, target) {
|
|
12320
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
12321
|
+
while (reader.pos < end) {
|
|
12322
|
+
let [fieldNo, wireType] = reader.tag();
|
|
12323
|
+
switch (fieldNo) {
|
|
12324
|
+
case 1:
|
|
12325
|
+
message.updates.push(Update.internalBinaryRead(reader, reader.uint32(), options));
|
|
12326
|
+
break;
|
|
12327
|
+
default:
|
|
12328
|
+
let u = options.readUnknownField;
|
|
12329
|
+
if (u === "throw")
|
|
12330
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
12331
|
+
let d = reader.skip(wireType);
|
|
12332
|
+
if (u !== false)
|
|
12333
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
12334
|
+
}
|
|
12335
|
+
}
|
|
12336
|
+
return message;
|
|
12337
|
+
}
|
|
12338
|
+
internalBinaryWrite(message, writer, options) {
|
|
12339
|
+
for (let i = 0;i < message.updates.length; i++)
|
|
12340
|
+
Update.internalBinaryWrite(message.updates[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
12341
|
+
let u = options.writeUnknownFields;
|
|
12342
|
+
if (u !== false)
|
|
12343
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
12344
|
+
return writer;
|
|
12345
|
+
}
|
|
12346
|
+
}
|
|
12347
|
+
var UpdateDialogFollowModeResult = new UpdateDialogFollowModeResult$Type;
|
|
12348
|
+
|
|
11998
12349
|
class MarkAsUnreadInput$Type extends import_runtime4.MessageType {
|
|
11999
12350
|
constructor() {
|
|
12000
12351
|
super("MarkAsUnreadInput", [
|
|
@@ -13115,17 +13466,311 @@ class RotateBotTokenInput$Type extends import_runtime4.MessageType {
|
|
|
13115
13466
|
return writer;
|
|
13116
13467
|
}
|
|
13117
13468
|
}
|
|
13118
|
-
var RotateBotTokenInput = new RotateBotTokenInput$Type;
|
|
13469
|
+
var RotateBotTokenInput = new RotateBotTokenInput$Type;
|
|
13470
|
+
|
|
13471
|
+
class RotateBotTokenResult$Type extends import_runtime4.MessageType {
|
|
13472
|
+
constructor() {
|
|
13473
|
+
super("RotateBotTokenResult", [
|
|
13474
|
+
{ no: 1, name: "token", kind: "scalar", T: 9 }
|
|
13475
|
+
]);
|
|
13476
|
+
}
|
|
13477
|
+
create(value) {
|
|
13478
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13479
|
+
message.token = "";
|
|
13480
|
+
if (value !== undefined)
|
|
13481
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13482
|
+
return message;
|
|
13483
|
+
}
|
|
13484
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13485
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13486
|
+
while (reader.pos < end) {
|
|
13487
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13488
|
+
switch (fieldNo) {
|
|
13489
|
+
case 1:
|
|
13490
|
+
message.token = reader.string();
|
|
13491
|
+
break;
|
|
13492
|
+
default:
|
|
13493
|
+
let u = options.readUnknownField;
|
|
13494
|
+
if (u === "throw")
|
|
13495
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13496
|
+
let d = reader.skip(wireType);
|
|
13497
|
+
if (u !== false)
|
|
13498
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13499
|
+
}
|
|
13500
|
+
}
|
|
13501
|
+
return message;
|
|
13502
|
+
}
|
|
13503
|
+
internalBinaryWrite(message, writer, options) {
|
|
13504
|
+
if (message.token !== "")
|
|
13505
|
+
writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.token);
|
|
13506
|
+
let u = options.writeUnknownFields;
|
|
13507
|
+
if (u !== false)
|
|
13508
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13509
|
+
return writer;
|
|
13510
|
+
}
|
|
13511
|
+
}
|
|
13512
|
+
var RotateBotTokenResult = new RotateBotTokenResult$Type;
|
|
13513
|
+
|
|
13514
|
+
class UpdateBotProfileInput$Type extends import_runtime4.MessageType {
|
|
13515
|
+
constructor() {
|
|
13516
|
+
super("UpdateBotProfileInput", [
|
|
13517
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
|
|
13518
|
+
{ no: 2, name: "name", kind: "scalar", opt: true, T: 9 },
|
|
13519
|
+
{ no: 3, name: "photo_file_unique_id", kind: "scalar", opt: true, T: 9 }
|
|
13520
|
+
]);
|
|
13521
|
+
}
|
|
13522
|
+
create(value) {
|
|
13523
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13524
|
+
message.botUserId = 0n;
|
|
13525
|
+
if (value !== undefined)
|
|
13526
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13527
|
+
return message;
|
|
13528
|
+
}
|
|
13529
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13530
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13531
|
+
while (reader.pos < end) {
|
|
13532
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13533
|
+
switch (fieldNo) {
|
|
13534
|
+
case 1:
|
|
13535
|
+
message.botUserId = reader.int64().toBigInt();
|
|
13536
|
+
break;
|
|
13537
|
+
case 2:
|
|
13538
|
+
message.name = reader.string();
|
|
13539
|
+
break;
|
|
13540
|
+
case 3:
|
|
13541
|
+
message.photoFileUniqueId = reader.string();
|
|
13542
|
+
break;
|
|
13543
|
+
default:
|
|
13544
|
+
let u = options.readUnknownField;
|
|
13545
|
+
if (u === "throw")
|
|
13546
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13547
|
+
let d = reader.skip(wireType);
|
|
13548
|
+
if (u !== false)
|
|
13549
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13550
|
+
}
|
|
13551
|
+
}
|
|
13552
|
+
return message;
|
|
13553
|
+
}
|
|
13554
|
+
internalBinaryWrite(message, writer, options) {
|
|
13555
|
+
if (message.botUserId !== 0n)
|
|
13556
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
13557
|
+
if (message.name !== undefined)
|
|
13558
|
+
writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.name);
|
|
13559
|
+
if (message.photoFileUniqueId !== undefined)
|
|
13560
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.photoFileUniqueId);
|
|
13561
|
+
let u = options.writeUnknownFields;
|
|
13562
|
+
if (u !== false)
|
|
13563
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13564
|
+
return writer;
|
|
13565
|
+
}
|
|
13566
|
+
}
|
|
13567
|
+
var UpdateBotProfileInput = new UpdateBotProfileInput$Type;
|
|
13568
|
+
|
|
13569
|
+
class UpdateBotProfileResult$Type extends import_runtime4.MessageType {
|
|
13570
|
+
constructor() {
|
|
13571
|
+
super("UpdateBotProfileResult", [
|
|
13572
|
+
{ no: 1, name: "bot", kind: "message", T: () => User }
|
|
13573
|
+
]);
|
|
13574
|
+
}
|
|
13575
|
+
create(value) {
|
|
13576
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13577
|
+
if (value !== undefined)
|
|
13578
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13579
|
+
return message;
|
|
13580
|
+
}
|
|
13581
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13582
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13583
|
+
while (reader.pos < end) {
|
|
13584
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13585
|
+
switch (fieldNo) {
|
|
13586
|
+
case 1:
|
|
13587
|
+
message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
|
|
13588
|
+
break;
|
|
13589
|
+
default:
|
|
13590
|
+
let u = options.readUnknownField;
|
|
13591
|
+
if (u === "throw")
|
|
13592
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13593
|
+
let d = reader.skip(wireType);
|
|
13594
|
+
if (u !== false)
|
|
13595
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13596
|
+
}
|
|
13597
|
+
}
|
|
13598
|
+
return message;
|
|
13599
|
+
}
|
|
13600
|
+
internalBinaryWrite(message, writer, options) {
|
|
13601
|
+
if (message.bot)
|
|
13602
|
+
User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13603
|
+
let u = options.writeUnknownFields;
|
|
13604
|
+
if (u !== false)
|
|
13605
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13606
|
+
return writer;
|
|
13607
|
+
}
|
|
13608
|
+
}
|
|
13609
|
+
var UpdateBotProfileResult = new UpdateBotProfileResult$Type;
|
|
13610
|
+
|
|
13611
|
+
class SetBotAvatarInput$Type extends import_runtime4.MessageType {
|
|
13612
|
+
constructor() {
|
|
13613
|
+
super("SetBotAvatarInput", [
|
|
13614
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
|
|
13615
|
+
{ no: 2, name: "kind", kind: "enum", T: () => ["BotAvatar.Kind", BotAvatar_Kind] },
|
|
13616
|
+
{ no: 3, name: "display_name", kind: "scalar", T: 9 },
|
|
13617
|
+
{ no: 4, name: "description", kind: "scalar", opt: true, T: 9 },
|
|
13618
|
+
{ no: 5, name: "file_unique_id", kind: "scalar", T: 9 }
|
|
13619
|
+
]);
|
|
13620
|
+
}
|
|
13621
|
+
create(value) {
|
|
13622
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13623
|
+
message.botUserId = 0n;
|
|
13624
|
+
message.kind = 0;
|
|
13625
|
+
message.displayName = "";
|
|
13626
|
+
message.fileUniqueId = "";
|
|
13627
|
+
if (value !== undefined)
|
|
13628
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13629
|
+
return message;
|
|
13630
|
+
}
|
|
13631
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13632
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13633
|
+
while (reader.pos < end) {
|
|
13634
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13635
|
+
switch (fieldNo) {
|
|
13636
|
+
case 1:
|
|
13637
|
+
message.botUserId = reader.int64().toBigInt();
|
|
13638
|
+
break;
|
|
13639
|
+
case 2:
|
|
13640
|
+
message.kind = reader.int32();
|
|
13641
|
+
break;
|
|
13642
|
+
case 3:
|
|
13643
|
+
message.displayName = reader.string();
|
|
13644
|
+
break;
|
|
13645
|
+
case 4:
|
|
13646
|
+
message.description = reader.string();
|
|
13647
|
+
break;
|
|
13648
|
+
case 5:
|
|
13649
|
+
message.fileUniqueId = reader.string();
|
|
13650
|
+
break;
|
|
13651
|
+
default:
|
|
13652
|
+
let u = options.readUnknownField;
|
|
13653
|
+
if (u === "throw")
|
|
13654
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13655
|
+
let d = reader.skip(wireType);
|
|
13656
|
+
if (u !== false)
|
|
13657
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13658
|
+
}
|
|
13659
|
+
}
|
|
13660
|
+
return message;
|
|
13661
|
+
}
|
|
13662
|
+
internalBinaryWrite(message, writer, options) {
|
|
13663
|
+
if (message.botUserId !== 0n)
|
|
13664
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
13665
|
+
if (message.kind !== 0)
|
|
13666
|
+
writer.tag(2, import_runtime.WireType.Varint).int32(message.kind);
|
|
13667
|
+
if (message.displayName !== "")
|
|
13668
|
+
writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.displayName);
|
|
13669
|
+
if (message.description !== undefined)
|
|
13670
|
+
writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.description);
|
|
13671
|
+
if (message.fileUniqueId !== "")
|
|
13672
|
+
writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.fileUniqueId);
|
|
13673
|
+
let u = options.writeUnknownFields;
|
|
13674
|
+
if (u !== false)
|
|
13675
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13676
|
+
return writer;
|
|
13677
|
+
}
|
|
13678
|
+
}
|
|
13679
|
+
var SetBotAvatarInput = new SetBotAvatarInput$Type;
|
|
13680
|
+
|
|
13681
|
+
class SetBotAvatarResult$Type extends import_runtime4.MessageType {
|
|
13682
|
+
constructor() {
|
|
13683
|
+
super("SetBotAvatarResult", [
|
|
13684
|
+
{ no: 1, name: "bot", kind: "message", T: () => User }
|
|
13685
|
+
]);
|
|
13686
|
+
}
|
|
13687
|
+
create(value) {
|
|
13688
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13689
|
+
if (value !== undefined)
|
|
13690
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13691
|
+
return message;
|
|
13692
|
+
}
|
|
13693
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13694
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13695
|
+
while (reader.pos < end) {
|
|
13696
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13697
|
+
switch (fieldNo) {
|
|
13698
|
+
case 1:
|
|
13699
|
+
message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
|
|
13700
|
+
break;
|
|
13701
|
+
default:
|
|
13702
|
+
let u = options.readUnknownField;
|
|
13703
|
+
if (u === "throw")
|
|
13704
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13705
|
+
let d = reader.skip(wireType);
|
|
13706
|
+
if (u !== false)
|
|
13707
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13708
|
+
}
|
|
13709
|
+
}
|
|
13710
|
+
return message;
|
|
13711
|
+
}
|
|
13712
|
+
internalBinaryWrite(message, writer, options) {
|
|
13713
|
+
if (message.bot)
|
|
13714
|
+
User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13715
|
+
let u = options.writeUnknownFields;
|
|
13716
|
+
if (u !== false)
|
|
13717
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13718
|
+
return writer;
|
|
13719
|
+
}
|
|
13720
|
+
}
|
|
13721
|
+
var SetBotAvatarResult = new SetBotAvatarResult$Type;
|
|
13722
|
+
|
|
13723
|
+
class ClearBotAvatarInput$Type extends import_runtime4.MessageType {
|
|
13724
|
+
constructor() {
|
|
13725
|
+
super("ClearBotAvatarInput", [
|
|
13726
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
|
|
13727
|
+
]);
|
|
13728
|
+
}
|
|
13729
|
+
create(value) {
|
|
13730
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13731
|
+
message.botUserId = 0n;
|
|
13732
|
+
if (value !== undefined)
|
|
13733
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13734
|
+
return message;
|
|
13735
|
+
}
|
|
13736
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13737
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13738
|
+
while (reader.pos < end) {
|
|
13739
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13740
|
+
switch (fieldNo) {
|
|
13741
|
+
case 1:
|
|
13742
|
+
message.botUserId = reader.int64().toBigInt();
|
|
13743
|
+
break;
|
|
13744
|
+
default:
|
|
13745
|
+
let u = options.readUnknownField;
|
|
13746
|
+
if (u === "throw")
|
|
13747
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13748
|
+
let d = reader.skip(wireType);
|
|
13749
|
+
if (u !== false)
|
|
13750
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13751
|
+
}
|
|
13752
|
+
}
|
|
13753
|
+
return message;
|
|
13754
|
+
}
|
|
13755
|
+
internalBinaryWrite(message, writer, options) {
|
|
13756
|
+
if (message.botUserId !== 0n)
|
|
13757
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
13758
|
+
let u = options.writeUnknownFields;
|
|
13759
|
+
if (u !== false)
|
|
13760
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13761
|
+
return writer;
|
|
13762
|
+
}
|
|
13763
|
+
}
|
|
13764
|
+
var ClearBotAvatarInput = new ClearBotAvatarInput$Type;
|
|
13119
13765
|
|
|
13120
|
-
class
|
|
13766
|
+
class ClearBotAvatarResult$Type extends import_runtime4.MessageType {
|
|
13121
13767
|
constructor() {
|
|
13122
|
-
super("
|
|
13123
|
-
{ no: 1, name: "
|
|
13768
|
+
super("ClearBotAvatarResult", [
|
|
13769
|
+
{ no: 1, name: "bot", kind: "message", T: () => User }
|
|
13124
13770
|
]);
|
|
13125
13771
|
}
|
|
13126
13772
|
create(value) {
|
|
13127
13773
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
13128
|
-
message.token = "";
|
|
13129
13774
|
if (value !== undefined)
|
|
13130
13775
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13131
13776
|
return message;
|
|
@@ -13136,7 +13781,7 @@ class RotateBotTokenResult$Type extends import_runtime4.MessageType {
|
|
|
13136
13781
|
let [fieldNo, wireType] = reader.tag();
|
|
13137
13782
|
switch (fieldNo) {
|
|
13138
13783
|
case 1:
|
|
13139
|
-
message.
|
|
13784
|
+
message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
|
|
13140
13785
|
break;
|
|
13141
13786
|
default:
|
|
13142
13787
|
let u = options.readUnknownField;
|
|
@@ -13150,27 +13795,69 @@ class RotateBotTokenResult$Type extends import_runtime4.MessageType {
|
|
|
13150
13795
|
return message;
|
|
13151
13796
|
}
|
|
13152
13797
|
internalBinaryWrite(message, writer, options) {
|
|
13153
|
-
if (message.
|
|
13154
|
-
writer.tag(1, import_runtime.WireType.LengthDelimited).
|
|
13798
|
+
if (message.bot)
|
|
13799
|
+
User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13155
13800
|
let u = options.writeUnknownFields;
|
|
13156
13801
|
if (u !== false)
|
|
13157
13802
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13158
13803
|
return writer;
|
|
13159
13804
|
}
|
|
13160
13805
|
}
|
|
13161
|
-
var
|
|
13806
|
+
var ClearBotAvatarResult = new ClearBotAvatarResult$Type;
|
|
13162
13807
|
|
|
13163
|
-
class
|
|
13808
|
+
class GetBotPresenceInput$Type extends import_runtime4.MessageType {
|
|
13164
13809
|
constructor() {
|
|
13165
|
-
super("
|
|
13166
|
-
{ no: 1, name: "
|
|
13167
|
-
|
|
13168
|
-
|
|
13810
|
+
super("GetBotPresenceInput", [
|
|
13811
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer }
|
|
13812
|
+
]);
|
|
13813
|
+
}
|
|
13814
|
+
create(value) {
|
|
13815
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13816
|
+
if (value !== undefined)
|
|
13817
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13818
|
+
return message;
|
|
13819
|
+
}
|
|
13820
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13821
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13822
|
+
while (reader.pos < end) {
|
|
13823
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13824
|
+
switch (fieldNo) {
|
|
13825
|
+
case 1:
|
|
13826
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
13827
|
+
break;
|
|
13828
|
+
default:
|
|
13829
|
+
let u = options.readUnknownField;
|
|
13830
|
+
if (u === "throw")
|
|
13831
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13832
|
+
let d = reader.skip(wireType);
|
|
13833
|
+
if (u !== false)
|
|
13834
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13835
|
+
}
|
|
13836
|
+
}
|
|
13837
|
+
return message;
|
|
13838
|
+
}
|
|
13839
|
+
internalBinaryWrite(message, writer, options) {
|
|
13840
|
+
if (message.peerId)
|
|
13841
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13842
|
+
let u = options.writeUnknownFields;
|
|
13843
|
+
if (u !== false)
|
|
13844
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13845
|
+
return writer;
|
|
13846
|
+
}
|
|
13847
|
+
}
|
|
13848
|
+
var GetBotPresenceInput = new GetBotPresenceInput$Type;
|
|
13849
|
+
|
|
13850
|
+
class GetBotPresenceResult$Type extends import_runtime4.MessageType {
|
|
13851
|
+
constructor() {
|
|
13852
|
+
super("GetBotPresenceResult", [
|
|
13853
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", opt: true, T: 3, L: 0 },
|
|
13854
|
+
{ no: 2, name: "avatar", kind: "message", T: () => BotAvatar },
|
|
13855
|
+
{ no: 3, name: "state", kind: "message", T: () => BotPresenceState },
|
|
13856
|
+
{ no: 4, name: "peer_id", kind: "message", T: () => Peer }
|
|
13169
13857
|
]);
|
|
13170
13858
|
}
|
|
13171
13859
|
create(value) {
|
|
13172
13860
|
const message = globalThis.Object.create(this.messagePrototype);
|
|
13173
|
-
message.botUserId = 0n;
|
|
13174
13861
|
if (value !== undefined)
|
|
13175
13862
|
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13176
13863
|
return message;
|
|
@@ -13184,10 +13871,13 @@ class UpdateBotProfileInput$Type extends import_runtime4.MessageType {
|
|
|
13184
13871
|
message.botUserId = reader.int64().toBigInt();
|
|
13185
13872
|
break;
|
|
13186
13873
|
case 2:
|
|
13187
|
-
message.
|
|
13874
|
+
message.avatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.avatar);
|
|
13188
13875
|
break;
|
|
13189
13876
|
case 3:
|
|
13190
|
-
message.
|
|
13877
|
+
message.state = BotPresenceState.internalBinaryRead(reader, reader.uint32(), options, message.state);
|
|
13878
|
+
break;
|
|
13879
|
+
case 4:
|
|
13880
|
+
message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
13191
13881
|
break;
|
|
13192
13882
|
default:
|
|
13193
13883
|
let u = options.readUnknownField;
|
|
@@ -13201,24 +13891,27 @@ class UpdateBotProfileInput$Type extends import_runtime4.MessageType {
|
|
|
13201
13891
|
return message;
|
|
13202
13892
|
}
|
|
13203
13893
|
internalBinaryWrite(message, writer, options) {
|
|
13204
|
-
if (message.botUserId !==
|
|
13894
|
+
if (message.botUserId !== undefined)
|
|
13205
13895
|
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
13206
|
-
if (message.
|
|
13207
|
-
writer.tag(2, import_runtime.WireType.LengthDelimited).
|
|
13208
|
-
if (message.
|
|
13209
|
-
writer.tag(3, import_runtime.WireType.LengthDelimited).
|
|
13896
|
+
if (message.avatar)
|
|
13897
|
+
BotAvatar.internalBinaryWrite(message.avatar, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13898
|
+
if (message.state)
|
|
13899
|
+
BotPresenceState.internalBinaryWrite(message.state, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13900
|
+
if (message.peerId)
|
|
13901
|
+
Peer.internalBinaryWrite(message.peerId, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13210
13902
|
let u = options.writeUnknownFields;
|
|
13211
13903
|
if (u !== false)
|
|
13212
13904
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13213
13905
|
return writer;
|
|
13214
13906
|
}
|
|
13215
13907
|
}
|
|
13216
|
-
var
|
|
13908
|
+
var GetBotPresenceResult = new GetBotPresenceResult$Type;
|
|
13217
13909
|
|
|
13218
|
-
class
|
|
13910
|
+
class SetBotPresenceStateInput$Type extends import_runtime4.MessageType {
|
|
13219
13911
|
constructor() {
|
|
13220
|
-
super("
|
|
13221
|
-
{ no: 1, name: "
|
|
13912
|
+
super("SetBotPresenceStateInput", [
|
|
13913
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
13914
|
+
{ no: 2, name: "state", kind: "message", T: () => BotPresenceState }
|
|
13222
13915
|
]);
|
|
13223
13916
|
}
|
|
13224
13917
|
create(value) {
|
|
@@ -13233,7 +13926,10 @@ class UpdateBotProfileResult$Type extends import_runtime4.MessageType {
|
|
|
13233
13926
|
let [fieldNo, wireType] = reader.tag();
|
|
13234
13927
|
switch (fieldNo) {
|
|
13235
13928
|
case 1:
|
|
13236
|
-
message.
|
|
13929
|
+
message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
13930
|
+
break;
|
|
13931
|
+
case 2:
|
|
13932
|
+
message.state = BotPresenceState.internalBinaryRead(reader, reader.uint32(), options, message.state);
|
|
13237
13933
|
break;
|
|
13238
13934
|
default:
|
|
13239
13935
|
let u = options.readUnknownField;
|
|
@@ -13247,15 +13943,39 @@ class UpdateBotProfileResult$Type extends import_runtime4.MessageType {
|
|
|
13247
13943
|
return message;
|
|
13248
13944
|
}
|
|
13249
13945
|
internalBinaryWrite(message, writer, options) {
|
|
13250
|
-
if (message.
|
|
13251
|
-
|
|
13946
|
+
if (message.peerId)
|
|
13947
|
+
InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13948
|
+
if (message.state)
|
|
13949
|
+
BotPresenceState.internalBinaryWrite(message.state, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13252
13950
|
let u = options.writeUnknownFields;
|
|
13253
13951
|
if (u !== false)
|
|
13254
13952
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13255
13953
|
return writer;
|
|
13256
13954
|
}
|
|
13257
13955
|
}
|
|
13258
|
-
var
|
|
13956
|
+
var SetBotPresenceStateInput = new SetBotPresenceStateInput$Type;
|
|
13957
|
+
|
|
13958
|
+
class SetBotPresenceStateResult$Type extends import_runtime4.MessageType {
|
|
13959
|
+
constructor() {
|
|
13960
|
+
super("SetBotPresenceStateResult", []);
|
|
13961
|
+
}
|
|
13962
|
+
create(value) {
|
|
13963
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13964
|
+
if (value !== undefined)
|
|
13965
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13966
|
+
return message;
|
|
13967
|
+
}
|
|
13968
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13969
|
+
return target ?? this.create();
|
|
13970
|
+
}
|
|
13971
|
+
internalBinaryWrite(message, writer, options) {
|
|
13972
|
+
let u = options.writeUnknownFields;
|
|
13973
|
+
if (u !== false)
|
|
13974
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13975
|
+
return writer;
|
|
13976
|
+
}
|
|
13977
|
+
}
|
|
13978
|
+
var SetBotPresenceStateResult = new SetBotPresenceStateResult$Type;
|
|
13259
13979
|
|
|
13260
13980
|
class GetUserSettingsInput$Type extends import_runtime4.MessageType {
|
|
13261
13981
|
constructor() {
|
|
@@ -16395,7 +17115,9 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
16395
17115
|
{ no: 34, name: "chat_open", kind: "message", oneof: "update", T: () => UpdateChatOpen },
|
|
16396
17116
|
{ no: 35, name: "message_action_invoked", kind: "message", oneof: "update", T: () => UpdateMessageActionInvoked },
|
|
16397
17117
|
{ no: 36, name: "message_action_answered", kind: "message", oneof: "update", T: () => UpdateMessageActionAnswered },
|
|
16398
|
-
{ no: 37, name: "clear_chat_history", kind: "message", oneof: "update", T: () => UpdateClearChatHistory }
|
|
17118
|
+
{ no: 37, name: "clear_chat_history", kind: "message", oneof: "update", T: () => UpdateClearChatHistory },
|
|
17119
|
+
{ no: 38, name: "bot_presence", kind: "message", oneof: "update", T: () => UpdateBotPresence },
|
|
17120
|
+
{ no: 39, name: "dialog_follow_mode", kind: "message", oneof: "update", T: () => UpdateDialogFollowMode }
|
|
16399
17121
|
]);
|
|
16400
17122
|
}
|
|
16401
17123
|
create(value) {
|
|
@@ -16620,6 +17342,18 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
16620
17342
|
clearChatHistory: UpdateClearChatHistory.internalBinaryRead(reader, reader.uint32(), options, message.update.clearChatHistory)
|
|
16621
17343
|
};
|
|
16622
17344
|
break;
|
|
17345
|
+
case 38:
|
|
17346
|
+
message.update = {
|
|
17347
|
+
oneofKind: "botPresence",
|
|
17348
|
+
botPresence: UpdateBotPresence.internalBinaryRead(reader, reader.uint32(), options, message.update.botPresence)
|
|
17349
|
+
};
|
|
17350
|
+
break;
|
|
17351
|
+
case 39:
|
|
17352
|
+
message.update = {
|
|
17353
|
+
oneofKind: "dialogFollowMode",
|
|
17354
|
+
dialogFollowMode: UpdateDialogFollowMode.internalBinaryRead(reader, reader.uint32(), options, message.update.dialogFollowMode)
|
|
17355
|
+
};
|
|
17356
|
+
break;
|
|
16623
17357
|
default:
|
|
16624
17358
|
let u = options.readUnknownField;
|
|
16625
17359
|
if (u === "throw")
|
|
@@ -16704,6 +17438,10 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
16704
17438
|
UpdateMessageActionAnswered.internalBinaryWrite(message.update.messageActionAnswered, writer.tag(36, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16705
17439
|
if (message.update.oneofKind === "clearChatHistory")
|
|
16706
17440
|
UpdateClearChatHistory.internalBinaryWrite(message.update.clearChatHistory, writer.tag(37, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
17441
|
+
if (message.update.oneofKind === "botPresence")
|
|
17442
|
+
UpdateBotPresence.internalBinaryWrite(message.update.botPresence, writer.tag(38, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
17443
|
+
if (message.update.oneofKind === "dialogFollowMode")
|
|
17444
|
+
UpdateDialogFollowMode.internalBinaryWrite(message.update.dialogFollowMode, writer.tag(39, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16707
17445
|
let u = options.writeUnknownFields;
|
|
16708
17446
|
if (u !== false)
|
|
16709
17447
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -17564,6 +18302,54 @@ class UpdateDialogNotificationSettings$Type extends import_runtime4.MessageType
|
|
|
17564
18302
|
}
|
|
17565
18303
|
var UpdateDialogNotificationSettings = new UpdateDialogNotificationSettings$Type;
|
|
17566
18304
|
|
|
18305
|
+
class UpdateDialogFollowMode$Type extends import_runtime4.MessageType {
|
|
18306
|
+
constructor() {
|
|
18307
|
+
super("UpdateDialogFollowMode", [
|
|
18308
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => Peer },
|
|
18309
|
+
{ no: 2, name: "follow_mode", kind: "enum", opt: true, T: () => ["DialogFollowMode", DialogFollowMode] }
|
|
18310
|
+
]);
|
|
18311
|
+
}
|
|
18312
|
+
create(value) {
|
|
18313
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
18314
|
+
if (value !== undefined)
|
|
18315
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
18316
|
+
return message;
|
|
18317
|
+
}
|
|
18318
|
+
internalBinaryRead(reader, length, options, target) {
|
|
18319
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
18320
|
+
while (reader.pos < end) {
|
|
18321
|
+
let [fieldNo, wireType] = reader.tag();
|
|
18322
|
+
switch (fieldNo) {
|
|
18323
|
+
case 1:
|
|
18324
|
+
message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
18325
|
+
break;
|
|
18326
|
+
case 2:
|
|
18327
|
+
message.followMode = reader.int32();
|
|
18328
|
+
break;
|
|
18329
|
+
default:
|
|
18330
|
+
let u = options.readUnknownField;
|
|
18331
|
+
if (u === "throw")
|
|
18332
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
18333
|
+
let d = reader.skip(wireType);
|
|
18334
|
+
if (u !== false)
|
|
18335
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
18336
|
+
}
|
|
18337
|
+
}
|
|
18338
|
+
return message;
|
|
18339
|
+
}
|
|
18340
|
+
internalBinaryWrite(message, writer, options) {
|
|
18341
|
+
if (message.peerId)
|
|
18342
|
+
Peer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
18343
|
+
if (message.followMode !== undefined)
|
|
18344
|
+
writer.tag(2, import_runtime.WireType.Varint).int32(message.followMode);
|
|
18345
|
+
let u = options.writeUnknownFields;
|
|
18346
|
+
if (u !== false)
|
|
18347
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
18348
|
+
return writer;
|
|
18349
|
+
}
|
|
18350
|
+
}
|
|
18351
|
+
var UpdateDialogFollowMode = new UpdateDialogFollowMode$Type;
|
|
18352
|
+
|
|
17567
18353
|
class UpdateNewChat$Type extends import_runtime4.MessageType {
|
|
17568
18354
|
constructor() {
|
|
17569
18355
|
super("UpdateNewChat", [
|
|
@@ -18089,6 +18875,74 @@ class UpdateClearChatHistory$Type extends import_runtime4.MessageType {
|
|
|
18089
18875
|
}
|
|
18090
18876
|
var UpdateClearChatHistory = new UpdateClearChatHistory$Type;
|
|
18091
18877
|
|
|
18878
|
+
class UpdateBotPresence$Type extends import_runtime4.MessageType {
|
|
18879
|
+
constructor() {
|
|
18880
|
+
super("UpdateBotPresence", [
|
|
18881
|
+
{ no: 1, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
|
|
18882
|
+
{ no: 2, name: "peer_id", kind: "message", T: () => Peer },
|
|
18883
|
+
{ no: 3, name: "state", kind: "message", T: () => BotPresenceState },
|
|
18884
|
+
{ no: 4, name: "avatar", kind: "message", T: () => BotAvatar },
|
|
18885
|
+
{ no: 5, name: "avatar_changed", kind: "scalar", T: 8 }
|
|
18886
|
+
]);
|
|
18887
|
+
}
|
|
18888
|
+
create(value) {
|
|
18889
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
18890
|
+
message.botUserId = 0n;
|
|
18891
|
+
message.avatarChanged = false;
|
|
18892
|
+
if (value !== undefined)
|
|
18893
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
18894
|
+
return message;
|
|
18895
|
+
}
|
|
18896
|
+
internalBinaryRead(reader, length, options, target) {
|
|
18897
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
18898
|
+
while (reader.pos < end) {
|
|
18899
|
+
let [fieldNo, wireType] = reader.tag();
|
|
18900
|
+
switch (fieldNo) {
|
|
18901
|
+
case 1:
|
|
18902
|
+
message.botUserId = reader.int64().toBigInt();
|
|
18903
|
+
break;
|
|
18904
|
+
case 2:
|
|
18905
|
+
message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
|
|
18906
|
+
break;
|
|
18907
|
+
case 3:
|
|
18908
|
+
message.state = BotPresenceState.internalBinaryRead(reader, reader.uint32(), options, message.state);
|
|
18909
|
+
break;
|
|
18910
|
+
case 4:
|
|
18911
|
+
message.avatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.avatar);
|
|
18912
|
+
break;
|
|
18913
|
+
case 5:
|
|
18914
|
+
message.avatarChanged = reader.bool();
|
|
18915
|
+
break;
|
|
18916
|
+
default:
|
|
18917
|
+
let u = options.readUnknownField;
|
|
18918
|
+
if (u === "throw")
|
|
18919
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
18920
|
+
let d = reader.skip(wireType);
|
|
18921
|
+
if (u !== false)
|
|
18922
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
18923
|
+
}
|
|
18924
|
+
}
|
|
18925
|
+
return message;
|
|
18926
|
+
}
|
|
18927
|
+
internalBinaryWrite(message, writer, options) {
|
|
18928
|
+
if (message.botUserId !== 0n)
|
|
18929
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
18930
|
+
if (message.peerId)
|
|
18931
|
+
Peer.internalBinaryWrite(message.peerId, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
18932
|
+
if (message.state)
|
|
18933
|
+
BotPresenceState.internalBinaryWrite(message.state, writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
18934
|
+
if (message.avatar)
|
|
18935
|
+
BotAvatar.internalBinaryWrite(message.avatar, writer.tag(4, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
18936
|
+
if (message.avatarChanged !== false)
|
|
18937
|
+
writer.tag(5, import_runtime.WireType.Varint).bool(message.avatarChanged);
|
|
18938
|
+
let u = options.writeUnknownFields;
|
|
18939
|
+
if (u !== false)
|
|
18940
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
18941
|
+
return writer;
|
|
18942
|
+
}
|
|
18943
|
+
}
|
|
18944
|
+
var UpdateBotPresence = new UpdateBotPresence$Type;
|
|
18945
|
+
|
|
18092
18946
|
class UpdateMessageId$Type extends import_runtime4.MessageType {
|
|
18093
18947
|
constructor() {
|
|
18094
18948
|
super("UpdateMessageId", [
|
|
@@ -21029,7 +21883,7 @@ class InlineSdkClient {
|
|
|
21029
21883
|
await this.handleUpdate(update);
|
|
21030
21884
|
}
|
|
21031
21885
|
}
|
|
21032
|
-
async handleUpdate(update) {
|
|
21886
|
+
async handleUpdate(update, options) {
|
|
21033
21887
|
const seq = update.seq ?? 0;
|
|
21034
21888
|
const date = update.date ?? 0n;
|
|
21035
21889
|
switch (update.update.oneofKind) {
|
|
@@ -21161,6 +22015,34 @@ class InlineSdkClient {
|
|
|
21161
22015
|
});
|
|
21162
22016
|
return;
|
|
21163
22017
|
}
|
|
22018
|
+
case "participantAdd": {
|
|
22019
|
+
const payload = update.update.participantAdd;
|
|
22020
|
+
if (options?.source !== "user" && options?.source !== "space") {
|
|
22021
|
+
this.bumpChatSeq(payload.chatId, seq);
|
|
22022
|
+
}
|
|
22023
|
+
await this.eventStream.send({
|
|
22024
|
+
kind: "chat.participant.add",
|
|
22025
|
+
chatId: payload.chatId,
|
|
22026
|
+
...payload.participant ? { participant: payload.participant } : {},
|
|
22027
|
+
seq,
|
|
22028
|
+
date
|
|
22029
|
+
});
|
|
22030
|
+
return;
|
|
22031
|
+
}
|
|
22032
|
+
case "participantDelete": {
|
|
22033
|
+
const payload = update.update.participantDelete;
|
|
22034
|
+
if (options?.source !== "user" && options?.source !== "space") {
|
|
22035
|
+
this.bumpChatSeq(payload.chatId, seq);
|
|
22036
|
+
}
|
|
22037
|
+
await this.eventStream.send({
|
|
22038
|
+
kind: "chat.participant.delete",
|
|
22039
|
+
chatId: payload.chatId,
|
|
22040
|
+
userId: payload.userId,
|
|
22041
|
+
seq,
|
|
22042
|
+
date
|
|
22043
|
+
});
|
|
22044
|
+
return;
|
|
22045
|
+
}
|
|
21164
22046
|
case "messageActionInvoked": {
|
|
21165
22047
|
const payload = update.update.messageActionInvoked;
|
|
21166
22048
|
if (this.shouldSkipUserSeq(seq)) {
|
|
@@ -21261,14 +22143,14 @@ class InlineSdkClient {
|
|
|
21261
22143
|
}
|
|
21262
22144
|
}
|
|
21263
22145
|
requestCatchUpUser() {
|
|
21264
|
-
const lastUserSeq = this.state.lastUserSeq
|
|
21265
|
-
if (lastUserSeq
|
|
22146
|
+
const lastUserSeq = this.state.lastUserSeq;
|
|
22147
|
+
if (lastUserSeq == null && !this.options.catchUpUserFromStart) {
|
|
21266
22148
|
return;
|
|
21267
22149
|
}
|
|
21268
22150
|
if (this.userCatchUpInFlight) {
|
|
21269
22151
|
return;
|
|
21270
22152
|
}
|
|
21271
|
-
this.userCatchUpInFlight = this.doCatchUpUser(lastUserSeq).catch((error) => {
|
|
22153
|
+
this.userCatchUpInFlight = this.doCatchUpUser(lastUserSeq ?? 0).catch((error) => {
|
|
21272
22154
|
this.log.warn?.("GET_UPDATES user catch-up failed; continuing live delivery", {
|
|
21273
22155
|
error: extractErrorMessage(error)
|
|
21274
22156
|
});
|
|
@@ -21309,7 +22191,7 @@ class InlineSdkClient {
|
|
|
21309
22191
|
return;
|
|
21310
22192
|
}
|
|
21311
22193
|
for (const update of payload.updates) {
|
|
21312
|
-
await this.handleUpdate(update);
|
|
22194
|
+
await this.handleUpdate(update, { source: "user" });
|
|
21313
22195
|
}
|
|
21314
22196
|
this.bumpUserSeq(deliveredSeq);
|
|
21315
22197
|
if (payload.date !== 0n) {
|
|
@@ -21408,7 +22290,7 @@ class InlineSdkClient {
|
|
|
21408
22290
|
}
|
|
21409
22291
|
this.bumpChatSeq(chatId, deliveredSeq);
|
|
21410
22292
|
for (const update of payload.updates) {
|
|
21411
|
-
await this.handleUpdate(update);
|
|
22293
|
+
await this.handleUpdate(update, { source: "chat" });
|
|
21412
22294
|
}
|
|
21413
22295
|
if (payload.date !== 0n) {
|
|
21414
22296
|
this.state.dateCursor = payload.date;
|
|
@@ -21510,7 +22392,7 @@ class InlineSdkClient {
|
|
|
21510
22392
|
}
|
|
21511
22393
|
this.bumpSpaceSeq(spaceId, deliveredSeq);
|
|
21512
22394
|
for (const update of payload.updates) {
|
|
21513
|
-
await this.handleUpdate(update);
|
|
22395
|
+
await this.handleUpdate(update, { source: "space" });
|
|
21514
22396
|
}
|
|
21515
22397
|
if (payload.date !== 0n) {
|
|
21516
22398
|
this.state.dateCursor = payload.date;
|
|
@@ -36445,6 +37327,8 @@ var InlineExecApprovalsSchema = exports_external.object({
|
|
|
36445
37327
|
var InlineReactionNotificationsSchema = exports_external.enum(["off", "own", "all", "allowlist"]);
|
|
36446
37328
|
var InlineStreamingModeSchema = exports_external.enum(["off", "partial", "block", "progress"]);
|
|
36447
37329
|
var InlineStreamingCommandTextSchema = exports_external.enum(["raw", "status"]);
|
|
37330
|
+
var INLINE_DEFAULT_GROUP_POLICY = "open";
|
|
37331
|
+
var INLINE_DEFAULT_REQUIRE_MENTION = true;
|
|
36448
37332
|
var InlineStreamingChunkSchema = exports_external.object({
|
|
36449
37333
|
minChars: exports_external.number().int().positive().optional(),
|
|
36450
37334
|
maxChars: exports_external.number().int().positive().optional(),
|
|
@@ -36516,7 +37400,7 @@ var InlineAccountSchemaBase = exports_external.object({
|
|
|
36516
37400
|
defaultTo: InlineTargetSchema.optional(),
|
|
36517
37401
|
systemPrompt: exports_external.string().optional(),
|
|
36518
37402
|
groupAllowFrom: exports_external.array(InlineAllowEntrySchema).optional(),
|
|
36519
|
-
groupPolicy: GroupPolicySchema.optional().default(
|
|
37403
|
+
groupPolicy: GroupPolicySchema.optional().default(INLINE_DEFAULT_GROUP_POLICY),
|
|
36520
37404
|
groups: exports_external.record(exports_external.string(), InlineGroupSchema.optional()).optional(),
|
|
36521
37405
|
requireMention: exports_external.boolean().optional(),
|
|
36522
37406
|
replyThreadMode: InlineReplyThreadModeSchema.optional(),
|
|
@@ -37250,6 +38134,17 @@ function readStringCandidate(...values) {
|
|
|
37250
38134
|
}
|
|
37251
38135
|
|
|
37252
38136
|
// src/inline/message-tools.ts
|
|
38137
|
+
var INLINE_BOT_PRESENCE_COMMENT_MAX_LENGTH = 30;
|
|
38138
|
+
var INLINE_BOT_PRESENCE_KINDS = [
|
|
38139
|
+
"idle",
|
|
38140
|
+
"happy",
|
|
38141
|
+
"waving",
|
|
38142
|
+
"jumping",
|
|
38143
|
+
"failed",
|
|
38144
|
+
"waiting",
|
|
38145
|
+
"running",
|
|
38146
|
+
"review"
|
|
38147
|
+
];
|
|
37253
38148
|
var InlineNudgeToolParameters = {
|
|
37254
38149
|
type: "object",
|
|
37255
38150
|
additionalProperties: false,
|
|
@@ -37350,6 +38245,43 @@ var InlineForwardToolParameters = {
|
|
|
37350
38245
|
},
|
|
37351
38246
|
required: ["to"]
|
|
37352
38247
|
};
|
|
38248
|
+
var InlineBotPresenceToolParameters = {
|
|
38249
|
+
type: "object",
|
|
38250
|
+
additionalProperties: false,
|
|
38251
|
+
properties: {
|
|
38252
|
+
kind: {
|
|
38253
|
+
type: "string",
|
|
38254
|
+
enum: INLINE_BOT_PRESENCE_KINDS,
|
|
38255
|
+
description: "Body state for your on-screen Inline character. Use waving for greetings/attention, jumping for delight/completion, review for thinking, waiting for user input, running for active work, failed when blocked/disappointed, happy for positive settled moments, and idle only when neutral is intentionally useful."
|
|
38256
|
+
},
|
|
38257
|
+
comment: {
|
|
38258
|
+
type: "string",
|
|
38259
|
+
maxLength: INLINE_BOT_PRESENCE_COMMENT_MAX_LENGTH,
|
|
38260
|
+
description: "Tiny generated thought bubble from your actual current mood, process, status, request, nudge, or aside. Keep it casual, characterful, and under 30 characters; text or one/two emojis are both fine. It supplements the chat answer and should not replace substantive content."
|
|
38261
|
+
},
|
|
38262
|
+
to: {
|
|
38263
|
+
type: "string",
|
|
38264
|
+
description: "Optional Inline target (`chat:<id>`, bare chat id, or `user:<id>`). Defaults to the current Inline chat when available."
|
|
38265
|
+
},
|
|
38266
|
+
target: {
|
|
38267
|
+
type: "string",
|
|
38268
|
+
description: "Alias for `to`."
|
|
38269
|
+
},
|
|
38270
|
+
chatId: {
|
|
38271
|
+
type: "string",
|
|
38272
|
+
description: "Explicit chat id target alias."
|
|
38273
|
+
},
|
|
38274
|
+
userId: {
|
|
38275
|
+
type: "string",
|
|
38276
|
+
description: "Explicit user id target alias."
|
|
38277
|
+
},
|
|
38278
|
+
accountId: {
|
|
38279
|
+
type: "string",
|
|
38280
|
+
description: "Optional Inline account id override."
|
|
38281
|
+
}
|
|
38282
|
+
},
|
|
38283
|
+
required: ["kind"]
|
|
38284
|
+
};
|
|
37353
38285
|
function resolvePeerTarget(params) {
|
|
37354
38286
|
if (params.direct) {
|
|
37355
38287
|
return {
|
|
@@ -37430,6 +38362,48 @@ function extractFirstMessageId2(updates) {
|
|
|
37430
38362
|
}
|
|
37431
38363
|
return null;
|
|
37432
38364
|
}
|
|
38365
|
+
function normalizeInlineBotPresenceKind(value) {
|
|
38366
|
+
if (typeof value !== "string") {
|
|
38367
|
+
throw new Error("inline_bot_presence: `kind` is required");
|
|
38368
|
+
}
|
|
38369
|
+
const normalized = value.trim().toLowerCase();
|
|
38370
|
+
for (const kind of INLINE_BOT_PRESENCE_KINDS) {
|
|
38371
|
+
if (kind === normalized)
|
|
38372
|
+
return kind;
|
|
38373
|
+
}
|
|
38374
|
+
throw new Error(`inline_bot_presence: invalid kind "${value}"`);
|
|
38375
|
+
}
|
|
38376
|
+
function botPresenceStateKind(kind) {
|
|
38377
|
+
switch (kind) {
|
|
38378
|
+
case "idle":
|
|
38379
|
+
return BotPresenceState_Kind.IDLE;
|
|
38380
|
+
case "happy":
|
|
38381
|
+
return BotPresenceState_Kind.HAPPY;
|
|
38382
|
+
case "waving":
|
|
38383
|
+
return BotPresenceState_Kind.WAVING;
|
|
38384
|
+
case "jumping":
|
|
38385
|
+
return BotPresenceState_Kind.JUMPING;
|
|
38386
|
+
case "failed":
|
|
38387
|
+
return BotPresenceState_Kind.FAILED;
|
|
38388
|
+
case "waiting":
|
|
38389
|
+
return BotPresenceState_Kind.WAITING;
|
|
38390
|
+
case "running":
|
|
38391
|
+
return BotPresenceState_Kind.RUNNING;
|
|
38392
|
+
case "review":
|
|
38393
|
+
return BotPresenceState_Kind.REVIEW;
|
|
38394
|
+
}
|
|
38395
|
+
}
|
|
38396
|
+
function normalizeInlineBotPresenceComment(value) {
|
|
38397
|
+
if (typeof value !== "string")
|
|
38398
|
+
return;
|
|
38399
|
+
const visible = sanitizeInlineVisibleText(value);
|
|
38400
|
+
if (visible.shouldSkip)
|
|
38401
|
+
return;
|
|
38402
|
+
const text = visible.text.replace(/\s+/g, " ").trim();
|
|
38403
|
+
if (!text)
|
|
38404
|
+
return;
|
|
38405
|
+
return Array.from(text).slice(0, INLINE_BOT_PRESENCE_COMMENT_MAX_LENGTH).join("");
|
|
38406
|
+
}
|
|
37433
38407
|
async function withInlineClient(params) {
|
|
37434
38408
|
const account = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId ?? null });
|
|
37435
38409
|
if (!account.configured || !account.baseUrl) {
|
|
@@ -37500,6 +38474,54 @@ function createInlineNudgeTool(ctx) {
|
|
|
37500
38474
|
}
|
|
37501
38475
|
};
|
|
37502
38476
|
}
|
|
38477
|
+
function createInlineBotPresenceTool(ctx) {
|
|
38478
|
+
return {
|
|
38479
|
+
name: "inline_bot_presence",
|
|
38480
|
+
label: "Body Cue",
|
|
38481
|
+
description: "Move or emote through your literal on-screen Inline character/body without sending a chat message. This is a cheap body-language/thought-bubble tool: use it during active work when your mood, thought, status, request, or final beat would help the human read you better.",
|
|
38482
|
+
parameters: InlineBotPresenceToolParameters,
|
|
38483
|
+
execute: async (_toolCallId, rawArgs) => {
|
|
38484
|
+
if (!ctx.config) {
|
|
38485
|
+
throw new Error("inline_bot_presence: missing OpenClaw config");
|
|
38486
|
+
}
|
|
38487
|
+
const args = rawArgs;
|
|
38488
|
+
const fallbackTarget = parseCurrentInlineTarget(ctx);
|
|
38489
|
+
const { target, usedFallback } = resolvePeerTarget({
|
|
38490
|
+
label: "target",
|
|
38491
|
+
direct: readStringCandidate(args.to, args.target),
|
|
38492
|
+
chatId: args.chatId,
|
|
38493
|
+
userId: args.userId,
|
|
38494
|
+
fallback: fallbackTarget
|
|
38495
|
+
});
|
|
38496
|
+
const kind = normalizeInlineBotPresenceKind(args.kind);
|
|
38497
|
+
const comment = normalizeInlineBotPresenceComment(args.comment);
|
|
38498
|
+
return await withInlineClient({
|
|
38499
|
+
cfg: ctx.config,
|
|
38500
|
+
accountId: args.accountId ?? ctx.agentAccountId ?? null,
|
|
38501
|
+
fn: async (client, resolvedAccountId) => {
|
|
38502
|
+
await client.invokeRaw(Method.SET_BOT_PRESENCE_STATE, {
|
|
38503
|
+
oneofKind: "setBotPresenceState",
|
|
38504
|
+
setBotPresenceState: {
|
|
38505
|
+
peerId: target.peerId,
|
|
38506
|
+
state: {
|
|
38507
|
+
kind: botPresenceStateKind(kind),
|
|
38508
|
+
...comment ? { comment } : {}
|
|
38509
|
+
}
|
|
38510
|
+
}
|
|
38511
|
+
});
|
|
38512
|
+
return jsonResult({
|
|
38513
|
+
ok: true,
|
|
38514
|
+
accountId: resolvedAccountId,
|
|
38515
|
+
target: target.normalized,
|
|
38516
|
+
usedCurrentChatDefault: usedFallback,
|
|
38517
|
+
kind,
|
|
38518
|
+
comment: comment ?? null
|
|
38519
|
+
});
|
|
38520
|
+
}
|
|
38521
|
+
});
|
|
38522
|
+
}
|
|
38523
|
+
};
|
|
38524
|
+
}
|
|
37503
38525
|
function createInlineForwardTool(ctx) {
|
|
37504
38526
|
return {
|
|
37505
38527
|
name: "inline_forward",
|
|
@@ -37558,7 +38580,7 @@ function createInlineForwardTool(ctx) {
|
|
|
37558
38580
|
function createInlineMessageTools(ctx) {
|
|
37559
38581
|
if (!ctx.config)
|
|
37560
38582
|
return [];
|
|
37561
|
-
return [createInlineNudgeTool(ctx), createInlineForwardTool(ctx)];
|
|
38583
|
+
return [createInlineNudgeTool(ctx), createInlineForwardTool(ctx), createInlineBotPresenceTool(ctx)];
|
|
37562
38584
|
}
|
|
37563
38585
|
|
|
37564
38586
|
// src/inline/space-members.ts
|
|
@@ -37747,6 +38769,80 @@ function createInlineMembersTool(ctx) {
|
|
|
37747
38769
|
};
|
|
37748
38770
|
}
|
|
37749
38771
|
|
|
38772
|
+
// src/inline/message-formatting.ts
|
|
38773
|
+
var INLINE_FORMATTING_RULES = [
|
|
38774
|
+
"Use Inline markdown.",
|
|
38775
|
+
"Prefer bullet lists over markdown tables.",
|
|
38776
|
+
"If a table is necessary, render it inside a fenced code block.",
|
|
38777
|
+
"Use plain URLs or markdown links; do not wrap bare URLs in inline code or backticks.",
|
|
38778
|
+
"Mention Inline users with markdown links like [@FirstName](inline://user?id=123); use inline://user?username=username only when the user id is unavailable.",
|
|
38779
|
+
"Link Inline chats/threads with markdown links like [Planning](inline://chat?id=123) or [Planning](inline://thread?id=123); use inline://thread?space_id=7 when only the title and space are known.",
|
|
38780
|
+
"Use inline code only for actual code, commands, file paths, env vars, or identifiers."
|
|
38781
|
+
];
|
|
38782
|
+
var INLINE_COPY_REPLACEMENTS = [
|
|
38783
|
+
[
|
|
38784
|
+
/Bind this (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) to a session target\.?/gi,
|
|
38785
|
+
"Bind this Inline conversation to a session target."
|
|
38786
|
+
],
|
|
38787
|
+
[
|
|
38788
|
+
/Remove the current (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) binding\.?/gi,
|
|
38789
|
+
"Remove the current Inline conversation binding."
|
|
38790
|
+
]
|
|
38791
|
+
];
|
|
38792
|
+
function normalizeInlineMarkdownLabel(raw, fallback) {
|
|
38793
|
+
return (raw ?? "").replace(/\s+/g, " ").trim() || fallback;
|
|
38794
|
+
}
|
|
38795
|
+
function escapeInlineMarkdownLabel(raw) {
|
|
38796
|
+
return raw.replace(/\\/g, "\\\\").replace(/\[/g, "\\[").replace(/\]/g, "\\]");
|
|
38797
|
+
}
|
|
38798
|
+
function encodeInlineMarkdownValue(raw) {
|
|
38799
|
+
return encodeURIComponent(String(raw).trim());
|
|
38800
|
+
}
|
|
38801
|
+
function isBareHttpUrl(text) {
|
|
38802
|
+
if (!/^https?:\/\/\S+$/i.test(text))
|
|
38803
|
+
return false;
|
|
38804
|
+
try {
|
|
38805
|
+
const url2 = new URL(text);
|
|
38806
|
+
return url2.protocol === "http:" || url2.protocol === "https:";
|
|
38807
|
+
} catch {
|
|
38808
|
+
return false;
|
|
38809
|
+
}
|
|
38810
|
+
}
|
|
38811
|
+
function adaptInlineVisibleCopy(text) {
|
|
38812
|
+
let result = text;
|
|
38813
|
+
for (const [from, to] of INLINE_COPY_REPLACEMENTS) {
|
|
38814
|
+
result = result.replace(from, to);
|
|
38815
|
+
}
|
|
38816
|
+
return result;
|
|
38817
|
+
}
|
|
38818
|
+
function buildInlineSystemPrompt(extraPrompt) {
|
|
38819
|
+
return extraPrompt?.trim() || "";
|
|
38820
|
+
}
|
|
38821
|
+
function buildInlineInboundFormattingHints() {
|
|
38822
|
+
return {
|
|
38823
|
+
text_markup: "inline_markdown",
|
|
38824
|
+
rules: [...INLINE_FORMATTING_RULES]
|
|
38825
|
+
};
|
|
38826
|
+
}
|
|
38827
|
+
function buildInlineThreadMarkdownLink(params) {
|
|
38828
|
+
const title = normalizeInlineMarkdownLabel(params.title, `thread:${String(params.threadId)}`);
|
|
38829
|
+
return `[${escapeInlineMarkdownLabel(title)}](inline://thread?id=${encodeInlineMarkdownValue(params.threadId)})`;
|
|
38830
|
+
}
|
|
38831
|
+
function buildInlineThreadTitleMarkdownLink(params) {
|
|
38832
|
+
const title = normalizeInlineMarkdownLabel(params.title, `space:${String(params.spaceId)}`);
|
|
38833
|
+
const label = normalizeInlineMarkdownLabel(params.label, title);
|
|
38834
|
+
const query = [`space_id=${encodeInlineMarkdownValue(params.spaceId)}`];
|
|
38835
|
+
if (label !== title) {
|
|
38836
|
+
query.push(`title=${encodeInlineMarkdownValue(title)}`);
|
|
38837
|
+
}
|
|
38838
|
+
return `[${escapeInlineMarkdownLabel(label)}](inline://thread?${query.join("&")})`;
|
|
38839
|
+
}
|
|
38840
|
+
function sanitizeInlineOutgoingText(text) {
|
|
38841
|
+
return adaptInlineVisibleCopy(text).replace(/`([^`\n]+)`/g, (full, content) => {
|
|
38842
|
+
return isBareHttpUrl(content) ? content : full;
|
|
38843
|
+
});
|
|
38844
|
+
}
|
|
38845
|
+
|
|
37750
38846
|
// src/inline/message-content.ts
|
|
37751
38847
|
var INLINE_MESSAGE_ENTITY_TYPE = {
|
|
37752
38848
|
MENTION: 1,
|
|
@@ -37758,7 +38854,9 @@ var INLINE_MESSAGE_ENTITY_TYPE = {
|
|
|
37758
38854
|
USERNAME_MENTION: 7,
|
|
37759
38855
|
CODE: 8,
|
|
37760
38856
|
PRE: 9,
|
|
37761
|
-
PHONE_NUMBER: 10
|
|
38857
|
+
PHONE_NUMBER: 10,
|
|
38858
|
+
THREAD: 11,
|
|
38859
|
+
THREAD_TITLE: 12
|
|
37762
38860
|
};
|
|
37763
38861
|
function compactWhitespace(raw) {
|
|
37764
38862
|
return (raw ?? "").replace(/\s+/g, " ").trim();
|
|
@@ -37926,6 +39024,10 @@ function mapEntityType(type) {
|
|
|
37926
39024
|
return "pre";
|
|
37927
39025
|
case INLINE_MESSAGE_ENTITY_TYPE.PHONE_NUMBER:
|
|
37928
39026
|
return "phone_number";
|
|
39027
|
+
case INLINE_MESSAGE_ENTITY_TYPE.THREAD:
|
|
39028
|
+
return "thread";
|
|
39029
|
+
case INLINE_MESSAGE_ENTITY_TYPE.THREAD_TITLE:
|
|
39030
|
+
return "thread_title";
|
|
37929
39031
|
default:
|
|
37930
39032
|
return "unknown";
|
|
37931
39033
|
}
|
|
@@ -37967,6 +39069,26 @@ function messageEntitySummaries(message) {
|
|
|
37967
39069
|
const language = compactWhitespace(entity.entity.pre.language);
|
|
37968
39070
|
if (language)
|
|
37969
39071
|
summary.language = language;
|
|
39072
|
+
} else if (entity.entity.oneofKind === "thread") {
|
|
39073
|
+
const chatId = entity.entity.thread.chatId.toString();
|
|
39074
|
+
summary.chatId = chatId;
|
|
39075
|
+
summary.markdownLink = buildInlineThreadMarkdownLink({
|
|
39076
|
+
threadId: chatId,
|
|
39077
|
+
...summary.text ? { title: summary.text } : {}
|
|
39078
|
+
});
|
|
39079
|
+
} else if (entity.entity.oneofKind === "threadTitle") {
|
|
39080
|
+
const spaceId = entity.entity.threadTitle.spaceId.toString();
|
|
39081
|
+
const title = compactWhitespace(entity.entity.threadTitle.title);
|
|
39082
|
+
summary.spaceId = spaceId;
|
|
39083
|
+
if (title)
|
|
39084
|
+
summary.title = title;
|
|
39085
|
+
if (title || summary.text) {
|
|
39086
|
+
summary.markdownLink = buildInlineThreadTitleMarkdownLink({
|
|
39087
|
+
spaceId,
|
|
39088
|
+
title: title || summary.text || `space:${spaceId}`,
|
|
39089
|
+
label: summary.text || title
|
|
39090
|
+
});
|
|
39091
|
+
}
|
|
37970
39092
|
}
|
|
37971
39093
|
entities.push(summary);
|
|
37972
39094
|
}
|
|
@@ -38019,6 +39141,13 @@ function formatEntitySummary(entity) {
|
|
|
38019
39141
|
return entity.userId ? `mention${quotedText} -> user:${entity.userId}` : `mention${quotedText}`;
|
|
38020
39142
|
case "text_link":
|
|
38021
39143
|
return entity.url ? `text link${quotedText} -> ${entity.url}` : `text link${quotedText}`;
|
|
39144
|
+
case "thread":
|
|
39145
|
+
return entity.chatId ? `thread link${quotedText} -> thread:${entity.chatId}` : `thread link${quotedText}`;
|
|
39146
|
+
case "thread_title":
|
|
39147
|
+
if (entity.spaceId && entity.title) {
|
|
39148
|
+
return `thread title link${quotedText} -> space:${entity.spaceId} title:"${entity.title}"`;
|
|
39149
|
+
}
|
|
39150
|
+
return entity.spaceId ? `thread title link${quotedText} -> space:${entity.spaceId}` : `thread title link${quotedText}`;
|
|
38022
39151
|
case "pre":
|
|
38023
39152
|
return entity.language ? `preformatted block${quotedText} (language: ${entity.language})` : `preformatted block${quotedText}`;
|
|
38024
39153
|
case "username_mention":
|
|
@@ -38292,14 +39421,17 @@ function sortMessages(messages) {
|
|
|
38292
39421
|
return a.id < b.id ? -1 : 1;
|
|
38293
39422
|
});
|
|
38294
39423
|
}
|
|
39424
|
+
function messageDedupeKey(message) {
|
|
39425
|
+
return `${String(message.id)}:${String(message.date)}`;
|
|
39426
|
+
}
|
|
38295
39427
|
function dedupeMessages(messages) {
|
|
38296
39428
|
const seen = new Set;
|
|
38297
39429
|
const out = [];
|
|
38298
39430
|
for (const message of messages) {
|
|
38299
|
-
const
|
|
38300
|
-
if (seen.has(
|
|
39431
|
+
const key = messageDedupeKey(message);
|
|
39432
|
+
if (seen.has(key))
|
|
38301
39433
|
continue;
|
|
38302
|
-
seen.add(
|
|
39434
|
+
seen.add(key);
|
|
38303
39435
|
out.push(message);
|
|
38304
39436
|
}
|
|
38305
39437
|
return out;
|
|
@@ -38428,56 +39560,11 @@ function createInlineParentContextTool(ctx) {
|
|
|
38428
39560
|
};
|
|
38429
39561
|
}
|
|
38430
39562
|
|
|
38431
|
-
// src/inline/
|
|
38432
|
-
|
|
38433
|
-
|
|
38434
|
-
|
|
38435
|
-
|
|
38436
|
-
"Use plain URLs or markdown links; do not wrap bare URLs in inline code or backticks.",
|
|
38437
|
-
"Mention Inline users with markdown links like [@FirstName](inline://user?id=123); use inline://user?username=username only when the user id is unavailable.",
|
|
38438
|
-
"Use inline code only for actual code, commands, file paths, env vars, or identifiers."
|
|
38439
|
-
];
|
|
38440
|
-
var INLINE_COPY_REPLACEMENTS = [
|
|
38441
|
-
[
|
|
38442
|
-
/Bind this (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) to a session target\.?/gi,
|
|
38443
|
-
"Bind this Inline conversation to a session target."
|
|
38444
|
-
],
|
|
38445
|
-
[
|
|
38446
|
-
/Remove the current (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) binding\.?/gi,
|
|
38447
|
-
"Remove the current Inline conversation binding."
|
|
38448
|
-
]
|
|
38449
|
-
];
|
|
38450
|
-
function isBareHttpUrl(text) {
|
|
38451
|
-
if (!/^https?:\/\/\S+$/i.test(text))
|
|
38452
|
-
return false;
|
|
38453
|
-
try {
|
|
38454
|
-
const url2 = new URL(text);
|
|
38455
|
-
return url2.protocol === "http:" || url2.protocol === "https:";
|
|
38456
|
-
} catch {
|
|
38457
|
-
return false;
|
|
38458
|
-
}
|
|
38459
|
-
}
|
|
38460
|
-
function adaptInlineVisibleCopy(text) {
|
|
38461
|
-
let result = text;
|
|
38462
|
-
for (const [from, to] of INLINE_COPY_REPLACEMENTS) {
|
|
38463
|
-
result = result.replace(from, to);
|
|
38464
|
-
}
|
|
38465
|
-
return result;
|
|
38466
|
-
}
|
|
38467
|
-
function buildInlineSystemPrompt(extraPrompt) {
|
|
38468
|
-
return extraPrompt?.trim() || "";
|
|
38469
|
-
}
|
|
38470
|
-
function buildInlineInboundFormattingHints() {
|
|
38471
|
-
return {
|
|
38472
|
-
text_markup: "inline_markdown",
|
|
38473
|
-
rules: [...INLINE_FORMATTING_RULES]
|
|
38474
|
-
};
|
|
38475
|
-
}
|
|
38476
|
-
function sanitizeInlineOutgoingText(text) {
|
|
38477
|
-
return adaptInlineVisibleCopy(text).replace(/`([^`\n]+)`/g, (full, content) => {
|
|
38478
|
-
return isBareHttpUrl(content) ? content : full;
|
|
38479
|
-
});
|
|
38480
|
-
}
|
|
39563
|
+
// src/inline/bot-avatar-tool.ts
|
|
39564
|
+
import { inflateRawSync } from "node:zlib";
|
|
39565
|
+
import path from "node:path";
|
|
39566
|
+
import { fileURLToPath } from "node:url";
|
|
39567
|
+
import os from "node:os";
|
|
38481
39568
|
|
|
38482
39569
|
// src/runtime.ts
|
|
38483
39570
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
@@ -38491,6 +39578,370 @@ var {
|
|
|
38491
39578
|
errorMessage: "Inline runtime not initialized"
|
|
38492
39579
|
});
|
|
38493
39580
|
|
|
39581
|
+
// src/inline/bot-avatar-tool.ts
|
|
39582
|
+
var MAX_PACKAGE_BYTES = 40000000;
|
|
39583
|
+
var MAX_MANIFEST_BYTES = 64000;
|
|
39584
|
+
var ZIP_EOCD_SIGNATURE = 101010256;
|
|
39585
|
+
var ZIP_CENTRAL_SIGNATURE = 33639248;
|
|
39586
|
+
var ZIP_LOCAL_SIGNATURE = 67324752;
|
|
39587
|
+
var ZIP_METHOD_STORE = 0;
|
|
39588
|
+
var ZIP_METHOD_DEFLATE = 8;
|
|
39589
|
+
var ZIP_FLAG_ENCRYPTED = 1;
|
|
39590
|
+
var CODEX_ATLAS_KIND = "codex_atlas";
|
|
39591
|
+
var InlineBotAvatarToolParameters = {
|
|
39592
|
+
type: "object",
|
|
39593
|
+
additionalProperties: false,
|
|
39594
|
+
properties: {
|
|
39595
|
+
zipPath: {
|
|
39596
|
+
type: "string",
|
|
39597
|
+
description: "Local path to a .zip avatar package. The archive should contain a Codex atlas manifest and a PNG/WebP spritesheet."
|
|
39598
|
+
},
|
|
39599
|
+
archivePath: {
|
|
39600
|
+
type: "string",
|
|
39601
|
+
description: "Alias for zipPath."
|
|
39602
|
+
},
|
|
39603
|
+
zipUrl: {
|
|
39604
|
+
type: "string",
|
|
39605
|
+
description: "Remote URL to a .zip avatar package."
|
|
39606
|
+
},
|
|
39607
|
+
source: {
|
|
39608
|
+
type: "string",
|
|
39609
|
+
description: "Local path or URL alias for the avatar package .zip."
|
|
39610
|
+
},
|
|
39611
|
+
displayName: {
|
|
39612
|
+
type: "string",
|
|
39613
|
+
description: "Optional display-name override for the uploaded bot avatar."
|
|
39614
|
+
},
|
|
39615
|
+
description: {
|
|
39616
|
+
type: "string",
|
|
39617
|
+
description: "Optional short description override for the uploaded bot avatar."
|
|
39618
|
+
},
|
|
39619
|
+
accountId: {
|
|
39620
|
+
type: "string",
|
|
39621
|
+
description: "Optional Inline account id override."
|
|
39622
|
+
}
|
|
39623
|
+
}
|
|
39624
|
+
};
|
|
39625
|
+
function readTrimmedString(value) {
|
|
39626
|
+
if (typeof value !== "string")
|
|
39627
|
+
return;
|
|
39628
|
+
const trimmed = value.trim();
|
|
39629
|
+
return trimmed || undefined;
|
|
39630
|
+
}
|
|
39631
|
+
function readVisibleString(value, label) {
|
|
39632
|
+
const raw = readTrimmedString(value);
|
|
39633
|
+
if (!raw)
|
|
39634
|
+
return;
|
|
39635
|
+
const visible = sanitizeInlineVisibleText(raw);
|
|
39636
|
+
if (visible.shouldSkip) {
|
|
39637
|
+
throw new Error(`inline_bot_avatar: ${label} contains internal runtime text`);
|
|
39638
|
+
}
|
|
39639
|
+
return readTrimmedString(visible.text);
|
|
39640
|
+
}
|
|
39641
|
+
function resolvePackageSource(args) {
|
|
39642
|
+
const source = readTrimmedString(args.zipPath) ?? readTrimmedString(args.archivePath) ?? readTrimmedString(args.zipUrl) ?? readTrimmedString(args.source);
|
|
39643
|
+
if (!source) {
|
|
39644
|
+
throw new Error("inline_bot_avatar: provide `zipPath` or `source`");
|
|
39645
|
+
}
|
|
39646
|
+
const sourceWithoutQuery = source.split(/[?#]/, 1)[0] ?? source;
|
|
39647
|
+
if (!sourceWithoutQuery.toLowerCase().endsWith(".zip")) {
|
|
39648
|
+
throw new Error("inline_bot_avatar: source must be a .zip package");
|
|
39649
|
+
}
|
|
39650
|
+
return source;
|
|
39651
|
+
}
|
|
39652
|
+
function sourceWithoutQuery(raw) {
|
|
39653
|
+
return raw.split(/[?#]/, 1)[0] ?? raw;
|
|
39654
|
+
}
|
|
39655
|
+
function localPathFromSource(source) {
|
|
39656
|
+
const trimmed = source.trim();
|
|
39657
|
+
if (!trimmed || /^https?:\/\//i.test(trimmed))
|
|
39658
|
+
return;
|
|
39659
|
+
if (trimmed.startsWith("file://")) {
|
|
39660
|
+
try {
|
|
39661
|
+
return fileURLToPath(trimmed);
|
|
39662
|
+
} catch {
|
|
39663
|
+
return;
|
|
39664
|
+
}
|
|
39665
|
+
}
|
|
39666
|
+
const withoutQuery = sourceWithoutQuery(trimmed);
|
|
39667
|
+
if (withoutQuery.startsWith("~/") || withoutQuery === "~") {
|
|
39668
|
+
return path.join(os.homedir(), withoutQuery.slice(2));
|
|
39669
|
+
}
|
|
39670
|
+
if (path.isAbsolute(withoutQuery))
|
|
39671
|
+
return withoutQuery;
|
|
39672
|
+
return;
|
|
39673
|
+
}
|
|
39674
|
+
function packageLoadOptions(source, ctx) {
|
|
39675
|
+
const options = {
|
|
39676
|
+
maxBytes: MAX_PACKAGE_BYTES,
|
|
39677
|
+
optimizeImages: false,
|
|
39678
|
+
...ctx.workspaceDir ? { workspaceDir: ctx.workspaceDir } : {}
|
|
39679
|
+
};
|
|
39680
|
+
const localPath = localPathFromSource(source);
|
|
39681
|
+
if (!localPath)
|
|
39682
|
+
return options;
|
|
39683
|
+
if (ctx.fsPolicy?.workspaceOnly === true) {
|
|
39684
|
+
if (ctx.workspaceDir)
|
|
39685
|
+
return { ...options, localRoots: [ctx.workspaceDir] };
|
|
39686
|
+
return options;
|
|
39687
|
+
}
|
|
39688
|
+
return {
|
|
39689
|
+
...options,
|
|
39690
|
+
localRoots: [path.dirname(localPath)]
|
|
39691
|
+
};
|
|
39692
|
+
}
|
|
39693
|
+
function sanitizeUploadFileName2(raw) {
|
|
39694
|
+
const normalized = raw.trim().replace(/\\/g, "/");
|
|
39695
|
+
const leaf = normalized.split("/").pop() ?? normalized;
|
|
39696
|
+
const safe = leaf.split(/[?#]/, 1)[0]?.trim();
|
|
39697
|
+
return safe || "bot-avatar.webp";
|
|
39698
|
+
}
|
|
39699
|
+
function normalizeZipName(raw) {
|
|
39700
|
+
const normalized = raw.replace(/\\/g, "/");
|
|
39701
|
+
const parts = normalized.split("/").filter((part) => part.length > 0);
|
|
39702
|
+
if (normalized.startsWith("/") || parts.some((part) => part === "." || part === "..")) {
|
|
39703
|
+
throw new Error(`inline_bot_avatar: invalid zip entry path "${raw}"`);
|
|
39704
|
+
}
|
|
39705
|
+
return parts.join("/");
|
|
39706
|
+
}
|
|
39707
|
+
function findEndOfCentralDirectory(data) {
|
|
39708
|
+
const minOffset = Math.max(0, data.length - 65535 - 22);
|
|
39709
|
+
for (let offset = data.length - 22;offset >= minOffset; offset -= 1) {
|
|
39710
|
+
if (data.readUInt32LE(offset) === ZIP_EOCD_SIGNATURE)
|
|
39711
|
+
return offset;
|
|
39712
|
+
}
|
|
39713
|
+
throw new Error("inline_bot_avatar: invalid zip package");
|
|
39714
|
+
}
|
|
39715
|
+
function readZipEntries(data) {
|
|
39716
|
+
const eocdOffset = findEndOfCentralDirectory(data);
|
|
39717
|
+
const totalEntries = data.readUInt16LE(eocdOffset + 10);
|
|
39718
|
+
const centralSize = data.readUInt32LE(eocdOffset + 12);
|
|
39719
|
+
const centralOffset = data.readUInt32LE(eocdOffset + 16);
|
|
39720
|
+
if (totalEntries === 65535 || centralSize === 4294967295 || centralOffset === 4294967295) {
|
|
39721
|
+
throw new Error("inline_bot_avatar: zip64 packages are not supported");
|
|
39722
|
+
}
|
|
39723
|
+
if (centralOffset + centralSize > data.length) {
|
|
39724
|
+
throw new Error("inline_bot_avatar: invalid zip central directory");
|
|
39725
|
+
}
|
|
39726
|
+
const entries = new Map;
|
|
39727
|
+
let offset = centralOffset;
|
|
39728
|
+
for (let index = 0;index < totalEntries; index += 1) {
|
|
39729
|
+
if (offset + 46 > data.length || data.readUInt32LE(offset) !== ZIP_CENTRAL_SIGNATURE) {
|
|
39730
|
+
throw new Error("inline_bot_avatar: invalid zip central directory entry");
|
|
39731
|
+
}
|
|
39732
|
+
const flags = data.readUInt16LE(offset + 8);
|
|
39733
|
+
const method = data.readUInt16LE(offset + 10);
|
|
39734
|
+
const compressedSize = data.readUInt32LE(offset + 20);
|
|
39735
|
+
const uncompressedSize = data.readUInt32LE(offset + 24);
|
|
39736
|
+
const fileNameLength = data.readUInt16LE(offset + 28);
|
|
39737
|
+
const extraLength = data.readUInt16LE(offset + 30);
|
|
39738
|
+
const commentLength = data.readUInt16LE(offset + 32);
|
|
39739
|
+
const localHeaderOffset = data.readUInt32LE(offset + 42);
|
|
39740
|
+
const fileNameStart = offset + 46;
|
|
39741
|
+
const fileNameEnd = fileNameStart + fileNameLength;
|
|
39742
|
+
if (fileNameEnd > data.length) {
|
|
39743
|
+
throw new Error("inline_bot_avatar: invalid zip file name");
|
|
39744
|
+
}
|
|
39745
|
+
const rawName = data.subarray(fileNameStart, fileNameEnd).toString("utf8");
|
|
39746
|
+
offset = fileNameEnd + extraLength + commentLength;
|
|
39747
|
+
if (!rawName || rawName.endsWith("/"))
|
|
39748
|
+
continue;
|
|
39749
|
+
const name = normalizeZipName(rawName);
|
|
39750
|
+
entries.set(name, {
|
|
39751
|
+
name,
|
|
39752
|
+
method,
|
|
39753
|
+
flags,
|
|
39754
|
+
compressedSize,
|
|
39755
|
+
uncompressedSize,
|
|
39756
|
+
localHeaderOffset
|
|
39757
|
+
});
|
|
39758
|
+
}
|
|
39759
|
+
return entries;
|
|
39760
|
+
}
|
|
39761
|
+
function readZipEntry(data, entry, maxBytes) {
|
|
39762
|
+
if ((entry.flags & ZIP_FLAG_ENCRYPTED) !== 0) {
|
|
39763
|
+
throw new Error(`inline_bot_avatar: encrypted zip entry is not supported (${entry.name})`);
|
|
39764
|
+
}
|
|
39765
|
+
if (entry.uncompressedSize > maxBytes) {
|
|
39766
|
+
throw new Error(`inline_bot_avatar: zip entry is too large (${entry.name})`);
|
|
39767
|
+
}
|
|
39768
|
+
if (entry.localHeaderOffset + 30 > data.length || data.readUInt32LE(entry.localHeaderOffset) !== ZIP_LOCAL_SIGNATURE) {
|
|
39769
|
+
throw new Error(`inline_bot_avatar: invalid zip local header (${entry.name})`);
|
|
39770
|
+
}
|
|
39771
|
+
const nameLength = data.readUInt16LE(entry.localHeaderOffset + 26);
|
|
39772
|
+
const extraLength = data.readUInt16LE(entry.localHeaderOffset + 28);
|
|
39773
|
+
const dataStart = entry.localHeaderOffset + 30 + nameLength + extraLength;
|
|
39774
|
+
const dataEnd = dataStart + entry.compressedSize;
|
|
39775
|
+
if (dataEnd > data.length) {
|
|
39776
|
+
throw new Error(`inline_bot_avatar: invalid zip entry data (${entry.name})`);
|
|
39777
|
+
}
|
|
39778
|
+
const compressed = data.subarray(dataStart, dataEnd);
|
|
39779
|
+
let bytes;
|
|
39780
|
+
try {
|
|
39781
|
+
bytes = entry.method === ZIP_METHOD_STORE ? Buffer.from(compressed) : entry.method === ZIP_METHOD_DEFLATE ? inflateRawSync(compressed, { maxOutputLength: maxBytes + 1 }) : undefined;
|
|
39782
|
+
} catch (error51) {
|
|
39783
|
+
throw new Error(`inline_bot_avatar: invalid or oversized zip entry (${entry.name})`, {
|
|
39784
|
+
cause: error51
|
|
39785
|
+
});
|
|
39786
|
+
}
|
|
39787
|
+
if (!bytes) {
|
|
39788
|
+
throw new Error(`inline_bot_avatar: unsupported zip compression (${entry.name})`);
|
|
39789
|
+
}
|
|
39790
|
+
if (bytes.length !== entry.uncompressedSize || bytes.length > maxBytes) {
|
|
39791
|
+
throw new Error(`inline_bot_avatar: invalid zip entry size (${entry.name})`);
|
|
39792
|
+
}
|
|
39793
|
+
return bytes;
|
|
39794
|
+
}
|
|
39795
|
+
function findPackageManifest(entries) {
|
|
39796
|
+
const root = entries.get("pet.json");
|
|
39797
|
+
if (root)
|
|
39798
|
+
return root;
|
|
39799
|
+
for (const entry of entries.values()) {
|
|
39800
|
+
if (entry.name.endsWith("/pet.json"))
|
|
39801
|
+
return entry;
|
|
39802
|
+
}
|
|
39803
|
+
throw new Error("inline_bot_avatar: package is missing avatar manifest");
|
|
39804
|
+
}
|
|
39805
|
+
function resolveRelativeZipPath(baseEntryName, rawPath) {
|
|
39806
|
+
const baseDir = baseEntryName.includes("/") ? baseEntryName.slice(0, baseEntryName.lastIndexOf("/")) : "";
|
|
39807
|
+
return normalizeZipName(path.posix.normalize(path.posix.join(baseDir, rawPath)));
|
|
39808
|
+
}
|
|
39809
|
+
function parsePackageManifest(data) {
|
|
39810
|
+
try {
|
|
39811
|
+
const parsed = JSON.parse(data.toString("utf8"));
|
|
39812
|
+
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
39813
|
+
return parsed;
|
|
39814
|
+
}
|
|
39815
|
+
} catch {}
|
|
39816
|
+
throw new Error("inline_bot_avatar: invalid avatar manifest");
|
|
39817
|
+
}
|
|
39818
|
+
function contentTypeForSprite(fileName) {
|
|
39819
|
+
const ext = path.extname(fileName).toLowerCase();
|
|
39820
|
+
if (ext === ".png")
|
|
39821
|
+
return "image/png";
|
|
39822
|
+
if (ext === ".webp")
|
|
39823
|
+
return "image/webp";
|
|
39824
|
+
throw new Error("inline_bot_avatar: spritesheet must be PNG or WebP");
|
|
39825
|
+
}
|
|
39826
|
+
function extractAvatarPackage(params) {
|
|
39827
|
+
const entries = readZipEntries(params.data);
|
|
39828
|
+
const manifestEntry = findPackageManifest(entries);
|
|
39829
|
+
const manifest = parsePackageManifest(readZipEntry(params.data, manifestEntry, MAX_MANIFEST_BYTES));
|
|
39830
|
+
const rawSpritesheetPath = readTrimmedString(manifest.spritesheetPath);
|
|
39831
|
+
if (!rawSpritesheetPath) {
|
|
39832
|
+
throw new Error("inline_bot_avatar: avatar manifest is missing spritesheetPath");
|
|
39833
|
+
}
|
|
39834
|
+
const spritesheetPath = resolveRelativeZipPath(manifestEntry.name, rawSpritesheetPath);
|
|
39835
|
+
const spriteEntry = entries.get(spritesheetPath);
|
|
39836
|
+
if (!spriteEntry) {
|
|
39837
|
+
throw new Error(`inline_bot_avatar: package is missing spritesheet ${rawSpritesheetPath}`);
|
|
39838
|
+
}
|
|
39839
|
+
const id = readTrimmedString(manifest.id);
|
|
39840
|
+
const fallbackName = sanitizeUploadFileName2(params.source).replace(/\.zip$/i, "");
|
|
39841
|
+
const displayName = params.displayName ?? readVisibleString(manifest.displayName, "displayName") ?? id ?? fallbackName;
|
|
39842
|
+
const description = params.description ?? readVisibleString(manifest.description, "description");
|
|
39843
|
+
const fileName = sanitizeUploadFileName2(spritesheetPath);
|
|
39844
|
+
return {
|
|
39845
|
+
...id ? { id } : {},
|
|
39846
|
+
displayName,
|
|
39847
|
+
...description ? { description } : {},
|
|
39848
|
+
spritesheetPath,
|
|
39849
|
+
spritesheet: readZipEntry(params.data, spriteEntry, MAX_PACKAGE_BYTES),
|
|
39850
|
+
contentType: contentTypeForSprite(fileName),
|
|
39851
|
+
fileName
|
|
39852
|
+
};
|
|
39853
|
+
}
|
|
39854
|
+
async function loadPackage(source, ctx) {
|
|
39855
|
+
return await getInlineRuntime().media.loadWebMedia(source, packageLoadOptions(source, ctx));
|
|
39856
|
+
}
|
|
39857
|
+
async function withInlineClient4(params) {
|
|
39858
|
+
const account = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId ?? null });
|
|
39859
|
+
if (!account.configured || !account.baseUrl) {
|
|
39860
|
+
throw new Error(`Inline not configured for account "${account.accountId}" (missing token or baseUrl)`);
|
|
39861
|
+
}
|
|
39862
|
+
const token = await resolveInlineToken(account);
|
|
39863
|
+
const client = new InlineSdkClient({
|
|
39864
|
+
baseUrl: account.baseUrl,
|
|
39865
|
+
token
|
|
39866
|
+
});
|
|
39867
|
+
await client.connect();
|
|
39868
|
+
try {
|
|
39869
|
+
return await params.fn(client, account.accountId);
|
|
39870
|
+
} finally {
|
|
39871
|
+
await client.close().catch(() => {});
|
|
39872
|
+
}
|
|
39873
|
+
}
|
|
39874
|
+
function createInlineBotAvatarTool(ctx) {
|
|
39875
|
+
if (!ctx.config)
|
|
39876
|
+
return null;
|
|
39877
|
+
return {
|
|
39878
|
+
name: "inline_bot_avatar",
|
|
39879
|
+
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.",
|
|
39881
|
+
parameters: InlineBotAvatarToolParameters,
|
|
39882
|
+
execute: async (_toolCallId, rawArgs) => {
|
|
39883
|
+
const args = rawArgs;
|
|
39884
|
+
const source = resolvePackageSource(args);
|
|
39885
|
+
const displayName = readVisibleString(args.displayName, "displayName");
|
|
39886
|
+
const description = readVisibleString(args.description, "description");
|
|
39887
|
+
const loaded = await loadPackage(source, ctx);
|
|
39888
|
+
const avatarPackage = extractAvatarPackage({
|
|
39889
|
+
data: Buffer.from(loaded.buffer),
|
|
39890
|
+
source,
|
|
39891
|
+
...displayName ? { displayName } : {},
|
|
39892
|
+
...description ? { description } : {}
|
|
39893
|
+
});
|
|
39894
|
+
return await withInlineClient4({
|
|
39895
|
+
cfg: ctx.config,
|
|
39896
|
+
accountId: args.accountId ?? ctx.agentAccountId ?? null,
|
|
39897
|
+
fn: async (client, resolvedAccountId) => {
|
|
39898
|
+
const me = await client.getMe();
|
|
39899
|
+
const uploaded = await client.uploadFile({
|
|
39900
|
+
type: "photo",
|
|
39901
|
+
file: avatarPackage.spritesheet,
|
|
39902
|
+
fileName: avatarPackage.fileName,
|
|
39903
|
+
contentType: avatarPackage.contentType
|
|
39904
|
+
});
|
|
39905
|
+
if (!uploaded.fileUniqueId) {
|
|
39906
|
+
throw new Error("inline_bot_avatar: upload did not return fileUniqueId");
|
|
39907
|
+
}
|
|
39908
|
+
const result = await client.invokeRaw(Method.SET_BOT_AVATAR, {
|
|
39909
|
+
oneofKind: "setBotAvatar",
|
|
39910
|
+
setBotAvatar: {
|
|
39911
|
+
botUserId: me.userId,
|
|
39912
|
+
kind: BotAvatar_Kind.CODEX_ATLAS,
|
|
39913
|
+
displayName: avatarPackage.displayName,
|
|
39914
|
+
...avatarPackage.description ? { description: avatarPackage.description } : {},
|
|
39915
|
+
fileUniqueId: uploaded.fileUniqueId
|
|
39916
|
+
}
|
|
39917
|
+
});
|
|
39918
|
+
if (result.oneofKind !== "setBotAvatar") {
|
|
39919
|
+
throw new Error(`inline_bot_avatar: expected setBotAvatar result, got ${String(result.oneofKind)}`);
|
|
39920
|
+
}
|
|
39921
|
+
return jsonResult({
|
|
39922
|
+
ok: true,
|
|
39923
|
+
accountId: resolvedAccountId,
|
|
39924
|
+
botUserId: String(me.userId),
|
|
39925
|
+
avatar: {
|
|
39926
|
+
kind: CODEX_ATLAS_KIND,
|
|
39927
|
+
...avatarPackage.id ? { id: avatarPackage.id } : {},
|
|
39928
|
+
displayName: avatarPackage.displayName,
|
|
39929
|
+
...avatarPackage.description ? { description: avatarPackage.description } : {},
|
|
39930
|
+
spritesheetPath: avatarPackage.spritesheetPath
|
|
39931
|
+
},
|
|
39932
|
+
uploaded: {
|
|
39933
|
+
fileUniqueId: uploaded.fileUniqueId,
|
|
39934
|
+
fileName: avatarPackage.fileName,
|
|
39935
|
+
contentType: avatarPackage.contentType
|
|
39936
|
+
},
|
|
39937
|
+
bot: result.setBotAvatar.bot ?? null
|
|
39938
|
+
});
|
|
39939
|
+
}
|
|
39940
|
+
});
|
|
39941
|
+
}
|
|
39942
|
+
};
|
|
39943
|
+
}
|
|
39944
|
+
|
|
38494
39945
|
// src/inline/profile-tool.ts
|
|
38495
39946
|
var InlineProfileToolParameters = {
|
|
38496
39947
|
type: "object",
|
|
@@ -38529,7 +39980,7 @@ function jsonResult3(payload) {
|
|
|
38529
39980
|
details: payload
|
|
38530
39981
|
};
|
|
38531
39982
|
}
|
|
38532
|
-
async function
|
|
39983
|
+
async function withInlineClient5(params) {
|
|
38533
39984
|
const account = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId ?? null });
|
|
38534
39985
|
if (!account.configured || !account.baseUrl) {
|
|
38535
39986
|
throw new Error(`Inline not configured for account "${account.accountId}" (missing token or baseUrl)`);
|
|
@@ -38546,14 +39997,14 @@ async function withInlineClient4(params) {
|
|
|
38546
39997
|
await client.close().catch(() => {});
|
|
38547
39998
|
}
|
|
38548
39999
|
}
|
|
38549
|
-
function
|
|
40000
|
+
function readTrimmedString2(value) {
|
|
38550
40001
|
if (typeof value !== "string")
|
|
38551
40002
|
return;
|
|
38552
40003
|
const trimmed = value.trim();
|
|
38553
40004
|
return trimmed || undefined;
|
|
38554
40005
|
}
|
|
38555
40006
|
function resolvePhotoSource(args) {
|
|
38556
|
-
return
|
|
40007
|
+
return readTrimmedString2(args.photoPath) ?? readTrimmedString2(args.photoUrl);
|
|
38557
40008
|
}
|
|
38558
40009
|
async function uploadProfilePhoto(client, rawSource) {
|
|
38559
40010
|
const runtimeMedia = getInlineRuntime().media;
|
|
@@ -38585,18 +40036,18 @@ function createInlineProfileTool(ctx) {
|
|
|
38585
40036
|
parameters: InlineProfileToolParameters,
|
|
38586
40037
|
execute: async (_toolCallId, rawArgs) => {
|
|
38587
40038
|
const args = rawArgs;
|
|
38588
|
-
const rawName =
|
|
40039
|
+
const rawName = readTrimmedString2(args.name);
|
|
38589
40040
|
const visibleName = sanitizeInlineVisibleText(rawName);
|
|
38590
40041
|
if (visibleName.shouldSkip) {
|
|
38591
40042
|
throw new Error("inline_update_profile: name contains internal runtime text");
|
|
38592
40043
|
}
|
|
38593
|
-
const name =
|
|
38594
|
-
const existingPhotoFileUniqueId =
|
|
40044
|
+
const name = readTrimmedString2(visibleName.text);
|
|
40045
|
+
const existingPhotoFileUniqueId = readTrimmedString2(args.photoFileUniqueId);
|
|
38595
40046
|
const photoSource = resolvePhotoSource(args);
|
|
38596
40047
|
if (!name && !existingPhotoFileUniqueId && !photoSource) {
|
|
38597
40048
|
throw new Error("inline_update_profile: provide `name` and/or `photo`");
|
|
38598
40049
|
}
|
|
38599
|
-
return await
|
|
40050
|
+
return await withInlineClient5({
|
|
38600
40051
|
cfg: ctx.config,
|
|
38601
40052
|
accountId: args.accountId ?? ctx.agentAccountId ?? null,
|
|
38602
40053
|
fn: async (client, resolvedAccountId) => {
|
|
@@ -38867,148 +40318,6 @@ import { listNativeCommandSpecsForConfig } from "openclaw/plugin-sdk/native-comm
|
|
|
38867
40318
|
import { getPluginCommandSpecs } from "openclaw/plugin-sdk/plugin-runtime";
|
|
38868
40319
|
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
38869
40320
|
import { listSkillCommandsForAgents } from "openclaw/plugin-sdk/skill-commands-runtime";
|
|
38870
|
-
var INLINE_COMMAND_NAME_RE = /^[a-z0-9_]{1,32}$/;
|
|
38871
|
-
var INLINE_COMMAND_LIMIT = 100;
|
|
38872
|
-
var INLINE_COMMAND_DESCRIPTION_LIMIT = 256;
|
|
38873
|
-
var INLINE_NATIVE_COMMAND_PROVIDER = "inline";
|
|
38874
|
-
function normalizeDynamicCommandName(raw) {
|
|
38875
|
-
const trimmed = raw.trim().toLowerCase();
|
|
38876
|
-
const withoutSlash = trimmed.startsWith("/") ? trimmed.slice(1) : trimmed;
|
|
38877
|
-
return withoutSlash.trim();
|
|
38878
|
-
}
|
|
38879
|
-
function appendUniqueCommand(out, seen, command, description, logger) {
|
|
38880
|
-
const normalized = normalizeDynamicCommandName(command);
|
|
38881
|
-
if (!INLINE_COMMAND_NAME_RE.test(normalized) || seen.has(normalized))
|
|
38882
|
-
return;
|
|
38883
|
-
const rawDescription = adaptInlineVisibleCopy(description).trim();
|
|
38884
|
-
const trimmedDescription = rawDescription.length > INLINE_COMMAND_DESCRIPTION_LIMIT ? rawDescription.slice(0, INLINE_COMMAND_DESCRIPTION_LIMIT).trimEnd() : rawDescription;
|
|
38885
|
-
if (!trimmedDescription)
|
|
38886
|
-
return;
|
|
38887
|
-
if (trimmedDescription.length !== rawDescription.length) {
|
|
38888
|
-
logger?.warn?.(`[inline] bot command sync truncated description for /${normalized} to ${INLINE_COMMAND_DESCRIPTION_LIMIT} characters`);
|
|
38889
|
-
}
|
|
38890
|
-
seen.add(normalized);
|
|
38891
|
-
out.push({ command: normalized, description: trimmedDescription });
|
|
38892
|
-
}
|
|
38893
|
-
function shouldSyncInlineNativeCommandsForAccount(params) {
|
|
38894
|
-
const effective = params.account.config.commands?.native ?? params.cfg.commands?.native ?? "auto";
|
|
38895
|
-
return effective !== false;
|
|
38896
|
-
}
|
|
38897
|
-
function shouldSyncInlineNativeSkillsForAccount(params) {
|
|
38898
|
-
const effective = params.account.config.commands?.nativeSkills ?? params.cfg.commands?.nativeSkills ?? "auto";
|
|
38899
|
-
return effective !== false;
|
|
38900
|
-
}
|
|
38901
|
-
async function buildInlineNativeCommandsForConfig(params) {
|
|
38902
|
-
const route = shouldSyncInlineNativeSkillsForAccount({ cfg: params.cfg, account: params.account }) ? resolveAgentRoute({
|
|
38903
|
-
cfg: params.cfg,
|
|
38904
|
-
channel: INLINE_NATIVE_COMMAND_PROVIDER,
|
|
38905
|
-
accountId: params.account.accountId
|
|
38906
|
-
}) : null;
|
|
38907
|
-
const skillCommands = route ? listSkillCommandsForAgents({
|
|
38908
|
-
cfg: params.cfg,
|
|
38909
|
-
agentIds: [route.agentId]
|
|
38910
|
-
}) : [];
|
|
38911
|
-
const nativeSpecs = listNativeCommandSpecsForConfig(params.cfg, {
|
|
38912
|
-
skillCommands,
|
|
38913
|
-
provider: INLINE_NATIVE_COMMAND_PROVIDER
|
|
38914
|
-
});
|
|
38915
|
-
const pluginSpecs = getPluginCommandSpecs("inline", { config: params.cfg });
|
|
38916
|
-
const seen = new Set;
|
|
38917
|
-
const resolved = [];
|
|
38918
|
-
for (const spec of nativeSpecs) {
|
|
38919
|
-
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
38920
|
-
}
|
|
38921
|
-
for (const spec of pluginSpecs) {
|
|
38922
|
-
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
38923
|
-
}
|
|
38924
|
-
return resolved;
|
|
38925
|
-
}
|
|
38926
|
-
async function syncInlineNativeCommands(params) {
|
|
38927
|
-
const accountIds = listInlineAccountIds(params.cfg);
|
|
38928
|
-
if (!accountIds.length) {
|
|
38929
|
-
params.logger?.info?.("[inline] bot command sync disabled");
|
|
38930
|
-
return { attempted: 0, synced: 0, failed: 0 };
|
|
38931
|
-
}
|
|
38932
|
-
let attempted = 0;
|
|
38933
|
-
let synced = 0;
|
|
38934
|
-
let failed = 0;
|
|
38935
|
-
for (const accountId of accountIds) {
|
|
38936
|
-
const account = resolveInlineAccount({ cfg: params.cfg, accountId });
|
|
38937
|
-
const nativeEnabled = shouldSyncInlineNativeCommandsForAccount({ cfg: params.cfg, account });
|
|
38938
|
-
attempted += 1;
|
|
38939
|
-
if (!account.enabled || !account.configured || !account.baseUrl) {
|
|
38940
|
-
continue;
|
|
38941
|
-
}
|
|
38942
|
-
const ownerAccountId = findInlineTokenOwnerAccountId({
|
|
38943
|
-
cfg: params.cfg,
|
|
38944
|
-
accountId: account.accountId
|
|
38945
|
-
});
|
|
38946
|
-
if (ownerAccountId) {
|
|
38947
|
-
failed += 1;
|
|
38948
|
-
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${formatDuplicateInlineTokenReason({
|
|
38949
|
-
accountId: account.accountId,
|
|
38950
|
-
ownerAccountId
|
|
38951
|
-
})}`);
|
|
38952
|
-
continue;
|
|
38953
|
-
}
|
|
38954
|
-
let token;
|
|
38955
|
-
try {
|
|
38956
|
-
token = await resolveInlineToken(account);
|
|
38957
|
-
} catch (err) {
|
|
38958
|
-
failed += 1;
|
|
38959
|
-
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${String(err)}`);
|
|
38960
|
-
continue;
|
|
38961
|
-
}
|
|
38962
|
-
if (!nativeEnabled) {
|
|
38963
|
-
try {
|
|
38964
|
-
await callInlineBotApi({
|
|
38965
|
-
baseUrl: account.baseUrl,
|
|
38966
|
-
token,
|
|
38967
|
-
methodName: "deleteMyCommands",
|
|
38968
|
-
method: "POST"
|
|
38969
|
-
});
|
|
38970
|
-
synced += 1;
|
|
38971
|
-
params.logger?.info?.(`[inline] bot commands cleared for account "${account.accountId}"`);
|
|
38972
|
-
} catch (err) {
|
|
38973
|
-
failed += 1;
|
|
38974
|
-
params.logger?.warn?.(`[inline] bot command clear failed for account "${account.accountId}": ${String(err)}`);
|
|
38975
|
-
}
|
|
38976
|
-
continue;
|
|
38977
|
-
}
|
|
38978
|
-
const allCommands = await buildInlineNativeCommandsForConfig({
|
|
38979
|
-
cfg: params.cfg,
|
|
38980
|
-
account,
|
|
38981
|
-
...params.logger ? { logger: params.logger } : {}
|
|
38982
|
-
});
|
|
38983
|
-
const commands = allCommands.slice(0, INLINE_COMMAND_LIMIT);
|
|
38984
|
-
if (allCommands.length > INLINE_COMMAND_LIMIT) {
|
|
38985
|
-
params.logger?.warn?.(`[inline] bot command sync truncating ${allCommands.length} commands to ${INLINE_COMMAND_LIMIT}`);
|
|
38986
|
-
}
|
|
38987
|
-
if (commands.length === 0) {
|
|
38988
|
-
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": no valid commands resolved`);
|
|
38989
|
-
continue;
|
|
38990
|
-
}
|
|
38991
|
-
try {
|
|
38992
|
-
await callInlineBotApi({
|
|
38993
|
-
baseUrl: account.baseUrl,
|
|
38994
|
-
token,
|
|
38995
|
-
methodName: "setMyCommands",
|
|
38996
|
-
method: "POST",
|
|
38997
|
-
body: { commands }
|
|
38998
|
-
});
|
|
38999
|
-
synced += 1;
|
|
39000
|
-
params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${commands.length} command${commands.length === 1 ? "" : "s"})`);
|
|
39001
|
-
} catch (err) {
|
|
39002
|
-
failed += 1;
|
|
39003
|
-
params.logger?.warn?.(`[inline] bot command sync failed for account "${account.accountId}": ${String(err)}`);
|
|
39004
|
-
}
|
|
39005
|
-
}
|
|
39006
|
-
return {
|
|
39007
|
-
attempted,
|
|
39008
|
-
synced,
|
|
39009
|
-
failed
|
|
39010
|
-
};
|
|
39011
|
-
}
|
|
39012
40321
|
|
|
39013
40322
|
// src/inline/policy.ts
|
|
39014
40323
|
function normalizeAccountId2(raw) {
|
|
@@ -39188,6 +40497,23 @@ var MODE_LABELS = {
|
|
|
39188
40497
|
main: "main"
|
|
39189
40498
|
};
|
|
39190
40499
|
var DEFAULT_REPLY_THREAD_AUTO_CREATE_MIN_MESSAGES = 50;
|
|
40500
|
+
var INLINE_THREADREPLY_NATIVE_NAME = "threadreply";
|
|
40501
|
+
var INLINE_THREADREPLY_COMMAND_SPEC = {
|
|
40502
|
+
name: "threadreply",
|
|
40503
|
+
nativeNames: { inline: INLINE_THREADREPLY_NATIVE_NAME },
|
|
40504
|
+
description: "Set Inline reply-thread mode for this chat.",
|
|
40505
|
+
channels: ["inline"],
|
|
40506
|
+
acceptsArgs: true
|
|
40507
|
+
};
|
|
40508
|
+
function listInlineBuiltinCommandSpecs() {
|
|
40509
|
+
return [
|
|
40510
|
+
{
|
|
40511
|
+
name: INLINE_THREADREPLY_COMMAND_SPEC.nativeNames.inline ?? INLINE_THREADREPLY_COMMAND_SPEC.name,
|
|
40512
|
+
description: INLINE_THREADREPLY_COMMAND_SPEC.description,
|
|
40513
|
+
acceptsArgs: INLINE_THREADREPLY_COMMAND_SPEC.acceptsArgs
|
|
40514
|
+
}
|
|
40515
|
+
];
|
|
40516
|
+
}
|
|
39191
40517
|
function isRecord3(value) {
|
|
39192
40518
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39193
40519
|
}
|
|
@@ -39385,6 +40711,9 @@ function normalizeAction(args) {
|
|
|
39385
40711
|
return normalizeMode(normalized);
|
|
39386
40712
|
}
|
|
39387
40713
|
async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
40714
|
+
return await handleInlineThreadReplyCommandWithConfigRuntime(api2.runtime.config, ctx);
|
|
40715
|
+
}
|
|
40716
|
+
async function handleInlineThreadReplyCommandWithConfigRuntime(configRuntime, ctx) {
|
|
39388
40717
|
if (!ctx.isAuthorizedSender) {
|
|
39389
40718
|
return { text: "This command requires authorization." };
|
|
39390
40719
|
}
|
|
@@ -39392,7 +40721,7 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39392
40721
|
if (!groupId) {
|
|
39393
40722
|
return { text: "/threadreply is only available in Inline group chats." };
|
|
39394
40723
|
}
|
|
39395
|
-
const currentConfig =
|
|
40724
|
+
const currentConfig = configRuntime.current();
|
|
39396
40725
|
const args = ctx.args?.trim() ?? "";
|
|
39397
40726
|
const [first = "", second, ...rest] = args.split(/\s+/).filter(Boolean);
|
|
39398
40727
|
if (["min", "minimum", "threshold", "limit"].includes(first.trim().toLowerCase())) {
|
|
@@ -39400,7 +40729,7 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39400
40729
|
if (minMessages == null || rest.length > 0) {
|
|
39401
40730
|
return { text: "Usage: /threadreply min <0-or-greater>|inherit" };
|
|
39402
40731
|
}
|
|
39403
|
-
const committed2 = await
|
|
40732
|
+
const committed2 = await configRuntime.mutateConfigFile({
|
|
39404
40733
|
afterWrite: { mode: "auto" },
|
|
39405
40734
|
mutate: (draft) => {
|
|
39406
40735
|
setGroupMinMessages({
|
|
@@ -39455,7 +40784,7 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39455
40784
|
`)
|
|
39456
40785
|
};
|
|
39457
40786
|
}
|
|
39458
|
-
const committed = await
|
|
40787
|
+
const committed = await configRuntime.mutateConfigFile({
|
|
39459
40788
|
afterWrite: { mode: "auto" },
|
|
39460
40789
|
mutate: (draft) => {
|
|
39461
40790
|
setGroupMode({
|
|
@@ -39477,15 +40806,165 @@ async function handleInlineThreadReplyCommand(api2, ctx) {
|
|
|
39477
40806
|
}
|
|
39478
40807
|
function createInlineThreadReplyCommand(api2) {
|
|
39479
40808
|
return {
|
|
39480
|
-
|
|
39481
|
-
nativeNames: { inline: "threadreply" },
|
|
39482
|
-
description: "Set Inline reply-thread mode for this chat.",
|
|
39483
|
-
channels: ["inline"],
|
|
39484
|
-
acceptsArgs: true,
|
|
40809
|
+
...INLINE_THREADREPLY_COMMAND_SPEC,
|
|
39485
40810
|
handler: async (ctx) => await handleInlineThreadReplyCommand(api2, ctx)
|
|
39486
40811
|
};
|
|
39487
40812
|
}
|
|
39488
40813
|
|
|
40814
|
+
// src/inline/bot-commands-sync.ts
|
|
40815
|
+
var INLINE_COMMAND_NAME_RE = /^[a-z0-9_]{1,32}$/;
|
|
40816
|
+
var INLINE_COMMAND_LIMIT = 100;
|
|
40817
|
+
var INLINE_COMMAND_DESCRIPTION_LIMIT = 256;
|
|
40818
|
+
var INLINE_NATIVE_COMMAND_PROVIDER = "inline";
|
|
40819
|
+
function resolveInlineChannelCommands(cfg) {
|
|
40820
|
+
const inline = cfg.channels?.inline;
|
|
40821
|
+
if (typeof inline !== "object" || inline === null || Array.isArray(inline))
|
|
40822
|
+
return;
|
|
40823
|
+
const commands = inline.commands;
|
|
40824
|
+
return typeof commands === "object" && commands !== null && !Array.isArray(commands) ? commands : undefined;
|
|
40825
|
+
}
|
|
40826
|
+
function normalizeDynamicCommandName(raw) {
|
|
40827
|
+
const trimmed = raw.trim().toLowerCase();
|
|
40828
|
+
const withoutSlash = trimmed.startsWith("/") ? trimmed.slice(1) : trimmed;
|
|
40829
|
+
return withoutSlash.trim();
|
|
40830
|
+
}
|
|
40831
|
+
function appendUniqueCommand(out, seen, command, description, logger) {
|
|
40832
|
+
const normalized = normalizeDynamicCommandName(command);
|
|
40833
|
+
if (!INLINE_COMMAND_NAME_RE.test(normalized) || seen.has(normalized))
|
|
40834
|
+
return;
|
|
40835
|
+
const rawDescription = adaptInlineVisibleCopy(description).trim();
|
|
40836
|
+
const trimmedDescription = rawDescription.length > INLINE_COMMAND_DESCRIPTION_LIMIT ? rawDescription.slice(0, INLINE_COMMAND_DESCRIPTION_LIMIT).trimEnd() : rawDescription;
|
|
40837
|
+
if (!trimmedDescription)
|
|
40838
|
+
return;
|
|
40839
|
+
if (trimmedDescription.length !== rawDescription.length) {
|
|
40840
|
+
logger?.warn?.(`[inline] bot command sync truncated description for /${normalized} to ${INLINE_COMMAND_DESCRIPTION_LIMIT} characters`);
|
|
40841
|
+
}
|
|
40842
|
+
seen.add(normalized);
|
|
40843
|
+
out.push({ command: normalized, description: trimmedDescription });
|
|
40844
|
+
}
|
|
40845
|
+
function shouldSyncInlineNativeCommandsForAccount(params) {
|
|
40846
|
+
const effective = params.account.config.commands?.native ?? resolveInlineChannelCommands(params.cfg)?.native ?? params.cfg.commands?.native ?? "auto";
|
|
40847
|
+
return effective !== false;
|
|
40848
|
+
}
|
|
40849
|
+
function shouldSyncInlineNativeSkillsForAccount(params) {
|
|
40850
|
+
const effective = params.account.config.commands?.nativeSkills ?? resolveInlineChannelCommands(params.cfg)?.nativeSkills ?? params.cfg.commands?.nativeSkills ?? "auto";
|
|
40851
|
+
return effective !== false;
|
|
40852
|
+
}
|
|
40853
|
+
async function buildInlineNativeCommandsForConfig(params) {
|
|
40854
|
+
const route = shouldSyncInlineNativeSkillsForAccount({ cfg: params.cfg, account: params.account }) ? resolveAgentRoute({
|
|
40855
|
+
cfg: params.cfg,
|
|
40856
|
+
channel: INLINE_NATIVE_COMMAND_PROVIDER,
|
|
40857
|
+
accountId: params.account.accountId
|
|
40858
|
+
}) : null;
|
|
40859
|
+
const skillCommands = route ? listSkillCommandsForAgents({
|
|
40860
|
+
cfg: params.cfg,
|
|
40861
|
+
agentIds: [route.agentId]
|
|
40862
|
+
}) : [];
|
|
40863
|
+
const nativeSpecs = listNativeCommandSpecsForConfig(params.cfg, {
|
|
40864
|
+
skillCommands,
|
|
40865
|
+
provider: INLINE_NATIVE_COMMAND_PROVIDER
|
|
40866
|
+
});
|
|
40867
|
+
const pluginSpecs = [
|
|
40868
|
+
...getPluginCommandSpecs("inline", { config: params.cfg }),
|
|
40869
|
+
...listInlineBuiltinCommandSpecs()
|
|
40870
|
+
];
|
|
40871
|
+
const seen = new Set;
|
|
40872
|
+
const resolved = [];
|
|
40873
|
+
for (const spec of nativeSpecs) {
|
|
40874
|
+
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
40875
|
+
}
|
|
40876
|
+
for (const spec of pluginSpecs) {
|
|
40877
|
+
appendUniqueCommand(resolved, seen, spec.name, spec.description, params.logger);
|
|
40878
|
+
}
|
|
40879
|
+
return resolved;
|
|
40880
|
+
}
|
|
40881
|
+
async function syncInlineNativeCommands(params) {
|
|
40882
|
+
const accountIds = listInlineAccountIds(params.cfg);
|
|
40883
|
+
if (!accountIds.length) {
|
|
40884
|
+
params.logger?.info?.("[inline] bot command sync disabled");
|
|
40885
|
+
return { attempted: 0, synced: 0, failed: 0 };
|
|
40886
|
+
}
|
|
40887
|
+
let attempted = 0;
|
|
40888
|
+
let synced = 0;
|
|
40889
|
+
let failed = 0;
|
|
40890
|
+
for (const accountId of accountIds) {
|
|
40891
|
+
const account = resolveInlineAccount({ cfg: params.cfg, accountId });
|
|
40892
|
+
const nativeEnabled = shouldSyncInlineNativeCommandsForAccount({ cfg: params.cfg, account });
|
|
40893
|
+
attempted += 1;
|
|
40894
|
+
if (!account.enabled || !account.configured || !account.baseUrl) {
|
|
40895
|
+
continue;
|
|
40896
|
+
}
|
|
40897
|
+
const ownerAccountId = findInlineTokenOwnerAccountId({
|
|
40898
|
+
cfg: params.cfg,
|
|
40899
|
+
accountId: account.accountId
|
|
40900
|
+
});
|
|
40901
|
+
if (ownerAccountId) {
|
|
40902
|
+
failed += 1;
|
|
40903
|
+
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${formatDuplicateInlineTokenReason({
|
|
40904
|
+
accountId: account.accountId,
|
|
40905
|
+
ownerAccountId
|
|
40906
|
+
})}`);
|
|
40907
|
+
continue;
|
|
40908
|
+
}
|
|
40909
|
+
let token;
|
|
40910
|
+
try {
|
|
40911
|
+
token = await resolveInlineToken(account);
|
|
40912
|
+
} catch (err) {
|
|
40913
|
+
failed += 1;
|
|
40914
|
+
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": ${String(err)}`);
|
|
40915
|
+
continue;
|
|
40916
|
+
}
|
|
40917
|
+
if (!nativeEnabled) {
|
|
40918
|
+
try {
|
|
40919
|
+
await callInlineBotApi({
|
|
40920
|
+
baseUrl: account.baseUrl,
|
|
40921
|
+
token,
|
|
40922
|
+
methodName: "deleteMyCommands",
|
|
40923
|
+
method: "POST"
|
|
40924
|
+
});
|
|
40925
|
+
synced += 1;
|
|
40926
|
+
params.logger?.info?.(`[inline] bot commands cleared for account "${account.accountId}"`);
|
|
40927
|
+
} catch (err) {
|
|
40928
|
+
failed += 1;
|
|
40929
|
+
params.logger?.warn?.(`[inline] bot command clear failed for account "${account.accountId}": ${String(err)}`);
|
|
40930
|
+
}
|
|
40931
|
+
continue;
|
|
40932
|
+
}
|
|
40933
|
+
const allCommands = await buildInlineNativeCommandsForConfig({
|
|
40934
|
+
cfg: params.cfg,
|
|
40935
|
+
account,
|
|
40936
|
+
...params.logger ? { logger: params.logger } : {}
|
|
40937
|
+
});
|
|
40938
|
+
const commands = allCommands.slice(0, INLINE_COMMAND_LIMIT);
|
|
40939
|
+
if (allCommands.length > INLINE_COMMAND_LIMIT) {
|
|
40940
|
+
params.logger?.warn?.(`[inline] bot command sync truncating ${allCommands.length} commands to ${INLINE_COMMAND_LIMIT}`);
|
|
40941
|
+
}
|
|
40942
|
+
if (commands.length === 0) {
|
|
40943
|
+
params.logger?.warn?.(`[inline] bot command sync skipped for account "${account.accountId}": no valid commands resolved`);
|
|
40944
|
+
continue;
|
|
40945
|
+
}
|
|
40946
|
+
try {
|
|
40947
|
+
await callInlineBotApi({
|
|
40948
|
+
baseUrl: account.baseUrl,
|
|
40949
|
+
token,
|
|
40950
|
+
methodName: "setMyCommands",
|
|
40951
|
+
method: "POST",
|
|
40952
|
+
body: { commands }
|
|
40953
|
+
});
|
|
40954
|
+
synced += 1;
|
|
40955
|
+
params.logger?.info?.(`[inline] bot commands synced for account "${account.accountId}" (${commands.length} command${commands.length === 1 ? "" : "s"})`);
|
|
40956
|
+
} catch (err) {
|
|
40957
|
+
failed += 1;
|
|
40958
|
+
params.logger?.warn?.(`[inline] bot command sync failed for account "${account.accountId}": ${String(err)}`);
|
|
40959
|
+
}
|
|
40960
|
+
}
|
|
40961
|
+
return {
|
|
40962
|
+
attempted,
|
|
40963
|
+
synced,
|
|
40964
|
+
failed
|
|
40965
|
+
};
|
|
40966
|
+
}
|
|
40967
|
+
|
|
39489
40968
|
// src/runtime-register-api.ts
|
|
39490
40969
|
function registerInlinePluginFull(api2) {
|
|
39491
40970
|
api2.registerTool((ctx) => createInlineMembersTool(ctx), {
|
|
@@ -39494,11 +40973,14 @@ function registerInlinePluginFull(api2) {
|
|
|
39494
40973
|
api2.registerTool((ctx) => createInlineProfileTool(ctx), {
|
|
39495
40974
|
names: ["inline_update_profile"]
|
|
39496
40975
|
});
|
|
40976
|
+
api2.registerTool((ctx) => createInlineBotAvatarTool(ctx), {
|
|
40977
|
+
names: ["inline_bot_avatar"]
|
|
40978
|
+
});
|
|
39497
40979
|
api2.registerTool((ctx) => createInlineBotCommandsTool(ctx), {
|
|
39498
40980
|
names: ["inline_bot_commands"]
|
|
39499
40981
|
});
|
|
39500
40982
|
api2.registerTool((ctx) => createInlineMessageTools(ctx), {
|
|
39501
|
-
names: ["inline_nudge", "inline_forward"]
|
|
40983
|
+
names: ["inline_nudge", "inline_forward", "inline_bot_presence"]
|
|
39502
40984
|
});
|
|
39503
40985
|
api2.registerTool((ctx) => createInlineParentContextTool(ctx), {
|
|
39504
40986
|
names: ["inline_parent_context"]
|
|
@@ -39534,5 +41016,5 @@ export {
|
|
|
39534
41016
|
registerInlinePluginFull
|
|
39535
41017
|
};
|
|
39536
41018
|
|
|
39537
|
-
//# debugId=
|
|
41019
|
+
//# debugId=D10D8C4C3B879C9364756E2164756E21
|
|
39538
41020
|
//# sourceMappingURL=runtime-register-api.js.map
|