@inline-openclaw/inline 0.0.45 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/approval-handler.runtime.js +1244 -262
- package/dist/approval-handler.runtime.js.map +8 -8
- package/dist/channel-plugin-api.js +1519 -219
- package/dist/channel-plugin-api.js.map +9 -9
- 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/channel.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/runtime-register-api.d.ts.map +1 -1
- package/dist/runtime-register-api.js +1488 -71
- package/dist/runtime-register-api.js.map +10 -9
- package/openclaw.plugin.json +2 -0
- 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);
|
|
@@ -12002,6 +12255,97 @@ class UpdateDialogOrderResult$Type extends import_runtime4.MessageType {
|
|
|
12002
12255
|
}
|
|
12003
12256
|
var UpdateDialogOrderResult = new UpdateDialogOrderResult$Type;
|
|
12004
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
|
+
|
|
12005
12349
|
class MarkAsUnreadInput$Type extends import_runtime4.MessageType {
|
|
12006
12350
|
constructor() {
|
|
12007
12351
|
super("MarkAsUnreadInput", [
|
|
@@ -13262,7 +13606,376 @@ class UpdateBotProfileResult$Type extends import_runtime4.MessageType {
|
|
|
13262
13606
|
return writer;
|
|
13263
13607
|
}
|
|
13264
13608
|
}
|
|
13265
|
-
var UpdateBotProfileResult = new UpdateBotProfileResult$Type;
|
|
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;
|
|
13765
|
+
|
|
13766
|
+
class ClearBotAvatarResult$Type extends import_runtime4.MessageType {
|
|
13767
|
+
constructor() {
|
|
13768
|
+
super("ClearBotAvatarResult", [
|
|
13769
|
+
{ no: 1, name: "bot", kind: "message", T: () => User }
|
|
13770
|
+
]);
|
|
13771
|
+
}
|
|
13772
|
+
create(value) {
|
|
13773
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13774
|
+
if (value !== undefined)
|
|
13775
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13776
|
+
return message;
|
|
13777
|
+
}
|
|
13778
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13779
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13780
|
+
while (reader.pos < end) {
|
|
13781
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13782
|
+
switch (fieldNo) {
|
|
13783
|
+
case 1:
|
|
13784
|
+
message.bot = User.internalBinaryRead(reader, reader.uint32(), options, message.bot);
|
|
13785
|
+
break;
|
|
13786
|
+
default:
|
|
13787
|
+
let u = options.readUnknownField;
|
|
13788
|
+
if (u === "throw")
|
|
13789
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13790
|
+
let d = reader.skip(wireType);
|
|
13791
|
+
if (u !== false)
|
|
13792
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13793
|
+
}
|
|
13794
|
+
}
|
|
13795
|
+
return message;
|
|
13796
|
+
}
|
|
13797
|
+
internalBinaryWrite(message, writer, options) {
|
|
13798
|
+
if (message.bot)
|
|
13799
|
+
User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
13800
|
+
let u = options.writeUnknownFields;
|
|
13801
|
+
if (u !== false)
|
|
13802
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13803
|
+
return writer;
|
|
13804
|
+
}
|
|
13805
|
+
}
|
|
13806
|
+
var ClearBotAvatarResult = new ClearBotAvatarResult$Type;
|
|
13807
|
+
|
|
13808
|
+
class GetBotPresenceInput$Type extends import_runtime4.MessageType {
|
|
13809
|
+
constructor() {
|
|
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 }
|
|
13857
|
+
]);
|
|
13858
|
+
}
|
|
13859
|
+
create(value) {
|
|
13860
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13861
|
+
if (value !== undefined)
|
|
13862
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13863
|
+
return message;
|
|
13864
|
+
}
|
|
13865
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13866
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13867
|
+
while (reader.pos < end) {
|
|
13868
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13869
|
+
switch (fieldNo) {
|
|
13870
|
+
case 1:
|
|
13871
|
+
message.botUserId = reader.int64().toBigInt();
|
|
13872
|
+
break;
|
|
13873
|
+
case 2:
|
|
13874
|
+
message.avatar = BotAvatar.internalBinaryRead(reader, reader.uint32(), options, message.avatar);
|
|
13875
|
+
break;
|
|
13876
|
+
case 3:
|
|
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);
|
|
13881
|
+
break;
|
|
13882
|
+
default:
|
|
13883
|
+
let u = options.readUnknownField;
|
|
13884
|
+
if (u === "throw")
|
|
13885
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13886
|
+
let d = reader.skip(wireType);
|
|
13887
|
+
if (u !== false)
|
|
13888
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13889
|
+
}
|
|
13890
|
+
}
|
|
13891
|
+
return message;
|
|
13892
|
+
}
|
|
13893
|
+
internalBinaryWrite(message, writer, options) {
|
|
13894
|
+
if (message.botUserId !== undefined)
|
|
13895
|
+
writer.tag(1, import_runtime.WireType.Varint).int64(message.botUserId);
|
|
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();
|
|
13902
|
+
let u = options.writeUnknownFields;
|
|
13903
|
+
if (u !== false)
|
|
13904
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13905
|
+
return writer;
|
|
13906
|
+
}
|
|
13907
|
+
}
|
|
13908
|
+
var GetBotPresenceResult = new GetBotPresenceResult$Type;
|
|
13909
|
+
|
|
13910
|
+
class SetBotPresenceStateInput$Type extends import_runtime4.MessageType {
|
|
13911
|
+
constructor() {
|
|
13912
|
+
super("SetBotPresenceStateInput", [
|
|
13913
|
+
{ no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
|
|
13914
|
+
{ no: 2, name: "state", kind: "message", T: () => BotPresenceState }
|
|
13915
|
+
]);
|
|
13916
|
+
}
|
|
13917
|
+
create(value) {
|
|
13918
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
13919
|
+
if (value !== undefined)
|
|
13920
|
+
import_runtime3.reflectionMergePartial(this, message, value);
|
|
13921
|
+
return message;
|
|
13922
|
+
}
|
|
13923
|
+
internalBinaryRead(reader, length, options, target) {
|
|
13924
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
13925
|
+
while (reader.pos < end) {
|
|
13926
|
+
let [fieldNo, wireType] = reader.tag();
|
|
13927
|
+
switch (fieldNo) {
|
|
13928
|
+
case 1:
|
|
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);
|
|
13933
|
+
break;
|
|
13934
|
+
default:
|
|
13935
|
+
let u = options.readUnknownField;
|
|
13936
|
+
if (u === "throw")
|
|
13937
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
13938
|
+
let d = reader.skip(wireType);
|
|
13939
|
+
if (u !== false)
|
|
13940
|
+
(u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
13941
|
+
}
|
|
13942
|
+
}
|
|
13943
|
+
return message;
|
|
13944
|
+
}
|
|
13945
|
+
internalBinaryWrite(message, writer, options) {
|
|
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();
|
|
13950
|
+
let u = options.writeUnknownFields;
|
|
13951
|
+
if (u !== false)
|
|
13952
|
+
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
13953
|
+
return writer;
|
|
13954
|
+
}
|
|
13955
|
+
}
|
|
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;
|
|
13266
13979
|
|
|
13267
13980
|
class GetUserSettingsInput$Type extends import_runtime4.MessageType {
|
|
13268
13981
|
constructor() {
|
|
@@ -16402,7 +17115,9 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
16402
17115
|
{ no: 34, name: "chat_open", kind: "message", oneof: "update", T: () => UpdateChatOpen },
|
|
16403
17116
|
{ no: 35, name: "message_action_invoked", kind: "message", oneof: "update", T: () => UpdateMessageActionInvoked },
|
|
16404
17117
|
{ no: 36, name: "message_action_answered", kind: "message", oneof: "update", T: () => UpdateMessageActionAnswered },
|
|
16405
|
-
{ 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 }
|
|
16406
17121
|
]);
|
|
16407
17122
|
}
|
|
16408
17123
|
create(value) {
|
|
@@ -16627,6 +17342,18 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
16627
17342
|
clearChatHistory: UpdateClearChatHistory.internalBinaryRead(reader, reader.uint32(), options, message.update.clearChatHistory)
|
|
16628
17343
|
};
|
|
16629
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;
|
|
16630
17357
|
default:
|
|
16631
17358
|
let u = options.readUnknownField;
|
|
16632
17359
|
if (u === "throw")
|
|
@@ -16711,6 +17438,10 @@ class Update$Type extends import_runtime4.MessageType {
|
|
|
16711
17438
|
UpdateMessageActionAnswered.internalBinaryWrite(message.update.messageActionAnswered, writer.tag(36, import_runtime.WireType.LengthDelimited).fork(), options).join();
|
|
16712
17439
|
if (message.update.oneofKind === "clearChatHistory")
|
|
16713
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();
|
|
16714
17445
|
let u = options.writeUnknownFields;
|
|
16715
17446
|
if (u !== false)
|
|
16716
17447
|
(u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
@@ -17571,6 +18302,54 @@ class UpdateDialogNotificationSettings$Type extends import_runtime4.MessageType
|
|
|
17571
18302
|
}
|
|
17572
18303
|
var UpdateDialogNotificationSettings = new UpdateDialogNotificationSettings$Type;
|
|
17573
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
|
+
|
|
17574
18353
|
class UpdateNewChat$Type extends import_runtime4.MessageType {
|
|
17575
18354
|
constructor() {
|
|
17576
18355
|
super("UpdateNewChat", [
|
|
@@ -18096,6 +18875,74 @@ class UpdateClearChatHistory$Type extends import_runtime4.MessageType {
|
|
|
18096
18875
|
}
|
|
18097
18876
|
var UpdateClearChatHistory = new UpdateClearChatHistory$Type;
|
|
18098
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
|
+
|
|
18099
18946
|
class UpdateMessageId$Type extends import_runtime4.MessageType {
|
|
18100
18947
|
constructor() {
|
|
18101
18948
|
super("UpdateMessageId", [
|
|
@@ -37287,6 +38134,17 @@ function readStringCandidate(...values) {
|
|
|
37287
38134
|
}
|
|
37288
38135
|
|
|
37289
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
|
+
];
|
|
37290
38148
|
var InlineNudgeToolParameters = {
|
|
37291
38149
|
type: "object",
|
|
37292
38150
|
additionalProperties: false,
|
|
@@ -37387,6 +38245,43 @@ var InlineForwardToolParameters = {
|
|
|
37387
38245
|
},
|
|
37388
38246
|
required: ["to"]
|
|
37389
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
|
+
};
|
|
37390
38285
|
function resolvePeerTarget(params) {
|
|
37391
38286
|
if (params.direct) {
|
|
37392
38287
|
return {
|
|
@@ -37467,6 +38362,48 @@ function extractFirstMessageId2(updates) {
|
|
|
37467
38362
|
}
|
|
37468
38363
|
return null;
|
|
37469
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
|
+
}
|
|
37470
38407
|
async function withInlineClient(params) {
|
|
37471
38408
|
const account = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId ?? null });
|
|
37472
38409
|
if (!account.configured || !account.baseUrl) {
|
|
@@ -37537,6 +38474,54 @@ function createInlineNudgeTool(ctx) {
|
|
|
37537
38474
|
}
|
|
37538
38475
|
};
|
|
37539
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
|
+
}
|
|
37540
38525
|
function createInlineForwardTool(ctx) {
|
|
37541
38526
|
return {
|
|
37542
38527
|
name: "inline_forward",
|
|
@@ -37595,7 +38580,7 @@ function createInlineForwardTool(ctx) {
|
|
|
37595
38580
|
function createInlineMessageTools(ctx) {
|
|
37596
38581
|
if (!ctx.config)
|
|
37597
38582
|
return [];
|
|
37598
|
-
return [createInlineNudgeTool(ctx), createInlineForwardTool(ctx)];
|
|
38583
|
+
return [createInlineNudgeTool(ctx), createInlineForwardTool(ctx), createInlineBotPresenceTool(ctx)];
|
|
37599
38584
|
}
|
|
37600
38585
|
|
|
37601
38586
|
// src/inline/space-members.ts
|
|
@@ -37784,6 +38769,80 @@ function createInlineMembersTool(ctx) {
|
|
|
37784
38769
|
};
|
|
37785
38770
|
}
|
|
37786
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
|
+
|
|
37787
38846
|
// src/inline/message-content.ts
|
|
37788
38847
|
var INLINE_MESSAGE_ENTITY_TYPE = {
|
|
37789
38848
|
MENTION: 1,
|
|
@@ -37795,7 +38854,9 @@ var INLINE_MESSAGE_ENTITY_TYPE = {
|
|
|
37795
38854
|
USERNAME_MENTION: 7,
|
|
37796
38855
|
CODE: 8,
|
|
37797
38856
|
PRE: 9,
|
|
37798
|
-
PHONE_NUMBER: 10
|
|
38857
|
+
PHONE_NUMBER: 10,
|
|
38858
|
+
THREAD: 11,
|
|
38859
|
+
THREAD_TITLE: 12
|
|
37799
38860
|
};
|
|
37800
38861
|
function compactWhitespace(raw) {
|
|
37801
38862
|
return (raw ?? "").replace(/\s+/g, " ").trim();
|
|
@@ -37963,6 +39024,10 @@ function mapEntityType(type) {
|
|
|
37963
39024
|
return "pre";
|
|
37964
39025
|
case INLINE_MESSAGE_ENTITY_TYPE.PHONE_NUMBER:
|
|
37965
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";
|
|
37966
39031
|
default:
|
|
37967
39032
|
return "unknown";
|
|
37968
39033
|
}
|
|
@@ -38004,6 +39069,26 @@ function messageEntitySummaries(message) {
|
|
|
38004
39069
|
const language = compactWhitespace(entity.entity.pre.language);
|
|
38005
39070
|
if (language)
|
|
38006
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
|
+
}
|
|
38007
39092
|
}
|
|
38008
39093
|
entities.push(summary);
|
|
38009
39094
|
}
|
|
@@ -38056,6 +39141,13 @@ function formatEntitySummary(entity) {
|
|
|
38056
39141
|
return entity.userId ? `mention${quotedText} -> user:${entity.userId}` : `mention${quotedText}`;
|
|
38057
39142
|
case "text_link":
|
|
38058
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}`;
|
|
38059
39151
|
case "pre":
|
|
38060
39152
|
return entity.language ? `preformatted block${quotedText} (language: ${entity.language})` : `preformatted block${quotedText}`;
|
|
38061
39153
|
case "username_mention":
|
|
@@ -38329,14 +39421,17 @@ function sortMessages(messages) {
|
|
|
38329
39421
|
return a.id < b.id ? -1 : 1;
|
|
38330
39422
|
});
|
|
38331
39423
|
}
|
|
39424
|
+
function messageDedupeKey(message) {
|
|
39425
|
+
return `${String(message.id)}:${String(message.date)}`;
|
|
39426
|
+
}
|
|
38332
39427
|
function dedupeMessages(messages) {
|
|
38333
39428
|
const seen = new Set;
|
|
38334
39429
|
const out = [];
|
|
38335
39430
|
for (const message of messages) {
|
|
38336
|
-
const
|
|
38337
|
-
if (seen.has(
|
|
39431
|
+
const key = messageDedupeKey(message);
|
|
39432
|
+
if (seen.has(key))
|
|
38338
39433
|
continue;
|
|
38339
|
-
seen.add(
|
|
39434
|
+
seen.add(key);
|
|
38340
39435
|
out.push(message);
|
|
38341
39436
|
}
|
|
38342
39437
|
return out;
|
|
@@ -38465,56 +39560,11 @@ function createInlineParentContextTool(ctx) {
|
|
|
38465
39560
|
};
|
|
38466
39561
|
}
|
|
38467
39562
|
|
|
38468
|
-
// src/inline/
|
|
38469
|
-
|
|
38470
|
-
|
|
38471
|
-
|
|
38472
|
-
|
|
38473
|
-
"Use plain URLs or markdown links; do not wrap bare URLs in inline code or backticks.",
|
|
38474
|
-
"Mention Inline users with markdown links like [@FirstName](inline://user?id=123); use inline://user?username=username only when the user id is unavailable.",
|
|
38475
|
-
"Use inline code only for actual code, commands, file paths, env vars, or identifiers."
|
|
38476
|
-
];
|
|
38477
|
-
var INLINE_COPY_REPLACEMENTS = [
|
|
38478
|
-
[
|
|
38479
|
-
/Bind this (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) to a session target\.?/gi,
|
|
38480
|
-
"Bind this Inline conversation to a session target."
|
|
38481
|
-
],
|
|
38482
|
-
[
|
|
38483
|
-
/Remove the current (?:thread \(Discord\) or topic\/conversation \(Telegram\)|thread or topic\/conversation) binding\.?/gi,
|
|
38484
|
-
"Remove the current Inline conversation binding."
|
|
38485
|
-
]
|
|
38486
|
-
];
|
|
38487
|
-
function isBareHttpUrl(text) {
|
|
38488
|
-
if (!/^https?:\/\/\S+$/i.test(text))
|
|
38489
|
-
return false;
|
|
38490
|
-
try {
|
|
38491
|
-
const url2 = new URL(text);
|
|
38492
|
-
return url2.protocol === "http:" || url2.protocol === "https:";
|
|
38493
|
-
} catch {
|
|
38494
|
-
return false;
|
|
38495
|
-
}
|
|
38496
|
-
}
|
|
38497
|
-
function adaptInlineVisibleCopy(text) {
|
|
38498
|
-
let result = text;
|
|
38499
|
-
for (const [from, to] of INLINE_COPY_REPLACEMENTS) {
|
|
38500
|
-
result = result.replace(from, to);
|
|
38501
|
-
}
|
|
38502
|
-
return result;
|
|
38503
|
-
}
|
|
38504
|
-
function buildInlineSystemPrompt(extraPrompt) {
|
|
38505
|
-
return extraPrompt?.trim() || "";
|
|
38506
|
-
}
|
|
38507
|
-
function buildInlineInboundFormattingHints() {
|
|
38508
|
-
return {
|
|
38509
|
-
text_markup: "inline_markdown",
|
|
38510
|
-
rules: [...INLINE_FORMATTING_RULES]
|
|
38511
|
-
};
|
|
38512
|
-
}
|
|
38513
|
-
function sanitizeInlineOutgoingText(text) {
|
|
38514
|
-
return adaptInlineVisibleCopy(text).replace(/`([^`\n]+)`/g, (full, content) => {
|
|
38515
|
-
return isBareHttpUrl(content) ? content : full;
|
|
38516
|
-
});
|
|
38517
|
-
}
|
|
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";
|
|
38518
39568
|
|
|
38519
39569
|
// src/runtime.ts
|
|
38520
39570
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
@@ -38528,6 +39578,370 @@ var {
|
|
|
38528
39578
|
errorMessage: "Inline runtime not initialized"
|
|
38529
39579
|
});
|
|
38530
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
|
+
|
|
38531
39945
|
// src/inline/profile-tool.ts
|
|
38532
39946
|
var InlineProfileToolParameters = {
|
|
38533
39947
|
type: "object",
|
|
@@ -38566,7 +39980,7 @@ function jsonResult3(payload) {
|
|
|
38566
39980
|
details: payload
|
|
38567
39981
|
};
|
|
38568
39982
|
}
|
|
38569
|
-
async function
|
|
39983
|
+
async function withInlineClient5(params) {
|
|
38570
39984
|
const account = resolveInlineAccount({ cfg: params.cfg, accountId: params.accountId ?? null });
|
|
38571
39985
|
if (!account.configured || !account.baseUrl) {
|
|
38572
39986
|
throw new Error(`Inline not configured for account "${account.accountId}" (missing token or baseUrl)`);
|
|
@@ -38583,14 +39997,14 @@ async function withInlineClient4(params) {
|
|
|
38583
39997
|
await client.close().catch(() => {});
|
|
38584
39998
|
}
|
|
38585
39999
|
}
|
|
38586
|
-
function
|
|
40000
|
+
function readTrimmedString2(value) {
|
|
38587
40001
|
if (typeof value !== "string")
|
|
38588
40002
|
return;
|
|
38589
40003
|
const trimmed = value.trim();
|
|
38590
40004
|
return trimmed || undefined;
|
|
38591
40005
|
}
|
|
38592
40006
|
function resolvePhotoSource(args) {
|
|
38593
|
-
return
|
|
40007
|
+
return readTrimmedString2(args.photoPath) ?? readTrimmedString2(args.photoUrl);
|
|
38594
40008
|
}
|
|
38595
40009
|
async function uploadProfilePhoto(client, rawSource) {
|
|
38596
40010
|
const runtimeMedia = getInlineRuntime().media;
|
|
@@ -38622,18 +40036,18 @@ function createInlineProfileTool(ctx) {
|
|
|
38622
40036
|
parameters: InlineProfileToolParameters,
|
|
38623
40037
|
execute: async (_toolCallId, rawArgs) => {
|
|
38624
40038
|
const args = rawArgs;
|
|
38625
|
-
const rawName =
|
|
40039
|
+
const rawName = readTrimmedString2(args.name);
|
|
38626
40040
|
const visibleName = sanitizeInlineVisibleText(rawName);
|
|
38627
40041
|
if (visibleName.shouldSkip) {
|
|
38628
40042
|
throw new Error("inline_update_profile: name contains internal runtime text");
|
|
38629
40043
|
}
|
|
38630
|
-
const name =
|
|
38631
|
-
const existingPhotoFileUniqueId =
|
|
40044
|
+
const name = readTrimmedString2(visibleName.text);
|
|
40045
|
+
const existingPhotoFileUniqueId = readTrimmedString2(args.photoFileUniqueId);
|
|
38632
40046
|
const photoSource = resolvePhotoSource(args);
|
|
38633
40047
|
if (!name && !existingPhotoFileUniqueId && !photoSource) {
|
|
38634
40048
|
throw new Error("inline_update_profile: provide `name` and/or `photo`");
|
|
38635
40049
|
}
|
|
38636
|
-
return await
|
|
40050
|
+
return await withInlineClient5({
|
|
38637
40051
|
cfg: ctx.config,
|
|
38638
40052
|
accountId: args.accountId ?? ctx.agentAccountId ?? null,
|
|
38639
40053
|
fn: async (client, resolvedAccountId) => {
|
|
@@ -39559,11 +40973,14 @@ function registerInlinePluginFull(api2) {
|
|
|
39559
40973
|
api2.registerTool((ctx) => createInlineProfileTool(ctx), {
|
|
39560
40974
|
names: ["inline_update_profile"]
|
|
39561
40975
|
});
|
|
40976
|
+
api2.registerTool((ctx) => createInlineBotAvatarTool(ctx), {
|
|
40977
|
+
names: ["inline_bot_avatar"]
|
|
40978
|
+
});
|
|
39562
40979
|
api2.registerTool((ctx) => createInlineBotCommandsTool(ctx), {
|
|
39563
40980
|
names: ["inline_bot_commands"]
|
|
39564
40981
|
});
|
|
39565
40982
|
api2.registerTool((ctx) => createInlineMessageTools(ctx), {
|
|
39566
|
-
names: ["inline_nudge", "inline_forward"]
|
|
40983
|
+
names: ["inline_nudge", "inline_forward", "inline_bot_presence"]
|
|
39567
40984
|
});
|
|
39568
40985
|
api2.registerTool((ctx) => createInlineParentContextTool(ctx), {
|
|
39569
40986
|
names: ["inline_parent_context"]
|
|
@@ -39599,5 +41016,5 @@ export {
|
|
|
39599
41016
|
registerInlinePluginFull
|
|
39600
41017
|
};
|
|
39601
41018
|
|
|
39602
|
-
//# debugId=
|
|
41019
|
+
//# debugId=D10D8C4C3B879C9364756E2164756E21
|
|
39603
41020
|
//# sourceMappingURL=runtime-register-api.js.map
|