@inline-openclaw/inline 0.0.58 → 0.0.60

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.
@@ -5722,6 +5722,7 @@ var RpcError_Code;
5722
5722
  RpcError_Code2[RpcError_Code2["USERNAME_TAKEN"] = 16] = "USERNAME_TAKEN";
5723
5723
  RpcError_Code2[RpcError_Code2["FIRST_NAME_INVALID"] = 17] = "FIRST_NAME_INVALID";
5724
5724
  RpcError_Code2[RpcError_Code2["URL_PREVIEW_UNAVAILABLE"] = 18] = "URL_PREVIEW_UNAVAILABLE";
5725
+ RpcError_Code2[RpcError_Code2["AGENT_SESSION_MESSAGE_IMMUTABLE"] = 19] = "AGENT_SESSION_MESSAGE_IMMUTABLE";
5725
5726
  })(RpcError_Code || (RpcError_Code = {}));
5726
5727
  var SyncSkippedSequence_Reason;
5727
5728
  (function(SyncSkippedSequence_Reason2) {
@@ -5843,11 +5844,56 @@ var DialogFollowMode;
5843
5844
  DialogFollowMode2[DialogFollowMode2["FOLLOWING"] = 1] = "FOLLOWING";
5844
5845
  DialogFollowMode2[DialogFollowMode2["UNFOLLOWED"] = 2] = "UNFOLLOWED";
5845
5846
  })(DialogFollowMode || (DialogFollowMode = {}));
5847
+ var AgentSessionProvider;
5848
+ (function(AgentSessionProvider2) {
5849
+ AgentSessionProvider2[AgentSessionProvider2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5850
+ AgentSessionProvider2[AgentSessionProvider2["CODEX"] = 1] = "CODEX";
5851
+ AgentSessionProvider2[AgentSessionProvider2["CODEX_CLOUD"] = 2] = "CODEX_CLOUD";
5852
+ AgentSessionProvider2[AgentSessionProvider2["CLAUDE"] = 3] = "CLAUDE";
5853
+ AgentSessionProvider2[AgentSessionProvider2["OPEN_CODE"] = 4] = "OPEN_CODE";
5854
+ AgentSessionProvider2[AgentSessionProvider2["AMP"] = 5] = "AMP";
5855
+ })(AgentSessionProvider || (AgentSessionProvider = {}));
5856
+ var AgentSessionMessageRole;
5857
+ (function(AgentSessionMessageRole2) {
5858
+ AgentSessionMessageRole2[AgentSessionMessageRole2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5859
+ AgentSessionMessageRole2[AgentSessionMessageRole2["USER"] = 1] = "USER";
5860
+ AgentSessionMessageRole2[AgentSessionMessageRole2["ASSISTANT"] = 2] = "ASSISTANT";
5861
+ })(AgentSessionMessageRole || (AgentSessionMessageRole = {}));
5862
+ var AgentSessionMessageRelation;
5863
+ (function(AgentSessionMessageRelation2) {
5864
+ AgentSessionMessageRelation2[AgentSessionMessageRelation2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5865
+ AgentSessionMessageRelation2[AgentSessionMessageRelation2["IMPORTED"] = 1] = "IMPORTED";
5866
+ AgentSessionMessageRelation2[AgentSessionMessageRelation2["LINKED"] = 2] = "LINKED";
5867
+ })(AgentSessionMessageRelation || (AgentSessionMessageRelation = {}));
5846
5868
  var MessageSendMode;
5847
5869
  (function(MessageSendMode2) {
5848
5870
  MessageSendMode2[MessageSendMode2["MODE_UNSPECIFIED"] = 0] = "MODE_UNSPECIFIED";
5849
5871
  MessageSendMode2[MessageSendMode2["MODE_SILENT"] = 1] = "MODE_SILENT";
5850
5872
  })(MessageSendMode || (MessageSendMode = {}));
5873
+ var ConnectAgentSessionState;
5874
+ (function(ConnectAgentSessionState2) {
5875
+ ConnectAgentSessionState2[ConnectAgentSessionState2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5876
+ ConnectAgentSessionState2[ConnectAgentSessionState2["CREATED"] = 1] = "CREATED";
5877
+ ConnectAgentSessionState2[ConnectAgentSessionState2["ALREADY_CONNECTED"] = 2] = "ALREADY_CONNECTED";
5878
+ ConnectAgentSessionState2[ConnectAgentSessionState2["CONNECTED_ELSEWHERE"] = 3] = "CONNECTED_ELSEWHERE";
5879
+ })(ConnectAgentSessionState || (ConnectAgentSessionState = {}));
5880
+ var AgentSessionSyncMode;
5881
+ (function(AgentSessionSyncMode2) {
5882
+ AgentSessionSyncMode2[AgentSessionSyncMode2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5883
+ AgentSessionSyncMode2[AgentSessionSyncMode2["HISTORY"] = 1] = "HISTORY";
5884
+ AgentSessionSyncMode2[AgentSessionSyncMode2["LIVE"] = 2] = "LIVE";
5885
+ })(AgentSessionSyncMode || (AgentSessionSyncMode = {}));
5886
+ var AgentSessionMessageSyncState;
5887
+ (function(AgentSessionMessageSyncState2) {
5888
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
5889
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["CREATED"] = 1] = "CREATED";
5890
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["EDITED"] = 2] = "EDITED";
5891
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["LINKED"] = 3] = "LINKED";
5892
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["UNCHANGED"] = 4] = "UNCHANGED";
5893
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["STALE"] = 5] = "STALE";
5894
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["TOMBSTONED"] = 6] = "TOMBSTONED";
5895
+ AgentSessionMessageSyncState2[AgentSessionMessageSyncState2["CONFLICT"] = 7] = "CONFLICT";
5896
+ })(AgentSessionMessageSyncState || (AgentSessionMessageSyncState = {}));
5851
5897
  var Method;
5852
5898
  (function(Method2) {
5853
5899
  Method2[Method2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
@@ -5977,6 +6023,11 @@ var Method;
5977
6023
  Method2[Method2["UPDATE_DIALOG_FOLDER"] = 125] = "UPDATE_DIALOG_FOLDER";
5978
6024
  Method2[Method2["DELETE_DIALOG_FOLDER"] = 126] = "DELETE_DIALOG_FOLDER";
5979
6025
  Method2[Method2["GET_SPACE"] = 127] = "GET_SPACE";
6026
+ Method2[Method2["CONNECT_AGENT_SESSION"] = 128] = "CONNECT_AGENT_SESSION";
6027
+ Method2[Method2["SYNC_AGENT_SESSION_MESSAGES"] = 129] = "SYNC_AGENT_SESSION_MESSAGES";
6028
+ Method2[Method2["GET_AGENT_SESSION"] = 130] = "GET_AGENT_SESSION";
6029
+ Method2[Method2["UPDATE_BOT_AGENT"] = 131] = "UPDATE_BOT_AGENT";
6030
+ Method2[Method2["DELETE_BOT_AGENT"] = 132] = "DELETE_BOT_AGENT";
5980
6031
  })(Method || (Method = {}));
5981
6032
  var GridConnectionUnavailableReason;
5982
6033
  (function(GridConnectionUnavailableReason2) {
@@ -9528,7 +9579,8 @@ class Message$Type extends import_runtime4.MessageType {
9528
9579
  { no: 20, name: "actions", kind: "message", T: () => MessageActions },
9529
9580
  { no: 21, name: "rev", kind: "scalar", opt: true, T: 3, L: 0 },
9530
9581
  { no: 22, name: "service_message", kind: "message", T: () => MessageService },
9531
- { no: 23, name: "block_content", kind: "message", T: () => BlockContent }
9582
+ { no: 23, name: "block_content", kind: "message", T: () => BlockContent },
9583
+ { no: 24, name: "agent_session", kind: "message", T: () => AgentSessionMessageInfo }
9532
9584
  ]);
9533
9585
  }
9534
9586
  create(value) {
@@ -9619,6 +9671,9 @@ class Message$Type extends import_runtime4.MessageType {
9619
9671
  case 23:
9620
9672
  message.blockContent = BlockContent.internalBinaryRead(reader, reader.uint32(), options, message.blockContent);
9621
9673
  break;
9674
+ case 24:
9675
+ message.agentSession = AgentSessionMessageInfo.internalBinaryRead(reader, reader.uint32(), options, message.agentSession);
9676
+ break;
9622
9677
  default:
9623
9678
  let u = options.readUnknownField;
9624
9679
  if (u === "throw")
@@ -9679,6 +9734,8 @@ class Message$Type extends import_runtime4.MessageType {
9679
9734
  MessageService.internalBinaryWrite(message.serviceMessage, writer.tag(22, import_runtime.WireType.LengthDelimited).fork(), options).join();
9680
9735
  if (message.blockContent)
9681
9736
  BlockContent.internalBinaryWrite(message.blockContent, writer.tag(23, import_runtime.WireType.LengthDelimited).fork(), options).join();
9737
+ if (message.agentSession)
9738
+ AgentSessionMessageInfo.internalBinaryWrite(message.agentSession, writer.tag(24, import_runtime.WireType.LengthDelimited).fork(), options).join();
9682
9739
  let u = options.writeUnknownFields;
9683
9740
  if (u !== false)
9684
9741
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -9687,6 +9744,70 @@ class Message$Type extends import_runtime4.MessageType {
9687
9744
  }
9688
9745
  var Message = new Message$Type;
9689
9746
 
9747
+ class AgentSessionMessageInfo$Type extends import_runtime4.MessageType {
9748
+ constructor() {
9749
+ super("AgentSessionMessageInfo", [
9750
+ { no: 1, name: "agent_session_id", kind: "scalar", T: 3, L: 0 },
9751
+ { no: 2, name: "provider", kind: "enum", T: () => ["AgentSessionProvider", AgentSessionProvider, "AGENT_SESSION_PROVIDER_"] },
9752
+ { no: 3, name: "role", kind: "enum", T: () => ["AgentSessionMessageRole", AgentSessionMessageRole, "AGENT_SESSION_MESSAGE_ROLE_"] },
9753
+ { no: 4, name: "relation", kind: "enum", T: () => ["AgentSessionMessageRelation", AgentSessionMessageRelation, "AGENT_SESSION_MESSAGE_RELATION_"] }
9754
+ ]);
9755
+ }
9756
+ create(value) {
9757
+ const message = globalThis.Object.create(this.messagePrototype);
9758
+ message.agentSessionId = 0n;
9759
+ message.provider = 0;
9760
+ message.role = 0;
9761
+ message.relation = 0;
9762
+ if (value !== undefined)
9763
+ import_runtime3.reflectionMergePartial(this, message, value);
9764
+ return message;
9765
+ }
9766
+ internalBinaryRead(reader, length, options, target) {
9767
+ let message = target ?? this.create(), end = reader.pos + length;
9768
+ while (reader.pos < end) {
9769
+ let [fieldNo, wireType] = reader.tag();
9770
+ switch (fieldNo) {
9771
+ case 1:
9772
+ message.agentSessionId = reader.int64().toBigInt();
9773
+ break;
9774
+ case 2:
9775
+ message.provider = reader.int32();
9776
+ break;
9777
+ case 3:
9778
+ message.role = reader.int32();
9779
+ break;
9780
+ case 4:
9781
+ message.relation = reader.int32();
9782
+ break;
9783
+ default:
9784
+ let u = options.readUnknownField;
9785
+ if (u === "throw")
9786
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
9787
+ let d = reader.skip(wireType);
9788
+ if (u !== false)
9789
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
9790
+ }
9791
+ }
9792
+ return message;
9793
+ }
9794
+ internalBinaryWrite(message, writer, options) {
9795
+ if (message.agentSessionId !== 0n)
9796
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentSessionId);
9797
+ if (message.provider !== 0)
9798
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.provider);
9799
+ if (message.role !== 0)
9800
+ writer.tag(3, import_runtime.WireType.Varint).int32(message.role);
9801
+ if (message.relation !== 0)
9802
+ writer.tag(4, import_runtime.WireType.Varint).int32(message.relation);
9803
+ let u = options.writeUnknownFields;
9804
+ if (u !== false)
9805
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
9806
+ return writer;
9807
+ }
9808
+ }
9809
+ var AgentSessionMessageInfo = new AgentSessionMessageInfo$Type;
9810
+
9690
9811
  class MessageFwdHeader$Type extends import_runtime4.MessageType {
9691
9812
  constructor() {
9692
9813
  super("MessageFwdHeader", [
@@ -10591,6 +10712,718 @@ class GetSpaceResult$Type extends import_runtime4.MessageType {
10591
10712
  }
10592
10713
  var GetSpaceResult = new GetSpaceResult$Type;
10593
10714
 
10715
+ class AgentSession$Type extends import_runtime4.MessageType {
10716
+ constructor() {
10717
+ super("AgentSession", [
10718
+ { no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
10719
+ { no: 2, name: "peer_id", kind: "message", T: () => Peer },
10720
+ { no: 3, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
10721
+ { no: 4, name: "provider", kind: "enum", T: () => ["AgentSessionProvider", AgentSessionProvider, "AGENT_SESSION_PROVIDER_"] },
10722
+ { no: 5, name: "status_message_id", kind: "scalar", opt: true, T: 3, L: 0 }
10723
+ ]);
10724
+ }
10725
+ create(value) {
10726
+ const message = globalThis.Object.create(this.messagePrototype);
10727
+ message.id = 0n;
10728
+ message.botUserId = 0n;
10729
+ message.provider = 0;
10730
+ if (value !== undefined)
10731
+ import_runtime3.reflectionMergePartial(this, message, value);
10732
+ return message;
10733
+ }
10734
+ internalBinaryRead(reader, length, options, target) {
10735
+ let message = target ?? this.create(), end = reader.pos + length;
10736
+ while (reader.pos < end) {
10737
+ let [fieldNo, wireType] = reader.tag();
10738
+ switch (fieldNo) {
10739
+ case 1:
10740
+ message.id = reader.int64().toBigInt();
10741
+ break;
10742
+ case 2:
10743
+ message.peerId = Peer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
10744
+ break;
10745
+ case 3:
10746
+ message.botUserId = reader.int64().toBigInt();
10747
+ break;
10748
+ case 4:
10749
+ message.provider = reader.int32();
10750
+ break;
10751
+ case 5:
10752
+ message.statusMessageId = reader.int64().toBigInt();
10753
+ break;
10754
+ default:
10755
+ let u = options.readUnknownField;
10756
+ if (u === "throw")
10757
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10758
+ let d = reader.skip(wireType);
10759
+ if (u !== false)
10760
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10761
+ }
10762
+ }
10763
+ return message;
10764
+ }
10765
+ internalBinaryWrite(message, writer, options) {
10766
+ if (message.id !== 0n)
10767
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.id);
10768
+ if (message.peerId)
10769
+ Peer.internalBinaryWrite(message.peerId, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
10770
+ if (message.botUserId !== 0n)
10771
+ writer.tag(3, import_runtime.WireType.Varint).int64(message.botUserId);
10772
+ if (message.provider !== 0)
10773
+ writer.tag(4, import_runtime.WireType.Varint).int32(message.provider);
10774
+ if (message.statusMessageId !== undefined)
10775
+ writer.tag(5, import_runtime.WireType.Varint).int64(message.statusMessageId);
10776
+ let u = options.writeUnknownFields;
10777
+ if (u !== false)
10778
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10779
+ return writer;
10780
+ }
10781
+ }
10782
+ var AgentSession = new AgentSession$Type;
10783
+
10784
+ class ConnectAgentSessionInput$Type extends import_runtime4.MessageType {
10785
+ constructor() {
10786
+ super("ConnectAgentSessionInput", [
10787
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
10788
+ { no: 2, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
10789
+ { no: 3, name: "provider", kind: "enum", T: () => ["AgentSessionProvider", AgentSessionProvider, "AGENT_SESSION_PROVIDER_"] },
10790
+ { no: 4, name: "instance_ref", kind: "scalar", T: 9 },
10791
+ { no: 5, name: "session_ref", kind: "scalar", T: 9 },
10792
+ { no: 6, name: "project_ref", kind: "scalar", opt: true, T: 9 },
10793
+ { no: 7, name: "status_message_id", kind: "scalar", opt: true, T: 3, L: 0 }
10794
+ ]);
10795
+ }
10796
+ create(value) {
10797
+ const message = globalThis.Object.create(this.messagePrototype);
10798
+ message.botUserId = 0n;
10799
+ message.provider = 0;
10800
+ message.instanceRef = "";
10801
+ message.sessionRef = "";
10802
+ if (value !== undefined)
10803
+ import_runtime3.reflectionMergePartial(this, message, value);
10804
+ return message;
10805
+ }
10806
+ internalBinaryRead(reader, length, options, target) {
10807
+ let message = target ?? this.create(), end = reader.pos + length;
10808
+ while (reader.pos < end) {
10809
+ let [fieldNo, wireType] = reader.tag();
10810
+ switch (fieldNo) {
10811
+ case 1:
10812
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
10813
+ break;
10814
+ case 2:
10815
+ message.botUserId = reader.int64().toBigInt();
10816
+ break;
10817
+ case 3:
10818
+ message.provider = reader.int32();
10819
+ break;
10820
+ case 4:
10821
+ message.instanceRef = reader.string();
10822
+ break;
10823
+ case 5:
10824
+ message.sessionRef = reader.string();
10825
+ break;
10826
+ case 6:
10827
+ message.projectRef = reader.string();
10828
+ break;
10829
+ case 7:
10830
+ message.statusMessageId = reader.int64().toBigInt();
10831
+ break;
10832
+ default:
10833
+ let u = options.readUnknownField;
10834
+ if (u === "throw")
10835
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10836
+ let d = reader.skip(wireType);
10837
+ if (u !== false)
10838
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10839
+ }
10840
+ }
10841
+ return message;
10842
+ }
10843
+ internalBinaryWrite(message, writer, options) {
10844
+ if (message.peerId)
10845
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
10846
+ if (message.botUserId !== 0n)
10847
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.botUserId);
10848
+ if (message.provider !== 0)
10849
+ writer.tag(3, import_runtime.WireType.Varint).int32(message.provider);
10850
+ if (message.instanceRef !== "")
10851
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.instanceRef);
10852
+ if (message.sessionRef !== "")
10853
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.sessionRef);
10854
+ if (message.projectRef !== undefined)
10855
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.projectRef);
10856
+ if (message.statusMessageId !== undefined)
10857
+ writer.tag(7, import_runtime.WireType.Varint).int64(message.statusMessageId);
10858
+ let u = options.writeUnknownFields;
10859
+ if (u !== false)
10860
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10861
+ return writer;
10862
+ }
10863
+ }
10864
+ var ConnectAgentSessionInput = new ConnectAgentSessionInput$Type;
10865
+
10866
+ class ConnectAgentSessionResult$Type extends import_runtime4.MessageType {
10867
+ constructor() {
10868
+ super("ConnectAgentSessionResult", [
10869
+ { no: 1, name: "agent_session", kind: "message", T: () => AgentSession },
10870
+ { no: 2, name: "state", kind: "enum", T: () => ["ConnectAgentSessionState", ConnectAgentSessionState, "CONNECT_AGENT_SESSION_STATE_"] }
10871
+ ]);
10872
+ }
10873
+ create(value) {
10874
+ const message = globalThis.Object.create(this.messagePrototype);
10875
+ message.state = 0;
10876
+ if (value !== undefined)
10877
+ import_runtime3.reflectionMergePartial(this, message, value);
10878
+ return message;
10879
+ }
10880
+ internalBinaryRead(reader, length, options, target) {
10881
+ let message = target ?? this.create(), end = reader.pos + length;
10882
+ while (reader.pos < end) {
10883
+ let [fieldNo, wireType] = reader.tag();
10884
+ switch (fieldNo) {
10885
+ case 1:
10886
+ message.agentSession = AgentSession.internalBinaryRead(reader, reader.uint32(), options, message.agentSession);
10887
+ break;
10888
+ case 2:
10889
+ message.state = reader.int32();
10890
+ break;
10891
+ default:
10892
+ let u = options.readUnknownField;
10893
+ if (u === "throw")
10894
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10895
+ let d = reader.skip(wireType);
10896
+ if (u !== false)
10897
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10898
+ }
10899
+ }
10900
+ return message;
10901
+ }
10902
+ internalBinaryWrite(message, writer, options) {
10903
+ if (message.agentSession)
10904
+ AgentSession.internalBinaryWrite(message.agentSession, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
10905
+ if (message.state !== 0)
10906
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.state);
10907
+ let u = options.writeUnknownFields;
10908
+ if (u !== false)
10909
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10910
+ return writer;
10911
+ }
10912
+ }
10913
+ var ConnectAgentSessionResult = new ConnectAgentSessionResult$Type;
10914
+
10915
+ class AgentSessionConnection$Type extends import_runtime4.MessageType {
10916
+ constructor() {
10917
+ super("AgentSessionConnection", [
10918
+ { no: 1, name: "agent_session", kind: "message", T: () => AgentSession },
10919
+ { no: 2, name: "instance_ref", kind: "scalar", T: 9 },
10920
+ { no: 3, name: "session_ref", kind: "scalar", T: 9 },
10921
+ { no: 4, name: "project_ref", kind: "scalar", opt: true, T: 9 }
10922
+ ]);
10923
+ }
10924
+ create(value) {
10925
+ const message = globalThis.Object.create(this.messagePrototype);
10926
+ message.instanceRef = "";
10927
+ message.sessionRef = "";
10928
+ if (value !== undefined)
10929
+ import_runtime3.reflectionMergePartial(this, message, value);
10930
+ return message;
10931
+ }
10932
+ internalBinaryRead(reader, length, options, target) {
10933
+ let message = target ?? this.create(), end = reader.pos + length;
10934
+ while (reader.pos < end) {
10935
+ let [fieldNo, wireType] = reader.tag();
10936
+ switch (fieldNo) {
10937
+ case 1:
10938
+ message.agentSession = AgentSession.internalBinaryRead(reader, reader.uint32(), options, message.agentSession);
10939
+ break;
10940
+ case 2:
10941
+ message.instanceRef = reader.string();
10942
+ break;
10943
+ case 3:
10944
+ message.sessionRef = reader.string();
10945
+ break;
10946
+ case 4:
10947
+ message.projectRef = reader.string();
10948
+ break;
10949
+ default:
10950
+ let u = options.readUnknownField;
10951
+ if (u === "throw")
10952
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10953
+ let d = reader.skip(wireType);
10954
+ if (u !== false)
10955
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10956
+ }
10957
+ }
10958
+ return message;
10959
+ }
10960
+ internalBinaryWrite(message, writer, options) {
10961
+ if (message.agentSession)
10962
+ AgentSession.internalBinaryWrite(message.agentSession, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
10963
+ if (message.instanceRef !== "")
10964
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.instanceRef);
10965
+ if (message.sessionRef !== "")
10966
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.sessionRef);
10967
+ if (message.projectRef !== undefined)
10968
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.projectRef);
10969
+ let u = options.writeUnknownFields;
10970
+ if (u !== false)
10971
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10972
+ return writer;
10973
+ }
10974
+ }
10975
+ var AgentSessionConnection = new AgentSessionConnection$Type;
10976
+
10977
+ class GetAgentSessionInput$Type extends import_runtime4.MessageType {
10978
+ constructor() {
10979
+ super("GetAgentSessionInput", [
10980
+ { no: 1, name: "peer_id", kind: "message", T: () => InputPeer },
10981
+ { no: 2, name: "bot_user_id", kind: "scalar", T: 3, L: 0 }
10982
+ ]);
10983
+ }
10984
+ create(value) {
10985
+ const message = globalThis.Object.create(this.messagePrototype);
10986
+ message.botUserId = 0n;
10987
+ if (value !== undefined)
10988
+ import_runtime3.reflectionMergePartial(this, message, value);
10989
+ return message;
10990
+ }
10991
+ internalBinaryRead(reader, length, options, target) {
10992
+ let message = target ?? this.create(), end = reader.pos + length;
10993
+ while (reader.pos < end) {
10994
+ let [fieldNo, wireType] = reader.tag();
10995
+ switch (fieldNo) {
10996
+ case 1:
10997
+ message.peerId = InputPeer.internalBinaryRead(reader, reader.uint32(), options, message.peerId);
10998
+ break;
10999
+ case 2:
11000
+ message.botUserId = reader.int64().toBigInt();
11001
+ break;
11002
+ default:
11003
+ let u = options.readUnknownField;
11004
+ if (u === "throw")
11005
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11006
+ let d = reader.skip(wireType);
11007
+ if (u !== false)
11008
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11009
+ }
11010
+ }
11011
+ return message;
11012
+ }
11013
+ internalBinaryWrite(message, writer, options) {
11014
+ if (message.peerId)
11015
+ InputPeer.internalBinaryWrite(message.peerId, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
11016
+ if (message.botUserId !== 0n)
11017
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.botUserId);
11018
+ let u = options.writeUnknownFields;
11019
+ if (u !== false)
11020
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11021
+ return writer;
11022
+ }
11023
+ }
11024
+ var GetAgentSessionInput = new GetAgentSessionInput$Type;
11025
+
11026
+ class GetAgentSessionResult$Type extends import_runtime4.MessageType {
11027
+ constructor() {
11028
+ super("GetAgentSessionResult", [
11029
+ { no: 1, name: "connection", kind: "message", T: () => AgentSessionConnection }
11030
+ ]);
11031
+ }
11032
+ create(value) {
11033
+ const message = globalThis.Object.create(this.messagePrototype);
11034
+ if (value !== undefined)
11035
+ import_runtime3.reflectionMergePartial(this, message, value);
11036
+ return message;
11037
+ }
11038
+ internalBinaryRead(reader, length, options, target) {
11039
+ let message = target ?? this.create(), end = reader.pos + length;
11040
+ while (reader.pos < end) {
11041
+ let [fieldNo, wireType] = reader.tag();
11042
+ switch (fieldNo) {
11043
+ case 1:
11044
+ message.connection = AgentSessionConnection.internalBinaryRead(reader, reader.uint32(), options, message.connection);
11045
+ break;
11046
+ default:
11047
+ let u = options.readUnknownField;
11048
+ if (u === "throw")
11049
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11050
+ let d = reader.skip(wireType);
11051
+ if (u !== false)
11052
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11053
+ }
11054
+ }
11055
+ return message;
11056
+ }
11057
+ internalBinaryWrite(message, writer, options) {
11058
+ if (message.connection)
11059
+ AgentSessionConnection.internalBinaryWrite(message.connection, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
11060
+ let u = options.writeUnknownFields;
11061
+ if (u !== false)
11062
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11063
+ return writer;
11064
+ }
11065
+ }
11066
+ var GetAgentSessionResult = new GetAgentSessionResult$Type;
11067
+
11068
+ class AgentSessionMessageUpsert$Type extends import_runtime4.MessageType {
11069
+ constructor() {
11070
+ super("AgentSessionMessageUpsert", [
11071
+ { no: 1, name: "text", kind: "scalar", T: 9 },
11072
+ { no: 2, name: "entities", kind: "message", T: () => MessageEntities },
11073
+ { no: 3, name: "assistant_random_id", kind: "scalar", opt: true, T: 3, L: 0 }
11074
+ ]);
11075
+ }
11076
+ create(value) {
11077
+ const message = globalThis.Object.create(this.messagePrototype);
11078
+ message.text = "";
11079
+ if (value !== undefined)
11080
+ import_runtime3.reflectionMergePartial(this, message, value);
11081
+ return message;
11082
+ }
11083
+ internalBinaryRead(reader, length, options, target) {
11084
+ let message = target ?? this.create(), end = reader.pos + length;
11085
+ while (reader.pos < end) {
11086
+ let [fieldNo, wireType] = reader.tag();
11087
+ switch (fieldNo) {
11088
+ case 1:
11089
+ message.text = reader.string();
11090
+ break;
11091
+ case 2:
11092
+ message.entities = MessageEntities.internalBinaryRead(reader, reader.uint32(), options, message.entities);
11093
+ break;
11094
+ case 3:
11095
+ message.assistantRandomId = reader.int64().toBigInt();
11096
+ break;
11097
+ default:
11098
+ let u = options.readUnknownField;
11099
+ if (u === "throw")
11100
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11101
+ let d = reader.skip(wireType);
11102
+ if (u !== false)
11103
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11104
+ }
11105
+ }
11106
+ return message;
11107
+ }
11108
+ internalBinaryWrite(message, writer, options) {
11109
+ if (message.text !== "")
11110
+ writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.text);
11111
+ if (message.entities)
11112
+ MessageEntities.internalBinaryWrite(message.entities, writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
11113
+ if (message.assistantRandomId !== undefined)
11114
+ writer.tag(3, import_runtime.WireType.Varint).int64(message.assistantRandomId);
11115
+ let u = options.writeUnknownFields;
11116
+ if (u !== false)
11117
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11118
+ return writer;
11119
+ }
11120
+ }
11121
+ var AgentSessionMessageUpsert = new AgentSessionMessageUpsert$Type;
11122
+
11123
+ class AgentSessionMessageLink$Type extends import_runtime4.MessageType {
11124
+ constructor() {
11125
+ super("AgentSessionMessageLink", [
11126
+ { no: 1, name: "message_id", kind: "scalar", T: 3, L: 0 }
11127
+ ]);
11128
+ }
11129
+ create(value) {
11130
+ const message = globalThis.Object.create(this.messagePrototype);
11131
+ message.messageId = 0n;
11132
+ if (value !== undefined)
11133
+ import_runtime3.reflectionMergePartial(this, message, value);
11134
+ return message;
11135
+ }
11136
+ internalBinaryRead(reader, length, options, target) {
11137
+ let message = target ?? this.create(), end = reader.pos + length;
11138
+ while (reader.pos < end) {
11139
+ let [fieldNo, wireType] = reader.tag();
11140
+ switch (fieldNo) {
11141
+ case 1:
11142
+ message.messageId = reader.int64().toBigInt();
11143
+ break;
11144
+ default:
11145
+ let u = options.readUnknownField;
11146
+ if (u === "throw")
11147
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11148
+ let d = reader.skip(wireType);
11149
+ if (u !== false)
11150
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11151
+ }
11152
+ }
11153
+ return message;
11154
+ }
11155
+ internalBinaryWrite(message, writer, options) {
11156
+ if (message.messageId !== 0n)
11157
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.messageId);
11158
+ let u = options.writeUnknownFields;
11159
+ if (u !== false)
11160
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11161
+ return writer;
11162
+ }
11163
+ }
11164
+ var AgentSessionMessageLink = new AgentSessionMessageLink$Type;
11165
+
11166
+ class AgentSessionMessageSync$Type extends import_runtime4.MessageType {
11167
+ constructor() {
11168
+ super("AgentSessionMessageSync", [
11169
+ { no: 1, name: "role", kind: "enum", T: () => ["AgentSessionMessageRole", AgentSessionMessageRole, "AGENT_SESSION_MESSAGE_ROLE_"] },
11170
+ { no: 2, name: "item_ref", kind: "scalar", opt: true, T: 9 },
11171
+ { no: 3, name: "correlation_ref", kind: "scalar", opt: true, T: 9 },
11172
+ { no: 4, name: "source_date", kind: "scalar", opt: true, T: 3, L: 0 },
11173
+ { no: 5, name: "revision_ref", kind: "scalar", opt: true, T: 9 },
11174
+ { no: 6, name: "base_revision_ref", kind: "scalar", opt: true, T: 9 },
11175
+ { no: 7, name: "complete", kind: "scalar", T: 8 },
11176
+ { no: 8, name: "upsert", kind: "message", oneof: "operation", T: () => AgentSessionMessageUpsert },
11177
+ { no: 9, name: "link", kind: "message", oneof: "operation", T: () => AgentSessionMessageLink }
11178
+ ]);
11179
+ }
11180
+ create(value) {
11181
+ const message = globalThis.Object.create(this.messagePrototype);
11182
+ message.role = 0;
11183
+ message.complete = false;
11184
+ message.operation = { oneofKind: undefined };
11185
+ if (value !== undefined)
11186
+ import_runtime3.reflectionMergePartial(this, message, value);
11187
+ return message;
11188
+ }
11189
+ internalBinaryRead(reader, length, options, target) {
11190
+ let message = target ?? this.create(), end = reader.pos + length;
11191
+ while (reader.pos < end) {
11192
+ let [fieldNo, wireType] = reader.tag();
11193
+ switch (fieldNo) {
11194
+ case 1:
11195
+ message.role = reader.int32();
11196
+ break;
11197
+ case 2:
11198
+ message.itemRef = reader.string();
11199
+ break;
11200
+ case 3:
11201
+ message.correlationRef = reader.string();
11202
+ break;
11203
+ case 4:
11204
+ message.sourceDate = reader.int64().toBigInt();
11205
+ break;
11206
+ case 5:
11207
+ message.revisionRef = reader.string();
11208
+ break;
11209
+ case 6:
11210
+ message.baseRevisionRef = reader.string();
11211
+ break;
11212
+ case 7:
11213
+ message.complete = reader.bool();
11214
+ break;
11215
+ case 8:
11216
+ message.operation = {
11217
+ oneofKind: "upsert",
11218
+ upsert: AgentSessionMessageUpsert.internalBinaryRead(reader, reader.uint32(), options, message.operation.upsert)
11219
+ };
11220
+ break;
11221
+ case 9:
11222
+ message.operation = {
11223
+ oneofKind: "link",
11224
+ link: AgentSessionMessageLink.internalBinaryRead(reader, reader.uint32(), options, message.operation.link)
11225
+ };
11226
+ break;
11227
+ default:
11228
+ let u = options.readUnknownField;
11229
+ if (u === "throw")
11230
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11231
+ let d = reader.skip(wireType);
11232
+ if (u !== false)
11233
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11234
+ }
11235
+ }
11236
+ return message;
11237
+ }
11238
+ internalBinaryWrite(message, writer, options) {
11239
+ if (message.role !== 0)
11240
+ writer.tag(1, import_runtime.WireType.Varint).int32(message.role);
11241
+ if (message.itemRef !== undefined)
11242
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.itemRef);
11243
+ if (message.correlationRef !== undefined)
11244
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.correlationRef);
11245
+ if (message.sourceDate !== undefined)
11246
+ writer.tag(4, import_runtime.WireType.Varint).int64(message.sourceDate);
11247
+ if (message.revisionRef !== undefined)
11248
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.revisionRef);
11249
+ if (message.baseRevisionRef !== undefined)
11250
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.baseRevisionRef);
11251
+ if (message.complete !== false)
11252
+ writer.tag(7, import_runtime.WireType.Varint).bool(message.complete);
11253
+ if (message.operation.oneofKind === "upsert")
11254
+ AgentSessionMessageUpsert.internalBinaryWrite(message.operation.upsert, writer.tag(8, import_runtime.WireType.LengthDelimited).fork(), options).join();
11255
+ if (message.operation.oneofKind === "link")
11256
+ AgentSessionMessageLink.internalBinaryWrite(message.operation.link, writer.tag(9, import_runtime.WireType.LengthDelimited).fork(), options).join();
11257
+ let u = options.writeUnknownFields;
11258
+ if (u !== false)
11259
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11260
+ return writer;
11261
+ }
11262
+ }
11263
+ var AgentSessionMessageSync = new AgentSessionMessageSync$Type;
11264
+
11265
+ class SyncAgentSessionMessagesInput$Type extends import_runtime4.MessageType {
11266
+ constructor() {
11267
+ super("SyncAgentSessionMessagesInput", [
11268
+ { no: 1, name: "agent_session_id", kind: "scalar", T: 3, L: 0 },
11269
+ { no: 2, name: "mode", kind: "enum", T: () => ["AgentSessionSyncMode", AgentSessionSyncMode, "AGENT_SESSION_SYNC_MODE_"] },
11270
+ { no: 3, name: "messages", kind: "message", repeat: 1, T: () => AgentSessionMessageSync }
11271
+ ]);
11272
+ }
11273
+ create(value) {
11274
+ const message = globalThis.Object.create(this.messagePrototype);
11275
+ message.agentSessionId = 0n;
11276
+ message.mode = 0;
11277
+ message.messages = [];
11278
+ if (value !== undefined)
11279
+ import_runtime3.reflectionMergePartial(this, message, value);
11280
+ return message;
11281
+ }
11282
+ internalBinaryRead(reader, length, options, target) {
11283
+ let message = target ?? this.create(), end = reader.pos + length;
11284
+ while (reader.pos < end) {
11285
+ let [fieldNo, wireType] = reader.tag();
11286
+ switch (fieldNo) {
11287
+ case 1:
11288
+ message.agentSessionId = reader.int64().toBigInt();
11289
+ break;
11290
+ case 2:
11291
+ message.mode = reader.int32();
11292
+ break;
11293
+ case 3:
11294
+ message.messages.push(AgentSessionMessageSync.internalBinaryRead(reader, reader.uint32(), options));
11295
+ break;
11296
+ default:
11297
+ let u = options.readUnknownField;
11298
+ if (u === "throw")
11299
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11300
+ let d = reader.skip(wireType);
11301
+ if (u !== false)
11302
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11303
+ }
11304
+ }
11305
+ return message;
11306
+ }
11307
+ internalBinaryWrite(message, writer, options) {
11308
+ if (message.agentSessionId !== 0n)
11309
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentSessionId);
11310
+ if (message.mode !== 0)
11311
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.mode);
11312
+ for (let i = 0;i < message.messages.length; i++)
11313
+ AgentSessionMessageSync.internalBinaryWrite(message.messages[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
11314
+ let u = options.writeUnknownFields;
11315
+ if (u !== false)
11316
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11317
+ return writer;
11318
+ }
11319
+ }
11320
+ var SyncAgentSessionMessagesInput = new SyncAgentSessionMessagesInput$Type;
11321
+
11322
+ class AgentSessionMessageSyncResult$Type extends import_runtime4.MessageType {
11323
+ constructor() {
11324
+ super("AgentSessionMessageSyncResult", [
11325
+ { no: 1, name: "index", kind: "scalar", T: 5 },
11326
+ { no: 2, name: "state", kind: "enum", T: () => ["AgentSessionMessageSyncState", AgentSessionMessageSyncState, "AGENT_SESSION_MESSAGE_SYNC_STATE_"] },
11327
+ { no: 3, name: "message_id", kind: "scalar", opt: true, T: 3, L: 0 },
11328
+ { no: 4, name: "current_revision_ref", kind: "scalar", opt: true, T: 9 }
11329
+ ]);
11330
+ }
11331
+ create(value) {
11332
+ const message = globalThis.Object.create(this.messagePrototype);
11333
+ message.index = 0;
11334
+ message.state = 0;
11335
+ if (value !== undefined)
11336
+ import_runtime3.reflectionMergePartial(this, message, value);
11337
+ return message;
11338
+ }
11339
+ internalBinaryRead(reader, length, options, target) {
11340
+ let message = target ?? this.create(), end = reader.pos + length;
11341
+ while (reader.pos < end) {
11342
+ let [fieldNo, wireType] = reader.tag();
11343
+ switch (fieldNo) {
11344
+ case 1:
11345
+ message.index = reader.int32();
11346
+ break;
11347
+ case 2:
11348
+ message.state = reader.int32();
11349
+ break;
11350
+ case 3:
11351
+ message.messageId = reader.int64().toBigInt();
11352
+ break;
11353
+ case 4:
11354
+ message.currentRevisionRef = reader.string();
11355
+ break;
11356
+ default:
11357
+ let u = options.readUnknownField;
11358
+ if (u === "throw")
11359
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11360
+ let d = reader.skip(wireType);
11361
+ if (u !== false)
11362
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11363
+ }
11364
+ }
11365
+ return message;
11366
+ }
11367
+ internalBinaryWrite(message, writer, options) {
11368
+ if (message.index !== 0)
11369
+ writer.tag(1, import_runtime.WireType.Varint).int32(message.index);
11370
+ if (message.state !== 0)
11371
+ writer.tag(2, import_runtime.WireType.Varint).int32(message.state);
11372
+ if (message.messageId !== undefined)
11373
+ writer.tag(3, import_runtime.WireType.Varint).int64(message.messageId);
11374
+ if (message.currentRevisionRef !== undefined)
11375
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.currentRevisionRef);
11376
+ let u = options.writeUnknownFields;
11377
+ if (u !== false)
11378
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11379
+ return writer;
11380
+ }
11381
+ }
11382
+ var AgentSessionMessageSyncResult = new AgentSessionMessageSyncResult$Type;
11383
+
11384
+ class SyncAgentSessionMessagesResult$Type extends import_runtime4.MessageType {
11385
+ constructor() {
11386
+ super("SyncAgentSessionMessagesResult", [
11387
+ { no: 1, name: "messages", kind: "message", repeat: 1, T: () => AgentSessionMessageSyncResult }
11388
+ ]);
11389
+ }
11390
+ create(value) {
11391
+ const message = globalThis.Object.create(this.messagePrototype);
11392
+ message.messages = [];
11393
+ if (value !== undefined)
11394
+ import_runtime3.reflectionMergePartial(this, message, value);
11395
+ return message;
11396
+ }
11397
+ internalBinaryRead(reader, length, options, target) {
11398
+ let message = target ?? this.create(), end = reader.pos + length;
11399
+ while (reader.pos < end) {
11400
+ let [fieldNo, wireType] = reader.tag();
11401
+ switch (fieldNo) {
11402
+ case 1:
11403
+ message.messages.push(AgentSessionMessageSyncResult.internalBinaryRead(reader, reader.uint32(), options));
11404
+ break;
11405
+ default:
11406
+ let u = options.readUnknownField;
11407
+ if (u === "throw")
11408
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11409
+ let d = reader.skip(wireType);
11410
+ if (u !== false)
11411
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11412
+ }
11413
+ }
11414
+ return message;
11415
+ }
11416
+ internalBinaryWrite(message, writer, options) {
11417
+ for (let i = 0;i < message.messages.length; i++)
11418
+ AgentSessionMessageSyncResult.internalBinaryWrite(message.messages[i], writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
11419
+ let u = options.writeUnknownFields;
11420
+ if (u !== false)
11421
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11422
+ return writer;
11423
+ }
11424
+ }
11425
+ var SyncAgentSessionMessagesResult = new SyncAgentSessionMessagesResult$Type;
11426
+
10594
11427
  class JoinPublicSpaceInput$Type extends import_runtime4.MessageType {
10595
11428
  constructor() {
10596
11429
  super("JoinPublicSpaceInput", [
@@ -12463,7 +13296,12 @@ class RpcCall$Type extends import_runtime4.MessageType {
12463
13296
  { no: 125, name: "createDialogFolder", kind: "message", oneof: "input", T: () => CreateDialogFolderInput },
12464
13297
  { no: 126, name: "updateDialogFolder", kind: "message", oneof: "input", T: () => UpdateDialogFolderInput },
12465
13298
  { no: 127, name: "deleteDialogFolder", kind: "message", oneof: "input", T: () => DeleteDialogFolderInput },
12466
- { no: 128, name: "getSpace", kind: "message", oneof: "input", T: () => GetSpaceInput }
13299
+ { no: 128, name: "getSpace", kind: "message", oneof: "input", T: () => GetSpaceInput },
13300
+ { no: 129, name: "connectAgentSession", kind: "message", oneof: "input", T: () => ConnectAgentSessionInput },
13301
+ { no: 130, name: "syncAgentSessionMessages", kind: "message", oneof: "input", T: () => SyncAgentSessionMessagesInput },
13302
+ { no: 131, name: "getAgentSession", kind: "message", oneof: "input", T: () => GetAgentSessionInput },
13303
+ { no: 132, name: "updateBotAgent", kind: "message", oneof: "input", T: () => UpdateBotAgentInput },
13304
+ { no: 133, name: "deleteBotAgent", kind: "message", oneof: "input", T: () => DeleteBotAgentInput }
12467
13305
  ]);
12468
13306
  }
12469
13307
  create(value) {
@@ -13238,6 +14076,36 @@ class RpcCall$Type extends import_runtime4.MessageType {
13238
14076
  getSpace: GetSpaceInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getSpace)
13239
14077
  };
13240
14078
  break;
14079
+ case 129:
14080
+ message.input = {
14081
+ oneofKind: "connectAgentSession",
14082
+ connectAgentSession: ConnectAgentSessionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.connectAgentSession)
14083
+ };
14084
+ break;
14085
+ case 130:
14086
+ message.input = {
14087
+ oneofKind: "syncAgentSessionMessages",
14088
+ syncAgentSessionMessages: SyncAgentSessionMessagesInput.internalBinaryRead(reader, reader.uint32(), options, message.input.syncAgentSessionMessages)
14089
+ };
14090
+ break;
14091
+ case 131:
14092
+ message.input = {
14093
+ oneofKind: "getAgentSession",
14094
+ getAgentSession: GetAgentSessionInput.internalBinaryRead(reader, reader.uint32(), options, message.input.getAgentSession)
14095
+ };
14096
+ break;
14097
+ case 132:
14098
+ message.input = {
14099
+ oneofKind: "updateBotAgent",
14100
+ updateBotAgent: UpdateBotAgentInput.internalBinaryRead(reader, reader.uint32(), options, message.input.updateBotAgent)
14101
+ };
14102
+ break;
14103
+ case 133:
14104
+ message.input = {
14105
+ oneofKind: "deleteBotAgent",
14106
+ deleteBotAgent: DeleteBotAgentInput.internalBinaryRead(reader, reader.uint32(), options, message.input.deleteBotAgent)
14107
+ };
14108
+ break;
13241
14109
  default:
13242
14110
  let u = options.readUnknownField;
13243
14111
  if (u === "throw")
@@ -13504,6 +14372,16 @@ class RpcCall$Type extends import_runtime4.MessageType {
13504
14372
  DeleteDialogFolderInput.internalBinaryWrite(message.input.deleteDialogFolder, writer.tag(127, import_runtime.WireType.LengthDelimited).fork(), options).join();
13505
14373
  if (message.input.oneofKind === "getSpace")
13506
14374
  GetSpaceInput.internalBinaryWrite(message.input.getSpace, writer.tag(128, import_runtime.WireType.LengthDelimited).fork(), options).join();
14375
+ if (message.input.oneofKind === "connectAgentSession")
14376
+ ConnectAgentSessionInput.internalBinaryWrite(message.input.connectAgentSession, writer.tag(129, import_runtime.WireType.LengthDelimited).fork(), options).join();
14377
+ if (message.input.oneofKind === "syncAgentSessionMessages")
14378
+ SyncAgentSessionMessagesInput.internalBinaryWrite(message.input.syncAgentSessionMessages, writer.tag(130, import_runtime.WireType.LengthDelimited).fork(), options).join();
14379
+ if (message.input.oneofKind === "getAgentSession")
14380
+ GetAgentSessionInput.internalBinaryWrite(message.input.getAgentSession, writer.tag(131, import_runtime.WireType.LengthDelimited).fork(), options).join();
14381
+ if (message.input.oneofKind === "updateBotAgent")
14382
+ UpdateBotAgentInput.internalBinaryWrite(message.input.updateBotAgent, writer.tag(132, import_runtime.WireType.LengthDelimited).fork(), options).join();
14383
+ if (message.input.oneofKind === "deleteBotAgent")
14384
+ DeleteBotAgentInput.internalBinaryWrite(message.input.deleteBotAgent, writer.tag(133, import_runtime.WireType.LengthDelimited).fork(), options).join();
13507
14385
  let u = options.writeUnknownFields;
13508
14386
  if (u !== false)
13509
14387
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -13641,7 +14519,12 @@ class RpcResult$Type extends import_runtime4.MessageType {
13641
14519
  { no: 125, name: "createDialogFolder", kind: "message", oneof: "result", T: () => CreateDialogFolderResult },
13642
14520
  { no: 126, name: "updateDialogFolder", kind: "message", oneof: "result", T: () => UpdateDialogFolderResult },
13643
14521
  { no: 127, name: "deleteDialogFolder", kind: "message", oneof: "result", T: () => DeleteDialogFolderResult },
13644
- { no: 128, name: "getSpace", kind: "message", oneof: "result", T: () => GetSpaceResult }
14522
+ { no: 128, name: "getSpace", kind: "message", oneof: "result", T: () => GetSpaceResult },
14523
+ { no: 129, name: "connectAgentSession", kind: "message", oneof: "result", T: () => ConnectAgentSessionResult },
14524
+ { no: 130, name: "syncAgentSessionMessages", kind: "message", oneof: "result", T: () => SyncAgentSessionMessagesResult },
14525
+ { no: 131, name: "getAgentSession", kind: "message", oneof: "result", T: () => GetAgentSessionResult },
14526
+ { no: 132, name: "updateBotAgent", kind: "message", oneof: "result", T: () => UpdateBotAgentResult },
14527
+ { no: 133, name: "deleteBotAgent", kind: "message", oneof: "result", T: () => DeleteBotAgentResult }
13645
14528
  ]);
13646
14529
  }
13647
14530
  create(value) {
@@ -14416,6 +15299,36 @@ class RpcResult$Type extends import_runtime4.MessageType {
14416
15299
  getSpace: GetSpaceResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getSpace)
14417
15300
  };
14418
15301
  break;
15302
+ case 129:
15303
+ message.result = {
15304
+ oneofKind: "connectAgentSession",
15305
+ connectAgentSession: ConnectAgentSessionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.connectAgentSession)
15306
+ };
15307
+ break;
15308
+ case 130:
15309
+ message.result = {
15310
+ oneofKind: "syncAgentSessionMessages",
15311
+ syncAgentSessionMessages: SyncAgentSessionMessagesResult.internalBinaryRead(reader, reader.uint32(), options, message.result.syncAgentSessionMessages)
15312
+ };
15313
+ break;
15314
+ case 131:
15315
+ message.result = {
15316
+ oneofKind: "getAgentSession",
15317
+ getAgentSession: GetAgentSessionResult.internalBinaryRead(reader, reader.uint32(), options, message.result.getAgentSession)
15318
+ };
15319
+ break;
15320
+ case 132:
15321
+ message.result = {
15322
+ oneofKind: "updateBotAgent",
15323
+ updateBotAgent: UpdateBotAgentResult.internalBinaryRead(reader, reader.uint32(), options, message.result.updateBotAgent)
15324
+ };
15325
+ break;
15326
+ case 133:
15327
+ message.result = {
15328
+ oneofKind: "deleteBotAgent",
15329
+ deleteBotAgent: DeleteBotAgentResult.internalBinaryRead(reader, reader.uint32(), options, message.result.deleteBotAgent)
15330
+ };
15331
+ break;
14419
15332
  default:
14420
15333
  let u = options.readUnknownField;
14421
15334
  if (u === "throw")
@@ -14682,6 +15595,16 @@ class RpcResult$Type extends import_runtime4.MessageType {
14682
15595
  DeleteDialogFolderResult.internalBinaryWrite(message.result.deleteDialogFolder, writer.tag(127, import_runtime.WireType.LengthDelimited).fork(), options).join();
14683
15596
  if (message.result.oneofKind === "getSpace")
14684
15597
  GetSpaceResult.internalBinaryWrite(message.result.getSpace, writer.tag(128, import_runtime.WireType.LengthDelimited).fork(), options).join();
15598
+ if (message.result.oneofKind === "connectAgentSession")
15599
+ ConnectAgentSessionResult.internalBinaryWrite(message.result.connectAgentSession, writer.tag(129, import_runtime.WireType.LengthDelimited).fork(), options).join();
15600
+ if (message.result.oneofKind === "syncAgentSessionMessages")
15601
+ SyncAgentSessionMessagesResult.internalBinaryWrite(message.result.syncAgentSessionMessages, writer.tag(130, import_runtime.WireType.LengthDelimited).fork(), options).join();
15602
+ if (message.result.oneofKind === "getAgentSession")
15603
+ GetAgentSessionResult.internalBinaryWrite(message.result.getAgentSession, writer.tag(131, import_runtime.WireType.LengthDelimited).fork(), options).join();
15604
+ if (message.result.oneofKind === "updateBotAgent")
15605
+ UpdateBotAgentResult.internalBinaryWrite(message.result.updateBotAgent, writer.tag(132, import_runtime.WireType.LengthDelimited).fork(), options).join();
15606
+ if (message.result.oneofKind === "deleteBotAgent")
15607
+ DeleteBotAgentResult.internalBinaryWrite(message.result.deleteBotAgent, writer.tag(133, import_runtime.WireType.LengthDelimited).fork(), options).join();
14685
15608
  let u = options.writeUnknownFields;
14686
15609
  if (u !== false)
14687
15610
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -16149,7 +17072,8 @@ var GetGridHomeResult = new GetGridHomeResult$Type;
16149
17072
  class CreateGridRoomInput$Type extends import_runtime4.MessageType {
16150
17073
  constructor() {
16151
17074
  super("CreateGridRoomInput", [
16152
- { no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 }
17075
+ { no: 1, name: "space_id", kind: "scalar", T: 3, L: 0 },
17076
+ { no: 2, name: "microphone_enabled", kind: "scalar", opt: true, T: 8 }
16153
17077
  ]);
16154
17078
  }
16155
17079
  create(value) {
@@ -16167,6 +17091,9 @@ class CreateGridRoomInput$Type extends import_runtime4.MessageType {
16167
17091
  case 1:
16168
17092
  message.spaceId = reader.int64().toBigInt();
16169
17093
  break;
17094
+ case 2:
17095
+ message.microphoneEnabled = reader.bool();
17096
+ break;
16170
17097
  default:
16171
17098
  let u = options.readUnknownField;
16172
17099
  if (u === "throw")
@@ -16181,6 +17108,8 @@ class CreateGridRoomInput$Type extends import_runtime4.MessageType {
16181
17108
  internalBinaryWrite(message, writer, options) {
16182
17109
  if (message.spaceId !== 0n)
16183
17110
  writer.tag(1, import_runtime.WireType.Varint).int64(message.spaceId);
17111
+ if (message.microphoneEnabled !== undefined)
17112
+ writer.tag(2, import_runtime.WireType.Varint).bool(message.microphoneEnabled);
16184
17113
  let u = options.writeUnknownFields;
16185
17114
  if (u !== false)
16186
17115
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -16241,7 +17170,8 @@ var CreateGridRoomResult = new CreateGridRoomResult$Type;
16241
17170
  class JoinGridRoomInput$Type extends import_runtime4.MessageType {
16242
17171
  constructor() {
16243
17172
  super("JoinGridRoomInput", [
16244
- { no: 1, name: "room_id", kind: "scalar", T: 3, L: 0 }
17173
+ { no: 1, name: "room_id", kind: "scalar", T: 3, L: 0 },
17174
+ { no: 2, name: "microphone_enabled", kind: "scalar", opt: true, T: 8 }
16245
17175
  ]);
16246
17176
  }
16247
17177
  create(value) {
@@ -16259,6 +17189,9 @@ class JoinGridRoomInput$Type extends import_runtime4.MessageType {
16259
17189
  case 1:
16260
17190
  message.roomId = reader.int64().toBigInt();
16261
17191
  break;
17192
+ case 2:
17193
+ message.microphoneEnabled = reader.bool();
17194
+ break;
16262
17195
  default:
16263
17196
  let u = options.readUnknownField;
16264
17197
  if (u === "throw")
@@ -16273,6 +17206,8 @@ class JoinGridRoomInput$Type extends import_runtime4.MessageType {
16273
17206
  internalBinaryWrite(message, writer, options) {
16274
17207
  if (message.roomId !== 0n)
16275
17208
  writer.tag(1, import_runtime.WireType.Varint).int64(message.roomId);
17209
+ if (message.microphoneEnabled !== undefined)
17210
+ writer.tag(2, import_runtime.WireType.Varint).bool(message.microphoneEnabled);
16276
17211
  let u = options.writeUnknownFields;
16277
17212
  if (u !== false)
16278
17213
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -18666,6 +19601,81 @@ class BotAgent$Type extends import_runtime4.MessageType {
18666
19601
  }
18667
19602
  var BotAgent = new BotAgent$Type;
18668
19603
 
19604
+ class BotAgentProfile$Type extends import_runtime4.MessageType {
19605
+ constructor() {
19606
+ super("BotAgentProfile", [
19607
+ { no: 1, name: "id", kind: "scalar", T: 3, L: 0 },
19608
+ { no: 2, name: "bot_user_id", kind: "scalar", T: 3, L: 0 },
19609
+ { no: 3, name: "name", kind: "scalar", T: 9 },
19610
+ { no: 4, name: "handle", kind: "scalar", opt: true, T: 9 },
19611
+ { no: 5, name: "emoji", kind: "scalar", opt: true, T: 9 },
19612
+ { no: 6, name: "description", kind: "scalar", opt: true, T: 9 }
19613
+ ]);
19614
+ }
19615
+ create(value) {
19616
+ const message = globalThis.Object.create(this.messagePrototype);
19617
+ message.id = 0n;
19618
+ message.botUserId = 0n;
19619
+ message.name = "";
19620
+ if (value !== undefined)
19621
+ import_runtime3.reflectionMergePartial(this, message, value);
19622
+ return message;
19623
+ }
19624
+ internalBinaryRead(reader, length, options, target) {
19625
+ let message = target ?? this.create(), end = reader.pos + length;
19626
+ while (reader.pos < end) {
19627
+ let [fieldNo, wireType] = reader.tag();
19628
+ switch (fieldNo) {
19629
+ case 1:
19630
+ message.id = reader.int64().toBigInt();
19631
+ break;
19632
+ case 2:
19633
+ message.botUserId = reader.int64().toBigInt();
19634
+ break;
19635
+ case 3:
19636
+ message.name = reader.string();
19637
+ break;
19638
+ case 4:
19639
+ message.handle = reader.string();
19640
+ break;
19641
+ case 5:
19642
+ message.emoji = reader.string();
19643
+ break;
19644
+ case 6:
19645
+ message.description = reader.string();
19646
+ break;
19647
+ default:
19648
+ let u = options.readUnknownField;
19649
+ if (u === "throw")
19650
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
19651
+ let d = reader.skip(wireType);
19652
+ if (u !== false)
19653
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
19654
+ }
19655
+ }
19656
+ return message;
19657
+ }
19658
+ internalBinaryWrite(message, writer, options) {
19659
+ if (message.id !== 0n)
19660
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.id);
19661
+ if (message.botUserId !== 0n)
19662
+ writer.tag(2, import_runtime.WireType.Varint).int64(message.botUserId);
19663
+ if (message.name !== "")
19664
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.name);
19665
+ if (message.handle !== undefined)
19666
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.handle);
19667
+ if (message.emoji !== undefined)
19668
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.emoji);
19669
+ if (message.description !== undefined)
19670
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.description);
19671
+ let u = options.writeUnknownFields;
19672
+ if (u !== false)
19673
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
19674
+ return writer;
19675
+ }
19676
+ }
19677
+ var BotAgentProfile = new BotAgentProfile$Type;
19678
+
18669
19679
  class CreateBotAgentInput$Type extends import_runtime4.MessageType {
18670
19680
  constructor() {
18671
19681
  super("CreateBotAgentInput", [
@@ -18965,6 +19975,213 @@ class ListBotAgentsResult$Type extends import_runtime4.MessageType {
18965
19975
  }
18966
19976
  var ListBotAgentsResult = new ListBotAgentsResult$Type;
18967
19977
 
19978
+ class UpdateBotAgentInput$Type extends import_runtime4.MessageType {
19979
+ constructor() {
19980
+ super("UpdateBotAgentInput", [
19981
+ { no: 1, name: "agent_id", kind: "scalar", T: 3, L: 0 },
19982
+ { no: 2, name: "name", kind: "scalar", opt: true, T: 9 },
19983
+ { no: 3, name: "handle", kind: "scalar", opt: true, T: 9 },
19984
+ { no: 4, name: "emoji", kind: "scalar", opt: true, T: 9 },
19985
+ { no: 5, name: "description", kind: "scalar", opt: true, T: 9 },
19986
+ { no: 6, name: "skill_key", kind: "scalar", opt: true, T: 9 },
19987
+ { no: 7, name: "instructions", kind: "scalar", opt: true, T: 9 }
19988
+ ]);
19989
+ }
19990
+ create(value) {
19991
+ const message = globalThis.Object.create(this.messagePrototype);
19992
+ message.agentId = 0n;
19993
+ if (value !== undefined)
19994
+ import_runtime3.reflectionMergePartial(this, message, value);
19995
+ return message;
19996
+ }
19997
+ internalBinaryRead(reader, length, options, target) {
19998
+ let message = target ?? this.create(), end = reader.pos + length;
19999
+ while (reader.pos < end) {
20000
+ let [fieldNo, wireType] = reader.tag();
20001
+ switch (fieldNo) {
20002
+ case 1:
20003
+ message.agentId = reader.int64().toBigInt();
20004
+ break;
20005
+ case 2:
20006
+ message.name = reader.string();
20007
+ break;
20008
+ case 3:
20009
+ message.handle = reader.string();
20010
+ break;
20011
+ case 4:
20012
+ message.emoji = reader.string();
20013
+ break;
20014
+ case 5:
20015
+ message.description = reader.string();
20016
+ break;
20017
+ case 6:
20018
+ message.skillKey = reader.string();
20019
+ break;
20020
+ case 7:
20021
+ message.instructions = reader.string();
20022
+ break;
20023
+ default:
20024
+ let u = options.readUnknownField;
20025
+ if (u === "throw")
20026
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
20027
+ let d = reader.skip(wireType);
20028
+ if (u !== false)
20029
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
20030
+ }
20031
+ }
20032
+ return message;
20033
+ }
20034
+ internalBinaryWrite(message, writer, options) {
20035
+ if (message.agentId !== 0n)
20036
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentId);
20037
+ if (message.name !== undefined)
20038
+ writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.name);
20039
+ if (message.handle !== undefined)
20040
+ writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.handle);
20041
+ if (message.emoji !== undefined)
20042
+ writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.emoji);
20043
+ if (message.description !== undefined)
20044
+ writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.description);
20045
+ if (message.skillKey !== undefined)
20046
+ writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.skillKey);
20047
+ if (message.instructions !== undefined)
20048
+ writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.instructions);
20049
+ let u = options.writeUnknownFields;
20050
+ if (u !== false)
20051
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20052
+ return writer;
20053
+ }
20054
+ }
20055
+ var UpdateBotAgentInput = new UpdateBotAgentInput$Type;
20056
+
20057
+ class UpdateBotAgentResult$Type extends import_runtime4.MessageType {
20058
+ constructor() {
20059
+ super("UpdateBotAgentResult", [
20060
+ { no: 1, name: "agent", kind: "message", T: () => BotAgent }
20061
+ ]);
20062
+ }
20063
+ create(value) {
20064
+ const message = globalThis.Object.create(this.messagePrototype);
20065
+ if (value !== undefined)
20066
+ import_runtime3.reflectionMergePartial(this, message, value);
20067
+ return message;
20068
+ }
20069
+ internalBinaryRead(reader, length, options, target) {
20070
+ let message = target ?? this.create(), end = reader.pos + length;
20071
+ while (reader.pos < end) {
20072
+ let [fieldNo, wireType] = reader.tag();
20073
+ switch (fieldNo) {
20074
+ case 1:
20075
+ message.agent = BotAgent.internalBinaryRead(reader, reader.uint32(), options, message.agent);
20076
+ break;
20077
+ default:
20078
+ let u = options.readUnknownField;
20079
+ if (u === "throw")
20080
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
20081
+ let d = reader.skip(wireType);
20082
+ if (u !== false)
20083
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
20084
+ }
20085
+ }
20086
+ return message;
20087
+ }
20088
+ internalBinaryWrite(message, writer, options) {
20089
+ if (message.agent)
20090
+ BotAgent.internalBinaryWrite(message.agent, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
20091
+ let u = options.writeUnknownFields;
20092
+ if (u !== false)
20093
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20094
+ return writer;
20095
+ }
20096
+ }
20097
+ var UpdateBotAgentResult = new UpdateBotAgentResult$Type;
20098
+
20099
+ class DeleteBotAgentInput$Type extends import_runtime4.MessageType {
20100
+ constructor() {
20101
+ super("DeleteBotAgentInput", [
20102
+ { no: 1, name: "agent_id", kind: "scalar", T: 3, L: 0 }
20103
+ ]);
20104
+ }
20105
+ create(value) {
20106
+ const message = globalThis.Object.create(this.messagePrototype);
20107
+ message.agentId = 0n;
20108
+ if (value !== undefined)
20109
+ import_runtime3.reflectionMergePartial(this, message, value);
20110
+ return message;
20111
+ }
20112
+ internalBinaryRead(reader, length, options, target) {
20113
+ let message = target ?? this.create(), end = reader.pos + length;
20114
+ while (reader.pos < end) {
20115
+ let [fieldNo, wireType] = reader.tag();
20116
+ switch (fieldNo) {
20117
+ case 1:
20118
+ message.agentId = reader.int64().toBigInt();
20119
+ break;
20120
+ default:
20121
+ let u = options.readUnknownField;
20122
+ if (u === "throw")
20123
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
20124
+ let d = reader.skip(wireType);
20125
+ if (u !== false)
20126
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
20127
+ }
20128
+ }
20129
+ return message;
20130
+ }
20131
+ internalBinaryWrite(message, writer, options) {
20132
+ if (message.agentId !== 0n)
20133
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentId);
20134
+ let u = options.writeUnknownFields;
20135
+ if (u !== false)
20136
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20137
+ return writer;
20138
+ }
20139
+ }
20140
+ var DeleteBotAgentInput = new DeleteBotAgentInput$Type;
20141
+
20142
+ class DeleteBotAgentResult$Type extends import_runtime4.MessageType {
20143
+ constructor() {
20144
+ super("DeleteBotAgentResult", [
20145
+ { no: 1, name: "agent_id", kind: "scalar", T: 3, L: 0 }
20146
+ ]);
20147
+ }
20148
+ create(value) {
20149
+ const message = globalThis.Object.create(this.messagePrototype);
20150
+ message.agentId = 0n;
20151
+ if (value !== undefined)
20152
+ import_runtime3.reflectionMergePartial(this, message, value);
20153
+ return message;
20154
+ }
20155
+ internalBinaryRead(reader, length, options, target) {
20156
+ let message = target ?? this.create(), end = reader.pos + length;
20157
+ while (reader.pos < end) {
20158
+ let [fieldNo, wireType] = reader.tag();
20159
+ switch (fieldNo) {
20160
+ case 1:
20161
+ message.agentId = reader.int64().toBigInt();
20162
+ break;
20163
+ default:
20164
+ let u = options.readUnknownField;
20165
+ if (u === "throw")
20166
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
20167
+ let d = reader.skip(wireType);
20168
+ if (u !== false)
20169
+ (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
20170
+ }
20171
+ }
20172
+ return message;
20173
+ }
20174
+ internalBinaryWrite(message, writer, options) {
20175
+ if (message.agentId !== 0n)
20176
+ writer.tag(1, import_runtime.WireType.Varint).int64(message.agentId);
20177
+ let u = options.writeUnknownFields;
20178
+ if (u !== false)
20179
+ (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
20180
+ return writer;
20181
+ }
20182
+ }
20183
+ var DeleteBotAgentResult = new DeleteBotAgentResult$Type;
20184
+
18968
20185
  class ListBotsInput$Type extends import_runtime4.MessageType {
18969
20186
  constructor() {
18970
20187
  super("ListBotsInput", []);
@@ -26388,7 +27605,8 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
26388
27605
  { no: 4, name: "emoji", kind: "scalar", opt: true, T: 9 },
26389
27606
  { no: 5, name: "is_public", kind: "scalar", T: 8 },
26390
27607
  { no: 6, name: "participants", kind: "message", repeat: 1, T: () => InputChatParticipant },
26391
- { no: 7, name: "reserved_chat_id", kind: "scalar", opt: true, T: 3, L: 0 }
27608
+ { no: 7, name: "reserved_chat_id", kind: "scalar", opt: true, T: 3, L: 0 },
27609
+ { no: 8, name: "placeholder_title", kind: "scalar", opt: true, T: 9 }
26392
27610
  ]);
26393
27611
  }
26394
27612
  create(value) {
@@ -26425,6 +27643,9 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
26425
27643
  case 7:
26426
27644
  message.reservedChatId = reader.int64().toBigInt();
26427
27645
  break;
27646
+ case 8:
27647
+ message.placeholderTitle = reader.string();
27648
+ break;
26428
27649
  default:
26429
27650
  let u = options.readUnknownField;
26430
27651
  if (u === "throw")
@@ -26451,6 +27672,8 @@ class CreateChatInput$Type extends import_runtime4.MessageType {
26451
27672
  InputChatParticipant.internalBinaryWrite(message.participants[i], writer.tag(6, import_runtime.WireType.LengthDelimited).fork(), options).join();
26452
27673
  if (message.reservedChatId !== undefined)
26453
27674
  writer.tag(7, import_runtime.WireType.Varint).int64(message.reservedChatId);
27675
+ if (message.placeholderTitle !== undefined)
27676
+ writer.tag(8, import_runtime.WireType.LengthDelimited).string(message.placeholderTitle);
26454
27677
  let u = options.writeUnknownFields;
26455
27678
  if (u !== false)
26456
27679
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -31459,12 +32682,14 @@ class PeerBot$Type extends import_runtime4.MessageType {
31459
32682
  constructor() {
31460
32683
  super("PeerBot", [
31461
32684
  { no: 1, name: "bot", kind: "message", T: () => User },
31462
- { no: 2, name: "capabilities", kind: "message", repeat: 1, T: () => BotCapability }
32685
+ { no: 2, name: "capabilities", kind: "message", repeat: 1, T: () => BotCapability },
32686
+ { no: 3, name: "agents", kind: "message", repeat: 1, T: () => BotAgentProfile }
31463
32687
  ]);
31464
32688
  }
31465
32689
  create(value) {
31466
32690
  const message = globalThis.Object.create(this.messagePrototype);
31467
32691
  message.capabilities = [];
32692
+ message.agents = [];
31468
32693
  if (value !== undefined)
31469
32694
  import_runtime3.reflectionMergePartial(this, message, value);
31470
32695
  return message;
@@ -31480,6 +32705,9 @@ class PeerBot$Type extends import_runtime4.MessageType {
31480
32705
  case 2:
31481
32706
  message.capabilities.push(BotCapability.internalBinaryRead(reader, reader.uint32(), options));
31482
32707
  break;
32708
+ case 3:
32709
+ message.agents.push(BotAgentProfile.internalBinaryRead(reader, reader.uint32(), options));
32710
+ break;
31483
32711
  default:
31484
32712
  let u = options.readUnknownField;
31485
32713
  if (u === "throw")
@@ -31496,6 +32724,8 @@ class PeerBot$Type extends import_runtime4.MessageType {
31496
32724
  User.internalBinaryWrite(message.bot, writer.tag(1, import_runtime.WireType.LengthDelimited).fork(), options).join();
31497
32725
  for (let i = 0;i < message.capabilities.length; i++)
31498
32726
  BotCapability.internalBinaryWrite(message.capabilities[i], writer.tag(2, import_runtime.WireType.LengthDelimited).fork(), options).join();
32727
+ for (let i = 0;i < message.agents.length; i++)
32728
+ BotAgentProfile.internalBinaryWrite(message.agents[i], writer.tag(3, import_runtime.WireType.LengthDelimited).fork(), options).join();
31499
32729
  let u = options.writeUnknownFields;
31500
32730
  if (u !== false)
31501
32731
  (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
@@ -41177,12 +42407,17 @@ var rpcInputKindByMethod = {
41177
42407
  79: "requestBotChatSettings",
41178
42408
  80: "invokeBotChatSettingsItem",
41179
42409
  81: "answerBotChatSettings",
42410
+ 106: "createBotAgent",
42411
+ 107: "getBotAgent",
42412
+ 108: "listBotAgents",
41180
42413
  117: "createUpload",
41181
42414
  118: "saveUploadPart",
41182
42415
  119: "getUploadState",
41183
42416
  120: "finishUpload",
41184
42417
  121: "cancelUpload",
41185
- 127: "getSpace"
42418
+ 127: "getSpace",
42419
+ 131: "updateBotAgent",
42420
+ 132: "deleteBotAgent"
41186
42421
  };
41187
42422
  var rpcResultKindByMethod = {
41188
42423
  0: undefined,
@@ -41241,12 +42476,17 @@ var rpcResultKindByMethod = {
41241
42476
  79: "requestBotChatSettings",
41242
42477
  80: "invokeBotChatSettingsItem",
41243
42478
  81: "answerBotChatSettings",
42479
+ 106: "createBotAgent",
42480
+ 107: "getBotAgent",
42481
+ 108: "listBotAgents",
41244
42482
  117: "createUpload",
41245
42483
  118: "saveUploadPart",
41246
42484
  119: "getUploadState",
41247
42485
  120: "finishUpload",
41248
42486
  121: "cancelUpload",
41249
- 127: "getSpace"
42487
+ 127: "getSpace",
42488
+ 131: "updateBotAgent",
42489
+ 132: "deleteBotAgent"
41250
42490
  };
41251
42491
 
41252
42492
  // ../sdk/dist/sdk/logger.js
@@ -43593,6 +44833,15 @@ function toInputMedia(media) {
43593
44833
  }
43594
44834
  }
43595
44835
  };
44836
+ case "voice":
44837
+ return {
44838
+ media: {
44839
+ oneofKind: "voice",
44840
+ voice: {
44841
+ voiceId: asInlineId(media.voiceId, "voiceId")
44842
+ }
44843
+ }
44844
+ };
43596
44845
  }
43597
44846
  }
43598
44847
  function normalizeHttpBaseUrl(baseUrl) {
@@ -59811,7 +61060,8 @@ async function downloadInlineMediaFromUrl(params) {
59811
61060
 
59812
61061
  // src/inline/message-formatting.ts
59813
61062
  var INLINE_FORMATTING_RULES = [
59814
- "Use Inline markdown.",
61063
+ "Use Inline's supported Markdown: emphasis, inline or fenced code, links, headings, lists or checklists, quotes, tables, separators, and HTTP(S) images.",
61064
+ "Do not rely on strikethrough, footnotes, or arbitrary HTML; unrecognized or ambiguous incomplete syntax remains visible text.",
59815
61065
  "Use ordinary Markdown tables for genuinely tabular data; never put a table in a fenced code block.",
59816
61066
  'For collapsible work, use <details open> followed by <summary>Title</summary>, body Markdown, and </details>; add kind="progress" to summary only while work is in progress.',
59817
61067
  "Use <footer>Attribution or brief metadata</footer> for a short message footer.",
@@ -60912,6 +62162,42 @@ async function getSpaceMembersWithUsers(params) {
60912
62162
  });
60913
62163
  }
60914
62164
 
62165
+ // src/inline/message-actions.ts
62166
+ var INLINE_AGENT_ACTION_PREFIX = "agent:";
62167
+ var INLINE_SYSTEM_ACTION_PREFIX = "system:";
62168
+ function resolveInlineMessageActionOwnership(actionId) {
62169
+ if (actionId.startsWith(INLINE_AGENT_ACTION_PREFIX)) {
62170
+ return { owner: "agent", explicit: true };
62171
+ }
62172
+ if (actionId.startsWith(INLINE_SYSTEM_ACTION_PREFIX)) {
62173
+ return { owner: "system", explicit: true };
62174
+ }
62175
+ return { owner: "agent", explicit: false };
62176
+ }
62177
+ function buildInlineMessageActionId(owner, rowIndex, actionIndex) {
62178
+ return `${owner}:${rowIndex + 1}:${actionIndex + 1}`;
62179
+ }
62180
+ function buildInlineAgentActionBody(params) {
62181
+ return `Inline action button pressed on message #${String(params.targetMessageId)} by ${params.actor}.`;
62182
+ }
62183
+ function buildInlineAgentActionStructuredContext(params) {
62184
+ return {
62185
+ label: "Inline action button press",
62186
+ source: "inline",
62187
+ type: "message_action",
62188
+ payload: {
62189
+ event_kind: "message.action.invoke",
62190
+ actor_user_id: String(params.actorUserId),
62191
+ chat_id: String(params.chatId),
62192
+ target_message_id: String(params.targetMessageId),
62193
+ interaction_id: String(params.interactionId),
62194
+ action_id: params.actionId,
62195
+ callback_data_base64: params.callbackDataBase64,
62196
+ ...params.callbackDataUtf8 ? { callback_data_utf8: params.callbackDataUtf8 } : {}
62197
+ }
62198
+ };
62199
+ }
62200
+
60915
62201
  // src/inline/actions.ts
60916
62202
  var ACTION_GROUPS = [
60917
62203
  {
@@ -61769,11 +63055,11 @@ function resolveInlineInteractiveButtonsParam(params) {
61769
63055
  });
61770
63056
  return rows.length > 0 ? rows : undefined;
61771
63057
  }
61772
- function toInlineMessageActions(rows) {
63058
+ function toInlineMessageActions(rows, owner) {
61773
63059
  return {
61774
63060
  rows: rows.map((row, rowIndex) => ({
61775
63061
  actions: row.map((button, buttonIndex) => ({
61776
- actionId: `btn_${rowIndex + 1}_${buttonIndex + 1}`,
63062
+ actionId: buildInlineMessageActionId(owner, rowIndex, buttonIndex),
61777
63063
  text: button.text,
61778
63064
  action: button.kind === "callback" ? {
61779
63065
  oneofKind: "callback",
@@ -61790,10 +63076,11 @@ function toInlineMessageActions(rows) {
61790
63076
  }))
61791
63077
  };
61792
63078
  }
61793
- function resolveInlineMessageActionsParam(params) {
63079
+ function resolveInlineMessageActionsParam(params, options) {
63080
+ const owner = options?.owner ?? "agent";
61794
63081
  if (!Object.prototype.hasOwnProperty.call(params, "buttons")) {
61795
63082
  const interactiveRows = resolveInlineInteractiveButtonsParam(params);
61796
- return interactiveRows ? toInlineMessageActions(interactiveRows) : undefined;
63083
+ return interactiveRows ? toInlineMessageActions(interactiveRows, owner) : undefined;
61797
63084
  }
61798
63085
  let rawButtons = params.buttons;
61799
63086
  if (typeof rawButtons === "string") {
@@ -61815,7 +63102,7 @@ function resolveInlineMessageActionsParam(params) {
61815
63102
  throw new Error("inline action: buttons must be an array of button rows");
61816
63103
  }
61817
63104
  const rows = normalizeReplyMarkupButtons(rawButtons);
61818
- return toInlineMessageActions(rows);
63105
+ return toInlineMessageActions(rows, owner);
61819
63106
  }
61820
63107
  function normalizeChatId(raw) {
61821
63108
  const normalized = normalizeInlineTarget(raw) ?? raw.trim();
@@ -65410,6 +66697,44 @@ function redactInlineBotApiUrl(raw) {
65410
66697
  }
65411
66698
  }
65412
66699
 
66700
+ // src/inline/agent-specialization.ts
66701
+ function projectInlineAgentSessionKey(baseSessionKey, agentId, specialization) {
66702
+ return agentId && specialization ? `${baseSessionKey}:inline-agent:${agentId}` : baseSessionKey;
66703
+ }
66704
+ function createInlineAgentSpecializationResolver(params) {
66705
+ const ttlMs = params.ttlMs ?? 60000;
66706
+ const maxEntries = params.maxEntries ?? 100;
66707
+ const now = params.now ?? Date.now;
66708
+ const cache = new Map;
66709
+ const loads = new Map;
66710
+ return {
66711
+ async resolve(agentId) {
66712
+ const cached3 = cache.get(agentId);
66713
+ if (cached3 && cached3.expiresAt > now())
66714
+ return cached3.value;
66715
+ const existingLoad = loads.get(agentId);
66716
+ if (existingLoad)
66717
+ return existingLoad;
66718
+ const load = params.fetchAgent(agentId).then((value) => {
66719
+ cache.delete(agentId);
66720
+ cache.set(agentId, { value, expiresAt: now() + ttlMs });
66721
+ while (cache.size > maxEntries) {
66722
+ const oldest = cache.keys().next().value;
66723
+ if (oldest === undefined)
66724
+ break;
66725
+ cache.delete(oldest);
66726
+ }
66727
+ return value;
66728
+ }).finally(() => {
66729
+ if (loads.get(agentId) === load)
66730
+ loads.delete(agentId);
66731
+ });
66732
+ loads.set(agentId, load);
66733
+ return load;
66734
+ }
66735
+ };
66736
+ }
66737
+
65413
66738
  // src/inline/sender-profile-cache.ts
65414
66739
  var DEFAULT_PROFILE_TTL_MS = 10 * 60000;
65415
66740
  var DEFAULT_MAX_PROFILES = 5000;
@@ -65443,7 +66768,8 @@ class InlineSenderProfileCache {
65443
66768
  const name = [cached3.firstName, cached3.lastName].filter(Boolean).join(" ").trim();
65444
66769
  return {
65445
66770
  ...name ? { name } : {},
65446
- ...cached3.username ? { username: cached3.username } : {}
66771
+ ...cached3.username ? { username: cached3.username } : {},
66772
+ ...cached3.bot != null ? { bot: cached3.bot } : {}
65447
66773
  };
65448
66774
  }
65449
66775
  remember(users) {
@@ -65457,6 +66783,7 @@ class InlineSenderProfileCache {
65457
66783
  ...readProfileField(user.firstName, previous?.firstName, "firstName"),
65458
66784
  ...readProfileField(user.lastName, previous?.lastName, "lastName"),
65459
66785
  ...readProfileField(normalizeInlineUsername(user.username), previous?.username, "username"),
66786
+ ...readBooleanProfileField(user.bot, previous?.bot, "bot"),
65460
66787
  expiresAt
65461
66788
  };
65462
66789
  this.profiles.delete(userId);
@@ -65476,21 +66803,34 @@ class InlineSenderProfileCache {
65476
66803
  }
65477
66804
  }
65478
66805
  async resolve(params) {
65479
- await this.hydrateChat(params.chatId);
66806
+ return (await this.resolveWithProvenance(params)).profile;
66807
+ }
66808
+ async resolveWithProvenance(params) {
66809
+ const participantHydrated = await this.hydrateChatResult(params.chatId);
65480
66810
  const participant = this.get(params.userId);
65481
- if (hasDisplayIdentity(participant))
65482
- return participant;
65483
- await this.hydrateDirectory();
66811
+ if (hasDisplayIdentity(participant)) {
66812
+ return {
66813
+ profile: participant,
66814
+ provenanceVerified: participantHydrated || participant.bot != null
66815
+ };
66816
+ }
66817
+ const directoryHydrated = await this.hydrateDirectoryResult();
65484
66818
  const resolved = this.get(params.userId);
65485
- return hasDisplayIdentity(resolved) ? resolved : undefined;
66819
+ return {
66820
+ ...hasDisplayIdentity(resolved) ? { profile: resolved } : {},
66821
+ provenanceVerified: directoryHydrated && (participantHydrated || hasDisplayIdentity(resolved))
66822
+ };
65486
66823
  }
65487
66824
  async hydrateChat(chatId) {
66825
+ await this.hydrateChatResult(chatId);
66826
+ }
66827
+ async hydrateChatResult(chatId) {
65488
66828
  const chatKey = String(chatId);
65489
66829
  const hydratedUntil = this.hydratedChats.get(chatKey) ?? 0;
65490
66830
  if (hydratedUntil > this.now()) {
65491
66831
  this.hydratedChats.delete(chatKey);
65492
66832
  this.hydratedChats.set(chatKey, hydratedUntil);
65493
- return;
66833
+ return true;
65494
66834
  }
65495
66835
  this.hydratedChats.delete(chatKey);
65496
66836
  const existing = this.participantFetches.get(chatKey);
@@ -65506,27 +66846,38 @@ class InlineSenderProfileCache {
65506
66846
  break;
65507
66847
  this.hydratedChats.delete(oldest);
65508
66848
  }
65509
- }).catch((error51) => this.options.onError?.("getChatParticipants", error51)).finally(() => this.participantFetches.delete(chatKey));
66849
+ return true;
66850
+ }).catch((error51) => {
66851
+ this.options.onError?.("getChatParticipants", error51);
66852
+ return false;
66853
+ }).finally(() => this.participantFetches.delete(chatKey));
65510
66854
  this.participantFetches.set(chatKey, run);
65511
- await run;
66855
+ return await run;
65512
66856
  }
65513
66857
  async hydrateDirectory() {
66858
+ await this.hydrateDirectoryResult();
66859
+ }
66860
+ async hydrateDirectoryResult() {
65514
66861
  if (this.directoryExpiresAt > this.now())
65515
- return;
66862
+ return true;
65516
66863
  if (this.directoryFetch)
65517
66864
  return this.directoryFetch;
65518
66865
  const run = this.options.fetchDirectoryUsers().then((users) => {
65519
66866
  this.remember(users);
65520
66867
  this.directoryExpiresAt = this.now() + this.ttlMs;
65521
- }).catch((error51) => this.options.onError?.("getChats", error51)).finally(() => {
66868
+ return true;
66869
+ }).catch((error51) => {
66870
+ this.options.onError?.("getChats", error51);
66871
+ return false;
66872
+ }).finally(() => {
65522
66873
  this.directoryFetch = null;
65523
66874
  });
65524
66875
  this.directoryFetch = run;
65525
- await run;
66876
+ return await run;
65526
66877
  }
65527
66878
  }
65528
66879
  function hasDisplayIdentity(profile) {
65529
- return Boolean(profile?.name || profile?.username);
66880
+ return Boolean(profile?.name || profile?.username || profile?.bot != null);
65530
66881
  }
65531
66882
  function normalizeInlineUsername(value) {
65532
66883
  const username = value?.trim().replace(/^@+/u, "");
@@ -65536,6 +66887,10 @@ function readProfileField(value, previous, key) {
65536
66887
  const resolved = value?.trim() || previous;
65537
66888
  return resolved ? { [key]: resolved } : {};
65538
66889
  }
66890
+ function readBooleanProfileField(value, previous, key) {
66891
+ const resolved = value ?? previous;
66892
+ return resolved == null ? {} : { [key]: resolved };
66893
+ }
65539
66894
 
65540
66895
  // src/inline/command-ui.ts
65541
66896
  var MODEL_LABEL_LIMIT = 38;
@@ -66772,8 +68127,8 @@ async function dispatchInlineReplyWithSessionInitRetry(params) {
66772
68127
  let retries = 0;
66773
68128
  while (true) {
66774
68129
  try {
66775
- await params.run();
66776
- return retries;
68130
+ const result = await params.run();
68131
+ return { result, retries };
66777
68132
  } catch (error51) {
66778
68133
  const delayMs = INLINE_REPLY_SESSION_INIT_RETRY_DELAYS_MS[retries];
66779
68134
  if (delayMs == null || !params.shouldRetry() || !INLINE_REPLY_SESSION_INIT_CONFLICT_RE.test(String(error51))) {
@@ -66785,6 +68140,12 @@ async function dispatchInlineReplyWithSessionInitRetry(params) {
66785
68140
  }
66786
68141
  }
66787
68142
  }
68143
+ function normalizeInlineDispatchResult(value) {
68144
+ return isRecord6(value) ? value : {};
68145
+ }
68146
+ function inlineReplyDeliveryResult(visibleReplySent) {
68147
+ return visibleReplySent ? { visibleReplySent: true } : { visibleReplySent: false, suppression: { reason: "no_visible_result" } };
68148
+ }
66788
68149
 
66789
68150
  class OpenClawBotChatSettingsMutationError extends Error {
66790
68151
  }
@@ -68097,7 +69458,8 @@ function normalizeReplyMarkupButtonsWith(raw, options) {
68097
69458
  }
68098
69459
  return rows;
68099
69460
  }
68100
- function resolveInlineReplyActions(payload) {
69461
+ function resolveInlineReplyActions(payload, options) {
69462
+ const owner = options?.owner ?? "agent";
68101
69463
  const channelData = isRecord6(payload.channelData) ? payload.channelData : undefined;
68102
69464
  const inlineData = channelData && isRecord6(channelData.inline) ? channelData.inline : undefined;
68103
69465
  const telegramData = channelData && isRecord6(channelData.telegram) ? channelData.telegram : undefined;
@@ -68116,13 +69478,13 @@ function resolveInlineReplyActions(payload) {
68116
69478
  hasExplicitButtons = true;
68117
69479
  }
68118
69480
  if (!hasExplicitButtons) {
68119
- return resolveInlineMessageActionsParam(payload);
69481
+ return resolveInlineMessageActionsParam(payload, { owner });
68120
69482
  }
68121
69483
  const rows = normalizeReplyMarkupButtonsWith(rawButtons, mapCallbackData ? { mapCallbackData } : undefined);
68122
69484
  return {
68123
69485
  rows: rows.map((row, rowIndex) => ({
68124
69486
  actions: row.map((button, buttonIndex) => ({
68125
- actionId: `btn_${rowIndex + 1}_${buttonIndex + 1}`,
69487
+ actionId: buildInlineMessageActionId(owner, rowIndex, buttonIndex),
68126
69488
  text: button.text,
68127
69489
  action: button.kind === "callback" ? {
68128
69490
  oneofKind: "callback",
@@ -68591,6 +69953,8 @@ function buildInlineUntrustedStructuredContext(params) {
68591
69953
  append("Current Inline message entities", "current_message_entities", params.currentEntityText);
68592
69954
  append("Recent Inline media/attachments", "recent_media_attachments", params.historyAttachmentText);
68593
69955
  append("Recent Inline message entities", "recent_message_entities", params.historyEntityText);
69956
+ if (params.actionContext)
69957
+ entries.push(params.actionContext);
68594
69958
  return entries;
68595
69959
  }
68596
69960
  function resolveInlineMediaMaxBytes(params) {
@@ -69059,6 +70423,25 @@ async function monitorInlineProvider(params) {
69059
70423
  const botMessageIdsByChat = new Map;
69060
70424
  const seenInboundMessageInstances = new Map;
69061
70425
  const groupPendingHistories = new Map;
70426
+ const inlineAgentResolver = createInlineAgentSpecializationResolver({
70427
+ fetchAgent: async (agentId) => {
70428
+ const result = await callInlineBotApi({
70429
+ baseUrl: botApiBaseUrl,
70430
+ token,
70431
+ methodName: "getAgent",
70432
+ method: "GET",
70433
+ query: { agent_id: agentId }
70434
+ });
70435
+ const agent = result.agent;
70436
+ if (!agent?.name)
70437
+ return null;
70438
+ return {
70439
+ name: agent.name,
70440
+ ...agent.skill_key ? { skillKey: agent.skill_key } : {},
70441
+ ...agent.instructions ? { instructions: agent.instructions } : {}
70442
+ };
70443
+ }
70444
+ });
69062
70445
  const inboundMediaMaxBytes = resolveInlineMediaMaxBytes({ cfg, account });
69063
70446
  const hydrateChatParticipants = (chatId) => senderProfilesById.hydrateChat(chatId);
69064
70447
  const resolveInlineSystemEventContext = async (params2) => {
@@ -69395,12 +70778,26 @@ async function monitorInlineProvider(params) {
69395
70778
  defaultLimit: account.config.replyThreadParentHistoryLimit ?? inlineThreadDefaults.replyThreadParentHistoryLimit ?? DEFAULT_REPLY_THREAD_PARENT_HISTORY_LIMIT
69396
70779
  }) : DEFAULT_REPLY_THREAD_PARENT_HISTORY_LIMIT;
69397
70780
  const senderId = String(msg.fromId);
69398
- const senderProfile = await senderProfilesById.resolve({ userId: senderId, chatId });
70781
+ const senderResolution = await senderProfilesById.resolveWithProvenance({ userId: senderId, chatId });
70782
+ const senderProfile = senderResolution.profile;
70783
+ const explicitlyMentionsThisBot = collectInlineMentionedUserIds(currentContent).includes(String(meId));
70784
+ if (!senderResolution.provenanceVerified && !explicitlyMentionsThisBot) {
70785
+ runtime.log?.(`inline: observe sender with unverified bot provenance chat=${String(chatId)} sender=${senderId}`);
70786
+ return;
70787
+ }
70788
+ if (senderProfile?.bot === true && !explicitlyMentionsThisBot) {
70789
+ runtime.log?.(`inline: observe ambient bot message chat=${String(chatId)} sender=${senderId}`);
70790
+ return;
70791
+ }
69399
70792
  const senderUsername = senderProfile?.username;
69400
70793
  const senderName = isGroup ? senderProfile?.name : resolveInlineDirectSenderName({ profileName: senderProfile?.name, chatTitle: chatInfo.title, senderId });
70794
+ const callbackActionOwnership = callbackActionEvent ? resolveInlineMessageActionOwnership(callbackActionEvent.actionId) : null;
69401
70795
  if (callbackActionEvent) {
69402
70796
  const actor = senderUsername != null && senderUsername.length > 0 ? `@${senderUsername}` : senderName ?? "the sender";
69403
- rawBody = `${actor} pressed "${callbackActionEvent.actionId}" on message #${String(callbackActionEvent.targetMessageId)}`;
70797
+ rawBody = buildInlineAgentActionBody({
70798
+ actor,
70799
+ targetMessageId: callbackActionEvent.targetMessageId
70800
+ });
69404
70801
  }
69405
70802
  const dmPolicy = account.config.dmPolicy ?? "pairing";
69406
70803
  const defaultGroupPolicy = cfg.channels?.defaults?.groupPolicy;
@@ -69425,7 +70822,8 @@ async function monitorInlineProvider(params) {
69425
70822
  const effectiveAllowFrom = [...configAllowFrom, ...storeAllowList].filter(Boolean);
69426
70823
  const effectiveGroupAllowFrom = groupSenderAllowlist.expanded.filter(Boolean);
69427
70824
  const effectiveGroupCommandAllowFrom = effectiveGroupAllowFrom;
69428
- const callbackCommandBody = callbackActionEvent ? resolveCallbackCommandBodyFromActionData({
70825
+ const shouldRouteCallbackThroughSystemHandlers = callbackActionEvent != null && (callbackActionOwnership?.owner === "system" || callbackActionOwnership?.explicit === false);
70826
+ const callbackCommandBody = callbackActionEvent && shouldRouteCallbackThroughSystemHandlers ? resolveCallbackCommandBodyFromActionData({
69429
70827
  data: callbackActionEvent.data,
69430
70828
  ...botUsername ? { botUsername } : {}
69431
70829
  }) : undefined;
@@ -69571,7 +70969,8 @@ async function monitorInlineProvider(params) {
69571
70969
  channel: CHANNEL_ID,
69572
70970
  idLine: `Your Inline user id: ${senderId}`,
69573
70971
  code
69574
- })
70972
+ }),
70973
+ parseMarkdown: account.config.parseMarkdown ?? true
69575
70974
  });
69576
70975
  publishStatus({ lastOutboundAt: Date.now() });
69577
70976
  } catch (err) {
@@ -69776,7 +71175,7 @@ async function monitorInlineProvider(params) {
69776
71175
  getCurrentConversationBinding: async () => null
69777
71176
  });
69778
71177
  const resultRecord = result;
69779
- const actions = resolveInlineReplyActions(resultRecord);
71178
+ const actions = resolveInlineReplyActions(resultRecord, { owner: "system" });
69780
71179
  const text = typeof result.text === "string" ? sanitizeInlineDeliveryText(result.text) : "";
69781
71180
  if (text || actions) {
69782
71181
  let delivered = false;
@@ -69817,7 +71216,7 @@ async function monitorInlineProvider(params) {
69817
71216
  return;
69818
71217
  }
69819
71218
  }
69820
- const commandsPageCallback = callbackActionEvent ? parseInlineCommandsPageCallback(callbackDataToUtf8(callbackActionEvent.data)) : null;
71219
+ const commandsPageCallback = callbackActionEvent && shouldRouteCallbackThroughSystemHandlers ? parseInlineCommandsPageCallback(callbackDataToUtf8(callbackActionEvent.data)) : null;
69821
71220
  if (shouldEditCallbackTargetInPlace && callbackActionEvent && commandsPageCallback) {
69822
71221
  if (commandsPageCallback.page === "noop")
69823
71222
  return;
@@ -69836,7 +71235,7 @@ async function monitorInlineProvider(params) {
69836
71235
  totalPages: paginated.totalPages,
69837
71236
  agentId
69838
71237
  }) ?? { inline: { buttons: [] } }
69839
- }) ?? { rows: [] };
71238
+ }, { owner: "system" }) ?? { rows: [] };
69840
71239
  const text = sanitizeInlineDeliveryText(paginated.text);
69841
71240
  try {
69842
71241
  const result = await client.invokeRaw(Method.EDIT_MESSAGE, {
@@ -69878,7 +71277,7 @@ async function monitorInlineProvider(params) {
69878
71277
  buttons: nativeCommandMenu.buttons
69879
71278
  }
69880
71279
  }
69881
- });
71280
+ }, { owner: "system" });
69882
71281
  const menuText = sanitizeInlineDeliveryText(nativeCommandMenu.title);
69883
71282
  let deliveredNativeMenu = false;
69884
71283
  if (shouldEditCallbackTargetInPlace && callbackActionEvent) {
@@ -69905,7 +71304,8 @@ async function monitorInlineProvider(params) {
69905
71304
  const sent = await client.sendMessage({
69906
71305
  chatId,
69907
71306
  text: menuText,
69908
- ...menuActions ? { actions: menuActions } : {}
71307
+ ...menuActions ? { actions: menuActions } : {},
71308
+ parseMarkdown
69909
71309
  });
69910
71310
  rememberSentBotMessage({ chatId, messageId: sent.messageId, replyThreadContext });
69911
71311
  }
@@ -69915,7 +71315,7 @@ async function monitorInlineProvider(params) {
69915
71315
  });
69916
71316
  return;
69917
71317
  }
69918
- const modelPickerCallbackData = callbackActionEvent ? callbackDataToUtf8(callbackActionEvent.data) : undefined;
71318
+ const modelPickerCallbackData = callbackActionEvent && shouldRouteCallbackThroughSystemHandlers ? callbackDataToUtf8(callbackActionEvent.data) : undefined;
69919
71319
  const modelPickerCallback = modelPickerCallbackData ? parseInlineModelPickerCallback(modelPickerCallbackData) : null;
69920
71320
  if (shouldEditCallbackTargetInPlace && callbackActionEvent && modelPickerCallback?.type === "select") {
69921
71321
  const deliverModelPickerEdit = async (text, buttons) => {
@@ -69926,7 +71326,7 @@ async function monitorInlineProvider(params) {
69926
71326
  buttons
69927
71327
  }
69928
71328
  }
69929
- }) ?? { rows: [] };
71329
+ }, { owner: "system" }) ?? { rows: [] };
69930
71330
  try {
69931
71331
  const result = await client.invokeRaw(Method.EDIT_MESSAGE, {
69932
71332
  oneofKind: "editMessage",
@@ -70006,6 +71406,10 @@ This model will be used for your next message.`, []);
70006
71406
  });
70007
71407
  return;
70008
71408
  }
71409
+ if (callbackActionEvent && callbackActionOwnership?.owner === "system" && callbackActionOwnership.explicit && callbackCommandBody == null) {
71410
+ runtime.log?.(`inline: drop unhandled system action ${callbackActionEvent.actionId} ` + `message=${String(callbackActionEvent.targetMessageId)}`);
71411
+ return;
71412
+ }
70009
71413
  let deliveryReplyThreadContext = replyThreadContext;
70010
71414
  const explicitReplyThreadIntent = replyThreadsEnabled && !deliveryReplyThreadContext && hasExplicitInlineReplyThreadIntent(rawBody);
70011
71415
  const shouldCreateDeliveryThread = replyThreadsEnabled && !deliveryReplyThreadContext && shouldCreateInlineReplyThreadDelivery({
@@ -70150,27 +71554,13 @@ This model will be used for your next message.`, []);
70150
71554
  let inlineAgent = null;
70151
71555
  if (inlineAgentId) {
70152
71556
  try {
70153
- const result = await callInlineBotApi({
70154
- baseUrl: botApiBaseUrl,
70155
- token,
70156
- methodName: "getAgent",
70157
- method: "GET",
70158
- query: { agent_id: inlineAgentId }
70159
- });
70160
- const agent = result.agent;
70161
- if (agent?.name) {
70162
- inlineAgent = {
70163
- name: agent.name,
70164
- ...agent.skill_key ? { skillKey: agent.skill_key } : {},
70165
- ...agent.instructions ? { instructions: agent.instructions } : {}
70166
- };
70167
- }
71557
+ inlineAgent = await inlineAgentResolver.resolve(inlineAgentId);
70168
71558
  } catch (error51) {
70169
71559
  runtime.error?.(`inline: failed to resolve mentioned Agent ${inlineAgentId}: ${String(error51)}`);
70170
71560
  }
70171
71561
  }
70172
71562
  const baseDeliverySessionKey = deliveryReplyThreadContext && isGroup ? buildInlineReplyThreadSessionKey(route.sessionKey, deliveryReplyThreadContext.childChatId) : route.sessionKey;
70173
- const deliverySessionKey = inlineAgentId ? `${baseDeliverySessionKey}:inline-agent:${inlineAgentId}` : baseDeliverySessionKey;
71563
+ const deliverySessionKey = projectInlineAgentSessionKey(baseDeliverySessionKey, inlineAgentId, inlineAgent);
70174
71564
  const groupHistoryKey = isGroup ? deliveryReplyThreadContext ? deliverySessionKey : route.sessionKey : null;
70175
71565
  const inboundMedia = await resolveInlineInboundMedia({
70176
71566
  core: core3,
@@ -70195,12 +71585,24 @@ This model will be used for your next message.`, []);
70195
71585
  pendingEntries: groupPendingHistories.get(groupHistoryKey) ?? [],
70196
71586
  limit: historyLimit
70197
71587
  }) : effectiveHistoryContext.inboundHistory;
71588
+ const actionCallbackDataUtf8 = callbackActionEvent ? callbackDataToUtf8(callbackActionEvent.data) : undefined;
70198
71589
  const untrustedStructuredContext = buildInlineUntrustedStructuredContext({
70199
71590
  currentAttachmentText,
70200
71591
  currentEntityText: currentEntityTextForAgent,
70201
71592
  currentBody,
70202
71593
  historyAttachmentText: effectiveHistoryContext.attachmentText,
70203
- historyEntityText: effectiveHistoryContext.entityText
71594
+ historyEntityText: effectiveHistoryContext.entityText,
71595
+ ...callbackActionEvent ? {
71596
+ actionContext: buildInlineAgentActionStructuredContext({
71597
+ actorUserId: msg.fromId,
71598
+ chatId,
71599
+ targetMessageId: callbackActionEvent.targetMessageId,
71600
+ interactionId: callbackActionEvent.interactionId,
71601
+ actionId: callbackActionEvent.actionId,
71602
+ callbackDataBase64: callbackDataToBase64(callbackActionEvent.data),
71603
+ ...actionCallbackDataUtf8 ? { callbackDataUtf8: actionCallbackDataUtf8 } : {}
71604
+ })
71605
+ } : {}
70204
71606
  });
70205
71607
  const inboundEventKind = classifyChannelInboundEvent({
70206
71608
  conversation: { kind: isGroup ? "group" : "direct" },
@@ -70420,7 +71822,8 @@ This model will be used for your next message.`, []);
70420
71822
  const sent = await client.sendMessage({
70421
71823
  chatId: deliveryChatId,
70422
71824
  text,
70423
- sendMode: "silent"
71825
+ sendMode: "silent",
71826
+ parseMarkdown
70424
71827
  });
70425
71828
  if (sent.messageId == null) {
70426
71829
  throw new Error("inline progress placeholder: sendMessage returned no messageId");
@@ -70437,7 +71840,8 @@ This model will be used for your next message.`, []);
70437
71840
  editMessage: {
70438
71841
  messageId: progressState.messageId,
70439
71842
  peerId: buildChatPeer3(deliveryChatId),
70440
- text
71843
+ text,
71844
+ parseMarkdown
70441
71845
  }
70442
71846
  });
70443
71847
  if (result.oneofKind !== "editMessage") {
@@ -70945,16 +72349,16 @@ This model will be used for your next message.`, []);
70945
72349
  };
70946
72350
  try {
70947
72351
  let delivered = false;
70948
- let deliveryAttempted = false;
70949
72352
  let skippedNonSilent = false;
70950
72353
  let skippedSilently = false;
70951
72354
  let failedNonSilent = false;
70952
72355
  let dispatchError = null;
72356
+ let dispatchResult = {};
70953
72357
  let streamedFinalEditRejected = false;
70954
72358
  let undeliveredFinalText = "";
70955
72359
  let undeliveredFinalActions;
70956
72360
  try {
70957
- const sessionInitRetries = await dispatchInlineReplyWithSessionInitRetry({
72361
+ const dispatch = await dispatchInlineReplyWithSessionInitRetry({
70958
72362
  shouldRetry: () => !delivered && !skippedNonSilent && !failedNonSilent,
70959
72363
  onRetry: (retry, delayMs) => {
70960
72364
  log?.warn(`[${account.accountId}] AGENT_DISPATCH_TRACE phase=session_init_conflict_retry ` + `retry=${retry} delay_ms=${delayMs}`);
@@ -70966,14 +72370,19 @@ This model will be used for your next message.`, []);
70966
72370
  ...dispatcherPipelineOptions,
70967
72371
  ...buildInlineTypingDispatcherOptions(typingCallbacks),
70968
72372
  deliver: async (payload, info) => {
70969
- deliveryAttempted = true;
72373
+ let payloadVisible = false;
72374
+ const markPayloadVisible = () => {
72375
+ delivered = true;
72376
+ payloadVisible = true;
72377
+ };
72378
+ const finishPayload = () => inlineReplyDeliveryResult(payloadVisible);
70970
72379
  const presenceSignal = resolveInlineBotPresenceSignal(payload);
70971
72380
  if (presenceSignal) {
70972
72381
  botPresenceLifecycle.express(presenceSignal);
70973
72382
  }
70974
72383
  const visiblePayload = resolveInlineChatVisibleReplyPayload(payload);
70975
72384
  if (!visiblePayload)
70976
- return;
72385
+ return finishPayload();
70977
72386
  await cleanupInlineProgressPlaceholder();
70978
72387
  const payloadRecord = visiblePayload;
70979
72388
  const rawText = resolveInlineInteractiveTextFallback({
@@ -71017,7 +72426,7 @@ This model will be used for your next message.`, []);
71017
72426
  ...includeActions && outboundActions !== undefined ? { actions: outboundActions } : {},
71018
72427
  parseMarkdown
71019
72428
  });
71020
- delivered = true;
72429
+ markPayloadVisible();
71021
72430
  try {
71022
72431
  rememberSent(sent.messageId);
71023
72432
  } catch (error51) {
@@ -71026,7 +72435,7 @@ This model will be used for your next message.`, []);
71026
72435
  } catch (error51) {
71027
72436
  if (!isInlineSendOutcomeUnknown(error51))
71028
72437
  throw error51;
71029
- delivered = true;
72438
+ markPayloadVisible();
71030
72439
  runtime.error?.(`inline text delivery outcome is unknown; suppressing duplicate (${String(error51)})`);
71031
72440
  }
71032
72441
  };
@@ -71084,12 +72493,12 @@ This model will be used for your next message.`, []);
71084
72493
  if (shouldEditCallbackTargetInPlace && editStreamState.messageId != null) {
71085
72494
  const callbackEditActions = outboundActions ?? { rows: [] };
71086
72495
  if (!outboundText.trim() && outboundActions === undefined) {
71087
- return;
72496
+ return finishPayload();
71088
72497
  }
71089
72498
  await updateStreamedMessage(outboundText, callbackEditActions);
71090
- delivered = true;
72499
+ markPayloadVisible();
71091
72500
  publishStatus({ lastOutboundAt: Date.now() });
71092
- return;
72501
+ return finishPayload();
71093
72502
  }
71094
72503
  if (streamViaEditMessage && infoKind === "final" && finalDeliveredForCurrentAssistantMessage && editStreamState.messageId != null) {
71095
72504
  await resetEditStreamForAssistantMessage();
@@ -71099,25 +72508,26 @@ This model will be used for your next message.`, []);
71099
72508
  editStreamState.finalTextAccumulator += outboundText;
71100
72509
  }
71101
72510
  if (!editStreamState.finalTextAccumulator.trim() && outboundActions === undefined) {
71102
- return;
72511
+ markPayloadVisible();
72512
+ return finishPayload();
71103
72513
  }
71104
72514
  await updateStreamedMessage(editStreamState.finalTextAccumulator, outboundActions);
71105
- delivered = true;
72515
+ markPayloadVisible();
71106
72516
  if (infoKind === "final") {
71107
72517
  finalDeliveredForCurrentAssistantMessage = true;
71108
72518
  }
71109
72519
  publishStatus({ lastOutboundAt: Date.now() });
71110
- return;
72520
+ return finishPayload();
71111
72521
  }
71112
72522
  if (!outboundText.trim())
71113
- return;
72523
+ return finishPayload();
71114
72524
  if (streamViaEditMessage && editStreamState.initialSendMayHaveLanded) {
71115
- delivered = true;
71116
- return;
72525
+ markPayloadVisible();
72526
+ return finishPayload();
71117
72527
  }
71118
72528
  await sendTextFallback(outboundText, true, true);
71119
72529
  publishStatus({ lastOutboundAt: Date.now() });
71120
- return;
72530
+ return finishPayload();
71121
72531
  }
71122
72532
  if (streamViaEditMessage && editStreamState.messageId != null && outboundText.trim()) {
71123
72533
  await updateStreamedMessage(outboundText, outboundActions);
@@ -71133,7 +72543,7 @@ This model will be used for your next message.`, []);
71133
72543
  if (partialDelivery) {
71134
72544
  const result = await partialDelivery;
71135
72545
  if (result.sent) {
71136
- delivered = true;
72546
+ markPayloadVisible();
71137
72547
  if (result.commitOutcomeUnknown) {
71138
72548
  continue;
71139
72549
  }
@@ -71193,7 +72603,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
71193
72603
  ...shouldAttachActionsToMedia && outboundActions !== undefined ? { actions: outboundActions } : {},
71194
72604
  ...caption ? { parseMarkdown } : {}
71195
72605
  });
71196
- delivered = true;
72606
+ markPayloadVisible();
71197
72607
  try {
71198
72608
  rememberSent(sent.messageId);
71199
72609
  } catch (error51) {
@@ -71201,7 +72611,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
71201
72611
  }
71202
72612
  } catch (error51) {
71203
72613
  if (isInlineSendOutcomeUnknown(error51)) {
71204
- delivered = true;
72614
+ markPayloadVisible();
71205
72615
  runtime.error?.(`inline media delivery outcome is unknown; suppressing duplicate (${String(error51)})`);
71206
72616
  continue;
71207
72617
  }
@@ -71213,6 +72623,7 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
71213
72623
  }
71214
72624
  }
71215
72625
  publishStatus({ lastOutboundAt: Date.now() });
72626
+ return finishPayload();
71216
72627
  },
71217
72628
  onSkip: (_payload, info) => {
71218
72629
  if (info?.reason === "silent") {
@@ -71230,8 +72641,9 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
71230
72641
  replyOptions
71231
72642
  })
71232
72643
  });
71233
- if (sessionInitRetries > 0) {
71234
- log?.info(`[${account.accountId}] AGENT_DISPATCH_TRACE phase=session_init_conflict_recovered ` + `retries=${sessionInitRetries}`);
72644
+ dispatchResult = normalizeInlineDispatchResult(dispatch.result);
72645
+ if (dispatch.retries > 0) {
72646
+ log?.info(`[${account.accountId}] AGENT_DISPATCH_TRACE phase=session_init_conflict_recovered ` + `retries=${dispatch.retries}`);
71235
72647
  }
71236
72648
  } catch (error51) {
71237
72649
  dispatchError = error51;
@@ -71247,7 +72659,12 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
71247
72659
  if (!delivered && streamViaEditMessage && (editStreamState.messageId != null || editStreamState.initialSendMayHaveLanded) && !streamedFinalEditRejected) {
71248
72660
  delivered = true;
71249
72661
  }
71250
- if (!delivered && !skippedSilently && (!deliveryAttempted || dispatchError != null || skippedNonSilent || failedNonSilent)) {
72662
+ const hostHandledTurn = dispatchResult.queuedFinal === true || dispatchResult.observedReplyDelivery === true || dispatchResult.noVisibleReplyFallbackDelivered === true;
72663
+ const deliberateSilence = skippedSilently || dispatchResult.deliberateSilentTerminalReply === true;
72664
+ const skipFallbackSuppressed = dispatchResult.sourceReplyDeliveryMode === "message_tool_only";
72665
+ const hostRequestedNoVisibleRecovery = dispatchResult.noVisibleReplyFallbackEligible === true;
72666
+ const explicitFailure = dispatchError != null || failedNonSilent;
72667
+ if (!delivered && (explicitFailure || !hostHandledTurn && !deliberateSilence && (skippedNonSilent && !skipFallbackSuppressed || hostRequestedNoVisibleRecovery))) {
71251
72668
  botPresenceLifecycle.fail();
71252
72669
  const fallbackText = undeliveredFinalText.trim() ? undeliveredFinalText : dispatchError != null ? INLINE_REQUEST_ERROR_FALLBACK : EMPTY_RESPONSE_FALLBACK;
71253
72670
  const sent = await client.sendMessage({
@@ -71336,7 +72753,8 @@ Attachment: ${mediaUrl}` : `Attachment: ${mediaUrl}`;
71336
72753
  return;
71337
72754
  client.sendMessage({
71338
72755
  chatId,
71339
- text: INLINE_DEBOUNCE_ERROR_FALLBACK
72756
+ text: INLINE_DEBOUNCE_ERROR_FALLBACK,
72757
+ parseMarkdown: account.config.parseMarkdown ?? true
71340
72758
  }).then(() => {
71341
72759
  publishStatus({ lastOutboundAt: Date.now() });
71342
72760
  }).catch((sendErr) => {
@@ -74550,7 +75968,7 @@ var inlineChannelPlugin = {
74550
75968
  "- Inline discovery: use `channel-list` to discover available chats and users. Use `scope: groups|peers|all` when helpful, and reuse returned `target` values.",
74551
75969
  "- Inline markdown links: in visible replies, link returned users as `[@name](inline://user?id=<userId>)` and returned chats/threads as `[title](inline://chat?id=<chatId>)` or `[title](inline://thread?id=<chatId>)`. Use `target` values only for tool calls.",
74552
75970
  ...supportsInlineMessageButtonsForConfig(cfg, accountId ?? null) ? [
74553
- "- Prefer Inline buttons/selects for 2-5 discrete choices or parameter picks instead of asking the user to type one. Use `presentation` blocks for shared buttons/selects, or `buttons` rows with `callback_data` for callbacks and `copy_text`/`copyText` for copy buttons. For quick button feedback, JSON `callback_data` can include `callbackToast`/`toast`."
75971
+ "- Prefer Inline buttons/selects for 2-5 discrete choices or parameter picks instead of asking the user to type one. Use `presentation` blocks for shared buttons/selects, or `buttons` rows with `callback_data` for callbacks and `copy_text`/`copyText` for copy buttons. For quick button feedback, JSON `callback_data` can include `callbackToast`/`toast`. A callback turn identifies the source message; your normal response replaces that message, omitting buttons clears them, and returning buttons replaces them."
74554
75972
  ] : [],
74555
75973
  ...supportsInlineReactionsForConfig(cfg, accountId ?? null) ? [
74556
75974
  "- Inline reactions: pass `messageId` for `react` when you have it; on inbound turns, the current inbound message id can be used as fallback."
@@ -74936,5 +76354,5 @@ export {
74936
76354
  inlineChannelPlugin
74937
76355
  };
74938
76356
 
74939
- //# debugId=D5786502DB64433864756E2164756E21
76357
+ //# debugId=46E778A45E078CF864756E2164756E21
74940
76358
  //# sourceMappingURL=channel-plugin-api.js.map